Package: policykit-1
Version: 0.101-3
Severity: important
Tags: patch
User: [email protected]
Usertags: hurd
Hi,
currently[1] policykit-1 does not compile on hurd-i386.
The problem is the usual PATH_MAX used unconditionally.
The attached patch fixes it, in a similar way as done in
src/examples/frobnicate.c (see also #550800).
[1]
https://buildd.debian.org/status/fetch.php?pkg=policykit-1&arch=hurd-i386&ver=0.101-3&stamp=1302529775
Thanks,
--
Pino
--- a/src/programs/pkexec.c
+++ b/src/programs/pkexec.c
@@ -49,7 +49,11 @@
#include <polkitagent/polkitagent.h>
static gchar *original_user_name = NULL;
+#ifdef __GLIBC__
+static gchar *original_cwd = NULL;
+#else
static gchar original_cwd[PATH_MAX];
+#endif
static gchar *command_line = NULL;
static struct passwd *pw;
@@ -452,7 +456,12 @@
goto out;
}
+#ifdef __GLIBC__
+ original_cwd = get_current_dir_name ();
+ if (original_cwd == NULL)
+#else
if (getcwd (original_cwd, sizeof (original_cwd)) == NULL)
+#endif
{
g_printerr ("Error getting cwd: %s\n",
g_strerror (errno));
@@ -908,6 +917,9 @@
g_free (command_line);
g_free (opt_user);
g_free (original_user_name);
+#ifdef __GLIBC__
+ g_free (original_cwd);
+#endif
return ret;
}