diff options
author | Warner Losh <imp@FreeBSD.org> | 2018-01-05 07:09:29 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2018-01-05 07:09:29 +0000 |
commit | 670a4056e2cf31c89305db0dad7b515ba3cc0cab (patch) | |
tree | ec097e1b1bd4041540a30796c90cd758d8a26896 /lib/libefivar | |
parent | 167b7a41ff171c2593a019eaba84ac5317f3c499 (diff) | |
download | src-670a4056e2cf31c89305db0dad7b515ba3cc0cab.tar.gz src-670a4056e2cf31c89305db0dad7b515ba3cc0cab.zip |
Need to convert '/' back to '\' when creating a path. Ideally, this
would be filesystem type dependent, but that's difficult to accomplish
and it's unclear how the UEFI firmware will cope. Be conservative and
make boot loaders cope instead.
Sponsored by: Netflix
Notes
Notes:
svn path=/head/; revision=327575
Diffstat (limited to 'lib/libefivar')
-rw-r--r-- | lib/libefivar/efivar-dp-xlate.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/libefivar/efivar-dp-xlate.c b/lib/libefivar/efivar-dp-xlate.c index 5c9398d9f43f..a0a61e710dd6 100644 --- a/lib/libefivar/efivar-dp-xlate.c +++ b/lib/libefivar/efivar-dp-xlate.c @@ -527,12 +527,17 @@ find_geom_efimedia(struct gmesh *mesh, const char *dev) static int build_dp(const char *efimedia, const char *relpath, efidp *dp) { - char *fp, *dptxt = NULL; + char *fp, *dptxt = NULL, *cp, *rp; int rv = 0; efidp out = NULL; size_t len; - fp = path_to_file_dp(relpath); + rp = strdup(relpath); + for (cp = rp; *cp; cp++) + if (*cp == '/') + *cp = '\\'; + fp = path_to_file_dp(rp); + free(rp); if (fp == NULL) { rv = ENOMEM; goto errout; |