return sval;
}
+/*
+ * Next routine will accept a qdstring in place of an oid. This is
+ * necessary to interoperate with Netscape Directory server that
+ * will improperly quote each oid (at least those of the descr kind)
+ * in the SUP clause.
+ */
+
/* Parse a woid or a $-separated list of them enclosed in () */
static char **
parse_oids(char **sp, int *code)
pos = 0;
parse_whsp(sp);
kind = get_token(sp,&sval);
- if ( kind == TK_BAREWORD ) {
+ if ( kind == TK_BAREWORD || kind == TK_QDSTRING ) {
res[pos] = sval;
pos++;
} else {
if ( kind == TK_DOLLAR ) {
parse_whsp(sp);
kind = get_token(sp,&sval);
- if ( kind == TK_BAREWORD ) {
+ if ( kind == TK_BAREWORD ||
+ kind == TK_QDSTRING ) {
if ( pos == size-2 ) {
size++;
res1 = LDAP_REALLOC(res,size*sizeof(char *));
res[pos] = NULL;
parse_whsp(sp);
return(res);
- } else if ( kind == TK_BAREWORD ) {
+ } else if ( kind == TK_BAREWORD || kind == TK_QDSTRING ) {
res = LDAP_CALLOC(2,sizeof(char *));
if ( !res ) {
*code = LDAP_SCHERR_OUTOFMEM;
int seen_may = 0;
LDAP_ATTRIBUTE_TYPE * at;
+ if ( !s ) {
+ *code = LDAP_SCHERR_EMPTY;
+ *errp = "";
+ return NULL;
+ }
+
*errp = s;
at = LDAP_CALLOC(1,sizeof(LDAP_ATTRIBUTE_TYPE));
free_at(at);
return NULL;
}
+ parse_whsp(&ss);
} else if ( !strcmp(sval,"SINGLE-VALUE") ) {
if ( at->at_single_value ) {
*code = LDAP_SCHERR_DUPOPT;
free_at(at);
return NULL;
}
+ parse_whsp(&ss);
} else {
*code = LDAP_SCHERR_UNEXPTOKEN;
*errp = ss;
int seen_may = 0;
LDAP_OBJECT_CLASS * oc;
+ if ( !s ) {
+ *code = LDAP_SCHERR_EMPTY;
+ *errp = "";
+ return NULL;
+ }
+
*errp = s;
oc = LDAP_CALLOC(1,sizeof(LDAP_OBJECT_CLASS));
return(NULL);
}
seen_sup = 1;
- /* Netscape DS is broken or I have not
- understood the syntax. */
- /* oc->oc_sup_oids = parse_oids(&ss,code); */
- oc->oc_sup_oids = parse_qdescrs(&ss,code);
+ oc->oc_sup_oids = parse_oids(&ss,code);
if ( !oc->oc_sup_oids ) {
*errp = ss;
free_oc(oc);
"Expecting a name",
"Bad description",
"Bad superiors",
- "Duplicate option"
+ "Duplicate option",
+ "Unexpected end of data"
};
char *