118 lines
3.0 KiB
Diff
118 lines
3.0 KiB
Diff
Upstream-Status: Backport
|
|
|
|
? add-system.patch
|
|
? cvs-20040608.patch
|
|
? familiar
|
|
? pod2htmd.tmp
|
|
? pod2htmi.tmp
|
|
? system.diff
|
|
? tinylogin_1.4-20030620.1_arm.ipk
|
|
? tinylogin_1.4-20030620.1_arm.ipk.asc
|
|
? tinylogin_1.4-20030620.1_arm.ipk.upload.html
|
|
? tinylogin_1.4-20030620.2_arm.ipk
|
|
? tinylogin_1.4-20030620.2_arm.ipk.asc
|
|
? tinylogin_1.4-20030620.2_arm.ipk.upload.html
|
|
? tinylogin_1.4-20030620_arm.ipk
|
|
? tinylogin_1.4-20030620_arm.ipk.asc
|
|
? tinylogin_1.4-20030620_arm.ipk.upload.html
|
|
? tmp
|
|
Index: addgroup.c
|
|
===================================================================
|
|
RCS file: /var/cvs/tinylogin/addgroup.c,v
|
|
retrieving revision 1.23
|
|
diff -u -r1.23 addgroup.c
|
|
--- a/addgroup.c 9 Jan 2003 18:43:29 -0000 1.23
|
|
+++ b/addgroup.c 8 Jun 2004 08:56:08 -0000
|
|
@@ -31,6 +31,7 @@
|
|
#include <sys/stat.h>
|
|
#include <sys/types.h>
|
|
#include <unistd.h>
|
|
+#include <getopt.h>
|
|
#include "tinylogin.h"
|
|
|
|
#define GROUP_FILE "/etc/group"
|
|
@@ -124,6 +125,11 @@
|
|
return 0;
|
|
}
|
|
|
|
+static struct option long_options[] = {
|
|
+ { "system", 0, NULL, 'S' },
|
|
+ { 0, 0, 0, 0 }
|
|
+};
|
|
+
|
|
/*
|
|
* addgroup will take a login_name as its first parameter.
|
|
*
|
|
@@ -136,14 +142,19 @@
|
|
int opt;
|
|
char *group;
|
|
char *user;
|
|
+ int option_index = -1;
|
|
gid_t gid = 0;
|
|
+ int system = 0;
|
|
|
|
/* get remaining args */
|
|
- while ((opt = getopt (argc, argv, "g:")) != -1) {
|
|
+ while ((opt = getopt_long (argc, argv, "g:S", long_options, &option_index)) != -1) {
|
|
switch (opt) {
|
|
case 'g':
|
|
gid = strtol(optarg, NULL, 10);
|
|
break;
|
|
+ case 'S':
|
|
+ system = 1;
|
|
+ break;
|
|
default:
|
|
show_usage();
|
|
break;
|
|
Index: adduser.c
|
|
===================================================================
|
|
RCS file: /var/cvs/tinylogin/adduser.c,v
|
|
retrieving revision 1.38
|
|
diff -u -r1.38 adduser.c
|
|
--- a/adduser.c 21 Jun 2003 19:35:42 -0000 1.38
|
|
+++ b/adduser.c 8 Jun 2004 08:56:09 -0000
|
|
@@ -66,13 +66,13 @@
|
|
|
|
/* remix */
|
|
/* EDR recoded such that the uid may be passed in *p */
|
|
-static int passwd_study(const char *filename, struct passwd *p)
|
|
+static int passwd_study(const char *filename, struct passwd *p, int system)
|
|
{
|
|
struct passwd *pw;
|
|
FILE *passwd;
|
|
|
|
- const int min = 500;
|
|
- const int max = 65000;
|
|
+ const int min = system ? 10 : 500;
|
|
+ const int max = system ? 99 : 65000;
|
|
|
|
passwd = wfopen(filename, "r");
|
|
if (!passwd)
|
|
@@ -142,7 +142,7 @@
|
|
}
|
|
|
|
/* putpwent(3) remix */
|
|
-static int adduser(const char *filename, struct passwd *p, int makehome, int setpass)
|
|
+static int adduser(const char *filename, struct passwd *p, int makehome, int setpass, int system)
|
|
{
|
|
FILE *passwd;
|
|
int r;
|
|
@@ -165,7 +165,7 @@
|
|
fseek(passwd, 0, SEEK_END);
|
|
|
|
/* if (passwd_study(filename, p) == 0) { */
|
|
- r = passwd_study(filename, p);
|
|
+ r = passwd_study(filename, p, system);
|
|
if (r) {
|
|
if (r == 1)
|
|
error_msg("%s: login already in use", p->pw_name);
|
|
@@ -357,7 +357,7 @@
|
|
}
|
|
|
|
/* grand finale */
|
|
- return adduser(PASSWD_FILE, &pw, makehome, setpass);
|
|
+ return adduser(PASSWD_FILE, &pw, makehome, setpass, system);
|
|
}
|
|
|
|
/* $Id: adduser.c,v 1.38 2003/06/21 19:35:42 andersen Exp $ */
|