diff options
author | Jeremy Allison <jra@samba.org> | 2002-01-04 20:06:04 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-01-04 20:06:04 +0000 |
commit | f01357737b9cdd85732439eb153d0a0b8f26e66c (patch) | |
tree | 9a94833dd1e75c3cf08829917f5e6227ec600f5f /source/smbd/vfs.c | |
parent | f97ce504d2cd29b09793fec4bf532a2acce44e1a (diff) | |
download | samba-f01357737b9cdd85732439eb153d0a0b8f26e66c.tar.gz samba-f01357737b9cdd85732439eb153d0a0b8f26e66c.tar.xz samba-f01357737b9cdd85732439eb153d0a0b8f26e66c.zip |
Re-wrote the guts of the rename_internals code to cope with a reported
bug (renaming name -> name was failing, on W2K it succeeds). Simplified
the common case, did a lot of work to ensure NT error codes are correctly
reported back to client. Now to port this to HEAD and app-head.
Jeremy.
Diffstat (limited to 'source/smbd/vfs.c')
-rw-r--r-- | source/smbd/vfs.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/source/smbd/vfs.c b/source/smbd/vfs.c index 499072dcd8f..dc22109d612 100644 --- a/source/smbd/vfs.c +++ b/source/smbd/vfs.c @@ -348,10 +348,10 @@ char *vfs_getwd(connection_struct *conn, char *unix_path) } /******************************************************************* - Check if a vfs file exists. + Check if an object exists in the vfs. ********************************************************************/ -BOOL vfs_file_exist(connection_struct *conn,char *fname,SMB_STRUCT_STAT *sbuf) +BOOL vfs_object_exist(connection_struct *conn,char *fname,SMB_STRUCT_STAT *sbuf) { SMB_STRUCT_STAT st; @@ -360,9 +360,26 @@ BOOL vfs_file_exist(connection_struct *conn,char *fname,SMB_STRUCT_STAT *sbuf) ZERO_STRUCTP(sbuf); - if (vfs_stat(conn,fname,sbuf) != 0) + if (vfs_stat(conn,fname,sbuf) == -1) return(False); + return True; +} + +/******************************************************************* + Check if a file exists in the vfs. +********************************************************************/ +BOOL vfs_file_exist(connection_struct *conn,char *fname,SMB_STRUCT_STAT *sbuf) +{ + SMB_STRUCT_STAT st; + + if (!sbuf) + sbuf = &st; + + ZERO_STRUCTP(sbuf); + + if (vfs_stat(conn,fname,sbuf) == -1) + return False; return(S_ISREG(sbuf->st_mode)); } |