chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Default file creation mode for core/scsh-process sets executable bit


From: Vasilij Schneidermann
Subject: Default file creation mode for core/scsh-process sets executable bit
Date: Thu, 7 May 2020 16:43:47 +0200

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.

Vasilij

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]