|
||
Symbian OS v9.1 introduced Platform Security (the concept of Capabilities, Signing and Data Caging) to protect a phone against malicious code. Granting a program certain capabilities enables it to use protected operating system functionality, and signing an installation enables it to be installed onto different phones.
See the Platform Security section of the Symbian OS Library for more information on Symbian's Platform Security architecture.
A program using the P.I.P.S. libraries may need certain capabilities in order to use protected functionality to be available. The capabilities required are listed in the program's makefile (or MMP file on Symbian OS). For example, the following line added to a Symbian MMP file will grant network access to a program.
CAPABILITY NetworkServices
Each Symbian program has access to a private area of storage in a
/private/<secureid>/
directory where secureid
is an identifier specified in the MMP file. If a secureid
is not
specified in the MMP file, the secureid
is set from the program's
third UID (Unique Identifier). Some extra capabilities are required if the
program wishes to have access to another program's private area. Also it is
worth noting that P.I.P.S. will not allow file descriptors in private
directories to be inherited.
The following code illustrates how P.I.P.S. conforms to Data Caging rules.
#include <stdio.h>
int main(int argc, char *argv[])
{
FILE* file;
//Create the file in another program's private directory
file = fopen("/private/10004902/out.file", "w");
if (file == NULL)
{
int I = errno;
//Error occurred
printf("\nError creating file, error=%d", errno);
return EXIT_FAILURE;
}
else
{
//File created
fprintf(file, "Sample File Output");
fclose(file);
printf("\nFile created");
}
return EXIT_SUCCESS;
}
If no capabilities are provided, the code will print out an error
message due to the attempted use of fopen()
on another
program's /private/
directory. The error code displayed will be
EACCESS
, showing a security error.
If, however, the AllFiles
capability is listed in the
program's MMP file, the file will be generated successfully.
Note: Here, AllFiles
represents a system
capability and is not something your application should require or use, in most
of the cases.
The following table provides details of the P.I.P.S. APIs and the capabilities that may need to be added.
P.I.P.S. API |
Capabilities required |
|
|
|
|
|
|
|
|