efi_loader: do not add \ in efi_fs_from_name()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 23 Feb 2019 10:20:23 +0000 (11:20 +0100)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 2 Mar 2019 22:34:26 +0000 (23:34 +0100)
In the `efidebug boot add` command we do not want an unsolicited leading
backslash added to the file name.

There is no good reason to mark a loaded file with a backslash as absolute.
Anyway when reading files the file name will be interpreted as relative to
root directory of the device.

So let's get rid of this backslash.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_device_path.c

index 98c36e798f5f40fcda0ddba63bd9f93dbbdc5e7c..53b40c8c3c2dd62b2de36dc768e3975b76b27bb0 100644 (file)
@@ -985,12 +985,7 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
        if (!path)
                return EFI_SUCCESS;
 
-       if (!is_net) {
-               /* Add leading / to fs paths, because they're absolute */
-               snprintf(filename, sizeof(filename), "/%s", path);
-       } else {
-               snprintf(filename, sizeof(filename), "%s", path);
-       }
+       snprintf(filename, sizeof(filename), "%s", path);
        /* DOS style file path: */
        s = filename;
        while ((s = strchr(s, '/')))