Files
privatae-bastion/client-go/agentsession_open_windows.go
T
Privatae 4f8285ef18
ci / personal-data (push) Successful in 4s
ci / test (push) Successful in 3m36s
ci / fuzz (push) Successful in 3m35s
bastion 0.60.0
2026-11-02 00:10:58 +00:00

23 lines
481 B
Go

//go:build windows
package main
import (
"errors"
"os"
)
// openOwned on Windows: no owner check by account number (accounts are SIDs
// here), and a symlink needs privilege to create; the file must be regular.
func openOwned(path string, _ int) (*os.File, error) {
f, err := os.Open(path)
if err != nil {
return nil, err
}
if st, err := f.Stat(); err != nil || !st.Mode().IsRegular() {
_ = f.Close()
return nil, errors.New("not a regular file")
}
return f, nil
}