From eb61d92ca7053bef9142a29f296aae695c47db33 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 4 Jan 2002 21:11:35 +0000 Subject: 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. Jeremy. (This used to be commit e6b27f3d8069ae304baaebe09341c58d46b05fe4) --- source3/smbd/vfs.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'source3/smbd/vfs.c') diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 6d8e9cc76c..afdfe8c48f 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -231,10 +231,10 @@ int vfs_mkdir(connection_struct *conn, const char *name, mode_t mode) } /******************************************************************* - Check if a vfs file exists. + Check if an object exists in the vfs. ********************************************************************/ -BOOL vfs_file_exist(connection_struct *conn,const char *fname,SMB_STRUCT_STAT *sbuf) +BOOL vfs_object_exist(connection_struct *conn,const char *fname,SMB_STRUCT_STAT *sbuf) { SMB_STRUCT_STAT st; @@ -243,9 +243,26 @@ BOOL vfs_file_exist(connection_struct *conn,const char *fname,SMB_STRUCT_STAT *s 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)); } -- cgit