NEXTSTEP In Focus, Spring 1994 (Volume 4, Issue 2). Copyright (C) 1994 by NeXT Computer, Inc. All Rights Reserved. TIPS & TECHNIQUES Correcting the sendmail Patch The sendmail patch NeXT recently made available doesn't update the entire sendmail subsystem. In the original release, the files /usr/bin/mailq and /usr/bin/newaliases were ``hard links'' to the same file (inode) as /usr/lib/sendmail. The patch replaces only the file called /usr/lib/sendmail, and doesn't affect the other two links. This leaves systems on which the patch is installed open to some of the vulnerabilities the patch was meant to address. To close the vulnerabilities, follow the steps below. 1 Either log in as root and run the Terminal application, or, in Terminal, su to root. 2 Run the following commands: 6# cd /usr/bin 7# rm mailq mailaliases 8# ln -s ../lib/sendmail mailq 9# ln -s ../lib/sendmail newaliases 3 You don't need to reboot the computer, nor to restart the sendmail daemon. Following these steps replaces the old mailq and newaliases with relative symbolic links to the new sendmail. Complete this procedure on all NEXTSTEP computers on which the sendmail patch has been installed. Failing to complete the installation according to these instructions can leave your system open to some of the vulnerabilities that the sendmail patch addresses. Thanks to Alan M. Marcum for this tip. Booting from a Second IDE Drive Selecting which partition to boot a computer from can be difficult. Consider a computer with two IDE disk drives, each with a capacity of 200 megabytes. It could be convenient to format one disk exclusively for DOS and the other exclusively for NEXTSTEP. But is this setup possible? To boot from the secondary drive, you need a means of interrupting the boot procedure and telling the PC to boot from the secondary IDE drive. One way to do this is to boot from the NEXTSTEP boot floppy that came with the operating system, telling it to load the mach_kernel from the secondary IDE and make it the root device. Another less tedious method is to boot from the primary drive and have it prompt which drive to boot from. Here are both procedures. Booting from floppy to secondary IDE drive 1 Install NEXTSTEP on the secondary IDE hard drive. The installation program puts the file system on this drive. When installation is complete, reboot the computer but don't eject the floppy disk! 2 When the computer boots, it loads the mach_kernel from the installation disk. At the boot prompt type the following command: # hd(1)mach_kernel rootdev=hd1a Booting continues from the secondary IDE drive; installation continues as well. When installation is complete, reboot the computer again but don't eject the floppy disk or the NEXTSTEP CD-ROM. 3 At the next boot prompt type this command: # mach_kernel -s This causes NEXTSTEP to boot from the CD-ROM in single-user mode. Although it looks as if NEXTSTEP is about to perform the installation again, rest assured that your work was not in vain. 4 After some time, the computer presents you with a # prompt. Type this command to mount the secondary IDE drive: # mount -n /dev/hd1a /disk 5 Modify /disk/etc/fstab to replace the hd0a entry with hd1a for the root device. You can either use a text editor like vi or execute these commands to achieve the same effect: # cd /disk/etc # mv fstab fstab.old # sed s/hd0a/hd1a/ fstab.old > fstab 6 Restart the computer. Start NEXTSTEP from the secondary IDE drive by typing this command at the boot prompt: # hd(1)mach_kernel rootdev=hd1a 7 Make a copy of the NEXTSTEP CD-ROM Installation Disk (the boot floppy) by following the steps outlined in ``Duplicating the Installation Disk,'' NeXTanswers #1561. Name the new disk something like Boot Floppy. 8 Repeat step 6. 9 Insert Boot Floppy in the computer. 10 Rename the file Instance0.table in the boot floppy's /usr/Devices/System.config directory to Instance0.table.orig. 11 Copy the Instance0.table file from the computer's /usr/Devices/System.config directory to /usr/Devices/System.config on the boot floppy. 12 Substitute hd(1)mach_kernel in place of mach_kernel in Instance0.table on the floppy disk. When you next need to start up NEXTSTEP, just insert the Boot Floppy floppy disk into the floppy drive and turn on the computer. Booting from primary IDE to secondary IDE Automating the boot procedure so that you choose DOS or NEXTSTEP when you start the computer is better than booting with the floppy disk all the time. This automation requires that the primary IDE disk have a partition for each operating system. The NEXTSTEP partition can be as small as 7 megabytes; you can make it larger to supplement the space for user data on the secondary drive. The primary disk can be thought of as containing a boot manager. When you start up the computer this manager asks you which operating system to use. Choosing NEXTSTEP boots the NEXTSTEP partition, which in turn redirects control to the secondary IDE drive. The root device then becomes the secondary IDE drive. Here's how to set the partition up. 1 Follow steps 1 through 5 for the floppy disk procedure in the previous section. 2 Partitioning the primary IDE drive will destroy any data currently on that drive, so if you have valuable data that is not backed up, stop and make an appropriate backup. 3 Create a NEXTSTEP partition of 7 megabytes and a DOS partition with the remaining space in fdisk: # fdisk /dev/rhd0h When you're finished, save the changes and quit fdisk. 4 Put a NEXTSTEP file system and the necessary boot blocks on the 7 megabyte partition with this command: # disk -i /dev/rhd0h 5 Mount the new NEXTSTEP partition: # mount -n /dev/hd0a /part 6 Copy a minimal file system to it and modify it to boot correctly. The commands for doing this are long; they're shown below. # mkdir /part/usr # mkdir /part/usr/Devices # cp -Rp /disk/usr/Devices/System.config /part/usr/Devices # cd /part/usr/Devices/System.config # mv Instance0.table Instance0.table.bak # sed s/mach_kernel/"hd(1)mach_kernel"/ Instance0.table.bak > Instance0.table 7 Remove the floppy disk and CD-ROM, and restart the computer. Now reinstall DOS on the second partition. More about booting For more on booting from an alternative hard drive, see ``Booting from an Alternative Hard Disk Drive,'' NeXTanswers #1487. Thanks to Mark Tacchi for this tip! Digital Librarian and Digital Webster Tricks The Digital Librarian and Digital Webster applications are full of neat tricks and shortcuts. For example, the search fields in Digital Librarian and Digital Webster perform Escape completion. To see how this works in Digital Webster, type the letters un in the search field and press the Escape key. You should see unabashed.'' If you press Escape again, Digital Webster cycles through more words with the un- prefix. You can also select the portion of the word to cycle for searching. For example, with unabashed'' showing, select only the shed suffix. Pressing Escape now cycles through words starting with unaba. Thanks to Jack Greenfield for this tip! Skipping the Workspace Manager Many people don't realize that you don't have to automatically launch the Workspace Manager when you log in. Although avoiding the Workspace Manager might not seem useful at first, if you spend most of your time in Mail and rarely bring up a File Viewer you might want to save the time Workspace Manager takes to launch when you log in. To keep Workspace Manager from launching automatically, uncheck the top check box in the Workspace Manager Preferences panel. Don't let the fact that the check box is grayed out fool you--you can still uncheck it. When you next log in, Workspace Manager won't start automatically. Of course, any time you want to start up Workspace Manager to use the File Viewer, you can just double-click the NeXT icon in the dock. You'll need to do this to log out. On a related note, you can change which application logs you out. This application is the dock controller. You select which application is the dock controller with a dwrite command: % dwrite Workspace DockController n Here, n is an integer corresponding to the dock location of the application you want to be the Dock Controller--Workspace Manager is 0, the application below it is 1, and so on. For instance, if you want Mail to be your dock controller and Mail is in position 2 on your dock, type this command in Terminal: % dwrite Workspace DockController 2 The command takes effect the next time you log in. Then when you quit Mail, Workspace Manager asks if you really want to log out, cancel, or power off. Try it! Bryce Jasmer and Bob Vadnais supplied these Workspace Manager tips. Thanks guys! ______________________________________________________________________________________________ Next Article NeXTanswer #1845 FYI Previous Article NeXTanswer #1847 FAQ Table of contents http://www.next.com/HotNews/Journal/InFocus/Spring1994/ContentsSpring1994.html