about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSilvino <silvino@bk.ru>2019-07-29 18:33:40 +0100
committerSilvino <silvino@bk.ru>2019-07-29 18:33:40 +0100
commitee84e47238980b2100d88f410d01fefcb7aa1d16 (patch)
tree56c6b628cab34f107d1d36a98cbc5d97ea5f3a63
parent79bfadccf36138b77df85621ae02ccbb39f45f8c (diff)
downloaddoc-ee84e47238980b2100d88f410d01fefcb7aa1d16.tar.gz
fix dev c indexes
-rw-r--r--dev/c/basic.html4
-rw-r--r--dev/c/datatypes.html6
-rw-r--r--dev/c/debugging.html47
-rw-r--r--dev/c/elements.html6
-rw-r--r--dev/c/hello.html4
-rw-r--r--dev/c/index.html6
-rw-r--r--dev/c/lib.html6
-rw-r--r--dev/c/system.html6
8 files changed, 62 insertions, 23 deletions
diff --git a/dev/c/basic.html b/dev/c/basic.html
index 104e59a..a2009fc 100644
--- a/dev/c/basic.html
+++ b/dev/c/basic.html
@@ -5,7 +5,7 @@
 	<title>C - Basic</title>
     </head>
     <body>
-        <a href="../index.html">C &amp; GDB Index</a>
+        <a href="index.html">C Index</a>
 
 	<h1>C - Basic</h1>
 
@@ -48,7 +48,7 @@
 	$ gcc -Wall main.c hello.c -o hello
 	</pre>
 
-	<a href="../index.html">C &amp; GDB Index</a>
+	<a href="index.html">C Index</a>
 	<p>
 	This is part of the Hive System Documentation.
 	Copyright (C) 2019
diff --git a/dev/c/datatypes.html b/dev/c/datatypes.html
index 77b5dbb..a5e1efd 100644
--- a/dev/c/datatypes.html
+++ b/dev/c/datatypes.html
@@ -5,7 +5,7 @@
         <title>Datatypes</title>
     </head>
     <body>
-        <a href="../index.html">Development Index</a>
+        <a href="index.html">C index</a>
 
         <h1>Datatypes</h1>
 
@@ -172,9 +172,9 @@
             <dd>Pointer address</dd>
         </dl>
 
-        <a href="../index.html">Development Index</a>
+        <a href="index.html">C Index</a>
         <p>This is part of the Hive System Documentation.
-        Copyright (C) 2018
+        Copyright (C) 2019
         Hive Team.
         See the file <a href="../../fdl-1.3-standalone.html">Gnu Free Documentation License</a>
         for copying conditions.</p>
diff --git a/dev/c/debugging.html b/dev/c/debugging.html
index c68fbc1..90dca1b 100644
--- a/dev/c/debugging.html
+++ b/dev/c/debugging.html
@@ -5,10 +5,43 @@
         <title>Debugging</title>
     </head>
     <body>
-        <a href="../index.html">Development Index</a>
+        <a href="index.html">C Index</a>
 
         <h1>Debugging</h1>
 
+        <p>Check if the system have restrictions to attach to other processes or other hardening measures, check <a href=../../core/sysctl.html>sysctl settings</a> such as; kernel.yama.ptrace_scope;</p>
+
+	<dl>
+            <dt>kernel.yama.ptrace_scope=0</dt>
+            <dd>All processes can be debugged, they must have same uid.</dd>
+            <dt>kernel.yama.ptrace_scope=1</dt>
+            <dd>Only a parent process can be debugged.</dd>
+
+            <dt>kernel.yama.ptrace_scope=2</dt>
+            <dd>Require user privileges to use ptrace  CAP_SYS_PTRACE capability.</dd>
+
+            <dt>kernel.yama.ptrace_scope=3</dt>
+            <dd>No processes may be traced with ptrace.</dd>
+
+        </dl>
+
+        <p>Before debug;</p>
+
+        <pre>
+        # echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
+        # sysctl -w kernel.yama.ptrace_scope=0
+
+        </pre>
+
+        <p>After debug;</p>
+
+        <pre>
+        # echo 1 | sudo tee /proc/sys/kernel/yama/ptrace_scope
+        # sysctl -w kernel.yama.ptrace_scope=1
+        </pre>
+
+        <h2 id="gdb">GDB</h2>
+
         <p>If the program needs arguments you can set it;</p>
 
         <pre>
@@ -74,8 +107,14 @@
         break linespec thread threadno
         </pre>
 
+        <h2 id="strace">Strace</h2>
+
+        <pre>
+        $ strace -c ./program -o ~/program.strace
+        </pre>
+
         <pre>
-        strace -c ./program
+        $ strace -p 1337 -o ~/program.strace
         </pre>
 
 
@@ -87,11 +126,11 @@
         <a href="http://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_39.html#SEC40">Stopping and Starting</a>
         multi-thread programs</p>
 
-        <a href="../index.html">Development Index</a>
+        <a href="index.html">C Index</a>
 
         <p>
         This is part of the Hive System Documentation.
-        Copyright (C) 2018
+        Copyright (C) 2019
         Hive Team.
         See the file <a href="../../fdl-1.3-standalone.html">Gnu Free Documentation License</a>
         for copying conditions.</p>
diff --git a/dev/c/elements.html b/dev/c/elements.html
index 9e31adb..49871db 100644
--- a/dev/c/elements.html
+++ b/dev/c/elements.html
@@ -5,7 +5,7 @@
         <title>Elements</title>
     </head>
     <body>
-        <a href="../index.html">Development Index</a>
+        <a href="index.html">C Index</a>
 
         <h1>Elements</h1>
 
@@ -51,11 +51,11 @@
 
         <p>White space is ignored except when separating elements.</p>
 
-        <a href="../index.html">Development Index</a>
+        <a href="index.html">C Index</a>
 
         <p>
         This is part of the Hive System Documentation.
-        Copyright (C) 2018
+        Copyright (C) 2019
         Hive Team.
         See the file <a href="../../fdl-1.3-standalone.html">Gnu Free Documentation License</a>
         for copying conditions.</p>
diff --git a/dev/c/hello.html b/dev/c/hello.html
index ff31bc9..14c65e9 100644
--- a/dev/c/hello.html
+++ b/dev/c/hello.html
@@ -5,7 +5,7 @@
 	<title>C &amp; GDB</title>
     </head>
     <body>
-        <a href="../index.html">C &amp; GDB Index</a>
+        <a href="index.html">C Index</a>
 
 	<h1>Hello World</h1>
 
@@ -123,7 +123,7 @@
 	(gdb) n
 	</pre>
 
-        <a href="../index.html">C &amp; GDB Index</a>
+        <a href="index.html">C Index</a>
 	<p>
 	This is part of the Hive System Documentation.
 	Copyright (C) 2019
diff --git a/dev/c/index.html b/dev/c/index.html
index 3c48776..0e54a13 100644
--- a/dev/c/index.html
+++ b/dev/c/index.html
@@ -70,8 +70,8 @@
 
 
 	    </li>
-	    <li><a href="c/debugging.html">Debugging</a></li>
-	    <li><a href="c/system.html">System Development</a></li>
+	    <li><a href="debugging.html">Debugging</a></li>
+	    <li><a href="system.html">System Development</a></li>
 	</ul>
 
 	<ul>
@@ -233,7 +233,7 @@
 	<a href="../index.html">Development Index</a>
 	<p>
 	This is part of the Hive System Documentation.
-	Copyright (C) 2018
+	Copyright (C) 2019
 	Hive Team.
 	See the file <a href="../../fdl-1.3-standalone.html">Gnu Free Documentation License</a>
 	for copying conditions.</p>
diff --git a/dev/c/lib.html b/dev/c/lib.html
index 4531d7a..5e3f1f7 100644
--- a/dev/c/lib.html
+++ b/dev/c/lib.html
@@ -5,7 +5,7 @@
         <title>Libraries</title>
     </head>
     <body>
-        <a href="../index.html">C &amp; GDB Index</a>
+        <a href="index.html">C Index</a>
 
 
         <h1>Libraries</h1>
@@ -243,11 +243,11 @@
         void pthread_exit(void *value_ptr);
         </pre>
 
-        <a href="../index.html">C &amp; GDB Index</a>
+        <a href="index.html">C Index</a>
 
         <p>
         This is part of the Hive System Documentation.
-        Copyright (C) 2018
+        Copyright (C) 2019
         Hive Team.
         See the file <a href="../../fdl-1.3-standalone.html">Gnu Free Documentation License</a>
         for copying conditions.</p>
diff --git a/dev/c/system.html b/dev/c/system.html
index 5312151..d2a7d1f 100644
--- a/dev/c/system.html
+++ b/dev/c/system.html
@@ -5,7 +5,7 @@
         <title>System Development &amp; GDB</title>
     </head>
     <body>
-        <a href="../index.html">Development Index</a>
+        <a href="index.html">C Index</a>
 
         <h1>System Development</h1>
 
@@ -169,10 +169,10 @@
 	(gdb)
 	</pre>
 
-        <a href="../index.html">Development Index</a>
+        <a href="index.html">C Index</a>
         <p>
         This is part of the Hive System Documentation.
-        Copyright (C) 2018
+        Copyright (C) 2019
         Hive Team.
         See the file <a href="../../fdl-1.3-standalone.html">Gnu Free Documentation License</a>
         for copying conditions.</p>