diff options
author | Nathan Kinder <nkinder@redhat.com> | 2009-05-08 09:14:42 -0700 |
---|---|---|
committer | Nathan Kinder <nkinder@redhat.com> | 2009-05-08 09:14:42 -0700 |
commit | d19eafcd211d89cffdac1b2c3432087443e7d122 (patch) | |
tree | 26d2b7f956c2ceaa3f605a42552a113e156b5b30 /ldap/servers/slapd/pblock.c | |
parent | 5d3d883251dd15cf719181e33fb6954454869822 (diff) | |
download | ds-d19eafcd211d89cffdac1b2c3432087443e7d122.tar.gz ds-d19eafcd211d89cffdac1b2c3432087443e7d122.tar.xz ds-d19eafcd211d89cffdac1b2c3432087443e7d122.zip |
Added capability to validate syntax of values being added to the database. Also added numericstring syntax support.
For more details, see the design doc at http://directory.fedoraproject.org/wiki/Syntax_Validation_Design
Diffstat (limited to 'ldap/servers/slapd/pblock.c')
-rw-r--r-- | ldap/servers/slapd/pblock.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c index 6ac6aa8e..062a87f8 100644 --- a/ldap/servers/slapd/pblock.c +++ b/ldap/servers/slapd/pblock.c @@ -1072,6 +1072,12 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) case SLAPI_SYNTAX_SUBSTRLENS: (*(int **)value) = pblock->pb_substrlens; break; + case SLAPI_PLUGIN_SYNTAX_VALIDATE: + if ( pblock->pb_plugin->plg_type != SLAPI_PLUGIN_SYNTAX ) { + return( -1 ); + } + (*(int *)value) = pblock->pb_plugin->plg_syntax_validate; + break; /* controls we know about */ case SLAPI_MANAGEDSAIT: @@ -2314,6 +2320,12 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) case SLAPI_SYNTAX_SUBSTRLENS: pblock->pb_substrlens = (int *) value; break; + case SLAPI_PLUGIN_SYNTAX_VALIDATE: + if ( pblock->pb_plugin->plg_type != SLAPI_PLUGIN_SYNTAX ) { + return( -1 ); + } + pblock->pb_plugin->plg_syntax_validate = (IFP) value; + break; case SLAPI_ENTRY_PRE_OP: pblock->pb_pre_op_entry = (Slapi_Entry *) value; break; |