diff options
author | lippe <lippe@FreeBSD.org> | 2009-02-22 05:23:32 +0800 |
---|---|---|
committer | lippe <lippe@FreeBSD.org> | 2009-02-22 05:23:32 +0800 |
commit | 859cc55a4f189fccdf672f2b400a0497314e6e7d (patch) | |
tree | 3f74a16491c0b0bad86010ec46de7da7ac92661c /net-mgmt | |
parent | 8eecc996ff0f2f3199f2b9f89092b3fda96ede96 (diff) | |
download | freebsd-ports-gnome-859cc55a4f189fccdf672f2b400a0497314e6e7d.tar.gz freebsd-ports-gnome-859cc55a4f189fccdf672f2b400a0497314e6e7d.tar.zst freebsd-ports-gnome-859cc55a4f189fccdf672f2b400a0497314e6e7d.zip |
- Added patch to fix a problem with the pidfile.
PR: ports/131591
Submitted by: Paul Schmehl <pauls@utdallas.edu>
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/pads/Makefile | 4 | ||||
-rw-r--r-- | net-mgmt/pads/files/patch-src-util.c | 34 |
2 files changed, 36 insertions, 2 deletions
diff --git a/net-mgmt/pads/Makefile b/net-mgmt/pads/Makefile index fee64deb05f4..14df522d9a0f 100644 --- a/net-mgmt/pads/Makefile +++ b/net-mgmt/pads/Makefile @@ -7,9 +7,9 @@ PORTNAME= pads PORTVERSION= 1.2 +PORTREVISION= 1 CATEGORIES= net-mgmt -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} -MASTER_SITE_SUBDIR= passive +MASTER_SITES= SF/passive MAINTAINER= ports@FreeBSD.org COMMENT= Passively detect network assets diff --git a/net-mgmt/pads/files/patch-src-util.c b/net-mgmt/pads/files/patch-src-util.c new file mode 100644 index 000000000000..d134b1517c5b --- /dev/null +++ b/net-mgmt/pads/files/patch-src-util.c @@ -0,0 +1,34 @@ +--- 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."); + + } |