wok-undigest rev 540

busybox/httpd: check system passwords (with pam support)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Nov 05 16:26:45 2011 +0100 (2011-11-05)
parents 693eba8cf9a0
children ee14628b3bd1
files busybox/stuff/busybox-1.19-httpd.u
line diff
     1.1 --- a/busybox/stuff/busybox-1.19-httpd.u	Sat Nov 05 16:11:27 2011 +0100
     1.2 +++ b/busybox/stuff/busybox-1.19-httpd.u	Sat Nov 05 16:26:45 2011 +0100
     1.3 @@ -1,4 +1,4 @@
     1.4 -Check system passwords
     1.5 +Check system passwords for *
     1.6  --- busybox-1.19.0/networking/httpd.c
     1.7  +++ busybox-1.19.0/networking/httpd.c
     1.8  @@ -54,6 +54,7 @@
     1.9 @@ -9,7 +9,22 @@
    1.10    * .au:audio/basic   # additional mime type for audio.au files
    1.11    * *.php:/path/php   # run xxx.php through an interpreter
    1.12    *
    1.13 -@@ -1730,6 +1731,57 @@
    1.14 +@@ -123,6 +124,14 @@
    1.15 + //usage:     "\n	-d STRING	URL decode STRING"
    1.16 + 
    1.17 + #include "libbb.h"
    1.18 ++#if ENABLE_PAM
    1.19 ++/* PAM may include <locale.h>. We may need to undefine bbox's stub define: */
    1.20 ++# undef setlocale
    1.21 ++/* For some obscure reason, PAM is not in pam/xxx, but in security/xxx.
    1.22 ++ * Apparently they like to confuse people. */
    1.23 ++# include <security/pam_appl.h>
    1.24 ++# include <security/pam_misc.h>
    1.25 ++#endif
    1.26 + #if ENABLE_FEATURE_HTTPD_USE_SENDFILE
    1.27 + # include <sys/sendfile.h>
    1.28 + #endif
    1.29 +@@ -1730,6 +1739,57 @@
    1.30   }
    1.31   
    1.32   #if ENABLE_FEATURE_HTTPD_BASIC_AUTH
    1.33 @@ -67,7 +82,7 @@
    1.34   /*
    1.35    * Config file entries are of the form "/<path>:<user>:<passwd>".
    1.36    * If config file has no prefix match for path, access is allowed.
    1.37 -@@ -1745,7 +1797,7 @@
    1.38 +@@ -1745,7 +1805,7 @@
    1.39   	const char *prev = NULL;
    1.40   
    1.41   	for (cur = g_auth; cur; cur = cur->next) {
    1.42 @@ -76,7 +91,7 @@
    1.43   		size_t len;
    1.44   
    1.45   		dir_prefix = cur->before_colon;
    1.46 -@@ -1770,18 +1822,71 @@
    1.47 +@@ -1770,18 +1830,71 @@
    1.48   		/* Path match found */
    1.49   		prev = dir_prefix;
    1.50   
    1.51 @@ -155,7 +170,7 @@
    1.52   				/* comparing "user:" */
    1.53   				if (strncmp(cur->after_colon, user_and_passwd, user_len_p1) != 0) {
    1.54   					continue;
    1.55 -@@ -1789,22 +1894,20 @@
    1.56 +@@ -1789,22 +1902,20 @@
    1.57   
    1.58   				encrypted = pw_encrypt(
    1.59   					user_and_passwd + user_len_p1 /* cleartext pwd from user */,