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>2002-06-06 15:17:51 +0400
committerCorinna Vinschen <corinna@vinschen.de>2002-06-06 15:17:51 +0400
commit2e8abfc1c50f541002610c4473caefee64183f04 (patch)
tree2d7145299c7d2fe24f4d35ca0550f10ac9ccfa28 /winsup/cygwin/security.cc
parentea6a35f68ad06c3e8095312239446255d5e0cedf (diff)
* sec_helper.cc (lookup_name): Suppress.
* security.cc (alloc_sd): Remove logsrv argument. Remove two calls to lookup_name. (set_security_attribute): Remove logsrv argument. Remove logsrv argument in call to alloc_sd. (set_nt_attribute): Remove logsrv argument. Remove logsrv argument in call to set_security_attribute. (set_file_attribute): Remove logsrv argument. Remove logsrv argument in call to set_nt_attribute. (set_file_attribute): Remove logsrv argument. Remove logsrv argument in call to set_file_attribute. * syscalls.cc (chown_worker): Remove logserver argument in call to set_file_attribute. (chmod): Ditto. * shm.cc (shmget): Remove logsrv argument in call to alloc_sd. * uinfo.cc (internal_getlogin): Replace calls to lookup_name by call to LookupAccountName. * security.h: Remove logsrv in declarations of set_file_attribute and alloc_sd. Remove declaration of lookup_name.
Diffstat (limited to 'winsup/cygwin/security.cc')
-rw-r--r--winsup/cygwin/security.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc
index 65a5b5e58..e6414cfd4 100644
--- a/winsup/cygwin/security.cc
+++ b/winsup/cygwin/security.cc
@@ -1353,7 +1353,7 @@ add_access_denied_ace (PACL acl, int offset, DWORD attributes,
}
PSECURITY_DESCRIPTOR
-alloc_sd (__uid32_t uid, __gid32_t gid, const char *logsrv, int attribute,
+alloc_sd (__uid32_t uid, __gid32_t gid, int attribute,
PSECURITY_DESCRIPTOR sd_ret, DWORD *sd_size_ret)
{
BOOL dummy;
@@ -1372,8 +1372,7 @@ alloc_sd (__uid32_t uid, __gid32_t gid, const char *logsrv, int attribute,
cygsid owner_sid;
struct passwd *pw = getpwuid32 (uid);
strcpy (owner, pw ? pw->pw_name : getlogin ());
- if ((!pw || !owner_sid.getfrompw (pw))
- && !lookup_name (owner, logsrv, owner_sid))
+ if (!pw || !owner_sid.getfrompw (pw))
return NULL;
debug_printf ("owner: %s [%d]", owner,
*GetSidSubAuthority(owner_sid,
@@ -1384,8 +1383,7 @@ alloc_sd (__uid32_t uid, __gid32_t gid, const char *logsrv, int attribute,
struct __group32 *grp = getgrgid32 (gid);
if (grp)
{
- if ((!grp || !group_sid.getfromgr (grp))
- && !lookup_name (grp->gr_name, logsrv, group_sid))
+ if (!grp || !group_sid.getfromgr (grp))
return NULL;
}
else
@@ -1616,14 +1614,13 @@ set_security_attribute (int attribute, PSECURITY_ATTRIBUTES psa,
InitializeSecurityDescriptor ((PSECURITY_DESCRIPTOR)sd_buf,
SECURITY_DESCRIPTOR_REVISION);
psa->lpSecurityDescriptor = alloc_sd (geteuid32 (), getegid32 (),
- cygheap->user.logsrv (),
attribute, (PSECURITY_DESCRIPTOR)sd_buf,
&sd_buf_size);
}
static int
set_nt_attribute (const char *file, __uid32_t uid, __gid32_t gid,
- const char *logsrv, int attribute)
+ int attribute)
{
if (!wincap.has_security ())
return 0;
@@ -1640,7 +1637,7 @@ set_nt_attribute (const char *file, __uid32_t uid, __gid32_t gid,
}
sd_size = 4096;
- if (!(psd = alloc_sd (uid, gid, logsrv, attribute, psd, &sd_size)))
+ if (!(psd = alloc_sd (uid, gid, attribute, psd, &sd_size)))
return -1;
return write_sd (file, psd, sd_size);
@@ -1649,12 +1646,12 @@ set_nt_attribute (const char *file, __uid32_t uid, __gid32_t gid,
int
set_file_attribute (int use_ntsec, const char *file,
__uid32_t uid, __gid32_t gid,
- int attribute, const char *logsrv)
+ int attribute)
{
int ret = 0;
if (use_ntsec && allow_ntsec)
- ret = set_nt_attribute (file, uid, gid, logsrv, attribute);
+ ret = set_nt_attribute (file, uid, gid, attribute);
else if (allow_ntea && !NTWriteEA (file, ".UNIXATTR", (char *) &attribute,
sizeof (attribute)))
{
@@ -1671,5 +1668,5 @@ set_file_attribute (int use_ntsec, const char *file, int attribute)
{
return set_file_attribute (use_ntsec, file,
myself->uid, myself->gid,
- attribute, cygheap->user.logsrv ());
+ attribute);
}