/macosx-10.9.5/Libc-997.90.3/gen/FreeBSD/ |
H A D | signal.c | 54 struct sigaction sa, osa; local 64 if (_sigaction(s, &sa, &osa) < 0) 68 if (_sigaction_nobind(s, &sa, &osa) < 0) 72 return (osa.sa_handler);
|
H A D | daemon.c | 80 struct sigaction osa, sa; local 90 osa_ok = _sigaction(SIGHUP, &sa, &osa); 106 _sigaction(SIGHUP, &osa, NULL);
|
/macosx-10.9.5/sudo-72/src/ |
H A D | sigaction.c | 31 sigaction(signo, sa, osa) 34 sigaction_t *osa; 46 error = sigvec(signo, sa, osa); 47 if (!error && osa) 48 osa->sa_flags ^= SV_INTERRUPT; /* flip SV_INTERRUPT as above */
|
H A D | exec.c | 597 sigaction_t sa, osa; local 610 sigaction(SIGTSTP, &sa, &osa); 615 sigaction(SIGTSTP, &osa, NULL);
|
H A D | exec_pty.c | 201 sigaction_t sa, osa; local 243 sigaction(signo, &sa, &osa); 268 sigaction(signo, &osa, NULL);
|
/macosx-10.9.5/Heimdal-323.92.1/lib/hcrypto/ |
H A D | rand-timer.c | 85 struct sigaction sa, osa; local 89 sigaction(sig, &sa, &osa); 90 return osa.sa_handler; 113 RETSIGTYPE (*osa)(int); 124 osa = signal(SIGALRM, sigALRM); 157 signal(SIGALRM, osa != SIG_ERR ? osa : SIG_DFL);
|
/macosx-10.9.5/BerkeleyDB-21/db/common/ |
H A D | util_sig.c | 45 struct sigaction sa, osa; local 50 (void)sigaction(s, &sa, &osa);
|
/macosx-10.9.5/passwordserver_sasl-170/cyrus_sasl/mac/libdes/src/ |
H A D | rnd_keys.c | 241 /*
* Copyright (c) 1995, 1996, 1997 Kungliga Tekniska H�gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the Kungliga Tekniska
* H�gskolan and its contributors.
*
* 4. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
RCSID("$Id: rnd_keys.c,v 1.4 2005/01/10 19:09:07 snsimon Exp $");
#endif
#include <des.h>
#include <des_locl.h>
#ifdef KRB5
#include <krb5-types.h>
#elif defined(KRB4)
#include <ktypes.h>
#endif
#include <string.h>
#ifdef TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#elif defined(HAVE_SYS_TIME_H)
#include <sys/time.h>
#else
#include <time.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_IO_H
#include <io.h>
#endif
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#endif
/*
* Generate "random" data by checksumming a file.
*
* Returns -1 if there were any problems with permissions or I/O
* errors.
*/
static
int
sumFile (const char *name, int len, void *res)
{
u_int32_t sum[2];
u_int32_t buf[1024*2];
int fd, i;
fd = open (name, 0);
if (fd < 0)
return -1;
while (len > 0)
{
int n = read(fd, buf, sizeof(buf));
if (n < 0)
{
close(fd);
return n;
}
for (i = 0; i < (n/sizeof(buf[0])); i++)
{
sum[0] += buf[i];
i++;
sum[1] += buf[i];
}
len -= n;
}
close (fd);
memcpy (res, &sum, sizeof(sum));
return 0;
}
#if 0
static
int
md5sumFile (const char *name, int len, int32_t sum[4])
{
int32_t buf[1024*2];
int fd, cnt;
struct md5 md5;
fd = open (name, 0);
if (fd < 0)
return -1;
md5_init(&md5);
while (len > 0)
{
int n = read(fd, buf, sizeof(buf));
if (n < 0)
{
close(fd);
return n;
}
md5_update(&md5, buf, n);
len -= n;
}
md5_finito(&md5, (unsigned char *)sum);
close (fd);
return 0;
}
#endif
/*
* Create a sequence of random 64 bit blocks.
* The sequence is indexed with a long long and
* based on an initial des key used as a seed.
*/
static des_key_schedule sequence_seed;
static u_int32_t sequence_index[2];
/*
* Random number generator based on ideas from truerand in cryptolib
* as described on page 424 in Applied Cryptography 2 ed. by Bruce
* Schneier.
*/
static volatile int counter;
static volatile unsigned char *gdata; /* Global data */
static volatile int igdata; /* Index into global data */
static int gsize;
#if !defined(WIN32) && !defined(__EMX__) && !defined(__OS2__) && !defined(__CYGWIN32__)
/* Visual C++ 4.0 (Windows95/NT) */
static
RETSIGTYPE
sigALRM(int sig)
{
if (igdata < gsize)
gdata[igdata++] ^= counter & 0xff;
#ifndef HAVE_SIGACTION
signal(SIGALRM, sigALRM); /* Reinstall SysV signal handler */
#endif
SIGRETURN(0);
}
#endif
#if !defined(HAVE_RANDOM) && defined(HAVE_RAND)
#ifndef srandom
#define srandom srand
#endif
#ifndef random
#define random rand
#endif
#endif
static void
des_not_rand_data(unsigned char *data, int size)
{
int i;
srandom (time (NULL));
for(i = 0; i < size; ++i)
data[i] ^= random() % 0x100;
}
#if !defined(WIN32) && !defined(__EMX__) && !defined(__OS2__) && !defined(__CYGWIN32__)
#ifndef HAVE_SETITIMER
static void
pacemaker(struct timeval *tv)
{
fd_set fds;
pid_t pid;
pid = getppid();
while(1){
FD_ZERO(&fds);
FD_SET(0, &fds);
select(1, &fds, NULL, NULL, tv);
kill(pid, SIGALRM);
}
}
#endif
/*
* Generate size bytes of "random" data using timed interrupts.
* It takes about 40ms/byte random data.
* It's not neccessary to be root to run it.
*/
void
des_rand_data(unsigned char *data, int size)
{
struct itimerval tv, otv;
#ifdef HAVE_SIGACTION
struct sigaction sa, osa;
#else
RETSIGTYPE (*osa)(int);
#endif
int i, j;
#ifndef HAVE_SETITIMER
pid_t pid;
#endif
char *rnd_devices[] = {"/dev/random",
"/dev/srandom",
"/dev/urandom",
NULL};
char **p;
for(p = rnd_devices; *p; p++) {
int fd = open(*p, O_RDONLY | O_NDELAY);
if(fd >= 0 && read(fd, data, size) == size) {
close(fd);
return;
}
close(fd);
}
/* Paranoia? Initialize data from /dev/mem if we can read it. */
if (size >= 8)
sumFile("/dev/mem", (1024*1024*2), data);
gdata = data;
gsize = size;
igdata = 0;
#ifdef HAVE_SIGACTION
/* Setup signal handler */
sa.sa_handler = sigALRM;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sigaction(SIGALRM, &sa, &osa);
#else
osa = signal(SIGALRM, sigALRM);
#endif
/* Start timer */
tv.it_value.tv_sec = 0;
tv.it_value.tv_usec = 10 * 1000; /* 10 ms */
tv.it_interval = tv.it_value;
#ifdef HAVE_SETITIMER
setitimer(ITIMER_REAL, &tv, &otv);
#else
pid = fork();
if(pid == -1){
des_not_rand_data(data, size);
return;
}
if(pid == 0)
pacemaker(&tv.it_interval);
#endif
for(i = 0; i < 4; i++) {
for (igdata = 0; igdata < size;) /* igdata++ in sigALRM */
counter++;
for (j = 0; j < size; j++) /* Only use 2 bits each lap */
gdata[j] = (gdata[j]>>2) | (gdata[j]<<6);
}
#ifdef HAVE_SETITIMER
setitimer(ITIMER_REAL, &otv, 0);
#else
kill(pid, SIGKILL);
waitpid(pid, NULL, 0);
#endif
#ifdef HAVE_SIGACTION
sigaction(SIGALRM, &osa, 0);
#else
signal(SIGALRM, osa != SIG_ERR ? osa : SIG_DFL);
#endif
}
#else
void
des_rand_data(unsigned char *p, int s)
{
des_not_rand_data (p, s (…) 1 /* local
|
/macosx-10.9.5/tcsh-65/tcsh/ |
H A D | tw.help.c | 136 struct sigaction osa, sa; local 144 (void)sigaction(SIGINT, &sa, &osa); 145 cleanup_push(&osa, sigint_cleanup);
|
H A D | sh.proc.c | 1728 struct sigaction osa, nsa; local 1752 if (sigaction(SIGSYNCH, &nsa, &osa)) 1874 if (sigaction(SIGSYNCH, &osa, NULL))
|
/macosx-10.9.5/Heimdal-323.92.1/lib/libedit/src/ |
H A D | sig.c | 162 struct sigaction osa, nsa; local 172 if (sigaction(sighdl[i], &nsa, &osa) != -1 && 173 osa.sa_handler != sig_handler) 174 el->el_signal->sig_action[i] = osa;
|
/macosx-10.9.5/OpenSSH-186/openssh/openbsd-compat/ |
H A D | bsd-misc.c | 217 struct sigaction sa, osa; local 219 if (sigaction(sig, NULL, &osa) == -1) 221 if (osa.sa_handler != act) { 233 return (osa.sa_handler);
|
/macosx-10.9.5/libedit-39/src/ |
H A D | sig.c | 162 struct sigaction osa, nsa; local 174 if (sigaction(sighdl[i], &nsa, &osa) != -1 && 175 osa.sa_handler != sig_handler) 176 el->el_signal->sig_action[i] = osa;
|
/macosx-10.9.5/Heimdal-323.92.1/lib/roken/ |
H A D | test-mem.c | 59 struct sigaction sa, osa; variable in typeref:struct: 167 sigaction (SIGSEGV, &sa, &osa); 208 sigaction (SIGSEGV, &osa, NULL);
|
/macosx-10.9.5/sudo-72/src/auth/ |
H A D | bsdauth.c | 122 sigaction_t sa, osa; local 129 (void) sigaction(SIGCHLD, &sa, &osa); 167 (void) sigaction(SIGCHLD, &osa, NULL);
|
H A D | sudo_auth.c | 168 sigaction_t sa, osa; local 174 (void) sigaction(SIGTSTP, &sa, &osa); 243 (void) sigaction(SIGTSTP, &osa, NULL);
|
/macosx-10.9.5/Heimdal-323.92.1/lib/asn1/ |
H A D | check-common.c | 209 struct sigaction sa, osa; local 228 sigaction (SIGSEGV, &sa, &osa); 334 sigaction (SIGSEGV, &osa, NULL); 362 struct sigaction sa, osa; local 381 sigaction (SIGSEGV, &sa, &osa); 413 sigaction (SIGSEGV, &osa, NULL);
|
/macosx-10.9.5/screen-22/screen/ |
H A D | misc.c | 200 struct sigaction osa, sa; local 208 if (sigaction(sig, &sa, &osa)) 210 return osa.sa_handler;
|
/macosx-10.9.5/Heimdal-323.92.1/appl/ftp/ftp/ |
H A D | ftp.c | 331 struct sigaction sa, osa; local 339 sigaction (SIGINT, &sa, &osa); 349 sigaction (SIGINT, &osa, NULL); 399 sigaction (SIGINT, &osa, NULL); 404 osa.sa_handler != cmdabort && 405 osa.sa_handler != SIG_IGN) 406 osa.sa_handler (SIGINT);
|
/macosx-10.9.5/xnu-2422.115.4/bsd/kern/ |
H A D | kern_sig.c | 382 if (uap->osa) { 406 error = copyout(&vec64, uap->osa, sizeof(vec64)); 411 error = copyout(&vec32, uap->osa, sizeof(vec32));
|
/macosx-10.9.5/vim-53/runtime/lang/ |
H A D | menu_ca_es.latin1.vim | 58 menutrans Put\ &After<Tab>]p P&osa\ despr�s<Tab>]p
|
/macosx-10.9.5/system_cmds-597.90.1/fs_usage.tproj/ |
H A D | fs_usage.c | 2173 struct sigaction osa; local 2181 sigaction(SIGHUP, (struct sigaction *)NULL, &osa); 2183 if (osa.sa_handler == SIG_DFL)
|
/macosx-10.9.5/system_cmds-597.90.1/system_cmds-597.1.1/fs_usage.tproj/ |
H A D | fs_usage.c | 2173 struct sigaction osa; local 2181 sigaction(SIGHUP, (struct sigaction *)NULL, &osa); 2183 if (osa.sa_handler == SIG_DFL)
|
/macosx-10.9.5/xnu-2422.115.4/bsd/net/ |
H A D | if.c | 2589 struct osockaddr *osa = local 2592 osa->sa_family = sa->sa_family;
|