summaryrefslogtreecommitdiff
path: root/misc.h
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2017-08-18 05:36:45 +0000
committerDamien Miller <djm@mindrot.org>2017-08-23 19:47:06 +1000
commitde4ae07f12dabf8815ecede54235fce5d22e3f63 (patch)
treee62b3e975ed519f37c7cda4b5229bcffca73023f /misc.h
parent643c2ad82910691b2240551ea8b14472f60b5078 (diff)
upstream commit
Move several subprocess-related functions from various locations to misc.c. Extend subprocess() to offer a little more control over stdio disposition. feedback & ok dtucker@ Upstream-ID: 3573dd7109d13ef9bd3bed93a3deb170fbfce049
Diffstat (limited to 'misc.h')
-rw-r--r--misc.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/misc.h b/misc.h
index c242f901..617f8767 100644
--- a/misc.h
+++ b/misc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.h,v 1.61 2016/11/30 00:28:31 dtucker Exp $ */
+/* $OpenBSD: misc.h,v 1.62 2017/08/18 05:36:45 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -16,6 +16,7 @@
#define _MISC_H
#include <sys/time.h>
+#include <sys/types.h>
/* Data structure for representing a forwarding request. */
struct Forward {
@@ -132,6 +133,25 @@ int parse_ipqos(const char *);
const char *iptos2str(int);
void mktemp_proto(char *, size_t);
+void child_set_env(char ***envp, u_int *envsizep, const char *name,
+ const char *value);
+
+int argv_split(const char *, int *, char ***);
+char *argv_assemble(int, char **argv);
+int exited_cleanly(pid_t, const char *, const char *);
+
+#define SSH_SUBPROCESS_STDOUT_DISCARD (1) /* Discard stdout */
+#define SSH_SUBPROCESS_STDOUT_CAPTURE (1<<1) /* Redirect stdout */
+#define SSH_SUBPROCESS_STDERR_DISCARD (1<<2) /* Discard stderr */
+pid_t subprocess(const char *, struct passwd *,
+ const char *, int, char **, FILE **, u_int flags);
+
+struct stat;
+int safe_path(const char *, struct stat *, const char *, uid_t,
+ char *, size_t);
+int safe_path_fd(int, const char *, struct passwd *,
+ char *err, size_t errlen);
+
/* readpass.c */
#define RP_ECHO 0x0001