diff options
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)); } |