summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-11-27 18:59:40 -0500
committerStephen Gallagher <sgallagh@redhat.com>2009-12-03 10:26:21 -0500
commit068e7e9b945dd1c9c6bf20b191cb95af918836e0 (patch)
tree1c619649f876870f7630f8657f6d70a63eb00f3c /server
parent9e37ad98a9f2bbd1128ba73d0fee1af7b337ec59 (diff)
downloadsssd-068e7e9b945dd1c9c6bf20b191cb95af918836e0.tar.gz
sssd-068e7e9b945dd1c9c6bf20b191cb95af918836e0.tar.bz2
sssd-068e7e9b945dd1c9c6bf20b191cb95af918836e0.zip
Use the custom password field in groups too.
Groups also need to honor the settable password field and use * by default.
Diffstat (limited to 'server')
-rw-r--r--server/responder/nss/nsssrv_cmd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/responder/nss/nsssrv_cmd.c b/server/responder/nss/nsssrv_cmd.c
index 1802dfea..88240a39 100644
--- a/server/responder/nss/nsssrv_cmd.c
+++ b/server/responder/nss/nsssrv_cmd.c
@@ -1480,6 +1480,7 @@ static int fill_grent(struct sss_packet *packet,
size_t nsize;
size_t delim;
size_t dom_len;
+ size_t pwlen;
int i, j;
int ret, num, memnum;
size_t rzero, rsize;
@@ -1496,6 +1497,7 @@ static int fill_grent(struct sss_packet *packet,
}
num = 0;
+ pwlen = strlen(nctx->pwfield) + 1;
/* first 2 fields (len and reserved), filled up later */
ret = sss_packet_grow(packet, 2*sizeof(uint32_t));
@@ -1549,7 +1551,7 @@ static int fill_grent(struct sss_packet *packet,
if (add_domain) nsize += delim + dom_len;
/* fill in gid and name and set pointer for number of members */
- rsize = STRS_ROFFSET + nsize + 2; /* name\0x\0 */
+ rsize = STRS_ROFFSET + nsize + pwlen; /* name\0x\0 */
ret = sss_packet_grow(packet, rsize);
if (ret != EOK) {
@@ -1602,8 +1604,8 @@ static int fill_grent(struct sss_packet *packet,
memcpy(&body[rzero+STRS_ROFFSET], name, nsize);
}
- body[rzero + rsize -2] = 'x'; /* group passwd field */
- body[rzero + rsize -1] = '\0';
+ /* group passwd field */
+ memcpy(&body[rzero + rsize -pwlen], nctx->pwfield, pwlen);
el = ldb_msg_find_element(msg, SYSDB_MEMBERUID);
if (el) {