- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 10 for IsPermission (0.41 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/syscall/exec_linux_test.go
out, err := cmd.CombinedOutput() t.Logf("%v: %v", cmd, err) if uid != 0 && setgroups { t.Logf("as non-root, expected permission error due to unprivileged gid_map") if !os.IsPermission(err) { if err == nil { t.Skipf("unexpected success: probably old kernel without security fix?") } if testenv.SyscallIsNotSupported(err) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 15 07:45:37 UTC 2024 - 20.6K 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) -
src/os/os_unix_test.go
dir, err := f.Stat() if err != nil { t.Fatalf("stat %s: %s", f.Name(), err) } linkname := f.Name() + "2" if err := Symlink(f.Name(), linkname); err != nil { if runtime.GOOS == "android" && IsPermission(err) { t.Skip("skipping test on Android; permission error creating symlink") } t.Fatalf("link %s -> %s: %v", f.Name(), linkname, err) } defer Remove(linkname)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Sep 18 17:32:43 UTC 2023 - 11.5K bytes - Viewed (0) -
cmd/xl-storage.go
if cleanUp { bgFormatErasureCleanupTmp(s.drivePath) // cleanup any old data. } formatData, formatFi, err := formatErasureMigrate(s.drivePath) if err != nil && !errors.Is(err, os.ErrNotExist) { if os.IsPermission(err) { return s, errDiskAccessDenied } else if isSysErrIO(err) { return s, errFaultyDisk } return s, err } s.formatData = formatData s.formatFileInfo = formatFi
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Mon Jun 10 15:51:27 UTC 2024 - 85.3K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go
{"Getuid", Func, 0}, {"Getwd", Func, 0}, {"Hostname", Func, 0}, {"Interrupt", Var, 0}, {"IsExist", Func, 0}, {"IsNotExist", Func, 0}, {"IsPathSeparator", Func, 0}, {"IsPermission", Func, 0}, {"IsTimeout", Func, 10}, {"Kill", Var, 0}, {"Lchown", Func, 0}, {"Link", Func, 0}, {"LinkError", Type, 0}, {"LinkError.Err", Field, 0}, {"LinkError.New", Field, 0},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 534.2K bytes - Viewed (0)