D in SUSE Enterprise Linux

Jonathan M Davis newsgroup.d at jmdavisprog.com
Tue May 1 16:01:59 UTC 2018


On Tuesday, May 01, 2018 15:51:14 Vino via Digitalmars-d-learn wrote:
> On Tuesday, 1 May 2018 at 15:42:38 UTC, Jonathan M Davis wrote:
> > On Tuesday, May 01, 2018 15:18:12 Vino via Digitalmars-d-learn
> >
> > wrote:
> >> On Tuesday, 1 May 2018 at 15:04:43 UTC, rikki cattermole wrote:
> >> > On 02/05/2018 2:56 AM, Vino wrote:
> >> >> [...]
> >> >
> >> > Does this work?
> >> >
> >> > $ dmd -run foo.d
> >>
> >> Hi Rikki,
> >>
> >>   No, it is not working, rather getting an error, and the user
> >>
> >> i
> >> executed is the root user. if i compile the program as dmd
> >> <program name> and then execute it as ./<program name> it works
> >> fine, so is rdmd not supported in Linux.
> >>
> >> Error:
> >> /tmp/dmd_runqfz3ul: Permission denied
> >
> > That sounds like your /tmp is mounted with noexec. which won't
> > work with rdmd or any other program that expects to be able to
> > create a file in /tmp and run it. Presumably, you'll need to
> > change the settings in /etc/fstab so that /tmp is not mounted
> > with noexec.
> >
> > - Jonathan M Davis
>
> Hi Jonathan,
>
>    Yes the /tmp is mounted with noexec option , we should not
> change this option as it is a security violation so is there any
> other way we can make it work, it tried setting the tmp env
> variable to a local FS which is mounted with the noexec option
> but it did not work.

Whether it's really a security risk is up for debate, though I'm sure that
concerns over that would be why /tmp is mounted with noexec on your system.

Looking at rdmd --help, it does list a --tmpdir flag, so if you have another
directory that is not mounted noexec where you would consider it acceptable
to have temporary files be created and executed, then you can use --tmpdir
to tell rdmd to use it. So, presumably, the shebang line would then be
something like

#!/usr/bin/env rdmd --tmpdir=/some/other/tmp/dir

though I haven't tested it.

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list