summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrell Lipman <derrell.lipman@unwireduniverse.com>2008-01-17 09:29:13 -0500
committerDerrell Lipman <derrell.lipman@unwireduniverse.com>2008-01-17 09:29:13 -0500
commit096e40c9169b2121a82c42d3cf31cbfb869603ce (patch)
tree387d589ec96a68a2a82114563312179c05635090
parentdba2400192e7d3afb9d1c48f52eeccd0c2f660e9 (diff)
downloadsamba-096e40c9169b2121a82c42d3cf31cbfb869603ce.tar.gz
samba-096e40c9169b2121a82c42d3cf31cbfb869603ce.tar.bz2
samba-096e40c9169b2121a82c42d3cf31cbfb869603ce.zip
Fix stat results to be consistent between smbc_stat and smbc_fstat.
We create a kludged inode based on the checksum of the path. We therefore need to use the same (full) path when calculating it in both smbc_stat() and smbc_fstat(). If struct stat has an rdev field, set it to zero. Derrell (This used to be commit b4282fbd6d27d868b2d5c04bb72d2d7421822da1)
-rw-r--r--source3/libsmb/libsmbclient.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index fb04d143a5..077970647d 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -2264,6 +2264,9 @@ smbc_setup_stat(SMBCCTX *context,
#ifdef HAVE_STAT_ST_BLOCKS
st->st_blocks = (size+511)/512;
#endif
+#ifdef HAVE_STRUCT_STAT_ST_RDEV
+ st->st_rdev = 0;
+#endif
st->st_uid = getuid();
st->st_gid = getgid();
@@ -2367,7 +2370,7 @@ smbc_stat_ctx(SMBCCTX *context,
st->st_ino = ino;
- smbc_setup_stat(context, st, path, size, mode);
+ smbc_setup_stat(context, st, (char *) fname, size, mode);
set_atimespec(st, access_time_ts);
set_ctimespec(st, change_time_ts);