Use easy to understand names for config files (debian, redhat, suse, unix). Move all autodetection to a separate script.master
parent
63472bb181
commit
8799bbac42
@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Find suitable PAM config file
|
||||
|
||||
rules="$1"
|
||||
srcdir="$2"
|
||||
outfile="$3"
|
||||
|
||||
service="xrdp-sesman"
|
||||
pamdir="/etc/pam.d"
|
||||
|
||||
guess_rules ()
|
||||
{
|
||||
if test -s "$pamdir/password-auth"; then
|
||||
rules="redhat"
|
||||
return
|
||||
fi
|
||||
|
||||
if test -s "$pamdir/common-account"; then
|
||||
if grep "^@include" "$pamdir/passwd" >/dev/null 2>&1; then
|
||||
rules="debian"
|
||||
else
|
||||
rules="suse"
|
||||
fi
|
||||
return
|
||||
fi
|
||||
|
||||
rules="unix"
|
||||
return
|
||||
}
|
||||
|
||||
if test "$rules" = "auto"; then
|
||||
guess_rules
|
||||
fi
|
||||
|
||||
if test -s "$srcdir/$service.$rules"; then
|
||||
ln -nsf "$srcdir/$service.$rules" "$outfile"
|
||||
else
|
||||
echo "Cannot find $srcdir/$service.$rules"
|
||||
exit 1
|
||||
fi
|
@ -1,5 +0,0 @@
|
||||
#%PAM-1.0
|
||||
auth include system-auth
|
||||
account include system-auth
|
||||
password include system-auth
|
||||
session include system-auth
|
@ -1,4 +0,0 @@
|
||||
#%PAM-1.0
|
||||
auth include password-auth
|
||||
account include password-auth
|
||||
session include password-auth
|
@ -0,0 +1,5 @@
|
||||
#%PAM-1.0
|
||||
auth include password-auth
|
||||
account include password-auth
|
||||
session include password-auth
|
||||
password include password-auth
|
@ -0,0 +1,5 @@
|
||||
#%PAM-1.0
|
||||
auth include common-auth
|
||||
account include common-account
|
||||
session include common-session
|
||||
password include common-password
|
@ -0,0 +1,5 @@
|
||||
#%PAM-1.0
|
||||
auth include system-auth
|
||||
account include system-auth
|
||||
password include system-auth
|
||||
session include system-auth
|
Loading…
Reference in new issue