emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] #+CALL - permission error -bash
@ 2024-05-02 14:41 vitalij
  2024-05-02 14:55 ` Ihor Radchenko
  2024-05-02 17:05 ` Leo Butler
  0 siblings, 2 replies; 4+ messages in thread
From: vitalij @ 2024-05-02 14:41 UTC (permalink / raw)
  To: emacs-orgmode

in org-babel-sh-evaluate
 file:~/.emacs.d/elpa/org-9.6.28/ob-shell.el::300

this do apply: (process-file "/tmp/babel-NfRG9P/sh-script-jmKNA4"
 "/tmp/babel-NfRG9P/sh-stdin-o3CEm5" #<buffer  *temp*> nil nil)

I don't allow executables in /tmp folder!

How to make it this way:

(process-file "/use/bin/bash /tmp/babel-NfRG9P/sh-script-jmKNA4"
 "/tmp/babel-NfRG9P/sh-stdin-o3CEm5" #<buffer  *temp*> nil nil)

???

It is like when you do:
./a.sh

instead of:
bash a.sh

Emacs  : GNU Emacs 29.3 (build 1, x86_64-pc-linux-gnu, X toolkit)
 of 2024-05-01
Package: Org mode version 9.6.28 ( @ /home/u/.emacs.d/elpa/org-9.6.28/)
--
Best regards,


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] #+CALL - permission error -bash
  2024-05-02 14:41 [BUG] #+CALL - permission error -bash vitalij
@ 2024-05-02 14:55 ` Ihor Radchenko
  2024-05-03 10:24   ` Max Nikulin
  2024-05-02 17:05 ` Leo Butler
  1 sibling, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2024-05-02 14:55 UTC (permalink / raw)
  To: vitalij; +Cc: emacs-orgmode

vitalij@gmx.com writes:

> in org-babel-sh-evaluate
>  file:~/.emacs.d/elpa/org-9.6.28/ob-shell.el::300
>
> this do apply: (process-file "/tmp/babel-NfRG9P/sh-script-jmKNA4"
>  "/tmp/babel-NfRG9P/sh-stdin-o3CEm5" #<buffer  *temp*> nil nil)
>
> I don't allow executables in /tmp folder!

Why do you think that it is a bug in Org mode?
AFAIK, it is generally expected that anything can go into tmp.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] #+CALL - permission error -bash
  2024-05-02 14:41 [BUG] #+CALL - permission error -bash vitalij
  2024-05-02 14:55 ` Ihor Radchenko
@ 2024-05-02 17:05 ` Leo Butler
  1 sibling, 0 replies; 4+ messages in thread
From: Leo Butler @ 2024-05-02 17:05 UTC (permalink / raw)
  To: vitalij@gmx.com; +Cc: emacs-orgmode@gnu.org

On Thu, May 02 2024, vitalij@gmx.com wrote:

> in org-babel-sh-evaluate
>  file:~/.emacs.d/elpa/org-9.6.28/ob-shell.el::300
>
> this do apply: (process-file "/tmp/babel-NfRG9P/sh-script-jmKNA4"
>  "/tmp/babel-NfRG9P/sh-stdin-o3CEm5" #<buffer  *temp*> nil nil)
>
> I don't allow executables in /tmp folder!

How about:

(setq org-babel-temporary-directory
      (let ((temporary-file-directory "/path/you/prefer"))
        (make-temp-file "babel-" t)))

Leo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] #+CALL - permission error -bash
  2024-05-02 14:55 ` Ihor Radchenko
@ 2024-05-03 10:24   ` Max Nikulin
  0 siblings, 0 replies; 4+ messages in thread
From: Max Nikulin @ 2024-05-03 10:24 UTC (permalink / raw)
  To: vitalij; +Cc: emacs-orgmode

On 02/05/2024 21:55, Ihor Radchenko wrote:
> vitalij writes:
> 
>> in org-babel-sh-evaluate
>>   file:~/.emacs.d/elpa/org-9.6.28/ob-shell.el::300
>>
>> this do apply: (process-file "/tmp/babel-NfRG9P/sh-script-jmKNA4"
>>   "/tmp/babel-NfRG9P/sh-stdin-o3CEm5" #<buffer  *temp*> nil nil)
>>
>> I don't allow executables in /tmp folder!
> 
> Why do you think that it is a bug in Org mode?
> AFAIK, it is generally expected that anything can go into tmp.

There are various guides recommending noexec, however they warn that 
some issues should be expected.

Securing Debian Manual
- https://www.debian.org/doc/manuals/securing-debian-manual/ch04s10.en.html
   4.10. Mounting partitions the right way
- 
https://www.debian.org/doc/manuals/securing-debian-manual/checklist.en.html
   B.2. Configuration checklist

Security in Arch Linux wiki:
https://wiki.archlinux.org/title/Security#Mount_options
Mount options

>> How to make it this way:
>> 
>> (process-file "/use/bin/bash /tmp/babel-NfRG9P/sh-script-jmKNA4"
>>  "/tmp/babel-NfRG9P/sh-stdin-o3CEm5" #<buffer  *temp*> nil nil)
>> 
>> ???
>> 
>> It is like when you do:
>> ./a.sh
>> 
>> instead of:
>> bash a.sh

Likely you mean

(process-file "/usr/bin/bash"
  "/tmp/babel-NfRG9P/sh-stdin-o3CEm5" #<buffer  *temp*> nil 
"/tmp/babel-NfRG9P/sh-script-jmKNA4")

but it would ignore shebang. Try

#!/bin/sh -e
false
printf "Should not be executed\n"

So it is necessary to either drop :shebang or set temporary directory to 
a suitable path.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-03 10:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-02 14:41 [BUG] #+CALL - permission error -bash vitalij
2024-05-02 14:55 ` Ihor Radchenko
2024-05-03 10:24   ` Max Nikulin
2024-05-02 17:05 ` Leo Butler

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).