Urgent help needed for Security Descriptor

Hi,

I want to set the User Access permissions for a shared folder on window NT 4. e.g I want to give access to user 'x' permission to only read the dir.

I unsuccessfully tried using GetNamedSecurityInfo() to get file info. It's giving me error 123. Don't know what that means. Is this the right method to get file security info? Someone please guide me in this respect

thanks in advance
Shirish
[445 byte] By [shirishart] at [2007-11-18 1:39:51]
# 1 Re: Urgent help needed for Security Descriptor
123 -
The filename, directory name, or volume label syntax is incorrect.

You can use errlook.exe to lookup the error number.

Microsoft Visual Studio\common\tools\errlook.exe

You can also look @ the headers...winerror.h or the listing in the MSDEV help, or on MSDN.microsoft.com or your favorite search engine...google etc etc...

As far as file security, look at GetFileSecurity/SetFileSecurity. Look in the MSDEV help contents, PLatform SDk, Security for more info.
Mick at 2007-11-10 8:54:05 >
# 2 Re: Urgent help needed for Security Descriptor
I tried using GetFileSecurity() method in the following way

SECURITY_INFORMATION sec_info = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION;

char sd[2000];
PSECURITY_DESCRIPTOR sec_desc = (void *)sd;
int nLen = sizeof(SECURITY_DESCRIPTOR);
DWORD neededLen;

int err = GetFileSecurity("temp", sec_info, sd, nLen, &neededLen);

Here I am getting value of err as 0 (Success), but not getting value of neededLen as 0, as it should be. I suspect it's giving me some meaningless vals :(

Shirish
shirishart at 2007-11-10 8:55:15 >
# 3 Re: Urgent help needed for Security Descriptor
Sorry abt a mistake in the last post. The value of err (0) is for failure and when I did GetLastError() it returned 1314 (Not sufficient privilages). But I have created this dir myself and my login has admin privilages on my PC. Then why should this happen?

Can somebody help me please? It's very urgent :(

Any help is appreciated
Shirish
shirishart at 2007-11-10 8:56:12 >
# 4 Re: Urgent help needed for Security Descriptor
So what is your parameters?
sm_ch at 2007-11-10 8:57:17 >