[ovs-git] [openvswitch/ovs] 4d8f04: util: Fix abs_file_name() bugs on Windows.

GitHub noreply at github.com
Fri Aug 3 17:48:19 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 4d8f04b3e93d7a853619e664abde955d0dfe0c48
      https://github.com/openvswitch/ovs/commit/4d8f04b3e93d7a853619e664abde955d0dfe0c48
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-08-03 (Fri, 03 Aug 2018)

  Changed paths:
    M Documentation/intro/install/windows.rst
    M appveyor.yml
    M lib/util.c
    M lib/util.h

  Log Message:
  -----------
  util: Fix abs_file_name() bugs on Windows.

abs_file_name() believed that a file name that begins with / or contains :
is absolute and that any other file name is relative.  On Windows, this is
wrong in at least the following ways:

   * / and \ are interchangeable on Windows.

   * A name that begins with \\ or // is also absolute.

   * A name that begins with X: but not X:\ is not absolute.

   * A name with : in some position other than the second position is
     not absolute (although it might not be valid either?).

Furthermore, Windows has more than one current working directory (one per
volume letter), so trying to make a file name absolute by just prefixing
the current working directory for the current volume results in silliness.

This patch attempts to fix the problem.

This makes OVS link against shlwapi, which is needed to use
PathIsRelative().

Found by inspection.

Acked-by: Alin Gabriel Serdean <aserdean at ovn.org>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: 4c36252dce687a53e39a37b2acbdbb20a965217d
      https://github.com/openvswitch/ovs/commit/4c36252dce687a53e39a37b2acbdbb20a965217d
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-08-03 (Fri, 03 Aug 2018)

  Changed paths:
    M lib/unixctl.c

  Log Message:
  -----------
  unixctl: Use absolute paths on Windows too.

When this case was adapted for Windows, asb_file_name() simply didn't work
at all there.  Now, it should work OK, and it seems like the right thing
to do, and it makes the code more straightforward too.

Acked-by: Alin Gabriel Serdean <aserdean at ovn.org>
Signed-off-by: Ben Pfaff <blp at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/7491caa37f3b...4c36252dce68
      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the git mailing list