summaryrefslogtreecommitdiffstats
path: root/source/web/cgi.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-01-03 08:28:12 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-01-03 08:28:12 +0000
commit3a7458f9472432ef12c43008414925fd1ce8ea0c (patch)
tree185f6140d3895e4d5304e4ef3f5ce4d7a34a7e82 /source/web/cgi.c
parent96e9fa5f224966531fa8f9cf18cbc4bbb2fe60ed (diff)
downloadsamba-3a7458f9472432ef12c43008414925fd1ce8ea0c.tar.gz
samba-3a7458f9472432ef12c43008414925fd1ce8ea0c.tar.xz
samba-3a7458f9472432ef12c43008414925fd1ce8ea0c.zip
Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings. (Adds a lot of const). Andrew Bartlett
Diffstat (limited to 'source/web/cgi.c')
-rw-r--r--source/web/cgi.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/web/cgi.c b/source/web/cgi.c
index c9cb78f6f1a..1cec580c675 100644
--- a/source/web/cgi.c
+++ b/source/web/cgi.c
@@ -40,7 +40,7 @@ static int num_variables;
static int content_length;
static int request_post;
static char *query_string;
-static char *baseurl;
+static const char *baseurl;
static char *pathinfo;
static char *C_user;
static BOOL inetd_server;
@@ -242,7 +242,7 @@ void cgi_load_variables(void)
browser. Also doesn't allow for variables[] containing multiple variables
with the same name and the same or different values.
***************************************************************************/
-char *cgi_variable(char *name)
+const char *cgi_variable(const char *name)
{
int i;
@@ -255,7 +255,7 @@ char *cgi_variable(char *name)
/***************************************************************************
tell a browser about a fatal error in the http processing
***************************************************************************/
-static void cgi_setup_error(char *err, char *header, char *info)
+static void cgi_setup_error(const char *err, const char *header, const char *info)
{
if (!got_request) {
/* damn browsers don't like getting cut off before they give a request */
@@ -301,10 +301,10 @@ authenticate when we are running as a CGI
***************************************************************************/
static void cgi_web_auth(void)
{
- char *user = getenv("REMOTE_USER");
+ const char *user = getenv("REMOTE_USER");
struct passwd *pwd;
- char *head = "Content-Type: text/html\r\n\r\n<HTML><BODY><H1>SWAT installation Error</H1>\n";
- char *tail = "</BODY></HTML>\r\n";
+ const char *head = "Content-Type: text/html\r\n\r\n<HTML><BODY><H1>SWAT installation Error</H1>\n";
+ const char *tail = "</BODY></HTML>\r\n";
if (!user) {
printf("%sREMOTE_USER not set. Not authenticated by web server.<br>%s\n",
@@ -333,7 +333,7 @@ decode a base64 string in-place - simple and slow algorithm
***************************************************************************/
static void base64_decode(char *s)
{
- char *b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ const char *b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int bit_offset, byte_offset, idx, i, n;
unsigned char *d = (unsigned char *)s;
char *p;
@@ -607,7 +607,7 @@ void cgi_setup(const char *rootdir, int auth_required)
/***************************************************************************
return the current pages URL
***************************************************************************/
-char *cgi_baseurl(void)
+const char *cgi_baseurl(void)
{
if (inetd_server) {
return baseurl;
@@ -618,7 +618,7 @@ char *cgi_baseurl(void)
/***************************************************************************
return the current pages path info
***************************************************************************/
-char *cgi_pathinfo(void)
+const char *cgi_pathinfo(void)
{
char *r;
if (inetd_server) {