Re: [vchkpw] perms on maildirsize

2005-03-31 Thread Charles Sprickman
On Fri, 18 Feb 2005, Ken Jones wrote:
On Thursday 17 February 2005 8:44 pm, Charles Sprickman wrote:
Howdy,
Can anyone shed some light on this?  I've got maildirsize files randomly
flipping to root ownership.  I'm a bit confused as to how this could
happen - all delivery is done by vpopmail, and none of that stuff runs as
root.  That leaves courier-imap/pop, which do run as root.
So I posted to the courier list (asbestos on, check...) and Mr. Sam
replied that this is a "known bug in vpopmail".  Looking through the
vpopmail archives I don't see any sign of this.  I do see a few threads
about size miscalculations, but that's an entirely different issue.
Any ideas?
I checked the code and where the maildirsize file gets created it does
not set the ownership. Most of the time the permissions get set with
the setuid call. But if it gets called some other way without the setuid
then the maildirsize file would probably be created as the owner of
the process,not the owner of the directory.
Perhaps we should put some set ownership code around the creation
of the maildirsize file?
Should I go ahead and formally request that at the SF bug tracker? 
Re-reading this thread, I see Paul noted that he does see vuserinfo do 
this sometimes.  I've never caught it, but if he has, that's good enough 
for me.  The list of stuff that runs as root (as far as I know ALL 
vpopmail cli tools need to run as root) is really short...

Thanks,
Charles
Ken Jones


Re: [vchkpw] perms on maildirsize

2005-02-18 Thread Jeremy Kitchen
On Friday 18 February 2005 02:45 pm, Tom Collins wrote:
> There are few apps that will touch that file.  Vdelivermail and the
> vpopmail tools are one.  Courier-IMAP is another, as is qmail-pop3d if
> you're running it.  Qmailadmin does as well, but it runs as the
> vpopmail user so it couldn't be responsible.

some systems have to run qmailadmin as root.

-Jeremy

-- 
Jeremy Kitchen ++ Systems Administrator ++ Inter7 Internet Technologies, Inc.
  [EMAIL PROTECTED] ++ www.inter7.com ++ 866.528.3530 ++ 815.776.9465 int'l
  kitchen @ #qmail #gentoo on EFnet IRC ++ scriptkitchen.com/qmail
 GnuPG Key ID: 481BF7E2 ++ jabber:[EMAIL PROTECTED]


pgpzFSvPUN1nu.pgp
Description: PGP signature


Re: [vchkpw] perms on maildirsize

2005-02-18 Thread Tom Collins
On Feb 18, 2005, at 11:42 AM, Charles Sprickman wrote:
Anyone want to speculate as to why vuserinfo might sometimes screw the 
perms and sometimes not?  Does anyone know of the problem Mr. Sam said 
is "known"?
Mr. Sam's default response to any problems on systems involving 
vpopmail is that it's a "known problem with vpopmail".  In the past, 
that may have been true, but I feel that vpopmail 5.4 and later have 
corrected a lot of the "known problems".

I've been working on the vpopmail code for a few years now.  We've been 
hosted on SourceForge for awhile as well.  In that time, no one has 
reported a problem with vpopmail creating a maildirsize file owned by 
root instead of vpopmail.  Perhaps Mr. Sam could provide some details 
on some of the problems he knows about so we can fix them.

There are few apps that will touch that file.  Vdelivermail and the 
vpopmail tools are one.  Courier-IMAP is another, as is qmail-pop3d if 
you're running it.  Qmailadmin does as well, but it runs as the 
vpopmail user so it couldn't be responsible.  Maybe vmoduser does it, 
but I'd think it would have come up before now.  Maybe SqWebMail, but I 
don't know much about that program.

It would take a lot of work, but you could write a program to look for 
root-owned maildirsize files, log the directory and timestamp of the 
file, and then check the maillog to see if the file was created while 
that user was logged into Courier-IMAP.

--
Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
You don't need a laptop to troubleshoot high-speed Internet: 
sniffter.com



Re: [vchkpw] perms on maildirsize

2005-02-18 Thread Ken Jones
On Thursday 17 February 2005 8:44 pm, Charles Sprickman wrote:
> Howdy,
>
> Can anyone shed some light on this?  I've got maildirsize files randomly
> flipping to root ownership.  I'm a bit confused as to how this could
> happen - all delivery is done by vpopmail, and none of that stuff runs as
> root.  That leaves courier-imap/pop, which do run as root.
>
> So I posted to the courier list (asbestos on, check...) and Mr. Sam
> replied that this is a "known bug in vpopmail".  Looking through the
> vpopmail archives I don't see any sign of this.  I do see a few threads
> about size miscalculations, but that's an entirely different issue.
>
> Any ideas?

I checked the code and where the maildirsize file gets created it does
not set the ownership. Most of the time the permissions get set with 
the setuid call. But if it gets called some other way without the setuid
then the maildirsize file would probably be created as the owner of
the process,not the owner of the directory.

Perhaps we should put some set ownership code around the creation
of the maildirsize file?

Ken Jones


Re: [vchkpw] perms on maildirsize

2005-02-18 Thread Charles Sprickman
On Thu, 17 Feb 2005, Paul Theodoropoulos wrote:
At 06:44 PM 2/17/2005, Charles Sprickman wrote:
Howdy,
Can anyone shed some light on this?  I've got maildirsize files randomly 
flipping to root ownership.  I'm a bit confused as to how this could happen 
- all delivery is done by vpopmail, and none of that stuff runs as root. 
That leaves courier-imap/pop, which do run as root.

So I posted to the courier list (asbestos on, check...) and Mr. Sam replied 
that this is a "known bug in vpopmail".  Looking through the vpopmail 
archives I don't see any sign of this.  I do see a few threads about size 
miscalculations, but that's an entirely different issue.

Any ideas?
[bottom posting to appease the text-formatting nazis]
i see that when i run vuserinfo [EMAIL PROTECTED] as root, which is often how i 
run it
I thought that vuserinfo did a setuid to vpopmail...  I know that for me 
it only works if I run it as root.  Even if run as vpopmail with su it 
will throw an error about not being able to "setuid".

Anyone want to speculate as to why vuserinfo might sometimes screw the 
perms and sometimes not?  Does anyone know of the problem Mr. Sam said is 
"known"?

FWIW:
[EMAIL PROTECTED]/home/vpopmail/domains/bway.net/M/chip/Maildir]# ls -al 
maildirsize
-rw-r--r--  1 vpopmail  vchkpw  2124 Feb 18 13:58 maildirsize
[EMAIL PROTECTED]/home/vpopmail/domains/bway.net/M/chip/Maildir]# rm maildirsize
[EMAIL PROTECTED]/home/vpopmail/domains/bway.net/M/chip/Maildir]# vuserinfo chip
name:   chip
passwd: dhflxJ6.
clear passwd:
uid:0
gid:0
flags:  0
gecos:  Chip
limits: No user limits set.
dir:   /home/vpopmail/domains/blah.net/M/chip
quota: 20971520S
usage: 23%
[EMAIL PROTECTED]/home/vpopmail/domains/blah.net/M/chip/Maildir]# ls -al 
maildirsize
-rw-r--r--  1 vpopmail  vchkpw  21 Feb 18 14:34 maildirsize

Charles
Paul Theodoropoulos
http://www.anastrophe.com
http://www.smileglobal.com



Re: [vchkpw] perms on maildirsize

2005-02-17 Thread Paul Theodoropoulos
At 06:44 PM 2/17/2005, Charles Sprickman wrote:
Howdy,
Can anyone shed some light on this?  I've got maildirsize files randomly 
flipping to root ownership.  I'm a bit confused as to how this could 
happen - all delivery is done by vpopmail, and none of that stuff runs as 
root.  That leaves courier-imap/pop, which do run as root.

So I posted to the courier list (asbestos on, check...) and Mr. Sam 
replied that this is a "known bug in vpopmail".  Looking through the 
vpopmail archives I don't see any sign of this.  I do see a few threads 
about size miscalculations, but that's an entirely different issue.

Any ideas?
[bottom posting to appease the text-formatting nazis]
i see that when i run vuserinfo [EMAIL PROTECTED] as root, which is often how 
i run it

Paul Theodoropoulos
http://www.anastrophe.com
http://www.smileglobal.com



[vchkpw] perms on maildirsize

2005-02-17 Thread Charles Sprickman
Howdy,
Can anyone shed some light on this?  I've got maildirsize files randomly 
flipping to root ownership.  I'm a bit confused as to how this could 
happen - all delivery is done by vpopmail, and none of that stuff runs as 
root.  That leaves courier-imap/pop, which do run as root.

So I posted to the courier list (asbestos on, check...) and Mr. Sam 
replied that this is a "known bug in vpopmail".  Looking through the 
vpopmail archives I don't see any sign of this.  I do see a few threads 
about size miscalculations, but that's an entirely different issue.

Any ideas?
Thanks,
Charles
-- Forwarded message --
Date: Thu, 17 Feb 2005 18:30:43 -0500
From: Sam Varshavchik <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [Courier-imap] perms on maildirsize
Charles Sprickman writes:
Howdy,
I'm running into a problem with courier-imap.  We've had some problems
with quota display via IMAP where there was no quota or usage reported.
I'd dug through the contents of the maildirsize file and all looked good.
But one thing I missed is that on all the "problem" customers the
maildirsize file was owned by root.
The only thing that touches these maildirs that starts with root perms is
courier imap/pop.  Any ideas on why it's flipping ownership?
I'm running Courier 3.0.8 on FreeBSD 4.9.  Delivery is qmail/vpopmail and
everything there runs out of tcpserver as the vpopmail user.
This bug was previously reported in vpopmail.  The vpopmail mailing list is
thataway → .