| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When subprocesses are created using open-command,
open-process, run or sh, any streams not bound by
those functions are obtained from *stdin*, *stdout*
or *stderr*, as appropriate. Thus manipulating these
variables has the effect of redirecting not only
local output within the program but over coprocesses
as well.
* stream.c (struct save_fds): New type.
(FDS_IN, FDS_OUT, FDS_ERR): New macros.
(fds_init, fds_subst, fds_swizzle, fds_restore): New static
functions.
(open_command, open_process, run): "Swizzle" and restore
the standard file descriptors.
* txr.1: Updated documentation of affected function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This helps with setuid hash bang scripting on Mac OS,
and other plaforms where the interpreter executed out
of a hash bang script runs with orinary privilege,
even if marked setuid.
* sysif.c (exec_wrap): Static function turns extern.
* sysif.h (exec-wrap): Declared.
* txr.1: Documented --reexec. Added notes about setuid under
Hash Bang Support.
* txr.c (help): List --reexec option.
(txr_main): Implement --reexec option.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (path_test_set_entries): New elements in the list
for path-readable-to-me-p, path-read-writable-to-me-p, and
path-strictly-private-to-me-p.
* share/txr/stdlib/path-test.pl (sys:path-access): Test
bitwise combinations of permissions, so read+write
can be tested in one call.
(path-readable-to-me-p, path-read-writable-to-me-p,
path-strictly-private-to-me-p): New functions.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TXR now notices that it's running setgid, and
implements setgid logic for scripts.
* sysif.c (orig_egid, real_gid, is_setgid): New static
variables.
(repress_privilege): Treat real and effective
group ID similarly to user ID. Save them in global
variables, and set the is_setgid flag.
(drop_privilege): Drop setgid privilege similarly
to setuid. Operate selectively: if neither setuid
nor setgid is in effect, do nothing, but if just
one is in effect, don't do anything for the other.
(simulate_setuid): Function renamed to simulate_setuid_setgid.
A small change is made here: if the fstat fails, just drop
privilege, don't abort. Implement setgid operation
independently of setuid. The is_setgid and is_setuid
flags are manipulated here now to get the drop_privileges
function to selectively drop setuid if we are running
a script which is only segid, or drop setgid if we are running
a setuid only script.
* sysif.h (simulate_setuid): Declaration name change to
simulate_setuid_setgid.
* txr.c (txr_main): Follow rename of simulate_setuid.
* txr.1: SETUID OPERATION section changed to SETUID/SETGID
operation, and setgid description worked into the text.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (repress_privilege): Eliminate redundant
getuid call.
(drop_privilege): On some platforms,
setuid(getuid()) will not drop setuid non-root privilege. This
is fixed by using setresuid, if we have it, which we do on
Linux. On platforms where we don't have setresuid,
we try setuid(getuid()). Then after that if we are able
to change our effective user ID to the one we dropped,
we conclude that it didn't work and abort.
(simulate_setuid): Call drop_privilege instead of
repeating the naive privilege-dropping logic.
Check the result of seteuid; if it fails, then
drop privilege! Otherwise a txr that is setuid bob
will continue running as bob, if it fails to enact
setuid on a script owned by alice.
* txr.1: Rewrite SETUID OPERATION section in an attempt
to clarify the wording, fix formatting issues, and
describe the current implemenation of privilege dropping.
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Test for these functions.
* sysif.c (getresuid_wrap, getresgid_wrap, setresuid_wrap,
setresgid_wrap): New static function.
(sysif_init): Registered getresuid, setresgid, setresuid and
setresgid intrinsics.
* txr.1: Documented all four functions.
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Test for setgroups. New HAVE_SETGROUPS
preprocessor symbol for config/config.h.
* sysif.c (setgroups_wrap): New static function.
(sysif_init): Register intrinsic setgroups function.
* txr.1: Documented setgroups. Rearranged sections
so getgroups and setgroups descriptions are consecutive.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The purpose is to eliminate any biases in
the PRNG arising out of the regularity of that pattern, so
that the behavior of successive values is good from the
beginning.
This doesn't solve the problem that a short warm-up period
leads to a poor distribution of initial values relative to the
seed space. In other words, that similar seeds lead to
initially similar sequences.
* rand.c (rand_tab): New static array.
(make_random_state): Set uninitialized parts of state from the
corresponding elements in rand_tab, rather than to the
0xAAAAAAAA values.
(rand_compat_fixup): In 139 compatibility mode, clobber
rand_tab with 0xAA bytes.
* tests/013/maze.expected: Updated.
* txr.1: Added some PRNG implementation notes, and
also compatibility notes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (copy): Pass new second argument to make_random_state.
* rand.c (random_warmup): New macro.
(random_warmup_s): New symbol variable.
(make_random_state): New warmup argument. Code restructured to
avoid copy flag. Fill code and initialization of r->cur made
common.
(rand_compat_fixup): Pass second argument to
make_random_state.
(rand_init): Pass second argument to make_random_state.
Initialize random_warmup_s with interned symbol. Register
*random-warmup* special variable. Fix registration of
make-random-state to two-argument function type.
* rand.h (make_random_state): Declaration updated.
* txr.1: Document *random-warmup* variable and warup
argument of make-random-state.
|
|
|
|
|
|
|
|
|
|
| |
* eval.h (call_s): Declared.
* match.c (h_call, v_call): New static function.
(dir_tables_init): Register v_call in v_directive_table
under call symbol. Likewise h_call in h_directive_table.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* arith.c (arith_init): Registered fixnum-min and fixnum-max
variables.
* txr.1: Documented.
|
|
|
|
|
|
| |
* checkman.txr: Check .metn using logic shared with .codn.
* txr.1: Numerous errors fixed.
|
|
|
|
|
|
|
|
| |
* checkman.txr: Check .meta similarly to .code.
* txr.1: Change .meta macro to take only one argument,
so that text with spaces must be quoted.
Errors found and fixed.
|
|
|
|
|
|
|
|
| |
* checkman.txr: Constraint on first character of second
argument coded as a require constraint, enforced
with assert.
* txr.1: Newly discovered errors fixed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the manual, the .code and .codn macros are no longer
variadic. They take one an two arguments, respectively.
Multiple arguments have to be quoted now.
This makes it easier to detect errors in usage,
using support in checkman.txr.
Numerous errors were found, in fact.
* checkman.txr (check-code): New pattern function
for doing some checks on .code, codn, cod2 and cod3
macro usage.
* txr.1: code and codn macro are no longer variadic.
All variadic uses fixes with quotes. Numerous
errors discovered and corrected.
|
|
|
|
|
|
| |
* txr.1: Fix incorrect function and variable description
headings with spurious commas and inappropriate plurals.
Fix missing .mets in syntax blocks.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
| |
* txr.1: Hunted down and fixed incorrect .code,
.codn, .meta and .metn invocations. Added
missing .desc macros after .coNP Variables ...
|
|
|
|
|
|
|
| |
* ftw.c (ftw_wrap): Handle case when dirpath is a list,
by recursion.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: new test for fnmatch, introducing HAVE_FNMATCH
configure variable into config/config.h.
* sysif.c (fnmatch_wrap): New function.
(sysif_init): Register intrinsic variables fnm-pathname, fnm-noescape,
fnm-period, fnm-leading-dir, fnm-casefold and fnm-extmatch.
Register intrinsic function fnmatch.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* regex.c (read_until_match): New argument, include_match.
Three times repeated termination code refactored into block
reached by forward goto.
(regex_init): Registration of read-until-match updated.
* regex.h (read_until_match): Declaration updated.
* stream.c (struct record_adapter_base): New member,
include_match.
(record_adapter_get_line): Pass match to read_until_match
as new argument.
(record_adapater): New argument, include_match.
(stream_init): Update registration of record-adapter.
* stream.h (record_adapter): Declaration updated.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixing read_until_match will require this feature.
* socket.c (dgram_get_char): Treat unget_c as a
cons-based stack; pop a character from it if
available.
(dgram_unget_char): Push the character onto unget_c
rather than storing the characer into unget_c.
* stream.c (stdio_get_char, stdio_unget_char): Closely
analogous changes to the ones in dgram_get_char
and dgram_unget_char, respectively.
* txr.1: Documentation improved and updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Numerous places in match.c are using assoc(sym, bindings)
logic to access a variable, which doesn't see the Lisp
globals, as we would like. For example, if foo is
defined using (defvar foo), @(set foo "A") doesn't work.
This is subject to the compatibility option.
* match.c (tx_lookup_var): New static function.
(dest_set, h_var, h_coll, h_parallel, h_fun, v_next,
v_parallel, v_gather, v_collect, v_flatten, v_cat,
v_output, v_filter, v_fun, match_filter): Use tx_lookup_var
instead of assoc for all lookups that see the full variable
scope. Only variable lists known to be locally consed up
are scanned with just assoc.
* txr.1: Documented new rules and added compatibility notes.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
| |
* txr.1: Remove factually incorrect statements that only
sockets connected with sock-connect or sock-accept have
a peer address. Broadly revise wording.
|
|
|
|
|
| |
* txr.1: Incorrect reference to sys:return* should
of course be to sys:abscond*.
|
|
|
|
|
|
| |
* txr.1: Document that glob's error-func callback can be
terminated by a non-local exit, but may not capture
continuations across glob.
|
|
|
|
|
| |
* txr.1: glob-err, glob-mark and others are global lexical
variables, not special.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (ftw.o): Add to OBJS-y conditionally.
* configure (have_ftw): New variable. New configure test
for nftw.
(gen_config_make): Set up have_ftw make variable.
* ftw.c, ftw.h: New files.
* lib.c (init): Call ftw_init, if compiled in.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (yield_set_entries): Add obtain* and obtain*-block
to autoload list.
* share/txr/stdlib/yield.tl (obtain*, obtain*-block):
New macros.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is really a gratuitous incompatibility with Common Lisp
and other dialects. Let's fix it internally also, but keep the
proper-listp function binding for backwards compatibility.
* eval.c (dot_to_apply, me_op): Update proper_listp
call to proper_list_p.
(eval_init): Register proper-list-p to the same C function as
proper-listp, and that C function is now called proper_list_p.
* lib.c (proper_listp): Renamed to proper_list_p.
* lib.h (proper_listp): Declaration updated.
* parser.y (define_transform): Update proper_listp call.
* txr.1: Replace all occurrences of proper-listp with
proper-list-p. Add note explaining the rename situation.
|
|
|
|
| |
* txr.1: example for delay and gen doesn't need @(do).
|
|
|
|
|
| |
* txr.1: Functions bound to variables must be
invoked using DWIM brackets or call function.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (sock_set_entries): Add open-socket-pair to
autoload list.
* socket.c (sock_mark_connected, socketpair_wrap): New static
functions.
(sock_load_init): Register open-socket-pair intrinsic.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* stream.c (fmt): New function.
* stream.h (fmt): Declared.
* txr.1: Documented.
|
|
|
|
| |
* txr.1: Better wording introducing the semantics.
|
|
|
|
|
| |
* txr.1: window-map doesn't require the function to return
sequences, and doesn't append.
|
|
|
|
|
|
| |
* txr.1: remove spurious blank lines before .meIP blocks.
After the indented section end, return to the correct
indentation with .IP rather than .PP.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The expander now actually produces apply forms for dot
position function call and dwim forms. This allows symbol
macros to work naturally.
* eval.c (sys_apply_s): New symbol variable.
(imp_list_to_list, dot_to_apply): New static functions.
(expand_forms, expand_forms_lisp1): We now throw an error if a
non-nil atom terminates a form, Except in compatibility mode
with TXR 137 or less, whereby we emulate the old behavior of
not expanding this atom.
(do_expand): Perform the dot_to_apply transformation
on the arguments of the dwim form.
Perform the dot_to_apply transformation on an
entire function call form.
(eval_init): Initialize sys_apply_s and register
sys:apply function (using the same function object that
is registered under apply).
* txr.1: Documented that both DWIM forms and regular
function call forms work as if by a transformation to apply form,
removing verbiage which separately described the DWIM
handling. Documented that symbol macros work properly in
dot position.
|
|
|
|
|
| |
* txr.1: A few occurrences of .codn misspelled .cond
are are fixed and one .cod fixed to .code.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (expand_forms): If the forms list is an atom, then
don't just return it. Try to expand it as a macro.
If the macro produces a compound form, diagnose with
an exception, otherwise return the expansion.
* txr.1: Document the treatment of symbol macros in
function call dot position.
|
|
|
|
|
|
|
|
| |
* txr.1: New section: Improper Lists as Macro Calls.
This is necessary because the section on Dot Position
in Function Calls doesn't cover macros. Macros
are simpler, because it's just destructuring of
syntax.
|
|
|
|
| |
* txr.1: Just some whitespace for alignment of comments.
|
|
|
|
|
|
|
|
| |
* txr.1: Reduce and simplify the description text under
the Dot Position in Function Calls section, giving the
semantics via equivalence to apply. The handling of values
which are atoms or improper lists is described under
apply in a more effective way.
|
|
|
|
| |
* txr.1: Example produces (1 2 3 4), not (1 2 3).
|
|
|
|
|
|
| |
* txr.1: Documentation for the tc macro falsely claims
that it is based on tree-bind, in the description and
example expansion.
|
|
|
|
|
| |
* txr.1: Fix strange formatting mistake, causing parenthesis
to follow a meta symbol with no whitespace.
|
|
|
|
| |
* txr.1: obtain-block introduced as the obtain-from macro.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Making it work as already documented.
* socket.c (MIN): New macro.
(sockaddr_pack): Use utf8_dup_to_buf to convert
Unix socket path to a buffer of UTF-8 bytes, possibly with one
or more embedded null bytes. Copy as much of this as fits into
the sun_path member of struct sockaddr_un.
* txr.1: Improve documentation about the abstract names
on Linux.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/socket.tl (sock-peer): Syntactic
place defined, allowing (set (sock-peer sock) addr).
* txr.1: Documented sock-peer as accessor and sock-set-peer.
|