A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pkg.go.dev/github.com/google/safeopen below:

safeopen package - github.com/google/safeopen - Go Packages

Package safeopen provides replacement APIs for Open that do not permit path traversal. The library supports Unix and Windows systems. OS native safe primitives are leveraged where available (e.g. openat2 + RESOLVE_BENEATH). Symbolic links are followed only if there is a safe way to prevent traversal (e.g. on platforms where OS level safe primitives are available), otherwise an error is returned.

This section is empty.

This section is empty.

CreateAt creates or truncates the named file in the named directory. file may not contain path separators.

If the file already exists, it is truncated. If the file does not exist, it is created with mode 0666 (before umask). If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR. If there is an error, it will be of type *PathError.

CreateBeneath creates or truncates the named file in the named directory. file may not contain .. path traversal entries.

If the file already exists, it is truncated. If the file does not exist, it is created with mode 0666 (before umask). If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR. If there is an error, it will be of type *PathError.

OpenAt opens the named file in the named directory for reading. file may not contain path separators.

If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. If there is an error, it will be of type *PathError.

OpenBeneath opens the named file in the named directory, or a subdirectory, for reading. file may not contain .. path traversal entries.

If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. If there is an error, it will be of type *PathError.

OpenFileAt is the generalized OpenAt call; most users will use OpenAt or CreateAt instead.

It opens the named file in the named directory with specified flag (O_RDONLY etc.). File may not contain path separators. If the file does not exist, and the O_CREATE flag is passed, it is created with mode perm (before umask). The perm parameter is ignored on Windows. If successful, methods on the returned File can be used for I/O. If there is an error, it will be of type *PathError.

OpenFileBeneath is the generalized OpenBeneath call; most users will use OpenBeneath or CreateBeneath instead.

It opens the named file in the named directory with specified flag (O_RDONLY etc.). File may not contain .. path traversal entries. If the file does not exist, and the O_CREATE flag is passed, it is created with mode perm (before umask). The perm parameter is ignored on Windows. If successful, methods on the returned File can be used for I/O. If there is an error, it will be of type *PathError.

ReadFileAt is a replacement of os.ReadFile that leverages safeopen.OpenAt.

ReadFileBeneath is a replacement of os.ReadFile that leverages safeopen.OpenBeneath.

WriteFileAt is a replacement of os.WriteFile that leverages safeopen.CreateAt.

WriteFileBeneath is a replacement of os.WriteFile that leverages safeopen.CreateBeneath.

This section is empty.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4