Affected by GO-2024-2468
and 4 other vulnerabilities
GO-2024-2468 : snapd Race Condition vulnerability in github.com/snapcore/snapd
GO-2024-3007 : snapd failed to restrict writes to the $HOME/bin path in github.com/snapcore/snapd
GO-2024-3008 : snapd failed to properly check the file type when extracting a snap in github.com/snapcore/snapd
GO-2024-3009 : snapd failed to properly check the destination of symbolic links when extracting a snap in github.com/snapcore/snapd
Discover Packages
github.com/snapcore/snapd
interfaces
prompting
internal
maxidmmap
package
Version:
v0.0.0-...-ab92e14
Opens a new window with list of versions in this module.
Published: Dec 18, 2024
License: GPL-3.0
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package maxidmmap provides a type for working with atomically unique
prompting-related IDs, backed by a memory mapped file.
View Source
var (
ErrMaxIDMmapClosed = fmt .Errorf ("cannot compute next ID on max ID mmap which has already been closed")
)
MaxIDMmap is a wrapper for ID tracked backed by a mmap'ed file.
OpenMaxIDMmap opens and mmaps the given maxIDFilepath, returning the
corresponding MaxIDMmap.
If the maxIDFilepath does not exist, or if the file is malformed, it is
reset to an 8-byte file with a max ID of 0. If the file cannot be created,
opened, or mmaped, returns an error and a nil MaxIDMmap.
Close unmaps the underlying byte slice corresponding to the receiving
max ID mmap, if it has not already been unmapped.
The caller must ensure that any relevant lock is held.
IsClosed returns whether the receiving max ID mmap has been unmapped and
closed, which is indicated by the underlying byte slice being nil.
The caller must ensure that any relevant lock is held.
NextID increments the monotonic max ID integer and returns the corresponding
ID.
The caller must ensure that any relevant lock is held.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.