diff options
| author | Jay Sorg <jay.sorg@gmail.com> | 2014-05-09 16:02:19 -0700 |
|---|---|---|
| committer | Jay Sorg <jay.sorg@gmail.com> | 2014-05-09 16:02:19 -0700 |
| commit | 49fcc23673323a850b7aaf9ae1025cfd14d0adba (patch) | |
| tree | f0c74b982c2d80715434f5624d57b8f02df63e00 /sesman/env.c | |
| parent | 3819fa5e72e7735d95fe7992368e242aabc75232 (diff) | |
| download | xrdp-proprietary-49fcc23673323a850b7aaf9ae1025cfd14d0adba.tar.gz xrdp-proprietary-49fcc23673323a850b7aaf9ae1025cfd14d0adba.zip | |
sesman: added SessionVariables to sesman.ini and some indent cleanup
Diffstat (limited to 'sesman/env.c')
| -rw-r--r-- | sesman/env.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sesman/env.c b/sesman/env.c index b650d0b3..26d1a4f7 100644 --- a/sesman/env.c +++ b/sesman/env.c @@ -24,6 +24,8 @@ * */ +#include "list.h" + #include "sesman.h" #include "sys/types.h" @@ -60,12 +62,16 @@ env_check_password_file(char *filename, char *password) /******************************************************************************/ int DEFAULT_CC -env_set_user(char *username, char *passwd_file, int display) +env_set_user(char *username, char *passwd_file, int display, + struct list *env_names, struct list* env_values) { int error; int pw_uid; int pw_gid; int uid; + int index; + char *name; + char *value; char pw_shell[256]; char pw_dir[256]; char pw_gecos[256]; @@ -96,7 +102,7 @@ env_set_user(char *username, char *passwd_file, int display) { g_clearenv(); g_setenv("SHELL", pw_shell, 1); - g_setenv("PATH", "/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin", 1); + g_setenv("PATH", "/bin:/usr/bin:/usr/local/bin", 1); g_setenv("USER", username, 1); g_sprintf(text, "%d", uid); g_setenv("UID", text, 1); @@ -106,6 +112,16 @@ env_set_user(char *username, char *passwd_file, int display) g_setenv("DISPLAY", text, 1); g_setenv("LANG", "en_US.UTF-8", 1); g_setenv("XRDP_SESSION", "1", 1); + if ((env_names != 0) && (env_values != 0) && + (env_names->count == env_values->count)) + { + for (index = 0; index < env_names->count; index++) + { + name = (char *) list_get_item(env_names, index), + value = (char *) list_get_item(env_values, index), + g_setenv(name, value, 1); + } + } if (passwd_file != 0) { |
