File: shadmrg.sv

package info (click to toggle)
crack 5.0a-12
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 9,016 kB
  • sloc: ansic: 7,444; perl: 1,375; sh: 1,062; makefile: 218
file content (33 lines) | stat: -rwxr-xr-x 701 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
###
# This program was written by and is copyright Alec Muffett 1991,
# 1992, 1993, 1994, 1995, and 1996, and is provided as part of the
# Crack v5.0 Password Cracking package.
#
# The copyright holder disclaims all responsibility or liability with
# respect to its usage or its effect upon hardware or computer
# systems, and maintains copyright as set out in the "LICENCE"
# document which accompanies distributions of Crack v5.0 and upwards.
###

SHADOW=/etc/shadow
PASSWD=/etc/passwd

(
	sed -e 's/^/STAG:/' < $SHADOW
	sed -e 's/^/PTAG:/' < $PASSWD
) |
awk -F: '
BEGIN {
	OFS=":";
}
$1 == "STAG" {
	pw[$2] = $3;
	next;
}
$1 == "PTAG"{
	$3 = pw[$2];
	print $0;	

}' |
sed -e 's/^PTAG://'