Bug 163637
Summary: | /etc/profile assumes there is an EUID variable | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Paul Watson <pwatson> |
Component: | setup | Assignee: | Karsten Hopp <karsten> |
Status: | CLOSED RAWHIDE | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 4 | CC: | jgowland, k.georgiou, sfalco |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2005-10-19 12:20:36 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Paul Watson
2005-07-19 18:52:58 UTC
Presumably this changed because referencing $EUID is faster (no fork/exec). Perhaps it should use if [ ${EUID:-unset} = 0 ] which is portable to any Bourne shell or derivative of the last decade or two. It changed because FC4 is now including the "real" korn shell from AT&T, rather than pdksh. KSH 93 doesn't set EUID, hence the problem. The real question is why /etc/profile was changed from id -u in FC3 and earlier to the use of $EUID in FC4. Sure, it's more efficient (no exec of id), but if it doesn't work... Since KSH 93 is owned by others, changing it to set EUID is probably not going to happen. However, we could change login(1) to set EUID, although that would require changing bash, zsh, etc to *not* set EUID, and remove mentioning it from their man pages, and add setting it to login(1). Why not just go back to using what works; 'id -u', and be done with it? How about something like the following? Perhaps it needs some revision to work with older shells. if [[ "${EUID}" = "0" || $(id -u) = 0 ]] This would use the EUID if it exists and invoke 'id' if not. /etc/profile belongs to the setup package. The current rawhide version has the following workaround: # ksh workaround if [ -z "$EUID" -a -x /usr/bin/id ]; then EUID=`id -u` UID=`id -ru` fi *** Bug 176265 has been marked as a duplicate of this bug. *** |