aboutsummaryrefslogtreecommitdiffstats
path: root/fix_pamd
blob: d8d3d5fa7f0b4cb5c42734e768e5ea89a74ff604 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

if [ -z "$RPM_BUILD_ROOT" ]; then
    echo "No build root defined" >&2
    exit 1
fi

if [ ! -d "$RPM_BUILD_ROOT" ]; then
    echo "Invalid build root" >&2
    exit 1
fi

configs=`find $RPM_BUILD_ROOT/etc/pam.d/ -type f ! -type l 2> /dev/null`
if [ -n "$configs" ]; then
    echo -n "Fixing pam.d config files..."
    perl -pi -e "s,/(usr/)?(lib|lib64)/security/,," $configs
    echo "done"
fi