[comp.unix.wizards] Mail not delivered yet, still trying

postmaster@nusc.arpa (SMTP MAILER) (12/02/88)

 ----Mail status follows----
Have been unable to send your mail to <baynes@drum>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 1 Dec 88 07:19:00 EST
From: <unix-wizards@BRL.MIL>
Subject: UNIX-WIZARDS Digest  V6#035
To: "baynes" <baynes@drum>

Received: from SEM.BRL.MIL by nusc.arpa with SMTP ; Thu,  1 Dec 88 07:18:41 EST
Received: from SEM.BRL.MIL by SEM.brl.MIL id aa04903; 1 Dec 88 3:18 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa04864; 1 Dec 88 2:45 EST
Date:       Thu, 01 Dec 88 02:45:33 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V6#035
Message-ID:  <8812010245.aa04864@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Thu, 01 Dec 1988              V6#035

Today's Topics:
                 Re: random passwords (was Re: Worm...)
                         Re: Mounting floppies
                             Re: Ghost file
                   Need news feed (pref. in DC area)
                   Re: Autologout of unused terminals
                ioctl in perl (was: using System V 'cu')
                    Re: what is the 'l' permission?
                               Re: cat -u
                               Re: umlaut
            Re: Insecure hardware (was Re: gets(3) nonsense)
                 Re: The Internet Virus--Another issue
                      Re: 4.3 BSD networking bugs
                Software Quality (was: Re: rtm and uucp)
                           Re: Worm/Passwords
                                  Echo
                   Re: Autologout of unused terminals
                 Re: fixing rm * (was: Worm/Passwords)
          Re: Here's a *BRILLIANT* password idea! (Sarcasm on)
             Re: "tip" leaves device file exclusively open
                   Re: Autologout of unused terminals
                 Re: wakeup() race condition. (theory)
                        Afio faster than Cpio???
                             Re: Ghost file
                       Why's and wherefore's.....
                         Re: Mounting floppies
                   Re: Autologout of unused terminals
                Re: rm etc. (was: Nasty Security Hole?)
                 Re: wakeup() race condition. (theory)
              Re: ioctl in perl (was: using System V 'cu')
                            Re: Predictable
                    Re: what is the 'l' permission?
               Re: Re: The Internet Virus--Another issue

-----------------------------------------------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: random passwords (was Re: Worm...)
Date: 30 Nov 88 02:22:04 GMT
Sender: news@sun.uucp
To:       unix-wizards@sem.brl.mil

Steve wrote:
>>Let's look at this quantitatively.  There are, more or less, 95
>>printable characters.  We'll subtract 2 for @ and #, which many UNIX
Barry said:
[wonderful]



Jeez.  This sounds awful.  Try this instead, you'll like it better.

Add a field somewhere (/etc/failures?) that records the number of 
failed attempts.  If it reaches some maximum, disallow logins with 
some message like:

	("Possible security risk: %d failed attempts\n", failed)

If the failed number is greater than MAXFAIL/2, then warn the user that
he ought to reset his password (to anything, including what it was).
Resetting would clear the failed field.  Now that I think about it,
you could print out the number of failed attempts to date at login time.
Users would know right away if someone had been beating on their
account.

Wouldn't this be a much easier and more palatable way to solve the problem?

Larry McVoy      (lm%snafu@sun.com)

-----------------------------

From: Stefan Stapelberg <stefan@mikros.systemware.de>
Subject: Re: Mounting floppies
Date: 29 Nov 88 10:10:52 GMT
To:       unix-wizards@sem.brl.mil

In article <5682@louie.udel.EDU> law@udel.EDU (Jeff Law) writes:
>suid programs are not the only problem with allowing users to mount floppies,
>what is going to stop me from putting my floppy in the drive and saying
>mount /dev/floppy /etc

I think, it is just that easy to write a small C program which checks
wether the user doing the mount is the owner of the mounting point.

BTW: You not only have to look for suid-files, but also for special
device files!

In Germany, there is a law for government agencies when accessing
sensitive data (e.g. personal data): The sensitive data has to be
physically present only when someone is working with it.  So people
like it to mount the floppy disk rather than read/write tar archives.

-- 
Written (W) 1988 by Stefan Stapelberg <stefan@mikros.uucp> Phone: +49 9352 5948

-----------------------------

From: DAVID NEWALL <ccdn@levels.sait.edu.au>
Subject: Re: Ghost file
Date: 25 Nov 88 12:11:13 GMT
Keywords: ghost, unprintable, unlink
To:       unix-wizards@sem.brl.mil

I had an off by one bug in a "high level" file access library, once.  It's
effect was to append a single character (usually > 127) to the end of all
files created.  Needless to say, I couldn't generate the filename from
within the shell, and so I couldn't delete it using rm.

But it turned out to be easy, to write a C program to delete the file.  It
looked sort of like this:

main()
{
   char name[] = "badfile?";
   name[7] = (char) 255;
   unlink(name);
}

Of course, I had to use "od" to find out the value of the `bad' character.
(Ls, by default, displays unprintable characters as "?").

--

David Newall                     Phone:  +61 8 343 3160
Unix Systems Programmer          Fax:    +61 8 349 6939
Academic Computing Service       E-mail: ccdn@levels.sait.oz.au
SA Institute of Technology       Post:   The Levels, South Australia, 5095

-----------------------------

From: storm development account <storm@reign.uucp>
Subject: Need news feed (pref. in DC area)
Date: 30 Nov 88 03:36:01 GMT
Keywords: dc news feed
To:       unix-wizards@sem.brl.mil

Greetings,

	If this is a repost, my apologies.  Looks like the regional
distribution only sent it to the source machine!

	I have a client, (The Process Control Divison of the 
U.S. Postal Service) that is looking for a Usenet mail connection 
and a news feed.  They can handle 2400 bps or 9600 bps if its being 
sent with a U.S. Robotics HST 9600 modem.  They should also be able 
to serve as a feed for a couple of other sites.

	If you can provide a feed, or know of someone who can, please
let me know.  (Might even be able to set up Empire on their system!)

	Thanks,

	Storm

-- 
                                   If you're going to walk on thin ice,
uunet!reign!storm                       You might as well dance...

-----------------------------

From: Bjorn Engsig <bengsig@orcenl.uucp>
Subject: Re: Autologout of unused terminals
Date: 29 Nov 88 15:48:19 GMT
To:       unix-wizards@sem.brl.mil

In article <201.nlunix6@orcenl.uucp>, I asked
> Is there any way to see if a terminal has not been used for some time,
  [ ... ]

Thank you to all of you who send me a mail, or posted a followup.  I've got
plenty of ideas and pointers to existing software.

Now, we can all just watch the ongoing discussion, whether one should have
such a mechanism in the first place :-)

-- 
Bjorn Engsig, ORACLE Europe      \ /    "Hofstaedter's Law:  It always takes
 ..!uunet!mcvax!orcenl!bengsig    X      longer than you expect, even if you
phone:  +31 21 59 56 411         / \     take into account Hofstaedter's Law"

-----------------------------

From: Larry Wall <lwall@jpl-devvax.jpl.nasa.gov>
Subject: ioctl in perl (was: using System V 'cu')
Date: 30 Nov 88 06:51:33 GMT
To:       unix-wizards@sem.brl.mil

Leslie Mikesell writes:
: Perhaps the reason is that it is not compiled into the official AT&T
: release, at least not up to SysVr3.1 on the 3B2's.  It would be extremely
: useful, though, as would the ability to execute a script like that
: found in the Dialers file at an arbitrary time (i.e. after the connection
: is made).  The code is obviously already there.  Is Larry Wall listening?
: How about adding ioctl() to perl so we can use it instead?

Er, um, that's kinda hard.  But I been thinkin' about it.

In the meantime, if it's something that stty knows about you can just
fork one off to do whatever you want after making sure you have the tty
open on stdout (stdin on some systems).

	open(TTY,"/dev/tty07");
	...
	open(dupout,">&stdout");	# dup stdout
	close stdout;
	open(stdout,">&TTY");		# dup filehandle TTY
	system 'stty', '-echo', 'raw';
	close stdout;
	open(stdout,">&dupout");	# restore stdout
	close dupout;

If efficiency isn't as important you can just say

	system 'stty -echo raw >/dev/tty07';

To do ioctl in perl I'd have to have a way to supply variable sized 3rd
arguments to ioctl.  I figure I could do that with a pre-sized array, with
extra information to say whether it is to be interpreted as bytes, shorts
or longs.  A scalar could likely substitute for a single element array.

The main problem with doing ioctl in perl is not the 3rd argument as much
as the 2nd.  Have you looked at the shenanigans they do in sys/ioctl.h?
(On BSD and Sun at least--I don't know about Sys V.)  Those cute little
identifiers you feed to the 2nd argument are awful.  You say, in C,
something polite like:

	ioctl(0,FIONREAD,&cnt);

and cpp turns that into the following mishmash

	ioctl(0,(0x40000000|((sizeof(int)&0x1fff)<<16)|('f'<<8)|127),&cnt);

So if I'm gonna let you write, in perl,

	ioctl(stdin,$FIONREAD,$cnt);

I've gotta have some way of teaching perl about the gobbledygook above.
Anyway, I'm thinking about it.  Adding chroot() would be much easier.
And maybe getppid().  I think I'll make the current priority a variable,
usable only if your system supports getpriority/setpriority:

	$" -= 20;	# grab that CPU!

The nice program could then be written like this:

	#!/usr/bin/perl
	$diff = ($ARGV[0] =~ s/^-(-?\d+)/$1/) ? shift : 10;
	$" += $diff;
	exec @ARGV;

Is this reasonable?

I'm still thinking about that ioctl...

Larry Wall
lwall@jpl-devvax.jpl.nasa.gov
"So many programs, so little time..."

-----------------------------

From: Henry Spencer <henry@utzoo.uucp>
Subject: Re: what is the 'l' permission?
Date: 29 Nov 88 19:31:57 GMT
To:       unix-wizards@sem.brl.mil

In article <516@auspex.UUCP> guy@auspex.UUCP (Guy Harris) writes:
>>Consider a program that mandatory-locks /etc/passwd and then sleeps forever.
>>...
>Well, actually, in order to lock out reads, you have to establish a
>write lock on the region in question, and to establish a write lock you
>need to have a file descriptor open for writing...

Hmm, guess I should have read the documentation! :-)  At at least one
point in the past, for at least one of the locking schemes (/usr/group?),
locking /etc/passwd *was* a problem and hence the 'l' bit.

>In AT&T's documentation, they appear to recommend that you not use
>mandatory locking because there's extra overhead on every read or write
>performed...

One can always argue that a more efficient implementation could largely
fix this.
-- 
SunOSish, adj:  requiring      |     Henry Spencer at U of Toronto Zoology
32-bit bug numbers.            | uunet!attcan!utzoo!henry henry@zoo.toronto.edu

-----------------------------

From: Henry Spencer <henry@utzoo.uucp>
Subject: Re: cat -u
Date: 29 Nov 88 19:41:10 GMT
To:       unix-wizards@sem.brl.mil

Organization: U of Toronto Zoology
Lines: 9

In article <4864@bsu-cs.UUCP> dhesi@bsu-cs.UUCP (Rahul Dhesi) writes:
>     /bin/cat -uv "$file" | /usr/ucb/more -10d
>
>I couldn't get it to work right without the -u option.

This is a bug (albeit a long-standing and widespread one) in your cat.
-- 
SunOSish, adj:  requiring      |     Henry Spencer at U of Toronto Zoology
32-bit bug numbers.            | uunet!attcan!utzoo!henry henry@zoo.toronto.edu

-----------------------------

From: Clay M Bond <bondc@iuvax.cs.indiana.edu>
Subject: Re: umlaut
Date: 30 Nov 88 11:24:03 GMT
To:       unix-wizards@sem.brl.mil

Peter Salus:

> . . . and tjhat the posters are ignorant.

Aren't they, though?

-- 
<< ***************************************************************** >>
<< Clay Bond -- IU Department of Leath-er, er, uh, Linguistics       >>
<< bondc@iuvax.cs.indiana.edu        AKA: Le Nouveau Marquis de Sade >>
<< {pur-ee,rutgers,pyramid,ames}!iuvax!bondc *********************** >>

-----------------------------

From: Chris Torek <chris@mimsy.uucp>
Subject: Re: Insecure hardware (was Re: gets(3) nonsense)
Date: 30 Nov 88 11:42:19 GMT
Followup-To: comp.unix.wizards
To:       unix-wizards@sem.brl.mil

Someone else mentioned the correct answer, but I suppose I had best do
it again.  I have redirected followups to comp.unix.wizards only.

>In article <1189@cps3xx.UUCP> rang@cpswh.cps.msu.edu (Anton Rang)
`corrects' me:
>>VAX processors do have separate bits for read, write, and execute on
>>each page (I seem to vaguely recall one more). ...

In article <3335@tekcrl.CRL.TEK.COM> terryl@tekcrl.CRL.TEK.COM writes:
>     BBBBUUUUUZZZZ!!!!! Wrong answer...

So far so good....

>     The VAX only has read/write permissions per page, but it does have
>4 different access modes per page (kernel, executive, supervisor, & user),
>with each access mode having its own independent permissions per page...

Not so.  There is a four bit field for `access control'.  With four CPU
modes (K E S & U as above) and two permissions (R & W), there are only
half as many bits as needed for fully independent permissions.
Instead, the VAX designers made the assumption that if the user can
write the page, all the more privileged modes should also be able to
write; if the user can only read, more bits might allow other modes to
write.  Whatever permissions a less-privileged mode has, a more-
privileged mode has at least those permissions.

4BSD VAX Unix makes use of only the following modes:

#define	PG_NOACC	0
#define	PG_KW		0x10000000
#define	PG_KR		0x18000000
#define	PG_UW		0x20000000
#define	PG_URKW		0x70000000
#define	PG_URKR		0x78000000

Execute permission is implied by read permission.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris

-----------------------------

From: Mike Klaus <mak@ndc.uucp>
Subject: Re: The Internet Virus--Another issue
Date: 29 Nov 88 17:28:55 GMT
To:       unix-wizards@sem.brl.mil


	Today's Score: Crossover   1
		       LineEater   0

     And, if you have an unauthorized copy of jay's mailer, it'll crash @ *the
     end* of the previous line.  Who says that software can't be reposessed?
    
								mak

    BTW, to all those that have fingered my new password, it's poison. 

-----------------------------

From: Chris Torek <chris@mimsy.uucp>
Subject: Re: 4.3 BSD networking bugs
Date: 30 Nov 88 13:18:09 GMT
To:       unix-wizards@sem.brl.mil

In article <204@hsi86.hsi.UUCP> stevens@hsi.UUCP (Richard Stevens) writes:
>(1) When using UNIX domain datagrams, only the first 14 bytes of
>	the sender's socket address are passed with the datagram.
>	It looks like sbappendaddr() ...

Yep.  Fixed in 4.4BSD?  (4.4 will have variable length socket addresses,
which are required by various ISO protocols.)

>(2) When using XNS datagrams (IDP protocol) you have to explicitly
>	call bind() to assign an address to yourself, if you want
>	the other end to be able to respond to you, otherwise an all
>	zero address gets sent along with the datagram.

spp_usrreq calls ns_pcbbind with a null `nam', telling it to choose
a local port.  ns_pcbbind defers choosing a local host address, however,
until send time, just like the TCP code.  Alas, ns_output does not
contain the `#ifndef notdef' (=~ `if true') code that appears in
ip_output....
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris

-----------------------------

From: "Snoopy T. Beagle" <snoopy@sopwith.uucp>
Subject: Software Quality (was: Re: rtm and uucp)
Date: 29 Nov 88 23:48:09 GMT
Followup-To: comp.software-eng
To:       unix-wizards@sem.brl.mil

In article <1988Nov15.180821.20324@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:

| The popular software distribution from a certain
| university in southern California is a good example of interesting ideas
| often marred by first-cut [i.e. poorly thought out, messy, sometimes
| incomplete] designs and implementations.

| This is not to say that any random commercial organization, like, say,
| one whose name has three initials and an "&" in it, will *necessarily*
| do better.  But those people can, in theory, afford to spend some money
| on quality assurance.  Universities generally can't.

Does this mean I should "rm -rf cnews" rather than trying to get it to
build?  :-)  Can I trust software from a certain university in eastern
Canada? :-)

These days, a vender is likely to be pushing both hardware and software
out the door as soon as possible so that they can rake in the bucks for
whizzy new feature foobar before their competitor beats them to it.  They
may very well argue that they can't spend any more time/money on quality.

If you want better quality, you need to get customers to demand it.
Customers with large budgets.

It isn't who you work for, it is your state-of-mind that counts.  Tools like
code inspections can help, but they may not buy you much if you're just going
through the motions.
    _____     
   /_____\    Snoopy
  /_______\   
    |___|     tektronix!tekecs!sopwith!snoopy
    |___|     sun!nosun!illian!sopwith!snoopy

-----------------------------

From: Jordan Brown <jbrown@herron.uucp>
Subject: Re: Worm/Passwords
Date: 30 Nov 88 12:56:14 GMT
To:       unix-wizards@sem.brl.mil

jbayer@ispi.UUCP (Jonathan Bayer) writes...
> In article <10@herron.uucp>, jbrown@herron.uucp (Jordan Brown) writes:
> > jbayer@ispi.UUCP writes:
> > > It is possible to adopt a single system, if that system is random.  For 
> > > example, I have included below a random password generating program, ...

> > Somebody go by this fellow's office and look at all the desk blotters and
> > scraps of paper to find written-down passwords.  Then log in and mail him
> > a note to go watch War Games.

>	 Instead of being critical without offering suggestions, why don't you
> shut up?

You may disagree with me on the security of randomly generated passwords,
but I don't think this tone is reasonable.  (At least I don't think my
comment was this nasty.  My apologies if it came across that way.)

> I challenge you to develop a program which will create random passwords
> which will be easy to remember.

I'm not sure what "easy to remember" means.  Enough users have problems
remembering passwords that *they* picked to make me doubt that any random
scheme has any chance.  I didn't mean to say that *your* random password
program was bad, but that they *all* are.

I'm not going to try to write a "better" version, as I'm convinced it
isn't possible to write one "good enough".

> If you do this then you will have contributed
> something worthy to the net instead of useless abuse.

Again, I did not intend abuse.  Randomly generated passwords are the
"obvious" answer to the problem of easily-guessed passwords, but cause
their own brand of security hole (which is probably worse, as it doesn't
take the same level of ingenuity to exploit it).  Random passwords make
life more awkward for the user while possibly *reducing* security.

Thinking about it, there's another serious problem.  If you don't have a
*very* good seed source, your random passwords are easily guessable.
(For instance, suppose you use the time in seconds as your source.
if you know what day the password was assigned, then there are only 86k
passwords to try.  It'll typically take a second or so to try each, so
about a day of CPU time later...  Time in ms would be better, but it is
still probably practical to observe password changes and search the
appropriate range of random numbers.  Write a program that "watches"
/etc/passwd and logs username and time when it's updated.  Probably
an adequate solution is to continuously increment a counter while
waiting for a keystroke.  That's pretty close to truly random.)

You presented a "solution" to the problem; I poked what I consider
to be a gaping hole in it, one that I thought was "well-known"
(documented in a mainstream motion picture, even).

I hate a flawed solution to a problem more than no solution at all.
At least when you know there's no solution you aren't deceived.

Sorry if I've offended; I just don't think random passwords are a
viable answer.  (You'd probably figured that out. :-)

-----------------------------

From: Kenneth Almquist <ka@june.cs.washington.edu>
Subject: Echo
Date: 30 Nov 88 14:18:11 GMT
To:       unix-wizards@sem.brl.mil

I've been implementing a public domain shell and I'm wondering what to
do about the echo builtin.  The System V echo command interprets a number
of escape sequences (e.g. \n for newline) which the BSD echo does not,
so I can...

1.  Implement the System V echo on the grounds that it will make it easier
    to run System V shell scripts.

2.  Implement the BSD echo on the grounds that it's the "right" approach
    (since the System V echo is useless if you want to echo an arbitrary
    string unchanged).

3.  Don't provide an echo builtin, so users get whatever echo command is
    installed in /bin.  This follows the principle of least surprise, but
    it makes shell scripts run slowly and does nothing for portability.

Any suggestions?  In particular I would like to know if any standards
organizations have addressed the semantics of echo.  Does anyone know
what the merged AT&T/SUN UNIX is going to do about echo?
				Kenneth Almquist

-----------------------------

From: "Vincent C. Hatem" <vch@attibr.uucp>
Subject: Re: Autologout of unused terminals
Date: 30 Nov 88 15:23:09 GMT
To:       unix-wizards@sem.brl.mil

In article <83@cosmic.sns.UUCP>, holgi@sns.UUCP (Holger Kollmer) writes:
# In article <201.nlunix6@orcenl.uucp> bengsig@orcenl.uucp (Bjorn Engsig) writes:
# #Is there any way to see if a terminal has not been used for some time,
# #and if it hasn't, to send a hangup to the processes there?  We are looking
# 
# You can make stat(2) on the tty. That system call returns st_mtime and 
# st_atime which shows the last access and modification time. 

You could also use 'who -u' (on Sys V), which tells the idle time...

-- 
Vincent C. Hatem                            | att ---->\ (available from any
AT&T International                          | ulysses ->\ Action Central site)
International Operations Technical Support  | bellcore ->\___ !attibr!vch
1200 Mt Kemble Ave, Basking Ridge, NJ 07920 | (201) 953-8030

-----------------------------

From: Clarence Dold <cdold@starfish.convergent.com>
Subject: Re: Autologout of unused terminals
Date: 29 Nov 88 16:26:40 GMT
To:       unix-wizards@sem.brl.mil

From article <2682@sultra.UUCP>, by dtynan@sultra.UUCP (Der Tynan):
> All he wants is the software.  Anyway, I don't mind if you spell it out
> one more time.  I'd like to know why it is better to leave Joe User's
> account available for a passer-by, than to kill it.  A lot of UN*X sites
To back up my system, I do an su, followed by /etc/backup&, then exit.
As long as I stay logged in as a normal user, the script continues.
If I log out, the script is aborted.
I don't leave a terminal in SuperUser lying around, even running a script.
-- 
Clarence A Dold - cdold@starfish.Convergent.COM         (408) 434-2083
                ...pyramid!ctnews!professo!dold         MailStop 18-011
                P.O.Box 6685, San Jose, CA 95150-6685

-----------------------------

From: "Richard A. O'Keefe" <ok@quintus.uucp>
Subject: Re: fixing rm * (was: Worm/Passwords)
Date: 30 Nov 88 11:27:42 GMT
Sender: news@quintus.uucp
To:       unix-wizards@sem.brl.mil

In article <1248@atari.UUCP> achar@atari.UUCP (Alan Char) writes:
>In article <727@quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes:
>|One answer, of course, would be to have a
>|	GLOBASK=rm:rmdir
>|shell variable, so that one could put
>|	GLOBASK=a.rm:$GLOBASK
>|in ones .profile.  (Did I just make a constructive suggestion?  Oops.)
>
>GLOBASK is not that different from expandcheck.  In fact,
>setting GLOBASK=<all commands> is exactly the same as setting
>expandcheck=1 modulo the prompt text.

No it isn't, because it is not *possible* to set GLOBASK=<all commands>.
That's an open set.  (The set of commands accessible through my $PATH at
the moment is 661, and that's after I pruned my $PATH.)  It's also quite
a different perspective; it's quite pointless to limit
	echo * | wc -w
which expandcheck would do, whereas the GLOBASK approach explicitly
identifies only the believed-dangerous commands.

I am not seriously proposing GLOBASK; just pointing out that more focussed
approaches than expandcheck are possible.

-----------------------------

From: Len Reed <lbr@holos0.uucp>
Subject: Re: Here's a *BRILLIANT* password idea! (Sarcasm on)
Date: 30 Nov 88 15:04:31 GMT
To:       unix-wizards@sem.brl.mil

From article <438@amanue.UUCP>, by jr@amanue.UUCP (Jim Rosenberg):
= Well now, net folk, since we're talking about good and bad ideas for passwords,
= how does this idea strike you.  (1)  Restrict all passwords to a *MAXIMUM* of
= 4 characters.  (2) *PROHIBIT* anything but digits from appearing in a password.
= 
= Isn't this nifty?  You're probably thinking I'm a nut case.
= 
= Well surprise:  This exact password system is ***IN USE***!!!  In (are you
= ready:) ***BANKS***!!!  I am not kidding.  Do you have an Automatic Teller
= Machine card?  What does your password look like?  Every time I've been given
= one of those things the password was just 4 digits!!!!!!!

You have to have physical possession of the card, too, not just knowledge
of the account number.  The "password" merely stops someone from using
the card between the time it is stolen and the theft is reported to
and dealt with by the bank.  It's a backup to the main security stategy--
possession of the card.  Not exactly the same thing as a computer system
with dial-in capability.

The banks around here have a "three strikes and you're out" rule.  If you
put the card in and fail three times to get the password right the
machine keeps the card.

BTW, I do think you're a nut case.
-- 
    -    Len Reed

-----------------------------

From: David Lai <lai@vedge.uucp>
Subject: Re: "tip" leaves device file exclusively open
Date: 29 Nov 88 22:33:13 GMT
Posted: Tue Nov 29 17:33:13 1988
To:       unix-wizards@sem.brl.mil

In article <318@taux02.UUCP> amos@taux02.UUCP (Amos Shapir) writes:
>Check permissions  to /usr/spool/uucp.   tip creates  a lock  file there
>(usually LCK.something)  as user uucp,  then does  a setuid to  the user
>that  runs it.   In some  versions, it  forgets to  setuid back  to uucp
>before  removing the  lock, so  the remove  fails and  the lock  is left
>intact.  Sometime  the only solution  is to make the  directory writable
>(shudder).
>-- 
>	Amos Shapir				amos@nsc.com
>National Semiconductor (Israel) P.O.B. 3007, Herzlia 46104, Israel
>Tel. +972 52 522261  TWX: 33691, fax: +972-52-558322
>34 48 E / 32 10 N			(My other cpu is a NS32532)

I have a small script I use instead of 'tip' on the sun (which creates
the LCK file as uucp but cant remove it afterwards, it is in the path before
/usr/bin)

tip:
#!/bin/sh
if test "$1" = "fast"; then
	a=cuad
fi
if test "$1" = "slow"; then
	a=cua0
fi
if test "$1" = "slow300"; then
	a=cua0
fi
if test "$1" = "fast" -o "$1" = "slow" -o "$1" = "slow300"; then
	if /usr/lib/uucp/uuchecklock $a; then
		/usr/bin/tip $*
		/usr/lib/uucp/uuunlock $a
	else
		echo "modem" $a "busy"
	fi
else
	/usr/bin/tip $*
fi

/usr/lib/uucp/uuchecklock: (setuid to uucp)
if test -f /usr/spool/uucp/LCK..$1; then
exit 1
else
exit 0
fi

/usr/lib/uucp/uuunlock: (setuid to uucp)
#!/bin/sh
rm -f /usr/spool/uucp/LCK..$1
-- 
	"What is a DJ if he can't scratch?"  - Uncle Jamms Army
The views expressed are those of the author, and not of Visual Edge, nor Usenet.
David Lai (vedge!lai@larry.mcrcim.mcgill.edu || ...watmath!onfcanim!vedge!lai)

-----------------------------

From: Christopher Lott <cml@brachiosaur.cis.ohio-state.edu>
Subject: Re: Autologout of unused terminals
Date: 30 Nov 88 21:23:17 GMT
Sender: news@tut.cis.ohio-state.edu
To:       unix-wizards@sem.brl.mil

In article <3603@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes:
>Not only that, but idle-killers are so easy to spoof, unless you disable
>people from executing utime() or ioctl().
>Larry Wall
>lwall@jpl-devvax.jpl.nasa.gov

Well, yes.  A friend (Hi, Ed) did so once; was nothing more than writing a
little daemon to spit out a newline character using a 4.2BSD ioctl() call
every IDLE_TIMEOUT_PERIOD - 1 minutes. 

But the reason I have put untamo, from Purdue cc, on our largish timeshare
machine here was to free up precious hardwire lines to the campus network
switch.  Allows more people to have access.

I maintain that people are slightly flaky at times (me especially) and do
forget to log out - so a daemon that cleans up after them is more of a help
than a detriment to the sysadmin effort.  Putting the daemon to work is
not a battle between the stodgy sysadmin and the clever, crafty user but
merely another effort to allocate resources more fairly.

[ Untamo allows nice exceptions - we never time-out a user on a pty, only
  on a hardwire line.  My xterm client on that machine tends to go idle for
  long periods, but pseudo terminals are relatively cheap, so it's ok. ]

I have no affiliation with untamo and authors except as a user.

chris... 

-=-
cml@tut.cis.ohio-state.edu   Computer Science Department, OSU     614-292-6546
 or:  ...!{att,pyramid,killer}!osu-cis!cml		<standard disclaimers>

-----------------------------

From: Bjorn Engsig <bengsig@orcenl.uucp>
Subject: Re: Autologout of unused terminals
Date: 30 Nov 88 08:40:00 GMT
To:       unix-wizards@sem.brl.mil

In article <9012@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn ) writes:
> >why it's such a terrible sin to kill these jobs.
> 
> Because any automated scheme you come up is likely to ALSO kill off
> some perfectly legitimate jobs.
> 
What I asked for in the first place was just a program to send SIGHUP to
processes, which seemed to be doing nothing.  There will of course always
be cases where this 'seems' is wrong, but a process that wants to live could
easily do signal(SIGHUP,handler) (or nohup).  When doing this, you show that
you are aware of the possible 'auto-killing', and you will be sure not to be
killed.  This is also a nice thing to do on a modem line.
-- 
Bjorn Engsig, ORACLE Europe      \ /    "Hofstaedter's Law:  It always takes
 ..!uunet!mcvax!orcenl!bengsig    X      longer than you expect, even if you
phone:  +31 21 59 56 411         / \     take into account Hofstaedter's Law"

-----------------------------

From: Lars Pensj| <lars@myab.se>
Subject: Re: wakeup() race condition. (theory)
Date: 29 Nov 88 14:46:40 GMT
Keywords: wakeup sleep spl
To:       unix-wizards@sem.brl.mil

In article <1974@van-bc.UUCP> sl@van-bc.UUCP (pri=-10 Stuart Lynne) writes:
>		x = spl(5);
>		state |= IAmAsleep;
>		sleep(...)
>		splx(x);

Just a note about this. It should be

		x = spl(5);
		state |= IAmAsleep;
!		while (state & IAmAsleep)
!		    sleep(...);
		splx(x);

because sleep() may wake through other wakeup() with unknown codes.

 --------------
Lars Pensj|
lars@myab.se
-- 
    Lars Pensj|
    lars@myab.se

-----------------------------

From: Dan Troxel VP <dan@hrc.uucp>
Subject: Afio faster than Cpio???
Date: 30 Nov 88 18:52:48 GMT
To:       unix-wizards@sem.brl.mil


Is it true that afio is faster than cpio? When I run it on a Convergent
S/640 (25MHZ 68020), on 5.33 megs, afio takes 45 to 50 seconds longer
than cpio. Any suggestions as to what I need to do to get the speed up?
The reason I need afio, is that the CT box cpio doesn't handle the
magnetic tape to well. (reel-to-reel)
-- 
Dan Troxel VP of Computer Operations @ 
Handwriting Research Corporation - 2821 E. Camelback Road Suite 600
Phoenix, AZ  85016       WK 1-602-957-8870        HM 1-602-435-1240
UUCP : asuvax!hrc!dan

-----------------------------

From: Guy Harris <guy@auspex.uucp>
Subject: Re: Ghost file
Date: 30 Nov 88 18:57:38 GMT
Keywords: ghost, unprintable, unlink
To:       unix-wizards@sem.brl.mil

>   char name[] = "badfile?";
>   name[7] = (char) 255;

Or

	char name[] = "badfile\377";

which is slightly more convenient.  I sincerely *hope* your compiler can
cope with that (although it's not inconceivable that the compiler writer
dropped the ball)....

-----------------------------

From: Paul Muller <muller@munnari.oz>
Subject: Why's and wherefore's.....
Date: 30 Nov 88 15:12:49 GMT
Keywords: Microport vs. Xenix (for IBM-AT(386) based systems)
To:       unix-wizards@sem.brl.mil


I know this is asking for comp.unix.wizards.flame, but I am rather confused.

     I have been talking to people in the industry and to collegues over the
advantages of SCO Xenix vs Microport Sys V (AT/386), which is better, the last
comment I recvd from a friend (who runs Xenix) was that Microport was CRAP!
He cited the point that the ttyx drivers are stuffed and that the whole OS is
a snail! This is rather odd as a conflicting comment suggested that M/Port
runs rings around Xenix on any PC?!?!

      I would appreciate some expert (read:user) opinion on this as I have
to help manage a system that will run a file intensive retrieval system and
with around 6 users I need something that can hack the pace and save my bum.

      I apologise for the contravertialnous (spel?) of the topic, but I really
like to know what I'm getting myself into (assuming it makes it through finance

Thanks in advance,
Paul Muller
+61 3 743 5930
(muller@munnari.oz.au)

-----------------------------

From: Guy Harris <guy@auspex.uucp>
Subject: Re: Mounting floppies
Date: 30 Nov 88 19:48:34 GMT
To:       unix-wizards@sem.brl.mil

>BTW: You not only have to look for suid-files, but also for special
>device files!

Note that "ncheck", both on S5R3 and 4.3BSD, has a "-s" flag to do
precisely those checks (it may do so on other UNIX versions as well); I
suspect it may do so faster than, say, "find".  You may be able to use
it, rather than writing your own code to do it.... 

-----------------------------

From: Amos Shapir <amos@taux02.uucp>
Subject: Re: Autologout of unused terminals
Date: 30 Nov 88 12:43:25 GMT
Hdate: 21 Kislev 5749
To:       unix-wizards@sem.brl.mil

In article <9012@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>There are many ways to deal with careless terminal users other than
>automatic idle-terminal killer software.

Here's one: the following command file, for BSD systems, uses the output
of 'w' to mail notes to idle users. The only bug is that such users are
usually not there to read their mail...

#!/bin/sh
w -hs | \
sed -n 's/^\(.........\)\(..\)\(.[0-9]\).*/(echo You have a login session on tty\2\
echo which has been inactive for more than \3 days now. \
echo You can use ps -ut\2  to find out what processes run there and kill them.) \\\
|Mail -s "Idle login session" \1/p' |sh


-- 
	Amos Shapir				amos@nsc.com
National Semiconductor (Israel) P.O.B. 3007, Herzlia 46104, Israel
Tel. +972 52 522261  TWX: 33691, fax: +972-52-558322
34 48 E / 32 10 N			(My other cpu is a NS32532)

-----------------------------

From: "Richard A. O'Keefe" <ok@quintus.uucp>
Subject: Re: rm etc. (was: Nasty Security Hole?)
Date: 30 Nov 88 14:54:24 GMT
Sender: news@quintus.uucp
To:       unix-wizards@sem.brl.mil

In article <13193@ncoast.UUCP> allbery@ncoast.UUCP (Brandon S. Allbery) writes:
>As quoted from <730@quintus.UUCP> by ok@quintus.uucp (Richard A. O'Keefe):
>| 	% att rm zabbo
>| 	zabbo: 0 mode ? n
>| 	% bsd rm zabbo
>| 	rm: override protection 0 for zabbo? n
>If UUNET is any guide, V.2 on Sequents isn't.
>	$ >foo ; chmod 0 foo ; rm foo
>	rm: remove foo? n
>
>I've seen the above on quite a few systems of V.2, V.3, and Xenix 5.x
>persuasions.

UNIX System V/386 Release 3.0 80386 says
	foo: 0 mode ?
just like the Sequent.  There is more reason to doubt UUNET:  the SVID
clearly and explicitly states in RM(BU_CMD) that
	If a file has no write permission
	and the standard input is a terminal,
	its [presumably the file's] permissions are printed
	and a line is read from the standard input.
Something which purports to be V.2 "rm" ought to obey the SVID and
print the permissions *somehow* (though the SVID doesn't specify a
format).

Internationalisation will be a great opportunity to tidy this up.

-----------------------------

From: "D.Rorke" <der@sfmag.uucp>
Subject: Re: wakeup() race condition. (theory)
Date: 30 Nov 88 18:47:45 GMT
To:       unix-wizards@sem.brl.mil

> 
> A few days ago, I posted an article describing a problem
> with a driver that didn't return from a sleep(), though
> the call to wakeup was performed.
> 
> The process remained in a curious state. It was reported by
> ps as runnable (no sleep chan), but the run list pointer
> was 0. It also didn't respond to any signal.
> 
> A point to note is that the driver's interrupt routine 
> priority is 7, and that this routine is calling wakeup()
> to awaken the sleeping process.
> 
> Theory:
> Sleep & wakeup both call spl6() to ensure secure access to
> the process queues, (Well, this is not theory, the calls are
> there...) and it is possible for the driver's device to 
> interrupt as a wakeup() is running, isn't it ?
> 
> As this driver (as SCO xenix serial driver) is running with
> prio 7, it's not blocked by spl6() and then it may interfere
> with the running wakeup by, say, runnig another wakeup.
> 
> Solution: (?)
> Not to call any wakeup at prio 7, that is, put every driver
> interrupt routine that calls wakeup at prio 6 or below.
> 
> I would be glad to hear some guru opinion on the topic.


Arghh.

Most current implementations of wakeup() are not reentrant.  I assume
yours is not if it's bothering to do an spl6().  Non reentrant
wakeup() implementations should set the interrupt level to the highest
possible level while executing in a critical section.  As you noted,
a wakeup() that sets some intermediate interrupt level can be 
interrupted by an interrupt handler that could potentially call wakeup().
This could cause the problem you observed.  It could also panic your
system if the sleep queues are implemented as linked lists.

The solution you propose above is OK but a better solution (if you have
source) is to fix wakeup() to set the highest interrupt level supported
by the hardware.


Dave Rorke
attunix!der


> -- 
> Carlos G. Mendioroz  <tron@mrecvax.mrec.ar>  
> Work: +54 (1) 313-8082  Fax: +54 (1) 311-1249
> Home: +54 (1) 71-3473 ; Malabia 2659 11 B, Buenos Aires, 1425 ARGENTINA

*** REPLACE THIS LINE WITH YOUR MESSAGE ***

-----------------------------

From: "D.Rorke" <der@sfmag.uucp>
Subject: Re: wakeup() race condition. (theory)
Date: 30 Nov 88 19:38:53 GMT
To:       unix-wizards@sem.brl.mil

> > Theory:
> > Sleep & wakeup both call spl6() to ensure secure access to
> > the process queues, (Well, this is not theory, the calls are
> > there...) and it is possible for the driver's device to 
> > interrupt as a wakeup() is running, isn't it ?
> > 
> > As this driver (as SCO xenix serial driver) is running with
> > prio 7, it's not blocked by spl6() and then it may interfere
> > with the running wakeup by, say, runnig another wakeup.
> > 
> > Solution: (?)
> > Not to call any wakeup at prio 7, that is, put every driver
> > interrupt routine that calls wakeup at prio 6 or below.
> > 
> > I would be glad to hear some guru opinion on the topic.
> 
> 
> Arghh.
> 
> Most current implementations of wakeup() are not reentrant.  I assume
> yours is not if it's bothering to do an spl6().  Non reentrant
> wakeup() implementations should set the interrupt level to the highest
> possible level while executing in a critical section.  As you noted,
> a wakeup() that sets some intermediate interrupt level can be 
> interrupted by an interrupt handler that could potentially call wakeup().
> This could cause the problem you observed.  It could also panic your
> system if the sleep queues are implemented as linked lists.
> 
> The solution you propose above is OK but a better solution (if you have
> source) is to fix wakeup() to set the highest interrupt level supported
> by the hardware.
> 
> 
> Dave Rorke
> attunix!der
> 
> 
> > -- 
> > Carlos G. Mendioroz  <tron@mrecvax.mrec.ar>  
> > Work: +54 (1) 313-8082  Fax: +54 (1) 311-1249
> > Home: +54 (1) 71-3473 ; Malabia 2659 11 B, Buenos Aires, 1425 ARGENTINA
> 


A clarification of my response above.  I said that the solution
that Carlos proposed was OK.  It is not however, sufficient to simply
set the interrupt priority level low before calling wakeup in the
interrupt routine, if the device interrupts at a level greater than
the level set in wakeup().  For example, in the case he cites above
you couldn't just set the interrupt level down to 6 at the beginning
of the serial driver interrupt routine if the hardware interrupt
actually comes in at level 7.  This won't solve the problem and
can create additional problems because the interrupt routine itself
may not be reentrant, and setting the level of the interrupt routine
lower than the level of the corresponding hardware interrupt could
cause the interrupt routine to be re-entered.

What you can do (assuming you can't fix wakeup) is make sure you
don't have any devices configured on your system which:


a) interrupt at a level greater than the level set in wakeup()

and
 
b) invoke interrupt handlers that call wakeup()


Of course similar problems can exist with any kernel function
that manipulates global data without blocking all interrupts
that could result in interrupt handlers manipulating the
same global data.


Dave Rorke
attunix!der

-----------------------------

From: Leslie Mikesell <les@chinet.chi.il.us>
Subject: Re: ioctl in perl (was: using System V 'cu')
Date: 30 Nov 88 16:53:25 GMT
To:       unix-wizards@sem.brl.mil

In article <3605@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes:
>: How about adding ioctl() to perl so we can use it instead?

>Er, um, that's kinda hard.  But I been thinkin' about it.

I was just thinking in terms of being able to dial out a tty port and
chat and/or exec some file transfer protocol (with uucp compatible lock
files, etc.)  For that purpose it might be easier to build in "stty" instead
of the full ioctl() functionality with the associated problem of undefined
structs.

However, perhaps I should ask your opinion on a "higher-level" approach.
What would you do if you did not have "rsh" and needed similar functionality
over dial-up or direct serial lines with some unix, some non-unix machines.
I'm using various versions of kermit for some of this, especially exchanging
files with a VM/CMS host where nothing else works, but I'm not entirely
satisfied with it.  Should I be looking at SLIP and something to emulate
rsh under SysV, or a wrapper around zmodem protocol (this may need to
run over a satellite connection), or fixing kermit to do what I want, or...?

Les Mikesell

-----------------------------

From: "Brandon S. Allbery" <allbery@ncoast.uucp>
Subject: Re: Predictable
Date: 1 Dec 88 00:15:35 GMT
Followup-To: comp.unix.wizards
To:       unix-wizards@sem.brl.mil

As quoted from <4271@encore.UUCP> by bzs@encore.com (Barry Shein):
+---------------
| From: allbery@ncoast.UUCP (Brandon S. Allbery)
| >...But the network entry point to sendmail is
| >via a particular Internet port; while a random user cannot alter the shell
| >for another user in /etc/password and cannot replace /usr/lib/uucp/uucico
| >with another program (or so we hope), if the SMTP port weren't root-only
| >*any* user could arrange for their own program to listen on the SMTP port
| >and wreak all kinds of havoc on other systems.  Or at minimum could read
| >anyone's incoming net mail.  Fun, eh?
| 
| In the first place that's one big *IF* (*IF* the SMTP port weren't
| root-only...) If a user can bypass root security on the system why is
| your main concern that they might intercept someone's incoming mail?
| Of course they can, they can just 'cat /usr/spool/mail/yournamehere'
| and delete what they want etc, why bother with the SMTP port?
+---------------

The question was why the SMTP port *was* root-only.

+---------------
| And what kind of havoc exactly can someone wreak on other systems by
| listening for incoming mail connections? I mean something peculiar to
| this ability and, what the hell, something they can't do otherwise via
| root permissions since that's a pre-requisite.
+---------------

Sorry.  Dumb mistake.  It didn't occur to me until a few days ago, in
conjunction with a *different* network protocol, that there was no reason
for SMTP commands to be bidirectional.  (I.e. the fact that you can transmit
SMTP *commands* to a program listening on port 25 doesn't mean that the
receiving program can then transmit another SMTP command [e.g. DEBUG]
*back*.)

++Brandon
-- 
Brandon S. Allbery, comp.sources.misc moderator and one admin of ncoast PA UN*X
uunet!hal.cwru.edu!ncoast!allbery  <PREFERRED!>	    ncoast!allbery@hal.cwru.edu
allberyb@skybridge.sdi.cwru.edu	      <ALSO>		   allbery@uunet.uu.net
comp.sources.misc is moving off ncoast -- please do NOT send submissions direct
      Send comp.sources.misc submissions to comp-sources-misc@<backbone>.

-----------------------------

From: "Brandon S. Allbery" <allbery@ncoast.uucp>
Subject: Re: what is the 'l' permission?
Date: 1 Dec 88 00:22:29 GMT
Followup-To: comp.unix.questions
To:       unix-wizards@sem.brl.mil

As quoted from <951@vsi.COM> by friedl@vsi.COM (Stephen J. Friedl):
+---------------
> (re: the "l" mode bit in SVR3.2 and mandatory/advisory file locking)
| 
| I'm speculating on this part, but I guess that setting the `l' mode
| is required because the vast majority of programs don't use locking,
| and the overhead required on each read/write call is probably too much.
| Setting the lock bit probably enables this checking.
+---------------

No, it's because advisory file locking is the SVR3 standard, but mandatory
file locking was in Xenix.  So UNIX apps use standard file locking and
migrated Xenix apps should set the "l" bit in order to work correctly.

I dunno, the whole thing seems a bit klugey to me.

++Brandon
-- 
Brandon S. Allbery, comp.sources.misc moderator and one admin of ncoast PA UN*X
uunet!hal.cwru.edu!ncoast!allbery  <PREFERRED!>	    ncoast!allbery@hal.cwru.edu
allberyb@skybridge.sdi.cwru.edu	      <ALSO>		   allbery@uunet.uu.net
comp.sources.misc is moving off ncoast -- please do NOT send submissions direct
      Send comp.sources.misc submissions to comp-sources-misc@<backbone>.

-----------------------------

From: Dan Schlitt <dan@ccnysci.uucp>
Subject: Re: Re: The Internet Virus--Another issue
Date: 30 Nov 88 15:02:51 GMT
Posted: Wed Nov 30 10:02:51 1988
To:       unix-wizards@sem.brl.mil

In article <4470010@hpindda.HP.COM> marcel@hpindda.HP.COM (Marcel Burlet) writes:
:/ kai@uicsrd.csrd.uiuc.edu /  8:44 pm  Nov 17, 1988 /
:>(Some) other manufacturers are doing something about it.
:>Sequent mailed a shell script to patch sendmail to disable debug.
:>Alliant did one better.  They have debug disabled in the sendmail they
:>distribute.
:
:HP also has debug disabled in the distribution.  (Guess when I found this
:out.  Right, *after* getting the scare of my life !)
:
I'm still waiting for Celerity's new parent to do something.

But there is really more to this than sendmail debug.  After a bit of
fussing I got adb to fix sendmail on the Celerity.  I haven't seen a
method for using adb to fix fingerd and ftpd.  They need fixing too.
Before patting too many vendors on the back for fixing things (or
distributing safe versions) let's see them fix the harder problems.
-- 
Dan Schlitt                        Manager, Science Division Computer Facility
dan@ccnysci                        City College of New York
dan@ccnysci.bitnet                 New York, NY 10031
                                   (212)690-6868

-----------------------------


End of UNIX-WIZARDS Digest
**************************

postmaster@sandia.gov (SMTP MAILER) (10/13/89)

 ----Mail status follows----
Have been unable to send your mail to <omalley%hotair@decwrl.dec.com>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 12 Oct 89 03:44:00 MDT
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V8#090
To: "omalley" <omalley%hotair@decwrl.dec.com>

Return-Path: <incoming-unix-wizards-request@sandia.gov>
Received: from SEM.BRL.MIL by sandia.gov with SMTP ; 
          Thu, 12 Oct 89 03:34:01 MDT
Received: from SEM.BRL.MIL by SEM.BRL.MIL id aa20946; 12 Oct 89 2:56 EDT
Received: from sem.brl.mil by SEM.BRL.MIL id aa20799; 12 Oct 89 2:45 EDT
Date:       Thu, 12 Oct 89 02:45:23 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V8#090
Message-ID:  <8910120245.aa20799@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Thu, 12 Oct 1989              V8#090

Today's Topics:
                               Re: ls -A
              How Do I Check Code Compilation Consistency?
                               Re: MUSBUS
          Re: ls -A - should be easier than this (and it was)
              Re: Can directory files have holes in them ?
                       Re: UNIX history made easy
            vmunix: stropen: out of streams in SunOS 4.0 ??
            Re: UNIX-like crypt function/crypt() outside USA
              Re: Job Control (a la csh/ksh) from within C
                       Re: UNIX history made easy
             A little salve (Re: Is there an FSDB Manual?)
                       Re: UNIX history made easy
                    timeout command in shell script!
              Re: Job Control (a la csh/ksh) from within C

-----------------------------------------------------------------

From: Doug Gwyn <gwyn@smoke.brl.mil>
Subject: Re: ls -A
Date: 11 Oct 89 07:08:02 GMT
To:       unix-wizards@sem.brl.mil

In article <17118@rpp386.cactus.org> jfh@rpp386.cactus.org (John F. Haugh II) writes:
>Xenix is -not- UNIX.  BSD 4.x is -not- UNIX.  Nor are the remainder
>of the things listed above which can't legally call themselves UNIX.

BSD predates the SVID, SVVS, and rules about calling the modified AT&T
software (that's what BSD basically is) "UNIX".

The latest release of Xenix is called UNIX System V Release 3.2.

Besides, recall what Humpty Dumpty said about who's master..

-----------------------------

From: Michael D Stiber <stiber@maui.cs.ucla.edu>
Subject: How Do I Check Code Compilation Consistency?
Date: 11 Oct 89 06:40:09 GMT
Sender: news@cs.ucla.edu
To:       unix-wizards@sem.brl.mil


We have a rather large software project, in which there are many files
divided among several directories, each directory with its own
Makefile.  Definitions for CFLAGS, etc are made in a main Makefile,
and passed along to subdirectory Makefiles.  The problem is this:
there are several compilation options that one may choose, and we must
be sure that all files are compiled with the same options.  To
complicate things, if different files are compiled with different
options, no obvious errors may result -- the errors are quite likely
to be very subtle, but fatal nonetheless.

To complicate things even further, this project will be used by others
with less knowledge of the inner workings of the code.  They will most
likely be adding their own modules to it.  Any errors introduced by
inconsistent compilation will be very difficult for them to track down
(difficult for us to track down, even).

So, is there any good way to do some sort of consistency checking,
either at link time or run time?  One idea I had was to have a header
file that is included in every source file, which would stick a static
string in the object code that says the file name and the compilation
options that were used.  Then, at run time, the program could grep for
all of those strings in its own object code, and check to make sure
they were consistent.  Is that a good approach?  A stupid, clumsy
approach?  An approach unlikely to be portable from one version of
UNIX to another?  Any better ideas?

I'd really appreciate any pointers or ideas that anyone could give me.
Thanks!!
			    Michael Stiber
   stiber@cs.ucla.edu                  UCLA Computer Science Dept.
   ...{ucbvax,ihpn4}!ucla-cs!stiber    Machine Perception Laboratory
                                 3564 Boelter Hall,Los Angeles, CA 90024

-----------------------------

From: Ken McDonell <kenj@yarra.oz.au>
Subject: Re: MUSBUS
Date: 11 Oct 89 04:59:33 GMT
To:       unix-wizards@sem.brl.mil

In article <4034@phri.UUCP> roy@phri.UUCP (Roy Smith) writes:
>
> 	A computer salesman was talking to me this morning about something
> called MUSBUS.  I vaugely remember hearing about it being some sort of
> benchmark for multi-user Unix systems, simulating some sort of "average"
> multiuser workload.  Anybody know anything about it? ...

MUSBUS (Monash University Software for Benchmarking Unix Systems) is
a synthetic multi-user benchmark in which the user workload profile
is intended to be one of the input parameters.  It was originally designed
to assist in comparative performance evaluations during equipment
acquistions.

Here is the standard "glossy" availability blurb I send out ...

    The MUSBUS source is in the public domain, distributed via the
    USENET newsgroup comp.sources.unix as follows
	    Version 5.0	volume 11, issues 29-32
	    Version 5.2	volume 12, issues 72-74
    You will need both, as the 5.2 distribution is an upgrade kit that
    assumes you already have Version 5.0.

    There is a MUSBUS mailing list that is used to distributed an infrequent
    Newsletter containing items of interest to those using MUSBUS, or related
    performance analysis tools.  If you'd like to join the mailing list
    send an e-mail request to kenj@yarra.oz.au

I am currently working on Version 6.1 with some scaling and normalization
enhancements, and additional "canned" workloads.

> ... Is there some
> repository of MUSBUS ratings for various machines somewhere?

Yes, I have them.  I do not distribute them, because

1. Unlike some others (dhrystone, AIM User Rating, ...) I have no faith
   in ``single figure of merit'' numbers for serious performance analysis.

2. The default workload will help you select the correct machine for Monash's
   Computer Science Department, circa 1982.  The relevance for others is
   questionable.

3. Unlike the pedlars of some other commercially available performance
   numbers, I am not interested in old numbers.  Today's Unix version and
   C compiler will deliver very different performance to yesterday's,
   even from the same vendor and on the same hardware (R&D folks do address
   performance issues in shipped product!).

4. If you are interested in multi-user performance for a particular
   application profile, build a workload and ask the vendors to run MUSBUS
   using YOUR workload.  Software engineering and portability issues have
   been addressed to the extent that this is not an onerous request.
   
The SPEC members have expressed some interest in MUSBUS, anyone from
there care to comment?

Disclaimer: I now work for Pyramid Technology, not Monash University, but
	    as always I speak for myself alone.

-----------------------------

From: Dick Dunn <rcd@ico.isc.com>
Subject: Re: ls -A - should be easier than this (and it was)
Date: 11 Oct 89 05:34:56 GMT
To:       unix-wizards@sem.brl.mil

General discussion is about trying to get ls to show files beginning with
 ., without getting . and ..

I remember that V7 *did* give files with names beginning with ".".  I
remember that this went away somewhere down the road...BSD let us ask for
it with -A, which Sys V doesn't implement.  I also remember a peek into the
Sys V source at some point which said that there's a compilation option to
ls which will give the dot-prefixed names.

so...mutter, grumble...I used to have it, then I could ask for it, now it's
there but I can't get at it.  Is dis progress?  I dunno, I don' tink so.
-- 
Dick Dunn     rcd@ico.isc.com    uucp: {ncar,nbires}!ico!rcd     (303)449-2870
   ...No DOS.  UNIX.

-----------------------------

From: John Bruner <bruner@uicsrd.csrd.uiuc.edu>
Subject: Re: Can directory files have holes in them ?
Date: 11 Oct 89 13:15:34 GMT
Sender: News <news@ux1.cso.uiuc.edu>
To:       unix-wizards@sem.brl.mil

In article <20044@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes:
>The original question was why dump is careful not to look at holes
>in directories.  The only possible answer is `paranoia'.

The paranoid code in dump and the kernel was added because of a
problem I ran into at Purdue on either a V7 PDP-11 or 4.1BSD VAX
(probably an 11/70) several years ago.  A hardware problem caused
a block pointer in a directory inode to be zeroed.  (I do not
remember the exact circumstances, except that it was a hardware
problem and it did not totally destroy the disc.)  "fsck" passed
the filesystem without a complaint, but any attempt to access the
directory (which I recall was something innocuous like "/usr/bin")
caused a panic.

In those days I believe that namei() did something like

	bp = bread(ip->i_dev, bmap(ip, lbn, B_READ));

The bug was that namei() didn't check whether bmap() returned -1
because holes in directories were "impossible".  My fix was to report
the hole on the console and allocate a new block if the filesystem
was mounted read/write; otherwise, it just skipped to the next block.
As I recall, "fsck" had code which checked for holes in files, but it
was commented out.  I turned on the check for directories.
I sent mail to Berkeley, and they integrated these changes into the
4.2BSD filesystem code (although they removed the code which filled
in the hole).
--
John Bruner	Center for Supercomputing R&D, University of Illinois
	bruner@uicsrd.csrd.uiuc.edu	(217) 244-4476	

-----------------------------

From: ari@kolmogorov.physics.uiuc.edu
Subject: Re: UNIX history made easy
Date: 11 Oct 89 16:41:18 GMT
Nf-ID: #R:rpp386.cactus.org:17085:kolmogorov:8600002:000:345
Nf-From: kolmogorov.physics.uiuc.edu!ari    Oct 10 04:29:00 1989
To:       unix-wizards@sem.brl.mil


In my field, physics, I don't know every Nobel prize lauriate,
(sure, I know many, but not near most).  There are some
who won, that I can't remember what for, and then there
are some physicist who didn't win, that I think have.  However,
this doesn't seem to interfere with doing physics.  Oh well, 
I guess I'm not a scientist after all.

ari

-----------------------------

From: Eric Ho <eho@clarity.princeton.edu>
Subject: vmunix: stropen: out of streams in SunOS 4.0 ??
Date: 11 Oct 89 17:34:15 GMT
Sender: news@brunix.uucp
To:       unix-wizards@sem.brl.mil

Has anyone out there seen such things before ?

I keep getting these "vmunix:  stropen: out of streams" messages on my Sun-4
server. We are running SunOS 4.0 on the entire net.  The server is a
Sun-4/280S-24 running GENERIC kernel. It usually happens when we've a lot of
users login to the server or when the load of the server is high.  The server
has a standard Eagle & a Hitachi DK15 -- both of them hooked off a Xylogics
451.  Other things on the server include a 1/4-inch scsi cartridage tape drive
and an ALM-1 board.  And I've already allocated over 35 meg of swap for the
server.

My initial guess is that there is something weird with the kernel since there
are ample of swap space & ram (24 meg) on this server.

Here is an excerpt from /var/adm/messages :-
==========================================
Oct 11 11:46:46 clarity vmunix: stropen: out of streams
Oct 11 11:47:40 clarity vmunix: stropen: out of streams
==========================================

Any pointers/info would be much appreciated.
--

Eric Ho  
Princeton University
eho@confidence.princeton.edu

-----------------------------

From: "Mark J. DeFilippis" <mark@promark.uucp>
Subject: Re: UNIX-like crypt function/crypt() outside USA
Date: 11 Oct 89 04:01:29 GMT
Followup-To: poster
Keywords: crypt unix NSA export
To:       unix-wizards@sem.brl.mil

In article <750@imuse.uucp>, ed@imuse.uucp (Ed Braaten) writes:
> Funny thing!  The SCO Xenix machine I play on at home has the crypt()
> facility on it, and I live in Dachau, (West) Germany.  How did it get 
> here?  I bought my Xenix in the US while back home on vacation,
> installed it on my portable, and then lugged the portable back
> with me here to Germany...
> 

Whats with all the cross posting?  WHat a waste of bandwidth.
Was this a topic in all these groups? I have been reading them for weeks
now, and I don't remember seeing this in all three groups?

Great, well now we know that Crypt is out!  What a shock!  I hope I can
call my local secret service office before you launch all the missles
on the US of A's Trident submarines.

-- 
Adelphi University, Garden City, NY 11530                   (516) 663-1170
Department of Mathematics and Computer Science
                                 markd@adelphi.UUCP  or  mark@promark.UUCP
                      UUCP:      ...philabs!sbcs!bnlux0!adelphi!markd

-----------------------------

From: Jim Frost <madd@bu-cs.bu.edu>
Subject: Re: Job Control (a la csh/ksh) from within C
Date: 11 Oct 89 19:54:34 GMT
Followup-To: comp.unix.wizards
To:       unix-wizards@sem.brl.mil

In article <20040@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes:
|One of the things that bothers me about many of these fancy windowing
|systems is that there is no way to dial in and use them.

See "At Home With X11/NeWS" in the June 1989 USENIX Proceedings.  One
of the things that bothers me about most windowing systems is that
they need a lot of communication between server/client, which is
painful over slow connections.  The NeWS technique is better since
many operations are local to the server and need no communication at
all.  I wouldn't have picked postscript for my language, though.

Of course you still need that bitmapped terminal at home for that, but
then again we all have one, right ;-).

jim frost
software tool & die
madd@std.com

-----------------------------

From: Jim Frost <madd@bu-cs.bu.edu>
Subject: Re: UNIX history made easy
Date: 11 Oct 89 20:26:19 GMT

9@smoke.BRL.
Followup-To: comp.unix.wizards
To:       unix-wizards@sem.brl.mil

In article <11239@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes:
|The point is, if you don't know who Backus, Dijkstra, Hoare, Knuth,
|Thompson, Wirth, etc. are and what their major accomplishments were,
|you shouldn't advertise yourself as a professional computer scientist.

You are mistaken.  While I admit that knowledge of what they have done
will aid you in being a computer scientist, that knowledge will not
make you one and lack of it does not necessarily degrade your ability
(although it probably will, especially for certain applications).

This is just another lesson in history: you can be more effective if
you know of the successes and failures of your predecessors, but you
can get the same job done that they did without knowledge of them --
it may just take a lot longer.  I only wish that politicians would
learn this lesson.

jim frost
software tool & die
madd@std.com

-----------------------------

From: Jim Frost <madd@bu-cs.bu.edu>
Subject: Re: UNIX history made easy
Date: 11 Oct 89 21:03:43 GMT

9@smoke.BRL.
Followup-To: comp.unix.wizards
To:       unix-wizards@sem.brl.mil

In article <17123@rpp386.cactus.org> jfh@rpp386.cactus.org (John F. Haugh II) writes:
|On the other hand, anyone who hasn't read ``The Mythical Man Month''
|should be fired.

Agreed.  Learn the mistakes from someone who had to make them the hard
way.

jim frost
software tool & die
madd@std.com

-----------------------------

From: "Blair P. Houghton" <bph@buengc.bu.edu>
Subject: A little salve (Re: Is there an FSDB Manual?)
Date: 12 Oct 89 01:03:33 GMT
Followup-To: comp.unix.wizards
To:       unix-wizards@sem.brl.mil

In article <1288@sdcc13.ucsd.EDU> pa1034@sdcc13.ucsd.edu.UUCP (The Evil(tm) One) writes:

Whoever chose your name chose well...

>Any program which is publicly executable can potentially be a security
>hole.  A program can be non-SUID and still have code like:
>	{
>		exec shell to cp /bin/sh /tmp/sushi.
>		Now that the /tmp/sushi is owned by current owner,
>		  do a chmod 6777 on it.
>	}  
>Surprise! the user now has the privileges of whoever runs this program.
>if root runs it, BIG SURPRISE!!!

It can't be stopped, no.  There is a way, though, to check for the
results of such things.  (This is paraphrased from the security chapter
in Fiedler and Hunter, UNIX(tm) System Administration, Hayden,
Indianapolis, 1986.)

	find / -perm -4000 -exec ls -ldg \{\} \;

will find all files with the setuid bit set.

I do it every once in a while just to see what's up, and
it only returns a few dozen lines.  If you really want to
check, you should probably run every one of the listed
programs to make sure it's still the program it's supposed
to be.

Then again, you could just diff it with a master list you
keep locked away somewhere, then have it mail you and
pull the fire alarm if anything ever changes...

				--Blair
				  "Crank, crank, crank..."

-----------------------------

From: Doug Gwyn <gwyn@smoke.brl.mil>
Subject: Re: UNIX history made easy
Date: 12 Oct 89 02:19:28 GMT
To:       unix-wizards@sem.brl.mil

In article <8600002@kolmogorov> ari@kolmogorov.physics.uiuc.edu writes:
>this doesn't seem to interfere with doing physics.  Oh well, 
>I guess I'm not a scientist after all.

If you had no idea who Newton, Einstein, Heisenberg, or Feynman were,
then yes I would have to say you weren't qualified as a physicist!

Remember, this thread started when somebody reported that his colleague,
who billed himself as a professional computer scientist, said that he
had no idea who Ken Thompson is or what he had done.  To me (and others)
that is comparble illiteracy to a "physicist" not knowing the names I
mentioned above.

Nobel prizes, Turing awards, etc. are of course only loosely correlated
with genuinely great names in their respective fields.

-----------------------------

From: Maarten Litmaath <maart@cs.vu.nl>
Subject: timeout command in shell script!
Date: 3 Oct 89 06:00:41 GMT
To:       unix-wizards@sem.brl.mil

: This is a shar archive.  Extract with sh, not csh.
: This archive ends with exit, so do not worry about trailing junk.
: --------------------------- cut here --------------------------
PATH=/bin:/usr/bin:/usr/ucb
echo Extracting 'timeout'
sed 's/^X//' > 'timeout' << '+ END-OF-FILE ''timeout'
X#!/bin/sh
X# @(#)timeout 1.0 89/10/03 Maarten Litmaath
X
Xprog=`basename $0`
Xusage="Usage: $prog <timeout in seconds> <command>"
X
Xcase $1 in
X[0-9]*)
X	timeout=$1
X	shift
X	;;
X*)
X	echo "$usage" >&2
X	exit 2
Xesac
X
Xcase $# in
X0)
X	echo "$usage" >&2
X	exit 2
Xesac
X
Xexec 3>&2 2> /dev/null
X
Xtrap 'echo TIMEOUT >&3; exit 1' 1
Xtrap '' 14
X
Xsh -c '(sleep '$timeout'; kill -1 '$$'; kill -9 $$) & exec "$@" 2>&3' \
X	"$prog" "$@"
X
Xtrap '' 1
Xkill -14 -$$
X
Xexit 0
+ END-OF-FILE timeout
chmod 'u=rwx,g=rx,o=rx' 'timeout'
set `wc -c 'timeout'`
count=$1
case $count in
440)	:;;
*)	echo 'Bad character count in ''timeout' >&2
		echo 'Count should be 440' >&2
esac
exit 0
-- 
   Did Andy Tanenbaum get his programming   |Maarten Litmaath @ VU Amsterdam: 
instruction from a Cereal box?  (Sam McCrea)|maart@cs.vu.nl, mcvax!botter!maart

-----------------------------

From: Henry Spencer <henry@utzoo.uucp>
Subject: Re: Job Control (a la csh/ksh) from within C
Date: 12 Oct 89 02:24:07 GMT
To:       unix-wizards@sem.brl.mil

In article <2491@ibmpa.UUCP> jsalter@slo.UUCP (James Salter) writes:
>>[...] You've got other windows, remember ...
>Sure.  And on an 11" monitor, those windows will look like stamps.

Well, if you *insist* on having them all on the screen at a time, of
course they will.  Particularly on a 24x80 terminal, you wouldn't.
Call them up when you need them.
-- 
A bit of tolerance is worth a  |     Henry Spencer at U of Toronto Zoology
megabyte of flaming.           | uunet!attcan!utzoo!henry henry@zoo.toronto.edu

-----------------------------


End of UNIX-WIZARDS Digest
**************************

postmaster@ccf3.nrl.navy.mil (SMTP MAILER) (11/28/89)

 ----Mail status follows----
Have been unable to send your mail to <whitis@rira.nrl.navy.mil>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 28 Nov 89 03:28:00 EST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#002
To: "whitis" <whitis@rira.nrl.navy.mil>

Return-Path: <@nrl3.arpa:unix-wizards-request@sem.brl.mil>
Received: from nrl3.arpa by nrl3.arpa with SMTP ; Tue, 28 Nov 89 03:28:04 EST
Received: from SEM.BRL.MIL by nrl3.arpa with SMTP ; Tue, 28 Nov 89 03:08:38 EST
Received: from SEM.BRL.MIL by SEM.BRL.MIL id aa01802; 28 Nov 89 2:55 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa01759; 28 Nov 89 2:45 EST
Date:       Tue, 28 Nov 89 02:45:21 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#002
Message-ID:  <8911280245.aa01759@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Tue, 28 Nov 1989              V9#002

Today's Topics:
                      How to maintain OO project?
                          Re: Watchdog program
                             Re: of course!
         How do you copy multiple dump tapes to one dump file?
                         uucico hangup problem
                 Re: Why isn't argv[argc]==(char *)0 ?
                   Re: Indirect system call (WARNING)
                       Re: FCC doing it again...
                      Re: Question about GETOPT(3)

-----------------------------------------------------------------

From: Terence Kwan <nctkwan@watdragon.waterloo.edu>
Subject: How to maintain OO project?
Date: 27 Nov 89 07:46:38 GMT
To:       unix-wizards@sem.brl.mil

Hello, I have some problem with 'ar'. I just wonder is there anyway to
change the filename limit to be more than 15 characters. I am doing a
very big project. The project is consisted a driver and about 20 set
of modules. I have about 30 directories. Each directories contain a
set of modules and we are using the same filename name for each
module within different directories. For example, in each directory,
we have a file called "init.c" to initialize the module. The problem
is that we want to create a library file for the project and procedure
a big project.a. However, we cannot use the filename in each module as
the object filename because of the duplication. We are thinking of add
the path name before the object file, for example, "path_init.o".
However, it will excess the limit of 15 characters. We had also
thought about numberize the object file but it is not that easy to
maintain the project. Is there any better way to do it?

Thank you in advance.

Terence Kwan
-- 
Terence Kwan ----------------- [ Together, we can build a better China. ]
nctkwan@watdragon.waterloo.edu ------------------------------------------
University of Waterloo, Computer Science --------------------------------
Office Automation Lab ---------------------------------------------------

-----------------------------

From: "Jonathan I. Kamens" <jik@athena.mit.edu>
Subject: Re: Watchdog program
Date: 27 Nov 89 12:38:43 GMT
Sender: News system <news@athena.mit.edu>
To:       unix-wizards@sem.brl.mil

In article <21529@adm.BRL.MIL> moore@ncsc.navy.mil (Moore) writes:
>It seems like a program such as this should be very common:  does anyone have
>a program (source, too, please!) to monitor terminal inactivity and shut down
>any processes idle for a certain amount of time?  It would have to detect
>processes that indicate Idle but really aren't (like a Kermit file transfer).

  The comp.sources.unix archives on uunet.uu.net (and, presumably,
whereever else they are archived) contains several such programs.  A
quick scan for "idle" in the c.s.u index reveals:

volume 3:
  idledaemon		Yet another idledaemon
volume 7:
  idle.users		A simple BSD idle-users daemon
  untamo2		Log out idle users
  untamo3		Log out idle users (untamo revised)

There may be others I've missed.

  You have to be careful when mentioning idle daemons on the net,
because for some reason some people feel very strongly that idle
daemons are a BAD idea, and will explain their opinions at length at
the least provocation.  This inevitably leads to a heated debate (read
"flame") which usually repeats to a tee the last debate on the same
subject.

  (Only 1/2 :-)

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik@Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710

-----------------------------

From: Richard Tobin <richard@aiai.edinburgh.ac.uk>
Subject: Re: of course!
Date: 25 Nov 89 16:10:24 GMT
To:       unix-wizards@sem.brl.mil

In article <11674@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes:
>Many implementations have severe constraints on stack size.

Some at least.

>For example, on Gould PowerNode series running UTX-32 (based on 4.3BSD),
>the stack size is fixed at link time, typically only a few kilobytes.  
 ...
>The three major alternatives are:

(4) Don't buy such machines.  We all know that all the world is not a vax,
    and that we mustn't dereference null pointers, but some machines just
    aren't worth the pain, given that there are plenty of sane systems
    available.  In my opinion, Goulds are among them.

-- Richard

-- 
Richard Tobin,                       JANET: R.Tobin@uk.ac.ed             
AI Applications Institute,           ARPA:  R.Tobin%uk.ac.ed@nsfnet-relay.ac.uk
Edinburgh University.                UUCP:  ...!ukc!ed.ac.uk!R.Tobin

-----------------------------

From: Scott Simpson <simpson@trwind.uucp>
Subject: How do you copy multiple dump tapes to one dump file?
Date: 27 Nov 89 18:48:47 GMT
Keywords: dump format, copying tapes
To:       unix-wizards@sem.brl.mil

Sun OS 3.4, Sun 3/280, Exabyte is /dev/rsmt0 and /dev/nrsmt0

I am trying to copy a set of dump tapes in dump format from a magtape
drive to an Exabyte.  The magtape dump tapes consist of three tapes 
consisting of one file system.  I want to dump all three tapes to one
file on the Exabyte.  I can't use dd because it would cease after the first
tape.  Would the following work:

	% dd if=/dev/rmt8 of=/dev/nrsmt0 bs=10k
	% mt -t /dev/nrsmt0 bsr
	% dd if=/dev/rmt8 of=/dev/nrsmt0 bs=10k
	% mt -t /dev/nrsmt0 bsr
	% dd if=/dev/rmt8 of=/dev/nrsmt0 bs=10k

That is, are the files on the multiple dump tapes simply contiguous and
will backspacing one record back space past the end of tape mark?

Please reply to me directly. I don't normally read this newsgroup.
-- 
	Scott Simpson
	TRW Space and Defense Sector
	oberon!trwarcadia!simpson  		(UUCP)
	trwarcadia!simpson@oberon.usc.edu	(Internet)

-----------------------------

From: Scott Barman <scott@nastar.uucp>
Subject: uucico hangup problem
Date: 27 Nov 89 17:14:28 GMT
To:       unix-wizards@sem.brl.mil

I know this is a problem someone has seen before but I still need to ask
since it bit us during the long holiday weekend.

Let's start with the essentials -
Hardware: Sun 3/60
Operating System: SunOS 3.5  (no flames on not going to 4.0.*.  We have
	a good reason and if you want to hear it email me the request)
Modem: Telebit Trailblazer+ not connected to our PBX and connected to
	/dev/ttya out of the back of the box.
Local filesystem: /usr/spool is symbolicly linked to a directory on a
	disk that is local to the machine but is mounted via NFS on our
	internal network.

Problem: When I finally made it in this morning [:-)] I was doing my
usual checking to find that uucico was still running to the site we feed
news to at 2400 baud and has been executing since last Wednesday night! 
Mail to root, uucp, and daemon only spoke of files in the spool
directory being cleaned out but not of any problems (messages from
/usr/lib/uucp/uucp.night).  There were no auxilary logfile (LOG.*) and
the LOGFILE saved from last Wednesday only showed a REQUEST message
looking to copy a news batch to the remote system.  Doing a ps showed
uucico still running and the modem showed itself as being "off hook." 
No evidence of problems except there was no activity on the modem (e.g.
Tx and Rx LEDs were not blinking) and a uucico running for about 4-5
days.

HELP!  I need to find out how to prevent this from happening again!  If
knowing why it happens helps, fine!  But we are going to be closed the
last week of the year and I'm lible to take off for parts unknown and
would like to leave this machine unattended for that time.  Is there
something I can do?

Please email your response and if there is a significant request for
summaries, I will post one to the net.

All help is appreciated!

-- 
scott barman
{gatech, emory}!nastar!scott

-----------------------------

From: Guy Harris <guy@auspex.auspex.com>
Subject: Re: Why isn't argv[argc]==(char *)0 ?
Date: 27 Nov 89 23:32:18 GMT
Keywords: X/OS, Olivetti, LSX, coredump
To:       unix-wizards@sem.brl.mil

>>(I.e., unless you have to deal with an archaic UNIX or a Mutant UNIX
>>From Hell, you can count on argv[argc] == 0.)
>
>In X/OS, a SYSV/BSD hybrid operating system for the Olivetti LSX
>minicomputers, a reference to argv[argc] will make your program dump core.

If you mean "a *de*reference *of* 'argv[argc]' will make your program
dump core", that's true on Suns as well, and some other machines, since
they don't let you dereference null pointers.

If you mean "even trying to copy the (pointer) *value* somewhere else
causes a core dump", then I think the label "Mutant UNIX From Hell" is
well-deserved; I've nothing against, say, array bounds-checking, but
"argv" has "argc+1" elements, not "argc" elements - if Olivetti intends
to get POSIX or ANSI C support on the LSX, they'd better fix this....

-----------------------------

From: Dan Mick <dan@charyb.com>
Subject: Re: Indirect system call (WARNING)
Date: 27 Nov 89 22:38:22 GMT
Keywords: doesn't aways work
To:       unix-wizards@sem.brl.mil

In article <128380@sun.Eng.Sun.COM> lm@sun.UUCP (Larry McVoy) writes:
>[From Sun's syscall man page:
>BUGS
>     There is no way to simulate system calls such  as  pipe(2V),
>     which  return  values in register d1 on Sun-3 and Sun-4 sys-
>     tems or in register %edx on Sun386i systems.
>]
 

Pretty neat, since Sun-4 systems have no register named 'd1'...<sigh>...
(They probably mean %o1.)

-- 
 .sig files are idiotic and wasteful.

-----------------------------

From: "Conor P. Cahill" <cpcahil@virtech.uucp>
Subject: Re: FCC doing it again...
Date: 28 Nov 89 01:15:14 GMT
To:       unix-wizards@sem.brl.mil

In article <21536@adm.BRL.MIL>, AGRISCS@umcvmb.missouri.edu (Don Ingli) writes:
> Please allow me to express my displeasure with the FCC proposal
> which would authorize a surcharge for the use of modems on the
> telephone network. This regulation is nothing less than an
> attempt to restrict the free exchange of information among the
> growing number of computer users. Calls placed using modems
> require no special telephone company equipment, and users of
> modems pay the phone company for use of the network in the form
> of a monthly bill. In short a modem call is the same as a voice
> call, and should not be subject to any additional charges.

Not that I want to pay a surcharge, but...

A modem phone call is not the same as a voice phone call.  Modem calls are
continuously transmitting tones on the line, while a voice call has lots 
of periods of silence.  This makes modem calls harder to multiplex on the 
phone network than voice calls.


-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+

-----------------------------

From: Dave Fenske <davef@lakesys.lakesys.com>
Subject: Re: FCC doing it again...
Date: 28 Nov 89 00:25:42 GMT
To:       unix-wizards@sem.brl.mil

It appeared as though someone's 2 cents were being solicited, so why not mine.

The proposed modem charge is not the only item.  It seems some of the Bell
operating companies are now attempting to charge business rates for lines
connected to any bulletin boards.

The net effect of such things is to limit the free exchange of information.
Could it be that the FCC is being inspired?   I rather believe that these
actions stem from the desire of AT&T and the Bell operating companies to
firmly entrench themselves in the information selling business.  

p.s. appologies to those who are going to say "what the #$@& is this doing

-----------------------------

From: Peter da Silva <peter@ficc.uu.net>
Subject: Re: Question about GETOPT(3)
Date: 27 Nov 89 18:03:01 GMT
Followup-To: comp.unix.wizards
To:       unix-wizards@sem.brl.mil

[ I suggested &n refer to /dev/fd/n ]

> 	command1&command2

> is currently valid syntax in the bourne shell.

And it'd remain so. You might have problems if you have a program called
'1', '2', and so on. That's pretty unlikely.
-- 
`-_-' Peter da Silva <peter@ficc.uu.net> <peter@sugar.lonestar.org>.
 'U`  --------------  +1 713 274 5180.
"The basic notion underlying USENET is the flame."
	-- Chuq Von Rospach, chuq@Apple.COM 

-----------------------------


End of UNIX-WIZARDS Digest
**************************

postmaster@ccf3.nrl.navy.mil (SMTP MAILER) (01/12/90)

 ----Mail status follows----
Have been unable to send your mail to <whitis@rira.nrl.navy.mil>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 11 Jan 90 00:36:00 EST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#043
To: "whitis" <whitis@rira.nrl.navy.mil>

Return-Path: <@nrl3.arpa:unix-wizards-request@sem.brl.mil>
Received: from nrl3.arpa by nrl3.arpa with SMTP ; Thu, 11 Jan 90 00:34:42 EST
Received: from SEM.BRL.MIL by nrl3.arpa with SMTP ; Wed, 10 Jan 90 03:39:40 EST
Received: from SEM.BRL.MIL by SEM.brl.MIL id aa03862; 10 Jan 90 3:00 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa03781; 10 Jan 90 2:45 EST
Date:       Wed, 10 Jan 90 02:45:12 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#043
Message-ID:  <9001100245.aa03781@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Wed, 10 Jan 1990              V9#043

Today's Topics:
                     filenames with a '/'  -- help
                   Re: filenames with a '/'  -- help
                              yacc and lex
                 Re: GNU Emacs, memory usage, releasing
                        Re: fcntl/socket anomaly
          Re: How to delete a file with ^? chars in the name?
          Number of chars in input queue - terminal, keyboard
                   Re: C Documentation Utility Needed
Obtaining a unique, "unchangeable" number associated with an SGI workstation
        Re: new mscp code in Ultrix 3.1 (was Boot block trashed)
                Re: Access to UNIX-Related Publications
                     Wanted: fast tar across ether

-----------------------------------------------------------------

From: "Gregory S. Baber" <gregb@dowjone.uucp>
Subject: filenames with a '/'  -- help
Date: 8 Jan 90 20:28:44 GMT
To:       unix-wizards@sem.brl.mil

Hello,
	I moved some files from a Mac to a NeXT using a GatorBox,
and then took the NeXT off the network. Some of the files that were
on the Mac had a '/' as part of the actual filename. How do I delete
these from the NeXT now without reconnecting to the network? When I
try to delete the files by hand, the shell responds with "file does
not exist" because it interprets the '/' as a directory indicator.
I even tried to double quote the filename to no avail. Any ideas?

Thanks, gregb

-- 
Reply to: Gregory S. Baber		Voice:	(609) 520-5077
   Dow Jones & Co., Inc.		UUCP:	..princeton!dowjone!gregb
   Box 300				or	..uunet!warlock!gregb
   Princeton, N.J. 08543-0300		"So long, and thanks for all the fish"

-----------------------------

From: "seth.zirin" <szirin@cbnewsm.att.com>
Subject: Re: filenames with a '/'  -- help
Date: 9 Jan 90 18:20:31 GMT
To:       unix-wizards@sem.brl.mil

In article <646@warlock.UUCP> gregb@dowjone.UUCP (Gregory S. Baber) writes:
>and then took the NeXT off the network. Some of the files that were
>on the Mac had a '/' as part of the actual filename. How do I delete
>these from the NeXT now without reconnecting to the network? When I
>try to delete the files by hand, the shell responds with "file does
>not exist" because it interprets the '/' as a directory indicator.

You have several options:

1) reformat the disk (JUST KIDDING!!) :-)

2) fsck the filesystem.  some versions of fsck will not permit illegal
   characters in names.  if your version of fsck cannot fix it, complain
   to your vendor about the bug in their fsck.

3) use fsdb to locate and edit the disk block that contains the filename
   with the '/'.  Change the '/' to a more palatable character.
   WARNING: this is not for the weak-hearted!

4) copy everything else from the parent directory to a safe spot and
   iclear or unlink the parent directory and run fsck.  if the bad
   name is a file (as opposed to a subdirectory), fsck will copy it
   to the lost+found and give it a civilized name.  if you have a
   directory tree of bad subdirectory names, this will become a
   recursive process.

the above procedures assume that the filesystem is mounted/unmounted
appropriately.  when you're all done and you haven't roached the whole
filesystem or the entire disk, hold your head high; you've earned one
star towards becoming a wizard.

discussion of the other stars should be referred to /dev/null as we just
finished that topic.

Seth Zirin

-----------------------------

From: Chuck Cartledge <chuck@virgil.uucp>
Subject: yacc and lex
Keywords: yacc,lex,error checking
Date: 8 Jan 90 20:51:49 GMT
Followup-To: comp.lang.c
To:       unix-wizards@sem.brl.mil


Pardon the cross posting, but I'm not sure where the answer is for this
question.

I would like to use a yacc/lex generated program segment as a operator input
validation routine, rather then having to write my own from the ground up.
What I am trying to generate either automatically via yacc/lex or with only
minor manual mods, is a function that looks like this:

	valid_data (character_string, data_type, addr1, addr2, ...)

Is there a way to get something like this??

Any help would be appreciated.  Thanks.
-- 
Chuck Cartledge (804)498-1012 (voice-play)                 chuck@virgil.UUCP
EDO Corporation (804)424-1004 (voice-work)
Virginia Operations
814 Greenbrier Circle, Chesapeake Va.  23320

-----------------------------

From: Peter da Silva <peter@ficc.uu.net>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 22:07:52 GMT
To:       unix-wizards@sem.brl.mil

> >> I contend that in a "modern workstation environment" (e.g., Sun 3/60),
> >> a simple buffer gap method is preferred over both paged buffer gap and
> >> linked line.  I leave it as an excercise for the reader to figure out
> >> why.

> >I'm not sure this is a valid conclusion. If 75K is the optimal file size

> Where did this "75K" figure come from?

I honestly don't remember. It was mentioned by someone in this forum.

I do think, though, that for any given system there is such an optimal size.
It may be that on your workstation that size is measured in megabytes... on
others it may be a few K. I wonder how it feels on a NeXT that's paging over
the network or onto the OD?

> >for a buffer-gap solution, how about paged buffer-gap with 75K pages? Or
> >to add a bit of compromise with some of today's brain-dead architectures
> >perhaps 64K pages would work nearly as well.

> In particular, I have had no trouble editing multi-megabyte files in
> GNU Emacs on a Sun 3/280 w/8 MBytes of memory.

Having "no trouble" with something doesn't mean you have the optimal
solution. Just that you have *a* solution.
-- 
 _--_|\  Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \ Also <peter@ficc.lonestar.org> or <peter@sugar.lonestar.org>
\_.--._/
      v  "Have you hugged your wolf today?" `-_-'

-----------------------------

From: Jim Cathey <jimc@isc-br.isc-br.com>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 9 Jan 90 19:20:13 GMT
Followup-To: comp.editors
To:       unix-wizards@sem.brl.mil

>The better solution, made relatively easy by the reasonably modular and
>layered structure of GNU emacs, would be to accept The Emacs Cookbook
>recommendation (adopted by Jove and the MicroEmacs/Gnu family of editors) and
>implement a linked list system. I would suggest just reading (or map, on the
>operating systems that allow it) the file to be edited as a large lump of
>virtual address space, then building a linked list of pointers to lines
>therein, and then to allocate modified lines from ageneral purpose arena.
>Informing the OS of the peculiar access patterns would also help, if
>possible.

So long as line-oriented operation preserved the ability of Gnu Emacs
to edit binary files that have no 'lines' at all.  The MicroEmacs we
have here will choke on these (as does vi, ed, see, siv, and all the
other editors we have), and MicroEmacs' line orientation is so badly
implemented that if (at our site) the file is larger than about 50K it
is _faster_ to start emacs on the file than MicroEmacs.  MicroEmacs
starts faster, but it reads files _much_ slower (fgets,malloc,strcpy).

Somebody or other's master's thesis was on buffer styles (I got a copy with
my copy of MINCE a few years ago), and his conclusion was that the gap method
worked best.  That may have been on a machine that wasn't DPV, though.

Moving the gap by, say, 20 characters should affect at most two pages (four,
if you assume it straddles a page boundary on both ends but this is true for
any scheme and may be disregarded).  A block with a line pointer array might
also affect two pages (the block and the buffer array) so I don't offhand
see the advantage.  Jumping about wildly would touch a lot of pages, but the
assumption is that you work a lot in one place.  The gap approach makes it
very quick to _save_ files, so the auto-save feature is unobtrusive.  It would
be absolutely useless if it took 5-10 seconds to rearrange the line-pointer
and block mess to get it into savable form, or write a line at a time.

If realloc can't do the right thing it should be replaced by one that can.
I believe GNU isn't interested in supporting non-GNU machines (read VAX)
to the extent that it corrupts the architecture of the program.  I somewhat
agree with them in that broken environments shouldn't be catered to, but 
repaired instead.

It would be nice if emacs did sbrk- when it could.  In our environment, we
can also release holes in the _middle_ of the heap.  We added an additional
system call for it.  This gets pages out of the swap space, but they'll be
reallocated (and cleared to zero) if you touch in the hole.

We have a limited virtual address space (2M on some machines, 4M on most 
others) so GNU can't edit those really big log files.  I think only elle can
of the editors I've experienced.  I think it uses linked blocks.

GNU Emacs _is_ awfully large, though, but I haven't noticed any machine
eating behavior.  Of course, we have a lot of smaller machines here, so few
use it at once.  Far more noticible is simultaneous compiles.

+----------------+
! II      CCCCCC !  Jim Cathey
! II  SSSSCC     !  ISC-Bunker Ramo
! II      CC     !  TAF-C8;  Spokane, WA  99220
! IISSSS  CC     !  UUCP: uunet!isc-br!jimc (jimc@isc-br.iscs.com)
! II      CCCCCC !  (509) 927-5757
+----------------+
			"With excitement like this, who is needing enemas?"

-----------------------------

From: Chris Torek <chris@mimsy.umd.edu>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 9 Jan 90 08:24:01 GMT
To:       unix-wizards@sem.brl.mil

In article <129979@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>Those checks [applied by TIOCSPGRP] are inappropriate for the F_SETOWN.
>For example, POSIX insists that the tty in question be your controlling tty.
>That's both unecessary and unlikely for processes wanting SIGIO on a tty.

Ah: this is different from what you said (or at least, what I understood)
before.  Now you seem to mean `any process should be allowed to ask for
SIGIO on any file descriptor to which it can apply an fcntl, and should
receive SIGIO signals whenever it could read from / write to that descriptor.'

(This is a reasonable interpretation of what SIGIO should be, but would
require major kernel restructuring, since per-file-descriptor flags can
only be stored in a u. area.)

>Suppose I have process A and process B.  A does a F_SETOWN on some
>socket and then goes on, expecting a SIGIO at some later time.  B comes
>along, and also does a F_SETOWN on the same socket.  A has been
>robbed.

Ah.  This, of course, is a property of the shared-ness of descriptors.
A dup()ed descriptor (either with the dup() or dup2() system calls,
or simply shared across fork+exec) has only one underlying object,
and (for reasons having to do with the basic kernel structure) signals
have to refer to the underlying object%, hence are shared.

Fortunately, two different endpoints on a socket are not shared.  A
program (your `A') that passes its own socket endpoint to another program
(your `B') has explicitly---well, okay, implicitly---given control of
the socket to the second program.  For instance, `B' could issue a
shutdown on the socket as well.

Thus, I think this objection does not apply.  (It *does* apply to tty
devices.)

 -----
% Actually, they refer to the object underlying the underlying object,
  in the case of inodes; but this, at least, could be changed in
  principle.  (Thread a linked list of signal info through the file
  table.)  Then you have the problem of *giving up* SIGIO signals for
  a descriptor.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 9 Jan 90 21:40:16 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <21710@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
>In article <129979@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>>Those checks [applied by TIOCSPGRP] are inappropriate for the F_SETOWN.
>>For example, POSIX insists that the tty in question be your controlling tty.
>>That's both unecessary and unlikely for processes wanting SIGIO on a tty.
>
>Ah: this is different from what you said (or at least, what I understood)
>before.  Now you seem to mean `any process should be allowed to ask for
>SIGIO on any file descriptor to which it can apply an fcntl, and should
>receive SIGIO signals whenever it could read from / write to that descriptor.'

Well, while I agree that this would be nice, it's not at all what I
meant and I think you know it.  SIGIO is commonly applied to tty's.
The point you made about permission checks is bogus because POSIX won't
let you get SIGIO on anything but your controlling terminal if you
continue with this braindead implementation that calls TIOCSPGRP.

>>Suppose I have process A and process B.  A does a F_SETOWN on some
>>socket and then goes on, expecting a SIGIO at some later time.  B comes
>>along, and also does a F_SETOWN on the same socket.  A has been
>>robbed.
>
>Ah.  This, of course, is a property of the shared-ness of descriptors.

Not really.  If sockets can be named in the file system (Unix domain) then
you can get at it by opeing the file (like the printer for instance).

>A dup()ed descriptor (either with the dup() or dup2() system calls,
>or simply shared across fork+exec) has only one underlying object,
>and (for reasons having to do with the basic kernel structure) signals
>have to refer to the underlying object%, hence are shared.
>
>Thus, I think this objection does not apply.  (It *does* apply to tty
>devices.)

This is missing the point completely.  I don't care (and neither do
you) that cooperating processes can hurt each other (a new definition
of cooperating :-)  It's the tty and named socket case that's broken.


Let's take this offline, Chris - I think the horse is dead....
---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: currey tom 76327 <tcurrey@x102c.harris-atd.com>
Subject: Re: How to delete a file with ^? chars in the name?
Date: 9 Jan 90 14:22:36 GMT
Sender: news@trantor.harris-atd.com
To:       unix-wizards@sem.brl.mil


  You asked how to delete a file with deleted characters.  This depends
on the system you're using.  Here are 2 ways:

    Using the backslash for the meanings try:

            " rm \<DEL>\<DEL>\<DEL>H12.b "      {<DEL> is delete key}

    or last resort method

 	    Copy all other files into a temporary directory and 
            " rm -r <directory with bad file> " the copy them back
            after making a new directory.

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: How to delete a file with ^? chars in the name?
Date: 9 Jan 90 21:44:45 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <7711@unix.SRI.COM> ubi@ginger.sri.com (Ron Ueberschaer x4399) writes:
>I have a file which is named ^?^?^?H01.b (delete character?) and can't
>find a way to delete it.  An ls -s on the directory produces:
>
>   ..	... (other files)
>    1	???H01.b
>
>If I do an ls *.b, it lists the other .b files, but complains:
>
>	H01.b not found
>
>I've tried:
>
>	rm -i *			(to selectively delete everything)
>	rm "???H01.b"
>	rm "^v^?^v^?^v^?H01.b"  (control-v delete ...)
>
>and nothing seems to work.

$ cat > xxx.c
#include <stdio.h>
main()
{
	char buf[255];

	while (gets(buf))
		if (unlink(buf))
			perror(buf);
}
^D
$ cc xxx.c
$ a.out
????H01.b
^D

---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: "John W. DeBoskey" <jwd@sas.uucp>
Subject: Number of chars in input queue - terminal, keyboard
Keywords: QUEUE TERM KEYBOARD ISC 1.0.6
Date: 9 Jan 90 16:42:00 GMT
To:       unix-wizards@sem.brl.mil

Hello,

   The subject almost says it all. I'm running ISC 1.0.6. I want to
find out how many characters are available to read from the terminal
if there are any. ie: avail = in_queue(term_id). 

   A BSD answer is to use FIONREAD, but sVr3 doesn't have it, and I've
been unable to duplicate it. Please don't tell me to RTFM or read
the monthly intros. I have and they don't help. I'm starting to think
the only way I can do this is to actually issue a read, and do my own
internal buffering, but I DON'T really want to do this.

   If anyone has some ideas, or knows a way that isn't doc'd, please
let me know. I'd really appreciate it. Thanks!!

                                      John W De Boskey

jwd@sas.UUCP     (w)  jwd%sas@rti.rti.org
jwd@baggins.UUCP (h)  jwd%baggins@mcnc.mcnc.org

-----------------------------

From: Mike Ewan <mike@raven.uss.tek.com>
Subject: Re: C Documentation Utility Needed
Date: 9 Jan 90 16:53:45 GMT
Followup-To: comp.unix.wizards
To:       unix-wizards@sem.brl.mil

In article <10761@cadnetix.COM> rusty@cadnetix.COM (Rusty Carruth) writes:
>In article <625@h.cs.wvu.wvnet.edu> dymm@b.cs.wvu.wvnet.edu (David Dymm) writes:
>>
>>I am looking for a utility to help in the documentation of C code.
>>[...]
>
>Well, this will probably not help as much as I would like, but there
>is a program available for the PC family which does pretty-printing
>and such, and also can create the tree info you wanted.  I THINK
>it was by Polytron, but I could be wrong.  I'll try to find out
>and post again.  If anyone else knows of the actual company name,
>you might be really lucky and that company may have ported it to
>unix by now...


The company is Sage/Polytron, 1100 nw 167th Pl, Beaverton OR 97006
(503) 645-1150

I havn't used their PolyDoc product but have used their PVCS (RCS clone).
I'm pleased with the product.  They have been porting some of the
products to Unix.  If PolyDoc isn't ported you could always download
to a PC run the thing and then up load.


-- 
 Michael Ewan    (503)627-6468      Internet:  mike@raven.USS.TEK.COM
 Unix Systems Support                   UUCP:  ...!tektronix!puffin!raven!mike
 Tektronix, Inc.                   Compuserv:  73747,2304
"Fig Newton: The force required to accelerate a fig 39.37 inches/sec."--J. Hart

-----------------------------

From: Tony Rems <rembo@uts.amdahl.com>
Subject: Re: C Documentation Utility Needed
Date: 10 Jan 90 01:24:00 GMT
To:       unix-wizards@sem.brl.mil

In article <625@h.cs.wvu.wvnet.edu> dymm@b.cs.wvu.wvnet.edu (David Dymm) writes:
>
>I am looking for a utility to help in the documentation of C code.
>
>Input:  Multiple 'C' files.
>
>Output: A cross reference report showing the call hierarchy of
>	all functions.
>	Thus, the report might be in the form of a tree where
>	each function is listed showing from where it is called
>	and perhaps how many times it is called.
>
>
>David Dymm			Project Manager
>
>USMAIL: Bell Atlantic Knowledge Systems,
>        145 Fayette Street, Morgantown, WV 26505
>PHONE:	304 291-2651 (8:30-4:30 EST)
>USENET:  {allegra,bellcore, cadre,idis,psuvax1}!pitt!wvucsb!dymm
>INTERNET: dymm@b.cs.wvu.wvnet.edu

There is a set of tools from McCabe & Associates called Battlemap, ACT & 
the Inference Engine.  These tools are designed to measure complexity 
of C code (as well as code in other languages) and it runs under UNIX on
Sun and a few other platforms.  It can produce the calling structure
of a pieced of code as well as the internal structure of the code.
It can produce a report or a graph (or both) and using the inference 
engine it produce cross reference information on the internal 
structure of the code - including called-bys called-from calls-to 
and number of calls.  Although, I found it rather limited in its
capacity as a test tool - which was its purpose, it sounds like it
might suit your purposes.  If you'd like any more info, send me 
some e-mail.

-Tony

-----------------------------

From: Andrew Simms <ams@fourier.princeton.edu>
Subject: Obtaining a unique, "unchangeable" number associated with an SGI workstation
Keywords: copy protection, hostids, unique identifiers
Date: 9 Jan 90 18:23:06 GMT
Sender: news@phoenix.princeton.edu
Followup-To: comp.sys.sgi
To:       unix-wizards@sem.brl.mil

Some of the folks I work for would like to make a reasonably secure
scheme to insure their product runs only on machines they are
licensed to run on.  To do this, they would like to obtain a
read-only number (such as a motherboard serial number) that
could be used as a key to operate the software only on that
machine.  I know mathematica on the Irises has a program called
mathinfo that generates a unique number but I have no idea
what it does to get it.

If there is sufficient interest, I will be happy to post
a summary of responses emailed to me.

p.s.  Ethernet addresses won't quite do it, since it needs
	to run on machines without ethernet boards.
 ----------------------------------------------------------------------

  Andrew Simms					ams@acm.princeton.edu
  System Administrator
  Program in Applied and Computational Math
  Princeton University
  Princeton, NJ   08544
  609/258-5324 or 609/258-6227
  609/258-1054 (fax)

-----------------------------

From: Greg Wohletz <greg@duke.cs.unlv.edu>
Subject: Re: new mscp code in Ultrix 3.1 (was Boot block trashed)
Date: 9 Jan 90 20:15:35 GMT
Sender: news@jimi.cs.unlv.edu
To:       unix-wizards@sem.brl.mil

In article <1444@jimi.cs.unlv.edu>, I write:

> We have three microvax  II's that we  use as fileservers.  Each has  3
> Wren V's and   an Exabyte hooked  into  a  Sigma  scsi  controller  (it
> emulates  a  uda  and  tms controller).   They    also  have a Dec  uda
> controller hooked to  an  rd52 and two rx50's  (yes  we've had  these
> machines for  a while...) on  them.   We have been  running with  this
> configuration under Ultrix  2.0 without  many problems (well a few nfs
> bugs, but nothing major).  Recently we got Ultrix 3.1.  I installed it
> on one of  our microvax's  and everything seemed  to be  going fine, I
> could use the disks, and read from the Exabyte.  However, when I tried
> to dump the root filesystem  to the Exabyte  I got a write error, then
> some message like ``mscp resynching controller uq2'' at that point the
> system locked up.


Well,  I've  investigated the situation   a bit further,   and  I have
discovered that (surprise, surprise)  one difference  between  2.0 and
3.1 is that  all of the disk and  tape drive stuff  appears to have be
re-written.   Now  everything  (except  for  non-uda   type drives and
non-tmscp tapes) goes through this new mscp code (or at least  that is
what it looks  like to me).  Anyway looking  at the code didn't reveal
anything obvious,  however  I have noticed  that I  can't  dump to the
trusty (?) old rx50's.   The first volume  of the dump works fine, but
if you so  much as open the  door to the floppy  when dump asks you to
insert the next volume all subsequent  attempts to write to the floppy
will fail (if you leave the same floppy in (without opening  the drive
door) for  ALL of the volumes it  will work...).   I suspect that this
problem is related to the same bug.  I think  at this point I'm almost
convinced that it is a software bug, and not  a problem with the Sigma
controller, but I could be wrong.

So  the question  is, will  someone  from DEC tell  me if  there  is a
known/fixable bug in 3.1 that would cause this behavior?

Would if be possible to graft in the old tmscp  code  from 2.0 without
an inordinate amount of pain?

ANY information would be greatly appreciated.

    	    	    	    	    	--Greg
    	    	    	    	    	greg@unlv.edu
    	    	    	    	    	<@relay.cs.net:greg@unlv.edu>

-----------------------------

From: Barry Shein <bzs@world.std.com>
Subject: Re: Access to UNIX-Related Publications
Date: 9 Jan 90 23:47:04 GMT
To:       unix-wizards@sem.brl.mil


>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).

	sq = sprintf("%c",39)
	print sq
-- 
        -Barry Shein

Software Tool & Die, Purveyors to the Trade         | bzs@world.std.com
1330 Beacon St, Brookline, MA 02146, (617) 739-0202 | {xylogics,uunet}world!bzs

-----------------------------

From: Lee McLoughlin <lmjm@doc.imperial.ac.uk>
Subject: Wanted: fast tar across ether
Date: 10 Jan 90 02:02:18 GMT
Sender: news@doc.ic.ac.uk
To:       unix-wizards@sem.brl.mil

I am in urgent need of a way to write tar output to a remote tape
drive, an exabyte, over ethernet very quickly - preferably allowing the
exabyte to stream.  I currently use the gnu-tar, which does a pretty
good job but I really something faster.

If necessary I will write my own one - so any suggestions about how
best to do this are welcome.

	Lee

-----------------------------


End of UNIX-WIZARDS Digest
**************************

postmaster@ccf3.nrl.navy.mil (SMTP MAILER) (01/12/90)

 ----Mail status follows----
Have been unable to send your mail to <whitis@rira.nrl.navy.mil>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 11 Jan 90 08:16:00 EST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#043
To: "whitis" <whitis@rira.nrl.navy.mil>

Return-Path: <@nrl3.arpa:unix-wizards-request@sem.brl.mil>
Received: from nrl3.arpa by nrl3.arpa with SMTP ; Thu, 11 Jan 90 08:14:47 EST
Received: from SEM.BRL.MIL by nrl3.arpa with SMTP ; Wed, 10 Jan 90 03:39:40 EST
Received: from SEM.BRL.MIL by SEM.brl.MIL id aa03862; 10 Jan 90 3:00 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa03781; 10 Jan 90 2:45 EST
Date:       Wed, 10 Jan 90 02:45:12 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#043
Message-ID:  <9001100245.aa03781@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Wed, 10 Jan 1990              V9#043

Today's Topics:
                     filenames with a '/'  -- help
                   Re: filenames with a '/'  -- help
                              yacc and lex
                 Re: GNU Emacs, memory usage, releasing
                        Re: fcntl/socket anomaly
          Re: How to delete a file with ^? chars in the name?
          Number of chars in input queue - terminal, keyboard
                   Re: C Documentation Utility Needed
Obtaining a unique, "unchangeable" number associated with an SGI workstation
        Re: new mscp code in Ultrix 3.1 (was Boot block trashed)
                Re: Access to UNIX-Related Publications
                     Wanted: fast tar across ether

-----------------------------------------------------------------

From: "Gregory S. Baber" <gregb@dowjone.uucp>
Subject: filenames with a '/'  -- help
Date: 8 Jan 90 20:28:44 GMT
To:       unix-wizards@sem.brl.mil

Hello,
	I moved some files from a Mac to a NeXT using a GatorBox,
and then took the NeXT off the network. Some of the files that were
on the Mac had a '/' as part of the actual filename. How do I delete
these from the NeXT now without reconnecting to the network? When I
try to delete the files by hand, the shell responds with "file does
not exist" because it interprets the '/' as a directory indicator.
I even tried to double quote the filename to no avail. Any ideas?

Thanks, gregb

-- 
Reply to: Gregory S. Baber		Voice:	(609) 520-5077
   Dow Jones & Co., Inc.		UUCP:	..princeton!dowjone!gregb
   Box 300				or	..uunet!warlock!gregb
   Princeton, N.J. 08543-0300		"So long, and thanks for all the fish"

-----------------------------

From: "seth.zirin" <szirin@cbnewsm.att.com>
Subject: Re: filenames with a '/'  -- help
Date: 9 Jan 90 18:20:31 GMT
To:       unix-wizards@sem.brl.mil

In article <646@warlock.UUCP> gregb@dowjone.UUCP (Gregory S. Baber) writes:
>and then took the NeXT off the network. Some of the files that were
>on the Mac had a '/' as part of the actual filename. How do I delete
>these from the NeXT now without reconnecting to the network? When I
>try to delete the files by hand, the shell responds with "file does
>not exist" because it interprets the '/' as a directory indicator.

You have several options:

1) reformat the disk (JUST KIDDING!!) :-)

2) fsck the filesystem.  some versions of fsck will not permit illegal
   characters in names.  if your version of fsck cannot fix it, complain
   to your vendor about the bug in their fsck.

3) use fsdb to locate and edit the disk block that contains the filename
   with the '/'.  Change the '/' to a more palatable character.
   WARNING: this is not for the weak-hearted!

4) copy everything else from the parent directory to a safe spot and
   iclear or unlink the parent directory and run fsck.  if the bad
   name is a file (as opposed to a subdirectory), fsck will copy it
   to the lost+found and give it a civilized name.  if you have a
   directory tree of bad subdirectory names, this will become a
   recursive process.

the above procedures assume that the filesystem is mounted/unmounted
appropriately.  when you're all done and you haven't roached the whole
filesystem or the entire disk, hold your head high; you've earned one
star towards becoming a wizard.

discussion of the other stars should be referred to /dev/null as we just
finished that topic.

Seth Zirin

-----------------------------

From: Chuck Cartledge <chuck@virgil.uucp>
Subject: yacc and lex
Keywords: yacc,lex,error checking
Date: 8 Jan 90 20:51:49 GMT
Followup-To: comp.lang.c
To:       unix-wizards@sem.brl.mil


Pardon the cross posting, but I'm not sure where the answer is for this
question.

I would like to use a yacc/lex generated program segment as a operator input
validation routine, rather then having to write my own from the ground up.
What I am trying to generate either automatically via yacc/lex or with only
minor manual mods, is a function that looks like this:

	valid_data (character_string, data_type, addr1, addr2, ...)

Is there a way to get something like this??

Any help would be appreciated.  Thanks.
-- 
Chuck Cartledge (804)498-1012 (voice-play)                 chuck@virgil.UUCP
EDO Corporation (804)424-1004 (voice-work)
Virginia Operations
814 Greenbrier Circle, Chesapeake Va.  23320

-----------------------------

From: Peter da Silva <peter@ficc.uu.net>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 22:07:52 GMT
To:       unix-wizards@sem.brl.mil

> >> I contend that in a "modern workstation environment" (e.g., Sun 3/60),
> >> a simple buffer gap method is preferred over both paged buffer gap and
> >> linked line.  I leave it as an excercise for the reader to figure out
> >> why.

> >I'm not sure this is a valid conclusion. If 75K is the optimal file size

> Where did this "75K" figure come from?

I honestly don't remember. It was mentioned by someone in this forum.

I do think, though, that for any given system there is such an optimal size.
It may be that on your workstation that size is measured in megabytes... on
others it may be a few K. I wonder how it feels on a NeXT that's paging over
the network or onto the OD?

> >for a buffer-gap solution, how about paged buffer-gap with 75K pages? Or
> >to add a bit of compromise with some of today's brain-dead architectures
> >perhaps 64K pages would work nearly as well.

> In particular, I have had no trouble editing multi-megabyte files in
> GNU Emacs on a Sun 3/280 w/8 MBytes of memory.

Having "no trouble" with something doesn't mean you have the optimal
solution. Just that you have *a* solution.
-- 
 _--_|\  Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \ Also <peter@ficc.lonestar.org> or <peter@sugar.lonestar.org>
\_.--._/
      v  "Have you hugged your wolf today?" `-_-'

-----------------------------

From: Jim Cathey <jimc@isc-br.isc-br.com>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 9 Jan 90 19:20:13 GMT
Followup-To: comp.editors
To:       unix-wizards@sem.brl.mil

>The better solution, made relatively easy by the reasonably modular and
>layered structure of GNU emacs, would be to accept The Emacs Cookbook
>recommendation (adopted by Jove and the MicroEmacs/Gnu family of editors) and
>implement a linked list system. I would suggest just reading (or map, on the
>operating systems that allow it) the file to be edited as a large lump of
>virtual address space, then building a linked list of pointers to lines
>therein, and then to allocate modified lines from ageneral purpose arena.
>Informing the OS of the peculiar access patterns would also help, if
>possible.

So long as line-oriented operation preserved the ability of Gnu Emacs
to edit binary files that have no 'lines' at all.  The MicroEmacs we
have here will choke on these (as does vi, ed, see, siv, and all the
other editors we have), and MicroEmacs' line orientation is so badly
implemented that if (at our site) the file is larger than about 50K it
is _faster_ to start emacs on the file than MicroEmacs.  MicroEmacs
starts faster, but it reads files _much_ slower (fgets,malloc,strcpy).

Somebody or other's master's thesis was on buffer styles (I got a copy with
my copy of MINCE a few years ago), and his conclusion was that the gap method
worked best.  That may have been on a machine that wasn't DPV, though.

Moving the gap by, say, 20 characters should affect at most two pages (four,
if you assume it straddles a page boundary on both ends but this is true for
any scheme and may be disregarded).  A block with a line pointer array might
also affect two pages (the block and the buffer array) so I don't offhand
see the advantage.  Jumping about wildly would touch a lot of pages, but the
assumption is that you work a lot in one place.  The gap approach makes it
very quick to _save_ files, so the auto-save feature is unobtrusive.  It would
be absolutely useless if it took 5-10 seconds to rearrange the line-pointer
and block mess to get it into savable form, or write a line at a time.

If realloc can't do the right thing it should be replaced by one that can.
I believe GNU isn't interested in supporting non-GNU machines (read VAX)
to the extent that it corrupts the architecture of the program.  I somewhat
agree with them in that broken environments shouldn't be catered to, but 
repaired instead.

It would be nice if emacs did sbrk- when it could.  In our environment, we
can also release holes in the _middle_ of the heap.  We added an additional
system call for it.  This gets pages out of the swap space, but they'll be
reallocated (and cleared to zero) if you touch in the hole.

We have a limited virtual address space (2M on some machines, 4M on most 
others) so GNU can't edit those really big log files.  I think only elle can
of the editors I've experienced.  I think it uses linked blocks.

GNU Emacs _is_ awfully large, though, but I haven't noticed any machine
eating behavior.  Of course, we have a lot of smaller machines here, so few
use it at once.  Far more noticible is simultaneous compiles.

+----------------+
! II      CCCCCC !  Jim Cathey
! II  SSSSCC     !  ISC-Bunker Ramo
! II      CC     !  TAF-C8;  Spokane, WA  99220
! IISSSS  CC     !  UUCP: uunet!isc-br!jimc (jimc@isc-br.iscs.com)
! II      CCCCCC !  (509) 927-5757
+----------------+
			"With excitement like this, who is needing enemas?"

-----------------------------

From: Chris Torek <chris@mimsy.umd.edu>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 9 Jan 90 08:24:01 GMT
To:       unix-wizards@sem.brl.mil

In article <129979@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>Those checks [applied by TIOCSPGRP] are inappropriate for the F_SETOWN.
>For example, POSIX insists that the tty in question be your controlling tty.
>That's both unecessary and unlikely for processes wanting SIGIO on a tty.

Ah: this is different from what you said (or at least, what I understood)
before.  Now you seem to mean `any process should be allowed to ask for
SIGIO on any file descriptor to which it can apply an fcntl, and should
receive SIGIO signals whenever it could read from / write to that descriptor.'

(This is a reasonable interpretation of what SIGIO should be, but would
require major kernel restructuring, since per-file-descriptor flags can
only be stored in a u. area.)

>Suppose I have process A and process B.  A does a F_SETOWN on some
>socket and then goes on, expecting a SIGIO at some later time.  B comes
>along, and also does a F_SETOWN on the same socket.  A has been
>robbed.

Ah.  This, of course, is a property of the shared-ness of descriptors.
A dup()ed descriptor (either with the dup() or dup2() system calls,
or simply shared across fork+exec) has only one underlying object,
and (for reasons having to do with the basic kernel structure) signals
have to refer to the underlying object%, hence are shared.

Fortunately, two different endpoints on a socket are not shared.  A
program (your `A') that passes its own socket endpoint to another program
(your `B') has explicitly---well, okay, implicitly---given control of
the socket to the second program.  For instance, `B' could issue a
shutdown on the socket as well.

Thus, I think this objection does not apply.  (It *does* apply to tty
devices.)

 -----
% Actually, they refer to the object underlying the underlying object,
  in the case of inodes; but this, at least, could be changed in
  principle.  (Thread a linked list of signal info through the file
  table.)  Then you have the problem of *giving up* SIGIO signals for
  a descriptor.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 9 Jan 90 21:40:16 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <21710@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
>In article <129979@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>>Those checks [applied by TIOCSPGRP] are inappropriate for the F_SETOWN.
>>For example, POSIX insists that the tty in question be your controlling tty.
>>That's both unecessary and unlikely for processes wanting SIGIO on a tty.
>
>Ah: this is different from what you said (or at least, what I understood)
>before.  Now you seem to mean `any process should be allowed to ask for
>SIGIO on any file descriptor to which it can apply an fcntl, and should
>receive SIGIO signals whenever it could read from / write to that descriptor.'

Well, while I agree that this would be nice, it's not at all what I
meant and I think you know it.  SIGIO is commonly applied to tty's.
The point you made about permission checks is bogus because POSIX won't
let you get SIGIO on anything but your controlling terminal if you
continue with this braindead implementation that calls TIOCSPGRP.

>>Suppose I have process A and process B.  A does a F_SETOWN on some
>>socket and then goes on, expecting a SIGIO at some later time.  B comes
>>along, and also does a F_SETOWN on the same socket.  A has been
>>robbed.
>
>Ah.  This, of course, is a property of the shared-ness of descriptors.

Not really.  If sockets can be named in the file system (Unix domain) then
you can get at it by opeing the file (like the printer for instance).

>A dup()ed descriptor (either with the dup() or dup2() system calls,
>or simply shared across fork+exec) has only one underlying object,
>and (for reasons having to do with the basic kernel structure) signals
>have to refer to the underlying object%, hence are shared.
>
>Thus, I think this objection does not apply.  (It *does* apply to tty
>devices.)

This is missing the point completely.  I don't care (and neither do
you) that cooperating processes can hurt each other (a new definition
of cooperating :-)  It's the tty and named socket case that's broken.


Let's take this offline, Chris - I think the horse is dead....
---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: currey tom 76327 <tcurrey@x102c.harris-atd.com>
Subject: Re: How to delete a file with ^? chars in the name?
Date: 9 Jan 90 14:22:36 GMT
Sender: news@trantor.harris-atd.com
To:       unix-wizards@sem.brl.mil


  You asked how to delete a file with deleted characters.  This depends
on the system you're using.  Here are 2 ways:

    Using the backslash for the meanings try:

            " rm \<DEL>\<DEL>\<DEL>H12.b "      {<DEL> is delete key}

    or last resort method

 	    Copy all other files into a temporary directory and 
            " rm -r <directory with bad file> " the copy them back
            after making a new directory.

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: How to delete a file with ^? chars in the name?
Date: 9 Jan 90 21:44:45 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <7711@unix.SRI.COM> ubi@ginger.sri.com (Ron Ueberschaer x4399) writes:
>I have a file which is named ^?^?^?H01.b (delete character?) and can't
>find a way to delete it.  An ls -s on the directory produces:
>
>   ..	... (other files)
>    1	???H01.b
>
>If I do an ls *.b, it lists the other .b files, but complains:
>
>	H01.b not found
>
>I've tried:
>
>	rm -i *			(to selectively delete everything)
>	rm "???H01.b"
>	rm "^v^?^v^?^v^?H01.b"  (control-v delete ...)
>
>and nothing seems to work.

$ cat > xxx.c
#include <stdio.h>
main()
{
	char buf[255];

	while (gets(buf))
		if (unlink(buf))
			perror(buf);
}
^D
$ cc xxx.c
$ a.out
????H01.b
^D

---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: "John W. DeBoskey" <jwd@sas.uucp>
Subject: Number of chars in input queue - terminal, keyboard
Keywords: QUEUE TERM KEYBOARD ISC 1.0.6
Date: 9 Jan 90 16:42:00 GMT
To:       unix-wizards@sem.brl.mil

Hello,

   The subject almost says it all. I'm running ISC 1.0.6. I want to
find out how many characters are available to read from the terminal
if there are any. ie: avail = in_queue(term_id). 

   A BSD answer is to use FIONREAD, but sVr3 doesn't have it, and I've
been unable to duplicate it. Please don't tell me to RTFM or read
the monthly intros. I have and they don't help. I'm starting to think
the only way I can do this is to actually issue a read, and do my own
internal buffering, but I DON'T really want to do this.

   If anyone has some ideas, or knows a way that isn't doc'd, please
let me know. I'd really appreciate it. Thanks!!

                                      John W De Boskey

jwd@sas.UUCP     (w)  jwd%sas@rti.rti.org
jwd@baggins.UUCP (h)  jwd%baggins@mcnc.mcnc.org

-----------------------------

From: Mike Ewan <mike@raven.uss.tek.com>
Subject: Re: C Documentation Utility Needed
Date: 9 Jan 90 16:53:45 GMT
Followup-To: comp.unix.wizards
To:       unix-wizards@sem.brl.mil

In article <10761@cadnetix.COM> rusty@cadnetix.COM (Rusty Carruth) writes:
>In article <625@h.cs.wvu.wvnet.edu> dymm@b.cs.wvu.wvnet.edu (David Dymm) writes:
>>
>>I am looking for a utility to help in the documentation of C code.
>>[...]
>
>Well, this will probably not help as much as I would like, but there
>is a program available for the PC family which does pretty-printing
>and such, and also can create the tree info you wanted.  I THINK
>it was by Polytron, but I could be wrong.  I'll try to find out
>and post again.  If anyone else knows of the actual company name,
>you might be really lucky and that company may have ported it to
>unix by now...


The company is Sage/Polytron, 1100 nw 167th Pl, Beaverton OR 97006
(503) 645-1150

I havn't used their PolyDoc product but have used their PVCS (RCS clone).
I'm pleased with the product.  They have been porting some of the
products to Unix.  If PolyDoc isn't ported you could always download
to a PC run the thing and then up load.


-- 
 Michael Ewan    (503)627-6468      Internet:  mike@raven.USS.TEK.COM
 Unix Systems Support                   UUCP:  ...!tektronix!puffin!raven!mike
 Tektronix, Inc.                   Compuserv:  73747,2304
"Fig Newton: The force required to accelerate a fig 39.37 inches/sec."--J. Hart

-----------------------------

From: Tony Rems <rembo@uts.amdahl.com>
Subject: Re: C Documentation Utility Needed
Date: 10 Jan 90 01:24:00 GMT
To:       unix-wizards@sem.brl.mil

In article <625@h.cs.wvu.wvnet.edu> dymm@b.cs.wvu.wvnet.edu (David Dymm) writes:
>
>I am looking for a utility to help in the documentation of C code.
>
>Input:  Multiple 'C' files.
>
>Output: A cross reference report showing the call hierarchy of
>	all functions.
>	Thus, the report might be in the form of a tree where
>	each function is listed showing from where it is called
>	and perhaps how many times it is called.
>
>
>David Dymm			Project Manager
>
>USMAIL: Bell Atlantic Knowledge Systems,
>        145 Fayette Street, Morgantown, WV 26505
>PHONE:	304 291-2651 (8:30-4:30 EST)
>USENET:  {allegra,bellcore, cadre,idis,psuvax1}!pitt!wvucsb!dymm
>INTERNET: dymm@b.cs.wvu.wvnet.edu

There is a set of tools from McCabe & Associates called Battlemap, ACT & 
the Inference Engine.  These tools are designed to measure complexity 
of C code (as well as code in other languages) and it runs under UNIX on
Sun and a few other platforms.  It can produce the calling structure
of a pieced of code as well as the internal structure of the code.
It can produce a report or a graph (or both) and using the inference 
engine it produce cross reference information on the internal 
structure of the code - including called-bys called-from calls-to 
and number of calls.  Although, I found it rather limited in its
capacity as a test tool - which was its purpose, it sounds like it
might suit your purposes.  If you'd like any more info, send me 
some e-mail.

-Tony

-----------------------------

From: Andrew Simms <ams@fourier.princeton.edu>
Subject: Obtaining a unique, "unchangeable" number associated with an SGI workstation
Keywords: copy protection, hostids, unique identifiers
Date: 9 Jan 90 18:23:06 GMT
Sender: news@phoenix.princeton.edu
Followup-To: comp.sys.sgi
To:       unix-wizards@sem.brl.mil

Some of the folks I work for would like to make a reasonably secure
scheme to insure their product runs only on machines they are
licensed to run on.  To do this, they would like to obtain a
read-only number (such as a motherboard serial number) that
could be used as a key to operate the software only on that
machine.  I know mathematica on the Irises has a program called
mathinfo that generates a unique number but I have no idea
what it does to get it.

If there is sufficient interest, I will be happy to post
a summary of responses emailed to me.

p.s.  Ethernet addresses won't quite do it, since it needs
	to run on machines without ethernet boards.
 ----------------------------------------------------------------------

  Andrew Simms					ams@acm.princeton.edu
  System Administrator
  Program in Applied and Computational Math
  Princeton University
  Princeton, NJ   08544
  609/258-5324 or 609/258-6227
  609/258-1054 (fax)

-----------------------------

From: Greg Wohletz <greg@duke.cs.unlv.edu>
Subject: Re: new mscp code in Ultrix 3.1 (was Boot block trashed)
Date: 9 Jan 90 20:15:35 GMT
Sender: news@jimi.cs.unlv.edu
To:       unix-wizards@sem.brl.mil

In article <1444@jimi.cs.unlv.edu>, I write:

> We have three microvax  II's that we  use as fileservers.  Each has  3
> Wren V's and   an Exabyte hooked  into  a  Sigma  scsi  controller  (it
> emulates  a  uda  and  tms controller).   They    also  have a Dec  uda
> controller hooked to  an  rd52 and two rx50's  (yes  we've had  these
> machines for  a while...) on  them.   We have been  running with  this
> configuration under Ultrix  2.0 without  many problems (well a few nfs
> bugs, but nothing major).  Recently we got Ultrix 3.1.  I installed it
> on one of  our microvax's  and everything seemed  to be  going fine, I
> could use the disks, and read from the Exabyte.  However, when I tried
> to dump the root filesystem  to the Exabyte  I got a write error, then
> some message like ``mscp resynching controller uq2'' at that point the
> system locked up.


Well,  I've  investigated the situation   a bit further,   and  I have
discovered that (surprise, surprise)  one difference  between  2.0 and
3.1 is that  all of the disk and  tape drive stuff  appears to have be
re-written.   Now  everything  (except  for  non-uda   type drives and
non-tmscp tapes) goes through this new mscp code (or at least  that is
what it looks  like to me).  Anyway looking  at the code didn't reveal
anything obvious,  however  I have noticed  that I  can't  dump to the
trusty (?) old rx50's.   The first volume  of the dump works fine, but
if you so  much as open the  door to the floppy  when dump asks you to
insert the next volume all subsequent  attempts to write to the floppy
will fail (if you leave the same floppy in (without opening  the drive
door) for  ALL of the volumes it  will work...).   I suspect that this
problem is related to the same bug.  I think  at this point I'm almost
convinced that it is a software bug, and not  a problem with the Sigma
controller, but I could be wrong.

So  the question  is, will  someone  from DEC tell  me if  there  is a
known/fixable bug in 3.1 that would cause this behavior?

Would if be possible to graft in the old tmscp  code  from 2.0 without
an inordinate amount of pain?

ANY information would be greatly appreciated.

    	    	    	    	    	--Greg
    	    	    	    	    	greg@unlv.edu
    	    	    	    	    	<@relay.cs.net:greg@unlv.edu>

-----------------------------

From: Barry Shein <bzs@world.std.com>
Subject: Re: Access to UNIX-Related Publications
Date: 9 Jan 90 23:47:04 GMT
To:       unix-wizards@sem.brl.mil


>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).

	sq = sprintf("%c",39)
	print sq
-- 
        -Barry Shein

Software Tool & Die, Purveyors to the Trade         | bzs@world.std.com
1330 Beacon St, Brookline, MA 02146, (617) 739-0202 | {xylogics,uunet}world!bzs

-----------------------------

From: Lee McLoughlin <lmjm@doc.imperial.ac.uk>
Subject: Wanted: fast tar across ether
Date: 10 Jan 90 02:02:18 GMT
Sender: news@doc.ic.ac.uk
To:       unix-wizards@sem.brl.mil

I am in urgent need of a way to write tar output to a remote tape
drive, an exabyte, over ethernet very quickly - preferably allowing the
exabyte to stream.  I currently use the gnu-tar, which does a pretty
good job but I really something faster.

If necessary I will write my own one - so any suggestions about how
best to do this are welcome.

	Lee

-----------------------------


End of UNIX-WIZARDS Digest
**************************

postmaster@ccf.nrl.navy.mil (SMTP MAILER) (01/12/90)

 ----Mail status follows----
Have been unable to send your mail to <whitis@rira.nrl.navy.mil>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 11 Jan 90 00:48:00 EST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#042
To: "whitis" <whitis@rira.nrl.navy.mil>

Return-Path: <@nrl3.arpa:unix-wizards-request@sem.brl.mil>
Received: from nrl3.arpa by nrl3.arpa with SMTP ; Thu, 11 Jan 90 00:46:53 EST
Received: from SEM.BRL.MIL by nrl3.arpa with SMTP ; Tue,  9 Jan 90 03:27:57 EST
Received: from SEM.BRL.MIL by SEM.brl.MIL id aa21640; 9 Jan 90 3:01 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa21575; 9 Jan 90 2:45 EST
Date:       Tue, 09 Jan 90 02:45:18 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#042
Message-ID:  <9001090245.aa21575@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Tue, 09 Jan 1990              V9#042

Today's Topics:
                Re: Access to UNIX-Related Publications
  Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications)
                        Sun4/SUNOS4.0.1 and tcsh
                        Re: fcntl/socket anomaly
Re: Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)
                    How to create a restricted shell
                  Re: How to create a restricted shell
                 Re: GNU Emacs, memory usage, releasing
            How to delete a file with ^? chars in the name?
                    Need a Tape Drive Hardware guru
                            Re: fuzzy strcmp
                      Re: PWD in Bourne Shell PS1

-----------------------------------------------------------------

From:  Sun Visualization Products <matthew@sunpix.uucp>
Subject: Re: Access to UNIX-Related Publications
Date: 7 Jan 90 18:39:55 GMT
To:       unix-wizards@sem.brl.mil

In article <166@omaha1.UUCP> wcc@omaha1.UUCP (William C Carey) writes:
>
>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).  I can't get the 'print' or
>


Here's an example that should get you in the right direction:

awk 'BEGIN { 
	SQ = sprintf("%c", 39);
	DQ = sprintf("%c", 34);
}
{
	printf("%cHow is this?%c\n", DQ, DQ);
	printf("%cAnd this?%c\n", SQ, SQ);
}


-- 
Matthew Lee Stier                            |
Sun Microsystems ---  RTP, NC  27709-3447    |     "Wisconsin   Escapee"
uucp:  sun!mstier or mcnc!rti!sunpix!matthew |
phone: (919) 469-8300 fax: (919) 460-8355    |

-----------------------------

From: Paul Lew <lew@gsg.uucp>
Subject: Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications)
Date: 7 Jan 90 21:02:40 GMT
To:       unix-wizards@sem.brl.mil

>In article <166@omaha1.UUCP> wcc@omaha1.UUCP (William C Carey) writes:
>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).  I can't get the 'print' or
>the 'printf' statement to do it with any combination of backslashes,
>double-quotes, or percent characters.

Try avoid using quotes, double-quotes will make life a lot easier.  I use
the following:

	BEGIN	{ q = 39; }
		{
		printf "this is a quote: %c\n", q;
		}

this free you up to worry about what you want to do instead of quoting
problem.  Just remember the decimal value for quote is 39, I did not start
using this method until I memorized its value (the most intuitive reaction
a programmer has at that point is to use "quote" mostly because he can
not remember the decimal value for quote and dont feel like look into the
ASCII table for it!)
-- 
Paul Lew (lew@gsg.gsg.com)		UUCP:		oliveb---+
						uunet---samsung--+
General Systems Group, 5 Manor Parkway			harvard--+--gsg--lew
Salem, NH 03079	(603) 893-1000				decvax---+

-----------------------------

From: Jussi Eloranta <eloranta@jyu.fi>
Subject: Sun4/SUNOS4.0.1 and tcsh
Date: 8 Jan 90 07:59:18 GMT
To:       unix-wizards@sem.brl.mil


I recall some discussion about tcsh problems with pipes..
but I was unable to find the fixed version of tcsh for sun4/sunos4.0.1
(or does it exist at all?)

Thanks,

Jussi
-- 
============================================================================
Jussi Eloranta               Internet(/Bitnet):
University of Jyvaskyla,     eloranta@tukki.jyu.fi
Finland                      [128.214.7.5]

-----------------------------

From: Chris Torek <chris@mimsy.umd.edu>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 08:27:10 GMT
To:       unix-wizards@sem.brl.mil

>In article <10763@encore.Encore.COM> peralta@encore.com (Rick Peralta) writes:
>>Why when setting the F_SETOWN on a socket a pfind is not done on the PID?
>>Maybe more to the point, why the double standard on how a pgrp is specified?

4.3-tahoe does a pfind, but not for pgroups (negative values), only for
pids (positive values), and only when translating to TIOCSPGRP (more
below).

In article <129970@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>F_SETOWN has been a botch from day one as far as I'm concerned.  For
>those who don't know (or don't remember) F_SETOWN is used to say "send
>this pid the SIGIO when the time is right".  The documentation has
>always said that you can specify pgrps instead of pids (one of them was
>negative to indicate the type) and SunOS, at least, never did that
>(stay tuned).

Actually, I am fairly sure that SunOS 3.x had the 4.2BSD bug where pid
and pgroup were reversed (between documentation and code).  Whether that
has been fixed, I do not know.  (The SunOS 4.x code is substantially
different, and I have not read it.)

>Furthermore, the F_SETOWN uses the same field in the tty
>structure that the tty sub system uses for job control (where ^Z and
>others get sent).  So if you use F_SETOWN on an active tty you get very
>strange things happening.

(The following applies only to 4.3BSD and otherwise-unchanged derivatives
thereof.)

F_SETOWN on an inode translates into a TIOCSPGRP ioctl, so that whatever
checks are applied to TIOCSPGRP are applied to fcntl(ttyf, F_SETOWN).
The translation goes like this:

	if (value > 0) {		[value is a pid, not a pgroup]
		struct proc *p = pfind(value);
		if (p == 0)
			return (ESRCH);
		value = p->p_pgrp;
	} else				[value is a negated pgroup ID]
		value = -value;
	return (fioctl(fp, (int)TIOCSPGRP, (caddr_t)&value);

For a socket, it sets ((struct socket *)fp->f_data)->so_pgrp to the
given value.  Tty pgroups are stored in tp->t_pgrp: a different place.

>My guess is that the SIGIO interface was a hack that some grad student
>needed.

Not really.  It does seem to be done rather badly, however.

>They hacked it in, it works in the obvious cases, it's stuck
>around.  It needs a rewack to be clean (I just checked SunOS - we do
>absolutely no permissions checks on F_SETOWN on sockets).

They are unnecessary.   SIGIO is a completely benign signal.  If a
process is not catching it, SIGIO is discarded.  If a process *is*
catching it, that process is required to figure out why the SIGIO occurred
and whether it still has any reason to do anything about it, so extra
SIGIO signals merely reduce efficiency.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris

-----------------------------

From: "Steven M. Schultz" <sms@wlv.imsd.contel.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 09:11:26 GMT
Sender: news@wlbr.imsd.contel.com
To:       unix-wizards@sem.brl.mil

In article <129970@sun.Eng.Sun.COM> lm@sun.UUCP (Larry McVoy) writes:
>In article <10763@encore.Encore.COM> peralta@encore.com (Rick Peralta) writes:
>>
>>Why when setting the F_SETOWN on a socket a pfind is not done on the PID?
>>Maybe more to the point, why the double standard on how a pgrp is specified?
>
>F_SETOWN has been a botch from day one as far as I'm concerned.  For
	
	amen.

>those who don't know (or don't remember) F_SETOWN is used to say "send
>this pid the SIGIO when the time is right"...
>Furthermore, the F_SETOWN uses the same field in the tty
>structure that the tty sub system uses for job control...
>My guess is that the SIGIO interface was a hack that some grad student
>needed.  They hacked it in, it works in the obvious cases, it's stuck
>around...

	The hack/botch is the F_SETOWN, or rather the whole fcntl(2) syscall.
	As i recall fcntl(2) was (needlessly?) instituted by the creators of 
	System V(anilla) and adopted by Berkeley as a compatability measure,
	nothing that really couldn't be done by ioctl(2) but a new syscall
	was created anyhow.

	and don't forget the overlaying (reuse) of the VTIME and VEOT
	members of the AT&G Unix tty system - switch modes from to/from
	'cbreak' and you have surprises too.  but then, i suppose it was
	done by a graduate student... .5;-)

	Steven

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 18:29:08 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <21691@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
>F_SETOWN on an inode translates into a TIOCSPGRP ioctl, so that whatever
>checks are applied to TIOCSPGRP are applied to fcntl(ttyf, F_SETOWN).
>The translation goes like this:
>
>	if (value > 0) {		[value is a pid, not a pgroup]
>		struct proc *p = pfind(value);
>		if (p == 0)
>			return (ESRCH);
>		value = p->p_pgrp;
>	} else				[value is a negated pgroup ID]
>		value = -value;
>	return (fioctl(fp, (int)TIOCSPGRP, (caddr_t)&value);

Those checks are inappropriate for the F_SETOWN.  For example, POSIX
insists that the tty in question be your controlling tty.  That's both
unecessary and unlikely for processes wanting SIGIO on a tty.

>>My guess is that the SIGIO interface was a hack that some grad student
>>needed.
>
>Not really.  It does seem to be done rather badly, however.
>
>>They hacked it in, it works in the obvious cases, it's stuck
>>around.  It needs a rewack to be clean (I just checked SunOS - we do
>>absolutely no permissions checks on F_SETOWN on sockets).
>
>They are unnecessary.   SIGIO is a completely benign signal.  If a
>process is not catching it, SIGIO is discarded.  If a process *is*
>catching it, that process is required to figure out why the SIGIO occurred
>and whether it still has any reason to do anything about it, so extra
>SIGIO signals merely reduce efficiency.

Permission checks are rarely "unnecessary", it's much more likely that
they're either missing or incorrect.  In this case, they're missing.
Suppose I have process A and process B.  A does a F_SETOWN on some
socket and then goes on, expecting a SIGIO at some later time.  B comes
along, and also does a F_SETOWN on the same socket.  A has been
robbed.

To head off a needless discussion: yes, I realize that if you do the
"right thing" everything is OK and there is no need for permission
checks.  My claim is that the number of programmers who "do the right
thing" (sorry spike) are getting fewer and fewer.
---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: Peter da Silva <peter@ficc.uu.net>
Subject: Re: Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)
Date: 8 Jan 90 15:05:53 GMT
To:       unix-wizards@sem.brl.mil

>    What I mean here is that you can allocate your block poimters, then call
>    map_fd to map the file into memory.

> The problem is that unless you copy the file on disk you can't back
> out of your edits at the last moment (:q! for vi people).  If you're
> going to copy the file you might as well copy it into vmem.

You misunderstand. I wasn't suggesting making direct edits on the memory
image. On the contrary, you map it in read-only if you can. What I was
suggesting was that since most of the things you're doing to the file don't
involve modifying it, you might as well page it in from disk when you
need it, only coping it to writable memory when you want to modify it.

For example, suppose you want to do a search and replace. You fault in
all the pages from here to the replacement location, copy the block that
contains the replacement into two new blocks (using the block-splitting
method) and add the new text. The blocks you just read can be discarded
when needed by the memory manager, rather than having to be written out
to the paging area, saving considerable disk access. Only modified blocks
would need to be written.
-- 
 _--_|\  Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \ Also <peter@ficc.lonestar.org> or <peter@sugar.lonestar.org>
\_.--._/
      v  "Have you hugged your wolf today?" `-_-'

-----------------------------

From: Tzu-Hsi Pan <pantz@nsf1.mth.msu.edu>
Subject: How to create a restricted shell
Keywords: restricted shell
Date: 8 Jan 90 16:19:51 GMT
Sender: usenet@cps3xx.uucp
To:       unix-wizards@sem.brl.mil


Could someone tell me how to build up a restricted shell for some user
such that only a couple of commands can be executed under a new root
environment?  Thanks.

-Pan (pantz@mth.msu.edu)

-----------------------------

From: Wm E Davidsen Jr <davidsen@crdos1.crd.ge.com>
Subject: Re: How to create a restricted shell
Keywords: restricted shell
Date: 8 Jan 90 20:05:48 GMT
To:       unix-wizards@sem.brl.mil

In article <5946@cps3xx.UUCP> pantz@mth.msu.edu (Tzu-Hsi Pan) writes:
| 
| Could someone tell me how to build up a restricted shell for some user
| such that only a couple of commands can be executed under a new root
| environment?  Thanks.

  rsh works with /bin/sh and ksh. You can either execute the rsh command
(SysV) or execute the shell with the -r flag. You simply set the PATH to
point to a directory containing only the things you want to allow, and
then (assuming a recent shell) set the PATH variable readonly. I usually
create a /usr/rbin directory and link stuff in from /bin and /usr/bin.

Ex:
	PATH=/usr/rbin
	readonly PATH; export PATH

-- 
bill davidsen	(davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon

-----------------------------

From: Craig Finseth <fin@uh.msc.umn.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 16:43:41 GMT
Sender: news@uc.msc.umn.edu
To:       unix-wizards@sem.brl.mil

In article <IN_S4Eggpc2@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>There seems to be an assumption here that the only possible methods are
>buffer gap and a linked list of lines. What about a linked list of larger
>blocks? ...

Think of pure buffer gap and linked line as opposite ends of a
continuum.  (Technically, linked character would be on the one end,
but I will ignore that case.)  Pure buffer gap has one chunk, which is
the entire object.  As you divide it into separate chunks (paged
buffer gap), the number increases and their size decreases.
Eventually, you get to a chunk size of one line and have linked line.

In may of the intermediate cases, whether you use an array or linked
list is an implementation detail.

Craig A. Finseth			fin@msc.umn.edu [CAF13]
Minnesota Supercomputer Center, Inc.	+1 612 624 3375

-----------------------------

From: Craig Finseth <fin@uh.msc.umn.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 16:48:15 GMT
Sender: news@uc.msc.umn.edu
To:       unix-wizards@sem.brl.mil

In article <SN_87Eggpc2@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>> I contend that in a "modern workstation environment" (e.g., Sun 3/60),
>> a simple buffer gap method is preferred over both paged buffer gap and
>> linked line.  I leave it as an excercise for the reader to figure out
>> why.

>I'm not sure this is a valid conclusion. If 75K is the optimal file size
>for a buffer-gap solution, how about paged buffer-gap with 75K pages? Or
>to add a bit of compromise with some of today's brain-dead architectures
>perhaps 64K pages would work nearly as well.

Where did this "75K" figure come from?  It wasn't mentioned by me.  It
would be a very unusual constant to remain constant over a wide range
of architectures, speeds, memory sizes, and other performance-related
figures.

In particular, I have had no trouble editing multi-megabyte files in
GNU Emacs on a Sun 3/280 w/8 MBytes of memory.

Craig A. Finseth			fin@msc.umn.edu [CAF13]
Minnesota Supercomputer Center, Inc.	+1 612 624 3375

-----------------------------

From: Joe Weening <weening@gang-of-four.stanford.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Date: 8 Jan 90 21:56:27 GMT
Sender: USENET News System <news@neon.stanford.edu>
Followup-To: comp.editors
To:       unix-wizards@sem.brl.mil

I'm posting this message to help RMS's desire to remove the discussion
of editor implementation methods from gnu.emacs.

The discussion is currently going on in comp.editors, gnu.emacs and
comp.unix.wizards.  Therefore not everyone contributing to the
discussion may have seen RMS's messages.

The discussion is appropriate for comp.editors, so that's where I'm
directing followups to this message.  It is not appropriate for
gnu.emacs, since that group is meant for short announcements only.  It
is not at all appropriate for comp.unix.wizards and should never have
been posted there.

Please, everyone, let's move this discussion to comp.editors only.  If
you want to continue reading it, subscribe to that newsgroup.
--
Joe Weening                                Computer Science Dept.
weening@Gang-of-Four.Stanford.EDU          Stanford University

-----------------------------

From: Ron Ueberschaer x4399 <ubi@ginger.sri.com>
Subject: How to delete a file with ^? chars in the name?
Date: 8 Jan 90 16:53:11 GMT
Sender: news@unix.sri.com
To:       unix-wizards@sem.brl.mil

I have a file which is named ^?^?^?H01.b (delete character?) and can't
find a way to delete it.  An ls -s on the directory produces:

   ..	... (other files)
    1	???H01.b

If I do an ls *.b, it lists the other .b files, but complains:

	H01.b not found

I've tried:

	rm -i *			(to selectively delete everything)
	rm "???H01.b"
	rm "^v^?^v^?^v^?H01.b"  (control-v delete ...)

and nothing seems to work.

Help me, o wizards!

--Ron Ueberschaer
  ubi@unix.sri.com
  ...!{hplabs,rutgers}!sri-unix!ubi

-----------------------------

From: Ira Rampil <rampil@cca.ucsf.edu>
Subject: Need a Tape Drive Hardware guru
Keywords: Tape, guru, $$$$
Date: 8 Jan 90 21:12:36 GMT
To:       unix-wizards@sem.brl.mil

It was a classic story.  A friend was using a kennedy clone
streaming tape on a PDP-11 to record lab data.  The original
drive 'disappeared' and now he needs to read his old tapes.
He has another Kennedy drive but it can not read most of the
tapes - we hypothesize a relative head misalginment.

Is there anyone out there with the requisite skill to retrieve
the data.  It is worth BIG bucks to my colleague!

Any clues, hints or vectors would be much appreciated!
Thanks,

Ira Rampil, MSEE, MD
Dept of Anesthesia
Univ. Cal, San Francisco

(415) 476-9037, or rampil@cca.ucsf.edu

-----------------------------

From: Fred Mitchell - PA <mitchell@cbmvax.commodore.com>
Subject: Re: fuzzy strcmp
Date: 8 Jan 90 22:30:42 GMT
To:       unix-wizards@sem.brl.mil

In article <297@hhb.UUCP> istvan@hhb.UUCP (Istvan Mohos) writes:
>tchrist@convexe.uucp (Tom Christiansen @ Convex Computer) writes:
>>I'm looking for an algorithm that would allow me to determine
>>whether two strings were similar.  Thus 
>>
>>	"abcde" !~ "xyzzy"
>>	"this old man can read" =~ "that old man can't read"
>>
>>... perhaps just
>>    float   strfzcmp(string1,string2)

I will give a general description of an algorithm that can accomplish
what you ask.

NOTE: I am doing this from the 'top of my head'. Some refinement may
be in order.

You will do a weighted comparision based on two factors:
a) The number of characters each string has in common
b) The number of matches the strings have in sequence

Let's take two arbitrary strings:
	"This old man can't read"    string alpha
	"That silly man can't read"  string beta

Notice that they are of different lengths. Also, there is an alignment
shift. The following algorithm _should_ properly handle this:

a) Count the number of occurences of each character in each string.
   Compare the count of each character in alpha to that in beta in the
   following way:
     For each different character from alpha & beta:
	Normalize the counts so that the greater is normalized to 1.
	Multiply the two normalized values toghether.
	Add this product to a running total.
     Normalize this total by the the length of the longest string
     Multiply that by weight w1 yeilding (we shall call it) yw1

b) Compare the two strings byte for byte as follows:
     Start at the beginning of alpha & beta (let's use i and j as indexes)
     initialize k to 0
     Until we hit the end of either string:
	if (alpha[i] == beta[j])
		++k, ++i, ++j
	else 
		we scan forward on beta to find a byte that matchess
		our current location on alpha. If so, adjust j to index
		it. If nothing was found, do vice-versa for alpha.
     When the above loop is completed,
     Normalize k against the size of the longest string
     and multiply it by weight w2 yeilding (we shall call it) yw2.

     return (yw1 + yw2) / (w1 + w2)


This should produce a good evaluation of how closely matched alpha
is to beta, taking into account mis-alignment. The value returned
will be between 0 and 1 inclusive. Weight w1 should be less than w2.
Perhaps w1 = w2 / 3. Experiment.

As I said, this is off the top of my head, so some refinement is in
order, as should be evident during the implementation/testing phase.

If anyone knows of a better way to accomplish this, let's hear it!

	-Mitchell
	 mitchell@cbmvax.UUCP
	 "The shortening of the Way."

 
		

-----------------------------

From: Dan Mercer <mercer@ncrcce.stpaul.ncr.com>
Subject: Re: PWD in Bourne Shell PS1
Date: 8 Jan 90 23:12:54 GMT
Keywords:
To:       unix-wizards@sem.brl.mil

In article <18@choreo.COM> chris@choreo.UUCP (Chris Hare / System Manager) writes:
:In article <8790.259b3142@ecs.umass.edu> Satam writes,
:> Inserting the following three aliases will help achieve the same
:> effect. Note that this is only for csh.
:> ------------------------------------------------------------
:> alias cd 'chdir \!* && set prompt="${cwd:t}_\\!% "'
:> alias pushd 'pushd \!* && set prompt="${cwd:t}_\\!% "'
:> alias popd 'popd \!* && set prompt="${cwd:t}_\\!% "'
:> -------------------------------------------------------------
:
:This is quite true.  However, a similar thing can be implemented in the
:Bourne shell using shell functions.  There are however two caveats :
:
:	1.  We cannot use the name of a built in shell command 
:	2.  We must recaculate the PS1 each time we do a cd.
:
:Firstly,  becase we want the PS1 to be updated whenever we change
:directories, we cannot use the builtin 'cd' command, but something like it.
:We must also remember to use the new command, because using a cd will mean
:that the directory reflected in our PS1 will be incorrect.
:
:You can try this Bourne shell function :
:
:	go()
:	   {
:	   if [ "$1" ]		# if we got an argument
:	   then
:	      cd $1
:	   else 		# otherwise go home
:	      cd $HOME
:	   fi
:	   PS1=`pwd`"> "	# change the PS1
:	   }
:

For what it's worth,  here is how I implemented things (from
file /usr/acct/ME/bin/.functs which I invoke as . .functs in
my .profile)

#
#       This file invokes function definitions
#
# ps3="`cat /etc/NODENAME`/`basename \`tty\``> "  # set in .profile
pd() { RT=$PWD; cd $1; PWD=`pwd`; PS1="$PWD
${ps3}"; }
lpd()	{ pd $1; ls; }
rt() { pd $RT; }

pd (path directory) changes my directory and reflects the current
directory as the first line of my two line prompt.  The second line
tells me what system I am on (I have access to several) and what
line (I also have a variety of ways to tie in - modem,  direct line,
pass thru line,  Token Ring).  If I am in a sub shell,  a /n is 
appended to the line number to indicate depth,  since I'm frequently
nested through some intermediary program or other.

I can toggle between two directories with the rt command,  very
useful wehn transferring files (mv pattern $RT).

:Remember, shell functions are not passed to their subshells.
:
But are accessible by shell scripts called by current shell.  If
you are lucky enough to have an NCR Tower (no flames please,  they
are my employers) they have the delightful .shrc feature implemented
that gets invoked when you fork an interactive shell.  Once I found
that gem (by accident - it's not documented)  I was able to invoke
my function definitions on all shell levels.

I have lots of other shifty functions.  vi (no args) for instance,
edits my last edited file rather than a file with no name.  Very
useful when mucking with balky items like makefiles.


:Chris Hare				Choreo Systems Inc.
:Coordinator, Systems Management		150 Laurier Ave West
:Authorized SCO Instructor		Ottawa, Canada
:					Phone 613-238-1050
:					Fax   613-238-4453
:*** It Works for ME ! ***		email : uunet!choreo!chris


-- 

Dan Mercer
Reply-To: mercer@ncrcce.StPaul.NCR.COM (Dan Mercer)

-----------------------------


End of UNIX-WIZARDS Digest
**************************

postmaster@ccf3.nrl.navy.mil (SMTP MAILER) (01/12/90)

 ----Mail status follows----
Have been unable to send your mail to <whitis@rira.nrl.navy.mil>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 11 Jan 90 08:42:00 EST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#042
To: "whitis" <whitis@rira.nrl.navy.mil>

Return-Path: <@nrl3.arpa:unix-wizards-request@sem.brl.mil>
Received: from nrl3.arpa by nrl3.arpa with SMTP ; Thu, 11 Jan 90 08:40:54 EST
Received: from SEM.BRL.MIL by nrl3.arpa with SMTP ; Tue,  9 Jan 90 03:27:57 EST
Received: from SEM.BRL.MIL by SEM.brl.MIL id aa21640; 9 Jan 90 3:01 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa21575; 9 Jan 90 2:45 EST
Date:       Tue, 09 Jan 90 02:45:18 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#042
Message-ID:  <9001090245.aa21575@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Tue, 09 Jan 1990              V9#042

Today's Topics:
                Re: Access to UNIX-Related Publications
  Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications)
                        Sun4/SUNOS4.0.1 and tcsh
                        Re: fcntl/socket anomaly
Re: Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)
                    How to create a restricted shell
                  Re: How to create a restricted shell
                 Re: GNU Emacs, memory usage, releasing
            How to delete a file with ^? chars in the name?
                    Need a Tape Drive Hardware guru
                            Re: fuzzy strcmp
                      Re: PWD in Bourne Shell PS1

-----------------------------------------------------------------

From:  Sun Visualization Products <matthew@sunpix.uucp>
Subject: Re: Access to UNIX-Related Publications
Date: 7 Jan 90 18:39:55 GMT
To:       unix-wizards@sem.brl.mil

In article <166@omaha1.UUCP> wcc@omaha1.UUCP (William C Carey) writes:
>
>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).  I can't get the 'print' or
>


Here's an example that should get you in the right direction:

awk 'BEGIN { 
	SQ = sprintf("%c", 39);
	DQ = sprintf("%c", 34);
}
{
	printf("%cHow is this?%c\n", DQ, DQ);
	printf("%cAnd this?%c\n", SQ, SQ);
}


-- 
Matthew Lee Stier                            |
Sun Microsystems ---  RTP, NC  27709-3447    |     "Wisconsin   Escapee"
uucp:  sun!mstier or mcnc!rti!sunpix!matthew |
phone: (919) 469-8300 fax: (919) 460-8355    |

-----------------------------

From: Paul Lew <lew@gsg.uucp>
Subject: Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications)
Date: 7 Jan 90 21:02:40 GMT
To:       unix-wizards@sem.brl.mil

>In article <166@omaha1.UUCP> wcc@omaha1.UUCP (William C Carey) writes:
>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).  I can't get the 'print' or
>the 'printf' statement to do it with any combination of backslashes,
>double-quotes, or percent characters.

Try avoid using quotes, double-quotes will make life a lot easier.  I use
the following:

	BEGIN	{ q = 39; }
		{
		printf "this is a quote: %c\n", q;
		}

this free you up to worry about what you want to do instead of quoting
problem.  Just remember the decimal value for quote is 39, I did not start
using this method until I memorized its value (the most intuitive reaction
a programmer has at that point is to use "quote" mostly because he can
not remember the decimal value for quote and dont feel like look into the
ASCII table for it!)
-- 
Paul Lew (lew@gsg.gsg.com)		UUCP:		oliveb---+
						uunet---samsung--+
General Systems Group, 5 Manor Parkway			harvard--+--gsg--lew
Salem, NH 03079	(603) 893-1000				decvax---+

-----------------------------

From: Jussi Eloranta <eloranta@jyu.fi>
Subject: Sun4/SUNOS4.0.1 and tcsh
Date: 8 Jan 90 07:59:18 GMT
To:       unix-wizards@sem.brl.mil


I recall some discussion about tcsh problems with pipes..
but I was unable to find the fixed version of tcsh for sun4/sunos4.0.1
(or does it exist at all?)

Thanks,

Jussi
-- 
============================================================================
Jussi Eloranta               Internet(/Bitnet):
University of Jyvaskyla,     eloranta@tukki.jyu.fi
Finland                      [128.214.7.5]

-----------------------------

From: Chris Torek <chris@mimsy.umd.edu>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 08:27:10 GMT
To:       unix-wizards@sem.brl.mil

>In article <10763@encore.Encore.COM> peralta@encore.com (Rick Peralta) writes:
>>Why when setting the F_SETOWN on a socket a pfind is not done on the PID?
>>Maybe more to the point, why the double standard on how a pgrp is specified?

4.3-tahoe does a pfind, but not for pgroups (negative values), only for
pids (positive values), and only when translating to TIOCSPGRP (more
below).

In article <129970@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>F_SETOWN has been a botch from day one as far as I'm concerned.  For
>those who don't know (or don't remember) F_SETOWN is used to say "send
>this pid the SIGIO when the time is right".  The documentation has
>always said that you can specify pgrps instead of pids (one of them was
>negative to indicate the type) and SunOS, at least, never did that
>(stay tuned).

Actually, I am fairly sure that SunOS 3.x had the 4.2BSD bug where pid
and pgroup were reversed (between documentation and code).  Whether that
has been fixed, I do not know.  (The SunOS 4.x code is substantially
different, and I have not read it.)

>Furthermore, the F_SETOWN uses the same field in the tty
>structure that the tty sub system uses for job control (where ^Z and
>others get sent).  So if you use F_SETOWN on an active tty you get very
>strange things happening.

(The following applies only to 4.3BSD and otherwise-unchanged derivatives
thereof.)

F_SETOWN on an inode translates into a TIOCSPGRP ioctl, so that whatever
checks are applied to TIOCSPGRP are applied to fcntl(ttyf, F_SETOWN).
The translation goes like this:

	if (value > 0) {		[value is a pid, not a pgroup]
		struct proc *p = pfind(value);
		if (p == 0)
			return (ESRCH);
		value = p->p_pgrp;
	} else				[value is a negated pgroup ID]
		value = -value;
	return (fioctl(fp, (int)TIOCSPGRP, (caddr_t)&value);

For a socket, it sets ((struct socket *)fp->f_data)->so_pgrp to the
given value.  Tty pgroups are stored in tp->t_pgrp: a different place.

>My guess is that the SIGIO interface was a hack that some grad student
>needed.

Not really.  It does seem to be done rather badly, however.

>They hacked it in, it works in the obvious cases, it's stuck
>around.  It needs a rewack to be clean (I just checked SunOS - we do
>absolutely no permissions checks on F_SETOWN on sockets).

They are unnecessary.   SIGIO is a completely benign signal.  If a
process is not catching it, SIGIO is discarded.  If a process *is*
catching it, that process is required to figure out why the SIGIO occurred
and whether it still has any reason to do anything about it, so extra
SIGIO signals merely reduce efficiency.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris

-----------------------------

From: "Steven M. Schultz" <sms@wlv.imsd.contel.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 09:11:26 GMT
Sender: news@wlbr.imsd.contel.com
To:       unix-wizards@sem.brl.mil

In article <129970@sun.Eng.Sun.COM> lm@sun.UUCP (Larry McVoy) writes:
>In article <10763@encore.Encore.COM> peralta@encore.com (Rick Peralta) writes:
>>
>>Why when setting the F_SETOWN on a socket a pfind is not done on the PID?
>>Maybe more to the point, why the double standard on how a pgrp is specified?
>
>F_SETOWN has been a botch from day one as far as I'm concerned.  For
	
	amen.

>those who don't know (or don't remember) F_SETOWN is used to say "send
>this pid the SIGIO when the time is right"...
>Furthermore, the F_SETOWN uses the same field in the tty
>structure that the tty sub system uses for job control...
>My guess is that the SIGIO interface was a hack that some grad student
>needed.  They hacked it in, it works in the obvious cases, it's stuck
>around...

	The hack/botch is the F_SETOWN, or rather the whole fcntl(2) syscall.
	As i recall fcntl(2) was (needlessly?) instituted by the creators of 
	System V(anilla) and adopted by Berkeley as a compatability measure,
	nothing that really couldn't be done by ioctl(2) but a new syscall
	was created anyhow.

	and don't forget the overlaying (reuse) of the VTIME and VEOT
	members of the AT&G Unix tty system - switch modes from to/from
	'cbreak' and you have surprises too.  but then, i suppose it was
	done by a graduate student... .5;-)

	Steven

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 18:29:08 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <21691@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
>F_SETOWN on an inode translates into a TIOCSPGRP ioctl, so that whatever
>checks are applied to TIOCSPGRP are applied to fcntl(ttyf, F_SETOWN).
>The translation goes like this:
>
>	if (value > 0) {		[value is a pid, not a pgroup]
>		struct proc *p = pfind(value);
>		if (p == 0)
>			return (ESRCH);
>		value = p->p_pgrp;
>	} else				[value is a negated pgroup ID]
>		value = -value;
>	return (fioctl(fp, (int)TIOCSPGRP, (caddr_t)&value);

Those checks are inappropriate for the F_SETOWN.  For example, POSIX
insists that the tty in question be your controlling tty.  That's both
unecessary and unlikely for processes wanting SIGIO on a tty.

>>My guess is that the SIGIO interface was a hack that some grad student
>>needed.
>
>Not really.  It does seem to be done rather badly, however.
>
>>They hacked it in, it works in the obvious cases, it's stuck
>>around.  It needs a rewack to be clean (I just checked SunOS - we do
>>absolutely no permissions checks on F_SETOWN on sockets).
>
>They are unnecessary.   SIGIO is a completely benign signal.  If a
>process is not catching it, SIGIO is discarded.  If a process *is*
>catching it, that process is required to figure out why the SIGIO occurred
>and whether it still has any reason to do anything about it, so extra
>SIGIO signals merely reduce efficiency.

Permission checks are rarely "unnecessary", it's much more likely that
they're either missing or incorrect.  In this case, they're missing.
Suppose I have process A and process B.  A does a F_SETOWN on some
socket and then goes on, expecting a SIGIO at some later time.  B comes
along, and also does a F_SETOWN on the same socket.  A has been
robbed.

To head off a needless discussion: yes, I realize that if you do the
"right thing" everything is OK and there is no need for permission
checks.  My claim is that the number of programmers who "do the right
thing" (sorry spike) are getting fewer and fewer.
---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: Peter da Silva <peter@ficc.uu.net>
Subject: Re: Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)
Date: 8 Jan 90 15:05:53 GMT
To:       unix-wizards@sem.brl.mil

>    What I mean here is that you can allocate your block poimters, then call
>    map_fd to map the file into memory.

> The problem is that unless you copy the file on disk you can't back
> out of your edits at the last moment (:q! for vi people).  If you're
> going to copy the file you might as well copy it into vmem.

You misunderstand. I wasn't suggesting making direct edits on the memory
image. On the contrary, you map it in read-only if you can. What I was
suggesting was that since most of the things you're doing to the file don't
involve modifying it, you might as well page it in from disk when you
need it, only coping it to writable memory when you want to modify it.

For example, suppose you want to do a search and replace. You fault in
all the pages from here to the replacement location, copy the block that
contains the replacement into two new blocks (using the block-splitting
method) and add the new text. The blocks you just read can be discarded
when needed by the memory manager, rather than having to be written out
to the paging area, saving considerable disk access. Only modified blocks
would need to be written.
-- 
 _--_|\  Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \ Also <peter@ficc.lonestar.org> or <peter@sugar.lonestar.org>
\_.--._/
      v  "Have you hugged your wolf today?" `-_-'

-----------------------------

From: Tzu-Hsi Pan <pantz@nsf1.mth.msu.edu>
Subject: How to create a restricted shell
Keywords: restricted shell
Date: 8 Jan 90 16:19:51 GMT
Sender: usenet@cps3xx.uucp
To:       unix-wizards@sem.brl.mil


Could someone tell me how to build up a restricted shell for some user
such that only a couple of commands can be executed under a new root
environment?  Thanks.

-Pan (pantz@mth.msu.edu)

-----------------------------

From: Wm E Davidsen Jr <davidsen@crdos1.crd.ge.com>
Subject: Re: How to create a restricted shell
Keywords: restricted shell
Date: 8 Jan 90 20:05:48 GMT
To:       unix-wizards@sem.brl.mil

In article <5946@cps3xx.UUCP> pantz@mth.msu.edu (Tzu-Hsi Pan) writes:
| 
| Could someone tell me how to build up a restricted shell for some user
| such that only a couple of commands can be executed under a new root
| environment?  Thanks.

  rsh works with /bin/sh and ksh. You can either execute the rsh command
(SysV) or execute the shell with the -r flag. You simply set the PATH to
point to a directory containing only the things you want to allow, and
then (assuming a recent shell) set the PATH variable readonly. I usually
create a /usr/rbin directory and link stuff in from /bin and /usr/bin.

Ex:
	PATH=/usr/rbin
	readonly PATH; export PATH

-- 
bill davidsen	(davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon

-----------------------------

From: Craig Finseth <fin@uh.msc.umn.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 16:43:41 GMT
Sender: news@uc.msc.umn.edu
To:       unix-wizards@sem.brl.mil

In article <IN_S4Eggpc2@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>There seems to be an assumption here that the only possible methods are
>buffer gap and a linked list of lines. What about a linked list of larger
>blocks? ...

Think of pure buffer gap and linked line as opposite ends of a
continuum.  (Technically, linked character would be on the one end,
but I will ignore that case.)  Pure buffer gap has one chunk, which is
the entire object.  As you divide it into separate chunks (paged
buffer gap), the number increases and their size decreases.
Eventually, you get to a chunk size of one line and have linked line.

In may of the intermediate cases, whether you use an array or linked
list is an implementation detail.

Craig A. Finseth			fin@msc.umn.edu [CAF13]
Minnesota Supercomputer Center, Inc.	+1 612 624 3375

-----------------------------

From: Craig Finseth <fin@uh.msc.umn.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 16:48:15 GMT
Sender: news@uc.msc.umn.edu
To:       unix-wizards@sem.brl.mil

In article <SN_87Eggpc2@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>> I contend that in a "modern workstation environment" (e.g., Sun 3/60),
>> a simple buffer gap method is preferred over both paged buffer gap and
>> linked line.  I leave it as an excercise for the reader to figure out
>> why.

>I'm not sure this is a valid conclusion. If 75K is the optimal file size
>for a buffer-gap solution, how about paged buffer-gap with 75K pages? Or
>to add a bit of compromise with some of today's brain-dead architectures
>perhaps 64K pages would work nearly as well.

Where did this "75K" figure come from?  It wasn't mentioned by me.  It
would be a very unusual constant to remain constant over a wide range
of architectures, speeds, memory sizes, and other performance-related
figures.

In particular, I have had no trouble editing multi-megabyte files in
GNU Emacs on a Sun 3/280 w/8 MBytes of memory.

Craig A. Finseth			fin@msc.umn.edu [CAF13]
Minnesota Supercomputer Center, Inc.	+1 612 624 3375

-----------------------------

From: Joe Weening <weening@gang-of-four.stanford.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Date: 8 Jan 90 21:56:27 GMT
Sender: USENET News System <news@neon.stanford.edu>
Followup-To: comp.editors
To:       unix-wizards@sem.brl.mil

I'm posting this message to help RMS's desire to remove the discussion
of editor implementation methods from gnu.emacs.

The discussion is currently going on in comp.editors, gnu.emacs and
comp.unix.wizards.  Therefore not everyone contributing to the
discussion may have seen RMS's messages.

The discussion is appropriate for comp.editors, so that's where I'm
directing followups to this message.  It is not appropriate for
gnu.emacs, since that group is meant for short announcements only.  It
is not at all appropriate for comp.unix.wizards and should never have
been posted there.

Please, everyone, let's move this discussion to comp.editors only.  If
you want to continue reading it, subscribe to that newsgroup.
--
Joe Weening                                Computer Science Dept.
weening@Gang-of-Four.Stanford.EDU          Stanford University

-----------------------------

From: Ron Ueberschaer x4399 <ubi@ginger.sri.com>
Subject: How to delete a file with ^? chars in the name?
Date: 8 Jan 90 16:53:11 GMT
Sender: news@unix.sri.com
To:       unix-wizards@sem.brl.mil

I have a file which is named ^?^?^?H01.b (delete character?) and can't
find a way to delete it.  An ls -s on the directory produces:

   ..	... (other files)
    1	???H01.b

If I do an ls *.b, it lists the other .b files, but complains:

	H01.b not found

I've tried:

	rm -i *			(to selectively delete everything)
	rm "???H01.b"
	rm "^v^?^v^?^v^?H01.b"  (control-v delete ...)

and nothing seems to work.

Help me, o wizards!

--Ron Ueberschaer
  ubi@unix.sri.com
  ...!{hplabs,rutgers}!sri-unix!ubi

-----------------------------

From: Ira Rampil <rampil@cca.ucsf.edu>
Subject: Need a Tape Drive Hardware guru
Keywords: Tape, guru, $$$$
Date: 8 Jan 90 21:12:36 GMT
To:       unix-wizards@sem.brl.mil

It was a classic story.  A friend was using a kennedy clone
streaming tape on a PDP-11 to record lab data.  The original
drive 'disappeared' and now he needs to read his old tapes.
He has another Kennedy drive but it can not read most of the
tapes - we hypothesize a relative head misalginment.

Is there anyone out there with the requisite skill to retrieve
the data.  It is worth BIG bucks to my colleague!

Any clues, hints or vectors would be much appreciated!
Thanks,

Ira Rampil, MSEE, MD
Dept of Anesthesia
Univ. Cal, San Francisco

(415) 476-9037, or rampil@cca.ucsf.edu

-----------------------------

From: Fred Mitchell - PA <mitchell@cbmvax.commodore.com>
Subject: Re: fuzzy strcmp
Date: 8 Jan 90 22:30:42 GMT
To:       unix-wizards@sem.brl.mil

In article <297@hhb.UUCP> istvan@hhb.UUCP (Istvan Mohos) writes:
>tchrist@convexe.uucp (Tom Christiansen @ Convex Computer) writes:
>>I'm looking for an algorithm that would allow me to determine
>>whether two strings were similar.  Thus 
>>
>>	"abcde" !~ "xyzzy"
>>	"this old man can read" =~ "that old man can't read"
>>
>>... perhaps just
>>    float   strfzcmp(string1,string2)

I will give a general description of an algorithm that can accomplish
what you ask.

NOTE: I am doing this from the 'top of my head'. Some refinement may
be in order.

You will do a weighted comparision based on two factors:
a) The number of characters each string has in common
b) The number of matches the strings have in sequence

Let's take two arbitrary strings:
	"This old man can't read"    string alpha
	"That silly man can't read"  string beta

Notice that they are of different lengths. Also, there is an alignment
shift. The following algorithm _should_ properly handle this:

a) Count the number of occurences of each character in each string.
   Compare the count of each character in alpha to that in beta in the
   following way:
     For each different character from alpha & beta:
	Normalize the counts so that the greater is normalized to 1.
	Multiply the two normalized values toghether.
	Add this product to a running total.
     Normalize this total by the the length of the longest string
     Multiply that by weight w1 yeilding (we shall call it) yw1

b) Compare the two strings byte for byte as follows:
     Start at the beginning of alpha & beta (let's use i and j as indexes)
     initialize k to 0
     Until we hit the end of either string:
	if (alpha[i] == beta[j])
		++k, ++i, ++j
	else 
		we scan forward on beta to find a byte that matchess
		our current location on alpha. If so, adjust j to index
		it. If nothing was found, do vice-versa for alpha.
     When the above loop is completed,
     Normalize k against the size of the longest string
     and multiply it by weight w2 yeilding (we shall call it) yw2.

     return (yw1 + yw2) / (w1 + w2)


This should produce a good evaluation of how closely matched alpha
is to beta, taking into account mis-alignment. The value returned
will be between 0 and 1 inclusive. Weight w1 should be less than w2.
Perhaps w1 = w2 / 3. Experiment.

As I said, this is off the top of my head, so some refinement is in
order, as should be evident during the implementation/testing phase.

If anyone knows of a better way to accomplish this, let's hear it!

	-Mitchell
	 mitchell@cbmvax.UUCP
	 "The shortening of the Way."

 
		

-----------------------------

From: Dan Mercer <mercer@ncrcce.stpaul.ncr.com>
Subject: Re: PWD in Bourne Shell PS1
Date: 8 Jan 90 23:12:54 GMT
Keywords:
To:       unix-wizards@sem.brl.mil

In article <18@choreo.COM> chris@choreo.UUCP (Chris Hare / System Manager) writes:
:In article <8790.259b3142@ecs.umass.edu> Satam writes,
:> Inserting the following three aliases will help achieve the same
:> effect. Note that this is only for csh.
:> ------------------------------------------------------------
:> alias cd 'chdir \!* && set prompt="${cwd:t}_\\!% "'
:> alias pushd 'pushd \!* && set prompt="${cwd:t}_\\!% "'
:> alias popd 'popd \!* && set prompt="${cwd:t}_\\!% "'
:> -------------------------------------------------------------
:
:This is quite true.  However, a similar thing can be implemented in the
:Bourne shell using shell functions.  There are however two caveats :
:
:	1.  We cannot use the name of a built in shell command 
:	2.  We must recaculate the PS1 each time we do a cd.
:
:Firstly,  becase we want the PS1 to be updated whenever we change
:directories, we cannot use the builtin 'cd' command, but something like it.
:We must also remember to use the new command, because using a cd will mean
:that the directory reflected in our PS1 will be incorrect.
:
:You can try this Bourne shell function :
:
:	go()
:	   {
:	   if [ "$1" ]		# if we got an argument
:	   then
:	      cd $1
:	   else 		# otherwise go home
:	      cd $HOME
:	   fi
:	   PS1=`pwd`"> "	# change the PS1
:	   }
:

For what it's worth,  here is how I implemented things (from
file /usr/acct/ME/bin/.functs which I invoke as . .functs in
my .profile)

#
#       This file invokes function definitions
#
# ps3="`cat /etc/NODENAME`/`basename \`tty\``> "  # set in .profile
pd() { RT=$PWD; cd $1; PWD=`pwd`; PS1="$PWD
${ps3}"; }
lpd()	{ pd $1; ls; }
rt() { pd $RT; }

pd (path directory) changes my directory and reflects the current
directory as the first line of my two line prompt.  The second line
tells me what system I am on (I have access to several) and what
line (I also have a variety of ways to tie in - modem,  direct line,
pass thru line,  Token Ring).  If I am in a sub shell,  a /n is 
appended to the line number to indicate depth,  since I'm frequently
nested through some intermediary program or other.

I can toggle between two directories with the rt command,  very
useful wehn transferring files (mv pattern $RT).

:Remember, shell functions are not passed to their subshells.
:
But are accessible by shell scripts called by current shell.  If
you are lucky enough to have an NCR Tower (no flames please,  they
are my employers) they have the delightful .shrc feature implemented
that gets invoked when you fork an interactive shell.  Once I found
that gem (by accident - it's not documented)  I was able to invoke
my function definitions on all shell levels.

I have lots of other shifty functions.  vi (no args) for instance,
edits my last edited file rather than a file with no name.  Very
useful when mucking with balky items like makefiles.


:Chris Hare				Choreo Systems Inc.
:Coordinator, Systems Management		150 Laurier Ave West
:Authorized SCO Instructor		Ottawa, Canada
:					Phone 613-238-1050
:					Fax   613-238-4453
:*** It Works for ME ! ***		email : uunet!choreo!chris


-- 

Dan Mercer
Reply-To: mercer@ncrcce.StPaul.NCR.COM (Dan Mercer)

-----------------------------


End of UNIX-WIZARDS Digest
**************************

postmaster@ccf3.nrl.navy.mil (SMTP MAILER) (01/12/90)

 ----Mail status follows----
Have been unable to send your mail to <whitis@rira.nrl.navy.mil>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 11 Jan 90 09:56:00 EST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#043
To: "whitis" <whitis@rira.nrl.navy.mil>

Return-Path: <@nrl3.arpa:unix-wizards-request@sem.brl.mil>
Received: from nrl3.arpa by nrl3.arpa with SMTP ; Thu, 11 Jan 90 09:54:39 EST
Received: from SEM.BRL.MIL by nrl3.arpa with SMTP ; Wed, 10 Jan 90 03:39:40 EST
Received: from SEM.BRL.MIL by SEM.brl.MIL id aa03862; 10 Jan 90 3:00 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa03781; 10 Jan 90 2:45 EST
Date:       Wed, 10 Jan 90 02:45:12 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#043
Message-ID:  <9001100245.aa03781@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Wed, 10 Jan 1990              V9#043

Today's Topics:
                     filenames with a '/'  -- help
                   Re: filenames with a '/'  -- help
                              yacc and lex
                 Re: GNU Emacs, memory usage, releasing
                        Re: fcntl/socket anomaly
          Re: How to delete a file with ^? chars in the name?
          Number of chars in input queue - terminal, keyboard
                   Re: C Documentation Utility Needed
Obtaining a unique, "unchangeable" number associated with an SGI workstation
        Re: new mscp code in Ultrix 3.1 (was Boot block trashed)
                Re: Access to UNIX-Related Publications
                     Wanted: fast tar across ether

-----------------------------------------------------------------

From: "Gregory S. Baber" <gregb@dowjone.uucp>
Subject: filenames with a '/'  -- help
Date: 8 Jan 90 20:28:44 GMT
To:       unix-wizards@sem.brl.mil

Hello,
	I moved some files from a Mac to a NeXT using a GatorBox,
and then took the NeXT off the network. Some of the files that were
on the Mac had a '/' as part of the actual filename. How do I delete
these from the NeXT now without reconnecting to the network? When I
try to delete the files by hand, the shell responds with "file does
not exist" because it interprets the '/' as a directory indicator.
I even tried to double quote the filename to no avail. Any ideas?

Thanks, gregb

-- 
Reply to: Gregory S. Baber		Voice:	(609) 520-5077
   Dow Jones & Co., Inc.		UUCP:	..princeton!dowjone!gregb
   Box 300				or	..uunet!warlock!gregb
   Princeton, N.J. 08543-0300		"So long, and thanks for all the fish"

-----------------------------

From: "seth.zirin" <szirin@cbnewsm.att.com>
Subject: Re: filenames with a '/'  -- help
Date: 9 Jan 90 18:20:31 GMT
To:       unix-wizards@sem.brl.mil

In article <646@warlock.UUCP> gregb@dowjone.UUCP (Gregory S. Baber) writes:
>and then took the NeXT off the network. Some of the files that were
>on the Mac had a '/' as part of the actual filename. How do I delete
>these from the NeXT now without reconnecting to the network? When I
>try to delete the files by hand, the shell responds with "file does
>not exist" because it interprets the '/' as a directory indicator.

You have several options:

1) reformat the disk (JUST KIDDING!!) :-)

2) fsck the filesystem.  some versions of fsck will not permit illegal
   characters in names.  if your version of fsck cannot fix it, complain
   to your vendor about the bug in their fsck.

3) use fsdb to locate and edit the disk block that contains the filename
   with the '/'.  Change the '/' to a more palatable character.
   WARNING: this is not for the weak-hearted!

4) copy everything else from the parent directory to a safe spot and
   iclear or unlink the parent directory and run fsck.  if the bad
   name is a file (as opposed to a subdirectory), fsck will copy it
   to the lost+found and give it a civilized name.  if you have a
   directory tree of bad subdirectory names, this will become a
   recursive process.

the above procedures assume that the filesystem is mounted/unmounted
appropriately.  when you're all done and you haven't roached the whole
filesystem or the entire disk, hold your head high; you've earned one
star towards becoming a wizard.

discussion of the other stars should be referred to /dev/null as we just
finished that topic.

Seth Zirin

-----------------------------

From: Chuck Cartledge <chuck@virgil.uucp>
Subject: yacc and lex
Keywords: yacc,lex,error checking
Date: 8 Jan 90 20:51:49 GMT
Followup-To: comp.lang.c
To:       unix-wizards@sem.brl.mil


Pardon the cross posting, but I'm not sure where the answer is for this
question.

I would like to use a yacc/lex generated program segment as a operator input
validation routine, rather then having to write my own from the ground up.
What I am trying to generate either automatically via yacc/lex or with only
minor manual mods, is a function that looks like this:

	valid_data (character_string, data_type, addr1, addr2, ...)

Is there a way to get something like this??

Any help would be appreciated.  Thanks.
-- 
Chuck Cartledge (804)498-1012 (voice-play)                 chuck@virgil.UUCP
EDO Corporation (804)424-1004 (voice-work)
Virginia Operations
814 Greenbrier Circle, Chesapeake Va.  23320

-----------------------------

From: Peter da Silva <peter@ficc.uu.net>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 22:07:52 GMT
To:       unix-wizards@sem.brl.mil

> >> I contend that in a "modern workstation environment" (e.g., Sun 3/60),
> >> a simple buffer gap method is preferred over both paged buffer gap and
> >> linked line.  I leave it as an excercise for the reader to figure out
> >> why.

> >I'm not sure this is a valid conclusion. If 75K is the optimal file size

> Where did this "75K" figure come from?

I honestly don't remember. It was mentioned by someone in this forum.

I do think, though, that for any given system there is such an optimal size.
It may be that on your workstation that size is measured in megabytes... on
others it may be a few K. I wonder how it feels on a NeXT that's paging over
the network or onto the OD?

> >for a buffer-gap solution, how about paged buffer-gap with 75K pages? Or
> >to add a bit of compromise with some of today's brain-dead architectures
> >perhaps 64K pages would work nearly as well.

> In particular, I have had no trouble editing multi-megabyte files in
> GNU Emacs on a Sun 3/280 w/8 MBytes of memory.

Having "no trouble" with something doesn't mean you have the optimal
solution. Just that you have *a* solution.
-- 
 _--_|\  Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \ Also <peter@ficc.lonestar.org> or <peter@sugar.lonestar.org>
\_.--._/
      v  "Have you hugged your wolf today?" `-_-'

-----------------------------

From: Jim Cathey <jimc@isc-br.isc-br.com>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 9 Jan 90 19:20:13 GMT
Followup-To: comp.editors
To:       unix-wizards@sem.brl.mil

>The better solution, made relatively easy by the reasonably modular and
>layered structure of GNU emacs, would be to accept The Emacs Cookbook
>recommendation (adopted by Jove and the MicroEmacs/Gnu family of editors) and
>implement a linked list system. I would suggest just reading (or map, on the
>operating systems that allow it) the file to be edited as a large lump of
>virtual address space, then building a linked list of pointers to lines
>therein, and then to allocate modified lines from ageneral purpose arena.
>Informing the OS of the peculiar access patterns would also help, if
>possible.

So long as line-oriented operation preserved the ability of Gnu Emacs
to edit binary files that have no 'lines' at all.  The MicroEmacs we
have here will choke on these (as does vi, ed, see, siv, and all the
other editors we have), and MicroEmacs' line orientation is so badly
implemented that if (at our site) the file is larger than about 50K it
is _faster_ to start emacs on the file than MicroEmacs.  MicroEmacs
starts faster, but it reads files _much_ slower (fgets,malloc,strcpy).

Somebody or other's master's thesis was on buffer styles (I got a copy with
my copy of MINCE a few years ago), and his conclusion was that the gap method
worked best.  That may have been on a machine that wasn't DPV, though.

Moving the gap by, say, 20 characters should affect at most two pages (four,
if you assume it straddles a page boundary on both ends but this is true for
any scheme and may be disregarded).  A block with a line pointer array might
also affect two pages (the block and the buffer array) so I don't offhand
see the advantage.  Jumping about wildly would touch a lot of pages, but the
assumption is that you work a lot in one place.  The gap approach makes it
very quick to _save_ files, so the auto-save feature is unobtrusive.  It would
be absolutely useless if it took 5-10 seconds to rearrange the line-pointer
and block mess to get it into savable form, or write a line at a time.

If realloc can't do the right thing it should be replaced by one that can.
I believe GNU isn't interested in supporting non-GNU machines (read VAX)
to the extent that it corrupts the architecture of the program.  I somewhat
agree with them in that broken environments shouldn't be catered to, but 
repaired instead.

It would be nice if emacs did sbrk- when it could.  In our environment, we
can also release holes in the _middle_ of the heap.  We added an additional
system call for it.  This gets pages out of the swap space, but they'll be
reallocated (and cleared to zero) if you touch in the hole.

We have a limited virtual address space (2M on some machines, 4M on most 
others) so GNU can't edit those really big log files.  I think only elle can
of the editors I've experienced.  I think it uses linked blocks.

GNU Emacs _is_ awfully large, though, but I haven't noticed any machine
eating behavior.  Of course, we have a lot of smaller machines here, so few
use it at once.  Far more noticible is simultaneous compiles.

+----------------+
! II      CCCCCC !  Jim Cathey
! II  SSSSCC     !  ISC-Bunker Ramo
! II      CC     !  TAF-C8;  Spokane, WA  99220
! IISSSS  CC     !  UUCP: uunet!isc-br!jimc (jimc@isc-br.iscs.com)
! II      CCCCCC !  (509) 927-5757
+----------------+
			"With excitement like this, who is needing enemas?"

-----------------------------

From: Chris Torek <chris@mimsy.umd.edu>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 9 Jan 90 08:24:01 GMT
To:       unix-wizards@sem.brl.mil

In article <129979@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>Those checks [applied by TIOCSPGRP] are inappropriate for the F_SETOWN.
>For example, POSIX insists that the tty in question be your controlling tty.
>That's both unecessary and unlikely for processes wanting SIGIO on a tty.

Ah: this is different from what you said (or at least, what I understood)
before.  Now you seem to mean `any process should be allowed to ask for
SIGIO on any file descriptor to which it can apply an fcntl, and should
receive SIGIO signals whenever it could read from / write to that descriptor.'

(This is a reasonable interpretation of what SIGIO should be, but would
require major kernel restructuring, since per-file-descriptor flags can
only be stored in a u. area.)

>Suppose I have process A and process B.  A does a F_SETOWN on some
>socket and then goes on, expecting a SIGIO at some later time.  B comes
>along, and also does a F_SETOWN on the same socket.  A has been
>robbed.

Ah.  This, of course, is a property of the shared-ness of descriptors.
A dup()ed descriptor (either with the dup() or dup2() system calls,
or simply shared across fork+exec) has only one underlying object,
and (for reasons having to do with the basic kernel structure) signals
have to refer to the underlying object%, hence are shared.

Fortunately, two different endpoints on a socket are not shared.  A
program (your `A') that passes its own socket endpoint to another program
(your `B') has explicitly---well, okay, implicitly---given control of
the socket to the second program.  For instance, `B' could issue a
shutdown on the socket as well.

Thus, I think this objection does not apply.  (It *does* apply to tty
devices.)

 -----
% Actually, they refer to the object underlying the underlying object,
  in the case of inodes; but this, at least, could be changed in
  principle.  (Thread a linked list of signal info through the file
  table.)  Then you have the problem of *giving up* SIGIO signals for
  a descriptor.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 9 Jan 90 21:40:16 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <21710@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
>In article <129979@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>>Those checks [applied by TIOCSPGRP] are inappropriate for the F_SETOWN.
>>For example, POSIX insists that the tty in question be your controlling tty.
>>That's both unecessary and unlikely for processes wanting SIGIO on a tty.
>
>Ah: this is different from what you said (or at least, what I understood)
>before.  Now you seem to mean `any process should be allowed to ask for
>SIGIO on any file descriptor to which it can apply an fcntl, and should
>receive SIGIO signals whenever it could read from / write to that descriptor.'

Well, while I agree that this would be nice, it's not at all what I
meant and I think you know it.  SIGIO is commonly applied to tty's.
The point you made about permission checks is bogus because POSIX won't
let you get SIGIO on anything but your controlling terminal if you
continue with this braindead implementation that calls TIOCSPGRP.

>>Suppose I have process A and process B.  A does a F_SETOWN on some
>>socket and then goes on, expecting a SIGIO at some later time.  B comes
>>along, and also does a F_SETOWN on the same socket.  A has been
>>robbed.
>
>Ah.  This, of course, is a property of the shared-ness of descriptors.

Not really.  If sockets can be named in the file system (Unix domain) then
you can get at it by opeing the file (like the printer for instance).

>A dup()ed descriptor (either with the dup() or dup2() system calls,
>or simply shared across fork+exec) has only one underlying object,
>and (for reasons having to do with the basic kernel structure) signals
>have to refer to the underlying object%, hence are shared.
>
>Thus, I think this objection does not apply.  (It *does* apply to tty
>devices.)

This is missing the point completely.  I don't care (and neither do
you) that cooperating processes can hurt each other (a new definition
of cooperating :-)  It's the tty and named socket case that's broken.


Let's take this offline, Chris - I think the horse is dead....
---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: currey tom 76327 <tcurrey@x102c.harris-atd.com>
Subject: Re: How to delete a file with ^? chars in the name?
Date: 9 Jan 90 14:22:36 GMT
Sender: news@trantor.harris-atd.com
To:       unix-wizards@sem.brl.mil


  You asked how to delete a file with deleted characters.  This depends
on the system you're using.  Here are 2 ways:

    Using the backslash for the meanings try:

            " rm \<DEL>\<DEL>\<DEL>H12.b "      {<DEL> is delete key}

    or last resort method

 	    Copy all other files into a temporary directory and 
            " rm -r <directory with bad file> " the copy them back
            after making a new directory.

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: How to delete a file with ^? chars in the name?
Date: 9 Jan 90 21:44:45 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <7711@unix.SRI.COM> ubi@ginger.sri.com (Ron Ueberschaer x4399) writes:
>I have a file which is named ^?^?^?H01.b (delete character?) and can't
>find a way to delete it.  An ls -s on the directory produces:
>
>   ..	... (other files)
>    1	???H01.b
>
>If I do an ls *.b, it lists the other .b files, but complains:
>
>	H01.b not found
>
>I've tried:
>
>	rm -i *			(to selectively delete everything)
>	rm "???H01.b"
>	rm "^v^?^v^?^v^?H01.b"  (control-v delete ...)
>
>and nothing seems to work.

$ cat > xxx.c
#include <stdio.h>
main()
{
	char buf[255];

	while (gets(buf))
		if (unlink(buf))
			perror(buf);
}
^D
$ cc xxx.c
$ a.out
????H01.b
^D

---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: "John W. DeBoskey" <jwd@sas.uucp>
Subject: Number of chars in input queue - terminal, keyboard
Keywords: QUEUE TERM KEYBOARD ISC 1.0.6
Date: 9 Jan 90 16:42:00 GMT
To:       unix-wizards@sem.brl.mil

Hello,

   The subject almost says it all. I'm running ISC 1.0.6. I want to
find out how many characters are available to read from the terminal
if there are any. ie: avail = in_queue(term_id). 

   A BSD answer is to use FIONREAD, but sVr3 doesn't have it, and I've
been unable to duplicate it. Please don't tell me to RTFM or read
the monthly intros. I have and they don't help. I'm starting to think
the only way I can do this is to actually issue a read, and do my own
internal buffering, but I DON'T really want to do this.

   If anyone has some ideas, or knows a way that isn't doc'd, please
let me know. I'd really appreciate it. Thanks!!

                                      John W De Boskey

jwd@sas.UUCP     (w)  jwd%sas@rti.rti.org
jwd@baggins.UUCP (h)  jwd%baggins@mcnc.mcnc.org

-----------------------------

From: Mike Ewan <mike@raven.uss.tek.com>
Subject: Re: C Documentation Utility Needed
Date: 9 Jan 90 16:53:45 GMT
Followup-To: comp.unix.wizards
To:       unix-wizards@sem.brl.mil

In article <10761@cadnetix.COM> rusty@cadnetix.COM (Rusty Carruth) writes:
>In article <625@h.cs.wvu.wvnet.edu> dymm@b.cs.wvu.wvnet.edu (David Dymm) writes:
>>
>>I am looking for a utility to help in the documentation of C code.
>>[...]
>
>Well, this will probably not help as much as I would like, but there
>is a program available for the PC family which does pretty-printing
>and such, and also can create the tree info you wanted.  I THINK
>it was by Polytron, but I could be wrong.  I'll try to find out
>and post again.  If anyone else knows of the actual company name,
>you might be really lucky and that company may have ported it to
>unix by now...


The company is Sage/Polytron, 1100 nw 167th Pl, Beaverton OR 97006
(503) 645-1150

I havn't used their PolyDoc product but have used their PVCS (RCS clone).
I'm pleased with the product.  They have been porting some of the
products to Unix.  If PolyDoc isn't ported you could always download
to a PC run the thing and then up load.


-- 
 Michael Ewan    (503)627-6468      Internet:  mike@raven.USS.TEK.COM
 Unix Systems Support                   UUCP:  ...!tektronix!puffin!raven!mike
 Tektronix, Inc.                   Compuserv:  73747,2304
"Fig Newton: The force required to accelerate a fig 39.37 inches/sec."--J. Hart

-----------------------------

From: Tony Rems <rembo@uts.amdahl.com>
Subject: Re: C Documentation Utility Needed
Date: 10 Jan 90 01:24:00 GMT
To:       unix-wizards@sem.brl.mil

In article <625@h.cs.wvu.wvnet.edu> dymm@b.cs.wvu.wvnet.edu (David Dymm) writes:
>
>I am looking for a utility to help in the documentation of C code.
>
>Input:  Multiple 'C' files.
>
>Output: A cross reference report showing the call hierarchy of
>	all functions.
>	Thus, the report might be in the form of a tree where
>	each function is listed showing from where it is called
>	and perhaps how many times it is called.
>
>
>David Dymm			Project Manager
>
>USMAIL: Bell Atlantic Knowledge Systems,
>        145 Fayette Street, Morgantown, WV 26505
>PHONE:	304 291-2651 (8:30-4:30 EST)
>USENET:  {allegra,bellcore, cadre,idis,psuvax1}!pitt!wvucsb!dymm
>INTERNET: dymm@b.cs.wvu.wvnet.edu

There is a set of tools from McCabe & Associates called Battlemap, ACT & 
the Inference Engine.  These tools are designed to measure complexity 
of C code (as well as code in other languages) and it runs under UNIX on
Sun and a few other platforms.  It can produce the calling structure
of a pieced of code as well as the internal structure of the code.
It can produce a report or a graph (or both) and using the inference 
engine it produce cross reference information on the internal 
structure of the code - including called-bys called-from calls-to 
and number of calls.  Although, I found it rather limited in its
capacity as a test tool - which was its purpose, it sounds like it
might suit your purposes.  If you'd like any more info, send me 
some e-mail.

-Tony

-----------------------------

From: Andrew Simms <ams@fourier.princeton.edu>
Subject: Obtaining a unique, "unchangeable" number associated with an SGI workstation
Keywords: copy protection, hostids, unique identifiers
Date: 9 Jan 90 18:23:06 GMT
Sender: news@phoenix.princeton.edu
Followup-To: comp.sys.sgi
To:       unix-wizards@sem.brl.mil

Some of the folks I work for would like to make a reasonably secure
scheme to insure their product runs only on machines they are
licensed to run on.  To do this, they would like to obtain a
read-only number (such as a motherboard serial number) that
could be used as a key to operate the software only on that
machine.  I know mathematica on the Irises has a program called
mathinfo that generates a unique number but I have no idea
what it does to get it.

If there is sufficient interest, I will be happy to post
a summary of responses emailed to me.

p.s.  Ethernet addresses won't quite do it, since it needs
	to run on machines without ethernet boards.
 ----------------------------------------------------------------------

  Andrew Simms					ams@acm.princeton.edu
  System Administrator
  Program in Applied and Computational Math
  Princeton University
  Princeton, NJ   08544
  609/258-5324 or 609/258-6227
  609/258-1054 (fax)

-----------------------------

From: Greg Wohletz <greg@duke.cs.unlv.edu>
Subject: Re: new mscp code in Ultrix 3.1 (was Boot block trashed)
Date: 9 Jan 90 20:15:35 GMT
Sender: news@jimi.cs.unlv.edu
To:       unix-wizards@sem.brl.mil

In article <1444@jimi.cs.unlv.edu>, I write:

> We have three microvax  II's that we  use as fileservers.  Each has  3
> Wren V's and   an Exabyte hooked  into  a  Sigma  scsi  controller  (it
> emulates  a  uda  and  tms controller).   They    also  have a Dec  uda
> controller hooked to  an  rd52 and two rx50's  (yes  we've had  these
> machines for  a while...) on  them.   We have been  running with  this
> configuration under Ultrix  2.0 without  many problems (well a few nfs
> bugs, but nothing major).  Recently we got Ultrix 3.1.  I installed it
> on one of  our microvax's  and everything seemed  to be  going fine, I
> could use the disks, and read from the Exabyte.  However, when I tried
> to dump the root filesystem  to the Exabyte  I got a write error, then
> some message like ``mscp resynching controller uq2'' at that point the
> system locked up.


Well,  I've  investigated the situation   a bit further,   and  I have
discovered that (surprise, surprise)  one difference  between  2.0 and
3.1 is that  all of the disk and  tape drive stuff  appears to have be
re-written.   Now  everything  (except  for  non-uda   type drives and
non-tmscp tapes) goes through this new mscp code (or at least  that is
what it looks  like to me).  Anyway looking  at the code didn't reveal
anything obvious,  however  I have noticed  that I  can't  dump to the
trusty (?) old rx50's.   The first volume  of the dump works fine, but
if you so  much as open the  door to the floppy  when dump asks you to
insert the next volume all subsequent  attempts to write to the floppy
will fail (if you leave the same floppy in (without opening  the drive
door) for  ALL of the volumes it  will work...).   I suspect that this
problem is related to the same bug.  I think  at this point I'm almost
convinced that it is a software bug, and not  a problem with the Sigma
controller, but I could be wrong.

So  the question  is, will  someone  from DEC tell  me if  there  is a
known/fixable bug in 3.1 that would cause this behavior?

Would if be possible to graft in the old tmscp  code  from 2.0 without
an inordinate amount of pain?

ANY information would be greatly appreciated.

    	    	    	    	    	--Greg
    	    	    	    	    	greg@unlv.edu
    	    	    	    	    	<@relay.cs.net:greg@unlv.edu>

-----------------------------

From: Barry Shein <bzs@world.std.com>
Subject: Re: Access to UNIX-Related Publications
Date: 9 Jan 90 23:47:04 GMT
To:       unix-wizards@sem.brl.mil


>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).

	sq = sprintf("%c",39)
	print sq
-- 
        -Barry Shein

Software Tool & Die, Purveyors to the Trade         | bzs@world.std.com
1330 Beacon St, Brookline, MA 02146, (617) 739-0202 | {xylogics,uunet}world!bzs

-----------------------------

From: Lee McLoughlin <lmjm@doc.imperial.ac.uk>
Subject: Wanted: fast tar across ether
Date: 10 Jan 90 02:02:18 GMT
Sender: news@doc.ic.ac.uk
To:       unix-wizards@sem.brl.mil

I am in urgent need of a way to write tar output to a remote tape
drive, an exabyte, over ethernet very quickly - preferably allowing the
exabyte to stream.  I currently use the gnu-tar, which does a pretty
good job but I really something faster.

If necessary I will write my own one - so any suggestions about how
best to do this are welcome.

	Lee

-----------------------------


End of UNIX-WIZARDS Digest
**************************

postmaster@CCF.NRL.NAVY.MIL (SMTP MAILER) (01/12/90)

 ----Mail status follows----
Have been unable to send your mail to <whitis@rira.nrl.navy.mil>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 11 Jan 90 09:26:00 EST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#042
To: "whitis" <whitis@rira.nrl.navy.mil>

Return-Path: <@nrl3.arpa:unix-wizards-request@sem.brl.mil>
Received: from nrl3.arpa by nrl3.arpa with SMTP ; Thu, 11 Jan 90 09:24:58 EST
Received: from SEM.BRL.MIL by nrl3.arpa with SMTP ; Tue,  9 Jan 90 03:27:57 EST
Received: from SEM.BRL.MIL by SEM.brl.MIL id aa21640; 9 Jan 90 3:01 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa21575; 9 Jan 90 2:45 EST
Date:       Tue, 09 Jan 90 02:45:18 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#042
Message-ID:  <9001090245.aa21575@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Tue, 09 Jan 1990              V9#042

Today's Topics:
                Re: Access to UNIX-Related Publications
  Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications)
                        Sun4/SUNOS4.0.1 and tcsh
                        Re: fcntl/socket anomaly
Re: Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)
                    How to create a restricted shell
                  Re: How to create a restricted shell
                 Re: GNU Emacs, memory usage, releasing
            How to delete a file with ^? chars in the name?
                    Need a Tape Drive Hardware guru
                            Re: fuzzy strcmp
                      Re: PWD in Bourne Shell PS1

-----------------------------------------------------------------

From:  Sun Visualization Products <matthew@sunpix.uucp>
Subject: Re: Access to UNIX-Related Publications
Date: 7 Jan 90 18:39:55 GMT
To:       unix-wizards@sem.brl.mil

In article <166@omaha1.UUCP> wcc@omaha1.UUCP (William C Carey) writes:
>
>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).  I can't get the 'print' or
>


Here's an example that should get you in the right direction:

awk 'BEGIN { 
	SQ = sprintf("%c", 39);
	DQ = sprintf("%c", 34);
}
{
	printf("%cHow is this?%c\n", DQ, DQ);
	printf("%cAnd this?%c\n", SQ, SQ);
}


-- 
Matthew Lee Stier                            |
Sun Microsystems ---  RTP, NC  27709-3447    |     "Wisconsin   Escapee"
uucp:  sun!mstier or mcnc!rti!sunpix!matthew |
phone: (919) 469-8300 fax: (919) 460-8355    |

-----------------------------

From: Paul Lew <lew@gsg.uucp>
Subject: Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications)
Date: 7 Jan 90 21:02:40 GMT
To:       unix-wizards@sem.brl.mil

>In article <166@omaha1.UUCP> wcc@omaha1.UUCP (William C Carey) writes:
>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).  I can't get the 'print' or
>the 'printf' statement to do it with any combination of backslashes,
>double-quotes, or percent characters.

Try avoid using quotes, double-quotes will make life a lot easier.  I use
the following:

	BEGIN	{ q = 39; }
		{
		printf "this is a quote: %c\n", q;
		}

this free you up to worry about what you want to do instead of quoting
problem.  Just remember the decimal value for quote is 39, I did not start
using this method until I memorized its value (the most intuitive reaction
a programmer has at that point is to use "quote" mostly because he can
not remember the decimal value for quote and dont feel like look into the
ASCII table for it!)
-- 
Paul Lew (lew@gsg.gsg.com)		UUCP:		oliveb---+
						uunet---samsung--+
General Systems Group, 5 Manor Parkway			harvard--+--gsg--lew
Salem, NH 03079	(603) 893-1000				decvax---+

-----------------------------

From: Jussi Eloranta <eloranta@jyu.fi>
Subject: Sun4/SUNOS4.0.1 and tcsh
Date: 8 Jan 90 07:59:18 GMT
To:       unix-wizards@sem.brl.mil


I recall some discussion about tcsh problems with pipes..
but I was unable to find the fixed version of tcsh for sun4/sunos4.0.1
(or does it exist at all?)

Thanks,

Jussi
-- 
============================================================================
Jussi Eloranta               Internet(/Bitnet):
University of Jyvaskyla,     eloranta@tukki.jyu.fi
Finland                      [128.214.7.5]

-----------------------------

From: Chris Torek <chris@mimsy.umd.edu>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 08:27:10 GMT
To:       unix-wizards@sem.brl.mil

>In article <10763@encore.Encore.COM> peralta@encore.com (Rick Peralta) writes:
>>Why when setting the F_SETOWN on a socket a pfind is not done on the PID?
>>Maybe more to the point, why the double standard on how a pgrp is specified?

4.3-tahoe does a pfind, but not for pgroups (negative values), only for
pids (positive values), and only when translating to TIOCSPGRP (more
below).

In article <129970@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>F_SETOWN has been a botch from day one as far as I'm concerned.  For
>those who don't know (or don't remember) F_SETOWN is used to say "send
>this pid the SIGIO when the time is right".  The documentation has
>always said that you can specify pgrps instead of pids (one of them was
>negative to indicate the type) and SunOS, at least, never did that
>(stay tuned).

Actually, I am fairly sure that SunOS 3.x had the 4.2BSD bug where pid
and pgroup were reversed (between documentation and code).  Whether that
has been fixed, I do not know.  (The SunOS 4.x code is substantially
different, and I have not read it.)

>Furthermore, the F_SETOWN uses the same field in the tty
>structure that the tty sub system uses for job control (where ^Z and
>others get sent).  So if you use F_SETOWN on an active tty you get very
>strange things happening.

(The following applies only to 4.3BSD and otherwise-unchanged derivatives
thereof.)

F_SETOWN on an inode translates into a TIOCSPGRP ioctl, so that whatever
checks are applied to TIOCSPGRP are applied to fcntl(ttyf, F_SETOWN).
The translation goes like this:

	if (value > 0) {		[value is a pid, not a pgroup]
		struct proc *p = pfind(value);
		if (p == 0)
			return (ESRCH);
		value = p->p_pgrp;
	} else				[value is a negated pgroup ID]
		value = -value;
	return (fioctl(fp, (int)TIOCSPGRP, (caddr_t)&value);

For a socket, it sets ((struct socket *)fp->f_data)->so_pgrp to the
given value.  Tty pgroups are stored in tp->t_pgrp: a different place.

>My guess is that the SIGIO interface was a hack that some grad student
>needed.

Not really.  It does seem to be done rather badly, however.

>They hacked it in, it works in the obvious cases, it's stuck
>around.  It needs a rewack to be clean (I just checked SunOS - we do
>absolutely no permissions checks on F_SETOWN on sockets).

They are unnecessary.   SIGIO is a completely benign signal.  If a
process is not catching it, SIGIO is discarded.  If a process *is*
catching it, that process is required to figure out why the SIGIO occurred
and whether it still has any reason to do anything about it, so extra
SIGIO signals merely reduce efficiency.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris

-----------------------------

From: "Steven M. Schultz" <sms@wlv.imsd.contel.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 09:11:26 GMT
Sender: news@wlbr.imsd.contel.com
To:       unix-wizards@sem.brl.mil

In article <129970@sun.Eng.Sun.COM> lm@sun.UUCP (Larry McVoy) writes:
>In article <10763@encore.Encore.COM> peralta@encore.com (Rick Peralta) writes:
>>
>>Why when setting the F_SETOWN on a socket a pfind is not done on the PID?
>>Maybe more to the point, why the double standard on how a pgrp is specified?
>
>F_SETOWN has been a botch from day one as far as I'm concerned.  For
	
	amen.

>those who don't know (or don't remember) F_SETOWN is used to say "send
>this pid the SIGIO when the time is right"...
>Furthermore, the F_SETOWN uses the same field in the tty
>structure that the tty sub system uses for job control...
>My guess is that the SIGIO interface was a hack that some grad student
>needed.  They hacked it in, it works in the obvious cases, it's stuck
>around...

	The hack/botch is the F_SETOWN, or rather the whole fcntl(2) syscall.
	As i recall fcntl(2) was (needlessly?) instituted by the creators of 
	System V(anilla) and adopted by Berkeley as a compatability measure,
	nothing that really couldn't be done by ioctl(2) but a new syscall
	was created anyhow.

	and don't forget the overlaying (reuse) of the VTIME and VEOT
	members of the AT&G Unix tty system - switch modes from to/from
	'cbreak' and you have surprises too.  but then, i suppose it was
	done by a graduate student... .5;-)

	Steven

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 18:29:08 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <21691@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
>F_SETOWN on an inode translates into a TIOCSPGRP ioctl, so that whatever
>checks are applied to TIOCSPGRP are applied to fcntl(ttyf, F_SETOWN).
>The translation goes like this:
>
>	if (value > 0) {		[value is a pid, not a pgroup]
>		struct proc *p = pfind(value);
>		if (p == 0)
>			return (ESRCH);
>		value = p->p_pgrp;
>	} else				[value is a negated pgroup ID]
>		value = -value;
>	return (fioctl(fp, (int)TIOCSPGRP, (caddr_t)&value);

Those checks are inappropriate for the F_SETOWN.  For example, POSIX
insists that the tty in question be your controlling tty.  That's both
unecessary and unlikely for processes wanting SIGIO on a tty.

>>My guess is that the SIGIO interface was a hack that some grad student
>>needed.
>
>Not really.  It does seem to be done rather badly, however.
>
>>They hacked it in, it works in the obvious cases, it's stuck
>>around.  It needs a rewack to be clean (I just checked SunOS - we do
>>absolutely no permissions checks on F_SETOWN on sockets).
>
>They are unnecessary.   SIGIO is a completely benign signal.  If a
>process is not catching it, SIGIO is discarded.  If a process *is*
>catching it, that process is required to figure out why the SIGIO occurred
>and whether it still has any reason to do anything about it, so extra
>SIGIO signals merely reduce efficiency.

Permission checks are rarely "unnecessary", it's much more likely that
they're either missing or incorrect.  In this case, they're missing.
Suppose I have process A and process B.  A does a F_SETOWN on some
socket and then goes on, expecting a SIGIO at some later time.  B comes
along, and also does a F_SETOWN on the same socket.  A has been
robbed.

To head off a needless discussion: yes, I realize that if you do the
"right thing" everything is OK and there is no need for permission
checks.  My claim is that the number of programmers who "do the right
thing" (sorry spike) are getting fewer and fewer.
---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: Peter da Silva <peter@ficc.uu.net>
Subject: Re: Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)
Date: 8 Jan 90 15:05:53 GMT
To:       unix-wizards@sem.brl.mil

>    What I mean here is that you can allocate your block poimters, then call
>    map_fd to map the file into memory.

> The problem is that unless you copy the file on disk you can't back
> out of your edits at the last moment (:q! for vi people).  If you're
> going to copy the file you might as well copy it into vmem.

You misunderstand. I wasn't suggesting making direct edits on the memory
image. On the contrary, you map it in read-only if you can. What I was
suggesting was that since most of the things you're doing to the file don't
involve modifying it, you might as well page it in from disk when you
need it, only coping it to writable memory when you want to modify it.

For example, suppose you want to do a search and replace. You fault in
all the pages from here to the replacement location, copy the block that
contains the replacement into two new blocks (using the block-splitting
method) and add the new text. The blocks you just read can be discarded
when needed by the memory manager, rather than having to be written out
to the paging area, saving considerable disk access. Only modified blocks
would need to be written.
-- 
 _--_|\  Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \ Also <peter@ficc.lonestar.org> or <peter@sugar.lonestar.org>
\_.--._/
      v  "Have you hugged your wolf today?" `-_-'

-----------------------------

From: Tzu-Hsi Pan <pantz@nsf1.mth.msu.edu>
Subject: How to create a restricted shell
Keywords: restricted shell
Date: 8 Jan 90 16:19:51 GMT
Sender: usenet@cps3xx.uucp
To:       unix-wizards@sem.brl.mil


Could someone tell me how to build up a restricted shell for some user
such that only a couple of commands can be executed under a new root
environment?  Thanks.

-Pan (pantz@mth.msu.edu)

-----------------------------

From: Wm E Davidsen Jr <davidsen@crdos1.crd.ge.com>
Subject: Re: How to create a restricted shell
Keywords: restricted shell
Date: 8 Jan 90 20:05:48 GMT
To:       unix-wizards@sem.brl.mil

In article <5946@cps3xx.UUCP> pantz@mth.msu.edu (Tzu-Hsi Pan) writes:
| 
| Could someone tell me how to build up a restricted shell for some user
| such that only a couple of commands can be executed under a new root
| environment?  Thanks.

  rsh works with /bin/sh and ksh. You can either execute the rsh command
(SysV) or execute the shell with the -r flag. You simply set the PATH to
point to a directory containing only the things you want to allow, and
then (assuming a recent shell) set the PATH variable readonly. I usually
create a /usr/rbin directory and link stuff in from /bin and /usr/bin.

Ex:
	PATH=/usr/rbin
	readonly PATH; export PATH

-- 
bill davidsen	(davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon

-----------------------------

From: Craig Finseth <fin@uh.msc.umn.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 16:43:41 GMT
Sender: news@uc.msc.umn.edu
To:       unix-wizards@sem.brl.mil

In article <IN_S4Eggpc2@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>There seems to be an assumption here that the only possible methods are
>buffer gap and a linked list of lines. What about a linked list of larger
>blocks? ...

Think of pure buffer gap and linked line as opposite ends of a
continuum.  (Technically, linked character would be on the one end,
but I will ignore that case.)  Pure buffer gap has one chunk, which is
the entire object.  As you divide it into separate chunks (paged
buffer gap), the number increases and their size decreases.
Eventually, you get to a chunk size of one line and have linked line.

In may of the intermediate cases, whether you use an array or linked
list is an implementation detail.

Craig A. Finseth			fin@msc.umn.edu [CAF13]
Minnesota Supercomputer Center, Inc.	+1 612 624 3375

-----------------------------

From: Craig Finseth <fin@uh.msc.umn.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 16:48:15 GMT
Sender: news@uc.msc.umn.edu
To:       unix-wizards@sem.brl.mil

In article <SN_87Eggpc2@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>> I contend that in a "modern workstation environment" (e.g., Sun 3/60),
>> a simple buffer gap method is preferred over both paged buffer gap and
>> linked line.  I leave it as an excercise for the reader to figure out
>> why.

>I'm not sure this is a valid conclusion. If 75K is the optimal file size
>for a buffer-gap solution, how about paged buffer-gap with 75K pages? Or
>to add a bit of compromise with some of today's brain-dead architectures
>perhaps 64K pages would work nearly as well.

Where did this "75K" figure come from?  It wasn't mentioned by me.  It
would be a very unusual constant to remain constant over a wide range
of architectures, speeds, memory sizes, and other performance-related
figures.

In particular, I have had no trouble editing multi-megabyte files in
GNU Emacs on a Sun 3/280 w/8 MBytes of memory.

Craig A. Finseth			fin@msc.umn.edu [CAF13]
Minnesota Supercomputer Center, Inc.	+1 612 624 3375

-----------------------------

From: Joe Weening <weening@gang-of-four.stanford.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Date: 8 Jan 90 21:56:27 GMT
Sender: USENET News System <news@neon.stanford.edu>
Followup-To: comp.editors
To:       unix-wizards@sem.brl.mil

I'm posting this message to help RMS's desire to remove the discussion
of editor implementation methods from gnu.emacs.

The discussion is currently going on in comp.editors, gnu.emacs and
comp.unix.wizards.  Therefore not everyone contributing to the
discussion may have seen RMS's messages.

The discussion is appropriate for comp.editors, so that's where I'm
directing followups to this message.  It is not appropriate for
gnu.emacs, since that group is meant for short announcements only.  It
is not at all appropriate for comp.unix.wizards and should never have
been posted there.

Please, everyone, let's move this discussion to comp.editors only.  If
you want to continue reading it, subscribe to that newsgroup.
--
Joe Weening                                Computer Science Dept.
weening@Gang-of-Four.Stanford.EDU          Stanford University

-----------------------------

From: Ron Ueberschaer x4399 <ubi@ginger.sri.com>
Subject: How to delete a file with ^? chars in the name?
Date: 8 Jan 90 16:53:11 GMT
Sender: news@unix.sri.com
To:       unix-wizards@sem.brl.mil

I have a file which is named ^?^?^?H01.b (delete character?) and can't
find a way to delete it.  An ls -s on the directory produces:

   ..	... (other files)
    1	???H01.b

If I do an ls *.b, it lists the other .b files, but complains:

	H01.b not found

I've tried:

	rm -i *			(to selectively delete everything)
	rm "???H01.b"
	rm "^v^?^v^?^v^?H01.b"  (control-v delete ...)

and nothing seems to work.

Help me, o wizards!

--Ron Ueberschaer
  ubi@unix.sri.com
  ...!{hplabs,rutgers}!sri-unix!ubi

-----------------------------

From: Ira Rampil <rampil@cca.ucsf.edu>
Subject: Need a Tape Drive Hardware guru
Keywords: Tape, guru, $$$$
Date: 8 Jan 90 21:12:36 GMT
To:       unix-wizards@sem.brl.mil

It was a classic story.  A friend was using a kennedy clone
streaming tape on a PDP-11 to record lab data.  The original
drive 'disappeared' and now he needs to read his old tapes.
He has another Kennedy drive but it can not read most of the
tapes - we hypothesize a relative head misalginment.

Is there anyone out there with the requisite skill to retrieve
the data.  It is worth BIG bucks to my colleague!

Any clues, hints or vectors would be much appreciated!
Thanks,

Ira Rampil, MSEE, MD
Dept of Anesthesia
Univ. Cal, San Francisco

(415) 476-9037, or rampil@cca.ucsf.edu

-----------------------------

From: Fred Mitchell - PA <mitchell@cbmvax.commodore.com>
Subject: Re: fuzzy strcmp
Date: 8 Jan 90 22:30:42 GMT
To:       unix-wizards@sem.brl.mil

In article <297@hhb.UUCP> istvan@hhb.UUCP (Istvan Mohos) writes:
>tchrist@convexe.uucp (Tom Christiansen @ Convex Computer) writes:
>>I'm looking for an algorithm that would allow me to determine
>>whether two strings were similar.  Thus 
>>
>>	"abcde" !~ "xyzzy"
>>	"this old man can read" =~ "that old man can't read"
>>
>>... perhaps just
>>    float   strfzcmp(string1,string2)

I will give a general description of an algorithm that can accomplish
what you ask.

NOTE: I am doing this from the 'top of my head'. Some refinement may
be in order.

You will do a weighted comparision based on two factors:
a) The number of characters each string has in common
b) The number of matches the strings have in sequence

Let's take two arbitrary strings:
	"This old man can't read"    string alpha
	"That silly man can't read"  string beta

Notice that they are of different lengths. Also, there is an alignment
shift. The following algorithm _should_ properly handle this:

a) Count the number of occurences of each character in each string.
   Compare the count of each character in alpha to that in beta in the
   following way:
     For each different character from alpha & beta:
	Normalize the counts so that the greater is normalized to 1.
	Multiply the two normalized values toghether.
	Add this product to a running total.
     Normalize this total by the the length of the longest string
     Multiply that by weight w1 yeilding (we shall call it) yw1

b) Compare the two strings byte for byte as follows:
     Start at the beginning of alpha & beta (let's use i and j as indexes)
     initialize k to 0
     Until we hit the end of either string:
	if (alpha[i] == beta[j])
		++k, ++i, ++j
	else 
		we scan forward on beta to find a byte that matchess
		our current location on alpha. If so, adjust j to index
		it. If nothing was found, do vice-versa for alpha.
     When the above loop is completed,
     Normalize k against the size of the longest string
     and multiply it by weight w2 yeilding (we shall call it) yw2.

     return (yw1 + yw2) / (w1 + w2)


This should produce a good evaluation of how closely matched alpha
is to beta, taking into account mis-alignment. The value returned
will be between 0 and 1 inclusive. Weight w1 should be less than w2.
Perhaps w1 = w2 / 3. Experiment.

As I said, this is off the top of my head, so some refinement is in
order, as should be evident during the implementation/testing phase.

If anyone knows of a better way to accomplish this, let's hear it!

	-Mitchell
	 mitchell@cbmvax.UUCP
	 "The shortening of the Way."

 
		

-----------------------------

From: Dan Mercer <mercer@ncrcce.stpaul.ncr.com>
Subject: Re: PWD in Bourne Shell PS1
Date: 8 Jan 90 23:12:54 GMT
Keywords:
To:       unix-wizards@sem.brl.mil

In article <18@choreo.COM> chris@choreo.UUCP (Chris Hare / System Manager) writes:
:In article <8790.259b3142@ecs.umass.edu> Satam writes,
:> Inserting the following three aliases will help achieve the same
:> effect. Note that this is only for csh.
:> ------------------------------------------------------------
:> alias cd 'chdir \!* && set prompt="${cwd:t}_\\!% "'
:> alias pushd 'pushd \!* && set prompt="${cwd:t}_\\!% "'
:> alias popd 'popd \!* && set prompt="${cwd:t}_\\!% "'
:> -------------------------------------------------------------
:
:This is quite true.  However, a similar thing can be implemented in the
:Bourne shell using shell functions.  There are however two caveats :
:
:	1.  We cannot use the name of a built in shell command 
:	2.  We must recaculate the PS1 each time we do a cd.
:
:Firstly,  becase we want the PS1 to be updated whenever we change
:directories, we cannot use the builtin 'cd' command, but something like it.
:We must also remember to use the new command, because using a cd will mean
:that the directory reflected in our PS1 will be incorrect.
:
:You can try this Bourne shell function :
:
:	go()
:	   {
:	   if [ "$1" ]		# if we got an argument
:	   then
:	      cd $1
:	   else 		# otherwise go home
:	      cd $HOME
:	   fi
:	   PS1=`pwd`"> "	# change the PS1
:	   }
:

For what it's worth,  here is how I implemented things (from
file /usr/acct/ME/bin/.functs which I invoke as . .functs in
my .profile)

#
#       This file invokes function definitions
#
# ps3="`cat /etc/NODENAME`/`basename \`tty\``> "  # set in .profile
pd() { RT=$PWD; cd $1; PWD=`pwd`; PS1="$PWD
${ps3}"; }
lpd()	{ pd $1; ls; }
rt() { pd $RT; }

pd (path directory) changes my directory and reflects the current
directory as the first line of my two line prompt.  The second line
tells me what system I am on (I have access to several) and what
line (I also have a variety of ways to tie in - modem,  direct line,
pass thru line,  Token Ring).  If I am in a sub shell,  a /n is 
appended to the line number to indicate depth,  since I'm frequently
nested through some intermediary program or other.

I can toggle between two directories with the rt command,  very
useful wehn transferring files (mv pattern $RT).

:Remember, shell functions are not passed to their subshells.
:
But are accessible by shell scripts called by current shell.  If
you are lucky enough to have an NCR Tower (no flames please,  they
are my employers) they have the delightful .shrc feature implemented
that gets invoked when you fork an interactive shell.  Once I found
that gem (by accident - it's not documented)  I was able to invoke
my function definitions on all shell levels.

I have lots of other shifty functions.  vi (no args) for instance,
edits my last edited file rather than a file with no name.  Very
useful when mucking with balky items like makefiles.


:Chris Hare				Choreo Systems Inc.
:Coordinator, Systems Management		150 Laurier Ave West
:Authorized SCO Instructor		Ottawa, Canada
:					Phone 613-238-1050
:					Fax   613-238-4453
:*** It Works for ME ! ***		email : uunet!choreo!chris


-- 

Dan Mercer
Reply-To: mercer@ncrcce.StPaul.NCR.COM (Dan Mercer)

-----------------------------


End of UNIX-WIZARDS Digest
**************************

postmaster@nrl3.arpa (SMTP MAILER) (01/12/90)

 ----Mail status follows----
Have been unable to send your mail to <whitis@rira.nrl.navy.mil>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 11 Jan 90 09:29:00 EST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#044
To: "whitis" <whitis@rira.nrl.navy.mil>

Return-Path: <@nrl3.arpa:unix-wizards-request@sem.brl.mil>
Received: from nrl3.arpa by nrl3.arpa with SMTP ; Thu, 11 Jan 90 09:27:47 EST
Received: from SEM.BRL.MIL by nrl3.arpa with SMTP ; Thu, 11 Jan 90 06:20:05 EST
Received: from SEM.BRL.MIL by SEM.brl.MIL id aa07083; 11 Jan 90 2:52 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa07051; 11 Jan 90 2:45 EST
Date:       Thu, 11 Jan 90 02:45:12 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#044
Message-ID:  <9001110245.aa07051@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Thu, 11 Jan 1990              V9#044

Today's Topics:
                         more nroff help needed
        Re: Number of chars in input queue - terminal, keyboard
          Re: How to delete a file with ^? chars in the name?
                  Re: Need a Tape Drive Hardware guru
                    memory allocation package wanted
                  Re: memory allocation package wanted
                   Re: Wanted: fast tar across ether
                       read on a pipe vs. SIGCHLD
                         Re: AWK/shell quoting
                        tcsh and process groups

-----------------------------------------------------------------

From: Jim Harkins <jharkins@sagpd1.uucp>
Subject: more nroff help needed
Keywords: I have not yet begun to fight
Date: 10 Jan 90 01:44:39 GMT
To:       unix-wizards@sem.brl.mil

Hi, I was asking a few days ago about moving page numbers from the top of the
page to the bottom in nroff.  I got it working, thanks to those who responded.
I've now got a new problem.  I want to imbed my source into my document
(remember, this is the military.  If it makes sense we can't do it).  I
started out with .nf, .na, and .cs commands to keep it from munging my text.
No go.  There are 2 general problems.  First, lines that start with an asterisk
or a slash get joined to the preceeding line.  For example:

 .nf
 .na
 .cs
/*-------*/
/*  data dictionary entry for fred.
/*  They don't really look like this, this is an example
fred (data flow) = 
*
    Type:     something
*
    0x24


Becomes

/*------*/ /*  data dictionary entry for fred. /*  They don't really look
like this, this is an example
fred (data flow) = *
    Type:   something*
    0x24.

(The *s are comment delimiters).  I tried using \(** and \(sl instead of stars
and slashes and it made no difference.


Second, the source is in 80 column line format and I'm having trouble  getting
them to stay that way.  I've been adjusting the page offset and line length
(.nr PO x.y,  .po x.y,  .nr LL z, .ll z) with no luck.  For example, assuming
20 column lines:

00000000011111111112
12345678901234567890
   mary had a little
       lamb it's fle

Becomes something like

0000
0000011111111112
123456789
01234567890
   mary had a litt
le
lamb it's fle



As far as I can tell there is no ryme or reason as to where and why it breaks
lines and whether or not it will honor the indenting in the source file.
So what am I doing wrong?

To summarize, I basically have a file of about 70 pages that I want printed
as is in my document.  All I want done is for each page to have the same
headers/footers as the rest of the document.  I'm trying to do it like:

 .nr PO x.y
 .nr LL x
 .po x.y
 .ll x
 .nf
 .na
 .cs             (by the way, how do I undo this command?)
 .so src/foo     ( file 1 )
 .bp
 .so src/bar     ( file 2 )
 .bp
 .so src/blatz   ( file 3 )
 .fi
 .ad

I'm using the ms macro package.  Please respond by email.  Thanks in advance.

jim
jharkins@sagpd1

"Only dead fish go with the flow"

-----------------------------

From: Doug Gwyn <gwyn@smoke.brl.mil>
Subject: Re: Number of chars in input queue - terminal, keyboard
Date: 10 Jan 90 09:28:42 GMT
To:       unix-wizards@sem.brl.mil

In article <1439@sas.UUCP> jwd@sas.UUCP (John W. DeBoskey) writes:
>   A BSD answer is to use FIONREAD, but sVr3 doesn't have it, and I've
>been unable to duplicate it.

There really is no even semi-standard way to obtain this information,
and in many UNIX implementations it cannot be obtained at all by
unprivileged processes.

Therefore the question should be asked, why do you think you need
this information?  I have NEVER in many years of UNIX system
programming needed such information, which makes me suspect you
don't really need it either.  If all you want to do is to avoid
blocking on a read from the terminal (the most common motivation
for such queries), other methods will accomplish that.  System V
also provides a way to control input burst size, which may be what
you desire.  Without more information about the application it is
hard to give good advice.

-----------------------------

From: "T. William Wells" <bill@twwells.com>
Subject: Re: Number of chars in input queue - terminal, keyboard
Keywords: QUEUE TERM KEYBOARD ISC 1.0.6
Date: 10 Jan 90 09:47:41 GMT
To:       unix-wizards@sem.brl.mil

In article <1439@sas.UUCP> jwd@sas.UUCP (John W. DeBoskey) writes:
:    The subject almost says it all. I'm running ISC 1.0.6. I want to
: find out how many characters are available to read from the terminal
: if there are any. ie: avail = in_queue(term_id).

As far as I know, it can't be done without kernel hacking.

---
Bill                    { uunet | novavax | ankh | sunvice } !twwells!bill
bill@twwells.com

-----------------------------

From: "Roy M. Silvernail" <roy@comcon.uucp>
Subject: Re: How to delete a file with ^? chars in the name?
Date: 10 Jan 90 09:57:03 GMT
To:       unix-wizards@sem.brl.mil

In article <7711@unix.SRI.COM>, ubi@ginger.sri.com (Ron Ueberschaer x4399) writes:
> I have a file which is named ^?^?^?H01.b (delete character?) and can't
> find a way to delete it.

Here's one way to do it:

/bin/ls>foo
edit foo with vi to delete all other lines and insert rm in front of the
filename in question. Save it and 'sh foo'
-- 
_R_o_y _M_. _S_i_l_v_e_r_n_a_i_l  | UUCP: uunet!comcon!roy  |  "Every race must arrive at this
#include <opinions.h>;#define opinions MINE  |   point in its history"
SnailMail: P.O. Box 210856, Anchorage,       |   ........Mr. Slippery
Alaska, 99521-0856, U.S.A., Earth, etc.      |  <Ono-Sendai: the right choice!>

-----------------------------

From: "Jeremy J. Epstein" <jje@virtech.uucp>
Subject: Re: How to delete a file with ^? chars in the name?
Date: 10 Jan 90 14:31:11 GMT
To:       unix-wizards@sem.brl.mil

In article <130045@sun.Eng.Sun.COM>, lm@snafu.Sun.COM (Larry McVoy) writes:
> In article <7711@unix.SRI.COM> ubi@ginger.sri.com (Ron Ueberschaer x4399) writes:
> >I have a file which is named ^?^?^?H01.b (delete character?) and can't
> >find a way to delete it.  An ls -s on the directory produces:
> >
> >   ..	... (other files)
> >    1	???H01.b
> >
> 
> $ cat > xxx.c
> #include <stdio.h>
> main()
> {
> 	char buf[255];
> 
> 	while (gets(buf))
> 		if (unlink(buf))
> 			perror(buf);
> }
> ^D
> $ cc xxx.c
> $ a.out
> ????H01.b
> ^D

Unfortunately this won't work since the shell is responsible
for expanding the ? and * wildcard characters, not the kernel
(just for fun, consider implementing a shell which used different
wildcard characters...it's only confusing to the user).

Try this:

main()
{
	unlink("\177\177\177H01.b");
}

It also might be worth using "od" to examine the directory...if
the high order bit is on in any of the bytes in the file name, then
the shell won't show them (since most shells strip the high order
bit).  If that's the case, then you would need to use:

main()
{
	unlink("\377\377\377H01.b");
}

-- 
Jeremy Epstein
TRW Systems Division
703-876-4202
jje@virtech.uu.net

-----------------------------

From: Ira Rampil <rampil@cca.ucsf.edu>
Subject: Re: Need a Tape Drive Hardware guru
Keywords: Tape, guru, $$$$
Date: 10 Jan 90 17:02:49 GMT
To:       unix-wizards@sem.brl.mil


Summary says it all!  Again, thanks to the dozen or so folks who
responded with names or suggestions.  My colleague should be
in touch with the named parties when he returns to town.
Regards,
Ira

-----------------------------

From: ned <ned@h-three.uucp>
Subject: memory allocation package wanted
Date: 10 Jan 90 19:58:50 GMT
To:       unix-wizards@sem.brl.mil

I'm developing a device driver that requires varying amounts of
shared memory to be dynamically allocated and deallocated.

I'm looking for a public domain memory allocation package which
is functionally equivalent to malloc, but is designed so that
buffer information (pointers, flags, etc.) are maintained in
an area that is separate from the arena itself (i.e. does not
use a linked list as malloc classic does).

My particular application requires that memory be allocated at
interrupt level, so critical sections of code need to be
fast and few.

Can anyone help?

Thanks.

-- Ned Robie		uunet!h-three!ned

-----------------------------

From: Andrew Valencia <vandys@sequent.uucp>
Subject: Re: memory allocation package wanted
Date: 11 Jan 90 00:40:58 GMT
To:       unix-wizards@sem.brl.mil

In article <758@h-three.UUCP> ned@h-three.UUCP (ned) writes:
>My particular application requires that memory be allocated at
>interrupt level, so critical sections of code need to be
>fast and few.

	Take a look at kern_malloc.c/malloc.h from the 4.3-tahoe
distribution.  The public portions of it are available on uunet.
Although the files are from kernel source, I've successfully converted
them into user-level routines also.  They contain no AT&T-owned source,
so their use is reasonable in other products.

					Andy Valencia
					...!{uunet, sun}!sequent!vandys

-----------------------------

From: Bob Sutterfield <bob@morningstar.com>
Subject: Re: Wanted: fast tar across ether
Date: 10 Jan 90 21:12:56 GMT
Sender: USENET Administrator <news@morningstar.com>
To:       unix-wizards@sem.brl.mil

In article <1430@gould.doc.ic.ac.uk> lmjm@doc.ic.ac.uk (Lee McLoughlin) writes:
   I am in urgent need of a way to write tar output to a remote tape
   drive, an exabyte, over ethernet very quickly - preferably allowing
   the exabyte to stream.  I currently use the gnu-tar, which does a
   pretty good job but I really something faster.

This SparcStation-1 has a local Wren-VI and an Exabyte on the same
SCSI bus, and I use GNU Tar for backups of it and several other
machines.  I can get about 30% better throughput when backing up the
local disk than when backing up a disk attached to a 4/110 on the same
Ethernet, but even the local speed is about 40% short of what the
Exabyte specs say would cause it to stream.

Paul Placeway did some improvements to dump while he was at Ohio State
and was (I believe) able to drive tapes at device speed either locally
or across an Ethernet.  The improvements involved some nifty
sliding-window acknowledgement schemes.  You'd need to do something
similar if you intend to make tar much faster.

-----------------------------

From: David Steffens <das@eplunix.uucp>
Subject: read on a pipe vs. SIGCHLD
Date: 10 Jan 90 21:21:05 GMT
To:       unix-wizards@sem.brl.mil

This problem was found when porting a version of TCSH
which works under 4.3bsd (uVAX II, VAX750) and SunOS4.0.3 (SUN4)
to RTU4.1A on a Concurrent (nee Masscomp) SLS5450.
Compilation was done in the bsd (as opposed to att) universe.

The problem appeared in backquote evaluation --
	echo `tty`
would fail (nothing printed) about 15-20% of the time.
Concurrent's own version of CSH always worked.

On every other system I tested, the attached program always prints:
	/dev/ttyXX
	SIGCHLD
Well, almost always.  On a SUN4 about 20% of the time it will print:
	SIGCHLD
	/dev/ttyXX
But the net result is always the same -- the parent reliably reads
and prints the message from its child.

Under RTU4.1A (bsd universe) on a Concurrent SLS5450,
things are quite different.  The following results are obtained
in the indicated proportions based on about 1000 repetitions:
85%	/dev/ttyp0
	SIGCHLD

10%	/dev/ttyp0
	SIGCHLD
	backq: read error -- Interrupted system call

5%	SIGCHLD
	backq: read error -- Interrupted system call

once	/dev/ttyp0
	SIGCHLD
	backq: wait -- Interrupted system call

It seems that the SIGCHLD from the child is occasionally interrupting
one of the two pipe reads in the parent.  If the second read is interrupted,
nothing is lost because the read loop handles EOF and error similarly.
But if the first read is interrupted, the loop terminates prematurely
and the message is lost.  Lest you think this is just an academic exercise,
this code is intended to simulate 4.3bsd csh/sh.glob.c quite closely.
Instrumentation installed directly in tcsh/sh.glob.c gives similar results.

The RTU4.1A signal stuff appears to be a mish-mash of _three_ different
implementations -- the original v7 implementation as carried over to SYSV,
an early 4.1bsd (!) implementation, and a recent 4.2bsd implementation.
The latter is the one I'm _supposed_ to get when in the bsd universe.
The _behavior_ seems more like the old v7 implementation, however!

Is it proper behavior for SIGCHLD to interrupt a pipe read?
Can this occur on other flavors of UNIX, or is RTU just plain brain-damaged?
Assuming no bug fix from Concurrent, there seem to be two work-arounds:
	1) block SIGCHLD before entering the read loop; release after EOF.
	2) On read error, retry the read if errno == EINTR (aka v7!)
Which is to be preferred?  Is there anything better?  advTHANKSance.
 --------------------
/* backq.c -- simulate csh/tcsh backquote processing, DAS JAN-90 */
#include <stdio.h>
#include <signal.h>
#include <sys/wait.h>

char *whoami;

#ifdef masscomp
void exit();
#endif

#ifdef sun
void
#endif
catch()
{
	(void) printf("SIGCHLD\n");
}

main(argc, argv)
	int argc;
	char *argv[];
{
	int n, pid, pfd[2];
	char buf[BUFSIZ];
	extern char **environ;

	whoami = *argv++;
	--argc;

	(void) signal(SIGCHLD, catch);

	if (pipe(pfd) < 0)
		fatalperror("can't open pipe");

	if ((pid = fork()) < 0)
		fatalperror("can't fork");

	if (pid == 0) { /* child */
		(void) close(pfd[0]);
		if (pfd[1] != 1) {
			(void) close(1);
			(void) dup(pfd[1]);
		}

		(void) execle("/bin/tty", "tty", 0, environ);
		(void) execle("/usr/bin/tty", "tty", 0, environ);
		fatalperror("can't exec");
	}

	/* parent */
	(void) close(pfd[1]);
	if (pfd[0] != 0) {
		(void) close(0);
		(void) dup(pfd[0]);
	}

	do {
		n = read(0, buf, sizeof(buf));

		if (n < 0)
			fatalperror("read error");
		else if (n > 0)
#ifdef masscomp
			(void) write(1, buf, (unsigned)n);
#else
			(void) write(1, buf, n);
#endif
	} while (n > 0);

	n = wait((union wait *)0);
	if (n < 0)
		fatalperror("wait");
	if (n != pid)
		(void) printf("%s: expecting pid %d, got pid %d\n",
			whoami, pid, n);

	exit(0);
	/* NOTREACHED */
}

/* Print system error message and die. */
fatalperror(msg)
	char *msg;
{
	extern int errno;
	extern char *sys_errlist[];
	char *syserr = sys_errlist[errno];

	(void) printf("%s: %s", whoami, msg);
	(void) printf(" -- %s\n", syserr);
	exit(1);
	/* NOTREACHED */
}
-- 
{harvard,mit-eddie,think}!eplunix!das	David Allan Steffens
243 Charles St., Boston, MA 02114	Eaton-Peabody Laboratory
(617) 573-3748				Mass. Eye & Ear Infirmary

-----------------------------

From: "ihor.j.kinal" <ijk@cbnewsh.att.com>
Subject: Re: AWK/shell quoting
Date: 10 Jan 90 21:43:34 GMT
To:       unix-wizards@sem.brl.mil

Why not this:

	awk "BEGIN { print \"'\" } "
	
Yes, I've tried it, and it does work [and it's simpler than the other
suggestions].

<standard disclaimer>
Ihor Kinal
att!cbnewsh!ijk

-----------------------------

From: Maarten Litmaath <maart@cs.vu.nl>
Subject: Re: AWK/shell quoting
Date: 10 Jan 90 22:57:26 GMT
To:       unix-wizards@sem.brl.mil

In article <2368@leah.Albany.Edu> emb978@leah.Albany.Edu (Eric M. Boehm) writes:
\In article <6954@lindy.Stanford.EDU> karish@forel.stanford.edu (Chuck Karish) writes:
\>>awk 'BEGIN { print "\'" }'
\>
\>Have you tried it?
\...
\Yes, I did try it. However, I did forget that the rules for the c shell
\are not those for the Bourne shell. [...]

You didn't check the abovementioned example in the Bourne shell either.
-- 
1755 EST, Dec 14, 1992: Henry Spencer is put on a one-way mission to the moon.|
  Maarten Litmaath @ VU Amsterdam:  maart@cs.vu.nl,  uunet!mcsun!botter!maart

-----------------------------

From: brnstnd@stealth.acf.nyu.edu
Subject: Re: AWK/shell quoting
Date: 11 Jan 90 03:48:28 GMT
X-Shell-Quoting-Expertise: Guru
To:       unix-wizards@sem.brl.mil

In article <7277@cbnewsh.ATT.COM> ijk@cbnewsh.ATT.COM (ihor.j.kinal) writes:
> 	awk "BEGIN { print \"'\" } "

Congratulations for testing your solution before posting it, but it
only works under sh. In contrast,

	awk 'BEGIN { print "'\''" } '

works under sh and csh. (More complicated? Give me a break.)

---Dan

-----------------------------

From: David Steffens <das@eplunix.uucp>
Subject: tcsh and process groups
Date: 10 Jan 90 21:47:38 GMT
To:       unix-wizards@sem.brl.mil

Late last summer (August?) there was a discussion in this group
about how csh/tcsh handles process groups.  The problem as I remember
was that under SunOS on a SUN4, you don't want to use vfork().
But vfork() enforces a certain processing order which is absent otherwise.
So if you don't use vfork(), you end up with the following annoyance:
	% egrep foo bar.c | less
	Stopped (tty output)
	%

The discussion seemed to revolve around how process groups are set up
for pipelines.  Chris Torek (I think) said that there was a race.
I don't remember whether it was ever explained why this problem
doesn't occur with the SunOS4.0 version of csh.

At this point I lost track of the discussion -- too much work to keep up
with the volume in this group! -- so I never did hear if there ever
was a fix posted or suggested.  Anyone know what I'm talking about?
Can you fill me in?  Tell me where I can get a fix?  advTHANKSance
-- 
{harvard,mit-eddie,think}!eplunix!das	David Allan Steffens
243 Charles St., Boston, MA 02114	Eaton-Peabody Laboratory
(617) 573-3748				Mass. Eye & Ear Infirmary

-----------------------------


End of UNIX-WIZARDS Digest
**************************

postmaster@CCF.NRL.NAVY.MIL (SMTP MAILER) (01/12/90)

 ----Mail status follows----
Have been unable to send your mail to <whitis@rira.nrl.navy.mil>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 11 Jan 90 11:01:00 EST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#042
To: "whitis" <whitis@rira.nrl.navy.mil>

Return-Path: <@nrl3.arpa:unix-wizards-request@sem.brl.mil>
Received: from nrl3.arpa by nrl3.arpa with SMTP ; Thu, 11 Jan 90 10:59:45 EST
Received: from SEM.BRL.MIL by nrl3.arpa with SMTP ; Tue,  9 Jan 90 03:27:57 EST
Received: from SEM.BRL.MIL by SEM.brl.MIL id aa21640; 9 Jan 90 3:01 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa21575; 9 Jan 90 2:45 EST
Date:       Tue, 09 Jan 90 02:45:18 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#042
Message-ID:  <9001090245.aa21575@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Tue, 09 Jan 1990              V9#042

Today's Topics:
                Re: Access to UNIX-Related Publications
  Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications)
                        Sun4/SUNOS4.0.1 and tcsh
                        Re: fcntl/socket anomaly
Re: Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)
                    How to create a restricted shell
                  Re: How to create a restricted shell
                 Re: GNU Emacs, memory usage, releasing
            How to delete a file with ^? chars in the name?
                    Need a Tape Drive Hardware guru
                            Re: fuzzy strcmp
                      Re: PWD in Bourne Shell PS1

-----------------------------------------------------------------

From:  Sun Visualization Products <matthew@sunpix.uucp>
Subject: Re: Access to UNIX-Related Publications
Date: 7 Jan 90 18:39:55 GMT
To:       unix-wizards@sem.brl.mil

In article <166@omaha1.UUCP> wcc@omaha1.UUCP (William C Carey) writes:
>
>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).  I can't get the 'print' or
>


Here's an example that should get you in the right direction:

awk 'BEGIN { 
	SQ = sprintf("%c", 39);
	DQ = sprintf("%c", 34);
}
{
	printf("%cHow is this?%c\n", DQ, DQ);
	printf("%cAnd this?%c\n", SQ, SQ);
}


-- 
Matthew Lee Stier                            |
Sun Microsystems ---  RTP, NC  27709-3447    |     "Wisconsin   Escapee"
uucp:  sun!mstier or mcnc!rti!sunpix!matthew |
phone: (919) 469-8300 fax: (919) 460-8355    |

-----------------------------

From: Paul Lew <lew@gsg.uucp>
Subject: Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications)
Date: 7 Jan 90 21:02:40 GMT
To:       unix-wizards@sem.brl.mil

>In article <166@omaha1.UUCP> wcc@omaha1.UUCP (William C Carey) writes:
>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).  I can't get the 'print' or
>the 'printf' statement to do it with any combination of backslashes,
>double-quotes, or percent characters.

Try avoid using quotes, double-quotes will make life a lot easier.  I use
the following:

	BEGIN	{ q = 39; }
		{
		printf "this is a quote: %c\n", q;
		}

this free you up to worry about what you want to do instead of quoting
problem.  Just remember the decimal value for quote is 39, I did not start
using this method until I memorized its value (the most intuitive reaction
a programmer has at that point is to use "quote" mostly because he can
not remember the decimal value for quote and dont feel like look into the
ASCII table for it!)
-- 
Paul Lew (lew@gsg.gsg.com)		UUCP:		oliveb---+
						uunet---samsung--+
General Systems Group, 5 Manor Parkway			harvard--+--gsg--lew
Salem, NH 03079	(603) 893-1000				decvax---+

-----------------------------

From: Jussi Eloranta <eloranta@jyu.fi>
Subject: Sun4/SUNOS4.0.1 and tcsh
Date: 8 Jan 90 07:59:18 GMT
To:       unix-wizards@sem.brl.mil


I recall some discussion about tcsh problems with pipes..
but I was unable to find the fixed version of tcsh for sun4/sunos4.0.1
(or does it exist at all?)

Thanks,

Jussi
-- 
============================================================================
Jussi Eloranta               Internet(/Bitnet):
University of Jyvaskyla,     eloranta@tukki.jyu.fi
Finland                      [128.214.7.5]

-----------------------------

From: Chris Torek <chris@mimsy.umd.edu>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 08:27:10 GMT
To:       unix-wizards@sem.brl.mil

>In article <10763@encore.Encore.COM> peralta@encore.com (Rick Peralta) writes:
>>Why when setting the F_SETOWN on a socket a pfind is not done on the PID?
>>Maybe more to the point, why the double standard on how a pgrp is specified?

4.3-tahoe does a pfind, but not for pgroups (negative values), only for
pids (positive values), and only when translating to TIOCSPGRP (more
below).

In article <129970@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>F_SETOWN has been a botch from day one as far as I'm concerned.  For
>those who don't know (or don't remember) F_SETOWN is used to say "send
>this pid the SIGIO when the time is right".  The documentation has
>always said that you can specify pgrps instead of pids (one of them was
>negative to indicate the type) and SunOS, at least, never did that
>(stay tuned).

Actually, I am fairly sure that SunOS 3.x had the 4.2BSD bug where pid
and pgroup were reversed (between documentation and code).  Whether that
has been fixed, I do not know.  (The SunOS 4.x code is substantially
different, and I have not read it.)

>Furthermore, the F_SETOWN uses the same field in the tty
>structure that the tty sub system uses for job control (where ^Z and
>others get sent).  So if you use F_SETOWN on an active tty you get very
>strange things happening.

(The following applies only to 4.3BSD and otherwise-unchanged derivatives
thereof.)

F_SETOWN on an inode translates into a TIOCSPGRP ioctl, so that whatever
checks are applied to TIOCSPGRP are applied to fcntl(ttyf, F_SETOWN).
The translation goes like this:

	if (value > 0) {		[value is a pid, not a pgroup]
		struct proc *p = pfind(value);
		if (p == 0)
			return (ESRCH);
		value = p->p_pgrp;
	} else				[value is a negated pgroup ID]
		value = -value;
	return (fioctl(fp, (int)TIOCSPGRP, (caddr_t)&value);

For a socket, it sets ((struct socket *)fp->f_data)->so_pgrp to the
given value.  Tty pgroups are stored in tp->t_pgrp: a different place.

>My guess is that the SIGIO interface was a hack that some grad student
>needed.

Not really.  It does seem to be done rather badly, however.

>They hacked it in, it works in the obvious cases, it's stuck
>around.  It needs a rewack to be clean (I just checked SunOS - we do
>absolutely no permissions checks on F_SETOWN on sockets).

They are unnecessary.   SIGIO is a completely benign signal.  If a
process is not catching it, SIGIO is discarded.  If a process *is*
catching it, that process is required to figure out why the SIGIO occurred
and whether it still has any reason to do anything about it, so extra
SIGIO signals merely reduce efficiency.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris

-----------------------------

From: "Steven M. Schultz" <sms@wlv.imsd.contel.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 09:11:26 GMT
Sender: news@wlbr.imsd.contel.com
To:       unix-wizards@sem.brl.mil

In article <129970@sun.Eng.Sun.COM> lm@sun.UUCP (Larry McVoy) writes:
>In article <10763@encore.Encore.COM> peralta@encore.com (Rick Peralta) writes:
>>
>>Why when setting the F_SETOWN on a socket a pfind is not done on the PID?
>>Maybe more to the point, why the double standard on how a pgrp is specified?
>
>F_SETOWN has been a botch from day one as far as I'm concerned.  For
	
	amen.

>those who don't know (or don't remember) F_SETOWN is used to say "send
>this pid the SIGIO when the time is right"...
>Furthermore, the F_SETOWN uses the same field in the tty
>structure that the tty sub system uses for job control...
>My guess is that the SIGIO interface was a hack that some grad student
>needed.  They hacked it in, it works in the obvious cases, it's stuck
>around...

	The hack/botch is the F_SETOWN, or rather the whole fcntl(2) syscall.
	As i recall fcntl(2) was (needlessly?) instituted by the creators of 
	System V(anilla) and adopted by Berkeley as a compatability measure,
	nothing that really couldn't be done by ioctl(2) but a new syscall
	was created anyhow.

	and don't forget the overlaying (reuse) of the VTIME and VEOT
	members of the AT&G Unix tty system - switch modes from to/from
	'cbreak' and you have surprises too.  but then, i suppose it was
	done by a graduate student... .5;-)

	Steven

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 18:29:08 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <21691@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
>F_SETOWN on an inode translates into a TIOCSPGRP ioctl, so that whatever
>checks are applied to TIOCSPGRP are applied to fcntl(ttyf, F_SETOWN).
>The translation goes like this:
>
>	if (value > 0) {		[value is a pid, not a pgroup]
>		struct proc *p = pfind(value);
>		if (p == 0)
>			return (ESRCH);
>		value = p->p_pgrp;
>	} else				[value is a negated pgroup ID]
>		value = -value;
>	return (fioctl(fp, (int)TIOCSPGRP, (caddr_t)&value);

Those checks are inappropriate for the F_SETOWN.  For example, POSIX
insists that the tty in question be your controlling tty.  That's both
unecessary and unlikely for processes wanting SIGIO on a tty.

>>My guess is that the SIGIO interface was a hack that some grad student
>>needed.
>
>Not really.  It does seem to be done rather badly, however.
>
>>They hacked it in, it works in the obvious cases, it's stuck
>>around.  It needs a rewack to be clean (I just checked SunOS - we do
>>absolutely no permissions checks on F_SETOWN on sockets).
>
>They are unnecessary.   SIGIO is a completely benign signal.  If a
>process is not catching it, SIGIO is discarded.  If a process *is*
>catching it, that process is required to figure out why the SIGIO occurred
>and whether it still has any reason to do anything about it, so extra
>SIGIO signals merely reduce efficiency.

Permission checks are rarely "unnecessary", it's much more likely that
they're either missing or incorrect.  In this case, they're missing.
Suppose I have process A and process B.  A does a F_SETOWN on some
socket and then goes on, expecting a SIGIO at some later time.  B comes
along, and also does a F_SETOWN on the same socket.  A has been
robbed.

To head off a needless discussion: yes, I realize that if you do the
"right thing" everything is OK and there is no need for permission
checks.  My claim is that the number of programmers who "do the right
thing" (sorry spike) are getting fewer and fewer.
---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: Peter da Silva <peter@ficc.uu.net>
Subject: Re: Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)
Date: 8 Jan 90 15:05:53 GMT
To:       unix-wizards@sem.brl.mil

>    What I mean here is that you can allocate your block poimters, then call
>    map_fd to map the file into memory.

> The problem is that unless you copy the file on disk you can't back
> out of your edits at the last moment (:q! for vi people).  If you're
> going to copy the file you might as well copy it into vmem.

You misunderstand. I wasn't suggesting making direct edits on the memory
image. On the contrary, you map it in read-only if you can. What I was
suggesting was that since most of the things you're doing to the file don't
involve modifying it, you might as well page it in from disk when you
need it, only coping it to writable memory when you want to modify it.

For example, suppose you want to do a search and replace. You fault in
all the pages from here to the replacement location, copy the block that
contains the replacement into two new blocks (using the block-splitting
method) and add the new text. The blocks you just read can be discarded
when needed by the memory manager, rather than having to be written out
to the paging area, saving considerable disk access. Only modified blocks
would need to be written.
-- 
 _--_|\  Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \ Also <peter@ficc.lonestar.org> or <peter@sugar.lonestar.org>
\_.--._/
      v  "Have you hugged your wolf today?" `-_-'

-----------------------------

From: Tzu-Hsi Pan <pantz@nsf1.mth.msu.edu>
Subject: How to create a restricted shell
Keywords: restricted shell
Date: 8 Jan 90 16:19:51 GMT
Sender: usenet@cps3xx.uucp
To:       unix-wizards@sem.brl.mil


Could someone tell me how to build up a restricted shell for some user
such that only a couple of commands can be executed under a new root
environment?  Thanks.

-Pan (pantz@mth.msu.edu)

-----------------------------

From: Wm E Davidsen Jr <davidsen@crdos1.crd.ge.com>
Subject: Re: How to create a restricted shell
Keywords: restricted shell
Date: 8 Jan 90 20:05:48 GMT
To:       unix-wizards@sem.brl.mil

In article <5946@cps3xx.UUCP> pantz@mth.msu.edu (Tzu-Hsi Pan) writes:
| 
| Could someone tell me how to build up a restricted shell for some user
| such that only a couple of commands can be executed under a new root
| environment?  Thanks.

  rsh works with /bin/sh and ksh. You can either execute the rsh command
(SysV) or execute the shell with the -r flag. You simply set the PATH to
point to a directory containing only the things you want to allow, and
then (assuming a recent shell) set the PATH variable readonly. I usually
create a /usr/rbin directory and link stuff in from /bin and /usr/bin.

Ex:
	PATH=/usr/rbin
	readonly PATH; export PATH

-- 
bill davidsen	(davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon

-----------------------------

From: Craig Finseth <fin@uh.msc.umn.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 16:43:41 GMT
Sender: news@uc.msc.umn.edu
To:       unix-wizards@sem.brl.mil

In article <IN_S4Eggpc2@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>There seems to be an assumption here that the only possible methods are
>buffer gap and a linked list of lines. What about a linked list of larger
>blocks? ...

Think of pure buffer gap and linked line as opposite ends of a
continuum.  (Technically, linked character would be on the one end,
but I will ignore that case.)  Pure buffer gap has one chunk, which is
the entire object.  As you divide it into separate chunks (paged
buffer gap), the number increases and their size decreases.
Eventually, you get to a chunk size of one line and have linked line.

In may of the intermediate cases, whether you use an array or linked
list is an implementation detail.

Craig A. Finseth			fin@msc.umn.edu [CAF13]
Minnesota Supercomputer Center, Inc.	+1 612 624 3375

-----------------------------

From: Craig Finseth <fin@uh.msc.umn.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 16:48:15 GMT
Sender: news@uc.msc.umn.edu
To:       unix-wizards@sem.brl.mil

In article <SN_87Eggpc2@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>> I contend that in a "modern workstation environment" (e.g., Sun 3/60),
>> a simple buffer gap method is preferred over both paged buffer gap and
>> linked line.  I leave it as an excercise for the reader to figure out
>> why.

>I'm not sure this is a valid conclusion. If 75K is the optimal file size
>for a buffer-gap solution, how about paged buffer-gap with 75K pages? Or
>to add a bit of compromise with some of today's brain-dead architectures
>perhaps 64K pages would work nearly as well.

Where did this "75K" figure come from?  It wasn't mentioned by me.  It
would be a very unusual constant to remain constant over a wide range
of architectures, speeds, memory sizes, and other performance-related
figures.

In particular, I have had no trouble editing multi-megabyte files in
GNU Emacs on a Sun 3/280 w/8 MBytes of memory.

Craig A. Finseth			fin@msc.umn.edu [CAF13]
Minnesota Supercomputer Center, Inc.	+1 612 624 3375

-----------------------------

From: Joe Weening <weening@gang-of-four.stanford.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Date: 8 Jan 90 21:56:27 GMT
Sender: USENET News System <news@neon.stanford.edu>
Followup-To: comp.editors
To:       unix-wizards@sem.brl.mil

I'm posting this message to help RMS's desire to remove the discussion
of editor implementation methods from gnu.emacs.

The discussion is currently going on in comp.editors, gnu.emacs and
comp.unix.wizards.  Therefore not everyone contributing to the
discussion may have seen RMS's messages.

The discussion is appropriate for comp.editors, so that's where I'm
directing followups to this message.  It is not appropriate for
gnu.emacs, since that group is meant for short announcements only.  It
is not at all appropriate for comp.unix.wizards and should never have
been posted there.

Please, everyone, let's move this discussion to comp.editors only.  If
you want to continue reading it, subscribe to that newsgroup.
--
Joe Weening                                Computer Science Dept.
weening@Gang-of-Four.Stanford.EDU          Stanford University

-----------------------------

From: Ron Ueberschaer x4399 <ubi@ginger.sri.com>
Subject: How to delete a file with ^? chars in the name?
Date: 8 Jan 90 16:53:11 GMT
Sender: news@unix.sri.com
To:       unix-wizards@sem.brl.mil

I have a file which is named ^?^?^?H01.b (delete character?) and can't
find a way to delete it.  An ls -s on the directory produces:

   ..	... (other files)
    1	???H01.b

If I do an ls *.b, it lists the other .b files, but complains:

	H01.b not found

I've tried:

	rm -i *			(to selectively delete everything)
	rm "???H01.b"
	rm "^v^?^v^?^v^?H01.b"  (control-v delete ...)

and nothing seems to work.

Help me, o wizards!

--Ron Ueberschaer
  ubi@unix.sri.com
  ...!{hplabs,rutgers}!sri-unix!ubi

-----------------------------

From: Ira Rampil <rampil@cca.ucsf.edu>
Subject: Need a Tape Drive Hardware guru
Keywords: Tape, guru, $$$$
Date: 8 Jan 90 21:12:36 GMT
To:       unix-wizards@sem.brl.mil

It was a classic story.  A friend was using a kennedy clone
streaming tape on a PDP-11 to record lab data.  The original
drive 'disappeared' and now he needs to read his old tapes.
He has another Kennedy drive but it can not read most of the
tapes - we hypothesize a relative head misalginment.

Is there anyone out there with the requisite skill to retrieve
the data.  It is worth BIG bucks to my colleague!

Any clues, hints or vectors would be much appreciated!
Thanks,

Ira Rampil, MSEE, MD
Dept of Anesthesia
Univ. Cal, San Francisco

(415) 476-9037, or rampil@cca.ucsf.edu

-----------------------------

From: Fred Mitchell - PA <mitchell@cbmvax.commodore.com>
Subject: Re: fuzzy strcmp
Date: 8 Jan 90 22:30:42 GMT
To:       unix-wizards@sem.brl.mil

In article <297@hhb.UUCP> istvan@hhb.UUCP (Istvan Mohos) writes:
>tchrist@convexe.uucp (Tom Christiansen @ Convex Computer) writes:
>>I'm looking for an algorithm that would allow me to determine
>>whether two strings were similar.  Thus 
>>
>>	"abcde" !~ "xyzzy"
>>	"this old man can read" =~ "that old man can't read"
>>
>>... perhaps just
>>    float   strfzcmp(string1,string2)

I will give a general description of an algorithm that can accomplish
what you ask.

NOTE: I am doing this from the 'top of my head'. Some refinement may
be in order.

You will do a weighted comparision based on two factors:
a) The number of characters each string has in common
b) The number of matches the strings have in sequence

Let's take two arbitrary strings:
	"This old man can't read"    string alpha
	"That silly man can't read"  string beta

Notice that they are of different lengths. Also, there is an alignment
shift. The following algorithm _should_ properly handle this:

a) Count the number of occurences of each character in each string.
   Compare the count of each character in alpha to that in beta in the
   following way:
     For each different character from alpha & beta:
	Normalize the counts so that the greater is normalized to 1.
	Multiply the two normalized values toghether.
	Add this product to a running total.
     Normalize this total by the the length of the longest string
     Multiply that by weight w1 yeilding (we shall call it) yw1

b) Compare the two strings byte for byte as follows:
     Start at the beginning of alpha & beta (let's use i and j as indexes)
     initialize k to 0
     Until we hit the end of either string:
	if (alpha[i] == beta[j])
		++k, ++i, ++j
	else 
		we scan forward on beta to find a byte that matchess
		our current location on alpha. If so, adjust j to index
		it. If nothing was found, do vice-versa for alpha.
     When the above loop is completed,
     Normalize k against the size of the longest string
     and multiply it by weight w2 yeilding (we shall call it) yw2.

     return (yw1 + yw2) / (w1 + w2)


This should produce a good evaluation of how closely matched alpha
is to beta, taking into account mis-alignment. The value returned
will be between 0 and 1 inclusive. Weight w1 should be less than w2.
Perhaps w1 = w2 / 3. Experiment.

As I said, this is off the top of my head, so some refinement is in
order, as should be evident during the implementation/testing phase.

If anyone knows of a better way to accomplish this, let's hear it!

	-Mitchell
	 mitchell@cbmvax.UUCP
	 "The shortening of the Way."

 
		

-----------------------------

From: Dan Mercer <mercer@ncrcce.stpaul.ncr.com>
Subject: Re: PWD in Bourne Shell PS1
Date: 8 Jan 90 23:12:54 GMT
Keywords:
To:       unix-wizards@sem.brl.mil

In article <18@choreo.COM> chris@choreo.UUCP (Chris Hare / System Manager) writes:
:In article <8790.259b3142@ecs.umass.edu> Satam writes,
:> Inserting the following three aliases will help achieve the same
:> effect. Note that this is only for csh.
:> ------------------------------------------------------------
:> alias cd 'chdir \!* && set prompt="${cwd:t}_\\!% "'
:> alias pushd 'pushd \!* && set prompt="${cwd:t}_\\!% "'
:> alias popd 'popd \!* && set prompt="${cwd:t}_\\!% "'
:> -------------------------------------------------------------
:
:This is quite true.  However, a similar thing can be implemented in the
:Bourne shell using shell functions.  There are however two caveats :
:
:	1.  We cannot use the name of a built in shell command 
:	2.  We must recaculate the PS1 each time we do a cd.
:
:Firstly,  becase we want the PS1 to be updated whenever we change
:directories, we cannot use the builtin 'cd' command, but something like it.
:We must also remember to use the new command, because using a cd will mean
:that the directory reflected in our PS1 will be incorrect.
:
:You can try this Bourne shell function :
:
:	go()
:	   {
:	   if [ "$1" ]		# if we got an argument
:	   then
:	      cd $1
:	   else 		# otherwise go home
:	      cd $HOME
:	   fi
:	   PS1=`pwd`"> "	# change the PS1
:	   }
:

For what it's worth,  here is how I implemented things (from
file /usr/acct/ME/bin/.functs which I invoke as . .functs in
my .profile)

#
#       This file invokes function definitions
#
# ps3="`cat /etc/NODENAME`/`basename \`tty\``> "  # set in .profile
pd() { RT=$PWD; cd $1; PWD=`pwd`; PS1="$PWD
${ps3}"; }
lpd()	{ pd $1; ls; }
rt() { pd $RT; }

pd (path directory) changes my directory and reflects the current
directory as the first line of my two line prompt.  The second line
tells me what system I am on (I have access to several) and what
line (I also have a variety of ways to tie in - modem,  direct line,
pass thru line,  Token Ring).  If I am in a sub shell,  a /n is 
appended to the line number to indicate depth,  since I'm frequently
nested through some intermediary program or other.

I can toggle between two directories with the rt command,  very
useful wehn transferring files (mv pattern $RT).

:Remember, shell functions are not passed to their subshells.
:
But are accessible by shell scripts called by current shell.  If
you are lucky enough to have an NCR Tower (no flames please,  they
are my employers) they have the delightful .shrc feature implemented
that gets invoked when you fork an interactive shell.  Once I found
that gem (by accident - it's not documented)  I was able to invoke
my function definitions on all shell levels.

I have lots of other shifty functions.  vi (no args) for instance,
edits my last edited file rather than a file with no name.  Very
useful when mucking with balky items like makefiles.


:Chris Hare				Choreo Systems Inc.
:Coordinator, Systems Management		150 Laurier Ave West
:Authorized SCO Instructor		Ottawa, Canada
:					Phone 613-238-1050
:					Fax   613-238-4453
:*** It Works for ME ! ***		email : uunet!choreo!chris


-- 

Dan Mercer
Reply-To: mercer@ncrcce.StPaul.NCR.COM (Dan Mercer)

-----------------------------


End of UNIX-WIZARDS Digest
**************************

postmaster@nrl3.arpa (SMTP MAILER) (01/12/90)

 ----Mail status follows----
Have been unable to send your mail to <whitis@rira.nrl.navy.mil>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 11 Jan 90 11:33:00 EST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#043
To: "whitis" <whitis@rira.nrl.navy.mil>

Return-Path: <@nrl3.arpa:unix-wizards-request@sem.brl.mil>
Received: from nrl3.arpa by nrl3.arpa with SMTP ; Thu, 11 Jan 90 11:30:22 EST
Received: from SEM.BRL.MIL by nrl3.arpa with SMTP ; Wed, 10 Jan 90 03:39:40 EST
Received: from SEM.BRL.MIL by SEM.brl.MIL id aa03862; 10 Jan 90 3:00 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa03781; 10 Jan 90 2:45 EST
Date:       Wed, 10 Jan 90 02:45:12 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#043
Message-ID:  <9001100245.aa03781@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Wed, 10 Jan 1990              V9#043

Today's Topics:
                     filenames with a '/'  -- help
                   Re: filenames with a '/'  -- help
                              yacc and lex
                 Re: GNU Emacs, memory usage, releasing
                        Re: fcntl/socket anomaly
          Re: How to delete a file with ^? chars in the name?
          Number of chars in input queue - terminal, keyboard
                   Re: C Documentation Utility Needed
Obtaining a unique, "unchangeable" number associated with an SGI workstation
        Re: new mscp code in Ultrix 3.1 (was Boot block trashed)
                Re: Access to UNIX-Related Publications
                     Wanted: fast tar across ether

-----------------------------------------------------------------

From: "Gregory S. Baber" <gregb@dowjone.uucp>
Subject: filenames with a '/'  -- help
Date: 8 Jan 90 20:28:44 GMT
To:       unix-wizards@sem.brl.mil

Hello,
	I moved some files from a Mac to a NeXT using a GatorBox,
and then took the NeXT off the network. Some of the files that were
on the Mac had a '/' as part of the actual filename. How do I delete
these from the NeXT now without reconnecting to the network? When I
try to delete the files by hand, the shell responds with "file does
not exist" because it interprets the '/' as a directory indicator.
I even tried to double quote the filename to no avail. Any ideas?

Thanks, gregb

-- 
Reply to: Gregory S. Baber		Voice:	(609) 520-5077
   Dow Jones & Co., Inc.		UUCP:	..princeton!dowjone!gregb
   Box 300				or	..uunet!warlock!gregb
   Princeton, N.J. 08543-0300		"So long, and thanks for all the fish"

-----------------------------

From: "seth.zirin" <szirin@cbnewsm.att.com>
Subject: Re: filenames with a '/'  -- help
Date: 9 Jan 90 18:20:31 GMT
To:       unix-wizards@sem.brl.mil

In article <646@warlock.UUCP> gregb@dowjone.UUCP (Gregory S. Baber) writes:
>and then took the NeXT off the network. Some of the files that were
>on the Mac had a '/' as part of the actual filename. How do I delete
>these from the NeXT now without reconnecting to the network? When I
>try to delete the files by hand, the shell responds with "file does
>not exist" because it interprets the '/' as a directory indicator.

You have several options:

1) reformat the disk (JUST KIDDING!!) :-)

2) fsck the filesystem.  some versions of fsck will not permit illegal
   characters in names.  if your version of fsck cannot fix it, complain
   to your vendor about the bug in their fsck.

3) use fsdb to locate and edit the disk block that contains the filename
   with the '/'.  Change the '/' to a more palatable character.
   WARNING: this is not for the weak-hearted!

4) copy everything else from the parent directory to a safe spot and
   iclear or unlink the parent directory and run fsck.  if the bad
   name is a file (as opposed to a subdirectory), fsck will copy it
   to the lost+found and give it a civilized name.  if you have a
   directory tree of bad subdirectory names, this will become a
   recursive process.

the above procedures assume that the filesystem is mounted/unmounted
appropriately.  when you're all done and you haven't roached the whole
filesystem or the entire disk, hold your head high; you've earned one
star towards becoming a wizard.

discussion of the other stars should be referred to /dev/null as we just
finished that topic.

Seth Zirin

-----------------------------

From: Chuck Cartledge <chuck@virgil.uucp>
Subject: yacc and lex
Keywords: yacc,lex,error checking
Date: 8 Jan 90 20:51:49 GMT
Followup-To: comp.lang.c
To:       unix-wizards@sem.brl.mil


Pardon the cross posting, but I'm not sure where the answer is for this
question.

I would like to use a yacc/lex generated program segment as a operator input
validation routine, rather then having to write my own from the ground up.
What I am trying to generate either automatically via yacc/lex or with only
minor manual mods, is a function that looks like this:

	valid_data (character_string, data_type, addr1, addr2, ...)

Is there a way to get something like this??

Any help would be appreciated.  Thanks.
-- 
Chuck Cartledge (804)498-1012 (voice-play)                 chuck@virgil.UUCP
EDO Corporation (804)424-1004 (voice-work)
Virginia Operations
814 Greenbrier Circle, Chesapeake Va.  23320

-----------------------------

From: Peter da Silva <peter@ficc.uu.net>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 22:07:52 GMT
To:       unix-wizards@sem.brl.mil

> >> I contend that in a "modern workstation environment" (e.g., Sun 3/60),
> >> a simple buffer gap method is preferred over both paged buffer gap and
> >> linked line.  I leave it as an excercise for the reader to figure out
> >> why.

> >I'm not sure this is a valid conclusion. If 75K is the optimal file size

> Where did this "75K" figure come from?

I honestly don't remember. It was mentioned by someone in this forum.

I do think, though, that for any given system there is such an optimal size.
It may be that on your workstation that size is measured in megabytes... on
others it may be a few K. I wonder how it feels on a NeXT that's paging over
the network or onto the OD?

> >for a buffer-gap solution, how about paged buffer-gap with 75K pages? Or
> >to add a bit of compromise with some of today's brain-dead architectures
> >perhaps 64K pages would work nearly as well.

> In particular, I have had no trouble editing multi-megabyte files in
> GNU Emacs on a Sun 3/280 w/8 MBytes of memory.

Having "no trouble" with something doesn't mean you have the optimal
solution. Just that you have *a* solution.
-- 
 _--_|\  Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \ Also <peter@ficc.lonestar.org> or <peter@sugar.lonestar.org>
\_.--._/
      v  "Have you hugged your wolf today?" `-_-'

-----------------------------

From: Jim Cathey <jimc@isc-br.isc-br.com>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 9 Jan 90 19:20:13 GMT
Followup-To: comp.editors
To:       unix-wizards@sem.brl.mil

>The better solution, made relatively easy by the reasonably modular and
>layered structure of GNU emacs, would be to accept The Emacs Cookbook
>recommendation (adopted by Jove and the MicroEmacs/Gnu family of editors) and
>implement a linked list system. I would suggest just reading (or map, on the
>operating systems that allow it) the file to be edited as a large lump of
>virtual address space, then building a linked list of pointers to lines
>therein, and then to allocate modified lines from ageneral purpose arena.
>Informing the OS of the peculiar access patterns would also help, if
>possible.

So long as line-oriented operation preserved the ability of Gnu Emacs
to edit binary files that have no 'lines' at all.  The MicroEmacs we
have here will choke on these (as does vi, ed, see, siv, and all the
other editors we have), and MicroEmacs' line orientation is so badly
implemented that if (at our site) the file is larger than about 50K it
is _faster_ to start emacs on the file than MicroEmacs.  MicroEmacs
starts faster, but it reads files _much_ slower (fgets,malloc,strcpy).

Somebody or other's master's thesis was on buffer styles (I got a copy with
my copy of MINCE a few years ago), and his conclusion was that the gap method
worked best.  That may have been on a machine that wasn't DPV, though.

Moving the gap by, say, 20 characters should affect at most two pages (four,
if you assume it straddles a page boundary on both ends but this is true for
any scheme and may be disregarded).  A block with a line pointer array might
also affect two pages (the block and the buffer array) so I don't offhand
see the advantage.  Jumping about wildly would touch a lot of pages, but the
assumption is that you work a lot in one place.  The gap approach makes it
very quick to _save_ files, so the auto-save feature is unobtrusive.  It would
be absolutely useless if it took 5-10 seconds to rearrange the line-pointer
and block mess to get it into savable form, or write a line at a time.

If realloc can't do the right thing it should be replaced by one that can.
I believe GNU isn't interested in supporting non-GNU machines (read VAX)
to the extent that it corrupts the architecture of the program.  I somewhat
agree with them in that broken environments shouldn't be catered to, but 
repaired instead.

It would be nice if emacs did sbrk- when it could.  In our environment, we
can also release holes in the _middle_ of the heap.  We added an additional
system call for it.  This gets pages out of the swap space, but they'll be
reallocated (and cleared to zero) if you touch in the hole.

We have a limited virtual address space (2M on some machines, 4M on most 
others) so GNU can't edit those really big log files.  I think only elle can
of the editors I've experienced.  I think it uses linked blocks.

GNU Emacs _is_ awfully large, though, but I haven't noticed any machine
eating behavior.  Of course, we have a lot of smaller machines here, so few
use it at once.  Far more noticible is simultaneous compiles.

+----------------+
! II      CCCCCC !  Jim Cathey
! II  SSSSCC     !  ISC-Bunker Ramo
! II      CC     !  TAF-C8;  Spokane, WA  99220
! IISSSS  CC     !  UUCP: uunet!isc-br!jimc (jimc@isc-br.iscs.com)
! II      CCCCCC !  (509) 927-5757
+----------------+
			"With excitement like this, who is needing enemas?"

-----------------------------

From: Chris Torek <chris@mimsy.umd.edu>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 9 Jan 90 08:24:01 GMT
To:       unix-wizards@sem.brl.mil

In article <129979@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>Those checks [applied by TIOCSPGRP] are inappropriate for the F_SETOWN.
>For example, POSIX insists that the tty in question be your controlling tty.
>That's both unecessary and unlikely for processes wanting SIGIO on a tty.

Ah: this is different from what you said (or at least, what I understood)
before.  Now you seem to mean `any process should be allowed to ask for
SIGIO on any file descriptor to which it can apply an fcntl, and should
receive SIGIO signals whenever it could read from / write to that descriptor.'

(This is a reasonable interpretation of what SIGIO should be, but would
require major kernel restructuring, since per-file-descriptor flags can
only be stored in a u. area.)

>Suppose I have process A and process B.  A does a F_SETOWN on some
>socket and then goes on, expecting a SIGIO at some later time.  B comes
>along, and also does a F_SETOWN on the same socket.  A has been
>robbed.

Ah.  This, of course, is a property of the shared-ness of descriptors.
A dup()ed descriptor (either with the dup() or dup2() system calls,
or simply shared across fork+exec) has only one underlying object,
and (for reasons having to do with the basic kernel structure) signals
have to refer to the underlying object%, hence are shared.

Fortunately, two different endpoints on a socket are not shared.  A
program (your `A') that passes its own socket endpoint to another program
(your `B') has explicitly---well, okay, implicitly---given control of
the socket to the second program.  For instance, `B' could issue a
shutdown on the socket as well.

Thus, I think this objection does not apply.  (It *does* apply to tty
devices.)

 -----
% Actually, they refer to the object underlying the underlying object,
  in the case of inodes; but this, at least, could be changed in
  principle.  (Thread a linked list of signal info through the file
  table.)  Then you have the problem of *giving up* SIGIO signals for
  a descriptor.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 9 Jan 90 21:40:16 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <21710@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
>In article <129979@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>>Those checks [applied by TIOCSPGRP] are inappropriate for the F_SETOWN.
>>For example, POSIX insists that the tty in question be your controlling tty.
>>That's both unecessary and unlikely for processes wanting SIGIO on a tty.
>
>Ah: this is different from what you said (or at least, what I understood)
>before.  Now you seem to mean `any process should be allowed to ask for
>SIGIO on any file descriptor to which it can apply an fcntl, and should
>receive SIGIO signals whenever it could read from / write to that descriptor.'

Well, while I agree that this would be nice, it's not at all what I
meant and I think you know it.  SIGIO is commonly applied to tty's.
The point you made about permission checks is bogus because POSIX won't
let you get SIGIO on anything but your controlling terminal if you
continue with this braindead implementation that calls TIOCSPGRP.

>>Suppose I have process A and process B.  A does a F_SETOWN on some
>>socket and then goes on, expecting a SIGIO at some later time.  B comes
>>along, and also does a F_SETOWN on the same socket.  A has been
>>robbed.
>
>Ah.  This, of course, is a property of the shared-ness of descriptors.

Not really.  If sockets can be named in the file system (Unix domain) then
you can get at it by opeing the file (like the printer for instance).

>A dup()ed descriptor (either with the dup() or dup2() system calls,
>or simply shared across fork+exec) has only one underlying object,
>and (for reasons having to do with the basic kernel structure) signals
>have to refer to the underlying object%, hence are shared.
>
>Thus, I think this objection does not apply.  (It *does* apply to tty
>devices.)

This is missing the point completely.  I don't care (and neither do
you) that cooperating processes can hurt each other (a new definition
of cooperating :-)  It's the tty and named socket case that's broken.


Let's take this offline, Chris - I think the horse is dead....
---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: currey tom 76327 <tcurrey@x102c.harris-atd.com>
Subject: Re: How to delete a file with ^? chars in the name?
Date: 9 Jan 90 14:22:36 GMT
Sender: news@trantor.harris-atd.com
To:       unix-wizards@sem.brl.mil


  You asked how to delete a file with deleted characters.  This depends
on the system you're using.  Here are 2 ways:

    Using the backslash for the meanings try:

            " rm \<DEL>\<DEL>\<DEL>H12.b "      {<DEL> is delete key}

    or last resort method

 	    Copy all other files into a temporary directory and 
            " rm -r <directory with bad file> " the copy them back
            after making a new directory.

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: How to delete a file with ^? chars in the name?
Date: 9 Jan 90 21:44:45 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <7711@unix.SRI.COM> ubi@ginger.sri.com (Ron Ueberschaer x4399) writes:
>I have a file which is named ^?^?^?H01.b (delete character?) and can't
>find a way to delete it.  An ls -s on the directory produces:
>
>   ..	... (other files)
>    1	???H01.b
>
>If I do an ls *.b, it lists the other .b files, but complains:
>
>	H01.b not found
>
>I've tried:
>
>	rm -i *			(to selectively delete everything)
>	rm "???H01.b"
>	rm "^v^?^v^?^v^?H01.b"  (control-v delete ...)
>
>and nothing seems to work.

$ cat > xxx.c
#include <stdio.h>
main()
{
	char buf[255];

	while (gets(buf))
		if (unlink(buf))
			perror(buf);
}
^D
$ cc xxx.c
$ a.out
????H01.b
^D

---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: "John W. DeBoskey" <jwd@sas.uucp>
Subject: Number of chars in input queue - terminal, keyboard
Keywords: QUEUE TERM KEYBOARD ISC 1.0.6
Date: 9 Jan 90 16:42:00 GMT
To:       unix-wizards@sem.brl.mil

Hello,

   The subject almost says it all. I'm running ISC 1.0.6. I want to
find out how many characters are available to read from the terminal
if there are any. ie: avail = in_queue(term_id). 

   A BSD answer is to use FIONREAD, but sVr3 doesn't have it, and I've
been unable to duplicate it. Please don't tell me to RTFM or read
the monthly intros. I have and they don't help. I'm starting to think
the only way I can do this is to actually issue a read, and do my own
internal buffering, but I DON'T really want to do this.

   If anyone has some ideas, or knows a way that isn't doc'd, please
let me know. I'd really appreciate it. Thanks!!

                                      John W De Boskey

jwd@sas.UUCP     (w)  jwd%sas@rti.rti.org
jwd@baggins.UUCP (h)  jwd%baggins@mcnc.mcnc.org

-----------------------------

From: Mike Ewan <mike@raven.uss.tek.com>
Subject: Re: C Documentation Utility Needed
Date: 9 Jan 90 16:53:45 GMT
Followup-To: comp.unix.wizards
To:       unix-wizards@sem.brl.mil

In article <10761@cadnetix.COM> rusty@cadnetix.COM (Rusty Carruth) writes:
>In article <625@h.cs.wvu.wvnet.edu> dymm@b.cs.wvu.wvnet.edu (David Dymm) writes:
>>
>>I am looking for a utility to help in the documentation of C code.
>>[...]
>
>Well, this will probably not help as much as I would like, but there
>is a program available for the PC family which does pretty-printing
>and such, and also can create the tree info you wanted.  I THINK
>it was by Polytron, but I could be wrong.  I'll try to find out
>and post again.  If anyone else knows of the actual company name,
>you might be really lucky and that company may have ported it to
>unix by now...


The company is Sage/Polytron, 1100 nw 167th Pl, Beaverton OR 97006
(503) 645-1150

I havn't used their PolyDoc product but have used their PVCS (RCS clone).
I'm pleased with the product.  They have been porting some of the
products to Unix.  If PolyDoc isn't ported you could always download
to a PC run the thing and then up load.


-- 
 Michael Ewan    (503)627-6468      Internet:  mike@raven.USS.TEK.COM
 Unix Systems Support                   UUCP:  ...!tektronix!puffin!raven!mike
 Tektronix, Inc.                   Compuserv:  73747,2304
"Fig Newton: The force required to accelerate a fig 39.37 inches/sec."--J. Hart

-----------------------------

From: Tony Rems <rembo@uts.amdahl.com>
Subject: Re: C Documentation Utility Needed
Date: 10 Jan 90 01:24:00 GMT
To:       unix-wizards@sem.brl.mil

In article <625@h.cs.wvu.wvnet.edu> dymm@b.cs.wvu.wvnet.edu (David Dymm) writes:
>
>I am looking for a utility to help in the documentation of C code.
>
>Input:  Multiple 'C' files.
>
>Output: A cross reference report showing the call hierarchy of
>	all functions.
>	Thus, the report might be in the form of a tree where
>	each function is listed showing from where it is called
>	and perhaps how many times it is called.
>
>
>David Dymm			Project Manager
>
>USMAIL: Bell Atlantic Knowledge Systems,
>        145 Fayette Street, Morgantown, WV 26505
>PHONE:	304 291-2651 (8:30-4:30 EST)
>USENET:  {allegra,bellcore, cadre,idis,psuvax1}!pitt!wvucsb!dymm
>INTERNET: dymm@b.cs.wvu.wvnet.edu

There is a set of tools from McCabe & Associates called Battlemap, ACT & 
the Inference Engine.  These tools are designed to measure complexity 
of C code (as well as code in other languages) and it runs under UNIX on
Sun and a few other platforms.  It can produce the calling structure
of a pieced of code as well as the internal structure of the code.
It can produce a report or a graph (or both) and using the inference 
engine it produce cross reference information on the internal 
structure of the code - including called-bys called-from calls-to 
and number of calls.  Although, I found it rather limited in its
capacity as a test tool - which was its purpose, it sounds like it
might suit your purposes.  If you'd like any more info, send me 
some e-mail.

-Tony

-----------------------------

From: Andrew Simms <ams@fourier.princeton.edu>
Subject: Obtaining a unique, "unchangeable" number associated with an SGI workstation
Keywords: copy protection, hostids, unique identifiers
Date: 9 Jan 90 18:23:06 GMT
Sender: news@phoenix.princeton.edu
Followup-To: comp.sys.sgi
To:       unix-wizards@sem.brl.mil

Some of the folks I work for would like to make a reasonably secure
scheme to insure their product runs only on machines they are
licensed to run on.  To do this, they would like to obtain a
read-only number (such as a motherboard serial number) that
could be used as a key to operate the software only on that
machine.  I know mathematica on the Irises has a program called
mathinfo that generates a unique number but I have no idea
what it does to get it.

If there is sufficient interest, I will be happy to post
a summary of responses emailed to me.

p.s.  Ethernet addresses won't quite do it, since it needs
	to run on machines without ethernet boards.
 ----------------------------------------------------------------------

  Andrew Simms					ams@acm.princeton.edu
  System Administrator
  Program in Applied and Computational Math
  Princeton University
  Princeton, NJ   08544
  609/258-5324 or 609/258-6227
  609/258-1054 (fax)

-----------------------------

From: Greg Wohletz <greg@duke.cs.unlv.edu>
Subject: Re: new mscp code in Ultrix 3.1 (was Boot block trashed)
Date: 9 Jan 90 20:15:35 GMT
Sender: news@jimi.cs.unlv.edu
To:       unix-wizards@sem.brl.mil

In article <1444@jimi.cs.unlv.edu>, I write:

> We have three microvax  II's that we  use as fileservers.  Each has  3
> Wren V's and   an Exabyte hooked  into  a  Sigma  scsi  controller  (it
> emulates  a  uda  and  tms controller).   They    also  have a Dec  uda
> controller hooked to  an  rd52 and two rx50's  (yes  we've had  these
> machines for  a while...) on  them.   We have been  running with  this
> configuration under Ultrix  2.0 without  many problems (well a few nfs
> bugs, but nothing major).  Recently we got Ultrix 3.1.  I installed it
> on one of  our microvax's  and everything seemed  to be  going fine, I
> could use the disks, and read from the Exabyte.  However, when I tried
> to dump the root filesystem  to the Exabyte  I got a write error, then
> some message like ``mscp resynching controller uq2'' at that point the
> system locked up.


Well,  I've  investigated the situation   a bit further,   and  I have
discovered that (surprise, surprise)  one difference  between  2.0 and
3.1 is that  all of the disk and  tape drive stuff  appears to have be
re-written.   Now  everything  (except  for  non-uda   type drives and
non-tmscp tapes) goes through this new mscp code (or at least  that is
what it looks  like to me).  Anyway looking  at the code didn't reveal
anything obvious,  however  I have noticed  that I  can't  dump to the
trusty (?) old rx50's.   The first volume  of the dump works fine, but
if you so  much as open the  door to the floppy  when dump asks you to
insert the next volume all subsequent  attempts to write to the floppy
will fail (if you leave the same floppy in (without opening  the drive
door) for  ALL of the volumes it  will work...).   I suspect that this
problem is related to the same bug.  I think  at this point I'm almost
convinced that it is a software bug, and not  a problem with the Sigma
controller, but I could be wrong.

So  the question  is, will  someone  from DEC tell  me if  there  is a
known/fixable bug in 3.1 that would cause this behavior?

Would if be possible to graft in the old tmscp  code  from 2.0 without
an inordinate amount of pain?

ANY information would be greatly appreciated.

    	    	    	    	    	--Greg
    	    	    	    	    	greg@unlv.edu
    	    	    	    	    	<@relay.cs.net:greg@unlv.edu>

-----------------------------

From: Barry Shein <bzs@world.std.com>
Subject: Re: Access to UNIX-Related Publications
Date: 9 Jan 90 23:47:04 GMT
To:       unix-wizards@sem.brl.mil


>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).

	sq = sprintf("%c",39)
	print sq
-- 
        -Barry Shein

Software Tool & Die, Purveyors to the Trade         | bzs@world.std.com
1330 Beacon St, Brookline, MA 02146, (617) 739-0202 | {xylogics,uunet}world!bzs

-----------------------------

From: Lee McLoughlin <lmjm@doc.imperial.ac.uk>
Subject: Wanted: fast tar across ether
Date: 10 Jan 90 02:02:18 GMT
Sender: news@doc.ic.ac.uk
To:       unix-wizards@sem.brl.mil

I am in urgent need of a way to write tar output to a remote tape
drive, an exabyte, over ethernet very quickly - preferably allowing the
exabyte to stream.  I currently use the gnu-tar, which does a pretty
good job but I really something faster.

If necessary I will write my own one - so any suggestions about how
best to do this are welcome.

	Lee

-----------------------------


End of UNIX-WIZARDS Digest
**************************

postmaster@ccf3.nrl.navy.mil (SMTP MAILER) (01/12/90)

 ----Mail status follows----
Have been unable to send your mail to <whitis@rira.nrl.navy.mil>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 11 Jan 90 12:45:00 EST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#042
To: "whitis" <whitis@rira.nrl.navy.mil>

Return-Path: <@nrl3.arpa:unix-wizards-request@sem.brl.mil>
Received: from nrl3.arpa by nrl3.arpa with SMTP ; Thu, 11 Jan 90 12:44:12 EST
Received: from SEM.BRL.MIL by nrl3.arpa with SMTP ; Tue,  9 Jan 90 03:27:57 EST
Received: from SEM.BRL.MIL by SEM.brl.MIL id aa21640; 9 Jan 90 3:01 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa21575; 9 Jan 90 2:45 EST
Date:       Tue, 09 Jan 90 02:45:18 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#042
Message-ID:  <9001090245.aa21575@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Tue, 09 Jan 1990              V9#042

Today's Topics:
                Re: Access to UNIX-Related Publications
  Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications)
                        Sun4/SUNOS4.0.1 and tcsh
                        Re: fcntl/socket anomaly
Re: Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)
                    How to create a restricted shell
                  Re: How to create a restricted shell
                 Re: GNU Emacs, memory usage, releasing
            How to delete a file with ^? chars in the name?
                    Need a Tape Drive Hardware guru
                            Re: fuzzy strcmp
                      Re: PWD in Bourne Shell PS1

-----------------------------------------------------------------

From:  Sun Visualization Products <matthew@sunpix.uucp>
Subject: Re: Access to UNIX-Related Publications
Date: 7 Jan 90 18:39:55 GMT
To:       unix-wizards@sem.brl.mil

In article <166@omaha1.UUCP> wcc@omaha1.UUCP (William C Carey) writes:
>
>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).  I can't get the 'print' or
>


Here's an example that should get you in the right direction:

awk 'BEGIN { 
	SQ = sprintf("%c", 39);
	DQ = sprintf("%c", 34);
}
{
	printf("%cHow is this?%c\n", DQ, DQ);
	printf("%cAnd this?%c\n", SQ, SQ);
}


-- 
Matthew Lee Stier                            |
Sun Microsystems ---  RTP, NC  27709-3447    |     "Wisconsin   Escapee"
uucp:  sun!mstier or mcnc!rti!sunpix!matthew |
phone: (919) 469-8300 fax: (919) 460-8355    |

-----------------------------

From: Paul Lew <lew@gsg.uucp>
Subject: Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications)
Date: 7 Jan 90 21:02:40 GMT
To:       unix-wizards@sem.brl.mil

>In article <166@omaha1.UUCP> wcc@omaha1.UUCP (William C Carey) writes:
>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).  I can't get the 'print' or
>the 'printf' statement to do it with any combination of backslashes,
>double-quotes, or percent characters.

Try avoid using quotes, double-quotes will make life a lot easier.  I use
the following:

	BEGIN	{ q = 39; }
		{
		printf "this is a quote: %c\n", q;
		}

this free you up to worry about what you want to do instead of quoting
problem.  Just remember the decimal value for quote is 39, I did not start
using this method until I memorized its value (the most intuitive reaction
a programmer has at that point is to use "quote" mostly because he can
not remember the decimal value for quote and dont feel like look into the
ASCII table for it!)
-- 
Paul Lew (lew@gsg.gsg.com)		UUCP:		oliveb---+
						uunet---samsung--+
General Systems Group, 5 Manor Parkway			harvard--+--gsg--lew
Salem, NH 03079	(603) 893-1000				decvax---+

-----------------------------

From: Jussi Eloranta <eloranta@jyu.fi>
Subject: Sun4/SUNOS4.0.1 and tcsh
Date: 8 Jan 90 07:59:18 GMT
To:       unix-wizards@sem.brl.mil


I recall some discussion about tcsh problems with pipes..
but I was unable to find the fixed version of tcsh for sun4/sunos4.0.1
(or does it exist at all?)

Thanks,

Jussi
-- 
============================================================================
Jussi Eloranta               Internet(/Bitnet):
University of Jyvaskyla,     eloranta@tukki.jyu.fi
Finland                      [128.214.7.5]

-----------------------------

From: Chris Torek <chris@mimsy.umd.edu>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 08:27:10 GMT
To:       unix-wizards@sem.brl.mil

>In article <10763@encore.Encore.COM> peralta@encore.com (Rick Peralta) writes:
>>Why when setting the F_SETOWN on a socket a pfind is not done on the PID?
>>Maybe more to the point, why the double standard on how a pgrp is specified?

4.3-tahoe does a pfind, but not for pgroups (negative values), only for
pids (positive values), and only when translating to TIOCSPGRP (more
below).

In article <129970@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>F_SETOWN has been a botch from day one as far as I'm concerned.  For
>those who don't know (or don't remember) F_SETOWN is used to say "send
>this pid the SIGIO when the time is right".  The documentation has
>always said that you can specify pgrps instead of pids (one of them was
>negative to indicate the type) and SunOS, at least, never did that
>(stay tuned).

Actually, I am fairly sure that SunOS 3.x had the 4.2BSD bug where pid
and pgroup were reversed (between documentation and code).  Whether that
has been fixed, I do not know.  (The SunOS 4.x code is substantially
different, and I have not read it.)

>Furthermore, the F_SETOWN uses the same field in the tty
>structure that the tty sub system uses for job control (where ^Z and
>others get sent).  So if you use F_SETOWN on an active tty you get very
>strange things happening.

(The following applies only to 4.3BSD and otherwise-unchanged derivatives
thereof.)

F_SETOWN on an inode translates into a TIOCSPGRP ioctl, so that whatever
checks are applied to TIOCSPGRP are applied to fcntl(ttyf, F_SETOWN).
The translation goes like this:

	if (value > 0) {		[value is a pid, not a pgroup]
		struct proc *p = pfind(value);
		if (p == 0)
			return (ESRCH);
		value = p->p_pgrp;
	} else				[value is a negated pgroup ID]
		value = -value;
	return (fioctl(fp, (int)TIOCSPGRP, (caddr_t)&value);

For a socket, it sets ((struct socket *)fp->f_data)->so_pgrp to the
given value.  Tty pgroups are stored in tp->t_pgrp: a different place.

>My guess is that the SIGIO interface was a hack that some grad student
>needed.

Not really.  It does seem to be done rather badly, however.

>They hacked it in, it works in the obvious cases, it's stuck
>around.  It needs a rewack to be clean (I just checked SunOS - we do
>absolutely no permissions checks on F_SETOWN on sockets).

They are unnecessary.   SIGIO is a completely benign signal.  If a
process is not catching it, SIGIO is discarded.  If a process *is*
catching it, that process is required to figure out why the SIGIO occurred
and whether it still has any reason to do anything about it, so extra
SIGIO signals merely reduce efficiency.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris

-----------------------------

From: "Steven M. Schultz" <sms@wlv.imsd.contel.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 09:11:26 GMT
Sender: news@wlbr.imsd.contel.com
To:       unix-wizards@sem.brl.mil

In article <129970@sun.Eng.Sun.COM> lm@sun.UUCP (Larry McVoy) writes:
>In article <10763@encore.Encore.COM> peralta@encore.com (Rick Peralta) writes:
>>
>>Why when setting the F_SETOWN on a socket a pfind is not done on the PID?
>>Maybe more to the point, why the double standard on how a pgrp is specified?
>
>F_SETOWN has been a botch from day one as far as I'm concerned.  For
	
	amen.

>those who don't know (or don't remember) F_SETOWN is used to say "send
>this pid the SIGIO when the time is right"...
>Furthermore, the F_SETOWN uses the same field in the tty
>structure that the tty sub system uses for job control...
>My guess is that the SIGIO interface was a hack that some grad student
>needed.  They hacked it in, it works in the obvious cases, it's stuck
>around...

	The hack/botch is the F_SETOWN, or rather the whole fcntl(2) syscall.
	As i recall fcntl(2) was (needlessly?) instituted by the creators of 
	System V(anilla) and adopted by Berkeley as a compatability measure,
	nothing that really couldn't be done by ioctl(2) but a new syscall
	was created anyhow.

	and don't forget the overlaying (reuse) of the VTIME and VEOT
	members of the AT&G Unix tty system - switch modes from to/from
	'cbreak' and you have surprises too.  but then, i suppose it was
	done by a graduate student... .5;-)

	Steven

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 18:29:08 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <21691@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
>F_SETOWN on an inode translates into a TIOCSPGRP ioctl, so that whatever
>checks are applied to TIOCSPGRP are applied to fcntl(ttyf, F_SETOWN).
>The translation goes like this:
>
>	if (value > 0) {		[value is a pid, not a pgroup]
>		struct proc *p = pfind(value);
>		if (p == 0)
>			return (ESRCH);
>		value = p->p_pgrp;
>	} else				[value is a negated pgroup ID]
>		value = -value;
>	return (fioctl(fp, (int)TIOCSPGRP, (caddr_t)&value);

Those checks are inappropriate for the F_SETOWN.  For example, POSIX
insists that the tty in question be your controlling tty.  That's both
unecessary and unlikely for processes wanting SIGIO on a tty.

>>My guess is that the SIGIO interface was a hack that some grad student
>>needed.
>
>Not really.  It does seem to be done rather badly, however.
>
>>They hacked it in, it works in the obvious cases, it's stuck
>>around.  It needs a rewack to be clean (I just checked SunOS - we do
>>absolutely no permissions checks on F_SETOWN on sockets).
>
>They are unnecessary.   SIGIO is a completely benign signal.  If a
>process is not catching it, SIGIO is discarded.  If a process *is*
>catching it, that process is required to figure out why the SIGIO occurred
>and whether it still has any reason to do anything about it, so extra
>SIGIO signals merely reduce efficiency.

Permission checks are rarely "unnecessary", it's much more likely that
they're either missing or incorrect.  In this case, they're missing.
Suppose I have process A and process B.  A does a F_SETOWN on some
socket and then goes on, expecting a SIGIO at some later time.  B comes
along, and also does a F_SETOWN on the same socket.  A has been
robbed.

To head off a needless discussion: yes, I realize that if you do the
"right thing" everything is OK and there is no need for permission
checks.  My claim is that the number of programmers who "do the right
thing" (sorry spike) are getting fewer and fewer.
---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: Peter da Silva <peter@ficc.uu.net>
Subject: Re: Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)
Date: 8 Jan 90 15:05:53 GMT
To:       unix-wizards@sem.brl.mil

>    What I mean here is that you can allocate your block poimters, then call
>    map_fd to map the file into memory.

> The problem is that unless you copy the file on disk you can't back
> out of your edits at the last moment (:q! for vi people).  If you're
> going to copy the file you might as well copy it into vmem.

You misunderstand. I wasn't suggesting making direct edits on the memory
image. On the contrary, you map it in read-only if you can. What I was
suggesting was that since most of the things you're doing to the file don't
involve modifying it, you might as well page it in from disk when you
need it, only coping it to writable memory when you want to modify it.

For example, suppose you want to do a search and replace. You fault in
all the pages from here to the replacement location, copy the block that
contains the replacement into two new blocks (using the block-splitting
method) and add the new text. The blocks you just read can be discarded
when needed by the memory manager, rather than having to be written out
to the paging area, saving considerable disk access. Only modified blocks
would need to be written.
-- 
 _--_|\  Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \ Also <peter@ficc.lonestar.org> or <peter@sugar.lonestar.org>
\_.--._/
      v  "Have you hugged your wolf today?" `-_-'

-----------------------------

From: Tzu-Hsi Pan <pantz@nsf1.mth.msu.edu>
Subject: How to create a restricted shell
Keywords: restricted shell
Date: 8 Jan 90 16:19:51 GMT
Sender: usenet@cps3xx.uucp
To:       unix-wizards@sem.brl.mil


Could someone tell me how to build up a restricted shell for some user
such that only a couple of commands can be executed under a new root
environment?  Thanks.

-Pan (pantz@mth.msu.edu)

-----------------------------

From: Wm E Davidsen Jr <davidsen@crdos1.crd.ge.com>
Subject: Re: How to create a restricted shell
Keywords: restricted shell
Date: 8 Jan 90 20:05:48 GMT
To:       unix-wizards@sem.brl.mil

In article <5946@cps3xx.UUCP> pantz@mth.msu.edu (Tzu-Hsi Pan) writes:
| 
| Could someone tell me how to build up a restricted shell for some user
| such that only a couple of commands can be executed under a new root
| environment?  Thanks.

  rsh works with /bin/sh and ksh. You can either execute the rsh command
(SysV) or execute the shell with the -r flag. You simply set the PATH to
point to a directory containing only the things you want to allow, and
then (assuming a recent shell) set the PATH variable readonly. I usually
create a /usr/rbin directory and link stuff in from /bin and /usr/bin.

Ex:
	PATH=/usr/rbin
	readonly PATH; export PATH

-- 
bill davidsen	(davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon

-----------------------------

From: Craig Finseth <fin@uh.msc.umn.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 16:43:41 GMT
Sender: news@uc.msc.umn.edu
To:       unix-wizards@sem.brl.mil

In article <IN_S4Eggpc2@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>There seems to be an assumption here that the only possible methods are
>buffer gap and a linked list of lines. What about a linked list of larger
>blocks? ...

Think of pure buffer gap and linked line as opposite ends of a
continuum.  (Technically, linked character would be on the one end,
but I will ignore that case.)  Pure buffer gap has one chunk, which is
the entire object.  As you divide it into separate chunks (paged
buffer gap), the number increases and their size decreases.
Eventually, you get to a chunk size of one line and have linked line.

In may of the intermediate cases, whether you use an array or linked
list is an implementation detail.

Craig A. Finseth			fin@msc.umn.edu [CAF13]
Minnesota Supercomputer Center, Inc.	+1 612 624 3375

-----------------------------

From: Craig Finseth <fin@uh.msc.umn.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 16:48:15 GMT
Sender: news@uc.msc.umn.edu
To:       unix-wizards@sem.brl.mil

In article <SN_87Eggpc2@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>> I contend that in a "modern workstation environment" (e.g., Sun 3/60),
>> a simple buffer gap method is preferred over both paged buffer gap and
>> linked line.  I leave it as an excercise for the reader to figure out
>> why.

>I'm not sure this is a valid conclusion. If 75K is the optimal file size
>for a buffer-gap solution, how about paged buffer-gap with 75K pages? Or
>to add a bit of compromise with some of today's brain-dead architectures
>perhaps 64K pages would work nearly as well.

Where did this "75K" figure come from?  It wasn't mentioned by me.  It
would be a very unusual constant to remain constant over a wide range
of architectures, speeds, memory sizes, and other performance-related
figures.

In particular, I have had no trouble editing multi-megabyte files in
GNU Emacs on a Sun 3/280 w/8 MBytes of memory.

Craig A. Finseth			fin@msc.umn.edu [CAF13]
Minnesota Supercomputer Center, Inc.	+1 612 624 3375

-----------------------------

From: Joe Weening <weening@gang-of-four.stanford.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Date: 8 Jan 90 21:56:27 GMT
Sender: USENET News System <news@neon.stanford.edu>
Followup-To: comp.editors
To:       unix-wizards@sem.brl.mil

I'm posting this message to help RMS's desire to remove the discussion
of editor implementation methods from gnu.emacs.

The discussion is currently going on in comp.editors, gnu.emacs and
comp.unix.wizards.  Therefore not everyone contributing to the
discussion may have seen RMS's messages.

The discussion is appropriate for comp.editors, so that's where I'm
directing followups to this message.  It is not appropriate for
gnu.emacs, since that group is meant for short announcements only.  It
is not at all appropriate for comp.unix.wizards and should never have
been posted there.

Please, everyone, let's move this discussion to comp.editors only.  If
you want to continue reading it, subscribe to that newsgroup.
--
Joe Weening                                Computer Science Dept.
weening@Gang-of-Four.Stanford.EDU          Stanford University

-----------------------------

From: Ron Ueberschaer x4399 <ubi@ginger.sri.com>
Subject: How to delete a file with ^? chars in the name?
Date: 8 Jan 90 16:53:11 GMT
Sender: news@unix.sri.com
To:       unix-wizards@sem.brl.mil

I have a file which is named ^?^?^?H01.b (delete character?) and can't
find a way to delete it.  An ls -s on the directory produces:

   ..	... (other files)
    1	???H01.b

If I do an ls *.b, it lists the other .b files, but complains:

	H01.b not found

I've tried:

	rm -i *			(to selectively delete everything)
	rm "???H01.b"
	rm "^v^?^v^?^v^?H01.b"  (control-v delete ...)

and nothing seems to work.

Help me, o wizards!

--Ron Ueberschaer
  ubi@unix.sri.com
  ...!{hplabs,rutgers}!sri-unix!ubi

-----------------------------

From: Ira Rampil <rampil@cca.ucsf.edu>
Subject: Need a Tape Drive Hardware guru
Keywords: Tape, guru, $$$$
Date: 8 Jan 90 21:12:36 GMT
To:       unix-wizards@sem.brl.mil

It was a classic story.  A friend was using a kennedy clone
streaming tape on a PDP-11 to record lab data.  The original
drive 'disappeared' and now he needs to read his old tapes.
He has another Kennedy drive but it can not read most of the
tapes - we hypothesize a relative head misalginment.

Is there anyone out there with the requisite skill to retrieve
the data.  It is worth BIG bucks to my colleague!

Any clues, hints or vectors would be much appreciated!
Thanks,

Ira Rampil, MSEE, MD
Dept of Anesthesia
Univ. Cal, San Francisco

(415) 476-9037, or rampil@cca.ucsf.edu

-----------------------------

From: Fred Mitchell - PA <mitchell@cbmvax.commodore.com>
Subject: Re: fuzzy strcmp
Date: 8 Jan 90 22:30:42 GMT
To:       unix-wizards@sem.brl.mil

In article <297@hhb.UUCP> istvan@hhb.UUCP (Istvan Mohos) writes:
>tchrist@convexe.uucp (Tom Christiansen @ Convex Computer) writes:
>>I'm looking for an algorithm that would allow me to determine
>>whether two strings were similar.  Thus 
>>
>>	"abcde" !~ "xyzzy"
>>	"this old man can read" =~ "that old man can't read"
>>
>>... perhaps just
>>    float   strfzcmp(string1,string2)

I will give a general description of an algorithm that can accomplish
what you ask.

NOTE: I am doing this from the 'top of my head'. Some refinement may
be in order.

You will do a weighted comparision based on two factors:
a) The number of characters each string has in common
b) The number of matches the strings have in sequence

Let's take two arbitrary strings:
	"This old man can't read"    string alpha
	"That silly man can't read"  string beta

Notice that they are of different lengths. Also, there is an alignment
shift. The following algorithm _should_ properly handle this:

a) Count the number of occurences of each character in each string.
   Compare the count of each character in alpha to that in beta in the
   following way:
     For each different character from alpha & beta:
	Normalize the counts so that the greater is normalized to 1.
	Multiply the two normalized values toghether.
	Add this product to a running total.
     Normalize this total by the the length of the longest string
     Multiply that by weight w1 yeilding (we shall call it) yw1

b) Compare the two strings byte for byte as follows:
     Start at the beginning of alpha & beta (let's use i and j as indexes)
     initialize k to 0
     Until we hit the end of either string:
	if (alpha[i] == beta[j])
		++k, ++i, ++j
	else 
		we scan forward on beta to find a byte that matchess
		our current location on alpha. If so, adjust j to index
		it. If nothing was found, do vice-versa for alpha.
     When the above loop is completed,
     Normalize k against the size of the longest string
     and multiply it by weight w2 yeilding (we shall call it) yw2.

     return (yw1 + yw2) / (w1 + w2)


This should produce a good evaluation of how closely matched alpha
is to beta, taking into account mis-alignment. The value returned
will be between 0 and 1 inclusive. Weight w1 should be less than w2.
Perhaps w1 = w2 / 3. Experiment.

As I said, this is off the top of my head, so some refinement is in
order, as should be evident during the implementation/testing phase.

If anyone knows of a better way to accomplish this, let's hear it!

	-Mitchell
	 mitchell@cbmvax.UUCP
	 "The shortening of the Way."

 
		

-----------------------------

From: Dan Mercer <mercer@ncrcce.stpaul.ncr.com>
Subject: Re: PWD in Bourne Shell PS1
Date: 8 Jan 90 23:12:54 GMT
Keywords:
To:       unix-wizards@sem.brl.mil

In article <18@choreo.COM> chris@choreo.UUCP (Chris Hare / System Manager) writes:
:In article <8790.259b3142@ecs.umass.edu> Satam writes,
:> Inserting the following three aliases will help achieve the same
:> effect. Note that this is only for csh.
:> ------------------------------------------------------------
:> alias cd 'chdir \!* && set prompt="${cwd:t}_\\!% "'
:> alias pushd 'pushd \!* && set prompt="${cwd:t}_\\!% "'
:> alias popd 'popd \!* && set prompt="${cwd:t}_\\!% "'
:> -------------------------------------------------------------
:
:This is quite true.  However, a similar thing can be implemented in the
:Bourne shell using shell functions.  There are however two caveats :
:
:	1.  We cannot use the name of a built in shell command 
:	2.  We must recaculate the PS1 each time we do a cd.
:
:Firstly,  becase we want the PS1 to be updated whenever we change
:directories, we cannot use the builtin 'cd' command, but something like it.
:We must also remember to use the new command, because using a cd will mean
:that the directory reflected in our PS1 will be incorrect.
:
:You can try this Bourne shell function :
:
:	go()
:	   {
:	   if [ "$1" ]		# if we got an argument
:	   then
:	      cd $1
:	   else 		# otherwise go home
:	      cd $HOME
:	   fi
:	   PS1=`pwd`"> "	# change the PS1
:	   }
:

For what it's worth,  here is how I implemented things (from
file /usr/acct/ME/bin/.functs which I invoke as . .functs in
my .profile)

#
#       This file invokes function definitions
#
# ps3="`cat /etc/NODENAME`/`basename \`tty\``> "  # set in .profile
pd() { RT=$PWD; cd $1; PWD=`pwd`; PS1="$PWD
${ps3}"; }
lpd()	{ pd $1; ls; }
rt() { pd $RT; }

pd (path directory) changes my directory and reflects the current
directory as the first line of my two line prompt.  The second line
tells me what system I am on (I have access to several) and what
line (I also have a variety of ways to tie in - modem,  direct line,
pass thru line,  Token Ring).  If I am in a sub shell,  a /n is 
appended to the line number to indicate depth,  since I'm frequently
nested through some intermediary program or other.

I can toggle between two directories with the rt command,  very
useful wehn transferring files (mv pattern $RT).

:Remember, shell functions are not passed to their subshells.
:
But are accessible by shell scripts called by current shell.  If
you are lucky enough to have an NCR Tower (no flames please,  they
are my employers) they have the delightful .shrc feature implemented
that gets invoked when you fork an interactive shell.  Once I found
that gem (by accident - it's not documented)  I was able to invoke
my function definitions on all shell levels.

I have lots of other shifty functions.  vi (no args) for instance,
edits my last edited file rather than a file with no name.  Very
useful when mucking with balky items like makefiles.


:Chris Hare				Choreo Systems Inc.
:Coordinator, Systems Management		150 Laurier Ave West
:Authorized SCO Instructor		Ottawa, Canada
:					Phone 613-238-1050
:					Fax   613-238-4453
:*** It Works for ME ! ***		email : uunet!choreo!chris


-- 

Dan Mercer
Reply-To: mercer@ncrcce.StPaul.NCR.COM (Dan Mercer)

-----------------------------


End of UNIX-WIZARDS Digest
**************************

reschly@BRL.MIL (Robert J. Reschly Jr.) (01/12/90)

      Good evening,

   Well, the mailer has blown up again and is dumping piles of messages
into the entire list.  You do not send error messages to the REPLY-TO
address!

   You are off the list until I get word that the problem has been fixed.

				Later,
				    Bob
----- Forwarded message # 1:

Received: from SEM.BRL.MIL by SEM.brl.MIL id ab14280; 11 Jan 90 14:46 EST
Received: from smoke.brl.mil by SEM.BRL.MIL id ab14268; 11 Jan 90 14:41 EST
Received: from CCF.NRL.NAVY.MIL by SMOKE.BRL.MIL id aa17467; 11 Jan 90 14:23 EST
Date: 11 Jan 90 11:05:28 EST
From: SMTP MAILER <postmaster@CCF.NRL.NAVY.MIL>
Subject: Mail not delivered yet, still trying
To: unix-wizards <unix-wizards@BRL.MIL>
Message-ID:  <9001111424.aa17467@SMOKE.BRL.MIL>

 ----Mail status follows----
Have been unable to send your mail to <whitis@rira.nrl.navy.mil>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 11 Jan 90 00:48:00 EST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#042
To: "whitis" <whitis@rira.nrl.navy.mil>

Return-Path: <@nrl3.arpa:unix-wizards-request@sem.brl.mil>
Received: from nrl3.arpa by nrl3.arpa with SMTP ; Thu, 11 Jan 90 00:46:53 EST
Received: from SEM.BRL.MIL by nrl3.arpa with SMTP ; Tue,  9 Jan 90 03:27:57 EST
Received: from SEM.BRL.MIL by SEM.brl.MIL id aa21640; 9 Jan 90 3:01 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa21575; 9 Jan 90 2:45 EST
Date:       Tue, 09 Jan 90 02:45:18 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#042
Message-ID:  <9001090245.aa21575@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Tue, 09 Jan 1990              V9#042

Today's Topics:
...
 [ ~26KB of digest text deleted ]

postmaster@CCF.NRL.NAVY.MIL (SMTP MAILER) (01/12/90)

 ----Mail status follows----
Have been unable to send your mail to <whitis@rira.nrl.navy.mil>
for one day, will keep trying for another two days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 11 Jan 90 00:36:00 EST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#043
To: "whitis" <whitis@rira.nrl.navy.mil>

Return-Path: <@nrl3.arpa:unix-wizards-request@sem.brl.mil>
Received: from nrl3.arpa by nrl3.arpa with SMTP ; Thu, 11 Jan 90 00:34:42 EST
Received: from SEM.BRL.MIL by nrl3.arpa with SMTP ; Wed, 10 Jan 90 03:39:40 EST
Received: from SEM.BRL.MIL by SEM.brl.MIL id aa03862; 10 Jan 90 3:00 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa03781; 10 Jan 90 2:45 EST
Date:       Wed, 10 Jan 90 02:45:12 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#043
Message-ID:  <9001100245.aa03781@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Wed, 10 Jan 1990              V9#043

Today's Topics:
                     filenames with a '/'  -- help
                   Re: filenames with a '/'  -- help
                              yacc and lex
                 Re: GNU Emacs, memory usage, releasing
                        Re: fcntl/socket anomaly
          Re: How to delete a file with ^? chars in the name?
          Number of chars in input queue - terminal, keyboard
                   Re: C Documentation Utility Needed
Obtaining a unique, "unchangeable" number associated with an SGI workstation
        Re: new mscp code in Ultrix 3.1 (was Boot block trashed)
                Re: Access to UNIX-Related Publications
                     Wanted: fast tar across ether

-----------------------------------------------------------------

From: "Gregory S. Baber" <gregb@dowjone.uucp>
Subject: filenames with a '/'  -- help
Date: 8 Jan 90 20:28:44 GMT
To:       unix-wizards@sem.brl.mil

Hello,
	I moved some files from a Mac to a NeXT using a GatorBox,
and then took the NeXT off the network. Some of the files that were
on the Mac had a '/' as part of the actual filename. How do I delete
these from the NeXT now without reconnecting to the network? When I
try to delete the files by hand, the shell responds with "file does
not exist" because it interprets the '/' as a directory indicator.
I even tried to double quote the filename to no avail. Any ideas?

Thanks, gregb

-- 
Reply to: Gregory S. Baber		Voice:	(609) 520-5077
   Dow Jones & Co., Inc.		UUCP:	..princeton!dowjone!gregb
   Box 300				or	..uunet!warlock!gregb
   Princeton, N.J. 08543-0300		"So long, and thanks for all the fish"

-----------------------------

From: "seth.zirin" <szirin@cbnewsm.att.com>
Subject: Re: filenames with a '/'  -- help
Date: 9 Jan 90 18:20:31 GMT
To:       unix-wizards@sem.brl.mil

In article <646@warlock.UUCP> gregb@dowjone.UUCP (Gregory S. Baber) writes:
>and then took the NeXT off the network. Some of the files that were
>on the Mac had a '/' as part of the actual filename. How do I delete
>these from the NeXT now without reconnecting to the network? When I
>try to delete the files by hand, the shell responds with "file does
>not exist" because it interprets the '/' as a directory indicator.

You have several options:

1) reformat the disk (JUST KIDDING!!) :-)

2) fsck the filesystem.  some versions of fsck will not permit illegal
   characters in names.  if your version of fsck cannot fix it, complain
   to your vendor about the bug in their fsck.

3) use fsdb to locate and edit the disk block that contains the filename
   with the '/'.  Change the '/' to a more palatable character.
   WARNING: this is not for the weak-hearted!

4) copy everything else from the parent directory to a safe spot and
   iclear or unlink the parent directory and run fsck.  if the bad
   name is a file (as opposed to a subdirectory), fsck will copy it
   to the lost+found and give it a civilized name.  if you have a
   directory tree of bad subdirectory names, this will become a
   recursive process.

the above procedures assume that the filesystem is mounted/unmounted
appropriately.  when you're all done and you haven't roached the whole
filesystem or the entire disk, hold your head high; you've earned one
star towards becoming a wizard.

discussion of the other stars should be referred to /dev/null as we just
finished that topic.

Seth Zirin

-----------------------------

From: Chuck Cartledge <chuck@virgil.uucp>
Subject: yacc and lex
Keywords: yacc,lex,error checking
Date: 8 Jan 90 20:51:49 GMT
Followup-To: comp.lang.c
To:       unix-wizards@sem.brl.mil


Pardon the cross posting, but I'm not sure where the answer is for this
question.

I would like to use a yacc/lex generated program segment as a operator input
validation routine, rather then having to write my own from the ground up.
What I am trying to generate either automatically via yacc/lex or with only
minor manual mods, is a function that looks like this:

	valid_data (character_string, data_type, addr1, addr2, ...)

Is there a way to get something like this??

Any help would be appreciated.  Thanks.
-- 
Chuck Cartledge (804)498-1012 (voice-play)                 chuck@virgil.UUCP
EDO Corporation (804)424-1004 (voice-work)
Virginia Operations
814 Greenbrier Circle, Chesapeake Va.  23320

-----------------------------

From: Peter da Silva <peter@ficc.uu.net>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 22:07:52 GMT
To:       unix-wizards@sem.brl.mil

> >> I contend that in a "modern workstation environment" (e.g., Sun 3/60),
> >> a simple buffer gap method is preferred over both paged buffer gap and
> >> linked line.  I leave it as an excercise for the reader to figure out
> >> why.

> >I'm not sure this is a valid conclusion. If 75K is the optimal file size

> Where did this "75K" figure come from?

I honestly don't remember. It was mentioned by someone in this forum.

I do think, though, that for any given system there is such an optimal size.
It may be that on your workstation that size is measured in megabytes... on
others it may be a few K. I wonder how it feels on a NeXT that's paging over
the network or onto the OD?

> >for a buffer-gap solution, how about paged buffer-gap with 75K pages? Or
> >to add a bit of compromise with some of today's brain-dead architectures
> >perhaps 64K pages would work nearly as well.

> In particular, I have had no trouble editing multi-megabyte files in
> GNU Emacs on a Sun 3/280 w/8 MBytes of memory.

Having "no trouble" with something doesn't mean you have the optimal
solution. Just that you have *a* solution.
-- 
 _--_|\  Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \ Also <peter@ficc.lonestar.org> or <peter@sugar.lonestar.org>
\_.--._/
      v  "Have you hugged your wolf today?" `-_-'

-----------------------------

From: Jim Cathey <jimc@isc-br.isc-br.com>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 9 Jan 90 19:20:13 GMT
Followup-To: comp.editors
To:       unix-wizards@sem.brl.mil

>The better solution, made relatively easy by the reasonably modular and
>layered structure of GNU emacs, would be to accept The Emacs Cookbook
>recommendation (adopted by Jove and the MicroEmacs/Gnu family of editors) and
>implement a linked list system. I would suggest just reading (or map, on the
>operating systems that allow it) the file to be edited as a large lump of
>virtual address space, then building a linked list of pointers to lines
>therein, and then to allocate modified lines from ageneral purpose arena.
>Informing the OS of the peculiar access patterns would also help, if
>possible.

So long as line-oriented operation preserved the ability of Gnu Emacs
to edit binary files that have no 'lines' at all.  The MicroEmacs we
have here will choke on these (as does vi, ed, see, siv, and all the
other editors we have), and MicroEmacs' line orientation is so badly
implemented that if (at our site) the file is larger than about 50K it
is _faster_ to start emacs on the file than MicroEmacs.  MicroEmacs
starts faster, but it reads files _much_ slower (fgets,malloc,strcpy).

Somebody or other's master's thesis was on buffer styles (I got a copy with
my copy of MINCE a few years ago), and his conclusion was that the gap method
worked best.  That may have been on a machine that wasn't DPV, though.

Moving the gap by, say, 20 characters should affect at most two pages (four,
if you assume it straddles a page boundary on both ends but this is true for
any scheme and may be disregarded).  A block with a line pointer array might
also affect two pages (the block and the buffer array) so I don't offhand
see the advantage.  Jumping about wildly would touch a lot of pages, but the
assumption is that you work a lot in one place.  The gap approach makes it
very quick to _save_ files, so the auto-save feature is unobtrusive.  It would
be absolutely useless if it took 5-10 seconds to rearrange the line-pointer
and block mess to get it into savable form, or write a line at a time.

If realloc can't do the right thing it should be replaced by one that can.
I believe GNU isn't interested in supporting non-GNU machines (read VAX)
to the extent that it corrupts the architecture of the program.  I somewhat
agree with them in that broken environments shouldn't be catered to, but 
repaired instead.

It would be nice if emacs did sbrk- when it could.  In our environment, we
can also release holes in the _middle_ of the heap.  We added an additional
system call for it.  This gets pages out of the swap space, but they'll be
reallocated (and cleared to zero) if you touch in the hole.

We have a limited virtual address space (2M on some machines, 4M on most 
others) so GNU can't edit those really big log files.  I think only elle can
of the editors I've experienced.  I think it uses linked blocks.

GNU Emacs _is_ awfully large, though, but I haven't noticed any machine
eating behavior.  Of course, we have a lot of smaller machines here, so few
use it at once.  Far more noticible is simultaneous compiles.

+----------------+
! II      CCCCCC !  Jim Cathey
! II  SSSSCC     !  ISC-Bunker Ramo
! II      CC     !  TAF-C8;  Spokane, WA  99220
! IISSSS  CC     !  UUCP: uunet!isc-br!jimc (jimc@isc-br.iscs.com)
! II      CCCCCC !  (509) 927-5757
+----------------+
			"With excitement like this, who is needing enemas?"

-----------------------------

From: Chris Torek <chris@mimsy.umd.edu>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 9 Jan 90 08:24:01 GMT
To:       unix-wizards@sem.brl.mil

In article <129979@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>Those checks [applied by TIOCSPGRP] are inappropriate for the F_SETOWN.
>For example, POSIX insists that the tty in question be your controlling tty.
>That's both unecessary and unlikely for processes wanting SIGIO on a tty.

Ah: this is different from what you said (or at least, what I understood)
before.  Now you seem to mean `any process should be allowed to ask for
SIGIO on any file descriptor to which it can apply an fcntl, and should
receive SIGIO signals whenever it could read from / write to that descriptor.'

(This is a reasonable interpretation of what SIGIO should be, but would
require major kernel restructuring, since per-file-descriptor flags can
only be stored in a u. area.)

>Suppose I have process A and process B.  A does a F_SETOWN on some
>socket and then goes on, expecting a SIGIO at some later time.  B comes
>along, and also does a F_SETOWN on the same socket.  A has been
>robbed.

Ah.  This, of course, is a property of the shared-ness of descriptors.
A dup()ed descriptor (either with the dup() or dup2() system calls,
or simply shared across fork+exec) has only one underlying object,
and (for reasons having to do with the basic kernel structure) signals
have to refer to the underlying object%, hence are shared.

Fortunately, two different endpoints on a socket are not shared.  A
program (your `A') that passes its own socket endpoint to another program
(your `B') has explicitly---well, okay, implicitly---given control of
the socket to the second program.  For instance, `B' could issue a
shutdown on the socket as well.

Thus, I think this objection does not apply.  (It *does* apply to tty
devices.)

 -----
% Actually, they refer to the object underlying the underlying object,
  in the case of inodes; but this, at least, could be changed in
  principle.  (Thread a linked list of signal info through the file
  table.)  Then you have the problem of *giving up* SIGIO signals for
  a descriptor.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 9 Jan 90 21:40:16 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <21710@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
>In article <129979@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>>Those checks [applied by TIOCSPGRP] are inappropriate for the F_SETOWN.
>>For example, POSIX insists that the tty in question be your controlling tty.
>>That's both unecessary and unlikely for processes wanting SIGIO on a tty.
>
>Ah: this is different from what you said (or at least, what I understood)
>before.  Now you seem to mean `any process should be allowed to ask for
>SIGIO on any file descriptor to which it can apply an fcntl, and should
>receive SIGIO signals whenever it could read from / write to that descriptor.'

Well, while I agree that this would be nice, it's not at all what I
meant and I think you know it.  SIGIO is commonly applied to tty's.
The point you made about permission checks is bogus because POSIX won't
let you get SIGIO on anything but your controlling terminal if you
continue with this braindead implementation that calls TIOCSPGRP.

>>Suppose I have process A and process B.  A does a F_SETOWN on some
>>socket and then goes on, expecting a SIGIO at some later time.  B comes
>>along, and also does a F_SETOWN on the same socket.  A has been
>>robbed.
>
>Ah.  This, of course, is a property of the shared-ness of descriptors.

Not really.  If sockets can be named in the file system (Unix domain) then
you can get at it by opeing the file (like the printer for instance).

>A dup()ed descriptor (either with the dup() or dup2() system calls,
>or simply shared across fork+exec) has only one underlying object,
>and (for reasons having to do with the basic kernel structure) signals
>have to refer to the underlying object%, hence are shared.
>
>Thus, I think this objection does not apply.  (It *does* apply to tty
>devices.)

This is missing the point completely.  I don't care (and neither do
you) that cooperating processes can hurt each other (a new definition
of cooperating :-)  It's the tty and named socket case that's broken.


Let's take this offline, Chris - I think the horse is dead....
---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: currey tom 76327 <tcurrey@x102c.harris-atd.com>
Subject: Re: How to delete a file with ^? chars in the name?
Date: 9 Jan 90 14:22:36 GMT
Sender: news@trantor.harris-atd.com
To:       unix-wizards@sem.brl.mil


  You asked how to delete a file with deleted characters.  This depends
on the system you're using.  Here are 2 ways:

    Using the backslash for the meanings try:

            " rm \<DEL>\<DEL>\<DEL>H12.b "      {<DEL> is delete key}

    or last resort method

 	    Copy all other files into a temporary directory and 
            " rm -r <directory with bad file> " the copy them back
            after making a new directory.

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: How to delete a file with ^? chars in the name?
Date: 9 Jan 90 21:44:45 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <7711@unix.SRI.COM> ubi@ginger.sri.com (Ron Ueberschaer x4399) writes:
>I have a file which is named ^?^?^?H01.b (delete character?) and can't
>find a way to delete it.  An ls -s on the directory produces:
>
>   ..	... (other files)
>    1	???H01.b
>
>If I do an ls *.b, it lists the other .b files, but complains:
>
>	H01.b not found
>
>I've tried:
>
>	rm -i *			(to selectively delete everything)
>	rm "???H01.b"
>	rm "^v^?^v^?^v^?H01.b"  (control-v delete ...)
>
>and nothing seems to work.

$ cat > xxx.c
#include <stdio.h>
main()
{
	char buf[255];

	while (gets(buf))
		if (unlink(buf))
			perror(buf);
}
^D
$ cc xxx.c
$ a.out
????H01.b
^D

---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: "John W. DeBoskey" <jwd@sas.uucp>
Subject: Number of chars in input queue - terminal, keyboard
Keywords: QUEUE TERM KEYBOARD ISC 1.0.6
Date: 9 Jan 90 16:42:00 GMT
To:       unix-wizards@sem.brl.mil

Hello,

   The subject almost says it all. I'm running ISC 1.0.6. I want to
find out how many characters are available to read from the terminal
if there are any. ie: avail = in_queue(term_id). 

   A BSD answer is to use FIONREAD, but sVr3 doesn't have it, and I've
been unable to duplicate it. Please don't tell me to RTFM or read
the monthly intros. I have and they don't help. I'm starting to think
the only way I can do this is to actually issue a read, and do my own
internal buffering, but I DON'T really want to do this.

   If anyone has some ideas, or knows a way that isn't doc'd, please
let me know. I'd really appreciate it. Thanks!!

                                      John W De Boskey

jwd@sas.UUCP     (w)  jwd%sas@rti.rti.org
jwd@baggins.UUCP (h)  jwd%baggins@mcnc.mcnc.org

-----------------------------

From: Mike Ewan <mike@raven.uss.tek.com>
Subject: Re: C Documentation Utility Needed
Date: 9 Jan 90 16:53:45 GMT
Followup-To: comp.unix.wizards
To:       unix-wizards@sem.brl.mil

In article <10761@cadnetix.COM> rusty@cadnetix.COM (Rusty Carruth) writes:
>In article <625@h.cs.wvu.wvnet.edu> dymm@b.cs.wvu.wvnet.edu (David Dymm) writes:
>>
>>I am looking for a utility to help in the documentation of C code.
>>[...]
>
>Well, this will probably not help as much as I would like, but there
>is a program available for the PC family which does pretty-printing
>and such, and also can create the tree info you wanted.  I THINK
>it was by Polytron, but I could be wrong.  I'll try to find out
>and post again.  If anyone else knows of the actual company name,
>you might be really lucky and that company may have ported it to
>unix by now...


The company is Sage/Polytron, 1100 nw 167th Pl, Beaverton OR 97006
(503) 645-1150

I havn't used their PolyDoc product but have used their PVCS (RCS clone).
I'm pleased with the product.  They have been porting some of the
products to Unix.  If PolyDoc isn't ported you could always download
to a PC run the thing and then up load.


-- 
 Michael Ewan    (503)627-6468      Internet:  mike@raven.USS.TEK.COM
 Unix Systems Support                   UUCP:  ...!tektronix!puffin!raven!mike
 Tektronix, Inc.                   Compuserv:  73747,2304
"Fig Newton: The force required to accelerate a fig 39.37 inches/sec."--J. Hart

-----------------------------

From: Tony Rems <rembo@uts.amdahl.com>
Subject: Re: C Documentation Utility Needed
Date: 10 Jan 90 01:24:00 GMT
To:       unix-wizards@sem.brl.mil

In article <625@h.cs.wvu.wvnet.edu> dymm@b.cs.wvu.wvnet.edu (David Dymm) writes:
>
>I am looking for a utility to help in the documentation of C code.
>
>Input:  Multiple 'C' files.
>
>Output: A cross reference report showing the call hierarchy of
>	all functions.
>	Thus, the report might be in the form of a tree where
>	each function is listed showing from where it is called
>	and perhaps how many times it is called.
>
>
>David Dymm			Project Manager
>
>USMAIL: Bell Atlantic Knowledge Systems,
>        145 Fayette Street, Morgantown, WV 26505
>PHONE:	304 291-2651 (8:30-4:30 EST)
>USENET:  {allegra,bellcore, cadre,idis,psuvax1}!pitt!wvucsb!dymm
>INTERNET: dymm@b.cs.wvu.wvnet.edu

There is a set of tools from McCabe & Associates called Battlemap, ACT & 
the Inference Engine.  These tools are designed to measure complexity 
of C code (as well as code in other languages) and it runs under UNIX on
Sun and a few other platforms.  It can produce the calling structure
of a pieced of code as well as the internal structure of the code.
It can produce a report or a graph (or both) and using the inference 
engine it produce cross reference information on the internal 
structure of the code - including called-bys called-from calls-to 
and number of calls.  Although, I found it rather limited in its
capacity as a test tool - which was its purpose, it sounds like it
might suit your purposes.  If you'd like any more info, send me 
some e-mail.

-Tony

-----------------------------

From: Andrew Simms <ams@fourier.princeton.edu>
Subject: Obtaining a unique, "unchangeable" number associated with an SGI workstation
Keywords: copy protection, hostids, unique identifiers
Date: 9 Jan 90 18:23:06 GMT
Sender: news@phoenix.princeton.edu
Followup-To: comp.sys.sgi
To:       unix-wizards@sem.brl.mil

Some of the folks I work for would like to make a reasonably secure
scheme to insure their product runs only on machines they are
licensed to run on.  To do this, they would like to obtain a
read-only number (such as a motherboard serial number) that
could be used as a key to operate the software only on that
machine.  I know mathematica on the Irises has a program called
mathinfo that generates a unique number but I have no idea
what it does to get it.

If there is sufficient interest, I will be happy to post
a summary of responses emailed to me.

p.s.  Ethernet addresses won't quite do it, since it needs
	to run on machines without ethernet boards.
 ----------------------------------------------------------------------

  Andrew Simms					ams@acm.princeton.edu
  System Administrator
  Program in Applied and Computational Math
  Princeton University
  Princeton, NJ   08544
  609/258-5324 or 609/258-6227
  609/258-1054 (fax)

-----------------------------

From: Greg Wohletz <greg@duke.cs.unlv.edu>
Subject: Re: new mscp code in Ultrix 3.1 (was Boot block trashed)
Date: 9 Jan 90 20:15:35 GMT
Sender: news@jimi.cs.unlv.edu
To:       unix-wizards@sem.brl.mil

In article <1444@jimi.cs.unlv.edu>, I write:

> We have three microvax  II's that we  use as fileservers.  Each has  3
> Wren V's and   an Exabyte hooked  into  a  Sigma  scsi  controller  (it
> emulates  a  uda  and  tms controller).   They    also  have a Dec  uda
> controller hooked to  an  rd52 and two rx50's  (yes  we've had  these
> machines for  a while...) on  them.   We have been  running with  this
> configuration under Ultrix  2.0 without  many problems (well a few nfs
> bugs, but nothing major).  Recently we got Ultrix 3.1.  I installed it
> on one of  our microvax's  and everything seemed  to be  going fine, I
> could use the disks, and read from the Exabyte.  However, when I tried
> to dump the root filesystem  to the Exabyte  I got a write error, then
> some message like ``mscp resynching controller uq2'' at that point the
> system locked up.


Well,  I've  investigated the situation   a bit further,   and  I have
discovered that (surprise, surprise)  one difference  between  2.0 and
3.1 is that  all of the disk and  tape drive stuff  appears to have be
re-written.   Now  everything  (except  for  non-uda   type drives and
non-tmscp tapes) goes through this new mscp code (or at least  that is
what it looks  like to me).  Anyway looking  at the code didn't reveal
anything obvious,  however  I have noticed  that I  can't  dump to the
trusty (?) old rx50's.   The first volume  of the dump works fine, but
if you so  much as open the  door to the floppy  when dump asks you to
insert the next volume all subsequent  attempts to write to the floppy
will fail (if you leave the same floppy in (without opening  the drive
door) for  ALL of the volumes it  will work...).   I suspect that this
problem is related to the same bug.  I think  at this point I'm almost
convinced that it is a software bug, and not  a problem with the Sigma
controller, but I could be wrong.

So  the question  is, will  someone  from DEC tell  me if  there  is a
known/fixable bug in 3.1 that would cause this behavior?

Would if be possible to graft in the old tmscp  code  from 2.0 without
an inordinate amount of pain?

ANY information would be greatly appreciated.

    	    	    	    	    	--Greg
    	    	    	    	    	greg@unlv.edu
    	    	    	    	    	<@relay.cs.net:greg@unlv.edu>

-----------------------------

From: Barry Shein <bzs@world.std.com>
Subject: Re: Access to UNIX-Related Publications
Date: 9 Jan 90 23:47:04 GMT
To:       unix-wizards@sem.brl.mil


>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).

	sq = sprintf("%c",39)
	print sq
-- 
        -Barry Shein

Software Tool & Die, Purveyors to the Trade         | bzs@world.std.com
1330 Beacon St, Brookline, MA 02146, (617) 739-0202 | {xylogics,uunet}world!bzs

-----------------------------

From: Lee McLoughlin <lmjm@doc.imperial.ac.uk>
Subject: Wanted: fast tar across ether
Date: 10 Jan 90 02:02:18 GMT
Sender: news@doc.ic.ac.uk
To:       unix-wizards@sem.brl.mil

I am in urgent need of a way to write tar output to a remote tape
drive, an exabyte, over ethernet very quickly - preferably allowing the
exabyte to stream.  I currently use the gnu-tar, which does a pretty
good job but I really something faster.

If necessary I will write my own one - so any suggestions about how
best to do this are welcome.

	Lee

-----------------------------


End of UNIX-WIZARDS Digest
**************************

postmaster@ccf3.nrl.navy.mil (SMTP MAILER) (01/12/90)

 ----Mail status follows----
Have been unable to send your mail to <whitis@rira.nrl.navy.mil>
for one day, will keep trying for another two days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 11 Jan 90 00:48:00 EST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#042
To: "whitis" <whitis@rira.nrl.navy.mil>

Return-Path: <@nrl3.arpa:unix-wizards-request@sem.brl.mil>
Received: from nrl3.arpa by nrl3.arpa with SMTP ; Thu, 11 Jan 90 00:46:53 EST
Received: from SEM.BRL.MIL by nrl3.arpa with SMTP ; Tue,  9 Jan 90 03:27:57 EST
Received: from SEM.BRL.MIL by SEM.brl.MIL id aa21640; 9 Jan 90 3:01 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa21575; 9 Jan 90 2:45 EST
Date:       Tue, 09 Jan 90 02:45:18 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#042
Message-ID:  <9001090245.aa21575@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Tue, 09 Jan 1990              V9#042

Today's Topics:
                Re: Access to UNIX-Related Publications
  Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications)
                        Sun4/SUNOS4.0.1 and tcsh
                        Re: fcntl/socket anomaly
Re: Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)
                    How to create a restricted shell
                  Re: How to create a restricted shell
                 Re: GNU Emacs, memory usage, releasing
            How to delete a file with ^? chars in the name?
                    Need a Tape Drive Hardware guru
                            Re: fuzzy strcmp
                      Re: PWD in Bourne Shell PS1

-----------------------------------------------------------------

From:  Sun Visualization Products <matthew@sunpix.uucp>
Subject: Re: Access to UNIX-Related Publications
Date: 7 Jan 90 18:39:55 GMT
To:       unix-wizards@sem.brl.mil

In article <166@omaha1.UUCP> wcc@omaha1.UUCP (William C Carey) writes:
>
>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).  I can't get the 'print' or
>


Here's an example that should get you in the right direction:

awk 'BEGIN { 
	SQ = sprintf("%c", 39);
	DQ = sprintf("%c", 34);
}
{
	printf("%cHow is this?%c\n", DQ, DQ);
	printf("%cAnd this?%c\n", SQ, SQ);
}


-- 
Matthew Lee Stier                            |
Sun Microsystems ---  RTP, NC  27709-3447    |     "Wisconsin   Escapee"
uucp:  sun!mstier or mcnc!rti!sunpix!matthew |
phone: (919) 469-8300 fax: (919) 460-8355    |

-----------------------------

From: Paul Lew <lew@gsg.uucp>
Subject: Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications)
Date: 7 Jan 90 21:02:40 GMT
To:       unix-wizards@sem.brl.mil

>In article <166@omaha1.UUCP> wcc@omaha1.UUCP (William C Carey) writes:
>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>single-quote character ( ascii 0x27 ).  I can't get the 'print' or
>the 'printf' statement to do it with any combination of backslashes,
>double-quotes, or percent characters.

Try avoid using quotes, double-quotes will make life a lot easier.  I use
the following:

	BEGIN	{ q = 39; }
		{
		printf "this is a quote: %c\n", q;
		}

this free you up to worry about what you want to do instead of quoting
problem.  Just remember the decimal value for quote is 39, I did not start
using this method until I memorized its value (the most intuitive reaction
a programmer has at that point is to use "quote" mostly because he can
not remember the decimal value for quote and dont feel like look into the
ASCII table for it!)
-- 
Paul Lew (lew@gsg.gsg.com)		UUCP:		oliveb---+
						uunet---samsung--+
General Systems Group, 5 Manor Parkway			harvard--+--gsg--lew
Salem, NH 03079	(603) 893-1000				decvax---+

-----------------------------

From: Jussi Eloranta <eloranta@jyu.fi>
Subject: Sun4/SUNOS4.0.1 and tcsh
Date: 8 Jan 90 07:59:18 GMT
To:       unix-wizards@sem.brl.mil


I recall some discussion about tcsh problems with pipes..
but I was unable to find the fixed version of tcsh for sun4/sunos4.0.1
(or does it exist at all?)

Thanks,

Jussi
-- 
============================================================================
Jussi Eloranta               Internet(/Bitnet):
University of Jyvaskyla,     eloranta@tukki.jyu.fi
Finland                      [128.214.7.5]

-----------------------------

From: Chris Torek <chris@mimsy.umd.edu>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 08:27:10 GMT
To:       unix-wizards@sem.brl.mil

>In article <10763@encore.Encore.COM> peralta@encore.com (Rick Peralta) writes:
>>Why when setting the F_SETOWN on a socket a pfind is not done on the PID?
>>Maybe more to the point, why the double standard on how a pgrp is specified?

4.3-tahoe does a pfind, but not for pgroups (negative values), only for
pids (positive values), and only when translating to TIOCSPGRP (more
below).

In article <129970@sun.Eng.Sun.COM> lm@snafu.Sun.COM (Larry McVoy) writes:
>F_SETOWN has been a botch from day one as far as I'm concerned.  For
>those who don't know (or don't remember) F_SETOWN is used to say "send
>this pid the SIGIO when the time is right".  The documentation has
>always said that you can specify pgrps instead of pids (one of them was
>negative to indicate the type) and SunOS, at least, never did that
>(stay tuned).

Actually, I am fairly sure that SunOS 3.x had the 4.2BSD bug where pid
and pgroup were reversed (between documentation and code).  Whether that
has been fixed, I do not know.  (The SunOS 4.x code is substantially
different, and I have not read it.)

>Furthermore, the F_SETOWN uses the same field in the tty
>structure that the tty sub system uses for job control (where ^Z and
>others get sent).  So if you use F_SETOWN on an active tty you get very
>strange things happening.

(The following applies only to 4.3BSD and otherwise-unchanged derivatives
thereof.)

F_SETOWN on an inode translates into a TIOCSPGRP ioctl, so that whatever
checks are applied to TIOCSPGRP are applied to fcntl(ttyf, F_SETOWN).
The translation goes like this:

	if (value > 0) {		[value is a pid, not a pgroup]
		struct proc *p = pfind(value);
		if (p == 0)
			return (ESRCH);
		value = p->p_pgrp;
	} else				[value is a negated pgroup ID]
		value = -value;
	return (fioctl(fp, (int)TIOCSPGRP, (caddr_t)&value);

For a socket, it sets ((struct socket *)fp->f_data)->so_pgrp to the
given value.  Tty pgroups are stored in tp->t_pgrp: a different place.

>My guess is that the SIGIO interface was a hack that some grad student
>needed.

Not really.  It does seem to be done rather badly, however.

>They hacked it in, it works in the obvious cases, it's stuck
>around.  It needs a rewack to be clean (I just checked SunOS - we do
>absolutely no permissions checks on F_SETOWN on sockets).

They are unnecessary.   SIGIO is a completely benign signal.  If a
process is not catching it, SIGIO is discarded.  If a process *is*
catching it, that process is required to figure out why the SIGIO occurred
and whether it still has any reason to do anything about it, so extra
SIGIO signals merely reduce efficiency.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris

-----------------------------

From: "Steven M. Schultz" <sms@wlv.imsd.contel.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 09:11:26 GMT
Sender: news@wlbr.imsd.contel.com
To:       unix-wizards@sem.brl.mil

In article <129970@sun.Eng.Sun.COM> lm@sun.UUCP (Larry McVoy) writes:
>In article <10763@encore.Encore.COM> peralta@encore.com (Rick Peralta) writes:
>>
>>Why when setting the F_SETOWN on a socket a pfind is not done on the PID?
>>Maybe more to the point, why the double standard on how a pgrp is specified?
>
>F_SETOWN has been a botch from day one as far as I'm concerned.  For
	
	amen.

>those who don't know (or don't remember) F_SETOWN is used to say "send
>this pid the SIGIO when the time is right"...
>Furthermore, the F_SETOWN uses the same field in the tty
>structure that the tty sub system uses for job control...
>My guess is that the SIGIO interface was a hack that some grad student
>needed.  They hacked it in, it works in the obvious cases, it's stuck
>around...

	The hack/botch is the F_SETOWN, or rather the whole fcntl(2) syscall.
	As i recall fcntl(2) was (needlessly?) instituted by the creators of 
	System V(anilla) and adopted by Berkeley as a compatability measure,
	nothing that really couldn't be done by ioctl(2) but a new syscall
	was created anyhow.

	and don't forget the overlaying (reuse) of the VTIME and VEOT
	members of the AT&G Unix tty system - switch modes from to/from
	'cbreak' and you have surprises too.  but then, i suppose it was
	done by a graduate student... .5;-)

	Steven

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: fcntl/socket anomaly
Keywords: obscure behavior
Date: 8 Jan 90 18:29:08 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <21691@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
>F_SETOWN on an inode translates into a TIOCSPGRP ioctl, so that whatever
>checks are applied to TIOCSPGRP are applied to fcntl(ttyf, F_SETOWN).
>The translation goes like this:
>
>	if (value > 0) {		[value is a pid, not a pgroup]
>		struct proc *p = pfind(value);
>		if (p == 0)
>			return (ESRCH);
>		value = p->p_pgrp;
>	} else				[value is a negated pgroup ID]
>		value = -value;
>	return (fioctl(fp, (int)TIOCSPGRP, (caddr_t)&value);

Those checks are inappropriate for the F_SETOWN.  For example, POSIX
insists that the tty in question be your controlling tty.  That's both
unecessary and unlikely for processes wanting SIGIO on a tty.

>>My guess is that the SIGIO interface was a hack that some grad student
>>needed.
>
>Not really.  It does seem to be done rather badly, however.
>
>>They hacked it in, it works in the obvious cases, it's stuck
>>around.  It needs a rewack to be clean (I just checked SunOS - we do
>>absolutely no permissions checks on F_SETOWN on sockets).
>
>They are unnecessary.   SIGIO is a completely benign signal.  If a
>process is not catching it, SIGIO is discarded.  If a process *is*
>catching it, that process is required to figure out why the SIGIO occurred
>and whether it still has any reason to do anything about it, so extra
>SIGIO signals merely reduce efficiency.

Permission checks are rarely "unnecessary", it's much more likely that
they're either missing or incorrect.  In this case, they're missing.
Suppose I have process A and process B.  A does a F_SETOWN on some
socket and then goes on, expecting a SIGIO at some later time.  B comes
along, and also does a F_SETOWN on the same socket.  A has been
robbed.

To head off a needless discussion: yes, I realize that if you do the
"right thing" everything is OK and there is no need for permission
checks.  My claim is that the number of programmers who "do the right
thing" (sorry spike) are getting fewer and fewer.
---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: Peter da Silva <peter@ficc.uu.net>
Subject: Re: Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)
Date: 8 Jan 90 15:05:53 GMT
To:       unix-wizards@sem.brl.mil

>    What I mean here is that you can allocate your block poimters, then call
>    map_fd to map the file into memory.

> The problem is that unless you copy the file on disk you can't back
> out of your edits at the last moment (:q! for vi people).  If you're
> going to copy the file you might as well copy it into vmem.

You misunderstand. I wasn't suggesting making direct edits on the memory
image. On the contrary, you map it in read-only if you can. What I was
suggesting was that since most of the things you're doing to the file don't
involve modifying it, you might as well page it in from disk when you
need it, only coping it to writable memory when you want to modify it.

For example, suppose you want to do a search and replace. You fault in
all the pages from here to the replacement location, copy the block that
contains the replacement into two new blocks (using the block-splitting
method) and add the new text. The blocks you just read can be discarded
when needed by the memory manager, rather than having to be written out
to the paging area, saving considerable disk access. Only modified blocks
would need to be written.
-- 
 _--_|\  Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \ Also <peter@ficc.lonestar.org> or <peter@sugar.lonestar.org>
\_.--._/
      v  "Have you hugged your wolf today?" `-_-'

-----------------------------

From: Tzu-Hsi Pan <pantz@nsf1.mth.msu.edu>
Subject: How to create a restricted shell
Keywords: restricted shell
Date: 8 Jan 90 16:19:51 GMT
Sender: usenet@cps3xx.uucp
To:       unix-wizards@sem.brl.mil


Could someone tell me how to build up a restricted shell for some user
such that only a couple of commands can be executed under a new root
environment?  Thanks.

-Pan (pantz@mth.msu.edu)

-----------------------------

From: Wm E Davidsen Jr <davidsen@crdos1.crd.ge.com>
Subject: Re: How to create a restricted shell
Keywords: restricted shell
Date: 8 Jan 90 20:05:48 GMT
To:       unix-wizards@sem.brl.mil

In article <5946@cps3xx.UUCP> pantz@mth.msu.edu (Tzu-Hsi Pan) writes:
| 
| Could someone tell me how to build up a restricted shell for some user
| such that only a couple of commands can be executed under a new root
| environment?  Thanks.

  rsh works with /bin/sh and ksh. You can either execute the rsh command
(SysV) or execute the shell with the -r flag. You simply set the PATH to
point to a directory containing only the things you want to allow, and
then (assuming a recent shell) set the PATH variable readonly. I usually
create a /usr/rbin directory and link stuff in from /bin and /usr/bin.

Ex:
	PATH=/usr/rbin
	readonly PATH; export PATH

-- 
bill davidsen	(davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon

-----------------------------

From: Craig Finseth <fin@uh.msc.umn.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 16:43:41 GMT
Sender: news@uc.msc.umn.edu
To:       unix-wizards@sem.brl.mil

In article <IN_S4Eggpc2@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>There seems to be an assumption here that the only possible methods are
>buffer gap and a linked list of lines. What about a linked list of larger
>blocks? ...

Think of pure buffer gap and linked line as opposite ends of a
continuum.  (Technically, linked character would be on the one end,
but I will ignore that case.)  Pure buffer gap has one chunk, which is
the entire object.  As you divide it into separate chunks (paged
buffer gap), the number increases and their size decreases.
Eventually, you get to a chunk size of one line and have linked line.

In may of the intermediate cases, whether you use an array or linked
list is an implementation detail.

Craig A. Finseth			fin@msc.umn.edu [CAF13]
Minnesota Supercomputer Center, Inc.	+1 612 624 3375

-----------------------------

From: Craig Finseth <fin@uh.msc.umn.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Keywords: GNU emacs malloc memory working set gap editor
Date: 8 Jan 90 16:48:15 GMT
Sender: news@uc.msc.umn.edu
To:       unix-wizards@sem.brl.mil

In article <SN_87Eggpc2@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>> I contend that in a "modern workstation environment" (e.g., Sun 3/60),
>> a simple buffer gap method is preferred over both paged buffer gap and
>> linked line.  I leave it as an excercise for the reader to figure out
>> why.

>I'm not sure this is a valid conclusion. If 75K is the optimal file size
>for a buffer-gap solution, how about paged buffer-gap with 75K pages? Or
>to add a bit of compromise with some of today's brain-dead architectures
>perhaps 64K pages would work nearly as well.

Where did this "75K" figure come from?  It wasn't mentioned by me.  It
would be a very unusual constant to remain constant over a wide range
of architectures, speeds, memory sizes, and other performance-related
figures.

In particular, I have had no trouble editing multi-megabyte files in
GNU Emacs on a Sun 3/280 w/8 MBytes of memory.

Craig A. Finseth			fin@msc.umn.edu [CAF13]
Minnesota Supercomputer Center, Inc.	+1 612 624 3375

-----------------------------

From: Joe Weening <weening@gang-of-four.stanford.edu>
Subject: Re: GNU Emacs, memory usage, releasing
Date: 8 Jan 90 21:56:27 GMT
Sender: USENET News System <news@neon.stanford.edu>
Followup-To: comp.editors
To:       unix-wizards@sem.brl.mil

I'm posting this message to help RMS's desire to remove the discussion
of editor implementation methods from gnu.emacs.

The discussion is currently going on in comp.editors, gnu.emacs and
comp.unix.wizards.  Therefore not everyone contributing to the
discussion may have seen RMS's messages.

The discussion is appropriate for comp.editors, so that's where I'm
directing followups to this message.  It is not appropriate for
gnu.emacs, since that group is meant for short announcements only.  It
is not at all appropriate for comp.unix.wizards and should never have
been posted there.

Please, everyone, let's move this discussion to comp.editors only.  If
you want to continue reading it, subscribe to that newsgroup.
--
Joe Weening                                Computer Science Dept.
weening@Gang-of-Four.Stanford.EDU          Stanford University

-----------------------------

From: Ron Ueberschaer x4399 <ubi@ginger.sri.com>
Subject: How to delete a file with ^? chars in the name?
Date: 8 Jan 90 16:53:11 GMT
Sender: news@unix.sri.com
To:       unix-wizards@sem.brl.mil

I have a file which is named ^?^?^?H01.b (delete character?) and can't
find a way to delete it.  An ls -s on the directory produces:

   ..	... (other files)
    1	???H01.b

If I do an ls *.b, it lists the other .b files, but complains:

	H01.b not found

I've tried:

	rm -i *			(to selectively delete everything)
	rm "???H01.b"
	rm "^v^?^v^?^v^?H01.b"  (control-v delete ...)

and nothing seems to work.

Help me, o wizards!

--Ron Ueberschaer
  ubi@unix.sri.com
  ...!{hplabs,rutgers}!sri-unix!ubi

-----------------------------

From: Ira Rampil <rampil@cca.ucsf.edu>
Subject: Need a Tape Drive Hardware guru
Keywords: Tape, guru, $$$$
Date: 8 Jan 90 21:12:36 GMT
To:       unix-wizards@sem.brl.mil

It was a classic story.  A friend was using a kennedy clone
streaming tape on a PDP-11 to record lab data.  The original
drive 'disappeared' and now he needs to read his old tapes.
He has another Kennedy drive but it can not read most of the
tapes - we hypothesize a relative head misalginment.

Is there anyone out there with the requisite skill to retrieve
the data.  It is worth BIG bucks to my colleague!

Any clues, hints or vectors would be much appreciated!
Thanks,

Ira Rampil, MSEE, MD
Dept of Anesthesia
Univ. Cal, San Francisco

(415) 476-9037, or rampil@cca.ucsf.edu

-----------------------------

From: Fred Mitchell - PA <mitchell@cbmvax.commodore.com>
Subject: Re: fuzzy strcmp
Date: 8 Jan 90 22:30:42 GMT
To:       unix-wizards@sem.brl.mil

In article <297@hhb.UUCP> istvan@hhb.UUCP (Istvan Mohos) writes:
>tchrist@convexe.uucp (Tom Christiansen @ Convex Computer) writes:
>>I'm looking for an algorithm that would allow me to determine
>>whether two strings were similar.  Thus 
>>
>>	"abcde" !~ "xyzzy"
>>	"this old man can read" =~ "that old man can't read"
>>
>>... perhaps just
>>    float   strfzcmp(string1,string2)

I will give a general description of an algorithm that can accomplish
what you ask.

NOTE: I am doing this from the 'top of my head'. Some refinement may
be in order.

You will do a weighted comparision based on two factors:
a) The number of characters each string has in common
b) The number of matches the strings have in sequence

Let's take two arbitrary strings:
	"This old man can't read"    string alpha
	"That silly man can't read"  string beta

Notice that they are of different lengths. Also, there is an alignment
shift. The following algorithm _should_ properly handle this:

a) Count the number of occurences of each character in each string.
   Compare the count of each character in alpha to that in beta in the
   following way:
     For each different character from alpha & beta:
	Normalize the counts so that the greater is normalized to 1.
	Multiply the two normalized values toghether.
	Add this product to a running total.
     Normalize this total by the the length of the longest string
     Multiply that by weight w1 yeilding (we shall call it) yw1

b) Compare the two strings byte for byte as follows:
     Start at the beginning of alpha & beta (let's use i and j as indexes)
     initialize k to 0
     Until we hit the end of either string:
	if (alpha[i] == beta[j])
		++k, ++i, ++j
	else 
		we scan forward on beta to find a byte that matchess
		our current location on alpha. If so, adjust j to index
		it. If nothing was found, do vice-versa for alpha.
     When the above loop is completed,
     Normalize k against the size of the longest string
     and multiply it by weight w2 yeilding (we shall call it) yw2.

     return (yw1 + yw2) / (w1 + w2)


This should produce a good evaluation of how closely matched alpha
is to beta, taking into account mis-alignment. The value returned
will be between 0 and 1 inclusive. Weight w1 should be less than w2.
Perhaps w1 = w2 / 3. Experiment.

As I said, this is off the top of my head, so some refinement is in
order, as should be evident during the implementation/testing phase.

If anyone knows of a better way to accomplish this, let's hear it!

	-Mitchell
	 mitchell@cbmvax.UUCP
	 "The shortening of the Way."

 
		

-----------------------------

From: Dan Mercer <mercer@ncrcce.stpaul.ncr.com>
Subject: Re: PWD in Bourne Shell PS1
Date: 8 Jan 90 23:12:54 GMT
Keywords:
To:       unix-wizards@sem.brl.mil

In article <18@choreo.COM> chris@choreo.UUCP (Chris Hare / System Manager) writes:
:In article <8790.259b3142@ecs.umass.edu> Satam writes,
:> Inserting the following three aliases will help achieve the same
:> effect. Note that this is only for csh.
:> ------------------------------------------------------------
:> alias cd 'chdir \!* && set prompt="${cwd:t}_\\!% "'
:> alias pushd 'pushd \!* && set prompt="${cwd:t}_\\!% "'
:> alias popd 'popd \!* && set prompt="${cwd:t}_\\!% "'
:> -------------------------------------------------------------
:
:This is quite true.  However, a similar thing can be implemented in the
:Bourne shell using shell functions.  There are however two caveats :
:
:	1.  We cannot use the name of a built in shell command 
:	2.  We must recaculate the PS1 each time we do a cd.
:
:Firstly,  becase we want the PS1 to be updated whenever we change
:directories, we cannot use the builtin 'cd' command, but something like it.
:We must also remember to use the new command, because using a cd will mean
:that the directory reflected in our PS1 will be incorrect.
:
:You can try this Bourne shell function :
:
:	go()
:	   {
:	   if [ "$1" ]		# if we got an argument
:	   then
:	      cd $1
:	   else 		# otherwise go home
:	      cd $HOME
:	   fi
:	   PS1=`pwd`"> "	# change the PS1
:	   }
:

For what it's worth,  here is how I implemented things (from
file /usr/acct/ME/bin/.functs which I invoke as . .functs in
my .profile)

#
#       This file invokes function definitions
#
# ps3="`cat /etc/NODENAME`/`basename \`tty\``> "  # set in .profile
pd() { RT=$PWD; cd $1; PWD=`pwd`; PS1="$PWD
${ps3}"; }
lpd()	{ pd $1; ls; }
rt() { pd $RT; }

pd (path directory) changes my directory and reflects the current
directory as the first line of my two line prompt.  The second line
tells me what system I am on (I have access to several) and what
line (I also have a variety of ways to tie in - modem,  direct line,
pass thru line,  Token Ring).  If I am in a sub shell,  a /n is 
appended to the line number to indicate depth,  since I'm frequently
nested through some intermediary program or other.

I can toggle between two directories with the rt command,  very
useful wehn transferring files (mv pattern $RT).

:Remember, shell functions are not passed to their subshells.
:
But are accessible by shell scripts called by current shell.  If
you are lucky enough to have an NCR Tower (no flames please,  they
are my employers) they have the delightful .shrc feature implemented
that gets invoked when you fork an interactive shell.  Once I found
that gem (by accident - it's not documented)  I was able to invoke
my function definitions on all shell levels.

I have lots of other shifty functions.  vi (no args) for instance,
edits my last edited file rather than a file with no name.  Very
useful when mucking with balky items like makefiles.


:Chris Hare				Choreo Systems Inc.
:Coordinator, Systems Management		150 Laurier Ave West
:Authorized SCO Instructor		Ottawa, Canada
:					Phone 613-238-1050
:					Fax   613-238-4453
:*** It Works for ME ! ***		email : uunet!choreo!chris


-- 

Dan Mercer
Reply-To: mercer@ncrcce.StPaul.NCR.COM (Dan Mercer)

-----------------------------


End of UNIX-WIZARDS Digest
**************************

postmaster@ddnvx2.afwl.af.mil (SMTP MAILER) (01/18/90)

 ----Mail status follows----
Have been unable to send your mail to <declerck@sun4b.afwl.af.mil>,
will keep trying for a total of three days.
At that time your mail will be returned.

 ----Transcript of message follows----
Date: 18 Jan 90 01:54:00 MST
From: unix-wizards@BRL.MIL
Subject: UNIX-WIZARDS Digest  V9#050
To: "declerck" <declerck@sun4b.afwl.af.mil>

Return-Path: <unix-wizards-request@sem.brl.mil>
Received: from SEM.BRL.MIL by ddnvx2.afwl.af.mil with SMTP ; 
          Thu, 18 Jan 90 01:52:47 MST
Received: from SEM.BRL.MIL by SEM.BRL.MIL id aa08556; 18 Jan 90 3:02 EST
Received: from sem.brl.mil by SEM.BRL.MIL id aa08510; 18 Jan 90 2:45 EST
Date:       Thu, 18 Jan 90 02:45:15 EST
From:       The Moderator (Mike Muuss) <Unix-Wizards-Request@BRL.MIL>
To:         UNIX-WIZARDS@BRL.MIL
Reply-To:   UNIX-WIZARDS@BRL.MIL
Subject:    UNIX-WIZARDS Digest  V9#050
Message-ID:  <9001180245.aa08510@SEM.BRL.MIL>

UNIX-WIZARDS Digest          Thu, 18 Jan 1990              V9#050

Today's Topics:
                 Re: Want documentation about threading
                           Re: socket -> UID
              Re: Managing a network of UNIX workstations
                 Re: xenix system V tty device drivers
                      Re: Quattro SB2422 and UUCP
        Re: Gripe about mickey-mouse VM behaviour on many Unixes
                    Uugetty/uucico hangs on Sysv/386
                       Interrupted library calls
                     Re: Interrupted library calls
     "bad ulimit" on all non-root "at" & "batch" jobs under 386/ix
   Re: "bad ulimit" on all non-root "at" & "batch" jobs under 386/ix
     8mm tape made on SUNOS 4.0.3, cannot be read with SUNOS 3.5.2
                            REAL TIME CLASS
                        XENIX tty device driver
          Re: How to delete a file with ^? chars in the name?
                 Dynamic Loader for DECstations wanted
               Re: Dynamic Loader for DECstations wanted
                 What do you want in a signal library?
               Re: What do you want in a signal library?
 noise posts (was re: How to delete a file with ^? chars in the name?)
                  SPEC Solicits Benchmark Applications
                   Request of final security checker.
       How does a VARARGS function call another VARARGS function?

-----------------------------------------------------------------

From: Eliot & <moss@takahe.cs.umass.edu>
Subject: Re: Want documentation about threading
Date: 14 Jan 90 19:19:33 GMT
Sender: news@dime.cs.umass.edu
To:       unix-wizards@sem.brl.mil

May I gently suggest that you clarify *which* concept of threading it is that
interests you? There are threaded lists and other *data structure techniques*,
threaded code (a style of programming language implementation), and threads
(also called lightweight processes), which represent loci of execution within
an address space. You might also try other groups (e.g., comp.os.research for
the lightweight process version, comp.compilers (or something like that) or
comp.languages.forth for the language version, etc.).		E
--

		J. Eliot B. Moss, Assistant Professor
		Department of Computer and Information Science
		Lederle Graduate Research Center
		University of Massachusetts
		Amherst, MA  01003
		(413) 545-4206; Moss@cs.umass.edu

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: socket -> UID
Date: 16 Jan 90 05:56:20 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <832@unipas.fmi.uni-passau.de> hessmann@unipas.fmi.uni-passau.de (Georg Hessmann) writes:
>Two processes communicate with the help of a socket. 
>(Socket has the type PF_INET, SOCK_STREAM)
>The first process runs as a background demon (using inetd) and waits
>for incoming messages from the second process.
>
>Problem:
>How can the first process obtain the UID and GID of the second process 
>right from the socket without any extra message from the second process.
>
>We want to disable/enable services of process one for certain 
>UID's and GID's without changing the source code of the second process.

Well, this is a bummer.  You can do it if really have to, but it requires
that
(1) both sockets must be on the same machine, and
(2) having an indepth knowledge that machine's socket implementation.

If you have both of those, the inetd-like process could open /dev/kmem and
grovel around, looking for the socket that was sending, and figure out
to whom it belonged (I think).  You don't want to try this at home, campers,
so the real answer is: "you can't."
---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.
    Besides, I frequently read news when I'n drjhgungh, err, um, drunk.

-----------------------------

From: brnstnd@stealth.acf.nyu.edu
Subject: Re: socket -> UID
Date: 17 Jan 90 08:18:51 GMT
To:       unix-wizards@sem.brl.mil

In article <1990Jan15.053647.24388@athena.mit.edu> jik@athena.mit.edu (Jonathan I. Kamens) writes:
> In article <832@unipas.fmi.uni-passau.de>, hessmann@unipas.fmi.uni-passau.de
> (Georg Hessmann) writes:
> [ How can a program at one end of an Internet socket find out what the ]
> [ UID and GID of the process at the other end of the socket are?       ]

You could use an RFC 931 Authentication Server implementation, so that
you can find out the username by asking TCP port 113 on the client machine.
My implementation is undergoing gamma testing.

Unfortunately, it's easy to compromise security below TCP, so if you
really want to know who you're talking to, run Kerberos.

>   This can't be done.  An Internet domain socket doesn't have any UID or GID
> information associated with it;

It should. The Internet inherited that administrative flaw from the Arpanet.

---Dan

-----------------------------

From: "Jonathan I. Kamens" <jik@athena.mit.edu>
Subject: Re: socket -> UID
Date: 18 Jan 90 03:28:13 GMT
Sender: News system <news@athena.mit.edu>
To:       unix-wizards@sem.brl.mil

In article <20784@stealth.acf.nyu.edu>, brnstnd@stealth.acf.nyu.edu writes:
> In article <1990Jan15.053647.24388@athena.mit.edu> jik@athena.mit.edu
> (Jonathan I. Kamens) writes:
> >   This can't be done.  An Internet domain socket doesn't have any
UID or GID
> > information associated with it;
> 
> It should. The Internet inherited that administrative flaw from the Arpanet.

  Not convinced.  The problem with assigning a UID and GID to a network
socket is
that not all machines connected to the network have a concept of UID's
and GID's.
It's quite common nowadays to see IBM PC's or Macs connected to an ethernet and
given a network address; what UID and GID should be associated with socket
connections to those machines.

  No, I would tend to agree with the decision not to associate UID and
GID with a
socket, simply because a UID's and GID's are Unix things, and the Internet is
certainly not restricted to Unix machines.

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik@Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710

-----------------------------

From: Barr3y Jaspan <bjaspan@athena.mit.edu>
Subject: Re: Managing a network of UNIX workstations
Date: 16 Jan 90 06:19:54 GMT
Sender: News system <news@athena.mit.edu>
To:       unix-wizards@sem.brl.mil

Warning!  This is a long-ish article.

In article <3949@jhunix.HCF.JHU.EDU>, barrett@jhunix.HCF.JHU.EDU (Dan
Barrett) writes:
> 
> 	I may be managing a network of DECstation 3100's running Ultrix in
> the near future.  I have been managing VAXen for a long time, but never a
> network of workstations.  So, I have some questions:

Reading your message, it sounds like you are trying to set up *EXACTLY*
what MIT's Project Athena has already set up.  I'll see if I can address
each of your points, explain Project Athena's solution.

> 
> (1)	How do you handle inter-machine superuser privileges?
> 
> 	I do NOT want to put "root" in /.rhosts -- this is a big security
> 	risk, right?

Athena uses the Kerberos Authentication System for authenication and
authorization (which, by the way, is a "bug free" authentication system
at least in its abstract form (ie: the implementation may have bugs)). 
Each host can have a file called ".klogin" that says which users can log
in to the host as root.  So, if I have already proved to Kerberos that I
really am "bjaspan@athena.mit.edu" and if the machine FOOBAR.MIT.EDU has
me in its .klogin file, then I can log in there as root.

> 
> (2)	How do you do transparent backups?  I want to pop a tape in ONE
> 	tape drive and say "Back up ALL files from ALL workstations onto
> 	this tape."
> 
> 	Suppose I dedicate one workstation as the "main node", mount all
> 	other workstation disks on the main node using NFS, and then back it
> 	up.  This should work...?  But don't I have to worry about
> 	inter-machine superuser privileges?  After all, we want to back up
> 	EVERY file from EVERY machine.
>
> (5)	Should we put disks on every workstation, or have one fileserver and
> 	many diskless workstations?  Which is better?  Easier to maintain?
> 
> 	My idea is to have one or two fileservers, make the other
> 	workstations use NFS, but put a small disk on each workstation for
> 	swapping only.  Good?  Bad?  What's better?
> 

These two are related, so I'll group them.  Athena has set up a number
of fileservers (which use Kerberos authentication to make sure they only
give files  to the right people) to store files.  Each "public
workstation" (of which there are approximately 1000 at the moment) has a
small hard disk which contains enough software for the machine to
function (many of the standard "system files" are also stored on
fileservers) and some local scratch space on a partition called "/site".
Filesystems from the fileservers are then mounted on the local disk
using NFS (and we are also currently experimenting with AFS, the Andrew
File System).

The backup problem then becomes easier.  You don't have to backup the
workstations at all, because no working files are stored there.  You
only have to backup the fileservers, and there is some limited number of them.

> 
> (3)	We'd like all users to have accounts on all workstations.  What's
> 	the best way to maintain an inter-machine password file?  I've
> 	heard vaguely of "yellow pages" but have never used it.
> 

Project Athena's solution to this problem is called "Hesiod", which it a
simple network database containing information for each user.  At
Athena, for example, Hesiod stores the following information (plus others):

    PASSWD: bjaspan:*:9123:101:Barr3y
Jaspan,,E40-342,34261,59604:/mit/bjaspan:/
bin/csh
    FILSYS: AFS /afs/athena.mit.edu/user/b/bjaspan w /mit/bjaspan
     POBOX: POP ATHENA-PO-2.MIT.EDU bjaspan

PASSWD is a standard password entry, except that password field itself
is the special character "*", meaning "ask the user for the password and
use Kerberos to do the authentication."  FILSYS says where my personal
filesystem is (which server, what path on that server, what the name of
the mountpoint on the local machine should be.  (My homedir is on AFS. 
An NFS entry looks like this:
"NFS /u1/lockers/testuser cyrus w /mit/testuser" -- it contains
essentially the same info.)  POBOX is used my the mailhub to determine
which machine stores my mail until I pick it up (mail server is
something you didn't mention.  A post office server holds my mail for me
until I call it up and ask for (using Kerberos to authenticate, of
course).  This way I can read my mail from any workstation.)

> (4)	We'd like a system where the entire network appears to each user as
> 	if it were one huge "machine".  A user would log onto this "machine"
> 	and not care which workstation s/he were actually using.  (Maybe the
> 	"machine" would automatically log the user onto the workstation with
> 	the lightest system load.  I've seen this done with VMS systems at
> 	other schools.)  Can this entire scheme be done?  Transparently?
> 

Well, at Athena, all workstations look essentially the same.  We have
VAXen, IBM RTs, and DECstation 3100s (running BSD4.3, BSD4.3, and
Ultrix, respectively) all running the X window system and the look
exactly the same to users.  (Well, almost.. :-)  Hesiod allows the
network services to be independent of which workstation a user is
actually logged on to.

One thing Athena doesn't do is the "using the machine with the lightest
load" trick.  The premise of Athena is that a workstation should be used
by a single user at a time (although of course they all support multiple
users) so any empty machine is the same as any other.


> 
> (6)	Does anybody make a removable media drive, like the Syquist
> 	44-megabyte cartridge drive, for the DS3100?
> 

I don't actually know what Project Athena uses to back up its
fileservers (I work for sysdev, not operations).  The Student
Information Processing Board (SIPB), however, has a tape drive made by
Exabyte that stores 2.2 GIGAbytes on an tape (we buy the tapes at our
local Tower Records store, and I think they're about $8 apiece.. most
people around here by Sony.)  We are currently running the Exabyte of a
VSII, but I think that is because we are using it to back up the SIPB
AFS cell, and the AFS software doesn't yet work on the DS3100 (we
actually have DS3100's in our office as well) but I seem to recall
hearing someone say that the drive does actually work with that machine.
 Incidentally, Exabyte has announced that they will be releasing a drive
that can store 5 gigabytes (instead of 2.2)
on the same tape by the end of this year.

I have no connection to Exabyte Corp.


> 	Thanks very much for your advice!
> 
>                                                         Dan

You're very welcome.  The best part about all this information that I've
given you is that the software to run it is FREE.  You can get Kerberos
and Hesiod by anonymous FTP from athena-dist.mit.edu.  There are also
things you didn't mention, like "How do users communicate with each
other?"  The answer is the Zephyr Notification Service, which you can
also get from athena-dist.  With all these services, you need a
service-management system, which we also have and is called Moira and
you can FTP it from.. you get the idea.  (Have you ever heard of a
networked conference system called "discuss"?  Well...)

This is a rough sketch of how we do things here.  There are more
knowledgeable people about running a network here that could be far more
useful to you.. 


Barry Jaspan, MIT-Project Athena
bjaspan@athena.mit.edu

-----------------------------

From: Jonathan Bayer <jbayer@ispi.uucp>
Subject: Re: xenix system V tty device drivers
Date: 16 Jan 90 15:35:45 GMT
To:       unix-wizards@sem.brl.mil

saeed@sunseeker.UUCP (Saeed Talebbeik) writes:

>yes there is a section in xenix manual for writing a tty driver but it is 
>only 500 lines. The SCO tech support claims that a true blue tty driver 
>is about 2000 lines. We are missing 1500 lines ! What are they ? What does
>that 1500 line is supposed to do ? That is exactly the problem. What are
>the issues involved that have to be addressed in that 1500 lines ?
>I guess except having access to a sample tty driver source code and running 
>through it there is no way of writing a tty driver for a novice 


I have found that SCO Tech Support makes mistakes in questions like
these.  I was able to implement the serial driver as printed in the
manual.  It doesn't have modem control, but it does work.


JB
-- 
Jonathan Bayer		Intelligent Software Products, Inc.
(201) 245-5922		500 Oakwood Ave.
jbayer@ispi.COM		Roselle Park, NJ   07204    

-----------------------------

From: Andy Ingle <andy@acorn.co.uk>
Subject: Re: Quattro SB2422 and UUCP
Date: 16 Jan 90 15:57:14 GMT
To:       unix-wizards@sem.brl.mil

In article <560@bodie.advsys.UUCP> derek@advent.co.uk (Derek Mulcahy) writes:
>We have a number of customer sites with Dowty Quattro SB2422 modems.
>
>They are all connected to Sun's.  We use uucp for mail and file transfer.
>Most of the time uucp works just fine.  Sometimes it manages to login but when
>it starts the uucp transfer it just gives up.
> [rest of article deleted]

Do make sure that neither modem will recognise X-ON/X-OFF flow control
during uucp as sooner or later an X-OFF char will be sent as part of a
uucp or ack packet and the modem will just stop.

Another point about these modems is they will auto-set the baud rate
*and* *parity* from the first "AT" command they get. Once they think
the're getting even parity they will ignore any odd bytes.  Check that
dial-in modems get setup from a terminal with parity off, and dial-out
ones have a "P_NONE" (or similar) statement in the uucp chat script.

--Andy Ingle

-----------------------------

From: Larry McVoy <lm@snafu.sun.com>
Subject: Re: Gripe about mickey-mouse VM behaviour on many Unixes
Keywords: MIPS, System-V, paging performance, working-set
Date: 17 Jan 90 01:18:43 GMT
Sender: news@sun.eng.sun.com
To:       unix-wizards@sem.brl.mil

In article <19821@watdragon.waterloo.edu> tbray@watsol.waterloo.edu (Tim Bray) writes:
>1. On a 32-Mb (4.3bsd) machine with *nothing* else happening, the OS stupidly 
>   pages away at you if you try to use more than about 20 Mb in the inane 
>   belief that the memory will be needed any moment for one of those gettys or
>   nfsds or something that aren't doing anything.

Not a great alg but not terrible if you are running a time sharing system.
Take your 32 meg, chop of the ~2 meg for the kernel, chop off the ~4 meg
for the buffer cache, and you have about 26 meg left.  Now there is still 
something fishy here - if I've got the numbers right, it does seem odd that
the pager is beating you up with 6 megs free.  I don't believe this for a
second.  Try this

$ adb /vmunix /dev/kmem
lotsfree/D
freemem/D
^D

The pager does not turn on until freemem < lotsfree (and lotsfree on Sun's
is typically small, like 256K or so).  So something is wacko.

>2. A process using only a moderate amount of memory (you think) runs like
>   a dog, and you note that the system is spending much of its time in
>   system state or idle.  Why, you wonder.  It quickly becomes apparent 
>   that the information produced by items such as ps, vmstat, vsar, top, 
>   and so on, is comparable in relevance and accuracy to Robert Ludlum novels 
>   or peyote visions.  (SunOS the villain here).

Yeah, well, um, yeah.  Right. Well, it's like this see...  Actually, the real
problem is sharing.  Who do you charge shared libraries to?  The numbers
displayed by all those programs don't take that into account, but they should
give you a general idea.  Oh, yeah, I assume 4.0 or greater, things were
easy before then.

>3. On a 64-Mb (MIPS) machine, your paging rate, system time, and idle time 
>   all go through the roof if your process insolently tries to random-access
>   more than 32 Mb of memory at once.

Waddya expect?  :-) :-)

>Look, we all appreciate the tender loving care that VM architects have put
>into strategies that are friendly to 100+ moderate-size processes context
>switching rapidly in time-sharing mode.  But there are other ways to use
>computers, and they are currently very poorly supported.  We paid for that
>memory, we have a good use for it, and the OS is getting in our way, and it's
>also REFUSING TO TELL US ACCURATELY WHAT'S GOING ON - an unforgiveable sin by
>my Unix dogma.

Hmm.  The SunOS VM model was designed with exactly this in mind.  You can
use damn near 100% of physical mem on a 4.0 or greater rev of the OS (the
os uses some, but on a 32 meg machine you should be looking at close to
30 megs of user usable ram).

At any rate, qwitchyerbitchin and tell me what you want to have happen.
Don't forget that your solution has to work well when I'm time sharing,
when one process wants the whole machine, and when two processes want the
whole machine.  And if you get it right, I'll get it into SunOS or die
trying.  Looking forward to your reply,
---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.
    Besides, I frequently read news when I'm drjhgunghc, err, um, drunk.
Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

-----------------------------

From: Malaclypse the Elder <dwc@cbnewsh.att.com>
Subject: Re: Gripe about mickey-mouse VM behaviour on many Unixes
Keywords: MIPS, System-V, paging performance, working-set
Date: 17 Jan 90 18:55:59 GMT
To:       unix-wizards@sem.brl.mil

In article <130347@sun.Eng.Sun.COM>, lm@snafu.Sun.COM (Larry McVoy) writes:
> >Look, we all appreciate the tender loving care that VM architects have put
> >into strategies that are friendly to 100+ moderate-size processes context
> >switching rapidly in time-sharing mode.  But there are other ways to use
> >computers, and they are currently very poorly supported.  We paid for that
> >memory, we have a good use for it, and the OS is getting in our way, and it's
> >also REFUSING TO TELL US ACCURATELY WHAT'S GOING ON - an unforgiveable sin by
> >my Unix dogma.
> 
> Hmm.  The SunOS VM model was designed with exactly this in mind.  You can
> use damn near 100% of physical mem on a 4.0 or greater rev of the OS (the
> os uses some, but on a 32 meg machine you should be looking at close to
> 30 megs of user usable ram).
> 
actually, the vm model address using all of physical memory because
it has integrated the paging pool with the buffer pool.  but it really
hasn't done much for such things as page stealing.  in fact, on the
version that was ported into system v release 4, i believe it still uses the
two hand clock algorithm which goes through physical memory regardless
of what that page is being used for.  my studies have shown that you
really want to classify pages according to "type" even with reference
information.  i worked with some developers on prototyping some
improvements in the old regions architecture (system v release 3)
and maybe will get around to integrating it into the vm model.

danny chen
att!hocus!dwc

-----------------------------

From: ACP Network <acp@ms.uky.edu>
Subject: Uugetty/uucico hangs on Sysv/386
Date: 16 Jan 90 16:32:51 GMT
To:       unix-wizards@sem.brl.mil

One of our uucp sites is having trouble with uucico.  We (ukma) call it
every day to exchange netnews and mail, but frequently uucico locks up
on his end.  The machine with the problem is an AT&T 6386 WGS running SysV/386
version 3.1 (or possibly 3.2) with HDB uucp (the standard AT&T distribution); 
the machine that always calls it is a vax running ultrix and Version 2 uucp.  
The modems on both ends are Telebit T-1000's connecting in an MNP mode.

The call takes place around 4 or 5 AM; when the sysop arrives in the
morning, he finds that uucico hung during the call and is still running
(the phone connection is broken).  Uucico can be killed, but the uugetty
refuses to give up the line, and in fact is immune to kill -9.  He has
to shut down the machine & restart to get the serial port back.

Here is a sample of the /usr/spool/uucp/.Log/uucico/ukma file from a crash
(with inserted line breaks):

uucp ukma  (1/10-5:33:37,5057,0) OK (startup)
uucp ukma  (1/10-5:33:39,5057,0) REMOTE REQUESTED 
   (ukma!D.ukmaBYs32 --> acpunc!D.ukmaSYs32 (netnews))
uucp ukma  (1/10-5:34:00,5057,1) REMOTE REQUESTED 
   (ukma!D.ukmaXYs30 --> acpunc!X.ukmaAYs33 (netnews))
uucp ukma  (1/10-5:34:04,5057,2) REMOTE REQUESTED 
   (ukma!D.ukmaBYs42 --> acpunc!D.ukmaSYs42 (netnews))
uucp ukma  (1/10-5:34:43,5057,3) REMOTE REQUESTED 
   (ukma!D.ukmaXYs40 --> acpunc!X.ukmaAYs43 (netnews))
uucp ukma  (1/10-5:34:46,5057,4) REMOTE REQUESTED 
   (ukma!D.ukmaBYs52 --> acpunc!D.ukmaSYs52 (netnews))
netnews ukma  (1/10-5:36:41,5057,5) IN SEND/SLAVE MODE (INPUT FAILURE)
netnews ukma  (1/10-5:36:41,5057,5) FAILED (conversation complete)

A few other items of note:

1) The lockup is intermittent, though it's been getting worse.
2) Other 6386s use the same uucp configuration files, the same modem,
   and are called by the same site without trouble (or, at least not
   this much trouble).
3) The modem on the 6386 has been replaced; this did nothing to fix the
   problem. 

I assume the uugetty is the actual culprit, since it becomes unkillable
(and uucico has enough wits to finish writing its log file).  

Does anyone have any suggestions?  Also, does anyone know how uugetty
becomes unkillable and what could be done to remove it without rebooting?
Please write me directly instead of posting, since I've crossposted
to three groups.  I'll summarize & post if there's any interest.

Kenneth Herron
-- 
acp@ms.uky.edu        University of Kentucky         ACP Network Consultant
ukma!acp         Dept. of Mathematics, room 715 POT          (606) 257-2975
                       Lexington, KY 40506

-----------------------------

From: Paul Breslaw <paul@mecazh.uucp>
Subject: Interrupted library calls
Keywords: Xlib, library, signals, longjmp
Date: 16 Jan 90 17:36:33 GMT
To:       unix-wizards@sem.brl.mil


This problem cropped up in the context of Xlib, but could equally apply to 
any Unix library. Hence the posting to more than one group.

Our application (a CAM package on HP9000/3xx machines under HP-UX6.5 X11.R2)
crashes sometimes when we handle a signal and return from 
the signal handler in a different context from the one in which the handler 
was entered. In other words we do a longjmp(3) from inside the handler.

We found that this is an elegant way to design certain features into a program.

[ Those of you who might want to argue this assertion read on. Those
  who are prepared to accept it can skip to the end of this []'ed bit.

  Our CAM package is a monolithic application running as a single
  process. Until Open Look or Motif is declared winner of the current
  X Look and Feel War, our application remains implemented using no tool
  kit, ie only pure Xlib calls.

  A user of our package can start a computation/display operation
  that might take a long time to complete. We wanted to allow him to
  hit a key to stop it, which would take him back to an earlier point
  in the dialogue.

  There are a large number of such long operations, so we needed a
  fairly general mechanism. 

  We did not want to sprinkle calls to X arbitrarily in the code
  in the hope that they would provide a frequent enough poll.  

  Neither did we want a signal handler to set a global flag and return
  normally, because that is simply the same polling problem in a different
  guise. You then have to sprinkle calls to check the global flag in the
  hope ... etc etc.

  So we had to have a signal handler to implement the required 
  asynchronousness, and it had to exit abnormally to achieve its end.
]

It is all the same, a pretty dangerous thing to do.    

This is especially so if the signal is allowed to interrupt any old bit of 
code that might be updating some data structure that is subsequently needed. 
And this, of course, is what happened when certain Xlib routines were 
interrupted.

Now good old BSD and friends (like Ultrix and HP-UX) offer a number of
means for dealing with the problem.

1. Interrupted system calls can be identified, and restarted when (if) the
   signal handler returns normally.

2. The application can be defensively programmed so that system calls which
   can be interrupted or partially completed are correctly handled.

3. Critical regions can be created with sigblock(2) and sigsetmask(2) providing
   DISABLE and ENABLE capabilities.

Clearly 1 and 2 are fine for system calls, but useless for libraries.

That leaves 3 - but whose responsibility is it to defend the data in the
library - the implementor or the user?

I suppose someone out there will cry `caveat emptor', but there are 
literally hundreds of X calls. How do I know which ones are critical and 
which ones not? If I bracket all the ones I use, I will end up with
ugly code that runs slowly (remember it's two system calls per X call).

Clearly this is a general problem, but I do not recall seeing anything
about it on the net.

Advice welcomed.


Paul Breslaw.
   

-- 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Paul Breslaw, Mecasoft SA,          |  telephone :  41 1 362 2040
Guggachstrasse 10, CH-8057 Zurich,  |  e-mail    :  mcsun!chx400!mecazh!paul
Switzerland.                        |               paul@mecazh.UUCP

-----------------------------

From: Doug Gwyn <gwyn@smoke.brl.mil>
Subject: Re: Interrupted library calls
Keywords: Xlib, library, signals, longjmp
Date: 17 Jan 90 14:57:14 GMT
Followup-To: comp.unix.wizards
To:       unix-wizards@sem.brl.mil

In article <373@node17.mecazh.UUCP> paul@mecazh.UUCP (Paul Breslaw) writes:
>This is especially so if the signal is allowed to interrupt any old bit of 
>code that might be updating some data structure that is subsequently needed. 
>And this, of course, is what happened when certain Xlib routines were 
>interrupted.
>That leaves 3 - but whose responsibility is it to defend the data in the
>library - the implementor or the user?
>Clearly this is a general problem, but I do not recall seeing anything
>about it on the net.

The relevant properties are reentrancy and noninterruptibility.

These issues were recognized by the various standardization groups.
For example, ANSI C requires that signal() be invokable within any
signal handler, and that a signal handler function terminate only
via return, abort(), exit(), or longjmp().  IEEE 1003.1 adds a
large number of ("system call") functions that are required to be
invokable reentrantly or else block signals during their operation
(so that reentrance is not possible).  The X/Open Portability Guide
adds chroot() to this list and imposes these constraints on abort(),
exit(), and longjmp() (which are therefore hard to implement!).

Note that stdio functions and other similar library functions were
NOT so constrained, in order to avoid paying a run-time penalty on
each use of these heavily-used functions.  However, some vendors of
multiprocessor implementations of UNIX have decided to go ahead and
use semaphores to protect critical regions within such library
functions, in order to prevent the kind of problem you encountered.

Unless the specification of a library function states that it is
safe to abort or reenter it, you the application programmer should
take steps to avoid doing so.

-----------------------------

From: Greyham Stoney <greyham@hades.oz>
Subject: "bad ulimit" on all non-root "at" & "batch" jobs under 386/ix
Date: 16 Jan 90 19:37:11 GMT
To:       unix-wizards@sem.brl.mil

Our system has suddenly, and for no apparent reason, started rejecting all
jobs from "at" and "batch" by users other than root with the error message
"bad ulimit" mailed back to the user when the command is run.

The problem appears to be in setting up the batch environment to be the
same as the one in which the job was queue'ed. Our /etc/default/login
contains:
	ULIMIT=99999
(to make filesize effectively unlimited).

Then, the /usr/lib/cron/.proto file has an entry:
	ulimit $l
(to set the ulimit the same as when the batch job was queued).

But, when this 'ulimit' command is ultimately run in the batch job, it
gets rejected with the "bad ulimit" message. Only root can increase it's
ulimit; so presumably cron should be starting the jobs with unlimited
(or very large) ulimit, so that the .proto generated entry can bring it
down to what it should be. So, what could be causing cron to start the job
with too small a ulimit?. Or is something else wrong here?. Any ideas?.

Thanks, Greyham.

-- 
/*  Greyham Stoney:                            Australia: (02) 428 6476  *
 *     greyham@hades.oz  - Ausonics Pty Ltd, Lane Cove, Sydney, Oz.      *
 *                ISDN: Interface Subscribers Don't Need                 */

-----------------------------

From: "Conor P. Cahill" <cpcahil@virtech.uucp>
Subject: Re: "bad ulimit" on all non-root "at" & "batch" jobs under 386/ix
Date: 17 Jan 90 00:23:48 GMT
To:       unix-wizards@sem.brl.mil

In article <558@hades.OZ>, greyham@hades.OZ (Greyham Stoney) writes:
> But, when this 'ulimit' command is ultimately run in the batch job, it
> gets rejected with the "bad ulimit" message. Only root can increase it's
> ulimit; so presumably cron should be starting the jobs with unlimited
> (or very large) ulimit, so that the .proto generated entry can bring it
> down to what it should be. So, what could be causing cron to start the job
> with too small a ulimit?. Or is something else wrong here?. Any ideas?.

Cron starts from an /etc/rc2.d file, which is run by init.  The ULIMIT in
effect when init starts cron is the ulimit in the kernel (max at 12228 or 
something like that).  Since cron is running as root, it does not 
to obey the ulimit (and any of root's cron jobs doesn't either).  However,
once the job starts up as non-root it must obey the ulimit.  

The fix for this is to modify the startup file (/etc/rc2.d/S75cron on this 
system) so that it sets it's ulimit real high before starting cron. 

-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+

-----------------------------

From: "Steven M. Schultz" <sms@wlv.imsd.contel.com>
Subject: Re: "bad ulimit" on all non-root "at" & "batch" jobs under 386/ix
Date: 17 Jan 90 10:38:30 GMT
Sender: news@wlbr.imsd.contel.com
Followup-To: comp.unix.i386
To:       unix-wizards@sem.brl.mil

In article <1990Jan17.002348.11507@virtech.uucp> cpcahil@virtech.uucp (Conor P. Cahill) writes:
>In article <558@hades.OZ>, greyham@hades.OZ (Greyham Stoney) writes:
>> But, when this 'ulimit' command is ultimately run in the batch job, it
>> gets rejected with the "bad ulimit" message...
>
>Cron starts from an /etc/rc2.d file, which is run by init.  The ULIMIT in
>effect when init starts cron is the ulimit in the kernel (max at 12228...

	i must disagree.

	"ulimit" is BAD,  actually 'impish' is more descriptive - it does
	no real good, but a great deal of inconvenience and mischieve.

	the "correct" fix is to convince the purveyors of
	the product which include this brain-dead system call to remove
	it and implement disc quotas (a la 4.3/2.10.1BSD).

	Steven M. Schultz
	sms@wlv.imsd.contel.com

-----------------------------

From: Joseph Sarkes <joe@junkyard.uucp>
Subject: Re: "bad ulimit" on all non-root "at" & "batch" jobs under 386/ix
Date: 17 Jan 90 23:02:59 GMT
Followup-To: poster
To:       unix-wizards@sem.brl.mil


ulimit is set by the kernel for all programs using the compiled in
value. This is set in the configuration file (stune) or whatever
your system uses. since login runs as root, it can take the default
value and raise it. a process started by cron is not started by
login, thus it does not get its ulimit raised before running. thus
is is necessary to have the stune value of ulimit as high or higher
than the default login value for cron to work right, or you can
change the cron prototype if that works better for you. 

Joseph Sarkes	(junkyard!joe)

-----------------------------

From: Jay Llewellyn <jkl@eplrx7.uucp>
Subject: 8mm tape made on SUNOS 4.0.3, cannot be read with SUNOS 3.5.2
Keywords: 8mm SUNOS
Date: 16 Jan 90 20:59:49 GMT
Sender: usenet@udel.edu
To:       unix-wizards@sem.brl.mil


	I currently have a problem reading 8mm tapes between two
different versions of the SUNOS.  My two active brain cells tell
be that this had been discussed at some point in the past.  If this 
topic has been covered in detail previously, and you have a summary 
please e-mail, otherwise here goes with the problem description.


	The two machines in question:

		4/260 running SUNOS 4.0.3
		3/160 running SUNOS 3.5.2

	Tapes make on the 3/160 can be read on both machines but,
the tapes made on the 4/260 can only be read by the 4/260.  When a
3/160 tape is tried on the 4/260 an I/O error occurs.  Both dump and
tar were tried, dd also fails with a I/O error. 

	Can this problem be overcome, without upgrading the 3/160,  
and how can it be done.

Thanks in advance.

jkl
-- 
    Jay Llewellyn                 |    E.I. Du Pont de Nemours & Co.
    eplrx7!jkl@uunet.uu.net       |    Engineering Physics Laboratory
    (302) 695-8209/7395           |    P.O. Box 80357
   "Maybe it was the roses"       |    Wilmington, DE 19880-0357
--
The UUCP Mailer

-----------------------------

From: Saeed Talebbeik <saeed@sunseeker.uucp>
Subject: REAL TIME CLASS
Date: 17 Jan 90 03:21:16 GMT
Sender: news@cirrusl.uucp
To:       unix-wizards@sem.brl.mil

I live in San Jose, California. I am looking for a good hands on course in
"real time software design". Does anyone have any idea which university 
offers such a course ? 

-----------------------------

From: Saeed Talebbeik <saeed@sunseeker.uucp>
Subject: XENIX tty device driver
Date: 17 Jan 90 03:27:53 GMT
Sender: news@cirrusl.uucp
To:       unix-wizards@sem.brl.mil

This message is for Mr. Jonathan Bayer in particular:
Thanks for the info. That makes me feel a little better. However does this code
in the XENIX manual handle the issue of multiple serial lines on one controller.
I guess the answer is yes since if it can handle one serial port it should be
able to handle several. Also do the line descipline routines handle the
issue of several processes trying to write to a single port? How about several
processes trying to read from the same port? This should be illegal since only
the first process that opens the tty for reading should be the sole reader
and other processes should not be able to read from the tty device(breach of
security I guess). If you JB or others have any comments please leave a message
for me . Thanks.

-----------------------------

From: Barry Shein <bzs@world.std.com>
Subject: Re: How to delete a file with ^? chars in the name?
Date: 17 Jan 90 05:15:08 GMT
To:       unix-wizards@sem.brl.mil


From: jik@athena.mit.edu (Jonathan I. Kamens)
>  The number of unnecessary postings, many of them wrong, about "How to
>delete a file with ^? chars in the name?" is really, really getting
>irritating.  Can people just *stop* posting, please?  And if you *are*
>going to post about it, then post about the *real* question, which is
>how to deal with files that have the eighth bit set in characters in
>their names.

Although your heart's in the right place you're missing the point. I
would bet that most people who post dumb/repetitive questions are new
to the list so they won't see your pleas.

I used to like to stand up in front of a class on the first day of the
semester, look out at the audience confused and comment "didn't I
explain all this stuff *last* year? What's your problem?"

Probably some of these questions are unleashed between "frequently
asked questions" postings although on USENET these sorts of things are
supposed to be archived and somehow the new user nudged toward them. I
must admit that such helpful hints are getting so large as to be less
than helpful.

On my system I have well over 1,000 newsgroups, imagine if even 10%
had a few pages of "frequently asked questions" or equivalent, no one
would read it, hundreds of pages. It's bulky already with frequently
asked questions, emily_postnews, netiquette, group descriptions, etc.

Here's an evil idea:

Let's put a hook into the mail readers which ignores all postings on
unix-wizards which doesn't, oh I dunno, have a subject line ending
with a period, or exactly two blank lines at the beginning, something.

Then explain this requirement at the end of frequently asked questions...

heh heh...:-)

-- 
        -Barry Shein

Software Tool & Die, Purveyors to the Trade         | bzs@world.std.com
1330 Beacon St, Brookline, MA 02146, (617) 739-0202 | {xylogics,uunet}world!bzs

-----------------------------

From: Greg Kemnitz <kemnitz@postgres.uucp>
Subject: Dynamic Loader for DECstations wanted
Date: 17 Jan 90 08:58:50 GMT
Sender: news@pasteur.berkeley.edu
To:       unix-wizards@sem.brl.mil

This is probably wishful thinking, but does anyone out there know of any
public domain dynamic loaders (lets you load a .o file and its associated
procedures at runtime) for DECstations (or have any source code :-))??  Any
and all help is greatly appreciated.


 -----------------------------------------------------------------------
Greg Kemnitz                  |      "I ran out of the room - I
Postgres Chief Programmer     |      didn't want to be killed by a pile
kemnitz@postgres.berkeley.edu |      of ULTRIX manuals" :-)
                              |
                              |      --A friend at DEC Palo Alto in the Quake

-----------------------------

From: George Hartzell <hartzell@boulder.colorado.edu>
Subject: Re: Dynamic Loader for DECstations wanted
Date: 17 Jan 90 17:16:43 GMT
Sender: news@boulder.colorado.edu
Followup-To: comp.unix.ultrix
To:       unix-wizards@sem.brl.mil

In article <21209@pasteur.Berkeley.EDU>, kemnitz@postgres (Greg Kemnitz) writes:
>This is probably wishful thinking, but does anyone out there know of any
>public domain dynamic loaders (lets you load a .o file and its associated
>procedures at runtime) for DECstations (or have any source code :-))??  Any
>and all help is greatly appreciated.
>

I wrote something that works with the newer MIPS compilers (I was
using 2.10 because I needed there builtin alloca for another part
of the port) that does dynamic loading for a version of scheme called
ELK.  It should work for DECstations, but several people have told me
that there is a problem with the MIPS 1.31 ld's handling of the -T
option.  The jist of it seemed to be that it wasn't possible under the
current compiler release.  I think that they have the newer release
(I don't know if it is MIPS 2.0 or 2.1) in field test.  If you want to
see the code, let me know.
g.
George Hartzell			                  (303) 492-4535
 MCD Biology, University of Colorado-Boulder, Boulder, CO 80309
hartzell@Boulder.Colorado.EDU  ..!{ncar,nbires}!boulder!hartzell

-----------------------------

From: brnstnd@stealth.acf.nyu.edu
Subject: What do you want in a signal library?
Date: 17 Jan 90 08:59:27 GMT
To:       unix-wizards@sem.brl.mil

For amusement I'm writing a BSD library for dealing with signals in
The Right Way. Each signal gets a stack of handlers, invoked one at a
time when the signal arrives. There are functions for manipulating the
stacks, temporarily blocking a signal (but receiving it when the block
is released), turning off the special handling, etc. What else do people
want? Should there be special routines dealing with particular signals:
CHLD, time signals (ALRM, VTALRM, PROF), and so on?

On the same subject: How does one correctly code ANSI C raise() so as to
prevent race conditions? I want to make sure I'm not messing this up.

---Dan

-----------------------------

From: Doug Gwyn <gwyn@smoke.brl.mil>
Subject: Re: What do you want in a signal library?
Date: 17 Jan 90 15:02:44 GMT
To:       unix-wizards@sem.brl.mil

In article <20926@stealth.acf.nyu.edu> brnstnd@stealth.acf.nyu.edu (Dan Bernstein) writes:
>On the same subject: How does one correctly code ANSI C raise() so as to
>prevent race conditions? I want to make sure I'm not messing this up.

/*
	raise() -- send a signal to the current process

	public-domain implementation

	last edit:	16-Jan-1990	Gwyn@BRL.MIL

	complies with the following standards:
		ANSI X3.159-1989
		IEEE Std 1003.1-1988
		SVID Issue 3
 */

extern int	getpid(), kill();	/* UNIX/POSIX system calls */

int
raise(sig)
	int	sig;
	{
	return kill(getpid(), sig);	/* set errno to EINVAL if sig invalid */
	}

-----------------------------

From: Jamie Zawinski <jwz@teak.berkeley.edu>
Subject: noise posts (was re: How to delete a file with ^? chars in the name?)
Date: 17 Jan 90 19:17:58 GMT
Sender: news@pasteur.berkeley.edu
To:       unix-wizards@sem.brl.mil

In article <1990Jan17.051508.2531@world.std.com> bzs@world.std.com (Barry Shein) writes:
- [ ... ]
- Although your heart's in the right place you're missing the point. I
- would bet that most people who post dumb/repetitive questions are new
- to the list so they won't see your pleas.
- [ ... ]
- Here's an evil idea:
- Let's put a hook into the mail readers which ignores all postings on
- unix-wizards which doesn't, oh I dunno, have a subject line ending
- with a period, or exactly two blank lines at the beginning, something.
- Then explain this requirement at the end of frequently asked questions...
- 
- heh heh...:-)

This is from the weekly posting of alt.hackers:

- To cut down on mindless violations of the rule, the group is
- self-moderated - marked as moderated, but with no moderator's address.
- Anyone who can figure out how to approve a message is welcome to post.
- I'm not going to post the (trivial) instructions for actually doing
- it.

Just a thought.  Of course, someone would just end up putting the
instructions for doing this in a new-users file somewhere, but it might
last for a while.

		-- Jamie

-----------------------------

From: "Robert E. Novak" <rnovak@mips.com>
Subject: SPEC Solicits Benchmark Applications
Date: 17 Jan 90 22:14:45 GMT
Sender: news@mips.com
To:       unix-wizards@sem.brl.mil

SPEC is actively soliciting for source code that will be included in future
SPEC benchmark releases.  The attached memo is the form that must be
completed BEFORE a benchmark is submitted.  SPEC cannot consider a
benchmark unless we can have a clear permission to use and distribute from
the author/owner of the benchmark.  We are particularly interested in
applications as opposed to synthetic benchmarks.  In a separate posting I
will publish the SPEC guidelines for good application programs.


                                              SPEC



       subject: Permission to Use and         date: January 17, 1990
                Distribute Computer
                Program                       from: SPEC Steering Committee



       1.  Name_and_Description_of_Program








       2.  Name_and_Address_of_Program_SUBMITTER








       3.  Permission_to_Use_and_Distribute

         1.  License.  SUBMITTER grants SPEC the non-revokable,
             non-exclusive/exclusive (strike one) right to copy,
             modify and distribute the PROGRAM to third parties
             insofar as SUBMITTER has proprietary rights in the
             PROGRAM.

         2.  Fee.  SUBMITTER waives any fee for the license of
             paragraph 1, both from SPEC and from end users to whom
             SPEC may license PROGRAM.

         3.  Restrictions.  The following restrictions are imposed
             by SUBMITTER on SPEC with regard to the license of
             paragraph 1 (write None if none apply; use separate
             continuation sheet, if needed):






         4.  Representation.  SUBMITTER represents that the PROGRAM
             submitted to SPEC is the best available version of the
             PROGRAM and that the PROGRAM is either in the public
             domain or owned by SUBMITTER and that SUBMITTER is not
             aware of any actual or threatened infringement claim











                                  - 2 -



             relating to the PROGRAM.

       SUBMITTER


       By _____________________________


       Name ___________________________


       Address ________________________


       ________________________________


       Telephone ______________________



       SPEC


       By _____________________________


       Memorandum to
       Standard Performance Evaluation Corporation
       c/o Waterside Associates
       39510 Paseo Padre Parkway
       Suite 350
       Fremont CA  94538

 -----
Robert E. Novak                                     MIPS Computer Systems, Inc.
{ames,decwrl,pyramid}!mips!rnovak      928 E. Arques Ave.  Sunnyvale, CA  94086
rnovak@mips.COM       (rnovak%mips.COM@ames.arc.nasa.gov)       +1 408 991-0402
-- 
Robert E. Novak                                     MIPS Computer Systems, Inc.
{ames,decwrl,pyramid}!mips!rnovak      928 E. Arques Ave.  Sunnyvale, CA  94086
rnovak@mips.COM       (rnovak%mips.COM@ames.arc.nasa.gov)       +1 408 991-0402

-----------------------------

From: "Gregory A. Hooten" <gahooten@orion.arc.nasa.gov>
Subject: Request of final security checker.
Date: 18 Jan 90 01:09:45 GMT
Sender: usenet@ames.arc.nasa.gov
To:       unix-wizards@sem.brl.mil

A while back, a person asked what people would put into a security checking 
program if they had a choice.  Has anyone condenced the program down to a 
list of requested items to check for?  I would be interested in this infor-
mation if possible.

Thanks

Greg Hooten
GAHOOTEN@ames.arc.nasa.gov

-----------------------------

From: Fariborz "Skip" Tavakkolian <fst@gtenmc.uucp>
Subject: How does a VARARGS function call another VARARGS function?
Keywords: VARARGS
Date: 18 Jan 90 01:52:24 GMT
To:       unix-wizards@sem.brl.mil

I think I have tried everything, though not sure. The problem looks like
this:

void error_function_1(file, line, errorlevel, fmt, va_alist)
	char *file, *fmt, *errorlevel;
	int line;
	va_dcl
	{
	va_list args;
	/* do stuff */
	error_function_2(errorlevel, fmt, args);
	/* do stuff */
	va_end();
	}

/* error_function_2 is another VARARGS function which uses vfprintf
 * for further processing
 */

Short of doing the ugly _arg1, _arg2, _arg3, ..., _arg1001, etc... is there
a ``right'' way of doing this?

Many thanks.

Skip
-- 
 ----------------------------------------------------------------------------
Fariborz "Skip" Tavakkolian  -of-  Automated Cellular Engineering
Currently consulting         -at-  GTE Telecom, Inc. Bothell, Wa
Mail:                              tiny1!fst@mcgp1  -or-  fst@gtenmc

-----------------------------


End of UNIX-WIZARDS Digest
**************************