Add support for readonly app with writable "exports" subdir

This will be used for the triggers
tingping/wmclass
Alexander Larsson 2015-01-15 20:21:17 +01:00
parent 66e889dc79
commit 258ca0b9d9
1 changed files with 18 additions and 0 deletions

View File

@ -836,6 +836,7 @@ main (int argc,
int mount_home = 0;
int writable = 0;
int writable_app = 0;
int writable_exports = 0;
char old_cwd[256];
char tmpdir[] = "/tmp/run-app.XXXXXX";
@ -871,6 +872,12 @@ main (int argc,
n_args -= 1;
break;
case 'e':
writable_exports = 1;
args += 1;
n_args -= 1;
break;
case 's':
share_shm = 1;
args += 1;
@ -1058,6 +1065,17 @@ main (int argc,
{
if (bind_mount (app_path, "self", BIND_PRIVATE | (writable_app?0:BIND_READONLY)))
die_with_error ("mount self");
if (!writable_app && writable_exports)
{
char *exports = strconcat (app_path, "/exports");
if (bind_mount (exports, "self/exports", BIND_PRIVATE))
die_with_error ("mount self/exports");
free (exports);
}
}
if (var_path != NULL)