diff src/lib/restrict-access.h @ 7091:59ac3628b8d8 HEAD

Build environment using envarr and pass it to execve(). This is faster than using putenv() directly. restrict_access_*_env() API changed to take environment array parameter.
author Timo Sirainen <tss@iki.fi>
date Wed, 02 Jan 2008 01:36:51 +0200
parents e4eb71ae8e96
children e6823d781317
line wrap: on
line diff
--- a/src/lib/restrict-access.h	Wed Jan 02 01:35:21 2008 +0200
+++ b/src/lib/restrict-access.h	Wed Jan 02 01:36:51 2008 +0200
@@ -3,14 +3,17 @@
 
 /* set environment variables so they can be read with
    restrict_access_by_env() */
-void restrict_access_set_env(const char *user, uid_t uid, gid_t gid,
+void restrict_access_set_env(ARRAY_TYPE(const_string) *env,
+			     const char *user, uid_t uid, gid_t gid,
 			     const char *chroot_dir,
 			     gid_t first_valid_gid, gid_t last_valid_gid,
 			     const char *extra_groups);
 
 /* chroot, setuid() and setgid() based on environment variables.
    If disallow_roots is TRUE, we'll kill ourself if we didn't have the
-   environment settings and we have root uid or gid. */
-void restrict_access_by_env(bool disallow_root);
+   environment settings and we have root uid or gid. If env=NULL, the real
+   environment is used. */
+void restrict_access_by_env(ARRAY_TYPE(const_string) *env,
+			    bool disallow_root);
 
 #endif