1
1
/* Wrapper code for Taylor UUCP on Amiga Unix (SVR4) for cron invoked UUCP */
4
/* The problem: Cron is not a "licensed" process. any process that grabs a
5
controlling terminal needs to be licensed. Taylor UUCP needs controlling
6
terminals. Taylor UUCP does relinquish the controlling terminal before
7
fork(), so the "UUCP" license is appropriate.
8
This simple program does the "right" thing, but *MUST* be SETUID ROOT */
10
/* Written by: Lawrence E. Rosenman <ler@lerami.lerctr.org> */
4
/* The problem: Cron and rmail (as forked by uuxqt, which may in
5
turn invoke uucico) are not "licensed" processes. Any process
6
that grabs a controlling terminal needs to be licensed. Taylor
7
UUCP needs controlling terminals. Taylor UUCP does relinquish
8
the controlling terminal before fork(), so the "UUCP" license is
9
appropriate. This simple program does the "right" thing, but
10
*MUST* be SETUID ROOT.
12
To use this program, you must move 'uucico' to 'uucico.real' (or
13
change the *name = below), compile this program, move it to where
14
uucico was originally, and make it SETUID ROOT.
16
This program is intended to be used as a wapper for Taylor UUCP's
17
uucico so that the annoying 'unlicensed user attempted to fork'
18
messages are eliminated. */
20
/* Written by: Lawrence E. Rosenman <ler@lerami.lerctr.org>
21
Modified by: Donald Phillips <don@blkhole.resun.com> */
12
23
#include <sys/sysm68k.h>
13
24
#include <sys/types.h>
19
30
int main(int argc,char *argv[],char *envp)
33
char *name = {"/usr/lib/uucp/uucico.real"};
24
strcpy(name,"/usr/local/lib/uucp/uucico");
25
35
if (sysm68k(_m68k_LIMUSER,EUA_GET_LIC) == 0 ) { /* are we unlicensed? */
26
if (sysm68k(_m68k_LIMUSER,EUA_UUCP) == -1) { /* yes, get a "uucp" license */
27
fprintf(stderr,"sysm68k failed, errno=%d\n",errno); /* we didn't? crab it */
32
pw = getpwnam("uucp"); /* get the Password Entry for uucp */
35
fprintf(stderr,"User ID \"uucp\" doesn't exist.\n");
38
setgid(pw->pw_gid); /* set gid to uucp */
39
setuid(pw->pw_uid); /* set uid to uucp */
40
argv[0]=name; /* have PS not lie... */
41
execv("/usr/local/lib/uucp/uucico",argv); /* go to the real program */
36
if (sysm68k(_m68k_LIMUSER,EUA_UUCP) == -1) { /* yes, get a "uucp"
38
fprintf(stderr,"sysm68k failed, errno=%d\n",errno); /* we didn't grab
43
pw = getpwnam("uucp"); /* get the Password Entry for uucp */
45
fprintf(stderr,"User ID \"uucp\" doesn't exist.\n");
48
setgid(pw->pw_gid); /* set gid to uucp */
49
setuid(pw->pw_uid); /* set uid to uucp */
52
argv[0]=name; /* have PS not lie... */
53
execv(name, argv); /* go to the real program */