[Mono-bugs] [Bug 82632][Min] New - new files are created with 0644 mode
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Thu Aug 30 09:14:47 EDT 2007
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by noix at sphere.pl.
http://bugzilla.ximian.com/show_bug.cgi?id=82632
--- shadow/82632 2007-08-30 09:14:46.000000000 -0400
+++ shadow/82632.tmp.15502 2007-08-30 09:14:46.000000000 -0400
@@ -0,0 +1,58 @@
+Bug#: 82632
+Product: Mono: Class Libraries
+Version: 1.2
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Minor
+Component: System
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: noix at sphere.pl
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: new files are created with 0644 mode
+
+Description of Problem:
+New files created by, for example, File.Create() are created with "mode" 0644.
+Wouldn't it be better if they were created with 0666 mode, leaving the rest
+to umask?
+Usually the default umask in Linux distros is 0022 and then it doesn't
+matter if creation mode is 0644 or 0666.
+However, I encountered a situation when I needed newly created files to
+have write permission for group and setting umask to 0002 wasn't enough.
+
+I don't see any downside for creating new files with 0666 in mono instead
+of 0644, is there any?
+
+A short program demonstrating this "problem":
+
+using System.IO;
+public class TestUmask {
+ public static void Main() {
+ File.Create("test.tmp");
+ }
+}
+
+It creates "test.tmp" file with 0644 permission regardless if umask is 0022
+or 0002 -- because the file creation syscall is (as seen with strace):
+open("test.tmp", O_RDWR|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 5
+
+
+Steps to reproduce the problem:
+1. set umask to 0002
+2. compile the program above
+3. run it
+4. check permissions of newly created test.tmp
+
+Actual Results:
+file with 0644 permissions
+
+Expected Results:
+file with 0664 permissions
+
+How often does this happen?
+always
More information about the mono-bugs
mailing list