aboutsummaryrefslogtreecommitdiffstats
path: root/fix_pamd
blob: cacd76c520fcd1e1d5b28c19ecae199a211d30fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
# $Id: fix_pamd 257534 2009-05-23 12:45:44Z guillomovitch $

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