summaryrefslogtreecommitdiffstats
path: root/src/sh_readconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sh_readconf.c')
-rw-r--r--src/sh_readconf.c51
1 files changed, 29 insertions, 22 deletions
diff --git a/src/sh_readconf.c b/src/sh_readconf.c
index 892be10..a37bc4e 100644
--- a/src/sh_readconf.c
+++ b/src/sh_readconf.c
@@ -33,7 +33,7 @@
#include "sh_unix.h"
#include "sh_files.h"
#include "sh_xfer.h"
-#include "sh_gpg.h"
+#include "sh_sig.h"
#include "sh_hash.h"
#include "sh_dbIO.h"
#include "sh_ignore.h"
@@ -351,8 +351,8 @@ int sh_readconf_read (void)
#if defined(SH_STEALTH) && !defined(SH_STEALTH_MICRO)
SL_TICKET fdTmp = -1;
#endif
-#if defined(WITH_GPG) || defined(WITH_PGP)
- SL_TICKET fdGpg = -1;
+#if defined(WITH_SIG)
+ SL_TICKET fdSIG = -1;
#endif
char * tmp;
@@ -368,7 +368,7 @@ int sh_readconf_read (void)
int local_file = 1;
char local_flag = 'R';
-#if defined(WITH_GPG) || defined(WITH_PGP)
+#if defined(WITH_SIG)
int signed_content = S_FALSE;
int true_content = S_FALSE;
#endif
@@ -469,8 +469,8 @@ int sh_readconf_read (void)
{
sl_write_line(fdTmp, line_in, sl_strlen(line_in));
}
-#if defined(WITH_GPG) || defined(WITH_PGP)
- if (0 == sl_strncmp(line_in, _("-----END PGP SIGNATURE-----"), 25))
+#if defined(WITH_SIG)
+ if (S_TRUE == sh_sig_data_end(line_in))
break;
#else
if (0 == sl_strncmp(line_in, _("[EOF]"), 5))
@@ -484,18 +484,18 @@ int sh_readconf_read (void)
sl_rewind (fd);
#endif
-#if defined(WITH_GPG) || defined(WITH_PGP)
+#if defined(WITH_SIG)
/* extract the data and copy to temporary file
*/
- fdGpg = sh_gpg_extract_signed(fd);
+ fdSIG = sh_sig_extract_signed(fd);
sl_close(fd);
- fd = fdGpg;
+ fd = fdSIG;
/* Validate signature of open file.
*/
- if (0 != sh_gpg_check_sign (fd, SIG_CONF))
+ if (0 != sh_sig_check_signature (fd, SIG_CONF))
{
SH_FREE(line_in);
sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EXIT_ABORT1, sh.prg_name);
@@ -519,26 +519,19 @@ int sh_readconf_read (void)
/* Sun May 27 18:40:05 CEST 2001
*/
-#if defined(WITH_GPG) || defined(WITH_PGP)
+#if defined(WITH_SIG)
if (signed_content == S_FALSE)
{
- if (0 == sl_strcmp(line, _("-----BEGIN PGP SIGNED MESSAGE-----")))
+ if (S_TRUE == sh_sig_msg_start(line))
signed_content = S_TRUE;
else
continue;
}
- else if (true_content == S_FALSE)
- {
- if (line[0] == '\n')
- true_content = S_TRUE;
- else
- continue;
- }
- else if (signed_content == S_TRUE)
+ else /* if (signed_content == S_TRUE) */
{
- if (0 == sl_strcmp(line, _("-----BEGIN PGP SIGNATURE-----")))
+ if (S_TRUE == sh_sig_msg_end(line))
break;
- else if (0 == sl_strcmp(line, _("-----BEGIN PGP SIGNED MESSAGE-----")))
+ else if (S_TRUE == sh_sig_msg_start(line))
{
sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
_("second signed message in file"),
@@ -551,6 +544,14 @@ int sh_readconf_read (void)
aud_exit (FIL__, __LINE__,EXIT_FAILURE);
}
}
+
+ if (true_content == S_FALSE) /* continue if in header */
+ {
+ if (S_TRUE == sh_sig_msg_startdata(line))
+ true_content = S_TRUE;
+ else
+ continue;
+ }
#endif
/* Skip leading white space.
@@ -1017,6 +1018,10 @@ cfg_options ext_table[] = {
{ N_("useaclcheck"), SH_SECTION_MISC, SH_SECTION_NONE,
sh_unix_setcheckacl },
#endif
+#if !defined(SH_COMPILE_STATIC) && defined(__linux__) && defined(HAVE_AUPARSE_H) && defined(HAVE_AUPARSE_LIB)
+ { N_("setauditdflags"), SH_SECTION_MISC, SH_SECTION_NONE,
+ sh_audit_set_flags },
+#endif
{ N_("loosedircheck"), SH_SECTION_MISC, SH_SECTION_NONE,
sh_hash_loosedircheck },
{ N_("addokchars"), SH_SECTION_MISC, SH_SECTION_NONE,
@@ -1142,6 +1147,8 @@ cfg_options ext_table[] = {
sh_xfer_set_port },
{ N_("setserverinterface"), SH_SECTION_SRV, SH_SECTION_MISC,
sh_xfer_set_interface },
+ { N_("alias"), SH_SECTION_CLIENTS, SH_SECTION_NONE,
+ sh_xfer_register_alias },
{ N_("client"), SH_SECTION_CLIENTS, SH_SECTION_NONE,
sh_xfer_register_client },
#endif