mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
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>
This commit is contained in:
committed by
Ben Pfaff
parent
1f3c5efcc6
commit
2c487bc808
@@ -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:
|
||||
|
Reference in New Issue
Block a user