From: Volker Lendecke Date: Wed, 8 Dec 2010 14:03:36 +0000 (+0100) Subject: s3: Fix ENODATA for getacl on .snapshot dirs X-Git-Url: http://git.samba.org/?p=obnox%2Fsamba-ctdb.git;a=commitdiff_plain;h=f3e8ac7e1c01b3ebc49a8db697c47bb01c69e49d s3: Fix ENODATA for getacl on .snapshot dirs The best we can do is to allow everything to the world. --- diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index c8cc96eacf..55d4dedc54 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -175,6 +175,7 @@ static void gpfs_dumpacl(int level, struct gpfs_acl *gacl) static struct gpfs_acl *gpfs_getacl_alloc(const char *fname, gpfs_aclType_t type) { struct gpfs_acl *acl; + struct gpfs_ace_v4 *ace; size_t len = 200; int ret; TALLOC_CTX *mem_ctx = talloc_tos(); @@ -207,12 +208,26 @@ static struct gpfs_acl *gpfs_getacl_alloc(const char *fname, gpfs_aclType_t type ret = smbd_gpfs_getacl((char *)fname, GPFS_GETACL_STRUCT | GPFS_ACL_SAMBA, acl); } - if (ret != 0) - { + if (ret == 0) { + return acl; + } + if (errno != ENODATA) { DEBUG(8, ("smbd_gpfs_getacl failed with %s\n",strerror(errno))); return NULL; } + DEBUG(10, ("gpfs_getacl returned ENODATA, returning bogus ACL\n")); + + acl->acl_nace = 1; + acl->acl_type = GPFS_ACL_TYPE_NFS4; + + ace = &acl->ace_v4[0]; + ace->aceWho = ACE4_SPECIAL_EVERYONE; + ace->aceType = ACE4_TYPE_ALLOW; + ace->aceMask = ACE4_MASK_ALL; + ace->aceIFlags = ACE4_IFLAG_SPECIAL_ID; + ace->aceFlags = 0; + return acl; }