]> 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:38:16 +0000 (16:38 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 16 Jun 2010 20:38:16 +0000 (16:38 -0400)
into sudo_exec.h.

--HG--
branch : 1.7

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

index d439626bfbcb27e0788ae8aca73abce599ff5b42..7f64a5ba3344d8b10f5b7088f8fb256dad50518f 100644 (file)
@@ -123,8 +123,9 @@ AUTH_SRCS = auth/afs.c auth/aix_auth.c auth/bsdauth.c auth/dce.c auth/fwtk.c \
 HDRS = alloc.h bsm_audit.h compat.h def_data.h defaults.h error.h ins_2001.h \
        ins_classic.h ins_csops.h ins_goons.h insults.h interfaces.h lbuf.h \
        linux_audit.h list.h logging.h missing.h mksiglist.h nonunix.h \
-       redblack.h parse.h sudo.h sudo_nss.h gram.h auth/sudo_auth.h \
-       emul/charclass.h emul/fnmatch.h emul/glob.h emul/timespec.h emul/utime.h
+       redblack.h parse.h sudo.h sudo_exec.h sudo_nss.h gram.h \
+       auth/sudo_auth.h emul/charclass.h emul/fnmatch.h emul/glob.h \
+       emul/timespec.h emul/utime.h
 
 AUTH_OBJS = sudo_auth.o @AUTH_OBJS@
 
@@ -270,9 +271,9 @@ env.o: $(srcdir)/env.c $(SUDODEP)
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/env.c
 error.o: $(srcdir)/error.c $(srcdir)/compat.h $(srcdir)/error.h config.h
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/error.c
-exec.o: $(srcdir)/exec.c $(SUDODEP)
+exec.o: $(srcdir)/exec.c $(SUDODEP) $(srcdir)/sudo_exec.h
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/exec.c
-exec_pty.o: $(srcdir)/exec.c $(SUDODEP)
+exec_pty.o: $(srcdir)/exec.c $(SUDODEP) $(srcdir)/sudo_exec.h
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/exec_pty.c
 fileops.o: $(srcdir)/fileops.c $(SUDODEP)
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/fileops.c
diff --git a/exec.c b/exec.c
index 60005efdba34991a5b27dd3247671335c267c087..2171e705f6633bdfd7fadccf9b39582830322e9a 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -64,6 +64,7 @@
 #endif
 
 #include "sudo.h"
+#include "sudo_exec.h"
 
 /* shared with exec_pty.c */
 sig_atomic_t recvsig[NSIG];
index d5594d5aaf76fffa86856939868862bee393ec9b..27f06c04606bde79763607487c5d84b82cc87a81 100644 (file)
@@ -60,6 +60,7 @@
 #include <signal.h>
 
 #include "sudo.h"
+#include "sudo_exec.h"
 
 #define SFD_STDIN      0
 #define SFD_STDOUT     1
@@ -89,10 +90,6 @@ struct io_buffer {
     char buf[16 * 1024];
 };
 
-/* shared with pty.c */
-extern sig_atomic_t recvsig[NSIG]; 
-extern void handler __P((int s));
-
 static char slavename[PATH_MAX];
 static int foreground;
 static int io_fds[6] = { -1, -1, -1, -1, -1, -1};
diff --git a/sudo.h b/sudo.h
index cb2750c3d1aa2fdbeb7795dc2a57f16c85c2ac27..0b074ef1ed0910c3934eea30bbe9ac9e44d587a0 100644 (file)
--- a/sudo.h
+++ b/sudo.h
@@ -236,16 +236,6 @@ void validate_env_vars     __P((struct list_member *));
 /* exec.c */
 int sudo_execve __P((const char *path, char *argv[], char *envp[], uid_t uid,
     struct command_status *cstat, int dowait, int bgmode));
-int my_execve __P((const char *path, char *argv[], char *envp[]));
-
-/* exec_pty.c */
-int fork_pty __P((const char *path, char *argv[], char *envp[], int sv[],
-    int rbac_enabled, int *maxfd));
-int perform_io __P((fd_set *fdsr, fd_set *fdsw, struct command_status *cstat));
-void pty_close __P((struct command_status *cstat));
-void fd_set_iobs __P((fd_set *fdsr, fd_set *fdsw));
-void pty_setup __P((uid_t uid));
-int suspend_parent __P((int signo));
 
 /* fileops.c */
 char *sudo_parseln     __P((FILE *));
diff --git a/sudo_exec.h b/sudo_exec.h
new file mode 100644 (file)
index 0000000..6e26913
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * 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 __P((const char *path, char *argv[], char *envp[]));
+
+/* exec_pty.c */
+int fork_pty __P((const char *path, char *argv[], char *envp[], int sv[],
+    int rbac_enabled, int *maxfd));
+int perform_io __P((fd_set *fdsr, fd_set *fdsw, struct command_status *cstat));
+int suspend_parent __P((int signo));
+void fd_set_iobs __P((fd_set *fdsr, fd_set *fdsw));
+void handler __P((int s));
+void pty_close __P((struct command_status *cstat));
+void pty_setup __P((uid_t uid));
+extern sig_atomic_t recvsig[NSIG];
+
+#endif /* _SUDO_EXEC_H */