summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_open.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-12-17 04:51:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:07:28 -0500
commit3b8e83a8c8f32ca658841f1fae344399a48d66a4 (patch)
treefebc6b07ebea32366b3ecc8f7b4862f7294e6798 /source4/ntvfs/posix/pvfs_open.c
parent50005129ab0a5c5f2422460e6d7c19616e5e1124 (diff)
downloadsamba-3b8e83a8c8f32ca658841f1fae344399a48d66a4.tar.gz
samba-3b8e83a8c8f32ca658841f1fae344399a48d66a4.tar.bz2
samba-3b8e83a8c8f32ca658841f1fae344399a48d66a4.zip
r4243: a sniff from kukks showed that the ea_set interface in trans2 setfileinfo allows
for multiple EAs to be set at once. This fixes all the ea code to allow for that. (This used to be commit b26828bef5d55e5eef0e34a164e76292df45e207)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_open.c')
-rw-r--r--source4/ntvfs/posix/pvfs_open.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c
index e31d79b9e0..bd96b935ad 100644
--- a/source4/ntvfs/posix/pvfs_open.c
+++ b/source4/ntvfs/posix/pvfs_open.c
@@ -70,6 +70,11 @@ static int pvfs_dir_handle_destructor(void *p)
struct pvfs_file_handle *h = p;
if (h->create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE) {
+ NTSTATUS status = pvfs_xattr_unlink_hook(h->pvfs, h->name->full_name);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0,("Warning: xattr rmdir hook failed for '%s' - %s\n",
+ h->name->full_name, nt_errstr(status)));
+ }
if (rmdir(h->name->full_name) != 0) {
DEBUG(0,("pvfs_close: failed to rmdir '%s' - %s\n",
h->name->full_name, strerror(errno)));
@@ -459,15 +464,13 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
/* setup any EAs that were asked for */
if (io->ntcreatex.in.ea_list) {
- int i;
- for (i=0;i<io->ntcreatex.in.ea_list->num_eas;i++) {
- status = pvfs_setfileinfo_ea_set(pvfs, name, fd,
- &io->ntcreatex.in.ea_list->eas[i]);
- if (!NT_STATUS_IS_OK(status)) {
- idr_remove(pvfs->idtree_fnum, fnum);
- close(fd);
- return status;
- }
+ status = pvfs_setfileinfo_ea_set(pvfs, name, fd,
+ io->ntcreatex.in.ea_list->num_eas,
+ io->ntcreatex.in.ea_list->eas);
+ if (!NT_STATUS_IS_OK(status)) {
+ idr_remove(pvfs->idtree_fnum, fnum);
+ close(fd);
+ return status;
}
}