mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
r16833: Add a base DN to more search calls, we need to look for an ID over the
whole tree here. Andrew Bartlett
This commit is contained in:
parent
ae7ec0d553
commit
7674306e67
@ -137,7 +137,7 @@ _PUBLIC_ NTSTATUS sidmap_sid_to_unixuid(struct sidmap_context *sidmap,
|
|||||||
|
|
||||||
tmp_ctx = talloc_new(sidmap);
|
tmp_ctx = talloc_new(sidmap);
|
||||||
|
|
||||||
ret = gendb_search(sidmap->samctx, tmp_ctx, NULL, &res, attrs,
|
ret = gendb_search(sidmap->samctx, tmp_ctx, samdb_base_dn(tmp_ctx), &res, attrs,
|
||||||
"objectSid=%s", ldap_encode_ndr_dom_sid(tmp_ctx, sid));
|
"objectSid=%s", ldap_encode_ndr_dom_sid(tmp_ctx, sid));
|
||||||
if (ret != 1) {
|
if (ret != 1) {
|
||||||
goto allocated_sid;
|
goto allocated_sid;
|
||||||
@ -233,7 +233,7 @@ _PUBLIC_ NTSTATUS sidmap_sid_to_unixgid(struct sidmap_context *sidmap,
|
|||||||
|
|
||||||
tmp_ctx = talloc_new(sidmap);
|
tmp_ctx = talloc_new(sidmap);
|
||||||
|
|
||||||
ret = gendb_search(sidmap->samctx, tmp_ctx, NULL, &res, attrs,
|
ret = gendb_search(sidmap->samctx, tmp_ctx, samdb_base_dn(tmp_ctx), &res, attrs,
|
||||||
"objectSid=%s", ldap_encode_ndr_dom_sid(tmp_ctx, sid));
|
"objectSid=%s", ldap_encode_ndr_dom_sid(tmp_ctx, sid));
|
||||||
if (ret != 1) {
|
if (ret != 1) {
|
||||||
goto allocated_sid;
|
goto allocated_sid;
|
||||||
@ -347,7 +347,7 @@ _PUBLIC_ NTSTATUS sidmap_uid_to_sid(struct sidmap_context *sidmap,
|
|||||||
given uid
|
given uid
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ret = gendb_search(sidmap->samctx, tmp_ctx, NULL, &res, attrs,
|
ret = gendb_search(sidmap->samctx, tmp_ctx, samdb_base_dn(tmp_ctx), &res, attrs,
|
||||||
"unixID=%u", (unsigned int)uid);
|
"unixID=%u", (unsigned int)uid);
|
||||||
for (i=0;i<ret;i++) {
|
for (i=0;i<ret;i++) {
|
||||||
if (!is_user_account(res[i])) continue;
|
if (!is_user_account(res[i])) continue;
|
||||||
@ -445,7 +445,7 @@ _PUBLIC_ NTSTATUS sidmap_gid_to_sid(struct sidmap_context *sidmap,
|
|||||||
given gid
|
given gid
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ret = gendb_search(sidmap->samctx, tmp_ctx, NULL, &res, attrs,
|
ret = gendb_search(sidmap->samctx, tmp_ctx, samdb_base_dn(tmp_ctx), &res, attrs,
|
||||||
"unixID=%u", (unsigned int)gid);
|
"unixID=%u", (unsigned int)gid);
|
||||||
for (i=0;i<ret;i++) {
|
for (i=0;i<ret;i++) {
|
||||||
if (!is_group_account(res[i])) continue;
|
if (!is_group_account(res[i])) continue;
|
||||||
@ -465,7 +465,7 @@ _PUBLIC_ NTSTATUS sidmap_gid_to_sid(struct sidmap_context *sidmap,
|
|||||||
goto allocate_sid;
|
goto allocate_sid;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = gendb_search(sidmap->samctx, tmp_ctx, NULL, &res, attrs,
|
ret = gendb_search(sidmap->samctx, tmp_ctx, samdb_base_dn(tmp_ctx), &res, attrs,
|
||||||
"(|(unixName=%s)(sAMAccountName=%s))",
|
"(|(unixName=%s)(sAMAccountName=%s))",
|
||||||
grp->gr_name, grp->gr_name);
|
grp->gr_name, grp->gr_name);
|
||||||
for (i=0;i<ret;i++) {
|
for (i=0;i<ret;i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user