]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
allow initial creation of smb.conf with SWAT
authorAndrew Tridgell <tridge@samba.org>
Thu, 10 Dec 1998 13:55:21 +0000 (13:55 +0000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 10 Dec 1998 13:55:21 +0000 (13:55 +0000)
source/web/swat.c

index 9cb33733519de3eb4d13934758f3b44756f36b51..aa9f8790299bcacb48e7ee66469f7c65b96b789b 100644 (file)
@@ -921,13 +921,20 @@ static void printers_page(void)
        
        cgi_load_variables(NULL);
 
-       /* check if the authenticated user has write access - if not then
-          don't show write options */
-       have_write_access = (access(servicesf,W_OK) == 0);
+       if (!file_exist(servicesf, NULL)) {
+               have_read_access = True;
+               have_write_access = True;
+       } else {
+               /* check if the authenticated user has write access - if not then
+                  don't show write options */
+               have_write_access = (access(servicesf,W_OK) == 0);
+
+               /* if the user doesn't have read access to smb.conf then
+                  don't let them view it */
+               have_read_access = (access(servicesf,R_OK) == 0);
+       }
+
 
-       /* if the user doesn't have read access to smb.conf then
-          don't let them view it */
-       have_read_access = (access(servicesf,R_OK) == 0);
 
        show_main_buttons();