[net.emacs] EOF without ptys?

johns@tybalt.caltech.edu.Caltech.Edu@cit-vax.Caltech.Edu (John Salmon) (08/03/86)

I just got GNUmacs version 64 running on an elxsi, under 'enix'
which is a System V.2 clone.  Hooray.

But...  When I use shell-interaction mode, I can't send EOF to
a subprocess of the shell.  Since the shell is getting its input
from a pipe, it doesn't do all the fancy line-discipline processing
that it would with a terminal.  In particular, sending it ^D disturbs
it not in the least.  I tried to go into process.c and just close the
file descriptor, but that loses because the pipe is closed to the
shell, not the sub-process you are interested in.  Is there any solution?
Does System V have something resembling pseudo-terminals that I don't know
about?

A different problem:  When I try to use rmail, count-messages (or one
of its friends) assures me that there are no new messages.  This is a lie.
I'm pretty sure I've told it the correct mail file to look in.  I think
it is unable to find message delimiters in the system mailbox.
Is this a common problem with rmail on SysV?  Am I missing something obvious?
Thanks.

bzs@bu-cs.BU.EDU (Barry Shein) (08/04/86)

>A different problem:  When I try to use rmail, count-messages (or one
>of its friends) assures me that there are no new messages.  This is a lie.
>I'm pretty sure I've told it the correct mail file to look in.  I think
>it is unable to find message delimiters in the system mailbox.
>Is this a common problem with rmail on SysV?  Am I missing something obvious?
>Thanks.

Your problem is that your etc/movemail program probably needs to run
setuid to something powerful enough to write the mail spool directory.

I didn't like the security hole this would cause so I added the
following check to etc/movemail to firm it up a bit, you may
want to go over this yourself, but I think it's the right idea:

	-Barry Shein, Boston University

*** /usr2/src/gnu/emacs-17.64/etc/movemail.c	Mon Jul 28 15:48:58 1986
--- /usr2/src/gnu/emacs-17.64/etc/movemail.c.orig	Mon Jul 28 15:18:43 1986
***************
*** 58,67
  
    inname = argv[1];
    outname = argv[2];
-   /* BZS 7/28/86 - to run suid we need to check permissions on files */
-   if(!insecure(inname) || !outsecure(outname))
-     fatal("Permission Denied");
-   /**/
  
  #ifndef MAIL_USE_FLOCK
    /* Use a lock file named /usr/spool/mail/$USER.lock:

--- 58,63 -----
  
    inname = argv[1];
    outname = argv[2];
  
  #ifndef MAIL_USE_FLOCK
    /* Use a lock file named /usr/spool/mail/$USER.lock:
***************
*** 204,231
      fatal ("virtual memory exhausted", 0);
    return result;
  }
- insecure(sp) char *sp;
- {
-   struct stat st;
- 
-   if(stat(sp,&st) < 0) return(0);
-   return(st.st_uid == getuid());
- }
- outsecure(sp) char *sp;
- {
-   char *cp;
-   struct stat st;
-   char buf[1024];
-   char *rindex();
- 
-   strcpy(buf,sp);
-   sp = buf;
-   if((cp = rindex(sp,'/')) != 0)
-     *cp = '\0';
-   else strcpy(sp,".");
-   if(stat(sp,&st) < 0) return(0);
-   if((st.st_mode & S_IFDIR) == 0) return(0);
-   return(!access(sp,W_OK));
- }
- 
-     

--- 200,202 -----
      fatal ("virtual memory exhausted", 0);
    return result;
  }

hansen@pegasus.UUCP (Tony L. Hansen) (08/14/86)

< >Is this a common problem with rmail on SysV?  Am I missing something
< >obvious?
< 
< Your problem is that your etc/movemail program probably needs to run
< setuid to something powerful enough to write the mail spool directory.

On System V (and III) machines, mail programs need to be "setgid mail".
Making them setuid creates unnecessary security holes.

					Tony Hansen
					ihnp4!pegasus!hansen