Fix build problems on GNU/Hurd
Subject: sudo-source: Does not build from source
Package: sudo
Version: 1.7.4p4-2
Severity: important
Tags: patch
This bug is also present in Version 1.7.4p4-6.
When building from source on GNU/Hurd the macro HAVE_GETUTID is defined
but not on GNU/Linux, making the Hurd build fail. The problem is that
<utmp.h> is included after the include of "compat.h" when HAVE_GETUTID
is defined. Moving the include higher up solves this problem, see the
inlined patch.
cat fix_sudo_hurd_source_build.diff
--- boottime.c.orig 2011-01-27 19:10:11.000000000 +0100
+++ boottime.c 2011-01-27 19:11:49.000000000 +0100
@@ -47,6 +47,14 @@
# include <sys/sysctl.h>
#endif
+/* Must be included above "compat.h"!! */
+#if defined(HAVE_GETUTXID)
+#include <utmpx.h>
+#elif defined(HAVE_GETUTID)
+#include <utmp.h>
+#else
+#endif
+
#include "compat.h"
#include "missing.h"
@@ -102,7 +110,6 @@
#elif defined(HAVE_GETUTXID)
-#include <utmpx.h>
int
get_boottime(tv)
struct timeval *tv;
@@ -121,7 +128,6 @@
#elif defined(HAVE_GETUTID)
-#include <utmp.h>
int
get_boottime(tv)
struct timeval *tv;
-- System Information:
Debian Release: 6.0
APT prefers stable
APT policy: (500, 'stable'), (100, 'testing'), (50, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages sudo depends on:
ii libc6 2.11.2-9 Embedded GNU C Library:
Shared lib
ii libpam-modules 1.1.1-6.1 Pluggable Authentication
Modules f
ii libpam0g 1.1.1-6.1 Pluggable Authentication
Modules l
sudo recommends no packages.
sudo suggests no packages.
-- Configuration Files:
/etc/sudoers.d/README [Errno 13] Permission denied:
u'/etc/sudoers.d/README'
-- no debconf information
Reply to: