[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Default file creation mode for core/scsh-process sets executable bit
From: |
Jörg F. Wittenberger |
Subject: |
Re: Default file creation mode for core/scsh-process sets executable bit |
Date: |
Sat, 9 May 2020 15:22:20 +0200 |
On Thu, 7 May 2020 16:43:47 +0200
Vasilij Schneidermann <address@hidden> wrote:
> Hello,
>
> I've noticed that when using process redirection in the scsh-process
> egg, they're always marked as executable. Observe:
>
> ^_^ csi -R scsh-process -e '(run (ls -l) (> ls.txt))'
> ^_^ ls -l ls.txt
> -rwxr--r-- 1 wasa wasa 515 May 7 16:34 ls.txt
>
> I've checked the output of `umask` and it's 022, meaning that the
> mode should be `0777 & !022` for directories and `0666 & !022` for
> files, which are 0755 and 0644 respectively. Digging a bit further
> this appears to be the fault of scsh-process using `file-open`
> without the optional mode argument which otherwise defaults to 0744
> in posixunix.scm. This is inconsistent with the behavior of other
> procedures such as `open-output-file` (0644).
>
> Which of the following options would you prefer?
>
> 1. Patching scsh-process to pass the correct file mask when using
> `file-open`.
> 2. Patching posixunix.scm to calculate a better default.
I strongly lean towards patching posixunix.scm -- I'm totally aware
that this could break things. But this default begs for security risks
too much IMHO.
Just my 0.02€
Jörg