Add cygsid methods to create SIDs from scratch
So far creating cygsids requires to generate an "S-1-..." string which is then converted to a SID by cygsid::getfromstr. Add two new methods: - cygsid::create (DWORD auth, DWORD subauth_count, ...) ... is a variable length list of subauth_count DWORD values being the actual subauths. - cygsid::append (DWORD rid) allows to append a single RID to an alreaday constituted SID. * security.h (cygsid::create): Declare public. (cygsid::append): Ditto. * sec_helper.cc (cygsid::create): Implement. (cygsid::append): Implement. * uinfo.cc (pwdgrp::fetch_account_from_windows): Use both new methods as appropriate. Drop setting csid from string. Create SID strings for printing SIDs only. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@ -248,6 +248,9 @@ public:
|
||||
return (*this = sp) != NO_SID;
|
||||
}
|
||||
|
||||
const PSID create (DWORD auth, DWORD subauth_cnt, ...);
|
||||
bool append (DWORD rid);
|
||||
|
||||
/* Implemented in pwdgrp.h. */
|
||||
BOOL getfrompw (const struct passwd *pw);
|
||||
BOOL getfromgr (const struct group *gr);
|
||||
|
Reference in New Issue
Block a user