Skip to content

Commit

Permalink
Jettisoning the long-unused FS match code, along with the unused crea…
Browse files Browse the repository at this point in the history
…t(2)

hooks.
  • Loading branch information
Castaglia committed Apr 19, 2016
1 parent ae8dc72 commit 6bd634a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 536 deletions.
51 changes: 2 additions & 49 deletions include/fsio.h
Expand Up @@ -44,7 +44,7 @@
#define FSIO_FILE_RENAME (1 << 2)
#define FSIO_FILE_UNLINK (1 << 3)
#define FSIO_FILE_OPEN (1 << 4)
#define FSIO_FILE_CREAT (1 << 5)
/* Was FSIO_FILE_CREAT, now unused */
#define FSIO_FILE_CLOSE (1 << 6)
#define FSIO_FILE_READ (1 << 7)
#define FSIO_FILE_WRITE (1 << 8)
Expand All @@ -59,7 +59,7 @@

/* Macro that defines the most common file ops */
#define FSIO_FILE_COMMON (FSIO_FILE_OPEN|FSIO_FILE_READ|FSIO_FILE_WRITE|\
FSIO_FILE_CLOSE|FSIO_FILE_CREAT)
FSIO_FILE_CLOSE)

#define FSIO_DIR_CHROOT (1 << 16)
#define FSIO_DIR_CHDIR (1 << 17)
Expand Down Expand Up @@ -108,7 +108,6 @@ struct fs_rec {
int (*rename)(pr_fs_t *, const char *, const char *);
int (*unlink)(pr_fs_t *, const char *);
int (*open)(pr_fh_t *, const char *, int);
int (*creat)(pr_fh_t *, const char *, mode_t);
int (*close)(pr_fh_t *, int);
int (*read)(pr_fh_t *, int, char *, size_t);
int (*write)(pr_fh_t *, int, const char *, size_t);
Expand Down Expand Up @@ -195,40 +194,6 @@ struct fh_rec {
*/
#define PR_FH_FD(f) ((f)->fh_fd)

#if defined(PR_USE_REGEX) && defined(PR_FS_MATCH)
typedef struct fs_match_rec pr_fs_match_t;
struct fs_match_rec {

pr_fs_match_t *fsm_next, *fsm_prev;

/* pool for this object's use */
pool *fsm_pool;

/* descriptive tag for this fs regex */
char *fsm_name;

/* mask of the fs operations to which this regex should apply */
int fsm_opmask;

/* string containing the match pattern */
char *fsm_pattern;

/* compiled pattern (regex) */
regex_t *fsm_regex;

/* "trigger" function to be called whenever a path that matches the
* compiled regex is given.
*/
int (*trigger)(pr_fh_t *, const char *, int);

/* NOTE: need some way of keeping track of the pr_fs_t registered by
* an fs_match's trigger function, such that when an fs_match is
* removed, its registered pr_fs_t's are removed as well.
*/
array_header *fsm_fs_objs;
};
#endif /* PR_USE_REGEX and PR_FS_MATCH */

int pr_fsio_stat(const char *, struct stat *);
int pr_fsio_stat_canon(const char *, struct stat *);
int pr_fsio_fstat(pr_fh_t *, struct stat *);
Expand All @@ -250,8 +215,6 @@ int pr_fsio_unlink(const char *);
int pr_fsio_unlink_canon(const char *);
pr_fh_t *pr_fsio_open(const char *, int);
pr_fh_t *pr_fsio_open_canon(const char *, int);
pr_fh_t *pr_fsio_creat(const char *, mode_t);
pr_fh_t *pr_fsio_creat_canon(const char *, mode_t);
int pr_fsio_close(pr_fh_t *);
int pr_fsio_read(pr_fh_t *, char *, size_t);
int pr_fsio_write(pr_fh_t *, const char *, size_t);
Expand Down Expand Up @@ -304,16 +267,6 @@ pr_fs_t *pr_remove_fs(const char *);
pr_fs_t *pr_unmount_fs(const char *, const char *);
int pr_unregister_fs(const char *);

#if defined(PR_USE_REGEX) && defined(PR_FS_MATCH)
pr_fs_match_t *pr_register_fs_match(pool *, const char *, const char *, int);
void pr_associate_fs(pr_fs_match_t *, pr_fs_t *);
pr_fs_match_t *pr_create_fs_match(pool *, const char *, const char *, int);
pr_fs_match_t *pr_get_fs_match(const char *, int);
pr_fs_match_t *pr_get_next_fs_match(pr_fs_match_t *, const char *, int);
int pr_insert_fs_match(pr_fs_match_t *);
int pr_unregister_fs_match(const char *);
#endif /* PR_USE_REGEX and PR_FS_MATCH */

/* FS Statcache API */
void pr_fs_clear_cache(void);
int pr_fs_clear_cache2(const char *path);
Expand Down
1 change: 0 additions & 1 deletion modules/mod_auth.c
Expand Up @@ -2826,7 +2826,6 @@ MODRET auth_pre_retr(cmd_rec *cmd) {

/* For all other FSIO callbacks, use the underlying FS. */
robots_fs->rename = curr_fs->rename;
robots_fs->creat = curr_fs->creat;
robots_fs->lseek = curr_fs->lseek;
robots_fs->link = curr_fs->link;
robots_fs->readlink = curr_fs->readlink;
Expand Down

0 comments on commit 6bd634a

Please sign in to comment.