Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd
diff options
context:
space:
mode:
Diffstat (limited to 'nslcd')
-rw-r--r--nslcd/common.c4
-rw-r--r--nslcd/ether.c4
-rw-r--r--nslcd/group.c4
-rw-r--r--nslcd/nslcd.c11
-rw-r--r--nslcd/passwd.c6
5 files changed, 15 insertions, 14 deletions
diff --git a/nslcd/common.c b/nslcd/common.c
index ec20693..37542b9 100644
--- a/nslcd/common.c
+++ b/nslcd/common.c
@@ -165,7 +165,7 @@ int write_address(TFILE *fp,MYLDAP_ENTRY *entry,const char *attr,
/* write the address length */
WRITE_INT32(fp,sizeof(struct in_addr));
/* write the address itself (in network byte order) */
- WRITE_TYPE(fp,ipv4addr,struct in_addr);
+ WRITE(fp,&ipv4addr,sizeof(struct in_addr));
}
else if (inet_pton(AF_INET6,addr,&ipv6addr)>0)
{
@@ -174,7 +174,7 @@ int write_address(TFILE *fp,MYLDAP_ENTRY *entry,const char *attr,
/* write the address length */
WRITE_INT32(fp,sizeof(struct in6_addr));
/* write the address itself (in network byte order) */
- WRITE_TYPE(fp,ipv6addr,struct in6_addr);
+ WRITE(fp,&ipv6addr,sizeof(struct in6_addr));
}
else
{
diff --git a/nslcd/ether.c b/nslcd/ether.c
index 74312fd..be243ba 100644
--- a/nslcd/ether.c
+++ b/nslcd/ether.c
@@ -109,7 +109,7 @@ void ether_init(void)
/* TODO: check for errors in aton() */
#define WRITE_ETHER(fp,addr) \
ether_aton_r(addr,&tmpaddr); \
- WRITE_TYPE(fp,tmpaddr,uint8_t[6]);
+ WRITE(fp,&tmpaddr,sizeof(uint8_t[6]));
static int write_ether(TFILE *fp,MYLDAP_ENTRY *entry,
const char *reqname,const char *reqether)
@@ -173,7 +173,7 @@ NSLCD_HANDLE(
struct ether_addr addr;
char addrstr[20];
char filter[4096];
- READ_TYPE(fp,addr,uint8_t[6]);
+ READ(fp,&addr,sizeof(uint8_t[6]));
if (ether_ntoa_r(&addr,addrstr)==NULL)
return -1;
log_setrequest("ether=%s",addrstr);,
diff --git a/nslcd/group.c b/nslcd/group.c
index 0096c95..1dfc5f8 100644
--- a/nslcd/group.c
+++ b/nslcd/group.c
@@ -194,7 +194,7 @@ static int do_write_group(
WRITE_INT32(fp,NSLCD_RESULT_BEGIN);
WRITE_STRING(fp,names[i]);
WRITE_STRING(fp,passwd);
- WRITE_TYPE(fp,gids[j],gid_t);
+ WRITE_INT32(fp,gids[j]);
WRITE_STRINGLIST(fp,members);
}
}
@@ -334,7 +334,7 @@ NSLCD_HANDLE(
group,bygid,
gid_t gid;
char filter[4096];
- READ_TYPE(fp,gid,gid_t);
+ READ_INT32(fp,gid);
log_setrequest("group=%lu",(unsigned long int)gid);,
NSLCD_ACTION_GROUP_BYGID,
mkfilter_group_bygid(gid,filter,sizeof(filter)),
diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c
index a59b640..68312fd 100644
--- a/nslcd/nslcd.c
+++ b/nslcd/nslcd.c
@@ -372,15 +372,16 @@ static int create_socket(const char *filename)
static int read_header(TFILE *fp,int32_t *action)
{
int32_t tmpint32;
+ int32_t protocol;
/* read the protocol version */
- READ_TYPE(fp,tmpint32,int32_t);
- if (tmpint32 != (int32_t)NSLCD_VERSION)
+ READ_INT32(fp,protocol);
+ if (protocol!=(int32_t)NSLCD_VERSION)
{
- log_log(LOG_DEBUG,"wrong nslcd version id (%d)",(int)tmpint32);
+ log_log(LOG_DEBUG,"wrong nslcd version id (%d)",(int)protocol);
return -1;
}
/* read the request type */
- READ(fp,action,sizeof(int32_t));
+ READ_INT32(fp,*action);
return 0;
}
@@ -456,7 +457,7 @@ static void handleconnection(int sock,MYLDAP_SESSION *session)
case NSLCD_ACTION_PAM_SESS_C: (void)nslcd_pam_sess_c(fp,session); break;
case NSLCD_ACTION_PAM_PWMOD: (void)nslcd_pam_pwmod(fp,session,uid); break;
default:
- log_log(LOG_WARNING,"invalid request id: %d",(int)action);
+ log_log(LOG_WARNING,"invalid request id: %ud",(unsigned int)action);
break;
}
/* we're done with the request */
diff --git a/nslcd/passwd.c b/nslcd/passwd.c
index cdeb814..414caed 100644
--- a/nslcd/passwd.c
+++ b/nslcd/passwd.c
@@ -531,8 +531,8 @@ static int write_passwd(TFILE *fp,MYLDAP_ENTRY *entry,const char *requser,
WRITE_INT32(fp,NSLCD_RESULT_BEGIN);
WRITE_STRING(fp,usernames[i]);
WRITE_STRING(fp,passwd);
- WRITE_TYPE(fp,uids[j],uid_t);
- WRITE_TYPE(fp,gid,gid_t);
+ WRITE_INT32(fp,uids[j]);
+ WRITE_INT32(fp,gid);
WRITE_STRING(fp,gecos);
WRITE_STRING(fp,homedir);
WRITE_STRING(fp,shell);
@@ -563,7 +563,7 @@ NSLCD_HANDLE_UID(
passwd,byuid,
uid_t uid;
char filter[4096];
- READ_TYPE(fp,uid,uid_t);
+ READ_INT32(fp,uid);
log_setrequest("passwd=%lu",(unsigned long int)uid);
if (uid<nslcd_cfg->ldc_nss_min_uid)
{