util.go 398 B

1234567891011121314151617
  1. package runhcs
  2. import "net/url"
  3. const (
  4. SafePipePrefix = `\\.\pipe\ProtectedPrefix\Administrators\`
  5. )
  6. // ShimSuccess is the byte stream returned on a successful operation.
  7. var ShimSuccess = []byte{0, 'O', 'K', 0}
  8. func SafePipePath(name string) string {
  9. // Use a pipe in the Administrators protected prefixed to prevent malicious
  10. // squatting.
  11. return SafePipePrefix + url.PathEscape(name)
  12. }