]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/shell-backends/shellutil.c
filter2bv can't de-normalize UUIDs, must do it explicitly for back-ldap
[openldap] / servers / slapd / shell-backends / shellutil.c
index c672fe8c430ef30241bf7aa5e3718e2f89d7713a..0321061bd4c62970b2d494bbe67d7e66a39a7bb8 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2003 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 );