]> git.sur5r.net Git - openldap/blobdiff - clients/fax500/main.c
Add LDAP version to comment
[openldap] / clients / fax500 / main.c
index 5bc84f2fb8efed7a7f7afa7ab44f8040b994ef28..8362a7b520c26fdfbb9148178075ed4185d12c1e 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright (c) 1990 Regents of the University of Michigan.
  * All rights reserved.
@@ -18,6 +19,7 @@
 
 #include <ac/ctype.h>
 #include <ac/errno.h>
+#include <ac/param.h>
 #include <ac/signal.h>
 #include <ac/socket.h>
 #include <ac/string.h>
@@ -27,9 +29,6 @@
 #include <ac/unistd.h>
 #include <ac/wait.h>
 
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
 #endif
@@ -121,7 +120,7 @@ static void add_to(char ***list, int *nlist, char **new);
 static int  isgroup(LDAPMessage *e);
 static void add_error(Error **err, int *nerr, int code, char *addr, LDAPMessage *msg);
 static void add_group(char *dn, Group **list, int *nlist);
-static void unbind_and_exit(int rc);
+static void unbind_and_exit(int rc) LDAP_GCCATTR((noreturn));
 static int  group_loop(char *dn);
 static void send_group(Group *group, int ngroup);
 static int  has_attributes(LDAPMessage *e, char *attr1, char *attr2);
@@ -190,7 +189,7 @@ main ( int argc, char **argv )
 
 #ifdef LOG_MAIL
        openlog( myname, OPENLOG_OPTIONS, LOG_MAIL );
-#else
+#elif LOG_DEBUG
        openlog( myname, OPENLOG_OPTIONS );
 #endif
 
@@ -831,7 +830,7 @@ add_member(
 
        timeout.tv_sec = FAX_TIMEOUT;
        timeout.tv_usec = 0;
-       if ( (rc = ldap_search_st( ld, dn, LDAP_SCOPE_BASE, "(objectclass=*)",
+       if ( (rc = ldap_search_st( ld, dn, LDAP_SCOPE_BASE, NULL,
            attrs, 0, &timeout, &res )) != LDAP_SUCCESS ) {
                if ( rc == LDAP_NO_SUCH_OBJECT ) {
                        add_error( err, nerr, E_BADMEMBER, dn, NULL );
@@ -1465,7 +1464,7 @@ get_attributes_mail_dn( LDAPMessage *e, char *attr1, char *attr2 )
 
                for ( i = 0; dnlist[i] != NULL; i++ ) {
                        if ( (rc = ldap_search_st( ld, dnlist[i],
-                           LDAP_SCOPE_BASE, "(objectclass=*)", attrs, 0,
+                           LDAP_SCOPE_BASE, NULL, attrs, 0,
                            &timeout, &res )) != LDAP_SUCCESS ) {
                                if ( rc != LDAP_NO_SUCH_OBJECT ) {
                                        unbind_and_exit( EX_TEMPFAIL );