diff options
| author | fukachan <fukachan> | 2003-02-03 12:25:58 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-02-03 12:25:58 +0000 |
| commit | 52905e4eb47df4e80ebf274af1824e1e5c1c8781 (patch) | |
| tree | 3fdb6603e94aac0fb300a5b9d9e461e150ac533c /fml/lib/FML/Process/Command.pm | |
| parent | 19afce81a05f1345815b8074cf438f438dce9bc4 (diff) | |
| download | fml8-52905e4eb47df4e80ebf274af1824e1e5c1c8781.tar.gz fml8-52905e4eb47df4e80ebf274af1824e1e5c1c8781.tar.bz2 fml8-52905e4eb47df4e80ebf274af1824e1e5c1c8781.zip | |
for hook, wrap main code by is_refused() condition such as:
unless ($curproc->is_refused()) { main code ...; }
Diffstat (limited to 'fml/lib/FML/Process/Command.pm')
| -rw-r--r-- | fml/lib/FML/Process/Command.pm | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/fml/lib/FML/Process/Command.pm b/fml/lib/FML/Process/Command.pm index 28726578..8278d86e 100644 --- a/fml/lib/FML/Process/Command.pm +++ b/fml/lib/FML/Process/Command.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001,2002,2003 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Command.pm,v 1.79 2003/01/03 07:06:38 fukachan Exp $ +# $FML: Command.pm,v 1.80 2003/01/11 06:58:45 fukachan Exp $ # package FML::Process::Command; @@ -147,32 +147,35 @@ sub run my ($curproc, $args) = @_; my $pcb = $curproc->{ pcb }; - # permit_xxx() sets the error reason at "check_restriction" in pcb. - if ($curproc->permit_command($args)) { - $curproc->_evaluate_command_lines($args); - } - # XXX reject command use irrespective of requests from admins/users. - # XXX rejection of admin use occurs in _evaluate_command_lines() not here. - # XXX possible cases are from "system_accounts" or from a not member. - else { - # check the error reason by permit_command(). - my $reason = $pcb->get("check_restrictions", "deny_reason"); - if (defined($reason) && ($reason eq 'reject_system_accounts')) { - $curproc->reply_message_nl("error.system_accounts", - "deny request from system accounts"); + unless ($curproc->is_refused()) { + # permit_xxx() sets the error reason at "check_restriction" in pcb. + if ($curproc->permit_command($args)) { + $curproc->_evaluate_command_lines($args); } + # XXX reject command use irrespective of requests from admins/users. + # XXX rejection of admin use occurs in _evaluate_command_lines() + # XXX not here. + # XXX possible cases are from "system_accounts" or from a not member. else { - $curproc->reply_message_nl("error.not_member", - "deny request from a not member"); - } + # check the error reason by permit_command(). + my $reason = $pcb->get("check_restrictions", "deny_reason"); + if (defined($reason) && ($reason eq 'reject_system_accounts')) { + my $s = "deny request from system accounts"; + $curproc->reply_message_nl("error.system_accounts", $s); + } + else { + $curproc->reply_message_nl("error.not_member", + "deny request from a not member"); + } - # append the incoming message into the error message sent back - # as the reference. - my $msg = $curproc->incoming_message(); - $curproc->reply_message( $msg ); + # append the incoming message into the error message sent back + # as the reference. + my $msg = $curproc->incoming_message(); + $curproc->reply_message( $msg ); - unless (defined $reason) { $reason = 'unknown';} - Log("deny command. reason=$reason"); + unless (defined $reason) { $reason = 'unknown';} + Log("deny command. reason=$reason"); + } } } |
