Bug 102372 - Patch to remove root's username dependencies
Summary: Patch to remove root's username dependencies
Status: RESOLVED NOT A BUG
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-24 17:06 UTC by Lucas Correia Villa Real
Modified: 2020-09-29 03:06 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Gets the superuser's name in a portable way (17.79 KB, patch)
2005-03-24 17:07 UTC, Lucas Correia Villa Real
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Correia Villa Real 2005-03-24 17:06:55 UTC
Version:            (using KDE KDE 3.4.0)
Installed from:    Compiled From Sources
Compiler:          GCC 3.4.3 
OS:                Linux

The KDE build system and some KDE sources currently assumes that the superuser is called "root". This is not a good idea, since the only assumption should be that the superuser has uid=0.

This patch fixes that for the KDE-Base, by replacing "root" by the portable getpwuid() calls and by replacing "root" by "0" on shell scripts.
Comment 1 Lucas Correia Villa Real 2005-03-24 17:07:54 UTC
Created attachment 10327 [details]
Gets the superuser's name in a portable way

This patch fixes that for the KDE-Base, by replacing "root" by the portable
getpwuid() calls and by replacing "root" by "0" on shell scripts.
Comment 2 Waldo Bastian 2005-03-24 19:40:49 UTC
Some parts of KDE actually use $ADMIN_ACCOUNT when defined instead of root.
Comment 3 Stephan Kulow 2005-03-30 15:55:32 UTC
I don't like the patch as it copies code around. Add a static function to kuser.h that returns the correct name and take in account what Waldo said:

      if (user.isEmpty())
        user = ::getenv("ADMIN_ACCOUNT");
      if (user.isEmpty())
        user = "root";
Comment 4 Raphael Kubo da Costa 2009-08-25 03:14:31 UTC
I can see that some places still use hard-coded "root". Lucas, is it still relevant for you? Can you update the patch?
Comment 5 Nate Graham 2020-09-29 03:06:37 UTC
Not relevant anymore.