From nobody@FreeBSD.org  Mon Aug 24 19:28:43 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 06CB8106568B
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Aug 2009 19:28:43 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id D10ED8FC2E
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Aug 2009 19:28:42 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n7OJSg7c099755
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Aug 2009 19:28:42 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n7OJSgTF099754;
	Mon, 24 Aug 2009 19:28:42 GMT
	(envelope-from nobody)
Message-Id: <200908241928.n7OJSgTF099754@www.freebsd.org>
Date: Mon, 24 Aug 2009 19:28:42 GMT
From: Bruce Cran <bruce@cran.org.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] w(1) and pkill(1) don't work on core files without specifying -N
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         138146
>Category:       bin
>Synopsis:       [patch] w(1) and pkill(1) don't work on core files without specifying -N
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brucec
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 24 19:30:01 UTC 2009
>Closed-Date:    Sun Feb 28 14:06:51 UTC 2010
>Last-Modified:  Sun Feb 28 14:06:51 UTC 2010
>Originator:     Bruce Cran
>Release:        8.0-BETA3
>Organization:
>Environment:
>Description:
w(1) and pkill(3) don't work on core files unless -N is specified because they initialize the execfile option to kvm_open or kvm_openfiles to "/dev/null" when it should be NULL.
>How-To-Repeat:
run 'w' or 'pkill' with the '-M' option without specifying '-N'.
>Fix:
http://www.cran.org.uk/~brucec/freebsd/pkill.c.diff
http://www.cran.org.uk/~brucec/freebsd/w.c.diff

>Release-Note:
>Audit-Trail:

From: Mikolaj Golub <to.my.trociny@gmail.com>
To: bug-followup@FreeBSD.org
Cc: Bruce Cran <bruce@cran.org.uk>
Subject: Re: bin/138146: [patch] w(1) and pkill(1) don't work on core files without specifying -N
Date: Tue, 25 Aug 2009 16:17:15 +0300

 I have noticed the same behaviour for ps utility (at least under
 FreeBSD7.2). It also has _PATH_DEVNULL as default for nlistf and does not work
 without -N option.
 
 -- 
 Mikolaj Golub

From: Bruce Cran <bruce@cran.org.uk>
To: Mikolaj Golub <to.my.trociny@gmail.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/138146: [patch] w(1) and pkill(1) don't work on core files
 without specifying -N
Date: Tue, 25 Aug 2009 16:51:24 +0100

 On Tue, 25 Aug 2009 16:17:15 +0300
 Mikolaj Golub <to.my.trociny@gmail.com> wrote:
 
 > I have noticed the same behaviour for ps utility (at least under
 > FreeBSD7.2). It also has _PATH_DEVNULL as default for nlistf and does
 > not work without -N option.
 
 There are more problems with ps(1) and crash dumps; they're all
 detailed in kern/137890 .   I'm wondering if systat might have the same
 problem too, since it uses "/dev/null" but it might be intentional
 since it's in a failure path.
 
 -- 
 Bruce

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/138146: commit references a PR
Date: Mon,  8 Feb 2010 21:23:57 +0000 (UTC)

 Author: brucec
 Date: Mon Feb  8 21:23:48 2010
 New Revision: 203688
 URL: http://svn.freebsd.org/changeset/base/203688
 
 Log:
   Initialize the execfile argument to NULL instead of _PATH_DEVNULL. This allows the -M option to be used without specifying -N.
   
   PR:	bin/138146
   Approved by:	rrs (mentor)
   MFC after:	3 days
 
 Modified:
   head/bin/pkill/pkill.c
   head/bin/ps/ps.c
   head/usr.bin/w/w.c
 
 Modified: head/bin/pkill/pkill.c
 ==============================================================================
 --- head/bin/pkill/pkill.c	Mon Feb  8 21:01:41 2010	(r203687)
 +++ head/bin/pkill/pkill.c	Mon Feb  8 21:23:48 2010	(r203688)
 @@ -180,7 +180,8 @@ main(int argc, char **argv)
  	debug_opt = 0;
  	pidfile = NULL;
  	pidfilelock = 0;
 -	execf = coref = _PATH_DEVNULL;
 +	execf = NULL;
 +	coref = _PATH_DEVNULL;
  
  	while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnos:t:u:vx")) != -1)
  		switch (ch) {
 
 Modified: head/bin/ps/ps.c
 ==============================================================================
 --- head/bin/ps/ps.c	Mon Feb  8 21:01:41 2010	(r203687)
 +++ head/bin/ps/ps.c	Mon Feb  8 21:23:48 2010	(r203688)
 @@ -212,7 +212,8 @@ main(int argc, char *argv[])
  	init_list(&sesslist, addelem_pid, sizeof(pid_t), "session id");
  	init_list(&ttylist, addelem_tty, sizeof(dev_t), "tty");
  	init_list(&uidlist, addelem_uid, sizeof(uid_t), "user");
 -	memf = nlistf = _PATH_DEVNULL;
 +	memf = _PATH_DEVNULL;
 +	nlistf = NULL;
  	while ((ch = getopt(argc, argv, PS_ARGS)) != -1)
  		switch (ch) {
  		case 'A':
 
 Modified: head/usr.bin/w/w.c
 ==============================================================================
 --- head/usr.bin/w/w.c	Mon Feb  8 21:01:41 2010	(r203687)
 +++ head/usr.bin/w/w.c	Mon Feb  8 21:23:48 2010	(r203688)
 @@ -158,7 +158,8 @@ main(int argc, char *argv[])
  	}
  
  	dropgid = 0;
 -	memf = nlistf = _PATH_DEVNULL;
 +	memf = _PATH_DEVNULL;
 +	nlistf = NULL;
  	while ((ch = getopt(argc, argv, p)) != -1)
  		switch (ch) {
  		case 'd':
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched  
State-Changed-By: brucec 
State-Changed-When: Mon Feb 8 21:43:05 UTC 2010 
State-Changed-Why:  
Fix has been checked in to -CURRENT. 


Responsible-Changed-From-To: freebsd-bugs->brucec 
Responsible-Changed-By: brucec 
Responsible-Changed-When: Mon Feb 8 21:43:05 UTC 2010 
Responsible-Changed-Why:  
Take 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138146 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/138146: commit references a PR
Date: Thu, 18 Feb 2010 10:46:41 +0000 (UTC)

 Author: brucec
 Date: Thu Feb 18 10:46:25 2010
 New Revision: 204033
 URL: http://svn.freebsd.org/changeset/base/204033
 
 Log:
   MFC r203688:
   
   Initialize the execfile argument to NULL instead of _PATH_DEVNULL. This allows
   the -M option to be used without specifying -N.
   
   PR:	bin/138146
   Approved by:	rrs (mentor)
 
 Modified:
   stable/8/bin/pkill/pkill.c
   stable/8/bin/ps/ps.c
   stable/8/usr.bin/w/w.c
 Directory Properties:
   stable/8/bin/pkill/   (props changed)
   stable/8/bin/ps/   (props changed)
   stable/8/usr.bin/w/   (props changed)
 
 Modified: stable/8/bin/pkill/pkill.c
 ==============================================================================
 --- stable/8/bin/pkill/pkill.c	Thu Feb 18 10:39:53 2010	(r204032)
 +++ stable/8/bin/pkill/pkill.c	Thu Feb 18 10:46:25 2010	(r204033)
 @@ -180,7 +180,8 @@ main(int argc, char **argv)
  	debug_opt = 0;
  	pidfile = NULL;
  	pidfilelock = 0;
 -	execf = coref = _PATH_DEVNULL;
 +	execf = NULL;
 +	coref = _PATH_DEVNULL;
  
  	while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnos:t:u:vx")) != -1)
  		switch (ch) {
 
 Modified: stable/8/bin/ps/ps.c
 ==============================================================================
 --- stable/8/bin/ps/ps.c	Thu Feb 18 10:39:53 2010	(r204032)
 +++ stable/8/bin/ps/ps.c	Thu Feb 18 10:46:25 2010	(r204033)
 @@ -212,7 +212,8 @@ main(int argc, char *argv[])
  	init_list(&sesslist, addelem_pid, sizeof(pid_t), "session id");
  	init_list(&ttylist, addelem_tty, sizeof(dev_t), "tty");
  	init_list(&uidlist, addelem_uid, sizeof(uid_t), "user");
 -	memf = nlistf = _PATH_DEVNULL;
 +	memf = _PATH_DEVNULL;
 +	nlistf = NULL;
  	while ((ch = getopt(argc, argv, PS_ARGS)) != -1)
  		switch (ch) {
  		case 'A':
 
 Modified: stable/8/usr.bin/w/w.c
 ==============================================================================
 --- stable/8/usr.bin/w/w.c	Thu Feb 18 10:39:53 2010	(r204032)
 +++ stable/8/usr.bin/w/w.c	Thu Feb 18 10:46:25 2010	(r204033)
 @@ -158,7 +158,8 @@ main(int argc, char *argv[])
  	}
  
  	dropgid = 0;
 -	memf = nlistf = _PATH_DEVNULL;
 +	memf = _PATH_DEVNULL;
 +	nlistf = NULL;
  	while ((ch = getopt(argc, argv, p)) != -1)
  		switch (ch) {
  		case 'd':
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed  
State-Changed-By: brucec 
State-Changed-When: Sun Feb 28 14:06:17 UTC 2010 
State-Changed-Why:  
Patch has been merged to stable/7 and stable/8. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138146 
>Unformatted:
