diff --git a/source/auth/auth_util.c b/source/auth/auth_util.c index 32224fa..b3a3d39 100644 --- a/source/auth/auth_util.c +++ b/source/auth/auth_util.c @@ -811,7 +811,7 @@ static NTSTATUS create_builtin_administrators( void ) return NT_STATUS_NO_MEMORY; } fstr_sprintf( root_name, "%s\\root", get_global_sam_name() ); - ret = lookup_name( ctx, root_name, 0, NULL, NULL, &root_sid, &type ); + ret = lookup_name( ctx, root_name, LOOKUP_NAME_DOMAIN, NULL, NULL, &root_sid, &type ); TALLOC_FREE( ctx ); if ( ret ) { diff --git a/source/groupdb/mapping.c b/source/groupdb/mapping.c index b0e59c0..cf015a5 100644 --- a/source/groupdb/mapping.c +++ b/source/groupdb/mapping.c @@ -452,7 +452,7 @@ NTSTATUS pdb_default_create_alias(struct pdb_methods *methods, return NT_STATUS_NO_MEMORY; } - exists = lookup_name(mem_ctx, name, LOOKUP_NAME_ISOLATED, + exists = lookup_name(mem_ctx, name, LOOKUP_NAME_LOCAL, NULL, NULL, &sid, &type); TALLOC_FREE(mem_ctx); diff --git a/source/include/smb.h b/source/include/smb.h index ed1d049..ee43bae 100644 --- a/source/include/smb.h +++ b/source/include/smb.h @@ -270,6 +270,10 @@ enum lsa_SidType { #define LOOKUP_NAME_BUILTIN 0x00000010 /* builtin names */ #define LOOKUP_NAME_WKN 0x00000020 /* well known names */ #define LOOKUP_NAME_DOMAIN 0x00000040 /* only lookup own domain */ +#define LOOKUP_NAME_LOCAL (LOOKUP_NAME_ISOLATED\ + |LOOKUP_NAME_BUILTIN\ + |LOOKUP_NAME_WKN\ + |LOOKUP_NAME_DOMAIN) #define LOOKUP_NAME_ALL (LOOKUP_NAME_ISOLATED\ |LOOKUP_NAME_REMOTE\ |LOOKUP_NAME_BUILTIN\ diff --git a/source/rpc_server/srv_samr_nt.c b/source/rpc_server/srv_samr_nt.c index 3343f16..cc289ca 100644 --- a/source/rpc_server/srv_samr_nt.c +++ b/source/rpc_server/srv_samr_nt.c @@ -2507,9 +2507,9 @@ static NTSTATUS can_create(TALLOC_CTX *mem_ctx, const char *new_name) DEBUG(10, ("Checking whether [%s] can be created\n", new_name)); become_root(); - /* Lookup in our local databases (only LOOKUP_NAME_ISOLATED set) + /* Lookup in our local databases (LOOKUP_NAME_REMOTE not set) * whether the name already exists */ - result = lookup_name(mem_ctx, new_name, LOOKUP_NAME_ISOLATED, + result = lookup_name(mem_ctx, new_name, LOOKUP_NAME_LOCAL, NULL, NULL, NULL, &type); unbecome_root(); diff --git a/source/utils/net_sam.c b/source/utils/net_sam.c index bf39780..e01142e 100644 --- a/source/utils/net_sam.c +++ b/source/utils/net_sam.c @@ -42,7 +42,7 @@ static int net_sam_userset(int argc, const char **argv, const char *field, return -1; } - if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_ISOLATED, + if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_LOCAL, &dom, &name, &sid, &type)) { d_fprintf(stderr, "Could not find name %s\n", argv[0]); return -1; @@ -139,7 +139,7 @@ static int net_sam_set_userflag(int argc, const char **argv, const char *field, return -1; } - if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_ISOLATED, + if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_LOCAL, &dom, &name, &sid, &type)) { d_fprintf(stderr, "Could not find name %s\n", argv[0]); return -1; @@ -223,7 +223,7 @@ static int net_sam_set_pwdmustchangenow(int argc, const char **argv) return -1; } - if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_ISOLATED, + if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_LOCAL, &dom, &name, &sid, &type)) { d_fprintf(stderr, "Could not find name %s\n", argv[0]); return -1; @@ -284,7 +284,7 @@ static int net_sam_set_comment(int argc, const char **argv) return -1; } - if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_ISOLATED, + if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_LOCAL, &dom, &name, &sid, &type)) { d_fprintf(stderr, "Could not find name %s\n", argv[0]); return -1; @@ -639,7 +639,7 @@ static int net_sam_addmem(int argc, const char **argv) return -1; } - if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_ISOLATED, + if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_LOCAL, &groupdomain, &groupname, &group, &grouptype)) { d_fprintf(stderr, "Could not find group %s\n", argv[0]); return -1; @@ -647,7 +647,7 @@ static int net_sam_addmem(int argc, const char **argv) /* check to see if the member to be added is a name or a SID */ - if (!lookup_name(tmp_talloc_ctx(), argv[1], LOOKUP_NAME_ISOLATED, + if (!lookup_name(tmp_talloc_ctx(), argv[1], LOOKUP_NAME_LOCAL, &memberdomain, &membername, &member, &membertype)) { /* try it as a SID */ @@ -712,13 +712,13 @@ static int net_sam_delmem(int argc, const char **argv) return -1; } - if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_ISOLATED, + if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_LOCAL, &groupdomain, &groupname, &group, &grouptype)) { d_fprintf(stderr, "Could not find group %s\n", argv[0]); return -1; } - if (!lookup_name(tmp_talloc_ctx(), argv[1], LOOKUP_NAME_ISOLATED, + if (!lookup_name(tmp_talloc_ctx(), argv[1], LOOKUP_NAME_LOCAL, &memberdomain, &membername, &member, NULL)) { if (!string_to_sid(&member, argv[1])) { d_fprintf(stderr, "Could not find member %s\n", @@ -770,7 +770,7 @@ static int net_sam_listmem(int argc, const char **argv) return -1; } - if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_ISOLATED, + if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_LOCAL, &groupdomain, &groupname, &group, &grouptype)) { d_fprintf(stderr, "Could not find group %s\n", argv[0]); return -1; @@ -918,7 +918,7 @@ static int net_sam_show(int argc, const char **argv) return -1; } - if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_ISOLATED, + if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_LOCAL, &dom, &name, &sid, &type)) { d_fprintf(stderr, "Could not find name %s\n", argv[0]); return -1;