From owner-freebsd-bugs@FreeBSD.ORG Tue Oct 13 20:20:05 2009 Return-Path: Delivered-To: freebsd-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 43320106566B for ; Tue, 13 Oct 2009 20:20:05 +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 31AE08FC17 for ; Tue, 13 Oct 2009 20:20:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n9DKK5DJ002282 for ; Tue, 13 Oct 2009 20:20:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n9DKK4LL002281; Tue, 13 Oct 2009 20:20:05 GMT (envelope-from gnats) Date: Tue, 13 Oct 2009 20:20:05 GMT Message-Id: <200910132020.n9DKK4LL002281@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Mikolaj Golub Cc: Subject: Re: bin/139314: /usr/bin/install -d reports success on failure X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mikolaj Golub List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2009 20:20:05 -0000 The following reply was made to PR bin/139314; it has been noted by GNATS. From: Mikolaj Golub To: Thomas Swan Cc: bug-followup@FreeBSD.org Subject: Re: bin/139314: /usr/bin/install -d reports success on failure Date: Tue, 13 Oct 2009 23:18:39 +0300 On Fri, 2 Oct 2009 19:10:59 GMT Thomas Swan wrote: TS> as root: TS> # /usr/bin/install -d -m755 /tmp/root-owned TS> as a mortal: TS> $ /usr/bin/install -d -m755 /tmp/root-owned TS> install: chmod 755 /tmp/root-owned: Operation not permitted TS> $ echo $? TS> 0 Actually I am not 100% sure this is a bug. Please note, the message is that it was not able to chmod, not to create directory. install(1) considers this is as a warning, not a error message. If you try to create new directory then you will get error exit code: zhuzha:~% /usr/bin/install -d -m755 /tmp/root-owned/test install: mkdir /tmp/root-owned/test: Permission denied zhuzha:~% echo $? 71 In the install code warn() is called when chmod() has failed. So if this still looks like a bug the patch is simple -- just replace warn(...) with err(EX_OSERR, ...). But then may be the same thing should be done on chown() failure (currently warn() is called here too). -- Mikolaj Golub