From 44ce5603ddbb1b9d75bfff58e40e7f1ea2821c67 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 27 Nov 2009 12:42:39 +0100 Subject: s3: Pass the "fake dir create times" parameter to sys_*stat Step 0 to restore it as a per-share paramter --- source3/utils/net_conf.c | 2 +- source3/utils/net_usershare.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index 4b511f2faa..736871f215 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -654,7 +654,7 @@ static int net_conf_addshare(struct net_context *c, goto done; } - if (sys_stat(path, &sbuf) != 0) { + if (sys_stat(path, &sbuf, lp_fake_dir_create_times()) != 0) { d_fprintf(stderr, _("ERROR: cannot stat path '%s' to ensure " "this is a directory.\n" diff --git a/source3/utils/net_usershare.c b/source3/utils/net_usershare.c index edcb7df5cb..9e2bf29409 100644 --- a/source3/utils/net_usershare.c +++ b/source3/utils/net_usershare.c @@ -248,7 +248,8 @@ static int get_share_list(TALLOC_CTX *ctx, const char *wcard, bool only_ours) return -1; } - if (sys_lstat(path, &sbuf) != 0) { + if (sys_lstat(path, &sbuf, lp_fake_dir_create_times()) + != 0) { d_fprintf(stderr, _("get_share_list: can't lstat file %s. Error " "was %s\n"), @@ -365,7 +366,7 @@ static int info_fn(struct file_list *fl, void *priv) } /* Paranoia... */ - if (sys_fstat(fd, &sbuf) != 0) { + if (sys_fstat(fd, &sbuf, lp_fake_dir_create_times()) != 0) { d_fprintf(stderr, _("info_fn: can't fstat file %s. Error was %s\n"), basepath, strerror(errno) ); @@ -585,7 +586,8 @@ static int count_num_usershares(void) return -1; } - if (sys_lstat(path, &sbuf) != 0) { + if (sys_lstat(path, &sbuf, lp_fake_dir_create_times()) + != 0) { d_fprintf(stderr, _("count_num_usershares: can't lstat file %s. " "Error was %s\n"), @@ -749,7 +751,7 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv) } /* Check the directory to be shared exists. */ - if (sys_stat(us_path, &sbuf) != 0) { + if (sys_stat(us_path, &sbuf, lp_fake_dir_create_times()) != 0) { d_fprintf(stderr, _("net usershare add: cannot stat path %s to ensure " "this is a directory. Error was %s\n"), @@ -892,7 +894,8 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv) } /* Ensure we opened the file we thought we did. */ - if (sys_lstat(full_path_tmp, &lsbuf) != 0) { + if (sys_lstat(full_path_tmp, &lsbuf, lp_fake_dir_create_times()) + != 0) { d_fprintf(stderr, _("net usershare add: cannot lstat tmp file %s\n"), full_path_tmp ); @@ -901,7 +904,7 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv) } /* Check this is the same as the file we opened. */ - if (sys_fstat(tmpfd, &sbuf) != 0) { + if (sys_fstat(tmpfd, &sbuf, lp_fake_dir_create_times()) != 0) { d_fprintf(stderr, _("net usershare add: cannot fstat tmp file %s\n"), full_path_tmp ); -- cgit