From 9951b1f569b0e16006cfcc5ceffef0ed4e700aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Fran=C3=A7ois?= Date: Tue, 13 Aug 2013 23:13:09 +0200 Subject: [PATCH] Fail in case arguments are provided after options. * src/vipw.c: Fail in case arguments are provided after options. Debian#677812 --- ChangeLog | 5 +++++ src/vipw.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 87f2c41d..8a80e409 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-08-13 Nicolas François + + * src/vipw.c: Fail in case arguments are provided after options. + Debian#677812 + 2013-08-13 Nicolas François * lib/subordinateio.c: Fix count for ranges truncated in diff --git a/src/vipw.c b/src/vipw.c index e3d4e421..59b79c2c 100644 --- a/src/vipw.c +++ b/src/vipw.c @@ -5,7 +5,7 @@ Copyright (c) 1997 , Guy Maor Copyright (c) 1999 - 2000, Marek Michałkiewicz Copyright (c) 2002 - 2006, Tomasz Kłoczko - Copyright (c) 2007 - 2011, Nicolas François + Copyright (c) 2007 - 2013, Nicolas François All rights reserved. This program is free software; you can redistribute it and/or modify @@ -480,6 +480,10 @@ int main (int argc, char **argv) usage (E_USAGE); } } + + if (optind != argc) { + usage (E_USAGE); + } } if (do_vipw) {