summary refs log tree commit diff stats
path: root/LICENSE
blob: 8cb51645a3f41b240015fe9ee6bce9a45910b6d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
Copyright (c) 2020, Andinus <andinus@nand.sh>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
olang.org/x/sys/unix" // Unveil takes a path, permission & unveils it, returning an // error if unveil fails. "no such file or directory" error is // ignored. func Unveil(path string, flags string) (err error) { err = unix.Unveil(path, flags) // "no such file or directory" error is ignored. if err != nil && err.Error() != "no such file or directory" { // Better error message could be returned like // one that includes the path on which unveil // failed. return err } // Returning nil because err can be "no such file or // directory" which needs to be ignored. return nil } // UnveilPath is kept for backwards compatibility, use Unveil instead. func UnveilPath(path string, flags string) (err error) { return Unveil(path, flags) } // UnveilStrict is just a wrapper around unix.Unveil. func UnveilStrict(path string, flags string) error { return unix.Unveil(path, flags) } // UnveilPathStrict is kept for backwards compatibility, use // UnveilStrict instead. func UnveilPathStrict(path string, flags string) error { return UnveilStrict(path, flags) }