Skip to content

Commit 6567a08

Browse files
Add SeCreateSymbolicLinkPrivilege (#4649) (#4650)
(cherry picked from commit 5fe8deb) Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
1 parent 68f32d7 commit 6567a08

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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)