]> git.armaanb.net Git - opendoas.git/blobdiff - pam.c
use config.h and link objects instead of libopenbsd.a
[opendoas.git] / pam.c
diff --git a/pam.c b/pam.c
index ccebd0fe98105499e81555bd5d15b3335cec3258..ee02b0faab8fa43d7c48e28d2f9cf569e9d2b82f 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 "includes.h"
 
+#ifndef HOST_NAME_MAX
+#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
+#endif
+
 #define PAM_SERVICE_NAME "doas"
 
 static pam_handle_t *pamh = NULL;
@@ -271,9 +277,6 @@ pamauth(const char *user, const char *myname, int interactive, int nopass, int p
                if (!interactive)
                        errx(1, "Authorization required");
 
-#ifndef HOST_NAME_MAX
-#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
-#endif
                /* doas style prompt for pam */
                char host[HOST_NAME_MAX + 1];
                if (gethostname(host, sizeof(host)))