input
stringlengths 28
169k
| output
stringlengths 20
317k
|
|---|---|
gnutls_certificate_type_get2(session, GNUTLS_CTYPE_CLIENT) != GNUTLS_CRT_X509) {
tmp =
gnutls_certificate_type_get_name
(gnutls_certificate_type_get2(session, GNUTLS_CTYPE_CLIENT));
if (tmp ==
((void *)0)
)
tmp = str_unknown;
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<TR><TD>Certificate Type:</TD><TD>%s</TD></TR>\n",
tmp);
}
|
void gnutls_certificate_type_get2(void)
{
halt_baddata();
}
|
int xfrm_lifetime_cfg_parse(struct xfrm_lifetime_cfg *lft,
int *argcp, char ***argvp)
{
int argc = *argcp;
char **argv = *argvp;
int ret;
if (strcmp(*argv, "time-soft") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ret = get_u64(&lft->soft_add_expires_seconds, *argv, 0);
if (ret)
invarg("value after \"time-soft\" is invalid", *argv);
} else if (strcmp(*argv, "time-hard") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ret = get_u64(&lft->hard_add_expires_seconds, *argv, 0);
if (ret)
invarg("value after \"time-hard\" is invalid", *argv);
} else if (strcmp(*argv, "time-use-soft") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ret = get_u64(&lft->soft_use_expires_seconds, *argv, 0);
if (ret)
invarg("value after \"time-use-soft\" is invalid", *argv);
} else if (strcmp(*argv, "time-use-hard") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ret = get_u64(&lft->hard_use_expires_seconds, *argv, 0);
if (ret)
invarg("value after \"time-use-hard\" is invalid", *argv);
} else if (strcmp(*argv, "byte-soft") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ret = get_u64(&lft->soft_byte_limit, *argv, 0);
if (ret)
invarg("value after \"byte-soft\" is invalid", *argv);
} else if (strcmp(*argv, "byte-hard") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ret = get_u64(&lft->hard_byte_limit, *argv, 0);
if (ret)
invarg("value after \"byte-hard\" is invalid", *argv);
} else if (strcmp(*argv, "packet-soft") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ret = get_u64(&lft->soft_packet_limit, *argv, 0);
if (ret)
invarg("value after \"packet-soft\" is invalid", *argv);
} else if (strcmp(*argv, "packet-hard") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ret = get_u64(&lft->hard_packet_limit, *argv, 0);
if (ret)
invarg("value after \"packet-hard\" is invalid", *argv);
} else
invarg("LIMIT value is invalid", *argv);
*argcp = argc;
*argvp = argv;
return 0;
}
|
long long xfrm_lifetime_cfg_parse(unsigned long long a0, unsigned int *a1, unsigned long long *a2) {
unsigned int v0;
unsigned int v1;
unsigned long long *v2;
v0 = *(a1);
v2 = *(a2);
if (strcmp(*(v2), "time-soft")) {
LABEL_404cb3:
if (strcmp(*(v2), "time-hard")) {
LABEL_404d23:
if (strcmp(*(v2), "time-use-soft")) {
LABEL_404d93:
if (strcmp(*(v2), "time-use-hard")) {
LABEL_404e03:
if (strcmp(*(v2), "byte-soft")) {
LABEL_404e6f:
if (strcmp(*(v2), "byte-hard")) {
LABEL_404edf:
if (strcmp(*(v2), "packet-soft")) {
LABEL_404f4f:
if (strcmp(*(v2), "packet-hard")) {
invarg("LIMIT value is invalid", *(v2));
} else {
v2 = v2 + 1;
v0 -= 1;
if (v0 <= 0)
incomplete_command();
v1 = get_u64(a0 + 24, *(v2), 0x0, a0 + 24);
if (v1) {
invarg("value after \"packet-hard\" is invalid", *(v2));
invarg("LIMIT value is invalid", *(v2));
}
}
} else {
v2 = v2 + 1;
v0 -= 1;
if (v0 <= 0)
incomplete_command();
v1 = get_u64(a0 + 16, *(v2), 0x0, a0 + 16);
if (v1) {
invarg("value after \"packet-soft\" is invalid", *(v2));
goto LABEL_404f4f;
}
}
} else {
v2 = v2 + 1;
v0 -= 1;
if (v0 <= 0)
incomplete_command();
v1 = get_u64(a0 + 8, *(v2), 0x0, a0 + 8);
if (v1) {
invarg("value after \"byte-hard\" is invalid", *(v2));
goto LABEL_404edf;
}
}
} else {
v2 = v2 + 1;
v0 -= 1;
if (v0 <= 0)
incomplete_command();
v1 = get_u64(a0, *(v2), 0x0, *(v2));
if (v1) {
invarg("value after \"byte-soft\" is invalid", *(v2));
goto LABEL_404e6f;
}
}
} else {
v2 = v2 + 1;
v0 -= 1;
if (v0 <= 0)
incomplete_command();
v1 = get_u64(a0 + 56, *(v2), 0x0, a0 + 56);
if (v1) {
invarg("value after \"time-use-hard\" is invalid", *(v2));
goto LABEL_404e03;
}
}
} else {
v2 = v2 + 1;
v0 -= 1;
if (v0 <= 0)
incomplete_command();
v1 = get_u64(a0 + 48, *(v2), 0x0, a0 + 48);
if (v1) {
invarg("value after \"time-use-soft\" is invalid", *(v2));
goto LABEL_404d93;
}
}
} else {
v2 = v2 + 1;
v0 -= 1;
if (v0 <= 0)
incomplete_command();
v1 = get_u64(a0 + 40, *(v2), 0x0, a0 + 40);
if (v1) {
invarg("value after \"time-hard\" is invalid", *(v2));
goto LABEL_404d23;
}
}
} else {
v2 = v2 + 1;
v0 -= 1;
if (v0 <= 0)
incomplete_command();
v1 = get_u64(a0 + 32, *(v2), 0x0, a0 + 32);
if (v1) {
invarg("value after \"time-soft\" is invalid", *(v2));
goto LABEL_404cb3;
}
}
*(a1) = v0;
*(a2) = v2;
return 0;
}
|
int
ssh_dss_sign(const struct sshkey *key, u_char **sigp, size_t *lenp,
const u_char *data, size_t datalen, u_int compat)
{
DSA_SIG *sig =
((void *)0)
;
const BIGNUM *sig_r, *sig_s;
u_char digest[64], sigblob[(2*20)];
size_t rlen, slen, len, dlen = ssh_digest_bytes(1);
struct sshbuf *b =
((void *)0)
;
int ret = -10;
if (lenp !=
((void *)0)
)
*lenp = 0;
if (sigp !=
((void *)0)
)
*sigp =
((void *)0)
;
if (key ==
((void *)0)
|| key->dsa ==
((void *)0)
||
sshkey_type_plain(key->type) != KEY_DSA)
return -10;
if (dlen == 0)
return -1;
if ((ret = ssh_digest_memory(1, data, datalen,
digest, sizeof(digest))) != 0)
goto out;
if ((sig = DSA_do_sign(digest, dlen, key->dsa)) ==
((void *)0)
) {
ret = -22;
goto out;
}
DSA_SIG_get0(sig, &sig_r, &sig_s);
rlen =
((BN_num_bits(
sig_r
)+7)/8)
;
slen =
((BN_num_bits(
sig_s
)+7)/8)
;
if (rlen > 20 || slen > 20) {
ret = -1;
goto out;
}
explicit_bzero(sigblob, (2*20));
BN_bn2bin(sig_r, sigblob + (2*20) - 20 - rlen);
BN_bn2bin(sig_s, sigblob + (2*20) - slen);
if ((b = sshbuf_new()) ==
((void *)0)
) {
ret = -2;
goto out;
}
if ((ret = sshbuf_put_cstring(b, "ssh-dss")) != 0 ||
(ret = sshbuf_put_string(b, sigblob, (2*20))) != 0)
goto out;
len = sshbuf_len(b);
if (sigp !=
((void *)0)
) {
if ((*sigp = malloc(len)) ==
((void *)0)
) {
ret = -2;
goto out;
}
memcpy(*sigp, sshbuf_ptr(b), len);
}
if (lenp !=
((void *)0)
)
*lenp = len;
ret = 0;
out:
explicit_bzero(digest, sizeof(digest));
DSA_SIG_free(sig);
sshbuf_free(b);
return ret;
}
|
long ssh_dss_sign(unsigned int *a1, void **a2, size_t *a3, long a4, long a5)
{
const void *v6;
unsigned int v10;
long v11;
long v12;
long v13;
long v14;
long v15;
unsigned long v16;
unsigned long v17;
size_t size;
char v19[48];
char v20[72];
unsigned long v21;
v21 = __readfsqword(0x28u);
v13 = 0LL;
v15 = ssh_digest_bytes(1LL);
v14 = 0LL;
if ( a3 )
*a3 = 0LL;
if ( a2 )
*a2 = 0LL;
if ( !a1 || !*((_QWORD *)a1 + 2) || (unsigned int)sshkey_type_plain(*a1) != 1 )
return 4294967286LL;
if ( !v15 )
return 0xFFFFFFFFLL;
v10 = ssh_digest_memory(1LL, a4, a5, v20, 64LL);
if ( !v10 )
{
v13 = DSA_do_sign(v20, (unsigned int)v15, *((_QWORD *)a1 + 2));
if ( v13 )
{
DSA_SIG_get0(v13, &v11, &v12);
v16 = (int)(BN_num_bits(v11) + 7) / 8;
v17 = (int)(BN_num_bits(v12) + 7) / 8;
if ( v16 <= 0x14 && v17 <= 0x14 )
{
explicit_bzero(v19, 40LL);
BN_bn2bin(v11, &v19[20 - v16]);
BN_bn2bin(v12, &v19[40 - v17]);
v14 = sshbuf_new();
if ( v14 )
{
v10 = sshbuf_put_cstring(v14, "ssh-dss");
if ( v10 )
goto LABEL_28;
v10 = sshbuf_put_string(v14, v19, 40LL);
if ( v10 )
goto LABEL_28;
size = sshbuf_len(v14);
if ( a2 )
{
*a2 = malloc(size);
if ( !*a2 )
{
v10 = -2;
goto LABEL_28;
}
v6 = (const void *)sshbuf_ptr(v14);
memcpy(*a2, v6, size);
}
if ( a3 )
*a3 = size;
v10 = 0;
goto LABEL_28;
}
v10 = -2;
}
else
{
v10 = -1;
}
}
else
{
v10 = -22;
}
}
LABEL_28:
explicit_bzero(v20, 64LL);
DSA_SIG_free(v13);
sshbuf_free(v14);
return v10;
}
|
static void
addfname(char *name)
{
struct strlist *sp;
sp = (struct strlist *)stalloc(sizeof *sp);
sp->text = sstrdup(name);
*exparg.lastp = sp;
exparg.lastp = &sp->next;
}
|
void addfname(undefined8 param_1)
{
long lVar1;
undefined8 uVar2;
lVar1 = stalloc(0x10);
uVar2 = sstrdup(param_1);
*(undefined8 *)(lVar1 + 8) = uVar2;
*exparg._8_8_ = lVar1;
exparg._8_8_ = (long *)lVar1;
return;
}
|
void
_rl_output_some_chars (const char *string, int count)
{
fwrite (string, 1, count, _rl_out_stream);
}
|
long long _rl_output_some_chars(void* a0, unsigned long a1) {
return fwrite(a0, 0x1, a1, _rl_out_stream);
}
|
test_code_t test_chain_order(gnutls_session_t session)
{
int ret;
const gnutls_datum_t *cert_list;
unsigned int cert_list_size = 0;
unsigned int i;
unsigned p_size;
gnutls_datum_t t;
gnutls_x509_crt_t *certs;
char *p, *pos;
sprintf(prio_str,
"NONE:" "+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL" ":%s:"
"+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":" "+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH" ":+VKO-GOST-12" ":%s", protocol_str, rest);
{ int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 1570)) != TEST_SUCCEED) { return _ret; } };
gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred);
ret = test_do_handshake(session);
if (ret == TEST_FAILED)
return ret;
if (gnutls_certificate_type_get(session) != GNUTLS_CRT_X509)
return TEST_IGNORE2;
cert_list = gnutls_certificate_get_peers(session, &cert_list_size);
if (cert_list_size == 0) {
ext_text = "No certificates found!";
return TEST_IGNORE2;
}
if (cert_list_size == 1)
return TEST_SUCCEED;
p = 0;
p_size = 0;
pos =
((void *)0)
;
for (i=0;i<cert_list_size;i++) {
char *new_p;
t.data =
((void *)0)
;
ret = gnutls_pem_base64_encode2("CERTIFICATE", &cert_list[i], &t);
if (ret < 0) {
free(p);
return TEST_FAILED;
}
new_p = realloc(p, p_size+t.size+1);
if (!new_p) {
free(p);
return TEST_FAILED;
}
p = new_p;
pos = p + p_size;
memcpy(pos, t.data, t.size);
p_size += t.size;
pos += t.size;
gnutls_free((void *) (t.data)), t.data=
((void *)0)
;
}
*pos = 0;
t.size = p_size;
t.data = (void*)p;
p_size = 0;
ret = gnutls_x509_crt_list_import2(&certs, &p_size, &t, GNUTLS_X509_FMT_PEM, GNUTLS_X509_CRT_LIST_FAIL_IF_UNSORTED);
if (ret < 0) {
return TEST_FAILED;
}
for (i=0;i<p_size;i++) {
gnutls_x509_crt_deinit(certs[i]);
}
gnutls_free((void *) (certs)), certs=
((void *)0)
;
free(p);
return TEST_SUCCEED;
}
|
long test_chain_order(long a1)
{
unsigned int v2;
unsigned int v3;
unsigned int i;
unsigned int v5;
int v6;
long v7;
void *ptr;
void *dest;
long peers;
char *v11;
void *src;
size_t n;
unsigned long v14;
v14 = __readfsqword(0x28u);
v2 = 0;
sprintf(
prio_str,
"NONE:+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC:+GOST28147-TC26Z-CNT:+COMP-NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT"
":+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH:+VKO-GOST-12:%s",
protocol_str,
rest);
v5 = _gnutls_priority_set_direct(a1, prio_str, 0x622u);
if ( v5 )
return v5;
gnutls_credentials_set(a1, 1LL, xcred);
v6 = test_do_handshake(a1);
if ( v6 == 1 )
return 1LL;
if ( (unsigned int)gnutls_certificate_type_get(a1) != 1 )
return 4LL;
peers = gnutls_certificate_get_peers(a1, &v2);
if ( v2 )
{
if ( v2 == 1 )
{
return 0LL;
}
else
{
ptr = 0LL;
v3 = 0;
dest = 0LL;
for ( i = 0; i < v2; ++i )
{
src = 0LL;
v6 = gnutls_pem_base64_encode2("CERTIFICATE", 16LL * i + peers, &src);
if ( v6 < 0 || (v11 = (char *)realloc(ptr, (unsigned int)n + v3 + 1)) == 0LL )
{
free(ptr);
return 1LL;
}
ptr = v11;
dest = &v11[v3];
memcpy(dest, src, (unsigned int)n);
v3 += n;
dest = (char *)dest + (unsigned int)n;
gnutls_free(src);
src = 0LL;
}
*(_BYTE *)dest = 0;
LODWORD(n) = v3;
src = ptr;
v3 = 0;
v6 = gnutls_x509_crt_list_import2(&v7, &v3, &src, 1LL, 2LL);
if ( v6 >= 0 )
{
for ( i = 0; i < v3; ++i )
gnutls_x509_crt_deinit(*(_QWORD *)(8LL * i + v7));
gnutls_free(v7);
v7 = 0LL;
free(ptr);
return 0LL;
}
else
{
return 1LL;
}
}
}
else
{
ext_text = "No certificates found!";
return 4LL;
}
}
|
char *first_word(const char *s, const char *t) {
static char retbuf[2][131072 + 1];
static int retsel = 0;
char *rb, *rp;
retsel = 1 - retsel;
rb = &retbuf[retsel][0];
rp = rb;
while (*s && (
((void *)0)
!= strchr(t, *s))) {
s++;
}
while (*s && (
((void *)0)
== strchr(t, *s)) && (rp < &rb[131072])) {
*rp++ = *s++;
}
*rp = '\0';
return (rb);
}
|
long long first_word(unsigned long a0, char *a1) {
char *v0;
int tmp_10;
char *v1;
char *v2;
char *v4;
v0 = a0;
retsel.4845 = 1 - retsel.4845;
v2 = 131073 * retsel.4845 + &retbuf.4844;
v1 = v2;
while (true) {
if (!*(v0))
break;
if (!strchr(a1, *(v0)))
break;
v0 += 1;
}
while (true) {
if (!*(v0))
break;
if (strchr(a1, *(v0)))
break;
if (v1 >= v2 + 0x20000)
break;
tmp_10 = v0;
v0 += 1;
v4 = v1;
v1 += 1;
*(v4) = *(tmp_10);
}
*(v1) = 0;
return v2;
}
|
static int
history_next_string(HistoryW *h, HistEventW *ev, const wchar_t *str)
{
size_t len = wcslen(str);
int retval;
for (retval = (*(h)->h_curr)((h)->h_ref, ev); retval != -1; retval = (*(h)->h_prev)((h)->h_ref, ev))
if (wcsncmp(str, ev->str, len) == 0)
return 0;
{ ev->num = 9; ev->str = he_errlist[9]; };
return -1;
}
|
undefined8 history_next_string(undefined8 *param_1,undefined4 *param_2,wchar_t *param_3)
{
int iVar1;
size_t __n;
int local_14;
__n = wcslen(param_3);
local_14 = (*(code *)param_1[6])(*param_1,param_2);
while( true ) {
if (local_14 == -1) {
*param_2 = 9;
*(wchar_t **)(param_2 + 2) = L"event not found";
return 0xffffffff;
}
iVar1 = wcsncmp(param_3,*(wchar_t **)(param_2 + 2),__n);
if (iVar1 == 0) break;
local_14 = (*(code *)param_1[5])(*param_1,param_2);
}
return 0;
}
|
static
_Bool
grepdirent (FTS *fts, FTSENT *ent,
_Bool
command_line)
{
_Bool
follow;
command_line &= ent->fts_level == 0;
if (ent->fts_info == 6)
return
1
;
if (!command_line
&& skipped_file (ent->fts_name,
0
,
(ent->fts_info == 1 || ent->fts_info == 2
|| ent->fts_info == 4)))
{
rpl_fts_set (fts, ent, 4);
return
1
;
}
filename = ent->fts_path;
if (omit_dot_slash && filename[1])
filename += 2;
follow = (fts->fts_options & 0x0002
|| (fts->fts_options & 0x0001 && command_line));
switch (ent->fts_info)
{
case 1:
if (directories == RECURSE_DIRECTORIES)
return
1
;
rpl_fts_set (fts, ent, 4);
break;
case 2:
if (!suppress_errors)
error (0, 0, gettext("%s: warning: recursive directory loop"), filename);
return
1
;
case 4:
case 7:
case 10:
suppressible_error (ent->fts_errno);
return
1
;
case 3:
case 11:
if (skip_devices (command_line))
{
struct stat *st = ent->fts_statp;
struct stat st1;
if (! st->st_mode)
{
int flag = follow ? 0 :
0x100
;
if (fstatat (fts->fts_cwd_fd, ent->fts_accpath, &st1, flag) != 0)
{
suppressible_error (
(*__errno_location ())
);
return
1
;
}
st = &st1;
}
if (is_device_mode (st->st_mode))
return
1
;
}
break;
case 8:
case 13:
break;
case 12:
case 14:
return
1
;
default:
abort ();
}
return grepfile (fts->fts_cwd_fd, ent->fts_accpath, follow, command_line);
}
|
_BOOL8 grepdirent(long a1, long a2, unsigned char a3)
{
_BOOL8 result;
char v4;
bool v5;
long v6;
char *v7;
int v8;
int *v9;
bool v10;
char v11;
struct stat *v12;
struct stat v13;
unsigned long v14;
v14 = __readfsqword(0x28u);
v10 = (a3 & (*(_QWORD *)(a2 + 88) == 0LL)) != 0;
if ( *(_WORD *)(a2 + 104) == 6 )
return 1LL;
if ( (a3 & (*(_QWORD *)(a2 + 88) == 0LL)) != 0
|| (*(_WORD *)(a2 + 104) != 1 && *(_WORD *)(a2 + 104) != 2 && *(_WORD *)(a2 + 104) != 4 ? (v4 = 0) : (v4 = 1),
!skipped_file(a2 + 256, 0, v4 & 1)) )
{
filename = *(_QWORD *)(a2 + 56);
if ( omit_dot_slash && *(_BYTE *)(filename + 1) )
filename += 2LL;
v5 = (*(_DWORD *)(a1 + 72) & 2) != 0 || (*(_DWORD *)(a1 + 72) & 1) != 0 && v10;
v11 = v5;
switch ( *(_WORD *)(a2 + 104) )
{
case 1:
if ( directories == 3 )
return 1LL;
rpl_fts_set(a1, a2, 4LL);
goto LABEL_39;
case 2:
if ( suppress_errors != 1 )
{
v6 = filename;
v7 = gettext("%s: warning: recursive directory loop");
error(0, 0, v7, v6);
}
return 1LL;
case 3:
case 0xB:
if ( !skip_devices(v10) )
goto LABEL_39;
v12 = (struct stat *)(a2 + 112);
if ( *(_DWORD *)(a2 + 136) )
goto LABEL_35;
if ( v11 )
v8 = 0;
else
v8 = 256;
if ( fstatat(*(_DWORD *)(a1 + 44), *(const char **)(a2 + 48), &v13, v8) )
{
v9 = _errno_location();
suppressible_error(*v9);
result = 1LL;
}
else
{
v12 = &v13;
LABEL_35:
if ( is_device_mode(v12->st_mode) )
result = 1LL;
else
LABEL_39:
result = grepfile(*(_DWORD *)(a1 + 44), *(_QWORD *)(a2 + 48), v11, v10);
}
break;
case 4:
case 7:
case 0xA:
suppressible_error(*(_DWORD *)(a2 + 64));
return 1LL;
case 8:
case 0xD:
goto LABEL_39;
case 0xC:
case 0xE:
return 1LL;
default:
abort();
}
}
else
{
rpl_fts_set(a1, a2, 4LL);
return 1LL;
}
return result;
}
|
static char *
preproc_filterpat (pat, text)
char *pat;
const char *text;
{
char *ret;
ret = strcreplace (pat, '&', text, 1);
return ret;
}
|
int preproc_filterpat(unsigned long long a0, unsigned long long a1) {
unsigned long v0;
v0 = strcreplace(a0, 0x26, a1, 0x1);
return v0;
}
|
int
rl_forward_byte (int count, int key)
{
if (count < 0)
return (rl_backward_byte (-count, key));
if (count > 0)
{
int end, lend;
end = rl_point + count;
lend = rl_end > 0 ? rl_end - ((rl_editing_mode == 0 && _rl_keymap == vi_movement_keymap)) : rl_end;
if (end > lend)
{
rl_point = lend;
rl_ding ();
}
else
rl_point = end;
}
if (rl_end < 0)
rl_end = 0;
return 0;
}
|
void rl_forward_byte(unsigned long a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned long long v4;
unsigned long long v5;
void* v6;
v0 = a0;
if (a0 < 0) {
v4 = rl_backward_byte(-(v0), a1);
} else {
if (a0 > 0) {
v1 = a0 + rl_point;
if (rl_end <= 0) {
v5 = rl_end;
} else {
if (!rl_editing_mode && _rl_keymap == 5243032) {
v5 = 1;
goto LABEL_4004b1;
}
v5 = 0;
LABEL_4004b1:
*(&v5) = rl_end - v5;
}
v2 = v5;
if (v1 <= v2) {
rl_point = v1;
} else {
rl_point = v2;
rl_ding();
}
}
if (rl_end < 0)
rl_end = 0;
v6 = 0;
}
return;
}
|
int
do_assignment (string)
char *string;
{
WORD_DESC td;
td.flags = (1 << 2);
td.word = string;
return do_assignment_internal (&td, 1);
}
|
long do_assignment(long a1)
{
long v2;
int v3;
unsigned long v4;
v4 = __readfsqword(0x28u);
v3 = 4;
v2 = a1;
return do_assignment_internal((long)&v2, 1);
}
|
void
_rl_region_color_on (void)
{
if (_rl_active_region_start_color && _rl_active_region_end_color)
tputs (_rl_active_region_start_color, 1, _rl_output_character_function);
}
|
long long _rl_region_color_on() {
unsigned long long v1;
v1 = _rl_active_region_start_color;
if (_rl_active_region_start_color) {
v1 = _rl_active_region_end_color;
if (_rl_active_region_end_color)
v1 = tputs(_rl_active_region_start_color, 0x1, _rl_output_character_function);
}
return v1;
}
|
static Session *
session_by_channel(int id)
{
int i;
for (i = 0; i < sessions_nalloc; i++) {
Session *s = &sessions[i];
if (s->used && s->chanid == id) {
sshlog("session.c", __func__, 1836, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "session_by_channel: session %d channel %d", i, id)
;
return s;
}
}
sshlog("session.c", __func__, 1841, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "session_by_channel: unknown channel %d", id);
session_dump();
return
((void *)0)
;
}
|
int session_by_channel(unsigned long a0) {
unsigned long long v0;
unsigned long v1;
unsigned long long v2;
unsigned long v3;
unsigned int v4;
unsigned int v5[48];
unsigned int v7;
for (v4 = 0; v4 < sessions_nalloc; v4 = __addvsi3(v4, 0x1)) {
*(&v5[0]) = v4 * 232 + sessions;
if (v5[0] && a0 == v5[47]) {
v2 = a0;
v1 = v4;
v0 = "session_by_channel: session %d channel %d";
sshlog("session.c", "session_by_channel", 0x72c, 0x0, 0x5, 0x0);
v7 = v5;
return v7;
}
}
v3 = a0;
v2 = "session_by_channel: unknown channel %d";
sshlog("session.c", "session_by_channel", 0x731, 0x0, 0x5, 0x0);
session_dump();
v7 = 0;
return v7;
}
|
static int check_members (const char *groupname,
char **members,
const char *fmt_info,
const char *fmt_prompt,
const char *fmt_syslog,
int *errors)
{
int i;
int members_changed = 0;
for (i = 0;
((void *)0)
!= members[i]; i++) {
if (getpwnam (members[i]) !=
((void *)0)
) {
continue;
}
*errors += 1;
printf (fmt_info, groupname, members[i]);
printf (fmt_prompt, members[i]);
if (!yes_or_no (read_only)) {
continue;
}
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
6
, fmt_syslog, members[i], groupname) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
members_changed = 1;
delete_member (members, members[i]);
i--;
}
return members_changed;
}
|
int check_members(unsigned long a0, unsigned long long *a1, char *a2, char *a3, char *a4, unsigned int *a5) {
unsigned int *v0;
unsigned long v1;
unsigned int v2;
unsigned int v3;
void* v4;
char *v5;
v1 = a0;
v0 = a5;
v3 = 0;
for (v2 = 0; a1[v2]; v2 += 1) {
if (!getpwnam(a1[v2])) {
*(a5) = *(a5) + 1;
printf(a2);
printf(a3);
if (!(yes_or_no(read_only) ^ 1)) {
v5 = setlocale(0x6, NULL);
v4 = 0;
if (v5)
v4 = strdup(v5);
if (v4)
setlocale(0x6, "C");
syslog(0x6, a4);
if (v4) {
setlocale(0x6, v4);
free(v4);
}
v3 = 1;
delete_member(a1, a1[v2]);
v2 -= 1;
}
}
}
return v3;
}
|
struct passwd *
pwcopy(struct passwd *pw)
{
struct passwd *copy = xcalloc(1, sizeof(*copy));
copy->pw_name = xstrdup(pw->pw_name);
copy->pw_passwd = xstrdup(pw->pw_passwd ==
((void *)0)
? "*" : pw->pw_passwd);
copy->pw_gecos = xstrdup(pw->pw_gecos);
copy->pw_uid = pw->pw_uid;
copy->pw_gid = pw->pw_gid;
copy->pw_dir = xstrdup(pw->pw_dir);
copy->pw_shell = xstrdup(pw->pw_shell);
return copy;
}
|
undefined8 * pwcopy(undefined8 *param_1)
{
undefined8 *puVar1;
undefined8 uVar2;
undefined *puVar3;
puVar1 = (undefined8 *)xcalloc(1,0x30);
uVar2 = xstrdup(*param_1);
*puVar1 = uVar2;
if (param_1[1] == 0) {
puVar3 = &DAT_001082fd;
}
else {
puVar3 = (undefined *)param_1[1];
}
uVar2 = xstrdup(puVar3);
puVar1[1] = uVar2;
uVar2 = xstrdup(param_1[3]);
puVar1[3] = uVar2;
*(undefined4 *)(puVar1 + 2) = *(undefined4 *)(param_1 + 2);
*(undefined4 *)((long)puVar1 + 0x14) = *(undefined4 *)((long)param_1 + 0x14);
uVar2 = xstrdup(param_1[4]);
puVar1[4] = uVar2;
uVar2 = xstrdup(param_1[5]);
puVar1[5] = uVar2;
return puVar1;
}
|
int
timingsafe_bcmp(const void *b1, const void *b2, size_t n)
{
const unsigned char *p1 = b1, *p2 = b2;
int ret = 0;
for (; n > 0; n--)
ret |= *p1++ ^ *p2++;
return (ret != 0);
}
|
bool timingsafe_bcmp(byte *param_1,byte *param_2,long param_3)
{
byte bVar1;
long local_40;
byte *local_18;
byte *local_10;
bVar1 = 0;
local_18 = param_1;
local_10 = param_2;
for (local_40 = param_3; local_40 != 0; local_40 = local_40 + -1) {
bVar1 = bVar1 | *local_10 ^ *local_18;
local_18 = local_18 + 1;
local_10 = local_10 + 1;
}
return bVar1 != 0;
}
|
errcode_t e2fsck_run_ext3_journal(e2fsck_t ctx)
{
io_manager io_ptr = ctx->fs->io->manager;
int blocksize = ctx->fs->blocksize;
errcode_t retval, recover_retval;
io_stats stats = 0;
unsigned long long kbytes_written = 0;
printf((gettext ("%s: recovering journal\n")), ctx->device_name);
if (ctx->options & 0x0001) {
printf((gettext ("%s: won't do journal recovery while read-only\n")),
ctx->device_name);
return (2133571405L);
}
if (ctx->fs->flags & 0x04)
ext2fs_flush(ctx->fs);
recover_retval = recover_ext3_journal(ctx);
if (ctx->fs->super->s_kbytes_written &&
ctx->fs->io->manager->get_stats)
ctx->fs->io->manager->get_stats(ctx->fs->io, &stats);
if (stats && stats->bytes_written)
kbytes_written = stats->bytes_written >> 10;
ext2fs_mmp_stop(ctx->fs);
ext2fs_free(ctx->fs);
retval = ext2fs_open(ctx->filesystem_name, ctx->openfs_flags,
ctx->superblock, blocksize, io_ptr,
&ctx->fs);
if (retval) {
com_err(ctx->program_name, retval,
(gettext ("while trying to re-open %s")),
ctx->device_name);
fatal_error(ctx, 0);
}
ctx->fs->priv_data = ctx;
ctx->fs->now = ctx->now;
ctx->fs->flags |= 0x200;
ctx->fs->super->s_kbytes_written += kbytes_written;
e2fsck_clear_recover(ctx, recover_retval != 0);
retval = e2fsck_check_ext3_journal(ctx);
return retval ? retval : recover_retval;
}
|
long e2fsck_run_ext3_journal(const void **a1)
{
const void *v1;
char *v2;
const void *v3;
char *v4;
const void *v6;
char *v7;
int v8;
unsigned int v9;
long v10;
long v11;
long v12;
long v13;
long v14;
unsigned long v15;
v15 = __readfsqword(0x28u);
v12 = *(_QWORD *)(*((_QWORD *)*a1 + 1) + 8LL);
v9 = *((_DWORD *)*a1 + 10);
v10 = 0LL;
v11 = 0LL;
v1 = a1[3];
v2 = gettext("%s: recovering journal\n");
printf(v2, v1);
if ( (*((_DWORD *)a1 + 19) & 1) != 0 )
{
v3 = a1[3];
v4 = gettext("%s: won't do journal recovery while read-only\n");
printf(v4, v3);
return 2133571405LL;
}
else
{
if ( (*((_DWORD *)*a1 + 4) & 4) != 0 )
ext2fs_flush(*a1);
v13 = recover_ext3_journal(a1);
if ( *(_QWORD *)(*((_QWORD *)*a1 + 4) + 376LL) && *(_QWORD *)(*(_QWORD *)(*((_QWORD *)*a1 + 1) + 8LL) + 80LL) )
(*(void ( **)(_QWORD, long *))(*(_QWORD *)(*((_QWORD *)*a1 + 1) + 8LL) + 80LL))(
*((_QWORD *)*a1 + 1),
&v10);
if ( v10 && *(_QWORD *)(v10 + 16) )
v11 = *(_QWORD *)(v10 + 16) >> 10;
ext2fs_mmp_stop(*a1);
ext2fs_free(*a1);
v14 = ext2fs_open(a1[2], *((unsigned int *)a1 + 32), (unsigned int)a1[12], v9, v12, a1);
if ( v14 )
{
v6 = a1[3];
v7 = gettext("while trying to re-open %s");
com_err(a1[1], v14, v7, v6);
fatal_error(a1, 0LL);
}
*((_QWORD *)*a1 + 28) = a1;
*((_QWORD *)*a1 + 23) = a1[105];
v8 = *((_DWORD *)*a1 + 4);
BYTE1(v8) |= 2u;
*((_DWORD *)*a1 + 4) = v8;
*(_QWORD *)(*((_QWORD *)*a1 + 4) + 376LL) += v11;
e2fsck_clear_recover(a1, v13 != 0);
v14 = e2fsck_check_ext3_journal(a1);
if ( v14 )
return v14;
else
return v13;
}
}
|
static int print_nlmsg_tunnel(struct nlmsghdr *n, void *arg)
{
struct tnl_print_nlmsg_info *info = arg;
struct ifinfomsg *ifi = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
struct rtattr *tb[(__IFLA_MAX - 1)+1];
const char *name, *n1;
if (n->nlmsg_type != RTM_NEWLINK && n->nlmsg_type != RTM_DELLINK)
return 0;
if (n->nlmsg_len < ((sizeof(*ifi)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))))
return -1;
if (preferred_family ==
2
) {
switch (ifi->ifi_type) {
case 768:
case 778:
case 776:
break;
default:
return 0;
}
} else {
switch (ifi->ifi_type) {
case 769:
case 823:
break;
default:
return 0;
}
}
parse_rtattr(tb, (__IFLA_MAX - 1), ((struct rtattr*)(((char*)(ifi)) + ( ((sizeof(struct ifinfomsg))+4U -1) & ~(4U -1) ))), ((n)->nlmsg_len - ( (((((sizeof(struct ifinfomsg))) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))))+4U -1) & ~(4U -1) )));
if (!tb[IFLA_IFNAME])
return 0;
name = rta_getattr_str(tb[IFLA_IFNAME]);
n1 = info->p1;
if (n1[0] && strcmp(n1, name))
return 0;
info->ifi = ifi;
info->init(info);
if (tnl_get_ioctl(name, info->p2))
return 0;
if (!info->match(info))
return 0;
info->print(info->p2);
if (show_stats) {
struct rtnl_link_stats64 s;
if (get_rtnl_link_stats_rta(&s, tb) <= 0)
return -1;
tnl_print_stats(&s);
}
fputc('\n',
stdout
);
return 0;
}
|
undefined8 print_nlmsg_tunnel(uint *param_1,uint **param_2)
{
char cVar1;
uint uVar2;
int iVar3;
undefined8 uVar4;
char *__s2;
long in_FS_OFFSET;
undefined local_2c8 [208];
undefined local_1f8 [24];
long local_1e0;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
if ((*(short *)(param_1 + 1) == 0x10) || (*(short *)(param_1 + 1) == 0x11)) {
if (*param_1 < 0x20) {
uVar4 = 0xffffffff;
}
else {
if (preferred_family == 2) {
uVar2 = *(ushort *)((long)param_1 + 0x12) - 0x300;
if ((10 < uVar2) || ((1 << ((byte)uVar2 & 0x3f) & 0x501U) == 0)) {
uVar4 = 0;
goto LAB_001012d6;
}
}
else if ((*(short *)((long)param_1 + 0x12) != 0x301) &&
(*(short *)((long)param_1 + 0x12) != 0x337)) {
uVar4 = 0;
goto LAB_001012d6;
}
parse_rtattr(local_1f8,0x3c,param_1 + 8,*param_1 - 0x20);
if (local_1e0 == 0) {
uVar4 = 0;
}
else {
__s2 = (char *)rta_getattr_str(local_1e0);
if ((*(char *)param_2[1] == '\0') || (iVar3 = strcmp((char *)param_2[1],__s2), iVar3 == 0))
{
*param_2 = param_1 + 4;
(*(code *)param_2[3])(param_2);
iVar3 = tnl_get_ioctl(__s2,param_2[2]);
if (iVar3 == 0) {
cVar1 = (*(code *)param_2[4])(param_2);
if (cVar1 == '\x01') {
(*(code *)param_2[5])(param_2[2]);
if (show_stats != 0) {
iVar3 = get_rtnl_link_stats_rta(local_2c8,local_1f8);
if (iVar3 < 1) {
uVar4 = 0xffffffff;
goto LAB_001012d6;
}
tnl_print_stats(local_2c8);
}
fputc(10,stdout);
uVar4 = 0;
}
else {
uVar4 = 0;
}
}
else {
uVar4 = 0;
}
}
else {
uVar4 = 0;
}
}
}
}
else {
uVar4 = 0;
}
LAB_001012d6:
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return uVar4;
}
__stack_chk_fail();
}
|
void
bash_add_history (line)
char *line;
{
int add_it, offset, curlen, is_comment;
HIST_ENTRY *current, *old;
char *chars_to_add, *new_line;
add_it = 1;
if (command_oriented_history && current_command_line_count > 1)
{
is_comment = shell_comment (line);
if ((parser_state & 0x020000) && here_doc_first_line == 0 && line[strlen (line) - 1] == '\n')
chars_to_add = "";
else if (current_command_line_count == current_command_line_comment+1)
chars_to_add = "\n";
else if (literal_history)
chars_to_add = "\n";
else
chars_to_add = history_delimiting_chars (line);
using_history ();
current = previous_history ();
current_command_line_comment = is_comment ? current_command_line_count : -2;
if (current)
{
curlen = strlen (current->line);
if (dstack.delimiter_depth == 0 && current->line[curlen - 1] == '\\' &&
current->line[curlen - 2] != '\\')
{
current->line[curlen - 1] = '\0';
curlen--;
chars_to_add = "";
}
if (dstack.delimiter_depth == 0 && current->line[curlen - 1] == '\n' && *chars_to_add == ';')
chars_to_add++;
new_line = (char *)sh_xmalloc((1 + curlen + strlen (line) + strlen (chars_to_add)), "bashhist.c", 931)
;
sprintf (new_line, "%s%s%s", current->line, chars_to_add, line);
offset = where_history ();
old = replace_history_entry (offset, new_line, current->data);
sh_xfree((new_line), "bashhist.c", 938);
if (old)
free_history_entry (old);
add_it = 0;
}
}
if (add_it && history_is_stifled() && history_length == 0 && history_length == history_max_entries)
add_it = 0;
if (add_it)
really_add_history (line);
using_history ();
}
|
void bash_add_history(char *a0, unsigned long long a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
char *v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned long long v5;
unsigned long long v6[3];
char *v7;
unsigned long long v8;
unsigned int v10;
unsigned int v12;
unsigned long long v15;
v0 = a0;
v1 = 1;
if (command_oriented_history && current_command_line_count > 1) {
v3 = shell_comment(v0);
if ((parser_state & 0x20000) && !here_doc_first_line) {
v10 = strlen(v0);
a2 = v10 - 1;
*(&v10) = v0[1 + v10];
if (v10 == 10)
v5 = &g_4014b8;
}
if (!(parser_state & 0x20000) || here_doc_first_line || v10 != 10) {
a2 = current_command_line_comment + 1;
if (current_command_line_comment + 1 == current_command_line_count) {
v5 = "\n";
} else {
v5 = "\n";
if (false)
v5 = history_delimiting_chars(v0);
}
}
using_history(a0, a1, a2, a3, a4, a5);
v6[0] = previous_history(a0, a1, a2, a3, a4, a5);
if (v3)
v10 = current_command_line_count;
else
v10 = -2;
current_command_line_comment = v10;
if (v6) {
v2 = strlen(v6[0]);
if (!parser_state && *((v6[0] + v2 - 1)) == 92 && *((v6[0] + v2 - 2)) != 92) {
*((v6[0] + v2 - 1)) = 0;
v2 -= 1;
v5 = &g_4014b8;
}
if (!parser_state && *((v6[0] + v2 - 1)) == 10 && *(v5) == 59)
v5 += 1;
v7 = sh_xmalloc(strlen(v5) + v2 + 1 + strlen(v0), "bashhist.c", 0x3a3);
v12 = v5;
a4 = v0;
sprintf(v7, "%s%s%s", v6[0], v5, v0);
v4 = where_history(a0, "%s%s%s", v6[0], reg_24, reg_80, a5);
v8 = replace_history_entry(v4, v7, v6[2], v7);
sh_xfree(v7, "bashhist.c", 0x3aa);
if (v8)
free_history_entry(v8);
v1 = 0;
}
}
if (v1 && history_is_stifled() && !history_length) {
a2 = history_length;
if (history_length == history_max_entries)
v1 = 0;
}
if (v1)
really_add_history(v0);
v15 = using_history(a0, "bashhist.c", a2, v7, a4, a5);
return;
}
|
vi_repeat_next_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
return cv_csearch(el, el->el_search.chadir, el->el_search.chacha,
el->el_state.argument, el->el_search.chatflg);
}
|
long long vi_repeat_next_char(struct_0 *a0, unsigned long a1) {
unsigned int v0;
v0 = a1;
return cv_csearch(a0, a0->field_4ac, a0->field_4b0, a0->field_78, a0->field_4b4);
}
|
static char *myhostname (void)
{
static char name[256 + 1] = "";
if (name[0] == '\0') {
gethostname (name, sizeof (name));
name[256] = '\0';
}
return (name);
}
|
char *myhostname()
{
if ( !name_6467 )
{
gethostname(&name_6467, 0x101uLL);
byte_C20 = 0;
}
return &name_6467;
}
|
int
a2port(const char *s)
{
struct servent *se;
long long port;
const char *errstr;
port = strtonum(s, 0, 65535, &errstr);
if (errstr ==
((void *)0)
)
return (int)port;
if ((se = getservbyname(s, "tcp")) !=
((void *)0)
)
return ntohs(se->s_port);
return -1;
}
|
int a2port(char *a0) {
char v0;
unsigned long v1;
struct_0 *v2;
unsigned int v4;
v1 = strtonum(a0, 0x0, 0xffff, &v0);
if (!*(&v0)) {
v4 = v1;
} else {
v2 = &getservbyname(a0, "tcp")->s_name;
if (!v2)
v4 = -1;
else
v4 = ntohs(v2->field_10);
}
return v4;
}
|
int
channel_setup_remote_fwd_listener(struct ssh *ssh, struct Forward *fwd,
int *allocated_listen_port, struct ForwardOptions *fwd_opts)
{
if (!check_rfwd_permission(ssh, fwd)) {
ssh_packet_send_debug(ssh, "port forwarding refused");
if (fwd->listen_path !=
((void *)0)
)
sshlog("channels.c", __func__, 4032, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Received request from %.100s port %d to " "remote forward to path \"%.100s\", " "but the request was denied.", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), fwd->listen_path)
;
else if(fwd->listen_host !=
((void *)0)
)
sshlog("channels.c", __func__, 4038, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Received request from %.100s port %d to " "remote forward to host %.100s port %d, " "but the request was denied.", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), fwd->listen_host, fwd->listen_port)
;
else
sshlog("channels.c", __func__, 4044, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Received request from %.100s port %d to remote " "forward, but the request was denied.", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh))
;
return 0;
}
if (fwd->listen_path !=
((void *)0)
) {
return channel_setup_fwd_listener_streamlocal(ssh,
19, fwd, fwd_opts);
} else {
return channel_setup_fwd_listener_tcpip(ssh,
11, fwd, allocated_listen_port,
fwd_opts);
}
}
|
long long channel_setup_remote_fwd_listener(void* a0, struct_0 *a1, unsigned int *a2, void* a3) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
void* v6;
unsigned long long v7;
if (!check_rfwd_permission(a0, a1)) {
ssh_packet_send_debug(a0, "port forwarding refused", a2);
if (a1->field_10) {
v3 = a1->field_10;
v2 = ssh_remote_port(a0);
v1 = ssh_remote_ipaddr(a0);
sshlog("channels.c", "channel_setup_remote_fwd_listener", 0xfc0, 0x0, 0x3, 0x0, "Received request from %.100s port %d to remote forward to path \"%.100s\", but the request was denied.");
} else {
if (a1->field_0) {
v7 = ssh_remote_port(a0);
v2 = a1->field_8;
v1 = a1->field_0;
v0 = ssh_remote_ipaddr(a0);
sshlog("channels.c", "channel_setup_remote_fwd_listener", 0xfc6, 0x0, 0x3, 0x0, "Received request from %.100s port %d to remote forward to host %.100s port %d, but the request was denied.");
} else {
v2 = ssh_remote_port(a0);
v1 = ssh_remote_ipaddr(a0);
sshlog("channels.c", "channel_setup_remote_fwd_listener", 0xfcc, 0x0, 0x3, 0x0, "Received request from %.100s port %d to remote forward, but the request was denied.");
}
}
v6 = 0;
} else if (a1->field_10) {
v6 = channel_setup_fwd_listener_streamlocal(a0, 0x13, a1, a3);
} else {
v6 = channel_setup_fwd_listener_tcpip(a0, 0xb, a1, a2, a3);
}
return v6;
}
|
static void *
xalloc (size_t s)
{
void *p = malloc (s);
if (p)
return p;
fprintf (
stderr
, "Virtual memory exhausted.\n");
exit (
1
);
}
|
void * xalloc(size_t a1)
{
void *v2;
v2 = malloc(a1);
if ( !v2 )
{
fprintf(stderr, "Virtual memory exhausted.\n");
exit(1);
}
return v2;
}
|
void
free_mail_files ()
{
register int i;
for (i = 0; i < mailfiles_count; i++)
dispose_mail_file (mailfiles[i]);
if (mailfiles)
sh_xfree((mailfiles), "mailcheck.c", 243);
mailfiles_count = 0;
mailfiles = (FILEINFO **)
((void *)0)
;
}
|
long long free_mail_files() {
void* v1;
unsigned long long *v2;
for (v1 = 0; v1 < mailfiles_count; v1 = v1 + 1) {
dispose_mail_file(*((mailfiles + 0x8 * v1)));
}
v2 = mailfiles;
if (mailfiles)
v2 = sh_xfree(mailfiles, "mailcheck.c", 0xf3);
mailfiles_count = 0;
mailfiles = 0;
return v2;
}
|
static inline void
emit_ancillary_info (char const *program)
{
struct infomap { char const *program; char const *node; } const infomap[] = {
{ "[", "test invocation" },
{ "coreutils", "Multi-call invocation" },
{ "sha224sum", "sha2 utilities" },
{ "sha256sum", "sha2 utilities" },
{ "sha384sum", "sha2 utilities" },
{ "sha512sum", "sha2 utilities" },
{
((void *)0)
,
((void *)0)
}
};
char const *node = program;
struct infomap const *map_prog = infomap;
while (map_prog->program && ! (strcmp (program, map_prog->program) == 0))
map_prog++;
if (map_prog->node)
node = map_prog->node;
printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https:
char const *lc_messages = setlocale (
5
,
((void *)0)
);
if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1))
{
fputs_unlocked (gettext ("Report any translation bugs to " "<https:
stdout
)
;
}
char const *url_program = (strcmp (program, "[") == 0) ? "test" : program;
printf (gettext ("Full documentation <%s%s>\n"),
"https:
printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"),
node, node == program ? " invocation" : "");
}
|
void emit_ancillary_info(char *a0) {
unsigned long v0;
unsigned long long v1[2];
char *v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
void* v16;
void* v17;
char v18;
unsigned long long v20;
unsigned long long *v21;
unsigned long long v22;
v4 = "[";
v5 = "test invocation";
v6 = "coreutils";
v7 = "Multi-call invocation";
v8 = "sha224sum";
v9 = "sha2 utilities";
v10 = "sha256sum";
v11 = "sha2 utilities";
v12 = "sha384sum";
v13 = "sha2 utilities";
v14 = "sha512sum";
v15 = "sha2 utilities";
v16 = 0;
v17 = 0;
v0 = a0;
v1[0] = &v4;
while (true) {
if (!v1[0])
break;
if (!strcmp(a0, v1[0]))
break;
v1[0] = v1 + 1;
}
if (v1[1])
v0 = v1[1];
printf(gettext("\n%s online help: <%s>\n"));
v2 = setlocale(0x5, NULL);
if (v2 && strncmp(v2, "en_", 0x3))
fputs_unlocked(gettext("Report any translation bugs to <https:
if (!strcmp(a0, "["))
v20 = "test";
else
v20 = a0;
v3 = v20;
printf(gettext("Full documentation <%s%s>\n"));
printf(gettext("or available locally via: info '(coreutils) %s%s'\n"));
v22 = *(&v18) ^ v21[5];
return;
}
|
static void
write_block (uintmax_t current_offset, size_t n_bytes,
char const *prev_block, char const *curr_block)
{
static
_Bool
first =
1
;
static
_Bool
prev_pair_equal =
0
;
if (abbreviate_duplicate_blocks
&& !first && n_bytes == bytes_per_block
&& (memcmp (prev_block, curr_block, bytes_per_block) == 0))
{
if (prev_pair_equal)
{
}
else
{
printf ("*\n");
prev_pair_equal =
1
;
}
}
else
{
prev_pair_equal =
0
;
for (size_t i = 0; i < n_specs; i++)
{
int datum_width = width_bytes[spec[i].size];
int fields_per_block = bytes_per_block / datum_width;
int blank_fields = (bytes_per_block - n_bytes) / datum_width;
if (i == 0)
format_address (current_offset, '\0');
else
printf ("%*s", address_pad_len, "");
(*spec[i].print_function) (fields_per_block, blank_fields,
curr_block, spec[i].fmt_string,
spec[i].field_width, spec[i].pad_width);
if (spec[i].hexl_mode_trailer)
{
int field_width = spec[i].field_width;
int pad_width = (spec[i].pad_width * blank_fields
/ fields_per_block);
printf ("%*s", blank_fields * field_width + pad_width, "");
dump_hexl_mode_trailer (n_bytes, curr_block);
}
putchar_unlocked ('\n');
}
}
first =
0
;
}
|
void write_block(unsigned long long a0, unsigned int a1, void* a2, unsigned long a3) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
void* v5;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
if (!abbreviate_duplicate_blocks || !(first.6436 ^ 1) || a1 != bytes_per_block || memcmp(a2, a3, bytes_per_block)) {
prev_pair_equal.6437 = 0;
v5 = 0;
while (true) {
v8 = n_specs;
if (v5 >= n_specs)
break;
v0 = *((4 * *((v5 * 40 + spec + 4)) + &width_bytes));
v1 = (0 CONCAT bytes_per_block) /m v0;
v2 = (0 CONCAT bytes_per_block - a1) /m v0;
if (v5)
printf("%*s");
else
format_address(a0, 0, format_address);
*(((stack_base)[16] * 40 + *(4211432) + 8))(v1, v2, a3, v5 * 40 + spec + 16, *((v5 * 40 + spec + 28)), *((v5 * 40 + spec + 32)));
if (*((((v5 << 2) + v5 << 3) + spec + 24))) {
v3 = *((v5 * 40 + spec + 28));
v4 = (v2 * *((v5 * 40 + spec + 32)) >> 31 CONCAT v2 * *((v5 * 40 + spec + 32))) /m v1;
printf("%*s");
dump_hexl_mode_trailer(a1, a3);
}
putchar_unlocked(0xa);
v5 += 1;
}
} else {
v7 = prev_pair_equal.6437;
if (!prev_pair_equal.6437) {
v9 = printf("*\n");
prev_pair_equal.6437 = 1;
}
}
first.6436 = 0;
return;
}
|
void
sv_comp_wordbreaks (name)
char *name;
{
SHELL_VAR *sv;
sv = find_variable (name);
if (sv == 0)
reset_completer_word_break_chars ();
}
|
long * sv_comp_wordbreaks(long a1)
{
long *result;
result = find_variable(a1);
if ( !result )
return (long *)reset_completer_word_break_chars();
return result;
}
|
static char *
make_id_equals_comment (STRUCT_UTMP const *utmp_ent)
{
size_t utmpsize = sizeof ((utmp_ent)->ut_id);
char *comment = xmalloc (strlen (gettext ("id=")) + utmpsize + 1);
char *p = stpcpy (comment, gettext ("id="));
stzncpy (p, ((utmp_ent)->ut_id), utmpsize);
return comment;
}
|
char * make_id_equals_comment(long param_1)
{
char *pcVar1;
size_t sVar2;
char *pcVar3;
pcVar1 = (char *)gettext(&DAT_00101f2d);
sVar2 = strlen(pcVar1);
pcVar1 = (char *)xmalloc(sVar2 + 5);
pcVar3 = (char *)gettext(&DAT_00101f2d);
pcVar3 = stpcpy(pcVar1,pcVar3);
stzncpy(pcVar3,param_1 + 0x28,4);
return pcVar1;
}
|
static int
getentropy_getrandom(void *buf, size_t len)
{
int pre_errno =
(*__errno_location ())
;
int ret;
if (len > 256)
return (-1);
do {
ret = syscall(
318
, buf, len,
0x0001
);
} while (ret == -1 &&
(*__errno_location ())
==
4
);
if (ret != (int)len)
return (-1);
(*__errno_location ())
= pre_errno;
return (0);
}
|
int getentropy_getrandom(unsigned long a0, unsigned long a1) {
unsigned long v0;
unsigned int v1;
unsigned int v2;
unsigned int v5;
v0 = a0;
v1 = *(__errno_location());
if (a1 > 0x100) {
v5 = -1;
} else {
while (true) {
v2 = syscall(0x13e);
if (v2 != -1)
break;
if (*(__errno_location()) != 4)
break;
}
if (v2 != a1) {
v5 = -1;
} else {
*(__errno_location()) = v1;
v5 = 0;
}
}
return v5;
}
|
void
freefunc(struct funcnode *f)
{
if (f && --f->count < 0)
free((pointer)(f));
}
|
void freefunc(int *param_1)
{
if ((param_1 != (int *)0x0) && (*param_1 = *param_1 + -1, *param_1 < 0)) {
free(param_1);
}
return;
}
|
static int Rq_recip3(Fq *out,const small *in)
{
Fq f[761 +1],g[761 +1],v[761 +1],r[761 +1];
int i,loop,delta;
int swap,t;
crypto_int32 f0,g0;
Fq scale;
for (i = 0;i < 761 +1;++i) v[i] = 0;
for (i = 0;i < 761 +1;++i) r[i] = 0;
r[0] = Fq_recip(3);
for (i = 0;i < 761;++i) f[i] = 0;
f[0] = 1; f[761 -1] = f[761] = -1;
for (i = 0;i < 761;++i) g[761 -1-i] = in[i];
g[761] = 0;
delta = 1;
for (loop = 0;loop < 2*761 -1;++loop) {
for (i = 761;i > 0;--i) v[i] = v[i-1];
v[0] = 0;
swap = int16_negative_mask(-delta) & int16_nonzero_mask(g[0]);
delta ^= swap&(delta^-delta);
delta += 1;
for (i = 0;i < 761 +1;++i) {
t = swap&(f[i]^g[i]); f[i] ^= t; g[i] ^= t;
t = swap&(v[i]^r[i]); v[i] ^= t; r[i] ^= t;
}
f0 = f[0];
g0 = g[0];
for (i = 0;i < 761 +1;++i) g[i] = Fq_freeze(f0*g[i]-g0*f[i]);
for (i = 0;i < 761 +1;++i) r[i] = Fq_freeze(f0*r[i]-g0*v[i]);
for (i = 0;i < 761;++i) g[i] = g[i+1];
g[761] = 0;
}
scale = Fq_recip(f[0]);
for (i = 0;i < 761;++i) out[i] = Fq_freeze(scale*(crypto_int32)v[761 -1-i]);
return int16_nonzero_mask(delta);
}
|
void Rq_recip3(unsigned short *a0, char *a1, unsigned long a2) {
unsigned short v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
char v8;
unsigned short v9;
unsigned short v10;
char v11;
unsigned long long v12;
unsigned short v13;
char v14;
char v15;
unsigned short *v17;
unsigned long v19;
unsigned long v21;
unsigned short *v22;
unsigned long v24;
unsigned long long v25;
v12 = *(&v12);
for (v1 = 0; v1 <= 761; v1 = __addvsi3(v1, 0x1, a2)) {
*(&(&v14)[2 * v1]) = 0;
}
for (v1 = 0; v1 <= 761; v1 = __addvsi3(v1, 0x1, a2)) {
*(&(&v15)[2 * v1]) = 0;
}
v15 = Fq_recip(0x3);
for (v1 = 0; v1 <= 760; v1 = __addvsi3(v1, 0x1, a2)) {
*(&(&v8)[2 * v1]) = 0;
}
v8 = 1;
v10 = 65535;
v9 = v10;
for (v1 = 0; v1 <= 760; v1 = __addvsi3(v1, 0x1, reg_32)) {
a2 = a1[v1];
*(&(&v11)[2 * __subvsi3(0x2f8, v1, v1)]) = a1[v1];
}
v13 = 0;
v3 = 1;
for (v2 = 0; v2 <= 1520; v2 = __addvsi3(v2, 0x1, a2)) {
for (v1 = 761; v1 > 0; v1 = __addvsi3(v1, 0xffffffff, *((&v14 + 0x2 * v17)))) {
v17 = __addvsi3(v1, 0xffffffff, a2);
a2 = *((&v14 + 0x2 * v17));
*(&(&v14)[2 * v1]) = *((&v14 + 0x2 * v17));
}
v14 = 0;
v4 = int16_nonzero_mask(*(&v11)) & int16_negative_mask(-(v3));
v3 ^= (__negvsi2(v3) ^ v3) & v4;
v3 = __addvsi3(v3, 0x1, a2);
for (v1 = 0; v1 <= 761; v1 = __addvsi3(v1, 0x1, v7 ^ *(&(&v15)[2 * v1]))) {
v7 = (*(&(&v11)[2 * v1]) ^ *(&(&v8)[2 * v1])) & v4;
*(&(&v8)[2 * v1]) = v7 ^ *(&(&v8)[2 * v1]);
*(&(&v11)[2 * v1]) = v7 ^ *(&(&v11)[2 * v1]);
v7 = (*(&(&v15)[2 * v1]) ^ *(&(&v14)[2 * v1])) & v4;
*(&(&v14)[2 * v1]) = v7 ^ *(&(&v14)[2 * v1]);
a2 = v7 ^ *(&(&v15)[2 * v1]);
*(&(&v15)[2 * v1]) = v7 ^ *(&(&v15)[2 * v1]);
}
v5 = v8;
v6 = *(&v11);
for (v1 = 0; v1 <= 761; v1 = __addvsi3(v1, 0x1, v1)) {
v19 = __subvsi3(__mulvsi3(*(&(&v11)[2 * v1]), v5, a2), __mulvsi3(*(&(&v8)[2 * v1]), v6, a2), a2);
*(&(&v11)[2 * v1]) = Fq_freeze(v19, a1, a2);
}
for (v1 = 0; v1 <= 761; v1 = __addvsi3(v1, 0x1, v1)) {
v21 = __subvsi3(__mulvsi3(*(&(&v15)[2 * v1]), v5, a2), __mulvsi3(*(&(&v14)[2 * v1]), v6, a2), a2);
*(&(&v15)[2 * v1]) = Fq_freeze(v21, a1, a2);
}
for (v1 = 0; v1 <= 760; v1 = __addvsi3(v1, 0x1, *((&v11 + 0x2 * v22)))) {
v22 = __addvsi3(v1, 0x1, a2);
a2 = *((&v11 + 0x2 * v22));
*(&(&v11)[2 * v1]) = *((&v11 + 0x2 * v22));
}
v13 = 0;
}
v0 = Fq_recip(v8);
for (v1 = 0; v1 <= 760; v1 = __addvsi3(v1, 0x1, a2)) {
v24 = __mulvsi3(v0, *(&(&v14)[2 * __subvsi3(0x2f8, v1, a2)]), a2);
a0[v1] = Fq_freeze(v24, a1, v1 * 2);
}
v25 = int16_nonzero_mask(v3);
return;
}
|
void
list_dumpdir (char *buffer, size_t size)
{
int state = 0;
while (size)
{
switch (*buffer)
{
case 'Y':
case 'N':
case 'D':
case 'R':
case 'T':
case 'X':
fprintf (stdlis, "%c", *buffer);
if (state == 0)
{
fprintf (stdlis, " ");
state = 1;
}
buffer++;
size--;
break;
case 0:
fputc_unlocked ('\n',stdlis);
buffer++;
size--;
state = 0;
break;
default:
fputc_unlocked (*buffer,stdlis);
buffer++;
size--;
}
}
}
|
long long list_dumpdir(unsigned long a0, unsigned long a1) {
unsigned long v0;
char *v1;
unsigned int v2;
unsigned long long v4;
v1 = a0;
v0 = a1;
for (v2 = 0; v0; v2 = 0) {
if (!*(v1)) {
v4 = fputc_unlocked(0xa, *(&stdlis));
v1 += 1;
v0 -= 1;
} else if (*(v1) >= 0 && *(v1) <= 89 && *(v1) >= 68) {
switch (*(v1)) {
case 68: case 78: case 82: case 84: case 88: case 89:
v4 = fprintf(*(&stdlis), "%c", *(v1));
if (!v2) {
v4 = fprintf(*(&stdlis), " ");
v2 = 1;
}
v1 += 1;
v0 -= 1;
break;
default:
v4 = fputc_unlocked(*(v1), *(&stdlis));
v1 += 1;
v0 -= 1;
break;
}
}
}
return v4;
}
|
void unsetvar(const char *s)
{
setvar(s, 0, 0);
}
|
void unsetvar(void* a0) {
unsigned long long v1;
v1 = setvar(a0, NULL, 0x0);
return;
}
|
int
main(int argc, char **argv)
{
struct passwd *user_pw;
sanitise_stdfd();
if ((user_pw = getpwuid(getuid())) ==
((void *)0)
) {
fprintf(
stderr
, "No user found for uid %lu\n",
(u_long)getuid());
return 1;
}
return (sftp_server_main(argc, argv, user_pw));
}
|
int main(unsigned long a0, unsigned long long a1) {
unsigned long long v0;
unsigned int v2;
sanitise_stdfd();
v0 = getpwuid(getuid());
if (!v0) {
fprintf(stderr, "No user found for uid %lu\n", getuid());
v2 = 1;
} else {
v2 = sftp_server_main(a0, a1, v0, a1);
}
return v2;
}
|
static inline __u8 rta_getattr_u8(const struct rtattr *rta)
{
return *(__u8 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
|
int rta_getattr_u8(struct_0 *a0) {
return a0->field_4;
}
|
void
array_dispose(a)
ARRAY *a;
{
if (a == 0)
return;
array_flush (a);
array_dispose_element(a->head);
sh_xfree((a), "array.c", 123);
}
|
void array_dispose(struct_0 *a0) {
unsigned long long v1;
if (a0) {
array_flush(a0);
array_dispose_element(a0->field_10);
v1 = sh_xfree(a0, "array.c", 0x7b);
}
return;
}
|
static void
session_dump(void)
{
int i;
for (i = 0; i < sessions_nalloc; i++) {
Session *s = &sessions[i];
sshlog("session.c", __func__, 1785, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "dump: used %d next_unused %d session %d " "channel %d pid %ld", s->used, s->next_unused, s->self, s->chanid, (long)s->pid)
;
}
}
|
void session_dump(void)
{
undefined4 *puVar1;
int local_14;
for (local_14 = 0; local_14 < sessions_nalloc; local_14 = __addvsi3(local_14)) {
puVar1 = (undefined4 *)((long)local_14 * 0xe8 + sessions);
sshlog("session.c","session_dump",0x6f9,0,5,0,
"dump: used %d next_unused %d session %d channel %d pid %ld",*puVar1,puVar1[2],puVar1[1],
puVar1[0x2f],(long)(int)puVar1[8]);
}
return;
}
|
int
main (int argc, char **argv)
{
char limit[1 +
(((
((((((sizeof (intmax_t) * 8) - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) + 1)
)>(
((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)
))?(
((((((sizeof (intmax_t) * 8) - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) + 1)
):(
((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)
))
];
;
set_program_name (argv[0]);
setlocale (
6
, "");
bindtextdomain ("coreutils", "/usr/local/share/locale");
textdomain ("coreutils");
initialize_exit_failure (
1
);
atexit (close_stdout);
parse_long_options (argc, argv, "getlimits", "GNU coreutils", "9.1",
usage, ("Padraig Brady"), (char const *)
((void *)0)
);
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t) 0x7f); printf ("CHAR""_MAX=%s\n", limit + 1); printf ("CHAR""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (
(-0x7f - 1)
) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t)
(-0x7f - 1)
); printf ("CHAR""_MIN=%s\n", limit + 1); printf ("CHAR""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t) 0x7f); printf ("SCHAR""_MAX=%s\n", limit + 1); printf ("SCHAR""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (
(-0x7f - 1)
) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t)
(-0x7f - 1)
); printf ("SCHAR""_MIN=%s\n", limit + 1); printf ("SCHAR""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t)
(0x7f * 2 + 1)
); printf ("UCHAR""_MAX=%s\n", limit + 1); printf ("UCHAR""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (0) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t) 0); printf ("UCHAR""_MIN=%s\n", limit + 1); printf ("UCHAR""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t) 0x7fff); printf ("SHRT""_MAX=%s\n", limit + 1); printf ("SHRT""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (
(-0x7fff - 1)
) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t)
(-0x7fff - 1)
); printf ("SHRT""_MIN=%s\n", limit + 1); printf ("SHRT""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t) 0x7fffffff); printf ("INT""_MAX=%s\n", limit + 1); printf ("INT""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (
(-0x7fffffff - 1)
) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t)
(-0x7fffffff - 1)
); printf ("INT""_MIN=%s\n", limit + 1); printf ("INT""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t)
(0x7fffffff * 2U + 1U)
); printf ("UINT""_MAX=%s\n", limit + 1); printf ("UINT""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (0) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t) 0); printf ("UINT""_MIN=%s\n", limit + 1); printf ("UINT""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t) 0x7fffffffffffffffL); printf ("LONG""_MAX=%s\n", limit + 1); printf ("LONG""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (
(-0x7fffffffffffffffL - 1L)
) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t)
(-0x7fffffffffffffffL - 1L)
); printf ("LONG""_MIN=%s\n", limit + 1); printf ("LONG""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t)
(0x7fffffffffffffffL * 2UL + 1UL)
); printf ("ULONG""_MAX=%s\n", limit + 1); printf ("ULONG""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (0) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t) 0); printf ("ULONG""_MIN=%s\n", limit + 1); printf ("ULONG""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t)
(18446744073709551615UL)
); printf ("SIZE""_MAX=%s\n", limit + 1); printf ("SIZE""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (0) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t) 0); printf ("SIZE""_MIN=%s\n", limit + 1); printf ("SIZE""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t) 0x7fffffffffffffffL); printf ("SSIZE""_MAX=%s\n", limit + 1); printf ("SSIZE""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (((ssize_t) ~ ((ssize_t) (! (! ((ssize_t) 0 < (ssize_t) -1)) ? (ssize_t) -1 : ((((ssize_t) 1 << ((sizeof (ssize_t) * 8) - 2)) - 1) * 2 + 1))))) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t) ((ssize_t) ~ ((ssize_t) (! (! ((ssize_t) 0 < (ssize_t) -1)) ? (ssize_t) -1 : ((((ssize_t) 1 << ((sizeof (ssize_t) * 8) - 2)) - 1) * 2 + 1))))); printf ("SSIZE""_MIN=%s\n", limit + 1); printf ("SSIZE""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t) ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1)))); printf ("TIME_T""_MAX=%s\n", limit + 1); printf ("TIME_T""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (((time_t) ~ ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))))) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t) ((time_t) ~ ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))))); printf ("TIME_T""_MIN=%s\n", limit + 1); printf ("TIME_T""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t) ((uid_t) (! (! ((uid_t) 0 < (uid_t) -1)) ? (uid_t) -1 : ((((uid_t) 1 << ((sizeof (uid_t) * 8) - 2)) - 1) * 2 + 1)))); printf ("UID_T""_MAX=%s\n", limit + 1); printf ("UID_T""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (0) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t) 0); printf ("UID_T""_MIN=%s\n", limit + 1); printf ("UID_T""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t) ((gid_t) (! (! ((gid_t) 0 < (gid_t) -1)) ? (gid_t) -1 : ((((gid_t) 1 << ((sizeof (gid_t) * 8) - 2)) - 1) * 2 + 1)))); printf ("GID_T""_MAX=%s\n", limit + 1); printf ("GID_T""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (0) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t) 0); printf ("GID_T""_MIN=%s\n", limit + 1); printf ("GID_T""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t) ((pid_t) (! (! ((pid_t) 0 < (pid_t) -1)) ? (pid_t) -1 : ((((pid_t) 1 << ((sizeof (pid_t) * 8) - 2)) - 1) * 2 + 1)))); printf ("PID_T""_MAX=%s\n", limit + 1); printf ("PID_T""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (((pid_t) ~ ((pid_t) (! (! ((pid_t) 0 < (pid_t) -1)) ? (pid_t) -1 : ((((pid_t) 1 << ((sizeof (pid_t) * 8) - 2)) - 1) * 2 + 1))))) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t) ((pid_t) ~ ((pid_t) (! (! ((pid_t) 0 < (pid_t) -1)) ? (pid_t) -1 : ((((pid_t) 1 << ((sizeof (pid_t) * 8) - 2)) - 1) * 2 + 1))))); printf ("PID_T""_MIN=%s\n", limit + 1); printf ("PID_T""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t) ((off_t) (! (! ((off_t) 0 < (off_t) -1)) ? (off_t) -1 : ((((off_t) 1 << ((sizeof (off_t) * 8) - 2)) - 1) * 2 + 1)))); printf ("OFF_T""_MAX=%s\n", limit + 1); printf ("OFF_T""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (((off_t) ~ ((off_t) (! (! ((off_t) 0 < (off_t) -1)) ? (off_t) -1 : ((((off_t) 1 << ((sizeof (off_t) * 8) - 2)) - 1) * 2 + 1))))) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t) ((off_t) ~ ((off_t) (! (! ((off_t) 0 < (off_t) -1)) ? (off_t) -1 : ((((off_t) 1 << ((sizeof (off_t) * 8) - 2)) - 1) * 2 + 1))))); printf ("OFF_T""_MIN=%s\n", limit + 1); printf ("OFF_T""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t)
(9223372036854775807L)
); printf ("INTMAX""_MAX=%s\n", limit + 1); printf ("INTMAX""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (
(-9223372036854775807L -1)
) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t)
(-9223372036854775807L -1)
); printf ("INTMAX""_MIN=%s\n", limit + 1); printf ("INTMAX""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
sprintf (limit + 1, "%"
"l" "u"
, (uintmax_t)
(18446744073709551615UL)
); printf ("UINTMAX""_MAX=%s\n", limit + 1); printf ("UINTMAX""_OFLOW=%s\n", decimal_absval_add_one (limit)); if (0) { sprintf (limit + 1, "%"
"l" "d"
, (intmax_t) 0); printf ("UINTMAX""_MIN=%s\n", limit + 1); printf ("UINTMAX""_UFLOW=%s\n", decimal_absval_add_one (limit)); };
printf ("FLT""_MIN="); print_FLT (1.17549435082228750796873653722224568e-38F); printf ("FLT""_MAX="); print_FLT (3.40282346638528859811704183484516925e+38F);;
printf ("DBL""_MIN="); print_DBL (((double)2.22507385850720138309023271733240406e-308L)); printf ("DBL""_MAX="); print_DBL (((double)1.79769313486231570814527423731704357e+308L));;
printf ("LDBL""_MIN="); print_LDBL (3.36210314311209350626267781732175260e-4932L); printf ("LDBL""_MAX="); print_LDBL (1.18973149535723176502126385303097021e+4932L);;
return
0
;
}
|
undefined8 main(undefined4 param_1,undefined8 *param_2)
{
undefined8 uVar1;
long in_FS_OFFSET;
undefined local_28;
char acStack39 [23];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
set_program_name(*param_2);
setlocale(6,"");
bindtextdomain("coreutils","/usr/local/share/locale");
textdomain("coreutils");
initialize_exit_failure(1);
atexit(p_Ram00000000001005c1);
parse_long_options(param_1,param_2,"getlimits","GNU coreutils",&DAT_00101393,usage,"Padraig Brady"
,0);
sprintf(acStack39,"%lu",0x7f);
printf("CHAR_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("CHAR_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%ld",0xffffffffffffff80);
printf("CHAR_MIN=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("CHAR_UFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0x7f);
printf("SCHAR_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("SCHAR_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%ld",0xffffffffffffff80);
printf("SCHAR_MIN=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("SCHAR_UFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0xff);
printf("UCHAR_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("UCHAR_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0x7fff);
printf("SHRT_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("SHRT_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%ld",0xffffffffffff8000);
printf("SHRT_MIN=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("SHRT_UFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0x7fffffff);
printf("INT_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("INT_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%ld",0xffffffff80000000);
printf("INT_MIN=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("INT_UFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0xffffffff);
printf("UINT_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("UINT_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0x7fffffffffffffff);
printf("LONG_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("LONG_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%ld",0x8000000000000000);
printf("LONG_MIN=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("LONG_UFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0xffffffffffffffff);
printf("ULONG_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("ULONG_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0xffffffffffffffff);
printf("SIZE_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("SIZE_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0x7fffffffffffffff);
printf("SSIZE_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("SSIZE_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%ld",0x8000000000000000);
printf("SSIZE_MIN=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("SSIZE_UFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0x7fffffffffffffff);
printf("TIME_T_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("TIME_T_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%ld",0x8000000000000000);
printf("TIME_T_MIN=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("TIME_T_UFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0xffffffff);
printf("UID_T_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("UID_T_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0xffffffff);
printf("GID_T_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("GID_T_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0x7fffffff);
printf("PID_T_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("PID_T_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%ld",0xffffffff80000000);
printf("PID_T_MIN=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("PID_T_UFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0x7fffffffffffffff);
printf("OFF_T_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("OFF_T_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%ld",0x8000000000000000);
printf("OFF_T_MIN=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("OFF_T_UFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0x7fffffffffffffff);
printf("INTMAX_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("INTMAX_OFLOW=%s\n",uVar1);
sprintf(acStack39,"%ld",0x8000000000000000);
printf("INTMAX_MIN=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("INTMAX_UFLOW=%s\n",uVar1);
sprintf(acStack39,"%lu",0xffffffffffffffff);
printf("UINTMAX_MAX=%s\n",acStack39);
uVar1 = decimal_absval_add_one(&local_28);
printf("UINTMAX_OFLOW=%s\n",uVar1);
printf("FLT_MIN=");
print_FLT();
printf("FLT_MAX=");
print_FLT();
printf("DBL_MIN=");
print_DBL(DAT_00101710);
printf("DBL_MAX=");
print_DBL(DAT_00101718);
printf("LDBL_MIN=");
print_LDBL();
printf("LDBL_MAX=");
print_LDBL();
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return 0;
}
|
static void
set_divertto(const struct cmdinfo *cip, const char *value)
{
opt_divertto = value;
if (opt_divertto[0] != '/')
badusage(gettext("filename \"%s\" is not absolute"), opt_divertto);
if (strchr(opt_divertto, '\n') !=
((void *)0)
)
badusage(gettext("divert-to may not contain newlines"));
}
|
char * set_divertto(long a1, char *a2)
{
char *v2;
char *v3;
char *result;
char *v5;
opt_divertto = a2;
if ( *a2 != 47 )
{
v2 = opt_divertto;
v3 = gettext("filename \"%s\" is not absolute");
badusage(v3, v2);
}
result = strchr(opt_divertto, 10);
if ( result )
{
v5 = gettext("divert-to may not contain newlines");
return (char *)badusage(v5, 10LL);
}
return result;
}
|
static void
usage(void)
{
fprintf(
stderr
,
"usage: ssh-add [-cDdKkLlqvXx] [-E fingerprint_hash] [-H hostkey_file]\n"
" [-h destination_constraint] [-S provider] [-t life]\n"
" [file ...]\n"
" ssh-add -s pkcs11\n"
" ssh-add -e pkcs11\n"
" ssh-add -T pubkey ...\n"
);
}
|
int usage()
{
return fprintf(
stderr,
"usage: ssh-add [-cDdKkLlqvXx] [-E fingerprint_hash] [-H hostkey_file]\n"
" [-h destination_constraint] [-S provider] [-t life]\n"
" [file ...]\n"
" ssh-add -s pkcs11\n"
" ssh-add -e pkcs11\n"
" ssh-add -T pubkey ...\n");
}
|
static int
sshsig_check_hashalg(const char *hashalg)
{
if (hashalg ==
((void *)0)
||
match_pattern_list(hashalg, "sha256,sha512", 0) == 1)
return 0;
sshlog("sshsig.c", __func__, 252, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "unsupported hash algorithm \"%.100s\"", hashalg);
return -58;
}
|
int sshsig_check_hashalg(unsigned long long a0) {
unsigned long long v0;
unsigned long v1;
unsigned int v3;
if (!a0) {
LABEL_400bfd:
v3 = 0;
} else {
if (match_pattern_list(a0, "sha256,sha512", 0x0) == 1)
goto LABEL_400bfd;
v1 = a0;
v0 = "unsupported hash algorithm \"%.100s\"";
sshlog("sshsig.c", "sshsig_check_hashalg", 0xfc, 0x1, 0x2, 0x0);
v3 = -58;
}
return v3;
}
|
void
print_private_key(FILE *outfile, common_info_st * cinfo, gnutls_x509_privkey_t key)
{
int ret;
size_t size;
if (!key)
return;
switch_to_pkcs8_when_needed(cinfo, key, gnutls_x509_privkey_get_pk_algorithm(key));
if (!cinfo->pkcs8) {
if (cinfo->outtext)
privkey_info_int(outfile, cinfo, key);
size = lbuffer_size;
ret = gnutls_x509_privkey_export(key, cinfo->outcert_format,
lbuffer, &size);
if (ret < 0) {
fprintf(
stderr
, "privkey_export: %s\n",
gnutls_strerror(ret));
app_exit(1);
}
} else {
unsigned int flags = 0;
const char *pass;
pass = get_password(cinfo, &flags, 0);
flags |= cipher_to_flags(cinfo->pkcs_cipher);
if (cinfo->outtext && (flags & GNUTLS_PKCS_PLAIN))
privkey_info_int(outfile, cinfo, key);
size = lbuffer_size;
ret =
gnutls_x509_privkey_export_pkcs8(key, cinfo->outcert_format,
pass, flags, lbuffer,
&size);
if (ret < 0) {
fprintf(
stderr
, "privkey_export_pkcs8: %s\n",
gnutls_strerror(ret));
app_exit(1);
}
}
fwrite(lbuffer, 1, size, outfile);
}
|
unsigned long print_private_key(FILE *a1, long a2, long a3)
{
unsigned int pk_algorithm;
const char *v4;
int v5;
const char *v6;
unsigned int v9;
unsigned int v10;
size_t n;
_BYTE *password;
unsigned long v13;
v13 = __readfsqword(0x28u);
if ( a3 )
{
pk_algorithm = gnutls_x509_privkey_get_pk_algorithm(a3);
switch_to_pkcs8_when_needed(a2, a3, pk_algorithm);
if ( !*(_DWORD *)(a2 + 24) )
{
if ( *(_DWORD *)(a2 + 36) )
privkey_info_int(a1, a2, a3);
n = lbuffer_size;
v10 = gnutls_x509_privkey_export(a3, *(unsigned int *)(a2 + 32), lbuffer, &n);
if ( (v10 & 0x80000000) == 0 )
goto LABEL_12;
v4 = (const char *)gnutls_strerror(v10);
fprintf(stderr, "privkey_export: %s\n", v4);
app_exit(1LL);
}
v9 = 0;
password = get_password(a2, (int *)&v9, 0);
v5 = cipher_to_flags(*(const char **)(a2 + 104));
v9 |= v5;
if ( *(_DWORD *)(a2 + 36) && (v9 & 1) != 0 )
privkey_info_int(a1, a2, a3);
n = lbuffer_size;
v10 = gnutls_x509_privkey_export_pkcs8(a3, *(unsigned int *)(a2 + 32), password, v9, lbuffer, &n);
if ( (v10 & 0x80000000) != 0 )
{
v6 = (const char *)gnutls_strerror(v10);
fprintf(stderr, "privkey_export_pkcs8: %s\n", v6);
app_exit(1LL);
}
LABEL_12:
fwrite(lbuffer, 1uLL, n, a1);
}
return __readfsqword(0x28u) ^ v13;
}
|
static int
isnbspace (int c)
{
return iswnbspace (btowc (c));
}
|
_BOOL8 isnbspace(int a1)
{
int v1;
v1 = btowc(a1);
return iswnbspace(v1);
}
|
int
main (int argc, char **argv)
{
_Bool
preserve_root =
1
;
struct rm_options x;
_Bool
prompt_once =
0
;
int c;
;
set_program_name (argv[0]);
setlocale (
6
, "");
bindtextdomain ("coreutils", "/usr/local/share/locale");
textdomain ("coreutils");
atexit (close_stdin);
rm_option_init (&x);
priv_set_remove_linkdir ();
while ((c = getopt_long (argc, argv, "dfirvIR", long_opts,
((void *)0)
)) != -1)
{
switch (c)
{
case 'd':
x.remove_empty_directories =
1
;
break;
case 'f':
x.interactive = RMI_NEVER;
x.ignore_missing_files =
1
;
prompt_once =
0
;
break;
case 'i':
x.interactive = RMI_ALWAYS;
x.ignore_missing_files =
0
;
prompt_once =
0
;
break;
case 'I':
x.interactive = RMI_SOMETIMES;
x.ignore_missing_files =
0
;
prompt_once =
1
;
break;
case 'r':
case 'R':
x.recursive =
1
;
break;
case INTERACTIVE_OPTION:
{
int i;
if (optarg)
i = ((interactive_types) [__xargmatch_internal ("--interactive", optarg, interactive_args, (void const *) (interactive_types), sizeof *(interactive_types), argmatch_die,
1
)])
;
else
i = interactive_always;
switch (i)
{
case interactive_never:
x.interactive = RMI_NEVER;
prompt_once =
0
;
break;
case interactive_once:
x.interactive = RMI_SOMETIMES;
x.ignore_missing_files =
0
;
prompt_once =
1
;
break;
case interactive_always:
x.interactive = RMI_ALWAYS;
x.ignore_missing_files =
0
;
prompt_once =
0
;
break;
}
break;
}
case ONE_FILE_SYSTEM:
x.one_file_system =
1
;
break;
case NO_PRESERVE_ROOT:
if (! (strcmp (argv[optind - 1], "--no-preserve-root") == 0))
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"you may not abbreviate the --no-preserve-root option\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("you may not abbreviate the --no-preserve-root option")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("you may not abbreviate the --no-preserve-root option")), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
preserve_root =
0
;
break;
case PRESERVE_ROOT:
if (optarg)
{
if (strcmp (optarg, "all") == 0)
x.preserve_all_root =
1
;
else
{
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"unrecognized --preserve-root argument: %s\"), quotearg_style (shell_escape_always_quoting_style, optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("unrecognized --preserve-root argument: %s"), quotearg_style (shell_escape_always_quoting_style, optarg)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("unrecognized --preserve-root argument: %s"), quotearg_style (shell_escape_always_quoting_style, optarg)), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
}
preserve_root =
1
;
break;
case PRESUME_INPUT_TTY_OPTION:
x.stdin_tty =
1
;
break;
case 'v':
x.verbose =
1
;
break;
case GETOPT_HELP_CHAR: usage (
0
); break;;
case GETOPT_VERSION_CHAR: version_etc (
stdout
, "rm", "GNU coreutils", Version, ("Paul Rubin"), ("David MacKenzie"), ("Richard M. Stallman"), ("Jim Meyering"), (char *)
((void *)0)
); exit (
0
); break;;
default:
diagnose_leading_hyphen (argc, argv);
usage (
1
);
}
}
if (argc <= optind)
{
if (x.ignore_missing_files)
return
0
;
else
{
error (0, 0, gettext ("missing operand"));
usage (
1
);
}
}
if (x.recursive && preserve_root)
{
static struct dev_ino dev_ino_buf;
x.root_dev_ino = get_root_dev_ino (&dev_ino_buf);
if (x.root_dev_ino ==
((void *)0)
)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"failed to get attributes of %s\"), quotearg_style (shell_escape_always_quoting_style, \"/\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, gettext ("failed to get attributes of %s"), quotearg_style (shell_escape_always_quoting_style, "/")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, gettext ("failed to get attributes of %s"), quotearg_style (shell_escape_always_quoting_style, "/")), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
uintmax_t n_files = argc - optind;
char **file = argv + optind;
if (prompt_once && (x.recursive || 3 < n_files))
{
fprintf (
stderr
,
(x.recursive
? ngettext ("%s: remove %"
"l" "u"
" argument recursively? ",
"%s: remove %"
"l" "u"
" arguments recursively? ",
select_plural (n_files))
: ngettext ("%s: remove %"
"l" "u"
" argument? ",
"%s: remove %"
"l" "u"
" arguments? ",
select_plural (n_files))),
program_name, n_files);
if (!yesno ())
return
0
;
}
enum RM_status status = rm (file, &x);
((void) sizeof ((
((status) == RM_OK || (status) == RM_USER_DECLINED || (status) == RM_ERROR)
) ? 1 : 0), __extension__ ({ if (
((status) == RM_OK || (status) == RM_USER_DECLINED || (status) == RM_ERROR)
) ; else __assert_fail (
"VALID_STATUS (status)"
, "src/rm.c", 371, __extension__ __PRETTY_FUNCTION__); }))
;
return status == RM_ERROR ?
1
:
0
;
}
|
int main(unsigned long long a0, unsigned long long *a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v0;
char v1;
char v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned long v6;
unsigned long long v7;
char v8;
unsigned int v9;
char v10;
char v11;
char v12;
unsigned long v13;
char v14;
char v15;
char v16;
unsigned int v18;
unsigned long long v19;
unsigned long long v20;
v1 = 1;
v2 = 0;
set_program_name(*(a1));
setlocale(0x6, &g_400ce3);
bindtextdomain("coreutils", "/usr/local/share/locale");
textdomain("coreutils");
atexit(got.close_stdin);
rm_option_init(&v8);
priv_set_remove_linkdir(&v8, "/usr/local/share/locale", a2, a3, a4, a5);
while (true) {
v4 = getopt_long(a0, a1, "dfirvIR", &long_opts, NULL);
if (v4 == -1)
break;
if (!(v4 <= 132))
goto LABEL_40095f;
if (v4 >= 73) {
switch (v4) {
case 73:
v9 = 4;
v8 = 0;
v2 = 1;
continue;
case 82: case 114:
v11 = 1;
continue;
case 100:
v12 = 1;
continue;
case 102:
v9 = 5;
v8 = 1;
v2 = 0;
continue;
case 105:
v9 = 3;
v8 = 0;
v2 = 0;
continue;
case 118:
v16 = 1;
continue;
case 128:
if (!*(&optarg)) {
v3 = 2;
} else {
v0 = 1;
v18 = *((4 * __xargmatch_internal("--interactive", *(&optarg), &interactive_args, &interactive_types, 0x4, argmatch_die) + &interactive_types));
v3 = v18;
}
if (v3 == 2) {
v9 = 3;
v8 = 0;
v2 = 0;
break;
} else {
if (!(v3 <= 2))
continue;
if (!v3) {
v9 = 5;
v2 = 0;
break;
} else {
if (!(v3 == 1))
continue;
v9 = 4;
v8 = 0;
v2 = 1;
break;
}
}
continue;
case 129:
v10 = 1;
continue;
case 130:
if (!strcmp(a1[1 + optind], "--no-preserve-root"))
v1 = 0;
else
error(0x1, 0x0, gettext("you may not abbreviate the --no-preserve-root option"));
continue;
case 131:
if (*(&optarg)) {
if (strcmp(*(&optarg), "all")) {
v19 = quotearg_style(0x4, *(&optarg));
error(0x1, 0x0, gettext("unrecognized --preserve-root argument: %s"));
}
v14 = 1;
}
v1 = 1;
continue;
case 132:
v15 = 1;
continue;
default:
LABEL_40095f:
diagnose_leading_hyphen(a0, a1);
usage(0x1);
}
} else if (v4 == -131) {
v0 = 0;
version_etc(stdout, "rm", "GNU coreutils", Version, "Paul Rubin", "David MacKenzie", "Richard M. Stallman", "Jim Meyering");
exit(0x0);
} else if (v4 == -130) {
usage(0x0);
}
}
if (a0 <= optind) {
if (v8) {
v18 = 0;
goto LABEL_400b7d;
} else {
error(0x0, 0x0, gettext("missing operand"));
usage(0x1);
}
}
if (v11 && v1) {
v13 = get_root_dev_ino(&dev_ino_buf.5887);
if (!v13) {
v20 = quotearg_style(0x4, "/");
error(0x1, *(__errno_location()), gettext("failed to get attributes of %s"));
}
}
v6 = a0 - optind;
v7 = &a1[optind];
if (v2) {
if (!v11 && v6 <= 3)
goto LABEL_400b2c;
if (!v11)
v18 = ngettext("%s: remove %lu argument? ", "%s: remove %lu arguments? ", select_plural(v6));
else
v18 = ngettext("%s: remove %lu argument recursively? ", "%s: remove %lu arguments recursively? ", select_plural(v6));
fprintf(stderr, v18);
*(&v18) = yesno(a0, a1, program_name, v6, 0x0, argmatch_die) ^ 1;
if (v18) {
v18 = 0;
goto LABEL_400b7d;
}
}
LABEL_400b2c:
v5 = rm(v7, &v8, &v8);
if (v5 != 2 && v5 != 3 && v5 != 4)
__assert_fail();
v18 = v5 == 4;
LABEL_400b7d:
return v18;
}
|
void
_rl_release_sigwinch (void)
{
if (sigwinch_blocked == 0)
return;
sigprocmask (
2
, &sigwinch_oset, (sigset_t *)
((void *)0)
);
sigwinch_blocked = 0;
}
|
long long _rl_release_sigwinch() {
unsigned long long v1;
v1 = sigwinch_blocked;
if (sigwinch_blocked) {
v1 = sigprocmask(0x2, &sigwinch_oset, NULL);
sigwinch_blocked = 0;
return v1;
}
return v1;
}
|
int
ssh_init(struct ssh **sshp, int is_server, struct kex_params *kex_params)
{
char *myproposal[PROPOSAL_MAX] = { "sntrup761x25519-sha512@openssh.com," "curve25519-sha256," "curve25519-sha256@libssh.org," "ecdh-sha2-nistp256," "ecdh-sha2-nistp384," "ecdh-sha2-nistp521," "diffie-hellman-group-exchange-sha256," "diffie-hellman-group16-sha512," "diffie-hellman-group18-sha512," "diffie-hellman-group14-sha256", "ssh-ed25519-cert-v01@openssh.com," "ecdsa-sha2-nistp256-cert-v01@openssh.com," "ecdsa-sha2-nistp384-cert-v01@openssh.com," "ecdsa-sha2-nistp521-cert-v01@openssh.com," "sk-ssh-ed25519-cert-v01@openssh.com," "sk-ecdsa-sha2-nistp256-cert-v01@openssh.com," "rsa-sha2-512-cert-v01@openssh.com," "rsa-sha2-256-cert-v01@openssh.com," "ssh-ed25519," "ecdsa-sha2-nistp256," "ecdsa-sha2-nistp384," "ecdsa-sha2-nistp521," "sk-ssh-ed25519@openssh.com," "sk-ecdsa-sha2-nistp256@openssh.com," "rsa-sha2-512," "rsa-sha2-256", "chacha20-poly1305@openssh.com," "aes128-ctr,aes192-ctr,aes256-ctr," "aes128-gcm@openssh.com,aes256-gcm@openssh.com", "chacha20-poly1305@openssh.com," "aes128-ctr,aes192-ctr,aes256-ctr," "aes128-gcm@openssh.com,aes256-gcm@openssh.com", "umac-64-etm@openssh.com," "umac-128-etm@openssh.com," "hmac-sha2-256-etm@openssh.com," "hmac-sha2-512-etm@openssh.com," "hmac-sha1-etm@openssh.com," "umac-64@openssh.com," "umac-128@openssh.com," "hmac-sha2-256," "hmac-sha2-512," "hmac-sha1", "umac-64-etm@openssh.com," "umac-128-etm@openssh.com," "hmac-sha2-256-etm@openssh.com," "hmac-sha2-512-etm@openssh.com," "hmac-sha1-etm@openssh.com," "umac-64@openssh.com," "umac-128@openssh.com," "hmac-sha2-256," "hmac-sha2-512," "hmac-sha1", "none,zlib@openssh.com", "none,zlib@openssh.com", "", "" };
struct ssh *ssh;
char **proposal;
static int called;
int r;
if (!called) {
seed_rng();
called = 1;
}
if ((ssh = ssh_packet_set_connection(
((void *)0)
, -1, -1)) ==
((void *)0)
)
return -2;
if (is_server)
ssh_packet_set_server(ssh);
proposal = kex_params ? kex_params->proposal : myproposal;
if ((r = kex_ready(ssh, proposal)) != 0) {
ssh_free(ssh);
return r;
}
ssh->kex->server = is_server;
if (is_server) {
ssh->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_server;
ssh->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_server;
ssh->kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_server;
ssh->kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_server;
ssh->kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_server;
ssh->kex->kex[KEX_DH_GEX_SHA1] = kexgex_server;
ssh->kex->kex[KEX_DH_GEX_SHA256] = kexgex_server;
ssh->kex->kex[KEX_ECDH_SHA2] = kex_gen_server;
ssh->kex->kex[KEX_C25519_SHA256] = kex_gen_server;
ssh->kex->kex[KEX_KEM_SNTRUP761X25519_SHA512] = kex_gen_server;
ssh->kex->load_host_public_key=&_ssh_host_public_key;
ssh->kex->load_host_private_key=&_ssh_host_private_key;
ssh->kex->sign=&_ssh_host_key_sign;
} else {
ssh->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_client;
ssh->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_client;
ssh->kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_client;
ssh->kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_client;
ssh->kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_client;
ssh->kex->kex[KEX_DH_GEX_SHA1] = kexgex_client;
ssh->kex->kex[KEX_DH_GEX_SHA256] = kexgex_client;
ssh->kex->kex[KEX_ECDH_SHA2] = kex_gen_client;
ssh->kex->kex[KEX_C25519_SHA256] = kex_gen_client;
ssh->kex->kex[KEX_KEM_SNTRUP761X25519_SHA512] = kex_gen_client;
ssh->kex->verify_host_key =&_ssh_verify_host_key;
}
*sshp = ssh;
return 0;
}
|
int ssh_init(long *param_1,int param_2,char **param_3)
{
int iVar1;
long lVar2;
long in_FS_OFFSET;
char *local_68;
char *local_60;
char *local_58;
char *local_50;
char *local_48;
char *local_40;
char *local_38;
char *local_30;
undefined *local_28;
undefined *local_20;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_68 =
"sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256"
;
local_60 =
"ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256"
;
local_58 =
"chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com"
;
local_50 =
"chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com"
;
local_48 =
"umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1"
;
local_40 =
"umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1"
;
local_38 = "none,zlib@openssh.com";
local_30 = "none,zlib@openssh.com";
local_28 = &DAT_00101bac;
local_20 = &DAT_00101bac;
if (called_19160 == 0) {
seed_rng();
called_19160 = 1;
}
lVar2 = ssh_packet_set_connection(0,0xffffffff,0xffffffff);
if (lVar2 == 0) {
iVar1 = -2;
}
else {
if (param_2 != 0) {
ssh_packet_set_server(lVar2);
}
if (param_3 == (char **)0x0) {
param_3 = &local_68;
}
iVar1 = kex_ready(lVar2,param_3);
if (iVar1 == 0) {
*(int *)(*(long *)(lVar2 + 8) + 0x18) = param_2;
if (param_2 == 0) {
*(undefined8 *)(*(long *)(lVar2 + 8) + 200) = uRam00000000001002d1;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0xd0) = uRam00000000001002e7;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0xd8) = uRam00000000001002fd;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0xe0) = uRam0000000000100313;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0xe8) = uRam0000000000100329;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0xf0) = uRam000000000010033f;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0xf8) = uRam0000000000100355;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0x100) = uRam000000000010036b;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0x108) = uRam0000000000100381;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0x110) = uRam0000000000100397;
*(code **)(*(long *)(lVar2 + 8) + 0xa0) = _ssh_verify_host_key;
}
else {
*(undefined8 *)(*(long *)(lVar2 + 8) + 200) = uRam00000000001001ae;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0xd0) = uRam00000000001001c4;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0xd8) = uRam00000000001001da;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0xe0) = uRam00000000001001f0;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0xe8) = uRam0000000000100206;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0xf0) = uRam000000000010021c;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0xf8) = uRam0000000000100232;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0x100) = uRam0000000000100248;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0x108) = uRam000000000010025e;
*(undefined8 *)(*(long *)(lVar2 + 8) + 0x110) = uRam0000000000100274;
*(code **)(*(long *)(lVar2 + 8) + 0xa8) = _ssh_host_public_key;
*(code **)(*(long *)(lVar2 + 8) + 0xb0) = _ssh_host_private_key;
*(code **)(*(long *)(lVar2 + 8) + 0xc0) = _ssh_host_key_sign;
}
*param_1 = lVar2;
iVar1 = 0;
}
else {
ssh_free(lVar2);
}
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return iVar1;
}
__stack_chk_fail();
}
|
static
_Bool
stdout_isatty (void)
{
static signed char out_tty = -1;
if (out_tty < 0)
out_tty = isatty (
1
);
((out_tty == 0 || out_tty == 1) ? (void) 0 : __builtin_unreachable ());
return out_tty;
}
|
int stdout_isatty() {
if (out_tty.9220 < 0)
out_tty.9220 = isatty(0x1);
return out_tty.9220;
}
|
static void
merge_lists (struct predlist lists[], int nlists,
struct predlist *name_list,
struct predlist *regex_list,
struct predicate **last)
{
int i;
static void (*mergefn)(struct predlist *, struct predicate**);
mergefn = predlist_merge_sort;
mergefn (name_list, last);
mergefn (regex_list, last);
for (i=0; i<nlists; i++)
mergefn (&lists[i], last);
}
|
long merge_lists(long a1, int a2, long *a3, long a4, _QWORD *a5)
{
long result;
int i;
mergefn_5804 = (long ( *)(_QWORD, _QWORD))predlist_merge_sort;
predlist_merge_sort(a3, a5);
mergefn_5804(a4, a5);
for ( i = 0; ; ++i )
{
result = (unsigned int)i;
if ( i >= a2 )
break;
mergefn_5804(a1 + 16LL * i, a5);
}
return result;
}
|
int
main (int argc, char **argv)
{
char const *specified_mode =
((void *)0)
;
int optc;
char const *scontext =
((void *)0)
;
struct mkdir_options options;
options.make_ancestor_function =
((void *)0)
;
options.mode =
((0400|0200|0100) | ((0400|0200|0100) >> 3) | (((0400|0200|0100) >> 3) >> 3))
;
options.mode_bits = 0;
options.created_directory_format =
((void *)0)
;
options.set_security_context =
((void *)0)
;
;
set_program_name (argv[0]);
setlocale (
6
, "");
bindtextdomain ("coreutils", "/usr/local/share/locale");
textdomain ("coreutils");
atexit (close_stdout);
while ((optc = getopt_long (argc, argv, "pm:vZ", longopts,
((void *)0)
)) != -1)
{
switch (optc)
{
case 'p':
options.make_ancestor_function = make_ancestor;
break;
case 'm':
specified_mode = optarg;
break;
case 'v':
options.created_directory_format = gettext ("created directory %s");
break;
case 'Z':
if (is_smack_enabled ())
{
scontext = optarg;
}
else if (is_selinux_enabled () > 0)
{
if (optarg)
scontext = optarg;
else
{
options.set_security_context = selabel_open (
0
,
((void *)0)
, 0);
if (! options.set_security_context)
error (0,
(*__errno_location ())
, gettext ("warning: ignoring --context"));
}
}
else if (optarg)
{
error (0, 0,
gettext ("warning: ignoring --context; " "it requires an SELinux/SMACK-enabled kernel")
);
}
break;
case GETOPT_HELP_CHAR: usage (
0
); break;;
case GETOPT_VERSION_CHAR: version_etc (
stdout
, "mkdir", "GNU coreutils", Version, ("David MacKenzie"), (char *)
((void *)0)
); exit (
0
); break;;
default:
usage (
1
);
}
}
if (optind == argc)
{
error (0, 0, gettext ("missing operand"));
usage (
1
);
}
if (scontext)
{
int ret = 0;
if (is_smack_enabled ())
ret = smack_set_label_for_self (scontext);
else
ret = setfscreatecon (scontext);
if (ret < 0)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"failed to set default file creation context to %s\"), quote (scontext)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, gettext ("failed to set default file creation context to %s"), quote (scontext)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, gettext ("failed to set default file creation context to %s"), quote (scontext)), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
if (options.make_ancestor_function || specified_mode)
{
mode_t umask_value = umask (0);
options.umask_ancestor = umask_value & ~(
0200
|
0100
);
if (specified_mode)
{
struct mode_change *change = mode_compile (specified_mode);
if (!change)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"invalid mode %s\"), quote (specified_mode)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("invalid mode %s"), quote (specified_mode)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("invalid mode %s"), quote (specified_mode)), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
options.mode = mode_adjust (
((0400|0200|0100) | ((0400|0200|0100) >> 3) | (((0400|0200|0100) >> 3) >> 3))
,
1
, umask_value, change,
&options.mode_bits);
options.umask_self = umask_value & ~options.mode;
free (change);
}
else
{
options.mode =
((0400|0200|0100) | ((0400|0200|0100) >> 3) | (((0400|0200|0100) >> 3) >> 3))
;
options.umask_self = umask_value;
}
umask (options.umask_self);
}
return savewd_process_files (argc - optind, argv + optind,
process_dir, &options);
}
|
int main(unsigned long a0, unsigned long long *a1) {
unsigned int v0;
unsigned int v1;
unsigned long long v2;
void* v3;
void* v4;
void* v5;
unsigned long long v6;
unsigned int v7;
unsigned int v8;
unsigned int v9;
unsigned int v10;
unsigned long v11;
unsigned long v12;
unsigned long long v14;
unsigned long long v15;
unsigned long long v16;
v3 = 0;
v4 = 0;
v6 = 0;
v9 = 511;
v10 = 0;
v12 = 0;
v11 = 0;
set_program_name(*(a1));
setlocale(0x6, &g_400d5b);
bindtextdomain("coreutils", "/usr/local/share/locale");
textdomain("coreutils");
atexit(got.close_stdout);
while (true) {
v1 = getopt_long(a0, a1, "pm:vZ", &longopts, NULL);
if (v1 != -1) {
if (v1 != 118) {
if (v1 <= 118) {
if (v1 == 112) {
v6 = make_ancestor;
continue;
} else if (v1 <= 112) {
if (v1 == 109) {
v3 = *(&optarg);
continue;
} else if (v1 <= 109) {
if (v1 == 90) {
v14 = is_smack_enabled();
if (v14) {
v4 = *(&optarg);
continue;
} else {
v14 = is_selinux_enabled();
if (v14 > 0) {
if (*(&optarg)) {
v4 = *(&optarg);
continue;
} else {
v11 = selabel_open(0x0, 0x0, 0x0);
if (v11)
continue;
error(0x0, *(__errno_location()), gettext("warning: ignoring --context"));
continue;
}
} else {
if (!*(&optarg))
continue;
error(0x0, 0x0, gettext("warning: ignoring --context; it requires an SELinux/SMACK-enabled kernel"));
continue;
}
}
} else if (v1 <= 90) {
if (v1 == -131) {
version_etc(stdout, "mkdir", "GNU coreutils", Version, "David MacKenzie", 0x0);
exit(0x0);
}
if (v1 == -130)
usage(0x0);
}
}
}
}
if (v1 > 118 || v1 <= 118 && v1 > 112 && v1 != 112 || v1 <= 118 && v1 <= 112 && v1 > 109 && v1 != 112 && v1 != 109 || v1 <= 118 && v1 <= 109 && v1 <= 112 && v1 != 90 && v1 != 112 && v1 > 90 && v1 != 109 || v1 <= 118 && v1 <= 109 && v1 <= 112 && v1 <= 90 && v1 != -130 && v1 != 90 && v1 != -131 && v1 != 112 && v1 != 109)
usage(0x1);
} else {
v12 = gettext("created directory %s");
}
} else {
if (a0 == optind) {
error(0x0, 0x0, gettext("missing operand"));
usage(0x1);
}
if (v4) {
v0 = 0;
v14 = is_smack_enabled();
if (v14)
v0 = smack_set_label_for_self(v4);
else
v0 = setfscreatecon(v4);
if (v0 < 0) {
v15 = quote(v4);
error(0x1, *(__errno_location()), gettext("failed to set default file creation context to %s"));
}
}
if (!v4 || v0 >= 0) {
if (!v6) {
if (!v3)
break;
}
if (v3) {
*(&v2) = umask(0x0);
*(&v14) = v2;
*(&v14) = v2 & 63;
v7 = v14;
if (v3) {
v5 = mode_compile(v3);
if (!v5) {
v16 = quote(v3);
error(0x1, 0x0, gettext("invalid mode %s"));
}
v9 = mode_adjust(0x1ff, 0x1, v2, v5, &v10);
v8 = !(v9) & v2;
free(v5);
} else {
v9 = 511;
v8 = v2;
}
if (!v3 || v5) {
umask(v8);
break;
}
}
}
}
}
return savewd_process_files(a0 - optind, &a1[optind], process_dir, &v6);
}
|
static void print_num(const char *msg, const gnutls_datum_t * num)
{
unsigned int i;
printf("%s:\t", msg);
for (i = 0; i < num->size; i++) {
if (i != 0 && i % 12 == 0)
printf("\n\t");
else if (i != 0 && i != num->size)
printf(":");
printf("%.2x", num->data[i]);
}
printf("\n\n");
}
|
void print_num(unsigned long a0, struct_0 *a1) {
unsigned int v0;
unsigned long long v2;
printf("%s:\t", a0);
for (v0 = 0; v0 < a1->field_8; v0 += 1) {
if (!(!v0 || v0 - (((v0 * 2863311531 >> 35) << 1) + (v0 * 2863311531 >> 35) << 2))) {
printf("\n\t");
} else if (v0 && v0 != a1->field_8) {
printf(":");
}
printf("%.2x", *((v0 + a1->field_0)));
}
v2 = printf("\n\n");
return;
}
|
void
set_utmp_time(struct logininfo *li, struct utmp *ut)
{
ut->ut_tv.tv_sec = li->tv_sec;
ut->ut_tv.tv_usec = li->tv_usec;
}
|
void set_utmp_time(unsigned int a0[232], unsigned int a1[87]) {
char v0;
unsigned int v2[87];
unsigned long long v3;
a1[85] = a0[230];
v2 = a1;
a1[86] = a0[231];
v3 = *(&v0);
return;
}
|
char *
string_list_dollar_star (list, quoted, flags)
WORD_LIST *list;
int quoted, flags;
{
char *ret;
char sep[
(__ctype_get_mb_cur_max ())
+ 1];
if (ifs_firstc_len == 1)
{
sep[0] = ifs_firstc[0];
sep[1] = '\0';
}
else
{
memcpy (sep, ifs_firstc, ifs_firstc_len);
sep[ifs_firstc_len] = '\0';
}
ret = string_list_internal (list, sep);
return ret;
}
|
int string_list_dollar_star(void* a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
char v2;
char v3[425802354520363005];
unsigned long v4;
char v5;
char v6;
unsigned long v8;
v1 = a1;
v0 = a2;
for (v8 = (0 CONCAT __ctype_get_mb_cur_max(a0, a1, a2, a3, a4, a5, *(&v0), a0, *(&v2)) + 16) /m 16 * 16; &v6 != &v0 + -1 * (v8 & -0x1000); v5 = *(&v5));
if ((v8 & 4095))
*((&v5 + (v8 & 4095))) = *((&v5 + (v8 & 4095)));
*(&v3[0]) = &v6;
if (false) {
v3[0] = 1480919671367579151;
v3[1] = 0;
} else {
memcpy(v3, &ifs_firstc, 0x5e8c0fc45b60ffc);
v3[425802354520363004] = 0;
}
v4 = string_list_internal(a0, v3);
return v4;
}
|
static void
mergefps (struct sortfile *files, size_t ntemps, size_t nfiles,
FILE *ofp, char const *output_file, FILE **fps)
{
struct buffer *buffer = xnmalloc (nfiles, sizeof *buffer);
struct line saved;
struct line const *savedline =
((void *)0)
;
size_t savealloc = 0;
struct line const **cur = xnmalloc (nfiles, sizeof *cur);
struct line const **base = xnmalloc (nfiles, sizeof *base);
size_t *ord = xnmalloc (nfiles, sizeof *ord);
size_t i;
size_t j;
size_t t;
struct keyfield const *key = keylist;
saved.text =
((void *)0)
;
for (i = 0; i < nfiles; )
{
initbuf (&buffer[i], sizeof (struct line),
(((
merge_buffer_size
)>(
sort_size / nfiles
))?(
merge_buffer_size
):(
sort_size / nfiles
))
);
if (fillbuf (&buffer[i], fps[i], files[i].name))
{
struct line const *linelim = buffer_linelim (&buffer[i]);
cur[i] = linelim - 1;
base[i] = linelim - buffer[i].nlines;
i++;
}
else
{
xfclose (fps[i], files[i].name);
if (i < ntemps)
{
ntemps--;
zaptemp (files[i].name);
}
free (buffer[i].buf);
--nfiles;
for (j = i; j < nfiles; ++j)
{
files[j] = files[j + 1];
fps[j] = fps[j + 1];
}
}
}
for (i = 0; i < nfiles; ++i)
ord[i] = i;
for (i = 1; i < nfiles; ++i)
if (0 < compare (cur[ord[i - 1]], cur[ord[i]]))
t = ord[i - 1], ord[i - 1] = ord[i], ord[i] = t, i = 0;
while (nfiles)
{
struct line const *smallest = cur[ord[0]];
if (unique)
{
if (savedline && compare (savedline, smallest))
{
savedline =
((void *)0)
;
write_line (&saved, ofp, output_file);
}
if (!savedline)
{
savedline = &saved;
if (savealloc < smallest->length)
{
do
if (! savealloc)
{
savealloc = smallest->length;
break;
}
while ((savealloc *= 2) < smallest->length);
free (saved.text);
saved.text = xmalloc (savealloc);
}
saved.length = smallest->length;
memcpy (saved.text, smallest->text, saved.length);
if (key)
{
saved.keybeg =
saved.text + (smallest->keybeg - smallest->text);
saved.keylim =
saved.text + (smallest->keylim - smallest->text);
}
}
}
else
write_line (smallest, ofp, output_file);
if (base[ord[0]] < smallest)
cur[ord[0]] = smallest - 1;
else
{
if (fillbuf (&buffer[ord[0]], fps[ord[0]], files[ord[0]].name))
{
struct line const *linelim = buffer_linelim (&buffer[ord[0]]);
cur[ord[0]] = linelim - 1;
base[ord[0]] = linelim - buffer[ord[0]].nlines;
}
else
{
for (i = 1; i < nfiles; ++i)
if (ord[i] > ord[0])
--ord[i];
--nfiles;
xfclose (fps[ord[0]], files[ord[0]].name);
if (ord[0] < ntemps)
{
ntemps--;
zaptemp (files[ord[0]].name);
}
free (buffer[ord[0]].buf);
for (i = ord[0]; i < nfiles; ++i)
{
fps[i] = fps[i + 1];
files[i] = files[i + 1];
buffer[i] = buffer[i + 1];
cur[i] = cur[i + 1];
base[i] = base[i + 1];
}
for (i = 0; i < nfiles; ++i)
ord[i] = ord[i + 1];
continue;
}
}
{
size_t lo = 1;
size_t hi = nfiles;
size_t probe = lo;
size_t ord0 = ord[0];
size_t count_of_smaller_lines;
while (lo < hi)
{
int cmp = compare (cur[ord0], cur[ord[probe]]);
if (cmp < 0 || (cmp == 0 && ord0 < ord[probe]))
hi = probe;
else
lo = probe + 1;
probe = (lo + hi) / 2;
}
count_of_smaller_lines = lo - 1;
for (j = 0; j < count_of_smaller_lines; j++)
ord[j] = ord[j + 1];
ord[count_of_smaller_lines] = ord0;
}
}
if (unique && savedline)
{
write_line (&saved, ofp, output_file);
free (saved.text);
}
xfclose (ofp, output_file);
free (fps);
free (buffer);
free (ord);
free (base);
free (cur);
}
|
void mergefps(void* a0, unsigned long a1, unsigned long long a2, void* a3, unsigned long long a4, void* a5) {
unsigned long long v0;
int tmp_86;
int tmp_199;
int tmp_262;
int tmp_272;
unsigned long v1;
void* v2;
unsigned int v3;
void* v4;
void* v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
void* v11;
void* v12;
void* v13;
unsigned long long v14;
unsigned long v15;
unsigned long long v16[4];
unsigned long v17;
void* v18;
unsigned long long v19;
void* v20;
unsigned long v21;
void* v22;
unsigned int v23;
unsigned long v24;
unsigned long v25;
char v26;
unsigned long v28;
unsigned long v29;
void* v30;
unsigned long long v31;
unsigned long long *v32;
unsigned long long v33;
v2 = a0;
v1 = a1;
v0 = a2;
v11 = xnmalloc(v0, 0x38);
v4 = 0;
v5 = 0;
v12 = xnmalloc(v0, 0x8);
v13 = xnmalloc(v0, 0x8);
v14 = xnmalloc(v0, 0x8);
v15 = keylist;
v22 = 0;
for (v6 = 0; v6 < v0; v6 += 1) {
v28 = merge_buffer_size;
if (merge_buffer_size <= (0 CONCAT sort_size) /m v0)
v28 = (0 CONCAT sort_size) /m v0;
v29 = v28;
v30 = v28 * 2;
initbuf(v30, 0x20, v29);
if (fillbuf(v11 + (v6 * 7 << 3), *((a5 + 0x8 * v6)), *((a0 + 0x10 * v6)))) {
v21 = buffer_linelim(v11 + v6 * 56);
*((v12 + 0x8 * v6)) = v21 - 32;
*((v13 + 0x8 * v6)) = v21 + -(*((16 + v11 + 0x38 * v6)) << 5);
} else {
xfclose(*((a5 + 0x8 * v6)), *((a0 + 0x10 * v6)));
if (v6 < v1) {
v1 -= 1;
zaptemp(*((a0 + 0x10 * v6)));
}
free(*((v11 + 0x38 * v6)));
v0 -= 1;
for (v7 = v6; v7 < v0; v7 += 1) {
tmp_86 = *((24 + a0 + 0x10 * v7));
*((0x10 * v7 + a0)) = *((16 + a0 + 0x10 * v7));
*((8 + 0x10 * v7 + a0)) = tmp_86;
*((a5 + 0x8 * v7)) = *((8 + a5 + 0x8 * v7));
}
}
}
for (v6 = 0; v6 < v0; v6 += 1) {
*((v6 * 8 + v14)) = v6;
}
for (v6 = 1; v6 < v0; v6 += 1) {
if (compare(*((v12 + 8 * *((v14 + (v6 << 3) - 8)))), *((v12 + 8 * *((v14 + (v6 << 3)))))) > 0) {
v20 = *((v14 + v6 * 8 - 8));
*((v14 + v6 * 8 - 8)) = *((v14 + v6 * 8));
*((v6 * 8 + v14)) = v20;
v6 = 0;
}
}
while (true) {
if (!v0)
break;
v16[0] = *((v12 + 8 * *(v14)));
if (!unique) {
write_line(v16, a3, a4);
} else {
if (v4 && compare(v4, v16)) {
v4 = 0;
write_line(&v22, a3, a4);
}
if (!v4) {
v4 = &v22;
if (v5 < v16[1]) {
do {
if (!v5) {
v5 = v16[1];
break;
}
} while ((v5 = (v5 * 2), v5 < v16[1]));
free(v22);
v22 = xmalloc(v5);
}
*(&v23) = v16[1];
memcpy(v22, v16[0], *(&v23));
if (v15) {
v24 = v16[2] - v16[0] + v22;
v25 = v16[3] - v16[0] + v22;
}
}
}
if (v16 > *((v13 + 8 * *(v14)))) {
*((v12 + 8 * *(v14))) = v16 + 1;
} else if (fillbuf(v11 + (*(v14) * 7 << 3), *((a5 + 8 * *(v14))), *((a0 + 16 * *(v14))))) {
v17 = buffer_linelim(v11 + *(v14) * 56);
*((v12 + 8 * *(v14))) = v17 - 32;
*((v13 + 8 * *(v14))) = v17 + -(*((16 + v11 + 56 * *(v14))) << 5);
} else {
for (v6 = 1; v6 < v0; v6 += 1) {
if (*((v14 + (v6 << 3))) > *(v14))
*((v14 + v6 * 8)) = *((v14 + v6 * 8)) - 1;
}
v0 -= 1;
xfclose(*((a5 + 8 * *(v14))), *((a0 + 16 * *(v14))));
if (v1 > *(v14)) {
v1 -= 1;
zaptemp(*((a0 + 16 * *(v14))));
}
free(*((v11 + 56 * *(v14))));
for (v6 = *(v14); v6 < v0; v6 += 1) {
*((a5 + 0x8 * v6)) = *((8 + a5 + 0x8 * v6));
tmp_199 = *((24 + a0 + 0x10 * v6));
*((0x10 * v6 + a0)) = *((16 + a0 + 0x10 * v6));
*((8 + 0x10 * v6 + a0)) = tmp_199;
tmp_262 = *((64 + 0x38 * v6 + v11));
*((v11 + 0x38 * v6)) = *((56 + 0x38 * v6 + v11));
*((8 + v11 + 0x38 * v6)) = tmp_262;
tmp_272 = *((80 + 0x38 * v6 + v11));
*((16 + v11 + 0x38 * v6)) = *((72 + 0x38 * v6 + v11));
*((24 + v11 + 0x38 * v6)) = tmp_272;
v31 = *((96 + 0x38 * v6 + v11));
*((32 + v11 + 0x38 * v6)) = *((88 + 0x38 * v6 + v11));
*((40 + v11 + 0x38 * v6)) = v31;
*((48 + v11 + 0x38 * v6)) = *((104 + 0x38 * v6 + v11));
*((v12 + 0x8 * v6)) = *((8 + v12 + 0x8 * v6));
*((v13 + 0x8 * v6)) = *((8 + v13 + 0x8 * v6));
}
for (v6 = 0; v6 < v0; v6 += 1) {
*((v14 + v6 * 8)) = *((v14 + (v6 + 1) * 8));
}
}
v8 = 1;
v9 = v0;
v10 = v8;
for (v18 = *(v14); v8 < v9; v10 = v9 + v8 >> 1) {
v3 = compare(*((v12 + 0x8 * v18)), *((v12 + 8 * *((v14 + v10 * 8)))));
if (v3 < 0 || !v3 && v18 < *((v14 + (v10 << 3))))
v9 = v10;
else
v8 = v10 + 1;
}
v19 = v8 - 1;
for (v7 = 0; v7 < v19; v7 += 1) {
*((v14 + v7 * 8)) = *((v14 + (v7 + 1) * 8));
}
*((v19 * 8 + v14)) = v18;
}
if (unique && v4) {
write_line(&v22, a3, a4);
free(v22);
}
xfclose(a3, a4);
free(a5);
free(v11);
free(v14);
free(v13);
free(v12);
v33 = *(&v26) ^ v32[5];
return;
}
|
static int istty(const char *dev)
{
int fd, ret;
fd = open(dev,
00
|
04000
);
if (fd < 0)
return 0;
ret = isatty(fd);
close(fd);
return ret;
}
|
int istty(char *param_1)
{
int __fd;
int iVar1;
__fd = open(param_1,0x800);
if (__fd < 0) {
iVar1 = 0;
}
else {
iVar1 = isatty(__fd);
close(__fd);
}
return iVar1;
}
|
static void
print_sdiff_common_lines (lin limit0, lin limit1)
{
lin i0 = next0, i1 = next1;
if (!suppress_common_lines && (i0 != limit0 || i1 != limit1))
{
if (sdiff_merge_assist)
{
printint len0 = limit0 - i0;
printint len1 = limit1 - i1;
fprintf (outfile, "i%""l""d,%""l""d\n", len0, len1);
}
if (!left_column)
{
while (i0 != limit0 && i1 != limit1)
print_1sdiff_line (&files[0].linbuf[i0++], ' ',
&files[1].linbuf[i1++]);
while (i1 != limit1)
print_1sdiff_line (0, ')', &files[1].linbuf[i1++]);
}
while (i0 != limit0)
print_1sdiff_line (&files[0].linbuf[i0++], '(', 0);
}
next0 = limit0;
next1 = limit1;
}
|
long print_sdiff_common_lines(long a1, long a2)
{
long v2;
char **v3;
long v4;
long v5;
long v6;
long result;
long v8;
long v9;
v8 = next0;
v9 = next1;
if ( suppress_common_lines != 1 && (next0 != a1 || next1 != a2) )
{
if ( sdiff_merge_assist )
fprintf(outfile, "i%ld,%ld\n", a1 - next0, a2 - next1);
if ( left_column != 1 )
{
while ( v8 != a1 && v9 != a2 )
{
v2 = v9++;
v3 = (char **)(files[61] + 8 * v2);
v4 = v8++;
print_1sdiff_line(files[23] + 8 * v4, 32, v3);
}
while ( v9 != a2 )
{
v5 = v9++;
print_1sdiff_line(0LL, 41, (char **)(files[61] + 8 * v5));
}
}
while ( v8 != a1 )
{
v6 = v8++;
print_1sdiff_line(files[23] + 8 * v6, 40, 0LL);
}
}
next0 = a1;
result = a2;
next1 = a2;
return result;
}
|
static void
client_global_hostkeys_private_confirm(struct ssh *ssh, int type,
u_int32_t seq, void *_ctx)
{
struct hostkeys_update_ctx *ctx = (struct hostkeys_update_ctx *)_ctx;
size_t i, ndone;
struct sshbuf *signdata;
int r, plaintype;
const u_char *sig;
const char *rsa_kexalg =
((void *)0)
;
char *alg =
((void *)0)
;
size_t siglen;
if (ctx->nnew == 0)
sshfatal("clientloop.c", __func__, 2116, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "ctx->nnew == 0");
if (type != 81) {
sshlog("clientloop.c", __func__, 2118, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Server failed to confirm ownership of " "private host keys")
;
hostkeys_update_ctx_free(ctx);
return;
}
if (sshkey_type_plain(sshkey_type_from_name(
ssh->kex->hostkey_alg)) == KEY_RSA)
rsa_kexalg = ssh->kex->hostkey_alg;
if ((signdata = sshbuf_new()) ==
((void *)0)
)
sshfatal("clientloop.c", __func__, 2127, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new failed");
for (ndone = i = 0; i < ctx->nkeys; i++) {
if (ctx->keys_match[i])
continue;
plaintype = sshkey_type_plain(ctx->keys[i]->type);
sshbuf_reset(signdata);
if ( (r = sshbuf_put_cstring(signdata,
"hostkeys-prove-00@openssh.com")) != 0 ||
(r = sshbuf_put_stringb(signdata,
ssh->kex->session_id)) != 0 ||
(r = sshkey_puts(ctx->keys[i], signdata)) != 0)
sshfatal("clientloop.c", __func__, 2144, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose signdata");
if ((r = sshpkt_get_string_direct(ssh, &sig, &siglen)) != 0) {
sshlog("clientloop.c", __func__, 2147, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "parse sig");
goto out;
}
if ((r = sshkey_get_sigtype(sig, siglen, &alg)) != 0) {
sshlog("clientloop.c", __func__, 2151, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "server gave unintelligible signature " "for %s key %zu", sshkey_type(ctx->keys[i]), i)
;
goto out;
}
if (plaintype == KEY_RSA && rsa_kexalg ==
((void *)0)
&&
match_pattern_list(alg, "rsa-sha2-512,rsa-sha2-256", 0) != 1) {
sshlog("clientloop.c", __func__, 2162, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "server used untrusted RSA signature algorithm " "%s for key %zu, disregarding", alg, i)
;
free(alg);
sshkey_free(ctx->keys[i]);
ctx->keys[i] =
((void *)0)
;
ndone++;
continue;
}
sshlog("clientloop.c", __func__, 2171, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "verify %s key %zu using sigalg %s", sshkey_type(ctx->keys[i]), i, alg)
;
free(alg);
if ((r = sshkey_verify(ctx->keys[i], sig, siglen,
sshbuf_ptr(signdata), sshbuf_len(signdata),
plaintype == KEY_RSA ? rsa_kexalg :
((void *)0)
, 0,
((void *)0)
)) != 0) {
sshlog("clientloop.c", __func__, 2177, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "server gave bad signature for %s key %zu", sshkey_type(ctx->keys[i]), i)
;
goto out;
}
ctx->keys_verified[i] = 1;
ndone++;
}
if (ndone != ctx->nnew)
sshfatal("clientloop.c", __func__, 2187, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "ndone != ctx->nnew (%zu / %zu)", ndone, ctx->nnew);
if ((r = sshpkt_get_end(ssh)) != 0) {
sshlog("clientloop.c", __func__, 2189, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "protocol error");
goto out;
}
update_known_hosts(ctx);
out:
hostkeys_update_ctx_free(ctx);
}
|
unsigned long client_global_hostkeys_private_confirm(long a1, int a2, long a3, _QWORD *a4)
{
long v4;
long v5;
long v6;
const char *v7;
long v8;
const char *v9;
const char *v10;
long v11;
long v12;
long v13;
const char *v14;
long v15;
unsigned int v18;
unsigned int string_direct;
unsigned int sigtype;
unsigned int v21;
int v22;
long v23;
void *ptr;
long v25;
size_t v26;
size_t v27;
long v28;
_QWORD *v29;
long v30;
unsigned long v31;
v31 = __readfsqword(0x28u);
v29 = a4;
v28 = 0LL;
ptr = 0LL;
if ( !a4[6] )
sshfatal("clientloop.c", "client_global_hostkeys_private_confirm", 2116LL, 1LL, 1LL, 0LL, "ctx->nnew == 0");
if ( a2 == 81 )
{
v4 = (unsigned int)sshkey_type_from_name(*(_QWORD *)(*(_QWORD *)(a1 + 8) + 40LL));
if ( !(unsigned int)sshkey_type_plain(v4) )
v28 = *(_QWORD *)(*(_QWORD *)(a1 + 8) + 40LL);
v30 = sshbuf_new();
if ( !v30 )
sshfatal("clientloop.c", "client_global_hostkeys_private_confirm", 2127LL, 1LL, 1LL, 0LL, "sshbuf_new failed");
v26 = 0LL;
v27 = 0LL;
while ( v26 < v29[5] )
{
if ( !*(_DWORD *)(4 * v26 + v29[3]) )
{
v22 = sshkey_type_plain(**(unsigned int **)(8 * v26 + v29[2]));
sshbuf_reset(v30);
v18 = sshbuf_put_cstring(v30, "hostkeys-prove-00@openssh.com");
if ( v18
|| (v18 = sshbuf_put_stringb(v30, *(_QWORD *)(*(_QWORD *)(a1 + 8) + 112LL))) != 0
|| (v18 = sshkey_puts(*(_QWORD *)(8 * v26 + v29[2]), v30)) != 0 )
{
v5 = ssh_err(v18);
sshfatal("clientloop.c", "client_global_hostkeys_private_confirm", 2144LL, 1LL, 1LL, v5, "compose signdata");
}
string_direct = sshpkt_get_string_direct(a1, &v23, &v25);
if ( string_direct )
{
v6 = ssh_err(string_direct);
sshlog("clientloop.c", "client_global_hostkeys_private_confirm", 2147LL, 1LL, 2LL, v6, "parse sig");
goto LABEL_36;
}
sigtype = sshkey_get_sigtype(v23, v25, &ptr);
if ( sigtype )
{
v7 = (const char *)sshkey_type(*(_QWORD *)(8 * v26 + v29[2]));
v8 = ssh_err(sigtype);
sshlog(
"clientloop.c",
"client_global_hostkeys_private_confirm",
2151LL,
1LL,
2LL,
v8,
"server gave unintelligible signature for %s key %zu",
v7,
v26);
goto LABEL_36;
}
if ( v22 || v28 || (unsigned int)match_pattern_list(ptr, "rsa-sha2-512,rsa-sha2-256", 0LL) == 1 )
{
v9 = (const char *)ptr;
v10 = (const char *)sshkey_type(*(_QWORD *)(8 * v26 + v29[2]));
sshlog(
"clientloop.c",
"client_global_hostkeys_private_confirm",
2171LL,
1LL,
7LL,
0LL,
"verify %s key %zu using sigalg %s",
v10,
v26,
v9);
free(ptr);
if ( v22 )
v11 = 0LL;
else
v11 = v28;
v12 = sshbuf_len(v30);
v13 = sshbuf_ptr(v30);
v21 = sshkey_verify(*(_QWORD *)(8 * v26 + v29[2]), v23, v25, v13, v12, v11, 0LL, 0LL);
if ( v21 )
{
v14 = (const char *)sshkey_type(*(_QWORD *)(8 * v26 + v29[2]));
v15 = ssh_err(v21);
sshlog(
"clientloop.c",
"client_global_hostkeys_private_confirm",
2177LL,
1LL,
2LL,
v15,
"server gave bad signature for %s key %zu",
v14,
v26);
goto LABEL_36;
}
*(_DWORD *)(4 * v26 + v29[4]) = 1;
++v27;
}
else
{
sshlog(
"clientloop.c",
"client_global_hostkeys_private_confirm",
2162LL,
1LL,
5LL,
0LL,
"server used untrusted RSA signature algorithm %s for key %zu, disregarding",
(const char *)ptr,
v26);
free(ptr);
sshkey_free(*(_QWORD *)(8 * v26 + v29[2]));
*(_QWORD *)(8 * v26 + v29[2]) = 0LL;
++v27;
}
}
++v26;
}
if ( v27 != v29[6] )
sshfatal(
"clientloop.c",
"client_global_hostkeys_private_confirm",
2187LL,
1LL,
1LL,
0LL,
"ndone != ctx->nnew (%zu / %zu)",
v27,
v29[6]);
if ( (unsigned int)sshpkt_get_end(a1) )
sshlog("clientloop.c", "client_global_hostkeys_private_confirm", 2189LL, 1LL, 2LL, 0LL, "protocol error");
else
update_known_hosts(v29);
LABEL_36:
hostkeys_update_ctx_free((long)v29);
}
else
{
sshlog(
"clientloop.c",
"client_global_hostkeys_private_confirm",
2118LL,
0LL,
2LL,
0LL,
"Server failed to confirm ownership of private host keys");
hostkeys_update_ctx_free((long)v29);
}
return __readfsqword(0x28u) ^ v31;
}
|
void
undo_last_backup (void)
{
if (after_backup_name)
{
if (renameat (chdir_fd, after_backup_name, chdir_fd, before_backup_name)
!= 0)
{
int e =
(*__errno_location ())
;
do { if (error_hook) error_hook (); error (0, e, gettext ("%s: Cannot rename to %s"), quotearg_colon (after_backup_name), quote_n (1, before_backup_name)); exit_status = 2; } while (0)
;
}
if (verbose_option)
fprintf (stdlis, gettext ("Renaming %s back to %s\n"),
quote_n (0, after_backup_name),
quote_n (1, before_backup_name));
assign_string (&after_backup_name, 0);
}
}
|
void undo_last_backup(void)
{
int iVar1;
int *piVar2;
undefined8 uVar3;
undefined8 uVar4;
undefined8 uVar5;
char *__format;
if (after_backup_name != (char *)0x0) {
iVar1 = renameat(chdir_fd,after_backup_name,chdir_fd,before_backup_name);
if (iVar1 != 0) {
piVar2 = __errno_location();
iVar1 = *piVar2;
if (error_hook != (code *)0x0) {
(*error_hook)();
}
uVar3 = quote_n(1,before_backup_name);
uVar4 = quotearg_colon(after_backup_name);
uVar5 = gettext("%s: Cannot rename to %s");
error(0,iVar1,uVar5,uVar4,uVar3);
_exit_status = 2;
}
if (verbose_option != 0) {
uVar3 = quote_n(1,before_backup_name);
uVar4 = quote_n(0,after_backup_name);
__format = (char *)gettext("Renaming %s back to %s\n");
fprintf(stdlis,__format,uVar4,uVar3);
}
assign_string(&after_backup_name,0);
}
return;
}
|
pkgbin_name(pkg, &pkg->available, pnaw_nonambig),
versiondescribe(&pkg->available.version, vdew_nonambig));
} else {
|
void pkgbin_name(void)
{
halt_baddata();
}
|
static inline char *
mk_env_string (name, value, attributes)
const char *name, *value;
int attributes;
{
size_t name_len, value_len;
char *p, *q, *t;
int isfunc, isarray;
name_len = strlen (name);
value_len = (((value) && (value)[0]) ? ((value)[1] ? ((value)[2] ? strlen(value) : 2) : 1) : 0);
isfunc = attributes & 0x0000008;
if (isfunc && value)
{
p = (char *)sh_xmalloc((10 + name_len + 2 + value_len + 2), "variables.c", 4774);
q = p;
memcpy (q, "BASH_FUNC_", 10);
q += 10;
memcpy (q, name, name_len);
q += name_len;
memcpy (q, "%%", 2);
q += 2;
}
else
{
p = (char *)sh_xmalloc((2 + name_len + value_len), "variables.c", 4818);
memcpy (p, name, name_len);
q = p + name_len;
}
q[0] = '=';
if (value && *value)
{
if (isfunc)
{
t = dequote_escapes (value);
value_len = (((t) && (t)[0]) ? ((t)[1] ? ((t)[2] ? strlen(t) : 2) : 1) : 0);
memcpy (q + 1, t, value_len + 1);
sh_xfree((t), "variables.c", 4831);
}
else
memcpy (q + 1, value, value_len + 1);
}
else
q[1] = '\0';
return (p);
}
|
void * mk_env_string(char *param_1,char *param_2,uint param_3)
{
void *__dest;
size_t sVar1;
size_t sVar2;
char *__s;
void *local_30;
undefined *local_28;
sVar1 = strlen(param_1);
if ((param_2 == (char *)0x0) || (*param_2 == '\0')) {
sVar2 = 0;
}
else if (param_2[1] == '\0') {
sVar2 = 1;
}
else if (param_2[2] == '\0') {
sVar2 = 2;
}
else {
sVar2 = strlen(param_2);
}
if (((param_3 & 8) == 0) || (param_2 == (char *)0x0)) {
local_30 = (void *)sh_xmalloc(sVar2 + sVar1 + 2,"variables.c",0x12d2);
memcpy(local_30,param_1,sVar1);
local_28 = (undefined *)(sVar1 + (long)local_30);
}
else {
local_30 = (void *)sh_xmalloc(sVar2 + sVar1 + 0xe,"variables.c",0x12a6);
memcpy(local_30,"BASH_FUNC_",10);
memcpy((void *)((long)local_30 + 10),param_1,sVar1);
__dest = (void *)((long)(void *)((long)local_30 + 10) + sVar1);
memcpy(__dest,&DAT_0010b9e3,2);
local_28 = (undefined *)((long)__dest + 2);
}
*local_28 = 0x3d;
if ((param_2 == (char *)0x0) || (*param_2 == '\0')) {
local_28[1] = 0;
}
else if ((param_3 & 8) == 0) {
memcpy(local_28 + 1,param_2,sVar2 + 1);
}
else {
__s = (char *)dequote_escapes(param_2);
if ((__s == (char *)0x0) || (*__s == '\0')) {
sVar1 = 0;
}
else if (__s[1] == '\0') {
sVar1 = 1;
}
else if (__s[2] == '\0') {
sVar1 = 2;
}
else {
sVar1 = strlen(__s);
}
memcpy(local_28 + 1,__s,sVar1 + 1);
sh_xfree(__s,"variables.c",0x12df);
}
return local_30;
}
|
==
34
) {
retval = getxattr(path_p, name,
((void *)0)
, 0);
if (retval > 0) {
ext_acl_p =
__builtin_alloca (
retval
)
;
if (!ext_acl_p)
return
((void *)0)
;
retval = getxattr(path_p, name, ext_acl_p, retval);
}
}
|
ssize_t getxattr(char *__path,char *__name,void *__value,size_t __size)
{
halt_baddata();
}
|
static FILE *
auth_openfile(const char *file, struct passwd *pw, int strict_modes,
int log_missing, char *file_type)
{
char line[1024];
struct stat st;
int fd;
FILE *f;
if ((fd = open(file,
00
|
04000
)) == -1) {
if (
(*__errno_location ())
!=
2
) {
sshlog("auth2-pubkeyfile.c", __func__, 453, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Could not open user '%s' %s '%s': %s", pw->pw_name, file_type, file, strerror(
(*__errno_location ())
))
;
} else if (log_missing) {
sshlog("auth2-pubkeyfile.c", __func__, 456, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "Could not open user '%s' %s '%s': %s", pw->pw_name, file_type, file, strerror(
(*__errno_location ())
))
;
}
return
((void *)0)
;
}
if (fstat(fd, &st) == -1) {
close(fd);
return
((void *)0)
;
}
if (!
((((
st.st_mode
)) & 0170000) == (0100000))
) {
sshlog("auth2-pubkeyfile.c", __func__, 467, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "User '%s' %s '%s' is not a regular file", pw->pw_name, file_type, file)
;
close(fd);
return
((void *)0)
;
}
unset_nonblock(fd);
if ((f = fdopen(fd, "r")) ==
((void *)0)
) {
close(fd);
return
((void *)0)
;
}
if (strict_modes &&
safe_path_fd(fileno(f), file, pw, line, sizeof(line)) != 0) {
fclose(f);
sshlog("auth2-pubkeyfile.c", __func__, 480, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Authentication refused: %s", line);
auth_debug_add("Ignored %s: %s", file_type, line);
return
((void *)0)
;
}
return f;
}
|
void auth_openfile(char *a0, unsigned long long *a1, unsigned long a2, unsigned long a3, unsigned long long a4) {
unsigned int v0;
void* v1;
char v2;
char v3;
char v4;
void* v7;
void* v8;
void* v9;
void* v10;
unsigned long long v11;
void* v12;
v0 = open(a0, 0x800, a2);
if (v0 == -1) {
if (*(__errno_location()) != 2) {
strerror(*(__errno_location()));
sshlog("auth2-pubkeyfile.c", "auth_openfile", 0x1c5, 0x0, 0x3, 0x0, "Could not open user '%s' %s '%s': %s", *(a1));
} else {
if (a3) {
strerror(*(__errno_location()));
sshlog("auth2-pubkeyfile.c", "auth_openfile", 0x1c8, 0x0, 0x5, 0x0, "Could not open user '%s' %s '%s': %s", *(a1));
}
}
v9 = 0;
} else if (fstat(v0, &v2) == -1) {
close(v0);
v7 = 0;
} else if ((*(&v3) & 0xf000) != 0x8000) {
sshlog("auth2-pubkeyfile.c", "auth_openfile", 0x1d3, 0x0, 0x3, 0x0, "User '%s' %s '%s' is not a regular file", *(a1));
close(v0);
v8 = 0;
} else {
unset_nonblock(v0);
v1 = fdopen(v0, "r");
if (!v1) {
close(v0);
v10 = 0;
} else {
if (a2 && safe_path_fd(fileno(v1), a0, a1, &v4, 0x400)) {
fclose(v1);
sshlog("auth2-pubkeyfile.c", "auth_openfile", 0x1e0, 0x0, 0x3, 0x0, "Authentication refused: %s", &v4);
auth_debug_add("Ignored %s: %s", a4, &v4);
v12 = 0;
goto LABEL_401678;
}
v11 = v1;
}
}
LABEL_401678:
return;
}
|
void
onsig(int signo)
{
if (vforked)
return;
if (signo ==
17
) {
gotsigchld = 1;
if (!trap[
17
])
return;
}
gotsig[signo - 1] = 1;
pending_sig = signo;
if (signo ==
2
&& !trap[
2
]) {
if (!suppressint)
onint();
intpending = 1;
}
}
|
void onsig(int param_1)
{
if (((vforked == 0) &&
(((param_1 != 0x11 || (gotsigchld = 1, trap._136_8_ != 0)) &&
(gotsig[param_1 + -1] = 1, pending_sig = param_1, param_1 == 2)))) && (trap._16_8_ == 0)) {
if (suppressint == 0) {
onint();
}
intpending = 1;
}
return;
}
|
void dpkg_error_print(struct dpkg_error *err, const char *fmt, ...)
__attribute__((format(printf, 2, 2 + 1)));
void dpkg_error_move(struct dpkg_error *dst, struct dpkg_error *src);
void dpkg_error_destroy(struct dpkg_error *err);
enum versiondisplayepochwhen { vdew_never, vdew_nonambig, vdew_always };
|
void dpkg_error_print(void)
{
halt_baddata();
}
|
static void xfrm_print_help(struct link_util *lu, int argc, char **argv,
FILE *f)
{
fprintf(f,
"Usage: ... %-4s dev [ PHYS_DEV ] [ if_id IF-ID ]\n"
"\n"
"Where: IF-ID := { 0x1..0xffffffff }\n",
lu->id);
}
|
int xfrm_print_help(long a1, long a2, long a3, FILE *a4)
{
return fprintf(
a4,
"Usage: ... %-4s dev [ PHYS_DEV ] [ if_id IF-ID ]\n\nWhere: IF-ID := { 0x1..0xffffffff }\n",
*(const char **)(a1 + 8));
}
|
static void print_owner(FILE *f, uid_t uid)
{
struct passwd *pw = getpwuid(uid);
if (pw)
print_string(PRINT_ANY, "user", "user %s ", pw->pw_name);
else
print_uint(PRINT_ANY, "user", "user %u ", uid);
}
|
void print_owner(unsigned long a0, unsigned long a1) {
char v0;
unsigned long v1;
unsigned long long *v2;
unsigned long long v4;
unsigned long long v5;
v1 = a0;
v2 = &getpwuid(a1)->pw_name;
if (v2)
v5 = print_string(0x4, "user", "user %s ", *(v2));
else
v4 = print_uint(0x4, "user", "user %u ", *(&v0));
return;
}
|
static void update_faillog (void)
{
struct faillog fl;
int fd;
off_t off_uid = (off_t) user_id * sizeof fl;
off_t off_newuid = (off_t) user_newid * sizeof fl;
if (access ("/var/log/faillog",
0
) != 0) {
return;
}
fd = open ("/var/log/faillog",
02
);
if (-1 == fd) {
fprintf (
stderr
,
gettext ("%s: failed to copy the faillog entry of user %lu to user %lu: %s\n"),
Prog, (unsigned long) user_id, (unsigned long) user_newid, strerror (
(*__errno_location ())
));
return;
}
if ( (lseek (fd, off_uid,
0
) == off_uid)
&& (read (fd, (char *) &fl, sizeof fl) == (ssize_t) sizeof fl)) {
if ( (lseek (fd, off_newuid,
0
) != off_newuid)
|| (write (fd, &fl, sizeof fl) != (ssize_t) sizeof fl)
|| (fsync (fd) != 0)) {
fprintf (
stderr
,
gettext ("%s: failed to copy the faillog entry of user %lu to user %lu: %s\n"),
Prog, (unsigned long) user_id, (unsigned long) user_newid, strerror (
(*__errno_location ())
));
}
} else {
if ( (lseek (fd, off_newuid,
0
) == off_newuid)
&& (read (fd, &fl, sizeof fl) == (ssize_t) sizeof fl)) {
explicit_bzero((&fl), (sizeof (fl)));
if ( (lseek (fd, off_newuid,
0
) != off_newuid)
|| (write (fd, &fl, sizeof fl) != (ssize_t) sizeof fl)) {
fprintf (
stderr
,
gettext ("%s: failed to copy the faillog entry of user %lu to user %lu: %s\n"),
Prog, (unsigned long) user_id, (unsigned long) user_newid, strerror (
(*__errno_location ())
));
}
}
}
(void) close (fd);
}
|
void update_faillog(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
char v3;
char v4;
unsigned long long v7;
unsigned long long v8;
unsigned long long v10;
unsigned long long v12;
unsigned long long v14;
unsigned long long v16;
unsigned long long *v17;
unsigned long long v18;
*(&v1) = user_id * 32;
*(&v2) = user_newid * 32;
if (!access("/var/log/faillog", 0x0)) {
v0 = open("/var/log/faillog", 0x2, a2);
if (v0 == -1) {
strerror(*(__errno_location()));
fprintf(*(&stderr), gettext("%s: failed to copy the faillog entry of user %lu to user %lu: %s\n"));
} else {
v7 = lseek(v0, *(&v1), 0x0);
if (*(&v1) == v7) {
v8 = read(v0, &v3, 0x20);
if (v8 == 32) {
v10 = lseek(v0, *(&v2), 0x0);
if (*(&v2) == v10)
v12 = write(v0, &v3, 0x20);
if (fsync(v0) || v12 != 32 || *(&v2) != v10) {
v16 = strerror(*(__errno_location()));
fprintf(*(&stderr), gettext("%s: failed to copy the faillog entry of user %lu to user %lu: %s\n"));
}
}
}
if ((v8 != 32 || *(&v1) != v7) && *(&v2) == lseek(v0, *(&v2), 0x0) && read(v0, &v3, 0x20) == 32) {
explicit_bzero(&v3, 0x20);
v14 = lseek(v0, *(&v2), 0x0);
if (write(v0, &v3, 0x20) != 32 || *(&v2) != v14) {
strerror(*(__errno_location()));
fprintf(*(&stderr), gettext("%s: failed to copy the faillog entry of user %lu to user %lu: %s\n"));
}
}
close(v0);
}
}
v18 = *(&v4) ^ v17[5];
return;
}
|
static int do_help(void)
{
const struct ipstats_stat_desc *toplev = &ipstats_stat_desc_toplev_group;
int i;
fprintf(
stderr
,
"Usage: ip stats help\n"
" ip stats show [ dev DEV ] [ group GROUP [ subgroup SUBGROUP [ suite SUITE ] ... ] ... ] ...\n"
" ip stats set dev DEV l3_stats { on | off }\n"
);
for (i = 0; i < toplev->nsubs; i++) {
const struct ipstats_stat_desc *desc = toplev->subs[i];
if (i == 0)
fprintf(
stderr
, "GROUP := { %s", desc->name);
else
fprintf(
stderr
, " | %s", desc->name);
}
if (i > 0)
fprintf(
stderr
, " }\n");
for (i = 0; i < toplev->nsubs; i++) {
const struct ipstats_stat_desc *desc = toplev->subs[i];
_Bool
opened =
0
;
size_t j;
if (desc->kind != IPSTATS_STAT_DESC_KIND_GROUP)
continue;
for (j = 0; j < desc->nsubs; j++) {
size_t k;
if (j == 0)
fprintf(
stderr
, "%s SUBGROUP := {", desc->name);
else
fprintf(
stderr
, " |");
fprintf(
stderr
, " %s", desc->subs[j]->name);
opened =
1
;
if (desc->subs[j]->kind != IPSTATS_STAT_DESC_KIND_GROUP)
continue;
for (k = 0; k < desc->subs[j]->nsubs; k++)
fprintf(
stderr
, " [ suite %s ]",
desc->subs[j]->subs[k]->name);
}
if (opened)
fprintf(
stderr
, " }\n");
}
return 0;
}
|
long do_help()
{
char v1;
int i;
int j;
unsigned long k;
unsigned long m;
long v6;
const char **v7;
fprintf(
stderr,
"Usage: ip stats help\n"
" ip stats show [ dev DEV ] [ group GROUP [ subgroup SUBGROUP [ suite SUITE ] ... ] ... ] ...\n"
" ip stats set dev DEV l3_stats { on | off }\n");
for ( i = 0; i < (unsigned long)*(&ipstats_stat_desc_toplev_group + 3); ++i )
{
v7 = *(const char ***)&(*(&ipstats_stat_desc_toplev_group + 2))[8 * i];
if ( i )
fprintf(stderr, " | %s", *v7);
else
fprintf(stderr, "GROUP := { %s", *v7);
}
if ( i > 0 )
fprintf(stderr, " }\n");
for ( j = 0; j < (unsigned long)*(&ipstats_stat_desc_toplev_group + 3); ++j )
{
v6 = *(_QWORD *)&(*(&ipstats_stat_desc_toplev_group + 2))[8 * j];
v1 = 0;
if ( *(_DWORD *)(v6 + 8) == 1 )
{
for ( k = 0LL; k < *(_QWORD *)(v6 + 24); ++k )
{
if ( k )
fprintf(stderr, " |");
else
fprintf(stderr, "%s SUBGROUP := {", *(const char **)v6);
fprintf(stderr, " %s", **(const char ***)(8 * k + *(_QWORD *)(v6 + 16)));
v1 = 1;
if ( *(_DWORD *)(*(_QWORD *)(8 * k + *(_QWORD *)(v6 + 16)) + 8LL) == 1 )
{
for ( m = 0LL; m < *(_QWORD *)(*(_QWORD *)(8 * k + *(_QWORD *)(v6 + 16)) + 24LL); ++m )
fprintf(
stderr,
" [ suite %s ]",
**(const char ***)(8 * m + *(_QWORD *)(*(_QWORD *)(8 * k + *(_QWORD *)(v6 + 16)) + 16LL)));
}
}
if ( v1 )
fprintf(stderr, " }\n");
}
}
return 0LL;
}
|
void iplink_usage(void)
{
if (iplink_have_newlink()) {
fprintf(
stderr
,
"Usage: ip link add [link DEV | parentdev NAME] [ name ] NAME\n"
" [ txqueuelen PACKETS ]\n"
" [ address LLADDR ]\n"
" [ broadcast LLADDR ]\n"
" [ mtu MTU ] [index IDX ]\n"
" [ numtxqueues QUEUE_COUNT ]\n"
" [ numrxqueues QUEUE_COUNT ]\n"
" type TYPE [ ARGS ]\n"
"\n"
" ip link delete { DEVICE | dev DEVICE | group DEVGROUP } type TYPE [ ARGS ]\n"
"\n"
" ip link set { DEVICE | dev DEVICE | group DEVGROUP }\n"
" [ { up | down } ]\n"
" [ type TYPE ARGS ]\n");
} else
fprintf(
stderr
,
"Usage: ip link set DEVICE [ { up | down } ]\n");
fprintf(
stderr
,
" [ arp { on | off } ]\n"
" [ dynamic { on | off } ]\n"
" [ multicast { on | off } ]\n"
" [ allmulticast { on | off } ]\n"
" [ promisc { on | off } ]\n"
" [ trailers { on | off } ]\n"
" [ carrier { on | off } ]\n"
" [ txqueuelen PACKETS ]\n"
" [ name NEWNAME ]\n"
" [ address LLADDR ]\n"
" [ broadcast LLADDR ]\n"
" [ mtu MTU ]\n"
" [ netns { PID | NAME } ]\n"
" [ link-netns NAME | link-netnsid ID ]\n"
" [ alias NAME ]\n"
" [ vf NUM [ mac LLADDR ]\n"
" [ vlan VLANID [ qos VLAN-QOS ] [ proto VLAN-PROTO ] ]\n"
" [ rate TXRATE ]\n"
" [ max_tx_rate TXRATE ]\n"
" [ min_tx_rate TXRATE ]\n"
" [ spoofchk { on | off} ]\n"
" [ query_rss { on | off} ]\n"
" [ state { auto | enable | disable} ]\n"
" [ trust { on | off} ]\n"
" [ node_guid EUI64 ]\n"
" [ port_guid EUI64 ] ]\n"
" [ { xdp | xdpgeneric | xdpdrv | xdpoffload } { off |\n"
" object FILE [ section NAME ] [ verbose ] |\n"
" pinned FILE } ]\n"
" [ master DEVICE ][ vrf NAME ]\n"
" [ nomaster ]\n"
" [ addrgenmode { eui64 | none | stable_secret | random } ]\n"
" [ protodown { on | off } ]\n"
" [ protodown_reason PREASON { on | off } ]\n"
" [ gso_max_size BYTES ] | [ gso_max_segs PACKETS ]\n"
" [ gro_max_size BYTES ]\n"
"\n"
" ip link show [ DEVICE | group GROUP ] [up] [master DEV] [vrf NAME] [type TYPE]\n"
" [nomaster]\n"
"\n"
" ip link xstats type TYPE [ ARGS ]\n"
"\n"
" ip link afstats [ dev DEVICE ]\n"
" ip link property add dev DEVICE [ altname NAME .. ]\n"
" ip link property del dev DEVICE [ altname NAME .. ]\n");
if (iplink_have_newlink()) {
fprintf(
stderr
,
"\n"
" ip link help [ TYPE ]\n"
"\n");
iplink_types_usage();
}
exit(-1);
}
|
void iplink_usage() {
if (iplink_have_newlink())
fprintf(*(&stderr), "Usage: ip link add [link DEV | parentdev NAME] [ name ] NAME\n\t\t [ txqueuelen PACKETS ]\n\t\t [ address LLADDR ]\n\t\t [ broadcast LLADDR ]\n\t\t [ mtu MTU ] [index IDX ]\n\t\t [ numtxqueues QUEUE_COUNT ]\n\t\t [ numrxqueues QUEUE_COUNT ]\n\t\t type TYPE [ ARGS ]\n\n\tip link delete { DEVICE | dev DEVICE | group DEVGROUP } type TYPE [ ARGS ]\n\n\tip link set { DEVICE | dev DEVICE | group DEVGROUP }\n\t\t\t[ { up | down } ]\n\t\t\t[ type TYPE ARGS ]\n");
else
fprintf(*(&stderr), "Usage: ip link set DEVICE [ { up | down } ]\n");
fprintf(*(&stderr), "\t\t[ arp { on | off } ]\n\t\t[ dynamic { on | off } ]\n\t\t[ multicast { on | off } ]\n\t\t[ allmulticast { on | off } ]\n\t\t[ promisc { on | off } ]\n\t\t[ trailers { on | off } ]\n\t\t[ carrier { on | off } ]\n\t\t[ txqueuelen PACKETS ]\n\t\t[ name NEWNAME ]\n\t\t[ address LLADDR ]\n\t\t[ broadcast LLADDR ]\n\t\t[ mtu MTU ]\n\t\t[ netns { PID | NAME } ]\n\t\t[ link-netns NAME | link-netnsid ID ]\n\t\t[ alias NAME ]\n\t\t[ vf NUM [ mac LLADDR ]\n\t\t\t [ vlan VLANID [ qos VLAN-QOS ] [ proto VLAN-PROTO ] ]\n\t\t\t [ rate TXRATE ]\n\t\t\t [ max_tx_rate TXRATE ]\n\t\t\t [ min_tx_rate TXRATE ]\n\t\t\t [ spoofchk { on | off} ]\n\t\t\t [ query_rss { on | off} ]\n\t\t\t [ state { auto | enable | disable} ]\n\t\t\t [ trust { on | off} ]\n\t\t\t [ node_guid EUI64 ]\n\t\t\t [ port_guid EUI64 ] ]\n\t\t[ { xdp | xdpgeneric | xdpdrv | xdpoffload } { off |\n\t\t\t object FILE [ section NAME ] [ verbose ] |\n\t\t\t pinned FILE } ]\n\t\t[ master DEVICE ][ vrf NAME ]\n\t\t[ nomaster ]\n\t\t[ addrgenmode { eui64 | none | stable_secret | random } ]\n\t\t[ protodown { on | off } ]\n\t\t[ protodown_reason PREASON { on | off } ]\n\t\t[ gso");
if (iplink_have_newlink()) {
fprintf(*(&stderr), "\n\tip link help [ TYPE ]\n\n");
iplink_types_usage();
}
exit(0xffffffff);
}
|
static int xfrm_seq_parse(__u32 *seq, int *argcp, char ***argvp)
{
int argc = *argcp;
char **argv = *argvp;
if (get_be32(seq, *argv, 0))
invarg("SEQ value is invalid", *argv);
*argcp = argc;
*argvp = argv;
return 0;
}
|
void xfrm_seq_parse(unsigned long long a0, unsigned int *a1, unsigned long long *a2) {
unsigned int v0;
unsigned long long *v1;
void* v3;
v0 = *(a1);
v1 = *(a2);
if (get_be32(a0, *(v1), 0x0, *(v1)))
invarg("SEQ value is invalid", *(v1));
*(a1) = v0;
*(a2) = v1;
v3 = 0;
return;
}
|
int parse_server_match_testspec(struct connection_info *ci, char *spec)
{
char *p;
while ((p = strsep(&spec, ",")) && *p != '\0') {
if (strncmp(p, "addr=", 5) == 0) {
ci->address = xstrdup(p + 5);
} else if (strncmp(p, "host=", 5) == 0) {
ci->host = xstrdup(p + 5);
} else if (strncmp(p, "user=", 5) == 0) {
ci->user = xstrdup(p + 5);
} else if (strncmp(p, "laddr=", 6) == 0) {
ci->laddress = xstrdup(p + 6);
} else if (strncmp(p, "rdomain=", 8) == 0) {
ci->rdomain = xstrdup(p + 8);
} else if (strncmp(p, "lport=", 6) == 0) {
ci->lport = a2port(p + 6);
if (ci->lport == -1) {
fprintf(
stderr
, "Invalid port '%s' in test mode"
" specification %s\n", p+6, p);
return -1;
}
} else {
fprintf(
stderr
, "Invalid test mode specification %s\n",
p);
return -1;
}
}
return 0;
}
|
long long parse_server_match_testspec(struct_2 *a0, unsigned long a1) {
unsigned long v0;
char *v1;
unsigned long long v9;
v0 = a1;
while (true) {
v1 = strsep(&v0, ",");
if (v1 && *(v1)) {
if (!strncmp(v1, "addr=", 0x5)) {
a0->field_10 = xstrdup(v1 + 5);
continue;
} else if (!strncmp(v1, "host=", 0x5)) {
*(&a0->padding_0[8]) = xstrdup(v1 + 5);
continue;
} else if (!strncmp(v1, "user=", 0x5)) {
*(&a0->padding_0[0]) = xstrdup(v1 + 5);
continue;
} else if (!strncmp(v1, "laddr=", 0x6)) {
*(&a0[1].padding_0[0]) = xstrdup(v1 + 6);
continue;
} else if (!strncmp(v1, "rdomain=", 0x8)) {
a0[1].field_10 = xstrdup(v1 + 8);
continue;
} else if (!strncmp(v1, "lport=", 0x6)) {
*(&a0[1].padding_0[8]) = a2port(v1 + 6);
if (*(&a0[1].padding_0[8]) != -1)
continue;
fprintf(*(&stderr), "Invalid port '%s' in test mode specification %s\n", (v1 + 6), v1);
v9 = 4294967295;
break;
} else {
fprintf(*(&stderr), "Invalid test mode specification %s\n", v1);
v9 = 4294967295;
break;
}
}
if (!*(v1) || !v1) {
v9 = 0;
break;
}
}
return v9;
}
|
static
_Bool
time_overflow (intmax_t n)
{
return ! (((! ((time_t) 0 < (time_t) -1)) ? ((time_t) ~ ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1)))) <= n : 0 <= n)
&& n <= ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))));
}
|
long time_overflow()
{
return 0LL;
}
|
vi_prev_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
return cv_csearch(el, (-1), -1, el->el_state.argument, 0);
}
|
long long vi_prev_char(struct_0 *a0, unsigned long a1) {
unsigned int v0;
v0 = a1;
return cv_csearch(a0, 0xffffffff, 0xffffffff, a0->field_78, 0x0);
}
|
static
_Bool
gre_is_erspan(struct link_util *lu)
{
return !strcmp(lu->id, "erspan");
}
|
int gre_is_erspan(struct_0 *a0) {
unsigned long long v1;
v1 = strcmp(a0->field_8, "erspan");
*(&v1) = !v1;
return v1;
}
|
static void
reap_some (void)
{
reap (-1);
reap_exited ();
}
|
void reap_some() {
unsigned long long v1;
reap(0xffffffff);
v1 = reap_exited();
return;
}
|
int
_rl_replace_text (const char *text, int start, int end)
{
int n;
n = 0;
rl_begin_undo_group ();
if (start <= end)
rl_delete_text (start, end + 1);
rl_point = start;
if (*text)
n = rl_insert_text (text);
rl_end_undo_group ();
return n;
}
|
undefined4 _rl_replace_text(char *param_1,int param_2,int param_3)
{
undefined4 local_c;
local_c = 0;
rl_begin_undo_group();
if (param_2 <= param_3) {
rl_delete_text(param_2,param_3 + 1);
}
rl_point = param_2;
if (*param_1 != '\0') {
local_c = rl_insert_text(param_1);
}
rl_end_undo_group();
return local_c;
}
|
char *
acl_to_text(acl_t acl, ssize_t *len_p)
{
return __acl_to_any_text(acl, len_p,
((void *)0)
, '\n', "\n",
0x01);
}
|
void acl_to_text(undefined8 param_1,undefined8 param_2)
{
__acl_to_any_text(param_1,param_2,0,10,&DAT_0010003d,1);
return;
}
|
static int
session_exec_req(struct ssh *ssh, Session *s)
{
u_int success;
int r;
char *command =
((void *)0)
;
if ((r = sshpkt_get_cstring(ssh, &command,
((void *)0)
)) != 0 ||
(r = sshpkt_get_end(ssh)) != 0)
sshpkt_fatal(ssh, r, "%s: parse packet", __func__);
success = do_exec(ssh, s, command) == 0;
free(command);
return success;
}
|
_BOOL8 session_exec_req(long a1, long a2)
{
unsigned int cstring;
_BOOL4 v4;
void *ptr[2];
ptr[1] = (void *)__readfsqword(0x28u);
ptr[0] = 0LL;
cstring = sshpkt_get_cstring(a1, ptr, 0LL);
if ( cstring || (cstring = sshpkt_get_end(a1)) != 0 )
sshpkt_fatal(a1, cstring, "%s: parse packet", "session_exec_req");
v4 = do_exec(a1, a2, (char *)ptr[0]) == 0;
free(ptr[0]);
return v4;
}
|
int
match_host_and_ip(const char *host, const char *ipaddr,
const char *patterns)
{
int mhost, mip;
if ((mip = addr_match_list(ipaddr, patterns)) == -2)
return -1;
else if (host ==
((void *)0)
|| ipaddr ==
((void *)0)
|| mip == -1)
return 0;
if ((mhost = match_hostname(host, patterns)) == -1)
return 0;
if (mhost == 0 && mip == 0)
return 0;
return 1;
}
|
int match_host_and_ip(unsigned long long a0, unsigned long long a1, char *a2) {
unsigned int v0;
unsigned int v1;
unsigned int v3;
v0 = addr_match_list(a1, a2, a2);
if (v0 == -2) {
v3 = -1;
} else if (!a0) {
LABEL_400442:
v3 = 0;
} else {
if (!a1)
goto LABEL_400442;
if (v0 == -1)
goto LABEL_400442;
v1 = match_hostname(a0, a2);
if (v1 == -1) {
v3 = 0;
} else {
if (!v1 && !v0) {
v3 = 0;
goto LABEL_400484;
}
v3 = 1;
}
}
LABEL_400484:
return v3;
}
|
char *
uitos (i)
uintmax_t i;
{
char *p, lbuf[(((sizeof (uintmax_t) * 8) - (! ((uintmax_t) 0 < (uintmax_t) -1))) * 302 / 1000 + 1 + (! ((uintmax_t) 0 < (uintmax_t) -1))) + 1];
p = fmtumax (i, 10, lbuf, sizeof(lbuf), 0x08);
return ((char *)strcpy (sh_xmalloc((1 + strlen (p)), "itos.c", 83), (p)));
}
|
long long uitos(unsigned long long a0) {
char *v0;
char v1;
v0 = fmtumax(a0, 0xa, &v1, 0x15, 0x8);
return strcpy(sh_xmalloc(strlen(v0) + 1, "itos.c", 0x53), v0);
}
|
static inline void
emit_mandatory_arg_note (void)
{
fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"),
stdout
)
;
}
|
void emit_mandatory_arg_note() {
unsigned long long v1;
v1 = fputs_unlocked(gettext("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout);
return;
}
|
test_code_t test_server_cas(gnutls_session_t session)
{
int ret;
(void)remove("debug-cas.out");
if (verbose == 0)
return TEST_IGNORE;
sprintf(prio_str,
"NONE:" "+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL" ":%s:"
"+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":" "+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH" ":+VKO-GOST-12" ":%s", protocol_str, rest);
{ int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 1694)) != TEST_SUCCEED) { return _ret; } };
gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred);
gnutls_certificate_set_retrieve_function(xcred, cert_callback);
ret = test_do_handshake(session);
gnutls_certificate_set_retrieve_function(xcred,
((void *)0)
);
if (ret == TEST_FAILED)
return ret;
if (access("debug-cas.out",
4
) == 0)
ext_text = "saved in debug-cas.out";
else
ext_text = "none";
return TEST_SUCCEED;
}
|
long test_server_cas(long a1)
{
unsigned int v2;
int v3;
remove("debug-cas.out");
if ( !verbose )
return 3LL;
sprintf(
prio_str,
"NONE:+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC:+GOST28147-TC26Z-CNT:+COMP-NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT"
":+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH:+VKO-GOST-12:%s",
protocol_str,
rest);
v2 = _gnutls_priority_set_direct(a1, prio_str, 0x69Eu);
if ( v2 )
return v2;
gnutls_credentials_set(a1, 1LL, xcred);
gnutls_certificate_set_retrieve_function(xcred, cert_callback);
v3 = test_do_handshake(a1);
gnutls_certificate_set_retrieve_function(xcred, 0LL);
if ( v3 == 1 )
return 1LL;
if ( access("debug-cas.out", 4) )
ext_text = "none";
else
ext_text = "saved in debug-cas.out";
return 0LL;
}
|
static
_Bool
overwrite_ok (struct cp_options const *x, char const *dst_name,
int dst_dirfd, char const *dst_relname,
struct stat const *dst_sb)
{
if (! writable_destination (dst_dirfd, dst_relname, dst_sb->st_mode))
{
char perms[12];
strmode (dst_sb->st_mode, perms);
perms[10] = '\0';
fprintf (
stderr
,
(x->move_mode || x->unlink_dest_before_opening
|| x->unlink_dest_after_failed_open)
? gettext ("%s: replace %s, overriding mode %04lo (%s)? ")
: gettext ("%s: unwritable %s (mode %04lo, %s); try anyway? "),
program_name, quotearg_style (shell_escape_always_quoting_style, dst_name),
(unsigned long int) (dst_sb->st_mode & (
04000
|
02000
|
01000
|
(0400|0200|0100)
|
((0400|0200|0100) >> 3)
|
(((0400|0200|0100) >> 3) >> 3)
)),
&perms[1]);
}
else
{
fprintf (
stderr
, gettext ("%s: overwrite %s? "),
program_name, quotearg_style (shell_escape_always_quoting_style, dst_name));
}
return yesno ();
}
|
long overwrite_ok(_BYTE *a1, long a2, int a3, const char *a4, long a5)
{
long v5;
long v6;
long v7;
char *v8;
long v9;
long v10;
char *v11;
char v14;
_BYTE v15[11];
unsigned long v16;
v16 = __readfsqword(0x28u);
if ( !writable_destination(a3, a4, *(_DWORD *)(a5 + 24)) )
{
strmode(*(unsigned int *)(a5 + 24), &v14);
v15[9] = 0;
v5 = *(_DWORD *)(a5 + 24) & 0xFFF;
v6 = quotearg_style(4LL, a2);
v7 = program_name;
if ( a1[24] || a1[21] || a1[22] )
v8 = gettext("%s: replace %s, overriding mode %04lo (%s)? ");
else
v8 = gettext("%s: unwritable %s (mode %04lo, %s); try anyway? ");
fprintf(stderr, v8, v7, v6, v5, v15);
}
else
{
v9 = quotearg_style(4LL, a2);
v10 = program_name;
v11 = gettext("%s: overwrite %s? ");
fprintf(stderr, v11, v10, v9);
}
return yesno();
}
|
int decode_signal(const char *string, int minsig)
{
int signo;
signo = decode_signum(string);
if (signo >= 0)
return signo;
for (signo = minsig; signo <
(64 + 1)
; signo++) {
if (!strcasecmp(string, signal_names[signo])) {
return signo;
}
}
return -1;
}
|
int decode_signal(char *a0, unsigned long a1) {
unsigned int v0;
unsigned int v2;
v0 = decode_signum(a0);
if (v0 >= 0) {
v2 = v0;
} else {
v0 = a1;
while (true) {
if (v0 > 64) {
v2 = -1;
break;
} else if (strcasecmp(a0, signal_names[v0])) {
v0 += 1;
} else {
v2 = v0;
break;
}
}
}
return v2;
}
|
static int
mux_client_hello_exchange(int fd)
{
struct sshbuf *m;
u_int type, ver;
int r, ret = -1;
if ((m = sshbuf_new()) ==
((void *)0)
)
sshfatal("mux.c", __func__, 1584, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new");
if ((r = sshbuf_put_u32(m, 0x00000001)) != 0 ||
(r = sshbuf_put_u32(m, 4)) != 0)
sshfatal("mux.c", __func__, 1587, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble hello");
if (mux_client_write_packet(fd, m) != 0) {
sshlog("mux.c", __func__, 1591, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "write packet: %s", strerror(
(*__errno_location ())
));
goto out;
}
sshbuf_reset(m);
if (mux_client_read_packet(fd, m) != 0) {
sshlog("mux.c", __func__, 1599, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "read packet failed");
goto out;
}
if ((r = sshbuf_get_u32(m, &type)) != 0)
sshfatal("mux.c", __func__, 1604, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse type");
if (type != 0x00000001) {
sshlog("mux.c", __func__, 1606, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "expected HELLO (%u) got %u", 0x00000001, type);
goto out;
}
if ((r = sshbuf_get_u32(m, &ver)) != 0)
sshfatal("mux.c", __func__, 1610, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse version");
if (ver != 4) {
sshlog("mux.c", __func__, 1612, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Unsupported multiplexing protocol version %d " "(expected %d)", ver, 4)
;
goto out;
}
sshlog("mux.c", __func__, 1616, 1, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "master version %u", ver);
while (sshbuf_len(m) > 0) {
char *name =
((void *)0)
;
if ((r = sshbuf_get_cstring(m, &name,
((void *)0)
)) != 0 ||
(r = sshbuf_get_string_direct(m,
((void *)0)
,
((void *)0)
)) != 0) {
sshlog("mux.c", __func__, 1623, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "parse extension");
goto out;
}
sshlog("mux.c", __func__, 1626, 0, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "Unrecognised master extension \"%s\"", name);
free(name);
}
ret = 0;
out:
sshbuf_free(m);
return ret;
}
|
int mux_client_hello_exchange(unsigned long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
char v0;
char v1;
unsigned int v2;
unsigned int v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long v7;
char v8;
v3 = -1;
v5 = sshbuf_new(a0, a1, a2, a3, a4, a5);
if (!v5)
sshfatal("mux.c", "mux_client_hello_exchange", 0x630, 0x1, 0x1, 0x0, "sshbuf_new");
v2 = sshbuf_put_u32(v5, 0x1);
if (!v2)
v2 = sshbuf_put_u32(v5, 0x4);
if (v2 || v2) {
v6 = "assemble hello";
sshfatal("mux.c", "mux_client_hello_exchange", 0x633, 0x1, 0x1, ssh_err(v2), *(&v8));
}
if (mux_client_write_packet(a0, v5, v5, a3, a4, a5)) {
v7 = strerror(*(__errno_location()));
v6 = "write packet: %s";
sshlog("mux.c", "mux_client_hello_exchange", 0x637, 0x1, 0x5, 0x0, *(&v8));
} else {
sshbuf_reset(v5);
if (mux_client_read_packet(a0, v5, v5, a3, a4, a5)) {
v6 = "read packet failed";
sshlog("mux.c", "mux_client_hello_exchange", 0x63f, 0x1, 0x5, 0x0, *(&v8));
} else {
v2 = sshbuf_get_u32(v5, &v0, &v0);
if (v2) {
v6 = "parse type";
sshfatal("mux.c", "mux_client_hello_exchange", 0x644, 0x1, 0x1, ssh_err(v2), *(&v8));
}
if (*(&v0) != 1) {
v6 = *(&v0);
v5 = 1;
v4 = "expected HELLO (%u) got %u";
sshlog("mux.c", "mux_client_hello_exchange", 0x646, 0x1, 0x2, 0x0, *(&v8));
} else {
v2 = sshbuf_get_u32(v5, &v1, &v1);
if (v2) {
v6 = "parse version";
sshfatal("mux.c", "mux_client_hello_exchange", 0x64a, 0x1, 0x1, ssh_err(v2), *(&v8));
}
if (*(&v1) != 4) {
v6 = 4;
v5 = *(&v1);
v4 = "Unsupported multiplexing protocol version %d (expected %d)";
sshlog("mux.c", "mux_client_hello_exchange", 0x64c, 0x0, 0x2, 0x0, *(&v8));
} else {
v7 = *(&v1);
v6 = "master version %u";
sshlog("mux.c", "mux_client_hello_exchange", 0x650, 0x1, 0x6, 0x0, *(&v8));
while (true) {
if (sshbuf_len(v5)) {
v4 = 0;
v2 = sshbuf_get_cstring(v5, &v4, 0x0, &v4);
if (!v2) {
v2 = sshbuf_get_string_direct(v5, 0x0, 0x0);
if (!v2) {
v7 = v4;
v6 = "Unrecognised master extension \"%s\"";
sshlog("mux.c", "mux_client_hello_exchange", 0x65a, 0x0, 0x6, 0x0, *(&v8));
free(v4);
}
}
if (v2 || v2) {
v6 = "parse extension";
sshlog("mux.c", "mux_client_hello_exchange", 0x657, 0x1, 0x2, ssh_err(v2), *(&v8));
break;
}
} else {
v3 = 0;
break;
}
}
}
}
}
}
sshbuf_free(v5);
return v3;
}
|
SHELL_VAR *
bind_var_to_int (var, val, flags)
char *var;
intmax_t val;
int flags;
{
char ibuf[(((sizeof (intmax_t) * 8) - (! ((intmax_t) 0 < (intmax_t) -1))) * 302 / 1000 + 1 + (! ((intmax_t) 0 < (intmax_t) -1))) + 1], *p;
p = fmtulong (val, 10, ibuf, sizeof (ibuf), 0);
return (bind_int_variable (var, p, flags));
}
|
void bind_var_to_int(undefined8 param_1,undefined8 param_2,undefined4 param_3)
{
undefined8 uVar1;
long in_FS_OFFSET;
undefined local_28 [24];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
uVar1 = fmtulong(param_2,10,local_28,0x16,0);
bind_int_variable(param_1,uVar1,param_3);
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static void
code_signed_num (uintmax_t value, char const *keyword,
intmax_t minval, uintmax_t maxval, struct xheader *xhdr)
{
char sbuf[SYSINT_BUFSIZE];
xheader_print (xhdr, keyword, sysinttostr (value, minval, maxval, sbuf));
}
|
void code_signed_num(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
undefined8 param_5)
{
undefined8 uVar1;
long in_FS_OFFSET;
undefined local_28 [24];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
uVar1 = sysinttostr(param_1,param_3,param_4,local_28);
xheader_print(param_5,param_2,uVar1);
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static void
null_empty(char **s)
{
if (s ==
((void *)0)
|| *s ==
((void *)0)
|| **s != '\0')
return;
free(*s);
*s =
((void *)0)
;
}
|
void * null_empty(void **a1)
{
void *result;
if ( a1 )
{
result = *a1;
if ( *a1 )
{
result = (void *)*(unsigned char *)*a1;
if ( !(_BYTE)result )
{
free(*a1);
result = a1;
*a1 = 0LL;
}
}
}
return result;
}
|
int xdp_parse(int *argc, char ***argv, struct iplink_req *req,
const char *ifname,
_Bool
generic,
_Bool
drv,
_Bool
offload)
{
struct bpf_cfg_in cfg = {
.type = BPF_PROG_TYPE_XDP,
.argc = *argc,
.argv = *argv,
};
struct xdp_req xdp = {
.req = req,
};
if (offload) {
int ifindex = ll_name_to_index(ifname);
if (!ifindex)
incomplete_command();
cfg.ifindex = ifindex;
}
if (!force)
xdp.flags |= (1U << 0);
if (generic)
xdp.flags |= (1U << 1);
if (drv)
xdp.flags |= (1U << 2);
if (offload)
xdp.flags |= (1U << 3);
if (*argc == 1) {
if (strcmp(**argv, "none") == 0 ||
strcmp(**argv, "off") == 0)
return xdp_delete(&xdp);
}
if (bpf_parse_and_load_common(&cfg, &bpf_cb_ops, &xdp))
return -1;
*argc = cfg.argc;
*argv = cfg.argv;
return 0;
}
|
undefined8
xdp_parse(int *param_1,undefined8 *param_2,undefined8 param_3,undefined8 param_4,char param_5,
char param_6,char param_7)
{
char *pcVar1;
undefined *puVar2;
int iVar3;
undefined8 uVar4;
undefined *puVar5;
long in_FS_OFFSET;
undefined8 local_8068;
ulong local_8060;
undefined local_8058 [32];
undefined4 local_8038;
int local_8030;
int local_8028;
undefined8 local_8020;
undefined local_8008 [32760];
long local_10;
puVar2 = &stack0xfffffffffffffff8;
do {
puVar5 = puVar2;
*(undefined8 *)(puVar5 + -0x1000) = *(undefined8 *)(puVar5 + -0x1000);
puVar2 = puVar5 + -0x1000;
} while (puVar5 + -0x1000 != local_8008);
local_10 = *(long *)(in_FS_OFFSET + 0x28);
*(undefined8 *)(puVar5 + -0x10a8) = 0x1001ad;
memset(local_8058,0,0x8048);
local_8038 = 6;
local_8028 = *param_1;
local_8020 = *param_2;
local_8060 = 0;
local_8068 = param_3;
if (param_7 != '\0') {
*(undefined8 *)(puVar5 + -0x10a8) = 0x100213;
local_8030 = ll_name_to_index(param_4);
if (local_8030 == 0) {
*(undefined8 *)(puVar5 + -0x10a8) = 0x100227;
incomplete_command();
}
}
if (force == 0) {
local_8060 = local_8060 | 1;
}
if (param_5 != '\0') {
local_8060 = local_8060 | 2;
}
if (param_6 != '\0') {
local_8060 = local_8060 | 4;
}
if (param_7 != '\0') {
local_8060 = local_8060 | 8;
}
if (*param_1 == 1) {
pcVar1 = *(char **)*param_2;
*(undefined8 *)(puVar5 + -0x10a8) = 0x1002be;
iVar3 = strcmp(pcVar1,"none");
if (iVar3 != 0) {
pcVar1 = *(char **)*param_2;
*(undefined8 *)(puVar5 + -0x10a8) = 0x1002de;
iVar3 = strcmp(pcVar1,"off");
if (iVar3 != 0) goto LAB_001002f3;
}
*(undefined8 *)(puVar5 + -0x10a8) = 0x1002f1;
uVar4 = xdp_delete(&local_8068);
}
else {
LAB_001002f3:
*(undefined8 *)(puVar5 + -0x10a8) = 0x100310;
iVar3 = bpf_parse_and_load_common(local_8058,bpf_cb_ops,&local_8068);
if (iVar3 == 0) {
*param_1 = local_8028;
*param_2 = local_8020;
uVar4 = 0;
}
else {
uVar4 = 0xffffffff;
}
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return uVar4;
}
*(undefined8 *)(puVar5 + -0x10a8) = 0x100354;
__stack_chk_fail();
}
|
int do_iproute(int argc, char **argv)
{
if (argc < 1)
return iproute_list_flush_or_save(0,
((void *)0)
, IPROUTE_LIST);
if (matches(*argv, "add") == 0)
return iproute_modify(RTM_NEWROUTE, 0x400|0x200,
argc-1, argv+1);
if (matches(*argv, "change") == 0 || strcmp(*argv, "chg") == 0)
return iproute_modify(RTM_NEWROUTE, 0x100,
argc-1, argv+1);
if (matches(*argv, "replace") == 0)
return iproute_modify(RTM_NEWROUTE, 0x400|0x100,
argc-1, argv+1);
if (matches(*argv, "prepend") == 0)
return iproute_modify(RTM_NEWROUTE, 0x400,
argc-1, argv+1);
if (matches(*argv, "append") == 0)
return iproute_modify(RTM_NEWROUTE, 0x400|0x800,
argc-1, argv+1);
if (matches(*argv, "test") == 0)
return iproute_modify(RTM_NEWROUTE, 0x200,
argc-1, argv+1);
if (matches(*argv, "delete") == 0)
return iproute_modify(RTM_DELROUTE, 0,
argc-1, argv+1);
if (matches(*argv, "list") == 0 || matches(*argv, "show") == 0
|| matches(*argv, "lst") == 0)
return iproute_list_flush_or_save(argc-1, argv+1, IPROUTE_LIST);
if (matches(*argv, "get") == 0)
return iproute_get(argc-1, argv+1);
if (matches(*argv, "flush") == 0)
return iproute_list_flush_or_save(argc-1, argv+1, IPROUTE_FLUSH);
if (matches(*argv, "save") == 0)
return iproute_list_flush_or_save(argc-1, argv+1, IPROUTE_SAVE);
if (matches(*argv, "restore") == 0)
return iproute_restore();
if (matches(*argv, "showdump") == 0)
return iproute_showdump();
if (matches(*argv, "help") == 0)
usage();
fprintf(
stderr
,
"Command \"%s\" is unknown, try \"ip route help\".\n", *argv);
exit(-1);
}
|
long long do_iproute(unsigned long a0, unsigned long long *a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v1;
if (a0 <= 0) {
v1 = iproute_list_flush_or_save(0x0, 0x0, 0x0, a3);
return v1;
} else if (!(matches(*(a1), "add") ^ 1)) {
if (!(matches(*(a1), "change") ^ 1) && strcmp(*(a1), "chg")) {
if ((matches(*(a1), "replace") ^ 1)) {
v1 = iproute_modify(0x18, 0x500, a0 - 1, a1 + 1);
return v1;
} else if ((matches(*(a1), "prepend") ^ 1)) {
v1 = iproute_modify(0x18, 0x400, a0 - 1, a1 + 1);
return v1;
} else if ((matches(*(a1), "append") ^ 1)) {
v1 = iproute_modify(0x18, 0xc00, a0 - 1, a1 + 1);
return v1;
} else if ((matches(*(a1), "test") ^ 1)) {
v1 = iproute_modify(0x18, 0x200, a0 - 1, a1 + 1);
return v1;
} else if (!(matches(*(a1), "delete") ^ 1)) {
if (!(matches(*(a1), "list") ^ 1) && !(matches(*(a1), "show") ^ 1) && !(matches(*(a1), "lst") ^ 1)) {
if ((matches(*(a1), "get") ^ 1)) {
v1 = iproute_get(a0 - 1, a1 + 1, a1 + 1, a3, a4, a5);
return v1;
} else if ((matches(*(a1), "flush") ^ 1)) {
v1 = iproute_list_flush_or_save(a0 - 1, a1 + 1, 0x1, a1 + 1);
return v1;
} else if ((matches(*(a1), "save") ^ 1)) {
v1 = iproute_list_flush_or_save(a0 - 1, a1 + 1, 0x2, a1 + 1);
return v1;
} else if ((matches(*(a1), "restore") ^ 1)) {
v1 = iproute_restore();
return v1;
} else if ((matches(*(a1), "showdump") ^ 1)) {
v1 = iproute_showdump();
return v1;
} else if ((matches(*(a1), "help") ^ 1)) {
usage();
} else {
fprintf(stderr, "Command \"%s\" is unknown, try \"ip route help\".\n", *(a1));
exit(0xffffffff);
}
}
v1 = iproute_list_flush_or_save(a0 - 1, a1 + 1, 0x0, a1 + 1);
return v1;
} else {
v1 = iproute_modify(0x19, 0x0, a0 - 1, a1 + 1);
return v1;
}
}
v1 = iproute_modify(0x18, 0x100, a0 - 1, a1 + 1);
return v1;
} else {
v1 = iproute_modify(0x18, 0x600, a0 - 1, a1 + 1);
return v1;
}
}
|
static inline rsRetVal
submitMsgWithDfltRatelimiter(smsg_t *pMsg)
{
return ratelimitAddMsg(dflt_ratelimiter,
((void *)0)
, pMsg);
}
|
void submitMsgWithDfltRatelimiter(unsigned long long a0) {
unsigned long long v1;
v1 = ratelimitAddMsg(dflt_ratelimiter, 0x0, a0);
return;
}
|
static void print_crl_info(gnutls_x509_crl_t crl, FILE * out, common_info_st *cinfo)
{
gnutls_datum_t data;
gnutls_datum_t cout;
int ret;
if (cinfo->outtext) {
ret = gnutls_x509_crl_print(crl, full_format, &data);
if (ret < 0) {
fprintf(
stderr
, "crl_print: %s\n", gnutls_strerror(ret));
app_exit(1);
}
fprintf(out, "%s\n", data.data);
gnutls_free((void *) (data.data)), data.data=
((void *)0)
;
}
ret =
gnutls_x509_crl_export2(crl, outcert_format, &cout);
if (ret < 0) {
fprintf(
stderr
, "crl_export: %s\n", gnutls_strerror(ret));
app_exit(1);
}
fwrite(cout.data, 1, cout.size, outfile);
gnutls_free((void *) (cout.data)), cout.data=
((void *)0)
;
}
|
void print_crl_info(unsigned long long a0, void* a1, struct_0 *a2) {
unsigned int v0;
char v1;
char v2;
char v3;
char v4;
unsigned long long *v6;
unsigned long long v7;
if (a2->field_24) {
v0 = gnutls_x509_crl_print(a0, full_format, &v1, full_format);
if (v0 >= 0) {
fprintf(a1, "%s\n", *(&v1));
*(5243720)(*(&v1));
v1 = 0;
} else {
fprintf(*(&stderr), "crl_print: %s\n", gnutls_strerror(v0));
app_exit(0x1);
}
}
v0 = gnutls_x509_crl_export2(a0, outcert_format, &v2, outcert_format);
if (v0 < 0) {
fprintf(*(&stderr), "crl_export: %s\n", gnutls_strerror(v0));
app_exit(0x1);
}
fwrite(*(&v2), 0x1, *(&v3), outfile);
*(5243720)(*(&v2));
v2 = 0;
v7 = *(&v4) ^ v6[5];
return;
}
|
void
dispose_partial_redirects ()
{
if (redirection_undo_list)
{
dispose_redirects (redirection_undo_list);
redirection_undo_list = (REDIRECT *)
((void *)0)
;
}
}
|
void dispose_partial_redirects(void)
{
if (redirection_undo_list != 0) {
dispose_redirects(redirection_undo_list);
redirection_undo_list = 0;
}
return;
}
|
static void
catchsig (int s)
{
if (! (s ==
2
&& ignore_SIGINT))
signal_received = s;
}
|
long long catchsig(unsigned long a0) {
unsigned long long v1;
if (a0 == 2) {
v1 = ignore_SIGINT ^ 1;
if (!(ignore_SIGINT ^ 1))
return v1;
}
v1 = a0;
signal_received = a0;
return v1;
}
|
static
_Bool
open_failure_recover (struct tar_stat_info const *dir)
{
if (
(*__errno_location ())
==
24
&& dir && dir->parent)
{
struct tar_stat_info *p;
for (p = dir->parent->parent; p; p = p->parent)
if (0 < p->fd && (! p->parent || p->parent->fd <= 0))
{
tar_stat_close (p);
return
1
;
}
(*__errno_location ())
=
24
;
}
return
0
;
}
|
int open_failure_recover(struct_0 *a0) {
struct_2 *v0;
unsigned int v2;
unsigned int v3;
v2 = *(__errno_location());
if (v2 == 24 && a0 && a0->field_198) {
v0 = a0->field_198->field_198;
while (true) {
if (v0) {
if (v0->field_1a8 > 0 && (v0->field_198->field_1a8 <= 0 || !v0->field_198)) {
tar_stat_close(v0);
v3 = 1;
break;
}
if (v0->field_1a8 <= 0 || v0->field_198->field_1a8 > 0 && v0->field_198)
v0 = &v0->field_198->padding_0;
} else {
*(__errno_location()) = 24;
break;
}
}
}
if (v0->field_1a8 <= 0 || !v0 || !a0 || !a0->field_198 || v2 != 24 || v0->field_198->field_1a8 > 0 && v0->field_198)
v3 = 0;
return v3;
}
|
static void
chan_send_eof2(struct ssh *ssh, Channel *c)
{
int r;
sshlog("nchan.c", __func__, 188, 0, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "channel %d: send eof", c->self);
switch (c->istate) {
case 1:
if (!c->have_remote_id)
sshfatal("nchan.c", __func__, 192, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "channel %d: no remote_id", c->self);
if ((r = sshpkt_start(ssh, 96)) != 0 ||
(r = sshpkt_put_u32(ssh, c->remote_id)) != 0 ||
(r = sshpkt_send(ssh)) != 0)
sshfatal("nchan.c", __func__, 196, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "send CHANNEL_EOF");
c->flags |= 0x04;
break;
default:
sshlog("nchan.c", __func__, 200, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "channel %d: cannot send eof for istate %d", c->self, c->istate)
;
break;
}
}
|
unsigned int * chan_send_eof2(long a1, unsigned int *a2)
{
long v2;
unsigned int *result;
unsigned int v4;
sshlog("nchan.c", "chan_send_eof2", 188LL, 0LL, 6LL, 0LL, "channel %d: send eof", a2[1]);
if ( a2[4] != 1 )
return (unsigned int *)sshlog(
"nchan.c",
"chan_send_eof2",
200LL,
0LL,
2LL,
0LL,
"channel %d: cannot send eof for istate %d",
a2[1],
a2[4]);
if ( !a2[3] )
sshfatal("nchan.c", "chan_send_eof2", 192LL, 1LL, 1LL, 0LL, "channel %d: no remote_id", a2[1]);
v4 = sshpkt_start(a1, 96LL);
if ( v4 || (v4 = sshpkt_put_u32(a1, a2[2])) != 0 || (v4 = sshpkt_send(a1)) != 0 )
{
v2 = ssh_err(v4);
sshfatal("nchan.c", "chan_send_eof2", 196LL, 1LL, 1LL, v2, "send CHANNEL_EOF");
}
result = a2;
a2[6] |= 4u;
return result;
}
|
int
strnunvis(char *dst, size_t dlen, const char *src)
{
return strnunvisx(dst, dlen, src, 0);
}
|
long long strnunvis(unsigned long long a0, unsigned long long a1, unsigned int a2) {
return strnunvisx(a0, a1, a2, 0x0);
}
|
static void
dunlink_reclaim (struct deferred_unlink *p)
{
free (p->file_name);
p->next = dunlink_avail;
dunlink_avail = p;
}
|
void dunlink_reclaim(unsigned long long a0[3]) {
unsigned long long v1[3];
free(a0[2]);
a0[0] = dunlink_avail;
v1 = a0;
dunlink_avail[0] = a0;
return;
}
|
static inline void
emit_ancillary_info (char const *program)
{
struct infomap { char const *program; char const *node; } const infomap[] = {
{ "[", "test invocation" },
{ "coreutils", "Multi-call invocation" },
{ "sha224sum", "sha2 utilities" },
{ "sha256sum", "sha2 utilities" },
{ "sha384sum", "sha2 utilities" },
{ "sha512sum", "sha2 utilities" },
{
((void *)0)
,
((void *)0)
}
};
char const *node = program;
struct infomap const *map_prog = infomap;
while (map_prog->program && ! (strcmp (program, map_prog->program) == 0))
map_prog++;
if (map_prog->node)
node = map_prog->node;
printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https:
char const *lc_messages = setlocale (
5
,
((void *)0)
);
if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1))
{
fputs_unlocked (gettext ("Report any translation bugs to " "<https:
stdout
)
;
}
char const *url_program = (strcmp (program, "[") == 0) ? "test" : program;
printf (gettext ("Full documentation <%s%s>\n"),
"https:
printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"),
node, node == program ? " invocation" : "");
}
|
void emit_ancillary_info(char *a0) {
unsigned long long v0;
unsigned long long v1[2];
char *v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
void* v16;
void* v17;
char v18;
unsigned long long v23;
unsigned long long *v24;
unsigned long long v25;
v4 = "[";
v5 = "test invocation";
v6 = "coreutils";
v7 = "Multi-call invocation";
v8 = "sha224sum";
v9 = "sha2 utilities";
v10 = "sha256sum";
v11 = "sha2 utilities";
v12 = "sha384sum";
v13 = "sha2 utilities";
v14 = "sha512sum";
v15 = "sha2 utilities";
v16 = 0;
v17 = 0;
v0 = a0;
for (v1[0] = &v4; v1[0]; v1[0] = v1 + 1) {
if (!strcmp(a0, v1[0]))
break;
}
if (v1[1])
v0 = v1[1];
printf(gettext("\n%s online help: <%s>\n"));
v2 = setlocale(0x5, NULL);
if (v2 && strncmp(v2, "en_", 0x3))
fputs_unlocked(gettext("Report any translation bugs to <https:
if (strcmp(a0, "["))
v23 = a0;
else
v23 = "test";
v3 = v23;
printf(gettext("Full documentation <%s%s>\n"));
printf(gettext("or available locally via: info '(coreutils) %s%s'\n"));
v25 = *(&v18) ^ v24[5];
return;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.