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
757bf08b
Commit
757bf08b
authored
Nov 22, 2015
by
Ondřej Kuzník
Committed by
Quanah Gibson-Mount
Apr 06, 2017
Browse files
ITS#8266 Allow empty mods
parent
1a0f83be
Changes
2
Hide whitespace changes
Inline
Side-by-side
servers/slapd/overlays/unique.c
View file @
757bf08b
...
...
@@ -1170,6 +1170,11 @@ unique_modify(
Debug
(
LDAP_DEBUG_TRACE
,
"==> unique_modify <%s>
\n
"
,
op
->
o_req_dn
.
bv_val
,
0
,
0
);
if
(
!
op
->
orm_modlist
)
{
Debug
(
LDAP_DEBUG_TRACE
,
"unique_modify: got empty modify op
\n
"
,
0
,
0
,
0
);
return
rc
;
}
/* skip the checks if the operation has manageDsaIt control in it
* (for replication) */
if
(
op
->
o_managedsait
>
SLAP_CONTROL_IGNORED
...
...
@@ -1203,22 +1208,14 @@ unique_modify(
&&
!
dnIsSuffix
(
&
op
->
o_req_ndn
,
&
uri
->
ndn
))
continue
;
if
(
!
(
m
=
op
->
orm_modlist
)
)
{
op
->
o_bd
->
bd_info
=
(
BackendInfo
*
)
on
->
on_info
;
send_ldap_error
(
op
,
rs
,
LDAP_INVALID_SYNTAX
,
"unique_modify() got null op.orm_modlist"
);
rc
=
rs
->
sr_err
;
break
;
}
else
for
(
;
m
;
m
=
m
->
sml_next
)
if
(
(
m
->
sml_op
&
LDAP_MOD_OP
)
!=
LDAP_MOD_DELETE
)
ks
+=
count_filter_len
(
domain
,
uri
,
m
->
sml_desc
,
m
->
sml_values
);
for
(
m
=
op
->
orm_modlist
;
m
;
m
=
m
->
sml_next
)
if
(
(
m
->
sml_op
&
LDAP_MOD_OP
)
!=
LDAP_MOD_DELETE
)
ks
+=
count_filter_len
(
domain
,
uri
,
m
->
sml_desc
,
m
->
sml_values
);
/* skip this domain-uri if it isn't involved */
if
(
!
ks
)
continue
;
...
...
tests/scripts/test024-unique
View file @
757bf08b
...
...
@@ -555,6 +555,21 @@ if test $RC != 0 ; then
exit
-1
fi
echo
"Sending an empty modification"
$LDAPMODIFY
-D
"
$UNIQUEDN
"
-h
$LOCALHOST
-p
$PORT1
-w
$PASSWD
>
\
$TESTOUT
2>&1
<<
EOF
dn: uid=empty,ou=users,o=unique
changetype: modify
EOF
RC
=
$?
if
test
$RC
!=
0
;
then
echo
"spurious unique error (
$RC
)!"
test
$KILLSERVERS
!=
no
&&
kill
-HUP
$KILLPIDS
exit
-1
fi
echo
"Making a record non-unique"
$LDAPMODIFY
-D
"uid=dave,ou=users,o=unique"
-h
$LOCALHOST
-p
$PORT1
-w
$PASSWD
>
\
$TESTOUT
2>&1
<<
EOF
...
...
Write
Preview
Markdown
is supported
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