From fcd991844a11a295ef7b5dce6c6bba9c00b44cba Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Thu, 3 Mar 2022 15:35:13 +0000 Subject: [PATCH] sesman : Move global declarations to sesman.h --- sesman/access.c | 2 -- sesman/env.c | 3 --- sesman/scp.c | 2 -- sesman/scp_v0.c | 2 -- sesman/scp_v1.c | 2 -- sesman/scp_v1_mng.c | 2 -- sesman/sesman.h | 7 +++++++ sesman/session.c | 2 -- sesman/sig.c | 4 ---- sesman/verify_user.c | 2 -- sesman/verify_user_bsd.c | 2 -- 11 files changed, 7 insertions(+), 23 deletions(-) diff --git a/sesman/access.c b/sesman/access.c index 4b8489aa..442d9e7b 100644 --- a/sesman/access.c +++ b/sesman/access.c @@ -31,8 +31,6 @@ #include "sesman.h" #include "string_calls.h" -extern struct config_sesman *g_cfg; /* in sesman.c */ - /******************************************************************************/ int access_login_allowed(const char *user) diff --git a/sesman/env.c b/sesman/env.c index b8b2c030..f3b3dc63 100644 --- a/sesman/env.c +++ b/sesman/env.c @@ -36,9 +36,6 @@ #include "ssl_calls.h" #include "string_calls.h" -extern unsigned char g_fixedkey[8]; /* in sesman.c */ -extern struct config_sesman *g_cfg; /* in sesman.c */ - /******************************************************************************/ int env_check_password_file(const char *filename, const char *passwd) diff --git a/sesman/scp.c b/sesman/scp.c index 36cf4045..62f6af39 100644 --- a/sesman/scp.c +++ b/sesman/scp.c @@ -33,8 +33,6 @@ #include "sesman.h" -extern struct config_sesman *g_cfg; /* in sesman.c */ - /******************************************************************************/ enum SCP_SERVER_STATES_E scp_process(struct trans *t, struct SCP_SESSION *sdata) diff --git a/sesman/scp_v0.c b/sesman/scp_v0.c index 100c5902..195169fa 100644 --- a/sesman/scp_v0.c +++ b/sesman/scp_v0.c @@ -30,8 +30,6 @@ #include "sesman.h" -extern struct config_sesman *g_cfg; /* in sesman.c */ - /******************************************************************************/ enum SCP_SERVER_STATES_E scp_v0_process(struct trans *t, struct SCP_SESSION *s) diff --git a/sesman/scp_v1.c b/sesman/scp_v1.c index a8a59ebd..91a47e07 100644 --- a/sesman/scp_v1.c +++ b/sesman/scp_v1.c @@ -33,8 +33,6 @@ //#include "libscp_types.h" #include "libscp.h" -extern struct config_sesman *g_cfg; /* in sesman.c */ - static void parseCommonStates(enum SCP_SERVER_STATES_E e, const char *f); diff --git a/sesman/scp_v1_mng.c b/sesman/scp_v1_mng.c index 1ae13476..2b7ff216 100644 --- a/sesman/scp_v1_mng.c +++ b/sesman/scp_v1_mng.c @@ -32,8 +32,6 @@ #include "libscp.h" -extern struct config_sesman *g_cfg; /* in sesman.c */ - static void parseCommonStates(enum SCP_SERVER_STATES_E e, const char *f); /******************************************************************************/ diff --git a/sesman/sesman.h b/sesman/sesman.h index ebffff47..0c0a4c6d 100644 --- a/sesman/sesman.h +++ b/sesman/sesman.h @@ -41,6 +41,13 @@ #include "libscp.h" +/* Globals */ +extern struct config_sesman *g_cfg; +extern unsigned char g_fixedkey[8]; +extern tintptr g_term_event; +extern int g_pid; + + /* * Close all file descriptors used by sesman. * diff --git a/sesman/session.c b/sesman/session.c index 28fdb3d9..10b8a16d 100644 --- a/sesman/session.c +++ b/sesman/session.c @@ -47,8 +47,6 @@ #define PR_SET_NO_NEW_PRIVS 38 #endif -extern unsigned char g_fixedkey[8]; -extern struct config_sesman *g_cfg; /* in sesman.c */ struct session_chain *g_sessions; int g_session_count; diff --git a/sesman/sig.c b/sesman/sig.c index cc29dea1..0c4c4483 100644 --- a/sesman/sig.c +++ b/sesman/sig.c @@ -32,10 +32,6 @@ #include "sesman.h" -extern int g_pid; -extern struct config_sesman *g_cfg; /* in sesman.c */ -extern tbus g_term_event; - /******************************************************************************/ void sig_sesman_shutdown(int sig) diff --git a/sesman/verify_user.c b/sesman/verify_user.c index 76918d68..2c72d38e 100644 --- a/sesman/verify_user.c +++ b/sesman/verify_user.c @@ -42,8 +42,6 @@ #define SECS_PER_DAY (24L*3600L) #endif -extern struct config_sesman *g_cfg; /* in sesman.c */ - static int auth_crypt_pwd(const char *pwd, const char *pln, char *crp); diff --git a/sesman/verify_user_bsd.c b/sesman/verify_user_bsd.c index 4b7793d1..06489653 100644 --- a/sesman/verify_user_bsd.c +++ b/sesman/verify_user_bsd.c @@ -43,8 +43,6 @@ #define SECS_PER_DAY (24L*3600L) #endif -extern struct config_sesman *g_cfg; /* in sesman.c */ - /******************************************************************************/ /* returns boolean */ long