]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - src/lightdm-guest-session.c
Remove unused vfunc
[sojka/lightdm.git] / src / lightdm-guest-session.c
1 /* -*- Mode: C; indent-tabs-mode: nil; tab-width: 4 -*-
2  *
3  * Copyright (C) 2011 Canonical Ltd.
4  * Author: Martin Pitt <martin.pitt@ubuntu.com>
5  *
6  * This program is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License as published by the Free Software
8  * Foundation, either version 3 of the License, or (at your option) any later
9  * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
10  * license.
11  */
12
13 /* This is a simple wrapper which just re-execve()'s the program given as its
14  * arguments. This allows MAC systems like AppArmor or SELinux to apply a
15  * policy on this wrapper which applies to guest sessions only. */
16
17 #include <stdlib.h>
18 #include <stdio.h>
19 #include <string.h>
20 #include <errno.h>
21 #include <unistd.h>
22
23 int
24 main (int argc, char *argv[], char *envp[])
25 {
26     if (argc < 2)
27     {
28         fprintf (stderr, "Usage: %s COMMAND [ARGS]\n", argv[0]);
29         return EXIT_FAILURE;
30     }
31
32     execve (argv[1], argv+1, envp);
33
34     fprintf (stderr, "Failed to run guest session '%s': %s\n", argv[1], strerror (errno));
35
36     return EXIT_FAILURE;
37 }