* faxtotpc() returns a pointer to a string allocated with malloc(3).
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
#include <ctype.h>
-#include <sys/types.h>
-
-#ifdef ultrix
-extern char *strdup();
-#endif
+#include <sys/types.h>
+#include <ac/string.h>
#define TPCDOMAIN "tpc.int"
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
#include <stdio.h>
-#include <string.h>
#include <ctype.h>
-#include <memory.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <syslog.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/syslog.h>
+#include <ac/time.h>
+#include <ac/wait.h>
+
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
+#endif
+
#include <sys/resource.h>
-#include <sys/wait.h>
-#include <sys/socket.h>
#include <sysexits.h>
-#include <ldapconfig.h>
-#include "portable.h"
#include "lber.h"
#include "ldap.h"
+#include <ldapconfig.h>
#define USER 0
#define GROUP_ERRORS 1
ld->ld_sizelimit = FAX_MAXAMBIGUOUS;
ld->ld_deref = LDAP_DEREF_ALWAYS;
- if ( ldap_simple_bind_s( ld, FAX_BINDDN, NULL ) != LDAP_SUCCESS ) {
+ if ( ldap_simple_bind_s( ld, FAX_BINDDN, FAX_BIND_CRED ) != LDAP_SUCCESS ) {
syslog( LOG_ALERT, "ldap_simple_bind_s failed" );
return( -1 );
}
char **to;
{
int pid;
-#ifndef USE_WAITPID
+#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
/* parent */
if ( pid = fork() ) {
-#ifdef USE_WAITPID
+#ifdef HAVE_WAITPID
waitpid( pid, (int *) NULL, 0 );
#else
wait4( pid, &status, WAIT_FLAGS, 0 );
char **argv;
int argc;
char *iargv[7];
-#ifndef USE_WAITPID
+#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
/* parent */
if ( pid = fork() ) {
-#ifdef USE_WAITPID
+#ifdef HAVE_WAITPID
waitpid( pid, (int *) NULL, 0 );
#else
wait4( pid, &status, WAIT_FLAGS, 0 );
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <syslog.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
#include <signal.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/syslog.h>
+#include <ac/time.h>
+#include <ac/wait.h>
+
+#include <sys/resource.h>
+
+#include <lber.h>
+#include <ldap.h>
+
#include <ldapconfig.h>
-#include "lber.h"
-#include "ldap.h"
#define DEFAULT_PORT 79
#define DEFAULT_SIZELIMIT 50
int debug;
-char *ldaphost = LDAPHOST;
-char *base = DEFAULT_BASE;
+char *ldaphost = LDAPHOST;
+char *base = RP_BASE;
int deref;
int sizelimit;
LDAPFiltDesc *filtd;
ld->ld_sizelimit = sizelimit ? sizelimit : DEFAULT_SIZELIMIT;
ld->ld_deref = deref;
- if ( ldap_simple_bind_s( ld, RP_BINDDN, NULL ) != LDAP_SUCCESS ) {
+ if ( ldap_simple_bind_s( ld, RP_BINDDN, RP_BIND_CRED ) != LDAP_SUCCESS ) {
fprintf( stderr, "X.500 is temporarily unavailable.\n" );
ldap_perror( ld, "ldap_simple_bind_s" );
exit( -1 );
* is provided ``as is'' without express or implied warranty.
*/
-#include "lber.h"
-#include "ldap.h"
-#include "disptmpl.h"
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
#include <ctype.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <syslog.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
-#ifdef aix
-#include <sys/select.h>
-#endif /* aix */
#include <signal.h>
-#include "portable.h"
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/syslog.h>
+#include <ac/time.h>
+#include <ac/unistd.h>
+#include <ac/wait.h>
+
+#include <sys/resource.h>
+
+#include "lber.h"
+#include "ldap.h"
+#include "disptmpl.h"
+
#include "ldapconfig.h"
-#ifdef USE_SYSCONF
-#include <unistd.h>
-#endif /* USE_SYSCONF */
int dosyslog = 1;
char *ldaphost = LDAPHOST;
ld->ld_sizelimit = FINGER_SIZELIMIT;
ld->ld_deref = deref;
- if ( ldap_simple_bind_s( ld, FINGER_BINDDN, NULL ) != LDAP_SUCCESS ) {
+ if ( ldap_simple_bind_s( ld, FINGER_BINDDN, FINGER_BIND_CRED )
+ != LDAP_SUCCESS )
+ {
fprintf( stderr, FINGER_UNAVAILABLE );
ldap_perror( ld, "ldap_simple_bind_s" );
exit( 1 );
tblsize = getdtablesize();
#endif /* USE_SYSCONF */
+#ifdef FD_SETSIZE
+ if (tblsize > FD_SETSIZE) {
+ tblsize = FD_SETSIZE;
+ }
+#endif /* FD_SETSIZE*/
+
timeout.tv_sec = FINGER_TIMEOUT;
timeout.tv_usec = 0;
FD_ZERO( &readfds );
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <sys/types.h>
+#include <signal.h>
+
#include <sys/file.h>
#include <sys/ioctl.h>
#include <fcntl.h>
-#include <signal.h>
-#include "portable.h"
-#ifdef USE_SYSCONF
-#include <unistd.h>
-#endif /* USE_SYSCONF */
+#include <ac/unistd.h>
detach( debug )
int debug;
{
int i, sd, nbits;
-#ifdef USE_SYSCONF
+#if defined( HAVE_SYSCONF )
nbits = sysconf( _SC_OPEN_MAX );
-#else /* USE_SYSCONF */
+#elif defined( HAVE_GETDTABLESIZE )
nbits = getdtablesize();
-#endif /* USE_SYSCONF */
+#else
+ nbits = 32;
+#endif
+
+#ifdef FD_SETSIZE
+ if (nbits > FD_SETSIZE) {
+ nbits = FD_SETSIZE;
+ }
+#endif /* FD_SETSIZE*/
if ( debug == 0 || !(isatty( 1 )) ) {
for ( i = 0; i < 5; i++ ) {
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
#include <ctype.h>
-#include <sys/types.h>
+#include <signal.h>
+
+#include <ac/string.h>
+#include <ac/time.h>
+#include <ac/socket.h>
+#include <ac/syslog.h>
+#include <ac/unistd.h>
+#include <ac/wait.h>
+
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <syslog.h>
+#endif
+
#include <sys/resource.h>
-#include <sys/wait.h>
-#ifdef aix
-#include <sys/select.h>
-#endif /* aix */
-#include <signal.h>
-#include "portable.h"
+
#include "ldapconfig.h"
#include "lber.h"
#include "ldap.h"
#include "disptmpl.h"
-#ifdef USE_SYSCONF
-#include <unistd.h>
-#endif /* USE_SYSCONF */
-
int debug;
int dosyslog;
int inetd;
int myport;
static set_socket();
-static SIG_FN wait4child();
+static RETSIGTYPE wait4child();
static do_queries();
static do_error();
static do_search();
struct hostent *hp;
struct sockaddr_in from;
int fromlen;
- SIG_FN wait4child();
+ RETSIGTYPE wait4child();
extern char *optarg;
extern char **Argv;
extern int Argc;
dtblsize = getdtablesize();
#endif /* USE_SYSCONF */
+#ifdef FD_SETSIZE
+ if (dtblsize > FD_SETSIZE) {
+ dtblsize = FD_SETSIZE;
+ }
+#endif /* FD_SETSIZE*/
+
+
/* detach if stderr is redirected or no debugging */
if ( inetd == 0 )
(void) detach( debug );
return( s );
}
-static SIG_FN
+static RETSIGTYPE
wait4child()
{
+#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
+#endif
if ( debug ) printf( "parent: catching child status\n" );
-#ifdef USE_WAITPID
+
+#ifdef HAVE_WAITPID
while (waitpid ((pid_t) -1, 0, WAIT_FLAGS) > 0)
-#else /* USE_WAITPID */
- while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 )
-#endif /* USE_WAITPID */
- ; /* NULL */
+ ; /* NULL */
+#else
+ while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 )
+ ; /* NULL */
+#endif
(void) signal( SIGCHLD, (void *) wait4child );
}
}
ld->ld_deref = GO500_DEREF;
- if ( (rc = ldap_simple_bind_s( ld, GO500_BINDDN, NULL ))
+ if ( (rc = ldap_simple_bind_s( ld, GO500_BINDDN, GO500_BIND_CRED ))
!= LDAP_SUCCESS ) {
fprintf(fp,
"0An error occurred (explanation)\t@%d\t%s\t%d\r\n",
* is provided ``as is'' without express or implied warranty.
*/
-#include "lber.h"
-#include "ldap.h"
-#include "disptmpl.h"
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
#include <ctype.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <syslog.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
#include <signal.h>
-#ifdef aix
-#include <sys/select.h>
-#endif /* aix */
-#include "portable.h"
-#include "ldapconfig.h"
-#ifdef USE_SYSCONF
-#include <unistd.h>
-#endif /* USE_SYSCONF */
+#include <ac/time.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/syslog.h>
+#include <ac/unistd.h>
+#include <ac/wait.h>
+
+#include <sys/resource.h>
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#include "lber.h"
+#include "ldap.h"
+#include "disptmpl.h"
+
+#include "ldapconfig.h"
int debug;
int dosyslog;
int rdncount = GO500GW_RDNCOUNT;
static set_socket();
-static SIG_FN wait4child();
+static RETSIGTYPE wait4child();
static do_queries();
static do_menu();
static do_list();
struct hostent *hp;
struct sockaddr_in from;
int fromlen;
- SIG_FN wait4child();
+ RETSIGTYPE wait4child();
extern char *optarg;
extern char **Argv;
extern int Argc;
}
}
-#ifdef USE_SYSCONF
+#ifdef HAVE_SYSCONF
dtblsize = sysconf( _SC_OPEN_MAX );
-#else /* USE_SYSCONF */
+#elif HAVE_GETDTABLESIZE
dtblsize = getdtablesize();
-#endif /* USE_SYSCONF */
+#else
+ dtblsize = 32;
+#endif
+
+#ifdef FD_SETSIZE
+ if ( dtblsize > FD_SETSIZE ) {
+ dtblsize = FD_SETSIZE;
+ }
+#endif /* FD_SETSIZE*/
+
+
#ifdef GO500GW_HOSTNAME
strcpy( myhost, GO500GW_HOSTNAME );
return( s );
}
-static SIG_FN
+static RETSIGTYPE
wait4child()
{
- WAITSTATUSTYPE status;
-
- if ( debug ) printf( "parent: catching child status\n" );
-#ifdef USE_WAITPID
- while (waitpid ((pid_t) -1, 0, WAIT_FLAGS) > 0)
-#else /* USE_WAITPID */
- while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 )
-#endif /* USE_WAITPID */
- ; /* NULL */
+#ifndef HAVE_WAITPID
+ WAITSTATUSTYPE status;
+#endif
+
+ if ( debug ) printf( "parent: catching child status\n" );
+
+#ifdef HAVE_WAITPID
+ while (waitpid ((pid_t) -1, NULL, WAIT_FLAGS) > 0)
+ ; /* NULL */
+#else
+ while (wait3( &status, WAIT_FLAGS, 0 ) > 0 )
+ ; /* NULL */
+#endif
(void) signal( SIGCHLD, (void *) wait4child );
}
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
char **Argv; /* pointer to original (main's) argv */
int Argc; /* original argc */
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
#include <ctype.h>
-#include <memory.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <syslog.h>
+
+#include <ac/string.h>
+#include <ac/syslog.h>
+#include <ac/time.h>
+#include <ac/wait.h>
+
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
+#endif
+
#include <sys/resource.h>
-#include <sys/wait.h>
+
#include <sysexits.h>
-#include "portable.h"
#include "lber.h"
#include "ldap.h"
char **to;
{
int pid;
-#ifndef USE_WAITPID
+#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
/* parent */
if ( pid = fork() ) {
-#ifdef USE_WAITPID
+#ifdef HAVE_WAITPID
waitpid( pid, (int *) NULL, 0 );
#else
wait4( pid, &status, WAIT_FLAGS, 0 );
char **argv;
int argc;
char *iargv[7];
-#ifndef USE_WAITPID
+#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
/* parent */
if ( pid = fork() ) {
-#ifdef USE_WAITPID
+#ifdef HAVE_WAITPID
waitpid( pid, (int *) NULL, 0 );
#else
wait4( pid, &status, WAIT_FLAGS, 0 );
int fd[2];
char *argv[8];
char buf[1024];
-#ifndef USE_WAITPID
+#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
}
fclose( fp );
-#ifdef USE_WAITPID
+#ifdef HAVE_WAITPID
waitpid( pid, (int *) NULL, 0 );
#else
wait4( pid, &status, WAIT_FLAGS, 0 );
* All Rights Reserved
*/
-#include <stdio.h>
+#include "portable.h"
+
+#include <stdlib.h>
#include "rcpt500.h"
struct command cmds[] = {
* All Rights Reserved
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <syslog.h>
-#include <string.h>
+
+#include <ac/syslog.h>
+#include <ac/string.h>
+
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif
-#include "portable.h"
#include "ldapconfig.h"
#include "rcpt500.h"
* All Rights Reserved
*/
+#include "portable.h"
+
#include <stdio.h>
#include <stdlib.h>
-#include <syslog.h>
-#include <string.h>
#include <ctype.h>
-#include "portable.h"
+#include <ac/syslog.h>
+#include <ac/string.h>
+
+
#include "ldapconfig.h"
#include "rcpt500.h"
-#ifdef ultrix
-extern char *strdup();
-#endif
-
int dosyslog = 0;
-#ifdef CLDAP
+#ifdef LDAP_CONNECTIONLESS
int do_cldap = 0;
-#endif /* CLDAP */
+#endif /* LDAP_CONNECTIONLESS */
+
int derefaliases = 1;
int sizelimit = RCPT500_SIZELIMIT;
int rdncount = RCPT500_RDNCOUNT;
dosyslog = 1;
break;
case 'U':
-#ifdef CLDAP
+#ifdef LDAP_CONNECTIONLESS
do_cldap = 1;
-#else /* CLDAP */
- fprintf( stderr, "Compile with -DCLDAP for -U support\n" );
-#endif /* CLDAP */
+#else /* LDAP_CONNECTIONLESS */
+ fprintf( stderr,
+ "Compile with -DLDAP_CONNECTIONLESS for -U support\n" );
+#endif /* LDAP_CONNECTIONLESS */
break;
case 'b':
searchbase = optarg;
* All Rights Reserved
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <syslog.h>
-#include <string.h>
#include <ctype.h>
-#include <sys/time.h>
+
+#include <ac/string.h>
+#include <ac/syslog.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
-#include "portable.h"
-#include "ldapconfig.h"
#include "disptmpl.h"
+
#include "rcpt500.h"
+#include "ldapconfig.h"
extern int dosyslog;
extern int do_cldap;
* All Rights Reserved
*/
+#include <ldap_cdefs.h>
+
+LDAP_BEGIN_DECL
+
struct msginfo {
char *msg_subject;
char *msg_replyto; /* actually could be from From: line */
};
struct command {
- char *cmd_text; /* text for command, e.g. "HELP" */
- int (*cmd_handler)(); /* pointer to handler function */
+ char *cmd_text; /* text for command, e.g. "HELP" */
+ int (*cmd_handler)LDAP_P(()); /* pointer to handler function */
};
/*
* functions
*/
-int help_cmd();
-int query_cmd();
+int help_cmd LDAP_P(());
+int query_cmd LDAP_P(());
/*
* externs
*/
extern struct command cmds[];
+
+LDAP_END_DECL
#include <ac/socket.h>
#include <ac/string.h>
-#include <ac/time.h>
#include <lber.h>
#include <ldap.h>
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
#include <pwd.h>
-#include <string.h>
+#include <time.h>
#include <ctype.h>
+
+#include <ac/string.h>
+#include <ac/krb.h>
+
#include <lber.h>
#include <ldap.h>
#include <ldapconfig.h>
+
#include "ud.h"
-#ifdef KERBEROS
-#include <sys/types.h>
-#include <krb.h>
-#endif
extern LDAP *ld; /* our LDAP descriptor */
extern int verbose; /* verbosity indicator */
int name_provided; /* was a name passed in? */
struct passwd *pw; /* for getting user id */
char uidname[20];
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
char **krbnames; /* for kerberos names */
int kinited, ikrb;
char buf[5];
rdns = ldap_explode_dn(Entry.DN, TRUE);
printf(" Authenticating to the directory as \"%s\"...\n", *rdns );
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
/*
* First, if the user has a choice of auth methods, ask which
* one they want to use. if they want kerberos, ask which
if ( hassimple && !kinited ) {
printf(" Which password would you like to use?\n");
- printf(" 1 -> X.500 password\n");
+ printf(" 1 -> LDAP password\n");
#ifdef UOFM
printf(" 2 -> UMICH password (aka Uniqname or Kerberos password)\n");
#else
} else {
#endif
authmethod = LDAP_AUTH_SIMPLE;
- sprintf(prompt, " Enter your X.500 password: ");
+ sprintf(prompt, " Enter your LDAP password: ");
do {
passwd = mygetpass(prompt);
} while (passwd != NULL && *passwd == '\0');
(void) ldap_value_free(rdns);
return(0);
}
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
}
(void) ldap_value_free(krbnames);
#endif
if (ld->ld_errno == LDAP_NO_SUCH_ATTRIBUTE)
fprintf(stderr, " Entry has no password\n");
else if (ld->ld_errno == LDAP_INVALID_CREDENTIALS)
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
if ( authmethod == LDAP_AUTH_KRBV4 ) {
fprintf(stderr, " The Kerberos credentials are invalid.\n");
} else {
#endif
fprintf(stderr, " The password you provided is incorrect.\n");
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
}
#endif
else
ldap_perror(ld, "ldap_bind_s" );
(void) ldap_bind_s(ld, default_bind_object,
- (char *) UD_PASSWD, LDAP_AUTH_SIMPLE);
+ (char *) UD_BIND_CRED, LDAP_AUTH_SIMPLE);
if (default_bind_object == NULL)
set_bound_dn(NULL);
else
return(0);
}
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
#define FIVEMINS ( 5 * 60 )
#define TGT "krbtgt"
-str2upper( s )
+static void str2upper( s )
char *s;
{
char *p;
return( 0 );
}
-#ifdef AFSKERBEROS
+#ifdef HAVE_AFS_KERBEROS
/*
* realm must be uppercase for krb_ routines
*/
str2upper( realm );
-#endif /* AFSKERBEROS */
+#endif /* HAVE_AFS_KERBEROS */
/*
* check ticket file for a valid ticket granting ticket
return(-1);
}
-#ifdef AFSKERBEROS
+#ifdef HAVE_AFS_KERBEROS
strcpy( lcrealm, realm );
for ( p = lcrealm; *p != '\0'; ++p ) {
if ( isupper( *p )) {
}
ka_StringToKey( passwd, lcrealm, key );
-#else /* AFSKERBEROS */
+#else /* HAVE_AFS_KERBEROS */
string_to_key( passwd, key );
-#endif /* AFSKERBEROS */
+#endif /* HAVE_AFS_KERBEROS */
return( 0 );
}
return( -1 );
}
-#ifdef AFSKERBEROS
+#ifdef HAVE_AFS_KERBEROS
/*
* realm must be uppercase for krb_ routines
*/
str2upper( realm );
-#endif /* AFSKERBEROS */
+#endif /* HAVE_AFS_KERBEROS */
rc = krb_get_in_tkt( name, inst, realm, TGT, realm,
DEFAULT_TKT_LIFE, krbgetpass, NULL, NULL );
return( 0 );
}
-destroy_tickets()
+void destroy_tickets(void)
{
if ( *tktpath != '\0' ) {
unlink( tktpath );
}
#endif
-static void set_bound_dn(s)
-char *s;
+static void set_bound_dn(char *s)
{
extern void Free();
extern char *bound_dn;
if (bound_dn != NULL)
Free(bound_dn);
- bound_dn = strdup(s);
+ bound_dn = (s == NULL) ? NULL : strdup(s);
}
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
#include <signal.h>
+
+#include <ac/string.h>
+#include <ac/time.h>
+#include <ac/wait.h>
+
+#include <sys/resource.h>
+
#include <lber.h>
#include <ldap.h>
#include <ldapconfig.h>
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
#include <ctype.h>
-#ifndef __STDC__
-#include <memory.h>
-#endif
+
+#include <ac/string.h>
+#include <ac/time.h>
+
#include <lber.h>
#include <ldap.h>
+
#include "ud.h"
extern char *search_base; /* search base */
} else if (matches == 1) {
if (ldap_search_s(ld, ldap_get_dn(ld, ldap_first_entry(ld, res)), LDAP_SCOPE_BASE, "objectClass=*", read_attrs, FALSE, &res) != LDAP_SUCCESS) {
if (ld->ld_errno == LDAP_UNAVAILABLE)
- printf(" Could not contact the X.500 server to find \"%s\".\n", who);
+ printf(" Could not contact the LDAP server to find \"%s\".\n", who);
else
ldap_perror(ld, "ldap_search_s");
return(NULL);
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
#include "ud.h"
*
*/
+#include "portable.h"
+
#include <stdio.h>
#include <string.h>
+#include <time.h>
+
#include <lber.h>
#include <ldap.h>
+
#include <ldapconfig.h>
#include "ud.h"
#endif
/*
- * Now add this to the X.500 Directory.
+ * Now add this to the LDAP Directory.
*/
if (ldap_add_s(ld, dn, attrs) != 0) {
ldap_perror(ld, " ldap_add_s");
return;
/*
- * Now remove this from the X.500 Directory.
+ * Now remove this from the LDAP Directory.
*/
if (ldap_delete_s(ld, dn) != 0) {
if (ld->ld_errno == LDAP_INSUFFICIENT_ACCESS)
}
/*
- * Add the X.500 style names.
+ * Add the LDAP style names.
*/
if (count_x500 > 0) {
mods[0] = &mod;
vp = Entry.attrs[attr_to_index("member")].values;
if (vp == NULL) {
if (verbose)
- printf(" \"%s\" has no X.500 members. There is nothing to purge.\n", group);
+ printf(" \"%s\" has no LDAP members. There is nothing to purge.\n", group);
return;
}
for (; *vp != NULL; vp++) {
}
if (verbose) {
printf("\n");
- format("Values may be specified as a name (which is then looked up in the X.500 Directory) or as a domain-style (i.e., user@domain) e-mail address. Simply hit the RETURN key at the prompt when finished.\n", 75, 2);
+ format("Values may be specified as a name (which is then looked up in the LDAP Directory) or as a domain-style (i.e., user@domain) e-mail address. Simply hit the RETURN key at the prompt when finished.\n", 75, 2);
printf("\n");
}
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
#include <ctype.h>
-#include <string.h>
+
+#include <ac/string.h>
+#include <ac/time.h>
+
#include <lber.h>
#include <ldap.h>
+
#include "ud.h"
#ifdef DEBUG
format("should be specified as a ordinary name (e.g., 'Friends of maX500').", 75, 15);
printf("\n");
printf(" [where] A place in the Directory needs to be specified. This name\n");
- format("should be specified as an X.500-style name (e.g., 'ou=people, o=University of Michigan, c=United States of America'). In most cases, it is easier to omit the [where] and allow the program to guide you.", 75, 15);
+ format("should be specified as an LDAP-style name (e.g., 'ou=people, o=University of Michigan, c=United States of America'). In most cases, it is easier to omit the [where] and allow the program to guide you.", 75, 15);
printf("\n");
printf(" [who] A person in the Directory needs to be specified. This name\n");
format("can be specified as either a ordinary name (e.g., 'Jane Doe'), or as some other identifying characteristic (e.g., 'uid=babs').", 75, 15);
}
else if (!strncasecmp("groupbase", s, len)) {
printf(" groupbase [where]\n\n");
- format("The syntax and use of this command is identical to the more commonly used 'cb' command. This command sets the base which is used to create groups in the X.500 Directory. Setting the base to a certain value does not necessarily grant the person write-access to that part of the Directory in order to successfully create a group.", 75, 2);
+ format("The syntax and use of this command is identical to the more commonly used 'cb' command. This command sets the base which is used to create groups in the LDAP Directory. Setting the base to a certain value does not necessarily grant the person write-access to that part of the Directory in order to successfully create a group.", 75, 2);
}
else if (!strncasecmp("cd", s, len) || !strncasecmp("cb", s,len)) {
printf(" cb [where]\n");
printf("\n * cb default\n\n");
format("sets the search base to its original default value.", 75, 2);
printf("\n * cb o=Merit Computer Network, c=US\n\n");
- format("sets the search base to organization given, the Merit Computer Network in this case. This comamnd checks the validity of the specified search base, and rejects it if it is not a valid Distinguished Name (DN). A DN uniquely identifies a portion of the global X.500 namespace.", 75, 2);
+ format("sets the search base to organization given, the Merit Computer Network in this case. This comamnd checks the validity of the specified search base, and rejects it if it is not a valid Distinguished Name (DN). A DN uniquely identifies a portion of the global LDAP namespace.", 75, 2);
}
else if (!strncasecmp("quit", s, len) || !strncasecmp("stop",s, len)) {
printf(" quit\n");
else if (!strncasecmp("modify", s, len) || !strncasecmp("change", s, len)) {
printf(" modify [entry]\n");
printf(" change [entry]\n\n");
- format("Changes information associated with an entry in the X.500 Directory. 'change' is an alias for 'modify'.", 75, 2);
+ format("Changes information associated with an entry in the LDAP Directory. 'change' is an alias for 'modify'.", 75, 2);
}
else if (!strncasecmp("verbose", s, len)) {
printf(" verbose\n\n");
}
else if (!strncasecmp("tidy", s, len)) {
printf(" tidy\n\n");
- format("Unsubscribes you from non-existent groups. Useful when you cannot resign from a group because, while your X.500 entry still contains a pointer to it, someone has removed a group of which you were a subscriber.", 75, 2);
+ format("Unsubscribes you from non-existent groups. Useful when you cannot resign from a group because, while your LDAP entry still contains a pointer to it, someone has removed a group of which you were a subscriber.", 75, 2);
}
else if (*s == '?') {
format("Prints out a brief description of each command. Same as typing 'help help'.", 75, 2);
* Simon Fraser University, Academic Computing Services
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <sys/types.h>
-#if defined(NeXT)
#include <stdlib.h>
-#include <sys/file.h>
-#else NeXT
-#include <unistd.h>
-#endif NeXT
-#include <pwd.h>
-#include <string.h>
-#ifndef DOS
-#if defined( NeXT ) || defined( ultrix ) || defined( osf1 ) || (defined(SunOS) && SunOS < 40)
-#include <sgtty.h>
-#else /* defined( NeXT ) || defined( ultrix ) etc. */
-#include <termios.h>
-#endif /* defined( NeXT ) || defined( ultrix ) etc. */
-#endif /* !DOS */
-#if defined( aix ) || defined( __NetBSD__ )
-#include <sys/ioctl.h>
-#endif /* aix || __NetBSD__ */
-#include <ctype.h>
#include <signal.h>
#include <setjmp.h>
-#include <memory.h>
+#include <pwd.h>
+
+#include <ac/string.h>
+#include <ac/termios.h>
+#include <ac/time.h>
+#include <ac/unistd.h>
+
+#ifdef HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+
#include <lber.h>
#include <ldap.h>
#include <ldapconfig.h>
-#include "portable.h"
#include "ud.h"
#ifndef lint
char *default_bind_object = UD_BINDDN;
char *bound_dn; /* bound user's Distinguished Name */
-char *group_base; /* place in X.500 tree where groups are */
-char *search_base; /* place in X.500 tree where searches start */
+char *group_base; /* place in LDAP tree where groups are */
+char *search_base; /* place in LDAP tree where searches start */
static jmp_buf env; /* spot to jump to on an interrupt */
}
/*
- * User wants to ascend one level in the X.500 tree.
+ * User wants to ascend one level in the LDAP tree.
* Easy: Just strip off the first element of the
* current search base, unless it's the root, in
* which case we just do nothing.
char *term; /* for tty set-up */
char *config; /* config file to use */
static char bp[1024]; /* for tty set-up */
- extern SIG_FN attn(); /* ^C signal handler */
+ extern RETSIGTYPE attn(); /* ^C signal handler */
extern char *getenv();
extern void Free();
* because we want to be sure to use TCP, not UDP.
*/
if ((ld = ldap_open(server, ldap_port)) == NULL) {
- fprintf(stderr, " The X.500 Directory is temporarily unavailable. Please try again later.\n");
+ fprintf(stderr, " The LDAP Directory is temporarily unavailable. Please try again later.\n");
exit(0);
/* NOTREACHED */
}
- if (ldap_bind_s(ld, (char *) default_bind_object, (char *) UD_PASSWD,
+ if (ldap_bind_s(ld, (char *) default_bind_object, (char *) UD_BIND_CRED,
LDAP_AUTH_SIMPLE) != LDAP_SUCCESS) {
- fprintf(stderr, " The X.500 Directory is temporarily unavailable. Please try again later.\n");
+ fprintf(stderr, " The LDAP Directory is temporarily unavailable. Please try again later.\n");
if (ld->ld_errno != LDAP_UNAVAILABLE)
ldap_perror(ld, " ldap_bind_s");
exit(0);
(void) signal(SIGINT, attn);
-#if !defined(DOS) && !defined(NOTERMCAP)
+#ifndef NO_TERMCAP
{
struct winsize win; /* for tty set-up */
- extern SIG_FN chwinsz(); /* WINSZ signal handler */
+ extern RETSIGTYPE chwinsz(); /* WINSZ signal handler */
if (((term = getenv("TERM")) == NULL) || (tgetent(bp, term) <= 0))
return;
#endif
}
-SIG_FN attn()
+RETSIGTYPE attn()
{
fflush(stderr);
fflush(stdout);
longjmp(env, 1);
}
-#if !defined(DOS) && !defined(NOTERMCAP)
-SIG_FN chwinsz()
+#ifndef NO_TERMCAP
+RETSIGTYPE chwinsz()
{
struct winsize win;
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
#include <string.h>
#include <ctype.h>
-#include <lber.h>
-#include <ldap.h>
+#include <time.h>
#ifndef __STDC__
#include <memory.h>
#endif
#include <sys/types.h>
+
+#include <lber.h>
+#include <ldap.h>
#include "ud.h"
extern struct entry Entry;
if (verbose && !printed_warning && (ld->ld_errno == LDAP_NO_SUCH_ATTRIBUTE)) {
printed_warning = 1;
printf("\n WARNING!\n");
- printf(" You are about to make a modification to an X.500 entry\n");
+ printf(" You are about to make a modification to an LDAP entry\n");
printf(" that has its \"automatic updates\" field set to ON.\n");
printf(" This means that the entry will be automatically updated\n");
printf(" each month from official University sources like the\n");
if (lmp == (LDAPMessage *) NULL) {
printf(" Could not find \"%s\" in the Directory\n", line);
if (verbose)
- format("Owners of groups must be valid entries in the X.500 Directory. The name you have typed above could not be found in the X.500 Directory.", 72, 2);
+ format("Owners of groups must be valid entries in the LDAP Directory. The name you have typed above could not be found in the LDAP Directory.", 72, 2);
return(NULL);
}
elmp = ldap_first_entry(ld, lmp);
if (verbose) {
printf("\n By default, updates that are received from the Personnel\n");
printf(" Office and the Office of the Registrar are applied to all\n");
- printf(" entries in the X.500 database each month. Sometimes this\n");
+ printf(" entries in the LDAP database each month. Sometimes this\n");
printf(" feature is undesirable. For example, if you maintain your\n");
- printf(" entry in the X.500 database manually, you may not want to\n");
+ printf(" entry in the LDAP database manually, you may not want to\n");
printf(" have these updates applied to your entry, possibly overwriting\n");
printf(" correct information with out-dated information.\n\n");
}
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
#include <string.h>
#include <ctype.h>
+#include "portable.h"
+
#if defined(KERBEROS) && !defined(openbsd)
/*
* $Source: /repo/OpenLDAP/pkg/ldap/clients/ud/string_to_key.c,v $
* is provided ``as is'' without express or implied warranty.
*/
-#define DISABLE_BRIDGE
#include "portable.h"
#include <stdio.h>
#include <stdlib.h>
-#include <ac/string.h>
+#include <ctype.h>
#include <signal.h>
-#ifdef DOS
-#include <malloc.h>
-#endif
-#include <memory.h>
-#if defined( NeXT )
-#endif
-#include <ctype.h>
+#include <ac/string.h>
+#include <ac/termios.h>
#include <ac/time.h>
-#include <errno.h>
+#include <ac/errno.h>
+#include <ac/unistd.h>
#include <lber.h>
#include <ldap.h>
-
#include <ldapconfig.h>
-#if !defined(DOS) && !defined( VMS)
-#include <sys/types.h>
-#endif
-#include "portable.h"
-#ifdef USE_TERMIOS
-#include <termios.h>
-#else /* USE_TERMIOS */
-#include <sgtty.h>
-#endif /* USE_TERMIOS */
-
#include "ud.h"
-#if defined(VMS)
-#define getch getchar
-#endif
-
#ifdef DEBUG
extern int debug;
#endif
register char *p;
register int c;
FILE *fi;
- SIG_FN (*sig)();
+ RETSIGTYPE (*sig)();
#ifdef DEBUG
if (debug & D_TRACE)
strtol \
strtoul \
sysconf \
+ waitpid \
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5929: checking for $ac_func" >&5
+echo "configure:5930: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5934 "configure"
+#line 5935 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:5957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
for ac_func in getopt strdup
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5985: checking for $ac_func" >&5
+echo "configure:5986: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5990 "configure"
+#line 5991 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:6013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
# Check Configuration
echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:6043: checking declaration of sys_errlist" >&5
+echo "configure:6044: checking declaration of sys_errlist" >&5
if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6049 "configure"
+#line 6050 "configure"
#include "confdefs.h"
#include <stdio.h>
char *c = (char *) *sys_errlist
; return 0; }
EOF
-if { (eval echo configure:6059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ol_cv_dcl_sys_errlist=yes
else
EOF
echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:6080: checking existence of sys_errlist" >&5
+echo "configure:6081: checking existence of sys_errlist" >&5
if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6086 "configure"
+#line 6087 "configure"
#include "confdefs.h"
#include <errno.h>
int main() {
char *c = (char *) *sys_errlist
; return 0; }
EOF
-if { (eval echo configure:6093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ol_cv_have_sys_errlist=yes
else
strtol \
strtoul \
sysconf \
+ waitpid \
)
AC_REPLACE_FUNCS(getopt strdup)
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
#endif
+#ifdef WCONTINUED
+# define WAIT_FLAGS ( WNOHANG | WUNTRACED | WCONTINUED )
+#else
+# define WAIT_FLAGS ( WNOHANG | WUNTRACED )
+#endif
+
#endif /* _AC_WAIT_H */
#define LDAP_URL_ERR_BADSCOPE 3 /* URL scope string is invalid */
#define LDAP_URL_ERR_MEM 4 /* can't allocate memory space */
+/* this typedef is never used, only exists to rid of declaration
+ in function param list warning */
+typedef struct timeval LDAPtv;
+
/*
* in abandon.c:
*/
/* Define if you have the sysconf function. */
#undef HAVE_SYSCONF
+/* Define if you have the waitpid function. */
+#undef HAVE_WAITPID
+
/* Define if you have the <db.h> header file. */
#undef HAVE_DB_H
/* Define if you have the sysconf function. */
/* #undef HAVE_SYSCONF */
+/* Define if you have the waitpid function. */
+#define HAVE_WAITPID 1
+
/* Define if you have the <db.h> header file. */
/* #undef HAVE_DB_H */