CyberCircuits / nekodrive

Automatically exported from code.google.com/p/nekodrive
0 stars 0 forks source link

MOUNTPROC_MNT_1: errorcode 13 #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. start program
2. set nfs server ip connect then select the mount point
3. error occurs

What is the expected output? What do you see instead?
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ApplicationException: MOUNTPROC_MNT_1: errorcode 13
   at NFSLibrary.Protocols.V2.NFSv2.MountDevice(String DeviceName)
   at NFSLibrary.NFSClient.MountDevice(String DeviceName)
   at NFSClient.MainForm.MountDevice(Int32 i)
   at NFSClient.MainForm.cboxRemoteDevices_SelectedIndexChanged(Object sender, EventArgs e)
   at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
   at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
   at System.Windows.Forms.ComboBox.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3615 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
NFSClient
    Assembly Version: 1.3.3925.28653
    Win32 Version: 1.3.0.0
    CodeBase: file:///P:/NfsTestClient/NFSClient/NFSClient.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3614 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
NFSLibrary
    Assembly Version: 0.6.3925.28652
    Win32 Version: 0.6.0.0
    CodeBase: file:///P:/NfsTestClient/NFSClient/NFSLibrary.DLL
----------------------------------------
RemoteTea.Net
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///P:/NfsTestClient/NFSClient/RemoteTea.Net.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

What version of the product are you using? On what operating system?
NFSClientCSharp 0.6 but previous release had the same error. Windows XP machine 
is client, ubuntu 10.04 is nfs server,

NFS Server export settings
/home/freak/Projects/TOVideosTEST 192.168.0.14(rw,sync,no_subtree_check)

NFSClientCSharp_0_4_1_4 does not have this problem...

Please provide any additional information below.

Original issue reported on code.google.com by freakm...@gmail.com on 30 Sep 2010 at 10:09

Attachments:

GoogleCodeExporter commented 8 years ago
Hi, versions >= 0.5 use new NFS libraries in full c#, and maybe there are 
problems. I will investigate as soon as possible. Thank you for the feedback!

Original comment by mirko.ga...@gmail.com on 1 Oct 2010 at 10:25

GoogleCodeExporter commented 8 years ago

Original comment by mirko.ga...@gmail.com on 1 Oct 2010 at 10:25

GoogleCodeExporter commented 8 years ago
Anyway, can you try NFSV3 instead of NFSV2? They use completely different code.

Original comment by mirko.ga...@gmail.com on 1 Oct 2010 at 10:26

GoogleCodeExporter commented 8 years ago
nothings change..

error output is the following;

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ApplicationException: MOUNTPROC3_MNT_3: errorcode 13
   at NFSLibrary.Protocols.V3.NFSv3.MountDevice(String DeviceName)
   at NFSLibrary.NFSClient.MountDevice(String DeviceName)
   at NFSClient.MainForm.MountDevice(Int32 i)
   at NFSClient.MainForm.cboxRemoteDevices_SelectedIndexChanged(Object sender, EventArgs e)
   at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
   at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
   at System.Windows.Forms.ComboBox.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3615 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
NFSClient
    Assembly Version: 1.3.3925.28653
    Win32 Version: 1.3.0.0
    CodeBase: file:///P:/NfsTestClient/NFSClient/NFSClient.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3614 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
NFSLibrary
    Assembly Version: 0.6.3925.28652
    Win32 Version: 0.6.0.0
    CodeBase: file:///P:/NfsTestClient/NFSClient/NFSLibrary.DLL
----------------------------------------
RemoteTea.Net
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///P:/NfsTestClient/NFSClient/RemoteTea.Net.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

do you want to share the source code with me, i can debug it also...

Original comment by freakm...@gmail.com on 1 Oct 2010 at 9:06

Attachments:

GoogleCodeExporter commented 8 years ago
At http://code.google.com/p/nekodrive/source/checkout you can get the latest 
version of the code using ankhsvn for visual studio, tortoise or any compatible 
svn client. Let me know if you find something. Till now I debugged on VxWorks 
6.4 NFS Server and everything works fine, today I'm going to try with your 
configuration. Anyway error code 13 means access denied. Thank you! 

Original comment by mirko.ga...@gmail.com on 2 Oct 2010 at 8:01

GoogleCodeExporter commented 8 years ago
ok, I'm going to download and debug the application... I'll write back if i 
find something.

Original comment by freakm...@gmail.com on 2 Oct 2010 at 10:45

GoogleCodeExporter commented 8 years ago
I just found something about security on Ubuntu NFS server

if i change the export settings like the following

/home/freak/Projects/TOVideosTEST 
192.168.0.14(rw,no_subtree_check,sync,insecure,anonuid=1000,anongid=1000)

anonuid and anongid values have been got using "id" command in linux

the mount problem has gone. However, there is something wrong about the 
permissions of creating directory and files. NFSV2 and NFSv3 have made the 
folders and files permissions differently, I've found something in your code 
and try to fix it, but permission appointments have not been set correctly. I 
need deeper investigation on your project...

Original comment by freakm...@gmail.com on 2 Oct 2010 at 2:38

GoogleCodeExporter commented 8 years ago
I don't know permission appointment of NFSV3 working correctly on VxWorks but 
the correct permission appointment on Ubuntu NFS Server is the following;

0777 permission mask
7 in bit order 111
NFS is searching the integer bit by bit. Every 3 bit has the permission 
information of the file and directory. so if we want to full access and execute 
permission to the file or folder, NFS server expects 9 bit like 111111111. The 
C# calculation of this bits are the following;

/* Calculate Permission */
byte userP = 7; byte groupP = 7; byte otherP = 7;
int permission = 0;
permission = (((int)userP) << 6) | (((int)groupP) << 3) | ((int)otherP);
/*  ---  */

I've modified the CreateDirectory and CreateFile procedures according to the 
this permission thing, followings are the proc contents

public void CreateDirectory(string DirectoryFullName)
        {
            if (_ProtocolV3 != null && _MountProtocolV3 != null)
            {
                string ParentDirectory = Path.GetDirectoryName(DirectoryFullName);
                string DirectoryName = Path.GetFileName(DirectoryFullName);
                NFSAttributes ParentAttributes = GetItemAttributes(ParentDirectory);

                MKDIR3args dpMkDirArgs = new MKDIR3args();
                MKDIR3res pMkDirRes;
                dpMkDirArgs.attributes = new sattr3();
                dpMkDirArgs.attributes.atime = new set_atime();
                dpMkDirArgs.attributes.atime.set_it = time_how.DONT_CHANGE;
                dpMkDirArgs.attributes.mtime = new set_mtime();
                dpMkDirArgs.attributes.mtime.set_it = time_how.DONT_CHANGE;
                dpMkDirArgs.attributes.size = new set_size3();
                dpMkDirArgs.attributes.size.set_it = false;
                dpMkDirArgs.attributes.mode = new set_mode3();
                /* Calculate Permission */
                byte userP = 7; byte groupP = 5; byte otherP = 5;
                int permission = 0;
                permission = (((int)userP) << 6) | (((int)groupP) << 3) | ((int)otherP);
                /*  ---  */
                dpMkDirArgs.attributes.mode.mode = new mode3(new uint32(permission));
                dpMkDirArgs.attributes.mode.set_it = true;
                dpMkDirArgs.attributes.gid = new set_gid3();
                dpMkDirArgs.attributes.gid.gid = new gid3(new uint32(_GId));
                dpMkDirArgs.attributes.gid.set_it = true;
                dpMkDirArgs.attributes.uid = new set_uid3();
                dpMkDirArgs.attributes.uid.uid = new uid3(new uint32(_UId));
                dpMkDirArgs.attributes.uid.set_it = true;
                dpMkDirArgs.where = new diropargs3();
                dpMkDirArgs.where.dir = new nfs_fh3();
                dpMkDirArgs.where.dir.data = ParentAttributes.handle;
                dpMkDirArgs.where.name = new filename3(DirectoryName);

                if ((pMkDirRes = _ProtocolV3.NFSPROC3_MKDIR_3(dpMkDirArgs)) != null)
                {
                    if (pMkDirRes.status != nfsstat3.NFS3_OK)
                        throw new ApplicationException("NFSPROC3_MKDIR_3: errorcode " + pMkDirRes.status);
                }
            }
            else
                throw new ApplicationException("NFS Client not connected!");
        }

public void CreateFile(string FileFullName)
        {
            if (_ProtocolV3 != null && _MountProtocolV3 != null)
            {
                string ParentDirectory = Path.GetDirectoryName(FileFullName);
                string FileName = Path.GetFileName(FileFullName);
                NFSAttributes ParentAttributes = GetItemAttributes(ParentDirectory);

                CREATE3args dpCreateArgs = new CREATE3args();
                CREATE3res pCreateRes;

                /* Calculate Permission */
                byte userP = 7; byte groupP = 7; byte otherP = 7;
                int permission = 0;
                permission = (((int)userP) << 6) | (((int)groupP) << 3) | ((int)otherP);
                /*  ---  */

                dpCreateArgs.how = new createhow3();
                dpCreateArgs.how.mode = createmode3.UNCHECKED;
                dpCreateArgs.how.obj_attributes_gu = new sattr3();
                dpCreateArgs.how.obj_attributes_gu.atime = new set_atime();
                dpCreateArgs.how.obj_attributes_gu.atime.set_it = time_how.DONT_CHANGE;
                dpCreateArgs.how.obj_attributes_gu.mtime = new set_mtime();
                dpCreateArgs.how.obj_attributes_gu.mtime.set_it = time_how.DONT_CHANGE;
                dpCreateArgs.how.obj_attributes_gu.mode = new set_mode3();
                dpCreateArgs.how.obj_attributes_gu.mode.mode = new mode3(new uint32(permission));
                dpCreateArgs.how.obj_attributes_gu.mode.set_it = true;
                dpCreateArgs.how.obj_attributes_gu.gid = new set_gid3();
                dpCreateArgs.how.obj_attributes_gu.gid.gid = new gid3(new uint32(_GId));
                dpCreateArgs.how.obj_attributes_gu.gid.set_it = true;
                dpCreateArgs.how.obj_attributes_gu.uid = new set_uid3();
                dpCreateArgs.how.obj_attributes_gu.uid.set_it = true;
                dpCreateArgs.how.obj_attributes_gu.uid.uid = new uid3(new uint32(_UId));
                dpCreateArgs.how.obj_attributes_gu.size = new set_size3();
                dpCreateArgs.how.obj_attributes_gu.size.size = new size3(new uint64(0));
                dpCreateArgs.how.obj_attributes_gu.size.set_it = true;

                dpCreateArgs.how.obj_attributes_un = new sattr3();
                dpCreateArgs.how.obj_attributes_un.atime = new set_atime();
                dpCreateArgs.how.obj_attributes_un.atime.set_it = time_how.DONT_CHANGE;
                dpCreateArgs.how.obj_attributes_un.mtime = new set_mtime();
                dpCreateArgs.how.obj_attributes_un.mtime.set_it = time_how.DONT_CHANGE;
                dpCreateArgs.how.obj_attributes_un.mode = new set_mode3();
                dpCreateArgs.how.obj_attributes_un.mode.mode = new mode3(new uint32(permission));
                dpCreateArgs.how.obj_attributes_un.mode.set_it = true;
                dpCreateArgs.how.obj_attributes_un.gid = new set_gid3();
                dpCreateArgs.how.obj_attributes_un.gid.gid = new gid3(new uint32(_GId));
                dpCreateArgs.how.obj_attributes_un.gid.set_it = true;
                dpCreateArgs.how.obj_attributes_un.uid = new set_uid3();
                dpCreateArgs.how.obj_attributes_un.uid.set_it = true;
                dpCreateArgs.how.obj_attributes_un.uid.uid = new uid3(new uint32(_UId));
                dpCreateArgs.how.obj_attributes_un.size = new set_size3();
                dpCreateArgs.how.obj_attributes_un.size.size = new size3(new uint64(0));
                dpCreateArgs.how.obj_attributes_un.size.set_it = true;
                dpCreateArgs.how.verf = new createverf3(new byte[NFSv3Protocol.NFS3_CREATEVERFSIZE]);

                dpCreateArgs.where = new diropargs3();
                dpCreateArgs.where.dir = new nfs_fh3();
                dpCreateArgs.where.dir.data = new byte[NFSv3Protocol.NFS3_FHSIZE];
                Array.Copy(ParentAttributes.handle, dpCreateArgs.where.dir.data, NFSv3Protocol.NFS3_FHSIZE);
                dpCreateArgs.where.name = new filename3(FileName);

                if ((pCreateRes = _ProtocolV3.NFSPROC3_CREATE_3(dpCreateArgs)) != null)
                {
                    if (pCreateRes.status != nfsstat3.NFS3_OK)
                        throw new ApplicationException("NFSPROC3_CREATE_3: errorcode " + pCreateRes.status);
                }
            }
            else
                throw new ApplicationException("NFS Client not connected!");
        }

Original comment by freakm...@gmail.com on 2 Oct 2010 at 4:40

GoogleCodeExporter commented 8 years ago
Awesome work! Thanks a lot!

Original comment by mirko.ga...@gmail.com on 2 Oct 2010 at 6:52