[systemd-devel] [PATCH] systemctl: fix broken list-unit-files with --root

Lukáš Nykrýn lnykryn at redhat.com
Wed Aug 27 02:50:35 PDT 2014


Lennart Poettering píše v Út 26. 08. 2014 v 20:26 +0200:
> On Tue, 26.08.14 13:36, Lukas Nykryn (lnykryn at redhat.com) wrote:
> 
> Looks good! Please commit!
> 
> > ---
> >  src/shared/install.c | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/shared/install.c b/src/shared/install.c
> > index 4b09a69..3ef995a 100644
> > --- a/src/shared/install.c
> > +++ b/src/shared/install.c
> > @@ -2072,6 +2072,7 @@ int unit_file_get_list(
> >                  for (;;) {
> >                          _cleanup_(unit_file_list_free_onep) UnitFileList *f = NULL;
> >                          struct dirent *de;
> > +                        _cleanup_free_ char *path = NULL;
> >  
> >                          errno = 0;
> >                          de = readdir(d);
> > @@ -2121,7 +2122,11 @@ int unit_file_get_list(
> >                                  goto found;
> >                          }
> >  
> > -                        r = unit_file_can_install(&paths, root_dir, f->path, true);
> > +                        path = path_make_absolute(de->d_name, *i);
> > +                        if (!path)
> > +                                return -ENOMEM;
> > +
> > +                        r = unit_file_can_install(&paths, root_dir, path, true);
> >                          if (r == -EINVAL ||  /* Invalid setting? */
> >                              r == -EBADMSG || /* Invalid format? */
> >                              r == -ENOENT     /* Included file not found? */)
> 
> 
> Lennart
> 

Thanks for checking! Applied.

Lukas 



More information about the systemd-devel mailing list