input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
static
_Bool
ip6_tnl_parm_match(const struct tnl_print_nlmsg_info *info)
{
const struct ip6_tnl_parm2 *p1 = info->p1;
const struct ip6_tnl_parm2 *p2 = info->p2;
return ((!p1->link || p1->link == p2->link) &&
(!p1->name[0] || strcmp(p1->name, p2->name) == 0) &&
(
(__extension__ ({ const struct in6_addr *__a = (const struct in6_addr *) (
&p1->laddr
); __a->__in6_u.__u6_addr32[0] == 0 && __a->__in6_u.__u6_addr32[1] == 0 && __a->__in6_u.__u6_addr32[2] == 0 && __a->__in6_u.__u6_addr32[3] == 0; }))
||
(__extension__ ({ const struct in6_addr *__a = (const struct in6_addr *) (
&p1->laddr
); const struct in6_addr *__b = (const struct in6_addr *) (
&p2->laddr
); __a->__in6_u.__u6_addr32[0] == __b->__in6_u.__u6_addr32[0] && __a->__in6_u.__u6_addr32[1] == __b->__in6_u.__u6_addr32[1] && __a->__in6_u.__u6_addr32[2] == __b->__in6_u.__u6_addr32[2] && __a->__in6_u.__u6_addr32[3] == __b->__in6_u.__u6_addr32[3]; }))
) &&
(
(__extension__ ({ const struct in6_addr *__a = (const struct in6_addr *) (
&p1->raddr
); __a->__in6_u.__u6_addr32[0] == 0 && __a->__in6_u.__u6_addr32[1] == 0 && __a->__in6_u.__u6_addr32[2] == 0 && __a->__in6_u.__u6_addr32[3] == 0; }))
||
(__extension__ ({ const struct in6_addr *__a = (const struct in6_addr *) (
&p1->raddr
); const struct in6_addr *__b = (const struct in6_addr *) (
&p2->raddr
); __a->__in6_u.__u6_addr32[0] == __b->__in6_u.__u6_addr32[0] && __a->__in6_u.__u6_addr32[1] == __b->__in6_u.__u6_addr32[1] && __a->__in6_u.__u6_addr32[2] == __b->__in6_u.__u6_addr32[2] && __a->__in6_u.__u6_addr32[3] == __b->__in6_u.__u6_addr32[3]; }))
) &&
(!p1->proto || !p2->proto || p1->proto == p2->proto) &&
(!p1->encap_limit || p1->encap_limit == p2->encap_limit) &&
(!p1->hop_limit || p1->hop_limit == p2->hop_limit) &&
(!(p1->flowinfo & htonl(0x0FF00000)) ||
!((p1->flowinfo ^ p2->flowinfo) & htonl(0x0FF00000))) &&
(!(p1->flowinfo & htonl(0x000FFFFF)) ||
!((p1->flowinfo ^ p2->flowinfo) & htonl(0x000FFFFF))) &&
(!p1->flags || (p1->flags & p2->flags)));
}
| long long ip6_tnl_parm_match(unsigned long long a0[3]) {
struct_1 *v0;
struct_0 *v1;
unsigned int v2[4];
unsigned int v3[4];
unsigned int v4[4];
unsigned int v5[4];
unsigned int v6[4];
unsigned int v7[4];
unsigned int v9;
unsigned long v10;
v0 = a0[1];
v1 = a0[2];
if (!v0->field_10 || v0->field_10 == v1->field_10) {
if (!v9) {
*(&v3[0]) = v0 + 1;
*(&v4[0]) = v1 + 1;
if (v3[0] == v4[0] && v3[1] == v4[1] && v3[2] == v4[2] && v3[3] == v4[3])
v9 = 1;
if (v3[1] != v4[1] || v3[0] != v4[0] || v3[2] != v4[2] || v3[3] != v4[3])
v9 = 0;
}
if (v0->field_0) {
v9 = strcmp(v0, v1);
} else if (v9) {
*(&v5[0]) = &v0[1].field_10;
if (!v5[0] && !v5[1] && !v5[2] && !v5[3])
v9 = 1;
if (v5[3] || v5[0] || v5[2] || v5[1])
v9 = 0;
}
}
if (!v0->field_10 && !v0->field_0 || !v0->field_10 && !v9 || !v0->field_0 && v0->field_10 == v1->field_10 || !v9 && v0->field_10 == v1->field_10) {
*(&v2[0]) = v0 + 1;
if (!v2[0] && !v2[1] && !v2[2] && !v2[3])
v9 = 1;
if (v2[0] || v2[2] || v2[1] || v2[3])
v9 = 0;
}
if (false) {
*(&v6[0]) = &v0[1].field_10;
*(&v7[0]) = &v1[1].field_10;
if (v6[0] == v7[0] && v6[1] == v7[1] && v6[2] == v7[2] && v6[3] == v7[3])
v9 = 1;
if (v6[2] != v7[2] || v6[1] != v7[1] || v6[3] != v7[3] || v6[0] != v7[0])
v9 = 0;
}
if (...) {
v9 = htonl(0xff00000) & v0->field_18;
if (v9)
v9 = htonl(0xff00000) & (v0->field_18 ^ v1->field_18);
}
if (...) {
v9 = htonl(0xfffff) & v0->field_18;
v9 = htonl(0xfffff) & (v0->field_18 ^ v1->field_18);
}
if (...)
v9 = 0;
if (...)
v9 = 1;
v10 = v9 & 1;
return v10;
}
|
void get_dc_set(int type, void *crt)
{
int ret = 0, i;
if (batch) {
if (!cfg.dc)
return;
for (i = 0; cfg.dc[i] !=
((void *)0)
; i++) {
if (type == 1)
ret =
gnutls_x509_crt_set_dn_by_oid(crt,
"0.9.2342.19200300.100.1.25",
0,
cfg.
dc[i],
strlen
(cfg.
dc[i]));
else
ret =
gnutls_x509_crq_set_dn_by_oid(crt,
"0.9.2342.19200300.100.1.25",
0,
cfg.
dc[i],
strlen
(cfg.
dc[i]));
if (ret < 0)
break;
}
} else {
const char *p;
unsigned int counter = 0;
do {
if (counter == 0) {
p = read_str
("Enter the subject's domain component (DC): ");
} else {
p = read_str
("Enter an additional domain component (DC): ");
}
if (!p)
return;
if (type == 1)
ret =
gnutls_x509_crt_set_dn_by_oid(crt,
"0.9.2342.19200300.100.1.25",
0, p,
strlen
(p));
else
ret =
gnutls_x509_crq_set_dn_by_oid(crt,
"0.9.2342.19200300.100.1.25",
0, p,
strlen
(p));
counter++;
if (ret < 0)
break;
}
while (p !=
((void *)0)
);
}
if (ret < 0) {
fprintf(
stderr
, "set_dn_by_oid: %s\n",
gnutls_strerror(ret));
exit(1);
}
}
| long long get_dc_set(unsigned long a0, unsigned long long a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
char *v3;
unsigned long long v5;
v0 = 0;
if (!*(got.batch)) {
v2 = 0;
do {
if (!v2) {
v5 = read_str("Enter the subject's domain component (DC): ");
v3 = v5;
} else {
v5 = read_str("Enter an additional domain component (DC): ");
v3 = v5;
}
if (!v3)
return v5;
if (a0 != 1) {
v5 = gnutls_x509_crq_set_dn_by_oid(a1, "0.9.2342.19200300.100.1.25", 0x0, v3, strlen(v3));
v0 = v5;
} else {
v5 = gnutls_x509_crt_set_dn_by_oid(a1, "0.9.2342.19200300.100.1.25", 0x0, v3, strlen(v3));
v0 = v5;
}
v2 += 1;
} while (v0 >= 0 && v3);
} else {
v5 = *((got.cfg + 304));
if (!*((got.cfg + 304)))
return v5;
v1 = 0;
while (true) {
v5 = *((*((got.cfg + 304)) + v1 * 8));
if (!*((*((got.cfg + 304)) + (v1 << 3))))
break;
if (a0 != 1) {
v5 = gnutls_x509_crq_set_dn_by_oid(a1, "0.9.2342.19200300.100.1.25", 0x0, *((*((got.cfg + 304)) + v1 * 8)), strlen(*((*((got.cfg + 304)) + v1 * 8))));
v0 = v5;
} else {
v5 = gnutls_x509_crt_set_dn_by_oid(a1, "0.9.2342.19200300.100.1.25", 0x0, *((*((got.cfg + 304)) + v1 * 8)), strlen(*((*((got.cfg + 304)) + v1 * 8))));
v0 = v5;
}
if (v0 < 0)
break;
v1 += 1;
}
}
if (v0 < 0) {
fprintf(*(got.stderr), "set_dn_by_oid: %s\n", gnutls_strerror(v0));
exit(0x1);
}
return v5;
}
|
BUF *
allocbuf(BUF *bp, int fd, int blksize)
{
size_t size;
struct stat stb;
if (fstat(fd, &stb) == -1) {
run_err("fstat: %s", strerror(
(*__errno_location ())
));
return (0);
}
size = ((((stb.st_blksize)+((blksize)-1))/(blksize))*(blksize));
if (size == 0)
size = blksize;
if (bp->cnt >= size)
return (bp);
bp->buf = xrecallocarray(bp->buf, bp->cnt, size, 1);
bp->cnt = size;
return (bp);
}
| int allocbuf(unsigned long long a0[2], unsigned long a1, unsigned long a2) {
unsigned long long v0;
char v1;
char v2;
unsigned int v4;
v4 = fstat(a1, &v1);
if (v4 == -1) {
strerror(*(__errno_location()));
run_err();
v4 = 0;
} else {
v4 = __addvdi3(*(&v2), __addvsi3(a2, 0xffffffff));
v0 = __mulvdi3((v4 >> 63 CONCAT v4) /m a2, a2);
if (!v0)
v0 = a2;
if (v0 <= a0[0]) {
v4 = a0;
} else {
a0[1] = xrecallocarray(a0[1], a0[0], v0, 0x1);
a0[0] = v0;
v4 = a0;
}
}
return v4;
}
|
static int
newkeys_from_blob(struct sshbuf *m, struct ssh *ssh, int mode)
{
struct sshbuf *b =
((void *)0)
;
struct sshcomp *comp;
struct sshenc *enc;
struct sshmac *mac;
struct newkeys *newkey =
((void *)0)
;
size_t keylen, ivlen, maclen;
int r;
if ((newkey = calloc(1, sizeof(*newkey))) ==
((void *)0)
) {
r = -2;
goto out;
}
if ((r = sshbuf_froms(m, &b)) != 0)
goto out;
enc = &newkey->enc;
mac = &newkey->mac;
comp = &newkey->comp;
if ((r = sshbuf_get_cstring(b, &enc->name,
((void *)0)
)) != 0 ||
(r = sshbuf_get_u32(b, (u_int *)&enc->enabled)) != 0 ||
(r = sshbuf_get_u32(b, &enc->block_size)) != 0 ||
(r = sshbuf_get_string(b, &enc->key, &keylen)) != 0 ||
(r = sshbuf_get_string(b, &enc->iv, &ivlen)) != 0)
goto out;
if ((enc->cipher = cipher_by_name(enc->name)) ==
((void *)0)
) {
r = -4;
goto out;
}
if (cipher_authlen(enc->cipher) == 0) {
if ((r = sshbuf_get_cstring(b, &mac->name,
((void *)0)
)) != 0)
goto out;
if ((r = mac_setup(mac, mac->name)) != 0)
goto out;
if ((r = sshbuf_get_u32(b, (u_int *)&mac->enabled)) != 0 ||
(r = sshbuf_get_string(b, &mac->key, &maclen)) != 0)
goto out;
if (maclen > mac->key_len) {
r = -4;
goto out;
}
mac->key_len = maclen;
}
if ((r = sshbuf_get_u32(b, &comp->type)) != 0 ||
(r = sshbuf_get_cstring(b, &comp->name,
((void *)0)
)) != 0)
goto out;
if (sshbuf_len(b) != 0) {
r = -4;
goto out;
}
enc->key_len = keylen;
enc->iv_len = ivlen;
ssh->kex->newkeys[mode] = newkey;
newkey =
((void *)0)
;
r = 0;
out:
free(newkey);
sshbuf_free(b);
return r;
}
| int newkeys_from_blob(unsigned long long a0, struct_0 *a1, unsigned long a2) {
unsigned int v0;
void* v1;
char v2;
char v3;
char v4;
void* v5;
void* v6;
struct_1 *v7;
unsigned long long v8;
unsigned long long v10;
v1 = 0;
v5 = 0;
v5 = calloc(0x1, 0x78);
if (!v5) {
v0 = -2;
} else {
v0 = sshbuf_froms(a0, &v1, &v1);
if (!v0) {
v6 = v5;
v7 = &v5[48];
v8 = v5 + 104;
v0 = sshbuf_get_cstring(v1, v6, 0x0, v6);
if (!v0) {
v0 = sshbuf_get_u32(v1, v6 + 16, v6 + 16);
if (!v0) {
v0 = sshbuf_get_u32(v1, v6 + 28, v6 + 28);
if (!v0) {
v0 = sshbuf_get_string(v1, v6 + 32, &v2, v6 + 32);
if (!v0) {
v0 = sshbuf_get_string(v1, v6 + 40, &v3, v6 + 40);
if (!v0) {
*(&v6[8]) = cipher_by_name(*(v6));
if (!v6[8]) {
v0 = -0x4;
} else {
v10 = cipher_authlen(v6[8]);
if (!v10) {
v0 = sshbuf_get_cstring(v1, v7, 0x0, v7);
if (!v0) {
v0 = mac_setup(v7, v7->field_0, v7->field_0);
if (!v0) {
v0 = sshbuf_get_u32(v1, &v7->padding_8, &v7->padding_8);
if (!v0) {
v0 = sshbuf_get_string(v1, &v7->padding_8[8], &v4, &v7->padding_8[8]);
if (!v0) {
if (v7->field_18 < *(&v4))
v0 = -0x4;
else
v7->field_18 = *(&v4);
}
}
}
}
}
if (v10 || !v0 && !v0 && !v0 && !v0 && v7->field_18 >= *(&v4)) {
v0 = sshbuf_get_u32(v1, v8, v8);
if (!v0) {
v0 = sshbuf_get_cstring(v1, v8 + 8, 0x0, v8 + 8);
if (!v0) {
if (sshbuf_len(v1)) {
v0 = -0x4;
} else {
*(&v6[20]) = *(&v2);
*(&v6[24]) = *(&v3);
*((a1->field_8 + a2 * 8)) = v5;
v5 = 0;
v0 = 0;
}
}
}
}
}
}
}
}
}
}
}
}
free(v5);
sshbuf_free(v1);
return v0;
}
|
static void print_mpls_stats(FILE *fp, struct rtattr *attr)
{
struct rtattr *mrtb[(__MPLS_STATS_MAX - 1)+1];
struct mpls_link_stats *stats;
parse_rtattr(mrtb, (__MPLS_STATS_MAX - 1), ((void*)(((char*)(attr)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))),
((int)((attr)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
if (!mrtb[MPLS_STATS_LINK])
return;
stats = ((void*)(((char*)(mrtb[MPLS_STATS_LINK])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
fprintf(fp, " mpls:\n");
print_mpls_link_stats(fp, stats, " ");
fprintf(fp, "\n");
}
| void print_mpls_stats(FILE *param_1,ushort *param_2)
{
long in_FS_OFFSET;
undefined local_28 [8];
long local_20;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
parse_rtattr(local_28,1,param_2 + 2,*param_2 - 4);
if (local_20 != 0) {
fprintf(param_1," mpls:\n");
print_mpls_link_stats(param_1,local_20 + 4," ");
fprintf(param_1,"\n");
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static inline __u32 rta_getattr_u32(const struct rtattr *rta)
{
return *(__u32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| undefined4 rta_getattr_u32(long param_1)
{
return *(undefined4 *)(param_1 + 4);
}
|
int
main(argc, argv)
int argc;
char **argv;
{
int opt, i;
char *filename;
FILE *fp;
if ((progname = strrchr (argv[0], '/')) == 0)
progname = argv[0];
else
progname++;
filename = (char *)
((void *)0)
;
debug = 0;
while ((opt = getopt (argc, argv, "do:")) !=
(-1)
)
{
switch (opt)
{
case 'd':
debug = 1;
break;
case 'o':
filename = optarg;
break;
default:
usage();
}
}
argc -= optind;
argv += optind;
if (filename)
{
fp = fopen (filename, "w");
if (fp == 0)
{
fprintf (
stderr
, "%s: %s: cannot open: %s\n", progname, filename, strerror(
(*__errno_location ())
));
exit (1);
}
}
else
{
filename = "stdout";
fp =
stdout
;
}
for (i = 0; i < 256; i++)
lsyntax[i] = 0x0000;
load_lsyntax ();
fprintf (fp, "%s\n", preamble);
fprintf (fp, "%s\n", includes);
dump_lsyntax (fp);
if (fp !=
stdout
)
fclose (fp);
exit (0);
}
| int main(int argc, const char **argv, const char **envp)
{
int *v3;
char *v4;
int i;
int v6;
const char *filename;
FILE *stream;
progname = (long)strrchr(*argv, 47);
if ( progname )
++progname;
else
progname = (long)*argv;
filename = 0LL;
debug = 0;
while ( 1 )
{
v6 = getopt(argc, (char *const *)argv, "do:");
if ( v6 == -1 )
break;
if ( v6 == 100 )
{
debug = 1;
}
else
{
if ( v6 != 111 )
usage();
filename = optarg;
}
}
if ( filename )
{
stream = fopen(filename, "w");
if ( !stream )
{
v3 = _errno_location();
v4 = strerror(*v3);
fprintf(stderr, "%s: %s: cannot open: %s\n", (const char *)progname, filename, v4);
exit(1);
}
}
else
{
stream = stdout;
}
for ( i = 0; i <= 255; ++i )
lsyntax[i] = 0;
load_lsyntax();
fprintf(stream, "%s\n", preamble);
fprintf(stream, "%s\n", includes);
dump_lsyntax(stream);
if ( stream != stdout )
fclose(stream);
exit(0);
}
|
const char *get_challenge_pass(void)
{
if (batch && !ask_pass)
return cfg.challenge_password;
else
return getpass("Enter a challenge password: ");
}
| long long get_challenge_pass() {
unsigned long long v1;
if (*(got.batch) && !*(got.ask_pass)) {
v1 = *((got.cfg + 88));
return v1;
}
v1 = getpass("Enter a challenge password: ");
return v1;
}
|
int
sshkey_cert_check_authority(const struct sshkey *k,
int want_host, int require_principal, int wildcard_pattern,
uint64_t verify_time, const char *name, const char **reason)
{
u_int i, principal_matches;
if (reason ==
((void *)0)
)
return -10;
if (!sshkey_is_cert(k)) {
*reason = "Key is not a certificate";
return -25;
}
if (want_host) {
if (k->cert->type != 2) {
*reason = "Certificate invalid: not a host certificate";
return -25;
}
} else {
if (k->cert->type != 1) {
*reason = "Certificate invalid: not a user certificate";
return -25;
}
}
if (verify_time < k->cert->valid_after) {
*reason = "Certificate invalid: not yet valid";
return -25;
}
if (verify_time >= k->cert->valid_before) {
*reason = "Certificate invalid: expired";
return -25;
}
if (k->cert->nprincipals == 0) {
if (require_principal) {
*reason = "Certificate lacks principal list";
return -25;
}
} else if (name !=
((void *)0)
) {
principal_matches = 0;
for (i = 0; i < k->cert->nprincipals; i++) {
if (wildcard_pattern) {
if (match_pattern(k->cert->principals[i],
name)) {
principal_matches = 1;
break;
}
} else if (strcmp(name, k->cert->principals[i]) == 0) {
principal_matches = 1;
break;
}
}
if (!principal_matches) {
*reason = "Certificate invalid: name is not a listed "
"principal";
return -25;
}
}
return 0;
}
| void sshkey_cert_check_authority(struct_0 *a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, char *a5, unsigned long long *v2) {
unsigned int v0;
unsigned int v1;
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;
void* v10;
unsigned long long v11;
if (!v2) {
v3 = 4294967286;
return;
} else if (sshkey_is_cert(a0)) {
if (a1) {
if (a0->field_80->field_8 != 2) {
*(v2) = "Certificate invalid: not a host certificate";
v6 = 4294967271;
return;
}
} else {
if (a0->field_80->field_8 != 1) {
*(v2) = "Certificate invalid: not a user certificate";
v5 = 4294967271;
return;
}
}
if (a4 < a0->field_80->field_30) {
*(v2) = "Certificate invalid: not yet valid";
v7 = 4294967271;
return;
} else if (a4 < a0->field_80->field_38) {
if (a0->field_80->field_20) {
if (a5) {
v1 = 0;
v0 = 0;
while (true) {
if (v0 >= a0->field_80->field_20)
break;
if (!a3) {
if (!strcmp(a5, *((a0->field_80->field_28 + (v0 << 3))))) {
v1 = 1;
break;
}
} else {
if (match_pattern(*((a0->field_80->field_28 + (v0 << 3))), a5, a5)) {
v1 = 1;
break;
}
}
v0 += 1;
}
if (!v1) {
*(v2) = "Certificate invalid: name is not a listed principal";
v11 = 4294967271;
return;
}
}
} else {
if (a2) {
*(v2) = "Certificate lacks principal list";
v9 = 4294967271;
return;
}
}
v10 = 0;
return;
} else {
*(v2) = "Certificate invalid: expired";
v8 = 4294967271;
return;
}
} else {
*(v2) = "Key is not a certificate";
v4 = 4294967271;
return;
}
}
|
char *
get_name_for_error ()
{
char *name;
SHELL_VAR *bash_source_v;
ARRAY *bash_source_a;
name = (char *)
((void *)0)
;
if (interactive_shell == 0)
{
bash_source_v = find_variable ("BASH_SOURCE");
if (bash_source_v && ((((bash_source_v)->attributes) & (0x0000004))) &&
(bash_source_a = (ARRAY *)((bash_source_v)->value)))
name = array_reference (bash_source_a, 0);
if (name == 0 || *name == '\0')
name = dollar_vars[0];
}
if (name == 0 && shell_name && *shell_name)
name = base_pathname (shell_name);
if (name == 0)
name = "bash";
return (name);
}
| int get_name_for_error() {
unsigned long long v0;
struct_0 *v1;
unsigned long long v2;
v0 = 0;
if (!interactive_shell) {
v1 = find_variable("BASH_SOURCE");
if (v1 && (v1->field_28 & 4)) {
v2 = v1->field_8;
if (v2)
v0 = array_reference(v2, 0x0);
}
if (v0 && !(!*(v0)))
goto LABEL_40012d;
v0 = dollar_vars;
}
LABEL_40012d:
if (!v0 && shell_name && *(shell_name))
v0 = base_pathname(shell_name);
if (!v0)
v0 = "bash";
return v0;
}
|
static void
update_current_files_info (void)
{
if (sort_type == sort_width
|| (line_length && (format == many_per_line || format == horizontal)))
{
size_t i;
for (i = 0; i < cwd_n_used; i++)
{
struct fileinfo *f = sorted_file[i];
f->width = fileinfo_name_width (f);
}
}
}
| void update_current_files_info() {
void* v0;
struct_0 *v1;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
if (sort_type == 2)
goto LABEL_406fb0;
v3 = line_length;
if (line_length) {
switch (format) {
case 2:
LABEL_406fb0:
v0 = 0;
while (true) {
v5 = cwd_n_used;
if (v0 >= cwd_n_used)
break;
v1 = *((sorted_file + v0 * 8));
v1->field_c8 = fileinfo_name_width(v1);
v0 += 1;
}
case 3:
v4 = format;
break;
default:
v4 = format;
goto LABEL_406fb0;
}
}
return;
}
|
static int
history_getunique(HistoryW *h, HistEventW *ev)
{
if (h->h_next != history_def_next) {
{ ev->num = 14; ev->str = he_errlist[14]; };
return -1;
}
ev->num = (((((history_t *)h->h_ref)->flags) & 1) != 0);
return 0;
}
| undefined8 history_getunique(long *param_1,uint *param_2)
{
undefined8 uVar1;
if ((code *)param_1[3] == history_def_next) {
*param_2 = (uint)((*(uint *)(*param_1 + 0x3c) & 1) != 0);
uVar1 = 0;
}
else {
*param_2 = 0xe;
*(wchar_t **)(param_2 + 2) =
L"function not allowed with other history-functions-set the default";
uVar1 = 0xffffffff;
}
return uVar1;
}
|
static int
mux_client_read(int fd, struct sshbuf *b, size_t need)
{
size_t have;
ssize_t len;
u_char *p;
struct pollfd pfd;
int r;
pfd.fd = fd;
pfd.events =
0x001
;
if ((r = sshbuf_reserve(b, need, &p)) != 0)
sshfatal("mux.c", __func__, 1459, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "reserve");
for (have = 0; have < need; ) {
if (muxclient_terminate) {
(*__errno_location ())
=
4
;
return -1;
}
len = read(fd, p + have, need - have);
if (len == -1) {
switch (
(*__errno_location ())
) {
case
11
:
(void)poll(&pfd, 1, -1);
case
4
:
continue;
default:
return -1;
}
}
if (len == 0) {
(*__errno_location ())
=
32
;
return -1;
}
have += (size_t)len;
}
return 0;
}
| long mux_client_read(int a1, long a2, unsigned long a3)
{
long v3;
int v5;
unsigned int v7;
long v8;
unsigned long v9;
ssize_t v10;
struct pollfd fds;
unsigned long v12;
v12 = __readfsqword(0x28u);
fds.fd = a1;
fds.events = 1;
v7 = sshbuf_reserve(a2, a3, &v8);
if ( v7 )
{
v3 = ssh_err(v7);
sshfatal("mux.c", "mux_client_read", 1459LL, 1LL, 1LL, v3, "reserve");
}
v9 = 0LL;
while ( v9 < a3 )
{
if ( muxclient_terminate )
{
*_errno_location() = 4;
return 0xFFFFFFFFLL;
}
v10 = read(a1, (void *)(v9 + v8), a3 - v9);
if ( v10 == -1 )
{
v5 = *_errno_location();
if ( v5 != 4 )
{
if ( v5 != 11 )
return 0xFFFFFFFFLL;
poll(&fds, 1uLL, -1);
}
}
else
{
if ( !v10 )
{
*_errno_location() = 32;
return 0xFFFFFFFFLL;
}
v9 += v10;
}
}
return 0LL;
}
|
static void print_secy_stats(const char *prefix, struct rtattr *attr)
{
struct rtattr *stats[MACSEC_SECY_STATS_ATTR_MAX + 1];
if (!attr || show_stats == 0)
return;
(parse_rtattr_flags((stats), (MACSEC_SECY_STATS_ATTR_MAX), ((void*)(((char*)(attr)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((attr)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)));
print_stats(prefix, secy_stats_names,
NUM_MACSEC_SECY_STATS_ATTR, stats);
}
| void print_secy_stats(unsigned int a0, unsigned short *a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long a5) {
char v0;
char v1;
unsigned long long *v3;
unsigned long long v4;
if (a1 && show_stats) {
parse_rtattr_flags(&v0, 0x9, a1 + 2, *(a1) - 4, 0x8000);
print_stats(a0, &secy_stats_names, 0xa, &v0, 0x8000, a5);
}
v4 = *(&v1) ^ v3[5];
return;
}
|
int load_database(cron_db * old_db) {
struct stat statbuf, syscron_stat, crond_stat;
cron_db new_db;
struct dirent *dp;
DIR *dir;
pid_t pid = getpid();
int is_local = 0;
time_t now;
if ((DebugFlags & (0x0010)) != 0) printf ("[%ld] load_database()\n", (long) pid);
now = time(
((void *)0)
);
if (stat("/usr/local/var/spool/cron", &statbuf) < 0) {
log_it("CRON", pid, "STAT FAILED", "/usr/local/var/spool/cron",
(*__errno_location ())
);
statbuf.
st_mtim.tv_sec
= 0;
}
else {
max_mtime("/usr/local/var/spool/cron", &statbuf);
}
if (stat("/usr/local/etc/cron.d", &crond_stat) < 0) {
log_it("CRON", pid, "STAT FAILED", "/usr/local/etc/cron.d",
(*__errno_location ())
);
crond_stat.
st_mtim.tv_sec
= 0;
}
else {
max_mtime("/usr/local/etc/cron.d", &crond_stat);
}
if (stat("/usr/local/etc/crontab", &syscron_stat) < 0)
syscron_stat.
st_mtim.tv_sec
= 0;
if (old_db->mtime != 0
&& old_db->mtime == ((now - 1)<(((crond_stat.
st_mtim.tv_sec
)>(((statbuf.
st_mtim.tv_sec
)>(syscron_stat.
st_mtim.tv_sec
)?(statbuf.
st_mtim.tv_sec
):(syscron_stat.
st_mtim.tv_sec
)))?(crond_stat.
st_mtim.tv_sec
):(((statbuf.
st_mtim.tv_sec
)>(syscron_stat.
st_mtim.tv_sec
)?(statbuf.
st_mtim.tv_sec
):(syscron_stat.
st_mtim.tv_sec
)))))?(now - 1):(((crond_stat.
st_mtim.tv_sec
)>(((statbuf.
st_mtim.tv_sec
)>(syscron_stat.
st_mtim.tv_sec
)?(statbuf.
st_mtim.tv_sec
):(syscron_stat.
st_mtim.tv_sec
)))?(crond_stat.
st_mtim.tv_sec
):(((statbuf.
st_mtim.tv_sec
)>(syscron_stat.
st_mtim.tv_sec
)?(statbuf.
st_mtim.tv_sec
):(syscron_stat.
st_mtim.tv_sec
))))))
) {
if ((DebugFlags & (0x0010)) != 0) printf ("[%ld] spool dir mtime unch, no load needed.\n", (long) pid)
;
return 0;
}
new_db.mtime = now - 1;
new_db.head = new_db.tail =
((void *)0)
;
if (syscron_stat.
st_mtim.tv_sec
)
process_crontab("root",
((void *)0)
, "/usr/local/etc/crontab", &new_db, old_db);
if (!(dir = opendir("/usr/local/etc/cron.d"))) {
log_it("CRON", pid, "OPENDIR FAILED", "/usr/local/etc/cron.d",
(*__errno_location ())
);
}
else {
while (
((void *)0)
!= (dp = readdir(dir))) {
char tabname[
255
+ 1];
if (not_a_crontab(dp))
continue;
if (!glue_strings(tabname, sizeof tabname, "/usr/local/etc/cron.d",
dp->d_name, '/'))
continue;
process_crontab("root",
((void *)0)
, tabname, &new_db, old_db);
}
closedir(dir);
}
if (!(dir = opendir("/usr/local/var/spool/cron"))) {
log_it("CRON", pid, "OPENDIR FAILED", "/usr/local/var/spool/cron",
(*__errno_location ())
);
}
else {
is_local = cluster_host_is_local();
while (is_local &&
((void *)0)
!= (dp = readdir(dir))) {
char fname[
255
+ 1], tabname[
255
+ 1];
if (not_a_crontab(dp))
continue;
strncpy(fname, dp->d_name,
255
);
fname[
255
] = '\0';
if (!glue_strings(tabname, sizeof tabname, "/usr/local/var/spool/cron", fname, '/'))
continue;
process_crontab(fname, fname, tabname, &new_db, old_db);
}
closedir(dir);
}
endpwent();
overwrite_database(old_db, &new_db);
if ((DebugFlags & (0x0010)) != 0) printf ("load_database is done\n");
return 1;
}
| long load_database(long a1)
{
int *v1;
int *v2;
__time_t tv_sec;
__time_t v4;
__time_t v5;
__time_t v6;
int *v8;
int *v9;
unsigned int v10;
int is_local;
time_t v12;
DIR *dirp;
DIR *dirpa;
struct dirent *v15;
struct dirent *v16;
long *v17[4];
struct stat v18;
struct stat v19;
struct stat v20;
char dest[256];
char v22[264];
unsigned long v23;
v23 = __readfsqword(0x28u);
v10 = getpid();
if ( (DebugFlags & 0x10) != 0 )
printf("[%ld] load_database()\n", (int)v10);
v12 = time(0LL);
if ( stat("/usr/local/var/spool/cron", &v18) >= 0 )
{
max_mtime("/usr/local/var/spool/cron", (long)&v18);
}
else
{
v1 = _errno_location();
log_it("CRON", v10, "STAT FAILED", "/usr/local/var/spool/cron", (unsigned int)*v1);
v18.st_mtim.tv_sec = 0LL;
}
if ( stat("/usr/local/etc/cron.d", &v20) >= 0 )
{
max_mtime("/usr/local/etc/cron.d", (long)&v20);
}
else
{
v2 = _errno_location();
log_it("CRON", v10, "STAT FAILED", "/usr/local/etc/cron.d", (unsigned int)*v2);
v20.st_mtim.tv_sec = 0LL;
}
if ( stat("/usr/local/etc/crontab", &v19) < 0 )
v19.st_mtim.tv_sec = 0LL;
if ( !*(_QWORD *)(a1 + 16) )
goto LABEL_26;
tv_sec = v19.st_mtim.tv_sec;
if ( v19.st_mtim.tv_sec < v18.st_mtim.tv_sec )
tv_sec = v18.st_mtim.tv_sec;
v4 = v20.st_mtim.tv_sec;
if ( tv_sec >= v20.st_mtim.tv_sec )
v4 = tv_sec;
if ( v12 > v4 )
{
v6 = v19.st_mtim.tv_sec;
if ( v19.st_mtim.tv_sec < v18.st_mtim.tv_sec )
v6 = v18.st_mtim.tv_sec;
v5 = v20.st_mtim.tv_sec;
if ( v6 >= v20.st_mtim.tv_sec )
v5 = v6;
}
else
{
v5 = v12 - 1;
}
if ( v5 == *(_QWORD *)(a1 + 16) )
{
if ( (DebugFlags & 0x10) != 0 )
printf("[%ld] spool dir mtime unch, no load needed.\n", (int)v10);
return 0LL;
}
else
{
LABEL_26:
v17[2] = (long *)(v12 - 1);
v17[1] = 0LL;
v17[0] = 0LL;
if ( v19.st_mtim.tv_sec )
process_crontab("root", 0LL, "/usr/local/etc/crontab", (long)v17, (long ***)a1);
dirp = opendir("/usr/local/etc/cron.d");
if ( dirp )
{
while ( 1 )
{
v15 = readdir(dirp);
if ( !v15 )
break;
if ( !not_a_crontab((long)v15)
&& (unsigned int)glue_strings(v22, 256LL, "/usr/local/etc/cron.d", v15->d_name, 47LL) )
{
process_crontab("root", 0LL, v22, (long)v17, (long ***)a1);
}
}
closedir(dirp);
}
else
{
v8 = _errno_location();
log_it("CRON", v10, "OPENDIR FAILED", "/usr/local/etc/cron.d", (unsigned int)*v8);
}
dirpa = opendir("/usr/local/var/spool/cron");
if ( dirpa )
{
is_local = cluster_host_is_local();
while ( is_local )
{
v16 = readdir(dirpa);
if ( !v16 )
break;
if ( !not_a_crontab((long)v16) )
{
strncpy(dest, v16->d_name, 0xFFuLL);
dest[255] = 0;
if ( (unsigned int)glue_strings(v22, 256LL, "/usr/local/var/spool/cron", dest, 47LL) )
process_crontab(dest, dest, v22, (long)v17, (long ***)a1);
}
}
closedir(dirpa);
}
else
{
v9 = _errno_location();
log_it("CRON", v10, "OPENDIR FAILED", "/usr/local/var/spool/cron", (unsigned int)*v9);
}
endpwent();
overwrite_database((long **)a1, v17);
if ( (DebugFlags & 0x10) != 0 )
printf("load_database is done\n");
return 1LL;
}
}
|
static int
process_input(struct ssh *ssh, int connection_in)
{
int r;
if ((r = ssh_packet_process_read(ssh, connection_in)) == 0)
return 0;
if (r == -24) {
if (
(*__errno_location ())
==
11
||
(*__errno_location ())
==
4
||
(*__errno_location ())
==
11
)
return 0;
if (
(*__errno_location ())
==
32
) {
sshlog("serverloop.c", __func__, 285, 0, SYSLOG_LEVEL_VERBOSE,
((void *)0)
, "Connection closed by %.100s port %d", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh))
;
return -1;
}
sshlog("serverloop.c", __func__, 289, 0, SYSLOG_LEVEL_VERBOSE,
((void *)0)
, "Read error from remote host %s port %d: %s", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), strerror(
(*__errno_location ())
))
;
cleanup_exit(255);
}
return -1;
}
| undefined8 process_input(undefined8 param_1,undefined4 param_2)
{
int iVar1;
undefined4 uVar2;
int *piVar3;
undefined8 uVar4;
char *pcVar5;
undefined8 uVar6;
iVar1 = ssh_packet_process_read(param_1,param_2);
if (iVar1 == 0) {
return 0;
}
if (iVar1 == -0x18) {
piVar3 = __errno_location();
if (((*piVar3 == 0xb) || (piVar3 = __errno_location(), *piVar3 == 4)) ||
(piVar3 = __errno_location(), *piVar3 == 0xb)) {
return 0;
}
piVar3 = __errno_location();
if (*piVar3 == 0x20) {
uVar2 = ssh_remote_port(param_1);
uVar6 = 0x1006f4;
uVar4 = ssh_remote_ipaddr(param_1);
sshlog("serverloop.c","process_input",0x11d,0,4,0,"Connection closed by %.100s port %d",uVar4,
uVar2,uVar6);
return 0xffffffff;
}
piVar3 = __errno_location();
pcVar5 = strerror(*piVar3);
uVar2 = ssh_remote_port(param_1);
uVar4 = ssh_remote_ipaddr(param_1);
sshlog("serverloop.c","process_input",0x121,0,4,0,"Read error from remote host %s port %d: %s",
uVar4,uVar2,pcVar5);
cleanup_exit(0xff);
}
return 0xffffffff;
}
|
static inline
_Bool
is_smack_enabled (void)
{
return
0
;
}
| int is_smack_enabled() {
return 0;
}
|
static void
fatal (char const *msgid)
{
error (0, 0, "%s", gettext (msgid));
exiterr ();
}
| void fatal(char *a0) {
gettext(a0);
error(0x0, 0x0, "%s");
exiterr();
}
|
static int
histfile_restore (const char *backup, const char *orig)
{
char linkbuf[
4096
+1];
ssize_t n;
if ((n = readlink (orig, linkbuf, sizeof (linkbuf) - 1)) > 0)
{
linkbuf[n] = '\0';
return (history_rename (backup, linkbuf));
}
return (history_rename (backup, orig));
}
| int histfile_restore(char *a0, char *a1) {
char *v0;
char v1;
unsigned long long v2;
unsigned long long v4;
v2 = *(&v2);
v0 = readlink(a1, &v1, 0x1000);
if (v0 <= 0) {
v4 = history_rename(a0, a1);
} else {
*((v0 + &v1)) = 0;
v4 = history_rename(a0, &v1);
}
return v4;
}
|
static void pdf_init(pdf_ctx *pc, aes_int_key prf_key)
{
UINT8 buf[16];
kdf(buf, prf_key, 0, 16);
AES_set_encrypt_key((const u_char *)(buf),16*8,pc->prf_key);
memset(pc->nonce, 0, sizeof(pc->nonce));
AES_encrypt((u_char *)(pc->nonce),(u_char *)(pc->cache),(AES_KEY *)pc->prf_key);
explicit_bzero(buf, sizeof(buf));
}
| unsigned long pdf_init(long a1, long a2)
{
char v3[24];
unsigned long v4;
v4 = __readfsqword(0x28u);
kdf(v3, a2, 0, 16);
AES_set_encrypt_key(v3, 128LL, a1 + 32);
memset((void *)(a1 + 16), 0, 0x10uLL);
AES_encrypt(a1 + 16, a1, a1 + 32);
explicit_bzero(v3, 16LL);
return __readfsqword(0x28u) ^ v4;
}
|
int
check_quietlogin(Session *s, const char *command)
{
char buf[256];
struct passwd *pw = s->pw;
struct stat st;
if (command !=
((void *)0)
)
return 1;
snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir);
if (stat(buf, &st) >= 0)
return 1;
return 0;
}
| int check_quietlogin(struct_0 *a0, unsigned long a1) {
struct_1 *v0;
char v1;
char v2;
unsigned int v4;
v0 = a0->field_10;
if (a1) {
v4 = 1;
return v4;
}
snprintf(&v2, 0x100, "%.200s/.hushlogin", v0->field_20);
v4 = (stat(&v2, &v1) < 0 ? 1 : 0);
return v4;
}
|
int
acl_get_entry(acl_t acl, int entry_id, acl_entry_t *entry_p)
{
acl_obj *acl_obj_p = ((acl_obj *)__ext2int_and_check(acl, (0x712C)));
if (!acl_obj_p) {
if (entry_p)
*entry_p =
((void *)0)
;
return -1;
}
if (!entry_p) {
(*__errno_location ())
=
22
;
return -1;
}
if (entry_id == 0) {
acl_obj_p->i.a_curr = acl_obj_p->i.a_next;
} else if (entry_id == 1) {
acl_obj_p->i.a_curr = acl_obj_p->i.a_curr->i.e_next;
}
if (acl_obj_p->i.a_curr == (acl_entry_obj *)acl_obj_p) {
*entry_p =
((void *)0)
;
return 0;
}
if (!((acl_entry_obj *)__check_obj_p((obj_prefix *)(acl_obj_p->i.a_curr), (0x9D6B)))) {
return -1;
}
*entry_p = ((acl_obj_p->i.a_curr) ? &(acl_obj_p->i.a_curr)->i :
((void *)0)
);
return 1;
}
| long long acl_get_entry(unsigned long long a0, unsigned long a1, unsigned long a2) {
unsigned long long *v0;
struct_0 *v1;
unsigned long long v3;
void* v4;
v0 = a2;
v1 = __ext2int_and_check(a0, 0x712c);
if (!v1) {
if (v0)
*(v0) = 0;
v3 = 4294967295;
} else if (!v0) {
*(__errno_location()) = 22;
v3 = 4294967295;
} else {
if (!a1) {
v1->field_18 = v1->field_10;
} else if (a1 == 1) {
v1->field_18 = v1->field_18->field_10;
}
if (v1 == v1->field_18) {
*(v0) = 0;
v3 = 0;
} else if (!__check_obj_p(v1->field_18, 0x9d6b)) {
v3 = 4294967295;
} else {
if (!v1->field_18)
v4 = 0;
else
v4 = &v1->field_18->padding_0[8];
*(v0) = v4;
v3 = 1;
}
}
return v3;
}
|
static int
waitfd(int fd, int *timeoutp, short events)
{
struct pollfd pfd;
struct timeval t_start;
int oerrno, r;
pfd.fd = fd;
pfd.events = events;
for (; *timeoutp >= 0;) {
monotime_tv(&t_start);
r = poll(&pfd, 1, *timeoutp);
oerrno =
(*__errno_location ())
;
ms_subtract_diff(&t_start, timeoutp);
(*__errno_location ())
= oerrno;
if (r > 0)
return 0;
else if (r == -1 &&
(*__errno_location ())
!=
11
&&
(*__errno_location ())
!=
4
)
return -1;
else if (r == 0)
break;
}
(*__errno_location ())
=
110
;
return -1;
}
| int waitfd(unsigned long a0, unsigned int *a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned short v3;
char v4;
unsigned int v8;
v2 = a0;
v3 = a2;
while (true) {
if (*(a1) < 0) {
LABEL_400adc:
*(__errno_location()) = 110;
v8 = -1;
break;
} else {
monotime_tv(&v4);
v0 = poll(&v2, 0x1, *(a1));
v1 = *(__errno_location());
ms_subtract_diff(&v4, a1);
*(__errno_location()) = v1;
if (v0 > 0) {
v8 = 0;
break;
}
if (v0 == -1 && *(__errno_location()) != 11 && *(__errno_location()) != 4) {
v8 = -1;
break;
}
if (!v0)
goto LABEL_400adc;
}
}
return v8;
}
|
static int netns_set(int argc, char **argv)
{
char netns_path[
4096
];
const char *name;
int netns, nsid;
if (argc < 1) {
fprintf(
stderr
, "No netns name specified\n");
return -1;
}
if (argc < 2) {
fprintf(
stderr
, "No nsid specified\n");
return -1;
}
name = argv[0];
if (strcmp(argv[1], "auto") == 0)
nsid = -1;
else if (get_integer(&nsid, argv[1], 0))
invarg("Invalid \"netnsid\" value", argv[1]);
else if (nsid < 0)
invarg("\"netnsid\" value should be >= 0", argv[1]);
snprintf(netns_path, sizeof(netns_path), "%s/%s", "/var/run/netns", name);
netns = open(netns_path,
00
|
02000000
);
if (netns < 0) {
fprintf(
stderr
, "Cannot open network namespace \"%s\": %s\n",
name, strerror(
(*__errno_location ())
));
return -1;
}
return set_netnsid_from_name(name, nsid);
}
| long netns_set(int a1, const char **a2)
{
int *v3;
char *v4;
signed int v5;
int v6;
const char *v7;
char s[16];
unsigned long v9;
v9 = __readfsqword(0x28u);
if ( a1 > 0 )
{
if ( a1 > 1 )
{
v7 = *a2;
if ( !strcmp(a2[1], "auto") )
{
v5 = -1;
}
else
{
if ( (unsigned int)get_integer(&v5, a2[1], 0LL) )
invarg("Invalid \"netnsid\" value", a2[1]);
if ( v5 < 0 )
invarg("\"netnsid\" value should be >= 0", a2[1]);
}
snprintf(s, 0x1000uLL, "%s/%s", "/var/run/netns", v7);
v6 = open64(s, 0x80000);
if ( v6 >= 0 )
{
return set_netnsid_from_name((long)v7, v5);
}
else
{
v3 = _errno_location();
v4 = strerror(*v3);
fprintf(stderr, "Cannot open network namespace \"%s\": %s\n", v7, v4);
return 0xFFFFFFFFLL;
}
}
else
{
fprintf(stderr, "No nsid specified\n");
return 0xFFFFFFFFLL;
}
}
else
{
fprintf(stderr, "No netns name specified\n");
return 0xFFFFFFFFLL;
}
}
|
void
gid_to_gname (gid_t gid, char **gname)
{
struct group *group;
if (gid != 0 && gid == cached_no_such_gid)
{
*gname = xstrdup ("");
return;
}
if (!cached_gname || gid != cached_gid)
{
group = getgrgid (gid);
if (group)
{
cached_gid = gid;
assign_string (&cached_gname, group->gr_name);
}
else
{
cached_no_such_gid = gid;
*gname = xstrdup ("");
return;
}
}
*gname = xstrdup (cached_gname);
}
| long * gid_to_gname(__gid_t a1, long *a2)
{
long v2;
long *result;
long v4;
long v5;
struct group *v6;
if ( a1 && a1 == cached_no_such_gid )
{
v2 = xstrdup(&unk_4344);
result = a2;
*a2 = v2;
return result;
}
if ( !cached_gname || a1 != cached_gid )
{
v6 = getgrgid(a1);
if ( !v6 )
{
cached_no_such_gid = a1;
v4 = xstrdup(&unk_4344);
result = a2;
*a2 = v4;
return result;
}
cached_gid = a1;
assign_string(&cached_gname, v6->gr_name);
}
v5 = xstrdup(cached_gname);
result = a2;
*a2 = v5;
return result;
}
|
static void
print_table (void)
{
size_t row;
for (row = 0; row < nrows; row++)
{
size_t col;
for (col = 0; col < ncolumns; col++)
{
char *cell = table[row][col];
if (col != 0)
putchar_unlocked (' ');
int flags = 0;
if (col == ncolumns - 1)
flags = MBA_NO_RIGHT_PAD;
size_t width = columns[col]->width;
cell = ambsalign (cell, &width, columns[col]->align, flags);
fputs_unlocked (cell ? cell : table[row][col],
stdout
);
free (cell);
}
putchar_unlocked ('\n');
}
}
| void print_table() {
unsigned int v0;
unsigned long v1;
void* v2;
void* v3;
void* v4;
char v5;
struct_0 *v7;
unsigned long long *v8;
unsigned long long v9;
for (v2 = 0; v2 < nrows; v2 += 1) {
for (v3 = 0; v3 < ncolumns; v3 += 1) {
v4 = *((*((table + v2 * 8)) + v3 * 8));
if (v3)
putchar_unlocked(0x20);
v0 = 0;
if (v3 == ncolumns - 1)
v0 = 8;
v1 = *((*((columns + v3 * 8)) + 32));
v4 = ambsalign(v4, &v1, *((*((columns + v3 * 8)) + 40)), v0);
if (!v4)
v7 = *((*((table + v2 * 8)) + v3 * 8));
else
v7 = v4;
fputs_unlocked(v7, stdout);
free(v4);
}
putchar_unlocked(0xa);
}
v9 = *(&v5) ^ v8[5];
return;
}
|
static struct nodelist *
copynodelist(lp)
struct nodelist *lp;
{
struct nodelist *start;
struct nodelist **lpp;
lpp = &start;
while (lp) {
*lpp = funcblock;
funcblock = (char *) funcblock +
(((sizeof(struct nodelist)) + (sizeof(union {int i; char *cp; double d; }) - 1)) & ~(sizeof(union {int i; char *cp; double d; }) - 1));
(*lpp)->n = copynode(lp->n);
lp = lp->next;
lpp = &(*lpp)->next;
}
*lpp =
((void *)0)
;
return start;
}
| long * copynodelist(undefined8 *param_1)
{
long *plVar1;
long lVar2;
long in_FS_OFFSET;
undefined8 *local_40;
long *local_30;
long **local_28;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
local_28 = &local_30;
for (local_40 = param_1; local_40 != (undefined8 *)0x0; local_40 = (undefined8 *)*local_40) {
*local_28 = funcblock;
funcblock = funcblock + 2;
plVar1 = *local_28;
lVar2 = copynode(local_40[1]);
plVar1[1] = lVar2;
local_28 = (long **)*local_28;
}
*local_28 = (long *)0x0;
if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return local_30;
}
|
static int check_if_fs_cluster(e2fsck_t ctx, blk64_t cluster)
{
ext2_filsys fs = ctx->fs;
blk64_t first_block;
dgrp_t i;
first_block = fs->super->s_first_data_block;
for (i = 0; i < fs->group_desc_count; i++) {
if (ext2fs_bg_has_super(fs, i)) {
if (cluster >= ((first_block) >> (fs)->cluster_ratio_bits) &&
(cluster <= ((first_block + fs->desc_blocks) >> (fs)->cluster_ratio_bits)
))
return 1;
}
if ((ext2fs_inode_table_loc(fs, i)) &&
(cluster >= ((ext2fs_inode_table_loc(fs, i)) >> (fs)->cluster_ratio_bits)
) &&
(cluster <= ((ext2fs_inode_table_loc(fs, i) + fs->inode_blocks_per_group - 1) >> (fs)->cluster_ratio_bits)
))
return 1;
if ((cluster == ((ext2fs_block_bitmap_loc(fs, i)) >> (fs)->cluster_ratio_bits)
) ||
(cluster == ((ext2fs_inode_bitmap_loc(fs, i)) >> (fs)->cluster_ratio_bits)
))
return 1;
first_block += fs->super->s_blocks_per_group;
}
return 0;
}
| long check_if_fs_cluster(long *a1, unsigned long a2)
{
unsigned int i;
unsigned long v4;
long v5;
v5 = *a1;
v4 = *(unsigned int *)(*(_QWORD *)(*a1 + 32) + 20LL);
for ( i = 0; i < *(_DWORD *)(v5 + 48); ++i )
{
if ( (unsigned int)ext2fs_bg_has_super(v5, i)
&& a2 >= v4 >> *(_DWORD *)(v5 + 192)
&& a2 <= (v4 + *(_QWORD *)(v5 + 56)) >> *(_DWORD *)(v5 + 192) )
{
return 1LL;
}
if ( ext2fs_inode_table_loc(v5, i)
&& a2 >= (unsigned long)ext2fs_inode_table_loc(v5, i) >> *(_DWORD *)(v5 + 192)
&& a2 <= ((unsigned long)*(unsigned int *)(v5 + 72) + ext2fs_inode_table_loc(v5, i) - 1) >> *(_DWORD *)(v5 + 192) )
{
return 1LL;
}
if ( a2 == (unsigned long)ext2fs_block_bitmap_loc(v5, i) >> *(_DWORD *)(v5 + 192)
|| a2 == (unsigned long)ext2fs_inode_bitmap_loc(v5, i) >> *(_DWORD *)(v5 + 192) )
{
return 1LL;
}
v4 += *(unsigned int *)(*(_QWORD *)(v5 + 32) + 32LL);
}
return 0LL;
}
|
static void
lookup_and_record(struct sftp_conn *conn,
u_int *uids, u_int nuids, u_int *gids, u_int ngids)
{
int r;
u_int i;
char **usernames =
((void *)0)
, **groupnames =
((void *)0)
;
if ((r = do_get_users_groups_by_id(conn, uids, nuids, gids, ngids,
&usernames, &groupnames)) != 0) {
sshlog("sftp-usergroup.c", __func__, 111, 1, SYSLOG_LEVEL_DEBUG1, ssh_err(r), "do_get_users_groups_by_id");
return;
}
for (i = 0; i < nuids; i++) {
if (usernames[i] ==
((void *)0)
) {
sshlog("sftp-usergroup.c", __func__, 116, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "uid %u not resolved", uids[i]);
continue;
}
sshlog("sftp-usergroup.c", __func__, 119, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "record uid %u => \"%s\"", uids[i], usernames[i]);
idname_enter(&user_idname, uids[i], usernames[i]);
}
for (i = 0; i < ngids; i++) {
if (groupnames[i] ==
((void *)0)
) {
sshlog("sftp-usergroup.c", __func__, 124, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "gid %u not resolved", gids[i]);
continue;
}
sshlog("sftp-usergroup.c", __func__, 127, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "record gid %u => \"%s\"", gids[i], groupnames[i]);
idname_enter(&group_idname, gids[i], groupnames[i]);
}
freenames(usernames, nuids);
freenames(groupnames, ngids);
}
| void lookup_and_record(undefined8 param_1,long param_2,uint param_3,long param_4,uint param_5)
{
int iVar1;
undefined8 uVar2;
long in_FS_OFFSET;
undefined8 uVar3;
uint local_28;
long local_20;
long local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_20 = 0;
local_18 = 0;
iVar1 = do_get_users_groups_by_id(param_1,param_2,param_3,param_4,param_5,&local_20,&local_18);
if (iVar1 == 0) {
for (local_28 = 0; local_28 < param_3; local_28 = local_28 + 1) {
if (*(long *)(local_20 + (ulong)local_28 * 8) == 0) {
sshlog("sftp-usergroup.c","lookup_and_record",0x74,1,7,0,"uid %u not resolved",
*(undefined4 *)(param_2 + (ulong)local_28 * 4));
}
else {
sshlog("sftp-usergroup.c","lookup_and_record",0x77,1,7,0,"record uid %u => \"%s\"",
*(undefined4 *)(param_2 + (ulong)local_28 * 4),
*(undefined8 *)(local_20 + (ulong)local_28 * 8));
idname_enter(&user_idname,*(undefined4 *)(param_2 + (ulong)local_28 * 4),
*(undefined8 *)(local_20 + (ulong)local_28 * 8));
}
}
for (local_28 = 0; local_28 < param_5; local_28 = local_28 + 1) {
if (*(long *)(local_18 + (ulong)local_28 * 8) == 0) {
sshlog("sftp-usergroup.c","lookup_and_record",0x7c,1,7,0,"gid %u not resolved",
*(undefined4 *)(param_4 + (ulong)local_28 * 4));
}
else {
sshlog("sftp-usergroup.c","lookup_and_record",0x7f,1,7,0,"record gid %u => \"%s\"",
*(undefined4 *)(param_4 + (ulong)local_28 * 4),
*(undefined8 *)(local_18 + (ulong)local_28 * 8));
idname_enter(&group_idname,*(undefined4 *)(param_4 + (ulong)local_28 * 4),
*(undefined8 *)(local_18 + (ulong)local_28 * 8));
}
}
freenames(local_20,param_3);
freenames(local_18,param_5);
}
else {
uVar3 = 0x1013b6;
uVar2 = ssh_err(iVar1);
sshlog("sftp-usergroup.c","lookup_and_record",0x6f,1,5,uVar2,"do_get_users_groups_by_id",uVar3);
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static char *
xattr_encode_keyword(const char *keyword)
{
static char *encode_buffer =
((void *)0)
;
static size_t encode_buffer_size = 0;
size_t bp;
if (!encode_buffer)
{
encode_buffer_size = 256;
encode_buffer = xmalloc (encode_buffer_size);
}
else
*encode_buffer = 0;
for (bp = 0; *keyword != 0; ++bp, ++keyword)
{
char c = *keyword;
if (bp + 2 >= encode_buffer_size)
{
encode_buffer = x2realloc (encode_buffer, &encode_buffer_size);
}
if (c == '%')
{
strcpy (encode_buffer + bp, "%25");
bp += 2;
}
else if (c == '=')
{
strcpy (encode_buffer + bp, "%3D");
bp += 2;
}
else
encode_buffer[bp] = c;
}
encode_buffer[bp] = 0;
return encode_buffer;
}
| long xattr_encode_keyword(char *a1)
{
char v3;
long v4;
if ( encode_buffer_7355 )
{
*(_BYTE *)encode_buffer_7355 = 0;
}
else
{
encode_buffer_size_7356 = 256LL;
encode_buffer_7355 = (long)xmalloc(256LL);
}
v4 = 0LL;
while ( *a1 )
{
v3 = *a1;
if ( v4 + 2 >= (unsigned long)encode_buffer_size_7356 )
encode_buffer_7355 = x2realloc(encode_buffer_7355, &encode_buffer_size_7356);
if ( v3 == 37 )
{
strcpy((char *)(encode_buffer_7355 + v4), "%25");
v4 += 2LL;
}
else if ( v3 == 61 )
{
strcpy((char *)(encode_buffer_7355 + v4), "%3D");
v4 += 2LL;
}
else
{
*(_BYTE *)(v4 + encode_buffer_7355) = v3;
}
++v4;
++a1;
}
*(_BYTE *)(encode_buffer_7355 + v4) = 0;
return encode_buffer_7355;
}
|
COMMAND *
make_until_command (test, action)
COMMAND *test, *action;
{
return (make_until_or_while (cm_until, test, action));
}
| long make_until_command(long a1, long a2)
{
return make_until_or_while(8, a1, a2);
}
|
inline int ext2fs_test_changed(ext2_filsys fs)
{
return (fs->flags & 0x02);
}
| void ext2fs_test_changed(void)
{
halt_baddata();
}
|
static wchar_t *
do_svis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra)
{
int iswextra, i, shft;
uint64_t bmsk, wmsk;
iswextra = wcschr(extra, c) !=
((void *)0)
;
if (!iswextra && ((((flags) & 0x4000) ?
((*__ctype_b_loc ())[(int) ((
c
))] & (unsigned short int) _ISgraph)
: iswgraph(c)) || (c == L' ' || c == L'\t' || c == L'\n') ||
((flags & 0x0020) && (c == L'\b' || c == L'\a' || c == L'\r')))) {
*dst++ = c;
return dst;
}
wmsk = 0;
for (i = sizeof(wmsk) - 1; i >= 0; i--) {
shft = i * 8;
bmsk = (uint64_t)0xffLL << shft;
wmsk |= bmsk;
if ((c & wmsk) || i == 0)
dst = do_mbyte(dst, (wint_t)(
(uint64_t)(c & bmsk) >> shft),
flags, nextc, iswextra);
}
return dst;
}
| int do_svis(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned short *a4) {
unsigned int v0;
int tmp_8;
unsigned long v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
void* v5;
unsigned long long v6;
unsigned int v8;
unsigned long long v10;
unsigned int v11;
v1 = a0;
v0 = a2;
v8 = wcschr(a4, a1);
v3 = v8;
if (!v3) {
if ((v0 & 0x4000)) {
*(&v8) = *((*(__ctype_b_loc()) + a1 * 2));
if (v8 < 0)
goto LABEL_40068a;
} else if (!(!iswgraph(a1))) {
goto LABEL_40068a;
}
if (a1 == 32) {
LABEL_40068a:
tmp_8 = v1;
v1 += 1;
*(tmp_8) = a1;
v11 = v1;
goto LABEL_40072f;
} else {
if (a1 == 9)
goto LABEL_40068a;
if (a1 == 10)
goto LABEL_40068a;
if ((v0 & 32) && a1 != 8 && a1 != 7) {
if (!(a1 == 13))
goto LABEL_4006a4;
goto LABEL_40068a;
}
}
}
LABEL_4006a4:
v5 = 0;
v2 = 7;
while (true) {
if (v2 < 0)
break;
v4 = v2 * 8;
v6 = 255 << (v4 & 63);
v5 |= v6;
if (!(a1 & v5) && !(!v2))
goto LABEL_400721;
if (((a1 & v6) & 63))
v10 = (a1 & v6) >> ((a1 & v6) & 63);
else
v10 = (a1 & v6) >> ((a1 & v6) & 63);
v1 = do_mbyte(v1, v10, v0, a3, v3);
LABEL_400721:
v2 -= 1;
}
v11 = v1;
LABEL_40072f:
return v11;
}
|
srclimit_check_allow(sock, notify_pipe) == 1) {
if (last_drop != 0 &&
startups < options.max_startups_begin - 1) {
sshlog("sshd.c", __func__, 863, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "exited MaxStartups throttling after %s, " "%u connections dropped", fmt_timeframe(now - first_drop), ndropped)
;
last_drop = 0;
}
return 0;
}
| void srclimit_check_allow(void)
{
halt_baddata();
}
|
void lwt_print_encap(FILE *fp, struct rtattr *encap_type,
struct rtattr *encap)
{
int et;
if (!encap_type)
return;
et = rta_getattr_u16(encap_type);
print_string(PRINT_ANY, "encap", " encap %s ", format_encap_type(et));
switch (et) {
case LWTUNNEL_ENCAP_MPLS:
print_encap_mpls(fp, encap);
break;
case LWTUNNEL_ENCAP_IP:
print_encap_ip(fp, encap);
break;
case LWTUNNEL_ENCAP_ILA:
print_encap_ila(fp, encap);
break;
case LWTUNNEL_ENCAP_IP6:
print_encap_ip6(fp, encap);
break;
case LWTUNNEL_ENCAP_BPF:
print_encap_bpf(fp, encap);
break;
case LWTUNNEL_ENCAP_SEG6:
print_encap_seg6(fp, encap);
break;
case LWTUNNEL_ENCAP_SEG6_LOCAL:
print_encap_seg6local(fp, encap);
break;
case LWTUNNEL_ENCAP_RPL:
print_encap_rpl(fp, encap);
break;
case LWTUNNEL_ENCAP_IOAM6:
print_encap_ioam6(fp, encap);
break;
}
}
| long long lwt_print_encap(unsigned int a0, void* a1, unsigned short *a2, unsigned long long a3, unsigned int a4, unsigned long long a5) {
unsigned int v0;
unsigned long long v2;
if (a1) {
v0 = rta_getattr_u16(a1);
v2 = print_string(0x4, "encap", " encap %s ", format_encap_type(v0));
switch (v0) {
case 1:
v2 = print_encap_mpls(a0, a2);
break;
case 2:
v2 = print_encap_ip(a0, a2, a2, a3, a4, a5);
break;
case 3:
v2 = print_encap_ila(a0, a2);
break;
case 4:
v2 = print_encap_ip6(a0, a2, a2, a3, a4, a5);
break;
case 5:
v2 = print_encap_seg6(a0, a2);
break;
case 6:
v2 = print_encap_bpf(a0, a2);
break;
case 7:
v2 = print_encap_seg6local(a0, a2, a2, a3, a4, a5);
break;
case 8:
v2 = print_encap_rpl(a0, a2);
break;
case 9:
v2 = print_encap_ioam6(a0, a2);
break;
}
}
return v2;
}
|
static int parse_address(const char *dev, int hatype, int halen,
char *lla, struct ifreq *ifr)
{
int alen;
memset(ifr, 0, sizeof(*ifr));
strlcpy(ifr->ifr_ifrn.ifrn_name, dev, 16);
ifr->ifr_ifru.ifru_hwaddr.sa_family = hatype;
alen = ll_addr_a2n(ifr->ifr_ifru.ifru_hwaddr.sa_data, 14, lla);
if (alen < 0)
return -1;
if (alen != halen) {
fprintf(
stderr
,
"Wrong address (%s) length: expected %d bytes\n",
lla, halen);
return -1;
}
return 0;
}
| int parse_address(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long long a3, struct_0 *a4) {
unsigned int v0;
unsigned int v2;
memset(a4, 0x0, 0x28);
strlcpy(a4, a0, 0x10, a0);
a4->field_10 = a1;
v0 = ll_addr_a2n(a4 + 1, 0xe, a3, a4 + 1);
if (v0 < 0) {
v2 = -1;
return v2;
} else if (v0 != a2) {
fprintf(stderr, "Wrong address (%s) length: expected %d bytes\n", a3, a2);
v2 = -1;
return v2;
} else {
v2 = 0;
return v2;
}
}
|
static int depmod_modules_search(struct depmod *depmod)
{
int err;
struct cfg_external *ext;
err = depmod_modules_search_path(depmod, depmod->cfg->dirname);
if (err < 0)
return err;
for (ext = depmod->cfg->externals; ext !=
((void *)0)
; ext = ext->next) {
err = depmod_modules_search_path(depmod, ext->path);
if (err < 0 && err == -
2
)
continue;
}
return 0;
}
| int depmod_modules_search(long *param_1)
{
int iVar1;
undefined8 *local_10;
iVar1 = depmod_modules_search_path(param_1,*param_1 + 8);
if (-1 < iVar1) {
for (local_10 = *(undefined8 **)(*param_1 + 0x1028); local_10 != (undefined8 *)0x0;
local_10 = (undefined8 *)*local_10) {
depmod_modules_search_path(param_1,local_10 + 2);
}
iVar1 = 0;
}
return iVar1;
}
|
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 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 *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;
for (v1[0] = &v4; v1[0] && strcmp(a0, v1[0]); 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:
*(&v3) = (!strcmp(a0, "[") ? a0 : "test");
printf(gettext("Full documentation <%s%s>\n"));
printf(gettext("or available locally via: info '(coreutils) %s%s'\n"));
v22 = *(&v18) ^ v21[5];
return;
}
|
< 0)
{
int recover = maybe_recoverable (file_name,
1
, &interdir_made);
if (recover != 1)
{
skip_member ();
if (recover == 2)
return 0;
open_error (file_name);
return 1;
}
}
| long maybe_recoverable(char *a1, char a2, _BYTE *a3)
{
long result;
char *v4;
int v6;
char *v7;
char v8[152];
unsigned long v9;
v9 = __readfsqword(0x28u);
v6 = *_errno_location();
v7 = 0LL;
if ( *a3 )
return 0LL;
if ( v6 == 95 )
goto LABEL_14;
if ( v6 > 95 )
goto LABEL_31;
if ( v6 == 40 )
goto LABEL_14;
if ( v6 > 40 )
goto LABEL_31;
if ( v6 == 31 )
{
LABEL_14:
if ( a2 != 1 || old_files_option != 2 || dereference_option )
goto LABEL_31;
if ( strchr(a1, 47) )
{
if ( (unsigned int)deref_stat(a1, v8) )
goto LABEL_31;
v7 = v8;
}
}
else
{
if ( v6 > 31 )
goto LABEL_31;
if ( v6 == 2 )
{
LABEL_28:
if ( !(unsigned int)make_directories(a1, a3) && *a3 )
return 1LL;
goto LABEL_31;
}
if ( v6 != 17 )
{
LABEL_31:
*_errno_location() = v6;
return 0LL;
}
}
switch ( old_files_option )
{
case 0:
case 1:
case 2:
goto LABEL_26;
case 4:
return 0LL;
case 5:
if ( (warning_option & 0x100000) != 0 )
{
if ( error_hook )
error_hook();
v4 = gettext("%s: skipping existing file");
error(0, 0, v4, a1);
}
return 2LL;
case 6:
if ( file_newer_p((long)a1, v7, (long)current_stat_info) )
goto LABEL_28;
LABEL_26:
if ( (int)remove_any_file(a1, 0LL) <= 0 )
goto LABEL_28;
result = 1LL;
break;
default:
goto LABEL_28;
}
return result;
}
|
int
rl_set_prompt(const char *prompt)
{
char *p;
if (!prompt)
prompt = "";
if (rl_prompt !=
((void *)0)
&& strcmp(rl_prompt, prompt) == 0)
return 0;
if (rl_prompt)
free(rl_prompt);
rl_prompt = strdup(prompt);
if (rl_prompt ==
((void *)0)
)
return -1;
while ((p = strchr(rl_prompt, '\2')) !=
((void *)0)
) {
if (p[1] == '\1') {
memmove(p, p + 2, 1 + strlen(p + 2));
} else {
*p = '\1';
}
}
return 0;
}
| int rl_set_prompt(char *a0) {
unsigned long long v0;
char v1[2];
unsigned int v3;
v0 = a0;
if (!v0)
v0 = &g_406500;
if (*(got.rl_prompt)) {
v3 = strcmp(*(got.rl_prompt));
if (!v3)
v3 = 0;
}
if (!*(got.rl_prompt) || v3) {
if (*(got.rl_prompt))
free(*(got.rl_prompt));
*(got.rl_prompt) = strdup(v0);
if (!*(got.rl_prompt)) {
v3 = -1;
} else {
while (true) {
*(&v1) = strchr(*(got.rl_prompt), 0x2);
if (!v1)
break;
if (v1[1] == 1)
memmove(v1, v1 + 1, strlen(v1 + 1) + 1);
else
v1[0] = 1;
}
v3 = 0;
}
}
return v3;
}
|
int
dup_cloexec (int fd)
{
return
rpl_fcntl
(fd,
1030
, 0);
}
| long long dup_cloexec(unsigned long a0) {
return rpl_fcntl(a0, 0x406, 0x0);
}
|
char *
namebuf_name (namebuf_t buf, const char *name)
{
size_t len = strlen (name);
while (buf->dir_length + len + 1 >= buf->buffer_size)
buf->buffer = x2realloc (buf->buffer, &buf->buffer_size);
strcpy (buf->buffer + buf->dir_length, name);
return buf->buffer;
}
| void namebuf_name(unsigned long long a0[3], char *a1) {
unsigned long v0;
unsigned long long v2;
for (v0 = strlen(a1); v0 + a0[2] + 1 >= a0[1]; a0[0] = x2realloc(a0[0], &a0[1], &a0[1]));
strcpy(a0[0] + a0[2], a1);
v2 = a0[0];
return;
}
|
static OpCodes
parse_token(const char *cp, const char *filename, int linenum,
const char *ignored_unknown)
{
int i;
for (i = 0; keywords[i].name; i++)
if (strcmp(cp, keywords[i].name) == 0)
return keywords[i].opcode;
if (ignored_unknown !=
((void *)0)
&&
match_pattern_list(cp, ignored_unknown, 1) == 1)
return oIgnoredUnknownOption;
sshlog("readconf.c", __func__, 798, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s: line %d: Bad configuration option: %s", filename, linenum, cp)
;
return oBadOption;
}
| undefined4 parse_token(char *param_1,undefined8 param_2,undefined4 param_3,long param_4)
{
int iVar1;
int local_c;
local_c = 0;
while (*(long *)(keywords + (long)local_c * 0x10) != 0) {
iVar1 = strcmp(param_1,*(char **)(keywords + (long)local_c * 0x10));
if (iVar1 == 0) {
return *(undefined4 *)(keywords + (long)local_c * 0x10 + 8);
}
local_c = __addvsi3(local_c,1);
}
if ((param_4 != 0) && (iVar1 = match_pattern_list(param_1,param_4,1), iVar1 == 1)) {
return 99;
}
sshlog("readconf.c","parse_token",0x31e,0,2,0,"%s: line %d: Bad configuration option: %s",param_2,
param_3,param_1);
return 0;
}
|
char *
itos (i)
intmax_t i;
{
char *p, lbuf[(((sizeof (intmax_t) * 8) - (! ((intmax_t) 0 < (intmax_t) -1))) * 302 / 1000 + 1 + (! ((intmax_t) 0 < (intmax_t) -1))) + 1];
p = fmtumax (i, 10, lbuf, sizeof(lbuf), 0);
return ((char *)strcpy (sh_xmalloc((1 + strlen (p)), "itos.c", 50), (p)));
}
| long long itos(unsigned long long a0) {
char *v0;
char v1;
v0 = fmtumax(a0, 0xa, &v1, 0x16, 0x0);
return strcpy(sh_xmalloc(strlen(v0) + 1, "itos.c", 0x32), v0);
}
|
static errcode_t get_next_block(ext2_filsys fs, struct out_dir *outdir,
char ** ret)
{
errcode_t retval;
if (outdir->num >= outdir->max) {
int increment = outdir->max / 10;
if (increment < 50)
increment = 50;
retval = alloc_size_dir(fs, outdir, outdir->max + increment);
if (retval)
return retval;
}
*ret = outdir->buf + (size_t)outdir->num++ * fs->blocksize;
memset(*ret, 0, fs->blocksize);
return 0;
}
| int get_next_block(struct_1 *a0, struct_0 *a1, unsigned long long *a2) {
struct_0 *v0;
int tmp_26;
int tmp_30;
unsigned int v1;
unsigned long v2;
unsigned int v4;
v0 = a1;
if (a1->field_0 >= a1->field_4) {
v1 = a1->field_4 * 3435973837 >> 35;
if (v1 <= 49)
v1 = 50;
v2 = alloc_size_dir(a0, a1, a1->field_4 + v1);
if (v2) {
v4 = v2;
goto LABEL_40125a;
}
}
tmp_26 = a1->field_8;
tmp_30 = a1->field_0;
a1->field_0 = a1->field_0 + 1;
*(a2) = tmp_26 + tmp_30 * a0->field_28;
memset(*(a2), 0x0, a0->field_28);
v4 = 0;
LABEL_40125a:
return v4;
}
|
void
sigwinch_sighandler (sig)
int sig;
{
sigwinch_received = 1;
return;
}
| void sigwinch_sighandler()
{
sigwinch_received = 1;
}
|
HANDLER_ENTRY *
find_directive (directive)
char *directive;
{
register int i;
for (i = 0; handlers[i].directive; i++)
if (strcmp (handlers[i].directive, directive) == 0)
return (&handlers[i]);
return ((HANDLER_ENTRY *)
((void *)0)
);
}
| int find_directive(char *a0) {
void* v1;
unsigned int v2;
v1 = 0;
while (true) {
if (*((0x10 * v1 + &handlers[0]))) {
v2 = strcmp(*((0x10 * v1 + &handlers[0])), a0);
if (!v2) {
v2 = (&handlers[0] + 0x10 * v1);
break;
} else {
v1 = v1 + 1;
}
} else {
v2 = 0;
break;
}
}
return v2;
}
|
off_t gzoffset(file)
gzFile file;
{
off64_t ret;
ret = gzoffset64(file);
return ret == (off_t)ret ? (off_t)ret : -1;
}
| long long gzoffset(void* a0) {
unsigned long v0;
v0 = gzoffset64(a0);
return v0;
}
|
static void
print_size (const struct duinfo *pdui, char const *string)
{
print_only_size (opt_inodes
? pdui->inodes
: pdui->size);
if (opt_time)
{
putchar_unlocked ('\t');
show_date (time_format, pdui->tmax, localtz);
}
printf ("\t%s%c", string, opt_nul_terminate_output ? '\0' : '\n');
fflush_unlocked (
stdout
);
}
| int print_size(long *a1, const char *a2)
{
long v2;
long v3;
if ( opt_inodes )
v2 = a1[1];
else
v2 = *a1;
print_only_size(v2);
if ( opt_time )
{
putchar_unlocked(9);
show_date(time_format, a1[2], a1[3], localtz);
}
if ( opt_nul_terminate_output )
v3 = 0LL;
else
v3 = 10LL;
printf("\t%s%c", a2, v3);
return fflush_unlocked(stdout);
}
|
static int
peek_type_nid(const char *s, size_t l, int *nid)
{
const struct keytype *kt;
for (kt = keytypes; kt->type != -1; kt++) {
if (kt->name ==
((void *)0)
|| strlen(kt->name) != l)
continue;
if (memcmp(s, kt->name, l) == 0) {
*nid = -1;
if (key_type_is_ecdsa_variant(kt->type))
*nid = kt->nid;
return kt->type;
}
}
return KEY_UNSPEC;
}
| int peek_type_nid(void* a0, unsigned int a1, unsigned int *a2) {
unsigned long long v0;
unsigned int v2;
v0 = &keytypes;
while (true) {
if (*((v0 + 24)) == -1) {
v2 = 14;
return v2;
}
if (!(!*(v0) || a1 != strlen(*(v0))) && !memcmp(a0, *(v0), a1)) {
*(a2) = -1;
break;
}
v0 += 40;
}
if (key_type_is_ecdsa_variant(*((v0 + 24))))
*(a2) = *((v0 + 28));
v2 = *((v0 + 24));
return v2;
}
|
static void
channel_before_prepare_io(struct ssh *ssh)
{
struct ssh_channels *sc = ssh->chanctxt;
Channel *c;
u_int i, oalloc;
for (i = 0, oalloc = sc->channels_alloc; i < oalloc; i++) {
c = sc->channels[i];
if (c ==
((void *)0)
)
continue;
if (c->type == 21)
channel_before_prepare_io_rdynamic(ssh, c);
}
}
| void channel_before_prepare_io(struct_0 *a0) {
unsigned int v0;
unsigned int v1;
struct_1 *v2;
unsigned int *v3;
unsigned long long v5;
v2 = a0->field_868;
v0 = 0;
v1 = v2->field_8;
while (true) {
v5 = v0;
if (v0 >= v1)
break;
v3 = *((v2->field_0 + v0 * 8));
if (v3 && *(v3) == 21)
channel_before_prepare_io_rdynamic(a0, v3);
v0 += 1;
}
return;
}
|
char *
mac_alg_list(char sep)
{
char *ret =
((void *)0)
, *tmp;
size_t nlen, rlen = 0;
const struct macalg *m;
for (m = macs; m->name !=
((void *)0)
; m++) {
if (ret !=
((void *)0)
)
ret[rlen++] = sep;
nlen = strlen(m->name);
if ((tmp = realloc(ret, rlen + nlen + 2)) ==
((void *)0)
) {
free(ret);
return
((void *)0)
;
}
ret = tmp;
memcpy(ret + rlen, m->name, nlen + 1);
rlen += nlen;
}
return ret;
}
| long long mac_alg_list(unsigned long a0) {
void* v0;
int tmp_11;
void* v1;
unsigned long long v2;
unsigned long v3;
void* v4;
void* v6;
v0 = 0;
v1 = 0;
v2 = &macs;
while (true) {
if (*(v2)) {
if (v0) {
tmp_11 = v1;
v1 += 1;
*(v0 + tmp_11) = a0;
}
v3 = strlen(*(v2));
v4 = realloc(v0, v3 + v1 + 2);
if (!v4) {
free(v0);
v6 = 0;
break;
} else {
v0 = v4;
memcpy(v1 + v0, *(v2), v3 + 1);
v1 += v3;
v2 += 32;
}
} else {
v6 = v0;
break;
}
}
return v6;
}
|
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;
}
|
int
sshpkt_get_cstring(struct ssh *ssh, char **valp, size_t *lenp)
{
return sshbuf_get_cstring(ssh->state->incoming_packet, valp, lenp);
}
| long long sshpkt_get_cstring(struct struct_0 **a0, unsigned long long a1, unsigned long long a2) {
return sshbuf_get_cstring(*(a0)->field_38, a1, a2, a1);
}
|
static int
sockaddr_is_local(struct sockaddr *hostaddr)
{
switch (hostaddr->sa_family) {
case
2
:
return (ntohl(((struct sockaddr_in *)hostaddr)->
sin_addr.s_addr) >> 24) ==
127
;
case
10
:
return
(__extension__ ({ const struct in6_addr *__a = (const struct in6_addr *) (
&(((struct sockaddr_in6 *)hostaddr)->sin6_addr)
); __a->__in6_u.__u6_addr32[0] == 0 && __a->__in6_u.__u6_addr32[1] == 0 && __a->__in6_u.__u6_addr32[2] == 0 && __a->__in6_u.__u6_addr32[3] == htonl (1); }))
;
default:
return 0;
}
}
| int sockaddr_is_local(struct_0 *a0) {
unsigned int v0[4];
unsigned int v2;
switch (a0->field_0) {
case 2:
v2 = (ntohl(a0->field_4) >> 24) == 127;
return v2;
case 10:
*(&v0[0]) = a0 + 1;
if (v0[0]) {
v2 = 0;
return v2;
} else if (v0[1]) {
v2 = 0;
return v2;
} else if (v0[2]) {
v2 = 0;
return v2;
} else if (v0[3] != htonl(0x1)) {
v2 = 0;
return v2;
} else {
v2 = 1;
return v2;
}
default:
v2 = 0;
return v2;
}
}
|
static int fix_dotdot_proc(struct ext2_dir_entry *dirent,
int offset __attribute__((unused)),
int blocksize __attribute__((unused)),
char *buf __attribute__((unused)),
void *priv_data)
{
struct fix_dotdot_struct *fp = (struct fix_dotdot_struct *) priv_data;
errcode_t retval;
struct problem_context pctx;
if (ext2fs_dirent_name_len(dirent) != 2)
return 0;
if (strncmp(dirent->name, "..", 2))
return 0;
clear_problem_context(&pctx);
retval = e2fsck_adjust_inode_count(fp->ctx, dirent->inode, -1);
if (retval) {
pctx.errcode = retval;
fix_problem(fp->ctx, 0x03000E, &pctx);
}
retval = e2fsck_adjust_inode_count(fp->ctx, fp->parent, 1);
if (retval) {
pctx.errcode = retval;
fix_problem(fp->ctx, 0x03000E, &pctx);
}
dirent->inode = fp->parent;
if (ext2fs_has_feature_filetype(fp->ctx->fs->super))
ext2fs_dirent_set_file_type(dirent, 2);
else
ext2fs_dirent_set_file_type(dirent, 0);
fp->done++;
return 2 | 1;
}
| long fix_dotdot_proc(long a1, long a2, long a3, long a4, long a5)
{
long v7;
long v8;
long v9[14];
v9[13] = __readfsqword(0x28u);
if ( (unsigned int)ext2fs_dirent_name_len(a1) != 2 )
return 0LL;
if ( strncmp((const char *)(a1 + 8), "..", 2uLL) )
return 0LL;
clear_problem_context(v9);
v7 = e2fsck_adjust_inode_count(*(long **)(a5 + 16), *(_DWORD *)a1, -1);
if ( v7 )
{
v9[0] = v7;
fix_problem(*(_QWORD *)(a5 + 16), 196622LL, v9);
}
v8 = e2fsck_adjust_inode_count(*(long **)(a5 + 16), *(_DWORD *)(a5 + 8), 1);
if ( v8 )
{
v9[0] = v8;
fix_problem(*(_QWORD *)(a5 + 16), 196622LL, v9);
}
*(_DWORD *)a1 = *(_DWORD *)(a5 + 8);
if ( ext2fs_has_feature_filetype(*(_QWORD *)(**(_QWORD **)(a5 + 16) + 32LL)) )
ext2fs_dirent_set_file_type(a1, 2LL);
else
ext2fs_dirent_set_file_type(a1, 0LL);
++*(_DWORD *)(a5 + 12);
return 3LL;
}
|
static void
userauth_banner(struct ssh *ssh)
{
char *banner =
((void *)0)
;
if (options.banner ==
((void *)0)
)
return;
if ((banner = (use_privsep ? mm_auth2_read_banner() : auth2_read_banner())) ==
((void *)0)
)
goto done;
userauth_send_banner(ssh, banner);
done:
free(banner);
}
| void userauth_banner(unsigned long a0, unsigned int a1, unsigned int a2) {
void* v0;
unsigned long long v2;
void* v3;
unsigned long long v4;
v0 = 0;
v2 = *(5250544);
if (!*(5250544))
return;
if (!use_privsep)
v3 = auth2_read_banner(a0, a1, a2);
else
v3 = mm_auth2_read_banner();
v0 = v3;
if (v0)
userauth_send_banner(a0, v0);
v4 = free(v0);
return;
}
|
static
_Bool
grepfile (int dirdesc, char const *name,
_Bool
follow,
_Bool
command_line)
{
int oflag = (
00
|
0400
| (({
binary ?
0
: 0;
})
)
| (follow ? 0 :
0400000
)
| (skip_devices (command_line) ?
04000
: 0));
int desc = openat_safer (dirdesc, name, oflag);
if (desc < 0)
{
if (follow || ! open_symlink_nofollow_error (
(*__errno_location ())
))
suppressible_error (
(*__errno_location ())
);
return
1
;
}
return grepdesc (desc, command_line);
}
| void grepfile(unsigned long a0, unsigned long long a1, unsigned long a2, unsigned long a3) {
unsigned int v0;
unsigned int v1;
unsigned int v4;
unsigned long long v5;
unsigned long long v6;
v4 = (!skip_devices(a3) ? 0x800 : 0);
v0 = v4 | (!a2 ? 0x100 : 0x20100);
v1 = openat_safer(a0, a1, v0, a1);
if (v1 >= 0) {
v5 = grepdesc(v1, a3);
return;
}
if (a2) {
suppressible_error(*(__errno_location()));
} else {
*(&v4) = open_symlink_nofollow_error(*(__errno_location())) ^ 1;
if (v4)
suppressible_error(*(__errno_location()));
}
v6 = 1;
return;
}
|
int
sshauthopt_deserialise(struct sshbuf *m, struct sshauthopt **optsp)
{
struct sshauthopt *opts =
((void *)0)
;
int r = -1;
u_char f;
u_int tmp;
if ((opts = calloc(1, sizeof(*opts))) ==
((void *)0)
)
return -2;
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->permit_port_forwarding_flag = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->permit_agent_forwarding_flag = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->permit_x11_forwarding_flag = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->permit_pty_flag = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->permit_user_rc = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->restricted = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->cert_authority = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->no_require_user_presence = f; } while (0);
do { if ((r = sshbuf_get_u8(m, &f)) != 0) goto out; opts->require_verify = f; } while (0);
if ((r = sshbuf_get_u64(m, &opts->valid_before)) != 0)
goto out;
if ((r = sshbuf_get_u8(m, &f)) != 0 ||
(r = sshbuf_get_u32(m, &tmp)) != 0)
goto out;
opts->force_tun_device = f ? -1 : (int)tmp;
if ((r = deserialise_nullable_string(m, &opts->cert_principals)) != 0 ||
(r = deserialise_nullable_string(m, &opts->force_command)) != 0 ||
(r = deserialise_nullable_string(m,
&opts->required_from_host_cert)) != 0 ||
(r = deserialise_nullable_string(m,
&opts->required_from_host_keys)) != 0)
goto out;
if ((r = deserialise_array(m, &opts->env, &opts->nenv)) != 0 ||
(r = deserialise_array(m,
&opts->permitopen, &opts->npermitopen)) != 0 ||
(r = deserialise_array(m,
&opts->permitlisten, &opts->npermitlisten)) != 0)
goto out;
r = 0;
*optsp = opts;
opts =
((void *)0)
;
out:
sshauthopt_free(opts);
return r;
}
| long long sshauthopt_deserialise(unsigned long long a0, unsigned long long *a1) {
char v0;
char v1;
unsigned int v2;
void* v3;
unsigned long long v5;
unsigned int v6;
v3 = 0;
v2 = -1;
v3 = calloc(0x1, 0x88);
if (!v3) {
v5 = 4294967294;
} else {
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(v3) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[4]) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[8]) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[12]) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[16]) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[20]) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[32]) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[128]) = v0;
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
*(&v3[132]) = v0;
v2 = sshbuf_get_u64(a0, v3 + 24, v3 + 24);
if (!v2) {
v2 = sshbuf_get_u8(a0, &v0, &v0);
if (!v2) {
v2 = sshbuf_get_u32(a0, &v1, &v1);
if (!v2) {
if (!v0)
v6 = *(&v1);
else
v6 = -1;
*(&v3[48]) = v6;
v2 = deserialise_nullable_string(a0, v3 + 40);
if (!v2) {
v2 = deserialise_nullable_string(a0, v3 + 56);
if (!v2) {
v2 = deserialise_nullable_string(a0, v3 + 112);
if (!v2) {
v2 = deserialise_nullable_string(a0, v3 + 120);
if (!v2) {
v2 = deserialise_array(a0, v3 + 72, v3 + 64);
if (!v2) {
v2 = deserialise_array(a0, v3 + 88, v3 + 80);
if (!v2) {
v2 = deserialise_array(a0, v3 + 104, v3 + 96);
if (!v2) {
v2 = 0;
*(a1) = v3;
v3 = 0;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
sshauthopt_free(v3);
v5 = v2;
}
return v5;
}
|
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;
}
|
0
)
do { fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
| int fprintf(FILE *__stream,char *__format,...)
{
halt_baddata();
}
|
void
sshkey_sig_details_free(struct sshkey_sig_details *details)
{
freezero(details, sizeof(*details));
}
| void sshkey_sig_details_free(undefined8 param_1)
{
freezero(param_1,8);
return;
}
|
static int print_spdinfo(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
__u32 *f = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
struct rtattr *tb[(__XFRMA_SPD_MAX - 1)+1];
struct rtattr *rta;
int len = n->nlmsg_len;
len -= ((sizeof(__u32)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )));
if (len < 0) {
fprintf(
stderr
, "SPDinfo: Wrong len %d\n", len);
return -1;
}
rta = ((struct rtattr*)(((char*)(f)) + ( ((sizeof(__u32))+4U -1) & ~(4U -1) )));
parse_rtattr(tb, (__XFRMA_SPD_MAX - 1), rta, len);
fprintf(fp, "\t SPD");
if (tb[XFRMA_SPD_INFO]) {
struct xfrmu_spdinfo *si;
if (((int)((tb[XFRMA_SPD_INFO])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) < sizeof(*si)) {
fprintf(
stderr
, "SPDinfo: Wrong len %d\n", len);
return -1;
}
si = ((void*)(((char*)(tb[XFRMA_SPD_INFO])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
fprintf(fp, " IN %d", si->incnt);
fprintf(fp, " OUT %d", si->outcnt);
fprintf(fp, " FWD %d", si->fwdcnt);
if (show_stats) {
fprintf(fp, " (Sock:");
fprintf(fp, " IN %d", si->inscnt);
fprintf(fp, " OUT %d", si->outscnt);
fprintf(fp, " FWD %d", si->fwdscnt);
fprintf(fp, ")");
}
fprintf(fp, "%s", _SL_);
}
if (show_stats > 1) {
struct xfrmu_spdhinfo *sh;
if (tb[XFRMA_SPD_HINFO]) {
if (((int)((tb[XFRMA_SPD_HINFO])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) < sizeof(*sh)) {
fprintf(
stderr
, "SPDinfo: Wrong len %d\n", len);
return -1;
}
sh = ((void*)(((char*)(tb[XFRMA_SPD_HINFO])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
fprintf(fp, "\t SPD buckets:");
fprintf(fp, " count %d", sh->spdhcnt);
fprintf(fp, " Max %d", sh->spdhmcnt);
fprintf(fp, "%s", _SL_);
}
if (tb[XFRMA_SPD_IPV4_HTHRESH]) {
struct xfrmu_spdhthresh *th;
if (((int)((tb[XFRMA_SPD_IPV4_HTHRESH])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) < sizeof(*th)) {
fprintf(
stderr
, "SPDinfo: Wrong len %d\n", len);
return -1;
}
th = ((void*)(((char*)(tb[XFRMA_SPD_IPV4_HTHRESH])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
fprintf(fp, "\t SPD IPv4 thresholds:");
fprintf(fp, " local %d", th->lbits);
fprintf(fp, " remote %d", th->rbits);
fprintf(fp, "%s", _SL_);
}
if (tb[XFRMA_SPD_IPV6_HTHRESH]) {
struct xfrmu_spdhthresh *th;
if (((int)((tb[XFRMA_SPD_IPV6_HTHRESH])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) < sizeof(*th)) {
fprintf(
stderr
, "SPDinfo: Wrong len %d\n", len);
return -1;
}
th = ((void*)(((char*)(tb[XFRMA_SPD_IPV6_HTHRESH])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
fprintf(fp, "\t SPD IPv6 thresholds:");
fprintf(fp, " local %d", th->lbits);
fprintf(fp, " remote %d", th->rbits);
fprintf(fp, "%s", _SL_);
}
}
if (oneline)
fprintf(fp, "\n");
return 0;
}
| void print_spdinfo(unsigned int *a0, void* a1) {
unsigned int v0;
unsigned long v1;
unsigned long long v2;
unsigned int v3[6];
unsigned int v4[2];
char v5[2];
char v6[2];
char v7;
char v8;
char v9;
char v10;
char v11;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
unsigned long long v16;
unsigned long long v17;
void* v18;
v1 = a0 + 4;
v0 = *(a0);
v0 -= 20;
if (v0 < 0) {
fprintf(*(&stderr), "SPDinfo: Wrong len %d\n", v0);
v13 = 4294967295;
} else {
v2 = v1 + 4;
parse_rtattr(&v7, 0x4, v2, v0);
fprintf(a1, "\t SPD");
if (*(&v8)) {
if (*(*(&v8)) - 4 <= 23) {
fprintf(*(&stderr), "SPDinfo: Wrong len %d\n", v0);
v14 = 4294967295;
} else {
*(&v3[0]) = *(&v8) + 4;
fprintf(a1, " IN %d", v3[0]);
fprintf(a1, " OUT %d", v3[1]);
fprintf(a1, " FWD %d", v3[2]);
if (show_stats) {
fprintf(a1, " (Sock:");
fprintf(a1, " IN %d", v3[3]);
fprintf(a1, " OUT %d", v3[4]);
fprintf(a1, " FWD %d", v3[5]);
fprintf(a1, ")");
}
fprintf(a1, "%s", _SL_);
}
}
if (!*(&v8) || *(*(&v8)) - 4 > 23) {
if (show_stats > 1) {
if (*(&v9)) {
if (*(*(&v9)) - 4 <= 7) {
fprintf(*(&stderr), "SPDinfo: Wrong len %d\n", v0);
v15 = 4294967295;
} else {
*(&v4[0]) = *(&v9) + 4;
fprintf(a1, "\t SPD buckets:");
fprintf(a1, " count %d", v4[0]);
fprintf(a1, " Max %d", v4[1]);
fprintf(a1, "%s", _SL_);
}
}
if (!*(&v9) || *(*(&v9)) - 4 > 7) {
if (*(&v10)) {
if (*(*(&v10)) - 4 <= 1) {
fprintf(*(&stderr), "SPDinfo: Wrong len %d\n", v0);
v16 = 4294967295;
} else {
*(&v5) = *(&v10) + 4;
fprintf(a1, "\t SPD IPv4 thresholds:");
fprintf(a1, " local %d", v5[0]);
fprintf(a1, " remote %d", v5[1]);
fprintf(a1, "%s", _SL_);
}
}
if ((!*(&v10) || *(*(&v10)) - 4 > 1) && *(&v11)) {
if (*(*(&v11)) - 4 <= 1) {
fprintf(*(&stderr), "SPDinfo: Wrong len %d\n", v0);
v17 = 4294967295;
} else {
*(&v6) = *(&v11) + 4;
fprintf(a1, "\t SPD IPv6 thresholds:");
fprintf(a1, " local %d", v6[0]);
fprintf(a1, " remote %d", v6[1]);
fprintf(a1, "%s", _SL_);
}
}
}
}
if (show_stats <= 1 || !*(&v10) && !*(&v11) && !*(&v9) || !*(&v10) && !*(&v11) && *(*(&v9)) - 4 > 7 || !*(&v10) && !*(&v9) && *(*(&v11)) - 4 > 1 || !*(&v11) && !*(&v9) && *(*(&v10)) - 4 > 1 || !*(&v10) && *(*(&v11)) - 4 > 1 && *(*(&v9)) - 4 > 7 || !*(&v11) && *(*(&v10)) - 4 > 1 && *(*(&v9)) - 4 > 7 || !*(&v9) && *(*(&v11)) - 4 > 1 && *(*(&v10)) - 4 > 1 || *(*(&v11)) - 4 > 1 && *(*(&v10)) - 4 > 1 && *(*(&v9)) - 4 > 7) {
if (oneline)
fprintf(a1, "\n");
v18 = 0;
}
}
}
return;
}
|
static void
settimeout (double duration,
_Bool
warn)
{
struct timespec ts = dtotimespec (duration);
struct itimerspec its = { {0, 0}, ts };
timer_t timerid;
if (timer_create (
0
,
((void *)0)
, &timerid) == 0)
{
if (timer_settime (timerid, 0, &its,
((void *)0)
) == 0)
return;
else
{
if (warn)
error (0,
(*__errno_location ())
, gettext ("warning: timer_settime"));
timer_delete (timerid);
}
}
else if (warn &&
(*__errno_location ())
!=
38
)
error (0,
(*__errno_location ())
, gettext ("warning: timer_create"));
unsigned int timeint;
if (
(0x7fffffff * 2U + 1U)
<= duration)
timeint =
(0x7fffffff * 2U + 1U)
;
else
{
unsigned int duration_floor = duration;
timeint = duration_floor + (duration_floor < duration);
}
alarm (timeint);
}
| void settimeout(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned long v0;
unsigned int v1;
unsigned int v2;
char v3;
unsigned long v4;
void* v5;
void* v6;
unsigned long v7;
unsigned long v8;
char v9;
unsigned long v11;
unsigned long long v13;
unsigned long long *v14;
unsigned long long v15;
v0 = v11;
v4 = dtotimespec();
v5 = 0;
v6 = 0;
v7 = v4;
v8 = a2;
if (timer_create(0x0, 0x0, &v3)) {
if (a0 && *(__errno_location()) != 38)
error(0x0, *(__errno_location()), gettext("warning: timer_create"));
} else {
if (timer_settime(*(&v3), 0x0, &v5, 0x0)) {
if (a0)
error(0x0, *(__errno_location()), gettext("warning: timer_settime"));
timer_delete(*(&v3));
} else {
v15 = *(&v9) ^ v14[5];
return;
}
}
if (!(BinaryOp CmpF & 1)) {
v1 = -1;
} else {
v2 = v0;
if (v2 >= 0)
v13 = v2;
else
v13 = (0 CONCAT v2 >> 1 | v2 & 1) + (0 CONCAT v2 >> 1 | v2 & 1);
v1 = v2 + (!((BinaryOp CmpF & 69 | (BinaryOp CmpF & 69) >> 6) & 1));
}
alarm(v1);
v15 = *(&v9) ^ v14[5];
return;
}
|
int
zmapfd (fd, ostr, fn)
int fd;
char **ostr;
char *fn;
{
ssize_t nr;
int rval;
char lbuf[4096];
char *result;
size_t rsize, rind;
rval = 0;
result = (char *)sh_xmalloc((rsize = 4096), "zmapfd.c", 60);
rind = 0;
while (1)
{
nr = zread (fd, lbuf, sizeof (lbuf));
if (nr == 0)
{
rval = rind;
break;
}
else if (nr < 0)
{
sh_xfree((result), "zmapfd.c", 73);
if (ostr)
*ostr = (char *)
((void *)0)
;
return -1;
}
do { if ((rind) + (nr) >= rsize) { while ((rind) + (nr) >= rsize) rsize += (4096); result = sh_xrealloc((result), (rsize), "zmapfd.c", 79); } } while (0);
memcpy (result+rind, lbuf, nr);
rind += nr;
}
do { if ((rind) + (1) >= rsize) { while ((rind) + (1) >= rsize) rsize += (128); result = sh_xrealloc((result), (rsize), "zmapfd.c", 84); } } while (0);
result[rind] = '\0';
if (ostr)
*ostr = result;
else
sh_xfree((result), "zmapfd.c", 90);
return rval;
}
| long long zmapfd(unsigned long a0, unsigned long long *a1, unsigned long a2) {
unsigned long v0;
unsigned int v1;
void* v2;
unsigned long long v3;
void* v4;
unsigned int v5;
char v6;
char v7;
unsigned long long v9;
v7 = *(&v7);
v0 = a2;
v1 = 0;
v3 = 0x1000;
v2 = sh_xmalloc(v3, "zmapfd.c", 0x3c);
v4 = 0;
while (true) {
if (!*(&v5)) {
if (v3 <= v4 + 1) {
for (v1 = v4; v3 <= v4 + 1; v3 -= -128);
v2 = sh_xrealloc(v2, v3, "zmapfd.c", 0x54);
}
*((v4 + v2)) = 0;
if (!a1)
sh_xfree(v2, "zmapfd.c", 0x5a);
else
*(a1) = v2;
v9 = v1;
break;
} else if ((*(&v5) - 0 >> 63)) {
sh_xfree(v2, "zmapfd.c", 0x49);
if (a1)
*(a1) = 0;
v9 = 4294967295;
break;
} else {
if (v3 <= v4 + *(&v5)) {
for (*(&v5) = zread(a0, &v6, 0x1000, &v6); v3 <= v4 + *(&v5); v3 += 0x1000);
v2 = sh_xrealloc(v2, v3, "zmapfd.c", 0x4f);
}
memcpy(v2 + v4, &v6, *(&v5));
v4 += *(&v5);
}
}
return v9;
}
|
static void Encrypt(Fq *c,const small *r,const Fq *h)
{
Fq hr[761];
Rq_mult_small(hr,h,r);
Round(c,hr);
}
| unsigned long Encrypt(long a1, long a2, long a3)
{
char v4[1528];
unsigned long v5;
v5 = __readfsqword(0x28u);
Rq_mult_small((long)v4, a3, a2);
Round(a1, (long)v4);
return __readfsqword(0x28u) ^ v5;
}
|
static int bond_slave_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
__u16 queue_id;
int prio;
while (argc > 0) {
if (matches(*argv, "queue_id") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u16(&queue_id, *argv, 0))
invarg("queue_id is invalid", *argv);
addattr16(n, 1024, IFLA_BOND_SLAVE_QUEUE_ID, queue_id);
} else if (strcmp(*argv, "prio") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_s32(&prio, *argv, 0))
invarg("prio is invalid", *argv);
addattr32(n, 1024, IFLA_BOND_SLAVE_PRIO, prio);
} else {
if (matches(*argv, "help") != 0)
fprintf(
stderr
,
"bond_slave: unknown option \"%s\"?\n",
*argv);
explain();
return -1;
}
argc--, argv++;
}
return 0;
}
| long long bond_slave_parse_opt(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long long a3) {
unsigned long long *v0;
unsigned int v1;
unsigned long v2;
char v3;
char v4;
unsigned long long v7;
v2 = a0;
v1 = a1;
v0 = a2;
while (true) {
if (v1 <= 0) {
v7 = 0;
break;
} else {
if ((matches(*(v0), "queue_id") ^ 1)) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
if (get_u16(&v3, *(v0), 0x0, *(v0)))
invarg("queue_id is invalid", *(v0));
addattr16(a3, 0x400, 0x5, *(&v3));
} else if (strcmp(*(v0), "prio")) {
if (matches(*(v0), "help"))
fprintf(stderr, "bond_slave: unknown option \"%s\"?\n", *(v0));
explain();
v7 = 4294967295;
break;
} else {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
if (get_s32(&v4, *(v0), 0x0, *(v0)))
invarg("prio is invalid", *(v0));
addattr32(a3, 0x400, 0x9, *(&v4));
}
v1 -= 1;
v0 += 1;
}
}
return v7;
}
|
void *
ssh_packet_get_input(struct ssh *ssh)
{
return (void *)ssh->state->input;
}
| long long ssh_packet_get_input(struct struct_0 **a0) {
return *(a0)->field_20;
}
|
static int
dns_read_rdata(u_int8_t *algorithm, u_int8_t *digest_type,
u_char **digest, size_t *digest_len, u_char *rdata, int rdata_len)
{
int success = 0;
*algorithm = SSHFP_KEY_RESERVED;
*digest_type = SSHFP_HASH_RESERVED;
if (rdata_len >= 2) {
*algorithm = rdata[0];
*digest_type = rdata[1];
*digest_len = rdata_len - 2;
if (*digest_len > 0) {
*digest = xmalloc(*digest_len);
memcpy(*digest, rdata + 2, *digest_len);
} else {
*digest = (u_char *)xstrdup("");
}
success = 1;
}
return success;
}
| undefined4
dns_read_rdata(undefined *param_1,undefined *param_2,void **param_3,size_t *param_4,
undefined *param_5,int param_6)
{
int iVar1;
void *pvVar2;
undefined4 local_c;
local_c = 0;
*param_1 = 0;
*param_2 = 0;
if (1 < param_6) {
*param_1 = *param_5;
*param_2 = param_5[1];
iVar1 = __addvsi3(param_6,0xfffffffe);
*param_4 = (long)iVar1;
if (*param_4 == 0) {
pvVar2 = (void *)xstrdup(&DAT_00100c1c);
*param_3 = pvVar2;
}
else {
pvVar2 = (void *)xmalloc(*param_4);
*param_3 = pvVar2;
memcpy(*param_3,param_5 + 2,*param_4);
}
local_c = 1;
}
return local_c;
}
|
static void
set_fwdpermit_from_authopts(struct ssh *ssh, const struct sshauthopt *opts)
{
char *tmp, *cp, *host;
int port;
size_t i;
if ((options.allow_tcp_forwarding & (1<<1)) != 0) {
channel_clear_permission(ssh, 0x101, (1<<1));
for (i = 0; i < auth_opts->npermitopen; i++) {
tmp = cp = xstrdup(auth_opts->permitopen[i]);
if ((host = hpdelim2(&cp,
((void *)0)
)) ==
((void *)0)
)
sshfatal("session.c", __func__, 307, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "internal error: hpdelim");
host = cleanhostname(host);
if (cp ==
((void *)0)
|| (port = permitopen_port(cp)) < 0)
sshfatal("session.c", __func__, 310, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "internal error: permitopen port");
channel_add_permission(ssh,
0x101, (1<<1), host, port);
free(tmp);
}
}
if ((options.allow_tcp_forwarding & (1)) != 0) {
channel_clear_permission(ssh, 0x101, (1));
for (i = 0; i < auth_opts->npermitlisten; i++) {
tmp = cp = xstrdup(auth_opts->permitlisten[i]);
if ((host = hpdelim(&cp)) ==
((void *)0)
)
sshfatal("session.c", __func__, 322, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "internal error: hpdelim");
host = cleanhostname(host);
if (cp ==
((void *)0)
|| (port = permitopen_port(cp)) < 0)
sshfatal("session.c", __func__, 325, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "internal error: permitlisten port");
channel_add_permission(ssh,
0x101, (1), host, port);
free(tmp);
}
}
}
| void set_fwdpermit_from_authopts(unsigned long long a0, unsigned long a1) {
unsigned long v0;
unsigned int v1;
void* v2;
void* v3;
void* v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long *v8;
unsigned long long v9;
v0 = a1;
if ((g_50061c & 2)) {
channel_clear_permission(a0, 0x101, 0x2);
for (v3 = 0; v3 < *((auth_opts + 80)); v3 += 1) {
v2 = xstrdup(*((*((auth_opts + 88)) + v3 * 8)));
v4 = v2;
v5 = hpdelim2(&v2, 0x0);
if (!v5) {
v6 = "internal error: hpdelim";
sshfatal("session.c", "set_fwdpermit_from_authopts", 0x133, 0x1, 0x1, 0x0);
}
v5 = cleanhostname(v5);
if (v2)
v1 = permitopen_port(v2);
if (!v2 || v1 < 0) {
v6 = "internal error: permitopen port";
sshfatal("session.c", "set_fwdpermit_from_authopts", 0x136, 0x1, 0x1, 0x0);
}
channel_add_permission(a0, 0x101, 0x2, v5, v1);
free(v4);
}
}
if ((g_50061c & 1)) {
channel_clear_permission(a0, 0x101, 0x1);
for (v3 = 0; v3 < *((auth_opts + 96)); v3 += 1) {
v2 = xstrdup(*((*((auth_opts + 104)) + v3 * 8)));
v4 = v2;
v5 = hpdelim(&v2);
if (!v5) {
v6 = "internal error: hpdelim";
sshfatal("session.c", "set_fwdpermit_from_authopts", 0x142, 0x1, 0x1, 0x0);
}
v5 = cleanhostname(v5);
if (v2)
v1 = permitopen_port(v2);
if (v1 < 0 || !v2) {
v6 = "internal error: permitlisten port";
sshfatal("session.c", "set_fwdpermit_from_authopts", 0x145, 0x1, 0x1, 0x0);
}
channel_add_permission(a0, 0x101, 0x1, v5, v1);
free(v4);
}
}
v9 = v6 ^ v8[5];
return;
}
|
static
void pad ( Char *s )
{
Int32 i;
if ( (Int32)strlen(s) >= longestFileName ) return;
for (i = 1; i <= longestFileName - (Int32)strlen(s); i++)
fprintf (
stderr
, " " );
}
| long pad(const char *a1)
{
int v1;
long result;
int i;
v1 = strlen(a1);
result = (unsigned int)longestFileName;
if ( v1 < longestFileName )
{
for ( i = 1; ; ++i )
{
result = longestFileName - (unsigned int)strlen(a1);
if ( i > (int)result )
break;
fprintf(stderr, " ");
}
}
return result;
}
|
void
usage (int status)
{
if (status !=
0
)
do { fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
else
{
printf (gettext ("Usage: %s [OPTION]... [-T] TARGET LINK_NAME\n or: %s [OPTION]... TARGET\n or: %s [OPTION]... TARGET... DIRECTORY\n or: %s [OPTION]... -t DIRECTORY TARGET...\n")
,
program_name, program_name, program_name, program_name);
fputs_unlocked (gettext ("In the 1st form, create a link to TARGET with the name LINK_NAME.\nIn the 2nd form, create a link to TARGET in the current directory.\nIn the 3rd and 4th forms, create links to each TARGET in DIRECTORY.\nCreate hard links by default, symbolic links with --symbolic.\nBy default, each destination (name of new link) should not already exist.\nWhen creating hard links, each TARGET must exist. Symbolic links\ncan hold arbitrary text; if later resolved, a relative link is\ninterpreted in relation to its parent directory.\n"),
stdout
)
;
emit_mandatory_arg_note ();
fputs_unlocked (gettext (" --backup[=CONTROL] make a backup of each existing destination file\n -b like --backup but does not accept an argument\n -d, -F, --directory allow the superuser to attempt to hard link\n directories (note: will probably fail due to\n system restrictions, even for the superuser)\n -f, --force remove existing destination files\n"),
stdout
)
;
fputs_unlocked (gettext (" -i, --interactive prompt whether to remove destinations\n -L, --logical dereference TARGETs that are symbolic links\n -n, --no-dereference treat LINK_NAME as a normal file if\n it is a symbolic link to a directory\n -P, --physical make hard links directly to symbolic links\n -r, --relative with -s, create links relative to link location\n -s, --symbolic make symbolic links instead of hard links\n"),
stdout
)
;
fputs_unlocked (gettext (" -S, --suffix=SUFFIX override the usual backup suffix\n -t, --target-directory=DIRECTORY specify the DIRECTORY in which to create\n the links\n -T, --no-target-directory treat LINK_NAME as a normal file always\n -v, --verbose print name of each linked file\n"),
stdout
)
;
fputs_unlocked (gettext (" --help display this help and exit\n"),
stdout
);
fputs_unlocked (gettext (" --version output version information and exit\n"),
stdout
);
emit_backup_suffix_note ();
printf (gettext ("\nUsing -s ignores -L and -P. Otherwise, the last option specified controls\nbehavior when a TARGET is a symbolic link, defaulting to %s.\n")
, 0 ? "-L" : "-P");
emit_ancillary_info ("ln");
}
exit (status);
}
| void usage(unsigned long a0) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned long v5;
unsigned long v6;
unsigned long v7;
unsigned long v8;
v3 = v5;
v2 = v6;
v1 = v7;
v0 = v8;
if (a0) {
fprintf(stderr, gettext("Try '%s --help' for more information.\n"));
} else {
printf(gettext("Usage: %s [OPTION]... [-T] TARGET LINK_NAME\n or: %s [OPTION]... TARGET\n or: %s [OPTION]... TARGET... DIRECTORY\n or: %s [OPTION]... -t DIRECTORY TARGET...\n"));
fputs_unlocked(gettext("In the 1st form, create a link to TARGET with the name LINK_NAME.\nIn the 2nd form, create a link to TARGET in the current directory.\nIn the 3rd and 4th forms, create links to each TARGET in DIRECTORY.\nCreate hard links by default, symbolic links with --symbolic.\nBy default, each destination (name of new link) should not already exist.\nWhen creating hard links, each TARGET must exist. Symbolic links\ncan hold arbitrary text; if later resolved, a relative link is\ninterpreted in relation to its parent directory.\n"), stdout);
emit_mandatory_arg_note();
fputs_unlocked(gettext(" --backup[=CONTROL] make a backup of each existing destination file\n -b like --backup but does not accept an argument\n -d, -F, --directory allow the superuser to attempt to hard link\n directories (note: will probably fail due to\n system restrictions, even for the superuser)\n -f, --force remove existing destination files\n"), stdout);
fputs_unlocked(gettext(" -i, --interactive prompt whether to remove destinations\n -L, --logical dereference TARGETs that are symbolic links\n -n, --no-dereference treat LINK_NAME as a normal file if\n it is a symbolic link to a directory\n -P, --physical make hard links directly to symbolic links\n -r, --relative with -s, create links relative to link location\n -s, --symbolic make symbolic links instead of hard links\n"), stdout);
fputs_unlocked(gettext(" -S, --suffix=SUFFIX override the usual backup suffix\n -t, --target-directory=DIRECTORY specify the DIRECTORY in which to create\n the links\n -T, --no-target-directory treat LINK_NAME as a normal file always\n -v, --verbose print name of each linked file\n"), stdout);
fputs_unlocked(gettext(" --help display this help and exit\n"), stdout);
fputs_unlocked(gettext(" --version output version information and exit\n"), stdout);
emit_backup_suffix_note();
printf(gettext("\nUsing -s ignores -L and -P. Otherwise, the last option specified controls\nbehavior when a TARGET is a symbolic link, defaulting to %s.\n"));
emit_ancillary_info("ln");
}
exit(a0);
}
|
static
_Bool
parse_mmin (const struct parser_table* entry, char **argv, int *arg_ptr)
{
return do_parse_xmin (entry, argv, arg_ptr, XVAL_MTIME);
}
| long long parse_mmin(unsigned long long a0, unsigned long long a1, unsigned long long a2) {
return do_parse_xmin(a0, a1, a2, 0x3);
}
|
static const char *
parse_awaiter_package(void)
{
struct dpkg_error err = { DPKG_MSG_NONE, 0,
((void *)0)
};
struct pkginfo *pkg;
if (!f_await)
bypackage = "-";
if (bypackage ==
((void *)0)
) {
const char *pkgname, *archname;
pkgname = getenv("DPKG_MAINTSCRIPT_PACKAGE");
archname = getenv("DPKG_MAINTSCRIPT_ARCH");
if (pkgname ==
((void *)0)
|| archname ==
((void *)0)
)
badusage(gettext("must be called from a maintainer script" " (or with a --by-package option)")
);
pkg = pkg_spec_find_pkg(pkgname, archname, &err);
} else if (strcmp(bypackage, "-") == 0) {
pkg =
((void *)0)
;
} else {
pkg = pkg_spec_parse_pkg(bypackage, &err);
}
if (pkg)
bypackage = pkg_name(pkg, pnaw_nonambig);
return err.str;
}
| int parse_awaiter_package() {
void* v0;
unsigned long long v1;
unsigned long long v2;
unsigned int v3;
unsigned int v4;
void* v5;
v3 = 0;
v4 = 0;
v5 = 0;
if (!f_await)
bypackage = "-";
if (!bypackage) {
v1 = getenv("DPKG_MAINTSCRIPT_PACKAGE");
v2 = getenv("DPKG_MAINTSCRIPT_ARCH");
if (!v2 || !v1)
badusage(gettext("must be called from a maintainer script (or with a --by-package option)"));
v0 = pkg_spec_find_pkg(v1, v2, &v3, v2);
} else if (!strcmp(bypackage, "-")) {
v0 = 0;
} else {
v0 = pkg_spec_parse_pkg(bypackage, &v3, &v3);
}
if (v0)
bypackage = pkg_name(v0, 0x1);
return v5;
}
|
static int ipadd_save_prep(void)
{
int ret;
if (isatty(
1
)) {
fprintf(
stderr
, "Not sending a binary stream to stdout\n");
return -1;
}
ret = write(
1
, &ipadd_dump_magic, sizeof(ipadd_dump_magic));
if (ret != sizeof(ipadd_dump_magic)) {
fprintf(
stderr
, "Can't write magic to dump file\n");
return -1;
}
return 0;
}
| long ipadd_save_prep()
{
if ( isatty(1) )
{
fprintf(stderr, "Not sending a binary stream to stdout\n");
return 0xFFFFFFFFLL;
}
else if ( (unsigned int)write(1, &ipadd_dump_magic, 4uLL) == 4 )
{
return 0LL;
}
else
{
fprintf(stderr, "Can't write magic to dump file\n");
return 0xFFFFFFFFLL;
}
}
|
void
usage (FILE *out, int status)
{
const char str[] =
"p11tool - GnuTLS PKCS #11 tool\n"
"Usage: p11tool [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [url]\n"
"\n"
"None:\n"
"\n"
"\n"
"Tokens:\n"
"\n"
" --list-tokens List all available tokens\n"
" --list-token-urls List the URLs available tokens\n"
" --list-mechanisms List all available mechanisms in a token\n"
" --initialize Initializes a PKCS #11 token\n"
" --initialize-pin Initializes/Resets a PKCS #11 token user PIN\n"
" --initialize-so-pin Initializes/Resets a PKCS #11 token security officer PIN\n"
" --set-pin=str Specify the PIN to use on token operations\n"
" --set-so-pin=str Specify the Security Officer's PIN to use on token initialization\n"
"\n"
"Object listing:\n"
"\n"
" --list-all List all available objects in a token\n"
" --list-all-certs List all available certificates in a token\n"
" --list-certs List all certificates that have an associated private key\n"
" --list-all-privkeys List all available private keys in a token\n"
" --list-privkeys an alias for the 'list-all-privkeys' option\n"
" --list-keys an alias for the 'list-all-privkeys' option\n"
" --list-all-trusted List all available certificates marked as trusted\n"
" --export Export the object specified by the URL\n"
" - prohibits these options:\n"
" export-stapled\n"
" export-chain\n"
" export-pubkey\n"
" --export-stapled Export the certificate object specified by the URL\n"
" - prohibits these options:\n"
" export\n"
" export-chain\n"
" export-pubkey\n"
" --export-chain Export the certificate specified by the URL and its chain of trust\n"
" - prohibits these options:\n"
" export-stapled\n"
" export\n"
" export-pubkey\n"
" --export-pubkey Export the public key for a private key\n"
" - prohibits these options:\n"
" export-stapled\n"
" export\n"
" export-chain\n"
" --info List information on an available object in a token\n"
" --trusted an alias for the 'mark-trusted' option\n"
" --distrusted an alias for the 'mark-distrusted' option\n"
"\n"
"Key generation:\n"
"\n"
" --generate-privkey=str Generate private-public key pair of given type\n"
" --bits=num Specify the number of bits for the key generate\n"
" --curve=str Specify the curve used for EC key generation\n"
" --sec-param=str Specify the security level\n"
"\n"
"Writing objects:\n"
"\n"
" --set-id=str Set the CKA_ID (in hex) for the specified by the URL object\n"
" - prohibits the option 'write'\n"
" --set-label=str Set the CKA_LABEL for the specified by the URL object\n"
" - prohibits these options:\n"
" write\n"
" set-id\n"
" --write Writes the loaded objects to a PKCS #11 token\n"
" --delete Deletes the objects matching the given PKCS #11 URL\n"
" --label=str Sets a label for the write operation\n"
" --id=str Sets an ID for the write operation\n"
" --mark-wrap Marks the generated key to be a wrapping key\n"
" --mark-trusted Marks the object to be written as trusted\n"
" - prohibits the option 'mark-distrusted'\n"
" --mark-distrusted When retrieving objects, it requires the objects to be distrusted (blacklisted)\n"
" - prohibits the option 'mark-trusted'\n"
" --mark-decrypt Marks the object to be written for decryption\n"
" --mark-sign Marks the object to be written for signature generation\n"
" --mark-ca Marks the object to be written as a CA\n"
" --mark-private Marks the object to be written as private\n"
" --ca an alias for the 'mark-ca' option\n"
" --private an alias for the 'mark-private' option\n"
" --mark-always-authenticate Marks the object to be written as always authenticate\n"
" --secret-key=str Provide a hex encoded secret key\n"
" --load-privkey=file Private key file to use\n"
" - file must pre-exist\n"
" --load-pubkey=file Public key file to use\n"
" - file must pre-exist\n"
" --load-certificate=file Certificate file to use\n"
" - file must pre-exist\n"
"\n"
"Other options:\n"
"\n"
" -d, --debug=num Enable debugging\n"
" - it must be in the range:\n"
" 0 to 9999\n"
" --outfile=str Output file\n"
" --login Force (user) login to token\n"
" --so-login Force security officer login to token\n"
" --admin-login an alias for the 'so-login' option\n"
" --test-sign Tests the signature operation of the provided object\n"
" --sign-params=str Sign with a specific signature algorithm\n"
" --hash=str Hash algorithm to use for signing\n"
" --generate-random=num Generate random data\n"
" -8, --pkcs8 Use PKCS #8 format for private keys\n"
" --inder Use DER/RAW format for input\n"
" --inraw an alias for the 'inder' option\n"
" --outder Use DER format for output certificates, private keys, and DH parameters\n"
" --outraw an alias for the 'outder' option\n"
" --provider=file Specify the PKCS #11 provider library\n"
" --detailed-url Print detailed URLs\n"
" --only-urls Print a compact listing using only the URLs\n"
" --batch Disable all interaction with the tool\n"
"\n"
"Version, usage and configuration options:\n"
"\n"
" -v, --version[=arg] output version information and exit\n"
" -h, --help display extended usage information and exit\n"
" -!, --more-help extended usage information passed thru pager\n"
"\n"
"Options are specified by doubled hyphens and their name or by a single\n"
"hyphen and the flag character.\n"
"Operands and options may be intermixed. They will be reordered.\n"
"\n"
"Program that allows operations on PKCS #11 smart cards\n"
"and security modules. \n"
"\n"
"To use PKCS #11 tokens with GnuTLS the p11-kit configuration files need to be setup.\n"
"That is create a .module file in /etc/pkcs11/modules with the contents 'module: /path/to/pkcs11.so'.\n"
"Alternatively the configuration file /etc/gnutls/pkcs11.conf has to exist and contain a number\n"
"of lines of the form 'load=/usr/lib/opensc-pkcs11.so'.\n"
"\n"
"You can provide the PIN to be used for the PKCS #11 operations with the environment variables\n"
"GNUTLS_PIN and GNUTLS_SO_PIN.\n"
"\n"
"\n"
"Please send bug reports to: <bugs@gnutls.org>\n"
"\n";
fprintf (out, "%s", str);
exit (status);
}
| void usage(FILE *param_1,int param_2)
{
long lVar1;
undefined8 *puVar2;
undefined8 *puVar3;
long in_FS_OFFSET;
undefined8 local_1908 [799];
undefined8 local_10;
local_10 = *(undefined8 *)(in_FS_OFFSET + 0x28);
puVar2 = (undefined8 *)
"p11tool - GnuTLS PKCS #11 tool\nUsage: p11tool [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [url]\n\nNone:\n\n\nTokens:\n\n --list-tokens List all available tokens\n --list-token-urls List the URLs available tokens\n --list-mechanisms List all available mechanisms in a token\n --initialize Initializes a PKCS #11 token\n --initialize-pin Initializes/Resets a PKCS #11 token user PIN\n --initialize-so-pin Initializes/Resets a PKCS #11 token security officer PIN\n --set-pin=str Specify the PIN to use on token operations\n --set-so-pin=str Specify the Security Officer\'s PIN to use on token initialization\n\nObject listing:\n\n --list-all List all available objects in a token\n --list-all-certs List all available certificates in a token\n --list-certs List all certificates that have an associated private key\n --list-all-privkeys List all available private keys in a token\n --list-privkeys an alias for the \'list-all-privkeys\' option\n --list-keys an alias for the \'list-all-privkeys\' option\n --list-all-trusted List all available certificates marked as trusted\n --export Export the object specified by the URL\n\t\t\t\t- prohibits these options:\n\t\t\t\texport-stapled\n\t\t\t\texport-chain\n\t\t\t\texport-pubkey\n --export-stapled Export the certificate object specified by the URL\n\t\t\t\t- prohibits these options:\n\t\t\t\texport\n\t\t\t\texport-chain\n\t\t\t\texport-pubkey\n --export-chain Export the certificate specified by the URL and its chain of trust\n\t\t\t\t- prohibits these options:\n\t\t\t\texport-stapled\n\t\t\t\texport\n\t\t\t\texport-pubkey\n --export-pubkey Export the public key for a private key\n\t\t\t\t- prohibits these options:\n\t\t\t\texport-stapled\n\t\t\t\texport\n\t\t\t\texport-chain\n --info List information on an available object in a token\n --trusted an alias for the \'mark-trusted\' option\n --distrusted..."
;
puVar3 = local_1908;
for (lVar1 = 799; lVar1 != 0; lVar1 = lVar1 + -1) {
*puVar3 = *puVar2;
puVar2 = puVar2 + 1;
puVar3 = puVar3 + 1;
}
fprintf(param_1,"%s",local_1908);
exit(param_2);
}
|
static char *
find_codeset (char *name, size_t *lenp)
{
char *cp, *language, *result;
cp = language = name;
result = (char *)0;
while (*cp && *cp != '_' && *cp != '@' && *cp != '+' && *cp != ',')
cp++;
if (language == cp)
{
*lenp = strlen (language);
result = language;
}
else
{
if (*cp == '_')
do
++cp;
while (*cp && *cp != '.' && *cp != '@' && *cp != '+' && *cp != ',' && *cp != '_');
result = cp;
if (*cp == '.')
do
++cp;
while (*cp && *cp != '@');
if (cp - result > 2)
{
result++;
*lenp = cp - result;
}
else
{
*lenp = strlen (language);
result = language;
}
}
return result;
}
| const char * find_codeset(const char *a1, size_t *a2)
{
const char *i;
const char *v4;
const char *v5;
for ( i = a1; *i && *i != 95 && *i != 64 && *i != 43 && *i != 44; ++i )
;
if ( a1 == i )
goto LABEL_21;
if ( *i == 95 )
{
do
++i;
while ( *i && *i != 46 && *i != 64 && *i != 43 && *i != 44 && *i != 95 );
}
v4 = i;
if ( *i == 46 )
{
do
++i;
while ( *i && *i != 64 );
}
if ( i - v4 <= 2 )
{
LABEL_21:
*a2 = strlen(a1);
return a1;
}
else
{
v5 = v4 + 1;
*a2 = i - v5;
}
return v5;
}
|
void
stifle_history(int max)
{
HistEvent ev;
HIST_ENTRY *he;
if (h ==
((void *)0)
|| e ==
((void *)0)
)
rl_initialize();
if (history(h, &ev, 1, max) == 0) {
max_input_history = max;
if (history_length > max)
history_base = history_length - max;
while (history_length > max) {
he = remove_history(0);
free(he->data);
free((void *)(unsigned long)he->line);
free(he);
}
}
}
| long long stifle_history(unsigned long a0) {
unsigned long long v0[2];
char v1;
if (!h || !e)
rl_initialize();
if (history(h, &v1, 0x1, a0))
return 0;
*(got.max_input_history) = a0;
if (a0 < *(got.history_length))
*(got.history_base) = *(got.history_length) - a0;
while (a0 < *(got.history_length)) {
v0[0] = remove_history(0x0);
free(v0[1]);
free(v0[0]);
free(v0);
}
return 0;
}
|
static
_Bool
parse_mmin (const struct parser_table* entry, char **argv, int *arg_ptr)
{
return do_parse_xmin (entry, argv, arg_ptr, XVAL_MTIME);
}
| long parse_mmin(long a1, long a2, int *a3)
{
return do_parse_xmin(a1, a2, a3, 3);
}
|
char *
_rmescapes(char *str, int flag)
{
char *p, *q, *r;
int notescaped;
int globbing;
p = strpbrk(str, qchars);
if (!p) {
return str;
}
q = p;
r = str;
if (flag & 0x1) {
size_t len = p - str;
size_t fulllen = len + strlen(p) + 1;
if (flag & 0x8) {
int strloc = str - (char *)((void *)stacknxt);
r = makestrspace(fulllen, expdest);
str = (char *)((void *)stacknxt) + strloc;
p = str + len;
} else if (flag & 0x10) {
r = ckmalloc(fulllen);
} else {
r = stalloc(fulllen);
}
q = r;
if (len > 0) {
q = mempcpy(q, str, len);
}
}
globbing = flag & 0x2;
notescaped = globbing;
while (*p) {
if (*p == (char)-120) {
p++;
notescaped = globbing;
continue;
}
if (*p == '\\') {
notescaped = 0;
goto copy;
}
if (*p == (char)-127) {
p++;
if (notescaped)
*q++ = '\\';
}
notescaped = globbing;
copy:
*q++ = *p++;
}
*q = '\0';
if (flag & 0x8) {
expdest = r;
(expdest += (q - r + 1));
}
return r;
}
| int _rmescapes(unsigned long a0, unsigned long a1) {
char *v0;
int tmp_10;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned long v4;
char *v5;
char *v6;
unsigned int v7;
unsigned long long v8;
char *v10;
char *v11;
v0 = a0;
v4 = strpbrk(v0, &qchars);
if (!v4) {
v10 = v0;
} else {
v5 = v4;
v6 = v0;
if ((a1 & 1)) {
*(&v7) = v4 - v0;
v8 = strlen(v4) + *(&v7) + 1;
if ((a1 & 8)) {
v2 = &v0[-1 * stacknxt];
v6 = makestrspace(v8, expdest, expdest);
v0 = v2 + stacknxt;
v4 = &v0[*(&v7)];
} else if ((a1 & 16)) {
v6 = ckmalloc(v8);
} else {
v6 = stalloc(v8);
}
v5 = v6;
if (*(&v7))
v5 = mempcpy(v5, v0, *(&v7));
}
v3 = a1 & 2;
v1 = v3;
while (*(v4)) {
if (*(v4) == 136) {
v4 += 1;
v1 = v3;
} else {
if (*(v4) == 92) {
v1 = 0;
} else {
if (*(v4) == 129) {
v4 += 1;
if (v1) {
v11 = v5;
v5 += 1;
*(v11) = 92;
}
}
v1 = v3;
}
tmp_10 = v4;
v4 += 1;
v10 = v5;
v5 += 1;
*(v10) = *(tmp_10);
}
}
*(v5) = 0;
if ((a1 & 8)) {
expdest = v6;
expdest = 1 + v5 + -0x1 * v6 + expdest;
}
*(&v10) = v6;
}
return v10;
}
|
int ssh_hmac_final(struct ssh_hmac_ctx *ctx, u_char *d, size_t dlen)
__attribute__(());
void ssh_hmac_free(struct ssh_hmac_ctx *ctx);
struct ssh_hmac_ctx {
int alg;
struct ssh_digest_ctx *ictx;
struct ssh_digest_ctx *octx;
struct ssh_digest_ctx *digest;
u_char *buf;
size_t buf_len;
};
| long ssh_hmac_final(_QWORD *a1, long a2, unsigned long a3)
{
unsigned long v5;
v5 = ssh_digest_bytes(*(unsigned int *)a1);
if ( a3 < v5 || (unsigned int)ssh_digest_final(a1[3], a1[4], v5) )
return 0xFFFFFFFFLL;
if ( (int)ssh_digest_copy_state(a1[2], a1[3]) >= 0
&& (int)ssh_digest_update(a1[3], a1[4], v5) >= 0
&& (int)ssh_digest_final(a1[3], a2, a3) >= 0 )
{
return 0LL;
}
return 0xFFFFFFFFLL;
}
|
struct builtin *
builtin_address_internal (name, disabled_okay)
char *name;
int disabled_okay;
{
int hi, lo, mid, j;
hi = num_shell_builtins - 1;
lo = 0;
while (lo <= hi)
{
mid = (lo + hi) / 2;
j = shell_builtins[mid].name[0] - name[0];
if (j == 0)
j = strcmp (shell_builtins[mid].name, name);
if (j == 0)
{
if (shell_builtins[mid].function &&
((shell_builtins[mid].flags & 0x02) == 0) &&
((shell_builtins[mid].flags & 0x01) || disabled_okay))
return (&shell_builtins[mid]);
else
return ((struct builtin *)
((void *)0)
);
}
if (j > 0)
hi = mid - 1;
else
lo = mid + 1;
}
return ((struct builtin *)
((void *)0)
);
}
| int builtin_address_internal(char *a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v5;
v0 = num_shell_builtins - 1;
v1 = 0;
while (true) {
if (v1 > v0) {
v5 = 0;
return v5;
}
v3 = v0 + v1 + (v0 + v1 >> 31) >> 1;
v2 = *(*((v3 * 48 + shell_builtins))) - *(a0);
if (!v2)
v2 = strcmp(*((v3 * 48 + shell_builtins)), a0);
if (!v2)
break;
if (v2 > 0)
v0 = v3 - 1;
else
v1 = v3 + 1;
}
if (!*((((v3 << 1) + v3 << 4) + shell_builtins + 8))) {
v5 = 0;
return v5;
} else if ((*((((v3 << 1) + v3 << 4) + shell_builtins + 16)) & 2)) {
v5 = 0;
return v5;
} else {
if (!(*((((v3 << 1) + v3 << 4) + shell_builtins + 16)) & 1) && !a1) {
v5 = 0;
return v5;
}
v5 = v3 * 48 + shell_builtins;
return v5;
}
}
|
static void
print_files (int number_of_files, char **av)
{
init_parameters (number_of_files);
if (! init_fps (number_of_files, av))
return;
if (storing_columns)
init_store_cols ();
if (first_page_number > 1)
{
if (!skip_to_page (first_page_number))
return;
else
page_number = first_page_number;
}
else
page_number = 1;
init_funcs ();
line_number = line_count;
while (print_page ())
;
}
| long print_files(unsigned int a1, const char **a2)
{
long result;
int v3;
init_parameters(a1);
result = (unsigned int)init_fps(a1, a2) ^ 1;
if ( !(_BYTE)result )
{
if ( storing_columns )
init_store_cols(a1, (long)a2);
if ( (unsigned long)first_page_number <= 1 )
{
page_number = 1LL;
}
else
{
LOBYTE(v3) = skip_to_page(first_page_number);
result = v3 ^ 1u;
if ( (_BYTE)result )
return result;
page_number = first_page_number;
}
init_funcs();
line_number = line_count;
do
result = print_page();
while ( (_BYTE)result );
}
return result;
}
|
static void
process_read(u_int32_t id)
{
static u_char *buf;
static size_t buflen;
u_int32_t len;
int r, handle, fd, ret, status = 4;
u_int64_t off;
if ((r = get_handle(iqueue, &handle)) != 0 ||
(r = sshbuf_get_u64(iqueue, &off)) != 0 ||
(r = sshbuf_get_u32(iqueue, &len)) != 0)
sshfatal("sftp-server.c", __func__, 810, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse");
sshlog("sftp-server.c", __func__, 812, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "request %u: read \"%s\" (handle %d) off %llu len %u", id, handle_to_name(handle), handle, (unsigned long long)off, len)
;
if ((fd = handle_to_fd(handle)) == -1)
goto out;
if (len > ((256 * 1024) - 1024)) {
sshlog("sftp-server.c", __func__, 817, 0, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "read change len %u to %u", len, ((256 * 1024) - 1024));
len = ((256 * 1024) - 1024);
}
if (len > buflen) {
sshlog("sftp-server.c", __func__, 821, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "allocate %zu => %u", buflen, len);
if ((buf = realloc(
((void *)0)
, len)) ==
((void *)0)
)
sshfatal("sftp-server.c", __func__, 823, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "realloc failed");
buflen = len;
}
if (lseek(fd, off,
0
) == -1) {
status = errno_to_portable(
(*__errno_location ())
);
sshlog("sftp-server.c", __func__, 828, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "seek \"%.100s\": %s", handle_to_name(handle), strerror(
(*__errno_location ())
))
;
goto out;
}
if (len == 0) {
ret = 0;
} else if ((ret = read(fd, buf, len)) == -1) {
status = errno_to_portable(
(*__errno_location ())
);
sshlog("sftp-server.c", __func__, 837, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "read \"%.100s\": %s", handle_to_name(handle), strerror(
(*__errno_location ())
))
;
goto out;
} else if (ret == 0) {
status = 1;
goto out;
}
send_data(id, buf, ret);
handle_update_read(handle, ret);
status = 0;
out:
if (status != 0)
send_status(id, status);
}
| long long process_read(unsigned long a0) {
unsigned long long v0;
unsigned int v1;
unsigned int v2;
char v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
char v8;
unsigned long long v9;
unsigned long v10;
unsigned long long v11;
unsigned long v12;
unsigned long long v13;
unsigned long v14;
char v15;
unsigned long long v18;
unsigned long long v19;
unsigned long long v21;
unsigned long long v22;
v1 = a0;
v6 = 4;
v4 = get_handle(0xe87d894820ec8348, &v3);
if (!v4) {
v4 = sshbuf_get_u64(0xe87d894820ec8348, &v8, &v8);
if (!v4) {
v4 = sshbuf_get_u32(0xe87d894820ec8348, &v2);
if (!v4)
goto LABEL_4022e2;
}
}
v0 = "parse";
sshfatal("sftp-server.c", "process_read", 0x32a, 0x1, 0x1, ssh_err(v4));
LABEL_4022e2:
v18 = *(&v8);
v19 = *(&v3);
v14 = v2;
v13 = v18;
v12 = v19;
v11 = handle_to_name(*(&v3));
v10 = v1;
v9 = "request %u: read \"%s\" (handle %d) off %llu len %u";
sshlog("sftp-server.c", "process_read", 0x32c, 0x0, 0x5, 0x0, *(&v15));
v7 = handle_to_fd(*(&v3));
if (v7 != -1) {
if (v2 > 0x3fc00) {
v13 = 0x3fc00;
v12 = v2;
v11 = "read change len %u to %u";
sshlog("sftp-server.c", "process_read", 0x331, 0x0, 0x6, 0x0, *(&v15));
v2 = 0x3fc00;
}
if (v2 > buflen.13119) {
v13 = v2;
v12 = buflen.13119;
v11 = "allocate %zu => %u";
sshlog("sftp-server.c", "process_read", 0x335, 0x1, 0x7, 0x0, *(&v15));
buf.13118 = realloc(NULL, v2);
if (!buf.13118) {
v13 = "realloc failed";
sshfatal("sftp-server.c", "process_read", 0x337, 0x1, 0x1, 0x0);
}
buflen.13119 = v2;
}
if (lseek(v7, *(&v8), 0x0) == -1) {
v6 = errno_to_portable(*(__errno_location()));
v21 = *(&v3);
v13 = strerror(*(__errno_location()));
v12 = handle_to_name(v21);
v11 = "seek \"%.100s\": %s";
sshlog("sftp-server.c", "process_read", 0x33c, 0x1, 0x2, 0x0, *(&v15));
} else {
if (!v2) {
v5 = 0;
} else {
v5 = read(v7, buf.13118, v2);
if (v5 == -1) {
v6 = errno_to_portable(*(__errno_location()));
v22 = *(&v3);
v13 = strerror(*(__errno_location()));
v12 = handle_to_name(v22);
v11 = "read \"%.100s\": %s";
sshlog("sftp-server.c", "process_read", 0x345, 0x1, 0x2, 0x0, *(&v15));
goto LABEL_4025ea;
}
if (!v5) {
v6 = 1;
goto LABEL_4025ea;
}
}
send_data(v1, buf.13118, v5);
handle_update_read(*(&v3), v5);
v6 = 0;
}
}
LABEL_4025ea:
if (v6)
send_status(v1, v6);
return 0;
}
|
static void
display_changed (struct termios *mode)
{
int i;
_Bool
empty_line;
tcflag_t *bitsp;
unsigned long mask;
enum mode_type prev_type = control;
display_speed (mode,
1
);
wrapf ("line = %d;", mode->c_line);
putchar_unlocked ('\n');
current_col = 0;
empty_line =
1
;
for (i = 0; !(strcmp (control_info[i].name, "min") == 0); ++i)
{
if (mode->c_cc[control_info[i].offset] == control_info[i].saneval)
continue;
if ((strcmp (control_info[i].name, "flush") == 0))
continue;
empty_line =
0
;
wrapf ("%s = %s;", control_info[i].name,
visible (mode->c_cc[control_info[i].offset]));
}
if ((mode->c_lflag &
0000002
) == 0)
{
wrapf ("min = %lu; time = %lu;\n",
(unsigned long int) mode->c_cc[
6
],
(unsigned long int) mode->c_cc[
5
]);
}
else if (!empty_line)
putchar_unlocked ('\n');
current_col = 0;
empty_line =
1
;
for (i = 0; mode_info[i].name !=
((void *)0)
; ++i)
{
if (mode_info[i].flags & 8)
continue;
if (mode_info[i].type != prev_type)
{
if (!empty_line)
{
putchar_unlocked ('\n');
current_col = 0;
empty_line =
1
;
}
prev_type = mode_info[i].type;
}
bitsp = mode_type_flag (mode_info[i].type, mode);
mask = mode_info[i].mask ? mode_info[i].mask : mode_info[i].bits;
((void) sizeof ((
bitsp
) ? 1 : 0), __extension__ ({ if (
bitsp
) ; else __assert_fail (
"bitsp"
, "src/stty.c", 1953, __extension__ __PRETTY_FUNCTION__); }))
;
if ((*bitsp & mask) == mode_info[i].bits)
{
if (mode_info[i].flags & 2)
{
wrapf ("%s", mode_info[i].name);
empty_line =
0
;
}
}
else if ((mode_info[i].flags & (1 | 4)) == (1 | 4))
{
wrapf ("-%s", mode_info[i].name);
empty_line =
0
;
}
}
if (!empty_line)
putchar_unlocked ('\n');
current_col = 0;
}
| void display_changed(struct_0 *a0) {
char v0;
unsigned int v1;
unsigned int v2;
unsigned int *v3;
unsigned long v4;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
v2 = 0;
display_speed(a0, 0x1);
wrapf();
putchar_unlocked(0xa);
current_col = 0;
v0 = 1;
for (v1 = 0; strcmp(control_info[2 * v1 + v1], "min"); v1 += 1) {
if (a0[1].padding_0[1 + g_406ff0[2 * v1 + v1]] != g_406fe8[16 * v1 + 8 * v1] && strcmp(control_info[2 * v1 + v1], "flush")) {
v0 = 0;
visible(a0[1].padding_0[1 + g_406ff0[3 * v1]]);
wrapf();
}
}
if (!(a0->field_c & 2)) {
wrapf();
} else if ((v0 ^ 1)) {
putchar_unlocked(0xa);
}
current_col = 0;
v0 = 1;
for (v1 = 0; mode_info[4 * v1]; v1 += 1) {
if (!(g_4064ac[32 * v1] & 8)) {
if (v2 != g_4064a8[8 * v1]) {
if ((v0 ^ 1)) {
putchar_unlocked(0xa);
current_col = 0;
v0 = 1;
}
v2 = g_4064a8[8 * v1];
}
v3 = mode_type_flag(g_4064a8[8 * v1], a0);
if (!g_4064b8[4 * v1])
v6 = g_4064b0[4 * v1];
else
v6 = g_4064b8[4 * v1];
v4 = v6;
if (!v3) {
__assert_fail();
} else if ((*(v3) & v4) != g_4064b0[4 * v1]) {
if ((g_4064ac[32 * v1] & 5) == 5) {
wrapf();
v0 = 0;
}
} else {
if ((g_4064ac[32 * v1] & 2)) {
wrapf();
v0 = 0;
}
}
}
}
v7 = v0 ^ 1;
if ((v0 ^ 1))
v8 = putchar_unlocked(0xa);
current_col = 0;
return;
}
|
static int
fstat_for_ino (int fd, struct stat *st)
{
return do_statx (fd, "", st,
0x1000
,
0x00000100U
);
}
| int fstat_for_ino(unsigned long a0, void* a1) {
return do_statx(a0, &g_40bb1b, a1, 0x1000, 0x100);
}
|
static void
locale_setblanks ()
{
int x;
for (x = 0; x < sh_syntabsiz; x++)
{
if (
((*__ctype_b_loc ())[(int) ((
(unsigned char)x
))] & (unsigned short int) _ISblank)
)
sh_syntaxtab[x] |= 0x0002|0x2000;
else if (((x) ? ((char *)mbschr (("()<>;&| \t\n"), (x)) != (char *)
((void *)0)
) : 0))
{
sh_syntaxtab[x] |= 0x0002;
sh_syntaxtab[x] &= ~0x2000;
}
else
sh_syntaxtab[x] &= ~(0x0002|0x2000);
}
}
| void locale_setblanks(void)
{
ushort **ppuVar1;
long lVar2;
uint local_c;
local_c = 0;
do {
if (sh_syntabsiz <= (int)local_c) {
return;
}
ppuVar1 = __ctype_b_loc();
if (((*ppuVar1)[local_c & 0xff] & 1) == 0) {
if (local_c != 0) {
lVar2 = mbschr("()<>;&| \t\n",local_c);
if (lVar2 != 0) {
*(uint *)(&sh_syntaxtab + (long)(int)local_c * 4) =
*(uint *)(&sh_syntaxtab + (long)(int)local_c * 4) | 2;
*(uint *)(&sh_syntaxtab + (long)(int)local_c * 4) =
*(uint *)(&sh_syntaxtab + (long)(int)local_c * 4) & 0xffffdfff;
goto LAB_00101370;
}
}
*(uint *)(&sh_syntaxtab + (long)(int)local_c * 4) =
*(uint *)(&sh_syntaxtab + (long)(int)local_c * 4) & 0xffffdffd;
}
else {
*(uint *)(&sh_syntaxtab + (long)(int)local_c * 4) =
*(uint *)(&sh_syntaxtab + (long)(int)local_c * 4) | 0x2002;
}
LAB_00101370:
local_c = local_c + 1;
} while( true );
}
|
static int
input_kex_dh_gex_group(int type, u_int32_t seq, struct ssh *ssh)
{
struct kex *kex = ssh->kex;
BIGNUM *p =
((void *)0)
, *g =
((void *)0)
;
const BIGNUM *pub_key;
int r, bits;
sshlog("kexgexc.c", __func__, 102, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "SSH2_MSG_KEX_DH_GEX_GROUP received");
ssh_dispatch_set(ssh, 31, &kex_protocol_error);
if ((r = sshpkt_get_bignum2(ssh, &p)) != 0 ||
(r = sshpkt_get_bignum2(ssh, &g)) != 0 ||
(r = sshpkt_get_end(ssh)) != 0)
goto out;
if ((bits = BN_num_bits(p)) < 0 ||
(u_int)bits < kex->min || (u_int)bits > kex->max) {
r = -28;
goto out;
}
if ((kex->dh = dh_new_group(g, p)) ==
((void *)0)
) {
r = -2;
goto out;
}
p = g =
((void *)0)
;
if ((r = dh_gen_key(kex->dh, kex->we_need * 8)) != 0)
goto out;
DH_get0_key(kex->dh, &pub_key,
((void *)0)
);
if ((r = sshpkt_start(ssh, 32)) != 0 ||
(r = sshpkt_put_bignum2(ssh, pub_key)) != 0 ||
(r = sshpkt_send(ssh)) != 0)
goto out;
sshlog("kexgexc.c", __func__, 128, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "SSH2_MSG_KEX_DH_GEX_INIT sent");
sshlog("kexgexc.c", __func__, 135, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "expecting SSH2_MSG_KEX_DH_GEX_REPLY");
ssh_dispatch_set(ssh, 33, &input_kex_dh_gex_reply);
r = 0;
out:
BN_clear_free(p);
BN_clear_free(g);
return r;
}
| long long input_kex_dh_gex_group(unsigned long a0, unsigned long a1, struct_0 *a2) {
char v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
void* v5;
void* v6;
char v7;
struct_1 *v8;
v2 = a0;
v1 = a1;
v8 = a2->field_8;
v5 = 0;
v6 = 0;
sshlog("kexgexc.c", "input_kex_dh_gex_group", 0x66, 0x0, 0x5, 0x0, "SSH2_MSG_KEX_DH_GEX_GROUP received", *(&v0), a2);
ssh_dispatch_set(a2, 0x1f, got.kex_protocol_error);
v3 = sshpkt_get_bignum2(a2, &v5, &v5);
if (!v3) {
v3 = sshpkt_get_bignum2(a2, &v6, &v6);
if (!v3) {
v3 = sshpkt_get_end(a2);
if (!v3) {
v4 = BN_num_bits(v5);
if (v4 >= 0 && v8->field_120 <= v4 && v8->field_124 >= v4) {
v8->field_118 = dh_new_group(v6, v5, v5);
if (!v8->field_118) {
v3 = -2;
} else {
v6 = 0;
v5 = v6;
v3 = dh_gen_key(v8->field_118, v8->field_10 * 8, v8->field_10 * 8);
if (!v3) {
DH_get0_key(v8->field_118, &v7, 0x0, &v7);
v3 = sshpkt_start(a2, 0x20);
if (!v3) {
v3 = sshpkt_put_bignum2(a2, *(&v7), *(&v7));
if (!v3) {
v3 = sshpkt_send(a2);
if (!v3) {
sshlog("kexgexc.c", "input_kex_dh_gex_group", 0x80, 0x0, 0x5, 0x0, "SSH2_MSG_KEX_DH_GEX_INIT sent", *(&v0), a2);
sshlog("kexgexc.c", "input_kex_dh_gex_group", 0x87, 0x0, 0x5, 0x0, "expecting SSH2_MSG_KEX_DH_GEX_REPLY", *(&v0), a2);
ssh_dispatch_set(a2, 0x21, input_kex_dh_gex_reply);
v3 = 0;
}
}
}
}
}
}
if (v4 < 0 || v8->field_124 < v4 || v8->field_120 > v4)
v3 = -28;
}
}
}
BN_clear_free(v5);
BN_clear_free(v6);
return v3;
}
|
static void lastlog_reset (uid_t uid)
{
struct lastlog ll;
int fd;
off_t offset_uid = (off_t) (sizeof ll) * uid;
uid_t max_uid;
struct stat st;
if (stat ("/var/log/lastlog", &st) != 0 || st.st_size <= offset_uid) {
return;
}
max_uid = (uid_t) getdef_ulong ("LASTLOG_UID_MAX", 0xFFFFFFFFUL);
if (uid > max_uid) {
return;
}
explicit_bzero((&ll), (sizeof (ll)));
fd = open ("/var/log/lastlog",
02
);
if (-1 == fd) {
fprintf (
stderr
,
gettext ("%s: failed to open the lastlog file for UID %lu: %s\n"),
Prog, (unsigned long) uid, strerror (
(*__errno_location ())
));
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 (
4
, "failed to open the lastlog file for UID %lu", (unsigned long) uid) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
return;
}
if ( (lseek (fd, offset_uid,
0
) != offset_uid)
|| (write (fd, &ll, sizeof (ll)) != (ssize_t) sizeof (ll))
|| (fsync (fd) != 0)) {
fprintf (
stderr
,
gettext ("%s: failed to reset the lastlog entry of UID %lu: %s\n"),
Prog, (unsigned long) uid, strerror (
(*__errno_location ())
));
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 (
4
, "failed to reset the lastlog entry of UID %lu", (unsigned long) uid) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
}
if (close (fd) != 0) {
fprintf (
stderr
,
gettext ("%s: failed to close the lastlog file for UID %lu: %s\n"),
Prog, (unsigned long) uid, strerror (
(*__errno_location ())
));
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 (
4
, "failed to close the lastlog file for UID %lu", (unsigned long) uid) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
}
}
| void lastlog_reset(unsigned long a0) {
unsigned int v0;
unsigned int v1;
void* v2;
void* v3;
void* v4;
unsigned int v5;
char *v6;
char *v7;
char *v8;
char v9;
char v10;
char v11;
char v12;
unsigned short v15;
unsigned long long v16;
unsigned long long v17;
unsigned long long v20;
unsigned long long *v21;
unsigned long long v22;
*(&v5) = a0 * 292;
if (!stat("/var/log/lastlog", &v9) && *(&v5) < *(&v10)) {
v0 = getdef_ulong("LASTLOG_UID_MAX", 0xffffffff);
if (a0 <= v0) {
explicit_bzero(&v11, 0x124);
v1 = open("/var/log/lastlog", 0x2, v15);
if (v1 == -1) {
strerror(*(__errno_location()));
fprintf(*(&stderr), gettext("%s: failed to open the lastlog file for UID %lu: %s\n"));
v8 = setlocale(0x6, NULL);
v2 = 0;
if (v8)
v2 = strdup(v8);
if (v2)
setlocale(0x6, "C");
syslog(0x4, "failed to open the lastlog file for UID %lu");
if (v2) {
setlocale(0x6, v2);
free(v2);
}
} else {
v16 = lseek(v1, *(&v5), 0x0);
if (*(&v5) == v16)
v17 = write(v1, &v11, 0x124);
if (*(&v5) != v16 || fsync(v1) || v17 != 292) {
strerror(*(__errno_location()));
fprintf(*(&stderr), gettext("%s: failed to reset the lastlog entry of UID %lu: %s\n"));
v6 = setlocale(0x6, NULL);
v3 = 0;
if (v6)
v3 = strdup(v6);
if (v3)
setlocale(0x6, "C");
syslog(0x4, "failed to reset the lastlog entry of UID %lu");
if (v3) {
setlocale(0x6, v3);
free(v3);
}
}
if (close(v1)) {
v20 = strerror(*(__errno_location()));
fprintf(*(&stderr), gettext("%s: failed to close the lastlog file for UID %lu: %s\n"));
v7 = setlocale(0x6, NULL);
v4 = 0;
if (v7)
v4 = strdup(v7);
if (v4)
setlocale(0x6, "C");
syslog(0x4, "failed to close the lastlog file for UID %lu");
if (v4) {
setlocale(0x6, v4);
free(v4);
}
}
}
}
}
v22 = *(&v12) ^ v21[5];
return;
}
|
void
info_free_exclist (struct tar_stat_info *dir)
{
struct exclist *ep = dir->exclude_list;
while (ep)
{
struct exclist *next = ep->next;
free_exclude (ep->excluded);
free (ep);
ep = next;
}
dir->exclude_list =
((void *)0)
;
}
| long info_free_exclist(long a1)
{
long result;
_QWORD *ptr;
_QWORD *v3;
for ( ptr = *(_QWORD **)(a1 + 432); ptr; ptr = v3 )
{
v3 = (_QWORD *)*ptr;
free_exclude(ptr[3]);
free(ptr);
}
result = a1;
*(_QWORD *)(a1 + 432) = 0LL;
return result;
}
|
char *
sstrdup(const char *p)
{
size_t len = strlen(p) + 1;
return memcpy(stalloc(len), p, len);
}
| long long sstrdup(void* a0) {
unsigned long v0;
v0 = strlen(a0) + 1;
return memcpy(stalloc(v0), a0, v0);
}
|
int
addr_pton(const char *p, struct xaddr *n)
{
struct addrinfo hints, *ai;
memset(&hints, '\0', sizeof(hints));
hints.ai_flags =
0x0004
;
if (p ==
((void *)0)
|| getaddrinfo(p,
((void *)0)
, &hints, &ai) != 0)
return -1;
if (ai ==
((void *)0)
)
return -1;
if (ai->ai_addr ==
((void *)0)
) {
freeaddrinfo(ai);
return -1;
}
if (n !=
((void *)0)
&& addr_sa_to_xaddr(ai->ai_addr, ai->ai_addrlen,
n) == -1) {
freeaddrinfo(ai);
return -1;
}
freeaddrinfo(ai);
return 0;
}
| int addr_pton(unsigned long long a0, void* a1) {
char v0;
char v1;
unsigned int v3;
memset(&v1, 0x0, 0x30);
v1 = 4;
if (!a0) {
LABEL_4008c2:
v3 = -1;
} else {
if (!(!getaddrinfo(a0, 0x0, &v1, &v0)))
goto LABEL_4008c2;
if (!*(&v0)) {
v3 = -1;
} else if (!*((*(&v0) + 24))) {
freeaddrinfo(*(&v0));
v3 = -1;
} else {
if (a1 && addr_sa_to_xaddr(*((*(&v0) + 24)), *((*(&v0) + 16)), a1) == -1) {
freeaddrinfo(*(&v0));
v3 = -1;
goto LABEL_400946;
}
freeaddrinfo(*(&v0));
v3 = 0;
}
}
LABEL_400946:
return v3;
}
|
int compress2(dest, destLen, source, sourceLen, level)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
int level;
{
z_stream stream;
int err;
const uInt max = (uInt)-1;
uLong left;
left = *destLen;
*destLen = 0;
stream.zalloc = (alloc_func)0;
stream.zfree = (free_func)0;
stream.opaque = (voidpf)0;
err = deflateInit_((&stream), (level), "1.2.13", (int)sizeof(z_stream));
if (err != 0) return err;
stream.next_out = dest;
stream.avail_out = 0;
stream.next_in = ( Bytef *)source;
stream.avail_in = 0;
do {
if (stream.avail_out == 0) {
stream.avail_out = left > (uLong)max ? max : (uInt)left;
left -= stream.avail_out;
}
if (stream.avail_in == 0) {
stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen;
sourceLen -= stream.avail_in;
}
err = deflate(&stream, sourceLen ? 0 : 4);
} while (err == 0);
*destLen = stream.total_out;
deflateEnd(&stream);
return err == 1 ? 0 : err;
}
| void compress2(unsigned long a0, unsigned long long *a1, unsigned long a2, unsigned long a3, unsigned long a4) {
unsigned long v0;
unsigned long v1;
unsigned int v2;
unsigned int v3;
unsigned long v4;
char v5;
unsigned int v6;
unsigned long v7;
unsigned int v8;
char v9;
void* v10;
void* v11;
void* v12;
unsigned long long v14;
unsigned int v15;
unsigned int v16;
unsigned long long v17;
void* v18;
unsigned long long v19;
v1 = a2;
v0 = a3;
v2 = -1;
v4 = *(a1);
*(a1) = 0;
v10 = 0;
v11 = 0;
v12 = 0;
v3 = deflateInit_(&v5, a4, "1.2.13", 0x70);
if (v3) {
v14 = v3;
} else {
v7 = a0;
v8 = 0;
v5 = v1;
v6 = 0;
do {
if (!v8) {
if (v4 > v2)
v15 = v2;
else
v15 = v4;
v8 = v15;
v4 -= v8;
}
if (!v6) {
if (v0 > v2)
v16 = v2;
else
v16 = v0;
v6 = v16;
v0 -= v6;
}
if (v0)
v17 = 0;
else
v17 = 4;
v3 = deflate(&v5, v17);
} while (!v3);
*(a1) = *(&v9);
deflateEnd(&v5);
if (v3 == 1)
v18 = 0;
else
v19 = v3;
}
return;
}
|
static int
ssh_request_reply_decode(int sock, struct sshbuf *request)
{
struct sshbuf *reply;
int r;
u_char type;
if ((reply = sshbuf_new()) ==
((void *)0)
)
return -2;
if ((r = ssh_request_reply(sock, request, reply)) != 0 ||
(r = sshbuf_get_u8(reply, &type)) != 0 ||
(r = decode_reply(type)) != 0)
goto out;
r = 0;
out:
sshbuf_free(reply);
return r;
}
| int ssh_request_reply_decode(unsigned long a0, unsigned long long a1) {
char v0;
unsigned int v1;
unsigned long long v2;
unsigned int v4;
v2 = sshbuf_new();
if (!v2) {
v4 = -2;
} else {
v1 = ssh_request_reply(a0, a1, v2);
if (!v1) {
v1 = sshbuf_get_u8(v2, &v0, &v0);
if (!v1) {
v1 = decode_reply(v0);
if (!v1)
v1 = 0;
}
}
sshbuf_free(v2);
v4 = v1;
}
return v4;
}
|
static void
send_names(u_int32_t id, int count, const Stat *stats)
{
struct sshbuf *msg;
int i, r;
if ((msg = sshbuf_new()) ==
((void *)0)
)
sshfatal("sftp-server.c", __func__, 622, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new failed");
if ((r = sshbuf_put_u8(msg, 104)) != 0 ||
(r = sshbuf_put_u32(msg, id)) != 0 ||
(r = sshbuf_put_u32(msg, count)) != 0)
sshfatal("sftp-server.c", __func__, 626, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose");
sshlog("sftp-server.c", __func__, 627, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "request %u: sent names count %d", id, count);
for (i = 0; i < count; i++) {
if ((r = sshbuf_put_cstring(msg, stats[i].name)) != 0 ||
(r = sshbuf_put_cstring(msg, stats[i].long_name)) != 0 ||
(r = encode_attrib(msg, &stats[i].attrib)) != 0)
sshfatal("sftp-server.c", __func__, 632, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose filenames/attrib");
}
send_msg(msg);
sshbuf_free(msg);
}
| void send_names(unsigned long a0, unsigned long a1, unsigned long long *a2) {
unsigned long long v0;
unsigned long long v1;
unsigned int v2;
unsigned int v3;
unsigned long long v4;
char v5;
unsigned long long v7;
unsigned long long v8;
v4 = sshbuf_new();
if (!v4) {
v0 = "sshbuf_new failed";
sshfatal("sftp-server.c", "send_names", 0x26e, 0x1, 0x1, 0x0);
}
v3 = sshbuf_put_u8(v4, 0x68);
if (!v3) {
v3 = sshbuf_put_u32(v4, a0, a0);
if (!v3) {
v3 = sshbuf_put_u32(v4, a1, a1);
if (!v3)
goto LABEL_401522;
}
}
v4 = "compose";
sshfatal("sftp-server.c", "send_names", 0x272, 0x1, 0x1, ssh_err(v3));
LABEL_401522:
v4 = a1;
v2 = a0;
v1 = "request %u: sent names count %d";
sshlog("sftp-server.c", "send_names", 0x273, 0x0, 0x5, 0x0, *(&v5));
v2 = 0;
while (true) {
if (v2 >= v1)
break;
v3 = sshbuf_put_cstring(v4, a2[7 * v2], a2[7 * v2]);
if (!v3) {
v3 = sshbuf_put_cstring(v4, a2[1 + 7 * v2], a2[1 + 7 * v2]);
if (!v3) {
v3 = encode_attrib(v4, &a2[7 * v2 + 2], &a2[7 * v2 + 2]);
if (!v3)
goto LABEL_401662;
}
}
v7 = ssh_err(v3);
v4 = "compose filenames/attrib";
sshfatal("sftp-server.c", "send_names", 0x278, 0x1, 0x1, v7);
LABEL_401662:
v2 = __addvsi3(v2, 0x1);
}
send_msg(v4);
v8 = sshbuf_free(v4);
return;
}
|
static inline void
emit_backup_suffix_note (void)
{
fputs_unlocked (gettext ("\nThe backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\nThe version control method may be selected via the --backup option or through\nthe VERSION_CONTROL environment variable. Here are the values:\n\n"),
stdout
)
;
fputs_unlocked (gettext (" none, off never make backups (even if --backup is given)\n numbered, t make numbered backups\n existing, nil numbered if numbered backups exist, simple otherwise\n simple, never always make simple backups\n"),
stdout
)
;
}
| void emit_backup_suffix_note(void)
{
char *pcVar1;
FILE *pFVar2;
pFVar2 = stdout;
pcVar1 = (char *)gettext(
"\nThe backup suffix is \'~\', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\nThe version control method may be selected via the --backup option or through\nthe VERSION_CONTROL environment variable. Here are the values:\n\n"
);
fputs_unlocked(pcVar1,pFVar2);
pFVar2 = stdout;
pcVar1 = (char *)gettext(
" none, off never make backups (even if --backup is given)\n numbered, t make numbered backups\n existing, nil numbered if numbered backups exist, simple otherwise\n simple, never always make simple backups\n"
);
fputs_unlocked(pcVar1,pFVar2);
return;
}
|
char *
asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
{
va_list args;
char *result;
__builtin_va_start(
args
,
format
)
;
result = vasnprintf (resultbuf, lengthp, format, args);
__builtin_va_end(
args
)
;
return result;
}
| long long asnprintf() {
unsigned long v0;
unsigned int v1;
unsigned int v2;
unsigned long v3;
unsigned long v4;
unsigned long v5;
char v6;
unsigned long v7;
unsigned long v8;
unsigned long v9;
int v10;
int v11;
int v12;
int v13;
int v14;
int v15;
int v16;
int v17;
unsigned long v18;
unsigned long v19;
unsigned long v20;
unsigned long v21;
char v22;
int v23;
int v24;
int v25;
int v26;
int v27;
int v28;
int v29;
int v30;
unsigned long long *v31;
unsigned long long v32;
unsigned long long v33;
unsigned long long v34;
v7 = v19;
v8 = v20;
v9 = v21;
if (v22) {
v10 = v23;
v11 = v24;
v12 = v25;
v13 = v26;
v14 = v27;
v15 = v28;
v16 = v29;
v17 = v30;
}
v5 = v31[5];
v1 = 24;
v2 = 48;
v3 = &v18;
v4 = &v6;
v0 = vasnprintf(v32, v33, v34, &v1);
if ((v5 ^ v31[5]))
__stack_chk_fail();
return v0;
}
|
static
_Bool
has_capability_cache (char const *file, struct fileinfo *f)
{
static dev_t unsupported_device;
if (f->stat.st_dev == unsupported_device)
{
(*__errno_location ())
=
95
;
return 0;
}
_Bool
b = has_capability (file);
if ( !b && errno_unsupported (
(*__errno_location ())
))
unsupported_device = f->stat.st_dev;
return b;
}
| _BOOL8 has_capability_cache(long a1, long a2)
{
int *v3;
bool v4;
if ( *(_QWORD *)(a2 + 24) == unsupported_device_9573 )
{
*_errno_location() = 95;
return 0LL;
}
else
{
v4 = has_capability(a1);
if ( !v4 )
{
v3 = _errno_location();
if ( errno_unsupported(*v3) )
unsupported_device_9573 = *(_QWORD *)(a2 + 24);
}
return v4;
}
}
|
off_t gzoffset(file)
gzFile file;
{
off64_t ret;
ret = gzoffset64(file);
return ret == (off_t)ret ? (off_t)ret : -1;
}
| long long gzoffset(void* a0) {
unsigned long v0;
v0 = gzoffset64(a0);
return v0;
}
|
static void
save_to_hold_area (char *start, idx_t num)
{
free (hold_area);
hold_area = start;
hold_count = num;
}
| void save_to_hold_area(unsigned long long a0, unsigned long long a1) {
unsigned long long v1;
free(hold_area);
hold_area = a0;
v1 = a1;
hold_count = a1;
return;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.