Using sarg stable (1.4.1-r2) - when running sarg with the sarg.conf file set up, sarg creates an incorrect tmp dir in /tmp, then fails to do anything with the tmp files: SARG: Successful report generated and sent to xxx@xxx SARG: (removetmp) Cannot open file: /tmp/sarg_tmp/2004Sep18-2004Sep20/geral In actuality, sarg creates a directory named /tmp/sarg, not /tmp/sarg_tmp. I tried renaming the directory to /tmp/sarg but it was renamed back to the incorrect one on the next sarg run. I also tried setting a tmp dir in sarg.conf, but sarg reads the tmp file directive, then creates a /sarg beneath the tmp directory I set, still resulting in the failure. For example, if I set the tmp dir to be /tmp/sarg, then on the next run sarg creates /tmp/sarg/sarg and gives the same error about removing it from /tmp/sarg/sarg_tmp. Reproducible: Always Steps to Reproduce: 1. emerge sarg 2. set up sarg.conf 3. run sarg ("sarg") Actual Results: SARG: Successful report generated and sent to xxx@xxx SARG: (removetmp) Cannot open file: /tmp/sarg_tmp/2004Sep18-2004Sep20/geral Expected Results: Worked with the files in the tmp dir and process them correctly Portage 2.0.50-r11 (default-x86-1.4, gcc-3.3.4, glibc-2.3.3.20040420-r1, 2.6.8- gentoo-r3) ================================================================= System uname: 2.6.8-gentoo-r3 i686 Pentium III (Coppermine) Gentoo Base System version 1.4.16 distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] Autoconf: sys-devel/autoconf-2.59-r4 Automake: sys-devel/automake-1.8.5-r1 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O3 -march=pentium3 -fprefetch-loop-arrays -funroll-loops -pipe" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share /config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O3 -march=pentium3 -fprefetch-loop-arrays -funroll-loops -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="http://open-systems.ufl.edu/mirrors/gentoo ftp://ftp.ussg.iu.edu/pub/linux/gentoo http://mirrors.tds.net/gentoo ftp://mirrors.tds.net/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="apache2 apm berkdb bitmap-fonts crypt cups encode foomaticdb gd gd- external gdbm gif gpm imagemagick imap jpeg kerberos ldap libwww maildir mysql ncurses nls offensive pam pdflib perl php png python readline samba sasl slang spell ssl svga tcpd truetype x86 xml xml2 xprint zlib"
By the way sarg's homepage changed to: http://sarg.sourceforge.net/sarg.php
Vermyndax, sorry I cannot confirm that, it works without any problems here. The only thing I did set in sarg.conf was the "access" confline and "output". And it works without problems. I also tried changing the "tmp" confline, and it works also. I used strace to verify file and directory access, and it looks good, except for some careful unlinks of unused logfiles, but that's ok. Can you send me your sarg.conf by private email ? Andy.
Andy... I will email you my sarg.conf, but I did notice in the source file email.c: sprintf(csort,"rm -r %s/sarg_tmp",TempDir); Wouldn't that hard-code the tmp directory? (Still learning C here)...
I can confirm your error now. It happens when "ouput_email" is set. And I found three outstanding patches, which are not implemented yet, but they're not concerning your problem. About "hardcode", no what you define with "temporary_dir" is just a prefix to sargs own tempdir, but it's using even more beside... So here's a new ebuild and in summary four "new" patches.
Created attachment 40071 [details] sarg-1.4.1-r3.ebuild holding four new patches
Created attachment 40072 [details, diff] sarg-1.4.1-email.c.patch (fix double removing of directory when email-reporting is activated)
Created attachment 40073 [details, diff] sarg-1.4.1-util.c.patch add parametercheck to builddia() from sf.net
Created attachment 40074 [details, diff] sarg-1.4.1-nocache.patch allows to add META-field "Cache-Control" in total report files from sf.net
Created attachment 40075 [details, diff] sarg-1.4.1-redirector.patch adds support of handling of log-files for programms like SquidGuard from sf.net
Wow, I actually filed a confirmed bug! Whew... ;) Your ebuild/patches worked fine, Sarg is generating reports without errors now. Many thanks!
Could someone from gentoo staff please still change a few more things: 1) The homepage-address: http://sarg.sourceforge.net 2) The src_uri of the main package: on sourceforge-mirror 3) The sort.index-patch is not available on the original site, it is fetched from the gentoo-mirrors. (src_uri is wrong) 4) Since we have those much patches, put them in a tarball and distribute it via distfiles. You may remove the old sort.index-patch from distfiles along with any old ebuilds depending on it. 5) All this will resolve the last warning line, when trying to unpack the plaintext sort.index-patch Best regards, Andy.
Can you provide a unified patch diff for the source and a diff against the build with the changes you've tested?
see also 71656
Jared - you bug - have fun.
Andreas, do newer sarg versions (2.0.x) has these fixes included?
no, the nocache and email patch is missing. NoCache is just a feature, the email-thingie seem to happen on some machines... no idea why. Anyway 2.0.7 has so many security fixes, that we should completly remove the old 1.4.x which is really out of date.
fixed with 2.0.8