__format__ attribute on top).
Also properly ignore SIGHUP in the child processes.
OK jmatthew@
-/* $OpenBSD: entries.c,v 1.5 2022/02/05 22:59:58 naddy Exp $ */
+/* $OpenBSD: entries.c,v 1.6 2023/07/18 13:06:33 claudio Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
*
#include <limits.h>
#include "ypldap.h"
+#include "log.h"
void
flatten_entries(struct env *env)
-/* $OpenBSD: ldapclient.c,v 1.48 2023/05/22 05:59:05 jmatthew Exp $ */
+/* $OpenBSD: ldapclient.c,v 1.49 2023/07/18 13:06:33 claudio Exp $ */
/*
* Copyright (c) 2008 Alexander Schrijver <aschrijver@openbsd.org>
case SIGTERM:
client_shutdown();
break;
+ case SIGHUP:
+ /* ingore */
+ break;
default:
fatalx("unexpected signal");
}
struct passwd *pw;
struct event ev_sigint;
struct event ev_sigterm;
+ struct event ev_sighup;
struct env env;
switch (pid = fork()) {
signal(SIGPIPE, SIG_IGN);
signal_set(&ev_sigint, SIGINT, client_sig_handler, NULL);
signal_set(&ev_sigterm, SIGTERM, client_sig_handler, NULL);
+ signal_set(&ev_sighup, SIGHUP, client_sig_handler, NULL);
signal_add(&ev_sigint, NULL);
signal_add(&ev_sigterm, NULL);
+ signal_add(&ev_sighup, NULL);
close(pipe_main2client[0]);
if ((env.sc_iev = calloc(1, sizeof(*env.sc_iev))) == NULL)
-/* $OpenBSD: parse.y,v 1.36 2022/10/13 04:55:33 jmatthew Exp $ */
+/* $OpenBSD: parse.y,v 1.37 2023/07/18 13:06:33 claudio Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
#include <unistd.h>
#include "ypldap.h"
+#include "log.h"
TAILQ_HEAD(files, file) files = TAILQ_HEAD_INITIALIZER(files);
static struct file {
-/* $OpenBSD: yp.c,v 1.21 2022/08/19 03:50:32 jmatthew Exp $ */
+/* $OpenBSD: yp.c,v 1.22 2023/07/18 13:06:33 claudio Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
*
#include <rpcsvc/ypclnt.h>
#include "ypldap.h"
+#include "log.h"
#define BINDINGDIR "/var/yp/binding"
-/* $OpenBSD: ypldap.h,v 1.23 2022/10/13 04:55:33 jmatthew Exp $ */
+/* $OpenBSD: ypldap.h,v 1.24 2023/07/18 13:06:33 claudio Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
int update_trashed;
};
-/* log.c */
-void log_init(int);
-void log_warn(const char *, ...);
-void log_warnx(const char *, ...);
-void log_info(const char *, ...);
-void log_debug(const char *, ...);
-void logit(int, const char *, ...);
-void vlog(int, const char *, va_list);
-__dead void fatal(const char *);
-__dead void fatalx(const char *);
-
/* parse.y */
int parse_config(struct env *, const char *, int);
int cmdline_symset(char *);
-/* $OpenBSD: ypldap_dns.c,v 1.15 2022/08/23 02:57:27 jmatthew Exp $ */
+/* $OpenBSD: ypldap_dns.c,v 1.16 2023/07/18 13:06:33 claudio Exp $ */
/*
* Copyright (c) 2003-2008 Henning Brauer <henning@openbsd.org>
#include <limits.h>
#include "ypldap.h"
+#include "log.h"
volatile sig_atomic_t quit_dns = 0;
struct imsgev *iev_dns;
case SIGTERM:
dns_shutdown();
break;
+ case SIGHUP:
+ /* ignore */
+ break;
default:
fatalx("unexpected signal");
}
pid_t
ypldap_dns(int pipe_ntp[2], struct passwd *pw)
{
- pid_t pid;
+ pid_t pid;
struct event ev_sigint;
struct event ev_sigterm;
struct event ev_sighup;