Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Oct 2009 20:20:05 GMT
From:      Mikolaj Golub <to.my.trociny@gmail.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/139314: /usr/bin/install -d reports success on failure
Message-ID:  <200910132020.n9DKK4LL002281@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/139314; it has been noted by GNATS.

From: Mikolaj Golub <to.my.trociny@gmail.com>
To: Thomas Swan <thomas.swan@gmail.com>
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910132020.n9DKK4LL002281>