input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
static VALUE *
eval2 (
_Bool
evaluate)
{
VALUE *l;
l = eval3 (evaluate);
while (
1
)
{
VALUE *r;
enum
{
less_than, less_equal, equal, not_equal, greater_equal, greater_than
} fxn;
_Bool
val =
0
;
if (nextarg ("<"))
fxn = less_than;
else if (nextarg ("<="))
fxn = less_equal;
else if (nextarg ("=") || nextarg ("=="))
fxn = equal;
else if (nextarg ("!="))
fxn = not_equal;
else if (nextarg (">="))
fxn = greater_equal;
else if (nextarg (">"))
fxn = greater_than;
else
return l;
r = eval3 (evaluate);
if (evaluate)
{
int cmp;
tostring (l);
tostring (r);
if (looks_like_integer (l->u.s) && looks_like_integer (r->u.s))
cmp = strintcmp (l->u.s, r->u.s);
else
{
(*__errno_location ())
= 0;
cmp = strcoll (l->u.s, r->u.s);
if (
(*__errno_location ())
)
{
error (0,
(*__errno_location ())
, gettext ("string comparison failed"));
error (0, 0, gettext ("set LC_ALL='C' to work around the problem"));
((!!sizeof (struct { _Static_assert (EXPR_INVALID, "verify_expr (" "EXPR_INVALID" ", " "(error (EXPR_INVALID, 0, gettext (\"the strings compared were %s and %s\"), quotearg_n_style (0, locale_quoting_style, l->u.s), quotearg_n_style (1, locale_quoting_style, r->u.s)), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXPR_INVALID, 0, gettext ("the strings compared were %s and %s"), quotearg_n_style (0, locale_quoting_style, l->u.s), quotearg_n_style (1, locale_quoting_style, r->u.s)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXPR_INVALID, 0, gettext ("the strings compared were %s and %s"), quotearg_n_style (0, locale_quoting_style, l->u.s), quotearg_n_style (1, locale_quoting_style, r->u.s)), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
}
switch (fxn)
{
case less_than: val = (cmp < 0); break;
case less_equal: val = (cmp <= 0); break;
case equal: val = (cmp == 0); break;
case not_equal: val = (cmp != 0); break;
case greater_equal: val = (cmp >= 0); break;
case greater_than: val = (cmp > 0); break;
default: abort ();
}
}
freev (l);
freev (r);
l = int_value (val);
}
}
| long eval2(char param_1)
{
byte bVar1;
char cVar2;
long lVar3;
int *piVar4;
undefined8 uVar5;
undefined8 uVar6;
undefined8 uVar7;
bool local_31;
uint local_30;
int local_2c;
long local_28;
local_28 = eval3(param_1);
do {
local_31 = false;
cVar2 = nextarg(&DAT_001029bb);
if (cVar2 == '\0') {
cVar2 = nextarg(&DAT_001029bd);
if (cVar2 == '\0') {
cVar2 = nextarg(&DAT_001029c0);
if (cVar2 == '\0') {
cVar2 = nextarg(&DAT_001029c2);
if (cVar2 == '\0') {
cVar2 = nextarg(&DAT_001029c5);
if (cVar2 == '\0') {
cVar2 = nextarg(&DAT_001029c8);
if (cVar2 == '\0') {
cVar2 = nextarg(&DAT_001029cb);
if (cVar2 == '\0') {
return local_28;
}
local_30 = 5;
}
else {
local_30 = 4;
}
}
else {
local_30 = 3;
}
goto LAB_00101af8;
}
}
local_30 = 2;
}
else {
local_30 = 1;
}
}
else {
local_30 = 0;
}
LAB_00101af8:
lVar3 = eval3(param_1);
if (param_1 != '\0') {
tostring(local_28);
tostring(lVar3);
cVar2 = looks_like_integer(*(undefined8 *)(local_28 + 8));
if (cVar2 == '\0') {
LAB_00101b74:
piVar4 = __errno_location();
*piVar4 = 0;
local_2c = strcoll(*(char **)(local_28 + 8),*(char **)(lVar3 + 8));
piVar4 = __errno_location();
if (*piVar4 != 0) {
uVar5 = gettext("string comparison failed");
piVar4 = __errno_location();
error(0,*piVar4,uVar5);
uVar5 = gettext("set LC_ALL=\'C\' to work around the problem");
error(0,0,uVar5);
uVar5 = quotearg_n_style(1,8,*(undefined8 *)(lVar3 + 8));
uVar6 = quotearg_n_style(0,8,*(undefined8 *)(local_28 + 8));
uVar7 = gettext("the strings compared were %s and %s");
error(2,0,uVar7,uVar6,uVar5);
}
}
else {
cVar2 = looks_like_integer(*(undefined8 *)(lVar3 + 8));
if (cVar2 == '\0') goto LAB_00101b74;
local_2c = strintcmp(*(undefined8 *)(local_28 + 8),*(undefined8 *)(lVar3 + 8));
}
if (5 < local_30) {
abort();
}
bVar1 = (byte)((uint)local_2c >> 0x18);
switch(local_30) {
case 0:
local_31 = (bool)(bVar1 >> 7);
break;
case 1:
local_31 = local_2c < 1;
break;
case 2:
local_31 = local_2c == 0;
break;
case 3:
local_31 = local_2c != 0;
break;
case 4:
local_31 = (bool)((byte)~bVar1 >> 7);
break;
case 5:
local_31 = 0 < local_2c;
}
}
freev(local_28);
freev(lVar3);
local_28 = int_value(local_31);
} while( true );
}
|
literal_clear(EditLine *el)
{
el_literal_t *l = &el->el_literal;
size_t i;
if (l->l_len == 0)
return;
for (i = 0; i < l->l_idx; i++)
free(l->l_buf[i]);
free(l->l_buf);
l->l_buf =
((void *)0)
;
l->l_len = 0;
l->l_idx = 0;
}
| void literal_clear(unsigned long a0) {
void* v0;
unsigned long long v1[3];
unsigned long long v3;
unsigned long long v4[3];
v1[0] = a0 + 848;
v3 = v1[2];
if (v1[2]) {
for (v0 = 0; v0 < v1[1]; v0 += 1) {
free(*((v1[0] + v0 * 8)));
}
free(v1[0]);
v1[0] = 0;
v1[2] = 0;
v4 = v1;
v1[1] = 0;
}
return;
}
|
int consolenames(struct real_cons *cons, int max_consoles)
{
unsigned int kdev;
struct stat st, st2;
char buf[4096];
char *p;
int didmount = 0;
int n;
int fd;
int considx, num_consoles = 0;
stat("/", &st);
if (stat("/proc", &st2) < 0) {
perror("bootlogd: /proc");
return 0;
}
if (st.st_dev == st2.st_dev) {
if (mount("proc", "/proc", "proc", 0,
((void *)0)
) < 0) {
perror("bootlogd: mount /proc");
return -1;
}
didmount = 1;
}
n = -1;
if ((fd = open("/proc/cmdline",
00
)) < 0) {
perror("bootlogd: /proc/cmdline");
} else {
buf[0] = 0;
if ((n = read(fd, buf, 4096 - 1)) < 0)
perror("bootlogd: /proc/cmdline");
close(fd);
}
if (didmount) umount("/proc");
if (n < 0) return 0;
p = buf + n;
*p-- = 0;
while (p >= buf) {
if (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n') {
*p-- = 0;
continue;
}
if (strncmp(p, "console=", 8) == 0 &&
isconsole(p + 8, cons[num_consoles].name, sizeof(cons[num_consoles].name))) {
for (considx = 0; considx < num_consoles; considx++) {
if (!strcmp(cons[num_consoles].name, cons[considx].name)) {
goto dontuse;
}
}
num_consoles++;
if (num_consoles >= max_consoles) {
break;
}
}
dontuse:
p--;
}
if (num_consoles > 0) return num_consoles;
fstat(0, &st);
if (
gnu_dev_major (
st.st_rdev
)
!= 5 ||
gnu_dev_minor (
st.st_rdev
)
!= 1) {
int r = findtty(cons[num_consoles].name, "/dev",
sizeof(cons[num_consoles].name), st.st_rdev);
if (!r)
num_consoles++;
}
if (num_consoles > 0) return num_consoles;
if (ioctl(0,
(((2U) << (((0 +8)+8)+14)) | ((('T')) << (0 +8)) | (((0x32)) << 0) | ((((sizeof(unsigned int)))) << ((0 +8)+8)))
, &kdev) == 0) {
int r = findtty(cons[num_consoles].name, "/dev",
sizeof(cons[num_consoles].name), (dev_t)kdev);
if (!r)
num_consoles++;
}
if (num_consoles > 0) return num_consoles;
for (n = 0; defcons[n]; n++)
if (isconsole(defcons[n], cons[0].name, sizeof(cons[0].name)))
return 1;
fprintf(
stderr
, "bootlogd: cannot deduce real console device\n");
return 0;
}
| int consolenames(char *a0, unsigned long a1) {
int tmp_24;
char v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
char *v8;
char v9;
char v10;
char v11;
char v12;
unsigned long long v13;
unsigned short v15;
unsigned int v16;
v13 = *(&v13);
v1 = 0;
v4 = 0;
stat("/", &v9);
if (stat("/proc", &v11) < 0) {
perror("bootlogd: /proc");
v16 = 0;
} else {
v15 = *(&v9);
if (*(&v9) == *(&v11)) {
if (mount("proc", "/proc", "proc", 0x0, NULL) >= 0) {
v1 = 1;
} else {
perror("bootlogd: mount /proc");
v16 = -1;
goto LABEL_400bf9;
}
}
v2 = -1;
v5 = open("/proc/cmdline", 0x0, v15);
if (v5 < 0) {
perror("bootlogd: /proc/cmdline");
} else {
v12 = 0;
v2 = read(v5, &v12, 0xfff);
if (v2 < 0)
perror("bootlogd: /proc/cmdline");
close(v5);
}
if (v1)
umount("/proc");
if (v2 < 0) {
v16 = 0;
} else {
v8 = &(&v12)[v2];
tmp_24 = v8;
v8 += 1;
*(tmp_24) = 0;
while (true) {
if (v8 < &v12) {
LABEL_400a5a:
if (v4 > 0) {
*(&v16) = v4;
break;
}
fstat(0x0, &v9);
if (gnu_dev_major(*(&v10)) == 5 && gnu_dev_minor(*(&v10)) == 1)
goto LABEL_400ae9;
v6 = findtty(&a0[1028 * v4], "/dev", 0x400, *(&v10));
if (!v6)
v4 += 1;
LABEL_400ae9:
if (v4 > 0) {
*(&v16) = v4;
break;
} else {
if (!ioctl(0x0, 0x80045432)) {
v7 = findtty(&a0[1028 * v4], "/dev", 0x400, *(&v0));
if (!v7)
v4 += 1;
}
if (v4 > 0) {
*(&v16) = v4;
break;
} else {
v2 = 0;
while (true) {
if (!defcons[v2]) {
fprintf(stderr, "bootlogd: cannot deduce real console device\n");
*(&v16) = 0;
break;
} else if (!isconsole(defcons[v2], a0, 0x400)) {
v2 += 1;
} else {
*(&v16) = 1;
break;
}
}
}
}
}
if (*(v8) == 32) {
LABEL_400949:
v16 = v8;
v8 += 1;
*(v16) = 0;
} else {
if (*(v8) == 9)
goto LABEL_400949;
if (*(v8) == 13)
goto LABEL_400949;
if (*(v8) == 10)
goto LABEL_400949;
if (!strncmp(v8, "console=", 0x8) && isconsole(v8 + 8, &a0[0x400 * v4 + 4 * v4], 0x400)) {
v3 = 0;
while (true) {
if (v3 >= v4) {
v4 += 1;
if (v4 < a1)
break;
} else {
if (!strcmp(&a0[0x400 * v4 + 4 * v4], &a0[0x400 * v3 + 4 * v3]))
goto LABEL_0x400a3a;
v3 += 1;
}
}
goto LABEL_400a5a;
}
v8 += 1;
}
}
}
}
LABEL_400bf9:
return v16;
}
|
static char *
authmethods_get(Authctxt *authctxt)
{
struct sshbuf *b;
char *list;
int i, r;
if ((b = sshbuf_new()) ==
((void *)0)
)
sshfatal("auth2.c", __func__, 491, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new failed");
for (i = 0; authmethods[i] !=
((void *)0)
; i++) {
if (strcmp(authmethods[i]->name, "none") == 0)
continue;
if (authmethods[i]->enabled ==
((void *)0)
||
*(authmethods[i]->enabled) == 0)
continue;
if (!auth2_method_allowed(authctxt, authmethods[i]->name,
((void *)0)
))
continue;
if ((r = sshbuf_putf(b, "%s%s", sshbuf_len(b) ? "," : "",
authmethods[i]->name)) != 0)
sshfatal("auth2.c", __func__, 503, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "buffer error");
}
if ((list = sshbuf_dup_string(b)) ==
((void *)0)
)
sshfatal("auth2.c", __func__, 506, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_dup_string failed");
sshbuf_free(b);
return list;
}
| int authmethods_get(void* a0) {
unsigned long long v0;
unsigned int v1;
unsigned int v2;
unsigned long long v3;
unsigned long v4;
unsigned long long v5;
v3 = sshbuf_new();
if (!v3) {
v0 = "sshbuf_new failed";
sshfatal("auth2.c", "authmethods_get", 0x1eb, 0x1, 0x1, 0x0);
}
for (v1 = 0; true; v1 = __addvsi3(v1, 0x1)) {
if (!authmethods[v1])
break;
if (strcmp(*(authmethods[v1]), "none")) {
if (!*((authmethods[v1] + 24)) || !*(*((authmethods[v1] + 24)))) {
continue;
} else if (!auth2_method_allowed(a0, *(authmethods[v1]), 0x0)) {
continue;
} else {
v2 = sshbuf_putf(v3, "%s%s", (!sshbuf_len(v3) ? "," : &g_402830), *(authmethods[v1]));
if (v2) {
v5 = "buffer error";
sshfatal("auth2.c", "authmethods_get", 0x1f7, 0x1, 0x1, ssh_err(v2));
} else {
continue;
}
}
}
}
v4 = sshbuf_dup_string(v3);
if (!v4) {
v5 = "sshbuf_dup_string failed";
sshfatal("auth2.c", "authmethods_get", 0x1fa, 0x1, 0x1, 0x0);
}
sshbuf_free(v3);
return v4;
}
|
static int index_insert(struct index_node *node, const char *key,
const char *value, unsigned int priority)
{
int i = 0;
int ch;
index__checkstring(key);
index__checkstring(value);
while(1) {
int j;
for (j = 0; node->prefix[j]; j++) {
ch = node->prefix[j];
if (ch != key[i+j]) {
char *prefix = node->prefix;
struct index_node *n;
n = (calloc(sizeof(struct index_node), 1));
memcpy(n, node, sizeof(struct index_node));
n->prefix = (strdup(&prefix[j+1]));
memset(node, 0, sizeof(struct index_node));
prefix[j] = '\0';
node->prefix = prefix;
node->first = ch;
node->last = ch;
node->children[ch] = n;
break;
}
}
i += j;
ch = key[i];
if(ch == '\0')
return index_add_value(&node->values, value, priority);
if (!node->children[ch]) {
struct index_node *child;
if (ch < node->first)
node->first = ch;
if (ch > node->last)
node->last = ch;
node->children[ch] = (calloc(sizeof(struct index_node), 1));
child = node->children[ch];
child->prefix = (strdup(&key[i+1]));
child->first = 128;
index_add_value(&child->values, value, priority);
return 0;
}
node = node->children[ch];
i++;
}
}
| int index_insert(void* a0, char *a1, void* a2, unsigned long a3) {
struct_1 *v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
char *v4;
unsigned long long *v5;
struct_2 *v6;
unsigned int v8;
v0 = a0;
v1 = 0;
index__checkstring(a1);
index__checkstring(a2);
while (true) {
v2 = 0;
while (true) {
if (!*((v2 + v0->field_0)))
break;
v3 = *((v2 + v0->field_0));
if (v3 == a1[v1 + v2]) {
v2 += 1;
} else {
v4 = v0->field_0;
v5 = calloc(0x418, 0x1);
memcpy(v5, v0, 0x418);
*(v5) = strdup(&v4[1 + v2]);
memset(v0, 0x0, 0x418);
v4[v2] = 0;
v0->field_0 = v4;
v0->field_10 = v3;
v0->field_11 = v3;
*((&(&v0[1].field_0)[v3] + 6)) = v5;
break;
}
}
v1 += v2;
v3 = a1[v1];
if (!v3) {
v8 = index_add_value(&v0->padding_8, a2, a3);
break;
} else if (*((&(&v0[1].field_0)[v3] + 6))) {
v0 = *((&(&v0[1].field_0)[v3] + 6));
v1 += 1;
} else {
if (v3 < v0->field_10)
v0->field_10 = v3;
if (v3 > v0->field_11)
v0->field_11 = v3;
*((&(&v0[1].field_0)[v3] + 6)) = calloc(0x418, 0x1);
v6 = *((&(&v0[1].field_0)[v3] + 6));
v6->field_0 = strdup(&a1[1 + v1]);
v6->field_10 = 128;
index_add_value(&v6->padding_8, a2, a3);
v8 = 0;
break;
}
}
return v8;
}
|
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;
}
|
int
ssh_connect(struct ssh *ssh, const char *host, const char *host_arg,
struct addrinfo *addrs, struct sockaddr_storage *hostaddr, u_short port,
int connection_attempts, int *timeout_ms, int want_keepalive)
{
int in, out;
if (options.proxy_command ==
((void *)0)
) {
return ssh_connect_direct(ssh, host, addrs, hostaddr, port,
connection_attempts, timeout_ms, want_keepalive);
} else if (strcmp(options.proxy_command, "-") == 0) {
if ((in = dup(
0
)) == -1 ||
(out = dup(
1
)) == -1) {
if (in >= 0)
close(in);
sshlog("sshconnect.c", __func__, 552, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "dup() in/out failed");
return -1;
}
if ((ssh_packet_set_connection(ssh, in, out)) ==
((void *)0)
)
return -1;
return 0;
} else if (options.proxy_use_fdpass) {
return ssh_proxy_fdpass_connect(ssh, host, host_arg, port,
options.proxy_command);
}
return ssh_proxy_connect(ssh, host, host_arg, port,
options.proxy_command);
}
| long long ssh_connect(unsigned long long a0, unsigned int a1, unsigned long long a2, void* a3, void* a4, unsigned long a5, unsigned int v2, unsigned long long a6, unsigned int a7) {
unsigned int v0;
unsigned int v1;
unsigned long long v3;
if (!htonl) {
v3 = ssh_connect_direct(a0, a1, a3, a4, a5, v2, a6, a7);
} else if (!strcmp(htonl, "-")) {
v0 = dup(0x0);
if (v0 == -1) {
LABEL_4016c7:
if (v0 >= 0)
close(v0);
sshlog("sshconnect.c", "ssh_connect", 0x228, 0x1, 0x2, 0x0, "dup() in/out failed");
v3 = 4294967295;
} else {
v1 = dup(0x1);
if (v1 == -1)
goto LABEL_4016c7;
if (!ssh_packet_set_connection(a0, v0, v1, v0))
v3 = 4294967295;
else
v3 = 0;
}
} else if (!*(5247924)) {
v3 = ssh_proxy_connect(a0, a1, a2, a5, htonl);
} else {
v3 = ssh_proxy_fdpass_connect(a0, a1, a2, a5, htonl);
}
return v3;
}
|
(r = sshpkt_get_u32(ssh, &remote_maxpacket)) != 0 ||
(r = sshpkt_get_end(ssh)) != 0) {
sshlog("channels.c", __func__, 3376, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "window/maxpacket");
ssh_packet_disconnect(ssh, "Invalid open confirmation message");
}
| void sshpkt_get_u32(void)
{
halt_baddata();
}
|
void
malloc_set_tracefp (fp)
FILE *fp;
{
}
| void malloc_set_tracefp(void)
{
return;
}
|
int
response(void)
{
char ch, *cp, resp, rbuf[2048], visbuf[2048];
if (atomicio(read, remin, &resp, sizeof(resp)) != sizeof(resp))
lostconn(0);
cp = rbuf;
switch (resp) {
case 0:
return (0);
default:
*cp++ = resp;
case 1:
case 2:
do {
if (atomicio(read, remin, &ch, sizeof(ch)) != sizeof(ch))
lostconn(0);
*cp++ = ch;
} while (cp < &rbuf[sizeof(rbuf) - 1] && ch != '\n');
if (!iamremote) {
cp[-1] = '\0';
(void) snmprintf(visbuf, sizeof(visbuf),
((void *)0)
, "%s\n", rbuf);
(void) atomicio((ssize_t (*)(int, void *, size_t))write,
2
,
visbuf, strlen(visbuf));
}
++errs;
if (resp == 1)
return (-1);
exit(1);
}
}
| int response() {
char v0;
int tmp_15;
char v1;
char *v2;
char v3;
unsigned long long v4;
char v5;
char v6;
unsigned int v8;
unsigned int v9;
v4 = *(&v4);
if (atomicio(got.read, 0x10ec8348e5894855, &v1, 0x1) != 1)
lostconn(0x0);
v2 = &v3;
v8 = v1;
if (!v1) {
v9 = 0;
} else {
if (v8 >= 0) {
v9 = v8 - 1;
if (v9 <= 1)
goto LABEL_406285;
}
v9 = v2;
v2 += 1;
*(v9) = v1;
while (true) {
LABEL_406285:
if (atomicio(got.read, 0x10ec8348e5894855, &v0, 0x1) != 1)
lostconn(0x0);
tmp_15 = v2;
v2 += 1;
*(tmp_15) = v0;
if (v2 >= &v5)
break;
if (v0 == 10)
break;
}
if (false) {
v2[1] = 0;
snmprintf(&v6, 0x800, 0x0, "%s\n", &v3);
atomicio(got.write, 0x2, &v6, strlen(&v6));
}
targetshouldbedirectory = __addvsi3(0x10ec8348e5894855, 0x1);
if (v1 == 1)
v9 = -1;
else
exit(0x1);
}
return v9;
}
|
int
rl_ding(void)
{
re_putc(e, '\a', 0);
return 0;
}
| long rl_ding()
{
re_putc(e, 7LL, 0LL);
return 0LL;
}
|
static int
sig_process_opts(char * const *opts, size_t nopts, char **hashalgp,
uint64_t *verify_timep, int *print_pubkey)
{
size_t i;
time_t now;
if (verify_timep !=
((void *)0)
)
*verify_timep = 0;
if (print_pubkey !=
((void *)0)
)
*print_pubkey = 0;
if (hashalgp !=
((void *)0)
)
*hashalgp =
((void *)0)
;
for (i = 0; i < nopts; i++) {
if (hashalgp !=
((void *)0)
&&
strncasecmp(opts[i], "hashalg=", 8) == 0) {
*hashalgp = xstrdup(opts[i] + 8);
} else if (verify_timep &&
strncasecmp(opts[i], "verify-time=", 12) == 0) {
if (parse_absolute_time(opts[i] + 12,
verify_timep) != 0 || *verify_timep == 0) {
sshlog("ssh-keygen.c", __func__, 2665, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Invalid \"verify-time\" option");
return -10;
}
} else if (print_pubkey &&
strcasecmp(opts[i], "print-pubkey") == 0) {
*print_pubkey = 1;
} else {
sshlog("ssh-keygen.c", __func__, 2672, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Invalid option \"%s\"", opts[i]);
return -10;
}
}
if (verify_timep && *verify_timep == 0) {
if ((now = time(
((void *)0)
)) < 0) {
sshlog("ssh-keygen.c", __func__, 2678, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Time is before epoch");
return -10;
}
*verify_timep = (uint64_t)now;
}
return 0;
}
| int sig_process_opts(void* a0, unsigned long a1, unsigned long long *a2, unsigned long long *a3, unsigned int *a4) {
char v0;
void* v1;
unsigned long v2;
unsigned int v4;
if (a3)
*(a3) = 0;
if (a4)
*(a4) = 0;
if (a2)
*(a2) = 0;
v1 = 0;
while (true) {
if (v1 >= a1) {
if (a3 && !*(a3)) {
v2 = time(NULL);
if (!((v2 - 0 >> 63))) {
*(a3) = v2;
} else {
sshlog("ssh-keygen.c", "sig_process_opts", 0xa76, 0x0, 0x2, 0x0, "Time is before epoch", *(&v0));
v4 = -10;
break;
}
}
v4 = 0;
break;
}
if (a2 && !strncasecmp(*((a0 + 0x8 * v1)), "hashalg=", 0x8)) {
*(a2) = xstrdup(*((a0 + 0x8 * v1)) + 8);
goto LABEL_40acd7;
}
if (a3 && !strncasecmp(*((a0 + 0x8 * v1)), "verify-time=", 0xc)) {
if (!parse_absolute_time(*((a0 + 0x8 * v1)) + 12, a3) && !(!*(a3)))
goto LABEL_40acd7;
sshlog("ssh-keygen.c", "sig_process_opts", 0xa69, 0x0, 0x2, 0x0, "Invalid \"verify-time\" option", *(&v0));
v4 = -10;
break;
}
if (!a4) {
LABEL_40ac7b:
sshlog("ssh-keygen.c", "sig_process_opts", 0xa70, 0x0, 0x2, 0x0, "Invalid option \"%s\"", *((a0 + 0x8 * v1)));
v4 = -10;
break;
} else {
if (!(!strcasecmp(*((a0 + 0x8 * v1)), "print-pubkey")))
goto LABEL_40ac7b;
*(a4) = 1;
LABEL_40acd7:
v1 += 1;
}
}
return v4;
}
|
static void
setoption(int flag, int val)
{
int i;
for (i = 0; i < 17; i++)
if (optletters[i] == flag) {
optlist[i] = val;
if (val) {
if (flag == 'V')
optlist[10] = 0;
else if (flag == 'E')
optlist[9] = 0;
}
return;
}
sh_error("Illegal option -%c", flag);
}
| void setoption(unsigned long a0, unsigned long a1) {
unsigned int v0;
unsigned long long v2;
unsigned long long v3;
v0 = 0;
while (true) {
if (v0 > 16) {
v2 = sh_error("Illegal option -%c");
break;
} else if (a0 != *(v0 + &optletters)) {
v0 += 1;
} else {
v3 = v0;
*(v0 + &optlist) = a1;
if (a1) {
if (a0 == 86) {
g_40001a = 0;
break;
} else if (a0 == 69) {
g_400019 = 0;
break;
}
}
}
}
return;
}
|
static void print_dumphmac(struct rtattr *attrs[])
{
char secret[64];
char *algstr;
__u8 slen = rta_getattr_u8(attrs[SEG6_ATTR_SECRETLEN]);
__u8 alg_id = rta_getattr_u8(attrs[SEG6_ATTR_ALGID]);
memset(secret, 0, 64);
if (slen > 63) {
fprintf(
stderr
, "HMAC secret length %d > 63, truncated\n", slen);
slen = 63;
}
memcpy(secret, ((void*)(((char*)(attrs[SEG6_ATTR_SECRET])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), slen);
switch (alg_id) {
case SEG6_HMAC_ALGO_SHA1:
algstr = "sha1";
break;
case SEG6_HMAC_ALGO_SHA256:
algstr = "sha256";
break;
default:
algstr = "<unknown>";
}
print_uint(PRINT_ANY, "hmac", "hmac %u ",
rta_getattr_u32(attrs[SEG6_ATTR_HMACKEYID]));
print_string(PRINT_ANY, "algo", "algo %s ", algstr);
print_string(PRINT_ANY, "secret", "secret \"%s\"\n", secret);
}
| unsigned long print_dumphmac(long *a1)
{
unsigned int v1;
unsigned char v3;
char v4;
const char *v5;
char s[72];
unsigned long v7;
v7 = __readfsqword(0x28u);
v3 = rta_getattr_u8(a1[5]);
v4 = rta_getattr_u8(a1[6]);
memset(s, 0, 0x40uLL);
if ( v3 > 0x3Fu )
{
fprintf(stderr, "HMAC secret length %d > 63, truncated\n", v3);
v3 = 63;
}
memcpy(s, (const void *)(a1[4] + 4), v3);
if ( v4 == 1 )
{
v5 = "sha1";
}
else if ( v4 == 2 )
{
v5 = "sha256";
}
else
{
v5 = "<unknown>";
}
v1 = rta_getattr_u32(a1[3]);
print_uint(4u, (long)"hmac", (long)"hmac %u ", v1);
print_string(4u, (long)"algo", (long)"algo %s ", (long)v5);
print_string(4u, (long)"secret", (long)"secret \"%s\"\n", (long)s);
return __readfsqword(0x28u) ^ v7;
}
|
static void license()
{
char const *const *p = license_msg;
printf ("%s %s\n", program_name, Version);
while (*p) printf ("%s\n", *p++);
}
| void license() {
unsigned long long v0;
int tmp_9;
unsigned long long v2;
v0 = &license_msg;
printf("%s %s\n", -116028600, Version);
while (true) {
v2 = *(v0);
if (!*(v0))
break;
tmp_9 = v0;
v0 += 8;
printf("%s\n", *(tmp_9));
}
return;
}
|
void
_rl_release_sigwinch (void)
{
if (sigwinch_blocked == 0)
return;
sigprocmask (
2
, &sigwinch_oset, (sigset_t *)
((void *)0)
);
sigwinch_blocked = 0;
}
| long long _rl_release_sigwinch() {
unsigned long long v1;
v1 = sigwinch_blocked;
if (sigwinch_blocked) {
v1 = sigprocmask(0x2, &sigwinch_oset, NULL);
sigwinch_blocked = 0;
}
return v1;
}
|
void
strip_trailing (string, len, newlines_only)
char *string;
int len;
int newlines_only;
{
while (len >= 0)
{
if ((newlines_only && string[len] == '\n') ||
(!newlines_only && (((string[len]) == ' ') || ((string[len]) == '\t'))))
len--;
else
break;
}
string[len + 1] = '\0';
}
| long long strip_trailing(char *a0, unsigned long a1, unsigned long a2) {
unsigned int v0;
v0 = a1;
while (true) {
if (v0 < 0)
break;
if (a2 && a0[v0] == 10) {
v0 -= 1;
} else {
if (a2)
break;
switch (a0[v0]) {
case 9: case 32:
break;
default:
goto LABEL_40090c;
}
}
}
LABEL_40090c:
a0[1 + v0] = 0;
return &a0[1 + v0];
}
|
static int
tilde_find_suffix (const char *string)
{
register int i, j, string_len;
register char **suffixes;
suffixes = tilde_additional_suffixes;
string_len = strlen (string);
for (i = 0; i < string_len; i++)
{
if (string[i] == '/' )
break;
for (j = 0; suffixes && suffixes[j]; j++)
{
if (strncmp (string + i, suffixes[j], strlen (suffixes[j])) == 0)
return (i);
}
}
return (i);
}
| int tilde_find_suffix(char *param_1)
{
undefined *puVar1;
int iVar2;
size_t sVar3;
size_t __n;
int iVar4;
int iVar5;
puVar1 = tilde_additional_suffixes;
sVar3 = strlen(param_1);
for (iVar4 = 0; (iVar4 < (int)sVar3 && (param_1[iVar4] != '/')); iVar4 = iVar4 + 1) {
iVar5 = 0;
while ((puVar1 != (undefined *)0x0 && (*(long *)(puVar1 + (long)iVar5 * 8) != 0))) {
__n = strlen(*(char **)(puVar1 + (long)iVar5 * 8));
iVar2 = strncmp(param_1 + iVar4,*(char **)(puVar1 + (long)iVar5 * 8),__n);
if (iVar2 == 0) {
return iVar4;
}
iVar5 = iVar5 + 1;
}
}
return iVar4;
}
|
int
rl_insert (int count, int c)
{
int r, n, x;
r = (rl_insert_mode == 1) ? _rl_insert_char (count, c) : _rl_overwrite_char (count, c);
x = 0;
n = (unsigned short)-2;
while (_rl_optimize_typeahead &&
rl_num_chars_to_read == 0 &&
((rl_readline_state & (0x0020000|0x0000800)) == 0) &&
_rl_pushed_input_available () == 0 &&
_rl_input_queued (0) &&
(n = rl_read_key ()) > 0 &&
_rl_keymap[(unsigned char)n].type == 0 &&
_rl_keymap[(unsigned char)n].function == rl_insert)
{
r = (rl_insert_mode == 1) ? _rl_insert_char (1, n) : _rl_overwrite_char (1, n);
n = (unsigned short)-2;
x++;
if (r == 1)
continue;
if (rl_done || r != 0)
break;
}
if (n != (unsigned short)-2)
{
rl_last_func = rl_insert;
_rl_reset_argument ();
rl_executing_keyseq[rl_key_sequence_length = 0] = '\0';
r = rl_execute_next (n);
}
return r;
}
| long long rl_insert(unsigned long a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
if (rl_insert_mode == 1)
v4 = _rl_insert_char(a0, a1);
else
v4 = _rl_overwrite_char(a0, a1);
v0 = v4;
v2 = 0;
v1 = 65534;
while (_rl_optimize_typeahead) {
if (rl_num_chars_to_read)
break;
if (!rl_num_chars_to_read) {
if ((rl_readline_state & 0x20800))
break;
if (!(rl_readline_state & 0x20800)) {
v5 = _rl_pushed_input_available();
if (v5)
break;
if (!v5) {
v6 = _rl_input_queued(0x0);
if (!v6)
break;
if (v6) {
v1 = rl_read_key();
if (v1 <= 0)
break;
if (v1 > 0) {
if (*((_rl_keymap + (v1 << 4))))
break;
if (!*((_rl_keymap + (v1 << 4)))) {
if (*((_rl_keymap + (v1 << 4) + 8)) != rl_insert)
break;
if (*((_rl_keymap + (v1 << 4) + 8)) == rl_insert) {
if (rl_insert_mode == 1)
v7 = _rl_insert_char(0x1, v1);
else
v7 = _rl_overwrite_char(0x1, v1);
v0 = v7;
v1 = 65534;
v2 += 1;
if (v0 == 1)
continue;
if (rl_done)
break;
}
}
}
}
}
}
}
if (v0)
break;
}
if (v1 != 65534) {
rl_last_func = rl_insert;
_rl_reset_argument();
rl_key_sequence_length = 0;
*(rl_executing_keyseq) = 0;
v0 = rl_execute_next(v1);
}
return v0;
}
|
void
ssh_set_app_data(struct ssh *ssh, void *app_data)
{
ssh->app_data = app_data;
}
| void ssh_set_app_data(long param_1,undefined8 param_2)
{
*(undefined8 *)(param_1 + 0x870) = param_2;
return;
}
|
int
sshpkt_put_u64(struct ssh *ssh, u_int64_t val)
{
return sshbuf_put_u64(ssh->state->outgoing_packet, val);
}
| long sshpkt_put_u64(long a1, long a2)
{
return sshbuf_put_u64(*(_QWORD *)(*(_QWORD *)a1 + 48LL), a2);
}
|
uint32_t
arc4random(void)
{
uint32_t val;
;
_rs_random_u32(&val);
;
return val;
}
| long long arc4random() {
char v0;
_rs_random_u32(&v0);
return *(&v0);
}
|
static char *
other_hostkeys_message(const char *host, const char *ip,
const struct sshkey *key,
char **user_hostfiles, u_int num_user_hostfiles,
char **system_hostfiles, u_int num_system_hostfiles)
{
char *ret =
((void *)0)
, **othernames =
((void *)0)
;
u_int i, n, num_othernames = 0;
hostkeys_find_by_key(host, ip, key,
user_hostfiles, num_user_hostfiles,
system_hostfiles, num_system_hostfiles,
&othernames, &num_othernames);
if (num_othernames == 0)
return xstrdup("This key is not known by any other names.");
xasprintf(&ret, "This host key is known by the following other "
"names/addresses:");
n = num_othernames;
if (n > 8)
n = 8;
for (i = 0; i < n; i++) {
xextendf(&ret, "\n", " %s", othernames[i]);
}
if (n < num_othernames) {
xextendf(&ret, "\n", " (%d additional names omitted)",
num_othernames - n);
}
for (i = 0; i < num_othernames; i++)
free(othernames[i]);
free(othernames);
return ret;
}
| long other_hostkeys_message(
long a1,
long a2,
long a3,
long a4,
unsigned int a5,
long a6,
unsigned int a7)
{
unsigned int v8;
unsigned int i;
unsigned int v10;
long v11;
void *ptr[2];
ptr[1] = (void *)__readfsqword(0x28u);
v11 = 0LL;
ptr[0] = 0LL;
v8 = 0;
hostkeys_find_by_key(a1, a2, a3, a4, a5, a6, a7, ptr, &v8);
if ( !v8 )
return xstrdup("This key is not known by any other names.");
xasprintf(&v11, "This host key is known by the following other names/addresses:");
v10 = v8;
if ( v8 > 8 )
v10 = 8;
for ( i = 0; i < v10; ++i )
xextendf(&v11, "\n", " %s", *((const char **)ptr[0] + i));
if ( v10 < v8 )
xextendf(&v11, "\n", " (%d additional names omitted)", v8 - v10);
for ( i = 0; i < v8; ++i )
free(*((void **)ptr[0] + i));
free(ptr[0]);
return v11;
}
|
gnutls_x509_crl_t *load_crl_list(int mand, size_t * crl_size,
common_info_st * info)
{
FILE *fp;
static gnutls_x509_crl_t *crl;
unsigned int crl_max;
int ret;
gnutls_datum_t dat;
size_t size;
*crl_size = 0;
if (info->verbose)
fprintf(
stderr
, "Loading CRL list...\n");
if (info->crl ==
((void *)0)
) {
if (mand) {
fprintf(
stderr
, "missing --load-crl\n");
app_exit(1);
} else
return
((void *)0)
;
}
fp = fopen(info->crl, "r");
if (fp ==
((void *)0)
) {
fprintf(
stderr
, "Could not open %s\n", info->crl);
app_exit(1);
}
fix_lbuffer(file_size(fp));
size = fread(lbuffer, 1, lbuffer_size - 1, fp);
lbuffer[size] = 0;
fclose(fp);
dat.data = (void *) lbuffer;
dat.size = size;
ret = gnutls_x509_crl_list_import2(&crl, &crl_max, &dat, GNUTLS_X509_FMT_PEM, 0);
if (ret == -34) {
ret = gnutls_x509_crl_list_import2(&crl, &crl_max, &dat, GNUTLS_X509_FMT_DER, 0);
}
if (ret < 0) {
fprintf(
stderr
, "Error loading CRLs: %s\n", gnutls_strerror(ret));
app_exit(1);
}
*crl_size = crl_max;
if (info->verbose)
fprintf(
stderr
, "Loaded %d CRLs.\n",
(int) *crl_size);
return crl;
}
| long long load_crl_list(unsigned long a0, unsigned long long *a1, struct_0 *a2) {
char v0;
unsigned int v1;
void* v2;
char *v3;
unsigned long v4;
unsigned int v5;
void* v7;
*(a1) = 0;
if (a2->field_c4)
fprintf(stderr, "Loading CRL list...\n");
if (a2->field_38) {
v2 = fopen(a2->field_38, "r");
if (!v2) {
fprintf(stderr, "Could not open %s\n", a2->field_38);
app_exit(0x1);
}
fix_lbuffer(file_size(v2));
v3 = fread(lbuffer, 0x1, lbuffer_size - 1, v2);
v3[lbuffer] = 0;
fclose(v2);
v4 = lbuffer;
v5 = v3;
v1 = gnutls_x509_crl_list_import2(&crl.12525, &v0, &v4, 0x1, 0x0);
if (v1 == -34)
v1 = gnutls_x509_crl_list_import2(&crl.12525, &v0, &v4, 0x0, 0x0);
if (v1 < 0) {
fprintf(stderr, "Error loading CRLs: %s\n", gnutls_strerror(v1));
app_exit(0x1);
}
*(a1) = *(&v0);
if (a2->field_c4)
fprintf(stderr, "Loaded %d CRLs.\n", *(a1));
v7 = crl.12525;
} else {
if (a0) {
fprintf(stderr, "missing --load-crl\n");
app_exit(0x1);
}
v7 = 0;
}
return v7;
}
|
static int
token_callback(void *user, const char *label, const unsigned retry)
{
char buf[32];
common_info_st *info = user;
if (retry > 0 || (info !=
((void *)0)
&& info->batch != 0)) {
fprintf(
stderr
, "Could not find token %s\n", label);
return -1;
}
log_msg(
stdout
, "Please insert token '%s' in slot and press enter\n",
label);
if (fgets(buf, sizeof(buf),
stdin
) ==
((void *)0)
) {
fprintf(
stderr
, "error reading input\n");
return -1;
}
return 0;
}
| long long token_callback(struct_0 *a0, unsigned long a1, unsigned long a2) {
char v0;
unsigned long long v2;
if (!a2 && (!(a0) || !(a0->field_bc))) {
log_msg();
if (fgets(&v0, 0x20, stdin)) {
v2 = 0;
return v2;
}
fprintf(*(&stderr), "error reading input\n");
v2 = 4294967295;
return v2;
}
fprintf(*(&stderr), "Could not find token %s\n", a1);
v2 = 4294967295;
return v2;
}
|
errcode_t e2fsck_allocate_context(e2fsck_t *ret)
{
e2fsck_t context;
errcode_t retval;
char *time_env;
retval = ext2fs_get_mem(sizeof(struct e2fsck_struct), &context);
if (retval)
return retval;
memset(context, 0, sizeof(struct e2fsck_struct));
context->process_inode_size = 256;
context->ext_attr_ver = 2;
context->blocks_per_page = 1;
context->htree_slack_percentage = 255;
time_env = getenv("E2FSCK_TIME");
if (time_env)
context->now = (time_t) strtoull(time_env,
((void *)0)
, 0);
else {
context->now = time(0);
if (context->now < 1262322000)
context->flags |= 0x2000;
}
*ret = context;
return 0;
}
| long e2fsck_allocate_context(void **param_1)
{
void *pvVar1;
long lVar2;
ulonglong uVar3;
time_t tVar4;
long in_FS_OFFSET;
void *local_38;
long local_30;
char *local_28;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
lVar2 = ext2fs_get_mem(0x3f8,&local_38);
local_30 = lVar2;
if (lVar2 == 0) {
memset(local_38,0,0x3f8);
*(undefined4 *)((long)local_38 + 600) = 0x100;
*(undefined4 *)((long)local_38 + 0x358) = 2;
*(undefined4 *)((long)local_38 + 0x368) = 1;
*(undefined4 *)((long)local_38 + 0x260) = 0xff;
local_28 = getenv("E2FSCK_TIME");
pvVar1 = local_38;
if (local_28 == (char *)0x0) {
tVar4 = time((time_t *)0x0);
*(time_t *)((long)pvVar1 + 0x348) = tVar4;
if (*(long *)((long)local_38 + 0x348) < 0x4b3d8150) {
*(uint *)((long)local_38 + 0x48) = *(uint *)((long)local_38 + 0x48) | 0x2000;
}
}
else {
uVar3 = strtoull(local_28,(char **)0x0,0);
*(ulonglong *)((long)local_38 + 0x348) = uVar3;
}
*param_1 = local_38;
lVar2 = 0;
}
if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) {
return lVar2;
}
__stack_chk_fail();
}
|
int
absolute_pathname (string)
const char *string;
{
if (string == 0 || *string == '\0')
return (0);
if (((string)[0] == '/'))
return (1);
if (string[0] == '.' && (((string[1]) == '/') || (string[1]) == 0))
return (1);
if (string[0] == '.' && string[1] == '.' && (((string[2]) == '/') || (string[2]) == 0))
return (1);
return (0);
}
| _BOOL8 absolute_pathname(_BYTE *a1)
{
if ( !a1 || !*a1 )
return 0LL;
if ( *a1 == 47 )
return 1LL;
if ( *a1 == 46 && (a1[1] == 47 || !a1[1]) )
return 1LL;
return *a1 == 46 && a1[1] == 46 && (a1[2] == 47 || !a1[2]);
}
|
(r = sshbuf_get_u32(original, &id)) != 0) {
sshlog("channels.c", __func__, 2976, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "parse");
goto out;
}
| || (string_direct = sshbuf_get_u32(v22, &v15)) != 0 )
{
v9 = ssh_err(string_direct);
sshlog("channels.c", "channel_proxy_downstream", 3036LL, 1LL, 2LL, v9, "parse");
goto LABEL_61;
}
|
static void
do_rc_files(struct ssh *ssh, Session *s, const char *shell)
{
FILE *f =
((void *)0)
;
char *cmd =
((void *)0)
, *user_rc =
((void *)0)
;
int do_xauth;
struct stat st;
do_xauth =
s->display !=
((void *)0)
&& s->auth_proto !=
((void *)0)
&& s->auth_data !=
((void *)0)
;
xasprintf(&user_rc, "%s/%s", s->pw->pw_dir, ".ssh" "/rc");
if (!s->is_subsystem && options.adm_forced_command ==
((void *)0)
&&
auth_opts->permit_user_rc && options.permit_user_rc &&
stat(user_rc, &st) >= 0) {
if (xasprintf(&cmd, "%s -c '%s %s'", shell,
"/bin/sh"
,
user_rc) == -1)
sshfatal("session.c", __func__, 1218, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "xasprintf: %s", strerror(
(*__errno_location ())
));
if (debug_flag)
fprintf(
stderr
, "Running %s\n", cmd);
f = popen(cmd, "w");
if (f) {
if (do_xauth)
fprintf(f, "%s %s\n", s->auth_proto,
s->auth_data);
pclose(f);
} else
fprintf(
stderr
, "Could not run %s\n",
user_rc);
} else if (stat("/usr/local/etc" "/sshrc", &st) >= 0) {
if (debug_flag)
fprintf(
stderr
, "Running %s %s\n",
"/bin/sh"
,
"/usr/local/etc" "/sshrc");
f = popen(
"/bin/sh"
" " "/usr/local/etc" "/sshrc", "w");
if (f) {
if (do_xauth)
fprintf(f, "%s %s\n", s->auth_proto,
s->auth_data);
pclose(f);
} else
fprintf(
stderr
, "Could not run %s\n",
"/usr/local/etc" "/sshrc");
} else if (do_xauth && options.xauth_location !=
((void *)0)
) {
if (debug_flag) {
fprintf(
stderr
,
"Running %.500s remove %.100s\n",
options.xauth_location, s->auth_display);
fprintf(
stderr
,
"%.500s add %.100s %.100s %.100s\n",
options.xauth_location, s->auth_display,
s->auth_proto, s->auth_data);
}
if (xasprintf(&cmd, "%s -q -", options.xauth_location) == -1)
sshfatal("session.c", __func__, 1255, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "xasprintf: %s", strerror(
(*__errno_location ())
));
f = popen(cmd, "w");
if (f) {
fprintf(f, "remove %s\n",
s->auth_display);
fprintf(f, "add %s %s %s\n",
s->auth_display, s->auth_proto,
s->auth_data);
pclose(f);
} else {
fprintf(
stderr
, "Could not run %s\n",
cmd);
}
}
free(cmd);
free(user_rc);
}
| unsigned long do_rc_files(long a1, long a2, const char *a3)
{
_BOOL4 v3;
int *v4;
char *v5;
int *v6;
char *v7;
_BOOL4 v10;
char *command;
char *file;
FILE *stream;
struct stat v14;
unsigned long v15;
v15 = __readfsqword(0x28u);
stream = 0LL;
command = 0LL;
file = 0LL;
v3 = *(_QWORD *)(a2 + 144) && *(_QWORD *)(a2 + 168) && *(_QWORD *)(a2 + 176);
v10 = v3;
xasprintf(&file, "%s/%s", *(const char **)(*(_QWORD *)(a2 + 16) + 32LL), ".ssh/rc");
if ( *(_DWORD *)(a2 + 200)
|| *(_QWORD *)&options[1924]
|| !*(_DWORD *)(auth_opts + 16LL)
|| !options[297]
|| stat(file, &v14) < 0 )
{
if ( stat("/usr/local/etc/sshrc", &v14) < 0 )
{
if ( v10 && *(_QWORD *)&options[294] )
{
if ( debug_flag )
{
fprintf(stderr, "Running %.500s remove %.100s\n", *(const char **)&options[294], *(const char **)(a2 + 160));
fprintf(
stderr,
"%.500s add %.100s %.100s %.100s\n",
*(const char **)&options[294],
*(const char **)(a2 + 160),
*(const char **)(a2 + 168),
*(const char **)(a2 + 176));
}
if ( (unsigned int)xasprintf(&command, "%s -q -", *(const char **)&options[294]) == -1 )
{
v6 = _errno_location();
v7 = strerror(*v6);
sshfatal("session.c", "do_rc_files", 1255LL, 1LL, 1LL, 0LL, "xasprintf: %s", v7);
}
stream = popen(command, "w");
if ( stream )
{
fprintf(stream, "remove %s\n", *(const char **)(a2 + 160));
fprintf(
stream,
"add %s %s %s\n",
*(const char **)(a2 + 160),
*(const char **)(a2 + 168),
*(const char **)(a2 + 176));
pclose(stream);
}
else
{
fprintf(stderr, "Could not run %s\n", command);
}
}
}
else
{
if ( debug_flag )
fprintf(stderr, "Running %s %s\n", "/bin/sh", "/usr/local/etc/sshrc");
stream = popen("/bin/sh /usr/local/etc/sshrc", "w");
if ( stream )
{
if ( v10 )
fprintf(stream, "%s %s\n", *(const char **)(a2 + 168), *(const char **)(a2 + 176));
pclose(stream);
}
else
{
fprintf(stderr, "Could not run %s\n", "/usr/local/etc/sshrc");
}
}
}
else
{
if ( (unsigned int)xasprintf(&command, "%s -c '%s %s'", a3, "/bin/sh", file) == -1 )
{
v4 = _errno_location();
v5 = strerror(*v4);
sshfatal("session.c", "do_rc_files", 1218LL, 1LL, 1LL, 0LL, "xasprintf: %s", v5);
}
if ( debug_flag )
fprintf(stderr, "Running %s\n", command);
stream = popen(command, "w");
if ( stream )
{
if ( v10 )
fprintf(stream, "%s %s\n", *(const char **)(a2 + 168), *(const char **)(a2 + 176));
pclose(stream);
}
else
{
fprintf(stderr, "Could not run %s\n", file);
}
}
free(command);
free(file);
return __readfsqword(0x28u) ^ v15;
}
|
static
_Bool
needs_quoting (char const *name)
{
char test[2];
size_t len = quotearg_buffer (test, sizeof test , name, -1,
filename_quoting_options);
return *name != *test || strlen (name) != len;
}
| int needs_quoting(char *a0) {
unsigned long v0;
char v1;
unsigned int v3;
unsigned int v4;
v0 = quotearg_buffer(&v1, 0x2, a0, 0xffffffffffffffff, filename_quoting_options);
if (*(a0) != v1) {
LABEL_404a70:
v3 = 1;
} else {
if (!(v0 == strlen(a0)))
goto LABEL_404a70;
v3 = 0;
}
v4 = v3 & 1;
return v4;
}
|
_Bool
utf8_convert (
_Bool
to_utf, char const *input, char **output)
{
char *ib;
char *ob, *ret;
size_t inlen;
size_t outlen;
iconv_t cd = utf8_init (to_utf);
if (cd == 0)
{
*output = xstrdup (input);
return
1
;
}
else if (cd == (iconv_t)-1)
return
0
;
inlen = strlen (input) + 1;
outlen = inlen *
16
+ 1;
ob = ret = xmalloc (outlen);
ib = (char *) input;
if (iconv (cd, &ib, &inlen, &ob, &outlen) != 0)
{
free (ret);
return
0
;
}
*ob = 0;
*output = ret;
return
1
;
}
| long long utf8_convert(unsigned long a0, char *a1, unsigned long long *a2) {
unsigned long v0;
char *v1;
unsigned long v2;
unsigned long long v3;
unsigned long long v4;
void* v5;
unsigned long long v7;
v4 = utf8_init(a0);
if (!v4) {
*(a2) = xstrdup(a1);
v7 = 1;
} else if (v4 == -1) {
v7 = 0;
} else {
v2 = strlen(a1) + 1;
v3 = v2 * 16 + 1;
v5 = xmalloc(v3);
v1 = v5;
v0 = a1;
if (!iconv(v4, &v0, &v2, &v1, &v3)) {
*(v1) = 0;
*(a2) = v5;
v7 = 1;
} else {
free(v5);
v7 = 0;
}
}
return v7;
}
|
static int ipvrf_print(struct nlmsghdr *n)
{
struct ifinfomsg *ifi = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
struct rtattr *tb[(__IFLA_MAX - 1)+1];
struct rtattr *li[(__IFLA_INFO_MAX - 1)+1];
int len = n->nlmsg_len;
const char *name;
__u32 tb_id;
len -= ((sizeof(*ifi)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )));
if (len < 0)
return 0;
if (vrf_filter.ifindex && vrf_filter.ifindex != ifi->ifi_index)
return 0;
parse_rtattr(tb, (__IFLA_MAX - 1), ((struct rtattr*)(((char*)(ifi)) + ( ((sizeof(struct ifinfomsg))+4U -1) & ~(4U -1) ))), len);
if (tb[IFLA_MASTER]) {
int master = *(int *)((void*)(((char*)(tb[IFLA_MASTER])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
if (vrf_filter.master && master != vrf_filter.master)
return 0;
}
if (!tb[IFLA_IFNAME]) {
fprintf(
stderr
,
"BUG: device with ifindex %d has nil ifname\n",
ifi->ifi_index);
return 0;
}
name = rta_getattr_str(tb[IFLA_IFNAME]);
if (!tb[IFLA_LINKINFO])
return 0;
(parse_rtattr_flags((li), ((__IFLA_INFO_MAX - 1)), ((void*)(((char*)(tb[IFLA_LINKINFO])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((tb[IFLA_LINKINFO])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)));
if (!li[IFLA_INFO_KIND])
return 0;
if (strcmp(((void*)(((char*)(li[IFLA_INFO_KIND])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), "vrf"))
return 0;
tb_id = vrf_table_linkinfo(li);
if (!tb_id) {
fprintf(
stderr
,
"BUG: VRF %s is missing table id\n", name);
return 0;
}
open_json_object(
((void *)0)
);
print_string(PRINT_ANY, "name", "%-16s", name);
print_uint(PRINT_ANY, "table", " %5u", tb_id);
print_string(PRINT_FP,
((void *)0)
, "%s", "\n");
close_json_object();
return 1;
}
| int ipvrf_print(unsigned int *a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
struct_0 *v3;
unsigned long long v4;
char v5;
char v6;
char v7;
char v8;
char v9;
char v10;
unsigned int v12;
v3 = &a0[4];
v0 = *(a0);
v0 -= 32;
if (v0 < 0) {
v12 = 0;
return v12;
}
if (vrf_filter && vrf_filter != v3->field_4) {
v12 = 0;
return v12;
}
parse_rtattr(&v7, 0x3c, v3 + 2, v0);
if (*(&v9)) {
v1 = *((*(&v9) + 4));
if (g_401b34 && v1 != g_401b34) {
v12 = 0;
return v12;
}
}
if (!*(&v8)) {
fprintf(*(&stderr), "BUG: device with ifindex %d has nil ifname\n", v3->field_4);
v12 = 0;
return v12;
}
v4 = rta_getattr_str(*(&v8));
if (!*(&v10)) {
v12 = 0;
return v12;
}
parse_rtattr_flags(&v5, 0x5, *(&v10) + 4, *(*(&v10)) - 4, 0x8000);
if (!*(&v6)) {
v12 = 0;
return v12;
} else if (!strcmp(*(&v6) + 4, "vrf")) {
v2 = vrf_table_linkinfo(&v5);
if (v2) {
open_json_object(0x0);
print_string(0x4, "name", "%-16s", v4);
print_uint(0x4, "table", " %5u", v2);
print_string(0x1, 0x0, "%s", "\n");
close_json_object(0x1, 0x0, "%s", "\n", 0x8000, a5);
v12 = 1;
return v12;
}
fprintf(*(&stderr), "BUG: VRF %s is missing table id\n", v4);
v12 = 0;
return v12;
} else {
v12 = 0;
return v12;
}
}
|
int get_cert_sign_status(void)
{
if (batch) {
return cfg.cert_sign_key;
} else {
return
read_yesno
("Will the certificate be used to sign other certificates? (Y/n): ",
1);
}
}
| long get_cert_sign_status()
{
if ( batch )
return (unsigned int)cfg[141];
else
return read_yesno("Will the certificate be used to sign other certificates? (Y/n): ", 1u);
}
|
static void
tok_finish(Tokenizer *tok)
{
*tok->wptr = '\0';
if ((tok->flags & 1) || tok->wptr != tok->wstart) {
tok->argv[tok->argc++] = tok->wstart;
tok->argv[tok->argc] =
((void *)0)
;
tok->wstart = ++tok->wptr;
}
tok->flags &= ~1;
}
| void tok_finish(struct_0 *a0) {
struct_2 *v0;
int tmp_53;
unsigned long long *v2;
struct_2 *v3;
v0 = &a0->padding_0;
a0->field_20->field_0 = 0;
if ((a0->field_44 & 1) || a0->field_20 != a0->field_30) {
v2 = a0->field_18;
tmp_53 = a0->field_8;
a0->field_8 = a0->field_8 + 1;
v2[tmp_53] = a0->field_30;
*((a0->field_8 * 8 + a0->field_18)) = 0;
a0->field_20 = a0->field_20 + 1;
a0->field_30 = a0->field_20;
}
v3 = a0;
a0->field_44 = a0->field_44 & -2;
return;
}
|
static int
huft_free(struct huft *t)
{
register struct huft *p, *q;
p = t;
while (p != (struct huft *)
((void *)0)
)
{
q = (--p)->v.t;
free(p);
p = q;
}
return 0;
}
| long huft_free(long a1)
{
_QWORD *v2;
long v3;
while ( a1 )
{
v2 = (_QWORD *)(a1 - 16);
v3 = v2[1];
free(v2);
a1 = v3;
}
return 0LL;
}
|
static int
ssh2_capable(int remote_major, int remote_minor)
{
switch (remote_major) {
case 1:
if (remote_minor == 99)
return 1;
break;
case 2:
return 1;
default:
break;
}
return 0;
}
| int ssh2_capable(unsigned long a0, unsigned long a1) {
unsigned int v1;
if (a0 == 1 && a1 == 99)
v1 = 1;
if (a0 == 2)
v1 = 1;
if (a0 == 1 && a1 != 99 || a0 != 1 && a0 != 2)
v1 = 0;
return v1;
}
|
void
verify_volume (void)
{
int may_fail = 0;
if (removed_prefixes_p ())
{
do { if (error_hook) error_hook (); error (0, 0, gettext ("Archive contains file names with leading prefixes removed.")); } while (0)
;
may_fail = 1;
}
if (transform_program_p ())
{
do { if (error_hook) error_hook (); error (0, 0, gettext ("Archive contains transformed file names.")); } while (0)
;
may_fail = 1;
}
if (may_fail)
do { if (error_hook) error_hook (); error (0, 0, gettext ("Verification may fail to locate original files.")); } while (0)
;
clear_directory_table ();
if (!diff_buffer)
diff_init ();
fsync (archive);
ioctl (archive,
(((0U) << (((0 +8)+8)+14)) | (((2)) << (0 +8)) | (((0x4b)) << 0) | ((0) << ((0 +8)+8)))
);
{
struct mtop operation;
int status;
operation.mt_op =
2
;
operation.mt_count = 1;
if (status = (((archive) >= (1 << 30)) ? rmt_ioctl__ (archive - (1 << 30),
(((1U) << (((0 +8)+8)+14)) | ((('m')) << (0 +8)) | (((1)) << 0) | ((((sizeof(struct mtop)))) << ((0 +8)+8)))
, (char *) &operation) : ioctl (archive,
(((1U) << (((0 +8)+8)+14)) | ((('m')) << (0 +8)) | (((1)) << 0) | ((((sizeof(struct mtop)))) << ((0 +8)+8)))
, (char *) &operation)), status < 0)
{
if (
(*__errno_location ())
!=
5
|| (status = (((archive) >= (1 << 30)) ? rmt_ioctl__ (archive - (1 << 30),
(((1U) << (((0 +8)+8)+14)) | ((('m')) << (0 +8)) | (((1)) << 0) | ((((sizeof(struct mtop)))) << ((0 +8)+8)))
, (char *) &operation) : ioctl (archive,
(((1U) << (((0 +8)+8)+14)) | ((('m')) << (0 +8)) | (((1)) << 0) | ((((sizeof(struct mtop)))) << ((0 +8)+8)))
, (char *) &operation)),
status < 0))
{
if ((((archive) >= (1 << 30)) ? rmt_lseek__ (archive - (1 << 30), (off_t) 0,
0
) : lseek (archive, (off_t) 0,
0
)) != 0)
{
seek_warn (archive_name_array[0]);
return;
}
}
}
}
access_mode = ACCESS_READ;
now_verifying = 1;
flush_read ();
while (1)
{
enum read_header status = read_header (¤t_header,
¤t_stat_info,
read_header_auto);
if (status == HEADER_FAILURE)
{
int counter = 0;
do
{
counter++;
set_next_block_after (current_header);
status = read_header (¤t_header, ¤t_stat_info,
read_header_auto);
}
while (status == HEADER_FAILURE);
do { if (error_hook) error_hook (); error (0, 0, ngettext ("VERIFY FAILURE: %d invalid header detected", "VERIFY FAILURE: %d invalid headers detected", counter), counter); exit_status = 2; } while (0)
;
}
if (status == HEADER_END_OF_FILE)
break;
if (status == HEADER_ZERO_BLOCK)
{
set_next_block_after (current_header);
if (!ignore_zeros_option)
{
char buf[((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)];
status = read_header (¤t_header, ¤t_stat_info,
read_header_auto);
if (status == HEADER_ZERO_BLOCK)
break;
do { if ((warning_option & (0x00000001))) do { if (error_hook) error_hook (); error (0, 0, gettext ("A lone zero block at %s"), umaxtostr (current_block_ordinal (), buf)); } while (0); } while (0)
;
}
continue;
}
decode_header (current_header, ¤t_stat_info, ¤t_format, 1);
diff_archive ();
tar_stat_destroy (¤t_stat_info);
}
access_mode = ACCESS_WRITE;
now_verifying = 0;
}
| long long verify_volume() {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned short v3;
unsigned int v4;
char v5;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
v0 = 0;
if (removed_prefixes_p()) {
if (error_hook)
*(5243024)();
error(0x0, 0x0, gettext("Archive contains file names with leading prefixes removed."));
v0 = 1;
}
if (transform_program_p()) {
if (error_hook)
*(5243024)();
error(0x0, 0x0, gettext("Archive contains transformed file names."));
v0 = 1;
}
if (v0) {
if (error_hook)
*(5243024)();
error(0x0, 0x0, gettext("Verification may fail to locate original files."));
}
clear_directory_table();
if (!diff_buffer)
diff_init();
fsync(archive);
ioctl(archive, 0x24b);
v3 = 2;
v4 = 1;
if (archive > 1073741823)
v9 = rmt_ioctl__(archive - 0x40000000, 0x40086d01, &v3, archive - 0x40000000);
else
v9 = ioctl(archive, 0x40086d01);
*(&v9) = v9;
if (((v9 >> 31) & 1)) {
*(&v9) = *(__errno_location());
if (v9 == 5) {
if (archive > 1073741823)
v9 = rmt_ioctl__(archive - 0x40000000, 0x40086d01, &v3, archive - 0x40000000);
else
v9 = ioctl(archive, 0x40086d01);
*(&v9) = v9;
}
if (v9 != 5 || ((v9 >> 31) & 1)) {
if (archive > 1073741823)
*(&v9) = rmt_lseek__(archive - 0x40000000, 0x0, 0x0);
else
*(&v9) = lseek(archive, 0x0, 0x0);
if (v9)
seek_warn(*(archive_name_array));
}
}
if (!((v9 >> 31) & 1) || !v9 || v9 == 5 && !((v9 >> 31) & 1)) {
access_mode = 0;
now_verifying = 1;
flush_read();
while (true) {
v1 = read_header(0x500110, 0x500058, 0x0);
if (v1 == 5) {
v2 = 0;
while (true) {
v2 += 1;
set_next_block_after(current_header);
v1 = read_header(0x500110, 0x500058, 0x0);
if (v1 != 5)
break;
}
if (error_hook)
*(5243024)();
error(0x0, 0x0, ngettext("VERIFY FAILURE: %d invalid header detected", "VERIFY FAILURE: %d invalid headers detected", v2));
exit_status = 2;
}
if (v1 == 4)
break;
if (v1 == 3) {
set_next_block_after(current_header);
if ((ignore_zeros_option ^ 1)) {
v1 = read_header(0x500110, 0x500058, 0x0);
if (v1 == 3)
break;
if (v1 != 3 && (warning_option & 1)) {
if (error_hook)
*(5243024)();
v10 = current_block_ordinal();
v11 = umaxtostr(v10, &v5, v10);
error(0x0, 0x0, gettext("A lone zero block at %s"));
}
}
} else {
decode_header(current_header, 0x500058, 0x5002c0, 0x1);
diff_archive();
tar_stat_destroy(0x500058);
}
}
access_mode = 1;
now_verifying = 0;
}
return 0;
}
|
double
monotime_double(void)
{
struct timespec ts;
monotime_ts(&ts);
return ts.tv_sec + ((double)ts.tv_nsec / 1000000000);
}
| void monotime_double(void)
{
long in_FS_OFFSET;
long local_28;
long local_20;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
monotime_ts(&local_28);
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail((double)local_20 / DAT_00108f38 + (double)local_28);
}
return;
}
|
REDIRECT *
make_redirection (source, instruction, dest_and_filename, flags)
REDIRECTEE source;
enum r_instruction instruction;
REDIRECTEE dest_and_filename;
int flags;
{
REDIRECT *temp;
WORD_DESC *w;
int wlen;
intmax_t lfd;
temp = (REDIRECT *)sh_xmalloc((sizeof (REDIRECT)), "make_cmd.c", 697);
temp->redirector = source;
temp->redirectee = dest_and_filename;
temp->here_doc_eof = 0;
temp->instruction = instruction;
temp->flags = 0;
temp->rflags = flags;
temp->next = (REDIRECT *)
((void *)0)
;
switch (instruction)
{
case r_output_direction:
case r_output_force:
case r_err_and_out:
temp->flags =
01000
|
01
|
0100
;
break;
case r_appending_to:
case r_append_err_and_out:
temp->flags =
02000
|
01
|
0100
;
break;
case r_input_direction:
case r_inputa_direction:
temp->flags =
00
;
break;
case r_input_output:
temp->flags =
02
|
0100
;
break;
case r_deblank_reading_until:
case r_reading_until:
case r_reading_string:
case r_close_this:
case r_duplicating_input:
case r_duplicating_output:
break;
case r_move_input:
case r_move_output:
case r_move_input_word:
case r_move_output_word:
break;
case r_duplicating_input_word:
case r_duplicating_output_word:
w = dest_and_filename.filename;
wlen = strlen (w->word) - 1;
if (w->word[wlen] == '-')
{
w->word[wlen] = '\0';
if (all_digits (w->word) && legal_number (w->word, &lfd) && lfd == (int)lfd)
{
dispose_word (w);
temp->instruction = (instruction == r_duplicating_input_word) ? r_move_input : r_move_output;
temp->redirectee.dest = lfd;
}
else
temp->instruction = (instruction == r_duplicating_input_word) ? r_move_input_word : r_move_output_word;
}
break;
default:
programming_error (gettext("make_redirection: redirection instruction `%d' out of range"), instruction);
abort ();
break;
}
return (temp);
}
| long long make_redirection(unsigned long a0, unsigned long a1, unsigned long long *a2, unsigned long a3) {
unsigned int v0;
char v1;
struct_0 *v2;
unsigned long long v4;
unsigned int v5;
unsigned int v6;
v2 = sh_xmalloc(0x30, "make_cmd.c", 0x2b9);
v2->field_8 = a0;
*(&v2->field_20) = a2;
v2->field_28 = 0;
v2->field_18 = a1;
v2->field_14 = 0;
v2->field_10 = a3;
v2->field_0 = 0;
switch (a1) {
case 0: case 10: case 12:
v2->field_14 = 577;
break;
case 1: case 2:
v2->field_14 = 0;
break;
case 3: case 19:
v2->field_14 = 1089;
break;
case 4: case 5: case 6: case 7: case 8: case 9: case 15: case 16: case 17: case 18:
break;
case 11:
v2->field_14 = 66;
break;
case 13: case 14:
v0 = strlen(*(a2)) - 1;
if (*((v0 + *(a2))) == 45) {
*((v0 + *(a2))) = 0;
if (all_digits(*(a2)) && legal_number(*(a2), &v1, &v1)) {
dispose_word(a2);
if (a1 != 13)
v6 = 16;
else
v6 = 15;
v2->field_18 = v6;
*(&v2->field_20) = *(&v1);
goto LABEL_401559;
}
if (a1 != 13)
v5 = 18;
else
v5 = 17;
v2->field_18 = v5;
}
LABEL_401559:
break;
default:
v4 = gettext("make_redirection: redirection instruction `%d' out of range");
programming_error(v4, a1, v4);
abort();
}
return v2;
}
|
size_t
wcslcpy(wchar_t *dst, const wchar_t *src, size_t siz)
{
wchar_t *d = dst;
const wchar_t *s = src;
size_t n = siz;
if (n != 0 && --n != 0) {
do {
if ((*d++ = *s++) == 0)
break;
} while (--n != 0);
}
if (n == 0) {
if (siz != 0)
*d = '\0';
while (*s++)
;
}
return(s - src - 1);
}
| long long wcslcpy(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned int *v0;
int tmp_22;
int tmp_14;
int tmp_9;
unsigned int *v1;
unsigned long v2;
v0 = a0;
v1 = a1;
v2 = a2;
if (v2) {
v2 -= 1;
if (v2) {
do {
tmp_14 = v1;
v1 += 1;
tmp_22 = v0;
v0 += 1;
*(tmp_22) = *(tmp_14);
} while (*(tmp_22) && (v2 -= 1, v2));
}
}
if (v2)
return (v1 + -1 * a1 >> 2) - 1;
if (a2)
*(v0) = 0;
do {
tmp_9 = v1;
v1 += 1;
} while (*(tmp_9));
return (v1 + -1 * a1 >> 2) - 1;
}
|
static u_int
agent_encode_alg(const struct sshkey *key, const char *alg)
{
if (alg !=
((void *)0)
&& sshkey_type_plain(key->type) == KEY_RSA) {
if (strcmp(alg, "rsa-sha2-256") == 0 ||
strcmp(alg, "rsa-sha2-256-cert-v01@openssh.com") == 0)
return 0x02;
if (strcmp(alg, "rsa-sha2-512") == 0 ||
strcmp(alg, "rsa-sha2-512-cert-v01@openssh.com") == 0)
return 0x04;
}
return 0;
}
| int agent_encode_alg(unsigned int *a0, char *a1) {
unsigned long long v1;
if (a1) {
v1 = sshkey_type_plain(*(a0));
if (!v1) {
v1 = strcmp(a1, "rsa-sha2-256");
if (v1) {
v1 = strcmp(a1, "rsa-sha2-256-cert-v01@openssh.com");
if (v1) {
v1 = strcmp(a1, "rsa-sha2-512");
if (v1)
v1 = strcmp(a1, "rsa-sha2-512-cert-v01@openssh.com");
if (!v1 || !v1)
v1 = 4;
}
}
if (!v1 || !v1)
v1 = 2;
}
}
if (!a1 || v1 || v1 && v1 && v1 && v1)
v1 = 0;
return v1;
}
|
static int get_cmd(FILE *f)
{
char cmd[4] = " ";
int i;
if (fread(cmd, 1, sizeof(cmd) - 1, f) != sizeof(cmd) - 1)
return -1;
for(i = 0; cmds[i].cmd && strcmp(cmds[i].name, cmd) != 0; i++)
;
return cmds[i].cmd;
}
| long get_cmd(FILE *a1)
{
int i;
int ptr;
unsigned long v4;
v4 = __readfsqword(0x28u);
ptr = 2105376;
if ( fread(&ptr, 1uLL, 3uLL, a1) != 3 )
return 0xFFFFFFFFLL;
for ( i = 0; *((_DWORD *)&cmds + 2 * i + 1) && strcmp((const char *)&cmds + 8 * i, (const char *)&ptr); ++i )
;
return *((unsigned int *)&cmds + 2 * i + 1);
}
|
static void
print_files (int number_of_files, char **av)
{
init_parameters (number_of_files);
if (! init_fps (number_of_files, av))
return;
if (storing_columns)
init_store_cols ();
if (first_page_number > 1)
{
if (!skip_to_page (first_page_number))
return;
else
page_number = first_page_number;
}
else
page_number = 1;
init_funcs ();
line_number = line_count;
while (print_page ())
;
}
| void print_files(unsigned long a0, unsigned long long a1) {
init_parameters(a0);
if (!(init_fps(a0, a1) ^ 1)) {
if (storing_columns)
init_store_cols();
if (first_page_number <= 1) {
page_number = 1;
} else {
if (!(!(skip_to_page(first_page_number) ^ 1)))
goto LABEL_401c10;
page_number = first_page_number;
}
init_funcs();
line_number = line_count;
do { } while (print_page());
}
LABEL_401c10:
return;
}
|
xsum (size_t size1, size_t size2)
{
size_t sum = size1 + size2;
return (sum >= size1 ? sum :
(18446744073709551615UL)
);
}
| void xsum(void)
{
halt_baddata();
}
|
static int xdp_delete(struct xdp_req *xdp)
{
xdp_ebpf_cb(xdp, -1,
((void *)0)
);
return 0;
}
| undefined8 xdp_delete(undefined8 param_1)
{
xdp_ebpf_cb(param_1,0xffffffff,0);
return 0;
}
|
void
channel_free(struct ssh *ssh, Channel *c)
{
struct ssh_channels *sc = ssh->chanctxt;
char *s;
u_int i, n;
Channel *other;
struct channel_confirm *cc;
for (n = 0, i = 0; i < sc->channels_alloc; i++) {
if ((other = sc->channels[i]) ==
((void *)0)
)
continue;
n++;
if (c->type == 16 &&
other->type == 20 &&
other->mux_ctx == c) {
other->mux_ctx =
((void *)0)
;
other->type = 4;
other->istate = 3;
other->ostate = 3;
}
}
sshlog("channels.c", __func__, 630, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "channel %d: free: %s, nchannels %u", c->self, c->remote_name ? c->remote_name : "???", n)
;
if (c->type == 16) {
mux_remove_remote_forwardings(ssh, c);
free(c->mux_ctx);
c->mux_ctx =
((void *)0)
;
} else if (c->type == 15) {
free(c->mux_ctx);
c->mux_ctx =
((void *)0)
;
}
if (log_level_get() >= SYSLOG_LEVEL_DEBUG3) {
s = channel_open_message(ssh);
sshlog("channels.c", __func__, 644, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "channel %d: status: %s", c->self, s);
free(s);
}
channel_close_fds(ssh, c);
sshbuf_free(c->input);
sshbuf_free(c->output);
sshbuf_free(c->extended);
c->input = c->output = c->extended =
((void *)0)
;
free(c->remote_name);
c->remote_name =
((void *)0)
;
free(c->path);
c->path =
((void *)0)
;
free(c->listening_addr);
c->listening_addr =
((void *)0)
;
while ((cc = ((&c->status_confirms)->tqh_first)) !=
((void *)0)
) {
if (cc->abandon_cb !=
((void *)0)
)
cc->abandon_cb(ssh, c, cc->ctx);
do { if (((cc)->entry.tqe_next) !=
((void *)0)
) (cc)->entry.tqe_next->entry.tqe_prev = (cc)->entry.tqe_prev; else (&c->status_confirms)->tqh_last = (cc)->entry.tqe_prev; *(cc)->entry.tqe_prev = (cc)->entry.tqe_next; ; ; } while (0);
freezero(cc, sizeof(*cc));
}
if (c->filter_cleanup !=
((void *)0)
&& c->filter_ctx !=
((void *)0)
)
c->filter_cleanup(ssh, c->self, c->filter_ctx);
sc->channels[c->self] =
((void *)0)
;
freezero(c, sizeof(*c));
}
| void channel_free(struct_2 *a0, struct_0 *a1) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned int v3;
unsigned int v4;
struct_3 *v5;
void* v6;
struct_5 *v7;
struct_4 *v8;
unsigned long v10;
struct_1 *v11;
unsigned long long v12;
unsigned long long v13;
v5 = a0->field_868;
v4 = 0;
for (v3 = 0; v3 < v5->field_8; v3 += 1) {
v8 = *((v5->field_0 + v3 * 8));
if (v8) {
v4 += 1;
if (a1->field_0 == 16 && v8->field_0 == 20 && a1 == v8->field_150) {
v8->field_150 = 0;
v8->field_0 = 4;
v8->field_10 = 3;
v8->field_14 = 3;
}
}
}
v10 = (!a1->field_a0 ? a1->field_a0 : "???");
v2 = v4;
v1 = v10;
v0 = a1->field_4;
sshlog("channels.c", "channel_free", 0x276, 0x0, 0x5, 0x0, "channel %d: free: %s, nchannels %u");
switch (a1->field_0) {
case 16:
mux_remove_remote_forwardings(a0, a1);
free(a1->field_150);
a1->field_150 = 0;
break;
case 15:
free(a1->field_150);
a1->field_150 = 0;
break;
default:
goto LABEL_4013c7;
}
LABEL_4013c7:
if (log_level_get() > 6) {
v6 = channel_open_message(a0, a1, 0x276, 0x0, 0x5, 0x0);
v1 = v6;
v0 = a1->field_4;
sshlog("channels.c", "channel_free", 0x284, 0x0, 0x7, 0x0, "channel %d: status: %s");
free(v6);
}
channel_close_fds(a0, a1);
sshbuf_free(a1->field_68);
sshbuf_free(a1->field_70);
sshbuf_free(a1->field_78);
a1->field_78 = 0;
a1->field_70 = a1->field_78;
a1->field_68 = a1->field_70;
free(a1->field_a0);
a1->field_a0 = 0;
free(a1->field_80);
a1->field_80 = 0;
free(a1->field_90);
a1->field_90 = 0;
while (true) {
v7 = a1->field_f0;
if (!v7)
break;
if (v7->field_18)
v7->field_18(a0, a1, v7->field_20, a1, v7->field_18);
if (v7->field_0)
v7->field_0->field_8 = v7->field_8;
else
a1->field_f8 = v7->field_8;
v11 = v7->field_0;
v7->field_8->field_0 = v7->field_0;
freezero(v7, 0x28, v11);
}
if (a1->field_118 && a1->field_110)
a1->field_118(a0, a1->field_4, a1->field_110, a1->field_4, a1->field_118);
v12 = v5->field_0;
*((a1->field_4 * 8 + v5->field_0)) = 0;
v13 = freezero(a1, 0x160, v12);
return;
}
|
const char *port_to_service(const char *sport, const char *proto)
{
unsigned int port;
struct servent *sr;
if (!c_isdigit(sport[0]))
return sport;
port = atoi(sport);
if (port == 0)
return sport;
port = htons(port);
sr = getservbyport(port, proto);
if (sr ==
((void *)0)
) {
fprintf(
stderr
,
"Warning: getservbyport(%s) failed. Using port number as service.\n", sport);
return sport;
}
return sr->s_name;
}
| char * port_to_service(const char *a1, const char *a2)
{
int port;
int porta;
struct servent *v5;
if ( (unsigned char)c_isdigit((unsigned int)*a1) != 1 )
return (char *)a1;
port = atoi(a1);
if ( !port )
return (char *)a1;
porta = htons(port);
v5 = getservbyport(porta, a2);
if ( v5 )
return v5->s_name;
fprintf(stderr, "Warning: getservbyport(%s) failed. Using port number as service.\n", a1);
return (char *)a1;
}
|
static void
window_change_handler(int sig)
{
received_window_change_signal = 1;
}
| void window_change_handler(void)
{
received_window_change_signal = 1;
return;
}
|
static int
rl_vi_domove_getchar (_rl_vimotion_cxt *m)
{
return (_rl_bracketed_read_key ());
}
| long rl_vi_domove_getchar()
{
return rl_bracketed_read_key();
}
|
static void new_table_block(e2fsck_t ctx, blk64_t first_block, dgrp_t group,
const char *name, int num, blk64_t *new_block)
{
ext2_filsys fs = ctx->fs;
dgrp_t last_grp;
blk64_t old_block = *new_block;
blk64_t last_block;
dgrp_t flexbg;
unsigned flexbg_size;
int i, is_flexbg;
char *buf;
struct problem_context pctx;
clear_problem_context(&pctx);
pctx.group = group;
pctx.blk = old_block;
pctx.str = name;
is_flexbg = ext2fs_has_feature_flex_bg(fs->super);
if (is_flexbg) {
flexbg_size = 1 << fs->super->s_log_groups_per_flex;
flexbg = group / flexbg_size;
first_block = ext2fs_group_first_block2(fs,
flexbg_size * flexbg);
last_grp = group | (flexbg_size - 1);
if (last_grp >= fs->group_desc_count)
last_grp = fs->group_desc_count - 1;
last_block = ext2fs_group_last_block2(fs, last_grp);
} else
last_block = ext2fs_group_last_block2(fs, group);
pctx.errcode = ext2fs_get_free_blocks2(fs, first_block, last_block,
num, ctx->block_found_map,
new_block);
if (is_flexbg && (pctx.errcode == (2133571400L)))
pctx.errcode = ext2fs_get_free_blocks2(fs,
fs->super->s_first_data_block,
ext2fs_blocks_count(fs->super),
num, ctx->block_found_map, new_block);
if (pctx.errcode) {
pctx.num = num;
fix_problem(ctx, 0x01001E, &pctx);
ext2fs_unmark_valid(fs);
ctx->flags |= 0x0001;
return;
}
pctx.errcode = ext2fs_get_mem(fs->blocksize, &buf);
if (pctx.errcode) {
fix_problem(ctx, 0x01001F, &pctx);
ext2fs_unmark_valid(fs);
ctx->flags |= 0x0001;
return;
}
ext2fs_mark_super_dirty(fs);
fs->flags &= ~0x200;
pctx.blk2 = *new_block;
fix_problem(ctx, (old_block ? 0x010020 :
0x010021), &pctx);
pctx.blk2 = 0;
for (i = 0; i < num; i++) {
pctx.blk = i;
ext2fs_mark_block_bitmap2(ctx->block_found_map, (*new_block)+i);
if (old_block) {
pctx.errcode = io_channel_read_blk64(fs->io,
old_block + i, 1, buf);
if (pctx.errcode)
fix_problem(ctx, 0x010022, &pctx);
pctx.blk = (*new_block) + i;
pctx.errcode = io_channel_write_blk64(fs->io, pctx.blk,
1, buf);
} else {
pctx.blk = (*new_block) + i;
pctx.errcode = ext2fs_zero_blocks2(fs, pctx.blk, 1,
((void *)0)
,
((void *)0)
);
}
if (pctx.errcode)
fix_problem(ctx, 0x010023, &pctx);
}
ext2fs_free_mem(&buf);
}
| void new_table_block(struct_0 *a0, unsigned long long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long *a5) {
unsigned long v0;
int tmp_24;
unsigned long long v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
char v7;
unsigned long long v8;
struct_1 *v9;
unsigned long v10;
unsigned long v11;
unsigned long v12;
void* v13;
unsigned int v14;
unsigned long v15;
unsigned long v16;
char v17;
unsigned long long v19;
unsigned long long v20;
unsigned long long *v21;
unsigned long long v22;
v1 = a1;
v0 = a3;
v9 = a0->field_0;
v10 = *(a5);
clear_problem_context(&v11);
v14 = a2;
v12 = v10;
v16 = v0;
v4 = ext2fs_has_feature_flex_bg(v9->field_20);
if (v4) {
v5 = 1 << (v9->field_20->field_174 & 31);
v6 = (0 CONCAT a2) /m v5;
v1 = ext2fs_group_first_block2(v9, v6 * v5, v6 * v5, v9->field_20->field_174);
v2 = v5 - 1 | a2;
if (v2 >= v9->field_30)
v2 = v9->field_30 - 1;
v8 = ext2fs_group_last_block2(v9, v2, v2);
} else {
v8 = ext2fs_group_last_block2(v9, a2, a2);
}
v11 = ext2fs_get_free_blocks2(v9, v1, v8, a4, a0->field_1a0, a5);
if (v4 && v11 == 2133571400)
v11 = ext2fs_get_free_blocks2(v9, v9->field_20->field_14, ext2fs_blocks_count(v9->field_20), a4, a0->field_1a0, a5);
if (v11) {
v15 = a4;
fix_problem(a0, 0x1001e, &v11);
ext2fs_unmark_valid(v9);
a0->field_48 = a0->field_48 | 1;
} else {
v11 = ext2fs_get_mem(v9->field_28, &v7, v9->field_28);
if (v11) {
fix_problem(a0, 0x1001f, &v11);
ext2fs_unmark_valid(v9);
a0->field_48 = a0->field_48 | 1;
} else {
ext2fs_mark_super_dirty(v9);
v19 = v9->field_10;
*(&v19) = (v9->field_10 >> 8) & 253;
tmp_24 = v19;
v9->field_10 = tmp_24;
v13 = *(a5);
if (v10)
v20 = 65568;
else
v20 = 65569;
fix_problem(a0, v20, &v11);
v13 = 0;
for (v3 = 0; v3 < a4; v3 += 1) {
v12 = v3;
ext2fs_mark_block_bitmap2(a0->field_1a0, *(a5) + v3, *(a5) + v3);
if (v10) {
v11 = io_channel_read_blk64(v9->field_8, v3 + v10, 0x1, *(&v7));
if (v11)
fix_problem(a0, 0x10022, &v11);
v12 = v3 + *(a5);
v11 = io_channel_write_blk64(v9->field_8, v12, 0x1, *(&v7));
} else {
v12 = v3 + *(a5);
v11 = ext2fs_zero_blocks2(v9, v12, 0x1, 0x0, 0x0);
}
if (v11)
fix_problem(a0, 0x10023, &v11);
}
ext2fs_free_mem(&v7);
}
}
v22 = *(&v17) ^ v21[5];
return;
}
|
static char *
fingerprint_randomart(const char *alg, u_char *dgst_raw, size_t dgst_raw_len,
const struct sshkey *k)
{
char *augmentation_string = " .o+=*BOX@%&#/^SE";
char *retval, *p, title[(8 * 2 + 1)], hash[(8 * 2 + 1)];
u_char field[(8 * 2 + 1)][(8 + 1)];
size_t i, tlen, hlen;
u_int b;
int x, y, r;
size_t len = strlen(augmentation_string) - 1;
if ((retval = calloc(((8 * 2 + 1) + 3), ((8 + 1) + 2))) ==
((void *)0)
)
return
((void *)0)
;
memset(field, 0, (8 * 2 + 1) * (8 + 1) * sizeof(char));
x = (8 * 2 + 1) / 2;
y = (8 + 1) / 2;
for (i = 0; i < dgst_raw_len; i++) {
int input;
input = dgst_raw[i];
for (b = 0; b < 4; b++) {
x += (input & 0x1) ? 1 : -1;
y += (input & 0x2) ? 1 : -1;
x = (((x) > (0)) ? (x) : (0));
y = (((y) > (0)) ? (y) : (0));
x = (((x) < ((8 * 2 + 1) - 1)) ? (x) : ((8 * 2 + 1) - 1));
y = (((y) < ((8 + 1) - 1)) ? (y) : ((8 + 1) - 1));
if (field[x][y] < len - 2)
field[x][y]++;
input = input >> 2;
}
}
field[(8 * 2 + 1) / 2][(8 + 1) / 2] = len - 1;
field[x][y] = len;
r = snprintf(title, sizeof(title), "[%s %u]",
sshkey_type(k), sshkey_size(k));
if (r < 0 || r > (int)sizeof(title))
r = snprintf(title, sizeof(title), "[%s]", sshkey_type(k));
tlen = (r <= 0) ? 0 : strlen(title);
r = snprintf(hash, sizeof(hash), "[%s]", alg);
hlen = (r <= 0) ? 0 : strlen(hash);
p = retval;
*p++ = '+';
for (i = 0; i < ((8 * 2 + 1) - tlen) / 2; i++)
*p++ = '-';
memcpy(p, title, tlen);
p += tlen;
for (i += tlen; i < (8 * 2 + 1); i++)
*p++ = '-';
*p++ = '+';
*p++ = '\n';
for (y = 0; y < (8 + 1); y++) {
*p++ = '|';
for (x = 0; x < (8 * 2 + 1); x++)
*p++ = augmentation_string[(((field[x][y]) < (len)) ? (field[x][y]) : (len))];
*p++ = '|';
*p++ = '\n';
}
*p++ = '+';
for (i = 0; i < ((8 * 2 + 1) - hlen) / 2; i++)
*p++ = '-';
memcpy(p, hash, hlen);
p += hlen;
for (i += hlen; i < (8 * 2 + 1); i++)
*p++ = '-';
*p++ = '+';
return retval;
}
| int fingerprint_randomart(unsigned long a0, void* a1, unsigned long a2, void* a3) {
void* v0;
int tmp_19;
int tmp_11;
int tmp_13;
int tmp_21;
int tmp_7;
unsigned long v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
char *v7;
void* v8;
unsigned long long v9;
unsigned long long v10;
unsigned long v11;
void* v12;
void* v13;
char v14;
char v15;
char v16;
char v17;
unsigned int v19;
unsigned long long v21;
void* v22;
void* v23;
char *v24;
char *v25;
char *v26;
unsigned long long v27;
unsigned long long v28;
char *v29;
char *v30;
v1 = a2;
v0 = a3;
v9 = " .o+=*BOX@%&#/^SE";
v10 = strlen(v9) - 1;
v11 = calloc(0x14, 0xb);
if (!v11) {
v19 = 0;
return v19;
}
memset(&v14, 0x0, 0x99);
v3 = 8;
v4 = 4;
for (v8 = 0; v8 < v1; v8 += 1) {
v6 = *((v8 + a1));
for (v2 = 0; v2 <= 3; v2 += 1) {
v3 = __addvsi3(v3, (!(v6 & 1) ? 1 : 4294967295));
v21 = (!(v6 & 2) ? 1 : 4294967295);
v4 = __addvsi3(v4, v21);
*(&v21) = (!(v3 - 0 >> 31 & 1) ? 0 : v3);
v3 = v21;
*(&v21) = (!(v4 - 0 >> 31 & 1) ? 0 : v4);
v4 = v21;
*(&v21) = (v3 <= 16 ? 16 : v3);
v3 = v21;
*(&v21) = (v4 <= 8 ? 8 : v4);
v4 = v21;
if ((&v14)[8 * v3 + v4 + v3] < v10 - 2)
(&v14)[8 * v3 + v4 + v3] = (&v14)[8 * v3 + v4 + v3] + 1;
v6 >>= 2;
}
}
v15 = v10 - 1;
(&v14)[8 * v3 + v4 + v3] = v10;
v5 = snprintf(&v16, 0x11, "[%s %u]", sshkey_type(v0), sshkey_size(v0));
if (v5 < 0 || v5 > 17)
v5 = snprintf(&v16, 0x11, "[%s]", sshkey_type(v0));
if (v5 <= 0)
v22 = 0;
else
v22 = strlen(&v16);
v12 = v22;
v5 = snprintf(&v17, 0x11, "[%s]", a0);
if (v5 <= 0)
v23 = 0;
else
v23 = strlen(&v17);
v13 = v23;
v7 = v11;
tmp_19 = v7;
v7 += 1;
*(tmp_19) = 43;
for (v8 = 0; v8 < 17 - v12 >> 1; v8 += 1) {
v24 = v7;
v7 += 1;
*(v24) = 45;
}
memcpy(v7, &v16, v12);
v7 += v12;
for (v8 += v12; v8 <= 16; v8 += 1) {
v25 = v7;
v7 += 1;
*(v25) = 45;
}
tmp_11 = v7;
v7 += 1;
*(tmp_11) = 43;
tmp_19 = v7;
v7 += 1;
*(tmp_19) = 10;
for (v4 = 0; v4 <= 8; v4 = __addvsi3(v4, 0x1)) {
v26 = v7;
v7 += 1;
*(v26) = 124;
for (v3 = 0; v3 <= 16; v3 = __addvsi3(v3, 0x1)) {
v27 = (&v14)[8 * v3 + v4 + v3];
if (v10 <= (&v14)[8 * v3 + v4 + v3])
v27 = v10;
v28 = v27;
v29 = v27 * 2;
v30 = v7;
v7 = v28 + 1;
*(v30) = *(v29);
}
tmp_13 = v7;
v7 += 1;
*(tmp_13) = 124;
tmp_21 = v7;
v7 += 1;
*(tmp_21) = 10;
}
v19 = v7;
v7 += 1;
*(v19) = 43;
for (v8 = 0; v8 < 17 - v13 >> 1; v8 += 1) {
v19 = v7;
v7 += 1;
*(v19) = 45;
}
memcpy(v7, &v17, v13);
v7 += v13;
for (v8 += v13; v8 <= 16; v8 += 1) {
v19 = v7;
v7 += 1;
*(v19) = 45;
}
tmp_7 = v7;
v7 += 1;
*(tmp_7) = 43;
v19 = v11;
return v19;
}
|
int
find_index_in_alist (string, alist, flags)
char *string;
STRING_INT_ALIST *alist;
int flags;
{
register int i;
int r;
for (i = r = 0; alist[i].word; i++)
{
if (flags)
r = strmatch (alist[i].word, string, (1 << 5)) != 1;
else
r = ((string)[0] == (alist[i].word)[0] && strcmp(string, alist[i].word) == 0);
if (r)
return (i);
}
return -1;
}
| long long find_index_in_alist(char *a0, unsigned long long a1, unsigned long a2) {
unsigned int v0;
unsigned long long v2;
unsigned int v3;
unsigned int v4;
unsigned long long v5;
v0 = 0;
v2 = v0;
while (true) {
if (*((a1 + (v2 << 4)))) {
if (a2) {
v4 = strmatch(*((a1 + (v2 << 4))), a0, 0x20, a0) != 1;
v0 = v4;
} else {
if (*(a0) == *(*((a1 + (v2 << 4))))) {
v3 = strcmp(a0, *((a1 + v2 * 16)));
if (!v3)
v3 = 1;
}
if (*(a0) != *(*((a1 + (v2 << 4)))) || v3)
v3 = 0;
v0 = v3;
}
if (v0) {
v5 = v2;
break;
} else {
v2 = v2 + 1;
}
} else {
v5 = 4294967295;
break;
}
}
return v5;
}
|
void
_rl_pop_executing_macro (void)
{
struct saved_macro *macro;
if (rl_executing_macro) free (rl_executing_macro);
rl_executing_macro = (char *)
((void *)0)
;
executing_macro_index = 0;
if (macro_list)
{
macro = macro_list;
rl_executing_macro = macro_list->string;
executing_macro_index = macro_list->sindex;
macro_list = macro_list->next;
xfree (macro);
}
macro_level--;
if (rl_executing_macro == 0)
(rl_readline_state &= ~(0x0000800));
}
| void _rl_pop_executing_macro() {
struct_0 *v0;
int tmp_7;
struct_0 *v2;
struct_0 *v3;
if (rl_executing_macro)
free(rl_executing_macro);
rl_executing_macro = 0;
executing_macro_index = 0;
if (macro_list) {
v0 = macro_list;
rl_executing_macro = *((macro_list + 8));
executing_macro_index = *((macro_list + 16));
macro_list = *(macro_list);
xfree(v0);
}
macro_level = macro_level - 1;
v2 = rl_executing_macro;
if (!rl_executing_macro) {
v3 = rl_readline_state;
*(&v3) = (rl_readline_state >> 8) & 247;
tmp_7 = v3;
rl_readline_state = tmp_7;
}
return;
}
|
(r = sshbuf_put_u32(req, ll < 0 ? 0 : ll)) != 0 ||
(r = sshbuf_putb(req, msg)) != 0) {
sshlog("ssh-sk-client.c", __func__, 163, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "compose");
goto out;
}
| void sshbuf_put_u32(void)
{
halt_baddata();
}
|
static inline __u8 rta_getattr_u8(const struct rtattr *rta)
{
return *(__u8 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| long rta_getattr_u8(long a1)
{
return *(unsigned char *)(a1 + 4);
}
|
static inline __u8 rta_getattr_u8(const struct rtattr *rta)
{
return *(__u8 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| int rta_getattr_u8(struct_0 *a0) {
return a0->field_4;
}
|
char *
make_variable_value (var, value, flags)
SHELL_VAR *var;
char *value;
int flags;
{
char *retval, *oval;
intmax_t lval, rval;
int expok, olen, op;
if ((flags & 0x0100) == 0 && ((((var)->attributes) & (0x0000010))))
{
if (flags & 0x0001)
{
oval = ((var)->value);
lval = evalexp (oval, 0, &expok);
if (expok == 0)
{
if (flags & 0x0200)
goto make_value;
else
{
top_level_cleanup ();
jump_to_top_level (2);
}
}
}
rval = evalexp (value, 0, &expok);
if (expok == 0)
{
if (flags & 0x0200)
goto make_value;
else
{
top_level_cleanup ();
jump_to_top_level (2);
}
}
if (flags & 0x0001)
rval += lval;
retval = itos (rval);
}
else if ((flags & 0x0100) == 0 && (((((var)->attributes) & (0x0000400))) || ((((var)->attributes) & (0x0000100))) || ((((var)->attributes) & (0x0000200)))))
{
if (flags & 0x0001)
{
oval = get_variable_value (var);
if (oval == 0)
oval = "";
olen = (((oval) && (oval)[0]) ? ((oval)[1] ? ((oval)[2] ? strlen(oval) : 2) : 1) : 0);
retval = (char *)sh_xmalloc((olen + (value ? (((value) && (value)[0]) ? ((value)[1] ? ((value)[2] ? strlen(value) : 2) : 1) : 0) : 0) + 1), "variables.c", 2984);
strcpy (retval, oval);
if (value)
strcpy (retval+olen, value);
}
else if (*value)
retval = (char *)strcpy (sh_xmalloc((1 + strlen (value)), "variables.c", 2990), (value));
else
{
retval = (char *)sh_xmalloc((1), "variables.c", 2993);
retval[0] = '\0';
}
op = ((((var)->attributes) & (0x0000400))) ? 0x0004
: (((((var)->attributes) & (0x0000100))) ? 0x0002 : 0x0001);
oval = sh_modcase (retval, (char *)0, op);
sh_xfree((retval), "variables.c", 2999);
retval = oval;
}
else if (value)
{
make_value:
if (flags & 0x0001)
{
oval = get_variable_value (var);
if (oval == 0)
oval = "";
olen = (((oval) && (oval)[0]) ? ((oval)[1] ? ((oval)[2] ? strlen(oval) : 2) : 1) : 0);
retval = (char *)sh_xmalloc((olen + (value ? (((value) && (value)[0]) ? ((value)[1] ? ((value)[2] ? strlen(value) : 2) : 1) : 0) : 0) + 1), "variables.c", 3012);
strcpy (retval, oval);
if (value)
strcpy (retval+olen, value);
}
else if (*value)
retval = (char *)strcpy (sh_xmalloc((1 + strlen (value)), "variables.c", 3018), (value));
else
{
retval = (char *)sh_xmalloc((1), "variables.c", 3021);
retval[0] = '\0';
}
}
else
retval = (char *)
((void *)0)
;
return retval;
}
| char * make_variable_value(long a1, long a2, short a3)
{
int v3;
long v4;
size_t v5;
size_t v6;
char *v7;
unsigned int v8;
int v9;
long v10;
size_t v11;
size_t v12;
char *v13;
int v16;
int v17;
unsigned int v18;
char *dest;
char *s;
long v21;
long v22;
unsigned long v23;
v23 = __readfsqword(0x28u);
if ( (a3 & 0x100) == 0 && (*(_DWORD *)(a1 + 40) & 0x10) != 0 )
{
if ( (a3 & 1) == 0 )
goto LABEL_7;
s = *(char **)(a1 + 8);
v21 = evalexp(s, 0LL, &v16);
if ( v16 )
goto LABEL_7;
if ( (a3 & 0x200) == 0 )
{
top_level_cleanup();
jump_to_top_level(2LL);
LABEL_7:
v22 = evalexp(a2, 0LL, &v16);
if ( v16 )
{
LABEL_10:
if ( (a3 & 1) != 0 )
v22 += v21;
return (char *)itos(v22);
}
if ( (a3 & 0x200) == 0 )
{
top_level_cleanup();
jump_to_top_level(2LL);
goto LABEL_10;
}
}
LABEL_49:
if ( (a3 & 1) != 0 )
{
s = (char *)get_variable_value(a1);
if ( !s )
s = (char *)&unk_BCF4;
if ( s && *s )
{
if ( s[1] )
{
if ( s[2] )
v9 = strlen(s);
else
v9 = 2;
}
else
{
v9 = 1;
}
}
else
{
v9 = 0;
}
v17 = v9;
v10 = v9;
if ( a2 )
{
if ( *(_BYTE *)a2 )
{
if ( *(_BYTE *)(a2 + 1) )
{
if ( *(_BYTE *)(a2 + 2) )
v11 = strlen((const char *)a2);
else
v11 = 2LL;
}
else
{
v11 = 1LL;
}
}
else
{
v11 = 0LL;
}
}
else
{
v11 = 0LL;
}
dest = (char *)sh_xmalloc(v10 + v11 + 1, "variables.c", 3012LL);
strcpy(dest, s);
if ( a2 )
strcpy(&dest[v17], (const char *)a2);
}
else if ( *(_BYTE *)a2 )
{
v12 = strlen((const char *)a2);
v13 = (char *)sh_xmalloc(v12 + 1, "variables.c", 3018LL);
return strcpy(v13, (const char *)a2);
}
else
{
dest = (char *)sh_xmalloc(1LL, "variables.c", 3021LL);
*dest = 0;
}
return dest;
}
if ( (a3 & 0x100) != 0
|| (*(_DWORD *)(a1 + 40) & 0x400) == 0 && (*(_DWORD *)(a1 + 40) & 0x100) == 0 && (*(_DWORD *)(a1 + 40) & 0x200) == 0 )
{
if ( !a2 )
return 0LL;
goto LABEL_49;
}
if ( (a3 & 1) != 0 )
{
s = (char *)get_variable_value(a1);
if ( !s )
s = (char *)&unk_BCF4;
if ( s && *s )
{
if ( s[1] )
{
if ( s[2] )
v3 = strlen(s);
else
v3 = 2;
}
else
{
v3 = 1;
}
}
else
{
v3 = 0;
}
v17 = v3;
v4 = v3;
if ( a2 )
{
if ( *(_BYTE *)a2 )
{
if ( *(_BYTE *)(a2 + 1) )
{
if ( *(_BYTE *)(a2 + 2) )
v5 = strlen((const char *)a2);
else
v5 = 2LL;
}
else
{
v5 = 1LL;
}
}
else
{
v5 = 0LL;
}
}
else
{
v5 = 0LL;
}
dest = (char *)sh_xmalloc(v4 + v5 + 1, "variables.c", 2984LL);
strcpy(dest, s);
if ( a2 )
strcpy(&dest[v17], (const char *)a2);
}
else if ( *(_BYTE *)a2 )
{
v6 = strlen((const char *)a2);
v7 = (char *)sh_xmalloc(v6 + 1, "variables.c", 2990LL);
dest = strcpy(v7, (const char *)a2);
}
else
{
dest = (char *)sh_xmalloc(1LL, "variables.c", 2993LL);
*dest = 0;
}
if ( (*(_DWORD *)(a1 + 40) & 0x400) != 0 )
{
v8 = 4;
}
else if ( (*(_DWORD *)(a1 + 40) & 0x100) != 0 )
{
v8 = 2;
}
else
{
v8 = 1;
}
v18 = v8;
s = (char *)sh_modcase(dest, 0LL, v8);
sh_xfree(dest, "variables.c", 2999LL);
return s;
}
|
static __inline void
_rs_init(unsigned char *buf, size_t n)
{
if (n < 32 + 8)
return;
if (rs ==
((void *)0)
) {
if (_rs_allocate(&rs, &rsx) == -1)
_exit(1);
}
chacha_keysetup(&rsx->rs_chacha, buf, 32 * 8);
chacha_ivsetup(&rsx->rs_chacha, buf + 32);
}
| void _rs_init(unsigned int a0, unsigned long a1) {
unsigned long long v1;
if (a1 <= 39)
return;
if (!rs && _rs_allocate(&rs, &rsx) == -1)
_exit(0x1);
chacha_keysetup(rsx, a0, 0x100);
v1 = chacha_ivsetup(rsx, a0 + 32);
return;
}
|
static void
_rs_stir(void)
{
u_char rnd[32 + 8];
uint32_t rekey_fuzz = 0;
if (getentropy(rnd, sizeof rnd) == -1)
_getentropy_fail();
if (!rs)
_rs_init(rnd, sizeof(rnd));
else
_rs_rekey(rnd, sizeof(rnd));
explicit_bzero(rnd, sizeof(rnd));
rs->rs_have = 0;
memset(rsx->rs_buf, 0, sizeof(rsx->rs_buf));
chacha_encrypt_bytes(&rsx->rs_chacha, (uint8_t *)&rekey_fuzz,
(uint8_t *)&rekey_fuzz, sizeof(rekey_fuzz));
rs->rs_count = (1024*1024) + (rekey_fuzz % (1024*1024));
}
| void _rs_stir(void)
{
int iVar1;
long in_FS_OFFSET;
uint local_3c;
undefined local_38 [40];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_3c = 0;
iVar1 = getentropy(local_38,0x28);
if (iVar1 == -1) {
_getentropy_fail();
}
if (rs == (undefined8 *)0x0) {
_rs_init(local_38,0x28);
}
else {
_rs_rekey(local_38,0x28);
}
explicit_bzero(local_38,0x28);
*rs = 0;
memset((void *)(rsx + 0x40),0,0x400);
chacha_encrypt_bytes(rsx,&local_3c,&local_3c,4);
rs[1] = (ulong)((local_3c & 0xfffff) + 0x100000);
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static void new_grent (struct group *grent)
{
explicit_bzero((grent), (sizeof *grent));
grent->gr_name = group_name;
if (pflg) {
grent->gr_passwd = group_passwd;
} else {
grent->gr_passwd = "x";
}
grent->gr_gid = group_id;
grent->gr_mem = &empty_list;
}
| long long new_grent(struct_0 *a0) {
explicit_bzero(a0, 0x20);
a0->field_0 = group_name;
if (pflg)
a0->field_8 = group_passwd;
else
a0->field_8 = "x";
a0->field_10 = group_id;
a0->field_18 = &empty_list;
return a0;
}
|
static
_Bool
strict_posix2 (void)
{
int posix_ver = posix2_version ();
return 200112 <= posix_ver && posix_ver < 200809;
}
| undefined4 strict_posix2(void)
{
int iVar1;
undefined4 uVar2;
iVar1 = posix2_version();
if ((iVar1 < 0x30db0) || (0x31068 < iVar1)) {
uVar2 = 0;
}
else {
uVar2 = 1;
}
return uVar2;
}
|
const char *get_pass(void)
{
return getpass("Enter password: ");
}
| void get_pass(void)
{
getpass("Enter password: ");
return;
}
|
int
user_key_allowed(struct ssh *ssh, struct passwd *pw, struct sshkey *key,
int auth_attempt, struct sshauthopt **authoptsp)
{
u_int success = 0, i;
char *file;
struct sshauthopt *opts =
((void *)0)
;
const char *remote_ip = ssh_remote_ipaddr(ssh);
const char *remote_host = auth_get_canonical_hostname(ssh,
options.use_dns);
if (authoptsp !=
((void *)0)
)
*authoptsp =
((void *)0)
;
if (auth_key_is_revoked(key))
return 0;
if (sshkey_is_cert(key) &&
auth_key_is_revoked(key->cert->signature_key))
return 0;
for (i = 0; !success && i < options.num_authkeys_files; i++) {
if (strcasecmp(options.authorized_keys_files[i], "none") == 0)
continue;
file = expand_authorized_keys(
options.authorized_keys_files[i], pw);
success = user_key_allowed2(pw, key, file,
remote_ip, remote_host, &opts);
free(file);
if (!success) {
sshauthopt_free(opts);
opts =
((void *)0)
;
}
}
if (success)
goto out;
if ((success = user_cert_trusted_ca(pw, key, remote_ip, remote_host,
&opts)) != 0)
goto out;
sshauthopt_free(opts);
opts =
((void *)0)
;
if ((success = user_key_command_allowed2(pw, key, remote_ip,
remote_host, &opts)) != 0)
goto out;
sshauthopt_free(opts);
opts =
((void *)0)
;
out:
if (success && authoptsp !=
((void *)0)
) {
*authoptsp = opts;
opts =
((void *)0)
;
}
sshauthopt_free(opts);
return success;
}
| int user_key_allowed(undefined8 param_1,undefined8 param_2,long param_3,undefined8 param_4,
undefined8 *param_5)
{
int iVar1;
long in_FS_OFFSET;
int local_38;
uint local_34;
undefined8 local_30;
undefined8 local_28;
undefined8 local_20;
void *local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_38 = 0;
local_30 = 0;
local_28 = ssh_remote_ipaddr(param_1);
local_20 = auth_get_canonical_hostname(param_1,_DAT_00105df8);
if (param_5 != (undefined8 *)0x0) {
*param_5 = 0;
}
iVar1 = auth_key_is_revoked(param_3);
if (iVar1 == 0) {
iVar1 = sshkey_is_cert(param_3);
if ((iVar1 == 0) ||
(iVar1 = auth_key_is_revoked(*(undefined8 *)(*(long *)(param_3 + 0x80) + 0x50)), iVar1 == 0))
{
for (local_34 = 0; (local_38 == 0 && (local_34 < _DAT_00105e04)); local_34 = local_34 + 1) {
iVar1 = strcasecmp(*(char **)(_DAT_00105e08 + (ulong)local_34 * 8),"none");
if (iVar1 != 0) {
local_18 = (void *)expand_authorized_keys
(*(undefined8 *)(_DAT_00105e08 + (ulong)local_34 * 8),param_2
);
local_38 = user_key_allowed2(param_2,param_3,local_18,local_28,local_20,&local_30);
free(local_18);
if (local_38 == 0) {
sshauthopt_free(local_30);
local_30 = 0;
}
}
}
if ((local_38 == 0) &&
(local_38 = user_cert_trusted_ca(param_2,param_3,local_28,local_20,&local_30),
local_38 == 0)) {
sshauthopt_free(local_30);
local_30 = 0;
local_38 = user_key_command_allowed2(param_2,param_3,local_28,local_20,&local_30);
if (local_38 == 0) {
sshauthopt_free(local_30);
local_30 = 0;
}
}
if ((local_38 != 0) && (param_5 != (undefined8 *)0x0)) {
*param_5 = local_30;
local_30 = 0;
}
sshauthopt_free(local_30);
}
else {
local_38 = 0;
}
}
else {
local_38 = 0;
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return local_38;
}
__stack_chk_fail();
}
|
int
trap_builtin (list)
WORD_LIST *list;
{
int list_signal_names, display, result, opt;
list_signal_names = display = 0;
result = 0;
reset_internal_getopt ();
while ((opt = internal_getopt (list, "lp")) != -1)
{
switch (opt)
{
case 'l':
list_signal_names++;
break;
case 'p':
display++;
break;
case -99: builtin_help (); return (258);
default:
builtin_usage ();
return (258);
}
}
list = loptend;
opt = 0x02|0x01;
if (list_signal_names)
return (sh_chkwrite (display_signal_list ((WORD_LIST *)
((void *)0)
, 1)));
else if (display || list == 0)
{
initialize_terminating_signals ();
get_all_original_signals ();
return (sh_chkwrite (display_traps (list, display && posixly_correct)));
}
else
{
char *first_arg;
int operation, sig, first_signal;
operation = 0;
first_arg = list->word->word;
first_signal = first_arg && *first_arg && all_digits (first_arg) && (decode_signal (first_arg,opt) != -1);
if (first_signal)
operation = 1;
else if (posixly_correct == 0 && first_arg && *first_arg &&
(*first_arg != '-' || first_arg[1]) &&
(decode_signal (first_arg,opt) != -1) && list->next == 0)
operation = 1;
else
{
list = list->next;
if (list == 0)
{
builtin_usage ();
return (258);
}
else if (*first_arg == '\0')
operation = 2;
else if (first_arg[0] == '-' && !first_arg[1])
operation = 1;
}
if (subshell_environment & 0x80)
{
free_trap_strings ();
subshell_environment &= ~0x80;
}
while (list)
{
sig = decode_signal (list->word->word, opt);
if (sig == -1)
{
sh_invalidsig (list->word->word);
result = 1;
}
else
{
switch (operation)
{
case 0:
set_signal (sig, first_arg);
break;
case 1:
restore_default_signal (sig);
switch (sig)
{
case
2
:
if (interactive)
set_signal_handler (
2
, sigint_sighandler);
else if (interactive_shell && (sourcelevel||running_trap||parse_and_execute_level))
set_signal_handler (
2
, sigint_sighandler);
else
set_signal_handler (
2
, termsig_sighandler);
break;
case
3
:
set_signal_handler (
3
,
((__sighandler_t) 1)
);
break;
case
15
:
case
21
:
case
22
:
case
20
:
if (interactive)
set_signal_handler (sig,
((__sighandler_t) 1)
);
break;
}
break;
case 2:
ignore_signal (sig);
break;
}
}
list = list->next;
}
}
return (result);
}
| long long trap_builtin(unsigned long long a0, unsigned long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
struct_0 *v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
char v8[2];
unsigned long long v10;
unsigned long long v11;
unsigned int v12;
unsigned int v13;
v0 = a0;
v2 = 0;
v1 = v2;
v3 = 0;
reset_internal_getopt();
while (true) {
v5 = internal_getopt(v0, "lp");
if (v5 == -1) {
v0 = loptend;
v5 = 3;
if (v1) {
v10 = sh_chkwrite(display_signal_list(0x0, 0x1));
break;
}
if (!v2 && v0) {
v4 = 0;
*(&v8) = v0->field_8->field_0;
if (v8 && v8[0] && all_digits(v8) && decode_signal(v8, v5, v5) != -1) {
v12 = 1;
goto LABEL_400163;
}
v12 = 0;
LABEL_400163:
v6 = v12;
if (v6) {
v4 = 1;
goto LABEL_40022f;
}
if (!*(&posixly_correct) && v8 && v8[0]) {
if (v8[0] == 45 && !v8[1])
goto LABEL_4001d9;
if (decode_signal(v8, v5, v5) != -1 && !v0->field_0) {
v4 = 1;
goto LABEL_40022f;
}
}
LABEL_4001d9:
v0 = v0->field_0;
if (!v0) {
builtin_usage();
v10 = 258;
break;
} else if (!v8[0]) {
v4 = 2;
} else if (v8[0] == 45 && !v8[1]) {
v4 = 1;
}
LABEL_40022f:
if ((subshell_environment & 128)) {
free_trap_strings();
v13 = subshell_environment;
*(&v13) = subshell_environment & 127;
subshell_environment = v13;
}
while (true) {
if (!v0)
goto LABEL_4003dc;
v7 = decode_signal(v0->field_8->field_0, v5, v5);
if (v7 == -1) {
sh_invalidsig(v0->field_8->field_0);
v3 = 1;
goto LABEL_4003c5;
}
if (v4 == 2) {
ignore_signal(v7);
goto LABEL_4003c5;
}
if (!(v4 <= 2))
goto LABEL_4003c5;
if (!v4) {
set_signal(v7, v8, v8);
goto LABEL_4003c5;
}
if (!(v4 == 1))
goto LABEL_4003c5;
restore_default_signal(v7);
if (v7 <= 22)
break;
LABEL_4003c5:
v0 = v0->field_0;
}
if (v7 < 20 && v7 != 15) {
if (!(v7 <= 15))
goto LABEL_4003c5;
if (v7 != 2) {
if (!(v7 == 3))
goto LABEL_4003c5;
set_signal_handler(0x3, 0x1);
}
if (*(&interactive))
set_signal_handler(0x2, *(&got.sigint_sighandler));
if (!interactive_shell) {
LABEL_400376:
set_signal_handler(0x2, got.termsig_sighandler);
} else {
if (!sourcelevel && !running_trap && !parse_and_execute_level)
goto LABEL_400376;
set_signal_handler(0x2, *(&got.sigint_sighandler));
}
}
if (*(&interactive))
set_signal_handler(v7, 0x1);
LABEL_4003dc:
v10 = v3;
break;
}
initialize_terminating_signals();
get_all_original_signals(a0, "lp", a2, a3, a4, a5);
if (v2 && *(&posixly_correct)) {
v11 = 1;
goto LABEL_4000ef;
}
v11 = 0;
LABEL_4000ef:
v10 = sh_chkwrite(display_traps(v0, v11, v11));
break;
}
if (v5 == 112) {
v2 += 1;
continue;
}
if (v5 > 112) {
LABEL_40005e:
builtin_usage();
v10 = 258;
break;
} else {
if (v5 == -99) {
builtin_help();
v10 = 258;
break;
}
if (!(v5 == 108))
goto LABEL_40005e;
v1 += 1;
}
}
return v10;
}
|
static inline int
_rl_vi_backup_point (void)
{
int point;
point = rl_point;
if (rl_point > 0)
{
if (
(__ctype_get_mb_cur_max ())
== 1 || rl_byte_oriented)
rl_point--;
else
{
point = rl_point;
rl_point = _rl_backward_char_internal (1);
if (rl_point < 0)
rl_point = 0;
}
}
return point;
}
| int _rl_vi_backup_point() {
unsigned int v0;
v0 = rl_point;
if (rl_point <= 0)
return v0;
if (__ctype_get_mb_cur_max() != 1 && !rl_byte_oriented) {
v0 = rl_point;
rl_point = _rl_backward_char_internal(0x1);
if (rl_point < 0) {
rl_point = 0;
return v0;
}
return v0;
}
rl_point = rl_point - 1;
return v0;
}
|
int
pkcs11_del_provider(char *provider_id)
{
struct pkcs11_provider *p;
if ((p = pkcs11_provider_lookup(provider_id)) !=
((void *)0)
) {
do { if (((p)->next.tqe_next) !=
((void *)0)
) (p)->next.tqe_next->next.tqe_prev = (p)->next.tqe_prev; else (&pkcs11_providers)->tqh_last = (p)->next.tqe_prev; *(p)->next.tqe_prev = (p)->next.tqe_next; ; ; } while (0);
pkcs11_provider_finalize(p);
pkcs11_provider_unref(p);
return (0);
}
return (-1);
}
| long long pkcs11_del_provider(char *a0) {
struct_0 *v0;
unsigned long long v2;
v0 = pkcs11_provider_lookup(a0);
if (!v0) {
v2 = 4294967295;
} else {
if (v0->field_90)
v0->field_90->field_98 = v0->field_98;
else
g_400018 = &v0->field_98->field_0;
v0->field_98->field_0 = v0->field_90;
pkcs11_provider_finalize(v0);
pkcs11_provider_unref(v0);
v2 = 0;
}
return v2;
}
|
void print_cert_info2(gnutls_session_t session, int verbose, FILE *out, int print_cert)
{
int flag, print_crt_status = 0;
if (verbose)
flag = GNUTLS_CRT_PRINT_FULL;
else
flag = GNUTLS_CRT_PRINT_COMPACT;
if (gnutls_certificate_client_get_request_status(session) != 0) {
log_msg(
stdout
, "- Server has requested a certificate.\n");
print_crt_status = 1;
}
switch (gnutls_certificate_type_get2(session, GNUTLS_CTYPE_PEERS)) {
case GNUTLS_CRT_X509:
print_x509_info(session, out, flag, print_cert, print_crt_status);
break;
case GNUTLS_CRT_RAWPK:
print_rawpk_info(session, out, flag, print_cert, print_crt_status);
break;
default:
break;
}
}
| void print_cert_info2(unsigned long long a0, unsigned long a1, unsigned long long a2, unsigned long a3) {
unsigned int v0;
unsigned int v1;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
v1 = 0;
if (a1)
v0 = 0;
else
v0 = 3;
if (gnutls_certificate_client_get_request_status(a0)) {
log_msg();
v1 = 1;
}
v4 = gnutls_certificate_type_get2(a0, 0x3);
if (v4 == 1) {
v5 = print_x509_info(a0, a2, v0, a3, v1);
} else if (v4 == 3) {
v6 = print_rawpk_info(a0, a2, v0, a3, v1);
}
return;
}
|
struct sshkey *
get_hostkey_private_by_type(int type, int nid, struct ssh *ssh)
{
return get_hostkey_by_type(type, nid, 1, ssh);
}
| long long get_hostkey_private_by_type(unsigned long a0, unsigned long a1, unsigned long long a2) {
return get_hostkey_by_type(a0, a1, 0x1, a2);
}
|
static int insmod_all(struct kmod_ctx *ctx, char **args, int nargs)
{
int i, err = 0;
for (i = 0; i < nargs; i++) {
int r = insmod(ctx, args[i],
((void *)0)
);
if (r < 0)
err = r;
}
return err;
}
| long insmod_all(long a1, long a2, int a3)
{
int i;
unsigned int v6;
int v7;
v6 = 0;
for ( i = 0; i < a3; ++i )
{
v7 = insmod(a1, *(const char **)(8LL * i + a2), 0LL);
if ( v7 < 0 )
v6 = v7;
}
return v6;
}
|
static int
append(char *cp, char ***ap, size_t *np)
{
char **tmp;
if ((tmp = reallocarray(*ap, *np + 1, sizeof(*tmp))) ==
((void *)0)
)
return -1;
tmp[(*np)] = cp;
(*np)++;
*ap = tmp;
return 0;
}
| int append(unsigned long a0, unsigned long long *a1, unsigned long long *a2) {
unsigned long long *v0;
unsigned long long *v1;
unsigned int v3;
v0 = a2;
v1 = reallocarray(*(a1), *(a2) + 1, 0x8);
if (!v1) {
v3 = -1;
} else {
v1[*(a2)] = a0;
*(a2) = *(a2) + 1;
*(a1) = v1;
v3 = 0;
}
return v3;
}
|
static int
visible_variable_in_context (var)
SHELL_VAR *var;
{
return (((((var)->attributes) & (0x0001000))) == 0 && ((((var)->attributes) & (0x0000020))) && var->context == variable_context);
}
| undefined8 visible_variable_in_context(long param_1)
{
undefined8 uVar1;
if ((((*(uint *)(param_1 + 0x28) & 0x1000) == 0) && ((*(uint *)(param_1 + 0x28) & 0x20) != 0)) &&
(*(int *)(param_1 + 0x2c) == variable_context)) {
uVar1 = 1;
}
else {
uVar1 = 0;
}
return uVar1;
}
|
) {
fprintf(
stderr
, gettext ("%s: kernel doesn't support setgroups restrictions\n"), Prog);
goto out;
}
| int fprintf(FILE *__stream,char *__format,...)
{
halt_baddata();
}
|
static int
input_eof ()
{
if (!decompress || last_member)
return 1;
if (inptr == insize)
{
if (insize != 0x40000 || fill_inbuf (1) ==
(-1)
)
return 1;
inptr = 0;
}
return 0;
}
| int input_eof() {
unsigned int v1;
if (!decompress) {
LABEL_4009aa:
v1 = 1;
} else {
if (!(!last_member))
goto LABEL_4009aa;
if (false) {
LABEL_4009ee:
v1 = 0;
} else {
if (false && fill_inbuf(0x1) != -1) {
outcnt = 0;
goto LABEL_4009ee;
}
v1 = 1;
}
}
return v1;
}
|
static size_t
print_file_name_and_frills (const struct fileinfo *f, size_t start_col)
{
char buf[
(((
((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * (
16
+ 1) -
16
+ 1 + 3) + 1
)>(
((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)
))?(
((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * (
16
+ 1) -
16
+ 1 + 3) + 1
):(
((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)
))
];
set_normal_color ();
if (print_inode)
printf ("%*s ", format == with_commas ? 0 : inode_number_width,
format_inode (buf, sizeof buf, f));
if (print_block_size)
printf ("%*s ", format == with_commas ? 0 : block_size_width,
! f->stat_ok ? "?"
: human_readable (((f->stat).st_blocks), buf, human_output_opts,
512
, output_block_size));
if (print_scontext)
printf ("%*s ", format == with_commas ? 0 : scontext_width, f->scontext);
size_t width = print_name_with_quoting (f,
0
,
((void *)0)
, start_col);
if (indicator_style != none)
width += print_type_indicator (f->stat_ok, f->stat.st_mode, f->filetype);
return width;
}
| void print_file_name_and_frills(struct_0 *a0, unsigned long long a1) {
unsigned long long v0;
char v1;
unsigned long long v4;
set_normal_color();
if (print_inode) {
format_inode(&v1, 0x28c, a0);
printf("%*s ");
}
if (print_block_size) {
if (!(a0->field_b8 ^ 1))
human_readable(a0->field_58, &v1, human_output_opts, 0x200, output_block_size);
printf("%*s ");
}
if (print_scontext)
printf("%*s ");
*(&v0) = print_name_with_quoting(a0, 0x0, 0x0, a1);
if (indicator_style)
v0 += print_type_indicator(a0->field_b8, a0->field_30, a0->field_a8);
v4 = v0;
return;
}
|
static
_Bool
is_feasible_path_argument (const char *arg,
_Bool
foldcase)
{
const char *last = strrchr (arg, '/');
if (last && !last[1])
{
if (matches_start_point (arg, foldcase))
{
return
1
;
}
else
{
return
0
;
}
}
return
1
;
}
| int is_feasible_path_argument(char *a0, unsigned long a1) {
struct_0 *v0;
unsigned int v2;
v0 = &strrchr(a0, 0x2f);
if (v0 && !v0->field_1) {
v2 = matches_start_point(a0, a1, a1);
if (v2)
v2 = 1;
else
v2 = 0;
}
if (!v0 || v0->field_1)
v2 = 1;
return v2;
}
|
static intmax_t
parameter_brace_expand_length (name)
char *name;
{
char *t, *newname;
intmax_t number, arg_index;
WORD_LIST *list;
SHELL_VAR *var;
var = (SHELL_VAR *)
((void *)0)
;
if (name[1] == '\0')
number = number_of_args ();
else if (((name[1]) == '@' || (name[1]) == '*') && name[2] == '\0')
number = number_of_args ();
else if ((sh_syntaxtab[(unsigned char) name[1]] & 0x0800) && name[2] == '\0')
{
switch (name[1])
{
case '-':
t = which_set_flags ();
break;
case '?':
t = itos (last_command_exit_value);
break;
case '$':
t = itos (dollar_dollar_pid);
break;
case '!':
if (last_asynchronous_pid == (pid_t)-1)
t = (char *)
((void *)0)
;
else
t = itos (last_asynchronous_pid);
break;
case '#':
t = itos (number_of_args ());
break;
}
number = (((t) && (t)[0]) ? ((t)[1] ? ((t)[2] ? strlen(t) : 2) : 1) : 0);
do { if (t) sh_xfree((t), "subst.c", 8010); } while (0);
}
else if (valid_array_reference (name + 1, 0))
number = array_length_reference (name + 1);
else
{
number = 0;
if (legal_number (name + 1, &arg_index))
{
t = get_dollar_var_value (arg_index);
if (t == 0 && unbound_vars_is_error)
return
(-9223372036854775807L -1)
;
number = ((
(__ctype_get_mb_cur_max ())
> 1) ? (((t) && (t)[0]) ? ((t)[1] ? mbstrlen (t) : 1) : 0) : (((t) && (t)[0]) ? ((t)[1] ? ((t)[2] ? strlen(t) : 2) : 1) : 0));
do { if (t) sh_xfree((t), "subst.c", 8026); } while (0);
}
else if ((var = find_variable (name + 1)) && (((((var)->attributes) & (0x0001000))) == 0) && (((((var)->attributes) & (0x0000004))) || ((((var)->attributes) & (0x0000040)))))
{
if (((((var)->attributes) & (0x0000040))))
t = assoc_reference ((HASH_TABLE *)((var)->value), "0");
else
t = array_reference ((ARRAY *)((var)->value), 0);
if (t == 0 && unbound_vars_is_error)
return
(-9223372036854775807L -1)
;
number = ((
(__ctype_get_mb_cur_max ())
> 1) ? (((t) && (t)[0]) ? ((t)[1] ? mbstrlen (t) : 1) : 0) : (((t) && (t)[0]) ? ((t)[1] ? ((t)[2] ? strlen(t) : 2) : 1) : 0));
}
else if ((var || (var = find_variable (name + 1))) &&
((((var)->attributes) & (0x0001000))) == 0 &&
((((var)->attributes) & (0x0000004))) == 0 && ((((var)->attributes) & (0x0000040))) == 0 &&
var->dynamic_value == 0)
number = ((var)->value) ? ((
(__ctype_get_mb_cur_max ())
> 1) ? (((((var)->value)) && (((var)->value))[0]) ? ((((var)->value))[1] ? mbstrlen (((var)->value)) : 1) : 0) : (((((var)->value)) && (((var)->value))[0]) ? ((((var)->value))[1] ? ((((var)->value))[2] ? strlen(((var)->value)) : 2) : 1) : 0)) : 0;
else if (var == 0 && unbound_vars_is_error == 0)
number = 0;
else
{
newname = (char *)strcpy (sh_xmalloc((1 + strlen (name)), "subst.c", 8051), (name));
newname[0] = '$';
list = expand_string (newname, 0x001);
t = list ? string_list (list) : (char *)
((void *)0)
;
sh_xfree((newname), "subst.c", 8055);
if (list)
dispose_words (list);
number = t ? ((
(__ctype_get_mb_cur_max ())
> 1) ? (((t) && (t)[0]) ? ((t)[1] ? mbstrlen (t) : 1) : 0) : (((t) && (t)[0]) ? ((t)[1] ? ((t)[2] ? strlen(t) : 2) : 1) : 0)) : 0;
do { if (t) sh_xfree((t), "subst.c", 8060); } while (0);
}
}
return (number);
}
| size_t parameter_brace_expand_length(char *param_1)
{
int iVar1;
size_t sVar2;
char *__dest;
long in_FS_OFFSET;
undefined8 local_40;
char *local_38;
size_t local_30;
long local_28;
char *local_20;
long local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_28 = 0;
if (param_1[1] == '\0') {
iVar1 = number_of_args();
sVar2 = (long)iVar1;
local_30 = (long)iVar1;
}
else if (((param_1[1] == '@') || (param_1[1] == '*')) && (param_1[2] == '\0')) {
iVar1 = number_of_args();
sVar2 = (long)iVar1;
local_30 = (long)iVar1;
}
else if (((*(uint *)(&sh_syntaxtab + (long)(int)(uint)(byte)param_1[1] * 4) & 0x800) == 0) ||
(param_1[2] != '\0')) {
iVar1 = valid_array_reference(param_1 + 1,0);
if (iVar1 == 0) {
local_30 = 0;
iVar1 = legal_number(param_1 + 1,&local_40);
if (iVar1 == 0) {
local_28 = find_variable(param_1 + 1);
if (((local_28 == 0) || ((*(uint *)(local_28 + 0x28) & 0x1000) != 0)) ||
(((*(uint *)(local_28 + 0x28) & 4) == 0 && ((*(uint *)(local_28 + 0x28) & 0x40) == 0))))
{
if (((((local_28 == 0) && (local_28 = find_variable(param_1 + 1), local_28 == 0)) ||
((*(uint *)(local_28 + 0x28) & 0x1000) != 0)) ||
(((*(uint *)(local_28 + 0x28) & 4) != 0 || ((*(uint *)(local_28 + 0x28) & 0x40) != 0))
)) || (*(long *)(local_28 + 0x18) != 0)) {
if ((local_28 == 0) && (unbound_vars_is_error == 0)) {
local_30 = 0;
sVar2 = local_30;
}
else {
sVar2 = strlen(param_1);
__dest = (char *)sh_xmalloc(sVar2 + 1,"subst.c",0x1f73);
local_20 = strcpy(__dest,param_1);
*local_20 = '$';
local_18 = expand_string(local_20,1);
if (local_18 == 0) {
local_38 = (char *)0x0;
}
else {
local_38 = (char *)string_list(local_18);
}
sh_xfree(local_20,"subst.c",0x1f77);
if (local_18 != 0) {
dispose_words(local_18);
}
if (local_38 == (char *)0x0) {
local_30 = 0;
}
else {
sVar2 = __ctype_get_mb_cur_max();
if (sVar2 < 2) {
if ((local_38 == (char *)0x0) || (*local_38 == '\0')) {
local_30 = 0;
}
else if (local_38[1] == '\0') {
local_30 = 1;
}
else if (local_38[2] == '\0') {
local_30 = 2;
}
else {
local_30 = strlen(local_38);
}
}
else if ((local_38 == (char *)0x0) || (*local_38 == '\0')) {
local_30 = 0;
}
else if (local_38[1] == '\0') {
local_30 = 1;
}
else {
local_30 = mbstrlen(local_38);
}
}
sVar2 = local_30;
if (local_38 != (char *)0x0) {
sh_xfree(local_38,"subst.c",0x1f7c);
sVar2 = local_30;
}
}
}
else if (*(long *)(local_28 + 8) == 0) {
sVar2 = 0;
local_30 = sVar2;
}
else {
sVar2 = __ctype_get_mb_cur_max();
if (sVar2 < 2) {
if ((*(long *)(local_28 + 8) == 0) || (**(char **)(local_28 + 8) == '\0')) {
sVar2 = 0;
local_30 = sVar2;
}
else if (*(char *)(*(long *)(local_28 + 8) + 1) == '\0') {
sVar2 = 1;
local_30 = sVar2;
}
else if (*(char *)(*(long *)(local_28 + 8) + 2) == '\0') {
sVar2 = 2;
local_30 = sVar2;
}
else {
sVar2 = strlen(*(char **)(local_28 + 8));
local_30 = sVar2;
}
}
else if ((*(long *)(local_28 + 8) == 0) || (**(char **)(local_28 + 8) == '\0')) {
sVar2 = 0;
local_30 = sVar2;
}
else if (*(char *)(*(long *)(local_28 + 8) + 1) == '\0') {
sVar2 = 1;
local_30 = sVar2;
}
else {
sVar2 = mbstrlen(*(undefined8 *)(local_28 + 8));
local_30 = sVar2;
}
}
}
else {
if ((*(uint *)(local_28 + 0x28) & 0x40) == 0) {
local_38 = (char *)array_reference(*(undefined8 *)(local_28 + 8),0);
}
else {
local_38 = (char *)assoc_reference(*(undefined8 *)(local_28 + 8),&DAT_0011fc53);
}
if ((local_38 == (char *)0x0) && (unbound_vars_is_error != 0)) {
sVar2 = 0x8000000000000000;
}
else {
sVar2 = __ctype_get_mb_cur_max();
if (sVar2 < 2) {
if ((local_38 == (char *)0x0) || (*local_38 == '\0')) {
sVar2 = 0;
local_30 = sVar2;
}
else if (local_38[1] == '\0') {
sVar2 = 1;
local_30 = sVar2;
}
else if (local_38[2] == '\0') {
sVar2 = 2;
local_30 = sVar2;
}
else {
sVar2 = strlen(local_38);
local_30 = sVar2;
}
}
else if ((local_38 == (char *)0x0) || (*local_38 == '\0')) {
sVar2 = 0;
local_30 = sVar2;
}
else if (local_38[1] == '\0') {
sVar2 = 1;
local_30 = sVar2;
}
else {
sVar2 = mbstrlen(local_38);
local_30 = sVar2;
}
}
}
}
else {
local_38 = (char *)get_dollar_var_value(local_40);
if ((local_38 == (char *)0x0) && (unbound_vars_is_error != 0)) {
sVar2 = 0x8000000000000000;
}
else {
sVar2 = __ctype_get_mb_cur_max();
if (sVar2 < 2) {
if ((local_38 == (char *)0x0) || (*local_38 == '\0')) {
local_30 = 0;
}
else if (local_38[1] == '\0') {
local_30 = 1;
}
else if (local_38[2] == '\0') {
local_30 = 2;
}
else {
local_30 = strlen(local_38);
}
}
else if ((local_38 == (char *)0x0) || (*local_38 == '\0')) {
local_30 = 0;
}
else if (local_38[1] == '\0') {
local_30 = 1;
}
else {
local_30 = mbstrlen(local_38);
}
sVar2 = local_30;
if (local_38 != (char *)0x0) {
sh_xfree(local_38,"subst.c",0x1f5a);
sVar2 = local_30;
}
}
}
}
else {
sVar2 = array_length_reference(param_1 + 1);
local_30 = sVar2;
}
}
else {
switch(param_1[1]) {
case '!':
if (last_asynchronous_pid == -1) {
local_38 = (char *)0x0;
}
else {
local_38 = (char *)itos((long)last_asynchronous_pid);
}
break;
case '#':
iVar1 = number_of_args();
local_38 = (char *)itos((long)iVar1);
break;
case '$':
local_38 = (char *)itos((long)dollar_dollar_pid);
break;
case '-':
local_38 = (char *)which_set_flags();
break;
case '?':
local_38 = (char *)itos((long)last_command_exit_value);
}
if ((local_38 == (char *)0x0) || (*local_38 == '\0')) {
local_30 = 0;
}
else if (local_38[1] == '\0') {
local_30 = 1;
}
else if (local_38[2] == '\0') {
local_30 = 2;
}
else {
local_30 = strlen(local_38);
}
sVar2 = local_30;
if (local_38 != (char *)0x0) {
sh_xfree(local_38,"subst.c",0x1f4a);
sVar2 = local_30;
}
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return sVar2;
}
|
int
main (argc, argv)
int argc;
char **argv;
{
char *stream_name;
FILE *stream;
progname = argv[0];
if (argc == 1)
{
stream_name = "stdout";
stream =
stdout
;
}
else if (argc == 2)
{
stream_name = argv[1];
stream = fopen (stream_name, "w");
}
else
{
fprintf (
stderr
, "Usage: %s [output-file]\n", progname);
exit (1);
}
if (!stream)
{
fprintf (
stderr
, "%s: %s: cannot open for writing\n",
progname, stream_name);
exit (2);
}
initialize_signames ();
write_signames (stream);
exit (0);
}
| int main(unsigned long a0) {
unsigned long long v0;
void* v1;
unsigned long long v3[2];
progname = v3[0];
if (a0 == 1) {
v0 = "stdout";
v1 = stdout;
} else if (a0 != 2) {
fprintf(*(&stderr), "Usage: %s [output-file]\n", 3968026707);
exit(0x1);
}
if (a0 == 2) {
v0 = v3[1];
v1 = fopen(v0, "w");
}
if (a0 == 1 || a0 == 2) {
if (!v1) {
fprintf(*(&stderr), "%s: %s: cannot open for writing\n", 3968026707, v0);
exit(0x2);
}
initialize_signames();
write_signames(v1);
exit(0x0);
}
}
|
static int flush_stream(FILE *in, int endchar)
{
size_t i = 0;
int c;
for (c = fgetc(in);
c !=
(-1)
&& c != endchar && c != '\0';
c = fgetc(in))
;
return c == endchar ? i : 0;
}
| void flush_stream(void* a0, unsigned long a1) {
unsigned int v0;
void* v1;
unsigned long v3;
v1 = 0;
for (v0 = fgetc(a0); v0 != -1 && v0 != a1 && v0; v0 = fgetc(a0));
v3 = (v0 == a1 ? 0 : v1);
return;
}
|
static
_Bool
file_newer_p (const char *file_name, struct stat const *stp,
struct tar_stat_info *tar_stat)
{
struct stat st;
if (!stp)
{
if (deref_stat (file_name, &st) != 0)
{
if (
(*__errno_location ())
!=
2
)
{
stat_warn (file_name);
return
1
;
}
return
0
;
}
stp = &st;
}
return (!
((((
stp->st_mode
)) & 0170000) == (0040000))
&& tar_timespec_cmp (tar_stat->mtime, get_stat_mtime (stp)) <= 0);
}
| int file_newer_p(unsigned long long a0, unsigned long long a1, unsigned long long a2[33]) {
struct_0 *v0;
char v1;
unsigned int v4;
unsigned int v5;
v0 = a1;
if (!v0) {
if (!deref_stat(a0, &v1, &v1)) {
v0 = &v1;
} else if (*(__errno_location()) == 2) {
v4 = 0;
goto LABEL_401664;
} else {
stat_warn(a0);
v4 = 1;
goto LABEL_401664;
}
}
if ((v0->field_18 & 0xf000) != 0x4000 && tar_timespec_cmp(a2[31], a2[32], get_stat_mtime(v0), &v1) <= 0) {
v5 = 1;
goto LABEL_401661;
}
v5 = 0;
LABEL_401661:
v4 = v5 & 1;
LABEL_401664:
return v4;
}
|
char *
sysinttostr (uintmax_t value, intmax_t minval, uintmax_t maxval,
char buf[SYSINT_BUFSIZE])
{
if (value <= maxval)
return umaxtostr (value, buf);
else
{
intmax_t i = value - minval;
return imaxtostr (i + minval, buf);
}
}
| long long sysinttostr(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long long a3) {
unsigned long v0;
unsigned long long v2;
if (a0 > a2) {
v0 = a0 - a1;
v2 = imaxtostr(v0 + a1, a3, v0 + a1);
} else {
v2 = umaxtostr(a0, a3, a3);
}
return v2;
}
|
static void
ensure_minimum_time_since(double start, double seconds)
{
struct timespec ts;
double elapsed = monotime_double() - start, req = seconds, remain;
while ((remain = seconds - elapsed) < 0.0)
seconds *= 2;
ts.tv_sec = remain;
ts.tv_nsec = (remain - ts.tv_sec) * 1000000000;
sshlog("auth2.c", __func__, 254, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "elapsed %0.3lfms, delaying %0.3lfms (requested %0.3lfms)", elapsed*1000, remain*1000, req*1000)
;
nanosleep(&ts,
((void *)0)
);
}
| void ensure_minimum_time_since() {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned long long v4;
unsigned long long v5;
char v7;
unsigned long v9;
unsigned long v10;
int v11;
unsigned long long v13;
unsigned long long *v15;
unsigned long long v16;
v1 = v9;
v0 = v10;
monotime_double();
s_40 =L Conv(128->64, (xmm0<16> - Conv(64->128, Load(addr=stack_base-80, size=8, endness=Iend_LE))))<8>
v3 = v0;
while (true) {
v4 = v0 - v2;
if ((((BinaryOp CmpF & 69) | ((BinaryOp CmpF & 69) >> 6)) & 1) == 1)
break;
v0 += v0;
}
v5 = v4;
v13 = v5;
s_20 =L Conv(128->64, (0x41cdcd6500000000<128> * (Conv(64->128, Load(addr=stack_base-48, size=8, endness=Iend_LE)) - xmm1<16>)))<8>
sshlog("auth2.c", "ensure_minimum_time_since", 0xfe, 0x1, 0x7, 0x0, "elapsed %0.3lfms, delaying %0.3lfms (requested %0.3lfms)");
nanosleep(&v5, NULL);
v16 = *(&v7) ^ v15[5];
return;
}
|
static WORD_LIST *
list_quote_escapes (list)
WORD_LIST *list;
{
register WORD_LIST *w;
char *t;
for (w = list; w; w = w->next)
{
t = w->word->word;
w->word->word = quote_escapes (t);
sh_xfree((t), "subst.c", 4731);
}
return list;
}
| int list_quote_escapes(unsigned long long a0) {
unsigned long long v0;
struct_0 *v2;
for (v2 = a0; v2; v2 = v2->field_0) {
v0 = v2->field_8->field_0;
v2->field_8->field_0 = quote_escapes(v0);
sh_xfree(v0, "subst.c", 0x127b);
}
return a0;
}
|
static int process(struct nlmsghdr *n, void *arg)
{
struct genlmsghdr *ghdr;
struct rtattr *attrs[MACSEC_ATTR_MAX + 1];
struct rtattr *attrs_secy[MACSEC_SECY_ATTR_MAX + 1];
int len = n->nlmsg_len;
int ifindex;
__u64 sci;
__u8 encoding_sa;
if (n->nlmsg_type != genl_family)
return -1;
len -= ((( ((sizeof(struct genlmsghdr))+4U -1) & ~(4U -1) )) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )));
if (len < 0)
return -1;
ghdr = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
if (ghdr->cmd != MACSEC_CMD_GET_TXSC)
return 0;
parse_rtattr(attrs, MACSEC_ATTR_MAX, (void *) ghdr + ( ((sizeof(struct genlmsghdr))+4U -1) & ~(4U -1) ), len);
if (!validate_dump(attrs)) {
fprintf(
stderr
, "incomplete dump message\n");
return -1;
}
ifindex = rta_getattr_u32(attrs[MACSEC_ATTR_IFINDEX]);
(parse_rtattr_flags((attrs_secy), (MACSEC_SECY_ATTR_MAX), ((void*)(((char*)(attrs[MACSEC_ATTR_SECY])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((attrs[MACSEC_ATTR_SECY])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)))
;
if (!validate_secy_dump(attrs_secy)) {
fprintf(
stderr
, "incomplete dump message\n");
return -1;
}
sci = rta_getattr_u64(attrs_secy[MACSEC_SECY_ATTR_SCI]);
encoding_sa = rta_getattr_u8(attrs_secy[MACSEC_SECY_ATTR_ENCODING_SA]);
if (filter.ifindex && ifindex != filter.ifindex)
return 0;
if (filter.sci && sci != filter.sci)
return 0;
open_json_object(
((void *)0)
);
print_uint(PRINT_ANY, "ifindex", "%u: ", ifindex);
print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname",
"%s: ", ll_index_to_name(ifindex));
print_attrs(attrs_secy);
print_tx_sc(" ", sci, encoding_sa,
attrs[MACSEC_ATTR_TXSC_STATS],
attrs[MACSEC_ATTR_SECY_STATS],
attrs[MACSEC_ATTR_TXSA_LIST]);
if (attrs[MACSEC_ATTR_RXSC_LIST])
print_rxsc_list(attrs[MACSEC_ATTR_RXSC_LIST]);
if (attrs[MACSEC_ATTR_OFFLOAD]) {
struct rtattr *attrs_offload[MACSEC_OFFLOAD_ATTR_MAX + 1];
__u8 offload;
(parse_rtattr_flags((attrs_offload), (MACSEC_OFFLOAD_ATTR_MAX), ((void*)(((char*)(attrs[MACSEC_ATTR_OFFLOAD])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((attrs[MACSEC_ATTR_OFFLOAD])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)))
;
offload = rta_getattr_u8(attrs_offload[MACSEC_OFFLOAD_ATTR_TYPE]);
print_string(PRINT_ANY, "offload",
" offload: %s ", offload_to_str(offload));
print_nl();
}
close_json_object();
return 0;
}
| long long process(struct_0 *a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long v0;
char v1;
char v2;
unsigned int v3;
unsigned int v4;
char *v5;
unsigned long long v6;
char v7;
char v8;
char v9;
char v10;
char v11;
char v12;
char v13;
char v14;
char v15;
char v16;
char v17;
char v18;
char v19;
unsigned long long v21;
v0 = a1;
v3 = a0->field_0;
if (a0->field_4 != genl_family) {
v21 = 4294967295;
} else {
v3 -= 20;
if (v3 < 0) {
v21 = 4294967295;
} else {
v5 = &a0[2].field_4;
if (*(v5)) {
v21 = 0;
} else {
parse_rtattr(&v9, 0x9, v5 + 4, v3);
if (!validate_dump(&v9)) {
fprintf(*(&stderr), "incomplete dump message\n");
v21 = 4294967295;
} else {
v4 = rta_getattr_u32(*(&v10));
parse_rtattr_flags(&v17, 0xe, *(&v11) + 4, *(*(&v11)) - 4, 0x8000);
if (!validate_secy_dump(&v17)) {
fprintf(*(&stderr), "incomplete dump message\n");
v21 = 4294967295;
} else {
v6 = rta_getattr_u64(*(&v18));
v1 = rta_getattr_u8(*(&v19));
if (filter && v4 != filter)
v21 = 0;
if (v4 == filter || !filter) {
if (g_4040e8 && v6 != g_4040e8)
v21 = 0;
if (!g_4040e8 || v6 == g_4040e8) {
open_json_object(0x0);
print_uint(0x4, "ifindex", "%u: ", v4);
print_color_string(0x4, 0x0, "ifname", "%s: ", ll_index_to_name(v4));
print_attrs(&v17, 0x0, "ifname", "%s: ", a4, a5);
print_tx_sc(" ", v6, v1, *(&v14), *(&v15), *(&v12));
if (*(&v13))
print_rxsc_list(*(&v13), a1, a2, a3, a4, a5);
if (*(&v16)) {
parse_rtattr_flags(&v7, 0x2, *(&v16) + 4, *(*(&v16)) - 4, 0x8000);
v2 = rta_getattr_u8(*(&v8));
print_string(0x4, "offload", " offload: %s ", offload_to_str(v2));
print_nl(0x4, "offload", " offload: %s ", a3, 0x8000, a5);
}
close_json_object(v4, a1, a2, a3, a4, a5);
v21 = 0;
}
}
}
}
}
}
}
return v21;
}
|
void ipmroute_reset_filter(int ifindex)
{
memset(&filter, 0, sizeof(filter));
filter.mdst.bitlen = -1;
filter.msrc.bitlen = -1;
filter.iif = ifindex;
}
| void ipmroute_reset_filter(undefined4 param_1)
{
memset(filter,0,0x21c);
filter._8_4_ = param_1;
filter._16_2_ = 0xffff;
filter._280_2_ = 0xffff;
return;
}
|
static int filecopy(const char *src, const char *dst)
{
FILE *fp, *fp2;
char line[5 * 1024];
char *p;
fp = fopen(dst, "w");
if (fp ==
((void *)0)
) {
fprintf(
stderr
, "Cannot open '%s' for write\n", dst);
return -1;
}
fp2 = fopen(src, "r");
if (fp2 ==
((void *)0)
) {
fclose(fp);
return 0;
}
line[sizeof(line) - 1] = 0;
do {
p = fgets(line, sizeof(line) - 1, fp2);
if (p ==
((void *)0)
)
break;
fputs(line, fp);
}
while (1);
fclose(fp);
fclose(fp2);
return 0;
}
| int filecopy(char *a0, char *a1) {
void* v0;
void* v1;
unsigned long v2;
char v3;
unsigned long long v4;
char v5;
unsigned int v7;
v4 = *(&v4);
v0 = fopen(a1, "w");
if (!v0) {
fprintf(stderr, "Cannot open '%s' for write\n", a1);
v7 = -1;
} else {
v1 = fopen(a0, "r");
if (!v1) {
fclose(v0);
v7 = 0;
} else {
v5 = 0;
while (true) {
v2 = fgets(&v3, 0x13ff, v1);
if (!v2)
break;
fputs(&v3, v0);
}
fclose(v0);
fclose(v1);
v7 = 0;
}
}
return v7;
}
|
void
_rl_vi_done_inserting (void)
{
if (_rl_vi_doing_insert)
{
rl_end_undo_group ();
_rl_vi_doing_insert = 0;
if (_rl_vi_last_key_before_insert == 'R')
_rl_vi_save_replace ();
else
_rl_vi_save_insert (rl_undo_list->next);
if (_rl_undo_group_level > 0)
rl_end_undo_group ();
}
else
{
if (rl_undo_list && (_rl_vi_last_key_before_insert == 'i' ||
_rl_vi_last_key_before_insert == 'a' ||
_rl_vi_last_key_before_insert == 'I' ||
_rl_vi_last_key_before_insert == 'A'))
_rl_vi_save_insert (rl_undo_list);
else if (_rl_vi_last_key_before_insert == 'C')
rl_end_undo_group ();
}
while (_rl_undo_group_level > 0)
rl_end_undo_group ();
}
| void _rl_vi_done_inserting(void)
{
if (_rl_vi_doing_insert == 0) {
if ((rl_undo_list == (undefined8 *)0x0) ||
((((_rl_vi_last_key_before_insert != 0x69 && (_rl_vi_last_key_before_insert != 0x61)) &&
(_rl_vi_last_key_before_insert != 0x49)) && (_rl_vi_last_key_before_insert != 0x41)))) {
if (_rl_vi_last_key_before_insert == 0x43) {
rl_end_undo_group();
}
}
else {
_rl_vi_save_insert(rl_undo_list);
}
}
else {
rl_end_undo_group();
_rl_vi_doing_insert = 0;
if (_rl_vi_last_key_before_insert == 0x52) {
_rl_vi_save_replace();
}
else {
_rl_vi_save_insert(*rl_undo_list);
}
if (0 < _rl_undo_group_level) {
rl_end_undo_group();
}
}
while (0 < _rl_undo_group_level) {
rl_end_undo_group();
}
return;
}
|
intmax_t arith(const char *s)
{
intmax_t result;
arith_buf = arith_startbuf = s;
result = assignment(yylex(), 0);
if (last_token)
yyerror("expecting EOF");
return result;
}
| long long arith(unsigned long long a0) {
unsigned long v0;
arith_startbuf = a0;
yylval = arith_startbuf;
v0 = assignment(yylex(), 0x0);
if (last_token)
yyerror("expecting EOF");
return v0;
}
|
static inline void
emit_ancillary_info (char const *program)
{
struct infomap { char const *program; char const *node; } const infomap[] = {
{ "[", "test invocation" },
{ "coreutils", "Multi-call invocation" },
{ "sha224sum", "sha2 utilities" },
{ "sha256sum", "sha2 utilities" },
{ "sha384sum", "sha2 utilities" },
{ "sha512sum", "sha2 utilities" },
{
((void *)0)
,
((void *)0)
}
};
char const *node = program;
struct infomap const *map_prog = infomap;
while (map_prog->program && ! (strcmp (program, map_prog->program) == 0))
map_prog++;
if (map_prog->node)
node = map_prog->node;
printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https:
char const *lc_messages = setlocale (
5
,
((void *)0)
);
if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1))
{
fputs_unlocked (gettext ("Report any translation bugs to " "<https:
stdout
)
;
}
char const *url_program = (strcmp (program, "[") == 0) ? "test" : program;
printf (gettext ("Full documentation <%s%s>\n"),
"https:
printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"),
node, node == program ? " invocation" : "");
}
| void emit_ancillary_info(char *a0) {
unsigned long long v0;
unsigned long long v1[2];
char *v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
void* v16;
void* v17;
char v18;
unsigned long long v23;
unsigned long long *v24;
unsigned long long v25;
v4 = "[";
v5 = "test invocation";
v6 = "coreutils";
v7 = "Multi-call invocation";
v8 = "sha224sum";
v9 = "sha2 utilities";
v10 = "sha256sum";
v11 = "sha2 utilities";
v12 = "sha384sum";
v13 = "sha2 utilities";
v14 = "sha512sum";
v15 = "sha2 utilities";
v16 = 0;
v17 = 0;
v0 = a0;
for (v1[0] = &v4; v1[0]; v1[0] = v1 + 1) {
if (!strcmp(a0, v1[0]))
break;
}
if (v1[1])
v0 = v1[1];
printf(gettext("\n%s online help: <%s>\n"));
v2 = setlocale(0x5, NULL);
if (v2 && strncmp(v2, "en_", 0x3))
fputs_unlocked(gettext("Report any translation bugs to <https:
if (strcmp(a0, "["))
v23 = a0;
else
v23 = "test";
v3 = v23;
printf(gettext("Full documentation <%s%s>\n"));
printf(gettext("or available locally via: info '(coreutils) %s%s'\n"));
v25 = *(&v18) ^ v24[5];
return;
}
|
extern inline
_Bool
c_ispunct (int c)
{
switch (c)
{
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 '~':
return
1
;
default:
return
0
;
}
}
| long long c_ispunct(unsigned long a0) {
unsigned long long v1;
if (a0 > 126) {
v1 = 0;
return v1;
} else if (a0 >= 123) {
v1 = 1;
return v1;
} else if (a0 > 96) {
v1 = 0;
return v1;
} else if (a0 >= 91) {
v1 = 1;
return v1;
} else if (a0 > 47) {
if (a0 - 58 <= 6) {
v1 = 1;
return v1;
}
v1 = 0;
return v1;
} else {
if (a0 >= 33) {
v1 = 1;
return v1;
}
v1 = 0;
return v1;
}
}
|
static unsigned long
count_lines(FILE *f)
{
unsigned long count = 0;
char lp[(100+8192) + 1];
if (fseek(f, 0,
0
) != 0) {
sshlog("moduli.c", __func__, 504, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "input file is not seekable");
return
(0x7fffffffffffffffL * 2UL + 1UL)
;
}
while (fgets(lp, (100+8192) + 1, f) !=
((void *)0)
)
count++;
rewind(f);
sshlog("moduli.c", __func__, 510, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "input file has %lu lines", count);
return count;
}
| int count_lines(void* a0) {
void* v0;
void* v1;
char v2;
char v3;
char v4;
unsigned int v6;
v4 = *(&v4);
v3 = *(&v3);
v1 = 0;
v6 = fseek(a0, 0x0, 0x0);
if (v6) {
sshlog("moduli.c", "count_lines", 0x1f8, 0x0, 0x5, 0x0, "input file is not seekable");
v6 = -1;
} else {
while (true) {
v6 = fgets(&v2, 0x2065, a0);
if (!v6)
break;
v1 += 1;
}
rewind(a0);
v0 = v1;
sshlog("moduli.c", "count_lines", 0x1fe, 0x0, 0x5, 0x0, "input file has %lu lines");
v6 = v1;
}
return v6;
}
|
static int
channel_handle_efd_read(struct ssh *ssh, Channel *c)
{
char buf[(16*1024)];
ssize_t len;
int r, force;
force = c->isatty && c->detach_close && c->istate != 3;
if (!force && (c->io_ready & 0x04) == 0)
return 1;
len = read(c->efd, buf, sizeof(buf));
sshlog("channels.c", __func__, 2140, 0, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "channel %d: read %zd from efd %d", c->self, len, c->efd);
if (len == -1 && (
(*__errno_location ())
==
4
|| ((
(*__errno_location ())
==
11
||
(*__errno_location ())
==
11
) && !force)))
return 1;
if (len <= 0) {
sshlog("channels.c", __func__, 2145, 0, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "channel %d: closing read-efd %d", c->self, c->efd);
channel_close_fd(ssh, c, &c->efd);
} else if (c->extended_usage == 0)
sshlog("channels.c", __func__, 2148, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "channel %d: discard efd", c->self);
else if ((r = sshbuf_put(c->extended, buf, len)) != 0)
sshfatal("channels.c", __func__, 2150, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "channel %i: append", c->self);
return 1;
}
| undefined8 channel_handle_efd_read(undefined8 param_1,long param_2)
{
uint uVar1;
bool bVar2;
int iVar3;
ssize_t sVar4;
int *piVar5;
undefined8 uVar6;
undefined *puVar7;
undefined *puVar8;
long in_FS_OFFSET;
undefined local_4028 [24];
undefined local_4010 [16368];
long local_20;
puVar8 = &stack0xfffffffffffffff0;
do {
puVar7 = puVar8;
*(undefined8 *)(puVar7 + -0x1000) = *(undefined8 *)(puVar7 + -0x1000);
puVar8 = puVar7 + -0x1000;
} while (puVar7 + -0x1000 != local_4010);
local_20 = *(long *)(in_FS_OFFSET + 0x28);
if (((*(int *)(param_2 + 0x48) == 0) || (*(int *)(param_2 + 0xe8) == 0)) ||
(*(int *)(param_2 + 0x10) == 3)) {
bVar2 = false;
}
else {
bVar2 = true;
}
if ((!bVar2) && (puVar8 = puVar7 + -0x1038, (*(uint *)(param_2 + 0x30) & 4) == 0))
goto LAB_001070c7;
iVar3 = *(int *)(param_2 + 0x24);
*(undefined8 *)(puVar7 + -0x1040) = 0x106ec7;
sVar4 = read(iVar3,local_4028,0x4000);
uVar1 = *(uint *)(param_2 + 4);
*(ulong *)(puVar7 + -0x1040) = (ulong)*(uint *)(param_2 + 0x24);
*(ssize_t *)(puVar7 + -0x1048) = sVar4;
*(ulong *)(puVar7 + -0x1050) = (ulong)uVar1;
*(char **)(puVar7 + -0x1058) = "channel %d: read %zd from efd %d";
*(undefined8 *)(puVar7 + -0x1060) = 0x106f20;
sshlog("channels.c","channel_handle_efd_read",0x85c,0,6,0);
if (sVar4 == -1) {
*(undefined8 *)(puVar7 + -0x1040) = 0x106f33;
piVar5 = __errno_location();
puVar8 = puVar7 + -0x1038;
if (*piVar5 == 4) goto LAB_001070c7;
*(undefined8 *)(puVar7 + -0x1040) = 0x106f3f;
piVar5 = __errno_location();
if (*piVar5 != 0xb) {
*(undefined8 *)(puVar7 + -0x1040) = 0x106f4b;
piVar5 = __errno_location();
if (*piVar5 != 0xb) goto LAB_00106f65;
}
puVar8 = puVar7 + -0x1038;
if (!bVar2) goto LAB_001070c7;
}
LAB_00106f65:
if (sVar4 < 1) {
uVar1 = *(uint *)(param_2 + 4);
*(ulong *)(puVar7 + -0x1048) = (ulong)*(uint *)(param_2 + 0x24);
*(ulong *)(puVar7 + -0x1050) = (ulong)uVar1;
*(char **)(puVar7 + -0x1058) = "channel %d: closing read-efd %d";
*(undefined8 *)(puVar7 + -0x1060) = 0x106fbf;
sshlog("channels.c","channel_handle_efd_read",0x861,0,6,0);
*(undefined8 *)(puVar7 + -0x1040) = 0x106fe7;
channel_close_fd(param_1,param_2,param_2 + 0x24);
puVar8 = puVar7 + -0x1038;
}
else if (*(int *)(param_2 + 0xc0) == 0) {
*(ulong *)(puVar7 + -0x1040) = (ulong)*(uint *)(param_2 + 4);
*(char **)(puVar7 + -0x1048) = "channel %d: discard efd";
*(undefined8 *)(puVar7 + -0x1050) = 0x10703e;
sshlog("channels.c","channel_handle_efd_read",0x864,0,7,0);
puVar8 = puVar7 + -0x1038;
}
else {
uVar6 = *(undefined8 *)(param_2 + 0x78);
*(undefined8 *)(puVar7 + -0x1040) = 0x107068;
iVar3 = sshbuf_put(uVar6,local_4028,sVar4);
puVar8 = puVar7 + -0x1038;
if (iVar3 != 0) {
uVar1 = *(uint *)(param_2 + 4);
*(undefined8 *)(puVar7 + -0x1040) = 0x10708e;
uVar6 = ssh_err(iVar3);
*(ulong *)(puVar7 + -0x1040) = (ulong)uVar1;
*(char **)(puVar7 + -0x1048) = "channel %i: append";
*(undefined8 *)(puVar7 + -0x1050) = 0x1070c2;
sshfatal("channels.c","channel_handle_efd_read",0x866,1,1,uVar6);
puVar8 = puVar7 + -0x1048;
}
}
LAB_001070c7:
if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) {
return 1;
}
*(undefined8 *)(puVar8 + -8) = 0x1070db;
__stack_chk_fail();
}
|
void
unlink_fifo_list ()
{
register int i;
if (nfds == 0)
return;
for (i = totfds-1; nfds && i >= 0; i--)
unlink_fifo (i);
nfds = 0;
}
| void unlink_fifo_list() {
unsigned long long v1;
unsigned long v2;
unsigned long long v3;
v1 = nfds;
if (nfds) {
v2 = totfds - 1;
while (true) {
v3 = nfds;
if (!nfds)
break;
if (v2 < 0)
break;
unlink_fifo(v2);
v2 = v2 - 1;
}
nfds = 0;
}
return;
}
|
static inline __u32 rta_getattr_u32(const struct rtattr *rta)
{
return *(__u32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| undefined4 rta_getattr_u32(long param_1)
{
return *(undefined4 *)(param_1 + 4);
}
|
static inline idx_t
io_blksize (struct stat sb)
{
return
(((((((9223372036854775807L))<((18446744073709551615UL)))?((9223372036854775807L)):((18446744073709551615UL)))
/ 2 + 1
)<((((
IO_BUFSIZE
)>(
((0 < (sb).st_blksize && (sb).st_blksize <= ((size_t)-1) / 8 + 1) ? (sb).st_blksize :
512
)
))?(
IO_BUFSIZE
):(
((0 < (sb).st_blksize && (sb).st_blksize <= ((size_t)-1) / 8 + 1) ? (sb).st_blksize :
512
)
))))?(((((9223372036854775807L))<((18446744073709551615UL)))?((9223372036854775807L)):((18446744073709551615UL)))
/ 2 + 1
):((((
IO_BUFSIZE
)>(
((0 < (sb).st_blksize && (sb).st_blksize <= ((size_t)-1) / 8 + 1) ? (sb).st_blksize :
512
)
))?(
IO_BUFSIZE
):(
((0 < (sb).st_blksize && (sb).st_blksize <= ((size_t)-1) / 8 + 1) ? (sb).st_blksize :
512
)
))))
;
}
| int io_blksize() {
char v1;
if (*(&v1) <= 0) {
LABEL_400320:
if (*(&v1) > 0 && *(&v1) <= 0x2000000000000000 && *(&v1) > 131071) {
if (*(&v1) > 0 && *(&v1) <= 0x2000000000000000)
goto LABEL_400388;
goto LABEL_400388;
}
} else {
if (!(*(&v1) <= 0x2000000000000000))
goto LABEL_400320;
if (*(&v1) <= 131071)
goto LABEL_400320;
if (*(&v1) <= 0)
goto LABEL_400320;
if (!(*(&v1) <= 0x2000000000000000))
goto LABEL_400320;
if (*(&v1) <= 0x4000000000000000)
goto LABEL_400320;
}
LABEL_400388:
return;
}
|
HIST_ENTRY *
current_history(void)
{
HistEvent ev;
if (history(h, &ev, 16, history_offset + 1) != 0)
return
((void *)0)
;
rl_he.line = ev.str;
rl_he.data =
((void *)0)
;
return &rl_he;
}
| void current_history() {
char v0;
char v1;
void* v4;
unsigned long long v5;
if (history(h, &v0, 0x10, *(got.history_offset) + 1)) {
v4 = 0;
} else {
rl_he = *(&v1);
g_406438 = 0;
v5 = &rl_he;
}
return;
}
|
void
initialize_shell_builtins ()
{
qsort (shell_builtins, num_shell_builtins, sizeof (struct builtin),
(QSFUNC *)shell_builtin_compare);
}
| void initialize_shell_builtins(void)
{
qsort(shell_builtins,(long)num_shell_builtins,0x30,shell_builtin_compare);
return;
}
|
static
int do_inline_command_processing(char *buffer_ptr, size_t curr_bytes,
socket_st * hd,
inline_cmds_st * inline_cmds)
{
int skip_bytes, bytes;
_Bool
inline_cmd_start_found;
bytes = curr_bytes;
continue_inline_processing:
inline_cmd_start_found =
parse_for_inline_commands_in_buffer(buffer_ptr, bytes,
inline_cmds);
if (!inline_cmd_start_found)
return bytes;
if (inline_cmds->bytes_to_flush) {
return inline_cmds->bytes_to_flush;
} else if (inline_cmds->cmd_found == INLINE_COMMAND_NONE) {
return 0;
} else {
if (run_inline_command(inline_cmds, hd))
return -1;
inline_cmds->cmd_found = INLINE_COMMAND_NONE;
skip_bytes = inline_cmds->new_buffer_ptr - buffer_ptr;
if (skip_bytes >= bytes)
return 0;
else {
buffer_ptr = inline_cmds->new_buffer_ptr;
bytes -= skip_bytes;
goto continue_inline_processing;
}
}
}
| int do_inline_command_processing(void* a0, unsigned long a1, void* a2, struct_0 *a3) {
void* v0;
char v1;
unsigned long long v2;
unsigned int v3;
unsigned int v5;
v0 = a0;
*(&v2) = a1;
while (true) {
v1 = parse_for_inline_commands_in_buffer(v0, v2, a3);
if ((v1 ^ 1)) {
v5 = v2;
break;
} else if (a3->field_18) {
v5 = a3->field_18;
break;
} else if (!a3->field_10) {
v5 = 0;
break;
} else {
v5 = run_inline_command(a3, a2, a2);
if (v5) {
v5 = -1;
break;
} else {
a3->field_10 = 0;
v3 = (a3->field_8 - v0);
if (v3 >= v2) {
v5 = 0;
break;
} else {
v0 = a3->field_8;
*(&v2) = v2 - v3;
}
}
}
}
return v5;
}
|
int
sshbuf_peek_u32(const struct sshbuf *buf, size_t offset, u_int32_t *valp)
{
const u_char *p =
((void *)0)
;
int r;
if (valp !=
((void *)0)
)
*valp = 0;
if ((r = check_roffset(buf, offset, 4, &p)) != 0)
return r;
if (valp !=
((void *)0)
)
*valp = (((u_int32_t)(((const u_char *)(p))[0]) << 24) | ((u_int32_t)(((const u_char *)(p))[1]) << 16) | ((u_int32_t)(((const u_char *)(p))[2]) << 8) | (u_int32_t)(((const u_char *)(p))[3]));
return 0;
}
| long long sshbuf_peek_u32(unsigned long long a0, unsigned long a1, unsigned int *a2) {
unsigned int v0;
void* v1;
void* v3;
v1 = 0;
if (a2)
*(a2) = 0;
v0 = check_roffset(a0, a1, 0x4, &v1);
if (v0) {
v3 = v0;
} else {
if (a2)
*(a2) = (*(v1) * 0x1000000) | (v1[1] * 0x10000) | (v1[2] * 0x100) | v1[3];
v3 = 0;
}
return v3;
}
|
int
sshsk_sign(const char *provider, struct sshkey *key,
u_char **sigp, size_t *lenp, const u_char *data, size_t datalen,
u_int compat, const char *pin)
{
int oerrno, r = -1;
struct sshbuf *kbuf =
((void *)0)
, *req =
((void *)0)
, *resp =
((void *)0)
;
*sigp =
((void *)0)
;
*lenp = 0;
if ((kbuf = sshbuf_new()) ==
((void *)0)
||
(req = sshbuf_new()) ==
((void *)0)
) {
r = -2;
goto out;
}
if ((r = sshkey_private_serialize(key, kbuf)) != 0) {
sshlog("ssh-sk-client.c", __func__, 251, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "encode key");
goto out;
}
if ((r = sshbuf_put_stringb(req, kbuf)) != 0 ||
(r = sshbuf_put_cstring(req, provider)) != 0 ||
(r = sshbuf_put_string(req, data, datalen)) != 0 ||
(r = sshbuf_put_cstring(req,
((void *)0)
)) != 0 ||
(r = sshbuf_put_u32(req, compat)) != 0 ||
(r = sshbuf_put_cstring(req, pin)) != 0) {
sshlog("ssh-sk-client.c", __func__, 260, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "compose");
goto out;
}
if ((r = client_converse(req, &resp, 1)) != 0)
goto out;
if ((r = sshbuf_get_string(resp, sigp, lenp)) != 0) {
sshlog("ssh-sk-client.c", __func__, 268, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "parse signature");
r = -4;
goto out;
}
if (sshbuf_len(resp) != 0) {
sshlog("ssh-sk-client.c", __func__, 273, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "trailing data in response");
r = -4;
goto out;
}
r = 0;
out:
oerrno =
(*__errno_location ())
;
if (r != 0) {
freezero(*sigp, *lenp);
*sigp =
((void *)0)
;
*lenp = 0;
}
sshbuf_free(kbuf);
sshbuf_free(req);
sshbuf_free(resp);
(*__errno_location ())
= oerrno;
return r;
}
| int sshsk_sign(undefined8 param_1,undefined8 param_2,undefined8 *param_3,undefined8 *param_4,
undefined8 param_5,undefined8 param_6,undefined4 param_7,undefined8 param_8)
{
int iVar1;
undefined8 uVar2;
long lVar3;
int *piVar4;
long in_FS_OFFSET;
undefined8 uVar5;
int local_30;
undefined8 local_28;
long local_20;
long local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_18 = 0;
local_20 = 0;
local_28 = 0;
*param_3 = 0;
*param_4 = 0;
local_18 = sshbuf_new();
if (local_18 != 0) {
local_20 = sshbuf_new();
if (local_20 != 0) {
local_30 = sshkey_private_serialize(param_2,local_18);
if (local_30 == 0) {
local_30 = sshbuf_put_stringb(local_20,local_18);
if (local_30 == 0) {
local_30 = sshbuf_put_cstring(local_20,param_1);
if (local_30 == 0) {
local_30 = sshbuf_put_string(local_20,param_5,param_6);
if (local_30 == 0) {
local_30 = sshbuf_put_cstring(local_20,0);
if (local_30 == 0) {
local_30 = sshbuf_put_u32(local_20,param_7);
if (local_30 == 0) {
local_30 = sshbuf_put_cstring(local_20,param_8);
if (local_30 == 0) {
local_30 = client_converse(local_20,&local_28,1);
if (local_30 == 0) {
iVar1 = sshbuf_get_string(local_28,param_3,param_4);
if (iVar1 == 0) {
uVar2 = 0x100daa;
lVar3 = sshbuf_len(local_28);
if (lVar3 == 0) {
local_30 = 0;
}
else {
sshlog("ssh-sk-client.c","sshsk_sign",0x111,1,2,0,
"trailing data in response",uVar2);
local_30 = -4;
}
}
else {
uVar5 = 0x100d5a;
uVar2 = ssh_err(iVar1);
sshlog("ssh-sk-client.c","sshsk_sign",0x10c,1,2,uVar2,"parse signature",
uVar5);
local_30 = -4;
}
}
goto LAB_00100e00;
}
}
}
}
}
}
uVar5 = 0x100ccb;
uVar2 = ssh_err(local_30);
sshlog("ssh-sk-client.c","sshsk_sign",0x104,1,2,uVar2,"compose",uVar5);
}
else {
uVar5 = 0x100bd7;
uVar2 = ssh_err(local_30);
sshlog("ssh-sk-client.c","sshsk_sign",0xfb,1,2,uVar2,"encode key",uVar5);
}
goto LAB_00100e00;
}
}
local_30 = -2;
LAB_00100e00:
piVar4 = __errno_location();
iVar1 = *piVar4;
if (local_30 != 0) {
freezero(*param_3,*param_4);
*param_3 = 0;
*param_4 = 0;
}
sshbuf_free(local_18);
sshbuf_free(local_20);
sshbuf_free(local_28);
piVar4 = __errno_location();
*piVar4 = iVar1;
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return local_30;
}
|
static struct cpelement *
cpl_delete (pid)
pid_t pid;
{
struct cpelement *prev, *p;
for (prev = p = coproc_list.head; p; prev = p, p = p->next)
if (p->coproc->c_pid == pid)
{
prev->next = p->next;
break;
}
if (p == 0)
return 0;
;
if (p == coproc_list.head)
coproc_list.head = coproc_list.head->next;
else if (p == coproc_list.tail)
coproc_list.tail = prev;
coproc_list.ncoproc--;
if (coproc_list.ncoproc == 0)
coproc_list.head = coproc_list.tail = 0;
else if (coproc_list.ncoproc == 1)
coproc_list.tail = coproc_list.head;
return (p);
}
| long long cpl_delete(unsigned long a0) {
void* v0;
void* v1;
void* v3;
v1 = coproc_list;
for (v0 = v1; v1; v1 = *(v1)) {
if (a0 == *((v1[8] + 8))) {
*(v0) = *(v1);
break;
} else {
v0 = v1;
}
}
if (!v1) {
v3 = 0;
} else {
if (v1 == coproc_list) {
coproc_list = *(coproc_list);
} else if (v1 == g_40b118) {
g_40b118 = v0;
}
g_40b120 = g_40b120 - 1;
if (!g_40b120) {
g_40b118 = 0;
coproc_list = g_40b118;
} else if (g_40b120 == 1) {
g_40b118 = coproc_list;
}
v3 = v1;
}
return v3;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.