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

 
 

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

Submitter:  None
Submitted:  Thu 30 Sep 2004 03:58:45 AM UTC
   
 
Category:  updatedb Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Fixed Release:  4.2.0
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>
Group 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>
Group 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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2004-10-16 jay Open/ClosedOpen Closed
        Fixed ReleaseNone 4.2.0
    2004-10-16 jay SummaryChange from \ Change from whoami to id -u breaks on Solaris
    2004-10-02 jay StatusNone Fixed
        SummaryChange from &quot;whoami&quot; to &quot;id -u&quot; breaks &quot;updatedb&quot; on Solaris Change from \

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code