Temporary fix for high-priority iprop issues
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
This commit is contained in:

committed by
Love Hornquist Astrand

parent
435c02fa26
commit
72f0690694
@@ -32,9 +32,27 @@
|
||||
*/
|
||||
|
||||
#include "kadm5_locl.h"
|
||||
#include <fcntl.h>
|
||||
|
||||
RCSID("$Id$");
|
||||
|
||||
#ifndef O_NONBLOCK
|
||||
#define NBLK FNDELAY
|
||||
#else
|
||||
#define NBLK O_NONBLOCK
|
||||
#endif
|
||||
|
||||
static int non_blocking(int fd, int on)
|
||||
{
|
||||
int flags;
|
||||
|
||||
if ((flags = fcntl(fd, F_GETFL, 0)) < 0)
|
||||
return -1;
|
||||
if (fcntl(fd, F_SETFL, on ? flags | NBLK : flags & ~NBLK) < 0)
|
||||
return -1;
|
||||
return ((flags & NBLK) != 0);
|
||||
}
|
||||
|
||||
|
||||
static kadm5_ret_t
|
||||
kadm5_s_init_with_context(krb5_context context,
|
||||
@@ -92,6 +110,8 @@ kadm5_s_init_with_context(krb5_context context,
|
||||
ctx->log_context.socket_info->ai_protocol);
|
||||
#endif
|
||||
|
||||
non_blocking(ctx->log_context.socket_fd, 1);
|
||||
|
||||
ret = krb5_parse_name(ctx->context, client_name, &ctx->caller);
|
||||
if(ret)
|
||||
return ret;
|
||||
|
@@ -675,7 +675,9 @@ send_diffs (krb5_context context, slave *s, int log_fd,
|
||||
if (s->flags & SLAVE_F_DEAD)
|
||||
return 0;
|
||||
|
||||
flock(log_fd, LOCK_SH);
|
||||
sp = kadm5_log_goto_end (log_fd);
|
||||
flock(log_fd, LOCK_UN);
|
||||
right = krb5_storage_seek(sp, 0, SEEK_CUR);
|
||||
for (;;) {
|
||||
ret = kadm5_log_previous (context, sp, &ver, ×tamp, &op, &len);
|
||||
@@ -1050,7 +1052,9 @@ main(int argc, char **argv)
|
||||
signal_fd = make_signal_socket (context);
|
||||
listen_fd = make_listen_socket (context, port_str);
|
||||
|
||||
flock(log_fd, LOCK_SH);
|
||||
kadm5_log_get_version_fd (log_fd, ¤t_version);
|
||||
flock(log_fd, LOCK_UN);
|
||||
|
||||
krb5_warnx(context, "ipropd-master started at version: %lu",
|
||||
(unsigned long)current_version);
|
||||
@@ -1091,7 +1095,9 @@ main(int argc, char **argv)
|
||||
|
||||
if (ret == 0) {
|
||||
old_version = current_version;
|
||||
flock(log_fd, LOCK_SH);
|
||||
kadm5_log_get_version_fd (log_fd, ¤t_version);
|
||||
flock(log_fd, LOCK_UN);
|
||||
|
||||
if (current_version > old_version) {
|
||||
krb5_warnx(context,
|
||||
@@ -1122,7 +1128,9 @@ main(int argc, char **argv)
|
||||
--ret;
|
||||
assert(ret >= 0);
|
||||
old_version = current_version;
|
||||
flock(log_fd, LOCK_SH);
|
||||
kadm5_log_get_version_fd (log_fd, ¤t_version);
|
||||
flock(log_fd, LOCK_UN);
|
||||
if (current_version > old_version) {
|
||||
krb5_warnx(context,
|
||||
"Got a signal, updating slaves %lu to %lu",
|
||||
|
@@ -759,9 +759,12 @@ main(int argc, char **argv)
|
||||
else
|
||||
krb5_err (context, 1, errno, "select");
|
||||
}
|
||||
if (ret == 0)
|
||||
krb5_errx (context, 1, "server didn't send a message "
|
||||
if (ret == 0) {
|
||||
krb5_warn (context, 1, "server didn't send a message "
|
||||
"in %d seconds", time_before_lost);
|
||||
connected = FALSE;
|
||||
continue;
|
||||
}
|
||||
|
||||
ret = krb5_read_priv_message(context, auth_context, &master_fd, &out);
|
||||
if (ret) {
|
||||
|
Reference in New Issue
Block a user