Create a share with Simple File Sharing enabled
From: John B (jbx1138_at_yahoo.com)
Date: 07/19/04
- Next message: tlviewer: "Re: CryptImportKey Question"
- Previous message: Tyler: "CryptImportKey Question"
- Next in thread: Richard Ward: "Re: Create a share with Simple File Sharing enabled"
- Reply: Richard Ward: "Re: Create a share with Simple File Sharing enabled"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 19 Jul 2004 15:21:12 -0400
I'm writing a peice of software that will guide a user through a wizard
interface to help them share a folder on their PC. I have done extensive
work programming to XP Pro, using Get/SetNamedSecurityInfo to create the
share, and to enable the right permissions on the share so that access is
restrcited. In addition, I am creating a special account just for this
purpose.
My code works beautifly on XP Pro unless simple file sharing is enabled.
When that is the case, the file is not accesible by my programatically
created account.
here is basically what I'm doing:
1. Create new user account (note: I have attempted to use LSA to disable
local login permissions for this account but that does not remove it from
the list of login accounts when booting up - with XP as part of a
workgroup - but that's a separate issue).
2. Create a share using NetShareAdd.
3. Add my new account to the DACL for the share.
4. Set file level permissions on the shared folder, granting the user read
only permissions.
5. Set all the inheritence properly.
6. Recursively check that all child folders are inheriting permissions for
the shared folder.
Again, this works great on XP Pro when simple file sharing is disabled. I
was hoping that with Simple File Sharing that this would just work, but
apparently there is something else I must do, or not do, for the share to be
accesible. Because if I do the above steps, and then try to access the
share with a different computer, I get "access denied". However, if I turn
off Simple File Sharing, then do the same steps above I can access the
share.
So I need to know:
1. How do I tell if Simple File Sharing is enabled?
2. What sets of permissions need to be placed on the share to allow any user
read only access to the shares and files it contains?
3. If someone then turns off Simple File Sharing will this mess up the
permissions?
4. If I get this working on XP Pro, how different will it be on XP Home?
Where can I find more in depth information on how this is implemented? I
found one article on MSDN that explains how to use it from the end users
perspective, but not from the developers POV.
TIA,
John
- Next message: tlviewer: "Re: CryptImportKey Question"
- Previous message: Tyler: "CryptImportKey Question"
- Next in thread: Richard Ward: "Re: Create a share with Simple File Sharing enabled"
- Reply: Richard Ward: "Re: Create a share with Simple File Sharing enabled"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|