Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sudo-project
GitHub Repository: sudo-project/sudo
Path: blob/main/plugins/python/sudo_python_debug.h
1532 views
1
/*
2
* SPDX-License-Identifier: ISC
3
*
4
* Copyright (c) 2014 Todd C. Miller <[email protected]>
5
*
6
* Permission to use, copy, modify, and distribute this software for any
7
* purpose with or without fee is hereby granted, provided that the above
8
* copyright notice and this permission notice appear in all copies.
9
*
10
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
*/
18
19
#ifndef SUDO_PYTHON_DEBUG_H
20
#define SUDO_PYTHON_DEBUG_H
21
22
#include <sudo_debug.h>
23
24
/*
25
* Sudo python plugin debug subsystems.
26
* Note that python_subsystem_ids[] is filled in at debug registration time.
27
*/
28
extern unsigned int python_subsystem_ids[];
29
#define PYTHON_DEBUG_PY_CALLS (python_subsystem_ids[0])
30
#define PYTHON_DEBUG_C_CALLS (python_subsystem_ids[1])
31
#define PYTHON_DEBUG_PLUGIN_LOAD (python_subsystem_ids[2])
32
#define PYTHON_DEBUG_CALLBACKS (python_subsystem_ids[3])
33
#define PYTHON_DEBUG_INTERNAL (python_subsystem_ids[4])
34
#define PYTHON_DEBUG_PLUGIN (python_subsystem_ids[5])
35
36
bool python_debug_parse_flags(struct sudo_conf_debug_file_list *debug_files, const char *entry);
37
bool python_debug_register(const char *program, struct sudo_conf_debug_file_list *debug_files);
38
void python_debug_deregister(void);
39
40
#define debug_return_ptr_pynone \
41
do { \
42
Py_INCREF(Py_None); \
43
debug_return_ptr(Py_None); \
44
} while(0)
45
46
#endif /* SUDO_PYTHON_DEBUG_H */
47
48