From d57e33ab31c7886bd4a145773381e7f0c57d7364 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Fri, 20 Jun 2014 09:57:27 +0000 Subject: use .Mt to mark up email addresses consistently (part2) PR: 191174 Submitted by: Franco Fichtner --- adduser/adduser.8 | 4 ++-- adduser/adduser.conf.5 | 2 +- 2 files changed, 3 insertions(+), 3 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. -- cgit v1.2.3-56-ge451 From 2150badb6562259975120d771dcc1b09fa05ecb8 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Fri, 20 Jun 2014 10:34:32 +0000 Subject: Removed compatibility with pre FreeBSD 2.2 pw_mkdb command Fix some broken indentattion PR: 189173 Submitted by: fullermd@over-yonder.net MFC after: 1 week --- pw/pwupd.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/pw/pwupd.c b/pw/pwupd.c index 22662db..735f385 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); -- cgit v1.2.3-56-ge451 From a3c0ba2575fa986313cd0d49c625570a14e0e0f2 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Fri, 20 Jun 2014 10:38:08 +0000 Subject: Fix changing the username PR: 189172 Submitted by: fullermd@over-yonder.net MFC after: 1 week --- pw/pwupd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pw/pwupd.c b/pw/pwupd.c index 735f385..c2a9a53 100644 --- a/pw/pwupd.c +++ b/pw/pwupd.c @@ -139,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()"); } -- cgit v1.2.3-56-ge451 From 541ffe0f9d8c657b529483a6725a6f2b4b45058e Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Fri, 27 Jun 2014 18:51:19 +0000 Subject: pw: fix up deletion of users from groups Previuosly given 'foo,bar' members, removing 'foo' would result in an infinite loop. PR: 191427 Submitted by: Voradesh Yenbut MFC after: 1 week --- pw/pw_user.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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); } -- cgit v1.2.3-56-ge451