[Pidgin] #12443: Installer starts Pidgin at high integrity level on Windows

Pidgin trac at pidgin.im
Thu Aug 5 23:07:02 EDT 2010


#12443: Installer starts Pidgin at high integrity level on Windows
-------------------------------+--------------------------------------------
 Reporter:  bjc                |        Owner:  datallah       
     Type:  defect             |       Status:  new            
Milestone:                     |    Component:  winpidgin (gtk)
  Version:  2.7.2              |   Resolution:                 
 Keywords:  windows installer  |  
-------------------------------+--------------------------------------------

Comment(by bjc):

 I had the same problem with NSIS and some commercial software I was
 working on. It was solved by developing an NSIS plugin that launched the
 app at medium integrity level.

 {{{
 EXDLL_INIT();
 popstring(exePath);
 hProcess = OpenProcess(MAXIMUM_ALLOWED, FALSE, GetCurrentProcessId());
 OpenProcessToken(hProcess, TOKEN_ALL_ACCESS, &hProcessToken);
 DuplicateTokenEx(hProcessToken, MAXIMUM_ALLOWED, NULL,
 SecurityImpersonation, TokenPrimary, &hPrimaryToken);
 AllocateAndInitializeSid(&siaMLA, 1, SECURITY_MANDATORY_MEDIUM_RID, 0, 0,
 0, 0, 0, 0, 0, &pSidMedium);
 til.Label.Attributes = SE_GROUP_INTEGRITY;
 til.Label.Sid = pSidMedium;
 SetTokenInformation(hPrimaryToken, TokenIntegrityLevel, &til,
 sizeof(TOKEN_MANDATORY_LABEL))
 si.cb = sizeof(si);
 CreateProcessAsUserA(hPrimaryToken, exePath, NULL, NULL, NULL, FALSE,
 DETACHED_PROCESS, NULL, NULL, &si, &pi);
 }}}

-- 
Ticket URL: <http://developer.pidgin.im/ticket/12443#comment:3>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list