From 8931e7504dacbc865094bf6b8ab7033e56a8d2c2 Mon Sep 17 00:00:00 2001 From: nbd Date: Sat, 4 Feb 2006 01:21:35 +0000 Subject: busybox httpd.conf: add support for reading passwords from /etc/passwd (syntax: $p$user, similar to md5 password syntax $1$password) git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@3122 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/busybox/patches/310-passwd_access.patch | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 package/busybox/patches/310-passwd_access.patch (limited to 'package/busybox/patches/310-passwd_access.patch') diff --git a/package/busybox/patches/310-passwd_access.patch b/package/busybox/patches/310-passwd_access.patch new file mode 100644 index 0000000000..03cfe8b850 --- /dev/null +++ b/package/busybox/patches/310-passwd_access.patch @@ -0,0 +1,37 @@ +diff -urN busybox.old/networking/httpd.c busybox.dev/networking/httpd.c +--- busybox.old/networking/httpd.c 2004-10-08 10:03:29.000000000 +0200 ++++ busybox.dev/networking/httpd.c 2006-02-04 01:54:19.688016250 +0100 +@@ -1467,12 +1467,22 @@ + { + char *cipher; + char *pp; ++ char *ppnew = NULL; ++ struct passwd *pwd = NULL; + + if(strncmp(p, request, u-request) != 0) { + /* user uncompared */ + continue; + } + pp = strchr(p, ':'); ++ if(pp && pp[1] == '$' && pp[2] == 'p' && ++ pp[3] == '$' && pp[4] && ++ (pwd = getpwnam(&pp[4])) != NULL) { ++ ppnew = malloc(5 + strlen(pwd->pw_passwd)); ++ ppnew[0] = ':'; ++ strcpy(ppnew + 1, pwd->pw_passwd); ++ pp = ppnew; ++ } + if(pp && pp[1] == '$' && pp[2] == '1' && + pp[3] == '$' && pp[4]) { + pp++; +@@ -1482,6 +1492,10 @@ + /* unauthorized */ + continue; + } ++ if (ppnew) { ++ free(ppnew); ++ ppnew = NULL; ++ } + } + #endif + if (strcmp(p, request) == 0) { -- cgit v1.2.3 From 3606a6b3ad25384d5b1fb40266a441ebbb189c90 Mon Sep 17 00:00:00 2001 From: nbd Date: Tue, 27 Jun 2006 00:51:59 +0000 Subject: add copyright headers to busybox patches git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4095 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/busybox/patches/190-ash_performance.patch | 3 +++ package/busybox/patches/210-passwd_limit.patch | 3 +++ package/busybox/patches/220-awk_bitops.patch | 3 +++ package/busybox/patches/300-netmsg.patch | 10 +++++++++- package/busybox/patches/310-passwd_access.patch | 3 +++ package/busybox/patches/320-httpd_address_binding.patch | 3 +++ package/busybox/patches/340-lock_util.patch | 10 +++++++++- 7 files changed, 33 insertions(+), 2 deletions(-) (limited to 'package/busybox/patches/310-passwd_access.patch') diff --git a/package/busybox/patches/190-ash_performance.patch b/package/busybox/patches/190-ash_performance.patch index 2231fd786a..0931931419 100644 --- a/package/busybox/patches/190-ash_performance.patch +++ b/package/busybox/patches/190-ash_performance.patch @@ -1,3 +1,6 @@ + + Copyright (C) 2006 OpenWrt.org + diff -urN busybox.old/shell/ash.c busybox.dev/shell/ash.c --- busybox.old/shell/ash.c 2005-11-12 22:39:19.853826250 +0100 +++ busybox.dev/shell/ash.c 2005-11-12 22:39:42.771258500 +0100 diff --git a/package/busybox/patches/210-passwd_limit.patch b/package/busybox/patches/210-passwd_limit.patch index 50c7ed8cb1..6c10916b4a 100644 --- a/package/busybox/patches/210-passwd_limit.patch +++ b/package/busybox/patches/210-passwd_limit.patch @@ -1,3 +1,6 @@ + + Copyright (C) 2006 OpenWrt.org + diff -urN busybox.old/loginutils/passwd.c busybox.dev/loginutils/passwd.c --- busybox.old/loginutils/passwd.c 2005-12-11 22:52:46.185150000 +0100 +++ busybox.dev/loginutils/passwd.c 2005-12-11 23:19:15.276596500 +0100 diff --git a/package/busybox/patches/220-awk_bitops.patch b/package/busybox/patches/220-awk_bitops.patch index 2b85729135..1567583d2a 100644 --- a/package/busybox/patches/220-awk_bitops.patch +++ b/package/busybox/patches/220-awk_bitops.patch @@ -1,3 +1,6 @@ + + Copyright (C) 2006 OpenWrt.org + --- busybox-1.00/editors/awk.c.orig 2004-09-24 05:24:27 -04:00 +++ busybox-1.00/editors/awk.c 2006-03-08 02:16:52 -05:00 @@ -271,7 +271,8 @@ diff --git a/package/busybox/patches/300-netmsg.patch b/package/busybox/patches/300-netmsg.patch index ef6c0f4507..ad4fcd04d0 100644 --- a/package/busybox/patches/300-netmsg.patch +++ b/package/busybox/patches/300-netmsg.patch @@ -1,3 +1,6 @@ + + Copyright (C) 2006 OpenWrt.org + diff -Nur busybox-1.1.1/include/applets.h busybox-1.1.1-owrt/include/applets.h --- busybox-1.1.1/include/applets.h 2006-04-01 18:26:21.000000000 +0200 +++ busybox-1.1.1-owrt/include/applets.h 2006-04-01 18:36:28.000000000 +0200 @@ -39,7 +42,12 @@ diff -Nur busybox-1.1.1/networking/Makefile.in busybox-1.1.1-owrt/networking/Mak diff -Nur busybox-1.1.1/networking/netmsg.c busybox-1.1.1-owrt/networking/netmsg.c --- busybox-1.1.1/networking/netmsg.c 1970-01-01 01:00:00.000000000 +0100 +++ busybox-1.1.1-owrt/networking/netmsg.c 2006-04-01 18:35:32.000000000 +0200 -@@ -0,0 +1,58 @@ +@@ -0,0 +1,63 @@ ++/* ++ * Copyright (C) 2006 Felix Fietkau ++ * ++ * This is free software, licensed under the GNU General Public License v2. ++ */ +#include +#include +#include diff --git a/package/busybox/patches/310-passwd_access.patch b/package/busybox/patches/310-passwd_access.patch index 03cfe8b850..3a09d2a0a6 100644 --- a/package/busybox/patches/310-passwd_access.patch +++ b/package/busybox/patches/310-passwd_access.patch @@ -1,3 +1,6 @@ + + Copyright (C) 2006 OpenWrt.org + diff -urN busybox.old/networking/httpd.c busybox.dev/networking/httpd.c --- busybox.old/networking/httpd.c 2004-10-08 10:03:29.000000000 +0200 +++ busybox.dev/networking/httpd.c 2006-02-04 01:54:19.688016250 +0100 diff --git a/package/busybox/patches/320-httpd_address_binding.patch b/package/busybox/patches/320-httpd_address_binding.patch index 288900b91f..b9503aa02a 100644 --- a/package/busybox/patches/320-httpd_address_binding.patch +++ b/package/busybox/patches/320-httpd_address_binding.patch @@ -1,3 +1,6 @@ + + Copyright (C) 2006 OpenWrt.org + --- busybox-1.1.1/networking/httpd.c 2006-03-22 22:16:19.000000000 +0100 +++ busybox-1.1.1.new/networking/httpd.c 2006-04-01 19:41:42.150744624 +0200 @@ -110,6 +110,7 @@ diff --git a/package/busybox/patches/340-lock_util.patch b/package/busybox/patches/340-lock_util.patch index bb1cf49a77..ad594e68db 100644 --- a/package/busybox/patches/340-lock_util.patch +++ b/package/busybox/patches/340-lock_util.patch @@ -1,3 +1,6 @@ + + Copyright (C) 2006 OpenWrt.org + diff -urN busybox.old/include/applets.h busybox.dev/include/applets.h --- busybox.old/include/applets.h 2006-04-05 01:06:29.000000000 +0200 +++ busybox.dev/include/applets.h 2006-04-05 01:19:09.000000000 +0200 @@ -39,7 +42,12 @@ diff -urN busybox.old/miscutils/Makefile.in busybox.dev/miscutils/Makefile.in diff -urN busybox.old/miscutils/lock.c busybox.dev/miscutils/lock.c --- busybox.old/miscutils/lock.c 1970-01-01 01:00:00.000000000 +0100 +++ busybox.dev/miscutils/lock.c 2006-04-05 01:07:12.000000000 +0200 -@@ -0,0 +1,128 @@ +@@ -0,0 +1,133 @@ ++/* ++ * Copyright (C) 2006 Felix Fietkau ++ * ++ * This is free software, licensed under the GNU General Public License v2. ++ */ +#include +#include +#include -- cgit v1.2.3 From b0ccd00793948e0fe2456f25ff6ad0e99c2eaa9a Mon Sep 17 00:00:00 2001 From: nbd Date: Mon, 2 Oct 2006 17:40:03 +0000 Subject: port last commit to -ng git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4886 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/busybox/patches/310-passwd_access.patch | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'package/busybox/patches/310-passwd_access.patch') diff --git a/package/busybox/patches/310-passwd_access.patch b/package/busybox/patches/310-passwd_access.patch index 3a09d2a0a6..3d4efb1351 100644 --- a/package/busybox/patches/310-passwd_access.patch +++ b/package/busybox/patches/310-passwd_access.patch @@ -4,7 +4,7 @@ diff -urN busybox.old/networking/httpd.c busybox.dev/networking/httpd.c --- busybox.old/networking/httpd.c 2004-10-08 10:03:29.000000000 +0200 +++ busybox.dev/networking/httpd.c 2006-02-04 01:54:19.688016250 +0100 -@@ -1467,12 +1467,22 @@ +@@ -1467,12 +1467,24 @@ { char *cipher; char *pp; @@ -16,6 +16,8 @@ diff -urN busybox.old/networking/httpd.c busybox.dev/networking/httpd.c continue; } pp = strchr(p, ':'); ++ if(pp && pp[1] == '!' && pp[2] == ':') ++ continue; + if(pp && pp[1] == '$' && pp[2] == 'p' && + pp[3] == '$' && pp[4] && + (pwd = getpwnam(&pp[4])) != NULL) { -- cgit v1.2.3 From 5b9d06e88ec9c98eb3758991ab22eb9d0813e70b Mon Sep 17 00:00:00 2001 From: nbd Date: Mon, 2 Oct 2006 17:43:42 +0000 Subject: fix for the password check (checked the wrong variable) git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4887 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/busybox/patches/310-passwd_access.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package/busybox/patches/310-passwd_access.patch') diff --git a/package/busybox/patches/310-passwd_access.patch b/package/busybox/patches/310-passwd_access.patch index 3d4efb1351..740181ac77 100644 --- a/package/busybox/patches/310-passwd_access.patch +++ b/package/busybox/patches/310-passwd_access.patch @@ -16,11 +16,11 @@ diff -urN busybox.old/networking/httpd.c busybox.dev/networking/httpd.c continue; } pp = strchr(p, ':'); -+ if(pp && pp[1] == '!' && pp[2] == ':') -+ continue; + if(pp && pp[1] == '$' && pp[2] == 'p' && + pp[3] == '$' && pp[4] && + (pwd = getpwnam(&pp[4])) != NULL) { ++ if(pwd->pw_passwd && pwd->pw_passwd[0] == '!') ++ continue; + ppnew = malloc(5 + strlen(pwd->pw_passwd)); + ppnew[0] = ':'; + strcpy(ppnew + 1, pwd->pw_passwd); -- cgit v1.2.3 From c1be781808c1d27e2eeb7aff624f286827b29141 Mon Sep 17 00:00:00 2001 From: nbd Date: Fri, 6 Oct 2006 18:52:02 +0000 Subject: really fix webif password access patch for busybox git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4936 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/busybox/patches/310-passwd_access.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'package/busybox/patches/310-passwd_access.patch') diff --git a/package/busybox/patches/310-passwd_access.patch b/package/busybox/patches/310-passwd_access.patch index 740181ac77..868abfcd06 100644 --- a/package/busybox/patches/310-passwd_access.patch +++ b/package/busybox/patches/310-passwd_access.patch @@ -4,7 +4,7 @@ diff -urN busybox.old/networking/httpd.c busybox.dev/networking/httpd.c --- busybox.old/networking/httpd.c 2004-10-08 10:03:29.000000000 +0200 +++ busybox.dev/networking/httpd.c 2006-02-04 01:54:19.688016250 +0100 -@@ -1467,12 +1467,24 @@ +@@ -1467,12 +1467,26 @@ { char *cipher; char *pp; @@ -19,8 +19,10 @@ diff -urN busybox.old/networking/httpd.c busybox.dev/networking/httpd.c + if(pp && pp[1] == '$' && pp[2] == 'p' && + pp[3] == '$' && pp[4] && + (pwd = getpwnam(&pp[4])) != NULL) { -+ if(pwd->pw_passwd && pwd->pw_passwd[0] == '!') ++ if(pwd->pw_passwd && pwd->pw_passwd[0] == '!') { ++ prev = NULL; + continue; ++ } + ppnew = malloc(5 + strlen(pwd->pw_passwd)); + ppnew[0] = ':'; + strcpy(ppnew + 1, pwd->pw_passwd); -- cgit v1.2.3