util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] lslogins: fix assertion failure for none existing logins
@ 2014-12-08 22:20 Sami Kerola
  2014-12-08 22:20 ` [PATCH 2/2] lslogins: align usage() and manual with struct option longopts Sami Kerola
  2014-12-09  8:23 ` [PATCH 1/2] lslogins: fix assertion failure for none existing logins Karel Zak
  0 siblings, 2 replies; 3+ messages in thread
From: Sami Kerola @ 2014-12-08 22:20 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

This cange makes the following to retun none-zero value instead of a core
dump.

$ lslogins qwertyuiopasdfghjklzxcvbnm1234567
lslogins: libsmartcols/src/line.c:362: scols_line_get_cell: Assertion `ln' failed.
Aborted (core dumped)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 login-utils/lslogins.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c
index 7867404..38d3cf6 100644
--- a/login-utils/lslogins.c
+++ b/login-utils/lslogins.c
@@ -842,7 +842,7 @@ static int get_user(struct lslogins_control *ctl, struct lslogins_user **user,
 		    const char *username)
 {
 	*user = get_user_info(ctl, username);
-	if (!*user && errno)
+	if (!*user)
 		if (IS_REAL_ERRNO(errno))
 			return -1;
 	return 0;
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] lslogins: align usage() and manual with struct option longopts
  2014-12-08 22:20 [PATCH 1/2] lslogins: fix assertion failure for none existing logins Sami Kerola
@ 2014-12-08 22:20 ` Sami Kerola
  2014-12-09  8:23 ` [PATCH 1/2] lslogins: fix assertion failure for none existing logins Karel Zak
  1 sibling, 0 replies; 3+ messages in thread
From: Sami Kerola @ 2014-12-08 22:20 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

Short option -G goes together with long option --supp-groups, while
neither of -m or --groups-info has worked in a release so remove them
from usage() and manual.

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

diff --git a/login-utils/lslogins.1 b/login-utils/lslogins.1
index 0a9e703..0dbeebd 100644
--- a/login-utils/lslogins.1
+++ b/login-utils/lslogins.1
@@ -31,7 +31,7 @@ Output data in the format of NAME=VALUE.
 \fB\-f\fR, \fB\-\-failed\fR
 Display data about the users' last failed login attempts.
 .TP
-\fB\-G\fR, \fB\-\-groups\-info\fR
+\fB\-G\fR, \fB\-\-supp\-groups\fR
 Show information about groups.
 .TP
 \fB\-g\fR, \fB\-\-groups\fR=\fIgroups\fR
@@ -48,9 +48,6 @@ Display data containing information about the users' last login sessions.
 Only show data of users with a login specified in \fIlogins\fR (user names or user
 IDS).  More than one login may be specified; the list has to be comma-separated.
 .TP
-\fB\-m\fR, \fB\-\-supp\-groups\fR
-Show supplementary groups.
-.TP
 \fB\-n\fR, \fB\-\-newline\fR
 Display each piece of information on a separate line.
 .TP
diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c
index 38d3cf6..abce949 100644
--- a/login-utils/lslogins.c
+++ b/login-utils/lslogins.c
@@ -1189,11 +1189,10 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
 	fputs(_(" -c, --colon-separate     display data in a format similar to /etc/passwd\n"), out);
 	fputs(_(" -e, --export             display in an export-able output format\n"), out);
 	fputs(_(" -f, --failed             display data about the users' last failed logins\n"), out);
-	fputs(_(" -G, --groups-info        display information about groups\n"), out);
+	fputs(_(" -G, --supp-groups        display information about groups\n"), out);
 	fputs(_(" -g, --groups=<groups>    display users belonging to a group in <groups>\n"), out);
 	fputs(_(" -L, --last               show info about the users' last login sessions\n"), out);
 	fputs(_(" -l, --logins=<logins>    display only users from <logins>\n"), out);
-	fputs(_(" -m, --supp-groups        display supplementary groups as well\n"), out);
 	fputs(_(" -n, --newline            display each piece of information on a new line\n"), out);
 	fputs(_("     --noheadings         don't print headings\n"), out);
 	fputs(_("     --notruncate         don't truncate output\n"), out);
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] lslogins: fix assertion failure for none existing logins
  2014-12-08 22:20 [PATCH 1/2] lslogins: fix assertion failure for none existing logins Sami Kerola
  2014-12-08 22:20 ` [PATCH 2/2] lslogins: align usage() and manual with struct option longopts Sami Kerola
@ 2014-12-09  8:23 ` Karel Zak
  1 sibling, 0 replies; 3+ messages in thread
From: Karel Zak @ 2014-12-09  8:23 UTC (permalink / raw)
  To: Sami Kerola; +Cc: util-linux

On Mon, Dec 08, 2014 at 10:20:55PM +0000, Sami Kerola wrote:
>  login-utils/lslogins.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

 All 2 patches applied.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-09  8:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-08 22:20 [PATCH 1/2] lslogins: fix assertion failure for none existing logins Sami Kerola
2014-12-08 22:20 ` [PATCH 2/2] lslogins: align usage() and manual with struct option longopts Sami Kerola
2014-12-09  8:23 ` [PATCH 1/2] lslogins: fix assertion failure for none existing logins Karel Zak

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).