[PATCH] fallocate: create mode 0666, that's what umask is for

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



User's umask will typically mask the mode down to 0664 or 0644.
---
 sys-utils/fallocate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c
index 0e06524b8c5837a63230dc047233c657c50c1d7c..9af3bb8ce1492defda57cc17764197790bb34c8e 100644
--- a/sys-utils/fallocate.c
+++ b/sys-utils/fallocate.c
@@ -365,7 +365,7 @@ int main(int argc, char **argv)
 
 	/* O_CREAT makes sense only for the default fallocate(2) behavior
 	 * when mode is no specified and new space is allocated */
-	fd = open(filename, O_RDWR | (!dig && !mode ? O_CREAT : 0), 0644);
+	fd = open(filename, O_RDWR | (!dig && !mode ? O_CREAT : 0), 0666);
 	if (fd < 0)
 		err(EXIT_FAILURE, _("cannot open %s"), filename);
 
-- 
2.2.1

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux