// + Synonyms (switch on all) [+abc] means -ab=-abc, -c=-abc
// ! More than one in group is error [!abc] means -ab calls error_exit()
// primarily useful if you can switch things back off again.
-//
// Notes from getopt man page
// - and -- cannot be arguments.
// generate appropriate random salt string for given encryption algorithm.
int get_salt(char *salt, char *algo)
-{
+{
struct {
char *type, id, len;
} al[] = {{"des", 0, 2}, {"md5", 1, 8}, {"sha256", 5, 16}, {"sha512", 6, 16}};
}
/*update_password is used by multiple utilities to update /etc/passwd,
- * /etc/shadow, /etc/group and /etc/gshadow files,
+ * /etc/shadow, /etc/group and /etc/gshadow files,
* which are used as user, group databeses
- * entry can be
+ * entry can be
* 1. encrypted password, when updating user password.
* 2. complete entry for user details, when creating new user
* 3. group members comma',' separated list, when adding user to group
current_ptr = get_nextcolon(current_ptr, 1);
fprintf(newfp, "%s\n",current_ptr);
} else fprintf(newfp, "%s\n",current_ptr);
- } else if (!strcmp(toys.which->name, "groupadd") ||
+ } else if (!strcmp(toys.which->name, "groupadd") ||
!strcmp(toys.which->name, "addgroup") ||
!strcmp(toys.which->name, "delgroup") ||
!strcmp(toys.which->name, "groupdel")){
// Cannonicalize path, even to file with one or more missing components at end.
// if exact, require last path component to exist
-char *xabspath(char *path, int exact)
+char *xabspath(char *path, int exact)
{
struct string_list *todo, *done = 0;
int try = 9999, dirfd = open("/", 0);;
if (CFG_TOYBOX_FLOAT) d = strtod(arg, &arg);
else l = strtoul(arg, &arg, 10);
-
+
// Parse suffix
if (*arg) {
int ismhd[]={1,60,3600,86400}, i = stridx("smhd", *arg);