diff options
author | David Zeuthen <davidz@redhat.com> | 2011-02-23 08:38:17 -0500 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2011-02-23 08:38:17 -0500 |
commit | 401d710a0c98f4011c3cf777677f96250bef9008 (patch) | |
tree | b2f3d81a2f4cc676d160f7f0d9f2856591d43f03 /src/programs | |
parent | 986d7c293c6b35899a1e7bc6437f18775220dc47 (diff) | |
download | polkit-401d710a0c98f4011c3cf777677f96250bef9008.tar.gz |
Bug 27081 – pkexec fails to build on non glibc systems
https://bugs.freedesktop.org/show_bug.cgi?id=27081
Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'src/programs')
-rw-r--r-- | src/programs/pkexec.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/programs/pkexec.c b/src/programs/pkexec.c index 40042e4..5952c47 100644 --- a/src/programs/pkexec.c +++ b/src/programs/pkexec.c @@ -47,7 +47,7 @@ #include <polkitagent/polkitagent.h> static gchar *original_user_name = NULL; -static gchar *original_cwd = NULL; +static gchar original_cwd[PATH_MAX]; static gchar *command_line = NULL; static struct passwd *pw; @@ -450,10 +450,10 @@ main (int argc, char *argv[]) goto out; } - original_cwd = g_strdup (get_current_dir_name ()); - if (original_cwd == NULL) + if (getcwd (original_cwd, sizeof (original_cwd)) == NULL) { - g_printerr ("Error getting cwd.\n"); + g_printerr ("Error getting cwd: %s\n", + g_strerror (errno)); goto out; } @@ -884,7 +884,6 @@ main (int argc, char *argv[]) g_free (command_line); g_free (opt_user); g_free (original_user_name); - g_free (original_cwd); return ret; } |