summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2018-12-21 15:02:40 +0100
committerBjoern Jacke <bj@sernet.de>2018-12-22 03:11:14 +0100
commit2e1bc87b13c491f47a6fbcf9549ffa8250a2508b (patch)
tree9f91262deef2c888f1a0304899bbd1f8d4c3865b
parentc36cf69d5911b86d73a495308c1bed14004b0659 (diff)
downloadsamba-2e1bc87b13c491f47a6fbcf9549ffa8250a2508b.tar.gz
winbind_nss_aix: add incomplete attr_flag initializations
Found by Jürgen Starek, see https://bugzilla.samba.org/show_bug.cgi?id=5157 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Bjoern Jacke <bj@sernet.de>
-rw-r--r--nsswitch/winbind_nss_aix.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/nsswitch/winbind_nss_aix.c b/nsswitch/winbind_nss_aix.c
index 6ccd386d3ad..343809a4b34 100644
--- a/nsswitch/winbind_nss_aix.c
+++ b/nsswitch/winbind_nss_aix.c
@@ -569,12 +569,12 @@ static int wb_aix_lsgroup(char *attributes[], attrval_t results[], int size)
static attrval_t pwd_to_group(struct passwd *pwd)
{
- attrval_t r;
+ attrval_t r = {
+ .attr_flag = EINVAL,
+ };
struct group *grp = wb_aix_getgrgid(pwd->pw_gid);
- if (!grp) {
- r.attr_flag = EINVAL;
- } else {
+ if (grp != NULL) {
r.attr_flag = 0;
r.attr_un.au_char = strdup(grp->gr_name);
free_grp(grp);
@@ -585,7 +585,9 @@ static attrval_t pwd_to_group(struct passwd *pwd)
static attrval_t pwd_to_groupsids(struct passwd *pwd)
{
- attrval_t r;
+ attrval_t r = {
+ .attr_flag = EINVAL,
+ };
char *s, *p;
size_t mlen;
@@ -605,6 +607,7 @@ static attrval_t pwd_to_groupsids(struct passwd *pwd)
replace_commas(p);
free(s);
+ r.attr_flag = 0;
r.attr_un.au_char = p;
return r;
@@ -663,7 +666,9 @@ static int wb_aix_user_attrib(const char *key, char *attributes[],
}
for (i=0;i<size;i++) {
- results[i].attr_flag = 0;
+ results[i] = (attrval_t) {
+ .attr_flag = 0,
+ };
if (strcmp(attributes[i], S_ID) == 0) {
results[i].attr_un.au_int = pwd->pw_uid;