Use ':' as group prefix; suggested by hubertf.

This commit is contained in:
ad 2000-07-06 13:09:46 +00:00
parent 29251eb71f
commit 240f3596cb
3 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: passwd.c,v 1.20 2000/07/06 11:06:12 ad Exp $ */
/* $NetBSD: passwd.c,v 1.21 2000/07/06 13:09:47 ad Exp $ */
/*
* Copyright (c) 1987, 1993, 1994, 1995
@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: passwd.c,v 1.20 2000/07/06 11:06:12 ad Exp $");
__RCSID("$NetBSD: passwd.c,v 1.21 2000/07/06 13:09:47 ad Exp $");
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@ -423,7 +423,7 @@ pw_getconf(char *data, size_t max, const char *key, const char *option)
/* Now we found our specified key */
while (read_line(fp, line, LINE_MAX)) {
/* Leaving key field */
if (strchr(line, ':') != NULL) {
if (line[0] != '\0' && strchr(line + 1, ':') != NULL) {
got = 1;
break;
}

View File

@ -1,4 +1,4 @@
.\" $NetBSD: passwd.conf.5,v 1.1 2000/07/06 11:23:11 ad Exp $
.\" $NetBSD: passwd.conf.5,v 1.2 2000/07/06 13:13:53 ad Exp $
.\"
.\" Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
.\" All rights reserved.
@ -50,8 +50,8 @@ stanza to a specific option is available, the default stanza
is used.
.Pp
To differentiate between user and group stanzas, groups are prefixed
with a single dot
.Pq Sq \&. .
with a single colon
.Pq Sq \&: .
.Pp
Some fields and their possible values that can appear in this file are:
.Bl -tag -width localcipher

View File

@ -1,4 +1,4 @@
/* $NetBSD: pwd_gensalt.c,v 1.1 2000/07/06 11:16:50 ad Exp $ */
/* $NetBSD: pwd_gensalt.c,v 1.2 2000/07/06 13:09:46 ad Exp $ */
/*
* Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
@ -76,7 +76,7 @@ pwd_gensalt(char *salt, int max, struct passwd *pwd, char type)
/* Try to find an entry for the group */
if (*option == 0) {
if ((grp = getgrgid(pwd->pw_gid)) != NULL) {
snprintf(grpkey, LINE_MAX - 1, ".%s", grp->gr_name);
snprintf(grpkey, LINE_MAX - 1, ":%s", grp->gr_name);
grpkey[LINE_MAX-1] = 0;
pw_getconf(option, LINE_MAX, grpkey, cipher);
}