input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
int
get_bits(gnutls_pk_algorithm_t key_type, int info_bits,
const char *info_sec_param, int warn)
{
int bits;
if (info_bits != 0) {
static int warned = 0;
if (warned == 0 && warn != 0 && (((unsigned int)(info_bits)) & 0x80000000)==0) {
warned = 1;
fprintf(
stderr
,
"** Note: You may use '--sec-param %s' instead of '--bits %d'\n",
bits_to_sp(key_type, info_bits), info_bits);
}
bits = info_bits;
} else {
if (info_sec_param == 0) {
info_sec_param = "HIGH";
}
bits =
gnutls_sec_param_to_pk_bits(key_type,
str_to_sec_param
(info_sec_param));
}
return bits;
}
| int get_bits(unsigned long a0, unsigned long a1, char *a2, unsigned long a3) {
unsigned long long v0;
unsigned int v1;
unsigned long long v3;
v0 = a2;
if (a1) {
if (!warned.12578 && a3 && a1 >= 0) {
warned.12578 = 1;
fprintf(stderr, "** Note: You may use '--sec-param %s' instead of '--bits %d'\n", bits_to_sp(a0, a1), a1);
}
v1 = a1;
} else {
if (!v0)
v0 = "HIGH";
v3 = str_to_sec_param(v0);
v1 = gnutls_sec_param_to_pk_bits(a0, v3, v3);
}
return v1;
}
|
int
get_job_spec (list)
WORD_LIST *list;
{
register char *word;
int job, jflags;
if (list == 0)
return (js.j_current);
word = list->word->word;
if (*word == '\0')
return (-1);
if (*word == '%')
word++;
if (((*word) >= '0' && (*word) <= '9') && all_digits (word))
{
job = atoi (word);
return ((job < 0 || job > js.j_jobslots) ? -1 : job - 1);
}
jflags = 0;
switch (*word)
{
case 0:
case '%':
case '+':
return (js.j_current);
case '-':
return (js.j_previous);
case '?':
jflags |= 0x02;
word++;
default:
return get_job_by_name (word, jflags);
}
}
| ulong get_job_spec(long param_1)
{
char cVar1;
int iVar2;
ulong uVar3;
char *__nptr;
undefined4 local_20;
if (param_1 == 0) {
uVar3 = (ulong)_signal_name;
}
else {
__nptr = **(char ***)(param_1 + 8);
if (*__nptr == '\0') {
uVar3 = 0xffffffff;
}
else {
if (*__nptr == '%') {
__nptr = __nptr + 1;
}
if ((('/' < *__nptr) && (*__nptr < ':')) && (iVar2 = all_digits(__nptr), iVar2 != 0)) {
iVar2 = atoi(__nptr);
if ((-1 < iVar2) && (iVar2 <= DAT_001031b4)) {
return (ulong)(iVar2 - 1);
}
return 0xffffffff;
}
local_20 = 0;
cVar1 = *__nptr;
if (cVar1 == '?') {
local_20 = 2;
__nptr = __nptr + 1;
}
else if (cVar1 < '@') {
if (cVar1 == '-') {
return (ulong)DAT_001031cc;
}
if ((cVar1 < '.') &&
((cVar1 == '+' || ((cVar1 < ',' && ((cVar1 == '\0' || (cVar1 == '%')))))))) {
return (ulong)_signal_name;
}
}
uVar3 = get_job_by_name(__nptr,local_20);
}
}
return uVar3;
}
|
static
_Bool
make_dir_parents_private (char const *const_dir, size_t src_offset,
int dst_dirfd,
char const *verbose_fmt_string,
struct dir_attr **attr_list,
_Bool
*new_dst,
const struct cp_options *x)
{
struct stat stats;
char *dir;
char *src;
char *dst_dir;
idx_t dirlen = dir_len (const_dir);
*attr_list =
((void *)0)
;
if (dirlen <= src_offset)
return
1
;
do { dir =
(__extension__ ({ const char *__old = (
const_dir
); size_t __len = strlen (__old) + 1; char *__new = (char *) __builtin_alloca (__len); (char *) memcpy (__new, __old, __len); }))
; } while (0);
src = dir + src_offset;
dst_dir = __builtin_alloca (dirlen + 1);
memcpy (dst_dir, dir, dirlen);
dst_dir[dirlen] = '\0';
char const *dst_reldir = dst_dir + src_offset;
while (*dst_reldir == '/')
dst_reldir++;
if (fstatat (dst_dirfd, dst_reldir, &stats, 0) != 0)
{
char *slash;
slash = src;
while (*slash == '/')
slash++;
dst_reldir = slash;
while ((slash = strchr (slash, '/')))
{
struct dir_attr *new;
_Bool
missing_dir;
*slash = '\0';
missing_dir = fstatat (dst_dirfd, dst_reldir, &stats, 0) != 0;
if (missing_dir || x->preserve_ownership || x->preserve_mode
|| x->preserve_timestamps)
{
struct stat src_st;
int src_errno = (stat (src, &src_st) != 0
?
(*__errno_location ())
:
((((
src_st.st_mode
)) & 0170000) == (0040000))
? 0
:
20
);
if (src_errno)
{
error (0, src_errno, gettext ("failed to get attributes of %s"),
quotearg_style (shell_escape_always_quoting_style, src));
return
0
;
}
new = xmalloc (sizeof *new);
new->st = src_st;
new->slash_offset = slash - dir;
new->restore_mode =
0
;
new->next = *attr_list;
*attr_list = new;
}
if (! set_process_security_ctx (src, dir,
missing_dir ? new->st.st_mode : 0,
missing_dir, x))
return
0
;
if (missing_dir)
{
mode_t src_mode;
mode_t omitted_permissions;
mode_t mkdir_mode;
*new_dst =
1
;
src_mode = new->st.st_mode;
omitted_permissions = (src_mode
& (x->preserve_ownership
?
((0400|0200|0100) >> 3)
|
(((0400|0200|0100) >> 3) >> 3)
: x->preserve_mode
?
(0200 >> 3)
|
((0200 >> 3) >> 3)
: 0));
mkdir_mode = x->explicit_no_preserve_mode ?
((0400|0200|0100) | ((0400|0200|0100) >> 3) | (((0400|0200|0100) >> 3) >> 3))
: src_mode;
mkdir_mode &= (
04000
|
02000
|
01000
|
(0400|0200|0100)
|
((0400|0200|0100) >> 3)
|
(((0400|0200|0100) >> 3) >> 3)
) & ~omitted_permissions;
if (mkdirat (dst_dirfd, dst_reldir, mkdir_mode) != 0)
{
error (0,
(*__errno_location ())
, gettext ("cannot make directory %s"),
quotearg_style (shell_escape_always_quoting_style, dir));
return
0
;
}
else
{
if (verbose_fmt_string !=
((void *)0)
)
printf (verbose_fmt_string, src, dir);
}
if (fstatat (dst_dirfd, dst_reldir, &stats,
0x100
))
{
error (0,
(*__errno_location ())
, gettext ("failed to get attributes of %s"),
quotearg_style (shell_escape_always_quoting_style, dir));
return
0
;
}
if (! x->preserve_mode)
{
if (omitted_permissions & ~stats.st_mode)
omitted_permissions &= ~ cached_umask ();
if (omitted_permissions & ~stats.st_mode
|| (stats.st_mode &
(0400|0200|0100)
) !=
(0400|0200|0100)
)
{
new->st.st_mode = stats.st_mode | omitted_permissions;
new->restore_mode =
1
;
}
}
mode_t accessible = stats.st_mode |
(0400|0200|0100)
;
if (stats.st_mode != accessible)
{
if (lchmodat (dst_dirfd, dst_reldir, accessible) != 0)
{
error (0,
(*__errno_location ())
, gettext ("setting permissions for %s"),
quotearg_style (shell_escape_always_quoting_style, dir));
return
0
;
}
}
}
else if (!
((((
stats.st_mode
)) & 0170000) == (0040000))
)
{
error (0, 0, gettext ("%s exists but is not a directory"),
quotearg_style (shell_escape_always_quoting_style, dir));
return
0
;
}
else
*new_dst =
0
;
if (! *new_dst
&& (x->set_security_context || x->preserve_security_context))
{
if (! set_file_security_ctx (dir,
0
, x)
&& x->require_preserve_context)
return
0
;
}
*slash++ = '/';
while (*slash == '/')
slash++;
}
}
else if (!
((((
stats.st_mode
)) & 0170000) == (0040000))
)
{
error (0, 0, gettext ("%s exists but is not a directory"), quotearg_style (shell_escape_always_quoting_style, dst_dir));
return
0
;
}
else
{
*new_dst =
0
;
}
return
1
;
}
| int make_dir_parents_private(void* a0, unsigned long a1, unsigned long a2, char *a3, unsigned long long *a4, char *a5, unsigned long long v39) {
char v0;
struct_0 *v1;
char v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
char *v8;
char *v9;
struct_1 *v10;
unsigned long long v11;
unsigned int v12;
unsigned long long v13;
void* v14;
char *v15;
unsigned long long 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;
char v36;
unsigned long long v37;
char v38;
unsigned long v40;
unsigned long long v41;
char *v42;
unsigned long long v43;
unsigned long long v44;
unsigned long long v45;
unsigned long long v46;
unsigned long long v47;
v1 = v39;
v11 = dir_len(a0);
*(a4) = 0;
if (a1 >= v11) {
v40 = 1;
} else {
for (*(&v12) = strlen(a0) + 1; &v38 != &(&v0)[-1 * ((0 CONCAT 15 + *(&v12) + 8) /m 16 * 16 & -0x1000)]; v37 = v37);
if ((((0 CONCAT 15 + *(&v12) + 8) /m 16 * 16) & 4095))
*((&v37 + (((0 CONCAT 15 + *(&v12) + 8) /m 16 * 16) & 4095))) = *((&v37 + (((0 CONCAT 15 + *(&v12) + 8) /m 16 * 16) & 4095)));
v13 = (&v39 >> 4) * 16;
v14 = memcpy(v13, a0, *(&v12));
for (v15 = a1 + v14; &v38 != &(&v38)[-1 * ((0 CONCAT 15 + v11 + 9) /m 16 * 16 & -0x1000)]; v37 = v37);
if ((((0 CONCAT 15 + v11 + 9) /m 16 * 16) & 4095))
*((&v37 + (((0 CONCAT 15 + v11 + 9) /m 16 * 16) & 4095))) = *((&v37 + (((0 CONCAT 15 + v11 + 9) /m 16 * 16) & 4095)));
v16 = (&v39 >> 4) * 16;
memcpy(v16, v14, v11);
*((v16 + v11)) = 0;
for (v8 = a1 + v16; *(v8) == 47; v8 += 1);
v40 = fstatat(a2, v8, &v17, 0x0);
if (v40) {
for (v9 = v15; *(v9) == 47; v9 += 1);
v8 = v9;
while (true) {
v40 = strchr(v9, 0x2f);
v9 = v40;
if (!v9)
break;
*(v9) = 0;
*(&v40) = fstatat(a2, v8, &v17, 0x0);
v2 = *(&v40);
if (v1->field_1e || v1->field_1f || v1->field_1d || v2) {
v40 = stat(v15, &v19);
if (v40) {
*(&v40) = *(__errno_location());
} else {
if ((*(&v22) & 0xf000) == 0x4000)
*(&v40) = 0;
else
*(&v40) = 20;
}
v4 = v40;
if (v4) {
v44 = quotearg_style(0x4, v15);
error(0x0, v4, gettext("failed to get attributes of %s"));
*(&v40) = 0;
break;
} else {
v10 = xmalloc(0xa8);
v10->field_0 = *(&v19);
v10->field_8 = *(&v20);
v10->field_10 = *(&v21);
*(&v10->field_18) = *(&v22);
v10->field_20 = *(&v23);
v10->field_28 = *(&v24);
v10->field_30 = *(&v25);
v10->field_38 = *(&v26);
v10->field_40 = *(&v27);
v10->field_48 = *(&v28);
v10->field_50 = *(&v29);
v10->field_58 = *(&v30);
v10->field_60 = *(&v31);
v10->field_68 = *(&v32);
v10->field_70 = *(&v33);
v10->field_78 = *(&v34);
v10->field_80 = *(&v35);
v10->field_88 = *(&v36);
v10->field_98 = v9 - v14;
v10->field_90 = 0;
v10->field_a0 = *(a4);
*(a4) = v10;
}
}
if (!v4 || !v1->field_1e && !v1->field_1f && !v1->field_1d && !v2) {
if (v2)
v40 = *(&v10->field_18);
else
v40 = 0;
*(&v40) = set_process_security_ctx(v15, v14, v40, v2, v1) ^ 1;
if (v40) {
*(&v40) = 0;
break;
} else {
if (v2) {
*(a5) = 1;
v5 = *(&v10->field_18);
if ((v1->field_1d ^ 1)) {
if (v1->field_1e)
*(&v40) = 18;
else
*(&v40) = 0;
} else {
*(&v40) = 63;
}
v3 = v40 & v5;
if (v1->field_20)
*(&v40) = 511;
else
*(&v40) = v5;
v6 = v40;
v6 = !(v3) & v6 & 4095;
v40 = mkdirat(a2, v8, v6, v8);
if (v40) {
v45 = quotearg_style(0x4, v14);
error(0x0, *(__errno_location()), gettext("cannot make directory %s"));
*(&v40) = 0;
break;
} else {
if (a3)
printf(a3);
v40 = fstatat(a2, v8, &v17, 0x100);
if (v40) {
v46 = quotearg_style(0x4, v14);
error(0x0, *(__errno_location()), gettext("failed to get attributes of %s"));
*(&v40) = 0;
break;
} else {
if ((v1->field_1e ^ 1)) {
if ((!(*(&v18)) & v3)) {
*(&v40) = !(cached_umask());
v3 &= v40;
}
if ((!(*(&v18)) & v3) || (*(&v18) & 448) != 448) {
*(&v10->field_18) = *(&v18) | v3;
v10->field_90 = 1;
}
}
v7 = *(&v18) | 448;
if (v7 != *(&v18)) {
v40 = lchmodat(a2, v8, v7, v8);
if (v40) {
v47 = quotearg_style(0x4, v14);
error(0x0, *(__errno_location()), gettext("setting permissions for %s"));
*(&v40) = 0;
break;
}
}
}
}
} else {
if ((*(&v18) & 0xf000) != 0x4000) {
v43 = quotearg_style(0x4, v14);
error(0x0, 0x0, gettext("%s exists but is not a directory"));
*(&v40) = 0;
break;
} else {
*(a5) = 0;
}
}
if ((!v40 || !v2) && (!v40 || !v2) && ((*(&v18) & 0xf000) == 0x4000 || v2) && (v7 == *(&v18) || !v40 || !v2)) {
if ((*(a5) ^ 1) && (v1->field_33 || v1->field_28)) {
*(&v40) = set_file_security_ctx(v14, 0x0, v1) ^ 1;
if (v40 && v1->field_34) {
*(&v40) = 0;
break;
}
}
if (!v40 || !v1->field_34 || !(*(a5) ^ 1) || !v1->field_33 && !v1->field_28) {
v42 = v9;
v9 += 1;
for (*(v42) = 47; *(v9) == 47; v9 += 1);
}
}
}
}
}
} else if ((*(&v18) & 0xf000) != 0x4000) {
v41 = quotearg_style(0x4, v16);
error(0x0, 0x0, gettext("%s exists but is not a directory"));
*(&v40) = 0;
} else {
*(a5) = 0;
}
if (...)
*(&v40) = 1;
}
return v40;
}
|
static int xfrm_str_to_policy(char *name, uint8_t *policy)
{
if (strcmp(name, "block") == 0) {
*policy = 1;
return 0;
} else if (strcmp(name, "accept") == 0) {
*policy = 2;
return 0;
}
return -1;
}
| long xfrm_str_to_policy(const char *a1, _BYTE *a2)
{
if ( !strcmp(a1, "block") )
{
*a2 = 1;
return 0LL;
}
else if ( !strcmp(a1, "accept") )
{
*a2 = 2;
return 0LL;
}
else
{
return 0xFFFFFFFFLL;
}
}
|
static inline void
emit_ancillary_info (char const *program)
{
struct infomap { char const *program; char const *node; } const infomap[] = {
{ "[", "test invocation" },
{ "coreutils", "Multi-call invocation" },
{ "sha224sum", "sha2 utilities" },
{ "sha256sum", "sha2 utilities" },
{ "sha384sum", "sha2 utilities" },
{ "sha512sum", "sha2 utilities" },
{
((void *)0)
,
((void *)0)
}
};
char const *node = program;
struct infomap const *map_prog = infomap;
while (map_prog->program && ! (strcmp (program, map_prog->program) == 0))
map_prog++;
if (map_prog->node)
node = map_prog->node;
printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https:
char const *lc_messages = setlocale (
5
,
((void *)0)
);
if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1))
{
fputs_unlocked (gettext ("Report any translation bugs to " "<https:
stdout
)
;
}
char const *url_program = (strcmp (program, "[") == 0) ? "test" : program;
printf (gettext ("Full documentation <%s%s>\n"),
"https:
printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"),
node, node == program ? " invocation" : "");
}
| void emit_ancillary_info(char *a0) {
unsigned long long v0;
unsigned long long v1[2];
char *v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
void* v16;
void* v17;
char v18;
unsigned long long v20;
unsigned long long *v21;
unsigned long long v22;
v4 = "[";
v5 = "test invocation";
v6 = "coreutils";
v7 = "Multi-call invocation";
v8 = "sha224sum";
v9 = "sha2 utilities";
v10 = "sha256sum";
v11 = "sha2 utilities";
v12 = "sha384sum";
v13 = "sha2 utilities";
v14 = "sha512sum";
v15 = "sha2 utilities";
v16 = 0;
v17 = 0;
v0 = a0;
v1[0] = &v4;
while (true) {
if (!v1[0])
break;
if (!strcmp(a0, v1[0]))
break;
v1[0] = v1 + 1;
}
if (v1[1])
v0 = v1[1];
printf(gettext("\n%s online help: <%s>\n"));
v2 = setlocale(0x5, NULL);
if (v2 && strncmp(v2, "en_", 0x3))
fputs_unlocked(gettext("Report any translation bugs to <https:
if (!strcmp(a0, "["))
v20 = "test";
else
v20 = a0;
v3 = v20;
printf(gettext("Full documentation <%s%s>\n"));
printf(gettext("or available locally via: info '(coreutils) %s%s'\n"));
v22 = *(&v18) ^ v21[5];
return;
}
|
static int
get_next (struct Spec_list *s, enum Upper_Lower_class *class)
{
struct List_element *p;
int return_val;
int i;
if (class)
*class = UL_NONE;
if (s->state == (
(18446744073709551615UL)
- 1))
{
s->tail = s->head->next;
s->state = ((
(18446744073709551615UL)
- 1) + 1);
}
p = s->tail;
if (p ==
((void *)0)
)
return -1;
switch (p->type)
{
case RE_NORMAL_CHAR:
return_val = p->u.normal_char;
s->state = ((
(18446744073709551615UL)
- 1) + 1);
s->tail = p->next;
break;
case RE_RANGE:
if (s->state == ((
(18446744073709551615UL)
- 1) + 1))
s->state = p->u.range.first_char;
else
++(s->state);
return_val = s->state;
if (s->state == p->u.range.last_char)
{
s->tail = p->next;
s->state = ((
(18446744073709551615UL)
- 1) + 1);
}
break;
case RE_CHAR_CLASS:
if (class)
{
switch (p->u.char_class)
{
case CC_LOWER:
*class = UL_LOWER;
break;
case CC_UPPER:
*class = UL_UPPER;
break;
default:
break;
}
}
if (s->state == ((
(18446744073709551615UL)
- 1) + 1))
{
for (i = 0; i < N_CHARS; i++)
if (is_char_class_member (p->u.char_class, i))
break;
((void) sizeof ((
i < N_CHARS
) ? 1 : 0), __extension__ ({ if (
i < N_CHARS
) ; else __assert_fail (
"i < N_CHARS"
, "src/tr.c", 1079, __extension__ __PRETTY_FUNCTION__); }))
;
s->state = i;
}
((void) sizeof ((
is_char_class_member (p->u.char_class, s->state)
) ? 1 : 0), __extension__ ({ if (
is_char_class_member (p->u.char_class, s->state)
) ; else __assert_fail (
"is_char_class_member (p->u.char_class, s->state)"
, "src/tr.c", 1082, __extension__ __PRETTY_FUNCTION__); }))
;
return_val = s->state;
for (i = s->state + 1; i < N_CHARS; i++)
if (is_char_class_member (p->u.char_class, i))
break;
if (i < N_CHARS)
s->state = i;
else
{
s->tail = p->next;
s->state = ((
(18446744073709551615UL)
- 1) + 1);
}
break;
case RE_EQUIV_CLASS:
return_val = p->u.equiv_code;
s->state = ((
(18446744073709551615UL)
- 1) + 1);
s->tail = p->next;
break;
case RE_REPEATED_CHAR:
if (p->u.repeated_char.repeat_count == 0)
{
s->tail = p->next;
s->state = ((
(18446744073709551615UL)
- 1) + 1);
return_val = get_next (s, class);
}
else
{
if (s->state == ((
(18446744073709551615UL)
- 1) + 1))
{
s->state = 0;
}
++(s->state);
return_val = p->u.repeated_char.the_repeated_char;
if (s->state == p->u.repeated_char.repeat_count)
{
s->tail = p->next;
s->state = ((
(18446744073709551615UL)
- 1) + 1);
}
}
break;
default:
abort ();
}
return return_val;
}
| int get_next(struct_0 *a0, unsigned int *a1) {
unsigned int v0;
unsigned int v1;
struct_2 *v2;
unsigned int v4;
if (a1)
*(a1) = 2;
if (a0->field_10 == -2) {
a0->field_8 = a0->field_0->field_8;
a0->field_10 = -1;
}
v2 = a0->field_8;
if (!v2) {
v4 = -1;
} else {
switch (v2->field_0) {
case 0:
v0 = v2->field_10;
a0->field_10 = -1;
a0->field_8 = v2->field_8;
break;
case 1:
if (a0->field_10 == -1)
a0->field_10 = v2->field_10;
else
a0->field_10 = a0->field_10 + 1;
v0 = a0->field_10;
if (a0->field_10 == v2->field_11) {
a0->field_8 = v2->field_8;
a0->field_10 = -1;
}
break;
case 2:
if (a1) {
if (*(&v2->field_10) == 6) {
*(a1) = 0;
} else if (*(&v2->field_10) == 10) {
*(a1) = 1;
}
}
if (a0->field_10 == -1) {
v1 = 0;
while (true) {
if (v1 > 255)
break;
if (is_char_class_member(*(&v2->field_10), v1))
break;
v1 += 1;
}
if (v1 > 255)
__assert_fail();
a0->field_10 = v1;
}
if (!is_char_class_member(*(&v2->field_10), a0->field_10))
__assert_fail();
v0 = a0->field_10;
v1 = a0->field_10 + 1;
while (true) {
if (v1 > 255)
break;
if (is_char_class_member(*(&v2->field_10), v1))
break;
v1 += 1;
}
if (v1 <= 255) {
a0->field_10 = v1;
break;
} else {
a0->field_8 = v2->field_8;
a0->field_10 = -1;
break;
}
case 3:
v0 = v2->field_10;
a0->field_10 = -1;
a0->field_8 = v2->field_8;
break;
case 4:
if (!v2->field_18) {
a0->field_8 = v2->field_8;
a0->field_10 = -1;
v0 = get_next(a0, a1);
} else {
if (a0->field_10 == -1)
a0->field_10 = 0;
a0->field_10 = a0->field_10 + 1;
v0 = v2->field_10;
if (a0->field_10 == v2->field_18) {
a0->field_8 = v2->field_8;
a0->field_10 = -1;
}
}
break;
default:
abort();
}
v4 = v0;
}
return v4;
}
|
static void print_namespace(struct rtattr *attrs[])
{
print_uint(PRINT_ANY, "namespace", "namespace %u",
rta_getattr_u16(attrs[IOAM6_ATTR_NS_ID]));
if (attrs[IOAM6_ATTR_SC_ID])
print_uint(PRINT_ANY, "schema", " [schema %u]",
rta_getattr_u32(attrs[IOAM6_ATTR_SC_ID]));
if (attrs[IOAM6_ATTR_NS_DATA])
print_hex(PRINT_ANY, "data", ", data %#010x",
rta_getattr_u32(attrs[IOAM6_ATTR_NS_DATA]));
if (attrs[IOAM6_ATTR_NS_DATA_WIDE])
print_0xhex(PRINT_ANY, "wide", ", wide %#018lx",
rta_getattr_u64(attrs[IOAM6_ATTR_NS_DATA_WIDE]));
print_nl();
}
| void print_namespace(unsigned long long a0[5]) {
unsigned long long v1;
print_uint(0x4, "namespace", "namespace %u", rta_getattr_u16(a0[1]));
if (a0[4])
print_uint(0x4, "schema", " [schema %u]", rta_getattr_u32(a0[4]));
if (a0[2])
print_hex(0x4, "data", ", data %#010x", rta_getattr_u32(a0[2]));
if (a0[3])
print_0xhex(0x4, "wide", ", wide %#018lx", rta_getattr_u64(a0[3]));
v1 = print_nl();
return;
}
|
static int dump_msg(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
if (!init_phase)
write_stamp(fp);
fwrite((void *)n, 1, ( ((n->nlmsg_len)+4U -1) & ~(4U -1) ), fp);
fflush(fp);
return 0;
}
| void dump_msg(unsigned long a0, unsigned int *a1, void* a2) {
unsigned long v0;
void* v2;
v0 = a0;
if (!init_phase)
write_stamp(a2);
fwrite(a1, 0x1, *(a1) + 3 & -0x4, a2);
fflush(a2);
v2 = 0;
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;
v0 = dcgettext(a0, a1, a3);
return (v0 == a1 ? v0 : a2);
}
|
static BitStream* bsOpenWriteStream ( FILE* stream )
{
BitStream *bs = malloc ( sizeof(BitStream) );
if (bs ==
((void *)0)
) mallocFail ( sizeof(BitStream) );
bs->handle = stream;
bs->buffer = 0;
bs->buffLive = 0;
bs->mode = 'w';
return bs;
}
| undefined8 * bsOpenWriteStream(undefined8 param_1)
{
undefined8 *puVar1;
puVar1 = (undefined8 *)malloc(0x18);
if (puVar1 == (undefined8 *)0x0) {
mallocFail(0x18);
}
*puVar1 = param_1;
*(undefined4 *)(puVar1 + 1) = 0;
*(undefined4 *)((long)puVar1 + 0xc) = 0;
*(undefined *)(puVar1 + 2) = 0x77;
return puVar1;
}
|
char *
de_backslash (string)
char *string;
{
register size_t slen;
register int i, j, prev_i;
mbstate_t state; memset (&state, '\0', sizeof (mbstate_t));
slen = strlen (string);
i = j = 0;
while (i < slen)
{
if (string[i] == '\\' && (string[i + 1] == '`' || string[i + 1] == '\\' ||
string[i + 1] == '$'))
i++;
prev_i = i;
do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0);
if (j < prev_i)
do string[j++] = string[prev_i++]; while (prev_i < i);
else
j = i;
}
string[j] = '\0';
return (string);
}
| void de_backslash(void* a0) {
int tmp_13;
int tmp_30;
unsigned int v0;
unsigned long long v1;
unsigned long long v2;
unsigned long long v3;
unsigned long long v5;
void* v6;
void* v7;
void* v8;
void* v10;
memset(&v2, 0x0, 0x8);
v5 = strlen(a0);
v6 = 0;
v7 = 0;
while (true) {
if (v5 <= v7)
break;
if (*((a0 + v7)) == 92) {
if (*((a0 + v7 + 1)) != 96 && *((a0 + v7 + 1)) != 92 && !(*((a0 + v7 + 1)) == 36))
goto LABEL_40450d;
v7 = v7 + 1;
}
LABEL_40450d:
v8 = v7;
if (locale_mb_cur_max <= 1) {
v7 = v7 + 1;
LABEL_4045e6:
if (v6 >= v8) {
v6 = v7;
} else {
do {
tmp_13 = v8;
v8 += 1;
tmp_30 = v6;
v6 += 1;
*(tmp_30 + a0) = *(tmp_13 + a0);
} while (v8 < v7);
}
} else {
v0 = is_basic(*((a0 + v7)));
if (v0) {
v1 = 1;
goto LABEL_4045ae;
}
if (locale_utf8locale && *((a0 + v7)) >= 0) {
v1 = *((a0 + v7));
goto LABEL_4045ae;
}
v3 = v2;
v1 = mbrlen(v7 + a0, v5 - v7, &v2, v7 + a0);
LABEL_4045ae:
if (v1 != -2 && v1 != -1) {
if (v1) {
v7 += v1;
goto LABEL_4045e6;
} else {
v7 = v7 + 1;
goto LABEL_4045e6;
}
}
v2 = v3;
v7 = v7 + 1;
goto LABEL_4045e6;
}
}
*((a0 + v6)) = 0;
v10 = a0;
return;
}
|
static int
exclude_options (void)
{
return (1 << 28) | (ignore_file_name_case ?
(1 << 4)
: 0);
}
| undefined8 exclude_options(void)
{
undefined8 uVar1;
if (ignore_file_name_case == '\0') {
uVar1 = 0x10000000;
}
else {
uVar1 = 0x10000010;
}
return uVar1;
}
|
static int
extract_symlink (char *file_name, int typeflag)
{
_Bool
interdir_made =
0
;
if (! absolute_names_option
&& (
(((
current_stat_info.link_name
)[0]) == '/')
|| contains_dot_dot (current_stat_info.link_name)))
return create_placeholder_file (file_name,
1
, &interdir_made,
((void *)0)
);
while (symlinkat (current_stat_info.link_name, chdir_fd, file_name) != 0)
switch (maybe_recoverable (file_name,
0
, &interdir_made))
{
case 1:
continue;
case 2:
return 0;
case 0:
symlink_error (current_stat_info.link_name, file_name);
return -1;
}
set_stat (file_name, ¤t_stat_info, -1, 0, 0,
'2',
0
,
0x100
);
return 0;
}
| long long extract_symlink(unsigned long a0, unsigned long a1) {
unsigned int v0;
char v1;
unsigned long long v3;
unsigned long long v4;
unsigned long long v6;
v0 = a1;
v1 = 0;
if ((absolute_names_option ^ 1)) {
if (*(free) != 47)
v3 = contains_dot_dot(free);
if (*(free) == 47 || v3)
v4 = create_placeholder_file(a0, 0x1, &v1, NULL);
}
if (!(absolute_names_option ^ 1) || !v3 && *(free) != 47) {
while (true) {
if (symlinkat(free, chdir_fd, a0, chdir_fd)) {
v6 = maybe_recoverable(a0, 0x0, &v1);
if (v6 != 2) {
if (v6 > 2)
continue;
if (!v6) {
symlink_error(free, a0, a0);
v4 = 4294967295;
break;
}
} else {
v4 = 0;
break;
}
} else {
set_stat(a0, ¤t_stat_info, 0xffffffff, 0x0, 0x0, 0x32, 0x0, 0x100);
v4 = 0;
break;
}
}
}
return v4;
}
|
static
_Bool
parse_wholename (const struct parser_table* entry, char **argv, int *arg_ptr)
{
return insert_path_check (entry, argv, arg_ptr, "wholename", pred_path);
}
| long long parse_wholename(unsigned long long a0, unsigned long long a1, unsigned long long a2) {
return insert_path_check(a0, a1, a2, "wholename", got.pred_path);
}
|
int
bitmap_set_bit(struct bitmap *b, u_int n)
{
int r;
size_t offset;
if ((r = reserve(b, n)) != 0)
return r;
offset = n / (sizeof(u_int) * 8);
if (offset > b->top)
b->top = offset;
b->d[offset] |= (u_int)1 << (n & ((u_int)(sizeof(u_int) * 8) - 1));
return 0;
}
| long long bitmap_set_bit(unsigned long long a0[3], unsigned long a1) {
unsigned int v0;
unsigned long long v1;
void* v3;
v0 = reserve(a0, a1);
if (v0) {
v3 = v0;
} else {
v1 = a1 >> 5;
if (v1 > a0[2])
a0[2] = v1;
*((a0[0] + v1 * 4)) = *((a0[0] + v1 * 4)) | (1 << ((a1 & 31) & 31));
v3 = 0;
}
return v3;
}
|
static const char *safe_strerror(int value)
{
const char *ret = gnutls_strerror(value);
if (ret ==
((void *)0)
)
ret = str_unknown;
return ret;
}
| void * safe_strerror(unsigned int a1)
{
long v2;
v2 = gnutls_strerror(a1);
if ( !v2 )
return &str_unknown;
return (void *)v2;
}
|
static intmax_t
expassign ()
{
register intmax_t value;
char *lhs, *rhs;
arrayind_t lind;
imaxdiv_t idiv;
value = expcond ();
if (curtok == '=' || curtok == 11)
{
int special, op;
intmax_t lvalue;
special = curtok == 11;
if (lasttok != 5)
evalerror (gettext("attempted assignment to non-variable"));
if (special)
{
op = assigntok;
lvalue = value;
}
if (tokstr == 0)
evalerror (gettext("syntax error in variable assignment"));
lhs = (char *)strcpy (sh_xmalloc((1 + strlen (tokstr)), "expr.c", 535), (tokstr));
lind = curlval.ind;
readtok ();
value = expassign ();
if (special)
{
if ((op == '/' || op == '%') && value == 0)
{
if (noeval == 0)
evalerror (gettext("division by 0"));
else
value = 1;
}
switch (op)
{
case '*':
lvalue *= value;
break;
case '/':
case '%':
if (lvalue ==
(-9223372036854775807L -1)
&& value == -1)
lvalue = (op == '/') ?
(-9223372036854775807L -1)
: 0;
else
{
idiv = imaxdiv (lvalue, value);
lvalue = (op == '/') ? idiv.quot : idiv.rem;
}
break;
case '+':
lvalue += value;
break;
case '-':
lvalue -= value;
break;
case 9:
lvalue <<= value;
break;
case 10:
lvalue >>= value;
break;
case '&':
lvalue &= value;
break;
case '|':
lvalue |= value;
break;
case '^':
lvalue ^= value;
break;
default:
sh_xfree((lhs), "expr.c", 593);
evalerror (gettext("bug: bad expassign token"));
break;
}
value = lvalue;
}
rhs = itos (value);
if (noeval == 0)
{
if (lind != -1)
expr_bind_array_element (lhs, lind, rhs);
else
expr_bind_variable (lhs, rhs);
}
if (curlval.tokstr && curlval.tokstr == tokstr)
init_lvalue (&curlval);
sh_xfree((rhs), "expr.c", 613);
sh_xfree((lhs), "expr.c", 614);
do { if (tokstr) sh_xfree((tokstr), "expr.c", 615); } while (0);
tokstr = (char *)
((void *)0)
;
}
return (value);
}
| int expassign(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3) {
unsigned int v0;
unsigned int v1;
unsigned long long v2;
char *v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
v10 = v2;
if (curtok != 61 && !(curtok == 11))
goto LABEL_401081;
v1 = curtok == 11;
if (lasttok != 5)
evalerror(gettext("attempted assignment to non-variable"));
if (v1) {
v0 = assigntok;
*(&v2) = expcond(a0, a1, a2, a3);
}
if (!tokstr)
evalerror(gettext("syntax error in variable assignment"));
v3 = strcpy(sh_xmalloc(strlen(tokstr) + 1, "expr.c", 0x217), tokstr);
v4 = g_402b98;
readtok(a0, a1, 0x217, a3, v11, v12);
v13 = expassign(a0, a1, 0x217, a3);
v10 = v13;
if (!v1) {
LABEL_400fab:
v5 = itos(v10);
if (!noeval) {
if (v4 == -1)
expr_bind_variable(v3, v5);
else
expr_bind_array_element(v3, v4, v5);
}
if (curlval && curlval == tokstr)
init_lvalue(&curlval);
sh_xfree(v5, "expr.c", 0x265, a3);
sh_xfree(v3, "expr.c", 0x266, a3);
if (tokstr)
sh_xfree(tokstr, "expr.c", 0x267, a3);
tokstr = 0;
LABEL_401081:
return v10;
}
if (v0 != 47 && !(v0 == 37))
goto LABEL_400e6f;
if (!v13) {
if (noeval)
v10 = 1;
else
evalerror(gettext("division by 0"));
}
LABEL_400e6f:
if (v0 == 124) {
v2 |= v10;
} else {
if (!(v0 <= 124))
goto LABEL_400f7a;
if (v0 > 47) {
if (!(v0 == 94))
goto LABEL_400f7a;
v2 ^= v10;
} else {
if (v0 < 9)
goto LABEL_400f7a;
switch (v0) {
case 9:
if ((v10 & 63))
v2 <<= v10 & 63;
else
v2 <<= v10 & 63;
break;
case 10:
if ((v10 & 63))
v2 >>= v10 & 63;
else
v2 >>= v10 & 63;
break;
case 37: case 47:
if (v2 == 0x8000000000000000 && v10 == -1) {
if (v0 == 47)
v14 = 0x8000000000000000;
else
v14 = 0;
v2 = v14;
break;
}
v6 = imaxdiv(v2, v10);
v7 = &g_402dbc;
if (v0 == 47)
v15 = v6;
else
v15 = v7;
v2 = v15;
break;
case 38:
v2 &= v10;
break;
case 42:
v2 = v10 * v2;
break;
case 43:
v2 += v10;
break;
case 45:
v2 -= v10;
break;
default:
LABEL_400f7a:
sh_xfree(v3, "expr.c", 0x251, a3);
evalerror(gettext("bug: bad expassign token"));
}
}
}
v10 = v2;
goto LABEL_400fab;
}
|
void
usage (int status)
{
if (status !=
0
)
do { fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
else
{
printf (gettext ("Usage: %s [OPTION]\n"), program_name);
fputs_unlocked (gettext ("Print the user's login name.\n\n"),
stdout
)
;
fputs_unlocked (gettext (" --help display this help and exit\n"),
stdout
);
fputs_unlocked (gettext (" --version output version information and exit\n"),
stdout
);
emit_ancillary_info ("logname");
}
exit (status);
}
| void usage(int param_1)
{
FILE *pFVar1;
undefined8 uVar2;
char *pcVar3;
uVar2 = program_name;
if (param_1 == 0) {
pcVar3 = (char *)gettext("Usage: %s [OPTION]\n");
printf(pcVar3,uVar2);
pFVar1 = stdout;
pcVar3 = (char *)gettext("Print the user\'s login name.\n\n");
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(" --help display this help and exit\n");
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(" --version output version information and exit\n");
fputs_unlocked(pcVar3,pFVar1);
emit_ancillary_info();
}
else {
pcVar3 = (char *)gettext("Try \'%s --help\' for more information.\n");
fprintf(stderr,pcVar3,uVar2);
}
exit(param_1);
}
|
static int
cert_option_list(struct sshauthopt *opts, struct sshbuf *oblob,
u_int which, int crit)
{
char *command, *allowed;
char *name =
((void *)0)
;
struct sshbuf *c =
((void *)0)
, *data =
((void *)0)
;
int r, ret = -1, found;
if ((c = sshbuf_fromb(oblob)) ==
((void *)0)
) {
sshlog("auth-options.c", __func__, 82, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "sshbuf_fromb failed");
goto out;
}
while (sshbuf_len(c) > 0) {
sshbuf_free(data);
data =
((void *)0)
;
if ((r = sshbuf_get_cstring(c, &name,
((void *)0)
)) != 0 ||
(r = sshbuf_froms(c, &data)) != 0) {
sshlog("auth-options.c", __func__, 91, 0, SYSLOG_LEVEL_ERROR, ssh_err(r), "Unable to parse certificate options");
goto out;
}
sshlog("auth-options.c", __func__, 94, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "found certificate option \"%.100s\" len %zu", name, sshbuf_len(data))
;
found = 0;
if ((which & 2) != 0) {
if (strcmp(name, "no-touch-required") == 0) {
opts->no_require_user_presence = 1;
found = 1;
} else if (strcmp(name, "permit-X11-forwarding") == 0) {
opts->permit_x11_forwarding_flag = 1;
found = 1;
} else if (strcmp(name,
"permit-agent-forwarding") == 0) {
opts->permit_agent_forwarding_flag = 1;
found = 1;
} else if (strcmp(name,
"permit-port-forwarding") == 0) {
opts->permit_port_forwarding_flag = 1;
found = 1;
} else if (strcmp(name, "permit-pty") == 0) {
opts->permit_pty_flag = 1;
found = 1;
} else if (strcmp(name, "permit-user-rc") == 0) {
opts->permit_user_rc = 1;
found = 1;
}
}
if (!found && (which & 1) != 0) {
if (strcmp(name, "verify-required") == 0) {
opts->require_verify = 1;
found = 1;
} else if (strcmp(name, "force-command") == 0) {
if ((r = sshbuf_get_cstring(data, &command,
((void *)0)
)) != 0) {
sshlog("auth-options.c", __func__, 127, 0, SYSLOG_LEVEL_ERROR, ssh_err(r), "Unable to parse \"%s\" " "section", name)
;
goto out;
}
if (opts->force_command !=
((void *)0)
) {
sshlog("auth-options.c", __func__, 132, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Certificate has multiple " "force-command options")
;
free(command);
goto out;
}
opts->force_command = command;
found = 1;
} else if (strcmp(name, "source-address") == 0) {
if ((r = sshbuf_get_cstring(data, &allowed,
((void *)0)
)) != 0) {
sshlog("auth-options.c", __func__, 142, 0, SYSLOG_LEVEL_ERROR, ssh_err(r), "Unable to parse \"%s\" " "section", name)
;
goto out;
}
if (opts->required_from_host_cert !=
((void *)0)
) {
sshlog("auth-options.c", __func__, 147, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Certificate has multiple " "source-address options")
;
free(allowed);
goto out;
}
if (addr_match_cidr_list(
((void *)0)
, allowed) == -1) {
sshlog("auth-options.c", __func__, 154, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Certificate source-address " "contents invalid")
;
goto out;
}
opts->required_from_host_cert = allowed;
found = 1;
}
}
if (!found) {
if (crit) {
sshlog("auth-options.c", __func__, 165, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Certificate critical option \"%s\" " "is not supported", name)
;
goto out;
} else {
sshlog("auth-options.c", __func__, 169, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Certificate extension \"%s\" " "is not supported", name)
;
}
} else if (sshbuf_len(data) != 0) {
sshlog("auth-options.c", __func__, 173, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Certificate option \"%s\" corrupt " "(extra data)", name)
;
goto out;
}
free(name);
name =
((void *)0)
;
}
ret = 0;
out:
free(name);
sshbuf_free(data);
sshbuf_free(c);
return ret;
}
| int cert_option_list(struct_1 *a0, unsigned long long a1, unsigned long a2, unsigned long a3) {
unsigned long long v0;
void* v1;
unsigned long long v2;
void* v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
char v7;
char v8;
void* v9;
void* v10;
void* v11;
unsigned long long v20;
unsigned long long v21;
unsigned long long v22;
unsigned long long v23;
unsigned long long v24;
v9 = 0;
v11 = 0;
v10 = 0;
v5 = -1;
v11 = sshbuf_fromb(a1);
if (!v11) {
v2 = "sshbuf_fromb failed";
sshlog("auth-options.c", "cert_option_list", 0x52, 0x1, 0x2, 0x0);
} else {
while (true) {
if (sshbuf_len(v11)) {
sshbuf_free(v10);
v10 = 0;
v4 = sshbuf_get_cstring(v11, &v9, 0x0, &v9);
if (!v4) {
v4 = sshbuf_froms(v11, &v10, &v10);
if (!v4) {
v2 = sshbuf_len(v10);
v1 = v9;
v0 = "found certificate option \"%.100s\" len %zu";
sshlog("auth-options.c", "cert_option_list", 0x5e, 0x0, 0x7, 0x0);
v6 = 0;
if ((a2 & 2)) {
if (!strcmp(v9, "no-touch-required")) {
a0->field_80 = 1;
v6 = 1;
} else if (!strcmp(v9, "permit-X11-forwarding")) {
*(&a0->padding_0[8]) = 1;
v6 = 1;
} else if (!strcmp(v9, "permit-agent-forwarding")) {
*(&a0->padding_0[4]) = 1;
v6 = 1;
} else if (!strcmp(v9, "permit-port-forwarding")) {
*(&a0->padding_0[0]) = 1;
v6 = 1;
} else if (!strcmp(v9, "permit-pty")) {
*(&a0->padding_0[12]) = 1;
v6 = 1;
} else if (!strcmp(v9, "permit-user-rc")) {
*(&a0->padding_0[16]) = 1;
v6 = 1;
}
}
if (!v6 && (a2 & 1)) {
v20 = strcmp(v9, "verify-required");
if (!v20) {
*(&a0[1].padding_0[0]) = 1;
v6 = 1;
} else {
v21 = strcmp(v9, "force-command");
if (!v21) {
v4 = sshbuf_get_cstring(v10, &v7, 0x0, &v7);
if (v4) {
v3 = v9;
v2 = "Unable to parse \"%s\" section";
sshlog("auth-options.c", "cert_option_list", 0x7f, 0x0, 0x2, ssh_err(v4));
break;
} else if (*(&a0->padding_0[56])) {
v2 = "Certificate has multiple force-command options";
sshlog("auth-options.c", "cert_option_list", 0x84, 0x0, 0x2, 0x0);
free(*(&v7));
break;
} else {
*(&a0->padding_0[56]) = *(&v7);
v6 = 1;
}
} else {
v22 = strcmp(v9, "source-address");
if (!v22) {
v4 = sshbuf_get_cstring(v10, &v8, 0x0, &v8);
if (v4) {
v3 = v9;
v2 = "Unable to parse \"%s\" section";
sshlog("auth-options.c", "cert_option_list", 0x8e, 0x0, 0x2, ssh_err(v4));
break;
} else if (*(&a0->padding_0[112])) {
v2 = "Certificate has multiple source-address options";
sshlog("auth-options.c", "cert_option_list", 0x93, 0x0, 0x2, 0x0);
free(*(&v8));
break;
} else {
v23 = addr_match_cidr_list(0x0, *(&v8));
if (v23 == -1) {
v2 = "Certificate source-address contents invalid";
sshlog("auth-options.c", "cert_option_list", 0x9a, 0x0, 0x2, 0x0);
break;
} else {
*(&a0->padding_0[112]) = *(&v8);
v6 = 1;
}
}
}
}
}
}
if (!*(&a0->padding_0[56]) && !v4 && !v21 && !v6 && (a2 & 1) && v20 || !v22 && !v6 && !*(&a0->padding_0[112]) && !v4 && (a2 & 1) && v21 && v20 && v23 != -1 || !v6 && (a2 & 1) && v21 && v20 && v22 || !v6 && !v20 && (a2 & 1) || !v6 && !(a2 & 1) || v6) {
if (v6) {
v24 = sshbuf_len(v10);
if (v24) {
v3 = v9;
v2 = "Certificate option \"%s\" corrupt (extra data)";
sshlog("auth-options.c", "cert_option_list", 0xad, 0x0, 0x2, 0x0);
break;
}
} else if (a3) {
v3 = v9;
v2 = "Certificate critical option \"%s\" is not supported";
sshlog("auth-options.c", "cert_option_list", 0xa5, 0x0, 0x2, 0x0);
break;
} else {
v3 = v9;
v2 = "Certificate extension \"%s\" is not supported";
sshlog("auth-options.c", "cert_option_list", 0xa9, 0x0, 0x3, 0x0);
}
if (!v6 && !a3 || !v24 && v6) {
free(v9);
v9 = 0;
continue;
}
}
}
}
if (v4 || v4) {
v2 = "Unable to parse certificate options";
sshlog("auth-options.c", "cert_option_list", 0x5b, 0x0, 0x2, ssh_err(v4));
break;
}
} else {
v5 = 0;
break;
}
}
}
free(v9);
sshbuf_free(v10);
sshbuf_free(v11);
return v5;
}
|
int copy(in, out)
int in, out;
{
int got;
(*__errno_location ())
= 0;
while (insize > inptr) {
write_buf(out, (char*)inbuf + inptr, insize - inptr);
got = read_buffer (in, (char *) inbuf, 0x40000);
if (got == -1)
read_error();
bytes_in += got;
insize = (unsigned)got;
inptr = 0;
}
return 0;
}
| long long copy(unsigned long a0, unsigned long a1) {
unsigned int v0;
*(__errno_location()) = 0;
while (true) {
if (insize <= inptr)
return 0;
write_buf(a1, inptr + &inbuf, insize - inptr);
v0 = read_buffer(a0, &inbuf, 0x40000);
if (v0 != -1) {
bytes_in = bytes_in + v0;
insize = v0;
inptr = 0;
} else {
read_error();
}
}
}
|
static
_Bool
parse_gid (const struct parser_table* entry, char **argv, int *arg_ptr)
{
struct predicate *p = insert_num (argv, arg_ptr, entry);
if (p)
{
p->est_success_rate = (p->args.numinfo.l_val < 100) ? 0.99 : 0.2;
return
1
;
}
else
{
--*arg_ptr;
return
0
;
}
}
| long long parse_gid(unsigned long long a0, unsigned long long a1, unsigned int *a2) {
unsigned int *v0;
struct_0 *v1;
unsigned long long v3;
v0 = a2;
v1 = insert_num(a1, a2, a0);
if (!v1) {
*(a2) = *(a2) - 1;
v3 = 0;
return v3;
}
v1->field_24 = (v1->field_40 <= 99 ? 4561245704505052365 : 4489188110487089316);
v3 = 1;
return v3;
}
|
void e2fsck_clear_inode(e2fsck_t ctx, ext2_ino_t ino,
struct ext2_inode *inode, int restart_flag,
const char *source)
{
inode->i_flags = 0;
inode->i_links_count = 0;
ext2fs_icount_store(ctx->inode_link_info, ino, 0);
inode->i_dtime = ctx->now;
if (ino < (((ctx->fs->super)->s_rev_level == 0) ? 11 : (ctx->fs->super)->s_first_ino))
memset(inode->i_block, 0, sizeof(inode->i_block));
ext2fs_unmark_inode_bitmap2(ctx->inode_dir_map, ino);
ext2fs_unmark_inode_bitmap2(ctx->inode_used_map, ino);
if (ctx->inode_reg_map)
ext2fs_unmark_inode_bitmap2(ctx->inode_reg_map, ino);
if (ctx->inode_bad_map)
ext2fs_unmark_inode_bitmap2(ctx->inode_bad_map, ino);
ctx->flags |= restart_flag;
if (ino == 1)
memset(inode, 0, sizeof(struct ext2_inode));
e2fsck_write_inode(ctx, ino, inode, source);
}
| void e2fsck_clear_inode(struct_0 *a0, unsigned long a1, struct_3 *a2, unsigned long a3, unsigned long long a4) {
unsigned int v1;
unsigned long long v2;
a2->field_20 = 0;
a2->field_1a = 0;
ext2fs_icount_store(a0->field_1c0, a1, 0x0, a1);
a2->field_14 = a0->field_348;
if (!a0->field_0->field_20->field_4c)
v1 = 11;
else
v1 = a0->field_0->field_20->field_54;
if (v1 > a1)
memset(&a2[1].padding_0[4], 0x0, 0x3c);
ext2fs_unmark_inode_bitmap2(a0->field_178, a1, a1);
ext2fs_unmark_inode_bitmap2(a0->field_168, a1, a1);
if (a0->field_190)
ext2fs_unmark_inode_bitmap2(a0->field_190, a1, a1);
if (a0->field_170)
ext2fs_unmark_inode_bitmap2(a0->field_170, a1, a1);
a0->field_48 = a0->field_48 | a3;
if (a1 == 1)
memset(a2, 0x0, 0x80);
v2 = e2fsck_write_inode(a0, a1, a2, a4);
return;
}
|
static int
history_next_string(HistoryW *h, HistEventW *ev, const wchar_t *str)
{
size_t len = wcslen(str);
int retval;
for (retval = (*(h)->h_curr)((h)->h_ref, ev); retval != -1; retval = (*(h)->h_prev)((h)->h_ref, ev))
if (wcsncmp(str, ev->str, len) == 0)
return 0;
{ ev->num = 9; ev->str = he_errlist[9]; };
return -1;
}
| int history_next_string(unsigned long long a0[7], struct_0 *a1, unsigned short *a2) {
unsigned int v0;
unsigned int v1;
unsigned int v3;
*(&v1) = wcslen(a2);
v0 = a0[6](a0[0], a1, a1, a0[6]);
while (true) {
if (v0 != -1) {
v3 = wcsncmp(a2, a1->field_8, *(&v1));
if (!v3) {
v3 = 0;
break;
} else {
v0 = a0[5](a0[0], a1, a1, a0[5]);
}
} else {
a1->field_0 = 9;
a1->field_8 = "e";
v3 = -1;
break;
}
}
return v3;
}
|
stderr
,
gettext ("%s: cannot open %s\n"),
Prog, sgr_dbname ());
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
4
, "cannot open %s", sgr_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
| void gettext(void)
{
halt_baddata();
}
|
void
_rl_vi_initialize_line (void)
{
register int i, n;
n = sizeof (vi_mark_chars) / sizeof (vi_mark_chars[0]);
for (i = 0; i < n; i++)
vi_mark_chars[i] = -1;
(rl_readline_state &= ~(0x0400000));
}
| long long _rl_vi_initialize_line() {
void* v1;
unsigned long long v2;
for (v1 = 0; v1 < 26; v1 = v1 + 1) {
*((0x4 * v1 + &vi_mark_chars)) = -1;
}
v2 = rl_readline_state & -4194305;
rl_readline_state = rl_readline_state & -4194305;
return v2;
}
|
SHELL_VAR *
find_variable_nameref_for_assignment (name, flags)
const char *name;
int flags;
{
SHELL_VAR *var;
var = find_variable_last_nameref (name, 1);
if (var && ((((var)->attributes) & (0x0000800))) && ((((var)->attributes) & (0x0001000))))
{
internal_warning (gettext("%s: removing nameref attribute"), name);
((var)->attributes &= ~(0x0000800));
}
if (var && ((((var)->attributes) & (0x0000800))))
{
if (valid_nameref_value (((var)->value), 1) == 0)
{
sh_invalidid (((var)->value) ? ((var)->value) : "");
return ((SHELL_VAR *)(void *)&nameref_invalid_value);
}
}
return (var);
}
| long long find_variable_nameref_for_assignment(unsigned long long a0, unsigned long a1) {
unsigned int v0;
int tmp_17;
unsigned long long v1;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
v0 = a1;
v1 = find_variable_last_nameref(a0, 0x1);
if (v1 && (*((v1 + 40)) & 0x800) && (*((v1 + 40)) & 0x1000)) {
internal_warning(gettext("%s: removing nameref attribute"), a0);
v3 = *((v1 + 40));
*(&v3) = (*((v1 + 40)) >> 8) & 247;
tmp_17 = v3;
*((v1 + 40)) = tmp_17;
}
if (v1 && (*((v1 + 40)) & 0x800)) {
v4 = valid_nameref_value(*((v1 + 8)), 0x1);
if (!v4) {
if (*((v1 + 8)))
v6 = *((v1 + 8));
else
v6 = &g_40bcf4;
sh_invalidid(v6);
v5 = &nameref_invalid_value;
}
}
if (!(*((v1 + 40)) & 0x800) || !v1 || v4)
v5 = v1;
return v5;
}
|
static void print_slave_oper_state(FILE *fp, const char *name, __u16 state)
{
open_json_array(PRINT_ANY, name);
print_string(PRINT_FP,
((void *)0)
, " <",
((void *)0)
);
if (state & 0x1) { state &= ~0x1; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "active"); };
if (state & 0x2) { state &= ~0x2; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "short_timeout"); };
if (state & 0x4) { state &= ~0x4; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "aggregating"); };
if (state & 0x8) { state &= ~0x8; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "in_sync"); };
if (state & 0x10) { state &= ~0x10; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "collecting"); };
if (state & 0x20) { state &= ~0x20; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "distributing"); };
if (state & 0x40) { state &= ~0x40; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "defaulted"); };
if (state & 0x80) { state &= ~0x80; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "expired"); };
close_json_array(PRINT_ANY, "> ");
}
| void print_slave_oper_state(undefined8 param_1,undefined8 param_2,ushort param_3)
{
undefined *puVar1;
ushort local_1c;
open_json_array(4,param_2);
print_string(1,0,&DAT_001009ad,0);
local_1c = param_3;
if ((param_3 & 1) != 0) {
local_1c = param_3 & 0xfffe;
if (local_1c == 0) {
puVar1 = &DAT_001009b4;
}
else {
puVar1 = &DAT_001009b0;
}
print_string(4,0,puVar1,"active");
}
if ((local_1c & 2) != 0) {
local_1c = local_1c & 0xfffd;
if (local_1c == 0) {
puVar1 = &DAT_001009b4;
}
else {
puVar1 = &DAT_001009b0;
}
print_string(4,0,puVar1,"short_timeout");
}
if ((local_1c & 4) != 0) {
local_1c = local_1c & 0xfffb;
if (local_1c == 0) {
puVar1 = &DAT_001009b4;
}
else {
puVar1 = &DAT_001009b0;
}
print_string(4,0,puVar1,"aggregating");
}
if ((local_1c & 8) != 0) {
local_1c = local_1c & 0xfff7;
if (local_1c == 0) {
puVar1 = &DAT_001009b4;
}
else {
puVar1 = &DAT_001009b0;
}
print_string(4,0,puVar1,"in_sync");
}
if ((local_1c & 0x10) != 0) {
local_1c = local_1c & 0xffef;
if (local_1c == 0) {
puVar1 = &DAT_001009b4;
}
else {
puVar1 = &DAT_001009b0;
}
print_string(4,0,puVar1,"collecting");
}
if ((local_1c & 0x20) != 0) {
local_1c = local_1c & 0xffdf;
if (local_1c == 0) {
puVar1 = &DAT_001009b4;
}
else {
puVar1 = &DAT_001009b0;
}
print_string(4,0,puVar1,"distributing");
}
if ((local_1c & 0x40) != 0) {
local_1c = local_1c & 0xffbf;
if (local_1c == 0) {
puVar1 = &DAT_001009b4;
}
else {
puVar1 = &DAT_001009b0;
}
print_string(4,0,puVar1,"defaulted");
}
if ((local_1c & 0x80) != 0) {
if ((local_1c & 0xff7f) == 0) {
puVar1 = &DAT_001009b4;
}
else {
puVar1 = &DAT_001009b0;
}
print_string(4,0,puVar1,"expired");
}
close_json_array(4,&DAT_00100a0a);
return;
}
|
ptrdiff_t
Pexecute (void *vcp, char const *buf, idx_t size, idx_t *match_size,
char const *start_ptr)
{
char const *p = start_ptr ? start_ptr : buf;
_Bool
bol = p[-1] == eolbyte;
char const *line_start = buf;
int e =
(-1)
;
char const *line_end;
struct pcre_comp *pc = vcp;
size_t
*sub =
pcre2_get_ovector_pointer_8
(pc->data);
char const *subject = buf;
do
{
line_end = rawmemchr (p, eolbyte);
if (
(18446744073709551615UL)
< line_end - p)
((!!sizeof (struct { _Static_assert (EXIT_TROUBLE, "verify_expr (" "EXIT_TROUBLE" ", " "(error (EXIT_TROUBLE, 0, gettext(\"exceeded PCRE's line length limit\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_TROUBLE, 0, gettext("exceeded PCRE's line length limit")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_TROUBLE, 0, gettext("exceeded PCRE's line length limit")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
for (;;)
{
while (localeinfo.sbclen[to_uchar (*p)] == -1)
{
p++;
subject = p;
bol =
0
;
}
idx_t search_offset = p - subject;
if (p == line_end)
{
sub[0] = sub[1] = search_offset;
e = pc->empty_match[bol];
break;
}
int options = 0;
if (!bol)
options |=
0x00000001u
;
e = jit_exec (pc, subject, line_end - subject,
search_offset, options);
if (!bad_utf8_from_pcre2 (e))
break;
idx_t valid_bytes =
pcre2_get_startchar_8
(pc->data);
if (search_offset <= valid_bytes)
{
if (valid_bytes == 0)
{
sub[0] = valid_bytes;
sub[1] = 0;
e = pc->empty_match[bol];
}
else
e = jit_exec (pc, subject, valid_bytes, search_offset,
options |
0x40000000u
|
0x00000002u
);
if (e !=
(-1)
)
break;
p = subject + valid_bytes + 1;
bol =
0
;
}
subject += valid_bytes + 1;
}
if (e !=
(-1)
)
break;
bol =
1
;
p = subject = line_start = line_end + 1;
}
while (p < buf + size);
if (e <= 0)
{
switch (e)
{
case
(-1)
:
break;
case
(-48)
:
((!!sizeof (struct { _Static_assert (EXIT_TROUBLE, "verify_expr (" "EXIT_TROUBLE" ", " "(error (EXIT_TROUBLE, 0, gettext(\"%s: memory exhausted\"), input_filename ()), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_TROUBLE, 0, gettext("%s: memory exhausted"), input_filename ()), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_TROUBLE, 0, gettext("%s: memory exhausted"), input_filename ()), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
case
(-46)
:
((!!sizeof (struct { _Static_assert (EXIT_TROUBLE, "verify_expr (" "EXIT_TROUBLE" ", " "(error (EXIT_TROUBLE, 0, gettext(\"%s: exhausted PCRE JIT stack\"), input_filename ()), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_TROUBLE, 0, gettext("%s: exhausted PCRE JIT stack"), input_filename ()), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_TROUBLE, 0, gettext("%s: exhausted PCRE JIT stack"), input_filename ()), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
case
(-47)
:
((!!sizeof (struct { _Static_assert (EXIT_TROUBLE, "verify_expr (" "EXIT_TROUBLE" ", " "(error (EXIT_TROUBLE, 0, gettext(\"%s: exceeded PCRE's backtracking limit\"), input_filename ()), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_TROUBLE, 0, gettext("%s: exceeded PCRE's backtracking limit"), input_filename ()), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_TROUBLE, 0, gettext("%s: exceeded PCRE's backtracking limit"), input_filename ()), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
case
(-53)
:
((!!sizeof (struct { _Static_assert (EXIT_TROUBLE, "verify_expr (" "EXIT_TROUBLE" ", " "(error (EXIT_TROUBLE, 0, gettext(\"%s: exceeded PCRE's nested backtracking limit\"), input_filename ()), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_TROUBLE, 0, gettext("%s: exceeded PCRE's nested backtracking limit"), input_filename ()), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_TROUBLE, 0, gettext("%s: exceeded PCRE's nested backtracking limit"), input_filename ()), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
case
(-52)
:
((!!sizeof (struct { _Static_assert (EXIT_TROUBLE, "verify_expr (" "EXIT_TROUBLE" ", " "(error (EXIT_TROUBLE, 0, gettext(\"%s: PCRE detected recurse loop\"), input_filename ()), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_TROUBLE, 0, gettext("%s: PCRE detected recurse loop"), input_filename ()), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_TROUBLE, 0, gettext("%s: PCRE detected recurse loop"), input_filename ()), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
case
(-63)
:
((!!sizeof (struct { _Static_assert (EXIT_TROUBLE, "verify_expr (" "EXIT_TROUBLE" ", " "(error (EXIT_TROUBLE, 0, gettext(\"%s: exceeded PCRE's heap limit\"), input_filename ()), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_TROUBLE, 0, gettext("%s: exceeded PCRE's heap limit"), input_filename ()), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_TROUBLE, 0, gettext("%s: exceeded PCRE's heap limit"), input_filename ()), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
default:
((!!sizeof (struct { _Static_assert (EXIT_TROUBLE, "verify_expr (" "EXIT_TROUBLE" ", " "(error (EXIT_TROUBLE, 0, gettext(\"%s: internal PCRE error: %d\"), input_filename (), e), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_TROUBLE, 0, gettext("%s: internal PCRE error: %d"), input_filename (), e), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_TROUBLE, 0, gettext("%s: internal PCRE error: %d"), input_filename (), e), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
return -1;
}
else
{
char const *matchbeg = subject + sub[0];
char const *matchend = subject + sub[1];
char const *beg;
char const *end;
if (start_ptr)
{
beg = matchbeg;
end = matchend;
}
else
{
beg = line_start;
end = line_end + 1;
}
*match_size = end - beg;
return beg - buf;
}
}
| long long Pexecute(struct_0 *a0, void* a1, unsigned long a2, unsigned long long *a3, unsigned long a4) {
char v0;
unsigned int v1;
unsigned int v2;
char *v3;
char *v4;
char *v5;
char *v6;
char *v7;
unsigned long long v8[2];
unsigned long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long v12;
unsigned long v13;
unsigned long long v16;
unsigned long long v17;
unsigned long long v18;
unsigned long long v19;
unsigned long long v20;
unsigned long long v21;
unsigned long long v22;
unsigned long long v23;
unsigned long long v24;
*(&v3) = (!a4 ? a4 : a1);
v0 = v3[1] == eolbyte;
v4 = a1;
v1 = -1;
v8[0] = pcre2_get_ovector_pointer_8(a0->field_18);
v5 = a1;
do {
v9 = rawmemchr(v3, eolbyte);
while (true) {
while (true) {
v16 = to_uchar(*(v3));
*(&v16) = *((v16 + 5242995));
if (v16 != 255)
break;
v3 += 1;
v5 = v3;
v0 = 0;
}
v10 = v3 - v5;
if (v3 == v9) {
v8[1] = v10;
v8[0] = v8[1];
v1 = (&a0->field_0)[v0 + 12];
break;
} else {
v2 = 0;
if ((v0 ^ 1))
v2 |= 1;
v1 = jit_exec(a0, v5, v9 + -0x1 * v5, v10, v2);
*(&v16) = bad_utf8_from_pcre2(v1) ^ 1;
if (v16)
break;
v11 = pcre2_get_startchar_8(a0->field_18);
if (v10 <= v11) {
if (!v11) {
v8[0] = v11;
v8[1] = 0;
v1 = (&a0->field_0)[v0 + 12];
} else {
v1 = jit_exec(a0, v5, v11, v10, v2 | 1073741826);
}
if (v1 != -1)
break;
v3 = &v5[1 + v11];
v0 = 0;
}
v5 = &v5[1 + v11];
}
}
if (!(v1 == -1) || !((v0 = 1, v4 = (v9 + 1), v5 = v4, v3 = v5, v3 < a1 + a2)))
break;
} while ((v0 = 1, v4 = (v9 + 1), v5 = v4, v3 = v5, v3 < a1 + a2));
if (v1 > 0) {
v12 = &v5[v8[0]];
v13 = &v5[v8[1]];
if (a4) {
v6 = v12;
v7 = v13;
} else {
v6 = v4;
v7 = v9 + 1;
}
*(a3) = v7 - v6;
v17 = v6 - a1;
return v17;
}
if (v1 > -46) {
if (!(v1 == -1))
goto LABEL_400b0b;
v17 = -1;
return v17;
}
if (v1 < -63)
goto LABEL_400b0b;
switch (v1) {
case -63:
v24 = input_filename();
error(0x2, 0x0, gettext("%s: exceeded PCRE's heap limit"));
case -53:
v19 = input_filename();
error(0x2, 0x0, gettext("%s: exceeded PCRE's nested backtracking limit"));
case -52:
v21 = input_filename();
error(0x2, 0x0, gettext("%s: PCRE detected recurse loop"));
case -48:
v23 = input_filename();
error(0x2, 0x0, gettext("%s: memory exhausted"));
case -47:
v22 = input_filename();
error(0x2, 0x0, gettext("%s: exceeded PCRE's backtracking limit"));
case -46:
v20 = input_filename();
error(0x2, 0x0, gettext("%s: exhausted PCRE JIT stack"));
default:
LABEL_400b0b:
v18 = input_filename();
error(0x2, 0x0, gettext("%s: internal PCRE error: %d"));
}
}
|
static void
free_dest_constraint_hop(struct dest_constraint_hop *dch)
{
u_int i;
if (dch ==
((void *)0)
)
return;
free(dch->user);
free(dch->hostname);
for (i = 0; i < dch->nkeys; i++)
sshkey_free(dch->keys[i]);
free(dch->keys);
free(dch->key_is_ca);
}
| void free_dest_constraint_hop(struct_0 *a0) {
unsigned int v0;
unsigned long long v2;
if (a0) {
free(a0->field_0);
free(a0->field_8);
for (v0 = 0; v0 < a0->field_14; v0 += 1) {
sshkey_free(*((a0->field_18 + v0 * 8)));
}
free(a0->field_18);
v2 = free(a0->field_20);
}
return;
}
|
static void print_tunsrc(struct rtattr *attrs[])
{
const char *dst
= rt_addr_n2a(
10
, 16,
((void*)(((char*)(attrs[SEG6_ATTR_DST])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))));
print_string(PRINT_ANY, "tunsrc",
"tunsrc addr %s\n", dst);
}
| void print_tunsrc(struct_0 *a0) {
unsigned long long v0;
unsigned long long v2;
v0 = rt_addr_n2a(0xa, 0x10, a0->field_8 + 4);
v2 = print_string(0x4, "tunsrc", "tunsrc addr %s\n", v0);
return;
}
|
void
internal_inform (const char *format, ...)
{
va_list args;
error_prolog (1);
fprintf (
stderr
, gettext("INFORM: "));
__builtin_va_start(
args
,
format
)
;
vfprintf (
stderr
, format, args);
fprintf (
stderr
, "\n");
__builtin_va_end(
args
)
;
}
| long long internal_inform() {
unsigned int v0;
unsigned int v1;
unsigned long v2;
unsigned long v3;
unsigned long v4;
char v5;
unsigned long v6;
unsigned long v7;
unsigned long v8;
unsigned long v9;
unsigned long v10;
int v11;
int v12;
int v13;
int v14;
int v15;
int v16;
int v17;
int v18;
unsigned long v19;
unsigned long v20;
unsigned long v21;
unsigned long v22;
unsigned long v23;
unsigned long v24;
char v25;
int v26;
int v27;
int v28;
int v29;
int v30;
int v31;
int v32;
int v33;
unsigned long long *v34;
char *v35;
v6 = v20;
v7 = v21;
v8 = v22;
v9 = v23;
v10 = v24;
if (v25) {
v11 = v26;
v12 = v27;
v13 = v28;
v14 = v29;
v15 = v30;
v16 = v31;
v17 = v32;
v18 = v33;
}
v4 = v34[5];
error_prolog(0x1);
fprintf(stderr, gettext("INFORM: "));
v0 = 8;
v1 = 48;
v2 = &v19;
v3 = &v5;
vfprintf(stderr, v35, &v0);
fprintf(stderr, "\n");
if ((v4 ^ v34[5]))
__stack_chk_fail();
return 0;
}
|
static
void console_init(void)
{
int fd;
int tried_devcons = 0;
int tried_vtmaster = 0;
char *s;
if ((s = getenv("CONSOLE")) !=
((void *)0)
)
console_dev = s;
else {
console_dev = "/dev/console";
tried_devcons++;
}
while ((fd = open(console_dev,
00
|
04000
)) < 0) {
if (!tried_devcons) {
tried_devcons++;
console_dev = "/dev/console";
continue;
}
if (!tried_vtmaster) {
tried_vtmaster++;
console_dev = "/dev/tty0";
continue;
}
break;
}
if (fd < 0)
console_dev = "/dev/null";
else
close(fd);
}
| int console_init()
{
const char *v0;
int v2;
int v3;
int fd;
char *v5;
v2 = 0;
v3 = 0;
v5 = getenv("CONSOLE");
if ( v5 )
{
console_dev = v5;
}
else
{
console_dev = "/dev/console";
v2 = 1;
}
while ( 1 )
{
fd = open(console_dev, 2048);
if ( fd >= 0 )
break;
if ( v2 )
{
if ( v3 )
break;
v3 = 1;
console_dev = "/dev/tty0";
}
else
{
v2 = 1;
console_dev = "/dev/console";
}
}
if ( fd >= 0 )
{
LODWORD(v0) = close(fd);
}
else
{
v0 = "/dev/null";
console_dev = "/dev/null";
}
return (int)v0;
}
|
static inline __u16 rta_getattr_u16(const struct rtattr *rta)
{
return *(__u16 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| long rta_getattr_u16(long a1)
{
return *(unsigned short *)(a1 + 4);
}
|
static void max_mtime(const char *dir_name, struct stat *max_st) {
DIR *dir;
struct dirent *dp;
struct stat st;
if (!(dir = opendir(dir_name))) {
max_st->
st_mtim.tv_sec
= 0;
return;
}
while (
((void *)0)
!= (dp = readdir(dir))) {
char tabname[
255
+ 1];
if ( not_a_crontab ( dp ) && strcmp(dp->d_name, ".cron.hostname") != 0)
continue;
if (!glue_strings(tabname, sizeof tabname, dir_name, dp->d_name, '/'))
continue;
if (stat(tabname, &st) < 0)
continue;
if (st.
st_mtim.tv_sec
> max_st->
st_mtim.tv_sec
)
max_st->
st_mtim.tv_sec
= st.
st_mtim.tv_sec
;
}
closedir(dir);
}
| void max_mtime(char *param_1,long param_2)
{
int iVar1;
DIR *__dirp;
dirent *pdVar2;
long in_FS_OFFSET;
stat local_1a8;
char local_118 [264];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
__dirp = opendir(param_1);
if (__dirp == (DIR *)0x0) {
*(undefined8 *)(param_2 + 0x58) = 0;
}
else {
while (pdVar2 = readdir(__dirp), pdVar2 != (dirent *)0x0) {
iVar1 = not_a_crontab(pdVar2);
if ((((iVar1 == 0) || (iVar1 = strcmp(pdVar2->d_name,".cron.hostname"), iVar1 == 0)) &&
(iVar1 = glue_strings(local_118,0x100,param_1,pdVar2->d_name,0x2f), iVar1 != 0)) &&
((iVar1 = stat(local_118,&local_1a8), -1 < iVar1 &&
(*(long *)(param_2 + 0x58) < local_1a8.st_mtim.tv_sec)))) {
*(__time_t *)(param_2 + 0x58) = local_1a8.st_mtim.tv_sec;
}
}
closedir(__dirp);
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
__stack_chk_fail();
}
|
static Session *
session_by_channel(int id)
{
int i;
for (i = 0; i < sessions_nalloc; i++) {
Session *s = &sessions[i];
if (s->used && s->chanid == id) {
sshlog("session.c", __func__, 1836, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "session_by_channel: session %d channel %d", i, id)
;
return s;
}
}
sshlog("session.c", __func__, 1841, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "session_by_channel: unknown channel %d", id);
session_dump();
return
((void *)0)
;
}
| int * session_by_channel(int param_1)
{
int *piVar1;
int local_14;
local_14 = 0;
while( true ) {
if (sessions_nalloc <= local_14) {
sshlog("session.c","session_by_channel",0x731,0,5,0,"session_by_channel: unknown channel %d",
param_1);
session_dump();
return (int *)0x0;
}
piVar1 = (int *)((long)local_14 * 0xe8 + sessions);
if ((*piVar1 != 0) && (param_1 == piVar1[0x2f])) break;
local_14 = __addvsi3(local_14,1);
}
sshlog("session.c","session_by_channel",0x72c,0,5,0,"session_by_channel: session %d channel %d",
local_14,param_1);
return piVar1;
}
|
static inline
_Bool
usable_st_size (struct stat const *sb)
{
return (
((((
sb->st_mode
)) & 0170000) == (0100000))
||
((((
sb->st_mode
)) & 0170000) == (0120000))
||
((
sb
)->st_mode - (
sb
)->st_mode)
||
0
);
}
| _BOOL8 usable_st_size(long a1)
{
return (*(_DWORD *)(a1 + 24) & 0xF000) == 0x8000 || (*(_DWORD *)(a1 + 24) & 0xF000) == 40960;
}
|
void BZ2_bzWriteClose64
( int* bzerror,
BZFILE* b,
int abandon,
unsigned int* nbytes_in_lo32,
unsigned int* nbytes_in_hi32,
unsigned int* nbytes_out_lo32,
unsigned int* nbytes_out_hi32 )
{
Int32 n, n2, ret;
bzFile* bzf = (bzFile*)b;
if (bzf ==
((void *)0)
)
{ { if (bzerror !=
((void *)0)
) *bzerror = 0; if (bzf !=
((void *)0)
) bzf->lastErr = 0; }; return; };
if (!(bzf->writing))
{ { if (bzerror !=
((void *)0)
) *bzerror = (-1); if (bzf !=
((void *)0)
) bzf->lastErr = (-1); }; return; };
if (ferror(bzf->handle))
{ { if (bzerror !=
((void *)0)
) *bzerror = (-6); if (bzf !=
((void *)0)
) bzf->lastErr = (-6); }; return; };
if (nbytes_in_lo32 !=
((void *)0)
) *nbytes_in_lo32 = 0;
if (nbytes_in_hi32 !=
((void *)0)
) *nbytes_in_hi32 = 0;
if (nbytes_out_lo32 !=
((void *)0)
) *nbytes_out_lo32 = 0;
if (nbytes_out_hi32 !=
((void *)0)
) *nbytes_out_hi32 = 0;
if ((!abandon) && bzf->lastErr == 0) {
while (((Bool)1)) {
bzf->strm.avail_out = 5000;
bzf->strm.next_out = bzf->buf;
ret = BZ2_bzCompress ( &(bzf->strm), 2 );
if (ret != 3 && ret != 4)
{ { if (bzerror !=
((void *)0)
) *bzerror = ret; if (bzf !=
((void *)0)
) bzf->lastErr = ret; }; return; };
if (bzf->strm.avail_out < 5000) {
n = 5000 - bzf->strm.avail_out;
n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
n, bzf->handle );
if (n != n2 || ferror(bzf->handle))
{ { if (bzerror !=
((void *)0)
) *bzerror = (-6); if (bzf !=
((void *)0)
) bzf->lastErr = (-6); }; return; };
}
if (ret == 4) break;
}
}
if ( !abandon && !ferror ( bzf->handle ) ) {
fflush ( bzf->handle );
if (ferror(bzf->handle))
{ { if (bzerror !=
((void *)0)
) *bzerror = (-6); if (bzf !=
((void *)0)
) bzf->lastErr = (-6); }; return; };
}
if (nbytes_in_lo32 !=
((void *)0)
)
*nbytes_in_lo32 = bzf->strm.total_in_lo32;
if (nbytes_in_hi32 !=
((void *)0)
)
*nbytes_in_hi32 = bzf->strm.total_in_hi32;
if (nbytes_out_lo32 !=
((void *)0)
)
*nbytes_out_lo32 = bzf->strm.total_out_lo32;
if (nbytes_out_hi32 !=
((void *)0)
)
*nbytes_out_hi32 = bzf->strm.total_out_hi32;
{ if (bzerror !=
((void *)0)
) *bzerror = 0; if (bzf !=
((void *)0)
) bzf->lastErr = 0; };
BZ2_bzCompressEnd ( &(bzf->strm) );
free ( bzf );
}
| void BZ2_bzWriteClose64(_DWORD *a1, FILE **a2, int a3, _DWORD *a4, _DWORD *a5, _DWORD *a6, _DWORD *a7)
{
int v11;
int v12;
if ( a2 )
{
if ( *((_BYTE *)a2 + 5012) )
{
if ( ferror(*a2) )
{
if ( a1 )
*a1 = -6;
*((_DWORD *)a2 + 1274) = -6;
}
else
{
if ( a4 )
*a4 = 0;
if ( a5 )
*a5 = 0;
if ( a6 )
*a6 = 0;
if ( a7 )
*a7 = 0;
if ( a3 || *((_DWORD *)a2 + 1274) )
{
LABEL_35:
if ( a3 || ferror(*a2) || (fflush(*a2), !ferror(*a2)) )
{
if ( a4 )
*a4 = *((_DWORD *)a2 + 1257);
if ( a5 )
*a5 = *((_DWORD *)a2 + 1258);
if ( a6 )
*a6 = *((_DWORD *)a2 + 1263);
if ( a7 )
*a7 = *((_DWORD *)a2 + 1264);
if ( a1 )
*a1 = 0;
*((_DWORD *)a2 + 1274) = 0;
BZ2_bzCompressEnd((long)(a2 + 627));
free(a2);
}
else
{
if ( a1 )
*a1 = -6;
*((_DWORD *)a2 + 1274) = -6;
}
}
else
{
while ( 1 )
{
*((_DWORD *)a2 + 1262) = 5000;
a2[630] = (FILE *)(a2 + 1);
v11 = BZ2_bzCompress((long)(a2 + 627), 2);
if ( v11 != 3 && v11 != 4 )
{
if ( a1 )
*a1 = v11;
*((_DWORD *)a2 + 1274) = v11;
return;
}
if ( *((_DWORD *)a2 + 1262) <= 0x1387u )
{
v12 = 5000 - *((_DWORD *)a2 + 1262);
if ( v12 != (unsigned int)fwrite(a2 + 1, 1uLL, v12, *a2) || ferror(*a2) )
break;
}
if ( v11 == 4 )
goto LABEL_35;
}
if ( a1 )
*a1 = -6;
*((_DWORD *)a2 + 1274) = -6;
}
}
}
else
{
if ( a1 )
*a1 = -1;
*((_DWORD *)a2 + 1274) = -1;
}
}
else if ( a1 )
{
*a1 = 0;
}
}
|
static
void my_re_exec(void)
{
CHILD *ch;
sigset_t mask, oldset;
pid_t pid;
char **env;
int fd;
if (strchr("S0123456",runlevel) ==
((void *)0)
)
return;
alarm(0);
sigfillset(&mask);
sigprocmask(
0
, &mask, &oldset);
if ((fd = make_pipe(11)) < 0) {
sigprocmask(
2
, &oldset,
((void *)0)
);
initlog(1, "Attempt to re-exec failed");
}
fail_cancel();
if (pipe_fd >= 0)
close(pipe_fd);
pipe_fd = -1;
((got_signals) &= ~(1 << (
17
)));
((got_signals) &= ~(1 << (
1
)));
((got_signals) &= ~(1 << (
10
)));
((got_signals) &= ~(1 << (
12
)));
for(ch = family; ch; ch = ch->next)
if (ch->flags & 64) {
;
ch->flags &= ~(2|64|32);
if (ch->process[0] != '+')
write_utmp_wtmp("", ch->id, ch->pid,
8
,
((void *)0)
);
}
if ((pid = fork()) == 0) {
send_state(fd);
exit(0);
}
env = init_buildenv(0);
execle(myname, myname, "--init",
((void *)0)
, env);
init_freeenv(env);
close(fd);
close(11);
sigprocmask(
2
, &oldset,
((void *)0)
);
initlog(1, "Attempt to re-exec failed");
}
| void my_re_exec(unsigned long a0, unsigned int a1, unsigned long a2, unsigned int a3, unsigned int a4, unsigned int a5) {
unsigned int v0;
int tmp_43;
int tmp_48;
unsigned int v1;
struct_0 *v2;
unsigned long long *v3;
char v4;
char v5;
char v6;
unsigned long long v8;
unsigned long v9;
unsigned long v10;
unsigned long long *v11;
unsigned long long v12;
v8 = strchr("S0123456", runlevel);
if (v8) {
alarm(0x0);
sigfillset(&v4);
sigprocmask(0x0, &v4, &v5);
v0 = make_pipe(0xb, &v4, &v5, a3, a4, a5);
if (v0 < 0) {
sigprocmask(0x2, &v5, NULL);
initlog(0x1, "Attempt to re-exec failed", 0x0, a3, a4, a5);
}
fail_cancel();
if (pipe_fd >= 0)
close(pipe_fd);
pipe_fd = -1;
oops_error = 955024200;
oops_error = 955024200;
v9 = 874961156424106824;
*(&v9) = 131;
tmp_43 = v9;
oops_error = tmp_43;
v10 = 874961156424106824;
*(&v10) = 131;
tmp_48 = v10;
oops_error = tmp_48;
for (v2 = family; v2; v2 = v2->field_c0) {
if ((v2->field_0 & 64)) {
v2->field_0 = v2->field_0 & -99;
if (v2->field_34 != 43)
write_utmp_wtmp(&g_407481, &v2->padding_c[16], v2->field_8, 0x8, 0x0);
}
}
v1 = fork();
if (!v1) {
send_state(v0);
exit(0x0);
}
v3 = init_buildenv(0x0, a1, a2, 0x8, 0x0, a5);
execle(myname, myname);
init_freeenv(v3);
close(v0);
close(0xb);
sigprocmask(0x2, &v5, NULL);
initlog(0x1, "Attempt to re-exec failed", 0x0, 0x8, 0x0, a5);
}
if (!v8 || v1) {
v12 = *(&v6) ^ v11[5];
return;
}
}
|
int do_ipila(int argc, char **argv)
{
if (argc < 1)
usage();
if (matches(*argv, "help") == 0)
usage();
if (genl_init_handle(&genl_rth, "ila", &genl_family))
exit(1);
if (matches(*argv, "add") == 0)
return do_add(argc-1, argv+1);
if (matches(*argv, "delete") == 0)
return do_del(argc-1, argv+1);
if (matches(*argv, "list") == 0)
return do_list(argc-1, argv+1);
fprintf(
stderr
, "Command \"%s\" is unknown, try \"ip ila help\".\n",
*argv);
exit(-1);
}
| void do_ipila(int param_1,undefined8 *param_2)
{
char cVar1;
int iVar2;
if (param_1 < 1) {
usage();
}
cVar1 = matches(*param_2,&DAT_00101300);
if (cVar1 != '\x01') {
usage();
}
iVar2 = genl_init_handle(genl_rth,&DAT_00101305,&genl_family);
if (iVar2 != 0) {
exit(1);
}
cVar1 = matches(*param_2,&DAT_00101309);
if (cVar1 == '\x01') {
cVar1 = matches(*param_2,"delete");
if (cVar1 == '\x01') {
cVar1 = matches(*param_2,&DAT_00101314);
if (cVar1 == '\x01') {
fprintf(stderr,"Command \"%s\" is unknown, try \"ip ila help\".\n",*param_2);
exit(-1);
}
do_list(param_1 + -1,param_2 + 1);
}
else {
do_del(param_1 + -1,param_2 + 1);
}
}
else {
do_add(param_1 + -1,param_2 + 1);
}
return;
}
|
static void explain(void)
{
print_explain(
stderr
);
}
| void explain() {
unsigned long long v1;
v1 = print_explain(stderr);
return;
}
|
int xasprintf(char **sp, const char *f, ...)
{
va_list ap;
int ret;
__builtin_va_start(
ap
,
f
)
;
ret = xvasprintf(sp, 0, f, ap);
__builtin_va_end(
ap
)
;
return ret;
}
| long long xasprintf() {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned long v3;
unsigned long v4;
unsigned long v5;
char v6;
unsigned long v7;
unsigned long v8;
unsigned long v9;
unsigned long v10;
int v11;
int v12;
int v13;
int v14;
int v15;
int v16;
int v17;
int v18;
unsigned long v19;
unsigned long v20;
unsigned long v21;
unsigned long v22;
unsigned long v23;
char v24;
int v25;
int v26;
int v27;
int v28;
int v29;
int v30;
int v31;
int v32;
unsigned long long *v33;
unsigned long long *v34;
char *v35;
v7 = v20;
v8 = v21;
v9 = v22;
v10 = v23;
if (v24) {
v11 = v25;
v12 = v26;
v13 = v27;
v14 = v28;
v15 = v29;
v16 = v30;
v17 = v31;
v18 = v32;
}
v5 = v33[5];
v1 = 16;
v2 = 48;
v3 = &v19;
v4 = &v6;
v0 = xvasprintf(v34, 0x0, v35, &v1);
if ((v5 ^ v33[5]))
__stack_chk_fail();
return v0;
}
|
int
pidfile_fileno(const struct pidfh *pfh)
{
if (pfh ==
((void *)0)
|| pfh->pf_fd == -1) {
(*__errno_location ())
=
22
;
return (-1);
}
return (pfh->pf_fd);
}
| long long pidfile_fileno(unsigned int *a0) {
unsigned long long v1;
if (!a0) {
LABEL_40078c:
*(__errno_location()) = 22;
v1 = 4294967295;
} else {
if (*(a0) == -1)
goto LABEL_40078c;
v1 = *(a0);
}
return v1;
}
|
int gzflush(file, flush)
gzFile file;
int flush;
{
gz_statep state;
if (file ==
((void *)0)
)
return (-2);
state = (gz_statep)file;
if (state->mode != 31153 || state->err != 0)
return (-2);
if (flush < 0 || flush > 4)
return (-2);
if (state->seek) {
state->seek = 0;
if (gz_zero(state, state->skip) == -1)
return state->err;
}
(void)gz_comp(state, flush);
return state->err;
}
| undefined4 gzflush(long param_1,int param_2)
{
int iVar1;
undefined4 uVar2;
if (param_1 == 0) {
uVar2 = 0xfffffffe;
}
else if ((*(int *)(param_1 + 0x18) == 0x79b1) && (*(int *)(param_1 + 0x74) == 0)) {
if ((param_2 < 0) || (4 < param_2)) {
uVar2 = 0xfffffffe;
}
else {
if (*(int *)(param_1 + 0x70) != 0) {
*(undefined4 *)(param_1 + 0x70) = 0;
iVar1 = gz_zero(param_1,*(undefined8 *)(param_1 + 0x68));
if (iVar1 == -1) {
return *(undefined4 *)(param_1 + 0x74);
}
}
gz_comp(param_1,param_2);
uVar2 = *(undefined4 *)(param_1 + 0x74);
}
}
else {
uVar2 = 0xfffffffe;
}
return uVar2;
}
|
get_stat_atime (struct stat const *st)
{
return ((st)->st_atim);
}
| void get_stat_atime(void)
{
halt_baddata();
}
|
int
wcsnwidth(pwcs, n, max)
const wchar_t *pwcs;
size_t n, max;
{
wchar_t wc, *ws;
int len, l;
len = 0;
ws = (wchar_t *)pwcs;
while (n-- > 0 && (wc = *ws++) != L'\0')
{
l = wcwidth (wc);
if (l < 0)
return (-1);
else if (l == max - len)
return (ws - pwcs);
else if (l > max - len)
return (--ws - pwcs);
len += l;
}
return (ws - pwcs);
}
| long long wcsnwidth(unsigned long a0, unsigned long long a1, unsigned long a2) {
unsigned long long v0;
int tmp_11;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int *v4;
unsigned long long v6;
unsigned long long v7;
v0 = a1;
v1 = 0;
v4 = a0;
while (true) {
v6 = v0;
v0 -= 1;
if (v6) {
tmp_11 = v4;
v4 += 1;
v2 = *(tmp_11);
if (v2) {
v3 = wcwidth(v2);
if (v3 < 0) {
v7 = 4294967295;
break;
} else if (v3 == a2 - v1) {
v7 = v4 + -1 * a0 >> 2;
break;
} else if (v3 > a2 - v1) {
v4 += 1;
v7 = v4 - a0 >> 2;
break;
} else {
v1 += v3;
continue;
}
}
}
if (!v2 || !v6) {
v7 = v4 + -1 * a0 >> 2;
break;
}
}
return v7;
}
|
void ll_rw_block(int rw, int op_flags __attribute__((unused)), int nr,
struct buffer_head *bhp[])
{
errcode_t retval;
struct buffer_head *bh;
for (; nr > 0; --nr) {
bh = *bhp++;
if (rw == 0 && !bh->b_uptodate) {
do { if ((3) <= (-1)) { printf ("" "(%s, %d): %s: ", "journal.c", 167, __FUNCTION__); printf ("reading block %llu/%p\n", bh->b_blocknr, (void *) bh); } } while (0)
;
retval = io_channel_read_blk64(bh->b_io,
bh->b_blocknr,
1, bh->b_data);
if (retval) {
com_err(bh->b_ctx->device_name, retval,
"while reading block %llu\n",
bh->b_blocknr);
bh->b_err = (int) retval;
continue;
}
bh->b_uptodate = 1;
} else if (rw == 1 && bh->b_dirty) {
do { if ((3) <= (-1)) { printf ("" "(%s, %d): %s: ", "journal.c", 181, __FUNCTION__); printf ("writing block %llu/%p\n", bh->b_blocknr, (void *) bh); } } while (0)
;
retval = io_channel_write_blk64(bh->b_io,
bh->b_blocknr,
1, bh->b_data);
if (retval) {
com_err(bh->b_ctx->device_name, retval,
"while writing block %llu\n",
bh->b_blocknr);
bh->b_err = (int) retval;
continue;
}
bh->b_dirty = 0;
bh->b_uptodate = 1;
} else {
do { if ((3) <= (-1)) { printf ("" "(%s, %d): %s: ", "journal.c", 197, __FUNCTION__); printf ("no-op %s for block %llu\n", rw == 0 ? "read" : "write", bh->b_blocknr); } } while (0)
;
}
}
}
| void ll_rw_block(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3) {
unsigned long long *v0;
int tmp_11;
unsigned int v1;
unsigned int v2;
struct_0 *v3;
unsigned long long v4;
struct_2 *v6;
unsigned long long v7;
unsigned long long v8;
struct_2 *v9;
struct_2 *v10;
struct_2 *v11;
struct_2 *v12;
v2 = a1;
v1 = a2;
v0 = a3;
while (true) {
if (v1 <= 0)
break;
tmp_11 = v0;
v0 += 1;
v6 = *(tmp_11);
v3 = *(tmp_11);
if (!a0) {
v7 = v3->field_18 & 2;
if (!(v3->field_18 & 2)) {
v4 = io_channel_read_blk64(v3->field_8, v3->field_20, 0x1, v3 + 1);
if (!v4) {
v9 = v3;
v3->field_18 = v3->field_18 | 2;
goto LABEL_400df3;
} else {
com_err(v3->field_0->field_18, v4, "while reading block %llu\n", v3->field_20);
v10 = v3;
v3->field_14 = v4;
goto LABEL_400df3;
}
}
}
if (a0 == 1) {
v8 = v3->field_18 & 1;
if ((v3->field_18 & 1)) {
v4 = io_channel_write_blk64(v3->field_8, v3->field_20, 0x1, v3 + 1);
if (!v4) {
v3->field_18 = v3->field_18 & 4294967294;
v11 = v3;
v3->field_18 = v3->field_18 | 2;
} else {
com_err(v3->field_0->field_18, v4, "while writing block %llu\n", v3->field_20);
v12 = v3;
v3->field_14 = v4;
}
}
}
LABEL_400df3:
v1 -= 1;
}
return;
}
|
int set_netnsid_from_name(const char *name, int nsid)
{
struct {
struct nlmsghdr n;
struct rtgenmsg g;
char buf[1024];
} req = {
.n.nlmsg_len = ((sizeof(struct rtgenmsg)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))),
.n.nlmsg_flags = 0x01,
.n.nlmsg_type = RTM_NEWNSID,
.g.rtgen_family =
0
,
};
int fd, err = 0;
netns_nsid_socket_init();
fd = netns_get_fd(name);
if (fd < 0)
return fd;
addattr32(&req.n, 1024, NETNSA_FD, fd);
addattr32(&req.n, 1024, NETNSA_NSID, nsid);
if (rtnl_talk(&rth, &req.n,
((void *)0)
) < 0)
err = -2;
close(fd);
return err;
}
| long set_netnsid_from_name(long a1, unsigned int a2)
{
unsigned int v3;
int fd;
int v5[262];
unsigned long v6;
v6 = __readfsqword(0x28u);
memset(v5, 0, 1044);
v5[0] = 17;
v5[1] = 65624;
v3 = 0;
netns_nsid_socket_init();
fd = netns_get_fd(a1);
if ( fd < 0 )
return (unsigned int)fd;
addattr32(v5, 1024LL, 3LL, (unsigned int)fd);
addattr32(v5, 1024LL, 1LL, a2);
if ( (int)rtnl_talk(&rth, v5, 0LL) < 0 )
v3 = -2;
close(fd);
return v3;
}
|
int set_latch_flags(int mask, int setflags, int clearflags)
{
struct latch_descr *ldesc;
ldesc = find_latch(mask);
if (!ldesc)
return -1;
ldesc->flags |= setflags;
ldesc->flags &= ~clearflags;
return 0;
}
| long long set_latch_flags(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned int v0;
struct_0 *v1;
unsigned long long v3;
v0 = a2;
v1 = find_latch(a0);
if (!v1) {
v3 = 4294967295;
} else {
v1->field_c = v1->field_c | a1;
v1->field_c = !(v0) & v1->field_c;
v3 = 0;
}
return v3;
}
|
static
void *imalloc(size_t size)
{
void *m;
while ((m = malloc(size)) ==
((void *)0)
) {
initlog((1|2), "out of memory");
do_msleep(5000);
}
memset(m, 0, size);
return m;
}
| void * imalloc(size_t param_1)
{
void *__s;
while( true ) {
__s = malloc(param_1);
if (__s != (void *)0x0) break;
initlog(3,"out of memory");
do_msleep(5000);
}
memset(__s,0,param_1);
return __s;
}
|
static int
get_space (FILE *f, int c)
{
while (
1
)
{
if (c == ' ')
in_column++;
else if (c == '\t')
{
tabs =
1
;
in_column = (in_column / 8 + 1) * 8;
}
else
return c;
c = getc_unlocked (f);
}
}
| int get_space(void* a0, unsigned long a1) {
unsigned int v0;
v0 = a1;
while (true) {
if (v0 == 32) {
in_column = in_column + 1;
} else {
if (v0 != 9)
break;
tabs = 1;
in_column = (((in_column < 0 ? in_column + 7 : in_column) >> 3) + 1) * 8;
}
v0 = getc_unlocked(a0);
}
return v0;
}
|
char *add_envopt(
int *argcp,
char ***argvp,
char const *envvar_name)
{
char *p;
char **oargv;
char **nargv;
int nargc = 0;
char *env_val;
env_val = getenv(envvar_name);
if (env_val ==
((void *)0)
) return
((void *)0)
;
env_val = xstrdup (env_val);
for (p = env_val; *p; nargc++ ) {
p += strspn(p, " \t");
if (*p == '\0') break;
p += strcspn(p, " \t");
if (*p) *p++ = '\0';
}
if (nargc == 0) {
free(env_val);
return
((void *)0)
;
}
*argcp = nargc + 1;
nargv = xcalloc (*argcp + 1, sizeof (char *));
oargv = *argvp;
*argvp = nargv;
*nargv++ = *oargv;
for (p = env_val; nargc > 0; nargc--) {
p += strspn(p, " \t");
*(nargv++) = p;
while (*p++) ;
}
*nargv =
((void *)0)
;
return env_val;
}
| long long add_envopt(unsigned int *a0, unsigned long long *a1, char *a2) {
unsigned int v0;
int tmp_34;
int tmp_9;
char *v1;
unsigned long long *v2;
void* v3;
unsigned long long *v4;
void* v6;
char *v7;
unsigned long long *v8;
v0 = 0;
v3 = getenv(a2);
if (!v3) {
v6 = 0;
} else {
v3 = xstrdup(v3);
v1 = v3;
while (true) {
if (!*(v1))
break;
v1 = &v1[strspn(v1, " \t")];
if (!*(v1))
break;
v1 = &v1[strcspn(v1, " \t")];
if (*(v1)) {
v7 = v1;
v1 += 1;
*(v7) = 0;
}
v0 += 1;
}
if (!v0) {
free(v3);
v6 = 0;
} else {
*(a0) = v0 + 1;
v2 = xcalloc(*(a0) + 1, 0x8, v0 + 1);
v4 = *(a1);
*(a1) = v2;
tmp_34 = v2;
v2 += 1;
*(tmp_34) = *(v4);
for (v1 = v3; v0 > 0; v0 -= 1) {
v1 = &v1[strspn(v1, " \t")];
v8 = v2;
v2 += 1;
*(v8) = v1;
do {
tmp_9 = v1;
v1 += 1;
*(&v8) = *(tmp_9);
} while (v8);
}
*(v2) = 0;
v6 = v3;
}
}
return v6;
}
|
static int
dsa_generate_private_key(u_int bits, DSA **dsap)
{
DSA *private;
int ret = -1;
if (dsap ==
((void *)0)
)
return -10;
if (bits != 1024)
return -56;
if ((private = DSA_new()) ==
((void *)0)
) {
ret = -2;
goto out;
}
*dsap =
((void *)0)
;
if (!DSA_generate_parameters_ex(private, bits,
((void *)0)
, 0,
((void *)0)
,
((void *)0)
,
((void *)0)
) || !DSA_generate_key(private)) {
ret = -22;
goto out;
}
*dsap = private;
private =
((void *)0)
;
ret = 0;
out:
DSA_free(private);
return ret;
}
| undefined4 dsa_generate_private_key(int param_1,DSA **param_2)
{
int iVar1;
undefined4 local_14;
DSA *local_10;
if (param_2 == (DSA **)0x0) {
return 0xfffffff6;
}
if (param_1 == 0x400) {
local_10 = DSA_new();
if (local_10 == (DSA *)0x0) {
local_14 = 0xfffffffe;
}
else {
*param_2 = (DSA *)0x0;
iVar1 = DSA_generate_parameters_ex
(local_10,0x400,(uchar *)0x0,0,(int *)0x0,(ulong *)0x0,(BN_GENCB *)0x0);
if ((iVar1 == 0) || (iVar1 = DSA_generate_key(local_10), iVar1 == 0)) {
local_14 = 0xffffffea;
}
else {
*param_2 = local_10;
local_10 = (DSA *)0x0;
local_14 = 0;
}
}
DSA_free(local_10);
return local_14;
}
return 0xffffffc8;
}
|
static void bad_time_notify (void)
{
(void) puts (gettext ("Invalid login time"));
(void) fflush (
stdout
);
}
| void bad_time_notify() {
unsigned long long v1;
puts(gettext("Invalid login time"));
v1 = fflush(stdout);
return;
}
|
static void
sparse_add_map (struct tar_stat_info *st, struct sp_array const *sp)
{
struct sp_array *sparse_map = st->sparse_map;
size_t avail = st->sparse_map_avail;
if (avail == st->sparse_map_size)
st->sparse_map = sparse_map =
x2nrealloc (sparse_map, &st->sparse_map_size, sizeof *sparse_map);
sparse_map[avail] = *sp;
st->sparse_map_avail = avail + 1;
}
| _QWORD * sparse_add_map(_QWORD *a1, _QWORD *a2)
{
_QWORD *v2;
long v3;
_QWORD *result;
long v5;
long v6;
v5 = a1[40];
v6 = a1[38];
if ( v6 == a1[39] )
{
v5 = x2nrealloc(v5, a1 + 39, 16LL);
a1[40] = v5;
}
v2 = (_QWORD *)(16 * v6 + v5);
v3 = a2[1];
*v2 = *a2;
v2[1] = v3;
result = a1;
a1[38] = v6 + 1;
return result;
}
|
static void print_nh_res_group(const struct nha_res_grp *res_grp)
{
struct timeval tv;
open_json_object("resilient_args");
print_uint(PRINT_ANY, "buckets", "buckets %u ", res_grp->buckets);
__jiffies_to_tv(&tv, res_grp->idle_timer);
print_tv(PRINT_ANY, "idle_timer", "idle_timer %g ", &tv);
__jiffies_to_tv(&tv, res_grp->unbalanced_timer);
print_tv(PRINT_ANY, "unbalanced_timer", "unbalanced_timer %g ", &tv);
__jiffies_to_tv(&tv, res_grp->unbalanced_time);
print_tv(PRINT_ANY, "unbalanced_time", "unbalanced_time %g ", &tv);
close_json_object();
}
| void print_nh_res_group(undefined2 *param_1)
{
long in_FS_OFFSET;
undefined local_28 [24];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
open_json_object("resilient_args");
print_uint(4,"buckets","buckets %u ",*param_1);
__jiffies_to_tv(local_28,*(undefined4 *)(param_1 + 2));
print_tv(4,"idle_timer","idle_timer %g ",local_28);
__jiffies_to_tv(local_28,*(undefined4 *)(param_1 + 4));
print_tv(4,"unbalanced_timer","unbalanced_timer %g ",local_28);
__jiffies_to_tv(local_28,*(undefined8 *)(param_1 + 8));
print_tv(4,"unbalanced_time","unbalanced_time %g ",local_28);
close_json_object();
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
const char *
directory_contents (struct directory *dir)
{
if (!dir)
return
((void *)0)
;
return dir->dump ? dir->dump->contents :
((void *)0)
;
}
| int directory_contents(struct_0 *a0) {
unsigned int v1;
if (!a0) {
v1 = 0;
} else if (a0->field_28) {
v1 = a0->field_28->field_0;
} else {
v1 = 0;
}
return v1;
}
|
WORD_LIST *
expand_word_leave_quoted (word, quoted)
WORD_DESC *word;
int quoted;
{
WORD_LIST *result;
expand_no_split_dollar_star = 1;
if (ifs_is_null)
word->flags |= (1 << 4);
word->flags |= (1 << 6);
result = call_expand_word_internal (word, quoted, 0, (int *)
((void *)0)
, (int *)
((void *)0)
);
expand_no_split_dollar_star = 0;
return result;
}
| long ** expand_word_leave_quoted(long a1, unsigned int a2)
{
long **result;
expand_no_split_dollar_star = 1;
if ( ifs_is_null )
*(_DWORD *)(a1 + 8) |= 0x10u;
*(_DWORD *)(a1 + 8) |= 0x40u;
result = call_expand_word_internal((_QWORD *)a1, a2, 0, 0LL, 0LL);
expand_no_split_dollar_star = 0;
return result;
}
|
const char *
get_history_event(const char *cmd, int *cindex, int qchar)
{
int idx, sign, sub, num, begin, ret;
size_t len;
char *pat;
const char *rptr;
HistEvent ev;
idx = *cindex;
if (cmd[idx++] != history_expansion_char)
return
((void *)0)
;
if (cmd[idx] == history_expansion_char || cmd[idx] == '\0') {
if (history(h, &ev, 3) != 0)
return
((void *)0)
;
*cindex = cmd[idx]? (idx + 1):idx;
return ev.str;
}
sign = 0;
if (cmd[idx] == '-') {
sign = 1;
idx++;
}
if ('0' <= cmd[idx] && cmd[idx] <= '9') {
HIST_ENTRY *he;
num = 0;
while (cmd[idx] && '0' <= cmd[idx] && cmd[idx] <= '9') {
num = num * 10 + cmd[idx] - '0';
idx++;
}
if (sign)
num = history_length - num + history_base;
if (!(he = history_get(num)))
return
((void *)0)
;
*cindex = idx;
return he->line;
}
sub = 0;
if (cmd[idx] == '?') {
sub = 1;
idx++;
}
begin = idx;
while (cmd[idx]) {
if (cmd[idx] == '\n')
break;
if (sub && cmd[idx] == '?')
break;
if (!sub && (cmd[idx] == ':' || cmd[idx] == ' '
|| cmd[idx] == '\t' || cmd[idx] == qchar))
break;
idx++;
}
len = (size_t)idx - (size_t)begin;
if (sub && cmd[idx] == '?')
idx++;
if (sub && len == 0 && last_search_pat && *last_search_pat)
pat = last_search_pat;
else if (len == 0)
return
((void *)0)
;
else {
if ((pat = calloc(len + 1, sizeof(*pat))) ==
((void *)0)
)
return
((void *)0)
;
(void)strlcpy(pat, cmd + begin, len + 1);
}
if (history(h, &ev, 8) != 0) {
if (pat != last_search_pat)
free(pat);
return
((void *)0)
;
}
num = ev.num;
if (sub) {
if (pat != last_search_pat) {
free(last_search_pat);
last_search_pat = pat;
}
ret = history_search(pat, -1);
} else
ret = history_search_prefix(pat, -1);
if (ret == -1) {
history(h, &ev, 3);
(void)fprintf(rl_outstream, "%s: Event not found\n", pat);
if (pat != last_search_pat)
free(pat);
return
((void *)0)
;
}
if (sub && len) {
free(last_search_match);
last_search_match = strdup(pat);
}
if (pat != last_search_pat)
free(pat);
if (history(h, &ev, 8) != 0)
return
((void *)0)
;
*cindex = idx;
rptr = ev.str;
(void)history(h, &ev, 7, num);
return rptr;
}
| int get_history_event(char *a0, unsigned int *a1, unsigned long long a2) {
unsigned int v0;
int tmp_66;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
void* v6;
unsigned long long *v7;
unsigned long v8;
unsigned long long v9;
char v10;
char v11;
unsigned int v13;
unsigned int v14;
v0 = *(a1);
tmp_66 = v0;
v0 += 1;
*(&a2) = a0[tmp_66];
if (a2 != *(got.history_expansion_char)) {
v13 = 0;
} else if (a0[v0] == *(got.history_expansion_char)) {
LABEL_400eb5:
if (history(*(&h), &v10, 0x3, &v10)) {
v13 = 0;
} else {
if (!a0[v0])
v14 = v0;
else
v14 = v0 + 1;
*(a1) = v14;
v13 = *(&v11);
}
} else {
if (!a0[v0])
goto LABEL_400eb5;
v1 = 0;
if (a0[v0] == 45) {
v1 = 1;
v0 += 1;
}
if (a0[v0] > 47 && a0[v0] <= 57) {
v3 = 0;
while (true) {
if (!a0[v0])
break;
if (a0[v0] <= 47)
break;
if (a0[v0] > 57)
break;
v3 = a0[v0] + ((v3 * 4) + v3) * 2 - 48;
v0 += 1;
}
if (v1)
v3 = *(got.history_base) + *(got.history_length) - v3;
v7 = history_get(v3);
if (!v7) {
v13 = 0;
goto LABEL_40138d;
} else {
*(a1) = v0;
v13 = *(v7);
goto LABEL_40138d;
}
}
v2 = 0;
if (a0[v0] == 63) {
v2 = 1;
v0 += 1;
}
v5 = v0;
while (true) {
if (!a0[v0])
break;
if (a0[v0] == 10)
break;
if (v2 && a0[v0] == 63)
break;
if (!v2) {
if (a0[v0] == 58)
break;
if (a0[v0] == 32)
break;
if (a0[v0] == 9)
break;
if (a2 == a0[v0])
break;
}
v0 += 1;
}
v8 = v0 - v5;
if (v2 && a0[v0] == 63)
v0 += 1;
if (v2 && !v8 && last_search_pat && *(last_search_pat)) {
v6 = last_search_pat;
goto LABEL_4011d4;
}
if (!v8) {
v13 = 0;
goto LABEL_40138d;
}
v6 = calloc(v8 + 1, 0x1);
if (!v6) {
v13 = 0;
goto LABEL_40138d;
} else {
strlcpy(v6, &a0[v5], v8 + 1, &a0[v5]);
}
LABEL_4011d4:
if (history(*(&h), &v10, 0x8, &v10)) {
if (v6 != last_search_pat)
free(v6);
v13 = 0;
} else {
v3 = *(&v10);
if (!v2) {
v4 = history_search_prefix(v6, 0xffffffff);
} else {
if (v6 != last_search_pat) {
free(last_search_pat);
last_search_pat = v6;
}
v4 = history_search(v6, 0xffffffff);
}
if (v4 == -1) {
history(*(&h), &v10, 0x3, &v10);
fprintf(*(got.rl_outstream), "%s: Event not found\n", v6);
if (v6 != last_search_pat)
free(v6);
v13 = 0;
} else {
if (v2 && v8) {
free(last_search_match);
last_search_match = strdup(v6);
}
if (v6 != last_search_pat)
free(v6);
if (history(*(&h), &v10, 0x8, &v10)) {
v13 = 0;
} else {
*(a1) = v0;
v9 = *(&v11);
history(*(&h), &v10, 0x7, v3);
v13 = v9;
}
}
}
}
LABEL_40138d:
return v13;
}
|
static void
dunlink_reclaim (struct deferred_unlink *p)
{
free (p->file_name);
p->next = dunlink_avail;
dunlink_avail = p;
}
| void ** dunlink_reclaim(void **a1)
{
void **result;
free(a1[2]);
*a1 = dunlink_avail;
result = a1;
dunlink_avail = a1;
return result;
}
|
static void init_block()
{
int n;
for (n = 0; n < (256 +1+29); n++) dyn_ltree[n].fc.freq = 0;
for (n = 0; n < 30; n++) dyn_dtree[n].fc.freq = 0;
for (n = 0; n < 19; n++) bl_tree[n].fc.freq = 0;
dyn_ltree[256].fc.freq = 1;
opt_len = static_len = 0L;
last_lit = last_dist = last_flags = 0;
flags = 0; flag_bit = 1;
}
| void init_block(void)
{
int local_c;
for (local_c = 0; local_c < 0x11e; local_c = local_c + 1) {
*(undefined2 *)(dyn_ltree + (long)local_c * 4) = 0;
}
for (local_c = 0; local_c < 0x1e; local_c = local_c + 1) {
*(undefined2 *)(dyn_dtree + (long)local_c * 4) = 0;
}
for (local_c = 0; local_c < 0x13; local_c = local_c + 1) {
*(undefined2 *)(bl_tree + (long)local_c * 4) = 0;
}
dyn_ltree._1024_2_ = 1;
last_lit = 0;
last_dist = 0;
last_flags = 0;
flags = 0;
flag_bit = 1;
opt_len = 0;
static_len = 0;
return;
}
|
static
_Bool
wipefile (char *name, char const *qname,
struct randint_source *s, struct Options const *flags)
{
_Bool
ok;
int fd;
fd = open_safer (name,
01
|
0400
|
0
);
if (fd < 0
&& (
(*__errno_location ())
==
13
&& flags->force)
&& chmod (name,
0200
) == 0)
fd = open_safer (name,
01
|
0400
|
0
);
if (fd < 0)
{
error (0,
(*__errno_location ())
, gettext ("%s: failed to open for writing"), qname);
return
0
;
}
ok = do_wipefd (fd, qname, s, flags);
if (close (fd) != 0)
{
error (0,
(*__errno_location ())
, gettext ("%s: failed to close"), qname);
ok =
0
;
}
if (ok && flags->remove_file)
ok = wipename (name, qname, flags);
return ok;
}
| long wipefile(const char *a1, const char *a2, long a3, long a4)
{
char *v4;
int *v5;
char *v7;
int *v8;
unsigned char v11;
int fd;
fd = open_safer(a1, 257LL);
if ( fd < 0 && *_errno_location() == 13 && *(_BYTE *)a4 && !chmod(a1, 0x80u) )
fd = open_safer(a1, 257LL);
if ( fd >= 0 )
{
v11 = do_wipefd(fd, (long)a2, a3, a4);
if ( close(fd) )
{
v7 = gettext("%s: failed to close");
v8 = _errno_location();
error(0, *v8, v7, a2);
v11 = 0;
}
if ( v11 )
{
if ( *(_DWORD *)(a4 + 24) )
return (unsigned char)wipename(a1, a2, a4);
}
return v11;
}
else
{
v4 = gettext("%s: failed to open for writing");
v5 = _errno_location();
error(0, *v5, v4, a2);
return 0LL;
}
}
|
do { v = bind_variable ("BASH_COMMAND", ((char *)
((void *)0)
), 0); v->dynamic_value = get_bash_command; v->assign_func = (sh_var_assign_func_t *)
((void *)0)
; } while (0);
| int bind_variable(unsigned long long a0, unsigned long long a1, unsigned long a2) {
struct_1 *v0;
struct_0 *v1;
struct_1 *v2;
unsigned long long v3;
unsigned long long v5;
if (!shell_variables)
create_variable_tables();
if (temporary_env && a1)
bind_tempenv_variable(a0, a1);
v2 = shell_variables;
while (true) {
if (!v2) {
v5 = bind_variable_internal(a0, a1, *((global_variables + 32)), 0x0, a2);
return v5;
}
if (!(!(v2->field_c & 4)) || !(!(v2->field_c & 8))) {
v1 = hash_lookup(a0, v2->field_20);
v0 = v2;
if (v1 && (v1->field_28 & 0x800)) {
v3 = find_variable_nameref_context(v1, v2, &v0);
switch (v3) {
case 0:
v3 = find_variable_last_nameref_context(v1, v2, &v0);
if (v3 && (v3->field_28 & 0x800))
goto LABEL_405aac;
if (v3 == 4241760) {
internal_warning(gettext("%s: circular name reference"), v1->field_0);
v5 = bind_global_variable(v1->field_0, a1, a2);
return v5;
}
v1 = v3;
break;
case 4241760:
internal_warning(gettext("%s: circular name reference"), v1->field_0);
v5 = bind_global_variable(v1->field_0, a1, a2);
return v5;
default:
v1 = v3;
break;
}
}
if (v1) {
v5 = bind_variable_internal(v1->field_0, a1, v0->field_20, 0x0, a2);
return v5;
}
}
v2 = v2->field_18;
}
LABEL_405aac:
if (!v3->field_8) {
v5 = bind_variable_internal(v3->field_0, a1, v0->field_20, 0x0, a2);
return v5;
} else if (valid_array_reference(v3->field_8, 0x0)) {
v5 = assign_array_element(v3->field_8, a1, a2, 0x0);
return v5;
} else {
v5 = bind_variable_internal(v3->field_8, a1, v0->field_20, 0x0, a2);
return v5;
}
}
|
cv_search(EditLine *el, int dir)
{
wchar_t ch;
wchar_t tmpbuf[((size_t)1024)];
ssize_t tmplen;
tmpbuf[0] = '.';
tmpbuf[1] = '*';
tmplen = 2;
el->el_search.patdir = dir;
tmplen = c_gets(el, &tmpbuf[2],
dir == 24 ? L"\n/" : L"\n?" );
if (tmplen == -1)
return 4;
tmplen += 2;
ch = tmpbuf[tmplen];
tmpbuf[tmplen] = '\0';
if (tmplen == 2) {
if (el->el_search.patlen == 0) {
re_refresh(el);
return 6;
}
if (el->el_search.patbuf[0] != '.' &&
el->el_search.patbuf[0] != '*') {
(void) wcsncpy(tmpbuf, el->el_search.patbuf,
sizeof(tmpbuf) / sizeof(*tmpbuf) - 1);
el->el_search.patbuf[0] = '.';
el->el_search.patbuf[1] = '*';
(void) wcsncpy(&el->el_search.patbuf[2], tmpbuf,
((size_t)1024) - 3);
el->el_search.patlen++;
el->el_search.patbuf[el->el_search.patlen++] = '.';
el->el_search.patbuf[el->el_search.patlen++] = '*';
el->el_search.patbuf[el->el_search.patlen] = '\0';
}
} else {
tmpbuf[tmplen++] = '.';
tmpbuf[tmplen++] = '*';
tmpbuf[tmplen] = '\0';
(void) wcsncpy(el->el_search.patbuf, tmpbuf, ((size_t)1024) - 1);
el->el_search.patlen = (size_t)tmplen;
}
el->el_state.lastcmd = (el_action_t) dir;
el->el_line.cursor = el->el_line.lastchar = el->el_line.buffer;
if ((dir == 24 ? ed_search_prev_history(el, 0) :
ed_search_next_history(el, 0)) == 6) {
re_refresh(el);
return 6;
}
if (ch == 0033) {
re_refresh(el);
return ed_newline(el, 0);
}
return 4;
}
| long long cv_search(struct_0 *a0, unsigned long a1) {
unsigned int v0;
int tmp_17;
int tmp_30;
int tmp_75;
int tmp_81;
int tmp_110;
struct_2 *v1;
unsigned int v2;
unsigned int *v3;
unsigned int v4;
unsigned int v5;
char v6;
char v7;
unsigned long long v9;
unsigned long long v10;
unsigned int v11[2];
v7 = *(&v7);
v1 = &a0->padding_0;
v0 = a1;
v4 = 46;
v5 = 42;
v3 = 2;
a0->field_4a8 = v0;
v9 = (v0 == 24 ? "\n" : "\n");
v3 = c_gets(a0, &v6, v9, a0);
if (v3 == -1) {
v10 = 4;
return v10;
}
v3 += 2;
v2 = *((&v4 + 0x4 * v3));
*((&v4 + 0x4 * v3)) = 0;
if (v3 != 2) {
tmp_17 = v3;
v3 = v3 + 1;
(&v4)[tmp_17] = 46;
tmp_30 = v3;
v3 = v3 + 1;
(&v4)[tmp_30] = 42;
*((&v4 + 0x4 * v3)) = 0;
wcsncpy(a0->field_498, &v4, 0x3ff);
a0->field_4a0 = v3;
} else if (a0->field_4a0) {
switch (a0->field_498->field_0) {
case 42: case 46:
break;
default:
wcsncpy(&v4, a0->field_498, 0x3ff);
a0->field_498->field_0 = 46;
a0->field_498->field_4 = 42;
wcsncpy(a0->field_498 + 1, &v4, 0x3fd);
a0->field_4a0 = a0->field_4a0 + 1;
tmp_75 = a0->field_498;
tmp_81 = a0->field_4a0;
a0->field_4a0 = a0->field_4a0 + 1;
*((tmp_81 * 4 + tmp_75)) = 46;
v11 = a0->field_498;
tmp_110 = a0->field_4a0;
a0->field_4a0 = a0->field_4a0 + 1;
v11[tmp_110] = 42;
(&a0->field_498->field_0)[a0->field_4a0] = 0;
break;
}
} else {
re_refresh(a0);
v10 = 6;
return v10;
}
a0->field_80 = v0;
a0->field_60 = a0->field_50;
a0->field_58 = a0->field_60;
*(&v9) = (v0 == 24 ? ed_search_next_history(a0, 0x0) == 6 : ed_search_prev_history(a0, 0x0) == 6);
if (v9) {
re_refresh(a0);
v10 = 6;
return v10;
} else if (v2 == 27) {
re_refresh(a0);
v10 = ed_newline(a0, 0x0);
return v10;
} else {
v10 = 4;
return v10;
}
}
|
static void
freenames(char **names, u_int nnames)
{
u_int i;
if (names ==
((void *)0)
)
return;
for (i = 0; i < nnames; i++)
free(names[i]);
free(names);
}
| void freenames(unsigned long long *a0, unsigned long a1) {
unsigned int v0;
unsigned long long v2;
if (a0) {
for (v0 = 0; v0 < a1; v0 += 1) {
free(a0[v0]);
}
v2 = free(a0);
}
return;
}
|
static inline int
is_basic (char c)
{
return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31))
& 1;
}
| int is_basic(unsigned long a0) {
return (*((4 * (a0 >> 5) + &is_basic_table)) >> (a0 & 31 & 31)) & 1;
}
|
void ea_refcount_intr_begin(ext2_refcount_t refcount)
{
refcount->cursor = 0;
}
| long long ea_refcount_intr_begin(struct_0 *a0) {
a0->field_10 = 0;
return a0;
}
|
static char *
extract_delimited_string (string, sindex, opener, alt_opener, closer, flags)
char *string;
int *sindex;
char *opener, *alt_opener, *closer;
int flags;
{
int i, c, si;
size_t slen;
char *t, *result;
int pass_character, nesting_level, in_comment;
int len_closer, len_opener, len_alt_opener;
mbstate_t state; memset (&state, '\0', sizeof (mbstate_t));
slen = strlen (string + *sindex) + *sindex;
len_opener = (((opener) && (opener)[0]) ? ((opener)[1] ? ((opener)[2] ? strlen(opener) : 2) : 1) : 0);
len_alt_opener = (((alt_opener) && (alt_opener)[0]) ? ((alt_opener)[1] ? ((alt_opener)[2] ? strlen(alt_opener) : 2) : 1) : 0);
len_closer = (((closer) && (closer)[0]) ? ((closer)[1] ? ((closer)[2] ? strlen(closer) : 2) : 1) : 0);
pass_character = in_comment = 0;
nesting_level = 1;
i = *sindex;
while (nesting_level)
{
c = string[i];
if (i > slen)
{
i = slen;
c = string[i = slen];
break;
}
if (c == 0)
break;
if (in_comment)
{
if (c == '\n')
in_comment = 0;
do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0);
continue;
}
if (pass_character)
{
pass_character = 0;
do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0);
continue;
}
if ((flags & 0x0008) && c == '#' && (i == 0 || string[i - 1] == '\n' || (sh_syntaxtab[(unsigned char)(string[i - 1])] & 0x2000)))
{
in_comment = 1;
do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0);
continue;
}
if (c == '\001' || c == '\\')
{
pass_character++;
i++;
continue;
}
if ((flags & 0x0008) && string[i] == '$' && string[i+1] == '(')
{
si = i + 2;
t = extract_command_subst (string, &si, flags|0x0001);
if (si >= slen) { i = slen; c = 0; break; } else;
i = si + 1;
continue;
}
if (((len_opener == 0) ? (1) : ((string + i)[0] == (opener)[0] && strncmp(string + i, opener, len_opener) == 0)))
{
si = i + len_opener;
t = extract_delimited_string (string, &si, opener, alt_opener, closer, flags|0x0001);
if (si >= slen) { i = slen; c = 0; break; } else;
i = si + 1;
continue;
}
if (len_alt_opener && ((len_alt_opener == 0) ? (1) : ((string + i)[0] == (alt_opener)[0] && strncmp(string + i, alt_opener, len_alt_opener) == 0)))
{
si = i + len_alt_opener;
t = extract_delimited_string (string, &si, alt_opener, alt_opener, closer, flags|0x0001);
if (si >= slen) { i = slen; c = 0; break; } else;
i = si + 1;
continue;
}
if (((len_closer == 0) ? (1) : ((string + i)[0] == (closer)[0] && strncmp(string + i, closer, len_closer) == 0)))
{
i += len_closer - 1;
nesting_level--;
if (nesting_level == 0)
break;
}
if (c == '`')
{
si = i + 1;
t = string_extract (string, &si, "`", flags|0x0001);
if (si >= slen) { i = slen; c = 0; break; } else;
i = si + 1;
continue;
}
if (c == '\'' || c == '"')
{
si = i + 1;
i = (c == '\'') ? skip_single_quoted (string, slen, si, 0)
: skip_double_quoted (string, slen, si, 0);
continue;
}
do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0);
}
if (c == 0 && nesting_level)
{
if (no_longjmp_on_fatal_error == 0)
{
last_command_exit_value = 1;
report_error (gettext("bad substitution: no closing `%s' in %s"), closer, string);
exp_jump_to_top_level (2);
}
else
{
*sindex = i;
return (char *)
((void *)0)
;
}
}
si = i - *sindex - len_closer + 1;
if (flags & 0x0001)
result = (char *)
((void *)0)
;
else
{
result = (char *)sh_xmalloc((1 + si), "subst.c", 1513);
strncpy (result, string + *sindex, si);
result[si] = '\0';
}
*sindex = i;
return (result);
}
| int extract_delimited_string(char *a0, unsigned int *a1, char a2[3], char a3[3], char a4[3], unsigned long long a5) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned int v8;
unsigned int v9;
unsigned int v10;
unsigned int v11;
unsigned int v12;
void* v13;
unsigned long long v14;
unsigned long long v15;
unsigned long long v16;
unsigned long long v17;
unsigned int v18;
unsigned long v19;
unsigned long long v20;
unsigned long long v21;
unsigned int v23;
unsigned long long v24;
memset(&v20, 0x0, 0x8);
v23 = strlen(&a0[*(a1)]) + *(a1);
v18 = v23;
if (a2 && a2[0]) {
if (!a2[1]) {
v23 = 1;
} else if (a2[2]) {
v23 = strlen(a2);
} else {
v23 = 2;
}
}
if (!a2[0] || !a2)
v23 = 0;
v6 = v23;
if (a3 && a3[0]) {
if (!a3[1]) {
v23 = 1;
} else if (a3[2]) {
v23 = strlen(a3);
} else {
v23 = 2;
}
}
if (!a3 || !a3[0])
v23 = 0;
v7 = v23;
if (a4 && a4[0]) {
if (!a4[1]) {
v23 = 1;
} else if (a4[2]) {
v23 = strlen(a4);
} else {
v23 = 2;
}
}
if (!a4 || !a4[0])
v23 = 0;
v8 = v23;
v5 = 0;
v3 = v5;
v4 = 1;
v1 = *(a1);
while (v4) {
v2 = a0[v1];
if (*(&v18) < v1) {
v1 = *(&v18);
v1 = *(&v18);
v2 = a0[v1];
break;
} else {
if (!v2)
break;
if (v2) {
if (v5) {
if (v2 == 10)
v5 = 0;
if (*(&locale_mb_cur_max) > 1) {
v12 = is_basic(a0[v1]);
if (v12) {
v14 = 1;
} else {
if (*(&locale_utf8locale) && a0[v1] >= 0)
v14 = a0[v1];
if (a0[v1] < 0 || !*(&locale_utf8locale)) {
v21 = v20;
v14 = mbrlen(&a0[v1], *(&v18) - v1, &v20, &a0[v1]);
}
}
if (v14 != -2 && v14 != -1) {
if (!v14) {
v1 += 1;
continue;
} else {
v1 += v14;
continue;
}
}
if (v14 == -1 || v14 == -2) {
v20 = v21;
v1 += 1;
}
} else {
v1 += 1;
}
} else if (v3) {
v3 = 0;
if (*(&locale_mb_cur_max) > 1) {
v11 = is_basic(a0[v1]);
if (v11) {
v15 = 1;
} else {
if (*(&locale_utf8locale) && a0[v1] >= 0)
v15 = a0[v1];
if (a0[v1] < 0 || !*(&locale_utf8locale)) {
v21 = v20;
v15 = mbrlen(&a0[v1], *(&v18) - v1, &v20, &a0[v1]);
}
}
if (v15 != -2 && v15 != -1) {
if (!v15) {
v1 += 1;
continue;
} else {
v1 += v15;
continue;
}
}
if (v15 == -1 || v15 == -2) {
v20 = v21;
v1 += 1;
}
} else {
v1 += 1;
}
} else {
if ((a5 & 8) && v2 == 35 && (a0[1 + v1] == 10 || !v1 || (sh_syntaxtab[a0[1 + v1]] & 0x2000))) {
v5 = 1;
if (*(&locale_mb_cur_max) > 1) {
v9 = is_basic(a0[v1]);
if (v9) {
v16 = 1;
} else {
if (*(&locale_utf8locale) && a0[v1] >= 0)
v16 = a0[v1];
if (a0[v1] < 0 || !*(&locale_utf8locale)) {
v21 = v20;
v16 = mbrlen(&a0[v1], *(&v18) - v1, &v20, &a0[v1]);
}
}
if (v16 != -2 && v16 != -1) {
if (!v16) {
v1 += 1;
continue;
} else {
v1 += v16;
continue;
}
}
if (v16 == -2 || v16 == -1) {
v20 = v21;
v1 += 1;
}
} else {
v1 += 1;
}
if (v16 == -1)
continue;
}
if (!(a5 & 8) || v2 != 35 || !(sh_syntaxtab[a0[1 + v1]] & 0x2000) && a0[1 + v1] != 10 && v1) {
if (v2 != 1 && v2 != 92) {
if ((a5 & 8) && a0[v1] == 36 && a0[1 + v1] == 40) {
v0 = v1 + 2;
v19 = extract_command_subst(a0, &v0, a5 | 1);
if (*(&v18) <= v0) {
v1 = *(&v18);
v2 = 0;
break;
} else {
v1 = v0 + 1;
continue;
}
}
if (!(a5 & 8) || a0[1 + v1] != 40 || a0[v1] != 36) {
if (v6) {
if (a0[v1] == a2[0])
v23 = strncmp(&a0[v1], a2, v6);
if (v23 || a0[v1] != a2[0]) {
if (v7 && a0[v1] == a3[0]) {
v23 = strncmp(&a0[v1], a3, v7);
if (!v23) {
v0 = v7 + v1;
v19 = extract_delimited_string(a0, &v0, a3, a3, a4, a5 | 1);
if (*(&v18) <= v0) {
v1 = *(&v18);
v2 = 0;
break;
} else {
v1 = v0 + 1;
continue;
}
}
}
if (!v7 || v23 || a0[v1] != a3[0]) {
if (v8 && a0[v1] == a4[0])
v23 = strncmp(&a0[v1], a4, v8);
if (!v8 || !v23 && a0[v1] == a4[0]) {
v1 += v8 - 1;
v4 -= 1;
if (!v4)
break;
}
if (v4) {
if (v2 == 96) {
v0 = v1 + 1;
v19 = string_extract(a0, &v0, "`", a5 | 1, a4, a5);
if (*(&v18) <= v0) {
v1 = *(&v18);
v2 = 0;
break;
} else {
v1 = v0 + 1;
continue;
}
} else {
if (v2 != 39 && v2 != 34) {
if (*(&locale_mb_cur_max) > 1) {
v10 = is_basic(a0[v1]);
if (v10) {
v17 = 1;
} else {
if (*(&locale_utf8locale) && a0[v1] >= 0)
v17 = a0[v1];
if (!*(&locale_utf8locale) || a0[v1] < 0) {
v21 = v20;
v17 = mbrlen(&a0[v1], *(&v18) - v1, &v20, &a0[v1]);
}
}
if (v17 != -2 && v17 != -1) {
if (!v17) {
v1 += 1;
continue;
} else {
v1 += v17;
continue;
}
}
if (v17 == -2 || v17 == -1) {
v20 = v21;
v1 += 1;
continue;
}
} else {
v1 += 1;
continue;
}
}
if (v2 == 34 || v2 == 39) {
v0 = v1 + 1;
if (v2 == 39)
v23 = skip_single_quoted(a0, *(&v18), v0, 0x0);
else
v23 = skip_double_quoted(a0, *(&v18), v0, 0x0);
v1 = v23;
continue;
}
}
}
}
}
}
if (!v6 || !v23 && a0[v1] == a2[0]) {
v0 = v6 + v1;
v19 = extract_delimited_string(a0, &v0, a2, a3, a4, a5 | 1);
if (*(&v18) <= v0) {
v1 = *(&v18);
v2 = 0;
break;
} else {
v1 = v0 + 1;
continue;
}
}
}
}
if (v2 == 92 || v2 == 1) {
v3 += 1;
v1 += 1;
}
}
}
}
}
}
if (!v2 && v4) {
if (!no_longjmp_on_fatal_error) {
last_command_exit_value = 1;
v24 = gettext("bad substitution: no closing `%s' in %s");
report_error(v24, a4, a0, v24);
exp_jump_to_top_level(0x2);
}
*(a1) = v1;
v23 = 0;
}
if (!v4 || v2) {
v0 = v1 - *(a1) - v8 + 1;
if ((a5 & 1)) {
v13 = 0;
} else {
v13 = sh_xmalloc(v0 + 1, "subst.c", 0x5e9);
strncpy(v13, &a0[*(a1)], v0);
*(v13 + v0) = 0;
}
*(a1) = v1;
v23 = v13;
}
if (!v4 || no_longjmp_on_fatal_error || v2)
return v23;
}
|
void canonicalize_host(char *hostname, char *service, unsigned service_size)
{
char *p;
if ((p = strchr(hostname, ':'))) {
unsigned char buf[64];
if (inet_pton(
10
, hostname, buf) == 1)
return;
*p = 0;
if (service && service_size)
snprintf(service, service_size, "%s", p+1);
} else
p = hostname + strlen(hostname);
if (p > hostname && p[-1] == '.')
p[-1] = 0;
}
| unsigned long canonicalize_host(char *a1, char *a2, unsigned int a3)
{
char *v5;
char buf[72];
unsigned long v7;
v7 = __readfsqword(0x28u);
v5 = strchr(a1, 58);
if ( v5 )
{
if ( inet_pton(10, a1, buf) == 1 )
return __readfsqword(0x28u) ^ v7;
*v5 = 0;
if ( a2 && a3 )
snprintf(a2, a3, "%s", v5 + 1);
}
else
{
v5 = &a1[strlen(a1)];
}
if ( v5 > a1 && *(v5 - 1) == 46 )
*(v5 - 1) = 0;
return __readfsqword(0x28u) ^ v7;
}
|
static void
get_input_size_and_time (void)
{
ifile_size = -1;
time_stamp.tv_nsec = -1;
if (
((((
istat.st_mode
)) & 0170000) == (0100000))
)
{
ifile_size = istat.st_size;
if (!no_time || list)
time_stamp = get_stat_mtime (&istat);
}
}
| void get_input_size_and_time(unsigned long a0, unsigned long a1, unsigned long long a2) {
unsigned long long v1;
unsigned long long v2;
bytes_out = -1;
g_400018 = -1;
v1 = g_404778 & 0xf000;
if ((g_404778 & 0xf000) == 0x8000) {
bytes_out = g_404790;
if (no_time)
v2 = list;
if (!no_time || list) {
*(&time_stamp) = get_stat_mtime(&istat);
g_400018 = a2;
}
}
return;
}
|
static int gre_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
struct ifinfomsg *ifi = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
struct {
struct nlmsghdr n;
struct ifinfomsg i;
} req = {
.n.nlmsg_len = ((sizeof(*ifi)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))),
.n.nlmsg_flags = 0x01,
.n.nlmsg_type = RTM_GETLINK,
.i.ifi_family = preferred_family,
.i.ifi_index = ifi->ifi_index,
};
struct nlmsghdr *answer;
struct rtattr *tb[(__IFLA_MAX - 1) + 1];
struct rtattr *linkinfo[(__IFLA_INFO_MAX - 1)+1];
struct rtattr *greinfo[(__IFLA_GRE_MAX - 1) + 1];
int len;
__u16 iflags = 0;
__u16 oflags = 0;
__be32 ikey = 0;
__be32 okey = 0;
inet_prefix saddr, daddr;
__u8 pmtudisc = 1;
__u8 ignore_df = 0;
__u8 tos = 0;
__u8 ttl = 0;
__u32 link = 0;
__u16 encaptype = 0;
__u16 encapflags = 0;
__u16 encapsport = 0;
__u16 encapdport = 0;
__u8 metadata = 0;
__u32 fwmark = 0;
_Bool
is_erspan = gre_is_erspan(lu);
__u32 erspan_idx = 0;
__u8 erspan_ver = 1;
__u8 erspan_dir = 0;
__u16 erspan_hwid = 0;
inet_prefix_reset(&saddr);
inet_prefix_reset(&daddr);
if (!(n->nlmsg_flags & 0x400)) {
const struct rtattr *rta;
if (rtnl_talk(&rth, &req.n, &answer) < 0) {
get_failed:
fprintf(
stderr
,
"Failed to get existing tunnel info.\n");
return -1;
}
len = answer->nlmsg_len;
len -= ((sizeof(*ifi)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )));
if (len < 0)
goto get_failed;
parse_rtattr(tb, (__IFLA_MAX - 1), ((struct rtattr*)(((char*)(((void *)(((char *)answer) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))))) + ( ((sizeof(struct ifinfomsg))+4U -1) & ~(4U -1) ))), len);
if (!tb[IFLA_LINKINFO])
goto get_failed;
(parse_rtattr_flags((linkinfo), ((__IFLA_INFO_MAX - 1)), ((void*)(((char*)(tb[IFLA_LINKINFO])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((tb[IFLA_LINKINFO])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)));
if (!linkinfo[IFLA_INFO_DATA])
goto get_failed;
(parse_rtattr_flags((greinfo), ((__IFLA_GRE_MAX - 1)), ((void*)(((char*)(linkinfo[IFLA_INFO_DATA])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((linkinfo[IFLA_INFO_DATA])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)))
;
rta = greinfo[IFLA_GRE_LOCAL];
if (rta && get_addr_rta(&saddr, rta,
2
))
goto get_failed;
rta = greinfo[IFLA_GRE_REMOTE];
if (rta && get_addr_rta(&daddr, rta,
2
))
goto get_failed;
if (greinfo[IFLA_GRE_IKEY])
ikey = rta_getattr_u32(greinfo[IFLA_GRE_IKEY]);
if (greinfo[IFLA_GRE_OKEY])
okey = rta_getattr_u32(greinfo[IFLA_GRE_OKEY]);
if (greinfo[IFLA_GRE_IFLAGS])
iflags = rta_getattr_u16(greinfo[IFLA_GRE_IFLAGS]);
if (greinfo[IFLA_GRE_OFLAGS])
oflags = rta_getattr_u16(greinfo[IFLA_GRE_OFLAGS]);
if (greinfo[IFLA_GRE_PMTUDISC])
pmtudisc = rta_getattr_u8(
greinfo[IFLA_GRE_PMTUDISC]);
if (greinfo[IFLA_GRE_IGNORE_DF])
ignore_df =
!!rta_getattr_u8(greinfo[IFLA_GRE_IGNORE_DF]);
if (greinfo[IFLA_GRE_TOS])
tos = rta_getattr_u8(greinfo[IFLA_GRE_TOS]);
if (greinfo[IFLA_GRE_TTL])
ttl = rta_getattr_u8(greinfo[IFLA_GRE_TTL]);
if (greinfo[IFLA_GRE_LINK])
link = rta_getattr_u32(greinfo[IFLA_GRE_LINK]);
if (greinfo[IFLA_GRE_ENCAP_TYPE])
encaptype = rta_getattr_u16(greinfo[IFLA_GRE_ENCAP_TYPE]);
if (greinfo[IFLA_GRE_ENCAP_FLAGS])
encapflags = rta_getattr_u16(greinfo[IFLA_GRE_ENCAP_FLAGS]);
if (greinfo[IFLA_GRE_ENCAP_SPORT])
encapsport = rta_getattr_u16(greinfo[IFLA_GRE_ENCAP_SPORT]);
if (greinfo[IFLA_GRE_ENCAP_DPORT])
encapdport = rta_getattr_u16(greinfo[IFLA_GRE_ENCAP_DPORT]);
if (greinfo[IFLA_GRE_COLLECT_METADATA])
metadata = 1;
if (greinfo[IFLA_GRE_FWMARK])
fwmark = rta_getattr_u32(greinfo[IFLA_GRE_FWMARK]);
if (greinfo[IFLA_GRE_ERSPAN_INDEX])
erspan_idx = rta_getattr_u32(greinfo[IFLA_GRE_ERSPAN_INDEX]);
if (greinfo[IFLA_GRE_ERSPAN_VER])
erspan_ver = rta_getattr_u8(greinfo[IFLA_GRE_ERSPAN_VER]);
if (greinfo[IFLA_GRE_ERSPAN_DIR])
erspan_dir = rta_getattr_u8(greinfo[IFLA_GRE_ERSPAN_DIR]);
if (greinfo[IFLA_GRE_ERSPAN_HWID])
erspan_hwid = rta_getattr_u16(greinfo[IFLA_GRE_ERSPAN_HWID]);
free(answer);
}
while (argc > 0) {
if (!matches(*argv, "key")) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
iflags |=
((__be16)(__builtin_constant_p((__u16)((
0x2000
))) ? ((__u16)( (((__u16)((
0x2000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x2000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x2000
))))
;
oflags |=
((__be16)(__builtin_constant_p((__u16)((
0x2000
))) ? ((__u16)( (((__u16)((
0x2000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x2000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x2000
))))
;
ikey = okey = tnl_parse_key("key", *argv);
} else if (!matches(*argv, "nokey")) {
iflags &= ~
((__be16)(__builtin_constant_p((__u16)((
0x2000
))) ? ((__u16)( (((__u16)((
0x2000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x2000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x2000
))))
;
oflags &= ~
((__be16)(__builtin_constant_p((__u16)((
0x2000
))) ? ((__u16)( (((__u16)((
0x2000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x2000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x2000
))))
;
ikey = okey = 0;
} else if (!matches(*argv, "ikey")) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
iflags |=
((__be16)(__builtin_constant_p((__u16)((
0x2000
))) ? ((__u16)( (((__u16)((
0x2000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x2000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x2000
))))
;
ikey = tnl_parse_key("ikey", *argv);
} else if (!matches(*argv, "noikey")) {
iflags &= ~
((__be16)(__builtin_constant_p((__u16)((
0x2000
))) ? ((__u16)( (((__u16)((
0x2000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x2000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x2000
))))
;
ikey = 0;
} else if (!matches(*argv, "okey")) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
oflags |=
((__be16)(__builtin_constant_p((__u16)((
0x2000
))) ? ((__u16)( (((__u16)((
0x2000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x2000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x2000
))))
;
okey = tnl_parse_key("okey", *argv);
} else if (!matches(*argv, "nookey")) {
oflags &= ~
((__be16)(__builtin_constant_p((__u16)((
0x2000
))) ? ((__u16)( (((__u16)((
0x2000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x2000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x2000
))))
;
okey = 0;
} else if (!matches(*argv, "seq")) {
iflags |=
((__be16)(__builtin_constant_p((__u16)((
0x1000
))) ? ((__u16)( (((__u16)((
0x1000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x1000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x1000
))))
;
oflags |=
((__be16)(__builtin_constant_p((__u16)((
0x1000
))) ? ((__u16)( (((__u16)((
0x1000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x1000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x1000
))))
;
} else if (!matches(*argv, "noseq")) {
iflags &= ~
((__be16)(__builtin_constant_p((__u16)((
0x1000
))) ? ((__u16)( (((__u16)((
0x1000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x1000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x1000
))))
;
oflags &= ~
((__be16)(__builtin_constant_p((__u16)((
0x1000
))) ? ((__u16)( (((__u16)((
0x1000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x1000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x1000
))))
;
} else if (!matches(*argv, "iseq")) {
iflags |=
((__be16)(__builtin_constant_p((__u16)((
0x1000
))) ? ((__u16)( (((__u16)((
0x1000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x1000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x1000
))))
;
} else if (!matches(*argv, "noiseq")) {
iflags &= ~
((__be16)(__builtin_constant_p((__u16)((
0x1000
))) ? ((__u16)( (((__u16)((
0x1000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x1000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x1000
))))
;
} else if (!matches(*argv, "oseq")) {
oflags |=
((__be16)(__builtin_constant_p((__u16)((
0x1000
))) ? ((__u16)( (((__u16)((
0x1000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x1000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x1000
))))
;
} else if (!matches(*argv, "nooseq")) {
oflags &= ~
((__be16)(__builtin_constant_p((__u16)((
0x1000
))) ? ((__u16)( (((__u16)((
0x1000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x1000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x1000
))))
;
} else if (!matches(*argv, "csum")) {
iflags |=
((__be16)(__builtin_constant_p((__u16)((
0x8000
))) ? ((__u16)( (((__u16)((
0x8000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x8000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x8000
))))
;
oflags |=
((__be16)(__builtin_constant_p((__u16)((
0x8000
))) ? ((__u16)( (((__u16)((
0x8000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x8000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x8000
))))
;
} else if (!matches(*argv, "nocsum")) {
iflags &= ~
((__be16)(__builtin_constant_p((__u16)((
0x8000
))) ? ((__u16)( (((__u16)((
0x8000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x8000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x8000
))))
;
oflags &= ~
((__be16)(__builtin_constant_p((__u16)((
0x8000
))) ? ((__u16)( (((__u16)((
0x8000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x8000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x8000
))))
;
} else if (!matches(*argv, "icsum")) {
iflags |=
((__be16)(__builtin_constant_p((__u16)((
0x8000
))) ? ((__u16)( (((__u16)((
0x8000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x8000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x8000
))))
;
} else if (!matches(*argv, "noicsum")) {
iflags &= ~
((__be16)(__builtin_constant_p((__u16)((
0x8000
))) ? ((__u16)( (((__u16)((
0x8000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x8000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x8000
))))
;
} else if (!matches(*argv, "ocsum")) {
oflags |=
((__be16)(__builtin_constant_p((__u16)((
0x8000
))) ? ((__u16)( (((__u16)((
0x8000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x8000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x8000
))))
;
} else if (!matches(*argv, "noocsum")) {
oflags &= ~
((__be16)(__builtin_constant_p((__u16)((
0x8000
))) ? ((__u16)( (((__u16)((
0x8000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x8000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x8000
))))
;
} else if (!matches(*argv, "nopmtudisc")) {
pmtudisc = 0;
} else if (!matches(*argv, "pmtudisc")) {
pmtudisc = 1;
} else if (!matches(*argv, "remote")) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
get_addr(&daddr, *argv,
2
);
} else if (!matches(*argv, "local")) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
get_addr(&saddr, *argv,
2
);
} else if (!matches(*argv, "dev")) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
link = ll_name_to_index(*argv);
if (!link)
exit(nodev(*argv));
} else if (!matches(*argv, "ttl") ||
!matches(*argv, "hoplimit") ||
!matches(*argv, "hlim")) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (strcmp(*argv, "inherit") != 0) {
if (get_u8(&ttl, *argv, 0))
invarg("invalid TTL\n", *argv);
} else
ttl = 0;
} else if (!matches(*argv, "tos") ||
!matches(*argv, "tclass") ||
!matches(*argv, "dsfield")) {
__u32 uval;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (strcmp(*argv, "inherit") != 0) {
if (rtnl_dsfield_a2n(&uval, *argv))
invarg("bad TOS value", *argv);
tos = uval;
} else
tos = 1;
} else if (strcmp(*argv, "noencap") == 0) {
encaptype = TUNNEL_ENCAP_NONE;
} else if (strcmp(*argv, "encap") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (strcmp(*argv, "fou") == 0)
encaptype = TUNNEL_ENCAP_FOU;
else if (strcmp(*argv, "gue") == 0)
encaptype = TUNNEL_ENCAP_GUE;
else if (strcmp(*argv, "none") == 0)
encaptype = TUNNEL_ENCAP_NONE;
else
invarg("Invalid encap type.", *argv);
} else if (strcmp(*argv, "encap-sport") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (strcmp(*argv, "auto") == 0)
encapsport = 0;
else if (get_u16(&encapsport, *argv, 0))
invarg("Invalid source port.", *argv);
} else if (strcmp(*argv, "encap-dport") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u16(&encapdport, *argv, 0))
invarg("Invalid destination port.", *argv);
} else if (strcmp(*argv, "encap-csum") == 0) {
encapflags |= (1<<0);
} else if (strcmp(*argv, "noencap-csum") == 0) {
encapflags &= ~(1<<0);
} else if (strcmp(*argv, "encap-udp6-csum") == 0) {
encapflags |= (1<<1);
} else if (strcmp(*argv, "noencap-udp6-csum") == 0) {
encapflags &= ~(1<<1);
} else if (strcmp(*argv, "encap-remcsum") == 0) {
encapflags |= (1<<2);
} else if (strcmp(*argv, "noencap-remcsum") == 0) {
encapflags &= ~(1<<2);
} else if (strcmp(*argv, "external") == 0) {
metadata = 1;
} else if (strcmp(*argv, "ignore-df") == 0) {
ignore_df = 1;
} else if (strcmp(*argv, "noignore-df") == 0) {
ignore_df = 2;
} else if (strcmp(*argv, "fwmark") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&fwmark, *argv, 0))
invarg("invalid fwmark\n", *argv);
} else if (is_erspan && strcmp(*argv, "erspan") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&erspan_idx, *argv, 0))
invarg("invalid erspan index\n", *argv);
if (erspan_idx & ~((1<<20) - 1) || erspan_idx == 0)
invarg("erspan index must be > 0 and <= 20-bit\n", *argv);
} else if (is_erspan && strcmp(*argv, "erspan_ver") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&erspan_ver, *argv, 0))
invarg("invalid erspan version\n", *argv);
if (erspan_ver > 2)
invarg("erspan version must be 0/1/2\n", *argv);
} else if (is_erspan && strcmp(*argv, "erspan_dir") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (matches(*argv, "ingress") == 0)
erspan_dir = 0;
else if (matches(*argv, "egress") == 0)
erspan_dir = 1;
else
invarg("Invalid erspan direction.", *argv);
} else if (is_erspan && strcmp(*argv, "erspan_hwid") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u16(&erspan_hwid, *argv, 0))
invarg("invalid erspan hwid\n", *argv);
} else {
gre_print_help(lu, argc, argv,
stderr
);
return -1;
}
argc--; argv++;
}
if (is_addrtype_inet_multi(&daddr)) {
if (!ikey) {
ikey = daddr.data[0];
iflags |=
((__be16)(__builtin_constant_p((__u16)((
0x2000
))) ? ((__u16)( (((__u16)((
0x2000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x2000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x2000
))))
;
}
if (!okey) {
okey = daddr.data[0];
oflags |=
((__be16)(__builtin_constant_p((__u16)((
0x2000
))) ? ((__u16)( (((__u16)((
0x2000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x2000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x2000
))))
;
}
if (!is_addrtype_inet_not_unspec(&saddr)) {
fprintf(
stderr
,
"A broadcast tunnel requires a source address.\n");
return -1;
}
}
if (metadata) {
addattr_l(n, 1024, IFLA_GRE_COLLECT_METADATA,
((void *)0)
, 0);
return 0;
}
addattr32(n, 1024, IFLA_GRE_IKEY, ikey);
addattr32(n, 1024, IFLA_GRE_OKEY, okey);
addattr_l(n, 1024, IFLA_GRE_IFLAGS, &iflags, 2);
addattr_l(n, 1024, IFLA_GRE_OFLAGS, &oflags, 2);
if (is_addrtype_inet_not_unspec(&saddr))
addattr_l(n, 1024, IFLA_GRE_LOCAL, saddr.data, saddr.bytelen);
if (is_addrtype_inet_not_unspec(&daddr))
addattr_l(n, 1024, IFLA_GRE_REMOTE, daddr.data, daddr.bytelen);
addattr_l(n, 1024, IFLA_GRE_PMTUDISC, &pmtudisc, 1);
if (ignore_df)
addattr8(n, 1024, IFLA_GRE_IGNORE_DF, ignore_df & 1);
addattr_l(n, 1024, IFLA_GRE_TOS, &tos, 1);
if (link)
addattr32(n, 1024, IFLA_GRE_LINK, link);
addattr_l(n, 1024, IFLA_GRE_TTL, &ttl, 1);
addattr32(n, 1024, IFLA_GRE_FWMARK, fwmark);
if (is_erspan) {
addattr8(n, 1024, IFLA_GRE_ERSPAN_VER, erspan_ver);
if (erspan_ver == 1 && erspan_idx != 0) {
addattr32(n, 1024, IFLA_GRE_ERSPAN_INDEX, erspan_idx);
} else if (erspan_ver == 2) {
addattr8(n, 1024, IFLA_GRE_ERSPAN_DIR, erspan_dir);
addattr16(n, 1024, IFLA_GRE_ERSPAN_HWID, erspan_hwid);
}
}
addattr16(n, 1024, IFLA_GRE_ENCAP_TYPE, encaptype);
addattr16(n, 1024, IFLA_GRE_ENCAP_FLAGS, encapflags);
addattr16(n, 1024, IFLA_GRE_ENCAP_SPORT, htons(encapsport));
addattr16(n, 1024, IFLA_GRE_ENCAP_DPORT, htons(encapdport));
return 0;
}
| long long gre_parse_opt(void* a0, unsigned long a1, unsigned int a2, struct_0 *a3) {
unsigned long long *v0;
unsigned int v1;
char v2;
char v3;
char v4;
char v5;
char v6;
char v7;
char v8;
char v9;
unsigned short v10;
unsigned short v11;
unsigned short v12;
unsigned short v13;
unsigned short v14;
unsigned short v15;
unsigned short v16;
unsigned int v17;
unsigned int v18;
char v19;
unsigned int v20;
unsigned int v21;
unsigned int v22;
unsigned int v23;
char v24;
struct_1 *v25;
unsigned long long v26;
void* v27;
unsigned short v28;
unsigned short v29;
void* v30;
void* v31;
unsigned int v32;
void* v33;
char v34;
char v35;
char v36;
char v37;
char v38;
char v39;
char v40;
char v41;
char v42;
char v43;
char v44;
char v45;
char v46;
char v47;
char v48;
char v49;
char v50;
char v51;
char v52;
char v53;
char v54;
char v55;
char v56;
char v57;
char v58;
char v59;
char v60;
char v61;
char v62;
char v63;
char v64;
char v65;
unsigned long long v67;
unsigned long long v68;
unsigned long long v69;
unsigned long long v70;
unsigned long long v71;
unsigned long long v73;
unsigned long long v75;
unsigned long long v76;
unsigned long long v77;
unsigned long long v78;
unsigned long long v79;
unsigned long long v80;
unsigned long long v81;
unsigned long long v82;
unsigned long long v83;
unsigned long long v84;
unsigned long long v85;
unsigned long long v86;
unsigned long long v87;
unsigned long long v88;
unsigned long long v89;
unsigned long long v90;
unsigned long long v91;
unsigned long long v92;
unsigned long long v93;
unsigned long long v94;
unsigned long long v96;
unsigned long long v98;
unsigned long long v99;
unsigned long long v100;
unsigned long long v101;
v1 = a1;
*(&v0) = a2;
v25 = &a3[2].padding_0;
v27 = 0;
v30 = 0;
v31 = 0;
v33 = 0;
v27 = 32;
v28 = 18;
v29 = 1;
v31 = preferred_family;
v32 = v25->field_4;
v10 = 0;
v11 = 0;
v20 = 0;
v21 = 0;
v2 = 1;
v6 = 0;
v3 = 0;
v4 = 0;
v22 = 0;
v15 = 0;
v16 = 0;
v12 = 0;
v13 = 0;
v7 = 0;
v17 = 0;
v9 = gre_is_erspan(a0);
v18 = 0;
v5 = 1;
v8 = 0;
v14 = 0;
inet_prefix_reset(&v58);
inet_prefix_reset(&v61);
if (!(a3->field_6 & 0x400)) {
v67 = rtnl_talk(0x500038, &v27, &v24);
if (v67 >= 0) {
v23 = *(*(&v24));
v23 -= 32;
if (v23 >= 0) {
parse_rtattr(&v64, 0x3c, *(&v24) + 32, v23);
if (*(&v65)) {
parse_rtattr_flags(&v34, 0x5, *(&v65) + 4, *(*(&v65)) - 4, 0x8000);
if (*(&v35)) {
parse_rtattr_flags(&v36, 0x18, *(&v35) + 4, *(*(&v35)) - 4, 0x8000);
v26 = *(&v42);
if (v26)
v67 = get_addr_rta(&v58, v26, 0x2, v26);
if (!v67 || !v26) {
v26 = *(&v43);
if (v26)
v67 = get_addr_rta(&v61, v26, 0x2, v26);
}
}
}
}
}
}
if (!(a3->field_6 & 0x400) && *(&v35) && v23 >= 0 && v26 && v67 >= 0 && *(&v65) && (!v67 || !v26) && v67 || !(a3->field_6 & 0x400) && *(&v35) && v23 >= 0 && v67 >= 0 && *(&v65) && v26 && v67 || !(a3->field_6 & 0x400) && v23 >= 0 && v67 >= 0 && *(&v65) && !*(&v35) || !(a3->field_6 & 0x400) && v23 >= 0 && v67 >= 0 && !*(&v65) || !(a3->field_6 & 0x400) && v67 >= 0 && v23 < 0 || !(a3->field_6 & 0x400) && v67 < 0) {
fprintf(*(&stderr), "Failed to get existing tunnel info.\n");
v68 = 4294967295;
}
if (!(a3->field_6 & 0x400) && *(&v35) && v23 >= 0 && v26 && v67 >= 0 && *(&v65) && (!v67 || !v26) && !v67 || !(a3->field_6 & 0x400) && *(&v35) && v23 >= 0 && v67 >= 0 && *(&v65) && (!v67 || !v26) && !v26) {
if (*(&v40))
v20 = rta_getattr_u32(*(&v40));
if (*(&v41))
v21 = rta_getattr_u32(*(&v41));
if (*(&v38)) {
v67 = rta_getattr_u16(*(&v38));
v10 = v67;
}
if (*(&v39)) {
*(&v67) = rta_getattr_u16(*(&v39));
v11 = v67;
}
if (*(&v46))
v2 = rta_getattr_u8(*(&v46));
if (*(&v52)) {
*(&v67) = rta_getattr_u8(*(&v52));
v6 = *(&v67);
}
if (*(&v45))
v3 = rta_getattr_u8(*(&v45));
if (*(&v44))
v4 = rta_getattr_u8(*(&v44));
if (*(&v37))
v22 = rta_getattr_u32(*(&v37));
if (*(&v47))
v15 = rta_getattr_u16(*(&v47));
if (*(&v48))
v16 = rta_getattr_u16(*(&v48));
if (*(&v49))
v12 = rta_getattr_u16(*(&v49));
if (*(&v50))
v13 = rta_getattr_u16(*(&v50));
if (*(&v51))
v7 = 1;
if (*(&v53))
v17 = rta_getattr_u32(*(&v53));
if (*(&v54))
v18 = rta_getattr_u32(*(&v54));
if (*(&v55))
v5 = rta_getattr_u8(*(&v55));
if (*(&v56))
v8 = rta_getattr_u8(*(&v56));
if (*(&v57))
v14 = rta_getattr_u16(*(&v57));
free(*(&v24));
}
if (!(a3->field_6 & 0x400) && *(&v35) && v23 >= 0 && v26 && v67 >= 0 && *(&v65) && (!v67 || !v26) && !v67 || !(a3->field_6 & 0x400) && *(&v35) && v23 >= 0 && v67 >= 0 && *(&v65) && (!v67 || !v26) && !v26 || (a3->field_6 & 0x400)) {
while (true) {
if (v1 > 0) {
*(&v67) = matches(*(v0), "key") ^ 1;
if (v67) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v10 |= 32;
v11 |= 32;
v21 = tnl_parse_key("key", *(v0));
v20 = v21;
} else {
*(&v67) = matches(*(v0), "nokey") ^ 1;
*(&v67) = matches(*(v0), "ikey") ^ 1;
*(&v67) = matches(*(v0), "noikey") ^ 1;
*(&v67) = matches(*(v0), "okey") ^ 1;
*(&v67) = matches(*(v0), "nookey") ^ 1;
*(&v67) = matches(*(v0), "seq") ^ 1;
*(&v67) = matches(*(v0), "noseq") ^ 1;
*(&v67) = matches(*(v0), "iseq") ^ 1;
*(&v67) = matches(*(v0), "noiseq") ^ 1;
*(&v67) = matches(*(v0), "oseq") ^ 1;
*(&v67) = matches(*(v0), "nooseq") ^ 1;
*(&v67) = matches(*(v0), "csum") ^ 1;
*(&v67) = matches(*(v0), "nocsum") ^ 1;
*(&v67) = matches(*(v0), "icsum") ^ 1;
*(&v67) = matches(*(v0), "noicsum") ^ 1;
*(&v67) = matches(*(v0), "ocsum") ^ 1;
*(&v67) = matches(*(v0), "noocsum") ^ 1;
*(&v67) = matches(*(v0), "nopmtudisc") ^ 1;
*(&v67) = matches(*(v0), "pmtudisc") ^ 1;
*(&v67) = matches(*(v0), "remote") ^ 1;
*(&v67) = matches(*(v0), "local") ^ 1;
*(&v67) = matches(*(v0), "dev") ^ 1;
*(&v67) = matches(*(v0), "ttl") ^ 1;
*(&v67) = matches(*(v0), "hoplimit") ^ 1;
*(&v67) = matches(*(v0), "hlim") ^ 1;
*(&v67) = matches(*(v0), "tos") ^ 1;
*(&v67) = matches(*(v0), "tclass") ^ 1;
*(&v67) = matches(*(v0), "dsfield") ^ 1;
v71 = strcmp(*(v0), "noencap");
if (!v71) {
v15 = 0;
} else {
v73 = strcmp(*(v0), "encap");
if (!v73) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v75 = strcmp(*(v0), "fou");
if (!v75) {
v15 = 1;
} else {
v76 = strcmp(*(v0), "gue");
if (!v76) {
v15 = 2;
} else {
v77 = strcmp(*(v0), "none");
if (!v77)
v15 = 0;
else
invarg("Invalid encap type.", *(v0));
}
}
}
if (v73 || v77 && v75 && v76) {
v78 = strcmp(*(v0), "encap-sport");
if (!v78) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v79 = strcmp(*(v0), "auto");
if (!v79) {
v12 = 0;
} else {
v80 = get_u16(&v12, *(v0), 0x0, *(v0));
if (v80)
invarg("Invalid source port.", *(v0));
}
}
}
}
}
if (false) {
v10 &= 4294967263;
v11 &= 4294967263;
v21 = 0;
v20 = v21;
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v10 |= 32;
v20 = tnl_parse_key("ikey", *(v0));
v10 &= 4294967263;
v20 = 0;
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v11 |= 32;
v21 = tnl_parse_key("okey", *(v0));
v11 &= 4294967263;
v21 = 0;
v10 |= 16;
v11 |= 16;
v10 &= 4294967279;
v11 &= 4294967279;
v10 |= 16;
v10 &= 4294967279;
v11 |= 16;
v11 &= 4294967279;
v67 = v10;
*(&v67) = v10 | 128;
v10 = v67;
v67 = v11;
*(&v67) = v11 | 128;
v11 = v67;
v67 = v10;
*(&v67) = v10 & 127;
v10 = v67;
v67 = v11;
*(&v67) = v11 & 127;
v11 = v67;
v67 = v10;
*(&v67) = v10 | 128;
v10 = v67;
v67 = v10;
*(&v67) = v10 & 127;
v10 = v67;
v67 = v11;
*(&v67) = v11 | 128;
v11 = v67;
v67 = v11;
*(&v67) = v11 & 127;
v11 = v67;
v2 = 0;
v2 = 1;
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
get_addr(&v61, *(v0), 0x2, *(v0));
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
get_addr(&v58, *(v0), 0x2, *(v0));
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v22 = ll_name_to_index(*(v0));
exit(nodev(*(v0)));
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v69 = strcmp(*(v0), "inherit");
if (v69) {
v70 = get_u8(&v4, *(v0), 0x0, *(v0));
if (v70)
invarg("invalid TTL\n", *(v0));
}
if (!v69 || v70)
v4 = 0;
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
if (strcmp(*(v0), "inherit")) {
if (rtnl_dsfield_a2n(&v19, *(v0), *(v0)))
invarg("bad TOS value", *(v0));
v3 = *(&v19);
} else {
v3 = 1;
}
}
if (!v67 && !v78 && v71 && v79 && (v77 || v73) && (v73 || v75) && (v73 || v76) && v80 || !v67 && v71 && (v77 || v73) && (v73 || v75) && (v73 || v76) && v78) {
v81 = strcmp(*(v0), "encap-dport");
if (!v81) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v82 = get_u16(&v13, *(v0), 0x0, *(v0));
if (v82)
invarg("Invalid destination port.", *(v0));
}
}
if ((!v67 && !v78 && v71 && v79 && (v77 || v73) && (v73 || v75) && (v73 || v76) && v80 || !v67 && v71 && (v77 || v73) && (v73 || v75) && (v73 || v76) && v78) && !v81 && v82 || (!v67 && !v78 && v71 && v79 && (v77 || v73) && (v73 || v75) && (v73 || v76) && v80 || !v67 && v71 && (v77 || v73) && (v73 || v75) && (v73 || v76) && v78) && v81) {
v83 = strcmp(*(v0), "encap-csum");
if (!v83) {
v16 |= 1;
} else {
v84 = strcmp(*(v0), "noencap-csum");
if (!v84) {
v16 &= 65534;
} else {
v85 = strcmp(*(v0), "encap-udp6-csum");
if (!v85) {
v16 |= 2;
} else {
v86 = strcmp(*(v0), "noencap-udp6-csum");
if (!v86) {
v16 &= 65533;
} else {
v87 = strcmp(*(v0), "encap-remcsum");
if (!v87) {
v16 |= 4;
} else {
v88 = strcmp(*(v0), "noencap-remcsum");
if (!v88) {
v16 &= 65531;
} else {
v89 = strcmp(*(v0), "external");
if (!v89) {
v7 = 1;
} else {
v90 = strcmp(*(v0), "ignore-df");
if (!v90) {
v6 = 1;
} else {
v91 = strcmp(*(v0), "noignore-df");
if (!v91) {
v6 = 2;
} else {
v92 = strcmp(*(v0), "fwmark");
if (!v92) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v93 = get_u32(&v17, *(v0), 0x0, *(v0));
if (v93)
invarg("invalid fwmark\n", *(v0));
}
}
}
}
}
}
}
}
}
}
}
if (...) {
v94 = strcmp(*(v0), "erspan");
if (!v94) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
if (get_u32(&v18, *(v0), 0x0, *(v0)))
invarg("invalid erspan index\n", *(v0));
}
}
if (...)
invarg("erspan index must be > 0 and <= 20-bit\n", *(v0));
if (...) {
v96 = strcmp(*(v0), "erspan_ver");
if (!v96) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
if (get_u8(&v5, *(v0), 0x0, *(v0)))
invarg("invalid erspan version\n", *(v0));
if (v5 > 2)
invarg("erspan version must be 0/1/2\n", *(v0));
}
}
if (...) {
v98 = strcmp(*(v0), "erspan_dir");
if (!v98) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
*(&v98) = matches(*(v0), "ingress") ^ 1;
if (v98) {
v8 = 0;
} else {
*(&v98) = matches(*(v0), "egress") ^ 1;
invarg("Invalid erspan direction.", *(v0));
}
if (false)
v8 = 1;
}
}
if (...) {
v99 = strcmp(*(v0), "erspan_hwid");
if (!v99) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v100 = get_u16(&v14, *(v0), 0x0, *(v0));
if (v100)
invarg("invalid erspan hwid\n", *(v0));
}
}
if (...) {
v1 -= 1;
v0 += 1;
continue;
}
if (...) {
gre_print_help(a0, v1, v0, *(&stderr));
v68 = 4294967295;
break;
}
} else {
v101 = is_addrtype_inet_multi(&v61);
if (v101) {
if (!v20) {
v20 = *(&v63);
v10 |= 32;
}
if (!v21) {
v21 = *(&v63);
v11 |= 32;
}
*(&v101) = is_addrtype_inet_not_unspec(&v58) ^ 1;
fprintf(*(&stderr), "A broadcast tunnel requires a source address.\n");
v68 = 4294967295;
break;
} else if (v7) {
addattr_l(a3, 0x400, 0x12, 0x0, 0x0);
v68 = 0;
break;
} else {
addattr32(a3, 0x400, 0x4, v20);
addattr32(a3, 0x400, 0x5, v21);
addattr_l(a3, 0x400, 0x2, &v10, 0x2);
addattr_l(a3, 0x400, 0x3, &v11, 0x2);
if (is_addrtype_inet_not_unspec(&v58))
addattr_l(a3, 0x400, 0x6, &v60, *(&v59));
if (is_addrtype_inet_not_unspec(&v61))
addattr_l(a3, 0x400, 0x7, &v63, *(&v62));
addattr_l(a3, 0x400, 0xa, &v2, 0x1);
if (v6)
addattr8(a3, 0x400, 0x13, v6 & 1);
addattr_l(a3, 0x400, 0x9, &v3, 0x1);
if (v22)
addattr32(a3, 0x400, 0x1, v22);
addattr_l(a3, 0x400, 0x8, &v4, 0x1);
addattr32(a3, 0x400, 0x14, v17);
if (v9) {
addattr8(a3, 0x400, 0x16, v5);
if (v5 == 1 && v18)
addattr32(a3, 0x400, 0x15, v18);
if ((!v18 || v5 != 1) && v5 == 2) {
addattr8(a3, 0x400, 0x17, v8);
addattr16(a3, 0x400, 0x18, v14);
}
}
addattr16(a3, 0x400, 0xe, v15);
addattr16(a3, 0x400, 0xf, v16);
addattr16(a3, 0x400, 0x10, htons(v12));
addattr16(a3, 0x400, 0x11, htons(v13));
v68 = 0;
break;
}
}
}
}
return v68;
}
|
static void
validate_case_classes (struct Spec_list *s1, struct Spec_list *s2)
{
size_t n_upper = 0;
size_t n_lower = 0;
int c1 = 0;
int c2 = 0;
count old_s1_len = s1->length;
count old_s2_len = s2->length;
struct List_element *s1_tail = s1->tail;
struct List_element *s2_tail = s2->tail;
_Bool
s1_new_element =
1
;
_Bool
s2_new_element =
1
;
if (complement || !s2->has_char_class)
return;
for (int i = 0; i < N_CHARS; i++)
{
if (
((*__ctype_b_loc ())[(int) ((
i
))] & (unsigned short int) _ISupper)
)
n_upper++;
if (
((*__ctype_b_loc ())[(int) ((
i
))] & (unsigned short int) _ISlower)
)
n_lower++;
}
s1->state = (
(18446744073709551615UL)
- 1);
s2->state = (
(18446744073709551615UL)
- 1);
while (c1 != -1 && c2 != -1)
{
enum Upper_Lower_class class_s1, class_s2;
c1 = get_next (s1, &class_s1);
c2 = get_next (s2, &class_s2);
if (s2_new_element && class_s2 != UL_NONE
&& !(s1_new_element && class_s1 != UL_NONE))
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"misaligned [:upper:] and/or [:lower:] construct\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("misaligned [:upper:] and/or [:lower:] construct")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("misaligned [:upper:] and/or [:lower:] construct")), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
if (class_s2 != UL_NONE)
{
skip_construct (s1);
skip_construct (s2);
s1->length -= (class_s1 == UL_UPPER ? n_upper : n_lower) - 1;
s2->length -= (class_s2 == UL_UPPER ? n_upper : n_lower) - 1;
}
s1_new_element = s1->state == ((
(18446744073709551615UL)
- 1) + 1);
s2_new_element = s2->state == ((
(18446744073709551615UL)
- 1) + 1);
}
((void) sizeof ((
old_s1_len >= s1->length && old_s2_len >= s2->length
) ? 1 : 0), __extension__ ({ if (
old_s1_len >= s1->length && old_s2_len >= s2->length
) ; else __assert_fail (
"old_s1_len >= s1->length && old_s2_len >= s2->length"
, "src/tr.c", 1224, __extension__ __PRETTY_FUNCTION__); }))
;
s1->tail = s1_tail;
s2->tail = s2_tail;
}
| unsigned long validate_case_classes(_QWORD *a1, long a2)
{
char *v2;
long v3;
long v4;
bool v6;
bool v7;
int v8;
int v9;
int next;
int v11;
int i;
long v13;
long v14;
unsigned long v15;
unsigned long v16;
long v17;
long v18;
unsigned long v19;
v19 = __readfsqword(0x28u);
v13 = 0LL;
v14 = 0LL;
next = 0;
v11 = 0;
v15 = a1[3];
v16 = *(_QWORD *)(a2 + 24);
v17 = a1[1];
v18 = *(_QWORD *)(a2 + 8);
v6 = 1;
v7 = 1;
if ( !complement && *(_BYTE *)(a2 + 49) == 1 )
{
for ( i = 0; i <= 255; ++i )
{
if ( ((*_ctype_b_loc())[i] & 0x100) != 0 )
++v13;
if ( ((*_ctype_b_loc())[i] & 0x200) != 0 )
++v14;
}
a1[2] = -2LL;
*(_QWORD *)(a2 + 16) = -2LL;
while ( next != -1 && v11 != -1 )
{
next = get_next(a1, &v8);
v11 = get_next((_QWORD *)a2, &v9);
if ( v7 && v9 != 2 && (!v6 || v8 == 2) )
{
v2 = gettext("misaligned [:upper:] and/or [:lower:] construct");
error(1, 0, v2);
}
if ( v9 != 2 )
{
skip_construct((long)a1);
skip_construct(a2);
if ( v8 == 1 )
v3 = v13 - 1;
else
v3 = v14 - 1;
a1[3] -= v3;
if ( v9 == 1 )
v4 = v13 - 1;
else
v4 = v14 - 1;
*(_QWORD *)(a2 + 24) -= v4;
}
v6 = a1[2] == -1LL;
v7 = *(_QWORD *)(a2 + 16) == -1LL;
}
if ( v15 < a1[3] || v16 < *(_QWORD *)(a2 + 24) )
_assert_fail("old_s1_len >= s1->length && old_s2_len >= s2->length", "src/tr.c", 0x4C8u, "validate_case_classes");
a1[1] = v17;
*(_QWORD *)(a2 + 8) = v18;
}
return __readfsqword(0x28u) ^ v19;
}
|
static void
read_environment_file(char ***env, u_int *envsize,
const char *filename, const char *allowlist)
{
FILE *f;
char *line =
((void *)0)
, *cp, *value;
size_t linesize = 0;
u_int lineno = 0;
f = fopen(filename, "r");
if (!f)
return;
while (getline(&line, &linesize, f) != -1) {
if (++lineno > 1000)
sshfatal("session.c", __func__, 859, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Too many lines in environment file %s", filename);
for (cp = line; *cp == ' ' || *cp == '\t'; cp++)
;
if (!*cp || *cp == '#' || *cp == '\n')
continue;
cp[strcspn(cp, "\n")] = '\0';
value = strchr(cp, '=');
if (value ==
((void *)0)
) {
fprintf(
stderr
, "Bad line %u in %.100s\n", lineno,
filename);
continue;
}
*value = '\0';
value++;
if (allowlist !=
((void *)0)
&&
match_pattern_list(cp, allowlist, 0) != 1)
continue;
child_set_env(env, envsize, cp, value);
}
free(line);
fclose(f);
}
| void read_environment_file(undefined8 param_1,undefined8 param_2,char *param_3,long param_4)
{
long lVar1;
int iVar2;
size_t sVar3;
__ssize_t _Var4;
long *plVar5;
long *plVar6;
long in_FS_OFFSET;
char *apcStack128 [3];
long local_68;
char *local_60;
undefined8 local_58;
undefined8 local_50;
uint local_3c;
char *local_38;
size_t local_30;
char *local_28;
FILE *local_20;
char *local_18;
long local_10;
plVar5 = &local_68;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_38 = (char *)0x0;
local_30 = 0;
local_3c = 0;
local_68 = param_4;
local_60 = param_3;
local_58 = param_2;
local_50 = param_1;
local_20 = fopen(param_3,"r");
plVar6 = &local_68;
if (local_20 != (FILE *)0x0) {
LAB_00101b8c:
*(undefined8 *)((long)plVar5 + -8) = 0x101ba3;
_Var4 = getline(&local_38,&local_30,local_20);
if (_Var4 != -1) {
local_3c = local_3c + 1;
if (1000 < local_3c) {
*(char **)((long)plVar5 + -8) = local_60;
*(char **)((long)plVar5 + -0x10) = "Too many lines in environment file %s";
*(undefined8 *)((long)plVar5 + -0x18) = 0x101a92;
sshfatal("session.c","read_environment_file",0x35b,0,1,0);
plVar5 = (long *)((long)plVar5 + -0x10);
}
for (local_28 = local_38; (*local_28 == ' ' || (*local_28 == '\t')); local_28 = local_28 + 1)
{
}
if (((*local_28 != '\0') && (*local_28 != '#')) && (*local_28 != '\n')) {
*(undefined8 *)((long)plVar5 + -8) = 0x101af8;
sVar3 = strcspn(local_28,"\n");
local_28[sVar3] = '\0';
*(undefined8 *)((long)plVar5 + -8) = 0x101b13;
local_18 = strchr(local_28,0x3d);
lVar1 = local_68;
if (local_18 != (char *)0x0) {
*local_18 = '\0';
local_18 = local_18 + 1;
if (local_68 != 0) {
*(undefined8 *)((long)plVar5 + -8) = 0x101b6d;
iVar2 = match_pattern_list(local_28,lVar1,0);
if (iVar2 != 1) goto LAB_00101b8c;
}
*(undefined8 *)((long)plVar5 + -8) = 0x101b8c;
child_set_env(local_50,local_58,local_28,local_18);
goto LAB_00101b8c;
}
*(undefined8 *)((long)plVar5 + -8) = 0x101b40;
fprintf(stderr,"Bad line %u in %.100s\n",(ulong)local_3c,local_60);
}
goto LAB_00101b8c;
}
*(undefined8 *)((long)plVar5 + -8) = 0x101bb9;
free(local_38);
*(undefined8 *)((long)plVar5 + -8) = 0x101bc5;
fclose(local_20);
plVar6 = plVar5;
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
*(undefined8 *)((long)plVar6 + -8) = 0x101bdc;
__stack_chk_fail();
}
|
(r = sshbuf_get_stringb(e->request, data)) != 0 ||
(r = sshbuf_get_u32(e->request, &flags)) != 0) {
sshlog("ssh-agent.c", __func__, 743, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "parse");
goto send;
}
| void sshbuf_get_stringb(void)
{
halt_baddata();
}
|
static void iptunnel_print_help(struct link_util *lu, int argc, char **argv,
FILE *f)
{
const char *mode;
if (strcmp(lu->id, "sit") == 0) {
mode = "{ ip6ip | ipip | mplsip | any } ]\n"
" [ isatap";
} else {
mode = "{ ipip | mplsip | any }";
}
fprintf(f,
"Usage: ... %-6s [ remote ADDR ]\n"
" [ local ADDR ]\n"
" [ ttl TTL ]\n"
" [ tos TOS ]\n"
" [ [no]pmtudisc ]\n"
" [ 6rd-prefix ADDR ]\n"
" [ 6rd-relay_prefix ADDR ]\n"
" [ 6rd-reset ]\n"
" [ dev PHYS_DEV ]\n"
" [ fwmark MARK ]\n"
" [ external ]\n"
" [ noencap ]\n"
" [ encap { fou | gue | none } ]\n"
" [ encap-sport PORT ]\n"
" [ encap-dport PORT ]\n"
" [ [no]encap-csum ]\n"
" [ [no]encap-csum6 ]\n"
" [ [no]encap-remcsum ]\n"
" [ mode %s ]\n"
"\n"
"Where: ADDR := { IP_ADDRESS | any }\n"
" TOS := { NUMBER | inherit }\n"
" TTL := { 1..255 | inherit }\n"
" MARK := { 0x0..0xffffffff }\n",
lu->id, mode);
}
| int iptunnel_print_help(long a1, long a2, long a3, FILE *a4)
{
if ( !strcmp(*(const char **)(a1 + 8), "sit") )
return fprintf(
a4,
"Usage: ... %-6s\t[ remote ADDR ]\n"
"\t\t\t[ local ADDR ]\n"
"\t\t\t[ ttl TTL ]\n"
"\t\t\t[ tos TOS ]\n"
"\t\t\t[ [no]pmtudisc ]\n"
"\t\t\t[ 6rd-prefix ADDR ]\n"
"\t\t\t[ 6rd-relay_prefix ADDR ]\n"
"\t\t\t[ 6rd-reset ]\n"
"\t\t\t[ dev PHYS_DEV ]\n"
"\t\t\t[ fwmark MARK ]\n"
"\t\t\t[ external ]\n"
"\t\t\t[ noencap ]\n"
"\t\t\t[ encap { fou | gue | none } ]\n"
"\t\t\t[ encap-sport PORT ]\n"
"\t\t\t[ encap-dport PORT ]\n"
"\t\t\t[ [no]encap-csum ]\n"
"\t\t\t[ [no]encap-csum6 ]\n"
"\t\t\t[ [no]encap-remcsum ]\n"
"\t\t\t[ mode %s ]\n"
"\n"
"Where:\tADDR := { IP_ADDRESS | any }\n"
"\tTOS := { NUMBER | inherit }\n"
"\tTTL := { 1..255 | inherit }\n"
"\tMARK := { 0x0..0xffffffff }\n",
*(const char **)(a1 + 8),
"{ ip6ip | ipip | mplsip | any } ]\n\t\t\t[ isatap");
else
return fprintf(
a4,
"Usage: ... %-6s\t[ remote ADDR ]\n"
"\t\t\t[ local ADDR ]\n"
"\t\t\t[ ttl TTL ]\n"
"\t\t\t[ tos TOS ]\n"
"\t\t\t[ [no]pmtudisc ]\n"
"\t\t\t[ 6rd-prefix ADDR ]\n"
"\t\t\t[ 6rd-relay_prefix ADDR ]\n"
"\t\t\t[ 6rd-reset ]\n"
"\t\t\t[ dev PHYS_DEV ]\n"
"\t\t\t[ fwmark MARK ]\n"
"\t\t\t[ external ]\n"
"\t\t\t[ noencap ]\n"
"\t\t\t[ encap { fou | gue | none } ]\n"
"\t\t\t[ encap-sport PORT ]\n"
"\t\t\t[ encap-dport PORT ]\n"
"\t\t\t[ [no]encap-csum ]\n"
"\t\t\t[ [no]encap-csum6 ]\n"
"\t\t\t[ [no]encap-remcsum ]\n"
"\t\t\t[ mode %s ]\n"
"\n"
"Where:\tADDR := { IP_ADDRESS | any }\n"
"\tTOS := { NUMBER | inherit }\n"
"\tTTL := { 1..255 | inherit }\n"
"\tMARK := { 0x0..0xffffffff }\n",
*(const char **)(a1 + 8),
"{ ipip | mplsip | any }");
}
|
static int ipoib_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
__u16 pkey, mode, umcast;
while (argc > 0) {
if (matches(*argv, "pkey") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u16(&pkey, *argv, 0))
invarg("pkey is invalid", *argv);
addattr_l(n, 1024, IFLA_IPOIB_PKEY, &pkey, 2);
} else if (matches(*argv, "mode") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (strcmp(*argv, "datagram") == 0)
mode = IPOIB_MODE_DATAGRAM;
else if (strcmp(*argv, "connected") == 0)
mode = IPOIB_MODE_CONNECTED;
else
return mode_arg();
addattr_l(n, 1024, IFLA_IPOIB_MODE, &mode, 2);
} else if (matches(*argv, "umcast") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u16(&umcast, *argv, 0))
invarg("umcast is invalid", *argv);
addattr_l(n, 1024, IFLA_IPOIB_UMCAST, &umcast, 2);
} else if (matches(*argv, "help") == 0) {
explain();
return -1;
} else {
fprintf(
stderr
, "ipoib: unknown option \"%s\"?\n", *argv);
explain();
return -1;
}
argc--, argv++;
}
return 0;
}
| undefined8 ipoib_parse_opt(undefined8 param_1,int param_2,undefined8 *param_3,undefined8 param_4)
{
char cVar1;
int iVar2;
undefined8 uVar3;
long in_FS_OFFSET;
undefined8 *local_30;
int local_24;
undefined local_16 [2];
undefined2 local_14;
undefined local_12 [2];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_30 = param_3;
local_24 = param_2;
do {
if (local_24 < 1) {
uVar3 = 0;
LAB_0010031a:
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar3;
}
cVar1 = matches(*local_30,&DAT_00100654);
if (cVar1 == '\x01') {
cVar1 = matches(*local_30,&DAT_00100669);
if (cVar1 == '\x01') {
cVar1 = matches(*local_30,"umcast");
if (cVar1 == '\x01') {
cVar1 = matches(*local_30,&DAT_0010069a);
if (cVar1 == '\x01') {
fprintf(stderr,"ipoib: unknown option \"%s\"?\n",*local_30);
explain();
uVar3 = 0xffffffff;
}
else {
explain();
uVar3 = 0xffffffff;
}
goto LAB_0010031a;
}
if (local_24 + -1 < 1) {
incomplete_command();
}
iVar2 = get_u16(local_12,local_30[1],0);
if (iVar2 != 0) {
invarg("umcast is invalid",local_30[1]);
}
addattr_l(param_4,0x400,3,local_12,2);
}
else {
if (local_24 + -1 < 1) {
incomplete_command();
}
iVar2 = strcmp((char *)local_30[1],"datagram");
if (iVar2 == 0) {
local_14 = 0;
}
else {
iVar2 = strcmp((char *)local_30[1],"connected");
if (iVar2 != 0) {
uVar3 = mode_arg();
goto LAB_0010031a;
}
local_14 = 1;
}
addattr_l(param_4,0x400,2,&local_14,2);
}
}
else {
if (local_24 + -1 < 1) {
incomplete_command();
}
iVar2 = get_u16(local_16,local_30[1],0);
if (iVar2 != 0) {
invarg("pkey is invalid",local_30[1]);
}
addattr_l(param_4,0x400,1,local_16,2);
}
local_24 = local_24 + -2;
local_30 = local_30 + 2;
} while( true );
}
|
ARRAY *
save_pipestatus_array ()
{
SHELL_VAR *v;
ARRAY *a;
v = find_variable ("PIPESTATUS");
if (v == 0 || ((((v)->attributes) & (0x0000004))) == 0 || (ARRAY *)((v)->value) == 0)
return ((ARRAY *)
((void *)0)
);
a = array_copy ((ARRAY *)((v)->value));
return a;
}
| long long save_pipestatus_array() {
struct_0 *v0;
unsigned long long v1;
void* v3;
v0 = find_variable("PIPESTATUS");
if (v0 && (v0->field_28 & 4) && v0->field_8) {
v1 = array_copy(v0->field_8);
v3 = v1;
}
if (!v0->field_8 || !v0 || !(v0->field_28 & 4))
v3 = 0;
return v3;
}
|
static
_Bool
count_items (__attribute__ ((__unused__)) struct item *unused)
{
n_strings++;
return
0
;
}
| long long count_items(unsigned long a0) {
unsigned long v0;
v0 = a0;
n_strings = n_strings + 1;
return 0;
}
|
wchar_t *
glob_patscan_wc (string, end, delim)
wchar_t *string, *end;
wint_t delim;
{
int pnest, bnest, skip;
wint_t cchar;
wchar_t *s, c, *bfirst;
pnest = bnest = skip = 0;
cchar = 0;
bfirst =
((void *)0)
;
if (string == end)
return (
((void *)0)
);
for (s = string; c = *s; s++)
{
if (s >= end)
return (s);
if (skip)
{
skip = 0;
continue;
}
switch (c)
{
case L'\\':
skip = 1;
break;
case L'\0':
return ((wchar_t *)
((void *)0)
);
case L'[':
if (bnest == 0)
{
bfirst = s + 1;
if (*bfirst == L'!' || *bfirst == L'^')
bfirst++;
bnest++;
}
else if (s[1] == L':' || s[1] == L'.' || s[1] == L'=')
cchar = s[1];
break;
case L']':
if (bnest)
{
if (cchar && s[-1] == cchar)
cchar = 0;
else if (s != bfirst)
{
bnest--;
bfirst = 0;
}
}
break;
case L'(':
if (bnest == 0)
pnest++;
break;
case L')':
if (bnest == 0 && pnest-- <= 0)
return ++s;
break;
case L'|':
if (bnest == 0 && pnest == 0 && delim == L'|')
return ++s;
break;
}
}
return (
((void *)0)
);
}
| int * glob_patscan_wc(int *a1, int *a2, int a3)
{
int v4;
int v5;
int v6;
int v7;
int v8;
int v9;
int *i;
int *v11;
v7 = 0;
v6 = 0;
v5 = 0;
v8 = 0;
v11 = 0LL;
if ( a1 == a2 )
return 0LL;
for ( i = a1; ; ++i )
{
v9 = *i;
if ( !*i )
break;
if ( i >= a2 )
return i;
if ( v7 )
{
v7 = 0;
}
else if ( v9 == 124 )
{
if ( !v6 && !v5 && a3 == 124 )
return i + 1;
}
else if ( v9 <= 124 )
{
if ( v9 == 93 )
{
if ( v6 )
{
if ( v8 && v8 == *(i - 1) )
{
v8 = 0;
}
else if ( i != v11 )
{
--v6;
v11 = 0LL;
}
}
}
else if ( v9 <= 93 )
{
switch ( v9 )
{
case '\\':
v7 = 1;
break;
case '[':
if ( v6 )
{
if ( i[1] == 58 || i[1] == 46 || i[1] == 61 )
v8 = i[1];
}
else
{
v11 = i + 1;
if ( i[1] == 33 || *v11 == 94 )
v11 = i + 2;
v6 = 1;
}
break;
case ')':
if ( !v6 )
{
v4 = v5--;
if ( v4 <= 0 )
return i + 1;
}
break;
default:
if ( v9 <= 41 )
{
if ( !v9 )
return 0LL;
if ( v9 == 40 && !v6 )
++v5;
}
break;
}
}
}
}
return 0LL;
}
|
int
rl_delete_horizontal_space (int count, int ignore)
{
int start;
while (rl_point && (((rl_line_buffer[rl_point - 1]) == ' ') || ((rl_line_buffer[rl_point - 1]) == '\t')))
rl_point--;
start = rl_point;
while (rl_point < rl_end && (((rl_line_buffer[rl_point]) == ' ') || ((rl_line_buffer[rl_point]) == '\t')))
rl_point++;
if (start != rl_point)
{
rl_delete_text (start, rl_point);
rl_point = start;
}
if (rl_point < 0)
rl_point = 0;
return 0;
}
| long long rl_delete_horizontal_space(unsigned long a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
v1 = a0;
for (v0 = a1; rl_point; rl_point = rl_point - 1) {
if (*((rl_line_buffer + rl_point - 1)) != 32) {
if (*((rl_line_buffer + rl_point - 1)) != 9)
break;
}
}
for (v2 = rl_point; rl_point < rl_end; rl_point = rl_point + 1) {
if (*((rl_point + rl_line_buffer)) != 32) {
if (*((rl_point + rl_line_buffer)) != 9)
break;
}
}
if (v2 != rl_point) {
rl_delete_text(v2, rl_point);
rl_point = v2;
}
if (rl_point < 0)
rl_point = 0;
return 0;
}
|
void *
growstackstr(void)
{
size_t len = stacknleft;
growstackblock(0);
return ((void *)stacknxt) + len;
}
| long long growstackstr() {
unsigned long v0;
v0 = stacknleft;
growstackblock(0x0);
return v0 + stacknxt;
}
|
int
mailstat(path, st)
const char *path;
struct stat *st;
{
static struct stat st_new_last, st_ret_last;
struct stat st_ret, st_tmp;
DIR *dd;
struct dirent *fn;
char dir[
4096
* 2], file[
4096
* 2 + 1];
int i, l;
time_t atime, mtime;
atime = mtime = 0;
if ((i = stat(path, st)) != 0 ||
((((
st->st_mode
)) & 0170000) == (0040000))
== 0)
return i;
if (strlen(path) > sizeof(dir) - 5)
{
(*__errno_location ())
=
36
;
return -1;
}
st_ret = *st;
st_ret.st_nlink = 1;
st_ret.st_size = 0;
st_ret.st_blocks = 0;
st_ret.st_mode &= ~
0040000
;
st_ret.st_mode |=
0100000
;
sprintf(dir, "%s/cur", path);
if (stat(dir, &st_tmp) ||
((((
st_tmp.st_mode
)) & 0170000) == (0040000))
== 0)
return 0;
st_ret.
st_atim.tv_sec
= st_tmp.
st_atim.tv_sec
;
sprintf(dir, "%s/tmp", path);
if (stat(dir, &st_tmp) ||
((((
st_tmp.st_mode
)) & 0170000) == (0040000))
== 0)
return 0;
st_ret.
st_mtim.tv_sec
= st_tmp.
st_mtim.tv_sec
;
sprintf(dir, "%s/new", path);
if (stat(dir, &st_tmp) ||
((((
st_tmp.st_mode
)) & 0170000) == (0040000))
== 0)
return 0;
st_ret.
st_mtim.tv_sec
= st_tmp.
st_mtim.tv_sec
;
if (st_tmp.st_dev == st_new_last.st_dev &&
st_tmp.st_ino == st_new_last.st_ino &&
st_tmp.
st_atim.tv_sec
== st_new_last.
st_atim.tv_sec
&&
st_tmp.
st_mtim.tv_sec
== st_new_last.
st_mtim.tv_sec
)
{
*st = st_ret_last;
return 0;
}
st_new_last = st_tmp;
for (i = 0; i < 2; i++)
{
sprintf(dir, "%s/%s", path, i ? "cur" : "new");
sprintf(file, "%s/", dir);
l = strlen(file);
if ((dd = opendir(dir)) ==
((void *)0)
)
return 0;
while ((fn = readdir(dd)) !=
((void *)0)
)
{
if (fn->d_name[0] == '.' || strlen(fn->d_name) + l >= sizeof(file))
continue;
strcpy(file + l, fn->d_name);
if (stat(file, &st_tmp) != 0)
continue;
st_ret.st_size += st_tmp.st_size;
st_ret.st_blocks++;
if (st_tmp.
st_atim.tv_sec
!= st_tmp.
st_mtim.tv_sec
&& st_tmp.
st_atim.tv_sec
> atime)
atime = st_tmp.
st_atim.tv_sec
;
if (st_tmp.
st_mtim.tv_sec
> mtime)
mtime = st_tmp.
st_mtim.tv_sec
;
}
closedir(dd);
}
st_ret.
st_atim.tv_sec
= atime;
if (mtime)
st_ret.
st_mtim.tv_sec
= mtime;
*st = st_ret_last = st_ret;
return 0;
}
| int mailstat() {
unsigned int v0;
int tmp_178;
int tmp_182;
int tmp_187;
unsigned int v1;
unsigned long long v2;
void* v3;
unsigned long long v4;
struct_1 *v5;
unsigned long long v6;
unsigned long long v7;
unsigned long v8;
unsigned int v9;
unsigned long long v10;
unsigned long long v11;
void* v12;
unsigned long long v13;
void* v14;
unsigned long long v15;
unsigned long long v16;
unsigned long long v17;
unsigned long long v18;
unsigned long long v19;
unsigned long long v20;
unsigned long long v21;
unsigned long long v22;
unsigned long long 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;
char v36;
char v37;
char v38;
char v39;
char v40;
char v41;
char v42;
char v43;
char v44;
char v45;
unsigned long v46;
unsigned long v47;
char v49;
char v50;
unsigned long v51;
unsigned long long *v52;
char *v53;
struct_0 *v54;
unsigned long long v56;
unsigned long long v57;
unsigned int v60;
struct_0 *v63;
unsigned long long v64;
unsigned long long v65;
v47 = v51;
do {
v45 = *(&v45);
} while (&v45 != &v43);
v46 = v52[5];
v3 = 0;
v2 = v3;
v0 = stat(v53, v54);
if (!v0 && (*(&v54->field_18) & 0xf000) == 0x4000) {
if (strlen(v53) > 8187) {
*(__errno_location()) = 36;
} else {
v6 = v54->field_0;
v7 = v54->field_8;
v8 = v54->field_10;
v9 = *(&v54->field_18);
v10 = v54->field_20;
v11 = v54->field_28;
v12 = v54->field_30;
v13 = v54->field_38;
v14 = v54->field_40;
v15 = v54->field_48;
v16 = v54->field_50;
v17 = v54->field_58;
v18 = v54->field_60;
v19 = v54->field_68;
v20 = v54->field_70;
v21 = v54->field_78;
v22 = v54->field_80;
v23 = v54->field_88;
v8 = 1;
v12 = 0;
v14 = 0;
v56 = v9;
*(&v56) = (v9 >> 8) & 191;
tmp_178 = v56;
v9 = tmp_178;
tmp_182 = v9;
v57 = tmp_182;
*(&v57) = v57 | 128;
tmp_187 = v57;
v9 = tmp_187;
sprintf(&v42, "%s/cur", v53);
if (!stat(&v42, &v24) && (*(&v27) & 0xf000) == 0x4000) {
v15 = *(&v33);
sprintf(&v42, "%s/tmp", v53);
if (!stat(&v42, &v24) && (*(&v27) & 0xf000) == 0x4000) {
v17 = *(&v35);
sprintf(&v42, "%s/new", v53);
v60 = stat(&v42, &v24);
if (!v60 && (*(&v27) & 0xf000) == 0x4000) {
v17 = *(&v35);
if (*(&v24) == st_new_last.4794 && *(&v25) == g_400968 && *(&v33) == g_4009a8 && *(&v35) == g_4009b8) {
v54->field_0 = st_ret_last.4795;
v54->field_8 = g_400a08;
v54->field_10 = g_400a10;
*(&v54->field_18) = g_400a18;
v54->field_20 = g_400a20;
v54->field_28 = g_400a28;
v54->field_30 = g_400a30;
v54->field_38 = g_400a38;
v54->field_40 = g_400a40;
v54->field_48 = g_400a48;
v54->field_50 = g_400a50;
v54->field_58 = g_400a58;
v54->field_60 = g_400a60;
v54->field_68 = g_400a68;
v54->field_70 = g_400a70;
v54->field_78 = g_400a78;
v54->field_80 = g_400a80;
v54->field_88 = g_400a88;
}
if (*(&v35) != g_4009b8 || *(&v33) != g_4009a8 || *(&v24) != st_new_last.4794 || *(&v25) != g_400968) {
st_new_last.4794 = *(&v24);
g_400968 = *(&v25);
g_400970 = *(&v26);
g_400978 = *(&v27);
g_400980 = *(&v28);
g_400988 = *(&v29);
g_400990 = *(&v30);
g_400998 = *(&v31);
g_4009a0 = *(&v32);
g_4009a8 = *(&v33);
g_4009b0 = *(&v34);
g_4009b8 = *(&v35);
g_4009c0 = *(&v36);
g_4009c8 = *(&v37);
g_4009d0 = *(&v38);
g_4009d8 = *(&v39);
g_4009e0 = *(&v40);
g_4009e8 = *(&v41);
v0 = 0;
while (true) {
if (v0 <= 1) {
if (v0)
v60 = "cur";
else
v60 = &g_400aa9;
sprintf(&v42, "%s/%s", v53, v60);
sprintf(&v44, "%s/", &v42);
v1 = strlen(&v44);
v4 = opendir(&v42);
if (!v4) {
break;
} else {
while (true) {
v5 = readdir(v4);
if (v5) {
if (v5->field_13 == 46)
continue;
if (strlen(&v5->field_13) + v1 > 0x2000)
continue;
strcpy(&(&v44)[v1], &v5->field_13);
if (stat(&v44, &v24))
continue;
v12 = *(&v30) + v12;
v14 += 1;
if (*(&v33) != *(&v35) && v2 < *(&v33))
v2 = *(&v33);
if (v3 >= *(&v35))
continue;
v3 = *(&v35);
} else {
closedir(v4);
v0 += 1;
break;
}
}
}
} else {
v15 = v2;
if (v3)
v17 = v3;
st_ret_last.4795 = v6;
g_400a08 = v7;
g_400a10 = v8;
g_400a18 = v9;
g_400a20 = v10;
g_400a28 = v11;
g_400a30 = v12;
g_400a38 = v13;
g_400a40 = v14;
g_400a48 = v15;
g_400a50 = v16;
g_400a58 = v17;
g_400a60 = v18;
g_400a68 = v19;
g_400a70 = v20;
g_400a78 = v21;
g_400a80 = v22;
g_400a88 = v23;
v63 = v54;
v54->field_0 = st_ret_last.4795;
v54->field_8 = g_400a08;
v54->field_10 = g_400a10;
*(&v54->field_18) = g_400a18;
v54->field_20 = g_400a20;
v54->field_28 = g_400a28;
v54->field_30 = g_400a30;
v54->field_38 = g_400a38;
v54->field_40 = g_400a40;
v54->field_48 = g_400a48;
v54->field_50 = g_400a50;
v54->field_58 = g_400a58;
v63->field_60 = g_400a60;
v63->field_68 = g_400a68;
v63->field_70 = g_400a70;
v63->field_78 = g_400a78;
v63->field_80 = g_400a80;
v63->field_88 = g_400a88;
break;
}
}
}
}
}
}
}
}
if ((v46 ^ v52[5]))
__stack_chk_fail();
v64 = *(&v49);
v65 = *(&v50);
return;
}
|
static void
factor_insert_large (struct factors *factors,
uintmax_t p1, uintmax_t p0)
{
if (p1 > 0)
{
((void) sizeof ((
factors->plarge[1] == 0
) ? 1 : 0), __extension__ ({ if (
factors->plarge[1] == 0
) ; else __assert_fail (
"factors->plarge[1] == 0"
, "src/factor.c", 558, __extension__ __PRETTY_FUNCTION__); }))
;
factors->plarge[0] = p0;
factors->plarge[1] = p1;
}
else
factor_insert_multiplicity (factors, p0, 1);
}
| void factor_insert_large(undefined8 *param_1,long param_2,undefined8 param_3)
{
if (param_2 == 0) {
factor_insert_multiplicity(param_1,param_3,1);
}
else {
if (param_1[1] != 0) {
__assert_fail("factors->plarge[1] == 0","src/factor.c",0x22e,"factor_insert_large");
}
*param_1 = param_3;
param_1[1] = param_2;
}
return;
}
|
void print_cert_info2(gnutls_session_t session, int verbose, FILE *out, int print_cert)
{
int flag, print_crt_status = 0;
if (verbose)
flag = GNUTLS_CRT_PRINT_FULL;
else
flag = GNUTLS_CRT_PRINT_COMPACT;
if (gnutls_certificate_client_get_request_status(session) != 0) {
log_msg(
stdout
, "- Server has requested a certificate.\n");
print_crt_status = 1;
}
switch (gnutls_certificate_type_get2(session, GNUTLS_CTYPE_PEERS)) {
case GNUTLS_CRT_X509:
print_x509_info(session, out, flag, print_cert, print_crt_status);
break;
case GNUTLS_CRT_RAWPK:
print_rawpk_info(session, out, flag, print_cert, print_crt_status);
break;
default:
break;
}
}
| void print_cert_info2(unsigned long long a0, unsigned long a1, unsigned long long a2, unsigned long a3) {
unsigned int v0;
unsigned int v1;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
v1 = 0;
if (a1)
v0 = 0;
else
v0 = 3;
if (gnutls_certificate_client_get_request_status(a0)) {
log_msg();
v1 = 1;
}
v3 = gnutls_certificate_type_get2(a0, 0x3);
if (v3 == 1) {
v4 = print_x509_info(a0, a2, v0, a3, v1);
} else if (v3 == 3) {
v5 = print_rawpk_info(a0, a2, v0, a3, v1);
}
return;
}
|
static void
process_rename(u_int32_t id)
{
char *oldpath, *newpath;
int r, status;
struct stat sb;
if ((r = sshbuf_get_cstring(iqueue, &oldpath,
((void *)0)
)) != 0 ||
(r = sshbuf_get_cstring(iqueue, &newpath,
((void *)0)
)) != 0)
sshfatal("sftp-server.c", __func__, 1276, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse");
sshlog("sftp-server.c", __func__, 1278, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "request %u: rename", id);
sshlog("sftp-server.c", __func__, 1279, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "rename old \"%s\" new \"%s\"", oldpath, newpath);
status = 4;
if (lstat(oldpath, &sb) == -1)
status = errno_to_portable(
(*__errno_location ())
);
else if (
((((
sb.st_mode
)) & 0170000) == (0100000))
) {
if (link(oldpath, newpath) == -1) {
if (
(*__errno_location ())
==
95
||
(*__errno_location ())
==
38
||
(*__errno_location ())
==
18
||
(*__errno_location ())
==
1
) {
struct stat st;
if (stat(newpath, &st) == -1) {
if (rename(oldpath, newpath) == -1)
status =
errno_to_portable(
(*__errno_location ())
);
else
status = 0;
}
} else {
status = errno_to_portable(
(*__errno_location ())
);
}
} else if (unlink(oldpath) == -1) {
status = errno_to_portable(
(*__errno_location ())
);
unlink(newpath);
} else
status = 0;
} else if (stat(newpath, &sb) == -1) {
if (rename(oldpath, newpath) == -1)
status = errno_to_portable(
(*__errno_location ())
);
else
status = 0;
}
send_status(id, status);
free(oldpath);
free(newpath);
}
| long long process_rename(unsigned long a0) {
unsigned long long v0;
unsigned int v1;
unsigned int v2;
char v3;
char v4;
char v5;
char v6;
char v7;
unsigned long long v8;
unsigned long long v9;
char v10;
v1 = sshbuf_get_cstring(0xe87d894820ec8348, &v3, 0x0, &v3);
if (!v1) {
v1 = sshbuf_get_cstring(0xe87d894820ec8348, &v4, 0x0, &v4);
if (!v1)
goto LABEL_40433e;
}
v0 = "parse";
sshfatal("sftp-server.c", "process_rename", 0x4fc, 0x1, 0x1, ssh_err(v1));
LABEL_40433e:
v9 = a0;
v8 = "request %u: rename";
sshlog("sftp-server.c", "process_rename", 0x4fe, 0x0, 0x7, 0x0, *(&v10));
v10 = *(&v4);
v9 = *(&v3);
v8 = "rename old \"%s\" new \"%s\"";
sshlog("sftp-server.c", "process_rename", 0x4ff, 0x0, 0x3, 0x0, *(&v4));
v2 = 4;
if (lstat(*(&v3), &v5) == -1) {
v2 = errno_to_portable(*(__errno_location()));
} else if ((*(&v6) & 0xf000) != 0x8000) {
if (stat(*(&v4), &v5) == -1) {
if (rename(*(&v3), *(&v4)) != -1)
v2 = 0;
else
v2 = errno_to_portable(*(__errno_location()));
}
} else {
if (link(*(&v3), *(&v4)) != -1) {
if (unlink(*(&v3)) != -1) {
v2 = 0;
} else {
v2 = errno_to_portable(*(__errno_location()));
unlink(*(&v4));
}
} else {
if (*(__errno_location()) == 95) {
LABEL_404476:
if (stat(*(&v4), &v7) == -1) {
if (rename(*(&v3), *(&v4)) != -1)
v2 = 0;
else
v2 = errno_to_portable(*(__errno_location()));
}
} else {
if (*(__errno_location()) == 38)
goto LABEL_404476;
if (*(__errno_location()) == 18)
goto LABEL_404476;
if (*(__errno_location()) == 1)
goto LABEL_404476;
v2 = errno_to_portable(*(__errno_location()));
}
}
}
send_status(a0, v2);
free(*(&v3));
free(*(&v4));
return 0;
}
|
char *
get_dollar_var_value (ind)
intmax_t ind;
{
char *temp;
WORD_LIST *p;
if (ind < 10)
temp = dollar_vars[ind] ? (char *)strcpy (sh_xmalloc((1 + strlen (dollar_vars[ind])), "subst.c", 3724), (dollar_vars[ind])) : (char *)
((void *)0)
;
else
{
ind -= 10;
for (p = rest_of_args; p && ind--; p = p->next)
;
temp = p ? (char *)strcpy (sh_xmalloc((1 + strlen (p->word->word)), "subst.c", 3730), (p->word->word)) : (char *)
((void *)0)
;
}
return (temp);
}
| int get_dollar_var_value(unsigned long a0) {
unsigned long long v0;
void* v1;
struct_0 *v2;
void* v4;
unsigned long long v5;
void* v6;
v0 = a0;
if (v0 <= 9) {
if (!*((0x8 * &v0->padding_0[0] + &dollar_vars[0])))
v4 = 0;
else
v4 = strcpy(sh_xmalloc(strlen(*((0x8 * &v0->padding_0[0] + &dollar_vars[0]))) + 1, "subst.c", 0xe8c), *((0x8 * &v0->padding_0[0] + &dollar_vars[0])));
v1 = v4;
} else {
v0 = &v0->padding_0[10];
v2 = rest_of_args;
while (true) {
if (!v2)
break;
v5 = v0;
v0 -= 1;
if (!v5)
break;
v2 = v2->field_0;
}
if (!v2)
v6 = 0;
else
v6 = strcpy(sh_xmalloc(strlen(v2->field_8->field_0) + 1, "subst.c", 0xe92), v2->field_8->field_0);
v1 = v6;
}
return v1;
}
|
static int do_switch(void *arg)
{
char *netns = arg;
vrf_reset();
return netns_switch(netns);
}
| long long do_switch(unsigned long long a0) {
vrf_reset();
return netns_switch(a0);
}
|
(strstr ( progName, "zcat" ) != 0) ||
(strstr ( progName, "ZCAT" ) != 0) ) {
opMode = 2;
srcMode = (numFileNames == 0) ? 1 : 2;
}
| char * strstr(char *__haystack,char *__needle)
{
halt_baddata();
}
|
static void print_tunnel(const struct l2tp_data *data)
{
const struct l2tp_parm *p = &data->config;
char buf[
46
];
open_json_object(
((void *)0)
);
print_uint(PRINT_ANY, "tunnel_id", "Tunnel %u,", p->tunnel_id);
print_string(PRINT_ANY, "encap", " encap %s",
p->encap == L2TP_ENCAPTYPE_UDP ? "UDP" :
p->encap == L2TP_ENCAPTYPE_IP ? "IP" : "??");
print_nl();
print_string(PRINT_ANY, "local", " From %s ",
inet_ntop(p->local_ip.family, p->local_ip.data,
buf, sizeof(buf)));
print_string(PRINT_ANY, "peer", "to %s",
inet_ntop(p->peer_ip.family, p->peer_ip.data,
buf, sizeof(buf)));
print_nl();
print_uint(PRINT_ANY, "peer_tunnel", " Peer tunnel %u",
p->peer_tunnel_id);
print_nl();
if (p->encap == L2TP_ENCAPTYPE_UDP) {
print_string(PRINT_FP,
((void *)0)
,
" UDP source / dest ports:",
((void *)0)
);
print_hu(PRINT_ANY, "local_port", " %hu",
p->local_udp_port);
print_hu(PRINT_ANY, "peer_port", "/%hu",
p->peer_udp_port);
print_nl();
switch (p->local_ip.family) {
case
2
:
print_bool(PRINT_JSON, "checksum",
((void *)0)
, p->udp_csum);
print_string(PRINT_FP,
((void *)0)
,
" UDP checksum: %s\n",
p->udp_csum ? "enabled" : "disabled");
break;
case
10
:
if (is_json_context()) {
print_bool(PRINT_JSON, "checksum_tx",
((void *)0)
, p->udp6_csum_tx);
print_bool(PRINT_JSON, "checksum_rx",
((void *)0)
, p->udp6_csum_rx);
} else {
printf(" UDP checksum: %s%s%s%s\n",
p->udp6_csum_tx && p->udp6_csum_rx
? "enabled" : "",
p->udp6_csum_tx && !p->udp6_csum_rx
? "tx" : "",
!p->udp6_csum_tx && p->udp6_csum_rx
? "rx" : "",
!p->udp6_csum_tx && !p->udp6_csum_rx
? "disabled" : "");
}
break;
}
}
close_json_object();
}
| unsigned long print_tunnel(long a1)
{
const char *v1;
const char *v2;
const char *v3;
int v4;
const char *v5;
const char *v6;
const char *v7;
const char *v8;
const char *v9;
char buf[56];
unsigned long v12;
v12 = __readfsqword(0x28u);
open_json_object(0LL);
print_uint(4u, (long)"tunnel_id", (long)"Tunnel %u,", *(_DWORD *)a1);
if ( *(_DWORD *)(a1 + 16) )
{
if ( *(_DWORD *)(a1 + 16) == 1 )
v1 = "IP";
else
v1 = "??";
}
else
{
v1 = "UDP";
}
print_string(4u, (long)"encap", " encap %s", (long)v1);
print_nl();
v2 = inet_ntop(*(unsigned short *)(a1 + 54), (const void *)(a1 + 56), buf, 0x2Eu);
print_string(4u, (long)"local", " From %s ", (long)v2);
v3 = inet_ntop(*(unsigned short *)(a1 + 318), (const void *)(a1 + 320), buf, 0x2Eu);
print_string(4u, (long)"peer", "to %s", (long)v3);
print_nl();
print_uint(4u, (long)"peer_tunnel", (long)" Peer tunnel %u", *(_DWORD *)(a1 + 4));
print_nl();
if ( !*(_DWORD *)(a1 + 16) )
{
print_string(1u, 0LL, " UDP source / dest ports:", 0LL);
print_hu(4u, (long)"local_port", (long)" %hu", *(_WORD *)(a1 + 20));
print_hu(4u, (long)"peer_port", (long)"/%hu", *(_WORD *)(a1 + 22));
print_nl();
v4 = *(unsigned short *)(a1 + 54);
if ( v4 == 2 )
{
print_bool(2u, (long)"checksum", 0LL, (*(_BYTE *)(a1 + 578) & 4) != 0);
if ( (*(_BYTE *)(a1 + 578) & 4) != 0 )
v5 = "enabled";
else
v5 = "disabled";
print_string(1u, 0LL, " UDP checksum: %s\n", (long)v5);
}
else if ( v4 == 10 )
{
if ( (unsigned char)is_json_context() )
{
print_bool(2u, (long)"checksum_tx", 0LL, (*(_BYTE *)(a1 + 578) & 1) != 0);
print_bool(2u, (long)"checksum_rx", 0LL, (*(_BYTE *)(a1 + 578) & 2) != 0);
}
else
{
if ( (*(_BYTE *)(a1 + 578) & 1) != 0 || (*(_BYTE *)(a1 + 578) & 2) != 0 )
v6 = (const char *)&unk_2F11;
else
v6 = "disabled";
if ( (*(_BYTE *)(a1 + 578) & 1) != 0 || (*(_BYTE *)(a1 + 578) & 2) == 0 )
v7 = (const char *)&unk_2F11;
else
v7 = "rx";
if ( (*(_BYTE *)(a1 + 578) & 1) == 0 || (*(_BYTE *)(a1 + 578) & 2) != 0 )
v8 = (const char *)&unk_2F11;
else
v8 = "tx";
if ( (*(_BYTE *)(a1 + 578) & 1) != 0 && (*(_BYTE *)(a1 + 578) & 2) != 0 )
v9 = "enabled";
else
v9 = (const char *)&unk_2F11;
printf(" UDP checksum: %s%s%s%s\n", v9, v8, v7, v6);
}
}
}
close_json_object();
return __readfsqword(0x28u) ^ v12;
}
|
static void check_uid_range(int rflg, uid_t user_id)
{
uid_t uid_min ;
uid_t uid_max ;
if (rflg) {
uid_max = (uid_t)getdef_ulong("SYS_UID_MAX",getdef_ulong("UID_MIN",1000UL)-1);
if (user_id > uid_max) {
fprintf(
stderr
, gettext ("%s warning: %s's uid %d is greater than SYS_UID_MAX %d\n"), Prog, user_name, user_id, uid_max);
}
}else{
uid_min = (uid_t)getdef_ulong("UID_MIN", 1000UL);
uid_max = (uid_t)getdef_ulong("UID_MAX", 6000UL);
if (uid_min <= uid_max) {
if (user_id < uid_min || user_id >uid_max)
fprintf(
stderr
, gettext ("%s warning: %s's uid %d outside of the UID_MIN %d and UID_MAX %d range.\n"), Prog, user_name, user_id, uid_min, uid_max);
}
}
}
| unsigned int check_uid_range(int a1, unsigned int a2)
{
long v2;
unsigned int result;
char *v4;
long v5;
char *v6;
char *v7;
long v8;
char *v9;
unsigned int v10;
unsigned int v11;
unsigned int v12;
if ( a1 )
{
v2 = getdef_ulong("UID_MIN", 1000LL);
v11 = getdef_ulong("SYS_UID_MAX", v2 - 1);
result = a2;
if ( a2 > v11 )
{
v4 = user_name;
v5 = Prog;
v6 = gettext("%s warning: %s's uid %d is greater than SYS_UID_MAX %d\n");
return fprintf(stderr, v6, v5, v4, a2, v11);
}
}
else
{
v10 = getdef_ulong("UID_MIN", 1000LL);
v12 = getdef_ulong("UID_MAX", 6000LL);
result = v10;
if ( v10 <= v12 )
{
if ( a2 < v10 || (result = a2, a2 > v12) )
{
v7 = user_name;
v8 = Prog;
v9 = gettext("%s warning: %s's uid %d outside of the UID_MIN %d and UID_MAX %d range.\n");
return fprintf(stderr, v9, v8, v7, a2, v10, v12);
}
}
}
return result;
}
|
void
xheader_store (char const *keyword, struct tar_stat_info *st,
void const *data)
{
struct xhdr_tab const *t;
if (st->xhdr.buffer)
return;
t = locate_handler (keyword);
if (!t || !t->coder)
return;
if (xheader_keyword_deleted_p (keyword))
return;
xheader_init (&st->xhdr);
if (!xheader_keyword_override_p (keyword))
t->coder (st, keyword, &st->xhdr, data);
}
| long xheader_store(const char *a1, long a2, long a3)
{
long result;
long v5;
result = *(_QWORD *)(a2 + 376);
if ( !result )
{
result = (long)locate_handler(a1);
v5 = result;
if ( result )
{
result = *(_QWORD *)(result + 8);
if ( result )
{
result = xheader_keyword_deleted_p(a1);
if ( !(_BYTE)result )
{
xheader_init((struct obstack **)(a2 + 360));
result = (unsigned int)xheader_keyword_override_p(a1) ^ 1;
if ( (_BYTE)result )
return (*(long ( **)(long, const char *, long, long))(v5 + 8))(a2, a1, a2 + 360, a3);
}
}
}
}
return result;
}
|
static void
ck_fclose (FILE *f)
{
if (fclose (f))
perror_fatal ("fclose");
}
| void ck_fclose(void* a0) {
if (fclose(a0))
perror_fatal("fclose");
return;
}
|
void
simple_finish_header (union block *header)
{
size_t i;
int sum;
char *p;
memcpy (header->header.chksum, " ", sizeof header->header.chksum);
sum = 0;
p = header->buffer;
for (i = sizeof *header; i-- != 0; )
sum += 0xFF & *p++;
uintmax_to_chars ((uintmax_t) sum, header->header.chksum, 7);
set_next_block_after (header);
}
| void simple_finish_header(unsigned long long a0) {
unsigned int v0;
int tmp_10;
unsigned long long v1;
char *v2;
unsigned long long v4;
unsigned long long v5;
memcpy(a0 + 148, " ", 0x8);
v0 = 0;
v2 = a0;
v1 = 0x200;
while (true) {
v4 = v1;
v1 -= 1;
if (!v4)
break;
tmp_10 = v2;
v2 += 1;
*(&v4) = *(tmp_10);
v0 += v4;
}
uintmax_to_chars(v0, a0 + 148, 0x7);
v5 = set_next_block_after(a0);
return;
}
|
int
rl_vi_bWord (int count, int ignore)
{
while (count-- && rl_point > 0)
{
if (!(((rl_line_buffer[rl_point]) == ' ') || ((rl_line_buffer[rl_point]) == '\t')) &&
(((rl_line_buffer[rl_point - 1]) == ' ') || ((rl_line_buffer[rl_point - 1]) == '\t')))
rl_point--;
while (rl_point > 0 && (((rl_line_buffer[rl_point]) == ' ') || ((rl_line_buffer[rl_point]) == '\t')))
_rl_vi_backup_point ();
if (rl_point > 0)
{
do
_rl_vi_backup_point ();
while (rl_point > 0 && !(((rl_line_buffer[rl_point]) == ' ') || ((rl_line_buffer[rl_point]) == '\t')));
if (rl_point > 0)
rl_point++;
if (rl_point < 0)
rl_point = 0;
}
}
return (0);
}
| undefined8 rl_vi_bWord(int param_1)
{
int iVar1;
int local_c;
local_c = param_1;
do {
do {
iVar1 = local_c + -1;
if ((local_c == 0) || (rl_point < 1)) {
return 0;
}
if (((*(char *)(rl_point + rl_line_buffer) != ' ') &&
(*(char *)(rl_point + rl_line_buffer) != '\t')) &&
((*(char *)(rl_line_buffer + (long)rl_point + -1) == ' ' ||
(*(char *)(rl_line_buffer + (long)rl_point + -1) == '\t')))) {
rl_point = rl_point + -1;
}
while ((0 < rl_point &&
((*(char *)(rl_point + rl_line_buffer) == ' ' ||
(*(char *)(rl_point + rl_line_buffer) == '\t'))))) {
_rl_vi_backup_point();
}
local_c = iVar1;
} while (rl_point < 1);
do {
_rl_vi_backup_point();
if ((rl_point < 1) || (*(char *)(rl_point + rl_line_buffer) == ' ')) break;
} while (*(char *)(rl_point + rl_line_buffer) != '\t');
if (0 < rl_point) {
rl_point = rl_point + 1;
}
if (rl_point < 0) {
rl_point = 0;
}
} while( true );
}
|
int
ssh_packet_send2(struct ssh *ssh)
{
struct session_state *state = ssh->state;
struct packet *p;
u_char type;
int r, need_rekey;
if (sshbuf_len(state->outgoing_packet) < 6)
return -1;
type = sshbuf_ptr(state->outgoing_packet)[5];
need_rekey = !ssh_packet_type_is_kex(type) &&
ssh_packet_need_rekeying(ssh, sshbuf_len(state->outgoing_packet));
if ((need_rekey || state->rekeying) && !ssh_packet_type_is_kex(type)) {
if (need_rekey)
sshlog("packet.c", __func__, 1259, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "rekex triggered");
sshlog("packet.c", __func__, 1260, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "enqueue packet: %u", type);
p = calloc(1, sizeof(*p));
if (p ==
((void *)0)
)
return -2;
p->type = type;
p->payload = state->outgoing_packet;
do { (p)->next.tqe_next =
((void *)0)
; (p)->next.tqe_prev = (&state->outgoing)->tqh_last; *(&state->outgoing)->tqh_last = (p); (&state->outgoing)->tqh_last = &(p)->next.tqe_next; } while (0);
state->outgoing_packet = sshbuf_new();
if (state->outgoing_packet ==
((void *)0)
)
return -2;
if (need_rekey) {
return kex_start_rekex(ssh);
}
return 0;
}
if (type == 20)
state->rekeying = 1;
if ((r = ssh_packet_send2_wrapped(ssh)) != 0)
return r;
if (type == 21) {
state->rekeying = 0;
state->rekey_time = monotime();
while ((p = ((&state->outgoing)->tqh_first))) {
type = p->type;
if (ssh_packet_need_rekeying(ssh,
sshbuf_len(p->payload))) {
sshlog("packet.c", __func__, 1301, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "queued packet triggered rekex");
return kex_start_rekex(ssh);
}
sshlog("packet.c", __func__, 1304, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "dequeue packet: %u", type);
sshbuf_free(state->outgoing_packet);
state->outgoing_packet = p->payload;
do { if (((p)->next.tqe_next) !=
((void *)0)
) (p)->next.tqe_next->next.tqe_prev = (p)->next.tqe_prev; else (&state->outgoing)->tqh_last = (p)->next.tqe_prev; *(p)->next.tqe_prev = (p)->next.tqe_next; ; ; } while (0);
memset(p, 0, sizeof(*p));
free(p);
if ((r = ssh_packet_send2_wrapped(ssh)) != 0)
return r;
}
}
return 0;
}
| void ssh_packet_send2(unsigned long long *a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v0;
unsigned long v1;
char v2;
unsigned int v3;
unsigned int v4;
struct_4 *v5;
struct_0 *v6;
unsigned long long v8;
unsigned int v9;
unsigned long long v10;
unsigned long long v11;
void* v13;
unsigned long long v14;
unsigned long long v15;
unsigned long long v16;
void* v17;
unsigned long long v18;
v5 = *(a0);
if (sshbuf_len(v5->field_30) <= 5) {
v8 = 4294967295;
} else {
v9 = *((sshbuf_ptr(v5->field_30) + 5));
v2 = v9;
if (!ssh_packet_type_is_kex(v2)) {
v9 = sshbuf_len(v5->field_30);
if (ssh_packet_need_rekeying(a0, v9, v9, a3, a4, a5)) {
v9 = 1;
goto LABEL_402a5f;
}
}
v9 = 0;
LABEL_402a5f:
v3 = v9;
if (!v3 && !v5->field_1dc)
goto LABEL_402bd3;
if (!ssh_packet_type_is_kex(v2)) {
if (v3) {
v0 = "rekex triggered";
sshlog("packet.c", "ssh_packet_send2", 0x4eb, 0x1, 0x7, 0x0);
}
v1 = v2;
v0 = "enqueue packet: %u";
sshlog("packet.c", "ssh_packet_send2", 0x4ec, 0x0, 0x5, 0x0);
v6 = calloc(0x1, 0x20);
if (!v6) {
v11 = 4294967294;
goto LABEL_402daf;
} else {
v6->field_10 = v2;
v6->field_18 = v5->field_30;
v6->field_0 = 0;
v6->field_8 = v5->field_208;
v5->field_208->field_0 = v6;
v5->field_208 = &v6->field_0;
v5->field_30 = sshbuf_new();
if (!v5->field_30) {
v15 = 4294967294;
goto LABEL_402daf;
} else if (!v3) {
v17 = 0;
goto LABEL_402daf;
} else {
v18 = kex_start_rekex(a0);
goto LABEL_402daf;
}
}
}
LABEL_402bd3:
if (v2 == 20)
v5->field_1dc = 1;
v4 = ssh_packet_send2_wrapped(a0);
if (v4) {
v10 = v4;
} else {
if (v2 == 21) {
v5->field_1dc = 0;
v5->field_1b8 = monotime(v2, a1, a2, a3, a4, a5);
do {
v6 = v5->field_200;
if (!v6)
goto LABEL_402daa;
v2 = v6->field_10;
if (ssh_packet_need_rekeying(a0, sshbuf_len(v6->field_18), sshbuf_len(v6->field_18), 0x0, 0x5, 0x0)) {
v0 = "queued packet triggered rekex";
sshlog("packet.c", "ssh_packet_send2", 0x515, 0x1, 0x7, 0x0);
v16 = kex_start_rekex(a0);
goto LABEL_402daf;
}
v1 = v2;
v0 = "dequeue packet: %u";
sshlog("packet.c", "ssh_packet_send2", 0x518, 0x0, 0x5, 0x0);
sshbuf_free(v5->field_30);
v5->field_30 = v6->field_18;
if (!v6->field_0)
v5->field_208 = v6->field_8;
else
v6->field_0->field_8 = v6->field_8;
v6->field_8->field_0 = v6->field_0;
memset(v6, 0x0, 0x20);
free(v6);
v4 = ssh_packet_send2_wrapped(a0);
} while (!v4);
v14 = v4;
goto LABEL_402daf;
}
LABEL_402daa:
v13 = 0;
}
}
LABEL_402daf:
return;
}
|
int
rl_vi_insertion_mode (int count, int key)
{
_rl_keymap = vi_insertion_keymap;
_rl_vi_last_key_before_insert = key;
if (_rl_show_mode_in_prompt)
_rl_reset_prompt ();
return (0);
}
| void rl_vi_insertion_mode(unsigned long a0, unsigned long a1) {
unsigned int v0;
void* v2;
v0 = a0;
_rl_keymap = &vi_insertion_keymap;
_rl_vi_last_key_before_insert = a1;
if (_rl_show_mode_in_prompt)
_rl_reset_prompt();
v2 = 0;
return;
}
|
static uintmax_t
uid_substitute (int *negative)
{
uid_t r;
static uid_t uid_nobody;
if (!uid_nobody && !uname_to_uid ("nobody", &uid_nobody))
uid_nobody = -2;
r = uid_nobody;
*negative = r < 0;
return r;
}
| long uid_substitute(_DWORD *a1)
{
unsigned int v2;
if ( !uid_nobody_7156 && !(unsigned int)uname_to_uid("nobody", &uid_nobody_7156) )
uid_nobody_7156 = -2;
v2 = uid_nobody_7156;
*a1 = 0;
return v2;
}
|
static inline void
emit_stdin_note (void)
{
fputs_unlocked (gettext ("\nWith no FILE, or when FILE is -, read standard input.\n"),
stdout
)
;
}
| void emit_stdin_note(void)
{
char *__s;
FILE *__stream;
__stream = stdout;
__s = (char *)gettext("\nWith no FILE, or when FILE is -, read standard input.\n");
fputs_unlocked(__s,__stream);
return;
}
|
c_hmatch(EditLine *el, const wchar_t *str)
{
return el_match(str, el->el_search.patbuf);
}
| long long c_hmatch(struct_0 *a0, unsigned short *a1) {
return el_match(a1, a0->field_498);
}
|
static void print_maddr(FILE *fp, struct ma_info *list)
{
print_string(PRINT_FP,
((void *)0)
, "\t",
((void *)0)
);
open_json_object(
((void *)0)
);
if (list->addr.family ==
17
) {
char b1[64];
print_string(PRINT_FP,
((void *)0)
, "link ",
((void *)0)
);
print_color_string(PRINT_ANY, COLOR_MAC, "link", "%s",
ll_addr_n2a((void *)list->addr.data, list->addr.bytelen,
0, b1, sizeof(b1)));
} else {
print_string(PRINT_ANY, "family", "%-5s ",
family_name(list->addr.family));
print_color_string(PRINT_ANY, ifa_family_color(list->addr.family),
"address", "%s",
format_host(list->addr.family,
-1, list->addr.data));
}
if (list->users != 1)
print_uint(PRINT_ANY, "users", " users %u", list->users);
if (list->features)
print_string(PRINT_ANY, "features", " %s", list->features);
print_string(PRINT_FP,
((void *)0)
, "\n",
((void *)0)
);
close_json_object();
}
| void print_maddr(unsigned long a0, struct_0 *a1, unsigned long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) {
unsigned long v0;
char v1;
char v2;
unsigned long long *v4;
unsigned long long v5;
v0 = a0;
print_string(0x1, 0x0, "\t", 0x0);
open_json_object(0x0);
if (a1->field_2e == 17) {
print_string(0x1, 0x0, "link ", 0x0);
print_color_string(0x4, 0x1, "link", "%s", ll_addr_n2a(a1 + 1, a1->field_2a, 0x0, &v1, 0x40));
} else {
print_string(0x4, "family", "%-5s ", family_name(a1->field_2e));
print_color_string(0x4, ifa_family_color(a1->field_2e), "address", "%s", format_host(a1->field_2e, 0xffffffff, a1 + 1));
}
if (a1->field_c != 1)
print_uint(0x4, "users", " users %u", a1->field_c);
if (a1->field_10)
print_string(0x4, "features", " %s", a1->field_10);
print_string(0x1, 0x0, "\n", 0x0);
close_json_object(0x1, 0x0, "\n", 0x0, a4, a5);
v5 = *(&v2) ^ v4[5];
return;
}
|
static void lwtunnel_print_vxlan_opts(struct rtattr *attr)
{
struct rtattr *tb[(__LWTUNNEL_IP_OPT_VXLAN_MAX - 1) + 1];
struct rtattr *i = ((void*)(((char*)(attr)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
int rem = ((int)((attr)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)));
char *name = "vxlan_opts";
__u32 gbp;
parse_rtattr(tb, (__LWTUNNEL_IP_OPT_VXLAN_MAX - 1), i, rem);
gbp = rta_getattr_u32(tb[LWTUNNEL_IP_OPT_VXLAN_GBP]);
print_nl();
print_string(PRINT_FP, name, "\t%s ", name);
open_json_array(PRINT_JSON, name);
open_json_object(
((void *)0)
);
print_uint(PRINT_ANY, "gbp", "%u ", gbp);
close_json_object();
close_json_array(PRINT_JSON, name);
}
| void lwtunnel_print_vxlan_opts(unsigned short *a0, unsigned long a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
unsigned long long v2;
unsigned long long v3;
char v4;
char v5;
char v6;
unsigned long long *v8;
unsigned long long v9;
v2 = a0 + 2;
v0 = *(a0) - 4;
v3 = "vxlan_opts";
parse_rtattr(&v4, 0x1, v2, v0);
v1 = rta_getattr_u32(*(&v5));
print_nl();
print_string(0x1, v3, "\t%s ", v3);
open_json_array(0x2, v3);
open_json_object(0x0);
print_uint(0x4, "gbp", "%u ", v1);
close_json_object(0x4, "gbp", "%u ", a3, a4, a5);
close_json_array(0x2, v3);
v9 = *(&v6) ^ v8[5];
return;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.