parsemode: rework

- for octal input: reset mode to 0.
- take umask into account.
- make '=rwx' etc work.
- we wont support crazy but valid modes like "a+rw,g=x,o=g"
- uudecode: use parsemode, mask is 0.

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
This commit is contained in:
Hiltjo Posthuma
2014-04-23 21:28:59 +02:00
committed by sin
parent a1b62b2282
commit bd99b92e91
4 changed files with 68 additions and 51 deletions

3
util.h
View File

@@ -27,4 +27,5 @@ size_t strlcat(char *, const char *, size_t);
size_t strlcpy(char *, const char *, size_t);
void weprintf(const char *, ...);
void parsemode(const char *, mode_t *, int *);
mode_t getumask(void);
mode_t parsemode(const char *, mode_t, mode_t);