Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Apr 2020 19:25:46 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r359642 - head/usr.sbin/adduser
Message-ID:  <202004051925.035JPkE5085667@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Sun Apr  5 19:25:46 2020
New Revision: 359642
URL: https://svnweb.freebsd.org/changeset/base/359642

Log:
  adduser: allow standard IFS characters in passwords
  
  Notably, the default IFS contains space/tab, thus any leading/trailing
  whitespace characters tend to be removed.
  
  Set IFS= for just the read lines to mitigate this, allowing the user to be
  less surprised when their leading/trailing spaces weren't actually captured
  in the password as they are with other means of setting a user's password.
  
  PR:		245342
  Submitted by:	dereks_lifeofadishwasher.com
  Reviewed by:	jilles
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D24292

Modified:
  head/usr.sbin/adduser/adduser.sh

Modified: head/usr.sbin/adduser/adduser.sh
==============================================================================
--- head/usr.sbin/adduser/adduser.sh	Sun Apr  5 17:15:20 2020	(r359641)
+++ head/usr.sbin/adduser/adduser.sh	Sun Apr  5 19:25:46 2020	(r359642)
@@ -733,10 +733,10 @@ input_interactive() {
 					trap 'stty echo; exit' 0 1 2 3 15
 					stty -echo
 					echo -n "Enter password: "
-					read -r upass
+					IFS= read -r upass
 					echo''
 					echo -n "Enter password again: "
-					read -r _passconfirm
+					IFS= read -r _passconfirm
 					echo ''
 					stty echo
 					# if user entered a blank password



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004051925.035JPkE5085667>