input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
ifa->ifa_family ==
10
) {
print_bool(PRINT_ANY,
"temporary", "temporary ",
1
);
} else {
| void print_bool(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined param_4)
{
print_color_bool(param_1,6,param_2,param_3,param_4);
return;
}
|
const char *strxf_mask32(__u32 mask)
{
static char str[16];
sprintf(str, "%.8x", mask);
return str;
}
| undefined1 * strxf_mask32(uint param_1)
{
sprintf(str_9273,"%.8x",(ulong)param_1);
return str_9273;
}
|
void *
reallocf(void *ptr, size_t size)
{
void *nptr;
nptr = realloc(ptr, size);
if (!nptr && ptr && size != 0)
free(ptr);
return (nptr);
}
| long long reallocf(void* a0, unsigned int a1) {
unsigned long v0;
v0 = realloc(a0, a1);
if (!v0 && a0 && a1)
free(a0);
return v0;
}
|
char *
readline_internal_teardown (int eof)
{
char *temp;
HIST_ENTRY *entry;
do { if (_rl_caught_signal) _rl_signal_handler (_rl_caught_signal); } while (0);
if (eof)
(rl_readline_state |= (0x8000000));
entry = current_history ();
if (entry && rl_undo_list)
{
temp = strcpy ((char *)xmalloc (1 + strlen (the_line)), (the_line));
rl_revert_line (1, 0);
entry = replace_history_entry (where_history (), the_line, (histdata_t)
((void *)0)
);
_rl_free_history_entry (entry);
strcpy (the_line, temp);
xfree (temp);
}
if (_rl_revert_all_at_newline)
_rl_revert_all_lines ();
if (rl_undo_list)
rl_free_undo_list ();
_rl_disable_meta_key ();
_rl_set_insert_mode (1, 0);
return (eof ? (char *)
((void *)0)
: strcpy ((char *)xmalloc (1 + strlen (the_line)), (the_line)));
}
| char * readline_internal_teardown(int a1)
{
const char *v1;
size_t v2;
char *v3;
char *v4;
unsigned int v5;
const char *v6;
size_t v7;
char *v8;
long v10;
const char *src;
if ( rl_caught_signal )
rl_signal_handler(rl_caught_signal);
if ( a1 )
rl_readline_state |= 0x8000000uLL;
if ( current_history() && rl_undo_list )
{
v1 = the_line;
v2 = strlen(the_line);
v3 = (char *)xmalloc(v2 + 1);
src = strcpy(v3, v1);
rl_revert_line(1LL, 0LL);
v4 = the_line;
v5 = where_history();
v10 = replace_history_entry(v5, v4, 0LL);
rl_free_history_entry(v10);
strcpy(the_line, src);
xfree(src);
}
if ( rl_revert_all_at_newline )
rl_revert_all_lines();
if ( rl_undo_list )
rl_free_undo_list();
rl_disable_meta_key();
rl_set_insert_mode(1LL, 0LL);
if ( a1 )
return 0LL;
v6 = the_line;
v7 = strlen(the_line);
v8 = (char *)xmalloc(v7 + 1);
return strcpy(v8, v6);
}
|
int
kex_derive_keys(struct ssh *ssh, u_char *hash, u_int hashlen,
const struct sshbuf *shared_secret)
{
struct kex *kex = ssh->kex;
u_char *keys[6];
u_int i, j, mode, ctos;
int r;
if ((kex->flags & 0x0002) != 0) {
if (sshbuf_len(kex->session_id) != 0) {
sshlog("kex.c", __func__, 1114, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "already have session ID at kex");
return -1;
}
if ((r = sshbuf_put(kex->session_id, hash, hashlen)) != 0)
return r;
} else if (sshbuf_len(kex->session_id) == 0) {
sshlog("kex.c", __func__, 1120, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "no session ID in rekex");
return -1;
}
for (i = 0; i < 6; i++) {
if ((r = derive_key(ssh, 'A'+i, kex->we_need, hash, hashlen,
shared_secret, &keys[i])) != 0) {
for (j = 0; j < i; j++)
free(keys[j]);
return r;
}
}
for (mode = 0; mode < MODE_MAX; mode++) {
ctos = (!kex->server && mode == MODE_OUT) ||
(kex->server && mode == MODE_IN);
kex->newkeys[mode]->enc.iv = keys[ctos ? 0 : 1];
kex->newkeys[mode]->enc.key = keys[ctos ? 2 : 3];
kex->newkeys[mode]->mac.key = keys[ctos ? 4 : 5];
}
return 0;
}
| long long kex_derive_keys(struct_0 *a0, unsigned long long a1, unsigned long a2, unsigned long long a3) {
unsigned long long v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
struct_1 *v6;
char v7;
unsigned long long v9;
unsigned int v10;
v0 = a3;
v6 = a0->field_8;
if ((v6->field_8c & 2)) {
if (sshbuf_len(v6->field_70)) {
sshlog("kex.c", "kex_derive_keys", 0x45a, 0x1, 0x2, 0x0, "already have session ID at kex");
v9 = 4294967295;
return v9;
}
v4 = sshbuf_put(v6->field_70, a1, a2, a1);
if (v4) {
v9 = v4;
return v9;
}
} else {
if (!sshbuf_len(v6->field_70)) {
sshlog("kex.c", "kex_derive_keys", 0x460, 0x1, 0x2, 0x0, "no session ID in rekex");
v9 = 4294967295;
return v9;
}
}
v1 = 0;
while (true) {
if (v1 <= 5) {
v4 = derive_key(a0, v1 + 65, v6->field_10, a1, a2, v0, &(&v7)[8 * v1]);
if (!v4) {
v1 += 1;
} else {
for (v2 = 0; v2 < v1; v2 += 1) {
free(*(&(&v7)[8 * v2]));
}
v9 = v4;
return v9;
}
} else {
for (v3 = 0; v3 <= 1; v3 += 1) {
if (!v6->field_18 && v3 == 1 || v6->field_18 && !v3)
v10 = 1;
else
v10 = 0;
v5 = v10;
(&v6->field_0)[v3]->field_28 = *(&(&v7)[8 * (!v5)]);
(&v6->field_0)[v3]->field_20 = *(&(&v7)[8 * (!v5 ? 2 : 3)]);
(&v6->field_0)[v3]->field_40 = *(&(&v7)[8 * (!v5 ? 4 : 5)]);
}
v9 = 0;
return v9;
}
}
}
|
_Bool
pred_quit (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
(void) pathname;
(void) stat_buf;
(void) pred_ptr;
cleanup ();
exit (state.exit_status);
}
| long long pred_quit() {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned long v4;
unsigned long v5;
unsigned long v6;
v2 = v4;
v1 = v5;
v0 = v6;
cleanup();
exit(g_50004c);
}
|
int __attribute__((visibility ("hidden"))) _tr_tally(s, dist, lc)
deflate_state *s;
unsigned dist;
unsigned lc;
{
s->sym_buf[s->sym_next++] = (uch)dist;
s->sym_buf[s->sym_next++] = (uch)(dist >> 8);
s->sym_buf[s->sym_next++] = (uch)lc;
if (dist == 0) {
s->dyn_ltree[lc].fc.freq++;
} else {
s->matches++;
dist--;
;
s->dyn_ltree[_length_code[lc] + 256 + 1].fc.freq++;
s->dyn_dtree[((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])].fc.freq++;
}
return (s->sym_next == s->sym_end);
}
| long long _tr_tally(struct_0 *a0, unsigned long a1, unsigned long a2) {
unsigned int v0;
int tmp_71;
int tmp_77;
int tmp_124;
int tmp_130;
int tmp_161;
struct_0 *v1;
char *v3;
unsigned long long v4;
unsigned short v5;
unsigned long long v6;
v1 = a0;
v0 = a1;
tmp_71 = a0->field_1700;
tmp_77 = a0->field_170c;
a0->field_170c = a0->field_170c + 1;
*((tmp_77 + tmp_71)) = v0;
tmp_124 = a0->field_1700;
tmp_130 = a0->field_170c;
a0->field_170c = a0->field_170c + 1;
*((tmp_130 + tmp_124)) = v0 >> 8;
v3 = a0->field_1700;
tmp_161 = a0->field_170c;
a0->field_170c = a0->field_170c + 1;
v3[tmp_161] = a2;
if (!v0) {
*(&a0->padding_0[212 + 4 * a2]) = *(&a0->padding_0[212 + 4 * a2]) + 1;
} else {
a0->field_1728 = a0->field_1728 + 1;
v0 -= 1;
*(&a0->padding_0[1240 + 4 * *(a2 + &_length_code)]) = *(&a0->padding_0[1240 + 4 * *(a2 + &_length_code)]) + 1;
if (v0 <= 255)
v4 = *(v0 + &_dist_code);
else
v4 = *((v0 >> 7) + &g_4043c0);
v5 = *(&a0->padding_0[2504 + 4 * v4]) + 1;
v6 = v4 + 624;
*(&a0->padding_0[8 + 4 * v6]) = v5;
}
return a0->field_170c == a0->field_1710;
}
|
timespec_cmp (struct timespec a, struct timespec b)
{
return 2 * (((a.tv_sec) > (b.tv_sec)) - ((a.tv_sec) < (b.tv_sec))) + (((a.tv_nsec) > (b.tv_nsec)) - ((a.tv_nsec) < (b.tv_nsec)));
}
| void timespec_cmp(void)
{
halt_baddata();
}
|
static inline void
print_forceinfo_line(int type, const char *name, const char *desc)
{
printf(" %s %-18s %s\n", forcetype_str(type), name, desc);
}
| void print_forceinfo_line(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned long v0;
unsigned long long v2;
v0 = a2;
v2 = printf(" %s %-18s %s\n", forcetype_str(a0), a1);
return;
}
|
int
rl_vi_match (int ignore, int key)
{
int count = 1, brack, pos, tmp, pre;
pos = rl_point;
if ((brack = rl_vi_bracktype (rl_line_buffer[rl_point])) == 0)
{
if (
(__ctype_get_mb_cur_max ())
> 1 && rl_byte_oriented == 0)
{
while ((brack = rl_vi_bracktype (rl_line_buffer[rl_point])) == 0)
{
pre = rl_point;
rl_forward_char (1, key);
if (pre == rl_point)
break;
}
}
else
while ((brack = rl_vi_bracktype (rl_line_buffer[rl_point])) == 0 &&
rl_point < rl_end - 1)
rl_forward_char (1, key);
if (brack <= 0)
{
rl_point = pos;
rl_ding ();
return 1;
}
}
pos = rl_point;
if (brack < 0)
{
while (count)
{
tmp = pos;
if (
(__ctype_get_mb_cur_max ())
== 1 || rl_byte_oriented)
pos--;
else
{
pos = _rl_find_prev_mbchar (rl_line_buffer, pos, 0x00);
if (tmp == pos)
pos--;
}
if (pos >= 0)
{
int b = rl_vi_bracktype (rl_line_buffer[pos]);
if (b == -brack)
count--;
else if (b == brack)
count++;
}
else
{
rl_ding ();
return 1;
}
}
}
else
{
while (count)
{
if (
(__ctype_get_mb_cur_max ())
== 1 || rl_byte_oriented)
pos++;
else
pos = _rl_find_next_mbchar (rl_line_buffer, pos, 1, 0x00);
if (pos < rl_end)
{
int b = rl_vi_bracktype (rl_line_buffer[pos]);
if (b == -brack)
count--;
else if (b == brack)
count++;
}
else
{
rl_ding ();
return 1;
}
}
}
rl_point = pos;
return (0);
}
| long long rl_vi_match(unsigned long a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned long long v9;
v0 = a0;
v1 = 1;
v3 = rl_point;
v2 = rl_vi_bracktype(*((rl_point + rl_line_buffer)));
if (!v2) {
if (__ctype_get_mb_cur_max() <= 1 || rl_byte_oriented) {
while (true) {
v2 = rl_vi_bracktype(*((rl_point + rl_line_buffer)));
if (!(!v2) || !(rl_end - 1 > rl_point))
break;
rl_forward_char(0x1, a1);
}
} else {
do { } while ((v2 = rl_vi_bracktype(*((rl_point + rl_line_buffer))), !v2 && (v4 = rl_point, rl_forward_char(0x1, a1), v4 != rl_point)));
}
if (v2 <= 0) {
rl_point = v3;
rl_ding();
v9 = 1;
return v9;
}
}
v3 = rl_point;
if (v2 >= 0) {
while (v1) {
if (__ctype_get_mb_cur_max() == 1 || rl_byte_oriented)
v3 += 1;
else
v3 = _rl_find_next_mbchar(rl_line_buffer, v3, 0x1, 0x0);
if (v3 >= rl_end) {
rl_ding();
v9 = 1;
return v9;
}
v5 = rl_vi_bracktype(*((v3 + rl_line_buffer)));
if (v5 == !(v2)) {
v1 -= 1;
} else if (v5 == v2) {
v1 += 1;
}
}
} else {
while (v1) {
v6 = v3;
if (__ctype_get_mb_cur_max() == 1 || rl_byte_oriented) {
v3 -= 1;
} else {
v3 = _rl_find_prev_mbchar(rl_line_buffer, v3, 0x0, v3);
if (v6 == v3)
v3 -= 1;
}
if (v3 < 0) {
rl_ding();
v9 = 1;
return v9;
}
v7 = rl_vi_bracktype(*((v3 + rl_line_buffer)));
if (v7 == !(v2)) {
v1 -= 1;
} else if (v7 == v2) {
v1 += 1;
}
}
}
rl_point = v3;
v9 = 0;
return v9;
}
|
static void tcp_server(const char *name, int port)
{
int n, s;
char topbuf[512];
int accept_fd;
struct sockaddr_storage client_address;
socklen_t calen;
struct timeval tv;
s = listen_socket(name, port,
SOCK_STREAM
);
if (s < 0)
exit(1);
for (;;) {
gl_list_iterator_t iter;
gl_list_node_t node;
const void *elt;
gl_list_t accepted_list = gl_list_create_empty(&gl_linked_list_implementation,
((void *)0)
,
((void *)0)
,
((void *)0)
,
1
);
fd_set rd, wr;
time_t now = time(0);
int val;
do { unsigned int __i; fd_set *__arr = (
&rd
); for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) ((__arr)->fds_bits)[__i] = 0; } while (0)
;
do { unsigned int __i; fd_set *__arr = (
&wr
); for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) ((__arr)->fds_bits)[__i] = 0; } while (0)
;
n = 0;
iter = gl_list_iterator(listener_list);
while (gl_list_iterator_next(&iter, &elt, &node)) {
listener_item *j = (listener_item *)elt;
val =
rpl_fcntl
(j->fd,
3
, 0);
if ((val == -1)
|| (
rpl_fcntl
(j->fd,
4
, val |
04000
) <
0)) {
perror("fcntl()");
exit(1);
}
if (j->start != 0 && now - j->start > 30) {
if (verbose != 0) {
fprintf(
stderr
, "Scheduling inactive connection for close\n");
}
j->http_state = 3;
}
if (j->listen_socket) {
((void) (((
&rd
)->fds_bits)[((
j->fd
) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << ((
j->fd
) % (8 * (int) sizeof (__fd_mask)))))))
;
n =
(((
n
)>(
j->fd
))?(
n
):(
j->fd
))
;
}
if (j->http_state == 1) {
((void) (((
&rd
)->fds_bits)[((
j->fd
) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << ((
j->fd
) % (8 * (int) sizeof (__fd_mask)))))))
;
n =
(((
n
)>(
j->fd
))?(
n
):(
j->fd
))
;
}
if (j->http_state == 2) {
((void) (((
&wr
)->fds_bits)[((
j->fd
) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << ((
j->fd
) % (8 * (int) sizeof (__fd_mask)))))))
;
n =
(((
n
)>(
j->fd
))?(
n
):(
j->fd
))
;
}
gl_list_node_set_value(listener_list, node, j);
}
gl_list_iterator_free(&iter);
tv.tv_sec = 10;
tv.tv_usec = 0;
n = select(n + 1, &rd, &wr,
((void *)0)
, &tv);
if (n == -1 &&
(*__errno_location ())
==
4
)
continue;
if (n < 0) {
perror("select()");
exit(1);
}
iter = gl_list_iterator(listener_list);
while (gl_list_iterator_next(&iter, &elt, &node)) {
listener_item *j = (listener_item *)elt;
if (
((((
&rd
)->fds_bits)[((
j->fd
) / (8 * (int) sizeof (__fd_mask)))] & ((__fd_mask) (1UL << ((
j->fd
) % (8 * (int) sizeof (__fd_mask)))))) != 0)
&& j->listen_socket) {
calen = sizeof(client_address);
memset(&client_address, 0, calen);
accept_fd =
accept(j->fd,
(struct sockaddr *)
&client_address, &calen);
if (accept_fd < 0) {
perror("accept()");
} else {
char timebuf[64];
time_t tt = time(0);
char *ctt;
listener_item *jj;
jj = xzalloc(sizeof(*jj));
gl_list_add_last(accepted_list, jj);
jj->http_request =
(char *) strdup("");
jj->http_state = 1;
jj->fd = accept_fd;
jj->start = tt;
jj->tls_session = initialize_session(0);
gnutls_session_set_ptr(jj->tls_session, jj);
gnutls_transport_set_int2(jj->tls_session, accept_fd, accept_fd)
;
;
jj->handshake_ok = 0;
jj->close_ok = 0;
if (verbose != 0) {
ctt = simple_ctime(&tt, timebuf);
ctt[strlen(ctt) - 1] = 0;
printf
("\n* Accepted connection from %s on %s\n",
human_addr((struct
sockaddr
*)
&client_address,
calen,
topbuf,
sizeof
(topbuf)),
ctt);
}
}
}
if (
((((
&rd
)->fds_bits)[((
j->fd
) / (8 * (int) sizeof (__fd_mask)))] & ((__fd_mask) (1UL << ((
j->fd
) % (8 * (int) sizeof (__fd_mask)))))) != 0)
&& !j->listen_socket) {
char buf[16*1024];
int r;
if (j->handshake_ok == 0) {
retry_handshake(j);
}
if (j->handshake_ok == 1) {
int earlydata_read = 0;
if (earlydata && !j->earlydata_eof) {
r = gnutls_record_recv_early_data(j->
tls_session,
buf,
(((
sizeof(buf)
)<(
(2147483647)
))?(
sizeof(buf)
):(
(2147483647)
))
);
if (r == -56) {
j->earlydata_eof = 1;
}
if (r == 0) {
earlydata_read = 1;
}
}
if (!earlydata_read) {
r = gnutls_record_recv(j->
tls_session,
buf,
(((
sizeof(buf)
)<(
(2147483647)
))?(
sizeof(buf)
):(
(2147483647)
))
);
}
if (r == -52 || r == -28) {
} else if (r <= 0) {
if (r == -293) {
gnutls_heartbeat_pong(j->tls_session, 0);
} else if (r == -37) {
try_rehandshake(j);
} else {
j->http_state = 3;
if (r < 0) {
int ret;
check_alert(j->tls_session, r);
fprintf(
stderr
,
"Error while receiving data\n");
do {
ret = gnutls_alert_send_appropriate(j->tls_session, r);
} while (ret == -28 || ret == -52);
fprintf(
stderr
, "Error: %s\n", safe_strerror(r));
j->close_ok = 0;
}
}
} else {
j->http_request =
realloc(j->
http_request,
j->
request_length
+ r + 1);
if (j->http_request !=
((void *)0)
) {
memcpy(j->
http_request
+
j->
request_length,
buf, r);
j->request_length
+= r;
j->http_request[j->
request_length]
= '\0';
} else {
j->http_state =
3;
}
}
j->http_response =
((void *)0)
;
if (j->http_state == 1 && j->http_request !=
((void *)0)
) {
if ((http == 0
&& strchr(j->
http_request,
'\n'))
|| strstr(j->
http_request,
"\r\n\r\n")
|| strstr(j->
http_request,
"\n\n")) {
if (get_response(j->
tls_session,
j->
http_request,
&j->
http_response,
&j->
response_length)) {
j->http_state =
2;
j->response_written
= 0;
} else {
j->http_state = 3;
}
}
}
}
}
if (
((((
&wr
)->fds_bits)[((
j->fd
) / (8 * (int) sizeof (__fd_mask)))] & ((__fd_mask) (1UL << ((
j->fd
) % (8 * (int) sizeof (__fd_mask)))))) != 0)
) {
int r;
if (j->handshake_ok == 0) {
retry_handshake(j);
}
if (j->handshake_ok == 1 && j->http_response ==
((void *)0)
) {
j->http_state = 3;
} else if (j->handshake_ok == 1 && j->http_response !=
((void *)0)
) {
r = gnutls_record_send(j->tls_session,
j->http_response
+
j->response_written,
(((
j->response_length - j->response_written
)<(
(2147483647)
))?(
j->response_length - j->response_written
):(
(2147483647)
))
);
if (r == -52 || r == -28) {
} else if (r <= 0) {
j->http_state = 3;
if (r < 0) {
fprintf(
stderr
,
"Error while sending data\n");
fprintf(
stderr
, "Error: %s\n", safe_strerror(r));
}
check_alert(j->tls_session,
r);
} else {
j->response_written += r;
if (j->response_written ==
j->response_length) {
if (http != 0)
j->http_state = 3;
else {
j->http_state = 1;
free(j->
http_response);
j->http_response =
((void *)0)
;
j->response_length = 0;
j->request_length = 0;
j->http_request[0] = 0;
}
}
}
} else {
j->request_length = 0;
j->http_request[0] = 0;
j->http_state = 1;
}
}
gl_list_node_set_value(listener_list, node, j);
}
gl_list_iterator_free(&iter);
iter = gl_list_iterator(listener_list);
while (gl_list_iterator_next(&iter, &elt, &node)) {
const listener_item *j = elt;
if (j->http_state == 3) {
gl_list_remove_node(listener_list, node);
}
}
gl_list_iterator_free(&iter);
iter = gl_list_iterator(accepted_list);
while (gl_list_iterator_next(&iter, &elt, &node)) {
gl_list_add_last(listener_list, elt);
}
gl_list_iterator_free(&iter);
gl_list_free(accepted_list);
}
gnutls_certificate_free_credentials(cert_cred);
if (srp_cred)
gnutls_srp_free_server_credentials(srp_cred);
if (psk_cred)
gnutls_psk_free_server_credentials(psk_cred);
gnutls_anon_free_server_credentials(dh_cred);
if (noticket == 0)
gnutls_free((void *) (session_ticket_key.data)), session_ticket_key.data=
((void *)0)
;
if (earlydata)
gnutls_anti_replay_deinit(anti_replay);
if (nodb == 0)
wrap_db_deinit();
gnutls_global_deinit();
}
| void tcp_server(undefined8 param_1,undefined4 param_2)
{
undefined4 uVar1;
int iVar2;
int iVar3;
char *pcVar4;
byte bVar5;
undefined *puVar6;
char cVar7;
int iVar8;
int *piVar9;
size_t sVar10;
char *pcVar11;
undefined8 uVar12;
undefined *puVar13;
long in_FS_OFFSET;
undefined8 local_44c8;
undefined8 local_44c0;
undefined8 local_44b8;
undefined8 local_44b0;
undefined8 local_44a8;
undefined8 local_44a0;
undefined8 local_4498;
undefined4 local_4484;
undefined8 local_4480;
socklen_t local_4474;
int local_4470;
uint local_446c;
int local_4468;
uint local_4464;
int local_4460;
int local_445c;
int local_4458;
int local_4454;
int local_4450;
uint local_444c;
undefined8 local_4448;
char **local_4440;
char *local_4438;
undefined8 local_4430;
time_t local_4428;
fd_set *local_4420;
fd_set *local_4418;
char **local_4410;
char **local_4408;
char **local_4400;
char *local_43f8;
char **local_43f0;
timeval local_43e8;
undefined8 local_43d8;
undefined8 local_43d0;
undefined8 local_43c8;
undefined8 local_43c0;
undefined8 local_43b8;
undefined8 local_43b0;
undefined8 local_43a8;
sockaddr local_4398 [8];
fd_set local_4318;
fd_set local_4298;
undefined local_4218 [512];
undefined local_4018 [16];
undefined local_4008 [16376];
undefined8 local_10;
puVar6 = &stack0xfffffffffffffff8;
do {
puVar13 = puVar6;
*(undefined8 *)(puVar13 + -0x1000) = *(undefined8 *)(puVar13 + -0x1000);
puVar6 = puVar13 + -0x1000;
} while (puVar13 + -0x1000 != local_4008);
local_10 = *(undefined8 *)(in_FS_OFFSET + 0x28);
*(undefined8 *)(puVar13 + -0x14c8) = 0x1038ae;
local_4484 = param_2;
local_4480 = param_1;
local_445c = listen_socket(param_1,param_2,1);
if (local_445c < 0) {
*(undefined8 *)(puVar13 + -0x14c8) = 0x1038c7;
exit(1);
}
LAB_001038c7:
*(undefined8 *)(puVar13 + -0x14c8) = 0x1038e8;
local_4430 = gl_list_create_empty(&gl_linked_list_implementation,0,0,0,1);
*(undefined8 *)(puVar13 + -0x14c8) = 0x1038f9;
local_4428 = time((time_t *)0x0);
local_4420 = &local_4318;
for (local_4464 = 0; local_4464 < 0x10; local_4464 = local_4464 + 1) {
local_4420->fds_bits[local_4464] = 0;
}
local_4418 = &local_4298;
for (local_446c = 0; local_446c < 0x10; local_446c = local_446c + 1) {
local_4418->fds_bits[local_446c] = 0;
}
local_4468 = 0;
*(undefined8 *)(puVar13 + -0x14c8) = 0x1039a1;
gl_list_iterator(&local_44c8,listener_list);
local_43d8 = local_44c8;
local_43d0 = local_44c0;
local_43c8 = local_44b8;
local_43c0 = local_44b0;
local_43b8 = local_44a8;
local_43b0 = local_44a0;
local_43a8 = local_4498;
while( true ) {
*(undefined8 *)(puVar13 + -0x14c8) = 0x103ca8;
cVar7 = gl_list_iterator_next(&local_43d8,&local_4440,&local_4448);
if (cVar7 == '\0') break;
local_43f0 = local_4440;
uVar1 = *(undefined4 *)((long)local_4440 + 0x24);
*(undefined8 *)(puVar13 + -0x14c8) = 0x103a36;
local_444c = rpl_fcntl(uVar1,3,0);
if (local_444c == 0xffffffff) {
LAB_00103a6f:
*(undefined8 *)(puVar13 + -0x14c8) = 0x103a7b;
perror("fcntl()");
*(undefined8 *)(puVar13 + -0x14c8) = 0x103a85;
exit(1);
}
uVar1 = *(undefined4 *)((long)local_43f0 + 0x24);
*(undefined8 *)(puVar13 + -0x14c8) = 0x103a6b;
iVar8 = rpl_fcntl(uVar1,4,local_444c | 0x800);
if (iVar8 < 0) goto LAB_00103a6f;
if ((local_43f0[7] != (char *)0x0) && (0x1e < local_4428 - (long)local_43f0[7])) {
if (verbose != 0) {
*(undefined8 *)(puVar13 + -0x14c8) = 0x103ad8;
fprintf(stderr,"Scheduling inactive connection for close\n");
}
*(undefined4 *)((long)local_43f0 + 0x1c) = 3;
}
iVar8 = local_4468;
if (*(int *)(local_43f0 + 4) != 0) {
iVar8 = *(int *)((long)local_43f0 + 0x24);
if (iVar8 < 0) {
iVar8 = iVar8 + 0x3f;
}
bVar5 = (byte)((int)*(undefined4 *)((long)local_43f0 + 0x24) >> 0x37);
local_4318.fds_bits[iVar8 >> 6] =
local_4318.fds_bits[iVar8 >> 6] |
1 << (((char)*(undefined4 *)((long)local_43f0 + 0x24) + (bVar5 >> 2) & 0x3f) -
(bVar5 >> 2) & 0x3f);
iVar8 = *(int *)((long)local_43f0 + 0x24);
if (*(int *)((long)local_43f0 + 0x24) <= local_4468) {
iVar8 = local_4468;
}
}
local_4468 = iVar8;
iVar8 = local_4468;
if (*(int *)((long)local_43f0 + 0x1c) == 1) {
iVar8 = *(int *)((long)local_43f0 + 0x24);
if (iVar8 < 0) {
iVar8 = iVar8 + 0x3f;
}
bVar5 = (byte)((int)*(undefined4 *)((long)local_43f0 + 0x24) >> 0x37);
local_4318.fds_bits[iVar8 >> 6] =
local_4318.fds_bits[iVar8 >> 6] |
1 << (((char)*(undefined4 *)((long)local_43f0 + 0x24) + (bVar5 >> 2) & 0x3f) -
(bVar5 >> 2) & 0x3f);
iVar8 = *(int *)((long)local_43f0 + 0x24);
if (*(int *)((long)local_43f0 + 0x24) <= local_4468) {
iVar8 = local_4468;
}
}
local_4468 = iVar8;
iVar8 = local_4468;
if (*(int *)((long)local_43f0 + 0x1c) == 2) {
iVar8 = *(int *)((long)local_43f0 + 0x24);
if (iVar8 < 0) {
iVar8 = iVar8 + 0x3f;
}
bVar5 = (byte)((int)*(undefined4 *)((long)local_43f0 + 0x24) >> 0x37);
local_4298.fds_bits[iVar8 >> 6] =
local_4298.fds_bits[iVar8 >> 6] |
1 << (((char)*(undefined4 *)((long)local_43f0 + 0x24) + (bVar5 >> 2) & 0x3f) -
(bVar5 >> 2) & 0x3f);
iVar8 = *(int *)((long)local_43f0 + 0x24);
if (*(int *)((long)local_43f0 + 0x24) <= local_4468) {
iVar8 = local_4468;
}
}
local_4468 = iVar8;
*(undefined8 *)(puVar13 + -0x14c8) = 0x103c88;
gl_list_node_set_value(listener_list,local_4448,local_43f0);
}
*(undefined8 *)(puVar13 + -0x14c8) = 0x103cbf;
gl_list_iterator_free();
local_43e8.tv_sec = 10;
local_43e8.tv_usec = 0;
*(undefined8 *)(puVar13 + -0x14c8) = 0x103d03;
local_4468 = select(local_4468 + 1,&local_4318,&local_4298,(fd_set *)0x0,&local_43e8);
if (local_4468 == -1) goto code_r0x00103d12;
goto LAB_00103d22;
code_r0x00103d12:
*(undefined8 *)(puVar13 + -0x14c8) = 0x103d17;
piVar9 = __errno_location();
if (*piVar9 != 4) {
LAB_00103d22:
if (local_4468 < 0) {
*(undefined8 *)(puVar13 + -0x14c8) = 0x103d37;
perror("select()");
*(undefined8 *)(puVar13 + -0x14c8) = 0x103d41;
exit(1);
}
*(undefined8 *)(puVar13 + -0x14c8) = 0x103d5a;
gl_list_iterator(&local_44c8,listener_list);
local_43d8 = local_44c8;
local_43d0 = local_44c0;
local_43c8 = local_44b8;
local_43c0 = local_44b0;
local_43b8 = local_44a8;
local_43b0 = local_44a0;
local_43a8 = local_4498;
while( true ) {
*(undefined8 *)(puVar13 + -0x14c8) = 0x10470b;
cVar7 = gl_list_iterator_next(&local_43d8,&local_4440,&local_4448);
if (cVar7 == '\0') break;
local_4408 = local_4440;
iVar8 = *(int *)((long)local_4440 + 0x24);
if (iVar8 < 0) {
iVar8 = iVar8 + 0x3f;
}
bVar5 = (byte)((int)*(undefined4 *)((long)local_4440 + 0x24) >> 0x37);
if (((1 << (((char)*(undefined4 *)((long)local_4440 + 0x24) + (bVar5 >> 2) & 0x3f) -
(bVar5 >> 2) & 0x3f) & local_4318.fds_bits[iVar8 >> 6]) != 0) &&
(*(int *)(local_4440 + 4) != 0)) {
local_4474 = 0x80;
*(undefined8 *)(puVar13 + -0x14c8) = 0x103e54;
memset(local_4398,0,0x80);
iVar8 = *(int *)((long)local_4408 + 0x24);
*(undefined8 *)(puVar13 + -0x14c8) = 0x103e79;
local_4458 = accept(iVar8,local_4398,&local_4474);
if (local_4458 < 0) {
*(undefined8 *)(puVar13 + -0x14c8) = 0x103e94;
perror("accept()");
}
else {
*(undefined8 *)(puVar13 + -0x14c8) = 0x103ea3;
local_4438 = (char *)time((time_t *)0x0);
*(undefined8 *)(puVar13 + -0x14c8) = 0x103eb4;
local_4400 = (char **)xzalloc(0x48);
*(undefined8 *)(puVar13 + -0x14c8) = 0x103ed4;
gl_list_add_last(local_4430,local_4400);
*(undefined8 *)(puVar13 + -0x14c8) = 0x103ee0;
pcVar11 = strdup("");
*local_4400 = pcVar11;
*(undefined4 *)((long)local_4400 + 0x1c) = 1;
*(int *)((long)local_4400 + 0x24) = local_4458;
local_4400[7] = local_4438;
*(undefined8 *)(puVar13 + -0x14c8) = 0x103f27;
pcVar11 = (char *)initialize_session(0);
local_4400[5] = pcVar11;
pcVar11 = local_4400[5];
*(undefined8 *)(puVar13 + -0x14c8) = 0x103f4f;
gnutls_session_set_ptr(pcVar11,local_4400);
pcVar11 = local_4400[5];
*(undefined8 *)(puVar13 + -0x14c8) = 0x103f70;
gnutls_transport_set_int2(pcVar11,local_4458,local_4458);
*(undefined4 *)(local_4400 + 6) = 0;
*(undefined4 *)((long)local_4400 + 0x34) = 0;
if (verbose != 0) {
*(undefined8 *)(puVar13 + -0x14c8) = 0x103fb3;
local_43f8 = (char *)simple_ctime(&local_4438,local_4018);
*(undefined8 *)(puVar13 + -0x14c8) = 0x103fc9;
sVar10 = strlen(local_43f8);
local_43f8[sVar10 - 1] = '\0';
*(undefined8 *)(puVar13 + -0x14c8) = 0x103ffb;
uVar12 = human_addr(local_4398,local_4474,local_4218,0x200);
*(undefined8 *)(puVar13 + -0x14c8) = 0x10401c;
printf("\n* Accepted connection from %s on %s\n",uVar12,local_43f8);
}
}
}
iVar8 = *(int *)((long)local_4408 + 0x24);
if (iVar8 < 0) {
iVar8 = iVar8 + 0x3f;
}
bVar5 = (byte)((int)*(undefined4 *)((long)local_4408 + 0x24) >> 0x37);
if (((1 << (((char)*(undefined4 *)((long)local_4408 + 0x24) + (bVar5 >> 2) & 0x3f) -
(bVar5 >> 2) & 0x3f) & local_4318.fds_bits[iVar8 >> 6]) != 0) &&
(*(int *)(local_4408 + 4) == 0)) {
if (*(int *)(local_4408 + 6) == 0) {
*(undefined8 *)(puVar13 + -0x14c8) = 0x104098;
retry_handshake(local_4408);
}
if (*(int *)(local_4408 + 6) == 1) {
local_4460 = 0;
if ((earlydata != 0) && (*(int *)(local_4408 + 8) == 0)) {
pcVar11 = local_4408[5];
*(undefined8 *)(puVar13 + -0x14c8) = 0x1040ef;
local_4470 = gnutls_record_recv_early_data(pcVar11,local_4018,0x4000);
if (local_4470 == -0x38) {
*(undefined4 *)(local_4408 + 8) = 1;
}
if (local_4470 == 0) {
local_4460 = 1;
}
}
if (local_4460 == 0) {
pcVar11 = local_4408[5];
*(undefined8 *)(puVar13 + -0x14c8) = 0x10414a;
local_4470 = gnutls_record_recv(pcVar11,local_4018,0x4000);
}
if ((local_4470 != -0x34) && (local_4470 != -0x1c)) {
if (local_4470 < 1) {
if (local_4470 == -0x125) {
pcVar11 = local_4408[5];
*(undefined8 *)(puVar13 + -0x14c8) = 0x10419b;
gnutls_heartbeat_pong(pcVar11,0);
}
else if (local_4470 == -0x25) {
*(undefined8 *)(puVar13 + -0x14c8) = 0x1041b8;
try_rehandshake(local_4408);
}
else {
*(undefined4 *)((long)local_4408 + 0x1c) = 3;
if (local_4470 < 0) {
pcVar11 = local_4408[5];
*(undefined8 *)(puVar13 + -0x14c8) = 0x1041f3;
check_alert(pcVar11,local_4470);
*(undefined8 *)(puVar13 + -0x14c8) = 0x10420e;
fprintf(stderr,"Error while receiving data\n");
do {
do {
pcVar11 = local_4408[5];
*(undefined8 *)(puVar13 + -0x14c8) = 0x104229;
local_4454 = gnutls_alert_send_appropriate(pcVar11,local_4470);
} while (local_4454 == -0x1c);
} while (local_4454 == -0x34);
*(undefined8 *)(puVar13 + -0x14c8) = 0x10424e;
uVar12 = safe_strerror(local_4470);
*(undefined8 *)(puVar13 + -0x14c8) = 0x10426c;
fprintf(stderr,"Error: %s\n",uVar12);
*(undefined4 *)((long)local_4408 + 0x34) = 0;
}
}
}
else {
iVar8 = *(int *)(local_4408 + 2);
pcVar11 = *local_4408;
*(undefined8 *)(puVar13 + -0x14c8) = 0x1042ac;
pcVar11 = (char *)realloc(pcVar11,(long)(local_4470 + iVar8 + 1));
*local_4408 = pcVar11;
if (*local_4408 == (char *)0x0) {
*(undefined4 *)((long)local_4408 + 0x1c) = 3;
}
else {
pcVar11 = *local_4408;
iVar8 = *(int *)(local_4408 + 2);
*(undefined8 *)(puVar13 + -0x14c8) = 0x1042f9;
memcpy(pcVar11 + iVar8,local_4018,(long)local_4470);
*(int *)(local_4408 + 2) = *(int *)(local_4408 + 2) + local_4470;
(*local_4408)[*(int *)(local_4408 + 2)] = '\0';
}
}
}
local_4408[1] = (char *)0x0;
if ((*(int *)((long)local_4408 + 0x1c) == 1) && (*local_4408 != (char *)0x0)) {
if (http == 0) {
pcVar11 = *local_4408;
*(undefined8 *)(puVar13 + -0x14c8) = 0x104397;
pcVar11 = strchr(pcVar11,10);
if (pcVar11 == (char *)0x0) goto LAB_0010439c;
}
else {
LAB_0010439c:
pcVar11 = *local_4408;
*(undefined8 *)(puVar13 + -0x14c8) = 0x1043b5;
pcVar11 = strstr(pcVar11,"\r\n\r\n");
if (pcVar11 == (char *)0x0) {
pcVar11 = *local_4408;
*(undefined8 *)(puVar13 + -0x14c8) = 0x1043d3;
pcVar11 = strstr(pcVar11,"\n\n");
if (pcVar11 == (char *)0x0) goto LAB_0010443b;
}
}
pcVar11 = *local_4408;
pcVar4 = local_4408[5];
*(undefined8 *)(puVar13 + -0x14c8) = 0x10440b;
iVar8 = get_response(pcVar4,pcVar11,local_4408 + 1);
if (iVar8 == 0) {
*(undefined4 *)((long)local_4408 + 0x1c) = 3;
}
else {
*(undefined4 *)((long)local_4408 + 0x1c) = 2;
*(undefined4 *)(local_4408 + 3) = 0;
}
}
}
}
LAB_0010443b:
iVar8 = *(int *)((long)local_4408 + 0x24);
if (iVar8 < 0) {
iVar8 = iVar8 + 0x3f;
}
bVar5 = (byte)((int)*(undefined4 *)((long)local_4408 + 0x24) >> 0x37);
if ((1 << (((char)*(undefined4 *)((long)local_4408 + 0x24) + (bVar5 >> 2) & 0x3f) -
(bVar5 >> 2) & 0x3f) & local_4298.fds_bits[iVar8 >> 6]) != 0) {
if (*(int *)(local_4408 + 6) == 0) {
*(undefined8 *)(puVar13 + -0x14c8) = 0x1044a5;
retry_handshake(local_4408);
}
if ((*(int *)(local_4408 + 6) == 1) && (local_4408[1] == (char *)0x0)) {
*(undefined4 *)((long)local_4408 + 0x1c) = 3;
}
else if ((*(int *)(local_4408 + 6) == 1) && (local_4408[1] != (char *)0x0)) {
iVar8 = *(int *)((long)local_4408 + 0x14);
iVar2 = *(int *)(local_4408 + 3);
pcVar11 = local_4408[1];
iVar3 = *(int *)(local_4408 + 3);
pcVar4 = local_4408[5];
*(undefined8 *)(puVar13 + -0x14c8) = 0x104549;
local_4450 = gnutls_record_send(pcVar4,pcVar11 + iVar3,(long)(iVar8 - iVar2));
if ((local_4450 != -0x34) && (local_4450 != -0x1c)) {
if (local_4450 < 1) {
*(undefined4 *)((long)local_4408 + 0x1c) = 3;
if (local_4450 < 0) {
*(undefined8 *)(puVar13 + -0x14c8) = 0x1045a4;
fprintf(stderr,"Error while sending data\n");
*(undefined8 *)(puVar13 + -0x14c8) = 0x1045b1;
uVar12 = safe_strerror(local_4450);
*(undefined8 *)(puVar13 + -0x14c8) = 0x1045cf;
fprintf(stderr,"Error: %s\n",uVar12);
}
pcVar11 = local_4408[5];
*(undefined8 *)(puVar13 + -0x14c8) = 0x1045ea;
check_alert(pcVar11,local_4450);
}
else {
*(int *)(local_4408 + 3) = *(int *)(local_4408 + 3) + local_4450;
if (*(int *)(local_4408 + 3) == *(int *)((long)local_4408 + 0x14)) {
if (http == 0) {
*(undefined4 *)((long)local_4408 + 0x1c) = 1;
pcVar11 = local_4408[1];
*(undefined8 *)(puVar13 + -0x14c8) = 0x104665;
free(pcVar11);
local_4408[1] = (char *)0x0;
*(undefined4 *)((long)local_4408 + 0x14) = 0;
*(undefined4 *)(local_4408 + 2) = 0;
**local_4408 = '\0';
}
else {
*(undefined4 *)((long)local_4408 + 0x1c) = 3;
}
}
}
}
}
else {
*(undefined4 *)(local_4408 + 2) = 0;
**local_4408 = '\0';
*(undefined4 *)((long)local_4408 + 0x1c) = 1;
}
}
*(undefined8 *)(puVar13 + -0x14c8) = 0x1046eb;
gl_list_node_set_value(listener_list,local_4448,local_4408);
}
*(undefined8 *)(puVar13 + -0x14c8) = 0x104722;
gl_list_iterator_free(&local_43d8);
*(undefined8 *)(puVar13 + -0x14c8) = 0x10473b;
gl_list_iterator(&local_44c8,listener_list);
local_43d8 = local_44c8;
local_43d0 = local_44c0;
local_43c8 = local_44b8;
local_43c0 = local_44b0;
local_43b8 = local_44a8;
local_43b0 = local_44a0;
local_43a8 = local_4498;
while( true ) {
*(undefined8 *)(puVar13 + -0x14c8) = 0x1047f5;
cVar7 = gl_list_iterator_next(&local_43d8,&local_4440,&local_4448);
if (cVar7 == '\0') break;
local_4410 = local_4440;
if (*(int *)((long)local_4440 + 0x1c) == 3) {
*(undefined8 *)(puVar13 + -0x14c8) = 0x1047d5;
gl_list_remove_node(listener_list,local_4448);
}
}
*(undefined8 *)(puVar13 + -0x14c8) = 0x104808;
gl_list_iterator_free(&local_43d8);
*(undefined8 *)(puVar13 + -0x14c8) = 0x104821;
gl_list_iterator(&local_44c8,local_4430);
local_43d8 = local_44c8;
local_43d0 = local_44c0;
local_43c8 = local_44b8;
local_43c0 = local_44b0;
local_43b8 = local_44a8;
local_43b0 = local_44a0;
local_43a8 = local_4498;
while( true ) {
*(undefined8 *)(puVar13 + -0x14c8) = 0x1048be;
cVar7 = gl_list_iterator_next(&local_43d8,&local_4440,&local_4448);
if (cVar7 == '\0') break;
*(undefined8 *)(puVar13 + -0x14c8) = 0x10489e;
gl_list_add_last(listener_list,local_4440);
}
*(undefined8 *)(puVar13 + -0x14c8) = 0x1048d1;
gl_list_iterator_free(&local_43d8);
*(undefined8 *)(puVar13 + -0x14c8) = 0x1048e0;
gl_list_free(local_4430);
}
goto LAB_001038c7;
}
|
static inline __u64 rta_getattr_u64(const struct rtattr *rta)
{
__u64 tmp;
memcpy(&tmp, ((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), sizeof(__u64));
return tmp;
}
| int rta_getattr_u64(unsigned long a0) {
char v0;
memcpy(&v0, a0 + 4, 0x8);
return *(&v0);
}
|
static void
sane_mode (struct termios *mode)
{
int i;
tcflag_t *bitsp;
for (i = 0; control_info[i].name; ++i)
{
mode->c_cc[control_info[i].offset] = control_info[i].saneval;
}
for (i = 0; mode_info[i].name !=
((void *)0)
; ++i)
{
if (mode_info[i].flags & 16)
continue;
if (mode_info[i].flags & 1)
{
bitsp = mode_type_flag (mode_info[i].type, mode);
((void) sizeof ((
bitsp
) ? 1 : 0), __extension__ ({ if (
bitsp
) ; else __assert_fail (
"bitsp"
, "src/stty.c", 2252, __extension__ __PRETTY_FUNCTION__); }))
;
*bitsp = (*bitsp & ~mode_info[i].mask) | mode_info[i].bits;
}
else if (mode_info[i].flags & 2)
{
bitsp = mode_type_flag (mode_info[i].type, mode);
((void) sizeof ((
bitsp
) ? 1 : 0), __extension__ ({ if (
bitsp
) ; else __assert_fail (
"bitsp"
, "src/stty.c", 2258, __extension__ __PRETTY_FUNCTION__); }))
;
*bitsp = *bitsp & ~mode_info[i].mask & ~mode_info[i].bits;
}
}
}
| void sane_mode(unsigned int a0) {
unsigned int v0;
unsigned int *v1;
unsigned long long v3;
for (v0 = 0; control_info[2 * v0 + v0]; v0 += 1) {
*((a0 + (&g_406ff0)[3 * v0] + 17)) = (&g_406fe8)[3 * v0];
}
for (v0 = 0; mode_info[4 * v0]; v0 += 1) {
v3 = mode_info[4 * v0];
if (!(g_4064ac[32 * v0] & 16)) {
if ((g_4064ac[32 * v0] & 1)) {
v1 = mode_type_flag(*(&(&g_4064a8)[32 * v0]), a0);
if (!v1)
__assert_fail();
*(v1) = *(v1) & !(*(&(&g_4064b8)[32 * v0])) | *(&(&g_4064b0)[32 * v0]);
} else if ((g_4064ac[32 * v0] & 2)) {
v1 = mode_type_flag(*(&(&g_4064a8)[32 * v0]), a0);
if (!v1)
__assert_fail();
*(v1) = *(v1) & !(*(&(&g_4064b8)[32 * v0])) & !(*(&(&g_4064b0)[32 * v0]));
}
}
}
return;
}
|
static void
clear_libcrypto_errors(void)
{
while (ERR_get_error() != 0)
;
}
| void clear_libcrypto_errors() {
while (true) {
if (!ERR_get_error())
break;
}
return;
}
|
static inline void
statx_to_stat (struct statx *stx, struct stat *stat)
{
stat->st_dev =
gnu_dev_makedev (
stx->stx_dev_major
,
stx->stx_dev_minor
)
;
stat->st_ino = stx->stx_ino;
stat->st_mode = stx->stx_mode;
stat->st_nlink = stx->stx_nlink;
stat->st_uid = stx->stx_uid;
stat->st_gid = stx->stx_gid;
stat->st_rdev =
gnu_dev_makedev (
stx->stx_rdev_major
,
stx->stx_rdev_minor
)
;
stat->st_size = stx->stx_size;
stat->st_blksize = stx->stx_blksize;
stat->st_blocks = stx->stx_blocks;
stat->st_atim = statx_timestamp_to_timespec (stx->stx_atime);
stat->st_mtim = statx_timestamp_to_timespec (stx->stx_mtime);
stat->st_ctim = statx_timestamp_to_timespec (stx->stx_ctime);
}
| long statx_to_stat(long a1, long a2)
{
long v2;
long v3;
long result;
long v5;
*(_QWORD *)a2 = gnu_dev_makedev(*(_DWORD *)(a1 + 136), *(_DWORD *)(a1 + 140));
*(_QWORD *)(a2 + 8) = *(_QWORD *)(a1 + 32);
*(_DWORD *)(a2 + 24) = *(unsigned short *)(a1 + 28);
*(_QWORD *)(a2 + 16) = *(unsigned int *)(a1 + 16);
*(_DWORD *)(a2 + 28) = *(_DWORD *)(a1 + 20);
*(_DWORD *)(a2 + 32) = *(_DWORD *)(a1 + 24);
*(_QWORD *)(a2 + 40) = gnu_dev_makedev(*(_DWORD *)(a1 + 128), *(_DWORD *)(a1 + 132));
*(_QWORD *)(a2 + 48) = *(_QWORD *)(a1 + 40);
*(_QWORD *)(a2 + 56) = *(unsigned int *)(a1 + 4);
*(_QWORD *)(a2 + 64) = *(_QWORD *)(a1 + 48);
*(_QWORD *)(a2 + 72) = statx_timestamp_to_timespec(*(_QWORD *)(a1 + 64));
*(_QWORD *)(a2 + 80) = v2;
*(_QWORD *)(a2 + 88) = statx_timestamp_to_timespec(*(_QWORD *)(a1 + 112));
*(_QWORD *)(a2 + 96) = v3;
result = statx_timestamp_to_timespec(*(_QWORD *)(a1 + 96));
*(_QWORD *)(a2 + 104) = result;
*(_QWORD *)(a2 + 112) = v5;
return result;
}
|
void *
__new_var_obj_p(int magic, size_t size)
{
obj_prefix *obj_p = (obj_prefix *)malloc(size);
if (obj_p) {
obj_p->p_magic = (long)magic;
obj_p->p_flags = 1;
}
return obj_p;
}
| long long __new_var_obj_p(unsigned long a0, unsigned int a1) {
unsigned short v0[2];
*(&v0) = malloc(a1);
if (v0) {
v0[0] = a0;
v0[1] = 1;
return v0;
}
return v0;
}
|
static int
parse_symbols (char const *str, struct symbol_value const *table,
_Bool
exclusive, char const *error_msgid)
{
int value = 0;
while (
1
)
{
char const *strcomma = strchr (str, ',');
struct symbol_value const *entry;
for (entry = table;
! (operand_matches (str, entry->symbol, ',') && entry->value);
entry++)
{
if (! entry->symbol[0])
{
idx_t slen = strcomma ? strcomma - str : strlen (str);
nl_error (0, 0, "%s: %s", gettext (error_msgid),
quotearg_n_style_mem (0, locale_quoting_style, str, slen));
usage (
1
);
}
}
if (exclusive)
value = entry->value;
else
value |= entry->value;
if (!strcomma)
break;
str = strcomma + 1;
}
return value;
}
| long parse_symbols(char *a1, _BYTE *a2, char a3, const char *a4)
{
char *i;
bool j;
size_t v6;
long v7;
char *v8;
long v9;
char *s;
unsigned int v14;
_BYTE *v15;
char *v16;
s = a1;
v14 = 0;
for ( i = strchr(a1, 44); ; i = strchr(v16 + 1, 44) )
{
v16 = i;
v15 = a2;
for ( j = operand_matches(s, a2, 44); !j || !*((_DWORD *)v15 + 3); j = operand_matches(s, v15, 44) )
{
if ( !*v15 )
{
if ( v16 )
v6 = v16 - s;
else
v6 = strlen(s);
v7 = quotearg_n_style_mem(0LL, 8LL, s, v6);
v8 = gettext(a4);
nl_error(0, 0, (long)"%s: %s", (long)v8, v7, v9);
usage(1);
}
v15 += 16;
}
if ( a3 )
v14 = *((_DWORD *)v15 + 3);
else
v14 |= *((_DWORD *)v15 + 3);
if ( !v16 )
break;
s = v16 + 1;
}
return v14;
}
|
void
clear_read_error_count (void)
{
read_error_count = 0;
}
| long long clear_read_error_count() {
unsigned long v1;
read_error_count = 0;
return v1;
}
|
Attrib *
do_lstat(struct sftp_conn *conn, const char *path, int quiet)
{
u_int id;
if (conn->version == 0) {
if (quiet)
sshlog("sftp-client.c", __func__, 927, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "Server version does not support lstat operation");
else
sshlog("sftp-client.c", __func__, 929, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Server version does not support lstat operation");
return(do_stat(conn, path, quiet));
}
id = conn->msg_id++;
send_string_request(conn, id, 7, path,
strlen(path));
return(get_decode_stat(conn, id, quiet));
}
| long long do_lstat(unsigned int a0[7], char *a1, unsigned long a2) {
unsigned int v0[7];
int tmp_14;
unsigned int v1;
unsigned long long v3;
*(&v0[0]) = a0;
if (a0[5]) {
tmp_14 = a0[6];
a0[6] = a0[6] + 1;
v1 = tmp_14;
send_string_request(a0, v1, 0x7, a1, strlen(a1));
v3 = get_decode_stat(a0, v1, a2);
} else {
if (!a2)
sshlog("sftp-client.c", "do_lstat", 0x3a1, 0x0, 0x3, 0x0, "Server version does not support lstat operation");
else
sshlog("sftp-client.c", "do_lstat", 0x39f, 0x0, 0x5, 0x0, "Server version does not support lstat operation");
v3 = do_stat(a0, a1, a2);
}
return v3;
}
|
int xfrm_sctx_parse(char *ctxstr, char *s,
struct xfrm_user_sec_ctx *sctx)
{
int slen;
slen = strlen(s) + 1;
sctx->exttype = XFRMA_SEC_CTX;
sctx->ctx_doi = 1;
sctx->ctx_alg = 1;
sctx->ctx_len = slen;
sctx->len = sizeof(struct xfrm_user_sec_ctx) + slen;
memcpy(ctxstr, s, slen);
return 0;
}
| void xfrm_sctx_parse(void* a0, void* a1, struct_0 *a2) {
unsigned int v0;
void* v2;
v0 = strlen(a1) + 1;
a2->field_2 = 8;
a2->field_5 = 1;
a2->field_4 = 1;
a2->field_6 = v0;
a2->field_0 = v0 + 8;
memcpy(a0, a1, v0);
v2 = 0;
return;
}
|
static
_Bool
out_mount_point (char const *filename, char *pformat, size_t prefix_len,
const struct stat *statp)
{
char const *np = "?", *bp =
((void *)0)
;
char *mp =
((void *)0)
;
_Bool
fail =
1
;
if (follow_links || !
((((
statp->st_mode
)) & 0170000) == (0120000))
)
{
char *resolved = canonicalize_file_name (filename);
if (!resolved)
{
error (0,
(*__errno_location ())
, gettext ("failed to canonicalize %s"), quotearg_style (shell_escape_always_quoting_style, filename));
goto print_mount_point;
}
bp = find_bind_mount (resolved);
free (resolved);
if (bp)
{
fail =
0
;
goto print_mount_point;
}
}
if ((mp = find_mount_point (filename, statp)))
{
bp = find_bind_mount (mp);
fail =
0
;
}
print_mount_point:
out_string (pformat, prefix_len, bp ? bp : mp ? mp : np);
free (mp);
return fail;
}
| int out_mount_point(char *a0, unsigned int a1, unsigned long a2, struct_0 *a3) {
char v0;
void* v1;
void* v2;
unsigned long long v3;
void* v4;
unsigned long long v6;
v3 = "?";
v1 = 0;
v2 = 0;
v0 = 1;
if (!(!follow_links) || !((a3->field_18 & 0xf000) == 0xa000)) {
v4 = canonicalize_file_name(a0);
if (!v4) {
v6 = quotearg_style(0x4, a0);
error(0x0, *(__errno_location()), gettext("failed to canonicalize %s"));
goto LABEL_4025f0;
} else {
v1 = find_bind_mount(v4);
free(v4);
if (v1) {
v0 = 0;
goto LABEL_4025f0;
}
}
}
v2 = find_mount_point(a0, a3, a3);
if (v2) {
v1 = find_bind_mount(v2);
v0 = 0;
}
LABEL_4025f0:
out_string(a1, a2, (!v1 ? v1 : (!v2 ? v2 : v3)));
free(v2);
return v0;
}
|
int BZ2_bzDecompressInit
( bz_stream* strm,
int verbosity,
int small )
{
DState* s;
if (!bz_config_ok()) return (-9);
if (strm ==
((void *)0)
) return (-2);
if (small != 0 && small != 1) return (-2);
if (verbosity < 0 || verbosity > 4) return (-2);
if (strm->bzalloc ==
((void *)0)
) strm->bzalloc = default_bzalloc;
if (strm->bzfree ==
((void *)0)
) strm->bzfree = default_bzfree;
s = (strm->bzalloc)(strm->opaque,(sizeof(DState)),1);
if (s ==
((void *)0)
) return (-3);
s->strm = strm;
strm->state = s;
s->state = 10;
s->bsLive = 0;
s->bsBuff = 0;
s->calculatedCombinedCRC = 0;
strm->total_in_lo32 = 0;
strm->total_in_hi32 = 0;
strm->total_out_lo32 = 0;
strm->total_out_hi32 = 0;
s->smallDecompress = (Bool)small;
s->ll4 =
((void *)0)
;
s->ll16 =
((void *)0)
;
s->tt =
((void *)0)
;
s->currBlockNo = 0;
s->verbosity = verbosity;
return 0;
}
| long BZ2_bzDecompressInit(long a1, unsigned int a2, unsigned int a3)
{
long v5;
if ( !(unsigned int)bz_config_ok() )
return 4294967287LL;
if ( !a1 )
return 4294967294LL;
if ( a3 >= 2 )
return 4294967294LL;
if ( a2 >= 5 )
return 4294967294LL;
if ( !*(_QWORD *)(a1 + 56) )
*(_QWORD *)(a1 + 56) = default_bzalloc;
if ( !*(_QWORD *)(a1 + 64) )
*(_QWORD *)(a1 + 64) = default_bzfree;
v5 = (*(long ( **)(_QWORD, long, long))(a1 + 56))(*(_QWORD *)(a1 + 72), 64144LL, 1LL);
if ( !v5 )
return 4294967293LL;
*(_QWORD *)v5 = a1;
*(_QWORD *)(a1 + 48) = v5;
*(_DWORD *)(v5 + 8) = 10;
*(_DWORD *)(v5 + 36) = 0;
*(_DWORD *)(v5 + 32) = 0;
*(_DWORD *)(v5 + 3188) = 0;
*(_DWORD *)(a1 + 12) = 0;
*(_DWORD *)(a1 + 16) = 0;
*(_DWORD *)(a1 + 36) = 0;
*(_DWORD *)(a1 + 40) = 0;
*(_BYTE *)(v5 + 44) = a3;
*(_QWORD *)(v5 + 3168) = 0LL;
*(_QWORD *)(v5 + 3160) = 0LL;
*(_QWORD *)(v5 + 3152) = 0LL;
*(_DWORD *)(v5 + 48) = 0;
*(_DWORD *)(v5 + 52) = a2;
return 0LL;
}
|
static int
getmonth (char const *month, char **ea)
{
size_t lo = 0;
size_t hi = 12;
while (blanks[to_uchar (*month)])
month++;
do
{
size_t ix = (lo + hi) / 2;
char const *m = month;
char const *n = monthtab[ix].name;
for (;; m++, n++)
{
if (!*n)
{
if (ea)
*ea = (char *) m;
return monthtab[ix].val;
}
if (to_uchar (fold_toupper[to_uchar (*m)]) < to_uchar (*n))
{
hi = ix;
break;
}
else if (to_uchar (fold_toupper[to_uchar (*m)]) > to_uchar (*n))
{
lo = ix + 1;
break;
}
}
}
while (lo < hi);
return 0;
}
| long getmonth(unsigned char *a1, unsigned char **a2)
{
unsigned char v3;
unsigned char v4;
unsigned char v5;
unsigned char v6;
unsigned long v8;
unsigned long v9;
unsigned char *v10;
unsigned char *i;
unsigned long v12;
v8 = 0LL;
v9 = 12LL;
while ( blanks[(unsigned char)to_uchar(*a1)] )
++a1;
while ( 2 )
{
v12 = (v8 + v9) >> 1;
v10 = a1;
for ( i = (unsigned char *)(&monthtab)[2 * v12]; ; ++i )
{
if ( !*i )
{
if ( a2 )
*a2 = v10;
return *((unsigned int *)&unk_DB08 + 4 * v12);
}
v3 = to_uchar(*v10);
v4 = to_uchar(fold_toupper[v3]);
if ( v4 < (unsigned char)to_uchar(*i) )
{
v9 = (v8 + v9) >> 1;
goto LABEL_14;
}
v5 = to_uchar(*v10);
v6 = to_uchar(fold_toupper[v5]);
if ( v6 > (unsigned char)to_uchar(*i) )
break;
++v10;
}
v8 = v12 + 1;
LABEL_14:
if ( v8 < v9 )
continue;
return 0LL;
}
}
|
static int
it_init_disabled (itp)
ITEMLIST *itp;
{
STRINGLIST *sl;
register int i, n;
sl = strlist_create (num_shell_builtins);
for (i = n = 0; i < num_shell_builtins; i++)
{
if (shell_builtins[i].function && ((shell_builtins[i].flags & 0x01) == 0))
sl->list[n++] = shell_builtins[i].name;
}
sl->list[sl->list_len = n] = (char *)
((void *)0)
;
itp->flags |= 0x020;
itp->slist = sl;
return 0;
}
| long long it_init_disabled(struct_0 *a0) {
struct_3 *v0;
int tmp_50;
int tmp_42;
void* v2;
void* v3;
v0 = strlist_create(num_shell_builtins);
v2 = 0;
for (v3 = 0; v3 < num_shell_builtins; v3 = v3 + 1) {
if (*((((v3 << 1) + v3 << 4) + shell_builtins + 8)) && !(*((((v3 << 1) + v3 << 4) + shell_builtins + 16)) & 1)) {
tmp_50 = v2;
v2 += 1;
v0->field_0[tmp_50].field_0 = *((shell_builtins + v3 * 48));
}
}
tmp_42 = v0->field_0;
v0->field_c = v2;
*((v0->field_c * 8 + tmp_42)) = 0;
a0->field_0 = a0->field_0 | 32;
a0->field_10 = v0;
return 0;
}
|
static int xfrm_state_keep(struct nlmsghdr *n, void *arg)
{
struct xfrm_buffer *xb = (struct xfrm_buffer *)arg;
struct rtnl_handle *rth = xb->rth;
struct xfrm_usersa_info *xsinfo = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
int len = n->nlmsg_len;
struct nlmsghdr *new_n;
struct xfrm_usersa_id *xsid;
struct rtattr *tb[(__XFRMA_MAX - 1)+1];
if (n->nlmsg_type != XFRM_MSG_NEWSA) {
fprintf(
stderr
, "Not a state: %08x %08x %08x\n",
n->nlmsg_len, n->nlmsg_type, n->nlmsg_flags);
return 0;
}
len -= ((sizeof(*xsinfo)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )));
if (len < 0) {
fprintf(
stderr
, "BUG: wrong nlmsg len %d\n", len);
return -1;
}
if (!xfrm_state_filter_match(xsinfo))
return 0;
if (xsinfo->id.proto ==
IPPROTO_IPIP
||
xsinfo->id.proto ==
IPPROTO_IPV6
)
return 0;
if (xb->offset > xb->size) {
fprintf(
stderr
, "State buffer overflow\n");
return -1;
}
new_n = (struct nlmsghdr *)(xb->buf + xb->offset);
new_n->nlmsg_len = ((sizeof(*xsid)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )));
new_n->nlmsg_flags = 0x01;
new_n->nlmsg_type = XFRM_MSG_DELSA;
new_n->nlmsg_seq = ++rth->seq;
xsid = ((void *)(((char *)new_n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
xsid->family = xsinfo->family;
memcpy(&xsid->daddr, &xsinfo->id.daddr, sizeof(xsid->daddr));
xsid->spi = xsinfo->id.spi;
xsid->proto = xsinfo->id.proto;
addattr_l(new_n, xb->size, XFRMA_SRCADDR, &xsinfo->saddr,
sizeof(xsid->daddr));
parse_rtattr(tb, (__XFRMA_MAX - 1), ((struct rtattr*)(((char*)(xsinfo)) + ( ((sizeof(struct xfrm_usersa_info))+4U -1) & ~(4U -1) ))), len);
if (tb[XFRMA_MARK]) {
int r = addattr_l(new_n, xb->size, XFRMA_MARK,
(void *)((void*)(((char*)(tb[XFRMA_MARK])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), tb[XFRMA_MARK]->rta_len);
if (r < 0) {
fprintf(
stderr
, "%s: XFRMA_MARK failed\n", __func__);
exit(1);
}
}
xb->offset += new_n->nlmsg_len;
xb->nlmsg_count++;
return 0;
}
| long xfrm_state_keep(unsigned int *a1, long a2)
{
unsigned int v3;
long v4;
long v5;
char v6[168];
unsigned short *v7;
unsigned long v8;
v8 = __readfsqword(0x28u);
v4 = *(_QWORD *)(a2 + 24);
if ( *((_WORD *)a1 + 2) == 16 )
{
v3 = *a1 - 240;
if ( (v3 & 0x80000000) == 0 )
{
if ( xfrm_state_filter_match((long)(a1 + 4)) )
{
if ( *((_BYTE *)a1 + 92) == 4 || *((_BYTE *)a1 + 92) == 41 )
{
return 0LL;
}
else if ( *(_DWORD *)(a2 + 12) <= *(_DWORD *)(a2 + 8) )
{
v5 = *(_QWORD *)a2 + *(int *)(a2 + 12);
*(_DWORD *)v5 = 40;
*(_WORD *)(v5 + 6) = 1;
*(_WORD *)(v5 + 4) = 17;
*(_DWORD *)(v5 + 8) = ++*(_DWORD *)(v4 + 28);
*(_WORD *)(v5 + 36) = *((_WORD *)a1 + 114);
memcpy((void *)(v5 + 16), a1 + 18, 0x14uLL);
*(_BYTE *)(v5 + 38) = *((_BYTE *)a1 + 92);
addattr_l(v5, *(unsigned int *)(a2 + 8), 13LL, a1 + 24, 16LL);
parse_rtattr(v6, 32LL, a1 + 60, v3);
if ( v7 )
{
if ( (int)addattr_l(v5, *(unsigned int *)(a2 + 8), 21LL, v7 + 2, *v7) < 0 )
{
fprintf(stderr, "%s: XFRMA_MARK failed\n", "xfrm_state_keep");
exit(1);
}
}
*(_DWORD *)(a2 + 12) += *(_DWORD *)v5;
++*(_DWORD *)(a2 + 16);
return 0LL;
}
else
{
fprintf(stderr, "State buffer overflow\n");
return 0xFFFFFFFFLL;
}
}
else
{
return 0LL;
}
}
else
{
fprintf(stderr, "BUG: wrong nlmsg len %d\n", v3);
return 0xFFFFFFFFLL;
}
}
else
{
fprintf(stderr, "Not a state: %08x %08x %08x\n", *a1, *((unsigned short *)a1 + 2), *((unsigned short *)a1 + 3));
return 0LL;
}
}
|
static struct directory *
find_directory_meta (dev_t dev, ino_t ino)
{
if (! directory_meta_table)
return 0;
else
{
struct directory *dir = make_directory ("",
((void *)0)
);
struct directory *ret;
dir->device_number = dev;
dir->inode_number = ino;
ret = hash_lookup (directory_meta_table, dir);
free_directory (dir);
return ret;
}
}
| int find_directory_meta(unsigned long a0, unsigned long a1) {
unsigned long long v0[5];
unsigned long v1;
unsigned int v3;
if (!directory_meta_table) {
v3 = 0;
return v3;
}
v0[0] = make_directory(&g_404c14, 0x0);
v0[3] = a0;
v0[4] = a1;
v1 = hash_lookup(directory_meta_table, v0, v0);
free_directory(v0);
v3 = v1;
return v3;
}
|
_Bool
pred_links (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
(void) pathname;
switch (pred_ptr->args.numinfo.kind)
{
case COMP_GT:
if (stat_buf->st_nlink > pred_ptr->args.numinfo.l_val)
return (
1
);
break;
case COMP_LT:
if (stat_buf->st_nlink < pred_ptr->args.numinfo.l_val)
return (
1
);
break;
case COMP_EQ:
if (stat_buf->st_nlink == pred_ptr->args.numinfo.l_val)
return (
1
);
break;
}
return (
0
);
}
| long long pred_links(unsigned long a0, struct_1 *a1, struct_0 *a2) {
unsigned long v0;
unsigned long long v2;
v0 = a0;
switch (a2->field_38) {
case 2:
if (a1->field_10 != a2->field_40) {
v2 = 0;
return v2;
}
v2 = 1;
return v2;
case 0:
if (a1->field_10 <= a2->field_40) {
v2 = 0;
return v2;
}
v2 = 1;
return v2;
case 1:
if (a1->field_10 >= a2->field_40) {
v2 = 0;
return v2;
}
v2 = 1;
return v2;
default:
v2 = 0;
return v2;
}
}
|
static
_Bool
check_rename(struct file *src, struct file *dst)
{
file_stat(src);
if (src->stat_state == FILE_STAT_NOFILE)
return
0
;
file_stat(dst);
check_writable_dir(src);
check_writable_dir(dst);
if (src->stat_state == FILE_STAT_VALID &&
dst->stat_state == FILE_STAT_VALID &&
!(src->stat.st_dev == dst->stat.st_dev &&
src->stat.st_ino == dst->stat.st_ino))
ohshit(gettext("rename involves overwriting '%s' with\n" " different file '%s', not allowed")
,
dst->name, src->name);
return
1
;
}
| undefined8 check_rename(undefined8 *param_1,undefined8 *param_2)
{
undefined8 uVar1;
undefined8 uVar2;
undefined8 uVar3;
file_stat(param_1);
if (*(int *)(param_1 + 1) == 2) {
uVar2 = 0;
}
else {
file_stat(param_2);
check_writable_dir(param_1);
check_writable_dir(param_2);
if (((*(int *)(param_1 + 1) == 1) && (*(int *)(param_2 + 1) == 1)) &&
((param_1[2] != param_2[2] || (param_1[3] != param_2[3])))) {
uVar2 = *param_1;
uVar1 = *param_2;
uVar3 = gettext(
"rename involves overwriting \'%s\' with\n different file \'%s\', not allowed"
);
ohshit(uVar3,uVar1,uVar2);
}
uVar2 = 1;
}
return uVar2;
}
|
static int
ssh_packet_start_discard(struct ssh *ssh, struct sshenc *enc,
struct sshmac *mac, size_t mac_already, u_int discard)
{
struct session_state *state = ssh->state;
int r;
if (enc ==
((void *)0)
|| !cipher_is_cbc(enc->cipher) || (mac && mac->etm)) {
if ((r = sshpkt_disconnect(ssh, "Packet corrupt")) != 0)
return r;
return -30;
}
if (mac && mac->enabled) {
state->packet_discard_mac = mac;
state->packet_discard_mac_already = mac_already;
}
if (sshbuf_len(state->input) >= discard)
return ssh_packet_stop_discard(ssh);
state->packet_discard = discard - sshbuf_len(state->input);
return 0;
}
| void ssh_packet_start_discard(unsigned long long *a0, struct_0 *a1, unsigned int a2[9], unsigned long a3, unsigned long a4) {
unsigned int v0;
struct_1 *v1;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v7;
void* v8;
v1 = *(a0);
if (a1) {
v3 = cipher_is_cbc(a1->field_8);
if (v3 && (!a2 || !a2[8])) {
if (a2 && a2[2]) {
v1->field_1d0 = a2;
v1->field_1c8 = a3;
}
if (sshbuf_len(v1->field_20) >= a4) {
v7 = ssh_packet_stop_discard(a0);
} else {
v1->field_1c4 = a4 - sshbuf_len(v1->field_20);
v8 = 0;
}
}
}
if (!v3 || !a1 || a2 && a2[8]) {
v0 = sshpkt_disconnect();
if (v0)
v5 = v0;
else
v4 = 4294967266;
}
return;
}
|
static SHELL_VAR *
assign_comp_wordbreaks (self, value, unused, key)
SHELL_VAR *self;
char *value;
arrayind_t unused;
char *key;
{
if (rl_completer_word_break_characters &&
rl_completer_word_break_characters != rl_basic_word_break_characters)
sh_xfree(((void *)rl_completer_word_break_characters), "variables.c", 1641);
rl_completer_word_break_characters = (char *)strcpy (sh_xmalloc((1 + strlen (value)), "variables.c", 1643), (value));
return self;
}
| long long assign_comp_wordbreaks(unsigned long a0, char *a1, unsigned long a2, unsigned long a3) {
unsigned long v0;
unsigned long v1;
v1 = a2;
v0 = a3;
if (rl_completer_word_break_characters && rl_completer_word_break_characters != rl_basic_word_break_characters)
sh_xfree(rl_completer_word_break_characters, "variables.c", 0x669);
rl_completer_word_break_characters = strcpy(sh_xmalloc(strlen(a1) + 1, "variables.c", 0x66b), a1);
return a0;
}
|
static void finish_processing_inode(e2fsck_t ctx, ext2_ino_t ino,
struct problem_context *pctx,
int failed_csum)
{
if (!failed_csum)
return;
pctx->errcode = recheck_bad_inode_checksum(ctx->fs, ino, ctx, pctx);
if (pctx->errcode)
ctx->flags |= 0x0001;
}
| void finish_processing_inode(struct_0 *a0, unsigned long a1, unsigned long long *a2, unsigned long a3) {
unsigned long long v1;
struct_0 *v2;
if (a3) {
*(a2) = recheck_bad_inode_checksum(a0->field_0, a1, a0, a2);
v1 = *(a2);
if (*(a2)) {
v2 = a0;
a0->field_48 = a0->field_48 | 1;
}
}
return;
}
|
static void print_bag_data(gnutls_pkcs12_bag_t bag, int outtext)
{
int result;
int count, i, type;
gnutls_datum_t cdata, id;
const char *str, *name;
gnutls_datum_t out;
count = gnutls_pkcs12_bag_get_count(bag);
if (count < 0) {
fprintf(
stderr
, "get_count: %s\n", gnutls_strerror(count));
app_exit(1);
}
if (outtext)
fprintf(outfile, "\tElements: %d\n", count);
for (i = 0; i < count; i++) {
type = gnutls_pkcs12_bag_get_type(bag, i);
if (type < 0) {
fprintf(
stderr
, "get_type: %s\n",
gnutls_strerror(type));
app_exit(1);
}
if (outtext)
fprintf(outfile, "\tType: %s\n", BAGTYPE(type));
result = gnutls_pkcs12_bag_get_data(bag, i, &cdata);
if (result < 0) {
fprintf(
stderr
, "get_data: %s\n",
gnutls_strerror(result));
app_exit(1);
}
if (type == GNUTLS_BAG_PKCS8_ENCRYPTED_KEY &&
outtext)
pkcs8_info_int(&cdata, GNUTLS_X509_FMT_DER, 1, outfile, "\t");
name =
((void *)0)
;
result =
gnutls_pkcs12_bag_get_friendly_name(bag, i,
(char **) &name);
if (result < 0) {
fprintf(
stderr
, "get_friendly_name: %s\n",
gnutls_strerror(result));
app_exit(1);
}
if (name && outtext)
fprintf(outfile, "\tFriendly name: %s\n", name);
id.data =
((void *)0)
;
id.size = 0;
result = gnutls_pkcs12_bag_get_key_id(bag, i, &id);
if (result < 0) {
fprintf(
stderr
, "get_key_id: %s\n",
gnutls_strerror(result));
app_exit(1);
}
if (id.size > 0 && outtext)
fprintf(outfile, "\tKey ID: %s\n",
raw_to_string(id.data, id.size));
switch (type) {
case GNUTLS_BAG_PKCS8_ENCRYPTED_KEY:
str = "ENCRYPTED PRIVATE KEY";
break;
case GNUTLS_BAG_PKCS8_KEY:
str = "PRIVATE KEY";
break;
case GNUTLS_BAG_CERTIFICATE:
str = "CERTIFICATE";
break;
case GNUTLS_BAG_CRL:
str = "CRL";
break;
case GNUTLS_BAG_ENCRYPTED:
case GNUTLS_BAG_EMPTY:
default:
str =
((void *)0)
;
}
if (str !=
((void *)0)
) {
result = gnutls_pem_base64_encode2(str, &cdata, &out);
if (result < 0) {
fprintf(
stderr
, "Error in base64 encoding: %s\n", gnutls_strerror(result));
app_exit(1);
}
fprintf(outfile, "%s", out.data);
gnutls_free((void *) (out.data)), out.data=
((void *)0)
;
}
}
}
| void print_bag_data(undefined8 param_1,int param_2)
{
uint uVar1;
int iVar2;
int iVar3;
undefined8 uVar4;
long in_FS_OFFSET;
int local_68;
long local_58;
char *local_50;
undefined local_48 [16];
undefined8 local_38;
int local_30;
undefined8 local_28 [3];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
uVar1 = gnutls_pkcs12_bag_get_count(param_1);
if ((int)uVar1 < 0) {
uVar4 = gnutls_strerror(uVar1);
fprintf(stderr,"get_count: %s\n",uVar4);
app_exit(1);
}
if (param_2 != 0) {
fprintf(outfile,"\tElements: %d\n",(ulong)uVar1);
}
local_68 = 0;
do {
if ((int)uVar1 <= local_68) {
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
__stack_chk_fail();
}
iVar2 = gnutls_pkcs12_bag_get_type(param_1,local_68);
if (iVar2 < 0) {
uVar4 = gnutls_strerror(iVar2);
fprintf(stderr,"get_type: %s\n",uVar4);
app_exit(1);
}
if (param_2 != 0) {
uVar4 = BAGTYPE(iVar2);
fprintf(outfile,"\tType: %s\n",uVar4);
}
iVar3 = gnutls_pkcs12_bag_get_data(param_1,local_68,local_48);
if (iVar3 < 0) {
uVar4 = gnutls_strerror(iVar3);
fprintf(stderr,"get_data: %s\n",uVar4);
app_exit(1);
}
if ((iVar2 == 1) && (param_2 != 0)) {
pkcs8_info_int(local_48,0,1,outfile,&DAT_0010bef5);
}
local_58 = 0;
iVar3 = gnutls_pkcs12_bag_get_friendly_name(param_1,local_68,&local_58);
if (iVar3 < 0) {
uVar4 = gnutls_strerror(iVar3);
fprintf(stderr,"get_friendly_name: %s\n",uVar4);
app_exit(1);
}
if ((local_58 != 0) && (param_2 != 0)) {
fprintf(outfile,"\tFriendly name: %s\n",local_58);
}
local_38 = 0;
local_30 = 0;
iVar3 = gnutls_pkcs12_bag_get_key_id(param_1,local_68,&local_38);
if (iVar3 < 0) {
uVar4 = gnutls_strerror(iVar3);
fprintf(stderr,"get_key_id: %s\n",uVar4);
app_exit(1);
}
if ((local_30 != 0) && (param_2 != 0)) {
uVar4 = raw_to_string(local_38,local_30);
fprintf(outfile,"\tKey ID: %s\n",uVar4);
}
if (iVar2 == 4) {
local_50 = "CRL";
}
else if (iVar2 < 5) {
if (iVar2 == 3) {
local_50 = "CERTIFICATE";
}
else {
if (3 < iVar2) goto LAB_001088a8;
if (iVar2 == 1) {
local_50 = "ENCRYPTED PRIVATE KEY";
}
else {
if (iVar2 != 2) goto LAB_001088a8;
local_50 = "PRIVATE KEY";
}
}
}
else {
LAB_001088a8:
local_50 = (char *)0x0;
}
if (local_50 != (char *)0x0) {
iVar2 = gnutls_pem_base64_encode2(local_50,local_48,local_28);
if (iVar2 < 0) {
uVar4 = gnutls_strerror(iVar2);
fprintf(stderr,"Error in base64 encoding: %s\n",uVar4);
app_exit(1);
}
fprintf(outfile,"%s",local_28[0]);
(*gnutls_free)(local_28[0]);
local_28[0] = 0;
}
local_68 = local_68 + 1;
} while( true );
}
|
static float
constrain_rate (float rate)
{
if (rate > 1.0f)
return 1.0;
else if (rate < 0.0)
return 0.0;
else
return rate;
}
| void constrain_rate() {
return;
}
|
static void
compile_regex (struct regex_data *regex)
{
struct re_pattern_buffer *pattern = ®ex->pattern;
char const *string = regex->string;
char const *message;
pattern->buffer =
((void *)0)
;
pattern->allocated = 0;
pattern->fastmap = regex->fastmap;
pattern->translate = ignore_case ? folded_chars :
((void *)0)
;
message = re_compile_pattern (string, strlen (string), pattern);
if (message)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"%s (for regexp %s)\"), message, quote (string)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("%s (for regexp %s)"), message, quote (string)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("%s (for regexp %s)"), message, quote (string)), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
re_compile_fastmap (pattern);
}
| void compile_regex(unsigned long long *a0) {
unsigned long long v0[6];
char *v1;
unsigned long v2;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
v0[0] = a0 + 1;
v1 = *(a0);
v0[0] = 0;
v0[1] = 0;
v0[4] = a0 + 9;
if (ignore_case)
v4 = &folded_chars;
else
v4 = 0;
v0[5] = v4;
v5 = strlen(v1);
v2 = re_compile_pattern(v1, v5, v0, v5);
if (!v2) {
v6 = re_compile_fastmap(v0);
return;
}
v7 = quote(v1);
error(0x1, 0x0, gettext("%s (for regexp %s)"));
}
|
static void
printentry(struct tblentry *cmdp)
{
int idx;
const char *path;
char *name;
idx = cmdp->param.index;
path = ((&(&(&varinit[0])[1])[1])[1].text + 5);
do {
padvance(&path, cmdp->cmdname);
} while (--idx >= 0);
name = ((void *)stacknxt);
outstr((name), out1);
out1fmt(snlfmt, cmdp->rehash ? "*" : nullstr);
}
| void printentry(struct_0 *a0) {
unsigned int v0;
unsigned long v1;
unsigned long long v2;
char v3;
unsigned long long v5;
unsigned long long *v6;
unsigned long long v7;
v0 = a0->field_8;
v1 = onint + 5;
do {
padvance(&v1, a0 + 1);
v0 -= 1;
} while (v0 >= 0);
v2 = stacknxt;
outstr(v2, out1, out1);
if (a0->field_12)
v5 = "*";
else
v5 = &nullstr;
out1fmt(0x5000b8, v5);
v7 = *(&v3) ^ v6[5];
return;
}
|
static int __ipstats_show_hw_stats(const struct rtattr *at_hwsi,
const struct rtattr *at_stats,
enum ipstats_hw_s_info_idx idx)
{
int err = 0;
if (at_hwsi !=
((void *)0)
) {
struct ipstats_hw_s_info hwsi = {};
err = ipstats_dissect_hw_s_info(at_hwsi, &hwsi);
if (err)
return err;
open_json_object("info");
__ipstats_show_hw_s_info_one(hwsi.infos[idx]);
close_json_object();
ipstats_fini_hw_s_info(&hwsi);
}
if (at_stats !=
((void *)0)
) {
print_nl();
open_json_object("stats64");
err = ipstats_show_hw64(at_stats);
close_json_object();
}
return err;
}
| void __ipstats_show_hw_stats(unsigned short *a0, unsigned short *a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
void* v1;
unsigned long long v3;
unsigned long long v4;
v0 = 0;
if (a0) {
v1 = 0;
v0 = ipstats_dissect_hw_s_info(a0, &v1);
if (v0) {
v3 = v0;
return;
}
open_json_object("info");
__ipstats_show_hw_s_info_one((&v1)[a2]);
close_json_object(a0, &v1, a2, a3, a4, a5);
ipstats_fini_hw_s_info(&v1);
}
if (a1) {
print_nl();
open_json_object("stats64");
v0 = ipstats_show_hw64(a1, &v1, a2, a3, a4, a5);
close_json_object(a0, &v1, a2, a3, a4, a5);
}
v4 = v0;
return;
}
|
int
unset_nonblock(int fd)
{
int val;
val = fcntl(fd,
3
);
if (val == -1) {
sshlog("misc.c", __func__, 135, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "fcntl(%d, F_GETFL): %s", fd, strerror(
(*__errno_location ())
));
return (-1);
}
if (!(val &
04000
)) {
sshlog("misc.c", __func__, 139, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "fd %d is not O_NONBLOCK", fd);
return (0);
}
sshlog("misc.c", __func__, 142, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "fd %d clearing O_NONBLOCK", fd);
val &= ~
04000
;
if (fcntl(fd,
4
, val) == -1) {
sshlog("misc.c", __func__, 145, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "fcntl(%d, F_SETFL, ~O_NONBLOCK): %s", fd, strerror(
(*__errno_location ())
))
;
return (-1);
}
return (0);
}
| long unset_nonblock(int a1)
{
int *v1;
char *v2;
int *v4;
char *v5;
int v6;
v6 = fcntl(a1, 3);
if ( v6 == -1 )
{
v1 = _errno_location();
v2 = strerror(*v1);
sshlog("misc.c", "unset_nonblock", 135LL, 0LL, 2LL, 0LL, "fcntl(%d, F_GETFL): %s", (unsigned int)a1, v2);
return 0xFFFFFFFFLL;
}
else if ( (v6 & 0x800) != 0 )
{
sshlog("misc.c", "unset_nonblock", 142LL, 0LL, 5LL, 0LL, "fd %d clearing O_NONBLOCK", (unsigned int)a1);
if ( fcntl(a1, 4, v6 & 0xFFFFF7FF) == -1 )
{
v4 = _errno_location();
v5 = strerror(*v4);
sshlog(
"misc.c",
"unset_nonblock",
145LL,
0LL,
5LL,
0LL,
"fcntl(%d, F_SETFL, ~O_NONBLOCK): %s",
(unsigned int)a1,
v5);
return 0xFFFFFFFFLL;
}
else
{
return 0LL;
}
}
else
{
sshlog("misc.c", "unset_nonblock", 139LL, 0LL, 7LL, 0LL, "fd %d is not O_NONBLOCK", (unsigned int)a1);
return 0LL;
}
}
|
int
end_handler (self, defs, arg)
char *self;
DEF_FILE *defs;
char *arg;
{
must_be_building (self, defs);
building_builtin = 0;
return (0);
}
| long long end_handler(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3) {
unsigned long v0;
v0 = a2;
must_be_building(a0, a1, a1, a3);
building_builtin = 0;
return 0;
}
|
static unsigned char
rl_bind_wrapper(EditLine *el __attribute__((__unused__)), unsigned char c)
{
if (map[c] ==
((void *)0)
)
return 6;
_rl_update_pos();
(*map[c])(1, c);
if (rl_done)
return 2;
return 0;
}
| long rl_bind_wrapper(long a1, unsigned char a2)
{
if ( !map[a2] )
return 6LL;
rl_update_pos();
map[a2](1LL, a2);
if ( rl_done )
return 2LL;
else
return 0LL;
}
|
static void index_write(const struct index_node *node, FILE *out)
{
long initial_offset, final_offset;
uint32_t u;
u = htonl(0xB007F457);
fwrite(&u, sizeof(u), 1, out);
u = htonl(((0x0002<<16)|0x0001));
fwrite(&u, sizeof(u), 1, out);
initial_offset = ftell(out);
((void) sizeof ((
initial_offset >= 0
) ? 1 : 0), __extension__ ({ if (
initial_offset >= 0
) ; else __assert_fail (
"initial_offset >= 0"
, "tools/depmod.c", 417, __extension__ __PRETTY_FUNCTION__); }))
;
u = 0;
fwrite(&u, sizeof(uint32_t), 1, out);
u = htonl(index_write__node(node, out));
final_offset = ftell(out);
((void) sizeof ((
final_offset >= 0
) ? 1 : 0), __extension__ ({ if (
final_offset >= 0
) ; else __assert_fail (
"final_offset >= 0"
, "tools/depmod.c", 426, __extension__ __PRETTY_FUNCTION__); }))
;
(void)fseek(out, initial_offset,
0
);
fwrite(&u, sizeof(uint32_t), 1, out);
(void)fseek(out, final_offset,
0
);
}
| void index_write(void* a0, void* a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
char v3;
unsigned long long *v5;
unsigned long long v6;
v0 = htonl(0xb007f457);
fwrite(&v0, 0x4, 0x1, a1);
v0 = htonl(0x20001);
fwrite(&v0, 0x4, 0x1, a1);
*(&v1) = ftell(a1);
if ((*(&v1) - 0 >> 63))
__assert_fail();
v0 = 0;
fwrite(&v0, 0x4, 0x1, a1);
v0 = htonl(index_write__node(a0, a1));
*(&v2) = ftell(a1);
if ((*(&v2) - 0 >> 63))
__assert_fail();
fseek(a1, *(&v1), 0x0);
fwrite(&v0, 0x4, 0x1, a1);
fseek(a1, *(&v2), 0x0);
v6 = *(&v3) ^ v5[5];
return;
}
|
static inline const char *rta_getattr_str(const struct rtattr *rta)
{
return (const char *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| long rta_getattr_str(long a1)
{
return a1 + 4;
}
|
static
_Bool
wc_file (char const *file, struct fstatus *fstatus)
{
if (! file || (strcmp (file, "-") == 0))
{
have_read_stdin =
1
;
xset_binary_mode (
0
,
0
);
return wc (
0
, file, fstatus, -1);
}
else
{
int fd = open (file,
00
|
0
);
if (fd == -1)
{
error (0,
(*__errno_location ())
, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, file));
return
0
;
}
else
{
_Bool
ok = wc (fd, file, fstatus, 0);
if (close (fd) != 0)
{
error (0,
(*__errno_location ())
, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, file));
return
0
;
}
return ok;
}
}
}
| int wc_file(char *a0, unsigned long a1, unsigned long long a2) {
unsigned long v0;
char v1;
unsigned int v2;
unsigned long long v4;
unsigned int v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
v0 = a1;
if (!a0) {
LABEL_4018eb:
have_read_stdin = 1;
xset_binary_mode(0x0, 0x0);
v5 = wc(0, 0, a2, v4);
} else {
if (!strcmp(a0, "-"))
goto LABEL_4018eb;
v2 = open(a0, 0x0, a2);
if (v2 == -1) {
v7 = quotearg_n_style_colon(0x0, 0x3, a0);
error(0x0, *(__errno_location()), "%s");
v5 = 0;
} else {
v1 = wc(a0, 0, a2, v6);
if (!close(v2)) {
v5 = v1;
} else {
v8 = quotearg_n_style_colon(0x0, 0x3, a0);
error(0x0, *(__errno_location()), "%s");
v5 = 0;
}
}
}
return v5;
}
|
int
rl_forward_char (int count, int key)
{
int point;
if (
(__ctype_get_mb_cur_max ())
== 1 || rl_byte_oriented)
return (rl_forward_byte (count, key));
if (count < 0)
return (rl_backward_char (-count, key));
if (count > 0)
{
if (rl_point == rl_end && (rl_editing_mode == 1))
{
rl_ding ();
return 0;
}
point = _rl_forward_char_internal (count);
if (rl_point == point)
rl_ding ();
rl_point = point;
}
return 0;
}
| undefined8 rl_forward_char(int param_1,undefined4 param_2)
{
int iVar1;
size_t sVar2;
undefined8 uVar3;
sVar2 = __ctype_get_mb_cur_max();
if ((sVar2 == 1) || (rl_byte_oriented != 0)) {
uVar3 = rl_forward_byte(param_1,param_2);
}
else if (param_1 < 0) {
uVar3 = rl_backward_char(-param_1,param_2);
}
else {
iVar1 = rl_point;
if (0 < param_1) {
if ((rl_point == rl_end) && (rl_editing_mode == 1)) {
rl_ding();
return 0;
}
iVar1 = _rl_forward_char_internal(param_1);
if (iVar1 == rl_point) {
rl_ding();
}
}
rl_point = iVar1;
uVar3 = 0;
}
return uVar3;
}
|
static void
spawn_shell(const char *confold, const char *confnew)
{
pid_t pid;
fputs(gettext("Useful environment variables:\n"),
stderr
);
fputs(" - DPKG_SHELL_REASON\n",
stderr
);
fputs(" - DPKG_CONFFILE_OLD\n",
stderr
);
fputs(" - DPKG_CONFFILE_NEW\n",
stderr
);
fputs(gettext("Type 'exit' when you're done.\n"),
stderr
);
pid = subproc_fork();
if (!pid) {
setenv("DPKG_SHELL_REASON", "conffile-prompt", 1);
setenv("DPKG_CONFFILE_OLD", confold, 1);
setenv("DPKG_CONFFILE_NEW", confnew, 1);
command_shell(
((void *)0)
, gettext("conffile shell"));
}
subproc_reap(pid, gettext("conffile shell"), SUBPROC_NOCHECK);
}
| long spawn_shell(const char *a1, const char *a2)
{
FILE *v2;
char *v3;
FILE *v4;
char *v5;
char *v6;
char *v7;
unsigned int v11;
v2 = stderr;
v3 = gettext("Useful environment variables:\n");
fputs(v3, v2);
fputs(" - DPKG_SHELL_REASON\n", stderr);
fputs(" - DPKG_CONFFILE_OLD\n", stderr);
fputs(" - DPKG_CONFFILE_NEW\n", stderr);
v4 = stderr;
v5 = gettext("Type 'exit' when you're done.\n");
fputs(v5, v4);
v11 = subproc_fork();
if ( !v11 )
{
setenv("DPKG_SHELL_REASON", "conffile-prompt", 1);
setenv("DPKG_CONFFILE_OLD", a1, 1);
setenv("DPKG_CONFFILE_NEW", a2, 1);
v6 = gettext("conffile shell");
command_shell(0LL, v6);
}
v7 = gettext("conffile shell");
return subproc_reap(v11, v7, 4LL);
}
|
static int
get_win_size (int fd, struct winsize *win)
{
int err = ioctl (fd,
0x5413
, (char *) win);
return err;
}
| int get_win_size(unsigned long a0, unsigned long a1) {
unsigned long v0;
unsigned int v1;
v0 = a1;
v1 = ioctl(a0, 0x5413);
return v1;
}
|
static int jread(struct buffer_head **bhp, journal_t *journal,
unsigned int offset)
{
int err;
unsigned long long blocknr;
struct buffer_head *bh;
*bhp =
((void *)0)
;
if (offset >= journal->j_total_len) {
printf("" "JBD2: corrupted journal superblock\n");
return -(2133571502L);
}
err = jbd2_journal_bmap(journal, offset, &blocknr);
if (err) {
printf("" "JBD2: bad block at offset %u\n",
offset);
return err;
}
bh = getblk(journal->j_dev, blocknr, journal->j_blocksize);
if (!bh)
return -
12
;
if (!buffer_uptodate(bh)) {
if (!1)
do {} while (0);
wait_on_buffer(bh);
}
if (!buffer_uptodate(bh)) {
printf("" "JBD2: Failed to read block at offset %u\n",
offset);
brelse(bh);
return -
5
;
}
*bhp = bh;
return 0;
}
| int jread(unsigned long long *a0, struct_0 *a1, unsigned long a2) {
unsigned int v0;
char v1;
unsigned long long v2;
unsigned int v4;
*(a0) = 0;
if (a2 >= a1->field_80) {
printf("JBD2: corrupted journal superblock\n");
v4 = 2161395794;
} else {
v0 = jbd2_journal_bmap(a1, a2, &v1, a2);
if (v0) {
printf("JBD2: bad block at offset %u\n", a2);
v4 = v0;
} else {
v2 = getblk(a1->field_68, *(&v1), a1->field_78, *(&v1));
if (!v2) {
v4 = -12;
} else {
if (!buffer_uptodate(v2))
wait_on_buffer(v2);
if (buffer_uptodate(v2)) {
*(a0) = v2;
v4 = 0;
} else {
printf("JBD2: Failed to read block at offset %u\n", a2);
brelse(v2);
v4 = -5;
}
}
}
}
return v4;
}
|
int check_command(gnutls_session_t session, const char *str, unsigned no_cli_cert)
{
size_t len = strnlen(str, 128);
int ret;
fprintf(
stderr
, "*** Processing %u bytes command: %s\n", (unsigned)len,
str);
if (len > 2 && str[0] == str[1] && str[0] == '*') {
if (strncmp
(str, "**REHANDSHAKE**",
sizeof("**REHANDSHAKE**") - 1) == 0) {
fprintf(
stderr
,
"*** Sending rehandshake request\n");
gnutls_rehandshake(session);
return 1;
} else if (strncmp
(str, "**REAUTH**",
sizeof("**REAUTH**") - 1) == 0) {
if (no_cli_cert)
gnutls_certificate_server_set_request(session, GNUTLS_CERT_REQUIRE);
fprintf(
stderr
,
"*** Sending re-auth request\n");
do {
ret = gnutls_reauth(session, 0);
} while(ret == -28 || ret == -52);
if (ret < 0) {
fprintf(
stderr
, "reauth: %s\n",
gnutls_strerror(ret));
return ret;
}
return 1;
} else
if (strncmp
(str, "**HEARTBEAT**",
sizeof("**HEARTBEAT**") - 1) == 0) {
ret =
gnutls_heartbeat_ping(session, 300, 5,
1);
if (ret < 0) {
if (ret == -50) {
fprintf(
stderr
,
"No heartbeat in this session\n");
} else {
fprintf(
stderr
, "ping: %s\n",
gnutls_strerror(ret));
return ret;
}
}
return 2;
}
}
return 0;
}
| int check_command(undefined8 param_1,char *param_2,int param_3)
{
int iVar1;
size_t sVar2;
undefined8 uVar3;
sVar2 = strnlen(param_2,0x80);
fprintf(stderr,"*** Processing %u bytes command: %s\n",sVar2 & 0xffffffff,param_2);
if (((2 < sVar2) && (*param_2 == param_2[1])) && (*param_2 == '*')) {
iVar1 = strncmp(param_2,"**REHANDSHAKE**",0xf);
if (iVar1 == 0) {
fprintf(stderr,"*** Sending rehandshake request\n");
gnutls_rehandshake(param_1);
return 1;
}
iVar1 = strncmp(param_2,"**REAUTH**",10);
if (iVar1 == 0) {
if (param_3 != 0) {
gnutls_certificate_server_set_request(param_1,2);
}
fprintf(stderr,"*** Sending re-auth request\n");
do {
do {
iVar1 = gnutls_reauth(param_1,0);
} while (iVar1 == -0x1c);
} while (iVar1 == -0x34);
if (iVar1 < 0) {
uVar3 = gnutls_strerror(iVar1);
fprintf(stderr,"reauth: %s\n",uVar3);
return iVar1;
}
return 1;
}
iVar1 = strncmp(param_2,"**HEARTBEAT**",0xd);
if (iVar1 == 0) {
iVar1 = gnutls_heartbeat_ping(param_1,300,5,1);
if (iVar1 < 0) {
if (iVar1 != -0x32) {
uVar3 = gnutls_strerror(iVar1);
fprintf(stderr,"ping: %s\n",uVar3);
return iVar1;
}
fprintf(stderr,"No heartbeat in this session\n");
}
return 2;
}
}
return 0;
}
|
static int
do_lstat (char const *name, struct stat *st)
{
return do_statx (
-100
, name, st,
0x100
, calc_req_mask ());
}
| void do_lstat(undefined8 param_1,undefined8 param_2)
{
undefined4 uVar1;
uVar1 = calc_req_mask();
do_statx(0xffffff9c,param_1,param_2,0x100,uVar1);
return;
}
|
static void gz_reset(state)
gz_statep state;
{
state->x.have = 0;
if (state->mode == 7247) {
state->eof = 0;
state->past = 0;
state->how = 0;
}
else
state->reset = 0;
state->seek = 0;
gz_error(state, 0,
((void *)0)
);
state->x.pos = 0;
state->strm.avail_in = 0;
}
| void gz_reset(undefined4 *param_1)
{
*param_1 = 0;
if (param_1[6] == 0x1c4f) {
param_1[0x14] = 0;
param_1[0x15] = 0;
param_1[0x11] = 0;
}
else {
param_1[0x18] = 0;
}
param_1[0x1c] = 0;
gz_error(param_1,0,0);
*(undefined8 *)(param_1 + 4) = 0;
param_1[0x22] = 0;
return;
}
|
void crypto_sign_ed25519_ref_sc25519_add(crypto_sign_ed25519_ref_sc25519 *r, const crypto_sign_ed25519_ref_sc25519 *x, const crypto_sign_ed25519_ref_sc25519 *y)
{
int i, carry;
for(i=0;i<32;i++) r->v[i] = x->v[i] + y->v[i];
for(i=0;i<31;i++)
{
carry = r->v[i] >> 8;
r->v[i+1] += carry;
r->v[i] &= 0xff;
}
reduce_add_sub(r);
}
| void crypto_sign_ed25519_ref_sc25519_add(long param_1,long param_2,long param_3)
{
uint uVar1;
int iVar2;
int iVar3;
int local_20;
for (local_20 = 0; local_20 < 0x20; local_20 = __addvsi3(local_20,1)) {
*(int *)(param_1 + (long)local_20 * 4) =
*(int *)(param_2 + (long)local_20 * 4) + *(int *)(param_3 + (long)local_20 * 4);
}
for (local_20 = 0; local_20 < 0x1f; local_20 = __addvsi3(local_20,1)) {
uVar1 = *(uint *)(param_1 + (long)local_20 * 4);
iVar2 = __addvsi3(local_20,1);
iVar2 = *(int *)(param_1 + (long)iVar2 * 4);
iVar3 = __addvsi3(local_20,1);
*(uint *)(param_1 + (long)iVar3 * 4) = iVar2 + (uVar1 >> 8);
*(uint *)(param_1 + (long)local_20 * 4) = *(uint *)(param_1 + (long)local_20 * 4) & 0xff;
}
reduce_add_sub(param_1);
return;
}
|
static
_Bool
set_increment_size (uintmax_t tabval)
{
_Bool
ok =
1
;
if (increment_size)
{
error (0,0,
gettext ("'+' specifier only allowed" " with the last value")
);
ok =
0
;
}
increment_size = tabval;
return ok;
}
| long set_increment_size(long a1)
{
char *v1;
unsigned char v3;
v3 = 1;
if ( increment_size )
{
v1 = gettext("'+' specifier only allowed with the last value");
error(0, 0, v1);
v3 = 0;
}
increment_size = a1;
return v3;
}
|
static void
collect_children(struct ssh *ssh)
{
pid_t pid;
int status;
if (child_terminated) {
sshlog("serverloop.c", __func__, 325, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "Received SIGCHLD.");
while ((pid = waitpid(-1, &status,
1
)) > 0 ||
(pid == -1 &&
(*__errno_location ())
==
4
))
if (pid > 0)
session_close_by_pid(ssh, pid, status);
child_terminated = 0;
}
}
| void collect_children(unsigned long long a0) {
char v0;
unsigned int v1;
char v2;
unsigned long long *v5;
unsigned long long v6;
if (child_terminated) {
sshlog("serverloop.c", "collect_children", 0x145, 0x0, 0x5, 0x0, "Received SIGCHLD.");
while (true) {
v1 = waitpid(0xffffffff, &v0, 0x1);
if (v1 <= 0) {
if (v1 != -1)
break;
if (*(__errno_location()) != 4)
break;
}
if (v1 <= 0)
continue;
session_close_by_pid(a0, v1, *(&v0), v1);
}
child_terminated = 0;
}
v6 = *(&v2) ^ v5[5];
return;
}
|
static char *
file_escape (char const *str,
_Bool
path)
{
char *esc = xnmalloc (3, strlen (str) + 1);
char *p = esc;
while (*str)
{
if (path && ((*str) == '/'))
{
*p++ = '/';
str++;
}
else if (RFC3986[to_uchar (*str)])
*p++ = *str++;
else
p += sprintf (p, "%%%02x", to_uchar (*str++));
}
*p = '\0';
return esc;
}
| int file_escape(char *a0, unsigned long a1) {
char *v0;
int tmp_10;
int tmp_8;
char *v1;
char *v2;
char *v4;
char *v6;
v0 = a0;
v2 = xnmalloc(0x3, strlen(v0) + 1);
v1 = v2;
while (true) {
if (!*(v0))
break;
if (a1 && *(v0) == 47) {
v4 = v1;
v1 += 1;
*(v4) = 47;
v0 += 1;
continue;
}
if (*(to_uchar(*(v0)) + &RFC3986)) {
tmp_10 = v0;
v0 += 1;
v6 = v1;
v1 += 1;
*(v6) = *(tmp_10);
} else {
tmp_8 = v0;
v0 += 1;
v1 = &v1[sprintf(v1, "%%%02x", to_uchar(*(tmp_8)))];
}
}
*(v1) = 0;
return v2;
}
|
void consalloc(char * name)
{
struct console *__restrict__ tail;
if (posix_memalign((void*)&tail, sizeof(void*), ((sizeof(__typeof__(struct console))+(sizeof(void*)-1)) & ~(sizeof(void*)-1))) != 0)
perror("memory allocation");
tail->next = (struct console*)0;
tail->tty = name;
tail->file = (FILE*)0;
tail->flags = 0;
tail->fd = -1;
tail->id = concount++;
tail->pid = 0;
memset(&tail->tio, 0, sizeof(tail->tio));
memcpy(&tail->cp, &initcp, sizeof(struct chardata));
if (!consoles)
consoles = tail;
else
consoles->next = tail;
}
| void consalloc(unsigned long a0) {
unsigned long long v0;
int tmp_51;
char v1;
unsigned long long *v3;
unsigned long long v4;
if (posix_memalign(&v0, 0x8, 0x68))
perror("memory allocation");
*((v0 + 96)) = 0;
*(v0) = a0;
*((v0 + 8)) = 0;
*((v0 + 16)) = 0;
*((v0 + 20)) = -1;
tmp_51 = concount;
concount = concount + 1;
*((v0 + 24)) = tmp_51;
*((v0 + 28)) = 0;
memset(v0 + 36, 0x0, 0x3c);
memcpy(v0 + 32, &initcp, 0x4);
if (false)
consoles = v0;
else
g_8b486408247c89a8 = v0;
v4 = *(&v1) ^ v3[5];
return;
}
|
static
_Bool
check_and_close (int in_errno)
{
_Bool
ok =
1
;
if (in_stream !=
((void *)0)
)
{
if (!ferror_unlocked (in_stream))
in_errno = 0;
if ((strcmp (file_list[-1], "-") == 0))
clearerr_unlocked (in_stream);
else if (
rpl_fclose
(in_stream) != 0 && !in_errno)
in_errno =
(*__errno_location ())
;
if (in_errno)
{
error (0, in_errno, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, input_filename));
ok =
0
;
}
in_stream =
((void *)0)
;
}
if (ferror_unlocked (
stdout
))
{
error (0, 0, gettext ("write error"));
ok =
0
;
}
return ok;
}
| int check_and_close(unsigned long a0) {
unsigned int v0;
char v1;
v0 = a0;
v1 = 1;
if (in_stream) {
if (!ferror_unlocked(in_stream))
v0 = 0;
if (!strcmp(*((file_list - 8)), "-")) {
clearerr_unlocked(in_stream);
} else if (rpl_fclose(in_stream) && !v0) {
v0 = *(__errno_location());
}
if (v0) {
quotearg_n_style_colon(0x0, 0x3, input_filename);
error(0x0, v0, "%s");
v1 = 0;
}
in_stream = 0;
}
if (ferror_unlocked(stdout)) {
error(0x0, 0x0, gettext("write error"));
v1 = 0;
}
return v1;
}
|
static const char *
_rl_completion_append_character_function(const char *dummy
__attribute__((__unused__)))
{
static char buf[2];
buf[0] = (char)rl_completion_append_character;
buf[1] = '\0';
return buf;
}
| undefined2 * _rl_completion_append_character_function(void)
{
buf_6921._0_1_ = (char)*puRam00000000001044c6;
buf_6921._1_1_ = 0;
return &buf_6921;
}
|
int print_color_on_off(enum output_type t, enum color_attr color, const char *key, const char *fmt,
_Bool
value); static inline int print_on_off(enum output_type t, const char *key, const char *fmt,
_Bool
value) { return print_color_on_off(t, COLOR_NONE, key, fmt, value); }
| void print_color_on_off(void)
{
halt_baddata();
}
|
static char *
make_printable_str (char const *s, size_t len)
{
char *printable_buf = xnmalloc (len + 1, 4);
char *p = printable_buf;
for (size_t i = 0; i < len; i++)
{
char buf[5];
char const *tmp =
((void *)0)
;
unsigned char c = s[i];
switch (c)
{
case '\\':
tmp = "\\";
break;
case '\a':
tmp = "\\a";
break;
case '\b':
tmp = "\\b";
break;
case '\f':
tmp = "\\f";
break;
case '\n':
tmp = "\\n";
break;
case '\r':
tmp = "\\r";
break;
case '\t':
tmp = "\\t";
break;
case '\v':
tmp = "\\v";
break;
default:
if (
((*__ctype_b_loc ())[(int) ((
c
))] & (unsigned short int) _ISprint)
)
{
buf[0] = c;
buf[1] = '\0';
}
else
sprintf (buf, "\\%03o", c);
tmp = buf;
break;
}
p = stpcpy (p, tmp);
}
return printable_buf;
}
| long make_printable_str(long a1, unsigned long a2)
{
char *v2;
unsigned char v4;
char *dest;
unsigned long i;
long v7;
char s[5];
unsigned long v9;
v9 = __readfsqword(0x28u);
v7 = xnmalloc(a2 + 1, 4LL);
dest = (char *)v7;
for ( i = 0LL; i < a2; ++i )
{
v4 = *(_BYTE *)(a1 + i);
if ( v4 > 0xDu )
{
if ( v4 == 92 )
{
v2 = stpcpy(dest, "\\");
goto LABEL_18;
}
LABEL_14:
if ( ((*_ctype_b_loc())[v4] & 0x4000) != 0 )
{
s[0] = v4;
s[1] = 0;
}
else
{
sprintf(s, "\\%03o", v4);
}
v2 = stpcpy(dest, s);
goto LABEL_18;
}
if ( v4 < 7u )
goto LABEL_14;
switch ( v4 )
{
case 7u:
v2 = stpcpy(dest, "\\a");
break;
case 8u:
v2 = stpcpy(dest, "\\b");
break;
case 9u:
v2 = stpcpy(dest, "\\t");
break;
case 0xAu:
v2 = stpcpy(dest, "\\n");
break;
case 0xBu:
v2 = stpcpy(dest, "\\v");
break;
case 0xCu:
v2 = stpcpy(dest, "\\f");
break;
case 0xDu:
v2 = stpcpy(dest, "\\r");
break;
default:
goto LABEL_14;
}
LABEL_18:
dest = v2;
}
return v7;
}
|
void
dump_client_config(Options *o, const char *host)
{
int i, r;
char buf[8], *all_key;
all_key = sshkey_alg_list(0, 0, 1, ',');
if ((r = kex_assemble_names(&o->hostkeyalgorithms, kex_default_pk_alg(),
all_key)) != 0)
sshfatal("readconf.c", __func__, 3264, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "expand HostKeyAlgorithms");
free(all_key);
dump_cfg_string(oUser, o->user);
dump_cfg_string(oHostname, host);
dump_cfg_int(oPort, o->port);
dump_cfg_fmtint(oAddressFamily, o->address_family);
dump_cfg_fmtint(oBatchMode, o->batch_mode);
dump_cfg_fmtint(oCanonicalizeFallbackLocal, o->canonicalize_fallback_local);
dump_cfg_fmtint(oCanonicalizeHostname, o->canonicalize_hostname);
dump_cfg_fmtint(oCheckHostIP, o->check_host_ip);
dump_cfg_fmtint(oCompression, o->compression);
dump_cfg_fmtint(oControlMaster, o->control_master);
dump_cfg_fmtint(oEnableSSHKeysign, o->enable_ssh_keysign);
dump_cfg_fmtint(oClearAllForwardings, o->clear_forwardings);
dump_cfg_fmtint(oExitOnForwardFailure, o->exit_on_forward_failure);
dump_cfg_fmtint(oFingerprintHash, o->fingerprint_hash);
dump_cfg_fmtint(oForwardX11, o->forward_x11);
dump_cfg_fmtint(oForwardX11Trusted, o->forward_x11_trusted);
dump_cfg_fmtint(oGatewayPorts, o->fwd_opts.gateway_ports);
dump_cfg_fmtint(oHashKnownHosts, o->hash_known_hosts);
dump_cfg_fmtint(oHostbasedAuthentication, o->hostbased_authentication);
dump_cfg_fmtint(oIdentitiesOnly, o->identities_only);
dump_cfg_fmtint(oKbdInteractiveAuthentication, o->kbd_interactive_authentication);
dump_cfg_fmtint(oNoHostAuthenticationForLocalhost, o->no_host_authentication_for_localhost);
dump_cfg_fmtint(oPasswordAuthentication, o->password_authentication);
dump_cfg_fmtint(oPermitLocalCommand, o->permit_local_command);
dump_cfg_fmtint(oProxyUseFdpass, o->proxy_use_fdpass);
dump_cfg_fmtint(oPubkeyAuthentication, o->pubkey_authentication);
dump_cfg_fmtint(oRequestTTY, o->request_tty);
dump_cfg_fmtint(oSessionType, o->session_type);
dump_cfg_fmtint(oStdinNull, o->stdin_null);
dump_cfg_fmtint(oForkAfterAuthentication, o->fork_after_authentication);
dump_cfg_fmtint(oStreamLocalBindUnlink, o->fwd_opts.streamlocal_bind_unlink);
dump_cfg_fmtint(oStrictHostKeyChecking, o->strict_host_key_checking);
dump_cfg_fmtint(oTCPKeepAlive, o->tcp_keep_alive);
dump_cfg_fmtint(oTunnel, o->tun_open);
dump_cfg_fmtint(oVerifyHostKeyDNS, o->verify_host_key_dns);
dump_cfg_fmtint(oVisualHostKey, o->visual_host_key);
dump_cfg_fmtint(oUpdateHostkeys, o->update_hostkeys);
dump_cfg_int(oCanonicalizeMaxDots, o->canonicalize_max_dots);
dump_cfg_int(oConnectionAttempts, o->connection_attempts);
dump_cfg_int(oForwardX11Timeout, o->forward_x11_timeout);
dump_cfg_int(oNumberOfPasswordPrompts, o->number_of_password_prompts);
dump_cfg_int(oServerAliveCountMax, o->server_alive_count_max);
dump_cfg_int(oServerAliveInterval, o->server_alive_interval);
dump_cfg_int(oRequiredRSASize, o->required_rsa_size);
dump_cfg_string(oBindAddress, o->bind_address);
dump_cfg_string(oBindInterface, o->bind_interface);
dump_cfg_string(oCiphers, o->ciphers);
dump_cfg_string(oControlPath, o->control_path);
dump_cfg_string(oHostKeyAlgorithms, o->hostkeyalgorithms);
dump_cfg_string(oHostKeyAlias, o->host_key_alias);
dump_cfg_string(oHostbasedAcceptedAlgorithms, o->hostbased_accepted_algos);
dump_cfg_string(oIdentityAgent, o->identity_agent);
dump_cfg_string(oIgnoreUnknown, o->ignored_unknown);
dump_cfg_string(oKbdInteractiveDevices, o->kbd_interactive_devices);
dump_cfg_string(oKexAlgorithms, o->kex_algorithms);
dump_cfg_string(oCASignatureAlgorithms, o->ca_sign_algorithms);
dump_cfg_string(oLocalCommand, o->local_command);
dump_cfg_string(oRemoteCommand, o->remote_command);
dump_cfg_string(oLogLevel, log_level_name(o->log_level));
dump_cfg_string(oMacs, o->macs);
dump_cfg_string(oPKCS11Provider, o->pkcs11_provider);
dump_cfg_string(oSecurityKeyProvider, o->sk_provider);
dump_cfg_string(oPreferredAuthentications, o->preferred_authentications);
dump_cfg_string(oPubkeyAcceptedAlgorithms, o->pubkey_accepted_algos);
dump_cfg_string(oRevokedHostKeys, o->revoked_host_keys);
dump_cfg_string(oXAuthLocation, o->xauth_location);
dump_cfg_string(oKnownHostsCommand, o->known_hosts_command);
dump_cfg_forwards(oDynamicForward, o->num_local_forwards, o->local_forwards);
dump_cfg_forwards(oLocalForward, o->num_local_forwards, o->local_forwards);
dump_cfg_forwards(oRemoteForward, o->num_remote_forwards, o->remote_forwards);
dump_cfg_strarray(oIdentityFile, o->num_identity_files, o->identity_files);
dump_cfg_strarray_oneline(oCanonicalDomains, o->num_canonical_domains, o->canonical_domains);
dump_cfg_strarray(oCertificateFile, o->num_certificate_files, o->certificate_files);
dump_cfg_strarray_oneline(oGlobalKnownHostsFile, o->num_system_hostfiles, o->system_hostfiles);
dump_cfg_strarray_oneline(oUserKnownHostsFile, o->num_user_hostfiles, o->user_hostfiles);
dump_cfg_strarray(oSendEnv, o->num_send_env, o->send_env);
dump_cfg_strarray(oSetEnv, o->num_setenv, o->setenv);
dump_cfg_strarray_oneline(oLogVerbose,
o->num_log_verbose, o->log_verbose);
if (o->num_permitted_remote_opens == 0)
printf("%s any\n", lookup_opcode_name(oPermitRemoteOpen));
else
dump_cfg_strarray_oneline(oPermitRemoteOpen,
o->num_permitted_remote_opens, o->permitted_remote_opens);
if (o->add_keys_to_agent_lifespan <= 0)
dump_cfg_fmtint(oAddKeysToAgent, o->add_keys_to_agent);
else {
printf("addkeystoagent%s %d\n",
o->add_keys_to_agent == 3 ? " confirm" : "",
o->add_keys_to_agent_lifespan);
}
if (o->forward_agent_sock_path ==
((void *)0)
)
dump_cfg_fmtint(oForwardAgent, o->forward_agent);
else
dump_cfg_string(oForwardAgent, o->forward_agent_sock_path);
if (o->connection_timeout == -1)
printf("connecttimeout none\n");
else
dump_cfg_int(oConnectTimeout, o->connection_timeout);
printf("tunneldevice");
if (o->tun_local == 0x7fffffff)
printf(" any");
else
printf(" %d", o->tun_local);
if (o->tun_remote == 0x7fffffff)
printf(":any");
else
printf(":%d", o->tun_remote);
printf("\n");
printf("canonicalizePermittedcnames");
if (o->num_permitted_cnames == 0)
printf(" none");
for (i = 0; i < o->num_permitted_cnames; i++) {
printf(" %s:%s", o->permitted_cnames[i].source_list,
o->permitted_cnames[i].target_list);
}
printf("\n");
if (o->control_persist == 0 || o->control_persist_timeout == 0)
dump_cfg_fmtint(oControlPersist, o->control_persist);
else
dump_cfg_int(oControlPersist, o->control_persist_timeout);
if (o->escape_char == -2)
printf("escapechar none\n");
else {
vis(buf, o->escape_char, (0x04 | 0x08 | 0x10), 0);
printf("escapechar %s\n", buf);
}
printf("ipqos %s ", iptos2str(o->ip_qos_interactive));
printf("%s\n", iptos2str(o->ip_qos_bulk));
printf("rekeylimit %llu %d\n",
(unsigned long long)o->rekey_limit, o->rekey_interval);
printf("streamlocalbindmask 0%o\n",
o->fwd_opts.streamlocal_bind_mask);
printf("syslogfacility %s\n", log_facility_name(o->log_facility));
if (o->jump_host ==
((void *)0)
)
dump_cfg_string(oProxyCommand, o->proxy_command);
else {
i = strchr(o->jump_host, ':') !=
((void *)0)
||
strspn(o->jump_host, "1234567890.") == strlen(o->jump_host);
snprintf(buf, sizeof(buf), "%d", o->jump_port);
printf("proxyjump %s%s%s%s%s%s%s%s%s\n",
o->jump_extra ==
((void *)0)
? "" : o->jump_extra,
o->jump_extra ==
((void *)0)
? "" : ",",
o->jump_user ==
((void *)0)
? "" : o->jump_user,
o->jump_user ==
((void *)0)
? "" : "@",
i ? "[" : "",
o->jump_host,
i ? "]" : "",
o->jump_port <= 0 ? "" : ":",
o->jump_port <= 0 ? "" : buf);
}
}
| void dump_client_config(undefined4 *param_1,undefined8 param_2)
{
undefined4 uVar1;
uint uVar2;
undefined8 uVar3;
undefined8 uVar4;
char *pcVar5;
size_t sVar6;
size_t sVar7;
undefined *puVar8;
undefined *puVar9;
char **ppcVar10;
undefined *puVar11;
undefined *puVar12;
undefined *puVar13;
undefined *puVar14;
undefined *puVar15;
long in_FS_OFFSET;
char *pcStack88;
undefined8 uStack80;
undefined8 local_48;
undefined4 *local_40;
int local_38;
int local_34;
void *local_30;
char local_28 [8];
long local_20;
ppcVar10 = (char **)&local_48;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
uStack80 = 0x109cb1;
local_48 = param_2;
local_40 = param_1;
local_30 = (void *)sshkey_alg_list(0,0,1,0x2c);
uStack80 = 0x109cba;
uVar4 = kex_default_pk_alg();
uStack80 = 0x109cd7;
local_34 = kex_assemble_names(local_40 + 0x2c,uVar4,local_30);
if (local_34 != 0) {
uStack80 = 0x109cea;
uVar4 = ssh_err(local_34);
ppcVar10 = &pcStack88;
pcStack88 = "expand HostKeyAlgorithms";
sshfatal("readconf.c","dump_client_config",0xcc0,1,1,uVar4);
}
*(undefined8 *)((long)ppcVar10 + -8) = 0x109d2d;
free(local_30);
uVar4 = *(undefined8 *)(local_40 + 0x38);
*(undefined8 *)((long)ppcVar10 + -8) = 0x109d45;
dump_cfg_string(0x15,uVar4);
uVar4 = local_48;
*(undefined8 *)((long)ppcVar10 + -8) = 0x109d56;
dump_cfg_string(0xd,uVar4);
uVar1 = local_40[0x22];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109d6c;
dump_cfg_int(0xe,uVar1);
uVar1 = local_40[0x23];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109d82;
dump_cfg_fmtint(0x37,uVar1);
uVar1 = local_40[0x16];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109d95;
dump_cfg_fmtint(0x1b,uVar1);
uVar1 = local_40[0x532];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109dab;
dump_cfg_fmtint(0x54,uVar1);
uVar1 = local_40[0x530];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109dc1;
dump_cfg_fmtint(0x52,uVar1);
uVar1 = local_40[0x17];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109dd4;
dump_cfg_fmtint(0x1c,uVar1);
uVar1 = local_40[0x19];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109de7;
dump_cfg_fmtint(0x1e,uVar1);
uVar1 = local_40[0x4da];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109dfd;
dump_cfg_fmtint(0x40,uVar1);
uVar1 = local_40[0x4c9];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109e13;
dump_cfg_fmtint(0x33,uVar1);
uVar1 = local_40[0x4c0];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109e29;
dump_cfg_fmtint(0x31,uVar1);
uVar1 = local_40[7];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109e3c;
dump_cfg_fmtint(9,uVar1);
uVar1 = local_40[0x5b6];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109e52;
dump_cfg_fmtint(0x59,uVar1);
uVar1 = local_40[4];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109e65;
dump_cfg_fmtint(5,uVar1);
uVar1 = local_40[6];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109e78;
dump_cfg_fmtint(6,uVar1);
uVar1 = local_40[10];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109e8b;
dump_cfg_fmtint(8,uVar1);
uVar1 = local_40[0x4dd];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109ea1;
dump_cfg_fmtint(0x42,uVar1);
uVar1 = local_40[0xe];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109eb4;
dump_cfg_fmtint(0x2c,uVar1);
uVar1 = local_40[0x4ce];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109eca;
dump_cfg_fmtint(0x3c,uVar1);
uVar1 = local_40[0x12];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109edd;
dump_cfg_fmtint(0x27,uVar1);
uVar1 = local_40[0x4cd];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109ef3;
dump_cfg_fmtint(0x32,uVar1);
uVar1 = local_40[0x11];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109f06;
dump_cfg_fmtint(10,uVar1);
uVar1 = local_40[0x4e4];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109f1c;
dump_cfg_fmtint(0x46,uVar1);
uVar1 = local_40[0x4ed];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109f32;
dump_cfg_fmtint(0x50,uVar1);
uVar1 = local_40[0xd];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109f45;
dump_cfg_fmtint(0x26,uVar1);
uVar1 = local_40[0x4e9];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109f5b;
dump_cfg_fmtint(0x4b,uVar1);
uVar1 = local_40[0x4ea];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109f71;
dump_cfg_fmtint(0x4c,uVar1);
uVar1 = local_40[0x4eb];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109f87;
dump_cfg_fmtint(0x4d,uVar1);
uVar1 = local_40[0x4ec];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109f9d;
dump_cfg_fmtint(0x4e,uVar1);
uVar1 = local_40[0xc];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109fb0;
dump_cfg_fmtint(0x57,uVar1);
uVar1 = local_40[0x18];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109fc3;
dump_cfg_fmtint(0x1d,uVar1);
uVar1 = local_40[0x1a];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109fd6;
dump_cfg_fmtint(0x1f,uVar1);
uVar1 = local_40[0x4de];
*(undefined8 *)((long)ppcVar10 + -8) = 0x109fec;
dump_cfg_fmtint(0x43,uVar1);
uVar1 = local_40[200];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a002;
dump_cfg_fmtint(0x35,uVar1);
uVar1 = local_40[0x4e8];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a018;
dump_cfg_fmtint(0x48,uVar1);
uVar1 = local_40[0x5b7];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a02e;
dump_cfg_fmtint(0x5a,uVar1);
uVar1 = local_40[0x531];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a044;
dump_cfg_int(0x53,uVar1);
uVar1 = local_40[0x24];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a05a;
dump_cfg_int(0x1a,uVar1);
uVar1 = local_40[5];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a06d;
dump_cfg_int(7,uVar1);
uVar1 = local_40[0x26];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a083;
dump_cfg_int(0x20,uVar1);
uVar1 = local_40[0x4d0];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a099;
dump_cfg_int(0x3b,uVar1);
uVar1 = local_40[0x4cf];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a0af;
dump_cfg_int(0x3a,uVar1);
uVar1 = local_40[0x5c6];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a0c5;
dump_cfg_int(0x61,uVar1);
uVar4 = *(undefined8 *)(local_40 + 0xc0);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a0dd;
dump_cfg_string(0x2e,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0xc2);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a0f5;
dump_cfg_string(0x2f,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x28);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a10d;
dump_cfg_string(0x24,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x4d8);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a125;
dump_cfg_string(0x3f,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x2c);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a13d;
dump_cfg_string(0x2d,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x34);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a155;
dump_cfg_string(0x29,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x5b8);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a16d;
dump_cfg_string(0x5b,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x4b6);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a185;
dump_cfg_string(0x14,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x5c8);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a19d;
dump_cfg_string(0x4f,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x14);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a1b2;
dump_cfg_string(0x28,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x2e);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a1ca;
dump_cfg_string(0x49,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x30);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a1e2;
dump_cfg_string(0x5d,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x4e2);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a1fa;
dump_cfg_string(0x45,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x4e6);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a212;
dump_cfg_string(0x47,uVar4);
uVar1 = local_40[0x1e];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a220;
uVar4 = log_level_name(uVar1);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a22d;
dump_cfg_string(0x22,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x2a);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a245;
dump_cfg_string(0x25,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0xc4);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a25d;
dump_cfg_string(0x30,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0xc6);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a275;
dump_cfg_string(0x5f,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0xbe);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a28d;
dump_cfg_string(0x2b,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x5ba);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a2a5;
dump_cfg_string(0x5c,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x5b4);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a2bd;
dump_cfg_string(0x58,uVar4);
uVar4 = *(undefined8 *)(local_40 + 8);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a2d2;
dump_cfg_string(0xb,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x5c4);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a2ea;
dump_cfg_string(0x60,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x4ba);
uVar1 = local_40[0x4b8];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a310;
dump_cfg_forwards(0x2a,uVar1,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x4ba);
uVar1 = local_40[0x4b8];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a336;
dump_cfg_forwards(0x10,uVar1,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x4be);
uVar1 = local_40[0x4bc];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a35c;
dump_cfg_forwards(0xf,uVar1,uVar4);
uVar1 = local_40[0xc9];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a381;
dump_cfg_strarray(0xc,uVar1,local_40 + 0xca);
uVar1 = local_40[0x4ee];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a3a6;
dump_cfg_strarray_oneline(0x51,uVar1,local_40 + 0x4f0);
uVar1 = local_40[0x2be];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a3cb;
dump_cfg_strarray(0x12,uVar1,local_40 + 0x2c0);
uVar1 = local_40[0x3b];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a3ec;
dump_cfg_strarray_oneline(0x18,uVar1,local_40 + 0x3c);
uVar1 = local_40[0x7c];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a40d;
dump_cfg_strarray_oneline(0x19,uVar1,local_40 + 0x7e);
uVar4 = *(undefined8 *)(local_40 + 0x4d2);
uVar1 = local_40[0x4d1];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a42e;
dump_cfg_strarray(0x3d,uVar1,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x4d6);
uVar1 = local_40[0x4d4];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a44f;
dump_cfg_strarray(0x3e,uVar1,uVar4);
uVar4 = *(undefined8 *)(local_40 + 0x20);
uVar1 = local_40[0x1f];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a46d;
dump_cfg_strarray_oneline(0x23,uVar1,uVar4);
if (local_40[0x4c4] == 0) {
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a485;
uVar4 = lookup_opcode_name(0x11);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a499;
printf("%s any\n",uVar4);
}
else {
uVar4 = *(undefined8 *)(local_40 + 0x4c2);
uVar1 = local_40[0x4c4];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a4bc;
dump_cfg_strarray_oneline(0x11,uVar1,uVar4);
}
if ((int)local_40[0x4b5] < 1) {
uVar1 = local_40[0x4b4];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a4e0;
dump_cfg_fmtint(0x13,uVar1);
}
else {
uVar2 = local_40[0x4b5];
if (local_40[0x4b4] == 3) {
pcVar5 = " confirm";
}
else {
pcVar5 = "";
}
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a51f;
printf("addkeystoagent%s %d\n",pcVar5,(ulong)uVar2);
}
if (*(long *)(local_40 + 2) == 0) {
uVar1 = *local_40;
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a53e;
dump_cfg_fmtint(4,uVar1);
}
else {
uVar4 = *(undefined8 *)(local_40 + 2);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a555;
dump_cfg_string(4,uVar4);
}
if (local_40[0x25] == -1) {
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a575;
printf("connecttimeout none\n");
}
else {
uVar1 = local_40[0x25];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a58d;
dump_cfg_int(0x36,uVar1);
}
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a59e;
printf("tunneldevice");
if (local_40[0x4df] == 0x7fffffff) {
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a5c0;
printf(" any");
}
else {
uVar2 = local_40[0x4df];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a5df;
printf(" %d",(ulong)uVar2);
}
if (local_40[0x4e0] == 0x7fffffff) {
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a601;
printf(":any");
}
else {
uVar2 = local_40[0x4e0];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a620;
printf(":%d",(ulong)uVar2);
}
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a631;
printf("\n");
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a642;
printf("canonicalizePermittedcnames");
if (local_40[0x533] == 0) {
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a661;
printf(" none");
}
for (local_38 = 0; local_38 < (int)local_40[0x533]; local_38 = __addvsi3(local_38,1)) {
uVar4 = *(undefined8 *)(local_40 + ((long)local_38 + 0x14d) * 4 + 2);
uVar3 = *(undefined8 *)(local_40 + ((long)local_38 + 0x14d) * 4);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a6b8;
printf(" %s:%s",uVar3,uVar4);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a6c5;
}
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a6e8;
printf("\n");
if ((local_40[0x4db] == 0) || (local_40[0x4dc] == 0)) {
uVar1 = local_40[0x4db];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a71a;
dump_cfg_fmtint(0x41,uVar1);
}
else {
uVar1 = local_40[0x4dc];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a732;
dump_cfg_int(0x41,uVar1);
}
if (local_40[0x3a] == -2) {
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a752;
printf("escapechar none\n");
}
else {
uVar1 = local_40[0x3a];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a774;
vis(local_28,uVar1,0x1c,0);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a78c;
printf("escapechar %s\n",local_28);
}
uVar1 = local_40[0x1b];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a79a;
uVar4 = iptos2str(uVar1);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a7ae;
printf("ipqos %s ",uVar4);
uVar1 = local_40[0x1c];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a7bc;
uVar4 = iptos2str(uVar1);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a7d0;
printf("%s\n",uVar4);
uVar2 = local_40[0x4cc];
uVar4 = *(undefined8 *)(local_40 + 0x4ca);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a7fe;
printf("rekeylimit %llu %d\n",uVar4,(ulong)uVar2);
uVar2 = local_40[0xb];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a818;
printf("streamlocalbindmask 0%o\n",(ulong)uVar2);
uVar1 = local_40[0x1d];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a826;
uVar4 = log_facility_name(uVar1);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a83a;
printf("syslogfacility %s\n",uVar4);
if (*(long *)(local_40 + 0x5be) == 0) {
uVar4 = *(undefined8 *)(local_40 + 0x36);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a862;
dump_cfg_string(0x17,uVar4);
goto code_r0x0010aa11;
}
pcVar5 = *(char **)(local_40 + 0x5be);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a87f;
pcVar5 = strchr(pcVar5,0x3a);
if (pcVar5 == (char *)0x0) {
pcVar5 = *(char **)(local_40 + 0x5be);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a89e;
sVar6 = strspn(pcVar5,"1234567890.");
pcVar5 = *(char **)(local_40 + 0x5be);
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a8b4;
sVar7 = strlen(pcVar5);
if (sVar6 == sVar7) goto LAB_0010a8b9;
local_38 = 0;
}
else {
LAB_0010a8b9:
local_38 = 1;
}
uVar2 = local_40[0x5c0];
*(undefined8 *)((long)ppcVar10 + -8) = 0x10a8f1;
snprintf(local_28,8,"%d",(ulong)uVar2);
if ((int)local_40[0x5c0] < 1) {
pcVar5 = "";
}
else {
pcVar5 = local_28;
}
if ((int)local_40[0x5c0] < 1) {
puVar13 = &DAT_0010b5e4;
}
else {
puVar13 = &DAT_0010cbbe;
}
if (local_38 == 0) {
puVar12 = &DAT_0010b5e4;
}
else {
puVar12 = &DAT_0010cbc0;
}
uVar4 = *(undefined8 *)(local_40 + 0x5be);
if (local_38 == 0) {
puVar14 = &DAT_0010b5e4;
}
else {
puVar14 = &DAT_0010cbc2;
}
if (*(long *)(local_40 + 0x5bc) == 0) {
puVar15 = &DAT_0010b5e4;
}
else {
puVar15 = &DAT_0010cbc4;
}
if (*(long *)(local_40 + 0x5bc) == 0) {
puVar9 = &DAT_0010b5e4;
}
else {
puVar9 = *(undefined **)(local_40 + 0x5bc);
}
if (*(long *)(local_40 + 0x5c2) == 0) {
puVar11 = &DAT_0010b5e4;
}
else {
puVar11 = &DAT_0010cbc6;
}
if (*(long *)(local_40 + 0x5c2) == 0) {
puVar8 = &DAT_0010b5e4;
}
else {
puVar8 = *(undefined **)(local_40 + 0x5c2);
}
*(char **)((long)ppcVar10 + -8) = pcVar5;
*(undefined **)((long)ppcVar10 + -0x10) = puVar13;
*(undefined **)((long)ppcVar10 + -0x18) = puVar12;
*(undefined8 *)((long)ppcVar10 + -0x20) = uVar4;
*(undefined8 *)((long)ppcVar10 + -0x28) = 0x10aa0c;
printf("proxyjump %s%s%s%s%s%s%s%s%s\n",puVar8,puVar11,puVar9,puVar15,puVar14);
code_r0x0010aa11:
if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
*(undefined8 *)((long)ppcVar10 + -8) = 0x10aa25;
__stack_chk_fail();
}
return;
}
|
static
void setExit ( Int32 v )
{
if (v > exitValue) exitValue = v;
}
| void setExit(unsigned long a0) {
unsigned int v0;
unsigned long long v2;
unsigned long v3;
v0 = a0;
v2 = exitValue;
if (a0 > exitValue) {
v3 = a0;
exitValue = a0;
}
return;
}
|
static void getsel1package(struct pkginfo *pkg) {
const char *pkgname;
int l;
if (pkg->want == PKG_WANT_UNKNOWN)
return;
pkgname = pkg_name(pkg, pnaw_nonambig);
l = strlen(pkgname);
l >>= 3;
l = 6 - l;
if (l < 1)
l = 1;
printf("%s%.*s%s\n", pkgname, l, "\t\t\t\t\t\t", pkg_want_name(pkg));
}
| void getsel1package(struct_0 *a0) {
unsigned int v0;
char *v1;
unsigned long long v3;
unsigned long long v4;
v3 = a0->field_10;
if (a0->field_10) {
v1 = pkg_name(a0, 0x1);
v0 = strlen(v1);
v0 >>= 3;
v0 = 6 - v0;
if (v0 <= 0)
v0 = 1;
pkg_want_name(a0);
v4 = printf("%s%.*s%s\n", v1, v0, &g_4007f0);
}
return;
}
|
static union node *
copynode(n)
union node *n;
{
union node *new;
if (n ==
((void *)0)
)
return
((void *)0)
;
new = funcblock;
funcblock = (char *) funcblock + nodesize[n->type];
switch (n->type) {
case 0:
new->ncmd.redirect = copynode(n->ncmd.redirect);
new->ncmd.args = copynode(n->ncmd.args);
new->ncmd.assign = copynode(n->ncmd.assign);
new->ncmd.linno = n->ncmd.linno;
break;
case 1:
new->npipe.cmdlist = copynodelist(n->npipe.cmdlist);
new->npipe.backgnd = n->npipe.backgnd;
break;
case 2:
case 3:
case 4:
new->nredir.redirect = copynode(n->nredir.redirect);
new->nredir.n = copynode(n->nredir.n);
new->nredir.linno = n->nredir.linno;
break;
case 5:
case 6:
case 7:
case 9:
case 10:
new->nbinary.ch2 = copynode(n->nbinary.ch2);
new->nbinary.ch1 = copynode(n->nbinary.ch1);
break;
case 8:
new->nif.elsepart = copynode(n->nif.elsepart);
new->nif.ifpart = copynode(n->nif.ifpart);
new->nif.test = copynode(n->nif.test);
break;
case 11:
new->nfor.var = nodesavestr(n->nfor.var);
new->nfor.body = copynode(n->nfor.body);
new->nfor.args = copynode(n->nfor.args);
new->nfor.linno = n->nfor.linno;
break;
case 12:
new->ncase.cases = copynode(n->ncase.cases);
new->ncase.expr = copynode(n->ncase.expr);
new->ncase.linno = n->ncase.linno;
break;
case 13:
new->nclist.body = copynode(n->nclist.body);
new->nclist.pattern = copynode(n->nclist.pattern);
new->nclist.next = copynode(n->nclist.next);
break;
case 14:
new->ndefun.body = copynode(n->ndefun.body);
new->ndefun.text = nodesavestr(n->ndefun.text);
new->ndefun.linno = n->ndefun.linno;
break;
case 15:
new->narg.backquote = copynodelist(n->narg.backquote);
new->narg.text = nodesavestr(n->narg.text);
new->narg.next = copynode(n->narg.next);
break;
case 16:
case 17:
case 18:
case 19:
case 20:
new->nfile.fname = copynode(n->nfile.fname);
new->nfile.fd = n->nfile.fd;
new->nfile.next = copynode(n->nfile.next);
break;
case 21:
case 22:
new->ndup.vname = copynode(n->ndup.vname);
new->ndup.dupfd = n->ndup.dupfd;
new->ndup.fd = n->ndup.fd;
new->ndup.next = copynode(n->ndup.next);
break;
case 23:
case 24:
new->nhere.doc = copynode(n->nhere.doc);
new->nhere.fd = n->nhere.fd;
new->nhere.next = copynode(n->nhere.next);
break;
case 25:
new->nnot.com = copynode(n->nnot.com);
break;
};
new->type = n->type;
return new;
}
| long copynode(int *a1)
{
long v2;
if ( !a1 )
return 0LL;
v2 = funcblock;
funcblock += nodesize[*a1];
switch ( *a1 )
{
case 0:
*(_QWORD *)(v2 + 24) = copynode(*((int **)a1 + 3));
*(_QWORD *)(v2 + 16) = copynode(*((int **)a1 + 2));
*(_QWORD *)(v2 + 8) = copynode(*((int **)a1 + 1));
*(_DWORD *)(v2 + 4) = a1[1];
break;
case 1:
*(_QWORD *)(v2 + 8) = copynodelist(*((long ****)a1 + 1));
*(_DWORD *)(v2 + 4) = a1[1];
break;
case 2:
case 3:
case 4:
case 12:
*(_QWORD *)(v2 + 16) = copynode(*((int **)a1 + 2));
*(_QWORD *)(v2 + 8) = copynode(*((int **)a1 + 1));
*(_DWORD *)(v2 + 4) = a1[1];
break;
case 5:
case 6:
case 7:
case 9:
case 10:
*(_QWORD *)(v2 + 16) = copynode(*((int **)a1 + 2));
*(_QWORD *)(v2 + 8) = copynode(*((int **)a1 + 1));
break;
case 8:
case 13:
*(_QWORD *)(v2 + 24) = copynode(*((int **)a1 + 3));
*(_QWORD *)(v2 + 16) = copynode(*((int **)a1 + 2));
*(_QWORD *)(v2 + 8) = copynode(*((int **)a1 + 1));
break;
case 11:
*(_QWORD *)(v2 + 24) = nodesavestr(*((const char **)a1 + 3));
*(_QWORD *)(v2 + 16) = copynode(*((int **)a1 + 2));
*(_QWORD *)(v2 + 8) = copynode(*((int **)a1 + 1));
*(_DWORD *)(v2 + 4) = a1[1];
break;
case 14:
*(_QWORD *)(v2 + 16) = copynode(*((int **)a1 + 2));
*(_QWORD *)(v2 + 8) = nodesavestr(*((const char **)a1 + 1));
*(_DWORD *)(v2 + 4) = a1[1];
break;
case 15:
*(_QWORD *)(v2 + 24) = copynodelist(*((long ****)a1 + 3));
*(_QWORD *)(v2 + 16) = nodesavestr(*((const char **)a1 + 2));
*(_QWORD *)(v2 + 8) = copynode(*((int **)a1 + 1));
break;
case 16:
case 17:
case 18:
case 19:
case 20:
case 23:
case 24:
*(_QWORD *)(v2 + 24) = copynode(*((int **)a1 + 3));
*(_DWORD *)(v2 + 16) = a1[4];
*(_QWORD *)(v2 + 8) = copynode(*((int **)a1 + 1));
break;
case 21:
case 22:
*(_QWORD *)(v2 + 24) = copynode(*((int **)a1 + 3));
*(_DWORD *)(v2 + 20) = a1[5];
*(_DWORD *)(v2 + 16) = a1[4];
*(_QWORD *)(v2 + 8) = copynode(*((int **)a1 + 1));
break;
case 25:
*(_QWORD *)(v2 + 8) = copynode(*((int **)a1 + 1));
break;
default:
break;
}
*(_DWORD *)v2 = *a1;
return v2;
}
|
static int vxcan_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
char *type =
((void *)0)
;
int err;
struct rtattr *data;
struct ifinfomsg *ifm, *peer_ifm;
unsigned int ifi_flags, ifi_change, ifi_index;
if (strcmp(argv[0], "peer") != 0) {
usage();
return -1;
}
ifm = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
ifi_flags = ifm->ifi_flags;
ifi_change = ifm->ifi_change;
ifi_index = ifm->ifi_index;
ifm->ifi_flags = 0;
ifm->ifi_change = 0;
ifm->ifi_index = 0;
data = addattr_nest(n, 1024, VXCAN_INFO_PEER);
n->nlmsg_len += sizeof(struct ifinfomsg);
err = iplink_parse(argc - 1, argv + 1, (struct iplink_req *)n, &type);
if (err < 0)
return err;
if (type)
duparg("type", argv[err]);
peer_ifm = ((void*)(((char*)(data)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
peer_ifm->ifi_index = ifm->ifi_index;
peer_ifm->ifi_flags = ifm->ifi_flags;
peer_ifm->ifi_change = ifm->ifi_change;
ifm->ifi_flags = ifi_flags;
ifm->ifi_change = ifi_change;
ifm->ifi_index = ifi_index;
addattr_nest_end(n, data);
return argc - 1 - err;
}
| int vxcan_parse_opt(undefined8 param_1,int param_2,char **param_3,int *param_4)
{
int iVar1;
int iVar2;
int iVar3;
int iVar4;
long in_FS_OFFSET;
long local_30;
int *local_28;
long local_20;
long local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_30 = 0;
iVar3 = strcmp(*param_3,"peer");
if (iVar3 == 0) {
local_28 = param_4 + 4;
iVar3 = param_4[6];
iVar1 = param_4[7];
iVar2 = param_4[5];
param_4[6] = 0;
param_4[7] = 0;
param_4[5] = 0;
local_20 = addattr_nest(param_4,0x400,1);
*param_4 = *param_4 + 0x10;
iVar4 = iplink_parse(param_2 + -1,param_3 + 1,param_4,&local_30);
if (-1 < iVar4) {
if (local_30 != 0) {
duparg(&DAT_00100284,param_3[iVar4]);
}
local_18 = local_20 + 4;
*(int *)(local_20 + 8) = local_28[1];
*(int *)(local_20 + 0xc) = local_28[2];
*(int *)(local_20 + 0x10) = local_28[3];
local_28[2] = iVar3;
local_28[3] = iVar1;
local_28[1] = iVar2;
addattr_nest_end(param_4,local_20);
iVar4 = (param_2 + -1) - iVar4;
}
}
else {
usage();
iVar4 = -1;
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return iVar4;
}
__stack_chk_fail();
}
|
gnutls_x509_crt_t load_ca_cert(unsigned mand, common_info_st * info)
{
gnutls_x509_crt_t crt;
int ret;
gnutls_datum_t dat;
size_t size;
if (mand == 0 && info->ca ==
((void *)0)
) {
return
((void *)0)
;
}
if (info->ca ==
((void *)0)
) {
fprintf(
stderr
, "missing --load-ca-certificate\n");
app_exit(1);
}
ret = gnutls_x509_crt_init(&crt);
if (ret < 0) {
fprintf(
stderr
, "crt_init: %s\n", gnutls_strerror(ret));
app_exit(1);
}
if (gnutls_url_is_supported(info->ca) != 0) {
ret = gnutls_x509_crt_import_url(crt, info->ca, 0);
if (ret < 0) {
fprintf(
stderr
, "error importing CA certificate: %s: %s\n",
info->ca, gnutls_strerror(ret));
app_exit(1);
}
return crt;
}
dat.data = (void *) _gnutls_read_file(info->ca, 0x1, &size);
dat.size = size;
if (!dat.data) {
fprintf(
stderr
, "error reading file at --load-ca-certificate: %s\n",
info->ca);
app_exit(1);
}
ret = gnutls_x509_crt_import(crt, &dat, info->incert_format);
free(dat.data);
if (ret < 0) {
fprintf(
stderr
, "error importing CA certificate: %s: %s\n",
info->ca, gnutls_strerror(ret));
app_exit(1);
}
return crt;
}
| long long load_ca_cert(unsigned long a0, struct_0 *a1) {
unsigned int v0;
char v1;
char v2;
void* v3;
unsigned int v4;
unsigned long long v6;
if (!a0 && !a1->field_40) {
v6 = 0;
return v6;
}
if (!a1->field_40) {
fprintf(stderr, "missing --load-ca-certificate\n");
app_exit(0x1);
}
v0 = gnutls_x509_crt_init(&v1);
if (v0 < 0) {
fprintf(stderr, "crt_init: %s\n", gnutls_strerror(v0));
app_exit(0x1);
}
if (gnutls_url_is_supported(a1->field_40)) {
v0 = gnutls_x509_crt_import_url(*(&v1), a1->field_40, 0x0, a1->field_40);
if (v0 < 0) {
fprintf(stderr, "error importing CA certificate: %s: %s\n", a1->field_40, gnutls_strerror(v0));
app_exit(0x1);
}
v6 = *(&v1);
return v6;
} else {
v3 = _gnutls_read_file(a1->field_40, 0x1, &v2);
v4 = *(&v2);
if (!v3) {
fprintf(stderr, "error reading file at --load-ca-certificate: %s\n", a1->field_40);
app_exit(0x1);
}
v0 = gnutls_x509_crt_import(*(&v1), &v3, a1->field_1c, &v3);
free(v3);
if (v0 < 0) {
fprintf(stderr, "error importing CA certificate: %s: %s\n", a1->field_40, gnutls_strerror(v0));
app_exit(0x1);
}
v6 = *(&v1);
return v6;
}
}
|
static inline char *
stzncpy (char *__restrict__ dest, char const *__restrict__ src, size_t len)
{
char const *src_end = src + len;
while (src < src_end && *src)
*dest++ = *src++;
*dest = 0;
return dest;
}
| void stzncpy(unsigned long long a0, unsigned long a1, unsigned long a2) {
char *v0;
int tmp_10;
char *v1;
unsigned long v2;
char *v4;
char *v6;
v1 = a0;
v0 = a1;
for (v2 = &v0[a2]; v0 < v2; *(v4) = *(tmp_10)) {
if (!*(v0))
break;
tmp_10 = v0;
v0 += 1;
v4 = v1;
v1 += 1;
}
*(v1) = 0;
v6 = v1;
return;
}
|
static inline int padvance(const char **path, const char *name)
{
return padvance_magic(path, name, 1);
}
| int padvance(unsigned long long a0, unsigned long long a1) {
return padvance_magic(a0, a1, 0x1, a1);
}
|
static void
unwind_frame_run_internal (tag, ignore)
char *tag, *ignore;
{
UNWIND_ELT *elt;
int found;
found = 0;
while (elt = unwind_protect_list)
{
unwind_protect_list = elt->head.next;
if (elt->head.cleanup == 0)
{
if (tag && ((elt->arg.v)[0] == (tag)[0] && strcmp(elt->arg.v, tag) == 0))
{
do { if ((uwcache).nc < (uwcache).cs) { do { if ((sizeof(UNWIND_ELT)) <= 32) { register char * mzp = (char *)((elt)); unsigned long mctmp = (sizeof(UNWIND_ELT)); register long mcn; if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp &= 7; } switch (mctmp) { case 0: for(;;) { *mzp++ = 0xdf; case 7: *mzp++ = 0xdf; case 6: *mzp++ = 0xdf; case 5: *mzp++ = 0xdf; case 4: *mzp++ = 0xdf; case 3: *mzp++ = 0xdf; case 2: *mzp++ = 0xdf; case 1: *mzp++ = 0xdf; if(mcn <= 0) break; mcn--; } } } else memset (((elt)), (0xdf), (sizeof(UNWIND_ELT))); } while(0); ((UNWIND_ELT **)((uwcache).data))[(uwcache).nc++] = (elt); } else sh_xfree((elt), "unwind_prot.c", 316); } while (0);
found = 1;
break;
}
}
else
{
if (elt->head.cleanup == (Function *) restore_variable)
restore_variable (&elt->sv.v);
else
(*(elt->head.cleanup)) (elt->arg.v);
}
do { if ((uwcache).nc < (uwcache).cs) { do { if ((sizeof(UNWIND_ELT)) <= 32) { register char * mzp = (char *)((elt)); unsigned long mctmp = (sizeof(UNWIND_ELT)); register long mcn; if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp &= 7; } switch (mctmp) { case 0: for(;;) { *mzp++ = 0xdf; case 7: *mzp++ = 0xdf; case 6: *mzp++ = 0xdf; case 5: *mzp++ = 0xdf; case 4: *mzp++ = 0xdf; case 3: *mzp++ = 0xdf; case 2: *mzp++ = 0xdf; case 1: *mzp++ = 0xdf; if(mcn <= 0) break; mcn--; } } } else memset (((elt)), (0xdf), (sizeof(UNWIND_ELT))); } while(0); ((UNWIND_ELT **)((uwcache).data))[(uwcache).nc++] = (elt); } else sh_xfree((elt), "unwind_prot.c", 329); } while (0);
}
if (tag && found == 0)
internal_warning (gettext("unwind_frame_run: %s: frame not found"), tag);
}
| void unwind_frame_run_internal(char *a0, unsigned long a1) {
unsigned long v0;
int tmp_15;
unsigned int v1;
unsigned long long v2;
unsigned long long v3;
struct_1 *v4;
struct_0 *v6;
struct_0 *v7;
unsigned long long v8;
struct_0 *v9;
struct_0 *v10;
struct_0 *v11;
struct_0 *v12;
struct_0 *v13;
struct_0 *v14;
struct_0 *v15;
struct_0 *v16;
struct_0 *v17;
unsigned long long v18;
unsigned long long v19;
struct_0 *v20;
struct_0 *v21;
struct_0 *v22;
struct_0 *v23;
struct_0 *v24;
struct_0 *v25;
struct_0 *v26;
struct_0 *v27;
struct_0 *v28;
unsigned long long v29;
unsigned long long v30;
v0 = a1;
v1 = 0;
while (true) {
v6 = unwind_protect_list;
v4 = unwind_protect_list;
if (!v4)
break;
unwind_protect_list = *(&v4->field_0);
if (v4->field_8) {
if (v4->field_8 != restore_variable)
*(((stack_base)[32] + 8))(v4->field_10);
else
restore_variable(&v4->field_10);
} else {
if (a0 && v4->field_10->field_0 == *(a0) && !strcmp(v4->field_10, a0)) {
if (g_400c2c >= g_400c28) {
v18 = sh_xfree(v4, "unwind_prot.c", 0x13c);
} else {
v17 = v4;
v2 = 32;
if (v2 <= 7) {
v19 = 0;
} else {
v19 = v2 - 1 >> 3;
v2 &= 7;
}
switch (v2) {
case 0:
while (true) {
v20 = v17;
v17 = &v17->padding_1;
v20->field_0 = 223;
LABEL_4008fe:
v21 = v17;
v17 = &v17->padding_1;
v21->field_0 = 223;
LABEL_400908:
v22 = v17;
v17 = &v17->padding_1;
v22->field_0 = 223;
LABEL_400912:
v23 = v17;
v17 = &v17->padding_1;
v23->field_0 = 223;
LABEL_40091c:
v24 = v17;
v17 = &v17->padding_1;
v24->field_0 = 223;
LABEL_400926:
v25 = v17;
v17 = &v17->padding_1;
v25->field_0 = 223;
LABEL_400930:
v26 = v17;
v17 = &v17->padding_1;
v26->field_0 = 223;
LABEL_40093a:
v27 = v17;
v17 = &v17->padding_1;
v27->field_0 = 223;
if (v19 <= 0)
break;
v19 -= 1;
}
case 1:
goto LABEL_40093a;
case 2:
goto LABEL_400930;
case 3:
goto LABEL_400926;
case 4:
goto LABEL_40091c;
case 5:
goto LABEL_400912;
case 6:
goto LABEL_400908;
case 7:
goto LABEL_4008fe;
}
tmp_15 = g_400c2c;
g_400c2c = g_400c2c + 1;
v28 = v4;
*((uwcache + tmp_15 * 8)) = v4;
}
v1 = 1;
break;
}
}
if (g_400c2c >= g_400c28) {
sh_xfree(v4, "unwind_prot.c", 0x149);
} else {
v7 = v4;
v3 = 32;
if (v3 > 7) {
v8 = v3 - 1 >> 3;
v3 &= 7;
} else {
v8 = 0;
}
switch (v3) {
case 0:
goto LABEL_400a50;
case 1:
goto LABEL_400a96;
case 2:
goto LABEL_400a8c;
case 3:
goto LABEL_400a82;
case 4:
goto LABEL_400a78;
case 5:
goto LABEL_400a6e;
case 6:
goto LABEL_400a64;
case 7:
while (true) {
v10 = v7;
v7 = &v7->padding_1;
v10->field_0 = 223;
LABEL_400a64:
v11 = v7;
v7 = &v7->padding_1;
v11->field_0 = 223;
LABEL_400a6e:
v12 = v7;
v7 = &v7->padding_1;
v12->field_0 = 223;
LABEL_400a78:
v13 = v7;
v7 = &v7->padding_1;
v13->field_0 = 223;
LABEL_400a82:
v14 = v7;
v7 = &v7->padding_1;
v14->field_0 = 223;
LABEL_400a8c:
v15 = v7;
v7 = &v7->padding_1;
v15->field_0 = 223;
LABEL_400a96:
v16 = v7;
v7 = &v7->padding_1;
v16->field_0 = 223;
if (v8 <= 0)
break;
v8 -= 1;
LABEL_400a50:
v9 = v7;
v7 = &v7->padding_1;
v9->field_0 = 223;
}
}
g_400c2c = g_400c2c + 1;
*((uwcache + g_400c2c * 8)) = v4;
}
}
if (a0 && !v1) {
v29 = gettext("unwind_frame_run: %s: frame not found");
v30 = internal_warning(v29, a0, v29);
}
return;
}
|
static void
dirlist_replace_prefix (const char *pref, const char *repl)
{
struct directory *dp;
size_t pref_len = strlen (pref);
size_t repl_len = strlen (repl);
for (dp = dirhead; dp; dp = dp->next)
replace_prefix (&dp->name, pref, pref_len, repl, repl_len);
}
| void dirlist_replace_prefix(char *a0, char *a1) {
unsigned long long *v0;
unsigned long long v1;
unsigned long long v2;
unsigned long long v4;
unsigned long long v5;
v1 = strlen(a0);
v2 = strlen(a1);
v4 = dirhead;
for (v0 = dirhead; v0; v0 = *(v0)) {
replace_prefix(v0 + 11, a0, v1, a1, v2);
v5 = *(v0);
}
return;
}
|
static int calc_chksums(journal_t *journal, struct buffer_head *bh,
unsigned long *next_log_block, __u32 *crc32_sum)
{
int i, num_blks, err;
unsigned long io_block;
struct buffer_head *obh;
num_blks = count_tags(journal, bh);
*crc32_sum = ext2fs_crc32_be((*crc32_sum), ((void *)bh->b_data), (bh->b_size));
for (i = 0; i < num_blks; i++) {
io_block = (*next_log_block)++;
do { unsigned long _wrap_last = jbd2_has_feature_fast_commit(journal) ? (journal)->j_fc_last : (journal)->j_last; if (*next_log_block >= _wrap_last) *next_log_block -= (_wrap_last - (journal)->j_first); } while (0);
err = jread(&obh, journal, io_block);
if (err) {
printf("" "JBD2: IO error %d recovering block "
"%lu in log\n", err, io_block);
return 1;
} else {
*crc32_sum = ext2fs_crc32_be((*crc32_sum), ((void *)obh->b_data), (obh->b_size))
;
}
brelse(obh);
}
return 0;
}
| undefined8 calc_chksums(long param_1,long param_2,ulong *param_3,undefined4 *param_4)
{
int iVar1;
undefined4 uVar2;
int iVar3;
uint uVar4;
undefined8 uVar5;
long in_FS_OFFSET;
int local_34;
long local_28;
ulong local_20;
ulong local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
iVar1 = count_tags(param_1,param_2);
uVar2 = ext2fs_crc32_be(*param_4,param_2 + 0x28,(long)*(int *)(param_2 + 0x10));
*param_4 = uVar2;
local_34 = 0;
do {
if (iVar1 <= local_34) {
uVar5 = 0;
LAB_00100781:
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar5;
}
local_20 = *param_3;
*param_3 = local_20 + 1;
iVar3 = jbd2_has_feature_fast_commit(param_1);
if (iVar3 == 0) {
local_18 = *(ulong *)(param_1 + 0x60);
}
else {
local_18 = *(ulong *)(param_1 + 0x48);
}
if (local_18 <= *param_3) {
*param_3 = *param_3 + (*(long *)(param_1 + 0x58) - local_18);
}
uVar4 = jread(&local_28,param_1,local_20 & 0xffffffff);
if (uVar4 != 0) {
printf("JBD2: IO error %d recovering block %lu in log\n",(ulong)uVar4,local_20);
uVar5 = 1;
goto LAB_00100781;
}
uVar2 = ext2fs_crc32_be(*param_4,local_28 + 0x28,(long)*(int *)(local_28 + 0x10));
*param_4 = uVar2;
brelse(local_28);
local_34 = local_34 + 1;
} while( true );
}
|
void
write_longdocs (stream, builtins)
FILE *stream;
ARRAY *builtins;
{
register int i;
register BUILTIN_DESC *builtin;
char *dname;
char *sarray[2];
for (i = 0; i < builtins->sindex; i++)
{
builtin = (BUILTIN_DESC *)builtins->array[i];
if (builtin->dependencies)
write_ifdefs (stream, builtin->dependencies->array);
dname = ((builtin)->docname ? (builtin)->docname : (builtin)->name);
fprintf (stream, "char * const %s_doc[] =", dname);
if (separate_helpfiles)
{
int l = strlen (helpfile_directory) + strlen (dname) + 1;
sarray[0] = (char *)xmalloc (l + 1);
sprintf (sarray[0], "%s/%s", helpfile_directory, dname);
sarray[1] = (char *)
((void *)0)
;
write_documentation (stream, sarray, 0, 0x01|0x08);
free (sarray[0]);
}
else
write_documentation (stream, builtin->longdoc->array, 0, 0x01);
if (builtin->dependencies)
write_endifs (stream, builtin->dependencies->array);
}
}
| void write_longdocs(void* a0, struct_0 *a1) {
unsigned int v0;
char *v1;
void* v2;
void* v3;
char v4;
void* v6;
struct_3 *v7;
char *v8;
unsigned long long *v9;
unsigned long long v10;
for (v6 = 0; v6 < a1->field_4; v6 = v6 + 1) {
v7 = *((a1->field_10 + 0x8 * v6));
if (*((*((a1->field_10 + 0x8 * v6)) + 40)))
write_ifdefs(a0, *((*((*((a1->field_10 + 0x8 * v6)) + 40)) + 16)));
if (v7->field_18)
v8 = v7->field_18;
else
v8 = v7->field_0;
v1 = v8;
fprintf(a0, "char * const %s_doc[] =", v1);
if (!separate_helpfiles) {
write_documentation(a0, v7->field_20->field_10, 0x0, 0x1);
} else {
v0 = (strlen(v1) + strlen(0xbc7d8948ec834853)) + 1;
v2 = xmalloc(v0 + 1);
sprintf(v2, "%s/%s", 3968026707, v1);
v3 = 0;
write_documentation(a0, &v2, 0x0, 0x9);
free(v2);
}
if (v7->field_28)
write_endifs(a0, v7->field_28->field_10);
}
v10 = *(&v4) ^ v9[5];
return;
}
|
static
FILE* fopen_output_safely ( Char* name, const char* mode )
{
FILE* fp;
IntNative fh;
fh = open(name,
01
|
0100
|
0200
,
0200
|
0400
);
if (fh == -1) return
((void *)0)
;
fp = fdopen(fh, mode);
if (fp ==
((void *)0)
) close(fh);
return fp;
}
| int fopen_output_safely(char *a0, char *a1) {
unsigned int v0;
unsigned long v1;
unsigned int v3;
v0 = open(a0, 0xc1, 0x180);
if (v0 == -1) {
v3 = 0;
return v3;
}
v1 = fdopen(v0, a1);
if (!v1)
close(v0);
v3 = v1;
return v3;
}
|
char *
find_dir_file_pathname (char const *dir, char const *file)
{
char const * match = file;
char *val;
struct dirdata dirdata;
dirdata.names =
((void *)0)
;
dirdata.data =
((void *)0)
;
if (ignore_file_name_case)
{
struct file_data filedata;
filedata.name = dir;
filedata.desc = 0;
if (dir_read (&filedata, &dirdata))
{
locale_specific_sorting =
1
;
if (
_setjmp (
failed_locale_specific_sorting
)
)
match = file;
else
{
for (char const **p = dirdata.names; *p; p++)
if (compare_names (*p, file) == 0)
{
if (strcmp (*p, file) == 0)
{
match = *p;
break;
}
if (match == file)
match = *p;
}
}
}
}
val = file_name_concat (dir, match,
((void *)0)
);
free (dirdata.names);
free (dirdata.data);
return val;
}
| undefined8 find_dir_file_pathname(undefined8 param_1,char *param_2)
{
char cVar1;
int iVar2;
undefined8 uVar3;
long in_FS_OFFSET;
char *local_180;
char **local_178;
undefined local_168 [8];
char **local_160;
void *local_158;
undefined4 local_148 [2];
undefined8 local_140;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_160 = (char **)0x0;
local_158 = (void *)0x0;
local_180 = param_2;
if (ignore_file_name_case != '\0') {
local_148[0] = 0;
local_140 = param_1;
cVar1 = dir_read(local_148,local_168);
if (cVar1 != '\0') {
locale_specific_sorting = 1;
iVar2 = _setjmp((__jmp_buf_tag *)failed_locale_specific_sorting);
if (iVar2 == 0) {
for (local_178 = local_160; *local_178 != (char *)0x0; local_178 = local_178 + 1) {
iVar2 = compare_names(*local_178,param_2);
if (iVar2 == 0) {
iVar2 = strcmp(*local_178,param_2);
if (iVar2 == 0) {
local_180 = *local_178;
break;
}
if (local_180 == param_2) {
local_180 = *local_178;
}
}
}
}
}
}
uVar3 = file_name_concat(param_1,local_180,0);
free(local_160);
free(local_158);
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return uVar3;
}
__stack_chk_fail();
}
|
static
_Bool
dump_dir (struct tar_stat_info *st)
{
char *directory = get_directory_entries (st);
if (! directory)
{
savedir_diag (st->orig_file_name);
return
0
;
}
dump_dir0 (st, directory);
restore_parent_fd (st);
free (directory);
return
1
;
}
| int dump_dir(unsigned long long *a0, unsigned int a1, unsigned int a2, unsigned long long a3) {
void* v0;
unsigned int v2;
v0 = get_directory_entries(a0);
if (!v0) {
savedir_diag(*(a0));
v2 = 0;
} else {
dump_dir0(a0, v0);
restore_parent_fd(a0, a1, a2, a3);
free(v0);
v2 = 1;
}
return v2;
}
|
static int
key_id_cmp(struct revoked_key_id *a, struct revoked_key_id *b)
{
return strcmp(a->key_id, b->key_id);
}
| int key_id_cmp(unsigned long long *a0, unsigned long long *a1) {
return strcmp(*(a0), *(a1));
}
|
void
close_fd_bitmap (fdbp)
struct fd_bitmap *fdbp;
{
register int i;
if (fdbp)
{
for (i = 0; i < fdbp->size; i++)
if (fdbp->bitmap[i])
{
close (i);
fdbp->bitmap[i] = 0;
}
}
}
| long long close_fd_bitmap(struct_0 *a0) {
void* v1;
if (a0) {
for (v1 = 0; v1 < a0->field_0; v1 = v1 + 1) {
if (*(v1 + a0->field_8)) {
close(v1);
*(v1 + a0->field_8) = 0;
}
}
}
return a0->field_0;
}
|
static void
print_for_command (for_command)
FOR_COM *for_command;
{
print_for_command_head (for_command);
cprintf (";");
newline ("do\n");
indentation += indentation_amount;
make_command_string_internal (for_command->action);
do { if (deferred_heredocs) print_deferred_heredocs (""); } while (0);
semicolon ();
indentation -= indentation_amount;
newline ("done");
}
| void print_for_command(struct_0 *a0) {
unsigned long long v1;
print_for_command_head(a0);
cprintf(";");
newline("do\n");
indentation = indentation_amount + indentation;
make_command_string_internal(a0->field_18);
if (deferred_heredocs)
print_deferred_heredocs(&g_403583);
semicolon();
indentation = indentation - indentation_amount;
v1 = newline("done");
return;
}
|
static void usage (int status)
{
FILE *usageout = (0 != status) ?
stderr
:
stdout
;
(void) fprintf (usageout,
gettext ("Usage: %s [options] LOGIN\n" " %s -D\n" " %s -D [options]\n" "\n" "Options:\n")
,
Prog, Prog, Prog);
(void) fputs (gettext (" --badname do not check for bad names\n"), usageout);
(void) fputs (gettext (" -b, --base-dir BASE_DIR base directory for the home directory of the\n" " new account\n")
, usageout);
(void) fputs (gettext (" --btrfs-subvolume-home use BTRFS subvolume for home directory\n"), usageout);
(void) fputs (gettext (" -c, --comment COMMENT GECOS field of the new account\n"), usageout);
(void) fputs (gettext (" -d, --home-dir HOME_DIR home directory of the new account\n"), usageout);
(void) fputs (gettext (" -D, --defaults print or change default useradd configuration\n"), usageout);
(void) fputs (gettext (" -e, --expiredate EXPIRE_DATE expiration date of the new account\n"), usageout);
(void) fputs (gettext (" -f, --inactive INACTIVE password inactivity period of the new account\n"), usageout);
(void) fputs (gettext (" -F, --add-subids-for-system add entries to sub[ud]id even when adding a system user\n"), usageout);
(void) fputs (gettext (" -g, --gid GROUP name or ID of the primary group of the new\n" " account\n")
, usageout);
(void) fputs (gettext (" -G, --groups GROUPS list of supplementary groups of the new\n" " account\n")
, usageout);
(void) fputs (gettext (" -h, --help display this help message and exit\n"), usageout);
(void) fputs (gettext (" -k, --skel SKEL_DIR use this alternative skeleton directory\n"), usageout);
(void) fputs (gettext (" -K, --key KEY=VALUE override /etc/login.defs defaults\n"), usageout);
(void) fputs (gettext (" -l, --no-log-init do not add the user to the lastlog and\n" " faillog databases\n")
, usageout);
(void) fputs (gettext (" -m, --create-home create the user's home directory\n"), usageout);
(void) fputs (gettext (" -M, --no-create-home do not create the user's home directory\n"), usageout);
(void) fputs (gettext (" -N, --no-user-group do not create a group with the same name as\n" " the user\n")
, usageout);
(void) fputs (gettext (" -o, --non-unique allow to create users with duplicate\n" " (non-unique) UID\n")
, usageout);
(void) fputs (gettext (" -p, --password PASSWORD encrypted password of the new account\n"), usageout);
(void) fputs (gettext (" -r, --system create a system account\n"), usageout);
(void) fputs (gettext (" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
(void) fputs (gettext (" -P, --prefix PREFIX_DIR prefix directory where are located the /etc/* files\n"), usageout);
(void) fputs (gettext (" -s, --shell SHELL login shell of the new account\n"), usageout);
(void) fputs (gettext (" -u, --uid UID user ID of the new account\n"), usageout);
(void) fputs (gettext (" -U, --user-group create a group with the same name as the user\n"), usageout);
(void) fputs ("\n", usageout);
exit (status);
}
| void usage(unsigned long a0) {
void* v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned long v5;
unsigned long v6;
unsigned long v7;
v3 = v5;
v2 = v6;
v1 = v7;
*(&v0) = (!a0 ? stderr : stdout);
fprintf(v0, gettext("Usage: %s [options] LOGIN\n %s -D\n %s -D [options]\n\nOptions:\n"));
fputs(gettext(" --badname do not check for bad names\n"), v0);
fputs(gettext(" -b, --base-dir BASE_DIR base directory for the home directory of the\n new account\n"), v0);
fputs(gettext(" --btrfs-subvolume-home use BTRFS subvolume for home directory\n"), v0);
fputs(gettext(" -c, --comment COMMENT GECOS field of the new account\n"), v0);
fputs(gettext(" -d, --home-dir HOME_DIR home directory of the new account\n"), v0);
fputs(gettext(" -D, --defaults print or change default useradd configuration\n"), v0);
fputs(gettext(" -e, --expiredate EXPIRE_DATE expiration date of the new account\n"), v0);
fputs(gettext(" -f, --inactive INACTIVE password inactivity period of the new account\n"), v0);
fputs(gettext(" -F, --add-subids-for-system add entries to sub[ud]id even when adding a system user\n"), v0);
fputs(gettext(" -g, --gid GROUP name or ID of the primary group of the new\n account\n"), v0);
fputs(gettext(" -G, --groups GROUPS list of supplementary groups of the new\n account\n"), v0);
fputs(gettext(" -h, --help display this help message and exit\n"), v0);
fputs(gettext(" -k, --skel SKEL_DIR use this alternative skeleton directory\n"), v0);
fputs(gettext(" -K, --key KEY=VALUE override /etc/login.defs defaults\n"), v0);
fputs(gettext(" -l, --no-log-init do not add the user to the lastlog and\n faillog databases\n"), v0);
fputs(gettext(" -m, --create-home create the user's home directory\n"), v0);
fputs(gettext(" -M, --no-create-home do not create the user's home directory\n"), v0);
fputs(gettext(" -N, --no-user-group do not create a group with the same name as\n the user\n"), v0);
fputs(gettext(" -o, --non-unique allow to create users with duplicate\n (non-unique) UID\n"), v0);
fputs(gettext(" -p, --password PASSWORD encrypted password of the new account\n"), v0);
fputs(gettext(" -r, --system create a system account\n"), v0);
fputs(gettext(" -R, --root CHROOT_DIR directory to chroot into\n"), v0);
fputs(gettext(" -P, --prefix PREFIX_DIR prefix directory where are located the /etc
}
|
static WORD_LIST *
quote_list (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_string (t);
if (*t == 0)
w->word->flags |= (1 << 18);
w->word->flags |= (1 << 1);
sh_xfree((t), "subst.c", 4932);
}
return list;
}
| int quote_list(unsigned long long a0) {
char *v0;
struct_0 *v2;
for (v2 = a0; v2; v2 = v2->field_0) {
v0 = v2->field_8->field_0;
v2->field_8->field_0 = quote_string(v0);
if (!*(v0))
v2->field_8->field_8 = v2->field_8->field_8 | 0x40000;
v2->field_8->field_8 = v2->field_8->field_8 | 2;
sh_xfree(v0, "subst.c", 0x1344);
}
return a0;
}
|
static int ipaddrlabel_modify(int cmd, int argc, char **argv)
{
struct {
struct nlmsghdr n;
struct ifaddrlblmsg ifal;
char buf[1024];
} req = {
.n.nlmsg_type = cmd,
.n.nlmsg_len = ((sizeof(struct ifaddrlblmsg)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))),
.n.nlmsg_flags = 0x01,
.ifal.ifal_family = preferred_family,
};
inet_prefix prefix = {};
uint32_t label = 0xffffffffUL;
char *p =
((void *)0)
;
char *l =
((void *)0)
;
if (cmd == RTM_NEWADDRLABEL) {
req.n.nlmsg_flags |= 0x400|0x200;
}
while (argc > 0) {
if (strcmp(*argv, "prefix") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
p = *argv;
get_prefix(&prefix, *argv, preferred_family);
} else if (strcmp(*argv, "dev") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if ((req.ifal.ifal_index = ll_name_to_index(*argv)) == 0)
invarg("dev is invalid\n", *argv);
} else if (strcmp(*argv, "label") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
l = *argv;
if (get_u32(&label, *argv, 0) || label == 0xffffffffUL)
invarg("label is invalid\n", *argv);
}
argc--;
argv++;
}
if (p ==
((void *)0)
) {
fprintf(
stderr
, "Not enough information: \"prefix\" argument is required.\n");
return -1;
}
if (l ==
((void *)0)
) {
fprintf(
stderr
, "Not enough information: \"label\" argument is required.\n");
return -1;
}
addattr32(&req.n, sizeof(req), IFAL_LABEL, label);
addattr_l(&req.n, sizeof(req), IFAL_ADDRESS, &prefix.data, prefix.bytelen);
req.ifal.ifal_prefixlen = prefix.bitlen;
if (req.ifal.ifal_family ==
0
)
req.ifal.ifal_family =
10
;
if (rtnl_talk(&rth, &req.n,
((void *)0)
) < 0)
return -2;
return 0;
}
| void ipaddrlabel_modify(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned long long *v0;
int tmp_13;
unsigned int v1;
unsigned int v2;
unsigned int v3;
void* v4;
void* v5;
char v6;
char v7;
void* v8;
unsigned short v9;
unsigned short v10;
char v11;
char v12;
unsigned int v13;
unsigned long long v15;
void* v16;
unsigned long v17;
unsigned long long *v18;
unsigned long long v19;
unsigned long long v20;
unsigned long long v22;
unsigned long long v25;
unsigned long long v26;
unsigned long long v28;
void* v29;
v2 = a0;
v1 = a1;
v0 = a2;
v15 = 131;
for (v16 = &v8; v15; v16 += v17 * 8) {
v15 -= 1;
v8 = 0;
}
*(v16) = 0;
v8 = 28;
v9 = v2;
v10 = 1;
v11 = preferred_family;
v19 = 33;
for (v18 = &v6; v19; v18 = &v18[v17]) {
v19 -= 1;
v6 = 0;
}
v3 = -1;
v4 = 0;
v5 = 0;
if (v2 == 72) {
v20 = v10;
*(&v20) = (v10 >> 8) | 6;
tmp_13 = v20;
v10 = tmp_13;
}
for (; v1 > 0; v0 += 1) {
if (!strcmp(*(v0), "prefix")) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v4 = *(v0);
get_prefix(&v6, *(v0), preferred_family, *(v0));
} else {
v22 = strcmp(*(v0), "dev");
if (!v22) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v13 = ll_name_to_index(*(v0));
if (!v13)
invarg("dev is invalid\n", *(v0));
}
if ((!v13 || v22) && !strcmp(*(v0), "label")) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v5 = *(v0);
if (v3 == -1 || get_u32(&v3, *(v0), 0x0, *(v0)))
invarg("label is invalid\n", *(v0));
}
}
v1 -= 1;
}
if (!v4) {
fprintf(*(&stderr), "Not enough information: \"prefix\" argument is required.\n");
v25 = 4294967295;
} else if (!v5) {
fprintf(*(&stderr), "Not enough information: \"label\" argument is required.\n");
v26 = 4294967295;
} else {
addattr32(&v8, 0x41c, 0x2, v3);
addattr_l(&v8, 0x41c, 0x1, &v7, *((&v6 + 2)));
v12 = *((&v6 + 4));
if (!v11)
v11 = 10;
if (rtnl_talk(0x500070, &v8, 0x0) < 0)
v28 = 4294967294;
else
v29 = 0;
}
return;
}
|
int
rl_vi_insert_beg (int count, int key)
{
rl_beg_of_line (1, key);
rl_vi_insert_mode (1, key);
return (0);
}
| long long rl_vi_insert_beg(unsigned long a0, unsigned long a1, unsigned int a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
v0 = a0;
rl_beg_of_line(0x1, a1);
rl_vi_insert_mode(0x1, a1, a2, a3, a4, a5);
return 0;
}
|
void
usage (FILE *out, int status)
{
const char str[] =
"gnutls-serv - GnuTLS server\n"
"Usage: gnutls-serv [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \n"
"\n"
"None:\n"
"\n"
" -d, --debug=num Enable debugging\n"
" - it must be in the range:\n"
" 0 to 9999\n"
" --sni-hostname=str Server's hostname for server name extension\n"
" --sni-hostname-fatal Send fatal alert on sni-hostname mismatch\n"
" --alpn=str Specify ALPN protocol to be enabled by the server\n"
" --alpn-fatal Send fatal alert on non-matching ALPN name\n"
" --noticket Don't accept session tickets\n"
" --earlydata Accept early data\n"
" --maxearlydata=num The maximum early data size to accept\n"
" - it must be in the range:\n"
" 1 to 2147483648\n"
" --nocookie Don't require cookie on DTLS sessions\n"
" -g, --generate Generate Diffie-Hellman parameters\n"
" -q, --quiet Suppress some messages\n"
" --nodb Do not use a resumption database\n"
" --http Act as an HTTP server\n"
" --echo Act as an Echo server\n"
" --crlf Do not replace CRLF by LF in Echo server mode\n"
" -u, --udp Use DTLS (datagram TLS) over UDP\n"
" --mtu=num Set MTU for datagram TLS\n"
" - it must be in the range:\n"
" 0 to 17000\n"
" --srtp-profiles=str Offer SRTP profiles\n"
" -a, --disable-client-cert Do not request a client certificate\n"
" - prohibits the option 'require-client-cert'\n"
" -r, --require-client-cert Require a client certificate\n"
" --verify-client-cert If a client certificate is sent then verify it\n"
" --compress-cert=str Compress certificate\n"
" -b, --heartbeat Activate heartbeat support\n"
" --x509fmtder Use DER format for certificates to read from\n"
" --priority=str Priorities string\n"
" --dhparams=file DH params file to use\n"
" - file must pre-exist\n"
" --x509cafile=str Certificate file or PKCS #11 URL to use\n"
" --x509crlfile=file CRL file to use\n"
" - file must pre-exist\n"
" --x509keyfile=str X.509 key file or PKCS #11 URL to use\n"
" --x509certfile=str X.509 Certificate file or PKCS #11 URL to use\n"
" --rawpkkeyfile=str Private key file (PKCS #8 or PKCS #12) or PKCS #11 URL to use\n"
" --rawpkfile=str Raw public-key file to use\n"
" - requires the option 'rawpkkeyfile'\n"
" --srppasswd=file SRP password file to use\n"
" - file must pre-exist\n"
" --srppasswdconf=file SRP password configuration file to use\n"
" - file must pre-exist\n"
" --pskpasswd=file PSK password file to use\n"
" - file must pre-exist\n"
" --pskhint=str PSK identity hint to use\n"
" --ocsp-response=str The OCSP response to send to client\n"
" --ignore-ocsp-response-errors Ignore any errors when setting the OCSP response\n"
" -p, --port=num The port to connect to\n"
" -l, --list Print a list of the supported algorithms and modes\n"
" --provider=file Specify the PKCS #11 provider library\n"
" - file must pre-exist\n"
" --keymatexport=str Label used for exporting keying material\n"
" --keymatexportsize=num Size of the exported keying material\n"
" --recordsize=num The maximum record size to advertise\n"
" - it must be in the range:\n"
" 0 to 16384\n"
" --httpdata=file The data used as HTTP response\n"
" - file must pre-exist\n"
"\n"
"Version, usage and configuration options:\n"
"\n"
" -v, --version[=arg] output version information and exit\n"
" -h, --help display extended usage information and exit\n"
" -!, --more-help extended usage information passed thru pager\n"
"\n"
"Options are specified by doubled hyphens and their name or by a single\n"
"hyphen and the flag character.\n"
"\n"
"Server program that listens to incoming TLS connections.\n"
"\n"
"Please send bug reports to: <bugs@gnutls.org>\n"
"\n";
fprintf (out, "%s", str);
exit (status);
}
| void usage(void* a0, unsigned long a1) {
unsigned int v0;
void* v1;
char v2;
unsigned long v3;
unsigned long long *v5;
unsigned long long v6;
unsigned long long v7;
unsigned long v8;
void* v9;
v1 = a0;
v0 = a1;
v3 = v5[5];
v6 = 488;
v9 = &v2;
for (v7 = "gnutls-serv - GnuTLS server\nUsage: gnutls-serv [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \n\nNone:\n\n -d, --debug=num Enable debugging\n\t\t\t\t- it must be in the range:\n\t\t\t\t 0 to 9999\n --sni-hostname=str Server's hostname for server name extension\n --sni-hostname-fatal Send fatal alert on sni-hostname mismatch\n --alpn=str Specify ALPN protocol to be enabled by the server\n --alpn-fatal Send fatal alert on non-matching ALPN name\n --noticket Don't accept session tickets\n --earlydata Accept early data\n --maxearlydata=num The maximum early data size to accept\n\t\t\t\t- it must be in the range:\n\t\t\t\t 1 to 2147483648\n --nocookie Don't require cookie on DTLS sessions\n -g, --generate Generate Diffie-Hellman parameters\n -q, --quiet Suppress some messages\n --nodb Do not use a resumption database\n --http Act as an HTTP server"; v6; v7 += v8 * 8) {
v6 -= 1;
v2 = *(v7);
v9 += v8 * 8;
}
*(v9) = *(v7);
fprintf(v1, "%s", &v2);
exit(v0);
}
|
static errcode_t e2fsck_write_all_quotas(e2fsck_t ctx)
{
struct problem_context pctx;
enum quota_type qtype;
if (!ext2fs_has_feature_quota(ctx->fs->super))
return 0;
clear_problem_context(&pctx);
for (qtype = 0 ; qtype < MAXQUOTAS; qtype++) {
pctx.num = qtype;
pctx.errcode = quota_write_inode(ctx->qctx, 1 << qtype);
if (pctx.errcode) {
fix_problem(ctx, 0x060006, &pctx);
break;
}
}
quota_release_context(&ctx->qctx);
return pctx.errcode;
}
| long e2fsck_write_all_quotas(long *param_1)
{
int iVar1;
long lVar2;
long in_FS_OFFSET;
uint local_7c;
long local_78 [10];
ulong local_28;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
iVar1 = ext2fs_has_feature_quota(*(undefined8 *)(*param_1 + 0x20));
if (iVar1 == 0) {
lVar2 = 0;
}
else {
clear_problem_context(local_78);
for (local_7c = 0; local_7c < 3; local_7c = local_7c + 1) {
local_28 = (ulong)local_7c;
local_78[0] = quota_write_inode(param_1[0x4f],1 << ((byte)local_7c & 0x1f));
if (local_78[0] != 0) {
fix_problem(param_1,0x60006,local_78);
break;
}
}
quota_release_context(param_1 + 0x4f);
lVar2 = local_78[0];
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return lVar2;
}
|
static void
get_reldate (struct timespec *result,
char const *flex_date, struct timespec const *now)
{
if (! parse_datetime (result, flex_date, now))
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"invalid date format %s\"), quote (flex_date)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("invalid date format %s"), quote (flex_date)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("invalid date format %s"), quote (flex_date)), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
}
| void get_reldate(undefined8 param_1,undefined8 param_2,undefined8 param_3)
{
char cVar1;
undefined8 uVar2;
undefined8 uVar3;
cVar1 = parse_datetime(param_1,param_2,param_3);
if (cVar1 != '\x01') {
uVar2 = quote(param_2);
uVar3 = gettext("invalid date format %s");
error(1,0,uVar3,uVar2);
}
return;
}
|
static int
fallback_stat (const char *name, struct stat *p, int prev_rv)
{
switch (
(*__errno_location ())
)
{
case
2
:
case
20
:
if (options.debug_options & DebugStat)
fprintf(
stderr
, "fallback_stat(): stat(%s) failed; falling back on lstat()\n", name);
return fstatat(state.cwd_dir_fd, name, p,
0x100
);
case
13
:
case
5
:
case
40
:
case
36
:
case
75
:
default:
return prev_rv;
}
}
| int fallback_stat(char *param_1,stat *param_2,int param_3)
{
int *piVar1;
piVar1 = __errno_location();
if ((*piVar1 == 2) || (*piVar1 == 0x14)) {
if ((___stack_chk_fail & 2) != 0) {
fprintf(stderr,"fallback_stat(): stat(%s) failed; falling back on lstat()\n",param_1);
}
param_3 = fstatat(_error,param_1,param_2,0x100);
}
return param_3;
}
|
static void alarm_handler(int signo)
{
benchmark_must_finish = 1;
}
| long long alarm_handler(unsigned long a0) {
unsigned int v0;
unsigned long v2;
v0 = a0;
benchmark_must_finish = 1;
return v2;
}
|
static int
check_allowed_keys_line(const char *path, u_long linenum, char *line,
const struct sshkey *sign_key, const char *principal,
const char *sig_namespace, uint64_t verify_time, char **principalsp)
{
struct sshkey *found_key =
((void *)0)
;
char *principals =
((void *)0)
;
int r, success = 0;
const char *reason =
((void *)0)
;
struct sshsigopt *sigopts =
((void *)0)
;
char tvalid[64], tverify[64];
if (principalsp !=
((void *)0)
)
*principalsp =
((void *)0)
;
if ((r = parse_principals_key_and_options(path, linenum, line,
principal, &principals, &found_key, &sigopts)) != 0) {
goto done;
}
if (!sigopts->ca && sshkey_equal(found_key, sign_key)) {
sshlog("sshsig.c", __func__, 901, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "%s:%lu: matched key", path, linenum);
} else if (sigopts->ca && sshkey_is_cert(sign_key) &&
sshkey_equal_public(sign_key->cert->signature_key, found_key)) {
if (principal) {
if ((r = sshkey_cert_check_authority(sign_key, 0, 1, 0,
verify_time, principal, &reason)) != 0) {
sshlog("sshsig.c", __func__, 908, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s:%lu: certificate not authorized: %s", path, linenum, reason)
;
goto done;
}
sshlog("sshsig.c", __func__, 912, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "%s:%lu: matched certificate CA key", path, linenum)
;
} else {
if ((r = cert_filter_principals(path, linenum,
&principals, sign_key, verify_time)) != 0) {
sshlog("sshsig.c", __func__, 919, 0, SYSLOG_LEVEL_DEBUG1, ssh_err(r), "%s:%lu: cert_filter_principals", path, linenum)
;
goto done;
}
sshlog("sshsig.c", __func__, 923, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "%s:%lu: matched certificate CA key", path, linenum)
;
}
} else {
goto done;
}
if (sigopts->namespaces !=
((void *)0)
&& sig_namespace !=
((void *)0)
&&
match_pattern_list(sig_namespace, sigopts->namespaces, 0) != 1) {
sshlog("sshsig.c", __func__, 934, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s:%lu: key is not permitted for use in signature " "namespace \"%s\"", path, linenum, sig_namespace)
;
goto done;
}
format_absolute_time((uint64_t)verify_time, tverify, sizeof(tverify));
if (sigopts->valid_after != 0 &&
(uint64_t)verify_time < sigopts->valid_after) {
format_absolute_time(sigopts->valid_after,
tvalid, sizeof(tvalid));
sshlog("sshsig.c", __func__, 945, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s:%lu: key is not yet valid: " "verify time %s < valid-after %s", path, linenum, tverify, tvalid)
;
goto done;
}
if (sigopts->valid_before != 0 &&
(uint64_t)verify_time > sigopts->valid_before) {
format_absolute_time(sigopts->valid_before,
tvalid, sizeof(tvalid));
sshlog("sshsig.c", __func__, 954, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s:%lu: key has expired: " "verify time %s > valid-before %s", path, linenum, tverify, tvalid)
;
goto done;
}
success = 1;
done:
if (success && principalsp !=
((void *)0)
) {
*principalsp = principals;
principals =
((void *)0)
;
}
free(principals);
sshkey_free(found_key);
sshsigopt_free(sigopts);
return success ? 0 : -46;
}
| long check_allowed_keys_line(
const char *a1,
long a2,
const char *a3,
long a4,
const char *a5,
const char *a6,
unsigned long a7,
void **a8)
{
long v8;
int v13;
unsigned int v14;
long v15;
void *ptr;
const char *v17;
void **v18;
char v19[64];
char v20[72];
unsigned long v21;
v21 = __readfsqword(0x28u);
v15 = 0LL;
ptr = 0LL;
v13 = 0;
v17 = 0LL;
v18 = 0LL;
if ( a8 )
*a8 = 0LL;
if ( !(unsigned int)parse_principals_key_and_options(a1, a2, a3, a5, &ptr, &v15, &v18) )
{
if ( *(_DWORD *)v18 || !(unsigned int)sshkey_equal(v15, a4) )
{
if ( !*(_DWORD *)v18
|| !(unsigned int)sshkey_is_cert(a4)
|| !(unsigned int)sshkey_equal_public(*(_QWORD *)(*(_QWORD *)(a4 + 128) + 80LL), v15) )
{
goto LABEL_28;
}
if ( a5 )
{
if ( (unsigned int)sshkey_cert_check_authority(a4, 0LL, 1LL, 0LL, a7, a5, &v17) )
{
sshlog(
"sshsig.c",
"check_allowed_keys_line",
908LL,
0LL,
2LL,
0LL,
"%s:%lu: certificate not authorized: %s",
a1,
a2,
v17);
goto LABEL_28;
}
sshlog(
"sshsig.c",
"check_allowed_keys_line",
912LL,
0LL,
5LL,
0LL,
"%s:%lu: matched certificate CA key",
a1,
a2);
}
else
{
v14 = cert_filter_principals(a1, a2, (char **)&ptr, a4, a7);
if ( v14 )
{
v8 = ssh_err(v14);
sshlog("sshsig.c", "check_allowed_keys_line", 919LL, 0LL, 5LL, v8, "%s:%lu: cert_filter_principals", a1, a2);
goto LABEL_28;
}
sshlog(
"sshsig.c",
"check_allowed_keys_line",
923LL,
0LL,
5LL,
0LL,
"%s:%lu: matched certificate CA key",
a1,
a2);
}
}
else
{
sshlog("sshsig.c", "check_allowed_keys_line", 901LL, 0LL, 5LL, 0LL, "%s:%lu: matched key", a1, a2);
}
if ( v18[1] && a6 && (unsigned int)match_pattern_list(a6, v18[1], 0LL) != 1 )
{
sshlog(
"sshsig.c",
"check_allowed_keys_line",
934LL,
0LL,
2LL,
0LL,
"%s:%lu: key is not permitted for use in signature namespace \"%s\"",
a1,
a2,
a6);
}
else
{
format_absolute_time(a7, v20, 64LL);
if ( v18[2] && a7 < (unsigned long)v18[2] )
{
format_absolute_time(v18[2], v19, 64LL);
sshlog(
"sshsig.c",
"check_allowed_keys_line",
945LL,
0LL,
2LL,
0LL,
"%s:%lu: key is not yet valid: verify time %s < valid-after %s",
a1,
a2,
v20,
v19);
}
else if ( v18[3] && a7 > (unsigned long)v18[3] )
{
format_absolute_time(v18[3], v19, 64LL);
sshlog(
"sshsig.c",
"check_allowed_keys_line",
954LL,
0LL,
2LL,
0LL,
"%s:%lu: key has expired: verify time %s > valid-before %s",
a1,
a2,
v20,
v19);
}
else
{
v13 = 1;
}
}
}
LABEL_28:
if ( v13 && a8 )
{
*a8 = ptr;
ptr = 0LL;
}
free(ptr);
sshkey_free(v15);
sshsigopt_free(v18);
if ( v13 )
return 0LL;
else
return 4294967250LL;
}
|
char *
match_filter_allowlist(const char *proposal, const char *filter)
{
return filter_list(proposal, filter, 0);
}
| void match_filter_allowlist(undefined8 param_1,undefined8 param_2)
{
filter_list(param_1,param_2,0);
return;
}
|
static void
suspchild(int signo)
{
if (sshpid > 1) {
kill(sshpid, signo);
while (waitpid(sshpid,
((void *)0)
,
2
) == -1 &&
(*__errno_location ())
==
4
)
continue;
}
kill(getpid(),
19
);
}
| long long suspchild(unsigned long a0) {
if (sshpid <= 1)
return kill(getpid(), 0x13);
kill(sshpid, a0);
while (true) {
if (waitpid(sshpid, NULL, 0x2) != -1) {
return kill(getpid(), 0x13);
} else if (*(__errno_location()) != 4) {
return kill(getpid(), 0x13);
}
}
}
|
static
_Bool
unquote (char const *s, struct E_string *es)
{
size_t len = strlen (s);
es->s = xmalloc (len);
es->escaped = xcalloc (len, sizeof es->escaped[0]);
unsigned int j = 0;
for (unsigned int i = 0; s[i]; i++)
{
unsigned char c;
int oct_digit;
switch (s[i])
{
case '\\':
es->escaped[j] =
1
;
switch (s[i + 1])
{
case '\\':
c = '\\';
break;
case 'a':
c = '\a';
break;
case 'b':
c = '\b';
break;
case 'f':
c = '\f';
break;
case 'n':
c = '\n';
break;
case 'r':
c = '\r';
break;
case 't':
c = '\t';
break;
case 'v':
c = '\v';
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
c = s[i + 1] - '0';
oct_digit = s[i + 2] - '0';
if (0 <= oct_digit && oct_digit <= 7)
{
c = 8 * c + oct_digit;
++i;
oct_digit = s[i + 2] - '0';
if (0 <= oct_digit && oct_digit <= 7)
{
if (8 * c + oct_digit < N_CHARS)
{
c = 8 * c + oct_digit;
++i;
}
else
{
error (0, 0, gettext ("warning: the ambiguous octal escape \\%c%c%c is being\n\tinterpreted as the 2-byte sequence \\0%c%c, %c")
,
s[i], s[i + 1], s[i + 2],
s[i], s[i + 1], s[i + 2]);
}
}
}
break;
case '\0':
error (0, 0, gettext ("warning: an unescaped backslash " "at end of string is not portable")
);
es->escaped[j] =
0
;
i--;
c = '\\';
break;
default:
c = s[i + 1];
break;
}
++i;
es->s[j++] = c;
break;
default:
es->s[j++] = s[i];
break;
}
}
es->len = j;
return
1
;
}
| int unquote(char *a0, unsigned long long a1[3]) {
unsigned long v0;
int tmp_22;
int tmp_28;
unsigned long v1;
unsigned long v2;
unsigned int v3;
char v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned long long v8;
unsigned long long v10;
v8 = strlen(a0);
v10 = xmalloc(v8);
a1[0] = v10;
a1[1] = xcalloc(v8, 0x1, v10);
v5 = 0;
v6 = 0;
while (true) {
switch (a0[v6]) {
case 0:
a1[2] = v5;
return 1;
case 92:
*((v5 + a1[1])) = 1;
if (!a0[1 + v6]) {
error(0x0, 0x0, gettext("warning: an unescaped backslash at end of string is not portable"));
*((v5 + a1[1])) = 0;
v6 -= 1;
v4 = 92;
break;
} else if (a0[1 + v6] < 0) {
v4 = a0[1 + v6];
break;
} else if (a0[1 + v6] > 118) {
v4 = a0[1 + v6];
break;
} else if (a0[1 + v6] < 48) {
v4 = a0[1 + v6];
break;
} else {
switch (a0[1 + v6]) {
case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55:
v4 = a0[1 + v6] - 48;
v7 = a0[2 + v6] - 48;
if (v7 >= 0 && v7 <= 7) {
v4 = (v4 * 8) + v7;
v6 += 1;
v7 = a0[2 + v6] - 48;
if (v7 >= 0 && v7 <= 7) {
if (v7 + (v4 << 3) <= 255) {
v4 = (v4 * 8) + v7;
v6 += 1;
} else {
v3 = a0[2 + v6];
v2 = a0[2 + v6];
v1 = a0[1 + v6];
v0 = a0[v6];
error(0x0, 0x0, gettext("warning: the ambiguous octal escape \\%c%c%c is being\n\tinterpreted as the 2-byte sequence \\0%c%c, %c"));
}
}
}
break;
case 92:
v4 = 92;
break;
case 97:
v4 = 7;
break;
case 98:
v4 = 8;
break;
case 102:
v4 = 12;
break;
case 110:
v4 = 10;
break;
case 114:
v4 = 13;
break;
case 116:
v4 = 9;
break;
case 118:
v4 = 11;
break;
default:
v4 = a0[1 + v6];
break;
}
}
v6 += 1;
tmp_22 = v5;
v5 += 1;
*((a1[0] + tmp_22)) = v4;
v6 += 1;
continue;
default:
tmp_28 = v5;
v5 += 1;
*((a1[0] + tmp_28)) = a0[v6];
v6 += 1;
continue;
}
}
}
|
SHELL_VAR *
convert_var_to_array (var)
SHELL_VAR *var;
{
char *oldval;
ARRAY *array;
oldval = ((var)->value);
array = array_create ();
if (oldval)
array_insert (array, 0, oldval);
do { if (((var)->value)) sh_xfree((((var)->value)), "arrayfunc.c", 88); } while (0);
((var)->value = (char *)(array));
var->dynamic_value = (sh_var_value_func_t *)
((void *)0)
;
var->assign_func = (sh_var_assign_func_t *)
((void *)0)
;
do { if ((var)->exportstr) { sh_xfree(((var)->exportstr), "arrayfunc.c", 95); (var)->exportstr = (char *)
((void *)0)
; } } while (0);
if (((((var)->attributes) & (0x0000001))))
array_needs_making++;
((var)->attributes |= (0x0000004));
if (oldval)
((var)->attributes &= ~(0x0001000));
((var)->attributes &= ~(0x0000040));
((var)->attributes &= ~(0x0000800));
return var;
}
| long convert_var_to_array(long a1)
{
int v1;
int v2;
long v4;
long v5;
v4 = *(_QWORD *)(a1 + 8);
v5 = array_create();
if ( v4 )
array_insert(v5, 0LL, v4);
if ( *(_QWORD *)(a1 + 8) )
sh_xfree(*(_QWORD *)(a1 + 8), "arrayfunc.c", 88LL);
*(_QWORD *)(a1 + 8) = v5;
*(_QWORD *)(a1 + 24) = 0LL;
*(_QWORD *)(a1 + 32) = 0LL;
if ( *(_QWORD *)(a1 + 16) )
{
sh_xfree(*(_QWORD *)(a1 + 16), "arrayfunc.c", 95LL);
*(_QWORD *)(a1 + 16) = 0LL;
}
if ( (*(_DWORD *)(a1 + 40) & 1) != 0 )
++array_needs_making;
*(_DWORD *)(a1 + 40) |= 4u;
if ( v4 )
{
v1 = *(_DWORD *)(a1 + 40);
BYTE1(v1) &= ~0x10u;
*(_DWORD *)(a1 + 40) = v1;
}
*(_DWORD *)(a1 + 40) &= ~0x40u;
v2 = *(_DWORD *)(a1 + 40);
BYTE1(v2) &= ~8u;
*(_DWORD *)(a1 + 40) = v2;
return a1;
}
|
static gl_list_t
gl_linked_nx_create (gl_list_implementation_t implementation,
gl_listelement_equals_fn equals_fn,
gl_listelement_hashcode_fn hashcode_fn,
gl_listelement_dispose_fn dispose_fn,
_Bool
allow_duplicates,
size_t count, const void **contents)
{
struct gl_list_impl *list =
(struct gl_list_impl *) malloc (sizeof (struct gl_list_impl));
gl_list_node_t tail;
if (list ==
((void *)0)
)
return
((void *)0)
;
list->base.vtable = implementation;
list->base.equals_fn = equals_fn;
list->base.hashcode_fn = hashcode_fn;
list->base.dispose_fn = dispose_fn;
list->base.allow_duplicates = allow_duplicates;
list->count = count;
tail = &list->root;
for (; count > 0; contents++, count--)
{
gl_list_node_t node =
(struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
if (node ==
((void *)0)
)
goto fail2;
node->value = *contents;
node->prev = tail;
tail->next = node;
tail = node;
}
tail->next = &list->root;
list->root.prev = tail;
return list;
fail2:
{
gl_list_node_t node;
for (node = tail; node != &list->root; )
{
gl_list_node_t prev = node->prev;
free (node);
node = prev;
}
}
free (list);
return
((void *)0)
;
}
| long long gl_linked_nx_create(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5, unsigned long long *v6) {
unsigned long v0;
unsigned long long v1[3];
unsigned long long v2[3];
void* v3;
unsigned long long v4[3];
void* v5;
void* v7;
v0 = a5;
v3 = malloc(0x48);
if (!v3) {
v7 = 0;
} else {
*(v3) = a0;
*(&v3[8]) = a1;
*(&v3[16]) = a2;
*(&v3[24]) = a3;
*(&v3[32]) = a4;
*(&v3[64]) = v0;
v1[0] = v3 + 40;
while (true) {
if (!v0) {
v1[0] = v3 + 40;
*(&v3[48]) = v1;
v7 = v3;
break;
} else {
v4[0] = malloc(0x18);
if (v4) {
v4[2] = *(v6);
v4[1] = v1;
v1[0] = v4;
v1[0] = v4;
v6 += 1;
v0 -= 1;
} else {
for (v2[0] = v1; v2 != v3 + 40; v2[0] = v5) {
v5 = v2[1];
free(v2);
}
free(v3);
v7 = 0;
break;
}
}
}
}
return v7;
}
|
int
sshbuf_get_string_direct(struct sshbuf *buf, const u_char **valp, size_t *lenp)
{
size_t len;
const u_char *p;
int r;
if (valp !=
((void *)0)
)
*valp =
((void *)0)
;
if (lenp !=
((void *)0)
)
*lenp = 0;
if ((r = sshbuf_peek_string_direct(buf, &p, &len)) < 0)
return r;
if (valp !=
((void *)0)
)
*valp = p;
if (lenp !=
((void *)0)
)
*lenp = len;
if (sshbuf_consume(buf, len + 4) != 0) {
;
;
return -1;
}
return 0;
}
| int sshbuf_get_string_direct(unsigned long long a0, unsigned long long *a1, unsigned long long *a2) {
unsigned int v0;
char v1;
char v2;
unsigned int v4;
if (a1)
*(a1) = 0;
if (a2)
*(a2) = 0;
v0 = sshbuf_peek_string_direct(a0, &v2, &v1);
if (v0 < 0) {
v4 = v0;
} else {
if (a1)
*(a1) = *(&v2);
if (a2)
*(a2) = *(&v1);
v4 = sshbuf_consume(a0, *(&v1) + 4, *(&v1) + 4);
if (v4)
v4 = -1;
else
v4 = 0;
}
return v4;
}
|
void
auth_maxtries_exceeded(struct ssh *ssh)
{
Authctxt *authctxt = (Authctxt *)ssh->authctxt;
sshlog("auth.c", __func__, 339, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "maximum authentication attempts exceeded for " "%s%.100s from %.200s port %d ssh2", authctxt->valid ? "" : "invalid user ", authctxt->user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh))
;
ssh_packet_disconnect(ssh, "Too many authentication failures");
}
| long long auth_maxtries_exceeded() {
unsigned long long v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
struct_1 *v4;
unsigned long v5;
unsigned long v7;
struct_0 *v8;
unsigned long long v11;
v5 = v7;
v4 = v8->field_860;
if (v4->field_c)
v11 = &g_402b2c;
else
v11 = "invalid user ";
v3 = ssh_remote_port(v8);
v2 = ssh_remote_ipaddr(v8);
v1 = v4->field_20;
v0 = v11;
sshlog("auth.c", "auth_maxtries_exceeded", 0x153, 0x0, 0x2, 0x0, "maximum authentication attempts exceeded for %s%.100s from %.200s port %d ssh2");
ssh_packet_disconnect(v8, "Too many authentication failures");
}
|
int e2fsck_get_num_dirinfo(e2fsck_t ctx)
{
return ctx->dir_info ? ctx->dir_info->count : 0;
}
| long e2fsck_get_num_dirinfo(long a1)
{
if ( *(_QWORD *)(a1 + 560) )
return **(unsigned int **)(a1 + 560);
else
return 0LL;
}
|
const char *raw_to_base64(const unsigned char *raw, size_t raw_size)
{
static char buf[1024];
gnutls_datum_t data = {(unsigned char*)raw, raw_size};
size_t buf_size;
int ret;
if (raw_size == 0)
return "(empty)";
buf_size = sizeof(buf);
ret = gnutls_pem_base64_encode(
((void *)0)
, &data, buf, &buf_size);
if (ret < 0)
return "(error)";
buf[sizeof(buf) - 1] = '\0';
return buf;
}
| char * raw_to_base64(undefined8 param_1,long param_2)
{
int iVar1;
char *pcVar2;
long in_FS_OFFSET;
undefined8 local_30;
undefined8 local_28;
undefined4 local_20;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_20 = (undefined4)param_2;
local_28 = param_1;
if (param_2 == 0) {
pcVar2 = "(empty)";
}
else {
local_30 = 0x400;
iVar1 = gnutls_pem_base64_encode(0,&local_28,buf_11901,&local_30);
if (iVar1 < 0) {
pcVar2 = "(error)";
}
else {
buf_11901[1023] = 0;
pcVar2 = buf_11901;
}
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return pcVar2;
}
|
int ipstats_stat_desc_show_xstats(struct ipstats_stat_show_attrs *attrs,
const struct ipstats_stat_desc *desc)
{
struct ipstats_stat_desc_xstats *xdesc;
const struct rtattr *at;
struct rtattr **tb;
int err;
xdesc = ({ const typeof( ((struct ipstats_stat_desc_xstats *)0)->desc ) *__mptr = (desc); (struct ipstats_stat_desc_xstats *)( (char *)__mptr -
__builtin_offsetof (
struct ipstats_stat_desc_xstats
,
desc
)
);});
at = ipstats_stat_show_get_attr(attrs,
xdesc->xstats_at,
xdesc->link_type_at, &err);
if (at ==
((void *)0)
)
return err;
tb =
__builtin_alloca (
sizeof(*tb) * (xdesc->inner_max + 1)
)
;
err = (parse_rtattr_flags((tb), (xdesc->inner_max), ((void*)(((char*)(at)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((at)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)));
if (err != 0)
return err;
if (tb[xdesc->inner_at] !=
((void *)0)
) {
print_nl();
xdesc->show_cb(tb[xdesc->inner_at]);
}
return 0;
}
| long long ipstats_stat_desc_show_xstats(void* a0, unsigned int a1[12]) {
char v0;
char v1;
unsigned short *v2;
unsigned long long v3;
unsigned long long v4;
char v5;
unsigned long v6;
void* v7;
if (!v2) {
v7 = *(&v1);
} else {
for (v2 = ipstats_stat_show_get_attr(a0, a1[8], a1[9], &v1); &v5 != &(&v0)[-1 * ((0 CONCAT 15 + (a1[10] + 1 << 3) + 8) /m 16 * 16 & -0x1000)]; v4 = *(&v4));
if ((((0 CONCAT 15 + (a1[10] + 1 << 3) + 8) /m 16 * 16) & 4095))
*((&v4 + (((0 CONCAT 15 + (a1[10] + 1) * 8 + 8) /m 16 * 16) & 4095))) = *((&v4 + (((0 CONCAT 15 + (a1[10] + 1) * 8 + 8) /m 16 * 16) & 4095)));
v3 = (&v6 >> 4) * 16;
v1 = parse_rtattr_flags(v3, a1[10], v2 + 2, *(v2) - 4, 0x8000);
if (v1) {
v7 = *(&v1);
} else {
if (*((v3 + (a1[11] << 3)))) {
print_nl();
*(&a1[1])(*((v3 + a1[11] * 8)));
}
v7 = 0;
}
}
return v7;
}
|
static
_Bool
tail_file (struct File_spec *f, uintmax_t n_units)
{
int fd;
_Bool
ok;
_Bool
is_stdin = ((strcmp (f->name, "-") == 0));
if (is_stdin)
{
have_read_stdin =
1
;
fd =
0
;
xset_binary_mode (
0
,
0
);
}
else
fd = open_safer (f->name,
00
|
0
);
f->tailable = !(reopen_inaccessible_files && fd == -1);
if (fd == -1)
{
if (forever)
{
f->fd = -1;
f->errnum =
(*__errno_location ())
;
f->ignore = ! reopen_inaccessible_files;
f->ino = 0;
f->dev = 0;
}
error (0,
(*__errno_location ())
, gettext ("cannot open %s for reading"),
quotearg_style (shell_escape_always_quoting_style, pretty_name (f)));
ok =
0
;
}
else
{
uintmax_t read_pos;
if (print_headers)
write_header (pretty_name (f));
ok = tail (pretty_name (f), fd, n_units, &read_pos);
if (forever)
{
struct stat stats;
f->errnum = ok - 1;
if (fstat (fd, &stats) < 0)
{
ok =
0
;
f->errnum =
(*__errno_location ())
;
error (0,
(*__errno_location ())
, gettext ("error reading %s"),
quotearg_style (shell_escape_always_quoting_style, pretty_name (f)));
}
else if (!(
((((
stats.st_mode
)) & 0170000) == (0100000))
||
((((
stats.st_mode
)) & 0170000) == (0010000))
||
((((
stats.st_mode
)) & 0170000) == (0140000))
||
((((
stats.st_mode
)) & 0170000) == (0020000))
))
{
ok =
0
;
f->errnum = -1;
f->tailable =
0
;
f->ignore = ! reopen_inaccessible_files;
error (0, 0, gettext ("%s: cannot follow end of this type of file%s"),
quotearg_n_style_colon (0, shell_escape_quoting_style, pretty_name (f)),
f->ignore ? gettext ("; giving up on this name") : "");
}
if (!ok)
{
f->ignore = ! reopen_inaccessible_files;
close_fd (fd, pretty_name (f));
f->fd = -1;
}
else
{
record_open_fd (f, fd, read_pos, &stats, (is_stdin ? -1 : 1));
f->remote = fremote (fd, pretty_name (f));
}
}
else
{
if (!is_stdin && close (fd))
{
error (0,
(*__errno_location ())
, gettext ("error reading %s"),
quotearg_style (shell_escape_always_quoting_style, pretty_name (f)));
ok =
0
;
}
}
}
return ok;
}
| int tail_file(struct_0 *a0, unsigned long a1) {
char v0;
char v1;
unsigned int v2;
char v3;
char v4;
char v5;
unsigned int v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
v1 = !strcmp(a0->field_0, "-");
if (v1) {
have_read_stdin = 1;
v2 = 0;
xset_binary_mode(0x0, 0x0);
} else {
v2 = open_safer(a0->field_0, 0x0);
}
if ((reopen_inaccessible_files ^ 1)) {
LABEL_406122:
v8 = 1;
} else {
if (!(v2 == -1))
goto LABEL_406122;
v8 = 0;
}
*(&v8) = v8 & 1;
a0->field_36 = v8;
if (v2 != -1) {
if (print_headers)
write_header(pretty_name(a0));
v0 = tail(pretty_name(a0), v2, a1, &v3);
if (forever) {
a0->field_3c = v0 - 1;
if (fstat(v2, &v4) < 0) {
v0 = 0;
a0->field_3c = *(__errno_location());
v11 = quotearg_style(0x4, pretty_name(a0));
error(0x0, *(__errno_location()), gettext("error reading %s"));
} else {
if ((*(&v5) & 0xf000) != 0x8000 && (*(&v5) & 0xf000) != 0x1000 && (*(&v5) & 0xf000) != 0xc000 && (*(&v5) & 0xf000) != 0x2000) {
v0 = 0;
a0->field_3c = -1;
a0->field_36 = 0;
a0->field_34 = !(reopen_inaccessible_files);
if (a0->field_34)
v12 = gettext("; giving up on this name");
quotearg_n_style_colon(0x0, 0x3, pretty_name(a0));
error(0x0, 0x0, gettext("%s: cannot follow end of this type of file%s"));
}
}
if ((v0 ^ 1)) {
a0->field_34 = !(reopen_inaccessible_files);
close_fd(v2, pretty_name(a0));
a0->field_38 = -1;
} else {
if (v1)
v13 = 4294967295;
else
v13 = 1;
record_open_fd(a0, v2, *(&v3), &v4, v13);
a0->field_35 = fremote(v2, pretty_name(a0));
}
} else if ((v1 ^ 1) && close(v2)) {
v10 = quotearg_style(0x4, pretty_name(a0));
error(0x0, *(__errno_location()), gettext("error reading %s"));
v0 = 0;
}
} else {
if (forever) {
a0->field_38 = -1;
a0->field_3c = *(__errno_location());
a0->field_34 = !(reopen_inaccessible_files);
a0->field_28 = 0;
a0->field_20 = 0;
}
v9 = quotearg_style(0x4, pretty_name(a0));
error(0x0, *(__errno_location()), gettext("cannot open %s for reading"));
v0 = 0;
}
return v0;
}
|
void print_rt_flags(FILE *fp, unsigned int flags)
{
open_json_array(PRINT_JSON,
is_json_context() ? "flags" : "");
if (flags & 1)
print_string(PRINT_ANY,
((void *)0)
, "%s ", "dead");
if (flags & 4)
print_string(PRINT_ANY,
((void *)0)
, "%s ", "onlink");
if (flags & 2)
print_string(PRINT_ANY,
((void *)0)
, "%s ", "pervasive");
if (flags & 8)
print_string(PRINT_ANY,
((void *)0)
, "%s ", "offload");
if (flags & 64)
print_string(PRINT_ANY,
((void *)0)
, "%s ", "trap");
if (flags & 0x100)
print_string(PRINT_ANY,
((void *)0)
, "%s ", "notify");
if (flags & 16)
print_string(PRINT_ANY,
((void *)0)
, "%s ", "linkdown");
if (flags & 32)
print_string(PRINT_ANY,
((void *)0)
, "%s ", "unresolved");
if (flags & 0x4000)
print_string(PRINT_ANY,
((void *)0)
, "%s ", "rt_offload");
if (flags & 0x8000)
print_string(PRINT_ANY,
((void *)0)
, "%s ", "rt_trap");
if (flags & 0x20000000)
print_string(PRINT_ANY,
((void *)0)
, "%s ", "rt_offload_failed");
close_json_array(PRINT_JSON,
((void *)0)
);
}
| void print_rt_flags(unsigned long a0, unsigned long a1) {
unsigned long v0;
unsigned long long v3;
v0 = a0;
open_json_array(0x2, (!is_json_context() ? "flags" : &g_409f54));
if ((a1 & 1))
print_string(0x4, 0x0, "%s ", "dead");
if ((a1 & 4))
print_string(0x4, 0x0, "%s ", "onlink");
if ((a1 & 2))
print_string(0x4, 0x0, "%s ", "pervasive");
if ((a1 & 8))
print_string(0x4, 0x0, "%s ", "offload");
if ((a1 & 64))
print_string(0x4, 0x0, "%s ", "trap");
if ((a1 & 0x100))
print_string(0x4, 0x0, "%s ", "notify");
if ((a1 & 16))
print_string(0x4, 0x0, "%s ", "linkdown");
if ((a1 & 32))
print_string(0x4, 0x0, "%s ", "unresolved");
if ((a1 & 0x4000))
print_string(0x4, 0x0, "%s ", "rt_offload");
if ((a1 & 0x8000))
print_string(0x4, 0x0, "%s ", "rt_trap");
if ((a1 & 0x20000000))
print_string(0x4, 0x0, "%s ", "rt_offload_failed");
v3 = close_json_array(0x2, 0x0);
return;
}
|
int
sshkey_from_blob(const u_char *blob, size_t blen, struct sshkey **keyp)
{
struct sshbuf *b;
int r;
if ((b = sshbuf_from(blob, blen)) ==
((void *)0)
)
return -2;
r = sshkey_from_blob_internal(b, keyp, 1);
sshbuf_free(b);
return r;
}
| long long sshkey_from_blob(unsigned long long a0, unsigned long long a1, unsigned long long *a2) {
unsigned int v0;
unsigned long long v1;
unsigned long long v3;
v1 = sshbuf_from(a0, a1, a1);
if (!v1) {
v3 = 4294967294;
return v3;
}
v0 = sshkey_from_blob_internal(v1, a2, 0x1);
sshbuf_free(v1);
v3 = v0;
return v3;
}
|
int
sftp_server_main(int argc, char **argv, struct passwd *user_pw)
{
int i, r, in, out, ch, skipargs = 0, log_stderr = 0;
ssize_t len, olen;
SyslogFacility log_facility = SYSLOG_FACILITY_AUTH;
char *cp, *homedir =
((void *)0)
, uidstr[32], buf[4*4096];
long mask;
__progname = ssh_get_progname(argv[0]);
log_init(__progname, log_level, log_facility, log_stderr);
pw = pwcopy(user_pw);
while (!skipargs && (ch = BSDgetopt(argc, argv, "d:f:l:P:p:Q:u:cehR")
) != -1) {
switch (ch) {
case 'Q':
if (strcasecmp(BSDoptarg, "requests") != 0) {
fprintf(
stderr
, "Invalid query type\n");
exit(1);
}
for (i = 0; handlers[i].handler !=
((void *)0)
; i++)
printf("%s\n", handlers[i].name);
for (i = 0; extended_handlers[i].handler !=
((void *)0)
; i++)
printf("%s\n", extended_handlers[i].name);
exit(0);
break;
case 'R':
readonly = 1;
break;
case 'c':
skipargs = 1;
break;
case 'e':
log_stderr = 1;
break;
case 'l':
log_level = log_level_number(BSDoptarg);
if (log_level == SYSLOG_LEVEL_NOT_SET)
sshlog("sftp-server.c", __func__, 1948, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Invalid log level \"%s\"", BSDoptarg);
break;
case 'f':
log_facility = log_facility_number(BSDoptarg);
if (log_facility == SYSLOG_FACILITY_NOT_SET)
sshlog("sftp-server.c", __func__, 1953, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Invalid log facility \"%s\"", BSDoptarg);
break;
case 'd':
cp = tilde_expand_filename(BSDoptarg, user_pw->pw_uid);
snprintf(uidstr, sizeof(uidstr), "%llu",
(unsigned long long)pw->pw_uid);
homedir = percent_expand(cp, "d", user_pw->pw_dir,
"u", user_pw->pw_name, "U", uidstr, (char *)
((void *)0)
);
free(cp);
break;
case 'p':
if (request_allowlist !=
((void *)0)
)
sshfatal("sftp-server.c", __func__, 1965, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Permitted requests already set");
request_allowlist = xstrdup(BSDoptarg);
break;
case 'P':
if (request_denylist !=
((void *)0)
)
sshfatal("sftp-server.c", __func__, 1970, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Refused requests already set");
request_denylist = xstrdup(BSDoptarg);
break;
case 'u':
(*__errno_location ())
= 0;
mask = strtol(BSDoptarg, &cp, 8);
if (mask < 0 || mask > 0777 || *cp != '\0' ||
cp == BSDoptarg || (mask == 0 &&
(*__errno_location ())
!= 0))
sshfatal("sftp-server.c", __func__, 1978, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Invalid umask \"%s\"", BSDoptarg);
(void)umask((mode_t)mask);
break;
case 'h':
default:
sftp_server_usage();
}
}
log_init(__progname, log_level, log_facility, log_stderr);
platform_disable_tracing(1);
platform_pledge_sftp_server();
if ((cp = getenv("SSH_CONNECTION")) !=
((void *)0)
) {
client_addr = xstrdup(cp);
if ((cp = strchr(client_addr, ' ')) ==
((void *)0)
) {
sshlog("sftp-server.c", __func__, 2003, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Malformed SSH_CONNECTION variable: \"%s\"", getenv("SSH_CONNECTION"))
;
sftp_server_cleanup_exit(255);
}
*cp = '\0';
} else
client_addr = xstrdup("UNKNOWN");
sshlog("sftp-server.c", __func__, 2011, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "session opened for local user %s from [%s]", pw->pw_name, client_addr)
;
in =
0
;
out =
1
;
if ((iqueue = sshbuf_new()) ==
((void *)0)
)
sshfatal("sftp-server.c", __func__, 2023, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new failed");
if ((oqueue = sshbuf_new()) ==
((void *)0)
)
sshfatal("sftp-server.c", __func__, 2025, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new failed");
if (homedir !=
((void *)0)
) {
if (chdir(homedir) != 0) {
sshlog("sftp-server.c", __func__, 2029, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "chdir to \"%s\" failed: %s", homedir, strerror(
(*__errno_location ())
))
;
}
}
for (;;) {
struct pollfd pfd[2];
memset(pfd, 0, sizeof pfd);
pfd[0].fd = pfd[1].fd = -1;
if ((r = sshbuf_check_reserve(iqueue, sizeof(buf))) == 0 &&
(r = sshbuf_check_reserve(oqueue,
(256 * 1024))) == 0) {
pfd[0].fd = in;
pfd[0].events =
0x001
;
}
else if (r != -9)
sshfatal("sftp-server.c", __func__, 2052, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "reserve");
olen = sshbuf_len(oqueue);
if (olen > 0) {
pfd[1].fd = out;
pfd[1].events =
0x004
;
}
if (poll(pfd, 2, -1) == -1) {
if (
(*__errno_location ())
==
4
)
continue;
sshlog("sftp-server.c", __func__, 2063, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "poll: %s", strerror(
(*__errno_location ())
));
sftp_server_cleanup_exit(2);
}
if (pfd[0].revents & (
0x001
|
0x010
)) {
len = read(in, buf, sizeof buf);
if (len == 0) {
sshlog("sftp-server.c", __func__, 2071, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "read eof");
sftp_server_cleanup_exit(0);
} else if (len == -1) {
if (
(*__errno_location ())
!=
11
&&
(*__errno_location ())
!=
4
) {
sshlog("sftp-server.c", __func__, 2075, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "read: %s", strerror(
(*__errno_location ())
));
sftp_server_cleanup_exit(1);
}
} else if ((r = sshbuf_put(iqueue, buf, len)) != 0)
sshfatal("sftp-server.c", __func__, 2079, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "sshbuf_put");
}
if (pfd[1].revents & (
0x004
|
0x010
)) {
len = write(out, sshbuf_ptr(oqueue), olen);
if (len == 0 || (len == -1 &&
(*__errno_location ())
==
32
)) {
sshlog("sftp-server.c", __func__, 2085, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "write eof");
sftp_server_cleanup_exit(0);
} else if (len == -1) {
sftp_server_cleanup_exit(1);
if (
(*__errno_location ())
!=
11
&&
(*__errno_location ())
!=
4
) {
sshlog("sftp-server.c", __func__, 2090, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "write: %s", strerror(
(*__errno_location ())
));
sftp_server_cleanup_exit(1);
}
} else if ((r = sshbuf_consume(oqueue, len)) != 0)
sshfatal("sftp-server.c", __func__, 2094, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "consume");
}
r = sshbuf_check_reserve(oqueue, (256 * 1024));
if (r == 0)
process();
else if (r != -9)
sshfatal("sftp-server.c", __func__, 2106, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "reserve");
}
}
| long long sftp_server_main(unsigned long a0) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
char *v8;
void* v9;
unsigned long v10;
unsigned int v11;
unsigned long long v12;
unsigned int v13;
unsigned short v14;
char v15;
unsigned int v16;
unsigned short v17;
char v18;
char v19;
char v20;
char v21;
char v22;
unsigned long long v23;
unsigned long v24;
unsigned long long v25;
struct_1 *v26;
char v27;
unsigned long v29;
unsigned long long *v30;
unsigned long long *v31;
struct_0 *v32;
struct_2 *v33;
unsigned long long v34;
unsigned long long v36;
unsigned long long v37;
unsigned long long v38;
unsigned long long v40;
v25 = v29;
do {
v22 = *(&v22);
} while (&v22 != &v21);
v23 = v30[5];
v1 = 0;
v2 = 0;
v0 = 2;
v9 = 0;
__progname = ssh_get_progname(*(v31));
log_init(__progname, log_level, v0, v2);
for (pw = pwcopy(v32); !v1; v34 = *((0x4 * &v33->padding_0[0] + &g_408d24)) + &g_408d24) {
v5 = BSDgetopt(a0, v31, "d:f:l:P:p:Q:u:cehR", v31);
if (v5 == -1)
break;
v33 = __addvsi3(v5, 0xffffffb0);
switch (v33) {
case 0:
if (request_denylist) {
v25 = "Refused requests already set";
sshfatal("sftp-server.c", "sftp_server_main", 0x7b2, 0x0, 0x1, 0x0);
}
request_denylist = xstrdup(*(&BSDoptarg));
break;
case 1:
if (strcasecmp(*(&BSDoptarg), "requests")) {
fprintf(stderr, "Invalid query type\n");
exit(0x1);
}
for (v3 = 0; g_409298[4 * v3 + v3]; v3 = __addvsi3(v3, 0x1)) {
printf("%s\n", (&handlers)[5 * v3]);
}
for (v3 = 0; g_409598[4 * v3 + v3]; v3 = __addvsi3(v3, 0x1)) {
printf("%s\n", (&extended_handlers)[5 * v3]);
}
exit(0x0);
case 2:
readonly = 1;
break;
case 19:
v1 = 1;
break;
case 20:
v8 = tilde_expand_filename(*(&BSDoptarg), v32->field_10, v32->field_10);
snprintf(&v19, 0x20, "%llu", *((pw + 16)));
v26 = 0;
v25 = &v19;
v9 = percent_expand(v8, "d", v32->field_20, "u", v32->field_0, "U", *(&v27));
free(v8);
break;
case 21:
v2 = 1;
break;
case 22:
v0 = log_facility_number(*(&BSDoptarg));
if (v0 != -1)
continue;
v26 = *(&BSDoptarg);
v25 = "Invalid log facility \"%s\"";
sshlog("sftp-server.c", "sftp_server_main", 0x7a1, 0x0, 0x2, 0x0, *(&v27));
break;
case 28:
log_level = log_level_number(*(&BSDoptarg));
if (log_level != -1)
continue;
v26 = *(&BSDoptarg);
v25 = "Invalid log level \"%s\"";
sshlog("sftp-server.c", "sftp_server_main", 0x79c, 0x0, 0x2, 0x0, *(&v27));
break;
case 32:
if (request_allowlist) {
v25 = "Permitted requests already set";
sshfatal("sftp-server.c", "sftp_server_main", 0x7ad, 0x0, 0x1, 0x0);
}
request_allowlist = xstrdup(*(&BSDoptarg));
break;
case 37:
*(__errno_location()) = 0;
v10 = strtol(*(&BSDoptarg), &v8, 0x8);
if (!((v10 - 0 >> 63)) && v10 <= 511 && !*(v8) && v8 != *(&BSDoptarg) && !v10)
*(&v34) = *(__errno_location());
if ((v10 - 0 >> 63) || v10 > 511) {
v26 = *(&BSDoptarg);
v25 = "Invalid umask \"%s\"";
sshfatal("sftp-server.c", "sftp_server_main", 0x7ba, 0x0, 0x1, 0x0);
}
umask(v10);
break;
default:
sftp_server_usage();
}
}
log_init(__progname, log_level, v0, v2);
platform_disable_tracing(0x1);
platform_pledge_sftp_server(0x1, v31, v32, v36, v37, v38);
v8 = getenv("SSH_CONNECTION");
if (v8) {
client_addr = xstrdup(v8);
v8 = strchr(client_addr, 0x20);
if (!v8) {
v26 = getenv("SSH_CONNECTION");
v25 = "Malformed SSH_CONNECTION variable: \"%s\"";
sshlog("sftp-server.c", "sftp_server_main", 0x7d3, 0x0, 0x2, 0x0, *(&v27));
sftp_server_cleanup_exit(0xff);
}
*(v8) = 0;
} else {
client_addr = xstrdup("UNKNOWN");
}
if (!v8 || v8) {
v25 = client_addr;
v24 = *(pw);
v23 = "session opened for local user %s from [%s]";
sshlog("sftp-server.c", "sftp_server_main", 0x7db, 0x0, 0x3, 0x0, *(&v27));
v6 = 0;
v7 = 1;
oqueue = sshbuf_new();
if (false) {
v25 = "sshbuf_new failed";
sshfatal("sftp-server.c", "sftp_server_main", 0x7e7, 0x1, 0x1, 0x0);
}
oqueue = sshbuf_new();
if (false) {
v25 = "sshbuf_new failed";
sshfatal("sftp-server.c", "sftp_server_main", 0x7e9, 0x1, 0x1, 0x0);
}
if (v9 && chdir(v9)) {
v25 = strerror(*(__errno_location()));
v24 = v9;
v23 = "chdir to \"%s\" failed: %s";
sshlog("sftp-server.c", "sftp_server_main", 0x7ed, 0x0, 0x2, 0x0, *(&v27));
}
while (true) {
memset(&v13, 0x0, 0x10);
v16 = -1;
v13 = v16;
v4 = sshbuf_check_reserve(0xe87d894820ec8348, 0x4000);
if (!v4) {
v4 = sshbuf_check_reserve(0xe87d894820ec8348, 0x40000);
if (!v4) {
v13 = v6;
v14 = 1;
}
}
if ((v4 || v4) && v4 != -9) {
v25 = "reserve";
sshfatal("sftp-server.c", "sftp_server_main", 0x804, 0x1, 0x1, ssh_err(v4));
}
*(&v11) = sshbuf_len(0xe87d894820ec8348);
if (*(&v11) > 0) {
v16 = v7;
v17 = 4;
}
v40 = poll(&v13, 0x2, 0xffffffff);
if (v40 == -1) {
*(&v40) = *(__errno_location());
v26 = strerror(*(__errno_location()));
v25 = "poll: %s";
sshlog("sftp-server.c", "sftp_server_main", 0x80f, 0x0, 0x2, 0x0, *(&v27));
sftp_server_cleanup_exit(0x2);
}
if ((*(&v15) & 17)) {
v12 = read(v6, &v20, 0x4000);
if (!v12) {
v25 = "read eof";
sshlog("sftp-server.c", "sftp_server_main", 0x817, 0x0, 0x5, 0x0, *(&v27));
sftp_server_cleanup_exit(0x0);
} else if (v12 != -1) {
v4 = sshbuf_put(0xe87d894820ec8348, &v20, v12, &v20);
if (v4) {
v25 = "sshbuf_put";
sshfatal("sftp-server.c", "sftp_server_main", 0x81f, 0x1, 0x1, ssh_err(v4));
}
} else if (v40 != 11) {
*(&v40) = *(__errno_location());
if (v40 != 4) {
v26 = strerror(*(__errno_location()));
v25 = "read: %s";
sshlog("sftp-server.c", "sftp_server_main", 0x81b, 0x0, 0x2, 0x0, *(&v27));
sftp_server_cleanup_exit(0x1);
}
}
if (v12 == -1)
*(&v40) = *(__errno_location());
}
if ((!(*(&v15) & 17) || v40 == 11 && v12 || v40 == 4 && v12 || v12 && v12 != -1) && (*(&v18) & 20)) {
v12 = write(v7, sshbuf_ptr(0xe87d894820ec8348), *(&v11));
if (!v12)
break;
if (v12 && v12 == -1) {
*(&v40) = *(__errno_location());
if (v40 == 32)
break;
}
if (v40 != 32) {
if (v12 == -1)
sftp_server_cleanup_exit(0x1);
v4 = sshbuf_consume(0xe87d894820ec8348, v12);
if (v4) {
v25 = "consume";
sshfatal("sftp-server.c", "sftp_server_main", 0x82e, 0x1, 0x1, ssh_err(v4));
}
}
}
if (!(*(&v18) & 20) && v40 != -1 && (!(*(&v15) & 17) || v12) && (v40 == 11 || !(*(&v15) & 17) || v40 == 4 || v12 != -1) || v40 != -1 && (*(&v18) & 20) && v12 != -1 && v40 != 32 && (!(*(&v15) & 17) || v12) && (v40 == 11 || !(*(&v15) & 17) || v40 == 4 || v12 != -1)) {
v4 = sshbuf_check_reserve(0xe87d894820ec8348, 0x40000);
if (!v4) {
process();
} else {
if (v4 == -9)
continue;
v25 = "reserve";
sshfatal("sftp-server.c", "sftp_server_main", 0x83a, 0x1, 0x1, ssh_err(v4));
}
}
}
v25 = "write eof";
sshlog("sftp-server.c", "sftp_server_main", 0x825, 0x0, 0x5, 0x0, *(&v27));
sftp_server_cleanup_exit(0x0);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.