[PATCH] Fallback on getpwuid if envar HOME is unset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From f64ba3c908b33a2ea5a5ad1f0e5800af76b82ce9 Mon Sep 17 00:00:00 2001
From: Conley Owens <cco3@xxxxxxxxxxx>
Date: Mon, 20 Aug 2012 18:23:40 -0700
Subject: [PATCH] Fallback on getpwuid if envar HOME is unset

Signed-off-by: Conley Owens <cco3@xxxxxxxxxxx>
---
 path.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/path.c b/path.c
index 66acd24..60affab 100644
--- a/path.c
+++ b/path.c
@@ -144,6 +144,11 @@ void home_config_paths(char **global, char **xdg,
char *file)
        char *to_free = NULL;

        if (!home) {
+         struct passwd *pw = xgetpwuid_self();
+         home = pw->pw_dir;
+       }
+
+       if (!home) {
                if (global)
                        *global = NULL;
        } else {
-- 
1.7.11-rc3
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]