You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by bphamhuu <a0...@gmail.com> on 2020/01/04 14:35:56 UTC

Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Hello,

I have a java web application by Tomcat 9 servlet container which tries to
read a file in /tmp folder with 777 permission on Ubuntu 18.04

ls -ltr /tmp/test.txt
-rwxrwxrwx 1 vagrant vagrant 10 Jan  3 17:03 /tmp/test.txt

The java code is:

    try {
        result = FileUtils.readFileToString(new File("/tmp/test.txt"));
    } catch (IOException ex) {
        log.info("##### Cannot read file. Reason: " + ex.getMessage());
    }

But it always show the error

##### Cannot read file. Reason: File '/tmp/test.txt' does not exist

This test file can be opened fine by a normal user on a terminal window
(example user: vagrant).

vagrant@ras:~$ cat /tmp/test.txt
asdasdsad

Does anybody know about the problem with Tomcat 9? I'll need the java web
application to read this test file as string.

Thanks,



--
Sent from: http://tomcat.10.x6.nabble.com/Tomcat-User-f1968778.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Pham Huu Bang <a0...@gmail.com>.
>What "user account" is Tomcat executing as?

tomcat user.

To fix the problem, I had to change
/lib/systemd/system/tomcat9.service
PrivateTmp=yes to PrivateTmp=no

Then,

sudo systemctl daemon-reload

sudo service tomcat9 restart


On Mon, 6 Jan 2020 at 09:58, calder <ca...@gmail.com> wrote:

> On Sat, Jan 4, 2020 at 8:36 AM bphamhuu <a0...@gmail.com> wrote:
> > I have a java web application by Tomcat 9 servlet container which tries
> to
> > read a file in /tmp folder with 777 permission on Ubuntu 18.04
> >
> > ls -ltr /tmp/test.txt
> > -rwxrwxrwx 1 vagrant vagrant 10 Jan  3 17:03 /tmp/test.txt
> [snip]
>
> > ##### Cannot read file. Reason: File '/tmp/test.txt' does not exist
>
> What "user account" is Tomcat executing as?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

-- 

*Bang Pham Huu *
*-------------------------------------------------------------------------------------*
*Master of Science - Research Assistant at Field Monitoring Center - 4 F,
E3 BuildingViet Nam - Ha Noi National University - University of
Engineering and Technology*
*Email: a09550@gmail.com <a0...@gmail.com> - Tel: +84 164.6339.217*

*“Life is like riding a bicycle. To keep your balance, you must keep
moving.”― Albert Einstein*

Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by calder <ca...@gmail.com>.
On Sat, Jan 4, 2020 at 8:36 AM bphamhuu <a0...@gmail.com> wrote:
> I have a java web application by Tomcat 9 servlet container which tries to
> read a file in /tmp folder with 777 permission on Ubuntu 18.04
>
> ls -ltr /tmp/test.txt
> -rwxrwxrwx 1 vagrant vagrant 10 Jan  3 17:03 /tmp/test.txt
[snip]

> ##### Cannot read file. Reason: File '/tmp/test.txt' does not exist

What "user account" is Tomcat executing as?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Zahid,

On 1/5/20 20:44, zahid wrote:
> Why will MS Windows users will never have to deal with issue of
> *chmod* ?

On Windows, it's called ATTRIB.EXE:

C:\> ATTRIB

A SH C:\pagefile.sys
A SH C:\swapfile.sys

Those are separate from the NT ACL, of course. Plus, you can
right-click and edit the permissions of any file. But in Windows, how
do you for example remove the "archive" bit on all TXT files in a
hierarchy? Right-click a million times and make your hand go numb.
- From the CLI, it's a single command.

Some people like clicking. I like typing. *shrug*

> also keep in mind why java command line have three  different
> options to do the same thing ?
> 
> java -cp
> 
> java -classpath

Long and short options. This isn't a *NIX thing (it's Java), but it
does hand a long history on *NIX. Although *NIX programs typically use
- --option for long-options, otherwise they don't make any sense when
mixed-together with short ones.

> java class-path

This is "java --class-path" which is a proper long-option.

- -chris

> 
> On 06/01/2020 01:21, Guang Chao wrote:
>> On Sun, Jan 5, 2020 at 9:26 AM zahid <za...@gmail.com>
>> wrote:
>> 
>>> Actually this is *one of many *punishments following the sin of
>>> choosing *.nix
>>> 
>>> and not Microsoft Windows.
>>> 
>> Why is it Linux fault?
>> 
>> 
>>> Have ever heard of "*chmod*" in windows ?
>>> 
>>> MS windows trust you with your machine.
>>> 
>>> You bought it , you paid for it , you own it.
>>> 
>>> 
>>> although you have many ways of installing software.
>>> 
>>> apt , apt-get yum , blah blah.
>>> 
>>> You need to familiarise yourself with *find  / -name java* *  ,
>>> which java*  because you have no idea where the installer
>>> installed the software you just installed on "your machine",
>>> 
>>> Have ever heard of *which* or *find* in windows ?
>>> 
>>> 
>>> you can be in a directory in one terminal and delete it form
>>> another terminal .
>>> 
>>> Is that  linux security  feature ?
>>> 
>>> can you do the same  in windows  ?
>>> 
>>> what are others benefits you can enjoy in MS Windows because of
>>> this particular behaviour is not same in MS Windows ?
>>> 
>>> After you deleted the directory you are in from somewhere else
>>> you will end up in trash literally.
>>> 
>>> why  is this same unique  behaviour in Unix which came after
>>> Linux.
>>> 
>>> 
>>> you see anything what's wrong with this ? can you see the
>>> missing the /r /n
>>> 
>>> manifest.txt
>>> 
>>> Main-Class:/classname /
>>> 
>>> why does manifest.text must have /r {carriage} or  /n
>>> {newline}.
>>> 
>>> Is it because jvm.dll it was written in C. C programming
>>> language also has the same feature.
>>> 
>>> 
>>> why is there three ways to do same thing  ?
>>> 
>>> java - cp
>>> 
>>> java - classpath
>>> 
>>> java - class-path
>>> 
>>> 
>>> 
>>> www.backbutton.co.uk ¯\_(ツ)_/¯ Marry loose with tight coupling
>>> = healthy applications
>>> 
>>> On 04/01/2020 22:51, Emmanuel Bourg wrote:
>>>> Le 04/01/2020 à 16:06, Pham Huu Bang a écrit :
>>>> 
>>>>> Thanks for this link
>>>>> 
>>> https://salsa.debian.org/java-team/tomcat9/blob/master/debian/README
.Debian
>>>
>>>
>>> 
.
>>>>> But I cannot *read* the file from /tmp (not *write* file to
>>>>> /tmp). The strange thing is, it can read another file from
>>>>> another location, e.g in /opt/:
>>>> The tomcat9 service is configured with a private /tmp
>>>> directory (using the 'PrivateTmp=yes' systemd directive). So
>>>> Tomcat can't see what other applications write to /tmp, and
>>>> temporary files written by Tomcat are out of reach from the
>>>> other applications.
>>>> 
>>>> This is a security hardening setting that can be overridden
>>>> as described in the README file Olaf mentioned.
>>>> 
>>>> Emmanuel Bourg
>>>> 
>>>> -------------------------------------------------------------------
- --
>>>>
>>>> 
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail:
>>>> users-help@tomcat.apache.org
>>>> 
>>> -- www.backbutton.co.uk ¯\_(ツ)_/¯ Marry loose with tight 
>>> coupling = healthy applications
>>> 
>>> 
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4TXekACgkQHPApP6U8
pFgM2hAAtbhH+QpOYePOu1iOWOOxQ2x40oOfz0enD18J6E7/uGA8Sm1331SKyvJ0
amU+C1faX7srin5EHvzFizDRicKzLGRonClypdqbezZ/grLQATMVBEbl4AnEvvPu
rOEOe+dwZ57l38/39qY3RQjDF67zqEsUb2mACH1oq5QemjRKLcEiXIlPAqzzGu/L
8I/nz0ibnp5sQAAxvuG1qYfNCoN8d/PO9KyJHIFGSEnKzaJcYewX/KZGX7CHNEHT
wHuxPiKAbwORELmVEsiQI/d5dL3nqnpDu/tEUzvpjVUILLSRTk51mCR20t+zfeNO
3YpCbWPQNGEcqgg3DDqSyUtOpnSt1xE35wII1Zfq9M94tqP2cCFYKYOMEvTUKIGU
Fg8xENrdV5OvVr9eHls7FV32pQ4ZnH4/BdmsoAhL1+UZmysSPBJgyz9ySok0cFXU
SJ/eF8iFZktglWncf9PliuRtL5G3eVvpZR3XlKC9Bz3WrQuL9LPLGmbh19WL0/hB
G2grN+HLSBPqJbqY9c3qymfQX+pYeSl8R5ZkTzCP7DG+SJ+wosVARrggAYBveR8E
bGWQGw1NlyEuMKlPOvkSc946cB2Syg8OdvRfmw8OSHYD7QEEv/cOVen15/a6FQiT
jAV/yrsxH8lPfWlCSJl9POq0gGQ7euyZSiDhy/MjulyatP/ZX6s=
=V6a2
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by zahid <za...@gmail.com>.
 > Apples and Oranges

You're right, Sorry.


www.backbutton.co.uk
¯\_(ツ)_/¯ ♡۶
java -cp classpath class-path
Marriage of loose and tight coupling -> healthy applications

On 06/01/2020 01:47, Guang Chao wrote:
>
>
> On Mon, Jan 6, 2020 at 9:44 AM zahid <zahidr1000@gmail.com 
> <ma...@gmail.com>> wrote:
>
>
>     Why will MS Windows users will never have to deal with issue of
>     *chmod* ?
>
> Apples and Oranges
>
>     also keep in mind why java command line have three different 
>     options to do the same thing ?
>
>     java -cp
>
>     java -classpath
>
>     java class-path
>
>
>     On 06/01/2020 01:21, Guang Chao wrote:
>>     On Sun, Jan 5, 2020 at 9:26 AM zahid<za...@gmail.com>  <ma...@gmail.com>  wrote:
>>
>>>     Actually this is *one of many *punishments following the sin of choosing
>>>     *.nix
>>>
>>>     and not Microsoft Windows.
>>>
>>     Why is it Linux fault?
>>
>>
>>>     Have ever heard of "*chmod*" in windows ?
>>>
>>>     MS windows trust you with your machine.
>>>
>>>     You bought it , you paid for it , you own it.
>>>
>>>
>>>     although you have many ways of installing software.
>>>
>>>     apt , apt-get yum , blah blah.
>>>
>>>     You need to familiarise yourself with *find  / -name java* *  ,   which
>>>     java*  because you have no idea where the installer installed the
>>>     software you just installed on "your machine",
>>>
>>>     Have ever heard of *which* or *find* in windows ?
>>>
>>>
>>>     you can be in a directory in one terminal and delete it form another
>>>     terminal .
>>>
>>>     Is that  linux security  feature ?
>>>
>>>     can you do the same  in windows  ?
>>>
>>>     what are others benefits you can enjoy in MS Windows because of this
>>>     particular behaviour is not same in MS Windows ?
>>>
>>>     After you deleted the directory you are in from somewhere else you will
>>>     end up in trash literally.
>>>
>>>     why  is this same unique  behaviour in Unix which came after Linux.
>>>
>>>
>>>     you see anything what's wrong with this ? can you see the missing the /r /n
>>>
>>>     manifest.txt
>>>
>>>     Main-Class:/classname /
>>>
>>>     why does manifest.text must have /r {carriage} or  /n {newline}.
>>>
>>>     Is it because jvm.dll it was written in C. C programming language also
>>>     has the same feature.
>>>
>>>
>>>     why is there three ways to do same thing  ?
>>>
>>>     java - cp
>>>
>>>     java - classpath
>>>
>>>     java - class-path
>>>
>>>
>>>
>>>     www.backbutton.co.uk  <http://www.backbutton.co.uk>
>>>     ¯\_(ツ)_/¯
>>>     Marry loose with tight
>>>     coupling = healthy applications
>>>
>>>     On 04/01/2020 22:51, Emmanuel Bourg wrote:
>>>>     Le 04/01/2020 à 16:06, Pham Huu Bang a écrit :
>>>>
>>>>>     Thanks for this link
>>>>>
>>>     https://salsa.debian.org/java-team/tomcat9/blob/master/debian/README.Debian
>>>     .
>>>>>     But I cannot *read* the file from /tmp (not *write* file to /tmp). The
>>>>>     strange thing is, it can read another file from another location, e.g in
>>>>>     /opt/:
>>>>     The tomcat9 service is configured with a private /tmp directory (using
>>>>     the 'PrivateTmp=yes' systemd directive). So Tomcat can't see what other
>>>>     applications write to /tmp, and temporary files written by Tomcat are
>>>>     out of reach from the other applications.
>>>>
>>>>     This is a security hardening setting that can be overridden as described
>>>>     in the README file Olaf mentioned.
>>>>
>>>>     Emmanuel Bourg
>>>>
>>>>     ---------------------------------------------------------------------
>>>>     To unsubscribe, e-mail:users-unsubscribe@tomcat.apache.org  <ma...@tomcat.apache.org>
>>>>     For additional commands, e-mail:users-help@tomcat.apache.org  <ma...@tomcat.apache.org>
>>>>
>>>     --
>>>     www.backbutton.co.uk  <http://www.backbutton.co.uk>
>>>     ¯\_(ツ)_/¯
>>>     Marry loose with tight
>>>     coupling
>>>     = healthy applications
>>>
>>>
>     -- 
>     www.backbutton.co.uk  <http://www.backbutton.co.uk>
>     ¯\_(ツ)_/¯
>     Marriage between loose
>     and tight coupling
>     = healthy applications
>
>
>
> -- 
> I love Java <https://javadevnotes.com/java-integer-to-string-examples>

-- 
www.backbutton.co.uk
¯\_(ツ)_/¯ ♡۶
java -cp classpath class-path
Marriage of loose and tight coupling -> healthy applications


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Guang Chao <gu...@gmail.com>.
On Mon, Jan 6, 2020 at 9:44 AM zahid <za...@gmail.com> wrote:

>
> Why will MS Windows users will never have to deal with issue of *chmod* ?
>
Apples and Oranges

> also keep in mind why java command line have three  different  options to
> do the same thing ?
>
> java -cp
>
> java -classpath
>
> java class-path
>
> On 06/01/2020 01:21, Guang Chao wrote:
>
> On Sun, Jan 5, 2020 at 9:26 AM zahid <za...@gmail.com> <za...@gmail.com> wrote:
>
>
> Actually this is *one of many *punishments following the sin of choosing
> *.nix
>
> and not Microsoft Windows.
>
>
> Why is it Linux fault?
>
>
>
> Have ever heard of "*chmod*" in windows ?
>
> MS windows trust you with your machine.
>
> You bought it , you paid for it , you own it.
>
>
> although you have many ways of installing software.
>
> apt , apt-get yum , blah blah.
>
> You need to familiarise yourself with *find  / -name java* *  ,   which
> java*  because you have no idea where the installer installed the
> software you just installed on "your machine",
>
> Have ever heard of *which* or *find* in windows ?
>
>
> you can be in a directory in one terminal and delete it form another
> terminal .
>
> Is that  linux security  feature ?
>
> can you do the same  in windows  ?
>
> what are others benefits you can enjoy in MS Windows because of this
> particular behaviour is not same in MS Windows ?
>
> After you deleted the directory you are in from somewhere else you will
> end up in trash literally.
>
> why  is this same unique  behaviour in Unix which came after Linux.
>
>
> you see anything what's wrong with this ? can you see the missing the /r /n
>
> manifest.txt
>
> Main-Class:/classname /
>
> why does manifest.text must have /r {carriage} or  /n {newline}.
>
> Is it because jvm.dll it was written in C. C programming language also
> has the same feature.
>
>
> why is there three ways to do same thing  ?
>
> java - cp
>
> java - classpath
>
> java - class-path
>
>
> www.backbutton.co.uk
> ¯\_(ツ)_/¯
> Marry loose with tight
> coupling = healthy applications
>
> On 04/01/2020 22:51, Emmanuel Bourg wrote:
>
> Le 04/01/2020 à 16:06, Pham Huu Bang a écrit :
>
>
> Thanks for this link
>
>
> https://salsa.debian.org/java-team/tomcat9/blob/master/debian/README.Debian
> .
>
> But I cannot *read* the file from /tmp (not *write* file to /tmp). The
> strange thing is, it can read another file from another location, e.g in
> /opt/:
>
> The tomcat9 service is configured with a private /tmp directory (using
> the 'PrivateTmp=yes' systemd directive). So Tomcat can't see what other
> applications write to /tmp, and temporary files written by Tomcat are
> out of reach from the other applications.
>
> This is a security hardening setting that can be overridden as described
> in the README file Olaf mentioned.
>
> Emmanuel Bourg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> --www.backbutton.co.uk
> ¯\_(ツ)_/¯
> Marry loose with tight
> coupling
> = healthy applications
>
>
>
> -- www.backbutton.co.uk
> ¯\_(ツ)_/¯
> Marriage between loose
> and tight coupling
> = healthy applications
>
>

-- 
I love Java <https://javadevnotes.com/java-integer-to-string-examples>

Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by zahid <za...@gmail.com>.
Why will MS Windows users will never have to deal with issue of *chmod* ?

also keep in mind why java command line have three  different options to 
do the same thing ?

java -cp

java -classpath

java class-path


On 06/01/2020 01:21, Guang Chao wrote:
> On Sun, Jan 5, 2020 at 9:26 AM zahid <za...@gmail.com> wrote:
>
>> Actually this is *one of many *punishments following the sin of choosing
>> *.nix
>>
>> and not Microsoft Windows.
>>
> Why is it Linux fault?
>
>
>> Have ever heard of "*chmod*" in windows ?
>>
>> MS windows trust you with your machine.
>>
>> You bought it , you paid for it , you own it.
>>
>>
>> although you have many ways of installing software.
>>
>> apt , apt-get yum , blah blah.
>>
>> You need to familiarise yourself with *find  / -name java* *  ,   which
>> java*  because you have no idea where the installer installed the
>> software you just installed on "your machine",
>>
>> Have ever heard of *which* or *find* in windows ?
>>
>>
>> you can be in a directory in one terminal and delete it form another
>> terminal .
>>
>> Is that  linux security  feature ?
>>
>> can you do the same  in windows  ?
>>
>> what are others benefits you can enjoy in MS Windows because of this
>> particular behaviour is not same in MS Windows ?
>>
>> After you deleted the directory you are in from somewhere else you will
>> end up in trash literally.
>>
>> why  is this same unique  behaviour in Unix which came after Linux.
>>
>>
>> you see anything what's wrong with this ? can you see the missing the /r /n
>>
>> manifest.txt
>>
>> Main-Class:/classname /
>>
>> why does manifest.text must have /r {carriage} or  /n {newline}.
>>
>> Is it because jvm.dll it was written in C. C programming language also
>> has the same feature.
>>
>>
>> why is there three ways to do same thing  ?
>>
>> java - cp
>>
>> java - classpath
>>
>> java - class-path
>>
>>
>>
>> www.backbutton.co.uk
>> ¯\_(ツ)_/¯
>> Marry loose with tight
>> coupling = healthy applications
>>
>> On 04/01/2020 22:51, Emmanuel Bourg wrote:
>>> Le 04/01/2020 à 16:06, Pham Huu Bang a écrit :
>>>
>>>> Thanks for this link
>>>>
>> https://salsa.debian.org/java-team/tomcat9/blob/master/debian/README.Debian
>> .
>>>> But I cannot *read* the file from /tmp (not *write* file to /tmp). The
>>>> strange thing is, it can read another file from another location, e.g in
>>>> /opt/:
>>> The tomcat9 service is configured with a private /tmp directory (using
>>> the 'PrivateTmp=yes' systemd directive). So Tomcat can't see what other
>>> applications write to /tmp, and temporary files written by Tomcat are
>>> out of reach from the other applications.
>>>
>>> This is a security hardening setting that can be overridden as described
>>> in the README file Olaf mentioned.
>>>
>>> Emmanuel Bourg
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>> --
>> www.backbutton.co.uk
>> ¯\_(ツ)_/¯
>> Marry loose with tight
>> coupling
>> = healthy applications
>>
>>
-- 
www.backbutton.co.uk
¯\_(ツ)_/¯
Marriage between loose
and tight coupling
= healthy applications


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Guang Chao <gu...@gmail.com>.
On Sun, Jan 5, 2020 at 9:26 AM zahid <za...@gmail.com> wrote:

>
> Actually this is *one of many *punishments following the sin of choosing
> *.nix
>
> and not Microsoft Windows.
>

Why is it Linux fault?


>
> Have ever heard of "*chmod*" in windows ?
>
> MS windows trust you with your machine.
>
> You bought it , you paid for it , you own it.
>
>
> although you have many ways of installing software.
>
> apt , apt-get yum , blah blah.
>
> You need to familiarise yourself with *find  / -name java* *  ,   which
> java*  because you have no idea where the installer installed the
> software you just installed on "your machine",
>
> Have ever heard of *which* or *find* in windows ?
>
>
> you can be in a directory in one terminal and delete it form another
> terminal .
>
> Is that  linux security  feature ?
>
> can you do the same  in windows  ?
>
> what are others benefits you can enjoy in MS Windows because of this
> particular behaviour is not same in MS Windows ?
>
> After you deleted the directory you are in from somewhere else you will
> end up in trash literally.
>
> why  is this same unique  behaviour in Unix which came after Linux.
>
>
> you see anything what's wrong with this ? can you see the missing the /r /n
>
> manifest.txt
>
> Main-Class:/classname /
>
> why does manifest.text must have /r {carriage} or  /n {newline}.
>
> Is it because jvm.dll it was written in C. C programming language also
> has the same feature.
>
>
> why is there three ways to do same thing  ?
>
> java - cp
>
> java - classpath
>
> java - class-path
>
>
>
> www.backbutton.co.uk
> ¯\_(ツ)_/¯
> Marry loose with tight
> coupling = healthy applications
>
> On 04/01/2020 22:51, Emmanuel Bourg wrote:
> > Le 04/01/2020 à 16:06, Pham Huu Bang a écrit :
> >
> >> Thanks for this link
> >>
> https://salsa.debian.org/java-team/tomcat9/blob/master/debian/README.Debian
> .
> >> But I cannot *read* the file from /tmp (not *write* file to /tmp). The
> >> strange thing is, it can read another file from another location, e.g in
> >> /opt/:
> > The tomcat9 service is configured with a private /tmp directory (using
> > the 'PrivateTmp=yes' systemd directive). So Tomcat can't see what other
> > applications write to /tmp, and temporary files written by Tomcat are
> > out of reach from the other applications.
> >
> > This is a security hardening setting that can be overridden as described
> > in the README file Olaf mentioned.
> >
> > Emmanuel Bourg
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> --
> www.backbutton.co.uk
> ¯\_(ツ)_/¯
> Marry loose with tight
> coupling
> = healthy applications
>
>

-- 
I love Java <https://javadevnotes.com/java-integer-to-string-examples>

Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Zahid Rahman <za...@gmail.com>.
So people who find miserable software breakdowns and  failures will be
called trolls and  blocked.

That sound about right .







On Mon, 6 Jan 2020, 20:35 Mark Thomas, <ma...@apache.org> wrote:

> On 06/01/2020 16:29, Christopher Schultz wrote:
> > You have a right to a view, and you can troll all you want. But you
> > will be ignored.
>
> Up to a point.
>
> Users that continue to troll will be unsubscribed and blocked from
> re-subscribing.
>
> As a general reminder aimed at keeping noise down on the list:
>
> Please don't feed the trolls.
>
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Zahid,

On 1/7/20 9:17 AM, zahid wrote:
>> Well - why do you think someone is calling you names? Mark did
>> not,
> right?
> 
> My efforts in chasing up a bug which effected many Apache  and non 
> Apache products
> 
> and  with MR Emmanuel Bourg 's  DILIGENT , VIGOROUS  efforts
> produced this :-
> 
> [1] https://bugs.debian.org/948309 [2]
> https://bugs.debian.org/948310
> 
> IBM can now upgrade from JDK 8 
> https://developer.ibm.com/javasdk/downloads/.
> 
> if this was their issue too.
> 
> I also sent same message to Apache Struts because the local expert
> there was recommending to use JDK 8 to people who had MAVEN warning
> caused when using Internationalisation API. (I looked through
> archive and saw that)
> 
> I also sent same message to Apache NetBeans because they were
> using Maven 3.3.9 (2015)  which knows nothing about the  trouble
> some java classes.
> 
>> Well - why do you think someone is calling you names? Mark did
>> not,
> right?
> 
> Mark T refer to me as "troll"
> 
> I am not part of the fashion victim of *nix, so  Mr Shultz also
> referred to me as a "troll".

Anyone who is stirring-up off-topic trouble on a mailing list for no
apparent purpose is trolling. Whether or not that makes you a troll is
debatable.

But posting messages about how one operating environment versus
another is superior/inferior is definitely off-topic, especially if it
is not some frustration which you are trying to solve and get past. It
is not useful to the community to post open-ended complaints about
e.g. UNIX or Windows for that matter. So if you hate the UNIX
philosophy, that's fine. We just don't really care to hear you
complain about it. We also don't want to hear complaints about
Windows, MacOS, BeOS, iOS, etc., either.

Extending the (useless) debate just wastes people's time. Extending
the debate is also a technique used by trolls to continue to anger peopl
e.

This is a community that exists to support users of Apache Tomcat.
If you are having a specific problem with an operating environment,
someone (or, typically, more than one someone) who has expertise in
that environment will generally try to explain what is happening and
help you. Complaining about the answer doesn't encourage others to
help you in the future. It also discourages others from participating
in the community, and THAT is the reason why we will (eventually) ban
people who continuously troll our community.

We are not threatening to ban you. We are explaining that actual
trolls WILL be banned.

- -chris

> On 06/01/2020 21:45, logo wrote:
>> Well - why do you think someone is calling you names? Mark did
>> not, right?
>> 
>>> Am 06.01.2020 um 22:11 schrieb Zahid Rahman
>>> <za...@gmail.com>:
>>> 
>>> Are you calling me names  ?
>>> 
>>> On Mon, 6 Jan 2020, 20:35 Mark Thomas, <ma...@apache.org>
>>> wrote:
>>> 
>>>> On 06/01/2020 16:29, Christopher Schultz wrote:
>>>>> You have a right to a view, and you can troll all you want.
>>>>> But you will be ignored.
>>>> Up to a point.
>>>> 
>>>> Users that continue to troll will be unsubscribed and blocked
>>>> from re-subscribing.
>>>> 
>>>> As a general reminder aimed at keeping noise down on the
>>>> list:
>>>> 
>>>> Please don't feed the trolls.
>>>> 
>>>> 
>>>> Mark
>>>> 
>>>> -------------------------------------------------------------------
- --
>>>>
>>>> 
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail:
>>>> users-help@tomcat.apache.org
>>>> 
>>>> 
>> 
>> ---------------------------------------------------------------------
>>
>> 
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4UrqMACgkQHPApP6U8
pFjx/w//Xs5LSFDgWtubi3hDdQqr/IYzPCSfWWhxsRxtT9sZRXx3dPd+O39Hj62v
7+Oiy/hQcTx+LFhLpdxbaJ2ntHU5B+Cj1336ikd8ndpeauMK8XPibv/Zf/fmeQb1
WO6g2+o4HA0OGtVtcZ56Q8W7UduHcVUHIYxim1dclscABrHbNzyNI+biX8IPA5Uu
D2XmItyjRuRnFZjeSwNAjMD+zPRs2K/j7Q+IDChObJJasjX04cDOV2QWKnAlUTWb
yoY5we6I7qVrGymp0eHovlMN6wKU+d620+/XKd9CLPlcID/TcAzmyCdxInKob+9m
uXW/B9CDAY3TwpiSIE6nsfjox/vCoNzLB6nUWH16VtTf+YqQwk036vvcpsX4qvof
uiV8I7PdUuwIik/g5/uaynXlSXOY+QMls0p4dveIj89GYhlGKuv/w3KZh5ugedSO
RYzHDyiHtCkP2uQddJMxKbsjEV4sWfai5I2TY7BUBoL8muPFso8/o8fwjK32yaUt
a3HrEAWa/NL7nfwG9VbtzWEDAtSiKsCxRpoCh7bgHnLt9ez+Bt+MIGpuVRWf0tGt
hTANri4MquduPz/phZpWFp930YlSBaWC15ZdDiZeoF0kclml/JhHtc+yJfufRjxO
BWksNkttTxMHkC2vlB44OUicTNxW0xowni2I+olieYDs1uUXDLQ=
=b3mX
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by zahid <za...@gmail.com>.
 > Well - why do you think someone is calling you names? Mark did not, 
right?

My efforts in chasing up a bug which effected many Apache  and non 
Apache products

and  with MR Emmanuel Bourg 's  DILIGENT , VIGOROUS  efforts produced 
this :-

[1] https://bugs.debian.org/948309
[2] https://bugs.debian.org/948310

IBM can now upgrade from JDK 8 https://developer.ibm.com/javasdk/downloads/.

if this was their issue too.

I also sent same message to Apache Struts because the local expert there 
was recommending to use JDK 8 to people who had MAVEN warning caused 
when using Internationalisation API. (I looked through archive and saw that)

I also sent same message to Apache NetBeans because they were using 
Maven 3.3.9 (2015)  which knows nothing about the  trouble some java 
classes.

 > Well - why do you think someone is calling you names? Mark did not, 
right?

Mark T refer to me as "troll"

I am not part of the fashion victim of *nix, so  Mr Shultz also referred 
to me as a "troll".


On 06/01/2020 21:45, logo wrote:
> Well - why do you think someone is calling you names? Mark did not, right?
>
>> Am 06.01.2020 um 22:11 schrieb Zahid Rahman <za...@gmail.com>:
>>
>> Are you calling me names  ?
>>
>> On Mon, 6 Jan 2020, 20:35 Mark Thomas, <ma...@apache.org> wrote:
>>
>>> On 06/01/2020 16:29, Christopher Schultz wrote:
>>>> You have a right to a view, and you can troll all you want. But you
>>>> will be ignored.
>>> Up to a point.
>>>
>>> Users that continue to troll will be unsubscribed and blocked from
>>> re-subscribing.
>>>
>>> As a general reminder aimed at keeping noise down on the list:
>>>
>>> Please don't feed the trolls.
>>>
>>>
>>> Mark
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
-- 
www.backbutton.co.uk
♡۶¯\_(ツ)_/¯ ♡۶
Marriage of loose and tight coupling
-> healthy applications
               ♡۶
java -cp classpath class-path


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by logo <lo...@kreuser.name>.
Well - why do you think someone is calling you names? Mark did not, right?

> Am 06.01.2020 um 22:11 schrieb Zahid Rahman <za...@gmail.com>:
> 
> Are you calling me names  ?
> 
> On Mon, 6 Jan 2020, 20:35 Mark Thomas, <ma...@apache.org> wrote:
> 
>> On 06/01/2020 16:29, Christopher Schultz wrote:
>>> You have a right to a view, and you can troll all you want. But you
>>> will be ignored.
>> 
>> Up to a point.
>> 
>> Users that continue to troll will be unsubscribed and blocked from
>> re-subscribing.
>> 
>> As a general reminder aimed at keeping noise down on the list:
>> 
>> Please don't feed the trolls.
>> 
>> 
>> Mark
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Zahid Rahman <za...@gmail.com>.
Are you calling me names  ?

On Mon, 6 Jan 2020, 20:35 Mark Thomas, <ma...@apache.org> wrote:

> On 06/01/2020 16:29, Christopher Schultz wrote:
> > You have a right to a view, and you can troll all you want. But you
> > will be ignored.
>
> Up to a point.
>
> Users that continue to troll will be unsubscribed and blocked from
> re-subscribing.
>
> As a general reminder aimed at keeping noise down on the list:
>
> Please don't feed the trolls.
>
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Mark Thomas <ma...@apache.org>.
On 06/01/2020 16:29, Christopher Schultz wrote:
> You have a right to a view, and you can troll all you want. But you
> will be ignored.

Up to a point.

Users that continue to troll will be unsubscribed and blocked from
re-subscribing.

As a general reminder aimed at keeping noise down on the list:

Please don't feed the trolls.


Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Zahid,

On 1/6/20 04:55, zahid wrote:
> 00000000000000hhhhh
> 
>>> Have ever heard of *which* in windows ? Yea, no "which" - but
>>> have you tried "where" on Win? Could also use a "for" in Win
>>> (if you understand how to do it).
>> 
>> kub18@UB18:~$ which java /usr/bin/java kub18@UB18:~$ whereis
>> java java: /usr/bin/java /usr/share/java
>> /usr/share/man/man1/java.1.gz kub18@UB18:~$
> 
>> There is no "which", "whereis" or "find" because window users I
>> have file explorer, it is a GUI, It makes  use of the screen
>> attached to the computer.Kubuntu , KDE  are catching up with MS
>> windows. Ummm. Linux came *after* Unix.
> 
> there is  a rumour flying around that Linus Torvalds stole the
> kernel source code.
> 
> I guess the chicken had to come first to lay the egg , for an egg
> thief to steal the egg.

Easily debunked by looking at the source code of both. Linux looks
like Linux. BSD looks like UNIX. I can start a rumor that Linux
Torvalds stole the code to the Windows kernel.

>> Okay, no "find" but have you tried: dir /s <drive:>\<pattern> ?
> 
> windows explorer is another name for GUI no command line tries
> needed.

Let's agree that you like Windows and others do not. This is not an
argument worth having here.

>> Because it's terse (BTW, the dash is supposed to be connected to
>> "cp", as "-cp")
> I use the compiler as a spell checker or as some refer to it as
> syntax checker. If I do not leave a space between - and cp then the
> syntax checker would have nothing to do ......   you could try
> grammarly maybe.
> 
> -cp <class search path of directories and zip/jar files> -classpath
> <class search path of directories and zip/jar files> --class-path
> <class search path of directories and zip/jar files> A : separated
> list of directories, JAR archives, and ZIP archives to search for
> class files.
> 
>> You missed one - the CLASSPATH environment variable Rwong -
>> Class-Path is used in the Manifest.
> 
> No  MR R."WONG" you missed all the points. Put a dot in your
> CLASSPATH
> 
>> Because it's descriptive and self-commenting
> I guess all those *.nix argument flags like ls -a -A -b -B  are
> examples of Software Engineering Naming Conventions at its best.

Have a look at Powershell and all the command-lets or whatever. They
are moving toward UNIX-style command-line power because Windows
administrators have been complaining since the beginning that Windows
is a PITA to use.

Most UNIX-style programs have a short option (for brevity) and a long
option (for readability). When you type an option on the command-line,
you don't want to have to type forever. You learn the shortcuts.
Nobody wants to type "ls --display-long-output-format" so we do "ls
- -l". Similar to "DIR" on MS-DOS/Windows CLI. Look at all those
single-letter options, there.

> java -cp was too hard to figure out so you had to have a more 
> description version java -classpath. I thought maybe it was because
> you want to get paid by the number of letters you type.
> 
>> No, but that's because the security model in Windows is
>> *different*
> "chmod" is like taking the house keys away from house owner,
> strange idea of security.

I would argue the opposite: it's handing them the keys.

> That is my view. I hope you appreciate I have a right to a view
> point.

You have a right to a view, and you can troll all you want. But you
will be ignored.

> You could always chmod 777 * and you will have MS WINDOWS friendly
> user experience.

There is no need to execute a TXT file. Why make the file executable?

What about a .EXE file that you deem dangerous? Maybe it's a trojan or
whatever. You need the file around for some reason but don't want
anyone to execute it?

Or the opposite? You want to be able to execute a .py file. AFAIK, you
can't do that on Windows. You have to run "python foo.py".

It's convenient to both be able to enable and disable executability on
a file, not based upon its file extension but some arbitrary criteria
you decide.

- -chris

> On 06/01/2020 08:57, calder wrote:
> 
>> On Sat, Jan 4, 2020 at 7:26 PM zahid <za...@gmail.com>
>> wrote:
>> 
>>> Have ever heard of "*chmod*" in windows ?
>> No, but that's because the security model in Windows is
>> *different* than for *nix OSes. On Win, there's attrib, xcacls,
>> cacls, and icacls, but none of those truly match was chmod does. 
>> So, one needs to understand the underlying models for *nix and
>> Windows to properly describe the differences.
>> 
>>> Have ever heard of *which* in windows ?
>> Yea, no "which" - but have you tried "where" on Win? Could also
>> use a "for" in Win (if you understand how to do it).
>> 
>>> or *find* in windows ?
>> Okay, no "find" but have you tried:  dir /s <drive:>\<pattern> ?
>> 
>>> why is this same unique behaviour in Unix which came after
>>> Linux.
>> Ummm.  Linux came *after* Unix.
>> 
>>> why is there three ways to do same thing  ? java - cp
>> Because it's terse (BTW, the dash is supposed to be connected to
>> "cp", as "-cp")
>> 
>>> java - classpath
>> Because it's descriptive and self-commenting (BTW, the dash is
>> supposed to be connected to "classpath", as "-classpath")
>> 
>>> java - class-path
>> Rwong - Class-Path is used in the Manifest.
>> 
>> You missed one - the CLASSPATH environment variable
> 
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4TYG8ACgkQHPApP6U8
pFgr8hAAobsuJFSwbReb+n4A7wqzOklvKJNexAOfTt7Nk7EOiGBBfoT5UvhuTji7
MFbHGiOoKardU3MDQi3BSB3dlTaATxgC/fTgzSFVveg30EWztViTfsa+mvg4aTKC
gxqr6d1pdwEeTVUwiuu35l61Ve8F4APVuC63/WsZAov8opS+rzIYW+JXIFHZGcmp
v1pNeUvzaQLfR8ne4NBwyUn9vM6z5VyriAfX6PVdD5e6LIzuglOG6D+Cz8vgHtYx
6+athiWeIXLv7WJ0KysgFVTzbKehxiDeiTqWQSoezUyJnuiH85F2f/k3klmHpIaq
EYO01yEY2pm84VmH0jgmboG/5lyRNTMlka24IHZ9ALoCkNLe8E784Rryod8AwLiN
J34ScIg84+IWhCiHadv/qSjuxbrjkuZq6bbPlN26l6rpYbYLLO2VqOCHEL5J4OU1
hjnYCY2BmxXz9CQszDn6nZmRcex99bYDb9A7Xcvnuigwn56mnz++4OYHHTx0W4m8
aFJCSrKwXDuZL3MGK7SFSUcsWmmlzrqp+MT4uEcg5Gqom7Y9DNi4lXaxumLB1C6S
TonL5Kkj71KSSSOWVkGwVVWU6Yp5v4Mnr7zNgcvNTmkdWGrn0AYXGMgicQGxsNoA
acSoU21E/L265ajdvLaWNSkNzqM25VGb7G34Qol2/vZuDkNyjy0=
=/tP6
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by zahid <za...@gmail.com>.
00000000000000hhhhh

> > Have ever heard of *which* in windows ?
> >Yea, no "which" - but have you tried "where" on Win?
> > Could also use a "for" in Win (if you understand how to do it).
>
> kub18@UB18:~$ which java
> /usr/bin/java
> kub18@UB18:~$ whereis java
> java: /usr/bin/java /usr/share/java /usr/share/man/man1/java.1.gz
> kub18@UB18:~$

> There is no "which", "whereis" or "find" because window users I have file explorer, it is a GUI, It makes  use of the screen attached to the computer.Kubuntu , KDE  are catching up with MS windows.
 > Ummm. Linux came *after* Unix.

there is  a rumour flying around that Linus Torvalds stole the kernel 
source code.

I guess the chicken had to come first to lay the egg , for an egg thief 
to steal the egg.


 > Okay, no "find" but have you tried: dir /s <drive:>\<pattern> ?

windows explorer is another name for GUI no command line tries needed.


> Because it's terse (BTW, the dash is supposed to be connected to "cp", as "-cp")
I use the compiler as a spell checker or as some refer to it as syntax checker.
If I do not leave a space between - and cp then the syntax checker
would have nothing to do ......   you could try grammarly maybe.

-cp <class search path of directories and zip/jar files>
     -classpath <class search path of directories and zip/jar files>
     --class-path <class search path of directories and zip/jar files>
                   A : separated list of directories, JAR archives,
                   and ZIP archives to search for class files.

> You missed one - the CLASSPATH environment variable
>Rwong - Class-Path is used in the Manifest.

No  MR R."WONG" you missed all the points. Put a dot in your CLASSPATH
  
> Because it's descriptive and self-commenting
I guess all those *.nix argument flags like
ls -a -A -b -B  are examples of Software Engineering Naming Conventions at its best.

java -cp was too hard to figure out so you had to have a more description version java -classpath.
I thought maybe it was because you want to get paid by the number of letters you type.

> No, but that's because the security model in Windows is *different*
"chmod" is like taking the house keys away from house owner, strange idea of security.
That is my view. I hope you appreciate I have a right to a view point.

You could always chmod 777 * and you will have MS WINDOWS friendly user experience.
  

On 06/01/2020 08:57, calder wrote:

> On Sat, Jan 4, 2020 at 7:26 PM zahid <za...@gmail.com> wrote:
>
>> Have ever heard of "*chmod*" in windows ?
> No, but that's because the security model in Windows is *different*
> than for *nix OSes.
> On Win, there's attrib, xcacls, cacls, and icacls, but none of those
> truly match was chmod does.
> So, one needs to understand the underlying models for *nix and Windows
> to properly describe the differences.
>
>> Have ever heard of *which* in windows ?
> Yea, no "which" - but have you tried "where" on Win?
> Could also use a "for" in Win (if you understand how to do it).
>
>>   or *find* in windows ?
> Okay, no "find" but have you tried:  dir /s <drive:>\<pattern> ?
>
>> why is this same unique behaviour in Unix which came after Linux.
> Ummm.  Linux came *after* Unix.
>
>> why is there three ways to do same thing  ?
>> java - cp
> Because it's terse (BTW, the dash is supposed to be connected to "cp", as "-cp")
>
>> java - classpath
> Because it's descriptive and self-commenting
> (BTW, the dash is supposed to be connected to "classpath", as "-classpath")
>
>> java - class-path
> Rwong - Class-Path is used in the Manifest.
>
> You missed one - the CLASSPATH environment variable

-- 
www.backbutton.co.uk
¯\_(ツ)_/¯ ♡۶
java cp classpath class-path
Marriage of loose and tight coupling -> healthy applications


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by calder <ca...@gmail.com>.
On Sat, Jan 4, 2020 at 7:26 PM zahid <za...@gmail.com> wrote:

> Have ever heard of "*chmod*" in windows ?
No, but that's because the security model in Windows is *different*
than for *nix OSes.
On Win, there's attrib, xcacls, cacls, and icacls, but none of those
truly match was chmod does.
So, one needs to understand the underlying models for *nix and Windows
to properly describe the differences.

> Have ever heard of *which* in windows ?
Yea, no "which" - but have you tried "where" on Win?
Could also use a "for" in Win (if you understand how to do it).

>  or *find* in windows ?
Okay, no "find" but have you tried:  dir /s <drive:>\<pattern> ?

> why is this same unique behaviour in Unix which came after Linux.
Ummm.  Linux came *after* Unix.

> why is there three ways to do same thing  ?
> java - cp
Because it's terse (BTW, the dash is supposed to be connected to "cp", as "-cp")

> java - classpath
Because it's descriptive and self-commenting
(BTW, the dash is supposed to be connected to "classpath", as "-classpath")

> java - class-path
Rwong - Class-Path is used in the Manifest.

You missed one - the CLASSPATH environment variable

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Zahid Rahman <za...@gmail.com>.
 >Point The email header says  I tried 777.

There are common commands used on  *.nix  which are never used Ms-windows.
That's one of them.

It is not rant. It is sarcasm.

 I use " find"  all the time when I don't ever need it on windows.


On Mon, 6 Jan 2020, 16:10 Christopher Schultz, <ch...@christopherschultz.net>
wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Zahid,
>
> On 1/4/20 20:26, zahid wrote:
> >
> > Actually this is *one of many *punishments following the sin of
> > choosing *.nix
> >
> > and not Microsoft Windows.
> >
> > Have ever heard of "*chmod*" in windows ?
> >
> > MS windows trust you with your machine.
> >
> > You bought it , you paid for it , you own it.
> >
> >
> > although you have many ways of installing software.
> >
> > apt , apt-get yum , blah blah.
> >
> > You need to familiarise yourself with *find  / -name java* *  ,
> > which java*  because you have no idea where the installer installed
> > the software you just installed on "your machine",
> >
> > Have ever heard of *which* or *find* in windows ?
> >
> >
> > you can be in a directory in one terminal and delete it form
> > another terminal .
> >
> > Is that  linux security  feature ?
> >
> > can you do the same  in windows  ?
> >
> > what are others benefits you can enjoy in MS Windows because of
> > this particular behaviour is not same in MS Windows ?
> >
> > After you deleted the directory you are in from somewhere else you
> > will end up in trash literally.
> >
> > why  is this same unique  behaviour in Unix which came after
> > Linux.
> >
> >
> > you see anything what's wrong with this ? can you see the missing
> > the /r /n
> >
> > manifest.txt
> >
> > Main-Class:/classname /
> >
> > why does manifest.text must have /r {carriage} or  /n {newline}.
> >
> > Is it because jvm.dll it was written in C. C programming language
> > also has the same feature.
> >
> >
> > why is there three ways to do same thing  ?
> >
> > java - cp
> >
> > java - classpath
> >
> > java - class-path
>
> LOL this is the first time I've seen a pro-MS rant saying that running
> Java on Windows is easier.
>
> I didn't understand any individual point. Just the general hatred for
> *NIX. What was the point of this post, again?
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4TW/4ACgkQHPApP6U8
> pFh5/Q/+OmDmoFUvDzeA/+J57bHF+T/LHh0r0CBuZADF2m+N9OMWm6QGWsZnHtIT
> 0oL9iSnN+7UKbJa7YBCddLKl9nYJfrxEDd3GeCLgY4c9LbICcnjO4BjwEfG8/K+a
> cp7XXHQHLq+YoYJBP3U289Y6yFsVTapD8HMg9kacAtFQOgn1FUZw0TfAIlXCdBM2
> mWdJgdoXEX2s23Hz/8bUafz4Gd772gYA1j1zilhc8Cp9fDmJgf0EU1sIcUCjFRZx
> wQnETG9AJbKdt0vH6svg7ML7oP5f10bHSe+9pLuSe/tMJNgsDQTyvEkOx1H9WenP
> J8crastrKTJu5qWs4Dsu5DH+bm+Dxz5D8kCUr1wzBgrvYwPIfxs/VOo/fC0fVvk8
> v0XvNUam1V5PFLb1yE0bfVyCZtEwKaetyR46N2+EB5Kp7lz0o0RUf39G29cMu07R
> SYhgz1AjoGwpisAWMX3qCxouWIU46ouDS5w1UTR7ZvGB0d1TsHPGUikp9eRt5PdC
> xVpEMMqZ6OhJ7Y7Ei9d+Srmrye+hRArbUZxGpKQWRazjHKCN9Q+E6d1kG/sf/HJV
> jU8fjhPRnjlI8vewf1yvU9Xn4rd4SGejudaXK4hzN8d54WSzQty5c+3/ts7ckqYc
> M4SPdQeHec0RQjwYMnDAGK/4pxhVOMDwJLNwvW3bCQdebFvJe3M=
> =wN50
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: [OT] Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Zahid,

On 1/4/20 20:26, zahid wrote:
> 
> Actually this is *one of many *punishments following the sin of
> choosing *.nix
> 
> and not Microsoft Windows.
> 
> Have ever heard of "*chmod*" in windows ?
> 
> MS windows trust you with your machine.
> 
> You bought it , you paid for it , you own it.
> 
> 
> although you have many ways of installing software.
> 
> apt , apt-get yum , blah blah.
> 
> You need to familiarise yourself with *find  / -name java* *  ,
> which java*  because you have no idea where the installer installed
> the software you just installed on "your machine",
> 
> Have ever heard of *which* or *find* in windows ?
> 
> 
> you can be in a directory in one terminal and delete it form
> another terminal .
> 
> Is that  linux security  feature ?
> 
> can you do the same  in windows  ?
> 
> what are others benefits you can enjoy in MS Windows because of
> this particular behaviour is not same in MS Windows ?
> 
> After you deleted the directory you are in from somewhere else you
> will end up in trash literally.
> 
> why  is this same unique  behaviour in Unix which came after
> Linux.
> 
> 
> you see anything what's wrong with this ? can you see the missing
> the /r /n
> 
> manifest.txt
> 
> Main-Class:/classname /
> 
> why does manifest.text must have /r {carriage} or  /n {newline}.
> 
> Is it because jvm.dll it was written in C. C programming language
> also has the same feature.
> 
> 
> why is there three ways to do same thing  ?
> 
> java - cp
> 
> java - classpath
> 
> java - class-path

LOL this is the first time I've seen a pro-MS rant saying that running
Java on Windows is easier.

I didn't understand any individual point. Just the general hatred for
*NIX. What was the point of this post, again?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4TW/4ACgkQHPApP6U8
pFh5/Q/+OmDmoFUvDzeA/+J57bHF+T/LHh0r0CBuZADF2m+N9OMWm6QGWsZnHtIT
0oL9iSnN+7UKbJa7YBCddLKl9nYJfrxEDd3GeCLgY4c9LbICcnjO4BjwEfG8/K+a
cp7XXHQHLq+YoYJBP3U289Y6yFsVTapD8HMg9kacAtFQOgn1FUZw0TfAIlXCdBM2
mWdJgdoXEX2s23Hz/8bUafz4Gd772gYA1j1zilhc8Cp9fDmJgf0EU1sIcUCjFRZx
wQnETG9AJbKdt0vH6svg7ML7oP5f10bHSe+9pLuSe/tMJNgsDQTyvEkOx1H9WenP
J8crastrKTJu5qWs4Dsu5DH+bm+Dxz5D8kCUr1wzBgrvYwPIfxs/VOo/fC0fVvk8
v0XvNUam1V5PFLb1yE0bfVyCZtEwKaetyR46N2+EB5Kp7lz0o0RUf39G29cMu07R
SYhgz1AjoGwpisAWMX3qCxouWIU46ouDS5w1UTR7ZvGB0d1TsHPGUikp9eRt5PdC
xVpEMMqZ6OhJ7Y7Ei9d+Srmrye+hRArbUZxGpKQWRazjHKCN9Q+E6d1kG/sf/HJV
jU8fjhPRnjlI8vewf1yvU9Xn4rd4SGejudaXK4hzN8d54WSzQty5c+3/ts7ckqYc
M4SPdQeHec0RQjwYMnDAGK/4pxhVOMDwJLNwvW3bCQdebFvJe3M=
=wN50
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by zahid <za...@gmail.com>.
Actually this is *one of many *punishments following the sin of choosing 
*.nix

and not Microsoft Windows.

Have ever heard of "*chmod*" in windows ?

MS windows trust you with your machine.

You bought it , you paid for it , you own it.


although you have many ways of installing software.

apt , apt-get yum , blah blah.

You need to familiarise yourself with *find  / -name java* *  ,   which 
java*  because you have no idea where the installer installed the 
software you just installed on "your machine",

Have ever heard of *which* or *find* in windows ?


you can be in a directory in one terminal and delete it form another 
terminal .

Is that  linux security  feature ?

can you do the same  in windows  ?

what are others benefits you can enjoy in MS Windows because of this 
particular behaviour is not same in MS Windows ?

After you deleted the directory you are in from somewhere else you will 
end up in trash literally.

why  is this same unique  behaviour in Unix which came after Linux.


you see anything what's wrong with this ? can you see the missing the /r /n

manifest.txt

Main-Class:/classname /

why does manifest.text must have /r {carriage} or  /n {newline}.

Is it because jvm.dll it was written in C. C programming language also 
has the same feature.


why is there three ways to do same thing  ?

java - cp

java - classpath

java - class-path



www.backbutton.co.uk
¯\_(ツ)_/¯
Marry loose with tight
coupling = healthy applications

On 04/01/2020 22:51, Emmanuel Bourg wrote:
> Le 04/01/2020 à 16:06, Pham Huu Bang a écrit :
>
>> Thanks for this link
>> https://salsa.debian.org/java-team/tomcat9/blob/master/debian/README.Debian.
>> But I cannot *read* the file from /tmp (not *write* file to /tmp). The
>> strange thing is, it can read another file from another location, e.g in
>> /opt/:
> The tomcat9 service is configured with a private /tmp directory (using
> the 'PrivateTmp=yes' systemd directive). So Tomcat can't see what other
> applications write to /tmp, and temporary files written by Tomcat are
> out of reach from the other applications.
>
> This is a security hardening setting that can be overridden as described
> in the README file Olaf mentioned.
>
> Emmanuel Bourg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
-- 
www.backbutton.co.uk
¯\_(ツ)_/¯
Marry loose with tight
coupling
= healthy applications


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 04/01/2020 à 16:06, Pham Huu Bang a écrit :

> Thanks for this link
> https://salsa.debian.org/java-team/tomcat9/blob/master/debian/README.Debian.
> But I cannot *read* the file from /tmp (not *write* file to /tmp). The
> strange thing is, it can read another file from another location, e.g in
> /opt/:

The tomcat9 service is configured with a private /tmp directory (using
the 'PrivateTmp=yes' systemd directive). So Tomcat can't see what other
applications write to /tmp, and temporary files written by Tomcat are
out of reach from the other applications.

This is a security hardening setting that can be overridden as described
in the README file Olaf mentioned.

Emmanuel Bourg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Pham Huu Bang <a0...@gmail.com>.
Hi,

Thanks for this link
https://salsa.debian.org/java-team/tomcat9/blob/master/debian/README.Debian.
But I cannot *read* the file from /tmp (not *write* file to /tmp). The
strange thing is, it can read another file from another location, e.g in
/opt/:

ls -ltr /opt/rasdaman/etc/petascope.properties
-rwxrwxrwx 1 rasdaman rasdaman 13095 Jan  3 16:25
/opt/rasdaman/etc/petascope.properties

+ java code:

 File tempFile = new File("/opt/rasdaman/etc/petascope.properties");
 log.info("WITH FOLDER /tmp Exists: " + tempFile.exists() + ", readable: "
+ tempFile.canRead() + ", writable: " + tempFile.canWrite());

+ with log results:

WITH FOLDER /tmp Exists: true, readable: true, writable: false

On Sat, 4 Jan 2020 at 15:58, Olaf Kock <to...@olafkock.de> wrote:

>
> On 04.01.20 15:35, bphamhuu wrote:
> > Hello,
> >
> > I have a java web application by Tomcat 9 servlet container which tries
> to
> > read a file in /tmp folder with 777 permission on Ubuntu 18.04
> >
> > ls -ltr /tmp/test.txt
> > -rwxrwxrwx 1 vagrant vagrant 10 Jan  3 17:03 /tmp/test.txt
> >
> > The java code is:
> >
> >     try {
> >         result = FileUtils.readFileToString(new File("/tmp/test.txt"));
> >     } catch (IOException ex) {
> >         log.info("##### Cannot read file. Reason: " + ex.getMessage());
> >     }
> >
> > But it always show the error
> >
> > ##### Cannot read file. Reason: File '/tmp/test.txt' does not exist
>
>
> You're running tomcat on Ubuntu, I'm assuming you use the version from
> the Debian repositories, not one that you downloaded from
> tomcat.apache.org.
>
> Debian's tomcat is sandboxed. Read /usr/share/doc/tomcat9/README.Debian
> (or an online version at
> https://salsa.debian.org/java-team/tomcat9/blob/master/debian/README.Debian
> )
> for more information (search for "sandboxed" to find the proper place)
>
> Credits: I keep this under my belt since Emmanuel Bourg answered a
> similar question on this list a while back.
>
> And don't forget to reset the 777 permissions.
>
> Olaf
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

-- 

*Bang Pham Huu *
*-------------------------------------------------------------------------------------*
*Master of Science - Research Assistant at Field Monitoring Center - 4 F,
E3 BuildingViet Nam - Ha Noi National University - University of
Engineering and Technology*
*Email: a09550@gmail.com <a0...@gmail.com> - Tel: +84 164.6339.217*

*“Life is like riding a bicycle. To keep your balance, you must keep
moving.”― Albert Einstein*

Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Olaf Kock <to...@olafkock.de>.
On 04.01.20 15:35, bphamhuu wrote:
> Hello,
>
> I have a java web application by Tomcat 9 servlet container which tries to
> read a file in /tmp folder with 777 permission on Ubuntu 18.04
>
> ls -ltr /tmp/test.txt
> -rwxrwxrwx 1 vagrant vagrant 10 Jan  3 17:03 /tmp/test.txt
>
> The java code is:
>
>     try {
>         result = FileUtils.readFileToString(new File("/tmp/test.txt"));
>     } catch (IOException ex) {
>         log.info("##### Cannot read file. Reason: " + ex.getMessage());
>     }
>
> But it always show the error
>
> ##### Cannot read file. Reason: File '/tmp/test.txt' does not exist


You're running tomcat on Ubuntu, I'm assuming you use the version from
the Debian repositories, not one that you downloaded from tomcat.apache.org.

Debian's tomcat is sandboxed. Read /usr/share/doc/tomcat9/README.Debian
(or an online version at
https://salsa.debian.org/java-team/tomcat9/blob/master/debian/README.Debian)
for more information (search for "sandboxed" to find the proper place)

Credits: I keep this under my belt since Emmanuel Bourg answered a
similar question on this list a while back.

And don't forget to reset the 777 permissions.

Olaf


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Pham Huu Bang <a0...@gmail.com>.
And here is the full stack trace from my java web application using Spring Boot.

 INFO [2020-01-04 14:42:08] RemoteCoverageUtil@80: ##### Cannot read
file. Reason: File '/tmp/test.txt' does not exist
java.io.FileNotFoundException: File '/tmp/test.txt' does not exist
    at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:254)
    at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1641)
    at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1659)
    at
petascope.wcst.helpers.RemoteCoverageUtil.getRemoteGMLCoverage(RemoteCoverageUtil.java:78)
    at
petascope.wcst.handlers.InsertCoverageHandler.handleRemoteCoverageInsert(InsertCoverageHandler.java:120)
    at
petascope.wcst.handlers.InsertCoverageHandler.handle(InsertCoverageHandler.java:103)
    at
petascope.controller.handler.service.KVPWCSTServiceHandler.handleInsertCoverageRequest(KVPWCSTServiceHandler.java:145)
    at
petascope.controller.handler.service.KVPWCSTServiceHandler.handle(KVPWCSTServiceHandler.java:99)
    at
petascope.controller.PetascopeController.requestDispatcher(PetascopeController.java:190)
    at
petascope.controller.PetascopeController.handleGet(PetascopeController.java:115)
    at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
    at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
    at
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
    at
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
    at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
    at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
    at
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
    at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
    at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
    at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
    at
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at
org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
    at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at
org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105)
    at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
    at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at
org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:115)
    at
org.springframework.boot.web.support.ErrorPageFilter.access$000(ErrorPageFilter.java:59)
    at
org.springframework.boot.web.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:90)
    at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at
org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:108)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    at
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
    at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
    at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
    at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
    at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:844)


On Sat, 4 Jan 2020 at 15:42, Pham Huu Bang <a0...@gmail.com> wrote:

> Hi,
>
> The stack trace is short with FileNotFoundException
>
> ##### Cannot read file. Reason: File '/tmp/test.txt' does not exist
> java.io.FileNotFoundException: File '/tmp/test.txt' does not exist
> at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:254)
> at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1641)
> at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1659)
>
> On Sat, 4 Jan 2020 at 15:38, M. Manna <ma...@gmail.com> wrote:
>
>> Hi,
>>
>> On Sat, 4 Jan 2020 at 14:36, bphamhuu <a0...@gmail.com> wrote:
>>
>> > Hello,
>> >
>> > I have a java web application by Tomcat 9 servlet container which tries
>> to
>> > read a file in /tmp folder with 777 permission on Ubuntu 18.04
>> >
>> > ls -ltr /tmp/test.txt
>> > -rwxrwxrwx 1 vagrant vagrant 10 Jan  3 17:03 /tmp/test.txt
>> >
>> > The java code is:
>> >
>> >     try {
>> >         result = FileUtils.readFileToString(new File("/tmp/test.txt"));
>> >     } catch (IOException ex) {
>> >         log.info("##### Cannot read file. Reason: " + ex.getMessage());
>> >     }
>> >
>> > But it always show the error
>> >
>> > ##### Cannot read file. Reason: File '/tmp/test.txt' does not exist
>> >
>> > This test file can be opened fine by a normal user on a terminal window
>> > (example user: vagrant).
>> >
>> > vagrant@ras:~$ cat /tmp/test.txt
>> > asdasdsad
>> >
>> > Does anybody know about the problem with Tomcat 9? I'll need the java
>> web
>> > application to read this test file as string.
>> >
>> > Thanks,
>> >
>> >
>> >   What is the full stack trace?
>>
>> >
>> > --
>> > Sent from: http://tomcat.10.x6.nabble.com/Tomcat-User-f1968778.html
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> > For additional commands, e-mail: users-help@tomcat.apache.org
>> >
>> >
>>
>
>
> --
>
> *Bang Pham Huu *
>
> *-------------------------------------------------------------------------------------*
> *Master of Science - Research Assistant at Field Monitoring Center - 4 F,
> E3 BuildingViet Nam - Ha Noi National University - University of
> Engineering and Technology*
> *Email: a09550@gmail.com <a0...@gmail.com> - Tel: +84 164.6339.217*
>
> *“Life is like riding a bicycle. To keep your balance, you must keep
> moving.”― Albert Einstein*
>
>
>
>
>
>
>
>

-- 

*Bang Pham Huu *
*-------------------------------------------------------------------------------------*
*Master of Science - Research Assistant at Field Monitoring Center - 4 F,
E3 BuildingViet Nam - Ha Noi National University - University of
Engineering and Technology*
*Email: a09550@gmail.com <a0...@gmail.com> - Tel: +84 164.6339.217*

*“Life is like riding a bicycle. To keep your balance, you must keep
moving.”― Albert Einstein*

Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by Pham Huu Bang <a0...@gmail.com>.
Hi,

The stack trace is short with FileNotFoundException

##### Cannot read file. Reason: File '/tmp/test.txt' does not exist
java.io.FileNotFoundException: File '/tmp/test.txt' does not exist
at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:254)
at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1641)
at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1659)

On Sat, 4 Jan 2020 at 15:38, M. Manna <ma...@gmail.com> wrote:

> Hi,
>
> On Sat, 4 Jan 2020 at 14:36, bphamhuu <a0...@gmail.com> wrote:
>
> > Hello,
> >
> > I have a java web application by Tomcat 9 servlet container which tries
> to
> > read a file in /tmp folder with 777 permission on Ubuntu 18.04
> >
> > ls -ltr /tmp/test.txt
> > -rwxrwxrwx 1 vagrant vagrant 10 Jan  3 17:03 /tmp/test.txt
> >
> > The java code is:
> >
> >     try {
> >         result = FileUtils.readFileToString(new File("/tmp/test.txt"));
> >     } catch (IOException ex) {
> >         log.info("##### Cannot read file. Reason: " + ex.getMessage());
> >     }
> >
> > But it always show the error
> >
> > ##### Cannot read file. Reason: File '/tmp/test.txt' does not exist
> >
> > This test file can be opened fine by a normal user on a terminal window
> > (example user: vagrant).
> >
> > vagrant@ras:~$ cat /tmp/test.txt
> > asdasdsad
> >
> > Does anybody know about the problem with Tomcat 9? I'll need the java web
> > application to read this test file as string.
> >
> > Thanks,
> >
> >
> >   What is the full stack trace?
>
> >
> > --
> > Sent from: http://tomcat.10.x6.nabble.com/Tomcat-User-f1968778.html
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>


-- 

*Bang Pham Huu *
*-------------------------------------------------------------------------------------*
*Master of Science - Research Assistant at Field Monitoring Center - 4 F,
E3 BuildingViet Nam - Ha Noi National University - University of
Engineering and Technology*
*Email: a09550@gmail.com <a0...@gmail.com> - Tel: +84 164.6339.217*

*“Life is like riding a bicycle. To keep your balance, you must keep
moving.”― Albert Einstein*

Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

Posted by "M. Manna" <ma...@gmail.com>.
Hi,

On Sat, 4 Jan 2020 at 14:36, bphamhuu <a0...@gmail.com> wrote:

> Hello,
>
> I have a java web application by Tomcat 9 servlet container which tries to
> read a file in /tmp folder with 777 permission on Ubuntu 18.04
>
> ls -ltr /tmp/test.txt
> -rwxrwxrwx 1 vagrant vagrant 10 Jan  3 17:03 /tmp/test.txt
>
> The java code is:
>
>     try {
>         result = FileUtils.readFileToString(new File("/tmp/test.txt"));
>     } catch (IOException ex) {
>         log.info("##### Cannot read file. Reason: " + ex.getMessage());
>     }
>
> But it always show the error
>
> ##### Cannot read file. Reason: File '/tmp/test.txt' does not exist
>
> This test file can be opened fine by a normal user on a terminal window
> (example user: vagrant).
>
> vagrant@ras:~$ cat /tmp/test.txt
> asdasdsad
>
> Does anybody know about the problem with Tomcat 9? I'll need the java web
> application to read this test file as string.
>
> Thanks,
>
>
>   What is the full stack trace?

>
> --
> Sent from: http://tomcat.10.x6.nabble.com/Tomcat-User-f1968778.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>