0

Everytime I run su command on this box, I constantly see the weird messages below. Switching user do eventually continue, but why are these messages showing?

<Server>:~ # su -
-bash: eval: line 26: unexpected EOF while looking for matching `"'
-bash: eval: line 27: syntax error: unexpected end of file
-bash: eval: line 26: unexpected EOF while looking for matching `"'
-bash: eval: line 27: syntax error: unexpected end of file

<Server>:~ # cat /etc/SuSE-release
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 4

<Server>:~ # uname -r
3.0.101-108.84-default

Yes I did looked into the "." files of root but I cannot see any weird content in those. It is also happening on all users when i try to su.. not just in root.

It seems this is a new upgrade and unfortunately i cannot tell if it were able to run su successfully in the past.

kernel-default-3.0.101-108.84.1               Tue Mar 19 04:25:06 2019
kernel-default-base-3.0.101-108.84.1          Tue Mar 19 04:24:33 2019
kernel-default-devel-3.0.101-108.84.1         Tue Mar 19 04:24:28 2019

<Server>:~ # cat .bashrc
export TMOUT=900 # 900 s = 15 min
umask 077
<Server>:~ # cat .bash_profile
umask 077
export PATH=$PATH:/opt/quest/bin
  • 6
    Do you have an unmatched " in root's .bashrc or .bash_profile file? – Kusalananda May 18 '19 at 21:30
  • From the error, it looks like one of the shell startup files is running eval on something that produces broken shell syntax. As @Kusalananda said, check root's startup files, but the error probably isn't directly in one of them, but in something one of them runs. – Gordon Davisson May 18 '19 at 22:09
  • "Everytime"... how long? Is this a new install, or have you run su successfully in the past? – Seamus May 19 '19 at 12:26
  • 2
    If the root profile files don't have anything odd, I'd consider /etc/profile or /etc/profile.d/*.sh – Jeff Schaller May 20 '19 at 0:09
  • I did compared all those mentioned directories/files with a working box, but nothing is different. Although I'm suspecting there is something wrong with /etc/pam.d/su or /etc/pam.d/su-l. Do anyone have any idea? – Ykaly May 20 '19 at 11:00
1

There is a missing " in one of the entries in /etc/sysconfig/proxy.

for sys in /etc/sysconfig/windowmanager \
           /etc/sysconfig/mail          \
           /etc/sysconfig/proxy         \
           /etc/sysconfig/console       \
           /etc/sysconfig/news
do
    test -s $sys || continue
    while read line ; do
        case "$line" in
        \#*|"") continue ;;
        esac
        eval val=${line#*=}

Line 24 of /etc/profile.d/profile.sh is eval val=${line#*=}. It basically reads all of the config file above and /etc/sysconfig/proxy turns out to be the suspect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.