How to debug FreeRADIUS in Debian if radiusd is not present? - debugging

The documentation of FreeRADIUS tells us to run radiusd -X to debug FreeRADIUS.
However, this daemon is not available in Debian:
$ apt-file search radiusd
freeradius: /etc/pam.d/radiusd
freeradius: /usr/share/doc/freeradius/deployment/supervise-radiusd.rst.gz
freeradius: /usr/share/doc/freeradius/examples/radiusd.cron.daily
freeradius: /usr/share/doc/freeradius/examples/radiusd.cron.monthly
freeradius: /usr/share/doc/freeradius/examples/radiusd.sh
freeradius: /usr/share/doc/freeradius/examples/radiusd2ldif.pl
freeradius: /usr/share/doc/freeradius/examples/rc.radiusd
freeradius: /usr/share/doc/freeradius/examples/rc.radiusd.in
freeradius-common: /usr/share/man/man5/radiusd.conf.5.gz
freeradius-config: /etc/freeradius/3.0/mods-config/python/radiusd.py
freeradius-config: /etc/freeradius/3.0/radiusd.conf
libfreeradius-dev: /usr/include/freeradius/radiusd.h
prelude-lml-rules: /etc/prelude-lml/ruleset/radiusd.rules
How do I get radiusd in Debian buster? Or how do I debug FreeRADIUS in another way?

It seems that in this package the binary was renamed to freeradius but the documentation was left unchanged.
The equivalent of radiusd is /usr/sbin/freeradius.

Related

How can I build SELinux policy compiler?

I've tried to build SELinux utilities from source code:
root#linuxmint21 ~/linux/src # git clone --depth 1 https://github.com/SELinuxProject/selinux
root#linuxmint21 ~/linux/src # git clone --depth 1 https://github.com/SELinuxProject/cil secilc
root#linuxmint21 ~/linux/src # cd selinux
root#linuxmint21 ~/linux/src/selinux # make -j12 V=1
But I have got an error: https://pastebin.com/bfWBTYJw
Then I've tried to build secilc:
root#linuxmint21 ~/linux/src/secilc # make -j12 V=1
Error: https://pastebin.com/BuVqWfse
There was a problem with file sepol/policydb/flask.h (File didn't exist), there was need usage this file from Android headers:
root#linuxmint21 ~/linux/src/secilc # apt install android-libsepol-dev
I'm need only policy compiler, nothing more. If I can't build it from source - OK, I'll try to write utility for building policy. I know about libsepol, but I don't understand how use it.
I read secilc and sedump source code... I didn't understand how can I build policy to binary file programatically... When I analyzed sepolicy file from my phone, then I've understood only some things. There is a magic bytes of sepolicy file, rules are written in binary format, but I can read contexts and available actions (read, write, mount, etc). (I used xxd sepolicy for reading). But I'm really need info how can I compile SELinux policy or build SELinux tools from source...
sorry if my english is not very good
I want to understand how can I build SELinux utilities from source or how can I compile SELinux policy

spdecode in simple-pt responds with 'error trace stream does not match query' Intel Processor Trace

I am a newbie using Intel PT for the trace.
I have read Intel PT manual and started to use it with simple-pt to understand how Intel PT works.
sptcmd command in simple-pt works and generates ptout.N with following command.
sudo ./sptcmd -c ls ls
When I use sptdecode as follows:
sudo ./sptdecode --sideband ptout.sideband --pt ptout.0
I get the following response:
TIME DELTA INSNs OPERATION
50:0: error trace stream does not match query
50: sync forward: trace stream does not match query
I have tried with boot argument of nopti as mentioned on simple-pt Git repo.
Additional information about setup which maybe relevant:
Compiled and built simple-pt from Git repo https://github.com/andikleen/simple-pt.
Using libipt by building from latest Git repo https://github.com/01org/processor-trace.
Using Ubuntu - 16.04
I am not sure what I am missing. Any help or pointers are appreciated.

Calling liquibase commandline from Cygwin

Trying to run a call to liquibase from command line (bash script). This works if I run it on a server (Red hat linux) but i get an error if I run it from a cygwin prompt:
java -cp ../liquibase-core-3.1.1:../ojdbc6-11.2.0.3.jar liquibase.integration.commandline.Main --driver=oracle.jdbc.OracleDriver \
--changeLogFile=database/master.xml --url=${schema_url} --username=${schema_username} --password=${schema_password} \
--contexts=${schema_context} migrate
I get the error:
Error: Could not find or load main class liquibase.integration.commandline.Main
Can't see why.
Found a way around the problem. Created a liquibase.properties file with the information,
url: <url>
username: <username>
password: <password>
contexts: global,dev
driver: oracle.jdbc.OracleDriver
classpath: ../ojdbc6-11.2.0.3.jar
changeLogFile: database/master.xml
And called the liquibase CLI using
java -jar ../liquibase-core-3.1.1.jar --defaultsFile=../foo/fum/liquibase.properties migrate
This worked fine both on the server and on cygwin.
The issue arises because Java expects a windows style path but the liquibase script issues a unix style path. See also the discussion how to run Java from cygwin. The proposed solution is to fix it by means of cygpath.
The root case is something different though. If you look into the startup script for liquibase you see the following piece of code
# build classpath from all jars in lib
if [ -f /usr/bin/cygpath ]; then
CP=.
for i in "$LIQUIBASE_HOME"/liquibase*.jar; do
i=`cygpath --windows "$i"`
CP="$CP;$i"
done
for i in "$LIQUIBASE_HOME"/lib/*.jar; do
i=`cygpath --windows "$i"`
CP="$CP;$i"
done
else
if [[ $(uname) = MINGW* ]]; then
CP_SEPARATOR=";"
else
CP_SEPARATOR=":"
fi
CP=.
for i in "$LIQUIBASE_HOME"/liquibase*.jar; do
CP="$CP""$CP_SEPARATOR""$i"
done
for i in "$LIQUIBASE_HOME"/lib/*.jar; do
CP="$CP""$CP_SEPARATOR""$i"
done
fi
That is the script checks for the existence of cygpath and will fix the issue if it finds it. Chances are that you are lacking cygpath.
If which cygpath results in /usr/bin/cygpath then everything should work as expected. Otherwise you have found the root cause.
This raises the question why cygpath is missing and how to get it. In my case I removed my (outdated) installation of git / gitbash and installed the newest version. This came with an up to date gitbash which included cygpath as desired.
The problem is that Java on CYGWIN has problems to resolve PATHs. To make this add
cygwinpath -wp
To fix this problem replace
java -cp ../liquibase-core-3.1.1:../ojdbc6-11.2.0.3.jar
with
java -classpath \`cygpath -wp ../liquibase-core-3.1.1:../ojdbc6-11.2.0.3.jar\`
Remember to surround cygwint -wp <path> with this mark `
check the main class jar file "liquibase.jar" in the main

LiteIDE debug message No executable specified use target exec

Try to debug In LightIde, . However, when I start debug, the following console message appear
(gdb)
10000015^error,msg="No symbol table is loaded. Use the \"file\" command."
(gdb)
10000016^error,msg="No executable specified, use `target exec'."
(gdb)
And it does not start debug.
What is missing?
It depends on your config: liteide - open project xxx.go , edit toolbar build config -> BUILDARGS (like the -g flag).
For instance, you can try (as in this issue) -gcflags "-N -l". As mentioned in this thread,
if BUILDARGS setup includes: -ldflags "-s", no debug info is loaded.

xperf refusing to load any symbol

With these command lines:
set _NT_SYMBOL_PATH=srv*C:\symbols*http://msdl.microsoft.com/downloads/symbols
XPerf -on FILE_IO
XPerf -d trace.etl
XPerf -symbols verbose -i trace.etl > output.csv
I get the following output:
XPerf: warning: applying restriction of access for trace processing
xperf: Using symbol path: srv*C:\symbols*http://msdl.microsoft.com/downloads/symbols
xperf: Using executable path: srv*C:\symbols*http://msdl.microsoft.com/downloads/symbols
xperf: Using SymCache path: \SymCache
xperf: SymCache engine version: v1.1
xperf: Minimum accepted SymCache version: v1.1
xperf: Minimum accepted SymCache version: v1.1
[1/2] 100.0%
[2/2] 100.0%
Warning: This trace does not contain the information needed to perform proper symbol decoding.
It was most likely stopped improperly. Please consult the documentation for information on how
to stop trace sessions (for example XPerf -stop <logger names> -d <merged.etl>)
If you still have access to the machine on which this trace was collected, you can have XPerf
add the required symbol information by running the following on that machine:
XPerf -merge <trace1.etl> <trace2.etl> ... <merged.etl>
Running this command on any machine other than the one on which the trace was collected will
result in incorrect symbol decoding.
What am I doing wrong?
XPerf -merge trace.etl trace_with_correct_symbol_decoding_info.etl
Now you can parse trace_with_correct_symbol_decoding_info.etl with your original command:
XPerf -symbols verbose -i trace_with_correct_symbol_decoding_info.etl > output.csv
The merge command not only merges multiple etl files, it also "adds image identification information required for safe symbol decoding."
D:\>xperf -help merge
Trace merge options:
xperf -merge trace1.etl trace2.etl ... merged.etl
-Merge trace1.etl trace2.etl ... merged.etl Merge trace1.etl trace2.etl ... into
merged.etl, also adding image identification
information required for safe symbol
decoding.

Resources