[package] uhttpd: cope with DES crypted passwd entries by not relying on a leading...
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 9 Nov 2011 18:55:28 +0000 (18:55 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 9 Nov 2011 18:55:28 +0000 (18:55 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28886 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/uhttpd/Makefile
package/uhttpd/src/uhttpd-utils.c

index d8bd33c..c333660 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uhttpd
-PKG_RELEASE:=29
+PKG_RELEASE:=30
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 PKG_CONFIG_DEPENDS := \
index d48f6bc..a47f175 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;
                        }
                }