sithnet-dev-patches Mailing List for SithNet Development (Page 3)
Brought to you by:
darthsidious_
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(5) |
Aug
(25) |
Sep
(3) |
Oct
(14) |
Nov
|
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Tim I. <dar...@us...> - 2003-07-30 22:54:44
|
Committer : Tim Ireland <dar...@us...> CVSROOT : /cvsroot/sithnet-dev Module : CVSROOT Commit time: 2003-07-30 22:54:44 UTC Modified files: checkoutlist commitinfo Added files: avail cvs_acls Log message: :( ---------------------- diff included ---------------------- Index: CVSROOT/avail diff -u /dev/null CVSROOT/avail:1.1 --- /dev/null Wed Jul 30 15:54:44 2003 +++ CVSROOT/avail Wed Jul 30 15:54:33 2003 @@ -0,0 +1,2 @@ +unavail +avail|darthsidious_ Index: CVSROOT/checkoutlist diff -u CVSROOT/checkoutlist:1.5 CVSROOT/checkoutlist:1.6 --- CVSROOT/checkoutlist:1.5 Tue Jul 29 12:03:21 2003 +++ CVSROOT/checkoutlist Wed Jul 30 15:54:33 2003 @@ -12,5 +12,10 @@ # # comment lines begin with '#' +all.template Unable to check out template. avail Unable to use CVS ACLs. cvs_acls Unable to use CVS ACLs. +new_commit_prep Won't be able to do mail logging. +new_log_accum Won't be able to do mail logging. +maillist Won't be able to do mail logging. +usermap Won't be able to do mail logging. Index: CVSROOT/commitinfo diff -u CVSROOT/commitinfo:1.5 CVSROOT/commitinfo:1.6 --- CVSROOT/commitinfo:1.5 Tue Jul 29 11:54:01 2003 +++ CVSROOT/commitinfo Wed Jul 30 15:54:33 2003 @@ -14,5 +14,5 @@ # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". -ALL /cvsroot/sitedocs/CVSROOT/cvstools/cvs_acls +DEFAULT $CVSROOT/CVSROOT/cvs_acls DEFAULT $CVSROOT/CVSROOT/new_commit_prep Index: CVSROOT/cvs_acls diff -u /dev/null CVSROOT/cvs_acls:1.1 --- /dev/null Wed Jul 30 15:54:44 2003 +++ CVSROOT/cvs_acls Wed Jul 30 15:54:33 2003 @@ -0,0 +1,193 @@ +#!/usr/bin/perl -w +# -*-Perl-*- +# +# Access control lists for CVS. dg...@ks... (David G. Grubbs) +# Branch specific controls added by vo...@by... (Aaron Voisine) +# +# CVS "commitinfo" for matching repository names, running the program it finds +# on the same line. More information is available in the CVS man pages. +# +# ==== INSTALLATION: +# +# To use this program as I intended, do the following four things: +# +# 0. Install PERL. :-) +# +# 1. Put one line, as the *only* non-comment line, in your commitinfo file: +# +# DEFAULT /usr/local/bin/cvs_acls +# +# 2. Install this file as /usr/local/bin/cvs_acls and make it executable. +# +# 3. Create a file named CVSROOT/avail and optionally add it to +# CVSROOT/checkoutlist and check it in. See the CVS manual's +# administrative files section about checkoutlist. Typically: +# +# $ cvs checkout CVSROOT +# $ cd CVSROOT +# [ create the avail file ] +# [ add avail to checkoutlist ] +# $ cvs add avail +# $ cvs commit -m 'Added avail for use with cvs_acls.' avail checkoutlist +# +# ==== FORMAT OF THE avail FILE: +# +# The avail file determines whether you may commit files. It contains lines +# read from top to bottom, keeping track of a single "bit". The "bit" +# defaults to "on". It can be turned "off" by "unavail" lines and "on" by +# "avail" lines. ==> Last one counts. +# +# Any line not beginning with "avail" or "unavail" is ignored. +# +# Lines beginning with "avail" or "unavail" are assumed to be '|'-separated +# triples: (All spaces and tabs are ignored in a line.) +# +# {avail.*,unavail.*} [|user,user,... [|repos,repos,... [|branch,branch,...]]] +# +# 1. String starting with "avail" or "unavail". +# 2. Optional, comma-separated list of usernames. +# 3. Optional, comma-separated list of repository pathnames. +# These are pathnames relative to $CVSROOT. They can be directories or +# filenames. A directory name allows access to all files and +# directories below it. +# 4. Optional, comma-separated list of branch tags. +# If not specified, all branches are assumed. Use HEAD to reference the +# main branch. +# +# Example: (Text from the ';;' rightward may not appear in the file.) +# +# unavail ;; Make whole repository unavailable. +# avail|dgg ;; Except for user "dgg". +# avail|fred, john|bin/ls ;; Except when "fred" or "john" commit to +# ;; the module whose repository is "bin/ls" +# avail|ed|/bin/ls|stable ;; Except when "ed" commits to the "stable" +# ;; branch of the "bin/ls" repository +# +# PROGRAM LOGIC: +# +# CVS passes to @ARGV an absolute directory pathname (the repository +# appended to your $CVSROOT variable), followed by a list of filenames +# within that directory. +# +# We walk through the avail file looking for a line that matches the +# username, repository and branch. +# +# A username match is simply the user's name appearing in the second +# column of the avail line in a space-or-comma separate list. +# +# A repository match is either: +# - One element of the third column matches $ARGV[0], or some +# parent directory of $ARGV[0]. +# - Otherwise *all* file arguments ($ARGV[1..$#ARGV]) must be +# in the file list in one avail line. +# - In other words, using directory names in the third column of +# the avail file allows committing of any file (or group of +# files in a single commit) in the tree below that directory. +# - If individual file names are used in the third column of +# the avail file, then files must be committed individually or +# all files specified in a single commit must all appear in +# third column of a single avail line. +# +# A branch match is either: +# - When no branches are listed in the fourth column. +# - One element from the fourth column matches each of the tag +# names for $ARGV[1..$#ARGV] found in the CVS/Entries file. +# - HEAD specified in the fourth column will match if there +# is no tag listed in the CVS/Entries file. +# + +$debug = 0; +$cvsroot = $ENV{'CVSROOT'}; +$availfile = $cvsroot . "/CVSROOT/avail"; +$entries = "CVS/Entries"; +$myname = $ENV{"USER"} if !($myname = $ENV{"LOGNAME"}); + +eval "print STDERR \$die='Unknown parameter $1\n' if !defined \$$1; \$$1=\$';" + while ($ARGV[0] =~ /^(\w+)=/ && shift(@ARGV)); +exit 255 if $die; # process any variable=value switches + +die "Must set CVSROOT\n" if !$cvsroot; +($repos = shift) =~ s:^$cvsroot/::; +grep($_ = $repos . '/' . $_, @ARGV); + +print "$$ Repos: $repos\n","$$ ==== ",join("\n$$ ==== ",@ARGV),"\n" if $debug; + +$exit_val = 0; # Good Exit value + +$universal_off = 0; + +my %branch; +my $f; + +open(ENTRIES, $entries) || die("Cannot open $entries.\n"); +while(<ENTRIES>) { + chop; + next if /^\s*$/; + if(m|^[^/]*/([^/]*)/(?:[^/]*/)*[^/]?([^/]*)$|) { + $branch{$repos . '/' . $1} = ($2) ? $2 : "HEAD"; + print "$$ $1/$2\n" if $debug; + } +} +close(ENTRIES); + +open (AVAIL, $availfile) || exit(0); # It is ok for avail file not to exist +while (<AVAIL>) { + chop; + next if /^\s*\#/; + next if /^\s*$/; + ($flagstr, $u, $m, $b) = split(/[\s,]*\|[\s,]*/, $_); + + # Skip anything not starting with "avail" or "unavail" and complain. + (print "Bad avail line: $_\n"), next + if ($flagstr !~ /^avail/ && $flagstr !~ /^unavail/); + + # Set which bit we are playing with. ('0' is OK == Available). + $flag = (($& eq "avail") ? 0 : 1); + + # If we find a "universal off" flag (i.e. a simple "unavail") remember it + $universal_off = 1 if ($flag && !$u && !$m && !$b); + + # $myname considered "in user list" if actually in list or is NULL + $in_user = (!$u || grep ($_ eq $myname, split(/[\s,]+/,$u))); + print "$$ \$myname($myname) in user list: $_\n" if $debug && $in_user; + + # Module matches if it is a NULL module list in the avail line. If module + # list is not null, we check every argument combination. + if (!($in_repo = !$m)) { + @tmp = split(/[\s,]+/,$m); + for $j (@tmp) { + # If the repos from avail is a parent(or equal) dir of $repos, OK + $in_repo = 1, last if ($repos eq $j || $repos =~ /^$j\//); + } + if (!$in_repo) { + $in_repo = 1; + for $j (@ARGV) { + last if !($in_repo = grep ($_ eq $j, @tmp)); + } + } + } + print "$$ \$repos($repos) in repository list: $_\n" if $debug && $in_repo; + + # Branch matches if it is in the branch list in the avail line, the branch + # list is NULL, or there is no branch and HEAD is in the branch list. + if(!($in_branch = !$b)) { + @bls = split (/[\s,]+/,$b); + + for $j (@ARGV) { + $f = $j; + last if !($in_branch = grep($_ eq $branch{$j}, @bls)); + } + } + print "$$ \$branch($branch{$f}) in branch list: $_\n" + if $debug && $in_branch; + + $exit_val = $flag if ($in_user && $in_repo && $in_branch); + print "$$ ==== \$exit_val = $exit_val\n$$ ==== \$flag = $flag\n" if $debug; +} +close(AVAIL); +print "$$ ==== \$exit_val = $exit_val\n" if $debug; +print "**** Access denied: Insufficient Karma ($myname|$repos|$branch{$f})\n" + if $exit_val; +print "**** Access allowed: Personal Karma exceeds Environmental Karma.\n" + if $universal_off && !$exit_val; +exit($exit_val); ----------------------- End of diff ----------------------- |
From: Tim I. <dar...@us...> - 2003-07-29 21:21:55
|
Committer : Tim Ireland <dar...@us...> CVSROOT : /cvsroot/sithnet-dev Module : CVSROOT Commit time: 2003-07-29 19:03:31 UTC Modified files: checkoutlist Removed files: all.template maillist new_commit_prep new_log_accum usermap Log message: Removed [CVS] Email commit script because it sucked ---------------------- diff included ---------------------- Index: CVSROOT/all.template diff -u CVSROOT/all.template:1.1 CVSROOT/all.template:removed --- CVSROOT/all.template:1.1 Wed Jul 9 15:38:41 2003 +++ CVSROOT/all.template Tue Jul 29 12:03:31 2003 @@ -1,3 +0,0 @@ -Author: -Log message: - Index: CVSROOT/checkoutlist diff -u CVSROOT/checkoutlist:1.4 CVSROOT/checkoutlist:1.5 --- CVSROOT/checkoutlist:1.4 Tue Jul 29 11:46:22 2003 +++ CVSROOT/checkoutlist Tue Jul 29 12:03:21 2003 @@ -12,10 +12,5 @@ # # comment lines begin with '#' -all.template Unable to check out template. avail Unable to use CVS ACLs. cvs_acls Unable to use CVS ACLs. -new_commit_prep Won't be able to do mail logging. -new_log_accum Won't be able to do mail logging. -maillist Won't be able to do mail logging. -usermap Won't be able to do mail logging. Index: CVSROOT/maillist diff -u CVSROOT/maillist:1.1 CVSROOT/maillist:removed --- CVSROOT/maillist:1.1 Tue Jul 29 11:46:23 2003 +++ CVSROOT/maillist Tue Jul 29 12:03:31 2003 @@ -1,20 +0,0 @@ -# The "maillist" file is used to control commit log mails. -# The (space-separated) addresses on the right will be added -# to the list of addresses mail will be sent to. Using -m -# on the new_logaccum command line will override the contents -# of this file. -# -# The first entry on a line is a regular expression which is tested -# against the module that the change is being committed to, relative -# to the $CVSROOT. For the each match that is found, the remainder -# of the line is the list of email addresses. Note this regular -# expression is compared only against the *first* component of the -# path! -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". - -DEFAULT sit...@li... Index: CVSROOT/new_commit_prep diff -u CVSROOT/new_commit_prep:1.2 CVSROOT/new_commit_prep:removed --- CVSROOT/new_commit_prep:1.2 Tue Jul 29 11:46:23 2003 +++ CVSROOT/new_commit_prep Tue Jul 29 12:03:31 2003 @@ -1,126 +0,0 @@ -#!/usr/bin/perl -w -# -# Copyright (C) 2000,2002 by Kevin L. Mitchell <kl...@mi...> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. -# -# Script to store the last visited directory for newlogaccum.pl. -# -# $Id: new_commit_prep,v 1.2 2003/07/29 18:46:23 darthsidious_ Exp $ - -use strict; - -use vars qw($debug); - -# Don't touch this; use the -d command line option -$debug = 0; - -# Debugging output -sub debug (@) { - print STDERR "$0: ", @_ - if ($debug); -} - -# This routine removes everything in a directory -sub clear_dir { - my ($dir) = @_; - my ($file); - - opendir(DIR, $dir) || die "Cannot clear directory $dir: $!"; - while ($file = readdir(DIR)) { - next - if ($file eq "." || $file eq ".."); - - $file = "$dir/$file"; - - if (-d $file) { - # It's a directory, recurse into it, then delete it. - clear_dir($file); - rmdir($file); - } else { - # It's a file, delete it. - unlink($file); - } - } - closedir(DIR); -} - -# This routine prepares a temporary directory, hopefully in a secure -# fashion; it uses the process group to make secondary programs be able -# to find it. -sub tmpdir (;$) { - my ($clear) = @_; - my ($pgrp, $own, $mode, $tmpdir); - - $pgrp = getpgrp(); - - die "Don't run $0 setuid!" - unless ($< == $>); - - # Decide on the directory name, using various environment variables - $tmpdir = ($ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp") . - "/.#cvs.$pgrp"; - - # Doesn't exist, but we can't create it... - die "Can't create temporary directory $tmpdir: $!" - unless (-e $tmpdir || mkdir($tmpdir, 0700)); - - die "Temporary directory $tmpdir is not a directory" - unless (-d $tmpdir); - - # Check ownership and permissions - (undef, undef, $mode, undef, $own, undef) = stat($tmpdir); - - die "Temporary directory $tmpdir not owned by $< (owned by $own)" - unless ($own == $<); - - die "Temporary directory $tmpdir group-writable" - if ($mode & 0020); - die "Temporary directory $tmpdir other-writable" - if ($mode & 0002); - - # If we're supposed to clear the directory, do so... - clear_dir($tmpdir) - if ($clear); - - return $tmpdir; -} - -# This routine writes a single line to a file -sub write_line ($$) { - my ($fname, $line) = @_; - - debug "Writing line \"$line\" to \"$fname\"...\n"; - - open(FILE, ">$fname") || die "Cannot open file $fname for writing"; - print FILE "$line\n"; - close(FILE); -} - -# Create and empty the temporary directory -my ($tmpdir) = (tmpdir(1)); - -# Set debugging if necessary -if ($ARGV[0] eq "-d") { - shift(@ARGV); - $debug++; -} - -# Log command line -debug "options \"", join("\" \"", @ARGV), "\"\n"; - -# Store the directory name -write_line("$tmpdir/lastdir", shift(@ARGV)); Index: CVSROOT/new_log_accum diff -u CVSROOT/new_log_accum:1.3 CVSROOT/new_log_accum:removed --- CVSROOT/new_log_accum:1.3 Tue Jul 29 11:46:23 2003 +++ CVSROOT/new_log_accum Tue Jul 29 12:03:31 2003 @@ -1,929 +0,0 @@ -#!/usr/bin/perl -w -# -# Copyright (C) 2000,2002 by Kevin L. Mitchell <kl...@mi...> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. -# -# Script to accumulate log messages for an entire tree and send them along -# with the diffs; deals correctly with all manner of branching (I hope) -# -# $Id: new_log_accum,v 1.3 2003/07/29 18:46:23 darthsidious_ Exp $ - -use strict; - -use vars qw($MAILER $CVS $debug $maillist $usermap); - -# Set this to the full path of a mailer that takes -s <subject> and a list -# of email addresses as arguments... -$MAILER = "/bin/mail"; - -# Set this to the path of the CVS binary responsible for this tree... -$CVS = "/usr/bin/cvs"; - -# Don't touch this; use the -d command line option -$debug = 0; - -# Don't touch this, just create (or delete) the file -$maillist = "$ENV{CVSROOT}/CVSROOT/maillist"; - -# Expand usernames to email addresses based on a map file? -$usermap = "$ENV{CVSROOT}/CVSROOT/usermap"; - -use POSIX qw(setsid); - -# Debugging output -sub debug (@) { - my (@args) = @_; - - if ($args[0] eq "-np") { - shift(@args); - } else { - unshift(@args, "$0: "); - } - - print STDERR @args - if ($debug); -} - -# We have to dissociate from our parent, so that the CVS commit can -# complete, before we try to extract the diffs -sub daemonize { - debug "Daemonizing..."; - defined(my $pid = fork()) || die "Can't fork: $!"; - exit(0) - if $pid; - unless ($debug) { - open(STDIN, "</dev/null"); - open(STDOUT, ">/dev/null"); - open(STDERR, ">&STDOUT"); - for (my $i = 2; $i < 255; $i++) { - POSIX::close($i); - } - } - chdir("/"); - setsid() || die "Can't start a new session: $!"; - debug "-np", "Done!\n"; -} - -# Constants used in the FSM below for parsing the log message -sub STATE_NONE { 0 } -sub STATE_MODIFIED { 1 } -sub STATE_ADDED { 2 } -sub STATE_REMOVED { 3 } -sub STATE_LOG1 { 4 } -sub STATE_LOG2 { 5 } - -# borrowed from cvs2cl.pl -- Let's have our usermap in here also :P~ -sub maybe_read_usermap () -{ - my %expansions; - - if ($usermap) - { - open (MAPFILE, "<$usermap") - or die ("Unable to open $usermap ($!)"); - - while (<MAPFILE>) - { - next if /^\s*#/; # Skip comment lines. - next if not /:/; # Skip lines without colons. - - # It is now safe to split on ':'. - my ($username, $expansion) = split ':'; - chomp $expansion; - $expansion =~ s/^'(.*)'$/$1/; - $expansion =~ s/^"(.*)"$/$1/; - - # If it looks like the expansion has a real name already, then - # we toss the username we got from CVS log. Otherwise, keep - # it to use in combination with the email address. - if ($expansion =~ /^\s*<{0,1}\S+@.*/) { - # Also, add angle brackets if none present - if (! ($expansion =~ /<\S+@\S+>/)) { - $expansions{$username} = "$username <$expansion>"; - } - else { - $expansions{$username} = "$username $expansion"; - } - } - else { - $expansions{$username} = $expansion; - } - } - - close (MAPFILE); - } - - return %expansions; -} - -# This routine removes everything in a directory -sub clear_dir { - my ($dir) = @_; - my ($file); - - opendir(DIR, $dir) || die "Cannot clear directory $dir: $!"; - while ($file = readdir(DIR)) { - next - if ($file eq "." || $file eq ".."); - - $file = "$dir/$file"; - - if (-d $file) { - # It's a directory, recurse into it, then delete it. - clear_dir($file); - rmdir($file); - } else { - # It's a file, delete it. - unlink($file); - } - } - closedir(DIR); -} - -# This routine prepares a temporary directory, hopefully in a secure -# fashion; it uses the process group to make secondary programs be able -# to find it. -sub tmpdir (;$) { - my ($clear) = @_; - my ($pgrp, $own, $mode, $tmpdir); - - $pgrp = getpgrp(); - - die "Don't run $0 setuid!" - unless ($< == $>); - - # Decide on the directory name, using various environment variables - $tmpdir = ($ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp") . - "/.#cvs.$pgrp"; - - # Doesn't exist, but we can't create it... - die "Can't create temporary directory $tmpdir: $!" - unless (-e $tmpdir || mkdir($tmpdir, 0700)); - - die "Temporary directory $tmpdir is not a directory" - unless (-d $tmpdir); - - # Check ownership and permissions - (undef, undef, $mode, undef, $own, undef) = stat($tmpdir); - - die "Temporary directory $tmpdir not owned by $< (owned by $own)" - unless ($own == $<); - - die "Temporary directory $tmpdir group-writable" - if ($mode & 0020); - die "Temporary directory $tmpdir other-writable" - if ($mode & 0002); - - # If we're supposed to clear the directory, do so... - clear_dir($tmpdir) - if ($clear); - - return $tmpdir; -} - -# Routine to remove the temporary directory when done -sub cleanup_dir ($) { - # If we're debugging, we may want to look at the contents... - return - if ($debug); - - clear_dir($_[0]); - rmdir($_[0]); -} - -# Retrieve a single line from a specified file -sub get_line ($) { - my ($fname) = @_; - - open(FILE, "<$fname") || die "Cannot open file $fname for reading"; - my $line = <FILE>; - close(FILE); - - # Chomp off the \n - chomp $line; - - return $line; -} - -# Routine that only allows one value to be pushed on the array; -# implemented by making the first element of the array a hash-reference. -# When we add a new value, we also increment the count of an element in -# the hash with the key being the array value... -sub push_once (\@@) { - my ($array, @values) = @_; - - # If the array is empty, create our hash ref - push @{$array}, {} - if (@{$array} == 0); - - foreach my $value (@values) { - push @{$array}, $value - if (!exists($array->[0]{$value})); - - $array->[0]{$value}++; - } - - return @{$array} - 1; -} - -# Load a list of regular expressions and email addresses -sub load_maillist ($) { - my ($file) = @_; - my ($mmap) = ({ - DEFAULT => [], - ALL => [], - re => {}, - }); - - # Don't load the list if it doesn't exist - return undef - unless (-e $file); - - # Open the map file - open(MAILFILE, "<$file"); - while (<MAILFILE>) { - chomp; - - s/\#.*$//; - next - if (/^\s*$/); - - my ($re, @addrs) = split; - - # DEFAULT and ALL are treated specially - if ($re eq "DEFAULT" || $re eq "ALL") { - push_once(@{$mmap->{$re}}, @addrs); - } else { - $mmap->{re}{$re} = [] - unless (exists($mmap->{re}{$re})); - - # Remember the associated email addresses - push_once(@{$mmap->{re}{$re}}, @addrs); - } - } - close(MAILFILE); - - return $mmap; -} - -# Given the module's name (and a mailmap structure), return the necessary -# email addresses -sub make_maillist ($$@) { - my ($mmap, $module, @inaddrs) = @_; - my ($matches, @addrs) = 0; - - # Return defaults passed in - return @inaddrs - unless (defined($mmap)); - - # Everything in ALL gets a message - push_once(@addrs, @{$mmap->{ALL}}[1..$#{$mmap->{ALL}}]); - # Now check each pattern one by one - foreach my $pat (keys(%{$mmap->{re}})) { - if ($module =~ /$pat/) { - $matches++; - push_once(@addrs, @{$mmap->{re}{$pat}}[1..$#{$mmap->{re}{$pat}}]); - } - } - # If no patterns matched, push on the defaults - push_once(@addrs, @{$mmap->{DEFAULT}}[1..$#{$mmap->{DEFAULT}}]) - unless ($matches > 0); - - # Return the defaults if we came up with nothing - return @inaddrs - unless (@addrs > 0); - - # Return just the addresses - return @addrs[1..$#addrs]; -} - -# Filter //, /./, and remove leading ./ or / from filenames -sub fname_filter ($) { - my ($fname) = @_; - - $fname =~ s,//,/,g; - $fname =~ s,/\./,/,g; - $fname =~ s,^\.?/,,g; - - return $fname; -} - -# Store file data in a temporary file -sub names_to_file ($$@) { - my ($fname, $dir, @names) = @_; - - if (@names > 0) { - open(FILE, ">>$fname") || die "Cannot open file $fname for appending"; - - # Store the directory data - print FILE "D $dir\n"; - - foreach my $name (@names) { - # Mark record as a file... - print FILE "F "; - - # Store the tag, if there is one... - print FILE "$name->{tag}" - if (defined($name->{tag})); - - # Then store old revision, new revision, and file name - print FILE ":$name->{old}:$name->{new}:$name->{file}\n"; - } - - close(FILE); - } -} - -# Retrieve file data from temporary file; updates branch tags with what it -# reads -sub file_to_names (\@$) { - my ($btags, $fname) = @_; - my ($dir) = (undef); - my (@names) = (); - - debug "Reading file names from $fname...\n"; - - # We may not have, say, added a file in this subdirectory... - return () - if (!-e $fname); - - open(FILE, "<$fname"); - while(<FILE>) { - chomp; - - # Get record type... - my ($type, $data) = split(' ', $_, 2); - - # ok, it's a directory, remember that... - if ($type eq "D") { - $dir = $data; - - debug "Read directory $dir\n"; - - next; - } - - debug "Read file $data\n"; - - # Get all the information about the file - my ($tag, $old, $new, $file) = split(':', $data); - - # and store it all - push(@names, { tag => $tag, old => $old, new => $new, file => $file, - dir => $dir, name => fname_filter("$dir/$file") }); - - # Remember the tags... - push_once(@{$btags}, $tag) - if (defined($tag) && $tag ne ""); - } - close(FILE); - - return @names; -} - -# Create a text-formatted list of names -sub name_to_list (\@@) { - my ($btags, @names) = @_; - my (@nlist, @nline) = (); - - debug "Tags:", join(':', @{$btags}), "\n"; - - # We group them by tag - foreach my $tag ("", @{$btags}[1..$#{$btags}]) { - debug "Processing tag $tag...\n"; - - @nlist = (); - - # Get a list of files by the tag... - foreach my $name (@names) { - debug "Processing $name->{file}...\n"; - - next - if ($name->{tag} ne $tag); - - debug "Pushing $name->{name} on \@nlist...\n"; - push(@nlist, $name->{name}); - } - - # If the tag is not the empty string, list the tag... - push(@nline, " Tag: $tag", " ") - if ($tag ne ""); - - # Now list each file name - foreach my $name (@nlist) { - # indent if we run past the end of line limit - push(@nline, " ") - if (@nline == 0 || ($nline[$#nline] ne " " && - length($nline[$#nline]) + length($name) + 1 > 70)); - - # add the file name to the list - debug "Adding $name to \@nline...\n"; - $nline[$#nline] .= " $name"; - } - } - - return @nline; -} - -# write the log message to a temporary file -sub write_log ($@) { - my ($fname, @text) = @_; - - open(FILE, ">$fname") || die "Cannot open file $fname for writing"; - print FILE join("\n", @text), "\n"; - close(FILE); -} - -# load module list -sub load_modules ($) { - my ($tmpdir) = @_; - my (@modlist); - - debug "Reading modules from $tmpdir/modules...\n"; - - # We may not have, say, recorded any modules yet - return () - if (!-e "$tmpdir/modules"); - - open(MODLIST, "<$tmpdir/modules"); - push_once(@modlist, map { chomp; $_ } <MODLIST>); - close(MODLIST); - - return @modlist; -} - -# save module list -sub save_modules (\@$) { - my ($modlist, $tmpdir) = @_; - - debug "Writing modules out to $tmpdir/modules...\n"; - - open(MODLIST, ">$tmpdir/modules"); - print MODLIST join("\n", @{$modlist}[1..$#{$modlist}]), "\n"; - close(MODLIST); -} - -# Build the header of the commit message: CVSROOT, module name, any -# branch tags, and the commit time -sub build_header ($@) { - my ($module, @branch_tags) = @_; - my (@text); - my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time()); - my ($user) = (getpwuid($<)); - my %usermap; - - %usermap = &maybe_read_usermap (); - - if (defined ($usermap{$user}) and $usermap{$user}) { - $user = $usermap{$user}; - } - - push(@text, "Committer : $user"); - push(@text, "CVSROOT : $ENV{CVSROOT}"); - push(@text, "Module : $module"); - push(@text, "Branch tags: " . join(' ', @branch_tags[1..$#branch_tags])) - if (@branch_tags > 0); - push(@text, sprintf("Commit time: %04d-%02d-%02d %02d:%02d:%02d UTC", - $year + 1900, $mon + 1, $mday, $hour, $min, $sec)); - - return @text, ""; -} - -# Send the mail message -sub send_mail (\@$@) { - my ($mailto, $subject, @text) = @_; - - debug("Sending mail, subject \"$subject\", to ", join(' ', @{$mailto}), - "\n"); - debug("-np", "> ", join("\n> ", @text), "\n"); - - # Execute our mailer... - my $pid = open(MAIL, "|-"); - - exec($MAILER, '-s', $subject, @{$mailto}) - unless ($pid); - - print MAIL join("\n", @text), "\n"; - close(MAIL); -} - -# Generates the diffs to include -sub diff_files ($@) { - my ($module, @files) = @_; - my (@text); - - foreach my $file (@files) { - debug "Diffing file $file->{name} (module $module)\n"; - - # Run cvs rdiff, extracting a diff between the old and new versions - my $pid = open(DIFF, "-|"); - - exec($CVS, '-Q', 'rdiff', '-u', '-r', $file->{old}, '-r', $file->{new}, - "$module/$file->{name}") - unless ($pid); - - # Chomp and store all the text... - push(@text, map { chomp; $_ } <DIFF>); - - close(DIFF); - } - - return @text; -} - -# Read in and process log message -sub read_log (\%\@\@\@\@\@) { - my ($fversions, $modified, $added, $removed, $log, $branch_tags) = @_; - my ($state, $tag) = (STATE_NONE, undef); - - while (<STDIN>) { - chomp; - - debug "State $state, line:$_\n"; - - # Ignore empty space at the beginning of the log message - next - if ($state == STATE_LOG1 && /^\s*$/); - - # We're done ignoring empty space - if ($state == STATE_LOG1) { - $state = STATE_LOG2; - } - - if ($state == STATE_LOG2) { - # Don't modify the lines at all if we're processing the log message - push(@{$log}, $_); - next; - } else { - # Strip out leading and trailing space - s/^\s*(.*?)\s*$/$1/; - } - - if (/^Modified Files/) { - # Collect list of modified files - debug "State switching to STATE_MODIFIED\n"; - - $state = STATE_MODIFIED; - $tag = undef; - - next; - - } elsif (/^Added Files/) { - # Collect list of added files - debug "State switching to STATE_ADDED\n"; - - $state = STATE_ADDED; - $tag = undef; - - next; - - } elsif (/^Removed Files/) { - # Collect list of removed files - debug "State switching to STATE_REMOVED\n"; - - $state = STATE_REMOVED; - $tag = undef; - - next; - - } elsif (/^Log Message/) { - # Collect log message - debug "State switching to STATE_LOG1\n"; - - $state = STATE_LOG1; - $tag = undef; - - next; - - } elsif (/^Revision\/Branch/) { - # Parse old-style Revision/Branch field - debug "Found a branch tag\n"; - - /^[^:]+:\s*(.*)/; - - push_once(@{$branch_tags}, $1); - - warn "Tag == $tag" - if (defined($tag)); - - next; - } - - # Ignore the stuff at the top of the commit report - next - if ($state == STATE_NONE); - - if (/^Tag:\s*(.*)$/) { - # Remember the tag - debug "Setting tag to $1\n"; - $tag = $1; - next; - } - - my (@tfiles) = (); - - # Find the file in our command line list of files - foreach my $file (split) { - die "Nothing known about file $file!" - unless (exists($fversions->{$file})); - - push @tfiles, { - file => $file, - tag => $tag, - old => $fversions->{$file}{old}, - new => $fversions->{$file}{new}, - }; - } - - # Store the file list in the correct array - push(@{$modified}, @tfiles) - if ($state == STATE_MODIFIED); - - push(@{$added}, @tfiles) - if ($state == STATE_ADDED); - - push(@{$removed}, @tfiles) - if ($state == STATE_REMOVED); - } - - # Remove trailing blank lines from the log message - while (@{$log} > 0 && $log->[$#{$log}] =~ /^\s*$/) { - pop(@{$log}); - } -} - -# Build and send message for a new directory -sub send_newdir ($$\@\@@) { - my ($module, $dir, $log, $branch_tags, @mailto) = @_; - my (@text) = (); - - # If there was a sticky tag for the directory, make it a branch tag - if ($log->[$#{$log}] =~ /^--> Using per-directory sticky tag \`(.*)\'$/) { - push_once(@{$branch_tags}, $1); - pop(@{$log}); - } - - # Build the message... - push(@text, build_header($module, @{$branch_tags})); - push(@text, "Log message:", "", @{$log}); - - # and send it (synchronously) - send_mail(@mailto, "[CVS] Module $module: New directory $dir", @text); -} - -# Build and send message for an import -sub send_import ($$\@\@@) { - my ($module, $dir, $log, $branch_tags, @mailto) = @_; - my (@text) = (); - - # Build the message... - push(@text, build_header($module, @{$branch_tags})); - push(@text, "Log message:", "", @{$log}); - - # and send it (synchronously) - send_mail(@mailto, "[CVS] Module $module: Imported $dir", @text); -} - -# Find log file matching our log -sub find_logfile ($$\@) { - my ($module, $tmpdir, $log) = @_; - my ($i); - - debug "Searching for log file index..."; - - for ($i = 0; ; $i++) { - my (@text); - - # found one that doesn't exist... - last - if (!-e "$tmpdir/mod.$module/logfile.$i"); - - # read in the log file - open(FILE, "<$tmpdir/mod.$module/logfile.$i"); - push(@text, map { chomp; $_ } <FILE>); - close(FILE); - - # If the log file was empty, use it - last - if (@text == 0); - - # If the log messages are identical, use that - last - if (join(' ', @{$log}) eq join(' ', @text)); - } - - debug "-np", "$tmpdir/mod.$module/logfile.$i\n"; - - return $i; -} - -sub send_commit ($$@) { - my ($module, $tmpdir, @mailto) = @_; - my ($i, @text, @modified, @added, @removed, @files, @branch_tags); - - for ($i = 0; ; $i++) { - # No more log files - last - if (!-e "$tmpdir/mod.$module/logfile.$i"); - - # read modified list and list all modified files if non-empty - @modified = file_to_names(@branch_tags, - "$tmpdir/mod.$module/modified.$i"); - push(@text, "Modified files:", name_to_list(@branch_tags, @modified), - "") - if (@modified > 0); - - # read added list and list all added files if non-empty - @added = file_to_names(@branch_tags, "$tmpdir/mod.$module/added.$i"); - push(@text, "Added files:", name_to_list(@branch_tags, @added), "") - if (@added > 0); - - # read removed list and list all removed files if non-empty - @removed = file_to_names(@branch_tags, - "$tmpdir/mod.$module/removed.$i"); - push(@text, "Removed files:", name_to_list(@branch_tags, @removed), "") - if (@removed > 0); - - # read and insert the log message - open(FILE, "<$tmpdir/mod.$module/logfile.$i"); - push(@text, "Log message:", ""); - push(@text, map { chomp; $_ } <FILE>); - push(@text, ""); - close(FILE); - - # remember all the files we looked at - push(@files, @modified, @added, @removed); - } - - # Now that name_to_list has rebuilt our list of branch tags, we can build - # the header and prepend it to the message - unshift(@text, build_header($module, @branch_tags)); - - # sort the files out for our diff - @files = sort { $a->{name} cmp $b->{name} } @files; - - # add the diff... - push(@text, "---------------------- diff included ----------------------"); - push(@text, diff_files($module, @files)); - push(@text, "----------------------- End of diff -----------------------"); - - # Now send the mail unless @text contains ChangeLog - send_mail(@mailto, "[CVS] Module $module: Change committed", @text); -} - -# Find the tmp directory -my ($tmpdir) = (tmpdir()); - -my (@mailto) = (); -my (@files) = (); -my (@path) = (); -my ($module, $repdir, $dir, $mailmap) = (undef, undef, undef, undef); - -# Process command line arguments -while (@ARGV > 0) { - my ($arg) = (shift(@ARGV)); - - if ($arg eq '-d') { - # Turn on debugging - $debug++; - } elsif ($arg eq '-m') { - # An address to mail the notification to - die "Argument for -m missing" - unless (@ARGV > 0); - - push(@mailto, shift(@ARGV)); - } else { - # the list of filenames passed by CVS--you *must* use %{sVv}! - die "Too many arguments!" - unless (@files == 0); - - @files = split(" ", $arg); - } -} - -$mailmap = load_maillist($maillist) - unless (@mailto > 0); - -die "Nobody to mail to" - unless (@mailto > 0 || defined($mailmap)); - -die "No files to process" - unless (@files > 1); - -# The repository directory -$repdir = shift(@files); - -# break it appart... -@path = split("/", $repdir); - -# Now we know the module name, if it wasn't explicitly set -$module = $path[0]; - -# Figure out what our directory is -if (@path == 1) { - $dir = "."; -} else { - $dir = join("/", @path[1..$#path]); -} - -# append a / to it... -$dir .= "/"; - -debug "module = $module\n"; -debug "dir = $dir\n"; -debug "path = ", join(":", @path), "\n"; -debug "files = ", join(":", @files), "\n"; -debug "tmpdir = $tmpdir\n"; - -my (%fversions); - -# Unless its a new directory or imported sources, create file records -unless (defined($files[1]) && defined($files[2]) && - (($files[1] eq "New" && $files[2] eq "directory") || - ($files[1] eq "Imported" && $files[2] eq "sources"))) { - - foreach my $fname (@files) { - # You *must* use %{sVv} in the call in loginfo! - die "Invalid filenames" - unless ($fname =~ /^(.*),([0-9.]+|NONE),([0-9.]+|NONE)$/); - - $fversions{$1} = { - old => ($2 eq "NONE" ? "0" : $2), - new => ($3 eq "NONE" ? "0" : $3), - }; - } -} - -my (@modules) = load_modules($tmpdir); -push_once(@modules, $module); -save_modules(@modules, $tmpdir); - -die "Can't create per-module directory $tmpdir/mod.$module: $!" - unless (-e "$tmpdir/mod.$module" || mkdir("$tmpdir/mod.$module", 0700)); - -die "Per-module directory $tmpdir/mod.$module is not a directory" - unless (-d "$tmpdir/mod.$module"); - -my (@modified, @added, @removed, @log, @branch_tags); - -read_log(%fversions, @modified, @added, @removed, @log, @branch_tags); - -# If a new directory was added, we're done... -if (defined($files[1]) && defined($files[2]) && - $files[1] eq "New" && $files[2] eq "directory") { - debug "Sending log message for new directory $dir\n"; - send_newdir($module, $dir, @log, @branch_tags, - make_maillist($mailmap, $module, @mailto)); -} elsif (defined($files[1]) && defined($files[2]) && - $files[1] eq "Imported" && $files[2] eq "sources") { - debug "Sending log message for new import $dir\n"; - send_import($module, $dir, @log, @branch_tags, - make_maillist($mailmap, $module, @mailto)); -} else { - my $i = find_logfile($module, $tmpdir, @log); - - # Store modified, added, and removed file lists, along with the log message - names_to_file("$tmpdir/mod.$module/modified.$i", $dir, @modified); - names_to_file("$tmpdir/mod.$module/added.$i", $dir, @added); - names_to_file("$tmpdir/mod.$module/removed.$i", $dir, @removed); - write_log("$tmpdir/mod.$module/logfile.$i", @log); - - # Now check to see if we're at the end of our rope - my ($lastdir) = (get_line("$tmpdir/lastdir")); - - debug "Checking $ENV{CVSROOT}/$repdir against lastdir $lastdir\n"; - - # Nope, exit instead of sending a message - exit(0) - if ($lastdir ne "$ENV{CVSROOT}/$repdir"); - - debug "At last, we've reached the end\n"; - - # We have to daemonize and sleep so that there isn't any lock hanging - # around when we get to the cvs rdiff below... - daemonize(); - sleep(10); - - # Send a mail for each module involved - foreach my $mod (@modules[1..$#modules]) { - debug "Sending log message for module $mod\n"; - send_commit($mod, $tmpdir, make_maillist($mailmap, $mod, @mailto)); - } -} - -# and clean up after ourselves -cleanup_dir($tmpdir); \ No newline at end of file Index: CVSROOT/usermap diff -u CVSROOT/usermap:1.2 CVSROOT/usermap:removed --- CVSROOT/usermap:1.2 Tue Jul 15 17:16:07 2003 +++ CVSROOT/usermap Tue Jul 29 12:03:31 2003 @@ -1,6 +0,0 @@ -changelog:'ChangeLog <cha...@us...>' -darthsidious_:'Tim Ireland <dar...@us...>' -denspike:'Jochen Meesters <den...@us...>' -privmath:'Mathieu Rene <pri...@us...>' -r33d:'Reed Loden <r3...@us...>' -ultike:'Matthias Crauwels <ul...@us...>' ----------------------- End of diff ----------------------- |
From: Tim I. <dar...@us...> - 2003-07-29 20:14:41
|
Committer : Tim Ireland <dar...@us...> CVSROOT : /cvsroot/sithnet-dev Module : CVSROOT Commit time: 2003-07-29 18:54:12 UTC Modified files: commitinfo Log message: CVS_ACLs Setup ---------------------- diff included ---------------------- Index: CVSROOT/commitinfo diff -u CVSROOT/commitinfo:1.4 CVSROOT/commitinfo:1.5 --- CVSROOT/commitinfo:1.4 Tue Jul 29 11:46:23 2003 +++ CVSROOT/commitinfo Tue Jul 29 11:54:01 2003 @@ -14,5 +14,5 @@ # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". -DEFAULT $CVSROOT/CVSROOT/cvs_acls +ALL /cvsroot/sitedocs/CVSROOT/cvstools/cvs_acls DEFAULT $CVSROOT/CVSROOT/new_commit_prep ----------------------- End of diff ----------------------- |
From: Tim I. <dar...@us...> - 2003-07-07 23:02:14
|
Committer : 'Tim Ireland <dar...@us...>' CVSROOT : /cvsroot/sithnet-dev Module : ircu2.10 Commit time: 2003-07-07 23:02:11 UTC Log message: Initial (unmodded) Import of Boxen.IRCu.2.10.11.05 Status: Vendor Tag: tireland Release Tags: start N ircu2.10/.cvsignore N ircu2.10/.indent.pro N ircu2.10/acconfig.h N ircu2.10/acinclude.m4 N ircu2.10/aclocal.m4 N ircu2.10/config.guess N ircu2.10/config.h.in N ircu2.10/config.sub N ircu2.10/configure N ircu2.10/configure.in N ircu2.10/INSTALL N ircu2.10/install-sh N ircu2.10/LICENSE N ircu2.10/Makefile.in N ircu2.10/README N ircu2.10/stamp-h.in N ircu2.10/doc/.cvsignore N ircu2.10/doc/Authors N ircu2.10/doc/boxenircu.features N ircu2.10/doc/example.conf N ircu2.10/doc/fda.txt N ircu2.10/doc/freebsd.txt N ircu2.10/doc/iauth.txt N ircu2.10/doc/ircd.8 N ircu2.10/doc/ircd.conf.sample N ircu2.10/doc/ircd.motd N ircu2.10/doc/ircd.opermotd N ircu2.10/doc/ircd.quotes N ircu2.10/doc/ircd.rules N ircu2.10/doc/iso-time.html N ircu2.10/doc/Makefile.in N ircu2.10/doc/p10.html N ircu2.10/doc/readme.asll N ircu2.10/doc/readme.chroot N ircu2.10/doc/readme.crules N ircu2.10/doc/readme.features N ircu2.10/doc/readme.gline N ircu2.10/doc/readme.indent N ircu2.10/doc/readme.jupe N ircu2.10/doc/readme.log N ircu2.10/doc/readme.os N ircu2.10/doc/readme.privs N ircu2.10/doc/readme.who N ircu2.10/doc/rfc1413.txt N ircu2.10/doc/rfc1459.unet N ircu2.10/doc/snomask.html N ircu2.10/doc/strings.txt N ircu2.10/doc/api/api.txt N ircu2.10/doc/api/events.txt N ircu2.10/doc/api/features.txt N ircu2.10/doc/api/gline.txt N ircu2.10/doc/api/ircd_snprintf.txt N ircu2.10/doc/api/joinbuf.txt N ircu2.10/doc/api/jupe.txt N ircu2.10/doc/api/log.txt N ircu2.10/doc/api/modebuf.txt N ircu2.10/doc/api/motd.txt N ircu2.10/doc/api/msgq.txt N ircu2.10/doc/api/privileges.txt N ircu2.10/doc/api/send.txt N ircu2.10/include/channel.h N ircu2.10/include/check.h N ircu2.10/include/class.h N ircu2.10/include/client.h N ircu2.10/include/crule.h N ircu2.10/include/dbuf.h N ircu2.10/include/fda.h N ircu2.10/include/fileio.h N ircu2.10/include/gline.h N ircu2.10/include/handlers.h N ircu2.10/include/hash.h N ircu2.10/include/iauth.h N ircu2.10/include/IPcheck.h N ircu2.10/include/ircd.h N ircu2.10/include/ircd_alloc.h N ircu2.10/include/ircd_chattr.h N ircu2.10/include/ircd_defs.h N ircu2.10/include/ircd_events.h N ircu2.10/include/ircd_features.h N ircu2.10/include/ircd_handler.h N ircu2.10/include/ircd_log.h N ircu2.10/include/ircd_osdep.h N ircu2.10/include/ircd_relay.h N ircu2.10/include/ircd_reply.h N ircu2.10/include/ircd_signal.h N ircu2.10/include/ircd_snprintf.h N ircu2.10/include/ircd_string.h N ircu2.10/include/ircd_xopen.h N ircu2.10/include/jupe.h N ircu2.10/include/list.h N ircu2.10/include/listener.h N ircu2.10/include/match.h N ircu2.10/include/motd.h N ircu2.10/include/msg.h N ircu2.10/include/msgq.h N ircu2.10/include/numeric.h N ircu2.10/include/numnicks.h N ircu2.10/include/opercmds.h N ircu2.10/include/packet.h N ircu2.10/include/parse.h N ircu2.10/include/patchlevel.h N ircu2.10/include/querycmds.h N ircu2.10/include/random.h N ircu2.10/include/res.h N ircu2.10/include/send.h N ircu2.10/include/ssl.h N ircu2.10/include/struct.h N ircu2.10/include/support.h N ircu2.10/include/supported.h N ircu2.10/include/sys.h N ircu2.10/include/s_auth.h N ircu2.10/include/s_bsd.h N ircu2.10/include/s_conf.h N ircu2.10/include/s_debug.h N ircu2.10/include/s_misc.h N ircu2.10/include/s_numeric.h N ircu2.10/include/s_serv.h N ircu2.10/include/s_stats.h N ircu2.10/include/s_user.h N ircu2.10/include/uping.h N ircu2.10/include/userload.h N ircu2.10/include/version.h N ircu2.10/include/whocmds.h N ircu2.10/include/whowas.h N ircu2.10/ircd/.cvsignore N ircu2.10/ircd/channel.c N ircu2.10/ircd/chkconf.c N ircu2.10/ircd/class.c N ircu2.10/ircd/client.c N ircu2.10/ircd/crule.c N ircu2.10/ircd/dbuf.c N ircu2.10/ircd/engine_devpoll.c N ircu2.10/ircd/engine_kqueue.c N ircu2.10/ircd/engine_poll.c N ircu2.10/ircd/engine_select.c N ircu2.10/ircd/fda.c N ircu2.10/ircd/fda_t.c N ircu2.10/ircd/fileio.c N ircu2.10/ircd/gline.c N ircu2.10/ircd/hash.c N ircu2.10/ircd/hosthiding.c N ircu2.10/ircd/iauth.c N ircu2.10/ircd/IPcheck.c N ircu2.10/ircd/ircd.c N ircu2.10/ircd/ircd_alloc.c N ircu2.10/ircd/ircd_events.c N ircu2.10/ircd/ircd_features.c N ircu2.10/ircd/ircd_log.c N ircu2.10/ircd/ircd_relay.c N ircu2.10/ircd/ircd_reply.c N ircu2.10/ircd/ircd_signal.c N ircu2.10/ircd/ircd_snprintf.c N ircu2.10/ircd/ircd_string.c N ircu2.10/ircd/ircd_xopen.c N ircu2.10/ircd/jupe.c N ircu2.10/ircd/list.c N ircu2.10/ircd/listener.c N ircu2.10/ircd/Makefile.in N ircu2.10/ircd/match.c N ircu2.10/ircd/motd.c N ircu2.10/ircd/msgq.c N ircu2.10/ircd/m_account.c N ircu2.10/ircd/m_admin.c N ircu2.10/ircd/m_asll.c N ircu2.10/ircd/m_away.c N ircu2.10/ircd/m_burst.c N ircu2.10/ircd/m_check.c N ircu2.10/ircd/m_clearmode.c N ircu2.10/ircd/m_close.c N ircu2.10/ircd/m_connect.c N ircu2.10/ircd/m_cprivmsg.c N ircu2.10/ircd/m_create.c N ircu2.10/ircd/m_defaults.c N ircu2.10/ircd/m_destruct.c N ircu2.10/ircd/m_desynch.c N ircu2.10/ircd/m_die.c N ircu2.10/ircd/m_endburst.c N ircu2.10/ircd/m_error.c N ircu2.10/ircd/m_get.c N ircu2.10/ircd/m_gline.c N ircu2.10/ircd/m_help.c N ircu2.10/ircd/m_info.c N ircu2.10/ircd/m_invite.c N ircu2.10/ircd/m_ircops.c N ircu2.10/ircd/m_ison.c N ircu2.10/ircd/m_join.c N ircu2.10/ircd/m_jupe.c N ircu2.10/ircd/m_kick.c N ircu2.10/ircd/m_kill.c N ircu2.10/ircd/m_links.c N ircu2.10/ircd/m_list.c N ircu2.10/ircd/m_lusers.c N ircu2.10/ircd/m_map.c N ircu2.10/ircd/m_mkpasswd.c N ircu2.10/ircd/m_mode.c N ircu2.10/ircd/m_motd.c N ircu2.10/ircd/m_names.c N ircu2.10/ircd/m_nick.c N ircu2.10/ircd/m_notice.c N ircu2.10/ircd/m_oper.c N ircu2.10/ircd/m_opermotd.c N ircu2.10/ircd/m_opmode.c N ircu2.10/ircd/m_part.c N ircu2.10/ircd/m_pass.c N ircu2.10/ircd/m_ping.c N ircu2.10/ircd/m_pong.c N ircu2.10/ircd/m_privmsg.c N ircu2.10/ircd/m_privs.c N ircu2.10/ircd/m_privset.c N ircu2.10/ircd/m_proto.c N ircu2.10/ircd/m_pseudo.c N ircu2.10/ircd/m_quit.c N ircu2.10/ircd/m_rahash.c N ircu2.10/ircd/m_rehash.c N ircu2.10/ircd/m_reset.c N ircu2.10/ircd/m_restart.c N ircu2.10/ircd/m_rping.c N ircu2.10/ircd/m_rpong.c N ircu2.10/ircd/m_rules.c N ircu2.10/ircd/m_sahost.c N ircu2.10/ircd/m_saident.c N ircu2.10/ircd/m_sajoin.c N ircu2.10/ircd/m_saname.c N ircu2.10/ircd/m_sanick.c N ircu2.10/ircd/m_sapart.c N ircu2.10/ircd/m_server.c N ircu2.10/ircd/m_set.c N ircu2.10/ircd/m_settime.c N ircu2.10/ircd/m_silence.c N ircu2.10/ircd/m_squit.c N ircu2.10/ircd/m_stats.c N ircu2.10/ircd/m_svsnoop.c N ircu2.10/ircd/m_time.c N ircu2.10/ircd/m_tmpl.c N ircu2.10/ircd/m_topic.c N ircu2.10/ircd/m_trace.c N ircu2.10/ircd/m_uping.c N ircu2.10/ircd/m_user.c N ircu2.10/ircd/m_userhost.c N ircu2.10/ircd/m_userip.c N ircu2.10/ircd/m_vctrl.c N ircu2.10/ircd/m_version.c N ircu2.10/ircd/m_vhost.c N ircu2.10/ircd/m_wallchops.c N ircu2.10/ircd/m_wallops.c N ircu2.10/ircd/m_wallusers.c N ircu2.10/ircd/m_wallvoices.c N ircu2.10/ircd/m_who.c N ircu2.10/ircd/m_whois.c N ircu2.10/ircd/m_whowas.c N ircu2.10/ircd/numnicks.c N ircu2.10/ircd/opercmds.c N ircu2.10/ircd/os_bsd.c N ircu2.10/ircd/os_generic.c N ircu2.10/ircd/os_linux.c N ircu2.10/ircd/os_openbsd.c N ircu2.10/ircd/os_solaris.c N ircu2.10/ircd/packet.c N ircu2.10/ircd/parse.c N ircu2.10/ircd/querycmds.c N ircu2.10/ircd/random.c N ircu2.10/ircd/res.c N ircu2.10/ircd/send.c N ircu2.10/ircd/ssl.c N ircu2.10/ircd/support.c N ircu2.10/ircd/s_auth.c N ircu2.10/ircd/s_bsd.c N ircu2.10/ircd/s_conf.c N ircu2.10/ircd/s_debug.c N ircu2.10/ircd/s_err.c N ircu2.10/ircd/s_misc.c N ircu2.10/ircd/s_numeric.c N ircu2.10/ircd/s_serv.c N ircu2.10/ircd/s_stats.c N ircu2.10/ircd/s_user.c N ircu2.10/ircd/table_gen.c N ircu2.10/ircd/uping.c N ircu2.10/ircd/userload.c N ircu2.10/ircd/version.c.SH N ircu2.10/ircd/whocmds.c N ircu2.10/ircd/whowas.c N ircu2.10/ircd/test/ircd_chattr.0.dat N ircu2.10/ircd/test/ircd_chattr_t.c N ircu2.10/ircd/test/ircd_string_t.c N ircu2.10/ircd/test/Makefile N ircu2.10/tools/autodoc.py N ircu2.10/tools/crypter N ircu2.10/tools/hashtoy N ircu2.10/tools/Makefile.crypt N ircu2.10/tools/mkchroot N ircu2.10/tools/mkpasswd.c N ircu2.10/tools/README N ircu2.10/tools/ringlog.c N ircu2.10/tools/ringlog.pl N ircu2.10/tools/sums N ircu2.10/tools/transition N ircu2.10/tools/untabify N ircu2.10/tools/wrapper.c N ircu2.10/tools/Bounce/bounce.conf N ircu2.10/tools/Bounce/Bounce.cpp N ircu2.10/tools/Bounce/Bounce.h N ircu2.10/tools/Bounce/build N ircu2.10/tools/linesync/linesync.conf N ircu2.10/tools/linesync/linesync.sh N ircu2.10/tools/makepem/makepem N ircu2.10/tools/zbounce/aclocal.m4 N ircu2.10/tools/zbounce/Bounce.cpp N ircu2.10/tools/zbounce/Bounce.h N ircu2.10/tools/zbounce/ChangeLog N ircu2.10/tools/zbounce/config.guess N ircu2.10/tools/zbounce/config.h N ircu2.10/tools/zbounce/config.sub N ircu2.10/tools/zbounce/configure N ircu2.10/tools/zbounce/configure.in N ircu2.10/tools/zbounce/Connection.cpp N ircu2.10/tools/zbounce/Connection.h N ircu2.10/tools/zbounce/defs.h.in N ircu2.10/tools/zbounce/install-sh N ircu2.10/tools/zbounce/LICENSE N ircu2.10/tools/zbounce/Listener.cpp N ircu2.10/tools/zbounce/Listener.h N ircu2.10/tools/zbounce/main.cpp N ircu2.10/tools/zbounce/main.h N ircu2.10/tools/zbounce/Makefile.am N ircu2.10/tools/zbounce/Makefile.in N ircu2.10/tools/zbounce/missing N ircu2.10/tools/zbounce/mkinstalldirs N ircu2.10/tools/zbounce/README N ircu2.10/tools/zbounce/Socket.cpp N ircu2.10/tools/zbounce/Socket.h N ircu2.10/tools/zbounce/stamp-h.in N ircu2.10/tools/zbounce/StringTokenizer.cpp N ircu2.10/tools/zbounce/StringTokenizer.h N ircu2.10/tools/zbounce/zbounce.conf No conflicts created by this import |
From: <dar...@us...> - 2003-06-30 20:59:30
|
Update of /cvsroot/sithnet-dev/gnuworld/mod.cservice In directory sc8-pr-cvs1:/tmp/cvs-serv6905 Added Files: VERIFYCommand.cc Log Message: Update VERIFYCommand |
From: <dar...@us...> - 2003-06-30 20:41:09
|
Update of /cvsroot/sithnet-dev/gnuworld/mod.cservice In directory sc8-pr-cvs1:/tmp/cvs-serv3567 Removed Files: VERIFYCommand.cc Log Message: . --- VERIFYCommand.cc DELETED --- |
From: <dar...@us...> - 2003-06-30 20:31:46
|
Update of /cvsroot/sithnet-dev/gnuworld/src In directory sc8-pr-cvs1:/tmp/cvs-serv1697 Modified Files: client.cc Log Message: mode updates Index: client.cc =================================================================== RCS file: /cvsroot/sithnet-dev/gnuworld/src/client.cc,v retrieving revision 1.1.1.3 retrieving revision 1.2 diff -C2 -d -r1.1.1.3 -r1.2 *** client.cc 28 Jun 2003 23:14:30 -0000 1.1.1.3 --- client.cc 30 Jun 2003 20:31:42 -0000 1.2 *************** *** 162,166 **** if( mode & iClient::MODE_WALLOPS ) Mode += 'w' ; if( mode & iClient::MODE_INVISIBLE ) Mode += 'i' ; ! return Mode ; } --- 162,167 ---- if( mode & iClient::MODE_WALLOPS ) Mode += 'w' ; if( mode & iClient::MODE_INVISIBLE ) Mode += 'i' ; ! if( mode & iClient::MODE_ADMIN ) Mode += 'A' ; ! if( mode & iClient::MODE_XTRAOP ) Mode += 'X' ; return Mode ; } *************** *** 194,198 **** case 'w': mode |= iClient::MODE_WALLOPS ; break; case 'i': mode |= iClient::MODE_INVISIBLE ; break; ! default: elog << "xClient::Mode> Unknown mode: " --- 195,200 ---- case 'w': mode |= iClient::MODE_WALLOPS ; break; case 'i': mode |= iClient::MODE_INVISIBLE ; break; ! case 'X': mode |= iClient::MODE_XTRAOP ; break; ! case 'A': mode |= iClient::MODE_ADMIN ; break; default: elog << "xClient::Mode> Unknown mode: " |
From: <dar...@us...> - 2003-06-30 20:22:03
|
Update of /cvsroot/sithnet-dev/gnuworld/libircu In directory sc8-pr-cvs1:/tmp/cvs-serv32530 Modified Files: msg_M.cc Log Message: clearmode updates Index: msg_M.cc =================================================================== RCS file: /cvsroot/sithnet-dev/gnuworld/libircu/msg_M.cc,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -C2 -d -r1.1.1.2 -r1.2 *** msg_M.cc 28 Jun 2003 23:12:27 -0000 1.1.1.2 --- msg_M.cc 30 Jun 2003 20:21:58 -0000 1.2 *************** *** 186,189 **** --- 186,209 ---- polarity, theUser ) ; break ; + case 'c': + theServer->OnChannelModeC( theChan, + polarity, theUser ) ; + break ; + case 'C': + theServer->OnChannelModec( theChan, + polarity, theUser ) ; + break ; + case 'D': + theServer->OnChannelModed( theChan, + polarity, theUser ) ; + break ; + case 'u': + theServer->OnChannelModeU( theChan, + polarity, theUser ) ; + break ; + case 'O': + theServer->OnChannelModeo( theChan, + polarity, theUser ) ; + break ; // Channel mode l only has an argument if *************** *** 426,429 **** --- 446,470 ---- else theClient->removeModeG() ; break ; + case 'X': + if( plus ) theClient->setModex() ; + else theClient->removeModex() ; + break ; + case 'I': + if( plus ) theClient->setModei() ; + else theClient->removeModei() ; + break ; + case 'R': + if( plus ) theClient->setModeR() ; + else theClient->removeModeR() ; + break ; + case 'n': + if( plus ) theClient->setModeN() ; + else theClient->removeModeN() ; + break ; + case 'H': + if( plus ) theClient->setModeH() ; + else theClient->removeModeH() ; + break ; + case 'o': if( plus ) |
From: <dar...@us...> - 2003-06-30 20:21:09
|
Update of /cvsroot/sithnet-dev/gnuworld/include In directory sc8-pr-cvs1:/tmp/cvs-serv32423 Modified Files: server.h Channel.h client.h Log Message: clearmode updates Index: server.h =================================================================== RCS file: /cvsroot/sithnet-dev/gnuworld/include/server.h,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -C2 -d -r1.1.1.2 -r1.2 *** server.h 28 Jun 2003 23:12:14 -0000 1.1.1.2 --- server.h 30 Jun 2003 20:21:06 -0000 1.2 *************** *** 892,895 **** --- 892,935 ---- /** + * This method is called when a channel mode 'c' change is + * detected. + * Keep in mind that the source ChannelUser may be NULL + * if the mode is being set/unset by a server. + */ + virtual void OnChannelModeC( Channel*, bool, ChannelUser* ) ; + + /** + * This method is called when a channel mode 'C' change is + * detected. + * Keep in mind that the source ChannelUser may be NULL + * if the mode is being set/unset by a server. + */ + virtual void OnChannelModec( Channel*, bool, ChannelUser* ) ; + + /** + * This method is called when a channel mode 'D' change is + * detected. + * Keep in mind that the source ChannelUser may be NULL + * if the mode is being set/unset by a server. + */ + virtual void OnChannelModed( Channel*, bool, ChannelUser* ) ; + + /** + * This method is called when a channel mode 'u' change is + * detected. + * Keep in mind that the source ChannelUser may be NULL + * if the mode is being set/unset by a server. + */ + virtual void OnChannelModeU( Channel*, bool, ChannelUser* ) ; + + /** + * This method is called when a channel mode 'O' change is + * detected. + * Keep in mind that the source ChannelUser may be NULL + * if the mode is being set/unset by a server. + */ + virtual void OnChannelModeo( Channel*, bool, ChannelUser* ) ; + + /** * This method is called when a channel mode 'l' change is * detected. Index: Channel.h =================================================================== RCS file: /cvsroot/sithnet-dev/gnuworld/include/Channel.h,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -C2 -d -r1.1.1.2 -r1.2 *** Channel.h 28 Jun 2003 23:12:09 -0000 1.1.1.2 --- Channel.h 30 Jun 2003 20:21:06 -0000 1.2 *************** *** 108,111 **** --- 108,126 ---- static const modeType MODE_R ; + /// Bit representing channel mode +c + static const modeType MODE_C ; + + /// Bit representing channel mode +C + static const modeType MODE_c ; + + /// Bit representing channel mode +D + static const modeType MODE_d ; + + /// Bit representing channel mode +u + static const modeType MODE_U ; + + /// Bit representing channel mode +O + static const modeType MODE_o ; + /// Type used to store number of clients in channel typedef userListType::size_type size_type ; *************** *** 489,492 **** --- 504,538 ---- virtual void onModeK( bool, const string& ) ; + + /** + * This method is called when channel mode 'c' is set + * or unset. + */ + virtual void onModeC( bool ) ; + + /** + * This method is called when channel mode 'C' is set + * or unset. + */ + virtual void onModec( bool ) ; + + /** + * This method is called when channel mode 'D' is set + * or unset. + */ + virtual void onModed( bool ) ; + + /** + * This method is called when channel mode 'u' is set + * or unset. + */ + virtual void onModeU( bool ) ; + + /** + * This method is called when channel mode 'O' is set + * or unset. + */ + virtual void onModeo( bool ) ; + /** * This method is called when one or more channel Index: client.h =================================================================== RCS file: /cvsroot/sithnet-dev/gnuworld/include/client.h,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -C2 -d -r1.1.1.2 -r1.2 *** client.h 28 Jun 2003 23:12:10 -0000 1.1.1.2 --- client.h 30 Jun 2003 20:21:06 -0000 1.2 *************** *** 308,311 **** --- 308,350 ---- ChannelUser*, const string& ) ; + virtual void OnChannelModeC( Channel*, bool polarity, + ChannelUser* ) ; + /** + * This method is invoked when a user sets or removes + * channel mode C (noctcp). Keep in mind that the + * source ChannelUser may be NULL if a server is + * setting the mode. + */ + virtual void OnChannelModec( Channel*, bool polarity, + ChannelUser* ) ; + + /** + * This method is invoked when a user sets or removes + * channel mode D (delayed joins). Keep in mind that the + * source ChannelUser may be NULL if a server is + * setting the mode. + */ + virtual void OnChannelModed( Channel*, bool polarity, + ChannelUser* ) ; + + /** + * This method is invoked when a user sets or removes + * channel mode u (noquitparts). Keep in mind that the + * source ChannelUser may be NULL if a server is + * setting the mode. + */ + virtual void OnChannelModeU( Channel*, bool polarity, + ChannelUser* ) ; + + /** + * This method is invoked when a user sets or removes + * channel mode O (operonly). Keep in mind that the + * source ChannelUser may be NULL if a server is + * setting the mode. + */ + virtual void OnChannelModeo( Channel*, bool polarity, + ChannelUser* ) ; + + /** * This method is invoked when a user sets or removes |
From: <dar...@us...> - 2003-06-30 20:06:12
|
Update of /cvsroot/sithnet-dev/gnuworld/mod.cservice In directory sc8-pr-cvs1:/tmp/cvs-serv30171 Modified Files: Makefile.am cserviceCommands.h Log Message: final patchinf for adduserid command Index: Makefile.am =================================================================== RCS file: /cvsroot/sithnet-dev/gnuworld/mod.cservice/Makefile.am,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -C2 -d -r1.1.1.2 -r1.2 *** Makefile.am 28 Jun 2003 23:13:57 -0000 1.1.1.2 --- Makefile.am 30 Jun 2003 20:06:09 -0000 1.2 *************** *** 66,70 **** UNSUSPENDCommand.cc \ VERIFYCommand.cc \ ! VOICECommand.cc INCLUDES = -I@PGSQL_INCLUDE@ $(INCLTDL) --- 66,71 ---- UNSUSPENDCommand.cc \ VERIFYCommand.cc \ ! VOICECommand.cc \ ! ADDUSERIDCommand.cc INCLUDES = -I@PGSQL_INCLUDE@ $(INCLTDL) Index: cserviceCommands.h =================================================================== RCS file: /cvsroot/sithnet-dev/gnuworld/mod.cservice/cserviceCommands.h,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -C2 -d -r1.1.1.2 -r1.2 *** cserviceCommands.h 28 Jun 2003 23:13:55 -0000 1.1.1.2 --- cserviceCommands.h 30 Jun 2003 20:06:09 -0000 1.2 *************** *** 130,133 **** --- 130,134 ---- DECLARE_COMMAND( STATS ) DECLARE_COMMAND( ADDCOMMENT ) + DECLARE_COMMAND( ADDUSERID ) DECLARE_COMMAND( SHUTDOWN ) |
From: <dar...@us...> - 2003-06-30 20:05:09
|
Update of /cvsroot/sithnet-dev/gnuworld/mod.cservice In directory sc8-pr-cvs1:/tmp/cvs-serv29903 Modified Files: cservice.cc Log Message: Index: cservice.cc =================================================================== RCS file: /cvsroot/sithnet-dev/gnuworld/mod.cservice/cservice.cc,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -C2 -d -r1.1.1.2 -r1.2 *** cservice.cc 28 Jun 2003 23:13:55 -0000 1.1.1.2 --- cservice.cc 30 Jun 2003 20:05:07 -0000 1.2 *************** *** 208,211 **** --- 208,212 ---- RegisterCommand(new SERVNOTICECommand(this, "SERVNOTICE", "<#channel> <text>", 5)); RegisterCommand(new SAYCommand(this, "SAY", "<#channel> <text>", 5)); + RegisterCommand(new ADDUSERIDCommand(this, "ADDUSERID", "<userid> <password> <email>", 5)); RegisterCommand(new QUOTECommand(this, "QUOTE", "<text>", 5)); RegisterCommand(new REHASHCommand(this, "REHASH", "[translations | help]]", 5)); |
From: <dar...@us...> - 2003-06-30 20:04:42
|
Update of /cvsroot/sithnet-dev/gnuworld/mod.cservice In directory sc8-pr-cvs1:/tmp/cvs-serv29825 Modified Files: levels.h Log Message: Index: levels.h =================================================================== RCS file: /cvsroot/sithnet-dev/gnuworld/mod.cservice/levels.h,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -C2 -d -r1.1.1.2 -r1.2 *** levels.h 28 Jun 2003 23:13:57 -0000 1.1.1.2 --- levels.h 30 Jun 2003 20:04:40 -0000 1.2 *************** *** 39,43 **** const int deop = 100; const int op = 100; ! const int invite = 100; const int suspend = 100; const int unsuspend = 100; --- 39,43 ---- const int deop = 100; const int op = 100; ! const int invite = 24; const int suspend = 100; const int unsuspend = 100; *************** *** 52,56 **** const int join = 450; ! const int part = 500; const int setcmd = 450; --- 52,56 ---- const int join = 450; ! const int part = 450; const int setcmd = 450; *************** *** 71,74 **** --- 71,75 ---- const int servnotice = 800; const int say = 800; + const int adduserid = 800; // Debug Commands *************** *** 113,120 **** namespace admin { ! const int base = 1; ! const int helper = 500; ! const int admin = 949; ! const int coder = 1000; } --- 114,127 ---- namespace admin { ! const int helper = 1; ! const int tadmin = 300; ! const int jadmin = 500; ! const int sadmin = 750; ! const int supervisor = 775; ! const int abuse = 800; ! const int comgr = 850; ! const int mgr = 900; ! const int coder = 950; ! const int director = 1000; } |
From: <dar...@us...> - 2003-06-30 19:48:59
|
Update of /cvsroot/sithnet-dev/gnuworld/mod.cservice In directory sc8-pr-cvs1:/tmp/cvs-serv26788 Added Files: ADDUSERIDCommand.cc Log Message: Addition of OUTsider's ADDUSERIDCommand.cc to the repository --- NEW FILE: ADDUSERIDCommand.cc --- /* ADDUSERIDCommand.cc * Adds a user to the database, usefull should pages not be available or obsolete */ #include <string> #include <iomanip.h> #include "md5hash.h" #include "StringTokenizer.h" #include "ELog.h" #include "cservice.h" #include "responses.h" #include "networkData.h" #include "levels.h" #include "libpq++.h" #include "responses.h" #include "Network.h" const char ADDUSERIDCommand_cc_rcsId[] = "$Id: ADDUSERIDCommand.cc,v 1.1 2003/06/30 19:48:56 darthsidious_ Exp $" ; namespace gnuworld { using namespace gnuworld; bool ADDUSERIDCommand::Exec( iClient* theClient, const string& Message ) { const char validChars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.$*_"; StringTokenizer st( Message ) ; if( st.size() < 4 ) { Usage(theClient); return true; } /* * Fetch the sqlUser record attached to this client. If there isn't one, * they aren't logged in - tell them they should be. */ sqlUser* theUser = bot->isAuthed(theClient, true); if (!theUser) return false; /* * Check Command access */ int level = bot->getAdminAccessLevel(theUser); if (level < level::adduserid) { bot->Notice(theClient, bot->getResponse(theUser, language::insuf_access, string("You have insufficient access to perform that command."))); return false; } /* * User exists?! Bail out, we don't want clones! */ sqlUser* Target = bot->getUserRecord(st[1]); if(Target) { bot->Notice(theClient, "Sorry, %s is already present in the database" ,st[1].c_str()); return false; } /* Try and stop people using an invalid syntax.. */ if (string_lower(st[1]) == string_lower(st[2]) ) { bot->Notice(theClient, "The passphrase cannot be the same as the username"); return false; } /* Work out some salt. */ string salt; // TODO: Why calling srand() here? srand(clock() * 1000000); // TODO: What is the significance of '8' here? // Schema states a fixed 8 bytes of random salt are used in generating the // password. for ( unsigned short int i = 0 ; i < 8; i++) { int randNo = 1+(int) (64.0*rand()/(RAND_MAX+1.0)); salt += validChars[randNo]; } /* Work out a MD5 hash of our salt + password */ md5 hash; // MD5 hash algorithm object. md5Digest digest; // MD5Digest algorithm object. // Prepend the salt to the password string newPass = salt + st[2]; // Take the md5 hash of this newPass string hash.update( (const unsigned char *)newPass.c_str(), newPass.size() ); hash.report( digest ); /* Convert to Hex */ int data[ MD5_DIGEST_LENGTH ] = { 0 } ; for( size_t i = 0 ; i < MD5_DIGEST_LENGTH ; ++i ) { data[ i ] = digest[ i ] ; } strstream output; output << hex; output.fill('0'); for( size_t ii = 0; ii < MD5_DIGEST_LENGTH; ii++ ) { output << setw(2) << data[ii]; } output << ends; // Prepend the md5 hash to the salt string finalPassword = salt + output.str(); /* * Check if the email is a correct one */ StringTokenizer st2( st[ 3 ], '@' ) ; if( (st2.size() != 2) || (st2[ 1 ].size() > 128 ) ) { bot->Notice(theClient, "Sorry, this email address is not valid."); return false ; } /* * Finally done, let's rock and roll.... */ strstream theQuery ; theQuery << "INSERT INTO users (user_name, password, email, language_id, last_updated_by, last_updated ) " << "VALUES (" << "'" << st[1] << "'," << "'" << finalPassword.c_str() << "'," << "'" << st[3] << "',1," << "'(" << theUser->getUserName() << ") " << theClient->getNickUserHost() << "'," << bot->currentTime() << ");" << ends; #ifdef LOG_SQL elog << "ADDUSERID::sqlQuery> " << theQuery.str() << endl; #endif ExecStatusType status = bot->SQLDb->Exec(theQuery.str()) ; delete[] theQuery.str() ; if( PGRES_COMMAND_OK != status ) { bot->dbErrorMessage(theClient); return false ; } bot->Notice(theClient, "%s has been added to the database with email address %s and password %s" ,st[1].c_str(), st[3].c_str(), st[2].c_str()); delete[] output.str() ; return true; } } // namespace gnuworld |
From: <dar...@us...> - 2003-06-30 19:42:40
|
Update of /cvsroot/sithnet-dev/gnuworld/mod.cservice In directory sc8-pr-cvs1:/tmp/cvs-serv25449 Modified Files: responses.h Log Message: VERIFYCommand + responses.h updates:\n VERIFICATION Replies changes to sithnet relevant replies. more work to come on these. Index: responses.h =================================================================== RCS file: /cvsroot/sithnet-dev/gnuworld/mod.cservice/responses.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** responses.h 30 Jun 2003 19:15:45 -0000 1.2 --- responses.h 30 Jun 2003 19:42:35 -0000 1.3 *************** *** 193,201 **** const int is_cservice_jadmin = 202; const int is_cservice_sadmin = 203; ! const int is_cservice_sup = 204; ! const int is_cservice_ab = 205; const int is_cservice_comgr = 206; const int is_cservice_mgr = 207; ! const int is_cservice_dir = 208; // Coder Response Languages const int is_coder_rep = 209; --- 193,201 ---- const int is_cservice_jadmin = 202; const int is_cservice_sadmin = 203; ! const int is_cservice_supervisor = 204; ! const int is_cservice_abuse = 205; const int is_cservice_comgr = 206; const int is_cservice_mgr = 207; ! const int is_director = 208; // Coder Response Languages const int is_coder_rep = 209; |
From: <dar...@us...> - 2003-06-30 19:15:49
|
Update of /cvsroot/sithnet-dev/gnuworld/mod.cservice In directory sc8-pr-cvs1:/tmp/cvs-serv21117 Modified Files: responses.h Log Message: modifications to responses header file \nnext commit will be for verification stuff \o/ Index: responses.h =================================================================== RCS file: /cvsroot/sithnet-dev/gnuworld/mod.cservice/responses.h,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -C2 -d -r1.1.1.2 -r1.2 *** responses.h 28 Jun 2003 23:14:01 -0000 1.1.1.2 --- responses.h 30 Jun 2003 19:15:45 -0000 1.2 *************** *** 171,177 **** const int is_not_logged_in = 148; const int logged_in_as = 149; - const int is_cservice_rep = 150; - const int is_cservice_admin = 151; - const int is_cservice_dev = 152; const int exc_search = 153; const int restrict_search = 154; --- 171,174 ---- *************** *** 181,188 **** const int invalid_option = 158; const int is_service_bot = 159; - const int is_coder_rep = 160; - const int is_coder_contrib = 161; - const int is_coder_devel = 162; - const int is_coder_senior = 163; const int is_also_an_ircop = 164; const int ban_added = 165; --- 178,181 ---- *************** *** 194,197 **** --- 187,217 ---- const int im_not_opped = 171; const int keywords = 172; + const int noforce_set = 176; + // CService Response Languages + const int is_cservice_rep = 200; + const int is_cservice_tadmin = 201; + const int is_cservice_jadmin = 202; + const int is_cservice_sadmin = 203; + const int is_cservice_sup = 204; + const int is_cservice_ab = 205; + const int is_cservice_comgr = 206; + const int is_cservice_mgr = 207; + const int is_cservice_dir = 208; + // Coder Response Languages + const int is_coder_rep = 209; + const int is_coder_contrib = 210; + const int is_coder_devel = 211; + const int is_coder_senior = 212; + // Scripting Response Languages + const int is_script_rep = 213; + const int is_script_helpmgr = 214; + const int is_script_j = 215; + const int is_script_s = 216; + const int is_script_rec = 217; + const int is_script_ab = 218; + const int is_script_cmgr = 219; + const int is_script_mgr = 220; + // Official Response Languages + // Not Yet Implemented const int greeting = 9998; const int motd = 9999; |
From: tim i. <dar...@ho...> - 2003-06-28 23:15:54
|
test ------------------------------------------------------- - Darth ExclusionZone IRC Operator & CService Trainee Admin. MTMUK Moderator _________________________________________________________________ Find a cheaper internet access deal - choose one to suit you. http://www.msn.co.uk/internetaccess |