Buffer overflow in passwd in BSD based operating systems 4.3 and earlier allows local users to gain root privileges by specifying a long shell or GECOS field.
https://github.com/i-mAshura/ExploitOracle
https://euvd.enisa.europa.eu/vulnerability/EUVD-1999-1452
http://www.securityfocus.com/bid/4