Skip to content

Commit

Permalink
Handle spaces in exec, and set correct default zed.d
Browse files Browse the repository at this point in the history
Signed-off-by: Jorgen Lundman <[email protected]>
  • Loading branch information
lundman committed Nov 20, 2024
1 parent 65ae459 commit f22537b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/zed/os/windows/zed_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ launch_process(const char *path, const char *prog, char *env[])
fflush(stderr);

snprintf(cmd, sizeof (cmd),
"powershell.exe -ExecutionPolicy Bypass -File %s", path);
"powershell.exe -ExecutionPolicy Bypass -File \"%s\"", path);
/*
* ENV:
* Unix is an array of strings, will last pointer NULL.
Expand Down
4 changes: 4 additions & 0 deletions cmd/zed/zed.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
/*
* Absolute path for the default zed zedlet directory.
*/
#ifdef _WIN32
#define ZED_ZEDLET_DIR SYSCONFDIR "/zed.d"
#else
#define ZED_ZEDLET_DIR SYSCONFDIR "/zfs/zed.d"
#endif

/*
* String prefix for ZED variables passed via environment variables.
Expand Down
4 changes: 2 additions & 2 deletions include/os/windows/zfs/zfs_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/* Define to 1 to enabled dmu tx validation */
/* #undef DEBUG_DMU_TX */

#define SYSCONFDIR "\\SystemRoot\\System32\\drivers" // Windwosify me
#define SYSCONFDIR ZFSEXECDIR // Windwosify me
#define PKGDATADIR "\\SystemRoot\\System32\\drivers" // Windwosify me

#define TEXT_DOMAIN "zfs-windows-user"
Expand Down Expand Up @@ -154,7 +154,7 @@

#define ZFSEXECDIR "C:/Program Files/OpenZFS on Windows"

#define RUNSTATEDIR ZFSEXECDIR "/zed"
#define RUNSTATEDIR ZFSEXECDIR
#define _PATH_STDPATH ""
#define SBINDIR ZFSEXECDIR

0 comments on commit f22537b

Please sign in to comment.