Historical bug tracker for the Pacman package manager.
The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues
This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues
This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
FS#10450 - makepkg uses fakeroot even if !fakeroot is in BUILDENV
Attached to Project:
Pacman
Opened by Xilon (Xilon) - Monday, 19 May 2008, 15:22 GMT
Last edited by Dan McGee (toofishes) - Saturday, 31 May 2008, 13:11 GMT
Opened by Xilon (Xilon) - Monday, 19 May 2008, 15:22 GMT
Last edited by Dan McGee (toofishes) - Saturday, 31 May 2008, 13:11 GMT
|
DetailsSummary and Info:
I'm not sure if it makes sense or not to disable fakeroot, but there is an option to do so, and makepkg should respect it. Even with "!fakeroot" (or just the lack of fakeroot) in BUILDENV, fakeroot is called when packaging: $ makepkg ==> WARNING: Running makepkg as an unprivileged user will result in non-root ownership of the packaged files. Try using the fakeroot environment by placing 'fakeroot' in the BUILDENV array in makepkg.conf. ==> Making package: test 1-1 (Mon 19 May 2008 22:56:00 WST) ==> Checking Runtime Dependencies... ==> Checking Buildtime Dependencies... ==> Retrieving Sources... ==> Validating source files with md5sums... ==> Extracting Sources... ==> Removing existing pkg/ directory... ==> Entering fakeroot environment... /usr/local/bin/makepkg: line 1509: fakeroot: command not found If fakeroot is really required for makepkg to function, then the option should be removed. Looking at the code, it appears that it will be fine if the user is root, but I was unable to test it. makepkg errors out when running it as root without --asroot. Running makepkg with --asroot does not appear to work either. The fact that being root is required should be documented. The warning given seems to imply that building the package as an unprivileged user is possible, but this does not appear to be the case. I suggest that if makepkg is run without fakeroot in BUILDENV, and the user does not have root privaleges, makepkg should output an error stating that root, and the --asroot argument, is required. $ sudo makepkg --asroot ==> ERROR: Running makepkg as root is a BAD idea and can cause permanent, catastrophic damage to your system. If you wish to run as root, please use the --asroot option. I don't understand why this still occurs, since $EUID is 0 and --asroot is is specified. Running it on Archlinux seems to work, but I am testing this on Mac OS X 10.5. After further investigation, it appears that no command line arguments work on OS X, they are simply ignored (even running makepkg --help is just like running makepkg by itself). This is getting a bit off topic of the original bug report. Steps to Reproduce: - Remove "fakeroot" (ore prefix with !) from the BUILDENV array in makepkg.conf - Attempt creating a package without the fakeroot binary available. |
This task depends upon
Closed by Dan McGee (toofishes)
Saturday, 31 May 2008, 13:11 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in commit b9369a747d0c2fa3ee8371f99f5ca7acbc89f7f9 in master
Saturday, 31 May 2008, 13:11 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in commit b9369a747d0c2fa3ee8371f99f5ca7acbc89f7f9 in master
I was trying to run makepkg on cygwin, where I am not root, and don't have fakeroot either. So I ran into the same issue.
I am not sure how to handle it.
Basically I think the real error here is that there's a warning shown, instead of an error.
I think that should work. The problem is that all permissions will be wrong, the files will be owned by user instead of root.
if [ $EUID -eq 0 ]; then
# SNIP
else
msg "$(gettext "Entering fakeroot environment...")"
if [ "$newpkgver" != "" ]; then
fakeroot -- $0 --forcever $newpkgver -F $ARGLIST || exit $?
else
fakeroot -- $0 -F $ARGLIST || exit $?
fi
fi
As an unprevilaged user without fakeroot installed, it's not possible to create a package. Now looking at the output of running makepkg as an unprivileged user, one would think that it's ok, since only a warning is printed, but fakeroot is called either way. As far as I can tell it would be possible to simply test if fakeroot is not in BUILDENV and attempt to build the package, then just call the normal run_build, tidy_install, create_package sequence. If it fails, that's up to the user.
Based on what you said, I think it makes more sense to change the following test :
if [ $EUID -eq 0 ]; then
to :
if [ "$(check_buildenv fakeroot)" = "n" -o $EUID -eq 0 ]; then
If that is what you meant, testing that change and submitting a git patch either here or on pacman-dev ML would greatly help.
Can I merge this?
http://shining.toofishes.net/gitweb/gitweb.cgi?p=pacman.git;a=commitdiff;h=d5c991f5a69e308df5cf2ef34b85ce4e1d7a1aeb
I wanted to replace it by Xilon's one which has a better handling of the option and better comment (minus typos).
I wanted to do this yesterday evening but the wifi is currently dead..