Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!homxb!mtuxo!mtune!lzaz!lznv!jlw
From: jlw@lznv.UUCP
Newsgroups: comp.sys.att
Subject: Re: 3b1:  files winding up in the wrong directory
Message-ID: <1204@lznv.ATT.COM>
Date: Wed, 25-Nov-87 09:33:05 EST
Article-I.D.: lznv.1204
Posted: Wed Nov 25 09:33:05 1987
Date-Received: Sun, 29-Nov-87 03:15:42 EST
References: <764@neoucom.UUCP>
Organization: AT&T ISL Middletown NJ USA
Lines: 51
Keywords: twilight zone; very weird problem


The problem is that smgr exec's /bin/mail as root
in the /etc/lddrv directory.  Smgr also happens
to look for /usr/bin/email first.  Therefore,
compiling the following little program and
installing it as /usr/bin/email with vanilla
options fixes that problem.  Don't use shared
libs; makes it bigger.  I've been using this for
months with both 3.5 and 3.51.  You may not have mailx
available so you may want to check what the
program's doing for you.  It's pretty easy to
change.

Joe Wood
lznv!jlw
lznv!jlwood3!jlw




------------------cut here------------cut here-----------------
/*
 *	email.c - exec'ed from smgr as:
 *		/usr/bin/email -i -u %s
 *
 *	This version fixes up a rather bad security
 *	bug in 3.5 UNIX PC.  With no /usr/bin/email
 *	installed, send mail to yourself, click on
 *	mail icon, escape to shell, and you're superuser.
 */
main(argc, argv)
int argc;
char *argv[];
{

	char p[256];

	p[0] = (char)0;
	strcat(p, "/bin/sh -c \"");
	strcat(p, " EDITOR=/usr/bin/vi VISUAL=/usr/bin/vi SHELL=/bin/ksh");
	strcat(p, " HOME=/u/");
	strcat(p, argv[3]);
	strcat(p, ";MAILRC=/u/");
	strcat(p, argv[3]);
	strcat(p, "/.mailrc;export HOME MAILRC EDITOR VISUAL SHELL;");
	strcat(p, "cd /u/");
	strcat(p, argv[3]);
	strcat(p, ";/usr/bin/mailx\"");
	execl( "/bin/su", "su", argv[3],
		"-c", p, (char *)0);
}