- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for IsPermission (0.23 sec)
-
src/os/error_test.go
{&os.SyscallError{Err: fs.ErrPermission}, true}, } func TestIsPermission(t *testing.T) { for _, tt := range isPermissionTests { if got := os.IsPermission(tt.err); got != tt.want { t.Errorf("os.IsPermission(%#v) = %v; want %v", tt.err, got, tt.want) } if got := errors.Is(tt.err, fs.ErrPermission); got != tt.want { t.Errorf("errors.Is(%#v, fs.ErrPermission) = %v; want %v", tt.err, got, tt.want)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 19 00:41:52 UTC 2023 - 4.9K bytes - Viewed (0) -
src/syscall/syscall_ptrace_test.go
} attr := &os.ProcAttr{ Sys: &syscall.SysProcAttr{ Ptrace: true, }, } proc, err := os.StartProcess(bin, []string{bin}, attr) if err == nil { proc.Kill() } if err != nil && !os.IsPermission(err) { t.Fatalf("StartProcess with ptrace enabled failed: %v", err) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 28 18:17:57 UTC 2021 - 768 bytes - Viewed (0) -
src/os/error.go
return underlyingErrorIs(err, ErrNotExist) } // IsPermission returns a boolean indicating whether the error is known to // report that permission is denied. It is satisfied by [ErrPermission] as well // as some syscall errors. // // This function predates [errors.Is]. It only supports errors returned by // the os package. New code should use errors.Is(err, fs.ErrPermission). func IsPermission(err error) bool {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 21:33:12 UTC 2024 - 4.8K bytes - Viewed (0) -
src/os/removeall_noat.go
return err } } } // Remove directory. err1 := Remove(path) if err1 == nil || IsNotExist(err1) { return nil } if runtime.GOOS == "windows" && IsPermission(err1) { if fs, err := Stat(path); err == nil { if err = Chmod(path, FileMode(0200|int(fs.Mode()))); err == nil { err1 = Remove(path) } } } if err == nil { err = err1 }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 29 16:24:51 UTC 2022 - 3.1K bytes - Viewed (0) -
src/runtime/security_test.go
proc, err := os.StartProcess(helloBin, []string{helloBin}, &os.ProcAttr{ Env: []string{"GOTRACEBACK=system", "TEST_OUTPUT=" + tempfilePath}, Files: []*os.File{os.Stdin, pw}, }) if err != nil { if os.IsPermission(err) { t.Skip("don't have execute permission on setuid binary, possibly directory permission issue?") } t.Fatal(err) } done := make(chan bool, 1) go func() { io.Copy(b, pr) pr.Close()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 13 18:10:14 UTC 2023 - 4.1K bytes - Viewed (0) -
src/cmd/go/internal/web/http.go
URL: u.Redacted(), Status: http.StatusText(http.StatusNotFound), StatusCode: http.StatusNotFound, Body: http.NoBody, fileErr: err, }, nil } if os.IsPermission(err) { return &Response{ URL: u.Redacted(), Status: http.StatusText(http.StatusForbidden), StatusCode: http.StatusForbidden, Body: http.NoBody, fileErr: err, }, nil
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Aug 10 17:34:27 UTC 2023 - 9.7K bytes - Viewed (0)