From 8b55f6f077c72d8294a67c752a4f761429ef52b0 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 22 Oct 2017 19:50:13 +0000 Subject: Option args need to be absolute paths --- doc/mdevd.html | 12 ++++++++---- src/mdevd/mdevd.c | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/mdevd.html b/doc/mdevd.html index b5b8a36..3b21565 100644 --- a/doc/mdevd.html +++ b/doc/mdevd.html @@ -90,13 +90,17 @@ is seriously verbose debugging. device nodes, and it will not spawn commands. Instead, it will print to stdout the commands it would have spawned.
  • -f conffile : read the configuration -file from conffile. Default is /etc/mdev.conf.
  • +file from conffile. Default is /etc/mdev.conf. +conffile must be an absolute path.
  • -s slashsys : assume the sysfs -pseudo-filesystem is mounted on slashsys. Default is /sys.
  • +pseudo-filesystem is mounted on slashsys. Default is /sys. +slashsys must be an absolute path.
  • -d slashdev : assume the device nodes -are to be found in slashdev. Default is /dev.
  • +are to be found in slashdev. Default is /dev. +slashdev must be an absolute path.
  • -F fwbase : assume the firmware files, if any, -are to be found in fwbase. Default is /lib/firmware.
  • +are to be found in fwbase. Default is /lib/firmware. +fwbase must be an absolute path.

    Configuration file

    diff --git a/src/mdevd/mdevd.c b/src/mdevd/mdevd.c index 3df038a..296f290 100644 --- a/src/mdevd/mdevd.c +++ b/src/mdevd/mdevd.c @@ -918,7 +918,10 @@ int main (int argc, char const *const *argv) } } argc -= l.ind ; argv += l.ind ; - if (configfile[0] != '/') strerr_dief1x(100, "conffile must be an absolute path") ; + if (configfile[0] != '/') strerr_dief2x(100, configfile, " is not an absolute path") ; + if (slashsys[0] != '/') strerr_dief2x(100, slashsys, " is not an absolute path") ; + if (slashdev[0] != '/') strerr_dief2x(100, slashdev, " is not an absolute path") ; + if (fwbase[0] != '/') strerr_dief2x(100, fwbase, " is not an absolute path") ; if (chdir(slashdev) < 0) strerr_diefu2sys(111, "chdir to ", slashdev) ; } -- cgit v1.3.1