File: test_magic_differs.sh

package info (click to toggle)
samba 2%3A4.23.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 188,088 kB
  • sloc: ansic: 2,007,520; python: 272,673; sh: 72,258; xml: 51,653; perl: 36,094; makefile: 6,353; yacc: 5,323; exp: 1,582; lex: 1,504; cpp: 1,224; awk: 589; java: 119; csh: 58; pascal: 54; sed: 45; asm: 30
file content (16 lines) | stat: -rwxr-xr-x 361 bytes parent folder | download | duplicates (20)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
# This test ensures that two different talloc processes do not use the same
# magic value to lessen the opportunity for transferrable attacks.

echo "test: magic differs"

helper=$1
m1=$($helper)
m2=$($helper)

if [ $m1 -eq $m2 ]; then
	echo "failure: magic remained the same between executions ($m1 vs $m2)"
	exit 1
fi

echo "success: magic differs"