Opened 10 years ago

Closed 10 years ago

#44764 closed defect (fixed)

coreutils 8.23_0 failed to upgrade

Reported by: schnide (Joe Schnide) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.3.99
Keywords: Cc: udbraumann
Port: coreutils

Description

yosemite DP 6, port upgrade outdated, coreutils 8.22_0 < 8.23_0 failed to upgrade. find log attached.

Attachments (2)

coreutils.txt (42.9 KB) - added by schnide (Joe Schnide) 10 years ago.
coreutils upgrade log
macports.conf (5.2 KB) - added by schnide (Joe Schnide) 10 years ago.
macports.conf

Download all attachments as: .zip

Change History (19)

Changed 10 years ago by schnide (Joe Schnide)

Attachment: coreutils.txt added

coreutils upgrade log

comment:1 Changed 10 years ago by neverpanic (Clemens Lang)

Owner: changed from macports-tickets@… to ryandesign@…

Seems to be a regression introduced by Ryan in r124489. Ryan?

comment:2 Changed 10 years ago by neverpanic (Clemens Lang)

Also, you don't happen to have macportsuser root in your $prefix/etc/macports/macports.conf, do you?

comment:3 in reply to:  2 Changed 10 years ago by udbraumann

Get the same error on my good old 10.5.8 PPC box, but as far as I can remember, had no problems on a 10.6.8 Intel machine earlier today ...

comment:4 Changed 10 years ago by udbraumann

Cc: braumann@… added

Cc Me!

comment:5 in reply to:  2 Changed 10 years ago by schnide (Joe Schnide)

Replying to cal@…:

Also, you don't happen to have macportsuser root in your $prefix/etc/macports/macports.conf, do you?

I have done a standard install from the instructions that were current when I installed. I have seen feedback from the install and upgrades commands with something about 'macportsuser root`. Where can I find information about this and put it in to my setup (if I need to)? I would prefer not to delete and reinstall everything.

comment:6 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

jschnide: as cal said, check your macports.conf file. What does it say about macportsuser? The default and usually correct value for this setting is "macports", and you would also need an OS X user account by that name. The MacPorts installer package would have created this for you and set it up for you this way. Your macportsuser should not be "root"; that defeats the purpose.

Changed 10 years ago by schnide (Joe Schnide)

Attachment: macports.conf added

macports.conf

comment:7 Changed 10 years ago by schnide (Joe Schnide)

Please find attached macports.conf file. There is no macportsuser OS X user account. What steps need to be done to get things set up properly? Or would it be better to wipe everything and reinstall everything?

comment:8 Changed 10 years ago by neverpanic (Clemens Lang)

Your setup seems to be correct. In this case, there might be a problem with the Portfile.

comment:9 in reply to:  8 ; Changed 10 years ago by udbraumann

In my macports.conf on my old 10.5.8. PPC I found this definition line not commented out:

# Set the user to run MacPorts compiles, etc as when privileges are dropped during an install
macportsuser           root

After simply putting a leading # here like

#macportsuser           root

I cleaned

sudo port clean coreutils

and called again

sudo port upgrade coreutils

by this doing a smooth upgrade.

However, I have a macports installation since more than five years and I never ever had to manually touch the macports.conf before. So I have no idea why this line was previously not commented out, and I also have no idea about possible side effects which may arise from my manipulation.

I also need to say that on a much more recent macports installation on a 10.6.8 i386 initially made in 2013 this line was commented out, so no problems had occurred during the upgrade of coreutils to version 8.23_0.

comment:10 in reply to:  9 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to braumann@…:

However, I have a macports installation since more than five years and I never ever had to manually touch the macports.conf before. So I have no idea why this line was previously not commented out, and I also have no idea about possible side effects which may arise from my manipulation.

Because we changed the defaults a few years ago. It's your responsibility, every time MacPorts base is updated, to compare the contents of your macports.conf (which MacPorts never touches) with macports.conf.default in the same directory (which is updated by MacPorts), and adopt any changes from the latter into the former.

The side effects of changing the macportsuser from root to macports is that strange ports will no longer have free reign to read or write files anywhere they please; they're now restricted to reasonable locations. This is a good thing—it's more secure—and it's why we made this change in the defaults.

comment:11 in reply to:  7 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to jschnide@…:

Please find attached macports.conf file. There is no macportsuser OS X user account. What steps need to be done to get things set up properly? Or would it be better to wipe everything and reinstall everything?

The name of the setting in macports.conf is "macportsuser"; its value, and the name of the OS X user account, is usually "macports". You may not see this account in System Preferences; you can run "id macports" on the command line to see if that user is defined.

comment:12 in reply to:  8 ; Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to cal@…:

Your setup seems to be correct. In this case, there might be a problem with the Portfile.

The only problem with the portfile is that it does not allow itself to be used as root. Admittedly this is an unusual restriction and I could revert r124489 to allow this again. However it seems that users are unaware that they are running as root and are unaware of the security implications of doing that, so perhaps that's what we should fix instead.

jschnide, your log does not include the usual privilege-dropping lines. Usually one starts MacPorts with sudo, thus giving it root privileges. MacPorts then quickly gives up those privileges and switches to the unprivileged macports user, but in your log, that's not happening. Do you have any idea why? Since you're running MacPorts on a system for which we don't provide binaries yet, I presume you compiled MacPorts from source. What configure arguments did you use?

comment:13 in reply to:  12 ; Changed 10 years ago by schnide (Joe Schnide)

Replying to ryandesign@…:

The only problem with the portfile is that it does not allow itself to be used as root. Admittedly this is an unusual restriction and I could revert r124489 to allow this again. However it seems that users are unaware that they are running as root and are unaware of the security implications of doing that, so perhaps that's what we should fix instead.

jschnide, your log does not include the usual privilege-dropping lines. Usually one starts MacPorts with sudo, thus giving it root privileges. MacPorts then quickly gives up those privileges and switches to the unprivileged macports user, but in your log, that's not happening. Do you have any idea why? Since you're running MacPorts on a system for which we don't provide binaries yet, I presume you compiled MacPorts from source. What configure arguments did you use?

I did nothing unusual. I first used the uninstall instructions on the macports web pages. I then did copy and paste from the install page on how to install from source on the macports web pages. My standard process is to sudo bash, port -d selfupdate, port upgrade outdated and then port -f uninstall inactive.

Just to clarify, what process should be followed whenever macports is updated? Should users should replace macports.conf with macports.conf.defaults? I've been macports for many years as what aware of this step.

Thanks

Version 0, edited 10 years ago by schnide (Joe Schnide) (next)

comment:14 in reply to:  13 ; Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to jschnide@…:

I did nothing unusual. I first used the uninstall instructions on the macports web pages. I then did copy and paste from the install page on how to install from source on the macports web pages. My standard process is to sudo bash, port -d selfupdate, port upgrade outdated and then port -f uninstall inactive.

Instead of running sudo bash, try running sudo -s. Also, instead of port upgrade outdated and then port -f uninstall inactive, you could just run port -u upgrade outdated.

Just to clarify, what process should be followed whenever macports is updated? Should users should replace macports.conf with macports.conf.defaults?

If you have not made any edits to your macports.conf, replacing it with macports.conf.default would be acceptable. However if you have made edits to macports.conf that you wish to keep, you should compare the two files and figure out what you want to do with each line.

I've been using macports for many years and was not aware of this step.

We should document this requirement better.

comment:15 Changed 10 years ago by macports.org@…

We should document this requirement better.

Maybe hash the .conf.default, on upgrade see if .conf.default has changed and if it has:

  • if .conf is a straight copy of the old .conf.default upgrade it directly
  • otherwise print a note that defaults have changed and the local configuration may need to be upgraded

Because I was also unaware of this requirement, never touched macports.conf and the svn $Id$ of my old conf file (which I've now replaced with the current default) states it's from 2009 (revision 59588)

comment:16 in reply to:  14 ; Changed 10 years ago by schnide (Joe Schnide)

Replying to ryandesign@…:

Replying to jschnide@…:

I did nothing unusual. I first used the uninstall instructions on the macports web pages. I then did copy and paste from the install page on how to install from source on the macports web pages. My standard process is to sudo bash, port -d selfupdate, port upgrade outdated and then port -f uninstall inactive.

Instead of running sudo bash, try running sudo -s. Also, instead of port upgrade outdated and then port -f uninstall inactive, you could just run port -u upgrade outdated.

Tried this and worked fine, I will continue to use this process.

Just to clarify, what process should be followed whenever macports is updated? Should users should replace macports.conf with macports.conf.defaults?

If you have not made any edits to your macports.conf, replacing it with macports.conf.default would be acceptable. However if you have made edits to macports.conf that you wish to keep, you should compare the two files and figure out what you want to do with each line.

I made the replacement and did:

port clean --all coreutils
port upgrade coreutils

(it failed again)

port uninstall coreutils
port install coreutils

(it failed again)

Here are the last few lines of the log:

:info:configure checking whether mkfifo rejects trailing slashes... no
:info:configure checking whether mknod can create fifo without root privileges... configure: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_sysutils_coreutils/coreutils/work/coreutils-8.23':
:info:configure configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)
:info:configure See `config.log' for more details
:info:configure Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_sysutils_coreutils/coreutils/work/coreutils-8.23" && ./configure --prefix=/opt/local --disable-silent-rules --program-prefix=g 
:info:configure Exit code: 1
:error:configure Failed to configure coreutils, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_sysutils_coreutils/coreutils/work/coreutils-8.23/config.log
:error:configure Failed to configure coreutils: configure failure: command execution failed
:debug:configure Error code: NONE
:debug:configure Backtrace: configure failure: command execution failed
    while executing
"$procedure $targetname"
:error:configure See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_sysutils_coreutils/coreutils/main.log for details.

Let me know if you would like me to send along the full log. Many thanks for your time on this.

Thanks

Last edited 10 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:17 in reply to:  16 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Replying to jschnide@…:

:info:configure configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)

I do not know why your MacPorts continues to try to run the configure phase as root. It should not, and it is unsafe to do so, but since I don't know how else to help you, I reverted r124489 in r125500.

Note: See TracTickets for help on using tickets.