diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2013-10-29 20:01:30 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2013-10-29 23:20:01 +0100 |
commit | f8af48faa18b6d9017ea64f4df2d6ee2b1743df3 (patch) | |
tree | c27c3d3932b850c65854ca4b855fbb68d262207b /nslcd | |
parent | 88801f9e5a01e580adae4f386c0c755fb2a17b79 (diff) |
Fix a number of compiler warnings
This includes a number of small fixes for issues that were formerly
masked by the incorrect AC_LANG_PROGRAM check.
Diffstat (limited to 'nslcd')
-rw-r--r-- | nslcd/common.c | 4 | ||||
-rw-r--r-- | nslcd/config.c | 4 | ||||
-rw-r--r-- | nslcd/group.c | 5 | ||||
-rw-r--r-- | nslcd/nslcd.c | 2 | ||||
-rw-r--r-- | nslcd/pam.c | 6 | ||||
-rw-r--r-- | nslcd/protocol.c | 4 | ||||
-rw-r--r-- | nslcd/rpc.c | 4 | ||||
-rw-r--r-- | nslcd/service.c | 2 |
8 files changed, 15 insertions, 16 deletions
diff --git a/nslcd/common.c b/nslcd/common.c index 211be1b..ade9ca6 100644 --- a/nslcd/common.c +++ b/nslcd/common.c @@ -238,8 +238,8 @@ int write_address(TFILE *fp, MYLDAP_ENTRY *entry, const char *attr, /* failure, log but write simple invalid address (otherwise the address list is messed up) */ /* TODO: have error message in correct format */ - log_log(LOG_WARNING, "%s: %s: \"%s\" unparseble", - myldap_get_dn(entry), attmap_ether_cn, addr); + log_log(LOG_WARNING, "%s: %s: \"%s\" unparsable", + myldap_get_dn(entry), attr, addr); /* write an illegal address type */ WRITE_INT32(fp, -1); /* write an emtpy address */ diff --git a/nslcd/config.c b/nslcd/config.c index 36efede..75c9ec1 100644 --- a/nslcd/config.c +++ b/nslcd/config.c @@ -1,7 +1,7 @@ /* config.c - routines for getting configuration information - Copyright (C) 2012 Arthur de Jong + Copyright (C) 2012, 2013 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 @@ -33,7 +33,7 @@ #include "log.h" #include "cfg.h" -int nslcd_config_get(TFILE *fp, MYLDAP_SESSION *session) +int nslcd_config_get(TFILE *fp, MYLDAP_SESSION UNUSED(*session)) { int32_t tmpint32; int32_t cfgopt; diff --git a/nslcd/group.c b/nslcd/group.c index e4ff55a..4fd40bf 100644 --- a/nslcd/group.c +++ b/nslcd/group.c @@ -136,8 +136,7 @@ static int mkfilter_group_bymember(MYLDAP_SESSION *session, attmap_group_member, safedn); } -static int mkfilter_group_bymemberdn(MYLDAP_SESSION *session, - const char *dn, +static int mkfilter_group_bymemberdn(const char *dn, char *buffer, size_t buflen) { char safedn[300]; @@ -481,7 +480,7 @@ int nslcd_group_bymember(TFILE *fp, MYLDAP_SESSION *session) while ((dn = set_pop(tocheck)) != NULL) { /* make filter for finding groups with our group as member */ - if (mkfilter_group_bymemberdn(session, dn, filter, sizeof(filter))) + if (mkfilter_group_bymemberdn(dn, filter, sizeof(filter))) { log_log(LOG_WARNING, "nslcd_group_bymember(): filter buffer too small"); set_free(seen); diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c index ffa6bea..b5881c4 100644 --- a/nslcd/nslcd.c +++ b/nslcd/nslcd.c @@ -250,7 +250,7 @@ static int create_socket(const char *filename) log_log(LOG_ERR, "cannot create socket: %s", strerror(errno)); exit(EXIT_FAILURE); } - if (sock >= FD_SETSIZE) + if (sock >= (int)FD_SETSIZE) { log_log(LOG_ERR, "socket file descriptor number too high (%d)", sock); exit(EXIT_FAILURE); diff --git a/nslcd/pam.c b/nslcd/pam.c index bdd8729..2593c7c 100644 --- a/nslcd/pam.c +++ b/nslcd/pam.c @@ -546,7 +546,7 @@ int nslcd_pam_authz(TFILE *fp, MYLDAP_SESSION *session) return 0; } -int nslcd_pam_sess_o(TFILE *fp, MYLDAP_SESSION *session) +int nslcd_pam_sess_o(TFILE *fp, MYLDAP_SESSION UNUSED(*session)) { int32_t tmpint32; char username[256], service[64], ruser[256], rhost[HOST_NAME_MAX + 1], tty[64]; @@ -554,7 +554,7 @@ int nslcd_pam_sess_o(TFILE *fp, MYLDAP_SESSION *session) static const char alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "01234567890"; - int i; + unsigned int i; /* read request parameters */ READ_STRING(fp, username); READ_STRING(fp, service); @@ -579,7 +579,7 @@ int nslcd_pam_sess_o(TFILE *fp, MYLDAP_SESSION *session) return 0; } -int nslcd_pam_sess_c(TFILE *fp, MYLDAP_SESSION *session) +int nslcd_pam_sess_c(TFILE *fp, MYLDAP_SESSION UNUSED(*session)) { int32_t tmpint32; char username[256], service[64], ruser[256], rhost[HOST_NAME_MAX + 1], tty[64]; diff --git a/nslcd/protocol.c b/nslcd/protocol.c index a2a31da..d37c903 100644 --- a/nslcd/protocol.c +++ b/nslcd/protocol.c @@ -5,7 +5,7 @@ Copyright (C) 1997-2005 Luke Howard Copyright (C) 2006 West Consulting - Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Arthur de Jong + Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012, 2013 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 @@ -150,7 +150,7 @@ static int write_protocol(TFILE *fp, MYLDAP_ENTRY *entry, const char *reqname) myldap_get_dn(entry), attmap_protocol_ipProtocolNumber); return 0; } - else if ((errno != 0) || (proto < 0) || (proto > UINT8_MAX)) + else if ((errno != 0) || (proto < 0) || (proto > (long)UINT8_MAX)) { log_log(LOG_WARNING, "%s: %s: out of range", myldap_get_dn(entry), attmap_protocol_ipProtocolNumber); diff --git a/nslcd/rpc.c b/nslcd/rpc.c index e022154..ba88f4e 100644 --- a/nslcd/rpc.c +++ b/nslcd/rpc.c @@ -5,7 +5,7 @@ Copyright (C) 1997-2005 Luke Howard Copyright (C) 2006 West Consulting - Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Arthur de Jong + Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012, 2013 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 @@ -105,7 +105,7 @@ static int write_rpc(TFILE *fp, MYLDAP_ENTRY *entry, const char *reqname) const char **aliases; const char **numbers; char *tmp; - long number; + unsigned long number; int i; /* get the most canonical name */ name = myldap_get_rdn_value(entry, attmap_rpc_cn); diff --git a/nslcd/service.c b/nslcd/service.c index 187bce0..673aac4 100644 --- a/nslcd/service.c +++ b/nslcd/service.c @@ -173,7 +173,7 @@ static int write_service(TFILE *fp, MYLDAP_ENTRY *entry, myldap_get_dn(entry), attmap_service_ipServicePort); return 0; } - else if ((errno != 0) || (port <= 0) || (port > UINT16_MAX)) + else if ((errno != 0) || (port <= 0) || (port > (long)UINT16_MAX)) { log_log(LOG_WARNING, "%s: %s: out of range", myldap_get_dn(entry), attmap_service_ipServicePort); |