HDTenEightyP/NetNews huggingface dataset:
From: kibirev@csa.bu.edu (oleg kibirev)
Subject: Re: Locking out users
Organization: Computer Science Department, Boston University, Boston, MA, USA
Date: Fri, 2 Oct 1992 03:22:13 GMT
X-Posted-From: csa.bu.edu
NNTP-Posting-Host: sol.ctr.columbia.edu

In article <32717@adm.brl.mil> isakoh@zpcp53.att.com writes:
>Has anybody tried putting this into /etc/profile?
>
>...
>...
># if NOT root (*** IMPORTANT ***),
>LOGIN=`logname`
>if [ "$LOGIN" != "root" ]
>then
>
>	# check if system-wide lock-out is in effect
>	if [ -f /etc/locked_users/ALL ]
>	then
>		# print reason
>		cat /etc/locked_users/ALL
>		exit
>	fi
>
>	# check for login in locked_users directory
>	if [ -f /etc/locked_users/$LOGIN ]
>	then
>		# print locked message
>		cat /etc/locked_users/$LOGIN
>		exit
>	fi
>fi
>...
>...
>
>Of course you need to create the /etc/locked_users directory beforehand.
>Whenever you want to lock out a user, simply create a file in that directory,
>using the login as the filename. The reason for the lock-out can be stored
>in that file. If you need to lock out all users, name the file 'ALL' and put
>the message in it. Note that root MUST be excluded from this or you'll be in
>BIG trouble.
>
>We use a modified version of this whenever we need to do housekeeping for
>some of our applications.
>
M-x flame

Don't you think that too much of the  recent traffic in  this group is
about locking   out users, erasing   accounts   and  installing stupid
"security measures" that prevent programs from running  and users from
doing there work?

Sure, there are  lots of ways you can  do this. Run  rm -rf ~user, set
their   shell  to   /usr/games/fortune  or   remove    the entry  from
/etc/passwd. If  this doesn't work, hit the  Big Red Switch and nobody
will ever compromize security of  your computer.  And, does it  really
take a unix.wizard to do oppresive job???

Do some sysadmin ever realize that the computer and they are here only
because there are users  who need to do  the work? Do they  understand
that when a smart user is  getting around their restrictions, it often
just means that these restrictions need to be revised?

I suggest  redirecting this  thread to alt.fashist.admin.  Most people
here know how to cancel articles, right?

Oleg

P.S: About this script  to sign off users:  there  is a VERY easy  way
around it.  All it takes is a single keystroke.

M-x flame-send
From: jing@hobart.cs.umass.edu (Yufeng Jing)
Newsgroups: comp.unix.wizards
Subject: Re: How to intercept UNIX system calls ?
Date: 5 Oct 92 19:48:44 GMT
Followup-To: comp.unix.wizards
Organization: Dept. of Computer Science, University of Massachusetts, Amherst
In-reply-to: imtst@pitt.edu's message of 20 Sep 92 14:05:58 GMT


****************************** This is your message ***************************
In article <6049@blue.cis.pitt.edu.UUCP> imtst@pitt.edu (I-ming Tsai) writes:

	   I am trying to intercept the UNIX system calls. The following simple
       program works by itself:

   ========================  test.c  ============================
   #include<sys/file.h>
   main()
   {
   int fd;

   fd=open("junk",O_WRONLY|O_CREAT,0600);
   write(fd,"12345",5);
   close(fd);
   }
   ===================== end of test.c ==========================

	   When I tried to substitute the system calls with my own functions,
       I wrote the following simple program:

   ====================  myfunction.c  =========================
   open(path,flags,mode)
   char *path;
   int flags,mode;
   {
   printf("This is my open!\n");
   return(1);
   }

   write(fd,buff,nbytes)
   int fd,nbytes;
   char buff;
   {
   printf("This is my write!\n");
   return(2);
   }

   close(fd)
   int fd;
   {
   printf("This is my close!\n");
   return(3);
   }
   ===================== end of myfunction.c ======================    

	   I compiled them (under Sun 4/470 running SunOs 4.1.2) using

		    cc -o test test.c myfunction.c

       I executed the "test", but got nothing. It didn't print my strings 
       on the screen. Any help ? Thank you in advance !

   -- Ming
****************************** End of your message ***************************


Hi, 

I think that you shouldn't use 'test' as your executable file name because
it is a shell command. I happened to have that problem before. So first 
change that. After changing that, you would get a 'segmentation fault' from
running your program. The reason I guess is that all I/O functions you used
have the same name as system I/O calls. In fact, the segmenation fault 
occured when your program goes to 'open' function.

Here is my version of your program. It worked well. Unfortunately I can't
answer your question --- "how to intercept UNIX system calls".

Try it. Good luck.
--Yufeng, Jing


***************************** gcc -g -o ming ming.c ************************
#include<sys/file.h>


m_open(path,flags,mode)
char *path;
int flags,mode;
{
printf("This is my open!\n");
return(1);
}

m_write(fd,buff,nbytes)
int fd,nbytes;
char buff;
{
printf("This is my write!\n");
return(2);
}

m_close(fd)
int fd;
{
printf("This is my close!\n");
return(3);
}


main()
{
int fd;

fd=m_open("junk",O_WRONLY|O_CREAT,0600);
m_write(fd,"12345",5);
m_close(fd);
}








Xref: sparky comp.unix.wizards:4142 comp.unix.aix:10246
From: guenther@stolaf.edu (Philip A Guenther)
Newsgroups: comp.unix.wizards,comp.unix.aix
Subject: Re: 'make' woes (won't catch secondary dependancy)
Date: 1 Oct 92 06:32:45 GMT
Followup-To: comp.lang.c
Organization: Academic Computing Center, St. Olaf College

In article <BvFB6o.A1w@news.cso.uiuc.edu> gbnewby@uxh.cso.uiuc.edu (Gregory B. Newby) writes:
   Greetings, wise ones.  I'm surprised that 'make' doesn't catch
   this problem, and would be very excited to hear of a good 
   solution or workaround.

   I have a header file that #include's another header file.  I
   would like for my 'make' to catch whether either of them are 
   modified.  Here is a very simple example of what goes wrong
   (of course, what I'm doing is a bit more complicated....hence,
   just putting "test.o: h1.h h2.h" will work in this example,
   but will not give me the freedom & capability I need to be
   happy):

<string of examples deleted>

You need to set hidden dependencies on in your makefile.  If hidden
dependencies is set then make queries cpp(1) for files that are
included by dependency tree files, and they are added to the
dependency tree.  There are several ways to activate this; the easiest
(I think) is to give the target .KEEP_STATE somewhere in your
makefile.  See the man page for other ways to do so.

   Get it?  Any workaround or syntax that I missed would be appreciated!
   I replicated this problem under AIX on a PS/2, SunOS 4.0, and Irix.
   GNUMake doesn't have the problem, but it also didn't catch whether the
   files were up to date or not (that it, it compiled anyway!  No
   matter what!  Perhaps someone here installed GNUMake wrongly...). 
   Thanks!!!

Note: this is true for SunOS 4.1.x make (but not old-make).  I don't
know about the others (though I do know that Sun Make (and Gnus Make)
has several features (pattern matching, for instance) that other makes
don't.  So Your Mileage May Vary by manufacturer, make and model of
make. :-)  And yes, I think that your version of Gnu Make is broken.

     -- Greg Newby

Philip Guenther

--
guenther@stolaf.edu (Philip Guenther)       | The ACC might agree with me,
Student Sys Prog, Academic Computing Center | but with that bunch, (and me)
St Olaf College, Northfield, MN 55057-1001  | you never know... :-) :-| :-(
"Life makes sense?  LIFE MAKES SENSE!!?  Where do people get these ideas?"-me
Newsgroups: comp.unix.wizards
From: fitzgb@mml0.meche.rpi.edu (Brian Fitzgerald)
Subject: Intro to comp.unix.wizards - read before posting! (weekly announcement, last change: Jul 31 10:30)
Followup-To: poster
Organization: Rensselaer Polytechnic Institute, Troy NY
Date: Sun, 4 Oct 1992 10:00:36 GMT
Expires: Tue, 3 Nov 1992 10:00:26 GMT

Please take a moment to read this before posting to comp.unix.wizards
for the first time.

comp.unix.wizards is for in-depth discussion of advanced unix topics.

Elementary questions do not belong in comp.unix.wizards.  Although some
socket questions (for example) are appropriate, "How do I program with
sockets?" is not.

Crossposting to comp.unix.wizards and comp.unix.questions is
inappropriate.  Plenty of wizards read comp.unix.questions and answer
questions there.

A wizard is someone who can rewrite the entire system from scratch.  If
you are not a wizard, you are welcome to follow along the discussions
anyway.  You'll learn quite a bit about how UNIX works.  Caution: post
to wizards only if you are yourself a wizard.

For a list of answers to frequently asked questions (FAQ), please refer
to comp.unix.questions (or comp.lang.c, news.answers, etc...).  "How do
I delete a file whose name starts with a '-' ?" is an example of such a
question.  Please do not ask or answer FAQ's on the net.

Write to Unix-Wizards-Request@BRL.MIL (Subject: subscribe.  Any
message.) if you want a daily digest of this newsgroup mailed to you.

To unsubscribe from the unix-wizards mailing list, send mail to
Unix-Wizards-Request@BRL.MIL Subject: unsubscribe.  It is incorrect to
post such requests to the list, or to mail them to me, though others
may mistakenly do so.

E-mail comments about this posting are welcome.  From time to time I'll
summarize them.

Brian
--
These opinions are mine, and do not necessarily reflect those of any
academic department or computing service at Rensselaer.
From: iah@de-montfort.ac.uk (Andy Humberston)
Newsgroups: comp.unix.wizards
Subject: Conferencing/BBS Systems
Date: 30 Sep 92 14:11:48 GMT

HI,

I'm not a subscriber to this list - so please could you reply direct.

We are after a conference/BBS system to run on our Sun Sparc Station,
only for internal use to start with.  

Thanks in advance

 ------------------------------------------------------------------
|     Andy Humberston, IT Services, De Montfort University, UK     |
|  Tel: +44 533 577159  Fax: +44 533 577170  EMail: iah@uk.ac.dmu  |
 ------------------------------------------------------------------
From: terry@cs.weber.edu (A Wizard of Earth C)
Newsgroups: comp.unix.wizards
Subject: Re: Deleting a file
Date: 30 Sep 92 04:09:16 GMT
Organization: Weber State University  (Ogden, UT)

In article <1992Sep29.134238.23590@athena.cs.uga.edu> is@groucho.dev.uga.edu (Bob Stearns) writes:
>Through a stupid and egregious programming error I have managed to place
>some files on my system with DELs at the beginning of the file name. Is
>there any way, without writing code in C/PERL/your-favorite-language to
>remove these files? I have even tried rm *xxx and the machine comes back
>and says the files don't exist even though it had to find the files to
>say they don't exist!?!?!
>
>If it is significant, I am running SCO Xenix 3.2.4 on an Intel 386/33
>generic clone with SCSI hard drives.

It's entirely possible that you have deletes in the middle of the file name or
the high bit's set on the x's.

use	rm -i *

and say "no" until you see your file.  If this doesn't work, unlink the
bugger and let fsck get it on the next boot (yes, I know this will result in
a "/lost+found" entry, but it will have a normal name and normal links and
should be removed).

If all else fails, backup everything *but* that file, re mkfs the disk, and
reload from backup.  8-).


					Terry Lambert
					terry@icarus.weber.edu
					terry_lambert@novell.com
					terry_lambert@ns.novell.com
---
Any opinions in this posting are my own and not those of my present
or previous employers.
-- 
-------------------------------------------------------------------------------
                                        "I have an 8 user poetic license" - me
 Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial
-------------------------------------------------------------------------------
From: is@groucho.dev.uga.edu (Bob Stearns)
Newsgroups: comp.unix.wizards
Subject: Deleting a file
Date: 29 Sep 92 13:42:38 GMT
Organization: University of Georgia

Before I get flamed, yes I read the Friendly manual, tried some of the
classic techniques from the FAQ and invented a few of my own. None of
them worked. Ne'ertheless I am accoutred with nomex unmentionables.

Through a stupid and egregious programming error I have managed to place
some files on my system with DELs at the beginning of the file name. Is
there any way, without writing code in C/PERL/your-favorite-language to
remove these files? I have even tried rm *xxx and the machine comes back
and says the files don't exist even though it had to find the files to
say they don't exist!?!?!

If it is significant, I am running SCO Xenix 3.2.4 on an Intel 386/33
generic clone with SCSI hard drives.

-- 
Bob Stearns
University of Georgia
is@groucho.dev.uga.edu
(404)542-5110
From: mnc@cs.rit.edu (Marcus N Cannava)
Newsgroups: comp.unix.wizards
Subject: Catching SIGTSTP
Date: 30 Sep 92 13:33:54 GMT
Organization: Rochester Institute of Technology

I have what should be a simple question:

I'm writing a program that should not be stopped by SIGTSTP (i.e., a user
hitting CTRL-Z on their terminal), so I want to ignore it. I'm also
blocking CTRL-C and CTRL-\, SIGINT and SIGQUIT, respectively.

Here's how I'm trying to do it:
 
        /* Block user signals (ctrl-c, ctrl-\) */

        if(signal(SIGINT, SIG_IGN) == SIG_ERR)  /* Block ^C */
          error(NOSIGIGNORE);
        if(signal(SIGQUIT, SIG_IGN) == SIG_ERR) /* Block ^\ */
          error(NOSIGIGNORE);
	if(signal(SIGTSTP, SIG_IGN) == SIG_ERR) /* Block ^Z */
	  error(NOSIGIGNORE);

PROBLEM: My program does **not** ignore SIGTSTP. It does, however, ignore the
other two. (This is running under SunOS 4.1.2)

Has anyone run up against this problem before? Am I missing some obvious
thing? It's driving me crazy! Help!

Thanks, in advance,
\marc

-- 
--
Marc N. Cannava			|	Tigers are nimble,		|
mnc@cs.rit.edu			|	And light on their toes,	|
				|	My RE-spect for tigers,		|
Newsgroups: comp.unix.wizards,comp.os.linux
From: lfoard@Turing.ORG (Lawrence C. Foard)
Subject: Re: Linux activists unite all you have to lose is you
Organization: The Turing Project, Charlottesville Virginia.
Date: Thu, 1 Oct 1992 15:20:34 GMT

In article <BvG1r3.6Ky@news.udel.edu> radel@bach.udel.edu (Todd Radel) writes:
>In article <1992Sep29.193435.12556@murdoch.acc.Virginia.EDU> lfoard@Turing.ORG (Lawrence C. Foard) writes:
>>So why not bombard BYTE with letters asking them to cover free software?
>
>How about sending something to _Communications_Of_The_ACM_, or some
>other magazine more devoted to hobbyist/academic readers? 

It certainly wouldn't hurt to do that as well. But magazines like byte
do have a much larger audience. Linux installation may still be a bit
above most people but it does seem to be improving. On the other hand
there are alot of hackers out there who would love to have a real OS
and wouldn't mind the slight challenge of installing linux. 

The problem with keeping free unix as a "cult" is that people also have
to earn a living. Wouldn't it be nice if you earned your money working on
freeware systems with full source, rather than Windows NT with no source and
outrageous prices for support?

I think its well worth the effort to compete with the commercial OS's
rather than limiting it to hobbiests. Just think how nice a real OS
would be the next time your pulling out your hair working on a proprietary
OS, or out of work and all people want to hire is OS/2 programmers.
-- 
------          Join the Pythagorean Reform Church!               .
\    /        Repent of your evil irrational numbers             . .
 \  /   and bean eating ways. Accept 10 into your heart!        . . .
  \/   Call the Pythagorean Reform Church BBS at 508-793-9568  . . . .
    
Newsgroups: comp.unix.wizards
From: fitzgb@mml0.meche.rpi.edu (Brian Fitzgerald)
Subject: Intro to comp.unix.wizards - read before posting! (weekly announcement, last change: Jul 31 10:30)
Followup-To: poster
Organization: Rensselaer Polytechnic Institute, Troy NY
Date: Sun, 27 Sep 1992 10:00:41 GMT
Expires: Tue, 27 Oct 1992 10:00:25 GMT

Please take a moment to read this before posting to comp.unix.wizards
for the first time.

comp.unix.wizards is for in-depth discussion of advanced unix topics.

Elementary questions do not belong in comp.unix.wizards.  Although some
socket questions (for example) are appropriate, "How do I program with
sockets?" is not.

Crossposting to comp.unix.wizards and comp.unix.questions is
inappropriate.  Plenty of wizards read comp.unix.questions and answer
questions there.

A wizard is someone who can rewrite the entire system from scratch.  If
you are not a wizard, you are welcome to follow along the discussions
anyway.  You'll learn quite a bit about how UNIX works.  Caution: post
to wizards only if you are yourself a wizard.

For a list of answers to frequently asked questions (FAQ), please refer
to comp.unix.questions (or comp.lang.c, news.answers, etc...).  "How do
I delete a file whose name starts with a '-' ?" is an example of such a
question.  Please do not ask or answer FAQ's on the net.

Write to Unix-Wizards-Request@BRL.MIL (Subject: subscribe.  Any
message.) if you want a daily digest of this newsgroup mailed to you.

To unsubscribe from the unix-wizards mailing list, send mail to
Unix-Wizards-Request@BRL.MIL Subject: unsubscribe.  It is incorrect to
post such requests to the list, or to mail them to me, though others
may mistakenly do so.

E-mail comments about this posting are welcome.  From time to time I'll
summarize them.

Brian
--
These opinions are mine, and do not necessarily reflect those of any
academic department or computing service at Rensselaer.
From: cerrafon@nzls02.nzl.abk.nec.co.jp (Jeff Cerrafon)
Newsgroups: comp.unix.wizards
Subject: SUB UNIX-WIZ Jeff Cerrafon
Date: 28 Sep 92 21:10:35 GMT

SUB UNIX-WIZ Jeff Cerrafon
Newsgroups: comp.unix.wizards,comp.unix.internals
From: witr@rwwa.COM (Robert Withrow)
Subject: Large Streams Buffers
Followup-To: comp.unix.internals
Reply-To: witr@rwwa.com
Organization: R.W. Withrow Associates
Distribution: usa
Date: Sun, 4 Oct 1992 15:55:16 GMT

I am contemplating the design of a (SVR4.0.3.0/386 streams) driver which
must collect about 16 bytes of data from a piece of hardware every 
millisecond, for 60 seconds, and return the data to a user mode program.  

This amounts to nearly a megabyte of data.  I am wondering on the most
reasonable way of returning this data to the user mode program.  I can
think of a few options (writing the data directly to the user's buffer
is not currently an option, due to design constraints):

  1) Allocb the whole buffer and putnext or putq it when the scan
     is complete.

  2) Allocb smaller ``chunks'' amounting to the total requirement and
     putq them as they fill.

  3) Allocb smaller ``chunks'' in a double buffering scheme, putqing 
     each one as it fills, and switching to the pre-allocated next
     buffer.  A new ``next'' buffer would be allocated either in the
     service routine or in the put routine.

I am worried that 1) will either fail the allocb or will have adverse
effects on the system when the large buffer gets to the streamhead.  
(Perhaps there are system tuning parameters that affect this?)

Option 2) seems to alleviate the possible adverse affects at the streamhead,
but I wonder if I will be able to allocb the total amount required, even in
smaller pieces...

Option 3) would seem to relieve both problems, but the negative effects of
a failed or late buffer allocation are severe enought that it is definately
a third choice.

Has anyone any experience solving a problem of this sort?

-- 
 Robert Withrow, Tel: +1 617 598 4480, Fax: +1 617 598 4430, Net: witr@rwwa.COM
 R.W. Withrow Associates, 21 Railroad Ave, Swampscott MA 01907-1821 USA
From: jim@accelr8.com (Jim Reiss)
Newsgroups: comp.unix.wizards
Subject: Re: Semaphores
Date: 5 Oct 92 15:04:25 GMT
Organization: Accelr8 Technology Corporation

In article <1992Oct01.131809.25816@bnr.uk> agc@bmdhh298.bnr.ca (Alan Carter) writes:
>In article <BvEt5y.7LM@accelr8.com>, jim@accelr8.com (Jim Reiss) writes:
>|> I have an application which currently uses a lot of semaphores, which are
>|> a limited UNIX resource.  In some cases, the semaphore is being used only
>|> locally by a program and is not shared by any other process.  Can anyone
>|> suggest a good alternative to using semaphores? I need a way for the process
>|> to sleep until an event happens, which is currently handled by waiting for
>|> a change in a semaphore.  Thanks for all input on this.
>You obviously have another process that will relinqyuish the semaphore.
>Why not connect them with a pipe or socket, and do a blocking read on the
>file descriptor?
That is not necessarily true.  The semaphore may be released by a signal
handler in the same process.  The point, in many cases, is to suspend process
execution while waiting for a piece of memory to change.  On SGI systems,
there is the sginap() call which forces a process to give up its time slice,
this would be another way to prevent a CPU-hogging loop, but is machine
specific.  It is also, by the way, possible that there are dozens of processes
waiting for the event, in which case I will probably still be forced to use
semaphores because the overhead of keeping track of them all would be too
great.
-- 
 Jim Reiss (jim@accelr8.com)    Accelr8 Technology, Denver, Colorado, USA
 Opinions expressed above are mine.  Who else would have them?
Newsgroups: comp.unix.wizards
From: cecchinr@fox.cs.rpi.edu (Ron Cecchini)
Subject: Re: unix prompt
Organization: Rensselaer Polytechnic Institute, Troy, NY
Date: Thu, 1 Oct 1992 17:01:13 GMT

In article <1992Sep29.191657.19902@base> rgm@romulon (Rick Morris) writes:
>Miloslav Blazek (milos@lion.ics.muni.cs) wrote:
>: >
>: > Do any of you know how to set up the Unix prompt (analogous to the DOS set
>: > prompt $p$g) so that whenever a user change directories, the new directory
>: > path shows up along with the prompt?  It has been a nuisance having to type
>: > 'pwd' all the time.
>: >
>: 
>
>
>  try this in a shell program file  (I call it cd.sh).  It uses the
>status line on VT3xx and VT4xx terminals or creates its on status line
>for VT1xx and VT2xx terminals.  If your are using the latter terminals,
>don't forget to stty rows 23.
>
>-------------------------------- cut here -----------------------------------
>#!  cd.sh
>#!
>#  define  a environment variable called CD_CSH_HOSTNAME as you host name.
>#
>#usage: cd [$1]
>#
>echo '7[r[2$~[1$}[24;1H[57C[1K
>exit
>-------------------------------- cut here -----------------------------------
>
>    Rick Morris                        |  E-mail: rgm@peasant.isis.org
>    Bell Canada                        |          
>    1050 - 160 Elgin St                |
>    Ottawa, Ont K1G 3J4                |  Envoy100: r.morris

I can't believe no one has said:

alias sp 'set prompt = "`hostname`:`whoami`:`pwd`> "'
alias cd 'cd \!*; sp'

And, if you want your directories listed each time you cd, just
change tbhe "cd" alias to 'cd \!*; sp; ls'

Ron

Newsgroups: comp.unix.wizards
From: bzs@ussr.std.com (Barry Shein)
Subject: Re: Origins of Unix
Organization: The World
	<1992Oct4.022343.21224@netcom.com>
Date: Sun, 4 Oct 1992 07:01:53 GMT


>>Y'all take yer hats off speak with respect when ya mention MULTICS.
>
>I'll point out that MIT has kept the name alive ever since their original
>MULTICS machine was decommissioned.  MULTICS.MIT.EDU currently points to
>a machine called charon, which is owned by their Student Information
>Processing Board.

There is at least one real, live Multics system on the internet.

--
        -Barry Shein

Software Tool & Die    | bzs@world.std.com          | uunet!world!bzs
Purveyors to the Trade | Voice: 617-739-0202        | Login: 617-739-WRLD
Newsgroups: comp.unix.wizards