From 068e7e9b945dd1c9c6bf20b191cb95af918836e0 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 27 Nov 2009 18:59:40 -0500 Subject: Use the custom password field in groups too. Groups also need to honor the settable password field and use * by default. --- server/responder/nss/nsssrv_cmd.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'server') 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) { -- cgit