<commit_before>/*
 * Distributed under the terms of the GNU General Public License v2
 * $Header: /var/cvs/uClibc/libc/sysdeps/linux/common/ssp.c,v 1.6 2005/01/11 17:01:53 vapier Exp $
 *
 * This is a modified version of Hiroaki Etoh's stack smashing routines
 * implemented for glibc.
 *
 * The following people have contributed input to this code.
 * <NAME> - <<EMAIL>>
 * <NAME> - <<EMAIL>>
 * The PaX Team - <<EMAIL>>
 * <NAME> - <<EMAIL>>
 * <NAME> - <<EMAIL>>
 * <NAME> - <<EMAIL>>
 * <NAME> <<EMAIL>>
 *
 */

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include <string.h>
#include <unistd.h>
#include <sys/syslog.h>

#include <ssp-internal.h>

static __always_inline void block_signals(void)
{
	struct sigaction sa;
	sigset_t mask;

	sigfillset(&mask);

	sigdelset(&mask, SSP_SIGTYPE);	/* Block all signal handlers */
	SIGPROCMASK(SIG_BLOCK, &mask, NULL);	/* except SSP_SIGTYPE */

	/* Make the default handler associated with the signal handler */
	memset(&sa, 0, sizeof(struct sigaction));
	sigfillset(&sa.sa_mask);	/* Block all signals */
	sa.sa_flags = 0;
	sa.sa_handler = SIG_DFL;
	SIGACTION(SSP_SIGTYPE, &sa, NULL);
}

static __always_inline void ssp_write(int fd, const char *msg1, const char *msg2, const char *msg3)
{
	WRITE(fd, msg1, strlen(msg1));
	WRITE(fd, msg2, strlen(msg2));
	WRITE(fd, msg3, strlen(msg3));
	WRITE(fd, "()\n", 3);<commit_msg>Changed ssp.c license to LGPL and added vapier as contributor<commit_after>/*
 * Distributed under the terms of the GNU Lesser General Public License
 * $Header: $
 *
 * This is a modified version of Hiroaki Etoh's stack smashing routines
 * implemented for glibc.
 *
 * The following people have contributed input to this code.
 * <NAME> - <<EMAIL>>
 * <NAME> - <<EMAIL>>
 * The PaX Team - <<EMAIL>>
 * <NAME> - <<EMAIL>>
 * <NAME> - <<EMAIL>>
 * <NAME> - <<EMAIL>>
 * <NAME> <<EMAIL>>
 * <NAME> <<EMAIL>>
 */

#include <string.h>
#include <unistd.h>
#include <sys/syslog.h>

#include <ssp-internal.h>

static __always_inline void block_signals(void)
{
	struct sigaction sa;
	sigset_t mask;

	sigfillset(&mask);

	sigdelset(&mask, SSP_SIGTYPE);	/* Block all signal handlers */
	SIGPROCMASK(SIG_BLOCK, &mask, NULL);	/* except SSP_SIGTYPE */

	/* Make the default handler associated with the signal handler */
	memset(&sa, 0, sizeof(struct sigaction));
	sigfillset(&sa.sa_mask);	/* Block all signals */
	sa.sa_flags = 0;
	sa.sa_handler = SIG_DFL;
	SIGACTION(SSP_SIGTYPE, &sa, NULL);
}

static __always_inline void ssp_write(int fd, const char *msg1, const char *msg2, const char *msg3)
{
	WRITE(fd, msg1, strlen(msg1));
	WRITE(fd, msg2, strlen(msg2));
	WRITE(fd, msg3, strlen(msg3));
	WRITE(fd, "()\n", 3);
{'fraction_non_alphanumeric': 0.1554559043348281, 'fraction_numerical': 0.015321375186846039, 'mean_word_length': 4.3220675944334, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7035296', 'n_tokens_mistral': 1018, 'n_tokens_neox': 983, 'n_words': 283}