Debian Codegraph @

debian/tests/usermod

raw
1 #!/bin/sh
2 # usermod(8) wrapper for use by debian/tests/integration.py
3 #
4 # Copyright 2023 Simon McVittie
5 # SPDX-License-Identifier: GPL-3.0-or-later
6
7 LOG='/run/accountsservice-integration-test.log'
8
9 echo "invoked usermod: $0 $*" >> "$LOG"
10 echo "loginuid is $(cat /proc/self/loginuid)" >> "$LOG"
11
12 next_is_password=
13
14 for arg in "$@"; do
15 if [ -n "$next_is_password" ]; then
16 case "$arg" in
17 (*'$'*)
18 echo "Looks like CVE-2012-6655!" >> "$LOG"
19 ;;
20 esac
21
22 next_is_password=
23 else
24 case "$arg" in
25 (-p)
26 next_is_password=yes
27 ;;
28 esac
29 fi
30 done
31
32 exec /usr/sbin/usermod.distrib "$@"