From owner-freebsd-hackers Fri Dec 29 22:51:36 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id WAA03339 for hackers-outgoing; Fri, 29 Dec 1995 22:51:36 -0800 (PST) Received: from toadflax.cs.ucdavis.edu (toadflax.cs.ucdavis.edu [128.120.56.188]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id WAA03334 Fri, 29 Dec 1995 22:51:33 -0800 (PST) Received: by toadflax.cs.ucdavis.edu (4.1/UCD.CS.2.6) id AA10608; Fri, 29 Dec 95 22:51:31 PST From: obrien@cs.ucdavis.edu (David E. O'Brien) Message-Id: <9512300651.AA10608@toadflax.cs.ucdavis.edu> Subject: termcap access as user uucp To: freebsd-security@freebsd.org, freebsd-hackers@freebsd.org (FreeBSD Hacker's list) Date: Fri, 29 Dec 1995 22:51:30 -0800 (PST) X-Mailer: ELM [version 2.4 PL24 PGP3ALPHA] Content-Type: text Sender: owner-hackers@freebsd.org Precedence: bulk I'm doing a port of a terminal program to FreeBSD. The orignal author installs it setuid root. I don't care for this. Following /usr/bin/cu's lead, I make it setuid uucp. Problem is the program can't access the termcap database as this user. Does it have something to do with uucp not having a "normal" shell? Security minded people: opinions on the best arraingment for security? Others: What's wrong with Mr. UUCP? Below is a minimal program to demonstrate this. Make it setuid root ==> no problem. Make it non-setuid, owned by joe user ==> no problem. Make it setuid uucp and you get: No termcap present! Test program ~~~~~~~~~~~~ #include #include main() { static char cbuf[2048]; char *term = "xterm"; switch(tgetent(cbuf, term )) { case 0: fprintf(stderr, "No termcap entry for %s\n", term); return 1; case -1: fprintf(stderr, "No termcap present!\n"); return 1; default: printf( "\n%s\n", cbuf ); } return 0; }