From 328b090f29853cd45be2ed7453f473634af18239 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 25 Aug 2008 09:38:14 +0000 Subject: * mkgroup.c (enum_local_groups): Don't skip printing groups when print_current is set and group SID is not curr_pgrp. (enum_groups): Ditto. (main): Fix condition when SYSTEM group gets printed. * mkpasswd.c (enum_users): Don't skip printing users when print_current is set and user SID is not curr_user. (main): Allow printing standard accounts even when print_current is set. --- winsup/utils/ChangeLog | 10 ++++++++++ winsup/utils/mkgroup.c | 8 +++----- winsup/utils/mkpasswd.c | 4 +--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 6917ab58d..b0d065642 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,13 @@ +2008-08-25 Corinna Vinschen + + * mkgroup.c (enum_local_groups): Don't skip printing groups when + print_current is set and group SID is not curr_pgrp. + (enum_groups): Ditto. + (main): Fix condition when SYSTEM group gets printed. + * mkpasswd.c (enum_users): Don't skip printing users when print_current + is set and user SID is not curr_user. + (main): Allow printing standard accounts even when print_current is set. + 2008-08-18 Corinna Vinschen * mkgroup.c (enum_local_groups): Use NetLocalGroupGetInfo to find out diff --git a/winsup/utils/mkgroup.c b/winsup/utils/mkgroup.c index 700363ee9..3a3376f97 100644 --- a/winsup/utils/mkgroup.c +++ b/winsup/utils/mkgroup.c @@ -435,8 +435,7 @@ enum_local_groups (BOOL domain, domlist_t *dom_or_machine, const char *sep, /* fall through */; else if (EqualSid (curr_pgrp.psid, psid)) got_curr_pgrp = TRUE; - else - continue; + gid = *GetSidSubAuthority (psid, *GetSidSubAuthorityCount(psid) - 1); printf ("%ls%s%ls:%s:%ld:\n", with_dom && !is_builtin ? domain_name : L"", @@ -565,8 +564,7 @@ enum_groups (BOOL domain, domlist_t *dom_or_machine, const char *sep, /* fall through */; else if (EqualSid (curr_pgrp.psid, psid)) got_curr_pgrp = TRUE; - else - continue; + printf ("%ls%s%ls:%s:%lu:\n", with_dom ? domain_name : L"", with_dom ? sep : "", @@ -880,7 +878,7 @@ skip: } /* Get 'system' group */ - if (!disp_groupname && print_system && print_builtin && !print_current) + if (!disp_groupname && print_system && print_builtin && print_domlist) print_special (&sid_nt_auth, 1, SECURITY_LOCAL_SYSTEM_RID, 0, 0, 0, 0, 0, 0, 0); diff --git a/winsup/utils/mkpasswd.c b/winsup/utils/mkpasswd.c index 70bee353d..b341b64c3 100644 --- a/winsup/utils/mkpasswd.c +++ b/winsup/utils/mkpasswd.c @@ -511,8 +511,6 @@ enum_users (BOOL domain, domlist_t *dom_or_machine, const char *sep, /* fall through */; else if (EqualSid (curr_user.psid, psid)) got_curr_user = TRUE; - else - continue; printf ("%ls%s%ls:unused:%lu:%lu:%ls%sU-%ls\\%ls,%s:%s:/bin/bash\n", with_dom ? domain_name : L"", @@ -873,7 +871,7 @@ skip: ? domlist[i].id_offset : off : 0; if (!domlist[i].domain && domlist[i].str && print_unix) enum_unix_users (domlist + i, sep_char, my_off, print_unix); - if (!my_off && !print_current && !disp_username) + if (!my_off && !disp_username) enum_std_accounts (); enum_users (domlist[i].domain, domlist + i, sep_char, print_cygpath, passed_home_path, my_off, disp_username, print_current); -- cgit v1.2.3