summaryrefslogtreecommitdiffstats
path: root/fsset.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-10-02 18:42:01 +0000
committerJeremy Katz <katzj@redhat.com>2002-10-02 18:42:01 +0000
commit0f5200e6b58bf0b78fac4cbf43fc60611f8b944d (patch)
tree0b760f6d0d976ab4ef7c5076bad3bb982c0296be /fsset.py
parent358bc3918ed227551f93f4efacb08f653a783e0d (diff)
downloadanaconda-0f5200e6b58bf0b78fac4cbf43fc60611f8b944d.tar.gz
anaconda-0f5200e6b58bf0b78fac4cbf43fc60611f8b944d.tar.xz
anaconda-0f5200e6b58bf0b78fac4cbf43fc60611f8b944d.zip
make sure that the swap file is created 0600 (#74849)
Diffstat (limited to 'fsset.py')
-rw-r--r--fsset.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/fsset.py b/fsset.py
index fc3dab595..c5109b8c6 100644
--- a/fsset.py
+++ b/fsset.py
@@ -1719,6 +1719,9 @@ class SwapFileDevice(Device):
file = os.path.normpath(chroot + self.getDevice())
if not os.access(file, os.R_OK):
if self.size:
+ # make sure the permissions are set properly
+ os.open(file, os.O_CREAT, 0600)
+ os.close(file)
isys.ddfile(file, self.size, None)
else:
raise SystemError, (0, "swap file creation necessary, but "