[Logwatch] Logwatch / Solaris 7

Mark D. Nagel mnagel@willingminds.com
Tue, 25 Jun 2002 14:34:08 -0700


I think a lot of these (like the patch below) can be directly implemented in
Perl, thereby avoiding system dependencies.  For example, there is a chown
function in Perl.  If you use the File::Temp module (in 5.6.1 core module
set), there is a mktemp family of functions available.   I think I may take
a quick once over on this code and see how much can be internalized.  I've
been meaning to test on Solaris myself lately -- good a time as any to pull
up the sleeves.

Also, there is a bug in that patch -- second chmod should be chgrp.

Mark

----- Original Message -----
From: "Kirk Bauer" <kirk@kaybee.org>
To: "Michael Glaser" <mglaser@umn.edu>
Cc: <logwatch@logwatch.org>
Sent: Tuesday, June 25, 2002 10:19 AM
Subject: Re: [Logwatch] Logwatch / Solaris 7


> On Tue, 25 Jun 2002, Michael Glaser wrote:
>
> Does Solaris 7 have the 'mktemp' program?  If so, does it support the
> "-d" option?  The preferred course of action is for logwatch to use
> that mktemp program to create its temporary directory.  The errors you
> are seeing tells me it is not.
>
> >   bash-2.05# ./logwatch.pl
> >   chown: unknown user id 0.1
>
> Here is a patch for this error (which will be in the next release):
>
> --- logwatch.pl-orig Tue Jun 25 13:12:57 2002
> +++ logwatch.pl   Tue Jun 25 13:13:17 2002
> @@ -450,7 +450,8 @@
>
>     `rm -rf $TempDir`;
>     mkdir ($TempDir,0700) or die "Failed to create TempDir: $TempDir
(somebody may be attempting a root exploit!)\n";
> -   `chown $uid.$gid $TempDir`;
> +   `chown $uid $TempDir`;
> +   `chown $gid $TempDir`;
>     `chmod 0700 $TempDir`;
>     unless (-d $TempDir and (not -l $TempDir)) {
>        die "$TempDir not a directory (somebody is attempting a root
exploit!)\n";
>
> > There seems to be a problem with the date command as well as something
with file
> > ownership. I grep'ed logwatch.pl for "date" and found nothing.
>
> The following style command is used in a ton of places in other files in
> the scripts directory (but not the main logwatch.pl).
>
> /bin/date -d "1 day ago" +"%m/%d"
>
> Now, a "fix" would be to specify either "today" or "all" for your date
> range, as only "yesterday" uses this style command.
>
> A better fix would be to figure out how to do the above command in a
> more portable manner, or maybe not use an absolute path to the "date"
> program so you could put a GNU date in /usr/local/bin, for example, and
> just make sure your path is correct before running logwatch.
>
> If anybody has access to a Solaris machine (which I don't, currently),
> could you tell me how the above command would be done with Solaris's
> "date" command?
>
> --
>  Kirk Bauer -- CmpE, Georgia Tech -- kirk@kaybee.org -- Avid Linux User
>      http://linux.kaybee.org | www.autorpm.org | www.logwatch.org
>     Opinions expressed are my own, but they should be everybody's.
>
> _______________________________________________
> Logwatch mailing list
> Logwatch@logwatch.org
> http://list.logwatch.org/lists/listinfo/logwatch
>