summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-25 03:12:19 +0200
committerLennart Poettering <lennart@poettering.net>2010-08-25 03:12:19 +0200
commit44bcea66542e398fcada22ba9cb24d07bd8e04ef (patch)
treec35cacf13df0f608c2d62d92cd5dca7b06e53846
parentd3689161a2870a56ba5a2837daa2ca3463e24710 (diff)
log: SCM_CREDENTIALS will be added by the kernel anyway, so there's no need to write them manually
-rw-r--r--src/log.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/log.c b/src/log.c
index 3c42e8e517..21fc9f4fa0 100644
--- a/src/log.c
+++ b/src/log.c
@@ -248,11 +248,6 @@ static int write_to_syslog(
char header_priority[16], header_time[64], header_pid[16];
struct iovec iovec[5];
struct msghdr msghdr;
- union {
- struct cmsghdr cmsghdr;
- uint8_t buf[CMSG_SPACE(sizeof(struct ucred))];
- } control;
- struct ucred *ucred;
time_t t;
struct tm *tm;
@@ -279,21 +274,9 @@ static int write_to_syslog(
IOVEC_SET_STRING(iovec[3], header_pid);
IOVEC_SET_STRING(iovec[4], buffer);
- zero(control);
- control.cmsghdr.cmsg_level = SOL_SOCKET;
- control.cmsghdr.cmsg_type = SCM_CREDENTIALS;
- control.cmsghdr.cmsg_len = CMSG_LEN(sizeof(struct ucred));
-
- ucred = (struct ucred*) CMSG_DATA(&control.cmsghdr);
- ucred->pid = getpid();
- ucred->uid = getuid();
- ucred->gid = getgid();
-
zero(msghdr);
msghdr.msg_iov = iovec;
msghdr.msg_iovlen = ELEMENTSOF(iovec);
- msghdr.msg_control = &control;
- msghdr.msg_controllen = control.cmsghdr.cmsg_len;
if (sendmsg(syslog_fd, &msghdr, MSG_NOSIGNAL) < 0)
return -errno;