Add -k,--umask option, Gentoo #232455.

This commit is contained in:
Roy Marples
2008-08-20 10:02:11 +00:00
parent a9f7d2d5e5
commit 1ab1e9328a
5 changed files with 36 additions and 24 deletions

View File

@@ -106,28 +106,6 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode, int file)
return 0;
}
/* Based on busybox */
static int parse_mode (mode_t *mode, char *text)
{
char *p;
unsigned long l;
/* Check for a numeric mode */
if ((*text - '0') < 8) {
l = strtoul(text, &p, 8);
if (*p || l > 07777U) {
errno = EINVAL;
return -1;
}
*mode = (mode_t) l;
return 0;
}
/* We currently don't check g+w type stuff */
errno = EINVAL;
return -1;
}
static int parse_owner(struct passwd **user, struct group **group,
const char *owner)
{