clients build under FreeBSD

This commit is contained in:
Kurt Zeilenga 1998-10-20 23:31:56 +00:00
parent 4bce7aa748
commit 727f6aa131
33 changed files with 382 additions and 301 deletions

View file

@ -19,15 +19,13 @@
* 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 <ac/string.h>
#define TPCDOMAIN "tpc.int"

View file

@ -10,24 +10,27 @@
* 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
@ -308,7 +311,7 @@ connect_to_x500()
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 );
}
@ -921,14 +924,14 @@ send_message( to )
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 );
@ -953,7 +956,7 @@ send_group( group, ngroup )
char **argv;
int argc;
char *iargv[7];
#ifndef USE_WAITPID
#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
@ -976,7 +979,7 @@ send_group( group, ngroup )
/* parent */
if ( pid = fork() ) {
#ifdef USE_WAITPID
#ifdef HAVE_WAITPID
waitpid( pid, (int *) NULL, 0 );
#else
wait4( pid, &status, WAIT_FLAGS, 0 );

View file

@ -10,28 +10,30 @@
* 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;
@ -114,7 +116,7 @@ main (argc, argv)
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 );

View file

@ -10,31 +10,27 @@
* is provided ``as is'' without express or implied warranty.
*/
#include "portable.h"
#include <stdio.h>
#include <ctype.h>
#include <signal.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 <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 "ldapconfig.h"
#ifdef USE_SYSCONF
#include <unistd.h>
#endif /* USE_SYSCONF */
int dosyslog = 1;
char *ldaphost = LDAPHOST;
@ -166,7 +162,9 @@ static do_query()
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 );
@ -178,6 +176,12 @@ static do_query()
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 );

View file

@ -10,28 +10,35 @@
* 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++ ) {

View file

@ -10,33 +10,30 @@
* is provided ``as is'' without express or implied warranty.
*/
#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>
#ifdef aix
#include <sys/select.h>
#endif /* aix */
#include <signal.h>
#include "portable.h"
#include <stdio.h>
#include <ctype.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>
#endif
#include <sys/resource.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;
@ -52,7 +49,7 @@ char myhost[MAXHOSTNAMELEN];
int myport;
static set_socket();
static SIG_FN wait4child();
static RETSIGTYPE wait4child();
static do_queries();
static do_error();
static do_search();
@ -78,7 +75,7 @@ char **argv;
struct hostent *hp;
struct sockaddr_in from;
int fromlen;
SIG_FN wait4child();
RETSIGTYPE wait4child();
extern char *optarg;
extern char **Argv;
extern int Argc;
@ -146,6 +143,13 @@ char **argv;
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 );
@ -292,18 +296,22 @@ int port;
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 );
}
@ -372,7 +380,7 @@ int s;
}
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",

View file

@ -10,32 +10,30 @@
* is provided ``as is'' without express or implied warranty.
*/
#include "portable.h"
#include <stdio.h>
#include <ctype.h>
#include <signal.h>
#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 <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 "ldapconfig.h"
int debug;
int dosyslog;
@ -52,7 +50,7 @@ char *friendlyfile = FRIENDLYFILE;
int rdncount = GO500GW_RDNCOUNT;
static set_socket();
static SIG_FN wait4child();
static RETSIGTYPE wait4child();
static do_queries();
static do_menu();
static do_list();
@ -85,7 +83,7 @@ char **argv;
struct hostent *hp;
struct sockaddr_in from;
int fromlen;
SIG_FN wait4child();
RETSIGTYPE wait4child();
extern char *optarg;
extern char **Argv;
extern int Argc;
@ -150,11 +148,21 @@ char **argv;
}
}
#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 );
@ -314,18 +322,22 @@ int port;
return( s );
}
static SIG_FN
static RETSIGTYPE
wait4child()
{
WAITSTATUSTYPE status;
#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
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 */
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 );
}

View file

@ -10,6 +10,8 @@
* is provided ``as is'' without express or implied warranty.
*/
#include "portable.h"
char **Argv; /* pointer to original (main's) argv */
int Argc; /* original argc */

View file

@ -10,19 +10,24 @@
* is provided ``as is'' without express or implied warranty.
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <memory.h>
#include <sys/types.h>
#include <sys/time.h>
#include <syslog.h>
#include <sys/param.h>
#include <sys/resource.h>
#include <sys/wait.h>
#include <sysexits.h>
#include "portable.h"
#include <stdio.h>
#include <ctype.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 <sysexits.h>
#include "lber.h"
#include "ldap.h"
#include "ldapconfig.h"
@ -1029,7 +1034,7 @@ send_message( to )
char **to;
{
int pid;
#ifndef USE_WAITPID
#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
@ -1048,7 +1053,7 @@ send_message( to )
/* parent */
if ( pid = fork() ) {
#ifdef USE_WAITPID
#ifdef HAVE_WAITPID
waitpid( pid, (int *) NULL, 0 );
#else
wait4( pid, &status, WAIT_FLAGS, 0 );
@ -1073,7 +1078,7 @@ send_group( group, ngroup )
char **argv;
int argc;
char *iargv[7];
#ifndef USE_WAITPID
#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
@ -1108,7 +1113,7 @@ send_group( group, ngroup )
/* parent */
if ( pid = fork() ) {
#ifdef USE_WAITPID
#ifdef HAVE_WAITPID
waitpid( pid, (int *) NULL, 0 );
#else
wait4( pid, &status, WAIT_FLAGS, 0 );
@ -1136,7 +1141,7 @@ send_errors( err, nerr )
int fd[2];
char *argv[8];
char buf[1024];
#ifndef USE_WAITPID
#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
@ -1255,7 +1260,7 @@ send_errors( err, nerr )
}
fclose( fp );
#ifdef USE_WAITPID
#ifdef HAVE_WAITPID
waitpid( pid, (int *) NULL, 0 );
#else
wait4( pid, &status, WAIT_FLAGS, 0 );

View file

@ -6,7 +6,9 @@
* All Rights Reserved
*/
#include <stdio.h>
#include "portable.h"
#include <stdlib.h>
#include "rcpt500.h"
struct command cmds[] = {

View file

@ -6,12 +6,17 @@
* All Rights Reserved
*/
#include <stdio.h>
#include <syslog.h>
#include <string.h>
#include <fcntl.h>
#include "portable.h"
#include <stdio.h>
#include <ac/syslog.h>
#include <ac/string.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#include "ldapconfig.h"
#include "rcpt500.h"

View file

@ -6,24 +6,24 @@
* 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;
@ -78,11 +78,12 @@ main( argc, argv )
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;

View file

@ -6,18 +6,21 @@
* 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;

View file

@ -6,6 +6,10 @@
* All Rights Reserved
*/
#include <ldap_cdefs.h>
LDAP_BEGIN_DECL
struct msginfo {
char *msg_subject;
char *msg_replyto; /* actually could be from From: line */
@ -16,8 +20,8 @@ struct msginfo {
};
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 */
};
@ -27,10 +31,12 @@ struct command {
/*
* 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

View file

@ -8,7 +8,6 @@
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
#include <lber.h>
#include <ldap.h>

View file

@ -10,18 +10,21 @@
* 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 */
@ -48,7 +51,7 @@ int implicit;
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];
@ -130,7 +133,7 @@ int implicit;
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
@ -155,7 +158,7 @@ int implicit;
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
@ -221,7 +224,7 @@ int implicit;
} 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');
@ -229,7 +232,7 @@ int implicit;
(void) ldap_value_free(rdns);
return(0);
}
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
}
(void) ldap_value_free(krbnames);
#endif
@ -239,19 +242,19 @@ int implicit;
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
@ -274,12 +277,12 @@ int implicit;
return(0);
}
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
#define FIVEMINS ( 5 * 60 )
#define TGT "krbtgt"
str2upper( s )
static void str2upper( s )
char *s;
{
char *p;
@ -307,12 +310,12 @@ static valid_tgt( names )
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
@ -351,7 +354,7 @@ krbgetpass( user, inst, realm, pw, key )
return(-1);
}
#ifdef AFSKERBEROS
#ifdef HAVE_AFS_KERBEROS
strcpy( lcrealm, realm );
for ( p = lcrealm; *p != '\0'; ++p ) {
if ( isupper( *p )) {
@ -360,9 +363,9 @@ krbgetpass( user, inst, realm, pw, key )
}
ka_StringToKey( passwd, lcrealm, key );
#else /* AFSKERBEROS */
#else /* HAVE_AFS_KERBEROS */
string_to_key( passwd, key );
#endif /* AFSKERBEROS */
#endif /* HAVE_AFS_KERBEROS */
return( 0 );
}
@ -382,12 +385,12 @@ static kinit( kname )
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 );
@ -407,7 +410,7 @@ static kinit( kname )
return( 0 );
}
destroy_tickets()
void destroy_tickets(void)
{
if ( *tktpath != '\0' ) {
unlink( tktpath );
@ -415,13 +418,12 @@ destroy_tickets()
}
#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);
}

View file

@ -10,14 +10,18 @@
* 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>

View file

@ -10,14 +10,17 @@
* 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 */
@ -224,7 +227,7 @@ int quiet;
} 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);

View file

@ -10,6 +10,8 @@
* is provided ``as is'' without express or implied warranty.
*/
#include "portable.h"
#include <stdio.h>
#include "ud.h"

View file

@ -11,10 +11,15 @@
*
*/
#include "portable.h"
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <lber.h>
#include <ldap.h>
#include <ldapconfig.h>
#include "ud.h"
@ -175,7 +180,7 @@ char *name;
#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");
@ -225,7 +230,7 @@ char *name;
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)
@ -452,7 +457,7 @@ char *group;
}
/*
* Add the X.500 style names.
* Add the LDAP style names.
*/
if (count_x500 > 0) {
mods[0] = &mod;
@ -562,7 +567,7 @@ char *group;
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++) {
@ -805,7 +810,7 @@ int offset;
}
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");
}

View file

@ -10,11 +10,17 @@
* 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
@ -88,7 +94,7 @@ char *s;
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);
@ -111,7 +117,7 @@ char *s;
}
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");
@ -125,7 +131,7 @@ char *s;
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");
@ -145,7 +151,7 @@ char *s;
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");
@ -182,7 +188,7 @@ char *s;
}
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);

View file

@ -16,34 +16,26 @@
* 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
@ -68,8 +60,8 @@ static int dereference = TRUE;
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 */
@ -374,7 +366,7 @@ char **base, *s;
}
/*
* 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.
@ -540,7 +532,7 @@ initialize_client()
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();
@ -627,13 +619,13 @@ initialize_client()
* 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);
@ -667,10 +659,10 @@ initialize_client()
(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;
@ -696,7 +688,7 @@ initialize_client()
#endif
}
SIG_FN attn()
RETSIGTYPE attn()
{
fflush(stderr);
fflush(stdout);
@ -707,8 +699,8 @@ SIG_FN attn()
longjmp(env, 1);
}
#if !defined(DOS) && !defined(NOTERMCAP)
SIG_FN chwinsz()
#ifndef NO_TERMCAP
RETSIGTYPE chwinsz()
{
struct winsize win;

View file

@ -10,15 +10,19 @@
* 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;
@ -109,7 +113,7 @@ char *who;
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");
@ -481,7 +485,7 @@ mail_is_good:
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);
@ -620,9 +624,9 @@ char *who;
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");
}

View file

@ -10,6 +10,8 @@
* is provided ``as is'' without express or implied warranty.
*/
#include "portable.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>

View file

@ -1,3 +1,5 @@
#include "portable.h"
#if defined(KERBEROS) && !defined(openbsd)
/*
* $Source: /repo/OpenLDAP/pkg/ldap/clients/ud/string_to_key.c,v $

View file

@ -10,45 +10,25 @@
* 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
@ -81,7 +61,7 @@ char *prompt;
register char *p;
register int c;
FILE *fi;
SIG_FN (*sig)();
RETSIGTYPE (*sig)();
#ifdef DEBUG
if (debug & D_TRACE)

25
configure vendored
View file

@ -5922,15 +5922,16 @@ for ac_func in \
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. */
@ -5953,7 +5954,7 @@ $ac_func();
; 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
@ -5981,12 +5982,12 @@ done
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. */
@ -6009,7 +6010,7 @@ $ac_func();
; 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
@ -6039,13 +6040,13 @@ done
# 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>
@ -6055,7 +6056,7 @@ int main() {
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
@ -6076,20 +6077,20 @@ if test $ol_cv_dcl_sys_errlist = no ; then
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

View file

@ -755,6 +755,7 @@ AC_CHECK_FUNCS( \
strtol \
strtoul \
sysconf \
waitpid \
)
AC_REPLACE_FUNCS(getopt strdup)

View file

@ -12,6 +12,10 @@
#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>

View file

@ -16,4 +16,10 @@
# 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 */

View file

@ -501,6 +501,10 @@ typedef struct ldap_url_desc {
#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:
*/

View file

@ -306,6 +306,9 @@ is provided ``as is'' without express or implied warranty.
/* 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

View file

@ -319,6 +319,9 @@ typedef char * caddr_t;
/* 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 */