Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336343 - org.mortbay.setuid.SetUIDServer.setUid(int) should parse the int as octal.
Summary: org.mortbay.setuid.SetUIDServer.setUid(int) should parse the int as octal.
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 7.2.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 7.2.x   Edit
Assignee: Shirley Boulay CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-04 09:17 EST by valentino miazzo CLA
Modified: 2011-03-04 16:32 EST (History)
2 users (show)

See Also:


Attachments

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