logcatd: fix up logpersist.cat to filter out signature file
Simple filter for no suffix, or a numerical suffix. toybox
grep did not handle a more robust regex, so we opted for
kiss in order to remove the .id suffix from consideration.
Bug: 30591615
Change-Id: I5b1c929d3e69c1ae39af95ae44a69f7b55e969ed
diff --git a/logcat/logpersist b/logcat/logpersist
index 74d99fc..c09b6b2 100755
--- a/logcat/logpersist
+++ b/logcat/logpersist
@@ -17,8 +17,9 @@
;;
esac
+log_uid=logd
log_tag_property=persist.log.tag
-data=/data/misc/logd
+data=/data/misc/logd/logcat
service=logcatd
size_default=256
buffer_default=all
@@ -74,11 +75,12 @@
if [ -n "${size}${buffer}" -o "true" = "${clear}" ]; then
echo WARNING: Can not use --clear, --size or --buffer with ${progname%.*}.cat >&2
fi
- su logd ls "${data}" |
+ su ${log_uid} ls "${data%/*}" |
tr -d '\r' |
sort -ru |
- sed "s#^#${data}/#" |
- su logd xargs cat
+ sed "s#^#${data%/*}/#" |
+ grep "${data}[.]*[0-9]*\$" |
+ su ${log_uid} xargs cat
;;
*.start)
current_buffer="`getprop ${property#persist.}.buffer`"
@@ -139,7 +141,7 @@
sleep 1
getprop ${property#persist.}
# also generate an error return code if not found running
- pgrep -u ${data##*/} ${service%d}
+ pgrep -u ${log_uid} ${service%d}
;;
*.stop)
if [ -n "${size}${buffer}" ]; then