2006-02-06 03:11:34 +00:00
|
|
|
/* privileges.h
|
|
|
|
* Declarations of routines for handling privileges.
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2006-02-06 03:11:34 +00:00
|
|
|
* Copyright 2006 Gerald Combs
|
|
|
|
*
|
|
|
|
* 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 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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 this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2007-08-30 00:24:40 +00:00
|
|
|
/**
|
2006-02-06 03:11:34 +00:00
|
|
|
* Called when the program starts, to save whatever credential information
|
|
|
|
* we'll need later.
|
|
|
|
*/
|
|
|
|
extern void get_credential_info(void);
|
|
|
|
|
2007-08-30 00:24:40 +00:00
|
|
|
/**
|
2006-02-06 03:11:34 +00:00
|
|
|
* Was this program started with special privileges?
|
2007-08-30 00:24:40 +00:00
|
|
|
* @return TRUE if the program was started with special privileges,
|
|
|
|
* FALSE otherwise.
|
2006-02-06 03:11:34 +00:00
|
|
|
*/
|
|
|
|
extern gboolean started_with_special_privs(void);
|
2006-02-06 10:27:27 +00:00
|
|
|
|
2007-08-30 00:24:40 +00:00
|
|
|
/**
|
|
|
|
* Is this program running with special privileges?
|
|
|
|
* @return TRUE if the program is running with special privileges,
|
|
|
|
* FALSE otherwise.
|
|
|
|
*/
|
|
|
|
extern gboolean running_with_special_privs(void);
|
|
|
|
|
|
|
|
/**
|
2006-02-06 10:27:27 +00:00
|
|
|
* Permanently relinquish special privileges.
|
|
|
|
*/
|
|
|
|
extern void relinquish_special_privs_perm(void);
|
2007-08-30 00:24:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the current username. String must be g_free()d after use.
|
|
|
|
* @return A freshly g_alloc()ed string containing the username,
|
|
|
|
* or "UNKNOWN" on failure.
|
|
|
|
*/
|
|
|
|
extern gchar *get_cur_username(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the current group. String must be g_free()d after use.
|
|
|
|
* @return A freshly g_alloc()ed string containing the group,
|
|
|
|
* or "UNKNOWN" on failure.
|
|
|
|
*/
|
|
|
|
extern gchar *get_cur_groupname(void);
|
|
|
|
|