Chad Perrin schreef:
> Ruud:
>> So some security layer is not implemented at your end. I don't know
>> which is implemented here, there are several ways to do something
>> similar.
>
> At a wild guess, I'd say it might be a chroot "jail".
I just asked them, and the shell runs in a (modified) yp (
Chad Perrin schreef:
> John W. Krahn:
>> Chad Perrin:
>>> Chad Perrin:
I'm sure that could be made prettier by someone with better Perl
mojo than I have at the moment, and it could be made a bit simpler
if all you want is the gid for each group rather than the group
name.
>>>
>
On Thu, Dec 21, 2006 at 06:24:53PM -0800, John W. Krahn wrote:
> Chad Perrin wrote:
> > On Thu, Dec 21, 2006 at 03:02:04PM -0700, Chad Perrin wrote:
> >>I'm sure that could be made prettier by someone with better Perl mojo
> >>than I have at the moment, and it could be made a bit simpler if all you
Chad Perrin wrote:
> On Thu, Dec 21, 2006 at 03:02:04PM -0700, Chad Perrin wrote:
>>I'm sure that could be made prettier by someone with better Perl mojo
>>than I have at the moment, and it could be made a bit simpler if all you
>>want is the gid for each group rather than the group name.
>
> I po
On Thu, Dec 21, 2006 at 03:02:04PM -0700, Chad Perrin wrote:
>
> I'm sure that could be made prettier by someone with better Perl mojo
> than I have at the moment, and it could be made a bit simpler if all you
> want is the gid for each group rather than the group name.
I posted a gid version her
On Thu, Dec 21, 2006 at 01:25:01PM -0700, Tom Smith wrote:
> Chad Perrin wrote:
> >
> >That's why I said you may as well either just use the id utility from
> >the shell if you're not going to grab group memberships in an
> >idiomatically Perlish way -- the Perl code is likely to be more
> >portabl
On 12/21/2006 09:05 AM, Tom Smith wrote:
I try to avoid calling console commands because there tends to be
differences in some of the CLI utilities between distributions--that was
actually one of the first things I had considered doing, except with the
`groups` command.
You could limit o
Chad Perrin wrote:
On Thu, Dec 21, 2006 at 08:05:05AM -0700, Tom Smith wrote:
Dr.Ruud wrote:
Chad Perrin schreef:
Of course, if you're going to call out of the Perl script to the id
utility, you may as well skip the Perl script entirely and just enter
this at the shell promp
On Thu, Dec 21, 2006 at 08:05:05AM -0700, Tom Smith wrote:
> Dr.Ruud wrote:
> >Chad Perrin schreef:
> >
> >>Of course, if you're going to call out of the Perl script to the id
> >>utility, you may as well skip the Perl script entirely and just enter
> >>this at the shell prompt:
> >>
> >> id -Gn
On Thu, Dec 21, 2006 at 03:06:38AM -0800, John W. Krahn wrote:
> Chad Perrin wrote:
> > On Wed, Dec 20, 2006 at 05:28:46PM -0800, John W. Krahn wrote:
> >>
> >> Since you are only reading from /etc/group you are not picking up the
> >> primary
> >> group stored in /etc/passwd.
> >
> > Singling o
On Thu, Dec 21, 2006 at 08:08:07AM -0700, Tom Smith wrote:
>
> Yeah, the smiley may have clarified the intentions a little...
. . . or it may have just looked like part of the Perl code.
--
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
print substr("Just another Perl hacker", 0, -2);
-
On Thu, Dec 21, 2006 at 11:23:15AM +0100, Dr.Ruud wrote:
> Chad Perrin schreef:
> > Dr.Ruud:
>
> >> TIMTOWTDI. On the shell machines of my provider (FreeBSD) the "id"
> >> approach will work, and the "/etc/group" one won't.
> >
> > I don't think that has anything to do with it being FreeBSD.
>
>
Tom Smith wrote:
Dr.Ruud wrote:
Chad Perrin schreef:
Dr.Ruud:
TIMTOWTDI. On the shell machines of my provider (FreeBSD) the "id"
approach will work, and the "/etc/group" one won't.
I don't think that has anything to do with it being FreeBSD.
That was and is also what
Chad Perrin wrote:
On Thu, Dec 21, 2006 at 01:48:38AM -0600, Mumia W. wrote:
On 12/21/2006 12:42 AM, Tom Smith wrote:
Mumia W. wrote:
use strict;
use warnings;
$_ = `id $ARGV[0]`;
s/.*?groups=// && print "@{[ /\((\w+)\)/g ]}\n";
I'm not trying to be argumentative or say
Dr.Ruud wrote:
Chad Perrin schreef:
Dr.Ruud:
TIMTOWTDI. On the shell machines of my provider (FreeBSD) the "id"
approach will work, and the "/etc/group" one won't.
I don't think that has anything to do with it being FreeBSD.
That was and is also what I don't think. I
Sorry, I sent this to the poster rather than the list... My bad.
Original Message
Subject:Re: Displaying a user's group memberships
Date: Wed, 20 Dec 2006 20:39:13 -0700
From: Tom Smith <[EMAIL PROTECTED]>
To: John W. Krahn <[EMAIL PROTECTE
Sorry, I sent these to the poster rather than the list--my bad.
Original Message
Subject:Re: Displaying a user's group memberships
Date: Wed, 20 Dec 2006 20:23:53 -0700
From: Tom Smith <[EMAIL PROTECTED]>
To: John W. Krahn <[EMAIL PROTECTE
Mumia W. wrote:
On 12/21/2006 12:42 AM, Tom Smith wrote:
Mumia W. wrote:
use strict;
use warnings;
$_ = `id $ARGV[0]`;
s/.*?groups=// && print "@{[ /\((\w+)\)/g ]}\n";
I'm not trying to be argumentative or say that this is "wrong"... But
does anyone else agree with this? If so, why is this
On 12/21/2006 02:59 AM, Chad Perrin wrote:
On Wed, Dec 20, 2006 at 10:47:25PM -0800, John W. Krahn wrote:
Mumia W. wrote:
On 12/20/2006 04:14 PM, Tom Smith wrote:
[...]
So is there a better way to do this, or perhaps a cleaner way?
use strict;
use warnings;
$_ = `id $ARGV[0]`;
s/.*?groups=//
Chad Perrin wrote:
> On Wed, Dec 20, 2006 at 05:28:46PM -0800, John W. Krahn wrote:
>>
>> Since you are only reading from /etc/group you are not picking up the primary
>> group stored in /etc/passwd.
>
> Singling out the primary group wasn't a requirement for the Perl script,
> as far as I recall
Chad Perrin schreef:
> Dr.Ruud:
>> TIMTOWTDI. On the shell machines of my provider (FreeBSD) the "id"
>> approach will work, and the "/etc/group" one won't.
>
> I don't think that has anything to do with it being FreeBSD.
That was and is also what I don't think. I only mentioned it because OP
men
On Thu, Dec 21, 2006 at 01:48:38AM -0600, Mumia W. wrote:
> On 12/21/2006 12:42 AM, Tom Smith wrote:
> >Mumia W. wrote:
> >>
> >>use strict;
> >>use warnings;
> >>$_ = `id $ARGV[0]`;
> >>s/.*?groups=// && print "@{[ /\((\w+)\)/g ]}\n";
> >
> >I'm not trying to be argumentative or say that this is "
On Wed, Dec 20, 2006 at 05:28:46PM -0800, John W. Krahn wrote:
> Tom Smith wrote:
> >
> > Thank Chad (and John) for your input on this. I thought I'd post the
> > portion of the script that I was trying to work out to see if there's
> > room for improvement. This should work on any *nix system. Th
On Wed, Dec 20, 2006 at 10:47:25PM -0800, John W. Krahn wrote:
> Mumia W. wrote:
> > On 12/20/2006 04:14 PM, Tom Smith wrote:
> >> [...]
> >> So is there a better way to do this, or perhaps a cleaner way?
> >
> > use strict;
> > use warnings;
> > $_ = `id $ARGV[0]`;
> > s/.*?groups=// && print "@{
On Thu, Dec 21, 2006 at 09:24:51AM +0100, Dr.Ruud wrote:
> Tom Smith schreef:
> > Mumia W.:
>
> >> use strict;
> >> use warnings;
> >> $_ = `id $ARGV[0]`;
> >> s/.*?groups=// && print "@{[ /\((\w+)\)/g ]}\n";
> >
> > I'm not trying to be argumentative or say that this is "wrong"... But
> > does an
On 12/21/2006 12:42 AM, Tom Smith wrote:
Mumia W. wrote:
use strict;
use warnings;
$_ = `id $ARGV[0]`;
s/.*?groups=// && print "@{[ /\((\w+)\)/g ]}\n";
I'm not trying to be argumentative or say that this is "wrong"... But
does anyone else agree with this? If so, why is this way better than t
Tom Smith schreef:
> Mumia W.:
>> use strict;
>> use warnings;
>> $_ = `id $ARGV[0]`;
>> s/.*?groups=// && print "@{[ /\((\w+)\)/g ]}\n";
>
> I'm not trying to be argumentative or say that this is "wrong"... But
> does anyone else agree with this? If so, why is this way better than
> the pure Perl
Mumia W. wrote:
> On 12/20/2006 04:14 PM, Tom Smith wrote:
>> [...]
>> So is there a better way to do this, or perhaps a cleaner way?
>
> use strict;
> use warnings;
> $_ = `id $ARGV[0]`;
> s/.*?groups=// && print "@{[ /\((\w+)\)/g ]}\n";
print $1 if `groups $ARGV[0] 2>/dev/null` =~ /$ARGV[0]\s*:
Mumia W. wrote:
On 12/20/2006 04:14 PM, Tom Smith wrote:
[...]
So is there a better way to do this, or perhaps a cleaner way?
Thanks again for your help!
~ Tom
use strict;
use warnings;
$_ = `id $ARGV[0]`;
s/.*?groups=// && print "@{[ /\((\w+)\)/g ]}\n";
I'm not trying to be argumentativ
On 12/20/2006 04:14 PM, Tom Smith wrote:
[...]
So is there a better way to do this, or perhaps a cleaner way?
Thanks again for your help!
~ Tom
use strict;
use warnings;
$_ = `id $ARGV[0]`;
s/.*?groups=// && print "@{[ /\((\w+)\)/g ]}\n";
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Tom Smith wrote:
>
> Thank Chad (and John) for your input on this. I thought I'd post the
> portion of the script that I was trying to work out to see if there's
> room for improvement. This should work on any *nix system. The format of
> the command is simple: `test.pl username`, where username i
On Wed, Dec 20, 2006 at 03:14:18PM -0700, Tom Smith wrote:
>
> Thank Chad (and John) for your input on this. I thought I'd post the
> portion of the script that I was trying to work out to see if there's
> room for improvement. This should work on any *nix system. The format of
> the command is
Chad Perrin wrote:
On Mon, Dec 18, 2006 at 04:50:57PM -0700, Tom Smith wrote:
I need to capture a user's group memberships for further processing in a
Perl script. The user's username is passed to the script via the command
line and captured with ARGV. From there, I want to determine the gro
Tom Smith wrote:
> I need to capture a user's group memberships for further processing in a
> Perl script. The user's username is passed to the script via the command
> line and captured with ARGV. From there, I want to determine the group
> memberships (much like executing `groups` from the comman
On Mon, Dec 18, 2006 at 04:50:57PM -0700, Tom Smith wrote:
> I need to capture a user's group memberships for further processing in a
> Perl script. The user's username is passed to the script via the command
> line and captured with ARGV. From there, I want to determine the group
> memberships
35 matches
Mail list logo