#!/tools/ns/bin/perl5.004 -- # DO NOT EDIT THIS FILE! You must instead go to http://warp/mozilla.org, and # tweak things from there. $mode{'4'} = 'Open'; $branch{'4'} = 'HEAD'; $fullname{'4'} = 'default'; $mode{'3'} = 'Closed'; $branch{'3'} = 'HEAD'; $fullname{'3'} = 'despotaccess'; $blessed{'3'} = []; $super{'3'} = ['despotdaemon%netscape.com',]; $mode{'12'} = 'Open'; $branch{'12'} = 'HEAD'; $fullname{'12'} = 'jpeg'; sub GetT { ($b,$_) = (@_); if ($b eq 'HEAD') { if (m:CVSROOT/commitcheck\.pl:) {return '12';} if (m:CVSROOT/passwd:) {return '12';} } return ''; } $debug = 0; $origrepository = shift(@ARGV); @files = @ARGV; $envcvsroot = $ENV{'CVSROOT'}; open( REP, "; chop($repository); close(REP); $repository =~ s:^$envcvsroot/::; $doit = 0; $| = 1; if( $debug){ print STDERR "----------------------------------------------\n"; print STDERR "files: @files\n"; print STDERR "origrepository: $origrepository\n"; print STDERR " repository: $repository\n"; print STDERR "----------------------------------------------\n"; } open(ENT, " ){ chop; ($d,$fn,$rev,$mod_time,$sticky,$tag) = split(/\//); $fbranch{$fn} = $sticky; } close ENT; foreach $f (@files) { $b = ""; if (defined $fbranch{$f}) {$b = $fbranch{$f};} if ($b eq "") {$b = "HEAD";} $t = GetT($b, "$repository/$f"); if ($debug) { print STDERR "GetT returned '$t' for '$repository/$f' branch '$b'\n"; } if ($t eq "") { $t = "default"; } if (!defined $mode{$t} || $mode{$t} eq "Open") { next; } if ($debug) { print STDERR "Checking twig $t\n"; } # OK, we have a match. See if we're allowed to checkin here. if ($username eq "") { $username = $ENV{"CVS_USER"} || getlogin || (getpwuid($<))[0] || "nobody"; if ($debug) { print STDERR "Username is $username\n"; print STDERR "getlogin returns " . getlogin . "\n"; print STDERR '(getpwuid($<))[0] returns ' . (getpwuid($<))[0] . "\n"; print STDERR "Environment:\n"; foreach $key (sort(keys %ENV)) { print STDERR $key, '=', $ENV{$key}, "\n"; } } } $ok = 0; $s = $super{$t}; foreach $u (@$s) { if ($debug) { print STDERR "Checking against super $u\n"; } if ($u eq $username) { $ok = 1; break; } } if ($mode{$t} eq "Restricted") { $b = $blessed{$t}; foreach $u (@$b) { if ($debug) { print STDERR "Checking against blessed $u\n"; } if ($u eq $username) { $ok = 1; break; } } } if (!$ok) { print STDERR "You may not check into partition $fullname{$t}.\n"; print STDERR "If you think you should be allowed to, send mail to\n"; print STDERR "one of the below people:\n"; $s = $super{$t}; foreach $u (@$s) { $u =~ s/%/@/; print STDERR " $u\n"; } exit 1; } } exit 0;