mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
zfs, libzfs: diff: accept -h/ZFS_DIFF_NO_MANGLE, disabling path escaping
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Rich Ercolani <rincebrain@gmail.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12829
This commit is contained in:
@@ -176,8 +176,13 @@ print_what(FILE *fp, mode_t what)
|
||||
static void
|
||||
print_cmn(FILE *fp, differ_info_t *di, const char *file)
|
||||
{
|
||||
stream_bytes(fp, di->dsmnt);
|
||||
stream_bytes(fp, file);
|
||||
if (!di->no_mangle) {
|
||||
stream_bytes(fp, di->dsmnt);
|
||||
stream_bytes(fp, file);
|
||||
} else {
|
||||
(void) fputs(di->dsmnt, fp);
|
||||
(void) fputs(file, fp);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -752,6 +757,7 @@ zfs_show_diffs(zfs_handle_t *zhp, int outfd, const char *fromsnap,
|
||||
di.scripted = (flags & ZFS_DIFF_PARSEABLE);
|
||||
di.classify = (flags & ZFS_DIFF_CLASSIFY);
|
||||
di.timestamped = (flags & ZFS_DIFF_TIMESTAMP);
|
||||
di.no_mangle = (flags & ZFS_DIFF_NO_MANGLE);
|
||||
|
||||
di.outputfd = outfd;
|
||||
di.datafd = pipefd[0];
|
||||
|
||||
@@ -232,6 +232,7 @@ typedef struct differ_info {
|
||||
boolean_t scripted;
|
||||
boolean_t classify;
|
||||
boolean_t timestamped;
|
||||
boolean_t no_mangle;
|
||||
uint64_t shares;
|
||||
int zerr;
|
||||
int cleanupfd;
|
||||
|
||||
Reference in New Issue
Block a user