Closed adriaandegroot closed 6 years ago
.. the error message, of course, doesn't always happen when running as root. It does when I run it from root's home-dir, which is /root
, and the problem is this bit of code in vzvol:
if [ -d ../lib ]; then
vzvol_libdir=../lib
else
vzvol_libdir=/usr/local/lib/vzvol/lib
fi
When in /root
, ../lib
refers to /lib
, which exists, and then the shared-functions-list inclusion goes bad. That if should probably be patched out, because it's also a security problem: you'll end up sourcing stuff from any ../lib/shared/freebsd that happens to be lying around if you're unlucky with cwd when you run the script.
Good point. This was meant to ease use of vzvol when running directly from the git repo. I'll figure out what to do about this later this week. I could just force it to use a hard-coded directory and remove the if, but that breaks the "you dont have to install it, just git/clone it" part. Might make more sense to check the location of vzvol on disk, cut the binary and bin dir out of the path, and load lib.
Congratulations on getting into the ports tree! vzvol sounds like it'd be awesome to use.
Which is a way of saying "but ..". I'll file issues here instead of FreeBSD's bugtracker, so there are fewer intermediates. Some of these problems might come down to packaging, rather than upstream -- in which case I'll re-report as a PR for olgeni.
I've installed vzvol from ports (built in poudriere locally), version 0.5.5. Running the script as root produces only an error message: