ports/115582: [MAINTAINER-UPDATE] sysutils/bacula-server - repair PID

Dan Langille dan at langille.org
Thu Aug 16 18:40:02 UTC 2007


>Number:         115582
>Category:       ports
>Synopsis:       [MAINTAINER-UPDATE] sysutils/bacula-server - repair PID
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 16 18:40:02 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Dan Langille
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
The FreeBSD Diary
>Environment:
System: FreeBSD bast.example.org 6.2-STABLE FreeBSD 6.2-STABLE #3: Wed Feb 28 22:21:12 EST 2007     dan at bast.example.org:/usr/obj/usr/src/sys/BAST  i386


	
>Description:
	
The code has a PID/priv issue.  See bug # 932 at http://bugs.bacula.org/
In short, it was dropping privs before setting PID. 
Patch the code locally to get FreeBSD users running.
While here, if PostgreSQL is not installed, ask for 8.2, not the default of 8.1.

>How-To-Repeat:
	
>Fix:

	



--- patch.bacula.diff begins here ---
diff -ruN /usr/ports/sysutils/bacula-server/Makefile bacula-server/Makefile
--- /usr/ports/sysutils/bacula-server/Makefile	Wed Aug 15 05:45:33 2007
+++ bacula-server/Makefile	Thu Aug 16 14:33:08 2007
@@ -7,6 +7,7 @@
 
 PORTNAME=	bacula
 DISTVERSION=	2.2.0
+PORTREVISION	1
 CATEGORIES=	sysutils
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	bacula
@@ -140,6 +141,7 @@
 DBTYPE=			mysql
 SUB_LIST+=		REQ_MYSQL=mysql REQ_PGSQL=""
 .elif defined(WITH_POSTGRESQL)
+DEFAULT_PGSQL_VER?=	82
 USE_PGSQL=		yes
 CONFIGURE_ARGS+=	--with-postgresql=yes
 DBTYPE=			postgresql
diff -ruN /usr/ports/sysutils/bacula-server/files/patch-src-dird-dird.c bacula-server/files/patch-src-dird-dird.c
--- /usr/ports/sysutils/bacula-server/files/patch-src-dird-dird.c	Wed Dec 31 19:00:00 1969
+++ bacula-server/files/patch-src-dird-dird.c	Thu Aug 16 14:25:40 2007
@@ -0,0 +1,33 @@
+--- src/dird/dird.c	2007-06-07 10:46:43.000000000 -0400
++++ src/dird/dird.c	2007-08-16 08:58:20.000000000 -0400
+@@ -228,6 +228,15 @@
+       Jmsg((JCR *)NULL, M_ERROR_TERM, 0, _("Please correct configuration file: %s\n"), configfile);
+    }
+ 
++   if (background) {
++      daemon_start();
++      init_stack_dump();              /* grab new pid */
++   }
++
++   /* Create pid must come after we are a daemon -- so we have our final pid */
++   create_pid_file(director->pid_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs));
++   read_state_file(director->working_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs));
++
+    drop(uid, gid);                    /* reduce privileges if requested */
+ 
+    if (!check_catalog()) {
+@@ -247,14 +256,6 @@
+    FDConnectTimeout = (int)director->FDConnectTimeout;
+    SDConnectTimeout = (int)director->SDConnectTimeout;
+ 
+-   if (background) {
+-      daemon_start();
+-      init_stack_dump();              /* grab new pid */
+-   }
+-
+-   /* Create pid must come after we are a daemon -- so we have our final pid */
+-   create_pid_file(director->pid_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs));
+-   read_state_file(director->working_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs));
+ 
+ 
+ #if !defined(HAVE_WIN32)
--- patch.bacula.diff ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list