[netcf-devel] [PATCH 6/9] add /sbin to ifup and ifdown paths.

Serge E. Hallyn serge at hallyn.com
Fri Apr 27 17:27:57 UTC 2012


Quoting Laine Stump (laine at laine.org):
> On 03/20/2012 10:23 AM, Serge Hallyn wrote:
> > In debian, /sbin won't be in $PATH.
> >
> > Index: netcf-0.1.9/src/drv_debian.c
> > ===================================================================
> > --- netcf-0.1.9.orig/src/drv_debian.c	2011-10-25 17:51:48.750682612 -0500
> > +++ netcf-0.1.9/src/drv_debian.c	2011-10-25 22:18:12.647041910 -0500
> > @@ -1044,7 +1044,7 @@
> >   */
> >  
> >  int drv_if_up(struct netcf_if *nif) {
> > -    static const char *const ifup = "ifup";
> > +    static const char *const ifup = "/sbin/ifup";
> >      struct netcf *ncf = nif->ncf;
> >      int result = -1;
> >  
> > @@ -1056,7 +1056,7 @@
> >  }
> >  
> >  int drv_if_down(struct netcf_if *nif) {
> > -    static const char *const ifdown = "ifdown";
> > +    static const char *const ifdown = "/sbin/ifdown";
> >      struct netcf *ncf = nif->ncf;
> >      int result = -1;
> 
> This path needs to be determined at runtime (or configure time) similar
> to binary paths in libvirt.

Note that some paths in libvirt are absolute.  But for these I
will go ahead and have them generated at configure time.  Otherwise
I think I'd have to hack dutil_linux.c to use execvpe and manually
add sbin to $PATH, which I don't really want to do.

thanks,
-serge


More information about the netcf-devel mailing list