Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ingo Voss
OpenLDAP
Commits
6a0cec46
Commit
6a0cec46
authored
Aug 12, 2005
by
Kurt Zeilenga
Browse files
Sync with HEAD
rebuild configure
parent
708306c8
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
aclocal.m4
View file @
6a0cec46
...
...
@@ -10,6 +10,10 @@ dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
dnl OpenLDAP Autoconf Macros
dnl $OpenLDAP$
dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
dnl
dnl Copyright 1998-2005 The OpenLDAP Foundation.
dnl All rights reserved.
dnl
...
...
@@ -766,9 +770,7 @@ else
;;
*)
AC_CHECK_FUNC([dllload],
[lt_cv_dlopen="dllload"],
[AC_CHECK_FUNC([shl_load],
AC_CHECK_FUNC([shl_load],
[lt_cv_dlopen="shl_load"],
[AC_CHECK_LIB([dld], [shl_load],
[lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
...
...
@@ -785,7 +787,6 @@ else
])
])
])
])
;;
esac
...
...
@@ -1043,10 +1044,6 @@ AC_CACHE_VAL(lt_cv_prog_cc_pic,
lt_cv_prog_cc_pic='-KPIC'
lt_cv_prog_cc_static='-Bstatic'
;;
openedition)
# XPLINK code is PIC by default
;;
osf3* | osf4* | osf5*)
# All OSF/1 code is PIC.
...
...
@@ -1787,12 +1784,6 @@ else
fi
;;
openedition*)
archive_cmds="\$CC -Wl,DLL \$libobjs \$deplibs \$compiler_flags -o \$lib &&
cp \$linknames \$output_objdir && linknames=''"
export_dynamic_flag_spec="-Wl,DLL"
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
...
...
@@ -2330,17 +2321,6 @@ openbsd*)
shlibpath_var=LD_LIBRARY_PATH
;;
openedition*)
need_lib_prefix=no
need_version=no
shlibpath_overrides_runpath=yes
shlibpath_var=LIBPATH
postinstall_cmds="rm \$destdir/\$linkname; cp \$linkname \$destdir; chmod a+x \$lib"
# the library's exports are in libname.x; this is the file that must
# actually be linked with to use a DLL.
library_names_spec="\${libname}\${release}.so\$versuffix \${libname}.x"
;;
os2*)
libname_spec='$name'
need_lib_prefix=no
...
...
@@ -3519,10 +3499,6 @@ openbsd*)
fi
;;
openedition*)
lt_cv_deplibs_check_method=pass_all
;;
osf3* | osf4* | osf5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
...
...
configure
View file @
6a0cec46
This diff is collapsed.
Click to expand it.
contrib/slapd-modules/smbk5pwd/smbk5pwd.c
View file @
6a0cec46
...
...
@@ -37,6 +37,12 @@
#include
<kadm5/admin.h>
#include
<hdb.h>
#ifndef HDB_INTERFACE_VERSION
#define HDB_MASTER_KEY_SET master_key_set
#else
#define HDB_MASTER_KEY_SET hdb_master_key_set
#endif
static
krb5_context
context
;
static
void
*
kadm_context
;
static
kadm5_config_params
conf
;
...
...
@@ -70,18 +76,21 @@ static const char hex[] = "0123456789abcdef";
/* From liblutil/passwd.c... */
static
void
lmPasswd_to_key
(
const
unsigned
char
*
lmPasswd
,
const
char
*
lmPasswd
,
des_cblock
*
key
)
{
const
unsigned
char
*
lpw
=
(
const
unsigned
char
*
)
lmPasswd
;
unsigned
char
*
k
=
(
unsigned
char
*
)
key
;
/* make room for parity bits */
((
char
*
)
key
)[
0
]
=
lmPasswd
[
0
];
((
char
*
)
key
)
[
1
]
=
((
l
mPasswd
[
0
]
&
0x01
)
<<
7
)
|
(
l
mPasswd
[
1
]
>>
1
);
((
char
*
)
key
)
[
2
]
=
((
l
mPasswd
[
1
]
&
0x03
)
<<
6
)
|
(
l
mPasswd
[
2
]
>>
2
);
((
char
*
)
key
)
[
3
]
=
((
l
mPasswd
[
2
]
&
0x07
)
<<
5
)
|
(
l
mPasswd
[
3
]
>>
3
);
((
char
*
)
key
)
[
4
]
=
((
l
mPasswd
[
3
]
&
0x0F
)
<<
4
)
|
(
l
mPasswd
[
4
]
>>
4
);
((
char
*
)
key
)
[
5
]
=
((
l
mPasswd
[
4
]
&
0x1F
)
<<
3
)
|
(
l
mPasswd
[
5
]
>>
5
);
((
char
*
)
key
)
[
6
]
=
((
l
mPasswd
[
5
]
&
0x3F
)
<<
2
)
|
(
l
mPasswd
[
6
]
>>
6
);
((
char
*
)
key
)
[
7
]
=
((
l
mPasswd
[
6
]
&
0x7F
)
<<
1
);
k
[
0
]
=
lpw
[
0
];
k
[
1
]
=
((
l
pw
[
0
]
&
0x01
)
<<
7
)
|
(
l
pw
[
1
]
>>
1
);
k
[
2
]
=
((
l
pw
[
1
]
&
0x03
)
<<
6
)
|
(
l
pw
[
2
]
>>
2
);
k
[
3
]
=
((
l
pw
[
2
]
&
0x07
)
<<
5
)
|
(
l
pw
[
3
]
>>
3
);
k
[
4
]
=
((
l
pw
[
3
]
&
0x0F
)
<<
4
)
|
(
l
pw
[
4
]
>>
4
);
k
[
5
]
=
((
l
pw
[
4
]
&
0x1F
)
<<
3
)
|
(
l
pw
[
5
]
>>
5
);
k
[
6
]
=
((
l
pw
[
5
]
&
0x3F
)
<<
2
)
|
(
l
pw
[
6
]
>>
6
);
k
[
7
]
=
((
l
pw
[
6
]
&
0x7F
)
<<
1
);
des_set_odd_parity
(
key
);
}
...
...
@@ -154,7 +163,7 @@ static void nthash(
MD4_Init
(
&
ctx
);
MD4_Update
(
&
ctx
,
passwd
->
bv_val
,
passwd
->
bv_len
);
MD4_Final
(
hbuf
,
&
ctx
);
MD4_Final
(
(
unsigned
char
*
)
hbuf
,
&
ctx
);
hexify
(
hbuf
,
hash
);
}
...
...
@@ -264,7 +273,7 @@ static int k5key_chk(
ent
.
keys
.
val
=
&
ekey
;
decode_Key
((
unsigned
char
*
)
a
->
a_vals
[
0
].
bv_val
,
(
size_t
)
a
->
a_vals
[
0
].
bv_len
,
&
ent
.
keys
.
val
[
0
],
&
l
);
if
(
db
->
master_key_set
)
if
(
db
->
HDB_MASTER_KEY_SET
)
hdb_unseal_keys
(
context
,
db
,
&
ent
);
krb5_string_to_key_salt
(
context
,
ekey
.
key
.
keytype
,
cred
->
bv_val
,
...
...
@@ -353,7 +362,7 @@ static int smbk5pwd_exop_passwd(
if
(
ret
!=
0
)
break
;
keys
[
i
].
bv_val
=
buf
;
keys
[
i
].
bv_val
=
(
char
*
)
buf
;
keys
[
i
].
bv_len
=
len
;
}
keys
[
i
].
bv_val
=
NULL
;
...
...
include/ldap.h
View file @
6a0cec46
...
...
@@ -1337,6 +1337,10 @@ ldap_initialize LDAP_P((
* in tls.c
*/
LDAP_F
(
int
)
ldap_tls_inplace
LDAP_P
((
LDAP
*
ld
));
LDAP_F
(
int
)
ldap_start_tls
LDAP_P
((
LDAP
*
ld
,
...
...
libraries/libldap/request.c
View file @
6a0cec46
...
...
@@ -201,8 +201,8 @@ ldap_send_server_request(
if
(
srvlist
==
NULL
)
{
lc
=
ld
->
ld_defconn
;
}
else
{
if
((
lc
=
find_connection
(
ld
,
srvlist
,
1
)
)
==
NULL
)
{
lc
=
find_connection
(
ld
,
srvlist
,
1
)
;
if
(
lc
==
NULL
)
{
if
(
(
bind
!=
NULL
)
&&
(
parentreq
!=
NULL
)
)
{
/* Remember the bind in the parent */
incparent
=
1
;
...
...
@@ -357,7 +357,9 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb,
/* V3 rebind function */
if
(
ld
->
ld_rebind_proc
!=
NULL
)
{
LDAPURLDesc
*
srvfunc
;
if
(
(
srvfunc
=
ldap_url_dup
(
srvlist
))
==
NULL
)
{
srvfunc
=
ldap_url_dup
(
srvlist
);
if
(
srvfunc
==
NULL
)
{
ld
->
ld_errno
=
LDAP_NO_MEMORY
;
err
=
-
1
;
}
else
{
...
...
@@ -480,7 +482,8 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind )
if
(
lc
->
lconn_status
==
LDAP_CONNST_CONNECTED
)
{
ldap_mark_select_clear
(
ld
,
lc
->
lconn_sb
);
if
(
unbind
)
{
ldap_send_unbind
(
ld
,
lc
->
lconn_sb
,
NULL
,
NULL
);
ldap_send_unbind
(
ld
,
lc
->
lconn_sb
,
NULL
,
NULL
);
}
}
...
...
@@ -907,10 +910,10 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
#endif
if
(
rc
<
0
)
{
/* Failure, try next referral in the list */
Debug
(
LDAP_DEBUG_ANY
,
"Unable to chase referral
\"
%s
\"
(%s)
\n
"
,
refarray
[
i
],
ldap_err2string
(
ld
->
ld_errno
)
,
0
);
unfollowedcnt
+=
ldap_append_referral
(
ld
,
&
unfollowed
,
refarray
[
i
]);
ldap_free_urllist
(
srv
);
Debug
(
LDAP_DEBUG_ANY
,
"Unable to chase referral
\"
%s
\"
(
%d:
%s)
\n
"
,
refarray
[
i
],
ld
->
ld_errno
,
ldap_err2string
(
ld
->
ld_errno
)
);
unfollowedcnt
+=
ldap_append_referral
(
ld
,
&
unfollowed
,
refarray
[
i
]
);
ldap_free_urllist
(
srv
);
srv
=
NULL
;
}
else
{
/* Success, no need to try this referral list further */
...
...
@@ -919,30 +922,30 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
*
hadrefp
=
1
;
/* check if there is a queue of referrals that came in during bind */
if
(
lc
==
NULL
)
{
if
((
lc
=
find_connection
(
ld
,
srv
,
1
))
==
NULL
)
{
if
(
lc
==
NULL
)
{
lc
=
find_connection
(
ld
,
srv
,
1
);
if
(
lc
==
NULL
)
{
ld
->
ld_errno
=
LDAP_OPERATIONS_ERROR
;
rc
=
-
1
;
goto
done
;
}
}
if
(
lc
->
lconn_rebind_queue
!=
NULL
)
{
if
(
lc
->
lconn_rebind_queue
!=
NULL
)
{
/* Release resources of previous list */
LDAP_VFREE
(
refarray
);
LDAP_VFREE
(
refarray
);
refarray
=
NULL
;
ldap_free_urllist
(
srv
);
ldap_free_urllist
(
srv
);
srv
=
NULL
;
/* Pull entries off end of queue so list always null terminated */
for
(
j
=
0
;
lc
->
lconn_rebind_queue
[
j
]
!=
NULL
;
j
++
)
{
for
(
j
=
0
;
lc
->
lconn_rebind_queue
[
j
]
!=
NULL
;
j
++
)
;
}
refarray
=
lc
->
lconn_rebind_queue
[
j
-
1
];
refarray
=
lc
->
lconn_rebind_queue
[
j
-
1
];
lc
->
lconn_rebind_queue
[
j
-
1
]
=
NULL
;
/* we pulled off last entry from queue, free queue */
if
(
j
==
1
)
{
LDAP_FREE
(
lc
->
lconn_rebind_queue
);
LDAP_FREE
(
lc
->
lconn_rebind_queue
);
lc
->
lconn_rebind_queue
=
NULL
;
}
/* restart the loop the with new referral list */
...
...
@@ -1027,10 +1030,9 @@ ldap_chase_referrals( LDAP *ld,
/* parse out & follow referrals */
for
(
ref
=
p
;
rc
==
0
&&
ref
!=
NULL
;
ref
=
p
)
{
if
((
p
=
strchr
(
ref
,
'\n'
))
!=
NULL
)
{
p
=
strchr
(
ref
,
'\n'
);
if
(
p
!=
NULL
)
{
*
p
++
=
'\0'
;
}
else
{
p
=
NULL
;
}
rc
=
ldap_url_parse_ext
(
ref
,
&
srv
);
...
...
@@ -1043,7 +1045,7 @@ ldap_chase_referrals( LDAP *ld,
continue
;
}
if
(
srv
->
lud_dn
!=
NULL
&&
srv
->
lud_dn
==
'\0'
)
{
if
(
srv
->
lud_dn
!=
NULL
&&
srv
->
lud_dn
==
'\0'
)
{
LDAP_FREE
(
srv
->
lud_dn
);
srv
->
lud_dn
=
NULL
;
}
...
...
@@ -1057,7 +1059,7 @@ ldap_chase_referrals( LDAP *ld,
ber
=
re_encode_request
(
ld
,
origreq
->
lr_ber
,
id
,
sref
,
srv
,
&
rinfo
.
ri_request
);
if
(
ber
==
NULL
)
{
if
(
ber
==
NULL
)
{
return
-
1
;
}
...
...
@@ -1081,8 +1083,8 @@ ldap_chase_referrals( LDAP *ld,
++
count
;
}
else
{
Debug
(
LDAP_DEBUG_ANY
,
"Unable to chase referral
(
%s)
\n
"
,
ldap_err2string
(
ld
->
ld_errno
)
,
0
,
0
);
"Unable to chase referral
\"
%s
\"
(%d:
%s)
\n
"
,
ref
,
ld
->
ld_errno
,
ldap_err2string
(
ld
->
ld_errno
)
);
rc
=
ldap_append_referral
(
ld
,
&
unfollowed
,
ref
);
}
...
...
libraries/libldap/tls.c
View file @
6a0cec46
...
...
@@ -827,6 +827,24 @@ ldap_pvt_tls_inplace ( Sockbuf *sb )
return
HAS_TLS
(
sb
)
?
1
:
0
;
}
int
ldap_tls_inplace
(
LDAP
*
ld
)
{
Sockbuf
*
sb
=
NULL
;
if
(
ld
->
ld_defconn
&&
ld
->
ld_defconn
->
lconn_sb
)
{
sb
=
ld
->
ld_defconn
->
lconn_sb
;
}
else
if
(
ld
->
ld_sb
)
{
sb
=
ld
->
ld_sb
;
}
else
{
return
0
;
}
return
ldap_pvt_tls_inplace
(
sb
);
}
static
X509
*
tls_get_cert
(
SSL
*
s
)
{
...
...
@@ -1667,7 +1685,7 @@ ldap_install_tls( LDAP *ld )
#ifndef HAVE_TLS
return
LDAP_NOT_SUPPORTED
;
#else
if
(
ld
->
ld_sb
!=
NULL
&&
ldap_pvt
_tls_inplace
(
ld
->
ld_sb
)
!=
0
)
{
if
(
ld
ap
_tls_inplace
(
ld
)
)
{
return
LDAP_LOCAL_ERROR
;
}
...
...
@@ -1689,7 +1707,7 @@ ldap_start_tls_s ( LDAP *ld,
/* XXYYZ: this initiates operation only on default connection! */
if
(
ld
->
ld_sb
!=
NULL
&&
ldap_pvt
_tls_inplace
(
ld
->
ld_sb
)
!=
0
)
{
if
(
ld
ap
_tls_inplace
(
ld
)
)
{
return
LDAP_LOCAL_ERROR
;
}
...
...
libraries/libldap/unbind.c
View file @
6a0cec46
...
...
@@ -90,14 +90,14 @@ ldap_ld_free(
while
(
ld
->
ld_requests
!=
NULL
)
{
ldap_free_request
(
ld
,
ld
->
ld_requests
);
}
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock
(
&
ld
->
ld_req_mutex
);
#endif
/* free and unbind from all open connections */
while
(
ld
->
ld_conns
!=
NULL
)
{
ldap_free_connection
(
ld
,
ld
->
ld_conns
,
1
,
close
);
}
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock
(
&
ld
->
ld_req_mutex
);
#endif
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock
(
&
ld
->
ld_res_mutex
);
...
...
@@ -199,7 +199,8 @@ ldap_unbind_s( LDAP *ld )
return
(
ldap_unbind_ext
(
ld
,
NULL
,
NULL
)
);
}
/* FIXME: this function is called only by ldap_free_connection(),
* which, most of the times, is called with ld_req_mutex locked */
int
ldap_send_unbind
(
LDAP
*
ld
,
...
...
@@ -221,7 +222,8 @@ ldap_send_unbind(
return
(
ld
->
ld_errno
);
}
LDAP_NEXT_MSGID
(
ld
,
id
);
id
=
++
(
ld
)
->
ld_msgid
;
/* fill it in */
if
(
ber_printf
(
ber
,
"{itn"
/*}*/
,
id
,
LDAP_REQ_UNBIND
)
==
-
1
)
{
...
...
@@ -242,18 +244,12 @@ ldap_send_unbind(
return
(
ld
->
ld_errno
);
}
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock
(
&
ld
->
ld_req_mutex
);
#endif
ld
->
ld_errno
=
LDAP_SUCCESS
;
/* send the message */
if
(
ber_flush
(
sb
,
ber
,
1
)
==
-
1
)
{
ld
->
ld_errno
=
LDAP_SERVER_DOWN
;
ber_free
(
ber
,
1
);
}
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock
(
&
ld
->
ld_req_mutex
);
#endif
return
(
ld
->
ld_errno
);
}
servers/slapd/Makefile.in
View file @
6a0cec46
...
...
@@ -401,7 +401,7 @@ all-cffiles: slapd $(SLAPD_DYNAMIC_BACKENDS) dynamic_overlays
touch
all-cffiles
install-schema
:
FORCE
@
if
test
-
e
$(DESTDIR)$(schemadir)
;
then
\
@
if
test
-
d
$(DESTDIR)$(schemadir)
;
then
\
echo
"MOVING EXISTING SCHEMA DIR to
$(DESTDIR)$(schemadir)
.
$$$$
"
;
\
mv
$(DESTDIR)$(schemadir)
$(DESTDIR)$(schemadir)
.
$$$$
;
\
fi
...
...
servers/slapd/ad.c
View file @
6a0cec46
...
...
@@ -174,12 +174,15 @@ int slap_bv2ad(
}
/* find valid base attribute type; parse in place */
memset
(
&
desc
,
0
,
sizeof
(
desc
));
memset
(
&
desc
,
0
,
sizeof
(
desc
)
);
desc
.
ad_cname
=
*
bv
;
name
=
bv
->
bv_val
;
options
=
strchr
(
name
,
';'
);
if
(
options
!=
NULL
)
{
options
=
strchr
(
name
,
';'
);
if
(
options
!=
NULL
&&
(
options
-
name
)
<
bv
->
bv_len
)
{
/* don't go past the end of the berval! */
desc
.
ad_cname
.
bv_len
=
options
-
name
;
}
else
{
options
=
NULL
;
}
desc
.
ad_type
=
at_bvfind
(
&
desc
.
ad_cname
);
if
(
desc
.
ad_type
==
NULL
)
{
...
...
servers/slapd/back-bdb/config.c
View file @
6a0cec46
...
...
@@ -67,7 +67,7 @@ static ConfigTable bdbcfg[] = {
{
"dbconfig"
,
"DB_CONFIG setting"
,
1
,
0
,
0
,
ARG_MAGIC
|
BDB_CONFIG
,
bdb_cf_gen
,
"( OLcfgDbAt:1.3 NAME 'olcDbConfig' "
"DESC 'BerkeleyDB DB_CONFIG configuration directives' "
"SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )"
,
NULL
,
NULL
},
"SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )"
,
NULL
,
NULL
},
{
"dbnosync"
,
NULL
,
1
,
2
,
0
,
ARG_ON_OFF
|
ARG_MAGIC
|
BDB_NOSYNC
,
bdb_cf_gen
,
"( OLcfgDbAt:1.4 NAME 'olcDbNoSync' "
"DESC 'Disable synchronous database writes' "
...
...
servers/slapd/back-bdb/search.c
View file @
6a0cec46
...
...
@@ -833,7 +833,7 @@ fetch_entry_retry:
if
(
rs
->
sr_err
==
LDAP_COMPARE_TRUE
)
{
/* check size limit */
if
(
--
op
->
ors_slimit
==
-
1
)
{
if
(
--
op
->
ors_slimit
==
-
1
)
{
#ifdef SLAP_ZONE_ALLOC
slap_zn_runlock
(
bdb
->
bi_cache
.
c_zctx
,
e
);
#endif
...
...
servers/slapd/entry.c
View file @
6a0cec46
...
...
@@ -268,15 +268,24 @@ str2entry2( char *s, int checkvals )
slap_syntax_transform_func
*
pretty
=
ad
->
ad_type
->
sat_syntax
->
ssyn_pretty
;
if
(
pretty
)
{
if
(
pretty
)
{
#ifdef SLAP_ORDERED_PRETTYNORM
rc
=
ordered_value_pretty
(
ad
,
&
vals
[
i
],
&
pval
,
NULL
);
#else
/* ! SLAP_ORDERED_PRETTYNORM */
rc
=
pretty
(
ad
->
ad_type
->
sat_syntax
,
&
vals
[
i
],
&
pval
,
NULL
);
#endif
/* ! SLAP_ORDERED_PRETTYNORM */
}
else
if
(
validate
)
{
}
else
if
(
validate
)
{
/*
* validate value per syntax
*/
#ifdef SLAP_ORDERED_PRETTYNORM
rc
=
ordered_value_validate
(
ad
,
&
vals
[
i
]
);
#else
/* ! SLAP_ORDERED_PRETTYNORM */
rc
=
validate
(
ad
->
ad_type
->
sat_syntax
,
&
vals
[
i
]
);
#endif
/* ! SLAP_ORDERED_PRETTYNORM */
}
else
{
Debug
(
LDAP_DEBUG_ANY
,
...
...
@@ -303,16 +312,24 @@ str2entry2( char *s, int checkvals )
}
}
if
(
ad
->
ad_type
->
sat_equality
&&
if
(
ad
->
ad_type
->
sat_equality
&&
ad
->
ad_type
->
sat_equality
->
smr_normalize
)
{
#ifdef SLAP_ORDERED_PRETTYNORM
rc
=
ordered_value_normalize
(
SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX
,
ad
,
ad
->
ad_type
->
sat_equality
,
&
vals
[
i
],
&
nvals
[
i
],
NULL
);
#else
/* ! SLAP_ORDERED_PRETTYNORM */
rc
=
ad
->
ad_type
->
sat_equality
->
smr_normalize
(
SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX
,
ad
->
ad_type
->
sat_syntax
,
ad
->
ad_type
->
sat_equality
,
&
vals
[
i
],
&
nvals
[
i
],
NULL
);
#endif
/* ! SLAP_ORDERED_PRETTYNORM */
if
(
rc
)
{
if
(
rc
)
{
Debug
(
LDAP_DEBUG_ANY
,
"<= str2entry NULL (smr_normalize %d)
\n
"
,
rc
,
0
,
0
);
goto
fail
;
...
...
servers/slapd/modify.c
View file @
6a0cec46
...
...
@@ -668,14 +668,25 @@ int slap_mods_check(
* check that each value is valid per syntax
* and pretty if appropriate
*/
for
(
nvals
=
0
;
ml
->
sml_values
[
nvals
].
bv_val
;
nvals
++
)
{
for
(
nvals
=
0
;
ml
->
sml_values
[
nvals
].
bv_val
;
nvals
++
)
{
struct
berval
pval
;
if
(
pretty
)
{
if
(
pretty
)
{
#ifdef SLAP_ORDERED_PRETTYNORM
rc
=
ordered_value_pretty
(
ad
,
&
ml
->
sml_values
[
nvals
],
&
pval
,
ctx
);
#else
/* ! SLAP_ORDERED_PRETTYNORM */
rc
=
pretty
(
ad
->
ad_type
->
sat_syntax
,
&
ml
->
sml_values
[
nvals
],
&
pval
,
ctx
);
#endif
/* ! SLAP_ORDERED_PRETTYNORM */
}
else
{
#ifdef SLAP_ORDERED_PRETTYNORM
rc
=
ordered_value_validate
(
ad
,
&
ml
->
sml_values
[
nvals
]
);
#else
/* ! SLAP_ORDERED_PRETTYNORM */
rc
=
validate
(
ad
->
ad_type
->
sat_syntax
,
&
ml
->
sml_values
[
nvals
]
);
#endif
/* ! SLAP_ORDERED_PRETTYNORM */
}
if
(
rc
!=
0
)
{
...
...
@@ -720,13 +731,21 @@ int slap_mods_check(
ml
->
sml_nvalues
=
ber_memalloc_x
(
(
nvals
+
1
)
*
sizeof
(
struct
berval
),
ctx
);
for
(
nvals
=
0
;
ml
->
sml_values
[
nvals
].
bv_val
;
nvals
++
)
{
for
(
nvals
=
0
;
ml
->
sml_values
[
nvals
].
bv_val
;
nvals
++
)
{
#ifdef SLAP_ORDERED_PRETTYNORM
rc
=
ordered_value_normalize
(
SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX
,
ad
,
ad
->
ad_type
->
sat_equality
,
&
ml
->
sml_values
[
nvals
],
&
ml
->
sml_nvalues
[
nvals
],
ctx
);
#else
/* ! SLAP_ORDERED_PRETTYNORM */
rc
=
ad
->
ad_type
->
sat_equality
->
smr_normalize
(
SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX
,
ad
->
ad_type
->
sat_syntax
,
ad
->
ad_type
->
sat_equality
,
&
ml
->
sml_values
[
nvals
],
&
ml
->
sml_nvalues
[
nvals
],
ctx
);
if
(
rc
)
{
#endif
/* ! SLAP_ORDERED_PRETTYNORM */
if
(
rc
)
{
Debug
(
LDAP_DEBUG_ANY
,
"<= str2entry NULL (ssyn_normalize %d)
\n
"
,
rc
,
0
,
0
);
...
...
@@ -738,8 +757,7 @@ int slap_mods_check(
}
}
ml
->
sml_nvalues
[
nvals
].
bv_val
=
NULL
;
ml
->
sml_nvalues
[
nvals
].
bv_len
=
0
;
BER_BVZERO
(
&
ml
->
sml_nvalues
[
nvals
]
);
}
/* check for duplicates, but ignore Deletes.
...
...
servers/slapd/proto-slap.h
View file @
6a0cec46
...
...
@@ -1337,6 +1337,31 @@ LDAP_SLAPD_F (int) slap_sasl_rewrite_config LDAP_P((
int
argc
,
char
**
argv
));
#endif
/* SLAP_AUTH_REWRITE */
#ifdef SLAP_AUTHZ_SYNTAX
LDAP_SLAPD_F
(
int
)
authzValidate
LDAP_P
((
Syntax
*
syn
,
struct
berval
*
in
));
#if 0
LDAP_SLAPD_F (int) authzMatch LDAP_P((
int *matchp,
slap_mask_t flags,
Syntax *syntax,
MatchingRule *mr,
struct berval *value,
void *assertedValue ));
#endif
LDAP_SLAPD_F
(
int
)
authzPretty
LDAP_P
((
Syntax
*
syntax
,
struct
berval
*
val
,
struct
berval
*
out
,
void
*
ctx
));
LDAP_SLAPD_F
(
int
)
authzNormalize
LDAP_P
((
slap_mask_t
usage
,
Syntax
*
syntax
,
MatchingRule
*
mr
,
struct
berval
*
val
,
struct
berval
*
normalized
,
void
*
ctx
));
#endif
/* SLAP_AUTHZ_SYNTAX */
/*
* schema.c
...
...
@@ -1513,6 +1538,24 @@ LDAP_SLAPD_F (int) ordered_value_add LDAP_P((
BerVarray
vals
,
BerVarray
nvals
));
LDAP_SLAPD_F
(
int
)
ordered_value_validate
LDAP_P
((
AttributeDescription
*
ad
,
struct
berval
*
in
));
LDAP_SLAPD_F
(
int
)
ordered_value_pretty
LDAP_P
((
AttributeDescription
*
ad
,
struct
berval
*
val
,
struct
berval
*
out
,
void
*
ctx
));
LDAP_SLAPD_F
(
int
)
ordered_value_normalize
LDAP_P
((
slap_mask_t
usage
,
AttributeDescription
*
ad
,
MatchingRule
*
mr
,
struct
berval
*
val
,
struct
berval
*
normalized
,
void
*
ctx
));
LDAP_SLAPD_F
(
int
)
ordered_value_match
LDAP_P
((
int
*
match
,
AttributeDescription
*
ad
,
...
...