Page 1 of 1

I still cant access a share.

PostPosted: Thu Jun 29, 2006 2:21 pm
by Leonel
I´m using this code:

Code: Select all
NewShare(DirPath, 'Share').Acl.SetFileAccess(Everyone,True);

I am seeing the share but I can't access in another computer. Say that I dont have a permission.
I sharing in WinXP and access in Win98 or 2003 Server.

I read the entire forum and I do not find anything that works for me.

I have to do a project in school and madsecurity will save my ass.

Tanks and sorry my english.


PostPosted: Thu Jun 29, 2006 3:23 pm
by madshi
Network access works only if *both* the share security attributes and the NTFS directory security attributes allow access.

PostPosted: Wed Sep 20, 2006 4:34 pm
by DiegoGarcia
So how should we do it ?
For me it doesnt work either :/

Can you give us a sample code ?

Thanks a lote,

PostPosted: Wed Sep 20, 2006 4:42 pm
by madshi
First of you all need to find out what's wrong with the share you created. You should do so by using the Windows shell. Once you know where the settings are not satisfying, let me know, then I can tell you what to do.

PostPosted: Wed Sep 20, 2006 4:51 pm
by DiegoGarcia
Ok I will give you some steps to reproduce the problem.

First Create an folder at C:\ named Test.
Second open the program with a button nammed "share folder" with the follow code NewShare('C:\Test','testShare$').Acl.SetFileAccess(Everyone,True);

Now go to other computer and try to access the shared folder by typing "\\computerName\testShare$".
Windows will throw an exception "Access Denied **"

Now back to the computer that has the shared path, simple rigth click on the folder "C:\Test", select "Sharing and Security" then just uncheck the option "Share This folder" and check it again, then click on "apply" button.

Now try to access the folder from the other pc, it will works !

Any help ?

Thanks madshi ;)


PostPosted: Wed Sep 20, 2006 4:55 pm
by madshi
Can you please check what security settings madSecurity has filled into the share? Do you see any obvious error?

Can't test it myself right now, cause I've no network where I'm currently.

PostPosted: Wed Sep 20, 2006 5:08 pm
by DiegoGarcia
how can I see the security setting on win xp ?

Thanks Madshi

PostPosted: Wed Sep 20, 2006 5:16 pm
by madshi
On the property page where you can share the folder, there should be a button labeled "access rights" or something like that.

Wait, I think there are two sharing modes. Something like simple file sharing and normal/full file sharing. Maybe your PC is configured to use simple file sharing? madSecurity is meant to do full file sharing. I'm not sure how that behaves if your PC is configured to do simply file sharing... :?

PostPosted: Wed Sep 20, 2006 5:30 pm
by DiegoGarcia
Ok I will have a look on how to setup it to show that option!

Thanks madshi, I will post the result here latter !


PostPosted: Wed Sep 20, 2006 5:50 pm
by DiegoGarcia
Hi good news madshi,
to disable the simple file share mode you have to click on the Tools menu from Explorer and select folder options the uncheck the option simple file sharing mode.

Now it works fine the program, share and it works !

Now the question is, how can we disable this option using our delphi program ?


PostPosted: Thu Sep 21, 2006 12:36 pm
by madshi
Hmmmm, I don't know that myself, unfortunately. My PCs are all setup so that "simple" file sharing isn't used. Have you tried googling for a solution? Have no other idea, either...

Same issue, and possible solution.

PostPosted: Fri Dec 01, 2006 4:35 pm
by Rockaholic
I had the same issue where i could create the share, and it would show up fine, but would get an access denied error when trying to access it.

Doing some testing i determined it had nothing to do with simple file shareing, same error regardless of which shareing mode.

The fix i came up with was this...

//Create Share
NewShare(GetRootPath(GetCurrentDir), ShareName).Acl.SetFileAccess(Everyone,True);
//File Leve Security
FileSecurity(GetRootPath(GetCurrentDir)).DAcl.SetFileAccess(Account('Everyone'), true);

The problem being that the share was being created, and the share permissions set, but the file level permission wasnt set, so you still would get the access denied.