I ran into a nasty bug with the latest alpha of WHS Disk Management 1.1; on non-English servers, the DiskManagement service failed to start. No meaningful error was generated, nothing got logged, and no matter what configuration options I changed, the service wouldn't start. Ever.

How's that for a bug?

Turns out, I was being bit by a localization issue. Who knew that the Authenticated Users group isn't actually named "Authenticated Users" on non-English servers?

Here's the fix. When passing your IDictionary of channel properties to the IpcChannel constructor, make sure you're getting the localized name of the role you're authorizing:

SecurityIdentifier sid = new SecurityIdentifier(WellKnownSidType.AuthenticatedUserSid, null);
NTAccount account = sid.Translate(typeof(NTAccount)) as NTAccount;

IDictionary channelProperties = new Hashtable();
channelProperties["portName"] = portName;
channelProperties["exclusiveAddressUse"] = false;
channelProperties["authorizedGroup"] = account.Value;
channelProperties["typeFilterLevel"] = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;

IpcChannel channel = new IpcChannel(channelProperties, null, null);
posted on Saturday, November 22, 2008 10:19 PM | Filed Under [ Development ]

Comments

Gravatar
# re: Localizing authorizedGroup property for IPC Channels (Jesus Reyes @ 3/26/2009 7:39 AM)

Thanks a lot
 
Gravatar
# re: Localizing authorizedGroup property for IPC Channels (Sam Wood @ 3/26/2009 8:55 AM)

Glad I could help, Jesus!
 
Gravatar
# re: Localizing authorizedGroup property for IPC Channels (Dennis @ 1/18/2011 2:58 PM)

Thanks a lot :-)
 
Gravatar
# re: Localizing authorizedGroup property for IPC Channels (manuel @ 3/30/2011 8:09 AM)

Thanks a lot, finally I found here the solution after one hour goggling.
 
Gravatar
# re: Localizing authorizedGroup property for IPC Channels (Tom Zych @ 9/11/2012 6:20 AM)

Thank you - I was beginning to think I'd have to detect the user's culture and do the translation myself!

Post Comment

Title *
Name *
Email
Url
Comment *  
Remember me
Please add 2 and 6 and type the answer here:

Search

Site Sections

Recent Posts

Archives

Post Categories

WHS Add-In Tutorial

WHS Blogs

WHS Development