summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2016-12-20 23:59:12 (GMT)
committer Slávek Banko <slavek.banko@axis.cz>2017-01-02 23:45:47 (GMT)
commitd23ac70c47e70cb082d38e13c4cd741769d1bb2b (patch)
tree20e3c8ab2b8cb6d5e295e80d2f1c056d89507efe
parente1861cb6811f7bac405ece204407ca46c000a453 (diff)
downloadtdelibs-d23ac70c.zip
tdelibs-d23ac70c.tar.gz
tdeinit: make lnusertemp respect HOME for root
This resolves bug 2739 Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
-rw-r--r--tdeinit/lnusertemp.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tdeinit/lnusertemp.c b/tdeinit/lnusertemp.c
index 5d739f6..4358c40 100644
--- a/tdeinit/lnusertemp.c
+++ b/tdeinit/lnusertemp.c
@@ -124,14 +124,15 @@ int build_link(const char *tmp_prefix, const char *kde_prefix, int kdehostname)
if (kde_home[0] == '~')
{
- if (uid == 0)
- {
- home_dir = pw_ent->pw_dir ? pw_ent->pw_dir : "/root";
- }
if (!home_dir || !home_dir[0])
{
- fprintf(stderr, "[lnusertemp] Aborting. $HOME not set!\n");
- return 1;
+ if ( uid == 0 ) {
+ home_dir = pw_ent->pw_dir ? pw_ent->pw_dir : "/root";
+ }
+ else {
+ fprintf(stderr, "[lnusertemp] Aborting. $HOME not set!\n");
+ return 1;
+ }
}
if (strlen(home_dir) > (PATH_MAX-100))
{