From 755cb6c801aa89cf0462634d5876d59e2b513b28 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Fri, 9 Oct 2015 18:41:05 +0200 Subject: Security upadte sync with Minstick --- lib/raw_format.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/raw_format.py b/lib/raw_format.py index 00b1f97..2d240a0 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) -- cgit v1.2.1