HDTenEightyP/NetNews huggingface dataset:
From: acourtny@unix1.tcd.ie (Antony A. Courtney)
Newsgroups: comp.unix.wizards,comp.unix.programmer,comp.unix.internals
Subject: Re: Implementation of Sys V. based message queues
Date: 3 Sep 92 22:10:46 GMT
Organization: Trinity College, Dublin

In <1992Sep1.155322.5522@panther.mot.com> asu@panther4.panther.mot.com (ASU Student) writes:
>Hello,
>  Does anyone have any insight in to the implementation of Sys V
>based message queues (on SunOS)?

All the system V IPC mechanisms are completely inconsistent with the rest of
the i/o facilities provided by Unix.  The "key"s they use are their own name
space, they are persistent after process death, they don't use descriptors so
you can't use normal read()/write()/select() semantics, and they add about a 
dozen system calls to the kernel just for handling them in their own arcane way.

>The reason I ask is because I would
>like to be able to use select(2) to multiplex descriptor based objects
>(sockets) as well as the message queue.

I could be mistaken, but my experience with using Sys V IPC with select()
is:  
	'aint no way...

I had the wonderful experience when integrating the DCE threads package with
a control process we had developed in a multi-process environment.  The
system ran beautifully first time, creating all the threads, sharing all the
data properly, simulating blocking i/o, etc.  And then the process had to
read some data from a Sys. V message queue and the process STOPPED STONE
DEAD.

Loads of fun. :-) 

(don't even get me started on Sys V semaphores....and to think Unix was once
appreciated for "simplicity" and "clarity".  *sigh*....)

	-antony

--
********************************************************************************
* Antony A. Courtney                              Email: acourtny@unix1.tcd.ie *
* Computer Science Department                            antony@george.lbl.gov *
* Trinity College, Dublin, Ireland                Phone: 01+353+1-607389       *
Xref: sparky comp.unix.wizards:3793 comp.unix.questions:10726
From: jim@cs.strath.ac.uk (Jim Reid)
Newsgroups: comp.unix.wizards,comp.unix.questions
Subject: Re: reliable signals under BSD / SVR4
Date: 4 Sep 92 12:04:31 GMT
	<acourtny.715556934@unix1.tcd.ie>
Organization: Computer Science Dept., Strathclyde Univ., Glasgow, Scotland.
In-reply-to: acourtny@unix1.tcd.ie's message of 3 Sep 92 21:48:54 GMT

In article <acourtny.715556934@unix1.tcd.ie> acourtny@unix1.tcd.ie (Antony A. Courtney) writes:

   Has anyone investigated other models for signal delivery?  Since signals are
   meant to be analogous to interrupts, wouldn't it be useful to guarantee that
   all signals sent are processed?

Not always. For instance, how could a process handle a second KILL or
STOP signal sent to it? Or why would someone want to know how many
times a process has been sent a signal that it was ignoring?

In the Good Old Days, signals had one simple function to perform. This
was to inform a process that Something Bad had happened - memory
violation, arithmetic exception, etc - so that the process could do
some cleanup before it terminated. Everything that has been done to
signals since then has added complexity and features that the
mechanism was never originally designed or intended for.

		Jim
Newsgroups: comp.unix.wizards
From: tching@target.water.ca.gov (Tracy Ching <SysAdmin>)
Subject: Re: Negative file size...   Was: A few UNIX questions
Organization: California State University, Sacramento
Distribution: usa
Date: Thu, 27 Aug 1992 20:48:24 GMT

In article <1992Aug27.162220.16130@krfiny.uucp> jeffj@krfiny.uucp (J. Jonas) writes:
>>mike@BRL.MIL ( Mike Muuss) writes:
>>: From: Michael Panosh <mwp.michael@melpn1.prime.com> PrimeService, Australia
>>: > Can *anyone* tell me why the file size is a signed integer.  Surely there
>>: > is no need for negative sized files!!
>>Umm, and a *signed* file size helps, does it?
>....
>I know of no possible time a file could have a negative size.
>Jeffrey Jonas
>jeffj@synsys.uucp

	I guess the negative file size is analogous to negative resistance.
(something for the non-electronic unix buffs to chew on...) Just my $.02
Newsgroups: comp.unix.wizards
From: fgg@gemini.gsfc.nasa.gov (Frank G. Gomez)
Subject: SIGKILL'ed before exec()
Organization: NASA GSFC CDP VLBI
Date: Thu, 27 Aug 1992 15:04:27 GMT

Hello,

We are  experiencing a SIGKILL when  attempting an exec system call.  We
think it is  probably  due to some  system  parameter  that  needs to be
increased.  This hypothesis is based on the following two passages ...

------------------------------------------------------------------------
HP-UX Reference Manual Volume 3, page 669 (signal(5)):

   "SIGKILL  is  sent  by  the  system  if an  exec(2)  system  call  is
    unsuccessful  and the  original  program has already  been  deleted"

------------------------------------------------------------------------
Bach's "The Design of the UNIX Operating System" page 220, 4th paragraph
(discussing exec's algorithm):

   "After copying the exec  parameters to a holding place in the kernel,
    the kernel  detaches the old regions of the process using  algorithm
    detachreg  [ ......  ] At this point the process  has no  user-level
    context,  so any  errors  that it incurs  from now on  result in its
    termination,  caused by a signal [the SIGKILL].  Such errors include
    running out of space in the kernel region table,  attempting to load
    a program whose size exceeds the system limit,  attempting to load a
    program  whose  region  addresses  overlap,  and  others."
------------------------------------------------------------------------

The important questions appear to be:

1) What are these  'other'  reasons ?
2) To   which   system   parameters do  the  first  two  above-mentioned
   reasons  correspond  ?
3) Under  what circumstances would the third reason occur ?

The  machine  is an HP 730 at 8.05 with 100 MB of swap.  The  error  has
occurred even when the process was the only user process running.

Any type of answers to these questions would be greatly appreciated.


Frank G. Gomez        fgg@gemini.gsfc.nasa.gov
Newsgroups: comp.unix.wizards
From: etxmesa@eos.ericsson.se (Michael Salmon)
Subject: Re: A few UNIX questions
Reply-To: etxmesa@eos.ericsson.se (Michael Salmon)
Organization: Ericsson Telecom AB
Date: Thu, 27 Aug 1992 13:25:44 GMT

In article <169@sc.sni.ie>, 
bsullivn@sc.sni.ie (Bryan O'Sullivan) writes:
|> 
|> 
|> frank@D012S436.sniap.mchp.sni.de writes:
|> 
|> ::Because lseek() needs to be able to return -1 on error, and not have it
|> ::look like a valid file offset.
|> 
|> :Umm, and a *signed* file size helps, does it?
|> 
|> RTFM.  Lseek(2) returns the current position in the file, or -1 on
|> error.  If you can think of any way to produce -1 by using unsigned
|> values, well ...

~0 works for me.

-- 

Michael Salmon

#include	<standard.disclaimer>
#include	<witty.saying>
#include	<fancy.pseudo.graphics>

Ericsson Telecom AB
Stockholm
Newsgroups: comp.unix.wizards,comp.unix.questions
From: trevore@vast.unsw.edu.au (Trevor Elbourne (Supr. Hell) BE)
Subject: help with ptrace
Organization: University of New South Wales
X-Newsreader: Tin 1.1 PL4
Date: Tue, 1 Sep 1992 02:22:02 GMT


Does anybody know how to use the ptrace system call successfully? 
I have tried with no success. I am trying to trace a child process 
after doing a fork(). After the fork I get the child to do an
ptrace(TRACE_ME,.....) and then an execve. Because the child does
the ptrace(TRACE_ME,...) call the subsequent execve will cause a 
signal to be sent to the parent (0177), which does a wait. The child
should then be stopped and the parent should now be able to control
the child via ptrace (single stepping it, examining its registers
.. etc).

In my case the parent recieves the 0177 signal ok and the first attemp
to use ptrace(SINGLE_STEP,...) works fine, but any subsequent attempt
to single step the child fails with the error: no such process. Can anyone
please help me? Anyway here's the test program I tried;

-------------------------------------------------------------------------
#include	<stdio.h>
#include	<ptrace.h>
#include	<signal.h>
#include	<sys/wait.h>

extern	int	errno;

main(int argc, char **argv, char **envp)
{
	int		pid;
	int		x,count;
	union wait	status;                  
	char		buff[127];

	switch (pid = fork())
	{
	case 0 	: /* child */
		if (ptrace(PTRACE_TRACEME, 0, NULL, 0, NULL, 0) < 0)
		{
			perror("child ptrace failed"); exit(2);
		}

		printf("child signals ... \n");
		fflush(stdout);
		++argv;
		execve(argv[0],argv,envp); /* process to trace */
		exit(0);

	default	: /* parent */
		if (wait(&status) != pid)
		{
			perror("wait failed"); exit(3);
		}

		printf("status: %08x\n", status);
		errno = 0;
		if (ptrace(PTRACE_SINGLESTEP, pid, NULL, 0, NULL, 0) < 0)
		{
			perror("parent attach ptrace failed"); exit(2);
		}
		/* single step child until its done */
		while (ptrace(PTRACE_SINGLESTEP, pid, NULL, 0, NULL, 0)==0)
			++count;
		printf("count: %u\n",count);
		break;

	case -1	: /* error */
		perror("fork failed");
		exit(1);
	}

	exit(0);
}                                                               
-----------------------------------------------------------------------------

Thanks in advance.

Cheers
-Trevor


Newsgroups: comp.unix.wizards,comp.unix.questions
From: terry@thisbe.Eng.Sandy.Novell.COM (Terry Lambert)
Subject: Re: reliable signals under BSD / SVR4
Keywords: signals, reliable, software interrupts
Organization: Novell NPD -- Sandy, UT
Date: Wed, 2 Sep 1992 19:42:18 GMT

In article <Btwqvs.LAI@zeus.dialix.oz.au> peter@zeus.dialix.oz.au (Peter Wemm) writes:
>BSD/POSIX/SVR4 signals to not automatically "reset" to default on
>actication, and the signal is usually *masked* to prevent a recurring
>signal from within the handler.  The mask is cleared when the handler 
>returns.  I dont seem to remember anything about reliable stacking or 
>queueing of signals in this model.

	The POSIX 1003.4 draft currently includes queued signals, such that
signals are treated as discrete "1 signal/1 handler invocation" events.


					Terry Lambert
					terry_lambert@gateway.novell.com
					terry@icarus.weber.edu

---
Disclaimer:  Any opinions in this posting are my own and not those of
my present or previous employers.
From: markk@sagredo.West.Sun.COM (Mark Kampe)
Newsgroups: comp.unix.wizards
Subject: Re: Info needed on UnErase utility ...
Date: 28 Aug 1992 15:00:34 GMT
Organization: SunSoft South
NNTP-Posting-Host: sagredo.west.sun.com

"UnErase" is a registered trademark of Symantec (ne Peter Norton Utilities).
I assume you are asking for a generic capability.

The Norton Utilities for System V includes this capability for INTERACTIVE,
SCO and AT&T V.3.2 systems and provides a very reliable and configurable 
service for recovering deleted files.  Support for other systems (V.4, Apple,
IBM, HP, ...) is in limbo.

LoneStar's ButtSaver provides a less reliable mechanism to recover VERY 
RECENTLY deleted files on old-style (non-bitmap-freelist) file systems. 
The LoneStar product is less costly but works on a wider range of platforms.
From: guy@Auspex.COM (Guy Harris)
Newsgroups: comp.unix.wizards
Subject: Re: 'cat'ting 8 bit data to the terminal.....
Date: 27 Aug 92 21:59:58 GMT
Organization: Auspex Systems, Santa Clara

>Someone told me that "stty cs7 -pass8" would work.

Someone may be confused.

There is absolutely no option to "stty" to cause *output* to be stripped
to 7 bits on a SunOS 4.x pseudo-tty.  The "line discipline" STREAMS
module "ldterm" doesn't have one, and the pseudo-tty driver doesn't
either.

"stty cs7" plus whatever parity options you want will do so on a serial
port, but that's because the hardware does the stripping if you set the
character size to 7 bits.  The 4.x pseudo-tty driver pays no attention
to the character size.

As I remember, the problem you were having is that the data being sent
to the pseudo-tty was coming *from* a serial line, and had the 8th bit
set.  Perhaps you should set the options on the serial line to strip the
data to 7 bits?
From: brijesh@tzu.sybase.com
Newsgroups: comp.unix.wizards
Subject: uncompressing an incomplete tar file
Date: 1 Sep 92 17:33:48 GMT

(modified from c.u.questions post for which i haven't gotten any response yet).
(I will appreciate if you could send a copy of reply to my address
brijesh@sybase.com)

Here is what I did:

1) TARed a directory => foo.tar
2) compress foo.tar  => foo.tar.Z (~200 Meg)
3) TARed it onto TK50 tapes (~150 Meg)
4) read the file foo.tar.Z from tape drive (~150 Meg)
5) uncompress foo.tar.Z => foo.tar (only ~2 Meg!!)
6) tar xvf foo.tar  [The contents appear OK, but only 2% of my entire data]

so after uncompressing I am not getting back rest of my stuff.
The only thing I think that may be wrong is at step 3,
only two tapes were available and they could not contain entire 200Meg,
so only ~150 Meg got stored which may have truncated some information
needed for a later uncompress.

what i am looking for is some sort of way to recover most of the data.
is it possible? how difficult? does anyone have the source for uncompress.c?
I could then maybe hack something with it to handle this situation.

any help is appreciated.
From: barnett@grymoire.crd.ge.com (Bruce Barnett)
Newsgroups: comp.unix.wizards
Subject: Re: 'cat'ting 8 bit data to the terminal.....
Date: 27 Aug 92 19:35:31 GMT
	<15250003@hprpcd.rose.hp.com>
Reply-To: barnett@crdgw1.ge.com
Organization: GE Corp. R & D, Schenectady, NY

I wrote:

> If someone finds an existing solution (better than "script | fixparity") 
> I'd appreciate it.... 

In article <15250003@hprpcd.rose.hp.com> tmilner@hprpcd.rose.hp.com (Tom Milner) writes:
>   How 'bout
>	   cat file | tr '[\200-\377]' '[\000-\177]'

Since this is the same solution ( I already know how to write a filter
to strip out parity), this doesn't really help.

Someone told me that "stty cs7 -pass8" would work. It doesn't on SunOS
with an xterm. Many it works on other systems. If anyone can find the
right stty combination, I'd love to hear about it. The symptom in
xterm of cat'ing 8 bit data is that the bits with parity are displayed
as blank spaces. In a cmdtool window, you get special foreign
characters.

--
Bruce Barnett <barnett@crd.ge.com> uunet!crdgw1!barnett
From: olson@anchor.esd.sgi.com (Dave Olson)
Newsgroups: comp.unix.wizards
Subject: Re: Disk bad block
Date: 3 Sep 92 02:14:12 GMT
Distribution: usa
Organization: Silicon Graphics, Inc.  Mountain View, CA

In <1992Sep2.191247.1253@tamsun.tamu.edu> pnarayan@cs.tamu.edu (P S Narayan) writes:
| Could any one tell me how does the file manager in the Unix File System
| detect a bad block and keep a track of it so that it is never allocated
| to any file. What is badness in a block ?
| I imagine the bad block list  is kept in the zeroth block of the  filesystem.

You need to be far more specific, as to what unix version, and what
kind of disks you are referring to; there is tremendous variation.
--
Let no one tell me that silence gives consent,  |   Dave Olson
because whoever is silent dissents.             |   Silicon Graphics, Inc.
    Maria Isabel Barreno                        |   olson@sgi.com
From: sysprgd@roads.sa.gov.au
Newsgroups: comp.unix.wizards
Subject: Groups and NIS
Date: 1 Sep 92 12:30:51 GMT
Organization: DEPARTMENT of ROAD TRANSPORT


We have several flavours of Unix (HP-UX, Ultrix and Tek) which are to share
(disk) resources via NFS and be administered via NIS.

All three have differing root ids (and groups):
Tek:    uid=0(root) gid=0(root)
Ultrix: uid=0(root) gid=1(daemon)
HP-UX:  uid=0(root) gid=3(sys)

In attempting to decide how NIS should be configured, what is the impact of
changing the group names and/or numbers  as setup in the distributions of 
passwd and groups?

Are there any recommendations for multi-vendor environments re group numbering 
and naming?

Many thanks,
Mike
      +---------------------------------------------------------+
      | Mike de Laine, Dept. of Road Transport, South Australia |
      +---------------------------------------------------------+
      | Email: mike@roads.sa.gov.au 				|
      | Post : Dept. of Road Transport, Information Technology, |
      |        PO Box 1, Walkerville, South Australia, 5081.    |
      | Phone: +61 8 343 2469               Fax: +61 8 343 2768 |
      | Pager: +61 8 273 5000 No. 10021				|
      +---------------------------------------------------------+
Newsgroups: comp.unix.wizards
From: fgreco@shearson.com (Frank Greco)
Subject: tokens modification
Organization: Lehman Brothers
Distribution: usa
Date: Thu, 27 Aug 1992 23:29:56 GMT

Bourne/Korn shell wizards, I beseech thee.

I have a string with the cmd line args:

	55 "hello world" frank 1900

I am trying to sed-ify/awk-ify/shell-ify it into the following:

	55, "hello world", frank, 1900

Anyone have any good ideas as to do this?  

Thanks,

Frank G.

In case you're interested, I'm trying to create a printf() shell
function via front-ending awk, i.e.:

	printf() {
		fmt=$1; shift
		# manipulate args to be $@ with commas
		echo "$@" | awk "END {printf $fmt, $args}"
	}
--
+-On Assignment at: Lehman Brothers-+-Office: Mercury Technologies, Inc.-+
| World Financial Center, 11th Floor| PO Box 529                         |
| New York City, NY 10285           | Fanwood, NJ 07023                  |
| email: fgreco@shearson.com        | email: fgreco@mercury.com          |
Newsgroups: comp.unix.wizards
From: jeffj@krfiny.uucp (J. Jonas)
Subject: correcton: restricting users
Summary: use group id to deny access
Organization: Jeff's house of computer pieces
Date: Thu, 27 Aug 1992 18:03:17 GMT


In article <928@gofish.Stars.Reston.Unisys.COM> dymm@cards.com (David Dymm) writes:
>I would like to set up a restricted directory tree
>on my Sun 4 system.  That is, certain users, when logging on,
>would be placed into accounts that would be located in a
>directory tree that would not have access to the rest of
>the system directory structure. ...

The way my college did this was to create the restricted users
in the 'peon' group-id.
>All restricted directories were owned by group peon but with NO permissions.
Correction: no GROUP permissions

That way, owner and all other have access but NOT peon.
Although this is contradictory to the intent of permission GRANTING
vs. permission denial, it works.

ex: /bin2 had commands that were not for peon use (moved over from /bin)
dr-x---r-x   2 bin      peon         1664 Aug 26 16:14 /bin2

Permission checking uses the logic
	if (effective UID == file UID)
		if (file's owner permissions allows access)
			ok
		else
			fail
	if (effective GID == file GID)
		if (file's group permissions allows access)
			ok
		else
			fail
	if (file's other permissions allows access)
		ok
	else
		fail

This means that denying group access stops the peons cold, even though
'other' allows access.
Had the logic been to 'or' all the lower permissions, then access
denial would not be possible.
But Unix says "if you're the owner, only the owner's permissions apply
to you, even though others may have greater access priviledges".

As already mentioned an other postings, using the restricted shell also helps.
I'm not sure if it was fixed, but there was a bug in how the shell
determined if it was restricted or not.
The old code checked for an 'r' in argv[0].  Anywhere in argv[0].
This bit me when a login for 'smart' (a teaching program) used
a C program that used 'system' to do something.
The subshell inherited the argv[0] of 'smart' and since it contained
an 'r', it went into restricted shell mode.
The workaround was to alter argv[0] to something without any 'r'.

Set root is tricky becuase you need hard links for all things in /dev,
/tmp and other things that are below the new root.

- Jeffrey Jonas
-- 
-- 
Jeffrey Jonas

jeffj@synsys.uucp
From: dtb@otto.bf.rmit.oz.au (David Bath)
Newsgroups: comp.unix.wizards
Subject: Re: Restricted directory trees in Unix - how?
Date: 27 Aug 92 01:02:16 GMT
Organization: RMIT Computer Centre, Melbourne Australia.

jeffj@krfiny.uucp (J. Jonas) writes:

>In article <928@gofish.Stars.Reston.Unisys.COM> dymm@cards.com (David Dymm) writes:
>>I would like to set up a restricted directory tree
>>on my Sun 4 system.  That is, certain users, when logging on,
>>would be placed into accounts that would be located in a
>>directory tree that would not have access to the rest of
>>the system directory structure. ...

Use chroot(2) like anonymous ftp does

Regards

========================================================================
David T. Bath
email: 	dtb@otto.bf.rmit.oz.au
Work: 	Global Technology Corporation, Carlton, Vic, OZ  (03) 3477511
=======================================================================
Newsgroups: comp.unix.wizards
From: johnk@gordian.com (John Kalucki)
Subject: Re: Calling a terminal from unix
Keywords: modem,terminal,unix,callback
Organization: Gordian; Costa Mesa, CA
Date: Mon, 31 Aug 1992 22:59:04 GMT

In article <1992Aug21.232751.2718@Cigna.COM>, james@Cigna.COM (James Dornan) writes:
>Hello Wizards,
>
>I need to have a Unix(SunOS) call a terminal with modem and
>display a login prompt.  I have a Hayes Ultra 9600 on both
>ends and I'm using a Sun4 machine running SunOS 4.1.1.
>The reason is my employer needs some data entry done remotely
>and does not want to give out the number. Thank you all and
>to all a good net.
>
>
>James "AAAAARGHHHHH!!! I hate PCs" Dornan
>
>
>
>
There used to be a utility called ct(1). (Call Terminal!) It
might be in one of the older comp.unix archives. I played with
it on a BSD4.0 system in 1985-6. It still might work!

		-John Kalucki
		johnk@gordian.com

Newsgroups: comp.unix.wizards
From: dbsuthe@pbhya.PacBell.COM (Daniel B. Suthers)
Subject: Re: Changing "pg" options
Reply-To: dbsuthe@PacBell.COM (Daniel B. Suthers)
Organization: Pacific * Bell, San Ramon, CA
Distribution: usa
Date: Wed, 26 Aug 1992 17:34:46 GMT

In article <1992Aug25.190239.19142@cbfsb.cb.att.com> rajeev@cbnewsf.cb.att.com (rajeev.dolas) writes:
>
>
>Howdy all,
>
>	I am trying to find out if there is a way of turning the "!"
>	option off from pg.  Here is something similar to what I am 
>	trying to do:
>
>	main()
>	{
>		char t[25];
>
>		strcpy(t, "pg $HOME/.profile\n");
>		system(t);
>	}
>
>	While running this program I don't want the !<command> option
>	to be available to the user.
>
>	Is there a simple way of doing this?  I don't want to reinvent the
>	wheel and write my own pg (if possible).

In the past, I had good results by simply removing the environment variable
SHELL.  This caused PG to issue an error message when the escape was attempted.

If you really want to be safer (not necessarily safe, but safer) add the 
following:
	Fork a new process.  In the new process:
	    Set SHELL to NULL and PATH to one you want them to use.
	    In the forked process, set the effective uid to the real uid (if
	    applicable)
	    Exec() the program instead of using system().
	    (Use the explicit path name in the exec call)
	In the parent process, wait for the child to die.

This should be fairly safe when even if using setuid.  Others may correct me,
so wait a few days before coding. :)

Daniel B. Suthers,  CCP
Technology Consultant, PCS & IN Development Lab,        Pac*Bell
Voice: (510) 671-1325               UUCP:  dbsuthe@Pacbell.COM
================================================================================
=  Commit unexpected kindnesses and senseless acts of beauty.                  =
================================================================================
Newsgroups: comp.unix.wizards
From: rajeev@cbnewsf.cb.att.com (rajeev.dolas)
Subject: Changing "pg" options
Organization: AT&T
Distribution: usa
Date: Tue, 25 Aug 1992 19:02:39 GMT



Howdy all,

	I am trying to find out if there is a way of turning the "!"
	option off from pg.  Here is something similar to what I am 
	trying to do:

	main()
	{
		char t[25];

		strcpy(t, "pg $HOME/.profile\n");
		system(t);
	}

	While running this program I don't want the !<command> option
	to be available to the user.

	Is there a simple way of doing this?  I don't want to reinvent the
	wheel and write my own pg (if possible).

	Thanks in advance.

	Raj Dolas.

Newsgroups: comp.unix.wizards