summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/tinylogin/tinylogin-1.4/add-system.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/tinylogin/tinylogin-1.4/add-system.patch')
-rw-r--r--meta/recipes-core/tinylogin/tinylogin-1.4/add-system.patch115
1 files changed, 115 insertions, 0 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
new file mode 100644
index 0000000000..18b4e47ad7
--- /dev/null
+++ b/meta/recipes-core/tinylogin/tinylogin-1.4/add-system.patch
@@ -0,0 +1,115 @@
1? add-system.patch
2? cvs-20040608.patch
3? familiar
4? pod2htmd.tmp
5? pod2htmi.tmp
6? system.diff
7? tinylogin_1.4-20030620.1_arm.ipk
8? tinylogin_1.4-20030620.1_arm.ipk.asc
9? tinylogin_1.4-20030620.1_arm.ipk.upload.html
10? tinylogin_1.4-20030620.2_arm.ipk
11? tinylogin_1.4-20030620.2_arm.ipk.asc
12? tinylogin_1.4-20030620.2_arm.ipk.upload.html
13? tinylogin_1.4-20030620_arm.ipk
14? tinylogin_1.4-20030620_arm.ipk.asc
15? tinylogin_1.4-20030620_arm.ipk.upload.html
16? tmp
17Index: addgroup.c
18===================================================================
19RCS file: /var/cvs/tinylogin/addgroup.c,v
20retrieving revision 1.23
21diff -u -r1.23 addgroup.c
22--- a/addgroup.c 9 Jan 2003 18:43:29 -0000 1.23
23+++ b/addgroup.c 8 Jun 2004 08:56:08 -0000
24@@ -31,6 +31,7 @@
25 #include <sys/stat.h>
26 #include <sys/types.h>
27 #include <unistd.h>
28+#include <getopt.h>
29 #include "tinylogin.h"
30
31 #define GROUP_FILE "/etc/group"
32@@ -124,6 +125,11 @@
33 return 0;
34 }
35
36+static struct option long_options[] = {
37+ { "system", 0, NULL, 'S' },
38+ { 0, 0, 0, 0 }
39+};
40+
41 /*
42 * addgroup will take a login_name as its first parameter.
43 *
44@@ -136,14 +142,19 @@
45 int opt;
46 char *group;
47 char *user;
48+ int option_index = -1;
49 gid_t gid = 0;
50+ int system = 0;
51
52 /* get remaining args */
53- while ((opt = getopt (argc, argv, "g:")) != -1) {
54+ while ((opt = getopt_long (argc, argv, "g:S", long_options, &option_index)) != -1) {
55 switch (opt) {
56 case 'g':
57 gid = strtol(optarg, NULL, 10);
58 break;
59+ case 'S':
60+ system = 1;
61+ break;
62 default:
63 show_usage();
64 break;
65Index: adduser.c
66===================================================================
67RCS file: /var/cvs/tinylogin/adduser.c,v
68retrieving revision 1.38
69diff -u -r1.38 adduser.c
70--- a/adduser.c 21 Jun 2003 19:35:42 -0000 1.38
71+++ b/adduser.c 8 Jun 2004 08:56:09 -0000
72@@ -66,13 +66,13 @@
73
74 /* remix */
75 /* EDR recoded such that the uid may be passed in *p */
76-static int passwd_study(const char *filename, struct passwd *p)
77+static int passwd_study(const char *filename, struct passwd *p, int system)
78 {
79 struct passwd *pw;
80 FILE *passwd;
81
82- const int min = 500;
83- const int max = 65000;
84+ const int min = system ? 10 : 500;
85+ const int max = system ? 99 : 65000;
86
87 passwd = wfopen(filename, "r");
88 if (!passwd)
89@@ -142,7 +142,7 @@
90 }
91
92 /* putpwent(3) remix */
93-static int adduser(const char *filename, struct passwd *p, int makehome, int setpass)
94+static int adduser(const char *filename, struct passwd *p, int makehome, int setpass, int system)
95 {
96 FILE *passwd;
97 int r;
98@@ -165,7 +165,7 @@
99 fseek(passwd, 0, SEEK_END);
100
101 /* if (passwd_study(filename, p) == 0) { */
102- r = passwd_study(filename, p);
103+ r = passwd_study(filename, p, system);
104 if (r) {
105 if (r == 1)
106 error_msg("%s: login already in use", p->pw_name);
107@@ -357,7 +357,7 @@
108 }
109
110 /* grand finale */
111- return adduser(PASSWD_FILE, &pw, makehome, setpass);
112+ return adduser(PASSWD_FILE, &pw, makehome, setpass, system);
113 }
114
115 /* $Id: adduser.c,v 1.38 2003/06/21 19:35:42 andersen Exp $ */