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
commit890bbba6351a23f92c9123541704d520f49d4378 (patch)
tree3862e979649f240bb899ffa47d2ae91853903dce
parent598d88bd5b2f67b48fd2c232f8fbd51c1a5e1cc6 (diff)
downloadtxr-890bbba6351a23f92c9123541704d520f49d4378.tar.gz
txr-890bbba6351a23f92c9123541704d520f49d4378.tar.bz2
txr-890bbba6351a23f92c9123541704d520f49d4378.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;