- } else if (!strcmp(cmd, LAUNCH_KEY_GETUSERENVIRONMENT)) {
- char **tmpenviron = environ;
- resp = launch_data_alloc(LAUNCH_DATA_DICTIONARY);
- for (; *tmpenviron; tmpenviron++) {
- char envkey[1024];
- launch_data_t s = launch_data_alloc(LAUNCH_DATA_STRING);
- launch_data_set_string(s, strchr(*tmpenviron, '=') + 1);
- strncpy(envkey, *tmpenviron, sizeof(envkey));
- *(strchr(envkey, '=')) = '\0';
- launch_data_dict_insert(resp, s, envkey);
- }
- } else if (!strcmp(cmd, LAUNCH_KEY_GETLOGMASK)) {
- int oldmask = setlogmask(LOG_UPTO(LOG_DEBUG));
- resp = launch_data_new_integer(oldmask);
- setlogmask(oldmask);
- } else if (!strcmp(cmd, LAUNCH_KEY_GETUMASK)) {
- mode_t oldmask = umask(0);
- resp = launch_data_new_integer(oldmask);
- umask(oldmask);