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>
This commit is contained in:
Rafał Miłecki 2017-11-14 13:14:24 +01:00
parent 62249d0a5d
commit f7c0dcb4c4
4 changed files with 38 additions and 36 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=shadow
PKG_VERSION:=4.2.1
PKG_RELEASE:=6
PKG_RELEASE:=7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://pkg-shadow.alioth.debian.org/releases
@ -37,8 +37,7 @@ CONFIGURE_ARGS += \
--without-acl \
--without-attr \
--without-tcb \
--without-nscd \
--disable-subordinate-ids \
--without-nscd
define Package/shadow/Default
SECTION:=utils

View File

@ -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

View File

@ -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

View File

@ -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);