tags 349560 upstream patch
forwarded 349560 Tomasz Kłoczko <[EMAIL PROTECTED]>
thanks

On Mon, Jan 23, 2006 at 10:57:05PM +0800, [EMAIL PROTECTED] wrote:
> 
> Perhaps die with error instead of ignoring (any=illegal) arguments:
> $ lastlog|sum
> 26395     3
> $ lastlog dfa adfadf|sum
> 26395     3

Tomasz,
The attached patch fixes this bug.

Do you think it should be applied?

I think other shadow utilities should be fixed. Do you think we should fix
them?

Best Regards,
-- 
Nekral
Goal: print the usage and exit if an additional argument is profided to lastlog

Fixes: #349560

Status wrt upstream: Not forwarded yet

Note: some other utils may suffer from the same issue.

Index: shadow-4.0.14/src/lastlog.c
===================================================================
--- shadow-4.0.14.orig/src/lastlog.c    2005-12-06 22:25:00.000000000 +0100
+++ shadow-4.0.14/src/lastlog.c 2006-01-24 00:52:38.000000000 +0100
@@ -213,6 +213,12 @@
                                break;
                        }
                }
+               if (argc > optind) {
+                       fprintf (stderr,
+                                _("lastlog: Unexpected argument: %s\n"),
+                                argv[optind]);
+                       usage();
+               }
        }
 
        if ((lastlogfile = fopen (LASTLOG_FILE, "r")) == (FILE *) 0) {

Reply via email to