summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parser.c2
-rw-r--r--sysif.c16
-rw-r--r--sysif.h2
3 files changed, 8 insertions, 12 deletions
diff --git a/parser.c b/parser.c
index 7c40b5d7..6f21f62e 100644
--- a/parser.c
+++ b/parser.c
@@ -798,7 +798,7 @@ static void load_rcfile(val name)
open_txr_file(name, &lisp_p, &resolved_name, &stream);
if (stream) {
- if (!funcall1(path_private_to_me_p, fstat_wrap(stream))) {
+ if (!funcall1(path_private_to_me_p, stat_wrap(stream))) {
format(std_output,
lit("** possible security problem: ~a is writable to others\n"),
name, nao);
diff --git a/sysif.c b/sysif.c
index def72149..d117729b 100644
--- a/sysif.c
+++ b/sysif.c
@@ -556,8 +556,6 @@ static val mkfifo_wrap(val path, val mode)
enum chm_state { chm_who, chm_perm, chm_nxtop, chm_comma };
enum chm_op { chm_add, chm_sub, chm_set };
-static val stat_wrap(val path);
-
static val chmod_wrap(val target, val mode)
{
val self = lit("chmod");
@@ -1128,7 +1126,7 @@ static val stat_impl(val obj, int (*statfn)(val, struct stat *),
#endif
}
-static val stat_wrap(val path)
+val stat_wrap(val path)
{
return stat_impl(path, do_stat, lit("stat"), path);
}
@@ -1138,11 +1136,6 @@ static val lstat_wrap(val path)
return stat_impl(path, do_lstat, lit("lstat"), path);
}
-val fstat_wrap(val stream)
-{
- return stat_impl(stream, do_stat, lit("fstat"), nil);
-}
-
#if HAVE_FILE_STAMP_CHANGE
#if HAVE_FUTIMENS
@@ -2372,9 +2365,12 @@ void sysif_init(void)
reg_fun(intern(lit("lutimes"), user_package), func_n5(wrap_lutimes));
#endif
- reg_fun(intern(lit("stat"), user_package), func_n1(stat_wrap));
+ {
+ val fn = func_n1(stat_wrap);
+ reg_fun(intern(lit("stat"), user_package), fn);
+ reg_fun(intern(lit("fstat"), user_package), fn);
+ }
reg_fun(intern(lit("lstat"), user_package), func_n1(lstat_wrap));
- reg_fun(intern(lit("fstat"), user_package), func_n1(fstat_wrap));
#if HAVE_SYS_STAT
#ifndef S_IFSOCK
diff --git a/sysif.h b/sysif.h
index f10d2da3..c2a650c0 100644
--- a/sysif.h
+++ b/sysif.h
@@ -49,7 +49,7 @@ val num_time(time_t time);
struct stat;
val stat_to_struct(struct stat st, val path);
#endif
-val fstat_wrap(val path);
+val stat_wrap(val path);
val stdio_ftell(FILE *);
int stdio_fseek(FILE *, val, int whence);
#if HAVE_GETEUID