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
Lukas However
OpenLDAP
Commits
dd83469d
Commit
dd83469d
authored
Aug 28, 2005
by
Howard Chu
Browse files
Sync with HEAD
parent
b849aae2
Changes
2
Hide whitespace changes
Inline
Side-by-side
servers/slapd/bconfig.c
View file @
dd83469d
...
...
@@ -1965,6 +1965,8 @@ str2loglevel( const char *s, int *l )
return
0
;
}
static
int
config_syslog
;
static
int
config_loglevel
(
ConfigArgs
*
c
)
{
int
i
;
...
...
@@ -1975,18 +1977,24 @@ config_loglevel(ConfigArgs *c) {
}
if
(
c
->
op
==
SLAP_CONFIG_EMIT
)
{
return
mask_to_verbs
(
loglevel_ops
,
ldap_syslog
,
&
c
->
rvalue_vals
);
/* Get default or commandline slapd setting */
if
(
ldap_syslog
&&
!
config_syslog
)
config_syslog
=
ldap_syslog
;
return
mask_to_verbs
(
loglevel_ops
,
config_syslog
,
&
c
->
rvalue_vals
);
}
else
if
(
c
->
op
==
LDAP_MOD_DELETE
)
{
if
(
!
c
->
line
)
{
ldap
_syslog
=
0
;
config
_syslog
=
0
;
}
else
{
int
level
=
verb_to_mask
(
c
->
line
,
loglevel_ops
);
ldap_syslog
^=
level
;
config_syslog
^=
level
;
}
if
(
slapMode
&
SLAP_SERVER_MODE
)
{
ldap_syslog
=
config_syslog
;
}
return
0
;
}
ldap
_syslog
=
0
;
config
_syslog
=
0
;
for
(
i
=
1
;
i
<
c
->
argc
;
i
++
)
{
int
level
;
...
...
@@ -2007,7 +2015,10 @@ config_loglevel(ConfigArgs *c) {
return
(
1
);
}
}
ldap_syslog
|=
level
;
config_syslog
|=
level
;
}
if
(
slapMode
&
SLAP_SERVER_MODE
)
{
ldap_syslog
=
config_syslog
;
}
return
(
0
);
}
...
...
@@ -2898,8 +2909,11 @@ check_vals( ConfigTable *ct, ConfigArgs *ca, void *ptr, int isAttr )
if
(
a
&&
(
ad
->
ad_type
->
sat_flags
&
SLAP_AT_ORDERED_VAL
))
{
sort
=
1
;
rc
=
ordered_value_sort
(
a
,
1
);
if
(
rc
)
if
(
rc
)
{
sprintf
(
ca
->
msg
,
"ordered_value_sort failed on attr %s
\n
"
,
ad
->
ad_cname
.
bv_val
);
return
rc
;
}
}
for
(
i
=
0
;
vals
[
i
].
bv_val
;
i
++
)
{
ca
->
line
=
vals
[
i
].
bv_val
;
...
...
@@ -3220,7 +3234,7 @@ config_add_internal( CfBackInfo *cfb, Entry *e, ConfigArgs *ca, SlapReply *rs, i
}
if
(
rc
!=
LDAP_SUCCESS
)
goto
leav
e
;
goto
don
e
;
/* Parse all the values and check for simple syntax errors before
* performing any set actions.
...
...
@@ -3240,7 +3254,7 @@ config_add_internal( CfBackInfo *cfb, Entry *e, ConfigArgs *ca, SlapReply *rs, i
*/
rc
=
check_name_index
(
last
,
colst
[
0
]
->
co_type
,
e
,
rs
,
renum
);
if
(
rc
)
goto
leav
e
;
goto
don
e
;
init_config_argv
(
ca
);
...
...
@@ -3252,7 +3266,7 @@ config_add_internal( CfBackInfo *cfb, Entry *e, ConfigArgs *ca, SlapReply *rs, i
ct
=
config_find_table
(
colst
,
nocs
,
a
->
a_desc
);
if
(
!
ct
)
continue
;
/* user data? */
rc
=
check_vals
(
ct
,
ca
,
a
,
1
);
if
(
rc
)
goto
leav
e
;
if
(
rc
)
goto
don
e
;
}
/* Basic syntax checks are OK. Do the actual settings. */
...
...
@@ -3270,7 +3284,7 @@ config_add_internal( CfBackInfo *cfb, Entry *e, ConfigArgs *ca, SlapReply *rs, i
rc
=
config_parse_add
(
ct
,
ca
);
if
(
rc
)
{
rc
=
LDAP_OTHER
;
goto
leav
e
;
goto
don
e
;
}
}
}
...
...
@@ -3293,7 +3307,7 @@ ok:
Debug
(
LDAP_DEBUG_ANY
,
"%s: %s (%s)!
\n
"
,
ca
->
log
,
ca
->
msg
,
ca
->
argv
[
1
]
);
rc
=
LDAP_OTHER
;
goto
leav
e
;
goto
don
e
;
}
}
...
...
@@ -3317,7 +3331,7 @@ ok:
last
->
ce_kids
=
ce
;
}
leav
e:
don
e:
if
(
rc
)
{
if
(
(
colst
[
0
]
->
co_type
==
Cft_Database
)
&&
ca
->
be
)
{
if
(
ca
->
be
!=
frontendDB
)
...
...
servers/slapd/value.c
View file @
dd83469d
...
...
@@ -322,7 +322,7 @@ ordered_value_sort( Attribute *a, int do_renumber )
char
*
ptr
;
index
=
1
;
ptr
=
strchr
(
a
->
a_vals
[
i
].
bv_val
,
'}'
);
if
(
!
ptr
||
!
ptr
[
1
]
)
if
(
!
ptr
)
return
LDAP_INVALID_SYNTAX
;
if
(
noindex
)
return
LDAP_INVALID_SYNTAX
;
...
...
@@ -361,8 +361,14 @@ ordered_value_sort( Attribute *a, int do_renumber )
#endif
indexes
=
ch_malloc
(
vals
*
sizeof
(
int
)
);
for
(
i
=
0
;
i
<
vals
;
i
++
)
indexes
[
i
]
=
strtol
(
a
->
a_vals
[
i
].
bv_val
+
1
,
NULL
,
0
);
for
(
i
=
0
;
i
<
vals
;
i
++
)
{
char
*
ptr
;
indexes
[
i
]
=
strtol
(
a
->
a_vals
[
i
].
bv_val
+
1
,
&
ptr
,
0
);
if
(
*
ptr
!=
'}'
)
{
ch_free
(
indexes
);
return
LDAP_INVALID_SYNTAX
;
}
}
/* Insertion sort */
for
(
i
=
1
;
i
<
vals
;
i
++
)
{
...
...
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