Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / afsinstall / lib / InstallGuides / sun4x_56 / login
CommitLineData
805e021f
CE
1# Copyright 2000, International Business Machines Corporation and others.
2# All Rights Reserved.
3#
4# This software has been released under the terms of the IBM Public
5# License. For details, see the LICENSE file in the top-level source
6# directory or online at http://www.openafs.org/dl/license10.html
7
8# An InstallGuide for installing the AFS integrated login
9#
10
11sub login {
12 &ErrorsAreFatal(1);
13 &Copy("lib/pam_afs.so.1", "/usr/lib/security");
14 &Chmod(0755, "/usr/lib/security/pam_afs.so.1");
15 &Chown(0,3, "/usr/lib/security/pam_afs.so.1");
16
17 $PamConf = "/etc/pam.conf";
18 &Patch::Verbose if ($InstallVerbose);
19 &Patch::FileOpen($PamConf);
20
21 $LoginSubSearch = "^(login.+)required(.+)";
22 $LoginSubReplace = '$1.optional.$2';
23
24 $LoginAuthSearch = "^login\\s+auth\\s+.*pam_unix.so.1";
25 $LoginAuthNew = <<"xxENDxx";
26login auth optional /usr/lib/security/pam_afs.so.1 try_first_pass ignore_root
27xxENDxx
28
29 $LoginAccountSearch = "^login\\s+account\\s+.*pam_unix.so.1";
30 $LoginAccountNew = <<"xxENDxx";
31login account optional /usr/lib/security/pam_afs.so.1 try_first_pass ignore_root
32xxENDxx
33
34 $OtherSubSearch = "^(other.+)required(.+)";
35 $OtherSubReplace = '$1.optional.$2';
36
37 $OtherAuthSearch = "^other\\s+auth\\s+.*pam_unix.so.1";
38 $OtherAuthNew = <<"xxENDxx";
39other auth optional /usr/lib/security/pam_afs.so.1 try_first_pass ignore_root
40xxENDxx
41
42 $OtherAccountSearch = "^other\\s+account\\s+.*pam_unix.so.1";
43 $OtherAccountNew = <<"xxENDxx";
44other account optional /usr/lib/security/pam_afs.so.1 try_first_pass ignore_root
45xxENDxx
46
47 $DtLoginSubSearch = "^(dtlogin.+)required(.+)";
48 $DtLoginSubReplace = '$1.optional.$2';
49
50 $DtLoginAccountSearch = "^dtlogin\\s+account\\s+.*pam_unix.so.1";
51 $DtLoginAccountNew = <<"xxENDxx";
52dtlogin account optional /usr/lib/security/pam_afs.so.1 try_first_pass ignore_root
53xxENDxx
54
55 &VPrint("Patching \"$PamConf\"");
56 if (!&Patch::Patch($PamConf, [[1, "Substitution", $LoginSubSearch, $LoginSubReplace],
57 [1, "Insert", $LoginAuthSearch, $LoginAuthNew],
58 [1, "Insert", $LoginAccountSearch, $LoginAccountNew],
59 [1, "Substitution", $OtherSubSearch, $OtherSubReplace],
60 [1, "Insert", $OtherAuthSearch, $OtherAuthNew],
61 [1, "Insert", $OtherAccountSearch, $OtherAccountNew],
62 [1, "Substitution", $DtLoginSubSearch, $DtLoginSubReplace],
63 [1, "Insert", $DtLoginAccountSearch, $DtLoginAccountNew]])) {
64 &ErrorMsg("Did not succeed with patch", $PamConf);
65 }
66 &Chmod(0644, $PamConf);
67 &Chown(0,0, "/usr/lib/security/pam_afs.so.1");
68
69}