1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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>
This commit is contained in:
Björn Jacke 2018-12-21 15:02:40 +01:00 committed by Bjoern Jacke
parent c36cf69d59
commit 2e1bc87b13

View File

@ -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) 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); struct group *grp = wb_aix_getgrgid(pwd->pw_gid);
if (!grp) { if (grp != NULL) {
r.attr_flag = EINVAL;
} else {
r.attr_flag = 0; r.attr_flag = 0;
r.attr_un.au_char = strdup(grp->gr_name); r.attr_un.au_char = strdup(grp->gr_name);
free_grp(grp); 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) static attrval_t pwd_to_groupsids(struct passwd *pwd)
{ {
attrval_t r; attrval_t r = {
.attr_flag = EINVAL,
};
char *s, *p; char *s, *p;
size_t mlen; size_t mlen;
@ -605,6 +607,7 @@ static attrval_t pwd_to_groupsids(struct passwd *pwd)
replace_commas(p); replace_commas(p);
free(s); free(s);
r.attr_flag = 0;
r.attr_un.au_char = p; r.attr_un.au_char = p;
return r; return r;
@ -663,7 +666,9 @@ static int wb_aix_user_attrib(const char *key, char *attributes[],
} }
for (i=0;i<size;i++) { 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) { if (strcmp(attributes[i], S_ID) == 0) {
results[i].attr_un.au_int = pwd->pw_uid; results[i].attr_un.au_int = pwd->pw_uid;