Bug 60167

Summary: PasswdUserDatabase cannot parsing /etc/passwd with empty-line
Product: Tomcat 8 Reporter: Jeho Sung <scheho>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P2    
Version: 8.0.x-trunk   
Target Milestone: ----   
Hardware: PC   
OS: Linux   

Description Jeho Sung 2016-09-23 08:50:04 UTC
summary:

  When PasswdUserDatabase initialize @/etc/passwd/@ with empty-line,
  cannot parsing completely.

  * https://tomcat.apache.org/tomcat-8.0-doc/config/host.html#User_Web_Applications


========================================================

my /etc/passwd:

  <...>
  lxc-dnsmasq:x:114:125:LXC dnsmasq,,,:/var/lib/lxc:/bin/false
  moodle:x:1002:1002:,,,:/home/moodle:/bin/bash
  tomcat8:x:117:126::/usr/share/tomcat8:/bin/false
  
  
  # 시스템 관리자
  
  jehos:x:1001:1001:성제호,,,:/home/jehos:/bin/bash
  <...>


========================================================

try:
  GET http://localhost:8080/~myid

expect:
  ~myid/public_html/index.html

actual:
  404 not found

workaround:
  remove all empty-lines,
  in my case, just comment out (#)

suspect:
  https://github.com/apache/tomcat/blob/trunk/java/org/apache/catalina/startup/PasswdUserDatabase.java#L147
Comment 1 Mark Thomas 2016-09-26 19:33:58 UTC
This has been fixed in the following branches:
- 9.0.x for 9.0.0.M11 onwards
- 8.5.x for 8.5.6 onwards
- 8.0.x for 8.0.38 onwards
- 7.0.x for 7.0.73 onwards
Comment 2 Jeho Sung 2016-09-26 23:25:51 UTC
@markt++