Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / afsinstall / lib / InstallGuides / sun4x_56 / unix
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 the AFS modified Unix commands
9 # For Sun systems running Solaris 5.6
10 #
11
12 sub unix {
13 &Copy("etc/inetd", "/usr/sbin/inetd.afs");
14
15 &ErrorsAreFatal(1);
16 &Patch::Verbose if ($InstallVerbose);
17 &CreateDir("/usr/vice/bin");
18
19 &Copy("bin/rsh", "/usr/vice/bin");
20 &Chown (0,2, "/usr/vice/bin/rsh");
21 &Chmod (04755, "/usr/vice/bin/rsh");
22
23 &Copy("lib/pam_afs.so.1", "/usr/lib/security");
24 &Chmod(0755, "/usr/lib/security/pam_afs.so.1");
25 &Chown(0,3, "/usr/lib/security/pam_afs.so.1");
26
27 $PamConf = "/etc/pam.conf";
28 &Patch::FileOpen($PamConf);
29
30 $RloginSubSearch = "^(rlogin.+)required(.+)";
31 $RloginSubReplace = '$1.optional.$2';
32
33 $RLoginAuthSearch = "^rlogin\\s+auth\\s+.+pam_unix.so.1";
34 $RLoginAuthNew = <<"xxENDxx";
35 rlogin auth optional /usr/lib/security/pam_afs.so.1 try_first_pass ignore_root
36 xxENDxx
37
38 $RshSubSearch = "^(rsh.+)required(.+)";
39 $RshSubReplace = '$1.optional.$2';
40
41 $RshSearch = "^rsh\\s+auth\\s+.*pam_rhosts_auth.so.1";
42 $RshNew = <<"xxENDxx";
43 rsh auth optional /usr/lib/security/pam_afs.so.1 try_first_pass ignore_root
44 xxENDxx
45
46 if (!&Patch::Patch($PamConf, [[1, "Substitution", $RloginSubSearch, $RloginSubReplace],
47 [1, "Insert", $RLoginAuthSearch, $RLoginAuthNew],
48 [1, "Substitution", $RshSubSearch, $RshSubReplace],
49 [1, "Insert", $RshSearch, $RshNew]])) {
50 &ErrorMsg("Did not succeed with patch", $PamConf);
51 }
52
53 # Create the inetd.conf.afs file
54 $InetdConfAfs = "/etc/inet/inetd.conf.afs";
55 open(INETD, ">$InetdConfAfs") || &ErrorMsg("Can't open file", $InetdConfAfs);
56 print INETD <<"EOINETD";
57 shell stream tcp nowait root /usr/sbin/in.rshd in.rshd
58 ta-rauth stream tcp nowait root internal ta-rauth
59 EOINETD
60 &Symlink("./inet/inetd.conf.afs", "/etc/inetd.conf.afs");
61
62 # comment out the rshd line in inetd.conf
63 $InetdConf = "/etc/inet/inetd.conf";
64 &CopyStat($InetdConf, $InetdConfAfs);
65 &Patch::FileOpen($InetdConf);
66
67 $Search = "^(shell\\s+.+)";
68 $Replace = '"#".$1';
69
70 if (!&Patch::Patch($InetdConf, [[1, "Substitution", $Search, $Replace]])) {
71 &ErrorMsg("Did not succeed with patch", $InetdConf);
72 }
73
74 # Modify the /etc/inet/services file
75 # append the ta-rauth to the services file
76 $Services = "/etc/inet/services";
77 &Patch::FileOpen($Services);
78
79 $ServicesAppend = "ta-rauth 601/tcp rauth";
80
81 if (!&Patch::Patch($Services, [[0, "EOF", "", $ServicesAppend]])) {
82 &ErrorMsg("Did not succeed with patch", $Services);
83 }
84 }
85