[systemd-devel] tmpfiles.d specifier support on "argument" when operating on files
Cristian Rodríguez
crrodriguez at opensuse.org
Wed Feb 18 13:17:17 PST 2015
El 18/02/15 a las 07:10, Lennart Poettering escribió:
> On Tue, 17.02.15 17:35, Cristian Rodríguez (crrodriguez at opensuse.org) wrote:
>
> Please fix this for all arguments, not just symlinks.
>
>> diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
>> index c948d4d..1b35b8e 100644
>> --- a/src/tmpfiles/tmpfiles.c
>> +++ b/src/tmpfiles/tmpfiles.c
>> @@ -1590,6 +1590,12 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
>> i.argument = strappend("/usr/share/factory/", i.path);
>> if (!i.argument)
>> return log_oom();
>> + } else {
>> + r = specifier_printf(i.argument,
>> specifier_table, NULL, &i.argument);
>
> Here's a memory leak, you need to free the old i.argument.
>
> Indentation! Please have a look at CODING_STYLE. You need to indent by
> 8ch. 4ch indenting is not acceptable.
>
>> + if (r < 0) {
>> + log_error("[%s:%u] Failed to replace specifiers: %s", fname, line, path);
>> + return r;
>> + }
>
HI again:
Is the attached version cool for you ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-tmpfiles-implement-specifier-substitution-for-file-a.patch
Type: text/x-patch
Size: 1351 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150218/4ae43109/attachment.bin>
More information about the systemd-devel
mailing list