storage: Make external disk mounts accessible by other users

- samba app doesn't need anymore to change mount permissions

Fixes #1692 (in a different way)

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Veiko Aasa authored and James Valleroy committed 2020-01-26 07:32:04 -05:00
1 parent d2286ca093
commit 9d653d87ec
3 files changed
+19 -11

No files matched your search

+17
View File
@@ -23,6 +23,7 @@ import argparse
import json
import os
import re
import stat
import subprocess
import sys
@@ -34,6 +35,8 @@ def parse_arguments():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='subcommand', help='Sub command')
subparsers.add_parser('setup', help='Configure storage after install')
subparser = subparsers.add_parser(
'is-partition-expandable',
help='Return whether a given partition can be expanded')
@@ -320,6 +323,20 @@ def umount_all_filesystems_of_drive(drive_object_path):
umount_filesystem(obj.get_filesystem())
def subcommand_setup(_):
"""Configure storage."""
# create udisks2 default mount directory
mounts_directory = '/media/root'
try:
os.mkdir(mounts_directory)
except FileExistsError:
pass
# make the directory readable and traversible by other users
stats = os.stat(mounts_directory)
os.chmod(mounts_directory, stats.st_mode | stat.S_IROTH | stat.S_IXOTH)
def subcommand_usage_info(_):
"""Get information about disk space usage."""
command = [