summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2013-06-06 16:23:35 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-25 17:44:53 +0100
commit977fb9a916c1f2f7cb5ceba4db89d2e0155b37a1 (patch)
tree55c68bb8c3757a29414f7c14aa9862a57450be47 /meta/recipes-core
parent8013f6e6aef28359d72ce3b21d5d704e19ceee69 (diff)
downloadpoky-977fb9a916c1f2f7cb5ceba4db89d2e0155b37a1.tar.gz
tinylogin: remove recipe
tinylogin has been deprecated and the functionality ported into busybox. We now use busybox as the login manager, so the tinylogin recipe could be deleted. [YOCTO #4207] (From OE-Core rev: 2762ff976a3473be4259889029e048ab8b3be5ab) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/tinylogin/tinylogin-1.4/add-system.patch117
-rw-r--r--meta/recipes-core/tinylogin/tinylogin-1.4/adduser-empty_pwd.patch45
-rw-r--r--meta/recipes-core/tinylogin/tinylogin-1.4/avoid_static.patch33
-rw-r--r--meta/recipes-core/tinylogin/tinylogin-1.4/cvs-20040608.patch823
-rw-r--r--meta/recipes-core/tinylogin/tinylogin-1.4/glibc_crypt_fix.patch23
-rw-r--r--meta/recipes-core/tinylogin/tinylogin-1.4/passwd_rotate_check.patch41
-rw-r--r--meta/recipes-core/tinylogin/tinylogin-1.4/remove-index.patch13
-rw-r--r--meta/recipes-core/tinylogin/tinylogin-1.4/use_O2_option.patch21
-rw-r--r--meta/recipes-core/tinylogin/tinylogin_1.4.bb45
9 files changed, 0 insertions, 1161 deletions
diff --git a/meta/recipes-core/tinylogin/tinylogin-1.4/add-system.patch b/meta/recipes-core/tinylogin/tinylogin-1.4/add-system.patch
deleted file mode 100644
index 0a97974114..0000000000
--- a/meta/recipes-core/tinylogin/tinylogin-1.4/add-system.patch
+++ /dev/null
@@ -1,117 +0,0 @@
1Upstream-Status: Backport
2
3? add-system.patch
4? cvs-20040608.patch
5? familiar
6? pod2htmd.tmp
7? pod2htmi.tmp
8? system.diff
9? tinylogin_1.4-20030620.1_arm.ipk
10? tinylogin_1.4-20030620.1_arm.ipk.asc
11? tinylogin_1.4-20030620.1_arm.ipk.upload.html
12? tinylogin_1.4-20030620.2_arm.ipk
13? tinylogin_1.4-20030620.2_arm.ipk.asc
14? tinylogin_1.4-20030620.2_arm.ipk.upload.html
15? tinylogin_1.4-20030620_arm.ipk
16? tinylogin_1.4-20030620_arm.ipk.asc
17? tinylogin_1.4-20030620_arm.ipk.upload.html
18? tmp
19Index: addgroup.c
20===================================================================
21RCS file: /var/cvs/tinylogin/addgroup.c,v
22retrieving revision 1.23
23diff -u -r1.23 addgroup.c
24--- a/addgroup.c 9 Jan 2003 18:43:29 -0000 1.23
25+++ b/addgroup.c 8 Jun 2004 08:56:08 -0000
26@@ -31,6 +31,7 @@
27 #include <sys/stat.h>
28 #include <sys/types.h>
29 #include <unistd.h>
30+#include <getopt.h>
31 #include "tinylogin.h"
32
33 #define GROUP_FILE "/etc/group"
34@@ -124,6 +125,11 @@
35 return 0;
36 }
37
38+static struct option long_options[] = {
39+ { "system", 0, NULL, 'S' },
40+ { 0, 0, 0, 0 }
41+};
42+
43 /*
44 * addgroup will take a login_name as its first parameter.
45 *
46@@ -136,14 +142,19 @@
47 int opt;
48 char *group;
49 char *user;
50+ int option_index = -1;
51 gid_t gid = 0;
52+ int system = 0;
53
54 /* get remaining args */
55- while ((opt = getopt (argc, argv, "g:")) != -1) {
56+ while ((opt = getopt_long (argc, argv, "g:S", long_options, &option_index)) != -1) {
57 switch (opt) {
58 case 'g':
59 gid = strtol(optarg, NULL, 10);
60 break;
61+ case 'S':
62+ system = 1;
63+ break;
64 default:
65 show_usage();
66 break;
67Index: adduser.c
68===================================================================
69RCS file: /var/cvs/tinylogin/adduser.c,v
70retrieving revision 1.38
71diff -u -r1.38 adduser.c
72--- a/adduser.c 21 Jun 2003 19:35:42 -0000 1.38
73+++ b/adduser.c 8 Jun 2004 08:56:09 -0000
74@@ -66,13 +66,13 @@
75
76 /* remix */
77 /* EDR recoded such that the uid may be passed in *p */
78-static int passwd_study(const char *filename, struct passwd *p)
79+static int passwd_study(const char *filename, struct passwd *p, int system)
80 {
81 struct passwd *pw;
82 FILE *passwd;
83
84- const int min = 500;
85- const int max = 65000;
86+ const int min = system ? 10 : 500;
87+ const int max = system ? 99 : 65000;
88
89 passwd = wfopen(filename, "r");
90 if (!passwd)
91@@ -142,7 +142,7 @@
92 }
93
94 /* putpwent(3) remix */
95-static int adduser(const char *filename, struct passwd *p, int makehome, int setpass)
96+static int adduser(const char *filename, struct passwd *p, int makehome, int setpass, int system)
97 {
98 FILE *passwd;
99 int r;
100@@ -165,7 +165,7 @@
101 fseek(passwd, 0, SEEK_END);
102
103 /* if (passwd_study(filename, p) == 0) { */
104- r = passwd_study(filename, p);
105+ r = passwd_study(filename, p, system);
106 if (r) {
107 if (r == 1)
108 error_msg("%s: login already in use", p->pw_name);
109@@ -357,7 +357,7 @@
110 }
111
112 /* grand finale */
113- return adduser(PASSWD_FILE, &pw, makehome, setpass);
114+ return adduser(PASSWD_FILE, &pw, makehome, setpass, system);
115 }
116
117 /* $Id: adduser.c,v 1.38 2003/06/21 19:35:42 andersen Exp $ */
diff --git a/meta/recipes-core/tinylogin/tinylogin-1.4/adduser-empty_pwd.patch b/meta/recipes-core/tinylogin/tinylogin-1.4/adduser-empty_pwd.patch
deleted file mode 100644
index 3a4c6d7aa7..0000000000
--- a/meta/recipes-core/tinylogin/tinylogin-1.4/adduser-empty_pwd.patch
+++ /dev/null
@@ -1,45 +0,0 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3--- tinylogin-1.4/adduser.c.orig 2004-09-30 18:01:46.000000000 +0200
4+++ tinylogin-1.4/adduser.c 2004-09-30 18:07:01.000000000 +0200
5@@ -249,6 +249,7 @@
6 struct option long_options[] = {
7 { "home", 1, NULL, 'h' },
8 { "disabled-password", 0, NULL, 'D' },
9+ { "empty-password", 0, NULL, 'E' },
10 { "system", 0, NULL, 'S' },
11 { "ingroup", 1, NULL, 'G' },
12 { "no-create-home", 0, NULL, 'H' },
13@@ -287,7 +288,7 @@
14 shell = default_shell;
15
16 /* get args */
17- while ((opt = getopt_long (argc, argv, "h:g:s:G:DSH", long_options, &option_index)) != -1) {
18+ while ((opt = getopt_long (argc, argv, "h:g:s:G:DESH", long_options, &option_index)) != -1) {
19 switch (opt) {
20 case 'h':
21 home = optarg;
22@@ -304,6 +305,9 @@
23 case 'D':
24 setpass = 0;
25 break;
26+ case 'E':
27+ setpass = -1;
28+ break;
29 case 'S':
30 system = 1;
31 break;
32@@ -338,7 +342,12 @@
33
34 /* create a passwd struct */
35 pw.pw_name = (char *)login;
36- pw.pw_passwd = (char *)default_passwd;
37+ if (setpass != -1)
38+ pw.pw_passwd = (char *)default_passwd;
39+ else {
40+ pw.pw_passwd = (char *)"";
41+ setpass = 0;
42+ }
43 pw.pw_uid = 0;
44 pw.pw_gid = 0;
45 pw.pw_gecos = (char *)gecos;
diff --git a/meta/recipes-core/tinylogin/tinylogin-1.4/avoid_static.patch b/meta/recipes-core/tinylogin/tinylogin-1.4/avoid_static.patch
deleted file mode 100644
index 8a06af0ddf..0000000000
--- a/meta/recipes-core/tinylogin/tinylogin-1.4/avoid_static.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1tinylogin: Do not link statically when building debug
2
3For some reason if DODEBUG was enabled (to prevent stripping) the binary was
4also statically linked. This patch prevents that behavior.
5
6Upstream-Status: Inappropriate [no upstream]
7
8Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
9
10diff -ur tinylogin-1.4.orig/Makefile tinylogin-1.4/Makefile
11--- tinylogin-1.4.orig/Makefile 2011-06-18 11:00:23.073927349 -0500
12+++ tinylogin-1.4/Makefile 2011-06-18 11:03:26.394849372 -0500
13@@ -123,20 +123,6 @@
14 LDFLAGS += -s -Wl,-warn-common
15 STRIP = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $(PROG)
16 endif
17-ifeq ($(strip $(DODEBUG)),true)
18- LDFLAGS += --static
19- #
20- #use '-ffunction-sections -fdata-sections' and '--gc-sections' (if they
21- # work) to try and strip out any unused junk. Doesn't do much for me,
22- # but you may want to give it a shot...
23- #
24- #ifeq ($(shell $(CC) -ffunction-sections -fdata-sections -S \
25- # -o /dev/null -xc /dev/null 2>/dev/null && $(LD) \
26- # --gc-sections -v >/dev/null && echo 1),1)
27- # CFLAGS += -ffunction-sections -fdata-sections
28- # LDFLAGS += --gc-sections
29- #endif
30-endif
31 ifeq ($(strip $(DOSTATIC)),true)
32 LDFLAGS += --static
33 #
diff --git a/meta/recipes-core/tinylogin/tinylogin-1.4/cvs-20040608.patch b/meta/recipes-core/tinylogin/tinylogin-1.4/cvs-20040608.patch
deleted file mode 100644
index 33bc301a6e..0000000000
--- a/meta/recipes-core/tinylogin/tinylogin-1.4/cvs-20040608.patch
+++ /dev/null
@@ -1,823 +0,0 @@
1Upstream-Status: Backport
2
3Index: Config.h
4===================================================================
5RCS file: /var/cvs/tinylogin/Config.h,v
6retrieving revision 1.10
7retrieving revision 1.12
8diff -u -r1.10 -r1.12
9--- a/Config.h 23 Jun 2002 03:09:07 -0000 1.10
10+++ b/Config.h 17 Feb 2003 11:51:55 -0000 1.12
11@@ -27,15 +27,11 @@
12 // Enable checking of /etc/securetty by login
13 #define CONFIG_FEATURE_SECURETTY
14 //
15-// Enable using sha passwords
16-#define CONFIG_FEATURE_SHA1_PASSWORDS
17-//
18 // Enable use of a wheel group
19 #define CONFIG_WHEEL_GROUP
20 //
21-// This compiles out everything but the most
22-// trivial --help usage information (i.e. reduces binary size)
23-#define CONFIG_FEATURE_TRIVIAL_HELP
24+// Show verbose usage messages
25+//#define CONFIG_FEATURE_VERBOSE_USAGE
26 //
27 // Enable 'tinylogin --install [-s]' to allow tinylogin
28 // to create links (or symlinks) at runtime for all the
29@@ -48,10 +44,6 @@
30 // Nothing beyond this point should ever be touched by
31 // mere mortals so leave this stuff alone.
32 //
33-#ifdef CONFIG_FEATURE_SHA1_PASSWORDS
34-#define CONFIG_SHA1
35-#endif
36-//
37 #ifdef CONFIG_FEATURE_SHADOWPASSWDS
38 #define CONFIG_SHADOW
39 #endif
40Index: addgroup.c
41===================================================================
42RCS file: /var/cvs/tinylogin/addgroup.c,v
43retrieving revision 1.22
44retrieving revision 1.23
45diff -u -r1.22 -r1.23
46--- a/addgroup.c 12 Dec 2002 08:46:03 -0000 1.22
47+++ b/addgroup.c 9 Jan 2003 18:43:29 -0000 1.23
48@@ -133,23 +133,33 @@
49 * ________________________________________________________________________ */
50 int addgroup_main(int argc, char **argv)
51 {
52+ int opt;
53 char *group;
54 char *user;
55 gid_t gid = 0;
56
57- if (argc < 2) {
58- show_usage();
59+ /* get remaining args */
60+ while ((opt = getopt (argc, argv, "g:")) != -1) {
61+ switch (opt) {
62+ case 'g':
63+ gid = strtol(optarg, NULL, 10);
64+ break;
65+ default:
66+ show_usage();
67+ break;
68+ }
69 }
70
71- if (strncmp(argv[1], "-g", 2) == 0) {
72- gid = strtol(argv[2], NULL, 10);
73- group = argv[2];
74+ if (optind < argc) {
75+ group = argv[optind];
76+ optind++;
77 } else {
78 show_usage();
79 }
80-
81- if (argc == 4) {
82- user = argv[3];
83+
84+ if (optind < argc) {
85+ user = argv[optind];
86+ optind++;
87 } else {
88 user = "";
89 }
90@@ -163,4 +173,4 @@
91 return addgroup(GROUP_FILE, group, gid, user);
92 }
93
94-/* $Id: addgroup.c,v 1.22 2002/12/12 08:46:03 andersen Exp $ */
95+/* $Id: addgroup.c,v 1.23 2003/01/09 18:43:29 andersen Exp $ */
96Index: adduser.c
97===================================================================
98RCS file: /var/cvs/tinylogin/adduser.c,v
99retrieving revision 1.37
100retrieving revision 1.38
101diff -u -r1.37 -r1.38
102--- a/adduser.c 12 Dec 2002 08:46:03 -0000 1.37
103+++ b/adduser.c 21 Jun 2003 19:35:42 -0000 1.38
104@@ -21,6 +21,9 @@
105 *
106 */
107
108+#ifndef _GNU_SOURCE
109+#define _GNU_SOURCE
110+#endif
111 #include <errno.h>
112 #include <fcntl.h>
113 #include <stdarg.h>
114@@ -29,6 +32,7 @@
115 #include <string.h>
116 #include <time.h>
117 #include <unistd.h>
118+#include <getopt.h>
119 #include <sys/param.h>
120 #include <sys/stat.h>
121 #include <sys/types.h>
122@@ -93,21 +97,23 @@
123 }
124 }
125
126- /* EDR check for an already existing gid */
127- while (getgrgid(p->pw_uid) != NULL)
128- p->pw_uid++;
129-
130- /* EDR also check for an existing group definition */
131- if (getgrnam(p->pw_name) != NULL)
132- return 3;
133+ if (p->pw_gid == 0) {
134+ /* EDR check for an already existing gid */
135+ while (getgrgid(p->pw_uid) != NULL)
136+ p->pw_uid++;
137+
138+ /* EDR also check for an existing group definition */
139+ if (getgrnam(p->pw_name) != NULL)
140+ return 3;
141+
142+ /* EDR create new gid always = uid */
143+ p->pw_gid = p->pw_uid;
144+ }
145
146 /* EDR bounds check */
147 if ((p->pw_uid > max) || (p->pw_uid < min))
148 return 2;
149
150- /* EDR create new gid always = uid */
151- p->pw_gid = p->pw_uid;
152-
153 /* return 1; */
154 return 0;
155 }
156@@ -136,7 +142,7 @@
157 }
158
159 /* putpwent(3) remix */
160-static int adduser(const char *filename, struct passwd *p)
161+static int adduser(const char *filename, struct passwd *p, int makehome, int setpass)
162 {
163 FILE *passwd;
164 int r;
165@@ -144,6 +150,11 @@
166 FILE *shadow;
167 struct spwd *sp;
168 #endif
169+ int new_group = 1;
170+
171+ /* if using a pre-existing group, don't create one */
172+ if (p->pw_gid != 0)
173+ new_group = 0;
174
175 /* make sure everything is kosher and setup uid && gid */
176 passwd = wfopen(filename, "a");
177@@ -194,29 +205,36 @@
178 }
179 #endif
180
181- /* add to group */
182- /* addgroup should be responsible for dealing w/ gshadow */
183- addgroup_wrapper(p->pw_name, p->pw_gid);
184+ if (new_group) {
185+ /* add to group */
186+ /* addgroup should be responsible for dealing w/ gshadow */
187+ addgroup_wrapper(p->pw_name, p->pw_gid);
188+ }
189
190 /* Clear the umask for this process so it doesn't
191 * * screw up the permissions on the mkdir and chown. */
192 umask(0);
193
194- /* mkdir */
195- if (mkdir(p->pw_dir, 0755)) {
196- perror_msg("%s", p->pw_dir);
197- }
198- /* Set the owner and group so it is owned by the new user. */
199- if (chown(p->pw_dir, p->pw_uid, p->pw_gid)) {
200- perror_msg("%s", p->pw_dir);
201- }
202- /* Now fix up the permissions to 2755. Can't do it before now
203- * since chown will clear the setgid bit */
204- if (chmod(p->pw_dir, 02755)) {
205- perror_msg("%s", p->pw_dir);
206+ if (makehome) {
207+ /* mkdir */
208+ if (mkdir(p->pw_dir, 0755)) {
209+ perror_msg("%s", p->pw_dir);
210+ }
211+ /* Set the owner and group so it is owned by the new user. */
212+ if (chown(p->pw_dir, p->pw_uid, p->pw_gid)) {
213+ perror_msg("%s", p->pw_dir);
214+ }
215+ /* Now fix up the permissions to 2755. Can't do it before now
216+ * since chown will clear the setgid bit */
217+ if (chmod(p->pw_dir, 02755)) {
218+ perror_msg("%s", p->pw_dir);
219+ }
220+ }
221+
222+ if (setpass) {
223+ /* interactively set passwd */
224+ passwd_wrapper(p->pw_name);
225 }
226- /* interactively set passwd */
227- passwd_wrapper(p->pw_name);
228
229 return 0;
230 }
231@@ -228,6 +246,15 @@
232 return geteuid();
233 }
234
235+struct option long_options[] = {
236+ { "home", 1, NULL, 'h' },
237+ { "disabled-password", 0, NULL, 'D' },
238+ { "system", 0, NULL, 'S' },
239+ { "ingroup", 1, NULL, 'G' },
240+ { "no-create-home", 0, NULL, 'H' },
241+ { 0, 0, 0, 0 }
242+};
243+
244 /*
245 * adduser will take a login_name as its first parameter.
246 *
247@@ -244,6 +271,11 @@
248 const char *gecos;
249 const char *home = NULL;
250 const char *shell;
251+ const char *usegroup = NULL;
252+ int option_index = -1;
253+ int setpass = 1;
254+ int makehome = 1;
255+ int system = 0;
256
257 struct passwd pw;
258
259@@ -255,7 +287,7 @@
260 shell = default_shell;
261
262 /* get args */
263- while ((opt = getopt (argc, argv, "h:g:s:")) != -1) {
264+ while ((opt = getopt_long (argc, argv, "h:g:s:G:DSH", long_options, &option_index)) != -1) {
265 switch (opt) {
266 case 'h':
267 home = optarg;
268@@ -266,6 +298,18 @@
269 case 's':
270 shell = optarg;
271 break;
272+ case 'H':
273+ makehome = 0;
274+ break;
275+ case 'D':
276+ setpass = 0;
277+ break;
278+ case 'S':
279+ system = 1;
280+ break;
281+ case 'G':
282+ usegroup = optarg;
283+ break;
284 default:
285 show_usage ();
286 break;
287@@ -301,8 +345,19 @@
288 pw.pw_dir = (char *)home;
289 pw.pw_shell = (char *)shell;
290
291+ if (usegroup) {
292+ /* Add user to a group that already exists */
293+ struct group *g;
294+
295+ g = getgrnam(usegroup);
296+ if (g == NULL)
297+ error_msg_and_die("group %s does not exist", usegroup);
298+
299+ pw.pw_gid = g->gr_gid;
300+ }
301+
302 /* grand finale */
303- return adduser(PASSWD_FILE, &pw);
304+ return adduser(PASSWD_FILE, &pw, makehome, setpass);
305 }
306
307-/* $Id: adduser.c,v 1.37 2002/12/12 08:46:03 andersen Exp $ */
308+/* $Id: adduser.c,v 1.38 2003/06/21 19:35:42 andersen Exp $ */
309Index: install.sh
310===================================================================
311RCS file: /var/cvs/tinylogin/install.sh,v
312retrieving revision 1.10
313retrieving revision 1.11
314diff -u -r1.10 -r1.11
315--- a/install.sh 23 Jun 2002 03:09:07 -0000 1.10
316+++ b/install.sh 6 Mar 2003 19:29:17 -0000 1.11
317@@ -21,11 +21,11 @@
318 h=`sort tinylogin.links | uniq`
319
320
321-mkdir -p $prefix/bin || exit 1
322+install -d -m 0755 $prefix/bin || exit 1
323
324 for i in $h ; do
325 appdir=`dirname $i`
326- mkdir -p $prefix/$appdir || exit 1
327+ install -d -m 0755 $prefix/$appdir || exit 1
328 if [ "$2" = "--hardlinks" ]; then
329 bb_path="$prefix/bin/tinylogin"
330 else
331Index: passwd.c
332===================================================================
333RCS file: /var/cvs/tinylogin/passwd.c,v
334retrieving revision 1.19
335retrieving revision 1.20
336diff -u -r1.19 -r1.20
337--- a/passwd.c 7 Nov 2002 02:34:15 -0000 1.19
338+++ b/passwd.c 17 Feb 2003 11:51:55 -0000 1.20
339@@ -25,10 +25,6 @@
340 {
341 int x = 0; /* standart: DES */
342
343-#ifdef CONFIG_FEATURE_SHA1_PASSWORDS
344- if (strcasecmp(a, "sha1") == 0)
345- x = 2;
346-#endif
347 if (strcasecmp(a, "md5") == 0)
348 x = 1;
349 return x;
350@@ -394,11 +390,6 @@
351 bzero(cp, strlen(cp));
352 bzero(orig, sizeof(orig));
353
354-#ifdef CONFIG_FEATURE_SHA1_PASSWORDS
355- if (algo == 2) {
356- cp = pw_encrypt(pass, "$2$");
357- } else
358-#endif
359 if (algo == 1) {
360 cp = pw_encrypt(pass, "$1$");
361 } else
362Index: sha1.c
363===================================================================
364RCS file: sha1.c
365diff -N sha1.c
366--- a/sha1.c 20 Dec 2000 21:54:28 -0000 1.2
367+++ /dev/null 1 Jan 1970 00:00:00 -0000
368@@ -1,187 +0,0 @@
369-/* vi: set sw=4 ts=4: */
370-/*
371- Implements the Secure Hash Algorithm (SHA1)
372-
373- Copyright (C) 1999 Scott G. Miller
374-
375- Released under the terms of the GNU General Public License v2
376- see file COPYING for details
377-
378- Credits:
379- Robert Klep <robert@ilse.nl> -- Expansion function fix
380- ---
381- FIXME: This source takes int to be a 32 bit integer. This
382- may vary from system to system. I'd use autoconf if I was familiar
383- with it. Anyone want to help me out?
384-*/
385-
386-void sha_hash(int *, int *);
387-void sha_init(int *);
388-char *sprint_hash(int *);
389-void do_sha_hash(int *, int *);
390-
391-/*
392- added 3 functions for sha passowrd stuff (mainly inspired from stuff seen in main.c from shasum-1.3 package)
393-*/
394-#include <stdio.h>
395-#include <string.h>
396-#include <stdlib.h>
397-
398-#include <endian.h>
399-/* On big endian machines, we need to reverse the input to process
400- the blocks correctly */
401-
402-#define switch_endianness(x) (x<<24 & 0xff000000) | \
403- (x<<8 & 0x00ff0000) | \
404- (x>>8 & 0x0000ff00) | \
405- (x>>24 & 0x000000ff)
406-
407-/* Initial hash values */
408-#define Ai 0x67452301
409-#define Bi 0xefcdab89
410-#define Ci 0x98badcfe
411-#define Di 0x10325476
412-#define Ei 0xc3d2e1f0
413-
414-/* SHA1 round constants */
415-#define K1 0x5a827999
416-#define K2 0x6ed9eba1
417-#define K3 0x8f1bbcdc
418-#define K4 0xca62c1d6
419-
420-/* Round functions. Note that f2() is used in both rounds 2 and 4 */
421-#define f1(B,C,D) ((B & C) | ((~B) & D))
422-#define f2(B,C,D) (B ^ C ^ D)
423-#define f3(B,C,D) ((B & C) | (B & D) | (C & D))
424-
425-/* left circular shift functions (rotate left) */
426-#define rol1(x) ((x<<1) | ((x>>31) & 1))
427-#define rol5(A) ((A<<5) | ((A>>27) & 0x1f))
428-#define rol30(B) ((B<<30) | ((B>>2) & 0x3fffffff))
429-
430-/*
431- Hashes 'data', which should be a pointer to 512 bits of data (sixteen
432- 32 bit ints), into the ongoing 160 bit hash value (five 32 bit ints)
433- 'hash'
434-*/
435-void sha_hash(int *data, int *hash)
436-{
437- int W[80];
438- unsigned int A = hash[0], B = hash[1], C = hash[2], D = hash[3], E =
439- hash[4];
440- unsigned int t, x, TEMP;
441-
442- for (t = 0; t < 16; t++) {
443-#ifdef BIG_ENDIAN
444- W[t] = switch_endianness(data[t]);
445-#else
446- W[t] = data[t];
447-#endif
448- }
449-
450-
451- /* SHA1 Data expansion */
452- for (t = 16; t < 80; t++) {
453- x = W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16];
454- W[t] = rol1(x);
455- }
456-
457- /* SHA1 main loop (t=0 to 79)
458- This is broken down into four subloops in order to use
459- the correct round function and constant */
460- for (t = 0; t < 20; t++) {
461- TEMP = rol5(A) + f1(B, C, D) + E + W[t] + K1;
462- E = D;
463- D = C;
464- C = rol30(B);
465- B = A;
466- A = TEMP;
467- }
468- for (; t < 40; t++) {
469- TEMP = rol5(A) + f2(B, C, D) + E + W[t] + K2;
470- E = D;
471- D = C;
472- C = rol30(B);
473- B = A;
474- A = TEMP;
475- }
476- for (; t < 60; t++) {
477- TEMP = rol5(A) + f3(B, C, D) + E + W[t] + K3;
478- E = D;
479- D = C;
480- C = rol30(B);
481- B = A;
482- A = TEMP;
483- }
484- for (; t < 80; t++) {
485- TEMP = rol5(A) + f2(B, C, D) + E + W[t] + K4;
486- E = D;
487- D = C;
488- C = rol30(B);
489- B = A;
490- A = TEMP;
491- }
492- hash[0] += A;
493- hash[1] += B;
494- hash[2] += C;
495- hash[3] += D;
496- hash[4] += E;
497-}
498-
499-/*
500- Takes a pointer to a 160 bit block of data (five 32 bit ints) and
501- intializes it to the start constants of the SHA1 algorithm. This
502- must be called before using hash in the call to sha_hash
503-*/
504-void sha_init(int *hash)
505-{
506- hash[0] = Ai;
507- hash[1] = Bi;
508- hash[2] = Ci;
509- hash[3] = Di;
510- hash[4] = Ei;
511-}
512-
513-
514-/*
515- * write the hash to a string
516- */
517-char *sprint_sha1_hash(int *hashval)
518-{
519- int x = 0;
520- char *out = NULL;
521-
522- if ((out = malloc(43)) == NULL)
523- return NULL;
524- memset(out, 0x00, 43);
525- strcpy(out, "$2$");
526- for (x = 0; x < 5; x++) {
527- sprintf(out + (x * 8) + 3, "%08x", hashval[x]);
528- }
529- out[43] = 0;
530- return out;
531-}
532-
533-
534-/*
535- * hash the password
536- */
537-void do_sha_hash(int *hashval, int *pw)
538-{
539- sha_init(hashval);
540- sha_hash(pw, hashval);
541-}
542-
543-
544-/*
545- * hash a charakter string and return the 160bit integer in hex as a character string
546- */
547-char *sha1_crypt(const char *pw)
548-{
549- int hashval[20];
550-
551- memset(hashval, 0x00, sizeof(hashval));
552- do_sha_hash(hashval, (int *) ((char *) pw + 3));
553-
554- return sprint_sha1_hash(hashval);
555-}
556Index: vlock.c
557===================================================================
558RCS file: /var/cvs/tinylogin/vlock.c,v
559retrieving revision 1.13
560retrieving revision 1.14
561diff -u -r1.13 -r1.14
562--- a/vlock.c 19 Sep 2002 03:50:31 -0000 1.13
563+++ b/vlock.c 17 Feb 2003 11:51:56 -0000 1.14
564@@ -26,7 +26,7 @@
565 * minimalistic vlock.
566 */
567 /* Fixed by Erik Andersen to do passwords the tinylogin way...
568- * It now works with md5, sha1, etc passwords. */
569+ * It now works with md5, etc passwords. */
570
571 #include "tinylogin.h"
572 #include <stdio.h>
573Index: docs/tinylogin.busybox.net/index.html
574===================================================================
575RCS file: /var/cvs/tinylogin/docs/tinylogin.busybox.net/index.html,v
576retrieving revision 1.23
577retrieving revision 1.25
578diff -u -r1.23 -r1.25
579--- a/docs/tinylogin.busybox.net/index.html 3 Jan 2003 10:56:32 -0000 1.23
580+++ b/docs/tinylogin.busybox.net/index.html 3 Jan 2003 11:21:53 -0000 1.25
581@@ -56,6 +56,9 @@
582 Erik Andersen</a>, and licensed under the
583 <a href="http://www.gnu.org/copyleft/gpl.html">GNU GENERAL PUBLIC LICENSE</a>.
584
585+<h3>Mailing List Information</h3>
586+Here are the Tinylogin <a href="/lists/tinylogin/">mailing list archives</a><br>
587+To subscribe, go and visit <a href= "/mailman/listinfo/tinylogin">this page</a>.
588
589 <!-- Begin Download section -->
590
591@@ -222,19 +225,19 @@
592 <ul>
593 <li> <A HREF="http://freshmeat.net/projects/tinylogin/?highlight=tinylogin">
594 Freshmeat AppIndex record for TinyLogin</A>
595+ <p>
596
597 <li><a href="http://www.busybox.net/">BusyBox</a>
598 combines tiny versions of many common UNIX utilities into a single small
599 executable. It provides minimalist replacements for most of the utilities
600 you usually find on a standard Linux system.
601-
602 <p>
603+
604 <li><a href="http://uclibc.org/uClibc.html">uClibc</a>
605 is a C library for embedded systems. You can actually statically link
606 a "Hello World" application under x86 that only takes 4k (as opposed to
607 200k under GNU libc). It can do dynamic linking too and works nicely with
608 BusyBox to create very small embedded systems.
609-
610 <p>
611
612 </ul>
613Index: include/libbb.h
614===================================================================
615RCS file: /var/cvs/tinylogin/include/libbb.h,v
616retrieving revision 1.1
617retrieving revision 1.2
618diff -u -r1.1 -r1.2
619--- a/include/libbb.h 23 Jun 2002 03:09:10 -0000 1.1
620+++ b/include/libbb.h 17 Feb 2003 11:51:57 -0000 1.2
621@@ -39,9 +39,6 @@
622 #ifdef CONFIG_FEATURE_SHADOWPASSWDS
623 #include "shadow_.h"
624 #endif
625-#ifdef CONFIG_FEATURE_SHA1_PASSWORDS
626-# include "sha1.h"
627-#endif
628
629 #if (__GNU_LIBRARY__ < 5) && (!defined __dietlibc__)
630 /* libc5 doesn't define socklen_t */
631Index: include/sha1.h
632===================================================================
633RCS file: include/sha1.h
634diff -N include/sha1.h
635--- a/include/sha1.h 23 Jun 2002 03:09:10 -0000 1.1
636+++ /dev/null 1 Jan 1970 00:00:00 -0000
637@@ -1,3 +0,0 @@
638-/* SHA1.H - header file for SHA1.C */
639-
640-char *sha1_crypt(const char *pw);
641Index: include/usage.h
642===================================================================
643RCS file: /var/cvs/tinylogin/include/usage.h,v
644retrieving revision 1.2
645retrieving revision 1.3
646diff -u -r1.2 -r1.3
647--- a/include/usage.h 3 Jul 2002 05:57:00 -0000 1.2
648+++ b/include/usage.h 17 Feb 2003 11:51:57 -0000 1.3
649@@ -33,11 +33,6 @@
650 "\t-h\tName of the remote host for this login.\n" \
651 "\t-p\tPreserve environment."
652
653-#ifdef CONFIG_FEATURE_SHA1_PASSWORDS
654- #define PASSWORD_ALG_TYPES(a) a
655-#else
656- #define PASSWORD_ALG_TYPES(a)
657-#endif
658 #define passwd_trivial_usage \
659 "[OPTION] [name]"
660 #define passwd_full_usage \
661@@ -46,7 +41,6 @@
662 "Options:\n" \
663 "\t-a\tDefine which algorithm shall be used for the password.\n" \
664 "\t\t\t(Choices: des, md5" \
665- PASSWORD_ALG_TYPES(", sha1") \
666 ")\n\t-d\tDelete the password for the specified user account.\n" \
667 "\t-l\tLocks (disables) the specified user account.\n" \
668 "\t-u\tUnlocks (re-enables) the specified user account."
669Index: libbb/obscure.c
670===================================================================
671RCS file: /var/cvs/tinylogin/libbb/obscure.c,v
672retrieving revision 1.2
673retrieving revision 1.3
674diff -u -r1.2 -r1.3
675--- a/libbb/obscure.c 23 Jun 2002 04:05:59 -0000 1.2
676+++ b/libbb/obscure.c 30 Jul 2003 08:41:33 -0000 1.3
677@@ -44,7 +44,7 @@
678 * can't be a palindrome - like `R A D A R' or `M A D A M'
679 */
680
681-static int palindrome(const char *old, const char *newval)
682+static int palindrome(const char *newval)
683 {
684 int i, j;
685
686@@ -79,24 +79,25 @@
687 * a nice mix of characters.
688 */
689
690-static int simple(const char *old, const char *newval)
691+static int simple(const char *newval)
692 {
693 int digits = 0;
694 int uppers = 0;
695 int lowers = 0;
696 int others = 0;
697+ int c;
698 int size;
699 int i;
700
701- for (i = 0; newval[i]; i++) {
702- if (isdigit(newval[i]))
703- digits++;
704- else if (isupper(newval[i]))
705- uppers++;
706- else if (islower(newval[i]))
707- lowers++;
708+ for (i = 0; (c = *newval++) != 0; i++) {
709+ if (isdigit(c))
710+ digits = c;
711+ else if (isupper(c))
712+ uppers = c;
713+ else if (islower(c))
714+ lowers = c;
715 else
716- others++;
717+ others = c;
718 }
719
720 /*
721@@ -129,49 +130,53 @@
722 return string;
723 }
724
725-static char *password_check(const char *old, const char *newval, const struct passwd *pwdp)
726+static const char *
727+password_check(const char *old, const char *newval, const struct passwd *pwdp)
728 {
729- char *msg = NULL;
730- char *oldmono, *newmono, *wrapped;
731+ const char *msg;
732+ char *newmono, *wrapped;
733+ int lenwrap;
734
735 if (strcmp(newval, old) == 0)
736 return "no change";
737+ if (simple(newval))
738+ return "too simple";
739
740+ msg = NULL;
741 newmono = str_lower(xstrdup(newval));
742- oldmono = str_lower(xstrdup(old));
743- wrapped = (char *) xmalloc(strlen(oldmono) * 2 + 1);
744- strcpy(wrapped, oldmono);
745- strcat(wrapped, oldmono);
746+ lenwrap = strlen(old) * 2 + 1;
747+ wrapped = (char *) xmalloc(lenwrap);
748+ str_lower(strcpy(wrapped, old));
749
750- if (palindrome(oldmono, newmono))
751+ if (palindrome(newmono))
752 msg = "a palindrome";
753
754- if (!msg && strcmp(oldmono, newmono) == 0)
755+ else if (strcmp(wrapped, newmono) == 0)
756 msg = "case changes only";
757
758- if (!msg && similiar(oldmono, newmono))
759+ else if (similiar(wrapped, newmono))
760 msg = "too similiar";
761
762- if (!msg && simple(old, newval))
763- msg = "too simple";
764-
765- if (!msg && strstr(wrapped, newmono))
766- msg = "rotated";
767+ else {
768+ safe_strncpy(wrapped + lenwrap, wrapped, lenwrap + 1);
769+ if (strstr(wrapped, newmono))
770+ msg = "rotated";
771+ }
772
773 bzero(newmono, strlen(newmono));
774- bzero(oldmono, strlen(oldmono));
775- bzero(wrapped, strlen(wrapped));
776+ bzero(wrapped, lenwrap);
777 free(newmono);
778- free(oldmono);
779 free(wrapped);
780
781 return msg;
782 }
783
784-static char *obscure_msg(const char *old, const char *newval, const struct passwd *pwdp)
785+static const char *
786+obscure_msg(const char *old, const char *newval, const struct passwd *pwdp)
787 {
788 int maxlen, oldlen, newlen;
789- char *new1, *old1, *msg;
790+ char *new1, *old1;
791+ const char *msg;
792
793 oldlen = strlen(old);
794 newlen = strlen(newval);
795@@ -233,7 +238,7 @@
796
797 extern int obscure(const char *old, const char *newval, const struct passwd *pwdp)
798 {
799- char *msg = obscure_msg(old, newval, pwdp);
800+ const char *msg = obscure_msg(old, newval, pwdp);
801
802 /* if (msg) { */
803 if (msg != NULL) {
804Index: libbb/pw_encrypt.c
805===================================================================
806RCS file: /var/cvs/tinylogin/libbb/pw_encrypt.c,v
807retrieving revision 1.1
808retrieving revision 1.2
809diff -u -r1.1 -r1.2
810--- a/libbb/pw_encrypt.c 23 Jun 2002 03:09:12 -0000 1.1
811+++ b/libbb/pw_encrypt.c 17 Feb 2003 11:51:58 -0000 1.2
812@@ -30,11 +30,6 @@
813 static char cipher[128];
814 char *cp;
815
816-#ifdef CONFIG_FEATURE_SHA1_PASSWORDS
817- if (strncmp(salt, "$2$", 3) == 0) {
818- return sha1_crypt(clear);
819- }
820-#endif
821 cp = (char *) crypt(clear, salt);
822 /* if crypt (a nonstandard crypt) returns a string too large,
823 truncate it so we don't overrun buffers and hope there is
diff --git a/meta/recipes-core/tinylogin/tinylogin-1.4/glibc_crypt_fix.patch b/meta/recipes-core/tinylogin/tinylogin-1.4/glibc_crypt_fix.patch
deleted file mode 100644
index 0a24656d09..0000000000
--- a/meta/recipes-core/tinylogin/tinylogin-1.4/glibc_crypt_fix.patch
+++ /dev/null
@@ -1,23 +0,0 @@
1
2staring from glibc 2.17 the crypt() function will error out and return
3NULL if the seed or "correct" is invalid. The failure case for this is
4an unknown user which tinylogin assigns '!' for the password. crypt()
5now expects a minimum of 2 valid characters. If we get a NULL return
6value from the crypt, assume we fail and return 0.
7
8Upstream-Status: Inappropriate [tinylogin depercated]
9Signed-off-by: Saul Wold <sgw@linux.intel.com>
10
11Index: tinylogin-1.4/libbb/correct_password.c
12===================================================================
13--- tinylogin-1.4.orig/libbb/correct_password.c
14+++ tinylogin-1.4/libbb/correct_password.c
15@@ -74,5 +74,8 @@ int correct_password ( const struct pass
16 }
17 encrypted = crypt ( unencrypted, correct );
18 memset ( unencrypted, 0, xstrlen ( unencrypted ));
19+ if ( !encrypted )
20+ return 0;
21+
22 return ( strcmp ( encrypted, correct ) == 0 ) ? 1 : 0;
23 }
diff --git a/meta/recipes-core/tinylogin/tinylogin-1.4/passwd_rotate_check.patch b/meta/recipes-core/tinylogin/tinylogin-1.4/passwd_rotate_check.patch
deleted file mode 100644
index 513ee5eda7..0000000000
--- a/meta/recipes-core/tinylogin/tinylogin-1.4/passwd_rotate_check.patch
+++ /dev/null
@@ -1,41 +0,0 @@
1Upstream-Status: Inappropriate [legacy version]
2
3Fix rotate check logic
4
5Rotate passwd checking code has logic error, which writes data into
6un-allocated memory. This patch fixes the issue.
7
8Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
9
10diff --git a/libbb/obscure.c b/libbb/obscure.c
11index 750b611..4a07b5f 100644
12--- a/libbb/obscure.c
13+++ b/libbb/obscure.c
14@@ -135,7 +135,7 @@ password_check(const char *old, const char *newval, const struct passwd *pwdp)
15 {
16 const char *msg;
17 char *newmono, *wrapped;
18- int lenwrap;
19+ int lenold, lenwrap;
20
21 if (strcmp(newval, old) == 0)
22 return "no change";
23@@ -144,7 +144,8 @@ password_check(const char *old, const char *newval, const struct passwd *pwdp)
24
25 msg = NULL;
26 newmono = str_lower(xstrdup(newval));
27- lenwrap = strlen(old) * 2 + 1;
28+ lenold = strlen(old);
29+ lenwrap = lenold * 2 + 1;
30 wrapped = (char *) xmalloc(lenwrap);
31 str_lower(strcpy(wrapped, old));
32
33@@ -158,7 +159,7 @@ password_check(const char *old, const char *newval, const struct passwd *pwdp)
34 msg = "too similiar";
35
36 else {
37- safe_strncpy(wrapped + lenwrap, wrapped, lenwrap + 1);
38+ safe_strncpy(wrapped + lenold, wrapped, lenold + 1);
39 if (strstr(wrapped, newmono))
40 msg = "rotated";
41 }
diff --git a/meta/recipes-core/tinylogin/tinylogin-1.4/remove-index.patch b/meta/recipes-core/tinylogin/tinylogin-1.4/remove-index.patch
deleted file mode 100644
index 9d3c3242da..0000000000
--- a/meta/recipes-core/tinylogin/tinylogin-1.4/remove-index.patch
+++ /dev/null
@@ -1,13 +0,0 @@
1Upstream-Status: Inappropriate [legacy version]
2
3--- /tmp/deluser.c 2007-05-13 10:38:19.000000000 +0200
4+++ tinylogin-1.4/deluser.c 2007-05-13 10:38:50.185251000 +0200
5@@ -60,7 +60,7 @@
6 }
7 start++;
8
9- stop = index(start, '\n'); /* index is a BSD-ism */
10+ stop = strchr(start, '\n'); /* index is a BSD-ism, strchr hopefully isn't */
11 b.start = start - buffer;
12 b.stop = stop - buffer;
13 return b;
diff --git a/meta/recipes-core/tinylogin/tinylogin-1.4/use_O2_option.patch b/meta/recipes-core/tinylogin/tinylogin-1.4/use_O2_option.patch
deleted file mode 100644
index 5b8806067a..0000000000
--- a/meta/recipes-core/tinylogin/tinylogin-1.4/use_O2_option.patch
+++ /dev/null
@@ -1,21 +0,0 @@
1Upstream-Status: Inappropriate [configuration]
2
3tinylogin will meet segment fault if compiled by gcc-4.5.0 when enable both
4frename-registers and Os options. Use O2 instead.
5
6Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
7
8diff -ruN tinylogin-1.4-orig/Makefile tinylogin-1.4/Makefile
9--- tinylogin-1.4-orig/Makefile 2010-09-16 13:02:06.302192295 +0800
10+++ tinylogin-1.4/Makefile 2010-09-16 13:02:34.634167846 +0800
11@@ -97,9 +97,7 @@
12 #--------------------------------------------------------
13
14
15-# use '-Os' optimization if available, else use -O2
16-OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
17- then echo "-Os"; else echo "-O2" ; fi)
18+OPTIMIZATION = -O2
19
20 WARNINGS = -Wall
21
diff --git a/meta/recipes-core/tinylogin/tinylogin_1.4.bb b/meta/recipes-core/tinylogin/tinylogin_1.4.bb
deleted file mode 100644
index d1da0e2880..0000000000
--- a/meta/recipes-core/tinylogin/tinylogin_1.4.bb
+++ /dev/null
@@ -1,45 +0,0 @@
1SECTION = "base"
2SUMMARY = "Tiny versions of many common login, authentication and related utilities."
3DESCRIPTION = "TinyLogin is a suite of tiny UNIX \
4utilities for handling logins, user authentication, \
5changing passwords, and otherwise maintaining users \
6and groups on an embedded system."
7HOMEPAGE = "http://tinylogin.busybox.net/"
8LICENSE = "GPLv2"
9LIC_FILES_CHKSUM="file://LICENSE;md5=f1060fa3a366f098b5b1d8c2077ba269"
10PR = "r9"
11
12inherit update-alternatives
13
14SRC_URI = "http://www.angstrom-distribution.org/unstable/sources/tinylogin-${PV}.tar.bz2 \
15 file://cvs-20040608.patch \
16 file://add-system.patch \
17 file://adduser-empty_pwd.patch \
18 file://remove-index.patch \
19 file://use_O2_option.patch \
20 file://passwd_rotate_check.patch \
21 file://avoid_static.patch \
22 file://glibc_crypt_fix.patch \
23 "
24
25SRC_URI[md5sum] = "44da0ff2b727455669890b24305e351d"
26SRC_URI[sha256sum] = "5e542e4b7825305a3678bf73136c392feb0d44b8bbf926e8eda5453eea7ddd6b"
27
28EXTRA_OEMAKE = ""
29
30do_compile () {
31 oe_runmake 'CC=${CC}' 'CROSS=${HOST_PREFIX}' 'DODEBUG=true'
32}
33
34do_install () {
35 install -d ${D}${base_bindir}
36 install -m 4755 tinylogin ${D}${base_bindir}/tinylogin
37 for i in `cat tinylogin.links`; do
38 mkdir -p ${D}/`dirname $i`
39 ln -sf /bin/tinylogin ${D}$i
40 done
41}
42
43ALTERNATIVE_${PN} = "getty"
44ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty"
45ALTERNATIVE_PRIORITY = "80"