]> git.sur5r.net Git - openldap/blobdiff - clients/mail500/main.c
Update copyright notices
[openldap] / clients / mail500 / main.c
index f7a9993035de4e912e97bd8a8a64f87d6a3fff57..cbe5bb80372f1ce7343e6af71f9ef0deae4b17b7 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright (c) 1990 Regents of the University of Michigan.
  * All rights reserved.
@@ -8,14 +9,20 @@
  * may not be used to endorse or promote products derived from this
  * software without specific prior written permission. This software
  * is provided ``as is'' without express or implied warranty.
+ *
+ * Copyright 1998-2000 The OpenLDAP Foundation
+ * COPYING RESTRICTIONS APPLY.  See COPYRIGHT File in top level directory
+ * of this package for details.
  */
 
 #include "portable.h"
 
 #include <stdio.h>
-#include <stdlib.h>
+
+#include <ac/stdlib.h>
 
 #include <ac/ctype.h>
+#include <ac/param.h>
 #include <ac/signal.h>
 #include <ac/string.h>
 #include <ac/sysexits.h>
 
 #include <sys/stat.h>
 
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
 #endif
 
-#include "lber.h"
-#include "ldap.h"
+#include <ldap.h>
 
-#include "ldapconfig.h"
+#include "ldap_defaults.h"
 
 #ifndef MAIL500_BOUNCEFROM
 #define MAIL500_BOUNCEFROM "<>"
@@ -81,7 +83,7 @@ typedef struct errs {
 #define        E_NOOWNER               11
 #define E_GROUPUNKNOWN         12
        char            *e_addr;
-       union {
+       union e_union_u {
                char            *e_u_loop;
                LDAPMessage     *e_u_msg;
        } e_union;
@@ -106,13 +108,13 @@ typedef struct baseinfo {
 } Base;
 
 Base   base[] = {
-       {"ou=People, dc=OpenLDAP, dc=org",
+       {"ou=People, dc=example, dc=com",
                0, USER,
                {"uid=%s", "cn=%s", NULL}},
-       {"ou=System Groups, ou=Groups, dc=OpenLDAP, dc=org",
+       {"ou=System Groups, ou=Groups, dc=example, dc=com",
                1, 0xff,
                {"(&(cn=%s)(associatedDomain=%h))", NULL, NULL}},
-       {"ou=User Groups, ou=Groups, dc=OpenLDAP, dc=org",
+       {"ou=User Groups, ou=Groups, dc=example, dc=com",
                1, 0xff,
                {"(&(cn=%s)(associatedDomain=%h))", NULL, NULL}},
        {NULL}
@@ -161,7 +163,7 @@ main ( int argc, char **argv )
        int             numto, ngroups, numerr, nargs;
        int             i, j;
 
-       if ( (myname = strrchr( argv[0], '/' )) == NULL )
+       if ( (myname = strrchr( argv[0], *LDAP_DIRSEP )) == NULL )
                myname = strdup( argv[0] );
        else
                myname = strdup( myname + 1 );
@@ -172,7 +174,7 @@ main ( int argc, char **argv )
 
 #ifdef LOG_MAIL
        openlog( myname, OPENLOG_OPTIONS, LOG_MAIL );
-#else
+#elif LOG_DEBUG
        openlog( myname, OPENLOG_OPTIONS );
 #endif
 
@@ -359,8 +361,8 @@ connect_to_x500( void )
 {
        int opt;
 
-       if ( (ld = ldap_open( ldaphost, 0 )) == NULL ) {
-               syslog( LOG_ALERT, "ldap_open failed" );
+       if ( (ld = ldap_init( ldaphost, 0 )) == NULL ) {
+               syslog( LOG_ALERT, "ldap_init failed" );
                return( -1 );
        }