Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336343

Summary: org.mortbay.setuid.SetUIDServer.setUid(int) should parse the int as octal.
Product: [RT] Jetty Reporter: valentino miazzo <valentino>
Component: serverAssignee: Shirley Boulay <boulay>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jetty-inbox, valentino
Version: 7.2.2   
Target Milestone: 7.2.x   
Hardware: PC   
OS: All   
Whiteboard:

Description valentino miazzo CLA 2011-02-04 09:17:48 EST
Build Identifier: jetty-distribution-7.2.2.v20101205.tar.gz

Documentation at http://wiki.eclipse.org/Jetty/Howto/Port80#Using_Jetty.27s_setuid_feature explains how to use <Set name="umask">UMASK</Set>.
It doesn't explain that UMASK must be entered in 'decimal'.
I.E. if you want the same effect of 'umask 022' you must use <Set name="umask">18</Set>.

The issues is in org.mortbay.setuid.SetUIDServer.setUid(int) where the int is 'parsed' as a decimal number and not an octal number.

http://grepcode.com/file/repo1.maven.org/maven2/org.mortbay.jetty/jetty-setuid-java/7.2.2.v20101205/org/mortbay/setuid/SetUIDServer.java#SetUIDServer.setUid%28int%29

Reproducible: Always

Steps to Reproduce:
1. Follow http://wiki.eclipse.org/Jetty/Howto/Port80#Using_Jetty.27s_setuid_feature
2. Use <Set name="umask">18</Set>
3. The log shows: INFO::Setting umask=022
Comment 1 Greg Wilkins CLA 2011-02-23 00:31:26 EST
I've added setUmaskOctal that takes a string so you can now do

<Set name="umaskOctal">022</Set>
Comment 2 Shirley Boulay CLA 2011-03-04 16:32:11 EST
Updated http://wiki.eclipse.org/Jetty/Howto/Port80 to explain how to use umask and umask Octal.