From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.0.4-1.3.1 Firefox/1.0.4 Description of problem: When starting a shell with ksh, an error message appears for line 17 because there is no EUID variable. The bash shell produces an EUID variable. This is not a bug in ksh. Please reassign it as appropriate. FC3 /etc/profile used `id -u` rather than EUID. Why did this change? Version-Release number of selected component (if applicable): ksh-20050202-1 How reproducible: Always Steps to Reproduce: 1. set /bin/ksh as the user's shell 2. logout and login as the user 3. start a shell 4. use Edit/Current Profile.../Title and Command tab and select Run command as login shell 5. logout and login as the user 6. start a shell Actual Results: Error message appears before user prompt is available. /etc/profile[17]: [: argument expected /usr/bin/vim Additional info:
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. ***