summaryrefslogtreecommitdiff
blob: 64e888a74c5b3bfe422c679c2daefcd52d1523ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
https://bugs.gentoo.org/show_bug.cgi?id=309457
https://bugs.freedesktop.org/show_bug.cgi?id=27081

--- src/programs/pkexec.c
+++ src/programs/pkexec.c
@@ -375,6 +375,7 @@
   gchar *path;
   struct passwd pwstruct;
   gchar pwbuf[8192];
+  gchar cwdbuf[PATH_MAX];
   gchar *s;
   const gchar *environment_variables_to_save[] = {
     "SHELL",
@@ -438,7 +439,7 @@
       goto out;
     }
 
-  original_cwd = g_strdup (get_current_dir_name ());
+  original_cwd = g_strdup (getcwd(cwdbuf,PATH_MAX));
   if (original_cwd == NULL)
     {
       g_printerr ("Error getting cwd.\n");