aboutsummaryrefslogtreecommitdiffstats
path: root/clip
diff options
context:
space:
mode:
Diffstat (limited to 'clip')
-rwxr-xr-xclip4
1 files changed, 1 insertions, 3 deletions
diff --git a/clip b/clip
index 0bdc35f..880a23b 100755
--- a/clip
+++ b/clip
@@ -40,9 +40,7 @@ def fileno(filelike):
def secure_open(path, mode='r', *l, **kw):
if os.path.islink(path):
raise SecurityError("The clipboard file can not be a symlink")
- real_mode = mode
- if 'w' in real_mode:
- real_mode = real_mode.replace('w', 'a')
+ real_mode = real_mode.replace('w', 'a')
with open(path, real_mode, *l, **kw) as fo:
if os.fstat(fileno(fo)) != os.stat(path):
raise SecurityError("Intrusion might have been done on %s" % path)