summaryrefslogtreecommitdiff
path: root/source3/web
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-11-24 08:32:03 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-11-24 08:32:03 +0000
commit5aca399a382fcd1e1664749f7b6fe7b9a67ac75e (patch)
treef7fc8cc002562720a385e3cf515a001a03993a1e /source3/web
parent191dff2d279dd8315f093e313d8c149e786eb19f (diff)
downloadsamba-5aca399a382fcd1e1664749f7b6fe7b9a67ac75e.tar.gz
samba-5aca399a382fcd1e1664749f7b6fe7b9a67ac75e.tar.bz2
samba-5aca399a382fcd1e1664749f7b6fe7b9a67ac75e.zip
Add ntlm_auth, a new program to provide a stable interface to winbind's
authentication code. In particular, ntlm_auth is designed to replace the winbind authentication 'helpers' currently supplied by Squid. I have added support for the current plaintext password protocol used by Squid, and will add the real guts (NTLMSSP support) shortly. I'll merge this into 3.0 when I've got the interface more stable (error message format etc) and got the important NTLMSSP support added. Also move SWAT's URL decoding code into util_str.c, for use in both utilities. Andrew Bartlett (This used to be commit 82dbf838879e8a2d2d3f9dd5be6eda50b780b787)
Diffstat (limited to 'source3/web')
-rw-r--r--source3/web/cgi.c45
1 files changed, 4 insertions, 41 deletions
diff --git a/source3/web/cgi.c b/source3/web/cgi.c
index c9cb78f6f1..96520c0eef 100644
--- a/source3/web/cgi.c
+++ b/source3/web/cgi.c
@@ -46,43 +46,6 @@ static char *C_user;
static BOOL inetd_server;
static BOOL got_request;
-static void unescape(char *buf)
-{
- char *p=buf;
-
- while ((p=strchr_m(p,'+')))
- *p = ' ';
-
- p = buf;
-
- while (p && *p && (p=strchr_m(p,'%'))) {
- int c1 = p[1];
- int c2 = p[2];
-
- if (c1 >= '0' && c1 <= '9')
- c1 = c1 - '0';
- else if (c1 >= 'A' && c1 <= 'F')
- c1 = 10 + c1 - 'A';
- else if (c1 >= 'a' && c1 <= 'f')
- c1 = 10 + c1 - 'a';
- else {p++; continue;}
-
- if (c2 >= '0' && c2 <= '9')
- c2 = c2 - '0';
- else if (c2 >= 'A' && c2 <= 'F')
- c2 = 10 + c2 - 'A';
- else if (c2 >= 'a' && c2 <= 'f')
- c2 = 10 + c2 - 'a';
- else {p++; continue;}
-
- *p = (c1<<4) | c2;
-
- memmove(p+1, p+3, strlen(p+3)+1);
- p++;
- }
-}
-
-
static char *grab_line(FILE *f, int *cl)
{
char *ret = NULL;
@@ -167,8 +130,8 @@ void cgi_load_variables(void)
!variables[num_variables].value)
continue;
- unescape(variables[num_variables].value);
- unescape(variables[num_variables].name);
+ rfc1738_unescape(variables[num_variables].value);
+ rfc1738_unescape(variables[num_variables].name);
#ifdef DEBUG_COMMENTS
printf("<!== POST var %s has value \"%s\" ==>\n",
@@ -198,8 +161,8 @@ void cgi_load_variables(void)
!variables[num_variables].value)
continue;
- unescape(variables[num_variables].value);
- unescape(variables[num_variables].name);
+ rfc1738_unescape(variables[num_variables].value);
+ rfc1738_unescape(variables[num_variables].name);
#ifdef DEBUG_COMMENTS
printf("<!== Commandline var %s has value \"%s\" ==>\n",