[Pkg-dspam-commits] [pkg-dspam-commits] r126 - in trunk/debian: . patches

Kurt B. Kaiser kbk-guest at alioth.debian.org
Sun Jan 13 21:30:53 UTC 2008


Author: kbk-guest
Date: Sun Jan 13 21:30:53 2008
New Revision: 126

Log:
Upstream Patch (Closes: #385353)
In daemon mode, dspam occasionally crashes with 'Unable to determine
the runtime user'

A    debian/patches/determine_runtime_user
M    debian/changelog


Added:
   trunk/debian/patches/determine_runtime_user
Modified:
   trunk/debian/changelog

Modified: trunk/debian/changelog
==============================================================================
--- trunk/debian/changelog	(original)
+++ trunk/debian/changelog	Sun Jan 13 21:30:53 2008
@@ -3,8 +3,9 @@
   [Kurt B. Kaiser]
   * Acknowledge NMU. Thanks Adrian Friedli.  (Closes: #448519)
   * dspamc should be setgid (Closes: #449530)
+  * daemon crashes sometimes, can't determine user (Closes: #385353)
 
- -- Debian DSPAM Maintainers <pkg-dspam-misc at lists.alioth.debian.org>  Sun, 13 Jan 2008 15:50:42 -0500
+ -- Debian DSPAM Maintainers <pkg-dspam-misc at lists.alioth.debian.org>  Sun, 13 Jan 2008 16:07:35 -0500
 
 dspam (3.6.8-5.1) unstable; urgency=medium
 

Added: trunk/debian/patches/determine_runtime_user
==============================================================================
--- (empty file)
+++ trunk/debian/patches/determine_runtime_user	Sun Jan 13 21:30:53 2008
@@ -0,0 +1,53 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## determine_runtime_user.dpatch by kbk at shore.net from upstream.
+##
+## DP: in daemon mode, dspam occasionally crashes with
+## DP: 'Unable to determine the runtime user'.  (Closes: #385353)
+## DP: http://thread.gmane.org/gmane.mail.qmail.simscan/3301/focus=3327
+
+ at DPATCH@
+
+--- dspam-3.6.8~/src/dspamc.c       2006-05-13 21:47:30.000000000 +0930
++++ dspam-3.6.8/src/dspamc.c        2007-06-15 13:30:34.000000000 +0930
+@@ -95,12 +95,19 @@
+ int
+ main (int argc, char *argv[])
+ {
+-  AGENT_CTX ATX;
++  AGENT_CTX ATX;                /* agent configuration */
++  buffer *message = NULL;       /* input message */
++  int agent_init = 0;           /* agent is initialized */
++  int driver_init = 0;          /* storage driver is initialized */
+   int exitcode = EXIT_SUCCESS;
+-  buffer *message = NULL;       /* input Message */
+-  int agent_init = 0;          /* agent is initialized */
++  struct nt_node *node_nt;
++  struct nt_c c_nt;
++  struct passwd *pwent;
++
++  srand ((long) time << (long) getpid ());
++  umask (006);                  /* rw-rw---- */
++  setbuf (stdout, NULL);        /* unbuffered output */
+
+-  setbuf (stdout, NULL);       /* unbuffered output */
+#ifdef DEBUG
+   DO_DEBUG = 0;
+ #endif
+@@ -113,6 +120,17 @@
+   exit(EXIT_FAILURE);
+ #endif
+
++  /* Cache my username and uid for trusted user security */
++
++  pwent = getpwuid(getuid());
++  if (pwent == NULL) {
++    LOG(LOG_ERR, ERR_AGENT_RUNTIME_USER);
++    exitcode = EXIT_FAILURE;
++    goto BAIL;
++  }
++  __pw_name = strdup(pwent->pw_name);
++  __pw_uid  = pwent->pw_uid;
++
+   /* Read dspam.conf into global config structure (ds_config_t) */
+
+   agent_config = read_config(NULL);



More information about the Pkg-dspam-commits mailing list