+2001-06-04 Ezra Peisach <epeisach@mit.edu>
+
+ * logger.c (krb5_klog_init): Cleanup assignments in
+ 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.
+
2001-03-10 Ezra Peisach <epeisach@kangaroo.mit.edu>
* str_conv.c: Include adm_proto.h for missing prototypes.
/*
* Find the end of the severity.
*/
- if (cp2 = strchr(&cp[7], ':')) {
+ cp2 = strchr(&cp[7], ':');
+ if (cp2) {
savec = *cp2;
*cp2 = '\0';
cp2++;
* Is this a standard error specification?
*/
else if (!strcasecmp(cp, "STDERR")) {
- if (log_control.log_entries[i].lfu_filep =
- fdopen(fileno(stderr), "a+")) {
+ log_control.log_entries[i].lfu_filep =
+ fdopen(fileno(stderr), "a+");
+ if (log_control.log_entries[i].lfu_filep) {
log_control.log_entries[i].log_type = K_LOG_STDERR;
log_control.log_entries[i].lfu_fname =
"standard error";
* Is this a specification of the console?
*/
else if (!strcasecmp(cp, "CONSOLE")) {
- if (log_control.log_entries[i].ldu_filep =
- CONSOLE_OPEN("a+")) {
+ log_control.log_entries[i].ldu_filep =
+ CONSOLE_OPEN("a+");
+ if (log_control.log_entries[i].ldu_filep) {
log_control.log_entries[i].log_type = K_LOG_CONSOLE;
log_control.log_entries[i].ldu_devname = "console";
}
* We handle devices very similarly to files.
*/
if (cp[6] == '=') {
- if (log_control.log_entries[i].ldu_filep =
- DEVICE_OPEN(&cp[7], "w")) {
+ log_control.log_entries[i].ldu_filep =
+ DEVICE_OPEN(&cp[7], "w");
+ if (log_control.log_entries[i].ldu_filep) {
log_control.log_entries[i].log_type = K_LOG_DEVICE;
log_control.log_entries[i].ldu_devname = &cp[7];
}
log_control.log_nentries = 1;
}
if (log_control.log_nentries) {
- if (log_control.log_whoami = (char *) malloc(strlen(whoami)+1))
+ log_control.log_whoami = (char *) malloc(strlen(whoami)+1);
+ if (log_control.log_whoami)
strcpy(log_control.log_whoami, whoami);
- if (log_control.log_hostname = (char *) malloc(MAXHOSTNAMELEN))
+
+ log_control.log_hostname = (char *) malloc(MAXHOSTNAMELEN + 1);
+ if (log_control.log_hostname) {
gethostname(log_control.log_hostname, MAXHOSTNAMELEN);
+ log_control.log_hostname[MAXHOSTNAMELEN] = '\0';
+ }
#ifdef HAVE_OPENLOG
if (do_openlog) {
openlog(whoami, LOG_NDELAY|LOG_PID, log_facility);
len = (size_t) *nksaltp;
/* Get new keysalt array */
- if (*ksaltp = (krb5_key_salt_tuple *)
- malloc((len + 1) * sizeof(krb5_key_salt_tuple))) {
+ *ksaltp = (krb5_key_salt_tuple *)
+ malloc((len + 1) * sizeof(krb5_key_salt_tuple));
+ if (*ksaltp) {
/* Copy old keysalt if appropriate */
if (savep) {
i,
scratch.ks_enctype,
scratch.ks_salttype)) {
- if (kret = (*iterator)(&scratch, arg))
+ kret = (*iterator)(&scratch, arg);
+ if (kret)
break;
}
}