From richard@greenend.org.uk Tue Apr 20 16:00:30 BST 1999 Article: 3 of chiark.mail.userv.discuss Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Date: Mon, 22 Sep 1997 22:53:25 GMT From: richard@greenend.org.uk MIME-Version: 1.0 Message-ID: Newsgroups: chiark.mail.userv.discuss Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Received-001: by chiark.greenend.org.uk id m0xDGfD-0004oea (Debian /\oo/\ Smail3.1.29.1 #29.37); Mon, 22 Sep 97 23:09 BST Received-002: from mercury.elmailer.net ([195.224.76.4]) by chiark.greenend.org.uk with smtp id m0xDGez-0004ocC (Debian /\oo/\ Smail3.1.29.1 #29.37); Mon, 22 Sep 97 23:08 BST Received-003: from sfere.greenend.org.uk (sfere.greenend.org.uk [195.224.38.1]) by mercury.elmailer.net with ESMTP id XAA02899 for (2.3-LM-8.8.6/3.1.19); Mon, 22 Sep 1997 23:07:07 +0100 (BST) Received-004: (richard@localhost) by sfere.greenend.org.uk id XAA10333 (2.1.1h-8.8.5/2.1b-greenend); Mon, 22 Sep 1997 23:07:57 +0100 Return-Path: Sender: owner-userv-discuss Subject: Compiling userv 0.55.1 on Debian with libc6 To: userv-discuss@chiark.greenend.org.uk X-Mailer: VM 6.30 under Emacs 19.34.1 X-Original-Date: Mon, 22 Sep 97 23:07:57 +0100 (BST) X-Original-From_: owner-userv-discuss Mon Sep 22 23:09:10 1997 Lines: 24 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:3 You'll probably need this patch for other versions of UNIX too: ------------------------------------------------------------------------ --- lexer.l.m4~ Thu Sep 18 02:58:54 1997 +++ lexer.l.m4 Mon Sep 22 23:05:37 1997 @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include "config.h" #include "common.h" ------------------------------------------------------------------------ Also, ./configure needs to be invoked with CC="gcc -D_GNU_SOURCE", otherwise the daft libc6 includes don't give you strsignal(). Grr. ttfn/rjk -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From andrewm@chiark.greenend.org.uk Tue Apr 20 16:00:31 BST 1999 Article: 4 of chiark.mail.userv.discuss Date: Wed, 24 Sep 97 22:10 BST From: Andrew Mobbs Message-ID: Newsgroups: chiark.mail.userv.discuss Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Received-001: by chiark.greenend.org.uk id m0xDyhf-0004ola (Debian /\oo/\ Smail3.1.29.1 #29.37); Wed, 24 Sep 97 22:10 BST Received-002: by chiark.greenend.org.uk id m0xDyhe-0004ofC (Debian /\oo/\ Smail3.1.29.1 #29.37); Wed, 24 Sep 97 22:10 BST Return-Path: Sender: owner-userv-discuss Subject: Bug reports To: userv-discuss X-Original-From_: owner-userv-discuss Wed Sep 24 22:10:36 1997 Lines: 13 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:4 I can find no clear statement on what to do with bug reports. Ian, do you want them mailed to you, or to the list? If the former which mailbox? (Don't worry, it's nothing major, just compilation bugs on NetBSD). -- Andrew Mobbs - andrewm@chiark.greenend.org.uk - http://www.chiark.greenend.org.uk/~andrewm/ -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From richard@greenend.org.uk Tue Apr 20 16:00:31 BST 1999 Article: 5 of chiark.mail.userv.discuss Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Date: Sat, 27 Sep 1997 14:52:38 GMT From: richard@greenend.org.uk In-Reply-To: MIME-Version: 1.0 Message-ID: Newsgroups: chiark.mail.userv.discuss Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Received-001: by chiark.greenend.org.uk id m0xEwl1-0004p4a (Debian /\oo/\ Smail3.1.29.1 #29.37); Sat, 27 Sep 97 14:18 BST Received-002: from mercury.elmailer.net ([195.224.76.4]) by chiark.greenend.org.uk with smtp id m0xEwl0-0004p2C (Debian /\oo/\ Smail3.1.29.1 #29.37); Sat, 27 Sep 97 14:18 BST Received-003: from sfere.greenend.org.uk (sfere.greenend.org.uk [195.224.38.1]) by mercury.elmailer.net with ESMTP id OAA24053 for (2.3-LM-8.8.6/3.1.19); Sat, 27 Sep 1997 14:16:16 +0100 (BST) Received-004: (richard@localhost) by sfere.greenend.org.uk id OAA22472 (2.1.1h-8.8.5/2.1b-greenend); Sat, 27 Sep 1997 14:12:15 +0100 References: Return-Path: Sender: owner-userv-discuss Subject: Bug reports To: userv-discuss@chiark.greenend.org.uk X-Mailer: VM 6.30 under Emacs 19.34.1 X-Original-Date: Sat, 27 Sep 97 14:12:14 +0100 (BST) X-Original-From_: owner-userv-discuss Sat Sep 27 14:18:04 1997 Lines: 16 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:5 Andrew Mobbs writes: > I can find no clear statement on what to do with bug reports. Ian, > do you want them mailed to you, or to the list? If the former which > mailbox? > > (Don't worry, it's nothing major, just compilation bugs on NetBSD). Personally I'd post them here, so that others can draw on your experience. ttfn/rjk -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From userv-maint@chiark.greenend.org.uk Tue Apr 20 16:00:31 BST 1999 Article: 6 of chiark.mail.userv.discuss Date: Mon, 29 Sep 97 14:14 BST From: userv-maint@chiark.greenend.org.uk (Ian Jackson) Message-ID: Newsgroups: chiark.mail.userv.discuss Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Received-001: by chiark.greenend.org.uk id m0xFfej-0004o0a (Debian /\oo/\ Smail3.1.29.1 #29.37); Mon, 29 Sep 97 14:14 BST Received-002: by chiark.greenend.org.uk id m0xFfeh-0004nzC (Debian /\oo/\ Smail3.1.29.1 #29.37); Mon, 29 Sep 97 14:14 BST Return-Path: Sender: owner-userv-discuss Subject: Bug reports To: userv-discuss X-Original-From_: owner-userv-discuss Mon Sep 29 14:14:33 1997 Lines: 11 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:6 Yes, please post bug reports here. I'll put a note in the README about this. Ian. (PS: The first time I posted this majordomo bounced it because I used the wrong From: line (-: .) -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From andrewm@chiark.greenend.org.uk Tue Apr 20 16:00:31 BST 1999 Article: 7 of chiark.mail.userv.discuss Date: Tue, 30 Sep 97 20:52 BST From: Andrew Mobbs Message-ID: Newsgroups: chiark.mail.userv.discuss Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Received-001: by chiark.greenend.org.uk id m0xG8LT-0004o0a (Debian /\oo/\ Smail3.1.29.1 #29.37); Tue, 30 Sep 97 20:52 BST Received-002: by chiark.greenend.org.uk id m0xG8LJ-0004o2C (Debian /\oo/\ Smail3.1.29.1 #29.37); Tue, 30 Sep 97 20:52 BST Return-Path: Sender: owner-userv-discuss Subject: Compiling userv for NetBSD To: userv-discuss X-Original-From_: owner-userv-discuss Tue Sep 30 20:52:35 1997 Lines: 32 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:7 I spent a little spare time on this last week. Just a few trivial problems, and mostly easy to fix, but it'd be nice if it all Just Worked. The platform is an ARM running what is essentially NetBSD 1.2. First occured in overlord.c: wait.h is in /usr/include/sys No such error as EPROTO WEXITSTATUS etc. return int, not long First occured in process.c: PIPEMAXLEN is long There seems to be a problems with sig.sa_handler=SIG_IGN (or SIG_DFL) error is "function decleration isn't a prototype". I couldn't see what was happening, any advice? (I then went back to doing what I'm paid to do :-). -- Andrew Mobbs - andrewm@chiark.greenend.org.uk - http://www.chiark.greenend.org.uk/~andrewm/ -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From richard@greenend.org.uk Tue Apr 20 16:00:31 BST 1999 Article: 8 of chiark.mail.userv.discuss Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Date: Wed, 01 Oct 1997 00:52:32 GMT From: richard@greenend.org.uk In-Reply-To: MIME-Version: 1.0 Message-ID: Newsgroups: chiark.mail.userv.discuss Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Received-001: by chiark.greenend.org.uk id m0xGCn8-0004ona (Debian /\oo/\ Smail3.1.29.1 #29.37); Wed, 1 Oct 97 01:37 BST Received-002: from mercury.elmailer.net ([195.224.76.4]) by chiark.greenend.org.uk with smtp id m0xGCn6-0004o2C (Debian /\oo/\ Smail3.1.29.1 #29.37); Wed, 1 Oct 97 01:37 BST Received-003: from sfere.greenend.org.uk (sfere.greenend.org.uk [195.224.38.1]) by mercury.elmailer.net with ESMTP id BAA27800 for (2.3-LM-8.8.6/3.1.19); Wed, 1 Oct 1997 01:35:37 +0100 (BST) Received-004: (richard@localhost) by sfere.greenend.org.uk id BAA19475 (2.1.1h-8.8.5/2.1b-greenend); Wed, 1 Oct 1997 01:31:58 +0100 References: Return-Path: Sender: owner-userv-discuss Subject: Compiling userv for NetBSD To: userv-discuss@chiark.greenend.org.uk X-Mailer: VM 6.30 under Emacs 19.34.1 X-Original-Date: Wed, 1 Oct 97 01:31:58 +0100 (BST) X-Original-From_: owner-userv-discuss Wed Oct 1 01:37:27 1997 Lines: 18 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:8 Andrew Mobbs writes: > First occured in overlord.c: > > wait.h is in /usr/include/sys The Linux and Solaris man pages document and not , despite the comment in Linux's that "SVR4 ABI requires rather than ". So I think userv (and everyone else) should use (in fact some parts of it already do). ttfn/rjk -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From userv-maint@chiark.greenend.org.uk Tue Apr 20 16:00:31 BST 1999 Article: 9 of chiark.mail.userv.discuss Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Date: Sun, 05 Oct 1997 22:52:52 GMT From: userv-maint@chiark.greenend.org.uk (Ian Jackson) MIME-Version: 1.0 Message-ID: Newsgroups: chiark.mail.userv.discuss Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Received-001: by chiark.greenend.org.uk id m0xHyA7-0004nQa (Debian /\oo/\ Smail3.1.29.1 #29.37); Sun, 5 Oct 97 22:24 BST Received-002: by chiark.greenend.org.uk id m0xHy3b-0004o3C (Debian /\oo/\ Smail3.1.29.1 #29.37); Sun, 5 Oct 97 22:17 BST Received-003: from ian by davenant.greenend.org.uk with local (Exim 1.61 #1) id 0xHy1T-0005fd-00 (Debian); Sun, 5 Oct 1997 22:15:31 +0100 Return-Path: Sender: owner-userv-discuss Subject: Portability fixes To: userv-discuss@chiark.greenend.org.uk X-Mailer: VM 6.28 under Emacs 19.34.1 X-Original-Date: Sun, 5 Oct 1997 22:15:31 +0100 X-Original-From_: owner-userv-discuss Sun Oct 5 22:24:28 1997 Lines: 8 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:9 Thanks for your portability comments; 0.55.2 will be out tomorrow. (It actually exists now, but I don't propose to send it over the modem.) Ian. -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From userv-maint@chiark.greenend.org.uk Tue Apr 20 16:00:31 BST 1999 Article: 10 of chiark.mail.userv.discuss Date: Mon, 20 Oct 97 16:22 BST From: userv-maint@chiark.greenend.org.uk (Ian Jackson) In-Reply-To: Message-ID: Newsgroups: chiark.mail.userv.discuss Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Received-001: by chiark.greenend.org.uk id m0xNJfK-0004noa (Debian /\oo/\ Smail3.1.29.1 #29.37); Mon, 20 Oct 97 16:22 BST Received-002: by chiark.greenend.org.uk id m0xNJfI-0004nWC (Debian /\oo/\ Smail3.1.29.1 #29.37); Mon, 20 Oct 97 16:22 BST References: Return-Path: Sender: owner-userv-discuss Subject: AIX 4.2 To: userv-discuss@chiark.greenend.org.uk X-Original-From_: owner-userv-discuss Mon Oct 20 16:22:47 1997 Lines: 16 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:10 Andrew Mobbs writes: > FYI, AIX 4.2 fails to provide several of the system interfaces which > are listed as required in "INSTALL". > > I apologise if this information causes anyone to suffer severe shock. Which, if I may ask ? (Sorry about the delay replying, but your message got bounced by majordomo and was just forwarded to me by majordomo-owner.) Ian. -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From userv-maint@chiark.greenend.org.uk Tue Apr 20 16:00:31 BST 1999 Article: 14 of chiark.mail.userv.discuss Cc: userv-discuss@chiark.greenend.org.uk Date: Tue, 20 Jan 98 18:55 GMT From: userv-maint@chiark.greenend.org.uk (Ian Jackson) In-Reply-To: Message-ID: Newsgroups: chiark.mail.userv.discuss Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Received-001: by chiark.greenend.org.uk id m0xuipM-0004p1a (Debian /\oo/\ Smail3.1.29.1 #29.37); Tue, 20 Jan 98 18:55 GMT Received-002: by chiark.greenend.org.uk id m0xuipK-0004p0C (Debian /\oo/\ Smail3.1.29.1 #29.37); Tue, 20 Jan 98 18:55 GMT References: Return-Path: Sender: owner-userv-discuss Subject: Re: userv and group id of service To: X-Original-From_: owner-userv-discuss Tue Jan 20 18:55:12 1998 Lines: 14 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:14 rjk@greenend.org.uk writes ("userv and group id of service"): > And another thing - I was surprised to discover that the daemon > executes the service without changing GID. (This is again in 0.57.) Thanks for that and your previous messages. Majordomo bounced them; I think I've forwarded them OK now. I'll put out a new release with your fixes shortly. Ian. -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From rjk@greenend.org.uk Tue Apr 20 16:00:32 BST 1999 Article: 11 of chiark.mail.userv.discuss Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="06UGXDsrox" Date: Tue, 20 Jan 1998 19:53:13 GMT From: MIME-Version: 1.0 Message-ID: Newsgroups: chiark.mail.userv.discuss Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Received-001: by chiark.greenend.org.uk id m0xuin6-0004p1a (Debian /\oo/\ Smail3.1.29.1 #29.37); Tue, 20 Jan 98 18:52 GMT Received-002: by chiark.greenend.org.uk id m0xuin3-0004owC (Debian /\oo/\ Smail3.1.29.1 #29.37); Tue, 20 Jan 98 18:52 GMT Received-003: from mercury.elmailer.net ([195.224.76.4]) by chiark.greenend.org.uk with smtp id m0xrVQD-0004ojC (Debian /\oo/\ Smail3.1.29.1 #29.37); Sun, 11 Jan 98 21:59 GMT Received-004: by mercury.elmailer.net with ESMTP from sfere.greenend.org.uk (sfere.greenend.org.uk [195.224.38.1]) id VAA16135 for (2.4-8.8.8/3.1.31); Sun, 11 Jan 1998 21:57:51 GMT Received-005: by sfere.greenend.org.uk (richard@localhost) id VAA28083 (2.1.1h-8.8.5/2.1b-greenend-with-news); Sun, 11 Jan 1998 21:59:36 GMT Return-Path: Sender: owner-userv-discuss Subject: patch against userv 0.57 To: userv-discuss@chiark.greenend.org.uk X-Mailer: VM 6.34 under 20.3 "Vatican City" XEmacs Lucid X-Original-Date: Sun, 11 Jan 98 21:59:36 +0000 (GMT) X-Original-From_: owner-userv-discuss Tue Jan 20 18:52:53 1998 Lines: 80 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:11 --06UGXDsrox Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Actually IIRC Ian is away for a few days so I'll send this to userv-discuss as well. ttfn/rjk --06UGXDsrox Content-Type: message/rfc822 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="hl3LVGUb3R" Message-Id: X-Mailer: VM 6.34 under 20.3 "Vatican City" XEmacs Lucid From: To: userv-maint@chiark.greenend.org.uk Subject: bug in user 0.57 Date: Sun, 11 Jan 98 20:12:37 +0000 (GMT) --hl3LVGUb3R Content-Type: text/plain; charset=us-ascii Hi, parser.c:parse_file() fails to copy the filename somewhere where it won't get mangled, with the result that syntax errors can give garbled error messages. Patch attached. ttfn/rjk --hl3LVGUb3R Content-Type: text/plain Content-Disposition: inline; filename="parse_file.diff" --- userv-0.57.orig/parser.c Thu Sep 18 02:58:56 1997 +++ userv-0.57/parser.c Sun Jan 11 20:10:51 1998 @@ -1267,6 +1267,7 @@ int r; FILE *file; struct stat newstab; + char *filename; if (fileparselevel >= MAX_INCLUDE_NEST) { parseerrprint("too many nested levels of included files"); @@ -1296,7 +1297,8 @@ ybuf= yy_create_buffer(file,YY_BUF_SIZE); if (!ybuf) syscallerror("unable to create flex buffer for file"); - parser_push(&usestate,string,&newstab,ybuf,0); + filename = xstrsave(string); + parser_push(&usestate,filename,&newstab,ybuf,0); fileparselevel++; r= parser(0); @@ -1307,6 +1309,7 @@ fileparselevel--; parser_pop(); + free(filename); fclose(file); if (r == tokv_eof) r= 0; return r; --hl3LVGUb3R-- --06UGXDsrox-- -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From rjk@greenend.org.uk Tue Apr 20 16:00:32 BST 1999 Article: 12 of chiark.mail.userv.discuss CC: userv-discuss@chiark.greenend.org.uk Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Date: Tue, 20 Jan 1998 19:53:14 GMT From: MIME-Version: 1.0 Message-ID: Newsgroups: chiark.mail.userv.discuss Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Received-001: by chiark.greenend.org.uk id m0xuinw-0004p0a (Debian /\oo/\ Smail3.1.29.1 #29.37); Tue, 20 Jan 98 18:53 GMT Received-002: by chiark.greenend.org.uk id m0xuins-0004owC (Debian /\oo/\ Smail3.1.29.1 #29.37); Tue, 20 Jan 98 18:53 GMT Received-003: from mercury.elmailer.net ([195.224.76.4]) by chiark.greenend.org.uk with smtp id m0xrVtH-0004o1C (Debian /\oo/\ Smail3.1.29.1 #29.37); Sun, 11 Jan 98 22:29 GMT Received-004: by mercury.elmailer.net with ESMTP from sfere.greenend.org.uk (sfere.greenend.org.uk [195.224.38.1]) id WAA22358 (2.4-8.8.8/3.1.31); Sun, 11 Jan 1998 22:27:52 GMT Received-005: by sfere.greenend.org.uk (richard@localhost) id WAA28926 (2.1.1h-8.8.5/2.1b-greenend-with-news); Sun, 11 Jan 1998 22:28:18 GMT Return-Path: Sender: owner-userv-discuss Subject: userv and group id of service To: userv-maint@chiark.greenend.org.uk X-Mailer: VM 6.34 under 20.3 "Vatican City" XEmacs Lucid X-Original-Date: Sun, 11 Jan 98 22:28:18 +0000 (GMT) X-Original-From_: owner-userv-discuss Tue Jan 20 18:53:44 1998 Lines: 21 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:12 And another thing - I was surprised to discover that the daemon executes the service without changing GID. (This is again in 0.57.) Why is setreuid() called twice? ttfn/rjk --- process.c~ Tue Oct 14 02:05:19 1997 +++ process.c Sun Jan 11 22:23:07 1998 @@ -508,6 +508,7 @@ serviceuser_uid= pw->pw_uid; if (initgroups(pw->pw_name,pw->pw_gid)) syscallerror("initgroups"); + if (setregid(pw->pw_gid,pw->pw_gid)) syscallerror("setregid"); if (setreuid(pw->pw_uid,pw->pw_uid)) syscallerror("setreuid 1"); if (setreuid(pw->pw_uid,pw->pw_uid)) syscallerror("setreuid 2"); if (pw->pw_uid) { -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From rjk@greenend.org.uk Tue Apr 20 16:00:32 BST 1999 Article: 13 of chiark.mail.userv.discuss Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Date: Tue, 20 Jan 1998 19:53:17 GMT From: MIME-Version: 1.0 Message-ID: Newsgroups: chiark.mail.userv.discuss Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Received-001: by chiark.greenend.org.uk id m0xuioQ-0004p0a (Debian /\oo/\ Smail3.1.29.1 #29.37); Tue, 20 Jan 98 18:54 GMT Received-002: by chiark.greenend.org.uk id m0xuioO-0004owC (Debian /\oo/\ Smail3.1.29.1 #29.37); Tue, 20 Jan 98 18:54 GMT Received-003: from mercury.elmailer.net ([195.224.76.4]) by chiark.greenend.org.uk with smtp id m0xruEp-0004oXC (Debian /\oo/\ Smail3.1.29.1 #29.37); Tue, 13 Jan 98 00:29 GMT Received-004: by mercury.elmailer.net with ESMTP from sfere.greenend.org.uk (sfere.greenend.org.uk [195.224.38.1]) id AAA05418 for (2.4-8.8.8/3.1.31); Tue, 13 Jan 1998 00:27:41 GMT Received-005: by sfere.greenend.org.uk (richard@localhost) id AAA28635 (2.1.1h-8.8.5/2.1b-greenend-with-news); Tue, 13 Jan 1998 00:01:56 GMT Return-Path: Sender: owner-userv-discuss Subject: another userv bug To: userv-discuss@chiark.greenend.org.uk X-Mailer: VM 6.34 under 20.3 "Vatican City" XEmacs Lucid X-Original-Date: Tue, 13 Jan 98 00:01:56 +0000 (GMT) X-Original-From_: owner-userv-discuss Tue Jan 20 18:54:14 1998 Lines: 101 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:13 The patch below contains both the previous reported fixes, plus an additional nasty which has taken me the best part of two evenings to track down. Having done all that work I feel compelled to describe it in gory detail. Suppose you have specified `ignore-fd 0' for a service and then redirect the client's stdin from /dev/null. The client will launch a `cat' to pipe the null stdin across, but this will terminate immediately and throw the client a SIGCHLD, which will send a et_closereadfd message to the server. Now the first half of the bug is that the fd isn't filled in correctly, so it'd always be stdin which gets closed in the server (since the buffer was memset to 0 before doing anything with it). The second half of the bug is a bit more complicated, though still a one-line fix. Suppose the server has already got as far as calling makenonexistentfd() (which it won't always have done, resulting in the somewhat random occurence of this bug). Then it'll try and close whatever the hold fd is (in getevent()). Unfortunately makenonexistentfd() has (i) already closed this and (ii) neglected to squash it with -1, so getevent() tries to close the fd again ... and gets EBADF and of course it's downhill from there on in. Anyway: with the following patch applied all this and all other bugs in 0.57 I've so far discovered go away. It can also be found at this URL: http://staff.elmail.co.uk/~richard/userv-0.57rjk.patch in case it gets mangled in email. I'll update this with any other fixes I generate (though I'm not aware of any further problems right now). Hope I've got all this right... ttfn/rjk diff -ruN userv-0.57.orig/client.c userv-0.57/client.c --- userv-0.57.orig/client.c Tue Oct 14 02:05:15 1997 +++ userv-0.57/client.c Mon Jan 12 23:35:20 1998 @@ -378,6 +378,7 @@ memset(&event_mbuf,0,sizeof(event_mbuf)); event_mbuf.magic= EVENT_MAGIC; event_mbuf.type= et_closereadfd; + event_mbuf.data.closereadfd.fd = fd; r= fwrite(&event_mbuf,1,sizeof(event_mbuf),swfile); if (r != sizeof(event_mbuf) || fflush(swfile)) if (errno != EPIPE) syscallerror("inform service of closed read fd"); diff -ruN userv-0.57.orig/parser.c userv-0.57/parser.c --- userv-0.57.orig/parser.c Thu Sep 18 02:58:56 1997 +++ userv-0.57/parser.c Mon Jan 12 23:35:59 1998 @@ -1267,6 +1267,7 @@ int r; FILE *file; struct stat newstab; + char *filename; if (fileparselevel >= MAX_INCLUDE_NEST) { parseerrprint("too many nested levels of included files"); @@ -1296,7 +1297,8 @@ ybuf= yy_create_buffer(file,YY_BUF_SIZE); if (!ybuf) syscallerror("unable to create flex buffer for file"); - parser_push(&usestate,string,&newstab,ybuf,0); + filename = xstrsave(string); + parser_push(&usestate,filename,&newstab,ybuf,0); fileparselevel++; r= parser(0); @@ -1307,6 +1309,7 @@ fileparselevel--; parser_pop(); + free(filename); fclose(file); if (r == tokv_eof) r= 0; return r; diff -ruN userv-0.57.orig/process.c userv-0.57/process.c --- userv-0.57.orig/process.c Tue Oct 14 02:05:19 1997 +++ userv-0.57/process.c Mon Jan 12 23:36:06 1998 @@ -508,6 +508,7 @@ serviceuser_uid= pw->pw_uid; if (initgroups(pw->pw_name,pw->pw_gid)) syscallerror("initgroups"); + if (setregid(pw->pw_gid,pw->pw_gid)) syscallerror("setregid"); if (setreuid(pw->pw_uid,pw->pw_uid)) syscallerror("setreuid 1"); if (setreuid(pw->pw_uid,pw->pw_uid)) syscallerror("setreuid 2"); if (pw->pw_uid) { @@ -597,6 +598,7 @@ if (fdarray[fd].holdfd != -1) { if (close(fdarray[fd].holdfd)) syscallfailure("close unwanted hold descriptor for %d",fd); + fdarray[fd].holdfd = -1; } } } -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From jpk28@cus.cam.ac.uk Tue Apr 20 16:00:32 BST 1999 Article: 15 of chiark.mail.userv.discuss Sender: owner-userv-discuss@chiark.greenend.org.uk Content-Transfer-Encoding: 7bit To: userv-discuss@chiark.greenend.org.uk X-Original-Date: Tue, 30 Mar 1999 17:03:13 +0100 (BST) Content-Length: 2543 Content-Type: text/plain; charset=US-ASCII X-Received: from majordom by chiark.greenend.org.uk with local (Exim 2.02 #1) id 10S0z1-0002vr-00 (Debian); Tue, 30 Mar 1999 17:03:19 +0100 X-Received: from taurus.cus.cam.ac.uk [131.111.8.48] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10S0yy-0002vg-00 (Debian); Tue, 30 Mar 1999 17:03:17 +0100 X-Received: from jpk28 by taurus.cus.cam.ac.uk with local (Exim 2.12 #3) id 10S0yv-0005i9-00; Tue, 30 Mar 1999 17:03:13 +0100 Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Subject: suggested modifications From: Julian King Return-path: MIME-Version: 1.0 Newsgroups: chiark.mail.userv.discuss Date: Tue, 30 Mar 1999 16:32:02 GMT X-Mailer: ELM [version 2.4 PL24] Message-ID: Lines: 60 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:15 Hello, I am afraid my first post may well irritate. My apologies, this isn't my intention, but I have been spending a lot of the last two days proding userv and getting the beast to compile, and work. I think I have just got it to the stage where I can start learning how to use it. All the below is as a result of trying to get the beast to work under Solaris. My suggested modifications include such diverse elements as: get configure to take LDLIBS or LDFLAGS variables, and then pass that on to Makefile (I think this is just a case of changing Makefile.in) (so that I can do LDFLAGS=-lsocket -lnls ./configure) get configure to check for m4, and put the complete path in Makefile get configure to check for _gnu_ m4, and barf if the m4 installed doesn't pass some appropriate test. get configure to check for flex, and barf if it fails to find it. check for 'setenv' and deal with it not being there, probably by using putenv, although I am not an expert. I have a trivial hack to get the beast to compile here, but in theory it leaks memory. I've been told that in practice it won't leak memory, but I have yet to check that. Give a pointer in the docs to the things that are needed (md5sum in particular) Cope with md5sum being the 'new' version which prints '-' at the end better still don't worry about it, and deal with what md5sum outputs as a string, and then stuff like 'cksum' can be used. don't include install.sh scripts which use cp -d, when cp -d is a gnu cp extension Document the behaviour when debug is set, since tracking down that the directories it was looking for weren't there, when in fact they were, but it was looking in a non standard place took a while. change the error message "syslog: uservd<24.6>(9): service failed (error encountered while parsing configuration)" to something more helpful don't use $^ since that is the only thing that stops you using make rather than gmake in the install rule you have 'if ! test -f ...' wouldn't 'if test ! -f' be better? Also you have LOG_AUTHPRIV which isn't a logging level under Solaris, thus far I've changed that to LOG_AUTH, although I may think about that further before rolling it out anywhere. Please take the above whinges as 'helpful suggestions' rather than me just being an annoying git, that is how they are meant. Oh, and whilst I am here, has anyone actually used userv under Solaris? Thanks, Julian King Computer Officer, University of Cambridge, Unix Support P.S. Ian Jackson, you are a far far braver man than I. m4 macro->lex->C ?!? -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From jpk28@cus.cam.ac.uk Tue Apr 20 16:00:32 BST 1999 Article: 16 of chiark.mail.userv.discuss Sender: owner-userv-discuss@chiark.greenend.org.uk Content-Transfer-Encoding: 7bit To: userv-discuss@chiark.greenend.org.uk X-Original-Date: Tue, 30 Mar 1999 18:18:55 +0100 (BST) Content-Length: 362 Content-Type: text/plain; charset=US-ASCII X-Received: from majordom by chiark.greenend.org.uk with local (Exim 2.02 #1) id 10S2AF-0003kd-00 (Debian); Tue, 30 Mar 1999 18:18:59 +0100 X-Received: from taurus.cus.cam.ac.uk [131.111.8.48] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10S2AD-0003kT-00 (Debian); Tue, 30 Mar 1999 18:18:57 +0100 X-Received: from jpk28 by taurus.cus.cam.ac.uk with local (Exim 2.12 #3) id 10S2AB-00012O-00 for userv-discuss@chiark.greenend.org.uk; Tue, 30 Mar 1999 18:18:55 +0100 Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Subject: nested statements From: Julian King Return-path: MIME-Version: 1.0 Newsgroups: chiark.mail.userv.discuss Date: Tue, 30 Mar 1999 17:32:00 GMT X-Mailer: ELM [version 2.4 PL24] Message-ID: Lines: 16 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:16 >from my experimentation it appears to be the case that one cannot have nested if statements? Is this correct, I can see that it might be advisable to avoid them in that you are liable to end up with spagghetti code. Or should you just try and get around it with judicious use of eof/quit? Julian King Computer Officer, University of Cambridge, Unix Support -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From rjk@greenend.org.uk Tue Apr 20 16:00:32 BST 1999 Article: 17 of chiark.mail.userv.discuss In-Reply-To: Sender: owner-userv-discuss@chiark.greenend.org.uk Content-Transfer-Encoding: 7bit References: To: userv-discuss@chiark.greenend.org.uk X-Original-Date: Wed, 31 Mar 99 00:06:02 +0100 (BST) Content-Type: text/plain; charset=us-ascii X-Received: from majordom by chiark.greenend.org.uk with local (Exim 2.02 #1) id 10S7cE-00079G-00 (Debian); Wed, 31 Mar 1999 00:08:14 +0100 X-Received: from mercury.elmailer.net [195.224.76.4] by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10S7cC-000790-00 (Debian); Wed, 31 Mar 1999 00:08:12 +0100 X-Received: by mercury.elmailer.net with ESMTP from sfere.greenend.org.uk (sfere.greenend.org.uk [195.224.38.1]) id AAA08789 for (2.4-8.8.8/3.1.37); Wed, 31 Mar 1999 00:08:11 +0100 (BST) X-Received: from richard by sfere.greenend.org.uk with local (Exim 2.02 #1 (Debian)) id 10S7a7-0000In-00; Wed, 31 Mar 1999 00:06:03 +0100 Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Subject: suggested modifications From: Richard Kettlewell Return-path: MIME-Version: 1.0 Newsgroups: chiark.mail.userv.discuss Date: Tue, 30 Mar 1999 23:32:00 GMT Message-ID: X-Mailer: VM 6.30 under 20.4 "Emerald" XEmacs Lucid Lines: 15 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:17 Julian King writes: > get configure to take LDLIBS or LDFLAGS variables, and then pass > that on to Makefile (I think this is just a case of changing > Makefile.in) (so that I can do LDFLAGS=-lsocket -lnls ./configure) An appropriate AC_CHECK_LIB line in configure.in is the usual way to do this, isn't it? ttfn/rjk -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From jpk28@cus.cam.ac.uk Tue Apr 20 16:00:33 BST 1999 Article: 18 of chiark.mail.userv.discuss In-Reply-To: from "Richard Kettlewell" at Mar 31, 99 00:06:02 am Sender: owner-userv-discuss@chiark.greenend.org.uk Content-Transfer-Encoding: 7bit References: To: userv-discuss@chiark.greenend.org.uk X-Original-Date: Wed, 31 Mar 1999 10:07:20 +0100 (BST) Content-Length: 832 Content-Type: text/plain; charset=US-ASCII X-Received: from majordom by chiark.greenend.org.uk with local (Exim 2.02 #1) id 10SGy3-0003pk-00 (Debian); Wed, 31 Mar 1999 10:07:23 +0100 X-Received: from taurus.cus.cam.ac.uk [131.111.8.48] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10SGy2-0003pa-00 (Debian); Wed, 31 Mar 1999 10:07:22 +0100 X-Received: from jpk28 by taurus.cus.cam.ac.uk with local (Exim 2.12 #3) id 10SGy0-0007Oz-00 for userv-discuss@chiark.greenend.org.uk; Wed, 31 Mar 1999 10:07:20 +0100 Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Subject: Re: suggested modifications From: Julian King Return-path: MIME-Version: 1.0 Newsgroups: chiark.mail.userv.discuss Date: Wed, 31 Mar 1999 09:32:01 GMT X-Mailer: ELM [version 2.4 PL24] Message-ID: Lines: 26 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:18 > > get configure to take LDLIBS or LDFLAGS variables, and then pass > > that on to Makefile (I think this is just a case of changing > > Makefile.in) (so that I can do LDFLAGS=-lsocket -lnls ./configure) > > An appropriate AC_CHECK_LIB line in configure.in is the usual way to > do this, isn't it? > > ttfn/rjk That may work on a generic configure script, it won't work on this one (well based on a grep AC_CHECK_LIB configure anyway). My way would work on this one, in that both LIBS and LDFLAGS are passed on to the sed of Makefile.in Certainly playing with those flags are my normal way of getting the configure script to run, and to pass things that I want passed. I would be quite prepared to believe that there are other ways that I haven't used though. Julian Computer Officer, University of Cambridge, Unix Support -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From rjk@greenend.org.uk Tue Apr 20 16:00:33 BST 1999 Article: 19 of chiark.mail.userv.discuss In-Reply-To: Sender: owner-userv-discuss@chiark.greenend.org.uk Content-Transfer-Encoding: 7bit References: To: userv-discuss@chiark.greenend.org.uk X-Original-Date: Wed, 31 Mar 99 21:28:49 +0100 (BST) Content-Type: text/plain; charset=us-ascii X-Received: from majordom by chiark.greenend.org.uk with local (Exim 2.02 #1) id 10SRhO-0002An-00 (Debian); Wed, 31 Mar 1999 21:34:54 +0100 X-Received: from mercury.elmailer.net [195.224.76.4] by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10SRhG-0002AU-00 (Debian); Wed, 31 Mar 1999 21:34:46 +0100 X-Received: by mercury.elmailer.net with ESMTP from sfere.greenend.org.uk (sfere.greenend.org.uk [195.224.38.1]) id VAA00352 for (2.4-8.8.8/3.1.37); Wed, 31 Mar 1999 21:34:44 +0100 (BST) X-Received: from richard by sfere.greenend.org.uk with local (Exim 2.02 #1 (Debian)) id 10SRbW-00068k-00; Wed, 31 Mar 1999 21:28:50 +0100 Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Subject: Re: suggested modifications From: Richard Kettlewell Return-path: MIME-Version: 1.0 Newsgroups: chiark.mail.userv.discuss Date: Wed, 31 Mar 1999 21:32:00 GMT Message-ID: X-Mailer: VM 6.30 under 20.4 "Emerald" XEmacs Lucid Lines: 22 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:19 Julian King writes: >>> get configure to take LDLIBS or LDFLAGS variables, and then pass >>> that on to Makefile (I think this is just a case of changing >>> Makefile.in) (so that I can do LDFLAGS=-lsocket -lnls ./configure) >> >> An appropriate AC_CHECK_LIB line in configure.in is the usual way to >> do this, isn't it? > > That may work on a generic configure script, it won't work on this one > (well based on a grep AC_CHECK_LIB configure anyway). My way would work > on this one, in that both LIBS and LDFLAGS are passed on to the sed > of Makefile.in I don't follow. Why do you think grepping `configure' gives you any relevant information? AC_CHECK_LIB would go in `configure.in'. ttfn/rjk -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From jpk28@cus.cam.ac.uk Tue Apr 20 16:00:33 BST 1999 Article: 20 of chiark.mail.userv.discuss In-Reply-To: from "Richard Kettlewell" at Mar 31, 99 09:28:49 pm Sender: owner-userv-discuss@chiark.greenend.org.uk Content-Transfer-Encoding: 7bit References: To: userv-discuss@chiark.greenend.org.uk X-Original-Date: Thu, 1 Apr 1999 10:10:37 +0100 (BST) Content-Length: 1257 Content-Type: text/plain; charset=US-ASCII X-Received: from majordom by chiark.greenend.org.uk with local (Exim 2.02 #1) id 10SdUn-0008WT-00 (Debian); Thu, 1 Apr 1999 10:10:41 +0100 X-Received: from taurus.cus.cam.ac.uk [131.111.8.48] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10SdUm-0008WJ-00 (Debian); Thu, 1 Apr 1999 10:10:40 +0100 X-Received: from jpk28 by taurus.cus.cam.ac.uk with local (Exim 2.12 #3) id 10SdUj-0005vm-00 for userv-discuss@chiark.greenend.org.uk; Thu, 1 Apr 1999 10:10:37 +0100 Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Subject: Re: suggested modifications From: Julian King Return-path: MIME-Version: 1.0 Newsgroups: chiark.mail.userv.discuss Date: Thu, 01 Apr 1999 09:32:03 GMT X-Mailer: ELM [version 2.4 PL24] Message-ID: Lines: 43 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:20 > > That may work on a generic configure script, it won't work on this one > > (well based on a grep AC_CHECK_LIB configure anyway). My way would work > > on this one, in that both LIBS and LDFLAGS are passed on to the sed > > of Makefile.in > > I don't follow. Why do you think grepping `configure' gives you any > relevant information? AC_CHECK_LIB would go in `configure.in'. > > ttfn/rjk > I don't know what AC_CHECK_LIB is supposed to do, as I said, I've never used it myself. However, I do know that my method will work with a change to Makefile.in. Your method will not work without changing several other things. bash-2.01# pwd /usr/src/userv/userv-0.60.3 bash-2.01# ls config* config.cache config.h.in config.status configure.in config.h config.log configure bash-2.01# grep AC_CHECK_LIB config* bash-2.01# AC_CHECK_LIB is not mentioned anywhere both LIBS and LDFLAGS are mentioned, in particular they are mentioned in the form configure:s%@LIBS@%$LIBS%g configure:s%@LDFLAGS@%$LDFLAGS%g which is what substitutions take place... I am completely prepared to believe that yours is the 'right' way of doing things though. Mine is the 'lazy' way. -- Julian King Computer Officer, University of Cambridge, Unix Support -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From jpk28@cus.cam.ac.uk Tue Apr 20 16:00:33 BST 1999 Article: 21 of chiark.mail.userv.discuss In-Reply-To: <14091.56535.491363.243720@anarres.relativity.greenend.org.uk> from "Ian Jackson" at Apr 7, 99 11:31:51 pm Sender: owner-userv-discuss@chiark.greenend.org.uk Content-Transfer-Encoding: 7bit References: <14091.56535.491363.243720@anarres.relativity.greenend.org.uk> To: userv-discuss@chiark.greenend.org.uk X-Original-Date: Thu, 8 Apr 1999 10:22:07 +0100 (BST) Content-Length: 7706 Content-Type: text/plain; charset=US-ASCII X-Received: from majordom by chiark.greenend.org.uk with local (Exim 2.02 #1) id 10VB0p-00039r-00 (Debian); Thu, 8 Apr 1999 10:22:15 +0100 X-Received: from ursa.cus.cam.ac.uk [131.111.8.6] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10VB0n-00039h-00 (Debian); Thu, 8 Apr 1999 10:22:14 +0100 X-Received: from jpk28 by ursa.cus.cam.ac.uk with local (Exim 2.12 #3) id 10VB0h-0005HC-00 for userv-discuss@chiark.greenend.org.uk; Thu, 8 Apr 1999 10:22:07 +0100 Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Subject: Re: suggested modifications From: Julian King Return-path: MIME-Version: 1.0 Newsgroups: chiark.mail.userv.discuss Date: Thu, 08 Apr 1999 09:32:02 GMT X-Mailer: ELM [version 2.4 PL24] Message-ID: Lines: 189 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:21 > I've got it to at least compile under Solaris with some effort. I > should be doing a `portability' release soon. Oh, so did I. I was making some comments on how to make the process a lot smoother. :-) > Do you want to be able to set the variables (incl PATH) `correctly' > only when you run configure, and have it remember them ? That sounds > bad to me. Better to have configure generate Makefiles which > themselves pay attention to these variable(s). Don't you agree ? As far as the 'path' for binaries is concerned, I would rather that it used the full path in the Makefile, since then I find that it is much easier to spot problems. As for your second point, you are probably right, doing LDFLAGS="-lsocket -lnls" make worked just fine, I am just used to doing it the other way around. I am not sure which is better, but I don't really care, I just want to be able to automate the whole procedure. > > get configure to check for _gnu_ m4, and barf if the m4 installed > > doesn't pass some appropriate test. > > Do you have a suitable test to hand ? I should ship the m4 output. Well the most trivial one, although undoubtedly not perfect is m4 --version if this returns 0 then it is gnu m4 (well no, it is an m4 which returns version information, which solaris m4 doesn't. Oh drat, just checked this breaks FreeBSD m4. Icky, but you _could_ use strings `which m4` |grep GNU The thing is that I am better at finding problems than solutions :-/ The symptoms are that _ appear to barf things up, in particular with the LOG_* stuff. > > get configure to check for flex, and barf if it fails to find it. > > I should ship the flex output. Perhaps, but it would still be nice if it warned me that my copy of lex won't work. > > check for 'setenv' and deal with it not being there, probably by using > > putenv, although I am not an expert. I have a trivial hack to get the > > beast to compile here, but in theory it leaks memory. I've been told that > > in practice it won't leak memory, but I have yet to check that. > > Fixed. Cool, that was one of the harder things for me to automatically work around. > > better still don't worry about it, and deal with what md5sum outputs > > as a string, and then stuff like 'cksum' can be used. > > Hmpf. Umm, is there some history here that I don't know about? I still think mine is a good idea, unless you have a reason why it isn't. > > don't include install.sh scripts which use cp -d, when cp -d is a > > gnu cp extension > > Where can I get another one ? I hadn't realised that this was a 'generic' one. Ok, I have included one that I think will work, see below > > Document the behaviour when debug is set, since tracking down that > > the directories it was looking for weren't there, when in fact they > > were, but it was looking in a non standard place took a while. > > I've added something about this to INSTALL. > > > change the error message > > "syslog: uservd<24.6>(9): service failed (error encountered while parsing configuration)" to something more helpful > > The full error will have been reported by the client. The idea is > that only a synopsis appears in the logfile, saying whether the > service failed or succeeded. The full error message as reported by the client wasn't all that helpful either. It certainly didn't give me any indication as to where to look for the problem. I forget what the problem was now, but it appeared to be that it was failing to parse the built in configuration string. > > don't use $^ since that is the only thing that stops you using make > > rather than gmake > > I'm not going to do this because it will make the Makefile less > clear. Just install GNU make. how do the lines ------------------ DAEMON_O= overlord.o process.o servexec.o parserlexer.o debug.o lib.o both.o CLIENT_O= client.o both.o PCSUM_H= common.h config.h config.status Makefile and then using these in the form daemon: $(DAEMON_O) $(CC) $(LDFLAGS) -o $@ $(DAEMON_O) $(LDLIBS) client: $(CLIENT_O) $(CC) $(LDFLAGS) -o $@ $(CLIENT_O) $(LDLIBS) pcsum.h: $(PCSUM_H) cat $(PCSUM_H) | md5sum | sed -e 's/../0x&,/g; s/,$$//;' >pcsum.h.new ------------------ make things less clear? > > in the install rule you have 'if ! test -f ...' wouldn't 'if test ! -f' > > be better? > > Fixed. > > > Also you have LOG_AUTHPRIV which isn't a logging level under Solaris, > > thus far I've changed that to LOG_AUTH, although I may think about that > > further before rolling it out anywhere. > > Fixed. > > > P.S. Ian Jackson, you are a far far braver man than I. m4 macro->lex->C ?!? > > The quoting got a bit, erm, tricky at times. grep for HYPHEN :-). > This demonstrates that you forgot a stage: > m4 macro -> lex -> C -> cpp output I don't consider the C->cpp output to be scary, although that might be because I haven't looked at your code carefully enough. > > Ian. > Julian -- Julian King Computer Officer, University of Cambridge, Unix Support ------------- Included uuencoded install.sh ---- untested ------ begin 644 install.sh.gz M'XL("#OG:3(``VENT"1W-(2;;$KB0))V5GLY;_?,R0ERUTGFS1`8"V'?.:%,\\, M)X]HN5+UTA;)))F0JJT394GS_DM08_3&B&I&-C.J<3/2AG+AQ%J5$D?>%LI2 MIBMI:6UT1?\Y/;UZMO!H/P!`U1MRO"6<[G#GMB`L-D:NI3$R)[V5IA,N;#$C MIUFZE;4#TG4E;N245-64*E..3%MV^C(CA6,M@M@BR@``O,Y^OTHP:X*R#NE"OX('W_YJ+'[8*Q:AWMA*6=4<[)&D!> M(\3"905#)UBSTM'%Z\NWOUR]_HD]DUFA^==)ZX;AX;T7NIXZ:JVDYW.RJLXD M?;?XEG6+.BT%<8NDJ3:_ M>BW5%GJRIEO]X1>_FC6\6E0Z[P4_OWQ]$62\[,5Z5^_%KW][%<58]N*-V[>ND%IL)J=9,KTSOP[XO+J^`#+W.X MG!&U76M3K825M:CD^7B\7_RO,!M>X#S(JAP8(1K1T[#4.TU/__GL6?32BZ)+ M\=L;&K]-%&C#C+TM.P)$N+^QY-`D=ENM0UDR.8:Z?-#0FC6W"2H&__]0\F MJ-A*0(H;G'J._YRK'=A:?5S73FR=_ MV\A,K97,<3_R`QK%:1)<\(D+`WK2I(1U'D!^/ZH+7->ESXNB-XHK6=LA-_)P)VT/3)%&0?W8_[Y]I'@C^1-3$2@15B$`[O MA\+>7$MNN8YP*=:->5NX'0Y2%V*^%0B[E(S@]^\[1]-4-9HSDG%XX3UFM"28 MQ9<^H%]]U<]WRC&!+ M@8YLN7=V1^W,=]=*W%(M<<>X(I'G9#$J4:DW*DO^G%J]SY[A?3"6UUW%^T!> MWW?.^Q<+E)D@Y@K)JBV1#-8[!5<]1I=(@,921R*L/-#(7())9K^_7[Y[DLYF M9W:V##_OT]EB!FZ!^SPUD6T-#PO"!?1!9/N@AJO&N#"A8%PCC)^L'`#J,"6] MTJ*@'Y'`.:R:6JINXCT#93@2O;E1#6+F+.DUZ%@X/^7Y:+/^UK:B]&UN$>K[ M$DN?WQS/ATETX0_,`/@9Y[>[84?>0K0>R'^A`E\;;:` MD9D(XU*=X]YYU]*7M;]7U)_5]<(C3Q]/$Y[[YA3#?!?L^3B,]8OEB\X^4UW'5RW&@\L^P;J3TE,=6VG,?Y^,WWR1[ M6NAF@4.VIGBND_J#9[YG$1N'N*P5`PUPPCCP*9P@?1BGFPB.XW32+[$G#$J? MLB=(C^+TK07,MI-3E.-&^[>61A+Z6N?*6*,L2U2BS%HGP%,SWW),I>H@]QMK MO5L,@CV<6B(9TY"9F-_.![2$I3TM'9=3>F^`01%@^X@+X4#C]?VM'8>'=PH* M7^^\\4.V@]N<="6\0Y.3I:J8D+H@!$).#OH,KWZU>\.6XHE0X`E7-6'X\/LC M):%N&KS2>C;D`(<&>QYI:3GA?%^DZ<2#X?W+3ZU,-[>]T0&1GXE8\'JB&W\N MF,&P$`H',6QH;"K?M^^"!&7^U$LG_B')U"3J6](-\[9E#@F#.Z&5N?C\MM)L M.="N51@DE+,QX_S!-=N%G%P+56+D0#!6VH2.L"MTR<%'1BXHI"A>R37#\O"Q MJ342%@]_;>(K?@@XHS]:6%#UC8:;+>P)QW!^>)"U0>^6AZ=/1Z4?H19_C54` M,2C`L[].*Y\'^@I>>D?\7ZK(M9 @WI6:-R]N\N_:/F'O[4R2:$3B![JGR?\!]XE\D*42``"5 ` end -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From ian@davenant.greenend.org.uk Tue Apr 20 16:00:33 BST 1999 Article: 22 of chiark.mail.userv.discuss In-Reply-To: Sender: owner-userv-discuss@chiark.greenend.org.uk Content-Transfer-Encoding: 7bit References: To: Julian King X-Original-Newsgroups: chiark.mail.userv.discuss X-Original-Date: Wed, 7 Apr 1999 22:48:52 +0100 (BST) Cc: userv-discuss@chiark.greenend.org.uk Content-Type: text/plain; charset=us-ascii X-Received: from majordom by chiark.greenend.org.uk with local (Exim 2.02 #1) id 10VZNO-00085e-00 (Debian); Fri, 9 Apr 1999 12:23:10 +0100 X-Received: from ian by chiark.greenend.org.uk with local (Exim 2.02 #1) id 10VZNM-00085O-00 (Debian); Fri, 9 Apr 1999 12:23:08 +0100 X-Received: from 370bd3aa.a5d9b.62bc.1.bsmtp.davenant.greenend.org.uk by chiark.greenend.org.uk with local-bsmtp (Exim 2.02 #1) id 10V0Ff-0006cC-00 (Debian); Wed, 7 Apr 1999 22:52:51 +0100 X-Received: from anarres.relativity.greenend.org.uk [172.18.45.2] (mail) by davenant.greenend.org.uk with esmtp (Exim 1.92 #1) id 10V0Bp-0007lb-00 (Debian); Wed, 7 Apr 1999 22:48:53 +0100 X-Received: from ian by anarres.relativity.greenend.org.uk with local (Exim 2.02 #8) id 10V0Bo-0000c0-00 (Debian); Wed, 7 Apr 1999 22:48:52 +0100 Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Subject: Re: nested statements From: Ian Jackson Return-path: MIME-Version: 1.0 Newsgroups: chiark.mail.userv.discuss Date: Fri, 09 Apr 1999 11:23:18 GMT Message-ID: <14091.53956.202192.848726@anarres.relativity.greenend.org.uk> X-Mailer: VM 6.47 under Emacs 19.34.1 Lines: 32 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:22 Julian King writes ("nested statements"): > from my experimentation it appears to be the case that one cannot have > nested if statements? Is this correct, I can see that it might be > advisable to avoid them in that you are liable to end up with spagghetti > code. > > Or should you just try and get around it with judicious use of eof/quit? This isn't supposed to be the case. Can you post your config and the error message ? I don't seem to have any examples of nested ifs lying around here, but something like if FIRST CONDITION STUFF if SECOND CONDITION MORE STUFF fi EVEN MORE STUFF fi should work. If you're using & and |, make sure your ( and ) are right :-). Ian. -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From ian@davenant.greenend.org.uk Tue Apr 20 16:00:33 BST 1999 Article: 23 of chiark.mail.userv.discuss In-Reply-To: Sender: owner-userv-discuss@chiark.greenend.org.uk Content-Transfer-Encoding: 7bit References: To: Julian King X-Original-Newsgroups: chiark.mail.userv.discuss X-Original-Date: Wed, 7 Apr 1999 23:31:51 +0100 (BST) Cc: userv-discuss@chiark.greenend.org.uk Content-Type: text/plain; charset=us-ascii X-Received: from majordom by chiark.greenend.org.uk with local (Exim 2.02 #1) id 10VZNg-000864-00 (Debian); Fri, 9 Apr 1999 12:23:28 +0100 X-Received: from ian by chiark.greenend.org.uk with local (Exim 2.02 #1) id 10VZNg-00085u-00 (Debian); Fri, 9 Apr 1999 12:23:28 +0100 X-Received: from 370c13b9.cfed7.7ae6.0.bsmtp.davenant.greenend.org.uk by chiark.greenend.org.uk with local-bsmtp (Exim 2.02 #1) id 10V4WI-0008Bl-00 (Debian); Thu, 8 Apr 1999 03:26:18 +0100 X-Received: from anarres.relativity.greenend.org.uk [172.18.45.2] (mail) by davenant.greenend.org.uk with esmtp (Exim 1.92 #1) id 10V0rQ-0007r7-00 (Debian); Wed, 7 Apr 1999 23:31:52 +0100 X-Received: from ian by anarres.relativity.greenend.org.uk with local (Exim 2.02 #8) id 10V0rP-0000ee-00 (Debian); Wed, 7 Apr 1999 23:31:51 +0100 Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Subject: Re: suggested modifications From: Ian Jackson Return-path: MIME-Version: 1.0 Newsgroups: chiark.mail.userv.discuss Date: Fri, 09 Apr 1999 11:23:32 GMT Message-ID: <14091.56535.491363.243720@anarres.relativity.greenend.org.uk> X-Mailer: VM 6.47 under Emacs 19.34.1 Lines: 94 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:23 Julian King writes ("suggested modifications"): > All the below is as a result of trying to get the beast to work under > Solaris. I've got it to at least compile under Solaris with some effort. I should be doing a `portability' release soon. > get configure to take LDLIBS or LDFLAGS variables, and then pass that > on to Makefile (I think this is just a case of changing Makefile.in) > (so that I can do LDFLAGS=-lsocket -lnls ./configure) > get configure to check for m4, and put the complete path in Makefile Do you want to be able to set the variables (incl PATH) `correctly' only when you run configure, and have it remember them ? That sounds bad to me. Better to have configure generate Makefiles which themselves pay attention to these variable(s). Don't you agree ? > get configure to check for _gnu_ m4, and barf if the m4 installed > doesn't pass some appropriate test. Do you have a suitable test to hand ? I should ship the m4 output. > get configure to check for flex, and barf if it fails to find it. I should ship the flex output. > check for 'setenv' and deal with it not being there, probably by using > putenv, although I am not an expert. I have a trivial hack to get the > beast to compile here, but in theory it leaks memory. I've been told that > in practice it won't leak memory, but I have yet to check that. Fixed. > Give a pointer in the docs to the things that are needed (md5sum in particular) Good idea; I've added a pointer about md5sum. > Cope with md5sum being the 'new' version which prints '-' at the end I think I've fixed this. > better still don't worry about it, and deal with what md5sum outputs > as a string, and then stuff like 'cksum' can be used. Hmpf. > don't include install.sh scripts which use cp -d, when cp -d is a > gnu cp extension Where can I get another one ? > Document the behaviour when debug is set, since tracking down that > the directories it was looking for weren't there, when in fact they > were, but it was looking in a non standard place took a while. I've added something about this to INSTALL. > change the error message > "syslog: uservd<24.6>(9): service failed (error encountered while parsing configuration)" to something more helpful The full error will have been reported by the client. The idea is that only a synopsis appears in the logfile, saying whether the service failed or succeeded. > don't use $^ since that is the only thing that stops you using make > rather than gmake I'm not going to do this because it will make the Makefile less clear. Just install GNU make. > in the install rule you have 'if ! test -f ...' wouldn't 'if test ! -f' > be better? Fixed. > Also you have LOG_AUTHPRIV which isn't a logging level under Solaris, > thus far I've changed that to LOG_AUTH, although I may think about that > further before rolling it out anywhere. Fixed. > P.S. Ian Jackson, you are a far far braver man than I. m4 macro->lex->C ?!? The quoting got a bit, erm, tricky at times. grep for HYPHEN :-). This demonstrates that you forgot a stage: m4 macro -> lex -> C -> cpp output Ian. -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From pjb1008@cam.ac.uk Tue Apr 20 16:00:34 BST 1999 Article: 24 of chiark.mail.userv.discuss In-Reply-To: <14091.56535.491363.243720@anarres.relativity.greenend.org.uk> Sender: owner-userv-discuss@chiark.greenend.org.uk Content-Transfer-Encoding: 7bit References: <14091.56535.491363.243720@anarres.relativity.greenend.org.uk> <14091.56535.491363.243720@anarres.relativity.greenend.org.uk> To: userv-discuss@chiark.greenend.org.uk X-Original-Newsgroups: chiark.mail.userv.discuss X-Original-Date: Fri, 9 Apr 1999 13:36:43 +0100 Content-Type: text/plain; charset=us-ascii X-Received: from majordom by chiark.greenend.org.uk with local (Exim 2.02 #1) id 10VaWd-0000P5-00 (Debian); Fri, 9 Apr 1999 13:36:47 +0100 X-Received: from taurus.cus.cam.ac.uk [131.111.8.48] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10VaWc-0000Ov-00 (Debian); Fri, 9 Apr 1999 13:36:46 +0100 X-Received: from pjb1008 by taurus.cus.cam.ac.uk with local (Exim 2.12 #3) id 10VaWZ-0005b2-00 for userv-discuss@chiark.greenend.org.uk; Fri, 9 Apr 1999 13:36:43 +0100 Path: ewrotcd!mail-to-news!not-for-mail Precedence: bulk Subject: Re: suggested modifications From: pjb1008@cam.ac.uk (Peter Benie) Return-path: MIME-Version: 1.0 Newsgroups: chiark.mail.userv.discuss Date: Fri, 09 Apr 1999 13:32:04 GMT X-Mailer: VM 6.28 under Emacs 19.34.1 Message-ID: Lines: 43 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:24 Ian Jackson writes ("Re: suggested modifications"): > Julian King writes ("suggested modifications"): > > don't include install.sh scripts which use cp -d, when cp -d is a > > gnu cp extension I've tracked down what was happening. Julian was working on a chrooted environment which didn't have /usr/bin/install present. Consequently, configure decided to use install-sh despite being on a Solaris system. (Julian sends his appologies for the confusion caused by this.) The makefile calls 'install -d' to create the appropriate directories, but the install-sh script doesn't understand '-d' and passes it down to 'cp', where it has a completely different meaning! > > don't use $^ since that is the only thing that stops you using make > > rather than gmake > > I'm not going to do this because it will make the Makefile less > clear. Defining a variable to be the list of dependencies and using that variable is a common Makefile idiom. Using $^ actually makes the meaning less clear because it's not standard. > Just install GNU make. I have some _very_ non-standard systems for which installing packages can involve a considerable amount of porting effort. GNU make is actually very clean, but many other packages are not and adding another program to the system is not something to be done casually. Since the effort involved in installing userv is roughly proportional to the number of packages that need to be installed in order to compile it, reducing the number of packages I need to install by one would be a significant concession. The makefile is so close to being portable, surely it's worth going the whole way? Peter -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From pjb1008@cam.ac.uk Tue Apr 20 16:00:34 BST 1999 Article: 25 of chiark.mail.userv.discuss Subject: userv: logname vs logname() Sender: owner-userv-discuss@chiark.greenend.org.uk Content-Transfer-Encoding: 7bit To: userv-discuss@chiark.greenend.org.uk From: pjb1008@cam.ac.uk (Peter Benie) X-Original-Date: Fri, 9 Apr 1999 13:39:43 +0100 Return-path: Content-Type: text/plain; charset=us-ascii MIME-Version: 1.0 X-Received: from majordom by chiark.greenend.org.uk with local (Exim 2.02 #1) id 10VaZV-0000Pv-00 (Debian); Fri, 9 Apr 1999 13:39:45 +0100 X-Received: from taurus.cus.cam.ac.uk [131.111.8.48] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10VaZU-0000Pl-00 (Debian); Fri, 9 Apr 1999 13:39:45 +0100 X-Received: from pjb1008 by taurus.cus.cam.ac.uk with local (Exim 2.12 #3) id 10VaZT-0005hv-00 for userv-discuss@chiark.greenend.org.uk; Fri, 9 Apr 1999 13:39:43 +0100 Newsgroups: chiark.mail.userv.discuss Path: ewrotcd!mail-to-news!not-for-mail Date: Fri, 09 Apr 1999 13:32:04 GMT Precedence: bulk Message-ID: X-Mailer: VM 6.28 under Emacs 19.34.1 Lines: 181 Xref: news.chiark.greenend.org.uk chiark.mail.userv.discuss:25 userv uses the identifier 'logname' for a string containing $LOGNAME. This clashes with the SVID function 'logname()'. I've appended a patch to resolve this conflict. Peter ______________________________________________________________________________ diff -Pur userv-0.58.orig/client.c userv-0.58/client.c --- userv-0.58.orig/client.c Sat Jan 24 19:14:05 1998 +++ userv-0.58/client.c Sun Nov 29 17:31:21 1998 @@ -127,7 +128,7 @@ static gid_t mygid, spoofgid, *gidarray; static int ngids; static struct opening_msg opening_mbuf; -static const char *logname; +static const char *ulogname; static char *cwdbuf; static size_t cwdbufsize; static char *ovbuf; @@ -852,18 +853,18 @@ spoofuid= myuid; spoofgid= mygid; - logname= getenv("LOGNAME"); - if (!logname) logname= getenv("USER"); - if (logname) { - pw= getpwnam(logname); - if (!pw || pw->pw_uid != myuid) logname= 0; + ulogname= getenv("LOGNAME"); + if (!ulogname) ulogname= getenv("USER"); + if (ulogname) { + pw= getpwnam(ulogname); + if (!pw || pw->pw_uid != myuid) ulogname= 0; } - if (!logname) { + if (!ulogname) { pw= getpwuid(myuid); if (!pw) miscerror("cannot determine your login name"); - logname= pw->pw_name; + ulogname= pw->pw_name; } - if (!strcmp(serviceuser,"-")) serviceuser= logname; + if (!strcmp(serviceuser,"-")) serviceuser= ulogname; pw= getpwnam(serviceuser); if (!pw) miscerror("requested service user `%s' is not a user",serviceuser); serviceuid= pw->pw_uid; @@ -873,9 +874,9 @@ " the user who will be providing the service"); if (spoofuser) { - logname= spoofuser; - pw= getpwnam(logname); - if (!pw) miscerror("spoofed login name `%s' is not valid",logname); + ulogname= spoofuser; + pw= getpwnam(ulogname); + if (!pw) miscerror("spoofed login name `%s' is not valid",ulogname); spoofuid= pw->pw_uid; spoofgid= pw->pw_gid; ngidssize= ngids; ngids= 0; @@ -885,7 +886,7 @@ } gidarray[ngids++]= spoofgid; while ((gr= getgrent())) { /* ouch! getgrent has no error behaviour! */ - for (mem= gr->gr_mem; *mem && strcmp(*mem,logname); mem++); + for (mem= gr->gr_mem; *mem && strcmp(*mem,ulogname); mem++); if (!*mem) continue; if (ngids>=ngidssize) { if (ngids>=MAX_GIDS) miscerror("spoofed user is member of too many groups"); @@ -1047,7 +1048,7 @@ request_mbuf.clientpid= getpid(); request_mbuf.serviceuserlen= strlen(serviceuser); request_mbuf.servicelen= strlen(argv[0]); - request_mbuf.lognamelen= strlen(logname); + request_mbuf.lognamelen= strlen(ulogname); request_mbuf.spoofed= spoofuser ? 1 : 0; request_mbuf.cwdlen= cwdbufsize; request_mbuf.callinguid= spoofuid; @@ -1066,7 +1067,7 @@ xfwrite(&request_mbuf,sizeof(request_mbuf),swfile); xfwrite(serviceuser,sizeof(*serviceuser)*request_mbuf.serviceuserlen,swfile); xfwrite(argv[0],sizeof(*argv[0])*request_mbuf.servicelen,swfile); - xfwrite(logname,sizeof(*logname)*request_mbuf.lognamelen,swfile); + xfwrite(ulogname,sizeof(*ulogname)*request_mbuf.lognamelen,swfile); xfwrite(cwdbuf,sizeof(*cwdbuf)*request_mbuf.cwdlen,swfile); if (ovused>=0) xfwrite(ovbuf,sizeof(*ovbuf)*ovused,swfile); xfwrite(&spoofgid,sizeof(gid_t),swfile); diff -Pur userv-0.58.orig/daemon.h userv-0.58/daemon.h --- userv-0.58.orig/daemon.h Tue Oct 14 02:05:18 1997 +++ userv-0.58/daemon.h Sun Nov 29 15:01:37 1998 @@ -157,7 +157,7 @@ extern int restfdwantstate, restfdwantrw; extern int service_ngids; extern char **argarray; -extern char *serviceuser, *service, *logname, *cwd; +extern char *serviceuser, *service, *ulogname, *cwd; extern char *overridedata, *userrcfile; extern char *serviceuser_dir, *serviceuser_shell, *callinguser_shell; extern gid_t *calling_gids, *service_gids; diff -Pur userv-0.58.orig/debug.c userv-0.58/debug.c --- userv-0.58.orig/debug.c Thu Sep 11 19:20:14 1997 +++ userv-0.58/debug.c Sun Nov 29 15:03:28 1998 @@ -160,7 +160,7 @@ "calling uid: %ld\n" "calling user shell: `%s'\n" "calling groups:", - logname, (long)request_mbuf.callinguid, + ulogname, (long)request_mbuf.callinguid, callinguser_shell); groupsdump(request_mbuf.ngids,calling_gids,calling_groups); printf("\n" diff -Pur userv-0.58.orig/parser.c userv-0.58/parser.c --- userv-0.58.orig/parser.c Thu Jan 29 00:00:18 1998 +++ userv-0.58/parser.c Sun Nov 29 16:27:29 1998 @@ -487,7 +487,7 @@ } static int pf_callinguser(int ptoken, char ***rvalues) { - return parm_usernameuid(rvalues,logname,request_mbuf.callinguid); + return parm_usernameuid(rvalues,ulogname,request_mbuf.callinguid); } static int pf_serviceuser(int ptoken, char ***rvalues) { diff -Pur userv-0.58.orig/process.c userv-0.58/process.c --- userv-0.58.orig/process.c Sat Jan 24 19:14:10 1998 +++ userv-0.58/process.c Sun Nov 29 15:04:14 1998 @@ -73,7 +73,7 @@ int restfdwantstate= tokv_word_rejectfd, restfdwantrw; int service_ngids; char **argarray; -char *serviceuser, *service, *logname, *cwd; +char *serviceuser, *service, *ulogname, *cwd; char *overridedata, *userrcfile; char *serviceuser_dir, *serviceuser_shell, *callinguser_shell; gid_t *calling_gids, *service_gids; @@ -413,7 +413,7 @@ serviceuser= xfreadsetstring(request_mbuf.serviceuserlen); service= xfreadsetstring(request_mbuf.servicelen); assert(request_mbuf.spoofed==0 || request_mbuf.spoofed==1); - logname= xfreadsetstring(request_mbuf.lognamelen); + ulogname= xfreadsetstring(request_mbuf.lognamelen); cwd= xfreadsetstring(request_mbuf.cwdlen); if (request_mbuf.overridelen >= 0) { assert(request_mbuf.overridelen <= MAX_OVERRIDE_LEN); @@ -495,9 +495,9 @@ static void lookup_uidsgids(void) { struct passwd *pw; - pw= getpwnam(logname); + pw= getpwnam(ulogname); if (!pw) miscerror("look up calling user"); - assert(!strcmp(pw->pw_name,logname)); + assert(!strcmp(pw->pw_name,ulogname)); callinguser_shell= xstrsave(pw->pw_shell); pw= getpwnam(serviceuser); @@ -722,7 +722,7 @@ debug_dumprequest(mypid); syslog(LOG_INFO,"%s %s -> %s %c %s", request_mbuf.spoofed ? "spoof" : "user", - logname, serviceuser, overridedata?'!':':', service); + ulogname, serviceuser, overridedata?'!':':', service); if (overridedata) r= parse_string(TOPLEVEL_OVERRIDDEN_CONFIGURATION, diff -Pur userv-0.58.orig/servexec.c userv-0.58/servexec.c --- userv-0.58.orig/servexec.c Tue Oct 14 14:05:27 1997 +++ userv-0.58/servexec.c Sun Nov 29 15:04:34 1998 @@ -143,7 +143,7 @@ static const char *see_service(void) { return service; } static const char *see_c_cwd(void) { return cwd; } -static const char *see_c_logname(void) { return logname; } +static const char *see_c_logname(void) { return ulogname; } static const char *see_c_uid(void) { static char buf[CHAR_BIT*sizeof(uid_t)/3+4]; snyprintf(buf,sizeof(buf),"%lu",(unsigned long)request_mbuf.callinguid); -- To remove yourself from this mailing list, send the word UNSUBSCRIBE to userv-discuss-REQUEST@chiark.greenend.org.uk. Info is at: . From owner-mailman@chiark.greenend.org.uk Sun Apr 18 21:09:12 1999 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from 371a3bde.90ef1.553.0.bsmtp.davenant.greenend.org.uk by chiark.greenend.org.uk with local-bsmtp (Exim 2.02 #1) id 10YxsO-0000MB-00 (Debian); Sun, 18 Apr 1999 21:09:12 +0100 Received: from anarres.relativity.greenend.org.uk [172.18.45.2] (mail) by davenant.greenend.org.uk with esmtp (Exim 1.92 #1) id 10YxqB-0003I8-00 (Debian); Sun, 18 Apr 1999 21:06:55 +0100 Received: from ian by anarres.relativity.greenend.org.uk with local (Exim 2.02 #8) id 10YxqA-00032q-00 (Debian); Sun, 18 Apr 1999 21:06:54 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14106.15197.182872.555489@anarres.relativity.greenend.org.uk> Date: Sun, 18 Apr 1999 21:06:53 +0100 (BST) From: userv-maint@chiark.greenend.org.uk (Ian Jackson) To: userv-announce@chiark.greenend.org.uk, userv-discuss@chiark.greenend.org.uk Subject: Change of mailing list software on userv lists X-Mailer: VM 6.47 under Emacs 19.34.1 Sender: Ian Jackson I've switched from Majordomo to Mailman for the userv mailing lists. You shouldn't notice much difference in normal operation. If you want to subscribe or unsubscribe, go to the Mailman list management page on chiark, http://www.chiark.greenend.org.uk/mailman/listinfo I've also created a new userv-bugreports list, where people not subscribed to userv-discuss will be encouraged to send their bug reports. Feel free to subscribe (but subscribers to userv-discuss are encouraged to continue to send bug reports there). Thanks, Ian. From owner-mailman@chiark.greenend.org.uk Fri May 14 16:03:20 1999 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from ursa.cus.cam.ac.uk [131.111.8.6] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10iJUe-0007yh-00 (Debian); Fri, 14 May 1999 16:03:20 +0100 Received: from bjh21 (helo=localhost) by ursa.cus.cam.ac.uk with local-smtp (Exim 3.00 #1) id 10iJUc-0006dT-00 for userv-discuss@chiark.greenend.org.uk; Fri, 14 May 1999 16:03:18 +0100 Date: Fri, 14 May 1999 16:03:17 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: putenv() problem Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Ben Harris uservd's synthesis of setenv() from putenv() appears to be broken in that it uses the same buffer for every call to putenv(). This breaks under Solaris, as (to quote putenv(3C)): # the string # pointed to by string becomes part of the environment, so # altering the string will change the environment. I think this means that uservd needs to malloc space for each environment variable separately, and the patch below does this. Any memory leaked by this will be minimal, and will in any case be rendered irrelevant as soon as uservd exec()s the service. *** lib.c.orig Wed Apr 7 23:33:44 1999 --- lib.c Fri May 14 13:57:43 1999 *************** *** 116,129 **** #ifndef HAVE_SETENV int setenv(const char *name, const char *value, int overwrite) { ! static char *buffer= 0; ! static int avail= 0; ! ! int r; assert(overwrite==1); ! r= makeroom(&buffer,&avail,strlen(name)+strlen(value)+2); ! if (r) { errno= EINVAL; return -1; } sprintf(buffer,"%s=%s",name,value); return putenv(buffer); --- 116,125 ---- #ifndef HAVE_SETENV int setenv(const char *name, const char *value, int overwrite) { ! char *buffer; assert(overwrite==1); ! buffer = xmalloc(strlen(name)+strlen(value)+2); sprintf(buffer,"%s=%s",name,value); return putenv(buffer); -- Ben Harris Unix Support, University of Cambridge Computing Service. E-mail: bjh21@cam.ac.uk Tel: +44 (0)1223 334728 Fax: +44 (0)1223 334679 From owner-mailman@chiark.greenend.org.uk Fri May 14 12:47:51 1999 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from ursa.cus.cam.ac.uk [131.111.8.6] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10iGRT-0006cf-00 (Debian); Fri, 14 May 1999 12:47:51 +0100 Received: from bjh21 (helo=localhost) by ursa.cus.cam.ac.uk with local-smtp (Exim 3.00 #1) id 10iGRQ-0004lD-00 for userv-discuss@chiark.greenend.org.uk; Fri, 14 May 1999 12:47:48 +0100 Date: Fri, 14 May 1999 12:47:48 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: Pidfiles Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Ben Harris In an application here, it'd be useful if uservd generated a pidfile (we'll have multiple chrooted uservds, and I'd like to make sure I kill the right one). The following patches seem to achieve this. They don't currently remove the pidfile when uservd exits. If this seems necessary it could probably be arranged. *** daemon.h.orig Thu Apr 8 00:43:11 1999 --- daemon.h Fri May 14 10:46:55 1999 *************** *** 74,79 **** --- 74,81 ---- #define SHELLLISTPATH SYSTEMCONFIGDIR "/" SHELLLIST #define SETENVIRONMENTPATH SYSTEMCONFIGDIR "/" SETENVIRONMENT + #define PIDFILE "/var/run/uservd.pid" + #define USERVD_LOGIDENT "uservd" #define USERVDCHECK_LOGIDENT "uservd/check" #define USERVD_LOGFACILITY LOG_DAEMON *** overlord.c.orig Wed Apr 7 23:33:47 1999 --- overlord.c Fri May 14 10:39:50 1999 *************** *** 256,261 **** --- 256,271 ---- exit(4); } + static void writepidfile(void) { + FILE *fp; + + fp = fopen(PIDFILE, "w"); + if (fp != NULL) { + fprintf(fp, "%d\n", getpid()); + fclose(fp); + } + } + int main(int argc, char *const *argv) { int mfd, sfd, nfd, csocklen, e, r, becomedaemon; struct sigaction sigact; *************** *** 336,341 **** --- 346,354 ---- close(nfd); } + if (becomedaemon) + writepidfile(); + syslog(LOG_NOTICE,"started"); for (;;) { -- Ben Harris Unix Support, University of Cambridge Computing Service. E-mail: bjh21@cam.ac.uk Tel: +44 (0)1223 334728 Fax: +44 (0)1223 334679 From owner-mailman@chiark.greenend.org.uk Mon May 17 18:54:41 1999 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from mercury.elmailer.net [195.224.76.4] by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10jRb7-0000YH-00 (Debian); Mon, 17 May 1999 18:54:41 +0100 Received: by mercury.elmailer.net with ESMTP from sfere.greenend.org.uk (sfere.greenend.org.uk [195.224.38.1]) id SAA10573 for (2.4-8.8.8/3.1.37); Mon, 17 May 1999 18:54:34 +0100 (BST) Received: from richard by sfere.greenend.org.uk with local (Exim 2.02 #1 (Debian)) id 10jRPe-0003JA-00; Mon, 17 May 1999 18:42:50 +0100 From: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Nazi-fissionable-NSA-lSbH2XjrLzYjdNeB" Content-Transfer-Encoding: 7bit To: userv-discuss@chiark.greenend.org.uk Subject: Pidfiles (fwd) In-Reply-To: References: X-Mailer: VM 6.30 under 20.4 "Emerald" XEmacs Lucid Message-Id: Date: Mon, 17 May 1999 18:42:50 +0100 X-RBL-Warning: See http://www.orbs.org/blocked.cgi. Your mailserver is in the ORBS database as an insecure email relay. This is a generic text --Nazi-fissionable-NSA-lSbH2XjrLzYjdNeB Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Ben Harris writes: > In an application here, it'd be useful if uservd generated a pidfile > (we'll have multiple chrooted uservds, and I'd like to make sure I > kill the right one). The following patches seem to achieve this. > They don't currently remove the pidfile when uservd exits. If this > seems necessary it could probably be arranged. Personally I prefer it to be possible to set the pidfile from the command line - though uservd as written seems to prefer its configuration to be compiled in. I've attached a patch which works this way. It's loosely based on Ben's. It compiles but I haven't tested it in anger. It would be trivial to modify to have a pidfile by default and use the command-line option to change it. ttfn/rjk --Nazi-fissionable-NSA-lSbH2XjrLzYjdNeB Content-Type: text/plain Content-Description: patch against userv to implement a pidfile from the command line Content-Disposition: inline; filename="userv.diff" Content-Transfer-Encoding: 7bit Index: overlord.c =================================================================== RCS file: /usr/src/CVS/userv/overlord.c,v retrieving revision 1.6 diff -u -r1.6 overlord.c --- overlord.c 1999/04/07 22:33:47 1.6 +++ overlord.c 1999/05/17 17:29:34 @@ -256,23 +256,36 @@ exit(4); } +static void writepidfile(const char *pidfile, pid_t pid) { + FILE *fp; + + if(!(fp = fopen(pidfile, "w"))) startupsyscallerr("cannot create pidfile"); + if(fprintf(fp, "%lu\n", (unsigned long)pid) < 0 || fclose(fp) < 0) + startupsyscallerr("cannot write to pidfile"); +} + int main(int argc, char *const *argv) { int mfd, sfd, nfd, csocklen, e, r, becomedaemon; struct sigaction sigact; struct sockaddr_un ssockname, csockname; pid_t child, parentpid, sid; + int n; + const char *pidfile = NULL; #ifdef NDEBUG abort(); /* Do not disable assertions in this security-critical code ! */ #endif becomedaemon= 0; - - if (argv[1] && !strcmp(argv[1],"-daemon")) { - becomedaemon= 1; - argv++; argc--; + + for(n = 1; n < argc; n++) { + if(!strcmp(argv[n], "-daemon")) becomedaemon = 1; + else if(!strcmp(argv[n], "-pidfile") && n + 1 < argc) pidfile = argv[++n]; + else { + fputs("usage: uservd [-daemon] [-pidfile filename]\n",stderr); + exit(3); + } } - if (argc>1) { fputs("usage: uservd [-daemon]\n",stderr); exit(3); } openlog(USERVD_LOGIDENT,LOG_NDELAY|LOG_PID,USERVD_LOGFACILITY); @@ -328,6 +341,7 @@ sid= setsid(); if (sid == -1) startupsyscallerr("cannot create new session"); overlordpid= getpid(); if (overlordpid == -1) startupsyscallerr("getpid after detach"); + if (pidfile) writepidfile(pidfile, overlordpid); if (dup2(nfd,0)<0 || dup2(nfd,1)<0) startupsyscallerr("cannot dup /dev/null for stdin/out"); r= kill(parentpid,SIGUSR1); if (r) startupsyscallerr("send SIGUSR1 to detach"); --Nazi-fissionable-NSA-lSbH2XjrLzYjdNeB-- From owner-mailman@chiark.greenend.org.uk Tue May 18 11:57:36 1999 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from ijackson by chiark.greenend.org.uk with local (Exim 2.02 #1) id 10jhZ1-0006Et-00 (Debian); Tue, 18 May 1999 11:57:35 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14145.18335.663451.317491@chiark.greenend.org.uk> Date: Tue, 18 May 1999 11:57:35 +0100 (BST) From: ian@davenant.greenend.org.uk (Ian Jackson) To: userv-discuss@chiark.greenend.org.uk Subject: Re: Pidfiles (fwd) Newsgroups: chiark.mail.userv.discuss In-Reply-To: References: X-Mailer: VM 6.47 under Emacs 19.34.1 Sender: Ian Jackson Ben Harris writes: > In an application here, it'd be useful if uservd generated a pidfile > (we'll have multiple chrooted uservds, and I'd like to make sure I > kill the right one). The following patches seem to achieve this. > They don't currently remove the pidfile when uservd exits. If this > seems necessary it could probably be arranged. I don't believe in pidfiles because they're not reliable. That is to say, given a reliable existing arrangement, pidfiles are unnecessary, and given an unreliable existing arrangement, addition of a pidfile will only reduce the probability of killing the wrong process, not eliminate it. How about if I make a client option which causes the server to shut down ? rjk@greenend.org.uk writes ("Pidfiles (fwd)"): > Personally I prefer it to be possible to set the pidfile from the > command line - though uservd as written seems to prefer its > configuration to be compiled in. Indeed. The client needs to have its configuration compiled in, for obvious reasons (though I could indirect through a config file in /etc, this means the client would have to parse something, which seems like a bad idea even if it's controlled by root, and furthermore is extra effort). Given that, it seems not worth the effort to make the server's configuration modifiable on the command line. Ian. From owner-mailman@chiark.greenend.org.uk Tue May 18 13:31:08 1999 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from ursa.cus.cam.ac.uk [131.111.8.6] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10jj1X-00075i-00 (Debian); Tue, 18 May 1999 13:31:07 +0100 Received: from bjh21 (helo=localhost) by ursa.cus.cam.ac.uk with local-smtp (Exim 3.00 #1) id 10jj1V-0000WZ-00 for userv-discuss@chiark.greenend.org.uk; Tue, 18 May 1999 13:31:05 +0100 Date: Tue, 18 May 1999 13:31:05 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: Re: Pidfiles (fwd) In-Reply-To: <14145.18335.663451.317491@chiark.greenend.org.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Ben Harris On Tue, 18 May 1999, Ian Jackson wrote: > Ben Harris writes: > > In an application here, it'd be useful if uservd generated a pidfile > > (we'll have multiple chrooted uservds, and I'd like to make sure I > > kill the right one). The following patches seem to achieve this. > > They don't currently remove the pidfile when uservd exits. If this > > seems necessary it could probably be arranged. > > I don't believe in pidfiles because they're not reliable. That is to > say, given a reliable existing arrangement, pidfiles are unnecessary, > and given an unreliable existing arrangement, addition of a pidfile > will only reduce the probability of killing the wrong process, not > eliminate it. Fair enough. In our case, killing processes by name is no good at all (the machine will run multiple chrooted uservds), but pidfiles will work as well as they usually do. > How about if I make a client option which causes the server to shut > down ? That would work perfectly well for us, yes, and would seem to be pretty reliable about killing the right process. -- Ben Harris Unix Support, University of Cambridge Computing Service. E-mail: bjh21@cam.ac.uk Tel: +44 (0)1223 334728 Fax: +44 (0)1223 334679 From owner-mailman@chiark.greenend.org.uk Thu May 20 00:33:15 1999 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from 37434a2d.81592.40ae.0.bsmtp.davenant.greenend.org.uk by chiark.greenend.org.uk with local-bsmtp (Exim 2.02 #1) id 10kFpq-0004JE-00 (Debian); Thu, 20 May 1999 00:33:14 +0100 Received: from anarres.relativity.greenend.org.uk [172.18.45.2] (mail) by davenant.greenend.org.uk with esmtp (Exim 2.125 #2) id 10kFbv-00045a-00 (Debian); Thu, 20 May 1999 00:18:51 +0100 Received: from ian by anarres.relativity.greenend.org.uk with local (Exim 2.125 #2) id 10kFbt-0001Hb-00 (Debian); Thu, 20 May 1999 00:18:49 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14147.18136.474318.9354@anarres.relativity.greenend.org.uk> Date: Thu, 20 May 1999 00:18:48 +0100 (BST) To: Ben Harris Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: Pidfiles (fwd) In-Reply-To: References: <14145.18335.663451.317491@chiark.greenend.org.uk> X-Mailer: VM 6.47 under Emacs 19.34.1 Ben Harris writes: > In an application here, it'd be useful if uservd generated a pidfile > (we'll have multiple chrooted uservds, and I'd like to make sure I > kill the right one). I think I've added the relevant things to make `-B shutdown' work. A long patch (against 0.62) is below. Can you try it and see if it does what you want ? (I've also included the putenv fix, you'll find.) NB that of course if you are using different copies of the actual uservd binary (rather than hardlinks) you can use Debian's start-stop-daemon to reliably kill the right process(es). (You have to decide whether you want to shut down just the parent server, or all the per-request processes currently running.) Ian. Index: userv/INSTALL diff -u userv/INSTALL:1.8 userv/INSTALL:1.9 --- userv/INSTALL:1.8 Wed Apr 7 23:43:42 1999 +++ userv/INSTALL Thu May 20 00:13:44 1999 @@ -153,6 +153,9 @@ example, if the client receives a fatal signal of some kind from its execution environment (eg its controlling terminal). + 10 - The per-request child wishes the server to check whether it is + still the uservd. + 12 - The service failed onm the service side in an expected and controlled manner, for example because it was rejected in the configuration files. @@ -170,7 +173,7 @@ internal error occurred. This can also occur if an attempt to block signals using sigprocmask fails. - 0-3,5-7,9-11,13-15,17-19 are not currently used. + 0-3,5-7,9,11,13-15,17-19 are not currently used by normal children. REENTRANCY IN THE LIBC: Index: userv/Makefile.in diff -u userv/Makefile.in:1.30 userv/Makefile.in:1.31 --- userv/Makefile.in:1.30 Sun Apr 18 19:53:44 1999 +++ userv/Makefile.in Thu May 20 00:13:45 1999 @@ -126,8 +126,6 @@ tokens.h: language.i4 - rm -f *.o *~ core ./#*# - autoconf configure: autoheader autoconf @@ -136,7 +134,7 @@ find -name '*.orig' -o -name '*~' -o -name '.*~' \ -o -name '*#' -o -name '.#*' -o -name '*.bak' \ | xargs -r rm - rm -rf $(TARGETS) *.o version.h + rm -rf $(TARGETS) *.o core version.h rm -f overview.eps rm -f spec.lout* spec.text* spec.ps?* spec.sgml.new rm -f lout.li *.ld *.lix *.ldx Index: userv/daemon.h diff -u userv/daemon.h:1.9 userv/daemon.h:1.10 --- userv/daemon.h:1.9 Thu Apr 8 00:43:11 1999 +++ userv/daemon.h Thu May 20 00:13:47 1999 @@ -131,7 +131,7 @@ builtinserviceexec_fnt NONRETURNING bisexec_environment, bisexec_parameter; builtinserviceexec_fnt NONRETURNING bisexec_version, bisexec_help; builtinserviceexec_fnt NONRETURNING bisexec_toplevel, bisexec_override, bisexec_reset; -builtinserviceexec_fnt NONRETURNING bisexec_execute; +builtinserviceexec_fnt NONRETURNING bisexec_execute, bisexec_shutdown; extern const char *const builtinservicehelpstrings[]; void execservice(const int synchsocket[], int clientfd) NONRETURNING; Index: userv/language.i4 diff -u userv/language.i4:1.4 userv/language.i4:1.5 --- userv/language.i4:1.4 Thu Apr 8 00:43:13 1999 +++ userv/language.i4 Thu May 20 00:13:48 1999 @@ -162,6 +162,7 @@ isbuiltinservice(`version',`none') isbuiltinservice(`toplevel',`none') isbuiltinservice(`override',`none') +isbuiltinservice(`shutdown',`none') dnl builtin services that are also directive names define(`isdirectivebuiltinservice', Index: userv/lexer.c diff -u userv/lexer.c:1.1 userv/lexer.c:1.2 --- userv/lexer.c:1.1 Sun Apr 18 19:15:15 1999 +++ userv/lexer.c Thu May 20 00:13:49 1999 @@ -1,7 +1,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /davenant/usr/src/CVS/userv/lexer.c,v 1.1 1999/04/18 18:15:15 ian Exp $ + * $Header: /davenant/usr/src/CVS/userv/lexer.c,v 1.2 1999/05/19 23:13:49 ian Exp $ */ #define FLEX_SCANNER @@ -285,73 +285,73 @@ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 103 -#define YY_END_OF_BUFFER 104 -static yyconst short int yy_accept[572] = +#define YY_NUM_RULES 104 +#define YY_END_OF_BUFFER 105 +static yyconst short int yy_accept[579] = { 0, - 0, 0, 104, 102, 96, 97, 89, 101, 99, 86, - 90, 87, 88, 93, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 91, 102, 96, 97, - 99, 101, 101, 100, 101, 99, 99, 98, 95, 93, - 102, 102, 102, 102, 19, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 37, 102, 102, 102, 102, - 32, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 100, 101, 101, 101, - - 101, 0, 101, 101, 94, 93, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 31, 62, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 70, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 101, 101, 100, 0, 101, 101, 94, 93, 102, - 102, 102, 66, 102, 102, 63, 67, 102, 102, 102, - 35, 36, 102, 102, 102, 102, 40, 42, 102, 50, - 102, 102, 59, 69, 102, 71, 102, 72, 102, 102, - - 102, 102, 102, 102, 102, 30, 102, 84, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 74, 75, - 102, 61, 102, 101, 101, 0, 0, 0, 101, 94, - 93, 102, 64, 102, 102, 102, 102, 102, 58, 102, - 65, 102, 92, 102, 38, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 41, 102, 102, - 48, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 85, 101, 0, 0, 94, 93, 102, 102, 102, - 102, 102, 68, 102, 102, 102, 102, 102, 102, 69, - 76, 77, 78, 79, 80, 81, 82, 83, 102, 102, - - 102, 102, 60, 102, 102, 102, 1, 102, 102, 102, - 102, 39, 102, 73, 102, 102, 102, 102, 0, 94, - 93, 102, 102, 102, 102, 102, 102, 102, 102, 49, - 102, 21, 26, 102, 102, 102, 10, 102, 102, 102, - 102, 102, 51, 102, 102, 102, 102, 45, 61, 94, - 93, 102, 9, 66, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 47, 102, 102, 102, - 102, 102, 102, 46, 102, 94, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 12, 102, 102, 102, - 102, 102, 102, 44, 11, 102, 102, 102, 102, 102, - - 102, 94, 102, 102, 102, 102, 102, 33, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 8, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 43, 34, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 20, 102, - 102, 102, 102, 52, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 55, 102, 102, - 102, 102, 102, 53, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 56, 102, 102, - 15, 102, 102, 102, 102, 17, 7, 102, 102, 102, - - 102, 102, 102, 102, 23, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 4, 102, 102, 102, - 22, 102, 102, 102, 102, 102, 13, 102, 102, 102, - 102, 5, 6, 102, 102, 102, 102, 102, 102, 16, - 102, 102, 102, 102, 102, 102, 3, 25, 102, 18, - 102, 102, 102, 27, 102, 54, 102, 24, 14, 57, - 102, 102, 102, 102, 28, 102, 102, 102, 29, 2, - 0 + 0, 0, 105, 103, 97, 98, 90, 102, 100, 87, + 91, 88, 89, 94, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 92, 103, 97, 98, + 100, 102, 102, 101, 102, 100, 100, 99, 96, 94, + 103, 103, 103, 103, 19, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 37, 103, 103, 103, 103, + 32, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 101, 102, 102, + + 102, 102, 0, 102, 102, 95, 94, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 31, 63, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 71, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 102, 102, 101, 0, 102, 102, 95, + 94, 103, 103, 103, 67, 103, 103, 64, 68, 103, + 103, 103, 35, 36, 103, 103, 103, 103, 40, 42, + 103, 51, 103, 103, 60, 70, 103, 72, 103, 73, + + 103, 103, 103, 103, 103, 103, 103, 30, 103, 85, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 75, 76, 103, 62, 103, 102, 102, 0, 0, + 0, 102, 95, 94, 103, 65, 103, 103, 103, 103, + 103, 59, 103, 66, 103, 93, 103, 38, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 41, 103, 103, 49, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 86, 102, 0, 0, 95, + 94, 103, 103, 103, 103, 103, 69, 103, 103, 103, + 103, 103, 103, 70, 77, 78, 79, 80, 81, 82, + + 83, 84, 103, 103, 103, 103, 61, 103, 103, 103, + 1, 103, 103, 103, 103, 103, 39, 103, 74, 103, + 103, 103, 103, 0, 95, 94, 103, 103, 103, 103, + 103, 103, 103, 103, 50, 103, 21, 26, 103, 103, + 103, 10, 103, 103, 103, 103, 103, 52, 103, 103, + 103, 103, 103, 45, 62, 95, 94, 103, 9, 67, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 47, 103, 103, 103, 103, 103, 48, 103, + 46, 103, 95, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 12, 103, 103, 103, 103, 103, 103, + + 44, 11, 103, 103, 103, 103, 103, 103, 95, 103, + 103, 103, 103, 103, 33, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 8, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 43, + 34, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 20, 103, 103, 103, 103, + 53, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 56, 103, 103, 103, 103, 103, + 54, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 57, 103, 103, 15, 103, 103, + + 103, 103, 17, 7, 103, 103, 103, 103, 103, 103, + 103, 23, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 4, 103, 103, 103, 22, 103, 103, + 103, 103, 103, 13, 103, 103, 103, 103, 5, 6, + 103, 103, 103, 103, 103, 103, 16, 103, 103, 103, + 103, 103, 103, 3, 25, 103, 18, 103, 103, 103, + 27, 103, 55, 103, 24, 14, 58, 103, 103, 103, + 103, 28, 103, 103, 103, 29, 2, 0 } ; static yyconst int yy_ec[256] = @@ -396,253 +396,254 @@ 1 } ; -static yyconst short int yy_base[582] = +static yyconst short int yy_base[589] = { 0, - 0, 0, 917, 0, 50, 918, 0, 52, 56, 0, - 0, 0, 0, 64, 883, 19, 44, 37, 51, 882, - 25, 36, 64, 885, 34, 67, 62, 867, 887, 866, - 75, 68, 871, 60, 880, 73, 0, 0, 106, 918, - 905, 109, 101, 905, 132, 116, 903, 918, 168, 177, - 867, 87, 860, 24, 0, 87, 874, 876, 858, 88, - 871, 853, 868, 855, 867, 0, 856, 865, 849, 856, - 0, 853, 95, 848, 862, 846, 854, 843, 838, 115, - 848, 854, 98, 849, 843, 130, 114, 841, 839, 835, - 837, 847, 848, 832, 831, 839, 0, 198, 869, 0, - - 126, 134, 245, 265, 283, 292, 843, 827, 829, 835, - 830, 838, 820, 825, 825, 816, 833, 829, 829, 815, - 823, 0, 816, 827, 827, 812, 826, 810, 810, 812, - 808, 808, 820, 0, 808, 800, 799, 132, 808, 804, - 797, 805, 812, 792, 804, 806, 804, 787, 802, 785, - 783, 816, 785, 786, 789, 788, 781, 782, 778, 782, - 775, 301, 318, 918, 348, 384, 393, 411, 420, 782, - 773, 769, 775, 781, 781, 0, 0, 773, 780, 771, - 0, 0, 778, 766, 765, 761, 0, 0, 778, 0, - 762, 758, 0, 773, 765, 0, 775, 0, 766, 132, - - 771, 785, 754, 768, 757, 0, 764, 0, 765, 758, - 746, 747, 755, 758, 744, 743, 745, 754, 770, 0, - 748, 747, 750, 429, 438, 135, 0, 464, 200, 482, - 491, 733, 0, 765, 734, 737, 762, 735, 0, 734, - 0, 732, 727, 725, 0, 739, 739, 730, 500, 734, - 721, 719, 722, 732, 730, 726, 729, 0, 713, 714, - 0, 722, 727, 715, 723, 722, 719, 703, 706, 708, - 708, 0, 139, 0, 508, 526, 535, 717, 714, 710, - 711, 700, 0, 702, 701, 726, 708, 724, 706, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 705, 706, - - 720, 691, 0, 702, 701, 684, 715, 697, 681, 695, - 677, 0, 679, 0, 692, 693, 681, 687, 198, 544, - 553, 688, 688, 669, 702, 668, 683, 674, 123, 698, - 679, 696, 0, 668, 677, 663, 0, 675, 674, 672, - 689, 651, 687, 665, 654, 660, 665, 0, 0, 562, - 682, 681, 0, 0, 134, 659, 664, 661, 644, 649, - 140, 659, 194, 648, 647, 655, 0, 641, 654, 651, - 179, 638, 667, 0, 645, 571, 198, 635, 633, 631, - 630, 635, 629, 659, 625, 627, 0, 635, 637, 627, - 627, 618, 620, 0, 0, 634, 619, 617, 620, 633, - - 621, 0, 620, 606, 611, 614, 623, 0, 639, 606, - 617, 100, 615, 608, 604, 616, 605, 614, 609, 598, - 0, 601, 610, 600, 595, 607, 602, 591, 604, 587, - 589, 598, 0, 0, 596, 125, 592, 590, 597, 577, - 588, 592, 573, 599, 554, 553, 557, 501, 0, 502, - 461, 434, 435, 462, 428, 436, 443, 427, 418, 449, - 390, 383, 350, 350, 354, 367, 351, 378, 360, 345, - 349, 347, 373, 0, 341, 343, 353, 352, 344, 346, - 198, 334, 334, 336, 363, 336, 331, 0, 329, 333, - 0, 316, 321, 316, 325, 0, 0, 314, 316, 316, - - 320, 327, 303, 286, 317, 296, 290, 295, 293, 280, - 277, 247, 249, 246, 232, 242, 0, 230, 227, 227, - 0, 243, 212, 227, 212, 225, 0, 226, 219, 221, - 214, 0, 0, 220, 216, 196, 208, 202, 202, 0, - 203, 198, 205, 202, 198, 206, 0, 0, 196, 0, - 187, 193, 190, 0, 173, 0, 164, 0, 0, 0, - 177, 177, 165, 145, 0, 134, 141, 119, 0, 0, - 918, 592, 596, 600, 604, 608, 612, 616, 620, 138, - 67 + 0, 0, 924, 0, 50, 925, 0, 52, 56, 0, + 0, 0, 0, 64, 890, 19, 44, 37, 51, 889, + 25, 36, 64, 892, 34, 67, 62, 874, 894, 873, + 75, 74, 878, 65, 887, 72, 0, 0, 109, 925, + 912, 115, 104, 912, 138, 119, 910, 925, 174, 183, + 874, 69, 867, 24, 0, 85, 881, 883, 865, 92, + 878, 860, 875, 862, 874, 0, 863, 872, 856, 863, + 0, 860, 99, 855, 869, 853, 861, 850, 845, 101, + 855, 861, 90, 856, 850, 136, 104, 842, 847, 845, + 841, 843, 853, 854, 838, 837, 845, 0, 204, 875, + + 0, 131, 139, 251, 271, 289, 298, 849, 833, 835, + 841, 836, 844, 826, 831, 831, 822, 839, 835, 835, + 821, 829, 0, 822, 833, 833, 818, 832, 816, 816, + 818, 814, 814, 826, 0, 814, 806, 805, 121, 814, + 810, 803, 811, 818, 798, 810, 812, 810, 793, 808, + 791, 789, 822, 789, 790, 791, 794, 793, 786, 787, + 783, 787, 780, 307, 324, 925, 354, 390, 399, 417, + 426, 787, 778, 774, 780, 786, 786, 0, 0, 778, + 785, 776, 0, 0, 783, 771, 770, 766, 0, 0, + 783, 0, 767, 763, 0, 778, 770, 0, 780, 0, + + 771, 118, 776, 790, 759, 773, 762, 0, 769, 0, + 770, 763, 751, 752, 760, 763, 763, 748, 747, 749, + 758, 774, 0, 752, 751, 754, 435, 444, 134, 0, + 470, 206, 488, 497, 737, 0, 769, 738, 741, 766, + 739, 0, 738, 0, 736, 731, 729, 0, 743, 743, + 734, 506, 738, 725, 723, 726, 736, 734, 730, 733, + 0, 717, 718, 0, 726, 731, 719, 717, 726, 725, + 722, 706, 709, 711, 711, 0, 145, 0, 514, 532, + 541, 720, 717, 713, 714, 703, 0, 705, 704, 729, + 711, 727, 709, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 708, 709, 723, 694, 0, 705, 704, 687, + 718, 700, 684, 698, 680, 678, 0, 681, 0, 694, + 695, 683, 689, 160, 550, 559, 690, 690, 671, 704, + 670, 685, 676, 127, 700, 681, 698, 0, 670, 679, + 665, 0, 677, 676, 674, 691, 653, 689, 667, 661, + 655, 661, 666, 0, 0, 568, 683, 682, 0, 0, + 135, 660, 665, 662, 645, 650, 143, 660, 148, 649, + 648, 656, 0, 642, 655, 652, 182, 639, 0, 668, + 0, 646, 577, 185, 636, 634, 632, 631, 636, 630, + 660, 626, 628, 0, 636, 638, 628, 628, 619, 621, + + 0, 0, 635, 620, 618, 621, 634, 622, 0, 621, + 607, 612, 615, 624, 0, 640, 607, 618, 100, 616, + 609, 605, 617, 606, 615, 610, 599, 0, 602, 611, + 601, 596, 608, 603, 592, 605, 588, 590, 599, 0, + 0, 596, 165, 589, 584, 588, 557, 566, 573, 496, + 525, 449, 440, 444, 449, 0, 450, 451, 435, 436, + 456, 422, 387, 394, 358, 356, 387, 371, 364, 351, + 351, 355, 368, 352, 379, 361, 346, 350, 348, 374, + 0, 342, 344, 354, 353, 345, 347, 203, 335, 335, + 337, 354, 327, 322, 0, 320, 324, 0, 317, 322, + + 317, 326, 0, 0, 306, 297, 297, 301, 308, 293, + 287, 318, 263, 246, 251, 249, 236, 267, 248, 250, + 246, 232, 232, 0, 220, 217, 218, 0, 234, 213, + 228, 213, 226, 0, 227, 218, 220, 213, 0, 0, + 219, 215, 197, 209, 204, 204, 0, 205, 201, 208, + 205, 201, 209, 0, 0, 199, 0, 190, 197, 194, + 0, 180, 0, 171, 0, 0, 0, 180, 156, 143, + 145, 0, 133, 143, 123, 0, 0, 925, 598, 602, + 606, 610, 614, 618, 622, 626, 138, 67 } ; -static yyconst short int yy_def[582] = +static yyconst short int yy_def[589] = { 0, - 571, 1, 571, 572, 571, 571, 572, 573, 574, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 571, 571, - 575, 573, 576, 577, 573, 574, 575, 571, 572, 14, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 578, 576, 577, 578, - - 578, 579, 577, 573, 572, 14, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 578, 576, 571, 579, 103, 104, 572, 14, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 578, 163, 571, 580, 579, 573, 572, - 14, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 576, 581, 228, 572, 14, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 579, 572, - 14, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 0, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571 + 578, 1, 578, 579, 578, 578, 579, 580, 581, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 578, 578, + 582, 580, 583, 584, 580, 581, 582, 578, 579, 14, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 585, 583, 584, + + 585, 585, 586, 584, 580, 579, 14, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 585, 583, 578, 586, 104, 105, 579, + 14, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 585, 165, 578, 587, + 586, 580, 579, 14, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 583, 588, 231, 579, + 14, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 586, 579, 14, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 579, 0, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578 } ; -static yyconst short int yy_nxt[970] = +static yyconst short int yy_nxt[977] = { 0, 4, 5, 6, 7, 8, 9, 10, 4, 11, 12, 13, 4, 14, 14, 14, 14, 14, 14, 14, 14, 14, 4, 4, 15, 16, 4, 17, 18, 19, 20, 21, 22, 23, 4, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 4, 4, 4, - 37, 39, 40, 43, 52, 41, 44, 47, 48, 111, - 67, 57, 69, 53, 70, 58, 68, 112, 54, 59, - 102, 55, 75, 76, 45, 49, 50, 50, 50, 50, + 37, 39, 40, 43, 52, 41, 44, 47, 48, 112, + 67, 57, 69, 53, 70, 58, 68, 113, 54, 59, + 103, 55, 75, 76, 45, 49, 50, 50, 50, 50, 50, 50, 50, 50, 50, 56, 60, 61, 62, 63, - 79, 77, 64, 71, 72, 78, 87, 95, 65, 85, + 79, 77, 64, 71, 72, 78, 96, 109, 65, 85, - 80, 73, 92, 86, 93, 97, 81, 39, 40, 88, - 43, 41, 89, 44, 96, 108, 90, 47, 48, 113, - 118, 130, 109, 98, 131, 114, 138, 101, 102, 435, - 119, 45, 99, 101, 102, 142, 226, 102, 164, 143, - 150, 274, 436, 97, 103, 103, 103, 103, 103, 103, - 103, 103, 103, 99, 146, 151, 165, 152, 139, 199, - 252, 98, 359, 147, 378, 385, 360, 570, 457, 386, - 148, 569, 149, 458, 200, 568, 253, 567, 379, 104, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 100, 101, - - 102, 43, 164, 566, 44, 565, 564, 563, 562, 397, - 162, 162, 162, 162, 162, 162, 162, 162, 162, 100, - 165, 388, 45, 398, 403, 501, 389, 561, 560, 390, - 559, 558, 557, 556, 555, 554, 553, 502, 552, 551, - 404, 550, 405, 549, 548, 163, 100, 547, 546, 545, - 544, 543, 542, 541, 540, 539, 538, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 43, 537, 536, 44, - 535, 534, 533, 532, 531, 530, 529, 167, 167, 167, - 167, 167, 167, 167, 167, 167, 167, 45, 528, 167, - 167, 167, 167, 167, 167, 168, 168, 168, 168, 168, - - 168, 168, 168, 168, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 97, 527, 526, 525, 524, 523, 522, 521, - 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, - 98, 520, 225, 225, 225, 225, 225, 225, 571, 226, - 102, 519, 518, 517, 516, 515, 514, 513, 512, 511, - 227, 227, 227, 227, 227, 227, 227, 227, 227, 571, - 510, 509, 508, 507, 506, 505, 504, 503, 500, 499, - 498, 497, 496, 495, 494, 493, 492, 491, 490, 489, - 488, 487, 486, 485, 484, 228, 42, 42, 42, 42, - - 42, 42, 42, 42, 42, 229, 229, 229, 229, 229, - 229, 229, 229, 229, 229, 483, 482, 229, 229, 229, - 229, 229, 229, 230, 230, 230, 230, 230, 230, 230, - 230, 230, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, - 481, 480, 273, 273, 273, 273, 273, 273, 164, 479, - 478, 477, 476, 475, 474, 473, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 165, 472, 275, 275, - 275, 275, 275, 275, 276, 276, 276, 276, 276, 276, - - 276, 276, 276, 277, 277, 277, 277, 277, 277, 277, - 277, 277, 291, 292, 293, 294, 295, 296, 297, 298, - 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 471, 470, 319, 319, 319, 319, 319, 319, 320, 320, - 320, 320, 320, 320, 320, 320, 320, 321, 321, 321, - 321, 321, 321, 321, 321, 321, 350, 350, 350, 350, - 350, 350, 350, 350, 350, 351, 351, 351, 351, 351, - 351, 351, 351, 351, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 402, 402, 402, 402, 402, 402, 402, - 402, 402, 38, 469, 468, 38, 42, 42, 467, 42, - - 46, 46, 46, 46, 47, 47, 47, 47, 43, 43, - 466, 43, 99, 99, 465, 99, 100, 100, 464, 100, - 102, 102, 463, 102, 462, 461, 460, 459, 456, 455, - 454, 453, 452, 451, 450, 449, 448, 447, 446, 445, - 444, 443, 442, 441, 440, 439, 438, 437, 434, 433, - 432, 431, 430, 429, 428, 427, 426, 425, 424, 423, - 422, 421, 420, 419, 418, 417, 416, 415, 414, 413, - 412, 411, 410, 409, 408, 407, 406, 401, 400, 399, - 396, 395, 394, 393, 392, 391, 387, 384, 383, 382, - 381, 380, 377, 49, 375, 374, 373, 372, 371, 354, - - 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, - 358, 357, 356, 355, 354, 353, 352, 349, 348, 347, - 346, 345, 344, 343, 342, 341, 340, 339, 338, 337, - 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, - 326, 325, 324, 323, 322, 318, 317, 316, 315, 314, - 313, 312, 311, 310, 309, 308, 307, 306, 305, 304, - 303, 302, 301, 300, 299, 290, 289, 288, 287, 286, - 285, 284, 283, 282, 281, 280, 279, 278, 272, 271, - 270, 269, 268, 267, 266, 265, 264, 263, 262, 261, - 260, 259, 258, 257, 241, 256, 255, 254, 251, 250, - - 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, - 239, 238, 237, 236, 235, 234, 233, 232, 223, 222, - 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, - 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, - 201, 198, 197, 196, 195, 194, 193, 192, 191, 190, - 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, - 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, - 100, 161, 160, 159, 158, 157, 156, 155, 154, 153, - 145, 144, 141, 140, 137, 136, 135, 134, 133, 132, - 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, - - 117, 116, 115, 110, 107, 48, 100, 48, 94, 91, - 84, 83, 82, 74, 66, 51, 571, 3, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571 + 80, 73, 87, 86, 110, 88, 81, 93, 98, 94, + 39, 40, 139, 97, 41, 89, 43, 114, 90, 44, + 47, 48, 91, 115, 119, 131, 99, 143, 132, 442, + 151, 144, 102, 103, 120, 229, 103, 45, 100, 102, + 103, 278, 443, 166, 140, 152, 255, 153, 201, 98, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 100, + 147, 167, 256, 202, 166, 385, 365, 99, 392, 148, + 366, 577, 393, 576, 575, 395, 149, 574, 150, 386, + 396, 573, 167, 397, 572, 105, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 107, 107, 107, 107, 107, + + 107, 107, 107, 107, 101, 102, 103, 43, 464, 571, + 44, 410, 404, 465, 570, 569, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 101, 405, 411, 45, 412, + 508, 568, 567, 566, 565, 564, 563, 562, 561, 560, + 559, 558, 509, 557, 556, 555, 554, 553, 552, 551, + 550, 165, 101, 549, 548, 547, 546, 545, 544, 543, + 542, 541, 540, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 43, 539, 538, 44, 537, 536, 535, 534, + 533, 532, 531, 169, 169, 169, 169, 169, 169, 169, + 169, 169, 169, 45, 530, 169, 169, 169, 169, 169, + + 169, 170, 170, 170, 170, 170, 170, 170, 170, 170, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 227, + 227, 227, 227, 227, 227, 227, 227, 227, 98, 529, + 528, 527, 526, 525, 524, 523, 228, 228, 228, 228, + 228, 228, 228, 228, 228, 228, 99, 522, 228, 228, + 228, 228, 228, 228, 578, 229, 103, 521, 520, 519, + 518, 517, 516, 515, 514, 513, 230, 230, 230, 230, + 230, 230, 230, 230, 230, 578, 512, 511, 510, 507, + 506, 505, 504, 503, 502, 501, 500, 499, 498, 497, + 496, 495, 494, 493, 492, 491, 490, 489, 488, 487, + + 486, 231, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 485, 484, 232, 232, 232, 232, 232, 232, 233, + 233, 233, 233, 233, 233, 233, 233, 233, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 277, 277, 277, 277, + 277, 277, 277, 277, 277, 277, 483, 482, 277, 277, + 277, 277, 277, 277, 166, 481, 480, 479, 478, 477, + 476, 475, 279, 279, 279, 279, 279, 279, 279, 279, + 279, 279, 167, 474, 279, 279, 279, 279, 279, 279, + + 280, 280, 280, 280, 280, 280, 280, 280, 280, 281, + 281, 281, 281, 281, 281, 281, 281, 281, 295, 296, + 297, 298, 299, 300, 301, 302, 324, 324, 324, 324, + 324, 324, 324, 324, 324, 324, 473, 472, 324, 324, + 324, 324, 324, 324, 325, 325, 325, 325, 325, 325, + 325, 325, 325, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 356, 356, 356, 356, 356, 356, 356, 356, + 356, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 38, 471, + + 470, 38, 42, 42, 469, 42, 46, 46, 46, 46, + 47, 47, 47, 47, 43, 43, 468, 43, 100, 100, + 467, 100, 101, 101, 466, 101, 103, 103, 463, 103, + 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, + 452, 451, 450, 449, 448, 447, 446, 445, 444, 441, + 440, 439, 438, 437, 436, 435, 434, 433, 432, 431, + 430, 429, 428, 427, 426, 425, 424, 423, 422, 421, + 420, 419, 418, 417, 416, 415, 414, 413, 408, 407, + 406, 403, 402, 401, 400, 399, 398, 394, 391, 390, + 389, 388, 387, 384, 49, 382, 381, 380, 379, 378, + + 377, 360, 376, 375, 374, 373, 372, 371, 370, 369, + 368, 367, 364, 363, 362, 361, 360, 359, 358, 355, + 354, 353, 352, 351, 350, 349, 348, 347, 346, 345, + 344, 343, 342, 341, 340, 339, 338, 337, 336, 335, + 334, 333, 332, 331, 330, 329, 328, 327, 323, 322, + 321, 320, 319, 318, 317, 316, 315, 314, 313, 312, + 311, 310, 309, 308, 307, 306, 305, 304, 303, 294, + 293, 292, 291, 290, 289, 288, 287, 286, 285, 284, + 283, 282, 276, 275, 274, 273, 272, 271, 270, 269, + 268, 267, 266, 265, 264, 263, 262, 261, 260, 244, + + 259, 258, 257, 254, 253, 252, 251, 250, 249, 248, + 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, + 237, 236, 235, 226, 225, 224, 223, 222, 221, 220, + 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, + 209, 208, 207, 206, 205, 204, 203, 200, 199, 198, + 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, + 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, + 177, 176, 175, 174, 173, 172, 101, 163, 162, 161, + 160, 159, 158, 157, 156, 155, 154, 146, 145, 142, + 141, 138, 137, 136, 135, 134, 133, 130, 129, 128, + + 127, 126, 125, 124, 123, 122, 121, 118, 117, 116, + 111, 108, 48, 101, 48, 95, 92, 84, 83, 82, + 74, 66, 51, 578, 3, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578 } ; -static yyconst short int yy_chk[970] = +static yyconst short int yy_chk[977] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -651,105 +652,106 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 8, 16, 5, 8, 9, 9, 54, 21, 18, 22, 16, 22, 18, 21, 54, 17, 18, - 581, 17, 25, 25, 8, 14, 14, 14, 14, 14, + 588, 17, 25, 25, 8, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 17, 19, 19, 19, 19, - 27, 26, 19, 23, 23, 26, 32, 36, 19, 31, + 27, 26, 19, 23, 23, 26, 36, 52, 19, 31, - 27, 23, 34, 31, 34, 43, 27, 39, 39, 32, - 42, 39, 32, 42, 36, 52, 32, 46, 46, 56, - 60, 73, 52, 43, 73, 56, 80, 101, 101, 412, - 60, 42, 45, 45, 45, 83, 226, 226, 102, 83, - 87, 580, 412, 273, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 86, 87, 102, 87, 80, 138, - 200, 273, 329, 86, 355, 361, 329, 568, 436, 361, - 86, 567, 86, 436, 138, 566, 200, 564, 355, 45, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 98, 98, - - 98, 229, 319, 563, 229, 562, 561, 557, 555, 371, - 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, - 319, 363, 229, 371, 377, 481, 363, 553, 552, 363, - 551, 549, 546, 545, 544, 543, 542, 481, 541, 539, - 377, 538, 377, 537, 536, 98, 103, 535, 534, 531, - 530, 529, 528, 526, 525, 524, 523, 103, 103, 103, - 103, 103, 103, 103, 103, 103, 104, 522, 520, 104, - 519, 518, 516, 515, 514, 513, 512, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 511, 104, - 104, 104, 104, 104, 104, 105, 105, 105, 105, 105, - - 105, 105, 105, 105, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 163, 510, 509, 508, 507, 506, 505, 504, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 503, 163, 163, 163, 163, 163, 163, 165, 165, - 165, 502, 501, 500, 499, 498, 495, 494, 493, 492, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 490, 489, 487, 486, 485, 484, 483, 482, 480, 479, - 478, 477, 476, 475, 473, 472, 471, 470, 469, 468, - 467, 466, 465, 464, 463, 165, 166, 166, 166, 166, - - 166, 166, 166, 166, 166, 167, 167, 167, 167, 167, - 167, 167, 167, 167, 167, 462, 461, 167, 167, 167, - 167, 167, 167, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 224, 224, 224, 224, 224, 224, 224, 224, 224, - 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, - 460, 459, 225, 225, 225, 225, 225, 225, 228, 458, - 457, 456, 455, 454, 453, 452, 228, 228, 228, 228, - 228, 228, 228, 228, 228, 228, 228, 451, 228, 228, - 228, 228, 228, 228, 230, 230, 230, 230, 230, 230, - - 230, 230, 230, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 249, 249, 249, 249, 249, 249, 249, 249, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 450, 448, 275, 275, 275, 275, 275, 275, 276, 276, - 276, 276, 276, 276, 276, 276, 276, 277, 277, 277, - 277, 277, 277, 277, 277, 277, 320, 320, 320, 320, - 320, 320, 320, 320, 320, 321, 321, 321, 321, 321, - 321, 321, 321, 321, 350, 350, 350, 350, 350, 350, - 350, 350, 350, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 572, 447, 446, 572, 573, 573, 445, 573, - - 574, 574, 574, 574, 575, 575, 575, 575, 576, 576, - 444, 576, 577, 577, 443, 577, 578, 578, 442, 578, - 579, 579, 441, 579, 440, 439, 438, 437, 435, 432, - 431, 430, 429, 428, 427, 426, 425, 424, 423, 422, - 420, 419, 418, 417, 416, 415, 414, 413, 411, 410, - 409, 407, 406, 405, 404, 403, 401, 400, 399, 398, - 397, 396, 393, 392, 391, 390, 389, 388, 386, 385, - 384, 383, 382, 381, 380, 379, 378, 375, 373, 372, - 370, 369, 368, 366, 365, 364, 362, 360, 359, 358, - 357, 356, 352, 351, 347, 346, 345, 344, 343, 342, - - 341, 340, 339, 338, 336, 335, 334, 332, 331, 330, - 328, 327, 326, 325, 324, 323, 322, 318, 317, 316, - 315, 313, 311, 310, 309, 308, 307, 306, 305, 304, - 302, 301, 300, 299, 289, 288, 287, 286, 285, 284, - 282, 281, 280, 279, 278, 271, 270, 269, 268, 267, - 266, 265, 264, 263, 262, 260, 259, 257, 256, 255, - 254, 253, 252, 251, 250, 248, 247, 246, 244, 243, - 242, 240, 238, 237, 236, 235, 234, 232, 223, 222, - 221, 219, 218, 217, 216, 215, 214, 213, 212, 211, - 210, 209, 207, 205, 204, 203, 202, 201, 199, 197, - - 195, 194, 192, 191, 189, 186, 185, 184, 183, 180, - 179, 178, 175, 174, 173, 172, 171, 170, 161, 160, - 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, - 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, - 139, 137, 136, 135, 133, 132, 131, 130, 129, 128, - 127, 126, 125, 124, 123, 121, 120, 119, 118, 117, - 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, - 99, 96, 95, 94, 93, 92, 91, 90, 89, 88, - 85, 84, 82, 81, 79, 78, 77, 76, 75, 74, - 72, 70, 69, 68, 67, 65, 64, 63, 62, 61, - - 59, 58, 57, 53, 51, 47, 44, 41, 35, 33, - 30, 29, 28, 24, 20, 15, 3, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571 + 27, 23, 32, 31, 52, 32, 27, 34, 43, 34, + 39, 39, 80, 36, 39, 32, 42, 56, 32, 42, + 46, 46, 32, 56, 60, 73, 43, 83, 73, 419, + 87, 83, 102, 102, 60, 229, 229, 42, 45, 45, + 45, 587, 419, 103, 80, 87, 202, 87, 139, 277, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 86, 103, 202, 139, 324, 361, 334, 277, 367, 86, + 334, 575, 367, 574, 573, 369, 86, 571, 86, 361, + 369, 570, 324, 369, 569, 45, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, + + 50, 50, 50, 50, 99, 99, 99, 232, 443, 568, + 232, 384, 377, 443, 564, 562, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 377, 384, 232, 384, + 488, 560, 559, 558, 556, 553, 552, 551, 550, 549, + 548, 546, 488, 545, 544, 543, 542, 541, 538, 537, + 536, 99, 104, 535, 533, 532, 531, 530, 529, 527, + 526, 525, 523, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 105, 522, 521, 105, 520, 519, 518, 517, + 516, 515, 514, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 513, 105, 105, 105, 105, 105, + + 105, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 165, 512, + 511, 510, 509, 508, 507, 506, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 505, 165, 165, + 165, 165, 165, 165, 167, 167, 167, 502, 501, 500, + 499, 497, 496, 494, 493, 492, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 491, 490, 489, 487, + 486, 485, 484, 483, 482, 480, 479, 478, 477, 476, + 475, 474, 473, 472, 471, 470, 469, 468, 467, 466, + + 465, 167, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 169, 169, 169, 169, 169, 169, 169, 169, 169, + 169, 464, 463, 169, 169, 169, 169, 169, 169, 170, + 170, 170, 170, 170, 170, 170, 170, 170, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 227, 227, 227, + 227, 227, 227, 227, 227, 227, 228, 228, 228, 228, + 228, 228, 228, 228, 228, 228, 462, 461, 228, 228, + 228, 228, 228, 228, 231, 460, 459, 458, 457, 455, + 454, 453, 231, 231, 231, 231, 231, 231, 231, 231, + 231, 231, 231, 452, 231, 231, 231, 231, 231, 231, + + 233, 233, 233, 233, 233, 233, 233, 233, 233, 234, + 234, 234, 234, 234, 234, 234, 234, 234, 252, 252, + 252, 252, 252, 252, 252, 252, 279, 279, 279, 279, + 279, 279, 279, 279, 279, 279, 451, 450, 279, 279, + 279, 279, 279, 279, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 281, 281, 281, 281, 281, 281, 281, + 281, 281, 325, 325, 325, 325, 325, 325, 325, 325, + 325, 326, 326, 326, 326, 326, 326, 326, 326, 326, + 356, 356, 356, 356, 356, 356, 356, 356, 356, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 579, 449, + + 448, 579, 580, 580, 447, 580, 581, 581, 581, 581, + 582, 582, 582, 582, 583, 583, 446, 583, 584, 584, + 445, 584, 585, 585, 444, 585, 586, 586, 442, 586, + 439, 438, 437, 436, 435, 434, 433, 432, 431, 430, + 429, 427, 426, 425, 424, 423, 422, 421, 420, 418, + 417, 416, 414, 413, 412, 411, 410, 408, 407, 406, + 405, 404, 403, 400, 399, 398, 397, 396, 395, 393, + 392, 391, 390, 389, 388, 387, 386, 385, 382, 380, + 378, 376, 375, 374, 372, 371, 370, 368, 366, 365, + 364, 363, 362, 358, 357, 353, 352, 351, 350, 349, + + 348, 347, 346, 345, 344, 343, 341, 340, 339, 337, + 336, 335, 333, 332, 331, 330, 329, 328, 327, 323, + 322, 321, 320, 318, 316, 315, 314, 313, 312, 311, + 310, 309, 308, 306, 305, 304, 303, 293, 292, 291, + 290, 289, 288, 286, 285, 284, 283, 282, 275, 274, + 273, 272, 271, 270, 269, 268, 267, 266, 265, 263, + 262, 260, 259, 258, 257, 256, 255, 254, 253, 251, + 250, 249, 247, 246, 245, 243, 241, 240, 239, 238, + 237, 235, 226, 225, 224, 222, 221, 220, 219, 218, + 217, 216, 215, 214, 213, 212, 211, 209, 207, 206, + + 205, 204, 203, 201, 199, 197, 196, 194, 193, 191, + 188, 187, 186, 185, 182, 181, 180, 177, 176, 175, + 174, 173, 172, 163, 162, 161, 160, 159, 158, 157, + 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, + 146, 145, 144, 143, 142, 141, 140, 138, 137, 136, + 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, + 124, 122, 121, 120, 119, 118, 117, 116, 115, 114, + 113, 112, 111, 110, 109, 108, 100, 97, 96, 95, + 94, 93, 92, 91, 90, 89, 88, 85, 84, 82, + 81, 79, 78, 77, 76, 75, 74, 72, 70, 69, + + 68, 67, 65, 64, 63, 62, 61, 59, 58, 57, + 53, 51, 47, 44, 41, 35, 33, 30, 29, 28, + 24, 20, 15, 3, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578 } ; static yy_state_type yy_last_accepting_state; @@ -1104,13 +1106,13 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 572 ) + if ( yy_current_state >= 579 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 918 ); + while ( yy_base[yy_current_state] != 925 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1374,231 +1376,236 @@ case 48: YY_RULE_SETUP #line 191 "lexer.l" -{ lr_bispa= bispa_none; lr_bisexec= bisexec_reset; lr_dir= df_reset; return tokv_word_reset; } +{ lr_bispa= bispa_none; lr_bisexec= bisexec_shutdown; return tokv_word_shutdown; } YY_BREAK case 49: YY_RULE_SETUP #line 192 "lexer.l" -{ lr_bispa= bispa_none; lr_bisexec= bisexec_execute; lr_dir= df_execute; return tokv_word_execute; } +{ lr_bispa= bispa_none; lr_bisexec= bisexec_reset; lr_dir= df_reset; return tokv_word_reset; } YY_BREAK case 50: YY_RULE_SETUP #line 193 "lexer.l" -{ lr_bispa= bispa_none; lr_bisexec= bisexec_help; return tokv_word_help; } +{ lr_bispa= bispa_none; lr_bisexec= bisexec_execute; lr_dir= df_execute; return tokv_word_execute; } YY_BREAK case 51: YY_RULE_SETUP #line 194 "lexer.l" -{ lr_parameter= pf_service; return tokv_word_service; } +{ lr_bispa= bispa_none; lr_bisexec= bisexec_help; return tokv_word_help; } YY_BREAK case 52: YY_RULE_SETUP #line 195 "lexer.l" -{ lr_parameter= pf_callinguser; return tokv_word_callinguser; } +{ lr_parameter= pf_service; return tokv_word_service; } YY_BREAK case 53: YY_RULE_SETUP #line 196 "lexer.l" -{ lr_parameter= pf_callinggroup; return tokv_word_callinggroup; } +{ lr_parameter= pf_callinguser; return tokv_word_callinguser; } YY_BREAK case 54: YY_RULE_SETUP #line 197 "lexer.l" -{ lr_parameter= pf_callingusershell; return tokv_word_callingusershell; } +{ lr_parameter= pf_callinggroup; return tokv_word_callinggroup; } YY_BREAK case 55: YY_RULE_SETUP #line 198 "lexer.l" -{ lr_parameter= pf_serviceuser; return tokv_word_serviceuser; } +{ lr_parameter= pf_callingusershell; return tokv_word_callingusershell; } YY_BREAK case 56: YY_RULE_SETUP #line 199 "lexer.l" -{ lr_parameter= pf_servicegroup; return tokv_word_servicegroup; } +{ lr_parameter= pf_serviceuser; return tokv_word_serviceuser; } YY_BREAK case 57: YY_RULE_SETUP #line 200 "lexer.l" -{ lr_parameter= pf_serviceusershell; return tokv_word_serviceusershell; } +{ lr_parameter= pf_servicegroup; return tokv_word_servicegroup; } YY_BREAK case 58: YY_RULE_SETUP #line 201 "lexer.l" -{ lr_loglevel= LOG_DEBUG; return tokv_syslog_debug; } +{ lr_parameter= pf_serviceusershell; return tokv_word_serviceusershell; } YY_BREAK case 59: YY_RULE_SETUP #line 202 "lexer.l" -{ lr_loglevel= LOG_INFO; return tokv_syslog_info; } +{ lr_loglevel= LOG_DEBUG; return tokv_syslog_debug; } YY_BREAK case 60: YY_RULE_SETUP #line 203 "lexer.l" -{ lr_loglevel= LOG_NOTICE; return tokv_syslog_notice; } +{ lr_loglevel= LOG_INFO; return tokv_syslog_info; } YY_BREAK case 61: YY_RULE_SETUP #line 204 "lexer.l" -{ lr_loglevel= LOG_WARNING; return tokv_syslog_warning; } +{ lr_loglevel= LOG_NOTICE; return tokv_syslog_notice; } YY_BREAK case 62: YY_RULE_SETUP #line 205 "lexer.l" -{ lr_loglevel= LOG_ERR; return tokv_syslog_err; } +{ lr_loglevel= LOG_WARNING; return tokv_syslog_warning; } YY_BREAK case 63: YY_RULE_SETUP #line 206 "lexer.l" -{ lr_loglevel= LOG_CRIT; return tokv_syslog_crit; } +{ lr_loglevel= LOG_ERR; return tokv_syslog_err; } YY_BREAK case 64: YY_RULE_SETUP #line 207 "lexer.l" -{ lr_loglevel= LOG_ALERT; return tokv_syslog_alert; } +{ lr_loglevel= LOG_CRIT; return tokv_syslog_crit; } YY_BREAK case 65: YY_RULE_SETUP #line 208 "lexer.l" -{ lr_loglevel= LOG_EMERG; return tokv_syslog_emerg; } +{ lr_loglevel= LOG_ALERT; return tokv_syslog_alert; } YY_BREAK case 66: YY_RULE_SETUP #line 209 "lexer.l" -{ lr_logfacility= LOG_AUTHPRIV; return tokv_syslog_authpriv; } +{ lr_loglevel= LOG_EMERG; return tokv_syslog_emerg; } YY_BREAK case 67: YY_RULE_SETUP #line 210 "lexer.l" -{ lr_logfacility= LOG_CRON; return tokv_syslog_cron; } +{ lr_logfacility= LOG_AUTHPRIV; return tokv_syslog_authpriv; } YY_BREAK case 68: YY_RULE_SETUP #line 211 "lexer.l" -{ lr_logfacility= LOG_DAEMON; return tokv_syslog_daemon; } +{ lr_logfacility= LOG_CRON; return tokv_syslog_cron; } YY_BREAK case 69: YY_RULE_SETUP #line 212 "lexer.l" -{ lr_logfacility= LOG_KERN; return tokv_syslog_kern; } +{ lr_logfacility= LOG_DAEMON; return tokv_syslog_daemon; } YY_BREAK case 70: YY_RULE_SETUP #line 213 "lexer.l" -{ lr_logfacility= LOG_LPR; return tokv_syslog_lpr; } +{ lr_logfacility= LOG_KERN; return tokv_syslog_kern; } YY_BREAK case 71: YY_RULE_SETUP #line 214 "lexer.l" -{ lr_logfacility= LOG_MAIL; return tokv_syslog_mail; } +{ lr_logfacility= LOG_LPR; return tokv_syslog_lpr; } YY_BREAK case 72: YY_RULE_SETUP #line 215 "lexer.l" -{ lr_logfacility= LOG_NEWS; return tokv_syslog_news; } +{ lr_logfacility= LOG_MAIL; return tokv_syslog_mail; } YY_BREAK case 73: YY_RULE_SETUP #line 216 "lexer.l" -{ lr_logfacility= LOG_SYSLOG; return tokv_syslog_syslog; } +{ lr_logfacility= LOG_NEWS; return tokv_syslog_news; } YY_BREAK case 74: YY_RULE_SETUP #line 217 "lexer.l" -{ lr_logfacility= LOG_USER; return tokv_syslog_user; } +{ lr_logfacility= LOG_SYSLOG; return tokv_syslog_syslog; } YY_BREAK case 75: YY_RULE_SETUP #line 218 "lexer.l" -{ lr_logfacility= LOG_UUCP; return tokv_syslog_uucp; } +{ lr_logfacility= LOG_USER; return tokv_syslog_user; } YY_BREAK case 76: YY_RULE_SETUP #line 219 "lexer.l" -{ lr_logfacility= LOG_LOCAL0; return tokv_syslog_local0; } +{ lr_logfacility= LOG_UUCP; return tokv_syslog_uucp; } YY_BREAK case 77: YY_RULE_SETUP #line 220 "lexer.l" -{ lr_logfacility= LOG_LOCAL1; return tokv_syslog_local1; } +{ lr_logfacility= LOG_LOCAL0; return tokv_syslog_local0; } YY_BREAK case 78: YY_RULE_SETUP #line 221 "lexer.l" -{ lr_logfacility= LOG_LOCAL2; return tokv_syslog_local2; } +{ lr_logfacility= LOG_LOCAL1; return tokv_syslog_local1; } YY_BREAK case 79: YY_RULE_SETUP #line 222 "lexer.l" -{ lr_logfacility= LOG_LOCAL3; return tokv_syslog_local3; } +{ lr_logfacility= LOG_LOCAL2; return tokv_syslog_local2; } YY_BREAK case 80: YY_RULE_SETUP #line 223 "lexer.l" -{ lr_logfacility= LOG_LOCAL4; return tokv_syslog_local4; } +{ lr_logfacility= LOG_LOCAL3; return tokv_syslog_local3; } YY_BREAK case 81: YY_RULE_SETUP #line 224 "lexer.l" -{ lr_logfacility= LOG_LOCAL5; return tokv_syslog_local5; } +{ lr_logfacility= LOG_LOCAL4; return tokv_syslog_local4; } YY_BREAK case 82: YY_RULE_SETUP #line 225 "lexer.l" -{ lr_logfacility= LOG_LOCAL6; return tokv_syslog_local6; } +{ lr_logfacility= LOG_LOCAL5; return tokv_syslog_local5; } YY_BREAK case 83: YY_RULE_SETUP #line 226 "lexer.l" -{ lr_logfacility= LOG_LOCAL7; return tokv_syslog_local7; } +{ lr_logfacility= LOG_LOCAL6; return tokv_syslog_local6; } YY_BREAK case 84: YY_RULE_SETUP #line 227 "lexer.l" -{ return tokv_word_read; } +{ lr_logfacility= LOG_LOCAL7; return tokv_syslog_local7; } YY_BREAK case 85: YY_RULE_SETUP #line 228 "lexer.l" -{ return tokv_word_write; } +{ return tokv_word_read; } YY_BREAK case 86: YY_RULE_SETUP #line 229 "lexer.l" -{ return tokv_dollar; } +{ return tokv_word_write; } YY_BREAK case 87: YY_RULE_SETUP #line 230 "lexer.l" -{ return tokv_openparen; } +{ return tokv_dollar; } YY_BREAK case 88: YY_RULE_SETUP #line 231 "lexer.l" -{ return tokv_closeparen; } +{ return tokv_openparen; } YY_BREAK case 89: YY_RULE_SETUP #line 232 "lexer.l" -{ return tokv_not; } +{ return tokv_closeparen; } YY_BREAK case 90: YY_RULE_SETUP #line 233 "lexer.l" -{ return tokv_and; } +{ return tokv_not; } YY_BREAK case 91: YY_RULE_SETUP #line 234 "lexer.l" -{ return tokv_or; } +{ return tokv_and; } YY_BREAK case 92: YY_RULE_SETUP #line 235 "lexer.l" -{ lr_dir= df_error; lr_loglevel= LOG_ERR; return tokv_word_error; } +{ return tokv_or; } YY_BREAK case 93: +YY_RULE_SETUP +#line 236 "lexer.l" +{ lr_dir= df_error; lr_loglevel= LOG_ERR; return tokv_word_error; } + YY_BREAK +case 94: YY_RULE_SETUP -#line 239 "lexer.l" +#line 240 "lexer.l" { char *ep; lr_min=lr_max= (int)strtoul(yytext,&ep,10); @@ -1606,9 +1613,9 @@ return tokv_ordinal; } YY_BREAK -case 94: +case 95: YY_RULE_SETUP -#line 245 "lexer.l" +#line 246 "lexer.l" { char *ep; lr_min= (int)strtoul(yytext,&ep,10); @@ -1623,9 +1630,9 @@ return tokv_fdrange; } YY_BREAK -case 95: +case 96: YY_RULE_SETUP -#line 258 "lexer.l" +#line 259 "lexer.l" { char *ep; lr_min= (int)strtoul(yytext,&ep,10); @@ -1635,15 +1642,10 @@ return tokv_fdstoend; } YY_BREAK -case 96: -YY_RULE_SETUP -#line 266 "lexer.l" -return tokv_lwsp; - YY_BREAK case 97: YY_RULE_SETUP #line 267 "lexer.l" -cstate->lineno++; return tokv_newline; +return tokv_lwsp; YY_BREAK case 98: YY_RULE_SETUP @@ -1653,38 +1655,43 @@ case 99: YY_RULE_SETUP #line 269 "lexer.l" +cstate->lineno++; return tokv_newline; + YY_BREAK +case 100: +YY_RULE_SETUP +#line 270 "lexer.l" { parseerrprint("missing newline at eof after comment"); return tokv_error; } YY_BREAK -case 100: +case 101: YY_RULE_SETUP -#line 273 "lexer.l" +#line 274 "lexer.l" { return dequote(yytext); } YY_BREAK -case 101: +case 102: YY_RULE_SETUP -#line 276 "lexer.l" +#line 277 "lexer.l" { parseerrprint("misquoted or unterminated string"); return tokv_error; } YY_BREAK -case 102: +case 103: YY_RULE_SETUP -#line 280 "lexer.l" +#line 281 "lexer.l" return tokv_barestring; YY_BREAK case YY_STATE_EOF(INITIAL): -#line 281 "lexer.l" +#line 282 "lexer.l" return tokv_eof; YY_BREAK -case 103: +case 104: YY_RULE_SETUP -#line 284 "lexer.l" +#line 285 "lexer.l" ECHO; YY_BREAK @@ -1976,7 +1983,7 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 572 ) + if ( yy_current_state >= 579 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2011,11 +2018,11 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 572 ) + if ( yy_current_state >= 579 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 571); + yy_is_jam = (yy_current_state == 578); return yy_is_jam ? 0 : yy_current_state; } @@ -2570,7 +2577,7 @@ return 0; } #endif -#line 284 "lexer.l" +#line 285 "lexer.l" const char *const builtinservicehelpstrings[]= { @@ -2579,6 +2586,7 @@ "version", "toplevel", "override", + "shutdown", "reset", "execute", "help", Index: userv/lexer.l diff -u userv/lexer.l:1.1 userv/lexer.l:1.2 --- userv/lexer.l:1.1 Sun Apr 18 19:15:17 1999 +++ userv/lexer.l Thu May 20 00:13:52 1999 @@ -188,6 +188,7 @@ version { lr_bispa= bispa_none; lr_bisexec= bisexec_version; return tokv_word_version; } toplevel { lr_bispa= bispa_none; lr_bisexec= bisexec_toplevel; return tokv_word_toplevel; } override { lr_bispa= bispa_none; lr_bisexec= bisexec_override; return tokv_word_override; } +shutdown { lr_bispa= bispa_none; lr_bisexec= bisexec_shutdown; return tokv_word_shutdown; } reset { lr_bispa= bispa_none; lr_bisexec= bisexec_reset; lr_dir= df_reset; return tokv_word_reset; } execute { lr_bispa= bispa_none; lr_bisexec= bisexec_execute; lr_dir= df_execute; return tokv_word_execute; } help { lr_bispa= bispa_none; lr_bisexec= bisexec_help; return tokv_word_help; } @@ -289,6 +290,7 @@ "version", "toplevel", "override", + "shutdown", "reset", "execute", "help", Index: userv/lib.c diff -u userv/lib.c:1.5 userv/lib.c:1.6 --- userv/lib.c:1.5 Wed Apr 7 23:33:44 1999 +++ userv/lib.c Wed May 19 22:03:33 1999 @@ -116,14 +116,10 @@ #ifndef HAVE_SETENV int setenv(const char *name, const char *value, int overwrite) { - static char *buffer= 0; - static int avail= 0; - - int r; + char *buffer= 0; assert(overwrite==1); - r= makeroom(&buffer,&avail,strlen(name)+strlen(value)+2); - if (r) { errno= EINVAL; return -1; } + buffer= xmalloc(strlen(name)+strlen(value)+2); sprintf(buffer,"%s=%s",name,value); return putenv(buffer); Index: userv/overlord.c diff -u userv/overlord.c:1.6 userv/overlord.c:1.7 --- userv/overlord.c:1.6 Wed Apr 7 23:33:47 1999 +++ userv/overlord.c Thu May 20 00:13:54 1999 @@ -43,7 +43,7 @@ pid_t overlordpid; static pid_t checkpid= -1, detachpid= -1; -static sig_atomic_t needcheck= 1; +static sig_atomic_t needcheck= 1; /* 2 means we half-expect the server to be down */ static void checkstalepipes(void) { /* There is an unimportant race here. If there is a stale pipe but @@ -128,11 +128,14 @@ } else if (!WIFEXITED(status)) { syslog(LOG_ERR,"call pid %ld died due to unknown reason, code %d", (long)r,status); + } else if (WEXITSTATUS(status)==10) { + needcheck= 2; } else if (WEXITSTATUS(status)>12) { if (WEXITSTATUS(status)>24) syslog(LOG_ERR,"call pid %ld exited with status %d >24", (long)r,WEXITSTATUS(status)); checkstalepipes(); + needcheck= 1; } } } @@ -165,7 +168,7 @@ r= sigprocmask(how,&set,0); assert(!r); } -static void NONRETURNING docheck(void) { +static void NONRETURNING docheck(int needwanted) { #ifndef DEBUG /* This subprocess exits with status 0 if the parent should die, * 1 if it should not, and something else if it fails horribly. @@ -197,8 +200,11 @@ r= connect(sfd,(struct sockaddr*)&ssockname,sizeof(ssockname)); if (r) { - if (errno == ECONNREFUSED || errno == ENOENT) - { syslog(LOG_WARNING,"real uservd daemon is not running: %m"); exit(0); } + if (errno == ECONNREFUSED || errno == ENOENT) { + if (needwanted != 2) + syslog(LOG_WARNING,"real uservd daemon is not running: %m"); + exit(0); + } syslog(LOG_ERR,"unable to connect to uservd daemon: %m"); exit(1); } @@ -340,11 +346,10 @@ for (;;) { if (needcheck) { - assert(checkpid==-1); - for (;;) { + while (checkpid==-1) { checkpid= fork(); if (checkpid!=-1) { - if (!checkpid) docheck(); + if (!checkpid) docheck(needcheck); break; } else if (errno==EAGAIN) { syslog(LOG_ERR,"fork for check - will wait and retry: %m"); Index: userv/process.c diff -u userv/process.c:1.9 userv/process.c:1.10 --- userv/process.c:1.9 Wed Apr 7 23:33:50 1999 +++ userv/process.c Thu May 20 00:13:55 1999 @@ -271,8 +271,18 @@ _exit(exitstatus); } -static void NONRETURNING sighandler_chld(int ignored) { +static void reporttermination(int status) { struct progress_msg progress_mbuf; + + memset(&progress_mbuf,0,sizeof(progress_mbuf)); + progress_mbuf.magic= PROGRESS_MAGIC; + progress_mbuf.type= pt_terminated; + progress_mbuf.data.terminated.status= status; + xfwrite(&progress_mbuf,sizeof(progress_mbuf),swfile); + xfflush(swfile); +} + +static void NONRETURNING sighandler_chld(int ignored) { int status; pid_t returned; @@ -281,14 +291,8 @@ if (!returned) syscallerror("spurious sigchld"); if (returned!=child) syscallerror("spurious child process"); child= childtokill= -1; - - memset(&progress_mbuf,0,sizeof(progress_mbuf)); - progress_mbuf.magic= PROGRESS_MAGIC; - progress_mbuf.type= pt_terminated; - progress_mbuf.data.terminated.status= status; - xfwrite(&progress_mbuf,sizeof(progress_mbuf),swfile); - xfflush(swfile); + reporttermination(status); syslog(LOG_INFO,"service completed (status %d %d)",(status>>8)&0x0ff,status&0x0ff); _exit(0); } @@ -745,6 +749,18 @@ getevent(&event_mbuf); assert(event_mbuf.type == et_confirm); + + if (execbuiltin == bisexec_shutdown && !serviceuser_uid) { + /* The check for the uid is just so we can give a nice + * error message (in the actual code for bisexec_shutdown). + * If this is spoofed somehow then the unlink() will simply fail. + */ + r= unlink(RENDEZVOUSPATH); + if (r) syscallfailure("remove rendezvous socket %s",RENDEZVOUSPATH); + syslog(LOG_NOTICE,"arranging for termination, due to client request"); + reporttermination(0); + _exit(10); + } fork_service_synch(); Index: userv/servexec.c diff -u userv/servexec.c:1.10 userv/servexec.c:1.11 --- userv/servexec.c:1.10 Thu Apr 8 00:43:15 1999 +++ userv/servexec.c Thu May 20 00:13:57 1999 @@ -137,6 +137,15 @@ serv_checkstdoutexit(); } +void bisexec_shutdown(const char *const *argv) { + /* This is only reached if the serviceuser_uid test in + * process.c:servicerequest() fails (we have to handle the + * shutdown request there, unfortunately). + */ + fputs("uservd: builtin service shutdown: permission denied\n",stderr); + _exit(-1); +} + static void serv_resetsignal(int signo) { struct sigaction sig; Index: userv/spec.sgml diff -u userv/spec.sgml:1.9 userv/spec.sgml:1.10 --- userv/spec.sgml:1.9 Sun Apr 18 20:09:44 1999 +++ userv/spec.sgml Thu May 20 00:13:58 1999 @@ -30,7 +30,7 @@ along with + Introduction

@@ -954,10 +954,13 @@ Displays a list of the understood builtin service names and arguments. - -In the future other builtin services may be defined which do more than -just print information. + +Arranges for the Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from ursa.cus.cam.ac.uk [131.111.8.6] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10kPiJ-00083m-00 (Debian); Thu, 20 May 1999 11:06:07 +0100 Received: from bjh21 (helo=localhost) by ursa.cus.cam.ac.uk with local-smtp (Exim 3.01 #3) id 10kPiH-0005sa-00; Thu, 20 May 1999 11:06:05 +0100 Date: Thu, 20 May 1999 11:06:05 +0100 (BST) From: Ben Harris To: Ian Jackson cc: userv-discuss@chiark.greenend.org.uk Subject: Re: Pidfiles (fwd) In-Reply-To: <14147.18136.474318.9354@anarres.relativity.greenend.org.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Ben Harris On Thu, 20 May 1999, Ian Jackson wrote: > I think I've added the relevant things to make `-B shutdown' work. > > A long patch (against 0.62) is below. Can you try it and see if it > does what you want ? (I've also included the putenv fix, you'll > find.) Will do. > NB that of course if you are using different copies of the actual > uservd binary (rather than hardlinks) you can use Debian's > start-stop-daemon to reliably kill the right process(es). In our case, they'll actually be loopback mounts of the same uservd (under Solaris), and as far as I can tell these behave pretty much like hard links, which is a pity, as I don't know we yet have a means of selectively killing the right inetd. -- Ben Harris Unix Support, University of Cambridge Computing Service. E-mail: bjh21@cam.ac.uk Tel: +44 (0)1223 334728 Fax: +44 (0)1223 334679 From owner-mailman@chiark.greenend.org.uk Thu Jun 10 13:59:15 1999 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from ursa.cus.cam.ac.uk [131.111.8.6] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 10s4QM-0004iv-00 (Debian); Thu, 10 Jun 1999 13:59:14 +0100 Received: from bjh21 (helo=localhost) by ursa.cus.cam.ac.uk with local-smtp (Exim 3.02 #4) id 10s4QG-0006lE-00 for userv-discuss@chiark.greenend.org.uk; Thu, 10 Jun 1999 13:59:08 +0100 Date: Thu, 10 Jun 1999 13:59:08 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: Minor doc bug Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Ben Harris The PostScript version of the userv spec (version 0.58) on the Web at seems to have a spurious page throw between the following two lines of the contents: 2. Client program usage 4 2.1. Options 4 This makes the printed version of the spec a little strange. -- Ben Harris Unix Support, University of Cambridge Computing Service. E-mail: bjh21@cam.ac.uk Tel: +44 (0)1223 334728 Fax: +44 (0)1223 334679 From owner-mailman@chiark.greenend.org.uk Mon Jun 21 00:35:28 1999 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from 376d7aae.4cea4.63cb.1.bsmtp.davenant.greenend.org.uk by chiark.greenend.org.uk with local-bsmtp (Exim 2.02 #1) id 10vr7Y-0006eQ-00 (Debian); Mon, 21 Jun 1999 00:35:28 +0100 Received: from anarres.relativity.greenend.org.uk [172.18.45.2] (mail) by davenant.greenend.org.uk with esmtp (Exim 2.125 #2) id 10vmIi-0000Gd-00 (Debian); Sun, 20 Jun 1999 19:26:40 +0100 Received: from ian by anarres.relativity.greenend.org.uk with local (Exim 2.125 #2) id 10vmIi-0001eR-00 (Debian); Sun, 20 Jun 1999 19:26:40 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14189.12896.111900.447266@anarres.relativity.greenend.org.uk> Date: Sun, 20 Jun 1999 19:26:40 +0100 (BST) To: Ben Harris Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: Minor doc bug In-Reply-To: References: X-Mailer: VM 6.62 under Emacs 19.34.1 Ben Harris writes ("Minor doc bug"): > The PostScript version of the userv spec (version 0.58) on the Web at > seems to > have a spurious page throw between the following two lines of the > contents: > > 2. Client program usage 4 > > 2.1. Options 4 > > This makes the printed version of the spec a little strange. This seems to have gone away due to upgrades to my Lout (the typesetter I'm using), or perhaps due to changes to the document. Anyway, the fixed version is there now. Thanks, Ian. From owner-mailman@chiark.greenend.org.uk Fri Sep 03 14:06:24 1999 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from ursa.cus.cam.ac.uk [131.111.8.6] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 11Mt2f-0005nL-00 (Debian); Fri, 3 Sep 1999 14:06:09 +0100 Received: from ursa.cus.cam.ac.uk ([131.111.8.6]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.3.6) with esmtp id sauce-id278-rp40763; 03 Sep 1999 13:06:09 +0000 (GMT) Received: from bjh21 (helo=localhost) by ursa.cus.cam.ac.uk with local-smtp (Exim 3.03 #1) id 11MrAU-0002ip-00 for userv-discuss@chiark.greenend.org.uk; Fri, 03 Sep 1999 12:06:06 +0100 Date: Fri, 3 Sep 1999 12:06:06 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: I'm not myself? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Ben Harris Should this be able to happen?: --------8<-------- bash-2.03$ uname -a SunOS ghoul.csi.cam.ac.uk 5.7 Generic_106541-04 sun4u sparc SUNW,Ultra-5_10 bash-2.03$ env PWD=/ TZ=GB HOSTNAME=ghoul.csi.cam.ac.uk MACHTYPE=sparc-sun-solaris2.7 MAIL=/var/mail/root SSH_CLIENT=131.111.11.78 1020 22 SHLVL=3 SHELL=/sbin/sh HOSTTYPE=sparc OSTYPE=solaris2.7 HOME=/ SSH_AUTH_SOCK=/tmp/ssh-root/ssh-15445-agent TERM=xterm PATH=/bin:/usr/bin:/usr/ucb:/usr/bin/X11:/usr/local/bin:/opt/local/bin SSH_TTY=/dev/pts/5 _=/bin/env bash-2.03$ id uid=2147482626(TEST02h) gid=2147482626(TEST02h) bash-2.03$ userv -B environment userv: failure: --override and --spoof options only available to root or to the user who will be providing the service -------->8-------- This is with a userv claiming to be "0.63std". I haven't yet looked into what's causing this, but one thing that strikes me is that in determin_users() (in client.c), the value of pw->pw_name can get saved in loginname, and then in serviceuser and passed to getpwnam. This seems at least slightly dodgy, as getpwnam is allowed to trample on the results of the last getpw*, which includes the string it's being passed in this case. I don't think this is actually the problem here, but I still think it's a bug. -- Ben Harris Unix Support, University of Cambridge Computing Service. E-mail: bjh21@cam.ac.uk Tel: +44 (0)1223 334728 Fax: +44 (0)1223 334679 From owner-mailman@chiark.greenend.org.uk Fri Sep 03 14:50:28 1999 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from ursa.cus.cam.ac.uk [131.111.8.6] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 11MtjX-0007UH-00 (Debian); Fri, 3 Sep 1999 14:50:27 +0100 Received: from ursa.cus.cam.ac.uk ([131.111.8.6]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.3.6) with esmtp id sauce-id881-rp44691; 03 Sep 1999 13:50:27 +0000 (GMT) Received: from bjh21 (helo=localhost) by ursa.cus.cam.ac.uk with local-smtp (Exim 3.03 #1) id 11MtjS-0005WP-00 for userv-discuss@chiark.greenend.org.uk; Fri, 03 Sep 1999 14:50:22 +0100 Date: Fri, 3 Sep 1999 14:50:21 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: Makefile.in portability patch Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Ben Harris Here's a patch which removes some (but not all) the GNUmake-isms from userv's Makefile.in. It also stops it using $(INSTALL) -d, which fails if configure falls back on install-sh. Instead, it requires a copy of GNU mkinstalldirs in the source directory. --------8<-------- *** Makefile.in.orig Thu May 20 00:13:45 1999 --- Makefile.in Fri Sep 3 13:04:23 1999 *************** *** 19,24 **** --- 19,26 ---- VERSION=@VERSION@ VEREXT=std + SHELL=/bin/sh + CC=@CC@ CFLAGS=@CFLAGS@ $(XCFLAGS) -DVERSION='"$(VERSION)"' -DVEREXT='"$(VEREXT)"' $(WERROR) OPTIMISE=@OPTIMISE@ *************** *** 29,38 **** M4FLAGS= LEX=flex CWD=$(shell pwd) INSTALL_GROUP=root INSTALL_FLAGS=-o root -g $(INSTALL_GROUP) ! INSTALL=@INSTALL@ INSTALL_PROGRAM=@INSTALL_PROGRAM@ $(INSTALL_FLAGS) INSTALL_DATA=@INSTALL_DATA@ $(INSTALL_FLAGS) --- 31,41 ---- M4FLAGS= LEX=flex CWD=$(shell pwd) + srcdir=@srcdir@ INSTALL_GROUP=root INSTALL_FLAGS=-o root -g $(INSTALL_GROUP) ! MKINSTALLDIRS=$(srcdir)/mkinstalldirs INSTALL=@INSTALL@ INSTALL_PROGRAM=@INSTALL_PROGRAM@ $(INSTALL_FLAGS) INSTALL_DATA=@INSTALL_DATA@ $(INSTALL_FLAGS) *************** *** 67,73 **** install: all $(INSTALL_PROGRAM) -m 755 daemon $(sbindir)/uservd $(INSTALL_PROGRAM) -m 4755 client $(bindir)/userv ! $(INSTALL) -d -m 2755 $(etcsubdir) \ $(etcsubdir)/default.d $(etcsubdir)/services.d $(etcsubdir)/override.d if test ! -f $(etcsubdir)/system.default; then \ $(INSTALL_DATA) system.default $(etcsubdir); fi --- 70,76 ---- install: all $(INSTALL_PROGRAM) -m 755 daemon $(sbindir)/uservd $(INSTALL_PROGRAM) -m 4755 client $(bindir)/userv ! $(MKINSTALLDIRS) $(etcsubdir) \ $(etcsubdir)/default.d $(etcsubdir)/services.d $(etcsubdir)/override.d if test ! -f $(etcsubdir)/system.default; then \ $(INSTALL_DATA) system.default $(etcsubdir); fi *************** *** 88,99 **** uninstall-doc: cd $docdir && rm -rf $(TARGETS_DOC) ! daemon: overlord.o process.o servexec.o parserlexer.o debug.o lib.o both.o ! $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) ! client: client.o both.o ! $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) lexer.l: language.i4 spec.sgml: spec.sgml.in Makefile --- 91,107 ---- uninstall-doc: cd $docdir && rm -rf $(TARGETS_DOC) ! DAEMON_OBJS= overlord.o process.o servexec.o parserlexer.o debug.o lib.o \ ! both.o ! daemon: $(DAEMON_OBJS) ! $(CC) $(LDFLAGS) -o $@ $(DAEMON_OBJS) $(LDLIBS) + CLIENT_OBJS= client.o both.o + + client: $(CLIENT_OBJS) + $(CC) $(LDFLAGS) -o $@ $(CLIENT_OBJS) $(LDLIBS) + lexer.l: language.i4 spec.sgml: spec.sgml.in Makefile *************** *** 116,123 **** # lexer.c #include's parser.c at the end. Blame flex. $(CC) -c $(CPPFLAGS) $(CFLAGS) lexer.c -o $@ ! pcsum.h: common.h config.h config.status Makefile ! cat $^ | md5sum | sed -e 's/ -$$//; s/../0x&,/g; s/,$$//;' >pcsum.h.new cmp pcsum.h.new pcsum.h || mv -f pcsum.h.new pcsum.h @rm -f pcsum.h.new --- 124,133 ---- # lexer.c #include's parser.c at the end. Blame flex. $(CC) -c $(CPPFLAGS) $(CFLAGS) lexer.c -o $@ ! PCSUM_FILES= common.h config.h config.status Makefile ! ! pcsum.h: $(PCSUM_FILES) ! cat $(PCSUM_FILES) | md5sum | sed -e 's/ -$$//; s/../0x&,/g; s/,$$//;' >pcsum.h.new cmp pcsum.h.new pcsum.h || mv -f pcsum.h.new pcsum.h @rm -f pcsum.h.new --------8<-------- -- Ben Harris Unix Support, University of Cambridge Computing Service. E-mail: bjh21@cam.ac.uk Tel: +44 (0)1223 334728 Fax: +44 (0)1223 334679 From owner-mailman@chiark.greenend.org.uk Fri Sep 03 15:21:42 1999 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from ursa.cus.cam.ac.uk [131.111.8.6] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.02 #1) id 11MuDm-0000CG-00 (Debian); Fri, 3 Sep 1999 15:21:42 +0100 Received: from ursa.cus.cam.ac.uk ([131.111.8.6]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.3.6) with esmtp id sauce-id1314-rp47667; 03 Sep 1999 14:21:42 +0000 (GMT) Received: from bjh21 (helo=localhost) by ursa.cus.cam.ac.uk with local-smtp (Exim 3.03 #1) id 11MuDi-000764-00 for userv-discuss@chiark.greenend.org.uk; Fri, 03 Sep 1999 15:21:38 +0100 Date: Fri, 3 Sep 1999 15:21:37 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: Re: I'm not myself? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Ben Harris On Fri, 3 Sep 1999, Ben Harris wrote: > I haven't yet looked into what's causing this, but one thing that strikes > me is that in determin_users() (in client.c), the value of pw->pw_name can > get saved in loginname, and then in serviceuser and passed to getpwnam. > This seems at least slightly dodgy, as getpwnam is allowed to trample on > the results of the last getpw*, which includes the string it's being > passed in this case. I don't think this is actually the problem here, > but I still think it's a bug. Fixing that seemed to get userv to start behaving itself again. Here's a patch: --------8<-------- *** client.c.orig Fri Sep 3 15:09:57 1999 --- client.c Fri Sep 3 15:00:51 1999 *************** *** 854,859 **** --- 854,860 ---- char **mem; struct passwd *pw; struct group *gr; + char *tmplogin; spoofuid= myuid; spoofgid= mygid; *************** *** 865,871 **** } if (!loginname) { pw= getpwuid(myuid); if (!pw) miscerror("cannot determine your login name"); ! loginname= pw->pw_name; } if (!strcmp(serviceuser,"-")) serviceuser= loginname; --- 866,874 ---- } if (!loginname) { pw= getpwuid(myuid); if (!pw) miscerror("cannot determine your login name"); ! tmplogin= xmalloc(strlen(pw->pw_name) + 1); ! strcpy(tmplogin, pw->pw_name); ! loginname= tmplogin; } if (!strcmp(serviceuser,"-")) serviceuser= loginname; -------->8-------- The "tmplogin" variable is used because loginname is a char const *, and hence can't be passed as the first argument to strcpy. Perhaps strdup might be better, though less standard. -- Ben Harris Unix Support, University of Cambridge Computing Service. E-mail: bjh21@cam.ac.uk Tel: +44 (0)1223 334728 Fax: +44 (0)1223 334679 From owner-mailman@chiark.greenend.org.uk Sun Jun 11 14:38:54 2000 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from libra.cus.cam.ac.uk [131.111.8.19] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.05 #1) id 1317x0-0001XZ-00 (Debian); Sun, 11 Jun 2000 14:38:54 +0100 Received: from libra.cus.cam.ac.uk ([131.111.8.19]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.6.0) with esmtp id sauce-id1068-rp34557; 11 Jun 2000 13:38:54 +0000 (GMT) Received: from bjh21 (helo=localhost) by libra.cus.cam.ac.uk with local-esmtp (Exim 3.14 #4) id 1317wy-0007ZU-00 for userv-discuss@chiark.greenend.org.uk; Sun, 11 Jun 2000 14:38:52 +0100 Date: Sun, 11 Jun 2000 14:38:52 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: userv-1.0.0 patch to support BSD md5(1) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Ben Harris This is a small patch to allow the userv-1.0.0 build mechanism to work in an environment that doesn't have GNU md5sum(1) but does have BSD md5(1), which is equivalent in simple cases. The variable name used should perhaps be different, since md5(1) and md5sum(1) take different options. --- configure.in.orig Wed Apr 7 23:43:49 1999 +++ configure.in Sun Jun 11 13:31:21 2000 @@ -41,6 +41,7 @@ AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL +AC_CHECK_PROGS(MD5SUM, md5sum md5) CFLAGS="$CFLAGS -D_GNU_SOURCE" --- Makefile.in.orig Mon Mar 6 18:14:46 2000 +++ Makefile.in Sun Jun 11 13:33:34 2000 @@ -28,6 +28,7 @@ M4=m4 M4FLAGS= LEX=flex +MD5SUM=@MD5SUM@ CWD=$(shell pwd) INSTALL_GROUP=root @@ -123,7 +124,7 @@ $(CC) -c $(CPPFLAGS) $(CFLAGS) lexer.c -o $@ pcsum.h: common.h config.h config.status Makefile - cat $^ | md5sum | sed -e 's/ -$$//; s/../0x&,/g; s/,$$//;' >pcsum.h.new + cat $^ | $(MD5SUM) | sed -e 's/ -$$//; s/../0x&,/g; s/,$$//;' >pcsum.h.new cmp pcsum.h.new pcsum.h || mv -f pcsum.h.new pcsum.h @rm -f pcsum.h.new -- Ben Harris Unix Support, University of Cambridge Computing Service. E-mail: bjh21@cam.ac.uk Tel: +44 (0)1223 334728 Fax: +44 (0)1223 334679 From owner-mailman@chiark.greenend.org.uk Wed Jun 28 01:14:11 2000 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from 39594350.39c61.1a4e.0.bsmtp.davenant.greenend.org.uk by chiark.greenend.org.uk with local-bsmtp (Exim 2.05 #1) id 1375UZ-0001kk-00 (Debian); Wed, 28 Jun 2000 01:14:11 +0100 Received: from ian by davenant.greenend.org.uk with local (Exim 2.125 #2) id 1375Tg-0001s1-00 (Debian); Wed, 28 Jun 2000 01:13:16 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14681.17180.637032.201225@davenant.relativity.greenend.org.uk> Date: Wed, 28 Jun 2000 01:13:16 +0100 (BST) To: Ben Harris Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: userv-1.0.0 patch to support BSD md5(1) Newsgroups: chiark.mail.userv.discuss In-Reply-To: References: X-Mailer: VM 6.62 under Emacs 19.34.1 Ben Harris writes ("userv-1.0.0 patch to support BSD md5(1)"): > This is a small patch to allow the userv-1.0.0 build mechanism to work in > an environment that doesn't have GNU md5sum(1) but does have BSD md5(1), > which is equivalent in simple cases. The variable name used should > perhaps be different, since md5(1) and md5sum(1) take different options. Thanks for the patch; I've applied it as is (I know that md5 and md5sum give different output, but I trust that you've checked that md5 on BSD works in my Makefile (-: .) Thanks, Ian. From owner-mailman@chiark.greenend.org.uk Wed Jun 28 14:03:40 2000 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from draco.cus.cam.ac.uk [131.111.8.18] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.05 #1) id 137HVD-00006K-00 (Debian); Wed, 28 Jun 2000 14:03:39 +0100 Received: from draco.cus.cam.ac.uk ([131.111.8.18]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.6.0) with esmtp id sauce-id1187-rp51518; 28 Jun 2000 13:03:39 +0000 (GMT) Received: from bjh21 (helo=localhost) by draco.cus.cam.ac.uk with local-esmtp (Exim 3.15 #3) id 137HVC-0000hr-00; Wed, 28 Jun 2000 14:03:38 +0100 Date: Wed, 28 Jun 2000 14:03:38 +0100 (BST) From: Ben Harris To: Ian Jackson cc: userv-discuss@chiark.greenend.org.uk Subject: Re: userv-1.0.0 patch to support BSD md5(1) In-Reply-To: <14681.17180.637032.201225@davenant.relativity.greenend.org.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Ben Harris On Wed, 28 Jun 2000, Ian Jackson wrote: > Ben Harris writes ("userv-1.0.0 patch to support BSD md5(1)"): > > This is a small patch to allow the userv-1.0.0 build mechanism to work in > > an environment that doesn't have GNU md5sum(1) but does have BSD md5(1), > > which is equivalent in simple cases. The variable name used should > > perhaps be different, since md5(1) and md5sum(1) take different options. > > Thanks for the patch; I've applied it as is (I know that md5 and > md5sum give different output, but I trust that you've checked that md5 > on BSD works in my Makefile (-: .) It does. What I was worried about was that this leaves an entry in config.cache for MD5SUM which other programs might expect to be something more like GNU md5sum. -- Ben Harris Unix Support, University of Cambridge Computing Service. E-mail: bjh21@cam.ac.uk Tel: +44 (0)1223 334728 Fax: +44 (0)1223 334679 From owner-mailman@chiark.greenend.org.uk Thu Jul 27 01:07:57 2000 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from 397f7d5a.bc8bc.624f.0.bsmtp.davenant.greenend.org.uk by chiark.greenend.org.uk with local-bsmtp (Exim 2.05 #1) id 13HbDR-0006Y3-00 (Debian); Thu, 27 Jul 2000 01:07:57 +0100 Received: from ian by davenant.greenend.org.uk with local (Exim 2.125 #2) id 13HaqH-0007xe-00 (Debian); Thu, 27 Jul 2000 00:44:01 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14719.30657.229687.555992@davenant.relativity.greenend.org.uk> Date: Thu, 27 Jul 2000 00:44:01 +0100 (BST) To: Ben Harris Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: userv-1.0.0 patch to support BSD md5(1) In-Reply-To: References: <14681.17180.637032.201225@davenant.relativity.greenend.org.uk> X-Mailer: VM 6.62 under Emacs 19.34.1 Ben Harris writes ("Re: userv-1.0.0 patch to support BSD md5(1)"): > It does. What I was worried about was that this leaves an entry in > config.cache for MD5SUM which other programs might expect to be something > more like GNU md5sum. Good point, I'll make it set MD5SUM_SIMPLE. Ian. From owner-mailman@chiark.greenend.org.uk Thu Jul 27 12:59:05 2000 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from draco.cus.cam.ac.uk [131.111.8.18] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 2.05 #1) id 13HmJd-00052c-00 (Debian); Thu, 27 Jul 2000 12:59:05 +0100 Received: from draco.cus.cam.ac.uk ([131.111.8.18]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.6.0) with esmtp id sauce-id2796-rp58944; 27 Jul 2000 11:59:05 +0000 (GMT) Received: from bjh21 (helo=localhost) by draco.cus.cam.ac.uk with local-esmtp (Exim 3.16 #3) id 13HmJa-0003vu-00 for userv-discuss@chiark.greenend.org.uk; Thu, 27 Jul 2000 12:59:02 +0100 Date: Thu, 27 Jul 2000 12:59:02 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: --help and --version behaviour conflicts with GNU standards Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Ben Harris The GNU Coding Standards (16 January 1997) state (node "User Interfaces") that --help and --version should print their results on stdout. userv seems to send the output to stderr instead, and its output for --version doesn't follow the GNU standards either. Tested with userv 1.0.1.1potatostd. --------8<-------- wraith:~$ userv --help 2>/dev/null wraith:~$ userv --version 2>/dev/null -------->8-------- -- Ben Harris Unix Support, University of Cambridge Computing Service. From owner-mailman@chiark.greenend.org.uk Sun Aug 13 13:26:15 2000 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from 399693e4.bbb9e.3f5.0.bsmtp.davenant.greenend.org.uk by chiark.greenend.org.uk with local-bsmtp (Exim 2.05 #1) id 13NwqF-0000GT-00 (Debian); Sun, 13 Aug 2000 13:26:15 +0100 Received: from ian by davenant.greenend.org.uk with local (Exim 2.125 #2) id 13Nwp5-0007a1-00 (Debian); Sun, 13 Aug 2000 13:25:03 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14742.37791.304513.417562@davenant.relativity.greenend.org.uk> Date: Sun, 13 Aug 2000 13:25:03 +0100 (BST) To: Ben Harris Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: --help and --version behaviour conflicts with GNU standards Newsgroups: chiark.mail.userv.discuss In-Reply-To: References: X-Mailer: VM 6.62 under Emacs 19.34.1 Ben Harris writes ("--help and --version behaviour conflicts with GNU standards"): > The GNU Coding Standards (16 January 1997) state (node "User Interfaces") > that --help and --version should print their results > on stdout. userv seems to send the output to stderr instead, and its > output for --version doesn't follow the GNU standards either. > > Tested with userv 1.0.1.1potatostd. This'll be fixed in 1.0.2. Thanks, Ian. From owner-mailman@chiark.greenend.org.uk Tue Apr 24 12:38:28 2001 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from virgo.cus.cam.ac.uk [131.111.8.20] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 3.12 #2) id 14s19I-0004KY-00 (Debian); Tue, 24 Apr 2001 12:38:28 +0100 Received: from virgo.cus.cam.ac.uk ([131.111.8.20]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.7.7) with esmtp id sauce-855-988112-1; 24 Apr 2001 11:38:28 +0000 (GMT) Received: from jpk28 by virgo.cus.cam.ac.uk with local (Exim 3.22 #1) id 14rzn3-0004EQ-00 for userv-discuss@chiark.greenend.org.uk; Tue, 24 Apr 2001 11:11:25 +0100 Subject: O_SYNC To: userv-discuss@chiark.greenend.org.uk Date: Tue, 24 Apr 2001 11:11:25 +0100 (BST) X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 890 Message-Id: From: Julian King I don't claim to understand the issues, but userv 1.0.1 will not compile on a FreeBSD 4.2-STABLE box of mine because client.c references O_SYNC. From what I can see this is an aspect of POSIX that has not made it to FreeBSD. Does this mean that userv cannot be used on FreeBSD until such time as sychronous writes are enforceable? Does the fact that the filesystem is be default synchronous make any difference? (actually it the default is: noasync Metadata I/O should be done synchronously, while data I/O should be done asynchronously. This is the default. although there is an option to force sync as well.) Could I just disable this bit of functionality from userv? I do not believe that I need it for the specific scenario that I want to use userv in in this case, although I am loathe to use a non standard version. Thoughts welcome, Julian From owner-mailman@chiark.greenend.org.uk Tue Apr 24 13:05:31 2001 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from draco.cus.cam.ac.uk [131.111.8.18] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 3.12 #2) id 14s1ZT-0005MG-00 (Debian); Tue, 24 Apr 2001 13:05:31 +0100 Received: from draco.cus.cam.ac.uk ([131.111.8.18]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.7.7) with esmtp id sauce-908-988113-1; 24 Apr 2001 12:05:31 +0000 (GMT) Received: from bjh21 (helo=localhost) by draco.cus.cam.ac.uk with local-esmtp (Exim 3.22 #1) id 14s1ZR-0002Dt-00; Tue, 24 Apr 2001 13:05:29 +0100 Date: Tue, 24 Apr 2001 13:05:29 +0100 (BST) From: Ben Harris To: Julian King cc: Subject: Re: O_SYNC In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Ben Harris On Tue, 24 Apr 2001, Julian King wrote: > I don't claim to understand the issues, but userv 1.0.1 will not > compile on a FreeBSD 4.2-STABLE box of mine because client.c > references O_SYNC. From what I can see this is an aspect of POSIX > that has not made it to FreeBSD. Does this mean that userv cannot > be used on FreeBSD until such time as sychronous writes are enforceable? From the NetBSD CVS log for sys/sys/fcntl.h: ---------------------------- revision 1.13 date: 1998/01/15 02:33:12; author: thorpej; state: Exp; lines: +9 -4 Define the O_SYNC flag to open(2) per XPG4.2, using the same value as the historic O_FSYNC flag (the semantics are identical). Hide the historic O_FSYNC flag if _POSIX_SOURCE or _XOPEN_SOURCE are defined, and define it to be O_SYNC. ---------------------------- So that looks like in the absence of a definition of O_SYNC, userv could fall back to O_FSYNC (which FreeBSD seems to have). -- Ben Harris Unix Support, University of Cambridge Computing Service. E-mail: bjh21@cam.ac.uk Tel: +44 (0)1223 334728 Fax: +44 (0)1223 334679 From owner-mailman@chiark.greenend.org.uk Thu Mar 06 18:39:54 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from virgo.cus.cam.ac.uk [131.111.8.20] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 3.12 #1) id 18r0Ha-0005ko-00 (Debian); Thu, 06 Mar 2003 18:39:54 +0000 Received: from virgo.cus.cam.ac.uk ([131.111.8.20]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.7.11) with esmtp id sauce-4145-1046975-1; 06 Mar 2003 18:39:54 +0000 (GMT) Received: from jpk28 by virgo.cus.cam.ac.uk with local (Exim 4.12) id 18r0HZ-0000N0-00; Thu, 06 Mar 2003 18:39:53 +0000 Subject: Re: suggested modifications To: userv-discuss@chiark.greenend.org.uk Date: Thu, 6 Mar 2003 18:39:53 +0000 (GMT) In-Reply-To: <14091.56535.491363.243720@anarres.relativity.greenend.org.uk> from "Ian Jackson" at Apr 7, 99 11:31:51 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 2651 Message-Id: From: Julian King This is a reply to a _really_ old thread. Sorry, but it kind of fits in here... [ Background for those that weren't there or have forgotten: I was creating a webserver with a chrooted environment, and was using userv to allow certain users to cross a security boundary. This was done under Solaris using an older version of userv. I am now (3 1/2 years later) repeating the exercise to make a new version of the webserver. ] > Julian King writes ("suggested modifications"): > > All the below is as a result of trying to get the beast to work under > > Solaris. > I've got it to at least compile under Solaris with some effort. I > should be doing a `portability' release soon. Well, the good news, with regards Solaris at least, is that it is a lot easier than it used to be. GNU M4 is now available with Solaris 9 - however it isn't called m4 it is is called gm4, and is installed as /opt/sfw/bin/gm4 (from package SFWgm4). GNU make is now available with Solaris 9 - installed as gmake, also in /opt/sfw/bin/ (from package SFWgmake) md5sum is now available - installed as /opt/sfw/bin/gmd5sum (from package SFWgtext) In order to configure and compile the program you need to do the equivalent of: cp Makefile.in Makefile.in.orig ; sed 's/^M4=.*/M4=/opt/sfw/bin/gm4/' < Makefile.in.orig > Makefile.in MD5SUM_SIMPLE=/opt/sfw/bin/gmd5sum ./configure Ideally the first stage should be done through configure, and not assume that m4 is called m4, and the second stage should not assume that md5sum is called md5sum, and search the PATH for more names, or under a specified name. > Do you have a suitable test to hand ? I should ship the m4 output. Heh, your INSTALL file still says that. > I should ship the flex output. Heh, your INSTALL file still says that. > > don't include install.sh scripts which use cp -d, when cp -d is a > > gnu cp extension > > Where can I get another one ? The (current) version of autoconf appears to ship with one that appears to work. As an added bonus, changing configure and Makefile.in so that etcdir can be set to be something else would be nice (for me). > > don't use $^ since that is the only thing that stops you using make > > rather than gmake > I'm not going to do this because it will make the Makefile less > clear. Just install GNU make. I still don't agree, but I now have gmake. > Ian. I should add that thus far I have merely tested the compilation and install phases, and haven't actually used userv in anger once compiled this way, but for the moment I'm going to assume it just works. Julian -- Julian King Computer Officer, University of Cambridge, Unix Support From owner-mailman@chiark.greenend.org.uk Tue Apr 01 20:36:51 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from (davenant.greenend.org.uk) [172.18.45.6] (mail) by chiark.greenend.org.uk with esmtp (Exim 3.12 #1) id 190RYx-000157-00 (Debian); Tue, 01 Apr 2003 20:36:51 +0100 Received: from ian by davenant.greenend.org.uk with local (Exim 3.35 #1) id 190RYx-0003Ex-00 (Debian); Tue, 01 Apr 2003 20:36:51 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16009.59987.11099.814309@davenant.relativity.greenend.org.uk> Date: Tue, 1 Apr 2003 20:36:51 +0100 To: Julian King Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: suggested modifications In-Reply-To: References: <14091.56535.491363.243720@anarres.relativity.greenend.org.uk> X-Mailer: VM 7.03 under Emacs 19.34.1 Julian King writes ("Re: suggested modifications"): > This is a reply to a _really_ old thread. Sorry, but it kind of fits > in here... No problem :-). > Well, the good news, with regards Solaris at least, is that it is a lot > easier than it used to be. > > GNU M4 [...] > GNU make [...] > md5sum [...] Hrm. > Ideally the first stage should be done through configure, and not > assume that m4 is called m4, and the second stage should not assume > that md5sum is called md5sum, and search the PATH for more names, or > under a specified name. I suppose so. Fancy supplying a patch ? Although I'm inclined to say `put symlinks in /usr/local/bin'. > > Do you have a suitable test to hand ? I should ship the m4 output. > > I should ship the flex output. > Heh, your INSTALL file still says that. I do seem to ship the output nowadays. Does that work for you ? (Ie, not use flex and m4 if you don't edit the source ?) > > Where can I get another [install-sh] ? > > The (current) version of autoconf appears to ship with one that appears > to work. I've nabbed the one from autoconf 2.53. > As an added bonus, changing configure and Makefile.in so that > etcdir can be set to be something else would be nice (for me). You can do that. Just say make etcdir= Thanks, Ian. From owner-mailman@chiark.greenend.org.uk Wed Apr 02 00:40:22 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from libra.cus.cam.ac.uk [131.111.8.19] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 3.12 #1) id 190VMb-0001Nm-00 (Debian); Wed, 02 Apr 2003 00:40:21 +0100 Received: from libra.cus.cam.ac.uk ([131.111.8.19]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.7.11) with esmtp id sauce-6372-1049240-1; 01 Apr 2003 23:40:21 +0000 (GMT) Received: from jpk28 by libra.cus.cam.ac.uk with local (Exim 4.14) id 190VMd-0005fF-7T for userv-discuss@chiark.greenend.org.uk; Wed, 02 Apr 2003 00:40:23 +0100 Subject: Re: suggested modifications To: userv-discuss@chiark.greenend.org.uk Date: Wed, 2 Apr 2003 00:40:23 +0100 (BST) In-Reply-To: <16009.59987.11099.814309@davenant.relativity.greenend.org.uk> from "Ian Jackson" at Apr 1, 3 08:36:51 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1732 Message-Id: From: Julian King > > Ideally the first stage should be done through configure, and not > > assume that m4 is called m4, and the second stage should not assume > > that md5sum is called md5sum, and search the PATH for more names, or > > under a specified name. > > I suppose so. Fancy supplying a patch ? Although I'm inclined to say > `put symlinks in /usr/local/bin'. I'll add it to my copious TODO list. Next time you think about this, if you haven't had a patch from me hit me (or cause me to be hit by someone else). I don't agree with your solution incidentally, since it is yet another set of symlinks for me to maintain - and I am going to have to maintain a stupid number as it is. (Must learn stow and see if it can do what I need). > > > Do you have a suitable test to hand ? I should ship the m4 output. > > > I should ship the flex output. > > Heh, your INSTALL file still says that. > I do seem to ship the output nowadays. Does that work for you ? (Ie, > not use flex and m4 if you don't edit the source ?) To be honest, I didn't think to check if you did. I merely noticed that the INSTALL file still said that you should. It wasn't a problem since we had gnu m4 this time around. > > > Where can I get another [install-sh] ? > > > > The (current) version of autoconf appears to ship with one that appears > > to work. > > I've nabbed the one from autoconf 2.53. > > > As an added bonus, changing configure and Makefile.in so that > > etcdir can be set to be something else would be nice (for me). > > You can do that. Just say > make etcdir= Good point! My mind was probably in the 'how do I get configure to do things' mode, since most programs work like that. > Thanks, > Ian. Cheers, Julian From owner-mailman@chiark.greenend.org.uk Fri Apr 04 00:13:11 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from (davenant.greenend.org.uk) [172.18.45.6] (mail) by chiark.greenend.org.uk with esmtp (Exim 3.12 #1) id 191DtP-0001ZJ-00 (Debian); Fri, 04 Apr 2003 00:13:11 +0100 Received: from ian by davenant.greenend.org.uk with local (Exim 3.35 #1) id 191DtP-0001ec-00 (Debian); Fri, 04 Apr 2003 00:13:11 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16012.49159.476404.9032@davenant.relativity.greenend.org.uk> Date: Fri, 4 Apr 2003 00:13:11 +0100 To: Julian King Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: suggested modifications In-Reply-To: References: <16009.59987.11099.814309@davenant.relativity.greenend.org.uk> X-Mailer: VM 7.03 under Emacs 19.34.1 Julian King writes ("Re: suggested modifications"): > I'll add it to my copious TODO list. Next time you think about this, > if you haven't had a patch from me hit me (or cause me to be hit > by someone else). Willdo. (Or I might do it myself if it looks easy.) > I don't agree with your solution incidentally, since it is yet another > set of symlinks for me to maintain - and I am going to have to maintain > a stupid number as it is. (Must learn stow and see if it can do what > I need). I can see that problem, yes :-). > > I do seem to ship the output nowadays. Does that work for you ? (Ie, > > not use flex and m4 if you don't edit the source ?) > > To be honest, I didn't think to check if you did. I merely noticed that > the INSTALL file still said that you should. It wasn't a problem > since we had gnu m4 this time around. OK :-). Thanks, Ian. From owner-mailman@chiark.greenend.org.uk Thu Apr 24 12:34:35 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from draco.cus.cam.ac.uk [131.111.8.18] (cusexim) by chiark.greenend.org.uk with esmtp (Exim 3.35 #1) id 198ezq-0001Gl-00 (Debian); Thu, 24 Apr 2003 12:34:34 +0100 Received: from draco.cus.cam.ac.uk ([131.111.8.18]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.7.11) with esmtp id sauce-2445-1051184-2; 24 Apr 2003 11:34:34 +0000 (GMT) Received: from aia21 (helo=localhost) by draco.cus.cam.ac.uk with local-smtp (Exim 4.14) id 198ezq-0003dZ-B8; Thu, 24 Apr 2003 12:34:34 +0100 Date: Thu, 24 Apr 2003 12:34:34 +0100 (BST) From: Anton Altaparmakov To: userv-maint@chiark.greenend.org.uk cc: userv-discuss@chiark.greenend.org.uk Subject: [micro-PATCH] Allow configure to detect gmd5sum. Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1297389768-1051184074=:26264" Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1297389768-1051184074=:26264 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, We need this tiny patchlet to be able to configure and compile userv-1.0.1 out of the box on Solaris 9 as md5sum is called gmd5sum. It would be great if it could be applied for the next release. - Thanks! Best regards, Anton -- Anton Altaparmakov (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/ ---559023410-1297389768-1051184074=:26264 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="userv-1.0.1-gmd5sum.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: ZGlmZiAtdXJOIHVzZXJ2LTEuMC4xL2NvbmZpZ3VyZSB1c2Vydi0xLjAuMS1n bWQ1c3VtL2NvbmZpZ3VyZQ0KLS0tIHVzZXJ2LTEuMC4xL2NvbmZpZ3VyZQlU aHUgSnVsIDI3IDAxOjA4OjM0IDIwMDANCisrKyB1c2Vydi0xLjAuMS1nbWQ1 c3VtL2NvbmZpZ3VyZQlUaHUgQXByIDI0IDEyOjE5OjEzIDIwMDMNCkBAIC04 NTUsNyArODU1LDcgQEANCiANCiB0ZXN0IC16ICIkSU5TVEFMTF9EQVRBIiAm JiBJTlNUQUxMX0RBVEE9JyR7SU5TVEFMTH0gLW0gNjQ0Jw0KIA0KLWZvciBh Y19wcm9nIGluIG1kNXN1bSBtZDUNCitmb3IgYWNfcHJvZyBpbiBtZDVzdW0g bWQ1IGdtZDVzdW0NCiBkbw0KICMgRXh0cmFjdCB0aGUgZmlyc3Qgd29yZCBv ZiAiJGFjX3Byb2ciLCBzbyBpdCBjYW4gYmUgYSBwcm9ncmFtIG5hbWUgd2l0 aCBhcmdzLg0KIHNldCBkdW1teSAkYWNfcHJvZzsgYWNfd29yZD0kMg0KZGlm ZiAtdXJOIHVzZXJ2LTEuMC4xL2NvbmZpZ3VyZS5pbiB1c2Vydi0xLjAuMS1n bWQ1c3VtL2NvbmZpZ3VyZS5pbg0KLS0tIHVzZXJ2LTEuMC4xL2NvbmZpZ3Vy ZS5pbglUaHUgSnVsIDI3IDAxOjA4OjM0IDIwMDANCisrKyB1c2Vydi0xLjAu MS1nbWQ1c3VtL2NvbmZpZ3VyZS5pbglUaHUgQXByIDI0IDEyOjE4OjU0IDIw MDMNCkBAIC00MSw3ICs0MSw3IEBADQogQUNfUFJPR19DQw0KIEFDX1BST0df Q1BQDQogQUNfUFJPR19JTlNUQUxMDQotQUNfQ0hFQ0tfUFJPR1MoTUQ1U1VN X1NJTVBMRSwgbWQ1c3VtIG1kNSkNCitBQ19DSEVDS19QUk9HUyhNRDVTVU1f U0lNUExFLCBtZDVzdW0gbWQ1IGdtZDVzdW0pDQogDQogQ0ZMQUdTPSIkQ0ZM QUdTIC1EX0dOVV9TT1VSQ0UiDQogDQo= ---559023410-1297389768-1051184074=:26264-- From owner-mailman@chiark.greenend.org.uk Fri Apr 25 19:56:17 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from (davenant.greenend.org.uk) [172.18.45.6] (mail) by chiark.greenend.org.uk with esmtp (Exim 3.35 #1) id 1998Mr-0003hu-00 (Debian); Fri, 25 Apr 2003 19:56:17 +0100 Received: from ian by davenant.greenend.org.uk with local (Exim 3.35 #1) id 1998Mr-0005X7-00 (Debian); Fri, 25 Apr 2003 19:56:17 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16041.34001.298385.532129@davenant.relativity.greenend.org.uk> Date: Fri, 25 Apr 2003 19:56:17 +0100 To: Anton Altaparmakov Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: [micro-PATCH] Allow configure to detect gmd5sum. In-Reply-To: References: X-Mailer: VM 7.03 under Emacs 19.34.1 Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: Anton Altaparmakov writes ("[micro-PATCH] Allow configure to detect gmd5sum."): > We need this tiny patchlet to be able to configure and compile userv-1.0.1 > out of the box on Solaris 9 as md5sum is called gmd5sum. > > It would be great if it could be applied for the next release. - Thanks! I have made that change in my CVS. Thanks for the report. Ian. From owner-mailman@chiark.greenend.org.uk Mon May 19 17:26:48 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from draco.cus.cam.ac.uk ([131.111.8.18] ident=cusexim) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp for userv-discuss@chiark.greenend.org.uk id 19HnTM-000074-00; Mon, 19 May 2003 17:26:48 +0100 Received: from draco.cus.cam.ac.uk ([131.111.8.18]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.7.11) with esmtp id sauce-4878-1053361-1; 19 May 2003 16:26:48 +0000 (GMT) Received: from bjh21 (helo=localhost) by draco.cus.cam.ac.uk with local-esmtp (Exim 4.20) id 19HnTL-0004Ju-Q9 for userv-discuss@chiark.greenend.org.uk; Mon, 19 May 2003 17:26:47 +0100 Date: Mon, 19 May 2003 17:26:47 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: ucam MWS groupmanage hacks Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: We've been using a hacked version of groupmanage on our Managed Web Server[1] for some years now, and I've just updated it to correspond with the latest version in userv-utils (CVS revision 1.3). Some of our local changes might be of more general interest, so the patch to implement them is below. The changes are: 1: Allow groupmanage.conf to specify the locations of the group, grouplist and gtmp files. This is important if the real group file is made by merging several parts, or if /etc isn't writable. 2: Allow a command to be specified that should be run when groupmanage finishes. Again, this is useful if the group file has to be constructed from several parts. 3: Allow more general restrictions on the names of user-created groups by specifying a Perl regexp for them. 4: Allow for an "admin" group. If such a group is defined, it has permission to create a group even if "user-create" is turned off. 5: Use a possibly-more-robust (certainly more complex) locking mechanism for the group file. I no longer have any idea why I wanted this. I'm not sure if the changes are large enough to merit an additional copyright notice, but I've provided one just in case. The comment naming me is for GPL clause 2a compliance and you can delete it if you want. [1] --- groupmanage.1.3 Mon May 12 17:44:04 2003 +++ groupmanage.new Mon May 12 18:09:50 2003 @@ -1,6 +1,11 @@ #!/usr/bin/perl # # Copyright (C)1995-9 Ian Jackson +# Copyright (C) 1999, 2003 +# Chancellor Masters and Scholars of the University of Cambridge +# +# Hacked by Ben Harris in 1999 and 2003 for Unix +# Support's own nefarious purposes. # # This is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -55,30 +60,33 @@ @ARGV || push(@ARGV,'--info'); -if ($ARGV[0] eq '--info') { - @ARGV == 1 || &usage('no arguments allowed after --info'); - &p_out; - &load; - &checkexists; - &display; - &p_out; - exit(0); -} - $callinguser= exists $ENV{'USERV_UID'} ? $ENV{'USERV_UID'} : $<; +$callingname = exists $ENV{'USERV_USER'} ? $ENV{'USERV_USER'} : getpwuid($<); %opt= ('user-create','0', 'user-create-minunameu','5', 'user-create-min','10000', 'user-create-max','19999', 'user-create-nameintitle','0', - 'user-create-maxperu','5'); + 'user-create-maxperu','5', + 'group-file','group', + 'gtmp-file','gtmp', + 'grouplist-file','grouplist', + 'name-regexp','', + 'admin-group','', + 'finish-command',''); %ovalid= ('user-create','boolean', 'user-create-minunameu','number', 'user-create-min','number', 'user-create-max','number', 'user-create-nameintitle','boolean', - 'user-create-maxperu','number'); + 'user-create-maxperu','number', + 'group-file','string', + 'gtmp-file','string', + 'grouplist-file','string', + 'name-regexp','string', + 'admin-group','string', + 'finish-command','string'); sub ov_boolean { $cov= $_ eq 'yes' ? 1 : @@ -90,6 +98,10 @@ m/^[0-9]{1,10}$/ || &quit("groupmanage.conf:$.: bad numerical value"); } +sub ov_string { + +} + open(GMC,"groupmanage.conf") || &quit("read groupmanage.conf: $!"); while () { next if m/^\#/ || !m/\S/; @@ -104,32 +116,56 @@ } close(GMC); +if ($ARGV[0] eq '--info') { + @ARGV == 1 || &usage('no arguments allowed after --info'); + &p_out; + &load; + &checkexists; + &display; + &p_out; + exit(0); +} + sub naming { $callinguser || return; &p_out; - print(STDERR <- You must quote at least $opt{'user-create-minunameu'} chars of your username $createby (or all of it if it is shorter). END + } + if ($opt{'name-regexp'}) { + print(STDERR <= $opt{'user-create-minunameu'} && - substr($createby,0,length($upart)) eq $upart) - || &naming; + if ($opt{'user-create-minunameu'}) { + $groupname =~ m/^([-0-9A-Za-z]+)-([0-9a-z]+)$/ || &naming; + $upart= $1; + $idpart= $2; + $upart eq $createby || + (length($upart) >= $opt{'user-create-minunameu'} && + substr($createby,0,length($upart)) eq $upart) + || &naming; + } else { + $groupname =~ m/${opt{'name-regexp'}}/ || &naming; + } $create= 1; shift(@ARGV); } @@ -158,6 +194,8 @@ } &weare($owner) || grep(&weare($_),@managers) || !$callinguser || + ($opt{'admin-group'} && + (getgrnam($opt{'admin-group'}))[3] =~ /(^| )$callingname( |$)/) || &quit("you may not manage $groupname"); $action= 'none'; @@ -227,14 +265,17 @@ "$groupname:$password:$gid:".join(',',@members)."\n"; $grouplist[$grouplistix]= "$groupname:$description:$owner:".join(',',@managers).":$homedir\n"; -&save('group',@groupfile); -&save('grouplist',@grouplist); -unlink('gtmp') || &quit("unlock group (remove gtmp): $!"); +&save($opt{'group-file'},@groupfile); +&save($opt{'grouplist-file'},@grouplist); +if ($opt{'finish-command'}) { + !system($opt{'finish-command'}) || &quit("finish-command: $!"); +} +unlink($opt{'gtmp-file'}) || &quit("unlock group (remove gtmp): $!"); &p_out; exit(0); sub load { - open(GF,"< group") || &quit("read group: $!"); + open(GF,"< $opt{'group-file'}") || &quit("read group: $!"); @groupfile=; close(GF); $groupfileix=-1; for ($i=0; $i<=$#groupfile; $i++) { @@ -250,7 +291,7 @@ $gid= $3; @members= split(/,/,$4); } - open(GL,"< grouplist") || &quit("read grouplist: $!"); + open(GL,"< $opt{'grouplist-file'}") || &quit("read grouplist: $!"); @grouplist=; close(GL); $grouplistix=-1; for ($i=0; $i<=$#grouplist; $i++) { @@ -299,14 +340,27 @@ } sub lock { - link('group','gtmp') || &quit("create gtmp: $!"); + # NFS-safe Locking per Linux open(2) + my($hostname) = `hostname`; + chomp($hostname); + my($hitching_post) = "$opt{'gtmp-file'}.$hostname.$$"; + open(LOCK, ">$hitching_post") || die "$hitching_post: $!"; + close(LOCK); + link($hitching_post, $opt{'gtmp-file'}); + if ((stat($hitching_post))[3] != 2) { + close(OUT); + unlink($hitching_post); + &quit("group file locked -- giving up..."); + } + unlink($hitching_post); +# link($opt{'group-file'},$opt{'gtmp-file'}) || &quit("create gtmp: $!"); $locked++; } sub unlock { return unless $locked; $locked--; - unlink('gtmp') || warn("unlock group file (remove gtmp): $!\n"); + unlink($opt{'gtmp-file'}) || warn("unlock group file (remove gtmp): $!\n"); } sub display { -- Ben Harris Unix Support, University of Cambridge Computing Service. E-mail: bjh21@cam.ac.uk Tel: +44 (0)1223 334728 Fax: +44 (0)1223 334679 From owner-mailman@chiark.greenend.org.uk Thu May 22 19:02:12 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from draco.cus.cam.ac.uk ([131.111.8.18] ident=cusexim) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp for userv-discuss@chiark.greenend.org.uk id 19IuOK-00050v-00; Thu, 22 May 2003 19:02:12 +0100 Received: from draco.cus.cam.ac.uk ([131.111.8.18]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.7.11) with esmtp id sauce-5575-1053626-1; 22 May 2003 18:02:12 +0000 (GMT) Received: from bjh21 (helo=localhost) by draco.cus.cam.ac.uk with local-esmtp (Exim 4.20) id 19IuOJ-0002ac-Hk for userv-discuss@chiark.greenend.org.uk; Thu, 22 May 2003 19:02:11 +0100 Date: Thu, 22 May 2003 19:02:11 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: Assertion failed: fdarray[fd].holdfd == -1, file process.c, line 648 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: I'm getting uservd exploding with an assertion failure: Assertion failed: fdarray[fd].holdfd == -1, file process.c, line 648 This occurs using both userv 1.0.1std on Solaris 9 and userv 1.0.1.1potatp.1std on Debian GNU/Linux testing. I can provoke the bug by having a service configuration file (in either /etc/userv/services.d or my per-user services.d) that looks like: if glob calling-user bjh21 reset set-environment no-suppress-args require-fd 3-4 read execute /bin/true fi and then running the command: userv --file 3,read=/etc/passwd --file 4,read=/etc/passwd bjh21 ssl-cert (where "bjh21" is my user name and "ssl-cert" is the name of the service). The names of the files and the users, the command executed by the service, and the conditions of the "if" don't seem to affect the bug. I haven't yet worked out precisely what's going on, but it seems easy enough to reproduce. -- Ben Harris Unix Support, University of Cambridge Computing Service. E-mail: bjh21@cam.ac.uk Tel: +44 (0)1223 334728 Fax: +44 (0)1223 334679 From owner-mailman@chiark.greenend.org.uk Wed May 28 20:10:39 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from draco.cus.cam.ac.uk ([131.111.8.18] ident=cusexim) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp for userv-discuss@chiark.greenend.org.uk id 19L6Jr-0007Yp-00; Wed, 28 May 2003 20:10:39 +0100 Received: from draco.cus.cam.ac.uk ([131.111.8.18]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.7.11) with esmtp id sauce-5432-1054149-1; 28 May 2003 19:10:39 +0000 (GMT) Received: from bjh21 (helo=localhost) by draco.cus.cam.ac.uk with local-esmtp (Exim 4.20) id 19L6Jm-0005e2-Um for userv-discuss@chiark.greenend.org.uk; Wed, 28 May 2003 20:10:34 +0100 Date: Wed, 28 May 2003 20:10:34 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: Re: Assertion failed: fdarray[fd].holdfd == -1, file process.c, line 648 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: On Thu, 22 May 2003, Ben Harris wrote: > I'm getting uservd exploding with an assertion failure: > > Assertion failed: fdarray[fd].holdfd == -1, file process.c, line 648 I've looked at this in more detail now, and I think (though I'm less than sure) that this assertion is bogus. As far as I can see, holdfd will be used (!= -1) at this point for any member of fdarray that's marked for reading, since establish_pipes() sets it up this way, and holdfd doesn't get reset until execservice(). Incidentally, as far as I can see, holdfd is used for two completely different purposes: holding an O_WRONLY descriptor on reading pipes from establish_pipes() to execservice(), and holding the number of the fd to which this fd should be dup()ed in the execservice() fd juggling. This is slightly confusing, but only slightly. Even more minorly, the use of fcntl() in execservice() is dodgy -- userv should do a F_GETFD/modify/F_SETFD operation to allow for the set of descriptor flags to be extended. I'll hack up a patch some time when I'm not late for dinner. -- Ben Harris Unix Support, University of Cambridge Computing Service. From owner-mailman@chiark.greenend.org.uk Thu May 29 11:59:57 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from draco.cus.cam.ac.uk ([131.111.8.18] ident=cusexim) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp for userv-discuss@chiark.greenend.org.uk id 19LL8X-0005wR-00; Thu, 29 May 2003 11:59:57 +0100 Received: from draco.cus.cam.ac.uk ([131.111.8.18]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.7.11) with esmtp id sauce-2499-1054205-1; 29 May 2003 10:59:57 +0000 (GMT) Received: from bjh21 (helo=localhost) by draco.cus.cam.ac.uk with local-esmtp (Exim 4.20) id 19LL8T-0006rs-2U for userv-discuss@chiark.greenend.org.uk; Thu, 29 May 2003 11:59:53 +0100 Date: Thu, 29 May 2003 11:59:53 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: Dodgy use of fcntl() in execservice() In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: On Wed, 28 May 2003, Ben Harris wrote: > Even more minorly, the use of fcntl() in execservice() is dodgy -- userv > should do a F_GETFD/modify/F_SETFD operation to allow for the set of > descriptor flags to be extended. I'll hack up a patch some time when I'm > not late for dinner. Here's the patch. It fixes two theoretical problems: 1: userv assumes that no file-descriptor flags other than FD_CLOEXEC will be set on a file descriptor. POSIX doesn't guarantee this, and requires applications to use read-modify-write operations to change file-descriptor flags. 2: userv assumes that all successful returns from fcntl(F_SETFD) will be positive. POSIX only guarantees that they'll be a value other that -1 (strange but true). See for the POSIX text on fcntl. Here's the patch. I've tried to follow the current coding style, which seems not to favour spaces. --- servexec.c.orig 2000-07-27 01:08:34.000000000 +0100 +++ servexec.c 2003-05-29 11:48:56.000000000 +0100 @@ -224,7 +224,7 @@ "-", 0 }; - int fd, realfd, holdfd, newfd, r, envvarbufsize=0, targ, nargs, i, l; + int fd, realfd, holdfd, newfd, r, envvarbufsize=0, targ, nargs, i, l, fdflags; char *envvarbuf=0; const char **args, *const *cpp; char *const *pp; @@ -286,7 +286,8 @@ } if (dup2(fdarray[fd].realfd,fd)<0) serv_syscallfail("dup2 set up fd"); if (close(fdarray[fd].realfd)) serv_syscallfail("close old fd"); - if (fcntl(fd,F_SETFD,0)<0) serv_syscallfail("set no-close-on-exec on fd"); + fdflags= fcntl(fd,F_GETFD); if (fdflags<0) serv_syscallfail("get fd flags"); + if (fcntl(fd,F_SETFD,fdflags&~FD_CLOEXEC)==-1) serv_syscallfail("set no-close-on-exec on fd"); fdarray[fd].realfd= fd; } -- Ben Harris Unix Support, University of Cambridge Computing Service. From owner-mailman@chiark.greenend.org.uk Thu May 29 12:33:43 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from draco.cus.cam.ac.uk ([131.111.8.18] ident=cusexim) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp for userv-discuss@chiark.greenend.org.uk id 19LLfD-0007UQ-00; Thu, 29 May 2003 12:33:43 +0100 Received: from draco.cus.cam.ac.uk ([131.111.8.18]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.7.11) with esmtp id sauce-2649-1054208-1; 29 May 2003 11:33:43 +0000 (GMT) Received: from bjh21 (helo=localhost) by draco.cus.cam.ac.uk with local-esmtp (Exim 4.20) id 19LLfC-00002y-91 for userv-discuss@chiark.greenend.org.uk; Thu, 29 May 2003 12:33:42 +0100 Date: Thu, 29 May 2003 12:33:42 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: Re: Dodgy use of fcntl() in execservice() In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: On Thu, 29 May 2003, Ben Harris wrote: > 2: userv assumes that all successful returns from fcntl(F_SETFD) will be > positive. When I say "positive", I do of course mean "non-negative". -- Ben Harris Unix Support, University of Cambridge Computing Service. From owner-mailman@chiark.greenend.org.uk Sun Jun 15 18:59:20 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from [172.18.45.6] (helo=davenant.greenend.org.uk ident=mail) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp id 19Rbmi-0001Hq-00; Sun, 15 Jun 2003 18:59:20 +0100 Received: from ian by davenant.greenend.org.uk with local (Exim 3.35 #1) id 19Rbmi-0002lD-00 (Debian); Sun, 15 Jun 2003 18:59:20 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16108.46072.117439.326247@davenant.relativity.greenend.org.uk> Date: Sun, 15 Jun 2003 18:59:20 +0100 To: Ben Harris Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: ucam MWS groupmanage hacks In-Reply-To: References: X-Mailer: VM 7.03 under Emacs 19.34.1 Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: Ben Harris writes ("ucam MWS groupmanage hacks"): > We've been using a hacked version of groupmanage on our Managed Web > Server[1] for some years now, and I've just updated it to correspond with > the latest version in userv-utils (CVS revision 1.3). Some of our local > changes might be of more general interest, so the patch to implement them > is below. The changes are: > > 1: Allow groupmanage.conf to specify the locations of the group, grouplist > and gtmp files. This is important if the real group file is made by > merging several parts, or if /etc isn't writable. This is good. > 2: Allow a command to be specified that should be run when groupmanage > finishes. Again, this is useful if the group file has to be constructed > from several parts. This is good. > 3: Allow more general restrictions on the names of user-created groups by > specifying a Perl regexp for them. That sounds good. > 4: Allow for an "admin" group. If such a group is defined, it has > permission to create a group even if "user-create" is turned off. I have two quibbles with this: * Instead of calling getgrnam, you should use the USERV_GROUP variable. * Your implementation allows admin users to manage any group ! > 5: Use a possibly-more-robust (certainly more complex) locking mechanism > for the group file. I no longer have any idea why I wanted this. The comments say something about NFS. My view is: don't use NFS like this (or at all if you can help it). > I'm not sure if the changes are large enough to merit an additional > copyright notice, but I've provided one just in case. The comment naming > me is for GPL clause 2a compliance and you can delete it if you want. So, I've applied the patches I like to my source tree and they'll be in the next userv-utils. Thanks, Ian. From owner-mailman@chiark.greenend.org.uk Sun Jun 15 19:17:55 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from [172.18.45.6] (helo=davenant.greenend.org.uk ident=mail) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp id 19Rc4h-0002gH-00; Sun, 15 Jun 2003 19:17:55 +0100 Received: from ian by davenant.greenend.org.uk with local (Exim 3.35 #1) id 19Rc4g-0002uf-00 (Debian); Sun, 15 Jun 2003 19:17:54 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16108.47186.498653.965037@davenant.relativity.greenend.org.uk> Date: Sun, 15 Jun 2003 19:17:54 +0100 To: Ben Harris Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: Dodgy use of fcntl() in execservice() In-Reply-To: References: X-Mailer: VM 7.03 under Emacs 19.34.1 Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: Ben Harris writes ("Dodgy use of fcntl() in execservice()"): > Here's the patch. It fixes two theoretical problems: > 1: userv assumes that no file-descriptor flags other than ... > 2: userv assumes that all successful returns from fcntl(F_SETFD) will be > positive. POSIX only guarantees that they'll be a value other that -1 I've applied your patch to my CVS, thanks. Ian. From owner-mailman@chiark.greenend.org.uk Sun Jun 29 13:55:19 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from [172.18.45.6] (helo=davenant.greenend.org.uk ident=mail) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp id 19WbiA-00064Z-00; Sun, 29 Jun 2003 13:55:18 +0100 Received: from ian by davenant.greenend.org.uk with local (Exim 3.35 #1) id 19Wbi4-0007L2-00 (Debian); Sun, 29 Jun 2003 13:55:12 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16126.57776.15330.686015@davenant.relativity.greenend.org.uk> Date: Sun, 29 Jun 2003 13:55:12 +0100 To: Ben Harris Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: Assertion failed: fdarray[fd].holdfd == -1, file process.c, line 648 In-Reply-To: References: X-Mailer: VM 7.03 under Emacs 19.34.1 Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: Ben Harris writes ("Re: Assertion failed: fdarray[fd].holdfd == -1, file process.c, line 648"): > On Thu, 22 May 2003, Ben Harris wrote: > > I'm getting uservd exploding with an assertion failure: > > Assertion failed: fdarray[fd].holdfd == -1, file process.c, line 648 > > I've looked at this in more detail now, and I think (though I'm less than > sure) that this assertion is bogus. [...] I've looked at it too now, and I agree. I've checked in a fix (ie, removed the assertion), and while I was at it I added some comments about the use of .holdfd. As soon as my access to ftp.gnu.org is working again I'll make a new release. Thanks, Ian. From owner-mailman@chiark.greenend.org.uk Thu Jul 10 19:32:57 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from draco.cus.cam.ac.uk ([131.111.8.18] ident=cusexim) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp for userv-discuss@chiark.greenend.org.uk id 19agDx-0001pT-00; Thu, 10 Jul 2003 19:32:57 +0100 Received: from draco.cus.cam.ac.uk ([131.111.8.18]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.7.14) with esmtp id sauce-7056-1057861-1; 10 Jul 2003 18:32:57 +0000 (GMT) Received: from bjh21 (helo=localhost) by draco.cus.cam.ac.uk with local-esmtp (Exim 4.20) id 19agDY-0002hX-27 for userv-discuss@chiark.greenend.org.uk; Thu, 10 Jul 2003 19:32:32 +0100 Date: Thu, 10 Jul 2003 19:32:31 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: groupmanage: correct getpwnam usage Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: Here's a tiny patch to fix groupmanage's usage of getpwnam so it doesn't claim that root doesn't exist. I can no longer remember _why_ we wanted to allow root to be a member or manager of a group, but it seemed important at the time, and there's certainly a bug here. --- groupmanage.1.5 Thu Jul 10 18:24:49 2003 +++ groupmanage Thu Jul 10 18:47:59 2003 @@ -227,7 +258,7 @@ } elsif (m/^\w[-0-9A-Za-z]*$/) { y/\n//d; $chgu=$_; - getpwnam($chgu) || &quit("username $chgu does not exist"); + defined(getpwnam($chgu)) || &quit("username $chgu does not exist"); eval "\@l = \@$clist; 1" || &quit("internal error: $@"); $already= grep($_ eq $chgu, @l); if ($action eq 'add') { -- Ben Harris Unix Support, University of Cambridge Computing Service. From owner-mailman@chiark.greenend.org.uk Fri Jul 11 19:22:07 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from draco.cus.cam.ac.uk ([131.111.8.18] ident=cusexim) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp for userv-discuss@chiark.greenend.org.uk id 19b2X1-0001ZC-00; Fri, 11 Jul 2003 19:22:07 +0100 Received: from draco.cus.cam.ac.uk ([131.111.8.18]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.7.14) with esmtp id sauce-7388-1057947-1; 11 Jul 2003 18:22:07 +0000 (GMT) Received: from bjh21 (helo=localhost) by draco.cus.cam.ac.uk with local-esmtp (Exim 4.20) id 19b2Ww-0003HB-OQ for userv-discuss@chiark.greenend.org.uk; Fri, 11 Jul 2003 19:22:02 +0100 Date: Fri, 11 Jul 2003 19:22:02 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: groupmanage patch: variable max name length Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: Here's a quick patch to allow for varying the maximum length of group names from its default of 8. Larger numbers (16, at least) seem to work on Solaris, and we wanted room for more descriptive names. --- groupmanage.1.5 Thu Jul 10 18:24:49 2003 +++ groupmanage Thu Jul 10 18:47:59 2003 @@ -74,2 +81,3 @@ 'name-regexp','', + 'name-maxlen','8', 'admin-group','', @@ -86,2 +98,3 @@ 'name-regexp','string', + 'name-maxlen','number', 'admin-group','string', @@ -150,5 +166,6 @@ &quit("group creation by users disabled by administrator"); - length($groupname) <= 8 || &quit("group names must be 8 chars or fewer"); + length($groupname) <= $opt{'name-maxlen'} || + &quit("group names must be $opt{'name-maxlen'} chars or fewer"); $!=0; (@pw= getpwuid($callinguser)) || &quit("cannot get your passwd entry: $!"); $createby= $pw[0]; -- Ben Harris Unix Support, University of Cambridge Computing Service. From owner-mailman@chiark.greenend.org.uk Fri Jul 11 19:28:58 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from draco.cus.cam.ac.uk ([131.111.8.18] ident=cusexim) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp for userv-discuss@chiark.greenend.org.uk id 19b2de-0001xb-00; Fri, 11 Jul 2003 19:28:58 +0100 Received: from draco.cus.cam.ac.uk ([131.111.8.18]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.7.14) with esmtp id sauce-7437-1057948-1; 11 Jul 2003 18:28:58 +0000 (GMT) Received: from bjh21 (helo=localhost) by draco.cus.cam.ac.uk with local-esmtp (Exim 4.20) id 19b2dZ-0003MW-E4 for userv-discuss@chiark.greenend.org.uk; Fri, 11 Jul 2003 19:28:53 +0100 Date: Fri, 11 Jul 2003 19:28:53 +0100 (BST) From: Ben Harris To: userv-discuss@chiark.greenend.org.uk Subject: groupmanage patch: user creation Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: A rather more involved patch, this. It gives groupmanage the ability to create a user to correspond with a groupmanaged group. The intention is that the user should be security-equivalent to the group, so that membership of the group gives control over the user (through group-writability of its home directory), and the user is a member of the group. The point behind it is to allow for things that can't be done by a group alone, like owning processes, running cron jobs etc. I assume it's not necessary to actually log in as a user, and that frobbing the passwd file (leaving the shadow file alone) is enough to create one. The latter seems to be true on Solaris, but won't be on *BSD, or if you're using NIS or something. The patch is a little ropey at the moment, and we haven't made any significant use of it yet, but I thought people might be interested. In particular, the naming of the configuration-file and command-line options is appalling, but I couldn't come up with anything good. --- groupmanage.1.5 Thu Jul 10 18:24:49 2003 +++ groupmanage Thu Jul 10 18:47:59 2003 @@ -37,6 +37,7 @@ --manager-remove ... --title --owner [root only] + --create-user groupmanage is Copyright. It is free software, released under the GNU GPL v2 or later. There is NO WARRANTY. See the GPL for details. END @@ -68,7 +72,10 @@ 'user-create-max','19999', 'user-create-nameintitle','0', 'user-create-maxperu','5', + 'allow-creation-of-users','0', 'group-file','group', 'gtmp-file','gtmp', 'grouplist-file','grouplist', + 'passwd-file','passwd', + 'ptmp-file','ptmp', 'name-regexp','', @@ -75,12 +83,16 @@ 'admin-group','', - 'finish-command',''); + 'finish-command','', + 'homedir-base','/home'); %ovalid= ('user-create','boolean', 'user-create-minunameu','number', 'user-create-min','number', 'user-create-max','number', 'user-create-nameintitle','boolean', 'user-create-maxperu','number', + 'allow-creation-of-users','boolean', 'group-file','string', 'gtmp-file','string', 'grouplist-file','string', + 'passwd-file','string', + 'ptmp-file','string', 'name-regexp','string', @@ -87,5 +100,6 @@ 'admin-group','string', - 'finish-command','string'); + 'finish-command','string', + 'homedir-base','string'); sub ov_boolean { $cov= $_ eq 'yes' ? 1 : @@ -222,6 +240,19 @@ } $description= $_; &p("title set to $description"); + } elsif (m/^--create-user$/) { + if ($opt{'allow-creation-of-users'}) { + $passwdfileix == -1 || &quit("user already exists"); + $passwdfileix= $#passwdfile+1; + $upassword = '*'; + $ushell = ''; + if ($homedir eq '') { + $homedir = "$opt{'homedir-base'}/$groupname"; + mkdir($homedir) || &quit("mkdir $homedir: $!"); + chmod(02775, $homedir) || &quit("chmod $homedir: $!"); + chown($gid, $gid, $homedir) || &quit("chown $homedir: $!"); + } + } } elsif (m/^-/) { &usage("unknown option $_"); } elsif (m/^\w[-0-9A-Za-z]*$/) { @@ -260,8 +291,15 @@ "$groupname:$password:$gid:".join(',',@members)."\n"; $grouplist[$grouplistix]= "$groupname:$description:$owner:".join(',',@managers).":$homedir\n"; +if ($opt{'allow-creation-of-users'} && $passwdfileix != -1) { + $passwdfile[$passwdfileix]= + "$groupname:$upassword:$gid:$gid:$description:$homedir:$ushell\n"; +} &save($opt{'group-file'},@groupfile); &save($opt{'grouplist-file'},@grouplist); +if ($opt{'allow-creation-of-users'}) { + &save($opt{'passwd-file'},@passwdfile); +} if ($opt{'finish-command'}) { !system($opt{'finish-command'}) || &quit("finish-command: $?"); } @@ -305,6 +343,28 @@ $homedir= $5; @managers= split(/,/,$4); } + if ($opt{'allow-creation-of-users'}) { + open(PF,"< $opt{'passwd-file'}") || &quit("read passwd: $!"); + @passwdfile=; close(PF); + $passwdfileix=-1; + for ($i=0; $i<=$#passwdfile; $i++) { + $_= $passwdfile[$i]; s/\n$//; + next if m/^\#/; + m/^(\w[-0-9A-Za-z]*):([^:]*):(\d+):(\d+):([^:]*):([^:]*):([^:]*)$/ || + &quit("bad entry in passwd: $_"); + $uname2uid{$1}=$3; + next unless $1 eq $groupname; + $passwdfileix<0 || &quit("duplicate entries in passwd"); + $passwdfileix= $i; + defined($gid) || &quit("user exists in passwd without group"); + $3==$4 || &quit("uid and gid don't match in passwd"); + $3==$gid || &quit("gids in passwd and group don't match"); + $5 eq $description || &quit("description and gecos don't match"); + $6 eq $homedir || &quit("homedirs in passwd and grouplist don't match"); + $upassword= $2; + $ushell= $7; + } + } } sub checkexists { @@ -355,6 +415,9 @@ members @members homedir $homedir END + if ($opt{'allow-creation-of-users'}) { + print 'user-exists ', $passwdfileix != -1 ? 'yes' : 'no', "\n"; + } } sub p_out { -- Ben Harris Unix Support, University of Cambridge Computing Service. E-mail: bjh21@cam.ac.uk Tel: +44 (0)1223 334728 Fax: +44 (0)1223 334679 From owner-mailman@chiark.greenend.org.uk Fri Jul 11 19:38:31 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from draco.cus.cam.ac.uk ([131.111.8.18] ident=cusexim) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp id 19b2mt-0002Vu-00; Fri, 11 Jul 2003 19:38:31 +0100 Received: from draco.cus.cam.ac.uk ([131.111.8.18]) ident cusexim by chiark.greenend.org.uk (SAUCE v0.7.14) with esmtp id sauce-7517-1057948-2; 11 Jul 2003 18:38:31 +0000 (GMT) Received: from bjh21 (helo=localhost) by draco.cus.cam.ac.uk with local-esmtp (Exim 4.20) id 19b2mo-0003UR-Ey; Fri, 11 Jul 2003 19:38:26 +0100 Date: Fri, 11 Jul 2003 19:38:26 +0100 (BST) From: Ben Harris To: Ian Jackson cc: userv-discuss@chiark.greenend.org.uk Subject: Re: ucam MWS groupmanage hacks In-Reply-To: <16108.46072.117439.326247@davenant.relativity.greenend.org.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: On Sun, 15 Jun 2003, Ian Jackson wrote: > > 4: Allow for an "admin" group. If such a group is defined, it has > > permission to create a group even if "user-create" is turned off. > > I have two quibbles with this: > * Instead of calling getgrnam, you should use the USERV_GROUP > variable. OK. The patch below fixes this. > * Your implementation allows admin users to manage any group ! This is deliberate, but I accept that it may not be what's wanted in all cases. In fact, it really suggests that groupmanage wants a richer ACL system We wanted admin users to have some of the privilages of root (notably the ability to manage any group visible in their chroot), but not all of them (in particular, not the right to override the naming rules). The patch basically implements the semantics we needed, and doesn't worry about the fact that the world might contain security policies that are different from both chiark and the MWS. I don't have a good solution to this -- it might be best to leave this patch out until someone does. > > 5: Use a possibly-more-robust (certainly more complex) locking mechanism > > for the group file. I no longer have any idea why I wanted this. > > The comments say something about NFS. My view is: don't use NFS like > this (or at all if you can help it). The confusing thing is that we don't use NFS on the MWS, never have done, and have never intended to. I've removed the code from our groupmanage, anyway. Here's the revised admin-users patch, for reference: --- groupmanage.1.5 Thu Jul 10 18:24:49 2003 +++ groupmanage Thu Jul 10 18:47:59 2003 @@ -61,6 +62,8 @@ @ARGV || push(@ARGV,'--info'); $callinguser= exists $ENV{'USERV_UID'} ? $ENV{'USERV_UID'} : $<; +@callinggroups = exists $ENV{'USERV_GROUP'} ? + split(/ /, $ENV{'USERV_GROUP'}) : map(getgrgid($_), split(/ /, $()); %opt= ('user-create','0', 'user-create-minunameu','5', @@ -147,4 +161,6 @@ if ($ARGV[0] eq '--create') { $opt{'user-create'} || !$callinguser || + ($opt{'admin-group'} && + grep($_ eq $opt{'admin-group'}, @callinggroups)) || &quit("group creation by users disabled by administrator"); @@ -191,6 +208,7 @@ } &weare($owner) || grep(&weare($_),@managers) || !$callinguser || + ($opt{'admin-group'} && grep($_ eq $opt{'admin_group'}, @callinggroups)) || &quit("you may not manage $groupname"); $action= 'none'; -- Ben Harris Unix Support, University of Cambridge Computing Service. From owner-mailman@chiark.greenend.org.uk Sun Jul 13 23:57:40 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from [172.18.45.6] (helo=davenant.greenend.org.uk ident=mail) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp id 19bpmm-0007y7-00; Sun, 13 Jul 2003 23:57:40 +0100 Received: from ian by davenant.greenend.org.uk with local (Exim 3.35 #1) id 19bpml-00064Y-00 (Debian); Sun, 13 Jul 2003 23:57:39 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16145.58339.914202.717426@davenant.relativity.greenend.org.uk> Date: Sun, 13 Jul 2003 23:57:39 +0100 To: Ben Harris Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: groupmanage: correct getpwnam usage In-Reply-To: References: X-Mailer: VM 7.03 under Emacs 19.34.1 Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: Ben Harris writes ("groupmanage: correct getpwnam usage"): > Here's a tiny patch to fix groupmanage's usage of getpwnam so it doesn't > claim that root doesn't exist. I can no longer remember _why_ we wanted > to allow root to be a member or manager of a group, but it seemed > important at the time, and there's certainly a bug here. > > --- groupmanage.1.5 Thu Jul 10 18:24:49 2003 > +++ groupmanage Thu Jul 10 18:47:59 2003 I have applied your change to my CVS. Ian. From owner-mailman@chiark.greenend.org.uk Sun Jul 13 23:59:02 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from [172.18.45.6] (helo=davenant.greenend.org.uk ident=mail) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp id 19bpo6-00082y-00; Sun, 13 Jul 2003 23:59:02 +0100 Received: from ian by davenant.greenend.org.uk with local (Exim 3.35 #1) id 19bpo5-00065b-00 (Debian); Sun, 13 Jul 2003 23:59:01 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16145.58421.765735.374820@davenant.relativity.greenend.org.uk> Date: Sun, 13 Jul 2003 23:59:01 +0100 To: Ben Harris Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: groupmanage patch: variable max name length In-Reply-To: References: X-Mailer: VM 7.03 under Emacs 19.34.1 Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: Ben Harris writes ("groupmanage patch: variable max name length"): > Here's a quick patch to allow for varying the maximum length of group > names from its default of 8. Larger numbers (16, at least) seem to work > on Solaris, and we wanted room for more descriptive names. > > --- groupmanage.1.5 Thu Jul 10 18:24:49 2003 > +++ groupmanage Thu Jul 10 18:47:59 2003 Thanks, I've applied that patch to my CVS. Ian. From owner-mailman@chiark.greenend.org.uk Mon Jul 14 00:02:41 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from [172.18.45.6] (helo=davenant.greenend.org.uk ident=mail) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp id 19bprd-0008Cv-00; Mon, 14 Jul 2003 00:02:41 +0100 Received: from ian by davenant.greenend.org.uk with local (Exim 3.35 #1) id 19bprV-00067p-00 (Debian); Mon, 14 Jul 2003 00:02:33 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16145.58633.627780.217343@davenant.relativity.greenend.org.uk> Date: Mon, 14 Jul 2003 00:02:33 +0100 To: Ben Harris Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: groupmanage patch: user creation In-Reply-To: References: X-Mailer: VM 7.03 under Emacs 19.34.1 Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: Ben Harris writes ("groupmanage patch: user creation"): > A rather more involved patch, this. [...] Quite so. I think I'll keep this one on file, for now, and not apply it - at least until I've done the next release. > I assume [that] frobbing the passwd file (leaving the shadow file > alone) is enough to create one. The latter seems to be true on > Solaris, but won't be on *BSD, or if you're using NIS or something. Quite so. Hrm. I'm not sure what to do about that portability nightmare. Also, I note that your implementation seems to have a race - you have a setting `ptmp-file' but you don't seem to use it. Ian. From owner-mailman@chiark.greenend.org.uk Mon Jul 14 00:04:05 2003 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from [172.18.45.6] (helo=davenant.greenend.org.uk ident=mail) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp id 19bpsz-0008IV-00; Mon, 14 Jul 2003 00:04:05 +0100 Received: from ian by davenant.greenend.org.uk with local (Exim 3.35 #1) id 19bpsz-00068V-00 (Debian); Mon, 14 Jul 2003 00:04:05 +0100 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16145.58725.178735.386181@davenant.relativity.greenend.org.uk> Date: Mon, 14 Jul 2003 00:04:05 +0100 To: Ben Harris Cc: userv-discuss@chiark.greenend.org.uk Subject: Re: ucam MWS groupmanage hacks In-Reply-To: References: <16108.46072.117439.326247@davenant.relativity.greenend.org.uk> X-Mailer: VM 7.03 under Emacs 19.34.1 Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: Ben Harris writes ("Re: ucam MWS groupmanage hacks"): > On Sun, 15 Jun 2003, Ian Jackson wrote: > > * Your implementation allows admin users to manage any group ! > > This is deliberate, but I accept that it may not be what's wanted in all > cases. In fact, it really suggests that groupmanage wants a richer ACL > system. We wanted admin users to have some of the privilages of root > (notably the ability to manage any group visible in their chroot), but not > all of them (in particular, not the right to override the naming rules). Ah, I think your chroots are showing here. In a `normal' system, an admin user would quickly become nearly root-equivalent. I'll think about the right answer. Ian. From owner-mailman@chiark.greenend.org.uk Sat Nov 05 23:54:00 2005 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from smtp2.poczta.onet.pl ([213.180.130.30]) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp (return-path bastardx@op.pl) id 1EYXrE-0004fP-00 for userv-discuss@chiark.greenend.org.uk; Sat, 05 Nov 2005 23:54:00 +0000 Received: from smtp2.poczta.onet.pl ([213.180.130.30]) by chiark.greenend.org.uk (SAUCE v0.8.1) with esmtp id sauce-15784-1131234-1; 05 Nov 2005 23:54:00 +0000 (GMT) Received: from axt178.internetdsl.tpnet.pl ([83.18.97.178]:37135 "EHLO MAGNUSMOBILE") by ps2.test.onet.pl with ESMTP id ; Sun, 6 Nov 2005 00:53:27 +0100 Message-ID: <001701c5e264$15499d00$6664a8c0@MAGNUSMOBILE> Reply-To: "bastardx" From: "bastardx" To: Subject: cat fd0: -: Invalid argument Date: Sun, 6 Nov 2005 00:53:12 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-2"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: Hi I am using userv to perform simple operation on my server from apache webserve fg quota, du, free etc. Few days ago I installed php as cgi (fastcgi) with mod_fcgid http://fastcgi.coremail.cn/index.htm Since that moment I have problem with userv. When I try to run command fg exec("/usr/local/bin/userv root quota user") I see following logs php log cat fd0: -: Invalid argument userv: cat for fd 0 exited with error exit status 1 userv: uservd reports that service failed cat fd0: -: Invalid argument userv: cat for fd 0 exited with error exit status 1 userv: system call failure: flush server socket: Broken pipe cat fd0: -: Invalid argument userv: cat for fd 0 exited with error exit status 1 message log uservd[20029]: user apache -> root : quota uservd[20029]: service completed (status 0 0) uservd[20036]: user apache -> root : quota uservd[20036]: client disconnected uservd[20041]: user apache -> root : quota uservd[20041]: client disconnected above command sometimes returns valid information "service completed (status 0 0) " sometimes nothing "client disconnected" system.default configuration if ( grep service-user-shell /etc/shells & glob service quota & glob calling-user apache ) reset no-suppress-args execute /usr/bin/quota no-disconnect-hup fi what could be a cause to this strange behaviour? From owner-mailman@chiark.greenend.org.uk Tue Nov 08 12:14:00 2005 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from [172.18.45.6] (helo=davenant.greenend.org.uk ident=mail) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp (return-path ian@davenant.greenend.org.uk) id 1EZSMR-0006PY-00; Tue, 08 Nov 2005 12:13:59 +0000 Received: from ian by davenant.greenend.org.uk with local (Exim 3.35 #1) id 1EZSMP-0003LH-00 (Debian); Tue, 08 Nov 2005 12:13:57 +0000 From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17264.38533.542266.393886@davenant.relativity.greenend.org.uk> Date: Tue, 8 Nov 2005 12:13:57 +0000 To: "bastardx" Cc: Subject: Re: cat fd0: -: Invalid argument In-Reply-To: <001701c5e264$15499d00$6664a8c0@MAGNUSMOBILE> References: <001701c5e264$15499d00$6664a8c0@MAGNUSMOBILE> X-Mailer: VM 7.03 under Emacs 19.34.1 Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: bastardx writes ("cat fd0: -: Invalid argument"): > I am using userv to perform simple operation on my server from apache > webserve fg quota, du, free etc. > Few days ago I installed php as cgi (fastcgi) with mod_fcgid > http://fastcgi.coremail.cn/index.htm > Since that moment I have problem with userv. When I try to run command > fg exec("/usr/local/bin/userv root quota user") I see following logs > > php log > cat fd0: -: Invalid argument > userv: cat for fd 0 exited with error exit status 1 What is the userv program's stdin connected to ? Ian. From owner-mailman@chiark.greenend.org.uk Tue Nov 08 13:15:50 2005 Return-path: Envelope-to: userv-discuss@chiark.greenend.org.uk Received: from smtp7.poczta.onet.pl ([213.180.130.47]) by chiark.greenend.org.uk (Debian Exim 3.35 #1) with esmtp (return-path bastardx@op.pl) id 1EZTKI-0002eU-00 for userv-discuss@chiark.greenend.org.uk; Tue, 08 Nov 2005 13:15:50 +0000 Received: from smtp7.poczta.onet.pl ([213.180.130.47]) by chiark.greenend.org.uk (SAUCE v0.8.1) with esmtp id sauce-5358-1131455-1; 08 Nov 2005 13:15:50 +0000 (GMT) Received: from dsb193.neoplus.adsl.tpnet.pl ([83.24.213.193]:18956 "EHLO MAGNUSMOBILE") by ps7.test.onet.pl with ESMTP id ; Tue, 8 Nov 2005 14:15:05 +0100 Message-ID: <001901c5e466$65be13c0$6f00a8c0@MAGNUSMOBILE> Reply-To: "bastardx" From: "bastardx" To: References: <001701c5e264$15499d00$6664a8c0@MAGNUSMOBILE> <17264.38533.542266.393886@davenant.relativity.greenend.org.uk> Subject: Re: cat fd0: -: Invalid argument Date: Tue, 8 Nov 2005 14:14:48 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Sender: userv-discuss-admin@chiark.greenend.org.uk Errors-To: userv-discuss-admin@chiark.greenend.org.uk X-BeenThere: userv-discuss@chiark.greenend.org.uk X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: userv (security boundary facility) - discussion List-Unsubscribe: , List-Archive: > What is the userv program's stdin connected to ? Hi. Thanks for your reply. Forgive me my lack of knowledge. How to check this? I have running following process root 23608 0.0 0.0 1564 488 pts/0 S 13:54 0:00 /usr/local/sbin/uservd lsof -p 23608 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME uservd 23608 root cwd DIR 3,3 4096 1531743 /var/run/userv uservd 23608 root rtd DIR 3,3 4096 2 / uservd 23608 root txt REG 3,3 136548 1401554 /usr/local/sbin/uservd uservd 23608 root mem REG 3,3 106912 537535 /lib/ld-2.3.2.so uservd 23608 root mem REG 3,3 1573120 944729 /lib/tls/libc-2.3.2.so uservd 23608 root 0u CHR 136,0 2 /dev/pts/0 uservd 23608 root 1u CHR 136,0 2 /dev/pts/0 uservd 23608 root 2u CHR 136,0 2 /dev/pts/0 uservd 23608 root 3u unix 0xdec1bac0 2769117 socket uservd 23608 root 4u unix 0xc17a6580 2769118 socket ls -al /var/run/userv/ total 8 drw------- 2 root root 4096 Nov 8 14:05 . drwxr-xr-x 11 root root 4096 Nov 8 07:53 .. srwxr-xr-x 1 root root 0 Nov 8 13:54 socket