diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2011-09-30 14:14:31 +0200 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2011-09-30 14:14:31 +0200 |
commit | cd38494ad9d34399b69eeac5cd1542d41147f01d (patch) | |
tree | 7310fe2f9eb734f5fa7ab099f60dc5c0ff4102be /src/lightdm-guest-session-wrapper.c | |
parent | 7a8539871a5c022ba19d1676f5331076354c39c0 (diff) | |
download | lightdm-cd38494ad9d34399b69eeac5cd1542d41147f01d.tar.gz |
Introduce a lightdm-guest-session-wrapper session command which MAC systems like AppArmor and SELinux can use for attaching a restrictive policy to guest sessions.
Diffstat (limited to 'src/lightdm-guest-session-wrapper.c')
-rw-r--r-- | src/lightdm-guest-session-wrapper.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lightdm-guest-session-wrapper.c b/src/lightdm-guest-session-wrapper.c new file mode 100644 index 00000000..c2a37455 --- /dev/null +++ b/src/lightdm-guest-session-wrapper.c @@ -0,0 +1,25 @@ +/* -*- Mode: C; indent-tabs-mode: nil; tab-width: 4 -*- + * + * Copyright (C) 2011 Canonical Ltd. + * Author: Martin Pitt <martin.pitt@ubuntu.com> + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. See http://www.gnu.org/copyleft/gpl.html the full text of the + * license. + */ + +/* This is a simple wrapper which just re-execve()'s the program given as its + * arguments. This allows MAC systems like AppArmor or SELinux to apply a + * policy on this wrapper which applies to guest sessions only. */ + +#include <unistd.h> + +int +main (int argc, char *argv[], char *envp[]) +{ + if (argc < 2) + return 1; + execve (argv[1], argv+1, envp); +} |