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
David Barchiesi
OpenLDAP
Commits
6fe2750a
Commit
6fe2750a
authored
20 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
allow backwards compatibility for 'T' option (single char)
parent
582adc6c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/main.c
+22
-3
22 additions, 3 deletions
servers/slapd/main.c
with
22 additions
and
3 deletions
servers/slapd/main.c
+
22
−
3
View file @
6fe2750a
...
...
@@ -79,6 +79,12 @@ static struct {
{
"slappasswd"
,
slappasswd
},
{
"slaptest"
,
slaptest
},
{
"slapauth"
,
slapauth
},
/* NOTE: new tools must be added in chronological order,
* not in alphabetical order, because for backwards
* compatibility name[4] is used to identify the
* tools; so name[4]=='a' must refer to "slapadd" and
* not to "slapauth". Alphabetical order can be used
* for tools whose name[4] is not used yet */
{
NULL
,
NULL
}
};
...
...
@@ -199,6 +205,7 @@ int main( int argc, char **argv )
}
#endif
char
*
serverNamePrefix
=
""
;
size_t
l
;
sl_mem_init
();
...
...
@@ -390,12 +397,24 @@ int main( int argc, char **argv )
break
;
case
'T'
:
for
(
i
=
0
;
tools
[
i
].
name
;
i
++
)
{
/* try full option string first */
for
(
i
=
0
;
tools
[
i
].
name
;
i
++
)
{
if
(
strcmp
(
optarg
,
&
tools
[
i
].
name
[
4
]
)
==
0
)
{
rc
=
tools
[
i
].
func
(
argc
,
argv
);
MAIN_RETURN
(
rc
);
rc
=
tools
[
i
].
func
(
argc
,
argv
);
MAIN_RETURN
(
rc
);
}
}
/* try bits of option string (backward compatibility for single char) */
l
=
strlen
(
optarg
);
for
(
i
=
0
;
tools
[
i
].
name
;
i
++
)
{
if
(
strncmp
(
optarg
,
&
tools
[
i
].
name
[
4
],
l
)
==
0
)
{
rc
=
tools
[
i
].
func
(
argc
,
argv
);
MAIN_RETURN
(
rc
);
}
}
/* issue error */
serverName
=
optarg
;
serverNamePrefix
=
"slap"
;
unrecognized_server_name:
;
...
...
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