diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2017-11-14 13:14:24 +0100 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2017-11-15 19:08:42 +0100 |
commit | f7c0dcb4c4f20c9aed3c33a1cc5ace29db63f37a (patch) | |
tree | 42c89be61e8dfb28fb6fa5e3204989555282faeb /utils/shadow/patches | |
parent | 62249d0a5de9fd8250f33b3ac0c2b56217e0629e (diff) |
shadow: use proper fix for checking subordinate IDs support
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>
Diffstat (limited to 'utils/shadow/patches')
3 files changed, 36 insertions, 33 deletions
diff --git a/utils/shadow/patches/003-Check-size-of-uid_t-and-gid_t-using-AC_CHECK_SIZEOF.patch b/utils/shadow/patches/003-Check-size-of-uid_t-and-gid_t-using-AC_CHECK_SIZEOF.patch new file mode 100644 index 000000000..046523dfb --- /dev/null +++ b/utils/shadow/patches/003-Check-size-of-uid_t-and-gid_t-using-AC_CHECK_SIZEOF.patch @@ -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 diff --git a/utils/shadow/patches/003-fix-disabling-subids.patch b/utils/shadow/patches/003-fix-disabling-subids.patch deleted file mode 100644 index bbc65c7d1..000000000 --- a/utils/shadow/patches/003-fix-disabling-subids.patch +++ /dev/null @@ -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 diff --git a/utils/shadow/patches/004-fix-su-controoling-term.patch b/utils/shadow/patches/004-fix-su-controoling-term.patch index 4c130c736..2f7a670b3 100644 --- a/utils/shadow/patches/004-fix-su-controoling-term.patch +++ b/utils/shadow/patches/004-fix-su-controoling-term.patch @@ -1,6 +1,6 @@ --- a/src/su.c +++ b/src/su.c -@@ -1090,8 +1090,12 @@ +@@ -1090,8 +1090,12 @@ int main (int argc, char **argv) if (fd >= 0) { err = ioctl (fd, TIOCNOTTY, (char *) 0); |