Great Circle Associates Majordomo-Workers
(November 1995)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Modified majordomo checker (was Re: another silly question)
From: "Vincent D. Skahan" <vds7789 @ aw101 . iasl . ca . boeing . com>
Date: Thu, 9 Nov 1995 15:42:20 -0800 (PST)
To: pdc @ lunch . engr . sgi . com (Paul Close)
Cc: torin @ daft . com, walter @ nexchi . com, majordomo-workers @ GreatCircle . COM
In-reply-to: <199511081826.KAA00058@lunch.engr.sgi.com> from "Paul Close" at Nov 8, 95 10:26:56 am

(Paul Close writes:)
> We are slowly getting towards a configuration checker!  Now all we need
> is to check each directory in the .cf file, and we'd be most of the
> way there....
> 

oh what the heck.  I was 'hurling perl' and needed a diversion for a while
anyway...this is what was posted earlier, with some perl5 ('use English')
in there to make it at least a little more readable to me at least.

I call the script "config-test" since 'test' is such a bad name to use
for a script because it's built into some shells.

-- 
 ----------- Vince Skahan ------ vds7789@aw101.iasl.ca.boeing.com -----------



(output on 1.94a1 with a 'posix' wrapper - news.news mode 6755)
-------- try to open majordomo '.cf' file --------
----------- environment variables ----------------
   HOME=/site/sw/majordomo-1.94
   LOGNAME=news
   MAJORDOMO_CF=/site/sw/majordomo-1.94/majordomo.cf
   PATH=/bin:/usr/bin:/usr/ucb
   SHELL=/bin/csh
   SYSTYPE=bsd4.3
   USER=news
------------- euid/egid checks -------------------
   effective user  = news (uid 300)
   effective group = news news (gid 300 300)
-------------- uid/gid checks --------------------
   real      user  = news (uid 300)
   real      group = news news (gid 300 300)
-------------- end of tests ----------------------


(output on 1.94a1 with a 'root' wrapper - root.news mode 4755)
-------- try to open majordomo '.cf' file --------
----------- environment variables ----------------
   HOME=/site/sw/majordomo-1.94
   LOGNAME=news
   MAJORDOMO_CF=/site/sw/majordomo-1.94/majordomo.cf
   PATH=/bin:/usr/bin:/usr/ucb
   SHELL=/bin/csh
   SYSTYPE=bsd4.3
   USER=news
------------- euid/egid checks -------------------
   effective user  = root (uid 0)
   effective group = news news (gid 300 300)
-------------- uid/gid checks --------------------
   real      user  = root (uid 0)
   real      group = news news (gid 300 300)
-------------- end of tests ----------------------


#!/usr/local/bin/perl5
# $Id: test,v 1.3 1995/11/08 09:16:24 majordom Exp $
# configuration test for majordomo
# provided with majordomo, modifications by darren stalder <torin@daft.com>
# more mods by Vince Skahan <vince@atc.boeing.com>
#
# execute this by cd to your majordomo dir, then 'wrapper config-test'
#
# To use perl4 for this:
#    change $EUID to 
#    change $EGID to 
#    change $UID  to 
#    change $GID  to 
#    comment out the next two lines
require 5.000;
use English;

print "-------- try to open majordomo '.cf' file --------\n";
open(CF, $ENV{MAJORDOMO_CF}) || warn "unable to open $ENV{MAJORDOMO_CF}: $!";

print "----------- environment variables ----------------\n";
foreach $e (sort keys %ENV) {
        print "   $e=$ENV{$e}\n";
}


print "------------- euid/egid checks -------------------\n";
$euid_name=getpwuid($EUID);
push(@egid_group_numbers,(split(' ',$EGID)));   # it switches groups...
foreach $groupnum (@egid_group_numbers) {
	$name = getgrgid($groupnum);
	push(@egid_names,$name);
}
print "   effective user  = $euid_name (uid $EUID)\n";
print "   effective group = @egid_names (gid $EGID)\n";

print "-------------- uid/gid checks --------------------\n";
$uid_name=getpwuid($UID);
push(@gid_group_numbers,(split(' ',$GID)));   # it switches groups...
foreach $groupnum (@gid_group_numbers) {
	$name = getgrgid($groupnum);
	push(@gid_names,$name);
}
print "   real      user  = $uid_name (uid $UID)\n";
print "   real      group = @gid_names (gid $GID)\n";

print "-------------- end of tests ----------------------\n";
#
# that's all folks
#


References:
Indexed By Date Previous: MIMEified digests
From: Bob Campbell <campbelr@hpwsrec.cup.hp.com>
Next: Re: Modified majordomo checker (was Re: another silly question)
From: "Torin/Darren/Who Ever..." <torin@daft.com>
Indexed By Thread Previous: Re: another silly question
From: pdc@lunch.engr.sgi.com (Paul Close)
Next: A human readable list configuration file.
From: Chan Wilson <cwilson@splut.meadow.net>

Google
 
Search Internet Search www.greatcircle.com