s3: Pass fake_dir_create_times down to file_exist_stat, none of the callers look...
authorVolker Lendecke <vl@samba.org>
Fri, 27 Nov 2009 12:17:05 +0000 (13:17 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 29 Nov 2009 10:22:04 +0000 (11:22 +0100)
source3/client/client.c
source3/include/proto.h
source3/lib/util.c
source3/web/cgi.c

index 1990ae801b1ccdd77d3a2036f55a3a87345e2fe0..504b1dd9b30ba5dcd6d6a6153abdffbc804573f6 100644 (file)
@@ -1745,7 +1745,7 @@ static int cmd_put(void)
                SMB_STRUCT_STAT st;
                /* allow '-' to represent stdin
                   jdblair, 24.jun.98 */
-               if (!file_exist_stat(lname,&st) &&
+               if (!file_exist_stat(lname, &st, false) &&
                    (strcmp(lname,"-"))) {
                        d_printf("%s does not exist\n",lname);
                        return 1;
@@ -3618,7 +3618,7 @@ static int cmd_reput(void)
                return 1;
        }
 
-       if (!file_exist_stat(local_name, &st)) {
+       if (!file_exist_stat(local_name, &st, false)) {
                d_printf("%s does not exist\n", local_name);
                return 1;
        }
index 55da2cf8dbc54c7f85e4687ce846904b408048cd..23b7f66257f6f97441aa4688898fd41f41dc5517 100644 (file)
@@ -1119,7 +1119,8 @@ struct user_auth_info *get_cmdline_auth_info_copy(TALLOC_CTX *mem_ctx,
                                                 const struct user_auth_info *info);
 bool set_cmdline_auth_info_machine_account_creds(struct user_auth_info *auth_info);
 void set_cmdline_auth_info_getpass(struct user_auth_info *auth_info);
-bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf);
+bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf,
+                    bool fake_dir_create_times);
 bool socket_exist(const char *fname);
 bool directory_exist_stat(char *dname,SMB_STRUCT_STAT *st);
 uint64_t get_file_size_stat(const SMB_STRUCT_STAT *sbuf);
index de2204074d3c9cbe5d169cfca543aed5257b89a0..b074a1bd6ccd8d6882bcffd6195aab8cefc22a08 100644 (file)
@@ -527,13 +527,14 @@ void set_cmdline_auth_info_getpass(struct user_auth_info *auth_info)
  Check if a file exists - call vfs_file_exist for samba files.
 ********************************************************************/
 
-bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf)
+bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf,
+                    bool fake_dir_create_times)
 {
        SMB_STRUCT_STAT st;
        if (!sbuf)
                sbuf = &st;
 
-       if (sys_stat(fname, sbuf, lp_fake_dir_create_times()) != 0)
+       if (sys_stat(fname, sbuf, fake_dir_create_times) != 0)
                return(False);
 
        return((S_ISREG(sbuf->st_ex_mode)) || (S_ISFIFO(sbuf->st_ex_mode)));
index 48e75aee566e0a5ef12802a1e2ffc96c87849493..39108cf36197025a12d512bd87a68054d2dc8c25 100644 (file)
@@ -450,7 +450,8 @@ static void cgi_download(char *file)
        if (S_ISDIR(st.st_ex_mode))
        {
                snprintf(buf, sizeof(buf), "%s/index.html", file);
-               if (!file_exist_stat(buf, &st) || !S_ISREG(st.st_ex_mode))
+               if (!file_exist_stat(buf, &st, false)
+                   || !S_ISREG(st.st_ex_mode))
                {
                        cgi_setup_error("404 File Not Found","",
                                        "The requested file was not found");