Initial commit for Tizen
[profile/extras/shadow-utils.git] / packaging / shadow-4.1.4.2-redhat.patch
1 diff -up shadow-4.1.4.2/libmisc/find_new_gid.c.redhat shadow-4.1.4.2/libmisc/find_new_gid.c
2 --- shadow-4.1.4.2/libmisc/find_new_gid.c.redhat        2009-07-18 01:53:42.000000000 +0200
3 +++ shadow-4.1.4.2/libmisc/find_new_gid.c       2009-09-07 16:34:26.640814090 +0200
4 @@ -58,11 +58,11 @@ int find_new_gid (bool sys_group,
5         assert (gid != NULL);
6  
7         if (!sys_group) {
8 -               gid_min = (gid_t) getdef_ulong ("GID_MIN", 1000UL);
9 +               gid_min = (gid_t) getdef_ulong ("GID_MIN", 500UL);
10                 gid_max = (gid_t) getdef_ulong ("GID_MAX", 60000UL);
11         } else {
12 -               gid_min = (gid_t) getdef_ulong ("SYS_GID_MIN", 101UL);
13 -               gid_max = (gid_t) getdef_ulong ("GID_MIN", 1000UL) - 1;
14 +               gid_min = (gid_t) getdef_ulong ("SYS_GID_MIN", 201UL);
15 +               gid_max = (gid_t) getdef_ulong ("GID_MIN", 500UL) - 1;
16                 gid_max = (gid_t) getdef_ulong ("SYS_GID_MAX", (unsigned long) gid_max);
17         }
18         used_gids = alloca (sizeof (bool) * (gid_max +1));
19 diff -up shadow-4.1.4.2/libmisc/find_new_uid.c.redhat shadow-4.1.4.2/libmisc/find_new_uid.c
20 --- shadow-4.1.4.2/libmisc/find_new_uid.c.redhat        2009-07-18 01:53:43.000000000 +0200
21 +++ shadow-4.1.4.2/libmisc/find_new_uid.c       2009-09-07 16:34:19.695877000 +0200
22 @@ -58,11 +58,11 @@ int find_new_uid (bool sys_user,
23         assert (uid != NULL);
24  
25         if (!sys_user) {
26 -               uid_min = (uid_t) getdef_ulong ("UID_MIN", 1000UL);
27 +               uid_min = (uid_t) getdef_ulong ("UID_MIN", 500UL);
28                 uid_max = (uid_t) getdef_ulong ("UID_MAX", 60000UL);
29         } else {
30 -               uid_min = (uid_t) getdef_ulong ("SYS_UID_MIN", 101UL);
31 -               uid_max = (uid_t) getdef_ulong ("UID_MIN", 1000UL) - 1;
32 +               uid_min = (uid_t) getdef_ulong ("SYS_UID_MIN", 201UL);
33 +               uid_max = (uid_t) getdef_ulong ("UID_MIN", 500UL) - 1;
34                 uid_max = (uid_t) getdef_ulong ("SYS_UID_MAX", (unsigned long) uid_max);
35         }
36         used_uids = alloca (sizeof (bool) * (uid_max +1));
37 diff -up shadow-4.1.4.2/src/useradd.c.redhat shadow-4.1.4.2/src/useradd.c
38 --- shadow-4.1.4.2/src/useradd.c.redhat 2009-06-06 00:16:58.000000000 +0200
39 +++ shadow-4.1.4.2/src/useradd.c        2009-09-07 16:34:01.402878101 +0200
40 @@ -90,7 +90,7 @@ char *Prog;
41  static gid_t def_group = 100;
42  static const char *def_gname = "other";
43  static const char *def_home = "/home";
44 -static const char *def_shell = "";
45 +static const char *def_shell = "/sbin/nologin";
46  static const char *def_template = SKEL_DIR;
47  static const char *def_create_mail_spool = "no";
48  
49 @@ -102,7 +102,7 @@ static char def_file[] = USER_DEFAULTS_F
50  #define        VALID(s)        (strcspn (s, ":\n") == strlen (s))
51  
52  static const char *user_name = "";
53 -static const char *user_pass = "!";
54 +static const char *user_pass = "!!";
55  static uid_t user_id;
56  static gid_t user_gid;
57  static const char *user_comment = "";
58 @@ -989,9 +989,9 @@ static void process_flags (int argc, cha
59                 };
60                 while ((c = getopt_long (argc, argv,
61  #ifdef WITH_SELINUX
62 -                                        "b:c:d:De:f:g:G:k:K:lmMNop:rs:u:UZ:",
63 +                                        "b:c:d:De:f:g:G:k:K:lmMnNop:rs:u:UZ:",
64  #else
65 -                                        "b:c:d:De:f:g:G:k:K:lmMNop:rs:u:U",
66 +                                        "b:c:d:De:f:g:G:k:K:lmMnNop:rs:u:U",
67  #endif
68                                          long_options, NULL)) != -1) {
69                         switch (c) {
70 @@ -1141,6 +1141,7 @@ static void process_flags (int argc, cha
71                         case 'M':
72                                 Mflg = true;
73                                 break;
74 +                       case 'n':
75                         case 'N':
76                                 Nflg = true;
77                                 break;