9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "ron minnich" <rminnich@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: [9fans] my previous note on vf
Date: Sat,  2 Jun 2007 20:14:38 -0700	[thread overview]
Message-ID: <13426df10706022014k240d2a96h12dea0548fa6a093@mail.gmail.com> (raw)

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


             reply	other threads:[~2007-06-03  3:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-03  3:14 ron minnich [this message]
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
2007-06-03  4:29 geoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13426df10706022014k240d2a96h12dea0548fa6a093@mail.gmail.com \
    --to=rminnich@gmail.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).