Skip to content

glusterd/snapshot: allow overriding ZFS_COMMAND at build time - #4778

Open
ThalesBarretto wants to merge 1 commit into
gluster:develfrom
ThalesBarretto:fix-dry-program-paths-category-3
Open

ThalesBarretto wants to merge 1 commit into
gluster:develfrom
ThalesBarretto:fix-dry-program-paths-category-3

Conversation

@ThalesBarretto

Copy link
Copy Markdown
Contributor

glusterd/snapshot: make the zfs tool path consistent and overridable

Wrap ZFS_COMMAND in an #ifndef guard so a packager can override via CPPFLAGS
(-DZFS_COMMAND='"/usr/sbin/zfs"') idiom already used in the tree.

The outlier glusterd_zfs_dataset() spelled the zfs list command as a bare string,
which is now routed through ZFS_COMMAND too, so all sites share one definition.

Fixes: #4777

ZFS_COMMAND hardcodes the absolute /sbin/zfs path. Wrap it in an #ifndef guard
so the default is preserved but a packager can override it via CPPFLAGS
(-DZFS_COMMAND='"/usr/sbin/zfs"'), matching the _PATH_UMOUNT / _PATH_SETFATTR
idiom already used in the tree.

Also, enforce the lone excption: glusterd_zfs_dataset() spelled the
"zfs list" command as a bare "zfs" string. Use ZFS_COMMAND there too, so all
ites in the file share a single definition of the command.

Signed-off-by: Thales Antunes de Oliveira Barretto <thales.barretto.git@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zfs snapshot: tool path is non-verridable , one call bypasses ZFS_COMMAND,

1 participant