Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8311631

When multiple users run tools/jpackage/share/LicenseTest.java, Permission denied for writing /var/tmp/*.files

    XMLWordPrintable

Details

    • b08

    Backports

      Description

        Sun Yaqi reported:

        The prerequisite is to install the rpmbuild command, when multiple users switch to write /var/tmp/*.files will have the permission forbidden.

        The complete test output follows:

            /var/tmp/rpm-tmp.jW3o4P: line 47: /var/tmp/commonlicensetest.app.files: Permission denied
            error: Bad exit status from /var/tmp/rpm-tmp.jW3o4P (%install)

            RPM build errors:
                Bad exit status from /var/tmp/rpm-tmp.jW3o4P (%install)
        [11:04:54.440] Returned: 1

        [11:04:54.440] java.io.IOException: Command [rpmbuild, -bb, /tmp/jdk.jpackage13540147031297722847/SPECS/commonlicensetest.spec, --define, %_sourcedir /tmp/jdk.jpackage13540147031297722847/images, --define, %_rpmdir /home/sunyaqi/jdk-ls/build/linux-x86_64-server-release/test-support/jtreg_test_jdk_tools_jpackage_share_LicenseTest_java/scratch/0/./testCommon/output, --define, %_topdir /tmp/jdk.jpackage13540147031297722847, --define, %_rpmfilename commonlicensetest-1.0-1.x86_64.rpm] exited with 1 code
            at jdk.jpackage/jdk.jpackage.internal.Executor.executeExpectSuccess(Executor.java:90)
            at jdk.jpackage/jdk.jpackage.internal.LinuxRpmBundler.buildRPM(LinuxRpmBundler.java:313)
            at jdk.jpackage/jdk.jpackage.internal.LinuxRpmBundler.buildPackageBundle(LinuxRpmBundler.java:165)
            at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.execute(LinuxPackageBundler.java:163)
            at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:688)
            at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:553)
            at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:92)
            at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:53)
        [11:04:54.503] jdk.jpackage.internal.PackagerException: java.io.IOException: Command [rpmbuild, -bb, /tmp/jdk.jpackage13540147031297722847/SPECS/commonlicensetest.spec, --define, %_sourcedir /tmp/jdk.jpackage13540147031297722847/images, --define, %_rpmdir /home/sunyaqi/jdk-ls/build/linux-x86_64-server-release/test-support/jtreg_test_jdk_tools_jpackage_share_LicenseTest_java/scratch/0/./testCommon/output, --define, %_topdir /tmp/jdk.jpackage13540147031297722847, --define, %_rpmfilename commonlicensetest-1.0-1.x86_64.rpm] exited with 1 code
            at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.execute(LinuxPackageBundler.java:176)
            at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:688)
            at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:553)
            at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:92)
            at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:53)
        Caused by: java.io.IOException: Command [rpmbuild, -bb, /tmp/jdk.jpackage13540147031297722847/SPECS/commonlicensetest.spec, --define, %_sourcedir /tmp/jdk.jpackage13540147031297722847/images, --define, %_rpmdir /home/sunyaqi/jdk-ls/build/linux-x86_64-server-release/test-support/jtreg_test_jdk_tools_jpackage_share_LicenseTest_java/scratch/0/./testCommon/output, --define, %_topdir /tmp/jdk.jpackage13540147031297722847, --define, %_rpmfilename commonlicensetest-1.0-1.x86_64.rpm] exited with 1 code
            at jdk.jpackage/jdk.jpackage.internal.Executor.executeExpectSuccess(Executor.java:90)
            at jdk.jpackage/jdk.jpackage.internal.LinuxRpmBundler.buildRPM(LinuxRpmBundler.java:313)
            at jdk.jpackage/jdk.jpackage.internal.LinuxRpmBundler.buildPackageBundle(LinuxRpmBundler.java:165)
            at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.execute(LinuxPackageBundler.java:163)
            ... 4 more
        [11:04:54.571] TRACE: exec: Done. Exit code: 1
        [11:04:54.576] ERROR: Expected [0]. Actual [1]: Check command [/home/sunyaqi/jdk-ls/build/linux-x86_64-server-release/images/jdk/bin/jpackage --input ./testCommon/input --dest ./testCommon/output --name CommonLicenseTest --type rpm --main-jar hello.jar --main-class Hello --license-file testCommon/license.txt -J-Djlink.debug=true --verbose](17) exited with 0 code
        [11:04:54.577] [ FAILED ] LicenseTest.testCommon; checks=4
        [11:04:54.579] [==========] 1 tests ran
        [11:04:54.579] [ PASSED ] 0 tests
        [11:04:54.581] [ FAILED ] 1 test, listed below
        [11:04:54.581] [ FAILED ] LicenseTest.testCommon; workDir=[./testCommon]
        [11:04:54.581] 1 FAILED TEST
        ----------System.err:(55/3890)----------
        java.lang.AssertionError: Expected [0]. Actual [1]: Check command [/home/sunyaqi/jdk-ls/build/linux-x86_64-server-release/images/jdk/bin/jpackage --input ./testCommon/input --dest ./testCommon/output --name CommonLicenseTest --type rpm --main-jar hello.jar --main-class Hello --license-file testCommon/license.txt -J-Djlink.debug=true --verbose](17) exited with 0 code
            at jdk.jpackage.test.TKit.error(TKit.java:273)
            at jdk.jpackage.test.TKit.assertEquals(TKit.java:576)
            at jdk.jpackage.test.Executor$Result.assertExitCodeIs(Executor.java:186)
            at jdk.jpackage.test.Executor.execute(Executor.java:224)
            at jdk.jpackage.test.JPackageCommand.execute(JPackageCommand.java:780)
            at jdk.jpackage.test.PackageTest$Handler.accept(PackageTest.java:587)
            at jdk.jpackage.test.PackageTest$2.accept(PackageTest.java:501)
            at jdk.jpackage.test.PackageTest$2.accept(PackageTest.java:413)
            at jdk.jpackage.test.Functional$ThrowingConsumer.lambda$toConsumer$0(Functional.java:41)
            at java.base/java.lang.Iterable.forEach(Iterable.java:75)
            at jdk.jpackage.test.PackageTest.lambda$runActions$24(PackageTest.java:383)
            at java.base/java.util.ArrayList.forEach(ArrayList.java:1593)
            at jdk.jpackage.test.PackageTest.lambda$runActions$25(PackageTest.java:382)
            at java.base/java.util.ArrayList.forEach(ArrayList.java:1593)
            at jdk.jpackage.test.PackageTest.runActions(PackageTest.java:381)
            at jdk.jpackage.test.RunnablePackageTest.run(RunnablePackageTest.java:58)
            at LicenseTest.testCommon(LicenseTest.java:104)
            at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
            at java.base/java.lang.reflect.Method.invoke(Method.java:578)
            at jdk.jpackage.test.MethodCall.accept(MethodCall.java:145)
            at jdk.jpackage.test.TestInstance.run(TestInstance.java:230)
            at jdk.jpackage.test.TKit.lambda$ignoreExceptions$5(TKit.java:141)
            at jdk.jpackage.test.TKit.lambda$runTests$3(TKit.java:126)
            at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1707)
            at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
            at jdk.jpackage.test.TKit.lambda$runTests$4(TKit.java:123)
            at jdk.jpackage.test.Functional$ThrowingRunnable.lambda$toRunnable$0(Functional.java:105)
            at jdk.jpackage.test.TKit.withExtraLogStream(TKit.java:109)
            at jdk.jpackage.test.TKit.runTests(TKit.java:122)
            at jdk.jpackage.test.Main.runTests(Main.java:79)
            at jdk.jpackage.test.Main.lambda$main$2(Main.java:75)
            at jdk.jpackage.test.Functional$ThrowingRunnable.lambda$toRunnable$0(Functional.java:105)
            at jdk.jpackage.test.TKit.withExtraLogStream(TKit.java:109)
            at jdk.jpackage.test.Main.main(Main.java:75)
            at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
            at java.base/java.lang.reflect.Method.invoke(Method.java:578)
            at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
            at java.base/java.lang.Thread.run(Thread.java:1583)

        Attachments

          Issue Links

            Activity

              People

                syaqi Sun Yaqi
                lzhai Leslie Zhai
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: