diff options
author | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-05-06 17:03:30 +1000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-08-06 14:08:33 +1000 |
commit | acc5ace6e58db2f3dceb1f7a27d0fc1fb29c4a27 (patch) | |
tree | d5577259029ad08d93de57e0a3560b6271627e8a /discover/device-handler.c | |
parent | 79bfd11f662fcf46bd4ae58a0aab993cbe158dbe (diff) | |
download | talos-petitboot-acc5ace6e58db2f3dceb1f7a27d0fc1fb29c4a27.tar.gz talos-petitboot-acc5ace6e58db2f3dceb1f7a27d0fc1fb29c4a27.zip |
Make read-only guarantee user-settable
Create a new Petitboot option 'petitboot,write?' that specifies whether
the system is allowed to mount devices read-write. The option can be
toggled by the user in the nc-config screen.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Diffstat (limited to 'discover/device-handler.c')
-rw-r--r-- | discover/device-handler.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c index 31cbcc2..4f7a7b7 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -1391,10 +1391,15 @@ static int umount_device(struct discover_device *dev) int device_request_write(struct discover_device *dev, bool *release) { const char *fstype, *device_path; + const struct config *config; int rc; *release = false; + config = config_get(); + if (!config->allow_writes) + return -1; + if (!dev->mounted) return -1; |