You Are Here:

Community: Blogs

Paul Todd's Forum Nokia Blog

Using TSecurityInfo

Paul.Todd | 29 July, 2009 16:02

Ok its been a long time since I blogged since I have been overworked getting a couple of apps ready for OVI.

However there is some info on a useful little but well hidden class:

There are two basic ways of getting the process info at runtime, rather than compile time

The main method is to use the less than well known TSecurityInfo

This T class will get the capabilties, VID and SID of the current process, current message or current thread. bviously all these need to be within the scope of the current process rather than system wide if platsec is enabled.

There are some useful methods as well:

 

  • TSecurityInfo::SetToCreatorInfo()
    which will set all the data to the process that created this process.
  • TSecurityInfo::SetToCurrentInfo()
    which will set all the data to the this process's info.

There are other ways to get the creator info by using the "Creator*" methods in the User library but doing it via TSecurityInfo is a lot simpler to understand.

 

The process info can also be retrieved if the name, path and drive of the executable is known which is quite difficult without the "all files" capability.

RLibrary::TInfo info;
TPckg<RLibrary::TInfo> pkg(info);
User::LeaveIfError(RLibrary::GetInfo(_L("c:\\sys\\bin\\PhoNetInfo.exe"), pkg));

The creator info is quite useful as it allows the application to stop being launched by "unapproved" applications since the SID of the creating process can be checked to see if is a known one that is allowed or to ensure a creating process has the correct capabilty(ies).

RSSComments

Cool info

vaibhavjain | 29/07/2009, 19:08

Thanks for sharing this cool info Todd. Can you please publish a wiki article on this. This makes for a great article in platform security section.

good idea!

Paul.Todd | 29/07/2009, 22:29

Paul.Todd

Will do

You must login to post comments. Login
 

Rate This

 
 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia