diff -u rsyslog-4.2.0/debian/changelog rsyslog-4.2.0/debian/changelog --- rsyslog-4.2.0/debian/changelog +++ rsyslog-4.2.0/debian/changelog @@ -1,3 +1,13 @@ +rsyslog (4.2.0-2ubuntu2) karmic; urgency=low + + * Fix log file ownership issues when HUPing an unprivileged rsyslog + LP: #407862 + - debian/rsyslog.conf: Set $FileOwner to syslog + - debian/patches/deroot.patch: Always chown output files, since we may + not be able to read them on a HUP otherwise. + + -- Michael Terry Mon, 31 Aug 2009 14:58:50 -0400 + rsyslog (4.2.0-2ubuntu1) karmic; urgency=low [ Michael Terry ] diff -u rsyslog-4.2.0/debian/rsyslog.conf rsyslog-4.2.0/debian/rsyslog.conf --- rsyslog-4.2.0/debian/rsyslog.conf +++ rsyslog-4.2.0/debian/rsyslog.conf @@ -38,7 +38,7 @@ # # Set the default permissions for all log files. # -$FileOwner root +$FileOwner syslog $FileGroup adm $FileCreateMode 0640 $DirCreateMode 0755 diff -u rsyslog-4.2.0/debian/patches/deroot.patch rsyslog-4.2.0/debian/patches/deroot.patch --- rsyslog-4.2.0/debian/patches/deroot.patch +++ rsyslog-4.2.0/debian/patches/deroot.patch @@ -1,7 +1,7 @@ -Index: rsyslog-4.2.0-2ubuntu1/tools/syslogd.c +Index: rsyslog-4.2.0/tools/syslogd.c =================================================================== ---- rsyslog-4.2.0-2ubuntu1.orig/tools/syslogd.c 2009-08-13 14:59:42.000000000 -0400 -+++ rsyslog-4.2.0-2ubuntu1/tools/syslogd.c 2009-08-13 14:59:42.000000000 -0400 +--- rsyslog-4.2.0.orig/tools/syslogd.c 2009-08-31 14:47:13.000000000 -0400 ++++ rsyslog-4.2.0/tools/syslogd.c 2009-08-31 14:47:13.000000000 -0400 @@ -2291,6 +2291,30 @@ } @@ -110,10 +110,10 @@ /* END OF INTIALIZATION * ... but keep in mind that we might do a restart and thus init() might * be called again. If that happens, we must shut down the worker thread, -Index: rsyslog-4.2.0-2ubuntu1/plugins/imklog/bsd.c +Index: rsyslog-4.2.0/plugins/imklog/bsd.c =================================================================== ---- rsyslog-4.2.0-2ubuntu1.orig/plugins/imklog/bsd.c 2009-08-13 14:26:00.000000000 -0400 -+++ rsyslog-4.2.0-2ubuntu1/plugins/imklog/bsd.c 2009-08-13 14:59:42.000000000 -0400 +--- rsyslog-4.2.0.orig/plugins/imklog/bsd.c 2009-06-14 06:25:11.000000000 -0400 ++++ rsyslog-4.2.0/plugins/imklog/bsd.c 2009-08-31 14:47:13.000000000 -0400 @@ -83,6 +83,11 @@ # define _PATH_KLOG "/dev/klog" #endif @@ -138,10 +138,10 @@ iRet = RS_RET_ERR; // TODO: better error code } -Index: rsyslog-4.2.0-2ubuntu1/plugins/imklog/imklog.c +Index: rsyslog-4.2.0/plugins/imklog/imklog.c =================================================================== ---- rsyslog-4.2.0-2ubuntu1.orig/plugins/imklog/imklog.c 2009-08-13 14:26:00.000000000 -0400 -+++ rsyslog-4.2.0-2ubuntu1/plugins/imklog/imklog.c 2009-08-13 14:59:42.000000000 -0400 +--- rsyslog-4.2.0.orig/plugins/imklog/imklog.c 2009-06-22 13:11:10.000000000 -0400 ++++ rsyslog-4.2.0/plugins/imklog/imklog.c 2009-08-31 14:47:13.000000000 -0400 @@ -44,6 +44,7 @@ #include #include @@ -186,10 +186,10 @@ CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogsymbollookup", 0, eCmdHdlrBinary, NULL, &symbol_lookup, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogsymbolstwice", 0, eCmdHdlrBinary, NULL, &symbols_twice, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogusesyscallinterface", 0, eCmdHdlrBinary, NULL, &use_syscall, STD_LOADABLE_MODULE_ID)); -Index: rsyslog-4.2.0-2ubuntu1/plugins/imklog/imklog.h +Index: rsyslog-4.2.0/plugins/imklog/imklog.h =================================================================== ---- rsyslog-4.2.0-2ubuntu1.orig/plugins/imklog/imklog.h 2009-08-13 14:26:00.000000000 -0400 -+++ rsyslog-4.2.0-2ubuntu1/plugins/imklog/imklog.h 2009-08-13 14:59:42.000000000 -0400 +--- rsyslog-4.2.0.orig/plugins/imklog/imklog.h 2009-06-14 06:25:11.000000000 -0400 ++++ rsyslog-4.2.0/plugins/imklog/imklog.h 2009-08-31 14:47:13.000000000 -0400 @@ -52,6 +52,7 @@ extern char *symfile; extern int console_log_level; @@ -198,10 +198,10 @@ /* the functions below may be called by the drivers */ rsRetVal imklogLogIntMsg(int priority, char *fmt, ...) __attribute__((format(printf,2, 3))); -Index: rsyslog-4.2.0-2ubuntu1/plugins/imklog/linux.c +Index: rsyslog-4.2.0/plugins/imklog/linux.c =================================================================== ---- rsyslog-4.2.0-2ubuntu1.orig/plugins/imklog/linux.c 2009-08-13 14:59:38.000000000 -0400 -+++ rsyslog-4.2.0-2ubuntu1/plugins/imklog/linux.c 2009-08-13 15:00:13.000000000 -0400 +--- rsyslog-4.2.0.orig/plugins/imklog/linux.c 2009-06-18 05:11:03.000000000 -0400 ++++ rsyslog-4.2.0/plugins/imklog/linux.c 2009-08-31 14:47:13.000000000 -0400 @@ -84,6 +84,11 @@ extern int ksyslog(int type, char *buf, int len); @@ -245,10 +245,10 @@ return(proc); } -Index: rsyslog-4.2.0-2ubuntu1/runtime/modules.c +Index: rsyslog-4.2.0/runtime/modules.c =================================================================== ---- rsyslog-4.2.0-2ubuntu1.orig/runtime/modules.c 2009-08-13 14:26:00.000000000 -0400 -+++ rsyslog-4.2.0-2ubuntu1/runtime/modules.c 2009-08-13 14:59:42.000000000 -0400 +--- rsyslog-4.2.0.orig/runtime/modules.c 2009-06-22 13:11:10.000000000 -0400 ++++ rsyslog-4.2.0/runtime/modules.c 2009-08-31 14:47:13.000000000 -0400 @@ -390,6 +390,7 @@ CHKiRet((*pNew->modQueryEtryPt)((uchar*)"runInput", &pNew->mod.im.runInput)); CHKiRet((*pNew->modQueryEtryPt)((uchar*)"willRun", &pNew->mod.im.willRun)); @@ -257,10 +257,10 @@ break; case eMOD_OUT: CHKiRet((*pNew->modQueryEtryPt)((uchar*)"freeInstance", &pNew->freeInstance)); -Index: rsyslog-4.2.0-2ubuntu1/runtime/modules.h +Index: rsyslog-4.2.0/runtime/modules.h =================================================================== ---- rsyslog-4.2.0-2ubuntu1.orig/runtime/modules.h 2009-08-13 14:26:00.000000000 -0400 -+++ rsyslog-4.2.0-2ubuntu1/runtime/modules.h 2009-08-13 14:59:42.000000000 -0400 +--- rsyslog-4.2.0.orig/runtime/modules.h 2009-06-22 13:11:10.000000000 -0400 ++++ rsyslog-4.2.0/runtime/modules.h 2009-08-31 14:47:13.000000000 -0400 @@ -106,6 +106,7 @@ rsRetVal (*runInput)(thrdInfo_t*); /* function to gather input and submit to queue */ rsRetVal (*willRun)(void); /* function to gather input and submit to queue */ @@ -271,0 +272,20 @@ +Index: rsyslog-4.2.0/tools/omfile.c +=================================================================== +--- rsyslog-4.2.0.orig/tools/omfile.c 2009-08-31 14:47:37.000000000 -0400 ++++ rsyslog-4.2.0/tools/omfile.c 2009-08-31 14:48:30.000000000 -0400 +@@ -421,6 +421,7 @@ + */ + pData->fd = open((char*) newFileName, O_WRONLY|O_APPEND|O_CREAT|O_NOCTTY|O_CLOEXEC, + pData->fCreateMode); ++ } + if(pData->fd != -1) { + /* check and set uid/gid */ + if(pData->fileUID != (uid_t)-1 || pData->fileGID != (gid_t) -1) { +@@ -438,7 +439,6 @@ + } + } + } +- } + finalize_it: + /* this was "pData->fd != 0", which I think was a bug. I guess 0 was intended to mean + * non-open file descriptor. Anyhow, I leave this comment for the time being to that if