ISFS_CreateFile owner/groupid issue

Post Reply
DacoTaco
Posts: 15
Joined: Tue Sep 22, 2009 5:37 pm

ISFS_CreateFile owner/groupid issue

Post by DacoTaco » Sun Oct 31, 2010 4:12 pm

what happens is when i call a createfile the file gets created but the permissions aren't what i suspected.

requested permissions:
owner 0 group 0 attributes 0 perm:3-3-0
what i got after the create:
owner 4198 group 18498 attributes 0 perm:3-3-0

i know the wii normally has nothing to do with the owner/group id & they aren't parameters but even if they were thats what i get :-/ (i modified isfs.c to allow it to see if it would be fixed but its not)
the number seems to change depending on the ios its running at (wtf?)
@ios58 its the above
@ios36 & my custom IOS249 (patched ios36 with a finishing touch from myself :P ) its 15 & 15 as id :/

the following pastebin is a stripped down to the bug code
http://www.dacotaco.com/crap/pastebin/paste/30.html

if anyone can help me out here i'd appreciate it >_>

tueidj
Posts: 40
Joined: Thu Dec 10, 2009 9:26 am

Re: ISFS_CreateFile owner/groupid issue

Post by tueidj » Tue Nov 02, 2010 2:48 pm

Unless you've identified as a specific title after IOS is loaded (or the current IOS was loaded during an ES_LAUNCHTITLE call), the owner and group used to access/create new files will be uninitialized (random). Not sure why libogc has parameters to specify the owner and group as they will be ignored (unless you're using a patched IOS).

DacoTaco
Posts: 15
Joined: Tue Sep 22, 2009 5:37 pm

Re: ISFS_CreateFile owner/groupid issue

Post by DacoTaco » Wed Nov 03, 2010 6:27 pm

i never did any identification yet it always seem to have writen files with owner/group id 0 (like all files on the wii seem to be)

also, should the loaded app not be identified as HBC since its booted from HBC?

so what do you suggest i do then? :/

again, libogc doesn't have parameters for the owner & group id. i just added it for a minute to see what would happen >_>

tueidj
Posts: 40
Joined: Thu Dec 10, 2009 9:26 am

Re: ISFS_CreateFile owner/groupid issue

Post by tueidj » Thu Nov 04, 2010 5:49 pm

Apps loaded from HBC will only be identified as HBC if they use no_ios_reload, otherwise a new IOS is loaded and the owner/group will be uninitialized.

As for what you should do, maybe rethink whatever you're attempting? The reason owner/group permissions exist is to prevent apps accessing files that don't belong to them and homebrew apps can store their files on SD/USB instead of NAND...

User avatar
Izhido
Posts: 107
Joined: Fri Oct 19, 2007 10:57 pm
Location: Costa Rica
Contact:

Re: ISFS_CreateFile owner/groupid issue

Post by Izhido » Thu Nov 04, 2010 8:47 pm

Yeah... that is interesting... why is ownership / identification so important in that Wii app of yours?

DacoTaco
Posts: 15
Joined: Tue Sep 22, 2009 5:37 pm

Re: ISFS_CreateFile owner/groupid issue

Post by DacoTaco » Thu Nov 04, 2010 9:19 pm

cause i dont want to know/find out what system menu will think when files are created with such owner/group id

@tueidj : dude, again ; IT USED TO WRITE WITH THE SAME CODE AS 0 OWNERID/GROUPID. both if i used ahbprot (no_ios_reload) or if i reloaded to an ios that had nand permissions. are you saying that it just happen to have 0 as random generated owner id for over a year now?
and even reverting code that is known to have the 0 id will result in that id?

EDIT: i did a test by reloading to IOS36, identifying as system menu using a (crap) ES_Identify & SetUID and guess what
still the same id's. those 2 functions are the only identification functions i know off on the wii and if those return 0 and createfile still produces the id's then i'd say it isn't a identification issue :/

tueidj
Posts: 40
Joined: Thu Dec 10, 2009 9:26 am

Re: ISFS_CreateFile owner/groupid issue

Post by tueidj » Fri Nov 05, 2010 11:59 am

I said uninitialized(random). Finding an uninitialized value set to 0 is not very rare.

Something tells me your identify/setuid tests didn't work (which isn't surprising, ES_Identify has been fixed for ages and setuid doesn't work unless you're already identified as the system menu). Why not find out which title id matches this owner id that you keep seeing get used? Convert it to hex and look it up in your uid.sys... so for example owner id 4918 would be 0x1066 and I'll bet that matches HBC's entry, perhaps because you're testing your program using wiiload which doesn't reload IOS and you inherit HBC's permissions?
(group 18498 converts to 'HB' which HBC "coincidentally" uses for its group ID. SideNote: This is how people who want to launch any HBC title (HAXX, JODI, asdfiu) should be finding it, but no-one seems to care about future-proofing their programs.)

BTW "dude" if you ask for help, at least attempt to try and understand what people tell you. It seems every time you ask a question and get an answer you don't like, you start saying it's bullshit. I think this is the last time I'll try and help you out.

DacoTaco
Posts: 15
Joined: Tue Sep 22, 2009 5:37 pm

Re: ISFS_CreateFile owner/groupid issue

Post by DacoTaco » Fri Nov 05, 2010 7:48 pm

/me facepalms

seems like this isn't getting anywhere.

the code , eventho ran using ahbprot , --used to create the files as 0-- .
i know its more logical to use the hbc id's as its run from hbc etc etc but suddenly it isn't anymore :-/

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests