Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 304379 Details for
Bug 185635
"service vsftpd stop" not stopping all vsftpd processes
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch for vsftpd
vsftpd-2.0.6-kill_children.patch (text/plain), 4.29 KB, created by
Martin Nagy
on 2008-05-02 12:40:52 UTC
(
hide
)
Description:
Patch for vsftpd
Filename:
MIME Type:
Creator:
Martin Nagy
Created:
2008-05-02 12:40:52 UTC
Size:
4.29 KB
patch
obsolete
>diff -up vsftpd-2.0.6/sysutil.c.kill_children vsftpd-2.0.6/sysutil.c >--- vsftpd-2.0.6/sysutil.c.kill_children 2008-05-02 14:21:47.000000000 +0200 >+++ vsftpd-2.0.6/sysutil.c 2008-05-02 14:21:47.000000000 +0200 >@@ -291,6 +291,15 @@ vsf_sysutil_unblock_sig(const enum EVSFS > die("sigprocmask"); > } > } >+ >+int >+vsf_sysutil_kill(const int pid, const enum EVSFSysUtilSignal sig) >+{ >+ int realsig; >+ realsig = vsf_sysutil_translate_sig(sig); >+ return kill(pid, realsig); >+} >+ > void > vsf_sysutil_install_io_handler(vsf_context_io_t handler, void* p_private) > { >diff -up vsftpd-2.0.6/hash.c.kill_children vsftpd-2.0.6/hash.c >--- vsftpd-2.0.6/hash.c.kill_children 2008-02-02 02:30:41.000000000 +0100 >+++ vsftpd-2.0.6/hash.c 2008-05-02 14:27:17.000000000 +0200 >@@ -145,3 +145,39 @@ hash_get_node_by_key(struct hash* p_hash > return p_node; > } > >+/* >+ * Get first available key occuring afther p_key, or the first one if p_key == 0 >+ */ >+void* >+hash_get_key_after(struct hash* p_hash, void *p_key) >+{ >+ int i; >+ struct hash_node *p_node; >+ unsigned int bucket = 0; >+ if (p_key != 0) >+ { >+ p_node = hash_get_node_by_key(p_hash, p_key); >+ if (p_node != 0 && p_node->p_next != 0) >+ { >+ return p_node->p_next->p_key; >+ } >+ bucket = (*p_hash->hash_func)(p_hash->buckets, p_key); >+ if (bucket >= p_hash->buckets) >+ { >+ bug("bad bucket lookup"); >+ } >+ if (p_node != 0) >+ { >+ bucket++; >+ } >+ } >+ for (i = bucket; i < p_hash->buckets; i++) >+ { >+ p_node = p_hash->p_nodes[i]; >+ if (p_node) >+ { >+ return p_node->p_key; >+ } >+ } >+ return 0; >+} >diff -up vsftpd-2.0.6/hash.h.kill_children vsftpd-2.0.6/hash.h >--- vsftpd-2.0.6/hash.h.kill_children 2008-02-02 02:30:41.000000000 +0100 >+++ vsftpd-2.0.6/hash.h 2008-05-02 14:21:47.000000000 +0200 >@@ -10,6 +10,7 @@ struct hash* hash_alloc(unsigned int buc > void* hash_lookup_entry(struct hash* p_hash, void* p_key); > void hash_add_entry(struct hash* p_hash, void* p_key, void* p_value); > void hash_free_entry(struct hash* p_hash, void* p_key); >+void* hash_get_key_after(struct hash* p_hash, void* p_key); > > #endif /* VSFTP_HASH_H */ > >diff -up vsftpd-2.0.6/sysutil.h.kill_children vsftpd-2.0.6/sysutil.h >--- vsftpd-2.0.6/sysutil.h.kill_children 2008-05-02 14:21:47.000000000 +0200 >+++ vsftpd-2.0.6/sysutil.h 2008-05-02 14:21:47.000000000 +0200 >@@ -52,6 +52,7 @@ void vsf_sysutil_check_pending_actions( > const enum EVSFSysUtilInterruptContext context, int retval, int fd); > void vsf_sysutil_block_sig(const enum EVSFSysUtilSignal sig); > void vsf_sysutil_unblock_sig(const enum EVSFSysUtilSignal sig); >+int vsf_sysutil_kill(const int pid, const enum EVSFSysUtilSignal sig); > > /* Alarm setting/clearing utility functions */ > void vsf_sysutil_set_alarm(const unsigned int trigger_seconds); >diff -up vsftpd-2.0.6/standalone.c.kill_children vsftpd-2.0.6/standalone.c >--- vsftpd-2.0.6/standalone.c.kill_children 2008-05-02 14:21:47.000000000 +0200 >+++ vsftpd-2.0.6/standalone.c 2008-05-02 14:29:58.000000000 +0200 >@@ -26,6 +26,7 @@ static unsigned int s_ipaddr_size; > > static void handle_sigchld(int duff); > static void handle_sighup(int duff); >+static void handle_sigterm(int duff); > static void prepare_child(int sockfd); > static unsigned int handle_ip_count(void* p_raw_addr); > static void drop_ip_count(void* p_raw_addr); >@@ -79,6 +80,7 @@ vsf_standalone_main(void) > } > vsf_sysutil_install_async_sighandler(kVSFSysUtilSigCHLD, handle_sigchld); > vsf_sysutil_install_async_sighandler(kVSFSysUtilSigHUP, handle_sighup); >+ vsf_sysutil_install_sighandler(kVSFSysUtilSigTERM, handle_sigterm, 0); > if (tunable_listen) > { > struct vsf_sysutil_sockaddr* p_sockaddr = 0; >@@ -173,6 +175,7 @@ vsf_standalone_main(void) > else > { > /* Child context */ >+ vsf_sysutil_default_sig(kVSFSysUtilSigTERM); > vsf_sysutil_close(listen_sock); > prepare_child(new_client_sock); > /* By returning here we "launch" the child process with the same >@@ -249,6 +252,20 @@ handle_sighup(int duff) > vsf_parseconf_load_file(0, 0); > } > >+static void >+handle_sigterm(int duff) >+{ >+ void* key = 0; >+ int pid; >+ (void) duff; >+ while ((key = hash_get_key_after(s_p_pid_ip_hash, key)) != 0) >+ { >+ pid = *(int*) key; >+ vsf_sysutil_kill(-pid, kVSFSysUtilSigTERM); >+ } >+ vsf_sysutil_exit(0); >+} >+ > static unsigned int > hash_ip(unsigned int buckets, void* p_key) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 185635
:
126227
| 304379