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/schema.c | |
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/schema.c')
-rw-r--r-- | ldap/servers/slapd/schema.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ldap/servers/slapd/schema.c b/ldap/servers/slapd/schema.c index 6ce43a52..e3ca1685 100644 --- a/ldap/servers/slapd/schema.c +++ b/ldap/servers/slapd/schema.c @@ -151,7 +151,13 @@ static int schema_strcmp_array( char **sa1, char **sa2, const char *ignorestr ); static PRBool schema_type_is_interesting( const char *type ); static void schema_create_errormsg( char *errorbuf, size_t errorbufsize, - const char *prefix, const char *name, const char *fmt, ... ); + const char *prefix, const char *name, const char *fmt, ... ) +#ifdef __GNUC__ + __attribute__ ((format (printf, 5, 6))); +#else + ; +#endif + /* Some utility functions for dealing with a dynamic buffer */ @@ -4066,7 +4072,7 @@ init_schema_dse(const char *configdir) { slapi_log_error(SLAPI_LOG_FATAL, "schema", "Could not add" " attribute type \"objectClass\" to the schema: %s\n", - errorbuf, 0, 0); + errorbuf); } rc = dse_read_file(pschemadse, &pb); |