From 20767d53f8c93be8986e03f608bfcf2f9b49ffa9 Mon Sep 17 00:00:00 2001 From: Dante Catalfamo Date: Fri, 2 Jul 2021 16:58:23 -0400 Subject: bsd-auth: Finally get graph working properly --- content/posts/WIP-how-bsd-authentication-works/gen_dot.rb | 3 +-- 1 file changed, 1 insertion(+), 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]) -- cgit v1.2.3