/
snap
/
core22
/
2411
/
usr
/
sbin
/
/snap/core22/2411/usr/sbin
mkdir
upload
Name
Size
Mode
Actions
aa-remove-unknown
3068
0755
edit
dl
rm
aa-status
64120
0755
edit
dl
rm
aa-teardown
137
0755
edit
dl
rm
add-shell
1051
0755
edit
dl
rm
addgroup
38247
0755
edit
dl
rm
adduser
38247
0755
edit
dl
rm
agetty
56896
0755
edit
dl
rm
apparmor_parser
1548064
0755
edit
dl
rm
apparmor_status
64120
0755
edit
dl
rm
arpd
26960
0755
edit
dl
rm
arptables
224296
0755
edit
dl
rm
arptables-nft
224296
0755
edit
dl
rm
arptables-nft-restore
224296
0755
edit
dl
rm
arptables-nft-save
224296
0755
edit
dl
rm
arptables-restore
224296
0755
edit
dl
rm
arptables-save
224296
0755
edit
dl
rm
badblocks
35144
0755
edit
dl
rm
blkdeactivate
16351
0755
edit
dl
rm
blkdiscard
22912
0755
edit
dl
rm
blkid
51624
0755
edit
dl
rm
blkzone
35200
0755
edit
dl
rm
blockdev
31104
0755
edit
dl
rm
bridge
94712
0755
edit
dl
rm
capsh
31032
0755
edit
dl
rm
cfdisk
97008
0755
edit
dl
rm
chcpu
31104
0755
edit
dl
rm
chgpasswd
59528
0755
edit
dl
rm
chmem
35200
0755
edit
dl
rm
chpasswd
55464
0755
edit
dl
rm
chroot
39432
0755
edit
dl
rm
cpgr
49448
0755
edit
dl
rm
cppw
49448
0755
edit
dl
rm
cryptdisks_start
1544
0755
edit
dl
rm
cryptdisks_stop
844
0755
edit
dl
rm
cryptsetup
174000
0755
edit
dl
rm
cryptsetup-reencrypt
92544
0755
edit
dl
rm
cryptsetup-ssh
24096
0755
edit
dl
rm
ctrlaltdel
14720
0755
edit
dl
rm
dcb
82448
0755
edit
dl
rm
debugfs
235320
0755
edit
dl
rm
delgroup
16495
0755
edit
dl
rm
deluser
16495
0755
edit
dl
rm
depmod
170352
0755
edit
dl
rm
devlink
146288
0755
edit
dl
rm
dhclient
453280
0755
edit
dl
rm
dhclient-script
16304
0755
edit
dl
rm
dmsetup
175128
0755
edit
dl
rm
dmstats
175128
0755
edit
dl
rm
dosfsck
84360
0755
edit
dl
rm
dosfslabel
39304
0755
edit
dl
rm
dumpe2fs
31040
0755
edit
dl
rm
e2freefrag
14648
0755
edit
dl
rm
e2fsck
360280
0755
edit
dl
rm
e2image
43328
0755
edit
dl
rm
e2label
105016
0755
edit
dl
rm
e2mmpstatus
31040
0755
edit
dl
rm
e2scrub
7296
0755
edit
dl
rm
e2scrub_all
5395
0755
edit
dl
rm
e2undo
22840
0755
edit
dl
rm
e4crypt
31104
0755
edit
dl
rm
e4defrag
31032
0755
edit
dl
rm
ebtables
224296
0755
edit
dl
rm
ebtables-nft
224296
0755
edit
dl
rm
ebtables-nft-restore
224296
0755
edit
dl
rm
ebtables-nft-save
224296
0755
edit
dl
rm
ebtables-restore
224296
0755
edit
dl
rm
ebtables-save
224296
0755
edit
dl
rm
faillock
14488
0755
edit
dl
rm
fatlabel
39304
0755
edit
dl
rm
fdisk
113072
0755
edit
dl
rm
filefrag
18760
0755
edit
dl
rm
findfs
14720
0755
edit
dl
rm
fsck
43440
0755
edit
dl
rm
fsck.cramfs
31168
0755
edit
dl
rm
fsck.ext2
360280
0755
edit
dl
rm
fsck.ext3
360280
0755
edit
dl
rm
fsck.ext4
360280
0755
edit
dl
rm
fsck.fat
84360
0755
edit
dl
rm
fsck.minix
55712
0755
edit
dl
rm
fsck.msdos
84360
0755
edit
dl
rm
fsck.vfat
84360
0755
edit
dl
rm
fsfreeze
14720
0755
edit
dl
rm
fstab-decode
18744
0755
edit
dl
rm
fstrim
43392
0755
edit
dl
rm
genl
92608
0755
edit
dl
rm
getcap
14648
0755
edit
dl
rm
getpcaps
14648
0755
edit
dl
rm
getty
56896
0755
edit
dl
rm
groupadd
68520
0755
edit
dl
rm
groupdel
64232
0755
edit
dl
rm
groupmems
55488
0755
edit
dl
rm
groupmod
68424
0755
edit
dl
rm
grpck
59528
0755
edit
dl
rm
grpconv
51208
0755
edit
dl
rm
grpunconv
51208
0755
edit
dl
rm
halt
1119856
0755
edit
dl
rm
hwclock
51712
0755
edit
dl
rm
iconvconfig
31128
0755
edit
dl
rm
init
1849992
0755
edit
dl
rm
insmod
170352
0755
edit
dl
rm
installkernel
2659
0755
edit
dl
rm
integritysetup
55368
0755
edit
dl
rm
invoke-rc.d
16507
0755
edit
dl
rm
ip
718896
0755
edit
dl
rm
ip6tables
224296
0755
edit
dl
rm
ip6tables-apply
7057
0755
edit
dl
rm
ip6tables-legacy
99272
0755
edit
dl
rm
ip6tables-legacy-restore
99272
0755
edit
dl
rm
ip6tables-legacy-save
99272
0755
edit
dl
rm
ip6tables-nft
224296
0755
edit
dl
rm
ip6tables-nft-restore
224296
0755
edit
dl
rm
ip6tables-nft-save
224296
0755
edit
dl
rm
ip6tables-restore
224296
0755
edit
dl
rm
ip6tables-restore-translate
224296
0755
edit
dl
rm
ip6tables-save
224296
0755
edit
dl
rm
ip6tables-translate
224296
0755
edit
dl
rm
iptables
224296
0755
edit
dl
rm
iptables-apply
7057
0755
edit
dl
rm
iptables-legacy
99272
0755
edit
dl
rm
iptables-legacy-restore
99272
0755
edit
dl
rm
iptables-legacy-save
99272
0755
edit
dl
rm
iptables-nft
224296
0755
edit
dl
rm
iptables-nft-restore
224296
0755
edit
dl
rm
iptables-nft-save
224296
0755
edit
dl
rm
iptables-restore
224296
0755
edit
dl
rm
iptables-restore-translate
224296
0755
edit
dl
rm
iptables-save
224296
0755
edit
dl
rm
iptables-translate
224296
0755
edit
dl
rm
isosize
14720
0755
edit
dl
rm
killall5
31112
0755
edit
dl
rm
ldattach
27008
0755
edit
dl
rm
ldconfig
387
0755
edit
dl
rm
ldconfig.real
1213960
0755
edit
dl
rm
logsave
14496
0755
edit
dl
rm
losetup
72208
0755
edit
dl
rm
lsmod
170352
0755
edit
dl
rm
luksformat
3401
0755
edit
dl
rm
mkdosfs
52048
0755
edit
dl
rm
mke2fs
133752
0755
edit
dl
rm
mkfs
14720
0755
edit
dl
rm
mkfs.bfs
22912
0755
edit
dl
rm
mkfs.cramfs
35144
0755
edit
dl
rm
mkfs.ext2
133752
0755
edit
dl
rm
mkfs.ext3
133752
0755
edit
dl
rm
mkfs.ext4
133752
0755
edit
dl
rm
mkfs.fat
52048
0755
edit
dl
rm
mkfs.minix
43408
0755
edit
dl
rm
mkfs.msdos
52048
0755
edit
dl
rm
mkfs.vfat
52048
0755
edit
dl
rm
mkhomedir_helper
22704
0755
edit
dl
rm
mklost+found
14648
0755
edit
dl
rm
mkswap
47496
0755
edit
dl
rm
modinfo
170352
0755
edit
dl
rm
modprobe
170352
0755
edit
dl
rm
netplan
798
0755
edit
dl
rm
newusers
76520
0755
edit
dl
rm
nfnl_osf
18736
0755
edit
dl
rm
nologin
14640
0755
edit
dl
rm
pam-auth-update
20992
0755
edit
dl
rm
pam_extrausers_chkpwd
22680
2755
edit
dl
rm
pam_extrausers_update
30872
0755
edit
dl
rm
pam_getenv
2890
0755
edit
dl
rm
pam_timestamp_check
14488
0755
edit
dl
rm
pivot_root
14720
0755
edit
dl
rm
plymouthd
154168
0755
edit
dl
rm
poweroff
1119856
0755
edit
dl
rm
pwck
51336
0755
edit
dl
rm
pwconv
47112
0755
edit
dl
rm
pwunconv
43016
0755
edit
dl
rm
readprofile
22944
0755
edit
dl
rm
reboot
1119856
0755
edit
dl
rm
remove-shell
1099
0755
edit
dl
rm
resize2fs
67896
0755
edit
dl
rm
rfkill
30952
0755
edit
dl
rm
rmmod
170352
0755
edit
dl
rm
rmt
59976
0755
edit
dl
rm
rmt-tar
59976
0755
edit
dl
rm
rtacct
28992
0755
edit
dl
rm
rtcwake
35200
0755
edit
dl
rm
rtmon
92560
0755
edit
dl
rm
runlevel
1119856
0755
edit
dl
rm
runuser
55680
0755
edit
dl
rm
service
9097
0755
edit
dl
rm
setcap
14648
0755
edit
dl
rm
sfdisk
104832
0755
edit
dl
rm
shadowconfig
885
0755
edit
dl
rm
shutdown
1119856
0755
edit
dl
rm
sshd
921288
0755
edit
dl
rm
start-stop-daemon
48488
0755
edit
dl
rm
sudo_logsrvd
204904
0755
edit
dl
rm
sudo_sendlog
109912
0755
edit
dl
rm
sulogin
43392
0755
edit
dl
rm
swaplabel
18816
0755
edit
dl
rm
swapoff
22912
0755
edit
dl
rm
swapon
43392
0755
edit
dl
rm
switch_root
22912
0755
edit
dl
rm
sysctl
30960
0755
edit
dl
rm
tarcat
936
0755
edit
dl
rm
tc
628816
0755
edit
dl
rm
telinit
1119856
0755
edit
dl
rm
tipc
92608
0755
edit
dl
rm
tune2fs
105016
0755
edit
dl
rm
tzconfig
106
0755
edit
dl
rm
unix_chkpwd
26776
2755
edit
dl
rm
unix_update
30872
0755
edit
dl
rm
update-ca-certificates
5418
0755
edit
dl
rm
update-passwd
35392
0755
edit
dl
rm
update-rc.d
17324
0755
edit
dl
rm
update-shells
3806
0755
edit
dl
rm
useradd
130720
0755
edit
dl
rm
userdel
88936
0755
edit
dl
rm
usermod
126424
0755
edit
dl
rm
vdpa
31296
0755
edit
dl
rm
veritysetup
44808
0755
edit
dl
rm
vigr
57888
0755
edit
dl
rm
vipw
57888
0755
edit
dl
rm
visudo
225064
0755
edit
dl
rm
wipefs
39296
0755
edit
dl
rm
wpa_action
1735
0755
edit
dl
rm
wpa_cli
143680
0755
edit
dl
rm
wpa_supplicant
3397048
0755
edit
dl
rm
xtables-legacy-multi
99272
0755
edit
dl
rm
xtables-monitor
224296
0755
edit
dl
rm
xtables-nft-multi
224296
0755
edit
dl
rm
zic
63816
0755
edit
dl
rm
zramctl
55824
0755
edit
dl
rm
Edit:
/snap/core22/2411/usr/sbin/update-shells
(3806B)
#!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later # Copyright 2021 Helmut Grohne <helmut@subdivi.de> # A "hashset" is a shell variable containing a sequence of elements separated # and surrounded by hash (#) characters. None of the elements may contain a # hash character. The character is thus chosen, because it initiates a comment # in /etc/shells. All variables ending in _SHELLS in this file are hashsets. set -e # Check whether hashset $1 contains element $2. hashset_contains() { case "$1" in *"#$2#"*) return 0 ;; *) return 1 ;; esac } log() { if [ "$VERBOSE" = 1 ]; then echo "$*" fi } ROOT= VERBOSE=0 NOACT=0 while [ $# -gt 0 ]; do case "$1" in --help) cat <<EOF usage: $0 [options] --no-act Do not move the actual update into place --verbose Be more verbose --root DIR Operate on the given chroot, defaults to / EOF exit 0 ;; --no-act) NOACT=1 ;; --root) shift if [ "$#" -lt 1 ]; then echo "missing argument to --root" 1>&2 exit 1 fi ROOT=$1 ;; --verbose) VERBOSE=1 ;; *) echo "unrecognized option $1" 1>&2 exit 1 ;; esac shift done PKG_DIR="$ROOT/usr/share/debianutils/shells.d" STATE_FILE="$ROOT/var/lib/shells.state" TARGET_ETC_FILE="$ROOT/etc/shells" SOURCE_ETC_FILE="$TARGET_ETC_FILE" NEW_ETC_FILE="$TARGET_ETC_FILE.tmp" NEW_STATE_FILE="$STATE_FILE.tmp" if ! test -e "$SOURCE_ETC_FILE"; then SOURCE_ETC_FILE="$ROOT/usr/share/debianutils/shells" fi PKG_SHELLS='#' LC_COLLATE=C.UTF-8 # glob in reproducible order for f in "$PKG_DIR/"*; do [ "$f" = "$PKG_DIR/*" ] && break while IFS='#' read -r line _; do [ -n "$line" ] || continue PKG_SHELLS="$PKG_SHELLS$line#" realshell=$(dpkg-realpath --root "$ROOT" "$line") if [ "$line" != "$realshell" ]; then PKG_SHELLS="$PKG_SHELLS$realshell#" fi done < "$f" done STATE_SHELLS='#' if [ -e "$STATE_FILE" ] ; then while IFS='#' read -r line _; do [ -n "$line" ] && STATE_SHELLS="$STATE_SHELLS$line#" done < "$STATE_FILE" fi cleanup() { rm -f "$NEW_ETC_FILE" "$NEW_STATE_FILE" } trap cleanup EXIT : > "$NEW_ETC_FILE" ETC_SHELLS='#' while IFS= read -r line; do shell=${line%%#*} # copy all comment lines, packaged shells and local additions if [ -z "$shell" ] || hashset_contains "$PKG_SHELLS" "$shell" || ! hashset_contains "$STATE_SHELLS" "$shell"; then echo "$line" >> "$NEW_ETC_FILE" ETC_SHELLS="$ETC_SHELLS$shell#" else log "removing shell $shell" fi done < "$SOURCE_ETC_FILE" : > "$NEW_STATE_FILE" saved_IFS=$IFS IFS='#' set -f # shellcheck disable=SC2086 # word splitting intended, globbing disabled set -- ${PKG_SHELLS###} set +f IFS=$saved_IFS for shell; do echo "$shell" >> "$NEW_STATE_FILE" # add shells that are neither already present nor locally removed if ! hashset_contains "$ETC_SHELLS" "$shell" && ! hashset_contains "$STATE_SHELLS" "$shell"; then echo "$shell" >> "$NEW_ETC_FILE" log "adding shell $shell" fi done if [ "$NOACT" = 0 ]; then if [ -e "$STATE_FILE" ]; then chmod --reference="${STATE_FILE}" "${NEW_STATE_FILE}" || chmod $(stat -c %a "${STATE_FILE}") "${NEW_STATE_FILE}" chown --reference="${STATE_FILE}" "${NEW_STATE_FILE}" || chown $(stat -c %U "${STATE_FILE}") "${NEW_STATE_FILE}" else chmod 0644 "$NEW_STATE_FILE" fi chmod --reference="${SOURCE_ETC_FILE}" "${NEW_ETC_FILE}" || chmod $(stat -c %a "${SOURCE_ETC_FILE}") "${NEW_ETC_FILE}" chown --reference="${SOURCE_ETC_FILE}" "${NEW_ETC_FILE}" || chown $(stat -c %U "${SOURCE_ETC_FILE}") "${NEW_ETC_FILE}" sync -d "$NEW_ETC_FILE" "$NEW_STATE_FILE" mv -Z "${NEW_ETC_FILE}" "${TARGET_ETC_FILE}" || mv "${NEW_ETC_FILE}" "${TARGET_ETC_FILE}" sync "$TARGET_ETC_FILE" sync "$(dirname "$TARGET_ETC_FILE")" mv "$NEW_STATE_FILE" "$STATE_FILE" sync "$STATE_FILE" sync "$(dirname "$STATE_FILE")" trap "" EXIT fi
Save
cmd:
run