Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
Zipr Toolchain
Commits
e325cb56
Commit
e325cb56
authored
9 years ago
by
an7s
Browse files
Options
Downloads
Patches
Plain Diff
use exit instead of return
Former-commit-id: 03f9cd908376c65a27446938956780675e76ba78
parent
b24ab909
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/cgc_protect/is_new_pov.sh
+21
-13
21 additions, 13 deletions
tools/cgc_protect/is_new_pov.sh
with
21 additions
and
13 deletions
tools/cgc_protect/is_new_pov.sh
+
21
−
13
View file @
e325cb56
#!/bin/bash
#
#
# Returns success (0) only if the POV results in a new crash point
# Returns > 0 otherwise
#
# /techx_share/techx_umbrella/peasoup/security_transforms/tools/cgc_protect/is_new_pov.sh /home/vagrant/techx_work/0b32aa01_crash_filter/id:000049,sig:11,src:000007,op:arith8,pos:88,val:+9.10288.xml /home/vagrant/techx_work/0b32aa01_crash_filter/0b32aa01_01.crash.summary /home/vagrant/techx_work/0b32aa01_crash_filter/0b32aa01_01
#
POV_PATH
=
$1
# fully qualified path for POV
CRASH_SUMMARY
=
$2
#
input/output: POV-->
crash summary file
CRASH_SUMMARY
=
$2
# crash summary file
CGC_BIN
=
$3
# input cgc binary (@todo: handle multi-cbs)
cbtest
=
$CGC_UMBRELLA_DIR
/scripts/techx-cb-test
timeout
=
20
delimiter
=
"###"
log
=
`
pwd
`
/tmp.log
.
$$
log
=
`
pwd
`
/tmp.log
pov_base
=
`
basename
${
POV_PATH
}
`
binary
=
`
basename
$CGC_BIN
`
...
...
@@ -21,17 +25,17 @@ core=${binary_dir}/core
# lookup pov
tmp
=
`
grep
-F
"
${
pov_base
}${
delimiter
}
"
${
CRASH_SUMMARY
}
`
if
[
$?
-eq
0
]
;
then
return
1
if
[
$?
-eq
0
]
;
then
exit
2
fi
# cleanup any stale core files
if
[
-f
$core
]
;
then
sudo rm
$core
2
>/dev/null
sudo rm
$core
&
>/dev/null
fi
echo
"sudo -E
$cbtest
--debug --xml
${
pov_base
}
--timeout
$timeout
--directory
${
binary_dir
}
--cb
${
binary
}
--log
$log
"
sudo
-E
$cbtest
--debug
--xml
${
pov_base
}
--timeout
$timeout
--directory
${
binary_dir
}
--cb
${
binary
}
--log
$log
echo
"sudo -E
$cbtest
--debug --xml
${
POV_PATH
}
--timeout
$timeout
--directory
${
binary_dir
}
--cb
${
binary
}
--log
$log
"
sudo
-E
$cbtest
--debug
--xml
${
POV_PATH
}
--timeout
$timeout
--directory
${
binary_dir
}
--cb
${
binary
}
--log
$log
grep
"core identified"
$log
if
[
$?
-eq
0
]
;
then
if
[
-f
$core
]
;
then
...
...
@@ -39,16 +43,20 @@ if [ $? -eq 0 ]; then
sudo chown
`
whoami
`
$core
eip
=
`
timeout
$timeout
$PEASOUP_HOME
/tools/extract_eip_from_core.sh
${
CGC_BIN
}
$core
`
if
[
$?
-eq
0
]
;
then
echo
"
$eip
"
>>
$CRASH_SITES
return
0
tmp
=
`
grep
-F
"
${
delimiter
}
$eip
"
${
CRASH_SUMMARY
}
`
if
[
$?
-eq
0
]
;
then
exit
1
else
exit
0
fi
else
return
1
exit
1
fi
sudo rm
$core
2
>/dev/null
sudo rm
$core
&
>/dev/null
else
return
1
exit
1
fi
else
return
1
exit
1
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment