Skip to content

Commit

Permalink
Do not use /var/run/user/$UID, do not use -f
Browse files Browse the repository at this point in the history
We cannot rely on /var/run/user/$UID being there, and -f makes it not work
Closes #150
  • Loading branch information
probonopd authored May 22, 2021
1 parent b3c2156 commit 88aeedd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions overlays/uzip/mountarchive/files/usr/local/bin/mountarchive
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

import os, sys
import distutils.spawn
import getpass

try:
from PyQt5 import QtWidgets, QtGui, QtCore
Expand All @@ -53,7 +54,7 @@ class ArchiveMounter(object):

def __init__(self, filename):

self.mountpoint = "/var/run/user/" + str(os.getuid()) + "/" + os.path.normpath(filename).replace("/", "_")
self.mountpoint = "/tmp/" + str(getpass.getuser()) + "/" + os.path.normpath(filename).replace("/", "_")
# TODO: Check how gvfs calls its mountpoints

if os.path.exists(self.mountpoint):
Expand All @@ -68,7 +69,7 @@ class ArchiveMounter(object):
self.p = QtCore.QProcess()
self.p.setProgram("archivemount")
# TODO: perhaps we need something along the lines of modules=iconv,from_code=ISO-8859-2,to_code=utf-8 for Windows compatiblity?
args = ['-f', '-o', 'readonly,nonempty,allow_root', filename, self.mountpoint]
args = ['-o', 'readonly,nonempty,allow_root', filename, self.mountpoint]
print(self.p.program() + " " + " ".join(args))
self.p.setArguments(args)
self.p.setProcessChannelMode(QtCore.QProcess.ForwardedChannels); # Forward standard output and standard error onto the main process
Expand Down

0 comments on commit 88aeedd

Please sign in to comment.