Discussion:
install-sh - permission denied
Paul Schmehl
2009-10-20 16:49:49 UTC
Permalink
I'm working on a new port, and I'm getting this error during make install:

test -z "/usr/local/bin" || .././install-sh -c -d "/usr/local/bin"
.././install-sh: Permission denied

Can anyone tell me why I'm getting this?

My system is 7.2 STABLE
7.2-STABLE FreeBSD 7.2-STABLE #13: Thu Sep 24 09:02:53 CDT 2009

Ports are csuped daily.
--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
*******************************************
"It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead." Thomas Jefferson
Matthew Seaman
2009-10-20 17:31:43 UTC
Permalink
Post by Paul Schmehl
test -z "/usr/local/bin" || .././install-sh -c -d "/usr/local/bin"
.././install-sh: Permission denied
Can anyone tell me why I'm getting this?
My system is 7.2 STABLE
7.2-STABLE FreeBSD 7.2-STABLE #13: Thu Sep 24 09:02:53 CDT 2009
Ports are csuped daily.
At a guess, it's because you don't have sufficient permissions to run
.././install-sh with the arguments shown. Now, one fairly obvious reason
why this wouldn't work is that .././install-sh isn't marked executable for
your UID. Judging by the file name, this is a shell script, so also check
that your UID has sufficient permissions to run the shell on the #! line
of the script too.

I can't really tell just by looking at the command names, but I'm guessing
that this command creates /usr/local/bin as a directory if it doesn't already
exist. Basically an obscurantist and over-engineered way of running a simple:

# mkdir -p /usr/local/bin

This is entirely unnecessary when dealing with the ports. You may take it
as read that the basic layout of directories under /usr/local will have been
created for you by using mtree(8) and /etc/mtree/BSD.local.dist

Cheers,

Matthew
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
Kent, CT11 9PW
Paul Schmehl
2009-10-20 17:40:35 UTC
Permalink
--On Tuesday, October 20, 2009 12:31:43 -0500 Matthew Seaman
Post by Matthew Seaman
Post by Paul Schmehl
test -z "/usr/local/bin" || .././install-sh -c -d "/usr/local/bin"
.././install-sh: Permission denied
Can anyone tell me why I'm getting this?
My system is 7.2 STABLE
7.2-STABLE FreeBSD 7.2-STABLE #13: Thu Sep 24 09:02:53 CDT 2009
Ports are csuped daily.
At a guess, it's because you don't have sufficient permissions to run
.././install-sh with the arguments shown. Now, one fairly obvious reason
why this wouldn't work is that .././install-sh isn't marked executable for
your UID. Judging by the file name, this is a shell script, so also check
that your UID has sufficient permissions to run the shell on the #! line
of the script too.
I can't really tell just by looking at the command names, but I'm guessing
that this command creates /usr/local/bin as a directory if it doesn't already
# mkdir -p /usr/local/bin
This is entirely unnecessary when dealing with the ports. You may take it
as read that the basic layout of directories under /usr/local will have been
created for you by using mtree(8) and /etc/mtree/BSD.local.dist
The problem is, I'm doing this as root. :-(
--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
*******************************************
"It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead." Thomas Jefferson
Paul Schmehl
2009-10-20 17:49:08 UTC
Permalink
--On Tuesday, October 20, 2009 11:49:49 -0500 Paul Schmehl
Post by Paul Schmehl
test -z "/usr/local/bin" || .././install-sh -c -d "/usr/local/bin"
.././install-sh: Permission denied
Can anyone tell me why I'm getting this?
My system is 7.2 STABLE
7.2-STABLE FreeBSD 7.2-STABLE #13: Thu Sep 24 09:02:53 CDT 2009
Ports are csuped daily.
As a followup - I doing all of this after suing to root, so it's hard to
understand why permissions would be a problem. This is only happening in this
new port I'm trying to develop, which seems even stranger, because this is an
exact copy of an existing port that I maintain (which builds fine - I checked
just a few minutes ago), which some editing done to the Makefile to download
and build a new version of the same software.

There's no NFS mounts involved. All partitions are mounted normally.

# mount
/dev/ad8s1a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/ad8s1f on /tmp (ufs, local, soft-updates)
/dev/ad8s1d on /usr (ufs, local, soft-updates)
/dev/ad8s1e on /var (ufs, local, soft-updates)
/dev/ad10s1d on /data (ufs, local, soft-updates)

Perms on /usr/local are "standard".

# ls -lsa /usr/local/
total 196
2 drwxr-xr-x 22 root wheel 512 Sep 19 12:11 .
2 drwxr-xr-x 19 root wheel 512 Feb 20 2008 ..
38 drwxr-xr-x 6 root wheel 38912 Oct 20 12:43 bin
2 drwxr-xr-x 3 root wheel 512 Feb 22 2008 com
2 drwxr-xr-x 9 root wheel 512 Sep 18 22:20 diablo-jdk1.6.0
2 drwxr-xr-x 7 root wheel 512 Sep 18 22:15 diablo-jre1.6.0
2 drwxr-xr-x 2 root wheel 512 Feb 21 2008 env
4 drwxr-xr-x 40 root wheel 2560 Oct 20 12:43 etc
34 drwxr-xr-x 210 root wheel 34816 Oct 9 13:05 include
4 drwxr-xr-x 3 root wheel 2560 Sep 24 16:07 info
78 drwxr-xr-x 83 root wheel 78848 Oct 9 13:05 lib
2 drwxr-xr-x 8 root wheel 512 Jul 11 14:37 libdata
2 drwxr-xr-x 10 root wheel 2048 Sep 24 16:07 libexec
2 drwxr-xr-x 33 root wheel 1024 Oct 10 09:42 man
2 drwxr-xr-x 11 root wheel 512 Jun 16 16:39 nessus
2 drwxr-xr-x 2 pgsql pgsql 512 Apr 11 2009 pgsql
4 drwxr-xr-x 2 root wheel 3072 Sep 24 15:09 sbin
4 drwxr-xr-x 156 root wheel 3072 Sep 24 16:06 share
2 drwxr-xr-x 4 root wheel 512 Sep 18 22:14 src
2 drwxr-xr-x 2 root wheel 512 Aug 6 12:57 translations
2 drwxr-xr-x 4 root wheel 512 Feb 22 2008 var
2 drwxr-xr-x 3 root wheel 512 Sep 19 11:58 www
--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
*******************************************
"It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead." Thomas Jefferson
Scott Lambert
2009-10-20 18:35:57 UTC
Permalink
Post by Paul Schmehl
test -z "/usr/local/bin" || .././install-sh -c -d "/usr/local/bin"
.././install-sh: Permission denied
Is the execute bit set on ../install.sh?
--
Scott Lambert KC5MLE Unix SysAdmin
***@lambertfam.org
Paul Schmehl
2009-10-20 18:55:20 UTC
Permalink
--On Tuesday, October 20, 2009 13:35:57 -0500 Scott Lambert
Post by Scott Lambert
Post by Paul Schmehl
test -z "/usr/local/bin" || .././install-sh -c -d "/usr/local/bin"
.././install-sh: Permission denied
Is the execute bit set on ../install.sh?
Bingo! No, it's not. Now the question is - why isn't it? What controls the
perms on that?

I just made clean and the made extract. The file is set to rw-r--r-- root
wheel.
--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
*******************************************
"It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead." Thomas Jefferson
Scot Hetzel
2009-10-20 18:59:54 UTC
Permalink
Post by Paul Schmehl
--On Tuesday, October 20, 2009 13:35:57 -0500 Scott Lambert
Post by Scott Lambert
Post by Paul Schmehl
test -z "/usr/local/bin" || .././install-sh -c -d "/usr/local/bin"
.././install-sh: Permission denied
Is the execute bit set on ../install.sh?
Bingo!  No, it's not.  Now the question is - why isn't it?  What controls
the perms on that?
I just made clean and the made extract.  The file is set to rw-r--r-- root
wheel.
Either it is not set in the tar file or your umask is blocking the
setting of the execute bit.

Scot
Paul Schmehl
2009-10-20 19:17:36 UTC
Permalink
Post by Scot Hetzel
Post by Paul Schmehl
--On Tuesday, October 20, 2009 13:35:57 -0500 Scott Lambert
Post by Scott Lambert
Post by Paul Schmehl
test -z "/usr/local/bin" || .././install-sh -c -d "/usr/local/bin"
.././install-sh: Permission denied
Is the execute bit set on ../install.sh?
Bingo!  No, it's not.  Now the question is - why isn't it?  What controls
the perms on that?
I just made clean and the made extract.  The file is set to rw-r--r-- root
wheel.
Either it is not set in the tar file or your umask is blocking the
setting of the execute bit.
Thanks, Scot. It's not set in the tarfile. Appreciate the help.
--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
*******************************************
"It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead." Thomas Jefferson
Loading...