[package] uhttpd: cope with DES crypted passwd entries by not relying on a leading...
[openwrt/svn-archive/archive.git] / package / uhttpd / src / uhttpd-utils.c
index d48f6bcf11908bb160dded5fae374ea6c0275463..a47f175ba6a98a86677bc4e2b9963c10b29546e1 100644 (file)
@@ -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;
                        }
                }