]> granicus.if.org Git - sudo/commitdiff
Move functions and symbols shared between exec.c and exec_pty.c
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 16 Jun 2010 20:46:56 +0000 (16:46 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 16 Jun 2010 20:46:56 +0000 (16:46 -0400)
into sudo_exec.h.

MANIFEST
src/Makefile.in
src/exec.c
src/exec_pty.c
src/sudo.h
src/sudo_exec.h [new file with mode: 0644]

index 34c957a1eb2b2213ba0e59020f5a9adc45ceacae..3792cee0e05857c84d3cb7122a97d9e718926d2b 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -191,6 +191,7 @@ src/sesh.c
 src/sudo.c
 src/sudo.h
 src/sudo_edit.c
+src/sudo_exec.h
 src/sudo_noexec.c
 src/sudo_plugin_int.h
 src/sudo_usage.h.in
index fa99d2ec3dd9dc2141855a7236b0f78624d89886..2062f5aaa598a455742fb6952003bf3df63b387a 100644 (file)
@@ -108,8 +108,8 @@ sesh: sesh.o
 aix.o: $(srcdir)/aix.c $(top_builddir)/config.h $(incdir)/compat.h
 conversation.o: $(srcdir)/conversation.c $(SUDODEP)
 error.o: $(srcdir)/error.c $(incdir)/compat.h $(incdir)/error.h $(top_builddir)/config.h
-exec.o: $(srcdir)/exec.c $(SUDODEP)
-exec_pty.o: $(srcdir)/exec_pty.c $(SUDODEP)
+exec.o: $(srcdir)/exec.c $(SUDODEP) $(srcdir)/sudo_exec.h
+exec_pty.o: $(srcdir)/exec_pty.c $(SUDODEP) $(srcdir)/sudo_exec.h
 get_pty.o: $(srcdir)/get_pty.c $(SUDODEP)
 load_plugins.o: $(srcdir)/load_plugins.c $(SUDODEP)
 parse_args.o: $(srcdir)/parse_args.c sudo_usage.h $(SUDODEP)
index 5d36cd2d66fc4a70a5fc90a8e20356ed43879a28..ab8c8fa4269e637077dd6bb2192a718544f37cb7 100644 (file)
@@ -57,6 +57,7 @@
 #include <termios.h>
 
 #include "sudo.h"
+#include "sudo_exec.h"
 #include "sudo_plugin.h"
 #include "sudo_plugin_int.h"
 
index 22c3530c5b5a5d6288aeea48757f3e8dcbb5617d..9a9ba5cb24bed19feae8f7c9b93b39c33b413dae 100644 (file)
@@ -56,6 +56,7 @@
 #include <termios.h>
 
 #include "sudo.h"
+#include "sudo_exec.h"
 #include "sudo_plugin.h"
 #include "sudo_plugin_int.h"
 
@@ -87,10 +88,6 @@ struct io_buffer {
     char buf[16 * 1024];
 };
 
-/* shared with pty.c */  
-extern sig_atomic_t recvsig[NSIG];
-extern void handler(int s);
-
 static char slavename[PATH_MAX];
 static int foreground;
 static int io_fds[6] = { -1, -1, -1, -1, -1, -1};
index 25f42e9cc50c9f5b68c2faee28a5d46a87763cb0..bcadbcf7eba4b485609b926f5d740517e4fc928e 100644 (file)
@@ -151,6 +151,8 @@ struct command_status {
     int val;
 };
 
+struct timeval;
+
 /* For error() and errorx() (XXX - needed?) */
 void cleanup(int);
 
@@ -165,17 +167,6 @@ void zero_bytes(volatile void *, size_t);
 /* exec.c */
 int sudo_execve(struct command_details *details, char *argv[], char *envp[],
     struct command_status *cstat);
-int my_execve(const char *path, char *const argv[], char *const envp[]);
-
-/* exec_pty.c */
-int fork_pty(struct command_details *details, char *argv[], char *envp[],
-    int sv[], int *maxfd);
-int perform_io(fd_set *fdsr, fd_set *fdsw, struct command_status *cstat);
-int suspend_parent(int signo);
-void fd_set_iobs(fd_set *fdsr, fd_set *fdsw);
-void pty_close(struct command_status *cstat);
-void pty_setup(uid_t uid);
-void terminate_child(pid_t pid, int use_pgrp);
 
 /* term.c */
 int term_cbreak(int);
diff --git a/src/sudo_exec.h b/src/sudo_exec.h
new file mode 100644 (file)
index 0000000..5151a22
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _SUDO_EXEC_H
+#define _SUDO_EXEC_H
+
+/*
+ * Symbols shared between exec.c and exec_pty.c
+ */
+
+/* exec.c */
+int my_execve(const char *path, char *const argv[], char *const envp[]);
+
+/* exec_pty.c */
+int fork_pty(struct command_details *details, char *argv[], char *envp[],
+    int sv[], int *maxfd);
+int perform_io(fd_set *fdsr, fd_set *fdsw, struct command_status *cstat);
+int suspend_parent(int signo);
+void fd_set_iobs(fd_set *fdsr, fd_set *fdsw);
+void handler(int s);
+void pty_close(struct command_status *cstat);
+void pty_setup(uid_t uid);
+void terminate_child(pid_t pid, int use_pgrp);
+extern sig_atomic_t recvsig[NSIG];
+
+#endif /* _SUDO_EXEC_H */