diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2011-11-09 18:55:28 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2011-11-09 18:55:28 +0000 |
commit | 69604f44197203c0859a7af24a13b1dd5abc75ab (patch) | |
tree | 5cbaceae2ab9c39b3edc9fdb75bfbb84149c4241 | |
parent | 0e402df056a05d22fca24ba0535363b3dedf417d (diff) | |
download | uhttpd-69604f44197203c0859a7af24a13b1dd5abc75ab.tar.gz |
[package] uhttpd: cope with DES crypted passwd entries by not relying on a leading dollar sign to indicate a cipher
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@28886 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | uhttpd-utils.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/uhttpd-utils.c b/uhttpd-utils.c index d48f6bc..a47f175 100644 --- a/uhttpd-utils.c +++ b/uhttpd-utils.c @@ -782,12 +782,9 @@ int uh_auth_check( /* found a realm matching the username */ if( realm ) { - /* is a crypt passwd */ - if( realm->pass[0] == '$' ) - pass = crypt(pass, realm->pass); - /* check user pass */ - if( !strcmp(pass, realm->pass) ) + if (!strcmp(pass, realm->pass) || + !strcmp(crypt(pass, realm->pass), realm->pass)) return 1; } } |