Don't stick '<null>' in log messages. Run kdb5_util dump with input explicitly from...
authorKen Raeburn <raeburn@mit.edu>
Mon, 17 Nov 2008 21:24:29 +0000 (21:24 +0000)
committerKen Raeburn <raeburn@mit.edu>
Mon, 17 Nov 2008 21:24:29 +0000 (21:24 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21132 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/server/ipropd_svc.c

index a76057cbe858f0da8c2f471e97064439870812d4..f0b704f1a19c8406fcd18f656953d2bba2997b10 100644 (file)
@@ -52,10 +52,8 @@ static char *reply_nil_str   = "UPDATE_NIL";
 static char *reply_perm_str    = "UPDATE_PERM_DENIED";
 static char *reply_unknown_str = "<UNKNOWN_CODE>";
 
-#define        LOG_UNAUTH  _("Unauthorized request: %s, %s, "  \
-                     "client=%s, service=%s, addr=%s")
-#define        LOG_DONE    _("Request: %s, %s, %s, client=%s, "        \
-                     "service=%s, addr=%s")
+#define        LOG_UNAUTH  _("Unauthorized request: %s, client=%s, service=%s, addr=%s")
+#define        LOG_DONE    _("Request: %s, %s, %s, client=%s, service=%s, addr=%s")
 
 #ifdef DPRINT
 #undef DPRINT
@@ -183,7 +181,7 @@ iprop_get_updates_1_svc(kdb_last_t *arg, struct svc_req *rqstp)
        ret.ret = UPDATE_PERM_DENIED;
 
        krb5_klog_syslog(LOG_NOTICE, LOG_UNAUTH, whoami,
-                        "<null>", client_name, service_name,
+                        client_name, service_name,
                         client_addr(rqstp));
        goto out;
     }
@@ -203,7 +201,9 @@ iprop_get_updates_1_svc(kdb_last_t *arg, struct svc_req *rqstp)
                        (unsigned long)arg->last_sno);
     }
 
-    krb5_klog_syslog(LOG_NOTICE, LOG_DONE, whoami,
+    krb5_klog_syslog(LOG_NOTICE,
+                    _("Request: %s, %s, %s, client=%s, service=%s, addr=%s"),
+                    whoami,
                     obuf,
                     ((kret == 0) ? "success" : error_message(kret)),
                     client_name, service_name,
@@ -301,7 +301,7 @@ iprop_full_resync_1_svc(/* LINTED */ void *argp, struct svc_req *rqstp)
        ret.ret = UPDATE_PERM_DENIED;
 
        krb5_klog_syslog(LOG_NOTICE, LOG_UNAUTH, whoami,
-                        "<null>", client_name, service_name,
+                        client_name, service_name,
                         client_addr(rqstp));
        goto out;
     }
@@ -327,8 +327,8 @@ iprop_full_resync_1_svc(/* LINTED */ void *argp, struct svc_req *rqstp)
      * note the -i; modified version of kdb5_util dump format
      * to include sno (serial number)
      */
-    if (asprintf(&ubuf, "%s dump -i %s", KPROPD_DEFAULT_KDB5_UTIL,
-                tmpf) < 0) {
+    if (asprintf(&ubuf, "%s dump -i %s </dev/null 2>&1",
+                KPROPD_DEFAULT_KDB5_UTIL, tmpf) < 0) {
        krb5_klog_syslog(LOG_ERR,
                         _("%s: cannot construct kdb5 util dump string too long; out of memory"),
                         whoami);
@@ -403,9 +403,9 @@ iprop_full_resync_1_svc(/* LINTED */ void *argp, struct svc_req *rqstp)
        ret.lastentry.last_time.seconds = 0;
        ret.lastentry.last_time.useconds = 0;
 
-       krb5_klog_syslog(LOG_NOTICE, LOG_DONE, whoami,
-                        "<null>",
-                        "success",
+       krb5_klog_syslog(LOG_NOTICE,
+                        _("Request: %s, spawned resync process %d, client=%s, service=%s, addr=%s"),
+                        whoami, fret,
                         client_name, service_name,
                         client_addr(rqstp));