aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorPavithra Ramesh <paramesh@vmware.com>2013-02-08 12:37:18 -0800
committerBen Pfaff <blp@nicira.com>2013-02-11 12:53:11 -0800
commit2ab02d25784e6d2cb294f55e16ba226cdcf143d7 (patch)
treeb0fed34f0e3ece31cd3bb5369cc338f731583efe /python
parent46739ae72b23bf6fcd56dc7ae743bce346300325 (diff)
stream-unix: Use rundir as root for relative paths.
Until now, "unix:" and "punix:" paths that are not absolute have been considered relative to the current working directory. It is more useful to consider them relative to the rundir, so this commit makes that change to the C and Python implementations of the stream code. This commit also relaxes the whitelist check in the bridge code so that any name that does not contain a "/" is considered OK. Signed-off-by: Pavithra Ramesh <paramesh@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'python')
-rw-r--r--python/ovs/stream.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/ovs/stream.py b/python/ovs/stream.py
index c640ebf5..fb083eee 100644
--- a/python/ovs/stream.py
+++ b/python/ovs/stream.py
@@ -107,6 +107,8 @@ class Stream(object):
return errno.EAFNOSUPPORT, None
suffix = name.split(":", 1)[1]
+ if name.startswith("unix:"):
+ suffix = ovs.util.abs_file_name(ovs.dirs.RUNDIR, suffix)
error, sock = cls._open(suffix, dscp)
if error:
return error, None
@@ -282,6 +284,8 @@ class PassiveStream(object):
return errno.EAFNOSUPPORT, None
bind_path = name[6:]
+ if name.startswith("punix:"):
+ bind_path = ovs.util.abs_file_name(ovs.dirs.RUNDIR, bind_path)
error, sock = ovs.socket_util.make_unix_socket(socket.SOCK_STREAM,
True, bind_path, None)
if error: