summaryrefslogtreecommitdiff
path: root/usr/src/cmd/idmap
diff options
context:
space:
mode:
authorbaban <none@none>2008-06-24 11:39:13 -0700
committerbaban <none@none>2008-06-24 11:39:13 -0700
commit82da9f6027f9bba5379e821f9331f18c4b0ffb15 (patch)
tree8fe79c71b1027f7bc8d42bfb77448f48a0a20db1 /usr/src/cmd/idmap
parent1b0f33a2fcb0db6ad853ab27d9fff601a7560f48 (diff)
downloadillumos-joyent-82da9f6027f9bba5379e821f9331f18c4b0ffb15.tar.gz
6717568 Fix integrated by CR6706243 is incomplete
Diffstat (limited to 'usr/src/cmd/idmap')
-rw-r--r--usr/src/cmd/idmap/idmapd/dbutils.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/usr/src/cmd/idmap/idmapd/dbutils.c b/usr/src/cmd/idmap/idmapd/dbutils.c
index 5263c1f158..30c9c54917 100644
--- a/usr/src/cmd/idmap/idmapd/dbutils.c
+++ b/usr/src/cmd/idmap/idmapd/dbutils.c
@@ -2581,7 +2581,8 @@ name_based_mapping_sid2pid(lookup_state_t *state,
i = 0;
if (windomain == NULL)
windomain = "";
- else if (strcasecmp(state->defdom, windomain) == 0)
+ else if (state->defdom != NULL &&
+ strcasecmp(state->defdom, windomain) == 0)
i = 1;
if ((lower_winname = tolower_u8(winname)) == NULL)
@@ -4196,10 +4197,19 @@ get_w2u_mapping(sqlite *cache, sqlite *db, idmap_mapping *request,
retcode = IDMAP_ERR_MEMORY;
} else if (lookup_wksids_name2sid(winname, NULL, NULL, NULL,
NULL) != IDMAP_SUCCESS) {
- /* well-known SIDs don't need domain */
- mapping->id1domain = strdup(state.defdom);
- if (mapping->id1domain == NULL)
- retcode = IDMAP_ERR_MEMORY;
+ if (state.defdom == NULL) {
+ /*
+ * We have a non-qualified winname which is
+ * neither the name of a well-known SID nor
+ * there is a default domain with which we can
+ * qualify it.
+ */
+ retcode = IDMAP_ERR_DOMAIN_NOTFOUND;
+ } else {
+ mapping->id1domain = strdup(state.defdom);
+ if (mapping->id1domain == NULL)
+ retcode = IDMAP_ERR_MEMORY;
+ }
}
if (retcode != IDMAP_SUCCESS)
goto out;