create an empty directory "/var/run/lldpd" (it needs to be owned by
root, not "_lldpd"!).
-lldpctl allows to query information collected through the command line.
+lldpctl allows to query information collected through the command
+line. If you don't want to run it as root, just install it setuid or
+setgid _lldpd.
lldpd also implements CDP (Cisco Discovery Protocol), FDP (Foundry
Discovery Protocol), SONMP (Nortel Discovery Protocol) and EDP
--no-create-home --quiet --force-badname --group _lldpd
[ -d /var/run/lldpd ] || mkdir -p /var/run/lldpd
+for i in /usr/sbin/lldpctl; do
+ if ! dpkg-statoverride --list $i > /dev/null 2>&1; then
+ dpkg-statoverride --update --add _lldpd _lldpd 4750 $i
+ fi
+done
+
#DEBHELPER#
exit 0
int monitored = -1; /* Child */
int sock = -1;
+/* UID/GID of unprivileged user */
+gid_t gid = 0;
+uid_t uid = 0;
+
/* Proxies */
void
must_write(remote, &rc, sizeof(int));
return;
}
+ if (chown(LLDPD_CTL_SOCKET, uid, gid) == -1)
+ LLOG_WARN("[priv]: unable to chown control socket");
+ if (chmod(LLDPD_CTL_SOCKET,
+ S_IRUSR | S_IWUSR | S_IXUSR |
+ S_IRGRP | S_IWGRP | S_IXGRP) == -1)
+ LLOG_WARN("[priv]: unable to chmod control socket");
must_write(remote, &rc, sizeof(int));
send_fd(remote, rc);
close(rc);
addr->sun_path[sizeof(addr->sun_path)-1] = '\0';
if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) {
- LLOG_WARN("cannot open socket");
+ LLOG_WARN("[priv]: cannot open socket");
must_write(remote, &sock, sizeof(int));
return;
}
if ((rc = connect(sock, (struct sockaddr *) addr,
sizeof(struct sockaddr_un))) != 0) {
- LLOG_WARN("cannot connect to %s", addr->sun_path);
+ LLOG_WARN("[priv]: cannot connect to %s", addr->sun_path);
close(sock);
rc = -1;
must_write(remote, &rc, sizeof(int));
{
int pair[2];
struct passwd *user;
- uid_t uid;
struct group *group;
- gid_t gid;
gid_t gidset[1];
/* Create socket pair */