1 /*
2  * ProFTPD - mod_vroot FSIO API
3  * Copyright (c) 2016 TJ Saunders
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18  *
19  * As a special exemption, TJ Saunders and other respective copyright holders
20  * give permission to link this program with OpenSSL, and distribute the
21  * resulting executable, without including the source code for OpenSSL in the
22  * source distribution.
23  */
24 
25 #ifndef MOD_VROOT_FSIO_H
26 #define MOD_VROOT_FSIO_H
27 
28 #include "mod_vroot.h"
29 
30 int vroot_fsio_stat(pr_fs_t *fs, const char *path, struct stat *st);
31 int vroot_fsio_lstat(pr_fs_t *fs, const char *path, struct stat *st);
32 int vroot_fsio_rename(pr_fs_t *fs, const char *from, const char *to);
33 int vroot_fsio_unlink(pr_fs_t *fs, const char *path);
34 int vroot_fsio_open(pr_fh_t *fh, const char *path, int flags);
35 int vroot_fsio_creat(pr_fh_t *fh, const char *path, mode_t mode);
36 int vroot_fsio_link(pr_fs_t *fs, const char *dst_path, const char *src_path);
37 int vroot_fsio_symlink(pr_fs_t *fs, const char *dst_path, const char *src_path);
38 int vroot_fsio_readlink(pr_fs_t *fs, const char *path, char *buf, size_t bufsz);
39 int vroot_fsio_truncate(pr_fs_t *fs, const char *path, off_t len);
40 int vroot_fsio_chmod(pr_fs_t *fs, const char *path, mode_t mode);
41 int vroot_fsio_chown(pr_fs_t *fs, const char *path, uid_t uid, gid_t gid);
42 int vroot_fsio_lchown(pr_fs_t *fs, const char *path, uid_t uid, gid_t gid);
43 int vroot_fsio_chroot(pr_fs_t *fs, const char *path);
44 int vroot_fsio_chdir(pr_fs_t *fs, const char *path);
45 int vroot_fsio_utimes(pr_fs_t *fs, const char *path, struct timeval *tvs);
46 void *vroot_fsio_opendir(pr_fs_t *fs, const char *path);
47 struct dirent *vroot_fsio_readdir(pr_fs_t *fs, void *dirh);
48 int vroot_fsio_closedir(pr_fs_t *fs, void *dirh);
49 int vroot_fsio_mkdir(pr_fs_t *fs, const char *path, mode_t mode);
50 int vroot_fsio_rmdir(pr_fs_t *fs, const char *path);
51 
52 /* Internal use only. */
53 int vroot_fsio_init(pool *p);
54 int vroot_fsio_free(void);
55 
56 #endif /* MOD_VROOT_FSIO_H */
57