summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/file.c b/file.c
index 69dbdee4..0d25db03 100644
--- a/file.c
+++ b/file.c
@@ -242,7 +242,9 @@ file_write(struct client *c, const char *path, int flags, const void *bdata,
cf->path = xstrdup("-");
fd = STDOUT_FILENO;
- if (c == NULL || c->flags & CLIENT_ATTACHED) {
+ if (c == NULL ||
+ (c->flags & CLIENT_ATTACHED) ||
+ (c->flags & CLIENT_CONTROL)) {
cf->error = EBADF;
goto done;
}
@@ -311,7 +313,9 @@ file_read(struct client *c, const char *path, client_file_cb cb, void *cbdata)
cf->path = xstrdup("-");
fd = STDIN_FILENO;
- if (c == NULL || c->flags & CLIENT_ATTACHED) {
+ if (c == NULL ||
+ (c->flags & CLIENT_ATTACHED) ||
+ (c->flags & CLIENT_CONTROL)) {
cf->error = EBADF;
goto done;
}