~ubuntu-branches/ubuntu/maverick/krb5/maverick

« back to all changes in this revision

Viewing changes to src/util/trim-valgrind-logs

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2009-05-07 16:16:34 UTC
  • mfrom: (13.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090507161634-xqyk0s9na0le4flj
Tags: 1.7dfsg~beta1-4
When  decrypting the TGS response fails with the subkey, try with the
session key to work around Heimdal bug, Closes: #527353 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
files=vg.*
 
4
 
 
5
logname() {
 
6
#       sed -n -e 7p $1 | awk '{print $2}'
 
7
#       head -7 $1 | tail -1 | awk '{print $2}'
 
8
        awk '{ if (NR == 9) { print $2; exit 0; } }' $1
 
9
}
 
10
 
 
11
show_names() {
 
12
        if test "$*" = "$files" ; then
 
13
                return
 
14
        fi
 
15
        for f in $* ; do
 
16
                echo $f : `logname $f`
 
17
        done
 
18
}
 
19
 
 
20
discard_list="/bin/ps /bin/sh /bin/stty /usr/bin/cmp awk cat chmod cmp cp env expr find grep kill mv rev rlogin rm sed sh sleep sort tail test touch wc whoami xargs"
 
21
discard_list="$discard_list tcsh tokens"
 
22
#discard_list="$discard_list ./rtest ./dbtest"
 
23
# The t_inetd program's logs seem to always wind up incomplete for some
 
24
# reason.  It's also not terribly important.
 
25
discard_list="$discard_list /path/to/.../t_inetd"
 
26
 
 
27
filter() {
 
28
        if test "$*" = "$files" ; then
 
29
                return
 
30
        fi
 
31
        for f in $* ; do
 
32
                n=`logname $f`
 
33
                for d in $discard_list; do
 
34
                        if test "$n" = "$d"; then
 
35
                                echo rm $f : $n
 
36
                                rm $f
 
37
                                break
 
38
                        fi
 
39
                done
 
40
        done
 
41
}
 
42
 
 
43
kill_error_free_logs() {
 
44
        if test "$*" = "$files" ; then
 
45
                return
 
46
        fi
 
47
        grep -l "ERROR SUMMARY: 0 errors" $* | while read name ; do
 
48
                echo rm $name : no errors in `logname $name`
 
49
                rm $name
 
50
        done
 
51
}
 
52
 
 
53
kill_no_leak_logs() {
 
54
        if test "$*" = "$files" ; then
 
55
            return
 
56
        fi
 
57
        grep -l "ERROR SUMMARY: 0 errors" $* | \
 
58
            grep -l "definitely lost: 0 bytes" $* | \
 
59
            xargs grep -l "possibly lost: 0 bytes" | \
 
60
            xargs grep -l "still reachable: 0 bytes in 0 blocks" | \
 
61
            while read name ; do
 
62
            echo rm $name : no leaks or errors in `logname $name`
 
63
            rm $name
 
64
        done
 
65
}
 
66
 
 
67
filter $files
 
68
kill_error_free_logs $files
 
69
#kill_no_leak_logs $files
 
70
echo Remaining files:
 
71
show_names $files