Browse Source

uhttpd: cope with DES crypted passwd entries by not relying on a leading dollar sign to indicate a cipher

SVN-Revision: 28886
Jo-Philipp Wich 14 năm trước cách đây
mục cha
commit
44da6400cd
2 tập tin đã thay đổi với 3 bổ sung6 xóa
  1. 1 1
      package/uhttpd/Makefile
  2. 2 5
      package/uhttpd/src/uhttpd-utils.c

+ 1 - 1
package/uhttpd/Makefile

@@ -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 := \

+ 2 - 5
package/uhttpd/src/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;
 			}
 		}