summaryrefslogtreecommitdiff
path: root/dbus/service.py
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2007-03-02 18:43:09 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2007-03-02 18:43:09 +0000
commitcfb1ea5f32a5ab77078ce184cb13602f2e28fec1 (patch)
tree456a980ba3f0f045e0c23958f24b148c2b093ef5 /dbus/service.py
parent5ee2e05d5056584d589991f5d5fd0d22df598676 (diff)
downloaddbus-python-cfb1ea5f32a5ab77078ce184cb13602f2e28fec1.tar.gz
* dbus.service.Object: don't let the user try to export objects on the local
path reserved by libdbus/dbus-daemon, or on an invalid path. * BusName: don't even try to claim an invalid bus name either.
Diffstat (limited to 'dbus/service.py')
-rw-r--r--dbus/service.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/dbus/service.py b/dbus/service.py
index 306818e..64f0330 100644
--- a/dbus/service.py
+++ b/dbus/service.py
@@ -33,6 +33,7 @@ from dbus.exceptions import NameExistsException
from dbus.exceptions import UnknownMethodException
from dbus.decorators import method
from dbus.decorators import signal
+from dbus.proxies import LOCAL_PATH
_logger = logging.getLogger('dbus.service')
@@ -89,6 +90,9 @@ class BusName(object):
services waiting for the requested name if another service
already holds it.
"""
+ _dbus_bindings.validate_bus_name(name, allow_well_known=True,
+ allow_unique=False)
+
# get default bus
if bus == None:
bus = _dbus.Bus()
@@ -394,6 +398,10 @@ class Object(Interface):
"""
if object_path is None:
raise TypeError('The object_path argument is required')
+ _dbus_bindings.validate_object_path(object_path)
+ if object_path == LOCAL_PATH:
+ raise DBusException('Objects may not be exported on the reserved '
+ 'path %s' % LOCAL_PATH)
if isinstance(conn, BusName):
# someone's using the old API; don't gratuitously break them