summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDante Catalfamo2021-07-02 16:58:23 -0400
committerDante Catalfamo2021-07-02 16:58:23 -0400
commit20767d53f8c93be8986e03f608bfcf2f9b49ffa9 (patch)
treee81ee737b6c2ee5485cef3efdf042827cf4fa461
parent2ddc62bac6933cfa32f3f344719df8b4c54b7631 (diff)
downloadblog-20767d53f8c93be8986e03f608bfcf2f9b49ffa9.tar.gz
blog-20767d53f8c93be8986e03f608bfcf2f9b49ffa9.tar.bz2
blog-20767d53f8c93be8986e03f608bfcf2f9b49ffa9.zip
bsd-auth: Finally get graph working properly
-rw-r--r--content/posts/WIP-how-bsd-authentication-works/gen_dot.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/content/posts/WIP-how-bsd-authentication-works/gen_dot.rb b/content/posts/WIP-how-bsd-authentication-works/gen_dot.rb
index 9925d8c..d9e884a 100644
--- a/content/posts/WIP-how-bsd-authentication-works/gen_dot.rb
+++ b/content/posts/WIP-how-bsd-authentication-works/gen_dot.rb
@@ -3,7 +3,7 @@
SOURCE_DIR = File.join Dir.home, 'src', 'github.com', 'openbsd', 'src', 'lib', 'libc', 'gen'
FILENAMES = %w[authenticate.c auth_subr.c login_cap.c].freeze
-FUNCTION_REGEX = /^\w.*?$\n(\w*)\(.*?\)\n\{(.*?)^\}/m.freeze
+FUNCTION_REGEX = /^\w.*?$\n(?!DEF)(\w*)\(.*?\)\n\{(.*?)^\}/m.freeze
ONELINE_FUNCTION_REFGEX = /^\w.*?(\w*)\(.*?\).*?\{(.*?)\}/.freeze
CALL_REGEX = /[^\n](\w+)\(.*?\)/.freeze
@@ -63,7 +63,6 @@ class FunctionDigraph
functions.each do |function|
function_name = function[0]
function_body = function[1]
- puts 'auth_open!' if function_name == 'auth_open'
subgraph.functions << function_name
function_body.scan(CALL_REGEX) do |call|
@pairs << Pair.new(function_name, call[0])