During 4.2.1 version update support for subordinate IDs has been disabled. It was handled by: 1) Adding --disable-subordinate-ids to avoid: configure: error: cannot run test program while cross compiling 2) Adding patch 003-fix-disabling-subids.patch to avoid: usermod.c: In function 'process_flags': usermod.c:1364:10: error: 'vflg' undeclared (first use in this function) if ( (vflg || Vflg) ^ This commit adds a patch with a proper configure.in fix. We don't need to disable subordinate IDs anymore. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>lilik-openwrt-22.03
@ -0,0 +1,35 @@ | |||||
From 2cb54158b80cdbd97ca3b36df83f9255e923ae3f Mon Sep 17 00:00:00 2001 | |||||
From: James Le Cuirot <chewi@aura-online.co.uk> | |||||
Date: Sat, 23 Aug 2014 09:46:39 +0100 | |||||
Subject: [PATCH] Check size of uid_t and gid_t using AC_CHECK_SIZEOF | |||||
This built-in check is simpler than the previous method and, most | |||||
importantly, works when cross-compiling. | |||||
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> | |||||
--- | |||||
configure.in | 14 ++++---------- | |||||
1 file changed, 4 insertions(+), 10 deletions(-) | |||||
--- a/configure.in | |||||
+++ b/configure.in | |||||
@@ -334,16 +334,10 @@ if test "$enable_subids" != "no"; then | |||||
dnl | |||||
dnl FIXME: check if 32 bit UIDs/GIDs are supported by libc | |||||
dnl | |||||
- AC_RUN_IFELSE([AC_LANG_SOURCE([ | |||||
-#include <sys/types.h> | |||||
-int main(void) { | |||||
- uid_t u; | |||||
- gid_t g; | |||||
- return (sizeof u < 4) || (sizeof g < 4); | |||||
-} | |||||
- ])], [id32bit="yes"], [id32bit="no"]) | |||||
+ AC_CHECK_SIZEOF([uid_t],, [#include "sys/types.h"]) | |||||
+ AC_CHECK_SIZEOF([gid_t],, [#include "sys/types.h"]) | |||||
- if test "x$id32bit" = "xyes"; then | |||||
+ if test "$ac_cv_sizeof_uid_t" -ge 4 && test "$ac_cv_sizeof_gid_t" -ge 4; then | |||||
AC_DEFINE(ENABLE_SUBIDS, 1, [Define to support the subordinate IDs.]) | |||||
enable_subids="yes" | |||||
else |
@ -1,32 +0,0 @@ | |||||
--- a/src/usermod.c | |||||
+++ b/src/usermod.c | |||||
@@ -1361,6 +1361,7 @@ static void process_flags (int argc, cha | |||||
exit (E_UID_IN_USE); | |||||
} | |||||
+#ifdef ENABLE_SUBIDS | |||||
if ( (vflg || Vflg) | |||||
&& !is_sub_uid) { | |||||
fprintf (stderr, | |||||
@@ -1376,6 +1377,7 @@ static void process_flags (int argc, cha | |||||
Prog, sub_gid_dbname (), "-w", "-W"); | |||||
exit (E_USAGE); | |||||
} | |||||
+#endif | |||||
} | |||||
/* | |||||
--- a/src/Makefile.am | |||||
+++ b/src/Makefile.am | |||||
@@ -52,7 +52,10 @@ usbin_PROGRAMS = \ | |||||
noinst_PROGRAMS = id sulogin | |||||
suidbins = su | |||||
-suidubins = chage chfn chsh expiry gpasswd newgrp passwd newuidmap newgidmap | |||||
+suidubins = chage chfn chsh expiry gpasswd newgrp passwd | |||||
+if ENABLE_SUBIDS | |||||
+ suidubins += newuidmap newgidmap | |||||
+endif | |||||
if ACCT_TOOLS_SETUID | |||||
suidubins += chage chgpasswd chpasswd groupadd groupdel groupmod newusers useradd userdel usermod | |||||
endif |