]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
daemon: unset UPSTART_JOB and NOTIFY_SOCKET once used
authorVincent Bernat <bernat@luffy.cx>
Wed, 1 Jan 2014 13:00:33 +0000 (14:00 +0100)
committerVincent Bernat <bernat@luffy.cx>
Wed, 1 Jan 2014 13:00:33 +0000 (14:00 +0100)
While we shouldn't have children that use those environment variables,
better safe than sorry.

src/daemon/lldpd.c

index f3cc7fe14dab914beb1fde0187119033bb0836aa..59c0cee1c9bcc440b680b1d44ba3cfef8d99a45c 100644 (file)
@@ -1196,6 +1196,7 @@ lldpd_started_by_upstart()
                return 0;
        log_debug("main", "running with upstart, don't fork but stop");
        raise(SIGSTOP);
+       unsetenv("UPSTART_JOB");
        return 1;
 #else
        return 0;
@@ -1237,6 +1238,7 @@ lldpd_started_by_systemd()
                .msg_iov = &iov,
                .msg_iovlen = 1
        };
+       unsetenv("NOTIFY_SOCKET");
        if (sendmsg(fd, &hdr, MSG_NOSIGNAL) < 0) {
                log_warn("main", "unable to send notification to systemd");
                close(fd);