aboutsummaryrefslogtreecommitdiff
path: root/src/lib/kadm5/logger.c
AgeCommit message (Collapse)AuthorFilesLines
2010-03-10Use KRB5_CONF_ macros instead of strings in the source file for profile ↵Zhanna Tsitkov1-3/+3
config attributes "default" and "logging" git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23798 dc483132-0cff-0310-8789-dd5450dbe970
2009-12-29MITKRB5-SA-2009-003 CVE-2009-3295 KDC null deref in referralsTom Yu1-0/+3
On certain error conditions, prep_reprocess_req() calls kdc_err() with a null pointer as the format string, causing a null dereference and denial of service. Legitimate protocol requests can trigger this problem. ticket: 6608 tags: pullup target_version: 1.7.1 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23533 dc483132-0cff-0310-8789-dd5450dbe970
2009-11-23Check return value of gethostname in krb5_klog_initGreg Hudson1-2/+5
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23313 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-31make mark-cstyleTom Yu1-649/+650
make reindent git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23100 dc483132-0cff-0310-8789-dd5450dbe970
2008-12-29Signed/unsigned fixes and remove unused variableEzra Peisach1-1/+1
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21635 dc483132-0cff-0310-8789-dd5450dbe970
2008-10-20Use strdup in place of malloc/strcpy in many placesGreg Hudson1-4/+1
ticket: 6200 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20898 dc483132-0cff-0310-8789-dd5450dbe970
2008-08-13Open log file for appending only, not also readingAlexandra Ellwood1-1/+1
ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20651 dc483132-0cff-0310-8789-dd5450dbe970
2007-10-22Set close-on-exec flag in most places where file descriptors areKen Raeburn1-0/+4
opened in our libraries (in case another application thread spawns a new process) and in the KDC programs (in case a plugin library spawns a new process). Checked calls to: open fopen THREEPARAMOPEN mkstemp socket accept dup dup2 pipe. In: util lib plugins kdc kadmin/server krb524. The various programs are less critical than the libraries, as any well-written plugin that spawns a new process should close all file descriptors it doesn't need to communicate with the new process. This approach also isn't bulletproof, as the call to set the close-on-exec flag is necessarily a separate call from creating the file descriptor, and the fork call could happen in between them. So plugins should be careful regardless of this patch; it will only reduce the window of potential lossage should a plugin be poorly written. (AFAIK there are currently no plugins that spawn processes where this would be a problem.) Update dependencies. ticket: 5561 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20143 dc483132-0cff-0310-8789-dd5450dbe970
2007-07-12Avoid use of unchecked sprintf in libraries. Use asprintf if theKen Raeburn1-7/+7
output buffer is allocated according to the size of data to be written, or snprintf otherwise. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19703 dc483132-0cff-0310-8789-dd5450dbe970
2007-06-29Attach format attributes to declarations of various message-formattingKen Raeburn1-18/+17
routines under gcc. In a couple of routines, hard-code the preference for using the vsnprintf paths instead of list-of-int-arguments hacks now that we're assuming vsnprintf is available in other places. Installed headers affected: com_err.h (com_err, com_err_va) ss.h (ss_error) krb5.h (krb5_set_error_message, krb5_vset_error_message) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19653 dc483132-0cff-0310-8789-dd5450dbe970
2007-04-03MITKRB5-SA-2007-002: buffer overflow in krb5_klog_syslogTom Yu1-3/+7
Fix MITKRB5-SA-2007-002: buffer overflow in krb5_klog_syslog. * src/lib/krb5/krb/get_in_tkt.c (krb5_klog_syslog): Use vsnprintf if available. Everything else: use precision fields on "%s" specifiers to truncate logged strings, in case someone doesn't have vsnprintf. ticket: new target_version: 1.6.1 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19395 dc483132-0cff-0310-8789-dd5450dbe970
2007-01-20Remove varargs.h paths, always use stdarg.hKen Raeburn1-4/+0
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19088 dc483132-0cff-0310-8789-dd5450dbe970
2006-06-19Make local const array of structures static tooKen Raeburn1-1/+1
ticket: 3276 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18165 dc483132-0cff-0310-8789-dd5450dbe970
2006-06-01krb5 1.5 alpha - memory leaks in krb5kdc due to not freeing error messages Ezra Peisach1-1/+4
In the kdc and lib/kadm5/logger.c, krb5_get_error_message needs to be paired with krb5_free_error_message to release returned memory. Essentially a memory leak was introduced for every principal requested that did not exist in the database. Identified by valgrind on the kdc - running kdc_hammer and specifying more principals than are present in the db. ticket: new tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18072 dc483132-0cff-0310-8789-dd5450dbe970
2006-04-13Partial merge from Novell LDAP integration branch, not including theKen Raeburn1-1/+5
actual LDAP bits: * include/kdb.h (krb5_db_entry_new): Add MASK field indicating what's changed. (KRB5_KDB_SRV_TYPE_*): New macros indicating which type of service is accessing the database. * lib/kadm5/srv/svr_principal.c: Set mask field. * lib/kadm5/srv/server_misc.c, server_init.c: Pass service type to krb5_db_open. * kadmin/dbutil/kdb5_stash.c (kdb5_stash): Pass service type to krb5_db_open. * kadmin/dbutil/kdb5_util.c (open_db_and_mkey): Pass service type to krb5_db_open. * kdc/main.c (init_realm): Pass service type to krb5_db_open. * lib/kadm5/srv/svr_principal.c: Set mask field. * kadmin/dbutil/dump.c (load_db): Pass service type to krb5_db_open. * lib/kdb/kdb5.h (KRB5_KDB_SRV_TYPE_*): New macros. * lib/kdb/err_handle.{c,h}: Deleted. * lib/kadm5/clnt/err_handle.{c,h}: Deleted. (krb5_db_clr_error): Declaration deleted. * lib/kdb/Makefile.in, lib/kadm5/clnt/Makefile.in: Don't build them. * lib/kdb/kdb5.c, lib/kadm5/clnt, lib/kadm5/srv: Use new error-message API. * kdc/do_tgs_req.c (process_tgs_req): Use new error-message API. * kdc/kdc_preauth.c (check_padata) * kdc/do_as_req.c (process_as_req): * kdc/main.c (init_realm): * kadmin/server/ovsec_kadmd.c (main, do_schpw): * schpw.c (process_chpw_request): * kadmin/server/server_stubs.c: * kadmin/cli/kadmin.c (extended_com_err_fn): New function. (kadmin_startup): Tell com_err library to use it, for kadmin.local. * lib/kdb/libkdb5.exports: Don't export krb5_db_clr_error. * lib/kdb/Makefile.in: (SRCS, STLIBOBJS): Don't build err_handle.c. * lib/kdb/kdb5.c (kdb_load_library): Don't pass argument to init_library. (krb5_db_clr_error): Function deleted. * lib/kdb/kdb5.h (struct _kdb_vftabl): Remove argument from init_library field. * lib/kadm5/logger.c (krb5_klog_init): Save the krb5_context pointer. (klog_com_err_proc): Use it, and call new error-message API. * lib/kadm5/srv/svr_principal.c: Use new error-message API. * kadmin/dbutil/kdb5_util.c (extended_com_err_fn): New function. (main): Tell com_err library to use it. * plugins/kdb/db2: Use new error-message APIs and updated DAL interface. * lib/kadm5/kadm_rpc.h: Delete err_str fields. * lib/kadm5/kadm_rpc_xdr.c: Don't process them. * kadmin/server/server_stubs.c: Don't use ret.err_str field. * include/k5-thread.h (k5_key_t): Deleted unused values. * lib/kdb/kdb5.h (KDB_MODULE_SECTION): Change db_modules to dbmodules. (KDB_MODULE_DEF_SECTION): New macro. * tests/Makefile.in (krb5.conf): Rename db_modules to dbmodules. * tests/dejagnu/config/default.exp (setup_krb5_conf): Likewise. * kadmin/testing/proto/krb5.conf.proto: Likewise. * lib/kdb/libkdb5.exports: Do export krb5_def_store_mkey. * lib/kadm5/admin.h (KADM5_CPW_FUNCTION, KADM5_RANDKEY_USED): New macros. (struct _kadm5_config_params): New field kpasswd_server. * lib/krb5/error_tables/kdb5_err.et (KRB5_KDB_SERVER_INTERNAL_ERR): New error code. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17899 dc483132-0cff-0310-8789-dd5450dbe970
2002-09-18protoizeKen Raeburn1-32/+6
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14877 dc483132-0cff-0310-8789-dd5450dbe970
2001-10-10 logger.c (krb5_klog_init): Initialize savec to keep compiler happyKen Raeburn1-1/+1
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13793 dc483132-0cff-0310-8789-dd5450dbe970
2001-10-06Danilo also says we can get rid of _MSDOS (Win16) tests, and explicit ↵Ken Raeburn1-5/+0
FAR/NEAR specs git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13786 dc483132-0cff-0310-8789-dd5450dbe970
2001-07-09 * logger.c (severity2string): Declare as returning const char *.Ezra Peisach1-5/+5
(klog_com_err_proc): Do not discard const status of format string. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13591 dc483132-0cff-0310-8789-dd5450dbe970
2001-06-21oops, missed a changeKen Raeburn1-3/+0
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13428 dc483132-0cff-0310-8789-dd5450dbe970
2001-06-21* logger.c (krb5_klog_init) [HAVE_SYSLOG]: Loop over an array of syslogKen Raeburn1-51/+38
facility names rather than open-coding each check. Add "authpriv" and "ftp" names. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13427 dc483132-0cff-0310-8789-dd5450dbe970
2001-06-18 * alt_prof.c (krb5_read_realm_params): Cast argument to isspace()Ezra Peisach1-2/+2
to int. * logger.c (krb5_klog_init): Likewise. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13370 dc483132-0cff-0310-8789-dd5450dbe970
2001-06-18 * logger.c (klog_vsyslog): If krb5_klog_init() is not called, doEzra Peisach1-1/+14
not pass a NULL pointer to vsprintf for a %s format. Also, if syslog() exists on the system, fallback to using this so the message is not dropped on the floor. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13357 dc483132-0cff-0310-8789-dd5450dbe970
2001-06-04 * logger.c (krb5_klog_init): Cleanup assignments inEzra Peisach1-9/+18
conditionals. Ensure that if hostname is MAXHOSTNAMELEN, buffer is \0 terminated. * str_conv.c (krb5_string_to_keysalts, krb5_keysalt_iterate): Clean up assignments in conditionals. * admin.h: Move kadm5_free_name_list() to version 1 api as it is present in the ovsec_glue layer. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13263 dc483132-0cff-0310-8789-dd5450dbe970
2000-06-27pullup from 1.2 branchKen Raeburn1-2/+3
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12442 dc483132-0cff-0310-8789-dd5450dbe970
1999-12-06* logger.c (klog_vsyslog): Convert pid_t to long for printingKen Raeburn1-2/+2
* alt_prof.c (kadm5_get_config_params): Fix bug in direction of test while walking through whitespace. Thanks to Matt Crawford. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11951 dc483132-0cff-0310-8789-dd5450dbe970
1999-09-29replace char arrays with macros for gcc format checking; provide format str ↵Ken Raeburn1-15/+15
to syslog git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11856 dc483132-0cff-0310-8789-dd5450dbe970
1999-09-24copyright and fprintf-format changes from 1.1Ken Raeburn1-9/+10
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11852 dc483132-0cff-0310-8789-dd5450dbe970
1998-07-08These additions cause the KDC to react to SIGHUP by closing andGeoffrey King1-0/+39
reopening its log files, so that logfile management utilities may now compress old logs and then kill -HUP the KDC process to get them to use fresh log files. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10627 dc483132-0cff-0310-8789-dd5450dbe970
1997-10-07Include ctype.h for isspace declarationEzra Peisach1-0/+1
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10210 dc483132-0cff-0310-8789-dd5450dbe970
1996-10-15 * logger.c (krb5_klog_init): remember to call openlog() whenBarry Jaspan1-1/+5
defaulting to syslog because nothing else was specified (klog_vsyslog): enable VERBOSE_LOGS so we get the process name and pid [krb5-kdc/63] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9179 dc483132-0cff-0310-8789-dd5450dbe970
1996-07-22this commit includes all the changes on the OV_9510_INTEGRATION andMarc Horowitz1-0/+940
OV_MERGE branches. This includes, but is not limited to, the new openvision admin system, and major changes to gssapi to add functionality, and bring the implementation in line with rfc1964. before committing, the code was built and tested for netbsd and solaris. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8774 dc483132-0cff-0310-8789-dd5450dbe970