[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#382037: Missing programname and PID in syslog-log by PAM



retitle 382037 xdm: missing call to openlog()
kthxbye

On Tue, Aug  8, 2006 at 15:00:58 +0200, General Stone wrote:

> PAM can not locate the PID and also the programname 'xdm'.
> So in the logs are statments like this:
> 
> ->
> Aug  8 14:34:51 workserver1 : (pam_unix) session opened for user
> generalstone by (uid=0)
> <-
> 
> and not:
> 
> Aug  8 14:34:51 workserver1 xdm[34521]: ...
>                             ^^^^^^^^^^
Thanks for your report.  FWIW, my log shows:
Feb 27 21:59:03 patate    : pam_unix(xdm:session): session opened for user julien by julien(uid=0)

It seems that xdm doesn't call openlog(), so the identifier defaults to
null when pam calls syslog().
Alan, do you know why the call to openlog() is conditional on
__OpenBSD__?  I think we should add it on linux too (something like the
attached patch).

Cheers,
Julien
From 8d2765bcaf820c3f67a187ee29d89657fb6ea8ed Mon Sep 17 00:00:00 2001
From: Julien Cristau <jcristau@debian.org>
Date: Thu, 28 Feb 2008 15:12:31 +0100
Subject: [PATCH] greeter: call openlog() on linux

This sets the identifier for subsequent pam log messages.
Debian bug#382037 (http://bugs.debian.org/382037)
---
 greeter/greet.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/greeter/greet.c b/greeter/greet.c
index 0aabec7..c832e4b 100644
--- a/greeter/greet.c
+++ b/greeter/greet.c
@@ -83,7 +83,7 @@ from The Open Group.
 #include "greet.h"
 #include "Login.h"
 
-#ifdef __OpenBSD__
+#if defined(__OpenBSD__) || defined(__linux__)
 #include <syslog.h>
 #endif
 
@@ -485,8 +485,10 @@ greet_user_rtn GreetUser(
 	LogError ("Cannot reopen display %s for greet window\n", d->name);
 	exit (RESERVER_DISPLAY);
     }
-#ifdef __OpenBSD__
+#if defined(__OpenBSD__)
     openlog("xdm", LOG_ODELAY, LOG_AUTH);
+#elif defined(__linux__)
+    openlog("xdm", LOG_PID, LOG_AUTHPRIV);
 #endif
 
     for (;;) {
-- 
1.5.4.3

Attachment: signature.asc
Description: Digital signature


Reply to: