TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags
[wireshark-sm.git] / wsutil / privileges.h
blobc936228c037a9cc9247594f1f946af92bfe7fb99
1 /** @file
2 * Declarations of routines for handling privileges.
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 2006 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
11 #ifndef __PRIVILEGES_H__
12 #define __PRIVILEGES_H__
14 #include <wireshark.h>
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
20 /**
21 * Called when the program starts, to enable security features and save
22 * whatever credential information we'll need later.
24 WS_DLL_PUBLIC void init_process_policies(void);
26 /**
27 * Was this program started with special privileges? get_credential_info()
28 * MUST be called before calling this.
29 * @return true if the program was started with special privileges,
30 * false otherwise.
32 WS_DLL_PUBLIC bool started_with_special_privs(void);
34 /**
35 * Is this program running with special privileges? get_credential_info()
36 * MUST be called before calling this.
37 * @return true if the program is running with special privileges,
38 * false otherwise.
40 WS_DLL_PUBLIC bool running_with_special_privs(void);
42 /**
43 * Permanently relinquish special privileges. get_credential_info()
44 * MUST be called before calling this.
46 WS_DLL_PUBLIC void relinquish_special_privs_perm(void);
48 /**
49 * Get the current username. String must be g_free()d after use.
50 * @return A freshly g_alloc()ed string containing the username,
51 * or "UNKNOWN" on failure.
53 WS_DLL_PUBLIC char *get_cur_username(void);
55 /**
56 * Get the current group. String must be g_free()d after use.
57 * @return A freshly g_alloc()ed string containing the group,
58 * or "UNKNOWN" on failure.
60 WS_DLL_PUBLIC char *get_cur_groupname(void);
62 #ifdef __cplusplus
64 #endif /* __cplusplus */
66 #endif /* __PRIVILEGES_H__ */