[CRIU] [PATCH 1/2] service: ban subdirs in logfile name

Ruslan Kuprieiev kupruser at gmail.com
Tue Feb 4 06:36:46 PST 2014


On 04.02.2014 18:22, Pavel Emelyanov wrote:
> On 02/04/2014 12:51 PM, Ruslan Kuprieiev wrote:
>> Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
>> ---
>>   cr-service.c | 9 +++++++--
>>   1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/cr-service.c b/cr-service.c
>> index ff2fb0d..5ef5d52 100644
>> --- a/cr-service.c
>> +++ b/cr-service.c
>> @@ -189,9 +189,14 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
>>   	}
>>   
>>   	/* initiate log file in work dir */
>> -	if (req->log_file)
>> +	if (req->log_file) {
>> +		if (strchr(req->log_file, '.') || strchr(req->log_file, '/')) {
> Why can't I specify log_file = "dump.log"? Why dots are not allowed?

Oh, my mistake, sorry.
Attached.

>> +			pr_perror("No subdirs are allowed in log_file name");
>> +			return -1;
>> +		}
>> +
>>   		opts.output = req->log_file;
>> -	else
>> +	} else
>>   		opts.output = DEFAULT_LOG_FILENAME;
>>   
>>   	log_set_loglevel(req->log_level);
>>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.patch
Type: text/x-diff
Size: 649 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140204/56190493/attachment-0001.bin>


More information about the CRIU mailing list