[Mono-bugs] [Bug 77636][Wis] New - Mono.Unix.Native.Syscall.stat()
returns random modes on dangling symlinks
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Fri Feb 24 10:20:09 EST 2006
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 mondalaci at gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=77636
--- shadow/77636 2006-02-24 10:20:09.000000000 -0500
+++ shadow/77636.tmp.23210 2006-02-24 10:20:09.000000000 -0500
@@ -0,0 +1,83 @@
+Bug#: 77636
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Mono.POSIX
+AssignedTo: miguel at ximian.com
+ReportedBy: mondalaci at gmail.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Mono.Unix.Native.Syscall.stat() returns random modes on dangling symlinks
+
+Description of Problem:
+
+Using the Mono.Unix.Native.Syscall.stat(string, out Stat) method returns
+random mode fields with each individual execution of the process.
+
+
+Steps to reproduce the problem:
+
+1. Put the code below in the file "stat-test.cs" and compile it.
+
+using System;
+using MUN = Mono.Unix.Native;
+
+public class StatTest {
+ public static void Main(string[] argv)
+ {
+ if (argv.Length == 0) {
+ Console.WriteLine("You gotta give the filename to stat, dude.");
+ System.Environment.Exit(1);
+ }
+
+ string filename = argv[0];
+
+ MUN.Stat stat;
+ MUN.Syscall.stat(filename, out stat);
+
+ Console.WriteLine(stat.st_mode & MUN.FilePermissions.S_IFMT);
+ }
+}
+
+2. Create a dangling symlink: `ln -s random-stupid-filename dangling-link'
+
+3. Execute the code: mono ./stat-test.exe dangling-link
+
+
+Actual Results:
+
+The stat() call returns random mode values. Here is the output of 10
+individual executions from the command line in sequence:
+
+S_IFIFO, S_IFDIR
+S_IFIFO, S_IFDIR
+S_IFCHR
+S_IFMT
+S_IFIFO, S_IFLNK
+S_IFLNK
+S_IFBLK
+S_IFSOCK
+S_IFDIR
+S_IFCHR
+
+
+Expected Results:
+
+stat() should return a correct mode value every time consistently.
+
+
+How often does this happen?
+
+See above.
+
+
+Additional Information:
+
+None.
More information about the mono-bugs
mailing list