* cygwin.din: Add symbol for `lacl'.
* security.cc (ReadSD): Add debug output. (acl_worker): New static function. (acl): Call acl_worker now. (lacl): New function. (facl): Call acl_worker now. * include/cygwin/acl.h: Add prototype for `lacl'.
This commit is contained in:
parent
a4bf66dd75
commit
b53881fd27
|
@ -1,3 +1,15 @@
|
||||||
|
Thu Apr 13 8:48:00 2000 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* path.cc (conv_to_win32_path): Detect a win32 path
|
||||||
|
if path contains backslashes.
|
||||||
|
* cygwin.din: Add symbol for `lacl'.
|
||||||
|
* security.cc (ReadSD): Add debug output.
|
||||||
|
(acl_worker): New static function.
|
||||||
|
(acl): Call acl_worker now.
|
||||||
|
(lacl): New function.
|
||||||
|
(facl): Call acl_worker now.
|
||||||
|
* include/cygwin/acl.h: Add prototype for `lacl'.
|
||||||
|
|
||||||
Wed Apr 12 18:48:33 2000 Christopher Faylor <cgf@cygnus.com>
|
Wed Apr 12 18:48:33 2000 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
* path.cc (path_conv::path_conv): Ensure that suffix is correctly
|
* path.cc (path_conv::path_conv): Ensure that suffix is correctly
|
||||||
|
|
|
@ -1068,6 +1068,8 @@ acl
|
||||||
_acl = acl
|
_acl = acl
|
||||||
facl
|
facl
|
||||||
_facl = facl
|
_facl = facl
|
||||||
|
lacl
|
||||||
|
_lacl = lacl
|
||||||
aclcheck
|
aclcheck
|
||||||
_aclcheck = aclcheck
|
_aclcheck = aclcheck
|
||||||
aclsort
|
aclsort
|
||||||
|
|
|
@ -65,6 +65,7 @@ typedef struct acl {
|
||||||
} aclent_t;
|
} aclent_t;
|
||||||
|
|
||||||
int _EXFUN(acl,(const char *path, int cmd, int nentries, aclent_t *aclbufp));
|
int _EXFUN(acl,(const char *path, int cmd, int nentries, aclent_t *aclbufp));
|
||||||
|
int _EXFUN(lacl,(const char *path, int cmd, int nentries, aclent_t *aclbufp));
|
||||||
int _EXFUN(facl,(int fd, int cmd, int nentries, aclent_t *aclbufp));
|
int _EXFUN(facl,(int fd, int cmd, int nentries, aclent_t *aclbufp));
|
||||||
int _EXFUN(aclcheck,(aclent_t *aclbufp, int nentries, int *which));
|
int _EXFUN(aclcheck,(aclent_t *aclbufp, int nentries, int *which));
|
||||||
int _EXFUN(aclsort,(int nentries, int calclass, aclent_t *aclbufp));
|
int _EXFUN(aclsort,(int nentries, int calclass, aclent_t *aclbufp));
|
||||||
|
|
|
@ -396,6 +396,7 @@ ReadSD(const char *file, PSECURITY_DESCRIPTOR sdBuf, LPDWORD sdBufSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open file for read */
|
/* Open file for read */
|
||||||
|
debug_printf("file = %s", file);
|
||||||
HANDLE hFile = CreateFile (file, GENERIC_READ,
|
HANDLE hFile = CreateFile (file, GENERIC_READ,
|
||||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||||
&sec_none_nih, OPEN_EXISTING,
|
&sec_none_nih, OPEN_EXISTING,
|
||||||
|
@ -1518,11 +1519,12 @@ acl_access (const char *path, int flags)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C"
|
static
|
||||||
int
|
int
|
||||||
acl (const char *path, int cmd, int nentries, aclent_t *aclbufp)
|
acl_worker (const char *path, int cmd, int nentries, aclent_t *aclbufp,
|
||||||
|
int nofollow)
|
||||||
{
|
{
|
||||||
path_conv real_path (path);
|
path_conv real_path (path, nofollow ? SYMLINK_NOFOLLOW : SYMLINK_FOLLOW, 1);
|
||||||
if (real_path.error)
|
if (real_path.error)
|
||||||
{
|
{
|
||||||
set_errno (real_path.error);
|
set_errno (real_path.error);
|
||||||
|
@ -1542,7 +1544,8 @@ acl (const char *path, int cmd, int nentries, aclent_t *aclbufp)
|
||||||
case GETACL:
|
case GETACL:
|
||||||
if (nentries < 1)
|
if (nentries < 1)
|
||||||
set_errno (EINVAL);
|
set_errno (EINVAL);
|
||||||
else if (! stat (path, &st))
|
else if ((nofollow && ! lstat (path, &st))
|
||||||
|
|| (!nofollow && ! stat (path, &st)))
|
||||||
{
|
{
|
||||||
aclent_t lacl[4];
|
aclent_t lacl[4];
|
||||||
if (nentries > 0)
|
if (nentries > 0)
|
||||||
|
@ -1616,6 +1619,20 @@ acl (const char *path, int cmd, int nentries, aclent_t *aclbufp)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
int
|
||||||
|
acl (const char *path, int cmd, int nentries, aclent_t *aclbufp)
|
||||||
|
{
|
||||||
|
return acl_worker (path, cmd, nentries, aclbufp, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
int
|
||||||
|
lacl (const char *path, int cmd, int nentries, aclent_t *aclbufp)
|
||||||
|
{
|
||||||
|
return acl_worker (path, cmd, nentries, aclbufp, 1);
|
||||||
|
}
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
int
|
int
|
||||||
facl (int fd, int cmd, int nentries, aclent_t *aclbufp)
|
facl (int fd, int cmd, int nentries, aclent_t *aclbufp)
|
||||||
|
@ -1634,7 +1651,7 @@ facl (int fd, int cmd, int nentries, aclent_t *aclbufp)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
syscall_printf ("facl (%d): calling acl (%s)", fd, path);
|
syscall_printf ("facl (%d): calling acl (%s)", fd, path);
|
||||||
return acl (path, cmd, nentries, aclbufp);
|
return acl_worker (path, cmd, nentries, aclbufp, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
|
|
Loading…
Reference in New Issue