Description of problem: /etc/profile.d/*sh files for krb5-devel, krb5-workstation, vim-enhanced, and probably other packages make the incorrect assumption that `id -u` always returns something other than '' Version-Release number of selected component (if applicable): krb5-devel-1.6.1-25.el5 krb5-workstation-1.6.1-25.el5 vim-enhanced-7.0.109-3.el5.3 How reproducible: See bug 448014 for one set of events causing the bug to be reproduced. Steps to Reproduce: 1. 2. 3. Actual results: .sh file errors out with '-bash: [: -le: unary operator expected' Expected results: No output Additional info: The root cause of this bug are incorrectly written .sh files. They use the construct [ `/usr/bin/id -u` = 0 ] and [ `/usr/bin/id -u` -le 100 ] The proper construct to guarantee enough parameters to the '[' shell builtin is [ "$(/usr/bin/id -u)" = 0] and [ "$(/usr/bin/id -u" -le 100 ] Thanks, Chris Dukes
This construct won't work either as p.e. '-le' doesn't accept an empty string as an integer. The correct fix is to check the value of id -u before using it. Please note that I'm not setting the alias for security reasons when id -u returns nothing. tmpid=$(/usr/bin/id -u) [ "$tmpid" = "" ] && tmpid=0 [ $tmpid -le 100 ] && return
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2009-1117.html