This is an automated email from the git hooks/post-receive script. intrigeri pushed a commit to branch experimental in repository libnet-dbus-perl.
commit ff234455e62037f64ca672273310d8f345ab91dc Author: Daniel P. Berrange <d...@berrange.com> Date: Thu Jun 30 21:19:25 2011 +0100 Replace dbus_strict_exports with dbus_no_strict_exports so default behaviour is more useful --- examples/strict-exports.pl | 4 ++-- lib/Net/DBus/Exporter.pm | 24 +++++++++++++++--------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/examples/strict-exports.pl b/examples/strict-exports.pl index 25417d4..e6b0e07 100644 --- a/examples/strict-exports.pl +++ b/examples/strict-exports.pl @@ -9,8 +9,6 @@ package MyStrictObject; use base qw(Net::DBus::Object); use Net::DBus::Exporter "org.example.MyObject"; -dbus_strict_exports; - sub new { my $class = shift; my $self = $class->SUPER::new(@_); @@ -39,6 +37,8 @@ package MyFlexibleObject; use base qw(Net::DBus::Object); use Net::DBus::Exporter qw(org.example.MyObject); +dbus_no_strict_exports; + sub new { my $class = shift; my $self = $class->SUPER::new(@_); diff --git a/lib/Net/DBus/Exporter.pm b/lib/Net/DBus/Exporter.pm index e0e2425..ca13b9b 100644 --- a/lib/Net/DBus/Exporter.pm +++ b/lib/Net/DBus/Exporter.pm @@ -253,7 +253,7 @@ use strict; use Exporter; @ISA = qw(Exporter); -@EXPORT = qw(dbus_method dbus_signal dbus_property dbus_strict_exports); +@EXPORT = qw(dbus_method dbus_signal dbus_property dbus_no_strict_exports); sub import { @@ -266,7 +266,7 @@ sub import { } $dbus_exports{$caller} = { - strict => 0, + strict => 1, methods => {}, signals => {}, props => {}, @@ -402,18 +402,24 @@ sub dbus_method { $dbus_exports{$caller}->{methods}->{$name} = [$params, $returns, $interface, \%attributes, $param_names, $return_names]; } -=item dbus_strict_exports(); +=item dbus_no_strict_exports(); -Restricts calls to only methods already exported through C<dbus_method>. -When not using this method, by default any method call will be allowed. -Method calls will be also restricted according to the used interface. -It is strongly recommended that this method be used. +If a object is using the Exporter to generate DBus introspection data, +the default behaviour is to only allow invocation of methods which have +been explicitly exported. + +To allow clients to access methods which have not been explicitly +exported, call C<dbus_no_strict_exports>. NB, doing this may be +a security risk if you have methods considered to be "private" for +internal use only. As such this method should not normally be used. +It is here only to allow switching export behaviour to match earlier +releases. =cut -sub dbus_strict_exports { +sub dbus_no_strict_exports { my $caller = caller; - $dbus_exports{$caller}->{strict} = 1; + $dbus_exports{$caller}->{strict} = 0; } =item dbus_property($name, $type, $access, [\%attributes]); -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-dbus-perl.git _______________________________________________ Pkg-perl-cvs-commits mailing list Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits