From 51d65037dfed30a43f46958aa082aa769fea250a Mon Sep 17 00:00:00 2001 From: John Schember Date: Thu, 11 Jun 2009 06:14:55 -0400 Subject: [PATCH 1/2] Use rmdir when removing directories instead of unlink. --- src/calibre/linux.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/linux.py b/src/calibre/linux.py index 34f7abb195..2645a661db 100644 --- a/src/calibre/linux.py +++ b/src/calibre/linux.py @@ -334,7 +334,7 @@ def post_install(): os.chdir(config_dir) for f in os.listdir('.'): if os.stat(f).st_uid == 0: - os.unlink(f) + os.rmdir(f) def binary_install(): manifest = os.path.join(getattr(sys, 'frozen_path'), 'manifest') From df2f0fa4c3b7b00d0e1c1ba8249f67a75a1749de Mon Sep 17 00:00:00 2001 From: John Schember Date: Thu, 11 Jun 2009 06:40:20 -0400 Subject: [PATCH 2/2] Remove root owned config dir in addition to root owned sub dirs. --- src/calibre/linux.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/linux.py b/src/calibre/linux.py index 2645a661db..d9f6b0777e 100644 --- a/src/calibre/linux.py +++ b/src/calibre/linux.py @@ -335,6 +335,8 @@ def post_install(): for f in os.listdir('.'): if os.stat(f).st_uid == 0: os.rmdir(f) + if os.stat(config_dir).st_uid == 0: + os.rmdir(config_dir) def binary_install(): manifest = os.path.join(getattr(sys, 'frozen_path'), 'manifest')