source
twoprocess.c
line
61 - 92
概要
vsf_two_process_start(struct vsf_session* p_sess)
処理の流れ
- /* Create the comms channel between privileged parent and no-priv child */
64 priv_sock_init(p_sess);
65 vsf_sysutil_install_async_sighandler(kVSFSysUtilSigCHLD, handle_sigchld);
66 {
67 int newpid = vsf_sysutil_fork();
68 if (newpid != 0)
69 {
70 /* Parent - go into pre-login parent process mode */
71 while (1)
72 {
73 process_login_req(p_sess);
74 }
75 }
76 }
- /* Child process - time to lose as much privilege as possible and do the login processing
80 if (tunable_local_enable && tunable_userlist_enable)
81 {
82 int retval = str_fileread(&p_sess->userlist_str, tunable_userlist_file,
83 VSFTP_CONF_FILE_MAX);
84 if (vsf_sysutil_retval_is_error(retval))
85 {
86 die2("cannot open user list file:", tunable_userlist_file);
87 }
88 }
89 drop_all_privs();
90 init_connection(p_sess);
function
61 vsf_two_process_start(struct vsf_session* p_sess)
62 {
63 /* Create the comms channel between privileged parent and no-priv child */
64 priv_sock_init(p_sess);
65 vsf_sysutil_install_async_sighandler(kVSFSysUtilSigCHLD, handle_sigchld);
66 {
67 int newpid = vsf_sysutil_fork();
68 if (newpid != 0)
69 {
70 /* Parent - go into pre-login parent process mode */
71 while (1)
72 {
73 process_login_req(p_sess);
74 }
75 }
76 }
77 /* Child process - time to lose as much privilege as possible and do the
78 * login processing
79 */
80 if (tunable_local_enable && tunable_userlist_enable)
81 {
82 int retval = str_fileread(&p_sess->userlist_str, tunable_userlist_file,
83 VSFTP_CONF_FILE_MAX);
84 if (vsf_sysutil_retval_is_error(retval))
85 {
86 die2("cannot open user list file:", tunable_userlist_file);
87 }
88 }
89 drop_all_privs();
90 init_connection(p_sess);
91 /* NOTREACHED */
92 }
最終更新:2009年02月22日 21:47