summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2014-08-19 06:50:54 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2014-08-19 06:50:54 +0000
commite4061ea7d682a38b6ce4da1d45e20f840d367b19 (patch)
tree73732ca13a0e498b3b9240b28d3aee425131cb9f
parent1fb8684f302fa65d6946f43d3d5e89f90aa9db6c (diff)
parent541ffe0f9d8c657b529483a6725a6f2b4b45058e (diff)
downloadpw-darwin-e4061ea7d682a38b6ce4da1d45e20f840d367b19.tar.gz
pw-darwin-e4061ea7d682a38b6ce4da1d45e20f840d367b19.tar.zst
pw-darwin-e4061ea7d682a38b6ce4da1d45e20f840d367b19.zip
Merge head from 7/28
-rw-r--r--adduser/adduser.84
-rw-r--r--adduser/adduser.conf.52
-rw-r--r--pw/pw_user.c7
-rw-r--r--pw/pwupd.c17
4 files changed, 9 insertions, 21 deletions
diff --git a/adduser/adduser.8 b/adduser/adduser.8
index f23ecff..2e6a5b5 100644
--- a/adduser/adduser.8
+++ b/adduser/adduser.8
@@ -450,11 +450,11 @@ command appeared in
.Sh AUTHORS
.An -nosplit
This manual page and the original script, in Perl, was written by
-.An Wolfram Schneider Aq wosch@FreeBSD.org .
+.An Wolfram Schneider Aq Mt wosch@FreeBSD.org .
The replacement script, written as a Bourne
shell script with some enhancements, and the man page modification that
came with it were done by
-.An Mike Makonnen Aq mtm@identd.net .
+.An Mike Makonnen Aq Mt mtm@identd.net .
.Sh BUGS
In order for
.Nm
diff --git a/adduser/adduser.conf.5 b/adduser/adduser.conf.5
index c7c4f5d..af9fe22 100644
--- a/adduser/adduser.conf.5
+++ b/adduser/adduser.conf.5
@@ -210,7 +210,7 @@ manual page first appeared in
.Fx 5.3 .
.Sh AUTHORS
This manual page was written by
-.An Tom Rhodes Aq trhodes@FreeBSD.org .
+.An Tom Rhodes Aq Mt trhodes@FreeBSD.org .
.Sh BUGS
The internal variables documented here may change without notice.
Do not rely on them.
diff --git a/pw/pw_user.c b/pw/pw_user.c
index 4b3f550..36c5d9d 100644
--- a/pw/pw_user.c
+++ b/pw/pw_user.c
@@ -438,14 +438,13 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
delgrent(GETGRNAM(a_name->val));
SETGRENT();
while ((grp = GETGRENT()) != NULL) {
- int i;
+ int i, j;
char group[MAXLOGNAME];
if (grp->gr_mem != NULL) {
for (i = 0; grp->gr_mem[i] != NULL; i++) {
if (!strcmp(grp->gr_mem[i], a_name->val)) {
- while (grp->gr_mem[i] != NULL) {
- grp->gr_mem[i] = grp->gr_mem[i+1];
- }
+ for (j = i; grp->gr_mem[j] != NULL; j++)
+ grp->gr_mem[j] = grp->gr_mem[j+1];
strlcpy(group, grp->gr_name, MAXLOGNAME);
chggrent(group, grp);
}
diff --git a/pw/pwupd.c b/pw/pwupd.c
index 22662db..c2a9a53 100644
--- a/pw/pwupd.c
+++ b/pw/pwupd.c
@@ -45,9 +45,6 @@ static const char rcsid[] =
#include "pwupd.h"
-#define HAVE_PWDB_C 1
-#define HAVE_PWDB_U 1
-
static char pathpwd[] = _PATH_PWD;
static char * pwpath = pathpwd;
@@ -112,22 +109,14 @@ pw_update(struct passwd * pwd, char const * user)
{
int rc = 0;
- /*
- * First, let's check the see if the database is alright
- * Note: -C is only available in FreeBSD 2.2 and above
- */
-#ifdef HAVE_PWDB_C
rc = pwdb("-C", (char *)NULL); /* Check only */
if (rc == 0) {
-#else
- { /* No -C */
-#endif
int pfd, tfd;
struct passwd *pw = NULL;
struct passwd *old_pw = NULL;
- if (pwd != NULL)
- pw = pw_dup(pwd);
+ if (pwd != NULL)
+ pw = pw_dup(pwd);
if (user != NULL)
old_pw = GETPWNAM(user);
@@ -150,7 +139,7 @@ pw_update(struct passwd * pwd, char const * user)
* in case of deletion of a user, the whole database
* needs to be regenerated
*/
- if (pw_mkdb(pw != NULL ? user : NULL) == -1) {
+ if (pw_mkdb(pw != NULL ? pw->pw_name : NULL) == -1) {
pw_fini();
err(1, "pw_mkdb()");
}