mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s3-passdb: Allow pdb_sid_to_id to work on any SID
This is needed so that pdb_samba4 can map any SID during a provision. At runtime, winbindd will be asked first, but this shortcut direct to the ldb file makes it possible to set the permissions on the sysvol share at provision time. Andrew Bartlett
This commit is contained in:
parent
d963aaf73b
commit
02e25b2a43
@ -1084,20 +1084,16 @@ static void legacy_gid_to_sid(struct dom_sid *psid, gid_t gid)
|
|||||||
static bool legacy_sid_to_unixid(const struct dom_sid *psid, struct unixid *id)
|
static bool legacy_sid_to_unixid(const struct dom_sid *psid, struct unixid *id)
|
||||||
{
|
{
|
||||||
GROUP_MAP *map;
|
GROUP_MAP *map;
|
||||||
if (sid_check_is_in_our_sam(psid)) {
|
bool ret;
|
||||||
bool ret;
|
|
||||||
|
become_root();
|
||||||
become_root();
|
ret = pdb_sid_to_id(psid, id);
|
||||||
ret = pdb_sid_to_id(psid, id);
|
unbecome_root();
|
||||||
unbecome_root();
|
|
||||||
|
if (ret) {
|
||||||
if (ret) {
|
goto done;
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This was ours, but it was not mapped. Fail */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sid_check_is_in_builtin(psid) ||
|
if ((sid_check_is_in_builtin(psid) ||
|
||||||
sid_check_is_in_wellknown_domain(psid))) {
|
sid_check_is_in_wellknown_domain(psid))) {
|
||||||
bool ret;
|
bool ret;
|
||||||
|
@ -1429,6 +1429,11 @@ static bool pdb_default_sid_to_id(struct pdb_methods *methods,
|
|||||||
uint32_t rid;
|
uint32_t rid;
|
||||||
id->id = -1;
|
id->id = -1;
|
||||||
|
|
||||||
|
if (!sid_check_is_in_our_sam(sid)) {
|
||||||
|
/* Not our SID */
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
mem_ctx = talloc_new(NULL);
|
mem_ctx = talloc_new(NULL);
|
||||||
|
|
||||||
if (mem_ctx == NULL) {
|
if (mem_ctx == NULL) {
|
||||||
|
@ -4938,6 +4938,11 @@ static bool ldapsam_sid_to_id(struct pdb_methods *methods,
|
|||||||
|
|
||||||
TALLOC_CTX *mem_ctx;
|
TALLOC_CTX *mem_ctx;
|
||||||
|
|
||||||
|
if (!sid_check_is_in_our_sam(sid)) {
|
||||||
|
/* Not our SID */
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
mem_ctx = talloc_new(NULL);
|
mem_ctx = talloc_new(NULL);
|
||||||
if (mem_ctx == NULL) {
|
if (mem_ctx == NULL) {
|
||||||
DEBUG(0, ("talloc_new failed\n"));
|
DEBUG(0, ("talloc_new failed\n"));
|
||||||
|
Loading…
Reference in New Issue
Block a user