Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 13th March 2008, 09:57   #1
uteseg
Junior Member
 
Join Date: Mar 2008
Posts: 2
AccessControl: Setting permissions to "Domain Users" without knowing the domain name

Hi,

I want to be able to set write permissions on a file to the "Domain Users" account, but without knowing the domain name in advance (or even that I'm in a domain at all).

I've seen in the AccessControl plugin documentation that I could use the SID (S-1-5-domain-513), but I still would need to know the domain the current user is logged onto. Is there an easy way to do that?

I found in another thread about a system call to LookupAccountSid which would also return the domain name, but I need the current user SID to do that and I don't know how to get it either.
uteseg is offline   Reply With Quote
Old 13th March 2008, 10:24   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Are you saying the account name is fixed, or 'Domain' is replaced with the name of the default domain?

Stu
Afrow UK is offline   Reply With Quote
Old 13th March 2008, 11:59   #3
uteseg
Junior Member
 
Join Date: Mar 2008
Posts: 2
Well, the installer should work in various environments, including with a domain (I don't have one).

Wat I want to do is: if the user launching the script is logged on to a domain, whichever it is, all users of that domain should get write permissions on a particular file.

Thus the domain name is not known at compile time, and should be found somehow at runtime, from the current user I guess.
uteseg is offline   Reply With Quote
Old 13th March 2008, 12:03   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,189
what about the Authenticated Users group?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th March 2008, 14:42   #5
CancerFace
Senior Member
 
Join Date: Apr 2006
Posts: 289
Send a message via ICQ to CancerFace
Quote:
I found in another thread about a system call to LookupAccountSid which would also return the domain name, but I need the current user SID to do that and I don't know how to get it either.
LookupAccountName accepts a username and returns its SID and (optionally) the domain name

Have a look at the Network management functions, maybe you can find something better though ...
CF
CancerFace is offline   Reply With Quote
Old 13th March 2008, 17:21   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Next version of AccessControl has NameToSid (and SidToName) in it.

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump