greeterconfig

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package greeterconfig is what a user may change of the login screen the system shows: the login keys config.GreeterApplyKeys names and a background image, written to the runtime.yaml beside the greeter's system config, never to config.yaml itself.

A Change is staged by the user who makes it, with that user's rights: Stage and NewChange read the background image, so no privileged process ever opens a path a user names. Check, run by whoever may write the system config (root, or lys-login's display manager), trusts nothing in a Change but the allowlisted keys, and Write takes only what Check passed.

Index

Constants

View Source
const MaxImage = 32 << 20

MaxImage bounds the background image a Change carries.

View Source
const MaxStaged = 1 << 20

MaxStaged bounds a Change's staged config text.

Variables

View Source
var ErrInvalid = errors.New("invalid login screen change")

Functions

func Write

func Write(c Checked, configPath string) (string, error)

Types

type Change

type Change struct {
	// Staged is the staged config: a login table, or its keys at the top
	// level.
	Staged string `json:"staged"`
	// Image is the background an image-mode Staged names, read by the
	// user who staged it; nil for the other modes.
	Image *Image `json:"image,omitempty"`
}

Change is a staged change of the login screen.

func NewChange

func NewChange(staged string) (Change, error)

func Stage

func Stage(path string) (Change, error)

func (Change) Check

func (c Change) Check() (Checked, error)

type Checked

type Checked struct {
	// contains filtered or unexported fields
}

type Image

type Image struct {
	// Ext is the extension, with its dot ("" without one).
	Ext  string `json:"ext"`
	Data []byte `json:"data"`
}

Image is a background image's bytes and its file extension.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL