diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2012-09-15 17:51:00 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2012-09-15 17:51:00 +0000 |
commit | 542e46b0f21830fcf3950bfcfcf0d80759e09f16 (patch) | |
tree | 904ed9ef9ad610df1e73f2471cce8ecf005c4ff9 | |
parent | 9d1bfe50eeb5d9beed38186834dfa267945e8996 (diff) |
clear the *ent structs before writing fields to avoid problems with extra fields (fixes password field weirdness on Solaris 10)
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1767 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | nss/aliases.c | 3 | ||||
-rw-r--r-- | nss/ethers.c | 1 | ||||
-rw-r--r-- | nss/group.c | 1 | ||||
-rw-r--r-- | nss/hosts.c | 1 | ||||
-rw-r--r-- | nss/netgroup.c | 1 | ||||
-rw-r--r-- | nss/networks.c | 1 | ||||
-rw-r--r-- | nss/passwd.c | 1 | ||||
-rw-r--r-- | nss/protocols.c | 1 | ||||
-rw-r--r-- | nss/rpc.c | 1 | ||||
-rw-r--r-- | nss/services.c | 1 | ||||
-rw-r--r-- | nss/shadow.c | 1 |
11 files changed, 12 insertions, 1 deletions
diff --git a/nss/aliases.c b/nss/aliases.c index bbbb1ee..be56026 100644 --- a/nss/aliases.c +++ b/nss/aliases.c @@ -2,7 +2,7 @@ aliases.c - NSS lookup functions for aliases database Copyright (C) 2006 West Consulting - Copyright (C) 2006, 2007, 2008, 2010 Arthur de Jong + Copyright (C) 2006, 2007, 2008, 2010, 2012 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -35,6 +35,7 @@ static nss_status_t read_aliasent( { int32_t tmpint32,tmp2int32,tmp3int32; size_t bufptr=0; + memset(result,0,sizeof(struct aliasent)); /* read the name of the alias */ READ_BUF_STRING(fp,result->alias_name); /* read the members */ diff --git a/nss/ethers.c b/nss/ethers.c index f746045..349ddab 100644 --- a/nss/ethers.c +++ b/nss/ethers.c @@ -37,6 +37,7 @@ static nss_status_t read_etherent( { int32_t tmpint32; size_t bufptr=0; + memset(result,0,sizeof(struct etherent)); READ_BUF_STRING(fp,result->e_name); READ_TYPE(fp,result->e_addr,uint8_t[6]); return NSS_STATUS_SUCCESS; diff --git a/nss/group.c b/nss/group.c index daa02e9..e67d70d 100644 --- a/nss/group.c +++ b/nss/group.c @@ -38,6 +38,7 @@ static nss_status_t read_group( { int32_t tmpint32,tmp2int32,tmp3int32; size_t bufptr=0; + memset(result,0,sizeof(struct group)); READ_BUF_STRING(fp,result->gr_name); READ_BUF_STRING(fp,result->gr_passwd); READ_TYPE(fp,result->gr_gid,gid_t); diff --git a/nss/hosts.c b/nss/hosts.c index 3b9bd20..6a271e1 100644 --- a/nss/hosts.c +++ b/nss/hosts.c @@ -74,6 +74,7 @@ static nss_status_t read_hostent( int i; int readaf; size_t bufptr=0; + memset(result,0,sizeof(struct hostent)); /* read the host entry */ READ_BUF_STRING(fp,result->h_name); READ_BUF_STRINGLIST(fp,result->h_aliases); diff --git a/nss/netgroup.c b/nss/netgroup.c index f490d5b..aee9ce1 100644 --- a/nss/netgroup.c +++ b/nss/netgroup.c @@ -48,6 +48,7 @@ static nss_status_t read_netgrent( int32_t tmpint32; int type; size_t bufptr=0; + memset(result,0,sizeof(struct __netgrent)); /* read netgroup type */ READ_INT32(fp,type); if (type==NSLCD_NETGROUP_TYPE_NETGROUP) diff --git a/nss/networks.c b/nss/networks.c index 9e37d7e..a2515a2 100644 --- a/nss/networks.c +++ b/nss/networks.c @@ -72,6 +72,7 @@ static nss_status_t read_netent( int readaf; size_t bufptr=0; nss_status_t retv=NSS_STATUS_NOTFOUND; + memset(result,0,sizeof(struct netent)); /* read the network entry */ READ_BUF_STRING(fp,result->n_name); READ_BUF_STRINGLIST(fp,result->n_aliases); diff --git a/nss/passwd.c b/nss/passwd.c index b39a40c..99ca750 100644 --- a/nss/passwd.c +++ b/nss/passwd.c @@ -37,6 +37,7 @@ static nss_status_t read_passwd( { int32_t tmpint32; size_t bufptr=0; + memset(result,0,sizeof(struct passwd)); READ_BUF_STRING(fp,result->pw_name); READ_BUF_STRING(fp,result->pw_passwd); READ_TYPE(fp,result->pw_uid,uid_t); diff --git a/nss/protocols.c b/nss/protocols.c index d635830..ead2a3e 100644 --- a/nss/protocols.c +++ b/nss/protocols.c @@ -37,6 +37,7 @@ static nss_status_t read_protoent( { int32_t tmpint32,tmp2int32,tmp3int32; size_t bufptr=0; + memset(result,0,sizeof(struct protoent)); READ_BUF_STRING(fp,result->p_name); READ_BUF_STRINGLIST(fp,result->p_aliases); READ_INT32(fp,result->p_proto); @@ -37,6 +37,7 @@ static nss_status_t read_rpcent( { int32_t tmpint32,tmp2int32,tmp3int32; size_t bufptr=0; + memset(result,0,sizeof(struct rpcent)); READ_BUF_STRING(fp,result->r_name); READ_BUF_STRINGLIST(fp,result->r_aliases); READ_INT32(fp,result->r_number); diff --git a/nss/services.c b/nss/services.c index a5e588e..e425c85 100644 --- a/nss/services.c +++ b/nss/services.c @@ -37,6 +37,7 @@ static nss_status_t read_servent( { int32_t tmpint32,tmp2int32,tmp3int32; size_t bufptr=0; + memset(result,0,sizeof(struct servent)); READ_BUF_STRING(fp,result->s_name); READ_BUF_STRINGLIST(fp,result->s_aliases); /* store port number in network byte order */ diff --git a/nss/shadow.c b/nss/shadow.c index b907ab8..5ca8e38 100644 --- a/nss/shadow.c +++ b/nss/shadow.c @@ -37,6 +37,7 @@ static nss_status_t read_spwd( { int32_t tmpint32; size_t bufptr=0; + memset(result,0,sizeof(struct spwd)); READ_BUF_STRING(fp,result->sp_namp); READ_BUF_STRING(fp,result->sp_pwdp); READ_INT32(fp,result->sp_lstchg); |