-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve: cxx/ClassSys.cxx
:classSysGetOwnPath()
: for _Termux_, use procfs
to return our true path.
#26
Comments
The use of |
so that `virusAnalysisTests()` outputs the offset+hash of `argv[0]`. Note that just the _Google Store_ version of _Termux_ output the wrong offset+hash (due to _Google_'s rules: termux/termux-exec#24). In the future (if more is done with our path than output example offsets+hashes), it is possible that this fix will have more value. If other programs use `classSysGetOwnPath()` on _Termux_, this can improve those. ?`cxx/ClassSys.cxx`: ?`classSysGetOwnPath()`: the fix was to use `readlink` to return true path. ?`cxx/ClassSys.hxx`: ?`classSysGetOwnPath()`, ?`classSysFopenOwnPath()`: comments improved. ?`cxx/VirusAnalysis.cxx`: typo fixes. Closes issue #26 (Improve: cxx/ClassSys.cxx:classSysGetOwnPath(): for _Termux_, use `procfs` to return our true path.) Is followup to: d50262f (+`classSysGetOwnPath()`, +`classSysFopenOwnPath()`), 5f0ffd8 (?`virusAnalysisTests()`: if Linux, use procfs: this should close https://github.com/SwuduSusuwu/SubStack/security/code-scanning/1277). ?`posts/VirusAnalysis.md`: Include all this. Remove accidental duplicate comments at end of file.
so that `virusAnalysisTests()` outputs the offset+hash of `argv[0]`. Note that just the _Google Store_ version of _Termux_ output the wrong offset+hash (due to _Google_'s rules: termux/termux-exec#24). In the future (if more is done with our path than output example offsets+hashes), it is possible that this fix will have more value. If other programs use `classSysGetOwnPath()` on _Termux_, this can improve those. ?`cxx/ClassSys.cxx`: ?`classSysGetOwnPath()`: the fix was to use `readlink` to return true path. ?`cxx/ClassSys.hxx`: ?`classSysGetOwnPath()`, ?`classSysFopenOwnPath()`: comments improved. ?`cxx/VirusAnalysis.cxx`: typo fixes. Closes issue #26 (Improve: cxx/ClassSys.cxx:classSysGetOwnPath(): for _Termux_, use `procfs` to return our true path.) Is followup to: d50262f (+`classSysGetOwnPath()`, +`classSysFopenOwnPath()`), 5f0ffd8 (?`virusAnalysisTests()`: if Linux, use procfs: this should close https://github.com/SwuduSusuwu/SubStack/security/code-scanning/1277). ?`posts/VirusAnalysis.md`: Include all this. Remove accidental duplicate comments at end of file.
StackOverflow says If you used |
virusAnalysisTests()
usesClassPortableExecutable()
to load this, with the result that tests on Termux now always output the same offset+hash (since/proc/self/exe
is/apex/com.android.runtime/bin/linker64
).Rationale: This would explain how (up until commit ?
virusAnalysisTests()
: if Linux, use procfs:@5f0ffd8), with each build,virusAnalysisTests()
's results showed a new offset+hash (,) as opposed to the post-
procfs
outputs () which use the
/proc/self/exe
path (and always give the same offset+hash.)Use of the
which linker64
path gives those results too:, thus am sure that this is due to how Termux loads all executables through
linker64
.Have not labelled this as
regression
since all it does is cause one of the unit tests to print unexpected results foroffset
+hash
(which does not alter the unit test's return value).Local tests show that if you use
readlink
orrealpath
, you get the true path.It was GitHub's code scan (https://github.com/SwuduSusuwu/SubStack/security/code-scanning/1277) which prompted the switch from
argv[0]
to/proc/self/exe
at 5f0ffd8The text was updated successfully, but these errors were encountered: