mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-18 18:18:06 -05:00
Added ldapsearch bad filter pattern check (ITS#4647)
This commit is contained in:
parent
b8fc3a5ffb
commit
04a2843aaf
2 changed files with 21 additions and 0 deletions
1
CHANGES
1
CHANGES
|
|
@ -1,6 +1,7 @@
|
|||
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 ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue