Skip to content

Commit

Permalink
Add SeCreateSymbolicLinkPrivilege (#4649)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakerouse authored May 1, 2024
1 parent 79ff5f7 commit 5fe8deb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/pkg/agent/install/user_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const (
USER_UF_SCRIPT = 1
USER_UF_NORMAL_ACCOUNT = 512
USER_UF_DONT_EXPIRE_PASSWD = 65536

accountRightCreateSymbolicLink gowin32.AccountRightName = "SeCreateSymbolicLinkPrivilege"
)

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

return FindUID(name)
}
Expand Down

0 comments on commit 5fe8deb

Please sign in to comment.