summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-11-27 13:17:05 +0100
committerVolker Lendecke <vl@samba.org>2009-11-29 11:22:04 +0100
commit33601b8632edf65af4d4ab787c5615ab5c6af6fb (patch)
tree05fbc260d64a759d2883d547910f8a9235b58336
parent129e976c47037731c9344a3994597b5781210914 (diff)
downloadsamba-33601b8632edf65af4d4ab787c5615ab5c6af6fb.tar.gz
samba-33601b8632edf65af4d4ab787c5615ab5c6af6fb.tar.bz2
samba-33601b8632edf65af4d4ab787c5615ab5c6af6fb.zip
s3: Pass fake_dir_create_times down to file_exist_stat, none of the callers look at the mtime
-rw-r--r--source3/client/client.c4
-rw-r--r--source3/include/proto.h3
-rw-r--r--source3/lib/util.c5
-rw-r--r--source3/web/cgi.c3
4 files changed, 9 insertions, 6 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 1990ae801b..504b1dd9b3 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -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;
}
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 55da2cf8db..23b7f66257 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -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);
diff --git a/source3/lib/util.c b/source3/lib/util.c
index de2204074d..b074a1bd6c 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -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)));
diff --git a/source3/web/cgi.c b/source3/web/cgi.c
index 48e75aee56..39108cf361 100644
--- a/source3/web/cgi.c
+++ b/source3/web/cgi.c
@@ -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");