flat assembler
Message board for the users of flat assembler.

Index > Linux > GetGid [renamed]

Author
Thread Post new topic Reply to topic
a16b03



Joined: 24 Jan 2006
Posts: 43
Location: Riga, Latvia
a16b03 07 Dec 2006, 21:01
What's the difference between

sys_getgid
&
sys_getegid


Last edited by a16b03 on 07 Dec 2006, 22:00; edited 2 times in total
Post 07 Dec 2006, 21:01
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 07 Dec 2006, 21:10
e


Laughing
Post 07 Dec 2006, 21:10
View user's profile Send private message Visit poster's website Reply with quote
a16b03



Joined: 24 Jan 2006
Posts: 43
Location: Riga, Latvia
a16b03 07 Dec 2006, 21:17
I don't believe. You gotta be kidding me.

...

Are you serious? Is that all?


P.S. eax is 50 and 47.
Post 07 Dec 2006, 21:17
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 07 Dec 2006, 21:28
a16b03, sorry, just my little joke, I don't know the difference. I was just being goofy (thought it was obvious). Embarassed
Post 07 Dec 2006, 21:28
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 07 Dec 2006, 21:41
47 = get real group id
50 = get effective group id

no idea what these are Smile
Post 07 Dec 2006, 21:41
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
a16b03



Joined: 24 Jan 2006
Posts: 43
Location: Riga, Latvia
a16b03 07 Dec 2006, 21:41
Here's more


sys_getpgid
sys_getpgrp


Maybe you can help
I need to get process GID.

here's what i use
Code:
        mov     eax,132
        xor     ebx,ebx
        int     0x80
        or      eax,5
        jnz     NOT_IN_TTY_GROUP
    


is it correct?

maybe mov eax,132 sould be replaced with other syscall.
Post 07 Dec 2006, 21:41
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
gunblade



Joined: 19 Feb 2004
Posts: 209
gunblade 07 Dec 2006, 21:43
man 2 getgid answers all your questions:

getgid returns the real group ID of the current process.

getegid returns the effective group ID of the current process.

The real ID corresponds to the ID of the calling process. The effec-
tive ID corresponds to the set ID bit on the file being executed.


Thats your best bet for any syscall, remove the "sys_" prefix, then just do man 2 <rest of syscall name>
Post 07 Dec 2006, 21:43
View user's profile Send private message Reply with quote
a16b03



Joined: 24 Jan 2006
Posts: 43
Location: Riga, Latvia
a16b03 07 Dec 2006, 21:58
Oh. I think i know whats wrong with my prog.

getgid returns all groups, rignt (for process)?
And If I want to know if user is in tty (GID=5) group i must somehow mask it out right?


Last edited by a16b03 on 07 Dec 2006, 22:05; edited 1 time in total
Post 07 Dec 2006, 21:58
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
a16b03



Joined: 24 Jan 2006
Posts: 43
Location: Riga, Latvia
a16b03 07 Dec 2006, 21:59
I'll rename This post to GetGid
Post 07 Dec 2006, 21:59
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
arafel



Joined: 29 Aug 2006
Posts: 131
Location: Jerusalem, Israel
arafel 26 Dec 2006, 20:06
sys_getgid returns real group id for the process and sys_getgroups retrieves a lists of all the supplementary groups id's.
No need to mask out (or do any other operations on) the return values. Just check whether the required group equals to primary or one of the supplementary groups.
Post 26 Dec 2006, 20:06
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.