Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-08-02 20:01:47 +0400
committerCorinna Vinschen <corinna@vinschen.de>2001-08-02 20:01:47 +0400
commit842c741f9821834c2a6220f0a704c30e214598b7 (patch)
treed8ee4b558946348ced33ab7ab69c9d303671acd6 /winsup/cygwin/security.cc
parent6825f8e75f287e96546ddc93a288f2d8d58e1d3c (diff)
* security.cc (set_file_attribute): Clean up. Don't call
`set_nt_attribute' when ntsec isn't set.
Diffstat (limited to 'winsup/cygwin/security.cc')
-rw-r--r--winsup/cygwin/security.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc
index fbc6c8869..489c75bbf 100644
--- a/winsup/cygwin/security.cc
+++ b/winsup/cygwin/security.cc
@@ -1587,18 +1587,16 @@ set_file_attribute (int use_ntsec, const char *file,
if ((attribute & S_IFLNK) == S_IFLNK)
attribute |= S_IRWXU | S_IRWXG | S_IRWXO;
- if (allow_ntea && (!use_ntsec || !allow_ntsec))
+ int ret = 0;
+
+ if (use_ntsec && allow_ntsec)
+ ret = set_nt_attribute (file, uid, gid, logsrv, attribute);
+ else if (allow_ntea && !NTWriteEA (file, ".UNIXATTR", (char *) &attribute,
+ sizeof (attribute)))
{
- if (!NTWriteEA (file, ".UNIXATTR", (char *) &attribute,
- sizeof (attribute)))
- {
- __seterrno ();
- return -1;
- }
- return 0;
+ __seterrno ();
+ ret = -1;
}
-
- int ret = set_nt_attribute (file, uid, gid, logsrv, attribute);
syscall_printf ("%d = set_file_attribute (%s, %d, %d, %p)",
ret, file, uid, gid, attribute);
return ret;