diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-05-17 16:28:15 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-05-20 05:49:25 -0400 |
commit | 54af51d2129d29258108a6dbf072a82c930bf399 (patch) | |
tree | 03b97d3b98b82395f5b35b6fbf0f0d67e3712262 /src/responder/nss | |
parent | 217d7e26345fb5f7e296551b62a4c1d82c9d9585 (diff) | |
download | sssd-54af51d2129d29258108a6dbf072a82c930bf399.tar.gz sssd-54af51d2129d29258108a6dbf072a82c930bf399.tar.bz2 sssd-54af51d2129d29258108a6dbf072a82c930bf399.zip |
Add a new option to override primary GID number
https://fedorahosted.org/sssd/ticket/742
Diffstat (limited to 'src/responder/nss')
-rw-r--r-- | src/responder/nss/nsssrv.c | 2 | ||||
-rw-r--r-- | src/responder/nss/nsssrv_cmd.c | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/responder/nss/nsssrv.c b/src/responder/nss/nsssrv.c index 9ae6f05e..6c20ca31 100644 --- a/src/responder/nss/nsssrv.c +++ b/src/responder/nss/nsssrv.c @@ -94,7 +94,7 @@ static int nss_get_config(struct nss_ctx *nctx, if (ret != EOK) goto done; if (nctx->cache_refresh_percent < 0 || nctx->cache_refresh_percent > 99) { - DEBUG(0,("Configuration error: entry_cache_nowait_percentage is" + DEBUG(0,("Configuration error: entry_cache_nowait_percentage is " "invalid. Disabling feature.\n")); nctx->cache_refresh_percent = 0; } diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c index db301b38..2f510b9b 100644 --- a/src/responder/nss/nsssrv_cmd.c +++ b/src/responder/nss/nsssrv_cmd.c @@ -170,6 +170,14 @@ struct setent_ctx { * PASSWD db related functions ***************************************************************************/ +static gid_t get_gid_override(struct ldb_message *msg, + struct sss_domain_info *dom) +{ + return dom->override_gid ? + dom->override_gid : + ldb_msg_find_attr_as_uint64(msg, SYSDB_GIDNUM, 0); +} + static int fill_pwent(struct sss_packet *packet, struct sss_domain_info *dom, struct nss_ctx *nctx, @@ -206,7 +214,7 @@ static int fill_pwent(struct sss_packet *packet, name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL); uid = ldb_msg_find_attr_as_uint64(msg, SYSDB_UIDNUM, 0); - gid = ldb_msg_find_attr_as_uint64(msg, SYSDB_GIDNUM, 0); + gid = get_gid_override(msg, dom); if (!name || !uid || !gid) { DEBUG(2, ("Incomplete or fake user object for %s[%llu]! Skipping\n", |