A colon is the preferred way to split a user and group name pair; make this

possible and depreciate the use of dot.
This commit is contained in:
ad 1999-10-06 21:54:10 +00:00
parent a4e89ca2a1
commit d3f47cfba9
2 changed files with 31 additions and 26 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: inetd.8,v 1.23 1999/09/10 03:26:49 simonb Exp $ .\" $NetBSD: inetd.8,v 1.24 1999/10/06 21:54:10 ad Exp $
.\" .\"
.\" Copyright (c) 1998 The NetBSD Foundation, Inc. .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
.\" All rights reserved. .\" All rights reserved.
@ -127,8 +127,8 @@ fields of the configuration file are as follows:
[addr:]service-name [addr:]service-name
socket-type socket-type
protocol[,sndbuf=size][,rcvbuf=size] protocol[,sndbuf=size][,rcvbuf=size]
wait/nowait[.max] wait/nowait[:max]
user[.group] user[:group]
server-program server-program
server program arguments server program arguments
.Ed .Ed
@ -141,8 +141,8 @@ based service, the entry would contain these fields.
service-name/version service-name/version
socket-type socket-type
rpc/protocol[,sndbuf=size][,rcvbuf=size] rpc/protocol[,sndbuf=size][,rcvbuf=size]
wait/nowait[.max] wait/nowait[:max]
user[.group] user[:group]
server-program server-program
server program arguments server program arguments
.Ed .Ed
@ -292,8 +292,8 @@ suffix (separated from
.Dq wait .Dq wait
or or
.Dq nowait .Dq nowait
by a dot) specifies the maximum number of server instances that may be by a dot or a colon) specifies the maximum number of server instances that may
spawned from be spawned from
.Nm .Nm
within an interval of 60 seconds. When omitted, within an interval of 60 seconds. When omitted,
.Dq max .Dq max
@ -316,13 +316,14 @@ is usually the only stream server marked as wait.
.Pp .Pp
The The
.Em user .Em user
entry should contain the user name of the user as whom the server entry should contain the user name of the user as whom the server should
should run. This allows for servers to be given less permission run. This allows for servers to be given less permission than root. An
than root. An optional group name can be specified by appending a dot to optional group name can be specified by appending a colon to the user name
the user name followed by the group name. This allows for servers to run with followed by the group name (it is possible to use a dot in lieu of a colon,
a different (primary) group id than specified in the password file. If a group however this feature is provided only for backward compatibility). This allows
is specified and user is not root, the supplementary groups associated with for servers to run with a different (primary) group id than specified in the
that user will still be set. password file. If a group is specified and user is not root, the
supplementary groups associated with that user will still be set.
.Pp .Pp
The The
.Em server-program .Em server-program

View File

@ -1,4 +1,4 @@
/* $NetBSD: inetd.c,v 1.54 1999/09/15 09:59:41 itojun Exp $ */ /* $NetBSD: inetd.c,v 1.55 1999/10/06 21:54:10 ad Exp $ */
/*- /*-
* Copyright (c) 1998 The NetBSD Foundation, Inc. * Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -77,7 +77,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1991, 1993, 1994\n\
#if 0 #if 0
static char sccsid[] = "@(#)inetd.c 8.4 (Berkeley) 4/13/94"; static char sccsid[] = "@(#)inetd.c 8.4 (Berkeley) 4/13/94";
#else #else
__RCSID("$NetBSD: inetd.c,v 1.54 1999/09/15 09:59:41 itojun Exp $"); __RCSID("$NetBSD: inetd.c,v 1.55 1999/10/06 21:54:10 ad Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -108,8 +108,8 @@ __RCSID("$NetBSD: inetd.c,v 1.54 1999/09/15 09:59:41 itojun Exp $");
* name a tcpmux service * name a tcpmux service
* socket type stream/dgram/raw/rdm/seqpacket * socket type stream/dgram/raw/rdm/seqpacket
* protocol must be in /etc/protocols * protocol must be in /etc/protocols
* wait/nowait[.max] single-threaded/multi-threaded, max # * wait/nowait[:max] single-threaded/multi-threaded, max #
* user[.group] user/group to run daemon as * user[:group] user/group to run daemon as
* server program full path name * server program full path name
* server program arguments maximum of MAXARGS (20) * server program arguments maximum of MAXARGS (20)
* *
@ -117,8 +117,8 @@ __RCSID("$NetBSD: inetd.c,v 1.54 1999/09/15 09:59:41 itojun Exp $");
* service name/version must be in /etc/rpc * service name/version must be in /etc/rpc
* socket type stream/dgram/raw/rdm/seqpacket * socket type stream/dgram/raw/rdm/seqpacket
* protocol must be in /etc/protocols * protocol must be in /etc/protocols
* wait/nowait[.max] single-threaded/multi-threaded * wait/nowait[:max] single-threaded/multi-threaded
* user[.group] user to run daemon as * user[:group] user to run daemon as
* server program full path name * server program full path name
* server program arguments maximum of MAXARGS (20) * server program arguments maximum of MAXARGS (20)
* *
@ -172,7 +172,7 @@ __RCSID("$NetBSD: inetd.c,v 1.54 1999/09/15 09:59:41 itojun Exp $");
*/ */
/* /*
* Here's the scoop concerning the user.group feature: * Here's the scoop concerning the user:group feature:
* *
* 1) set-group-option off. * 1) set-group-option off.
* *
@ -1561,8 +1561,9 @@ do { \
arg = sskip(&cp); arg = sskip(&cp);
{ {
char *cp; char *cp;
if ((cp = strchr(arg, ':')) == NULL)
cp = strchr(arg, '.'); cp = strchr(arg, '.');
if (cp) { if (cp != NULL) {
*cp++ = '\0'; *cp++ = '\0';
sep->se_max = atoi(cp); sep->se_max = atoi(cp);
} else } else
@ -1590,8 +1591,11 @@ do { \
} }
} }
sep->se_user = newstr(sskip(&cp)); sep->se_user = newstr(sskip(&cp));
if ((sep->se_group = strchr(sep->se_user, '.'))) if ((sep->se_group = strchr(sep->se_user, ':')) != NULL)
*sep->se_group++ = '\0'; *sep->se_group++ = '\0';
else if ((sep->se_group = strchr(sep->se_user, '.')) != NULL)
*sep->se_group++ = '\0';
sep->se_server = newstr(sskip(&cp)); sep->se_server = newstr(sskip(&cp));
if (strcmp(sep->se_server, "internal") == 0) { if (strcmp(sep->se_server, "internal") == 0) {
struct biltin *bi; struct biltin *bi;
@ -2072,7 +2076,7 @@ print_service(action, sep)
{ {
if (isrpcservice(sep)) if (isrpcservice(sep))
fprintf(stderr, fprintf(stderr,
"%s: %s rpcprog=%d, rpcvers = %d/%d, proto=%s, wait.max=%d.%d, user.group=%s.%s builtin=%lx server=%s" "%s: %s rpcprog=%d, rpcvers = %d/%d, proto=%s, wait:max=%d.%d, user:group=%s.%s builtin=%lx server=%s"
#ifdef IPSEC #ifdef IPSEC
" policy=\"%s\"" " policy=\"%s\""
#endif #endif
@ -2087,7 +2091,7 @@ print_service(action, sep)
); );
else else
fprintf(stderr, fprintf(stderr,
"%s: %s proto=%s, wait.max=%d.%d, user.group=%s.%s builtin=%lx server=%s" "%s: %s proto=%s, wait:max=%d.%d, user:group=%s.%s builtin=%lx server=%s"
#ifdef IPSEC #ifdef IPSEC
" policy=%s" " policy=%s"
#endif #endif