summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-10-27 20:42:09 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-10-27 20:42:09 -0700
commit746dddd01f28dc4499825c855c42aa5e95d5055a (patch)
tree3862e979649f240bb899ffa47d2ae91853903dce
parent80623a3c5ab1e1c645cdaafa2e1716cb0dcb3b60 (diff)
downloadtxr-746dddd01f28dc4499825c855c42aa5e95d5055a.tar.gz
txr-746dddd01f28dc4499825c855c42aa5e95d5055a.tar.bz2
txr-746dddd01f28dc4499825c855c42aa5e95d5055a.zip
listener: drop security checks on windows.
These checks go off on Windows and are likely not easily fixable. They have to do with how Cygwin maps permissions. Our security checks depend on a detailed, bona fide Unix implementation. * parser.c (report_file_perm_problem, report_path_perm_problem): Empty bodies when compiled for Cygwin. (repl): Initialize the ppriv_s and psafe_s variables to the tf symbol, the function which takes any number of arguments, ignoring them, and returning t.
-rw-r--r--parser.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/parser.c b/parser.c
index 8fd05785..d2c01048 100644
--- a/parser.c
+++ b/parser.c
@@ -941,16 +941,24 @@ val txr_parse(val source_in, val error_stream,
static void report_file_perm_problem(val name)
{
+#ifdef __CYGWIN__
+ (void) name;
+#else
format(std_output,
lit("** security problem: ~a is readable by others\n"),
name, nao);
+#endif
}
static void report_path_perm_problem(val name)
{
+#ifdef __CYGWIN__
+ (void) name;
+#else
format(std_output,
lit("** security problem: a component of ~a is writable to others\n"),
name, nao);
+#endif
}
static void load_rcfile(val name, val psafe_s, val ppriv_s)
@@ -1561,8 +1569,13 @@ val repl(val bindings, val in_stream, val out_stream, val env)
val var_counter_sym = intern(lit("*v"), user_package);
val result_hash_sym = intern(lit("*r"), user_package);
val pexist_s = intern(lit("path-exists-p"), user_package);
- val ppriv_s = intern(lit("path-strictly-private-to-me-p"), user_package);
+#ifdef __CYGWIN__
+ val ppriv_s = intern(lit("tf"), user_package);
+ val psafe_s = ppriv_s;
+#else
+ val ppriv_s = intern(lit("path-strictly-private-to-me-p"), user_package);
val psafe_s = intern(lit("path-components-safe"), user_package);
+#endif
val result_hash = make_hash(hash_weak_none, nil);
val done = nil;
val counter = one;