summaryrefslogtreecommitdiffstats
path: root/source3/web
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-11-11 23:47:03 +0000
committerAndrew Tridgell <tridge@samba.org>1998-11-11 23:47:03 +0000
commit01ceb5e2d7b7b4492ed3f2bd1e95fe9b4d68ad47 (patch)
treee4e677a95af0c94f1c761ea8a028a350c82031bb /source3/web
parentf9584f93be33ee69912708e6402809f47703a5d5 (diff)
downloadsamba-01ceb5e2d7b7b4492ed3f2bd1e95fe9b4d68ad47.tar.gz
samba-01ceb5e2d7b7b4492ed3f2bd1e95fe9b4d68ad47.tar.xz
samba-01ceb5e2d7b7b4492ed3f2bd1e95fe9b4d68ad47.zip
changed is_root() to am_root() to prevent clash with variable names.
(This used to be commit 52f47b8d2ef5ee64e2f8dcfeb6840071e57904d1)
Diffstat (limited to 'source3/web')
-rw-r--r--source3/web/cgi.c4
-rw-r--r--source3/web/swat.c20
2 files changed, 11 insertions, 13 deletions
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("<p> 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("<p> 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("<p> 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("<H2>Password Manager</H2>\n");
@@ -941,7 +939,7 @@ static void passwd_page(void)
}
printf("<p> User Name : <input type=text size=30 name=%s value=%s> \n", user, new_name);
- if (is_root() == False) {
+ if (am_root() == False) {
printf("<p> Old Password: <input type=password size=30 name=%s>\n",old_pswd);
}
printf("<p> New Password: <input type=password size=30 name=%s>\n",new_pswd);
@@ -950,7 +948,7 @@ static void passwd_page(void)
printf("</select></td></tr><p>");
printf("<tr><td>");
printf("<input type=submit name=%s value=\"Change Password\">", chg_passwd_flag);
- if (is_root() == True) {
+ if (am_root() == True) {
printf("<input type=submit name=%s value=\"Add New User\">", add_user_flag);
printf("<input type=submit name=%s value=\"Disable User\">", 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) {