diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2001-08-02 16:01:47 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2001-08-02 16:01:47 +0000 |
commit | 842c741f9821834c2a6220f0a704c30e214598b7 (patch) | |
tree | d8ee4b558946348ced33ab7ab69c9d303671acd6 /winsup | |
parent | 6825f8e75f287e96546ddc93a288f2d8d58e1d3c (diff) | |
download | newlib-842c741f9821834c2a6220f0a704c30e214598b7.zip newlib-842c741f9821834c2a6220f0a704c30e214598b7.tar.gz newlib-842c741f9821834c2a6220f0a704c30e214598b7.tar.bz2 |
* security.cc (set_file_attribute): Clean up. Don't call
`set_nt_attribute' when ntsec isn't set.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/security.cc | 18 |
2 files changed, 13 insertions, 10 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 36af78a..587c367 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Thu Aug 2 17:59:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (set_file_attribute): Clean up. Don't call + `set_nt_attribute' when ntsec isn't set. + Sat Jul 28 22:30:55 2001 Christopher Faylor <cgf@cygnus.com> * dcrt0.cc (alloc_stack_hard_way): Make half-hearted attempt to deal diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index fbc6c88..489c75b 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; |