Skip to content

Commit 31b8d28

Browse files
committed
fix merge conflicts
1 parent b20480b commit 31b8d28

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

internal/pkg/agent/install/install_windows.go

+4-14
Original file line numberDiff line numberDiff line change
@@ -81,26 +81,16 @@ func withServiceOptions(username string, groupName string) ([]serviceOpt, error)
8181
//
8282
// gives user the ability to control the service, needed when installed with --unprivileged or
8383
// ReExec is not possible on Windows.
84-
<<<<<<< HEAD
8584
func servicePostInstall(ownership utils.FileOwner) error {
86-
if ownership.UID == "" {
87-
// no user, running with LOCAL SYSTEM (do nothing)
88-
return nil
89-
=======
90-
func serviceConfigure(ownership utils.FileOwner) error {
9185
// Modify registry to allow logging to eventlog as "Elastic Agent".
9286
err := eventlog.InstallAsEventCreate(paths.ServiceName, eventlog.Info|eventlog.Warning|eventlog.Error)
9387
if err != nil && !strings.Contains(err.Error(), "registry key already exists") {
9488
return fmt.Errorf("unable to create registry key for logging: %w", err)
9589
}
96-
// https://learn.microsoft.com/en-us/windows-hardware/drivers/kernel/sddl-for-device-objects
97-
sddl := "D:(A;;GA;;;SY)" + // SDDL_LOCAL_SYSTEM -> SDDL_GENERIC_ALL
98-
"(A;;GA;;;BA)" + // SDDL_BUILTIN_ADMINISTRATORS -> SDDL_GENERIC_ALL
99-
"(A;;GR;;;WD)" + // SDDL_EVERYONE -> SDDL_GENERIC_READ
100-
"(A;;GRGX;;;NS)" // SDDL_NETWORK_SERVICE -> SDDL_GENERIC_READ|SDDL_GENERIC_EXECUTE
101-
if ownership.UID != "" {
102-
sddl += fmt.Sprintf("(A;;GA;;;%s)", ownership.UID) // Ownership UID -> SDDL_GENERIC_ALL
103-
>>>>>>> 6c20730d5c ([windows] if `elastic-agent run` fails, log error to Application EventLog (#4846))
90+
91+
if ownership.UID == "" {
92+
// no user, running with LOCAL SYSTEM (do nothing)
93+
return nil
10494
}
10595

10696
// https://learn.microsoft.com/en-us/windows-hardware/drivers/kernel/sddl-for-device-objects

0 commit comments

Comments
 (0)