-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mount.zfs argument order breaks on POSIX-conforming getopt #4222
Comments
Normally I'd suggest avoiding the use of |
… of argv. mount.zfs is called by convention (and util-linux) with arguments last, i.e. % mount.zfs <dataset> <mountpoint> -o <options> This is not a problem on glibc since GNU getopt(3) will reorder the arguments. However, alternative libc such as musl libc (or glibc with $POSIXLY_CORRECT set) will not permute argv and fail to parse the -o <options>. Use getopt_long so musl will permute arguments. Signed-off-by: Christian Neukirchen <chneukirchen@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #4222
… of argv. mount.zfs is called by convention (and util-linux) with arguments last, i.e. % mount.zfs <dataset> <mountpoint> -o <options> This is not a problem on glibc since GNU getopt(3) will reorder the arguments. However, alternative libc such as musl libc (or glibc with $POSIXLY_CORRECT set) will not permute argv and fail to parse the -o <options>. Use getopt_long so musl will permute arguments. Signed-off-by: Christian Neukirchen <chneukirchen@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#4222
… of argv. mount.zfs is called by convention (and util-linux) with arguments last, i.e. % mount.zfs <dataset> <mountpoint> -o <options> This is not a problem on glibc since GNU getopt(3) will reorder the arguments. However, alternative libc such as musl libc (or glibc with $POSIXLY_CORRECT set) will not permute argv and fail to parse the -o <options>. Use getopt_long so musl will permute arguments. Signed-off-by: Christian Neukirchen <chneukirchen@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#4222
… of argv. mount.zfs is called by convention (and util-linux) with arguments last, i.e. % mount.zfs <dataset> <mountpoint> -o <options> This is not a problem on glibc since GNU getopt(3) will reorder the arguments. However, alternative libc such as musl libc (or glibc with $POSIXLY_CORRECT set) will not permute argv and fail to parse the -o <options>. Use getopt_long so musl will permute arguments. Signed-off-by: Christian Neukirchen <chneukirchen@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#4222
… of argv. mount.zfs is called by convention (and util-linux) with arguments last, i.e. % mount.zfs <dataset> <mountpoint> -o <options> This is not a problem on glibc since GNU getopt(3) will reorder the arguments. However, alternative libc such as musl libc (or glibc with $POSIXLY_CORRECT set) will not permute argv and fail to parse the -o <options>. Use getopt_long so musl will permute arguments. Signed-off-by: Christian Neukirchen <chneukirchen@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#4222
The mount.zfs helper program uses getopt(3) to parse its arguments. mount.zfs is called by util-linux with the non-standard order of
<spec> <mountpoint> -o <options>
which other tools likemount.nfs
orsshfs
explicitly expect. (This is specified inEXTERNAL HELPERS
in util-linux mount(8).)This is not a problem on glibc since GNU getopt(3) will reorder the arguments. However, alternative libc such as musl libc (or glibc with
$POSIXLY_CORRECT
set) will not permute argv and fail to parse the-o <options>
.I see two options here:
<device> <mountpoint>
and use getopt on the rest.The latter option has been implemented as a patch by Void Linux: https://github.com/voidlinux/void-packages/commit/0203a5aa0f26bb0ef334e09c8736f35275d06e8f
The text was updated successfully, but these errors were encountered: