diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-07-30 17:46:13 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-07-30 17:46:13 +0000 |
commit | d27b07596eb8de59d15e8979c24455ae8cabeb63 (patch) | |
tree | feb78de415d6aa112d2e2d3b86b4d56cf599eff8 /usr.bin | |
parent | 8810e84fa87f186513b4bfd9a75c4a2322c01393 (diff) |
Don't babysit people and let them try to load /dev/zero or (more useful)
/dev/null if they want.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/cfg.c | 12 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-load-buffer.c | 6 |
2 files changed, 2 insertions, 16 deletions
diff --git a/usr.bin/tmux/cfg.c b/usr.bin/tmux/cfg.c index 13a03ef12e2..085d1a5d141 100644 --- a/usr.bin/tmux/cfg.c +++ b/usr.bin/tmux/cfg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cfg.c,v 1.2 2009/06/25 06:00:45 nicm Exp $ */ +/* $OpenBSD: cfg.c,v 1.3 2009/07/30 17:46:12 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -55,21 +55,11 @@ load_cfg(const char *path, char **cause) { FILE *f; u_int n; - struct stat sb; char *buf, *line, *ptr; size_t len; struct cmd_list *cmdlist; struct cmd_ctx ctx; - if (stat(path, &sb) != 0) { - xasprintf(cause, "%s: %s", path, strerror(errno)); - return (-1); - } - if (!S_ISREG(sb.st_mode)) { - xasprintf(cause, "%s: not a regular file", path); - return (-1); - } - if ((f = fopen(path, "rb")) == NULL) { xasprintf(cause, "%s: %s", path, strerror(errno)); return (1); diff --git a/usr.bin/tmux/cmd-load-buffer.c b/usr.bin/tmux/cmd-load-buffer.c index 43bc7221b9a..f17483971b9 100644 --- a/usr.bin/tmux/cmd-load-buffer.c +++ b/usr.bin/tmux/cmd-load-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-load-buffer.c,v 1.4 2009/07/26 12:58:44 nicm Exp $ */ +/* $OpenBSD: cmd-load-buffer.c,v 1.5 2009/07/30 17:46:12 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -60,10 +60,6 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_ctx *ctx) ctx->error(ctx, "%s: %s", data->arg, strerror(errno)); return (-1); } - if (!S_ISREG(statbuf.st_mode)) { - ctx->error(ctx, "%s: not a regular file", data->arg); - return (-1); - } if ((f = fopen(data->arg, "rb")) == NULL) { ctx->error(ctx, "%s: %s", data->arg, strerror(errno)); |