Create /var/log/lastlog if it doesn't exist.

Submitted by:	des
This commit is contained in:
Maxim Sobolev 2002-02-20 07:47:06 +00:00
parent d5c6e8dee0
commit c80f5647cb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90955

View file

@ -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);