I am unable to find a method/function in libc which allows me to list
all known users and groups on a partition (similar to lsuser ALL /
lsgroup ALL).
All functions that I see in libc provide additional information on a
group based on either the GID or the name.
But what if I don't know the GID/name? There must be someway to list
all known groups...
Thanks for the help!
If I'm understanding your issue, all you are trying to do is list the
groups. If so, you can just use this
lsgroups -a ALL
That will list all of the group names with none of the extended
attributes.
Likewise, you can list all of the user names.
lsuser -a ALL
If this isn't what you are looking for, please elaborate.
J.
Yes that's exactly what I am looking for.
However, unfortunately, I has to be coded in C (and I don't really
like the "system" systemcall to obtain this information :-) ).
So I need something out of the libc library to obtain this.
F.e. methods/functions in libc:
getgroupattr
getgrgid
...
But nothing really about just listing the groups without knowledge of
the existing group names.
Thanks for the help!
Rgds
Mark Tyalor
> But nothing really about just listing the groups without knowledge of
> the existing group names.
>
> Thanks for the help!
getgrent ??
--
* Alberto Varesio * - /IBM eServer Certified Specialist/
/S&N Competence Center Application Engineer/
* SPAZIOSYSTEM S.p.A. * - http://www.spaziosystem.com/
Tel.: +39 011 19756013 - Cell.: 335 1811324
Confidential notice: This message and its attachments may contain
confidential information that is addressed solely to the above person.
If you have received this message without authorization, delete it
along with any other copy and inform the sender.
Please consider your environmental impact before printing this e-mail
==
Nimmistica: "Il senso sviluppato nei polpastrelli". Lu...dito".