commit 22b68970dd6a3f5018bbf3e68a5f9e35d5948c2e
parent a3264b9072fa61ac1a834445d6b2d80860f58435
Author: Duncan Overbruck <mail@duncano.de>
Date: Thu, 12 Nov 2020 16:15:04 +0100
libopenbsd: clean up readpassphrase compat and fix ifdefs
Diffstat:
5 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/includes.h b/includes.h
@@ -1,11 +1,6 @@
#ifndef INCLUDES_H
#define INCLUDES_H
-#ifndef _PATH_TTY
-# define _PATH_TTY "/dev/tty"
-#endif
-
-
#include "openbsd.h"
#ifdef USE_PAM
diff --git a/libopenbsd/readpassphrase.c b/libopenbsd/readpassphrase.c
@@ -31,10 +31,16 @@
#include <signal.h>
#include <ctype.h>
#include <fcntl.h>
-#include <readpassphrase.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
+#include <paths.h>
+
+#include "sys-readpassphrase.h"
+
+#ifndef _PATH_TTY
+#define _PATH_TTY "/dev/tty"
+#endif
#ifndef TCSASOFT
/* If we don't have TCSASOFT define it so that ORing it it below is a no-op. */
diff --git a/libopenbsd/readpassphrase.h b/libopenbsd/sys-readpassphrase.h
diff --git a/pam.c b/pam.c
@@ -23,10 +23,10 @@
#include <errno.h>
#include <limits.h>
#include <pwd.h>
-#ifdef HAVE_READPASSPHRASE_H
+#ifdef HAVE_READPASSPHRASE
# include <readpassphrase.h>
#else
-# include "readpassphrase.h"
+# include "sys-readpassphrase.h"
#endif
#include <signal.h>
#include <stdio.h>
diff --git a/shadow.c b/shadow.c
@@ -23,10 +23,10 @@
#include <errno.h>
#include <limits.h>
#include <pwd.h>
-#ifdef HAVE_READPASSPHRASE_H
+#ifdef HAVE_READPASSPHRASE
# include <readpassphrase.h>
#else
-# include "readpassphrase.h"
+# include "sys-readpassphrase.h"
#endif
#include <shadow.h>
#include <stdio.h>