Fix broken PSID problem on cygheap in account handling

* pwdgrp.h: Add comment to explain below change.
        (struct pg_pwd): Convert sid member to BYTE array.
        (struct pg_grp): Ditto.
        * grp.cc (pwdgrp::parse_group): Accommodate above change.
        * passwd.cc (pwdgrp::parse_passwd): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2015-04-17 11:56:15 +02:00
parent e26cf1c5d7
commit ecc6cfeb7e
4 changed files with 20 additions and 4 deletions

View File

@@ -40,7 +40,9 @@ pwdgrp::parse_passwd ()
res.p.pw_gecos = next_str (':');
res.p.pw_dir = next_str (':');
res.p.pw_shell = next_str (':');
res.sid.getfrompw_gecos (&res.p);
cygsid csid;
csid.getfrompw_gecos (&res.p);
RtlCopySid (SECURITY_MAX_SID_SIZE, res.sid, csid);
/* lptr points to the \0 after pw_shell. Increment by one to get the correct
required buffer len in getpw_cp. */
res.len = lptr - res.p.pw_name + 1;