summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-07-28 13:08:20 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-07-28 13:08:20 +0000
commit551c8a81b850dfb1351d66ae288be6ab45b69f55 (patch)
tree98973ece20426b6a9297790fb9964896d521f0b6 /usr.sbin
parent00f501ce1b0db92f3e13fb9d99ff8616db7f7aac (diff)
Should set user and group on unix domain sockets as reported by Juan Vera.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/inetd/inetd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index 1d539cf911d..28893a7b21a 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inetd.c,v 1.118 2004/06/30 07:58:12 otto Exp $ */
+/* $OpenBSD: inetd.c,v 1.119 2004/07/28 13:08:19 millert Exp $ */
/*
* Copyright (c) 1983,1991 The Regents of the University of California.
@@ -37,7 +37,7 @@ char copyright[] =
#ifndef lint
/*static const char sccsid[] = "from: @(#)inetd.c 5.30 (Berkeley) 6/3/91";*/
-static const char rcsid[] = "$OpenBSD: inetd.c,v 1.118 2004/06/30 07:58:12 otto Exp $";
+static const char rcsid[] = "$OpenBSD: inetd.c,v 1.119 2004/07/28 13:08:19 millert Exp $";
#endif /* not lint */
/*
@@ -1961,6 +1961,12 @@ spawn(struct servtab *sep, int ctrl)
pwd->pw_gid = grp->gr_gid;
tmpint |= LOGIN_SETGROUP;
}
+ if (sep->se_family == AF_UNIX &&
+ chown(sep->se_ctrladdr_un.sun_path,
+ pwd->pw_uid, pwd->pw_gid) < 0)
+ syslog(LOG_WARNING,
+ "%s/%s: UNIX domain socket: %m",
+ sep->se_service, sep->se_proto);
if (setusercontext(NULL, pwd, pwd->pw_uid,
tmpint) < 0) {
syslog(LOG_ERR,