… | |
… | |
478 | When secure mode is enabled, then remote nodes cannot execute code |
478 | When secure mode is enabled, then remote nodes cannot execute code |
479 | locally, at least not via the normal node protocol. All other messages are |
479 | locally, at least not via the normal node protocol. All other messages are |
480 | still allowed. This means remote nodes can monitor, kill or local ports |
480 | still allowed. This means remote nodes can monitor, kill or local ports |
481 | (port names can be easily guessed). |
481 | (port names can be easily guessed). |
482 | |
482 | |
483 | At the moment, this affects C<eval_on> and C<spawn> functionality. |
483 | At the moment, this affects C<snd_on>, C<eval_on> and C<spawn> |
|
|
484 | functionality. |
484 | |
485 | |
485 | The C<configure> function additionally allows you to specify a callback |
486 | The C<configure> function additionally allows you to specify a callback |
486 | that can grant or suppress such requests on a per-node basis. |
487 | that can grant or suppress such requests on a per-node basis. |
487 | |
488 | |
488 | =item [set|del]monitor_timeout <seconds> |
489 | =item [set|del]monitor_timeout <seconds> |
… | |
… | |
637 | my $to = AE::timer 15, 0, sub { exit 1 }; |
638 | my $to = AE::timer 15, 0, sub { exit 1 }; |
638 | |
639 | |
639 | init; |
640 | init; |
640 | |
641 | |
641 | my $reply = port { |
642 | my $reply = port { |
642 | my ($node, @neigh) = @_; |
643 | my ($node, undef, @neigh) = @_; |
643 | |
644 | |
644 | @neigh = grep $_ ne $NODE, @neigh; |
645 | @neigh = grep $_ ne $NODE, @neigh; |
645 | |
646 | |
646 | print +(join " ", $node, @neigh), "\n"; |
647 | print $node, " -> ", (join " ", @neigh), "\n"; |
647 | |
648 | |
648 | for (@neigh) { |
649 | for (@neigh) { |
649 | unless ($seen{$_}++) { |
650 | unless ($seen{$_}++) { |
650 | $cv->begin; |
651 | $cv->begin; |
651 | snd $_, up_nodes => $SELF => $_; |
652 | AnyEvent::MP::Kernel::eval_on $_, "AnyEvent::MP::Kernel::up_nodes" => $SELF => $_; |
652 | } |
653 | } |
653 | } |
654 | } |
654 | |
655 | |
655 | $cv->end; |
656 | $cv->end; |
656 | }; |
657 | }; |
657 | |
658 | |
658 | $cv->begin; |
659 | $cv->begin; |
659 | snd $reply, seed => $node; |
660 | snd $reply, $node => undef, AnyEvent::MP::Kernel::up_nodes; |
660 | |
661 | |
661 | $cv->recv; |
662 | $cv->recv; |
662 | } |
663 | } |
663 | |
664 | |
664 | sub shell { |
665 | sub shell { |