From: Jo-Philipp Wich Date: Wed, 9 Nov 2011 18:55:28 +0000 (+0000) Subject: uhttpd: cope with DES crypted passwd entries by not relying on a leading dollar sign... X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=44da6400cde94d6b3cb7581cf474282ea1bcafd3;p=librecmc%2Flibrecmc.git uhttpd: cope with DES crypted passwd entries by not relying on a leading dollar sign to indicate a cipher SVN-Revision: 28886 --- diff --git a/package/uhttpd/Makefile b/package/uhttpd/Makefile index d8bd33c075..c333660d57 100644 --- a/package/uhttpd/Makefile +++ b/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 := \ diff --git a/package/uhttpd/src/uhttpd-utils.c b/package/uhttpd/src/uhttpd-utils.c index d48f6bcf11..a47f175ba6 100644 --- a/package/uhttpd/src/uhttpd-utils.c +++ b/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; } }