ASP.NET Permissions to Mail Directory

sneckelmann

New Member
Messages
19
Reaction score
0
Points
0
I'm trying the following coding:

Code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  Dim MAIL_PATH As String = "/home/neckelma/mail/neckelmann.x10hosting.com/mapper/cur/"
  Response.Write(My.Computer.FileSystem.DirectoryExists(MAIL_PATH))
End Sub

which always writes FALSE. Here is a picture of the control panel showing the mail path.

maildirectory.jpg


Any suggestions?
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
What is the directory currently chmoded to?
 

sneckelmann

New Member
Messages
19
Reaction score
0
Points
0
Each directory:

mail - 0750
neckelmann.x10hosting.com - 0750
mapper - 0750
cur - 0750
 

sneckelmann

New Member
Messages
19
Reaction score
0
Points
0
I'm hoping a Moderator could help me with this. I believe they have to set the appropriate permissions.
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
try setting it to 754
You can do it through the cPanel file manager or FTP.
 
Last edited:

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
Post a ticket in the free hosting support section, as it is probably something only admins can do.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
There should be nothing preventing you from setting permissions on a directory you own. Furthermore, the ASP.Net script will run with your credentials and thus have the same authorization to access anything you can access. The cause probably lies elsewhere, perhaps in Mono's Visual Basic Runtime Library, which is the assembly that hosts My.Computer.FileSystem.
 

sneckelmann

New Member
Messages
19
Reaction score
0
Points
0
Misson - thank you for your attention. Unfortunately, I do not believe your post is correct. I have created the following script:

Code:
   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim MAIL_PATH As String = "/home/neckelma/mail/neckelmann.x10hosting.com/mapper/cur/"
        Dim HOME_PATH As String = "/home/neckelma/public_html/"

        Dim mailInfo As FileInfo
        Dim homeInfo As FileInfo

        Try
            For Each foundfile As String In My.Computer.FileSystem.GetFiles(MAIL_PATH)
                mailInfo = My.Computer.FileSystem.GetFileInfo(foundfile)
                Response.Write(mailInfo.FullName & "<BR>")
            Next
        Catch ex As Exception
            Response.Write("Error Message: " & ex.Message & "<BR>")
        End Try

        Try
            For Each foundfile As String In My.Computer.FileSystem.GetFiles(HOME_PATH)
                homeInfo = My.Computer.FileSystem.GetFileInfo(foundfile)
                Response.Write(homeInfo.FullName & "<BR>")
            Next
        Catch ex As Exception
            Response.Write("Error Message: " & ex.Message & "<BR>")
        End Try
    End Sub

which produces the following results:

Error Message: Access to the path "/home/neckelma/mail/neckelmann.x10hosting.com/mapper/cur" is denied.
/home/neckelma/public_html/.htaccess
/home/neckelma/public_html/Default.aspx
/home/neckelma/public_html/Default.aspx.vb
/home/neckelma/public_html/aural.css
/home/neckelma/public_html/main.css
/home/neckelma/public_html/print.css
/home/neckelma/public_html/web.config

If the problem was in Mono neither loop would run. If it's not the permissions, then it must be the directory (MAIL_PATH) & I honestly don't think that's the case.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Interesting... Try getting the user name with Mono.Unix.Native.Syscall.getuid() and Mono.Unix.UserInfo (caveat: I don't know if the Mono.Unix assembly is available on X10). Also try temporarily setting the permissions of the directories along the path to 777. If that works, then it is a permissions issue. Of course, you don't want to give everyone write access to those folders. The admins should be able to configure Mono to run under each site's owner's account, the way other handlers do.
 

sneckelmann

New Member
Messages
19
Reaction score
0
Points
0
Mison,

I have set the permissions for all of the concerned directories to 0777. This did not help the problem.

I tried using the Mono namespace but my compiler doesn't understand it. I'm developing on a machine at work so I have limited priveleges as far as installing goes. This does not effect the issue though...obviously.

Could you create a quick script that accomplishes the task? I will post the results, of course.
Edit:
misson,

I wrote this line:
Code:
[SIZE=2]
Response.Write([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"You are logged in as <b>"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Mono.Unix.Native.Syscall.getuid & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"<b>."[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
[/SIZE]

but it didn't work.

'Unix' is not a member of 'Mono'.

Any other ideas? I can't believe this is this difficult.
 
Last edited:
Top