* fhandler.cc (fhandler_base::open): Simplify access evaluation
expression. (fhandler_base::facl): New method. * fhandler.h: Declare facl method in fhandler_base, fhandler_disk_file and fhandler_virtual. * fhandler_disk_file.cc (fhandler_disk_file::facl): New method. * fhandler_virtual.cc (fhandler_virtual::facl): New method. * sec_acl.cc: Remove forward declaration for aclsort32 and acl32. (setacl): Remove static. Add and use handle parameter. (getacl): Ditto. (acl_worker): Reorganize to call fhandler's facl method eventually. (facl32): Ditto. * security.cc (get_nt_object_security): Remove static. * security.h: Add extern declarations for get_nt_object_security, aclsort32, acl32, getacl and setacl. Apply missing syscalls.cc patch and ChangeLog of previous check in. * syscalls.cc (chown_worker): Reorganize to call fhandler's fchown method eventually. (fchown): Ditto.
This commit is contained in:
@ -13,6 +13,7 @@ details. */
|
||||
#include <stdlib.h>
|
||||
#include <sys/cygwin.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/acl.h>
|
||||
#include <signal.h>
|
||||
#include "cygerrno.h"
|
||||
#include "perprocess.h"
|
||||
@ -442,27 +443,28 @@ fhandler_base::open (int flags, mode_t mode)
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (query_open ())
|
||||
switch (query_open ())
|
||||
{
|
||||
case query_null_access:
|
||||
access = 0;
|
||||
break;
|
||||
case query_read_control:
|
||||
access = READ_CONTROL;
|
||||
break;
|
||||
case query_write_control:
|
||||
access = READ_CONTROL | WRITE_OWNER | WRITE_DAC;
|
||||
break;
|
||||
}
|
||||
else if (get_major () == DEV_TAPE_MAJOR)
|
||||
access = GENERIC_READ | GENERIC_WRITE;
|
||||
else if ((flags & (O_RDONLY | O_WRONLY | O_RDWR)) == O_RDONLY)
|
||||
access = GENERIC_READ;
|
||||
else if ((flags & (O_RDONLY | O_WRONLY | O_RDWR)) == O_WRONLY)
|
||||
access = GENERIC_WRITE;
|
||||
else
|
||||
access = GENERIC_READ | GENERIC_WRITE;
|
||||
switch (query_open ())
|
||||
{
|
||||
case query_null_access:
|
||||
access = 0;
|
||||
break;
|
||||
case query_read_control:
|
||||
access = READ_CONTROL;
|
||||
break;
|
||||
case query_write_control:
|
||||
access = READ_CONTROL | WRITE_OWNER | WRITE_DAC;
|
||||
break;
|
||||
default:
|
||||
if (get_major () == DEV_TAPE_MAJOR)
|
||||
access = GENERIC_READ | GENERIC_WRITE;
|
||||
else if ((flags & (O_RDONLY | O_WRONLY | O_RDWR)) == O_RDONLY)
|
||||
access = GENERIC_READ;
|
||||
else if ((flags & (O_RDONLY | O_WRONLY | O_RDWR)) == O_WRONLY)
|
||||
access = GENERIC_WRITE;
|
||||
else
|
||||
access = GENERIC_READ | GENERIC_WRITE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Allow reliable lseek on disk devices. */
|
||||
if (get_major () == DEV_FLOPPY_MAJOR)
|
||||
@ -1429,3 +1431,10 @@ fhandler_base::fchown (__uid32_t uid, __gid32_t gid)
|
||||
/* By default, just succeeds. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
fhandler_base::facl (int cmd, int nentries, __aclent32_t *aclbufp)
|
||||
{
|
||||
/* By default, just succeeds. */
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user