]> git.sur5r.net Git - openldap/commitdiff
ITS#8097 nssov: clean up some compiler warnings
authorRyan Tandy <ryan@nardis.ca>
Tue, 24 Mar 2015 01:57:39 +0000 (18:57 -0700)
committerQuanah Gibson-Mount <quanah@openldap.org>
Fri, 17 Apr 2015 18:18:30 +0000 (13:18 -0500)
contrib/slapd-modules/nssov/ether.c
contrib/slapd-modules/nssov/host.c
contrib/slapd-modules/nssov/network.c
contrib/slapd-modules/nssov/nssov.c
contrib/slapd-modules/nssov/nssov.h
contrib/slapd-modules/nssov/pam.c
contrib/slapd-modules/nssov/passwd.c
contrib/slapd-modules/nssov/protocol.c
contrib/slapd-modules/nssov/rpc.c
contrib/slapd-modules/nssov/service.c

index 0cb85db830b3719789841927fca53f1b1bcffeae..e2a6a50a6d4f27c5c5e65e0e5e98a7ee53bc63c0 100644 (file)
@@ -65,7 +65,7 @@ static int write_ether(nssov_ether_cbp *cbp,Entry *entry)
 {
        int32_t tmpint32;
        struct ether_addr tmpaddr;
-       struct berval tmparr[2], empty;
+       struct berval tmparr[2];
        struct berval *names,*ethers;
        Attribute *a;
        int i,j;
index 4fae49d4c5deff0b9ec2dbb0fd7804cbacf84820..76d7029d640822cff6546db2d93ebf57835b0d8d 100644 (file)
@@ -50,7 +50,7 @@ NSSOV_CBPRIV(host,
 /* write a single host entry to the stream */
 static int write_host(nssov_host_cbp *cbp,Entry *entry)
 {
-       int32_t tmpint32,tmp2int32,tmp3int32;
+       int32_t tmpint32;
        int numaddr,i,numname,dupname;
        struct berval name,*names,*addrs;
        Attribute *a;
index 272dfda4c7a563802d119b8bd924a53ebbd5b069..6387688ed90bd79e325e278213056fb2c7bdaf4f 100644 (file)
@@ -50,7 +50,7 @@ NSSOV_CBPRIV(network,
 /* write a single network entry to the stream */
 static int write_network(nssov_network_cbp *cbp,Entry *entry)
 {
-       int32_t tmpint32,tmp2int32,tmp3int32;
+       int32_t tmpint32;
        int numaddr,i,numname,dupname;
        struct berval name, *names, *addrs;
        Attribute *a;
index e55c0c351fb032650694c138525e0d6ae83217c8..e361d7d3d76000e4ab31cb4dfe0150996b75d410 100644 (file)
@@ -46,7 +46,7 @@ AttributeDescription *nssov_pam_svc_ad;
 #define WRITEBUFFER_MAXSIZE 64*1024
 
 /* Find the given attribute's value in the RDN of the DN */
-int nssov_find_rdnval(struct berval *dn, AttributeDescription *ad, struct berval *value)
+void nssov_find_rdnval(struct berval *dn, AttributeDescription *ad, struct berval *value)
 {
        struct berval rdn;
        char *next;
@@ -406,10 +406,10 @@ static void *acceptconn(void *ctx, void *arg)
                        if ((errno==EINTR)||(errno==EAGAIN)||(errno==EWOULDBLOCK))
                        {
                                Debug( LDAP_DEBUG_TRACE,"nssov: accept() failed (ignored): %s",strerror(errno),0,0);
-                               return;
+                               return NULL;
                        }
                        Debug( LDAP_DEBUG_ANY,"nssov: accept() failed: %s",strerror(errno),0,0);
-                       return;
+                       return NULL;
                }
                /* make sure O_NONBLOCK is not inherited */
                if ((j=fcntl(csock,F_GETFL,0))<0)
@@ -417,14 +417,14 @@ static void *acceptconn(void *ctx, void *arg)
                        Debug( LDAP_DEBUG_ANY,"nssov: fcntl(F_GETFL) failed: %s",strerror(errno),0,0);
                        if (close(csock))
                                Debug( LDAP_DEBUG_ANY,"nssov: problem closing socket: %s",strerror(errno),0,0);
-                       return;
+                       return NULL;
                }
                if (fcntl(csock,F_SETFL,j&~O_NONBLOCK)<0)
                {
                        Debug( LDAP_DEBUG_ANY,"nssov: fcntl(F_SETFL,~O_NONBLOCK) failed: %s",strerror(errno),0,0);
                        if (close(csock))
                                Debug( LDAP_DEBUG_ANY,"nssov: problem closing socket: %s",strerror(errno),0,0);
-                       return;
+                       return NULL;
                }
        }
        connection_fake_init( &conn, &opbuf, ctx );
@@ -435,6 +435,8 @@ static void *acceptconn(void *ctx, void *arg)
 
        /* handle the connection */
        handleconnection(ni,csock,op);
+
+       return NULL;
 }
 
 static slap_verbmasks nss_svcs[] = {
@@ -769,7 +771,6 @@ nssov_db_init(
 {
        slap_overinst *on = (slap_overinst *)be->bd_info;
        nssov_info *ni;
-       nssov_mapinfo *mi;
        int rc;
 
        rc = nssov_pam_init();
@@ -802,6 +803,7 @@ nssov_db_destroy(
        BackendDB *be,
        ConfigReply *cr )
 {
+       return 0;
 }
 
 static int
@@ -958,6 +960,7 @@ nssov_db_close(
                                strerror(errno),0,0);
                }
        }
+       return 0;
 }
 
 static slap_overinst nssov;
index eae55f76559ddaaed8b9e38413279b6fd2005353..bef9495969a5f9966d17bd2f6a6e6091619f1bd2 100644 (file)
@@ -164,6 +164,9 @@ void nssov_cfg_init(nssov_info *ni,const char *fname);
     }                                                                          \
   }                                                                            \
 
+/* Find the given attribute's value in the RDN of the DN. */
+void nssov_find_rdnval(struct berval *dn,AttributeDescription *ad,struct berval *value);
+
 /* This tries to get the user password attribute from the entry.
    It will try to return an encrypted password as it is used in /etc/passwd,
    /etc/group or /etc/shadow depending upon what is in the directory.
@@ -303,7 +306,6 @@ int pam_pwmod(nssov_info *ni,TFILE *fp,Operation *op,uid_t calleruid);
   { \
     /* define common variables */ \
     int32_t tmpint32; \
-    int rc; \
        nssov_##db##_cbp cbp; \
        slap_callback cb = {0}; \
        SlapReply rs = {REP_RESULT}; \
index c94053848156e7f90ecb702d6d6237911d02a5e1..e38220a3afc7bc74be6457aab4e897637443cc01 100644 (file)
@@ -19,6 +19,9 @@
 #include "nssov.h"
 #include "lutil.h"
 
+#undef ldap_debug      /* silence a warning in ldap-int.h */
+#include "../../../libraries/libldap/ldap-int.h"       /* for ldap_ld_free */
+
 static int ppolicy_cid;
 static AttributeDescription *ad_loginStatus;
 
index 4e6a8c113d156207be0752b933585472e07b204a..e4cc61450f18da55e0624774615c48fd9d1b6a03 100644 (file)
@@ -207,7 +207,6 @@ static int write_passwd(nssov_passwd_cbp *cbp,Entry *entry)
 {
        int32_t tmpint32;
        struct berval tmparr[2], tmpuid[2];
-       const char **tmpvalues;
        char *tmp;
        struct berval *names;
        struct berval *uids;
index 058bb7926a6238ef5bec33855d341b55605b3dcf..1f9625d220a9b90d39f14c1d9889897db881ff29 100644 (file)
@@ -15,7 +15,7 @@
  * <http://www.OpenLDAP.org/license.html>.
  */
 /*
-/* ACKNOWLEDGEMENTS:
+ * ACKNOWLEDGEMENTS:
  * This code references portions of the nss-ldapd package
  * written by Arthur de Jong. The nss-ldapd code was forked
  * from the nss-ldap library written by Luke Howard.
@@ -50,7 +50,7 @@ NSSOV_CBPRIV(protocol,
 
 static int write_protocol(nssov_protocol_cbp *cbp,Entry *entry)
 {
-       int32_t tmpint32,tmp2int32,tmp3int32;
+       int32_t tmpint32;
        int i,numname,dupname,proto;
        struct berval name,*names;
        Attribute *a;
index 0d97d32ba78c71be28ee11c0be7166ce401e27ff..bb422ef89f7225e94b4c3f69a22e6086aeb70864 100644 (file)
@@ -52,7 +52,7 @@ NSSOV_CBPRIV(rpc,
 /* write a single rpc entry to the stream */
 static int write_rpc(nssov_rpc_cbp *cbp,Entry *entry)
 {
-       int32_t tmpint32,tmp2int32,tmp3int32;
+       int32_t tmpint32;
        int i,numname,dupname,number;
        struct berval name,*names;
        Attribute *a;
index 7521b26ed958c23d54f8bc1879e8a71fb8ad525f..ac7fa16cfaa7b06d35abb8ccfac835648554d72f 100644 (file)
@@ -112,8 +112,8 @@ NSSOV_CBPRIV(service,
 
 static int write_service(nssov_service_cbp *cbp,Entry *entry)
 {
-       int32_t tmpint32,tmp2int32,tmp3int32;
-       struct berval name,*names,*ports,*protos;
+       int32_t tmpint32;
+       struct berval name,*names,*protos;
        struct berval tmparr[2];
        Attribute *a;
        char *tmp;