On Tue, 2011-08-09 at 15:53 +0200, Nikola Pajkovsky wrote:
Denys Vlasenko <dvlasenk(a)redhat.com> writes:
>> - state.uuid = NULL;
>> - state.crash_dump_dup_name = NULL;
>> - char *analyzer = dd_load_text(dd, FILENAME_ANALYZER);
>> dd_close(dd);
> ...
>> + uid_t uid = xatoi_positive(state.uid);
>
> The only use of state.uid is above and...
>
>> +
>> + char *args[5];
>> + args[0] = (char *) "abrt-handle-event";
>> + args[1] = (char *) "-e";
>> + args[2] = (char *) "post-create";
>> + args[3] = (char *) dump_dir_name;
>> + args[4] = NULL;
>> +
>> + int pipeout[2];
>> + int flags = EXECFLG_INPUT_NUL | EXECFLG_OUTPUT | EXECFLG_QUIET;
>> + flags |= EXECFLG_ERR2OUT;
>> + VERB1 flags &= ~EXECFLG_QUIET;
>> +
>> + pid_t child = fork_execv_on_steroids(flags, args, pipeout,
>> + /*env_vec:*/ NULL, /*dir:*/ NULL,
uid);
>
> ...here, but flags have no EXECFLG_SETGUID and therefore
> fork_execv_on_steroids() will simply ignore uid parameter.
>
> Remove struct cdump_state state form this function.
removed and set EXECFLG_SETGUID
You shouldn't set EXECFLG_SETGUID. We don't run events under uid of
problem dir.
--
vda