9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] my previous note on vf
@ 2007-06-03  4:29 geoff
  0 siblings, 0 replies; 9+ messages in thread
From: geoff @ 2007-06-03  4:29 UTC (permalink / raw)
  To: 9fans

We relay lots of mail here, but our configuration is customised
somewhat relative to what's on sources.

I've just pushed out changes to vf and validateattachment that should
prevent the problem Ron encountered and give better error messages if
something similar does happen.



^ permalink raw reply	[flat|nested] 9+ messages in thread
* [9fans] my previous note on vf
@ 2007-06-03  3:14 ron minnich
  2007-06-03  3:26 ` geoff
  0 siblings, 1 reply; 9+ messages in thread
From: ron minnich @ 2007-06-03  3:14 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Well, all my unhappiness with vf still applies but is now x2.

So, the real problem with the failed mail w/pictures is this from what
I can now tell:

error+ failed with error 'error creating temporary file:
'/tmp/vf.00000037245' permission denied
error+ rc: note: mail refused: we don't accept executable attachments
error+ '.
error+ The mailer `/mail/lib/qmail 'mbgokhale.org!maya' 'net!$smtp''
returned error status 72.
error+
error+

The path is this (do a src vf):
/*
 * Run the external checker to do content-based checks.
 */
static int
runchecker(Part *p)
{
	int pid;
	char *name;
	Waitmsg *w;

	if(access("/mail/lib/validateattachment", AEXEC) < 0)
		return 0;

	name = savetmp(p);
	fprint(2, "run checker %s\n",
.
.
.

savetmp does this:
static char*
savetmp(Part *p)
{
	char buf[40], *name;
	int fd;

	strcpy(buf, "/tmp/vf.XXXXXXXXXXX");
	name = mktemp(buf);
	if((fd = create(name, OWRITE|OEXCL, 0666)) < 0){
		fprint(2, "error creating temporary file: %r\n");
		refuse();
	}

note the failure path, which is refuse, which does this:
void
refuse(void)
{
	postnote(PNGROUP, getpid(), "mail refused: we don't accept executable
attachments");
	exits("mail refused: we don't accept executable attachments");
}

In other words, the return error in this case is pretty seriously
bogus. A tmp file create fails, which translates to a 'we don't take
that attachment type'. To say the least, this leaves the poor Mac user
in the dark.

It seems the temporary file create really does fail, but the error
returned is utterly wrong: it has nothing to do with executable
attachments.

Now it seems that I've hit something I had not had to think about before.
Listen is started up in /rc/bin/cpurc. It does a becomenone(). So
where can listen
open a /tmp file? Does /usr/bootes/tmp need to be 777?
In other words, how can this script,

#!/bin/rc
#smtp serv net incalldir user

user=`{cat /dev/user}
exec upas/smtpd -n $3

running as user 'none', ever spawn a process which can open a tmp
file? Where is /tmp for none anyway?

Thanks

ron


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-06-06  9:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-03  4:29 [9fans] my previous note on vf geoff
  -- strict thread matches above, loose matches on Subject: below --
2007-06-03  3:14 ron minnich
2007-06-03  3:26 ` geoff
2007-06-03  3:32   ` ron minnich
2007-06-03  3:43     ` W B Hacker
2007-06-06  8:49       ` Douglas A. Gwyn
2007-06-06  9:07         ` W B Hacker
2007-06-03  4:03     ` erik quanstrom
2007-06-03  8:58     ` Steve Simon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).