diff options
author | Michal Zidek <mzidek@redhat.com> | 2012-11-14 15:36:22 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-11-28 14:45:44 +0100 |
commit | 3f964af2d45b85c8c7461f5227b343340ab06b06 (patch) | |
tree | 05005911a805f91ceb730e3221bbf7211b1e111f /src/providers/ldap/sdap_idmap.c | |
parent | fac2e9f6f7551bf5bce89605cdb0672871613ca6 (diff) | |
download | sssd-3f964af2d45b85c8c7461f5227b343340ab06b06.tar.gz sssd-3f964af2d45b85c8c7461f5227b343340ab06b06.tar.xz sssd-3f964af2d45b85c8c7461f5227b343340ab06b06.zip |
idmap: Silence DEBUG messages when dealing with built-in SIDs.
When converting built-in SID to unix GID/UID a confusing debug
message about the failed conversion was printed. This patch special
cases these built-in objects.
https://fedorahosted.org/sssd/ticket/1593
Diffstat (limited to 'src/providers/ldap/sdap_idmap.c')
-rw-r--r-- | src/providers/ldap/sdap_idmap.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/providers/ldap/sdap_idmap.c b/src/providers/ldap/sdap_idmap.c index 9ace11b5c..e51fcc6b4 100644 --- a/src/providers/ldap/sdap_idmap.c +++ b/src/providers/ldap/sdap_idmap.c @@ -380,13 +380,10 @@ sdap_idmap_sid_to_unix(struct sdap_idmap_ctx *idmap_ctx, err = sss_idmap_sid_to_unix(idmap_ctx->map, sid_str, (uint32_t *)id); - if (err != IDMAP_SUCCESS && err != IDMAP_NO_DOMAIN) { - DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not convert objectSID [%s] to a UNIX ID\n", - sid_str)); - ret = EIO; - goto done; - } else if (err == IDMAP_NO_DOMAIN) { + switch (err) { + case IDMAP_SUCCESS: + break; + case IDMAP_NO_DOMAIN: /* This is the first time we've seen this domain * Create a new domain for it. We'll use the dom-sid * as the domain name for now, since we don't have @@ -420,6 +417,20 @@ sdap_idmap_sid_to_unix(struct sdap_idmap_ctx *idmap_ctx, ret = EIO; goto done; } + break; + case IDMAP_BUILTIN_SID: + DEBUG(SSSDBG_TRACE_FUNC, + ("Object SID [%s] is a built-in one.\n", sid_str)); + /* ENOTSUP indicates built-in SID */ + ret = ENOTSUP; + goto done; + break; + default: + DEBUG(SSSDBG_MINOR_FAILURE, + ("Could not convert objectSID [%s] to a UNIX ID\n", + sid_str)); + ret = EIO; + goto done; } ret = EOK; |