PolicyKit: Branch 'master'
David Zeuthen
david at kemper.freedesktop.org
Wed Feb 23 05:39:59 PST 2011
src/programs/pkexec.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
New commits:
commit 401d710a0c98f4011c3cf777677f96250bef9008
Author: David Zeuthen <davidz at redhat.com>
Date: Wed Feb 23 08:38:17 2011 -0500
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 at redhat.com>
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;
}
More information about the hal-commit
mailing list