From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Feb 11 17:10:07 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 984DA10656BB for ; Wed, 11 Feb 2009 17:10:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 753768FC22 for ; Wed, 11 Feb 2009 17:10:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BHA7hX034766 for ; Wed, 11 Feb 2009 17:10:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n1BHA71M034765; Wed, 11 Feb 2009 17:10:07 GMT (envelope-from gnats) Resent-Date: Wed, 11 Feb 2009 17:10:07 GMT Resent-Message-Id: <200902111710.n1BHA71M034765@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Paul Schmehl Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FAA5106564A for ; Wed, 11 Feb 2009 17:05:34 +0000 (UTC) (envelope-from root@utd65257.utdallas.edu) Received: from utd65257.utdallas.edu (utd65257.utdallas.edu [129.110.3.28]) by mx1.freebsd.org (Postfix) with ESMTP id E9A588FC1E for ; Wed, 11 Feb 2009 17:05:33 +0000 (UTC) (envelope-from root@utd65257.utdallas.edu) Received: by utd65257.utdallas.edu (Postfix, from userid 0) id 2C01E347821; Wed, 11 Feb 2009 10:48:02 -0600 (CST) Message-Id: <20090211164802.2C01E347821@utd65257.utdallas.edu> Date: Wed, 11 Feb 2009 10:48:02 -0600 (CST) From: Paul Schmehl To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/131591: add a patch to fix a problem with the pid file X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Paul Schmehl List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 17:10:08 -0000 >Number: 131591 >Category: ports >Synopsis: add a patch to fix a problem with the pid file >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Wed Feb 11 17:10:06 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Paul Schmehl >Release: FreeBSD 7.0-STABLE i386 >Organization: The University of Texas at Dallas >Environment: System: FreeBSD hostname.utdallas.edu 7.0-STABLE FreeBSD 7.0-STABLE #9: Mon Jul 14 10:01:23 CDT 2008 root@utd65257.utdallas.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: This PR adds a patch to the util.c file to fix a problem with the pid file. It also bumps PORTREVISION. This software is no longer maintained but is still available, and the patch was requested by users. Maintainer can remain ports@FreeBSD.org. >How-To-Repeat: >Fix: --- patch-Makefile begins here --- --- Makefile.orig 2009-02-10 21:32:18.000000000 -0600 +++ Makefile 2009-02-10 21:32:34.000000000 -0600 @@ -7,6 +7,7 @@ PORTNAME= pads PORTVERSION= 1.2 +PORTREVISION= 1 CATEGORIES= net-mgmt MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= passive --- patch-Makefile ends here --- --- patch-util.c begins here --- --- src/util.orig.c 2009-02-11 10:29:24.000000000 -0500 +++ src/util.c 2009-02-11 10:30:36.000000000 -0500 @@ -117,16 +117,18 @@ struct passwd *this_user; /* Default PID File */ - if (gc.pid_file->slen >= 0) - gc.pid_file = bfromcstr("/var/run/pads.pid"); + if (pid_file == NULL) { + pid_file = bfromcstr("/var/run/pads.pid"); + gc.pid_file = bfromcstr("/var/run/pads.pid"); // Needed to unlink + } /* Create PID File */ - if ((fp = fopen(bdata(gc.pid_file), "w")) != NULL) { + if ((fp = fopen(bdata(pid_file), "w")) != NULL) { pid = (int) getpid(); fprintf(fp, "%d\n", pid); fclose(fp); } else { - err_message("Unable to create PID file (%s).\n", bdata(gc.pid_file)); + err_message("Unable to create PID file (%s).\n", bdata(pid_file)); } /* Change PID File's Ownership */ @@ -137,7 +139,7 @@ err_message("'%s' group does not appear to exist.", bdata(group)); if ((this_user = getpwnam(bdata(user))) == NULL) err_message("'%s' user does not appear to exist.", bdata(user)); - if ((chown(pid_file, this_user->pw_uid, this_group->gr_gid)) != 0) + if ((chown(bdata(pid_file), this_user->pw_uid, this_group->gr_gid)) != 0) err_message("Unable to change PID file's ownership."); } --- patch-util.c ends here --- >Release-Note: >Audit-Trail: >Unformatted: