version 1.1.1.2, 2012/05/29 12:26:49
|
version 1.1.1.3, 2012/10/09 09:29:52
|
Line 237 check_passwd(void)
|
Line 237 check_passwd(void)
|
} |
} |
|
|
static char ** |
static char ** |
build_command_info(char *command) | build_command_info(const char *command) |
{ |
{ |
static char **command_info; |
static char **command_info; |
int i = 0; |
int i = 0; |
Line 308 find_editor(int nfiles, char * const files[], char **a
|
Line 308 find_editor(int nfiles, char * const files[], char **a
|
(editor_path = find_in_path(editor, plugin_state.envp)) == NULL) { |
(editor_path = find_in_path(editor, plugin_state.envp)) == NULL) { |
return NULL; |
return NULL; |
} |
} |
|
if (editor_path != editor) |
|
free(editor); |
nargv = (char **) malloc((nargc + 1 + nfiles + 1) * sizeof(char *)); |
nargv = (char **) malloc((nargc + 1 + nfiles + 1) * sizeof(char *)); |
if (nargv == NULL) { |
if (nargv == NULL) { |
sudo_log(SUDO_CONV_ERROR_MSG, "unable to allocate memory\n"); |
sudo_log(SUDO_CONV_ERROR_MSG, "unable to allocate memory\n"); |
|
free(editor_path); |
return NULL; |
return NULL; |
} |
} |
for (ac = 0; cp != NULL && ac < nargc; ac++) { |
for (ac = 0; cp != NULL && ac < nargc; ac++) { |
Line 357 policy_check(int argc, char * const argv[],
|
Line 360 policy_check(int argc, char * const argv[],
|
|
|
if (use_sudoedit) { |
if (use_sudoedit) { |
/* Rebuild argv using editor */ |
/* Rebuild argv using editor */ |
|
free(command); |
command = find_editor(argc - 1, argv + 1, argv_out); |
command = find_editor(argc - 1, argv + 1, argv_out); |
if (command == NULL) { |
if (command == NULL) { |
sudo_log(SUDO_CONV_ERROR_MSG, "unable to find valid editor\n"); |
sudo_log(SUDO_CONV_ERROR_MSG, "unable to find valid editor\n"); |
Line 373 policy_check(int argc, char * const argv[],
|
Line 377 policy_check(int argc, char * const argv[],
|
|
|
/* Setup command info. */ |
/* Setup command info. */ |
*command_info_out = build_command_info(command); |
*command_info_out = build_command_info(command); |
|
free(command); |
if (*command_info_out == NULL) { |
if (*command_info_out == NULL) { |
sudo_log(SUDO_CONV_ERROR_MSG, "out of memory\n"); |
sudo_log(SUDO_CONV_ERROR_MSG, "out of memory\n"); |
return -1; |
return -1; |