From c5b8baea8f557f9c63e26693bd8b23a5251edd4d Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Tue, 14 Feb 2012 10:17:03 +0000 Subject: readlink len-1 --- pw/cpdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pw/cpdir.c b/pw/cpdir.c index c5534e5..0fd671b 100644 --- a/pw/cpdir.c +++ b/pw/cpdir.c @@ -84,7 +84,7 @@ copymkdir(char const * dir, char const * skel, mode_t mode, uid_t uid, gid_t gid if (strcmp(e->d_name, ".") != 0 && strcmp(e->d_name, "..") != 0) copymkdir(dst, src, st.st_mode & _DEF_DIRMODE, uid, gid); chflags(dst, st.st_flags); /* propagate flags */ - } else if (S_ISLNK(st.st_mode) && (len = readlink(src, lnk, sizeof(lnk))) != -1) { + } else if (S_ISLNK(st.st_mode) && (len = readlink(src, lnk, sizeof(lnk) - 1)) != -1) { lnk[len] = '\0'; symlink(lnk, dst); lchown(dst, uid, gid); -- cgit v1.2.3-56-ge451 From 577f7aac3dda1702f68f91c9a938693f52c16ccf Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Wed, 22 Feb 2012 06:27:20 +0000 Subject: Handle NULL return from crypt(3). Mostly from DragonFly --- pw/pw_user.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pw/pw_user.c b/pw/pw_user.c index 0001a41..b59789c 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -1028,6 +1028,7 @@ pw_pwcrypt(char *password) { int i; char salt[SALTSIZE + 1]; + char *cryptpw; static char buf[256]; @@ -1038,7 +1039,10 @@ pw_pwcrypt(char *password) salt[i] = chars[arc4random_uniform(sizeof(chars) - 1)]; salt[SALTSIZE] = '\0'; - return strcpy(buf, crypt(password, salt)); + cryptpw = crypt(password, salt); + if (cryptpw == NULL) + errx(EX_CONFIG, "crypt(3) failure"); + return strcpy(buf, cryptpw); } -- cgit v1.2.3-56-ge451 From 5981966a8ffda48fad2d1a5f93697220ba8aab8a Mon Sep 17 00:00:00 2001 From: Daniel Eischen Date: Sat, 25 Feb 2012 07:58:59 +0000 Subject: When using uidstart in /etc/adduser.conf, get the next available user id and show it in the "Uid [xxx]" prompt. PR: 163863 Submitted by: Moritz Wilhelmy (mw at wzff dot de) MFC after: 2 weeks --- adduser/adduser.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/adduser/adduser.sh b/adduser/adduser.sh index f645f59..4b0a6f6 100644 --- a/adduser/adduser.sh +++ b/adduser/adduser.sh @@ -488,6 +488,7 @@ get_uid() { _prompt= if [ -n "$uuid" ]; then + uuid=`get_nextuid $uuid` _prompt="Uid [$uuid]: " else _prompt="Uid (Leave empty for default): " -- cgit v1.2.3-56-ge451 From 1d76cdec40716274826c5d6e25f1b1d71a79703d Mon Sep 17 00:00:00 2001 From: Eitan Adler Date: Thu, 29 Mar 2012 05:02:12 +0000 Subject: Remove trailing whitespace per mdoc lint warning Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days --- adduser/adduser.conf.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adduser/adduser.conf.5 b/adduser/adduser.conf.5 index d5fcf77..c7c4f5d 100644 --- a/adduser/adduser.conf.5 +++ b/adduser/adduser.conf.5 @@ -34,7 +34,7 @@ .Xr adduser 8 configuration file .Sh DESCRIPTION -The +The .Pa /etc/adduser.conf file is automatically generated by the .Xr adduser 8 -- cgit v1.2.3-56-ge451