plugin_syntax.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. /** BEGIN COPYRIGHT BLOCK
  2. * This Program is free software; you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation; version 2 of the License.
  5. *
  6. * This Program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  9. *
  10. * You should have received a copy of the GNU General Public License along with
  11. * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  12. * Place, Suite 330, Boston, MA 02111-1307 USA.
  13. *
  14. * In addition, as a special exception, Red Hat, Inc. gives You the additional
  15. * right to link the code of this Program with code not covered under the GNU
  16. * General Public License ("Non-GPL Code") and to distribute linked combinations
  17. * including the two, subject to the limitations in this paragraph. Non-GPL Code
  18. * permitted under this exception must only link to the code of this Program
  19. * through those well defined interfaces identified in the file named EXCEPTION
  20. * found in the source code files (the "Approved Interfaces"). The files of
  21. * Non-GPL Code may instantiate templates or use macros or inline functions from
  22. * the Approved Interfaces without causing the resulting work to be covered by
  23. * the GNU General Public License. Only Red Hat, Inc. may make changes or
  24. * additions to the list of Approved Interfaces. You must obey the GNU General
  25. * Public License in all respects for all of the Program code and other code used
  26. * in conjunction with the Program except the Non-GPL Code covered by this
  27. * exception. If you modify this file, you may extend this exception to your
  28. * version of the file, but you are not obligated to do so. If you do not wish to
  29. * provide this exception without modification, you must delete this exception
  30. * statement from your version and license this file solely under the GPL without
  31. * exception.
  32. *
  33. *
  34. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  35. * Copyright (C) 2005 Red Hat, Inc.
  36. * All rights reserved.
  37. * END COPYRIGHT BLOCK **/
  38. #ifdef HAVE_CONFIG_H
  39. # include <config.h>
  40. #endif
  41. /*
  42. * plugin_syntax.c - routines for calling syntax plugins
  43. */
  44. #include "slap.h"
  45. struct slapdplugin *
  46. plugin_syntax_find( const char *nameoroid )
  47. {
  48. struct slapdplugin *pi;
  49. /* LDAPDebug( LDAP_DEBUG_FILTER, "=> plugin_syntax_find (%s)\n", nameoroid, 0, 0 ); */
  50. for ( pi = get_plugin_list(PLUGIN_LIST_SYNTAX); pi != NULL; pi = pi->plg_next ) {
  51. if ( charray_inlist( pi->plg_syntax_names, (char *)nameoroid ) ) {
  52. break;
  53. }
  54. }
  55. /* LDAPDebug( LDAP_DEBUG_FILTER, "<= plugin_syntax_find %d\n", pi, 0, 0 ); */
  56. return ( pi );
  57. }
  58. /*
  59. * Enumerate all the syntax plugins, calling (*sef)() for each one.
  60. */
  61. void
  62. plugin_syntax_enumerate( SyntaxEnumFunc sef, void *arg )
  63. {
  64. struct slapdplugin *pi;
  65. for ( pi = get_plugin_list(PLUGIN_LIST_SYNTAX); pi != NULL;
  66. pi = pi->plg_next ) {
  67. (*sef)( pi->plg_syntax_names, &pi->plg_desc, arg );
  68. }
  69. }
  70. struct slapdplugin *
  71. slapi_get_global_syntax_plugins()
  72. {
  73. return get_plugin_list(PLUGIN_LIST_SYNTAX);
  74. }
  75. char *
  76. plugin_syntax2oid( struct slapdplugin *pi )
  77. {
  78. return( pi->plg_syntax_oid );
  79. }
  80. int
  81. plugin_call_syntax_get_compare_fn(
  82. void *vpi,
  83. value_compare_fn_type *compare_fn
  84. )
  85. {
  86. struct slapdplugin *pi = vpi;
  87. *compare_fn = NULL;
  88. LDAPDebug( LDAP_DEBUG_TRACE,
  89. "=> plugin_call_syntax_get_compare_fn\n",0,0, 0 );
  90. if ( pi == NULL ) {
  91. LDAPDebug( LDAP_DEBUG_TRACE,
  92. "<= plugin_syntax no plugin for attribute type\n",
  93. 0, 0, 0 );
  94. return( LDAP_PROTOCOL_ERROR ); /* syntax unkonwn */
  95. }
  96. if ( (pi->plg_syntax_flags & SLAPI_PLUGIN_SYNTAX_FLAG_ORDERING) == 0 ) {
  97. return( LDAP_PROTOCOL_ERROR );
  98. }
  99. if (pi->plg_syntax_filter_ava == NULL) {
  100. LDAPDebug( LDAP_DEBUG_ANY, "<= plugin_call_syntax_get_compare_fn: "
  101. "no filter_ava found for attribute type\n", 0, 0, 0 );
  102. return( LDAP_PROTOCOL_ERROR );
  103. }
  104. if (pi->plg_syntax_compare == NULL) {
  105. return( LDAP_PROTOCOL_ERROR );
  106. }
  107. *compare_fn = (value_compare_fn_type) pi->plg_syntax_compare;
  108. LDAPDebug( LDAP_DEBUG_TRACE,
  109. "<= plugin_call_syntax_get_compare_fn \n", 0, 0, 0 );
  110. return( 0 );
  111. }
  112. int
  113. plugin_call_syntax_filter_ava(
  114. const Slapi_Attr *a,
  115. int ftype,
  116. struct ava *ava
  117. )
  118. {
  119. return(plugin_call_syntax_filter_ava_sv(a,ftype,ava,NULL,0 /*Present*/));
  120. }
  121. int
  122. plugin_call_syntax_filter_ava_sv(
  123. const Slapi_Attr *a,
  124. int ftype,
  125. struct ava *ava,
  126. Slapi_Value **retVal,
  127. int useDeletedValues
  128. )
  129. {
  130. int rc;
  131. Slapi_PBlock pipb;
  132. LDAPDebug( LDAP_DEBUG_FILTER,
  133. "=> plugin_call_syntax_filter_ava %s=%s\n", ava->ava_type,
  134. ava->ava_value.bv_val, 0 );
  135. if ( a->a_plugin == NULL ) {
  136. LDAPDebug( LDAP_DEBUG_FILTER,
  137. "<= plugin_syntax no plugin for attr (%s)\n",
  138. a->a_type, 0, 0 );
  139. return( LDAP_PROTOCOL_ERROR ); /* syntax unkonwn */
  140. }
  141. pblock_init( &pipb );
  142. slapi_pblock_set( &pipb, SLAPI_PLUGIN, (void *) a->a_plugin );
  143. rc = -1; /* does not match by default */
  144. switch ( ftype ) {
  145. case LDAP_FILTER_GE:
  146. case LDAP_FILTER_LE:
  147. if ( (a->a_plugin->plg_syntax_flags &
  148. SLAPI_PLUGIN_SYNTAX_FLAG_ORDERING) == 0 ) {
  149. rc = LDAP_PROTOCOL_ERROR;
  150. break;
  151. }
  152. /* FALL */
  153. case LDAP_FILTER_EQUALITY:
  154. case LDAP_FILTER_APPROX:
  155. if ( a->a_plugin->plg_syntax_filter_ava != NULL )
  156. {
  157. /* JCM - Maybe the plugin should use the attr value iterator too... */
  158. Slapi_Value **va;
  159. if(useDeletedValues)
  160. va= valueset_get_valuearray(&a->a_deleted_values);
  161. else
  162. va= valueset_get_valuearray(&a->a_present_values);
  163. if(va!=NULL)
  164. {
  165. rc = a->a_plugin->plg_syntax_filter_ava( &pipb,
  166. &ava->ava_value,
  167. va,
  168. ftype, retVal );
  169. }
  170. }
  171. break;
  172. default:
  173. LDAPDebug( LDAP_DEBUG_ANY, "plugin_call_syntax_filter: "
  174. "unknown filter type %d\n", ftype, 0, 0 );
  175. rc = LDAP_PROTOCOL_ERROR;
  176. break;
  177. }
  178. LDAPDebug( LDAP_DEBUG_FILTER,
  179. "<= plugin_call_syntax_filter_ava %d\n", rc, 0, 0 );
  180. return( rc );
  181. }
  182. int
  183. plugin_call_syntax_filter_sub(
  184. Slapi_PBlock *pb,
  185. Slapi_Attr *a,
  186. struct subfilt *fsub
  187. )
  188. {
  189. return(plugin_call_syntax_filter_sub_sv(pb,a,fsub));
  190. }
  191. int
  192. plugin_call_syntax_filter_sub_sv(
  193. Slapi_PBlock *pb,
  194. Slapi_Attr *a,
  195. struct subfilt *fsub
  196. )
  197. {
  198. Slapi_PBlock pipb;
  199. int rc;
  200. LDAPDebug( LDAP_DEBUG_FILTER,
  201. "=> plugin_call_syntax_filter_sub\n", 0, 0, 0 );
  202. if ( a->a_plugin == NULL ) {
  203. LDAPDebug( LDAP_DEBUG_FILTER,
  204. "<= plugin_call_syntax_filter no plugin\n", 0, 0, 0 );
  205. return( -1 ); /* syntax unkonwn - does not match */
  206. }
  207. if ( a->a_plugin->plg_syntax_filter_sub != NULL )
  208. {
  209. Slapi_Value **va= valueset_get_valuearray(&a->a_present_values);
  210. pblock_init( &pipb );
  211. if (pb)
  212. {
  213. Operation *op = NULL;
  214. /* to pass SLAPI_SEARCH_TIMELIMIT & SLAPI_OPINITATED_TIME */
  215. slapi_pblock_get( pb, SLAPI_OPERATION, &op );
  216. slapi_pblock_set( &pipb, SLAPI_OPERATION, op );
  217. }
  218. slapi_pblock_set( &pipb, SLAPI_PLUGIN, (void *) a->a_plugin );
  219. rc = a->a_plugin->plg_syntax_filter_sub( &pipb,
  220. fsub->sf_initial, fsub->sf_any, fsub->sf_final, va);
  221. } else {
  222. rc = -1;
  223. }
  224. LDAPDebug( LDAP_DEBUG_FILTER, "<= plugin_call_syntax_filter_sub_sv %d\n",
  225. rc, 0, 0 );
  226. return( rc );
  227. }
  228. /* Checks if the values of all attributes in an entry are valid for the
  229. * syntax specified for the attribute in question. Setting override to
  230. * 1 will force syntax checking to be performed, even if syntax checking
  231. * is disabled in the config. Setting override to 0 will obey the config
  232. * settings.
  233. *
  234. * Returns 1 if there is a syntax violation and sets the error message
  235. * appropriately. Returns 0 if everything checks out fine.
  236. */
  237. int
  238. slapi_entry_syntax_check(
  239. Slapi_PBlock *pb, Slapi_Entry *e, int override
  240. )
  241. {
  242. int ret = 0;
  243. int i = 0;
  244. int is_replicated_operation = 0;
  245. int badval = 0;
  246. int syntaxcheck = config_get_syntaxcheck();
  247. int syntaxlogging = config_get_syntaxlogging();
  248. Slapi_Attr *prevattr = NULL;
  249. Slapi_Attr *a = NULL;
  250. char errtext[ BUFSIZ ];
  251. char *errp = &errtext[0];
  252. size_t err_remaining = sizeof(errtext);
  253. if (pb != NULL) {
  254. slapi_pblock_get(pb, SLAPI_IS_REPLICATED_OPERATION, &is_replicated_operation);
  255. }
  256. /* If syntax checking and logging are off, or if this is a
  257. * replicated operation, just return that the syntax is OK. */
  258. if (((syntaxcheck == 0) && (syntaxlogging == 0) && (override == 0)) ||
  259. is_replicated_operation) {
  260. goto exit;
  261. }
  262. i = slapi_entry_first_attr(e, &a);
  263. while ((-1 != i) && a && (a->a_plugin != NULL)) {
  264. /* If no validate function is available for this type, just
  265. * assume that the value is valid. */
  266. if ( a->a_plugin->plg_syntax_validate != NULL ) {
  267. int numvals = 0;
  268. slapi_attr_get_numvalues(a, &numvals);
  269. if ( numvals > 0 ) {
  270. Slapi_Value *val = NULL;
  271. const struct berval *bval = NULL;
  272. int hint = slapi_attr_first_value(a, &val);
  273. /* iterate through each value to check if it's valid */
  274. while (val != NULL) {
  275. bval = slapi_value_get_berval(val);
  276. if ((a->a_plugin->plg_syntax_validate( bval )) != 0) {
  277. if (syntaxlogging) {
  278. slapi_log_error( SLAPI_LOG_FATAL, "Syntax Check",
  279. "\"%s\": (%s) value #%d invalid per syntax\n",
  280. slapi_entry_get_dn(e), a->a_type, hint );
  281. }
  282. if (syntaxcheck || override) {
  283. if (pb) {
  284. /* Append new text to any existing text. */
  285. errp += PR_snprintf( errp, err_remaining,
  286. "%s: value #%d invalid per syntax\n", a->a_type, hint );
  287. err_remaining -= errp - &errtext[0];
  288. }
  289. ret = 1;
  290. }
  291. }
  292. hint = slapi_attr_next_value(a, hint, &val);
  293. }
  294. }
  295. }
  296. prevattr = a;
  297. i = slapi_entry_next_attr(e, prevattr, &a);
  298. }
  299. /* See if we need to set the error text in the pblock. */
  300. if (errp != &errtext[0]) {
  301. slapi_pblock_set( pb, SLAPI_PB_RESULT_TEXT, errtext );
  302. }
  303. exit:
  304. return( ret );
  305. }
  306. /* Checks if the values of all attributes being added in a Slapi_Mods
  307. * are valid for the syntax specified for the attribute in question.
  308. * The new values in an add or replace modify operation and the newrdn
  309. * value for a modrdn operation will be checked.
  310. * Returns 1 if there is a syntax violation and sets the error message
  311. * appropriately. Returns 0 if everything checks out fine.
  312. */
  313. int
  314. slapi_mods_syntax_check(
  315. Slapi_PBlock *pb, LDAPMod **mods, int override
  316. )
  317. {
  318. int ret = 0;
  319. int i, j = 0;
  320. int is_replicated_operation = 0;
  321. int badval = 0;
  322. int syntaxcheck = config_get_syntaxcheck();
  323. int syntaxlogging = config_get_syntaxlogging();
  324. char errtext[ BUFSIZ ];
  325. char *errp = &errtext[0];
  326. size_t err_remaining = sizeof(errtext);
  327. char *dn = NULL;
  328. LDAPMod *mod = NULL;
  329. if (mods == NULL) {
  330. ret = 1;
  331. goto exit;
  332. }
  333. if (pb != NULL) {
  334. slapi_pblock_get(pb, SLAPI_IS_REPLICATED_OPERATION, &is_replicated_operation);
  335. slapi_pblock_get(pb, SLAPI_TARGET_DN, &dn);
  336. }
  337. /* If syntax checking and logging are off, or if this is a
  338. * replicated operation, just return that the syntax is OK. */
  339. if (((syntaxcheck == 0) && (syntaxlogging == 0) && (override == 0)) ||
  340. is_replicated_operation) {
  341. goto exit;
  342. }
  343. /* Loop through mods */
  344. for (i = 0; mods[i] != NULL; i++) {
  345. mod = mods[i];
  346. /* We only care about replace and add modify operations that
  347. * are truly adding new values to the entry. */
  348. if ((SLAPI_IS_MOD_REPLACE(mod->mod_op) || SLAPI_IS_MOD_ADD(mod->mod_op)) &&
  349. (mod->mod_bvalues != NULL)) {
  350. struct slapdplugin *syntax_plugin = NULL;
  351. /* Find the plug-in for this type, then call it's
  352. * validate function.*/
  353. slapi_attr_type2plugin(mod->mod_type, (void **)&syntax_plugin);
  354. if ((syntax_plugin != NULL) && (syntax_plugin->plg_syntax_validate != NULL)) {
  355. /* Loop through the values and validate each one */
  356. for (j = 0; mod->mod_bvalues[j] != NULL; j++) {
  357. if (syntax_plugin->plg_syntax_validate(mod->mod_bvalues[j]) != 0) {
  358. if (syntaxlogging) {
  359. slapi_log_error( SLAPI_LOG_FATAL, "Syntax Check", "\"%s\": (%s) value #%d invalid per syntax\n",
  360. dn ? dn : "NULL", mod->mod_type, j );
  361. }
  362. if (syntaxcheck || override) {
  363. if (pb) {
  364. /* Append new text to any existing text. */
  365. errp += PR_snprintf( errp, err_remaining,
  366. "%s: value #%d invalid per syntax\n", mod->mod_type, j );
  367. err_remaining -= errp - &errtext[0];
  368. }
  369. ret = 1;
  370. }
  371. }
  372. }
  373. }
  374. }
  375. }
  376. /* See if we need to set the error text in the pblock. */
  377. if (errp != &errtext[0]) {
  378. slapi_pblock_set( pb, SLAPI_PB_RESULT_TEXT, errtext );
  379. }
  380. exit:
  381. return( ret );
  382. }
  383. SLAPI_DEPRECATED int
  384. slapi_call_syntax_values2keys( /* JCM SLOW FUNCTION */
  385. void *vpi,
  386. struct berval **vals,
  387. struct berval ***ivals,
  388. int ftype
  389. )
  390. {
  391. int rc;
  392. Slapi_Value **svin= NULL;
  393. Slapi_Value **svout= NULL;
  394. valuearray_init_bervalarray(vals,&svin); /* JCM SLOW FUNCTION */
  395. rc= slapi_call_syntax_values2keys_sv(vpi,svin,&svout,ftype);
  396. valuearray_get_bervalarray(svout,ivals); /* JCM SLOW FUNCTION */
  397. valuearray_free(&svout);
  398. valuearray_free(&svin);
  399. return rc;
  400. }
  401. int
  402. slapi_call_syntax_values2keys_sv(
  403. void *vpi,
  404. Slapi_Value **vals,
  405. Slapi_Value ***ivals,
  406. int ftype
  407. )
  408. {
  409. int rc;
  410. Slapi_PBlock pipb;
  411. struct slapdplugin *pi = vpi;
  412. LDAPDebug( LDAP_DEBUG_FILTER, "=> slapi_call_syntax_values2keys\n",
  413. 0, 0, 0 );
  414. pblock_init( &pipb );
  415. slapi_pblock_set( &pipb, SLAPI_PLUGIN, vpi );
  416. *ivals = NULL;
  417. rc = -1; /* means no values2keys function */
  418. if ( pi != NULL && pi->plg_syntax_values2keys != NULL ) {
  419. rc = pi->plg_syntax_values2keys( &pipb, vals, ivals, ftype );
  420. }
  421. LDAPDebug( LDAP_DEBUG_FILTER,
  422. "<= slapi_call_syntax_values2keys %d\n", rc, 0, 0 );
  423. return( rc );
  424. }
  425. /*
  426. * almost identical to slapi_call_syntax_values2keys_sv except accepting
  427. * pblock to pass some info such as substrlen.
  428. */
  429. int
  430. slapi_call_syntax_values2keys_sv_pb(
  431. void *vpi,
  432. Slapi_Value **vals,
  433. Slapi_Value ***ivals,
  434. int ftype,
  435. Slapi_PBlock *pb
  436. )
  437. {
  438. int rc;
  439. struct slapdplugin *pi = vpi;
  440. LDAPDebug( LDAP_DEBUG_FILTER, "=> slapi_call_syntax_values2keys\n",
  441. 0, 0, 0 );
  442. slapi_pblock_set( pb, SLAPI_PLUGIN, vpi );
  443. *ivals = NULL;
  444. rc = -1; /* means no values2keys function */
  445. if ( pi != NULL && pi->plg_syntax_values2keys != NULL ) {
  446. rc = pi->plg_syntax_values2keys( pb, vals, ivals, ftype );
  447. }
  448. LDAPDebug( LDAP_DEBUG_FILTER,
  449. "<= slapi_call_syntax_values2keys %d\n", rc, 0, 0 );
  450. return( rc );
  451. }
  452. SLAPI_DEPRECATED int
  453. slapi_call_syntax_assertion2keys_ava( /* JCM SLOW FUNCTION */
  454. void *vpi,
  455. struct berval *val,
  456. struct berval ***ivals,
  457. int ftype
  458. )
  459. {
  460. int rc;
  461. Slapi_Value svin;
  462. Slapi_Value **svout= NULL;
  463. slapi_value_init_berval(&svin, val);
  464. rc= slapi_call_syntax_assertion2keys_ava_sv(vpi,&svin,&svout,ftype);
  465. valuearray_get_bervalarray(svout,ivals); /* JCM SLOW FUNCTION */
  466. valuearray_free(&svout);
  467. value_done(&svin);
  468. return rc;
  469. }
  470. SLAPI_DEPRECATED int
  471. slapi_call_syntax_assertion2keys_ava_sv(
  472. void *vpi,
  473. Slapi_Value *val,
  474. Slapi_Value ***ivals,
  475. int ftype
  476. )
  477. {
  478. int rc;
  479. Slapi_PBlock pipb;
  480. struct slapdplugin *pi = vpi;
  481. LDAPDebug( LDAP_DEBUG_FILTER,
  482. "=> slapi_call_syntax_assertion2keys_ava\n", 0, 0, 0 );
  483. pblock_init( &pipb );
  484. slapi_pblock_set( &pipb, SLAPI_PLUGIN, vpi );
  485. rc = -1; /* means no assertion2keys function */
  486. if ( pi->plg_syntax_assertion2keys_ava != NULL ) {
  487. rc = pi->plg_syntax_assertion2keys_ava( &pipb, val, ivals, ftype );
  488. }
  489. LDAPDebug( LDAP_DEBUG_FILTER,
  490. "<= slapi_call_syntax_assertion2keys_ava %d\n", rc, 0, 0 );
  491. return( rc );
  492. }
  493. SLAPI_DEPRECATED int
  494. slapi_call_syntax_assertion2keys_sub( /* JCM SLOW FUNCTION */
  495. void *vpi,
  496. char *initial,
  497. char **any,
  498. char *final,
  499. struct berval ***ivals
  500. )
  501. {
  502. int rc;
  503. Slapi_Value **svout= NULL;
  504. rc= slapi_call_syntax_assertion2keys_sub_sv(vpi,initial,any,final,&svout);
  505. valuearray_get_bervalarray(svout,ivals); /* JCM SLOW FUNCTION */
  506. valuearray_free(&svout);
  507. return rc;
  508. }
  509. int
  510. slapi_call_syntax_assertion2keys_sub_sv(
  511. void *vpi,
  512. char *initial,
  513. char **any,
  514. char *final,
  515. Slapi_Value ***ivals
  516. )
  517. {
  518. int rc;
  519. Slapi_PBlock pipb;
  520. struct slapdplugin *pi = vpi;
  521. LDAPDebug( LDAP_DEBUG_FILTER,
  522. "=> slapi_call_syntax_assertion2keys_sub\n", 0, 0, 0 );
  523. pblock_init( &pipb );
  524. slapi_pblock_set( &pipb, SLAPI_PLUGIN, vpi );
  525. rc = -1; /* means no assertion2keys function */
  526. *ivals = NULL;
  527. if ( pi->plg_syntax_assertion2keys_sub != NULL ) {
  528. rc = pi->plg_syntax_assertion2keys_sub( &pipb, initial, any,
  529. final, ivals );
  530. }
  531. LDAPDebug( LDAP_DEBUG_FILTER,
  532. "<= slapi_call_syntax_assertion2keys_sub %d\n", rc, 0, 0 );
  533. return( rc );
  534. }