From 34211cbde959d55fb8e6b818365341d0193e7253 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sun, 7 Jun 2015 19:33:25 +0000 Subject: In case of rename validate the length of the new name Check early that the new name fits MAXLOGNAME and store it in pwconf --- pw/pw.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pw/pw.c') diff --git a/pw/pw.c b/pw/pw.c index 7274c32..ae030ec 100644 --- a/pw/pw.c +++ b/pw/pw.c @@ -234,6 +234,11 @@ main(int argc, char *argv[]) case 'N': conf.dryrun = true; break; + case 'l': + if (strlen(optarg) >= MAXLOGNAME) + errx(EX_USAGE, "new name too long: %s", optarg); + conf.newname = optarg; + break; case 'P': conf.pretty = true; break; -- cgit v1.2.3