From: Andrew Tridgell Date: Thu, 10 Dec 1998 13:55:21 +0000 (+0000) Subject: allow initial creation of smb.conf with SWAT X-Git-Tag: samba-2.0.0beta4~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60f6e01565682553059aabe673cf68963333a831;p=thirdparty%2Fsamba.git allow initial creation of smb.conf with SWAT --- diff --git a/source/web/swat.c b/source/web/swat.c index 9cb33733519..aa9f8790299 100644 --- a/source/web/swat.c +++ b/source/web/swat.c @@ -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();