1 #ifndef VSF_TWOPROCESS_H
2 #define VSF_TWOPROCESS_H
7 /* vsf_two_process_start()
9 * Called to start FTP login processing using the two process model. This
10 * launches the unprivileged child to process the FTP login.
12 * p_sess - the current session object
14 void vsf_two_process_start(struct vsf_session
* p_sess
);
16 /* vsf_two_process_login()
18 * Called to propose a login using the two process model.
20 * p_sess - the current session object
21 * p_pass_str - the proposed password
23 void vsf_two_process_login(struct vsf_session
* p_sess
,
24 const struct mystr
* p_pass_str
);
26 /* vsf_two_process_get_priv_data_sock()
28 * Get a privileged port 20 bound data socket using the two process model.
30 * p_sess - the current session object
32 * The file descriptor of the privileged socket
34 int vsf_two_process_get_priv_data_sock(struct vsf_session
* p_sess
);
36 /* vsf_two_process_pasv_cleanup()
38 * Clean up any listening passive socket in the privileged side.
40 * p_sess - the current session object
42 void vsf_two_process_pasv_cleanup(struct vsf_session
* p_sess
);
44 /* vsf_two_process_pasv_active()
46 * Determine if the passive socket is listening on the privileged side.
48 * p_sess - the current session object
50 * 1 if active, 0 if not.
52 int vsf_two_process_pasv_active(struct vsf_session
* p_sess
);
54 /* vsf_two_process_listen()
56 * Start listening for an incoming connection on the passive socket in the
59 * p_sess - the current session object
61 * The port we listened on.
63 unsigned short vsf_two_process_listen(struct vsf_session
* p_sess
);
65 /* vsf_two_process_get_pasv_fd()
67 * Accept an incoming connection on the passive socket in the privileged
70 * p_sess - the current session object
72 * The file descriptor for the incoming connection.
74 int vsf_two_process_get_pasv_fd(struct vsf_session
* p_sess
);
76 /* vsf_two_process_chown_upload()
78 * Change ownership of an uploaded file using the two process model.
80 * p_sess - the current session object
81 * fd - the file descriptor to change ownership on
83 void vsf_two_process_chown_upload(struct vsf_session
* p_sess
, int fd
);
85 #endif /* VSF_TWOPROCESS_H */