From c80f5647cbf162cdc128864fa18dbde3c72e0c45 Mon Sep 17 00:00:00 2001 From: Maxim Sobolev Date: Wed, 20 Feb 2002 07:47:06 +0000 Subject: [PATCH] Create /var/log/lastlog if it doesn't exist. Submitted by: des --- lib/libpam/modules/pam_lastlog/pam_lastlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libpam/modules/pam_lastlog/pam_lastlog.c b/lib/libpam/modules/pam_lastlog/pam_lastlog.c index 4a7c3df671c8..bf6ff5434c76 100644 --- a/lib/libpam/modules/pam_lastlog/pam_lastlog.c +++ b/lib/libpam/modules/pam_lastlog/pam_lastlog.c @@ -149,7 +149,7 @@ pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv) if (tty == NULL) PAM_RETURN(PAM_SERVICE_ERR); - fd = open(_PATH_LASTLOG, O_RDWR, 0); + fd = open(_PATH_LASTLOG, O_RDWR|O_CREAT, 0644); if (fd == -1) { syslog(LOG_ERR, "cannot open %s: %m", _PATH_LASTLOG); PAM_RETURN(PAM_SERVICE_ERR);