From owner-svn-src-all@FreeBSD.ORG Thu May 30 21:59:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 61ABBBCA; Thu, 30 May 2013 21:59:30 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5436ED50; Thu, 30 May 2013 21:59:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULxU4X075098; Thu, 30 May 2013 21:59:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULxUx3075097; Thu, 30 May 2013 21:59:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201305302159.r4ULxUx3075097@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 30 May 2013 21:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251167 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 21:59:30 -0000 Author: pjd Date: Thu May 30 21:59:29 2013 New Revision: 251167 URL: http://svnweb.freebsd.org/changeset/base/251167 Log: If the -r option is given we cannot enter capability mode. The option tells kdump to convert numeric UIDs and GIDs into user and group names plus to convert times and dates into locallized versions. This all needs opening various files at various occasions. Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Thu May 30 21:57:40 2013 (r251166) +++ head/usr.bin/kdump/kdump.c Thu May 30 21:59:29 2013 (r251167) @@ -240,8 +240,10 @@ main(int argc, char *argv[]) * XXXPJD: There should be strerror_init() and strsignal_init() in libc. */ (void)catopen("libc", NL_CAT_LOCALE); - if (cap_enter() < 0 && errno != ENOSYS) - err(1, "unable to enter capability mode"); + if (resolv == 0) { + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + } limitfd(STDIN_FILENO); limitfd(STDOUT_FILENO); limitfd(STDERR_FILENO);