summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup
diff options
context:
space:
mode:
Diffstat (limited to 'rdiff-backup/rdiff_backup')
-rw-r--r--rdiff-backup/rdiff_backup/connection.py2
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py15
2 files changed, 14 insertions, 3 deletions
diff --git a/rdiff-backup/rdiff_backup/connection.py b/rdiff-backup/rdiff_backup/connection.py
index 20dd3db..1506675 100644
--- a/rdiff-backup/rdiff_backup/connection.py
+++ b/rdiff-backup/rdiff_backup/connection.py
@@ -11,7 +11,7 @@
"""Support code for remote execution and data transfer"""
from __future__ import generators
-import types, os, tempfile, cPickle, shutil, traceback, pickle
+import types, os, tempfile, cPickle, shutil, traceback, pickle, socket
class ConnectionError(Exception): pass
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py
index 22e901e..6f9734f 100644
--- a/rdiff-backup/rdiff_backup/rpath.py
+++ b/rdiff-backup/rdiff_backup/rpath.py
@@ -16,7 +16,7 @@ remote systems transparent.
"""
-import os, stat, re, sys, shutil, gzip
+import os, stat, re, sys, shutil, gzip, socket
from static import *
@@ -75,7 +75,7 @@ class RPathStatic:
major, minor = rpin.getdevnums()
rpout.makedev("b", major, minor)
elif rpin.isfifo(): rpout.mkfifo()
- elif rpin.issock(): Log("Found socket, ignoring", 1)
+ elif rpin.issock(): rpout.mksock()
else: raise RPathException("File %s has unknown type" % rpin.path)
def copy_reg_file(rpin, rpout):
@@ -200,6 +200,11 @@ class RPathStatic:
try: return tuple(os.lstat(filename))
except os.error: return None
+ def make_socket(path):
+ """Make a local socket at the given path"""
+ s = socket.socket(socket.AF_UNIX)
+ s.bind(path)
+
MakeStatic(RPathStatic)
@@ -580,6 +585,12 @@ class RPath(RORPath):
self.setdata()
assert self.isfifo()
+ def mksock(self):
+ """Make a socket at self.path"""
+ self.conn.RPathStatic.make_socket(self.path)
+ self.setdata()
+ assert self.issock()
+
def touch(self):
"""Make sure file at self.path exists"""
Log("Touching " + self.path, 7)