input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
char *
match_filter_denylist(const char *proposal, const char *filter)
{
return filter_list(proposal, filter, 1);
}
| long long match_filter_denylist(char *a0, char *a1) {
return filter_list(a0, a1, 0x1);
}
|
int
ssh_packet_read_expect(struct ssh *ssh, u_int expected_type)
{
int r;
u_char type;
if ((r = ssh_packet_read_seqnr(ssh, &type,
((void *)0)
)) != 0)
return r;
if (type != expected_type) {
if ((r = sshpkt_disconnect(ssh,
"Protocol error: expected packet type %d, got %d",
expected_type, type)) != 0)
return r;
return -55;
}
return 0;
}
| long long ssh_packet_read_expect(unsigned long long *a0, unsigned long a1) {
char v0;
unsigned int v1;
unsigned long long v3;
v1 = ssh_packet_read_seqnr(a0, &v0, 0x0);
if (v1) {
v3 = v1;
} else if (a1 != v0) {
v1 = sshpkt_disconnect();
if (v1)
v3 = v1;
else
v3 = 4294967241;
} else {
v3 = 0;
}
return v3;
}
|
static char *
mbs_logical_substr (char const *s, size_t pos, size_t len)
{
char *v, *vlim;
size_t blen = strlen (s);
size_t llen = (
(__ctype_get_mb_cur_max ())
> 1) ? mbslen (s) : blen;
if (llen < pos || pos == 0 || len == 0 || len ==
(18446744073709551615UL)
)
return xstrdup ("");
size_t vlen =
(((
len
)<(
llen - pos + 1
))?(
len
):(
llen - pos + 1
))
;
if (
(__ctype_get_mb_cur_max ())
== 1)
{
v = xmalloc (vlen + 1);
vlim = mempcpy (v, s + pos - 1, vlen);
}
else
{
vlim = v = xmalloc (blen + 1);
mbui_iterator_t iter;
size_t idx=1;
for (((iter).cur.ptr = (s), (iter).in_shift =
0
, memset (&(iter).state, '\0', sizeof (mbstate_t)), (iter).next_done =
0
);
(mbuiter_multi_next (&(iter)), !(((iter).cur).wc_valid && ((iter).cur).wc == 0)) && vlen > 0;
((iter).cur.ptr += (iter).cur.bytes, (iter).next_done =
0
), ++idx)
{
if (idx < pos)
continue;
--vlen;
vlim = mempcpy (vlim, (iter).cur.ptr, (((iter).cur).bytes));
}
}
*vlim = '\0';
return v;
}
| int mbs_logical_substr(void* a0, unsigned long a1, unsigned long a2) {
void* v0;
char *v1;
unsigned int v2;
unsigned long long v3;
unsigned long long v4;
unsigned long v5;
char v6;
char v7;
char v8;
void* v9;
char v10;
char v11;
char v12;
unsigned long long v14;
unsigned int v15;
v4 = strlen(a0);
if (__ctype_get_mb_cur_max() <= 1)
v14 = v4;
else
v14 = mbslen(a0);
v5 = v14;
if (v5 < a1) {
LABEL_400590:
v15 = xstrdup(&g_401feb);
} else {
if (!a1)
goto LABEL_400590;
if (!a2)
goto LABEL_400590;
if (a2 == -1)
goto LABEL_400590;
v15 = v5 - a1 + 1;
if (a2 <= v5 - a1 + 1)
v15 = a2;
v2 = v15;
if (__ctype_get_mb_cur_max() == 1) {
v0 = xmalloc(*(&v2) + 1);
v1 = mempcpy(v0, a1 - 1 + a0, *(&v2));
} else {
v0 = xmalloc(v4 + 1);
v1 = v0;
v3 = 1;
v9 = a0;
v6 = 0;
memset(&v7, 0x0, 0x8);
v8 = 0;
while (true) {
mbuiter_multi_next(&v6);
if ((v11 ^ 1)) {
LABEL_4006cd:
v15 = 1;
goto LABEL_4006d9;
} else {
if (!(!*(&v12)))
goto LABEL_4006cd;
v15 = 0;
LABEL_4006d9:
if (!v15)
break;
if (!*(&v2))
break;
if (v3 >= a1) {
v2 = *(&v2) - 1;
v1 = mempcpy(v1, v9, *(&v10));
}
v9 = *(&v10) + v9;
v8 = 0;
v3 += 1;
}
}
}
*(v1) = 0;
v15 = v0;
}
return v15;
}
|
static void
chacha_ivsetup(chacha_ctx *x,const u8 *iv)
{
x->input[12] = 0;
x->input[13] = 0;
x->input[14] = (((u32)((iv + 0)[0]) ) | ((u32)((iv + 0)[1]) << 8) | ((u32)((iv + 0)[2]) << 16) | ((u32)((iv + 0)[3]) << 24));
x->input[15] = (((u32)((iv + 4)[0]) ) | ((u32)((iv + 4)[1]) << 8) | ((u32)((iv + 4)[2]) << 16) | ((u32)((iv + 4)[3]) << 24));
}
| void chacha_ivsetup(unsigned int a0[16], char a1[8]) {
char v0;
unsigned int v2[16];
unsigned long long v3;
a0[12] = 0;
a0[13] = 0;
a0[14] = (a1[1] * 0x100) | a1[0] | (a1[2] * 0x10000) | (a1[3] * 0x1000000);
v2 = a0;
a0[15] = (a1[5] * 0x100) | a1[4] | (a1[6] * 0x10000) | (a1[7] * 0x1000000);
v3 = *(&v0);
return;
}
|
char *
channel_open_message(struct ssh *ssh)
{
struct sshbuf *buf;
Channel *c;
u_int i;
int r;
char *cp, *ret;
if ((buf = sshbuf_new()) ==
((void *)0)
)
sshfatal("channels.c", __func__, 901, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new");
if ((r = sshbuf_putf(buf,
"The following connections are open:\r\n")) != 0)
sshfatal("channels.c", __func__, 904, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "sshbuf_putf");
for (i = 0; i < ssh->chanctxt->channels_alloc; i++) {
c = ssh->chanctxt->channels[i];
if (c ==
((void *)0)
)
continue;
switch (c->type) {
case 1:
case 2:
case 11:
case 5:
case 6:
case 14:
case 17:
case 15:
case 18:
case 19:
continue;
case 10:
case 3:
case 12:
case 13:
case 21:
case 22:
case 4:
case 7:
case 20:
case 16:
cp = channel_format_status(c);
if ((r = sshbuf_putf(buf, " #%d %.300s (%s)\r\n",
c->self, c->remote_name, cp)) != 0) {
free(cp);
sshfatal("channels.c", __func__, 935, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "sshbuf_putf");
}
free(cp);
continue;
default:
sshfatal("channels.c", __func__, 940, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "bad channel type %d", c->type);
}
}
if ((ret = sshbuf_dup_string(buf)) ==
((void *)0)
)
sshfatal("channels.c", __func__, 945, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_dup_string");
sshbuf_free(buf);
return ret;
}
| long channel_open_message(long param_1)
{
uint uVar1;
long lVar2;
undefined8 uVar3;
char **ppcVar4;
undefined *puVar5;
undefined *puVar6;
char *pcStack88;
undefined8 uStack80;
undefined auStack72 [8];
long local_40;
uint local_30;
int local_2c;
long local_28;
long local_20;
uint *local_18;
void *local_10;
ppcVar4 = (char **)auStack72;
uStack80 = 0x101d27;
local_40 = param_1;
local_28 = sshbuf_new();
if (local_28 == 0) {
ppcVar4 = &pcStack88;
pcStack88 = "sshbuf_new";
sshfatal("channels.c","channel_open_message",0x385,1,1,0);
}
*(undefined8 *)((long)ppcVar4 + -8) = 0x101d84;
local_2c = sshbuf_putf(local_28,"The following connections are open:\r\n");
puVar6 = (undefined *)ppcVar4;
if (local_2c != 0) {
*(undefined8 *)((long)ppcVar4 + -8) = 0x101d97;
uVar3 = ssh_err(local_2c);
puVar6 = (undefined *)((long)ppcVar4 + -0x10);
*(char **)((long)ppcVar4 + -0x10) = "sshbuf_putf";
*(undefined8 *)((long)ppcVar4 + -0x18) = 0x101dce;
sshfatal("channels.c","channel_open_message",0x388,1,1,uVar3);
}
for (local_30 = 0; local_30 < *(uint *)(*(long *)(local_40 + 0x868) + 8); local_30 = local_30 + 1)
{
local_18 = *(uint **)(**(long **)(local_40 + 0x868) + (ulong)local_30 * 8);
puVar5 = puVar6;
if (local_18 != (uint *)0x0) {
switch(*local_18) {
default:
*(ulong *)(puVar6 + -8) = (ulong)*local_18;
puVar5 = puVar6 + -0x10;
*(char **)(puVar6 + -0x10) = "bad channel type %d";
*(undefined8 *)(puVar6 + -0x18) = 0x101f18;
sshfatal("channels.c","channel_open_message",0x3ac,1,1,0);
break;
case 1:
case 2:
case 5:
case 6:
case 0xb:
case 0xe:
case 0xf:
case 0x11:
case 0x12:
case 0x13:
break;
case 3:
case 4:
case 7:
case 10:
case 0xc:
case 0xd:
case 0x10:
case 0x14:
case 0x15:
case 0x16:
*(undefined8 *)(puVar6 + -8) = 0x101e42;
local_10 = (void *)channel_format_status(local_18);
uVar3 = *(undefined8 *)(local_18 + 0x28);
uVar1 = local_18[1];
*(undefined8 *)(puVar6 + -8) = 0x101e77;
local_2c = sshbuf_putf(local_28," #%d %.300s (%s)\r\n",uVar1,uVar3,local_10);
if (local_2c != 0) {
*(undefined8 *)(puVar6 + -8) = 0x101e8c;
free(local_10);
*(undefined8 *)(puVar6 + -8) = 0x101e96;
uVar3 = ssh_err(local_2c);
puVar5 = puVar6 + -0x10;
*(char **)(puVar6 + -0x10) = "sshbuf_putf";
*(undefined8 *)(puVar6 + -0x18) = 0x101ecd;
sshfatal("channels.c","channel_open_message",0x3a7,1,1,uVar3);
}
*(undefined8 *)(puVar5 + -8) = 0x101ed9;
free(local_10);
}
}
puVar6 = puVar5;
}
*(undefined8 *)(puVar6 + -8) = 0x101f43;
local_20 = sshbuf_dup_string(local_28);
puVar5 = puVar6;
if (local_20 == 0) {
puVar5 = puVar6 + -0x10;
*(char **)(puVar6 + -0x10) = "sshbuf_dup_string";
*(undefined8 *)(puVar6 + -0x18) = 0x101f88;
sshfatal("channels.c","channel_open_message",0x3b1,1,1,0);
}
lVar2 = local_28;
*(undefined8 *)(puVar5 + -8) = 0x101f94;
sshbuf_free(lVar2);
return local_20;
}
|
static intmax_t
eval_arith_for_expr (l, okp)
WORD_LIST *l;
int *okp;
{
WORD_LIST *new;
intmax_t expresult;
int r, eflag;
char *expr, *temp;
expr = l->next ? string_list (l) : l->word->word;
temp = expand_arith_string (expr, 0x001|0x100);
if (l->next)
sh_xfree((expr), "execute_cmd.c", 3051);
new = make_word_list (make_word (temp), (WORD_LIST *)
((void *)0)
);
sh_xfree((temp), "execute_cmd.c", 3053);
if (new)
{
if (echo_command_at_execute)
xtrace_print_arith_cmd (new);
command_string_index = 0;
print_arith_command (new);
if (signal_in_progress (
(64 + 1)
) == 0 && running_trap == 0)
{
do { if (the_printed_command_except_trap) sh_xfree((the_printed_command_except_trap), "execute_cmd.c", 3064); } while (0);
the_printed_command_except_trap = (char *)strcpy (sh_xmalloc((1 + strlen (the_printed_command)), "execute_cmd.c", 3065), (the_printed_command));
}
r = run_debug_trap ();
eflag = (shell_compatibility_level > 51) ? 0 : 0x01;
this_command_name = "((";
if (debugging_mode == 0 || r == 0)
expresult = evalexp (new->word->word, eflag, okp);
else
{
expresult = 0;
if (okp)
*okp = 1;
}
dispose_words (new);
}
else
{
expresult = 0;
if (okp)
*okp = 1;
}
return (expresult);
}
| undefined8 eval_arith_for_expr(long *param_1,undefined4 *param_2)
{
char *__src;
int iVar1;
undefined8 uVar2;
undefined8 uVar3;
long lVar4;
size_t sVar5;
char *__dest;
undefined8 local_38;
if (*param_1 == 0) {
uVar2 = *(undefined8 *)param_1[1];
}
else {
uVar2 = string_list(param_1);
}
uVar3 = expand_arith_string(uVar2,0x101);
if (*param_1 != 0) {
sh_xfree(uVar2,"execute_cmd.c",0xbeb);
}
uVar2 = make_word(uVar3);
lVar4 = make_word_list(uVar2,0);
sh_xfree(uVar3,"execute_cmd.c",0xbed);
if (lVar4 == 0) {
local_38 = 0;
if (param_2 != (undefined4 *)0x0) {
*param_2 = 1;
}
}
else {
if (echo_command_at_execute != 0) {
xtrace_print_arith_cmd(lVar4);
}
_command_string_index = 0;
print_arith_command(lVar4);
iVar1 = signal_in_progress(0x41);
if ((iVar1 == 0) && (running_trap == 0)) {
if (the_printed_command_except_trap != 0) {
sh_xfree(the_printed_command_except_trap,"execute_cmd.c",0xbf8);
}
__src = the_printed_command;
sVar5 = strlen(the_printed_command);
__dest = (char *)sh_xmalloc(sVar5 + 1,"execute_cmd.c",0xbf9);
strcpy(__dest,__src);
}
iVar1 = run_debug_trap();
this_command_name = &DAT_0010b34f;
if ((debugging_mode == 0) || (iVar1 == 0)) {
local_38 = evalexp(**(undefined8 **)(lVar4 + 8),shell_compatibility_level < 0x34,param_2);
}
else {
local_38 = 0;
if (param_2 != (undefined4 *)0x0) {
*param_2 = 1;
}
}
dispose_words(lVar4);
}
return local_38;
}
|
size_t
xmbsrtowcs (dest, src, len, pstate)
wchar_t *dest;
const char **src;
size_t len;
mbstate_t *pstate;
{
mbstate_t *ps;
size_t mblength, wclength, n;
ps = pstate;
if (pstate ==
((void *)0)
)
{
if (!local_state_use)
{
memset (&local_state, '\0', sizeof(mbstate_t));
local_state_use = 1;
}
ps = &local_state;
}
n = strlen (*src);
if (dest ==
((void *)0)
)
{
wchar_t *wsbuf;
const char *mbs;
mbstate_t psbuf;
wsbuf = (wchar_t *) malloc ((n + 1) * sizeof(wchar_t));
mbs = *src;
psbuf = *ps;
wclength = mbsrtowcs (wsbuf, &mbs, n, &psbuf);
if (wsbuf)
free (wsbuf);
return wclength;
}
for (wclength = 0; wclength < len; wclength++, dest++)
{
if (mbsinit(ps))
{
if (**src == '\0')
{
*dest = L'\0';
*src =
((void *)0)
;
return (wclength);
}
else if (**src == '\\')
{
*dest = L'\\';
mblength = 1;
}
else
mblength = mbrtowc(dest, *src, n, ps);
}
else
mblength = mbrtowc(dest, *src, n, ps);
if (mblength == (size_t)-1 || mblength == (size_t)-2)
return (size_t)-1;
*src += mblength;
n -= mblength;
if (*dest == L'\0')
{
*src =
((void *)0)
;
break;
}
}
return (wclength);
}
| long long xmbsrtowcs(unsigned long long a0, char **a1, unsigned long a2, unsigned long long a3) {
unsigned long long *v0;
unsigned int *v1;
char *v2;
unsigned long long v3;
unsigned long long v4;
void* v5;
unsigned long long v6;
void* v7;
unsigned long v8;
unsigned long long v10;
unsigned long long v11;
v1 = a0;
v0 = a1;
v3 = a3;
if (!a3) {
if (!local_state_use) {
memset(&local_state, 0x0, 0x8);
local_state_use = 1;
}
v3 = &local_state;
}
v6 = strlen(*(a1));
if (!v1) {
v7 = malloc((v6 + 1) * 4);
v2 = *(a1);
v8 = *(v3);
v5 = mbsrtowcs(v7, &v2, v6, &v8);
if (v7)
free(v7);
v11 = v5;
} else {
v5 = 0;
while (true) {
if (v5 < a2) {
v10 = mbsinit(v3);
if (!v10) {
v4 = mbrtowc(v1, *(a1), v6, v3);
} else if (!*(*(a1))) {
*(v1) = 0;
*(a1) = 0;
v11 = v5;
break;
} else if (*(*(a1)) == 92) {
*(v1) = 92;
v4 = 1;
} else {
v4 = mbrtowc(v1, *(a1), v6, v3);
}
if (!v10 || *(*(a1))) {
if (v4 != -1 && v4 != -2) {
*(a1) = &(*(a1))[v4];
v6 -= v4;
if (!*(v1)) {
*(a1) = 0;
} else {
v5 += 1;
v1 += 1;
continue;
}
}
if (v4 == -1 || v4 == -2) {
v11 = -1;
break;
}
}
}
if (v5 >= a2 || !*(v1) && !v10 && v4 != -1 && v4 != -2 || !*(v1) && *(*(a1)) && v4 != -1 && v4 != -2) {
v11 = v5;
break;
}
}
}
return v11;
}
|
void
mm_request_receive_expect(int sock, enum monitor_reqtype type, struct sshbuf *m)
{
u_char rtype;
int r;
sshlog("monitor_wrap.c", __func__, 170, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "entering, type %d", type);
mm_request_receive(sock, m);
if ((r = sshbuf_get_u8(m, &rtype)) != 0)
sshfatal("monitor_wrap.c", __func__, 174, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse");
if (rtype != type)
sshfatal("monitor_wrap.c", __func__, 176, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "read: rtype %d != type %d", rtype, type);
}
| void mm_request_receive_expect(unsigned long a0, unsigned long a1, unsigned long long a2) {
unsigned long v0;
unsigned long long v1;
unsigned long v2;
char v3;
unsigned int v4;
unsigned long long v5;
unsigned long long *v7;
unsigned long long v8;
v0 = a1;
sshlog("monitor_wrap.c", "mm_request_receive_expect", 0xaa, 0x1, 0x7, 0x0, "entering, type %d");
mm_request_receive(a0, a2);
v4 = sshbuf_get_u8(a2, &v3, &v3);
if (v4)
sshfatal("monitor_wrap.c", "mm_request_receive_expect", 0xae, 0x1, 0x1, ssh_err(v4));
if (a1 != v3) {
v5 = a1;
v2 = v3;
v1 = "read: rtype %d != type %d";
sshfatal("monitor_wrap.c", "mm_request_receive_expect", 0xb0, 0x1, 0x1, 0x0);
}
v8 = v5 ^ v7[5];
return;
}
|
static void fail_exit (int code)
{
if (gr_locked) {
if (gr_unlock () == 0) {
fprintf (
stderr
,
gettext ("%s: failed to unlock %s\n"),
Prog, gr_dbname ());
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
3
, "failed to unlock %s", gr_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
}
}
if (sgr_locked) {
if (sgr_unlock () == 0) {
fprintf (
stderr
,
gettext ("%s: failed to unlock %s\n"),
Prog, sgr_dbname ());
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
3
, "failed to unlock %s", sgr_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
}
}
exit (code);
}
| void fail_exit(int param_1)
{
int iVar1;
undefined8 uVar2;
char *pcVar3;
undefined8 uVar4;
char *local_38;
char *local_30;
if (gr_locked != '\0') {
iVar1 = gr_unlock();
if (iVar1 == 0) {
uVar2 = gr_dbname();
uVar4 = Prog;
pcVar3 = (char *)gettext("%s: failed to unlock %s\n");
fprintf(stderr,pcVar3,uVar4,uVar2);
pcVar3 = setlocale(6,(char *)0x0);
local_38 = (char *)0x0;
if (pcVar3 != (char *)0x0) {
local_38 = strdup(pcVar3);
}
if (local_38 != (char *)0x0) {
setlocale(6,"C");
}
uVar4 = gr_dbname();
syslog(3,"failed to unlock %s",uVar4);
if (local_38 != (char *)0x0) {
setlocale(6,local_38);
free(local_38);
}
}
}
if (sgr_locked != '\0') {
iVar1 = sgr_unlock();
if (iVar1 == 0) {
uVar2 = sgr_dbname();
uVar4 = Prog;
pcVar3 = (char *)gettext("%s: failed to unlock %s\n");
fprintf(stderr,pcVar3,uVar4,uVar2);
pcVar3 = setlocale(6,(char *)0x0);
local_30 = (char *)0x0;
if (pcVar3 != (char *)0x0) {
local_30 = strdup(pcVar3);
}
if (local_30 != (char *)0x0) {
setlocale(6,"C");
}
uVar4 = sgr_dbname();
syslog(3,"failed to unlock %s",uVar4);
if (local_30 != (char *)0x0) {
setlocale(6,local_30);
free(local_30);
}
}
}
exit(param_1);
}
|
static void
initAll(int argc, char **argv)
{
rsRetVal localRet;
int ch;
int iHelperUOpt;
int bChDirRoot = 1;
char *arg;
char cwdbuf[128];
int parentPipeFD = 0;
rsRetVal iRet = RS_RET_OK;
hdlr_enable(
21
, hdlr_sigttin_ou);
hdlr_enable(
22
, hdlr_sigttin_ou);
while((ch = getopt(argc, argv, "46ACDdf:hi:M:nN:o:qQS:T:u:vwx")) !=
(-1)
) {
switch((char)ch) {
case '4':
case '6':
case 'A':
case 'f':
case 'i':
case 'n':
case 'N':
case 'q':
case 'Q':
case 'S':
case 'T':
case 'u':
case 'w':
case 'C':
case 'o':
case 'x':
if((iRet = bufOptAdd(ch, optarg)) != RS_RET_OK) goto finalize_it;
break;
case 'd':
debugging_on = 1;
Debug = 1;
yydebug = 1;
break;
case 'D':
yydebug = 1;
break;
case 'M':
glblModPath = (uchar*) optarg;
break;
case 'v':
printVersion();
exit(0);
case 'h':
case '?':
default:
rsyslogd_usage();
}
}
if(argc - optind)
rsyslogd_usage();
if(Debug) { r_dbgprintf("rsyslogd.c", "rsyslogd %s startup, module path '%s', cwd:%s\n", "8.2210.0", glblModPath ==
((void *)0)
? "" : (char*)glblModPath, getcwd(cwdbuf, sizeof(cwdbuf))); }
;
if((iRet = rsyslogd_InitGlobalClasses()) != RS_RET_OK) goto finalize_it;
if((iRet = modInitIminternal()) != RS_RET_OK) {
fprintf(
stderr
, "fatal error: could not initialize errbuf object (error code %d).\n",
iRet);
exit(1);
}
if(getenv("TZ") ==
((void *)0)
) {
const char *const tz =
(access("/etc/localtime",
4
) == 0) ? "TZ=/etc/localtime" : "TZ=UTC";
putenv((char*)tz);
if(emitTZWarning) {
LogMsg(0, RS_RET_NO_TZ_SET, 4, "environment variable TZ is not "
"set, auto correcting this to %s", tz);
} else {
r_dbgprintf("rsyslogd.c", "environment variable TZ is not set, auto correcting this to %s\n", tz);
}
}
while((iRet = bufOptRemove(&ch, &arg)) == RS_RET_OK) {
if(Debug) { r_dbgprintf("rsyslogd.c", "deque option %c, optarg '%s'\n", ch, (arg ==
((void *)0)
) ? "" : arg); };
switch((char)ch) {
case '4':
fprintf (
stderr
, "rsyslogd: the -4 command line option has gone away.\n"
"Please use the global(net.ipprotocol=\"ipv4-only\") "
"configuration parameter instead.\n");
break;
case '6':
fprintf (
stderr
, "rsyslogd: the -6 command line option will has gone away.\n"
"Please use the global(net.ipprotocol=\"ipv6-only\") "
"configuration parameter instead.\n");
break;
case 'A':
fprintf (
stderr
, "rsyslogd: the -A command line option will go away "
"soon.\n"
"Please use the omfwd parameter \"upd.sendToAll\" instead.\n");
send_to_all++;
break;
case 'S':
fprintf (
stderr
, "rsyslogd: the -S command line option will go away "
"soon.\n"
"Please use the omrelp parameter \"localClientIP\" instead.\n");
if(glbl.GetSourceIPofLocalClient() !=
((void *)0)
) {
fprintf (
stderr
, "rsyslogd: Only one -S argument allowed, the first one is taken.\n");
} else {
glbl.SetSourceIPofLocalClient((uchar*)arg);
}
break;
case 'f':
ConfFile = (uchar*) arg;
break;
case 'i':
free((void*)PidFile);
PidFile = arg;
break;
case 'n':
doFork = 0;
break;
case 'N':
iConfigVerify = (arg ==
((void *)0)
) ? 0 : atoi(arg);
break;
case 'o':
if(fp_rs_full_conf_output !=
((void *)0)
) {
fprintf(
stderr
, "warning: -o option given multiple times. Now "
"using value %s\n", (arg ==
((void *)0)
) ? "-" : arg);
fclose(fp_rs_full_conf_output);
fp_rs_full_conf_output =
((void *)0)
;
}
if(arg ==
((void *)0)
|| !strcmp(arg, "-")) {
fp_rs_full_conf_output =
stdout
;
} else {
fp_rs_full_conf_output = fopen(arg, "w");
}
if(fp_rs_full_conf_output ==
((void *)0)
) {
perror(arg);
fprintf (
stderr
, "rsyslogd: cannot open config output file %s - "
"-o option will be ignored\n", arg);
} else {
time_t tTime;
struct tm tp;
datetime.GetTime(&tTime);
localtime_r(&tTime, &tp);
fprintf(fp_rs_full_conf_output,
"## full conf created by rsyslog version %s at "
"%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d ##\n",
"8.2210.0", tp.tm_year + 1900, tp.tm_mon + 1, tp.tm_mday,
tp.tm_hour, tp.tm_min, tp.tm_sec);
}
break;
case 'q':
fprintf (
stderr
, "rsyslogd: the -q command line option has gone away.\n"
"Please use the global(net.aclAddHostnameOnFail=\"on\") "
"configuration parameter instead.\n");
break;
case 'Q':
fprintf (
stderr
, "rsyslogd: the -Q command line option has gone away.\n"
"Please use the global(net.aclResolveHostname=\"off\") "
"configuration parameter instead.\n");
break;
case 'T':
if(arg ==
((void *)0)
) {
fprintf(
stderr
, "-T options needs a parameter\n");
exit(1);
}
if(chroot(arg) != 0) {
perror("chroot");
exit(1);
}
if(chdir("/") != 0) {
perror("chdir");
exit(1);
}
break;
case 'u':
iHelperUOpt = (arg ==
((void *)0)
) ? 0 : atoi(arg);
if(iHelperUOpt & 0x01) {
fprintf (
stderr
, "rsyslogd: the -u command line option has gone away.\n"
"For the 0x01 bit, please use the "
"global(parser.parseHostnameAndTag=\"off\") "
"configuration parameter instead.\n");
}
if(iHelperUOpt & 0x02) {
fprintf (
stderr
, "rsyslogd: the -u command line option will go away "
"soon.\n"
"For the 0x02 bit, please use the -C option instead.");
bChDirRoot = 0;
}
break;
case 'C':
bChDirRoot = 0;
break;
case 'w':
fprintf (
stderr
, "rsyslogd: the -w command line option has gone away.\n"
"Please use the global(net.permitWarning=\"off\") "
"configuration parameter instead.\n");
break;
case 'x':
fprintf (
stderr
, "rsyslogd: the -x command line option has gone away.\n"
"Please use the global(net.enableDNS=\"off\") "
"configuration parameter instead.\n");
break;
case 'h':
case '?':
default:
rsyslogd_usage();
}
}
if(iRet != RS_RET_END_OF_LINKEDLIST)
goto finalize_it;;
if(iConfigVerify) {
doFork = 0;
fprintf(
stderr
, "rsyslogd: version %s, config validation run (level %d), master config %s\n",
"8.2210.0", iConfigVerify, ConfFile);
}
resetErrMsgsFlag();
localRet = rsconf.Load(&ourConf, ConfFile);
if(fp_rs_full_conf_output !=
((void *)0)
) {
if(fp_rs_full_conf_output !=
stdout
) {
fclose(fp_rs_full_conf_output);
}
fp_rs_full_conf_output =
((void *)0)
;
}
if( (localRet == RS_RET_CONF_FILE_NOT_FOUND)
|| (localRet == RS_RET_NO_ACTIONS) ) {
if((loadConf->globals.glblDevOptions & 1) == 1) {
fprintf(
stderr
, "rsyslogd: NOTE: developer-only option set to keep rsyslog "
"running where it should abort - this can lead to "
"more problems later in the run.\n");
} else {
do { iRet = localRet; goto finalize_it; } while (0);
}
}
glbl.GenerateLocalHostNameProperty();
if(hadErrMsgs()) {
if(loadConf->globals.bAbortOnUncleanConfig) {
fprintf(
stderr
, "rsyslogd: global(AbortOnUncleanConfig=\"on\") is set, and "
"config is not clean.\n"
"Check error log for details, fix errors and restart. As a last\n"
"resort, you may want to use global(AbortOnUncleanConfig=\"off\") \n"
"to permit a startup with a dirty config.\n");
exit(2);
}
if(iConfigVerify) {
exit(1);
}
localRet = RS_RET_OK;
}
if((iRet = localRet) != RS_RET_OK) goto finalize_it;
if((iRet = rsyslogd_InitStdRatelimiters()) != RS_RET_OK) goto finalize_it;
if(bChDirRoot) {
if(chdir("/") != 0)
fprintf(
stderr
, "Can not do 'cd /' - still trying to run\n");
}
if(iConfigVerify)
goto finalize_it;;
thrdInit();
if((iRet = checkStartupOK()) != RS_RET_OK) goto finalize_it;
if(doFork) {
parentPipeFD = forkRsyslog();
}
{ glbl_ourpid = (getpid()); };
hdlr_enable(
13
,
((__sighandler_t) 1)
);
hdlr_enable(
25
,
((__sighandler_t) 1)
);
if(Debug || loadConf->globals.permitCtlC) {
hdlr_enable(
10
, rsyslogdDebugSwitch);
hdlr_enable(
2
, rsyslogdDoDie);
hdlr_enable(
3
, rsyslogdDoDie);
} else {
hdlr_enable(
10
,
((__sighandler_t) 1)
);
hdlr_enable(
2
,
((__sighandler_t) 1)
);
hdlr_enable(
3
,
((__sighandler_t) 1)
);
}
hdlr_enable(
15
, rsyslogdDoDie);
hdlr_enable(
17
, hdlr_sigchld);
hdlr_enable(
1
, hdlr_sighup);
if(rsconfNeedDropPriv(loadConf)) {
if((iRet = writePidFile()) != RS_RET_OK) goto finalize_it;
}
if((iRet = rsconf.Activate(ourConf)) != RS_RET_OK) goto finalize_it;
if(runConf->globals.bLogStatusMsgs) {
char bufStartUpMsg[512];
snprintf(bufStartUpMsg, sizeof(bufStartUpMsg),
"[origin software=\"rsyslogd\" " "swVersion=\"" "8.2210.0"
"\" x-pid=\"%d\" x-info=\"https:
(int) glbl_ourpid);
logmsgInternal(-1, (5<<3)|6, (uchar*)bufStartUpMsg, 0);
}
if(!rsconfNeedDropPriv(runConf)) {
if((iRet = writePidFile()) != RS_RET_OK) goto finalize_it;
}
if(Debug) { r_dbgprintf("rsyslogd.c", "rsyslogd: initialization completed, transitioning to regular run mode\n"); };
if(doFork) {
tellChildReady(parentPipeFD, "OK");
stddbg = -1;
close(1);
close(2);
runConf->globals.bErrMsgToStderr = 0;
}
finalize_it:
if(iRet == RS_RET_VALIDATION_RUN) {
fprintf(
stderr
, "rsyslogd: End of config validation run. Bye.\n");
exit(0);
} else if(iRet != RS_RET_OK) {
fprintf(
stderr
, "rsyslogd: run failed with error %d (see rsyslog.h "
"or try https:
iRet, iRet*-1);
exit(1);
}
}
| void initAll(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned int v8;
char v9;
char v10;
unsigned long v11;
char v12;
char v13;
char v14;
char v15;
char v16;
char v17;
char v18;
char v19;
char v20;
unsigned long v22;
unsigned long long *v23;
unsigned long long v24;
v5 = 1;
v6 = 0;
v7 = 0;
hdlr_enable(0x15, hdlr_sigttin_ou);
hdlr_enable(0x16, hdlr_sigttin_ou);
while (true) {
v3 = getopt(a0, a1, "46ACDdf:hi:M:nN:o:qQS:T:u:vwx");
if (v3 == -1)
break;
switch (v3) {
case 52: case 54: case 65: case 67: case 78: case 81: case 83: case 84: case 102: case 105: case 110: case 111: case 113: case 117: case 119: case 120:
v7 = bufOptAdd(v3, *(&optarg));
if (v7)
goto LABEL_40367b;
continue;
case 68:
yydebug = 1;
break;
case 77:
glblModPath = *(&optarg);
break;
case 100:
debugging_on = 1;
Debug = 1;
yydebug = 1;
break;
case 118:
printVersion();
exit(0x0);
default:
rsyslogd_usage();
}
}
if (a0 != optind)
rsyslogd_usage();
if (Debug) {
getcwd(&v18, 0x80);
r_dbgprintf("rsyslogd.c", "rsyslogd %s startup, module path '%s', cwd:%s\n", "8.2210.0");
}
v22 = rsyslogd_InitGlobalClasses(a0, a1, a2, a3, a4, a5);
v7 = v22;
if (v7)
goto LABEL_40367b;
v7 = modInitIminternal();
if (v7) {
fprintf(*(&stderr), "fatal error: could not initialize errbuf object (error code %d).\n", v7);
exit(0x1);
}
if (!getenv("TZ")) {
if (access("/etc/localtime", 0x4))
v22 = "TZ=UTC";
else
v22 = "TZ=/etc/localtime";
v11 = v22;
putenv(v11);
if (emitTZWarning)
LogMsg(0x0, 0xfffff676, 0x4, "environment variable TZ is not set, auto correcting this to %s", v11, a5);
else
r_dbgprintf("rsyslogd.c", "environment variable TZ is not set, auto correcting this to %s\n", v11);
}
while (true) {
v7 = bufOptRemove(&v3, &v9);
if (v7)
break;
if (Debug)
r_dbgprintf("rsyslogd.c", "deque option %c, optarg '%s'\n", v3);
switch (v3) {
case 52:
fprintf(*(&stderr), "rsyslogd: the -4 command line option has gone away.\nPlease use the global(net.ipprotocol=\"ipv4-only\") configuration parameter instead.\n");
continue;
case 54:
fprintf(*(&stderr), "rsyslogd: the -6 command line option will has gone away.\nPlease use the global(net.ipprotocol=\"ipv6-only\") configuration parameter instead.\n");
continue;
case 65:
fprintf(*(&stderr), "rsyslogd: the -A command line option will go away soon.\nPlease use the omfwd parameter \"upd.sendToAll\" instead.\n");
send_to_all = send_to_all + 1;
continue;
case 67:
v5 = 0;
continue;
case 78:
if (!*(&v9))
*(&v22) = 0;
else
v22 = atoi(*(&v9));
iConfigVerify = v22;
continue;
case 81:
fprintf(*(&stderr), "rsyslogd: the -Q command line option has gone away.\nPlease use the global(net.aclResolveHostname=\"off\") configuration parameter instead.\n");
continue;
case 83:
fprintf(*(&stderr), "rsyslogd: the -S command line option will go away soon.\nPlease use the omrelp parameter \"localClientIP\" instead.\n");
if (!*(4212528)(a0, "rsyslogd: the -S command line option will go away soon.\nPlease use the omrelp parameter \"localClientIP\" instead.\n", &g_406c44, a3, a4, a5)) {
*(4212536)(*(&v9));
break;
} else {
fprintf(*(&stderr), "rsyslogd: Only one -S argument allowed, the first one is taken.\n");
}
continue;
case 84:
if (!*(&v9)) {
fprintf(*(&stderr), "-T options needs a parameter\n");
exit(0x1);
} else if (chroot(*(&v9))) {
perror("chroot");
exit(0x1);
} else if (chdir("/")) {
perror("chdir");
exit(0x1);
}
continue;
case 102:
ConfFile = *(&v9);
continue;
case 105:
free(PidFile);
PidFile = *(&v9);
continue;
case 110:
doFork = 0;
continue;
case 111:
if (fp_rs_full_conf_output) {
if (!*(&v9))
*(&v22) = &g_406379;
else
*(&v22) = *(&v9);
a3 = *(&stderr);
fprintf(*(&stderr), "warning: -o option given multiple times. Now using value %s\n", v22);
fclose(fp_rs_full_conf_output);
fp_rs_full_conf_output = 0;
}
if (!*(&v9)) {
LABEL_402f68:
fp_rs_full_conf_output = stdout;
goto LABEL_402f95;
} else {
if (!strcmp(*(&v9), "-"))
goto LABEL_402f68;
fp_rs_full_conf_output = fopen(*(&v9), "w");
LABEL_402f95:
if (!fp_rs_full_conf_output) {
perror(*(&v9));
fprintf(*(&stderr), "rsyslogd: cannot open config output file %s - -o option will be ignored\n", *(&v9));
break;
} else {
*(4212296)(&v10);
localtime_r(&v10, &v12);
v2 = *(&v12);
v1 = *(&v13);
v0 = *(&v14);
a5 = *(&v15);
a4 = *(&v16) + 1;
a3 = *(&v17) + 1900;
fprintf(fp_rs_full_conf_output, "## full conf created by rsyslog version %s at %4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d ##\n", &g_405fe4);
break;
}
}
case 113:
fprintf(*(&stderr), "rsyslogd: the -q command line option has gone away.\nPlease use the global(net.aclAddHostnameOnFail=\"on\") configuration parameter instead.\n");
continue;
case 117:
if (!*(&v9))
*(&v22) = 0;
else
v22 = atoi(*(&v9));
v8 = v22;
if ((v8 & 1))
fprintf(*(&stderr), "rsyslogd: the -u command line option has gone away.\nFor the 0x01 bit, please use the global(parser.parseHostnameAndTag=\"off\") configuration parameter instead.\n");
if ((v8 & 2)) {
fprintf(*(&stderr), "rsyslogd: the -u command line option will go away soon.\nFor the 0x02 bit, please use the -C option instead.");
v5 = 0;
}
continue;
case 119:
fprintf(*(&stderr), "rsyslogd: the -w command line option has gone away.\nPlease use the global(net.permitWarning=\"off\") configuration parameter instead.\n");
continue;
case 120:
fprintf(*(&stderr), "rsyslogd: the -x command line option has gone away.\nPlease use the global(net.enableDNS=\"off\") configuration parameter instead.\n");
continue;
default:
rsyslogd_usage();
}
}
if (v7 != -2014)
goto LABEL_40367b;
if (iConfigVerify) {
doFork = 0;
fprintf(*(&stderr), "rsyslogd: version %s, config validation run (level %d), master config %s\n", &g_405fe4, iConfigVerify, ConfFile);
}
resetErrMsgsFlag();
v4 = g_4048d8(&ourConf, ConfFile, g_4048d8);
if (fp_rs_full_conf_output) {
if (fp_rs_full_conf_output != stdout)
fclose(fp_rs_full_conf_output);
fp_rs_full_conf_output = 0;
}
if (v4 != -2104 && !(v4 == -2103))
goto LABEL_40333d;
if ((*((loadConf + 232)) & 1)) {
fprintf(*(&stderr), "rsyslogd: NOTE: developer-only option set to keep rsyslog running where it should abort - this can lead to more problems later in the run.\n");
} else {
v7 = v4;
goto LABEL_40367b;
}
LABEL_40333d:
*(4212472)();
if (hadErrMsgs(a0, a1, a2, a3, a4, a5)) {
if (*((loadConf + 48))) {
fprintf(*(&stderr), "rsyslogd: global(AbortOnUncleanConfig=\"on\") is set, and config is not clean.\nCheck error log for details, fix errors and restart. As a last\nresort, you may want to use global(AbortOnUncleanConfig=\"off\") \nto permit a startup with a dirty config.\n");
exit(0x2);
} else if (!iConfigVerify) {
v4 = 0;
} else {
exit(0x1);
}
}
v7 = v4;
if (v7)
goto LABEL_40367b;
v7 = rsyslogd_InitStdRatelimiters();
if (v7)
goto LABEL_40367b;
if (v5 && chdir("/"))
fprintf(*(&stderr), "Can not do 'cd /' - still trying to run\n");
if (iConfigVerify)
goto LABEL_40367b;
thrdInit();
v7 = checkStartupOK();
if (v7)
goto LABEL_40367b;
if (doFork)
v6 = forkRsyslog(a0, a1, a2);
glbl_ourpid = getpid();
hdlr_enable(0xd, 0x1);
hdlr_enable(0x19, 0x1);
if (!Debug && !*((loadConf + 252))) {
hdlr_enable(0xa, 0x1);
hdlr_enable(0x2, 0x1);
hdlr_enable(0x3, 0x1);
LABEL_4034eb:
hdlr_enable(0xf, rsyslogdDoDie);
hdlr_enable(0x11, hdlr_sigchld);
hdlr_enable(0x1, hdlr_sighup);
if (rsconfNeedDropPriv(loadConf)) {
v7 = writePidFile();
if (v7)
goto LABEL_40367b;
}
v7 = g_4048e0(ourConf);
if (v7)
goto LABEL_40367b;
if (*((runConf + 36))) {
snprintf(&v19, 0x200, "[origin software=\"rsyslogd\" swVersion=\"8.2210.0\" x-pid=\"%d\" x-info=\"https:
logmsgInternal(0xffffffff, 0x2e, &v19, 0x0);
}
if (!rsconfNeedDropPriv(runConf)) {
v7 = writePidFile();
if (v7)
goto LABEL_40367b;
}
if (Debug)
r_dbgprintf("rsyslogd.c", "rsyslogd: initialization completed, transitioning to regular run mode\n", g_4048e0);
if (doFork) {
tellChildReady(v6, "OK", g_4048e0);
stddbg = -1;
close(0x1);
close(0x2);
*((runConf + 40)) = 0;
goto LABEL_40367b;
}
}
hdlr_enable(0xa, rsyslogdDebugSwitch);
hdlr_enable(0x2, rsyslogdDoDie);
hdlr_enable(0x3, rsyslogdDoDie);
goto LABEL_4034eb;
LABEL_40367b:
if (v7 == -9) {
fprintf(*(&stderr), "rsyslogd: End of config validation run. Bye.\n");
exit(0x0);
} else if (v7) {
fprintf(*(&stderr), "rsyslogd: run failed with error %d (see rsyslog.h or try https:
exit(0x1);
} else {
v24 = *(&v20) ^ v23[5];
return;
}
}
|
static WHILE_COM *
copy_while_command (com)
WHILE_COM *com;
{
WHILE_COM *new_while;
new_while = (WHILE_COM *)sh_xmalloc((sizeof (WHILE_COM)), "copy_cmd.c", 269);
new_while->flags = com->flags;
new_while->test = copy_command (com->test);
new_while->action = copy_command (com->action);
return (new_while);
}
| long copy_while_command(long a1)
{
long v2;
v2 = sh_xmalloc(24LL, "copy_cmd.c", 269LL);
*(_DWORD *)v2 = *(_DWORD *)a1;
*(_QWORD *)(v2 + 8) = copy_command(*(_QWORD *)(a1 + 8));
*(_QWORD *)(v2 + 16) = copy_command(*(_QWORD *)(a1 + 16));
return v2;
}
|
int get_sign_status(int server)
{
const char *msg;
if (batch) {
return cfg.signing_key;
} else {
if (server)
msg =
"Will the certificate be used for signing (DHE ciphersuites)? (Y/n): ";
else
msg =
"Will the certificate be used for signing (required for TLS)? (Y/n): ";
return read_yesno(msg, 1);
}
}
| long long get_sign_status(unsigned long a0) {
unsigned long long v0;
unsigned long long v2;
if (*(got.batch)) {
v2 = *((got.cfg + 556));
return v2;
}
if (a0)
v0 = "Will the certificate be used for signing (DHE ciphersuites)? (Y/n): ";
else
v0 = "Will the certificate be used for signing (required for TLS)? (Y/n): ";
v2 = read_yesno(v0, 0x1);
return v2;
}
|
void jbd2_journal_destroy_revoke(journal_t *journal)
{
journal->j_revoke =
((void *)0)
;
if (journal->j_revoke_table[0])
jbd2_journal_destroy_revoke_table(journal->j_revoke_table[0]);
if (journal->j_revoke_table[1])
jbd2_journal_destroy_revoke_table(journal->j_revoke_table[1]);
}
| long long jbd2_journal_destroy_revoke(unsigned long long a0[24]) {
unsigned long long v1;
a0[21] = 0;
if (a0[22])
jbd2_journal_destroy_revoke_table(a0[22]);
v1 = a0[23];
if (a0[23])
v1 = jbd2_journal_destroy_revoke_table(a0[23]);
return v1;
}
|
void
sshsk_free_resident_keys(struct sshsk_resident_key **srks, size_t nsrks)
{
size_t i;
if (srks ==
((void *)0)
|| nsrks == 0)
return;
for (i = 0; i < nsrks; i++)
sshsk_free_resident_key(srks[i]);
free(srks);
}
| void sshsk_free_resident_keys(void* a0, unsigned long a1) {
void* v0;
unsigned long long v2;
if (!a0) {
return;
} else if (!a1) {
return;
} else {
for (v0 = 0; v0 < a1; v0 += 1) {
sshsk_free_resident_key(*((a0 + 0x8 * v0)));
}
v2 = free(a0);
return;
}
}
|
static int check_ext_attr(e2fsck_t ctx, struct problem_context *pctx,
char *block_buf, struct ea_quota *ea_block_quota)
{
ext2_filsys fs = ctx->fs;
ext2_ino_t ino = pctx->ino;
struct ext2_inode *inode = pctx->inode;
blk64_t blk;
char * end;
struct ext2_ext_attr_header *header;
struct ext2_ext_attr_entry *first, *entry;
blk64_t quota_blocks = ((1) << (fs)->cluster_ratio_bits);
__u64 quota_inodes = 0;
region_t region = 0;
int failed_csum = 0;
ea_block_quota->blocks = 0;
ea_block_quota->inodes = 0;
blk = ext2fs_file_acl_block(fs, inode);
if (blk == 0)
return 0;
if (!ext2fs_has_feature_xattr(fs->super) ||
(blk < fs->super->s_first_data_block) ||
(blk >= ext2fs_blocks_count(fs->super))) {
mark_inode_bad(ctx, ino);
return 0;
}
if (!ctx->block_ea_map) {
pctx->errcode = e2fsck_allocate_block_bitmap(fs,
(gettext ("ext attr block map")),
2, "block_ea_map",
&ctx->block_ea_map);
if (pctx->errcode) {
pctx->num = 2;
fix_problem(ctx, 0x010025, pctx);
ctx->flags |= 0x0001;
return 0;
}
}
if (!ctx->refcount) {
pctx->errcode = ea_refcount_create(0, &ctx->refcount);
if (pctx->errcode) {
pctx->num = 1;
fix_problem(ctx, 0x010038, pctx);
ctx->flags |= 0x0001;
return 0;
}
}
if (ext2fs_fast_test_block_bitmap2(ctx->block_ea_map, blk)) {
ea_block_quota->blocks = ((1) << (fs)->cluster_ratio_bits);
ea_block_quota->inodes = 0;
if (ctx->ea_block_quota_blocks) {
ea_refcount_fetch(ctx->ea_block_quota_blocks, blk,
"a_blocks);
if (quota_blocks)
ea_block_quota->blocks = quota_blocks;
}
if (ctx->ea_block_quota_inodes)
ea_refcount_fetch(ctx->ea_block_quota_inodes, blk,
&ea_block_quota->inodes);
if (ea_refcount_decrement(ctx->refcount, blk, 0) == 0)
return 1;
if (!ctx->refcount_extra) {
pctx->errcode = ea_refcount_create(0,
&ctx->refcount_extra);
if (pctx->errcode) {
pctx->num = 2;
fix_problem(ctx, 0x010038, pctx);
ctx->flags |= 0x0001;
return 0;
}
}
ea_refcount_increment(ctx->refcount_extra, blk, 0);
return 1;
}
pctx->blk = blk;
pctx->errcode = ext2fs_read_ext_attr3(fs, blk, block_buf, pctx->ino);
if (pctx->errcode == (2133571479L)) {
pctx->errcode = 0;
failed_csum = 1;
} else if (pctx->errcode == (2133571489L))
pctx->errcode = 0;
if (pctx->errcode &&
fix_problem(ctx, 0x010039, pctx)) {
pctx->errcode = 0;
goto clear_extattr;
}
header = (struct ext2_ext_attr_header *) block_buf;
pctx->blk = ext2fs_file_acl_block(fs, inode);
if (((ctx->ext_attr_ver == 1) &&
(header->h_magic != 0xEA010000)) ||
((ctx->ext_attr_ver == 2) &&
(header->h_magic != 0xEA020000))) {
if (fix_problem(ctx, 0x01003A, pctx))
goto clear_extattr;
}
if (header->h_blocks != 1) {
if (fix_problem(ctx, 0x01003E, pctx))
goto clear_extattr;
}
if (pctx->errcode && fix_problem(ctx, 0x010039, pctx))
goto clear_extattr;
region = region_create(0, fs->blocksize);
if (!region) {
fix_problem(ctx, 0x01003F, pctx);
ctx->flags |= 0x0001;
return 0;
}
if (region_allocate(region, 0, sizeof(struct ext2_ext_attr_header))) {
if (fix_problem(ctx, 0x010040, pctx))
goto clear_extattr;
}
first = (struct ext2_ext_attr_entry *)(header+1);
end = block_buf + fs->blocksize;
entry = first;
while ((char *)entry < end && *(__u32 *)entry) {
__u32 hash;
if (region_allocate(region, (char *)entry - (char *)header,
(((entry->e_name_len) + (((unsigned) 1<<2)-1) + sizeof(struct ext2_ext_attr_entry)) & ~(((unsigned) 1<<2)-1)))) {
if (fix_problem(ctx, 0x010040, pctx))
goto clear_extattr;
break;
}
if ((ctx->ext_attr_ver == 1 &&
(entry->e_name_len == 0 || entry->e_name_index != 0)) ||
(ctx->ext_attr_ver == 2 &&
entry->e_name_index == 0)) {
if (fix_problem(ctx, 0x010041, pctx))
goto clear_extattr;
break;
}
if (entry->e_value_inum == 0) {
if (entry->e_value_offs + entry->e_value_size >
fs->blocksize) {
if (fix_problem(ctx, 0x010042, pctx))
goto clear_extattr;
break;
}
if (entry->e_value_size &&
region_allocate(region, entry->e_value_offs,
(((entry->e_value_size) + (((unsigned) 1<<2)-1)) & ~(((unsigned) 1<<2)-1)))) {
if (fix_problem(ctx, 0x010040,
pctx))
goto clear_extattr;
}
hash = ext2fs_ext_attr_hash_entry(entry, block_buf +
entry->e_value_offs);
if (entry->e_hash != hash) {
pctx->num = entry->e_hash;
if (fix_problem(ctx, 0x010054, pctx))
goto clear_extattr;
entry->e_hash = hash;
}
} else {
problem_t problem;
blk64_t entry_quota_blocks;
problem = check_large_ea_inode(ctx, entry, pctx,
&entry_quota_blocks);
if (problem && fix_problem(ctx, problem, pctx))
goto clear_extattr;
quota_blocks += entry_quota_blocks;
quota_inodes++;
}
entry = ( (struct ext2_ext_attr_entry *)( (char *)(entry) + ((((entry)->e_name_len) + (((unsigned) 1<<2)-1) + sizeof(struct ext2_ext_attr_entry)) & ~(((unsigned) 1<<2)-1))) );
}
if (region_allocate(region, (char *)entry - (char *)header, 4)) {
if (fix_problem(ctx, 0x010040, pctx))
goto clear_extattr;
}
region_free(region);
if (failed_csum &&
fix_problem(ctx, 0x01006C, pctx)) {
pctx->errcode = ext2fs_write_ext_attr3(fs, blk, block_buf,
pctx->ino);
if (pctx->errcode)
return 0;
}
if (quota_blocks != ((1U) << (fs)->cluster_ratio_bits)) {
if (!ctx->ea_block_quota_blocks) {
pctx->errcode = ea_refcount_create(0,
&ctx->ea_block_quota_blocks);
if (pctx->errcode) {
pctx->num = 3;
goto refcount_fail;
}
}
ea_refcount_store(ctx->ea_block_quota_blocks, blk,
quota_blocks);
}
if (quota_inodes) {
if (!ctx->ea_block_quota_inodes) {
pctx->errcode = ea_refcount_create(0,
&ctx->ea_block_quota_inodes);
if (pctx->errcode) {
pctx->num = 4;
refcount_fail:
fix_problem(ctx, 0x010038, pctx);
ctx->flags |= 0x0001;
return 0;
}
}
ea_refcount_store(ctx->ea_block_quota_inodes, blk,
quota_inodes);
}
ea_block_quota->blocks = quota_blocks;
ea_block_quota->inodes = quota_inodes;
inc_ea_inode_refs(ctx, pctx, first, end);
ea_refcount_store(ctx->refcount, blk, header->h_refcount - 1);
mark_block_used(ctx, blk);
ext2fs_fast_mark_block_bitmap2(ctx->block_ea_map, blk);
return 1;
clear_extattr:
if (region)
region_free(region);
ext2fs_file_acl_block_set(fs, inode, 0);
e2fsck_write_inode(ctx, ino, inode, "check_ext_attr");
return 0;
}
| undefined8 check_ext_attr(long *param_1,long *param_2,int *param_3,ulong *param_4)
{
undefined4 uVar1;
bool bVar2;
int iVar3;
int iVar4;
undefined8 uVar5;
ulong uVar6;
long lVar7;
long in_FS_OFFSET;
ulong local_78;
long local_70;
int *local_68;
ulong local_60;
long local_58;
long local_50;
long local_48;
ulong local_40;
int *local_38;
int *local_30;
int *local_28;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
local_50 = *param_1;
uVar1 = *(undefined4 *)(param_2 + 1);
local_48 = param_2[3];
local_78 = (ulong)(1 << ((byte)*(undefined4 *)(local_50 + 0xc0) & 0x1f));
local_60 = 0;
local_58 = 0;
bVar2 = false;
*param_4 = 0;
param_4[1] = 0;
local_40 = ext2fs_file_acl_block(local_50,local_48);
if (local_40 == 0) {
uVar5 = 0;
goto LAB_0010740e;
}
iVar3 = ext2fs_has_feature_xattr(*(undefined8 *)(local_50 + 0x20));
if (((iVar3 == 0) || (local_40 < *(uint *)(*(long *)(local_50 + 0x20) + 0x14))) ||
(uVar6 = ext2fs_blocks_count(*(undefined8 *)(local_50 + 0x20)), uVar6 <= local_40)) {
mark_inode_bad(param_1,uVar1);
uVar5 = 0;
goto LAB_0010740e;
}
if (param_1[0x36] == 0) {
uVar5 = gettext("ext attr block map");
lVar7 = e2fsck_allocate_block_bitmap(local_50,uVar5,2,"block_ea_map",param_1 + 0x36);
*param_2 = lVar7;
if (*param_2 != 0) {
param_2[10] = 2;
fix_problem(param_1,0x10025,param_2);
*(uint *)(param_1 + 9) = *(uint *)(param_1 + 9) | 1;
uVar5 = 0;
goto LAB_0010740e;
}
}
if (param_1[0x39] == 0) {
lVar7 = ea_refcount_create(0,param_1 + 0x39);
*param_2 = lVar7;
if (*param_2 != 0) {
param_2[10] = 1;
fix_problem(param_1,0x10038,param_2);
*(uint *)(param_1 + 9) = *(uint *)(param_1 + 9) | 1;
uVar5 = 0;
goto LAB_0010740e;
}
}
iVar3 = ext2fs_fast_test_block_bitmap2(param_1[0x36],local_40);
if (iVar3 != 0) {
*param_4 = (long)(1 << ((byte)*(undefined4 *)(local_50 + 0xc0) & 0x1f));
param_4[1] = 0;
if ((param_1[0x3b] != 0) && (ea_refcount_fetch(param_1[0x3b],local_40,&local_78), local_78 != 0)
) {
*param_4 = local_78;
}
if (param_1[0x3c] != 0) {
ea_refcount_fetch(param_1[0x3c],local_40,param_4 + 1);
}
lVar7 = ea_refcount_decrement(param_1[0x39],local_40,0);
if (lVar7 == 0) {
uVar5 = 1;
}
else {
if (param_1[0x3a] == 0) {
lVar7 = ea_refcount_create(0,param_1 + 0x3a);
*param_2 = lVar7;
if (*param_2 != 0) {
param_2[10] = 2;
fix_problem(param_1,0x10038,param_2);
*(uint *)(param_1 + 9) = *(uint *)(param_1 + 9) | 1;
uVar5 = 0;
goto LAB_0010740e;
}
}
ea_refcount_increment(param_1[0x3a],local_40,0);
uVar5 = 1;
}
goto LAB_0010740e;
}
param_2[5] = local_40;
lVar7 = ext2fs_read_ext_attr3(local_50,local_40,param_3,*(undefined4 *)(param_2 + 1));
*param_2 = lVar7;
if (*param_2 == 0x7f2bb797) {
*param_2 = 0;
bVar2 = true;
}
else if (*param_2 == 0x7f2bb7a1) {
*param_2 = 0;
}
if ((*param_2 == 0) || (iVar3 = fix_problem(param_1,0x10039,param_2), iVar3 == 0)) {
local_38 = param_3;
lVar7 = ext2fs_file_acl_block(local_50,local_48);
param_2[5] = lVar7;
if (((((*(int *)(param_1 + 0x6b) != 1) || (*local_38 == -0x15ff0000)) &&
((*(int *)(param_1 + 0x6b) != 2 || (*local_38 == -0x15fe0000)))) ||
(iVar3 = fix_problem(param_1,0x1003a,param_2), iVar3 == 0)) &&
(((local_38[2] == 1 || (iVar3 = fix_problem(param_1,0x1003e,param_2), iVar3 == 0)) &&
((*param_2 == 0 || (iVar3 = fix_problem(param_1,0x10039,param_2), iVar3 == 0)))))) {
local_58 = region_create(0,*(undefined4 *)(local_50 + 0x28));
if (local_58 == 0) {
fix_problem(param_1,0x1003f,param_2);
*(uint *)(param_1 + 9) = *(uint *)(param_1 + 9) | 1;
uVar5 = 0;
goto LAB_0010740e;
}
iVar3 = region_allocate(local_58,0,0x20);
if ((iVar3 == 0) || (iVar3 = fix_problem(param_1,0x10040,param_2), iVar3 == 0)) {
local_68 = local_38 + 8;
local_28 = (int *)((long)param_3 + (ulong)*(uint *)(local_50 + 0x28));
local_30 = local_68;
while( true ) {
if ((local_28 <= local_68) || (*local_68 == 0)) goto LAB_001070f4;
iVar3 = region_allocate(local_58,(long)local_68 - (long)local_38,
*(byte *)local_68 + 0x13 & 0xfffffffc);
if (iVar3 != 0) break;
if (((*(int *)(param_1 + 0x6b) == 1) &&
((*(byte *)local_68 == 0 || (*(byte *)((long)local_68 + 1) != 0)))) ||
((*(int *)(param_1 + 0x6b) == 2 && (*(byte *)((long)local_68 + 1) == 0)))) {
iVar3 = fix_problem(param_1,0x10041,param_2);
goto joined_r0x00106f25;
}
if (local_68[1] == 0) {
if (*(uint *)(local_50 + 0x28) < (uint)*(ushort *)((long)local_68 + 2) + local_68[2]) {
iVar3 = fix_problem(param_1,0x10042,param_2);
goto joined_r0x00106f25;
}
if (((local_68[2] != 0) &&
(iVar3 = region_allocate(local_58,*(undefined2 *)((long)local_68 + 2),
local_68[2] + 3U & 0xfffffffc), iVar3 != 0)) &&
(iVar3 = fix_problem(param_1,0x10040,param_2), iVar3 != 0)) goto LAB_001073c1;
iVar3 = ext2fs_ext_attr_hash_entry
(local_68,(ulong)*(ushort *)((long)local_68 + 2) + (long)param_3);
if (iVar3 != local_68[3]) {
param_2[10] = (ulong)(uint)local_68[3];
iVar4 = fix_problem(param_1,0x10054,param_2);
if (iVar4 != 0) goto LAB_001073c1;
local_68[3] = iVar3;
}
}
else {
iVar3 = check_large_ea_inode(param_1,local_68,param_2,&local_70);
if ((iVar3 != 0) && (iVar3 = fix_problem(param_1,iVar3,param_2), iVar3 != 0))
goto LAB_001073c1;
local_78 = local_70 + local_78;
local_60 = local_60 + 1;
}
local_68 = (int *)((long)local_68 + (ulong)(*(byte *)local_68 + 0x13 & 0xfffffffc));
}
iVar3 = fix_problem(param_1,0x10040,param_2);
joined_r0x00106f25:
if (iVar3 != 0) goto LAB_001073c1;
LAB_001070f4:
iVar3 = region_allocate(local_58,(long)local_68 - (long)local_38,4);
if ((iVar3 == 0) || (iVar3 = fix_problem(param_1,0x10040,param_2), iVar3 == 0)) {
region_free(local_58);
if ((bVar2) && (iVar3 = fix_problem(param_1,0x1006c,param_2), iVar3 != 0)) {
lVar7 = ext2fs_write_ext_attr3(local_50,local_40,param_3);
*param_2 = lVar7;
if (*param_2 != 0) {
uVar5 = 0;
goto LAB_0010740e;
}
}
if ((uint)(1 << ((byte)*(undefined4 *)(local_50 + 0xc0) & 0x1f)) == local_78) {
LAB_0010724a:
if (local_60 != 0) {
if (param_1[0x3c] == 0) {
lVar7 = ea_refcount_create(0,param_1 + 0x3c);
*param_2 = lVar7;
if (*param_2 != 0) {
param_2[10] = 4;
goto LAB_001072ae;
}
}
ea_refcount_store(param_1[0x3c],local_40,local_60);
}
*param_4 = local_78;
param_4[1] = local_60;
inc_ea_inode_refs(param_1,param_2,local_30,local_28);
ea_refcount_store(param_1[0x39],local_40,local_38[1] + -1);
mark_block_used(param_1,local_40);
ext2fs_fast_mark_block_bitmap2(param_1[0x36],local_40);
uVar5 = 1;
}
else {
if (param_1[0x3b] != 0) {
LAB_00107229:
ea_refcount_store(param_1[0x3b],local_40,local_78);
goto LAB_0010724a;
}
lVar7 = ea_refcount_create(0,param_1 + 0x3b);
*param_2 = lVar7;
if (*param_2 == 0) goto LAB_00107229;
param_2[10] = 3;
LAB_001072ae:
fix_problem(param_1,0x10038,param_2);
*(uint *)(param_1 + 9) = *(uint *)(param_1 + 9) | 1;
uVar5 = 0;
}
goto LAB_0010740e;
}
}
}
}
else {
*param_2 = 0;
}
LAB_001073c1:
if (local_58 != 0) {
region_free(local_58);
}
ext2fs_file_acl_block_set(local_50,local_48,0);
e2fsck_write_inode(param_1,uVar1,local_48,"check_ext_attr");
uVar5 = 0;
LAB_0010740e:
if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar5;
}
|
int
getlast_entry(struct logininfo *li)
{
return(lastlog_get_entry(li));
}
| void getlast_entry(undefined8 param_1)
{
lastlog_get_entry(param_1);
return;
}
|
static float
constrain_rate (float rate)
{
if (rate > 1.0f)
return 1.0;
else if (rate < 0.0)
return 0.0;
else
return rate;
}
| void constrain_rate() {
return;
}
|
int
ssh_set_verify_host_key_callback(struct ssh *ssh,
int (*cb)(struct sshkey *, struct ssh *))
{
if (cb ==
((void *)0)
|| ssh->kex ==
((void *)0)
)
return -10;
ssh->kex->verify_host_key = cb;
return 0;
}
| long long ssh_set_verify_host_key_callback(struct_0 *a0, unsigned long a1) {
unsigned long long v1;
if (a1 && a0->field_8) {
a0->field_8->field_a0 = a1;
v1 = 0;
}
if (!a1 || !a0->field_8)
v1 = 4294967286;
return v1;
}
|
int
rl_clear_screen (int count, int key)
{
if (rl_explicit_arg)
{
rl_refresh_line (count, key);
return 0;
}
_rl_clear_screen (0);
rl_keep_mark_active ();
rl_forced_update_display ();
rl_display_fixed = 1;
return 0;
}
| long long rl_clear_screen(unsigned long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
if (rl_explicit_arg) {
rl_refresh_line(a0, a1);
} else {
_rl_clear_screen(0x0);
rl_keep_mark_active();
rl_forced_update_display(0x0, a1, a2, a3, a4, a5);
rl_display_fixed = 1;
}
return 0;
}
|
static int
sig_match_principals(const char *allowed_keys, char *principal,
char * const *opts, size_t nopts)
{
int r;
char **principals =
((void *)0)
;
size_t i, nprincipals = 0;
if ((r = sig_process_opts(opts, nopts,
((void *)0)
,
((void *)0)
,
((void *)0)
)) != 0)
return r;
if ((r = sshsig_match_principals(allowed_keys, principal,
&principals, &nprincipals)) != 0) {
sshlog("ssh-keygen.c", __func__, 2922, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "match: %s", ssh_err(r));
fprintf(
stderr
, "No principal matched.\n");
return r;
}
for (i = 0; i < nprincipals; i++) {
printf("%s\n", principals[i]);
free(principals[i]);
}
free(principals);
return 0;
}
| int sig_match_principals
(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)
{
int iVar1;
undefined8 uVar2;
long in_FS_OFFSET;
void *local_28;
ulong local_20;
ulong local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_28 = (void *)0x0;
local_20 = 0;
iVar1 = sig_process_opts(param_3,param_4,0,0,0);
if (iVar1 == 0) {
iVar1 = sshsig_match_principals(param_1,param_2,&local_28,&local_20);
if (iVar1 == 0) {
for (local_18 = 0; local_18 < local_20; local_18 = local_18 + 1) {
printf("%s\n",*(undefined8 *)((long)local_28 + local_18 * 8));
free(*(void **)((long)local_28 + local_18 * 8));
}
free(local_28);
iVar1 = 0;
}
else {
uVar2 = ssh_err(iVar1);
sshlog("ssh-keygen.c","sig_match_principals",0xb6a,1,5,0,"match: %s",uVar2);
fprintf(stderr,"No principal matched.\n");
}
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return iVar1;
}
__stack_chk_fail();
}
|
static void nlnoprompt(void)
{
(parsefile->linno)++;
needprompt = doprompt;
}
| void nlnoprompt(void)
{
*(int *)(parsefile + 8) = *(int *)(parsefile + 8) + 1;
needprompt = doprompt;
return;
}
|
int
ssh_packet_write_poll(struct ssh *ssh)
{
struct session_state *state = ssh->state;
int len = sshbuf_len(state->output);
int r;
if (len > 0) {
len = write(state->connection_out,
sshbuf_ptr(state->output), len);
if (len == -1) {
if (
(*__errno_location ())
==
4
||
(*__errno_location ())
==
11
||
(*__errno_location ())
==
11
)
return 0;
return -24;
}
if (len == 0)
return -52;
if ((r = sshbuf_consume(state->output, len)) != 0)
return r;
}
return 0;
}
| int ssh_packet_write_poll(long *param_1)
{
long lVar1;
int iVar2;
void *__buf;
ssize_t sVar3;
int *piVar4;
lVar1 = *param_1;
iVar2 = sshbuf_len(*(undefined8 *)(lVar1 + 0x28));
if (0 < iVar2) {
__buf = (void *)sshbuf_ptr();
sVar3 = write(*(int *)(lVar1 + 4),__buf,(long)iVar2);
iVar2 = (int)sVar3;
if (iVar2 == -1) {
piVar4 = __errno_location();
if (((*piVar4 != 4) && (piVar4 = __errno_location(), *piVar4 != 0xb)) &&
(piVar4 = __errno_location(), *piVar4 != 0xb)) {
return -0x18;
}
return 0;
}
if (iVar2 == 0) {
return -0x34;
}
iVar2 = sshbuf_consume(*(undefined8 *)(lVar1 + 0x28),(long)iVar2);
if (iVar2 != 0) {
return iVar2;
}
}
return 0;
}
|
static void append_string(struct string *s, const char *a, int len)
{
int needlen;
if (!len)
len = strlen(a);
needlen = s->end + len + 1;
if (needlen > s->len) {
char *n;
if (s->len * 2 > needlen)
needlen = s->len * 2;
n = realloc(s->s, needlen);
if (n) {
s->s = n;
s->len = needlen;
} else {
return;
}
}
memcpy(s->s + s->end, a, len);
s->end += len;
s->s[s->end] = 0;
}
| void append_string(struct_0 *a0, void* a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
unsigned long v2;
unsigned long long v5;
v0 = a2;
if (!v0)
v0 = strlen(a1);
v1 = v0 + a0->field_c + 1;
if (v1 > a0->field_8) {
if (v1 < a0->field_8 << 1)
v1 = a0->field_8 * 2;
v2 = realloc(a0->field_0, v1);
if (!v2)
return;
a0->field_0 = v2;
a0->field_8 = v1;
}
memcpy(a0->field_0 + a0->field_c, a1, v0);
a0->field_c = a0->field_c + v0;
v5 = a0->field_c + a0->field_0;
*((a0->field_c + a0->field_0)) = 0;
return;
}
|
static int
history_expand_internal (char *string, int start, int qc, int *end_index_ptr, char **ret_string, char *current_line)
{
int i, n, starting_index;
int substitute_globally, subst_bywords, want_quotes, print_only;
char *event, *temp, *result, *tstr, *t, c, *word_spec;
int result_len;
mbstate_t ps;
memset (&ps, 0, sizeof (mbstate_t));
result = (char *)xmalloc (result_len = 128);
i = start;
if (((string[i + 1]) ? ((char *)strchr ((":$*%^"), (string[i + 1])) != (char *)
((void *)0)
) : 0))
{
char fake_s[3];
int fake_i = 0;
i++;
fake_s[0] = fake_s[1] = history_expansion_char;
fake_s[2] = '\0';
event = get_history_event (fake_s, &fake_i, 0);
}
else if (string[i + 1] == '#')
{
i += 2;
event = current_line;
}
else
event = get_history_event (string, &i, qc);
if (event == 0)
{
*ret_string = hist_error (string, start, i, 0);
xfree (result);
return (-1);
}
starting_index = i;
word_spec = get_history_word_specifier (string, event, &i);
if (word_spec == (char *)&error_pointer)
{
*ret_string = hist_error (string, starting_index, i, 1);
xfree (result);
return (-1);
}
temp = word_spec ? strcpy (xmalloc (1 + strlen (word_spec)), (word_spec)) : strcpy (xmalloc (1 + strlen (event)), (event));
if (word_spec) free (word_spec);
want_quotes = substitute_globally = subst_bywords = print_only = 0;
starting_index = i;
while (string[i] == ':')
{
c = string[i + 1];
if (c == 'g' || c == 'a')
{
substitute_globally = 1;
i++;
c = string[i + 1];
}
else if (c == 'G')
{
subst_bywords = 1;
i++;
c = string[i + 1];
}
switch (c)
{
default:
*ret_string = hist_error (string, i+1, i+2, 3);
xfree (result);
xfree (temp);
return -1;
case 'q':
want_quotes = 'q';
break;
case 'x':
want_quotes = 'x';
break;
case 'p':
print_only = 1;
break;
case 't':
tstr = strrchr (temp, '/');
if (tstr)
{
tstr++;
t = strcpy (xmalloc (1 + strlen (tstr)), (tstr));
xfree (temp);
temp = t;
}
break;
case 'h':
tstr = strrchr (temp, '/');
if (tstr)
*tstr = '\0';
break;
case 'r':
tstr = strrchr (temp, '.');
if (tstr)
*tstr = '\0';
break;
case 'e':
tstr = strrchr (temp, '.');
if (tstr)
{
t = strcpy (xmalloc (1 + strlen (tstr)), (tstr));
xfree (temp);
temp = t;
}
break;
case '&':
case 's':
{
char *new_event;
int delimiter, failed, si, l_temp, ws, we;
if (c == 's')
{
if (i + 2 < (int)strlen (string))
{
if (
(__ctype_get_mb_cur_max ())
> 1 && rl_byte_oriented == 0)
{
_rl_adjust_point (string, i + 2, &ps);
if (_rl_get_char_len (string + i + 2, &ps) > 1)
delimiter = 0;
else
delimiter = string[i + 2];
}
else
delimiter = string[i + 2];
}
else
break;
i += 3;
t = get_subst_pattern (string, &i, delimiter, 0, &subst_lhs_len);
if (t)
{
if (subst_lhs) free (subst_lhs);
subst_lhs = t;
}
else if (!subst_lhs)
{
if (search_string && *search_string)
{
subst_lhs = strcpy (xmalloc (1 + strlen (search_string)), (search_string));
subst_lhs_len = strlen (subst_lhs);
}
else
{
subst_lhs = (char *)
((void *)0)
;
subst_lhs_len = 0;
}
}
if (subst_rhs) free (subst_rhs);
subst_rhs = get_subst_pattern (string, &i, delimiter, 1, &subst_rhs_len);
if ((('&') ? ((char *)strchr ((subst_rhs), ('&')) != (char *)
((void *)0)
) : 0))
postproc_subst_rhs ();
}
else
i += 2;
if (subst_lhs_len == 0)
{
*ret_string = hist_error (string, starting_index, i, 4);
xfree (result);
xfree (temp);
return -1;
}
l_temp = strlen (temp);
if (subst_lhs_len > l_temp)
{
*ret_string = hist_error (string, starting_index, i, 2);
xfree (result);
xfree (temp);
return (-1);
}
si = we = 0;
for (failed = 1; (si + subst_lhs_len) <= l_temp; si++)
{
if (subst_bywords && si > we)
{
for (; temp[si] && ((((temp[si]) == ' ') || ((temp[si]) == '\t')) || (temp[si]) == '\n'); si++)
;
ws = si;
we = history_tokenize_word (temp, si);
}
if ((((subst_lhs_len) == 0) ? (1) : ((temp+si)[0] == (subst_lhs)[0]) && (strncmp ((temp+si), (subst_lhs), (subst_lhs_len)) == 0)))
{
int len = subst_rhs_len - subst_lhs_len + l_temp;
new_event = (char *)xmalloc (1 + len);
strncpy (new_event, temp, si);
strncpy (new_event + si, subst_rhs, subst_rhs_len);
strncpy (new_event + si + subst_rhs_len,
temp + si + subst_lhs_len,
l_temp - (si + subst_lhs_len));
new_event[len] = '\0';
xfree (temp);
temp = new_event;
failed = 0;
if (substitute_globally)
{
si += subst_rhs_len - 1;
l_temp = strlen (temp);
substitute_globally++;
continue;
}
else if (subst_bywords)
{
si = we;
l_temp = strlen (temp);
continue;
}
else
break;
}
}
if (substitute_globally > 1)
{
substitute_globally = 0;
continue;
}
if (failed == 0)
continue;
*ret_string = hist_error (string, starting_index, i, 2);
xfree (result);
xfree (temp);
return (-1);
}
}
i += 2;
}
--i;
if (want_quotes)
{
char *x;
if (want_quotes == 'q')
x = sh_single_quote (temp);
else if (want_quotes == 'x')
x = quote_breaks (temp);
else
x = strcpy (xmalloc (1 + strlen (temp)), (temp));
xfree (temp);
temp = x;
}
n = strlen (temp);
if (n >= result_len)
result = (char *)xrealloc (result, n + 2);
strcpy (result, temp);
xfree (temp);
*end_index_ptr = i;
*ret_string = result;
return (print_only);
}
| undefined4
history_expand_internal
(char *param_1,int param_2,undefined4 param_3,int *param_4,char **param_5,char *param_6)
{
int iVar1;
undefined4 uVar2;
char *pcVar3;
size_t sVar4;
char *__dest;
long in_FS_OFFSET;
char local_b1;
int local_b0;
undefined4 local_ac;
int local_a8;
int local_a4;
int local_a0;
undefined4 local_9c;
int local_98;
int local_94;
int local_90;
int local_8c;
int local_88;
int local_84;
int local_80;
int local_7c;
int local_78;
int local_74;
char *local_70;
char *local_68;
char *local_60;
char *local_58;
char *local_50;
char *local_48;
char *local_40;
char *local_38;
undefined local_2c [9];
undefined local_23;
undefined local_22;
undefined local_21;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
memset(local_2c,0,8);
local_84 = 0x80;
local_60 = (char *)xmalloc(0x80);
local_b0 = param_2;
if ((param_1[(long)param_2 + 1] == '\0') ||
(pcVar3 = strchr(":$*%^",(int)param_1[(long)param_2 + 1]), pcVar3 == (char *)0x0)) {
if (param_1[(long)local_b0 + 1] == '#') {
local_b0 = local_b0 + 2;
local_70 = param_6;
}
else {
local_70 = (char *)get_history_event(param_1,&local_b0,param_3);
}
}
else {
local_ac = 0;
local_b0 = local_b0 + 1;
local_23 = history_expansion_char;
local_21 = 0;
local_22 = local_23;
local_70 = (char *)get_history_event(&local_23,&local_ac,0);
}
if (local_70 == (char *)0x0) {
pcVar3 = (char *)hist_error(param_1,param_2,local_b0,0);
*param_5 = pcVar3;
xfree(local_60);
uVar2 = 0xffffffff;
}
else {
local_80 = local_b0;
local_50 = (char *)get_history_word_specifier(param_1,local_70,&local_b0);
if (local_50 == &error_pointer) {
pcVar3 = (char *)hist_error(param_1,local_80,local_b0,1);
*param_5 = pcVar3;
xfree(local_60);
uVar2 = 0xffffffff;
}
else {
if (local_50 == (char *)0x0) {
sVar4 = strlen(local_70);
pcVar3 = (char *)xmalloc(sVar4 + 1);
local_68 = strcpy(pcVar3,local_70);
}
else {
sVar4 = strlen(local_50);
pcVar3 = (char *)xmalloc(sVar4 + 1);
local_68 = strcpy(pcVar3,local_50);
}
if (local_50 != (char *)0x0) {
free(local_50);
}
local_9c = 0;
local_a4 = 0;
local_a8 = 0;
local_a0 = 0;
local_80 = local_b0;
LAB_00101824:
do {
while( true ) {
if (param_1[local_b0] != ':') {
local_b0 = local_b0 + -1;
if (local_a0 != 0) {
if (local_a0 == 0x71) {
local_58 = (char *)sh_single_quote(local_68);
}
else if (local_a0 == 0x78) {
local_58 = (char *)quote_breaks(local_68);
}
else {
sVar4 = strlen(local_68);
pcVar3 = (char *)xmalloc(sVar4 + 1);
local_58 = strcpy(pcVar3,local_68);
}
xfree(local_68);
local_68 = local_58;
}
sVar4 = strlen(local_68);
local_7c = (int)sVar4;
if (local_84 <= local_7c) {
local_60 = (char *)xrealloc(local_60,(long)(local_7c + 2));
}
strcpy(local_60,local_68);
xfree(local_68);
*param_4 = local_b0;
*param_5 = local_60;
uVar2 = local_9c;
goto LAB_00101947;
}
local_b1 = param_1[(long)local_b0 + 1];
if ((local_b1 == 'g') || (local_b1 == 'a')) {
local_a8 = 1;
local_b0 = local_b0 + 1;
local_b1 = param_1[(long)local_b0 + 1];
}
else if (local_b1 == 'G') {
local_a4 = 1;
local_b0 = local_b0 + 1;
local_b1 = param_1[(long)local_b0 + 1];
}
iVar1 = (int)local_b1;
if (iVar1 == 0x26) break;
if (((iVar1 < 0x26) || (0x78 < iVar1)) || (iVar1 < 0x65)) {
switchD_0010104e_caseD_66:
pcVar3 = (char *)hist_error(param_1,local_b0 + 1,local_b0 + 2,3);
*param_5 = pcVar3;
xfree(local_60);
xfree(local_68);
uVar2 = 0xffffffff;
goto LAB_00101947;
}
switch(iVar1) {
case 0x65:
local_48 = strrchr(local_68,0x2e);
if (local_48 != (char *)0x0) {
sVar4 = strlen(local_48);
pcVar3 = (char *)xmalloc(sVar4 + 1);
local_40 = strcpy(pcVar3,local_48);
xfree(local_68);
local_68 = local_40;
}
break;
default:
goto switchD_0010104e_caseD_66;
case 0x68:
local_48 = strrchr(local_68,0x2f);
if (local_48 != (char *)0x0) {
*local_48 = '\0';
}
break;
case 0x70:
local_9c = 1;
break;
case 0x71:
local_a0 = 0x71;
break;
case 0x72:
local_48 = strrchr(local_68,0x2e);
if (local_48 != (char *)0x0) {
*local_48 = '\0';
}
break;
case 0x73:
goto switchD_0010104e_caseD_73;
case 0x74:
local_48 = strrchr(local_68,0x2f);
if (local_48 != (char *)0x0) {
local_48 = local_48 + 1;
sVar4 = strlen(local_48);
pcVar3 = (char *)xmalloc(sVar4 + 1);
local_40 = strcpy(pcVar3,local_48);
xfree(local_68);
local_68 = local_40;
}
break;
case 0x78:
local_a0 = 0x78;
}
LAB_00101815:
local_b0 = local_b0 + 2;
}
switchD_0010104e_caseD_73:
if (local_b1 == 's') {
iVar1 = local_b0 + 2;
sVar4 = strlen(param_1);
if ((int)sVar4 <= iVar1) goto LAB_00101815;
sVar4 = __ctype_get_mb_cur_max();
if ((sVar4 < 2) || (rl_byte_oriented != 0)) {
local_98 = (int)param_1[(long)local_b0 + 2];
}
else {
_rl_adjust_point(param_1,local_b0 + 2,local_2c);
iVar1 = _rl_get_char_len(param_1 + (long)local_b0 + 2,local_2c);
if (iVar1 < 2) {
local_98 = (int)param_1[(long)local_b0 + 2];
}
else {
local_98 = 0;
}
}
local_b0 = local_b0 + 3;
local_40 = (char *)get_subst_pattern(param_1,&local_b0,local_98,0,&subst_lhs_len);
pcVar3 = search_string;
if (local_40 == (char *)0x0) {
if (subst_lhs == (char *)0x0) {
if ((search_string == (char *)0x0) || (*search_string == '\0')) {
subst_lhs = (char *)0x0;
subst_lhs_len = 0;
}
else {
sVar4 = strlen(search_string);
__dest = (char *)xmalloc(sVar4 + 1);
subst_lhs = strcpy(__dest,pcVar3);
sVar4 = strlen(subst_lhs);
subst_lhs_len = (int)sVar4;
}
}
}
else {
if (subst_lhs != (char *)0x0) {
free(subst_lhs);
}
subst_lhs = local_40;
}
if (subst_rhs != (char *)0x0) {
free(subst_rhs);
}
subst_rhs = (char *)get_subst_pattern(param_1,&local_b0,local_98,1,&subst_rhs_len);
pcVar3 = strchr(subst_rhs,0x26);
if (pcVar3 != (char *)0x0) {
postproc_subst_rhs();
}
}
else {
local_b0 = local_b0 + 2;
}
if (subst_lhs_len == 0) {
pcVar3 = (char *)hist_error(param_1,local_80,local_b0,4);
*param_5 = pcVar3;
xfree(local_60);
xfree(local_68);
uVar2 = 0xffffffff;
goto LAB_00101947;
}
sVar4 = strlen(local_68);
local_8c = (int)sVar4;
if (local_8c < subst_lhs_len) {
pcVar3 = (char *)hist_error(param_1,local_80,local_b0,2);
*param_5 = pcVar3;
xfree(local_60);
xfree(local_68);
uVar2 = 0xffffffff;
goto LAB_00101947;
}
local_88 = 0;
local_94 = 1;
for (local_90 = 0; local_90 + subst_lhs_len <= local_8c; local_90 = local_90 + 1) {
if ((local_a4 != 0) && (local_88 < local_90)) {
for (; (local_68[local_90] != '\0' &&
(((local_68[local_90] == ' ' || (local_68[local_90] == '\t')) ||
(local_68[local_90] == '\n')))); local_90 = local_90 + 1) {
}
local_78 = local_90;
local_88 = history_tokenize_word(local_68);
}
if ((subst_lhs_len == 0) ||
((local_68[local_90] == *subst_lhs &&
(iVar1 = strncmp(local_68 + local_90,subst_lhs,(long)subst_lhs_len), iVar1 == 0)))) {
local_74 = local_8c + (subst_rhs_len - subst_lhs_len);
local_38 = (char *)xmalloc((long)(local_74 + 1));
strncpy(local_38,local_68,(long)local_90);
strncpy(local_38 + local_90,subst_rhs,(long)subst_rhs_len);
strncpy(local_38 + (long)local_90 + (long)subst_rhs_len,
local_68 + (long)local_90 + (long)subst_lhs_len,
(long)(local_8c - (subst_lhs_len + local_90)));
local_38[local_74] = '\0';
xfree(local_68);
local_68 = local_38;
local_94 = 0;
if (local_a8 == 0) {
if (local_a4 == 0) break;
local_90 = local_88;
sVar4 = strlen(local_38);
local_8c = (int)sVar4;
}
else {
local_90 = local_90 + subst_rhs_len + -1;
sVar4 = strlen(local_38);
local_8c = (int)sVar4;
local_a8 = local_a8 + 1;
}
}
}
if (1 < local_a8) {
local_a8 = 0;
goto LAB_00101824;
}
} while (local_94 == 0);
pcVar3 = (char *)hist_error(param_1,local_80,local_b0,2);
*param_5 = pcVar3;
xfree(local_60);
xfree(local_68);
uVar2 = 0xffffffff;
}
}
LAB_00101947:
if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar2;
}
|
static int
pkcs11_ecdsa_start_wrapper(void)
{
int (*orig_sign)(int, const unsigned char *, int, unsigned char *,
unsigned int *, const BIGNUM *, const BIGNUM *, EC_KEY *) =
((void *)0)
;
if (ec_key_method !=
((void *)0)
)
return (0);
ec_key_idx =
CRYPTO_get_ex_new_index(8,
0
,
"ssh-pkcs11-ecdsa"
, ((void *)0), ((void *)0),
pkcs11_k11_free
)
;
if (ec_key_idx == -1)
return (-1);
ec_key_method = EC_KEY_METHOD_new(EC_KEY_OpenSSL());
if (ec_key_method ==
((void *)0)
)
return (-1);
EC_KEY_METHOD_get_sign(ec_key_method, &orig_sign,
((void *)0)
,
((void *)0)
);
EC_KEY_METHOD_set_sign(ec_key_method, orig_sign,
((void *)0)
, ecdsa_do_sign);
return (0);
}
| int pkcs11_ecdsa_start_wrapper() {
void* v0;
unsigned int v2;
v0 = 0;
if (ec_key_method) {
v2 = 0;
} else {
ec_key_idx = CRYPTO_get_ex_new_index(0x8, 0x0, "ssh-pkcs11-ecdsa", 0x0, 0x0, pkcs11_k11_free);
if (ec_key_idx == -1) {
v2 = -1;
} else {
ec_key_method = EC_KEY_METHOD_new(EC_KEY_OpenSSL());
if (!ec_key_method) {
v2 = -1;
} else {
EC_KEY_METHOD_get_sign(ec_key_method, &v0, 0x0, 0x0);
EC_KEY_METHOD_set_sign(ec_key_method, v0, 0x0, ecdsa_do_sign);
v2 = 0;
}
}
}
return v2;
}
|
static inline __u32 rta_getattr_u32(const struct rtattr *rta)
{
return *(__u32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| int rta_getattr_u32(struct_0 *a0) {
return a0->field_4;
}
|
static int
_rl_subseq_result (int r, Keymap map, int key, int got_subseq)
{
Keymap m;
int type, nt;
rl_command_func_t *func, *nf;
if (r == -2)
{
m = _rl_dispatching_keymap;
type = m[257 -1].type;
func = m[257 -1].function;
if (type == 0 && func == rl_do_lowercase_version)
r = _rl_dispatch (((1 && (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)(unsigned char)key
))] & (unsigned short int) _ISupper)
)) ? tolower((unsigned char)((unsigned char)key)) : ((unsigned char)key)), map);
else if (type == 0)
{
nt = m[key].type;
nf = m[key].function;
m[key].type = type;
m[key].function = func;
_rl_dispatching_keymap = map;
r = _rl_dispatch_subseq (key, m, 0);
m[key].type = nt;
m[key].function = nf;
}
else
r = _rl_dispatch (257 -1, m);
}
else if (r < 0 && map[257 -1].function)
{
if ((rl_readline_state & (0x0000800)))
_rl_prev_macro_key ();
else
_rl_unget_char (key);
if (rl_key_sequence_length > 0)
rl_executing_keyseq[--rl_key_sequence_length] = '\0';
_rl_dispatching_keymap = map;
return -2;
}
else if (r < 0 && got_subseq)
{
if ((rl_readline_state & (0x0000800)))
_rl_prev_macro_key ();
else
_rl_unget_char (key);
if (rl_key_sequence_length > 0)
rl_executing_keyseq[--rl_key_sequence_length] = '\0';
_rl_dispatching_keymap = map;
return -1;
}
return r;
}
| int _rl_subseq_result(int param_1,long param_2,uint param_3,int param_4)
{
undefined uVar1;
long lVar2;
undefined8 uVar3;
long lVar4;
ushort **ppuVar5;
lVar4 = _rl_dispatching_keymap;
if (param_1 == -2) {
lVar2 = *(long *)(_rl_dispatching_keymap + 0x1008);
if ((*(char *)(_rl_dispatching_keymap + 0x1000) == '\0') && (lVar2 == lRam0000000000101545)) {
ppuVar5 = __ctype_b_loc();
if (((*ppuVar5)[param_3 & 0xff] & 0x100) == 0) {
param_3 = param_3 & 0xff;
}
else {
param_3 = tolower(param_3 & 0xff);
}
param_1 = _rl_dispatch(param_3,param_2);
}
else if (*(char *)(_rl_dispatching_keymap + 0x1000) == '\0') {
uVar1 = *(undefined *)(_rl_dispatching_keymap + (long)(int)param_3 * 0x10);
uVar3 = *(undefined8 *)(_rl_dispatching_keymap + (long)(int)param_3 * 0x10 + 8);
*(undefined *)(_rl_dispatching_keymap + (long)(int)param_3 * 0x10) = 0;
*(long *)((long)(int)param_3 * 0x10 + _rl_dispatching_keymap + 8) = lVar2;
_rl_dispatching_keymap = param_2;
param_1 = _rl_dispatch_subseq(param_3,lVar4,0);
*(undefined *)(lVar4 + (long)(int)param_3 * 0x10) = uVar1;
*(undefined8 *)((long)(int)param_3 * 0x10 + lVar4 + 8) = uVar3;
}
else {
param_1 = _rl_dispatch(0x100,_rl_dispatching_keymap);
}
}
else if ((param_1 < 0) && (*(long *)(param_2 + 0x1008) != 0)) {
if ((rl_readline_state & 0x800) == 0) {
_rl_unget_char(param_3);
}
else {
_rl_prev_macro_key();
}
if (0 < rl_key_sequence_length) {
rl_key_sequence_length = rl_key_sequence_length + -1;
*(undefined *)(rl_key_sequence_length + rl_executing_keyseq) = 0;
}
param_1 = -2;
_rl_dispatching_keymap = param_2;
}
else if ((param_1 < 0) && (param_4 != 0)) {
if ((rl_readline_state & 0x800) == 0) {
_rl_unget_char(param_3);
}
else {
_rl_prev_macro_key();
}
if (0 < rl_key_sequence_length) {
rl_key_sequence_length = rl_key_sequence_length + -1;
*(undefined *)(rl_key_sequence_length + rl_executing_keyseq) = 0;
}
param_1 = -1;
_rl_dispatching_keymap = param_2;
}
return param_1;
}
|
static struct diff3_block *
using_to_diff3_block (struct diff_block *using[2],
struct diff_block *last_using[2],
int low_thread, int high_thread,
struct diff3_block const *last_diff3)
{
lin low[2], high[2];
struct diff3_block *result;
struct diff_block *ptr;
int d;
lin i;
lin lowc = ((using[low_thread])->ranges[1][0]);
lin highc = ((last_using[high_thread])->ranges[1][1]);
for (d = 0; d < 2; d++)
if (using[d])
{
low[d] = ((lowc) - (((using[d]))->ranges[(1)][0]) + (((using[d]))->ranges[(0)][0]));
high[d] = ((highc) - (((last_using[d]))->ranges[(1)][1]) + (((last_using[d]))->ranges[(0)][1]));
}
else
{
low[d] = ((lowc) - (((last_diff3))->ranges[(2)][1]) + (((last_diff3))->ranges[(0 + d)][1]));
high[d] = ((highc) - (((last_diff3))->ranges[(2)][1]) + (((last_diff3))->ranges[(0 + d)][1]));
}
result = create_diff3_block (low[0], high[0], low[1], high[1], lowc, highc);
for (d = 0; d < 2; d++)
for (ptr = using[d]; ptr; ptr = ((ptr)->next))
{
lin result_offset = ((ptr)->ranges[1][0]) - lowc;
if (!copy_stringlist (((ptr)->lines[1]),
((ptr)->lengths[1]),
((result)->lines[2]) + result_offset,
((result)->lengths[2]) + result_offset,
(((ptr)->ranges[1][1]) - ((ptr)->ranges[1][0]) + 1)))
return 0;
}
for (d = 0; d < 2; d++)
{
struct diff_block *u = using[d];
lin lo = low[d], hi = high[d];
for (i = 0;
i + lo < (u ? ((u)->ranges[0][0]) : hi + 1);
i++)
{
((result)->lines[0 + d][i]) = ((result)->lines[2][i]);
((result)->lengths[0 + d][i]) = ((result)->lengths[2][i]);
}
for (ptr = u; ptr; ptr = ((ptr)->next))
{
lin result_offset = ((ptr)->ranges[0][0]) - lo;
lin linec;
if (!copy_stringlist (((ptr)->lines[0]),
((ptr)->lengths[0]),
((result)->lines[0 + d]) + result_offset,
((result)->lengths[0 + d]) + result_offset,
(((ptr)->ranges[0][1]) - ((ptr)->ranges[0][0]) + 1)))
return 0;
linec = ((ptr)->ranges[1][1]) + 1 - lowc;
for (i = ((ptr)->ranges[0][1]) + 1 - lo;
i < (((ptr)->next) ? ((((ptr)->next))->ranges[0][0]) : hi + 1) - lo;
i++)
{
((result)->lines[0 + d][i]) = ((result)->lines[2][linec]);
((result)->lengths[0 + d][i]) = ((result)->lengths[2][linec]);
linec++;
}
}
}
if (!using[0])
((result)->correspond) = DIFF_2ND;
else if (!using[1])
((result)->correspond) = DIFF_1ST;
else
{
lin nl0 = (((result)->ranges[0][1]) - ((result)->ranges[0][0]) + 1);
lin nl1 = (((result)->ranges[1][1]) - ((result)->ranges[1][0]) + 1);
if (nl0 != nl1
|| !compare_line_list (((result)->lines[0]),
((result)->lengths[0]),
((result)->lines[1]),
((result)->lengths[1]),
nl0))
((result)->correspond) = DIFF_ALL;
else
((result)->correspond) = DIFF_3RD;
}
return result;
}
| int using_to_diff3_block(struct_2 *a0, unsigned long long *a1[4], unsigned long a2, unsigned long a3, struct_5 *a4) {
unsigned int v0;
struct_7 *v1;
unsigned long long *v2;
unsigned long long *v3;
unsigned long long v4;
unsigned long long v5;
struct_6 *v6;
unsigned long long v7;
unsigned long v8;
unsigned long long v9[9];
unsigned long v10;
unsigned long v11;
unsigned long v12;
unsigned long v13;
char v14;
char v15;
char v16;
char v17;
unsigned int v19;
v4 = (&a0->field_0)[a2]->field_10;
v5 = a1[a3 + 3];
for (v0 = 0; v0 <= 1; v0 += 1) {
if (!(&a0->field_0)[v0]) {
*(&(&v14)[8 * v0]) = v4 - a4->field_30 + *(&a4->padding_0[16 + 16 * v0]);
*(&(&v16)[8 * v0]) = v5 - a4->field_30 + *(&a4->padding_0[16 + 16 * v0]);
} else {
*(&(&v14)[8 * v0]) = v4 - (&a0->field_0)[v0]->field_10 + (&a0->field_0)[v0]->field_0;
*(&(&v16)[8 * v0]) = v5 - a1[v0 + 3] + a1[v0 + 1];
}
}
v6 = create_diff3_block(*(&v14), *(&v16), *(&v15), *(&v17), v4, v5);
for (v0 = 0; v0 <= 1; v0 += 1) {
for (v1[0] = (&a0->field_0)[v0]; v1; v1[0] = v1[8]) {
v13 = v1[2] - v4;
v19 = (copy_stringlist(v1[5], v1[7], v13 * 8 + v6->field_48, v6->field_60 + v13 * 8, v1[3] - v1[2] + 1) ^ 1);
if (v19) {
v19 = 0;
return v19;
}
}
}
for (v0 = 0; v0 <= 1; v0 += 1) {
v9[0] = (&a0->field_0)[v0];
v10 = *(&(&v14)[8 * v0]);
v11 = *(&(&v16)[8 * v0]);
v2 = 0;
while (true) {
v19 = (!v9 ? v9[0] : v11 + 1);
if (v19 <= v2 + v10)
break;
*((v2 * 8 + (&v6->field_38)[v0])) = *((v6->field_48 + v2 * 8));
*((v2 * 8 + (&v6->field_50)[v0])) = *((v6->field_60 + v2 * 8));
v2 += 1;
}
for (v1 = &v9[0]; v1; v1 = &v1->field_40->field_0) {
v12 = v1->field_0 - v10;
*(&v19) = copy_stringlist(v1->field_20, v1->field_30, v12 * 8 + (&v6->field_38)[v0], (&v6->field_50)[v0] + v12 * 8, v1->field_8 - v1->field_0 + 1) ^ 1;
if (v19) {
v19 = 0;
return v19;
}
v3 = v1->field_18 + 1 - v4;
v2 = v1->field_8 + 1 - v10;
while (true) {
v19 = (!v1->field_40 ? v1->field_40->field_0 : v11 + 1) - v10;
if (v2 >= v19)
break;
*((v2 * 8 + (&v6->field_38)[v0])) = *((v6->field_48 + v3 * 8));
*((v2 * 8 + (&v6->field_50)[v0])) = *((v6->field_60 + v3 * 8));
v3 = v3 + 1;
v2 = &v2[1];
}
}
}
if (!a0->field_0) {
*(&v6->field_0) = 6;
} else if (!a0->field_8) {
*(&v6->field_0) = 5;
} else {
v7 = v6->field_10 - v6->field_8 + 1;
v8 = v6->field_20 - v6->field_18 + 1;
if (v7 != v8 || (*(&v19) = (compare_line_list(v6->field_38, v6->field_50, v6->field_40, v6->field_58, v7) ^ 1), v19))
*(&v6->field_0) = 4;
else
*(&v6->field_0) = 7;
}
v19 = v6;
return v19;
}
|
static int count_tags(journal_t *journal, struct buffer_head *bh)
{
char * tagp;
journal_block_tag_t tag;
int nr = 0, size = journal->j_blocksize;
int tag_bytes = journal_tag_bytes(journal);
if (jbd2_journal_has_csum_v2or3(journal))
size -= sizeof(struct jbd2_journal_block_tail);
tagp = &bh->b_data[sizeof(journal_header_t)];
while ((tagp - bh->b_data + tag_bytes) <= size) {
memcpy(&tag, tagp, sizeof(tag));
nr++;
tagp += tag_bytes;
if (!(tag.t_flags & (( __be16)ext2fs_swab16((__u16)(2)))))
tagp += 16;
if (tag.t_flags & (( __be16)ext2fs_swab16((__u16)(8))))
break;
}
return nr;
}
| int count_tags(struct_0 *a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned long v3;
char v4;
char v5;
unsigned long long v7;
v0 = 0;
v1 = a0->field_78;
v2 = journal_tag_bytes(a0);
v7 = jbd2_journal_has_csum_v2or3(a0);
if (v7)
v1 -= 4;
v3 = a1 + 52;
while (v3 - (a1 + 40) + v2 <= v1) {
memcpy(&v4, v3, 0xc);
v0 += 1;
v3 += v2;
*(&v7) = ext2fs_swab16(0x2) & *(&v5);
if (!v7)
v3 += 16;
*(&v7) = ext2fs_swab16(0x8) & *(&v5);
if (v7)
break;
}
return v0;
}
|
static size_t
src_to_dest_hash (void const *x, size_t table_size)
{
struct Src_to_dest const *p = x;
return (uintmax_t) p->st_ino % table_size;
}
| unsigned long src_to_dest_hash(_QWORD *a1, unsigned long a2)
{
return *a1 % a2;
}
|
static void
cpl_flush ()
{
struct cpelement *cpe, *p;
for (cpe = coproc_list.head; cpe; )
{
p = cpe;
cpe = cpe->next;
coproc_dispose (p->coproc);
cpe_dispose (p);
}
coproc_list.head = coproc_list.tail = 0;
coproc_list.ncoproc = 0;
}
| long cpl_flush()
{
long result;
_QWORD *v1;
long v2;
v1 = (_QWORD *)coproc_list;
while ( v1 )
{
v2 = (long)v1;
v1 = (_QWORD *)*v1;
coproc_dispose(*(_QWORD **)(v2 + 8));
cpe_dispose(v2);
}
*(&coproc_list + 1) = 0LL;
result = *(&coproc_list + 1);
coproc_list = result;
*((_DWORD *)&coproc_list + 4) = 0;
return result;
}
|
static void verify_provable_privkey(common_info_st * cinfo)
{
gnutls_privkey_t pkey;
int ret;
pkey = load_private_key(1, cinfo);
if (cinfo->seed_size > 0) {
ret = gnutls_privkey_verify_seed(pkey, 0, cinfo->seed, cinfo->seed_size);
} else {
ret = gnutls_privkey_verify_seed(pkey, 0,
((void *)0)
, 0);
}
if (ret < 0) {
if (ret == -1250)
fprintf(
stderr
, "The private key type cannot be associated with validated parameters\n");
else
fprintf(
stderr
, "Error verifying private key: %s\n", gnutls_strerror(ret));
app_exit(1);
}
printf("Key was verified\n");
gnutls_privkey_deinit(pkey);
return;
}
| void verify_provable_privkey(long param_1)
{
undefined8 uVar1;
int local_14;
uVar1 = load_private_key(1,param_1);
if (*(int *)(param_1 + 0x98) == 0) {
local_14 = gnutls_privkey_verify_seed(uVar1,0,0,0);
}
else {
local_14 = gnutls_privkey_verify_seed
(uVar1,0,*(undefined8 *)(param_1 + 0x90),*(undefined4 *)(param_1 + 0x98));
}
if (local_14 < 0) {
if (local_14 == -0x4e2) {
fprintf(stderr,"The private key type cannot be associated with validated parameters\n");
}
else {
uVar1 = gnutls_strerror(local_14);
fprintf(stderr,"Error verifying private key: %s\n",uVar1);
}
app_exit(1);
}
printf("Key was verified\n");
gnutls_privkey_deinit(uVar1);
return;
}
|
static
_Bool
parse_true (const struct parser_table* entry, char **argv, int *arg_ptr)
{
struct predicate *our_pred;
(void) argv;
(void) arg_ptr;
our_pred = insert_primary_noarg (entry);
our_pred->need_stat = our_pred->need_type =
0
;
our_pred->est_success_rate = 1.0f;
return
1
;
}
| long parse_true(long a1)
{
long inserted;
inserted = insert_primary_noarg(a1);
*(_BYTE *)(inserted + 27) = 0;
*(_BYTE *)(inserted + 26) = *(_BYTE *)(inserted + 27);
*(_DWORD *)(inserted + 36) = 1065353216;
return 1LL;
}
|
int
sshauthopt_deserialise(struct sshbuf *m, struct sshauthopt **optsp)
{
struct sshauthopt *opts =
((void *)0)
;
int r = -1;
u_char f;
u_int tmp;
if ((opts = calloc(1, sizeof(*opts))) ==
((void *)0)
)
return -2;
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->permit_port_forwarding_flag = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->permit_agent_forwarding_flag = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->permit_x11_forwarding_flag = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->permit_pty_flag = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->permit_user_rc = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->restricted = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->cert_authority = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->no_require_user_presence = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->require_verify = f; } while (0);
if ((r = sshbuf_get_u64(m, &opts->valid_before)) != 0)
goto out;
if ((r = sshbuf_get_u8(m, &f)) != 0 ||
(r = sshbuf_get_u32(m, &tmp)) != 0)
goto out;
opts->force_tun_device = f ? -1 : (int)tmp;
if ((r = deserialise_nullable_string(m, &opts->cert_principals)) != 0 ||
(r = deserialise_nullable_string(m, &opts->force_command)) != 0 ||
(r = deserialise_nullable_string(m,
&opts->required_from_host_cert)) != 0 ||
(r = deserialise_nullable_string(m,
&opts->required_from_host_keys)) != 0)
goto out;
if ((r = deserialise_array(m, &opts->env, &opts->nenv)) != 0 ||
(r = deserialise_array(m,
&opts->permitopen, &opts->npermitopen)) != 0 ||
(r = deserialise_array(m,
&opts->permitlisten, &opts->npermitlisten)) != 0)
goto out;
r = 0;
*optsp = opts;
opts =
((void *)0)
;
out:
sshauthopt_free(opts);
return r;
}
| long long sshauthopt_deserialise(unsigned long long a0, unsigned long long *a1) {
char v0;
char v1;
unsigned int v2;
void* v3;
unsigned long long v5;
unsigned int v6;
v3 = 0;
v2 = -1;
v3 = calloc(0x1, 0x88);
if (!v3) {
v5 = 4294967294;
} else {
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(v3) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[4]) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[8]) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[12]) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[16]) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[20]) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[32]) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[128]) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[132]) = v0;
v2 = sshbuf_get_u64(a0, v3 + 24, v3 + 24);
if (!v2) {
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
v2 = sshbuf_get_u32(a0, &v1, &v1);
if (!v2) {
if (v0)
v6 = -1;
else
v6 = *(&v1);
*(&v3[48]) = v6;
v2 = deserialise_nullable_string(a0, v3 + 40);
if (!v2) {
v2 = deserialise_nullable_string(a0, v3 + 56);
if (!v2) {
v2 = deserialise_nullable_string(a0, v3 + 112);
if (!v2) {
v2 = deserialise_nullable_string(a0, v3 + 120);
if (!v2) {
v2 = deserialise_array(a0, v3 + 72, v3 + 64);
if (!v2) {
v2 = deserialise_array(a0, v3 + 88, v3 + 80);
if (!v2) {
v2 = deserialise_array(a0, v3 + 104, v3 + 96);
if (!v2) {
v2 = 0;
*(a1) = v3;
v3 = 0;
goto LABEL_4028ea;
}
}
}
goto LABEL_4028ea;
}
}
}
}
goto LABEL_4028ea;
}
}
}
}
}
}
}
}
}
}
}
}
LABEL_4028ea:
sshauthopt_free(v3);
v5 = v2;
}
return v5;
}
|
static size_t
specify_nthreads (int oi, char c, char const *s)
{
uintmax_t nthreads;
enum strtol_error e = xstrtoumax (s,
((void *)0)
, 10, &nthreads, "");
if (e == LONGINT_OVERFLOW)
return
(18446744073709551615UL)
;
if (e != LONGINT_OK)
xstrtol_fatal (e, oi, c, long_options, s);
if (
(18446744073709551615UL)
< nthreads)
nthreads =
(18446744073709551615UL)
;
if (nthreads == 0)
((!!sizeof (struct { _Static_assert (SORT_FAILURE, "verify_expr (" "SORT_FAILURE" ", " "(error (SORT_FAILURE, 0, gettext (\"number in parallel must be nonzero\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (SORT_FAILURE, 0, gettext ("number in parallel must be nonzero")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (SORT_FAILURE, 0, gettext ("number in parallel must be nonzero")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
return nthreads;
}
| long specify_nthreads(unsigned int a1, char a2, long a3)
{
char *v4;
unsigned int v6;
long v7[2];
v7[1] = __readfsqword(0x28u);
v6 = xstrtoumax(a3, 0LL, 10LL, v7, locale);
if ( v6 == 1 )
return -1LL;
if ( v6 )
xstrtol_fatal(v6, a1, (unsigned int)a2, &long_options, a3);
if ( !v7[0] )
{
v4 = gettext("number in parallel must be nonzero");
error(2, 0, v4);
}
return v7[0];
}
|
int
el_wparse(EditLine *el, int argc, const wchar_t *argv[])
{
const wchar_t *ptr;
int i;
if (argc < 1)
return -1;
ptr = wcschr(argv[0], L':');
if (ptr !=
((void *)0)
) {
wchar_t *tprog;
size_t l;
if (ptr == argv[0])
return 0;
l = (size_t)(ptr - argv[0]);
tprog = calloc(l + 1, sizeof(*tprog));
if (tprog ==
((void *)0)
)
return 0;
(void) wcsncpy(tprog, argv[0], l);
tprog[l] = '\0';
ptr++;
l = (size_t)el_match(el->el_prog, tprog);
free(tprog);
if (!l)
return 0;
} else
ptr = argv[0];
for (i = 0; cmds[i].name !=
((void *)0)
; i++)
if (wcscmp(cmds[i].name, ptr) == 0) {
i = (*cmds[i].func) (el, argc, argv);
return -i;
}
return -1;
}
| int el_wparse(unsigned long long *a0, unsigned long a1, unsigned long long *a2) {
unsigned int v0;
unsigned short *v1;
unsigned long v2;
unsigned long long v3;
unsigned int v5;
if (a1 <= 0) {
v5 = -1;
} else {
v1 = wcschr(*(a2), 0x3a);
if (!v1) {
v1 = *(a2);
} else if (v1 == *(a2)) {
v5 = 0;
} else {
v2 = v1 - *(a2) >> 2;
v3 = calloc(v2 + 1, 0x4);
if (!v3) {
v5 = 0;
} else {
wcsncpy(v3, *(a2), v2);
*((v3 + v2 * 4)) = 0;
v1 += 4;
v2 = el_match(*(a0), v3, v3);
free(v3);
if (!v2)
v5 = 0;
}
}
if (!v1 || v1 != *(a2) && v2 && v3) {
v0 = 0;
while (true) {
if (cmds[2 * v0]) {
v5 = wcscmp(cmds[2 * v0], v1);
if (!v5) {
v0 = (&g_400888)[2 * v0](a0, a1, a2, a1, (&g_400888)[2 * v0]);
v5 = -(v0);
break;
} else {
v0 += 1;
}
} else {
v5 = -1;
break;
}
}
}
}
return v5;
}
|
static void yyerror(const char *s)
{
sh_error("arithmetic expression: %s: \"%s\"", s, arith_startbuf);
}
| void yyerror(unsigned long long a0) {
sh_error("arithmetic expression: %s: \"%s\"", a0, arith_startbuf);
}
|
==
32
) {
sshlog("serverloop.c", __func__, 285, 0, SYSLOG_LEVEL_VERBOSE,
((void *)0)
, "Connection closed by %.100s port %d", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh))
;
return -1;
}
| void sshlog(void)
{
halt_baddata();
}
|
static int
bash_complete_variable_internal (what_to_do)
int what_to_do;
{
return bash_specific_completion (what_to_do, variable_completion_function);
}
| long bash_complete_variable_internal(unsigned int a1)
{
return bash_specific_completion(a1, (long)variable_completion_function);
}
|
static size_t
read_input_reservoir_sampling (FILE *in, char eolbyte, size_t k,
struct randint_source *s,
struct linebuffer **out_rsrv)
{
randint n_lines = 0;
size_t n_alloc_lines =
(((
k
)<(
RESERVOIR_LINES_INCREMENT
))?(
k
):(
RESERVOIR_LINES_INCREMENT
))
;
struct linebuffer *line =
((void *)0)
;
struct linebuffer *rsrv;
rsrv = xcalloc (n_alloc_lines, sizeof (struct linebuffer));
while (n_lines < k
&& (line =
readlinebuffer_delim (&rsrv[n_lines], in, eolbyte)) !=
((void *)0)
)
{
n_lines++;
if (n_lines >= n_alloc_lines)
{
n_alloc_lines += RESERVOIR_LINES_INCREMENT;
rsrv = xnrealloc (rsrv, n_alloc_lines, sizeof (struct linebuffer));
memset (&rsrv[n_lines], 0,
RESERVOIR_LINES_INCREMENT * sizeof (struct linebuffer));
}
}
if (line !=
((void *)0)
)
{
struct linebuffer dummy;
initbuffer (&dummy);
do
{
randint j = randint_choose (s, n_lines + 1);
line = (j < k) ? (&rsrv[j]) : (&dummy);
}
while (readlinebuffer_delim (line, in, eolbyte) !=
((void *)0)
&& n_lines++);
if (! n_lines)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 75, gettext (\"too many input lines\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
75
, gettext ("too many input lines")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
75
, gettext ("too many input lines")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
freebuffer (&dummy);
}
if (ferror_unlocked (in))
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"read error\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, gettext ("read error")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, gettext ("read error")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
*out_rsrv = rsrv;
return
(((
k
)<(
n_lines
))?(
k
):(
n_lines
))
;
}
| unsigned long read_input_reservoir_sampling(
FILE *a1,
char a2,
unsigned long a3,
long a4,
long *a5)
{
long v5;
char *v6;
char *v8;
char *v9;
int *v10;
unsigned long result;
unsigned long v15;
unsigned long v16;
long v17;
long v18;
unsigned long v19;
char v20[24];
unsigned long v21;
v21 = __readfsqword(0x28u);
v15 = 0LL;
v5 = 1024LL;
if ( a3 <= 0x400 )
v5 = a3;
v16 = v5;
v17 = 0LL;
v18 = xcalloc(v5, 24LL);
while ( v15 < a3 )
{
v17 = readlinebuffer_delim(24 * v15 + v18, a1, (unsigned int)a2);
if ( !v17 )
break;
if ( ++v15 >= v16 )
{
v16 += 1024LL;
v18 = xnrealloc(v18, v16, 24LL);
memset((void *)(24 * v15 + v18), 0, 0x6000uLL);
}
}
if ( v17 )
{
initbuffer(v20);
do
{
v19 = randint_choose(a4, v15 + 1);
if ( v19 >= a3 )
v6 = v20;
else
v6 = (char *)(24 * v19 + v18);
if ( !readlinebuffer_delim(v6, a1, (unsigned int)a2) )
break;
}
while ( v15++ );
if ( !v15 )
{
v8 = gettext("too many input lines");
error(1, 75, v8);
}
freebuffer(v20);
}
if ( ferror_unlocked(a1) )
{
v9 = gettext("read error");
v10 = _errno_location();
error(1, *v10, v9);
}
*a5 = v18;
result = a3;
if ( v15 <= a3 )
return v15;
return result;
}
|
static inline char *
bad_cast (char const *s)
{
return (char *) s;
}
| int bad_cast(unsigned long a0) {
return a0;
}
|
static void
sigchld_handler(int sig)
{
child_terminated = 1;
}
| long long sigchld_handler(unsigned long a0) {
unsigned int v0;
unsigned long v2;
v0 = a0;
child_terminated = 1;
return v2;
}
|
static int
history_setunique(History *h, HistEvent *ev, int uni)
{
if (h->h_next != history_def_next) {
{ ev->num = 14; ev->str = he_errlist[14]; };
return -1;
}
if (uni) (((history_t *)h->h_ref)->flags) |= 1; else (((history_t *)h->h_ref)->flags) &= ~1;
return 0;
}
| long history_setunique(long ( **a1)(long a1, long a2), long a2, int a3)
{
unsigned int v4;
if ( a1[3] == history_def_next )
{
if ( a3 )
v4 = *((_DWORD *)*a1 + 15) | 1;
else
v4 = *((_DWORD *)*a1 + 15) & 0xFFFFFFFE;
*((_DWORD *)*a1 + 15) = v4;
return 0LL;
}
else
{
*(_DWORD *)a2 = 14;
*(_QWORD *)(a2 + 8) = "function not allowed with other history-functions-set the default";
return 0xFFFFFFFFLL;
}
}
|
static void
process_extended_fsync(u_int32_t id)
{
int handle, fd, r, status = 8;
if ((r = get_handle(iqueue, &handle)) != 0)
sshfatal("sftp-server.c", __func__, 1455, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse");
sshlog("sftp-server.c", __func__, 1456, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "request %u: fsync (handle %u)", id, handle);
sshlog("sftp-server.c", __func__, 1457, 0, SYSLOG_LEVEL_VERBOSE,
((void *)0)
, "fsync \"%s\"", handle_to_name(handle));
if ((fd = handle_to_fd(handle)) < 0)
status = 2;
else if (handle_is_ok(handle, HANDLE_FILE)) {
r = fsync(fd);
status = (r == -1) ? errno_to_portable(
(*__errno_location ())
) : 0;
}
send_status(id, status);
}
| long long process_extended_fsync(unsigned long a0) {
unsigned long long v0;
unsigned long long v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned long long v5;
unsigned int v6;
char v7;
unsigned int v9;
v2 = 8;
v3 = get_handle(0xe87d894820ec8348, &v1);
if (v3) {
v0 = "parse";
sshfatal("sftp-server.c", "process_extended_fsync", 0x5af, 0x1, 0x1, ssh_err(v3));
}
v5 = *(&v1);
v3 = a0;
v1 = "request %u: fsync (handle %u)";
sshlog("sftp-server.c", "process_extended_fsync", 0x5b0, 0x0, 0x7, 0x0, *(&v7));
v9 = handle_to_name(*(&v1));
v6 = v9;
v5 = "fsync \"%s\"";
sshlog("sftp-server.c", "process_extended_fsync", 0x5b1, 0x0, 0x4, 0x0, *(&v7));
v4 = handle_to_fd(*(&v1));
if (v4 < 0) {
v2 = 2;
} else if (handle_is_ok(*(&v1), 0x2)) {
v3 = fsync(v4);
if (v3 != -1)
v9 = 0;
else
v9 = errno_to_portable(*(__errno_location()));
v2 = v9;
}
send_status(a0, v2);
return 0;
}
|
void
getoptsreset(value)
const char *value;
{
shellparam.optind = number(value) ?: 1;
shellparam.optoff = -1;
}
| long long getoptsreset(unsigned long long a0) {
unsigned long long v1;
v1 = number(a0);
if (!v1)
v1 = 1;
g_400020 = v1;
g_400024 = -1;
return v1;
}
|
static void
die_pipe (void)
{
raise (
13
);
exit (
1
);
}
| void die_pipe() {
raise(0xd);
exit(0x1);
}
|
static inline
_Bool
is_nul (void const *buf, size_t length)
{
const unsigned char *p = buf;
unsigned char word;
if (! length)
return
1
;
while (__builtin_expect ((length & (sizeof word - 1)), 0))
{
if (*p)
return
0
;
p++;
length--;
if (! length)
return
1
;
}
for (;;)
{
memcpy (&word, p, sizeof word);
if (word)
return
0
;
p += sizeof word;
length -= sizeof word;
if (! length)
return
1
;
if (__builtin_expect ((length & 15), 0) == 0)
break;
}
return memcmp (buf, p, length) == 0;
}
| ulong is_nul(void *param_1,ulong param_2)
{
int iVar1;
ulong uVar2;
undefined4 extraout_var;
long in_FS_OFFSET;
ulong local_38;
char local_19;
void *local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_38 = param_2;
local_18 = param_1;
if (param_2 == 0) {
uVar2 = 1;
}
else {
do {
memcpy(&local_19,local_18,1);
if (local_19 != '\0') {
uVar2 = 0;
goto LAB_001000ff;
}
local_18 = (void *)((long)local_18 + 1);
local_38 = local_38 - 1;
if (local_38 == 0) {
uVar2 = 1;
goto LAB_001000ff;
}
} while ((local_38 & 0xf) != 0);
iVar1 = memcmp(param_1,local_18,local_38);
uVar2 = CONCAT44(extraout_var,iVar1) & 0xffffffffffffff00 | (ulong)(iVar1 == 0);
}
LAB_001000ff:
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return uVar2;
}
__stack_chk_fail();
}
|
void *
xmalloc (size_t size)
{
void *ret;
ret = malloc (size);
if (ret == 0) {
fprintf(
stderr
, "man2html: out of memory");
exit(
1
);
}
return ret;
}
| void * xmalloc(size_t a1)
{
void *v2;
v2 = malloc(a1);
if ( !v2 )
{
fprintf(stderr, "man2html: out of memory");
exit(1);
}
return v2;
}
|
static void usage(void)
{
iplink_usage();
}
| void usage() {
iplink_usage();
}
|
void
_rl_prep_non_filename_text (void)
{
if (_rl_color_indicator[C_END].string !=
((void *)0)
)
_rl_put_indicator (&_rl_color_indicator[C_END]);
else
{
_rl_put_indicator (&_rl_color_indicator[C_LEFT]);
_rl_put_indicator (&_rl_color_indicator[C_RESET]);
_rl_put_indicator (&_rl_color_indicator[C_RIGHT]);
}
}
| long long _rl_prep_non_filename_text() {
unsigned long long v1;
if (strcpy) {
v1 = _rl_put_indicator(xmalloc);
return v1;
}
_rl_put_indicator(&_rl_color_indicator);
_rl_put_indicator(lstat);
v1 = _rl_put_indicator(strlen);
return v1;
}
|
int
unquoted_glob_pattern_p (string)
register char *string;
{
register int c;
char *send;
int open, bsquote;
mbstate_t state; memset (&state, '\0', sizeof (mbstate_t));
open = bsquote = 0;
send = string + strlen (string);
while (c = *string++)
{
switch (c)
{
case '?':
case '*':
return (1);
case '[':
open++;
continue;
case ']':
if (open)
return (1);
continue;
case '/':
if (open)
open = 0;
case '+':
case '@':
case '!':
if (*string == '(')
return (1);
continue;
case '\\':
if (*string != '\0' && *string != '/')
{
bsquote = 1;
string++;
continue;
}
else if (open && *string == '/')
{
string++;
continue;
}
else if (*string == 0)
return (0);
case '\001':
if (*string++ == '\0')
return (0);
}
string--;
do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic (*(string)); if (_f) mblength = 1; else if (locale_utf8locale && ((*(string) & 0x80) == 0)) mblength = *(string) != 0; else { state_bak = state; mblength = mbrlen ((string), (send - string), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; mblength = 1; } else (string) += (mblength < 1) ? 0 : (mblength - 1); } } while (0);
string++;
}
return (0);
}
| long long unquoted_glob_pattern_p(char *a0) {
unsigned int v0;
int tmp_5;
unsigned int v1;
unsigned int v2;
unsigned long long v3;
unsigned long v4;
unsigned long long v5;
unsigned long long v6;
char *v8;
unsigned long long v9;
struct_0 *v10;
char *v11;
void* v12;
unsigned long long v13;
v8 = a0;
memset(&v5, 0x0, 0x8);
v1 = 0;
v0 = v1;
v9 = &a0[strlen(a0)];
v4 = v9;
while (true) {
tmp_5 = v8;
v8 += 1;
*(&v9) = *(tmp_5);
if (!v9) {
v13 = 0;
break;
}
if (v9 == 1) {
tmp_5 = v8;
v8 += 1;
*(&v9) = *(tmp_5);
if (!v9) {
v13 = 0;
break;
}
} else {
if (v9 <= 0)
goto LABEL_400192;
if (!(v9 <= 93))
goto LABEL_400192;
if (v9 < 33)
goto LABEL_400192;
v10 = v9 - 33;
switch (v10) {
case 9: case 30:
v13 = 1;
break;
case 58:
v0 += 1;
continue;
case 59:
if (*(v8) && *(v8) != 47) {
v1 = 1;
v8 += 1;
continue;
}
if (v0 && *(v8) == 47) {
v8 += 1;
continue;
}
if (!*(v8)) {
v13 = 0;
break;
}
case 60:
if (!v0)
continue;
v13 = 1;
break;
case 14:
if (v0) {
v0 = 0;
goto LABEL_400120;
}
case 0: case 10: case 31:
LABEL_400120:
if (!(*(v8) == 40))
continue;
v13 = 1;
break;
default:
LABEL_400192:
v11 = v8 + 1;
if (locale_mb_cur_max <= 1) {
LABEL_400248:
v8 = v11 + 1;
continue;
} else {
v2 = is_basic(*(v11));
if (v2) {
v3 = 1;
goto LABEL_40020f;
}
if (locale_utf8locale && *(v11) >= 0) {
v3 = *(v11);
goto LABEL_40020f;
}
v6 = v5;
v3 = mbrlen(v11, v4 + -0x1 * v11, &v5, v4 + -0x1 * v11);
LABEL_40020f:
if (v3 != -2 && v3 != -1) {
if (!v3)
v12 = 0;
else
v12 = v3 - 1;
v11 += v12;
goto LABEL_400248;
}
v5 = v6;
v3 = 1;
goto LABEL_400248;
}
}
}
}
return v13;
}
|
static void ZDecrypt(Inputs r,const unsigned char *C,const unsigned char *sk)
{
small f[761],v[761];
Fq c[761];
Small_decode(f,sk); sk += ((761 +3)/4);
Small_decode(v,sk);
Rounded_decode(c,C);
Decrypt(r,c,f,v);
}
| void ZDecrypt(char *a0, unsigned long long a1, unsigned int a2) {
unsigned int v0;
char v1;
char v2;
char v3;
char v4;
unsigned long long *v6;
unsigned long long v7;
v0 = a2;
Small_decode(&v2, *(&v0));
*(&v0) = *(&v0) + 191;
Small_decode(&v3, *(&v0));
Rounded_decode(&v1, a1, a1);
Decrypt(a0, &v1, &v2, &v3);
v7 = *(&v4) ^ v6[5];
return;
}
|
static int
bash_complete_username (ignore, ignore2)
int ignore, ignore2;
{
return bash_complete_username_internal (rl_completion_mode (bash_complete_username));
}
| void bash_complete_username(void)
{
undefined4 uVar1;
uVar1 = rl_completion_mode(bash_complete_username);
bash_complete_username_internal(uVar1);
return;
}
|
static inline int have_traps(void)
{
return trapcnt;
}
| int have_traps() {
return trapcnt;
}
|
int
history_is_stifled(void)
{
return max_input_history != 0x7fffffff;
}
| long long history_is_stifled() {
return *(got.max_input_history) != 2147483647;
}
|
int
main(int argc, char **argv)
{
int agent_fd;
char *pkcs11provider =
((void *)0)
, *skprovider =
((void *)0)
;
char **dest_constraint_strings =
((void *)0)
, **hostkey_files =
((void *)0)
;
int r, i, ch, deleting = 0, ret = 0, key_only = 0, do_download = 0;
int xflag = 0, lflag = 0, Dflag = 0, qflag = 0, Tflag = 0;
SyslogFacility log_facility = SYSLOG_FACILITY_AUTH;
LogLevel log_level = SYSLOG_LEVEL_INFO;
struct dest_constraint **dest_constraints =
((void *)0)
;
size_t ndest_constraints = 0;
sanitise_stdfd();
__progname = ssh_get_progname(argv[0]);
seed_rng();
log_init(__progname, log_level, log_facility, 1);
setvbuf(
stdout
,
((void *)0)
,
1
, 0);
switch (r = ssh_get_authentication_socket(&agent_fd)) {
case 0:
break;
case -47:
fprintf(
stderr
, "Could not open a connection to your "
"authentication agent.\n");
exit(2);
default:
fprintf(
stderr
, "Error connecting to agent: %s\n", ssh_err(r));
exit(2);
}
skprovider = getenv("SSH_SK_PROVIDER");
while ((ch = BSDgetopt(argc, argv, "vkKlLcdDTxXE:e:h:H:M:m:qs:S:t:")) != -1) {
switch (ch) {
case 'v':
if (log_level == SYSLOG_LEVEL_INFO)
log_level = SYSLOG_LEVEL_DEBUG1;
else if (log_level < SYSLOG_LEVEL_DEBUG3)
log_level++;
break;
case 'E':
fingerprint_hash = ssh_digest_alg_by_name(BSDoptarg);
if (fingerprint_hash == -1)
sshfatal("ssh-add.c", __func__, 833, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Invalid hash algorithm \"%s\"", BSDoptarg);
break;
case 'H':
stringlist_append(&hostkey_files, BSDoptarg);
break;
case 'h':
stringlist_append(&dest_constraint_strings, BSDoptarg);
break;
case 'k':
key_only = 1;
break;
case 'K':
do_download = 1;
break;
case 'l':
case 'L':
if (lflag != 0)
sshfatal("ssh-add.c", __func__, 850, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "-%c flag already specified", lflag);
lflag = ch;
break;
case 'x':
case 'X':
if (xflag != 0)
sshfatal("ssh-add.c", __func__, 856, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "-%c flag already specified", xflag);
xflag = ch;
break;
case 'c':
confirm = 1;
break;
case 'm':
minleft = (int)strtonum(BSDoptarg, 1,
(0x7fffffff * 2U + 1U)
,
((void *)0)
);
if (minleft == 0) {
usage();
ret = 1;
goto done;
}
break;
case 'M':
maxsign = (int)strtonum(BSDoptarg, 1,
(0x7fffffff * 2U + 1U)
,
((void *)0)
);
if (maxsign == 0) {
usage();
ret = 1;
goto done;
}
break;
case 'd':
deleting = 1;
break;
case 'D':
Dflag = 1;
break;
case 's':
pkcs11provider = BSDoptarg;
break;
case 'S':
skprovider = BSDoptarg;
break;
case 'e':
deleting = 1;
pkcs11provider = BSDoptarg;
break;
case 't':
if ((lifetime = convtime(BSDoptarg)) == -1 ||
lifetime < 0 || (u_long)lifetime >
(4294967295U)
) {
fprintf(
stderr
, "Invalid lifetime\n");
ret = 1;
goto done;
}
break;
case 'q':
qflag = 1;
break;
case 'T':
Tflag = 1;
break;
default:
usage();
ret = 1;
goto done;
}
}
log_init(__progname, log_level, log_facility, 1);
if ((xflag != 0) + (lflag != 0) + (Dflag != 0) > 1)
sshfatal("ssh-add.c", __func__, 917, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Invalid combination of actions");
else if (xflag) {
if (lock_agent(agent_fd, xflag == 'x' ? 1 : 0) == -1)
ret = 1;
goto done;
} else if (lflag) {
if (list_identities(agent_fd, lflag == 'l' ? 1 : 0) == -1)
ret = 1;
goto done;
} else if (Dflag) {
if (delete_all(agent_fd, qflag) == -1)
ret = 1;
goto done;
}
if (hostkey_files ==
((void *)0)
) {
stringlist_append(&hostkey_files, "~/" ".ssh" "/known_hosts");
stringlist_append(&hostkey_files, "~/" ".ssh" "/known_hosts2");
stringlist_append(&hostkey_files, "/usr/local/etc" "/ssh_known_hosts");
stringlist_append(&hostkey_files, "/usr/local/etc" "/ssh_known_hosts2");
}
if (dest_constraint_strings !=
((void *)0)
) {
for (i = 0; dest_constraint_strings[i] !=
((void *)0)
; i++) {
parse_dest_constraint(dest_constraint_strings[i],
&dest_constraints, &ndest_constraints, hostkey_files);
}
}
argc -= BSDoptind;
argv += BSDoptind;
if (Tflag) {
if (argc <= 0)
sshfatal("ssh-add.c", __func__, 955, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "no keys to test");
for (r = i = 0; i < argc; i++)
r |= test_key(agent_fd, argv[i]);
ret = r == 0 ? 0 : 1;
goto done;
}
if (pkcs11provider !=
((void *)0)
) {
if (update_card(agent_fd, !deleting, pkcs11provider,
qflag, dest_constraints, ndest_constraints) == -1)
ret = 1;
goto done;
}
if (do_download) {
if (skprovider ==
((void *)0)
)
sshfatal("ssh-add.c", __func__, 969, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Cannot download keys without provider");
if (load_resident_keys(agent_fd, skprovider, qflag,
dest_constraints, ndest_constraints) != 0)
ret = 1;
goto done;
}
if (argc == 0) {
char buf[
4096
];
struct passwd *pw;
struct stat st;
int count = 0;
if ((pw = getpwuid(getuid())) ==
((void *)0)
) {
fprintf(
stderr
, "No user found with uid %u\n",
(u_int)getuid());
ret = 1;
goto done;
}
for (i = 0; default_files[i]; i++) {
snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir,
default_files[i]);
if (stat(buf, &st) == -1)
continue;
if (do_file(agent_fd, deleting, key_only, buf,
qflag, skprovider,
dest_constraints, ndest_constraints) == -1)
ret = 1;
else
count++;
}
if (count == 0)
ret = 1;
} else {
for (i = 0; i < argc; i++) {
if (do_file(agent_fd, deleting, key_only,
argv[i], qflag, skprovider,
dest_constraints, ndest_constraints) == -1)
ret = 1;
}
}
done:
clear_pass();
ssh_close_authentication_socket(agent_fd);
return ret;
}
| int main(int argc, const char **argv, const char **envp)
{
const char *v3;
long v4;
int v5;
__uid_t v6;
__uid_t v7;
const char **v10;
int v11;
unsigned int v12;
unsigned int authentication_socket;
int i;
int v15;
int v16;
int v17;
int v18;
unsigned int v19;
unsigned int v20;
int v21;
int v22;
int v23;
unsigned int v24;
int v25;
unsigned int v26;
unsigned int v27;
long v28;
long v29;
long v30;
long v31;
const char *v32;
char *v33;
struct passwd *v34;
struct stat v35;
char s[16];
unsigned long v37;
v37 = __readfsqword(0x28u);
v32 = 0LL;
v33 = 0LL;
v28 = 0LL;
v29 = 0LL;
v15 = 0;
v16 = 0;
v17 = 0;
v18 = 0;
v19 = 0;
v20 = 0;
v21 = 0;
v22 = 0;
v23 = 0;
v26 = 2;
v24 = 3;
v30 = 0LL;
v31 = 0LL;
sanitise_stdfd(argc, argv, envp);
_progname = ssh_get_progname(*argv);
seed_rng();
log_init(_progname, 3LL, 2LL, 1LL);
setvbuf(stdout, 0LL, 1, 0LL);
authentication_socket = ssh_get_authentication_socket(&v12);
if ( authentication_socket == -47 )
{
fprintf(stderr, "Could not open a connection to your authentication agent.\n");
exit(2);
}
if ( authentication_socket )
{
v3 = (const char *)ssh_err(authentication_socket);
fprintf(stderr, "Error connecting to agent: %s\n", v3);
exit(2);
}
v33 = getenv("SSH_SK_PROVIDER");
while ( 2 )
{
v27 = BSDgetopt((unsigned int)argc, argv, "vkKlLcdDTxXE:e:h:H:M:m:qs:S:t:");
if ( v27 == -1 )
{
log_init(_progname, v24, v26, 1LL);
if ( (v19 != 0) + (v20 != 0) + (v21 != 0) > 1 )
sshfatal("ssh-add.c", "main", 917LL, 0LL, 1LL, 0LL, "Invalid combination of actions");
if ( v19 )
{
if ( (unsigned int)lock_agent(v12, v19 == 120) == -1 )
v16 = 1;
}
else if ( v20 )
{
if ( (unsigned int)list_identities(v12, v20 == 108) == -1 )
v16 = 1;
}
else if ( v21 )
{
if ( (unsigned int)delete_all(v12, v22) == -1 )
v16 = 1;
}
else
{
if ( !v29 )
{
stringlist_append(&v29, (long)"~/.ssh/known_hosts");
stringlist_append(&v29, (long)"~/.ssh/known_hosts2");
stringlist_append(&v29, (long)"/usr/local/etc/ssh_known_hosts");
stringlist_append(&v29, (long)"/usr/local/etc/ssh_known_hosts2");
}
if ( v28 )
{
for ( i = 0; *(_QWORD *)(8LL * i + v28); ++i )
parse_dest_constraint(*(_QWORD *)(8LL * i + v28), &v30, &v31, v29);
}
v11 = argc - BSDoptind;
v10 = &argv[BSDoptind];
if ( v23 )
{
if ( v11 <= 0 )
sshfatal("ssh-add.c", "main", 955LL, 0LL, 1LL, 0LL, "no keys to test");
i = 0;
authentication_socket = 0;
while ( i < v11 )
{
v5 = test_key(v12, v10[i]);
authentication_socket |= v5;
++i;
}
v16 = authentication_socket != 0;
}
else if ( v32 )
{
if ( (unsigned int)update_card(v12, v15 == 0, v32, v22, v30, v31) == -1 )
v16 = 1;
}
else if ( v18 )
{
if ( !v33 )
sshfatal("ssh-add.c", "main", 969LL, 0LL, 1LL, 0LL, "Cannot download keys without provider");
if ( (unsigned int)load_resident_keys(v12, (long)v33, v22, v30, v31) )
v16 = 1;
}
else if ( v11 )
{
for ( i = 0; i < v11; ++i )
{
if ( (unsigned int)do_file(v12, v15, v17, (char *)v10[i], v22, (long)v33, v30, v31) == -1 )
v16 = 1;
}
}
else
{
v25 = 0;
v6 = getuid();
v34 = getpwuid(v6);
if ( v34 )
{
for ( i = 0; default_files[i]; ++i )
{
snprintf(s, 0x1000uLL, "%s/%s", v34->pw_dir, default_files[i]);
if ( stat(s, &v35) != -1 )
{
if ( (unsigned int)do_file(v12, v15, v17, s, v22, (long)v33, v30, v31) == -1 )
v16 = 1;
else
++v25;
}
}
if ( !v25 )
v16 = 1;
}
else
{
v7 = getuid();
fprintf(stderr, "No user found with uid %u\n", v7);
v16 = 1;
}
}
}
}
else
{
HIDWORD(v4) = 0;
switch ( v27 )
{
case 'D':
v21 = 1;
continue;
case 'E':
fingerprint_hash = ssh_digest_alg_by_name(BSDoptarg, v4);
if ( fingerprint_hash != -1 )
continue;
sshfatal("ssh-add.c", "main", 833LL, 0LL, 1LL, 0LL, "Invalid hash algorithm \"%s\"", BSDoptarg);
goto LABEL_13;
case 'H':
LABEL_13:
stringlist_append(&v29, BSDoptarg);
continue;
case 'K':
v18 = 1;
continue;
case 'L':
case 'l':
if ( v20 )
sshfatal("ssh-add.c", "main", 850LL, 0LL, 1LL, 0LL, "-%c flag already specified", v20);
v20 = v27;
continue;
case 'M':
maxsign = strtonum(BSDoptarg, 1LL, 0xFFFFFFFFLL, 0LL);
if ( maxsign )
continue;
goto LABEL_25;
case 'S':
v33 = (char *)BSDoptarg;
continue;
case 'T':
v23 = 1;
continue;
case 'X':
case 'x':
if ( v19 )
sshfatal("ssh-add.c", "main", 856LL, 0LL, 1LL, 0LL, "-%c flag already specified", v19);
v19 = v27;
continue;
case 'c':
confirm = 1;
continue;
case 'd':
v15 = 1;
continue;
case 'e':
v15 = 1;
v32 = (const char *)BSDoptarg;
continue;
case 'h':
stringlist_append(&v28, BSDoptarg);
continue;
case 'k':
v17 = 1;
continue;
case 'm':
minleft = strtonum(BSDoptarg, 1LL, 0xFFFFFFFFLL, 0LL);
if ( minleft )
continue;
goto LABEL_25;
case 'q':
v22 = 1;
continue;
case 's':
v32 = (const char *)BSDoptarg;
continue;
case 't':
lifetime = convtime(BSDoptarg, v4);
if ( lifetime >= 0 )
continue;
fprintf(stderr, "Invalid lifetime\n");
v16 = 1;
goto LABEL_87;
case 'v':
if ( v24 == 3 )
{
v24 = 5;
}
else if ( (int)v24 <= 6 )
{
++v24;
}
continue;
default:
LABEL_25:
usage();
v16 = 1;
break;
}
}
break;
}
LABEL_87:
clear_pass();
ssh_close_authentication_socket(v12);
return v16;
}
|
static char *
strlimitcpy(char *to, char *from, int n, int limit)
{
int len = n > limit ? limit : n;
strmaxcpy(to, from, len);
to[len] = '\0';
return to;
}
| void strlimitcpy(char *a0, char *a1, unsigned long a2, unsigned long a3) {
unsigned int v0;
unsigned int v2;
char *v3;
v2 = a3;
if (a2 <= a3)
v2 = a2;
v0 = v2;
strmaxcpy(a0, a1, v0);
a0[v0] = 0;
v3 = a0;
return;
}
|
int
sshbuf_get_u8(struct sshbuf *buf, u_char *valp)
{
const u_char *p = sshbuf_ptr(buf);
int r;
if ((r = sshbuf_consume(buf, 1)) < 0)
return r;
if (valp !=
((void *)0)
)
*valp = (u_int8_t)*p;
return 0;
}
| long sshbuf_get_u8(long a1, _BYTE *a2)
{
int v3;
_BYTE *v4;
v4 = (_BYTE *)sshbuf_ptr(a1);
v3 = sshbuf_consume(a1, 1LL);
if ( v3 < 0 )
return (unsigned int)v3;
if ( a2 )
*a2 = *v4;
return 0LL;
}
|
static
_Bool
open_symlink_nofollow_error (int err)
{
if (err ==
40
|| err ==
31
)
return
1
;
return
0
;
}
| int open_symlink_nofollow_error(unsigned long a0) {
unsigned int v1;
if (a0 != 40 && a0 != 31)
v1 = 0;
if (a0 == 40 || a0 == 31)
v1 = 1;
return v1;
}
|
static int
print_index_and_element (len, ind, list)
int len, ind;
WORD_LIST *list;
{
register WORD_LIST *l;
register int i;
if (list == 0)
return (0);
for (i = ind, l = list; l && --i; l = l->next)
;
if (l == 0)
return (0);
fprintf (
stderr
, "%*d%s%s", len, ind, ") ", l->word->word);
return (displen (l->word->word));
}
| int print_index_and_element(unsigned long a0, unsigned long a1, unsigned long long a2) {
unsigned int v1;
unsigned int v2;
struct_0 *v3;
if (!a2) {
v1 = 0;
return v1;
}
v2 = a1;
for (v3 = a2; v3 && (v2 -= 1, v2); v3 = v3->field_0);
if (!v3) {
v1 = 0;
return v1;
}
fprintf(stderr, "%*", a0, a1);
v1 = displen(v3->field_8->field_0);
return v1;
}
|
struct passwd *
getpwnamallow(struct ssh *ssh, const char *user)
{
struct passwd *pw;
struct connection_info *ci;
u_int i;
ci = get_connection_info(ssh, 1, options.use_dns);
ci->user = user;
parse_server_match_config(&options, &includes, ci);
log_change_level(options.log_level);
log_verbose_reset();
for (i = 0; i < options.num_log_verbose; i++)
log_verbose_add(options.log_verbose[i]);
process_permitopen(ssh, &options);
pw = getpwnam(user);
if (pw ==
((void *)0)
) {
sshlog("auth.c", __func__, 495, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Invalid user %.100s from %.100s port %d", user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh))
;
record_failed_login(ssh, user,
auth_get_canonical_hostname(ssh, options.use_dns), "ssh");
return (
((void *)0)
);
}
if (!allowed_user(ssh, pw))
return (
((void *)0)
);
if (pw !=
((void *)0)
)
return (pwcopy(pw));
return (
((void *)0)
);
}
| long long getpwnamallow(unsigned long long a0, char *a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned int v3;
unsigned long long *v4;
void* v5;
void* v7;
v4 = get_connection_info(a0, 0x1, *(5250552));
*(v4) = a1;
parse_server_match_config(0x500000, 0x500128, v4);
log_change_level(*(5244128));
log_verbose_reset(a0, 0x500128, a2, a3, a4, a5);
for (v3 = 0; v3 < *(5244132); v3 += 1) {
log_verbose_add(*((*(5244136) + v3 * 8)));
}
process_permitopen(a0, 0x500000);
v5 = getpwnam(a1);
if (!v5) {
v2 = ssh_remote_port(a0);
v1 = ssh_remote_ipaddr(a0);
v0 = a1;
sshlog("auth.c", "getpwnamallow", 0x1ef, 0x0, 0x3, 0x0, "Invalid user %.100s from %.100s port %d");
record_failed_login(a0, a1, auth_get_canonical_hostname(a0, *(5250552)), "ssh");
v7 = 0;
} else if (!allowed_user(a0, v5)) {
v7 = 0;
} else if (!v5) {
v7 = 0;
} else {
v7 = pwcopy(v5);
}
return v7;
}
|
static void
key_to_opts (struct keyfield const *key, char *opts)
{
if (key->skipsblanks || key->skipeblanks)
*opts++ = 'b';
if (key->ignore == nondictionary)
*opts++ = 'd';
if (key->translate)
*opts++ = 'f';
if (key->general_numeric)
*opts++ = 'g';
if (key->human_numeric)
*opts++ = 'h';
if (key->ignore == nonprinting)
*opts++ = 'i';
if (key->month)
*opts++ = 'M';
if (key->numeric)
*opts++ = 'n';
if (key->random)
*opts++ = 'R';
if (key->reverse)
*opts++ = 'r';
if (key->version)
*opts++ = 'V';
*opts = '\0';
}
| void key_to_opts(long param_1,undefined *param_2)
{
undefined *local_18;
if ((*(char *)(param_1 + 0x30) != '\0') || (local_18 = param_2, *(char *)(param_1 + 0x31) != '\0')
) {
local_18 = param_2 + 1;
*param_2 = 0x62;
}
if (*(undefined1 **)(param_1 + 0x20) == nondictionary) {
*local_18 = 100;
local_18 = local_18 + 1;
}
if (*(long *)(param_1 + 0x28) != 0) {
*local_18 = 0x66;
local_18 = local_18 + 1;
}
if (*(char *)(param_1 + 0x34) != '\0') {
*local_18 = 0x67;
local_18 = local_18 + 1;
}
if (*(char *)(param_1 + 0x35) != '\0') {
*local_18 = 0x68;
local_18 = local_18 + 1;
}
if (*(undefined1 **)(param_1 + 0x20) == nonprinting) {
*local_18 = 0x69;
local_18 = local_18 + 1;
}
if (*(char *)(param_1 + 0x36) != '\0') {
*local_18 = 0x4d;
local_18 = local_18 + 1;
}
if (*(char *)(param_1 + 0x32) != '\0') {
*local_18 = 0x6e;
local_18 = local_18 + 1;
}
if (*(char *)(param_1 + 0x33) != '\0') {
*local_18 = 0x52;
local_18 = local_18 + 1;
}
if (*(char *)(param_1 + 0x37) != '\0') {
*local_18 = 0x72;
local_18 = local_18 + 1;
}
if (*(char *)(param_1 + 0x38) != '\0') {
*local_18 = 0x56;
local_18 = local_18 + 1;
}
*local_18 = 0;
return;
}
|
void
setup_glob_ignore (name)
char *name;
{
char *v;
v = get_string_value (name);
setup_ignore_patterns (&globignore);
if (globignore.num_ignores)
glob_dot_filenames = 1;
else if (v == 0)
glob_dot_filenames = 0;
}
| long long setup_glob_ignore(unsigned long long a0) {
unsigned long v0;
v0 = get_string_value(a0);
setup_ignore_patterns(&globignore);
if (g_4017b0) {
glob_dot_filenames = 1;
return g_4017b0;
}
if (!v0)
glob_dot_filenames = 0;
return g_4017b0;
}
|
static void
mux_client_request_terminate(int fd)
{
struct sshbuf *m;
char *e;
u_int type, rid;
int r;
sshlog("mux.c", __func__, 1695, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "entering");
if ((m = sshbuf_new()) ==
((void *)0)
)
sshfatal("mux.c", __func__, 1698, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new");
if ((r = sshbuf_put_u32(m, 0x10000005)) != 0 ||
(r = sshbuf_put_u32(m, muxclient_request_id)) != 0)
sshfatal("mux.c", __func__, 1701, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "request");
if (mux_client_write_packet(fd, m) != 0)
sshfatal("mux.c", __func__, 1704, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "write packet: %s", strerror(
(*__errno_location ())
));
sshbuf_reset(m);
if (mux_client_read_packet(fd, m) != 0) {
if (
(*__errno_location ())
==
32
) {
sshbuf_free(m);
return;
}
sshfatal("mux.c", __func__, 1715, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "read from master failed: %s", strerror(
(*__errno_location ())
));
}
if ((r = sshbuf_get_u32(m, &type)) != 0 ||
(r = sshbuf_get_u32(m, &rid)) != 0)
sshfatal("mux.c", __func__, 1720, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse");
if (rid != muxclient_request_id)
sshfatal("mux.c", __func__, 1722, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "out of sequence reply: my id %u theirs %u", muxclient_request_id, rid)
;
switch (type) {
case 0x80000001:
break;
case 0x80000002:
if ((r = sshbuf_get_cstring(m, &e,
((void *)0)
)) != 0)
sshfatal("mux.c", __func__, 1729, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse error message");
sshfatal("mux.c", __func__, 1730, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Master refused termination request: %s", e);
case 0x80000003:
if ((r = sshbuf_get_cstring(m, &e,
((void *)0)
)) != 0)
sshfatal("mux.c", __func__, 1733, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse error message");
sshfatal("mux.c", __func__, 1734, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "termination request failed: %s", e);
default:
sshfatal("mux.c", __func__, 1736, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "unexpected response from master 0x%08x", type);
}
sshbuf_free(m);
muxclient_request_id++;
}
| unsigned long mux_client_request_terminate(int a1)
{
long v1;
int *v2;
char *v3;
int *v4;
char *v5;
long v6;
long v7;
long v8;
unsigned int v10;
unsigned int v11;
unsigned int u32;
const char *v13;
long v14;
unsigned long v15;
v15 = __readfsqword(0x28u);
sshlog("mux.c", "mux_client_request_terminate", 1695LL, 1LL, 7LL, 0LL, "entering");
v14 = sshbuf_new();
if ( !v14 )
sshfatal("mux.c", "mux_client_request_terminate", 1698LL, 1LL, 1LL, 0LL, "sshbuf_new");
u32 = sshbuf_put_u32(v14, 268435461LL);
if ( u32 || (u32 = sshbuf_put_u32(v14, (unsigned int)muxclient_request_id)) != 0 )
{
v1 = ssh_err(u32);
sshfatal("mux.c", "mux_client_request_terminate", 1701LL, 1LL, 1LL, v1, "request");
}
if ( (unsigned int)mux_client_write_packet(a1, v14) )
{
v2 = _errno_location();
v3 = strerror(*v2);
sshfatal("mux.c", "mux_client_request_terminate", 1704LL, 1LL, 1LL, 0LL, "write packet: %s", v3);
}
sshbuf_reset(v14);
if ( !(unsigned int)mux_client_read_packet(a1, v14) )
{
LABEL_12:
u32 = sshbuf_get_u32(v14, &v10);
if ( u32 || (u32 = sshbuf_get_u32(v14, &v11)) != 0 )
{
v6 = ssh_err(u32);
sshfatal("mux.c", "mux_client_request_terminate", 1720LL, 1LL, 1LL, v6, "parse");
}
if ( v11 != muxclient_request_id )
sshfatal(
"mux.c",
"mux_client_request_terminate",
1722LL,
1LL,
1LL,
0LL,
"out of sequence reply: my id %u theirs %u",
(unsigned int)muxclient_request_id,
v11);
if ( v10 != -2147483645 )
{
if ( v10 > 0x80000003 )
goto LABEL_27;
if ( v10 == -2147483647 )
{
LABEL_28:
sshbuf_free(v14);
++muxclient_request_id;
return __readfsqword(0x28u) ^ v15;
}
if ( v10 != -2147483646 )
{
LABEL_27:
sshfatal(
"mux.c",
"mux_client_request_terminate",
1736LL,
1LL,
1LL,
0LL,
"unexpected response from master 0x%08x",
v10);
goto LABEL_28;
}
u32 = sshbuf_get_cstring(v14, &v13, 0LL);
if ( u32 )
{
v7 = ssh_err(u32);
sshfatal("mux.c", "mux_client_request_terminate", 1729LL, 1LL, 1LL, v7, "parse error message");
}
sshfatal(
"mux.c",
"mux_client_request_terminate",
1730LL,
0LL,
1LL,
0LL,
"Master refused termination request: %s",
v13);
}
u32 = sshbuf_get_cstring(v14, &v13, 0LL);
if ( u32 )
{
v8 = ssh_err(u32);
sshfatal("mux.c", "mux_client_request_terminate", 1733LL, 1LL, 1LL, v8, "parse error message");
}
sshfatal("mux.c", "mux_client_request_terminate", 1734LL, 1LL, 1LL, 0LL, "termination request failed: %s", v13);
goto LABEL_27;
}
if ( *_errno_location() != 32 )
{
v4 = _errno_location();
v5 = strerror(*v4);
sshfatal("mux.c", "mux_client_request_terminate", 1715LL, 1LL, 1LL, 0LL, "read from master failed: %s", v5);
goto LABEL_12;
}
sshbuf_free(v14);
return __readfsqword(0x28u) ^ v15;
}
|
cfg_option_t
cfg_load(const char *filename)
{
struct parser_st parser;
struct options_st options;
struct cfg_option_st null_option = {
((void *)0)
,
((void *)0)
};
memset(&parser, 0, sizeof(parser));
memset(&options, 0, sizeof(options));
parser.fp = fopen(filename, "r");
if (!parser.fp) {
return
((void *)0)
;
}
for (;;) {
struct cfg_option_st option;
option.name = read_name(&parser);
if (!option.name) {
break;
}
option.value = read_value(&parser);
if (!option.value) {
clear_option(&option);
goto error;
}
if (take_option(&options, &option) < 0) {
clear_option(&option);
goto error;
}
((void) sizeof ((
!option.name && !option.value
) ? 1 : 0), __extension__ ({ if (
!option.name && !option.value
) ; else __assert_fail (
"!option.name && !option.value"
, "cfg.c", 423, __extension__ __PRETTY_FUNCTION__); }))
;
}
fclose(parser.fp);
take_option(&options, &null_option);
return options.data;
error:
clear_options(&options);
fclose(parser.fp);
return
((void *)0)
;
}
| undefined8 cfg_load(char *param_1)
{
int iVar1;
long in_FS_OFFSET;
undefined8 local_68;
undefined8 local_60;
long local_58;
long local_50;
undefined8 local_48 [4];
FILE *local_28 [3];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_68 = 0;
local_60 = 0;
memset(local_28,0,0x18);
memset(local_48,0,0x18);
local_28[0] = fopen(param_1,"r");
if (local_28[0] == (FILE *)0x0) {
local_48[0] = 0;
}
else {
while( true ) {
local_58 = read_name(local_28);
if (local_58 == 0) {
fclose(local_28[0]);
take_option(local_48,&local_68);
goto LAB_00100bb3;
}
local_50 = read_value(local_28);
if (local_50 == 0) break;
iVar1 = take_option(local_48,&local_58);
if (iVar1 < 0) {
clear_option(&local_58);
goto LAB_00100b96;
}
if ((local_58 != 0) || (local_50 != 0)) {
__assert_fail("!option.name && !option.value","cfg.c",0x1a7,"cfg_load");
}
}
clear_option(&local_58);
LAB_00100b96:
clear_options(local_48);
fclose(local_28[0]);
local_48[0] = 0;
}
LAB_00100bb3:
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return local_48[0];
}
__stack_chk_fail();
}
|
static void
open_stdout (struct format_val *p)
{
open_output_file ("/dev/stdout", p);
}
| bool open_stdout(long a1)
{
return open_output_file("/dev/stdout", a1);
}
|
static
void *myMalloc ( Int32 n )
{
void* p;
p = malloc ( (size_t)n );
if (p ==
((void *)0)
) outOfMemory ();
return p;
}
| int myMalloc(unsigned long a0) {
unsigned long v0;
v0 = malloc(a0);
if (!v0)
outOfMemory();
return v0;
}
|
extern inline
_Bool
c_isprint (int c)
{
switch (c)
{
case ' ':
case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
case 'a' + (0): case 'b' + (0): case 'c' + (0): case 'd' + (0): case 'e' + (0): case 'f' + (0): case 'g' + (0): case 'h' + (0): case 'i' + (0): case 'j' + (0): case 'k' + (0): case 'l' + (0): case 'm' + (0): case 'n' + (0): case 'o' + (0): case 'p' + (0): case 'q' + (0): case 'r' + (0): case 's' + (0): case 't' + (0): case 'u' + (0): case 'v' + (0): case 'w' + (0): case 'x' + (0): case 'y' + (0): case 'z' + (0):
case '!': case '"': case '#': case '$': case '%': case '&': case '\'': case '(': case ')': case '*': case '+': case ',': case '-': case '.': case '/': case ':': case ';': case '<': case '=': case '>': case '?': case '@': case '[': case '\\': case ']': case '^': case '_': case '`': case '{': case '|': case '}': case '~':
case 'a' + ('A' - 'a'): case 'b' + ('A' - 'a'): case 'c' + ('A' - 'a'): case 'd' + ('A' - 'a'): case 'e' + ('A' - 'a'): case 'f' + ('A' - 'a'): case 'g' + ('A' - 'a'): case 'h' + ('A' - 'a'): case 'i' + ('A' - 'a'): case 'j' + ('A' - 'a'): case 'k' + ('A' - 'a'): case 'l' + ('A' - 'a'): case 'm' + ('A' - 'a'): case 'n' + ('A' - 'a'): case 'o' + ('A' - 'a'): case 'p' + ('A' - 'a'): case 'q' + ('A' - 'a'): case 'r' + ('A' - 'a'): case 's' + ('A' - 'a'): case 't' + ('A' - 'a'): case 'u' + ('A' - 'a'): case 'v' + ('A' - 'a'): case 'w' + ('A' - 'a'): case 'x' + ('A' - 'a'): case 'y' + ('A' - 'a'): case 'z' + ('A' - 'a'):
return
1
;
default:
return
0
;
}
}
| bool c_isprint(int param_1)
{
return param_1 - 0x20U < 0x5f;
}
|
static void
keyprint_one(const char *host, struct sshkey *key)
{
char *hostport =
((void *)0)
, *hashed =
((void *)0)
;
const char *known_host;
found_one = 1;
if (print_sshfp) {
export_dns_rr(host, key,
stdout
, 0);
return;
}
hostport = put_host_port(host, ssh_port);
lowercase(hostport);
if (hash_hosts && (hashed = host_hash(hostport,
((void *)0)
, 0)) ==
((void *)0)
)
sshfatal("ssh-keyscan.c", __func__, 323, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "host_hash failed");
known_host = hash_hosts ? hashed : hostport;
if (!get_cert)
fprintf(
stdout
, "%s ", known_host);
sshkey_write(key,
stdout
);
fputs("\n",
stdout
);
free(hashed);
free(hostport);
}
| void keyprint_one(unsigned long long a0, unsigned long long a1) {
void* v0;
void* v1;
unsigned long v2;
unsigned long long v4;
unsigned long long v6;
v1 = 0;
v0 = 0;
found_one = 1;
if (print_sshfp) {
v4 = export_dns_rr(a0, a1, *(&stdout), 0x0);
return;
}
v1 = put_host_port(a0, ssh_port, ssh_port);
lowercase(v1);
if (hash_hosts) {
v0 = host_hash(v1, 0x0, 0x0);
if (!v0)
sshfatal("ssh-keyscan.c", "keyprint_one", 0x143, 0x0, 0x1, 0x0, "host_hash failed");
}
*(&v2) = (!hash_hosts ? v0 : v1);
if (!get_cert)
fprintf(*(&stdout), "%s ", v2);
sshkey_write(a1, *(&stdout), *(&stdout));
fputs("\n", *(&stdout));
free(v0);
v6 = free(v1);
return;
}
|
static inline int have_traps(void)
{
return trapcnt;
}
| int have_traps() {
return trapcnt;
}
|
static void
lbuf_flush (void)
{
size_t size = lbuf.end - lbuf.buf;
if (full_write (
1
, lbuf.buf, size) != size)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", gettext (\"write error\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, "%s", gettext ("write error")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, "%s", gettext ("write error")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
lbuf.end = lbuf.buf;
}
| void lbuf_flush(void)
{
long lVar1;
undefined8 uVar2;
int *piVar3;
long lVar4;
lVar4 = lbuf._8_8_ - lbuf._0_8_;
lVar1 = full_write(1,lbuf._0_8_,lVar4);
if (lVar4 != lVar1) {
uVar2 = gettext("write error");
piVar3 = __errno_location();
error(1,*piVar3,&DAT_00108654,uVar2);
}
lbuf._8_8_ = lbuf._0_8_;
return;
}
|
int
sshbuf_allocate(struct sshbuf *buf, size_t len)
{
size_t rlen, need;
u_char *dp;
int r;
;
if ((r = sshbuf_check_reserve(buf, len)) != 0)
return r;
sshbuf_maybe_pack(buf, buf->size + len > buf->max_size);
;
if (len + buf->size <= buf->alloc)
return 0;
need = len + buf->size - buf->alloc;
rlen = ((((buf->alloc + need)+((256)-1))/(256))*(256));
;
if (rlen > buf->max_size)
rlen = buf->alloc + need;
;
if ((dp = recallocarray(buf->d, buf->alloc, rlen, 1)) ==
((void *)0)
) {
;
return -2;
}
buf->alloc = rlen;
buf->cd = buf->d = dp;
if ((r = sshbuf_check_reserve(buf, len)) < 0) {
return r;
}
;
return 0;
}
| int sshbuf_allocate(unsigned long long a0[6], unsigned int a1) {
unsigned int v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned long v5;
v0 = sshbuf_check_reserve(a0, a1);
if (v0) {
v5 = v0;
return v5;
}
sshbuf_maybe_pack(a0, !(a0[3] + a1 <= a0[4]));
if (a0[3] + a1 <= a0[5]) {
v5 = 0;
return v5;
}
v2 = a0[3] + a1 - a0[5];
v5 = v2 + a0[5] + 255;
*(&v5) = 0;
v1 = v5;
if (v1 > a0[4])
v1 = v2 + a0[5];
v3 = recallocarray(a0[0], a0[5], v1, 0x1);
if (!v3) {
*(&v5) = -2;
return v5;
}
a0[5] = v1;
a0[0] = v3;
a0[1] = a0[0];
v0 = sshbuf_check_reserve(a0, a1);
*(&v5) = (v0 < 0 ? 0 : v0);
return v5;
}
|
static void
server_init_dispatch(struct ssh *ssh)
{
sshlog("serverloop.c", __func__, 916, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "server_init_dispatch");
ssh_dispatch_init(ssh, &dispatch_protocol_error);
ssh_dispatch_set(ssh, 97, &channel_input_oclose);
ssh_dispatch_set(ssh, 94, &channel_input_data);
ssh_dispatch_set(ssh, 96, &channel_input_ieof);
ssh_dispatch_set(ssh, 95, &channel_input_extended_data);
ssh_dispatch_set(ssh, 90, &server_input_channel_open);
ssh_dispatch_set(ssh, 91, &channel_input_open_confirmation);
ssh_dispatch_set(ssh, 92, &channel_input_open_failure);
ssh_dispatch_set(ssh, 98, &server_input_channel_req);
ssh_dispatch_set(ssh, 93, &channel_input_window_adjust);
ssh_dispatch_set(ssh, 80, &server_input_global_request);
ssh_dispatch_set(ssh, 99, &server_input_keep_alive);
ssh_dispatch_set(ssh, 100, &server_input_keep_alive);
ssh_dispatch_set(ssh, 81, &server_input_keep_alive);
ssh_dispatch_set(ssh, 82, &server_input_keep_alive);
ssh_dispatch_set(ssh, 20, &kex_input_kexinit);
}
| void server_init_dispatch(unsigned long long a0) {
unsigned long long v1;
sshlog("serverloop.c", "server_init_dispatch", 0x394, 0x0, 0x5, 0x0, "server_init_dispatch");
ssh_dispatch_init(a0, got.dispatch_protocol_error, got.dispatch_protocol_error);
ssh_dispatch_set(a0, 0x61, got.channel_input_oclose);
ssh_dispatch_set(a0, 0x5e, got.channel_input_data);
ssh_dispatch_set(a0, 0x60, got.channel_input_ieof);
ssh_dispatch_set(a0, 0x5f, got.channel_input_extended_data);
ssh_dispatch_set(a0, 0x5a, server_input_channel_open);
ssh_dispatch_set(a0, 0x5b, got.channel_input_open_confirmation);
ssh_dispatch_set(a0, 0x5c, got.channel_input_open_failure);
ssh_dispatch_set(a0, 0x62, server_input_channel_req);
ssh_dispatch_set(a0, 0x5d, got.channel_input_window_adjust);
ssh_dispatch_set(a0, 0x50, server_input_global_request);
ssh_dispatch_set(a0, 0x63, server_input_keep_alive);
ssh_dispatch_set(a0, 0x64, server_input_keep_alive);
ssh_dispatch_set(a0, 0x51, server_input_keep_alive);
ssh_dispatch_set(a0, 0x52, server_input_keep_alive);
v1 = ssh_dispatch_set(a0, 0x14, got.kex_input_kexinit);
return;
}
|
static inline const char *rta_getattr_str(const struct rtattr *rta)
{
return (const char *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| int rta_getattr_str(unsigned long a0) {
return a0 + 4;
}
|
static void new_spent (struct spwd *spent)
{
if (lflg) {
if (spw_locate (user_newname) !=
((void *)0)
) {
fprintf (
stderr
,
gettext ("%s: user '%s' already exists in %s\n"),
Prog, user_newname, spw_dbname ());
fail_exit (9);
}
spent->sp_namp = xstrdup (user_newname);
}
if (fflg) {
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
6
, "change user '%s' inactive from '%ld' to '%ld'", spent->sp_namp, spent->sp_inact, user_newinactive) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
)
;
spent->sp_inact = user_newinactive;
}
if (eflg) {
char new_exp[16], old_exp[16];
date_to_str (sizeof(new_exp), new_exp, user_newexpire * (24L*3600L));
date_to_str (sizeof(old_exp), old_exp, user_expire * (24L*3600L));
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
6
, "change user '%s' expiration from '%s' to '%s'", spent->sp_namp, old_exp, new_exp) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
)
;
spent->sp_expire = user_newexpire;
}
spent->sp_pwdp = new_pw_passwd (spent->sp_pwdp);
if (pflg) {
spent->sp_lstchg = (long) gettime () / (24L*3600L);
if (0 == spent->sp_lstchg) {
spent->sp_lstchg = -1;
}
}
}
| void new_spent(unsigned long long a0[8], unsigned long long a1, unsigned long long a2, unsigned long long a3) {
void* v0;
void* v1;
char *v2;
char *v3;
char v4;
char v5;
char v6;
unsigned long long v9;
unsigned long long *v11;
unsigned long long v12;
if (lflg) {
if (spw_locate(user_newname)) {
v9 = spw_dbname();
fprintf(stderr, gettext("%s: user '%s' already exists in %s\n"));
fail_exit(0x9);
}
a2 = a0;
*(&a0[0]) = xstrdup(user_newname, a1, a2, a3);
}
if (fflg) {
v2 = setlocale(0x6, NULL);
v0 = 0;
if (v2)
v0 = strdup(v2);
if (v0)
setlocale(0x6, "C");
a3 = a0[6];
syslog(0x6, "change user '%s' inactive from '%ld' to '%ld'");
if (v0) {
setlocale(0x6, v0);
free(v0);
}
a2 = user_newinactive;
a0[6] = user_newinactive;
}
if (eflg) {
date_to_str(0x10, &v4, user_newexpire * 86400);
date_to_str(0x10, &v5, user_expire * 86400);
v3 = setlocale(0x6, NULL);
v1 = 0;
if (v3)
v1 = strdup(v3);
if (v1)
setlocale(0x6, "C");
a3 = &v5;
syslog(0x6, "change user '%s' expiration from '%s' to '%s'");
if (v1) {
setlocale(0x6, v1);
free(v1);
}
a2 = user_newexpire;
a0[7] = user_newexpire;
}
a0[1] = new_pw_passwd(a0[1], a1, a2, a3);
if (pflg) {
a0[2] = (gettime() * 1749024623285053783 >> 64 >> 13) - (gettime() >> 63);
if (!a0[2])
a0[2] = -1;
}
v12 = *(&v6) ^ v11[5];
return;
}
|
int
_rl_vi_domove_motion_cleanup (int c, _rl_vimotion_cxt *m)
{
int r;
rl_end = m->end;
rl_line_buffer[rl_end] = '\0';
_rl_fix_point (0);
if (rl_mark == rl_point)
{
if (((1 && (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)m->key
))] & (unsigned short int) _ISlower)
)) ? toupper((unsigned char)(m->key)) : (m->key)) == 'C' && _rl_vi_motion_command (c))
return (vidomove_dispatch (m));
(rl_readline_state &= ~(0x0100000));
return (-1);
}
if ((((1 && (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)c
))] & (unsigned short int) _ISlower)
)) ? toupper((unsigned char)(c)) : (c)) == 'W') && rl_point < rl_end && rl_point > rl_mark &&
!(((rl_line_buffer[rl_point]) == ' ') || ((rl_line_buffer[rl_point]) == '\t')))
rl_point--;
if (m->key == 'c' && rl_point >= rl_mark && (((1 && (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)c
))] & (unsigned short int) _ISlower)
)) ? toupper((unsigned char)(c)) : (c)) == 'W'))
{
while (rl_point > rl_mark && (((rl_line_buffer[rl_point]) == ' ') || ((rl_line_buffer[rl_point]) == '\t')))
rl_point--;
if (rl_point == rl_mark)
_rl_vi_advance_point ();
else
{
if (rl_point >= 0 && rl_point < (rl_end - 1) && !(((rl_line_buffer[rl_point]) == ' ') || ((rl_line_buffer[rl_point]) == '\t')))
_rl_vi_advance_point ();
}
}
if (rl_mark < rl_point)
do { int t; t = rl_point; rl_point = rl_mark; rl_mark = t; } while (0);
if ((rl_readline_state & (0x0080000)))
(*rl_redisplay_function)();
r = vidomove_dispatch (m);
return (r);
}
| void _rl_vi_domove_motion_cleanup(unsigned long a0, unsigned int a1[8], unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
unsigned int v4;
unsigned int v6;
unsigned long long v7;
unsigned long long v8;
unsigned int v9;
unsigned long long v10;
unsigned long long v11;
rl_end = a1[6];
*((rl_end + rl_line_buffer)) = 0;
_rl_fix_point(0x0);
if (rl_mark != rl_point) {
v6 = *((*(__ctype_b_loc()) + a0 * 2)) & 0x200;
*(&v6) = (!v6 ? toupper(a0) == 87 : a0 == 87);
if (v6 && rl_point < rl_end && rl_point > rl_mark) {
switch (*((rl_point + rl_line_buffer))) {
case 9: case 32:
break;
default:
rl_point = rl_point - 1;
break;
}
}
if (a1[7] == 99 && rl_point >= rl_mark) {
*(&v6) = *((*(__ctype_b_loc()) + a0 * 2));
v9 = v6 & 0x200;
*(&v9) = (!v9 ? toupper(a0) == 87 : a0 == 87);
if (v9) {
while (true) {
if (rl_point <= rl_mark)
break;
switch (*((rl_point + rl_line_buffer))) {
case 9: case 32:
rl_point = rl_point - 1;
break;
default:
goto LABEL_402414;
}
}
LABEL_402414:
if (rl_point == rl_mark) {
_rl_vi_advance_point();
} else if (rl_point >= 0 && rl_end - 1 > rl_point) {
switch (*((rl_point + rl_line_buffer))) {
case 9: case 32:
break;
default:
_rl_vi_advance_point();
}
}
}
}
v10 = rl_mark;
if (rl_mark < rl_point) {
v0 = rl_point;
rl_point = rl_mark;
rl_mark = v0;
}
if ((rl_readline_state & 0x80000))
*(5243464)();
v1 = vidomove_dispatch(a1, a1, v10, a3, a4, a5);
v11 = v1;
return;
} else {
v4 = *((a1[7] * 2 + *(__ctype_b_loc()))) & 0x200;
*(&v4) = (!v4 ? toupper(a1[7]) == 67 : a1[7] == 67);
if (v4 && _rl_vi_motion_command(a0)) {
v8 = vidomove_dispatch(a1, a1, a2, a3, a4, a5);
return;
}
rl_readline_state = rl_readline_state & -1048577;
v7 = 4294967295;
return;
}
}
|
static int
openssh_RSA_verify(int hash_alg, u_char *hash, size_t hashlen,
u_char *sigbuf, size_t siglen, RSA *rsa)
{
size_t rsasize = 0, oidlen = 0, hlen = 0;
int ret, len, oidmatch, hashmatch;
const u_char *oid =
((void *)0)
;
u_char *decrypted =
((void *)0)
;
if ((ret = rsa_hash_alg_oid(hash_alg, &oid, &oidlen)) != 0)
return ret;
ret = -1;
hlen = ssh_digest_bytes(hash_alg);
if (hashlen != hlen) {
ret = -10;
goto done;
}
rsasize = RSA_size(rsa);
if (rsasize <= 0 || rsasize > (16384 / 8) ||
siglen == 0 || siglen > rsasize) {
ret = -10;
goto done;
}
if ((decrypted = malloc(rsasize)) ==
((void *)0)
) {
ret = -2;
goto done;
}
if ((len = RSA_public_decrypt(siglen, sigbuf, decrypted, rsa,
1
)) < 0) {
ret = -22;
goto done;
}
if (len < 0 || (size_t)len != hlen + oidlen) {
ret = -4;
goto done;
}
oidmatch = timingsafe_bcmp(decrypted, oid, oidlen) == 0;
hashmatch = timingsafe_bcmp(decrypted + oidlen, hash, hlen) == 0;
if (!oidmatch || !hashmatch) {
ret = -21;
goto done;
}
ret = 0;
done:
freezero(decrypted, rsasize);
return ret;
}
| int openssh_RSA_verify(unsigned long a0, unsigned long long a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
void* v4;
void* v5;
void* v6;
void* v7;
void* v8;
unsigned int v10;
v6 = 0;
v4 = 0;
v8 = 0;
v5 = 0;
v7 = 0;
v0 = rsa_hash_alg_oid(a0, &v5, &v4);
if (v0) {
v10 = v0;
return v10;
}
v0 = -1;
v8 = ssh_digest_bytes(a0);
if (a2 != v8) {
v0 = -10;
} else {
v6 = RSA_size(a5);
if (!v6 || v6 > 0x800 || !a4 || a4 > v6) {
v0 = -10;
} else {
v7 = malloc(v6);
if (!v7) {
v0 = -2;
} else {
v1 = RSA_public_decrypt(a4, a3, v7, a5, 0x1);
if (v1 < 0) {
v0 = -22;
} else if (v1 < 0 || v1 != v8 + v4) {
v0 = -0x4;
} else {
v2 = !timingsafe_bcmp(v7, v5, v4, v5);
v3 = !timingsafe_bcmp(v4 + v7, a1, v8, v4 + v7);
if (!v2 || !v3)
v0 = -21;
else
v0 = 0;
}
}
}
}
freezero(v7, v6, v6);
v10 = v0;
return v10;
}
|
gl_linked_search_from_to (gl_list_t list, size_t start_index, size_t end_index,
const void *elt)
{
size_t count = list->count;
if (!(start_index <= end_index && end_index <= count))
abort ();
{
gl_listelement_equals_fn equals = list->base.equals_fn;
gl_list_node_t node = list->root.next;
end_index -= start_index;
for (; start_index > 0; start_index--)
node = node->next;
if (equals !=
((void *)0)
)
{
for (; end_index > 0; node = node->next, end_index--)
if (equals (elt, node->value))
return node;
}
else
{
for (; end_index > 0; node = node->next, end_index--)
if (elt == node->value)
return node;
}
return
((void *)0)
;
}
}
| int gl_linked_search_from_to(unsigned long long a0[9], unsigned long a1, unsigned long a2, unsigned long long a3) {
unsigned long v0;
unsigned long v1;
unsigned long long v2[3];
unsigned long v3;
unsigned long long v4;
unsigned int v6;
v1 = a1;
v0 = a2;
v3 = a0[8];
if (v1 <= v0 && v0 <= v3) {
v4 = a0[1];
v2[0] = a0[5];
for (v0 -= v1; v1; v1 -= 1) {
v2[0] = v2[0];
}
if (v4) {
for (; v0; v0 -= 1) {
v6 = (stack_base)[16](a3, v2[2], v2[2], (stack_base)[16]);
if (v6) {
v6 = v2;
break;
} else {
v2[0] = v2[0];
}
}
} else {
for (; v0; v0 -= 1) {
if (a3 == v2[2]) {
v6 = v2;
break;
} else {
v2[0] = v2[0];
}
}
}
if (!v4 && !v0 || !v4 && a3 != v2[2] || !v6 && v4 || !v0 && v4)
v6 = 0;
return v6;
}
if (v0 > v3 || v1 > v0)
abort();
}
|
static int
mux_master_read_cb(struct ssh *ssh, Channel *c)
{
struct mux_master_state *state = (struct mux_master_state *)c->mux_ctx;
struct sshbuf *in =
((void *)0)
, *out =
((void *)0)
;
u_int type, rid, i;
int r, ret = -1;
if ((out = sshbuf_new()) ==
((void *)0)
)
sshfatal("mux.c", __func__, 1144, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new");
if (c->mux_ctx ==
((void *)0)
) {
state = xcalloc(1, sizeof(*state));
c->mux_ctx = state;
channel_register_cleanup(ssh, c->self,
mux_master_control_cleanup_cb, 0);
if ((r = sshbuf_put_u32(out, 0x00000001)) != 0 ||
(r = sshbuf_put_u32(out, 4)) != 0)
sshfatal("mux.c", __func__, 1156, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "reply");
if ((r = sshbuf_put_stringb(c->output, out)) != 0)
sshfatal("mux.c", __func__, 1159, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "enqueue");
sshlog("mux.c", __func__, 1160, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "channel %d: hello sent", c->self);
ret = 0;
goto out;
}
if ((r = sshbuf_froms(c->input, &in)) != 0) {
malf:
sshlog("mux.c", __func__, 1168, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "malformed message");
goto out;
}
if ((r = sshbuf_get_u32(in, &type)) != 0)
goto malf;
sshlog("mux.c", __func__, 1174, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "channel %d packet type 0x%08x len %zu", c->self, type, sshbuf_len(in))
;
if (type == 0x00000001)
rid = 0;
else {
if (!state->hello_rcvd) {
sshlog("mux.c", __func__, 1181, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "expected MUX_MSG_HELLO(0x%08x), " "received 0x%08x", 0x00000001, type)
;
goto out;
}
if ((r = sshbuf_get_u32(in, &rid)) != 0)
goto malf;
}
for (i = 0; mux_master_handlers[i].handler !=
((void *)0)
; i++) {
if (type == mux_master_handlers[i].type) {
ret = mux_master_handlers[i].handler(ssh, rid,
c, in, out);
break;
}
}
if (mux_master_handlers[i].handler ==
((void *)0)
) {
sshlog("mux.c", __func__, 1197, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "unsupported mux message 0x%08x", type);
reply_error(out, 0x80000003, rid, "unsupported request");
ret = 0;
}
if (sshbuf_len(out) != 0 &&
(r = sshbuf_put_stringb(c->output, out)) != 0)
sshfatal("mux.c", __func__, 1204, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "enqueue");
out:
sshbuf_free(in);
sshbuf_free(out);
return ret;
}
| long long mux_master_read_cb(unsigned long long a0, struct_0 *a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
char v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
void* v5;
unsigned long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long v9;
char v10;
v6 = a1->field_150;
v5 = 0;
v7 = 0;
v4 = -1;
v7 = sshbuf_new(a0, a1, a2, a3, a4, a5);
if (!v7)
sshfatal("mux.c", "mux_master_read_cb", 0x478, 0x1, 0x1, 0x0, "sshbuf_new");
if (!a1->field_150) {
v6 = xcalloc(0x1, 0x4);
a1->field_150 = v6;
channel_register_cleanup(a0, a1->field_4, mux_master_control_cleanup_cb, 0x0);
v3 = sshbuf_put_u32(v7, 0x1);
if (!v3)
v3 = sshbuf_put_u32(v7, 0x4);
if (v3 || v3) {
v8 = "reply";
sshfatal("mux.c", "mux_master_read_cb", 0x484, 0x1, 0x1, ssh_err(v3), *(&v10));
}
v3 = sshbuf_put_stringb(a1->field_70, v7, v7);
if (v3) {
v8 = "enqueue";
sshfatal("mux.c", "mux_master_read_cb", 0x487, 0x1, 0x1, ssh_err(v3), *(&v10));
}
v9 = a1->field_4;
v8 = "channel %d: hello sent";
sshlog("mux.c", "mux_master_read_cb", 0x488, 0x1, 0x7, 0x0, *(&v10));
v4 = 0;
} else {
v3 = sshbuf_froms(a1->field_68, &v5, &v5);
if (!v3) {
v3 = sshbuf_get_u32(v5, &v0, &v0);
if (!v3) {
v9 = sshbuf_len(v5);
v8 = *(&v0);
v7 = a1->field_4;
v6 = "channel %d packet type 0x%08x len %zu";
sshlog("mux.c", "mux_master_read_cb", 0x496, 0x1, 0x7, 0x0, *(&v10));
if (*(&v0) == 1) {
v1 = 0;
} else if (!*(v6)) {
v8 = *(&v0);
v7 = 1;
v6 = "expected MUX_MSG_HELLO(0x%08x), received 0x%08x";
sshlog("mux.c", "mux_master_read_cb", 0x49d, 0x1, 0x2, 0x0, *(&v10));
} else {
v3 = sshbuf_get_u32(v5, &v1, &v1);
}
if ((!v3 || *(&v0) == 1) && (*(&v0) == 1 || *(v6))) {
for (v2 = 0; g_408e48[2 * v2]; v2 += 1) {
if (mux_master_handlers[4 * v2] == *(&v0)) {
v4 = g_408e48[2 * v2](a0, v1, a1, v5, v7, g_408e48[2 * v2]);
break;
}
}
if (!g_408e48[2 * v2]) {
v9 = *(&v0);
v8 = "unsupported mux message 0x%08x";
sshlog("mux.c", "mux_master_read_cb", 0x4ad, 0x1, 0x2, 0x0, *(&v10));
reply_error(v7, 0x80000003, v1, "unsupported request");
v4 = 0;
}
if (sshbuf_len(v7)) {
v3 = sshbuf_put_stringb(a1->field_70, v7, v7);
if (v3) {
v8 = "enqueue";
sshfatal("mux.c", "mux_master_read_cb", 0x4b4, 0x1, 0x1, ssh_err(v3), *(&v10));
}
}
}
}
}
if (v3 || v3 || v3 && *(v6) && *(&v0) != 1) {
v8 = "malformed message";
sshlog("mux.c", "mux_master_read_cb", 0x490, 0x1, 0x2, 0x0, *(&v10));
}
}
sshbuf_free(v5);
sshbuf_free(v7);
return v4;
}
|
static
time_t get_date(const char* date)
{
struct timespec r;
if (date==
((void *)0)
|| parse_datetime(&r, date,
((void *)0)
) == 0) {
if (sizeof(time_t) < 8) fprintf(
stderr
, "This system expresses time with a 32-bit time_t; that prevents dates after 2038 to be expressed by GnuTLS.\n");
fprintf(
stderr
, "Cannot parse date: %s\n", date);
exit(1);
}
return r.tv_sec;
}
| long get_date(const char *a1)
{
long v2[4];
v2[3] = __readfsqword(0x28u);
if ( !a1 || (unsigned char)parse_datetime(v2, a1, 0LL) != 1 )
{
fprintf(stderr, "Cannot parse date: %s\n", a1);
exit(1);
}
return v2[0];
}
|
static void
output_primes (const struct prime *primes, unsigned nprimes)
{
unsigned i;
unsigned p;
int is_prime;
unsigned wide_uint_bits = 0;
wide_uint mask = -1;
for (wide_uint_bits = 0; mask; wide_uint_bits++)
mask >>= 1;
puts ("\n");
printf ("#define WIDE_UINT_BITS %u\n", wide_uint_bits);
for (i = 0, p = 2; i < nprimes; i++)
{
unsigned int d8 = i + 8 < nprimes ? primes[i + 8].p - primes[i].p : 0xff;
if (255 < d8)
abort ();
printf ("P (%u, %u,\n (", primes[i].p - p, d8);
print_wide_uint (primes[i].pinv, 0, wide_uint_bits);
printf ("),\n UINTMAX_MAX / %u)\n", primes[i].p);
p = primes[i].p;
}
printf ("\n#undef FIRST_OMITTED_PRIME\n");
do
{
p += 2;
for (i = 0, is_prime = 1; is_prime; i++)
{
if (primes[i].p * primes[i].p > p)
break;
if (p * primes[i].pinv <= primes[i].lim)
{
is_prime = 0;
break;
}
}
}
while (!is_prime);
printf ("#define FIRST_OMITTED_PRIME %u\n", p);
}
| void output_primes(unsigned int *a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned long long v5;
unsigned long long v6;
unsigned int v8;
unsigned long long v9;
v3 = 0;
v5 = -1;
v6 = -1;
for (v3 = 0; !(!v6) || !(!v5); v3 += 1) {
v5 = v5 >> 1 | v6 * 0x8000000000000000;
v6 >>= 1;
}
puts("\n");
printf("#define WIDE_UINT_BITS %u\n", v3);
v0 = 0;
v1 = 2;
while (true) {
if (v0 < a1) {
if (a1 <= v0 + 8)
v8 = 255;
else
v8 = a0[96 + 12 * v0] - a0[12 * v0];
v4 = v8;
if (v4 > 255)
abort();
printf("P (%u, %u,\n (", a0[12 * v0] - v1, v4);
print_wide_uint(*(&a0[4 + 12 * v0]), *(&a0[6 + 12 * v0]), 0x0, v3);
printf("),\n UINTMAX_MAX / %u)\n", a0[12 * v0]);
v1 = a0[12 * v0];
v0 += 1;
} else {
printf("\n#undef FIRST_OMITTED_PRIME\n");
do {
v1 += 2;
v0 = 0;
v2 = 1;
while (true) {
if (!v2)
break;
if (v1 < a0[8 * v0 + 4 * v0] * a0[8 * v0 + 4 * v0])
break;
if ([D] amd64g_calculate_condition(0x2<64>, 0x10<64>, Load(addr=((rdi<8> + (((Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE)) << 0x1<8>) + Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE))) << 0x4<8>)) + 0x28<64>), size=8, endness=Iend_LE), Xor((((Conv(32->64, Load(addr=stack_base-72, size=4, endness=Iend_LE)) * Load(addr=((rdi<8> + (((Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE)) << 0x1<8>) + Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE))) << 0x4<8>)) + 0x18<64>), size=8, endness=Iend_LE)) + (Load(addr=((rdi<8> + (((Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE)) << 0x1<8>) + Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE))) << 0x4<8>)) + 0x10<64>), size=8, endness=Iend_LE) * 0x0<64>)) + Conv(128->64, ((Load(addr=((rdi<8> + (((Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE)) << 0x1<8>) + Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE))) << 0x4<8>)) + 0x10<64>), size=8, endness=Iend_LE) Mull Conv(32->64, Load(addr=stack_base-72, size=4, endness=Iend_LE))) >> 0x40<8>))), Conv(1->64, (Load(addr=((rdi<8> + (((Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE)) << 0x1<8>) + Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE))) << 0x4<8>)) + 0x20<64>), size=8, endness=Iend_LE) < Conv(128->64, (Load(addr=((rdi<8> + (((Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE)) << 0x1<8>) + Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE))) << 0x4<8>)) + 0x10<64>), size=8, endness=Iend_LE) Mull Conv(32->64, Load(addr=stack_base-72, size=4, endness=Iend_LE))))))), Conv(1->64, (Load(addr=((rdi<8> + (((Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE)) << 0x1<8>) + Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE))) << 0x4<8>)) + 0x20<64>), size=8, endness=Iend_LE) < Conv(128->64, (Load(addr=((rdi<8> + (((Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE)) << 0x1<8>) + Conv(32->64, Load(addr=stack_base-76, size=4, endness=Iend_LE))) << 0x4<8>)) + 0x10<64>), size=8, endness=Iend_LE) Mull Conv(32->64, Load(addr=stack_base-72, size=4, endness=Iend_LE)))))))) {
v0 += 1;
} else {
v2 = 0;
break;
}
}
} while (!v2);
v9 = printf("#define FIRST_OMITTED_PRIME %u\n", v1);
return;
}
}
}
|
static
_Bool
dev_ino_compare (void const *x, void const *y)
{
struct dev_ino const *a = x;
struct dev_ino const *b = y;
return ((*a).st_ino == (*b).st_ino && (*a).st_dev == (*b).st_dev) ?
1
:
0
;
}
| undefined4 dev_ino_compare(long *param_1,long *param_2)
{
undefined4 uVar1;
if ((*param_1 == *param_2) && (param_1[1] == param_2[1])) {
uVar1 = 1;
}
else {
uVar1 = 0;
}
return uVar1;
}
|
int
main (int argc, char **argv)
{
_Bool
ok =
1
;
int optc;
;
set_program_name (argv[0]);
setlocale (
6
, "");
bindtextdomain ("coreutils", "/usr/local/share/locale");
textdomain ("coreutils");
atexit (close_stdout);
remove_empty_parents =
0
;
while ((optc = getopt_long (argc, argv, "pv", longopts,
((void *)0)
)) != -1)
{
switch (optc)
{
case 'p':
remove_empty_parents =
1
;
break;
case IGNORE_FAIL_ON_NON_EMPTY_OPTION:
ignore_fail_on_non_empty =
1
;
break;
case 'v':
verbose =
1
;
break;
case GETOPT_HELP_CHAR: usage (
0
); break;;
case GETOPT_VERSION_CHAR: version_etc (
stdout
, "rmdir", "GNU coreutils", Version, ("David MacKenzie"), (char *)
((void *)0)
); exit (
0
); break;;
default:
usage (
1
);
}
}
if (optind == argc)
{
error (0, 0, gettext ("missing operand"));
usage (
1
);
}
for (; optind < argc; ++optind)
{
char *dir = argv[optind];
if (verbose)
prog_fprintf (
stdout
, gettext ("removing directory, %s"), quotearg_style (shell_escape_always_quoting_style, dir));
if (rmdir (dir) != 0)
{
int rmdir_errno =
(*__errno_location ())
;
if (ignorable_failure (rmdir_errno, dir))
continue;
_Bool
custom_error =
0
;
if (rmdir_errno ==
20
)
{
char const *last_unix_slash = strrchr (dir, '/');
if (last_unix_slash && (*(last_unix_slash + 1) == '\0'))
{
struct stat st;
int ret = stat (dir, &st);
if ((ret != 0 &&
(*__errno_location ())
!=
20
)
|| (ret == 0 &&
((((
st.st_mode
)) & 0170000) == (0040000))
))
{
char *dir_arg = xstrdup (dir);
strip_trailing_slashes (dir);
ret = lstat (dir, &st);
if (ret == 0 &&
((((
st.st_mode
)) & 0170000) == (0120000))
)
{
error (0, 0,
gettext ("failed to remove %s:" " Symbolic link not followed")
,
quotearg_style (shell_escape_always_quoting_style, dir_arg));
custom_error =
1
;
}
free (dir_arg);
}
}
}
if (! custom_error)
error (0, rmdir_errno, gettext ("failed to remove %s"), quotearg_style (shell_escape_always_quoting_style, dir));
ok =
0
;
}
else if (remove_empty_parents)
{
ok &= remove_parents (dir);
}
}
return ok ?
0
:
1
;
}
| byte main(int param_1,undefined8 *param_2)
{
char *__path;
bool bVar1;
char cVar2;
byte bVar3;
int iVar4;
int iVar5;
undefined8 uVar6;
undefined8 uVar7;
int *piVar8;
char *pcVar9;
void *__ptr;
long in_FS_OFFSET;
bool local_de;
stat local_b8;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
local_de = true;
set_program_name(*param_2);
setlocale(6,"");
bindtextdomain("coreutils","/usr/local/share/locale");
textdomain("coreutils");
atexit(p_Ram00000000001007b8);
remove_empty_parents = '\0';
LAB_001008a0:
while( true ) {
iVar4 = getopt_long(param_1,param_2,&DAT_0010106f,longopts,0);
if (iVar4 == -1) {
if (param_1 != optind) goto LAB_00100bc2;
uVar6 = gettext("missing operand");
error(0,0,uVar6);
usage(1);
do {
__path = (char *)param_2[optind];
if (verbose != '\0') {
uVar6 = quotearg_style(4,__path);
uVar7 = gettext("removing directory, %s");
prog_fprintf(stdout,uVar7,uVar6);
}
iVar4 = rmdir(__path);
if (iVar4 == 0) {
if (remove_empty_parents != '\0') {
bVar3 = remove_parents(__path);
local_de = (bVar3 & local_de) != 0;
}
}
else {
piVar8 = __errno_location();
iVar4 = *piVar8;
cVar2 = ignorable_failure(iVar4,__path);
if (cVar2 == '\0') {
bVar1 = false;
if ((((iVar4 == 0x14) && (pcVar9 = strrchr(__path,0x2f), pcVar9 != (char *)0x0)) &&
(pcVar9[1] == '\0')) &&
(((iVar5 = stat(__path,&local_b8), iVar5 != 0 &&
(piVar8 = __errno_location(), *piVar8 != 0x14)) ||
((iVar5 == 0 && ((local_b8.st_mode & 0xf000) == 0x4000)))))) {
__ptr = (void *)xstrdup(__path);
strip_trailing_slashes(__path);
iVar5 = lstat(__path,&local_b8);
if ((iVar5 == 0) && ((local_b8.st_mode & 0xf000) == 0xa000)) {
uVar6 = quotearg_style(4,__ptr);
uVar7 = gettext("failed to remove %s: Symbolic link not followed");
error(0,0,uVar7,uVar6);
bVar1 = true;
}
free(__ptr);
}
if (!bVar1) {
uVar6 = quotearg_style(4,__path);
uVar7 = gettext("failed to remove %s");
error(0,iVar4,uVar7,uVar6);
}
local_de = false;
}
}
optind = optind + 1;
LAB_00100bc2:
} while (optind < param_1);
if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) {
return local_de ^ 1;
}
__stack_chk_fail();
}
if (iVar4 != 0x80) break;
ignore_fail_on_non_empty = 1;
}
if (iVar4 < 0x81) {
if (iVar4 == 0x76) {
verbose = '\x01';
goto LAB_001008a0;
}
if (0x76 < iVar4) goto LAB_00100896;
if (iVar4 == 0x70) {
remove_empty_parents = '\x01';
goto LAB_001008a0;
}
if (iVar4 < 0x71) {
if (iVar4 == -0x83) {
LAB_00100853:
version_etc(stdout,"rmdir","GNU coreutils",Version,"David MacKenzie",0);
exit(0);
}
if (iVar4 == -0x82) {
usage(0);
goto LAB_00100853;
}
}
}
LAB_00100896:
usage();
goto LAB_001008a0;
}
|
static int print_af_stats(struct nlmsghdr *n, void *arg)
{
struct if_stats_msg *ifsm = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
struct rtattr *tb[(__IFLA_STATS_MAX - 1)+1];
int len = n->nlmsg_len;
struct af_stats_ctx *ctx = arg;
FILE *fp = ctx->fp;
len -= ((sizeof(*ifsm)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )));
if (len < 0) {
fprintf(
stderr
, "BUG: wrong nlmsg len %d\n", len);
return -1;
}
if (ctx->ifindex && ifsm->ifindex != ctx->ifindex)
return 0;
parse_rtattr(tb, (__IFLA_STATS_MAX - 1), ((struct rtattr *)(((char *)(ifsm)) + ( ((sizeof(struct if_stats_msg))+4U -1) & ~(4U -1) ))), len);
if (tb[IFLA_STATS_AF_SPEC])
print_af_stats_attr(fp, ifsm->ifindex, tb[IFLA_STATS_AF_SPEC]);
fflush(fp);
return 0;
}
| long long print_af_stats(unsigned int *a0, struct_0 *a1, unsigned long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
struct_1 *v1;
void* v2;
char v3;
char v4;
unsigned long long v6;
v1 = &a0[4];
v0 = *(a0);
v2 = a1->field_0;
v0 -= 28;
if (v0 < 0) {
fprintf(stderr, "BUG: wrong nlmsg len %d\n", v0);
v6 = 4294967295;
return v6;
}
if (a1->field_8 && v1->field_4 != a1->field_8) {
v6 = 0;
return v6;
}
parse_rtattr(&v3, 0x5, &v1[1].field_4, v0);
if (*(&v4))
print_af_stats_attr(v2, v1->field_4, *(&v4), v1->field_4, a4, a5);
fflush(v2);
v6 = 0;
return v6;
}
|
static WORD_LIST *
expand_oneword (value, flags)
char *value;
int flags;
{
WORD_LIST *l, *nl;
char *t;
int kvpair;
if (flags == 0)
{
l = expand_compound_array_assignment ((SHELL_VAR *)
((void *)0)
, value, flags);
quote_compound_array_list (l, flags);
return l;
}
else
{
l = parse_string_to_word_list (value, 1, "array assign");
kvpair = kvpair_assignment_p (l);
for (nl = l; nl; nl = nl->next)
{
if (kvpair)
t = expand_and_quote_kvpair_word (nl->word->word);
else
if ((nl->word->flags & (1 << 2)) == 0)
t = sh_single_quote (nl->word->word ? nl->word->word : "");
else
t = expand_and_quote_assoc_word (nl->word->word, flags);
sh_xfree((nl->word->word), "subst.c", 12557);
nl->word->word = t;
}
return l;
}
}
| long expand_oneword(long a1, unsigned int a2)
{
const char *v3;
int v4;
long i;
long v6;
long v7;
long v8;
if ( a2 )
{
v8 = parse_string_to_word_list(a1, 1LL, "array assign");
v4 = kvpair_assignment_p(v8);
for ( i = v8; i; i = *(_QWORD *)i )
{
if ( v4 )
{
v6 = expand_and_quote_kvpair_word(**(_QWORD **)(i + 8));
}
else if ( (*(_DWORD *)(*(_QWORD *)(i + 8) + 8LL) & 4) != 0 )
{
v6 = expand_and_quote_assoc_word(**(_QWORD **)(i + 8), a2);
}
else
{
if ( **(_QWORD **)(i + 8) )
v3 = **(const char ***)(i + 8);
else
v3 = &src;
v6 = sh_single_quote(v3);
}
sh_xfree(**(_QWORD **)(i + 8), "subst.c", 12557LL);
**(_QWORD **)(i + 8) = v6;
}
return v8;
}
else
{
v7 = expand_compound_array_assignment(0LL, a1, 0LL);
quote_compound_array_list(v7, 0LL);
return v7;
}
}
|
(*__errno_location ())
= save_errno;
tried = 1;
} else {
| int * __errno_location(void)
{
halt_baddata();
}
|
void
remove_delayed_set_stat (const char *fname)
{
struct delayed_set_stat *data, *next, *prev =
((void *)0)
;
for (data = delayed_set_stat_head; data; data = next)
{
next = data->next;
if (chdir_current == data->change_dir
&& strcmp (data->file_name, fname) == 0)
{
free_delayed_set_stat (data);
if (prev)
prev->next = next;
else
delayed_set_stat_head = next;
return;
}
else
prev = data;
}
}
| long long remove_delayed_set_stat(char *a0) {
void* v0;
void* v1;
void* v2;
void* v4;
v1 = 0;
v4 = delayed_set_stat_head;
v0 = delayed_set_stat_head;
while (true) {
if (!v0)
break;
v2 = *(v0);
if (v0[92] == chdir_current && !strcmp(v0[160], a0)) {
free_delayed_set_stat(v0);
if (!v1) {
v4 = v2;
delayed_set_stat_head = v2;
break;
} else {
v4 = v1;
*(v1) = v2;
break;
}
}
v1 = v0;
v4 = v2;
v0 = v2;
}
return v4;
}
|
static int xvasprintf(char **sp, size_t size, const char *f, va_list ap)
{
char *s;
int len;
va_list ap2;
__builtin_va_copy(
ap2
,
ap
)
;
len = xvsnprintf(*sp, size, f, ap2);
__builtin_va_end(
ap2
)
;
if (len < 0)
sh_error("xvsnprintf failed");
if (len < size)
return len;
s = stalloc((len >= stacknleft ? len : stacknleft) + 1);
*sp = s;
len = xvsnprintf(s, len + 1, f, ap);
return len;
}
| int xvasprintf(unsigned long long *a0, unsigned long a1, char *a2, unsigned long long a3[3]) {
unsigned int v0;
char *v1;
unsigned long v2;
unsigned long v3;
unsigned long v4;
unsigned long long v6;
unsigned long v7;
v2 = a3[0];
v3 = a3[1];
v4 = a3[2];
v0 = xvsnprintf(*(a0), a1, a2, &v2);
if (v0 < 0)
sh_error("xvsnprintf failed");
if (a1 > v0) {
v7 = v0;
} else {
v6 = stacknleft;
if (stacknleft <= v0)
v6 = v0;
v7 = v6 + 1;
v1 = stalloc(v7);
*(a0) = v1;
v0 = xvsnprintf(v1, v0 + 1, a2, a3);
*(&v7) = v0;
}
return v7;
}
|
int
rl_print_last_kbd_macro (int count, int ignore)
{
char *m;
if (current_macro == 0)
{
rl_ding ();
return 0;
}
m = _rl_untranslate_macro_value (current_macro, 1);
rl_crlf ();
printf ("%s", m);
fflush (
stdout
);
rl_crlf ();
if (m) free (m);
rl_forced_update_display ();
rl_display_fixed = 1;
return 0;
}
| long long rl_print_last_kbd_macro(unsigned long long a0, unsigned long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
void* v2;
v1 = a0;
v0 = a1;
if (!current_macro) {
rl_ding();
} else {
v2 = _rl_untranslate_macro_value(current_macro, 0x1);
rl_crlf(a0, 0x1, a2, a3, a4, a5);
printf("%s", v2);
fflush(stdout);
rl_crlf(a0, v2, a2, a3, a4, a5);
if (v2)
free(v2);
rl_forced_update_display();
rl_display_fixed = 1;
}
return 0;
}
|
static char *
path_strip(const char *path, const char *strip)
{
size_t len;
if (strip ==
((void *)0)
)
return (xstrdup(path));
len = strlen(strip);
if (strncmp(path, strip, len) == 0) {
if (strip[len - 1] != '/' && path[len] == '/')
len++;
return (xstrdup(path + len));
}
return (xstrdup(path));
}
| void path_strip(char *param_1,char *param_2)
{
int iVar1;
size_t local_10;
if (param_2 == (char *)0x0) {
xstrdup(param_1);
}
else {
local_10 = strlen(param_2);
iVar1 = strncmp(param_1,param_2,local_10);
if (iVar1 == 0) {
if ((param_2[local_10 - 1] != '/') && (param_1[local_10] == '/')) {
local_10 = local_10 + 1;
}
xstrdup(param_1 + local_10);
}
else {
xstrdup(param_1);
}
}
return;
}
|
void
ssh_packet_close(struct ssh *ssh)
{
ssh_packet_close_internal(ssh, 1);
}
| void ** ssh_packet_close(void **a1)
{
return ssh_packet_close_internal(a1, 1);
}
|
static inline char *
bad_cast (char const *s)
{
return (char *) s;
}
| undefined8 bad_cast(undefined8 param_1)
{
return param_1;
}
|
static int
sftpio(void *_bwlimit, size_t amount)
{
struct bwlimit *bwlimit = (struct bwlimit *)_bwlimit;
refresh_progress_meter(0);
if (bwlimit !=
((void *)0)
)
bandwidth_limit(bwlimit, amount);
return 0;
}
| long long sftpio(unsigned long long a0, unsigned long long a1) {
refresh_progress_meter(0x0);
if (a0)
bandwidth_limit(a0, a1, a1);
return 0;
}
|
void
_rl_erase_entire_line(void)
{
}
| long long _rl_erase_entire_line() {
unsigned long v1;
return v1;
}
|
void
skip_file (off_t size)
{
union block *x;
if (seekable_archive)
{
off_t nblk = seek_archive (size);
if (nblk >= 0)
size -= nblk * 512;
else
seekable_archive =
0
;
}
mv_size_left (size);
while (size > 0)
{
x = find_next_block ();
if (! x)
do { if (error_hook) error_hook (); error (0, 0, gettext ("Unexpected EOF in archive")); fatal_exit (); } while (0);
set_next_block_after (x);
size -= 512;
mv_size_left (size);
}
}
| void skip_file(unsigned long long a0, unsigned int a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v0;
unsigned long v1;
unsigned long long v2;
unsigned long long v4;
unsigned long long v5;
v0 = a0;
if (seekable_archive) {
v1 = seek_archive(v0);
if (!((v1 - 0 >> 63)))
v0 -= v1 * 0x200;
else
seekable_archive = 0;
}
v4 = mv_size_left(v0);
while (v0 > 0) {
v2 = find_next_block();
if (!v2) {
if (error_hook)
*(5243072)();
error(0x0, 0x0, gettext("Unexpected EOF in archive"));
fatal_exit(0x0, 0x0, a2, a3, a4, a5);
}
set_next_block_after(v2);
v0 -= 0x200;
v5 = mv_size_left(v0);
}
return;
}
|
static void
usage (void)
{
char const * const *p;
printf (gettext ("Usage: %s [OPTION]... FILES\n"), program_name);
printf ("%s\n\n", gettext ("Compare FILES line by line."));
fputs_unlocked (gettext ("Mandatory arguments to long options are mandatory for short options too.\n"),
stdout
)
;
for (p = option_help_msgid; *p; p++)
{
if (!**p)
putchar_unlocked ('\n');
else
{
char const *msg = gettext (*p);
char const *nl;
while ((nl = strchr (msg, '\n')))
{
int msglen = nl + 1 - msg;
((void) sizeof ((
msglen < 4096
) ? 1 : 0), __extension__ ({ if (
msglen < 4096
) ; else __assert_fail (
"msglen < 4096"
, "diff.c", 1016, __extension__ __PRETTY_FUNCTION__); }))
;
printf (" %.*s", msglen, msg);
msg = nl + 1;
}
printf (&" %s\n"[2 * (*msg != ' ' && *msg != '-')], msg);
}
}
emit_bug_reporting_address ();
}
| long usage()
{
long v0;
char *v1;
char *v2;
FILE *v3;
char *v4;
char *j;
int v7;
const char **i;
const char *s;
char *v10;
v0 = program_name;
v1 = gettext("Usage: %s [OPTION]... FILES\n");
printf(v1, v0);
v2 = gettext("Compare FILES line by line.");
printf("%s\n\n", v2);
v3 = stdout;
v4 = gettext("Mandatory arguments to long options are mandatory for short options too.\n");
fputs_unlocked(v4, v3);
for ( i = (const char **)option_help_msgid; *i; ++i )
{
if ( **i )
{
s = gettext(*i);
for ( j = strchr(s, 10); ; j = strchr(v10 + 1, 10) )
{
v10 = j;
if ( !j )
break;
v7 = (_DWORD)j + 1 - (_DWORD)s;
if ( v7 > 4095 )
_assert_fail("msglen < 4096", "diff.c", 0x3F8u, "usage");
printf(" %.*s", v7, s);
s = v10 + 1;
}
if ( *s == 32 || *s == 45 )
printf(" %s\n", s);
else
printf("%s\n", s);
}
else
{
putchar_unlocked(10);
}
}
return emit_bug_reporting_address();
}
|
static int
waitfd(int fd, int *timeoutp, short events)
{
struct pollfd pfd;
struct timeval t_start;
int oerrno, r;
pfd.fd = fd;
pfd.events = events;
for (; *timeoutp >= 0;) {
monotime_tv(&t_start);
r = poll(&pfd, 1, *timeoutp);
oerrno =
(*__errno_location ())
;
ms_subtract_diff(&t_start, timeoutp);
(*__errno_location ())
= oerrno;
if (r > 0)
return 0;
else if (r == -1 &&
(*__errno_location ())
!=
11
&&
(*__errno_location ())
!=
4
)
return -1;
else if (r == 0)
break;
}
(*__errno_location ())
=
110
;
return -1;
}
| int waitfd(unsigned long a0, unsigned int *a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned short v3;
char v4;
unsigned int v8;
v2 = a0;
v3 = a2;
while (true) {
if (*(a1) < 0)
break;
monotime_tv(&v4);
v0 = poll(&v2, 0x1, *(a1));
v1 = *(__errno_location());
ms_subtract_diff(&v4, a1);
*(__errno_location()) = v1;
if (v0 > 0) {
v8 = 0;
return v8;
}
if (v0 == -1 && *(__errno_location()) != 11 && *(__errno_location()) != 4) {
v8 = -1;
return v8;
}
if (!v0)
break;
}
*(__errno_location()) = 110;
v8 = -1;
return v8;
}
|
static void
checksigs (void)
{
int s = signal_received;
if (s)
{
cleanup (0);
untrapsig (s);
raise (s);
exit (2);
}
}
| long checksigs()
{
long result;
int sig;
result = (unsigned int)signal_received;
sig = signal_received;
if ( signal_received )
{
cleanup();
untrapsig(sig);
raise(sig);
exit(2);
}
return result;
}
|
xsum3 (size_t size1, size_t size2, size_t size3)
{
return xsum (xsum (size1, size2), size3);
}
| void xsum3(void)
{
halt_baddata();
}
|
test_code_t test_anonymous(gnutls_session_t session)
{
int ret;
sprintf(prio_str,
"NONE:" "+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL" ":%s:"
"+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":+ANON-DH:+ANON-ECDH:+CURVE-ALL:%s",
protocol_str, rest);
{ int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 1466)) != TEST_SUCCEED) { return _ret; } };
gnutls_credentials_set(session, GNUTLS_CRD_ANON, anon_cred);
ret = test_do_handshake(session);
if (ret == TEST_SUCCEED)
gnutls_dh_get_pubkey(session, &pubkey);
return ret;
}
| int test_anonymous(undefined8 param_1)
{
int iVar1;
sprintf(prio_str,
"NONE:+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC:+GOST28147-TC26Z-CNT:+COMP-NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT:+ANON-DH:+ANON-ECDH:+CURVE-ALL:%s"
,protocol_str,rest);
iVar1 = __gnutls_priority_set_direct(param_1,prio_str,0x5ba);
if (iVar1 == 0) {
gnutls_credentials_set(param_1,2,anon_cred);
iVar1 = test_do_handshake(param_1);
if (iVar1 == 0) {
gnutls_dh_get_pubkey(param_1,pubkey);
}
}
return iVar1;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.