* fhandler_disk_file.cc (fhandler_disk_file::facl): Pretend successful
SETACL if no acls are available. * fhandler.cc (fhandler_base::facl): Implement to return sensible values on GETACL and GETACLCNT. Pretend successful SETACL. * fhandler_virtual.cc (fhandler_virtual::facl): Ditto.
This commit is contained in:
parent
36ca239fd4
commit
aafdf30f7a
@ -1,3 +1,11 @@
|
|||||||
|
2005-01-14 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_disk_file.cc (fhandler_disk_file::facl): Pretend successful
|
||||||
|
SETACL if no acls are available.
|
||||||
|
* fhandler.cc (fhandler_base::facl): Implement to return sensible
|
||||||
|
values on GETACL and GETACLCNT. Pretend successful SETACL.
|
||||||
|
* fhandler_virtual.cc (fhandler_virtual::facl): Ditto.
|
||||||
|
|
||||||
2005-01-13 Corinna Vinschen <corinna@vinschen.de>
|
2005-01-13 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler.h (fhandler_disk_file::touch_ctime): Declare.
|
* fhandler.h (fhandler_disk_file::touch_ctime): Declare.
|
||||||
|
@ -1539,6 +1539,41 @@ fhandler_base::fchown (__uid32_t uid, __gid32_t gid)
|
|||||||
int
|
int
|
||||||
fhandler_base::facl (int cmd, int nentries, __aclent32_t *aclbufp)
|
fhandler_base::facl (int cmd, int nentries, __aclent32_t *aclbufp)
|
||||||
{
|
{
|
||||||
/* By default, just succeeds. */
|
int res = -1;
|
||||||
return 0;
|
switch (cmd)
|
||||||
|
{
|
||||||
|
case SETACL:
|
||||||
|
/* By default, just succeeds. */
|
||||||
|
res = 0;
|
||||||
|
break;
|
||||||
|
case GETACL:
|
||||||
|
if (!aclbufp)
|
||||||
|
set_errno(EFAULT);
|
||||||
|
else if (nentries < MIN_ACL_ENTRIES)
|
||||||
|
set_errno (ENOSPC);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
aclbufp[0].a_type = USER_OBJ;
|
||||||
|
aclbufp[0].a_id = myself->uid;
|
||||||
|
aclbufp[0].a_perm = (S_IRUSR | S_IWUSR) >> 6;
|
||||||
|
aclbufp[1].a_type = GROUP_OBJ;
|
||||||
|
aclbufp[1].a_id = myself->gid;
|
||||||
|
aclbufp[1].a_perm = (S_IRGRP | S_IWGRP) >> 3;
|
||||||
|
aclbufp[2].a_type = OTHER_OBJ;
|
||||||
|
aclbufp[2].a_id = ILLEGAL_GID;
|
||||||
|
aclbufp[2].a_perm = S_IROTH | S_IWOTH;
|
||||||
|
aclbufp[3].a_type = CLASS_OBJ;
|
||||||
|
aclbufp[3].a_id = ILLEGAL_GID;
|
||||||
|
aclbufp[3].a_perm = S_IRWXU | S_IRWXG | S_IRWXO;
|
||||||
|
res = MIN_ACL_ENTRIES;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GETACLCNT:
|
||||||
|
res = MIN_ACL_ENTRIES;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
set_errno (EINVAL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -498,7 +498,11 @@ fhandler_disk_file::facl (int cmd, int nentries, __aclent32_t *aclbufp)
|
|||||||
struct __stat64 st;
|
struct __stat64 st;
|
||||||
|
|
||||||
case SETACL:
|
case SETACL:
|
||||||
set_errno (ENOSYS);
|
/* Open for writing required to be able to set ctime
|
||||||
|
(even though setting the ACL is just pretended). */
|
||||||
|
if (!get_io_handle ())
|
||||||
|
oret = open_fs (O_WRONLY | O_BINARY, 0);
|
||||||
|
res = 0;
|
||||||
break;
|
break;
|
||||||
case GETACL:
|
case GETACL:
|
||||||
if (!aclbufp)
|
if (!aclbufp)
|
||||||
|
@ -247,7 +247,12 @@ fhandler_virtual::fchown (__uid32_t uid, __gid32_t gid)
|
|||||||
int
|
int
|
||||||
fhandler_virtual::facl (int cmd, int nentries, __aclent32_t *aclbufp)
|
fhandler_virtual::facl (int cmd, int nentries, __aclent32_t *aclbufp)
|
||||||
{
|
{
|
||||||
/* Same as on Linux. */
|
int res = fhandler_base::facl (cmd, nentries, aclbufp);
|
||||||
set_errno (EPERM);
|
if (res >= 0 && cmd == GETACL)
|
||||||
return -1;
|
{
|
||||||
|
aclbufp[0].a_perm = (S_IRUSR | (pc.isdir () ? S_IXUSR : 0)) >> 6;
|
||||||
|
aclbufp[1].a_perm = (S_IRGRP | (pc.isdir () ? S_IXGRP : 0)) >> 3;
|
||||||
|
aclbufp[2].a_perm = S_IROTH | (pc.isdir () ? S_IXOTH : 0);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user