diff options
author | bapt <bapt@FreeBSD.org> | 2015-06-07 19:33:25 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2015-06-07 19:33:25 +0000 |
commit | 4a60f5b2aa32e78ca47b6bda0c8df390f7116df0 (patch) | |
tree | af0c53a2d8eb41aa0ee99a6dfe9e5a97cced6861 /usr.sbin/pw/pw.c | |
parent | 3be2bba5d71e59e56e7e8ba65e3c4efe3e59380f (diff) | |
download | FreeBSD-src-4a60f5b2aa32e78ca47b6bda0c8df390f7116df0.zip FreeBSD-src-4a60f5b2aa32e78ca47b6bda0c8df390f7116df0.tar.gz |
In case of rename validate the length of the new name
Check early that the new name fits MAXLOGNAME and store it in pwconf
Diffstat (limited to 'usr.sbin/pw/pw.c')
-rw-r--r-- | usr.sbin/pw/pw.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c index 7274c32..ae030ec 100644 --- a/usr.sbin/pw/pw.c +++ b/usr.sbin/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; |