I still cant access a share.

delphi package - easy access to security apis

I still cant access a share.

Postby Leonel » Thu Jun 29, 2006 2:21 pm

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.

Leonel
Leonel
 
Posts: 1
Joined: Thu Jun 29, 2006 2:02 pm

Postby madshi » Thu Jun 29, 2006 3:23 pm

Network access works only if *both* the share security attributes and the NTFS directory security attributes allow access.
madshi
Site Admin
 
Posts: 9774
Joined: Sun Mar 21, 2004 5:25 pm

Postby DiegoGarcia » Wed Sep 20, 2006 4:34 pm

So how should we do it ?
For me it doesnt work either :/

Can you give us a sample code ?

Thanks a lote,
Diego.
DiegoGarcia
 
Posts: 6
Joined: Wed Sep 20, 2006 4:29 pm

Postby madshi » Wed Sep 20, 2006 4:42 pm

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.
madshi
Site Admin
 
Posts: 9774
Joined: Sun Mar 21, 2004 5:25 pm

Postby DiegoGarcia » Wed Sep 20, 2006 4:51 pm

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 ;)

Regards,
Diego.
DiegoGarcia
 
Posts: 6
Joined: Wed Sep 20, 2006 4:29 pm

Postby madshi » Wed Sep 20, 2006 4:55 pm

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.
madshi
Site Admin
 
Posts: 9774
Joined: Sun Mar 21, 2004 5:25 pm

Postby DiegoGarcia » Wed Sep 20, 2006 5:08 pm

how can I see the security setting on win xp ?

Thanks Madshi
DiegoGarcia
 
Posts: 6
Joined: Wed Sep 20, 2006 4:29 pm

Postby madshi » Wed Sep 20, 2006 5:16 pm

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... :?
madshi
Site Admin
 
Posts: 9774
Joined: Sun Mar 21, 2004 5:25 pm

Postby DiegoGarcia » Wed Sep 20, 2006 5:30 pm

Ok I will have a look on how to setup it to show that option!

Thanks madshi, I will post the result here latter !

Regards,
Diego.
DiegoGarcia
 
Posts: 6
Joined: Wed Sep 20, 2006 4:29 pm

Postby DiegoGarcia » Wed Sep 20, 2006 5:50 pm

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 ?

Regards,
Diego.
DiegoGarcia
 
Posts: 6
Joined: Wed Sep 20, 2006 4:29 pm

Postby madshi » Thu Sep 21, 2006 12:36 pm

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...
madshi
Site Admin
 
Posts: 9774
Joined: Sun Mar 21, 2004 5:25 pm

Same issue, and possible solution.

Postby Rockaholic » Fri Dec 01, 2006 4:35 pm

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.
Rockaholic
 
Posts: 1
Joined: Fri Dec 01, 2006 4:22 pm


Return to madSecurity

Who is online

Users browsing this forum: Baidu [Spider] and 2 guests

cron