]> git.pld-linux.org Git - packages/shadow.git/blobdiff - shadow-pld.patch
uidmap requires setup with /etc/sub[ug]idmap files
[packages/shadow.git] / shadow-pld.patch
index 51f6a9bd2d05a2959b4edce050f07410624c0517..69836c2f6a29faacbee26300b16257d34f19d911 100644 (file)
@@ -1,63 +1,6 @@
---- ./src/groupadd.c.org       Sat Oct  6 23:48:13 2001
-+++ ./src/groupadd.c   Sat Oct  6 23:55:55 2001
-@@ -78,6 +78,8 @@
- static int oflg = 0; /* permit non-unique group ID to be specified with -g */
- static int gflg = 0; /* ID value for the new group */
- static int fflg = 0; /* if group already exists, do nothing and exit(0) */
-+static int rflg = 0; /* for adding system accounts */
-+#define MIN_GID               10
- #ifdef        NDBM
- extern        int     gr_dbm_mode;
-@@ -108,7 +110,7 @@
- static void
- usage(void)
- {
--      fprintf(stderr, _("usage: groupadd [-g gid [-o]] group\n"));
-+      fprintf(stderr, _("usage: groupadd [-g gid [-o]] [-r] [-f] group\n"));
-       exit(E_USAGE);
- }
-@@ -233,8 +235,13 @@
-       const struct group *grp;
-       gid_t gid_min, gid_max;
--      gid_min = getdef_num("GID_MIN", 100);
-+      if (!rflg) {
-+      gid_min = getdef_num("GID_MIN", 500);
-       gid_max = getdef_num("GID_MAX", 60000);
-+      } else {
-+      gid_min = MIN_GID;
-+      gid_max = getdef_num("GID_MIN", 499);
-+      }
-       /*
-        * Start with some GID value if the user didn't provide us with
-@@ -344,7 +351,7 @@
-       char *cp;
-       int arg;
--      while ((arg = getopt(argc, argv, "og:O:f")) != EOF) {
-+      while ((arg = getopt(argc, argv, "og:O:fr")) != EOF) {
-               switch (arg) {
-               case 'g':
-                       gflg++;
-@@ -389,6 +396,12 @@
-                        */
-                       fflg++;
-                       break;
-+              case 'r':
-+                      /*
-+                       * create system group
-+                       */
-+                      rflg++;
-+                      break;
-               default:
-                       usage();
-               }
---- ./src/useradd.c.org        Sat Oct  6 23:56:11 2001
-+++ ./src/useradd.c    Sun Oct  7 00:25:24 2001
-@@ -78,10 +78,10 @@
+--- shadow-4.0.6/src/useradd.c 2004-11-18 21:45:00.713398344 +0100
++++ shadow-4.0.16/src/useradd.c        2006-06-08 01:17:05.580340031 +0300
+@@ -72,10 +72,10 @@
  /*
   * These defaults are used if there is no defaults file.
   */
 -static const char *def_home = "/home";
 -static const char *def_shell = "";
 +static const char *def_home = "/home/users";
-+static const char *def_shell = "/dev/null";
++static const char *def_shell = "/sbin/nologin";
  static const char *def_template = SKEL_DIR;
- #ifdef SHADOWPWD
- static long def_inactive = -1;
-@@ -93,7 +93,7 @@
+ static const char *def_create_mail_spool = "no";
+@@ -89,7 +89,7 @@
  #define       VALID(s)        (strcspn (s, ":\n") == strlen (s))
  
  static const char *user_name = "";
  static uid_t user_id;
  static gid_t user_gid;
  static const char *user_comment = "";
-@@ -122,6 +122,7 @@
-       sflg = 0, /* shell program for new account */
-       cflg = 0, /* comment (GECOS) field for new account */
-       mflg = 0, /* create user's home directory if it doesn't exist */
-+      Mflg = 0, /* don't crate user's home directory */
-       kflg = 0, /* specify a directory to fill new user directory */
-       fflg = 0, /* days until account with expired password is locked */
-       eflg = 0, /* days since 1970-01-01 when account is locked */
-@@ -179,6 +180,7 @@
-  * exit status values
-  */
- #define E_SUCCESS     0       /* success */
-+#define E_LOCKING     1       /* locking error */
- #define E_PW_UPDATE   1       /* can't update password file */
- #define E_USAGE               2       /* bad command syntax */
- #define E_BAD_ARG     3       /* invalid argument to option */
-@@ -728,7 +730,7 @@
- #ifdef AUTH_METHODS
-       fprintf(stderr, _("[-A program] "));
- #endif
--      fprintf(stderr, _("[-p passwd] name\n"));
-+      fprintf(stderr, _("[-p passwd] [-n] [-r] name\n"));
-       fprintf(stderr, _("       %s\t-D [-g group] [-b base] [-s shell]\n"),
-               Prog);
-@@ -986,7 +988,7 @@
-       const struct passwd *pwd;
-       uid_t uid_min, uid_max;
--      uid_min = getdef_num("UID_MIN", 100);
-+      uid_min = getdef_num("UID_MIN", 500);
-       uid_max = getdef_num("UID_MAX", 60000);
-       /*
-@@ -1143,9 +1145,9 @@
-       char *cp;
- #ifdef SHADOWPWD
--#define FLAGS "A:Du:og:G:d:s:c:mk:p:f:e:b:O:M"
-+#define FLAGS "A:Du:og:G:d:s:c:mk:p:f:e:b:O:Mnr"
- #else
--#define FLAGS "A:Du:og:G:d:s:c:mk:p:b:O:M"
-+#define FLAGS "A:Du:og:G:d:s:c:mk:p:b:O:Mnr"
- #endif
-       while ((arg = getopt(argc, argv, FLAGS)) != EOF) {
- #undef FLAGS
-@@ -1278,6 +1280,9 @@
-               case 'o':
-                       oflg++;
-                       break;
-+              case 'n':
-+                      nflg++;
-+                      break;
-               case 'O':
-                       /*
-                        * override login.defs defaults (-O name=value)
-@@ -1329,7 +1334,9 @@
-        * Certain options are only valid in combination with others.
-        * Check it here so that they can be specified in any order.
-        */
--      if ((oflg && !uflg) || (kflg && !mflg))
-+      if (kflg && !mflg)
-+              usage();
-+      if (mflg && Mflg)
-               usage();
-       /*
+--- shadow-4.5/libmisc/find_new_gid.c~ 2017-01-29 22:37:22.000000000 +0200
++++ shadow-4.5/libmisc/find_new_gid.c  2017-05-17 23:13:32.785253060 +0300
+@@ -61,8 +61,8 @@
+               /* A requested ID is allowed to be below the autoselect range */
+               *preferred_min = (gid_t) 1;
+-              /* Get the minimum ID range from login.defs or default to 101 */
+-              *min_id = (gid_t) getdef_ulong ("SYS_GID_MIN", 101UL);
++              /* Get the minimum ID range from login.defs or default to 10 */
++              *min_id = (gid_t) getdef_ulong ("SYS_GID_MIN", 10UL);
+               /*
+                * If SYS_GID_MAX is unspecified, we should assume it to be one
+--- shadow-4.5/libmisc/find_new_uid.c~ 2017-01-29 22:37:22.000000000 +0200
++++ shadow-4.5/libmisc/find_new_uid.c  2017-05-17 23:10:38.366687971 +0300
+@@ -61,8 +61,8 @@
+               /* A requested ID is allowed to be below the autoselect range */
+               *preferred_min = (uid_t) 1;
+-              /* Get the minimum ID range from login.defs or default to 101 */
+-              *min_id = (uid_t) getdef_ulong ("SYS_UID_MIN", 101UL);
++              /* Get the minimum ID range from login.defs or default to 1 */
++              *min_id = (uid_t) getdef_ulong ("SYS_UID_MIN", 1UL);
+               /*
+                * If SYS_UID_MAX is unspecified, we should assume it to be one
This page took 0.030291 seconds and 4 git commands to generate.