1/*
2 * Copyright 2015, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
5
6
7#include <pwd.h>
8#include <stdio.h>
9#include <stdlib.h>
10
11#include <LaunchRoster.h>
12
13
14int
15main()
16{
17	if (getuid() != 0)
18		return EXIT_FAILURE;
19
20	// TODO: This will obviously be done differently in a multi-user
21	// environment; we'll probably want to merge this with the standard
22	// login application then.
23	struct passwd* passwd = getpwuid(0);
24	if (passwd == NULL)
25		return EXIT_FAILURE;
26
27	status_t status = BLaunchRoster().StartSession(passwd->pw_name);
28	if (status != B_OK)
29		return EXIT_FAILURE;
30
31	return EXIT_SUCCESS;
32}
33