United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6501543 Username can have non-alphanumeric characters
JDK-6501543 : Username can have non-alphanumeric characters

Details
Type:
Bug
Submit Date:
2006-12-06
Status:
Closed
Updated Date:
2011-05-18
Project Name:
JDK
Resolved Date:
2011-05-18
Component:
infrastructure
OS:
generic
Sub-Component:
build
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
6,7
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description
Besides spaces and quotes, the USER or USERNAME could have non alphnumeric characters or even be non ISO-Latin.
Any use of the username to contruct make build id names should take this into account, may use
tr -c "[:alnum:]=" "[.*]"
to map the characters we don't want to see???

                                    

Comments
EVALUATION

There is some concern that maybe the solution should involve native2ascii so that the username characters are not turned into '.' but maybe something that could be transformed back into the real username?  Just a thought.
                                     
2006-12-07
EVALUATION

Could be a dup of 6547593
                                     
2008-03-19
EVALUATION

So 6547593 was about the name of the month being localized in the release string, which can be fixed by not using a month name but a month number. The other part of the version string is the username, which just needs to be filtered to only include alnum characters.
                                     
2008-03-29
SUGGESTED FIX

diff --git a/make/common/shared/Defs.gmk b/make/common/shared/Defs.gmk
--- a/make/common/shared/Defs.gmk
+++ b/make/common/shared/Defs.gmk
@@ -265,7 +265,9 @@ ifdef BUILD_NUMBER
   FULL_VERSION = $(RELEASE)-$(BUILD_NUMBER)
 else
   BUILD_NUMBER = b00
-  USER_RELEASE_SUFFIX := $(shell echo $(USER)_`date '+%d_%b_%Y_%H_%M' | tr "A-Z" "a-z"`)
+  BUILD_DATE := $(shell $(DATE) '+%Y_%m_%d_%H_%M')
+  CLEAN_USERNAME := $(shell $(ECHO) "$(USER)" | $(TR) -d -c '[:alnum:]')
+  USER_RELEASE_SUFFIX := $(shell $(ECHO) "$(CLEAN_USERNAME)_$(BUILD_DATE)" | $(TR) '[:upper:]' '[:lower:]' )
   FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER)
 endif
                                     
2008-03-29
EVALUATION

http://hg.openjdk.java.net/jdk7/build/jdk/rev/425096dc0fc8
                                     
2008-04-01



Hardware and Software, Engineered to Work Together