Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140560660
D42731.id130509.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
794 B
Referenced Files
None
Subscribers
None
D42731.id130509.diff
View Options
diff --git a/lib/libpam/modules/pam_unix/pam_unix.c b/lib/libpam/modules/pam_unix/pam_unix.c
--- a/lib/libpam/modules/pam_unix/pam_unix.c
+++ b/lib/libpam/modules/pam_unix/pam_unix.c
@@ -288,6 +288,7 @@
char *encrypted;
time_t passwordtime;
int pfd, tfd, retval;
+ char emptyhash[] = "";
if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF))
user = getlogin();
@@ -402,8 +403,14 @@
pwd->pw_change = time(NULL) + passwordtime;
login_close(lc);
- makesalt(salt);
- pwd->pw_passwd = crypt(new_pass, salt);
+
+ /* store empty password as an empty hash */
+ if (new_pass[0] == '\0')
+ pwd->pw_passwd = emptyhash;
+ else {
+ makesalt(salt);
+ pwd->pw_passwd = crypt(new_pass, salt);
+ }
#ifdef YP
switch (old_pwd->pw_fields & _PWF_SOURCE) {
case _PWF_FILES:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 26, 7:05 AM (12 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27277613
Default Alt Text
D42731.id130509.diff (794 B)
Attached To
Mode
D42731: pam_unix: Store empty password as empty hash
Attached
Detach File
Event Timeline
Log In to Comment