Commit 04a2843a authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Added ldapsearch bad filter pattern check (ITS#4647)

parent b8fc3a5f
OpenLDAP 2.3 Change Log
OpenLDAP 2.3.28 Engineering
Added ldapsearch bad filter pattern check (ITS#4647)
OpenLDAP 2.3.27 Release
Fixed libldap dangling pointer issue (previous fix was broken) (ITS#4405)
......
......@@ -611,12 +611,32 @@ main( int argc, char **argv )
}
if ( infile != NULL ) {
int percent = 0;
if ( infile[0] == '-' && infile[1] == '\0' ) {
fp = stdin;
} else if (( fp = fopen( infile, "r" )) == NULL ) {
perror( infile );
return EXIT_FAILURE;
}
for( i=0 ; filtpattern[i] ; i++ ) {
if( filtpattern[i] == '%' ) {
if( percent ) {
fprintf( stderr, _("Bad filter pattern \"%s\"\n"),
filtpattern );
return EXIT_FAILURE;
}
percent++;
if( filtpattern[i+1] != 's' ) {
fprintf( stderr, _("Bad filter pattern \"%s\"\n"),
filtpattern );
return EXIT_FAILURE;
}
}
}
}
if ( tmpdir == NULL ) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment