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 296816 Details for
Bug 410821
RFE: Support reloading fence_xvm{,d} key files on the fly
[?]
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 reloading via SIGHUP
fence_xvmd.diff (text/plain), 2.90 KB, created by
Ryan McCabe
on 2008-03-04 21:46:20 UTC
(
hide
)
Description:
patch for reloading via SIGHUP
Filename:
MIME Type:
Creator:
Ryan McCabe
Created:
2008-03-04 21:46:20 UTC
Size:
2.90 KB
patch
obsolete
>diff --git a/fence/agents/xvm/fence_xvm.c b/fence/agents/xvm/fence_xvm.c >index 4ce4693..8c8ce64 100644 >--- a/fence/agents/xvm/fence_xvm.c >+++ b/fence/agents/xvm/fence_xvm.c >@@ -219,7 +219,7 @@ int > fence_xen_domain(fence_xvm_args_t *args) > { > ip_list_t ipl; >- char key[4096]; >+ char key[MAX_KEY_LEN]; > int lfd, key_len = 0, fd; > int attempts = 0; > >diff --git a/fence/agents/xvm/fence_xvmd.c b/fence/agents/xvm/fence_xvmd.c >index 82f08f5..1280310 100644 >--- a/fence/agents/xvm/fence_xvmd.c >+++ b/fence/agents/xvm/fence_xvmd.c >@@ -57,6 +57,7 @@ > #define LIBVIRT_XEN_URI "xen:///" > > static int running = 1; >+static int reload_key; > > > int cleanup_xml(char *xmldesc, char **ret, size_t *retsz); >@@ -573,6 +574,27 @@ xvmd_loop(cman_handle_t ch, void *h, int fd, fence_xvm_args_t *args, > virConnectClose(vp); > vp = NULL; > } >+ >+ if (reload_key) { >+ char temp_key[MAX_KEY_LEN]; >+ int ret; >+ >+ reload_key = 0; >+ >+ ret = read_key_file(args->key_file, temp_key, sizeof(temp_key)); >+ if (ret < 0) { >+ printf("Could not read %s; not updating key", >+ args->key_file); >+ } else { >+ memcpy(key, temp_key, MAX_KEY_LEN); >+ key_len = (size_t) ret; >+ >+ if (args->auth == AUTH_NONE) >+ args->auth = AUTH_SHA256; >+ if (args->hash == HASH_NONE) >+ args->hash = HASH_SHA256; >+ } >+ } > > n = select(fd+1, &rfds, NULL, NULL, &tv); > if (n < 0) >@@ -678,6 +700,11 @@ sigint_handler(int sig) > running = 0; > } > >+void >+sighup_handler(int sig) >+{ >+ reload_key = 1; >+} > > void malloc_dump_table(void); > >@@ -687,7 +714,7 @@ main(int argc, char **argv) > { > fence_xvm_args_t args; > int mc_sock; >- char key[4096]; >+ char key[MAX_KEY_LEN]; > int key_len = 0, x; > char *my_options = "dfi:a:p:C:c:k:u?hLXV"; > cman_handle_t ch = NULL; >@@ -780,7 +807,6 @@ main(int argc, char **argv) > if (x) > printf("Checkpoint initialized\n"); > } >- > if (args.family == PF_INET) > mc_sock = ipv4_recv_sk(args.addr, args.port); > else >@@ -791,6 +817,7 @@ main(int argc, char **argv) > } > > >+ signal(SIGHUP, sighup_handler); > signal(SIGINT, sigint_handler); > signal(SIGTERM, sigint_handler); > signal(SIGQUIT, sigint_handler); >diff --git a/fence/agents/xvm/simple_auth.c b/fence/agents/xvm/simple_auth.c >index 0064e5c..7eb26ee 100644 >--- a/fence/agents/xvm/simple_auth.c >+++ b/fence/agents/xvm/simple_auth.c >@@ -390,6 +390,8 @@ read_key_file(char *file, char *key, size_t max_len) > while (remain) { > nread = read(fd, p, remain); > if (nread < 0) { >+ if (errno == EINTR) >+ continue; > dbg_printf(2, "Error from read: %s\n", strerror(errno)); > close(fd); > return -1; >diff --git a/fence/agents/xvm/xvm.h b/fence/agents/xvm/xvm.h >index bee9f3f..4272246 100644 >--- a/fence/agents/xvm/xvm.h >+++ b/fence/agents/xvm/xvm.h >@@ -59,6 +59,7 @@ typedef enum { > #define DEFAULT_TTL 4 > > #define MAX_HASH_LENGTH SHA512_LENGTH >+#define MAX_KEY_LEN 4096 > > typedef struct __attribute__ ((packed)) _fence_req { > uint8_t request; /* Fence request */
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 410821
: 296816