aboutsummaryrefslogtreecommitdiffstats
path: root/guts
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2010-12-08 15:33:30 -0600
committerPeter Seebach <peter.seebach@windriver.com>2010-12-13 15:01:49 -0600
commiteba97c46608e776088a86d9d8db25d07e8de09ac (patch)
treeb04c5c61dd4ed181adf0f3810d13de75b37dea09 /guts
parent048cd003f3330f0811a48f79cd9d65bf022757a9 (diff)
downloadpseudo-eba97c46608e776088a86d9d8db25d07e8de09ac.tar.gz
pseudo-eba97c46608e776088a86d9d8db25d07e8de09ac.tar.bz2
pseudo-eba97c46608e776088a86d9d8db25d07e8de09ac.zip
Further amend the system to enable/disable sudo during fork/exec.
2010-12-09: * (mhatle) Add doc/program_flow to attempt to explain startup/running * (mhatle) guts/* minor cleanup * (mhatle) Reorganize into a new constructor for libpseudo ONLY pseudo main() now manually calls the util init new / revised init for client, wrappers and utils * (mhatle) Add central "reinit" function * (mhatle) Add manul execv* functions * (mhatle) rename pseudo_populate_wrappers to pseudo_check_wrappers Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'guts')
-rw-r--r--guts/clone.c4
-rw-r--r--guts/execv.c4
-rw-r--r--guts/execve.c4
-rw-r--r--guts/execvp.c4
-rw-r--r--guts/fork.c2
5 files changed, 12 insertions, 6 deletions
diff --git a/guts/clone.c b/guts/clone.c
index 61c8bf9..8299c54 100644
--- a/guts/clone.c
+++ b/guts/clone.c
@@ -14,8 +14,8 @@
pseudo_debug(1, "client resetting for clone(2) call\n");
if (real_clone) {
if (!pseudo_get_value("PSEUDO_RELOADED")) {
- pseudo_setupenv();
- pseudo_client_reinit();
+ pseudo_setupenv();
+ pseudo_reinit_libpseudo();
} else {
pseudo_setupenv();
pseudo_dropenv();
diff --git a/guts/execv.c b/guts/execv.c
index cc37e0a..a72556b 100644
--- a/guts/execv.c
+++ b/guts/execv.c
@@ -12,7 +12,9 @@
* <CHROOT>/bin/sh. This allows use of basic utilities. This
* design will likely be revisited.
*/
- pseudo_client_op(OP_EXEC, PSA_EXEC, -1, -1, file, 0);
+ if (antimagic == 0) {
+ pseudo_client_op(OP_EXEC, PSA_EXEC, -1, -1, file, 0);
+ }
if (!pseudo_get_value("PSEUDO_RELOADED"))
pseudo_setupenv();
diff --git a/guts/execve.c b/guts/execve.c
index febcf80..fafc154 100644
--- a/guts/execve.c
+++ b/guts/execve.c
@@ -13,7 +13,9 @@
* <CHROOT>/bin/sh. This allows use of basic utilities. This
* design will likely be revisited.
*/
- pseudo_client_op(OP_EXEC, PSA_EXEC, -1, -1, file, 0);
+ if (antimagic == 0) {
+ pseudo_client_op(OP_EXEC, PSA_EXEC, -1, -1, file, 0);
+ }
if (!pseudo_get_value("PSEUDO_RELOADED"))
new_environ = pseudo_setupenvp(envp);
diff --git a/guts/execvp.c b/guts/execvp.c
index 67eaff0..a3ce05b 100644
--- a/guts/execvp.c
+++ b/guts/execvp.c
@@ -13,7 +13,9 @@
* <CHROOT>/bin/sh. This allows use of basic utilities. This
* design will likely be revisited.
*/
- pseudo_client_op(OP_EXEC, PSA_EXEC, -1, -1, file, 0);
+ if (antimagic == 0) {
+ pseudo_client_op(OP_EXEC, PSA_EXEC, -1, -1, file, 0);
+ }
if (!pseudo_get_value("PSEUDO_RELOADED"))
pseudo_setupenv();
diff --git a/guts/fork.c b/guts/fork.c
index 8febd13..b7fd239 100644
--- a/guts/fork.c
+++ b/guts/fork.c
@@ -14,7 +14,7 @@
if (rc == 0) {
if (!pseudo_get_value("PSEUDO_RELOADED")) {
pseudo_setupenv();
- pseudo_client_reinit();
+ pseudo_reinit_libpseudo();
} else {
pseudo_setupenv();
pseudo_dropenv();