Skip to content

Commit 688f9af

Browse files
committed
Merge branch 'windows-unprivileged-symbolic-rights' into windows-unprivileged-upgrade-testing
2 parents b06dfdb + a645ed0 commit 688f9af

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.agent-versions.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"testVersions": [
3+
"8.14.0-SNAPSHOT",
34
"8.13.3-SNAPSHOT",
45
"8.13.2",
56
"8.12.2",

internal/pkg/agent/install/user_windows.go

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ const (
3939
USER_UF_SCRIPT = 1
4040
USER_UF_NORMAL_ACCOUNT = 512
4141
USER_UF_DONT_EXPIRE_PASSWD = 65536
42+
43+
accountRightCreateSymbolicLink gowin32.AccountRightName = "SeCreateSymbolicLinkPrivilege"
4244
)
4345

4446
// FindGID returns the group's GID on the machine.
@@ -151,6 +153,10 @@ func CreateUser(name string, _ string) (string, error) {
151153
if err != nil {
152154
return "", fmt.Errorf("failed to set service logon: %w", err)
153155
}
156+
err = sp.AddAccountRight(sid, accountRightCreateSymbolicLink)
157+
if err != nil {
158+
return "", fmt.Errorf("failed to add right to create symbolic link: %w", err)
159+
}
154160

155161
return FindUID(name)
156162
}

0 commit comments

Comments
 (0)