/
usr
/
include
/
proftpd
/
/usr/include/proftpd
mkdir
upload
Name
Size
Mode
Actions
ascii.h
2674
0644
edit
dl
rm
auth.h
6381
0644
edit
dl
rm
base.h
3497
0644
edit
dl
rm
bindings.h
8027
0644
edit
dl
rm
buildstamp.h
50
0644
edit
dl
rm
ccan-json.h
3677
0644
edit
dl
rm
child.h
1511
0644
edit
dl
rm
class.h
3096
0644
edit
dl
rm
cmd.h
4463
0644
edit
dl
rm
compat.h
1324
0644
edit
dl
rm
conf.h
3948
0644
edit
dl
rm
config.h
36627
0644
edit
dl
rm
configdb.h
5864
0644
edit
dl
rm
ctrls.h
8524
0644
edit
dl
rm
data.h
2582
0644
edit
dl
rm
default_paths.h
3037
0644
edit
dl
rm
dirtree.h
7648
0644
edit
dl
rm
display.h
2514
0644
edit
dl
rm
encode.h
3757
0644
edit
dl
rm
env.h
1913
0644
edit
dl
rm
error.h
18894
0644
edit
dl
rm
event.h
3583
0644
edit
dl
rm
expr.h
2209
0644
edit
dl
rm
feat.h
1303
0644
edit
dl
rm
filter.h
2113
0644
edit
dl
rm
fsio.h
19528
0644
edit
dl
rm
ftp.h
9196
0644
edit
dl
rm
glibc-glob.h
7294
0644
edit
dl
rm
hanson-tpl.h
4505
0644
edit
dl
rm
help.h
1265
0644
edit
dl
rm
ident.h
1334
0644
edit
dl
rm
inet.h
5395
0644
edit
dl
rm
jot.h
8736
0644
edit
dl
rm
json.h
6282
0644
edit
dl
rm
lastlog.h
1655
0644
edit
dl
rm
log.h
6822
0644
edit
dl
rm
logfmt.h
3444
0644
edit
dl
rm
memcache.h
5056
0644
edit
dl
rm
mkhome.h
1569
0644
edit
dl
rm
modules.h
6474
0644
edit
dl
rm
mod_ctrls.h
4058
0644
edit
dl
rm
mod_sftp.h
10959
0644
edit
dl
rm
mod_tls.h
6478
0644
edit
dl
rm
netacl.h
2571
0644
edit
dl
rm
netaddr.h
15999
0644
edit
dl
rm
netio.h
8176
0644
edit
dl
rm
openbsd-blowfish.h
2967
0644
edit
dl
rm
options.h
8531
0644
edit
dl
rm
os.h
7391
0644
edit
dl
rm
parser.h
6351
0644
edit
dl
rm
pidfile.h
1331
0644
edit
dl
rm
pool.h
4138
0644
edit
dl
rm
pr-syslog.h
3552
0644
edit
dl
rm
privs.h
2613
0644
edit
dl
rm
proctitle.h
1682
0644
edit
dl
rm
proftpd.h
9727
0644
edit
dl
rm
random.h
1325
0644
edit
dl
rm
redis.h
15953
0644
edit
dl
rm
regexp.h
3720
0644
edit
dl
rm
response.h
3145
0644
edit
dl
rm
rlimit.h
1873
0644
edit
dl
rm
scoreboard.h
4760
0644
edit
dl
rm
session.h
4430
0644
edit
dl
rm
sets.h
1986
0644
edit
dl
rm
signals.h
1879
0644
edit
dl
rm
stash.h
2174
0644
edit
dl
rm
str.h
5729
0644
edit
dl
rm
support.h
4494
0644
edit
dl
rm
table.h
11883
0644
edit
dl
rm
throttle.h
1299
0644
edit
dl
rm
timers.h
3370
0644
edit
dl
rm
trace.h
2421
0644
edit
dl
rm
utf8.h
1407
0644
edit
dl
rm
var.h
4419
0644
edit
dl
rm
version.h
1631
0644
edit
dl
rm
xferlog.h
1374
0644
edit
dl
rm
Edit:
/usr/include/proftpd/ctrls.h
(8524B)
/* * ProFTPD - FTP server daemon * Copyright (c) 2001-2023 The ProFTPD Project team * * 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * * As a special exemption, Public Flood Software/MacGyver aka Habeeb J. Dihu * and other respective copyright holders give permission to link this program * with OpenSSL, and distribute the resulting executable, without including * the source code for OpenSSL in the source distribution. */ /* Controls API definitions */ #ifndef PR_CTRLS_H #define PR_CTRLS_H #include <sys/un.h> #include "conf.h" /* Controls API build-time necessities */ /* mode for control socket */ #define PR_CTRLS_MODE 0777 /* mode for client sockets */ #define PR_CTRLS_CL_MODE S_IRWXU /* Controls API objects */ /* Controls client object */ typedef struct cl_obj { struct cl_obj *cl_next, *cl_prev; /* Pool for this object's use */ pool *cl_pool; /* Client socket file descriptor */ int cl_fd; /* Credentials of the connecting client */ uid_t cl_uid; const char *cl_user; gid_t cl_gid; const char *cl_group; pid_t cl_pid; /* For internal use only */ volatile unsigned long cl_flags; /* Pointers to all controls matching client request */ array_header *cl_ctrls; } pr_ctrls_cl_t; /* Controls client flag values */ #define PR_CTRLS_CL_HAVEREQ 0x001 #define PR_CTRLS_CL_HAVERESP 0x002 #define PR_CTRLS_CL_NOACCESS 0x004 #define PR_CTRLS_CL_NOACTION 0x010 #define PR_CTRLS_CL_BLOCKED 0x020 /* Controls handler object */ typedef struct ctrls_obj { struct ctrls_obj *ctrls_next, *ctrls_prev; /* Object ID */ unsigned int ctrls_id; /* Registering module */ const module *ctrls_module; /* Requesting client */ pr_ctrls_cl_t *ctrls_cl; /* Control "action" */ const char *ctrls_action; /* Control trigger time. If 0, triggers immediately */ time_t ctrls_when; /* Simple description/help text */ const char *ctrls_desc; /* Temporary pool */ pool *ctrls_tmp_pool; /* Control handler callback */ int (*ctrls_cb)(struct ctrls_obj *, int, char **); /* Control handler callback arguments */ array_header *ctrls_cb_args; /* Control handler callback return value. Used to determine when to clear * this object from the requested list */ int ctrls_cb_retval; /* Control handler callback responses */ array_header *ctrls_cb_resps; /* For possibly passing data among control handlers */ void *ctrls_data; /* For internal use */ volatile unsigned long ctrls_flags; } pr_ctrls_t; #define PR_CTRLS_FL_REQUESTED 0x00001 #define PR_CTRLS_FL_HANDLED 0x00002 #define PR_CTRLS_FL_PENDING 0x00004 #define PR_CTRLS_ACT_SOLITARY 0x00010 #define PR_CTRLS_ACT_DISABLED 0x00020 #define CTRLS_GET_ACTION_ALL 7 #define CTRLS_GET_ACTION_ENABLED 8 #define CTRLS_GET_DESC 9 /* Controls API */ /* Control action exit status values */ /* Note: For internal use only */ #define PR_CTRLS_STATUS_PENDING 1 #define PR_CTRLS_STATUS_OK 0 /* Note: Used for backward compatibility */ #define PR_CTRLS_STATUS_GENERIC_ERROR -1 #define PR_CTRLS_STATUS_ACCESS_DENIED -2 #define PR_CTRLS_STATUS_WRONG_PARAMETERS -3 /* Example: "no such server/address", "unknown module" */ #define PR_CTRLS_STATUS_SUBJECT_NOT_FOUND -4 #define PR_CTRLS_STATUS_OPERATION_DENIED -5 #define PR_CTRLS_STATUS_OPERATION_IGNORED -6 #define PR_CTRLS_STATUS_UNSUPPORTED_OPERATION -7 #define PR_CTRLS_STATUS_INTERNAL_ERROR -8 /* Register a control handler for the given action with the Controls layer, * to be available to requesting clients. Returns the ID of the registered * handler, or -1 if there was an error. */ int pr_ctrls_register(const module *mod, const char *action, const char *desc, int (*ctrls_cb)(pr_ctrls_t *, int, char **)); /* Unregisters any control handlers that match the given module/action pair. * If the module argument is null, then the specified action for all modules * is unregistered. If the action argument is null, then all actions for the * specified module are unregistered. * * Returns 0 on success, -1 on failure. */ int pr_ctrls_unregister(module *mod, const char *action); /* Add the given ctrls_arg string to the pr_ctrls_t object's argument * array. Returns 0 on success, -1 on failure. */ int pr_ctrls_add_arg(pr_ctrls_t *ctrl, char *ctrls_arg, size_t ctrls_arglen); /* Add the given string to the pr_ctrls_t object's response array. Returns * 0 on success, -1 on failure. Control handlers can use this function to * add a text response to be returned to the requesting client. */ int pr_ctrls_add_response(pr_ctrls_t *ctrl, const char *fmt, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))); #else ; #endif /* Meant for use in opening a client control socket, by ftpdctl and core * routines. Connects to the control socket, and returns the socket descriptor * opened, or -1 if there was an error. */ int pr_ctrls_connect(const char *socket_file); int pr_ctrls_copy_args(pr_ctrls_t *src_ctrl, pr_ctrls_t *dest_ctrl); int pr_ctrls_copy_resps(pr_ctrls_t *src_ctrl, pr_ctrls_t *dest_ctrl); /* Flush any responses added to the pr_ctrls_t out the client. This should * only be used when the control handler will not return (as when it is * going to end the process then and there). Returns -1 with errno set to * EINVAL if the given pointer is NULL, EPERM if unable to flush the responses * out to the client. Returns 0 on success. */ int pr_ctrls_flush_response(pr_ctrls_t *ctrl); /* Reads a client control request from the given client. Returns -1 with errno * set to EOF if there is nothing to read from the client socket, or errno set * to the appropriate error for other problems. Returns 0 on success. */ int pr_ctrls_recv_request(pr_ctrls_cl_t *cl); int pr_ctrls_send_request(pool *p, int fd, const char *action, unsigned int argc, char **argv); /* argv can be NULL, as when the client does not care to know the response * messages, just that a response was successfully received. Returns argc, * or -1 if there was an error. */ int pr_ctrls_recv_response(pool *p, int fd, int *status, char ***argv); int pr_ctrls_send_response(pool *p, int fd, int status, unsigned int argc, char **argv); /* Determine whether the given socket mode is for a Unix domain socket. * Returns zero if true, -1 otherwise. */ int pr_ctrls_issock_unix(mode_t sock_mode); /* Accept a Controls connection. Returns the fd of the connected client * if successful, -1 (with errno set appropriately) otherwise. * * The optional uid, gid, and pid pointers, if provided, will be filled in * with the uid, gid, and pid of the connecting client process. These can * be used e.g. for access control checks. The max_age parameter specifies * the maximum age, in seconds, for the connecting client; this is used * for some types of credentials checking. */ int pr_ctrls_accept(int sockfd, uid_t *uid, gid_t *gid, pid_t *pid, unsigned int max_age); int pr_get_registered_actions(pr_ctrls_t *ctrl, int flags); int pr_set_registered_actions(module *mod, const char *action, unsigned char skip_disabled, unsigned int flags); /* Blocks ctrls from being run. */ void pr_block_ctrls(void); /* Unblocks ctrls from being run. */ void pr_unblock_ctrls(void); /* XXX */ int pr_ctrls_check_actions(void); /* Iterate through the list of pr_ctrls_ts and invoke the callbacks of any * that match the given module and action arguments. Returns 0 if successful, * -1 if error (eg controls are blocked). */ int pr_run_ctrls(module *mod, const char *action); /* Run through the registered controls, freeing up any that are available. */ int pr_ctrls_reset(void); /* For internal use only. */ pr_ctrls_t *pr_ctrls_alloc(void); int pr_ctrls_free(pr_ctrls_t *ctrl); void init_ctrls(void); int init_ctrls2(const char *socket_path); #endif /* PR_CTRLS_H */
Save
cmd:
run