__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
/*
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2009-2023 Todd C. Miller <Todd.Miller@sudo.ws>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef SUDO_PLUGIN_H
#define SUDO_PLUGIN_H
/* API version major/minor */
#define SUDO_API_VERSION_MAJOR 1
#define SUDO_API_VERSION_MINOR 21
#define SUDO_API_MKVERSION(x, y) (((x) << 16) | (y))
#define SUDO_API_VERSION SUDO_API_MKVERSION(SUDO_API_VERSION_MAJOR, SUDO_API_VERSION_MINOR)
/* Getters and setters for plugin API versions */
#define SUDO_API_VERSION_GET_MAJOR(v) ((v) >> 16)
#define SUDO_API_VERSION_GET_MINOR(v) ((v) & 0xffffU)
#define SUDO_API_VERSION_SET_MAJOR(vp, n) do { \
*(vp) = (*(vp) & 0x0000ffffU) | ((n) << 16); \
} while(0)
#define SUDO_API_VERSION_SET_MINOR(vp, n) do { \
*(vp) = (*(vp) & 0xffff0000U) | (n); \
} while(0)
/* "plugin type" for the sudo front end, as passed to an audit plugin */
#define SUDO_FRONT_END 0
/* Conversation function types and defines */
struct sudo_conv_message {
#define SUDO_CONV_PROMPT_ECHO_OFF 0x0001 /* do not echo user input */
#define SUDO_CONV_PROMPT_ECHO_ON 0x0002 /* echo user input */
#define SUDO_CONV_ERROR_MSG 0x0003 /* error message */
#define SUDO_CONV_INFO_MSG 0x0004 /* informational message */
#define SUDO_CONV_PROMPT_MASK 0x0005 /* mask user input */
#define SUDO_CONV_PROMPT_ECHO_OK 0x1000 /* flag: allow echo if no tty */
#define SUDO_CONV_PREFER_TTY 0x2000 /* flag: use tty if possible */
int msg_type;
int timeout;
const char *msg;
};
/*
* Maximum length of a reply (not including the trailing NUL) when
* conversing with the user. In practical terms, this is the longest
* password sudo will support. This means that a buffer of size
* SUDO_CONV_REPL_MAX+1 is guaranteed to be able to hold any reply
* from the conversation function.
*/
#define SUDO_CONV_REPL_MAX 1023
struct sudo_conv_reply {
char *reply;
};
/* Conversation callback API version major/minor */
#define SUDO_CONV_CALLBACK_VERSION_MAJOR 1
#define SUDO_CONV_CALLBACK_VERSION_MINOR 0
#define SUDO_CONV_CALLBACK_VERSION SUDO_API_MKVERSION(SUDO_CONV_CALLBACK_VERSION_MAJOR, SUDO_CONV_CALLBACK_VERSION_MINOR)
/*
* Callback struct to be passed to the conversation function.
* Can be used to perform operations on suspend/resume such
* as dropping/acquiring locks.
*/
typedef int (*sudo_conv_callback_fn_t)(int signo, void *closure);
struct sudo_conv_callback {
unsigned int version;
void *closure;
sudo_conv_callback_fn_t on_suspend;
sudo_conv_callback_fn_t on_resume;
};
typedef int (*sudo_conv_t)(int num_msgs, const struct sudo_conv_message msgs[],
struct sudo_conv_reply replies[], struct sudo_conv_callback *callback);
typedef int (*sudo_printf_t)(int msg_type, const char * restrict fmt, ...);
/*
* Hooks allow a plugin to hook into specific sudo and/or libc functions.
*/
#if defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 4) || __GNUC__ > 4)
# pragma GCC diagnostic ignored "-Wstrict-prototypes"
#endif
/* Hook functions typedefs. */
typedef int (*sudo_hook_fn_t)();
typedef int (*sudo_hook_fn_setenv_t)(const char *name, const char *value, int overwrite, void *closure);
typedef int (*sudo_hook_fn_putenv_t)(char *string, void *closure);
typedef int (*sudo_hook_fn_getenv_t)(const char *name, char **value, void *closure);
typedef int (*sudo_hook_fn_unsetenv_t)(const char *name, void *closure);
/* Hook structure definition. */
struct sudo_hook {
unsigned int hook_version;
unsigned int hook_type;
sudo_hook_fn_t hook_fn;
void *closure;
};
/* Hook API version major/minor */
#define SUDO_HOOK_VERSION_MAJOR 1
#define SUDO_HOOK_VERSION_MINOR 0
#define SUDO_HOOK_VERSION SUDO_API_MKVERSION(SUDO_HOOK_VERSION_MAJOR, SUDO_HOOK_VERSION_MINOR)
/*
* Hook function return values.
*/
#define SUDO_HOOK_RET_ERROR -1 /* error */
#define SUDO_HOOK_RET_NEXT 0 /* go to the next hook in the list */
#define SUDO_HOOK_RET_STOP 1 /* stop hook processing for this type */
/*
* Hooks for setenv/unsetenv/putenv/getenv.
* This allows the plugin to be notified when a PAM module modifies
* the environment so it can update the copy of the environment that
* is passed to execve().
*/
#define SUDO_HOOK_SETENV 1
#define SUDO_HOOK_UNSETENV 2
#define SUDO_HOOK_PUTENV 3
#define SUDO_HOOK_GETENV 4
/*
* Plugin interface to sudo's main event loop.
*/
typedef void (*sudo_plugin_ev_callback_t)(int fd, int what, void *closure);
struct timespec;
struct sudo_plugin_event {
int (*set)(struct sudo_plugin_event *pev, int fd, int events, sudo_plugin_ev_callback_t callback, void *closure);
int (*add)(struct sudo_plugin_event *pev, struct timespec *timeout);
int (*del)(struct sudo_plugin_event *pev);
int (*pending)(struct sudo_plugin_event *pev, int events, struct timespec *ts);
int (*fd)(struct sudo_plugin_event *pev);
void (*setbase)(struct sudo_plugin_event *pev, void *base);
void (*loopbreak)(struct sudo_plugin_event *pev);
void (*free)(struct sudo_plugin_event *pev);
/* actually larger... */
};
/* Sudo plugin Event types */
#define SUDO_PLUGIN_EV_TIMEOUT 0x01 /* fire after timeout */
#define SUDO_PLUGIN_EV_READ 0x02 /* fire when readable */
#define SUDO_PLUGIN_EV_WRITE 0x04 /* fire when writable */
#define SUDO_PLUGIN_EV_PERSIST 0x08 /* persist until deleted */
#define SUDO_PLUGIN_EV_SIGNAL 0x10 /* fire on signal receipt */
/* Policy plugin type and defines. */
struct passwd;
struct policy_plugin {
#define SUDO_POLICY_PLUGIN 1
unsigned int type; /* always SUDO_POLICY_PLUGIN */
unsigned int version; /* always SUDO_API_VERSION */
int (*open)(unsigned int version, sudo_conv_t conversation,
sudo_printf_t sudo_plugin_printf, char * const settings[],
char * const user_info[], char * const user_env[],
char * const plugin_options[], const char **errstr);
void (*close)(int exit_status, int error); /* wait status or error */
int (*show_version)(int verbose);
int (*check_policy)(int argc, char * const argv[],
char *env_add[], char **command_info[],
char **argv_out[], char **user_env_out[], const char **errstr);
int (*list)(int argc, char * const argv[], int verbose,
const char *user, const char **errstr);
int (*validate)(const char **errstr);
void (*invalidate)(int rmcred);
int (*init_session)(struct passwd *pwd, char **user_env_out[],
const char **errstr);
void (*register_hooks)(int version, int (*register_hook)(struct sudo_hook *hook));
void (*deregister_hooks)(int version, int (*deregister_hook)(struct sudo_hook *hook));
struct sudo_plugin_event * (*event_alloc)(void);
};
/* I/O plugin type and defines. */
struct io_plugin {
#define SUDO_IO_PLUGIN 2
unsigned int type; /* always SUDO_IO_PLUGIN */
unsigned int version; /* always SUDO_API_VERSION */
int (*open)(unsigned int version, sudo_conv_t conversation,
sudo_printf_t sudo_plugin_printf, char * const settings[],
char * const user_info[], char * const command_info[],
int argc, char * const argv[], char * const user_env[],
char * const plugin_options[], const char **errstr);
void (*close)(int exit_status, int error); /* wait status or error */
int (*show_version)(int verbose);
int (*log_ttyin)(const char *buf, unsigned int len, const char **errstr);
int (*log_ttyout)(const char *buf, unsigned int len, const char **errstr);
int (*log_stdin)(const char *buf, unsigned int len, const char **errstr);
int (*log_stdout)(const char *buf, unsigned int len, const char **errstr);
int (*log_stderr)(const char *buf, unsigned int len, const char **errstr);
void (*register_hooks)(int version,
int (*register_hook)(struct sudo_hook *hook));
void (*deregister_hooks)(int version,
int (*deregister_hook)(struct sudo_hook *hook));
int (*change_winsize)(unsigned int line, unsigned int cols,
const char **errstr);
int (*log_suspend)(int signo, const char **errstr);
struct sudo_plugin_event * (*event_alloc)(void);
};
/* Differ audit plugin close status types. */
#define SUDO_PLUGIN_NO_STATUS 0
#define SUDO_PLUGIN_WAIT_STATUS 1
#define SUDO_PLUGIN_EXEC_ERROR 2
#define SUDO_PLUGIN_SUDO_ERROR 3
/* Audit plugin type and defines */
struct audit_plugin {
#define SUDO_AUDIT_PLUGIN 3
unsigned int type; /* always SUDO_AUDIT_PLUGIN */
unsigned int version; /* always SUDO_API_VERSION */
int (*open)(unsigned int version, sudo_conv_t conversation,
sudo_printf_t sudo_plugin_printf, char * const settings[],
char * const user_info[], int submit_optind,
char * const submit_argv[], char * const submit_envp[],
char * const plugin_options[], const char **errstr);
void (*close)(int status_type, int status);
int (*accept)(const char *plugin_name, unsigned int plugin_type,
char * const command_info[], char * const run_argv[],
char * const run_envp[], const char **errstr);
int (*reject)(const char *plugin_name, unsigned int plugin_type,
const char *audit_msg, char * const command_info[],
const char **errstr);
int (*error)(const char *plugin_name, unsigned int plugin_type,
const char *audit_msg, char * const command_info[],
const char **errstr);
int (*show_version)(int verbose);
void (*register_hooks)(int version, int (*register_hook)(struct sudo_hook *hook));
void (*deregister_hooks)(int version, int (*deregister_hook)(struct sudo_hook *hook));
struct sudo_plugin_event * (*event_alloc)(void);
};
/* Approval plugin type and defines */
struct approval_plugin {
#define SUDO_APPROVAL_PLUGIN 4
unsigned int type; /* always SUDO_APPROVAL_PLUGIN */
unsigned int version; /* always SUDO_API_VERSION */
int (*open)(unsigned int version, sudo_conv_t conversation,
sudo_printf_t sudo_plugin_printf, char * const settings[],
char * const user_info[], int submit_optind,
char * const submit_argv[], char * const submit_envp[],
char * const plugin_options[], const char **errstr);
void (*close)(void);
int (*check)(char * const command_info[], char * const run_argv[],
char * const run_envp[], const char **errstr);
int (*show_version)(int verbose);
};
/* Sudoers group plugin version major/minor */
#define GROUP_API_VERSION_MAJOR 1
#define GROUP_API_VERSION_MINOR 0
#define GROUP_API_VERSION SUDO_API_MKVERSION(GROUP_API_VERSION_MAJOR, GROUP_API_VERSION_MINOR)
/* Getters and setters for group version (for source compat only) */
#define GROUP_API_VERSION_GET_MAJOR(v) SUDO_API_VERSION_GET_MAJOR(v)
#define GROUP_API_VERSION_GET_MINOR(v) SUDO_API_VERSION_GET_MINOR(v)
#define GROUP_API_VERSION_SET_MAJOR(vp, n) SUDO_API_VERSION_SET_MAJOR(vp, n)
#define GROUP_API_VERSION_SET_MINOR(vp, n) SUDO_API_VERSION_SET_MINOR(vp, n)
/*
* version: for compatibility checking
* group_init: return 1 on success, 0 if unconfigured, -1 on error.
* group_cleanup: called to clean up resources used by provider
* user_in_group: returns 1 if user is in group, 0 if not.
* note that pwd may be NULL if the user is not in passwd.
*/
struct sudoers_group_plugin {
unsigned int version;
int (*init)(int version, sudo_printf_t sudo_plugin_printf,
char *const argv[]);
void (*cleanup)(void);
int (*query)(const char *user, const char *group, const struct passwd *pwd);
};
#endif /* SUDO_PLUGIN_H */
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| X11 | Folder | 0755 |
|
|
| arpa | Folder | 0755 |
|
|
| asm-generic | Folder | 0755 |
|
|
| drm | Folder | 0755 |
|
|
| finclude | Folder | 0755 |
|
|
| iproute2 | Folder | 0755 |
|
|
| linux | Folder | 0755 |
|
|
| misc | Folder | 0755 |
|
|
| mtd | Folder | 0755 |
|
|
| net | Folder | 0755 |
|
|
| netash | Folder | 0755 |
|
|
| netatalk | Folder | 0755 |
|
|
| netax25 | Folder | 0755 |
|
|
| neteconet | Folder | 0755 |
|
|
| netinet | Folder | 0755 |
|
|
| netipx | Folder | 0755 |
|
|
| netiucv | Folder | 0755 |
|
|
| netpacket | Folder | 0755 |
|
|
| netrom | Folder | 0755 |
|
|
| netrose | Folder | 0755 |
|
|
| nfs | Folder | 0755 |
|
|
| php | Folder | 0755 |
|
|
| protocols | Folder | 0755 |
|
|
| rdma | Folder | 0755 |
|
|
| regulator | Folder | 0755 |
|
|
| rpc | Folder | 0755 |
|
|
| rpcsvc | Folder | 0755 |
|
|
| scsi | Folder | 0755 |
|
|
| sound | Folder | 0755 |
|
|
| video | Folder | 0755 |
|
|
| x86_64-linux-gnu | Folder | 0755 |
|
|
| xen | Folder | 0755 |
|
|
| xfs | Folder | 0755 |
|
|
| aio.h | File | 7.56 KB | 0644 |
|
| aliases.h | File | 1.98 KB | 0644 |
|
| alloca.h | File | 1.17 KB | 0644 |
|
| ar.h | File | 1.69 KB | 0644 |
|
| argp.h | File | 24.95 KB | 0644 |
|
| argz.h | File | 5.91 KB | 0644 |
|
| assert.h | File | 4.97 KB | 0644 |
|
| byteswap.h | File | 1.42 KB | 0644 |
|
| complex.h | File | 7.95 KB | 0644 |
|
| cpio.h | File | 2.21 KB | 0644 |
|
| crypt.h | File | 10.87 KB | 0644 |
|
| ctype.h | File | 10.71 KB | 0644 |
|
| dirent.h | File | 12.32 KB | 0644 |
|
| dlfcn.h | File | 8.38 KB | 0644 |
|
| elf.h | File | 190.33 KB | 0644 |
|
| endian.h | File | 2.25 KB | 0644 |
|
| envz.h | File | 2.8 KB | 0644 |
|
| err.h | File | 2.33 KB | 0644 |
|
| errno.h | File | 1.64 KB | 0644 |
|
| error.h | File | 2.37 KB | 0644 |
|
| execinfo.h | File | 1.49 KB | 0644 |
|
| fcntl.h | File | 11.17 KB | 0644 |
|
| features-time64.h | File | 1.38 KB | 0644 |
|
| features.h | File | 18.09 KB | 0644 |
|
| fenv.h | File | 5.65 KB | 0644 |
|
| fmtmsg.h | File | 3.16 KB | 0644 |
|
| fnmatch.h | File | 2.24 KB | 0644 |
|
| fstab.h | File | 3.04 KB | 0644 |
|
| fts.h | File | 9.35 KB | 0644 |
|
| ftw.h | File | 6.19 KB | 0644 |
|
| gawkapi.h | File | 40.72 KB | 0644 |
|
| gconv.h | File | 4.11 KB | 0644 |
|
| getopt.h | File | 1.43 KB | 0644 |
|
| glob.h | File | 7.13 KB | 0644 |
|
| gnu-versions.h | File | 2.29 KB | 0644 |
|
| grp.h | File | 6.69 KB | 0644 |
|
| gshadow.h | File | 4.58 KB | 0644 |
|
| iconv.h | File | 1.87 KB | 0644 |
|
| ifaddrs.h | File | 2.77 KB | 0644 |
|
| inttypes.h | File | 11.04 KB | 0644 |
|
| langinfo.h | File | 17.43 KB | 0644 |
|
| lastlog.h | File | 126 B | 0644 |
|
| libgen.h | File | 1.35 KB | 0644 |
|
| libintl.h | File | 4.47 KB | 0644 |
|
| limits.h | File | 5.57 KB | 0644 |
|
| link.h | File | 7.62 KB | 0644 |
|
| locale.h | File | 7.5 KB | 0644 |
|
| malloc.h | File | 5.84 KB | 0644 |
|
| math.h | File | 49.75 KB | 0644 |
|
| mcheck.h | File | 2.38 KB | 0644 |
|
| memory.h | File | 956 B | 0644 |
|
| mntent.h | File | 3.28 KB | 0644 |
|
| monetary.h | File | 1.92 KB | 0644 |
|
| mqueue.h | File | 4.5 KB | 0644 |
|
| netdb.h | File | 27.79 KB | 0644 |
|
| nl_types.h | File | 1.71 KB | 0644 |
|
| nss.h | File | 14.07 KB | 0644 |
|
| obstack.h | File | 20.81 KB | 0644 |
|
| paths.h | File | 2.91 KB | 0644 |
|
| poll.h | File | 22 B | 0644 |
|
| printf.h | File | 6.71 KB | 0644 |
|
| proc_service.h | File | 3.4 KB | 0644 |
|
| pthread.h | File | 47.25 KB | 0644 |
|
| pty.h | File | 1.53 KB | 0644 |
|
| pwd.h | File | 6.17 KB | 0644 |
|
| re_comp.h | File | 963 B | 0644 |
|
| regex.h | File | 25.3 KB | 0644 |
|
| regexp.h | File | 1.35 KB | 0644 |
|
| resolv.h | File | 12.02 KB | 0644 |
|
| sched.h | File | 4.92 KB | 0644 |
|
| search.h | File | 5.32 KB | 0644 |
|
| semaphore.h | File | 3.38 KB | 0644 |
|
| setjmp.h | File | 3.12 KB | 0644 |
|
| sgtty.h | File | 1.31 KB | 0644 |
|
| shadow.h | File | 5.5 KB | 0644 |
|
| signal.h | File | 12.73 KB | 0644 |
|
| spawn.h | File | 8.19 KB | 0644 |
|
| stab.h | File | 264 B | 0644 |
|
| stdbit.h | File | 26.27 KB | 0644 |
|
| stdc-predef.h | File | 2.4 KB | 0644 |
|
| stdint.h | File | 7.96 KB | 0644 |
|
| stdio.h | File | 33.84 KB | 0644 |
|
| stdio_ext.h | File | 2.73 KB | 0644 |
|
| stdlib.h | File | 40.07 KB | 0644 |
|
| string.h | File | 19.5 KB | 0644 |
|
| strings.h | File | 4.64 KB | 0644 |
|
| sudo_plugin.h | File | 11.68 KB | 0644 |
|
| syscall.h | File | 25 B | 0644 |
|
| sysexits.h | File | 5.11 KB | 0644 |
|
| syslog.h | File | 24 B | 0644 |
|
| tar.h | File | 3.66 KB | 0644 |
|
| termio.h | File | 214 B | 0644 |
|
| termios.h | File | 3.51 KB | 0644 |
|
| tgmath.h | File | 46.51 KB | 0644 |
|
| thread_db.h | File | 15.65 KB | 0644 |
|
| threads.h | File | 7.62 KB | 0644 |
|
| time.h | File | 14.77 KB | 0644 |
|
| ttyent.h | File | 2.44 KB | 0644 |
|
| uchar.h | File | 3.04 KB | 0644 |
|
| ucontext.h | File | 1.99 KB | 0644 |
|
| ulimit.h | File | 1.55 KB | 0644 |
|
| unistd.h | File | 44 KB | 0644 |
|
| utime.h | File | 1.86 KB | 0644 |
|
| utmp.h | File | 3.15 KB | 0644 |
|
| utmpx.h | File | 4 KB | 0644 |
|
| values.h | File | 1.91 KB | 0644 |
|
| wait.h | File | 22 B | 0644 |
|
| wchar.h | File | 38.19 KB | 0644 |
|
| wctype.h | File | 5.42 KB | 0644 |
|
| wordexp.h | File | 2.44 KB | 0644 |
|