summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kyheku <kaz@kylheku.com>2020-03-10 22:33:24 -0700
committerKaz Kyheku <kaz@kylheku.com>2020-03-10 22:33:24 -0700
commitbbb650af0c211ef35580daecd975a096e71b0b3a (patch)
tree3744d8661a5b964fb8e6a5c96056b827ac960754 /txr.1
parentb0f3da66f6a9f0e911e167cb8e61eeaa1f75234c (diff)
downloadtxr-bbb650af0c211ef35580daecd975a096e71b0b3a.tar.gz
txr-bbb650af0c211ef35580daecd975a096e71b0b3a.tar.bz2
txr-bbb650af0c211ef35580daecd975a096e71b0b3a.zip
compile-file: propagate permissions for hash bang programs.
* share/txr/stdlib/compiler.tl (propagate-perms): New function. (compile-file-conditionally): If the source file is a hash bang script, then call propagate-perms just before closing the streams. * txr.1: Documented the permission propagation.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.122
1 files changed, 19 insertions, 3 deletions
diff --git a/txr.1 b/txr.1
index d64dda7e..39f555b3 100644
--- a/txr.1
+++ b/txr.1
@@ -70042,6 +70042,10 @@ circular structures are reproduced.
.SS* Treatment of The Hash Bang Line
+\*(TX supports the hash bang mechanism in compiled
+.code .tlo
+files, thereby allowing compiled scripts to be executable.
+
When a source file begins with the
.code #!
("hash-bang") character sequence, the file compiler propagates that
@@ -70051,9 +70055,21 @@ compiled file, subject to the following transformation: occurrences of
which are not followed by a dash are replaced with
.strn --compiled .
-\*(TX supports the hash bang mechanism in compiled
-.code .tlo
-files, thereby allowing compiled scripts to be executable.
+Furthermore, certain permissions are propagated from a hash bang source
+file to the target file. If the source file is executable to its owner,
+then the target file is made executable as if by using
+.code chmod
+with the
+.code +x
+mode: all the executable permissions that are allowed by the current
+.code umask
+are are enabled on the target file. If the target file is thus being marked
+executable, then additional permissions are also treated as follows. If the
+target file has the same owner as the source file, and the source file's setuid
+permission bit is set, then this is propagated to the target file. Similarly,
+if the target file has the same group owner as the source file, and the source
+file's group execute bit and setgid permission bit are set, then the setgid
+bit is set on the target file.
.SS* Compiled File Compatibility