Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nadezhda Ivanova
OpenLDAP
Commits
555e23dd
Commit
555e23dd
authored
26 years ago
by
Hallvard Furuseth
Browse files
Options
Downloads
Patches
Plain Diff
Add readline support. Change prompt to "saucer dn=CURRENT-DN> ".
parent
973c830d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/saucer/Makefile.in
+3
-1
3 additions, 1 deletion
contrib/saucer/Makefile.in
contrib/saucer/main.c
+39
-4
39 additions, 4 deletions
contrib/saucer/main.c
with
42 additions
and
5 deletions
contrib/saucer/Makefile.in
+
3
−
1
View file @
555e23dd
...
...
@@ -6,8 +6,10 @@ OBJS= main.o
LDAP_INCDIR
=
../../include
LDAP_LIBDIR
=
../../libraries
READLINE_LIBS
=
@READLINE_LIBS@
XLIBS
=
-lldap
-llber
-llutil
XXLIBS
=
$(
KRB_LIBS
)
$(
LUTIL_LIBS
)
XXLIBS
=
$(
KRB_LIBS
)
$(
LUTIL_LIBS
)
$(
READLINE_LIBS
)
$(
TERMCAP_LIBS
)
saucer
:
${OBJS} $(LDAP_LIBDEPEND)
$(
LTLINK
)
-o
$@
$(
OBJS
)
$(
LIBS
)
...
...
This diff is collapsed.
Click to expand it.
contrib/saucer/main.c
+
39
−
4
View file @
555e23dd
...
...
@@ -13,6 +13,8 @@
* 'saucer' LDAP command-line client source code.
*
* Author: Eric Rosenquist, 1994.
*
* 07-Mar-1999 readline support added: O. Steffensen (oddbjorn@tricknology.org)
*/
#include
"portable.h"
...
...
@@ -20,6 +22,13 @@
#include
<stdio.h>
#include
<stdlib.h>
#ifdef HAVE_READLINE
# include <readline/readline.h>
# ifdef HAVE_READLINE_HISTORY_H
# include <readline/history.h>
# endif
#endif
#include
<ac/ctype.h>
#include
<ac/string.h>
#include
<ac/unistd.h>
...
...
@@ -528,13 +537,39 @@ void do_commands(FILE *file)
{
char
cmd_buf
[
BUFSIZ
];
int
tty
=
isatty
(
fileno
(
file
));
char
*
buf
=
cmd_buf
;
int
status
;
for
(;;)
{
if
(
tty
)
printf
(
"Cmd? "
);
if
(
!
fgets
(
cmd_buf
,
sizeof
(
cmd_buf
),
file
))
break
;
if
(
do_command
(
cmd_buf
))
{
char
prompt
[
40
];
sprintf
(
prompt
,
(
strlen
(
default_dn
)
<
18
?
"saucer dn=%s> "
:
"saucer dn=%.15s..> "
),
default_dn
);
#ifndef HAVE_READLINE
fputs
(
prompt
,
stdout
);
#else
buf
=
readline
(
prompt
);
if
(
!
buf
)
break
;
add_history
(
buf
);
#endif
}
#ifdef HAVE_READLINE
else
#endif
{
if
(
!
fgets
(
cmd_buf
,
sizeof
(
cmd_buf
),
file
))
break
;
}
status
=
do_command
(
buf
);
#ifdef HAVE_READLINE
if
(
tty
)
free
(
buf
);
#endif
if
(
status
)
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment