summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch')
-rw-r--r--meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch215
1 files changed, 104 insertions, 111 deletions
diff --git a/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch b/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch
index eafb935a3a..68da25f406 100644
--- a/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch
+++ b/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch
@@ -3,20 +3,19 @@ Upstream-Status: Inappropriate [OE specific]
3Allow for setting password in clear text. 3Allow for setting password in clear text.
4 4
5Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 5Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
6
7--- 6---
8 src/Makefile.am | 8 ++++---- 7 src/Makefile.am | 8 ++++----
9 src/groupadd.c | 8 +++++++- 8 src/groupadd.c | 8 +++++++-
10 src/groupmod.c | 9 ++++++++- 9 src/groupmod.c | 8 +++++++-
11 src/useradd.c | 9 +++++++-- 10 src/useradd.c | 9 +++++++--
12 src/usermod.c | 10 ++++++++-- 11 src/usermod.c | 8 +++++++-
13 5 files changed, 34 insertions(+), 10 deletions(-) 12 5 files changed, 32 insertions(+), 9 deletions(-)
14 13
15diff --git a/src/Makefile.am b/src/Makefile.am 14diff --git a/src/Makefile.am b/src/Makefile.am
16index 6a3b4c5..1ffdbc6 100644 15index 25e288d..856b087 100644
17--- a/src/Makefile.am 16--- a/src/Makefile.am
18+++ b/src/Makefile.am 17+++ b/src/Makefile.am
19@@ -76,10 +76,10 @@ chgpasswd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBSELINUX) $(LIBCRYPT) 18@@ -88,10 +88,10 @@ chgpasswd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBSELINUX) $(LIBCRYPT)
20 chsh_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD) 19 chsh_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
21 chpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT) 20 chpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT)
22 gpasswd_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT) 21 gpasswd_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT)
@@ -29,47 +28,46 @@ index 6a3b4c5..1ffdbc6 100644
29 grpck_LDADD = $(LDADD) $(LIBSELINUX) 28 grpck_LDADD = $(LDADD) $(LIBSELINUX)
30 grpconv_LDADD = $(LDADD) $(LIBSELINUX) 29 grpconv_LDADD = $(LDADD) $(LIBSELINUX)
31 grpunconv_LDADD = $(LDADD) $(LIBSELINUX) 30 grpunconv_LDADD = $(LDADD) $(LIBSELINUX)
32@@ -99,9 +99,9 @@ su_SOURCES = \ 31@@ -111,9 +111,9 @@ su_SOURCES = \
33 suauth.c 32 suauth.c
34 su_LDADD = $(LDADD) $(LIBPAM) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD) 33 su_LDADD = $(LDADD) $(LIBPAM) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
35 sulogin_LDADD = $(LDADD) $(LIBCRYPT) 34 sulogin_LDADD = $(LDADD) $(LIBCRYPT)
36-useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) 35-useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR)
37+useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT) 36+useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR) $(LIBCRYPT)
38 userdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) 37 userdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE)
39-usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) 38-usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR)
40+usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT) 39+usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR) $(LIBCRYPT)
41 vipw_LDADD = $(LDADD) $(LIBSELINUX) 40 vipw_LDADD = $(LDADD) $(LIBSELINUX)
42 41
43 install-am: all-am 42 install-am: all-am
44diff --git a/src/groupadd.c b/src/groupadd.c 43diff --git a/src/groupadd.c b/src/groupadd.c
45index 66b38de..3157486 100644 44index f716f57..4e28c26 100644
46--- a/src/groupadd.c 45--- a/src/groupadd.c
47+++ b/src/groupadd.c 46+++ b/src/groupadd.c
48@@ -124,6 +124,7 @@ static void usage (void) 47@@ -124,6 +124,7 @@ static /*@noreturn@*/void usage (int status)
49 (void) fputs (_(" -o, --non-unique allow to create groups with duplicate\n" 48 (void) fputs (_(" -o, --non-unique allow to create groups with duplicate\n"
50 " (non-unique) GID\n"), stderr); 49 " (non-unique) GID\n"), usageout);
51 (void) fputs (_(" -p, --password PASSWORD use this encrypted password for the new group\n"), stderr); 50 (void) fputs (_(" -p, --password PASSWORD use this encrypted password for the new group\n"), usageout);
52+ (void) fputs (_(" -P, --clear-password PASSWORD use this clear text password for the new group\n"), stderr); 51+ (void) fputs (_(" -P, --clear-password PASSWORD use this clear password for the new group\n"), usageout);
53 (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), stderr); 52 (void) fputs (_(" -r, --system create a system account\n"), usageout);
54 (void) fputs (_(" -r, --system create a system account\n"), stderr); 53 (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
55 (void) fputs ("\n", stderr); 54 (void) fputs ("\n", usageout);
56@@ -388,13 +389,14 @@ static void process_flags (int argc, char **argv) 55@@ -387,12 +388,13 @@ static void process_flags (int argc, char **argv)
57 {"key", required_argument, NULL, 'K'}, 56 {"key", required_argument, NULL, 'K'},
58 {"non-unique", no_argument, NULL, 'o'}, 57 {"non-unique", no_argument, NULL, 'o'},
59 {"password", required_argument, NULL, 'p'}, 58 {"password", required_argument, NULL, 'p'},
60+ {"clear-password", required_argument, NULL, 'P'}, 59+ {"clear-password", required_argument, NULL, 'P'},
61 {"root", required_argument, NULL, 'R'}, 60 {"system", no_argument, NULL, 'r'},
62 {"system", no_argument, NULL, 'r'}, 61 {"root", required_argument, NULL, 'R'},
63 {NULL, 0, NULL, '\0'} 62 {NULL, 0, NULL, '\0'}
64 }; 63 };
65 64
66 while ((c = 65- while ((c = getopt_long (argc, argv, "fg:hK:op:rR:",
67- getopt_long (argc, argv, "fg:hK:op:R:r", long_options, 66+ while ((c = getopt_long (argc, argv, "fg:hK:op:P:rR:",
68+ getopt_long (argc, argv, "fg:hK:op:P:R:r", long_options, 67 long_options, NULL)) != -1) {
69 &option_index)) != -1) {
70 switch (c) { 68 switch (c) {
71 case 'f': 69 case 'f':
72@@ -446,6 +448,10 @@ static void process_flags (int argc, char **argv) 70@@ -444,6 +446,10 @@ static void process_flags (int argc, char **argv)
73 pflg = true; 71 pflg = true;
74 group_passwd = optarg; 72 group_passwd = optarg;
75 break; 73 break;
@@ -77,37 +75,35 @@ index 66b38de..3157486 100644
77+ pflg = true; 75+ pflg = true;
78+ group_passwd = pw_encrypt (optarg, crypt_make_salt (NULL, NULL)); 76+ group_passwd = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
79+ break; 77+ break;
80 case 'R': 78 case 'r':
81 if ('/' != optarg[0]) { 79 rflg = true;
82 fprintf (stderr, 80 break;
83diff --git a/src/groupmod.c b/src/groupmod.c 81diff --git a/src/groupmod.c b/src/groupmod.c
84index 27eb159..17acbc3 100644 82index d9d3807..68f49d1 100644
85--- a/src/groupmod.c 83--- a/src/groupmod.c
86+++ b/src/groupmod.c 84+++ b/src/groupmod.c
87@@ -127,6 +127,8 @@ static void usage (void) 85@@ -127,6 +127,7 @@ static void usage (int status)
88 (void) fputs (_(" -o, --non-unique allow to use a duplicate (non-unique) GID\n"), stderr); 86 (void) fputs (_(" -o, --non-unique allow to use a duplicate (non-unique) GID\n"), usageout);
89 (void) fputs (_(" -p, --password PASSWORD change the password to this (encrypted)\n" 87 (void) fputs (_(" -p, --password PASSWORD change the password to this (encrypted)\n"
90 " PASSWORD\n"), stderr); 88 " PASSWORD\n"), usageout);
91+ (void) fputs (_(" -P, --clear-password PASSWORD change the password to this (clear text)\n" 89+ (void) fputs (_(" -P, --clear-password PASSWORD change the password to this clear PASSWORD\n"), usageout);
92+ " PASSWORD\n"), stderr); 90 (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
93 (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), stderr); 91 (void) fputs ("\n", usageout);
94 (void) fputs ("\n", stderr); 92 exit (status);
95 exit (E_USAGE); 93@@ -375,10 +376,11 @@ static void process_flags (int argc, char **argv)
96@@ -348,11 +350,12 @@ static void process_flags (int argc, char **argv) 94 {"new-name", required_argument, NULL, 'n'},
97 {"new-name", required_argument, NULL, 'n'}, 95 {"non-unique", no_argument, NULL, 'o'},
98 {"non-unique", no_argument, NULL, 'o'}, 96 {"password", required_argument, NULL, 'p'},
99 {"password", required_argument, NULL, 'p'},
100+ {"clear-password", required_argument, NULL, 'P'}, 97+ {"clear-password", required_argument, NULL, 'P'},
101 {"root", required_argument, NULL, 'R'}, 98 {"root", required_argument, NULL, 'R'},
102 {NULL, 0, NULL, '\0'} 99 {NULL, 0, NULL, '\0'}
103 }; 100 };
104 while ((c = 101- while ((c = getopt_long (argc, argv, "g:hn:op:R:",
105- getopt_long (argc, argv, "g:hn:op:R:", 102+ while ((c = getopt_long (argc, argv, "g:hn:op:P:R:",
106+ getopt_long (argc, argv, "g:hn:op:P:R:", 103 long_options, NULL)) != -1) {
107 long_options, &option_index)) != -1) {
108 switch (c) { 104 switch (c) {
109 case 'g': 105 case 'g':
110@@ -376,6 +379,10 @@ static void process_flags (int argc, char **argv) 106@@ -405,6 +407,10 @@ static void process_flags (int argc, char **argv)
111 group_passwd = optarg; 107 group_passwd = optarg;
112 pflg = true; 108 pflg = true;
113 break; 109 break;
@@ -115,84 +111,81 @@ index 27eb159..17acbc3 100644
115+ group_passwd = pw_encrypt (optarg, crypt_make_salt (NULL, NULL)); 111+ group_passwd = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
116+ pflg = true; 112+ pflg = true;
117+ break; 113+ break;
118 case 'R': 114 case 'R': /* no-op, handled in process_root_flag () */
119 if ('/' != optarg[0]) { 115 break;
120 fprintf (stderr, 116 default:
121diff --git a/src/useradd.c b/src/useradd.c 117diff --git a/src/useradd.c b/src/useradd.c
122index 2102630..390909c 100644 118index b3bd451..4416f90 100644
123--- a/src/useradd.c 119--- a/src/useradd.c
124+++ b/src/useradd.c 120+++ b/src/useradd.c
125@@ -716,6 +716,7 @@ static void usage (void) 121@@ -773,6 +773,7 @@ static void usage (int status)
126 (void) fputs (_(" -o, --non-unique allow to create users with duplicate\n" 122 (void) fputs (_(" -o, --non-unique allow to create users with duplicate\n"
127 " (non-unique) UID\n"), stderr); 123 " (non-unique) UID\n"), usageout);
128 (void) fputs (_(" -p, --password PASSWORD encrypted password of the new account\n"), stderr); 124 (void) fputs (_(" -p, --password PASSWORD encrypted password of the new account\n"), usageout);
129+ (void) fputs (_(" -P, --clear-password PASSWORD clear text password of the new account\n"), stderr); 125+ (void) fputs (_(" -P, --clear-password PASSWORD clear password of the new account\n"), usageout);
130 (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), stderr); 126 (void) fputs (_(" -r, --system create a system account\n"), usageout);
131 (void) fputs (_(" -r, --system create a system account\n"), stderr); 127 (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
132 (void) fputs (_(" -s, --shell SHELL login shell of the new account\n"), stderr); 128 (void) fputs (_(" -s, --shell SHELL login shell of the new account\n"), usageout);
133@@ -1035,6 +1036,7 @@ static void process_flags (int argc, char **argv) 129@@ -1047,6 +1048,7 @@ static void process_flags (int argc, char **argv)
134 {"no-user-group", no_argument, NULL, 'N'}, 130 {"no-user-group", no_argument, NULL, 'N'},
135 {"non-unique", no_argument, NULL, 'o'}, 131 {"non-unique", no_argument, NULL, 'o'},
136 {"password", required_argument, NULL, 'p'}, 132 {"password", required_argument, NULL, 'p'},
137+ {"clear-password", required_argument, NULL, 'P'}, 133+ {"clear-password", required_argument, NULL, 'P'},
138 {"root", required_argument, NULL, 'R'}, 134 {"system", no_argument, NULL, 'r'},
139 {"system", no_argument, NULL, 'r'}, 135 {"root", required_argument, NULL, 'R'},
140 {"shell", required_argument, NULL, 's'}, 136 {"shell", required_argument, NULL, 's'},
141@@ -1047,9 +1049,9 @@ static void process_flags (int argc, char **argv) 137@@ -1059,9 +1061,9 @@ static void process_flags (int argc, char **argv)
142 }; 138 };
143 while ((c = getopt_long (argc, argv, 139 while ((c = getopt_long (argc, argv,
144 #ifdef WITH_SELINUX 140 #ifdef WITH_SELINUX
145- "b:c:d:De:f:g:G:k:K:lmMNop:R:rs:u:UZ:", 141- "b:c:d:De:f:g:G:hk:K:lmMNop:rR:s:u:UZ:",
146+ "b:c:d:De:f:g:G:k:K:lmMNop:P:R:rs:u:UZ:", 142+ "b:c:d:De:f:g:G:hk:K:lmMNop:P:rR:s:u:UZ:",
147 #else 143 #else /* !WITH_SELINUX */
148- "b:c:d:De:f:g:G:k:K:lmMNop:R:rs:u:U", 144- "b:c:d:De:f:g:G:hk:K:lmMNop:rR:s:u:U",
149+ "b:c:d:De:f:g:G:k:K:lmMNop:P:R:rs:u:U", 145+ "b:c:d:De:f:g:G:hk:K:lmMNop:P:rR:s:u:U",
150 #endif 146 #endif /* !WITH_SELINUX */
151 long_options, NULL)) != -1) { 147 long_options, NULL)) != -1) {
152 switch (c) { 148 switch (c) {
153@@ -1214,6 +1216,9 @@ static void process_flags (int argc, char **argv) 149@@ -1227,6 +1229,9 @@ static void process_flags (int argc, char **argv)
154 } 150 }
155 user_pass = optarg; 151 user_pass = optarg;
156 break; 152 break;
157+ case 'P': /* set clear text password */ 153+ case 'P': /* set clear text password */
158+ user_pass = pw_encrypt (optarg, crypt_make_salt (NULL, NULL)); 154+ user_pass = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
159+ break; 155+ break;
160 case 'R': 156 case 'r':
161 /* no-op since we handled this in process_root_flag() earlier */ 157 rflg = true;
162 break; 158 break;
163diff --git a/src/usermod.c b/src/usermod.c 159diff --git a/src/usermod.c b/src/usermod.c
164index 8363597..f4c1cee 100644 160index e7d4351..b79f7a3 100644
165--- a/src/usermod.c 161--- a/src/usermod.c
166+++ b/src/usermod.c 162+++ b/src/usermod.c
167@@ -325,6 +325,7 @@ static void usage (void) 163@@ -419,6 +419,7 @@ static /*@noreturn@*/void usage (int status)
168 " new location (use only with -d)\n" 164 " new location (use only with -d)\n"), usageout);
169 " -o, --non-unique allow using duplicate (non-unique) UID\n" 165 (void) fputs (_(" -o, --non-unique allow using duplicate (non-unique) UID\n"), usageout);
170 " -p, --password PASSWORD use encrypted password for the new password\n" 166 (void) fputs (_(" -p, --password PASSWORD use encrypted password for the new password\n"), usageout);
171+ " -P, --clear-password PASSWORD use clear text password for the new password\n" 167+ (void) fputs (_(" -P, --clear-password PASSWORD use clear password for the new password\n"), usageout);
172 " -R --root CHROOT_DIR directory to chroot into\n" 168 (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
173 " -s, --shell SHELL new login shell for the user account\n" 169 (void) fputs (_(" -s, --shell SHELL new login shell for the user account\n"), usageout);
174 " -u, --uid UID new UID for the user account\n" 170 (void) fputs (_(" -u, --uid UID new UID for the user account\n"), usageout);
175@@ -950,6 +951,7 @@ static void process_flags (int argc, char **argv) 171@@ -996,6 +997,7 @@ static void process_flags (int argc, char **argv)
176 {"move-home", no_argument, NULL, 'm'}, 172 {"move-home", no_argument, NULL, 'm'},
177 {"non-unique", no_argument, NULL, 'o'}, 173 {"non-unique", no_argument, NULL, 'o'},
178 {"password", required_argument, NULL, 'p'}, 174 {"password", required_argument, NULL, 'p'},
179+ {"clear-password", required_argument, NULL, 'P'}, 175+ {"clear-password", required_argument, NULL, 'P'},
180 {"root", required_argument, NULL, 'R'}, 176 {"root", required_argument, NULL, 'R'},
181 #ifdef WITH_SELINUX 177 {"shell", required_argument, NULL, 's'},
182 {"selinux-user", required_argument, NULL, 'Z'}, 178 {"uid", required_argument, NULL, 'u'},
183@@ -961,9 +963,9 @@ static void process_flags (int argc, char **argv) 179@@ -1012,7 +1014,7 @@ static void process_flags (int argc, char **argv)
180 {NULL, 0, NULL, '\0'}
184 }; 181 };
185 while ((c = getopt_long (argc, argv, 182 while ((c = getopt_long (argc, argv,
186 #ifdef WITH_SELINUX 183- "ac:d:e:f:g:G:hl:Lmop:R:s:u:U"
187- "ac:d:e:f:g:G:hl:Lmop:R:s:u:UZ:", 184+ "ac:d:e:f:g:G:hl:Lmop:P:R:s:u:U"
188+ "ac:d:e:f:g:G:hl:Lmop:P:R:s:u:UZ:", 185 #ifdef ENABLE_SUBIDS
189 #else 186 "v:w:V:W:"
190- "ac:d:e:f:g:G:hl:Lmop:R:s:u:U", 187 #endif /* ENABLE_SUBIDS */
191+ "ac:d:e:f:g:G:hl:Lmop:P:R:s:u:U", 188@@ -1112,6 +1114,10 @@ static void process_flags (int argc, char **argv)
192 #endif
193 long_options, NULL)) != -1) {
194 switch (c) {
195@@ -1055,6 +1057,10 @@ static void process_flags (int argc, char **argv)
196 user_pass = optarg; 189 user_pass = optarg;
197 pflg = true; 190 pflg = true;
198 break; 191 break;
@@ -200,9 +193,9 @@ index 8363597..f4c1cee 100644
200+ user_pass = pw_encrypt (optarg, crypt_make_salt (NULL, NULL)); 193+ user_pass = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
201+ pflg = true; 194+ pflg = true;
202+ break; 195+ break;
203 case 'R': 196 case 'R': /* no-op, handled in process_root_flag () */
204 /* no-op since we handled this in process_root_flag() earlier */
205 break; 197 break;
198 case 's':
206-- 199--
2071.7.9.5 2001.7.9.5
208 201