Bug 60167 - PasswdUserDatabase cannot parsing /etc/passwd with empty-line
Summary: PasswdUserDatabase cannot parsing /etc/passwd with empty-line
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.x-trunk
Hardware: PC Linux
: P2 minor (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-23 08:50 UTC by Jeho Sung
Modified: 2016-09-26 23:25 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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++