[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with runas + filepriv



ZMailers (all versions) and    RUNAS .. FILEPRIV ..

	Here below is an ages old error, which is present
	also in the lattest ZM by Edwin Allum.

	Nobody noticed it before, because the way the old
	FILEPRIV works:  it uses only one argument, but
	this new one uses more..

	I am wrestling with one (new) pathological input
	case which kept crashing my router, however now
	that I got it straightened, it reports sub-optimal
	error message :-/

		From: =Some=MIME-2=Stuff= Word" <user@node> (comment
			(more comments) in here)

	(I agree, error messaging is difficult to do right..)

	... and I am supposed to do a paid project instead of
	ZMailer :-)

		/Matti Aarnio	<mea@utu.fi>

> Matti,
> 
> 	gcc version 2.6.0
> 	SunOS scapa 4.1.3_U1 2 sun4m
> 	zmailer-2.99.7
> 
> Can you  confirm that this alluded to patch made it into zmailer-2.99.7? 
> I seem to be getting something similiar.
> My suspicion was aroused when mail to the vacation program
> failed with the the "mail to a program not allowed" message.
> 
> % cat ~anne/.forward
> anne, "|/usr/ucb/vacation anne"
> 
> 
> # router -i
> ZMailer router (2.99.6mea #1: Tue Jan  3 14:05:46 MST 1995)
>                      ^?
>   bruce@shoal-lk:/usr/miette/src/Mail/zmailer/zmailer-2.99.7/router
>                                                            ^

	Oh, I must remember to update the top-level Makefile..

> Copyright 1992 Rayan S. Zachariassen
> Copyright 1992,1993,1994 Matti Aarnio
> 
> z# router anne
> <bruce.interactive@scapa.cs.ualberta.ca>: address: anne
> runas: setuid(-2): Invalid argument
> (((local anne anne default_attributes)))
> z# runas -2 filepriv -M 644 /usr/cavell/guest/anne/.forward
> runas: setuid(-2): Invalid argument

	Hmm.. Your system is SVR4 ?    No, you said SunOS 4.1.3U1 above..


> z# runas 65534 filepriv -M 644 /usr/cavell/guest/anne/.forward
> -M: No such file or directory
> filepriv: cannot fopen("-M")!
> z# 

nic:~|18647$ /lib/sendmail -bt
ZMailer router (2.99.3mea #2: Wed Dec 28 15:02:07 EET 1994)
  mea@nic:/mnt/staff/mea/zmailer-2.99.3/router
Copyright 1992 Rayan S. Zachariassen
Copyright 1992,1993,1994 Matti Aarnio

z$ /bin/ls -l zm.lst
-rw-r--r--  1 mea          7465 Nov 13 23:07 zm.lst
z$ filepriv
Usage: filepriv [-M maxperm] pathname [ uid ]
z$ filepriv -M 600 zm.lst
60001
z$ echo $NOBODY
nobody
z$ filepriv -M 644 zm.lst
10909
z$ runas -2 filepriv -M 644 zm.lst
-M: No such file or directory
filepriv: cannot fopen("-M")!
z$ runas 6001 filepriv -M 644 zm.lst
-M: No such file or directory
filepriv: cannot fopen("-M")!

	Hmm..

	..  Ooo..  A SUBTLE bug in  libsh/interpret.c: fapply()
----------------------------------------------------------------
                for (ll = car(l); ll != NULL; ll = cdr(l)) {
                        if (STRING(ll))
                                argv[argc++] = (char *)ll->string;
                }
                argv[argc] = NULL;
-----Emacs: interpret.c<2>      (C)--97%------------------------
                for (ll = car(l); ll != NULL; ll = cdr(ll)) {
                        if (STRING(ll))
                                argv[argc++] = (char *)ll->string;
                }
-----Emacs: interpret.c         (C)--98%------------------------


	Now it runs:
----------------------------------------------------------------
z$ /bin/ls -l netdb.h
-rw-r--r--   1 mea      lake        5904 May 19  1994 netdb.h
z$ runas nobody filepriv -M 644 netdb.h
401
z$ runas nobody filepriv -M 600 netdb.h
60001
----------------------------------------------------------------

> -- 
> Bruce Wm Folliott <bruce@cs.ualberta.ca>
> http://web.cs.ualberta.ca/~bruce/