bugfindutils - Bugs: bug #10533, Change from whoami to id -u breaks...

 
 

bug #10533: Change from whoami to id -u breaks on Solaris

Submitted by:  None
Submitted on:  Thu 30 Sep 2004 03:58:45 AM UTC  
 
Category: updatedbSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: None
Fixed Release: 4.2.0

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 17 May 2008 08:38:51 AM UTC, comment #4:

I'm not sure what your point is. I don't see how the presence or absence of /usr/xpg4/bin/id is relevant; we don't use the "-u" option.

James Youngman <jay>
Project Administrator
Wed 14 May 2008 08:52:06 AM UTC, comment #3:

/usr/xpg4/bin/id is not guaranteed to be installed, things in that directory are very much optional.

Anonymous
Sat 02 Oct 2004 10:56:11 AM UTC, comment #2:

This problem is fixed in the CVS code for findutils.
To resolve your problem, you could either wait for the
next official release of findutils, or check out a copy
of the code from the CVS repository for findutils.

James Youngman <jay>
Project Administrator
Sat 02 Oct 2004 10:55:25 AM UTC, comment #1:

This problem was fixed in the CVS code on 2003/06/16. The fix was to apply my own version of Savannah patch 1601. The updated bit of code from updatedb.sh is

getuid() {
# format of "id" output is ...
# uid=1(daemon) gid=1(other)
# for `id's that don't understand -u
id | cut -d'(' -f 1 | cut -d'=' -f2
}

James Youngman <jay>
Project Administrator
Thu 30 Sep 2004 03:58:45 AM UTC, original submission:

I see that "updatedb" was changed from using "whoami" to "id -u" 3 years ago:

2001-06-05 Kevin Dalley <kevin@seti.org>

* locate/updatedb.sh: replace "whoami" with "id -u" when testing
for root.

The Solaris "/usr/bin/id" program does not support "-u", so this breaks (out of the box) on Solaris.

The XPG4 version of "id" in "/usr/xpg4/bin/id" does support "-u", so a possible fix might be to pre-pend "/usr/xpg4/bin" to the $PATH setting in "updatedb.sh" (a harmless no-op on other OS', I suspect), but then that means that other programs in the script would be called from "/usr/xpg4/bin" instead of the expected places - "rm", "mv", "sed", "sort", "tr" and "awk", to be specific - with possibly unexpected/unwanted results.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jay (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 16 Oct 2004 06:24:55 PM UTCjayOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.2.0
    Sat 16 Oct 2004 06:24:10 PM UTCjaySummaryChange from \=>Change from whoami to id -u breaks on Solaris
    Sat 02 Oct 2004 10:56:11 AM UTCjayStatusNone=>Fixed
      SummaryChange from "whoami" to "id -u" breaks "updatedb" on Solaris=>Change from \

    Back to the top


    Powered by Savane 3.1-cleanup1