summaryrefslogtreecommitdiffstats
path: root/source3/web/cgi.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-11-29 22:23:22 +0100
committerVolker Lendecke <vl@samba.org>2009-11-29 23:42:41 +0100
commit4e9d95c1e761e0331f1edcd25a64171ce9b60cc7 (patch)
tree5b30826be3c344d85a2d502b2f2e327a88a1a157 /source3/web/cgi.c
parent7bbee8dc17744a838834ea21b2acb2b7f8366194 (diff)
downloadsamba-4e9d95c1e761e0331f1edcd25a64171ce9b60cc7.tar.gz
samba-4e9d95c1e761e0331f1edcd25a64171ce9b60cc7.tar.xz
samba-4e9d95c1e761e0331f1edcd25a64171ce9b60cc7.zip
s3: Fix some nonempty blank lines
Diffstat (limited to 'source3/web/cgi.c')
-rw-r--r--source3/web/cgi.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/source3/web/cgi.c b/source3/web/cgi.c
index 39108cf3619..24d2b051572 100644
--- a/source3/web/cgi.c
+++ b/source3/web/cgi.c
@@ -1,17 +1,17 @@
/*
some simple CGI helper routines
Copyright (C) Andrew Tridgell 1997-1998
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -53,7 +53,7 @@ static char *grab_line(FILE *f, int *cl)
while ((*cl)) {
int c;
-
+
if (i == len) {
char *ret2;
if (len == 0) len = 1024;
@@ -62,7 +62,7 @@ static char *grab_line(FILE *f, int *cl)
if (!ret2) return ret;
ret = ret2;
}
-
+
c = fgetc(f);
(*cl)--;
@@ -70,7 +70,7 @@ static char *grab_line(FILE *f, int *cl)
(*cl) = 0;
break;
}
-
+
if (c == '\r') continue;
if (strchr_m("\n&", c)) break;
@@ -78,7 +78,7 @@ static char *grab_line(FILE *f, int *cl)
ret[i++] = c;
}
-
+
if (ret) {
ret[i] = 0;
}
@@ -132,14 +132,14 @@ void cgi_load_variables(void)
while (len && (line=grab_line(f, &len))) {
p = strchr_m(line,'=');
if (!p) continue;
-
+
*p = 0;
-
+
variables[num_variables].name = SMB_STRDUP(line);
variables[num_variables].value = SMB_STRDUP(p+1);
SAFE_FREE(line);
-
+
if (!variables[num_variables].name ||
!variables[num_variables].value)
continue;
@@ -154,7 +154,7 @@ void cgi_load_variables(void)
variables[num_variables].name,
variables[num_variables].value);
#endif
-
+
num_variables++;
if (num_variables == MAX_VARIABLES) break;
}
@@ -169,9 +169,9 @@ void cgi_load_variables(void)
tok=strtok_r(NULL, "&;", &saveptr)) {
p = strchr_m(tok,'=');
if (!p) continue;
-
+
*p = 0;
-
+
variables[num_variables].name = SMB_STRDUP(tok);
variables[num_variables].value = SMB_STRDUP(p+1);
@@ -366,33 +366,33 @@ static bool cgi_handle_authorization(char *line)
/*
* Try and get the user from the UNIX password file.
*/
-
+
pass = getpwnam_alloc(talloc_autofree_context(), user);
-
+
/*
* Validate the password they have given.
*/
-
+
if NT_STATUS_IS_OK(pass_check(pass, user, user_pass,
strlen(user_pass), NULL, False)) {
-
+
if (pass) {
/*
* Password was ok.
*/
-
+
if ( initgroups(pass->pw_name, pass->pw_gid) != 0 )
goto err;
become_user_permanently(pass->pw_uid, pass->pw_gid);
-
+
/* Save the users name */
C_user = SMB_STRDUP(user);
TALLOC_FREE(pass);
return True;
}
}
-
+
err:
cgi_setup_error("401 Bad Authorization",
"WWW-Authenticate: Basic realm=\"SWAT\"\r\n",