diff options
author | Rich Megginson <rmeggins@redhat.com> | 2006-04-11 02:14:54 +0000 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2006-04-11 02:14:54 +0000 |
commit | e8c67e58c2faa3e3f5d328a92391a5a6a4569620 (patch) | |
tree | 7e16092b4dfb0106f446bb6a79552004399f7155 /ldap/servers/slapd/proto-slap.h | |
parent | 9545e36805201ac0e3172b762373c6df741c2721 (diff) | |
download | ds-e8c67e58c2faa3e3f5d328a92391a5a6a4569620.tar.gz ds-e8c67e58c2faa3e3f5d328a92391a5a6a4569620.tar.xz ds-e8c67e58c2faa3e3f5d328a92391a5a6a4569620.zip |
Bug(s) fixed: 186280
Bug Description: ldapserver: Close potential security vulnerabilities in CGI code
Reviewed by: Nathan, Noriko, and Pete (Thanks!)
Fix Description: Clean up usage of sprintf, strcpy, fgets instead of
gets, fixed buffer usage, etc., mostly in the CGI code and other user
facing code (i.e. setup). Also, Steve Grubb told me about a GCC trick
to force it to check printf style varargs functions, to check the format
string against the argument string, for type mismatches, missing
arguments, and too many arguments.
In the CGI form argument parsing code, we needed to be more careful
about checking for bad input - good input is supposed to look like this:
name=value&name=value&.....
&name=value. I don't think the original code
was checking properly for something like name&name=value.
There was another place where we were not checking to see if a buffer
had enough room before appending a string to it.
I had to change a couple of functions to allow passing in the size of
the buffer.
Fixed some issues raised by Noriko and Nathan.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Diffstat (limited to 'ldap/servers/slapd/proto-slap.h')
-rw-r--r-- | ldap/servers/slapd/proto-slap.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h index 30f88b5c..e150a003 100644 --- a/ldap/servers/slapd/proto-slap.h +++ b/ldap/servers/slapd/proto-slap.h @@ -557,7 +557,13 @@ int lock_fclose( FILE *fp, FILE *lfp ); * log.c */ int slapd_log_error_proc( char *subsystem, char *fmt, ... ); -int slapi_log_access( int level, char *fmt, ... ); + +int slapi_log_access( int level, char *fmt, ... ) +#ifdef __GNUC__ + __attribute__ ((format (printf, 2, 3))); +#else + ; +#endif int slapd_log_audit_proc(char *buffer, int buf_len); void log_access_flush(); |