Bug 3190 - spamd/sa-learn can't start under chroot/su
Summary: spamd/sa-learn can't start under chroot/su
Status: RESOLVED WORKSFORME
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: PC FreeBSD
: P5 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-18 09:17 UTC by Andrew A. Vasilyev
Modified: 2005-02-19 12:29 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew A. Vasilyev 2004-03-18 09:17:24 UTC
In 2.6x versions of spamd/sa-learn there was a

  eval 'exec /usr/local/bin/perl -T -w -S $0 ${1+"$@"}' if 0;

string at the beginning of each script file. Now it is not.
And when you try to start the process as

  chroot /dir /bin/su - user /path/to/spamd OPTIONS

the starting procedure failes. If one adds this eval, all starts
as before.

What was the reason for deleting this eval from the code?
Comment 1 Justin Mason 2004-03-18 12:07:34 UTC
Subject: Re:  New: spamd/sa-learn can't start under chroot/su 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


>In 2.6x versions of spamd/sa-learn there was a
>
>  eval 'exec /usr/local/bin/perl -T -w -S $0 ${1+"$@"}' if 0;
>
>string at the beginning of each script file. Now it is not.
>And when you try to start the process as
>
>  chroot /dir /bin/su - user /path/to/spamd OPTIONS
>
>the starting procedure failes. If one adds this eval, all starts
>as before.

This is added during "make install".  Have you done that?

- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFAWgF6QTcbUG5Y7woRArWDAJ9n3Vnf8l35DMNNlFSD1loFI4Q4pwCdGpC0
sHFz88brVk3zxX64L+nQWeE=
=sdEp
-----END PGP SIGNATURE-----

Comment 2 Andrew A. Vasilyev 2004-03-18 14:16:51 UTC
Subject: Re:  spamd/sa-learn can't start under chroot/su

On Thu, Mar 18, 2004 at 12:07:35PM -0800, bugzilla-daemon@bugzilla.spamassassin.org wrote:
> http://bugzilla.spamassassin.org/show_bug.cgi?id=3190
> 
> ------- Additional Comments From jm@jmason.org  2004-03-18 12:07 -------
> Subject: Re:  New: spamd/sa-learn can't start under chroot/su 
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> >In 2.6x versions of spamd/sa-learn there was a
> >
> >  eval 'exec /usr/local/bin/perl -T -w -S $0 ${1+"$@"}' if 0;
> >
> >string at the beginning of each script file. Now it is not.
> >And when you try to start the process as
> >
> >  chroot /dir /bin/su - user /path/to/spamd OPTIONS
> >
> >the starting procedure failes. If one adds this eval, all starts
> >as before.
> 
> This is added during "make install".  Have you done that?

  Certainly yes. But nothing appeared. Only this license header:

#!/usr/local/bin/perl5.8.3 -T -w
# <@LICENSE>
# Copyright 2004 Apache Software Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# </@LICENSE>

________
	ANDY

> 
> - --j.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
> Comment: Exmh CVS
> 
> iD8DBQFAWgF6QTcbUG5Y7woRArWDAJ9n3Vnf8l35DMNNlFSD1loFI4Q4pwCdGpC0
> sHFz88brVk3zxX64L+nQWeE=
> =sdEp
> -----END PGP SIGNATURE-----
> 
> 
> 
> 
> 
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.

Comment 3 Andrew A. Vasilyev 2004-03-24 07:53:44 UTC
Probably this is a bug in ExtUtils::MM_Unix.pm:
if one has FULLPERL (in Makefile) as /path/perl1.2.3, then
make install will not add the eval string, if the name of Perl
binary doesn't end with digits, the eval string will be added.
Comment 4 Theo Van Dinter 2004-04-19 19:54:51 UTC
well, ignoring the eval thing ...  why can't the normal version be used under chroot/su ?

su definitely shouldn't be a problem.  chroot() will have the normal issues related to paths and such.
Comment 5 Theo Van Dinter 2004-04-19 20:00:24 UTC
oh, forgot to mention...  I do still get the eval bit with 3.0.
Comment 6 Theo Van Dinter 2005-02-19 21:29:27 UTC
I don't think this is an issue in 3.x.  if it is, we can reopen.