18c2aff776a775d34a4c9893a4c72e0434d68e36artem/***************************************************************************
18c2aff776a775d34a4c9893a4c72e0434d68e36artem * CVSID: $Id$
18c2aff776a775d34a4c9893a4c72e0434d68e36artem * polkit-is-privileged.c : Determine if a user has privileges
18c2aff776a775d34a4c9893a4c72e0434d68e36artem * Copyright (C) 2006 David Zeuthen, <david@fubar.dk>
18c2aff776a775d34a4c9893a4c72e0434d68e36artem * This program is free software; you can redistribute it and/or modify
18c2aff776a775d34a4c9893a4c72e0434d68e36artem * it under the terms of the GNU General Public License as published by
18c2aff776a775d34a4c9893a4c72e0434d68e36artem * the Free Software Foundation; either version 2 of the License, or
18c2aff776a775d34a4c9893a4c72e0434d68e36artem * (at your option) any later version.
18c2aff776a775d34a4c9893a4c72e0434d68e36artem * This program is distributed in the hope that it will be useful,
18c2aff776a775d34a4c9893a4c72e0434d68e36artem * but WITHOUT ANY WARRANTY; without even the implied warranty of
18c2aff776a775d34a4c9893a4c72e0434d68e36artem * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18c2aff776a775d34a4c9893a4c72e0434d68e36artem * GNU General Public License for more details.
18c2aff776a775d34a4c9893a4c72e0434d68e36artem * You should have received a copy of the GNU General Public License
18c2aff776a775d34a4c9893a4c72e0434d68e36artem * along with this program; if not, write to the Free Software
18c2aff776a775d34a4c9893a4c72e0434d68e36artem * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18c2aff776a775d34a4c9893a4c72e0434d68e36artem **************************************************************************/
18c2aff776a775d34a4c9893a4c72e0434d68e36artem fprintf (stderr, "polkit-is-privileged version " PACKAGE_VERSION "\n");
18c2aff776a775d34a4c9893a4c72e0434d68e36artem "usage : %s -u <uid> -p <privilege> [-r <resource>]\n"
18c2aff776a775d34a4c9893a4c72e0434d68e36artem "Options:\n"
18c2aff776a775d34a4c9893a4c72e0434d68e36artem " -u, --user Username or user id\n"
18c2aff776a775d34a4c9893a4c72e0434d68e36artem " -s, --system-bus-unique-name Unique system bus connection name\n"
18c2aff776a775d34a4c9893a4c72e0434d68e36artem " -r, --resource Resource\n"
18c2aff776a775d34a4c9893a4c72e0434d68e36artem " -p, --privilege Privilege to test for\n"
18c2aff776a775d34a4c9893a4c72e0434d68e36artem " -h, --help Show this information and exit\n"
18c2aff776a775d34a4c9893a4c72e0434d68e36artem " -v, --verbose Verbose operation\n"
18c2aff776a775d34a4c9893a4c72e0434d68e36artem " -V, --version Print version number\n"
18c2aff776a775d34a4c9893a4c72e0434d68e36artem "Queries system policy whether a given user is allowed for a given\n"
18c2aff776a775d34a4c9893a4c72e0434d68e36artem "privilege for a given resource. The resource may be omitted.\n"
18c2aff776a775d34a4c9893a4c72e0434d68e36artem {"system-bus-unique-name", required_argument, NULL, 's'},
18c2aff776a775d34a4c9893a4c72e0434d68e36artem c = getopt_long (argc, argv, "u:r:p:s:hVv", long_options, NULL);
18c2aff776a775d34a4c9893a4c72e0434d68e36artem if (c == -1)
18c2aff776a775d34a4c9893a4c72e0434d68e36artem switch (c) {
18c2aff776a775d34a4c9893a4c72e0434d68e36artem printf ("polkit-is-privileged version " PACKAGE_VERSION "\n");
18c2aff776a775d34a4c9893a4c72e0434d68e36artem#endif /* POLKITD_ENABLED */
18c2aff776a775d34a4c9893a4c72e0434d68e36artem g_warning ("Error determing whether user is privileged.");