Introduction
Introduction Statistics Contact Development Disclaimer Help
find: Use the current umask to parse -perm - sbase - suckless unix tools
git clone git://git.suckless.org/sbase
Log
Files
Refs
README
LICENSE
---
commit 8f9824e34bbf5a7c61a425ebfca93bff6364ecb9
parent e861343db1d13e1e7497e81db56526fd5505704b
Author: Tavian Barnes <[email protected]>
Date: Sat, 22 Feb 2025 13:14:49 +0100
find: Use the current umask to parse -perm
https://www.austingroupbugs.net/view.php?id=1392
Diffstat:
M find.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/find.c b/find.c
@@ -516,6 +516,7 @@ get_xdev_arg(char *argv[], union extra *extra)
static char **
get_perm_arg(char *argv[], union extra *extra)
{
+ mode_t mask;
struct permarg *p = extra->p = emalloc(sizeof(*p));
if (**argv == '-')
@@ -523,7 +524,10 @@ get_perm_arg(char *argv[], union extra *extra)
else
p->exact = 1;
- p->mode = parsemode(*argv, 0, 0);
+ mask = umask(0);
+ umask(mask);
+
+ p->mode = parsemode(*argv, 0, mask);
return argv;
}
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.