diff options
-rw-r--r-- | adduser/adduser.conf.5 | 2 | ||||
-rw-r--r-- | adduser/adduser.sh | 1 | ||||
-rw-r--r-- | pw/cpdir.c | 2 | ||||
-rw-r--r-- | pw/pw_user.c | 6 |
4 files changed, 8 insertions, 3 deletions
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 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): " @@ -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); 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); } |