]> git.armaanb.net Git - opendoas.git/blobdiff - pam.c
remove includes.h and move the prototypes to doas.h
[opendoas.git] / pam.c
diff --git a/pam.c b/pam.c
index e0f17a536012b6bca3bccad1f2a74a2f0458326c..c6f63f2f516dbdfd181da204db9e302b50a6fecd 100644 (file)
--- a/pam.c
+++ b/pam.c
@@ -14,6 +14,8 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include "config.h"
+
 #include <sys/types.h>
 #include <sys/wait.h>
 
 #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>
 
 #include <security/pam_appl.h>
 
-#include "includes.h"
+#include "openbsd.h"
+#include "doas.h"
+
+#ifndef HOST_NAME_MAX
+#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
+#endif
 
 #define PAM_SERVICE_NAME "doas"
 
@@ -323,8 +330,13 @@ pamauth(const char *user, const char *myname, int interactive, int nopass, int p
        }
 
        /* return as child */
-       if (child == 0)
+       if (child == 0) {
+#ifdef USE_TIMESTAMP
+               if (fd != -1)
+                       close(fd);
+#endif
                return;
+       }
 
 #ifdef USE_TIMESTAMP
        if (fd != -1) {