aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageialinux-online.org>2015-10-06 07:45:53 +0200
committerPapoteur <papoteur@mageialinux-online.org>2015-10-06 07:45:53 +0200
commit12e34b26a99ada6c22fcee5abaac5a90fb2b8cf3 (patch)
treea6abaf0bd8138f533ee2a4052c95f6a66572fe56 /lib
parent3f303a9b14fd751df8d87b7900fef7c983af6acd (diff)
downloadisodumper-12e34b26a99ada6c22fcee5abaac5a90fb2b8cf3.tar
isodumper-12e34b26a99ada6c22fcee5abaac5a90fb2b8cf3.tar.gz
isodumper-12e34b26a99ada6c22fcee5abaac5a90fb2b8cf3.tar.bz2
isodumper-12e34b26a99ada6c22fcee5abaac5a90fb2b8cf3.tar.xz
isodumper-12e34b26a99ada6c22fcee5abaac5a90fb2b8cf3.zip
Sécurity update, sync with Mintstick
Diffstat (limited to 'lib')
-rwxr-xr-xlib/raw_format.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/raw_format.py b/lib/raw_format.py
index 84ca8c7..b634470 100755
--- a/lib/raw_format.py
+++ b/lib/raw_format.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
#
# imported from project Mintstick, by Clement Lefebvre
+# https://github.com/linuxmint/mintstick/
#
# Copyright (C) 2013 THE isodumper'S COPYRIGHT HOLDER
# This file is distributed under the same license as the isodumper package.
@@ -63,7 +64,7 @@ def raw_format(device_path, fstype, volume_label, uid, gid):
do_umount(device_path)
# First erase MBR and partition table , if any
- os.system ("dd if=/dev/zero of=%s bs=512 count=1 >/dev/null 2>&1" % device_path)
+ call(["dd", "if=/dev/zero", "of=%s" % device_path, "bs=512", "count=1"])
device = parted.getDevice(device_path)
@@ -106,11 +107,11 @@ def raw_format(device_path, fstype, volume_label, uid, gid):
# Format partition according to the fstype specified
if fstype == "fat32":
- os.system("mkdosfs -F 32 -n \"%s\" %s >/dev/null 2>&1" % (volume_label, partition.path))
+ call(["mkdosfs", "-F", "32", "-n", volume_label, partition.path])
if fstype == "ntfs":
- os.system("mkntfs -f -L \"%s\" %s >/dev/null 2>&1" % (volume_label, partition.path))
+ call(["mkntfs", "-f", "-L", volume_label, partition.path])
elif fstype == "ext4":
- os.system("mkfs.ext4 -E root_owner=%s:%s -L \"%s\" %s >/dev/null 2>&1" % (uid, gid, volume_label, partition.path))
+ call(["mkfs.ext4", "-E", "root_owner=%s:%s" % (uid, gid), "-L", volume_label, partition.path])
sys.exit(0)