[go] os: do not call CreateSymbolicLink again if err is not ERROR_PRIVILEGE_NOT_HELD

38 views
Skip to first unread message

Yasuhiro Matsumoto (Gerrit)

unread,
Jun 29, 2022, 11:41:31 AM6/29/22
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Yasuhiro Matsumoto has uploaded this change for review.

View Change

os: do not call CreateSymbolicLink again if err is not ERROR_PRIVILEGE_NOT_HELD

Updates #53582

Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
---
M src/os/file_windows.go
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/os/file_windows.go b/src/os/file_windows.go
index db5c27d..3cd4a0b 100644
--- a/src/os/file_windows.go
+++ b/src/os/file_windows.go
@@ -368,6 +368,9 @@
}
err = syscall.CreateSymbolicLink(n, o, flags)
if err != nil {
+ if err.(syscall.Errno) == syscall.ERROR_PRIVILEGE_NOT_HELD {
+ return &LinkError{"symlink", oldname, newname, err}
+ }
// the unprivileged create flag is unsupported
// below Windows 10 (1703, v10.0.14972). retry without it.
flags &^= windows.SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE

To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
Gerrit-Change-Number: 415094
Gerrit-PatchSet: 1
Gerrit-Owner: Yasuhiro Matsumoto <matt...@gmail.com>
Gerrit-MessageType: newchange

Yasuhiro Matsumoto (Gerrit)

unread,
Jun 29, 2022, 11:43:00 AM6/29/22
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Yasuhiro Matsumoto uploaded patch set #2 to this change.

View Change

os: do not call CreateSymbolicLink again if err is not ERROR_PRIVILEGE_NOT_HELD

Updates #53582

Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
---
M src/os/file_windows.go
1 file changed, 14 insertions(+), 0 deletions(-)

To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
Gerrit-Change-Number: 415094
Gerrit-PatchSet: 2
Gerrit-Owner: Yasuhiro Matsumoto <matt...@gmail.com>
Gerrit-MessageType: newpatchset

Yasuhiro Matsumoto (Gerrit)

unread,
Jun 29, 2022, 11:44:52 AM6/29/22
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

View Change

1 comment:

  • Patchset:

To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
Gerrit-Change-Number: 415094
Gerrit-PatchSet: 2
Gerrit-Owner: Yasuhiro Matsumoto <matt...@gmail.com>
Gerrit-Comment-Date: Wed, 29 Jun 2022 15:44:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Bryan Mills (Gerrit)

unread,
Jun 29, 2022, 12:20:49 PM6/29/22
to goph...@pubsubhelper.golang.org, Alex Brainman, Bryan Mills, Ian Lance Taylor, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Alex Brainman, Ian Lance Taylor, Yasuhiro Matsumoto.

Patch set 2:Run-TryBot +1Code-Review +1

View Change

2 comments:


    • return &LinkError{"symlink", oldname, newname, err}
      }

    • This seems like it would be a bit simpler as two sequential conditions instead of one nested one:

      ```
      if err == syscall.ERROR_PRIVILEGE_NOT_HELD {

    • // the unprivileged create flag is unsupported
      // below Windows 10 (1703, v10.0.14972). retry without it.
      flags &^= windows.SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
    • 		err = syscall.CreateSymbolicLink(n, o, flags)
      }
      if err != nil {
    • 		return &LinkError{"symlink", oldname, newname, err}
      }
    • 	return nil
      ```

To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
Gerrit-Change-Number: 415094
Gerrit-PatchSet: 2
Gerrit-Owner: Yasuhiro Matsumoto <matt...@gmail.com>
Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Alex Brainman <alex.b...@gmail.com>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Yasuhiro Matsumoto <matt...@gmail.com>
Gerrit-Comment-Date: Wed, 29 Jun 2022 16:20:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Yasuhiro Matsumoto (Gerrit)

unread,
Jun 29, 2022, 12:56:56 PM6/29/22
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Alex Brainman, Bryan Mills, Ian Lance Taylor, Yasuhiro Matsumoto.

Yasuhiro Matsumoto uploaded patch set #3 to this change.

View Change

The following approvals got outdated and were removed: Run-TryBot+1 by Bryan Mills, TryBot-Result-1 by Gopher Robot

os: do not call CreateSymbolicLink again if err is not ERROR_PRIVILEGE_NOT_HELD nor ERROR_INVALID_PARAMETER


Updates #53582

Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
---
M src/os/file_windows.go
1 file changed, 15 insertions(+), 0 deletions(-)

To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
Gerrit-Change-Number: 415094
Gerrit-PatchSet: 3
Gerrit-Owner: Yasuhiro Matsumoto <matt...@gmail.com>
Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Bryan Mills <bcm...@google.com>
Gerrit-Attention: Alex Brainman <alex.b...@gmail.com>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Yasuhiro Matsumoto <matt...@gmail.com>
Gerrit-MessageType: newpatchset

Yasuhiro Matsumoto (Gerrit)

unread,
Jun 29, 2022, 12:59:18 PM6/29/22
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Alex Brainman, Bryan Mills, Ian Lance Taylor, Yasuhiro Matsumoto.

Yasuhiro Matsumoto uploaded patch set #4 to this change.

View Change

os: do not call CreateSymbolicLink again if err is not ERROR_PRIVILEGE_NOT_HELD nor ERROR_INVALID_PARAMETER


Updates #53582

Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
---
M src/os/file_windows.go
1 file changed, 15 insertions(+), 0 deletions(-)

To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
Gerrit-Change-Number: 415094
Gerrit-PatchSet: 4

Yasuhiro Matsumoto (Gerrit)

unread,
Jun 29, 2022, 1:00:26 PM6/29/22
to goph...@pubsubhelper.golang.org, Gopher Robot, Alex Brainman, Bryan Mills, Ian Lance Taylor, golang-co...@googlegroups.com

Attention is currently required from: Alex Brainman, Bryan Mills, Ian Lance Taylor.

View Change

2 comments:

  • Patchset:

  • File src/os/file_windows.go:

    • Patch Set #2, Line 370:

      	if err != nil {
      if err.(syscall.Errno) != syscall.ERROR_PRIVILEGE_NOT_HELD {
      return &LinkError{"symlink", oldname, newname, err}
      }

    • This seems like it would be a bit simpler as two sequential conditions instead of one nested one: […]

      Done

To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
Gerrit-Change-Number: 415094
Gerrit-PatchSet: 4
Gerrit-Owner: Yasuhiro Matsumoto <matt...@gmail.com>
Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Bryan Mills <bcm...@google.com>
Gerrit-Attention: Alex Brainman <alex.b...@gmail.com>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Comment-Date: Wed, 29 Jun 2022 17:00:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Bryan Mills <bcm...@google.com>
Gerrit-MessageType: comment

Ian Lance Taylor (Gerrit)

unread,
Jun 29, 2022, 5:16:02 PM6/29/22
to goph...@pubsubhelper.golang.org, Ian Lance Taylor, Gopher Robot, Alex Brainman, Bryan Mills, golang-co...@googlegroups.com

Attention is currently required from: Alex Brainman, Bryan Mills, Yasuhiro Matsumoto.

Patch set 4:Run-TryBot +1

View Change

    To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
    Gerrit-Change-Number: 415094
    Gerrit-PatchSet: 4
    Gerrit-Owner: Yasuhiro Matsumoto <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Attention: Yasuhiro Matsumoto <matt...@gmail.com>
    Gerrit-Comment-Date: Wed, 29 Jun 2022 21:15:57 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Bryan Mills (Gerrit)

    unread,
    Jun 30, 2022, 2:39:43 PM6/30/22
    to goph...@pubsubhelper.golang.org, Gopher Robot, Ian Lance Taylor, Alex Brainman, Bryan Mills, golang-co...@googlegroups.com

    Attention is currently required from: Alex Brainman, Yasuhiro Matsumoto.

    Patch set 4:Code-Review +1

    View Change

    2 comments:

    • File src/os/file_windows.go:

      • Patch Set #2, Line 370:

        	if err != nil {
        if err.(syscall.Errno) != syscall.ERROR_PRIVILEGE_NOT_HELD {
        return &LinkError{"symlink", oldname, newname, err}
        }

      • Done

        Does not appear to be done?

        I would ideally like to see only one `return &LinkError{ … }` for the case where the `CreateSymbolicLink` call fails:

        ```

      • err = syscall.CreateSymbolicLink(n, o, flags)
      • 	if err == windows.ERROR_INVALID_PARAMETER {

      • // the unprivileged create flag is unsupported
        // below Windows 10 (1703, v10.0.14972). retry without it.
        flags &^= windows.SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
        err = syscall.CreateSymbolicLink(n, o, flags)
        }
        if err != nil {
      • 		return &LinkError{"symlink", oldname, newname, err}
        }
      • 	return nil
        ```
    • File src/os/file_windows.go:

      • Patch Set #4, Line 371: ERROR_PRIVILEGE_NOT_HELD

        Hmm... is the `ERROR_PRIVILEGE_NOT_HELD` error actually relevant here at all?

        This is a retry without the `SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE` flag, but if the privilege is actually required then retrying _without_ that flag won't fix that problem anyway.

    To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
    Gerrit-Change-Number: 415094
    Gerrit-PatchSet: 4
    Gerrit-Owner: Yasuhiro Matsumoto <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Attention: Yasuhiro Matsumoto <matt...@gmail.com>
    Gerrit-Comment-Date: Thu, 30 Jun 2022 18:39:38 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Bryan Mills <bcm...@google.com>
    Comment-In-Reply-To: Yasuhiro Matsumoto <matt...@gmail.com>
    Gerrit-MessageType: comment

    Yasuhiro Matsumoto (Gerrit)

    unread,
    Jul 1, 2022, 9:59:48 AM7/1/22
    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Attention is currently required from: Alex Brainman, Ian Lance Taylor, Yasuhiro Matsumoto.

    Yasuhiro Matsumoto uploaded patch set #5 to this change.

    View Change

    The following approvals got outdated and were removed: Run-TryBot+1 by Ian Lance Taylor, TryBot-Result+1 by Gopher Robot

    os: do not call CreateSymbolicLink again if err is not ERROR_PRIVILEGE_NOT_HELD nor ERROR_INVALID_PARAMETER

    Updates #53582

    Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
    ---
    M src/os/file_windows.go
    1 file changed, 15 insertions(+), 4 deletions(-)

    To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
    Gerrit-Change-Number: 415094
    Gerrit-PatchSet: 5
    Gerrit-Owner: Yasuhiro Matsumoto <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Alex Brainman <alex.b...@gmail.com>

    Yasuhiro Matsumoto (Gerrit)

    unread,
    Jul 1, 2022, 9:59:58 AM7/1/22
    to goph...@pubsubhelper.golang.org, Gopher Robot, Ian Lance Taylor, Alex Brainman, Bryan Mills, golang-co...@googlegroups.com

    Attention is currently required from: Alex Brainman, Bryan Mills, Ian Lance Taylor.

    View Change

    2 comments:

    • File src/os/file_windows.go:

      • Patch Set #2, Line 370:

        	if err != nil {
        if err.(syscall.Errno) != syscall.ERROR_PRIVILEGE_NOT_HELD {
        return &LinkError{"symlink", oldname, newname, err}
        }

      • Does not appear to be done? […]

        Done

    • File src/os/file_windows.go:

      • Hmm... is the `ERROR_PRIVILEGE_NOT_HELD` error actually relevant here at all? […]

        When the user does not have privileges, error "A required privilege is not held by the client." is returned.

    To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
    Gerrit-Change-Number: 415094
    Gerrit-PatchSet: 5
    Gerrit-Owner: Yasuhiro Matsumoto <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Comment-Date: Fri, 01 Jul 2022 13:59:52 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Bryan Mills (Gerrit)

    unread,
    Jul 1, 2022, 10:28:44 AM7/1/22
    to goph...@pubsubhelper.golang.org, Gopher Robot, Ian Lance Taylor, Alex Brainman, Bryan Mills, golang-co...@googlegroups.com

    Attention is currently required from: Alex Brainman, Ian Lance Taylor, Yasuhiro Matsumoto.

    Patch set 5:Code-Review +1

    View Change

    1 comment:

    • File src/os/file_windows.go:

      • When the user does not have privileges, error "A required privilege is not held by the client." is returned.

        Right, but when the user does not have privileges, retrying _without_ the `SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE` flag is not going to do anything to fix that situation. (We should skip the overhead of the second call to retry.)

    To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
    Gerrit-Change-Number: 415094
    Gerrit-PatchSet: 5
    Gerrit-Owner: Yasuhiro Matsumoto <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Yasuhiro Matsumoto <matt...@gmail.com>
    Gerrit-Comment-Date: Fri, 01 Jul 2022 14:28:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes

    Yasuhiro Matsumoto (Gerrit)

    unread,
    Jul 1, 2022, 11:41:50 AM7/1/22
    to goph...@pubsubhelper.golang.org, Gopher Robot, Ian Lance Taylor, Alex Brainman, Bryan Mills, golang-co...@googlegroups.com

    Attention is currently required from: Alex Brainman, Bryan Mills, Ian Lance Taylor.

    View Change

    1 comment:

    • File src/os/file_windows.go:

      • > When the user does not have privileges, error "A required privilege is not held by the client. […]

        Sorry, I'm confusing. first call possibly return two errors.
        1. ERROR_PRIVILEGE_NOT_HELD
        This is failure that the user does not have privileges to create symbolic link. So we should call again without SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE flag.
        2. ERROR_INVALID_PARAMETER
        This is failure that the Windows version does not support SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE flag. So try again without SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE.

        Right?

    To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
    Gerrit-Change-Number: 415094
    Gerrit-PatchSet: 5
    Gerrit-Owner: Yasuhiro Matsumoto <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Comment-Date: Fri, 01 Jul 2022 15:41:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Bryan Mills (Gerrit)

    unread,
    Jul 1, 2022, 12:46:00 PM7/1/22
    to goph...@pubsubhelper.golang.org, Gopher Robot, Ian Lance Taylor, Alex Brainman, Bryan Mills, golang-co...@googlegroups.com

    Attention is currently required from: Alex Brainman, Ian Lance Taylor, Yasuhiro Matsumoto.

    View Change

    1 comment:

    • File src/os/file_windows.go:

      • Sorry, I'm confusing. first call possibly return two errors.

      • 1. ERROR_PRIVILEGE_NOT_HELD
        This is failure that the user does not have privileges to create symbolic link. So we should call again without SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE flag.
      • From https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createsymboliclinkw, my understanding is:

        • If the system is in developer mode, `SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE` allows users to create symlinks (regardless of their privilege level).
        • If the system is not in developer mode, then only privileged users can create symlinks (regardless of `SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE`).

        So setting `SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE` can only allow `CreateSymbolicLink` to succeed when it would otherwise fail — the flag cannot cause it to fail when it would otherwise succeed.

        If the first call fails with `ERROR_PRIVILEGE_NOT_HELD`, that means that the user is unprivileged *and* the system is not in developer mode. In that case, retrying without the flag still will not succeed (because the user is still unprivileged.)


      • > 2. ERROR_INVALID_PARAMETER
        > This is failure that the Windows version does not support SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE flag. So try again without SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE.

      • Correct.

    To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
    Gerrit-Change-Number: 415094
    Gerrit-PatchSet: 5
    Gerrit-Owner: Yasuhiro Matsumoto <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Yasuhiro Matsumoto <matt...@gmail.com>
    Gerrit-Comment-Date: Fri, 01 Jul 2022 16:45:56 +0000

    Alex Brainman (Gerrit)

    unread,
    Jul 2, 2022, 1:36:42 AM7/2/22
    to goph...@pubsubhelper.golang.org, Gopher Robot, Ian Lance Taylor, Bryan Mills, golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills, Ian Lance Taylor, Yasuhiro Matsumoto.

    View Change

    2 comments:

    • Patchset:

      • Patch Set #5:

        Thanks for trying to fix this Matn,

        Please see my comment.

        Alex

    • File src/os/file_windows.go:

      • > Sorry, I'm confusing. first call possibly return two errors. […]

        Matn, I don't see purpose of this change. Why do you think it will help with issue #53582? And how do you know your change will not break any existing users?

        I am worried, because we don't have many tests for link creation.

    To view, visit change 415094. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I4495c5886410ed57d41625c088fbcf44e49bf1b9
    Gerrit-Change-Number: 415094
    Gerrit-PatchSet: 5
    Gerrit-Owner: Yasuhiro Matsumoto <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Yasuhiro Matsumoto <matt...@gmail.com>
    Gerrit-Comment-Date: Sat, 02 Jul 2022 05:36:36 +0000
    Reply all
    Reply to author
    Forward
    0 new messages