summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-02-28 01:53:19 +0000
committerJeremy Allison <jra@samba.org>2004-02-28 01:53:19 +0000
commita51129c4740cc4795440c193a99cedf844531462 (patch)
tree39ea8e843b85c915e29cd2e9600c53863b3c2a1d /source3/smbd/open.c
parentcff0114f2b5965cfc49f39061305ff23fa4f3931 (diff)
downloadsamba-a51129c4740cc4795440c193a99cedf844531462.tar.gz
samba-a51129c4740cc4795440c193a99cedf844531462.tar.bz2
samba-a51129c4740cc4795440c193a99cedf844531462.zip
Can't set allocation size on directories, return correct error code on
fail if file exists and target is a directory. gentest. Jeremy. (This used to be commit 4b1262322995c8794cd73d84712f82d8c91abdc6)
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r--source3/smbd/open.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index dd10a87055..e688f8de48 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -866,7 +866,11 @@ files_struct *open_file_shared1(connection_struct *conn,char *fname, SMB_STRUCT_
DEBUG(5,("open_file_shared: create new requested for file %s and file already exists.\n",
fname ));
file_free(fsp);
- errno = EEXIST;
+ if (S_ISDIR(psbuf->st_mode)) {
+ errno = EISDIR;
+ } else {
+ errno = EEXIST;
+ }
return NULL;
}