input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
, "unexpected getopt_long() value '%c'.\n", c)
;
return
1
;
}
}
if (optind >= argc) {
log_printf(
3
, "missing filename.\n");
return
1
;
}
| void getopt_long(void)
{
halt_baddata();
}
|
size_t
utf8_mbstrlen(s)
const char *s;
{
size_t clen, nc;
int mb_cur_max;
nc = 0;
mb_cur_max =
(__ctype_get_mb_cur_max ())
;
while (*s && (clen = (size_t)utf8_mblen(s, mb_cur_max)) != 0)
{
if (((clen) == (size_t)-1 || (clen) == (size_t)-2))
clen = 1;
s += clen;
nc++;
}
return nc;
}
| long utf8_mbstrlen(char *a1)
{
int v1;
unsigned int mb_cur_max;
long v5;
long v6;
v6 = 0LL;
mb_cur_max = _ctype_get_mb_cur_max();
while ( *a1 )
{
v1 = utf8_mblen(a1, mb_cur_max);
v5 = v1;
if ( !v1 )
break;
if ( (unsigned long)v1 >= 0xFFFFFFFFFFFFFFFELL )
v5 = 1LL;
a1 += v5;
++v6;
}
return v6;
}
|
char *
expand_and_quote_assoc_word (w, type)
char *w;
int type;
{
char *nword, *key, *value, *s, *t;
int ind, wlen, i;
if (w[0] != '[')
return (sh_single_quote (w));
ind = skipsubscript (w, 0, 0);
if (w[ind] != ']')
return (sh_single_quote (w));
w[ind] = '\0';
t = expand_subscript_string (w+1, 0);
s = (t && strchr (t, '\001')) ? quote_escapes (t) : t;
key = sh_single_quote (s ? s : "");
if (s != t)
sh_xfree((s), "arrayfunc.c", 1018);
w[ind] = ']';
sh_xfree((t), "arrayfunc.c", 1020);
wlen = (((key) && (key)[0]) ? ((key)[1] ? ((key)[2] ? strlen(key) : 2) : 1) : 0);
nword = sh_xmalloc((wlen + 5), "arrayfunc.c", 1023);
nword[0] = '[';
memcpy (nword+1, key, wlen);
i = wlen + 1;
nword[i++] = w[ind++];
if (w[ind] == '+')
nword[i++] = w[ind++];
nword[i++] = w[ind++];
t = expand_subscript_string (w+ind, 0);
s = (t && strchr (t, '\001')) ? quote_escapes (t) : t;
value = sh_single_quote (s ? s : "");
if (s != t)
sh_xfree((s), "arrayfunc.c", 1037);
sh_xfree((t), "arrayfunc.c", 1038);
nword = sh_xrealloc((nword), (wlen + 5 + (((value) && (value)[0]) ? ((value)[1] ? ((value)[2] ? strlen(value) : 2) : 1) : 0)), "arrayfunc.c", 1039);
strcpy (nword + i, value);
sh_xfree((key), "arrayfunc.c", 1042);
sh_xfree((value), "arrayfunc.c", 1043);
return nword;
}
| long long expand_and_quote_assoc_word(char *a0, unsigned long a1) {
unsigned int v0;
int tmp_43;
int tmp_65;
int tmp_16;
int tmp_38;
int tmp_23;
int tmp_45;
unsigned int v1;
unsigned int v2;
unsigned int v3;
char *v4;
char *v5;
char v6[3];
char *v7;
char v8[3];
unsigned long long v10;
char *v12;
unsigned long v13;
char *v15;
unsigned long long v16;
unsigned long long v17;
unsigned long long v18;
v0 = a1;
if (*(a0) != 91) {
v10 = sh_single_quote(a0);
} else {
v1 = skipsubscript(a0, 0x0, 0x0);
if (a0[v1] != 93) {
v10 = sh_single_quote(a0);
} else {
a0[v1] = 0;
*(&v4) = expand_subscript_string(a0 + 1, 0x0);
if (v4 && strchr(v4, 0x1)) {
v12 = quote_escapes(v4);
goto LABEL_40226b;
}
v12 = v4;
LABEL_40226b:
v5 = v12;
if (!v5)
v13 = &g_403ab5;
else
v13 = v5;
*(&v6) = sh_single_quote(v13);
if (v5 != v4)
sh_xfree(v5, "arrayfunc.c", 0x3fa);
a0[v1] = 93;
sh_xfree(v4, "arrayfunc.c", 0x3fc);
if (v6 && v6[0]) {
if (!v6[1]) {
*(&v13) = 1;
goto LABEL_40232a;
} else if (!v6[2]) {
*(&v13) = 2;
goto LABEL_40232a;
} else {
v13 = strlen(v6);
goto LABEL_40232a;
}
}
*(&v13) = 0;
LABEL_40232a:
v3 = v13;
v7 = sh_xmalloc(v3 + 5, "arrayfunc.c", 0x3ff);
*(v7) = 91;
memcpy(v7 + 1, v6, v3);
v2 = v3 + 1;
tmp_43 = v1;
v1 += 1;
tmp_65 = v2;
v2 += 1;
*(&v13) = a0[tmp_43];
v7[tmp_65] = v13;
if (a0[v1] == 43) {
tmp_16 = v1;
v1 += 1;
tmp_38 = v2;
v2 += 1;
*(&v13) = a0[tmp_16];
v7[tmp_38] = v13;
}
tmp_23 = v1;
v1 += 1;
tmp_45 = v2;
v2 += 1;
*(&v13) = a0[tmp_23];
v7[tmp_45] = v13;
*(&v4) = expand_subscript_string(&a0[v1], 0x0);
if (v4 && strchr(v4, 0x1)) {
v15 = quote_escapes(v4);
goto LABEL_40245f;
}
v15 = v4;
LABEL_40245f:
v5 = v15;
if (!v5)
v16 = &g_403ab5;
else
v16 = v5;
*(&v8) = sh_single_quote(v16);
if (v5 != v4)
sh_xfree(v5, "arrayfunc.c", 0x40d);
sh_xfree(v4, "arrayfunc.c", 0x40e);
if (v8 && v8[0]) {
if (!v8[1]) {
v17 = 1;
goto LABEL_402517;
} else if (!v8[2]) {
v17 = 2;
goto LABEL_402517;
} else {
v17 = strlen(v8);
goto LABEL_402517;
}
}
v17 = 0;
LABEL_402517:
v18 = sh_xrealloc(v7, v17 + v3 + 5, "arrayfunc.c", 0x40f);
v7 = v18;
strcpy(v2 + v7, v8);
sh_xfree(v6, "arrayfunc.c", 0x412);
sh_xfree(v8, "arrayfunc.c", 0x413);
v10 = v7;
}
}
return v10;
}
|
gnutls_aead_cipher_encrypt(actx, iv.data, iv.size,
((void *)0)
, 0, tag_size, i, step, output, &out_size) >= 0
) ? 1 : 0), __extension__ ({ if (
gnutls_aead_cipher_encrypt(actx, iv.data, iv.size,
((void *)0)
, 0, tag_size, i, step, output, &out_size) >= 0
) ; else __assert_fail (
"gnutls_aead_cipher_encrypt(actx, iv.data, iv.size, NULL, 0, tag_size, i, step, output, &out_size) >= 0"
, "benchmark-cipher.c", 204, __extension__ __PRETTY_FUNCTION__); }))
| void gnutls_aead_cipher_encrypt(void)
{
halt_baddata();
}
|
rsRetVal
queryLocalHostname(void)
{
uchar *LocalHostName =
((void *)0)
;
uchar *LocalDomain =
((void *)0)
;
uchar *LocalFQDNName;
rsRetVal iRet = RS_RET_OK;
if((iRet = net.getLocalHostname(&LocalFQDNName)) != RS_RET_OK) goto finalize_it;
uchar *dot = (uchar*) strstr((char*)LocalFQDNName, ".");
if(dot ==
((void *)0)
) {
if((LocalHostName = (uchar*) strdup((char*)LocalFQDNName)) ==
((void *)0)
) do { iRet = RS_RET_OUT_OF_MEMORY; goto finalize_it; } while (0);
if((LocalDomain = (uchar*)strdup("")) ==
((void *)0)
) do { iRet = RS_RET_OUT_OF_MEMORY; goto finalize_it; } while (0);
} else {
const size_t lenhn = dot - LocalFQDNName;
if((LocalHostName = (uchar*) strndup((char*) LocalFQDNName, lenhn)) ==
((void *)0)
) do { iRet = RS_RET_OUT_OF_MEMORY; goto finalize_it; } while (0);
if((LocalDomain = (uchar*) strdup((char*) dot+1)) ==
((void *)0)
) do { iRet = RS_RET_OUT_OF_MEMORY; goto finalize_it; } while (0);
}
glbl.SetLocalFQDNName(LocalFQDNName);
glbl.SetLocalHostName(LocalHostName);
glbl.SetLocalDomain(LocalDomain);
glbl.GenerateLocalHostNameProperty();
LocalHostName =
((void *)0)
;
LocalDomain =
((void *)0)
;
finalize_it:
free(LocalHostName);
free(LocalDomain);
return iRet;
}
| void queryLocalHostname() {
unsigned int v0;
char v1;
void* v2;
void* v3;
unsigned long v4;
unsigned int v5;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
v2 = 0;
v3 = 0;
v0 = 0;
v0 = *(4212008)(&v1);
if (!v0) {
v4 = strstr(*(&v1), ".");
if (!v4) {
v2 = strdup(*(&v1));
if (!v2) {
v0 = -6;
} else {
v3 = strdup(&g_404a79);
if (!v3)
v0 = -6;
}
} else {
*(&v5) = v4 - *(&v1);
v2 = strndup(*(&v1), *(&v5));
if (!v2) {
v0 = -6;
} else {
v3 = strdup(v4 + 1);
if (!v3)
v0 = -6;
}
}
if ((!v4 || v2) && (!v4 || v3) && (v2 || v4) && (v3 || v4)) {
*(4212416)(*(&v1));
*(4212448)(v2);
g_4046f0(v3);
*(4212472)(v7, v8, g_4046f0, v9, v10, v11);
v2 = 0;
v3 = 0;
}
}
free(v2);
free(v3);
v12 = v0;
return;
}
|
static void
init_parameters (int number_of_files)
{
int chars_used_by_number = 0;
lines_per_body = lines_per_page - lines_per_header - lines_per_footer;
if (lines_per_body <= 0)
{
extremities =
0
;
keep_FF =
1
;
}
if (extremities ==
0
)
lines_per_body = lines_per_page;
if (double_space)
lines_per_body = lines_per_body / 2;
if (number_of_files == 0)
parallel_files =
0
;
if (parallel_files)
columns = number_of_files;
if (storing_columns)
balance_columns =
1
;
if (columns > 1)
{
if (!use_col_separator)
{
if (join_lines)
col_sep_string = line_separator;
else
col_sep_string = column_separator;
col_sep_length = 1;
use_col_separator =
1
;
}
else if (!join_lines && col_sep_length == 1 && *col_sep_string == '\t')
col_sep_string = column_separator;
truncate_lines =
1
;
if (! (col_sep_length == 1 && *col_sep_string == '\t'))
untabify_input =
1
;
tabify_output =
1
;
}
else
storing_columns =
0
;
if (join_lines)
truncate_lines =
0
;
if (numbered_lines)
{
int chars_per_default_tab = 8;
line_count = start_line_num;
if (number_separator == '\t')
number_width = (chars_per_number
+ ((chars_per_default_tab) - ((chars_per_number) % (chars_per_default_tab))));
else
number_width = chars_per_number + 1;
if (parallel_files)
chars_used_by_number = number_width;
}
int sep_chars, useful_chars;
if (__builtin_mul_overflow (columns - 1, col_sep_length, &sep_chars))
sep_chars = 0x7fffffff;
if (__builtin_sub_overflow (chars_per_line - chars_used_by_number, sep_chars, &useful_chars)
)
useful_chars = 0;
chars_per_column = useful_chars / columns;
if (chars_per_column < 1)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"page width too narrow\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("page width too narrow")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("page width too narrow")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
if (numbered_lines)
{
free (number_buff);
number_buff = xmalloc (
(((
chars_per_number
)>(
(((((sizeof (line_number) * 8) - (! ((__typeof__ (line_number)) 0 < (__typeof__ (line_number)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (line_number)) 0 < (__typeof__ (line_number)) -1)))
))?(
chars_per_number
):(
(((((sizeof (line_number) * 8) - (! ((__typeof__ (line_number)) 0 < (__typeof__ (line_number)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (line_number)) 0 < (__typeof__ (line_number)) -1)))
))
+ 1);
}
free (clump_buff);
clump_buff = xmalloc (
(((
8
)>(
chars_per_input_tab
))?(
8
):(
chars_per_input_tab
))
);
}
| void init_parameters(unsigned long a0) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
char v4;
unsigned long v6;
unsigned long v7;
unsigned long long v9;
unsigned long long *v10;
unsigned long long v11;
v2 = 0;
lines_per_body = lines_per_page - 10;
if (lines_per_body <= 0) {
extremities = 0;
keep_FF = 1;
}
if ((extremities ^ 1))
lines_per_body = lines_per_page;
if (double_space)
lines_per_body = lines_per_body + (lines_per_body >> 31) >> 1;
if (!a0)
parallel_files = 0;
if (parallel_files)
columns = a0;
if (storing_columns)
balance_columns = 1;
if (columns <= 1) {
storing_columns = 0;
} else {
if ((use_col_separator ^ 1)) {
if (join_lines)
col_sep_string = line_separator;
else
col_sep_string = *(&column_separator);
col_sep_length = 1;
use_col_separator = 1;
} else if ((join_lines ^ 1) && col_sep_length == 1 && *(col_sep_string) == 9) {
col_sep_string = *(&column_separator);
}
truncate_lines = 1;
if (col_sep_length != 1 || *(col_sep_string) != 9)
untabify_input = 1;
tabify_output = 1;
}
if (join_lines)
truncate_lines = 0;
if (numbered_lines) {
v3 = 8;
line_count = start_line_num;
if (number_separator != 9)
number_width = *(&chars_per_number) + 1;
else
number_width = *(&chars_per_number) + v3 - ((*(&chars_per_number) >> 31 CONCAT *(&chars_per_number)) /m v3 >> 32);
if (parallel_files)
v2 = number_width;
}
v6 = 0;
if ([D] amd64g_calculate_condition(0x0<64>, 0x33<64>, Conv(32->64, (Load(addr=0x403c1c<64>, size=4, endness=Iend_LE) - 0x1<32>)), Conv(32->64, Load(addr=0x403cdc<64>, size=4, endness=Iend_LE)), cc_ndep<8>))
*(&v6) = 1;
v0 = (columns - 1) * col_sep_length;
if ((v6 & 1))
v0 = 2147483647;
v7 = 0;
if (((chars_per_line - v2 ^ v0) & (chars_per_line - v2 ^ chars_per_line - v2 - v0)) < 0)
*(&v7) = 1;
v1 = chars_per_line - v2 - v0;
if ((v7 & 1))
v1 = 0;
chars_per_column = (v1 >> 31 CONCAT v1) /m columns;
if (chars_per_column > 0) {
if (numbered_lines) {
free(number_buff);
number_buff = xmalloc((*(&chars_per_number) <= 11 ? *(&chars_per_number) + 1 : 12));
}
free(clump_buff);
v9 = chars_per_input_tab;
if (chars_per_input_tab < 8)
v9 = 8;
clump_buff = xmalloc(v9);
v11 = *(&v4) ^ v10[5];
return;
}
error(0x1, 0x0, gettext("page width too narrow"));
}
|
inline
_Bool
c_isspace (int c)
{
switch (c)
{
case ' ': case '\t': case '\n': case '\v': case '\f': case '\r':
return
1
;
default:
return
0
;
}
}
| void c_isspace(void)
{
halt_baddata();
}
|
int
strnvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags)
{
return istrsenvisx(&mbdst, &dlen, mbsrc, len, flags, "",
((void *)0)
);
}
| long strnvisx(char *a1, size_t a2, const char *a3, unsigned long a4, int a5)
{
size_t v6;
char *v7;
v7 = a1;
v6 = a2;
return istrsenvisx(&v7, &v6, a3, a4, a5, (char *)&unk_18E8, 0LL);
}
|
static void
sizenodelist(lp)
struct nodelist *lp;
{
while (lp) {
funcblocksize += (((sizeof(struct nodelist)) + (sizeof(union {int i; char *cp; double d; }) - 1)) & ~(sizeof(union {int i; char *cp; double d; }) - 1));
calcsize(lp->n);
lp = lp->next;
}
}
| void sizenodelist(unsigned long a0) {
unsigned long long v0[2];
unsigned long long v2;
for (v0[0] = a0; v0; v0[0] = v0[0]) {
funcstringsize = 3850979429;
calcsize(v0[1]);
v2 = v0[0];
}
return;
}
|
static inline
_Bool
dot_or_dotdot (char const *file_name)
{
if (file_name[0] == '.')
{
char sep = file_name[(file_name[1] == '.') + 1];
return (! sep || ((sep) == '/'));
}
else
return
0
;
}
| int dot_or_dotdot(unsigned long long a0) {
char v0;
unsigned int v2;
unsigned long long v3;
unsigned int v4;
if (*(a0) == 46) {
if (*((a0 + 1)) == 46)
v3 = 2;
else
v3 = 1;
v0 = *((a0 + v3));
if (v0 && v0 != 47)
v4 = 0;
if (v0 == 47 || !v0)
v4 = 1;
v2 = v4 & 1;
} else {
v2 = 0;
}
return v2;
}
|
int main (int argc, char **argv)
{
char buf[
8192
];
char *name;
char *newpwd;
char *cp;
const struct sgrp *sg;
struct sgrp newsg;
const struct group *gr;
struct group newgr;
int errors = 0;
int line = 0;
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(
stderr
);
(void) setlocale (
6
, "");
(void) bindtextdomain ("shadow", "/usr/share/locale");
(void) textdomain ("shadow");
process_root_flag ("-R", argc, argv);
process_flags (argc, argv);
openlog("chgpasswd", (
0x01
),
(10<<3)
);
check_perms ();
is_shadow_grp = sgr_file_present ();
open_files ();
while (fgets (buf, (int) sizeof buf,
stdin
) != (char *) 0) {
line++;
cp = strrchr (buf, '\n');
if (
((void *)0)
!= cp) {
*cp = '\0';
} else {
fprintf (
stderr
, gettext ("%s: line %d: line too long\n"),
Prog, line);
errors++;
continue;
}
name = buf;
cp = strchr (name, ':');
if (
((void *)0)
!= cp) {
*cp = '\0';
cp++;
} else {
fprintf (
stderr
,
gettext ("%s: line %d: missing new password\n"),
Prog, line);
errors++;
continue;
}
newpwd = cp;
if ( (!eflg)
&& ( (
((void *)0)
== crypt_method)
|| (0 != strcmp (crypt_method, "NONE")))) {
void *arg =
((void *)0)
;
const char *salt;
if (md5flg) {
crypt_method = "MD5";
}
if (sflg) {
if ( (0 == strcmp (crypt_method, "SHA256"))
|| (0 == strcmp (crypt_method, "SHA512"))) {
arg = &sha_rounds;
}
}
salt = crypt_make_salt (crypt_method, arg);
cp = pw_encrypt (newpwd, salt);
if (
((void *)0)
== cp) {
fprintf (
stderr
,
gettext ("%s: failed to crypt password with salt '%s': %s\n"),
Prog, salt, strerror (
(*__errno_location ())
));
fail_exit (1);
}
}
gr = gr_locate (name);
if (
((void *)0)
== gr) {
fprintf (
stderr
,
gettext ("%s: line %d: group '%s' does not exist\n"), Prog,
line, name);
errors++;
continue;
}
if (is_shadow_grp) {
sg = sgr_locate (name);
if ( (
((void *)0)
== sg)
&& (strcmp (gr->gr_passwd,
"x") == 0)) {
static char *empty =
((void *)0)
;
newsg.sg_name = name;
newsg.sg_adm = ∅
newsg.sg_mem = dup_list (gr->gr_mem);
sg = &newsg;
}
} else {
sg =
((void *)0)
;
}
if (
((void *)0)
!= sg) {
newsg = *sg;
newsg.sg_passwd = cp;
}
if ( (
((void *)0)
== sg)
|| (strcmp (gr->gr_passwd, "x") != 0))
{
newgr = *gr;
newgr.gr_passwd = cp;
}
if (
((void *)0)
!= sg) {
if (sgr_update (&newsg) == 0) {
fprintf (
stderr
,
gettext ("%s: line %d: failed to prepare the new %s entry '%s'\n"),
Prog, line, sgr_dbname (), newsg.sg_name);
errors++;
continue;
}
}
if ( (
((void *)0)
== sg)
|| (strcmp (gr->gr_passwd, "x") != 0))
{
if (gr_update (&newgr) == 0) {
fprintf (
stderr
,
gettext ("%s: line %d: failed to prepare the new %s entry '%s'\n"),
Prog, line, gr_dbname (), newgr.gr_name);
errors++;
continue;
}
}
}
if (0 != errors) {
fprintf (
stderr
,
gettext ("%s: error detected, changes ignored\n"), Prog);
fail_exit (1);
}
close_files ();
nscd_flush_cache ("group");
sssd_flush_cache (0x002);
return (0);
}
| int main(unsigned long a0, unsigned long long *a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
unsigned long long v2;
void* v3;
unsigned long long v4;
char *v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8[4];
unsigned long v9;
unsigned long v10;
unsigned long v11;
unsigned long v12;
unsigned long v13;
unsigned long v14;
unsigned long v15;
unsigned long v16;
char v17;
unsigned long long v18;
unsigned long long v19;
unsigned long long v21;
unsigned long long v22;
unsigned long long v23;
v19 = *(&v19);
v18 = *(&v18);
v0 = 0;
v1 = 0;
Prog = Basename(*(a1));
log_set_progname(0x8930ec8348535441);
log_set_logfd(stderr);
setlocale(0x6, &g_4016d4);
bindtextdomain("shadow", "/usr/share/locale");
textdomain("shadow");
process_root_flag("-R", a0, a1);
process_flags(a0, a1);
openlog("chgpasswd", 0x1, 0x50);
check_perms();
is_shadow_grp = sgr_file_present("chgpasswd", a1, a2, a3, a4, a5);
open_files();
for (; fgets(&v17, 0x2000, stdin); v0 += 1) {
v1 += 1;
v2 = strrchr(&v17, 0xa);
if (!v2) {
fprintf(stderr, gettext("%s: line %d: line too long\n"));
} else {
*(v2) = 0;
v5 = &v17;
v2 = strchr(v5, 0x3a);
if (!v2) {
fprintf(stderr, gettext("%s: line %d: missing new password\n"));
} else {
*(v2) = 0;
v2 += 1;
v6 = v2;
if ((eflg ^ 1) && (!crypt_method || strcmp(crypt_method, "NONE"))) {
v4 = 0;
if (md5flg)
crypt_method = "MD5";
if (sflg && (!strcmp(crypt_method, "SHA256") || !strcmp(crypt_method, "SHA512")))
v4 = &sha_rounds;
v7 = crypt_make_salt(crypt_method, v4, v4);
v2 = pw_encrypt(v6, v7, v7);
if (!v2) {
v23 = strerror(*(__errno_location()));
fprintf(stderr, gettext("%s: failed to crypt password with salt '%s': %s\n"));
fail_exit(0x1);
}
}
v8[0] = gr_locate(v5);
if (!v8) {
fprintf(stderr, gettext("%s: line %d: group '%s' does not exist\n"));
} else {
if (!is_shadow_grp) {
v3 = 0;
} else {
v3 = sgr_locate(v5);
if (!v3 && !strcmp(v8[1], "x")) {
v9 = v5;
v11 = &empty.5713;
v12 = dup_list(v8[3]);
v3 = &v9;
}
}
if (v3) {
v9 = *(v3);
v10 = v3[8];
v11 = v3[16];
v12 = v3[24];
v10 = v2;
}
if (!v3 || strcmp(v8[1], "x")) {
v13 = v8[0];
v14 = v8[1];
v15 = v8[2];
v16 = v8[3];
v14 = v2;
}
if (!(!v3 || sgr_update(&v9))) {
v21 = sgr_dbname();
fprintf(stderr, gettext("%s: line %d: failed to prepare the new %s entry '%s'\n"));
} else if ((!v3 || strcmp(v8[1], "x")) && !gr_update(&v13)) {
v22 = gr_dbname();
fprintf(stderr, gettext("%s: line %d: failed to prepare the new %s entry '%s'\n"));
}
}
}
}
}
if (!v0) {
close_files();
nscd_flush_cache("group");
sssd_flush_cache(0x2);
return 0;
}
fprintf(stderr, gettext("%s: error detected, changes ignored\n"));
fail_exit(0x1);
}
|
{
unsigned int cols[] = {
strlen("*X: bytes"),
strlen("packets"),
strlen("errors"),
strlen("dropped"),
strlen("overrun"),
};
if (is_json_context()) {
open_json_object("rx");
print_u64(PRINT_JSON, "bytes",
((void *)0)
, s->rx_bytes);
print_u64(PRINT_JSON, "packets",
((void *)0)
, s->rx_packets);
print_u64(PRINT_JSON, "errors",
((void *)0)
, s->rx_errors);
print_u64(PRINT_JSON, "dropped",
((void *)0)
, s->rx_dropped);
print_u64(PRINT_JSON, "multicast",
((void *)0)
, s->multicast);
close_json_object();
open_json_object("tx");
print_u64(PRINT_JSON, "bytes",
((void *)0)
, s->tx_bytes);
print_u64(PRINT_JSON, "packets",
((void *)0)
, s->tx_packets);
print_u64(PRINT_JSON, "errors",
((void *)0)
, s->tx_errors);
print_u64(PRINT_JSON, "dropped",
((void *)0)
, s->tx_dropped);
close_json_object();
} else {
size_columns(cols, (sizeof(cols) / sizeof((cols)[0])),
s->rx_bytes, s->rx_packets, s->rx_errors,
s->rx_dropped, s->multicast);
size_columns(cols, (sizeof(cols) / sizeof((cols)[0])),
s->tx_bytes, s->tx_packets, s->tx_errors,
s->tx_dropped, 0);
fprintf(fp, " RX: %*s %*s %*s %*s %*s%s",
cols[0] - 4, "bytes", cols[1], "packets",
cols[2], "errors", cols[3], "dropped",
cols[4], "mcast", _SL_);
fprintf(fp, " ");
print_num(fp, cols[0], s->rx_bytes);
print_num(fp, cols[1], s->rx_packets);
print_num(fp, cols[2], s->rx_errors);
print_num(fp, cols[3], s->rx_dropped);
print_num(fp, cols[4], s->multicast);
fprintf(fp, "%s", _SL_);
fprintf(fp, " TX: %*s %*s %*s %*s%s",
cols[0] - 4, "bytes", cols[1], "packets",
cols[2], "errors", cols[3], "dropped", _SL_);
fprintf(fp, " ");
print_num(fp, cols[0], s->tx_bytes);
print_num(fp, cols[1], s->tx_packets);
print_num(fp, cols[2], s->tx_errors);
print_num(fp, cols[3], s->tx_dropped);
}
}
| size_t strlen(char *__s)
{
halt_baddata();
}
|
(*__errno_location ())
) {
case
32
:
sshlog("ssh-keyscan.c", __func__, 518, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s: Connection closed by remote host", c->c_name);
break;
case
111
:
break;
default:
sshlog("ssh-keyscan.c", __func__, 523, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "read (%s): %s", c->c_name, strerror(
(*__errno_location ())
));
break;
}
| int * __errno_location(void)
{
halt_baddata();
}
|
static size_t
raw_hasher (const void *data, size_t n)
{
size_t val = rotr_sz ((size_t) data, 3);
return val % n;
}
| long long raw_hasher(unsigned long long a0, unsigned long a1) {
unsigned long v0;
v0 = rotr_sz(a0, 0x3);
return (0 CONCAT v0) /m a1 >> 64;
}
|
static
_Bool
parse_name (const struct parser_table* entry, char **argv, int *arg_ptr)
{
const char *name;
const int saved_argc = *arg_ptr;
if (collect_arg (argv, arg_ptr, &name))
{
fnmatch_sanitycheck ();
if (check_name_arg ("-name", "-wholename", name))
{
struct predicate *our_pred = insert_primary (entry, name);
our_pred->need_stat = our_pred->need_type =
0
;
our_pred->args.str = name;
our_pred->est_success_rate = estimate_pattern_match_rate (name, 0);
return
1
;
}
else
{
*arg_ptr = saved_argc;
}
}
return
0
;
}
| long long parse_name(unsigned long long a0, unsigned long long a1, unsigned int *a2) {
unsigned int v0;
char v1;
struct_0 *v2;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned int v7;
v0 = *(a2);
v4 = collect_arg(a1, a2, &v1);
if (v4) {
fnmatch_sanitycheck();
v5 = check_name_arg("-name", "-wholename", *(&v1));
if (v5) {
v2 = insert_primary(a0, *(&v1), *(&v1));
v2->field_1b = 0;
v2->field_1a = v2->field_1b;
v2->field_38 = *(&v1);
estimate_pattern_match_rate(*(&v1), 0x0);
v2->field_24 = v7;
v6 = 1;
} else {
*(a2) = v0;
}
}
if (!v4 || !v5)
v6 = 0;
return v6;
}
|
int
xasprintf(char **ret, const char *fmt, ...)
{
va_list ap;
int i;
__builtin_va_start(
ap
,
fmt
)
;
i = xvasprintf(ret, fmt, ap);
__builtin_va_end(
ap
)
;
return i;
}
| long xasprintf(char **a1, const char *a2, long a3, long a4, long a5, long a6, ...)
{
gcc_va_list va;
unsigned long v8;
long v9;
long v10;
long v11;
long v12;
va_start(va, a6);
v9 = a3;
v10 = a4;
v11 = a5;
v12 = a6;
v8 = __readfsqword(0x28u);
va[0].gp_offset = 16;
return (unsigned int)xvasprintf(a1, a2, va);
}
|
hash_pattern (void const *pat, size_t n_buckets)
{
uint_fast64_t h15 = 5381, h32 = 3657500101, h64 = 4123221751654370051;
size_t h = h64 <=
(18446744073709551615UL)
? h64 : h32 <=
(18446744073709551615UL)
? h32 : h15;
intptr_t pat_offset = (intptr_t) pat - 1;
unsigned char const *s = (unsigned char const *) pattern_array + pat_offset;
for ( ; *s != '\n'; s++)
h = h * 33 ^ *s;
return h % n_buckets;
}
| long long hash_pattern(unsigned long a0, unsigned long a1) {
unsigned long long v0;
char *v1;
unsigned long long v2;
unsigned long long v3;
unsigned long long v4;
unsigned long v5;
v2 = 5381;
v3 = 3657500101;
v4 = 4123221751654370051;
v0 = v4;
v5 = a0 - 1;
for (v1 = v5 + pattern_array; *(v1) != 10; v1 += 1) {
v0 = *(v1) ^ v0 * 33;
}
return (0 CONCAT v0) /m a1 >> 64;
}
|
gl_linked_iterator (gl_list_t list)
{
gl_list_iterator_t result;
result.vtable = list->base.vtable;
result.list = list;
result.p = list->root.next;
result.q = &list->root;
return result;
}
| _QWORD * gl_linked_iterator(_QWORD *a1, _QWORD *a2)
{
long v3;
long v4;
long v5;
long v6;
v4 = a2[5];
*a1 = *a2;
a1[1] = a2;
a1[2] = v3;
a1[3] = v4;
a1[4] = a2 + 5;
a1[5] = v5;
a1[6] = v6;
return a1;
}
|
static void
push_current_dired_pos (struct obstack *obs)
{
if (dired)
__extension__ ({ struct obstack *__o = (obs); size_t __len = (sizeof dired_pos); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < __len) _obstack_newchunk (__o, __len); memcpy (__o->next_free, &dired_pos, __len); __o->next_free += __len; (void) 0; });
}
| void push_current_dired_pos(long param_1)
{
if (dired != '\0') {
if ((ulong)(*(long *)(param_1 + 0x20) - *(long *)(param_1 + 0x18)) < 8) {
_obstack_newchunk(param_1,8);
}
memcpy(*(void **)(param_1 + 0x18),&dired_pos,8);
*(long *)(param_1 + 0x18) = *(long *)(param_1 + 0x18) + 8;
}
return;
}
|
static void print_type(FILE *f, __u8 type)
{
char buf[64];
const char *str = buf;
if (type == 0x0001)
str = "tun";
else if (type == 0x0002)
str = "tap";
else
snprintf(buf, sizeof(buf), "UNKNOWN:%hhu", type);
print_string(PRINT_ANY, "type", "type %s ", str);
}
| unsigned long print_type(long a1, unsigned char a2)
{
char s[72];
unsigned long v4;
v4 = __readfsqword(0x28u);
if ( a2 == 1 )
{
print_string(4u, (long)"type", "type %s ", (long)"tun");
}
else if ( a2 == 2 )
{
print_string(4u, (long)"type", "type %s ", (long)"tap");
}
else
{
snprintf(s, 0x40uLL, "UNKNOWN:%hhu", a2);
print_string(4u, (long)"type", "type %s ", (long)s);
}
return __readfsqword(0x28u) ^ v4;
}
|
void
set_exit_status (int val)
{
if (val > exit_status)
exit_status = val;
}
| void set_exit_status(unsigned long a0) {
unsigned int v0;
unsigned long long v2;
unsigned long v3;
v0 = a0;
v2 = exit_status;
if (a0 > exit_status) {
v3 = a0;
exit_status = a0;
}
return;
}
|
static int xfrm_policy_get(int argc, char **argv)
{
struct nlmsghdr *n =
((void *)0)
;
xfrm_policy_get_or_delete(argc, argv, 0, &n);
if (xfrm_policy_print(n, (void *)
stdout
) < 0) {
fprintf(
stderr
, "An error :-)\n");
exit(1);
}
free(n);
return 0;
}
| void xfrm_policy_get(unsigned long a0, unsigned int a1) {
void* v0;
void* v3;
v0 = 0;
xfrm_policy_get_or_delete(a0, a1, 0x0, &v0);
if (xfrm_policy_print(v0, stdout) < 0) {
fprintf(stderr, "An error :-)\n");
exit(0x1);
}
free(v0);
v3 = 0;
return;
}
|
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 (!v0)
v0 = "HIGH";
v3 = str_to_sec_param(v0);
v1 = gnutls_sec_param_to_pk_bits(a0, v3, v3);
return v1;
} else {
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;
return v1;
}
}
|
static void
cleanup (int signo __attribute__((unused)))
{
if (0 < diffpid)
kill (diffpid,
13
);
if (tmpname)
unlink (tmpname);
}
| void cleanup(unsigned long a0) {
unsigned int v0;
unsigned long long v2;
unsigned long long v3;
v0 = a0;
if (diffpid > 0)
kill(diffpid, 0xd);
v2 = tmpname;
if (tmpname)
v3 = unlink(tmpname);
return;
}
|
void fprint_off(file, offset, width)
FILE *file;
off_t offset;
int width;
{
char buf[8 * sizeof (off_t)];
char *p = buf + sizeof buf;
if (offset < 0) {
do
*--p = '0' - offset % 10;
while ((offset /= 10) != 0);
*--p = '-';
} else {
do
*--p = '0' + offset % 10;
while ((offset /= 10) != 0);
}
width -= buf + sizeof buf - p;
while (0 < width--) {
putc (' ', file);
}
for (; p < buf + sizeof buf; p++)
putc (*p, file);
}
| long long fprint_off(void* a0, unsigned long a1, unsigned long a2) {
unsigned int v0;
unsigned long v1;
char *v2;
char v3;
unsigned int v5;
v1 = a1;
v0 = a2;
v2 = &v3;
if ((v1 - 0 >> 63)) {
do {
v2 += 1;
*(v2) = 48 - (v1 - ((v1 * 7378697629483820647 >> 64 >> 2) - (v1 >> 63)) * 10);
v1 = (v1 * 7378697629483820647 >> 64 >> 2) - (v1 >> 63);
} while (v1);
v2 += 1;
*(v2) = 45;
} else {
do {
v2 += 1;
*(v2) = (v1 - ((v1 * 7378697629483820647 >> 64 >> 2) - (v1 >> 63)) * 10) + 48;
v1 = (v1 * 7378697629483820647 >> 64 >> 2) - (v1 >> 63);
} while (v1);
}
v0 -= (&v3 - v2);
while (true) {
v5 = v0;
v0 -= 1;
if (v5 <= 0)
break;
putc(0x20, a0);
}
for (; v2 < &v3; v2 += 1) {
putc(*(v2), a0);
}
return 0;
}
|
int
hash_size (table)
HASH_TABLE *table;
{
return (((table) ? (table)->nentries : 0));
}
| long long hash_size(struct_0 *a0) {
return (!a0 ? a0->field_c : 0);
}
|
int xfrm_mode_parse(__u8 *mode, int *argcp, char ***argvp)
{
int argc = *argcp;
char **argv = *argvp;
if (matches(*argv, "transport") == 0)
*mode = 0;
else if (matches(*argv, "tunnel") == 0)
*mode = 1;
else if (matches(*argv, "ro") == 0)
*mode = 2;
else if (matches(*argv, "in_trigger") == 0)
*mode = 3;
else if (matches(*argv, "beet") == 0)
*mode = 4;
else
invarg("MODE value is invalid", *argv);
*argcp = argc;
*argvp = argv;
return 0;
}
| long xfrm_mode_parse(_BYTE *a1, int *a2, _QWORD **a3)
{
int v5;
_QWORD *v6;
v5 = *a2;
v6 = *a3;
if ( (unsigned char)matches(**a3, "transport") != 1 )
{
*a1 = 0;
}
else if ( (unsigned char)matches(*v6, "tunnel") != 1 )
{
*a1 = 1;
}
else if ( (unsigned char)matches(*v6, "ro") != 1 )
{
*a1 = 2;
}
else if ( (unsigned char)matches(*v6, "in_trigger") != 1 )
{
*a1 = 3;
}
else if ( (unsigned char)matches(*v6, "beet") != 1 )
{
*a1 = 4;
}
else
{
invarg("MODE value is invalid", *v6);
}
*a2 = v5;
*a3 = v6;
return 0LL;
}
|
static void
xheader_list_append (struct keyword_list **root, char const *kw,
char const *value)
{
struct keyword_list *kp = xmalloc (sizeof *kp);
kp->pattern = xstrdup (kw);
kp->value = value ? xstrdup (value) :
((void *)0)
;
kp->next = *root;
*root = kp;
}
| void xheader_list_append(unsigned long long *a0, unsigned long long a1, unsigned long long a2) {
unsigned long long v0;
unsigned long long v1[3];
unsigned long long *v4;
v0 = a2;
v1[0] = xmalloc(0x18);
v1[1] = xstrdup(a1);
*(&v1[2]) = (!v0 ? xstrdup(v0) : 0);
v1[0] = *(a0);
v4 = a0;
*(a0) = v1;
return;
}
|
static int
ssh_proxy_fdpass_connect(struct ssh *ssh, const char *host,
const char *host_arg, u_short port, const char *proxy_command)
{
char *command_string;
int sp[2], sock;
pid_t pid;
char *shell;
if ((shell = getenv("SHELL")) ==
((void *)0)
)
shell =
"/bin/sh"
;
if (socketpair(
1
,
SOCK_STREAM
, 0, sp) == -1)
sshfatal("sshconnect.c", __func__, 126, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Could not create socketpair to communicate with " "proxy dialer: %.100s", strerror(
(*__errno_location ())
))
;
command_string = expand_proxy_command(proxy_command, options.user,
host, host_arg, port);
sshlog("sshconnect.c", __func__, 131, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "Executing proxy dialer command: %.500s", command_string);
if ((pid = fork()) == 0) {
char *argv[10];
close(sp[1]);
if (sp[0] != 0) {
if (dup2(sp[0], 0) == -1)
perror("dup2 stdin");
}
if (sp[0] != 1) {
if (dup2(sp[0], 1) == -1)
perror("dup2 stdout");
}
if (sp[0] >= 2)
close(sp[0]);
if (!debug_flag && options.control_path !=
((void *)0)
&&
options.control_persist && stdfd_devnull(0, 0, 1) == -1)
sshlog("sshconnect.c", __func__, 156, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "stdfd_devnull failed");
argv[0] = shell;
argv[1] = "-c";
argv[2] = command_string;
argv[3] =
((void *)0)
;
execv(argv[0], argv);
perror(argv[0]);
exit(1);
}
if (pid == -1)
sshfatal("sshconnect.c", __func__, 173, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "fork failed: %.100s", strerror(
(*__errno_location ())
));
close(sp[0]);
free(command_string);
if ((sock = mm_receive_fd(sp[1])) == -1)
sshfatal("sshconnect.c", __func__, 178, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "proxy dialer did not pass back a connection");
close(sp[1]);
while (waitpid(pid,
((void *)0)
, 0) == -1)
if (
(*__errno_location ())
!=
4
)
sshfatal("sshconnect.c", __func__, 183, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Couldn't wait for child: %s", strerror(
(*__errno_location ())
));
if (ssh_packet_set_connection(ssh, sock, sock) ==
((void *)0)
)
return -1;
return 0;
}
| undefined8
ssh_proxy_fdpass_connect
(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined2 param_4,
undefined8 param_5)
{
int iVar1;
__pid_t _Var2;
int *piVar3;
char *pcVar4;
long lVar5;
undefined8 uVar6;
char **ppcVar7;
undefined *puVar8;
undefined *puVar9;
long in_FS_OFFSET;
char *apcStack240 [7];
undefined auStack184 [8];
undefined8 local_b0;
undefined2 local_a4;
undefined8 local_a0;
undefined8 local_98;
undefined8 local_90;
__pid_t local_88;
int local_84;
char *local_80;
void *local_78;
int local_70;
int local_6c;
char *local_68;
undefined *local_60;
void *local_58;
undefined8 local_50;
long local_10;
ppcVar7 = (char **)auStack184;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
apcStack240[6] = (char *)0x10015a;
local_b0 = param_5;
local_a4 = param_4;
local_a0 = param_3;
local_98 = param_2;
local_90 = param_1;
local_80 = getenv("SHELL");
if (local_80 == (char *)0x0) {
local_80 = "/bin/sh";
}
apcStack240[6] = (char *)0x10018b;
iVar1 = socketpair(1,1,0,&local_70);
if (iVar1 == -1) {
apcStack240[6] = (char *)0x100195;
piVar3 = __errno_location();
apcStack240[6] = (char *)0x10019e;
apcStack240[6] = strerror(*piVar3);
ppcVar7 = apcStack240 + 5;
apcStack240[5] = "Could not create socketpair to communicate with proxy dialer: %.100s";
sshfatal("sshconnect.c","ssh_proxy_fdpass_connect",0x7e,0,1,0);
}
*(undefined8 *)((long)ppcVar7 + -8) = 0x100203;
local_78 = (void *)expand_proxy_command(local_b0,_htonl,local_98,local_a0,local_a4);
*(void **)((long)ppcVar7 + -8) = local_78;
*(char **)((long)ppcVar7 + -0x10) = "Executing proxy dialer command: %.500s";
*(undefined8 *)((long)ppcVar7 + -0x18) = 0x100240;
sshlog("sshconnect.c","ssh_proxy_fdpass_connect",0x83,0,5,0);
*(undefined8 *)((long)ppcVar7 + -8) = 0x100249;
local_88 = fork();
if (local_88 == 0) {
*(undefined8 *)((long)ppcVar7 + -8) = 0x100260;
close(local_6c);
if (local_70 != 0) {
*(undefined8 *)((long)ppcVar7 + -8) = 0x100276;
iVar1 = dup2(local_70,0);
if (iVar1 == -1) {
*(undefined8 *)((long)ppcVar7 + -8) = 0x100287;
perror("dup2 stdin");
}
}
if (local_70 != 1) {
*(undefined8 *)((long)ppcVar7 + -8) = 0x10029e;
iVar1 = dup2(local_70,1);
if (iVar1 == -1) {
*(undefined8 *)((long)ppcVar7 + -8) = 0x1002af;
perror("dup2 stdout");
}
}
if (1 < local_70) {
*(undefined8 *)((long)ppcVar7 + -8) = 0x1002c1;
close(local_70);
}
if (((debug_flag == 0) && (_DAT_00109360 != 0)) && (_DAT_0010936c != 0)) {
*(undefined8 *)((long)ppcVar7 + -8) = 0x1002f5;
iVar1 = stdfd_devnull(0,0,1);
if (iVar1 == -1) {
*(char **)((long)ppcVar7 + -0x10) = "stdfd_devnull failed";
*(undefined8 *)((long)ppcVar7 + -0x18) = 0x100334;
sshlog("sshconnect.c","ssh_proxy_fdpass_connect",0x9c,1,2,0);
}
}
local_68 = local_80;
local_60 = &DAT_00105b3b;
local_58 = local_78;
local_50 = 0;
*(undefined8 *)((long)ppcVar7 + -8) = 0x10036e;
execv(local_80,&local_68);
*(undefined8 *)((long)ppcVar7 + -8) = 0x10037a;
perror(local_68);
*(undefined8 *)((long)ppcVar7 + -8) = 0x100384;
exit(1);
}
puVar9 = (undefined *)ppcVar7;
if (local_88 == -1) {
*(undefined8 *)((long)ppcVar7 + -8) = 0x10038f;
piVar3 = __errno_location();
iVar1 = *piVar3;
*(undefined8 *)((long)ppcVar7 + -8) = 0x100398;
pcVar4 = strerror(iVar1);
*(char **)((long)ppcVar7 + -8) = pcVar4;
puVar9 = (undefined *)((long)ppcVar7 + -0x10);
*(char **)((long)ppcVar7 + -0x10) = "fork failed: %.100s";
*(undefined8 *)((long)ppcVar7 + -0x18) = 0x1003cf;
sshfatal("sshconnect.c","ssh_proxy_fdpass_connect",0xad,0,1,0);
}
*(undefined8 *)(puVar9 + -8) = 0x1003d9;
close(local_70);
*(undefined8 *)(puVar9 + -8) = 0x1003e5;
free(local_78);
*(undefined8 *)(puVar9 + -8) = 0x1003ef;
local_84 = mm_receive_fd();
puVar8 = puVar9;
if (local_84 == -1) {
puVar8 = puVar9 + -0x10;
*(char **)(puVar9 + -0x10) = "proxy dialer did not pass back a connection";
*(undefined8 *)(puVar9 + -0x18) = 0x100432;
sshfatal("sshconnect.c","ssh_proxy_fdpass_connect",0xb2,0,1,0);
}
*(undefined8 *)(puVar8 + -8) = 0x10043c;
close(local_6c);
puVar9 = puVar8;
while( true ) {
*(undefined8 *)(puVar9 + -8) = 0x1004a3;
_Var2 = waitpid(local_88,(int *)0x0,0);
if (_Var2 != -1) break;
*(undefined8 *)(puVar9 + -8) = 0x100443;
piVar3 = __errno_location();
if (*piVar3 != 4) {
*(undefined8 *)(puVar9 + -8) = 0x10044f;
piVar3 = __errno_location();
iVar1 = *piVar3;
*(undefined8 *)(puVar9 + -8) = 0x100458;
pcVar4 = strerror(iVar1);
*(char **)(puVar9 + -8) = pcVar4;
*(char **)(puVar9 + -0x10) = "Couldn\'t wait for child: %s";
*(undefined8 *)(puVar9 + -0x18) = 0x10048f;
sshfatal("sshconnect.c","ssh_proxy_fdpass_connect",0xb7,0,1,0);
puVar9 = puVar9 + -0x10;
}
}
*(undefined8 *)(puVar9 + -8) = 0x1004bf;
lVar5 = ssh_packet_set_connection(local_90,local_84,local_84);
if (lVar5 == 0) {
uVar6 = 0xffffffff;
}
else {
uVar6 = 0;
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
*(undefined8 *)(puVar9 + -8) = 0x1004e4;
__stack_chk_fail();
}
return uVar6;
}
|
static int
emacs_edit_and_execute_command (count, c)
int count, c;
{
return (edit_and_execute_command (count, c, 1, "fc -e \"${VISUAL:-${EDITOR:-emacs}}\""));
}
| void emacs_edit_and_execute_command(undefined4 param_1,undefined4 param_2)
{
edit_and_execute_command(param_1,param_2,1,"fc -e \"${VISUAL:-${EDITOR:-emacs}}\"");
return;
}
|
static void log_gpasswd_success_group (__attribute__((unused)) void *arg)
{
char buf[1024];
snprintf (buf, 1023, " in %s", gr_dbname ());
buf[1023] = '\0';
log_gpasswd_success (buf);
}
| long long log_gpasswd_success_group(unsigned long a0) {
unsigned long v0;
char v1;
char v2;
v0 = a0;
snprintf(&v1, 0x3ff, " in %s", gr_dbname());
v2 = 0;
log_gpasswd_success(&v1);
return 0;
}
|
static
_Bool
match_lname (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr,
_Bool
ignore_case)
{
_Bool
ret =
0
;
if (
((((
stat_buf->st_mode
)) & 0170000) == (0120000))
)
{
char *linkname = areadlinkat (state.cwd_dir_fd, state.rel_pathname);
if (linkname)
{
if (fnmatch (pred_ptr->args.str, linkname,
ignore_case ?
(1 << 4)
: 0) == 0)
ret =
1
;
}
else
{
nonfatal_target_file_error (
(*__errno_location ())
, pathname);
state.exit_status =
1
;
}
free (linkname);
}
return ret;
}
| void match_lname(unsigned long long a0, struct_0 *a1, struct_1 *a2, unsigned long a3) {
char v0;
void* v1;
unsigned long long v4;
v0 = 0;
if ((a1->field_18 & 0xf000) == 0xa000) {
v1 = areadlinkat(__errno_location, strcmp, strcmp);
if (v1) {
*(&a2) = (!a3 ? 16 : 0);
if (!fnmatch(a2->field_38, v1, a2))
v0 = 1;
} else {
nonfatal_target_file_error(*(__errno_location()), a0, a0);
g_50004c = 1;
}
free(v1);
}
v4 = v0;
return;
}
|
static inline char *
timetostr (time_t t, char *buf)
{
return ((! ((time_t) 0 < (time_t) -1))
? imaxtostr (t, buf)
: umaxtostr (t, buf));
}
| void timetostr(undefined8 param_1,undefined8 param_2)
{
imaxtostr(param_1,param_2);
return;
}
|
int
pidfile_close(struct pidfh *pfh)
{
int error;
error = pidfile_verify(pfh);
if (error != 0) {
(*__errno_location ())
= error;
return (-1);
}
if (close(pfh->pf_fd) == -1)
error =
(*__errno_location ())
;
free(pfh->pf_path);
free(pfh);
if (error != 0) {
(*__errno_location ())
= error;
return (-1);
}
return (0);
}
| long long pidfile_close(struct_0 *a0) {
unsigned int v0;
unsigned long long v2;
unsigned long long v3;
v0 = pidfile_verify(a0);
if (v0) {
*(__errno_location()) = v0;
v3 = 4294967295;
} else {
v2 = close(a0->field_0);
if (v2 == -1) {
*(&v2) = *(__errno_location());
v0 = v2;
}
free(a0->field_8);
free(a0);
if (v0) {
*(__errno_location()) = v0;
v3 = 4294967295;
} else {
v3 = 0;
}
}
return v3;
}
|
static
_Bool
owner_failure_ok (struct cp_options const *x)
{
return ((
(*__errno_location ())
==
1
||
(*__errno_location ())
==
22
) && !x->owner_privileges);
}
| int owner_failure_ok(struct_0 *a0) {
unsigned int v3;
unsigned int v4;
if (*(__errno_location()) != 1 && !(*(__errno_location()) == 22))
goto LABEL_4070be;
if ((a0->field_1b ^ 1)) {
v3 = 1;
goto LABEL_4070c3;
}
LABEL_4070be:
v3 = 0;
LABEL_4070c3:
v4 = v3 & 1;
return v4;
}
|
static
void signal_handler(int sig)
{
((got_signals) |= (1 << (sig)));
}
| void signal_handler(byte param_1)
{
got_signals = got_signals | 1 << (param_1 & 0x1f);
return;
}
|
inline __u32 jbd2_chksum(journal_t *j __attribute__((unused)),
__u32 crc, const void *address,
unsigned int length)
{
return ext2fs_crc32c_le(crc, address, length);
}
| void jbd2_chksum(void)
{
halt_baddata();
}
|
static int
spt_copyenv(int envc, char *envp[])
{
char **envcopy;
char *eq;
int envsize;
int i, error;
if (environ != envp)
return 0;
envsize = (envc + 1) * sizeof(char *);
envcopy = malloc(envsize);
if (envcopy ==
((void *)0)
)
return
(*__errno_location ())
;
memcpy(envcopy, envp, envsize);
error = spt_clearenv();
if (error) {
environ = envp;
free(envcopy);
return error;
}
for (i = 0; envcopy[i]; i++) {
eq = strchr(envcopy[i], '=');
if (eq ==
((void *)0)
)
continue;
*eq = '\0';
if (setenv(envcopy[i], eq + 1, 1) < 0)
error =
(*__errno_location ())
;
*eq = '=';
if (error) {
environ = envcopy;
return error;
}
}
free(envcopy);
return 0;
}
| long spt_copyenv(int a1, char **a2)
{
int i;
unsigned int v4;
void *dest;
char *v6;
if ( a2 != environ )
return 0LL;
dest = malloc(8 * (a1 + 1));
if ( !dest )
return (unsigned int)*_errno_location();
memcpy(dest, a2, 8 * (a1 + 1));
v4 = spt_clearenv();
if ( v4 )
{
environ = a2;
free(dest);
return v4;
}
else
{
for ( i = 0; *((_QWORD *)dest + i); ++i )
{
v6 = strchr(*((const char **)dest + i), 61);
if ( v6 )
{
*v6 = 0;
if ( setenv(*((const char **)dest + i), v6 + 1, 1) < 0 )
v4 = *_errno_location();
*v6 = 61;
if ( v4 )
{
environ = (char **)dest;
return v4;
}
}
}
free(dest);
return 0LL;
}
}
|
static inline ext2_ino_t *quota_sb_inump(struct ext2_super_block *sb,
enum quota_type qtype)
{
switch (qtype) {
case USRQUOTA:
return &sb->s_usr_quota_inum;
case GRPQUOTA:
return &sb->s_grp_quota_inum;
case PRJQUOTA:
return &sb->s_prj_quota_inum;
default:
return
((void *)0)
;
}
return
((void *)0)
;
}
| int quota_sb_inump(unsigned long a0, unsigned long a1) {
unsigned int v1;
if (a1 == 2) {
v1 = a0 + 620;
} else {
if (a1 <= 2) {
if (!a1) {
v1 = a0 + 576;
goto LABEL_4002e8;
}
if (a1 == 1) {
v1 = a0 + 580;
goto LABEL_4002e8;
}
}
v1 = 0;
}
LABEL_4002e8:
return v1;
}
|
static int check_ext_attr(e2fsck_t ctx, struct problem_context *pctx,
char *block_buf, struct ea_quota *ea_block_quota)
{
ext2_filsys fs = ctx->fs;
ext2_ino_t ino = pctx->ino;
struct ext2_inode *inode = pctx->inode;
blk64_t blk;
char * end;
struct ext2_ext_attr_header *header;
struct ext2_ext_attr_entry *first, *entry;
blk64_t quota_blocks = ((1) << (fs)->cluster_ratio_bits);
__u64 quota_inodes = 0;
region_t region = 0;
int failed_csum = 0;
ea_block_quota->blocks = 0;
ea_block_quota->inodes = 0;
blk = ext2fs_file_acl_block(fs, inode);
if (blk == 0)
return 0;
if (!ext2fs_has_feature_xattr(fs->super) ||
(blk < fs->super->s_first_data_block) ||
(blk >= ext2fs_blocks_count(fs->super))) {
mark_inode_bad(ctx, ino);
return 0;
}
if (!ctx->block_ea_map) {
pctx->errcode = e2fsck_allocate_block_bitmap(fs,
(gettext ("ext attr block map")),
2, "block_ea_map",
&ctx->block_ea_map);
if (pctx->errcode) {
pctx->num = 2;
fix_problem(ctx, 0x010025, pctx);
ctx->flags |= 0x0001;
return 0;
}
}
if (!ctx->refcount) {
pctx->errcode = ea_refcount_create(0, &ctx->refcount);
if (pctx->errcode) {
pctx->num = 1;
fix_problem(ctx, 0x010038, pctx);
ctx->flags |= 0x0001;
return 0;
}
}
if (ext2fs_fast_test_block_bitmap2(ctx->block_ea_map, blk)) {
ea_block_quota->blocks = ((1) << (fs)->cluster_ratio_bits);
ea_block_quota->inodes = 0;
if (ctx->ea_block_quota_blocks) {
ea_refcount_fetch(ctx->ea_block_quota_blocks, blk,
"a_blocks);
if (quota_blocks)
ea_block_quota->blocks = quota_blocks;
}
if (ctx->ea_block_quota_inodes)
ea_refcount_fetch(ctx->ea_block_quota_inodes, blk,
&ea_block_quota->inodes);
if (ea_refcount_decrement(ctx->refcount, blk, 0) == 0)
return 1;
if (!ctx->refcount_extra) {
pctx->errcode = ea_refcount_create(0,
&ctx->refcount_extra);
if (pctx->errcode) {
pctx->num = 2;
fix_problem(ctx, 0x010038, pctx);
ctx->flags |= 0x0001;
return 0;
}
}
ea_refcount_increment(ctx->refcount_extra, blk, 0);
return 1;
}
pctx->blk = blk;
pctx->errcode = ext2fs_read_ext_attr3(fs, blk, block_buf, pctx->ino);
if (pctx->errcode == (2133571479L)) {
pctx->errcode = 0;
failed_csum = 1;
} else if (pctx->errcode == (2133571489L))
pctx->errcode = 0;
if (pctx->errcode &&
fix_problem(ctx, 0x010039, pctx)) {
pctx->errcode = 0;
goto clear_extattr;
}
header = (struct ext2_ext_attr_header *) block_buf;
pctx->blk = ext2fs_file_acl_block(fs, inode);
if (((ctx->ext_attr_ver == 1) &&
(header->h_magic != 0xEA010000)) ||
((ctx->ext_attr_ver == 2) &&
(header->h_magic != 0xEA020000))) {
if (fix_problem(ctx, 0x01003A, pctx))
goto clear_extattr;
}
if (header->h_blocks != 1) {
if (fix_problem(ctx, 0x01003E, pctx))
goto clear_extattr;
}
if (pctx->errcode && fix_problem(ctx, 0x010039, pctx))
goto clear_extattr;
region = region_create(0, fs->blocksize);
if (!region) {
fix_problem(ctx, 0x01003F, pctx);
ctx->flags |= 0x0001;
return 0;
}
if (region_allocate(region, 0, sizeof(struct ext2_ext_attr_header))) {
if (fix_problem(ctx, 0x010040, pctx))
goto clear_extattr;
}
first = (struct ext2_ext_attr_entry *)(header+1);
end = block_buf + fs->blocksize;
entry = first;
while ((char *)entry < end && *(__u32 *)entry) {
__u32 hash;
if (region_allocate(region, (char *)entry - (char *)header,
(((entry->e_name_len) + (((unsigned) 1<<2)-1) + sizeof(struct ext2_ext_attr_entry)) & ~(((unsigned) 1<<2)-1)))) {
if (fix_problem(ctx, 0x010040, pctx))
goto clear_extattr;
break;
}
if ((ctx->ext_attr_ver == 1 &&
(entry->e_name_len == 0 || entry->e_name_index != 0)) ||
(ctx->ext_attr_ver == 2 &&
entry->e_name_index == 0)) {
if (fix_problem(ctx, 0x010041, pctx))
goto clear_extattr;
break;
}
if (entry->e_value_inum == 0) {
if (entry->e_value_offs + entry->e_value_size >
fs->blocksize) {
if (fix_problem(ctx, 0x010042, pctx))
goto clear_extattr;
break;
}
if (entry->e_value_size &&
region_allocate(region, entry->e_value_offs,
(((entry->e_value_size) + (((unsigned) 1<<2)-1)) & ~(((unsigned) 1<<2)-1)))) {
if (fix_problem(ctx, 0x010040,
pctx))
goto clear_extattr;
}
hash = ext2fs_ext_attr_hash_entry(entry, block_buf +
entry->e_value_offs);
if (entry->e_hash != hash) {
pctx->num = entry->e_hash;
if (fix_problem(ctx, 0x010054, pctx))
goto clear_extattr;
entry->e_hash = hash;
}
} else {
problem_t problem;
blk64_t entry_quota_blocks;
problem = check_large_ea_inode(ctx, entry, pctx,
&entry_quota_blocks);
if (problem && fix_problem(ctx, problem, pctx))
goto clear_extattr;
quota_blocks += entry_quota_blocks;
quota_inodes++;
}
entry = ( (struct ext2_ext_attr_entry *)( (char *)(entry) + ((((entry)->e_name_len) + (((unsigned) 1<<2)-1) + sizeof(struct ext2_ext_attr_entry)) & ~(((unsigned) 1<<2)-1))) );
}
if (region_allocate(region, (char *)entry - (char *)header, 4)) {
if (fix_problem(ctx, 0x010040, pctx))
goto clear_extattr;
}
region_free(region);
if (failed_csum &&
fix_problem(ctx, 0x01006C, pctx)) {
pctx->errcode = ext2fs_write_ext_attr3(fs, blk, block_buf,
pctx->ino);
if (pctx->errcode)
return 0;
}
if (quota_blocks != ((1U) << (fs)->cluster_ratio_bits)) {
if (!ctx->ea_block_quota_blocks) {
pctx->errcode = ea_refcount_create(0,
&ctx->ea_block_quota_blocks);
if (pctx->errcode) {
pctx->num = 3;
goto refcount_fail;
}
}
ea_refcount_store(ctx->ea_block_quota_blocks, blk,
quota_blocks);
}
if (quota_inodes) {
if (!ctx->ea_block_quota_inodes) {
pctx->errcode = ea_refcount_create(0,
&ctx->ea_block_quota_inodes);
if (pctx->errcode) {
pctx->num = 4;
refcount_fail:
fix_problem(ctx, 0x010038, pctx);
ctx->flags |= 0x0001;
return 0;
}
}
ea_refcount_store(ctx->ea_block_quota_inodes, blk,
quota_inodes);
}
ea_block_quota->blocks = quota_blocks;
ea_block_quota->inodes = quota_inodes;
inc_ea_inode_refs(ctx, pctx, first, end);
ea_refcount_store(ctx->refcount, blk, header->h_refcount - 1);
mark_block_used(ctx, blk);
ext2fs_fast_mark_block_bitmap2(ctx->block_ea_map, blk);
return 1;
clear_extattr:
if (region)
region_free(region);
ext2fs_file_acl_block_set(fs, inode, 0);
e2fsck_write_inode(ctx, ino, inode, "check_ext_attr");
return 0;
}
| long check_ext_attr(long a1, long a2, _DWORD *a3, _QWORD *a4)
{
char *v5;
int v8;
unsigned int v9;
unsigned int v10;
unsigned int v11;
long v12;
unsigned long v13;
char *i;
long v15;
long v16;
long v17;
long v18;
unsigned long v19;
_DWORD *v20;
unsigned int *v21;
unsigned long v22;
unsigned long v23;
v23 = __readfsqword(0x28u);
v17 = *(_QWORD *)a1;
v9 = *(_DWORD *)(a2 + 8);
v18 = *(_QWORD *)(a2 + 24);
v12 = 1 << *(_DWORD *)(v17 + 192);
v15 = 0LL;
v16 = 0LL;
v8 = 0;
*a4 = 0LL;
a4[1] = 0LL;
v19 = ext2fs_file_acl_block(v17, v18);
if ( !v19 )
return 0LL;
if ( !ext2fs_has_feature_xattr(*(_QWORD *)(v17 + 32))
|| v19 < *(unsigned int *)(*(_QWORD *)(v17 + 32) + 20LL)
|| v19 >= ext2fs_blocks_count(*(_QWORD *)(v17 + 32)) )
{
mark_inode_bad(a1, v9);
return 0LL;
}
if ( !*(_QWORD *)(a1 + 432) )
{
v5 = gettext("ext attr block map");
*(_QWORD *)a2 = e2fsck_allocate_block_bitmap(v17, v5, 2LL, "block_ea_map", a1 + 432);
if ( *(_QWORD *)a2 )
{
*(_QWORD *)(a2 + 80) = 2LL;
fix_problem(a1, 65573LL, a2);
*(_DWORD *)(a1 + 72) |= 1u;
return 0LL;
}
}
if ( !*(_QWORD *)(a1 + 456) )
{
*(_QWORD *)a2 = ea_refcount_create(0LL, a1 + 456);
if ( *(_QWORD *)a2 )
{
*(_QWORD *)(a2 + 80) = 1LL;
fix_problem(a1, 65592LL, a2);
*(_DWORD *)(a1 + 72) |= 1u;
return 0LL;
}
}
if ( (unsigned int)ext2fs_fast_test_block_bitmap2(*(_QWORD *)(a1 + 432), v19) )
{
*a4 = 1 << *(_DWORD *)(v17 + 192);
a4[1] = 0LL;
if ( *(_QWORD *)(a1 + 472) )
{
ea_refcount_fetch(*(_QWORD *)(a1 + 472), v19, &v12);
if ( v12 )
*a4 = v12;
}
if ( *(_QWORD *)(a1 + 480) )
ea_refcount_fetch(*(_QWORD *)(a1 + 480), v19, a4 + 1);
if ( !ea_refcount_decrement(*(_QWORD *)(a1 + 456), v19, 0LL) )
return 1LL;
if ( *(_QWORD *)(a1 + 464) || (*(_QWORD *)a2 = ea_refcount_create(0LL, a1 + 464)) == 0LL )
{
ea_refcount_increment(*(_QWORD *)(a1 + 464), v19, 0LL);
return 1LL;
}
else
{
*(_QWORD *)(a2 + 80) = 2LL;
fix_problem(a1, 65592LL, a2);
*(_DWORD *)(a1 + 72) |= 1u;
return 0LL;
}
}
*(_QWORD *)(a2 + 40) = v19;
*(_QWORD *)a2 = ext2fs_read_ext_attr3(v17, v19, a3, *(unsigned int *)(a2 + 8));
if ( *(_QWORD *)a2 == 2133571479LL )
{
*(_QWORD *)a2 = 0LL;
v8 = 1;
}
else if ( *(_QWORD *)a2 == 2133571489LL )
{
*(_QWORD *)a2 = 0LL;
}
if ( !*(_QWORD *)a2 || !(unsigned int)fix_problem(a1, 65593LL, a2) )
{
v20 = a3;
*(_QWORD *)(a2 + 40) = ext2fs_file_acl_block(v17, v18);
if ( (*(_DWORD *)(a1 + 856) == 1 && *v20 != -369033216 || *(_DWORD *)(a1 + 856) == 2 && *v20 != -368967680)
&& (unsigned int)fix_problem(a1, 65594LL, a2)
|| v20[2] != 1 && (unsigned int)fix_problem(a1, 65598LL, a2)
|| *(_QWORD *)a2 && (unsigned int)fix_problem(a1, 65593LL, a2) )
{
goto LABEL_90;
}
v16 = region_create(0LL, *(unsigned int *)(v17 + 40));
if ( !v16 )
{
fix_problem(a1, 65599LL, a2);
*(_DWORD *)(a1 + 72) |= 1u;
return 0LL;
}
if ( (unsigned int)region_allocate(v16, 0LL, 32LL) && (unsigned int)fix_problem(a1, 65600LL, a2) )
goto LABEL_90;
v21 = v20 + 8;
v22 = (unsigned long)a3 + *(unsigned int *)(v17 + 40);
for ( i = (char *)(v20 + 8); (unsigned long)i < v22 && *(_DWORD *)i; i += ((unsigned char)*i + 19) & 0xFFFFFFFC )
{
if ( (unsigned int)region_allocate(v16, i - (char *)v20, ((unsigned char)*i + 19) & 0xFFFFFFFC) )
{
if ( (unsigned int)fix_problem(a1, 65600LL, a2) )
goto LABEL_90;
break;
}
if ( *(_DWORD *)(a1 + 856) == 1 && (!*i || i[1]) || *(_DWORD *)(a1 + 856) == 2 && !i[1] )
{
if ( (unsigned int)fix_problem(a1, 65601LL, a2) )
goto LABEL_90;
break;
}
if ( *((_DWORD *)i + 1) )
{
v10 = check_large_ea_inode((long *)a1, (unsigned int *)i, a2, &v13);
if ( v10 && (unsigned int)fix_problem(a1, v10, a2) )
goto LABEL_90;
v12 += v13;
++v15;
}
else
{
if ( *((_DWORD *)i + 2) + (unsigned int)*((unsigned short *)i + 1) > *(_DWORD *)(v17 + 40) )
{
if ( (unsigned int)fix_problem(a1, 65602LL, a2) )
goto LABEL_90;
break;
}
if ( *((_DWORD *)i + 2)
&& (unsigned int)region_allocate(v16, *((unsigned short *)i + 1), (*((_DWORD *)i + 2) + 3) & 0xFFFFFFFC)
&& (unsigned int)fix_problem(a1, 65600LL, a2) )
{
goto LABEL_90;
}
v11 = ext2fs_ext_attr_hash_entry(i, (char *)a3 + *((unsigned short *)i + 1));
if ( v11 != *((_DWORD *)i + 3) )
{
*(_QWORD *)(a2 + 80) = *((unsigned int *)i + 3);
if ( (unsigned int)fix_problem(a1, 65620LL, a2) )
goto LABEL_90;
*((_DWORD *)i + 3) = v11;
}
}
}
if ( (unsigned int)region_allocate(v16, i - (char *)v20, 4LL) && (unsigned int)fix_problem(a1, 65600LL, a2) )
goto LABEL_90;
region_free(v16);
if ( v8 )
{
if ( (unsigned int)fix_problem(a1, 65644LL, a2) )
{
*(_QWORD *)a2 = ext2fs_write_ext_attr3(v17, v19, a3, *(unsigned int *)(a2 + 8));
if ( *(_QWORD *)a2 )
return 0LL;
}
}
if ( 1 << *(_DWORD *)(v17 + 192) != v12 )
{
if ( !*(_QWORD *)(a1 + 472) )
{
*(_QWORD *)a2 = ea_refcount_create(0LL, a1 + 472);
if ( *(_QWORD *)a2 )
{
*(_QWORD *)(a2 + 80) = 3LL;
LABEL_87:
fix_problem(a1, 65592LL, a2);
*(_DWORD *)(a1 + 72) |= 1u;
return 0LL;
}
}
ea_refcount_store(*(_QWORD *)(a1 + 472), v19, v12);
}
if ( v15 )
{
if ( !*(_QWORD *)(a1 + 480) )
{
*(_QWORD *)a2 = ea_refcount_create(0LL, a1 + 480);
if ( *(_QWORD *)a2 )
{
*(_QWORD *)(a2 + 80) = 4LL;
goto LABEL_87;
}
}
ea_refcount_store(*(_QWORD *)(a1 + 480), v19, v15);
}
*a4 = v12;
a4[1] = v15;
inc_ea_inode_refs((unsigned int *)a1, (_QWORD *)a2, v21, v22);
ea_refcount_store(*(_QWORD *)(a1 + 456), v19, (unsigned int)(v20[1] - 1));
mark_block_used(a1, v19);
ext2fs_fast_mark_block_bitmap2(*(_QWORD *)(a1 + 432), v19);
return 1LL;
}
*(_QWORD *)a2 = 0LL;
LABEL_90:
if ( v16 )
region_free(v16);
ext2fs_file_acl_block_set(v17, v18, 0LL);
e2fsck_write_inode(a1, v9, v18, "check_ext_attr");
return 0LL;
}
|
int iplink_ifla_xstats(int argc, char **argv)
{
struct link_util *lu =
((void *)0)
;
__u32 filt_mask;
if (!argc) {
fprintf(
stderr
, "xstats: missing argument\n");
return -1;
}
if (matches(*argv, "type") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
lu = get_link_kind(*argv);
if (!lu)
invarg("invalid type", *argv);
} else if (matches(*argv, "help") == 0) {
print_explain(
stdout
);
return 0;
} else {
invarg("unknown argument", *argv);
}
if (!lu) {
print_explain(
stderr
);
return -1;
}
if (!lu->print_ifla_xstats) {
fprintf(
stderr
, "xstats: link type %s doesn't support xstats\n",
lu->id);
return -1;
}
if (lu->parse_ifla_xstats &&
lu->parse_ifla_xstats(lu, argc-1, argv+1))
return -1;
if (strstr(lu->id, "_slave"))
filt_mask = (1 << (IFLA_STATS_LINK_XSTATS_SLAVE - 1));
else
filt_mask = (1 << (IFLA_STATS_LINK_XSTATS - 1));
if (rtnl_statsdump_req_filter(&rth,
0
, filt_mask,
((void *)0)
,
((void *)0)
) < 0) {
perror("Cannont send dump request");
return -1;
}
new_json_obj(json);
if (rtnl_dump_filter_nc(&rth, lu->print_ifla_xstats,
stdout
, 0) < 0) {
delete_json_obj();
fprintf(
stderr
, "Dump terminated\n");
return -1;
}
delete_json_obj();
return 0;
}
| undefined8 iplink_ifla_xstats(int param_1,undefined8 *param_2)
{
char cVar1;
int iVar2;
undefined8 uVar3;
char *pcVar4;
undefined8 *local_28;
int local_1c;
undefined4 local_14;
long local_10;
local_10 = 0;
if (param_1 == 0) {
fprintf(stderr,"xstats: missing argument\n");
return 0xffffffff;
}
cVar1 = matches(*param_2,&DAT_001002c0);
local_28 = param_2;
local_1c = param_1;
if (cVar1 != '\x01') {
local_28 = param_2 + 1;
local_1c = param_1 + -1;
if (local_1c < 1) {
incomplete_command();
}
local_10 = get_link_kind(*local_28);
if (local_10 != 0) goto LAB_0010011e;
invarg("invalid type",*local_28);
}
cVar1 = matches(*local_28,&DAT_001002d2);
if (cVar1 != '\x01') {
print_explain(stdout);
return 0;
}
invarg("unknown argument",*local_28);
LAB_0010011e:
if (local_10 == 0) {
print_explain(stderr);
uVar3 = 0xffffffff;
}
else if (*(long *)(local_10 + 0x40) == 0) {
fprintf(stderr,"xstats: link type %s doesn\'t support xstats\n",*(undefined8 *)(local_10 + 8));
uVar3 = 0xffffffff;
}
else {
if ((*(long *)(local_10 + 0x38) != 0) &&
(iVar2 = (**(code **)(local_10 + 0x38))(local_10,local_1c + -1,local_28 + 1), iVar2 != 0)) {
return 0xffffffff;
}
pcVar4 = strstr(*(char **)(local_10 + 8),"_slave");
if (pcVar4 == (char *)0x0) {
local_14 = 2;
}
else {
local_14 = 4;
}
iVar2 = rtnl_statsdump_req_filter(&rth,0,local_14,0,0);
if (iVar2 < 0) {
perror("Cannont send dump request");
uVar3 = 0xffffffff;
}
else {
new_json_obj(json);
iVar2 = rtnl_dump_filter_nc(&rth,*(undefined8 *)(local_10 + 0x40),stdout,0);
if (iVar2 < 0) {
delete_json_obj();
fprintf(stderr,"Dump terminated\n");
uVar3 = 0xffffffff;
}
else {
delete_json_obj();
uVar3 = 0;
}
}
}
return uVar3;
}
|
static void
gnu_add_multi_volume_header (struct bufmap *map)
{
int tmp;
union block *block = find_next_block ();
size_t len = strlen (map->file_name);
if (len > 100)
{
do { if (error_hook) error_hook (); error (0, 0, gettext ("%s: file name too long to be stored in a GNU multivolume header, truncated"), quotearg_colon (map->file_name)); } while (0)
;
len = 100;
}
memset (block, 0, 512);
memcpy (block->header.name, map->file_name, len);
block->header.typeflag = 'M';
off_to_chars (map->sizeleft, block->header.size, sizeof (block->header.size));
off_to_chars (map->sizetotal - map->sizeleft, block->oldgnu_header.offset, sizeof (block->oldgnu_header.offset))
;
tmp = verbose_option;
verbose_option = 0;
finish_header (¤t_stat_info, block, -1);
verbose_option = tmp;
set_next_block_after (block);
}
| void gnu_add_multi_volume_header(long param_1)
{
undefined4 uVar1;
void *__s;
undefined8 uVar2;
undefined8 uVar3;
size_t local_28;
__s = (void *)find_next_block();
local_28 = strlen(*(char **)(param_1 + 0x10));
if (100 < local_28) {
if (error_hook != (code *)0x0) {
(*error_hook)();
}
uVar2 = quotearg_colon(*(undefined8 *)(param_1 + 0x10));
uVar3 = gettext("%s: file name too long to be stored in a GNU multivolume header, truncated");
error(0,0,uVar3,uVar2);
local_28 = 100;
}
memset(__s,0,0x200);
memcpy(__s,*(void **)(param_1 + 0x10),local_28);
*(undefined *)((long)__s + 0x9c) = 0x4d;
off_to_chars(*(undefined8 *)(param_1 + 0x20),(long)__s + 0x7c,0xc);
off_to_chars(*(long *)(param_1 + 0x18) - *(long *)(param_1 + 0x20),(long)__s + 0x171,0xc);
uVar1 = verbose_option;
verbose_option = 0;
finish_header(¤t_stat_info,__s,0xffffffffffffffff);
verbose_option = uVar1;
set_next_block_after(__s);
return;
}
|
static void
permute_args(int panonopt_start, int panonopt_end, int opt_end,
char * const *nargv)
{
int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos;
char *swap;
nnonopts = panonopt_end - panonopt_start;
nopts = opt_end - panonopt_end;
ncycle = gcd(nnonopts, nopts);
cyclelen = (opt_end - panonopt_start) / ncycle;
for (i = 0; i < ncycle; i++) {
cstart = panonopt_end+i;
pos = cstart;
for (j = 0; j < cyclelen; j++) {
if (pos >= panonopt_end)
pos -= nnonopts;
else
pos += nopts;
swap = nargv[pos];
((char **) nargv)[pos] = nargv[cstart];
((char **)nargv)[cstart] = swap;
}
}
}
| void permute_args(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long long *a3) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned long v8;
unsigned long long v10;
unsigned long long v11;
v3 = __subvsi3(a1, a0);
v4 = __subvsi3(a2, a1);
v5 = gcd(v3, v4);
v10 = __subvsi3(a2, a0);
*(&v10) = (v10 >> 31 CONCAT v10) /m v5;
v6 = v10;
v0 = 0;
while (true) {
v11 = v0;
if (v0 >= v5)
break;
v7 = __addvsi3(a1, v0);
v2 = v7;
for (v1 = 0; v1 < v6; v1 = __addvsi3(v1, 0x1)) {
if (v2 < a1)
v2 = __addvsi3(v2, v4);
else
v2 = __subvsi3(v2, v3);
v8 = a3[v2];
a3[v2] = a3[v7];
a3[v7] = v8;
}
v0 = __addvsi3(v0, 0x1);
}
return;
}
|
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] [FILE]\nWrite totally ordered list consistent with the partial ordering in FILE.\n")
, program_name);
emit_stdin_note ();
fputs_unlocked (gettext ("\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 ("tsort");
}
exit (status);
}
| void usage(unsigned long a0) {
unsigned long v0;
unsigned long v2;
v0 = v2;
if (a0) {
fprintf(stderr, gettext("Try '%s --help' for more information.\n"));
} else {
printf(gettext("Usage: %s [OPTION] [FILE]\nWrite totally ordered list consistent with the partial ordering in FILE.\n"));
emit_stdin_note();
fputs_unlocked(gettext("\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("tsort");
}
exit(a0);
}
|
static int
wextglob_skipname (pat, dname, flags)
wchar_t *pat, *dname;
int flags;
{
wchar_t *pp, *pe, *t, *se, n;
int r, negate, wild, nullpat, xflags;
negate = *pat == L'!';
wild = *pat == L'*' || *pat == L'?';
pp = pat + 2;
se = pp + wcslen (pp);
pe = glob_patscan_wc (pp, se, 0);
if (pe == 0)
return 0;
xflags = flags | ( negate ? 0x2000 : 0);
if (pe == se && *pe == L'\0' && pe[-1] == L')' && (t = wcschr (pp, L'|')) == 0)
{
pe[-1] = L'\0';
r = wskipname (pp, dname, xflags);
pe[-1] = L')';
return r;
}
nullpat = pe >= (pat + 2) && pe[-2] == L'(' && pe[-1] == L')';
while (t = glob_patscan_wc (pp, pe, '|'))
{
n = t[-1];
if (wextglob_pattern_p (pp) && n == L')')
t[-1] = n;
else
t[-1] = L'\0';
r = wskipname (pp, dname, xflags);
t[-1] = n;
if (r == 0)
return 0;
pp = t;
if (pp == pe)
break;
}
if (pp == se)
return r;
if (wild && *pe != L'\0')
return (wskipname (pe, dname, flags));
return 1;
}
| ulong wextglob_skipname(int *param_1,undefined8 param_2,uint param_3)
{
wchar_t wVar1;
bool bVar2;
uint uVar3;
int iVar4;
size_t sVar5;
wchar_t *pwVar6;
wchar_t *pwVar7;
ulong uVar8;
wchar_t *pwVar9;
uint local_40;
wchar_t *local_28;
iVar4 = *param_1;
if ((*param_1 == 0x2a) || (*param_1 == 0x3f)) {
bVar2 = true;
}
else {
bVar2 = false;
}
local_28 = param_1 + 2;
sVar5 = wcslen(local_28);
pwVar6 = local_28 + sVar5;
pwVar7 = (wchar_t *)glob_patscan_wc(local_28,pwVar6,0);
if (pwVar7 == (wchar_t *)0x0) {
uVar8 = 0;
}
else {
if (iVar4 == 0x21) {
uVar3 = 0x2000;
}
else {
uVar3 = 0;
}
if ((((pwVar7 == pwVar6) && (*pwVar7 == L'\0')) && (pwVar7[-1] == L')')) &&
(pwVar9 = wcschr(local_28,L'|'), pwVar9 == (wchar_t *)0x0)) {
pwVar7[-1] = L'\0';
uVar3 = wskipname(local_28,param_2,uVar3 | param_3);
pwVar7[-1] = L')';
uVar8 = (ulong)uVar3;
}
else {
do {
pwVar9 = (wchar_t *)glob_patscan_wc(local_28,pwVar7,0x7c);
if (pwVar9 == (wchar_t *)0x0) break;
wVar1 = pwVar9[-1];
iVar4 = wextglob_pattern_p(local_28);
if ((iVar4 == 0) || (wVar1 != L')')) {
pwVar9[-1] = L'\0';
}
else {
pwVar9[-1] = L')';
}
local_40 = wskipname(local_28,param_2,uVar3 | param_3);
pwVar9[-1] = wVar1;
if (local_40 == 0) {
return 0;
}
local_28 = pwVar9;
} while (pwVar9 != pwVar7);
if (local_28 == pwVar6) {
uVar8 = (ulong)local_40;
}
else if ((bVar2) && (*pwVar7 != L'\0')) {
uVar8 = wskipname(pwVar7,param_2,param_3);
}
else {
uVar8 = 1;
}
}
}
return uVar8;
}
|
static int e2fsck_journal_sb_csum_verify(journal_t *j,
journal_superblock_t *jsb)
{
__u32 provided, calculated;
if (!jbd2_journal_has_csum_v2or3(j))
return 1;
provided = ext2fs_swab32(( __u32)(__be32)(jsb->s_checksum));
calculated = e2fsck_journal_sb_csum(jsb);
return provided == calculated;
}
| int e2fsck_journal_sb_csum_verify(void* a0, struct_0 *a1, unsigned int a2, unsigned long long a3) {
unsigned int v0;
unsigned int v1;
unsigned int v3;
v3 = jbd2_journal_has_csum_v2or3(a0);
if (!v3) {
v3 = 1;
} else {
v0 = ext2fs_swab32(a1->field_fc);
v1 = e2fsck_journal_sb_csum(a1, a1, a2, a3);
v3 = v0 == v1;
}
return v3;
}
|
static inline void
lock_node (struct merge_node *node)
{
pthread_mutex_lock (&node->lock);
}
| void lock_node(unsigned long a0) {
unsigned long long v1;
v1 = pthread_mutex_lock(a0 + 88);
return;
}
|
char *
strip_whitespace (string)
char *string;
{
while ((((*string) == ' ') || ((*string) == '\t')))
string++;
remove_trailing_whitespace (string);
return (string);
}
| char * strip_whitespace(char *param_1)
{
char *local_10;
for (local_10 = param_1; (*local_10 == ' ' || (*local_10 == '\t')); local_10 = local_10 + 1) {
}
remove_trailing_whitespace(local_10);
return local_10;
}
|
static void usage(void)
{
fprintf(
stderr
, "Usage: ip netconf show [ dev STRING ]\n");
exit(-1);
}
| void usage()
{
fprintf(stderr, "Usage: ip netconf show [ dev STRING ]\n");
exit(-1);
}
|
uint32_t
arc4random(void)
{
uint32_t val;
pthread_mutex_lock(&arc4random_mtx);
_rs_random_u32(&val);
pthread_mutex_unlock(&arc4random_mtx);
return val;
}
| undefined4 arc4random(void)
{
long in_FS_OFFSET;
undefined4 local_14;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
pthread_mutex_lock((pthread_mutex_t *)arc4random_mtx);
_rs_random_u32(&local_14);
pthread_mutex_unlock((pthread_mutex_t *)arc4random_mtx);
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return local_14;
}
|
int
execute_command (command)
COMMAND *command;
{
struct fd_bitmap *bitmap;
int result;
current_fds_to_close = (struct fd_bitmap *)
((void *)0)
;
bitmap = new_fd_bitmap (32);
begin_unwind_frame ("execute-command");
add_unwind_protect (dispose_fd_bitmap, (char *)bitmap);
result = execute_command_internal (command, 0, -1, -1, bitmap);
dispose_fd_bitmap (bitmap);
discard_unwind_frame ("execute-command");
if (variable_context == 0 && executing_list == 0)
unlink_fifo_list ();
do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0);
return (result);
}
| long long execute_command(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long a5) {
unsigned int v0;
void* v1;
current_fds_to_close = 0;
v1 = new_fd_bitmap(0x20);
begin_unwind_frame("execute-command");
add_unwind_protect(dispose_fd_bitmap, v1);
v0 = execute_command_internal(a0, 0x0, 0xffffffff, 0xffffffff, v1, a5);
dispose_fd_bitmap(v1);
discard_unwind_frame("execute-command");
if (!variable_context && !executing_list)
unlink_fifo_list();
if (terminating_signal)
termsig_handler(terminating_signal);
if (interrupt_state)
throw_to_top_level();
return v0;
}
|
static void depmod_modules_sort(struct depmod *depmod)
{
char line[
4096
];
const char *order_file = "modules.order";
FILE *fp;
unsigned idx = 0, total = 0;
fp = dfdopen(depmod->cfg->dirname, order_file,
00
, "r");
if (fp ==
((void *)0)
)
return;
while (fgets(line, sizeof(line), fp) !=
((void *)0)
) {
size_t len = strlen(line);
idx++;
if (len == 0)
continue;
if (line[len - 1] != '\n') {
log_printf(
3
, "%s/%s:%u corrupted line misses '\\n'\n", depmod->cfg->dirname, order_file, idx)
;
goto corrupted;
}
}
total = idx + 1;
idx = 0;
fseek(fp, 0,
0
);
while (fgets(line, sizeof(line), fp) !=
((void *)0)
) {
size_t len = strlen(line);
struct mod *mod;
idx++;
if (len == 0)
continue;
line[len - 1] = '\0';
mod = hash_find(depmod->modules_by_uncrelpath, line);
if (mod ==
((void *)0)
)
continue;
mod->sort_idx = idx - total;
}
array_sort(&depmod->modules, mod_cmp);
for (idx = 0; idx < depmod->modules.count; idx++) {
struct mod *m = depmod->modules.array[idx];
m->idx = idx;
}
corrupted:
fclose(fp);
}
| void depmod_modules_sort(long *param_1)
{
char *pcVar1;
size_t sVar2;
long lVar3;
long in_FS_OFFSET;
long *local_1060;
uint local_1050;
int local_104c;
FILE *local_1040;
undefined8 local_1020;
char local_1018 [4104];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_1050 = 0;
local_1040 = (FILE *)dfdopen(*param_1 + 8,"modules.order",0,&DAT_0010064f);
if (local_1040 != (FILE *)0x0) {
LAB_00105073:
pcVar1 = fgets(local_1018,0x1000,local_1040);
if (pcVar1 != (char *)0x0) goto LAB_00104ff7;
local_104c = local_1050 + 1;
local_1050 = 0;
fseek(local_1040,0,0);
local_1060 = param_1;
while (pcVar1 = fgets(local_1018,0x1000,local_1040), pcVar1 != (char *)0x0) {
sVar2 = strlen(local_1018);
local_1050 = local_1050 + 1;
if (sVar2 != 0) {
local_1018[sVar2 - 1] = '\0';
lVar3 = hash_find(local_1060[6],local_1018);
if (lVar3 != 0) {
*(uint *)(lVar3 + 0x60) = local_1050 - local_104c;
}
}
}
array_sort(local_1060 + 2,mod_cmp);
for (local_1050 = 0; (ulong)local_1050 < (ulong)local_1060[3]; local_1050 = local_1050 + 1) {
*(short *)(*(long *)(local_1060[2] + (ulong)local_1050 * 8) + 0x68) = (short)local_1050;
}
goto LAB_001051ef;
}
LAB_00105201:
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
__stack_chk_fail();
LAB_00104ff7:
local_1020 = strlen(local_1018);
local_1050 = local_1050 + 1;
if ((local_1020 == 0) || (local_1018[local_1020 - 1] == '\n')) goto LAB_00105073;
log_printf(3,"%s/%s:%u corrupted line misses \'\\n\'\n",*param_1 + 8,"modules.order",local_1050);
LAB_001051ef:
fclose(local_1040);
goto LAB_00105201;
}
|
void printflags(char *indent, int flags) {
size_t f;
int first = 1;
printf("%s flagnames:", indent);
for (f = 0; f < sizeof(flagname)/sizeof(char *); f++)
if (flags & (int)1 << f) {
printf("%s%s", first ? " " : "|", flagname[f]);
first = 0;
}
printf("\n");
}
| void printflags(unsigned long a0, unsigned long a1) {
unsigned int v0;
void* v1;
unsigned int v3;
unsigned long long v4;
v0 = 1;
printf("%s flagnames:", a0);
for (v1 = 0; v1 <= 5; v1 += 1) {
if (((a1 >> (v1 & 31)) & 1)) {
if (!v0)
v3 = &g_40118e;
else
v3 = " ";
printf("%s%s", v3, *((0x8 * v1 + &flagname)));
v0 = 0;
}
}
v4 = printf("\n");
return;
}
|
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]... NAME...\n"), program_name);
fputs_unlocked (gettext ("Create named pipes (FIFOs) with the given NAMEs.\n"),
stdout
)
;
emit_mandatory_arg_note ();
fputs_unlocked (gettext (" -m, --mode=MODE set file permission bits to MODE, not a=rw - umask\n"),
stdout
)
;
fputs_unlocked (gettext (" -Z set the SELinux security context to default type\n --context[=CTX] like -Z, or if CTX is specified then set the SELinux\n or SMACK security context to CTX\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 ("mkfifo");
}
exit (status);
}
| void usage(unsigned long a0) {
unsigned long v0;
unsigned long v2;
v0 = v2;
if (a0) {
fprintf(stderr, gettext("Try '%s --help' for more information.\n"));
} else {
printf(gettext("Usage: %s [OPTION]... NAME...\n"));
fputs_unlocked(gettext("Create named pipes (FIFOs) with the given NAMEs.\n"), stdout);
emit_mandatory_arg_note();
fputs_unlocked(gettext(" -m, --mode=MODE set file permission bits to MODE, not a=rw - umask\n"), stdout);
fputs_unlocked(gettext(" -Z set the SELinux security context to default type\n --context[=CTX] like -Z, or if CTX is specified then set the SELinux\n or SMACK security context to CTX\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("mkfifo");
}
exit(a0);
}
|
static void
unescape_string (char *string)
{
char *cursor;
int value;
int length;
cursor = string;
while (*string)
{
if (*string == '\\')
{
string++;
switch (*string)
{
case 'x':
value = 0;
for (length = 0, string++;
length < 3 &&
((*__ctype_b_loc ())[(int) ((
to_uchar (*string)
))] & (unsigned short int) _ISxdigit)
;
length++, string++)
value = value * 16 + ((*string) >= 'a' && (*string) <= 'f' ? (*string)-'a'+10 : (*string) >= 'A' && (*string) <= 'F' ? (*string)-'A'+10 : (*string)-'0');
if (length == 0)
{
*cursor++ = '\\';
*cursor++ = 'x';
}
else
*cursor++ = value;
break;
case '0':
value = 0;
for (length = 0, string++;
length < 3 && ((*string) >= '0' && (*string) <= '7');
length++, string++)
value = value * 8 + ((*string) - '0');
*cursor++ = value;
break;
case 'a':
*cursor++ = '\a';
string++;
break;
case 'b':
*cursor++ = '\b';
string++;
break;
case 'c':
while (*string)
string++;
break;
case 'f':
*cursor++ = '\f';
string++;
break;
case 'n':
*cursor++ = '\n';
string++;
break;
case 'r':
*cursor++ = '\r';
string++;
break;
case 't':
*cursor++ = '\t';
string++;
break;
case 'v':
*cursor++ = '\v';
string++;
break;
case '\0':
break;
default:
*cursor++ = '\\';
*cursor++ = *string++;
break;
}
}
else
*cursor++ = *string++;
}
*cursor = '\0';
}
| void unescape_string(unsigned long long a0) {
char *v0;
int tmp_30;
int tmp_10;
int tmp_14;
int tmp_22;
int tmp_18;
unsigned int v1;
unsigned int v2;
char *v3;
char *v5;
char *v7;
char *v8;
char *v9;
char *v10;
char *v11;
char *v12;
char *v13;
char v14;
unsigned short v16;
unsigned int v17;
unsigned long long v18;
char *v19;
char *v20;
char *v21;
v0 = a0;
for (v3 = v0; true; *(tmp_30) = v14) {
do {
switch (*(v0)) {
case 0:
v21 = v3;
*(v3) = 0;
return;
case 92:
v0 += 1;
if (*(v0))
goto LABEL_400365;
continue;
break;
default:
tmp_10 = v0;
v0 += 1;
v5 = v3;
v3 += 1;
*(v5) = *(tmp_10);
break;
}
} while (!*(v0));
LABEL_400365:
if (*(v0) < 0) {
tmp_14 = v3;
v3 += 1;
*(tmp_14) = 92;
tmp_22 = v0;
v0 += 1;
tmp_30 = v3;
v3 += 1;
v14 = *(tmp_22);
} else if (*(v0) > 120) {
tmp_14 = v3;
v3 += 1;
*(tmp_14) = 92;
tmp_22 = v0;
v0 += 1;
tmp_30 = v3;
v3 += 1;
v14 = *(tmp_22);
} else if (*(v0) < 48) {
tmp_14 = v3;
v3 += 1;
*(tmp_14) = 92;
tmp_22 = v0;
v0 += 1;
tmp_30 = v3;
v3 += 1;
v14 = *(tmp_22);
} else {
switch (*(v0)) {
case 48:
v1 = 0;
v2 = 0;
for (v0 += 1; v2 <= 2 && *(v0) > 47 && *(v0) <= 55; v0 += 1) {
v1 = *(v0) - 48 + (v1 * 8);
v2 += 1;
}
v19 = v3;
v3 += 1;
*(v19) = v1;
break;
case 97:
v10 = v3;
v3 += 1;
*(v10) = 7;
v0 += 1;
break;
case 98:
v8 = v3;
v3 += 1;
*(v8) = 8;
v0 += 1;
break;
case 99:
for (; *(v0); v0 += 1);
case 102:
v13 = v3;
v3 += 1;
*(v13) = 12;
v0 += 1;
break;
case 110:
v11 = v3;
v3 += 1;
*(v11) = 10;
v0 += 1;
break;
case 114:
v9 = v3;
v3 += 1;
*(v9) = 13;
v0 += 1;
break;
case 116:
v7 = v3;
v3 += 1;
*(v7) = 9;
v0 += 1;
break;
case 118:
v12 = v3;
v3 += 1;
*(v12) = 11;
v0 += 1;
break;
case 120:
v1 = 0;
v2 = 0;
v0 += 1;
while (true) {
if (v2 > 2)
break;
v16 = *((to_uchar(*(v0)) * 2 + *(__ctype_b_loc())));
v17 = v16 & 0x1000;
if (!v17)
break;
if (!(*(v0) <= 96 || *(v0) > 102)) {
v18 = *(v0) - 87;
} else if (*(v0) <= 64 || *(v0) > 70) {
v18 = *(v0) - 48;
} else {
v18 = *(v0) - 55;
}
*(&v18) = v18 + v1 * 16;
v1 = v18;
v2 += 1;
v0 += 1;
}
if (!v2) {
tmp_10 = v3;
v3 += 1;
*(tmp_10) = 92;
tmp_18 = v3;
v3 += 1;
*(tmp_18) = 120;
break;
} else {
v20 = v3;
v3 += 1;
*(v20) = v1;
break;
}
default:
tmp_14 = v3;
v3 += 1;
*(tmp_14) = 92;
tmp_22 = v0;
v0 += 1;
tmp_30 = v3;
v3 += 1;
v14 = *(tmp_22);
*(tmp_30) = v14;
break;
}
}
}
}
|
int
array_shift_element(a, v)
ARRAY *a;
char *v;
{
return (array_rshift (a, 1, v));
}
| void array_shift_element(undefined8 param_1,undefined8 param_2)
{
array_rshift(param_1,1,param_2);
return;
}
|
ed_start_over(EditLine *el, wint_t c __attribute__((__unused__)))
{
ch_reset(el);
return 4;
}
| undefined8 ed_start_over(undefined8 param_1)
{
ch_reset(param_1);
return 4;
}
|
void
rl_free_keymap (Keymap map)
{
rl_discard_keymap (map);
xfree ((char *)map);
}
| void rl_free_keymap(undefined8 param_1)
{
rl_discard_keymap(param_1);
xfree(param_1);
return;
}
|
void ipstats_stat_desc_pack_xstats(struct ipstats_stat_dump_filters *filters,
const struct ipstats_stat_desc *desc)
{
struct ipstats_stat_desc_xstats *xdesc;
xdesc = ({ const typeof( ((struct ipstats_stat_desc_xstats *)0)->desc ) *__mptr = (desc); (struct ipstats_stat_desc_xstats *)( (char *)__mptr -
__builtin_offsetof (
struct ipstats_stat_desc_xstats
,
desc
)
);});
ipstats_stat_desc_enable_bit(filters, xdesc->xstats_at, 0);
}
| long long ipstats_stat_desc_pack_xstats(unsigned int *a0, struct_0 *a1) {
return ipstats_stat_desc_enable_bit(a0, a1->field_20, 0x0);
}
|
static struct change *
add_change (lin line0, lin line1, lin deleted, lin inserted,
struct change *old)
{
struct change *new = xmalloc (sizeof *new);
new->line0 = line0;
new->line1 = line1;
new->inserted = inserted;
new->deleted = deleted;
new->link = old;
return new;
}
| undefined8 *
add_change(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
undefined8 param_5)
{
undefined8 *puVar1;
puVar1 = (undefined8 *)xmalloc(0x30);
puVar1[3] = param_1;
puVar1[4] = param_2;
puVar1[1] = param_4;
puVar1[2] = param_3;
*puVar1 = param_5;
return puVar1;
}
|
static void
decode_string (char **string, char const *arg)
{
if (*string)
{
free (*string);
*string =
((void *)0)
;
}
if (!utf8_convert (
0
, arg, string))
{
assign_string (string, arg);
}
}
| void decode_string(void **param_1,undefined8 param_2)
{
char cVar1;
if (*param_1 != (void *)0x0) {
free(*param_1);
*param_1 = (void *)0x0;
}
cVar1 = utf8_convert(0,param_2,param_1);
if (cVar1 != '\x01') {
assign_string(param_1,param_2);
}
return;
}
|
test_code_t test_camellia_gcm(gnutls_session_t session)
{
int ret;
if (gnutls_fips140_mode_enabled())
return TEST_IGNORE;
sprintf(prio_str,
"NONE:" "+CAMELLIA-128-GCM:+CAMELLIA-256-GCM:" "+COMP-NULL"
":%s:" "+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":" "+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH" ":+VKO-GOST-12" ":%s", protocol_str, rest);
{ int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 835)) != TEST_SUCCEED) { return _ret; } };
gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred);
ret = test_do_handshake(session);
return ret;
}
| long long test_camellia_gcm(unsigned long long a0) {
unsigned int v0;
unsigned int v1;
unsigned long long v4;
if (gnutls_fips140_mode_enabled()) {
v4 = 3;
} else {
sprintf(&prio_str, "NONE:+CAMELLIA-128-GCM:+CAMELLIA-256-GCM:+COMP-NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT:+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH:+VKO-GOST-12:%s", &protocol_str, &rest);
v0 = __gnutls_priority_set_direct(a0, &prio_str, 0x343);
if (v0) {
v4 = v0;
} else {
gnutls_credentials_set(a0, 0x1, xcred);
v1 = test_do_handshake(a0);
v4 = v1;
}
}
return v4;
}
|
int inflateValidate(strm, check)
z_streamp strm;
int check;
{
struct inflate_state *state;
if (inflateStateCheck(strm)) return (-2);
state = (struct inflate_state *)strm->state;
if (check && state->wrap)
state->wrap |= 4;
else
state->wrap &= ~4;
return 0;
}
| undefined8 inflateValidate(long param_1,int param_2)
{
long lVar1;
int iVar2;
undefined8 uVar3;
iVar2 = inflateStateCheck(param_1);
if (iVar2 == 0) {
lVar1 = *(long *)(param_1 + 0x38);
if ((param_2 == 0) || (*(int *)(lVar1 + 0x10) == 0)) {
*(uint *)(lVar1 + 0x10) = *(uint *)(lVar1 + 0x10) & 0xfffffffb;
}
else {
*(uint *)(lVar1 + 0x10) = *(uint *)(lVar1 + 0x10) | 4;
}
uVar3 = 0;
}
else {
uVar3 = 0xfffffffe;
}
return uVar3;
}
|
static
_Bool
binary_operator (
_Bool
l_is_l)
{
int op;
struct stat stat_buf, stat_spare;
_Bool
r_is_l;
if (l_is_l)
advance (
0
);
op = pos + 1;
if ((op < argc - 2) && (strcmp (argv[op + 1], "-l") == 0))
{
r_is_l =
1
;
advance (
0
);
}
else
r_is_l =
0
;
if (argv[op][0] == '-')
{
if ((((argv[op][1] == 'l' || argv[op][1] == 'g')
&& (argv[op][2] == 'e' || argv[op][2] == 't'))
|| (argv[op][1] == 'e' && argv[op][2] == 'q')
|| (argv[op][1] == 'n' && argv[op][2] == 'e'))
&& !argv[op][3])
{
char lbuf[((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)];
char rbuf[((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)];
char const *l = (l_is_l
? umaxtostr (strlen (argv[op - 1]), lbuf)
: find_int (argv[op - 1]));
char const *r = (r_is_l
? umaxtostr (strlen (argv[op + 2]), rbuf)
: find_int (argv[op + 1]));
int cmp = strintcmp (l, r);
_Bool
xe_operator = (argv[op][2] == 'e');
pos += 3;
return (argv[op][1] == 'l' ? cmp < xe_operator
: argv[op][1] == 'g' ? cmp > - xe_operator
: (cmp != 0) == xe_operator);
}
switch (argv[op][1])
{
default:
break;
case 'n':
if (argv[op][2] == 't' && !argv[op][3])
{
struct timespec lt, rt;
_Bool
le, re;
pos += 3;
if (l_is_l || r_is_l)
test_syntax_error (gettext ("-nt does not accept -l"));
le = get_mtime (argv[op - 1], <);
re = get_mtime (argv[op + 1], &rt);
return le && (!re || timespec_cmp (lt, rt) > 0);
}
break;
case 'e':
if (argv[op][2] == 'f' && !argv[op][3])
{
pos += 3;
if (l_is_l || r_is_l)
test_syntax_error (gettext ("-ef does not accept -l"));
return (stat (argv[op - 1], &stat_buf) == 0
&& stat (argv[op + 1], &stat_spare) == 0
&& stat_buf.st_dev == stat_spare.st_dev
&& stat_buf.st_ino == stat_spare.st_ino);
}
break;
case 'o':
if ('t' == argv[op][2] && '\000' == argv[op][3])
{
struct timespec lt, rt;
_Bool
le, re;
pos += 3;
if (l_is_l || r_is_l)
test_syntax_error (gettext ("-ot does not accept -l"));
le = get_mtime (argv[op - 1], <);
re = get_mtime (argv[op + 1], &rt);
return re && (!le || timespec_cmp (lt, rt) < 0);
}
break;
}
test_syntax_error (gettext ("%s: unknown binary operator"), quote (argv[op]));
}
if (argv[op][0] == '='
&& (!argv[op][1] || ((argv[op][1] == '=') && !argv[op][2])))
{
_Bool
value = (strcmp (argv[pos], argv[pos + 2]) == 0);
pos += 3;
return value;
}
if ((strcmp (argv[op], "!=") == 0))
{
_Bool
value = !(strcmp (argv[pos], argv[pos + 2]) == 0);
pos += 3;
return value;
}
abort ();
}
| int binary_operator(unsigned long a0) {
char v0;
char v1;
char v2;
char v3;
char v4;
char v5;
char v6;
char v7;
unsigned int v8;
unsigned int v9;
unsigned long long v10;
unsigned int v11;
char v12;
char v13;
char v14;
char v15;
char v16;
char v17;
char v18;
char v19;
char v20;
char v21;
unsigned int v23;
unsigned long long v24;
unsigned long long v25;
unsigned long long v26;
unsigned int v27;
unsigned int v28;
unsigned int v29;
if (a0)
advance(0x0);
v8 = pos + 1;
if (v8 < argc - 2 && !strcmp(*((argv + (v8 + 1 << 3))), "-l")) {
v0 = 1;
advance(0x0);
goto LABEL_400bd2;
}
v0 = 0;
LABEL_400bd2:
if (*(*((argv + (v8 << 3)))) != 45) {
if (*(*((argv + (v8 << 3)))) == 61) {
if (!*((*((argv + (v8 << 3))) + 1))) {
LABEL_40141b:
v1 = !strcmp(*((argv + (pos << 3))), *((argv + (pos + 2 << 3))));
pos = pos + 3;
v23 = v1;
goto LABEL_40151c;
} else if (*((*((argv + (v8 << 3))) + 1)) == 61) {
if (!(!*((*((argv + (v8 << 3))) + 2))))
goto LABEL_401484;
goto LABEL_40141b;
}
}
LABEL_401484:
if (strcmp(*((argv + (v8 << 3))), "!="))
abort();
v2 = strcmp(*((argv + (pos << 3))), *((argv + (pos + 2 << 3))));
pos = pos + 3;
v23 = v2;
LABEL_40151c:
return v23;
}
if (*((*((argv + (v8 << 3))) + 1)) != 108 && !(*((*((argv + (v8 << 3))) + 1)) == 103))
goto LABEL_400c93;
if (*((*((argv + (v8 << 3))) + 2)) == 101)
goto LABEL_400d2f;
if (*((*((argv + (v8 << 3))) + 2)) == 116)
goto LABEL_400d2f;
LABEL_400c93:
if (*((*((argv + (v8 << 3))) + 1)) == 101 && *((*((argv + (v8 << 3))) + 2)) == 113)
goto LABEL_400d2f;
if (!(*((*((argv + (v8 << 3))) + 1)) == 110))
goto LABEL_400f26;
if (!(*((*((argv + (v8 << 3))) + 2)) == 101))
goto LABEL_400f26;
LABEL_400d2f:
if (!*((*((argv + (v8 << 3))) + 3))) {
if (!a0) {
v24 = find_int(*((argv + v8 * 8 - 8)));
} else {
v25 = strlen(*((argv + v8 * 8 - 8)));
v24 = umaxtostr(v25, &v20, v25);
}
v10 = v24;
if (!v0) {
v23 = find_int(*((argv + (v8 + 1) * 8)));
} else {
v26 = strlen(*((argv + (v8 + 2) * 8)));
v23 = umaxtostr(v26, &v21, v26);
}
v11 = v23;
v9 = strintcmp(v10, *(&v11), *(&v11));
v3 = *((*((argv + (v8 << 3))) + 2)) == 101;
pos = pos + 3;
if (*((*((argv + (v8 << 3))) + 1)) == 108) {
v23 = v3;
*(&v23) = v9 < v3;
goto LABEL_40151c;
} else if (*((*((argv + (v8 << 3))) + 1)) == 103) {
v23 = -(v3);
*(&v23) = -(v3) < v9;
goto LABEL_40151c;
} else {
v23 = v3;
*(&v23) = v9 == v3;
goto LABEL_40151c;
}
}
LABEL_400f26:
if (*((*((argv + (v8 << 3))) + 1)) == 111) {
if (*((*((argv + (v8 << 3))) + 2)) == 116 && !*((*((argv + (v8 << 3))) + 3))) {
pos = pos + 3;
if (!a0 && !v0) {
v4 = get_mtime(*((argv + v8 * 8 - 8)), &v12);
v5 = get_mtime(*((argv + (v8 + 1) * 8)), &v14);
if (v5) {
if ((v4 ^ 1)) {
LABEL_401324:
v27 = 1;
goto LABEL_401330;
} else if (timespec_cmp(*(&v12), *(&v13), *(&v14), *(&v15)) < 0) {
goto LABEL_401324;
}
}
v27 = 0;
LABEL_401330:
v23 = v27 & 1;
goto LABEL_40151c;
}
test_syntax_error(gettext("-ot does not accept -l"), "-l");
}
} else {
if (*((*((argv + (v8 << 3))) + 1)) <= 111) {
if (*((*((argv + (v8 << 3))) + 1)) == 101) {
if (*((*((argv + (v8 << 3))) + 2)) == 102 && !*((*((argv + (v8 << 3))) + 3))) {
pos = pos + 3;
if (!a0 && !v0) {
if (!stat(*((argv + (v8 << 3) - 8)), &v16) && !stat(*((argv + (v8 + 1 << 3))), &v18) && *(&v16) == *(&v18) && *(&v17) == *(&v19)) {
v28 = 1;
goto LABEL_4011e2;
}
v28 = 0;
LABEL_4011e2:
v23 = v28 & 1;
goto LABEL_40151c;
}
test_syntax_error(gettext("-ef does not accept -l"), "-l");
}
goto LABEL_401342;
} else if (*((*((argv + (v8 << 3))) + 1)) == 110) {
if (*((*((argv + (v8 << 3))) + 2)) == 116 && !*((*((argv + (v8 << 3))) + 3))) {
pos = pos + 3;
if (!a0 && !v0) {
v6 = get_mtime(*((argv + v8 * 8 - 8)), &v12);
v7 = get_mtime(*((argv + (v8 + 1) * 8)), &v14);
if (v6) {
if ((v7 ^ 1)) {
LABEL_4010a8:
v29 = 1;
goto LABEL_4010b4;
} else if (!(timespec_cmp(*(&v12), *(&v13), *(&v14), *(&v15)) <= 0)) {
goto LABEL_4010a8;
}
}
v29 = 0;
LABEL_4010b4:
v23 = v29 & 1;
goto LABEL_40151c;
}
test_syntax_error(gettext("-nt does not accept -l"), "-l");
}
goto LABEL_401342;
}
}
}
LABEL_401342:
test_syntax_error(gettext("%s: unknown binary operator"), quote(*((argv + v8 * 8))));
}
|
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;
}
| undefined8 set_latch_flags(undefined4 param_1,uint param_2,uint param_3)
{
long lVar1;
undefined8 uVar2;
lVar1 = find_latch(param_1);
if (lVar1 == 0) {
uVar2 = 0xffffffff;
}
else {
*(uint *)(lVar1 + 0xc) = *(uint *)(lVar1 + 0xc) | param_2;
*(uint *)(lVar1 + 0xc) = ~param_3 & *(uint *)(lVar1 + 0xc);
uVar2 = 0;
}
return uVar2;
}
|
uLong adler32_combine(adler1, adler2, len2)
uLong adler1;
uLong adler2;
off_t len2;
{
return adler32_combine_(adler1, adler2, len2);
}
| long long adler32_combine(unsigned int a0, unsigned int a1, unsigned int a2) {
return adler32_combine_(a0, a1, a2);
}
|
static void
print_sdiff_hunk (struct change *hunk)
{
lin first0, last0, first1, last1;
register lin i, j;
enum changes changes =
analyze_hunk (hunk, &first0, &last0, &first1, &last1);
if (!changes)
return;
print_sdiff_common_lines (first0, first1);
if (sdiff_merge_assist)
{
printint len0 = last0 - first0 + 1;
printint len1 = last1 - first1 + 1;
fprintf (outfile, "c%""l""d,%""l""d\n", len0, len1);
}
if (changes == CHANGED)
{
for (i = first0, j = first1; i <= last0 && j <= last1; i++, j++)
print_1sdiff_line (&files[0].linbuf[i], '|', &files[1].linbuf[j]);
changes = (i <= last0 ? OLD : 0) + (j <= last1 ? NEW : 0);
next0 = first0 = i;
next1 = first1 = j;
}
if (changes & NEW)
{
for (j = first1; j <= last1; ++j)
print_1sdiff_line (0, '>', &files[1].linbuf[j]);
next1 = j;
}
if (changes & OLD)
{
for (i = first0; i <= last0; ++i)
print_1sdiff_line (&files[0].linbuf[i], '<', 0);
next0 = i;
}
}
| void print_sdiff_hunk(undefined8 param_1)
{
int iVar1;
long lVar2;
long lVar3;
long in_FS_OFFSET;
uint local_54;
long local_50;
long local_48;
long local_40;
long local_38;
long local_30;
long local_28;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
local_54 = analyze_hunk(param_1,&local_50,&local_48,&local_40,&local_38);
lVar3 = next0;
if (local_54 != 0) {
print_sdiff_common_lines(local_50,local_40);
if (sdiff_merge_assist != '\0') {
local_30 = (local_48 - local_50) + 1;
local_28 = (local_38 - local_40) + 1;
fprintf(outfile,"c%ld,%ld\n",local_30,local_28);
}
if (local_54 == 3) {
for (; (local_50 <= local_48 && (local_40 <= local_38)); local_40 = local_40 + 1) {
print_1sdiff_line(_DAT_001010c0 + local_50 * 8,0x7c,local_40 * 8 + _DAT_001011f0);
local_50 = local_50 + 1;
}
if (local_38 < local_40) {
iVar1 = 0;
}
else {
iVar1 = 2;
}
local_54 = (uint)(local_50 <= local_48) + iVar1;
next0 = local_50;
next1 = local_40;
}
lVar3 = local_40;
lVar2 = next1;
if ((local_54 & 2) != 0) {
for (; lVar2 = lVar3, lVar3 <= local_38; lVar3 = lVar3 + 1) {
print_1sdiff_line(0,0x3e,_DAT_001011f0 + lVar3 * 8);
}
}
next1 = lVar2;
lVar2 = local_50;
lVar3 = next0;
if ((local_54 & 1) != 0) {
for (; lVar3 = lVar2, lVar2 <= local_48; lVar2 = lVar2 + 1) {
print_1sdiff_line(_DAT_001010c0 + lVar2 * 8,0x3c,0);
}
}
}
next0 = lVar3;
if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
__stack_chk_fail();
}
|
static const char *prio_to_str(char buf[static 32], int prio)
{
const char *prioname;
switch (prio) {
case
2
:
prioname = "FATAL";
break;
case
3
:
prioname = "ERROR";
break;
case
4
:
prioname = "WARNING";
break;
case
5
:
prioname = "NOTICE";
break;
case
6
:
prioname = "INFO";
break;
case
7
:
prioname = "DEBUG";
break;
default:
snprintf(buf, 32, "LOG-%03d", prio);
prioname = buf;
}
return prioname;
}
| char * prio_to_str(char *param_1,uint param_2)
{
char *local_10;
switch(param_2) {
default:
snprintf(param_1,0x20,"LOG-%03d",(ulong)param_2);
local_10 = param_1;
break;
case 2:
local_10 = "FATAL";
break;
case 3:
local_10 = "ERROR";
break;
case 4:
local_10 = "WARNING";
break;
case 5:
local_10 = "NOTICE";
break;
case 6:
local_10 = "INFO";
break;
case 7:
local_10 = "DEBUG";
}
return local_10;
}
|
static char *
authmethods_get(Authctxt *authctxt)
{
struct sshbuf *b;
char *list;
int i, r;
if ((b = sshbuf_new()) ==
((void *)0)
)
sshfatal("auth2.c", __func__, 491, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new failed");
for (i = 0; authmethods[i] !=
((void *)0)
; i++) {
if (strcmp(authmethods[i]->name, "none") == 0)
continue;
if (authmethods[i]->enabled ==
((void *)0)
||
*(authmethods[i]->enabled) == 0)
continue;
if (!auth2_method_allowed(authctxt, authmethods[i]->name,
((void *)0)
))
continue;
if ((r = sshbuf_putf(b, "%s%s", sshbuf_len(b) ? "," : "",
authmethods[i]->name)) != 0)
sshfatal("auth2.c", __func__, 503, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "buffer error");
}
if ((list = sshbuf_dup_string(b)) ==
((void *)0)
)
sshfatal("auth2.c", __func__, 506, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_dup_string failed");
sshbuf_free(b);
return list;
}
| long authmethods_get(undefined8 param_1)
{
char *__s1;
int iVar1;
long lVar2;
undefined *puVar3;
undefined8 uVar4;
char **ppcVar5;
undefined *puVar6;
undefined *puVar7;
char *pcStack88;
undefined8 uStack80;
undefined auStack72 [8];
undefined8 local_40;
int local_30;
int local_2c;
long local_28;
long local_20;
ppcVar5 = (char **)auStack72;
uStack80 = 0x101370;
local_40 = param_1;
local_28 = sshbuf_new();
if (local_28 == 0) {
ppcVar5 = &pcStack88;
pcStack88 = "sshbuf_new failed";
sshfatal("auth2.c","authmethods_get",0x1eb,1,1,0);
}
local_30 = 0;
puVar7 = (undefined *)ppcVar5;
while (*(long *)(authmethods + (long)local_30 * 8) != 0) {
__s1 = **(char ***)(authmethods + (long)local_30 * 8);
*(undefined8 *)(puVar7 + -8) = 0x1013eb;
iVar1 = strcmp(__s1,"none");
puVar6 = puVar7;
if (((iVar1 != 0) && (*(long *)(*(long *)(authmethods + (long)local_30 * 8) + 0x18) != 0)) &&
(**(int **)(*(long *)(authmethods + (long)local_30 * 8) + 0x18) != 0)) {
uVar4 = **(undefined8 **)(authmethods + (long)local_30 * 8);
*(undefined8 *)(puVar7 + -8) = 0x10146d;
iVar1 = auth2_method_allowed(local_40,uVar4,0);
if (iVar1 != 0) {
uVar4 = **(undefined8 **)(authmethods + (long)local_30 * 8);
*(undefined8 *)(puVar7 + -8) = 0x10149c;
lVar2 = sshbuf_len(local_28);
if (lVar2 == 0) {
puVar3 = &DAT_00102830;
}
else {
puVar3 = &DAT_00102b63;
}
*(undefined8 *)(puVar7 + -8) = 0x1014cc;
local_2c = sshbuf_putf(local_28,&DAT_001029dd,puVar3,uVar4);
if (local_2c != 0) {
*(undefined8 *)(puVar7 + -8) = 0x1014df;
uVar4 = ssh_err(local_2c);
puVar6 = puVar7 + -0x10;
*(char **)(puVar7 + -0x10) = "buffer error";
*(undefined8 *)(puVar7 + -0x18) = 0x101516;
sshfatal("auth2.c","authmethods_get",0x1f7,1,1,uVar4);
}
}
}
*(undefined8 *)(puVar6 + -8) = 0x10152a;
local_30 = __addvsi3(local_30,1);
puVar7 = puVar6;
}
*(undefined8 *)(puVar7 + -8) = 0x10155a;
local_20 = sshbuf_dup_string(local_28);
puVar6 = puVar7;
if (local_20 == 0) {
puVar6 = puVar7 + -0x10;
*(char **)(puVar7 + -0x10) = "sshbuf_dup_string failed";
*(undefined8 *)(puVar7 + -0x18) = 0x10159f;
sshfatal("auth2.c","authmethods_get",0x1fa,1,1,0);
}
lVar2 = local_28;
*(undefined8 *)(puVar6 + -8) = 0x1015ab;
sshbuf_free(lVar2);
return local_20;
}
|
static void
dump_cfg_strarray(OpCodes code, u_int count, char **vals)
{
u_int i;
for (i = 0; i < count; i++)
printf("%s %s\n", lookup_opcode_name(code), vals[i]);
}
| void dump_cfg_strarray(unsigned long a0, unsigned long a1, unsigned long long *a2) {
unsigned int v0;
unsigned long long v2;
v0 = 0;
while (true) {
v2 = v0;
if (v0 >= a1)
break;
printf("%s %s\n", lookup_opcode_name(a0), a2[v0]);
v0 += 1;
}
return;
}
|
static void vrf_explain(FILE *f)
{
fprintf(f, "Usage: ... vrf table TABLEID\n");
}
| void vrf_explain(void* a0) {
unsigned long long v1;
v1 = fprintf(a0, "Usage: ... vrf table TABLEID\n");
return;
}
|
int
sshbuf_set_max_size(struct sshbuf *buf, size_t max_size)
{
size_t rlen;
u_char *dp;
int r;
;
if ((r = sshbuf_check_sanity(buf)) != 0)
return r;
if (max_size == buf->max_size)
return 0;
if (buf->readonly || buf->refcount > 1)
return -49;
if (max_size > 0x8000000)
return -9;
sshbuf_maybe_pack(buf, max_size < buf->size);
if (max_size < buf->alloc && max_size > buf->size) {
if (buf->size < 256)
rlen = 256;
else
rlen = ((((buf->size)+((256)-1))/(256))*(256));
if (rlen > max_size)
rlen = max_size;
;
if ((dp = recallocarray(buf->d, buf->alloc, rlen, 1)) ==
((void *)0)
)
return -2;
buf->cd = buf->d = dp;
buf->alloc = rlen;
}
;
if (max_size < buf->alloc)
return -9;
buf->max_size = max_size;
return 0;
}
| long long sshbuf_set_max_size(struct_0 *a0, unsigned long long a1) {
unsigned int v0;
unsigned long v1;
unsigned long v2;
unsigned long long v4;
char v5;
v0 = sshbuf_check_sanity(a0);
if (v0) {
v4 = v0;
return v4;
} else if (a1 == a0->field_20) {
v4 = 0;
return v4;
} else if (a0->field_30) {
v4 = 4294967247;
return v4;
} else if (a0->field_38 > 1) {
v4 = 4294967247;
return v4;
} else if (a1 <= 0x8000000) {
sshbuf_maybe_pack(a0, a1 < a0->field_18);
if (a1 < a0->field_28 && a1 > a0->field_18) {
if (a0->field_18 <= 255) {
v1 = 0x100;
} else {
v5 = a0->field_18 + 255;
v5 = 0;
*(&v1) = v5;
}
if (v1 > a1)
v1 = a1;
v2 = recallocarray(a0->field_0, a0->field_28, v1, 0x1);
if (!v2) {
v4 = 4294967294;
return v4;
}
a0->field_0 = v2;
a0->field_8 = a0->field_0;
a0->field_28 = v1;
}
if (a1 < a0->field_28) {
v4 = 4294967287;
return v4;
}
a0->field_20 = a1;
v4 = 0;
return v4;
} else {
v4 = 4294967287;
return v4;
}
}
|
static void
parse_dest_constraint(const char *s, struct dest_constraint ***dcp,
size_t *ndcp, char **hostkey_files)
{
struct dest_constraint *dc;
char *os, *cp;
dc = xcalloc(1, sizeof(*dc));
os = xstrdup(s);
if ((cp = strchr(os, '>')) ==
((void *)0)
) {
parse_dest_constraint_hop(os, &dc->to, hostkey_files);
} else {
*(cp++) = '\0';
parse_dest_constraint_hop(os, &dc->from, hostkey_files);
parse_dest_constraint_hop(cp, &dc->to, hostkey_files);
if (dc->from.user !=
((void *)0)
) {
sshfatal("ssh-add.c", __func__, 750, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Invalid key constraint %s: cannot specify " "user on 'from' host", os)
;
}
}
sshlog("ssh-add.c", __func__, 755, 1, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "constraint %zu: %s%s%s (%u keys) > %s%s%s (%u keys)", *ndcp, dc->from.user ? dc->from.user : "", dc->from.user ? "@" : "", dc->from.hostname ? dc->from.hostname : "(ORIGIN)", dc->from.nkeys, dc->to.user ? dc->to.user : "", dc->to.user ? "@" : "", dc->to.hostname ? dc->to.hostname : "(ANY)", dc->to.nkeys)
;
*dcp = xrecallocarray(*dcp, *ndcp, *ndcp + 1, sizeof(**dcp));
(*dcp)[(*ndcp)++] = dc;
free(os);
}
| void parse_dest_constraint(long a1, _QWORD *a2, _QWORD *a3, long a4)
{
const char *v4;
const char *v5;
const char *v6;
const char *v7;
const char *v8;
const char *v9;
long v10;
long v11;
long v15;
char *s;
char *v17;
v15 = xcalloc(1LL, 80LL);
s = (char *)xstrdup(a1);
v17 = strchr(s, 62);
if ( v17 )
{
*v17 = 0;
parse_dest_constraint_hop(s, (long *)v15, a4);
parse_dest_constraint_hop(v17 + 1, (long *)(v15 + 40), a4);
if ( *(_QWORD *)v15 )
sshfatal(
"ssh-add.c",
"parse_dest_constraint",
750LL,
0LL,
1LL,
0LL,
"Invalid key constraint %s: cannot specify user on 'from' host",
s);
}
else
{
parse_dest_constraint_hop(s, (long *)(v15 + 40), a4);
}
if ( *(_QWORD *)(v15 + 48) )
v4 = *(const char **)(v15 + 48);
else
v4 = "(ANY)";
if ( *(_QWORD *)(v15 + 40) )
v5 = "@";
else
v5 = &byte_33DF;
if ( *(_QWORD *)(v15 + 40) )
v6 = *(const char **)(v15 + 40);
else
v6 = &byte_33DF;
if ( *(_QWORD *)(v15 + 8) )
v7 = *(const char **)(v15 + 8);
else
v7 = "(ORIGIN)";
if ( *(_QWORD *)v15 )
v8 = "@";
else
v8 = &byte_33DF;
if ( *(_QWORD *)v15 )
v9 = *(const char **)v15;
else
v9 = &byte_33DF;
sshlog(
"ssh-add.c",
"parse_dest_constraint",
755LL,
1LL,
6LL,
0LL,
"constraint %zu: %s%s%s (%u keys) > %s%s%s (%u keys)",
*a3,
v9,
v8,
v7,
*(unsigned int *)(v15 + 20),
v6,
v5,
v4,
*(unsigned int *)(v15 + 60));
*a2 = xrecallocarray(*a2, *a3, *a3 + 1LL, 8LL);
v10 = *a2;
v11 = (*a3)++;
*(_QWORD *)(v10 + 8 * v11) = v15;
free(s);
}
|
void print_ocsp_verify_res(unsigned int output)
{
int comma = 0;
if (output) {
printf("Failure");
comma = 1;
} else {
printf("Success");
comma = 1;
}
if (output & GNUTLS_OCSP_VERIFY_SIGNER_NOT_FOUND) {
if (comma)
printf(", ");
printf("Signer cert not found");
comma = 1;
}
if (output & GNUTLS_OCSP_VERIFY_SIGNER_KEYUSAGE_ERROR) {
if (comma)
printf(", ");
printf("Signer cert keyusage error");
comma = 1;
}
if (output & GNUTLS_OCSP_VERIFY_UNTRUSTED_SIGNER) {
if (comma)
printf(", ");
printf("Signer cert is not trusted");
comma = 1;
}
if (output & GNUTLS_OCSP_VERIFY_INSECURE_ALGORITHM) {
if (comma)
printf(", ");
printf("Insecure algorithm");
comma = 1;
}
if (output & GNUTLS_OCSP_VERIFY_SIGNATURE_FAILURE) {
if (comma)
printf(", ");
printf("Signature failure");
comma = 1;
}
if (output & GNUTLS_OCSP_VERIFY_CERT_NOT_ACTIVATED) {
if (comma)
printf(", ");
printf("Signer cert not yet activated");
comma = 1;
}
if (output & GNUTLS_OCSP_VERIFY_CERT_EXPIRED) {
if (comma)
printf(", ");
printf("Signer cert expired");
}
}
| void print_ocsp_verify_res(unsigned long a0) {
unsigned int v0;
unsigned long v2;
unsigned long long v3;
v0 = 0;
if (a0) {
printf("Failure");
v0 = 1;
} else {
printf("Success");
v0 = 1;
}
if ((a0 & 1)) {
if (v0)
printf(", ");
printf("Signer cert not found");
v0 = 1;
}
if ((a0 & 2)) {
if (v0)
printf(", ");
printf("Signer cert keyusage error");
v0 = 1;
}
if ((a0 & 4)) {
if (v0)
printf(", ");
printf("Signer cert is not trusted");
v0 = 1;
}
if ((a0 & 8)) {
if (v0)
printf(", ");
printf("Insecure algorithm");
v0 = 1;
}
if ((a0 & 16)) {
if (v0)
printf(", ");
printf("Signature failure");
v0 = 1;
}
if ((a0 & 32)) {
if (v0)
printf(", ");
printf("Signer cert not yet activated");
v0 = 1;
}
v2 = a0 & 64;
if (!(a0 & 64))
return;
if (v0)
printf(", ");
v3 = printf("Signer cert expired");
return;
}
|
static void check_perms (void)
{
}
| void check_perms() {
char v0;
unsigned long long v2;
v2 = *(&v0);
return;
}
|
static void
unknown_file_error (char const *p)
{
do { if ((warning_option & (0x00000020))) do { if (error_hook) error_hook (); error (0, 0, gettext ("%s: Unknown file type; file ignored"), quotearg_colon (p)); } while (0); } while (0)
;
if (!ignore_failed_read_option)
set_exit_status (2);
}
| void unknown_file_error(unsigned long long a0) {
unsigned long long v1;
unsigned long long v2;
unsigned long long v3;
if ((warning_option & 32)) {
if (error_hook)
*(5242912)();
v1 = quotearg_colon(a0);
error(0x0, 0x0, gettext("%s: Unknown file type; file ignored"));
}
v2 = ignore_failed_read_option ^ 1;
if ((ignore_failed_read_option ^ 1))
v3 = set_exit_status(0x2);
return;
}
|
static void print_slave_state(FILE *f, struct rtattr *tb)
{
unsigned int state = rta_getattr_u8(tb);
if (state >= (sizeof(slave_states) / sizeof((slave_states)[0])))
print_int(PRINT_ANY, "state_index", "state %d ", state);
else
print_string(PRINT_ANY,
"state",
"state %s ",
slave_states[state]);
}
| long print_slave_state(long a1, long a2)
{
unsigned int v3;
v3 = (unsigned char)rta_getattr_u8(a2);
if ( v3 <= 1 )
return print_string(4u, (long)"state", (long)"state %s ", (long)slave_states[v3]);
else
return print_int(4u, (long)"state_index", (long)"state %d ", v3);
}
|
static __u8 read_ioam6mode_type(const char *mode)
{
__u8 i;
for (i = (__IOAM6_IPTUNNEL_MODE_MIN + 1); i <= (__IOAM6_IPTUNNEL_MODE_MAX - 1); i++) {
if (ioam6_mode_types[i] && !strcmp(mode, ioam6_mode_types[i]))
return i;
}
return 0;
}
| int read_ioam6mode_type(char *a0) {
char v0;
unsigned int v2;
v0 = 1;
while (true) {
if (v0 <= 3) {
if (ioam6_mode_types[v0]) {
v2 = strcmp(a0, ioam6_mode_types[v0]);
if (!v2) {
v2 = v0;
break;
}
}
if (!ioam6_mode_types[v0] || v2)
v0 += 1;
} else {
v2 = 0;
break;
}
}
return v2;
}
|
static
_Bool
iswheel (const char *username)
{
struct group *grp;
grp = getgrnam ("wheel");
if ( (
((void *)0)
==grp)
|| (
((void *)0)
== grp->gr_mem)) {
return
0
;
}
return is_on_list (grp->gr_mem, username);
}
| undefined8 iswheel(undefined8 param_1)
{
group *pgVar1;
undefined8 uVar2;
pgVar1 = getgrnam("wheel");
if ((pgVar1 == (group *)0x0) || (pgVar1->gr_mem == (char **)0x0)) {
uVar2 = 0;
}
else {
uVar2 = is_on_list(pgVar1->gr_mem,param_1);
}
return uVar2;
}
|
int
_rl_read_mbchar (char *mbchar, int size)
{
int mb_len, c;
size_t mbchar_bytes_length;
wchar_t wc;
mbstate_t ps, ps_back;
memset(&ps, 0, sizeof (mbstate_t));
memset(&ps_back, 0, sizeof (mbstate_t));
mb_len = 0;
while (mb_len < size)
{
c = (mb_len == 0) ? _rl_bracketed_read_key () : rl_read_key ();
if (c < 0)
break;
mbchar[mb_len++] = c;
mbchar_bytes_length = mbrtowc (&wc, mbchar, mb_len, &ps);
if (mbchar_bytes_length == (size_t)(-1))
break;
else if (mbchar_bytes_length == (size_t)(-2))
{
ps = ps_back;
continue;
}
else if (mbchar_bytes_length == 0)
{
mbchar[0] = '\0';
mb_len = 1;
break;
}
else if (mbchar_bytes_length > (size_t)(0))
break;
}
return mb_len;
}
| long long _rl_read_mbchar(char *a0, unsigned long a1) {
int tmp_17;
char v0;
unsigned int v1;
unsigned int v2;
unsigned long v3;
unsigned long long v4;
char v5;
unsigned long long v7;
memset(&v4, 0x0, 0x8);
memset(&v5, 0x0, 0x8);
v1 = 0;
while (v1 >= a1) {
LABEL_401410:
return v1;
}
if (v1)
v7 = rl_read_key();
else
v7 = _rl_bracketed_read_key();
v2 = v7;
if (v2 < 0)
return v1;
tmp_17 = v1;
v1 += 1;
a0[tmp_17] = v2;
v3 = mbrtowc(&v0, a0, v1, &v4);
if (v3 == -1) {
return v1;
} else if (v3 == -2) {
v4 = *(&v5);
goto LABEL_401410;
} else {
if (!v3) {
*(a0) = 0;
v1 = 1;
return v1;
}
if (v3)
return v1;
goto LABEL_401410;
}
}
|
pid_t
sys_child_open_for_uncompress (void)
{
int parent_pipe[2];
int child_pipe[2];
pid_t grandchild_pid;
pid_t child_pid;
xpipe (parent_pipe);
child_pid = xfork ();
if (child_pid > 0)
{
archive = parent_pipe[0];
xclose (parent_pipe[1]);
return child_pid;
}
set_program_name (gettext ("tar (child)"));
signal (
13
,
((__sighandler_t) 0)
);
xdup2 (parent_pipe[1],
1
);
xclose (parent_pipe[0]);
if (strcmp (archive_name_array[0], "-") != 0
&& !(!force_local_option && (rmt_dev_name__ = strchr (archive_name_array[0], ':')) && rmt_dev_name__ > (archive_name_array[0]) && ! memchr (archive_name_array[0], '/', rmt_dev_name__ - (archive_name_array[0])))
&& is_regular_file (archive_name_array[0]))
{
archive = open (archive_name_array[0],
00
|
0
, (
0200
|
(0200 >> 3)
|
((0200 >> 3) >> 3)
| (
0400
|
(0400 >> 3)
|
((0400 >> 3) >> 3)
)));
if (archive < 0)
open_fatal (archive_name_array[0]);
xdup2 (archive,
0
);
priv_set_restore_linkdir ();
run_decompress_program ();
}
xpipe (child_pipe);
grandchild_pid = xfork ();
if (grandchild_pid == 0)
{
set_program_name (gettext ("tar (grandchild)"));
xdup2 (child_pipe[0],
0
);
xclose (child_pipe[1]);
priv_set_restore_linkdir ();
run_decompress_program ();
}
xdup2 (child_pipe[1],
1
);
xclose (child_pipe[0]);
if (strcmp (archive_name_array[0], "-") == 0)
archive =
0
;
else
archive = ((!force_local_option && (rmt_dev_name__ = strchr (archive_name_array[0], ':')) && rmt_dev_name__ > (archive_name_array[0]) && ! memchr (archive_name_array[0], '/', rmt_dev_name__ - (archive_name_array[0]))) ? rmt_open__ (archive_name_array[0],
00
|
0
, (1 << 30), rsh_command_option) : open (archive_name_array[0],
00
|
0
, (
0200
|
(0200 >> 3)
|
((0200 >> 3) >> 3)
| (
0400
|
(0400 >> 3)
|
((0400 >> 3) >> 3)
))))
;
if (archive < 0)
open_fatal (archive_name_array[0]);
while (1)
{
char *cursor;
size_t maximum;
size_t count;
size_t status;
clear_read_error_count ();
error_loop:
status = (((archive) >= (1 << 30)) ? rmt_read__ (archive - (1 << 30), record_start->buffer, record_size) : safe_read (archive, record_start->buffer, record_size));
if (status == ((size_t) -1))
{
archive_read_error ();
goto error_loop;
}
if (status == 0)
break;
cursor = record_start->buffer;
maximum = status;
while (maximum)
{
count = maximum < 512 ? maximum : 512;
if (full_write (
1
, cursor, count) != count)
write_error (use_compress_program_option);
cursor += count;
maximum -= count;
}
}
xclose (
1
);
wait_for_grandchild (grandchild_pid);
}
| long long sys_child_open_for_uncompress(unsigned int a0, unsigned long a1, unsigned long 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 v3;
unsigned long long v4;
unsigned long long v5;
char v6;
char v7;
char v8;
char v9;
unsigned long v10;
unsigned long long *v12;
unsigned short v13;
unsigned long long v14;
unsigned long long v15;
v10 = v12[5];
xpipe(&v6);
v0 = xfork();
if (v0 <= 0) {
set_program_name(gettext("tar (child)"));
signal(0xd, 0x0);
xdup2(*(&v7), 0x1, a2, a3, a4, a5);
xclose(*(&v6));
if (!strcmp(*(archive_name_array), "-")) {
LABEL_401075:
xpipe(&v8);
v1 = xfork();
if (!v1) {
set_program_name(gettext("tar (grandchild)"));
xdup2(*(&v8), 0x0, rmt_dev_name__ - *(archive_name_array), a3, a4, a5);
xclose(*(&v9));
priv_set_restore_linkdir();
run_decompress_program(a0, 0x0, a2, a3, a4, a5);
}
xdup2(*(&v9), 0x1, rmt_dev_name__ - *(archive_name_array), a3, a4, a5);
xclose(*(&v8));
if (!strcmp(*(archive_name_array), "-")) {
archive = 0;
} else {
if (!(force_local_option ^ 1)) {
LABEL_4011bb:
v14 = open(*(archive_name_array), 0x0, 0x1b6);
} else {
rmt_dev_name__ = strchr(*(archive_name_array), 0x3a);
if (!(rmt_dev_name__) || !(*(archive_name_array) < rmt_dev_name__) || !(!memchr(*(archive_name_array), 0x2f, rmt_dev_name__ - *(archive_name_array))))
goto LABEL_4011bb;
v14 = rmt_open__(*(archive_name_array), 0x0, 0x40000000, rsh_command_option);
}
archive = v14;
}
if (archive < 0)
open_fatal(*(archive_name_array));
while (true) {
clear_read_error_count();
while (true) {
if (archive > 1073741823)
v15 = rmt_read__(archive - 0x40000000, *(&record_start), *(&record_size), archive - 0x40000000);
else
v15 = safe_read(archive, *(&record_start), *(&record_size));
v4 = v15;
if (v4 != -1)
break;
archive_read_error();
}
if (!v4)
break;
v2 = *(&record_start);
for (v3 = v4; v3; v3 -= v5) {
*(&v5) = (v3 <= 0x200 ? 0x200 : v3);
if (v5 != full_write(0x1, v2, v5, a3))
write_error(use_compress_program_option);
v2 = v2 + v5;
}
}
xclose(0x1);
wait_for_grandchild(v1);
}
if (!force_local_option) {
rmt_dev_name__ = strchr(*(archive_name_array), 0x3a);
if (!(!rmt_dev_name__) && !(*(archive_name_array) >= rmt_dev_name__) && !(memchr(*(archive_name_array), 0x2f, rmt_dev_name__ - *(archive_name_array))))
goto LABEL_401075;
}
if (is_regular_file(*(archive_name_array))) {
v13 = 438;
archive = open(*(archive_name_array), 0x0, 0x1b6);
if (archive < 0)
open_fatal(*(archive_name_array));
xdup2(archive, 0x0, reg_32, a3, a4, a5);
priv_set_restore_linkdir();
run_decompress_program(a0, 0x0, reg_32, a3, a4, a5);
}
goto LABEL_401075;
} else {
archive = *(&v6);
xclose(*(&v7));
if ((v10 ^ v12[5]))
__stack_chk_fail();
return v0;
}
}
|
static const char *ntable_strtime_delta(__u32 msec)
{
static char str[32];
struct timeval now = {};
time_t t;
struct tm *tp;
if (msec == 0)
goto error;
if (gettimeofday(&now,
((void *)0)
) < 0) {
perror("gettimeofday");
goto error;
}
t = now.tv_sec - (msec / 1000);
tp = localtime(&t);
if (!tp)
goto error;
strftime(str, sizeof(str), "%Y-%m-%d %T", tp);
return str;
error:
strcpy(str, "(error)");
return str;
}
| undefined1 * ntable_strtime_delta(uint param_1)
{
int iVar1;
long in_FS_OFFSET;
long local_38;
tm *local_30;
timeval local_28;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_28.tv_sec = 0;
local_28.tv_usec = 0;
if (param_1 != 0) {
iVar1 = gettimeofday(&local_28,(__timezone_ptr_t)0x0);
if (iVar1 < 0) {
perror("gettimeofday");
}
else {
local_38 = local_28.tv_sec - (ulong)param_1 / 1000;
local_30 = localtime(&local_38);
if (local_30 != (tm *)0x0) {
strftime(str_8334,0x20,"%Y-%m-%d %T",local_30);
goto LAB_001010ea;
}
}
}
strcpy(str_8334,"(error)");
LAB_001010ea:
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return str_8334;
}
__stack_chk_fail();
}
|
FILE *
funopen(const void *cookie,
int (*readfn)(void *cookie, char *buf, int size),
int (*writefn)(void *cookie, const char *buf, int size),
off_t (*seekfn)(void *cookie, off_t offset, int whence),
int (*closefn)(void *cookie))
{
struct funopen_cookie *cookiewrap;
cookie_io_functions_t funcswrap = {
.read = funopen_read,
.write = funopen_write,
.seek = funopen_seek,
.close = funopen_close,
};
const char *mode;
if (readfn) {
if (writefn ==
((void *)0)
)
mode = "r";
else
mode = "r+";
} else if (writefn) {
mode = "w";
} else {
(*__errno_location ())
=
22
;
return
((void *)0)
;
}
cookiewrap = malloc(sizeof(*cookiewrap));
if (cookiewrap ==
((void *)0)
)
return
((void *)0)
;
cookiewrap->orig_cookie = (void *)cookie;
cookiewrap->readfn = readfn;
cookiewrap->writefn = writefn;
cookiewrap->seekfn = seekfn;
cookiewrap->closefn = closefn;
return fopencookie(cookiewrap, mode, funcswrap);
}
| FILE * funopen(undefined8 param_1,long param_2,long param_3,undefined8 param_4,undefined8 param_5)
{
int *piVar1;
undefined8 *__magic_cookie;
FILE *pFVar2;
char *local_38;
if (param_2 == 0) {
if (param_3 == 0) {
piVar1 = __errno_location();
*piVar1 = 0x16;
return (FILE *)0x0;
}
local_38 = "w";
}
else if (param_3 == 0) {
local_38 = "r";
}
else {
local_38 = "r+";
}
__magic_cookie = (undefined8 *)malloc(0x28);
if (__magic_cookie == (undefined8 *)0x0) {
pFVar2 = (FILE *)0x0;
}
else {
*__magic_cookie = param_1;
__magic_cookie[1] = param_2;
__magic_cookie[2] = param_3;
__magic_cookie[3] = param_4;
__magic_cookie[4] = param_5;
pFVar2 = fopencookie(__magic_cookie,local_38,
(_IO_cookie_io_functions_t)
CONCAT725(0x1001,CONCAT124(0x43,CONCAT816(0x1000c3,CONCAT88(0x100067,
0x100000)))));
}
return pFVar2;
}
|
void destroy_encrypted_file_info(e2fsck_t ctx)
{
struct encrypted_file_info *info = ctx->encrypted_files;
if (info) {
destroy_encryption_policy_map(ctx);
ext2fs_free_mem(&info->file_ranges);
ext2fs_free_mem(&info);
ctx->encrypted_files =
((void *)0)
;
}
}
| long long destroy_encrypted_file_info(struct_0 *a0) {
unsigned long long v0;
v0 = a0->field_250;
if (v0) {
destroy_encryption_policy_map(a0);
ext2fs_free_mem(v0);
ext2fs_free_mem(&v0);
a0->field_250 = 0;
return 0;
}
return 0;
}
|
int
main (int argc, char **argv)
{
int c;
_Bool
ok;
_Bool
make_backups =
0
;
char const *backup_suffix =
((void *)0)
;
char *version_control_string =
((void *)0)
;
struct cp_options x;
_Bool
remove_trailing_slashes =
0
;
char const *target_directory =
((void *)0)
;
_Bool
no_target_directory =
0
;
int n_files;
char **file;
_Bool
selinux_enabled = (0 < is_selinux_enabled ());
;
set_program_name (argv[0]);
setlocale (
6
, "");
bindtextdomain ("coreutils", "/usr/local/share/locale");
textdomain ("coreutils");
atexit (close_stdin);
cp_option_init (&x);
priv_set_remove_linkdir ();
while ((c = getopt_long (argc, argv, "bfint:uvS:TZ", long_options,
((void *)0)
))
!= -1)
{
switch (c)
{
case 'b':
make_backups =
1
;
if (optarg)
version_control_string = optarg;
break;
case 'f':
x.interactive = I_ALWAYS_YES;
break;
case 'i':
x.interactive = I_ASK_USER;
break;
case 'n':
x.interactive = I_ALWAYS_NO;
break;
case STRIP_TRAILING_SLASHES_OPTION:
remove_trailing_slashes =
1
;
break;
case 't':
if (target_directory)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"multiple target directories specified\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("multiple target directories specified")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("multiple target directories specified")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
target_directory = optarg;
break;
case 'T':
no_target_directory =
1
;
break;
case 'u':
x.update =
1
;
break;
case 'v':
x.verbose =
1
;
break;
case 'S':
make_backups =
1
;
backup_suffix = optarg;
break;
case 'Z':
if (selinux_enabled)
{
x.preserve_security_context =
0
;
x.set_security_context = selabel_open (
0
,
((void *)0)
, 0);
if (! x.set_security_context)
error (0,
(*__errno_location ())
, gettext ("warning: ignoring --context"));
}
break;
case GETOPT_HELP_CHAR: usage (
0
); break;;
case GETOPT_VERSION_CHAR: version_etc (
stdout
, "mv", "GNU coreutils", Version, ("Mike Parker"), ("David MacKenzie"), ("Jim Meyering"), (char *)
((void *)0)
); exit (
0
); break;;
default:
usage (
1
);
}
}
n_files = argc - optind;
file = argv + optind;
if (n_files <= !target_directory)
{
if (n_files <= 0)
error (0, 0, gettext ("missing file operand"));
else
error (0, 0, gettext ("missing destination file operand after %s"),
quotearg_style (shell_escape_always_quoting_style, file[0]));
usage (
1
);
}
struct stat sb;
sb.st_mode = 0;
int target_dirfd =
-100
;
if (no_target_directory)
{
if (target_directory)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot combine --target-directory (-t) \" \"and --no-target-directory (-T)\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("cannot combine --target-directory (-t) " "and --no-target-directory (-T)")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("cannot combine --target-directory (-t) " "and --no-target-directory (-T)")), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
if (2 < n_files)
{
error (0, 0, gettext ("extra operand %s"), quotearg_style (shell_escape_always_quoting_style, file[2]));
usage (
1
);
}
}
else if (target_directory)
{
target_dirfd = target_directory_operand (target_directory, &sb);
if (! target_dirfd_valid (target_dirfd))
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"target directory %s\"), quotearg_style (shell_escape_always_quoting_style, target_directory)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, gettext ("target directory %s"), quotearg_style (shell_escape_always_quoting_style, target_directory)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, gettext ("target directory %s"), quotearg_style (shell_escape_always_quoting_style, target_directory)), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
else
{
char const *lastfile = file[n_files - 1];
if (n_files == 2)
x.rename_errno = (renameatu (
-100
, file[0],
-100
, lastfile,
(1 << 0)
)
?
(*__errno_location ())
: 0);
if (x.rename_errno != 0)
{
int fd = target_directory_operand (lastfile, &sb);
if (target_dirfd_valid (fd))
{
x.rename_errno = -1;
target_dirfd = fd;
target_directory = lastfile;
n_files--;
}
else
{
int err =
(*__errno_location ())
;
if (2 < n_files
|| (O_PATHSEARCH ==
00
&& err ==
13
&& (sb.st_mode != 0 || stat (lastfile, &sb) == 0)
&&
((((
sb.st_mode
)) & 0170000) == (0040000))
))
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, err, gettext (\"target %s\"), quotearg_style (shell_escape_always_quoting_style, lastfile)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, err, gettext ("target %s"), quotearg_style (shell_escape_always_quoting_style, lastfile)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, err, gettext ("target %s"), quotearg_style (shell_escape_always_quoting_style, lastfile)), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
}
}
}
if (remove_trailing_slashes)
for (int i = 0; i < n_files; i++)
strip_trailing_slashes (file[i]);
if (x.interactive == I_ALWAYS_NO)
x.update =
0
;
if (make_backups && x.interactive == I_ALWAYS_NO)
{
error (0, 0,
gettext ("options --backup and --no-clobber are mutually exclusive"));
usage (
1
);
}
x.backup_type = (make_backups
? xget_version (gettext ("backup type"),
version_control_string)
: no_backups);
set_simple_backup_suffix (backup_suffix);
hash_init ();
if (target_directory)
{
if (2 <= n_files)
dest_info_init (&x);
ok =
1
;
for (int i = 0; i < n_files; ++i)
{
x.last_file = i + 1 == n_files;
char const *source = file[i];
char const *source_basename = last_component (source);
char *dest_relname;
char *dest = file_name_concat (target_directory, source_basename,
&dest_relname);
strip_trailing_slashes (dest_relname);
ok &= do_move (source, dest, target_dirfd, dest_relname, &x);
free (dest);
}
}
else
{
x.last_file =
1
;
ok = do_move (file[0], file[1],
-100
, file[1], &x);
}
return ok ?
0
:
1
;
}
| int main(unsigned long long a0, unsigned long long *a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
void* v0;
char v1;
char v2;
char v3;
char v4;
char v5;
unsigned int v6;
unsigned int v7;
unsigned int v8;
unsigned int v9;
unsigned int v10;
unsigned int v11;
unsigned int v12;
char v13;
void* v14;
void* v15;
void* v16;
unsigned long long v17[3];
unsigned long long v18;
unsigned long long v19;
unsigned long long v20;
void* v21;
char v22;
unsigned int v23;
unsigned long v24;
char v25;
char v26;
char v27;
char v28;
unsigned int v29;
char v30;
unsigned int v31;
unsigned long long v33;
unsigned long long v35;
unsigned int v36;
unsigned long long v37;
unsigned long long v39;
unsigned int v40;
unsigned long long v41;
v2 = 0;
v14 = 0;
v15 = 0;
v3 = 0;
v16 = 0;
v4 = 0;
v5 = is_selinux_enabled() > 0;
set_program_name(*(a1));
setlocale(0x6, &g_401413);
bindtextdomain("coreutils", "/usr/local/share/locale");
textdomain("coreutils");
atexit(got.close_stdin);
cp_option_init(&v22);
priv_set_remove_linkdir(&v22, "/usr/local/share/locale", a2, a3, a4, a5);
while (true) {
v10 = getopt_long(a0, a1, "bfint:uvS:TZ", &long_options, NULL);
if (v10 == -1)
break;
if (!(v10 <= 128))
goto LABEL_400ab3;
if (v10 >= 83) {
switch (v10) {
case 83:
v2 = 1;
v14 = *(&optarg);
break;
case 84:
v4 = 1;
break;
case 90:
if (v5) {
v25 = 0;
v24 = selabel_open(0x0, 0x0, 0x0);
if (!v24) {
error(0x0, *(__errno_location()), gettext("warning: ignoring --context"));
break;
}
}
case 98:
v2 = 1;
if (*(&optarg)) {
v15 = *(&optarg);
break;
}
case 102:
v23 = 1;
break;
case 105:
v23 = 3;
break;
case 110:
v23 = 2;
break;
case 116:
if (!v16) {
v16 = *(&optarg);
break;
} else {
error(0x1, 0x0, gettext("multiple target directories specified"));
}
case 117:
v26 = 1;
break;
case 118:
v27 = 1;
break;
case 128:
v3 = 1;
break;
default:
LABEL_400ab3:
usage(0x1);
}
} else if (v10 == -131) {
v0 = 0;
version_etc(stdout, "mv", "GNU coreutils", Version, "Mike Parker", "David MacKenzie", "Jim Meyering");
exit(0x0);
} else if (v10 == -130) {
usage(0x0);
}
}
v6 = a0 - optind;
v17[0] = &a1[optind];
if (v6 <= (!v16)) {
if (v6 <= 0) {
error(0x0, 0x0, gettext("missing file operand"));
} else {
v33 = quotearg_style(0x4, v17[0]);
error(0x0, 0x0, gettext("missing destination file operand after %s"));
}
usage(0x1);
} else {
v31 = 0;
v7 = -100;
if (v4) {
if (v16) {
error(0x1, 0x0, gettext("cannot combine --target-directory (-t) and --no-target-directory (-T)"));
} else if (v6 > 2) {
v35 = quotearg_style(0x4, v17[2]);
error(0x0, 0x0, gettext("extra operand %s"));
usage(0x1);
}
} else {
if (!v16) {
v18 = v17[1 + v6];
if (v6 == 2) {
if (!renameatu(0xffffff9c, v17[0], 0xffffff9c, v18, 0x1))
v36 = 0;
else
v36 = *(__errno_location());
v29 = v36;
}
if (v29) {
v11 = target_directory_operand(v18, &v30, &v30);
if (target_dirfd_valid(v11)) {
v29 = -1;
v7 = v11;
v16 = v18;
v6 -= 1;
} else {
v12 = *(__errno_location());
if (v6 > 2) {
v39 = quotearg_style(0x4, v18);
error(0x1, v12, gettext("target %s"));
}
}
}
} else {
v7 = target_directory_operand(v16, &v30, &v30);
if ((target_dirfd_valid(v7) ^ 1)) {
v37 = quotearg_style(0x4, v16);
error(0x1, *(__errno_location()), gettext("target directory %s"));
}
}
}
if (v3) {
for (v8 = 0; v8 < v6; v8 += 1) {
strip_trailing_slashes(v17[v8]);
}
}
}
if (v23 == 2)
v26 = 0;
if (v2 && v23 == 2) {
error(0x0, 0x0, gettext("options --backup and --no-clobber are mutually exclusive"));
usage(0x1);
}
if (!v2) {
v40 = 0;
} else {
v41 = gettext("backup type");
v40 = xget_version(v41, v15, v41);
}
v22 = v40;
set_simple_backup_suffix(v14);
hash_init(a0, a1, a2, a3, a4, a5);
if (!v16) {
v28 = 1;
v1 = do_move(v17[0], v17[1], 0xffffff9c, v17[1], &v22);
} else {
if (v6 > 1)
dest_info_init(&v22);
v1 = 1;
for (v9 = 0; v9 < v6; v9 += 1) {
v28 = v6 == v9 + 1;
v19 = v17[v9];
v20 = last_component(v19);
v21 = file_name_concat(v16, v20, &v13, v20);
strip_trailing_slashes(*(&v13));
v1 = (do_move(v19, v21, v7, *(&v13), &v22) & v1);
free(v21);
}
}
return v1 ^ 1;
}
|
(r = sshbuf_consume(iqueue, msg_len - consumed)) != 0)
sshfatal("sftp-server.c", __func__, 1872, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "consume");
}
void
sftp_server_cleanup_exit(int i)
{
if (pw !=
((void *)0)
&& client_addr !=
((void *)0)
) {
handle_log_exit();
sshlog("sftp-server.c", __func__, 1881, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "session closed for local user %s from [%s]", pw->pw_name, client_addr)
;
}
_exit(i);
}
| void sshbuf_consume(void)
{
halt_baddata();
}
|
char *
fmtullong (ui, base, buf, len, flags)
unsigned long long ui;
int base;
char *buf;
size_t len;
int flags;
{
char *p;
int sign;
long long si;
if (base == 0)
base = 10;
if (base < 2 || base > 64)
{
strncpy (buf, gettext("invalid base"), len - 1);
buf[len-1] = '\0';
(*__errno_location ())
=
22
;
return (p = buf);
}
sign = 0;
if ((flags & 0x08) == 0 && (long long)ui < 0)
{
ui = -ui;
sign = '-';
}
p = buf + len - 2;
p[1] = '\0';
switch (base)
{
case 10:
if (ui < 10)
{
*p-- = ((ui) + '0');
break;
}
if ((long long)ui < 0)
{
*p-- = ((ui % 10) + '0');
si = ui / 10;
}
else
si = ui;
do
*p-- = ((si % 10) + '0');
while (si /= 10);
break;
case 8:
do
*p-- = ((ui & 7) + '0');
while (ui >>= 3);
break;
case 16:
do
*p-- = (flags & 0x04) ? "0123456789ABCDEF"[ui & 15] : "0123456789abcdef"[ui & 15];
while (ui >>= 4);
break;
case 2:
do
*p-- = ((ui & 1) + '0');
while (ui >>= 1);
break;
default:
do
*p-- = ((ui % base) < 10) ? (ui % base) + '0' : (((ui % base) < 36) ? (ui % base) - 10 + 'a' : (((ui % base) < 62) ? (ui % base) - 36 + 'A' : (((ui % base) == 62) ? '@' : '_')));
while (ui /= base);
break;
}
if ((flags & 0x01) && (base == 8 || base == 16))
{
if (base == 16)
{
*p-- = (flags & 0x04) ? 'X' : 'x';
*p-- = '0';
}
else if (p[1] != '0')
*p-- = '0';
}
else if ((flags & 0x02) && base != 10)
{
*p-- = '#';
*p-- = ((base % 10) + '0');
if (base > 10)
*p-- = ((base / 10) + '0');
}
if (sign)
*p-- = '-';
return (p + 1);
}
| char * fmtullong(ulong param_1,int param_2,char *param_3,long param_4,uint param_5)
{
char cVar1;
char *pcVar2;
int *piVar3;
int local_44;
ulong local_40;
int local_2c;
char *local_28;
ulong local_20;
local_44 = param_2;
if (param_2 == 0) {
local_44 = 10;
}
if ((local_44 < 2) || (0x40 < local_44)) {
pcVar2 = (char *)gettext("invalid base");
strncpy(param_3,pcVar2,param_4 - 1);
param_3[param_4 + -1] = '\0';
piVar3 = __errno_location();
*piVar3 = 0x16;
return param_3;
}
local_2c = 0;
local_40 = param_1;
if (((param_5 & 8) == 0) && ((long)param_1 < 0)) {
local_40 = -param_1;
local_2c = 0x2d;
}
local_28 = param_3 + param_4 + -2;
local_28[1] = '\0';
if (local_44 == 0x10) {
do {
if ((param_5 & 4) == 0) {
cVar1 = "0123456789abcdef"[(uint)local_40 & 0xf];
}
else {
cVar1 = "0123456789ABCDEF"[(uint)local_40 & 0xf];
}
pcVar2 = local_28 + -1;
*local_28 = cVar1;
local_40 = local_40 >> 4;
local_28 = pcVar2;
} while (local_40 != 0);
goto LAB_001003ce;
}
if (local_44 < 0x11) {
if (local_44 == 10) {
if (local_40 < 10) {
*local_28 = (char)local_40 + '0';
local_28 = local_28 + -1;
}
else {
if ((long)local_40 < 0) {
*local_28 = (char)local_40 + ((char)(local_40 / 10 << 2) + (char)(local_40 / 10)) * -2 +
'0';
local_20 = local_40 / 10;
local_28 = local_28 + -1;
}
else {
local_20 = local_40;
}
do {
pcVar2 = local_28 + -1;
*local_28 = (char)local_20 + (char)((long)local_20 / 10) * -10 + '0';
local_20 = (long)local_20 / 10;
local_28 = pcVar2;
} while (local_20 != 0);
}
goto LAB_001003ce;
}
if (local_44 < 0xb) {
if (local_44 == 2) {
do {
pcVar2 = local_28 + -1;
*local_28 = ((byte)local_40 & 1) + 0x30;
local_40 = local_40 >> 1;
local_28 = pcVar2;
} while (local_40 != 0);
goto LAB_001003ce;
}
if (local_44 == 8) {
do {
pcVar2 = local_28 + -1;
*local_28 = ((byte)local_40 & 7) + 0x30;
local_40 = local_40 >> 3;
local_28 = pcVar2;
} while (local_40 != 0);
goto LAB_001003ce;
}
}
}
do {
if (local_40 % (ulong)(long)local_44 < 10) {
cVar1 = (char)(local_40 % (ulong)(long)local_44) + '0';
}
else if (local_40 % (ulong)(long)local_44 < 0x24) {
cVar1 = (char)(local_40 % (ulong)(long)local_44) + 'W';
}
else if (local_40 % (ulong)(long)local_44 < 0x3e) {
cVar1 = (char)(local_40 % (ulong)(long)local_44) + '\x1d';
}
else if (local_40 % (ulong)(long)local_44 == 0x3e) {
cVar1 = '@';
}
else {
cVar1 = '_';
}
pcVar2 = local_28 + -1;
*local_28 = cVar1;
local_40 = local_40 / (ulong)(long)local_44;
local_28 = pcVar2;
} while (local_40 != 0);
LAB_001003ce:
pcVar2 = local_28;
if (((param_5 & 1) == 0) || ((local_44 != 8 && (local_44 != 0x10)))) {
if (((param_5 & 2) != 0) && (local_44 != 10)) {
*local_28 = '#';
local_28[-1] = (char)local_44 + (char)(local_44 / 10) * -10 + '0';
pcVar2 = local_28 + -2;
if (10 < local_44) {
local_28[-2] = (char)(local_44 / 10) + '0';
pcVar2 = local_28 + -3;
}
}
}
else if (local_44 == 0x10) {
if ((param_5 & 4) == 0) {
cVar1 = 'x';
}
else {
cVar1 = 'X';
}
*local_28 = cVar1;
local_28[-1] = '0';
pcVar2 = local_28 + -2;
}
else if (local_28[1] != '0') {
*local_28 = '0';
pcVar2 = local_28 + -1;
}
local_28 = pcVar2;
if (local_2c != 0) {
*local_28 = '-';
local_28 = local_28 + -1;
}
return local_28 + 1;
}
|
static struct ipv6_rpl_sr_hdr *parse_rpl_srh(char *segbuf)
{
struct ipv6_rpl_sr_hdr *srh;
int nsegs = 0;
int srhlen;
char *s;
int i;
s = segbuf;
for (i = 0; *s; *s++ == ',' ? i++ : *s);
nsegs = i + 1;
srhlen = 8 + 16 * nsegs;
srh = calloc(1, srhlen);
srh->hdrlen = (srhlen >> 3) - 1;
srh->type = 3;
srh->segments_left = nsegs;
for (s = strtok(segbuf, ","); s; s = strtok(
((void *)0)
, ",")) {
inet_prefix addr;
get_addr(&addr, s,
10
);
memcpy(&srh->segments.addr[i], addr.data, sizeof(struct in6_addr));
i--;
}
return srh;
}
| void * parse_rpl_srh(char *param_1)
{
char *pcVar1;
char cVar2;
int iVar3;
void *pvVar4;
long in_FS_OFFSET;
int local_134;
char *local_128;
undefined local_118 [8];
undefined local_110 [256];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_134 = 0;
local_128 = param_1;
while (*local_128 != '\0') {
pcVar1 = local_128 + 1;
cVar2 = *local_128;
local_128 = pcVar1;
if (cVar2 == ',') {
local_134 = local_134 + 1;
}
}
iVar3 = (local_134 + 1) * 0x10 + 8;
pvVar4 = calloc(1,(long)iVar3);
*(char *)((long)pvVar4 + 1) = (char)(iVar3 >> 3) + -1;
*(undefined *)((long)pvVar4 + 2) = 3;
*(char *)((long)pvVar4 + 3) = (char)(local_134 + 1);
local_128 = strtok(param_1,",");
while (local_128 != (char *)0x0) {
get_addr(local_118,local_128,10);
memcpy((void *)((long)pvVar4 + (long)local_134 * 0x10 + 8),local_110,0x10);
local_134 = local_134 + -1;
local_128 = strtok((char *)0x0,",");
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return pvVar4;
}
|
void *
xmalloc (size_t size)
{
void *ret;
ret = malloc (size);
if (ret == 0) {
fprintf(
stderr
, "man2html: out of memory");
exit(
1
);
}
return ret;
}
| int xmalloc(unsigned int a0) {
unsigned long v0;
v0 = malloc(a0);
if (!v0) {
fprintf(stderr, "man2html: out of memory");
exit(0x1);
}
return v0;
}
|
static int
fdlim_set(int lim)
{
struct rlimit rlfd;
if (lim <= 0)
return (-1);
if (getrlimit(
RLIMIT_NOFILE
, &rlfd) == -1)
return (-1);
rlfd.rlim_cur = lim;
if (setrlimit(
RLIMIT_NOFILE
, &rlfd) == -1)
return (-1);
return (0);
}
| undefined8 fdlim_set(int param_1)
{
int iVar1;
undefined8 uVar2;
long in_FS_OFFSET;
rlimit local_28;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
if (param_1 < 1) {
uVar2 = 0xffffffff;
}
else {
iVar1 = getrlimit(RLIMIT_NOFILE,&local_28);
if (iVar1 == -1) {
uVar2 = 0xffffffff;
}
else {
local_28.rlim_cur = (rlim_t)param_1;
iVar1 = setrlimit(RLIMIT_NOFILE,&local_28);
if (iVar1 == -1) {
uVar2 = 0xffffffff;
}
else {
uVar2 = 0;
}
}
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar2;
}
|
void
load_hostkeys(struct hostkeys *hostkeys, const char *host, const char *path,
u_int note)
{
FILE *f;
if ((f = fopen(path, "r")) ==
((void *)0)
) {
sshlog("hostfile.c", __func__, 292, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "fopen %s: %s", path, strerror(
(*__errno_location ())
));
return;
}
load_hostkeys_file(hostkeys, host, path, f, note);
fclose(f);
}
| long long load_hostkeys(unsigned int a0, unsigned long long a1, char *a2, unsigned long a3) {
unsigned long long v0;
unsigned long v1;
unsigned long v2;
void* v3;
unsigned long long v5;
v3 = fopen(a2, "r");
if (v3) {
load_hostkeys_file(a0, a1, a2, v3, a3);
v5 = fclose(v3);
} else {
v2 = strerror(*(__errno_location()));
v1 = a2;
v0 = "fopen %s: %s";
v5 = sshlog("hostfile.c", "load_hostkeys", 0x124, 0x1, 0x5, 0x0);
}
return v5;
}
|
_Bool
pred_comma (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
if (pred_ptr->pred_left !=
((void *)0)
)
{
apply_predicate (pathname, stat_buf,pred_ptr->pred_left);
}
return apply_predicate (pathname, stat_buf, pred_ptr->pred_right);
}
| long long pred_comma(unsigned long long a0, unsigned long long a1, unsigned long long a2[36]) {
if (a2[34])
apply_predicate(a0, a1, a2[34], a1);
return apply_predicate(a0, a1, a2[35], a1);
}
|
static void
calcsize(n)
union node *n;
{
if (n ==
((void *)0)
)
return;
funcblocksize += nodesize[n->type];
switch (n->type) {
case 0:
calcsize(n->ncmd.redirect);
calcsize(n->ncmd.args);
calcsize(n->ncmd.assign);
break;
case 1:
sizenodelist(n->npipe.cmdlist);
break;
case 2:
case 3:
case 4:
calcsize(n->nredir.redirect);
calcsize(n->nredir.n);
break;
case 5:
case 6:
case 7:
case 9:
case 10:
calcsize(n->nbinary.ch2);
calcsize(n->nbinary.ch1);
break;
case 8:
calcsize(n->nif.elsepart);
calcsize(n->nif.ifpart);
calcsize(n->nif.test);
break;
case 11:
funcstringsize += strlen(n->nfor.var) + 1;
calcsize(n->nfor.body);
calcsize(n->nfor.args);
break;
case 12:
calcsize(n->ncase.cases);
calcsize(n->ncase.expr);
break;
case 13:
calcsize(n->nclist.body);
calcsize(n->nclist.pattern);
calcsize(n->nclist.next);
break;
case 14:
calcsize(n->ndefun.body);
funcstringsize += strlen(n->ndefun.text) + 1;
break;
case 15:
sizenodelist(n->narg.backquote);
funcstringsize += strlen(n->narg.text) + 1;
calcsize(n->narg.next);
break;
case 16:
case 17:
case 18:
case 19:
case 20:
calcsize(n->nfile.fname);
calcsize(n->nfile.next);
break;
case 21:
case 22:
calcsize(n->ndup.vname);
calcsize(n->ndup.next);
break;
case 23:
case 24:
calcsize(n->nhere.doc);
calcsize(n->nhere.next);
break;
case 25:
calcsize(n->nnot.com);
break;
};
}
| void calcsize(struct_0 *a0) {
struct_1 *v1;
unsigned long long v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v14;
unsigned long long v15;
if (a0) {
funcstringsize = 2372415452829272149 + *((2 * a0->field_0 + &nodesize));
v1 = a0->field_0;
switch (a0->field_0) {
case 0:
calcsize(a0->field_18);
calcsize(a0->field_10);
v11 = calcsize(a0->field_8);
break;
case 1:
v3 = sizenodelist(a0->field_8);
break;
case 2: case 3: case 4:
calcsize(a0->field_10);
v5 = calcsize(a0->field_8);
break;
case 5: case 6: case 7: case 9: case 10:
calcsize(a0->field_10);
v8 = calcsize(a0->field_8);
break;
case 8:
calcsize(a0->field_18);
calcsize(a0->field_10);
v14 = calcsize(a0->field_8);
break;
case 11:
funcstringsize = 2372415452829272149 + strlen(a0->field_18) + 1;
calcsize(a0->field_10);
v15 = calcsize(a0->field_8);
break;
case 12:
calcsize(a0->field_10);
v9 = calcsize(a0->field_8);
break;
case 13:
calcsize(a0->field_18);
calcsize(a0->field_10);
v10 = calcsize(a0->field_8);
break;
case 14:
calcsize(a0->field_10);
funcstringsize = 2372415452829272149 + strlen(a0->field_8) + 1;
break;
case 15:
sizenodelist(a0->field_18);
funcstringsize = 2372415452829272149 + strlen(a0->field_10) + 1;
v12 = calcsize(a0->field_8);
break;
case 16: case 17: case 18: case 19: case 20:
calcsize(a0->field_18);
v4 = calcsize(a0->field_8);
break;
case 21: case 22:
calcsize(a0->field_18);
v6 = calcsize(a0->field_8);
break;
case 23: case 24:
calcsize(a0->field_18);
v7 = calcsize(a0->field_8);
break;
case 25:
v2 = calcsize(a0->field_8);
break;
}
}
return;
}
|
static void
mp_factor_init (struct mp_factors *factors)
{
factors->p =
((void *)0)
;
factors->e =
((void *)0)
;
factors->nfactors = 0;
}
| long long mp_factor_init(unsigned long long a0[3]) {
a0[0] = 0;
a0[1] = 0;
a0[2] = 0;
return a0;
}
|
int get_non_repudiation_status(void)
{
if (batch) {
return cfg.non_repudiation;
} else {
return 0;
}
}
| long get_non_repudiation_status()
{
if ( batch )
return (unsigned int)cfg[143];
else
return 0LL;
}
|
static int __errcode_to_errno(errcode_t err, const char *func, int line)
{
if (err == 0)
return 0;
fprintf(
stderr
, "Error \"%s\" encountered in function %s at line %d\n",
error_message(err), func, line);
if (err <= 256)
return -err;
return -
14
;
}
| int __errcode_to_errno(unsigned long long a0, unsigned long a1, unsigned long a2) {
unsigned int v1;
if (!a0) {
v1 = 0;
} else {
fprintf(stderr, "Error \"%s\" encountered in function %s at line %d\n", error_message(a0), a1, a2);
if (a0 > 0x100)
v1 = -14;
else
v1 = -(a0);
}
return v1;
}
|
int
strnunvisx(char *dst, size_t dlen, const char *src, int flag)
{
char c;
char t = '\0', *start = dst;
int state = 0;
;
;
while ((c = *src++) != '\0') {
again:
switch (unvis(&t, c, &state, flag)) {
case 1:
do { if (dlen-- == 0) {
(*__errno_location ())
=
28
; return -1; } } while (0);
*dst++ = t;
break;
case 2:
do { if (dlen-- == 0) {
(*__errno_location ())
=
28
; return -1; } } while (0);
*dst++ = t;
goto again;
case 0:
case 3:
break;
case -1:
(*__errno_location ())
=
22
;
return -1;
default:
;
(*__errno_location ())
=
22
;
return -1;
}
}
if (unvis(&t, c, &state, 0x0800) == 1) {
do { if (dlen-- == 0) {
(*__errno_location ())
=
28
; return -1; } } while (0);
*dst++ = t;
}
do { if (dlen-- == 0) {
(*__errno_location ())
=
28
; return -1; } } while (0);
*dst = '\0';
return (int)(dst - start);
}
| void strnunvisx(unsigned long long a0, unsigned long long a1, unsigned long a2, unsigned long a3) {
char *v0;
int tmp_11;
unsigned long long v1;
char *v2;
char v3;
char v4;
unsigned int v5;
char *v6;
struct_0 *v9;
unsigned long long v10;
unsigned long long v11;
char *v12;
unsigned long long v13;
char *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;
char *v21;
unsigned long long v22;
unsigned long long v23;
unsigned long long v24;
unsigned long long v25;
v2 = a0;
v1 = a1;
v0 = a2;
v3 = 0;
v6 = v2;
v5 = 0;
if (true) {
while (true) {
tmp_11 = v0;
v0 += 1;
v4 = *(tmp_11);
if (v4) {
if (v11) {
v12 = v2;
v2 += 1;
*(v12) = v3;
}
v9 = unvis(&v3, v4, &v5, a3) + 1;
switch (v9) {
case 0:
*(__errno_location()) = 22;
v16 = 4294967295;
break;
case 1: case 4:
continue;
case 2:
v13 = v1;
v1 -= 1;
if (!v13) {
*(__errno_location()) = 28;
v17 = 4294967295;
break;
} else {
v14 = v2;
v2 += 1;
*(v14) = v3;
continue;
}
case 3:
v11 = v1;
v1 -= 1;
if (!v11) {
*(__errno_location()) = 28;
v18 = 4294967295;
break;
}
default:
*(__errno_location()) = 22;
v19 = 4294967295;
break;
}
if (v9 <= 4)
v10 = *((0x4 * &v9->padding_0[0] + &g_40115c)) + &g_40115c;
} else {
v15 = unvis(&v3, v4, &v5, 0x800);
if (v15 == 1) {
v20 = v1;
v1 -= 1;
if (!v20) {
*(__errno_location()) = 28;
v23 = 4294967295;
break;
} else {
v21 = v2;
v2 += 1;
*(v21) = v3;
}
}
if (v15 != 1 || v20) {
v22 = v1;
v1 -= 1;
if (!v22) {
*(__errno_location()) = 28;
v25 = 4294967295;
break;
} else {
*(v2) = 0;
v24 = v2 - v6;
break;
}
}
}
}
}
return;
}
|
void
muxserver_listen(struct ssh *ssh)
{
mode_t old_umask;
char *orig_control_path = options.control_path;
char rbuf[16+1];
u_int i, r;
int oerrno;
if (options.control_path ==
((void *)0)
||
options.control_master == 0)
return;
sshlog("mux.c", __func__, 1270, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "setting up multiplex master socket");
for (i = 0; i < sizeof(rbuf) - 1; i++) {
r = arc4random_uniform(26+26+10);
rbuf[i] = (r < 26) ? 'a' + r :
(r < 26*2) ? 'A' + r - 26 :
'0' + r - 26 - 26;
}
rbuf[sizeof(rbuf) - 1] = '\0';
options.control_path =
((void *)0)
;
xasprintf(&options.control_path, "%s.%s", orig_control_path, rbuf);
sshlog("mux.c", __func__, 1287, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "temporary control path %s", options.control_path);
old_umask = umask(0177);
muxserver_sock = unix_listener(options.control_path, 64, 0);
oerrno =
(*__errno_location ())
;
umask(old_umask);
if (muxserver_sock < 0) {
if (oerrno ==
22
|| oerrno ==
98
) {
sshlog("mux.c", __func__, 1295, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "ControlSocket %s already exists, " "disabling multiplexing", options.control_path)
;
disable_mux_master:
if (muxserver_sock != -1) {
close(muxserver_sock);
muxserver_sock = -1;
}
free(orig_control_path);
free(options.control_path);
options.control_path =
((void *)0)
;
options.control_master = 0;
return;
} else {
cleanup_exit(255);
}
}
if (link(options.control_path, orig_control_path) != 0) {
if (
(*__errno_location ())
!=
17
) {
sshfatal("mux.c", __func__, 1316, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "link mux listener %s => %s: %s", options.control_path, orig_control_path, strerror(
(*__errno_location ())
))
;
}
sshlog("mux.c", __func__, 1320, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "ControlSocket %s already exists, disabling multiplexing", orig_control_path)
;
unlink(options.control_path);
goto disable_mux_master;
}
unlink(options.control_path);
free(options.control_path);
options.control_path = orig_control_path;
set_nonblock(muxserver_sock);
mux_listener_channel = channel_new(ssh, "mux listener",
15, muxserver_sock, muxserver_sock, -1,
(64*(32*1024)), (32*1024),
0, options.control_path, 1);
mux_listener_channel->mux_rcb = mux_master_read_cb;
sshlog("mux.c", __func__, 1336, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "mux listener channel %d fd %d", mux_listener_channel->self, mux_listener_channel->sock)
;
}
| unsigned long muxserver_listen(long a1)
{
char v1;
int *v2;
char *v3;
unsigned int i;
__mode_t mask;
int v7;
unsigned int v8;
char *ptr;
char v10[24];
unsigned long v11;
v11 = __readfsqword(0x28u);
ptr = *(char **)&options[1240];
if ( !ptr || !options[1242] )
return __readfsqword(0x28u) ^ v11;
sshlog("mux.c", "muxserver_listen", 1270LL, 0LL, 5LL, 0LL, "setting up multiplex master socket");
for ( i = 0; i <= 0xF; ++i )
{
v8 = arc4random_uniform(62LL);
if ( v8 > 0x19 )
{
if ( v8 > 0x33 )
v1 = v8 - 4;
else
v1 = v8 + 39;
}
else
{
v1 = v8 + 97;
}
v10[i] = v1;
}
v10[16] = 0;
*(_QWORD *)&options[1240] = 0LL;
xasprintf(&options[1240], "%s.%s", ptr, v10);
sshlog(
"mux.c",
"muxserver_listen",
1287LL,
1LL,
7LL,
0LL,
"temporary control path %s",
*(const char **)&options[1240]);
mask = umask(0x7Fu);
muxserver_sock = unix_listener(*(_QWORD *)&options[1240], 64LL, 0LL);
v7 = *_errno_location();
umask(mask);
if ( muxserver_sock >= 0 )
goto LABEL_19;
if ( v7 != 22 && v7 != 98 )
{
cleanup_exit(255LL);
LABEL_19:
if ( !link(*(const char **)&options[1240], ptr) )
{
unlink(*(const char **)&options[1240]);
free(*(void **)&options[1240]);
*(_QWORD *)&options[1240] = ptr;
set_nonblock((unsigned int)muxserver_sock);
mux_listener_channel = channel_new(
a1,
"mux listener",
15LL,
(unsigned int)muxserver_sock,
(unsigned int)muxserver_sock,
0xFFFFFFFFLL,
0x200000LL,
0x8000LL,
0LL,
*(_QWORD *)&options[1240],
1LL);
*(_QWORD *)(mux_listener_channel + 328) = mux_master_read_cb;
sshlog(
"mux.c",
"muxserver_listen",
1336LL,
1LL,
7LL,
0LL,
"mux listener channel %d fd %d",
*(unsigned int *)(mux_listener_channel + 4),
*(unsigned int *)(mux_listener_channel + 40));
return __readfsqword(0x28u) ^ v11;
}
if ( *_errno_location() != 17 )
{
v2 = _errno_location();
v3 = strerror(*v2);
sshfatal(
"mux.c",
"muxserver_listen",
1316LL,
1LL,
1LL,
0LL,
"link mux listener %s => %s: %s",
*(const char **)&options[1240],
ptr,
v3);
}
sshlog(
"mux.c",
"muxserver_listen",
1320LL,
0LL,
2LL,
0LL,
"ControlSocket %s already exists, disabling multiplexing",
ptr);
unlink(*(const char **)&options[1240]);
goto LABEL_15;
}
sshlog(
"mux.c",
"muxserver_listen",
1295LL,
0LL,
2LL,
0LL,
"ControlSocket %s already exists, disabling multiplexing",
*(const char **)&options[1240]);
LABEL_15:
if ( muxserver_sock != -1 )
{
close(muxserver_sock);
muxserver_sock = -1;
}
free(ptr);
free(*(void **)&options[1240]);
*(_QWORD *)&options[1240] = 0LL;
options[1242] = 0;
return __readfsqword(0x28u) ^ v11;
}
|
void
stunalloc(pointer p)
{
stacknleft += stacknxt - (char *)p;
stacknxt = p;
}
| long long stunalloc(unsigned long long a0) {
stacknleft = stacknleft + stacknxt - a0;
stacknxt = a0;
return a0;
}
|
int
strsenvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags,
const char *mbextra, int *cerr_ptr)
{
return istrsenvisx(&mbdst, &dlen, mbsrc, len, flags, mbextra, cerr_ptr);
}
| long strsenvisx(char *a1, size_t a2, const char *a3, unsigned long a4, int a5, char *a6, int *a7)
{
size_t v8;
char *v9;
v9 = a1;
v8 = a2;
return istrsenvisx(&v9, &v8, a3, a4, a5, a6, a7);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.