input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
static int
_verify_passwd_int(const char *username, const char *passwd,
char *verifier, const char *salt,
const gnutls_datum_t * g, const gnutls_datum_t * n)
{
char _salt[1024];
gnutls_datum_t tmp, raw_salt, new_verifier;
size_t salt_size;
char *pos;
if (salt ==
((void *)0)
|| verifier ==
((void *)0)
)
return -1;
if (strlen(salt) >= sizeof(_salt)) {
fprintf(
stderr
, "Too long salt.\n");
return -1;
}
strcpy(_salt, salt);
pos = strchr(_salt, ':');
if (pos !=
((void *)0)
)
*pos = 0;
tmp.data = (void *) _salt;
tmp.size = strlen(_salt);
if (gnutls_srp_base64_decode2(&tmp, &raw_salt) < 0) {
fprintf(
stderr
, "Could not decode salt.\n");
return -1;
}
if (gnutls_srp_verifier
(username, passwd, &raw_salt, g, n, &new_verifier) < 0) {
fprintf(
stderr
, "Could not make the verifier\n");
return -1;
}
free(raw_salt.data);
salt_size = sizeof(_salt);
memset(_salt, 0, salt_size);
if (gnutls_srp_base64_encode(&new_verifier, _salt, &salt_size) < 0) {
fprintf(
stderr
, "Encoding error\n");
return -1;
}
free(new_verifier.data);
if (strncmp(verifier, _salt, strlen(_salt)) == 0) {
fprintf(
stderr
, "Password verified\n");
return 0;
} else {
fprintf(
stderr
, "Password does NOT match\n");
}
return -1;
}
| void _verify_passwd_int(unsigned long long a0, unsigned long long a1, char *a2, char *a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v0;
char *v1;
unsigned long v2;
unsigned int v3;
char v4;
char v5;
char v6;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
void* v13;
unsigned long long v14;
if (!a3) {
LABEL_40057d:
v8 = 4294967295;
} else {
if (!a2)
goto LABEL_40057d;
if (strlen(a3) > 1023) {
fprintf(*(&stderr), "Too long salt.\n");
v9 = 4294967295;
} else {
strcpy(&v6, a3);
v1 = strchr(&v6, 0x3a);
if (v1)
*(v1) = 0;
v2 = &v6;
v3 = strlen(&v6);
if (gnutls_srp_base64_decode2(&v2, &v4, &v4) < 0) {
fprintf(*(&stderr), "Could not decode salt.\n");
v10 = 4294967295;
} else if (gnutls_srp_verifier(a0, a1, &v4, a4, a5, &v5) < 0) {
fprintf(*(&stderr), "Could not make the verifier\n");
v11 = 4294967295;
} else {
free(*(&v4));
v0 = 0x400;
memset(&v6, 0x0, v0);
if (gnutls_srp_base64_encode(&v5, &v6, &v0, &v6) < 0) {
fprintf(*(&stderr), "Encoding error\n");
v12 = 4294967295;
} else {
free(*(&v5));
if (!strncmp(a2, &v6, strlen(&v6))) {
fprintf(*(&stderr), "Password verified\n");
v13 = 0;
} else {
fprintf(*(&stderr), "Password does NOT match\n");
v14 = 4294967295;
}
}
}
}
}
return;
}
|
int
strvis(char *mbdst, const char *mbsrc, int flags)
{
return istrsenvisxl(&mbdst,
((void *)0)
, mbsrc, flags, "",
((void *)0)
);
}
| void strvis(undefined8 param_1,undefined8 param_2,undefined4 param_3)
{
undefined8 local_10;
local_10 = param_1;
istrsenvisxl(&local_10,0,param_2,param_3,&DAT_001018e8,0);
return;
}
|
int hddown(void)
{
unsigned int flags;
char *disk;
DIR *blk;
if ((blk = opendir("/sys/block")) == (DIR*)0)
return -1;
while ((disk = list_disks(blk, &flags)))
do_standby_disk(disk, flags);
return closedir(blk);
}
| long long hddown() {
char v0;
unsigned long long v1;
unsigned int v2;
unsigned long long v4;
v1 = opendir("/sys/block");
if (!v1) {
v4 = 4294967295;
} else {
while (true) {
*(&v2) = list_disks(v1, &v0);
if (!*(&v2))
break;
do_standby_disk(*(&v2), *(&v0));
}
v4 = closedir(v1);
}
return v4;
}
|
void
set_posix_options (bitmap)
const char *bitmap;
{
register int i;
for (i = 0; posix_vars[i].posix_mode_var; i++)
*(posix_vars[i].posix_mode_var) = bitmap[i];
}
| long set_posix_options(long a1)
{
int i;
long result;
for ( i = 0; ; ++i )
{
result = (long)*(&posix_vars + i);
if ( !result )
break;
*(_DWORD *)*(&posix_vars + i) = *(char *)(i + a1);
}
return result;
}
|
static char *
heredoc_expand (redirectee, ri, lenp)
WORD_DESC *redirectee;
enum r_instruction ri;
size_t *lenp;
{
char *document;
size_t dlen;
int old;
if (redirectee->word == 0 || redirectee->word[0] == '\0')
{
if (lenp)
*lenp = 0;
return (redirectee->word);
}
if (ri != r_reading_string && (redirectee->flags & (1 << 1)))
{
if (lenp)
*lenp = (((redirectee->word) && (redirectee->word)[0]) ? ((redirectee->word)[1] ? ((redirectee->word)[2] ? strlen(redirectee->word) : 2) : 1) : 0);
return (redirectee->word);
}
expanding_redir = 1;
sv_ifs ("IFS");
document = (ri == r_reading_string) ? expand_assignment_string_to_string (redirectee->word, 0)
: expand_string_to_string (redirectee->word, 0x002);
expanding_redir = 0;
old = executing_builtin;
executing_builtin = 1;
sv_ifs ("IFS");
executing_builtin = old;
dlen = (((document) && (document)[0]) ? ((document)[1] ? ((document)[2] ? strlen(document) : 2) : 1) : 0);
if (ri == r_reading_string)
{
document = sh_xrealloc((document), (dlen + 2), "redir.c", 400);
document[dlen++] = '\n';
document[dlen] = '\0';
}
if (lenp)
*lenp = dlen;
return document;
}
| int heredoc_expand(struct_0 *a0, unsigned long a1, unsigned long long *a2) {
unsigned int v0;
int tmp_20;
unsigned long long v1;
unsigned long long v2;
unsigned long long v4;
char *v5;
if (!a0->field_0) {
LABEL_4006ae:
if (a2)
*(a2) = 0;
v4 = a0->field_0;
} else {
if (!a0->field_0->field_0)
goto LABEL_4006ae;
if (a1 != 5 && (a0->field_8 & 2)) {
if (a2) {
if (a0->field_0 && a0->field_0->field_0) {
if (!a0->field_0->field_1) {
v4 = 1;
goto LABEL_40074d;
} else if (!a0->field_0->field_2) {
v4 = 2;
goto LABEL_40074d;
} else {
v4 = strlen(a0->field_0);
goto LABEL_40074d;
}
}
v4 = 0;
LABEL_40074d:
*(a2) = v4;
}
*(&v4) = a0->field_0;
goto LABEL_400895;
}
expanding_redir = 1;
sv_ifs("IFS");
if (a1 != 5)
v5 = expand_string_to_string(a0->field_0, 0x2);
else
v5 = expand_assignment_string_to_string(a0->field_0, 0x0);
v1 = v5;
expanding_redir = 0;
v0 = executing_builtin;
executing_builtin = 1;
sv_ifs("IFS");
executing_builtin = v0;
if (v1 && *(v1)) {
if (!*((v1 + 1))) {
v4 = 1;
goto LABEL_40082d;
} else if (!*((v1 + 2))) {
v4 = 2;
goto LABEL_40082d;
} else {
v4 = strlen(v1);
goto LABEL_40082d;
}
}
v4 = 0;
LABEL_40082d:
v2 = v4;
if (a1 == 5) {
v4 = sh_xrealloc(v1, v2 + 2, "redir.c", 0x190);
v1 = v4;
tmp_20 = v2;
v2 += 1;
*((tmp_20 + v1)) = 10;
*((v2 + v1)) = 0;
}
if (a2)
*(a2) = v2;
*(&v4) = v1;
}
LABEL_400895:
return v4;
}
|
static
_Bool
known (off_t size)
{
return 0 <= size;
}
| ulong known(ulong param_1)
{
return ~param_1 >> 0x3f;
}
|
void test_compress(compr, comprLen, uncompr, uncomprLen)
Byte *compr, *uncompr;
uLong comprLen, uncomprLen;
{
int err;
uLong len = (uLong)strlen(hello)+1;
err = compress(compr, &comprLen, (const Bytef*)hello, len);
{ if (err != 0) { fprintf(
stderr
, "%s error: %d\n", "compress", err); exit(1); } };
strcpy((char*)uncompr, "garbage");
err = uncompress(uncompr, &uncomprLen, compr, comprLen);
{ if (err != 0) { fprintf(
stderr
, "%s error: %d\n", "uncompress", err); exit(1); } };
if (strcmp((char*)uncompr, hello)) {
fprintf(
stderr
, "bad uncompress\n");
exit(1);
} else {
printf("uncompress(): %s\n", (char *)uncompr);
}
}
| void test_compress(unsigned long long a0, unsigned long long a1, char *a2, unsigned long a3) {
unsigned long v0;
char v1;
unsigned int v2;
unsigned long long v3;
unsigned long long v5;
v0 = a3;
v3 = strlen("hello,") + 1;
v2 = compress(a0, &v1, "hello,", v3);
if (v2) {
fprintf(*(&stderr), "%s error: %d\n", &g_401aa6, v2);
exit(0x1);
}
strcpy(a2, "garbage");
v2 = uncompress(a2, &v0, a0, a1);
if (v2) {
fprintf(*(&stderr), "%s error: %d\n", &g_401ac5, v2);
exit(0x1);
} else if (strcmp(a2, "hello,")) {
fprintf(*(&stderr), "bad uncompress\n");
exit(0x1);
} else {
v5 = printf("uncompress(): %s\n", a2);
return;
}
}
|
int
sshauthopt_serialise(const struct sshauthopt *opts, struct sshbuf *m,
int untrusted)
{
int r = -1;
if ((r = sshbuf_put_u8(m, opts->permit_port_forwarding_flag)) != 0 ||
(r = sshbuf_put_u8(m, opts->permit_agent_forwarding_flag)) != 0 ||
(r = sshbuf_put_u8(m, opts->permit_x11_forwarding_flag)) != 0 ||
(r = sshbuf_put_u8(m, opts->permit_pty_flag)) != 0 ||
(r = sshbuf_put_u8(m, opts->permit_user_rc)) != 0 ||
(r = sshbuf_put_u8(m, opts->restricted)) != 0 ||
(r = sshbuf_put_u8(m, opts->cert_authority)) != 0 ||
(r = sshbuf_put_u8(m, opts->no_require_user_presence)) != 0 ||
(r = sshbuf_put_u8(m, opts->require_verify)) != 0)
return r;
if ((r = sshbuf_put_u64(m, opts->valid_before)) != 0)
return r;
if ((r = sshbuf_put_u8(m, opts->force_tun_device == -1)) != 0 ||
(r = sshbuf_put_u32(m, (opts->force_tun_device < 0) ?
0 : (u_int)opts->force_tun_device)) != 0)
return r;
if ((r = serialise_nullable_string(m,
untrusted ? "yes" : opts->cert_principals)) != 0 ||
(r = serialise_nullable_string(m,
untrusted ? "true" : opts->force_command)) != 0 ||
(r = serialise_nullable_string(m,
untrusted ?
((void *)0)
: opts->required_from_host_cert)) != 0 ||
(r = serialise_nullable_string(m,
untrusted ?
((void *)0)
: opts->required_from_host_keys)) != 0)
return r;
if ((r = serialise_array(m, opts->env,
untrusted ? 0 : opts->nenv)) != 0 ||
(r = serialise_array(m, opts->permitopen,
untrusted ? 0 : opts->npermitopen)) != 0 ||
(r = serialise_array(m, opts->permitlisten,
untrusted ? 0 : opts->npermitlisten)) != 0)
return r;
return 0;
}
| long long sshauthopt_serialise(struct_0 *a0, unsigned long long a1, unsigned long a2) {
unsigned int v0;
void* v2;
void* v3;
unsigned long long v4;
unsigned long long v5;
void* v6;
void* v7;
void* v8;
void* v9;
void* v10;
v0 = -1;
v0 = sshbuf_put_u8(a1, a0->field_0, a0->field_0);
if (v0) {
LABEL_40232d:
v2 = v0;
} else {
v0 = sshbuf_put_u8(a1, a0->field_4, a0->field_4);
if (!(!v0))
goto LABEL_40232d;
v0 = sshbuf_put_u8(a1, a0->field_8, a0->field_8);
if (!(!v0))
goto LABEL_40232d;
v0 = sshbuf_put_u8(a1, a0->field_c, a0->field_c);
if (!(!v0))
goto LABEL_40232d;
v0 = sshbuf_put_u8(a1, a0->field_10, a0->field_10);
if (!(!v0))
goto LABEL_40232d;
v0 = sshbuf_put_u8(a1, a0->field_14, a0->field_14);
if (!(!v0))
goto LABEL_40232d;
v0 = sshbuf_put_u8(a1, a0->field_20, a0->field_20);
if (!(!v0))
goto LABEL_40232d;
v0 = sshbuf_put_u8(a1, a0->field_80, a0->field_80);
if (!(!v0))
goto LABEL_40232d;
v0 = sshbuf_put_u8(a1, a0->field_84, a0->field_84);
if (!(!v0))
goto LABEL_40232d;
v0 = sshbuf_put_u64(a1, a0->field_18, a0->field_18);
if (v0) {
v2 = v0;
} else {
v0 = sshbuf_put_u8(a1, a0->field_30 == -1, a0->field_30 == -1);
if (v0) {
LABEL_4023ae:
v2 = v0;
} else {
v3 = a0->field_30;
if (a0->field_30 < 0)
v3 = 0;
v0 = sshbuf_put_u32(v3, v3, v3);
if (!(!v0))
goto LABEL_4023ae;
if (a2)
v4 = "yes";
else
v4 = a0->field_28;
v0 = serialise_nullable_string(a1, v4);
if (v0) {
LABEL_402472:
v2 = v0;
} else {
if (a2)
v5 = "true";
else
v5 = a0->field_38;
v0 = serialise_nullable_string(a1, v5);
if (!(!v0))
goto LABEL_402472;
if (a2)
v6 = 0;
else
v6 = a0->field_70;
v0 = serialise_nullable_string(a1, v6);
if (!(!v0))
goto LABEL_402472;
if (a2)
v7 = 0;
else
v7 = a0->field_78;
v0 = serialise_nullable_string(a1, v7);
if (!(!v0))
goto LABEL_402472;
if (a2)
v8 = 0;
else
v8 = a0->field_40;
v0 = serialise_array(a1, a0->field_48, v8);
if (v0) {
LABEL_402519:
v2 = v0;
} else {
if (a2)
v9 = 0;
else
v9 = a0->field_50;
v0 = serialise_array(a1, a0->field_58, v9);
if (!(!v0))
goto LABEL_402519;
if (a2)
v10 = 0;
else
v10 = a0->field_60;
v0 = serialise_array(a1, a0->field_68, v10);
if (!(!v0))
goto LABEL_402519;
v2 = 0;
}
}
}
}
}
return v2;
}
|
FUNCTION_DEF *
copy_function_def_contents (old, new_def)
FUNCTION_DEF *old, *new_def;
{
new_def->name = copy_word (old->name);
new_def->command = old->command ? copy_command (old->command) : old->command;
new_def->flags = old->flags;
new_def->line = old->line;
new_def->source_file = old->source_file ? (char *)strcpy (sh_xmalloc((1 + strlen (old->source_file)), "copy_cmd.c", 347), (old->source_file)) : old->source_file;
return (new_def);
}
| int copy_function_def_contents(struct_0 *a0, struct_0 *a1) {
unsigned long long v1;
unsigned long long v2;
a1->field_8 = copy_word(a0->field_8);
if (!a0->field_10)
v1 = a0->field_10;
else
v1 = copy_command(a0->field_10);
a1->field_10 = v1;
a1->field_0 = a0->field_0;
a1->field_4 = a0->field_4;
if (!a0->field_18)
v2 = a0->field_18;
else
v2 = strcpy(sh_xmalloc(strlen(a0->field_18) + 1, "copy_cmd.c", 0x15b), a0->field_18);
a1->field_18 = v2;
return a1;
}
|
static int ext4_add_extent_to_list(e2fsck_t ctx, struct extent_list *list,
struct ext2fs_extent *ex)
{
return ext4_modify_extent_list(ctx, list, ex, 0 );
}
| long ext4_add_extent_to_list(_QWORD *a1, long a2, long *a3)
{
return ext4_modify_extent_list(a1, a2, a3, 0);
}
|
static void nh_reset(nh_ctx *hc)
{
hc->bytes_hashed = 0;
hc->next_data_empty = 0;
hc->state[0] = 0;
hc->state[1] = 0;
hc->state[2] = 0;
hc->state[3] = 0;
}
| void nh_reset(struct_0 *a0) {
char v0;
struct_0 *v2;
unsigned long long v3;
a0->field_474 = 0;
a0->field_470 = 0;
a0->field_478 = 0;
a0->field_480 = 0;
a0->field_488 = 0;
v2 = a0;
a0->field_490 = 0;
v3 = *(&v0);
return;
}
|
static int
choose_enc(struct sshenc *enc, char *client, char *server)
{
char *name = match_list(client, server,
((void *)0)
);
if (name ==
((void *)0)
)
return -31;
if ((enc->cipher = cipher_by_name(name)) ==
((void *)0)
) {
sshlog("kex.c", __func__, 783, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "unsupported cipher %s", name);
free(name);
return -1;
}
enc->name = name;
enc->enabled = 0;
enc->iv =
((void *)0)
;
enc->iv_len = cipher_ivlen(enc->cipher);
enc->key =
((void *)0)
;
enc->key_len = cipher_keylen(enc->cipher);
enc->block_size = cipher_blocksize(enc->cipher);
return 0;
}
| undefined8 choose_enc(void **param_1,undefined8 param_2,undefined8 param_3)
{
undefined4 uVar1;
void *__ptr;
undefined8 uVar2;
void *pvVar3;
__ptr = (void *)match_list(param_2,param_3,0);
if (__ptr == (void *)0x0) {
uVar2 = 0xffffffe1;
}
else {
pvVar3 = (void *)cipher_by_name(__ptr);
param_1[1] = pvVar3;
if (param_1[1] == (void *)0x0) {
sshlog("kex.c","choose_enc",0x30f,1,2,0,"unsupported cipher %s",__ptr);
free(__ptr);
uVar2 = 0xffffffff;
}
else {
*param_1 = __ptr;
*(undefined4 *)(param_1 + 2) = 0;
param_1[5] = (void *)0x0;
uVar1 = cipher_ivlen(param_1[1]);
*(undefined4 *)(param_1 + 3) = uVar1;
param_1[4] = (void *)0x0;
uVar1 = cipher_keylen(param_1[1]);
*(undefined4 *)((long)param_1 + 0x14) = uVar1;
uVar1 = cipher_blocksize(param_1[1]);
*(undefined4 *)((long)param_1 + 0x1c) = uVar1;
uVar2 = 0;
}
}
return uVar2;
}
|
static struct var **
findvar(struct var **vpp, const char *name)
{
for (; *vpp; vpp = &(*vpp)->next) {
if (varequal((*vpp)->text, name)) {
break;
}
}
return vpp;
}
| long * findvar(long *a1, char *a2)
{
while ( *a1 && !varequal(*(_BYTE **)(*a1 + 16), a2) )
a1 = (long *)*a1;
return a1;
}
|
static void
print_cond_node (cond)
COND_COM *cond;
{
if (cond->flags & 0x04)
cprintf ("! ");
if (cond->type == 6)
{
cprintf ("( ");
print_cond_node (cond->left);
cprintf (" )");
}
else if (cond->type == 1)
{
print_cond_node (cond->left);
cprintf (" && ");
print_cond_node (cond->right);
}
else if (cond->type == 2)
{
print_cond_node (cond->left);
cprintf (" || ");
print_cond_node (cond->right);
}
else if (cond->type == 3)
{
cprintf ("%s", cond->op->word);
cprintf (" ");
print_cond_node (cond->left);
}
else if (cond->type == 4)
{
print_cond_node (cond->left);
cprintf (" ");
cprintf ("%s", cond->op->word);
cprintf (" ");
print_cond_node (cond->right);
}
else if (cond->type == 5)
{
cprintf ("%s", cond->op->word);
}
}
| void print_cond_node(struct_0 *a0) {
unsigned long long v1;
unsigned long long v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
if ((a0->field_0 & 4))
cprintf("! ");
if (a0->field_8 == 6) {
cprintf("( ");
print_cond_node(a0->field_18);
v1 = cprintf(" )");
} else if (a0->field_8 == 1) {
print_cond_node(a0->field_18);
cprintf(" && ");
v2 = print_cond_node(a0->field_20);
} else if (a0->field_8 == 2) {
print_cond_node(a0->field_18);
cprintf(" || ");
v4 = print_cond_node(a0->field_20);
} else if (a0->field_8 == 3) {
cprintf("%s");
cprintf(" ");
v5 = print_cond_node(a0->field_18);
} else if (a0->field_8 == 4) {
print_cond_node(a0->field_18);
cprintf(" ");
cprintf("%s");
cprintf(" ");
v7 = print_cond_node(a0->field_20);
} else {
v3 = a0->field_8;
if (a0->field_8 == 5)
v6 = cprintf("%s");
}
return;
}
|
void
err_unboundvar (s)
const char *s;
{
report_error (gettext("%s: unbound variable"), s);
}
| long long err_unboundvar(unsigned int a0) {
unsigned long v1;
v1 = gettext("%s: unbound variable");
return report_error(v1, a0, v1);
}
|
DH *
dh_new_group18(void)
{
static char *gen = "2", *group18 =
"FFFFFFFF" "FFFFFFFF" "C90FDAA2" "2168C234" "C4C6628B" "80DC1CD1"
"29024E08" "8A67CC74" "020BBEA6" "3B139B22" "514A0879" "8E3404DD"
"EF9519B3" "CD3A431B" "302B0A6D" "F25F1437" "4FE1356D" "6D51C245"
"E485B576" "625E7EC6" "F44C42E9" "A637ED6B" "0BFF5CB6" "F406B7ED"
"EE386BFB" "5A899FA5" "AE9F2411" "7C4B1FE6" "49286651" "ECE45B3D"
"C2007CB8" "A163BF05" "98DA4836" "1C55D39A" "69163FA8" "FD24CF5F"
"83655D23" "DCA3AD96" "1C62F356" "208552BB" "9ED52907" "7096966D"
"670C354E" "4ABC9804" "F1746C08" "CA18217C" "32905E46" "2E36CE3B"
"E39E772C" "180E8603" "9B2783A2" "EC07A28F" "B5C55DF0" "6F4C52C9"
"DE2BCBF6" "95581718" "3995497C" "EA956AE5" "15D22618" "98FA0510"
"15728E5A" "8AAAC42D" "AD33170D" "04507A33" "A85521AB" "DF1CBA64"
"ECFB8504" "58DBEF0A" "8AEA7157" "5D060C7D" "B3970F85" "A6E1E4C7"
"ABF5AE8C" "DB0933D7" "1E8C94E0" "4A25619D" "CEE3D226" "1AD2EE6B"
"F12FFA06" "D98A0864" "D8760273" "3EC86A64" "521F2B18" "177B200C"
"BBE11757" "7A615D6C" "770988C0" "BAD946E2" "08E24FA0" "74E5AB31"
"43DB5BFC" "E0FD108E" "4B82D120" "A9210801" "1A723C12" "A787E6D7"
"88719A10" "BDBA5B26" "99C32718" "6AF4E23C" "1A946834" "B6150BDA"
"2583E9CA" "2AD44CE8" "DBBBC2DB" "04DE8EF9" "2E8EFC14" "1FBECAA6"
"287C5947" "4E6BC05D" "99B2964F" "A090C3A2" "233BA186" "515BE7ED"
"1F612970" "CEE2D7AF" "B81BDD76" "2170481C" "D0069127" "D5B05AA9"
"93B4EA98" "8D8FDDC1" "86FFB7DC" "90A6C08F" "4DF435C9" "34028492"
"36C3FAB4" "D27C7026" "C1D4DCB2" "602646DE" "C9751E76" "3DBA37BD"
"F8FF9406" "AD9E530E" "E5DB382F" "413001AE" "B06A53ED" "9027D831"
"179727B0" "865A8918" "DA3EDBEB" "CF9B14ED" "44CE6CBA" "CED4BB1B"
"DB7F1447" "E6CC254B" "33205151" "2BD7AF42" "6FB8F401" "378CD2BF"
"5983CA01" "C64B92EC" "F032EA15" "D1721D03" "F482D7CE" "6E74FEF6"
"D55E702F" "46980C82" "B5A84031" "900B1C9E" "59E7C97F" "BEC7E8F3"
"23A97A7E" "36CC88BE" "0F1D45B7" "FF585AC5" "4BD407B2" "2B4154AA"
"CC8F6D7E" "BF48E1D8" "14CC5ED2" "0F8037E0" "A79715EE" "F29BE328"
"06A1D58B" "B7C5DA76" "F550AA3D" "8A1FBFF0" "EB19CCB1" "A313D55C"
"DA56C9EC" "2EF29632" "387FE8D7" "6E3C0468" "043E8F66" "3F4860EE"
"12BF2D5B" "0B7474D6" "E694F91E" "6DBE1159" "74A3926F" "12FEE5E4"
"38777CB6" "A932DF8C" "D8BEC4D0" "73B931BA" "3BC832B6" "8D9DD300"
"741FA7BF" "8AFC47ED" "2576F693" "6BA42466" "3AAB639C" "5AE4F568"
"3423B474" "2BF1C978" "238F16CB" "E39D652D" "E3FDB8BE" "FC848AD9"
"22222E04" "A4037C07" "13EB57A8" "1A23F0C7" "3473FC64" "6CEA306B"
"4BCBC886" "2F8385DD" "FA9D4B7F" "A2C087E8" "79683303" "ED5BDD3A"
"062B3CF5" "B3A278A6" "6D2A13F8" "3F44F82D" "DF310EE0" "74AB6A36"
"4597E899" "A0255DC1" "64F31CC5" "0846851D" "F9AB4819" "5DED7EA1"
"B1D510BD" "7EE74D73" "FAF36BC3" "1ECFA268" "359046F4" "EB879F92"
"4009438B" "481C6CD7" "889A002E" "D5EE382B" "C9190DA6" "FC026E47"
"9558E447" "5677E9AA" "9E3050E2" "765694DF" "C81F56E8" "80B96E71"
"60C980DD" "98EDD3DF" "FFFFFFFF" "FFFFFFFF";
return (dh_new_group_asc(gen, group18));
}
| void dh_new_group18() {
unsigned long long v1;
v1 = dh_new_group_asc(gen.17696, group18.17697);
return;
}
|
!matches(*argv, "hoplimit") ||
!matches(*argv, "hlim")) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (strcmp(*argv, "inherit") != 0) {
if (get_u8(&hop_limit, *argv, 0))
invarg("invalid HLIM\n", *argv);
} else
hop_limit = 0;
} else if (!matches(*argv, "tos") ||
| (cVar1 = matches(*local_5b0,"hoplimit"),
cVar1 == '\x01')) &&
(cVar1 = matches(*local_5b0,&DAT_001028ff),
cVar1 == '\x01')) {
cVar1 = matches(*local_5b0,&DAT_0010291a);
if (((cVar1 == '\x01') &&
(cVar1 = matches(*local_5b0,"tclass"),
cVar1 == '\x01')) &&
(cVar1 = matches(*local_5b0,"dsfield"),
cVar1 == '\x01')) {
iVar3 = strcmp(*local_5b0,"flowlabel");
if ((iVar3 == 0) ||
(iVar3 = strcmp(*local_5b0,"fl"), iVar3 == 0)
) {
local_5b0 = local_5b0 + 1;
local_5a4 = local_5a4 + -1;
if (local_5a4 < 1) {
incomplete_command();
}
uVar4 = htonl(0xfffff);
local_584 = local_584 & ~uVar4;
iVar3 = strcmp(*local_5b0,"inherit");
if (iVar3 == 0) {
local_56c = local_56c | 4;
}
else {
iVar3 = get_u32(&local_578,*local_5b0,0x10);
if (iVar3 != 0) {
invarg("invalid Flowlabel",*local_5b0);
}
if (0xfffff < local_578) {
invarg("invalid Flowlabel",*local_5b0);
}
uVar4 = htonl(local_578);
uVar5 = htonl(0xfffff);
local_584 = local_584 | uVar4 & uVar5;
local_56c = local_56c & 0xfffffffb;
}
}
else {
iVar3 = strcmp(*local_5b0,"dscp");
if (iVar3 == 0) {
local_5b0 = local_5b0 + 1;
local_5a4 = local_5a4 + -1;
if (local_5a4 < 1) {
incomplete_command();
}
iVar3 = strcmp(*local_5b0,"inherit");
if (iVar3 != 0) {
invarg("not inherit",*local_5b0);
}
local_56c = local_56c | 0x10;
}
else {
iVar3 = strcmp(*local_5b0,"noencap");
if (iVar3 == 0) {
local_588 = 0;
}
else {
iVar3 = strcmp(*local_5b0,"encap");
if (iVar3 == 0) {
local_5b0 = local_5b0 + 1;
local_5a4 = local_5a4 + -1;
if (local_5a4 < 1) {
incomplete_command();
}
iVar3 = strcmp(*local_5b0,"fou");
if (iVar3 == 0) {
local_588 = 1;
}
else {
iVar3 = strcmp(*local_5b0,"gue");
if (iVar3 == 0) {
local_588 = 2;
}
else {
iVar3 = strcmp(*local_5b0,"none");
if (iVar3 != 0) {
invarg("Invalid encap type.",
*local_5b0);
goto LAB_00101289;
}
local_588 = 0;
}
}
}
else {
LAB_00101289:
iVar3 = strcmp(*local_5b0,"encap-sport")
;
if (iVar3 == 0) {
local_5b0 = local_5b0 + 1;
local_5a4 = local_5a4 + -1;
if (local_5a4 < 1) {
incomplete_command();
}
iVar3 = strcmp(*local_5b0,"auto");
if (iVar3 == 0) {
local_58e = 0;
}
else {
iVar3 = get_u16(&local_58e,
*local_5b0,0);
if (iVar3 != 0) {
invarg("Invalid source port.",
*local_5b0);
goto LAB_00101334;
}
}
}
else {
LAB_00101334:
iVar3 = strcmp(*local_5b0,
"encap-dport");
if (iVar3 == 0) {
local_5b0 = local_5b0 + 1;
local_5a4 = local_5a4 + -1;
if (local_5a4 < 1) {
incomplete_command();
}
iVar3 = get_u16(&local_58c,
*local_5b0,0);
if (iVar3 == 0) goto LAB_0010194b;
invarg("Invalid destination port.",
*local_5b0);
}
iVar3 = strcmp(*local_5b0,"encap-csum"
);
if (iVar3 == 0) {
local_586 = local_586 | 1;
}
else {
iVar3 = strcmp(*local_5b0,
"noencap-csum");
if (iVar3 == 0) {
local_586 = local_586 & 0xfffe;
}
else {
iVar3 = strcmp(*local_5b0,
"encap-udp6-csum");
if (iVar3 == 0) {
local_586 = local_586 | 2;
}
else {
iVar3 = strcmp(*local_5b0,
"noencap-udp6-csum");
if (iVar3 == 0) {
local_586 = local_586 & 0xfffd;
}
else {
iVar3 = strcmp(*local_5b0,"encap-remcsum");
if (iVar3 == 0) {
local_586 = local_586 | 4;
}
else {
iVar3 = strcmp(*local_5b0,"noencap-remcsum");
if (iVar3 == 0) {
local_586 = local_586 & 0xfffb;
}
else {
iVar3 = strcmp(*local_5b0,"external");
if (iVar3 == 0) {
local_594 = '\x01';
}
else {
iVar3 = strcmp(*local_5b0,"fwmark");
if (iVar3 == 0) {
local_5b0 = local_5b0 + 1;
local_5a4 = local_5a4 + -1;
if (local_5a4 < 1) {
incomplete_command();
}
iVar3 = strcmp(*local_5b0,"inherit");
if (iVar3 == 0) {
local_56c = local_56c | 0x20;
local_580 = 0;
}
else {
iVar3 = get_u32(&local_580,*local_5b0,
0);
if (iVar3 != 0) {
invarg("invalid fwmark\n",*local_5b0
);
}
local_56c = local_56c & 0xffffffdf;
}
}
else {
iVar3 = strcmp(*local_5b0,
"allow-localremote");
if (iVar3 == 0) {
local_56c = local_56c | 0x40;
}
else {
iVar3 = strcmp(*local_5b0,
"noallow-localremote");
if (iVar3 == 0) {
local_56c = local_56c & 0xffffffbf;
}
else {
iVar3 = strcmp(*local_5b0,
"encaplimit");
if (iVar3 == 0) {
local_5b0 = local_5b0 + 1;
local_5a4 = local_5a4 + -1;
if (local_5a4 < 1) {
incomplete_command();
}
iVar3 = strcmp(*local_5b0,"none");
if (iVar3 == 0) {
local_56c = local_56c | 1;
}
else {
iVar3 = get_u8(&local_578,
*local_5b0,0);
if (iVar3 != 0) {
invarg("invalid ELIM",
*local_5b0);
}
local_596 = (undefined)local_578
;
local_56c = local_56c &
0xfffffffe;
}
}
else {
iVar3 = strcmp(*local_5b0,"erspan"
);
if (iVar3 == 0) {
local_5b0 = local_5b0 + 1;
local_5a4 = local_5a4 + -1;
if (local_5a4 < 1) {
incomplete_command();
}
iVar3 = get_u32(&local_57c,
*local_5b0,0);
if (iVar3 != 0) {
invarg(
"invalid erspan index\n",*local_5b0);
}
if (((local_57c & 0xfff00000) == 0) &&
(local_57c != 0)) goto LAB_0010194b;
invarg("erspan index must be > 0 and <= 20-bit\n",
*local_5b0);
}
iVar3 = strcmp(*local_5b0,"erspan_ver");
if (iVar3 == 0) {
local_5b0 = local_5b0 + 1;
local_5a4 = local_5a4 + -1;
if (local_5a4 < 1) {
incomplete_command();
}
iVar3 = get_u8(&local_595,*local_5b0,0);
if (iVar3 != 0) {
invarg("invalid erspan version\n",*local_5b0);
}
if (local_595 < 3) goto LAB_0010194b;
invarg("erspan version must be 0/1/2\n",
*local_5b0);
}
iVar3 = strcmp(*local_5b0,"erspan_dir");
if (iVar3 != 0) {
LAB_001018a5:
iVar3 = strcmp(*local_5b0,"erspan_hwid");
if (iVar3 == 0) {
local_5b0 = local_5b0 + 1;
local_5a4 = local_5a4 + -1;
if (local_5a4 < 1) {
incomplete_command();
}
iVar3 = get_u16(&local_58a,*local_5b0,0);
if (iVar3 == 0) goto LAB_0010194b;
invarg("invalid erspan hwid\n",*local_5b0);
}
gre_print_help(param_1,local_5a4,local_5b0,
stderr);
uVar6 = 0xffffffff;
goto LAB_00101d0c;
}
local_5b0 = local_5b0 + 1;
local_5a4 = local_5a4 + -1;
if (local_5a4 < 1) {
incomplete_command();
}
cVar1 = matches(*local_5b0,"ingress");
if (cVar1 == '\x01') {
cVar1 = matches(*local_5b0,"egress");
if (cVar1 == '\x01') {
invarg("Invalid erspan direction.",*local_5b0)
;
goto LAB_001018a5;
}
local_593 = 1;
}
else {
local_593 = 0;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
else {
local_5b0 = local_5b0 + 1;
local_5a4 = local_5a4 + -1;
if (local_5a4 < 1) {
incomplete_command();
}
uVar4 = htonl(0xff00000);
local_584 = local_584 & ~uVar4;
iVar3 = strcmp(*local_5b0,"inherit");
if (iVar3 == 0) {
local_56c = local_56c | 2;
}
else {
iVar3 = get_u8(&local_578,*local_5b0,0x10);
if (iVar3 != 0) {
invarg("invalid TClass",*local_5b0);
}
uVar4 = htonl((local_578 & 0xff) << 0x14);
uVar5 = htonl(0xff00000);
local_584 = local_584 | uVar4 & uVar5;
local_56c = local_56c & 0xfffffffd;
}
}
}
|
int
assertlongfilenames(const char *const *argv)
{
struct dpkg_version version = { 0, "1.4.1.17",
((void *)0)
};
return assert_version_support(argv, &version, gettext("long filenames"));
}
| long long assertlongfilenames(unsigned long long *a0) {
unsigned int v0;
unsigned long long v1;
void* v2;
v0 = 0;
v1 = "1.4.1.17";
v2 = 0;
return assert_version_support(a0, &v0, gettext("long filenames"));
}
|
void
channel_send_open(struct ssh *ssh, int id)
{
Channel *c = channel_lookup(ssh, id);
int r;
if (c ==
((void *)0)
) {
sshlog("channels.c", __func__, 971, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "channel_send_open: %d: bad id", id);
return;
}
sshlog("channels.c", __func__, 974, 0, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "channel %d: send open", id);
open_preamble(ssh, __func__, c, c->ctype);
if ((r = sshpkt_send(ssh)) != 0)
sshfatal("channels.c", __func__, 977, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "channel %i", c->self);
}
| long long channel_send_open(void* a0, unsigned long a1) {
unsigned long v0;
unsigned int v1;
struct_0 *v2;
unsigned long long v4;
v2 = channel_lookup(a0, a1);
if (!v2) {
v0 = a1;
v4 = sshlog("channels.c", "channel_send_open", 0x3cb, 0x0, 0x3, 0x0, "channel_send_open: %d: bad id");
} else {
v0 = a1;
sshlog("channels.c", "channel_send_open", 0x3ce, 0x0, 0x6, 0x0, "channel %d: send open");
open_preamble(a0, "channel_send_open", v2, v2->field_c8);
v4 = sshpkt_send(a0);
v1 = v4;
if (v1) {
v0 = v2->field_4;
v4 = sshfatal("channels.c", "channel_send_open", 0x3d1, 0x1, 0x1, ssh_err(v1));
}
}
return v4;
}
|
void
print_rlimtype (n, addnl)
rlim_t n;
int addnl;
{
char s[(((sizeof (rlim_t) * 8) - (! ((rlim_t) 0 < (rlim_t) -1))) * 302 / 1000 + 1 + (! ((rlim_t) 0 < (rlim_t) -1))) + 1], *p;
p = s + sizeof(s);
*--p = '\0';
if (n < 0)
{
do
*--p = '0' - n % 10;
while ((n /= 10) != 0);
*--p = '-';
}
else
{
do
*--p = '0' + n % 10;
while ((n /= 10) != 0);
}
printf ("%s%s", p, addnl ? "\n" : "");
}
| void print_rlimtype(ulong param_1,int param_2)
{
undefined *puVar1;
long in_FS_OFFSET;
ulong local_40;
char *local_30;
char acStack21 [5];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_30 = acStack21 + 1;
acStack21[1] = 0;
local_40 = param_1;
do {
local_30 = local_30 + -1;
*local_30 = (char)local_40 + ((char)(local_40 / 10 << 2) + (char)(local_40 / 10)) * -2 + '0';
local_40 = local_40 / 10;
} while (local_40 != 0);
if (param_2 == 0) {
puVar1 = &DAT_001034bd;
}
else {
puVar1 = &DAT_001034bb;
}
printf("%s%s",local_30,puVar1);
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static struct deferred_unlink *
dunlink_alloc (void)
{
struct deferred_unlink *p;
if (dunlink_avail)
{
p = dunlink_avail;
dunlink_avail = p->next;
p->next =
((void *)0)
;
}
else
p = xmalloc (sizeof (*p));
return p;
}
| long dunlink_alloc()
{
_QWORD *v1;
if ( !dunlink_avail )
return xmalloc(40LL);
v1 = dunlink_avail;
dunlink_avail = *(void **)dunlink_avail;
*v1 = 0LL;
return (long)v1;
}
|
static int
_rl_char_search (int count, int fdir, int bdir)
{
char mbchar[
16
];
int mb_len;
mb_len = _rl_read_mbchar (mbchar,
16
);
if (mb_len <= 0)
return 1;
if (count < 0)
return (_rl_char_search_internal (-count, bdir, mbchar, mb_len));
else
return (_rl_char_search_internal (count, fdir, mbchar, mb_len));
}
| void _rl_char_search(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
char v2;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
v0 = a0;
v1 = _rl_read_mbchar(&v2, 0x10);
if (v1 <= 0) {
v4 = 1;
} else if (a0 >= 0) {
v6 = _rl_char_search_internal(a0, a1, &v2, v1);
} else {
v5 = _rl_char_search_internal(-(v0), a2, &v2, v1);
}
return;
}
|
static void
tar_copy_str (char *dst, const char *src, size_t len)
{
size_t i;
for (i = 0; i < len; i++)
if (! (dst[i] = src[i]))
break;
}
| void tar_copy_str(void* a0, void* a1, unsigned long a2) {
void* v0;
void* v2;
unsigned long long v3;
v0 = 0;
while (true) {
v2 = v0;
if (v0 >= a2)
break;
*((v0 + a0)) = *((a1 + v0));
v3 = *((v0 + a0));
if (!*((v0 + a0)))
break;
v0 += 1;
}
return;
}
|
void
bash_history_reinit (interact)
int interact;
{
history_expansion = (interact == 0) ? histexp_flag : 1;
history_expansion_inhibited = (interact == 0) ? 1 - histexp_flag : 0;
history_inhibit_expansion_function = bash_history_inhibit_expansion;
remember_on_history = enable_history_list;
}
| void bash_history_reinit(int param_1)
{
if (param_1 == 0) {
history_expansion_inhibited = 1 - histexp_flag;
history_expansion = histexp_flag;
}
else {
history_expansion = 1;
history_expansion_inhibited = 0;
}
remember_on_history = enable_history_list;
_history_inhibit_expansion_function = 0x100000;
return;
}
|
__inline
static const char *
pgettext_aux (const char *domain,
const char *msg_ctxt_id, const char *msgid,
int category)
{
const char *translation = dcgettext (domain, msg_ctxt_id, category);
if (translation == msg_ctxt_id)
return msgid;
else
return translation;
}
| int pgettext_aux(char *a0, char *a1, unsigned long a2, unsigned long a3) {
unsigned long v0;
unsigned int v2;
v0 = dcgettext(a0, a1, a3);
if (v0 == a1)
v2 = a2;
else
v2 = v0;
return v2;
}
|
static inline void
emit_ancillary_info (char const *program)
{
struct infomap { char const *program; char const *node; } const infomap[] = {
{ "[", "test invocation" },
{ "coreutils", "Multi-call invocation" },
{ "sha224sum", "sha2 utilities" },
{ "sha256sum", "sha2 utilities" },
{ "sha384sum", "sha2 utilities" },
{ "sha512sum", "sha2 utilities" },
{
((void *)0)
,
((void *)0)
}
};
char const *node = program;
struct infomap const *map_prog = infomap;
while (map_prog->program && ! (strcmp (program, map_prog->program) == 0))
map_prog++;
if (map_prog->node)
node = map_prog->node;
printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https:
char const *lc_messages = setlocale (
5
,
((void *)0)
);
if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1))
{
fputs_unlocked (gettext ("Report any translation bugs to " "<https:
stdout
)
;
}
char const *url_program = (strcmp (program, "[") == 0) ? "test" : program;
printf (gettext ("Full documentation <%s%s>\n"),
"https:
printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"),
node, node == program ? " invocation" : "");
}
| void emit_ancillary_info(char *a0) {
unsigned long v0;
unsigned long long v1[2];
char *v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
void* v16;
void* v17;
char v18;
unsigned long long 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;
}
|
static inline
_Bool
is_smack_enabled (void)
{
return
0
;
}
| undefined8 is_smack_enabled(void)
{
return 0;
}
|
static int depmod_modules_search_file(struct depmod *depmod, size_t baselen, size_t namelen, const char *path)
{
struct kmod_module *kmod;
struct mod *mod;
const char *relpath;
char modname[
4096
];
size_t modnamelen;
int err;
if (!path_ends_with_kmod_ext(path + baselen, namelen))
return 0;
if (path_to_modname(path, modname, &modnamelen) ==
((void *)0)
) {
log_printf(
3
, "could not get modname from path %s\n", path);
return -
22
;
}
relpath = path + depmod->cfg->dirnamelen + 1;
log_printf(
7
, "try %s (%s)\n", relpath, modname);
mod = hash_find(depmod->modules_by_name, modname);
if (mod ==
((void *)0)
)
goto add;
if (depmod_module_is_higher_priority(depmod, mod, baselen,
namelen, modnamelen, path)) {
log_printf(
7
, "Ignored lower priority: %s, higher: %s\n", path, mod->path)
;
return 0;
}
log_printf(
7
, "Replace lower priority %s with new module %s\n", mod->relpath, relpath)
;
err = depmod_module_del(depmod, mod);
if (err < 0) {
log_printf(
3
, "could not del module %s: %s\n", mod->path, strerror(-err));
return err;
}
add:
err = kmod_module_new_from_path(depmod->ctx, path, &kmod);
if (err < 0) {
log_printf(
3
, "could not create module %s: %s\n", path, strerror(-err));
return err;
}
err = depmod_module_add(depmod, kmod);
if (err < 0) {
log_printf(
3
, "could not add module %s: %s\n", path, strerror(-err))
;
kmod_module_unref(kmod);
return err;
}
return 0;
}
| int depmod_modules_search_file(struct_0 *a0, unsigned int a1, unsigned long long a2, unsigned long a3, unsigned long long a4) {
unsigned int v0;
char v1;
char v2;
unsigned long long v3;
unsigned long long v4[3];
char v5;
char v6;
unsigned int v9;
v6 = *(&v6);
if ((path_ends_with_kmod_ext(a3 + a1, a2, a3 + a1) ^ 1)) {
v9 = 0;
} else {
v9 = path_to_modname(a3, &v5, &v2, &v5);
if (!v9) {
log_printf(0x3, "could not get modname from path %s\n", a3, &v5, a4);
v9 = -22;
} else {
v3 = a3 + a0->field_0->field_1008 + 1;
log_printf(0x7, "try %s (%s)\n", v3, &v5, a4);
v4[0] = hash_find(a0->field_38, &v5, &v5);
if (v4) {
v9 = depmod_module_is_higher_priority(a0, v4, a1, a2, *(&v2), a3);
if (v9) {
log_printf(0x7, "Ignored lower priority: %s, higher: %s\n", a3, v4[1], a4);
v9 = 0;
} else {
log_printf(0x7, "Replace lower priority %s with new module %s\n", v4[2], v3, a4);
v0 = depmod_module_del(a0, v4);
if (v0 < 0) {
log_printf(0x3, "could not del module %s: %s\n", v4[1], strerror(-(v0)), a4);
v9 = v0;
}
}
}
if (!v4 || !v9 && v0 >= 0) {
v0 = kmod_module_new_from_path(a0->field_8, a3, &v1, a3);
if (v0 < 0) {
log_printf(0x3, "could not create module %s: %s\n", a3, strerror(-(v0)), a4);
v9 = v0;
} else {
v0 = depmod_module_add(a0, *(&v1), *(&v1), a3, a4);
if (v0 < 0) {
log_printf(0x3, "could not add module %s: %s\n", a3, strerror(-(v0)), a4);
kmod_module_unref(*(&v1));
v9 = v0;
} else {
v9 = 0;
}
}
}
}
}
return v9;
}
|
int
rl_vi_subst (int count, int key)
{
if (_rl_vi_redoing == 0)
rl_stuff_char ((key == 'S') ? 'c' : 'l');
return (rl_vi_change_to (count, 'c'));
}
| long rl_vi_subst(unsigned int a1, int a2)
{
unsigned int v2;
if ( !rl_vi_redoing )
{
if ( a2 == 83 )
v2 = 99;
else
v2 = 108;
rl_stuff_char(v2);
}
return rl_vi_change_to(a1, 0x63u);
}
|
"re-open the connection if configured to do so (we saw a generic IO Error, "
"which usually goes along with that behaviour).",
pWrkrData->pData->target, pWrkrData->pData->port);
} else if ((conErrCnt++ % skipFactor) == 0) {
| "interim system like a load balancer or firewall) shuts down or aborts a connection. Rsyslog will re-open the c"
"onnection if configured to do so (we saw a generic IO Error, which usually goes along with that behaviour).",
*(const char **)(*a1 + 80LL),
*(const char **)(*a1 + 112LL));
}
}
else
{
LogError(
0LL,
v6,
"omfwd: TCPSendBuf error %d, destruct TCP Connection to %s:%s",
v6,
*(const char **)(*a1 + 80LL),
*(const char **)(*a1 + 112LL));
}
|
static char *
commandtext(union node *n)
{
char *name;
((cmdnextc) = ((void *)stacknxt));
cmdtxt(n);
name = ((void *)stacknxt);
;
return savestr(name);
}
| void commandtext(undefined8 param_1)
{
cmdnextc = stacknxt;
cmdtxt(param_1);
savestr(stacknxt);
return;
}
|
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(void* a0, unsigned long a1) {
unsigned int v0;
void* v1;
unsigned long v2;
unsigned long long v3;
unsigned long v4;
unsigned long long *v6;
unsigned long long v7;
unsigned long long v8;
unsigned long v9;
unsigned long long *v10;
v3 = *(&v3);
v1 = a0;
v0 = a1;
v4 = v6[5];
v7 = 799;
v10 = &v2;
for (v8 = "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 --"; v7; v8 += v9 * 8) {
v7 -= 1;
v2 = *(v8);
v10 = &v10[v9];
}
fprintf(v1, "%s", &v2);
exit(v0);
}
|
static size_t
mbs_logical_cspn (char const *s, char const *accept)
{
size_t idx = 0;
if (accept[0] == '\0')
return 0;
if (
(__ctype_get_mb_cur_max ())
> 1)
{
mbui_iterator_t iter;
for (((iter).cur.ptr = (s), (iter).in_shift =
0
, memset (&(iter).state, '\0', sizeof (mbstate_t)), (iter).next_done =
0
); (mbuiter_multi_next (&(iter)), !(((iter).cur).wc_valid && ((iter).cur).wc == 0)); ((iter).cur.ptr += (iter).cur.bytes, (iter).next_done =
0
))
{
++idx;
if ((((iter).cur).bytes) == 1)
{
if (mbschr (accept, *(iter).cur.ptr))
return idx;
}
else
{
mbui_iterator_t aiter;
for (((aiter).cur.ptr = (accept), (aiter).in_shift =
0
, memset (&(aiter).state, '\0', sizeof (mbstate_t)), (aiter).next_done =
0
);
(mbuiter_multi_next (&(aiter)), !(((aiter).cur).wc_valid && ((aiter).cur).wc == 0));
((aiter).cur.ptr += (aiter).cur.bytes, (aiter).next_done =
0
))
if ((((aiter).cur).wc_valid && ((iter).cur).wc_valid ? ((aiter).cur).wc == ((iter).cur).wc : ((aiter).cur).bytes == ((iter).cur).bytes && memcmp (((aiter).cur).ptr, ((iter).cur).ptr, ((aiter).cur).bytes) == 0))
return idx;
}
}
return 0;
}
else
{
size_t i = strcspn (s, accept);
return (s[i] ? i + 1 : 0);
}
}
| int mbs_logical_cspn(void* a0, char *a1) {
void* v0;
char *v1;
char v2;
char v3;
char v4;
unsigned long v5;
char v6;
char v7;
char v8;
char v9;
char v10;
char v11;
char *v12;
char v13;
char v14;
char v15;
unsigned int v17;
unsigned int v18;
unsigned int v19;
v0 = 0;
if (!*(a1)) {
v17 = 0;
return v17;
}
if (__ctype_get_mb_cur_max() <= 1) {
v1 = strcspn(a0, a1);
v17 = (!*((v1 + a0)) ? (v1 + 1) : 0);
return v17;
}
v5 = a0;
v2 = 0;
memset(&v3, 0x0, 0x8);
v4 = 0;
while (true) {
mbuiter_multi_next(&v2);
if ((v7 ^ 1) || *(&v8))
v18 = 1;
else
v18 = 0;
if (!v18) {
v17 = 0;
return v17;
}
v0 += 1;
if (*(&v6) != 1) {
v12 = a1;
v9 = 0;
memset(&v10, 0x0, 0x8);
v11 = 0;
while (true) {
mbuiter_multi_next(&v9);
if ((v14 ^ 1) || *(&v15))
v19 = 1;
else
v19 = 0;
if (!v19)
break;
if (!v14 || !v7) {
if (*(&v13) != *(&v6) || memcmp(v12, v5, *(&v13)))
v19 = 0;
else
v19 = 1;
*(&v19) = v19 & 1;
} else {
*(&v19) = *(&v15) == *(&v8);
}
if (v19) {
v17 = v0;
return v17;
}
v12 = &v12[*(&v13)];
v11 = 0;
}
} else if (mbschr(a1, *(v5), *(v5))) {
v17 = v0;
return v17;
}
v5 = &v5[*(&v6)];
v4 = 0;
}
}
|
int
printf_fetchargs (va_list args, arguments *a)
{
size_t i;
argument *ap;
for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
switch (ap->type)
{
case TYPE_SCHAR:
ap->a.a_schar =
__builtin_va_arg(
args
,
int
)
;
break;
case TYPE_UCHAR:
ap->a.a_uchar =
__builtin_va_arg(
args
,
int
)
;
break;
case TYPE_SHORT:
ap->a.a_short =
__builtin_va_arg(
args
,
int
)
;
break;
case TYPE_USHORT:
ap->a.a_ushort =
__builtin_va_arg(
args
,
int
)
;
break;
case TYPE_INT:
ap->a.a_int =
__builtin_va_arg(
args
,
int
)
;
break;
case TYPE_UINT:
ap->a.a_uint =
__builtin_va_arg(
args
,
unsigned int
)
;
break;
case TYPE_LONGINT:
ap->a.a_longint =
__builtin_va_arg(
args
,
long int
)
;
break;
case TYPE_ULONGINT:
ap->a.a_ulongint =
__builtin_va_arg(
args
,
unsigned long int
)
;
break;
case TYPE_LONGLONGINT:
ap->a.a_longlongint =
__builtin_va_arg(
args
,
long long int
)
;
break;
case TYPE_ULONGLONGINT:
ap->a.a_ulonglongint =
__builtin_va_arg(
args
,
unsigned long long int
)
;
break;
case TYPE_DOUBLE:
ap->a.a_double =
__builtin_va_arg(
args
,
double
)
;
break;
case TYPE_LONGDOUBLE:
ap->a.a_longdouble =
__builtin_va_arg(
args
,
long double
)
;
break;
case TYPE_CHAR:
ap->a.a_char =
__builtin_va_arg(
args
,
int
)
;
break;
case TYPE_WIDE_CHAR:
ap->a.a_wide_char =
(sizeof (wint_t) < sizeof (int)
? (wint_t)
__builtin_va_arg(
args
,
int
)
:
__builtin_va_arg(
args
,
wint_t
)
);
break;
case TYPE_STRING:
ap->a.a_string =
__builtin_va_arg(
args
,
const char *
)
;
if (ap->a.a_string ==
((void *)0)
)
ap->a.a_string = "(NULL)";
break;
case TYPE_WIDE_STRING:
ap->a.a_wide_string =
__builtin_va_arg(
args
,
const wchar_t *
)
;
if (ap->a.a_wide_string ==
((void *)0)
)
{
static const wchar_t wide_null_string[] =
{
(wchar_t)'(',
(wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
(wchar_t)')',
(wchar_t)0
};
ap->a.a_wide_string = wide_null_string;
}
break;
case TYPE_POINTER:
ap->a.a_pointer =
__builtin_va_arg(
args
,
void *
)
;
break;
case TYPE_COUNT_SCHAR_POINTER:
ap->a.a_count_schar_pointer =
__builtin_va_arg(
args
,
signed char *
)
;
break;
case TYPE_COUNT_SHORT_POINTER:
ap->a.a_count_short_pointer =
__builtin_va_arg(
args
,
short *
)
;
break;
case TYPE_COUNT_INT_POINTER:
ap->a.a_count_int_pointer =
__builtin_va_arg(
args
,
int *
)
;
break;
case TYPE_COUNT_LONGINT_POINTER:
ap->a.a_count_longint_pointer =
__builtin_va_arg(
args
,
long int *
)
;
break;
case TYPE_COUNT_LONGLONGINT_POINTER:
ap->a.a_count_longlongint_pointer =
__builtin_va_arg(
args
,
long long int *
)
;
break;
default:
return -1;
}
return 0;
}
| undefined8 printf_fetchargs(uint *param_1,ulong *param_2)
{
unkbyte10 *pVar1;
undefined4 *puVar2;
undefined8 *puVar3;
ulong local_18;
undefined4 *local_10;
local_18 = 0;
local_10 = (undefined4 *)param_2[1];
for (; local_18 < *param_2; local_18 = local_18 + 1) {
switch(*local_10) {
default:
return 0xffffffff;
case 1:
if (*param_1 < 0x30) {
puVar2 = (undefined4 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar2 = *(undefined4 **)(param_1 + 2);
*(undefined4 **)(param_1 + 2) = puVar2 + 2;
}
*(char *)(local_10 + 4) = (char)*puVar2;
break;
case 2:
if (*param_1 < 0x30) {
puVar2 = (undefined4 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar2 = *(undefined4 **)(param_1 + 2);
*(undefined4 **)(param_1 + 2) = puVar2 + 2;
}
*(char *)(local_10 + 4) = (char)*puVar2;
break;
case 3:
if (*param_1 < 0x30) {
puVar2 = (undefined4 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar2 = *(undefined4 **)(param_1 + 2);
*(undefined4 **)(param_1 + 2) = puVar2 + 2;
}
*(short *)(local_10 + 4) = (short)*puVar2;
break;
case 4:
if (*param_1 < 0x30) {
puVar2 = (undefined4 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar2 = *(undefined4 **)(param_1 + 2);
*(undefined4 **)(param_1 + 2) = puVar2 + 2;
}
*(short *)(local_10 + 4) = (short)*puVar2;
break;
case 5:
if (*param_1 < 0x30) {
puVar2 = (undefined4 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar2 = *(undefined4 **)(param_1 + 2);
*(undefined4 **)(param_1 + 2) = puVar2 + 2;
}
local_10[4] = *puVar2;
break;
case 6:
if (*param_1 < 0x30) {
puVar2 = (undefined4 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar2 = *(undefined4 **)(param_1 + 2);
*(undefined4 **)(param_1 + 2) = puVar2 + 2;
}
local_10[4] = *puVar2;
break;
case 7:
if (*param_1 < 0x30) {
puVar3 = (undefined8 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar3 = *(undefined8 **)(param_1 + 2);
*(undefined8 **)(param_1 + 2) = puVar3 + 1;
}
*(undefined8 *)(local_10 + 4) = *puVar3;
break;
case 8:
if (*param_1 < 0x30) {
puVar3 = (undefined8 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar3 = *(undefined8 **)(param_1 + 2);
*(undefined8 **)(param_1 + 2) = puVar3 + 1;
}
*(undefined8 *)(local_10 + 4) = *puVar3;
break;
case 9:
if (*param_1 < 0x30) {
puVar3 = (undefined8 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar3 = *(undefined8 **)(param_1 + 2);
*(undefined8 **)(param_1 + 2) = puVar3 + 1;
}
*(undefined8 *)(local_10 + 4) = *puVar3;
break;
case 10:
if (*param_1 < 0x30) {
puVar3 = (undefined8 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar3 = *(undefined8 **)(param_1 + 2);
*(undefined8 **)(param_1 + 2) = puVar3 + 1;
}
*(undefined8 *)(local_10 + 4) = *puVar3;
break;
case 0xb:
if (param_1[1] < 0xb0) {
puVar3 = (undefined8 *)((ulong)param_1[1] + *(long *)(param_1 + 4));
param_1[1] = param_1[1] + 0x10;
}
else {
puVar3 = *(undefined8 **)(param_1 + 2);
*(undefined8 **)(param_1 + 2) = puVar3 + 1;
}
*(undefined8 *)(local_10 + 4) = *puVar3;
break;
case 0xc:
pVar1 = (unkbyte10 *)(*(long *)(param_1 + 2) + 0xfU & 0xfffffffffffffff0);
*(long *)(param_1 + 2) = (long)pVar1 + 0x10;
*(unkbyte10 *)(local_10 + 4) = *pVar1;
break;
case 0xd:
if (*param_1 < 0x30) {
puVar2 = (undefined4 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar2 = *(undefined4 **)(param_1 + 2);
*(undefined4 **)(param_1 + 2) = puVar2 + 2;
}
local_10[4] = *puVar2;
break;
case 0xe:
if (*param_1 < 0x30) {
puVar2 = (undefined4 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar2 = *(undefined4 **)(param_1 + 2);
*(undefined4 **)(param_1 + 2) = puVar2 + 2;
}
local_10[4] = *puVar2;
break;
case 0xf:
if (*param_1 < 0x30) {
puVar3 = (undefined8 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar3 = *(undefined8 **)(param_1 + 2);
*(undefined8 **)(param_1 + 2) = puVar3 + 1;
}
*(undefined8 *)(local_10 + 4) = *puVar3;
if (*(long *)(local_10 + 4) == 0) {
*(char **)(local_10 + 4) = "(NULL)";
}
break;
case 0x10:
if (*param_1 < 0x30) {
puVar3 = (undefined8 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar3 = *(undefined8 **)(param_1 + 2);
*(undefined8 **)(param_1 + 2) = puVar3 + 1;
}
*(undefined8 *)(local_10 + 4) = *puVar3;
if (*(long *)(local_10 + 4) == 0) {
*(undefined1 **)(local_10 + 4) = wide_null_string_1908;
}
break;
case 0x11:
if (*param_1 < 0x30) {
puVar3 = (undefined8 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar3 = *(undefined8 **)(param_1 + 2);
*(undefined8 **)(param_1 + 2) = puVar3 + 1;
}
*(undefined8 *)(local_10 + 4) = *puVar3;
break;
case 0x12:
if (*param_1 < 0x30) {
puVar3 = (undefined8 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar3 = *(undefined8 **)(param_1 + 2);
*(undefined8 **)(param_1 + 2) = puVar3 + 1;
}
*(undefined8 *)(local_10 + 4) = *puVar3;
break;
case 0x13:
if (*param_1 < 0x30) {
puVar3 = (undefined8 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar3 = *(undefined8 **)(param_1 + 2);
*(undefined8 **)(param_1 + 2) = puVar3 + 1;
}
*(undefined8 *)(local_10 + 4) = *puVar3;
break;
case 0x14:
if (*param_1 < 0x30) {
puVar3 = (undefined8 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar3 = *(undefined8 **)(param_1 + 2);
*(undefined8 **)(param_1 + 2) = puVar3 + 1;
}
*(undefined8 *)(local_10 + 4) = *puVar3;
break;
case 0x15:
if (*param_1 < 0x30) {
puVar3 = (undefined8 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar3 = *(undefined8 **)(param_1 + 2);
*(undefined8 **)(param_1 + 2) = puVar3 + 1;
}
*(undefined8 *)(local_10 + 4) = *puVar3;
break;
case 0x16:
if (*param_1 < 0x30) {
puVar3 = (undefined8 *)((ulong)*param_1 + *(long *)(param_1 + 4));
*param_1 = *param_1 + 8;
}
else {
puVar3 = *(undefined8 **)(param_1 + 2);
*(undefined8 **)(param_1 + 2) = puVar3 + 1;
}
*(undefined8 *)(local_10 + 4) = *puVar3;
}
local_10 = local_10 + 8;
}
return 0;
}
|
static
_Bool
parse_accesscheck (const struct parser_table* entry, char **argv, int *arg_ptr)
{
struct predicate *our_pred;
(void) argv;
(void) arg_ptr;
our_pred = insert_primary_noarg (entry);
our_pred->need_stat = our_pred->need_type =
0
;
our_pred->side_effects = our_pred->no_default_print =
0
;
if (( ((our_pred)->pred_func) == (pred_executable) ))
our_pred->est_success_rate = 0.2;
else
our_pred->est_success_rate = 0.9;
return
1
;
}
| long long parse_accesscheck(unsigned long long a0, unsigned long a1, unsigned long a2) {
unsigned long v0;
unsigned long v1;
struct_0 *v2;
v1 = a1;
v0 = a2;
v2 = insert_primary_noarg(a0);
v2->field_1b = 0;
v2->field_1a = v2->field_1b;
v2->field_19 = 0;
v2->field_18 = v2->field_19;
if (v2->field_0 == got.pred_executable) {
v2->field_24 = 4561245704505052365;
return 1;
}
v2->field_24 = 1063675494;
return 1;
}
|
, "sendmsg(%d): %s", fd, strerror(
(*__errno_location ())
));
(void)poll(&pfd, 1, -1);
}
if (n == -1) {
sshlog("monitor_fdpass.c", __func__, 96, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "sendmsg(%d): %s", fd, strerror(
(*__errno_location ())
));
return -1;
}
| ssize_t sendmsg(int __fd,msghdr *__message,int __flags)
{
halt_baddata();
}
|
static inline const char *rta_getattr_str(const struct rtattr *rta)
{
return (const char *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| int rta_getattr_str(unsigned long a0) {
return a0 + 4;
}
|
int main(int argn, char *argv[]) {
int opt;
char *include, *exclude, *command;
int flags;
time_t start, next, end = 0;
int endtime, printjobs;
cron_db db;
int installed = 0;
include =
((void *)0)
;
exclude =
((void *)0)
;
command =
((void *)0)
;
flags = 0x04;
endtime = 0;
printjobs = 0;
start = time(
((void *)0)
) / 60 * 60;
while (-1 != (opt = getopt(argn, argv, "i:e:ast:q:j:lcfhV"))) {
switch (opt) {
case 'i':
include = optarg;
break;
case 'e':
exclude = optarg;
break;
case 'a':
installed = 1;
break;
case 's':
flags &= ~0x04;
break;
case 't':
start = atoi(optarg) / 60 * 60;
break;
case 'q':
end = atoi(optarg) / 60 * 60;
endtime = 1;
break;
case 'j':
command = optarg;
break;
case 'l':
printjobs = 1;
break;
case 'c':
flags |= 0x01 | 0x02;
break;
case 'f':
flags |= 0x08 | 0x01;
break;
case 'h':
usage();
return
0
;
case 'V':
puts("cronie 1.6.1");
return
0
;
default:
fprintf(
stderr
, "unrecognized option: %s\n",
argv[optind - 1]);
usage();
exit(
1
);
}
}
if (flags & 0x08 && !endtime) {
fprintf(
stderr
, "no ending time specified: -f requires -q\n");
usage();
exit(
1
);
}
if (!endtime)
end = start + 8 * 12 * 31 * 24 * 60 * 60;
if (flags & 0x02) {
printf("spool: %s\n", "/usr/local/var/spool/cron");
set_debug_flags("");
}
db = database(installed || argv[optind] ==
((void *)0)
, argv + optind);
next = cronnext(db, start, end, include, exclude, command, flags);
if (next == -1)
return
1
;
else
printf("next: %ld\n", (long) next);
if (printjobs) {
printf("nextjobs:\n");
cronnext(db, next, next, include, exclude, command, (flags & 0x04) | 0x01);
}
return
0
;
}
| int main(unsigned long a0, unsigned long long *a1) {
unsigned long long v0;
unsigned long long v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
void* v7;
void* v8;
void* v9;
unsigned int v10;
unsigned long v11;
unsigned int v12;
char v13;
char v14;
char v15;
unsigned int v17;
unsigned long long v18;
unsigned long long v19;
unsigned long long v20;
v11 = 0;
v5 = 0;
v7 = 0;
v8 = 0;
v9 = 0;
v2 = 4;
v3 = 0;
v4 = 0;
v17 = time(NULL);
*(&v10) = (((v17 * 9838263505978427529 >> 64) + v17 >> 5) - (v17 >> 63)) * 60;
while (true) {
v6 = getopt(a0, a1, "i:e:ast:q:j:lcfhV");
if (v6 == -1)
break;
switch (v6) {
case 86:
puts("cronie 1.6.1");
v17 = 0;
return v17;
case 97:
v5 = 1;
break;
case 99:
v2 |= 3;
break;
case 101:
v8 = *(&optarg);
break;
case 102:
v2 |= 9;
break;
case 104:
usage();
v17 = 0;
return v17;
case 105:
v7 = *(&optarg);
break;
case 106:
v9 = *(&optarg);
break;
case 108:
v4 = 1;
break;
case 113:
v18 = atoi(*(&optarg));
v17 = (((v18 * -2004318071 >> 32) + v18 >> 5) - (v18 >> 31)) * 60;
v11 = v17;
v3 = 1;
break;
case 115:
v2 &= -5;
break;
case 116:
v19 = atoi(*(&optarg));
v17 = (((v19 * -2004318071 >> 32) + v19 >> 5) - (v19 >> 31)) * 60;
v10 = v17;
break;
default:
fprintf(*(&stderr), "unrecognized option: %s\n", a1[1 + *(&optind)]);
usage();
exit(0x1);
}
}
if ((v2 & 8) && !v3) {
fprintf(*(&stderr), "no ending time specified: -f requires -q\n");
usage();
exit(0x1);
}
if (!v3)
v11 = *(&v10) + 0xf537000;
if ((v2 & 2)) {
printf("spool: %s\n", &g_4015ca);
set_debug_flags(&g_401244);
}
if (v5 || !a1[*(&optind)])
v20 = 1;
else
v20 = 0;
database(&v13, v20, &a1[*(&optind)]);
v1 = *(&v15);
v0 = *(&v14);
*(&v12) = cronnext(*(&v10), v11, v7, v8, v9, v2, *(&v13));
if (*(&v12) == -1) {
v17 = 1;
return v17;
}
printf("next: %ld\n", *(&v12));
if (v4) {
printf("nextjobs:\n");
v1 = *(&v15);
v0 = *(&v14);
cronnext(*(&v12), *(&v12), v7, v8, v9, v2 & 4 | 1, *(&v13));
v17 = 0;
return v17;
}
v17 = 0;
return v17;
}
|
int
rl_backward_word (int count, int key)
{
int c, p;
if (count < 0)
return (rl_forward_word (-count, key));
while (count)
{
if (rl_point == 0)
return 0;
p = ((
(__ctype_get_mb_cur_max ())
> 1 && rl_byte_oriented == 0) ? _rl_find_prev_mbchar ((rl_line_buffer), (rl_point), (0x01)) : ((rl_point) - 1));
c = _rl_char_value (rl_line_buffer, p);
if (_rl_walphabetic (c) == 0)
{
rl_point = p;
while (rl_point > 0)
{
p = ((
(__ctype_get_mb_cur_max ())
> 1 && rl_byte_oriented == 0) ? _rl_find_prev_mbchar ((rl_line_buffer), (rl_point), (0x01)) : ((rl_point) - 1));
c = _rl_char_value (rl_line_buffer, p);
if (_rl_walphabetic (c))
break;
rl_point = p;
}
}
while (rl_point)
{
p = ((
(__ctype_get_mb_cur_max ())
> 1 && rl_byte_oriented == 0) ? _rl_find_prev_mbchar ((rl_line_buffer), (rl_point), (0x01)) : ((rl_point) - 1));
c = _rl_char_value (rl_line_buffer, p);
if (_rl_walphabetic (c) == 0)
break;
else
rl_point = p;
}
--count;
}
return 0;
}
| long rl_backward_word(int a1, unsigned int a2)
{
unsigned int prev_mbchar;
unsigned int v4;
unsigned int v5;
int v6;
unsigned int v7;
unsigned int v8;
unsigned int v9;
unsigned int v10;
unsigned int v11;
unsigned int v12;
v6 = a1;
if ( a1 < 0 )
return rl_forward_word(-a1, a2);
while ( v6 )
{
if ( !rl_point )
return 0LL;
if ( _ctype_get_mb_cur_max() <= 1 || rl_byte_oriented )
prev_mbchar = rl_point - 1;
else
prev_mbchar = rl_find_prev_mbchar(rl_line_buffer, rl_point, 1LL);
v7 = prev_mbchar;
v10 = rl_char_value(rl_line_buffer, prev_mbchar);
if ( !(unsigned int)rl_walphabetic(v10) )
{
for ( rl_point = v7; rl_point > 0; rl_point = v8 )
{
v4 = _ctype_get_mb_cur_max() <= 1 || rl_byte_oriented
? rl_point - 1
: rl_find_prev_mbchar(rl_line_buffer, rl_point, 1LL);
v8 = v4;
v11 = rl_char_value(rl_line_buffer, v4);
if ( (unsigned int)rl_walphabetic(v11) )
break;
}
}
while ( rl_point )
{
v5 = _ctype_get_mb_cur_max() <= 1 || rl_byte_oriented
? rl_point - 1
: rl_find_prev_mbchar(rl_line_buffer, rl_point, 1LL);
v9 = v5;
v12 = rl_char_value(rl_line_buffer, v5);
if ( !(unsigned int)rl_walphabetic(v12) )
break;
rl_point = v9;
}
--v6;
}
return 0LL;
}
|
static void
pr_context_hunk (struct change *hunk)
{
lin first0, last0, first1, last1, i;
char const *prefix;
char const *function;
FILE *out;
enum changes changes = analyze_hunk (hunk, &first0, &last0, &first1, &last1);
if (! changes)
return;
i = - files[0].prefix_lines;
first0 = ((first0 - context) >= (i) ? (first0 - context) : (i));
first1 = ((first1 - context) >= (i) ? (first1 - context) : (i));
if (last0 < files[0].valid_lines - context)
last0 += context;
else
last0 = files[0].valid_lines - 1;
if (last1 < files[1].valid_lines - context)
last1 += context;
else
last1 = files[1].valid_lines - 1;
function =
((void *)0)
;
if (function_regexp.fastmap)
function = find_function (files[0].linbuf, first0);
begin_output ();
out = outfile;
fputs_unlocked ("***************",out);
if (function)
print_context_function (out, function);
putc_unlocked ('\n',out);
set_color_context (LINE_NUMBER_CONTEXT);
fputs_unlocked ("*** ",out);
print_context_number_range (&files[0], first0, last0);
fputs_unlocked (" ****",out);
set_color_context (RESET_CONTEXT);
putc_unlocked ('\n',out);
if (changes & OLD)
{
struct change *next = hunk;
for (i = first0; i <= last0; i++)
{
set_color_context (DELETE_CONTEXT);
while (next && next->line0 + next->deleted <= i)
next = next->link;
prefix = " ";
if (next && next->line0 <= i)
{
prefix = (next->inserted > 0 ? "!" : "-");
}
print_1_line_nl (prefix, &files[0].linbuf[i],
1
);
set_color_context (RESET_CONTEXT);
if (files[0].linbuf[i + 1][-1] == '\n')
putc_unlocked ('\n',out);
}
}
set_color_context (LINE_NUMBER_CONTEXT);
fputs_unlocked ("--- ",out);
print_context_number_range (&files[1], first1, last1);
fputs_unlocked (" ----",out);
set_color_context (RESET_CONTEXT);
putc_unlocked ('\n',out);
if (changes & NEW)
{
struct change *next = hunk;
for (i = first1; i <= last1; i++)
{
set_color_context (ADD_CONTEXT);
while (next && next->line1 + next->inserted <= i)
next = next->link;
prefix = " ";
if (next && next->line1 <= i)
{
prefix = (next->deleted > 0 ? "!" : "+");
}
print_1_line_nl (prefix, &files[1].linbuf[i],
1
);
set_color_context (RESET_CONTEXT);
if (files[1].linbuf[i + 1][-1] == '\n')
putc_unlocked ('\n',out);
}
}
}
| unsigned long pr_context_hunk(long *a1)
{
long v1;
long v2;
const char *v3;
const char *v4;
int v6;
long v7;
long v8;
long v9;
long v10;
long i;
const char *v12;
char *function;
long *v14;
long *v15;
FILE *stream;
unsigned long v17;
v17 = __readfsqword(0x28u);
v6 = analyze_hunk(a1, &v7, &v8, &v9, &v10);
if ( v6 )
{
i = -files[29];
v1 = v7 - context;
if ( i >= v7 - context )
v1 = i;
v7 = v1;
v2 = v9 - context;
if ( i >= v9 - context )
v2 = i;
v9 = v2;
if ( files[26] - context <= v8 )
v8 = files[26] - 1LL;
else
v8 += context;
if ( files[64] - context <= v10 )
v10 = files[64] - 1LL;
else
v10 += context;
function = 0LL;
if ( function_regexp.fastmap )
function = find_function(files[23], v7);
begin_output();
stream = outfile;
fputs_unlocked("***************", outfile);
if ( function )
print_context_function(stream, (long)function);
putc_unlocked(10, stream);
set_color_context(4LL);
fputs_unlocked("*** ", stream);
print_context_number_range((long)files, v7, v8);
fputs_unlocked(" ****", stream);
set_color_context(3LL);
putc_unlocked(10, stream);
if ( (v6 & 1) != 0 )
{
v14 = a1;
for ( i = v7; i <= v8; ++i )
{
set_color_context(2LL);
while ( v14 && i >= v14[3] + v14[2] )
v14 = (long *)*v14;
v12 = " ";
if ( v14 && i >= v14[3] )
{
if ( v14[1] <= 0 )
v3 = "-";
else
v3 = "!";
v12 = v3;
}
print_1_line_nl(v12, files[23] + 8 * i, 1LL);
set_color_context(3LL);
if ( *(_BYTE *)(*(_QWORD *)(8 * (i + 1) + files[23]) - 1LL) == 10 )
putc_unlocked(10, stream);
}
}
set_color_context(4LL);
fputs_unlocked("--- ", stream);
print_context_number_range((long)&files[38], v9, v10);
fputs_unlocked(" ----", stream);
set_color_context(3LL);
putc_unlocked(10, stream);
if ( (v6 & 2) != 0 )
{
v15 = a1;
for ( i = v9; i <= v10; ++i )
{
set_color_context(1LL);
while ( v15 && i >= v15[4] + v15[1] )
v15 = (long *)*v15;
v12 = " ";
if ( v15 && i >= v15[4] )
{
if ( v15[2] <= 0 )
v4 = "+";
else
v4 = "!";
v12 = v4;
}
print_1_line_nl(v12, files[61] + 8 * i, 1LL);
set_color_context(3LL);
if ( *(_BYTE *)(*(_QWORD *)(8 * (i + 1) + files[61]) - 1LL) == 10 )
putc_unlocked(10, stream);
}
}
}
return __readfsqword(0x28u) ^ v17;
}
|
static char *
print_line_tail (char *beg, const char *lim, const char *line_color)
{
idx_t eol_size;
idx_t tail_size;
eol_size = (lim > beg && lim[-1] == eolbyte);
eol_size += (lim - eol_size > beg && lim[-(1 + eol_size)] == '\r');
tail_size = lim - eol_size - beg;
if (tail_size > 0)
{
pr_sgr_start (line_color);
fwrite_errno (beg, 1, tail_size);
beg += tail_size;
pr_sgr_end (line_color);
}
return beg;
}
| char * print_line_tail(char *a1, unsigned long a2, unsigned char *a3)
{
_BOOL4 v3;
_BOOL4 v4;
char *v7;
_BOOL8 v8;
signed long v9;
v7 = a1;
v3 = a2 > (unsigned long)a1 && *(_BYTE *)(a2 - 1) == eolbyte;
v8 = v3;
v4 = (unsigned long)a1 < a2 - v3 && *(_BYTE *)(~(long)v3 + a2) == 13;
v9 = a2 - (v4 + v8) - (_QWORD)a1;
if ( v9 > 0 )
{
pr_sgr_start(a3);
fwrite_errno(a1, 1uLL, v9);
v7 = &a1[v9];
pr_sgr_end(a3);
}
return v7;
}
|
static
_Bool
fillbuf (struct buffer *buf, FILE *fp, char const *file)
{
struct keyfield const *key = keylist;
char eol = eolchar;
size_t line_bytes = buf->line_bytes;
size_t mergesize = merge_buffer_size - (2 + sizeof (struct line));
if (buf->eof)
return
0
;
if (buf->used != buf->left)
{
memmove (buf->buf, buf->buf + buf->used - buf->left, buf->left);
buf->used = buf->left;
buf->nlines = 0;
}
while (
1
)
{
char *ptr = buf->buf + buf->used;
struct line *linelim = buffer_linelim (buf);
struct line *line = linelim - buf->nlines;
size_t avail = (char *) linelim - buf->nlines * line_bytes - ptr;
char *line_start = buf->nlines ? line->text + line->length : buf->buf;
while (line_bytes + 1 < avail)
{
size_t readsize = (avail - 1) / (line_bytes + 1);
size_t bytes_read = fread_unlocked (ptr,1,readsize,fp);
char *ptrlim = ptr + bytes_read;
char *p;
avail -= bytes_read;
if (bytes_read != readsize)
{
if (ferror_unlocked (fp))
sort_die (gettext ("read failed"), file);
if (feof_unlocked (fp))
{
buf->eof =
1
;
if (buf->buf == ptrlim)
return
0
;
if (line_start != ptrlim && ptrlim[-1] != eol)
*ptrlim++ = eol;
}
}
while ((p = memchr (ptr, eol, ptrlim - ptr)))
{
*p = '\0';
ptr = p + 1;
line--;
line->text = line_start;
line->length = ptr - line_start;
mergesize =
(((
mergesize
)>(
line->length
))?(
mergesize
):(
line->length
))
;
avail -= line_bytes;
if (key)
{
line->keylim = (key->eword ==
(18446744073709551615UL)
? p
: limfield (line, key));
if (key->sword !=
(18446744073709551615UL)
)
line->keybeg = begfield (line, key);
else
{
if (key->skipsblanks)
while (blanks[to_uchar (*line_start)])
line_start++;
line->keybeg = line_start;
}
}
line_start = ptr;
}
ptr = ptrlim;
if (buf->eof)
break;
}
buf->used = ptr - buf->buf;
buf->nlines = buffer_linelim (buf) - line;
if (buf->nlines != 0)
{
buf->left = ptr - line_start;
merge_buffer_size = mergesize + (2 + sizeof (struct line));
return
1
;
}
{
size_t line_alloc = buf->alloc / sizeof (struct line);
buf->buf = x2nrealloc (buf->buf, &line_alloc, sizeof (struct line));
buf->alloc = line_alloc * sizeof (struct line);
}
}
}
| int fillbuf(struct_0 *a0, void* a1, unsigned long long a2) {
char v0;
unsigned long long v1;
unsigned long long v2;
void* v3;
unsigned long long v4[4];
unsigned long v5;
char *v6;
void* v7;
struct_1 *v8;
unsigned long v9;
unsigned long v10;
unsigned int v11;
unsigned long v12;
char *v13;
unsigned int v15;
char *v16;
unsigned long long v17;
char *v18;
unsigned long long v19;
unsigned long v20;
v8 = keylist;
v0 = eolchar;
v9 = a0->field_28;
v2 = merge_buffer_size - 34;
if (a0->field_30) {
v15 = 0;
return v15;
}
if (a0->field_8 != a0->field_20) {
memmove(a0->field_0, a0->field_0 + a0->field_8 - a0->field_20, a0->field_20);
a0->field_8 = a0->field_20;
a0->field_10 = 0;
}
while (true) {
v3 = a0->field_8 + a0->field_0;
v10 = buffer_linelim(a0);
v4[0] = v10 + -(a0->field_10 << 5);
v5 = v10 + -(v9 * a0->field_10) - v3;
v15 = (!a0->field_10 ? v4[1] + v4[0] : a0->field_0);
v6 = v15;
while (true) {
if (v5 <= v9 + 1)
break;
*(&v11) = (0 CONCAT v5 - 1) /m (v9 + 1);
v12 = fread_unlocked(v3, 0x1, *(&v11), a1);
v7 = v12 + v3;
v5 -= v12;
if (v12 != *(&v11)) {
if (ferror_unlocked(a1)) {
v20 = gettext("read failed");
sort_die(v20, a2, v20);
} else if (feof_unlocked(a1)) {
a0->field_30 = 1;
if (v7 == a0->field_0) {
v15 = 0;
return v15;
} else if (v6 != v7 && v0 != v7[1]) {
v16 = v7;
v7 += 1;
*(v16) = v0;
}
}
}
while (true) {
v15 = memchr(v3, v0, v7 - v3);
v13 = v15;
if (!v13)
break;
*(v13) = 0;
v3 = v13 + 1;
v4[0] = v4 + 1;
v4[0] = v6;
v4[1] = v3 - v6;
v17 = v4[1];
if (v4[1] <= v2)
v17 = v2;
v2 = v17;
v5 -= v9;
if (v8) {
if (v8->field_10 == -1)
v18 = v13;
else
v18 = limfield(v4, v8);
v4[3] = v18;
if (v8->field_0 == -1) {
if (v8->field_30) {
while (true) {
v19 = to_uchar(*(v6));
*(&v19) = *(v19 + &blanks);
if (!v19)
break;
v6 += 1;
}
}
v4[2] = v6;
} else {
v4[2] = begfield(v4, v8);
}
}
v6 = v3;
}
v3 = v7;
if (a0->field_30)
break;
}
a0->field_8 = v3 - a0->field_0;
a0->field_10 = buffer_linelim(a0) + -0x1 * v4 >> 5;
if (a0->field_10)
break;
v1 = a0->field_18 >> 5;
a0->field_0 = x2nrealloc(a0->field_0, &v1, 0x20);
a0->field_18 = v1 * 32;
}
a0->field_20 = v3 - v6;
merge_buffer_size = v2 + 34;
v15 = 1;
return v15;
}
|
static int parse_args(int argc, char **argv,
struct ifreq *ifr, uid_t *uid, gid_t *gid)
{
int count = 0;
memset(ifr, 0, sizeof(*ifr));
ifr->ifr_ifru.ifru_flags |= 0x1000;
while (argc > 0) {
if (matches(*argv, "mode") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (matches(*argv, "tun") == 0) {
if (ifr->ifr_ifru.ifru_flags & 0x0002) {
fprintf(
stderr
, "You managed to ask for more than one tunnel mode.\n");
exit(-1);
}
ifr->ifr_ifru.ifru_flags |= 0x0001;
} else if (matches(*argv, "tap") == 0) {
if (ifr->ifr_ifru.ifru_flags & 0x0001) {
fprintf(
stderr
, "You managed to ask for more than one tunnel mode.\n");
exit(-1);
}
ifr->ifr_ifru.ifru_flags |= 0x0002;
} else {
fprintf(
stderr
, "Unknown tunnel mode \"%s\"\n", *argv);
exit(-1);
}
} else if (uid && matches(*argv, "user") == 0) {
char *end;
unsigned long user;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (**argv && ((user = strtol(*argv, &end, 10)), !*end))
*uid = user;
else {
struct passwd *pw = getpwnam(*argv);
if (!pw) {
fprintf(
stderr
, "invalid user \"%s\"\n", *argv);
exit(-1);
}
*uid = pw->pw_uid;
}
} else if (gid && matches(*argv, "group") == 0) {
char *end;
unsigned long group;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (**argv && ((group = strtol(*argv, &end, 10)), !*end))
*gid = group;
else {
struct group *gr = getgrnam(*argv);
if (!gr) {
fprintf(
stderr
, "invalid group \"%s\"\n", *argv);
exit(-1);
}
*gid = gr->gr_gid;
}
} else if (matches(*argv, "pi") == 0) {
ifr->ifr_ifru.ifru_flags &= ~0x1000;
} else if (matches(*argv, "one_queue") == 0) {
ifr->ifr_ifru.ifru_flags |= 0x2000;
} else if (matches(*argv, "vnet_hdr") == 0) {
ifr->ifr_ifru.ifru_flags |= 0x4000;
} else if (matches(*argv, "multi_queue") == 0) {
ifr->ifr_ifru.ifru_flags |= 0x0100;
} else if (matches(*argv, "dev") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_ifname(ifr->ifr_ifrn.ifrn_name, *argv))
invarg("\"dev\" not a valid ifname", *argv);
} else {
if (matches(*argv, "name") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
} else if (matches(*argv, "help") == 0)
usage();
if (ifr->ifr_ifrn.ifrn_name[0])
duparg2("name", *argv);
if (get_ifname(ifr->ifr_ifrn.ifrn_name, *argv))
invarg("\"name\" not a valid ifname", *argv);
}
count++;
argc--; argv++;
}
if (!(ifr->ifr_ifru.ifru_flags & 0x000f)) {
fprintf(
stderr
, "You failed to specify a tunnel mode\n");
return -1;
}
return 0;
}
| undefined8 parse_args(int param_1,char **param_2,char *param_3,__uid_t *param_4,__gid_t *param_5)
{
char cVar1;
int iVar2;
undefined8 uVar3;
long in_FS_OFFSET;
char **local_58;
int local_4c;
char *local_38;
long local_30;
passwd *local_28;
long local_20;
group *local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
memset(param_3,0,0x28);
*(ushort *)(param_3 + 0x10) =
*(ushort *)(param_3 + 0x10) & 0xff |
(ushort)(byte)((ulong)*(ushort *)(param_3 + 0x10) >> 8) << 8 | 0x1000;
local_58 = param_2;
local_4c = param_1;
do {
if (local_4c < 1) {
if ((*(ushort *)(param_3 + 0x10) & 0xf) == 0) {
fprintf(stderr,"You failed to specify a tunnel mode\n");
uVar3 = 0xffffffff;
}
else {
uVar3 = 0;
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar3;
}
cVar1 = matches(*local_58,&DAT_00101c66);
if (cVar1 == '\x01') {
if (param_4 != (__uid_t *)0x0) {
cVar1 = matches(*local_58,&DAT_00101cc1);
if (cVar1 != '\x01') {
local_58 = local_58 + 1;
local_4c = local_4c + -1;
if (local_4c < 1) {
incomplete_command();
}
if (**local_58 != '\0') {
local_30 = strtol(*local_58,&local_38,10);
if (*local_38 == '\0') {
*param_4 = (__uid_t)local_30;
goto LAB_001008d9;
}
}
local_28 = getpwnam(*local_58);
if (local_28 == (passwd *)0x0) {
fprintf(stderr,"invalid user \"%s\"\n",*local_58);
exit(-1);
}
*param_4 = local_28->pw_uid;
goto LAB_001008d9;
}
}
if (param_5 != (__gid_t *)0x0) {
cVar1 = matches(*local_58,"group");
if (cVar1 != '\x01') {
local_58 = local_58 + 1;
local_4c = local_4c + -1;
if (local_4c < 1) {
incomplete_command();
}
if (**local_58 != '\0') {
local_20 = strtol(*local_58,&local_38,10);
if (*local_38 == '\0') {
*param_5 = (__gid_t)local_20;
goto LAB_001008d9;
}
}
local_18 = getgrnam(*local_58);
if (local_18 == (group *)0x0) {
fprintf(stderr,"invalid group \"%s\"\n",*local_58);
exit(-1);
}
*param_5 = local_18->gr_gid;
goto LAB_001008d9;
}
}
cVar1 = matches(*local_58,&DAT_00101cf3);
if (cVar1 == '\x01') {
cVar1 = matches(*local_58,"one_queue");
if (cVar1 == '\x01') {
cVar1 = matches(*local_58,"vnet_hdr");
if (cVar1 == '\x01') {
cVar1 = matches(*local_58,"multi_queue");
if (cVar1 == '\x01') {
cVar1 = matches(*local_58,&DAT_00101d15);
if (cVar1 != '\x01') {
local_58 = local_58 + 1;
local_4c = local_4c + -1;
if (local_4c < 1) {
incomplete_command();
}
iVar2 = get_ifname(param_3,*local_58);
if (iVar2 == 0) goto LAB_001008d9;
invarg("\"dev\" not a valid ifname",*local_58);
}
cVar1 = matches(*local_58,&DAT_00101d32);
if (cVar1 == '\x01') {
LAB_00100866:
cVar1 = matches(*local_58,&DAT_00101d37);
if (cVar1 != '\x01') {
usage();
}
}
else {
local_58 = local_58 + 1;
local_4c = local_4c + -1;
if (local_4c < 1) {
incomplete_command();
goto LAB_00100866;
}
}
if (*param_3 != '\0') {
duparg2(&DAT_00101d32,*local_58);
}
iVar2 = get_ifname(param_3,*local_58);
if (iVar2 != 0) {
invarg("\"name\" not a valid ifname",*local_58);
}
}
else {
*(ushort *)(param_3 + 0x10) =
*(ushort *)(param_3 + 0x10) & 0xff |
(ushort)(byte)((ulong)*(ushort *)(param_3 + 0x10) >> 8) << 8 | 0x100;
}
}
else {
*(ushort *)(param_3 + 0x10) =
*(ushort *)(param_3 + 0x10) & 0xff |
(ushort)(byte)((ulong)*(ushort *)(param_3 + 0x10) >> 8) << 8 | 0x4000;
}
}
else {
*(ushort *)(param_3 + 0x10) =
*(ushort *)(param_3 + 0x10) & 0xff |
(ushort)(byte)((ulong)*(ushort *)(param_3 + 0x10) >> 8) << 8 | 0x2000;
}
}
else {
*(ushort *)(param_3 + 0x10) =
*(ushort *)(param_3 + 0x10) & 0xff |
((byte)((ulong)*(ushort *)(param_3 + 0x10) >> 8) & 0xef) << 8;
}
}
else {
local_58 = local_58 + 1;
local_4c = local_4c + -1;
if (local_4c < 1) {
incomplete_command();
}
cVar1 = matches(*local_58,&DAT_00101c6b);
if (cVar1 == '\x01') {
cVar1 = matches(*local_58,&DAT_00101ca3);
if (cVar1 == '\x01') {
fprintf(stderr,"Unknown tunnel mode \"%s\"\n",*local_58);
exit(-1);
}
if ((*(ushort *)(param_3 + 0x10) & 1) != 0) {
fprintf(stderr,"You managed to ask for more than one tunnel mode.\n");
exit(-1);
}
*(ushort *)(param_3 + 0x10) = *(ushort *)(param_3 + 0x10) | 2;
}
else {
if ((*(ushort *)(param_3 + 0x10) & 2) != 0) {
fprintf(stderr,"You managed to ask for more than one tunnel mode.\n");
exit(-1);
}
*(ushort *)(param_3 + 0x10) = *(ushort *)(param_3 + 0x10) | 1;
}
}
LAB_001008d9:
local_4c = local_4c + -1;
local_58 = local_58 + 1;
} while( true );
}
|
static size_t
component_len (char const *f)
{
size_t len;
for (len = 1; f[len] != '/' && f[len]; len++)
continue;
return len;
}
| long component_len(long a1)
{
long i;
for ( i = 1LL; *(_BYTE *)(a1 + i) != 47 && *(_BYTE *)(a1 + i); ++i )
;
return i;
}
|
int template_parse(const char *template)
{
unsigned int i;
int ret;
cfg_option_t pov;
cfg_option_t val;
char tmpstr[256];
pov = cfg_load(template);
if (pov ==
((void *)0)
) {
perror("configFileLoad");
fprintf(
stderr
, "Error loading template: %s\n", template);
exit(1);
}
for (val = pov; val->name; val++) {
if (handle_option(val) == 0) {
fprintf(
stderr
, "Warning: skipping unknown option '%s'\n", val->name);
}
}
val = cfg_next(pov, "unit"); if (val !=
((void *)0)
) { if (cfg.unit ==
((void *)0)
) { i = 0; cfg.unit = malloc(sizeof(char*)*128); if (cfg.unit ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "unit")!=0) continue; cfg.unit[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.unit[i] =
((void *)0)
; } };
if (cfg.unit ==
((void *)0)
) {
val = cfg_next(pov, "ou"); if (val !=
((void *)0)
) { if (cfg.unit ==
((void *)0)
) { i = 0; cfg.unit = malloc(sizeof(char*)*128); if (cfg.unit ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "ou")!=0) continue; cfg.unit[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.unit[i] =
((void *)0)
; } };
}
val = cfg_next(pov, "organization"); if (val !=
((void *)0)
) { if (cfg.organization ==
((void *)0)
) { i = 0; cfg.organization = malloc(sizeof(char*)*128); if (cfg.organization ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "organization")!=0) continue; cfg.organization[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.organization[i] =
((void *)0)
; } };
if (cfg.organization ==
((void *)0)
) {
val = cfg_next(pov, "o"); if (val !=
((void *)0)
) { if (cfg.organization ==
((void *)0)
) { i = 0; cfg.organization = malloc(sizeof(char*)*128); if (cfg.organization ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "o")!=0) continue; cfg.organization[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.organization[i] =
((void *)0)
; } };
}
val = cfg_next(pov, "locality");
if (val !=
((void *)0)
)
cfg.locality = strdup(val->value);
val = cfg_next(pov, "state");
if (val !=
((void *)0)
)
cfg.state = strdup(val->value);
val = cfg_next(pov, "dn");
if (val !=
((void *)0)
)
cfg.dn = strdup(val->value);
val = cfg_next(pov, "cn");
if (val !=
((void *)0)
)
cfg.cn = strdup(val->value);
val = cfg_next(pov, "uid");
if (val !=
((void *)0)
)
cfg.uid = strdup(val->value);
val = cfg_next(pov, "issuer_unique_id");
if (val !=
((void *)0)
)
{ gnutls_datum_t _input = {(void*)val->value, strlen(val->value)}; gnutls_datum_t _output; ret = gnutls_hex_decode2(&_input, &_output); if (ret < 0) { fprintf(
stderr
, "error in hex ID: %s\n", val->value); exit(1); } cfg.issuer_unique_id = _output.data; cfg.issuer_unique_id_size = _output.size; };
val = cfg_next(pov, "subject_unique_id");
if (val !=
((void *)0)
)
{ gnutls_datum_t _input = {(void*)val->value, strlen(val->value)}; gnutls_datum_t _output; ret = gnutls_hex_decode2(&_input, &_output); if (ret < 0) { fprintf(
stderr
, "error in hex ID: %s\n", val->value); exit(1); } cfg.subject_unique_id = _output.data; cfg.subject_unique_id_size = _output.size; };
val = cfg_next(pov, "challenge_password");
if (val !=
((void *)0)
)
cfg.challenge_password = strdup(val->value);
val = cfg_next(pov, "password");
if (val !=
((void *)0)
)
cfg.password = strdup(val->value);
val = cfg_next(pov, "pkcs9_email");
if (val !=
((void *)0)
)
cfg.pkcs9_email = strdup(val->value);
val = cfg_next(pov, "country");
if (val !=
((void *)0)
)
cfg.country = strdup(val->value);
val = cfg_next(pov, "expiration_date");
if (val !=
((void *)0)
)
cfg.expiration_date = strdup(val->value);
val = cfg_next(pov, "activation_date");
if (val !=
((void *)0)
)
cfg.activation_date = strdup(val->value);
val = cfg_next(pov, "crl_revocation_date");
if (val !=
((void *)0)
)
cfg.revocation_date = strdup(val->value);
val = cfg_next(pov, "crl_this_update_date");
if (val !=
((void *)0)
)
cfg.this_update_date = strdup(val->value);
val = cfg_next(pov, "crl_next_update_date");
if (val !=
((void *)0)
)
cfg.next_update_date = strdup(val->value);
val = cfg_next(pov, "inhibit_anypolicy_skip_certs"); if (val !=
((void *)0)
) { cfg.skip_certs = strtol(val->value,
((void *)0)
, 10); };
for (i = 0; i < 8; i++) {
snprintf(tmpstr, sizeof(tmpstr), "policy%d", i + 1);
val = cfg_next(pov, tmpstr);
if (val !=
((void *)0)
)
cfg.policy_oid[i] = strdup(val->value);
if (cfg.policy_oid[i] !=
((void *)0)
) {
snprintf(tmpstr, sizeof(tmpstr), "policy%d_url",
i + 1);
val = cfg_next(pov, tmpstr);
if (val !=
((void *)0)
)
cfg.policy_url[i] = strdup(val->value);
snprintf(tmpstr, sizeof(tmpstr), "policy%d_txt",
i + 1);
val = cfg_next(pov, tmpstr);
if (val !=
((void *)0)
) {
cfg.policy_txt[i] = strdup(val->value);
}
}
}
val = cfg_next(pov, "dc"); if (val !=
((void *)0)
) { if (cfg.dc ==
((void *)0)
) { i = 0; cfg.dc = malloc(sizeof(char*)*128); if (cfg.dc ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "dc")!=0) continue; cfg.dc[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.dc[i] =
((void *)0)
; } };
val = cfg_next(pov, "dns_name"); if (val !=
((void *)0)
) { if (cfg.dns_name ==
((void *)0)
) { i = 0; cfg.dns_name = malloc(sizeof(char*)*128); if (cfg.dns_name ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "dns_name")!=0) continue; cfg.dns_name[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.dns_name[i] =
((void *)0)
; } };
val = cfg_next(pov, "uri"); if (val !=
((void *)0)
) { if (cfg.uri ==
((void *)0)
) { i = 0; cfg.uri = malloc(sizeof(char*)*128); if (cfg.uri ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "uri")!=0) continue; cfg.uri[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.uri[i] =
((void *)0)
; } };
val = cfg_next(pov, "krb5_principal"); if (val !=
((void *)0)
) { if (cfg.krb5_principal ==
((void *)0)
) { i = 0; cfg.krb5_principal = malloc(sizeof(char*)*128); if (cfg.krb5_principal ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "krb5_principal")!=0) continue; cfg.krb5_principal[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.krb5_principal[i] =
((void *)0)
; } };
val = cfg_next(pov, "other_name"); if (val !=
((void *)0)
) { char *str; char *p; if (cfg.other_name ==
((void *)0)
) { i = 0; cfg.other_name = malloc(sizeof(char*)*128); if (cfg.other_name ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "other_name")!=0) continue; str = strdup(val->value); if (str ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; if ((p=strchr(str, ' ')) ==
((void *)0)
&& (p=strchr(str, '\t')) ==
((void *)0)
) { fprintf(
stderr
, "Error parsing %s\n", "other_name"); exit(1); } p[0] = 0; p++; cfg.other_name[i] = strdup(str); while(*p==' ' || *p == '\t') p++; if (p[0] == 0) { fprintf(
stderr
, "Error (2) parsing %s\n", "other_name"); exit(1); } cfg.other_name[i+1] = strdup(p); i+=2; free(str); if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.other_name[i] =
((void *)0)
; } };
val = cfg_next(pov, "other_name_octet"); if (val !=
((void *)0)
) { char *str; char *p; if (cfg.other_name_octet ==
((void *)0)
) { i = 0; cfg.other_name_octet = malloc(sizeof(char*)*128); if (cfg.other_name_octet ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "other_name_octet")!=0) continue; str = strdup(val->value); if (str ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; if ((p=strchr(str, ' ')) ==
((void *)0)
&& (p=strchr(str, '\t')) ==
((void *)0)
) { fprintf(
stderr
, "Error parsing %s\n", "other_name_octet"); exit(1); } p[0] = 0; p++; cfg.other_name_octet[i] = strdup(str); while(*p==' ' || *p == '\t') p++; if (p[0] == 0) { fprintf(
stderr
, "Error (2) parsing %s\n", "other_name_octet"); exit(1); } cfg.other_name_octet[i+1] = strdup(p); i+=2; free(str); if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.other_name_octet[i] =
((void *)0)
; } };
val = cfg_next(pov, "other_name_utf8"); if (val !=
((void *)0)
) { char *str; char *p; if (cfg.other_name_utf8 ==
((void *)0)
) { i = 0; cfg.other_name_utf8 = malloc(sizeof(char*)*128); if (cfg.other_name_utf8 ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "other_name_utf8")!=0) continue; str = strdup(val->value); if (str ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; if ((p=strchr(str, ' ')) ==
((void *)0)
&& (p=strchr(str, '\t')) ==
((void *)0)
) { fprintf(
stderr
, "Error parsing %s\n", "other_name_utf8"); exit(1); } p[0] = 0; p++; cfg.other_name_utf8[i] = strdup(str); while(*p==' ' || *p == '\t') p++; if (p[0] == 0) { fprintf(
stderr
, "Error (2) parsing %s\n", "other_name_utf8"); exit(1); } cfg.other_name_utf8[i+1] = strdup(p); i+=2; free(str); if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.other_name_utf8[i] =
((void *)0)
; } };
val = cfg_next(pov, "xmpp_name"); if (val !=
((void *)0)
) { if (cfg.xmpp_name ==
((void *)0)
) { i = 0; cfg.xmpp_name = malloc(sizeof(char*)*128); if (cfg.xmpp_name ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "xmpp_name")!=0) continue; cfg.xmpp_name[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.xmpp_name[i] =
((void *)0)
; } };
val = cfg_next(pov, "ip_address"); if (val !=
((void *)0)
) { if (cfg.ip_addr ==
((void *)0)
) { i = 0; cfg.ip_addr = malloc(sizeof(char*)*128); if (cfg.ip_addr ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "ip_address")!=0) continue; cfg.ip_addr[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.ip_addr[i] =
((void *)0)
; } };
val = cfg_next(pov, "email"); if (val !=
((void *)0)
) { if (cfg.email ==
((void *)0)
) { i = 0; cfg.email = malloc(sizeof(char*)*128); if (cfg.email ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "email")!=0) continue; cfg.email[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.email[i] =
((void *)0)
; } };
val = cfg_next(pov, "key_purpose_oid"); if (val !=
((void *)0)
) { if (cfg.key_purpose_oids ==
((void *)0)
) { i = 0; cfg.key_purpose_oids = malloc(sizeof(char*)*128); if (cfg.key_purpose_oids ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "key_purpose_oid")!=0) continue; cfg.key_purpose_oids[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.key_purpose_oids[i] =
((void *)0)
; } };
val = cfg_next(pov, "nc_exclude_ip"); if (val !=
((void *)0)
) { if (cfg.excluded_nc_ip ==
((void *)0)
) { i = 0; cfg.excluded_nc_ip = malloc(sizeof(char*)*128); if (cfg.excluded_nc_ip ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "nc_exclude_ip")!=0) continue; cfg.excluded_nc_ip[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.excluded_nc_ip[i] =
((void *)0)
; } };
val = cfg_next(pov, "nc_exclude_dns"); if (val !=
((void *)0)
) { if (cfg.excluded_nc_dns ==
((void *)0)
) { i = 0; cfg.excluded_nc_dns = malloc(sizeof(char*)*128); if (cfg.excluded_nc_dns ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "nc_exclude_dns")!=0) continue; cfg.excluded_nc_dns[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.excluded_nc_dns[i] =
((void *)0)
; } };
val = cfg_next(pov, "nc_exclude_email"); if (val !=
((void *)0)
) { if (cfg.excluded_nc_email ==
((void *)0)
) { i = 0; cfg.excluded_nc_email = malloc(sizeof(char*)*128); if (cfg.excluded_nc_email ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "nc_exclude_email")!=0) continue; cfg.excluded_nc_email[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.excluded_nc_email[i] =
((void *)0)
; } };
val = cfg_next(pov, "nc_permit_ip"); if (val !=
((void *)0)
) { if (cfg.permitted_nc_ip ==
((void *)0)
) { i = 0; cfg.permitted_nc_ip = malloc(sizeof(char*)*128); if (cfg.permitted_nc_ip ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "nc_permit_ip")!=0) continue; cfg.permitted_nc_ip[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.permitted_nc_ip[i] =
((void *)0)
; } };
val = cfg_next(pov, "nc_permit_dns"); if (val !=
((void *)0)
) { if (cfg.permitted_nc_dns ==
((void *)0)
) { i = 0; cfg.permitted_nc_dns = malloc(sizeof(char*)*128); if (cfg.permitted_nc_dns ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "nc_permit_dns")!=0) continue; cfg.permitted_nc_dns[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.permitted_nc_dns[i] =
((void *)0)
; } };
val = cfg_next(pov, "nc_permit_email"); if (val !=
((void *)0)
) { if (cfg.permitted_nc_email ==
((void *)0)
) { i = 0; cfg.permitted_nc_email = malloc(sizeof(char*)*128); if (cfg.permitted_nc_email ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "nc_permit_email")!=0) continue; cfg.permitted_nc_email[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.permitted_nc_email[i] =
((void *)0)
; } };
val = cfg_next(pov, "dn_oid"); if (val !=
((void *)0)
) { char *str; char *p; if (cfg.dn_oid ==
((void *)0)
) { i = 0; cfg.dn_oid = malloc(sizeof(char*)*128); if (cfg.dn_oid ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "dn_oid")!=0) continue; str = strdup(val->value); if (str ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; if ((p=strchr(str, ' ')) ==
((void *)0)
&& (p=strchr(str, '\t')) ==
((void *)0)
) { fprintf(
stderr
, "Error parsing %s\n", "dn_oid"); exit(1); } p[0] = 0; p++; cfg.dn_oid[i] = strdup(str); while(*p==' ' || *p == '\t') p++; if (p[0] == 0) { fprintf(
stderr
, "Error (2) parsing %s\n", "dn_oid"); exit(1); } cfg.dn_oid[i+1] = strdup(p); i+=2; free(str); if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.dn_oid[i] =
((void *)0)
; } };
val = cfg_next(pov, "add_extension"); if (val !=
((void *)0)
) { char *str; char *p; if (cfg.extensions ==
((void *)0)
) { i = 0; cfg.extensions = malloc(sizeof(char*)*128); if (cfg.extensions ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "add_extension")!=0) continue; str = strdup(val->value); if (str ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; if ((p=strchr(str, ' ')) ==
((void *)0)
&& (p=strchr(str, '\t')) ==
((void *)0)
) { fprintf(
stderr
, "Error parsing %s\n", "add_extension"); exit(1); } p[0] = 0; p++; cfg.extensions[i] = strdup(str); while(*p==' ' || *p == '\t') p++; if (p[0] == 0) { fprintf(
stderr
, "Error (2) parsing %s\n", "add_extension"); exit(1); } cfg.extensions[i+1] = strdup(p); i+=2; free(str); if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.extensions[i] =
((void *)0)
; } };
val = cfg_next(pov, "add_critical_extension"); if (val !=
((void *)0)
) { char *str; char *p; if (cfg.crit_extensions ==
((void *)0)
) { i = 0; cfg.crit_extensions = malloc(sizeof(char*)*128); if (cfg.crit_extensions ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "add_critical_extension")!=0) continue; str = strdup(val->value); if (str ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; if ((p=strchr(str, ' ')) ==
((void *)0)
&& (p=strchr(str, '\t')) ==
((void *)0)
) { fprintf(
stderr
, "Error parsing %s\n", "add_critical_extension"); exit(1); } p[0] = 0; p++; cfg.crit_extensions[i] = strdup(str); while(*p==' ' || *p == '\t') p++; if (p[0] == 0) { fprintf(
stderr
, "Error (2) parsing %s\n", "add_critical_extension"); exit(1); } cfg.crit_extensions[i+1] = strdup(p); i+=2; free(str); if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.crit_extensions[i] =
((void *)0)
; } };
val = cfg_next(pov, "crl_dist_points"); if (val !=
((void *)0)
) { if (cfg.crl_dist_points ==
((void *)0)
) { i = 0; cfg.crl_dist_points = malloc(sizeof(char*)*128); if (cfg.crl_dist_points ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "crl_dist_points")!=0) continue; cfg.crl_dist_points[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.crl_dist_points[i] =
((void *)0)
; } };
val = cfg_next(pov, "pkcs12_key_name");
if (val !=
((void *)0)
)
cfg.pkcs12_key_name = strdup(val->value);
val = cfg_next(pov, "serial");
if (val !=
((void *)0)
)
{ gnutls_datum_t _output; ret = serial_decode(val->value, &_output); if (ret < 0) { fprintf(
stderr
, "error parsing number: %s\n", val->value); exit(1); } cfg.serial = _output.data; cfg.serial_size = _output.size; };
val = cfg_next(pov, "expiration_days"); if (val !=
((void *)0)
) { cfg.expiration_days = strtol(val->value,
((void *)0)
, 10); };
val = cfg_next(pov, "crl_next_update"); if (val !=
((void *)0)
) { cfg.crl_next_update = strtol(val->value,
((void *)0)
, 10); };
val = cfg_next(pov, "crl_number");
if (val !=
((void *)0)
)
{ gnutls_datum_t _output; ret = serial_decode(val->value, &_output); if (ret < 0) { fprintf(
stderr
, "error parsing number: %s\n", val->value); exit(1); } cfg.crl_number = _output.data; cfg.crl_number_size = _output.size; };
val = cfg_next(pov, "path_len"); if (val !=
((void *)0)
) { cfg.path_len = strtol(val->value,
((void *)0)
, 10); };
val = cfg_next(pov, "proxy_policy_language");
if (val !=
((void *)0)
)
cfg.proxy_policy_language = strdup(val->value);
val = cfg_next(pov, "ocsp_uri"); if (val !=
((void *)0)
) { if (cfg.ocsp_uris ==
((void *)0)
) { i = 0; cfg.ocsp_uris = malloc(sizeof(char*)*128); if (cfg.ocsp_uris ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "ocsp_uri")!=0) continue; cfg.ocsp_uris[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.ocsp_uris[i] =
((void *)0)
; } };
val = cfg_next(pov, "ca_issuers_uri"); if (val !=
((void *)0)
) { if (cfg.ca_issuers_uris ==
((void *)0)
) { i = 0; cfg.ca_issuers_uris = malloc(sizeof(char*)*128); if (cfg.ca_issuers_uris ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "ca_issuers_uri")!=0) continue; cfg.ca_issuers_uris[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.ca_issuers_uris[i] =
((void *)0)
; } };
val = cfg_next(pov, "ca"); if (val !=
((void *)0)
) { cfg.ca = 1; };
val = cfg_next(pov, "honor_crq_extensions"); if (val !=
((void *)0)
) { cfg.honor_crq_extensions = 1; };
val = cfg_next(pov, "honor_crq_ext"); if (val !=
((void *)0)
) { if (cfg.exts_to_honor ==
((void *)0)
) { i = 0; cfg.exts_to_honor = malloc(sizeof(char*)*128); if (cfg.exts_to_honor ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "honor_crq_ext")!=0) continue; cfg.exts_to_honor[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.exts_to_honor[i] =
((void *)0)
; } };
val = cfg_next(pov, "tls_www_client"); if (val !=
((void *)0)
) { cfg.tls_www_client = 1; };
val = cfg_next(pov, "tls_www_server"); if (val !=
((void *)0)
) { cfg.tls_www_server = 1; };
val = cfg_next(pov, "signing_key"); if (val !=
((void *)0)
) { cfg.signing_key = 1; };
val = cfg_next(pov, "encryption_key"); if (val !=
((void *)0)
) { cfg.encryption_key = 1; };
val = cfg_next(pov, "cert_signing_key"); if (val !=
((void *)0)
) { cfg.cert_sign_key = 1; };
val = cfg_next(pov, "crl_signing_key"); if (val !=
((void *)0)
) { cfg.crl_sign_key = 1; };
val = cfg_next(pov, "code_signing_key"); if (val !=
((void *)0)
) { cfg.code_sign_key = 1; };
val = cfg_next(pov, "ocsp_signing_key"); if (val !=
((void *)0)
) { cfg.ocsp_sign_key = 1; };
val = cfg_next(pov, "time_stamping_key"); if (val !=
((void *)0)
) { cfg.time_stamping_key = 1; };
val = cfg_next(pov, "email_protection_key"); if (val !=
((void *)0)
) { cfg.email_protection_key = 1; };
val = cfg_next(pov, "ipsec_ike_key"); if (val !=
((void *)0)
) { cfg.ipsec_ike_key = 1; };
val = cfg_next(pov, "data_encipherment"); if (val !=
((void *)0)
) { cfg.data_encipherment = 1; };
val = cfg_next(pov, "key_agreement"); if (val !=
((void *)0)
) { cfg.key_agreement = 1; };
val = cfg_next(pov, "non_repudiation"); if (val !=
((void *)0)
) { cfg.non_repudiation = 1; };
val = cfg_next(pov, "tls_feature"); if (val !=
((void *)0)
) { if (cfg.tls_features ==
((void *)0)
) { i = 0; cfg.tls_features = malloc(sizeof(char*)*128); if (cfg.tls_features ==
((void *)0)
) { fprintf(
stderr
, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "tls_feature")!=0) continue; cfg.tls_features[i] = strdup(val->value); i++; if (i>=128) break; } while((val = cfg_next(val + 1, val->name)) !=
((void *)0)
); cfg.tls_features[i] =
((void *)0)
; } };
cfg_free(pov);
return 0;
}
| long template_parse(const char *a1)
{
char **v1;
char **v2;
char **v3;
char **v4;
char **v5;
char **v6;
char **v7;
char **v8;
char **v9;
char **v10;
char **v11;
char **v12;
char **v13;
char **v14;
char **v15;
char **v16;
char **v17;
char **v18;
char **v19;
char **v20;
char **v21;
char **v22;
char **v23;
char **v24;
char **v25;
char **v26;
char **v27;
char **v28;
char **v29;
char **v30;
char **v31;
char **v32;
char **v33;
char **v34;
char **v35;
unsigned int v37;
unsigned int v38;
unsigned int v39;
unsigned int v40;
unsigned int j;
unsigned int v42;
unsigned int v43;
unsigned int v44;
unsigned int v45;
unsigned int v46;
unsigned int v47;
unsigned int v48;
unsigned int v49;
unsigned int v50;
unsigned int v51;
unsigned int v52;
unsigned int v53;
unsigned int v54;
unsigned int v55;
unsigned int v56;
unsigned int v57;
unsigned int v58;
unsigned int v59;
unsigned int v60;
unsigned int v61;
unsigned int v62;
unsigned int v63;
unsigned int v64;
unsigned int v65;
unsigned int v66;
const char **i;
const char **v68;
const char **v69;
const char **v70;
const char **v71;
long v72;
long v73;
long v74;
long v75;
long v76;
long v77;
long v78;
long v79;
long v80;
long v81;
long v82;
long v83;
long v84;
long v85;
long v86;
long v87;
long v88;
long v89;
long v90;
long v91;
const char **v92;
const char **v93;
const char **v94;
const char **v95;
const char **v96;
const char **v97;
const char **v98;
const char **v99;
const char **v100;
const char **v101;
const char **v102;
const char **v103;
const char **v104;
const char **v105;
const char **v106;
const char **v107;
const char **v108;
const char **v109;
const char **v110;
const char **v111;
const char **v112;
long v113;
long v114;
long v115;
long v116;
long v117;
long v118;
long v119;
const char **v120;
const char **v121;
const char **v122;
const char **v123;
char *v124;
char *v125;
char *v126;
char *v127;
char *v128;
char *v129;
char *v130;
char *v131;
char *v132;
char *v133;
char *v134;
char *v135;
long v136;
char *v137;
char *v138;
char *v139;
char *v140;
char *v141;
char *v142;
long v143;
int v144;
long v145;
int v146;
char s[264];
unsigned long v148;
v148 = __readfsqword(0x28u);
v136 = cfg_load(a1);
if ( !v136 )
{
perror("configFileLoad");
fprintf(stderr, "Error loading template: %s\n", a1);
exit(1);
}
for ( i = (const char **)v136; *i; i += 2 )
{
if ( !(unsigned int)handle_option(i) )
fprintf(stderr, "Warning: skipping unknown option '%s'\n", *i);
}
v68 = (const char **)cfg_next(v136, "unit");
if ( v68 && !*(_QWORD *)&cfg[2] )
{
v37 = 0;
*(_QWORD *)&cfg[2] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[2] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v68, "unit") )
{
v1 = (char **)(*(_QWORD *)&cfg[2] + 8LL * v37);
*v1 = strdup(v68[1]);
if ( ++v37 > 0x7F )
break;
}
v68 = (const char **)cfg_next(v68 + 2, *v68);
}
while ( v68 );
*(_QWORD *)(8LL * v37 + *(_QWORD *)&cfg[2]) = 0LL;
}
if ( !*(_QWORD *)&cfg[2] )
{
v69 = (const char **)cfg_next(v136, "ou");
if ( v69 )
{
if ( !*(_QWORD *)&cfg[2] )
{
v38 = 0;
*(_QWORD *)&cfg[2] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[2] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v69, "ou") )
{
v2 = (char **)(*(_QWORD *)&cfg[2] + 8LL * v38);
*v2 = strdup(v69[1]);
if ( ++v38 > 0x7F )
break;
}
v69 = (const char **)cfg_next(v69 + 2, *v69);
}
while ( v69 );
*(_QWORD *)(8LL * v38 + *(_QWORD *)&cfg[2]) = 0LL;
}
}
}
v70 = (const char **)cfg_next(v136, "organization");
if ( v70 && !*(_QWORD *)cfg )
{
v39 = 0;
*(_QWORD *)cfg = malloc(0x400uLL);
if ( !*(_QWORD *)cfg )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v70, "organization") )
{
v3 = (char **)(*(_QWORD *)cfg + 8LL * v39);
*v3 = strdup(v70[1]);
if ( ++v39 > 0x7F )
break;
}
v70 = (const char **)cfg_next(v70 + 2, *v70);
}
while ( v70 );
*(_QWORD *)(8LL * v39 + *(_QWORD *)cfg) = 0LL;
}
if ( !*(_QWORD *)cfg )
{
v71 = (const char **)cfg_next(v136, "o");
if ( v71 )
{
if ( !*(_QWORD *)cfg )
{
v40 = 0;
*(_QWORD *)cfg = malloc(0x400uLL);
if ( !*(_QWORD *)cfg )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v71, "o") )
{
v4 = (char **)(*(_QWORD *)cfg + 8LL * v40);
*v4 = strdup(v71[1]);
if ( ++v40 > 0x7F )
break;
}
v71 = (const char **)cfg_next(v71 + 2, *v71);
}
while ( v71 );
*(_QWORD *)(8LL * v40 + *(_QWORD *)cfg) = 0LL;
}
}
}
v72 = cfg_next(v136, "locality");
if ( v72 )
*(_QWORD *)&cfg[4] = strdup(*(const char **)(v72 + 8));
v73 = cfg_next(v136, "state");
if ( v73 )
*(_QWORD *)&cfg[6] = strdup(*(const char **)(v73 + 8));
v74 = cfg_next(v136, "dn");
if ( v74 )
*(_QWORD *)&cfg[8] = strdup(*(const char **)(v74 + 8));
v75 = cfg_next(v136, "cn");
if ( v75 )
*(_QWORD *)&cfg[10] = strdup(*(const char **)(v75 + 8));
v76 = cfg_next(v136, "uid");
if ( v76 )
*(_QWORD *)&cfg[12] = strdup(*(const char **)(v76 + 8));
v77 = cfg_next(v136, "issuer_unique_id");
if ( v77 )
{
v143 = *(_QWORD *)(v77 + 8);
v144 = strlen(*(const char **)(v77 + 8));
if ( (int)gnutls_hex_decode2(&v143, &v145) < 0 )
{
fprintf(stderr, "error in hex ID: %s\n", *(const char **)(v77 + 8));
exit(1);
}
*(_QWORD *)&cfg[18] = v145;
cfg[20] = v146;
}
v78 = cfg_next(v136, "subject_unique_id");
if ( v78 )
{
v143 = *(_QWORD *)(v78 + 8);
v144 = strlen(*(const char **)(v78 + 8));
if ( (int)gnutls_hex_decode2(&v143, &v145) < 0 )
{
fprintf(stderr, "error in hex ID: %s\n", *(const char **)(v78 + 8));
exit(1);
}
*(_QWORD *)&cfg[14] = v145;
cfg[16] = v146;
}
v79 = cfg_next(v136, "challenge_password");
if ( v79 )
*(_QWORD *)&cfg[22] = strdup(*(const char **)(v79 + 8));
v80 = cfg_next(v136, "password");
if ( v80 )
*(_QWORD *)&cfg[116] = strdup(*(const char **)(v80 + 8));
v81 = cfg_next(v136, "pkcs9_email");
if ( v81 )
*(_QWORD *)&cfg[24] = strdup(*(const char **)(v81 + 8));
v82 = cfg_next(v136, "country");
if ( v82 )
*(_QWORD *)&cfg[26] = strdup(*(const char **)(v82 + 8));
v83 = cfg_next(v136, "expiration_date");
if ( v83 )
*(_QWORD *)&cfg[120] = strdup(*(const char **)(v83 + 8));
v84 = cfg_next(v136, "activation_date");
if ( v84 )
*(_QWORD *)&cfg[122] = strdup(*(const char **)(v84 + 8));
v85 = cfg_next(v136, "crl_revocation_date");
if ( v85 )
*(_QWORD *)&cfg[124] = strdup(*(const char **)(v85 + 8));
v86 = cfg_next(v136, "crl_this_update_date");
if ( v86 )
*(_QWORD *)&cfg[126] = strdup(*(const char **)(v86 + 8));
v87 = cfg_next(v136, "crl_next_update_date");
if ( v87 )
*(_QWORD *)&cfg[128] = strdup(*(const char **)(v87 + 8));
v88 = cfg_next(v136, "inhibit_anypolicy_skip_certs");
if ( v88 )
cfg[134] = strtol(*(const char **)(v88 + 8), 0LL, 10);
for ( j = 0; j <= 7; ++j )
{
snprintf(s, 0x100uLL, "policy%d", j + 1);
v89 = cfg_next(v136, s);
if ( v89 )
*(_QWORD *)&cfg[2 * j + 28] = strdup(*(const char **)(v89 + 8));
if ( *(_QWORD *)&cfg[2 * j + 28] )
{
snprintf(s, 0x100uLL, "policy%d_url", j + 1);
v90 = cfg_next(v136, s);
if ( v90 )
*(_QWORD *)&cfg[2 * j + 60] = strdup(*(const char **)(v90 + 8));
snprintf(s, 0x100uLL, "policy%d_txt", j + 1);
v91 = cfg_next(v136, s);
if ( v91 )
*(_QWORD *)&cfg[2 * j + 44] = strdup(*(const char **)(v91 + 8));
}
}
v92 = (const char **)cfg_next(v136, "dc");
if ( v92 && !*(_QWORD *)&cfg[76] )
{
v42 = 0;
*(_QWORD *)&cfg[76] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[76] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v92, "dc") )
{
v5 = (char **)(*(_QWORD *)&cfg[76] + 8LL * v42);
*v5 = strdup(v92[1]);
if ( ++v42 > 0x7F )
break;
}
v92 = (const char **)cfg_next(v92 + 2, *v92);
}
while ( v92 );
*(_QWORD *)(8LL * v42 + *(_QWORD *)&cfg[76]) = 0LL;
}
v93 = (const char **)cfg_next(v136, "dns_name");
if ( v93 && !*(_QWORD *)&cfg[78] )
{
v43 = 0;
*(_QWORD *)&cfg[78] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[78] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v93, "dns_name") )
{
v6 = (char **)(*(_QWORD *)&cfg[78] + 8LL * v43);
*v6 = strdup(v93[1]);
if ( ++v43 > 0x7F )
break;
}
v93 = (const char **)cfg_next(v93 + 2, *v93);
}
while ( v93 );
*(_QWORD *)(8LL * v43 + *(_QWORD *)&cfg[78]) = 0LL;
}
v94 = (const char **)cfg_next(v136, "uri");
if ( v94 && !*(_QWORD *)&cfg[80] )
{
v44 = 0;
*(_QWORD *)&cfg[80] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[80] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v94, "uri") )
{
v7 = (char **)(*(_QWORD *)&cfg[80] + 8LL * v44);
*v7 = strdup(v94[1]);
if ( ++v44 > 0x7F )
break;
}
v94 = (const char **)cfg_next(v94 + 2, *v94);
}
while ( v94 );
*(_QWORD *)(8LL * v44 + *(_QWORD *)&cfg[80]) = 0LL;
}
v95 = (const char **)cfg_next(v136, "krb5_principal");
if ( v95 && !*(_QWORD *)&cfg[86] )
{
v45 = 0;
*(_QWORD *)&cfg[86] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[86] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v95, "krb5_principal") )
{
v8 = (char **)(*(_QWORD *)&cfg[86] + 8LL * v45);
*v8 = strdup(v95[1]);
if ( ++v45 > 0x7F )
break;
}
v95 = (const char **)cfg_next(v95 + 2, *v95);
}
while ( v95 );
*(_QWORD *)(8LL * v45 + *(_QWORD *)&cfg[86]) = 0LL;
}
v96 = (const char **)cfg_next(v136, "other_name");
if ( v96 && !*(_QWORD *)&cfg[88] )
{
v46 = 0;
*(_QWORD *)&cfg[88] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[88] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v96, "other_name") )
{
v137 = strdup(v96[1]);
if ( !v137 )
{
fprintf(stderr, "memory error\n");
exit(1);
}
v124 = strchr(v137, 32);
if ( !v124 )
{
v124 = strchr(v137, 9);
if ( !v124 )
{
fprintf(stderr, "Error parsing %s\n", "other_name");
exit(1);
}
}
*v124 = 0;
v125 = v124 + 1;
v9 = (char **)(*(_QWORD *)&cfg[88] + 8LL * v46);
*v9 = strdup(v137);
while ( *v125 == 32 || *v125 == 9 )
++v125;
if ( !*v125 )
{
fprintf(stderr, "Error (2) parsing %s\n", "other_name");
exit(1);
}
v10 = (char **)(*(_QWORD *)&cfg[88] + 8LL * (v46 + 1));
*v10 = strdup(v125);
v46 += 2;
free(v137);
if ( v46 > 0x7F )
break;
}
v96 = (const char **)cfg_next(v96 + 2, *v96);
}
while ( v96 );
*(_QWORD *)(8LL * v46 + *(_QWORD *)&cfg[88]) = 0LL;
}
v97 = (const char **)cfg_next(v136, "other_name_octet");
if ( v97 && !*(_QWORD *)&cfg[92] )
{
v47 = 0;
*(_QWORD *)&cfg[92] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[92] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v97, "other_name_octet") )
{
v138 = strdup(v97[1]);
if ( !v138 )
{
fprintf(stderr, "memory error\n");
exit(1);
}
v126 = strchr(v138, 32);
if ( !v126 )
{
v126 = strchr(v138, 9);
if ( !v126 )
{
fprintf(stderr, "Error parsing %s\n", "other_name_octet");
exit(1);
}
}
*v126 = 0;
v127 = v126 + 1;
v11 = (char **)(*(_QWORD *)&cfg[92] + 8LL * v47);
*v11 = strdup(v138);
while ( *v127 == 32 || *v127 == 9 )
++v127;
if ( !*v127 )
{
fprintf(stderr, "Error (2) parsing %s\n", "other_name_octet");
exit(1);
}
v12 = (char **)(*(_QWORD *)&cfg[92] + 8LL * (v47 + 1));
*v12 = strdup(v127);
v47 += 2;
free(v138);
if ( v47 > 0x7F )
break;
}
v97 = (const char **)cfg_next(v97 + 2, *v97);
}
while ( v97 );
*(_QWORD *)(8LL * v47 + *(_QWORD *)&cfg[92]) = 0LL;
}
v98 = (const char **)cfg_next(v136, "other_name_utf8");
if ( v98 && !*(_QWORD *)&cfg[90] )
{
v48 = 0;
*(_QWORD *)&cfg[90] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[90] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v98, "other_name_utf8") )
{
v139 = strdup(v98[1]);
if ( !v139 )
{
fprintf(stderr, "memory error\n");
exit(1);
}
v128 = strchr(v139, 32);
if ( !v128 )
{
v128 = strchr(v139, 9);
if ( !v128 )
{
fprintf(stderr, "Error parsing %s\n", "other_name_utf8");
exit(1);
}
}
*v128 = 0;
v129 = v128 + 1;
v13 = (char **)(*(_QWORD *)&cfg[90] + 8LL * v48);
*v13 = strdup(v139);
while ( *v129 == 32 || *v129 == 9 )
++v129;
if ( !*v129 )
{
fprintf(stderr, "Error (2) parsing %s\n", "other_name_utf8");
exit(1);
}
v14 = (char **)(*(_QWORD *)&cfg[90] + 8LL * (v48 + 1));
*v14 = strdup(v129);
v48 += 2;
free(v139);
if ( v48 > 0x7F )
break;
}
v98 = (const char **)cfg_next(v98 + 2, *v98);
}
while ( v98 );
*(_QWORD *)(8LL * v48 + *(_QWORD *)&cfg[90]) = 0LL;
}
v99 = (const char **)cfg_next(v136, "xmpp_name");
if ( v99 && !*(_QWORD *)&cfg[94] )
{
v49 = 0;
*(_QWORD *)&cfg[94] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[94] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v99, "xmpp_name") )
{
v15 = (char **)(*(_QWORD *)&cfg[94] + 8LL * v49);
*v15 = strdup(v99[1]);
if ( ++v49 > 0x7F )
break;
}
v99 = (const char **)cfg_next(v99 + 2, *v99);
}
while ( v99 );
*(_QWORD *)(8LL * v49 + *(_QWORD *)&cfg[94]) = 0LL;
}
v100 = (const char **)cfg_next(v136, "ip_address");
if ( v100 && !*(_QWORD *)&cfg[82] )
{
v50 = 0;
*(_QWORD *)&cfg[82] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[82] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v100, "ip_address") )
{
v16 = (char **)(*(_QWORD *)&cfg[82] + 8LL * v50);
*v16 = strdup(v100[1]);
if ( ++v50 > 0x7F )
break;
}
v100 = (const char **)cfg_next(v100 + 2, *v100);
}
while ( v100 );
*(_QWORD *)(8LL * v50 + *(_QWORD *)&cfg[82]) = 0LL;
}
v101 = (const char **)cfg_next(v136, "email");
if ( v101 && !*(_QWORD *)&cfg[84] )
{
v51 = 0;
*(_QWORD *)&cfg[84] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[84] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v101, "email") )
{
v17 = (char **)(*(_QWORD *)&cfg[84] + 8LL * v51);
*v17 = strdup(v101[1]);
if ( ++v51 > 0x7F )
break;
}
v101 = (const char **)cfg_next(v101 + 2, *v101);
}
while ( v101 );
*(_QWORD *)(8LL * v51 + *(_QWORD *)&cfg[84]) = 0LL;
}
v102 = (const char **)cfg_next(v136, "key_purpose_oid");
if ( v102 && !*(_QWORD *)&cfg[152] )
{
v52 = 0;
*(_QWORD *)&cfg[152] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[152] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v102, "key_purpose_oid") )
{
v18 = (char **)(*(_QWORD *)&cfg[152] + 8LL * v52);
*v18 = strdup(v102[1]);
if ( ++v52 > 0x7F )
break;
}
v102 = (const char **)cfg_next(v102 + 2, *v102);
}
while ( v102 );
*(_QWORD *)(8LL * v52 + *(_QWORD *)&cfg[152]) = 0LL;
}
v103 = (const char **)cfg_next(v136, "nc_exclude_ip");
if ( v103 && !*(_QWORD *)&cfg[104] )
{
v53 = 0;
*(_QWORD *)&cfg[104] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[104] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v103, "nc_exclude_ip") )
{
v19 = (char **)(*(_QWORD *)&cfg[104] + 8LL * v53);
*v19 = strdup(v103[1]);
if ( ++v53 > 0x7F )
break;
}
v103 = (const char **)cfg_next(v103 + 2, *v103);
}
while ( v103 );
*(_QWORD *)(8LL * v53 + *(_QWORD *)&cfg[104]) = 0LL;
}
v104 = (const char **)cfg_next(v136, "nc_exclude_dns");
if ( v104 && !*(_QWORD *)&cfg[108] )
{
v54 = 0;
*(_QWORD *)&cfg[108] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[108] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v104, "nc_exclude_dns") )
{
v20 = (char **)(*(_QWORD *)&cfg[108] + 8LL * v54);
*v20 = strdup(v104[1]);
if ( ++v54 > 0x7F )
break;
}
v104 = (const char **)cfg_next(v104 + 2, *v104);
}
while ( v104 );
*(_QWORD *)(8LL * v54 + *(_QWORD *)&cfg[108]) = 0LL;
}
v105 = (const char **)cfg_next(v136, "nc_exclude_email");
if ( v105 && !*(_QWORD *)&cfg[112] )
{
v55 = 0;
*(_QWORD *)&cfg[112] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[112] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v105, "nc_exclude_email") )
{
v21 = (char **)(*(_QWORD *)&cfg[112] + 8LL * v55);
*v21 = strdup(v105[1]);
if ( ++v55 > 0x7F )
break;
}
v105 = (const char **)cfg_next(v105 + 2, *v105);
}
while ( v105 );
*(_QWORD *)(8LL * v55 + *(_QWORD *)&cfg[112]) = 0LL;
}
v106 = (const char **)cfg_next(v136, "nc_permit_ip");
if ( v106 && !*(_QWORD *)&cfg[102] )
{
v56 = 0;
*(_QWORD *)&cfg[102] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[102] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v106, "nc_permit_ip") )
{
v22 = (char **)(*(_QWORD *)&cfg[102] + 8LL * v56);
*v22 = strdup(v106[1]);
if ( ++v56 > 0x7F )
break;
}
v106 = (const char **)cfg_next(v106 + 2, *v106);
}
while ( v106 );
*(_QWORD *)(8LL * v56 + *(_QWORD *)&cfg[102]) = 0LL;
}
v107 = (const char **)cfg_next(v136, "nc_permit_dns");
if ( v107 && !*(_QWORD *)&cfg[106] )
{
v57 = 0;
*(_QWORD *)&cfg[106] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[106] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v107, "nc_permit_dns") )
{
v23 = (char **)(*(_QWORD *)&cfg[106] + 8LL * v57);
*v23 = strdup(v107[1]);
if ( ++v57 > 0x7F )
break;
}
v107 = (const char **)cfg_next(v107 + 2, *v107);
}
while ( v107 );
*(_QWORD *)(8LL * v57 + *(_QWORD *)&cfg[106]) = 0LL;
}
v108 = (const char **)cfg_next(v136, "nc_permit_email");
if ( v108 && !*(_QWORD *)&cfg[110] )
{
v58 = 0;
*(_QWORD *)&cfg[110] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[110] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v108, "nc_permit_email") )
{
v24 = (char **)(*(_QWORD *)&cfg[110] + 8LL * v58);
*v24 = strdup(v108[1]);
if ( ++v58 > 0x7F )
break;
}
v108 = (const char **)cfg_next(v108 + 2, *v108);
}
while ( v108 );
*(_QWORD *)(8LL * v58 + *(_QWORD *)&cfg[110]) = 0LL;
}
v109 = (const char **)cfg_next(v136, "dn_oid");
if ( v109 && !*(_QWORD *)&cfg[96] )
{
v59 = 0;
*(_QWORD *)&cfg[96] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[96] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v109, "dn_oid") )
{
v140 = strdup(v109[1]);
if ( !v140 )
{
fprintf(stderr, "memory error\n");
exit(1);
}
v130 = strchr(v140, 32);
if ( !v130 )
{
v130 = strchr(v140, 9);
if ( !v130 )
{
fprintf(stderr, "Error parsing %s\n", "dn_oid");
exit(1);
}
}
*v130 = 0;
v131 = v130 + 1;
v25 = (char **)(*(_QWORD *)&cfg[96] + 8LL * v59);
*v25 = strdup(v140);
while ( *v131 == 32 || *v131 == 9 )
++v131;
if ( !*v131 )
{
fprintf(stderr, "Error (2) parsing %s\n", "dn_oid");
exit(1);
}
v26 = (char **)(*(_QWORD *)&cfg[96] + 8LL * (v59 + 1));
*v26 = strdup(v131);
v59 += 2;
free(v140);
if ( v59 > 0x7F )
break;
}
v109 = (const char **)cfg_next(v109 + 2, *v109);
}
while ( v109 );
*(_QWORD *)(8LL * v59 + *(_QWORD *)&cfg[96]) = 0LL;
}
v110 = (const char **)cfg_next(v136, "add_extension");
if ( v110 && !*(_QWORD *)&cfg[98] )
{
v60 = 0;
*(_QWORD *)&cfg[98] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[98] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v110, "add_extension") )
{
v141 = strdup(v110[1]);
if ( !v141 )
{
fprintf(stderr, "memory error\n");
exit(1);
}
v132 = strchr(v141, 32);
if ( !v132 )
{
v132 = strchr(v141, 9);
if ( !v132 )
{
fprintf(stderr, "Error parsing %s\n", "add_extension");
exit(1);
}
}
*v132 = 0;
v133 = v132 + 1;
v27 = (char **)(*(_QWORD *)&cfg[98] + 8LL * v60);
*v27 = strdup(v141);
while ( *v133 == 32 || *v133 == 9 )
++v133;
if ( !*v133 )
{
fprintf(stderr, "Error (2) parsing %s\n", "add_extension");
exit(1);
}
v28 = (char **)(*(_QWORD *)&cfg[98] + 8LL * (v60 + 1));
*v28 = strdup(v133);
v60 += 2;
free(v141);
if ( v60 > 0x7F )
break;
}
v110 = (const char **)cfg_next(v110 + 2, *v110);
}
while ( v110 );
*(_QWORD *)(8LL * v60 + *(_QWORD *)&cfg[98]) = 0LL;
}
v111 = (const char **)cfg_next(v136, "add_critical_extension");
if ( v111 && !*(_QWORD *)&cfg[100] )
{
v61 = 0;
*(_QWORD *)&cfg[100] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[100] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v111, "add_critical_extension") )
{
v142 = strdup(v111[1]);
if ( !v142 )
{
fprintf(stderr, "memory error\n");
exit(1);
}
v134 = strchr(v142, 32);
if ( !v134 )
{
v134 = strchr(v142, 9);
if ( !v134 )
{
fprintf(stderr, "Error parsing %s\n", "add_critical_extension");
exit(1);
}
}
*v134 = 0;
v135 = v134 + 1;
v29 = (char **)(*(_QWORD *)&cfg[100] + 8LL * v61);
*v29 = strdup(v142);
while ( *v135 == 32 || *v135 == 9 )
++v135;
if ( !*v135 )
{
fprintf(stderr, "Error (2) parsing %s\n", "add_critical_extension");
exit(1);
}
v30 = (char **)(*(_QWORD *)&cfg[100] + 8LL * (v61 + 1));
*v30 = strdup(v135);
v61 += 2;
free(v142);
if ( v61 > 0x7F )
break;
}
v111 = (const char **)cfg_next(v111 + 2, *v111);
}
while ( v111 );
*(_QWORD *)(8LL * v61 + *(_QWORD *)&cfg[100]) = 0LL;
}
v112 = (const char **)cfg_next(v136, "crl_dist_points");
if ( v112 && !*(_QWORD *)&cfg[114] )
{
v62 = 0;
*(_QWORD *)&cfg[114] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[114] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v112, "crl_dist_points") )
{
v31 = (char **)(*(_QWORD *)&cfg[114] + 8LL * v62);
*v31 = strdup(v112[1]);
if ( ++v62 > 0x7F )
break;
}
v112 = (const char **)cfg_next(v112 + 2, *v112);
}
while ( v112 );
*(_QWORD *)(8LL * v62 + *(_QWORD *)&cfg[114]) = 0LL;
}
v113 = cfg_next(v136, "pkcs12_key_name");
if ( v113 )
*(_QWORD *)&cfg[118] = strdup(*(const char **)(v113 + 8));
v114 = cfg_next(v136, "serial");
if ( v114 )
{
if ( (int)serial_decode(*(_QWORD *)(v114 + 8), (long)&v145) < 0 )
{
fprintf(stderr, "error parsing number: %s\n", *(const char **)(v114 + 8));
exit(1);
}
*(_QWORD *)&cfg[130] = v145;
cfg[132] = v146;
}
v115 = cfg_next(v136, "expiration_days");
if ( v115 )
cfg[133] = strtol(*(const char **)(v115 + 8), 0LL, 10);
v116 = cfg_next(v136, "crl_next_update");
if ( v116 )
cfg[154] = strtol(*(const char **)(v116 + 8), 0LL, 10);
v117 = cfg_next(v136, "crl_number");
if ( v117 )
{
if ( (int)serial_decode(*(_QWORD *)(v117 + 8), (long)&v145) < 0 )
{
fprintf(stderr, "error parsing number: %s\n", *(const char **)(v117 + 8));
exit(1);
}
*(_QWORD *)&cfg[156] = v145;
cfg[158] = v146;
}
v118 = cfg_next(v136, "path_len");
if ( v118 )
cfg[136] = strtol(*(const char **)(v118 + 8), 0LL, 10);
v119 = cfg_next(v136, "proxy_policy_language");
if ( v119 )
*(_QWORD *)&cfg[160] = strdup(*(const char **)(v119 + 8));
v120 = (const char **)cfg_next(v136, "ocsp_uri");
if ( v120 && !*(_QWORD *)&cfg[164] )
{
v63 = 0;
*(_QWORD *)&cfg[164] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[164] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v120, "ocsp_uri") )
{
v32 = (char **)(*(_QWORD *)&cfg[164] + 8LL * v63);
*v32 = strdup(v120[1]);
if ( ++v63 > 0x7F )
break;
}
v120 = (const char **)cfg_next(v120 + 2, *v120);
}
while ( v120 );
*(_QWORD *)(8LL * v63 + *(_QWORD *)&cfg[164]) = 0LL;
}
v121 = (const char **)cfg_next(v136, "ca_issuers_uri");
if ( v121 && !*(_QWORD *)&cfg[166] )
{
v64 = 0;
*(_QWORD *)&cfg[166] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[166] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v121, "ca_issuers_uri") )
{
v33 = (char **)(*(_QWORD *)&cfg[166] + 8LL * v64);
*v33 = strdup(v121[1]);
if ( ++v64 > 0x7F )
break;
}
v121 = (const char **)cfg_next(v121 + 2, *v121);
}
while ( v121 );
*(_QWORD *)(8LL * v64 + *(_QWORD *)&cfg[166]) = 0LL;
}
if ( cfg_next(v136, "ca") )
cfg[135] = 1;
if ( cfg_next(v136, "honor_crq_extensions") )
cfg[159] = 1;
v122 = (const char **)cfg_next(v136, "honor_crq_ext");
if ( v122 && !*(_QWORD *)&cfg[162] )
{
v65 = 0;
*(_QWORD *)&cfg[162] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[162] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v122, "honor_crq_ext") )
{
v34 = (char **)(*(_QWORD *)&cfg[162] + 8LL * v65);
*v34 = strdup(v122[1]);
if ( ++v65 > 0x7F )
break;
}
v122 = (const char **)cfg_next(v122 + 2, *v122);
}
while ( v122 );
*(_QWORD *)(8LL * v65 + *(_QWORD *)&cfg[162]) = 0LL;
}
if ( cfg_next(v136, "tls_www_client") )
cfg[137] = 1;
if ( cfg_next(v136, "tls_www_server") )
cfg[138] = 1;
if ( cfg_next(v136, "signing_key") )
cfg[139] = 1;
if ( cfg_next(v136, "encryption_key") )
cfg[140] = 1;
if ( cfg_next(v136, "cert_signing_key") )
cfg[141] = 1;
if ( cfg_next(v136, "crl_signing_key") )
cfg[142] = 1;
if ( cfg_next(v136, "code_signing_key") )
cfg[146] = 1;
if ( cfg_next(v136, "ocsp_signing_key") )
cfg[147] = 1;
if ( cfg_next(v136, "time_stamping_key") )
cfg[148] = 1;
if ( cfg_next(v136, "email_protection_key") )
cfg[149] = 1;
if ( cfg_next(v136, "ipsec_ike_key") )
cfg[150] = 1;
if ( cfg_next(v136, "data_encipherment") )
cfg[144] = 1;
if ( cfg_next(v136, "key_agreement") )
cfg[145] = 1;
if ( cfg_next(v136, "non_repudiation") )
cfg[143] = 1;
v123 = (const char **)cfg_next(v136, "tls_feature");
if ( v123 && !*(_QWORD *)&cfg[168] )
{
v66 = 0;
*(_QWORD *)&cfg[168] = malloc(0x400uLL);
if ( !*(_QWORD *)&cfg[168] )
{
fprintf(stderr, "memory error\n");
exit(1);
}
do
{
if ( !strcmp(*v123, "tls_feature") )
{
v35 = (char **)(*(_QWORD *)&cfg[168] + 8LL * v66);
*v35 = strdup(v123[1]);
if ( ++v66 > 0x7F )
break;
}
v123 = (const char **)cfg_next(v123 + 2, *v123);
}
while ( v123 );
*(_QWORD *)(8LL * v66 + *(_QWORD *)&cfg[168]) = 0LL;
}
cfg_free(v136);
return 0LL;
}
|
int
history_expand(char *str, char **output)
{
int ret = 0;
size_t idx, i, size;
char *tmp, *result;
if (h ==
((void *)0)
|| e ==
((void *)0)
)
rl_initialize();
if (history_expansion_char == 0) {
*output = strdup(str);
return 0;
}
*output =
((void *)0)
;
if (str[0] == history_subst_char) {
*output = calloc(strlen(str) + 4 + 1, sizeof(**output));
if (*output ==
((void *)0)
)
return 0;
(*output)[0] = (*output)[1] = history_expansion_char;
(*output)[2] = ':';
(*output)[3] = 's';
(void)strcpy((*output) + 4, str);
str = *output;
} else {
*output = strdup(str);
if (*output ==
((void *)0)
)
return 0;
}
result =
((void *)0)
;
size = idx = 0;
tmp =
((void *)0)
;
for (i = 0; str[i];) {
int qchar, loop_again;
size_t len, start, j;
qchar = 0;
loop_again = 1;
start = j = i;
loop:
for (; str[j]; j++) {
if (str[j] == '\\' &&
str[j + 1] == history_expansion_char) {
len = strlen(&str[j + 1]) + 1;
memmove(&str[j], &str[j + 1], len);
continue;
}
if (!loop_again) {
if (
((*__ctype_b_loc ())[(int) ((
(unsigned char) str[j]
))] & (unsigned short int) _ISspace)
|| str[j] == qchar)
break;
}
if (str[j] == history_expansion_char
&& !strchr(history_no_expand_chars, str[j + 1])
&& (!history_inhibit_expansion_function ||
(*history_inhibit_expansion_function)(str,
(int)j) == 0))
break;
}
if (str[j] && loop_again) {
i = j;
qchar = (j > 0 && str[j - 1] == '"' )? '"':0;
j++;
if (str[j] == history_expansion_char)
j++;
loop_again = 0;
goto loop;
}
len = i - start;
{ if (idx + len + 1 > size) { char *nresult = realloc(result, (size += len + 1) * sizeof(*nresult)); if (nresult ==
((void *)0)
) { free(*output); free(
((void *)0)
); return 0; } result = nresult; } (void)strlcpy(&result[idx], &str[start], len + 1); idx += len; };
if (str[i] == '\0' || str[i] != history_expansion_char) {
len = j - i;
{ if (idx + len + 1 > size) { char *nresult = realloc(result, (size += len + 1) * sizeof(*nresult)); if (nresult ==
((void *)0)
) { free(*output); free(
((void *)0)
); return 0; } result = nresult; } (void)strlcpy(&result[idx], &str[i], len + 1); idx += len; };
if (start == 0)
ret = 0;
else
ret = 1;
break;
}
ret = _history_expand_command (str, i, (j - i), &tmp);
if (ret > 0 && tmp) {
len = strlen(tmp);
{ if (idx + len + 1 > size) { char *nresult = realloc(result, (size += len + 1) * sizeof(*nresult)); if (nresult ==
((void *)0)
) { free(*output); free(tmp); return 0; } result = nresult; } (void)strlcpy(&result[idx], tmp, len + 1); idx += len; };
}
if (tmp) {
free(tmp);
tmp =
((void *)0)
;
}
i = j;
}
if (ret == 2) {
add_history(result);
}
free(*output);
*output = result;
return ret;
}
| int history_expand(char *param_1,char **param_2)
{
long lVar1;
bool bVar2;
long lVar3;
char cVar4;
int iVar5;
char *pcVar6;
size_t sVar7;
ushort **ppuVar8;
long lVar9;
long in_FS_OFFSET;
char *local_80;
int local_74;
long local_60;
long local_58;
size_t local_50;
char *local_48;
long local_40;
lVar1 = *(long *)(in_FS_OFFSET + 0x28);
local_74 = 0;
if ((h == 0) || (e == 0)) {
rl_initialize();
}
if (*pcRam0000000000102067 == '\0') {
pcVar6 = strdup(param_1);
*param_2 = pcVar6;
local_74 = 0;
}
else {
*param_2 = (char *)0x0;
if (*param_1 == *pcRam00000000001020a7) {
sVar7 = strlen(param_1);
pcVar6 = (char *)calloc(sVar7 + 5,1);
*param_2 = pcVar6;
if (*param_2 == (char *)0x0) {
local_74 = 0;
goto LAB_001026b2;
}
pcVar6 = *param_2;
pcVar6[1] = *pcRam0000000000102101;
**param_2 = pcVar6[1];
(*param_2)[2] = ':';
(*param_2)[3] = 's';
strcpy(*param_2 + 4,param_1);
local_80 = *param_2;
}
else {
pcVar6 = strdup(param_1);
*param_2 = pcVar6;
local_80 = param_1;
if (*param_2 == (char *)0x0) {
local_74 = 0;
goto LAB_001026b2;
}
}
local_48 = (char *)0x0;
local_60 = 0;
local_50 = 0;
local_58 = 0;
LAB_0010266d:
lVar3 = local_58;
if (local_80[local_58] != '\0') {
cVar4 = '\0';
bVar2 = true;
local_40 = local_58;
do {
for (; local_80[local_40] != '\0'; local_40 = local_40 + 1) {
if ((local_80[local_40] == '\\') && (local_80[local_40 + 1] == *pcRam00000000001021fc)) {
sVar7 = strlen(local_80 + local_40 + 1);
memmove(local_80 + local_40,local_80 + local_40 + 1,sVar7 + 1);
}
else if (((!bVar2) &&
((ppuVar8 = __ctype_b_loc(), ((*ppuVar8)[(byte)local_80[local_40]] & 0x2000) != 0
|| (cVar4 == local_80[local_40])))) ||
((local_80[local_40] == *pcRam00000000001022b9 &&
((pcVar6 = strchr(*ppcRam00000000001022dc,(int)local_80[local_40 + 1]),
pcVar6 == (char *)0x0 &&
((*plRam00000000001022f5 == 0 ||
(iVar5 = (**ppcRam0000000000102304)(local_80), iVar5 == 0)))))))) break;
}
if ((local_80[local_40] == '\0') || (!bVar2)) goto LAB_001023b5;
local_58 = local_40;
if ((local_40 == 0) || (local_80[local_40 + -1] != '\"')) {
cVar4 = '\0';
}
else {
cVar4 = '\"';
}
lVar9 = local_40 + 1;
if (local_80[local_40 + 1] == *pcRam000000000010239d) {
lVar9 = local_40 + 2;
}
local_40 = lVar9;
bVar2 = false;
} while( true );
}
LAB_00102683:
if (local_74 == 2) {
add_history(local_48);
}
free(*param_2);
*param_2 = local_48;
}
LAB_001026b2:
if (lVar1 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return local_74;
LAB_001023b5:
lVar9 = local_58 - lVar3;
if (local_50 < lVar9 + local_60 + 1U) {
local_50 = local_50 + lVar9 + 1;
local_48 = (char *)realloc(local_48,local_50);
if (local_48 == (char *)0x0) {
free(*param_2);
free((void *)0x0);
local_74 = 0;
goto LAB_001026b2;
}
}
strlcpy(local_48 + local_60,local_80 + lVar3,lVar9 + 1);
local_60 = local_60 + lVar9;
if ((local_80[local_58] == '\0') || (local_80[local_58] != *pcRam000000000010248a)) {
local_40 = local_40 - local_58;
if ((local_50 < local_40 + local_60 + 1U) &&
(local_48 = (char *)realloc(local_48,local_50 + local_40 + 1), local_48 == (char *)0x0)) {
free(*param_2);
free((void *)0x0);
local_74 = 0;
goto LAB_001026b2;
}
strlcpy(local_48 + local_60,local_80 + local_58,local_40 + 1);
if (lVar3 == 0) {
local_74 = 0;
}
else {
local_74 = 1;
}
goto LAB_00102683;
}
local_74 = _history_expand_command(local_80,local_58,local_40 - local_58);
local_58 = local_40;
goto LAB_0010266d;
}
|
static
void bsPutUChar ( EState* s, UChar c )
{
bsW( s, 8, (UInt32)c );
}
| void bsPutUChar(void* a0, unsigned long a1) {
unsigned long long v1;
v1 = bsW(a0, 0x8, a1);
return;
}
|
static inline __u8 rta_getattr_u8(const struct rtattr *rta)
{
return *(__u8 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| int rta_getattr_u8(struct_0 *a0) {
return a0->field_4;
}
|
size_t
bitmap_nbytes(struct bitmap *b)
{
return (bitmap_nbits(b) + 7) / 8;
}
| ulong bitmap_nbytes(undefined8 param_1)
{
long lVar1;
lVar1 = bitmap_nbits(param_1);
return lVar1 + 7U >> 3;
}
|
static void mod_free(struct mod *mod)
{
log_printf(
7
, "free %p kmod=%p, path=%s\n", mod, mod->kmod, mod->path);
array_free_array(&mod->deps);
kmod_module_unref(mod->kmod);
kmod_module_info_free_list(mod->info_list);
kmod_module_dependency_symbols_free_list(mod->dep_sym_list);
free(mod->uncrelpath);
free(mod->path);
free(mod);
}
| void mod_free(undefined8 *param_1)
{
log_printf(7,"free %p kmod=%p, path=%s\n",param_1,*param_1,param_1[1]);
array_free_array(param_1 + 6);
kmod_module_unref(*param_1);
kmod_module_info_free_list(param_1[4]);
kmod_module_dependency_symbols_free_list(param_1[5]);
free((void *)param_1[3]);
free((void *)param_1[1]);
free(param_1);
return;
}
|
static STRINGLIST *
gen_progcomp_completions (ocmd, cmd, word, start, end, foundp, retryp, lastcs)
const char *ocmd;
const char *cmd;
const char *word;
int start, end;
int *foundp, *retryp;
COMPSPEC **lastcs;
{
COMPSPEC *cs, *oldcs;
const char *oldcmd, *oldtxt;
STRINGLIST *ret;
cs = progcomp_search (ocmd);
if (cs == 0 || cs == *lastcs)
{
return (
((void *)0)
);
}
if (*lastcs)
compspec_dispose (*lastcs);
cs->refcount++;
*lastcs = cs;
cs = compspec_copy (cs);
oldcs = pcomp_curcs;
oldcmd = pcomp_curcmd;
oldtxt = pcomp_curtxt;
pcomp_curcs = cs;
pcomp_curcmd = cmd;
pcomp_curtxt = word;
ret = gen_compspec_completions (cs, cmd, word, start, end, foundp);
pcomp_curcs = oldcs;
pcomp_curcmd = oldcmd;
pcomp_curtxt = oldtxt;
if (retryp)
*retryp = foundp && (*foundp & ((1<<8) << 1));
if (foundp)
{
*foundp &= ~((1<<8) << 1);
*foundp |= cs->options;
}
compspec_dispose (cs);
return ret;
}
| int gen_progcomp_completions(unsigned long long a0, char *a1, unsigned long long a2, unsigned long a3, unsigned long a4, unsigned int *a5, unsigned int *v6, unsigned long long *a6) {
unsigned int *v0;
int tmp_24;
unsigned long long v1;
unsigned long long v2;
unsigned long long v3;
unsigned long long v4;
unsigned long v5;
unsigned int v7;
unsigned int v8;
v0 = a5;
v1 = progcomp_search(a0);
if (!v1) {
LABEL_4035c6:
v7 = 0;
} else {
if (v1 == *(a6))
goto LABEL_4035c6;
if (*(a6))
compspec_dispose(*(a6));
*(v1) = *(v1) + 1;
*(a6) = v1;
v1 = compspec_copy(v1);
v2 = -556885833387505336;
v3 = -556885833387505336;
v4 = -556885833387505336;
pcomp_line = v1;
pcomp_line = a1;
pcomp_line = a2;
v5 = gen_compspec_completions(v1, a1, a2, a3, a4, a5);
pcomp_line = v2;
pcomp_line = v3;
pcomp_line = v4;
if (v6) {
if (a5 && (*(a5) & 0x200)) {
v8 = 1;
goto LABEL_4036c9;
}
v8 = 0;
LABEL_4036c9:
*(v6) = v8;
}
if (a5) {
v7 = *(a5);
*(&v7) = (*(a5) >> 8) & 253;
tmp_24 = v7;
*(a5) = tmp_24;
*(a5) = *((v1 + 16)) | *(a5);
}
compspec_dispose(v1);
v7 = v5;
}
return v7;
}
|
static void
killchild(int signo)
{
pid_t pid;
pid = sshpid;
if (pid > 1) {
kill(pid,
15
);
waitpid(pid,
((void *)0)
, 0);
}
_exit(1);
}
| long long killchild(unsigned long a0) {
unsigned int v0;
unsigned int v1;
v0 = a0;
v1 = sshpid;
if (v1 > 1) {
kill(v1, 0xf);
waitpid(v1, NULL, 0x0);
}
_exit(0x1);
}
|
void
file_error (filename)
char *filename;
{
perror (filename);
exit (2);
}
| void file_error(char *a0) {
perror(a0);
exit(0x2);
}
|
static struct strlist *
msort(struct strlist *list, int len)
{
struct strlist *p, *q =
((void *)0)
;
struct strlist **lpp;
int half;
int n;
if (len <= 1)
return list;
half = len >> 1;
p = list;
for (n = half ; --n >= 0 ; ) {
q = p;
p = p->next;
}
q->next =
((void *)0)
;
q = msort(list, half);
p = msort(p, len - half);
lpp = &list;
for (;;) {
if (strcmp(p->text, q->text) < 0) {
*lpp = p;
lpp = &p->next;
if ((p = *lpp) ==
((void *)0)
) {
*lpp = q;
break;
}
} else {
*lpp = q;
lpp = &q->next;
if ((q = *lpp) ==
((void *)0)
) {
*lpp = p;
break;
}
}
}
return list;
}
| int msort(unsigned long long a0, unsigned long a1) {
unsigned long long v0;
unsigned int v1;
unsigned int v2;
void* v3;
void* v4;
unsigned long long v5[2];
unsigned int v7;
v0 = a0;
v4 = 0;
if (a1 <= 1) {
v7 = v0;
} else {
v2 = a1 >> 1;
v3 = v0;
v1 = v2;
while (true) {
v1 -= 1;
if (v1 < 0)
break;
v4 = v3;
v3 = *(v3);
}
*(v4) = 0;
v4[0] = msort(v0, v2);
v3[0] = msort(v3, a1 - v2);
v5[0] = &v0;
do {
if (strcmp(v3[1], v4[1]) >= 0) {
v5[0] = v4;
v5[0] = v4;
v4[0] = v5[0];
if (!(!v4))
continue;
v5[0] = v3;
goto LABEL_4025c7;
}
v5[0] = v3;
v5[0] = v3;
v3[0] = v5[0];
} while (v3);
v5[0] = v4;
LABEL_4025c7:
v7 = v0;
}
return v7;
}
|
static
void boot_transitions()
{
CHILD *ch;
static int newlevel = 0;
static int warn = 1;
int loglevel;
int oldlevel;
for( ch = family; ch; ch = ch->next )
if ((ch->flags & 2) && ch->action != 4) break;
if (ch ==
((void *)0)
) {
loglevel = -1;
oldlevel = 'N';
switch(runlevel) {
case '#':
;
wrote_utmp_reboot = 0;
wrote_wtmp_reboot = 0;
write_utmp_wtmp("reboot", "~~", 0,
2
, "~");
newlevel = dfl_level ? dfl_level : get_init_default();
if (newlevel == 'S') {
runlevel = newlevel;
setproctitle("init [S]");
} else
runlevel = '*';
break;
case '*':
;
if (runlevel != newlevel)
loglevel = newlevel;
runlevel = newlevel;
did_boot = 1;
warn = 1;
break;
case 'S':
case 's':
;
newlevel = get_init_default();
if (!did_boot && newlevel != 'S')
runlevel = '*';
else {
if (runlevel != newlevel)
loglevel = newlevel;
runlevel = newlevel;
oldlevel = 'S';
}
warn = 1;
for(ch = family; ch; ch = ch->next)
if (strcmp(ch->rlevel, "S") == 0)
ch->flags &= ~(16|32|128);
break;
default:
if (warn)
initlog((1|2),
"no more processes left in this runlevel");
warn = 0;
loglevel = -1;
if (got_signals == 0)
check_init_fifo();
break;
}
if (loglevel > 0) {
initlog((1|2), "Entering runlevel: %c", runlevel);
wrote_utmp_rlevel = 0;
wrote_wtmp_rlevel = 0;
write_utmp_wtmp("runlevel", "~~", runlevel + 256 * oldlevel,
1
, "~");
thislevel = runlevel;
prevlevel = oldlevel;
setproctitle("init [%c]", (int)runlevel);
}
Write_Runlevel_Log(runlevel);
}
}
| long boot_transitions()
{
long result;
long v1;
long v2;
long v3;
long v4;
int init_default;
int v6;
long v7;
long v8;
long v9;
long v10;
int v11;
int v12;
long i;
long j;
result = family;
for ( i = family; i; i = result )
{
if ( (*(_DWORD *)i & 2) != 0 )
{
result = *(unsigned int *)(i + 48);
if ( (_DWORD)result != 4 )
break;
}
result = *(_QWORD *)(i + 192);
}
if ( !i )
{
v11 = -1;
v12 = 78;
if ( runlevel != 115 )
{
if ( runlevel > 115 )
goto LABEL_35;
if ( runlevel != 83 )
{
if ( runlevel <= 83 )
{
if ( runlevel == 35 )
{
wrote_utmp_reboot = 0;
wrote_wtmp_reboot = 0;
write_utmp_wtmp("reboot", "~~", 0LL, 2LL, "~");
if ( dfl_level )
init_default = dfl_level;
else
init_default = get_init_default();
newlevel_5631 = init_default;
if ( init_default == 83 )
{
runlevel = newlevel_5631;
setproctitle("init [S]", (long)"~~", v1, v2, v3, v4);
}
else
{
runlevel = 42;
}
LABEL_39:
if ( v11 > 0 )
{
initlog(3, "Entering runlevel: %c", (unsigned int)runlevel);
wrote_utmp_rlevel = 0;
wrote_wtmp_rlevel = 0;
write_utmp_wtmp("runlevel", "~~", (unsigned int)((v12 << 8) + runlevel), 1LL, "~");
thislevel = runlevel;
prevlevel = v12;
setproctitle("init [%c]", (unsigned int)runlevel, v7, v8, v9, v10);
}
return Write_Runlevel_Log((unsigned int)runlevel);
}
if ( runlevel == 42 )
{
if ( runlevel != newlevel_5631 )
v11 = newlevel_5631;
runlevel = newlevel_5631;
did_boot = 1;
warn_5632 = 1;
goto LABEL_39;
}
}
LABEL_35:
if ( warn_5632 )
initlog(3, "no more processes left in this runlevel");
warn_5632 = 0;
v11 = -1;
if ( !got_signals )
check_init_fifo();
goto LABEL_39;
}
}
newlevel_5631 = get_init_default();
if ( did_boot || newlevel_5631 == 83 )
{
if ( runlevel != newlevel_5631 )
v11 = newlevel_5631;
runlevel = newlevel_5631;
v12 = 83;
}
else
{
runlevel = 42;
}
warn_5632 = 1;
for ( j = family; j; j = *(_QWORD *)(j + 192) )
{
if ( !strcmp((const char *)(j + 36), "S") )
{
v6 = *(_DWORD *)j;
LOBYTE(v6) = *(_DWORD *)j & 0x4F;
*(_DWORD *)j = v6;
}
}
goto LABEL_39;
}
return result;
}
|
static int xfrm_policy_modify(int cmd, unsigned int flags, int argc, char **argv)
{
struct rtnl_handle rth;
struct {
struct nlmsghdr n;
struct xfrm_userpolicy_info xpinfo;
char buf[2048];
} req = {
.n.nlmsg_len = ((sizeof(req.xpinfo)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))),
.n.nlmsg_flags = 0x01 | flags,
.n.nlmsg_type = cmd,
.xpinfo.sel.family = preferred_family,
.xpinfo.lft.soft_byte_limit = (~(__u64)0),
.xpinfo.lft.hard_byte_limit = (~(__u64)0),
.xpinfo.lft.soft_packet_limit = (~(__u64)0),
.xpinfo.lft.hard_packet_limit = (~(__u64)0),
};
char *dirp =
((void *)0)
;
char *selp =
((void *)0)
;
char *ptypep =
((void *)0)
;
char *sctxp =
((void *)0)
;
struct xfrm_userpolicy_type upt = {};
char tmpls_buf[1024] = {};
int tmpls_len = 0;
struct xfrm_mark mark = {0, 0};
struct {
struct xfrm_user_sec_ctx sctx;
char str[256];
} ctx = {};
_Bool
is_if_id_set =
0
;
__u32 if_id = 0;
while (argc > 0) {
if (strcmp(*argv, "dir") == 0) {
if (dirp)
duparg("dir", *argv);
dirp = *argv;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
xfrm_policy_dir_parse(&req.xpinfo.dir, &argc, &argv);
} else if (strcmp(*argv, "ctx") == 0) {
char *context;
if (sctxp)
duparg("ctx", *argv);
sctxp = *argv;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
context = *argv;
xfrm_sctx_parse((char *)&ctx.str, context, &ctx.sctx);
} else if (strcmp(*argv, "mark") == 0) {
xfrm_parse_mark(&mark, &argc, &argv);
} else if (strcmp(*argv, "index") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&req.xpinfo.index, *argv, 0))
invarg("INDEX value is invalid", *argv);
} else if (strcmp(*argv, "ptype") == 0) {
if (ptypep)
duparg("ptype", *argv);
ptypep = *argv;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
xfrm_policy_ptype_parse(&upt.type, &argc, &argv);
} else if (strcmp(*argv, "action") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (strcmp(*argv, "allow") == 0)
req.xpinfo.action = 0;
else if (strcmp(*argv, "block") == 0)
req.xpinfo.action = 1;
else
invarg("ACTION value is invalid\n", *argv);
} else if (strcmp(*argv, "priority") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&req.xpinfo.priority, *argv, 0))
invarg("PRIORITY value is invalid", *argv);
} else if (strcmp(*argv, "flag") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
xfrm_policy_flag_parse(&req.xpinfo.flags, &argc,
&argv);
} else if (strcmp(*argv, "limit") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
xfrm_lifetime_cfg_parse(&req.xpinfo.lft, &argc, &argv);
} else if (strcmp(*argv, "tmpl") == 0) {
struct xfrm_user_tmpl *tmpl;
if (tmpls_len + sizeof(*tmpl) > sizeof(tmpls_buf)) {
fprintf(
stderr
, "Too many tmpls: buffer overflow\n");
exit(1);
}
tmpl = (struct xfrm_user_tmpl *)((char *)tmpls_buf + tmpls_len);
tmpl->family = preferred_family;
tmpl->aalgos = (~(__u32)0);
tmpl->ealgos = (~(__u32)0);
tmpl->calgos = (~(__u32)0);
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
xfrm_tmpl_parse(tmpl, &argc, &argv);
tmpls_len += sizeof(*tmpl);
} else if (strcmp(*argv, "if_id") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&if_id, *argv, 0))
invarg("IF_ID value is invalid", *argv);
is_if_id_set =
1
;
} else {
if (selp)
duparg("unknown", *argv);
selp = *argv;
xfrm_selector_parse(&req.xpinfo.sel, &argc, &argv);
if (preferred_family ==
0
)
preferred_family = req.xpinfo.sel.family;
}
argc--; argv++;
}
if (!dirp) {
fprintf(
stderr
, "Not enough information: DIR is required.\n");
exit(1);
}
if (ptypep) {
addattr_l(&req.n, sizeof(req), XFRMA_POLICY_TYPE,
(void *)&upt, sizeof(upt));
}
if (tmpls_len > 0) {
addattr_l(&req.n, sizeof(req), XFRMA_TMPL,
(void *)tmpls_buf, tmpls_len);
}
if (mark.m) {
int r = addattr_l(&req.n, sizeof(req.buf), XFRMA_MARK,
(void *)&mark, sizeof(mark));
if (r < 0) {
fprintf(
stderr
, "%s: XFRMA_MARK failed\n", __func__);
exit(1);
}
}
if (sctxp) {
addattr_l(&req.n, sizeof(req), XFRMA_SEC_CTX,
(void *)&ctx, ctx.sctx.len);
}
if (is_if_id_set)
addattr32(&req.n, sizeof(req.buf), XFRMA_IF_ID, if_id);
if (rtnl_open_byproto(&rth, 0, 6) < 0)
exit(1);
if (req.xpinfo.sel.family ==
0
)
req.xpinfo.sel.family =
2
;
if (rtnl_talk(&rth, &req.n,
((void *)0)
) < 0)
exit(2);
rtnl_close(&rth);
return 0;
}
| undefined8 xfrm_policy_modify(undefined4 param_1,undefined4 param_2,int param_3,char **param_4)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
long in_FS_OFFSET;
char **local_e90;
int local_e84;
undefined4 local_e80;
undefined4 local_e7c;
char local_e75;
undefined4 local_e74;
int local_e70;
int local_e6c;
undefined4 local_e66;
undefined2 local_e62;
char *local_e60;
char *local_e58;
char *local_e50;
char *local_e48;
long local_e40;
char *local_e38;
undefined4 local_e30;
int local_e2c;
undefined local_e28 [64];
undefined8 local_de8;
undefined auStack3552 [264];
undefined8 local_cd8;
undefined auStack3272 [40];
ushort local_ca0;
undefined8 local_c90;
undefined8 local_c88;
undefined8 local_c80;
undefined8 local_c78;
undefined local_c30 [4];
undefined local_c2c [4];
undefined uStack3112;
undefined local_c27;
undefined auStack3110 [2062];
undefined8 local_418;
undefined8 local_410;
undefined8 local_408;
undefined2 auStack1024 [14];
undefined4 auStack996 [245];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
puVar3 = &local_cd8;
for (lVar2 = 0x117; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
local_cd8._0_4_ = 0xb8;
local_cd8._4_2_ = (undefined2)param_1;
local_cd8._6_2_ = (ushort)param_2 | 1;
local_ca0 = (ushort)preferred_family;
local_c90 = 0xffffffffffffffff;
local_c88 = 0xffffffffffffffff;
local_c80 = 0xffffffffffffffff;
local_c78 = 0xffffffffffffffff;
local_e60 = (char *)0x0;
local_e58 = (char *)0x0;
local_e50 = (char *)0x0;
local_e48 = (char *)0x0;
local_e66 = 0;
local_e62 = 0;
local_418 = 0;
local_410 = 0;
puVar3 = &local_408;
for (lVar2 = 0x7e; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
local_e70 = 0;
local_e30 = 0;
local_e2c = 0;
puVar3 = &local_de8;
for (lVar2 = 0x21; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
local_e75 = '\0';
local_e74 = 0;
local_e90 = param_4;
local_e84 = param_3;
local_e80 = param_2;
local_e7c = param_1;
do {
if (local_e84 < 1) {
if (local_e60 == (char *)0x0) {
fprintf(stderr,"Not enough information: DIR is required.\n");
exit(1);
}
if (local_e50 != (char *)0x0) {
addattr_l(&local_cd8,0x8b8,0x10,&local_e66,6);
}
if (0 < local_e70) {
addattr_l(&local_cd8,0x8b8,5,&local_418,local_e70);
}
if (local_e2c != 0) {
local_e6c = addattr_l(&local_cd8,0x800,0x15,&local_e30,8);
if (local_e6c < 0) {
fprintf(stderr,"%s: XFRMA_MARK failed\n","xfrm_policy_modify");
exit(1);
}
}
if (local_e48 != (char *)0x0) {
addattr_l(&local_cd8,0x8b8,8,&local_de8,(undefined2)local_de8);
}
if (local_e75 != '\0') {
addattr32(&local_cd8,0x800,0x1f,local_e74);
}
iVar1 = rtnl_open_byproto(local_e28,0,6);
if (iVar1 < 0) {
exit(1);
}
if (local_ca0 == 0) {
local_ca0 = 2;
}
iVar1 = rtnl_talk(local_e28,&local_cd8,0);
if (iVar1 < 0) {
exit(2);
}
rtnl_close(local_e28);
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return 0;
}
iVar1 = strcmp(*local_e90,"dir");
if (iVar1 == 0) {
if (local_e60 != (char *)0x0) {
duparg(&DAT_00104916,*local_e90);
}
local_e60 = *local_e90;
local_e90 = local_e90 + 1;
local_e84 = local_e84 + -1;
if (local_e84 < 1) {
incomplete_command();
}
xfrm_policy_dir_parse(&uStack3112,&local_e84,&local_e90);
}
else {
iVar1 = strcmp(*local_e90,"ctx");
if (iVar1 == 0) {
if (local_e48 != (char *)0x0) {
duparg(&DAT_0010491a,*local_e90);
}
local_e48 = *local_e90;
local_e90 = local_e90 + 1;
local_e84 = local_e84 + -1;
if (local_e84 < 1) {
incomplete_command();
}
local_e38 = *local_e90;
xfrm_sctx_parse(auStack3552,local_e38,&local_de8);
}
else {
iVar1 = strcmp(*local_e90,"mark");
if (iVar1 == 0) {
xfrm_parse_mark(&local_e30,&local_e84,&local_e90);
}
else {
iVar1 = strcmp(*local_e90,"index");
if (iVar1 == 0) {
local_e90 = local_e90 + 1;
local_e84 = local_e84 + -1;
if (local_e84 < 1) {
incomplete_command();
}
iVar1 = get_u32(local_c2c,*local_e90,0);
if (iVar1 == 0) goto LAB_00100f5a;
invarg("INDEX value is invalid",*local_e90);
}
iVar1 = strcmp(*local_e90,"ptype");
if (iVar1 == 0) {
if (local_e50 != (char *)0x0) {
duparg("ptype",*local_e90);
}
local_e50 = *local_e90;
local_e90 = local_e90 + 1;
local_e84 = local_e84 + -1;
if (local_e84 < 1) {
incomplete_command();
}
xfrm_policy_ptype_parse(&local_e66,&local_e84,&local_e90);
}
else {
iVar1 = strcmp(*local_e90,"action");
if (iVar1 == 0) {
local_e90 = local_e90 + 1;
local_e84 = local_e84 + -1;
if (local_e84 < 1) {
incomplete_command();
}
iVar1 = strcmp(*local_e90,"allow");
if (iVar1 == 0) {
local_c27 = 0;
}
else {
iVar1 = strcmp(*local_e90,"block");
if (iVar1 != 0) {
invarg("ACTION value is invalid\n",*local_e90);
goto LAB_00100bbb;
}
local_c27 = 1;
}
}
else {
LAB_00100bbb:
iVar1 = strcmp(*local_e90,"priority");
if (iVar1 == 0) {
local_e90 = local_e90 + 1;
local_e84 = local_e84 + -1;
if (local_e84 < 1) {
incomplete_command();
}
iVar1 = get_u32(local_c30,*local_e90,0);
if (iVar1 == 0) goto LAB_00100f5a;
invarg("PRIORITY value is invalid",*local_e90);
}
iVar1 = strcmp(*local_e90,"flag");
if (iVar1 == 0) {
local_e90 = local_e90 + 1;
local_e84 = local_e84 + -1;
if (local_e84 < 1) {
incomplete_command();
}
xfrm_policy_flag_parse(auStack3110,&local_e84,&local_e90);
}
else {
iVar1 = strcmp(*local_e90,"limit");
if (iVar1 == 0) {
local_e90 = local_e90 + 1;
local_e84 = local_e84 + -1;
if (local_e84 < 1) {
incomplete_command();
}
xfrm_lifetime_cfg_parse(&local_c90,&local_e84,&local_e90);
}
else {
iVar1 = strcmp(*local_e90,"tmpl");
if (iVar1 == 0) {
if (0x400 < (long)local_e70 + 0x40U) {
fprintf(stderr,"Too many tmpls: buffer overflow\n");
exit(1);
}
lVar2 = (long)local_e70;
local_e40 = (long)&local_418 + lVar2;
*(short *)((long)auStack1024 + lVar2) = (short)preferred_family;
*(undefined4 *)((long)auStack996 + lVar2) = 0xffffffff;
*(undefined4 *)((long)auStack996 + lVar2 + 4) = 0xffffffff;
*(undefined4 *)((long)auStack996 + lVar2 + 8) = 0xffffffff;
local_e90 = local_e90 + 1;
local_e84 = local_e84 + -1;
if (local_e84 < 1) {
incomplete_command();
}
xfrm_tmpl_parse(local_e40,&local_e84,&local_e90);
local_e70 = local_e70 + 0x40;
}
else {
iVar1 = strcmp(*local_e90,"if_id");
if (iVar1 == 0) {
local_e90 = local_e90 + 1;
local_e84 = local_e84 + -1;
if (local_e84 < 1) {
incomplete_command();
}
iVar1 = get_u32(&local_e74,*local_e90,0);
if (iVar1 != 0) {
invarg("IF_ID value is invalid",*local_e90);
}
local_e75 = '\x01';
}
else {
if (local_e58 != (char *)0x0) {
duparg("unknown",*local_e90);
}
local_e58 = *local_e90;
xfrm_selector_parse(auStack3272,&local_e84,&local_e90);
if (preferred_family == 0) {
preferred_family = (uint)local_ca0;
}
}
}
}
}
}
}
}
}
}
LAB_00100f5a:
local_e84 = local_e84 + -1;
local_e90 = local_e90 + 1;
} while( true );
}
|
static int ipstats_show(int argc, char **argv)
{
struct ipstats_stat_enabled enabled = {};
struct ipstats_sel sel = {};
const char *dev =
((void *)0)
;
int ifindex;
int err;
int i;
while (argc > 0) {
if (strcmp(*argv, "dev") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (dev !=
((void *)0)
)
duparg2("dev", *argv);
if (check_ifname(*argv))
invarg("\"dev\" not a valid ifname", *argv);
dev = *argv;
} else if (strcmp(*argv, "help") == 0) {
do_help();
return 0;
} else {
_Bool
found_level =
0
;
for (i = 0; i < (sizeof(ipstats_levels) / sizeof((ipstats_levels)[0])); i++) {
if (strcmp(*argv, ipstats_levels[i]) == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
err = ipstats_select(&sel, *argv, i,
&enabled);
if (err)
goto err;
found_level =
1
;
}
}
if (!found_level) {
fprintf(
stderr
, "What is \"%s\"?\n", *argv);
do_help();
err = -
22
;
goto err;
}
}
do { argv++; argc--; } while(0);
}
err = ipstats_enable_check(&sel, &enabled);
if (err)
goto err;
if (dev) {
ifindex = ll_name_to_index(dev);
if (!ifindex) {
err = nodev(dev);
goto err;
}
} else {
ifindex = 0;
}
err = ipstats_show_do(ifindex, &enabled);
err:
ipstats_enabled_free(&enabled);
return err;
}
| int ipstats_show(int param_1,char **param_2)
{
bool bVar1;
int iVar2;
long in_FS_OFFSET;
char **local_68;
int local_5c;
int local_4c;
int local_48;
uint local_44;
char *local_40;
undefined8 local_38;
undefined8 local_30;
undefined8 local_28;
undefined8 local_20;
undefined8 local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_38 = 0;
local_30 = 0;
local_28 = 0;
local_20 = 0;
local_18 = 0;
local_40 = (char *)0x0;
local_68 = param_2;
for (local_5c = param_1; 0 < local_5c; local_5c = local_5c + -1) {
iVar2 = strcmp(*local_68,"dev");
if (iVar2 == 0) {
local_68 = local_68 + 1;
local_5c = local_5c + -1;
if (local_5c < 1) {
incomplete_command();
}
if (local_40 != (char *)0x0) {
duparg2(&DAT_0010349d,*local_68);
}
iVar2 = check_ifname(*local_68);
if (iVar2 != 0) {
invarg("\"dev\" not a valid ifname",*local_68);
}
local_40 = *local_68;
}
else {
iVar2 = strcmp(*local_68,"help");
if (iVar2 == 0) {
do_help();
local_48 = 0;
goto LAB_00102b05;
}
bVar1 = false;
for (local_44 = 0; local_44 < 3; local_44 = local_44 + 1) {
iVar2 = strcmp(*local_68,*(char **)(ipstats_levels + (long)(int)local_44 * 8));
if (iVar2 == 0) {
local_68 = local_68 + 1;
local_5c = local_5c + -1;
if (local_5c < 1) {
incomplete_command();
}
local_48 = ipstats_select(&local_28,*local_68,local_44,&local_38);
if (local_48 != 0) goto LAB_00102af6;
bVar1 = true;
}
}
if (!bVar1) {
fprintf(stderr,"What is \"%s\"?\n",*local_68);
do_help();
local_48 = -0x16;
goto LAB_00102af6;
}
}
local_68 = local_68 + 1;
}
local_48 = ipstats_enable_check(&local_28,&local_38);
if (local_48 == 0) {
if (local_40 == (char *)0x0) {
local_4c = 0;
}
else {
local_4c = ll_name_to_index(local_40);
if (local_4c == 0) {
local_48 = nodev(local_40);
goto LAB_00102af6;
}
}
local_48 = ipstats_show_do(local_4c,&local_38);
}
LAB_00102af6:
ipstats_enabled_free(&local_38);
LAB_00102b05:
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return local_48;
}
__stack_chk_fail();
}
|
void print_rta_ifidx(FILE *fp, __u32 ifidx, const char *prefix)
{
const char *ifname = ll_index_to_name(ifidx);
if (is_json_context()) {
print_string(PRINT_JSON, prefix,
((void *)0)
, ifname);
} else {
fprintf(fp, "%s ", prefix);
color_fprintf(fp, COLOR_IFNAME, "%s ", ifname);
}
}
| void print_rta_ifidx(void* a0, unsigned long a1, unsigned long long a2) {
unsigned long long v0;
unsigned long long v3;
unsigned long long v4;
v0 = ll_index_to_name(a1);
if (is_json_context()) {
v3 = print_string(0x2, a2, 0x0, v0);
} else {
fprintf(a0, "%s ", a2);
v4 = color_fprintf(a0, 0x0, "%s ", v0);
}
return;
}
|
literal_get(EditLine *el, wint_t idx)
{
el_literal_t *l = &el->el_literal;
((void) sizeof ((
idx & ((wint_t)0x80000000)
) ? 1 : 0), __extension__ ({ if (
idx & ((wint_t)0x80000000)
) ; else __assert_fail (
"idx & EL_LITERAL"
, "literal.c", 134, __extension__ __PRETTY_FUNCTION__); }))
;
idx &= ~((wint_t)0x80000000);
((void) sizeof ((
l->l_idx > (size_t)idx
) ? 1 : 0), __extension__ ({ if (
l->l_idx > (size_t)idx
) ; else __assert_fail (
"l->l_idx > (size_t)idx"
, "literal.c", 136, __extension__ __PRETTY_FUNCTION__); }))
;
return l->l_buf[idx];
}
| long long literal_get(unsigned long a0, unsigned long a1) {
unsigned int v0;
unsigned long long v1[2];
v0 = a1;
v1[0] = a0 + 848;
if (v0 >= 0)
__assert_fail();
v0 &= 2147483647;
if (v1[1] > v0)
return *((v1[0] + v0 * 8));
__assert_fail();
}
|
static inline int
__gnutls_priority_set_direct(gnutls_session_t session, const char *str, int line)
{
const char *err;
int ret = gnutls_priority_set_direct(session, str, &err);
if (ret < 0) {
if (ret == -326)
return TEST_IGNORE;
fprintf(
stderr
, "Error at %d with string %s\n", line, str);
fprintf(
stderr
, "Error at %s: %s\n", err,
gnutls_strerror(ret));
exit(1);
}
return TEST_SUCCEED;
}
| undefined8 __gnutls_priority_set_direct(undefined8 param_1,undefined8 param_2,uint param_3)
{
int iVar1;
undefined8 uVar2;
long in_FS_OFFSET;
undefined8 local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
iVar1 = gnutls_priority_set_direct(param_1,param_2,&local_18);
if (iVar1 < 0) {
if (iVar1 != -0x146) {
fprintf(stderr,"Error at %d with string %s\n",(ulong)param_3,param_2);
uVar2 = gnutls_strerror(iVar1);
fprintf(stderr,"Error at %s: %s\n",local_18,uVar2);
exit(1);
}
uVar2 = 3;
}
else {
uVar2 = 0;
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar2;
}
|
static errcode_t pass1_check_directory(ext2_filsys fs, ext2_ino_t ino)
{
e2fsck_t ctx = (e2fsck_t) fs->priv_data;
if ((ino != ctx->stashed_ino) || !ctx->stashed_inode)
return (2133571393L);
if (!(((ctx->stashed_inode->i_mode) & 00170000) == 0040000))
return (2133571402L);
return 0;
}
| long long pass1_check_directory(struct_0 *a0, unsigned long a1) {
struct_1 *v0;
unsigned long long v2;
v0 = a0->field_e0;
if (a1 != v0->field_218) {
v2 = 2133571393;
return v2;
} else if (!v0->field_220) {
v2 = 2133571393;
return v2;
} else {
v2 = ((v0->field_220->field_0 & 0xf000) == 0x4000 ? 2133571402 : 0);
return v2;
}
}
|
static int amt_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
unsigned int mode, max_tunnels;
inet_prefix saddr, daddr;
__u64 attrs = 0;
__u16 port;
saddr.family = daddr.family =
0
;
inet_prefix_reset(&saddr);
inet_prefix_reset(&daddr);
while (argc > 0) {
if (strcmp(*argv, "mode") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (strcmp(*argv, "gateway") == 0) {
mode = 0;
} else if (strcmp(*argv, "relay") == 0) {
mode = 1;
} else {
usage();
return -1;
}
addattr32(n, 1024, IFLA_AMT_MODE, mode);
} else if (strcmp(*argv, "relay_port") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u16(&port, *argv, 0))
invarg("relay_port", *argv);
addattr16(n, 1024, IFLA_AMT_RELAY_PORT, htons(port));
} else if (strcmp(*argv, "gateway_port") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u16(&port, *argv, 0))
invarg("gateway_port", *argv);
addattr16(n, 1024, IFLA_AMT_GATEWAY_PORT, htons(port));
} else if (strcmp(*argv, "max_tunnels") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&max_tunnels, *argv, 0))
invarg("max_tunnels", *argv);
addattr32(n, 1024, IFLA_AMT_MAX_TUNNELS, max_tunnels);
} else if (strcmp(*argv, "dev") == 0) {
unsigned int link;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
link = ll_name_to_index(*argv);
if (!link)
exit(nodev(*argv));
addattr32(n, 1024, IFLA_AMT_LINK, link);
} else if (strcmp(*argv, "local") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
check_duparg(&attrs, IFLA_AMT_LOCAL_IP, "local", *argv);
get_addr(&saddr, *argv, daddr.family);
if (is_addrtype_inet(&saddr))
addattr_l(n, 1024, IFLA_AMT_LOCAL_IP,
saddr.data, saddr.bytelen);
} else if (strcmp(*argv, "discovery") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
check_duparg(&attrs, IFLA_AMT_DISCOVERY_IP,
"discovery", *argv);
get_addr(&daddr, *argv, daddr.family);
if (is_addrtype_inet(&daddr))
addattr_l(n, 1024, IFLA_AMT_DISCOVERY_IP,
daddr.data, daddr.bytelen);
} else if (strcmp(*argv, "help") == 0) {
usage();
return -1;
} else {
fprintf(
stderr
, "amt: unknown command \"%s\"?\n", *argv);
usage();
return -1;
}
argc--, argv++;
}
return 0;
}
| undefined8 amt_parse_opt(undefined8 param_1,int param_2,char **param_3,undefined8 param_4)
{
char cVar1;
int iVar2;
undefined8 uVar3;
long in_FS_OFFSET;
char **local_260;
int local_254;
uint16_t local_23e;
undefined4 local_23c;
undefined4 local_238;
int local_234;
undefined8 local_230;
undefined local_228 [2];
undefined2 local_226;
undefined2 local_222;
undefined local_220 [264];
undefined local_118 [2];
undefined2 local_116;
undefined2 local_112;
undefined local_110 [256];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_230 = 0;
local_112 = 0;
local_222 = 0;
inet_prefix_reset(local_228);
inet_prefix_reset(local_118);
local_260 = param_3;
local_254 = param_2;
do {
if (local_254 < 1) {
uVar3 = 0;
LAB_001007a9:
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar3;
}
iVar2 = strcmp(*local_260,"mode");
if (iVar2 == 0) {
if (local_254 + -1 < 1) {
incomplete_command();
}
iVar2 = strcmp(local_260[1],"gateway");
if (iVar2 == 0) {
local_238 = 0;
}
else {
iVar2 = strcmp(local_260[1],"relay");
if (iVar2 != 0) {
usage();
uVar3 = 0xffffffff;
goto LAB_001007a9;
}
local_238 = 1;
}
addattr32(param_4,0x400,1,local_238);
}
else {
iVar2 = strcmp(*local_260,"relay_port");
if (iVar2 == 0) {
if (local_254 + -1 < 1) {
incomplete_command();
}
iVar2 = get_u16(&local_23e,local_260[1],0);
if (iVar2 != 0) {
invarg("relay_port",local_260[1]);
}
htons(local_23e);
addattr16(param_4,0x400,2);
}
else {
iVar2 = strcmp(*local_260,"gateway_port");
if (iVar2 == 0) {
if (local_254 + -1 < 1) {
incomplete_command();
}
iVar2 = get_u16(&local_23e,local_260[1],0);
if (iVar2 != 0) {
invarg("gateway_port",local_260[1]);
}
htons(local_23e);
addattr16(param_4,0x400,3);
}
else {
iVar2 = strcmp(*local_260,"max_tunnels");
if (iVar2 == 0) {
if (local_254 + -1 < 1) {
incomplete_command();
}
iVar2 = get_u32(&local_23c,local_260[1],0);
if (iVar2 != 0) {
invarg("max_tunnels",local_260[1]);
}
addattr32(param_4,0x400,8,local_23c);
}
else {
iVar2 = strcmp(*local_260,"dev");
if (iVar2 == 0) {
if (local_254 + -1 < 1) {
incomplete_command();
}
local_234 = ll_name_to_index(local_260[1]);
if (local_234 == 0) {
iVar2 = nodev();
exit(iVar2);
}
addattr32(param_4,0x400,4,local_234);
}
else {
iVar2 = strcmp(*local_260,"local");
if (iVar2 == 0) {
if (local_254 + -1 < 1) {
incomplete_command();
}
check_duparg(&local_230,5,"local",local_260[1]);
get_addr(local_228,local_260[1],local_112);
cVar1 = is_addrtype_inet(local_228);
if (cVar1 != '\0') {
addattr_l(param_4,0x400,5,local_220,local_226);
}
}
else {
iVar2 = strcmp(*local_260,"discovery");
if (iVar2 != 0) {
iVar2 = strcmp(*local_260,"help");
if (iVar2 == 0) {
usage();
uVar3 = 0xffffffff;
}
else {
fprintf(stderr,"amt: unknown command \"%s\"?\n",*local_260);
usage();
uVar3 = 0xffffffff;
}
goto LAB_001007a9;
}
if (local_254 + -1 < 1) {
incomplete_command();
}
check_duparg(&local_230,7,"discovery",local_260[1]);
get_addr(local_118,local_260[1],local_112);
cVar1 = is_addrtype_inet(local_118);
if (cVar1 != '\0') {
addattr_l(param_4,0x400,7,local_110,local_116);
}
}
}
}
}
}
}
local_254 = local_254 + -2;
local_260 = local_260 + 2;
} while( true );
}
|
SHELL_VAR *
find_variable_internal (name, flags)
const char *name;
int flags;
{
SHELL_VAR *var;
int search_tempenv, force_tempenv;
VAR_CONTEXT *vc;
var = (SHELL_VAR *)
((void *)0)
;
force_tempenv = (flags & 0x01);
search_tempenv = force_tempenv || (expanding_redir == 0 && subshell_environment);
if (search_tempenv && temporary_env)
var = hash_lookup (name, temporary_env);
if (var == 0)
{
if ((flags & 0x02) == 0)
var = var_lookup (name, shell_variables);
else
{
for (vc = shell_variables; vc; vc = vc->down)
{
var = hash_lookup (name, vc->table);
if (var && ((((var)->attributes) & (0x0001000))))
var = 0;
if (var)
break;
}
}
}
if (var == 0)
return ((SHELL_VAR *)
((void *)0)
);
return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var);
}
| long find_variable_internal(undefined8 param_1,uint param_2)
{
bool bVar1;
long local_18;
long local_10;
local_18 = 0;
if (((param_2 & 1) == 0) && ((expanding_redir != 0 || (subshell_environment == 0)))) {
bVar1 = false;
}
else {
bVar1 = true;
}
if ((bVar1) && (temporary_env != 0)) {
local_18 = hash_lookup(param_1,temporary_env);
}
if (local_18 == 0) {
if ((param_2 & 2) == 0) {
local_18 = var_lookup(param_1,shell_variables);
}
else {
for (local_10 = shell_variables; local_10 != 0; local_10 = *(long *)(local_10 + 0x18)) {
local_18 = hash_lookup(param_1,*(undefined8 *)(local_10 + 0x20));
if ((local_18 != 0) && ((*(uint *)(local_18 + 0x28) & 0x1000) != 0)) {
local_18 = 0;
}
if (local_18 != 0) break;
}
}
}
if (local_18 == 0) {
local_18 = 0;
}
else if (*(long *)(local_18 + 0x18) != 0) {
local_18 = (**(code **)(local_18 + 0x18))(local_18);
}
return local_18;
}
|
static void
dump_cfg_string(OpCodes code, const char *val)
{
if (val ==
((void *)0)
)
return;
printf("%s %s\n", lookup_opcode_name(code), val);
}
| void dump_cfg_string(unsigned long a0, unsigned long a1) {
unsigned long long v1;
if (a1)
v1 = printf("%s %s\n", lookup_opcode_name(a0), a1);
return;
}
|
static const char *strxf_limit(__u64 limit)
{
static char str[32];
if (limit == (~(__u64)0))
strcpy(str, "(INF)");
else
sprintf(str, "%llu", (unsigned long long) limit);
return str;
}
| undefined1 * strxf_limit(long param_1)
{
if (param_1 == -1) {
strcpy(str_9320,"(INF)");
}
else {
sprintf(str_9320,"%llu",param_1);
}
return str_9320;
}
|
static void netns_restore(void)
{
if (saved_netns == -1)
return;
if (setns(saved_netns,
0x40000000
)) {
perror("setns");
exit(1);
}
close(saved_netns);
saved_netns = -1;
}
| void netns_restore() {
unsigned long long v1;
unsigned long long v2;
unsigned long long v3;
v1 = saved_netns;
if (saved_netns != -1) {
v2 = setns(saved_netns, 0x40000000);
if (v2) {
perror("setns");
exit(0x1);
}
v3 = close(saved_netns);
saved_netns = -1;
}
if (!v2 || saved_netns == -1)
return;
}
|
static void
send_string_request(struct sftp_conn *conn, u_int id, u_int code, const char *s,
u_int len)
{
struct sshbuf *msg;
int r;
if ((msg = sshbuf_new()) ==
((void *)0)
)
sshfatal("sftp-client.c", __func__, 241, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new failed");
if ((r = sshbuf_put_u8(msg, code)) != 0 ||
(r = sshbuf_put_u32(msg, id)) != 0 ||
(r = sshbuf_put_string(msg, s, len)) != 0)
sshfatal("sftp-client.c", __func__, 245, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose");
send_msg(conn, msg);
sshlog("sftp-client.c", __func__, 247, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "Sent message fd %d T:%u I:%u", conn->fd_out, code, id);
sshbuf_free(msg);
}
| void send_string_request(long param_1,uint param_2,uint param_3,undefined8 param_4,
undefined4 param_5)
{
uint uVar1;
undefined4 uVar2;
undefined8 uVar3;
char **ppcVar4;
undefined *puVar5;
char *apcStack128 [2];
ulong auStack112 [5];
char *pcStack72;
undefined8 uStack64;
undefined auStack56 [4];
undefined4 local_34;
undefined8 local_30;
uint local_28;
uint local_24;
long local_20;
int local_14;
long local_10;
ppcVar4 = (char **)auStack56;
uStack64 = 0x1006c0;
local_34 = param_5;
local_30 = param_4;
local_28 = param_3;
local_24 = param_2;
local_20 = param_1;
local_10 = sshbuf_new();
if (local_10 == 0) {
ppcVar4 = &pcStack72;
pcStack72 = "sshbuf_new failed";
sshfatal("sftp-client.c","send_string_request",0xf1,1,1,0);
}
*(undefined8 *)((long)ppcVar4 + -8) = 0x100719;
local_14 = sshbuf_put_u8(local_10,local_28 & 0xff);
if (local_14 == 0) {
*(undefined8 *)((long)ppcVar4 + -8) = 0x100733;
local_14 = sshbuf_put_u32(local_10,local_24);
uVar2 = local_34;
if (local_14 == 0) {
*(undefined8 *)((long)ppcVar4 + -8) = 0x100752;
local_14 = sshbuf_put_string(local_10,local_30,uVar2);
puVar5 = (undefined *)ppcVar4;
if (local_14 == 0) goto LAB_0010079c;
}
}
*(undefined8 *)((long)ppcVar4 + -8) = 0x100765;
uVar3 = ssh_err(local_14);
puVar5 = (undefined *)((long)ppcVar4 + -0x10);
*(char **)((long)ppcVar4 + -0x10) = "compose";
*(undefined8 *)((long)ppcVar4 + -0x18) = 0x10079c;
sshfatal("sftp-client.c","send_string_request",0xf5,1,1,uVar3);
LAB_0010079c:
*(undefined8 *)(puVar5 + -8) = 0x1007af;
send_msg(local_20,local_10);
uVar1 = *(uint *)(local_20 + 4);
*(ulong *)(puVar5 + -8) = (ulong)local_24;
*(ulong *)(puVar5 + -0x10) = (ulong)local_28;
*(ulong *)(puVar5 + -0x18) = (ulong)uVar1;
*(char **)(puVar5 + -0x20) = "Sent message fd %d T:%u I:%u";
*(undefined8 *)(puVar5 + -0x28) = 0x1007f5;
sshlog("sftp-client.c","send_string_request",0xf7,0,7,0);
*(undefined8 *)(puVar5 + -8) = 0x100805;
sshbuf_free(local_10);
return;
}
|
static int tunnel_nlmsg(struct nlmsghdr *n, void *arg)
{
int ret = get_response(n, arg);
if (ret == 0)
print_tunnel(arg);
return ret;
}
| int tunnel_nlmsg(undefined8 param_1,undefined8 param_2)
{
int iVar1;
iVar1 = get_response(param_1,param_2);
if (iVar1 == 0) {
print_tunnel(param_2);
}
return iVar1;
}
|
pid_t
subprocess(const char *tag, const char *command,
int ac, char **av, FILE **child, u_int flags,
struct passwd *pw, privdrop_fn *drop_privs, privrestore_fn *restore_privs)
{
FILE *f =
((void *)0)
;
struct stat st;
int fd, devnull, p[2], i;
pid_t pid;
char *cp, errmsg[512];
u_int nenv = 0;
char **env =
((void *)0)
;
if (drop_privs !=
((void *)0)
&& (pw ==
((void *)0)
|| restore_privs ==
((void *)0)
)) {
sshlog("misc.c", __func__, 2647, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s: inconsistent arguments", tag);
return 0;
}
if (pw ==
((void *)0)
&& (pw = getpwuid(getuid())) ==
((void *)0)
) {
sshlog("misc.c", __func__, 2651, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s: no user for current uid", tag);
return 0;
}
if (child !=
((void *)0)
)
*child =
((void *)0)
;
sshlog("misc.c", __func__, 2657, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "%s command \"%s\" running as %s (flags 0x%x)", tag, command, pw->pw_name, flags)
;
if ((flags & (1)) != 0 &&
(flags & (1<<1)) != 0) {
sshlog("misc.c", __func__, 2663, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "inconsistent flags");
return 0;
}
if (((flags & (1<<1)) == 0) != (child ==
((void *)0)
)) {
sshlog("misc.c", __func__, 2667, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "inconsistent flags/output");
return 0;
}
if (!path_absolute(av[0])) {
sshlog("misc.c", __func__, 2676, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s path is not absolute", tag);
return 0;
}
if (drop_privs !=
((void *)0)
)
drop_privs(pw);
if (stat(av[0], &st) == -1) {
sshlog("misc.c", __func__, 2682, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Could not stat %s \"%s\": %s", tag, av[0], strerror(
(*__errno_location ())
))
;
goto restore_return;
}
if ((flags & (1<<3)) == 0 &&
safe_path(av[0], &st,
((void *)0)
, 0, errmsg, sizeof(errmsg)) != 0) {
sshlog("misc.c", __func__, 2688, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Unsafe %s \"%s\": %s", tag, av[0], errmsg);
goto restore_return;
}
if (pipe(p) == -1) {
sshlog("misc.c", __func__, 2693, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s: pipe: %s", tag, strerror(
(*__errno_location ())
));
restore_return:
if (restore_privs !=
((void *)0)
)
restore_privs();
return 0;
}
if (restore_privs !=
((void *)0)
)
restore_privs();
switch ((pid = fork())) {
case -1:
sshlog("misc.c", __func__, 2704, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s: fork: %s", tag, strerror(
(*__errno_location ())
));
close(p[0]);
close(p[1]);
return 0;
case 0:
if ((flags & (1<<4)) == 0) {
nenv = 5;
env = xcalloc(sizeof(*env), nenv);
child_set_env(&env, &nenv, "PATH", "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin");
child_set_env(&env, &nenv, "USER", pw->pw_name);
child_set_env(&env, &nenv, "LOGNAME", pw->pw_name);
child_set_env(&env, &nenv, "HOME", pw->pw_dir);
if ((cp = getenv("LANG")) !=
((void *)0)
)
child_set_env(&env, &nenv, "LANG", cp);
}
for (i = 1; i <
(64 + 1)
; i++)
ssh_signal(i,
((__sighandler_t) 0)
);
if ((devnull = open(
"/dev/null"
,
02
)) == -1) {
sshlog("misc.c", __func__, 2725, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s: open %s: %s", tag,
"/dev/null"
, strerror(
(*__errno_location ())
))
;
_exit(1);
}
if (dup2(devnull,
0
) == -1) {
sshlog("misc.c", __func__, 2730, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s: dup2: %s", tag, strerror(
(*__errno_location ())
));
_exit(1);
}
fd = -1;
if ((flags & (1<<1)) != 0)
fd = p[1];
else if ((flags & (1)) != 0)
fd = devnull;
if (fd != -1 && dup2(fd,
1
) == -1) {
sshlog("misc.c", __func__, 2741, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s: dup2: %s", tag, strerror(
(*__errno_location ())
));
_exit(1);
}
closefrom(
2
+ 1);
if (geteuid() == 0 &&
initgroups(pw->pw_name, pw->pw_gid) == -1) {
sshlog("misc.c", __func__, 2748, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s: initgroups(%s, %u): %s", tag, pw->pw_name, (u_int)pw->pw_gid, strerror(
(*__errno_location ())
))
;
_exit(1);
}
if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1) {
sshlog("misc.c", __func__, 2753, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s: setresgid %u: %s", tag, (u_int)pw->pw_gid, strerror(
(*__errno_location ())
))
;
_exit(1);
}
if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) == -1) {
sshlog("misc.c", __func__, 2758, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s: setresuid %u: %s", tag, (u_int)pw->pw_uid, strerror(
(*__errno_location ())
))
;
_exit(1);
}
if ((flags & (1)) != 0 &&
dup2(
0
,
2
) == -1) {
sshlog("misc.c", __func__, 2765, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s: dup2: %s", tag, strerror(
(*__errno_location ())
));
_exit(1);
}
if (env !=
((void *)0)
)
execve(av[0], av, env);
else
execv(av[0], av);
sshlog("misc.c", __func__, 2772, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s %s \"%s\": %s", tag, env ==
((void *)0)
? "execv" : "execve", command, strerror(
(*__errno_location ())
))
;
_exit(127);
default:
break;
}
close(p[1]);
if ((flags & (1<<1)) == 0)
close(p[0]);
else if ((f = fdopen(p[0], "r")) ==
((void *)0)
) {
sshlog("misc.c", __func__, 2783, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s: fdopen: %s", tag, strerror(
(*__errno_location ())
));
close(p[0]);
kill(pid,
15
);
while (waitpid(pid,
((void *)0)
, 0) == -1 &&
(*__errno_location ())
==
4
)
;
return 0;
}
sshlog("misc.c", __func__, 2792, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "%s pid %ld", tag, (long)pid);
if (child !=
((void *)0)
)
*child = f;
return pid;
}
| __pid_t subprocess(undefined8 param_1,undefined8 param_2,undefined8 param_3,char **param_4,
FILE **param_5,uint param_6,passwd *param_7,code *param_8,code *param_9)
{
__uid_t _Var1;
int iVar2;
__pid_t _Var3;
int *piVar4;
char *pcVar5;
char *pcVar6;
long in_FS_OFFSET;
undefined8 uVar7;
passwd *local_318;
undefined4 local_2dc;
int local_2d8;
int local_2d4;
__pid_t local_2d0;
int local_2cc;
char **local_2c8;
FILE *local_2c0;
char *local_2b8;
int local_2b0;
int local_2ac;
stat local_2a8;
undefined local_218 [520];
long local_10;
local_318 = param_7;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_2c0 = (FILE *)0x0;
local_2dc = 0;
local_2c8 = (char **)0x0;
if ((param_8 == (code *)0x0) || ((param_7 != (passwd *)0x0 && (param_9 != (code *)0x0)))) {
if (param_7 == (passwd *)0x0) {
_Var1 = getuid();
local_318 = getpwuid(_Var1);
if (local_318 == (passwd *)0x0) {
sshlog("misc.c","subprocess",0xa5b,0,2,0,"%s: no user for current uid",param_1);
_Var3 = 0;
goto LAB_00107dd5;
}
}
if (param_5 != (FILE **)0x0) {
*param_5 = (FILE *)0x0;
}
sshlog("misc.c","subprocess",0xa61,1,7,0,"%s command \"%s\" running as %s (flags 0x%x)",param_1,
param_2,local_318->pw_name,param_6);
if (((param_6 & 1) == 0) || ((param_6 & 2) == 0)) {
if ((param_5 == (FILE **)0x0) == ((param_6 & 2) == 0)) {
iVar2 = path_absolute(*param_4);
if (iVar2 == 0) {
sshlog("misc.c","subprocess",0xa74,0,2,0,"%s path is not absolute",param_1);
_Var3 = 0;
}
else {
if (param_8 != (code *)0x0) {
(*param_8)(local_318);
}
iVar2 = stat(*param_4,&local_2a8);
if (iVar2 == -1) {
piVar4 = __errno_location();
pcVar5 = strerror(*piVar4);
sshlog("misc.c","subprocess",0xa7a,0,2,0,"Could not stat %s \"%s\": %s",param_1,*param_4
,pcVar5);
}
else if (((param_6 & 8) == 0) &&
(iVar2 = safe_path(*param_4,&local_2a8,0,0,local_218,0x200), iVar2 != 0)) {
sshlog("misc.c","subprocess",0xa80,0,2,0,"Unsafe %s \"%s\": %s",param_1,*param_4,
local_218);
}
else {
iVar2 = pipe(&local_2b0);
if (iVar2 != -1) {
if (param_9 != (code *)0x0) {
(*param_9)();
}
local_2d0 = fork();
if (local_2d0 == -1) {
piVar4 = __errno_location();
uVar7 = 0x1075f6;
pcVar5 = strerror(*piVar4);
sshlog("misc.c","subprocess",0xa90,0,2,0,"%s: fork: %s",param_1,pcVar5,uVar7);
close(local_2b0);
close(local_2ac);
_Var3 = 0;
}
else {
if (local_2d0 == 0) {
if ((param_6 & 0x10) == 0) {
local_2dc = 5;
local_2c8 = (char **)xcalloc(8,5);
child_set_env(&local_2c8,&local_2dc,&DAT_00108cbd,
"/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin");
child_set_env(&local_2c8,&local_2dc,&DAT_00108cc2,local_318->pw_name);
child_set_env(&local_2c8,&local_2dc,"LOGNAME",local_318->pw_name);
child_set_env(&local_2c8,&local_2dc,&DAT_00108ccf);
local_2b8 = getenv("LANG");
if (local_2b8 != (char *)0x0) {
child_set_env(&local_2c8,&local_2dc,&DAT_00108cd4);
}
}
for (local_2d4 = 1; local_2d4 < 0x41; local_2d4 = __addvsi3(local_2d4,1)) {
ssh_signal(local_2d4,0);
}
local_2cc = open("/dev/null",2);
if (local_2cc == -1) {
piVar4 = __errno_location();
pcVar5 = strerror(*piVar4);
sshlog("misc.c","subprocess",0xaa5,0,2,0,"%s: open %s: %s",param_1,"/dev/null",
pcVar5);
_exit(1);
}
iVar2 = dup2(local_2cc,0);
if (iVar2 == -1) {
piVar4 = __errno_location();
uVar7 = 0x107865;
pcVar5 = strerror(*piVar4);
sshlog("misc.c","subprocess",0xaaa,0,2,0,"%s: dup2: %s",param_1,pcVar5,uVar7);
_exit(1);
}
local_2d8 = -1;
if ((param_6 & 2) == 0) {
if ((param_6 & 1) != 0) {
local_2d8 = local_2cc;
}
}
else {
local_2d8 = local_2ac;
}
if ((local_2d8 != -1) && (iVar2 = dup2(local_2d8,1), iVar2 == -1)) {
piVar4 = __errno_location();
uVar7 = 0x107920;
pcVar5 = strerror(*piVar4);
sshlog("misc.c","subprocess",0xab5,0,2,0,"%s: dup2: %s",param_1,pcVar5,uVar7);
_exit(1);
}
closefrom();
_Var1 = geteuid();
if ((_Var1 == 0) &&
(iVar2 = initgroups(local_318->pw_name,local_318->pw_gid), iVar2 == -1)) {
piVar4 = __errno_location();
uVar7 = 0x1079b7;
pcVar5 = strerror(*piVar4);
sshlog("misc.c","subprocess",0xabc,0,2,0,"%s: initgroups(%s, %u): %s",param_1,
local_318->pw_name,local_318->pw_gid,pcVar5,uVar7);
_exit(1);
}
iVar2 = setresgid(local_318->pw_gid,local_318->pw_gid,local_318->pw_gid);
if (iVar2 == -1) {
piVar4 = __errno_location();
pcVar5 = strerror(*piVar4);
sshlog("misc.c","subprocess",0xac1,0,2,0,"%s: setresgid %u: %s",param_1,
local_318->pw_gid,pcVar5);
_exit(1);
}
iVar2 = setresuid(local_318->pw_uid,local_318->pw_uid,local_318->pw_uid);
if (iVar2 != -1) {
if (((param_6 & 1) != 0) && (iVar2 = dup2(0,2), iVar2 == -1)) {
piVar4 = __errno_location();
uVar7 = 0x107b6b;
pcVar5 = strerror(*piVar4);
sshlog("misc.c","subprocess",0xacd,0,2,0,"%s: dup2: %s",param_1,pcVar5,uVar7);
_exit(1);
}
if (local_2c8 == (char **)0x0) {
execv(*param_4,param_4);
}
else {
execve(*param_4,param_4,local_2c8);
}
piVar4 = __errno_location();
uVar7 = 0x107c15;
pcVar5 = strerror(*piVar4);
if (local_2c8 == (char **)0x0) {
pcVar6 = "execv";
}
else {
pcVar6 = "execve";
}
sshlog("misc.c","subprocess",0xad4,0,2,0,"%s %s \"%s\": %s",param_1,pcVar6,
param_2,pcVar5,uVar7);
_exit(0x7f);
}
piVar4 = __errno_location();
pcVar5 = strerror(*piVar4);
sshlog("misc.c","subprocess",0xac6,0,2,0,"%s: setresuid %u: %s",param_1,
local_318->pw_uid,pcVar5);
_exit(1);
}
close(local_2ac);
if ((param_6 & 2) == 0) {
uVar7 = 0x107c97;
close(local_2b0);
}
else {
uVar7 = 0x107cb0;
local_2c0 = fdopen(local_2b0,"r");
if (local_2c0 == (FILE *)0x0) {
piVar4 = __errno_location();
uVar7 = 0x107cd3;
pcVar5 = strerror(*piVar4);
sshlog("misc.c","subprocess",0xadf,0,2,0,"%s: fdopen: %s",param_1,pcVar5,uVar7);
close(local_2b0);
kill(local_2d0,0xf);
do {
_Var3 = waitpid(local_2d0,(int *)0x0,0);
if (_Var3 != -1) break;
piVar4 = __errno_location();
} while (*piVar4 == 4);
_Var3 = 0;
goto LAB_00107dd5;
}
}
sshlog("misc.c","subprocess",0xae8,1,7,0,"%s pid %ld",param_1,(long)local_2d0,uVar7)
;
_Var3 = local_2d0;
if (param_5 != (FILE **)0x0) {
*param_5 = local_2c0;
}
}
goto LAB_00107dd5;
}
piVar4 = __errno_location();
uVar7 = 0x10752e;
pcVar5 = strerror(*piVar4);
sshlog("misc.c","subprocess",0xa85,0,2,0,"%s: pipe: %s",param_1,pcVar5,uVar7);
}
if (param_9 != (code *)0x0) {
(*param_9)();
}
_Var3 = 0;
}
}
else {
sshlog("misc.c","subprocess",0xa6b,1,2,0,"inconsistent flags/output");
_Var3 = 0;
}
}
else {
sshlog("misc.c","subprocess",0xa67,1,2,0,"inconsistent flags");
_Var3 = 0;
}
}
else {
sshlog("misc.c","subprocess",0xa57,0,2,0,"%s: inconsistent arguments",param_1);
_Var3 = 0;
}
LAB_00107dd5:
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return _Var3;
}
__stack_chk_fail();
}
|
static size_t
esclen(const char *start, const char *p) {
size_t esc = 0;
while (p > start && *--p == (char)-127) {
esc++;
}
return esc;
}
| long esclen(unsigned long a1, unsigned long a2)
{
long i;
for ( i = 0LL; a2 > a1; ++i )
{
if ( *(_BYTE *)--a2 != 0x81 )
break;
}
return i;
}
|
int
have_unwind_protects ()
{
return (unwind_protect_list != 0);
}
| long long have_unwind_protects() {
return unwind_protect_list;
}
|
int
strlist_remove (sl, s)
STRINGLIST *sl;
char *s;
{
int r;
if (sl == 0 || sl->list == 0 || sl->list_len == 0)
return 0;
r = strvec_remove (sl->list, s);
if (r)
sl->list_len--;
return r;
}
| long long strlist_remove(struct_0 *a0, unsigned long long a1) {
unsigned int v0;
void* v2;
if (!a0) {
v2 = 0;
return v2;
} else if (!a0->field_0) {
v2 = 0;
return v2;
} else if (!a0->field_c) {
v2 = 0;
return v2;
} else {
v0 = strvec_remove(a0->field_0, a1, a1);
if (v0)
a0->field_c = a0->field_c - 1;
v2 = v0;
return v2;
}
}
|
static
_Bool
read_num (FILE *fp, char const *fieldname,
intmax_t min_val, uintmax_t max_val, intmax_t *pval)
{
int i;
char buf[((((((sizeof (intmax_t) * 8) - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) + 1)];
char offbuf[((((((sizeof (off_t) * 8) - (! ((__typeof__ (off_t)) 0 < (__typeof__ (off_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (off_t)) 0 < (__typeof__ (off_t)) -1))) + 1)];
char minbuf[((((((sizeof (intmax_t) * 8) - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) + 1)];
char maxbuf[((((((sizeof (intmax_t) * 8) - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) + 1)];
int conversion_errno;
int c = getc_unlocked (fp);
_Bool
negative = c == '-';
for (i = 0; (i == 0 && negative) || ((unsigned) (c) - '0' <= 9); i++)
{
buf[i] = c;
if (i == sizeof buf - 1)
do { if (error_hook) error_hook (); error (0, 0, gettext ("%s: byte %s: %s %.*s... too long"), quotearg_colon (listed_incremental_option), offtostr (ftello (fp), offbuf), fieldname, i + 1, buf); fatal_exit (); } while (0)
;
c = getc_unlocked (fp);
}
buf[i] = 0;
if (c < 0)
{
if (ferror_unlocked (fp))
read_fatal (listed_incremental_option);
if (i != 0)
do { if (error_hook) error_hook (); error (0, 0, "%s: %s", quotearg_colon (listed_incremental_option), gettext ("Unexpected EOF in snapshot file")); fatal_exit (); } while (0)
;
return
0
;
}
if (c)
{
unsigned uc = c;
do { if (error_hook) error_hook (); error (0, 0, gettext ("%s: byte %s: %s %s followed by invalid byte 0x%02x"), quotearg_colon (listed_incremental_option), offtostr (ftello (fp), offbuf), fieldname, buf, uc); fatal_exit (); } while (0)
;
}
*pval = strtosysint (buf,
((void *)0)
, min_val, max_val);
conversion_errno =
(*__errno_location ())
;
switch (conversion_errno)
{
case
34
:
do { if (error_hook) error_hook (); error (0, conversion_errno, gettext ("%s: byte %s: (valid range %s..%s)\n\t%s %s"), quotearg_colon (listed_incremental_option), offtostr (ftello (fp), offbuf), imaxtostr (min_val, minbuf), umaxtostr (max_val, maxbuf), fieldname, buf); fatal_exit (); } while (0)
;
default:
do { if (error_hook) error_hook (); error (0, conversion_errno, gettext ("%s: byte %s: %s %s"), quotearg_colon (listed_incremental_option), offtostr (ftello (fp), offbuf), fieldname, buf); fatal_exit (); } while (0)
;
case 0:
break;
}
return
1
;
}
| int read_num(void* a0, unsigned int a1, unsigned long long a2, unsigned long long a3, unsigned long long *a4) {
unsigned long v0;
unsigned int v1;
char *v2;
char *v3;
char v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned int v8;
char v9;
char v10;
char v11;
char v12;
unsigned long long v14;
unsigned long long v15;
unsigned long long v16;
unsigned long long v17;
unsigned long long v18;
unsigned int v20;
unsigned long long v23;
unsigned long long v25;
unsigned long long v26;
unsigned long long v27;
v6 = getc_unlocked(a0);
v4 = v6 == 45;
v5 = 0;
while (true) {
if (!v5 && !(!v4))
goto LABEL_402c04;
if (v6 - 48 > 9)
break;
LABEL_402c04:
(&v9)[v5] = v6;
if (v5 == 20) {
if (error_hook)
*(5243072)();
v14 = ftello(a0);
v15 = offtostr(v14, &v10, v14);
v16 = quotearg_colon(listed_incremental_option);
v3 = &v9;
v2 = v5 + 1;
a1 = 0;
error(0x0, 0x0, gettext("%s: byte %s: %s %.*s... too long"));
fatal_exit(0x0, a1, a2, v16, v15, a1);
}
v6 = getc_unlocked(a0);
v5 += 1;
}
(&v9)[v5] = 0;
if (v6 < 0) {
if (ferror_unlocked(a0))
read_fatal(listed_incremental_option);
if (v5) {
if (error_hook)
*(5243072)();
v14 = quotearg_colon(listed_incremental_option);
a1 = 0;
v20 = 0;
error(0x0, 0x0, "%s: %s");
fatal_exit(reg_72, a1, "%s: %s", v14, gettext("Unexpected EOF in snapshot file"), a1);
}
v14 = 0;
} else {
if (v6) {
v8 = v6;
if (error_hook)
*(5243072)();
v14 = ftello(a0);
v17 = offtostr(v14, &v10, v14);
v18 = quotearg_colon(listed_incremental_option);
v3 = v8;
v2 = &v9;
a1 = 0;
error(0x0, 0x0, gettext("%s: byte %s: %s %s followed by invalid byte 0x%02x"));
fatal_exit(0x0, a1, a2, v18, v17, a1);
}
*(a4) = strtosysint(&v9, 0x0, a2, a3);
*(&v14) = *(__errno_location());
v7 = v14;
if (v7) {
if (v7 == 34) {
if (error_hook)
*(5243072)();
v23 = ftello(a0);
v25 = quotearg_colon(listed_incremental_option);
v2 = &v9;
v1 = a1;
v0 = umaxtostr(a3, &v12, &v12);
a1 = v7;
error(0x0, v7, gettext("%s: byte %s: (valid range %s..%s)\n\t%s %s"));
fatal_exit(0x0, a1, a2, v25, offtostr(v23, &v10, v23), imaxtostr(a2, &v11, &v11));
}
if (error_hook)
*(5243072)();
v14 = ftello(a0);
v26 = offtostr(v14, &v10, v14);
v27 = quotearg_colon(listed_incremental_option);
v2 = &v9;
a1 = v7;
error(0x0, v7, gettext("%s: byte %s: %s %s"));
fatal_exit(0x0, a1, a2, v27, v26, a1);
}
v14 = 1;
}
return v14;
}
|
static void nh_update(nh_ctx *hc, const UINT8 *buf, UINT32 nbytes)
{
UINT32 i,j;
j = hc->next_data_empty;
if ((j + nbytes) >= 64) {
if (j) {
i = 64 - j;
memcpy(hc->data+j, buf, i);
nh_transform(hc,hc->data,64);
nbytes -= i;
buf += i;
hc->bytes_hashed += 64;
}
if (nbytes >= 64) {
i = nbytes & ~(64 - 1);
nh_transform(hc, buf, i);
nbytes -= i;
buf += i;
hc->bytes_hashed += i;
}
j = 0;
}
memcpy(hc->data + j, buf, nbytes);
hc->next_data_empty = j + nbytes;
}
| void nh_update(long param_1,void *param_2,uint param_3)
{
uint uVar1;
undefined4 uVar2;
uint local_2c;
void *local_28;
uint local_10;
local_10 = *(uint *)(param_1 + 0x450);
local_2c = param_3;
local_28 = param_2;
if (0x3f < param_3 + local_10) {
if (local_10 != 0) {
uVar1 = 0x40 - local_10;
memcpy((void *)(param_1 + 0x410 + (ulong)local_10),param_2,(ulong)uVar1);
nh_transform(param_1,param_1 + 0x410,0x40);
local_2c = param_3 - uVar1;
local_28 = (void *)((long)param_2 + (ulong)uVar1);
uVar2 = __addvsi3(*(undefined4 *)(param_1 + 0x454),0x40);
*(undefined4 *)(param_1 + 0x454) = uVar2;
}
if (0x3f < local_2c) {
uVar1 = local_2c & 0xffffffc0;
nh_transform(param_1,local_28,uVar1);
local_2c = local_2c - uVar1;
local_28 = (void *)((long)local_28 + (ulong)uVar1);
*(uint *)(param_1 + 0x454) = uVar1 + *(int *)(param_1 + 0x454);
}
local_10 = 0;
}
memcpy((void *)(param_1 + 0x410 + (ulong)local_10),local_28,(ulong)local_2c);
*(uint *)(param_1 + 0x450) = local_2c + local_10;
return;
}
|
int
_rl_current_display_line (void)
{
int ret, nleft;
if (rl_display_prompt == rl_prompt)
nleft = _rl_last_c_pos - _rl_screenwidth - rl_visible_prompt_length;
else
nleft = _rl_last_c_pos - _rl_screenwidth;
if (nleft > 0)
ret = 1 + nleft / _rl_screenwidth;
else
ret = 0;
return ret;
}
| long long _rl_current_display_line() {
unsigned int v0;
unsigned int v1;
if (rl_display_prompt == rl_prompt)
v1 = *(&_rl_last_c_pos) - *(&_rl_screenwidth) - rl_visible_prompt_length;
else
v1 = *(&_rl_last_c_pos) - *(&_rl_screenwidth);
if (v1 <= 0) {
v0 = 0;
return v0;
}
v0 = (v1 >> 31 CONCAT v1) /m *(&_rl_screenwidth) + 1;
return v0;
}
|
void
dispose_saved_dollar_vars ()
{
if (dollar_arg_stack == 0 || dollar_arg_stack_index == 0)
return;
dispose_words (dollar_arg_stack[--dollar_arg_stack_index].rest);
free_saved_dollar_vars (dollar_arg_stack[dollar_arg_stack_index].first_ten);
sh_xfree((dollar_arg_stack[dollar_arg_stack_index].first_ten), "variables.c", 5705);
dollar_arg_stack[dollar_arg_stack_index].first_ten = (char **)
((void *)0)
;
dollar_arg_stack[dollar_arg_stack_index].rest = (WORD_LIST *)
((void *)0)
;
dollar_arg_stack[dollar_arg_stack_index].count = 0;
}
| long long dispose_saved_dollar_vars() {
unsigned long long v1;
v1 = dollar_arg_stack;
if (!dollar_arg_stack)
return v1;
v1 = dollar_arg_stack_index;
if (dollar_arg_stack_index) {
dollar_arg_stack_index = dollar_arg_stack_index - 1;
dispose_words(*((dollar_arg_stack_index * 24 + dollar_arg_stack + 8)));
free_saved_dollar_vars(*((dollar_arg_stack_index * 24 + dollar_arg_stack)));
sh_xfree(*((dollar_arg_stack_index * 24 + dollar_arg_stack)), "variables.c", 0x1649);
*((dollar_arg_stack_index * 24 + dollar_arg_stack)) = 0;
*((dollar_arg_stack_index * 24 + dollar_arg_stack + 8)) = 0;
v1 = dollar_arg_stack_index * 24 + dollar_arg_stack;
*((dollar_arg_stack_index * 24 + dollar_arg_stack + 16)) = 0;
return v1;
}
return v1;
}
|
static inline void
initialize_exit_failure (int status)
{
if (status !=
1
)
exit_failure = status;
}
| void initialize_exit_failure(unsigned long long a0) {
unsigned long long v1;
if (a0 != 1) {
v1 = a0;
exit_failure = a0;
}
return;
}
|
static void bsPutUChar ( BitStream* bs, UChar c )
{
Int32 i;
for (i = 7; i >= 0; i--)
bsPutBit ( bs, (((UInt32) c) >> i) & 0x1 );
}
| void bsPutUChar(void* a0, unsigned long long a1) {
unsigned int v0;
unsigned long long v2;
unsigned long long v3;
v2 = a1;
for (v0 = 7; v0 >= 0; v0 -= 1) {
v3 = bsPutBit(a0, (a1 >> (v0 & 31)) & 1);
}
return;
}
|
void
_rl_release_sigwinch (void)
{
if (sigwinch_blocked == 0)
return;
sigprocmask (
2
, &sigwinch_oset, (sigset_t *)
((void *)0)
);
sigwinch_blocked = 0;
}
| void _rl_release_sigwinch(void)
{
if (sigwinch_blocked != 0) {
sigprocmask(2,(sigset_t *)sigwinch_oset,(sigset_t *)0x0);
sigwinch_blocked = 0;
}
return;
}
|
int
_rl_get_char_len (char *src, mbstate_t *ps)
{
size_t tmp, l;
int mb_cur_max;
l = (size_t)strlen (src);
if (_rl_utf8locale && l > 0 && (((*src) & 0x80) == 0))
tmp = (*src != 0) ? 1 : 0;
else
{
mb_cur_max =
(__ctype_get_mb_cur_max ())
;
tmp = mbrlen((const char *)src, (l < mb_cur_max) ? l : mb_cur_max, ps);
}
if (tmp == (size_t)(-2))
{
if (ps)
memset (ps, 0, sizeof(mbstate_t));
return -2;
}
else if (tmp == (size_t)(-1))
{
if (ps)
memset (ps, 0, sizeof(mbstate_t));
return -1;
}
else if (tmp == (size_t)0)
return 0;
else
return (int)tmp;
}
| int _rl_get_char_len(char *a0, void* a1) {
unsigned int v0;
unsigned long v1;
unsigned long long v2;
unsigned int v4;
v2 = strlen(a0);
if (!_rl_utf8locale || !v2 || *(a0) < 0) {
v0 = __ctype_get_mb_cur_max();
v4 = v0;
if (v2 <= v0)
v4 = v2;
v1 = mbrlen(v4, v4, a1, v4);
} else {
v1 = *(a0);
}
if (v1 == -2) {
if (a1)
memset(a1, 0x0, 0x8);
v4 = -2;
return v4;
} else if (v1 == -1) {
if (a1)
memset(a1, 0x0, 0x8);
v4 = -1;
return v4;
} else {
v4 = (!v1 ? v1 : 0);
return v4;
}
}
|
int serial_decode(const char *input, gnutls_datum_t *output)
{
int i;
int64_t value;
char *endptr;
int64_t value_limit;
gnutls_datum_t input_datum;
if (input[0] == '0' && input[1] == 'x') {
input_datum.data = (void *) (input + 2);
input_datum.size = strlen(input + 2);
if (input_datum.size == 0) {
return -302;
}
return gnutls_hex_decode2(&input_datum, output);
}
value = strtoll(input, &endptr, 10);
value_limit = 0x7fffffffffffffffLL;
if (*endptr != '\0') {
fprintf(
stderr
, "Trailing garbage: `%s'\n", endptr);
return -302;
}
if (value <= 0 || value >= value_limit) {
fprintf(
stderr
, "Integer out of range: `%s' (min: 1, max: %"
"l" "d"
")\n", input, value_limit-1);
return -302;
}
output->size = sizeof(int64_t);
output->data = gnutls_malloc(output->size);
if (output->data ==
((void *)0)
) {
output->size = 0;
return -25;
}
for (i = output->size - 1; i >= 0; i--) {
output->data[i] = value & 0xff;
value = value >> 8;
}
return 0;
}
| int serial_decode(char a0[2], struct_0 *a1) {
unsigned int v0;
unsigned long long v1;
unsigned long long v2;
char *v3;
unsigned int v4;
unsigned int v6;
if (a0[0] == 48 && a0[1] == 120) {
v3 = &a0[1];
v4 = strlen(a0 + 1);
if (!v4)
v6 = -302;
else
v6 = gnutls_hex_decode2(&v3, a1, a1);
}
if (a0[0] != 48 || a0[1] != 120) {
v1 = strtoll(a0, &v3, 0xa);
v2 = 9223372036854775807;
if (*(v3)) {
fprintf(*(*(&got.stderr)), "Trailing garbage: `%s'\n", v3);
v6 = -302;
} else {
if (v1 > 0 && v1 < v2) {
a1->field_8 = 8;
a1->field_0 = *(*(5243144))(a1->field_8);
if (!a1->field_0) {
a1->field_8 = 0;
v6 = -25;
} else {
for (v0 = a1->field_8 - 1; v0 >= 0; v0 -= 1) {
*((v0 + a1->field_0)) = v1;
v1 >>= 8;
}
v6 = 0;
}
}
if (v1 <= 0 || v1 >= v2) {
fprintf(*(*(&got.stderr)), "Integer out of range: `%s' (min: 1, max: %ld)\n", a0, (v2 - 1));
v6 = -302;
}
}
}
return v6;
}
|
static void
bind_termcap_arrow_keys (Keymap map)
{
Keymap xkeymap;
xkeymap = _rl_keymap;
_rl_keymap = map;
rl_bind_keyseq_if_unbound (_rl_term_ku, rl_get_previous_history);
rl_bind_keyseq_if_unbound (_rl_term_kd, rl_get_next_history);
rl_bind_keyseq_if_unbound (_rl_term_kr, rl_forward_char);
rl_bind_keyseq_if_unbound (_rl_term_kl, rl_backward_char);
rl_bind_keyseq_if_unbound (_rl_term_kh, rl_beg_of_line);
rl_bind_keyseq_if_unbound (_rl_term_at7, rl_end_of_line);
rl_bind_keyseq_if_unbound (_rl_term_kD, rl_delete);
rl_bind_keyseq_if_unbound (_rl_term_kI, rl_overwrite_mode);
rl_bind_keyseq_if_unbound (_rl_term_kN, rl_history_search_forward);
rl_bind_keyseq_if_unbound (_rl_term_kP, rl_history_search_backward);
_rl_keymap = xkeymap;
}
| void bind_termcap_arrow_keys(unsigned long long a0) {
unsigned long long v0;
unsigned long long v2;
v0 = _rl_keymap;
_rl_keymap = a0;
rl_bind_keyseq_if_unbound(_rl_term_ku, got.rl_get_previous_history, got.rl_get_previous_history);
rl_bind_keyseq_if_unbound(_rl_term_kd, got.rl_get_next_history, got.rl_get_next_history);
rl_bind_keyseq_if_unbound(_rl_term_kr, got.rl_forward_char, got.rl_forward_char);
rl_bind_keyseq_if_unbound(_rl_term_kl, got.rl_backward_char, got.rl_backward_char);
rl_bind_keyseq_if_unbound(_rl_term_kh, got.rl_beg_of_line, got.rl_beg_of_line);
rl_bind_keyseq_if_unbound(_rl_term_at7, got.rl_end_of_line, got.rl_end_of_line);
rl_bind_keyseq_if_unbound(_rl_term_kD, got.rl_delete, got.rl_delete);
rl_bind_keyseq_if_unbound(_rl_term_kI, got.rl_overwrite_mode, got.rl_overwrite_mode);
rl_bind_keyseq_if_unbound(_rl_term_kN, got.rl_history_search_forward, got.rl_history_search_forward);
rl_bind_keyseq_if_unbound(_rl_term_kP, got.rl_history_search_backward, got.rl_history_search_backward);
v2 = v0;
_rl_keymap = v0;
return;
}
|
static const struct parser_table*
found_parser (const char *original_arg, const struct parser_table *entry)
{
if (entry->type != ARG_POSITIONAL_OPTION)
{
if (entry->type == ARG_NOOP)
return
((void *)0)
;
if (entry->type == ARG_OPTION)
{
if ((first_nonoption_arg !=
((void *)0)
)
&& should_issue_warnings ())
{
error (0, 0,
gettext ("warning: you have specified the global option %s " "after the argument %s, but global options are not " "positional, i.e., %s affects tests specified before it " "as well as those specified after it. " "Please specify global options before other arguments.")
,
original_arg,
first_nonoption_arg,
original_arg);
}
}
else
{
if (first_nonoption_arg ==
((void *)0)
)
{
first_nonoption_arg = original_arg;
}
}
}
return entry;
}
| void found_parser(unsigned long long a0, unsigned int *a1) {
void* v1;
unsigned int *v3;
if (*(a1) != 2) {
if (*(a1) == 1) {
v1 = 0;
} else if (!*(a1)) {
if (first_nonoption_arg && should_issue_warnings())
error(0x0, 0x0, gettext("warning: you have specified the global option %s after the argument %s, but global options are not positional, i.e., %s affects tests specified before it as well as those specified after it. Please specify global options before other arguments."));
} else {
if (!first_nonoption_arg)
first_nonoption_arg = a0;
}
}
if (*(a1) == 2 || *(a1) != 1)
v3 = a1;
return;
}
|
static void cfg_free(struct cfg *cfg)
{
while (cfg->overrides) {
struct cfg_override *tmp = cfg->overrides;
cfg->overrides = cfg->overrides->next;
cfg_override_free(tmp);
}
while (cfg->searches) {
struct cfg_search *tmp = cfg->searches;
cfg->searches = cfg->searches->next;
cfg_search_free(tmp);
}
while (cfg->externals) {
struct cfg_external *tmp = cfg->externals;
cfg->externals = cfg->externals->next;
cfg_external_free(tmp);
}
while (cfg->excludes) {
struct cfg_exclude *tmp = cfg->excludes;
cfg->excludes = cfg->excludes->next;
cfg_exclude_free(tmp);
}
}
| void cfg_free(struct struct_0 *a0[519]) {
unsigned long long *v0;
unsigned long long *v1;
unsigned long long *v2;
unsigned long long *v3;
unsigned long long *v5;
while (a0[515]) {
v3 = &a0[515]->field_0;
a0[515] = a0[515]->field_0;
cfg_override_free(v3);
}
while (a0[516]) {
v2 = &a0[516]->field_0;
a0[516] = a0[516]->field_0;
cfg_search_free(v2);
}
while (a0[517]) {
v1 = &a0[517]->field_0;
a0[517] = a0[517]->field_0;
cfg_external_free(v1);
}
while (true) {
v5 = a0[518];
if (!a0[518])
break;
v0 = &a0[518]->field_0;
a0[518] = a0[518]->field_0;
cfg_exclude_free(v0);
}
return;
}
|
void
xheader_decode (struct tar_stat_info *st)
{
run_override_list (keyword_global_override_list, st);
run_override_list (global_header_override_list, st);
if (st->xhdr.size)
{
char *p = st->xhdr.buffer + 512;
while (decode_record (&st->xhdr, &p, decx, st))
continue;
}
run_override_list (keyword_override_list, st);
st->archive_file_size = st->stat.st_size;
if (st->real_size_set)
st->stat.st_size = st->real_size;
}
| unsigned long xheader_decode(long a1)
{
char *v2;
unsigned long v3;
v3 = __readfsqword(0x28u);
run_override_list((long ***)keyword_global_override_list, a1);
run_override_list((long ***)global_header_override_list, a1);
if ( *(_QWORD *)(a1 + 368) )
{
v2 = (char *)(*(_QWORD *)(a1 + 376) + 512LL);
while ( (unsigned char)decode_record(
a1 + 360,
&v2,
(void ( *)(long, char *, char *, unsigned long))decx,
a1) )
;
}
run_override_list((long ***)keyword_override_list, a1);
*(_QWORD *)(a1 + 280) = *(_QWORD *)(a1 + 136);
if ( *(_BYTE *)(a1 + 336) )
*(_QWORD *)(a1 + 136) = *(_QWORD *)(a1 + 328);
return __readfsqword(0x28u) ^ v3;
}
|
static struct pkginfo *
check_trigger_cycle(struct pkginfo *processing_now)
{
struct trigcyclenode *tcn;
struct trigcycleperpkg *tortoise_pkg;
struct trigpend *tortoise_trig;
struct pkginfo *giveup;
const char *sep;
debug(dbg_triggers, "check_triggers_cycle pnow=%s",
pkg_name(processing_now, pnaw_always));
tcn = trigproc_new_cyclenode(processing_now);
if (!hare) {
debug(dbg_triggersdetail, "check_triggers_cycle pnow=%s first",
pkg_name(processing_now, pnaw_always));
hare = tortoise = tcn;
return
((void *)0)
;
}
hare->next = tcn;
hare = hare->next;
if (tortoise_advance)
tortoise = tortoise->next;
tortoise_advance = !tortoise_advance;
for (tortoise_pkg = tortoise->pkgs;
tortoise_pkg;
tortoise_pkg = tortoise_pkg->next) {
if (!tortoise_in_hare(processing_now, tortoise_pkg))
return
((void *)0)
;
}
notice(gettext("cycle found while processing triggers:\n" " chain of packages whose triggers are or may be responsible:")
);
sep = " ";
for (tcn = tortoise; tcn; tcn = tcn->next) {
fprintf(
stderr
, "%s%s", sep,
pkg_name(tcn->then_processed, pnaw_nonambig));
sep = " -> ";
}
fprintf(
stderr
, gettext("\n" " packages' pending triggers which are" " or may be unresolvable:\n")
);
for (tortoise_pkg = tortoise->pkgs;
tortoise_pkg;
tortoise_pkg = tortoise_pkg->next) {
fprintf(
stderr
, " %s",
pkg_name(tortoise_pkg->pkg, pnaw_nonambig));
sep = ": ";
for (tortoise_trig = tortoise_pkg->then_trigs;
tortoise_trig;
tortoise_trig = tortoise_trig->next) {
fprintf(
stderr
, "%s%s", sep, tortoise_trig->name);
}
fprintf(
stderr
, "\n");
}
giveup = tortoise->pkgs->pkg;
debug(dbg_triggers, "check_triggers_cycle pnow=%s giveup=%s",
pkg_name(processing_now, pnaw_always),
pkg_name(giveup, pnaw_always));
if (giveup->status != PKG_STAT_TRIGGERSAWAITED &&
giveup->status != PKG_STAT_TRIGGERSPENDING)
do_internerr("trigproc.c", 355, __func__, "package %s in non-trigger state %s", pkg_name(giveup, pnaw_always), pkg_status_name(giveup))
;
giveup->clientdata->istobe = PKG_ISTOBE_NORMAL;
pkg_set_status(giveup, PKG_STAT_HALFCONFIGURED);
modstatdb_note(giveup);
print_error_perpackage(gettext("triggers looping, abandoned"),
pkg_name(giveup, pnaw_nonambig));
return giveup;
}
| long check_trigger_cycle(undefined8 param_1)
{
char cVar1;
undefined8 uVar2;
undefined8 *puVar3;
long lVar4;
char *__format;
undefined8 uVar5;
undefined8 *local_40;
undefined8 *local_38;
undefined8 *local_30;
undefined *local_28;
uVar2 = pkg_name(param_1,3);
debug(0x1000,"check_triggers_cycle pnow=%s",uVar2);
puVar3 = (undefined8 *)trigproc_new_cyclenode(param_1);
if (hare == (undefined8 *)0x0) {
uVar2 = pkg_name(param_1,3);
debug(0x2000,"check_triggers_cycle pnow=%s first",uVar2);
lVar4 = 0;
tortoise = puVar3;
hare = puVar3;
}
else {
*hare = puVar3;
hare = (undefined8 *)*hare;
if (tortoise_advance != '\0') {
tortoise = (undefined8 *)*tortoise;
}
tortoise_advance = tortoise_advance == '\0';
for (local_38 = (undefined8 *)tortoise[1]; local_38 != (undefined8 *)0x0;
local_38 = (undefined8 *)*local_38) {
cVar1 = tortoise_in_hare(param_1,local_38);
if (cVar1 != '\x01') {
return 0;
}
}
uVar2 = gettext(
"cycle found while processing triggers:\n chain of packages whose triggers are or may be responsible:"
);
notice(uVar2);
local_28 = &DAT_0010126c;
for (local_40 = tortoise; local_40 != (undefined8 *)0x0; local_40 = (undefined8 *)*local_40) {
uVar2 = pkg_name(local_40[2],1);
fprintf(stderr,"%s%s",local_28,uVar2);
local_28 = &DAT_00101274;
}
__format = (char *)gettext("\n packages\' pending triggers which are or may be unresolvable:\n")
;
fprintf(stderr,__format);
for (local_38 = (undefined8 *)tortoise[1]; local_38 != (undefined8 *)0x0;
local_38 = (undefined8 *)*local_38) {
uVar2 = pkg_name(local_38[1],1);
fprintf(stderr," %s",uVar2);
for (local_30 = (undefined8 *)local_38[2]; local_30 != (undefined8 *)0x0;
local_30 = (undefined8 *)*local_30) {
fprintf(stderr,"%s%s",&DAT_001012c5,local_30[1]);
}
fprintf(stderr,"\n");
}
lVar4 = *(long *)(tortoise[1] + 8);
uVar2 = pkg_name(lVar4,3);
uVar5 = pkg_name(param_1,3);
debug(0x1000,"check_triggers_cycle pnow=%s giveup=%s",uVar5,uVar2);
if ((*(int *)(lVar4 + 0x18) != 5) && (*(int *)(lVar4 + 0x18) != 6)) {
uVar2 = pkg_status_name(lVar4);
uVar5 = pkg_name(lVar4,3);
do_internerr("trigproc.c",0x163,"check_trigger_cycle","package %s in non-trigger state %s",
uVar5,uVar2);
}
**(undefined4 **)(lVar4 + 0x138) = 0;
pkg_set_status(lVar4,4);
modstatdb_note(lVar4);
uVar2 = pkg_name(lVar4,1);
uVar5 = gettext("triggers looping, abandoned");
print_error_perpackage(uVar5,uVar2);
}
return lVar4;
}
|
static int ipvrf_show(int argc, char **argv)
{
struct nlmsg_chain linfo = {
((void *)0)
,
((void *)0)
};
int rc = 0;
vrf_filter.kind = "vrf";
if (argc > 1)
usage();
if (argc == 1) {
__u32 tb_id;
tb_id = ipvrf_get_table(argv[0]);
if (!tb_id) {
fprintf(
stderr
, "Invalid VRF\n");
return 1;
}
printf("%s %u\n", argv[0], tb_id);
return 0;
}
if (ip_link_list(ipvrf_filter_req, &linfo) == 0) {
struct nlmsg_list *l;
unsigned nvrf = 0;
new_json_obj(json);
print_string(PRINT_FP,
((void *)0)
, "%-16s", "Name");
print_string(PRINT_FP,
((void *)0)
, " %5s\n", "Table");
print_string(PRINT_FP,
((void *)0)
, "%s\n",
"-----------------------");
for (l = linfo.head; l; l = l->next)
nvrf += ipvrf_print(&l->h);
if (!nvrf)
print_string(PRINT_FP,
((void *)0)
, "%s\n",
"No VRF has been configured");
delete_json_obj();
} else
rc = 1;
free_nlmsg_chain(&linfo);
return rc;
}
| void ipvrf_show(unsigned long a0, unsigned long long *a1, unsigned long a2, unsigned long a3, unsigned int a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
void* v3;
void* v4;
void* v5;
unsigned long long v7;
void* v8;
unsigned long long v9;
v4 = 0;
v5 = 0;
v0 = 0;
g_401b38 = "vrf";
if (a0 > 1) {
usage();
} else if (a0 == 1) {
v2 = ipvrf_get_table(*(a1));
if (!v2) {
fprintf(stderr, "Invalid VRF\n");
v7 = 1;
return;
}
printf("%s %u\n", *(a1), v2);
v8 = 0;
return;
} else {
if (ip_link_list(ipvrf_filter_req, &v4)) {
v0 = 1;
} else {
v1 = 0;
new_json_obj(json);
print_string(0x1, 0x0, "%-16s", "Name");
print_string(0x1, 0x0, " %5s\n", "Table");
print_string(0x1, 0x0, "%s\n", "-----------------------");
for (v3 = v4; v3; v3 = *(v3)) {
v1 += ipvrf_print(v3 + 8, 0x0, "%s\n", "-----------------------", a4, a5);
}
if (!v1)
print_string(0x1, 0x0, "%s\n", "No VRF has been configured");
delete_json_obj();
}
free_nlmsg_chain(&v4);
v9 = v0;
return;
}
}
|
int
main (int argc, char **argv)
{
int c;
;
set_program_name (argv[0]);
setlocale (
6
, "");
bindtextdomain ("coreutils", "/usr/local/share/locale");
textdomain ("coreutils");
initialize_exit_failure (EXIT_CANCELED);
atexit (close_stdout);
while ((c = getopt_long (argc, argv, "+i:o:e:", longopts,
((void *)0)
)) != -1)
{
int opt_fileno;
switch (c)
{
case 'e':
case 'i':
case 'o':
opt_fileno = optc_to_fileno (c);
((void) sizeof ((
0 <= opt_fileno && opt_fileno < (sizeof (stdbuf) / sizeof *(stdbuf))
) ? 1 : 0), __extension__ ({ if (
0 <= opt_fileno && opt_fileno < (sizeof (stdbuf) / sizeof *(stdbuf))
) ; else __assert_fail (
"0 <= opt_fileno && opt_fileno < ARRAY_CARDINALITY (stdbuf)"
, "src/stdbuf.c", 336, __extension__ __PRETTY_FUNCTION__); }))
;
stdbuf[opt_fileno].optc = c;
while (c_isspace (*optarg))
optarg++;
stdbuf[opt_fileno].optarg = optarg;
if (c == 'i' && *optarg == 'L')
{
error (0, 0, gettext ("line buffering stdin is meaningless"));
usage (EXIT_CANCELED);
}
if (!(strcmp (optarg, "L") == 0)
&& parse_size (optarg, &stdbuf[opt_fileno].size) == -1)
((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), gettext (\"invalid mode %s\"), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CANCELED,
(*__errno_location ())
, gettext ("invalid mode %s"), quote (optarg)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED,
(*__errno_location ())
, gettext ("invalid mode %s"), quote (optarg)), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
break;
case GETOPT_HELP_CHAR: usage (
0
); break;;
case GETOPT_VERSION_CHAR: version_etc (
stdout
, "stdbuf", "GNU coreutils", Version, ("Padraig Brady"), (char *)
((void *)0)
); exit (
0
); break;;
default:
usage (EXIT_CANCELED);
}
}
argv += optind;
argc -= optind;
if (argc < 1)
{
error (0, 0, gettext ("missing operand"));
usage (EXIT_CANCELED);
}
if (! set_libstdbuf_options ())
{
error (0, 0, gettext ("you must specify a buffering mode option"));
usage (EXIT_CANCELED);
}
set_program_path (program_name);
if (!program_path)
program_path = xstrdup ("/usr/local/lib/coreutils");
set_LD_PRELOAD ();
free (program_path);
execvp (*argv, argv);
int exit_status =
(*__errno_location ())
==
2
? EXIT_ENOENT : EXIT_CANNOT_INVOKE;
error (0,
(*__errno_location ())
, gettext ("failed to run command %s"), quote (argv[0]));
return exit_status;
}
| int main(unsigned long a0, char **a1) {
unsigned long long *v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned long long v6;
unsigned int v9;
unsigned long long v10;
v1 = a0;
v0 = a1;
set_program_name(*(v0));
setlocale(0x6, &g_4010ab);
bindtextdomain("coreutils", "/usr/local/share/locale");
textdomain("coreutils");
initialize_exit_failure(0x7d);
atexit(got.close_stdout);
while (true) {
v2 = getopt_long(v1, v0, "+i:o:e:", &longopts, NULL);
if (v2 == -1) {
v0 = &v0[optind];
v1 -= optind;
if (v1 <= 0) {
error(0x0, 0x0, gettext("missing operand"));
usage(0x7d);
} else if ((set_libstdbuf_options() ^ 1)) {
error(0x0, 0x0, gettext("you must specify a buffering mode option"));
usage(0x7d);
} else {
set_program_path(program_name);
if (!program_path) {
program_path = xstrdup("/usr/local/lib/coreutils");
break;
}
}
}
if (v2 > 111) {
LABEL_400d3a:
usage(0x7d);
}
if (v2 < 101) {
if (v2 == -131) {
version_etc(stdout, "stdbuf", "GNU coreutils", Version, "Padraig Brady", 0x0);
exit(0x0);
} else if (v2 == -130) {
usage(0x0);
}
goto LABEL_400d3a;
}
if (!((1 << ((v2 - 101) & 63)) & 1041))
goto LABEL_400d3a;
v4 = optc_to_fileno(v2);
if (v4 < 0) {
LABEL_400b81:
__assert_fail();
}
if (!(v4 <= 2))
goto LABEL_400b81;
for (*(&(&g_400ee8)[3 * v4]) = v2; c_isspace(*(optarg)); optarg = optarg + 1);
(&g_400ef0)[3 * v4] = optarg;
if (v2 == 105 && *(optarg) == 76) {
error(0x0, 0x0, gettext("line buffering stdin is meaningless"));
usage(0x7d);
}
if (strcmp(optarg, "L") && parse_size(optarg, &(&stdbuf)[2 * v4 + v4]) == -1) {
v6 = quote(optarg);
error(0x7d, *(__errno_location()), gettext("invalid mode %s"));
}
}
set_LD_PRELOAD();
free(program_path);
execvp(*(v0), v0);
if (*(__errno_location()) != 2)
v9 = 126;
else
v9 = 127;
v3 = v9;
v10 = quote(*(v0));
error(0x0, *(__errno_location()), gettext("failed to run command %s"));
return v3;
}
|
static inline __u32 rta_getattr_u32(const struct rtattr *rta)
{
return *(__u32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| int rta_getattr_u32(struct_0 *a0) {
return a0->field_4;
}
|
static int
execute_arith_for_command (arith_for_command)
ARITH_FOR_COM *arith_for_command;
{
intmax_t expresult;
int expok, body_status, arith_lineno, save_lineno;
body_status = 0;
loop_level++;
save_lineno = line_number;
if (arith_for_command->flags & 0x08)
arith_for_command->action->flags |= 0x08;
this_command_name = "((";
line_number = arith_lineno = arith_for_command->line;
if (variable_context && interactive_shell && sourcelevel == 0)
{
line_number -= function_line_number - 1;
if (line_number <= 0)
line_number = 1;
}
expresult = eval_arith_for_expr (arith_for_command->init, &expok);
if (expok == 0)
{
line_number = save_lineno;
return (1);
}
while (1)
{
line_number = arith_lineno;
expresult = eval_arith_for_expr (arith_for_command->test, &expok);
line_number = save_lineno;
if (expok == 0)
{
body_status = 1;
break;
}
do { if (job_control == 0 || interactive_shell == 0) reap_dead_jobs (); } while (0);
if (expresult == 0)
break;
do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0);
body_status = execute_command (arith_for_command->action);
do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0);
if (breaking)
{
breaking--;
break;
}
if (continuing)
{
continuing--;
if (continuing)
break;
}
line_number = arith_lineno;
expresult = eval_arith_for_expr (arith_for_command->step, &expok);
line_number = save_lineno;
if (expok == 0)
{
body_status = 1;
break;
}
}
loop_level--;
line_number = save_lineno;
return (body_status);
}
| long long execute_arith_for_command(struct_0 *a0, unsigned long a1, unsigned long a2, unsigned int a3, unsigned int a4, unsigned long long a5) {
char v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned long v4;
unsigned long long v6;
v1 = 0;
loop_level = loop_level + 1;
v2 = line_number;
if ((a0->field_0 & 8))
a0->field_20->field_4 = a0->field_20->field_4 | 8;
this_shell_function = "((";
v3 = a0->field_4;
line_number = v3;
if (variable_context && interactive_shell && !sourcelevel) {
line_number = line_number - (function_line_number - 1);
if (line_number <= 0)
line_number = 1;
}
v4 = eval_arith_for_expr(a0->field_8, &v0, &v0);
if (!*(&v0)) {
line_number = v2;
v6 = 1;
return v6;
}
do {
line_number = v3;
v4 = eval_arith_for_expr(a0->field_10, &v0, &v0);
line_number = v2;
if (!*(&v0)) {
v1 = 1;
loop_level = loop_level - 1;
line_number = v2;
v6 = v1;
return v6;
}
if (!job_control || !interactive_shell)
reap_dead_jobs();
if (!v4) {
loop_level = loop_level - 1;
line_number = v2;
v6 = v1;
return v6;
}
if (terminating_signal)
termsig_handler(terminating_signal);
if (interrupt_state)
throw_to_top_level();
v1 = execute_command(a0->field_20, &v0, &v0, a3, a4, a5);
if (terminating_signal)
termsig_handler(terminating_signal);
if (interrupt_state)
throw_to_top_level();
if (breaking) {
breaking = breaking - 1;
loop_level = loop_level - 1;
line_number = v2;
v6 = v1;
return v6;
}
if (!((continuing = continuing - 1, !continuing)))
goto LABEL_405352;
} while ((line_number = v3, v4 = eval_arith_for_expr(a0->field_18, &v0, &v0), line_number = v2, *(&v0)));
v1 = 1;
LABEL_405352:
loop_level = loop_level - 1;
line_number = v2;
v6 = v1;
return v6;
}
|
static __attribute__((unused)) inline int ERR_GET_LIB(unsigned long errcode)
{
if ((((errcode) & ((unsigned int)0x7fffffff + 1)) != 0))
return 2;
return (errcode >> 23L) & 0xFF;
}
| ulong ERR_GET_LIB(ulong param_1)
{
ulong uVar1;
if ((param_1 & 0x80000000) == 0) {
uVar1 = param_1 >> 0x17 & 0xff;
}
else {
uVar1 = 2;
}
return uVar1;
}
|
int
fn_complete(EditLine *el,
char *(*complete_func)(const char *, int),
char **(*attempted_completion_function)(const char *, int, int),
const wchar_t *word_break, const wchar_t *special_prefixes,
const char *(*app_func)(const char *), size_t query_items,
int *completion_type, int *over, int *point, int *end)
{
return fn_complete2(el, complete_func, attempted_completion_function,
word_break, special_prefixes, app_func, query_items,
completion_type, over, point, end,
attempted_completion_function ? 0 : 1U);
}
| void fn_complete(void* a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned int a5, unsigned int v0, unsigned int a6, unsigned int a7, unsigned int a8, unsigned int a9) {
unsigned long long v1;
v1 = fn_complete2(a0, a1, a2, a3, a4, a5, *(&v0), *(&a6), *(&a7), *(&a8), *(&a9), !a2);
return;
}
|
inline void ext2fs_unmark_valid(ext2_filsys fs)
{
fs->flags &= ~0x08;
}
| void ext2fs_unmark_valid(void)
{
halt_baddata();
}
|
static void
write_error (void)
{
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"write error\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, gettext ("write error")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, gettext ("write error")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
}
| int write_error()
{
char *v0;
int *v1;
v0 = gettext("write error");
v1 = _errno_location();
error(1, *v1, v0);
return xputchar(1);
}
|
static int mptcp_parse_opt(int argc, char **argv, struct nlmsghdr *n, int cmd)
{
_Bool
setting = cmd == MPTCP_PM_CMD_SET_FLAGS;
_Bool
adding = cmd == MPTCP_PM_CMD_ADD_ADDR;
_Bool
deling = cmd == MPTCP_PM_CMD_DEL_ADDR;
struct rtattr *attr_addr;
_Bool
addr_set =
0
;
inet_prefix address;
_Bool
id_set =
0
;
__u32 index = 0;
__u32 flags = 0;
__u16 port = 0;
__u8 id = 0;
ll_init_map(&rth);
while (argc > 0) {
if (get_flags(*argv, &flags) == 0) {
if (adding &&
(flags & (1 << 0)) &&
(flags & (1 << 3)))
invarg("flags mustn't have both signal and fullmesh", *argv);
if (setting &&
(flags & ~((1 << 2) |
(1 << 3))))
invarg("invalid flags, backup and fullmesh only", *argv);
} else if (matches(*argv, "id") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&id, *argv, 0))
invarg("invalid ID\n", *argv);
id_set =
1
;
} else if (matches(*argv, "dev") == 0) {
const char *ifname;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ifname = *argv;
if (check_ifname(ifname))
invarg("invalid interface name\n", ifname);
index = ll_name_to_index(ifname);
if (!index)
invarg("device does not exist\n", ifname);
} else if (matches(*argv, "port") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u16(&port, *argv, 0))
invarg("expected port", *argv);
} else if (get_addr(&address, *argv,
0
) == 0) {
addr_set =
1
;
} else {
invarg("unknown argument", *argv);
}
do { argv++; argc--; } while(0);
}
if (!addr_set && adding)
missarg("ADDRESS");
if (!id_set && deling) {
missarg("ID");
} else if (id_set && deling) {
if (id && addr_set)
invarg("invalid for non-zero id address\n", "ADDRESS");
else if (!id && !addr_set)
invarg("address is needed for deleting id 0 address\n", "ID");
}
if (adding && port && !(flags & (1 << 0)))
invarg("flags must have signal when using port", "port");
if (setting && id_set && port)
invarg("port can't be used with id", "port");
attr_addr = addattr_nest(n, 4096,
MPTCP_PM_ATTR_ADDR | (1 << 15));
if (id_set)
addattr8(n, 4096, MPTCP_PM_ADDR_ATTR_ID, id);
if (flags)
addattr32(n, 4096, MPTCP_PM_ADDR_ATTR_FLAGS, flags);
if (index)
addattr32(n, 4096, MPTCP_PM_ADDR_ATTR_IF_IDX, index);
if (port)
addattr16(n, 4096, MPTCP_PM_ADDR_ATTR_PORT, port);
if (addr_set) {
int type;
addattr16(n, 4096, MPTCP_PM_ADDR_ATTR_FAMILY,
address.family);
type = address.family ==
2
? MPTCP_PM_ADDR_ATTR_ADDR4 :
MPTCP_PM_ADDR_ATTR_ADDR6;
addattr_l(n, 4096, type, &address.data,
address.bytelen);
}
addattr_nest_end(n, attr_addr);
return 0;
}
| long mptcp_parse_opt(int a1, const char **a2, long a3, int a4)
{
unsigned int v4;
unsigned char v9;
char v10;
char v11;
bool v12;
bool v13;
bool v14;
unsigned short v15;
unsigned int v16;
unsigned int v17;
unsigned int v18;
long v19;
const char *v20;
char v21[2];
unsigned short v22;
unsigned short v23;
_QWORD v24[33];
v24[32] = __readfsqword(0x28u);
v12 = a4 == 7;
v13 = a4 == 1;
v14 = a4 == 2;
v10 = 0;
v11 = 0;
v17 = 0;
v16 = 0;
v15 = 0;
v9 = 0;
ll_init_map(&rth);
while ( a1 > 0 )
{
if ( !(unsigned int)get_flags(*a2, &v16) )
{
if ( v13 && (v16 & 1) != 0 && (v16 & 8) != 0 )
invarg("flags mustn't have both signal and fullmesh", *a2);
if ( !v12 || (v16 & 0xFFFFFFF3) == 0 )
goto LABEL_31;
invarg("invalid flags, backup and fullmesh only", *a2);
}
if ( (unsigned char)matches(*a2, "id") != 1 )
{
++a2;
if ( --a1 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v9, *a2, 0LL) )
invarg("invalid ID\n", *a2);
v11 = 1;
goto LABEL_31;
}
if ( (unsigned char)matches(*a2, "dev") != 1 )
{
++a2;
if ( --a1 <= 0 )
incomplete_command();
v20 = *a2;
if ( (unsigned int)check_ifname(v20) )
invarg("invalid interface name\n", v20);
v17 = ll_name_to_index(v20);
if ( v17 )
goto LABEL_31;
invarg("device does not exist\n", v20);
}
if ( (unsigned char)matches(*a2, "port") == 1 )
goto LABEL_28;
++a2;
if ( --a1 <= 0 )
incomplete_command();
if ( (unsigned int)get_u16(&v15, *a2, 0LL) )
{
invarg("expected port", *a2);
LABEL_28:
if ( (unsigned int)get_addr(v21, *a2, 0LL) )
invarg("unknown argument", *a2);
else
v10 = 1;
}
LABEL_31:
++a2;
--a1;
}
if ( v10 != 1 && v13 )
missarg("ADDRESS");
if ( v11 != 1 && v14 )
missarg("ID");
if ( v11 && v14 )
{
if ( v9 && v10 )
invarg("invalid for non-zero id address\n", "ADDRESS");
if ( !v9 && v10 != 1 )
invarg("address is needed for deleting id 0 address\n", "ID");
}
if ( v13 && v15 && (v16 & 1) == 0 )
invarg("flags must have signal when using port", "port");
if ( v12 && v11 && v15 )
invarg("port can't be used with id", "port");
v19 = addattr_nest(a3, 4096LL, 32769LL);
if ( v11 )
addattr8(a3, 4096LL, 2LL, v9);
if ( v16 )
addattr32(a3, 4096LL, 6LL, v16);
if ( v17 )
addattr32(a3, 4096LL, 7LL, v17);
if ( v15 )
addattr16(a3, 4096LL, 5LL, v15);
if ( v10 )
{
addattr16(a3, 4096LL, 1LL, v23);
if ( v23 == 2 )
v4 = 3;
else
v4 = 4;
v18 = v4;
addattr_l(a3, 4096LL, v4, v24, v22);
}
addattr_nest_end(a3, v19);
return 0LL;
}
|
static void
process_close(u_int32_t id)
{
int r, handle, ret, status = 4;
if ((r = get_handle(iqueue, &handle)) != 0)
sshfatal("sftp-server.c", __func__, 789, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse");
sshlog("sftp-server.c", __func__, 791, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "request %u: close handle %u", id, handle);
handle_log_close(handle,
((void *)0)
);
ret = handle_close(handle);
status = (ret == -1) ? errno_to_portable(
(*__errno_location ())
) : 0;
send_status(id, status);
}
| void process_close(uint param_1)
{
int iVar1;
undefined8 uVar2;
int *piVar3;
char **ppcVar4;
long in_FS_OFFSET;
char *pcStack72;
undefined8 uStack64;
undefined auStack56 [12];
uint local_2c;
uint local_20;
undefined4 local_1c;
int local_18;
int local_14;
long local_10;
ppcVar4 = (char **)auStack56;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_1c = 4;
uStack64 = 0x10212a;
local_2c = param_1;
local_18 = get_handle(iqueue,&local_20);
if (local_18 != 0) {
uStack64 = 0x10213d;
uVar2 = ssh_err(local_18);
ppcVar4 = &pcStack72;
pcStack72 = "parse";
sshfatal("sftp-server.c","process_close",0x315,1,1,uVar2);
}
*(ulong *)((long)ppcVar4 + -0x10) = (ulong)local_20;
*(ulong *)((long)ppcVar4 + -0x18) = (ulong)local_2c;
*(char **)((long)ppcVar4 + -0x20) = "request %u: close handle %u";
*(undefined8 *)((long)ppcVar4 + -0x28) = 0x1021b6;
sshlog("sftp-server.c","process_close",0x317,0,7,0);
*(undefined8 *)((long)ppcVar4 + -8) = 0x1021c9;
handle_log_close(local_20,0);
*(undefined8 *)((long)ppcVar4 + -8) = 0x1021d3;
local_14 = handle_close(local_20);
if (local_14 == -1) {
*(undefined8 *)((long)ppcVar4 + -8) = 0x1021e1;
piVar3 = __errno_location();
iVar1 = *piVar3;
*(undefined8 *)((long)ppcVar4 + -8) = 0x1021ea;
local_1c = errno_to_portable(iVar1);
}
else {
local_1c = 0;
}
*(undefined8 *)((long)ppcVar4 + -8) = 0x102203;
send_status(local_2c,local_1c);
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
*(undefined8 *)((long)ppcVar4 + -8) = 0x102218;
__stack_chk_fail();
}
return;
}
|
static void
who (char const *filename, int options)
{
size_t n_users;
STRUCT_UTMP *utmp_buf;
if (read_utmp (filename, &n_users, &utmp_buf, options) != 0)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", quotearg_n_style_colon (0, shell_escape_quoting_style, filename)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, filename)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, filename)), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
if (short_list)
list_entries_who (n_users, utmp_buf);
else
scan_entries (n_users, utmp_buf);
free (utmp_buf);
}
| void who(unsigned long long a0, unsigned long a1) {
char v0;
char v1;
char v2;
unsigned long long v4;
unsigned long long *v5;
unsigned long long v6;
if (!read_utmp(a0, &v0, &v1, a1)) {
if (!short_list)
scan_entries(*(&v0), *(&v1));
else
list_entries_who(*(&v0), *(&v1));
free(*(&v1));
v6 = *(&v2) ^ v5[5];
return;
}
v4 = quotearg_n_style_colon(0x0, 0x3, a0);
error(0x1, *(__errno_location()), "%s");
}
|
) {
resolved = malloc(
4096
);
if (resolved ==
((void *)0)
)
return (
((void *)0)
);
mem_allocated = 1;
} else
| void * malloc(size_t __size)
{
halt_baddata();
}
|
static int
make_ancestor (char const *dir, char const *component, void *options)
{
struct cp_options const *x = options;
if (x->set_security_context
&& defaultcon (x->set_security_context, component,
0040000
) < 0
&& ! ignorable_ctx_err (
(*__errno_location ())
))
error (0,
(*__errno_location ())
, gettext ("failed to set default creation context for %s"),
quotearg_style (shell_escape_always_quoting_style, dir));
int r = mkdir (component, (
(0400|0200|0100)
|
(0400 >> 3)
|
(0100 >> 3)
|
((0400 >> 3) >> 3)
|
((0100 >> 3) >> 3)
));
if (r == 0)
announce_mkdir (dir, options);
return r;
}
| int make_ancestor(undefined8 param_1,char *param_2,long param_3)
{
char cVar1;
int iVar2;
int *piVar3;
undefined8 uVar4;
undefined8 uVar5;
if (*(long *)(param_3 + 0x28) != 0) {
iVar2 = defaultcon(*(undefined8 *)(param_3 + 0x28),param_2,0x4000);
if (iVar2 < 0) {
piVar3 = __errno_location();
cVar1 = ignorable_ctx_err(*piVar3);
if (cVar1 != '\x01') {
uVar4 = quotearg_style(4,param_1);
uVar5 = gettext("failed to set default creation context for %s");
piVar3 = __errno_location();
error(0,*piVar3,uVar5,uVar4);
}
}
}
iVar2 = mkdir(param_2,0x1ed);
if (iVar2 == 0) {
announce_mkdir(param_1,param_3);
}
return iVar2;
}
|
static void send_mesg_to_tty (int tty_fd)
{
struct termios oldt, newt;
FILE *mesg_file, *tty_file;
_Bool
is_tty;
tty_file = fdopen (tty_fd, "w");
if (
((void *)0)
== tty_file) {
return;
}
is_tty = (tcgetattr(tty_fd, &oldt) == 0);
if (is_tty) {
newt = oldt;
newt.c_oflag |=
0000001
;
tcsetattr(tty_fd,
0
, &newt);
}
mesg_file = fopen ("/etc/logoutd.mesg", "r");
if (
((void *)0)
!= mesg_file) {
int c;
while ((c = getc (mesg_file)) !=
(-1)
) {
if (c == '\n') {
putc ('\r', tty_file);
}
putc (c, tty_file);
}
fclose (mesg_file);
} else {
fputs (gettext ("login time exceeded\n\n"), tty_file);
}
fflush (tty_file);
fclose (tty_file);
if (is_tty) {
tcsetattr(tty_fd,
0
, &oldt);
}
}
| unsigned long send_mesg_to_tty(int a1)
{
int v1;
char *v2;
bool v4;
int c;
FILE *stream;
FILE *v7;
struct termios termios_p;
struct termios v9;
unsigned long v10;
v10 = __readfsqword(0x28u);
stream = fdopen(a1, "w");
if ( stream )
{
v1 = tcgetattr(a1, &termios_p);
v4 = v1 == 0;
if ( !v1 )
{
v9.c_iflag = termios_p.c_iflag;
*(_QWORD *)&v9.c_cflag = *(_QWORD *)&termios_p.c_cflag;
*(_QWORD *)&v9.c_line = *(_QWORD *)&termios_p.c_line;
*(_QWORD *)&v9.c_cc[7] = *(_QWORD *)&termios_p.c_cc[7];
*(_QWORD *)&v9.c_cc[15] = *(_QWORD *)&termios_p.c_cc[15];
*(_QWORD *)&v9.c_cc[23] = *(_QWORD *)&termios_p.c_cc[23];
*(_QWORD *)&v9.c_cc[31] = *(_QWORD *)&termios_p.c_cc[31];
v9.c_ospeed = termios_p.c_ospeed;
v9.c_oflag = termios_p.c_oflag | 1;
tcsetattr(a1, 0, &v9);
}
v7 = fopen("/etc/logoutd.mesg", "r");
if ( v7 )
{
while ( 1 )
{
c = getc(v7);
if ( c == -1 )
break;
if ( c == 10 )
putc(13, stream);
putc(c, stream);
}
fclose(v7);
}
else
{
v2 = gettext("login time exceeded\n\n");
fputs(v2, stream);
}
fflush(stream);
fclose(stream);
if ( v4 )
tcsetattr(a1, 0, &termios_p);
}
return __readfsqword(0x28u) ^ v10;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.