aboutsummaryrefslogtreecommitdiffstats
path: root/doc
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 /doc
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 'doc')
-rw-r--r--doc/program_flow63
1 files changed, 63 insertions, 0 deletions
diff --git a/doc/program_flow b/doc/program_flow
new file mode 100644
index 0000000..b0680a0
--- /dev/null
+++ b/doc/program_flow
@@ -0,0 +1,63 @@
+This is a quick attempt at documenting the basic program flow for both the main
+pseudo executable and the pseudo wrapper library. The key thing to note is
+that there are key init functions. These functions are designed to be
+re-invoked if it becomes necessary to reset the system environment.
+
+libpseudo execution flow:
+ # on startup #
+
+ pseudo_wrappers.c: (constructor) _libpseudo_init()
+ pseudo_util.c: pseudo_init_util()
+ copy environment
+ setup PSEUDO_DEBUG levels
+ pseudo_wrappers.c: pseudo_init_wrappers()
+ setup pseudo_functions
+ setup pseudo_logfile
+ pseudo_client.c: pseudo_init_client()
+ setup PSEUDO_DISBLED
+ setup pseudo_prefix_dir_fd
+ setup pseudo_localstate_dir_fd
+ setup PSEUDO_NOSYMLINKEXP
+ setup PSEUDO_UIDS
+ setup PSEUDO_GIDS
+ setup PSEUDO_CHROOT
+ setup PSEUDO_PASSWD
+
+ # regular program execution #
+ exec*()
+ pseudo_check_wrappers():
+ pseudo_reinit_libpseudo if necessary
+ call wrap_exec*()
+ if !PSEUDO_RELOADED
+ pseudo_setupenv()
+ else
+ pseudo_setupenv()
+ pseudo_dropenv()
+ real_exec*()
+
+ fork()
+ clone()
+ pseudo_populate_wrappers():
+ pseudo_reinit_libpseudo if necessary
+ call wrap_exec*()
+ if !PSEUDO_RELOADED
+ pseudo_setupenv()
+ pseudo_reinit_libpseudo()
+ _libpseudo_init()
+ else
+ pseudo_setupenv()
+ pseudo_dropenv()
+ real_*()
+
+ ... normal function wrappers ...
+
+pseudo execution flow:
+ pseudo.c: main()
+ pseudo_util.c: pseudo_init_util()
+ <see above>
+ check LD_PRELOAD
+ process arguments
+ setup PSEUDO_OPTS
+ ...
+ startup server
+