Summary
xlators/mgmt/glusterd/src/snapshot/glusterd-zfs-snapshot.c reaches the zfs
utility through a file-local macro:
#define ZFS_COMMAND "/sbin/zfs"
Two related problems:
- One call bypasses the macro. Six of the seven
zfs invocations in the file
go through ZFS_COMMAND, but glusterd_zfs_dataset() spells the zfs list
command as a bare "zfs" string (line 54).
- Not overridable.
ZFS_COMMAND bakes in /sbin/zfs with no way for a packager
to point it elsewhere without patching the source — unlike the sibling path macros
_PATH_UMOUNT and _PATH_SETFATTR, which are #ifndef-guarded for exactly this.
The outlier:
/* glusterd_zfs_dataset(), line 54 */
runner_add_args(&runner, "zfs", "list", "-Ho", "name", brick_path, NULL);
Note the two spellings resolve differently: glusterd's runner spawns via
posix_spawnp, so the bare "zfs" is $PATH-resolved, whereas ZFS_COMMAND pins
/sbin/zfs. So line 54 is not just cosmetically different — it is the one site whose
zfs path is not the file's declared /sbin/zfs.
Summary
xlators/mgmt/glusterd/src/snapshot/glusterd-zfs-snapshot.creaches thezfsutility through a file-local macro:
Two related problems:
zfsinvocations in the filego through
ZFS_COMMAND, butglusterd_zfs_dataset()spells thezfs listcommand as a bare
"zfs"string (line 54).ZFS_COMMANDbakes in/sbin/zfswith no way for a packagerto point it elsewhere without patching the source — unlike the sibling path macros
_PATH_UMOUNTand_PATH_SETFATTR, which are#ifndef-guarded for exactly this.The outlier:
Note the two spellings resolve differently: glusterd's runner spawns via
posix_spawnp, so the bare"zfs"is$PATH-resolved, whereasZFS_COMMANDpins/sbin/zfs. So line 54 is not just cosmetically different — it is the one site whosezfs path is not the file's declared
/sbin/zfs.