util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: Sami Kerola <kerolasa@iki.fi>
Subject: [PATCH 07/16] lslogins: use hardcoded paths from pathnames.h
Date: Sun, 14 Dec 2014 17:44:03 +0000	[thread overview]
Message-ID: <1418579052-29386-8-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1418579052-29386-1-git-send-email-kerolasa@iki.fi>

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 include/pathnames.h    | 1 +
 login-utils/lslogins.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/pathnames.h b/include/pathnames.h
index 1cc4e15..0d21b98 100644
--- a/include/pathnames.h
+++ b/include/pathnames.h
@@ -38,6 +38,7 @@
 #endif
 #define	_PATH_MOTDFILE		"/etc/motd"
 #define	_PATH_NOLOGIN		"/etc/nologin"
+#define	_PATH_VAR_NOLOGIN	"/var/run/nologin"
 
 #define _PATH_LOGIN		"/bin/login"
 #define _PATH_INITTAB		"/etc/inittab"
diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c
index 14a0749..85ae8f5 100644
--- a/login-utils/lslogins.c
+++ b/login-utils/lslogins.c
@@ -688,8 +688,8 @@ static struct lslogins_user *get_user_info(struct lslogins_control *ctl, const c
 			if (strstr(pwd->pw_shell, "nologin"))
 				user->nologin = 1;
 			else if (pwd->pw_uid)
-				user->nologin = access("/etc/nologin", F_OK) == 0 ||
-						access("/var/run/nologin", F_OK) == 0;
+				user->nologin = access(_PATH_NOLOGIN, F_OK) == 0 ||
+						access(_PATH_VAR_NOLOGIN, F_OK) == 0;
 			break;
 		case COL_PWD_WARN:
 			if (shadow && shadow->sp_warn >= 0)
-- 
2.1.3


  parent reply	other threads:[~2014-12-14 17:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-14 17:43 [PATCH 00/16] pull: updates to lslogins and chfn Sami Kerola
2014-12-14 17:43 ` [PATCH 01/16] lslogins: allow changing password changed and expiration time formats Sami Kerola
2014-12-14 17:43 ` [PATCH 02/16] lslogins: make journald last logs time stamps to honor --time-format Sami Kerola
2014-12-14 17:43 ` [PATCH 03/16] lslogins: tell why command failed Sami Kerola
2014-12-14 17:44 ` [PATCH 04/16] lslogins: fix short options Sami Kerola
2014-12-14 17:44 ` [PATCH 05/16] lslogins: reject unknown time format arguments Sami Kerola
2014-12-15  9:28   ` Karel Zak
2014-12-19  9:30     ` Sami Kerola
2014-12-14 17:44 ` [PATCH 06/16] lslogins: add space to systemd journal header and message Sami Kerola
2014-12-14 17:44 ` Sami Kerola [this message]
2014-12-14 17:44 ` [PATCH 08/16] chfn: remove function prototypes Sami Kerola
2014-12-14 17:44 ` [PATCH 09/16] chfn: rewrite prompt() to use strutils Sami Kerola
2014-12-14 17:44 ` [PATCH 10/16] chfn: use xasprintf() rather than bunch of strlen() and malloc() calls Sami Kerola
2014-12-14 17:44 ` [PATCH 11/16] chfn: fix usage() regression Sami Kerola
2014-12-14 17:44 ` [PATCH 12/16] chfn: simplify parse_passwd() by using strsep() Sami Kerola
2014-12-14 17:44 ` [PATCH 13/16] chfn: add minimalistic struct chfn_control Sami Kerola
2014-12-14 17:44 ` [PATCH 14/16] chfn: clean up parse_argv() Sami Kerola
2014-12-15  9:45   ` Karel Zak
2014-12-14 17:44 ` [PATCH 15/16] chfn: move new and old finger structs to chfn control struct Sami Kerola
2014-12-15 10:07   ` Karel Zak
2014-12-19  9:41     ` Sami Kerola
2014-12-14 17:44 ` [PATCH 16/16] chfn: make command to obey login.defs CHFN_RESTRICT instructions Sami Kerola
2014-12-15 10:11   ` Karel Zak
2014-12-19 13:30 ` [PATCH 00/16] pull: updates to lslogins and chfn Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1418579052-29386-8-git-send-email-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).