PATH:
snap
/
core26
/
409
/
usr
/
bin
#!/bin/sh # Copyright (c) 2018 - 2022 Chris Cromer # Released under the 2-clause BSD license. # # This is an implementation of the systemd-sysusers command sysusersver=0.7.3 warninvalid() { printf "sysusers: %s on line %d of '%s'\n" "${1:-ignoring invalid entry}" \ "${lineno}" "${file}" : "$((error += 1))" } >&2 add_group() { # add_group <name> <id> if [ "$2" = '-' ]; then grep -q "^$1:" "$root/etc/group" || groupadd --prefix "$root" -r "$1" elif ! grep -q "^$1:\|^[^:]*:[^:]*:$2:[^:]*$" "$root/etc/group"; then groupadd --prefix "$root" -g "$2" "$1" fi } add_user() { # add_user <name> <uid> <gid> <gecos> <home> [locked]* if ! id "$1" >/dev/null 2>&1; then if [ "$2" = '-' ]; then if [ "$3" = '-' ]; then useradd --prefix "$root" -rc "$4" -g "$1" -d "$5" -s '/sbin/nologin' "$1" else useradd --prefix "$root" -rc "$4" -g "$3" -d "$5" -s '/sbin/nologin' "$1" fi else useradd --prefix "$root" -rc "$4" -u "$2" -g "$3" -d "$5" -s '/sbin/nologin' "$1" fi passwd --prefix "$root" -l "$1" >/dev/null 2>&1 while [ $# -gt 5 ]; do case "$6" in locked) usermod --prefix "$root" -e 1 "$1" ;; esac shift done fi } update_login_defs() { # update_login_defs <name> <id> [ "$1" != '-' ] && warninvalid && return min="${2%%-*}" max="${2#*-}" [ "${max}" != "${max#*-}" ] && warninvalid && return [ "${min}" -ge "${max}" ] && warninvalid "invalid range" && return while read -r key val; do case "${key}" in SYS_UID_MAX) suid_max="${val}" ;; SYS_GID_MAX) sgid_max="${val}" ;; esac done < "${root}/etc/login.defs" [ "${min}" -lt "${suid_max}" ] && warninvalid "invalid range" && return [ "${min}" -lt "${sgid_max}" ] && warninvalid "invalid range" && return sed -e "/[GU]ID_MIN[[:space:]]\+/s/[^[:space:]]*$/${min}/" \ -e "/[GU]ID_MAX[[:space:]]\+/s/[^[:space:]]*$/${max}/" \ -i "${root}/etc/login.defs" } parse_file() { while read -r conf; do lineno=0 while read -r line; do parse_string "${line}" "$((lineno += 1))" done < "${conf}" [ -n "${line}" ] && parse_string "${line}" done } parse_string() { [ -n "${1%%#*}" ] || return full_line=$1 #eval "set -- $1" # do not use eval, see CVE-2021-40084 set -- $1 suffix="${1#?}" type="${1%%${suffix}}" name="$2" id="$3" gecos="$4" home="$5" # and now set the GECOS field without eval if [ "${type}" = u ]; then if [ ! -z "$4" ] && [ "$4" != '-' ]; then # strip everything before the first " gecosplus=${full_line#*\"} # now strip everything after the last " gecos=${gecosplus%\"*} # check if there are other valid fields after GECOS gecostest=$(echo $gecosplus | grep -o '".*' -) if [ "$gecostest" = '"' ]; then home= else set -- $gecostest home=$2 fi fi fi case "${type}" in u) uid=${id%%:*} gid=${id##*:} case "${uid}" in 65535|4294967295) warninvalid; return; esac case "${gid}" in 65535|4294967295) warninvalid; return; esac if [ "${uid}" != '-' ] && [ "${gid}" = '-' ]; then warninvalid; return; fi [ "${home:--}" = '-' ] && home='/' if [ "${uid}" = "${id}" ]; then # No specific gid, create group for this user add_group "${name}" "${id}" fi case "${suffix}" in '!') locked=1;; '') ;; *) warninvalid; return;; esac add_user "${name}" "${uid}" "${gid}" "${gecos}" "${home}" ${locked:+locked} ;; g) case "${id}" in 65535|4294967295) warninvalid; return; esac add_group "${name}" "${id}" ;; m) add_group "${id}" '-' if id "${name}" >/dev/null 2>&1; then usermod --prefix "$root" -a -G "${id}" "${name}" else useradd --prefix "$root" -r -g "${id}" -s '/sbin/nologin' "${name}" passwd --prefix "$root" -l "${name}" >/dev/null 2>&1 fi ;; r) update_login_defs "${name}" "${id}" ;; *) warninvalid; return ;; esac } usage() { printf '%s\n' \ "${0##*/}" '' \ "${0##*/} creates system users and groups, based on the file" \ 'format and location specified in sysusers.d(5).' '' \ "Usage: ${0##*/} [OPTIONS...] [CONFIGFILE...]" '' \ 'Options:' \ ' --root=root All paths will be prefixed with the' \ ' given alternate root path, including' \ ' config search paths.' \ " --replace=PATH Don't run check in the package" \ ' --inline Treat each positional argument as a' \ ' separate configuration line instead of a' \ ' file name.' \ ' -h, --help Print a short help text and exit.' \ ' --version Print a short version string and exit.' exit "$1" } error=0 inline=0 replace='' root='' seen='' # opensysusers is an implementation of sysusers.d spec without # systemd command, it doesn't accept options or arguments [ "${0##*/}" = opensysusers ] && set -- while [ "$#" -ne 0 ]; do case "$1" in --root=*) root="${1#--root=}" ;; --root) root="$2"; shift ;; --replace=*) replace="${1#--replace=}" ;; --replace) replace="$2"; shift ;; --inline) inline=1 ;; --version) printf '%s\n' "${sysusersver}"; exit 0 ;; -h|--help) usage 0 ;; -[!-]|--?*) usage 1 ;; --) shift; break ;; *) break ;; esac shift done if [ "${inline}" -eq 0 ]; then for file do [ "${file}" = '--' ] && continue for dir in etc run usr/lib; do if [ -f "${root}/${dir}/sysusers.d/${file}" ]; then sed -i -e '$a\' "${root}/${dir}/sysusers.d/${file}" printf '%s/%s/sysusers.d/%s\n' "${root}" "${dir}" "${file}" | parse_file break fi done done else for string in "$@"; do parse_string "${string}" done fi if [ "$#" -eq 0 ] || [ -n "${replace}" ]; then set -- "${root}/etc/sysusers.d/"*.conf "${root}/run/sysusers.d/"*.conf \ "${root}/usr/lib/sysusers.d/"*.conf for f do printf '%s %s\n' "${f##*/}" "${f%/*}"; done | sort -k1,1 | while read -r b d; do [ "${seen}" = "${seen#* ${b} }" ] && [ -f "${d}/${b}" ] && { seen="${seen:- }${b} "; printf '%s/%s\n' "${d}" "${b}"; } done | parse_file fi exit "${error}"
[+]
..
[-] [
[edit]
[-] aa-enabled
[edit]
[-] aa-exec
[edit]
[-] aa-features-abi
[edit]
[-] arch
[edit]
[-] awk
[edit]
[-] b2sum
[edit]
[-] b3sum
[edit]
[-] base32
[edit]
[-] base64
[edit]
[-] basename
[edit]
[-] basenc
[edit]
[-] bash
[edit]
[-] bunzip2
[edit]
[-] busctl
[edit]
[-] bzcat
[edit]
[-] bzcmp
[edit]
[-] bzdiff
[edit]
[-] bzegrep
[edit]
[-] bzexe
[edit]
[-] bzfgrep
[edit]
[-] bzgrep
[edit]
[-] bzip2
[edit]
[-] bzip2recover
[edit]
[-] bzless
[edit]
[-] bzmore
[edit]
[-] cat
[edit]
[-] chage
[edit]
[-] chattr
[edit]
[-] chcon
[edit]
[-] chfn
[edit]
[-] chgrp
[edit]
[-] chmod
[edit]
[-] choom
[edit]
[-] chown
[edit]
[-] chrt
[edit]
[-] chsh
[edit]
[-] cksum
[edit]
[-] clear
[edit]
[-] clear_console
[edit]
[-] cmp
[edit]
[-] comm
[edit]
[-] core-sshd-host-keygen
[edit]
[-] coredumpctl
[edit]
[-] coreutils
[edit]
[-] cp
[edit]
[-] csplit
[edit]
[-] ctstat
[edit]
[-] cut
[edit]
[-] dash
[edit]
[-] date
[edit]
[-] dbus-cleanup-sockets
[edit]
[-] dbus-daemon
[edit]
[-] dbus-monitor
[edit]
[-] dbus-run-session
[edit]
[-] dbus-send
[edit]
[-] dbus-update-activation-environment
[edit]
[-] dbus-uuidgen
[edit]
[-] dd
[edit]
[-] df
[edit]
[-] diff
[edit]
[-] diff3
[edit]
[-] dir
[edit]
[-] dircolors
[edit]
[-] dirname
[edit]
[-] dmesg
[edit]
[-] dnsdomainname
[edit]
[-] domainname
[edit]
[-] du
[edit]
[-] echo
[edit]
[-] editor
[edit]
[-] egrep
[edit]
[-] env
[edit]
[-] ex
[edit]
[-] expand
[edit]
[-] expiry
[edit]
[-] expr
[edit]
[-] factor
[edit]
[-] fallocate
[edit]
[-] false
[edit]
[-] fgrep
[edit]
[-] finalrd
[edit]
[-] find
[edit]
[-] findmnt
[edit]
[-] flock
[edit]
[-] fmt
[edit]
[-] fold
[edit]
[-] free
[edit]
[-] gdbserver
[edit]
[-] getconf
[edit]
[-] getent
[edit]
[-] getopt
[edit]
[-] gnu[
[edit]
[-] gnuarch
[edit]
[-] gnub2sum
[edit]
[-] gnubase32
[edit]
[-] gnubase64
[edit]
[-] gnubasename
[edit]
[-] gnubasenc
[edit]
[-] gnucat
[edit]
[-] gnuchcon
[edit]
[-] gnuchgrp
[edit]
[-] gnuchmod
[edit]
[-] gnuchown
[edit]
[-] gnucksum
[edit]
[-] gnucomm
[edit]
[-] gnucp
[edit]
[-] gnucsplit
[edit]
[-] gnucut
[edit]
[-] gnudate
[edit]
[-] gnudd
[edit]
[-] gnudf
[edit]
[-] gnudir
[edit]
[-] gnudircolors
[edit]
[-] gnudirname
[edit]
[-] gnudu
[edit]
[-] gnuecho
[edit]
[-] gnuenv
[edit]
[-] gnuexpand
[edit]
[-] gnuexpr
[edit]
[-] gnufactor
[edit]
[-] gnufalse
[edit]
[-] gnufmt
[edit]
[-] gnufold
[edit]
[-] gnugroups
[edit]
[-] gnuhead
[edit]
[-] gnuhostid
[edit]
[-] gnuid
[edit]
[-] gnuinstall
[edit]
[-] gnujoin
[edit]
[-] gnulink
[edit]
[-] gnuln
[edit]
[-] gnulogname
[edit]
[-] gnuls
[edit]
[-] gnumd5sum
[edit]
[-] gnumkdir
[edit]
[-] gnumkfifo
[edit]
[-] gnumknod
[edit]
[-] gnumktemp
[edit]
[-] gnumv
[edit]
[-] gnunice
[edit]
[-] gnunl
[edit]
[-] gnunohup
[edit]
[-] gnunproc
[edit]
[-] gnunumfmt
[edit]
[-] gnuod
[edit]
[-] gnupaste
[edit]
[-] gnupathchk
[edit]
[-] gnupinky
[edit]
[-] gnupr
[edit]
[-] gnuprintenv
[edit]
[-] gnuprintf
[edit]
[-] gnuptx
[edit]
[-] gnupwd
[edit]
[-] gnureadlink
[edit]
[-] gnurealpath
[edit]
[-] gnurm
[edit]
[-] gnurmdir
[edit]
[-] gnuruncon
[edit]
[-] gnuseq
[edit]
[-] gnusha1sum
[edit]
[-] gnusha224sum
[edit]
[-] gnusha256sum
[edit]
[-] gnusha384sum
[edit]
[-] gnusha512sum
[edit]
[-] gnushred
[edit]
[-] gnushuf
[edit]
[-] gnusleep
[edit]
[-] gnusort
[edit]
[-] gnusplit
[edit]
[-] gnustat
[edit]
[-] gnustdbuf
[edit]
[-] gnustty
[edit]
[-] gnusum
[edit]
[-] gnusync
[edit]
[-] gnutac
[edit]
[-] gnutail
[edit]
[-] gnutee
[edit]
[-] gnutest
[edit]
[-] gnutimeout
[edit]
[-] gnutouch
[edit]
[-] gnutr
[edit]
[-] gnutrue
[edit]
[-] gnutruncate
[edit]
[-] gnutsort
[edit]
[-] gnutty
[edit]
[-] gnuuname
[edit]
[-] gnuunexpand
[edit]
[-] gnuuniq
[edit]
[-] gnuunlink
[edit]
[-] gnuusers
[edit]
[-] gnuvdir
[edit]
[-] gnuwc
[edit]
[-] gnuwho
[edit]
[-] gnuwhoami
[edit]
[-] gnuyes
[edit]
[-] gpasswd
[edit]
[-] gpgv
[edit]
[-] grep
[edit]
[-] groups
[edit]
[-] gunzip
[edit]
[-] gzip
[edit]
[-] hashsum
[edit]
[-] head
[edit]
[-] hostid
[edit]
[-] hostname
[edit]
[-] hostnamectl
[edit]
[-] i386
[edit]
[-] iconv
[edit]
[-] id
[edit]
[-] install
[edit]
[-] ionice
[edit]
[-] ip
[edit]
[-] ipcmk
[edit]
[-] ipcrm
[edit]
[-] ipcs
[edit]
[-] ischroot
[edit]
[-] join
[edit]
[-] journalctl
[edit]
[-] kill
[edit]
[-] kmod
[edit]
[-] ld.so
[edit]
[-] ldd
[edit]
[-] less
[edit]
[-] lessecho
[edit]
[-] link
[edit]
[-] linux32
[edit]
[-] linux64
[edit]
[-] ln
[edit]
[-] locale
[edit]
[-] localectl
[edit]
[-] localedef
[edit]
[-] logger
[edit]
[-] login
[edit]
[-] loginctl
[edit]
[-] logname
[edit]
[-] ls
[edit]
[-] lsattr
[edit]
[-] lsblk
[edit]
[-] lscpu
[edit]
[-] lsipc
[edit]
[-] lslocks
[edit]
[-] lsmod
[edit]
[-] lsns
[edit]
[-] man
[edit]
[-] mawk
[edit]
[-] md5sum
[edit]
[-] mkdir
[edit]
[-] mkfifo
[edit]
[-] mknod
[edit]
[-] mksquashfs
[edit]
[-] mkswapfile
[edit]
[-] mktemp
[edit]
[-] more
[edit]
[-] mount
[edit]
[-] mountpoint
[edit]
[-] mv
[edit]
[-] nc
[edit]
[-] nc.openbsd
[edit]
[-] netcat
[edit]
[-] networkctl
[edit]
[-] nice
[edit]
[-] nisdomainname
[edit]
[-] nl
[edit]
[-] nohup
[edit]
[-] nproc
[edit]
[-] nsenter
[edit]
[-] numfmt
[edit]
[-] od
[edit]
[-] openssl
[edit]
[-] opensysusers-sysusers
[edit]
[-] p11-kit
[edit]
[-] p11tool
[edit]
[-] pager
[edit]
[-] partx
[edit]
[-] passwd
[edit]
[-] paste
[edit]
[-] pathchk
[edit]
[-] pgrep
[edit]
[-] pidof
[edit]
[-] pidwait
[edit]
[-] ping
[edit]
[-] ping4
[edit]
[-] ping6
[edit]
[-] pinky
[edit]
[-] pkaction
[edit]
[-] pkcheck
[edit]
[-] pkcs11-tool
[edit]
[-] pkill
[edit]
[-] pkttyagent
[edit]
[-] pldd
[edit]
[-] plymouth
[edit]
[-] pr
[edit]
[-] printenv
[edit]
[-] printf
[edit]
[-] prlimit
[edit]
[-] ps
[edit]
[-] ptx
[edit]
[-] pwd
[edit]
[-] pwdx
[edit]
[-] rbash
[edit]
[-] readlink
[edit]
[-] realpath
[edit]
[-] reset
[edit]
[-] resolvectl
[edit]
[-] rgrep
[edit]
[-] rm
[edit]
[-] rmdir
[edit]
[-] routel
[edit]
[-] run-parts
[edit]
[-] run0
[edit]
[-] runcon
[edit]
[-] rview
[edit]
[-] sbattach
[edit]
[-] sbkeysync
[edit]
[-] sbsiglist
[edit]
[-] sbsign
[edit]
[-] sbvarsign
[edit]
[-] sbverify
[edit]
[-] scp
[edit]
[-] sdiff
[edit]
[-] sed
[edit]
[-] seq
[edit]
[-] setarch
[edit]
[-] setpriv
[edit]
[-] setsid
[edit]
[-] setterm
[edit]
[-] sftp
[edit]
[-] sg
[edit]
[-] sh
[edit]
[-] sha1sum
[edit]
[-] sha224sum
[edit]
[-] sha256sum
[edit]
[-] sha3-224sum
[edit]
[-] sha3-256sum
[edit]
[-] sha3-384sum
[edit]
[-] sha3-512sum
[edit]
[-] sha384sum
[edit]
[-] sha3sum
[edit]
[-] sha512sum
[edit]
[-] shake128sum
[edit]
[-] shake256sum
[edit]
[-] shred
[edit]
[-] shuf
[edit]
[-] skill
[edit]
[-] sleep
[edit]
[-] snap
[edit]
[-] snapctl
[edit]
[-] snice
[edit]
[-] sort
[edit]
[-] splash-client
[edit]
[-] split
[edit]
[-] sqfscat
[edit]
[-] sqfstar
[edit]
[-] ss
[edit]
[-] ssh
[edit]
[-] ssh-add
[edit]
[-] ssh-agent
[edit]
[-] ssh-keygen
[edit]
[-] ssh-keyscan
[edit]
[-] stat
[edit]
[-] stdbuf
[edit]
[-] stty
[edit]
[-] su
[edit]
[-] su-rs
[edit]
[-] sudo
[edit]
[-] sudo-rs
[edit]
[-] sudoedit
[edit]
[-] sudoedit-rs
[edit]
[-] sum
[edit]
[-] sync
[edit]
[-] systemctl
[edit]
[-] systemd-ac-power
[edit]
[-] systemd-analyze
[edit]
[-] systemd-ask-password
[edit]
[-] systemd-cat
[edit]
[-] systemd-cgls
[edit]
[-] systemd-cgtop
[edit]
[-] systemd-confext
[edit]
[-] systemd-creds
[edit]
[-] systemd-cryptenroll
[edit]
[-] systemd-cryptsetup
[edit]
[-] systemd-delta
[edit]
[-] systemd-detect-virt
[edit]
[-] systemd-escape
[edit]
[-] systemd-firstboot
[edit]
[-] systemd-hwdb
[edit]
[-] systemd-id128
[edit]
[-] systemd-inhibit
[edit]
[-] systemd-machine-id-setup
[edit]
[-] systemd-mount
[edit]
[-] systemd-notify
[edit]
[-] systemd-path
[edit]
[-] systemd-run
[edit]
[-] systemd-socket-activate
[edit]
[-] systemd-stdio-bridge
[edit]
[-] systemd-sysext
[edit]
[-] systemd-sysusers
[edit]
[-] systemd-tmpfiles
[edit]
[-] systemd-tty-ask-password-agent
[edit]
[-] systemd-umount
[edit]
[-] systemd-vpick
[edit]
[-] tabs
[edit]
[-] tac
[edit]
[-] tail
[edit]
[-] tar
[edit]
[-] taskset
[edit]
[-] tee
[edit]
[-] test
[edit]
[-] timedatectl
[edit]
[-] timeout
[edit]
[-] top
[edit]
[-] touch
[edit]
[-] tput
[edit]
[-] tr
[edit]
[-] true
[edit]
[-] truncate
[edit]
[-] tset
[edit]
[-] tsort
[edit]
[-] tty
[edit]
[-] uclampset
[edit]
[-] udevadm
[edit]
[-] umount
[edit]
[-] uname
[edit]
[-] uncompress
[edit]
[-] unexpand
[edit]
[-] uniq
[edit]
[-] unlink
[edit]
[-] unshare
[edit]
[-] unsquashfs
[edit]
[-] uptime
[edit]
[-] users
[edit]
[-] varlinkctl
[edit]
[-] vdir
[edit]
[-] vi
[edit]
[-] view
[edit]
[-] vim.tiny
[edit]
[-] visudo-rs
[edit]
[-] vmstat
[edit]
[-] w
[edit]
[-] waitpid
[edit]
[-] watch
[edit]
[-] wc
[edit]
[-] wdctl
[edit]
[-] whereis
[edit]
[-] which
[edit]
[-] which.debianutils
[edit]
[-] who
[edit]
[-] whoami
[edit]
[-] wpa_passphrase
[edit]
[-] x86_64
[edit]
[-] xargs
[edit]
[-] xdg-email
[edit]
[-] xdg-open
[edit]
[-] xdg-settings
[edit]
[-] yes
[edit]
[-] ypdomainname
[edit]
[-] zcat
[edit]
[-] zcmp
[edit]
[-] zdiff
[edit]
[-] zegrep
[edit]
[-] zfgrep
[edit]
[-] zforce
[edit]
[-] zgrep
[edit]
[-] zless
[edit]
[-] zmore
[edit]