[Mono-bugs] [Bug 78751][Nor] New - Process start fails, if getwd() isn't accessible

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Jul 3 06:25:28 EDT 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 pawel.sakowski at mindbreeze.com.


--- shadow/78751	2006-07-03 06:25:28.000000000 -0400
+++ shadow/78751.tmp.601	2006-07-03 06:25:28.000000000 -0400
@@ -0,0 +1,64 @@
+Bug#: 78751
+Product: Mono: Runtime
+Version: 1.1
+OS: GNU/Linux [Other]
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: io-layer
+AssignedTo: dick at ximian.com                            
+ReportedBy: pawel.sakowski at mindbreeze.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Process start fails, if getwd() isn't accessible
+Description of Problem:
+If no explicit directory change is requested in a
+System.Diagnostics.Process, CreateProcess calls chdir(g_get_current_dir()).
+This is unnecessary, and fails if the cwd isn't accessible. The failure is
+pretty mysterious, since the exact same code works perfectly when started
+from another directory (which normally isn't expected to have any impact).
+Steps to reproduce the problem:
+1. Build /tmp/y.exe out of:
+using System;
+using System.Diagnostics;
+using System.IO;
+class Y {
+static void Main() {
+Process p = new Process();
+p.StartInfo.FileName = "/bin/date";
+2. Issue:
+$ su -
+# mkdir /tmp/dir
+# chmod 700 /tmp/dir
+# cd /tmp/dir
+# su anynonrootuser
+$ mono /tmp/y.exe
+Actual Results:
+Expected Results:
+current date
+How often does this happen? 
+Additional Information:
+When invoked from another directory, or the SetCurrentDirectory line (the
+known workaround) is commented out, the expected results are obtained.

More information about the mono-bugs mailing list