Make read-only guarantee user-settable
[petitboot] / discover / device-handler.c
index 31cbcc2c1da50b87b9b5bf472227ebe2ce8559ab..4f7a7b7500c4fee446747df10861095d30b2ce33 100644 (file)
@@ -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;