Page MenuHomeFreeBSD

Don't remove leading or trailing IFS for passwords
ClosedPublic

Authored by dereks_lifeofadishwasher.com on Apr 4 2020, 5:02 AM.
Tags
None
Referenced Files
F109260524: D24292.diff
Sun, Feb 2, 5:53 PM
Unknown Object (File)
Mon, Jan 27, 9:53 PM
Unknown Object (File)
Fri, Jan 24, 12:32 PM
Unknown Object (File)
Wed, Jan 8, 2:30 AM
Unknown Object (File)
Dec 11 2024, 4:10 AM
Unknown Object (File)
Nov 19 2024, 10:19 PM
Unknown Object (File)
Oct 2 2024, 10:43 PM
Unknown Object (File)
Sep 24 2024, 9:00 PM
Subscribers

Details

Summary

PR: 245342

When entering a password sh's IFS default value (space tab, newline) so
any leading a trailing IFS characters are removed.

Setting IFS= (null) for just the two adduser.sh read lines will not
remove leading or trailing IFS characters.

Test Plan
(cmd)$ IFS= read -r p 	# with leading and trailing tabs
            foo 
(cmd)$ echo "|${p}|"
|           foo         |
(cmd)$ read -r p  	
            foo
(cmd)$ echo "|${p}|"
|foo|

(ins)$ IFS= read -r p  	# with leading and trailing space
   foo   
(cmd)$ echo "|${p}|"
|   foo   |
(cmd)$ read -r p
   foo   
(cmd)$ echo "|${p}|"
|foo|

Test adduser.sh with IFS= lines and su -l newuser with the space/tab.
Also, confirm the non-space/tab padded password doesn't work.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30281
Build 28057: arc lint + arc unit

Event Timeline

Some people wrongly add whitespace via copy and paste, but let's be consistent with login, passwd, etc.

This revision is now accepted and ready to land.Apr 4 2020, 3:04 PM

Agreed; will commit this sometime today.

This revision was automatically updated to reflect the committed changes.