00001 #ifndef VSF_PRIVOPS_H 00002 #define VSF_PRIVOPS_H 00003 00004 struct mystr; 00005 struct vsf_session; 00006 00007 /* vsf_privop_get_ftp_port_sock() 00008 * PURPOSE 00009 * Return a network socket bound to a privileged port (less than 1024). 00010 * PARAMETERS 00011 * p_sess - the current session object 00012 * RETURNS 00013 * A file descriptor which is a socket bound to the privileged port. 00014 */ 00015 int vsf_privop_get_ftp_port_sock(struct vsf_session* p_sess); 00016 00017 /* vsf_privop_do_file_chown() 00018 * PURPOSE 00019 * Takes a file owned by the unprivileged FTP user, and change the ownership 00020 * to the value defined in the config file. 00021 * PARAMETERS 00022 * p_sess - the current session object 00023 * fd - the file descriptor of the regular file 00024 */ 00025 void vsf_privop_do_file_chown(struct vsf_session* p_sess, int fd); 00026 00027 enum EVSFPrivopLoginResult 00028 { 00029 kVSFLoginNull = 0, 00030 kVSFLoginFail, 00031 kVSFLoginAnon, 00032 kVSFLoginReal 00033 }; 00034 /* vsf_privop_do_login() 00035 * PURPOSE 00036 * Check if the supplied username/password combination is valid. This 00037 * interface caters for checking both anonymous and real logins. 00038 * PARAMETERS 00039 * p_sess - the current session object 00040 * p_pass_str - the proposed password 00041 * RETURNS 00042 * kVSFLoginFail - access denied 00043 * kVSFLoginAnon - anonymous login credentials OK 00044 * kVSFLoginReal - real login credentials OK 00045 */ 00046 enum EVSFPrivopLoginResult vsf_privop_do_login( 00047 struct vsf_session* p_sess, const struct mystr* p_pass_str); 00048 00049 #endif /* VSF_PRIVOPS_H */ 00050