path: root/pseudo.h
diff options
authorPeter Seebach <peter.seebach@windriver.com>2010-12-07 20:43:45 -0600
committerPeter Seebach <peter.seebach@windriver.com>2010-12-07 20:47:19 -0600
commit98f16482f1e5c4b9c9d3b0803d41565a350af53d (patch)
tree4af00226b5b0b3b79ff26b51aedb2c5af15f58fe /pseudo.h
parent7b2dd4c7a6e20a8fe78cb892a8406d6d119c415b (diff)
This is a merge of several commits from a tree which turned out to
be out of sync in a very inconvenient way. Changes include: * Some whitespace fixes, also move the pseudo_variables definition into pseudo_util.c since it's not used anywhere else. * Further improvements in the fork() support: We now recognize both positive and negative forms of PSEUDO_DISABLED, so we can distinguish between "it was removed from the environment by env -i" (restore the old value) and "it was intentionally turned off" (the new value wins). * clone(2) support. This is a little primitive, and programs might still fail horribly due to clone's semantics, but at least it's there and passes easy test cases. Plus a big patch from Mark Hatle: Cleanup fork/clone and PSEUDO_DISABLED guts/fork.c: * cleanup function and make it more robust * be sure to call pseudo_setupenv prior to pseudo_client_reset to match exec behavior pseudo_wrappers.c: * fix mismatched type in execl_to_v call via typecast * Simplify fork call via single call to wrap_fork() * be sure to save pseudo_disabled * be sure to call pseudo_setupenv prior to pseudo_client_reset to match exec behavior tests: * Add a test of whether pseudo can be disabled/enabled on a fork. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'pseudo.h')
1 files changed, 6 insertions, 4 deletions
diff --git a/pseudo.h b/pseudo.h
index 9b06651..38b663a 100644
--- a/pseudo.h
+++ b/pseudo.h
@@ -20,17 +20,16 @@
#include <stdlib.h>
#include <fcntl.h>
-struct pseudo_variables { char * key; size_t key_len; char * value; };
void pseudo_dump_env(char **envp);
-int pseudo_set_value(const char * key, const char * value);
-char * pseudo_get_value(const char * key);
+int pseudo_set_value(const char *key, const char *value);
+char *pseudo_get_value(const char *key);
#include "pseudo_tables.h"
extern void pseudo_debug_verbose(void);
extern void pseudo_debug_terse(void);
extern int pseudo_util_debug_fd;
+extern int pseudo_disabled;
#ifndef NDEBUG
extern int pseudo_debug_real(int, char *, ...) __attribute__ ((format (printf, 2, 3)));
#define pseudo_debug pseudo_debug_real
@@ -62,6 +61,9 @@ extern ssize_t pseudo_path_max(void);
extern int pseudo_etc_file(const char *filename, char *realname, int flags, char **search, int dircount);
#define PSEUDO_ETC_FILE(name, realname, flags) pseudo_etc_file((name), (realname), (flags), (char *[]) { pseudo_chroot, pseudo_passwd }, 2)
+/* refresh environment variables from internals */
+extern void pseudo_reinit_environment(void);
extern char *pseudo_version;