]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Removed restrict_access_clean_env() and env_remove(). They're not needed.
authorTimo Sirainen <tss@iki.fi>
Tue, 4 Mar 2003 04:00:13 +0000 (06:00 +0200)
committerTimo Sirainen <tss@iki.fi>
Tue, 4 Mar 2003 04:00:13 +0000 (06:00 +0200)
--HG--
branch : HEAD

src/lib/env-util.c
src/lib/env-util.h
src/lib/restrict-access.c
src/lib/restrict-access.h

index 0d6fc074d38246eb8c0009fc3facaad4d0126f1e..4f1b9d78c789851f2e6ff0793dbbad2bca885452 100644 (file)
@@ -39,26 +39,6 @@ void env_put(const char *env)
                i_fatal("Environment full, can't add: %s", env);
 }
 
-void env_remove(const char *env)
-{
-       extern char **environ;
-       size_t len;
-
-       if (environ == NULL)
-               return;
-
-       len = strlen(env);
-       for (; *environ != NULL; environ++) {
-               if (strncmp(*environ, env, len) == 0 &&
-                   (*environ)[len] == '=') {
-                       char **p;
-
-                       for (p = environ; *p != NULL; p++)
-                               p[0] = p[1];
-               }
-       }
-}
-
 void env_clean(void)
 {
        extern char **environ;
index d180ed20696533625f760ebe75ec4deef200e60e..18562c3946aa0a480b889db826fdc9d078b858c3 100644 (file)
@@ -4,8 +4,6 @@
 /* Add new environment variable. Wrapper to putenv(). Note that calls to this
    function allocates memory which isn't free'd until env_clean() is called. */
 void env_put(const char *env);
-/* Remove environment variable. */
-void env_remove(const char *env);
 /* Clear all environment variables. */
 void env_clean(void);
 
index bb53237d0f607e9360903eec37e054150872e21d..27e209976f1a983de3a8d935ab905464e2aea801 100644 (file)
@@ -42,14 +42,6 @@ void restrict_access_set_env(const char *user, uid_t uid, gid_t gid,
        env_put(t_strdup_printf("RESTRICT_SETGID=%s", dec2str(gid)));
 }
 
-void restrict_access_clear_env(void)
-{
-       env_remove("RESTRICT_USER");
-       env_remove("RESTRICT_CHROOT");
-       env_remove("RESTRICT_SETUID");
-       env_remove("RESTRICT_SETGID");
-}
-
 void restrict_access_by_env(int disallow_root)
 {
        const char *env;
index 23ebbb51c44dc7db28c31ec966ac0531537200fb..78f8039790fa7615c59c8a0d4ba0e78f026a6207 100644 (file)
@@ -6,9 +6,6 @@
 void restrict_access_set_env(const char *user, uid_t uid, gid_t gid,
                             const char *chroot_dir);
 
-/* clear the environment variables set by restrict_access_set_env() */
-void restrict_access_clear_env(void);
-
 /* 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. */