[Bug 218177] New: "/etc/cron.d/suse.de-clean-core" from findutils-locate-4.2.28-16 doesn't identify core dumps reliably
https://bugzilla.novell.com/show_bug.cgi?id=218177 Summary: "/etc/cron.d/suse.de-clean-core" from findutils-locate- 4.2.28-16 doesn't identify core dumps reliably Product: openSUSE 10.2 Version: Beta 1 plus Platform: i586 OS/Version: SuSE Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: andreas.bolsch@alumni.tu-berlin.de QAContact: qa@suse.de The script may easily identify non-core files as core dumps. "locate '*/core' '*/core.[0-9]*'" and "find "$COREFILE" \( -name core -o -regex ".*/core\\.[0-9]+" \) -type f" hits arbitrary files named "core". Although there is an improvement over SuSE 10.1 (where /usr/share/man/man5/core.5.gz got found and *deleted*), it's still not quite safe. Furthermore, using "safe-rm" instead of the plain "rm" might be a good idea. Suggested fix: --- suse.de-clean-core 2006-10-31 01:23:04.000000000 +0100 +++ suse.de-clean-core.new 2006-11-04 17:21:37.000000000 +0100 @@ -49,18 +49,15 @@ for i in $(find "$COREFILE" ! \( -fstype nfs -o -fstype NFS \) \ \( -name core -o -regex ".*/core\\.[0-9]+" \) -type f \ -mtime +"$MAX_DAYS_FOR_CORE" 2> /dev/null); do - if [ "$DELETE_OLD_CORE" = yes ]; then - echo "Deleting core file older than $MAX_DAYS_FOR_CORE days: $i" if [ -x /usr/bin/file ]; then - echo file "$i" - /usr/bin/file "$i" - fi - rm -f "$i" + FILE=`/usr/bin/file $i` + if `echo $FILE | egrep -i -q 'core (file|dump)'`; then + if [ "$DELETE_OLD_CORE" = yes ] && [ -x /usr/bin/safe-rm ]; then + echo "Deleting core file older than $MAX_DAYS_FOR_CORE days: $FILE" + /usr/bin/safe-rm "$i" else - echo "Found core file older than $MAX_DAYS_FOR_CORE days: $i" - if [ -x /usr/bin/file ]; then - echo file "$i" - /usr/bin/file "$i" + echo "Found core file older than $MAX_DAYS_FOR_CORE days: $FILE" + fi fi fi done -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=218177 cthiel@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |schwab@novell.com |screening@forge.provo.novell| |.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=218177 schwab@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #1 from schwab@novell.com 2007-01-09 05:01 MST ------- This is already fixed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
participants (1)
-
bugzilla_noreply@novell.com