diff options
author | cy <cy@FreeBSD.org> | 2012-01-05 16:20:44 +0800 |
---|---|---|
committer | cy <cy@FreeBSD.org> | 2012-01-05 16:20:44 +0800 |
commit | 8065e4fb2ec376ac4cb7a5c0d06fcc39119e041e (patch) | |
tree | 53cc9ab11288a6467831cbb22ad530587868a6e4 | |
parent | a8cd9b9406ba17d8af5772ad8e08c7e89b7c719a (diff) | |
download | freebsd-ports-gnome-8065e4fb2ec376ac4cb7a5c0d06fcc39119e041e.tar.gz freebsd-ports-gnome-8065e4fb2ec376ac4cb7a5c0d06fcc39119e041e.tar.zst freebsd-ports-gnome-8065e4fb2ec376ac4cb7a5c0d06fcc39119e041e.zip |
When 'Doinkd' is started as a service and there are no users actually
logged into system it segfaults (signal 11).
There is a bug in the 'chk_maxuser' function. When it receives as a
prameter 'user==NULL' following condition:
if (user->mgroup != 0) {
causes a segfault. Bug can be very easy reproduced and tracked by
gdb (core dumps have to be enabled).
Tested fix is:
if (user != NULL && user->mgroup != 0) {
Obtained from: doinkd bug ID at Sourceforge: 1652293
http://sourceforge.net/tracker/?func=detail&aid=1652293&group_id=168453&atid=846828
-rw-r--r-- | sysutils/doinkd/Makefile | 6 | ||||
-rw-r--r-- | sysutils/doinkd/files/patch-doinkd.c | 11 |
2 files changed, 13 insertions, 4 deletions
diff --git a/sysutils/doinkd/Makefile b/sysutils/doinkd/Makefile index 76c85bd5a3f9..802845244682 100644 --- a/sysutils/doinkd/Makefile +++ b/sysutils/doinkd/Makefile @@ -7,15 +7,13 @@ PORTNAME= doinkd PORTVERSION= 0.01 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= sysutils MASTER_SITES= SF/idled/${PORTNAME}/${PORTVERSION}/ MAINTAINER= cy@FreeBSD.org COMMENT= A daemon that logs out idle users and those users hogging resources -CFLAGS+= -O0 - MANCOMPRESSED= yes MAN5= doinkd.cf.5 MAN8= doinkd.8 @@ -23,7 +21,7 @@ MAN8= doinkd.8 USE_RC_SUBR= ${PORTNAME} PLIST_FILES= etc/doinkd/doinkd.cf.template sbin/doinkd -PLIST_DIRS= etc/doinkd +PLIST_DIRSTRY= etc/doinkd .include <bsd.port.pre.mk> diff --git a/sysutils/doinkd/files/patch-doinkd.c b/sysutils/doinkd/files/patch-doinkd.c new file mode 100644 index 000000000000..466a1bee2ed0 --- /dev/null +++ b/sysutils/doinkd/files/patch-doinkd.c @@ -0,0 +1,11 @@ +--- doinkd.c.orig 2006-05-30 00:17:44.000000000 -0700 ++++ doinkd.c 2012-01-04 12:28:11.183448967 -0800 +@@ -651,7 +651,7 @@ + int grpcnt = 0; + int tgrpcnt = 0; + +- if (user->mgroup != 0) { ++ if (user != NULL && user->mgroup != 0) { + for (i = 0; i < n_users; i++) { + if ( (*pusers[i]).uid == user->uid) + who = i; |