test-login.c revision 74b91131ed09850ed487a2f7849147ff6f80194d
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2011 Lennart Poettering
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "sd-login.h"
#include "util.h"
int r, k;
char *seat;
char *session;
char *state;
char *session2;
r = sd_session_is_active(session);
assert_se(r >= 0);
printf("uid = %lu\n", (unsigned long) u);
k = sd_uid_is_active_on_seat(u, seat);
assert_se(k >= 0);
assert_se(!!r == !!r);
return 0;
}