from a security prespective, touch should not allow
everyone to have write permissions to the file, if
someones needs such a permission, chmod(1) can be
used later.
I have tried touch(1) from coreutils and OpenBSD,
both set the default permissions to 644.
Raiz
diff --git a/touch.c b/touch.c
index 6e63bf8..a849901 100644
--- a/touch.c
+++ b/touch.c
@@ -26,7 +26,7 @@ touch(const char *file)
eprintf("utimensat %s:", file);
if (cflag)
return;
- if ((fd = open(file, O_WRONLY | O_CREAT | O_EXCL, 0666)) < 0)
+ if ((fd = open(file, O_WRONLY | O_CREAT | O_EXCL, 0644)) < 0)
eprintf("open %s:", file);
ret = futimens(fd, times);
close(fd);