diff options
| author | fukachan <fukachan> | 2003-05-12 10:16:38 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-05-12 10:16:38 +0000 |
| commit | f914afdbe83507cccca18b7953c3992aa18abc6e (patch) | |
| tree | 180a0aded945a705945a8a474e8c377f35c2ffb4 | |
| parent | b8e34c6b65bd5e1b5838204265e35845306a6f19 (diff) | |
| download | fml8-f914afdbe83507cccca18b7953c3992aa18abc6e.tar.gz fml8-f914afdbe83507cccca18b7953c3992aa18abc6e.tar.bz2 fml8-f914afdbe83507cccca18b7953c3992aa18abc6e.zip | |
we should operate only $primary_*_map not $*_maps in deleting the user
address.
| -rw-r--r-- | fml/doc/ja/tutorial/book.sgml | 5 | ||||
| -rw-r--r-- | fml/doc/ja/tutorial/include/chapters.ent | 3 | ||||
| -rw-r--r-- | fml/doc/ja/tutorial/internals/userctl.sgml | 60 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/chaddr.pm | 26 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/changepassword.pm | 20 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/deladmin.pm | 32 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/delmoderator.pm | 32 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/digest.pm | 33 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/off.pm | 18 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/on.pm | 4 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/unsubscribe.pm | 24 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Auth.pm | 42 |
12 files changed, 165 insertions, 134 deletions
diff --git a/fml/doc/ja/tutorial/book.sgml b/fml/doc/ja/tutorial/book.sgml index 67be8270..04740281 100644 --- a/fml/doc/ja/tutorial/book.sgml +++ b/fml/doc/ja/tutorial/book.sgml @@ -2,7 +2,7 @@ This is an sgml using DocBook dtd. Use sgmltools version 2.0.x or above to generate various output formats. -$FML: book.sgml,v 1.54 2003/04/12 15:20:01 fukachan Exp $ +$FML: book.sgml,v 1.55 2003/04/13 03:29:01 fukachan Exp $ --> <!doctype book public "-//FML//DTD DocBook V3.1-Based Extension//EN" [ @@ -141,6 +141,9 @@ $FML: book.sgml,v 1.54 2003/04/12 15:20:01 fukachan Exp $ &chapter.filter; <!-- &chapter.replybyfml; --> + <!-- ユーザ制御について --> + &chapter.userctl; + <!-- コマンド --> &chapter.command; diff --git a/fml/doc/ja/tutorial/include/chapters.ent b/fml/doc/ja/tutorial/include/chapters.ent index 57c3347c..9800936a 100644 --- a/fml/doc/ja/tutorial/include/chapters.ent +++ b/fml/doc/ja/tutorial/include/chapters.ent @@ -1,5 +1,5 @@ <!-- - $FML: chapters.ent,v 1.69 2003/04/13 03:29:02 fukachan Exp $ + $FML: chapters.ent,v 1.70 2003/04/13 04:36:11 fukachan Exp $ --> <!entity versin "1.1"> @@ -114,6 +114,7 @@ <!entity chapter.filename SYSTEM "internals/filename.sgml"> <!entity chapter.filter SYSTEM "internals/filter.sgml"> +<!entity chapter.userctl SYSTEM "internals/userctl.sgml"> <!-- 配送 --> diff --git a/fml/doc/ja/tutorial/internals/userctl.sgml b/fml/doc/ja/tutorial/internals/userctl.sgml new file mode 100644 index 00000000..0d920c32 --- /dev/null +++ b/fml/doc/ja/tutorial/internals/userctl.sgml @@ -0,0 +1,60 @@ +<!-- + $FML: db.sgml,v 1.7 2003/04/15 14:51:40 fukachan Exp $ +--> + +<chapter id="userctl"> + <title> + ユーザの制御 + </title> + + +<sect1 id="userctl.deladd"> + <title> + ユーザの追加と削除は何に対して行なうか? + </title> + +<para> +追加は primary_*_map に対しておこなう。 +削除も primary_*_map に対しておこなう。 +</para> + +<para> +たとえば、リモート管理者は +primary_admin_member_map と primary_admin_recipient_map の両方に +アドレスを追加する。 +削除の際は、 +primary_admin_member_map と primary_admin_recipient_map から +アドレスを削除する。 +</para> + +<para> +これを admin_member_maps と admin_recipient_maps にすると問題だ。 +</para> + +<para> +追加は、明らかに複数の map に追加してしまうので、一つに限定するべきだ。 +だから、primary_*_map 一つに対して行なう。 +メンバーは primary_xxx_member_map ひとつに、 +受信者は primary_xxx_recipient_map 一つに対して行なう。 +</para> + +<para> +削除だが、一見 *_maps でもよいような気がするが、 +実は駄目だ。消し過ぎになってしまうことがある。 +特に問題になるのは、権限の異なる map が混在している場合である。 +</para> + +<para> +たとえば、 +member_maps はデフォルトで、リモート管理者を含んでいる。 +<screen> +member_maps = $primary_member_map + $admin_member_maps +</screen> +そのため、member_maps に対して削除を試みると、 +勢いあまってリモート管理者の分も削除してしまうことになる +</para> + +</sect1> + +</chapter> diff --git a/fml/lib/FML/Command/Admin/chaddr.pm b/fml/lib/FML/Command/Admin/chaddr.pm index 2d5bbe06..42eb8fa5 100644 --- a/fml/lib/FML/Command/Admin/chaddr.pm +++ b/fml/lib/FML/Command/Admin/chaddr.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: chaddr.pm,v 1.14 2003/03/17 13:22:24 fukachan Exp $ +# $FML: chaddr.pm,v 1.15 2003/03/18 10:42:42 fukachan Exp $ # package FML::Command::Admin::chaddr; @@ -69,12 +69,12 @@ sub lock_channel { return 'command_serialize';} sub process { my ($self, $curproc, $command_args) = @_; - my $config = $curproc->{ config }; - my $member_maps = $config->get_as_array_ref( 'member_maps' ); - my $recipient_maps = $config->get_as_array_ref( 'recipient_maps' ); - my $options = $command_args->{ options }; - my $old_address = ''; - my $new_address = ''; + my $config = $curproc->{ config }; + my $member_map = $config->{ 'primary_member_map' }; + my $recipient_map = $config->{ 'primary_recipient_map' }; + my $options = $command_args->{ options }; + my $old_address = ''; + my $new_address = ''; if (defined $command_args->{ command_data }) { my $x = $command_args->{ command_data }; @@ -91,15 +91,11 @@ sub process unless ($old_address && $new_address) { croak("chaddr: invalid arguments"); } - croak("\$member_maps is not specified") unless $member_maps; - croak("\$recipient_maps is not specified") unless $recipient_maps; + croak("\$member_map not specified") unless $member_map; + croak("\$recipient_map not specified") unless $recipient_map; - # change all maps including this $address. - my (@maps) = (); - push(@maps, @$member_maps); - push(@maps, @$recipient_maps); - - # FML::Command::UserControl specific parameters + # uc_args = FML::Command::UserControl specific parameters + my (@maps) = ($member_map, $recipient_map); my $uc_args = { old_address => $old_address, new_address => $new_address, diff --git a/fml/lib/FML/Command/Admin/changepassword.pm b/fml/lib/FML/Command/Admin/changepassword.pm index a057bb61..5b900538 100644 --- a/fml/lib/FML/Command/Admin/changepassword.pm +++ b/fml/lib/FML/Command/Admin/changepassword.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: changepassword.pm,v 1.3 2003/03/17 13:23:22 fukachan Exp $ +# $FML: changepassword.pm,v 1.4 2003/03/18 10:42:42 fukachan Exp $ # package FML::Command::Admin::changepassword; @@ -67,11 +67,9 @@ sub lock_channel { return 'command_serialize';} sub process { my ($self, $curproc, $command_args) = @_; - my $config = $curproc->config(); - my $maps = $config->get_as_array_ref('admin_member_password_maps'); - my $pri_map = $config->{ primary_admin_member_password_map }; - my $myname = $curproc->myname(); - my $options = $command_args->{ options }; + my $config = $curproc->config(); + my $myname = $curproc->myname(); + my $options = $command_args->{ options }; # XXX The arguments differ for the cases. # 1. command mail: admin changepassword [$USER] $PASSWORD @@ -121,20 +119,18 @@ sub _change_password { my ($self, $curproc, $command_args, $address, $password) = @_; my $config = $curproc->config(); - my $maps = $config->get_as_array_ref('admin_member_password_maps'); my $pri_map = $config->{ primary_admin_member_password_map }; my $up_args = { - primary_map => $pri_map, - maplist => $maps, - address => $address, - password => $password, + map => $pri_map, + address => $address, + password => $password, }; my $r = ''; eval q{ use FML::Command::Auth; my $passwd = new FML::Command::Auth; - $passwd->change($curproc, $command_args, $up_args); + $passwd->change_password($curproc, $command_args, $up_args); }; if ($r = $@) { croak($r); diff --git a/fml/lib/FML/Command/Admin/deladmin.pm b/fml/lib/FML/Command/Admin/deladmin.pm index 00e36204..f8922e7e 100644 --- a/fml/lib/FML/Command/Admin/deladmin.pm +++ b/fml/lib/FML/Command/Admin/deladmin.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: deladmin.pm,v 1.8 2003/01/27 04:36:29 fukachan Exp $ +# $FML: deladmin.pm,v 1.9 2003/03/18 10:42:42 fukachan Exp $ # package FML::Command::Admin::deladmin; @@ -69,25 +69,21 @@ sub process my $config = $curproc->config(); # target maps - my $member_maps = $config->get_as_array_ref('admin_member_maps'); - my $recipient_maps = $config->get_as_array_ref('admin_recipient_maps'); - my $options = $command_args->{ options }; - my $address = $command_args->{ command_data } || $options->[ 0 ]; + my $member_map = $config->{ 'primary_admin_member_map' }; + my $recipient_map = $config->{ 'primary_admin_recipient_map' }; + my $options = $command_args->{ options }; + my $address = $command_args->{ command_data } || $options->[ 0 ]; # fundamental check - croak("address not undefined") unless defined $address; - croak("address not specified") unless $address; - croak("member_maps not undefined") unless defined $member_maps; - croak("member_maps not specified") unless $member_maps; - croak("recipient_maps not undefined") unless defined $recipient_maps; - croak("recipient_maps not specified") unless $recipient_maps; - - # maplist - my $maplist = []; - push(@$maplist, @$member_maps) if @$member_maps; - push(@$maplist, @$recipient_maps) if @$recipient_maps; - - # FML::Command::UserControl specific parameters + croak("address not undefined") unless defined $address; + croak("address not specified") unless $address; + croak("member_map not undefined") unless defined $member_map; + croak("member_map not specified") unless $member_map; + croak("recipient_map not undefined") unless defined $recipient_map; + croak("recipient_map not specified") unless $recipient_map; + + # $uc_args = FML::Command::UserControl specific parameters + my $maplist = [ $member_map, $recipient_map ]; my $uc_args = { address => $address, maplist => $maplist, diff --git a/fml/lib/FML/Command/Admin/delmoderator.pm b/fml/lib/FML/Command/Admin/delmoderator.pm index dbd72047..438b7165 100644 --- a/fml/lib/FML/Command/Admin/delmoderator.pm +++ b/fml/lib/FML/Command/Admin/delmoderator.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: delmoderator.pm,v 1.7 2003/01/27 04:40:21 fukachan Exp $ +# $FML: delmoderator.pm,v 1.8 2003/03/18 10:42:42 fukachan Exp $ # package FML::Command::Admin::delmoderator; @@ -69,25 +69,21 @@ sub process my $config = $curproc->config(); # target maps - my $member_maps = $config->get_as_array_ref('moderator_member_maps'); - my $recipient_maps = $config->get_as_array_ref('moderator_recipient_maps'); - my $options = $command_args->{ options }; - my $address = $command_args->{ command_data } || $options->[ 0 ]; + my $member_map = $config->{ 'primary_moderator_member_map' }; + my $recipient_map = $config->{ 'primary_moderator_recipient_map' }; + my $options = $command_args->{ options }; + my $address = $command_args->{ command_data } || $options->[ 0 ]; # fundamental check - croak("address not undefined") unless defined $address; - croak("address not specified") unless $address; - croak("member_maps not undefined") unless defined $member_maps; - croak("member_maps not specified") unless $member_maps; - croak("recipient_maps not undefined") unless defined $recipient_maps; - croak("recipient_maps not specified") unless $recipient_maps; - - # maplist - my $maplist = []; - push(@$maplist, @$member_maps) if @$member_maps; - push(@$maplist, @$recipient_maps) if @$recipient_maps; - - # FML::Command::UserControl specific parameters + croak("address not undefined") unless defined $address; + croak("address not specified") unless $address; + croak("member_map not undefined") unless defined $member_map; + croak("member_map not specified") unless $member_map; + croak("recipient_map not undefined") unless defined $recipient_map; + croak("recipient_map not specified") unless $recipient_map; + + # $uc_args = FML::Command::UserControl specific parameters + my $maplist = [ $member_map, $recipient_map ]; my $uc_args = { address => $address, maplist => $maplist, diff --git a/fml/lib/FML/Command/Admin/digest.pm b/fml/lib/FML/Command/Admin/digest.pm index d5f4d8f1..062c5d3c 100644 --- a/fml/lib/FML/Command/Admin/digest.pm +++ b/fml/lib/FML/Command/Admin/digest.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: digest.pm,v 1.8 2003/02/13 14:06:13 fukachan Exp $ +# $FML: digest.pm,v 1.9 2003/03/18 10:42:42 fukachan Exp $ # package FML::Command::Admin::digest; @@ -77,17 +77,16 @@ sub process my $mode = $options->[ 1 ] || ''; # maps - my $primary_recipient_map = $config->{ primary_recipient_map }; + my $recipient_map = $config->{ primary_recipient_map }; my $recipient_maps = $config->get_as_array_ref('recipient_maps'); my $digest_recipient_map = $config->{ primary_digest_recipient_map }; my $digest_recipient_maps = $config->get_as_array_ref('digest_recipient_maps'); # fundamental check - croak("address not defined") unless defined $address; + croak("address not defined") unless defined $address; croak("address not specified") unless $address; - croak("primary_recipient_map not defined") - unless defined $primary_recipient_map; + croak("primary_recipient_map not defined") unless defined $recipient_map; croak("recipient_maps not defined") unless defined $recipient_maps; croak("digest_recipient_map not defined") unless defined $digest_recipient_map; @@ -95,9 +94,9 @@ sub process unless defined $digest_recipient_maps; my $digest_args = { - address => $address, - mode => $mode, - primary_recipient_map => $primary_recipient_map, + address => $address, + mode => $mode, + primary_recipient_map => $recipient_map, recipient_maps => $recipient_maps, primary_digest_recipient_map => $digest_recipient_map, digest_recipient_maps => $digest_recipient_maps, @@ -131,16 +130,13 @@ sub _digest_on { my ($self, $curproc, $command_args, $dargs) = @_; my $address = $dargs->{ address }; - my $mode = $dargs->{ mode }; - my $primary_recipient_map = $dargs->{ primary_recipient_map }; - my $recipient_maps = $dargs->{ recipient_maps }; + my $recipient_map = $dargs->{ primary_recipient_map }; my $digest_recipient_map = $dargs->{ primary_digest_recipient_map }; - my $digest_recipient_maps = $dargs->{ digest_recipient_maps }; - # move $address from normal $recipient_maps to $digest_recipient_maps + # move $address from normal $recipient_map to $digest_recipient_map my $uc_normal_args = { address => $address, - maplist => $recipient_maps, + maplist => [ $recipient_map ], }; my $uc_digest_args = { @@ -162,21 +158,18 @@ sub _digest_off { my ($self, $curproc, $command_args, $dargs) = @_; my $address = $dargs->{ address }; - my $mode = $dargs->{ mode }; - my $primary_recipient_map = $dargs->{ primary_recipient_map }; - my $recipient_maps = $dargs->{ recipient_maps }; + my $recipient_map = $dargs->{ primary_recipient_map }; my $digest_recipient_map = $dargs->{ primary_digest_recipient_map }; - my $digest_recipient_maps = $dargs->{ digest_recipient_maps }; # move $address from normal $digest_recipient_maps to $prmary_recipient_map my $uc_normal_args = { address => $address, - maplist => [ $primary_recipient_map ], + maplist => [ $recipient_map ], }; my $uc_digest_args = { address => $address, - maplist => $digest_recipient_maps, + maplist => [ $digest_recipient_map ], }; $self->_userdel($curproc, $command_args, $uc_digest_args); diff --git a/fml/lib/FML/Command/Admin/off.pm b/fml/lib/FML/Command/Admin/off.pm index 1feb77cb..5d93ffa8 100644 --- a/fml/lib/FML/Command/Admin/off.pm +++ b/fml/lib/FML/Command/Admin/off.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: off.pm,v 1.8 2003/02/13 14:06:13 fukachan Exp $ +# $FML: off.pm,v 1.9 2003/03/18 10:42:43 fukachan Exp $ # package FML::Command::Admin::off; @@ -66,20 +66,20 @@ sub lock_channel { return 'command_serialize';} sub process { my ($self, $curproc, $command_args) = @_; - my $config = $curproc->config(); - my $recipient_maps = $config->get_as_array_ref( 'recipient_maps' ); - my $options = $command_args->{ options }; - my $address = $command_args->{ command_data } || $options->[ 0 ]; + my $config = $curproc->config(); + my $recipient_map = $config->{ 'primary_recipient_map' }; + my $options = $command_args->{ options }; + my $address = $command_args->{ command_data } || $options->[ 0 ]; # fundamental check - croak("address not defined") unless defined $address; - croak("address not specified") unless $address; - croak("\$recipient_maps not specified") unless @$recipient_maps; + croak("address not defined") unless defined $address; + croak("address not specified") unless $address; + croak("\$recipient_map not specified") unless $recipient_map; # FML::Command::UserControl specific parameters my $uc_args = { address => $address, - maplist => $recipient_maps, + maplist => [ $recipient_map ], }; my $r = ''; diff --git a/fml/lib/FML/Command/Admin/on.pm b/fml/lib/FML/Command/Admin/on.pm index 0b302375..6b59a566 100644 --- a/fml/lib/FML/Command/Admin/on.pm +++ b/fml/lib/FML/Command/Admin/on.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: on.pm,v 1.7 2003/02/13 14:06:13 fukachan Exp $ +# $FML: on.pm,v 1.8 2003/03/18 10:42:43 fukachan Exp $ # package FML::Command::Admin::on; @@ -67,8 +67,6 @@ sub process { my ($self, $curproc, $command_args) = @_; my $config = $curproc->{ config }; - - # XXX-TODO: use of $primary_recipient_map is correct here? my $recipient_map = $config->{ primary_recipient_map }; my $options = $command_args->{ options }; my $address = $command_args->{ command_data } || $options->[ 0 ]; diff --git a/fml/lib/FML/Command/Admin/unsubscribe.pm b/fml/lib/FML/Command/Admin/unsubscribe.pm index f22ec45d..12b0b17c 100644 --- a/fml/lib/FML/Command/Admin/unsubscribe.pm +++ b/fml/lib/FML/Command/Admin/unsubscribe.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: unsubscribe.pm,v 1.21 2003/02/13 14:06:13 fukachan Exp $ +# $FML: unsubscribe.pm,v 1.22 2003/03/18 10:42:43 fukachan Exp $ # package FML::Command::Admin::unsubscribe; @@ -68,22 +68,20 @@ sub lock_channel { return 'command_serialize';} sub process { my ($self, $curproc, $command_args) = @_; - my $config = $curproc->{ config }; - my $member_maps = $config->get_as_array_ref( 'member_maps' ); - my $recipient_maps = $config->get_as_array_ref( 'recipient_maps' ); - my $options = $command_args->{ options }; - my $address = $command_args->{ command_data } || $options->[ 0 ]; + my $config = $curproc->{ config }; + my $member_map = $config->{ 'primary_member_map' }; + my $recipient_map = $config->{ 'primary_recipient_map' }; + my $options = $command_args->{ options }; + my $address = $command_args->{ command_data } || $options->[ 0 ]; # fundamental check - croak("address is not defined") unless defined $address; - croak("address is not specified") unless $address; - croak("member_maps is not specified") unless @$member_maps; - croak("recipient_maps is not specified") unless @$recipient_maps; + croak("address not defined") unless defined $address; + croak("address not specified") unless $address; + croak("member_map not specified") unless $member_map; + croak("recipient_map not specified") unless $recipient_map; # FML::Command::UserControl specific parameters - my $maplist = []; - push(@$maplist, @$recipient_maps); - push(@$maplist, @$member_maps); + my $maplist = [ $member_map, $recipient_map ]; my $uc_args = { address => $address, maplist => $maplist, diff --git a/fml/lib/FML/Command/Auth.pm b/fml/lib/FML/Command/Auth.pm index 492e6232..df833689 100644 --- a/fml/lib/FML/Command/Auth.pm +++ b/fml/lib/FML/Command/Auth.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Auth.pm,v 1.24 2003/03/18 10:42:41 fukachan Exp $ +# $FML: Auth.pm,v 1.25 2003/03/28 10:32:21 fukachan Exp $ # package FML::Command::Auth; @@ -216,8 +216,7 @@ sub check_admin_member_password sub change_password { my ($self, $curproc, $command_args, $up_args) = @_; - my $maplist = $up_args->{ maplist }; - my $pri_map = $up_args->{ primary_map }; + my $map = $up_args->{ map }; my $address = $up_args->{ address }; my $password = $up_args->{ password }; my $status = 0; @@ -229,36 +228,31 @@ sub change_password $curproc->lock($lock_channel); - # XXX delete entries for address among ALL MAPS. use IO::Adapter; - for my $map (@$maplist) { - my $obj = new IO::Adapter $map; - if (defined $obj) { - $obj->open(); - if ($obj->find( $address )) { - $obj->delete( $address ); - if ($obj->error()) { - LogError("cannot delete $address from=$map"); - } - else { - Log("delete $address from=$map"); - } + my $obj = new IO::Adapter $map; + if (defined $obj) { + $obj->open(); + + # delete + if ($obj->find( $address )) { + $obj->delete( $address ); + if ($obj->error()) { + LogError("cannot delete $address from=$map"); + } + else { + Log("delete $address from=$map"); } - $obj->close(); } - } - # XXX add password entry to ONLY primary map. o.k. ? - my $obj = new IO::Adapter $pri_map; - if (defined $obj) { - $obj->open(); + # add $obj->add( $address, [ $cp, "UNIX_CRYPT" ] ) && $status++; if ($obj->error()) { - LogError("cannot add $address to=$pri_map"); + LogError("cannot add $address to=$map"); } else { - Log("add password for $address to=$pri_map"); + Log("add password for $address to=$map"); } + $obj->close(); } |
