Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
62a5807b
Commit
62a5807b
authored
Oct 21, 1998
by
Kurt Zeilenga
Browse files
Use autoconf defines
parent
bed979f9
Changes
12
Hide whitespace changes
Inline
Side-by-side
clients/finger/main.c
View file @
62a5807b
...
...
@@ -170,11 +170,13 @@ static do_query()
exit
(
1
);
}
#ifdef
US
E_SYSCONF
#ifdef
HAV
E_SYSCONF
tblsize
=
sysconf
(
_SC_OPEN_MAX
);
#el
se
/* USE_SYSCONF */
#el
if HAVE_GETDTABLESIZE
tblsize
=
getdtablesize
();
#endif
/* USE_SYSCONF */
#else
tblsize
=
FD_SETSIZE
;
#endif
#ifdef FD_SETSIZE
if
(
tblsize
>
FD_SETSIZE
)
{
...
...
clients/gopher/detach.c
View file @
62a5807b
...
...
@@ -31,7 +31,7 @@ int debug;
#elif defined( HAVE_GETDTABLESIZE )
nbits
=
getdtablesize
();
#else
nbits
=
32
;
nbits
=
FD_SETSIZE
;
#endif
#ifdef FD_SETSIZE
...
...
@@ -73,14 +73,14 @@ int debug;
(
void
)
dup2
(
sd
,
2
);
close
(
sd
);
#ifdef
US
E_SETSID
#ifdef
HAV
E_SETSID
(
void
)
setsid
();
#else
/*
US
E_SETSID */
#else
/*
HAV
E_SETSID */
if
(
(
sd
=
open
(
"/dev/tty"
,
O_RDWR
))
!=
-
1
)
{
(
void
)
ioctl
(
sd
,
TIOCNOTTY
,
NULL
);
(
void
)
close
(
sd
);
}
#endif
/*
US
E_SETSID */
#endif
/*
HAV
E_SETSID */
}
(
void
)
signal
(
SIGPIPE
,
SIG_IGN
);
...
...
clients/gopher/go500.c
View file @
62a5807b
...
...
@@ -137,11 +137,13 @@ char **argv;
}
#endif
#ifdef
US
E_SYSCONF
#ifdef
HAV
E_SYSCONF
dtblsize
=
sysconf
(
_SC_OPEN_MAX
);
#el
se
/* USE_SYSCONF */
#el
if HAVE_GETDTABLESIZE
dtblsize
=
getdtablesize
();
#endif
/* USE_SYSCONF */
#else
dtblsize
=
FD_SETSIZE
;
#endif
#ifdef FD_SETSIZE
if
(
dtblsize
>
FD_SETSIZE
)
{
...
...
clients/gopher/go500gw.c
View file @
62a5807b
...
...
@@ -153,7 +153,7 @@ char **argv;
#elif HAVE_GETDTABLESIZE
dtblsize
=
getdtablesize
();
#else
dtblsize
=
32
;
dtblsize
=
FD_SETSIZE
;
#endif
#ifdef FD_SETSIZE
...
...
clients/rcpt500/query.c
View file @
62a5807b
...
...
@@ -80,11 +80,11 @@ query_cmd( msgp, reply )
/*
* open connection to LDAP server and bind as dapuser
*/
#ifdef
C
LDAP
#ifdef LDAP
_CONNECTIONLESS
if
(
do_cldap
)
ldp
=
cldap_open
(
ldaphost
,
ldapport
);
else
#endif
/*
C
LDAP */
#endif
/* LDAP
_CONNECTIONLESS
*/
ldp
=
ldap_open
(
ldaphost
,
ldapport
);
if
(
ldp
==
NULL
)
{
...
...
@@ -94,9 +94,9 @@ query_cmd( msgp, reply )
return
(
0
);
}
#ifdef
C
LDAP
#ifdef LDAP
_CONNECTIONLESS
if
(
!
do_cldap
)
#endif
/*
C
LDAP */
#endif
/* LDAP
_CONNECTIONLESS
*/
if
(
ldap_simple_bind_s
(
ldp
,
dapuser
,
NULL
)
!=
LDAP_SUCCESS
)
{
report_ldap_err
(
ldp
,
reply
);
close_ldap
(
ldp
);
...
...
@@ -113,11 +113,11 @@ query_cmd( msgp, reply )
matches
=
0
;
#ifdef RCPT500_UFN
#ifdef
C
LDAP
#ifdef LDAP
_CONNECTIONLESS
if
(
!
do_cldap
&&
strchr
(
msgp
->
msg_arg
,
','
)
!=
NULL
)
{
#else
/*
C
LDAP */
#else
/* LDAP
_CONNECTIONLESS
*/
if
(
strchr
(
msgp
->
msg_arg
,
','
)
!=
NULL
)
{
#endif
/*
C
LDAP */
#endif
/* LDAP
_CONNECTIONLESS
*/
struct
timeval
tv
;
ldap_ufn_setprefix
(
ldp
,
searchbase
);
...
...
@@ -136,12 +136,12 @@ query_cmd( msgp, reply )
for
(
lfi
=
ldap_getfirstfilter
(
lfdp
,
"rcpt500"
,
msgp
->
msg_arg
);
lfi
!=
NULL
;
lfi
=
ldap_getnextfilter
(
lfdp
))
{
#ifdef
C
LDAP
#ifdef LDAP
_CONNECTIONLESS
if
(
do_cldap
)
rc
=
cldap_search_s
(
ldp
,
searchbase
,
LDAP_SCOPE_SUBTREE
,
lfi
->
lfi_filter
,
attrs
,
0
,
&
ldmsgp
,
dapuser
);
else
#endif
/*
C
LDAP */
#endif
/* LDAP
_CONNECTIONLESS
*/
rc
=
ldap_search_s
(
ldp
,
searchbase
,
LDAP_SCOPE_SUBTREE
,
lfi
->
lfi_filter
,
attrs
,
0
,
&
ldmsgp
);
...
...
@@ -223,11 +223,11 @@ query_cmd( msgp, reply )
void
close_ldap
(
LDAP
*
ld
)
{
#ifdef
C
LDAP
#ifdef LDAP
_CONNECTIONLESS
if
(
do_cldap
)
cldap_close
(
ld
);
else
#endif
/*
C
LDAP */
#endif
/* LDAP
_CONNECTIONLESS
*/
ldap_unbind
(
ld
);
}
...
...
clients/tools/ldapsearch.c
View file @
62a5807b
...
...
@@ -50,7 +50,7 @@ char *s;
fprintf
(
stderr
,
" -z size lim
\t
size limit (in entries) for search
\n
"
);
fprintf
(
stderr
,
" -D binddn
\t
bind dn
\n
"
);
fprintf
(
stderr
,
" -w passwd
\t
bind passwd (for simple authentication)
\n
"
);
#ifdef KERBEROS
#ifdef
HAVE_
KERBEROS
fprintf
(
stderr
,
" -k
\t\t
use Kerberos instead of Simple Password authentication
\n
"
);
#endif
fprintf
(
stderr
,
" -h host
\t
ldap server
\n
"
);
...
...
@@ -111,7 +111,7 @@ char **argv;
scope
=
LDAP_SCOPE_SUBTREE
;
while
((
i
=
getopt
(
argc
,
argv
,
#ifdef KERBEROS
#ifdef
HAVE_
KERBEROS
"KknuvtRABLD:s:f:h:b:d:p:F:a:w:l:z:S:"
#else
"nuvtRABLD:s:f:h:b:d:p:F:a:w:l:z:S:"
...
...
@@ -131,7 +131,7 @@ char **argv;
fprintf
(
stderr
,
"compile with -DLDAP_DEBUG for debugging
\n
"
);
#endif
/* LDAP_DEBUG */
break
;
#ifdef KERBEROS
#ifdef
HAVE_
KERBEROS
case
'k'
:
/* use kerberos bind */
kerberos
=
2
;
break
;
...
...
clients/ud/auth.c
View file @
62a5807b
...
...
@@ -34,7 +34,7 @@ extern char *mygetpass(); /* getpass() passwds are too short */
extern
int
debug
;
/* debug flag */
#endif
#ifdef KERBEROS
#ifdef
HAVE_
KERBEROS
static
char
tktpath
[
20
];
/* ticket file path */
static
int
kinit
();
static
int
valid_tgt
();
...
...
clients/ud/globals.c
View file @
62a5807b
...
...
@@ -44,7 +44,7 @@ struct attribute attrlist[] = {
#ifdef UOFM
{
"multiLineDescription"
,
"Description"
,
change_field
,
ATTR_FLAG_PERSON
|
ATTR_FLAG_GROUP
|
ATTR_FLAG_READ
|
ATTR_FLAG_PERSON_MOD
|
ATTR_FLAG_GROUP_MOD
|
ATTR_FLAG_IS_MULTILINE
},
#endif
#ifdef KERBEROS
#ifdef
HAVE_
KERBEROS
{
"krbName"
,
"Kerberos name"
,
NULL
,
ATTR_FLAG_PERSON
|
ATTR_FLAG_READ
},
#endif
{
"description"
,
"Brief description"
,
NULL
,
ATTR_FLAG_PERSON
|
ATTR_FLAG_GROUP
|
ATTR_FLAG_READ
},
...
...
clients/ud/main.c
View file @
62a5807b
...
...
@@ -270,7 +270,7 @@ do_commands()
printf
(
" Thank you!
\n
"
);
ldap_unbind
(
ld
);
#ifdef KERBEROS
#ifdef
HAVE_
KERBEROS
destroy_tickets
();
#endif
exit
(
0
);
...
...
@@ -693,9 +693,9 @@ RETSIGTYPE attn()
fflush
(
stderr
);
fflush
(
stdout
);
printf
(
"
\n\n
INTERRUPTED!
\n
"
);
#if defined(DOS) || defined(SYSV)
(
void
)
signal
(
SIGINT
,
attn
);
#endif
longjmp
(
env
,
1
);
}
...
...
@@ -711,6 +711,7 @@ RETSIGTYPE chwinsz()
if
(
win
.
ws_col
!=
0
)
col_size
=
win
.
ws_col
;
}
(
void
)
signal
(
SIGWINCH
,
chwinsz
);
}
#endif
clients/ud/print.c
View file @
62a5807b
...
...
@@ -13,14 +13,14 @@
#include
"portable.h"
#include
<stdio.h>
#include
<string.h>
#include
<ctype.h>
#ifndef __STDC__
#include
<
memory
.h>
#
endif
#include
<time.h>
#include
<
ac/string
.h>
#
include
<ac/time.h>
#include
<lber.h>
#include
<ldap.h>
#include
"ud.h"
#ifdef DEBUG
...
...
@@ -597,9 +597,7 @@ time2text( char *ldtimestr, int dateonly )
/* gtime.c - inverse gmtime */
#if !defined( MACOS ) && !defined( _WIN32 ) && !defined( DOS )
#include
<sys/time.h>
#endif
/* !MACOS */
#include
<ac/time.h>
/* gtime(): the inverse of localtime().
This routine was supplied by Mike Accetta at CMU many years ago.
...
...
clients/ud/ud.h
View file @
62a5807b
...
...
@@ -10,14 +10,13 @@
* is provided ``as is'' without express or implied warranty.
*/
#include
"portable.h"
#ifdef DOS
#include
"protoud.h"
#define strncasecmp(a, b, n) strnicmp(a, b, n)
#define strcasecmp(a, b) stricmp(a, b)
#define MAX_VALUES 8
#else
#define MAX_VALUES 1000
#endif
/*
end of DOS ifdef
*/
#endif
/*
!DOS
*/
/*****************************************************************************
**
...
...
@@ -87,7 +86,7 @@
/*
* Authentication method we will be using.
*/
#ifdef KERBEROS
#ifdef
HAVE_
KERBEROS
#define UD_AUTH_METHOD LDAP_AUTH_KRBV4
#else
#define UD_AUTH_METHOD LDAP_AUTH_SIMPLE
...
...
@@ -136,6 +135,8 @@
#define ATTR_FLAG_IS_A_BOOL 0x4000
#define ATTR_FLAG_IS_MULTILINE 0x8000
LDAP_BEGIN_DECL
/*
* These are the structures we use when parsing an answer we get from the LDAP
* server.
...
...
@@ -156,3 +157,5 @@ struct entry {
char
*
name
;
struct
attribute
attrs
[
MAX_ATTRS
];
};
LDAP_END_DECL
clients/ud/util.c
View file @
62a5807b
...
...
@@ -217,7 +217,7 @@ char *s;
{
if
(
errno
!=
0
)
perror
(
s
);
#ifdef KERBEROS
#ifdef
HAVE_
KERBEROS
destroy_tickets
();
#endif
exit
(
-
1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment