From 01ceb5e2d7b7b4492ed3f2bd1e95fe9b4d68ad47 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 11 Nov 1998 23:47:03 +0000 Subject: changed is_root() to am_root() to prevent clash with variable names. (This used to be commit 52f47b8d2ef5ee64e2f8dcfeb6840071e57904d1) --- source3/include/proto.h | 2 +- source3/web/cgi.c | 4 ++-- source3/web/swat.c | 20 +++++++++----------- 3 files changed, 12 insertions(+), 14 deletions(-) (limited to 'source3') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6bb801b633..5c0efaf93c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2629,7 +2629,7 @@ int smbw_stat(const char *fname, struct stat *st); void cgi_load_variables(FILE *f1); char *cgi_variable(char *name); -BOOL is_root(void); +BOOL am_root(void); char *get_user_name(void); void cgi_setup(char *rootdir, int auth_required); char *cgi_baseurl(void); diff --git a/source3/web/cgi.c b/source3/web/cgi.c index 41d099bac9..5415abf6b3 100644 --- a/source3/web/cgi.c +++ b/source3/web/cgi.c @@ -321,7 +321,7 @@ static int cgi_handle_authorization(char *line) /*************************************************************************** is this root? ***************************************************************************/ -BOOL is_root(void) +BOOL am_root(void) { if ((C_user) && (strcmp(C_user,"root") == 0)) { return( True); @@ -411,7 +411,7 @@ void cgi_setup(char *rootdir, int auth_required) char *x; /* Save the users name if available */ - if ((x = getenv("REMOTE_USER"))!=NULL) { + if ((x = getenv("REMOTE_USER"))) { C_user = strdup(x); } else { C_user = ""; diff --git a/source3/web/swat.c b/source3/web/swat.c index da032e077d..038829337d 100644 --- a/source3/web/swat.c +++ b/source3/web/swat.c @@ -405,7 +405,7 @@ static void show_main_buttons(void) image_link("Home", "", "images/home.gif"); /* Root gets full functionality */ - if ( is_root() == True) { + if (am_root() == True) { image_link("Globals", "globals", "images/globals.gif"); image_link("Shares", "shares", "images/shares.gif"); image_link("Printers", "printers", "images/printers.gif"); @@ -632,7 +632,7 @@ static BOOL talk_to_smbpasswd(char *old, char *new) /* * smbpasswd requires a regular old user to send their old password */ - if ( is_root() == False) { + if (am_root() == False) { n = (strlen(old) <= (MAX_STRINGLEN)) ? strlen(old) : (MAX_STRINGLEN); strncpy( line, old, n); line[n] = '\n'; n++; /* add carriage return */ @@ -727,7 +727,7 @@ static BOOL talk_to_smbpasswd(char *old, char *new) /* Root can do more */ - if (is_root() == True) { + if (am_root() == True) { if (cgi_variable(add_user_flag)) { /* * Add a user @@ -838,7 +838,6 @@ static BOOL become_id(uid_t uid,gid_t gid) ****************************************************************************/ static void chg_passwd(void) { - char *s; struct passwd *pass = NULL; BOOL rslt; @@ -855,7 +854,7 @@ static void chg_passwd(void) if (!cgi_variable(disable_user_flag)) { /* If current user is not root, make sure old password has been specified */ - if ((is_root() == False) && (strlen( cgi_variable(old_pswd)) <= 0)) { + if ((am_root() == False) && (strlen( cgi_variable(old_pswd)) <= 0)) { printf("

Must specify \"Old Password\" \n"); return; } @@ -875,7 +874,7 @@ static void chg_passwd(void) } /* Get the UID/GID of the user, and become that user */ - if (is_root() == False) { + if (am_root() == False) { pass = Get_Pwnam(cgi_variable(user),True); if (pass == NULL) { printf("

User uid unknown \n"); @@ -902,7 +901,7 @@ static void chg_passwd(void) rslt = talk_to_smbpasswd( cgi_variable(old_pswd), cgi_variable(new_pswd)); - if (is_root() == False) { + if (am_root() == False) { if (rslt == True) { printf("

The passwd for '%s' has been changed. \n",cgi_variable(user)); } else { @@ -919,7 +918,6 @@ static void chg_passwd(void) static void passwd_page(void) { char *new_name; - int i; printf("

Password Manager

\n"); @@ -941,7 +939,7 @@ static void passwd_page(void) } printf("

User Name : \n", user, new_name); - if (is_root() == False) { + if (am_root() == False) { printf("

Old Password: \n",old_pswd); } printf("

New Password: \n",new_pswd); @@ -950,7 +948,7 @@ static void passwd_page(void) printf("

"); printf(""); printf("", chg_passwd_flag); - if (is_root() == True) { + if (am_root() == True) { printf("", add_user_flag); printf("", disable_user_flag); } @@ -1102,7 +1100,7 @@ static void printers_page(void) page = cgi_pathinfo(); /* Root gets full functionality */ - if ( is_root() == True) { + if (am_root() == True) { if (strcmp(page, "globals")==0) { globals_page(); } else if (strcmp(page,"shares")==0) { -- cgit