Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

I am seeing the following error (21) when trying to open a file.
I took the sample code without any changes. But my guess is that the cif file or some othere system configuration is not setup. I am new to brew..

1. This step works fine
if(nRet = ISHELL_CreateInstance(pMe->piShell, AEECLSID_FileSystem2,
(void **)&pIFileSystem2)){
goto bail;
}
2. stats is returning some info that appears correct. But i dont know what the flag mean
if ((nRet=IFileSystem2_StatVFS(pIFileSystem2,topath,&buf))!= AEE_SUCCESS)
{
return;
}
3. open is failing with error code 21
if ((nRet = IFileSystem2_Open(pIFileSystem2,topath "fs:/~0x0012345/myfile.txt",
FS_CAP_CREATE FS_CAP_WRONLY, &pIFilePort1 ))!= AEE_SUCCESS ) {

#define EPRIVLEVEL 21 // Security violation

The output from stats was:

- buf FSStatVFSEx
dwFragmentSize 4096 unsigned long
dwBlocks 9938357 unsigned long
dwBlocksFree 9938357 unsigned long
dwBlocksAvail 9938357 unsigned long
dwMaxFilePathname 0 unsigned long
dwMaxFilename 255 unsigned long
qwFilesUsed 4 unsigned __int64
qwFSSpaceUsed 2044055 unsigned __int64
qwMaxFiles 9999 unsigned __int64
qwMaxFSSpace 1111 unsigned __int64
qwMaxFileSize 0 unsigned __int64
qwFileSystemId 1 unsigned __int64
qwCharSetSupport 0 unsigned __int64
qwValidFlags 1007 unsigned __int64
qwFlags 0 unsigned __int64

If I go into the directory and create the file myfile.txt it gets a little further but still i cant write to the file.
There seems to be some basic permisions problem possible in the .cif file.

Ive added the following to my .cif file with no luck

FS_ACL_Grant {
{ groups = {AEECLSID_FILERDWRTESTAPP},perms = "rw/rw" },
{ groups = {20},perms = "rw/rw" },
{ groups = {21},perms = "rw/rw" },

path = "fs:/~0x0012345/"

}

FS_Quota {
max_files = 9999;
max_space = 1111;
max_file_size = 1000;
max_file_pathname = 100;

Applet {
appletid = AEECLSID_FILERDWRTESTAPP,
resbaseid = 20, -- Applet base resource id
applethostid = 0,
type = 0,
privs = {},

Thanks for any help.

You need to add file permissions to the .cif file, AEEPRIVID_PLFile
https://brewmobileplatform.qualcomm.com/devnet/resources/devEx/library/t...

You need to add file permissions to the .cif file, AEEPRIVID_PLFile
https://brewmobileplatform.qualcomm.com/devnet/resources/devEx/library/t...

Thanks for the tip. But I had actually already tried that with some interesting results.
When i changed my priv in my .cif file to
privs = {AEEPRIVID_PLFile } This did not work
I also tried
privs = { 0xFFF) this did not work either
But
privs = { 0xFFFF} does work same as AEEPRIVID_PLSystem
Now why would i need to give full system priv to my app ?
Any ideas

Thanks for the tip. But I had actually already tried that with some interesting results.
When i changed my priv in my .cif file to
privs = {AEEPRIVID_PLFile } This did not work
I also tried
privs = { 0xFFF) this did not work either
But
privs = { 0xFFFF} does work same as AEEPRIVID_PLSystem
Now why would i need to give full system priv to my app ?
Any ideas

cthelen wrote:
Thanks for the tip. But I had actually already tried that with some interesting results.
When i changed my priv in my .cif file to
privs = {AEEPRIVID_PLFile } This did not work
I also tried
privs = { 0xFFF) this did not work either
But
privs = { 0xFFFF} does work same as AEEPRIVID_PLSystem
Now why would i need to give full system priv to my app ?
Any ideas
The only thing you would need system permission for is if the directory does
not belong to your application. I see you used "~0x0012345" which doesn't look
like a real class id (should be the classid of your app) to me.
Is this on SIM or device? On some devices there may be an OEM specific
implemented issue in regards to the file system.

cthelen wrote:
Thanks for the tip. But I had actually already tried that with some interesting results.
When i changed my priv in my .cif file to
privs = {AEEPRIVID_PLFile } This did not work
I also tried
privs = { 0xFFF) this did not work either
But
privs = { 0xFFFF} does work same as AEEPRIVID_PLSystem
Now why would i need to give full system priv to my app ?
Any ideas
The only thing you would need system permission for is if the directory does
not belong to your application. I see you used "~0x0012345" which doesn't look
like a real class id (should be the classid of your app) to me.
Is this on SIM or device? On some devices there may be an OEM specific
implemented issue in regards to the file system.

This is using the simulator with the candybar phone.
I substituted the real id with the 12345 one.. Do I need to keep my ap id private to avoid hackers ?
I got the app id from the FileRdWrTestApp.bid file
The file that is created does turn up in the correct directory when i search for it in explorer.
At least I assume that this is were the directory should map to since that is the name of my project.
C:\Brew MP\Targets\Candy Bar (1.0.2.488)\fs\usermods\FileRDWRTestApp
I also find this directory contains the othere 4 files .bar , .dll, .mif, .pdb file... plus my file.

This is using the simulator with the candybar phone.
I substituted the real id with the 12345 one.. Do I need to keep my ap id private to avoid hackers ?
I got the app id from the FileRdWrTestApp.bid file
The file that is created does turn up in the correct directory when i search for it in explorer.
At least I assume that this is were the directory should map to since that is the name of my project.
C:\Brew MP\Targets\Candy Bar (1.0.2.488)\fs\usermods\FileRDWRTestApp
I also find this directory contains the othere 4 files .bar , .dll, .mif, .pdb file... plus my file.