diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-03-06 22:54:08 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-03-06 22:54:08 +0400 |
commit | 29adfd78bd5870268f0b930f25374f7299dd7e8d (patch) | |
tree | 0a916602d45e2e017b06686bb9cb3950cf4d35f9 /winsup/cygwin/passwd.cc | |
parent | 722c840b35178adc5b5ad438334a04723cc624ac (diff) |
* passwd.cc (pg_ent::enumerate_builtin): Convert pwd_builtins and
grp_builtins to array of cygpsid pointers. Replace SID strings with
pointers to well known SIDs.
* sec_helper.cc (well_known_local_service_sid): Define.
(well_known_network_service_sid): Define.
(trusted_installer_sid): Define.
* security.h (well_known_local_service_sid): Declare.
(well_known_network_service_sid): Declare.
(trusted_installer_sid): Declare.
* uinfo.cc (pwdgrp::fetch_account_from_windows): Throughout set acc_type
to SidTypeUnknown if LookupAccountXXX function failed. Create
simplified passwd entry for non-user accounts, except for LocalSystem.
Add comment.
Diffstat (limited to 'winsup/cygwin/passwd.cc')
-rw-r--r-- | winsup/cygwin/passwd.cc | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc index 70759086f..cbe0945d6 100644 --- a/winsup/cygwin/passwd.cc +++ b/winsup/cygwin/passwd.cc @@ -467,36 +467,27 @@ pg_ent::enumerate_file () void * pg_ent::enumerate_builtin () { - static const char *pwd_builtins[] = { - /* SYSTEM */ - "S-1-5-18", - /* LocalService */ - "S-1-5-19", - /* NetworkService */ - "S-1-5-20", - /* Administrators */ - "S-1-5-32-544", - /* TrustedInstaller */ - "S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464", - /* The end */ + static cygpsid *pwd_builtins[] = { + &well_known_system_sid, + &well_known_local_service_sid, + &well_known_network_service_sid, + &well_known_admins_sid, + &trusted_installer_sid, NULL }; - static const char *grp_builtins[] = { - /* SYSTEM */ - "S-1-5-18", - /* TrustedInstaller */ - "S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464", - /* The end */ + static cygpsid *grp_builtins[] = { + &well_known_system_sid, + &trusted_installer_sid, NULL }; - const char **builtins = group ? grp_builtins : pwd_builtins; + cygpsid **builtins = group ? grp_builtins : pwd_builtins; if (!builtins[cnt]) { cnt = max = resume = 0; return NULL; } - cygsid sid (builtins[cnt++]); + cygsid sid (*builtins[cnt++]); fetch_user_arg_t arg; arg.type = SID_arg; arg.sid = &sid; |