* uinfo.cc (pwdgrp::fetch_account_from_windows): Add code to allow
setting the primary group from the SAM comment field.
This commit is contained in:
parent
127cfd4f5a
commit
0ac645c1c3
@ -1,3 +1,8 @@
|
|||||||
|
2014-02-10 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* uinfo.cc (pwdgrp::fetch_account_from_windows): Add code to allow
|
||||||
|
setting the primary group from the SAM comment field.
|
||||||
|
|
||||||
2014-02-10 Corinna Vinschen <corinna@vinschen.de>
|
2014-02-10 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* dcrt0.cc (child_info_spawn::handle_spawn): Call fixup_lockf_after_exec
|
* dcrt0.cc (child_info_spawn::handle_spawn): Call fixup_lockf_after_exec
|
||||||
|
@ -1443,6 +1443,7 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, bool group)
|
|||||||
debug_printf ("NetUserGetInfo(%W,%W) %u", domain, name, nas);
|
debug_printf ("NetUserGetInfo(%W,%W) %u", domain, name, nas);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
PWCHAR pgrp = NULL;
|
||||||
struct {
|
struct {
|
||||||
PCWSTR str;
|
PCWSTR str;
|
||||||
size_t len;
|
size_t len;
|
||||||
@ -1450,7 +1451,8 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, bool group)
|
|||||||
} search[] = {
|
} search[] = {
|
||||||
{ L"name=\"", 6, &user },
|
{ L"name=\"", 6, &user },
|
||||||
{ L"home=\"", 6, &home },
|
{ L"home=\"", 6, &home },
|
||||||
{ L"shell=\"", 7, &shell }
|
{ L"shell=\"", 7, &shell },
|
||||||
|
{ L"group=\"", 7, &pgrp }
|
||||||
};
|
};
|
||||||
PWCHAR s, e;
|
PWCHAR s, e;
|
||||||
|
|
||||||
@ -1494,6 +1496,25 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, bool group)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
NetApiBufferFree (ui);
|
NetApiBufferFree (ui);
|
||||||
|
if (pgrp)
|
||||||
|
{
|
||||||
|
/* For setting the primary group, we have to test all
|
||||||
|
three possible Cygwin name variations:
|
||||||
|
|
||||||
|
MACHINE+group, +group, group
|
||||||
|
*/
|
||||||
|
char gname[2 * (DNLEN + UNLEN + 1)];
|
||||||
|
char *sep;
|
||||||
|
struct group *gr;
|
||||||
|
|
||||||
|
sep += sys_wcstombs (sep = gname, 2 * DNLEN + 1, domain);
|
||||||
|
*sep = cygheap->pg.nss_separator ()[0];
|
||||||
|
sys_wcstombs (sep + 1, 2 * UNLEN + 1, pgrp);
|
||||||
|
if ((gr = internal_getgrnam (gname))
|
||||||
|
|| (gr = internal_getgrnam (sep))
|
||||||
|
|| (gr = internal_getgrnam (sep + 1)))
|
||||||
|
gid = gr->gr_gid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else /* SidTypeGroup */
|
else /* SidTypeGroup */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user