1#ifndef VSF_PRIVOPS_H
2#define VSF_PRIVOPS_H
3
4struct mystr;
5struct vsf_session;
6
7/* vsf_privop_get_ftp_port_sock()
8 * PURPOSE
9 * Return a network socket bound to a privileged port (less than 1024).
10 * PARAMETERS
11 * p_sess       - the current session object
12 * RETURNS
13 * A file descriptor which is a socket bound to the privileged port.
14 */
15int vsf_privop_get_ftp_port_sock(struct vsf_session* p_sess);
16
17/* vsf_privop_do_file_chown()
18 * PURPOSE
19 * Takes a file owned by the unprivileged FTP user, and change the ownership
20 * to the value defined in the config file.
21 * PARAMETERS
22 * p_sess       - the current session object
23 * fd           - the file descriptor of the regular file
24 */
25void vsf_privop_do_file_chown(struct vsf_session* p_sess, int fd);
26
27enum EVSFPrivopLoginResult
28{
29  kVSFLoginNull = 0,
30  kVSFLoginFail,
31  kVSFLoginAnon,
32  kVSFLoginReal
33};
34/* vsf_privop_do_login()
35 * PURPOSE
36 * Check if the supplied username/password combination is valid. This
37 * interface caters for checking both anonymous and real logins.
38 * PARAMETERS
39 * p_sess       - the current session object
40 * p_pass_str   - the proposed password
41 * RETURNS
42 * kVSFLoginFail - access denied
43 * kVSFLoginAnon - anonymous login credentials OK
44 * kVSFLoginReal - real login credentials OK
45 */
46enum EVSFPrivopLoginResult vsf_privop_do_login(
47  struct vsf_session* p_sess, const struct mystr* p_pass_str);
48
49#endif /* VSF_PRIVOPS_H */
50
51