How to influence File Permission Mode
Medi Montaseri
medi.montaseri at hds.com
Fri Sep 5 02:39:36 UTC 2014
Hi Erik,
Here is a longer list of 0600 files from JDK.tgz, that is src/build/linux-x86_64-normal-server-release/images/j2sdk-image
not only under lib/ext/*. As you know we get two images; jre and jdk. This one is under jdk.
mmontaseri at griffin:~/work/bug-91383/depot1> tar -zvtf openjdk-1.8.0-jdk-20140904.debian.tgz | grep '^-rw-------'
-rw------- root/root 31265 2014-09-04 19:06 ./demo/scripting/jconsole-plugin/jconsole-plugin.jar
-rw------- root/root 43860 2014-09-04 19:06 ./demo/jfc/Metalworks/Metalworks.jar
-rw------- root/root 20448 2014-09-04 19:06 ./demo/jfc/FileChooserDemo/FileChooserDemo.jar
-rw------- root/root 2817 2014-09-04 19:06 ./demo/jfc/SwingApplet/SwingApplet.jar
-rw------- root/root 36537 2014-09-04 19:06 ./demo/jfc/Notepad/Notepad.jar
-rw------- root/root 7927 2014-09-04 19:06 ./demo/jfc/TransparentRuler/TransparentRuler.jar
-rw------- root/root 26010 2014-09-04 19:06 ./demo/jfc/TableExample/TableExample.jar
-rw------- root/root 19627 2014-09-04 19:06 ./demo/jfc/SampleTree/SampleTree.jar
-rw------- root/root 51115 2014-09-04 19:06 ./demo/jfc/Font2DTest/Font2DTest.jar
-rw------- root/root 12661 2014-09-04 19:06 ./demo/jfc/CodePointIM/CodePointIM.jar
-rw------- root/root 321154 2014-09-04 19:06 ./demo/jpda/examples.jar
-rw------- root/root 11330 2014-09-04 19:06 ./demo/management/MemoryMonitor/MemoryMonitor.jar
-rw------- root/root 9637 2014-09-04 19:06 ./demo/management/FullThreadDump/FullThreadDump.jar
-rw------- root/root 5585 2014-09-04 19:06 ./demo/management/VerboseGC/VerboseGC.jar
-rw------- root/root 11053 2014-09-04 19:06 ./demo/management/JTop/JTop.jar
-rw------- root/root 68845 2014-09-04 19:06 ./demo/nio/zipfs/zipfs.jar
-rw------- root/root 38569 2014-09-04 19:06 ./demo/applets/WireFrame/WireFrame.jar
-rw------- root/root 14500 2014-09-04 19:06 ./demo/applets/MoleculeViewer/MoleculeViewer.jar
-rw------- root/root 13341 2014-09-04 19:06 ./demo/jvmti/mtrace/mtrace.jar
-rw------- root/root 15125 2014-09-04 19:06 ./demo/jvmti/heapTracker/heapTracker.jar
-rw------- root/root 11423 2014-09-04 19:06 ./demo/jvmti/minst/minst.jar
-rw------- root/root 17609350 2014-09-04 19:06 ./lib/ct.sym
-rw------- root/root 18142536 2014-09-04 19:06 ./lib/tools.jar
-rw------- root/root 2263892 2014-09-04 19:06 ./lib/sa-jdi.jar
-rw------- root/root 408031 2014-09-04 19:06 ./lib/jconsole.jar
-rw------- root/root 147558 2014-09-04 19:06 ./lib/dt.jar
-rw------- root/root 617946 2014-09-04 19:06 ./jre/lib/jsse.jar
-rw------- root/root 259148 2014-09-04 19:06 ./jre/lib/ext/sunjce_provider.jar
-rw------- root/root 8286 2014-09-04 19:06 ./jre/lib/ext/dnsns.jar
-rw------- root/root 68845 2014-09-04 19:06 ./jre/lib/ext/zipfs.jar
-rw------- root/root 1589694 2014-09-04 19:06 ./jre/lib/ext/nashorn.jar
-rw------- root/root 35899 2014-09-04 19:06 ./jre/lib/ext/sunec.jar
-rw------- root/root 235457 2014-09-04 19:06 ./jre/lib/ext/sunpkcs11.jar
-rw------- root/root 3860522 2014-09-04 19:06 ./jre/lib/ext/cldrdata.jar
-rw------- root/root 1178765 2014-09-04 19:06 ./jre/lib/ext/localedata.jar
-rw------- root/root 620 2014-09-04 19:06 ./jre/lib/security/US_export_policy.jar
-rw------- root/root 1040 2014-09-04 19:06 ./jre/lib/security/local_policy.jar
-rw------- root/root 93130 2014-09-04 19:06 ./jre/lib/jce.jar
-rw------- root/root 3131343 2014-09-04 19:06 ./jre/lib/charsets.jar
A few minutes ago, I put a hack in my wrapper to fix the JRE tgz. But the JDK side is not fixed yet. When I saw your email, I figured I should report back before I put the fix on the JDK tgz as well. So we see, it is not just the lib/ext/*.jar but more.....
Also got an email from a user on build-dev who has fixed this in the fedora packaging
===============================================================
[Unknown] build-dev at openjdk.java.net
Wednesday, September 03, 2014 10:25 AM
* Medi Montaseri <medi.montaseri at hds.com> [2014-08-26 13:56]:
> I am seeing some files with permission 0600 (-rw --- --- ) in my
> build. Is there a way to influence the generated files' permission
> from the configure or do I need to run a chmod(1) on them myself.
I saw an issue similar to this myself. I was using OpenJDK 7 to build
OpenJDK 8 and a bug in OpenJDK 7 was making many (but not all) jars have
0600 permissions.
I added a workaround that involves a manual chmod. See:
http://pkgs.fedoraproject.org/cgit/java-1.8.0-openjdk.git/tree/java-1.8.0-openjdk.spec?id=ac0d9480b7113e609b9747a3a3842a88d2bb9e84#n577
Hope that helps,
Omair
===================================================================
If you wish, I can file a bug, please share with me the bug filing URL and any category/module/subsystem, etc
Thanks
Medi
________________________________________
From: Erik Joelsson [erik.joelsson at oracle.com]
Sent: Wednesday, September 03, 2014 12:36 AM
To: Medi Montaseri; build-dev at openjdk.java.net
Subject: Re: How to influence File Permission Mode
Hello Medi,
On 2014-09-02 21:35, Medi Montaseri wrote:
> Hi Erik,
>
> Sorry for a bit of delay, got task switched around...
>
> My umask seems to be ok ( it is 0002 ) and I see the same issue under Debian (user=mmontaseri, umask=0002) and CentOS (user=manager, umask=0002)
>
> mmontaseri at griffin:/tmp> touch joe ; ls -l joe
> -rw-rw-r-- 1 mmontaseri software 0 Sep 2 11:47 joe
> mmontaseri at griffin:/tmp> mkdir moe ; ls -ld moe
> drwxrwxr-x 2 mmontaseri software 4096 Sep 2 11:47 moe/
>
> I see a few chmod(1)-ing and umask(1)-ing in the build scripts.
>
> build-performance.m4: chmod a+rwxs $CCACHE_DIR > /dev/null 2>&1
> generated-configure.sh:$CHMOD +x $OUTPUT_ROOT/compare.sh
> autoconf/generated-configure.sh: tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
> autoconf/generated-configure.sh: (umask 077 && mkdir "$tmp")
> autoconf/build-performance.m4: # with other users. Thus change the umask.
> autoconf/build-performance.m4: SET_CCACHE_DIR="CCACHE_DIR=$with_ccache_dir CCACHE_UMASK=002"
These instances are not related to the build output in any way. In the
makefiles all calls to chmod are made through the variable CHMOD, so
grep for $(CHMOD) to find them. When I did I could not find any that
removed read permissions.
> Can you please take a quick look and see....maybe cross-check that with the following area
>
>> tar -zvtf openjdk-1.8.0-jre-20140822.debian.tgz | grep '^-rw-------'
>> -rw------- root/root 617946 2014-08-22 11:38 ./lib/jsse.jar
>> -rw------- root/root 259148 2014-08-22 11:38 ./lib/ext/sunjce_provider.jar
>> -rw------- root/root 8286 2014-08-22 11:38 ./lib/ext/dnsns.jar
>> -rw------- root/root 1589693 2014-08-22 11:38 ./lib/ext/nashorn.jar
> I see "nashorn" as something worth chasing...
What's common for these particular jars is that they are built into one
location and then copied an extra time. Could you check the permissions
of all instances of those jars in your build output dir?
/Erik
> Thanks
> Medi
> ________________________________________
> From: Erik Joelsson [erik.joelsson at oracle.com]
> Sent: Wednesday, August 27, 2014 1:09 AM
> To: Medi Montaseri; build-dev at openjdk.java.net
> Subject: Re: How to influence File Permission Mode
>
> Hello Medi,
>
> The build does not intentionally limit file read permissions on the
> built files. There are some instances where write is removed. Have you
> checked your umask?
>
> /Erikl
>
> On 2014-08-26 19:55, Medi Montaseri wrote:
>> Hi
>>
>> I am seeing some files with permission 0600 (-rw --- --- ) in my build. Is there a way to influence the generated files' permission from the configure or do I need to run a chmod(1) on them myself.
>> Note that I have selected owner=root , group=root, so the net effect is that those files with 0600 only works for root. I need it to be readable by all. Unless there is some specific reason why these JARs are 0600.
>>
>> mmontaseri at griffin:~/work/bug-91383/depot9> ls -1
>> bin/
>> jvm/
>> openjdk-1.8.0-jdk-20140822.debian.tgz
>> openjdk-1.8.0-jre-20140822.debian.tgz
>> mmontaseri at griffin:~/work/bug-91383/depot9> bin/javac -version
>> javac 1.8.0-20140822
>>
>> mmontaseri at griffin:~/work/bug-91383/depot9/jvm/openjdk-1.8.0-20140822> find . -perm 600
>> ./demo/scripting/jconsole-plugin/jconsole-plugin.jar
>> ./demo/jfc/Metalworks/Metalworks.jar
>> ./demo/jfc/FileChooserDemo/FileChooserDemo.jar
>> ./demo/jfc/SwingApplet/SwingApplet.jar
>> ./demo/jfc/Notepad/Notepad.jar
>> ./demo/jfc/TransparentRuler/TransparentRuler.jar
>> ./demo/jfc/TableExample/TableExample.jar
>> ./demo/jfc/SampleTree/SampleTree.jar
>> ./demo/jfc/Font2DTest/Font2DTest.jar
>> ./demo/jfc/CodePointIM/CodePointIM.jar
>> ./demo/jpda/examples.jar
>> ./demo/management/MemoryMonitor/MemoryMonitor.jar
>> ./demo/management/FullThreadDump/FullThreadDump.jar
>> ./demo/management/VerboseGC/VerboseGC.jar
>> ./demo/management/JTop/JTop.jar
>> ./demo/nio/zipfs/zipfs.jar
>> ./demo/applets/WireFrame/WireFrame.jar
>> ./demo/applets/MoleculeViewer/MoleculeViewer.jar
>> ./demo/jvmti/mtrace/mtrace.jar
>> ./demo/jvmti/heapTracker/heapTracker.jar
>> ./demo/jvmti/minst/minst.jar
>> ./lib/ct.sym
>> ./lib/tools.jar
>> ./lib/sa-jdi.jar
>> ./lib/jconsole.jar
>> ./lib/dt.jar
>> ./jre/lib/jsse.jar
>> ./jre/lib/ext/sunjce_provider.jar
>> ./jre/lib/ext/dnsns.jar
>> ./jre/lib/ext/zipfs.jar
>> ./jre/lib/ext/nashorn.jar
>> ./jre/lib/ext/sunec.jar
>> ./jre/lib/ext/sunpkcs11.jar
>> ./jre/lib/ext/cldrdata.jar
>> ./jre/lib/ext/localedata.jar
>> ./jre/lib/security/US_export_policy.jar
>> ./jre/lib/security/local_policy.jar
>> ./jre/lib/jce.jar
>> ./jre/lib/charsets.jar
>>
>> mmontaseri at griffin:~/work/bug-91383/depot9/jvm/openjdk-1.8.0-20140822/jre/lib> find . -perm 600 -ls
>> 67241378 608 -rw------- 1 mmontaseri software 617946 Aug 22 11:38 ./jsse.jar
>> 67297842 260 -rw------- 1 mmontaseri software 259148 Aug 22 11:38 ./ext/sunjce_provider.jar
>> 67297843 12 -rw------- 1 mmontaseri software 8286 Aug 22 11:38 ./ext/dnsns.jar
>> 67297844 72 -rw------- 1 mmontaseri software 68844 Aug 22 11:38 ./ext/zipfs.jar
>> 67297845 1560 -rw------- 1 mmontaseri software 1589693 Aug 22 11:38 ./ext/nashorn.jar
>> 67297846 36 -rw------- 1 mmontaseri software 35899 Aug 22 11:38 ./ext/sunec.jar
>> 67297848 236 -rw------- 1 mmontaseri software 235457 Aug 22 11:38 ./ext/sunpkcs11.jar
>> 67297849 3776 -rw------- 1 mmontaseri software 3860522 Aug 22 11:38 ./ext/cldrdata.jar
>> 67297850 1156 -rw------- 1 mmontaseri software 1178765 Aug 22 11:38 ./ext/localedata.jar
>> 67346443 4 -rw------- 1 mmontaseri software 620 Aug 22 11:38 ./security/US_export_policy.jar
>> 67346444 4 -rw------- 1 mmontaseri software 1040 Aug 22 11:38 ./security/local_policy.jar
>> 67241387 96 -rw------- 1 mmontaseri software 93130 Aug 22 11:38 ./jce.jar
>> 67241393 3064 -rw------- 1 mmontaseri software 3131343 Aug 22 11:38 ./charsets.jar
>>
>> Here is another way of showing this....lets say I have my JRE packaged up in a tar file
>>
>> tar -zvtf openjdk-1.8.0-jre-20140822.debian.tgz | grep '^-rw-------'
>> -rw------- root/root 617946 2014-08-22 11:38 ./lib/jsse.jar
>> -rw------- root/root 259148 2014-08-22 11:38 ./lib/ext/sunjce_provider.jar
>> -rw------- root/root 8286 2014-08-22 11:38 ./lib/ext/dnsns.jar
>> -rw------- root/root 68844 2014-08-22 11:38 ./lib/ext/zipfs.jar
>> -rw------- root/root 1589693 2014-08-22 11:38 ./lib/ext/nashorn.jar
>> -rw------- root/root 35899 2014-08-22 11:38 ./lib/ext/sunec.jar
>> -rw------- root/root 235457 2014-08-22 11:38 ./lib/ext/sunpkcs11.jar
>> -rw------- root/root 3860522 2014-08-22 11:38 ./lib/ext/cldrdata.jar
>> -rw------- root/root 1178765 2014-08-22 11:38 ./lib/ext/localedata.jar
>> -rw------- root/root 620 2014-08-22 11:38 ./lib/security/US_export_policy.jar
>> -rw------- root/root 1040 2014-08-22 11:38 ./lib/security/local_policy.jar
>> -rw------- root/root 93130 2014-08-22 11:38 ./lib/jce.jar
>> -rw------- root/root 3131343 2014-08-22 11:38 ./lib/charsets.jar
>>
More information about the build-dev
mailing list