Fix stat results to be consistent between smbc_stat and smbc_fstat.
authorDerrell Lipman <derrell.lipman@unwireduniverse.com>
Thu, 17 Jan 2008 14:29:13 +0000 (09:29 -0500)
committerDerrell Lipman <derrell.lipman@unwireduniverse.com>
Thu, 17 Jan 2008 14:29:13 +0000 (09:29 -0500)
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)

source3/libsmb/libsmbclient.c

index fb04d143a588836226f1ad0d0991acc3464dbc28..077970647d993dc5c67a7a899e80e0065e0858ad 100644 (file)
@@ -2263,6 +2263,9 @@ smbc_setup_stat(SMBCCTX *context,
 #endif
 #ifdef HAVE_STAT_ST_BLOCKS
        st->st_blocks = (size+511)/512;
 #endif
 #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();
 #endif
        st->st_uid = getuid();
        st->st_gid = getgid();
@@ -2367,7 +2370,7 @@ smbc_stat_ctx(SMBCCTX *context,
 
        st->st_ino = ino;
 
 
        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);
 
        set_atimespec(st, access_time_ts);
        set_ctimespec(st, change_time_ts);