From 31692b6ab23a7117901774214fabfab45eba69b9 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 28 May 2015 22:28:37 +0200 Subject: [PATCH] helper: Minor cleanup of uid/gid handling --- xdg-app-helper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xdg-app-helper.c b/xdg-app-helper.c index 3455ce97..874642ff 100644 --- a/xdg-app-helper.c +++ b/xdg-app-helper.c @@ -63,7 +63,9 @@ typedef int bool; #define READ_END 0 #define WRITE_END 1 -int uid, gid; +/* Globals to avoid having to use getuid(), since the uid/gid changes during runtime */ +static uid_t uid; +static gid_t gid; static void die_with_error (const char *format, ...) @@ -1737,7 +1739,7 @@ main (int argc, if (mkdir (newroot, 0755) && errno != EEXIST) { free (newroot); - newroot = strdup_printf ("/tmp/.xdg-app-root", uid); + newroot = "/tmp/.xdg-app-root"; if (mkdir (newroot, 0755) && errno != EEXIST) die_with_error ("Creating xdg-app-root failed"); }