From 29b6b8ca6447f9a719d4ce17e7637594a6dd579e Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 13 Apr 2004 20:45:14 +0000 Subject: [PATCH] * security.cc (set_nt_attribute): Only call get_nt_object_security if handle is NULL. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/security.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5eb32ff4a..51bcd00d1 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2004-04-13 Corinna Vinschen + + * security.cc (set_nt_attribute): Only call get_nt_object_security + if handle is NULL. + 2004-04-13 Corinna Vinschen * dir.cc (mkdir): Call set_file_attribute with additional handle diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 8abf40564..bbe409be4 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -1824,7 +1824,7 @@ set_nt_attribute (HANDLE handle, const char *file, security_descriptor sd; - if (get_nt_object_security (handle, SE_FILE_OBJECT, sd) + if ((!handle || get_nt_object_security (handle, SE_FILE_OBJECT, sd)) && read_sd (file, sd) <= 0) { debug_printf ("read_sd %E");