X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fshell-backends%2Fshellutil.c;h=0321061bd4c62970b2d494bbe67d7e66a39a7bb8;hb=4a87798893cb529d32cd77d50eab95cb361aa185;hp=2731b52b8676a3b55814d68e8b5c4de10c6ed99a;hpb=dc0eacd40b625258355eea866d62188e5aa7ce3b;p=openldap diff --git a/servers/slapd/shell-backends/shellutil.c b/servers/slapd/shell-backends/shellutil.c index 2731b52b86..0321061bd4 100644 --- a/servers/slapd/shell-backends/shellutil.c +++ b/servers/slapd/shell-backends/shellutil.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2005 The OpenLDAP Foundation. + * Copyright 1998-2006 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -185,21 +185,32 @@ parse_input( FILE *ifp, FILE *ofp, struct ldop *op ) op->ldop_dn = estrdup( args ); break; case IP_TYPE_SCOPE: - if (( op->ldop_srch.ldsp_scope = atoi( args )) != LDAP_SCOPE_BASE && + if ( lutil_atoi( &op->ldop_srch.ldsp_scope, args ) != 0 || + ( op->ldop_srch.ldsp_scope != LDAP_SCOPE_BASE && op->ldop_srch.ldsp_scope != LDAP_SCOPE_ONELEVEL && - op->ldop_srch.ldsp_scope != LDAP_SCOPE_SUBTREE ) { + op->ldop_srch.ldsp_scope != LDAP_SCOPE_SUBTREE ) ) + { write_result( ofp, LDAP_OTHER, NULL, "Bad scope" ); return( -1 ); } break; case IP_TYPE_ALIASDEREF: - op->ldop_srch.ldsp_aliasderef = atoi( args ); + if ( lutil_atoi( &op->ldop_srch.ldsp_aliasderef, args ) != 0 ) { + write_result( ofp, LDAP_OTHER, NULL, "Bad alias deref" ); + return( -1 ); + } break; case IP_TYPE_SIZELIMIT: - op->ldop_srch.ldsp_sizelimit = atoi( args ); + if ( lutil_atoi( &op->ldop_srch.ldsp_sizelimit, args ) != 0 ) { + write_result( ofp, LDAP_OTHER, NULL, "Bad size limit" ); + return( -1 ); + } break; case IP_TYPE_TIMELIMIT: - op->ldop_srch.ldsp_timelimit = atoi( args ); + if ( lutil_atoi( &op->ldop_srch.ldsp_timelimit, args ) != 0 ) { + write_result( ofp, LDAP_OTHER, NULL, "Bad time limit" ); + return( -1 ); + } break; case IP_TYPE_FILTER: op->ldop_srch.ldsp_filter = estrdup( args );