FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 06-25-2008, 09:31 AM
kfx
 
Default /usr/bin/id behavior since CentOS 5.2 upgrade

Hi list,

Since the upgrade to 5.2, when I log into my server with a ldap account
I have these 2 errors messages:

-bash: [: =: unary operator expected
-bash: [: -le: unary operator expected

After investigation, the trouble come from two scripts in /etc/profile.d:
/etc/profile.d/krb5-workstation.sh
/etc/profile.d/vim.sh

The problem is with the test where the command "id" is involved, like:
if [ `/usr/bin/id -u` = 0 ] ;

If I add double quotes ("`/usr/bin/id -u`"), it will work again.

Indeed, as a connected ldap user, the id command returns nothing when
quoted:

[ldapUser@server ~]$ /usr/bin/id -u
12345
[ldapUser@server ~]$ `/usr/bin/id -u`
[ldapUser@server ~]$

As a normal user, the command behaves normally:
[user@server ~]$ `/usr/bin/id -u`
-bash: 1302: command not found
[user@server ~]$ /usr/bin/id -u
1302


I have modified theses two scripts but I am afraid it will break
something in the future.

Any idea on how to resolve this cleanly ?

Best regards,
kfx

PS: Linux server 2.6.18-92.1.1.el5xen #1 SMP Sat Jun 21 19:21:20 EDT
2008 x86_64 x86_64 x86_64 GNU/Linux

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-25-2008, 09:35 AM
"Tim Verhoeven"
 
Default /usr/bin/id behavior since CentOS 5.2 upgrade

On Wed, Jun 25, 2008 at 11:31 AM, kfx <kadafax@gmail.com> wrote:
> Hi list,
>
> Since the upgrade to 5.2, when I log into my server with a ldap account I
> have these 2 errors messages:
> -bash: [: =: unary operator expected
> -bash: [: -le: unary operator expected
>
> After investigation, the trouble come from two scripts in /etc/profile.d:
> /etc/profile.d/krb5-workstation.sh
> /etc/profile.d/vim.sh
>
> The problem is with the test where the command "id" is involved, like:
> if [ `/usr/bin/id -u` = 0 ] ;
>
> If I add double quotes ("`/usr/bin/id -u`"), it will work again.
>
> Indeed, as a connected ldap user, the id command returns nothing when
> quoted:
> [ldapUser@server ~]$ /usr/bin/id -u
> 12345
> [ldapUser@server ~]$ `/usr/bin/id -u`
> [ldapUser@server ~]$
>
> As a normal user, the command behaves normally:
> [user@server ~]$ `/usr/bin/id -u`
> -bash: 1302: command not found
> [user@server ~]$ /usr/bin/id -u
> 1302
>
>
> I have modified theses two scripts but I am afraid it will break something
> in the future.
> Any idea on how to resolve this cleanly ?

Hi,

Read the release notes
(http://wiki.centos.org/Manuals/ReleaseNotes/CentOS5.2) and check the
known issues section and the piece about nss_ldap.

Regards,
Tim

--
Tim Verhoeven - tim.verhoeven.be@gmail.com - 0479 / 88 11 83

Hoping the problem magically goes away by ignoring it is the
"microsoft approach to programming" and should never be allowed.
(Linus Torvalds)
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-25-2008, 09:39 AM
Johnny Hughes
 
Default /usr/bin/id behavior since CentOS 5.2 upgrade

kfx wrote:

Hi list,

Since the upgrade to 5.2, when I log into my server with a ldap account
I have these 2 errors messages:

-bash: [: =: unary operator expected
-bash: [: -le: unary operator expected

After investigation, the trouble come from two scripts in /etc/profile.d:
/etc/profile.d/krb5-workstation.sh
/etc/profile.d/vim.sh

The problem is with the test where the command "id" is involved, like:
if [ `/usr/bin/id -u` = 0 ] ;

If I add double quotes ("`/usr/bin/id -u`"), it will work again.

Indeed, as a connected ldap user, the id command returns nothing when
quoted:

[ldapUser@server ~]$ /usr/bin/id -u
12345
[ldapUser@server ~]$ `/usr/bin/id -u`
[ldapUser@server ~]$

As a normal user, the command behaves normally:
[user@server ~]$ `/usr/bin/id -u`
-bash: 1302: command not found
[user@server ~]$ /usr/bin/id -u
1302


I have modified theses two scripts but I am afraid it will break
something in the future.

Any idea on how to resolve this cleanly ?


This is a known upstream bug, please see the release notes:

http://wiki.centos.org/Manuals/ReleaseNotes/CentOS5.2#head-447967c60eb305ef2c5dbbc3f4e8b3c4c5170632

As stated there, we have an nss_ldap package in the testing repo that
can fix this issue, but it will not be fixed in the official repo until
upsream releases a fix.



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 03:22 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org