|
Bugzilla – Full Text Bug Listing |
| Summary: | Unable to install with normal (unprivileged) user | ||
|---|---|---|---|
| Product: | Sudo | Reporter: | Paul Menzel <pmenzel+bugzilla.sudo.ws> |
| Component: | Configure | Assignee: | Todd C. Miller <Todd.Miller> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | normal | ||
| Priority: | low | ||
| Version: | 1.8.27 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
How is this causing a problem for you? The root check is only performed for the -G, -M and -O flags which sudo doesn't currently use. Closing due to lack of a reply from the submitter. (In reply to Todd C. Miller from comment #2) > Closing due to lack of a reply from the submitter. Sorry, the email preferences were not configured yet, and I was not notified about your comment. (In reply to Todd C. Miller from comment #1) > How is this causing a problem for you? The root check is only > performed for the -G, -M and -O flags which sudo doesn't currently > use. We want to build the package for the distribution under an unprivileged user. The changes below work around the issue to not get permission denied errors. $ sed -i \ -e '/ROOT=true/s/true/false/' \ -e '/CHOWNIT=true/s/true/false/' \ -e '/CHGROUPIT=true/s/true/false/' \ install-sh The error is below, where `chown` was run in a wrapper. ``` #BEEWRAP-chown# [13289] chown 0 /scratch/local2/beehive/sudo-1.8.22-0/buildroot/sudo/sudo-1.8 .22-0/image/usr/libexec/sudo/libsudo_util.so.0.0.0 chown: changing ownership of '/scratch/local2/beehive/sudo-1.8.22-0/buildroot/sudo/sudo-1.8.2 2-0/image/usr/libexec/sudo/libsudo_util.so.0.0.0': Operation not permitted make[1]: *** [Makefile:221: install] Error 1 ``` You could do what the package build target does and run something like: make INSTALL_OWNER= install which will skip the chown/chgrp. Thank you. Also looking more into it, in `Makefile.in` there is
INSTALL_OWNER = -o $(install_uid) -g $(install_gid)
[…]
# User and group ids the installed files should be "owned" by
install_uid = 0
install_gid = 0
This will fail, if you build as a normal user. (And I should update the bug description. Sorry about the confusion.)
So, why would you hard code that to 0, and not leave it be?
The uid is set explicitly because sudo itself is installed setuid. It is better to fail to install than to install a sudo binary that it setuid to the wrong user. |
The installation [1] should not differ if run as root or non-root user. ``` ## Making a directory? if ${DIRMODE} ; then while test $# != 0; do DEST="$1" if [ ! -d "${DEST}" ] ; then ${MKDIR} "${DEST}" || exit 1 fi if ${CHOWNIT} ; then ${CHOWN} "${OWNER}" "${DEST}" || exit 1 fi if ${CHGROUPIT} ; then ${CHGRP} "${GROUP}" "${DEST}" || exit 1 fi if ${CHMODIT} ; then ${CHMOD} "${MODE}" "${DEST}" || exit 1 fi shift; done exit 0 fi ``` [1]: https://www.sudo.ws/repos/sudo/file/18faff6ab915/install-sh