Author |
Message
|
ranjan1247 |
Posted: Tue Jan 27, 2015 5:30 pm Post subject: MQM users |
|
|
Novice
Joined: 17 Feb 2014 Posts: 20
|
How to extract mqm users from a server? |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Jan 27, 2015 7:13 pm Post subject: Re: MQM users |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 Location: US: west coast, almost. Otherwise, enroute.
|
ranjan1247 wrote: |
How to extract mqm users from a server? |
I'd suggest some kind of bait to attract them, like pizza or beer. Once they leave the confines of the server, lure them away from the server room. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
tczielke |
Posted: Wed Jan 28, 2015 4:27 am Post subject: Re: MQM users |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
ranjan1247 wrote: |
How to extract mqm users from a server? |
Are you asking you to find all the users that are members in the mqm group on a UNIX server? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jan 28, 2015 5:18 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
How about using the OS facilities to query group membership?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
tczielke |
Posted: Wed Jan 28, 2015 6:12 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
fjb_saper wrote: |
How about using the OS facilities to query group membership?  |
If "using the OS facilities to query group membership" means to do that programmatically, then I would agree. I personally have not found a way to do that through just using UNIX commands, if some of the user information is only stored in LDAP (and not locally in the /etc/passwd and /etc/group files).
This is the C program that I use to find all the members in a group. It seems to work well for Linux and Solaris.
Code: |
#include <sys/types.h>
#include <grp.h>
#include <pwd.h>
#include <string.h>
int main(int argc, char *argv[])
{
int i;
struct group *gr;
struct passwd *pw;
/* 1 argument is required for trace input file */
if (argc != 2)
{
printf("grpusers requires 1 argument for group name\n");
exit(-1);
}
if (!(gr = getgrnam(argv[1])))
{
endgrent( );
printf("group name %s was not found in database\n", argv[1]);
exit(-1);
}
printf("group member names for %s\n", argv[1]);
for (i = 0; gr->gr_mem[i]; i++)
puts(gr->gr_mem[i]);
endgrent( );
printf("users with primary group of %s\n", argv[1]);
pw = getpwent();
for (; pw; pw = getpwent()) {
if ( pw->pw_gid == gr->gr_gid )
puts(pw->pw_name);
}
endpwent();
exit(0);
}
|
|
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Jan 28, 2015 10:01 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Maybe this is too simple but I prefer:
Code: |
cat /etc/group | grep <group_name> |
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 28, 2015 10:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
I'd still recommend pizza or beer..... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jan 28, 2015 10:49 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Vitor wrote: |
I'd still recommend pizza or beer..... |
"Free Donuts at the Great Egress". |
|
Back to top |
|
 |
tczielke |
Posted: Wed Jan 28, 2015 10:57 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
RogerLacroix wrote: |
Maybe this is too simple but I prefer:
Code: |
cat /etc/group | grep <group_name> |
Regards,
Roger Lacroix
Capitalware Inc. |
That would miss users in mqm, if they are stored remotely in the LDAP server. At least, that has been my experience. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 28, 2015 11:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
Vitor wrote: |
I'd still recommend pizza or beer..... |
"Free Donuts at the Great Egress". |
One born every minute. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Jan 28, 2015 1:07 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 Location: US: west coast, almost. Otherwise, enroute.
|
It's not just me, then. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
|