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
dd53a839
Commit
dd53a839
authored
25 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Wrap prints of DN and other strings in double quotes so user can easily
determine if string contains leading/trailing whitespace.
parent
638f3774
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
clients/tools/ldapmodify.c
+16
-15
16 additions, 15 deletions
clients/tools/ldapmodify.c
clients/tools/ldapmodrdn.c
+7
-8
7 additions, 8 deletions
clients/tools/ldapmodrdn.c
clients/tools/ldappasswd.c
+6
-7
6 additions, 7 deletions
clients/tools/ldappasswd.c
with
29 additions
and
30 deletions
clients/tools/ldapmodify.c
+
16
−
15
View file @
dd53a839
...
...
@@ -258,7 +258,7 @@ main( int argc, char **argv )
if
(
version
!=
-
1
&&
ldap_set_option
(
ld
,
LDAP_OPT_PROTOCOL_VERSION
,
&
version
)
!=
LDAP_OPT_SUCCESS
)
{
fprintf
(
stderr
,
"Could not set LDAP_OPT_PROTOCOL_VERSION %d
\n
"
,
version
);
fprintf
(
stderr
,
"Could not set LDAP_OPT_PROTOCOL_VERSION
to
%d
\n
"
,
version
);
}
if
(
ldap_bind_s
(
ld
,
binddn
,
passwd
,
authmethod
)
!=
LDAP_SUCCESS
)
{
...
...
@@ -415,7 +415,8 @@ process_ldif_rec( char *rbuf, int count )
if
(
expect_ct
)
{
expect_ct
=
0
;
if
(
!
use_record
&&
saw_replica
)
{
printf
(
"%s: skipping change record for entry: %s
\n\t
(LDAP host/port does not match replica: lines)
\n
"
,
printf
(
"%s: skipping change record for entry: %s
\n
"
"
\t
(LDAP host/port does not match replica: lines)
\n
"
,
prog
,
dn
);
free
(
dn
);
return
(
0
);
...
...
@@ -436,7 +437,7 @@ process_ldif_rec( char *rbuf, int count )
got_all
=
delete_entry
=
1
;
}
else
{
fprintf
(
stderr
,
"%s: unknown %s
\"
%s
\"
(line %d of entry
: %s
)
\n
"
,
"%s: unknown %s
\"
%s
\"
(line %d of entry
\"
%s
\"
)
\n
"
,
prog
,
T_CHANGETYPESTR
,
value
,
linenum
,
dn
);
rc
=
LDAP_PARAM_ERROR
;
}
...
...
@@ -476,7 +477,7 @@ process_ldif_rec( char *rbuf, int count )
expect_deleteoldrdn
=
1
;
expect_newrdn
=
0
;
}
else
{
fprintf
(
stderr
,
"%s: expecting
\"
%s:
\"
but saw
\"
%s:
\"
(line %d of entry
%s
)
\n
"
,
fprintf
(
stderr
,
"%s: expecting
\"
%s:
\"
but saw
\"
%s:
\"
(line %d of entry
\"
%s
\"
)
\n
"
,
prog
,
T_NEWRDNSTR
,
type
,
linenum
,
dn
);
rc
=
LDAP_PARAM_ERROR
;
}
...
...
@@ -487,7 +488,7 @@ process_ldif_rec( char *rbuf, int count )
expect_newsup
=
1
;
got_all
=
1
;
}
else
{
fprintf
(
stderr
,
"%s: expecting
\"
%s:
\"
but saw
\"
%s:
\"
(line %d of entry
%s
)
\n
"
,
fprintf
(
stderr
,
"%s: expecting
\"
%s:
\"
but saw
\"
%s:
\"
(line %d of entry
\"
%s
\"
)
\n
"
,
prog
,
T_DELETEOLDRDNSTR
,
type
,
linenum
,
dn
);
rc
=
LDAP_PARAM_ERROR
;
}
...
...
@@ -499,13 +500,13 @@ process_ldif_rec( char *rbuf, int count )
}
expect_newsup
=
0
;
}
else
{
fprintf
(
stderr
,
"%s: expecting
\"
%s:
\"
but saw
\"
%s:
\"
(line %d of entry
%s
)
\n
"
,
fprintf
(
stderr
,
"%s: expecting
\"
%s:
\"
but saw
\"
%s:
\"
(line %d of entry
\"
%s
\"
)
\n
"
,
prog
,
T_NEWSUPSTR
,
type
,
linenum
,
dn
);
rc
=
LDAP_PARAM_ERROR
;
}
}
else
if
(
got_all
)
{
fprintf
(
stderr
,
"%s: extra lines at end (line %d of entry
%s
)
\n
"
,
"%s: extra lines at end (line %d of entry
\"
%s
\"
)
\n
"
,
prog
,
linenum
,
dn
);
rc
=
LDAP_PARAM_ERROR
;
}
else
{
...
...
@@ -614,7 +615,7 @@ process_ldapmod_rec( char *rbuf )
}
if
(
value
==
NULL
&&
new
)
{
fprintf
(
stderr
,
"%s: missing value on line %d (attr
is %s
)
\n
"
,
fprintf
(
stderr
,
"%s: missing value on line %d (attr
=
\"
%s
\"
)
\n
"
,
prog
,
linenum
,
attr
);
rc
=
LDAP_PARAM_ERROR
;
}
else
{
...
...
@@ -743,7 +744,7 @@ domodify( char *dn, LDAPMod **pmods, int newentry )
struct
berval
*
bvp
;
if
(
pmods
==
NULL
)
{
fprintf
(
stderr
,
"%s: no attributes to change or add (entry
%s
)
\n
"
,
fprintf
(
stderr
,
"%s: no attributes to change or add (entry
=
\"
%s
\"
)
\n
"
,
prog
,
dn
);
return
(
LDAP_PARAM_ERROR
);
}
...
...
@@ -775,9 +776,9 @@ domodify( char *dn, LDAPMod **pmods, int newentry )
}
if
(
newentry
)
{
printf
(
"%sadding new entry
%s
\n
"
,
not
?
"!"
:
""
,
dn
);
printf
(
"%sadding new entry
\"
%s
\"
\n
"
,
not
?
"!"
:
""
,
dn
);
}
else
{
printf
(
"%smodifying entry
%s
\n
"
,
not
?
"!"
:
""
,
dn
);
printf
(
"%smodifying entry
\"
%s
\"
\n
"
,
not
?
"!"
:
""
,
dn
);
}
if
(
!
not
)
{
...
...
@@ -806,7 +807,7 @@ dodelete( char *dn )
{
int
rc
;
printf
(
"%sdeleting entry
%s
\n
"
,
not
?
"!"
:
""
,
dn
);
printf
(
"%sdeleting entry
\"
%s
\"
\n
"
,
not
?
"!"
:
""
,
dn
);
if
(
!
not
)
{
if
((
rc
=
ldap_delete_s
(
ld
,
dn
))
!=
LDAP_SUCCESS
)
{
ldap_perror
(
ld
,
"ldap_delete"
);
...
...
@@ -828,12 +829,12 @@ domodrdn( char *dn, char *newrdn, int deleteoldrdn )
{
int
rc
;
printf
(
"%smodifying rdn of entry
\"
%s
\"\n
"
,
not
?
"!"
:
""
,
dn
);
if
(
verbose
)
{
printf
(
"new RDN:
%s
(%skeep existing values)
\n
"
,
printf
(
"
\t
new RDN:
\"
%s
\"
(%skeep existing values)
\n
"
,
newrdn
,
deleteoldrdn
?
"do not "
:
""
);
}
printf
(
"%smodifying rdn of entry %s
\n
"
,
not
?
"!"
:
""
,
dn
);
if
(
!
not
)
{
if
((
rc
=
ldap_modrdn2_s
(
ld
,
dn
,
newrdn
,
deleteoldrdn
))
!=
LDAP_SUCCESS
)
{
...
...
This diff is collapsed.
Click to expand it.
clients/tools/ldapmodrdn.c
+
7
−
8
View file @
dd53a839
...
...
@@ -287,14 +287,13 @@ static int domodrdn(
int
i
;
if
(
verbose
)
{
printf
(
"modrdn %s:
\n\t
%s
\n
"
,
dn
,
rdn
);
if
(
remove
)
printf
(
"removing old RDN
\n
"
);
else
printf
(
"keeping old RDN
\n
"
);
if
(
newSuperior
!=
NULL
)
printf
(
"placing node under a new parent = %s
\n
"
,
newSuperior
);
}
printf
(
"Renaming
\"
%s
\"\n
"
,
dn
);
printf
(
"
\t
new rdn=
\"
%s
\"
(%s old rdn)
\n
"
,
rdn
,
remove
?
"delete"
:
"keep"
);
if
(
newSuperior
!=
NULL
)
{
printf
(
"
\t
new parent=
\"
%s
\"\n
"
,
newSuperior
);
}
}
if
(
!
not
)
{
i
=
ldap_rename2_s
(
ld
,
dn
,
rdn
,
remove
,
newSuperior
);
...
...
This diff is collapsed.
Click to expand it.
clients/tools/ldappasswd.c
+
6
−
7
View file @
dd53a839
...
...
@@ -329,7 +329,7 @@ void
usage
(
char
*
s
)
{
fprintf
(
stderr
,
"Usage: %s [options] [filter]
\n
"
,
s
);
fprintf
(
stderr
,
" -a attrib
\t
password attribute (default:
%s)
\n
"
,
LDAP_PASSWD_ATTRIB
);
fprintf
(
stderr
,
" -a attrib
\t
password attribute (default:
"
LDAP_PASSWD_ATTRIB
")
\n
"
);
fprintf
(
stderr
,
" -b basedn
\t
basedn to perform searches
\n
"
);
/* fprintf (stderr, " -C\t\tuse entry's current hash mechanism\n"); */
fprintf
(
stderr
,
" -D binddn
\t
bind dn
\n
"
);
...
...
@@ -587,12 +587,12 @@ main (int argc, char *argv[])
#ifdef HAVE_GETTIMEOFDAY
/* this is of questionable value
* gettimeofday not provide much usec
* gettimeofday
may
not provide much usec
*/
{
struct
timeval
tv
;
gettimeofday
(
&
tv
,
NULL
);
srand
(
tv
.
tv_usec
);
srand
(
tv
.
sec
*
(
tv
.
tv_usec
+
1
)
);
}
#else
/* The traditional seed */
...
...
@@ -651,10 +651,9 @@ main (int argc, char *argv[])
{
char
filter
[
BUFSIZ
];
LDAPMessage
*
result
=
NULL
,
*
e
;
char
*
attrs
[
3
];
attrs
[
0
]
=
"dn"
;
attrs
[
1
]
=
pwattr
;
attrs
[
2
]
=
NULL
;
char
*
attrs
[
2
];
attrs
[
0
]
=
pwattr
;
attrs
[
1
]
=
NULL
;
/* search */
sprintf
(
filter
,
"%s"
,
filtpattern
);
...
...
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