input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
static void bareudp_print_help(struct link_util *lu, int argc, char **argv,
FILE *f)
{
print_explain(f);
}
| long long bareudp_print_help(unsigned long a0, unsigned long a1, unsigned long a2, void* a3) {
unsigned long v0;
unsigned int v1;
unsigned long v2;
v2 = a0;
v1 = a1;
v0 = a2;
return print_explain(a3);
}
|
static void print_explain(FILE *f)
{
fprintf(f,
"Usage: ... bareudp dstport PORT\n"
" ethertype PROTO\n"
" [ srcportmin PORT ]\n"
" [ [no]multiproto ]\n"
"\n"
"Where: PORT := UDP_PORT\n"
" PROTO := ETHERTYPE\n"
"\n"
"Note: ETHERTYPE can be given as number or as protocol name (\"ipv4\", \"ipv6\",\n"
" \"mpls_uc\", etc.).\n"
);
}
| int print_explain(FILE *a1)
{
return fprintf(
a1,
"Usage: ... bareudp dstport PORT\n"
"\t\tethertype PROTO\n"
"\t\t[ srcportmin PORT ]\n"
"\t\t[ [no]multiproto ]\n"
"\n"
"Where:\tPORT := UDP_PORT\n"
"\tPROTO := ETHERTYPE\n"
"\n"
"Note: ETHERTYPE can be given as number or as protocol name (\"ipv4\", \"ipv6\",\n"
" \"mpls_uc\", etc.).\n");
}
|
static uintmax_t
parse_owner_group (char *arg, uintmax_t field_max, char const **name_option)
{
uintmax_t u =
(18446744073709551615UL)
;
char *end;
char const *name = 0;
char const *invalid_num = 0;
char *colon = strchr (arg, ':');
if (colon)
{
char const *num = colon + 1;
*colon = '\0';
if (*arg)
name = arg;
if (num && (! (xstrtoumax (num, &end, 10, &u, "") == LONGINT_OK
&& u <= field_max)))
invalid_num = num;
}
else
{
uintmax_t u1;
switch ('0' <= *arg && *arg <= '9'
? xstrtoumax (arg, &end, 10, &u1, "")
: LONGINT_INVALID)
{
default:
name = arg;
break;
case LONGINT_OK:
if (u1 <= field_max)
{
u = u1;
break;
}
__attribute__ ((__fallthrough__));
case LONGINT_OVERFLOW:
invalid_num = arg;
break;
}
}
if (invalid_num)
do { if (error_hook) error_hook (); error (0, 0, "%s: %s", quotearg_colon (invalid_num), gettext ("Invalid owner or group ID")); fatal_exit (); } while (0)
;
if (name)
*name_option = name;
return u;
}
| int parse_owner_group(void* a0, unsigned long a1, unsigned long long *a2, unsigned long a3, unsigned long a4, unsigned long long a5) {
unsigned long long v0;
char v1;
char v2;
void* v3;
void* v4;
char *v5;
unsigned long long v6;
unsigned int v8;
unsigned int v12;
unsigned int v13;
v0 = -1;
v3 = 0;
v4 = 0;
v5 = strchr(a0, 0x3a);
if (v5) {
v6 = v5 + 1;
*(v5) = 0;
if (*(a0))
v3 = a0;
if (v6 && (a1 < v0 || xstrtoumax(v6, &v1, 0xa, &v0, &g_407b53)))
v4 = v6;
} else {
if (*(a0) > 47 && *(a0) <= 57)
v8 = xstrtoumax(a0, &v1, 0xa, &v2, &g_407b53);
if (*(a0) <= 47 || *(a0) > 57)
v8 = 4;
if (v8) {
if (v8 != 1)
v3 = a0;
} else {
if (a1 >= *(&v2))
v0 = *(&v2);
}
if (v8 == 1 || !v8 && a1 < *(&v2))
v4 = a0;
}
if (v4) {
if (error_hook)
*(5242888)();
v12 = 0;
v13 = 0;
error(0x0, 0x0, "%s: %s");
fatal_exit(reg_72, reg_64, "%s: %s", quotearg_colon(v4), gettext("Invalid owner or group ID"), a5);
}
if (v3)
*(a2) = v3;
return v0;
}
|
void get_extensions_crt_set(int type, void *crt)
{
int ret, i;
unsigned char *raw =
((void *)0)
;
unsigned raw_size;
if (batch) {
if (!cfg.extensions)
goto check_critical;
for (i = 0; cfg.extensions[i] !=
((void *)0)
; i += 2) {
if (cfg.extensions[i + 1] ==
((void *)0)
) {
fprintf(
stderr
,
"extensions: %s does not have an argument.\n",
cfg.extensions[i]);
exit(1);
}
raw = decode_ext_string(cfg.extensions[i+1], &raw_size);
if (type == 1)
ret =
gnutls_x509_crt_set_extension_by_oid(crt,
cfg.extensions[i],
raw, raw_size, 0);
else
ret =
gnutls_x509_crq_set_extension_by_oid(crt,
cfg.extensions[i],
raw, raw_size, 0);
gnutls_free((void *) (raw)), raw=
((void *)0)
;
if (ret < 0) {
fprintf(
stderr
, "set_extensions: %s\n",
gnutls_strerror(ret));
exit(1);
}
}
check_critical:
if (!cfg.crit_extensions)
return;
for (i = 0; cfg.crit_extensions[i] !=
((void *)0)
; i += 2) {
if (cfg.crit_extensions[i + 1] ==
((void *)0)
) {
fprintf(
stderr
,
"extensions: %s does not have an argument.\n",
cfg.crit_extensions[i]);
exit(1);
}
raw = decode_ext_string(cfg.crit_extensions[i+1], &raw_size);
if (type == 1)
ret =
gnutls_x509_crt_set_extension_by_oid(crt,
cfg.crit_extensions[i],
raw, raw_size, 1);
else
ret =
gnutls_x509_crq_set_extension_by_oid(crt,
cfg.crit_extensions[i],
raw, raw_size, 1);
gnutls_free((void *) (raw)), raw=
((void *)0)
;
if (ret < 0) {
fprintf(
stderr
, "set_extensions: %s\n",
gnutls_strerror(ret));
exit(1);
}
}
}
}
| void get_extensions_crt_set(int param_1,undefined8 param_2)
{
long in_FS_OFFSET;
undefined4 local_24;
int local_20;
int local_1c;
undefined8 local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
if (*piRam00000000001061e6 != 0) {
if (*(long *)(lRam00000000001061f7 + 0x188) != 0) {
local_1c = 0;
while (local_18 = 0,
*(long *)(*(long *)(lRam0000000000106396 + 0x188) + (long)local_1c * 8) != 0) {
if (*(long *)(*(long *)(lRam000000000010621a + 0x188) + ((long)local_1c + 1) * 8) == 0) {
fprintf(*ppFRam000000000010625f,"extensions: %s does not have an argument.\n",
*(undefined8 *)(*(long *)(lRam0000000000106241 + 0x188) + (long)local_1c * 8));
}
local_18 = decode_ext_string(*(undefined8 *)
(*(long *)(lRam0000000000106287 + 0x188) +
((long)local_1c + 1) * 8),&local_24);
if (param_1 == 1) {
local_20 = gnutls_x509_crt_set_extension_by_oid
(param_2,*(undefined8 *)
(*(long *)(lRam00000000001062c7 + 0x188) +
(long)local_1c * 8),local_18,local_24,0);
}
else {
local_20 = gnutls_x509_crq_set_extension_by_oid
(param_2,*(undefined8 *)
(*(long *)(lRam0000000000106305 + 0x188) +
(long)local_1c * 8),local_18,local_24,0);
}
(**ppcRam000000000010633c)(local_18);
local_18 = 0;
if (local_20 < 0) {
gnutls_strerror(local_20);
}
local_1c = local_1c + 2;
}
}
if (*(long *)(lRam00000000001063c0 + 400) != 0) {
local_1c = 0;
while (local_18 = 0,
*(long *)(*(long *)(lRam000000000010655f + 400) + (long)local_1c * 8) != 0) {
if (*(long *)(*(long *)(lRam00000000001063e3 + 400) + ((long)local_1c + 1) * 8) == 0) {
fprintf(*ppFRam0000000000106428,"extensions: %s does not have an argument.\n",
*(undefined8 *)(*(long *)(lRam000000000010640a + 400) + (long)local_1c * 8));
}
local_18 = decode_ext_string(*(undefined8 *)
(*(long *)(lRam0000000000106450 + 400) +
((long)local_1c + 1) * 8),&local_24);
if (param_1 == 1) {
local_20 = gnutls_x509_crt_set_extension_by_oid
(param_2,*(undefined8 *)
(*(long *)(lRam0000000000106490 + 400) + (long)local_1c * 8
),local_18,local_24,1);
}
else {
local_20 = gnutls_x509_crq_set_extension_by_oid
(param_2,*(undefined8 *)
(*(long *)(lRam00000000001064ce + 400) + (long)local_1c * 8
),local_18,local_24,1);
}
(**ppcRam0000000000106505)(local_18);
local_18 = 0;
if (local_20 < 0) {
gnutls_strerror(local_20);
}
local_1c = local_1c + 2;
}
}
}
local_18 = 0;
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
__stack_chk_fail();
}
|
static int nl_get_ll_addr_len(const char *ifname)
{
int len;
int dev_index = ll_name_to_index(ifname);
struct iplink_req req = {
.n = {
.nlmsg_len = ((sizeof(struct ifinfomsg)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))),
.nlmsg_type = RTM_GETLINK,
.nlmsg_flags = 0x01
},
.i = {
.ifi_family = preferred_family,
.ifi_index = dev_index,
}
};
struct nlmsghdr *answer;
struct rtattr *tb[(__IFLA_MAX - 1)+1];
if (dev_index == 0)
return -1;
if (rtnl_talk(&rth, &req.n, &answer) < 0)
return -1;
len = answer->nlmsg_len - ((sizeof(struct ifinfomsg)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )));
if (len < 0) {
free(answer);
return -1;
}
parse_rtattr_flags(tb, (__IFLA_MAX - 1), ((struct rtattr*)(((char*)(((void *)(((char *)answer) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))))) + ( ((sizeof(struct ifinfomsg))+4U -1) & ~(4U -1) ))),
len, (1 << 15));
if (!tb[IFLA_ADDRESS]) {
free(answer);
return -1;
}
len = ((int)((tb[IFLA_ADDRESS])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)));
free(answer);
return len;
}
| int nl_get_ll_addr_len(undefined8 param_1)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
long in_FS_OFFSET;
byte bVar4;
int *local_630;
undefined local_628 [8];
ushort *local_620;
undefined8 local_438;
undefined local_428;
int local_424;
long local_10;
bVar4 = 0;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_424 = ll_name_to_index(param_1);
puVar3 = &local_438;
for (lVar2 = 0x84; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + (ulong)bVar4 * -2 + 1;
}
local_438._0_4_ = 0x20;
local_438._4_2_ = 0x12;
local_438._6_2_ = 1;
local_428 = (undefined)preferred_family;
if (local_424 == 0) {
iVar1 = -1;
}
else {
iVar1 = rtnl_talk(&rth,&local_438,&local_630);
if (iVar1 < 0) {
iVar1 = -1;
}
else if (*local_630 + -0x20 < 0) {
free(local_630);
iVar1 = -1;
}
else {
parse_rtattr_flags(local_628,0x3c,local_630 + 8,*local_630 + -0x20,0x8000);
if (local_620 == (ushort *)0x0) {
free(local_630);
iVar1 = -1;
}
else {
iVar1 = *local_620 - 4;
free(local_630);
}
}
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return iVar1;
}
|
1
, 0, gettext ("'--pages=FIRST_PAGE[:LAST_PAGE]' missing argument")), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
else if (! first_last_page (oi, 0, optarg))
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"invalid page range %s\"), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
| void gettext(void)
{
halt_baddata();
}
|
static void
run_checkpoint_actions (
_Bool
do_write)
{
struct checkpoint_action *p;
for (p = checkpoint_action; p; p = p->next)
{
switch (p->opcode)
{
case cop_dot:
fputc_unlocked ('.',stdlis);
fflush_unlocked (stdlis);
break;
case cop_bell:
if (!tty)
tty = fopen ("/dev/tty", "w");
if (tty)
{
fputc_unlocked ('\a',tty);
fflush_unlocked (tty);
}
break;
case cop_echo:
{
int n = fprintf (
stderr
, "%s: ", program_name);
format_checkpoint_string (
stderr
, n, p->v.command, do_write,
checkpoint);
fputc_unlocked ('\n',
stderr
);
}
break;
case cop_ttyout:
if (!tty)
tty = fopen ("/dev/tty", "w");
if (tty)
format_checkpoint_string (tty, 0, p->v.command, do_write,
checkpoint);
break;
case cop_sleep:
sleep (p->v.time);
break;
case cop_exec:
sys_exec_checkpoint_script (p->v.command,
archive_name_cursor[0],
checkpoint);
break;
case cop_totals:
compute_duration ();
print_total_stats ();
break;
case cop_wait:
{
int n;
sigwait (&sigs, &n);
}
}
}
}
| void run_checkpoint_actions(unsigned int a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
char v0;
unsigned int v1;
struct_0 *v2;
char v3;
unsigned long long *v5;
unsigned long long v6;
for (v2 = checkpoint_action; v2; v2 = v2->field_0) {
switch (v2->field_8) {
case 0:
fputc_unlocked(0x2e, stdlis);
fflush_unlocked(stdlis);
break;
case 1:
if (!tty)
tty = fopen("/dev/tty", "w");
if (tty) {
fputc_unlocked(0x7, tty);
fflush_unlocked(tty);
}
break;
case 2:
v1 = fprintf(stderr, "%s: ", program_name);
format_checkpoint_string(stderr, v1, v2->field_10, a0, *(&checkpoint));
a0 = 10;
fputc_unlocked(0xa, stderr);
break;
case 3:
if (!tty)
tty = fopen("/dev/tty", "w");
if (tty)
format_checkpoint_string(tty, 0x0, v2->field_10, a0, *(&checkpoint));
break;
case 4:
a0 = v2->field_10;
sleep(v2->field_10);
break;
case 5:
sys_exec_checkpoint_script(v2->field_10, *(archive_name_cursor), *(&checkpoint), *(archive_name_cursor));
break;
case 6:
compute_duration();
print_total_stats(a0, a1, a2, a3, a4, a5);
break;
case 7:
sigwait(&sigs, &v0);
break;
}
}
v6 = *(&v3) ^ v5[5];
return;
}
|
static void
open_preamble(struct ssh *ssh, const char *where, Channel *c, const char *type)
{
int r;
if ((r = sshpkt_start(ssh, 90)) != 0 ||
(r = sshpkt_put_cstring(ssh, type)) != 0 ||
(r = sshpkt_put_u32(ssh, c->self)) != 0 ||
(r = sshpkt_put_u32(ssh, c->local_window)) != 0 ||
(r = sshpkt_put_u32(ssh, c->local_maxpacket)) != 0) {
sshfatal("channels.c", __func__, 960, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s: channel %i: open", where, c->self);
}
}
| void open_preamble(unsigned long long a0, unsigned long a1, unsigned int a2[48], unsigned long long a3) {
unsigned long long v0;
unsigned long v1;
unsigned long v2;
unsigned int v3;
unsigned long long v6;
v3 = sshpkt_start(a0, 0x5a);
if (!v3) {
v3 = sshpkt_put_cstring(a0, a3);
if (!v3) {
v3 = sshpkt_put_u32(a0, a2[1], a2[1]);
if (!v3) {
v3 = sshpkt_put_u32(a0, a2[44], a2[44]);
if (!v3) {
v3 = sshpkt_put_u32(a0, a2[47], a2[47]);
if (!v3)
return;
}
}
}
}
v2 = a2[1];
v1 = a1;
v0 = "%s: channel %i: open";
v6 = sshfatal("channels.c", "open_preamble", 0x3c0, 0x0, 0x1, ssh_err(v3));
return;
}
|
int main (int argc, char **argv)
{
const struct passwd *pw;
struct passwd pwent;
const struct spwd *sp;
struct spwd spent;
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);
openlog("pwconv", (
0x01
),
(10<<3)
);
process_flags (argc, argv);
if (pw_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, pw_dbname ());
fail_exit (5);
}
pw_locked =
1
;
if (pw_open (
0100
|
02
) == 0) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"), Prog, pw_dbname ());
fail_exit (4);
}
if (spw_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, spw_dbname ());
fail_exit (5);
}
spw_locked =
1
;
if (spw_open (
0100
|
02
) == 0) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"), Prog, spw_dbname ());
fail_exit (3);
}
(void) spw_rewind ();
while ((sp = spw_next ()) !=
((void *)0)
) {
if (pw_locate (sp->sp_namp) !=
((void *)0)
) {
continue;
}
if (spw_remove (sp->sp_namp) == 0) {
fprintf (
stderr
,
gettext ("%s: cannot remove entry '%s' from %s\n"),
Prog, sp->sp_namp, spw_dbname ());
fail_exit (3);
}
(void) spw_rewind();
}
(void) pw_rewind ();
while ((pw = pw_next ()) !=
((void *)0)
) {
sp = spw_locate (pw->pw_name);
if (
((void *)0)
!= sp) {
if (strcmp (pw->pw_passwd, "x") == 0) {
continue;
}
spent = *sp;
} else {
memset (&spent, 0, sizeof spent);
spent.sp_namp = pw->pw_name;
spent.sp_min = getdef_num ("PASS_MIN_DAYS", -1);
spent.sp_max = getdef_num ("PASS_MAX_DAYS", -1);
spent.sp_warn = getdef_num ("PASS_WARN_AGE", -1);
spent.sp_inact = -1;
spent.sp_expire = -1;
spent.sp_flag = ((unsigned long int)-1);
}
spent.sp_pwdp = pw->pw_passwd;
spent.sp_lstchg = (long) gettime () / (24L*3600L);
if (0 == spent.sp_lstchg) {
spent.sp_lstchg = -1;
}
if (spw_update (&spent) == 0) {
fprintf (
stderr
,
gettext ("%s: failed to prepare the new %s entry '%s'\n"),
Prog, spw_dbname (), spent.sp_namp);
fail_exit (3);
}
pwent = *pw;
pwent.pw_passwd = "x";
if (pw_update (&pwent) == 0) {
fprintf (
stderr
,
gettext ("%s: failed to prepare the new %s entry '%s'\n"),
Prog, pw_dbname (), pwent.pw_name);
fail_exit (3);
}
}
if (spw_close () == 0) {
fprintf (
stderr
,
gettext ("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
3
, "failure while writing changes to %s", spw_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
fail_exit (3);
}
if (pw_close () == 0) {
fprintf (
stderr
,
gettext ("%s: failure while writing changes to %s\n"),
Prog, pw_dbname ());
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
3
, "failure while writing changes to %s", pw_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
fail_exit (3);
}
(*__errno_location ())
= 0;
if ((chmod ("/etc/passwd" "-", 0600) != 0) && (
(*__errno_location ())
!=
2
)) {
fprintf (
stderr
,
gettext ("%s: failed to change the mode of %s to 0600\n"),
Prog, "/etc/passwd" "-");
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
3
, "failed to change the mode of %s to 0600", "/etc/passwd" "-") ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
}
if (pw_unlock () == 0) {
fprintf (
stderr
, gettext ("%s: failed to unlock %s\n"), Prog, pw_dbname ());
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
3
, "failed to unlock %s", pw_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
}
if (spw_unlock () == 0) {
fprintf (
stderr
, gettext ("%s: failed to unlock %s\n"), Prog, spw_dbname ());
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
3
, "failed to unlock %s", spw_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
}
nscd_flush_cache ("passwd");
sssd_flush_cache (0x001);
return 0;
}
| undefined8 main(undefined4 param_1,undefined8 *param_2)
{
int iVar1;
undefined8 uVar2;
char *pcVar3;
long lVar4;
undefined8 *puVar5;
undefined8 *puVar6;
undefined8 uVar7;
undefined8 uVar8;
int *piVar9;
long in_FS_OFFSET;
char *local_108;
char *local_100;
char *local_f8;
char *local_f0;
char *local_e8;
undefined8 local_a8;
undefined *local_a0;
undefined8 local_98;
undefined8 local_90;
undefined8 local_88;
undefined8 local_80;
undefined8 local_78;
undefined8 local_70;
long local_68;
long local_60;
long local_58;
long local_50;
undefined8 local_48;
undefined8 local_40;
undefined8 local_38;
long local_30;
local_30 = *(long *)(in_FS_OFFSET + 0x28);
Prog = Basename(*param_2);
log_set_progname(Prog);
log_set_logfd(stderr);
setlocale(6,"");
bindtextdomain("shadow","/usr/share/locale");
textdomain("shadow");
process_root_flag(&DAT_00100e6a,param_1,param_2);
openlog("pwconv",1,0x50);
process_flags(param_1,param_2);
iVar1 = pw_lock();
if (iVar1 == 0) {
uVar2 = pw_dbname();
uVar8 = Prog;
pcVar3 = (char *)gettext("%s: cannot lock %s; try again later.\n");
fprintf(stderr,pcVar3,uVar8,uVar2);
fail_exit(5);
}
pw_locked = 1;
iVar1 = pw_open(0x42);
if (iVar1 == 0) {
uVar2 = pw_dbname();
uVar8 = Prog;
pcVar3 = (char *)gettext("%s: cannot open %s\n");
fprintf(stderr,pcVar3,uVar8,uVar2);
fail_exit(4);
}
iVar1 = spw_lock();
if (iVar1 == 0) {
uVar2 = spw_dbname();
uVar8 = Prog;
pcVar3 = (char *)gettext("%s: cannot lock %s; try again later.\n");
fprintf(stderr,pcVar3,uVar8,uVar2);
fail_exit(5);
}
spw_locked = 1;
iVar1 = spw_open(0x42);
if (iVar1 == 0) {
uVar2 = spw_dbname();
uVar8 = Prog;
pcVar3 = (char *)gettext("%s: cannot open %s\n");
fprintf(stderr,pcVar3,uVar8,uVar2);
fail_exit(3);
}
spw_rewind();
while (puVar5 = (undefined8 *)spw_next(), puVar5 != (undefined8 *)0x0) {
lVar4 = pw_locate(*puVar5);
if (lVar4 == 0) {
iVar1 = spw_remove(*puVar5);
if (iVar1 == 0) {
uVar7 = spw_dbname();
uVar2 = Prog;
uVar8 = *puVar5;
pcVar3 = (char *)gettext("%s: cannot remove entry \'%s\' from %s\n");
fprintf(stderr,pcVar3,uVar2,uVar8,uVar7);
fail_exit(3);
}
spw_rewind();
}
}
pw_rewind();
LAB_00100849:
puVar5 = (undefined8 *)pw_next();
if (puVar5 == (undefined8 *)0x0) {
iVar1 = spw_close();
if (iVar1 == 0) {
uVar2 = spw_dbname();
uVar8 = Prog;
pcVar3 = (char *)gettext("%s: failure while writing changes to %s\n");
fprintf(stderr,pcVar3,uVar8,uVar2);
pcVar3 = setlocale(6,(char *)0x0);
local_108 = (char *)0x0;
if (pcVar3 != (char *)0x0) {
local_108 = strdup(pcVar3);
}
if (local_108 != (char *)0x0) {
setlocale(6,"C");
}
uVar8 = spw_dbname();
syslog(3,"failure while writing changes to %s",uVar8);
if (local_108 != (char *)0x0) {
setlocale(6,local_108);
free(local_108);
}
fail_exit(3);
}
iVar1 = pw_close();
if (iVar1 == 0) {
uVar2 = pw_dbname();
uVar8 = Prog;
pcVar3 = (char *)gettext("%s: failure while writing changes to %s\n");
fprintf(stderr,pcVar3,uVar8,uVar2);
pcVar3 = setlocale(6,(char *)0x0);
local_100 = (char *)0x0;
if (pcVar3 != (char *)0x0) {
local_100 = strdup(pcVar3);
}
if (local_100 != (char *)0x0) {
setlocale(6,"C");
}
uVar8 = pw_dbname();
syslog(3,"failure while writing changes to %s",uVar8);
if (local_100 != (char *)0x0) {
setlocale(6,local_100);
free(local_100);
}
fail_exit(3);
}
piVar9 = __errno_location();
*piVar9 = 0;
iVar1 = chmod("/etc/passwd-",0x180);
if ((iVar1 != 0) && (piVar9 = __errno_location(), uVar8 = Prog, *piVar9 != 2)) {
pcVar3 = (char *)gettext("%s: failed to change the mode of %s to 0600\n");
fprintf(stderr,pcVar3,uVar8,"/etc/passwd-");
pcVar3 = setlocale(6,(char *)0x0);
local_f8 = (char *)0x0;
if (pcVar3 != (char *)0x0) {
local_f8 = strdup(pcVar3);
}
if (local_f8 != (char *)0x0) {
setlocale(6,"C");
}
syslog(3,"failed to change the mode of %s to 0600","/etc/passwd-");
if (local_f8 != (char *)0x0) {
setlocale(6,local_f8);
free(local_f8);
}
}
iVar1 = pw_unlock();
if (iVar1 == 0) {
uVar2 = pw_dbname();
uVar8 = Prog;
pcVar3 = (char *)gettext("%s: failed to unlock %s\n");
fprintf(stderr,pcVar3,uVar8,uVar2);
pcVar3 = setlocale(6,(char *)0x0);
local_f0 = (char *)0x0;
if (pcVar3 != (char *)0x0) {
local_f0 = strdup(pcVar3);
}
if (local_f0 != (char *)0x0) {
setlocale(6,"C");
}
uVar8 = pw_dbname();
syslog(3,"failed to unlock %s",uVar8);
if (local_f0 != (char *)0x0) {
setlocale(6,local_f0);
free(local_f0);
}
}
iVar1 = spw_unlock();
if (iVar1 == 0) {
uVar2 = spw_dbname();
uVar8 = Prog;
pcVar3 = (char *)gettext("%s: failed to unlock %s\n");
fprintf(stderr,pcVar3,uVar8,uVar2);
pcVar3 = setlocale(6,(char *)0x0);
local_e8 = (char *)0x0;
if (pcVar3 != (char *)0x0) {
local_e8 = strdup(pcVar3);
}
if (local_e8 != (char *)0x0) {
setlocale(6,"C");
}
uVar8 = spw_dbname();
syslog(3,"failed to unlock %s",uVar8);
if (local_e8 != (char *)0x0) {
setlocale(6,local_e8);
free(local_e8);
}
}
nscd_flush_cache("passwd");
sssd_flush_cache(1);
if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {
return 0;
}
__stack_chk_fail();
}
puVar6 = (undefined8 *)spw_locate(*puVar5);
if (puVar6 != (undefined8 *)0x0) goto code_r0x001005fd;
memset(&local_78,0,0x48);
local_78 = *puVar5;
iVar1 = getdef_num("PASS_MIN_DAYS",0xffffffff);
local_60 = (long)iVar1;
iVar1 = getdef_num("PASS_MAX_DAYS",0xffffffff);
local_58 = (long)iVar1;
iVar1 = getdef_num("PASS_WARN_AGE",0xffffffff);
local_50 = (long)iVar1;
local_48 = 0xffffffffffffffff;
local_40 = 0xffffffffffffffff;
local_38 = 0xffffffffffffffff;
goto LAB_001006f4;
code_r0x001005fd:
iVar1 = strcmp((char *)puVar5[1],"x");
if (iVar1 != 0) {
local_78 = *puVar6;
local_68 = puVar6[2];
local_60 = puVar6[3];
local_58 = puVar6[4];
local_50 = puVar6[5];
local_48 = puVar6[6];
local_40 = puVar6[7];
local_38 = puVar6[8];
LAB_001006f4:
local_70 = puVar5[1];
local_68 = gettime();
local_68 = local_68 / 0x15180;
if (local_68 == 0) {
local_68 = -1;
}
iVar1 = spw_update(&local_78);
uVar8 = local_78;
if (iVar1 == 0) {
uVar7 = spw_dbname();
uVar2 = Prog;
pcVar3 = (char *)gettext("%s: failed to prepare the new %s entry \'%s\'\n");
fprintf(stderr,pcVar3,uVar2,uVar7,uVar8);
fail_exit(3);
}
local_a8 = *puVar5;
local_98 = puVar5[2];
local_90 = puVar5[3];
local_80 = puVar5[5];
local_88 = puVar5[4];
local_a0 = &DAT_00100ede;
iVar1 = pw_update(&local_a8);
uVar8 = local_a8;
if (iVar1 == 0) {
uVar7 = pw_dbname();
uVar2 = Prog;
pcVar3 = (char *)gettext("%s: failed to prepare the new %s entry \'%s\'\n");
fprintf(stderr,pcVar3,uVar2,uVar7,uVar8);
fail_exit(3);
}
}
goto LAB_00100849;
}
|
unsigned long crc32(crc, buf, len)
unsigned long crc;
const unsigned char *buf;
uInt len;
{
return crc32_z(crc, buf, len);
}
| long long crc32(unsigned long long a0, unsigned int a1, unsigned long a2) {
return crc32_z(a0, a1, a2);
}
|
static struct strlist *fill_arglist(struct arglist *arglist,
union node **argpp)
{
struct strlist **lastp = arglist->lastp;
union node *argp;
while ((argp = *argpp)) {
expandarg(argp, arglist, 0x1 | 0x2);
*argpp = argp->narg.next;
if (*lastp)
break;
}
return *lastp;
}
| int fill_arglist(struct_0 *a0, unsigned long long *a1) {
unsigned long long *v0;
struct_0 *v1;
v0 = a0->field_8;
while (v1) {
v1 = *(a1);
expandarg(v1, a0, 0x3, a0);
*(a1) = v1->field_8;
if (*(v0))
return *(v0);
}
return *(v0);
}
|
static void check_block_bitmaps(e2fsck_t ctx)
{
ext2_filsys fs = ctx->fs;
blk64_t i;
unsigned int *free_array;
dgrp_t g, group = 0;
unsigned int blocks = 0;
blk64_t free_blocks = 0;
blk64_t first_free = ext2fs_blocks_count(fs->super);
unsigned int group_free = 0;
int actual, bitmap;
struct problem_context pctx;
problem_t problem, save_problem;
int fixit, had_problem;
errcode_t retval;
int redo_flag = 0;
char *actual_buf, *bitmap_buf;
actual_buf = (char *) e2fsck_allocate_memory(ctx, fs->blocksize,
"actual bitmap buffer");
bitmap_buf = (char *) e2fsck_allocate_memory(ctx, fs->blocksize,
"bitmap block buffer");
clear_problem_context(&pctx);
free_array = (unsigned int *) e2fsck_allocate_memory(ctx,
fs->group_desc_count * sizeof(unsigned int), "free block count array");
if (((((fs->super->s_first_data_block)) >> (fs)->cluster_ratio_bits) <
ext2fs_get_block_bitmap_start2(ctx->block_found_map)) ||
((((ext2fs_blocks_count(fs->super)-1)) >> (fs)->cluster_ratio_bits) >
ext2fs_get_block_bitmap_end2(ctx->block_found_map))) {
pctx.num = 1;
pctx.blk = (((fs->super->s_first_data_block)) >> (fs)->cluster_ratio_bits);
pctx.blk2 = (((ext2fs_blocks_count(fs->super) - 1)) >> (fs)->cluster_ratio_bits);
pctx.ino = ext2fs_get_block_bitmap_start2(ctx->block_found_map);
pctx.ino2 = ext2fs_get_block_bitmap_end2(ctx->block_found_map);
fix_problem(ctx, 0x050010, &pctx);
ctx->flags |= 0x0001;
goto errout;
}
if (((((fs->super->s_first_data_block)) >> (fs)->cluster_ratio_bits) <
ext2fs_get_block_bitmap_start2(fs->block_map)) ||
((((ext2fs_blocks_count(fs->super)-1)) >> (fs)->cluster_ratio_bits) >
ext2fs_get_block_bitmap_end2(fs->block_map))) {
pctx.num = 2;
pctx.blk = (((fs->super->s_first_data_block)) >> (fs)->cluster_ratio_bits);
pctx.blk2 = (((ext2fs_blocks_count(fs->super) - 1)) >> (fs)->cluster_ratio_bits);
pctx.ino = ext2fs_get_block_bitmap_start2(fs->block_map);
pctx.ino2 = ext2fs_get_block_bitmap_end2(fs->block_map);
fix_problem(ctx, 0x050010, &pctx);
ctx->flags |= 0x0001;
goto errout;
}
redo_counts:
had_problem = 0;
save_problem = 0;
pctx.blk = pctx.blk2 = ((blk64_t) -1);
for (i = (((fs->super->s_first_data_block)) >> (fs)->cluster_ratio_bits);
i < ext2fs_blocks_count(fs->super);
i += (1 << (fs)->cluster_ratio_bits)) {
int first_block_in_bg = ((((i)) >> (fs)->cluster_ratio_bits) -
(((fs->super->s_first_data_block)) >> (fs)->cluster_ratio_bits)) %
fs->super->s_clusters_per_group == 0;
int n, nbytes = fs->super->s_clusters_per_group / 8;
actual = ext2fs_fast_test_block_bitmap2(ctx->block_found_map, i);
if (!first_block_in_bg ||
(group == fs->group_desc_count - 1) ||
(ctx->options & 0x2000))
goto no_optimize;
retval = ext2fs_get_block_bitmap_range2(ctx->block_found_map,
(((i)) >> (fs)->cluster_ratio_bits), fs->super->s_clusters_per_group,
actual_buf);
if (retval)
goto no_optimize;
retval = ext2fs_get_block_bitmap_range2(fs->block_map,
(((i)) >> (fs)->cluster_ratio_bits), fs->super->s_clusters_per_group,
bitmap_buf);
if (retval)
goto no_optimize;
if (memcmp(actual_buf, bitmap_buf, nbytes) != 0)
goto no_optimize;
n = ext2fs_bitcount(actual_buf, nbytes);
group_free = fs->super->s_clusters_per_group - n;
free_blocks += group_free;
i += ((fs->super->s_clusters_per_group - 1) << (fs)->cluster_ratio_bits);
goto next_group;
no_optimize:
if (redo_flag)
bitmap = actual;
else
bitmap = ext2fs_fast_test_block_bitmap2(fs->block_map, i);
if (!actual == !bitmap)
goto do_counts;
if (!actual && bitmap) {
problem = 0x050004;
} else {
problem = 0x050005;
if (ext2fs_bg_flags_test(fs, group,
0x0002)) {
struct problem_context pctx2;
pctx2.blk = i;
pctx2.group = group;
if (fix_problem(ctx, 0x050018,
&pctx2))
ext2fs_bg_flags_clear(fs, group,
0x0002);
}
}
if (pctx.blk == ((blk64_t) -1)) {
pctx.blk = pctx.blk2 = i;
save_problem = problem;
} else {
if ((problem == save_problem) &&
(pctx.blk2 == i - (1 << (fs)->cluster_ratio_bits)))
pctx.blk2 += (1 << (fs)->cluster_ratio_bits);
else {
print_bitmap_problem(ctx, save_problem, &pctx);
pctx.blk = pctx.blk2 = i;
save_problem = problem;
}
}
ctx->flags |= 0x0040;
had_problem++;
ctx->options &= ~0x2000;
do_counts:
if (!bitmap) {
group_free++;
free_blocks++;
if (first_free > i)
first_free = i;
} else if (i > first_free) {
e2fsck_discard_blocks(ctx, first_free,
(i - first_free));
first_free = ext2fs_blocks_count(fs->super);
}
blocks ++;
if ((blocks == fs->super->s_clusters_per_group) ||
(((i) >> (fs)->cluster_ratio_bits) ==
((ext2fs_blocks_count(fs->super)-1) >> (fs)->cluster_ratio_bits))) {
if (!bitmap && i >= first_free)
e2fsck_discard_blocks(ctx, first_free,
(i - first_free) + 1);
next_group:
first_free = ext2fs_blocks_count(fs->super);
free_array[group] = group_free;
group ++;
blocks = 0;
group_free = 0;
if (ctx->progress)
if ((ctx->progress)(ctx, 5, group,
fs->group_desc_count*2))
goto errout;
}
}
if (pctx.blk != ((blk64_t) -1))
print_bitmap_problem(ctx, save_problem, &pctx);
if (had_problem)
fixit = end_problem_latch(ctx, 0x0040);
else
fixit = -1;
ctx->flags &= ~0x0040;
if (fixit == 1) {
ext2fs_free_block_bitmap(fs->block_map);
retval = ext2fs_copy_bitmap(ctx->block_found_map,
&fs->block_map);
if (retval) {
clear_problem_context(&pctx);
fix_problem(ctx, 0x050013, &pctx);
ctx->flags |= 0x0001;
goto errout;
}
ext2fs_set_bitmap_padding(fs->block_map);
ext2fs_mark_bb_dirty(fs);
blocks = 0; free_blocks = 0; group_free = 0; group = 0;
memset(free_array, 0, fs->group_desc_count * sizeof(int));
redo_flag++;
goto redo_counts;
} else if (fixit == 0)
ext2fs_unmark_valid(fs);
for (g = 0; g < fs->group_desc_count; g++) {
if (free_array[g] != ext2fs_bg_free_blocks_count(fs, g)) {
pctx.group = g;
pctx.blk = ext2fs_bg_free_blocks_count(fs, g);
pctx.blk2 = free_array[g];
if (fix_problem(ctx, 0x05000E,
&pctx)) {
ext2fs_bg_free_blocks_count_set(fs, g, free_array[g]);
ext2fs_mark_super_dirty(fs);
} else
ext2fs_unmark_valid(fs);
}
}
free_blocks = ((free_blocks) << (fs)->cluster_ratio_bits);
if (free_blocks != ext2fs_free_blocks_count(fs->super)) {
pctx.group = 0;
pctx.blk = ext2fs_free_blocks_count(fs->super);
pctx.blk2 = free_blocks;
if (fix_problem(ctx, 0x05000F, &pctx)) {
ext2fs_free_blocks_count_set(fs->super, free_blocks);
ext2fs_mark_super_dirty(fs);
}
}
errout:
ext2fs_free_mem(&free_array);
ext2fs_free_mem(&actual_buf);
ext2fs_free_mem(&bitmap_buf);
}
| unsigned long check_block_bitmaps(long a1)
{
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned long v4;
int v5;
unsigned long v6;
int v7;
unsigned int j;
unsigned int v10;
int v11;
unsigned int v12;
int v13;
int v14;
unsigned int v15;
int v16;
int v17;
int v18;
_BOOL4 v19;
unsigned int v20;
int v21;
void *s;
void *s1;
void *s2;
unsigned long i;
unsigned long v26;
unsigned long v27;
long v28;
long block_bitmap_range2;
char v30[8];
int block_bitmap_start2;
int block_bitmap_end2;
unsigned long v33;
unsigned long v34;
unsigned int v35;
long v36;
char v37[40];
unsigned long v38;
unsigned int v39;
unsigned long v40;
v40 = __readfsqword(0x28u);
v28 = *(_QWORD *)a1;
v10 = 0;
v11 = 0;
v26 = 0LL;
v27 = ext2fs_blocks_count(*(_QWORD *)(v28 + 32));
v12 = 0;
v18 = 0;
s1 = (void *)e2fsck_allocate_memory(a1, *(unsigned int *)(v28 + 40), "actual bitmap buffer");
s2 = (void *)e2fsck_allocate_memory(a1, *(unsigned int *)(v28 + 40), "bitmap block buffer");
clear_problem_context(v30);
s = (void *)e2fsck_allocate_memory(a1, 4LL * *(unsigned int *)(v28 + 48), "free block count array");
v1 = (unsigned int)(*(_DWORD *)(*(_QWORD *)(v28 + 32) + 20LL) >> *(_DWORD *)(v28 + 192));
if ( v1 < ext2fs_get_block_bitmap_start2(*(_QWORD *)(a1 + 416))
|| (v2 = (unsigned long)(ext2fs_blocks_count(*(_QWORD *)(v28 + 32)) - 1) >> *(_DWORD *)(v28 + 192),
v2 > ext2fs_get_block_bitmap_end2(*(_QWORD *)(a1 + 416))) )
{
v36 = 1LL;
v33 = (unsigned int)(*(_DWORD *)(*(_QWORD *)(v28 + 32) + 20LL) >> *(_DWORD *)(v28 + 192));
v34 = (unsigned long)(ext2fs_blocks_count(*(_QWORD *)(v28 + 32)) - 1) >> *(_DWORD *)(v28 + 192);
block_bitmap_start2 = ext2fs_get_block_bitmap_start2(*(_QWORD *)(a1 + 416));
block_bitmap_end2 = ext2fs_get_block_bitmap_end2(*(_QWORD *)(a1 + 416));
fix_problem(a1, 327696LL, v30);
*(_DWORD *)(a1 + 72) |= 1u;
goto LABEL_67;
}
v3 = (unsigned int)(*(_DWORD *)(*(_QWORD *)(v28 + 32) + 20LL) >> *(_DWORD *)(v28 + 192));
if ( v3 < ext2fs_get_block_bitmap_start2(*(_QWORD *)(v28 + 88))
|| (v4 = (unsigned long)(ext2fs_blocks_count(*(_QWORD *)(v28 + 32)) - 1) >> *(_DWORD *)(v28 + 192),
v4 > ext2fs_get_block_bitmap_end2(*(_QWORD *)(v28 + 88))) )
{
v36 = 2LL;
v33 = (unsigned int)(*(_DWORD *)(*(_QWORD *)(v28 + 32) + 20LL) >> *(_DWORD *)(v28 + 192));
v34 = (unsigned long)(ext2fs_blocks_count(*(_QWORD *)(v28 + 32)) - 1) >> *(_DWORD *)(v28 + 192);
block_bitmap_start2 = ext2fs_get_block_bitmap_start2(*(_QWORD *)(v28 + 88));
block_bitmap_end2 = ext2fs_get_block_bitmap_end2(*(_QWORD *)(v28 + 88));
fix_problem(a1, 327696LL, v30);
*(_DWORD *)(a1 + 72) |= 1u;
goto LABEL_67;
}
while ( 2 )
{
v17 = 0;
v15 = 0;
v34 = -1LL;
v33 = -1LL;
for ( i = (unsigned int)(*(_DWORD *)(*(_QWORD *)(v28 + 32) + 20LL) >> *(_DWORD *)(v28 + 192));
i < ext2fs_blocks_count(*(_QWORD *)(v28 + 32));
i += 1 << *(_DWORD *)(v28 + 192) )
{
v19 = ((i >> *(_DWORD *)(v28 + 192))
- (unsigned int)(*(_DWORD *)(*(_QWORD *)(v28 + 32) + 20LL) >> *(_DWORD *)(v28 + 192)))
% *(unsigned int *)(*(_QWORD *)(v28 + 32) + 36LL) == 0;
v20 = *(_DWORD *)(*(_QWORD *)(v28 + 32) + 36LL) >> 3;
v21 = ext2fs_fast_test_block_bitmap2(*(_QWORD *)(a1 + 416), i);
if ( !v19
|| v10 == *(_DWORD *)(v28 + 48) - 1
|| (*(_DWORD *)(a1 + 76) & 0x2000) != 0
|| (block_bitmap_range2 = ext2fs_get_block_bitmap_range2(
*(_QWORD *)(a1 + 416),
i >> *(_DWORD *)(v28 + 192),
*(unsigned int *)(*(_QWORD *)(v28 + 32) + 36LL),
s1)) != 0
|| (block_bitmap_range2 = ext2fs_get_block_bitmap_range2(
*(_QWORD *)(v28 + 88),
i >> *(_DWORD *)(v28 + 192),
*(unsigned int *)(*(_QWORD *)(v28 + 32) + 36LL),
s2)) != 0
|| memcmp(s1, s2, (int)v20) )
{
if ( v18 )
v13 = v21;
else
v13 = ext2fs_fast_test_block_bitmap2(*(_QWORD *)(v28 + 88), i);
if ( (v21 != 0) == (v13 == 0) )
{
if ( v21 || !v13 )
{
v14 = 327685;
if ( (unsigned int)ext2fs_bg_flags_test(v28, v10, 2LL) )
{
v38 = i;
v39 = v10;
if ( (unsigned int)fix_problem(a1, 327704LL, v37) )
ext2fs_bg_flags_clear(v28, v10, 2LL);
}
}
else
{
v14 = 327684;
}
if ( v33 == -1LL )
{
v34 = i;
v33 = i;
v15 = v14;
}
else if ( v14 == v15 && v34 == i - (1 << *(_DWORD *)(v28 + 192)) )
{
v34 += 1 << *(_DWORD *)(v28 + 192);
}
else
{
print_bitmap_problem(a1, v15, (long)v30);
v34 = i;
v33 = i;
v15 = v14;
}
*(_DWORD *)(a1 + 72) |= 0x40u;
++v17;
v5 = *(_DWORD *)(a1 + 76);
BYTE1(v5) &= ~0x20u;
*(_DWORD *)(a1 + 76) = v5;
}
if ( v13 )
{
if ( i > v27 )
{
e2fsck_discard_blocks((long *)a1, v27, i - v27);
v27 = ext2fs_blocks_count(*(_QWORD *)(v28 + 32));
}
}
else
{
++v12;
++v26;
if ( v27 > i )
v27 = i;
}
if ( ++v11 != *(_DWORD *)(*(_QWORD *)(v28 + 32) + 36LL) )
{
v6 = i >> *(_DWORD *)(v28 + 192);
if ( v6 != (unsigned long)(ext2fs_blocks_count(*(_QWORD *)(v28 + 32)) - 1) >> *(_DWORD *)(v28 + 192) )
continue;
}
if ( !v13 && i >= v27 )
e2fsck_discard_blocks((long *)a1, v27, i - v27 + 1);
}
else
{
v12 = *(_DWORD *)(*(_QWORD *)(v28 + 32) + 36LL) - ext2fs_bitcount(s1, v20);
v26 += v12;
i += (unsigned int)((*(_DWORD *)(*(_QWORD *)(v28 + 32) + 36LL) - 1) << *(_DWORD *)(v28 + 192));
}
v27 = ext2fs_blocks_count(*(_QWORD *)(v28 + 32));
*((_DWORD *)s + v10++) = v12;
v11 = 0;
v12 = 0;
if ( *(_QWORD *)(a1 + 352)
&& (*(unsigned int ( **)(long, long, _QWORD, _QWORD))(a1 + 352))(
a1,
5LL,
v10,
(unsigned int)(2 * *(_DWORD *)(v28 + 48))) )
{
goto LABEL_67;
}
}
if ( v33 != -1LL )
print_bitmap_problem(a1, v15, (long)v30);
if ( v17 )
v16 = end_problem_latch(a1, 64LL);
else
v16 = -1;
*(_DWORD *)(a1 + 72) &= ~0x40u;
if ( v16 == 1 )
{
ext2fs_free_block_bitmap(*(_QWORD *)(v28 + 88));
block_bitmap_range2 = ext2fs_copy_bitmap(*(_QWORD *)(a1 + 416), v28 + 88);
if ( !block_bitmap_range2 )
{
ext2fs_set_bitmap_padding(*(_QWORD *)(v28 + 88));
ext2fs_mark_bb_dirty(v28);
v11 = 0;
v26 = 0LL;
v12 = 0;
v10 = 0;
memset(s, 0, 4LL * *(unsigned int *)(v28 + 48));
++v18;
continue;
}
clear_problem_context(v30);
fix_problem(a1, 327699LL, v30);
*(_DWORD *)(a1 + 72) |= 1u;
}
else
{
if ( !v16 )
ext2fs_unmark_valid(v28);
for ( j = 0; j < *(_DWORD *)(v28 + 48); ++j )
{
v7 = *((_DWORD *)s + j);
if ( v7 != (unsigned int)ext2fs_bg_free_blocks_count(v28, j) )
{
v35 = j;
v33 = (unsigned int)ext2fs_bg_free_blocks_count(v28, j);
v34 = *((unsigned int *)s + j);
if ( (unsigned int)fix_problem(a1, 327694LL, v30) )
{
ext2fs_bg_free_blocks_count_set(v28, j, *((unsigned int *)s + j));
ext2fs_mark_super_dirty(v28);
}
else
{
ext2fs_unmark_valid(v28);
}
}
}
v26 <<= *(_DWORD *)(v28 + 192);
if ( v26 != ext2fs_free_blocks_count(*(_QWORD *)(v28 + 32)) )
{
v35 = 0;
v33 = ext2fs_free_blocks_count(*(_QWORD *)(v28 + 32));
v34 = v26;
if ( (unsigned int)fix_problem(a1, 327695LL, v30) )
{
ext2fs_free_blocks_count_set(*(_QWORD *)(v28 + 32), v26);
ext2fs_mark_super_dirty(v28);
}
}
}
break;
}
LABEL_67:
ext2fs_free_mem(&s);
ext2fs_free_mem(&s1);
ext2fs_free_mem(&s2);
return __readfsqword(0x28u) ^ v40;
}
|
static void
unexpand (void)
{
FILE *fp = next_file (
((void *)0)
);
char *pending_blank;
if (!fp)
return;
pending_blank = xmalloc (max_column_width);
while (
1
)
{
int c;
_Bool
convert =
1
;
uintmax_t column = 0;
uintmax_t next_tab_column = 0;
size_t tab_index = 0;
_Bool
one_blank_before_tab_stop =
0
;
_Bool
prev_blank =
1
;
size_t pending = 0;
do
{
while ((c = getc_unlocked (fp)) < 0 && (fp = next_file (fp)))
continue;
if (convert)
{
_Bool
blank = !!
((*__ctype_b_loc ())[(int) ((
c
))] & (unsigned short int) _ISblank)
;
if (blank)
{
_Bool
last_tab;
next_tab_column = get_next_tab_column (column, &tab_index,
&last_tab);
if (last_tab)
convert =
0
;
if (convert)
{
if (next_tab_column < column)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"input line is too long\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("input line is too long")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("input line is too long")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
if (c == '\t')
{
column = next_tab_column;
if (pending)
pending_blank[0] = '\t';
}
else
{
column++;
if (! (prev_blank && column == next_tab_column))
{
if (column == next_tab_column)
one_blank_before_tab_stop =
1
;
pending_blank[pending++] = c;
prev_blank =
1
;
continue;
}
pending_blank[0] = c = '\t';
}
pending = one_blank_before_tab_stop;
}
}
else if (c == '\b')
{
column -= !!column;
next_tab_column = column;
tab_index -= !!tab_index;
}
else
{
column++;
if (!column)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"input line is too long\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("input line is too long")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("input line is too long")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
}
if (pending)
{
if (pending > 1 && one_blank_before_tab_stop)
pending_blank[0] = '\t';
if (fwrite_unlocked (pending_blank,1,pending,
stdout
) != pending)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"write error\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, gettext ("write error")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, gettext ("write error")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
pending = 0;
one_blank_before_tab_stop =
0
;
}
prev_blank = blank;
convert &= convert_entire_line || blank;
}
if (c < 0)
{
free (pending_blank);
return;
}
if (putchar_unlocked (c) < 0)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"write error\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, gettext ("write error")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, gettext ("write error")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
}
while (c != '\n');
}
}
| void unexpand() {
char v0;
int tmp_12;
char v1;
char v2;
char v3;
char v4;
unsigned int v5;
void* v6;
void* v7;
unsigned long v8;
void* v9;
void* v10;
unsigned long v11;
char v12;
unsigned int v14;
unsigned long long *v15;
unsigned long long v16;
v7 = next_file(0x0);
if (!v7) {
v16 = *(&v12) ^ v15[5];
return;
}
v10 = xmalloc(max_column_width);
while (true) {
v1 = 1;
v8 = 0;
v11 = 0;
v6 = 0;
v2 = 0;
v3 = 1;
v9 = 0;
do {
do { } while ((v5 = getc_unlocked(v7), !(v5 >= 0) && !((v7 = next_file(v7), !v7))));
if (v1) {
v14 = *((*(__ctype_b_loc()) + v5 * 2));
v4 = (v14 & 1);
if (v4) {
v11 = get_next_tab_column(v8, &v6, &v0, &v6);
if (v0)
v1 = 0;
if (v1) {
if (v11 < v8)
error(0x1, 0x0, gettext("input line is too long"));
if (v5 == 9) {
v8 = v11;
if (v9)
*(v10) = 9;
} else {
v8 += 1;
if (!((v3 ^ 1)) && !(v8 != v11)) {
v5 = 9;
*(v10) = 9;
} else {
if (v8 == v11)
v2 = 1;
tmp_12 = v9;
v9 += 1;
*(tmp_12 + v10) = v5;
v3 = 1;
continue;
}
}
v9 = v2;
}
} else if (v5 == 8) {
v8 -= v8;
v11 = v8;
v6 -= v6;
} else {
v8 += 1;
if (!v8)
error(0x1, 0x0, gettext("input line is too long"));
}
if (v9) {
if (v9 > 1 && v2)
*(v10) = 9;
if (v9 != fwrite_unlocked(v10, 0x1, v9, stdout))
error(0x1, *(__errno_location()), gettext("write error"));
v9 = 0;
v2 = 0;
}
v3 = v4;
if (convert_entire_line || v4)
v14 = 1;
else
v14 = 0;
v14 &= v1;
v1 = v14;
}
if (v5 < 0) {
free(v10);
v16 = *(&v12) ^ v15[5];
return;
} else if (putchar_unlocked(v5) < 0) {
error(0x1, *(__errno_location()), gettext("write error"));
}
} while (v5 != 10);
}
}
|
static inline void
emit_ancillary_info (char const *program)
{
struct infomap { char const *program; char const *node; } const infomap[] = {
{ "[", "test invocation" },
{ "coreutils", "Multi-call invocation" },
{ "sha224sum", "sha2 utilities" },
{ "sha256sum", "sha2 utilities" },
{ "sha384sum", "sha2 utilities" },
{ "sha512sum", "sha2 utilities" },
{
((void *)0)
,
((void *)0)
}
};
char const *node = program;
struct infomap const *map_prog = infomap;
while (map_prog->program && ! (strcmp (program, map_prog->program) == 0))
map_prog++;
if (map_prog->node)
node = map_prog->node;
printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https:
char const *lc_messages = setlocale (
5
,
((void *)0)
);
if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1))
{
fputs_unlocked (gettext ("Report any translation bugs to " "<https:
stdout
)
;
}
char const *url_program = (strcmp (program, "[") == 0) ? "test" : program;
printf (gettext ("Full documentation <%s%s>\n"),
"https:
printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"),
node, node == program ? " invocation" : "");
}
| unsigned long emit_ancillary_info(const char *a1)
{
char *v1;
FILE *v2;
char *v3;
const char *v4;
char *v5;
const char *v6;
char *v7;
const char *v9;
long *i;
const char *v11;
const char *v12;
long v13[15];
unsigned long v14;
v14 = __readfsqword(0x28u);
v13[0] = (long)"[";
v13[1] = (long)"test invocation";
v13[2] = (long)"coreutils";
v13[3] = (long)"Multi-call invocation";
v13[4] = (long)"sha224sum";
v13[5] = (long)"sha2 utilities";
v13[6] = (long)"sha256sum";
v13[7] = (long)"sha2 utilities";
v13[8] = (long)"sha384sum";
v13[9] = (long)"sha2 utilities";
v13[10] = (long)"sha512sum";
v13[11] = (long)"sha2 utilities";
v13[12] = 0LL;
v13[13] = 0LL;
v9 = a1;
for ( i = v13; *i && strcmp(a1, (const char *)*i); i += 2 )
;
if ( i[1] )
v9 = (const char *)i[1];
v1 = gettext("\n%s online help: <%s>\n");
printf(v1, "GNU coreutils", "https:
v11 = setlocale(5, 0LL);
if ( v11 && strncmp(v11, "en_", 3uLL) )
{
v2 = stdout;
v3 = gettext("Report any translation bugs to <https:
fputs_unlocked(v3, v2);
}
if ( !strcmp(a1, "[") )
v4 = "test";
else
v4 = a1;
v12 = v4;
v5 = gettext("Full documentation <%s%s>\n");
printf(v5, "https:
if ( v9 == a1 )
v6 = " invocation";
else
v6 = locale;
v7 = gettext("or available locally via: info '(coreutils) %s%s'\n");
printf(v7, v9, v6);
return __readfsqword(0x28u) ^ v14;
}
|
static char *
adjust_resolution (char const *format)
{
char *copy =
((void *)0)
;
for (char const *f = format; *f; f++)
if (f[0] == '%')
{
if (f[1] == '-' && f[2] == 'N')
{
if (!copy)
copy = xstrdup (format);
copy[f + 1 - format] = '0' + res_width (gettime_res ());
f += 2;
}
else
f += f[1] == '%';
}
return copy;
}
| long adjust_resolution(char *param_1)
{
char cVar1;
undefined8 uVar2;
long local_18;
char *local_10;
local_18 = 0;
for (local_10 = param_1; *local_10 != '\0'; local_10 = local_10 + 1) {
if (*local_10 == '%') {
if ((local_10[1] == '-') && (local_10[2] == 'N')) {
if (local_18 == 0) {
local_18 = xstrdup(param_1);
}
uVar2 = gettime_res();
cVar1 = res_width(uVar2);
local_10[local_18 + (1 - (long)param_1)] = cVar1 + '0';
local_10 = local_10 + 2;
}
else {
local_10 = local_10 + (local_10[1] == '%');
}
}
}
return local_18;
}
|
static void
merge_tree_destroy (size_t nthreads, struct merge_node *merge_tree)
{
size_t n_nodes = nthreads * 2;
struct merge_node *node = merge_tree;
while (n_nodes--)
{
pthread_mutex_destroy (&node->lock);
node++;
}
free (merge_tree);
}
| void merge_tree_destroy(unsigned long long a0, void* a1) {
unsigned long long v0;
unsigned long v1;
unsigned long long v3;
unsigned long long v4;
v0 = a0 * 2;
v1 = a1;
while (true) {
v3 = v0;
v0 -= 1;
if (!v3)
break;
pthread_mutex_destroy(v1 + 88);
v1 -= -128;
}
v4 = free(a1);
return;
}
|
const char *
ssh_gai_strerror(int gaierr)
{
if (gaierr ==
-11
&&
(*__errno_location ())
!= 0)
return strerror(
(*__errno_location ())
);
return gai_strerror(gaierr);
}
| long long ssh_gai_strerror(unsigned long a0) {
unsigned long long v2;
if (a0 == -11 && *(__errno_location())) {
v2 = strerror(*(__errno_location()));
return v2;
}
v2 = gai_strerror(a0);
return v2;
}
|
struct var *setvareq(char *s, int flags)
{
struct var *vp, **vpp;
vpp = hashvar(s);
flags |= (0x01 & (((unsigned) (1 - optlist[12])) - 1));
vpp = findvar(vpp, s);
vp = *vpp;
if (vp) {
if (vp->flags & 0x02) {
const char *n;
if (flags & 0x100)
free(s);
n = vp->text;
sh_error("%.*s: is read only", strchrnul(n, '=') - n,
n);
}
if (flags & 0x80)
goto out;
if (vp->func && (flags & 0x40) == 0)
(*vp->func)(strchrnul(s, '=') + 1);
if ((vp->flags & (0x08|0x10)) == 0)
free((pointer)(vp->text));
if (((flags & (0x01|0x02|0x04|0x20)) |
(vp->flags & 0x04)) == 0x20) {
*vpp = vp->next;
free((pointer)(vp));
out_free:
if ((flags & (0x08|0x10|0x100)) == 0x100)
free((pointer)(s));
goto out;
}
flags |= vp->flags & ~(0x08|0x10|0x100|0x20);
} else {
if (flags & 0x80)
goto out;
if ((flags & (0x01|0x02|0x04|0x20)) == 0x20)
goto out_free;
vp = ckmalloc(sizeof (*vp));
vp->next = *vpp;
vp->func =
((void *)0)
;
*vpp = vp;
}
if (!(flags & (0x08|0x10|0x100)))
s = savestr(s);
vp->text = s;
vp->flags = flags;
out:
return vp;
}
| int setvareq(void* a0, unsigned long a1) {
unsigned int v0;
void* v1;
struct_0 *v2;
unsigned long long *v3;
char *v4;
v1 = a0;
v0 = a1;
v3 = hashvar(v1);
v0 |= -(g_50006c) & 1;
v3 = findvar(v3, v1);
v2 = *(v3);
if (!v2) {
if ((v0 & 128))
return v2;
if ((v0 & 39) != 32) {
v2 = ckmalloc(0x20);
v2->field_0 = *(v3);
v2->field_18 = 0;
*(v3) = v2;
LABEL_40056d:
if (!(v0 & 280))
v1 = savestr(v1);
v2->field_10 = v1;
v2->field_8 = v0;
return v2;
}
} else {
if ((v2->field_8 & 2)) {
if ((v0 & 0x100))
free(v1);
v4 = v2->field_10;
sh_error("%.*s: is read only", strchrnul(v4, 0x3d) - v4, v4);
}
if ((v0 & 128))
return v2;
if (v2->field_18 && !(v0 & 64))
*(((stack_base)[48] + 24))(strchrnul(v1, 0x3d) + 1);
if (!(v2->field_8 & 24))
free(v2->field_10);
if ((v2->field_8 & 4 | v0 & 39) != 32) {
v0 |= v2->field_8 & -313;
goto LABEL_40056d;
} else {
*(v3) = v2->field_0;
free(v2);
}
}
if ((v0 & 280) == 0x100) {
free(v1);
return v2;
}
return v2;
}
|
int ipstats_print(struct nlmsghdr *n, void *arg)
{
struct ipstats_stat_enabled_one one = {
.desc = &ipstats_stat_desc_offload_hw_s_info,
};
struct ipstats_stat_enabled enabled = {
.enabled = &one,
.nenabled = 1,
};
FILE *fp = arg;
int rc;
rc = ipstats_process_ifsm(n, &enabled);
if (rc)
return rc;
fflush(fp);
return 0;
}
| long long ipstats_print(unsigned int *a0, void* a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned long v1;
unsigned long long v2;
unsigned long long v3;
void* v4;
void* v5;
void* v6;
void* v8;
v3 = 0;
v4 = 0;
v5 = 0;
v6 = 0;
v3 = &ipstats_stat_desc_offload_hw_s_info;
v1 = &v3;
v2 = 1;
v0 = ipstats_process_ifsm(a0, &v1, &v1, a3, a4, a5);
if (v0) {
v8 = v0;
} else {
fflush(a1);
v8 = 0;
}
return v8;
}
|
static int
worst_cost (const struct predicate *p)
{
if (p)
{
unsigned int cost_r, cost_l, worst;
cost_l = worst_cost (p->pred_left);
cost_r = worst_cost (p->pred_right);
worst = (cost_l > cost_r) ? cost_l : cost_r;
if (worst < p->p_cost)
worst = p->p_cost;
return worst;
}
else
{
return 0;
}
}
| int worst_cost(struct_0 *a0) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v4;
unsigned int v5;
if (!a0) {
v4 = 0;
} else {
v1 = worst_cost(a0->field_110);
v2 = worst_cost(a0->field_118);
v5 = v1;
if (v1 <= v2)
v5 = v2;
v0 = v5;
if (v0 < a0->field_20)
v0 = a0->field_20;
v4 = v0;
}
return v4;
}
|
static void
minus_o(char *name, int val)
{
int i;
if (name ==
((void *)0)
) {
if (val) {
outstr(("Current option settings\n"), out1);
for (i = 0; i < 17; i++)
out1fmt("%-16s%s\n", optnames[i],
optlist[i] ? "on" : "off");
} else {
for (i = 0; i < 17; i++)
out1fmt("set %s %s\n",
optlist[i] ? "-o" : "+o",
optnames[i]);
}
} else {
for (i = 0; i < 17; i++)
if ((strcmp(name, optnames[i]) == 0)) {
optlist[i] = val;
return;
}
sh_error("Illegal option -o %s", name);
}
}
| void minus_o(char *param_1,int param_2)
{
int iVar1;
undefined *puVar2;
int local_c;
if (param_1 == (char *)0x0) {
if (param_2 == 0) {
for (local_c = 0; local_c < 0x11; local_c = local_c + 1) {
if (optlist[local_c] == '\0') {
puVar2 = &DAT_00100fa5;
}
else {
puVar2 = &DAT_00100fa2;
}
out1fmt("set %s %s\n",puVar2,*(undefined8 *)(optnames + (long)local_c * 8));
}
}
else {
outstr("Current option settings\n",out1);
for (local_c = 0; local_c < 0x11; local_c = local_c + 1) {
if (optlist[local_c] == '\0') {
puVar2 = &DAT_00100f95;
}
else {
puVar2 = &DAT_00100f92;
}
out1fmt("%-16s%s\n",*(undefined8 *)(optnames + (long)local_c * 8),puVar2);
}
}
}
else {
for (local_c = 0; local_c < 0x11; local_c = local_c + 1) {
iVar1 = strcmp(param_1,*(char **)(optnames + (long)local_c * 8));
if (iVar1 == 0) {
optlist[local_c] = (char)param_2;
return;
}
}
sh_error("Illegal option -o %s",param_1);
}
return;
}
|
static void show_defaults (void)
{
printf ("GROUP=%u\n", (unsigned int) def_group);
printf ("HOME=%s\n", def_home);
printf ("INACTIVE=%ld\n", def_inactive);
printf ("EXPIRE=%s\n", def_expire);
printf ("SHELL=%s\n", def_shell);
printf ("SKEL=%s\n", def_template);
printf ("CREATE_MAIL_SPOOL=%s\n", def_create_mail_spool);
printf ("LOG_INIT=%s\n", def_log_init);
}
| void show_defaults() {
unsigned long long v1;
printf("GROUP=%u\n", def_group);
printf("HOME=%s\n", def_home);
printf("INACTIVE=%ld\n", def_inactive);
printf("EXPIRE=%s\n", def_expire);
printf("SHELL=%s\n", def_shell);
printf("SKEL=%s\n", def_template);
printf("CREATE_MAIL_SPOOL=%s\n", def_create_mail_spool);
v1 = printf("LOG_INIT=%s\n", def_log_init);
return;
}
|
void
set_transform_expr (const char *expr)
{
while (*expr)
expr = parse_transform_expr (expr);
}
| long long set_transform_expr(char *a0) {
char *v0;
for (v0 = a0; *(v0); v0 = parse_transform_expr(v0));
return *(v0);
}
|
int
read_config_file(const char *filename, struct passwd *pw, const char *host,
const char *original_host, Options *options, int flags,
int *want_final_pass)
{
int active = 1;
return read_config_file_depth(filename, pw, host, original_host,
options, flags, &active, want_final_pass, 0);
}
| long read_config_file(
const char *a1,
long a2,
long a3,
const char *a4,
long a5,
int a6,
long a7)
{
int v8;
unsigned long v9;
v9 = __readfsqword(0x28u);
v8 = 1;
return read_config_file_depth(a1, a2, a3, a4, a5, a6, &v8, a7, 0);
}
|
void uconv(struct oldutmp *oldut, struct utmp *utn)
{
memset(utn, 0, sizeof(struct utmp));
utn->ut_type = oldut->ut_type;
utn->ut_pid = oldut->ut_pid;
utn->
ut_tv.tv_sec
= oldut->ut_oldtime;
utn->
ut_addr_v6[0]
= oldut->ut_oldaddr;
strncpy(utn->ut_line, oldut->ut_line, 12);
strncpy(utn->ut_user, oldut->ut_user, 8);
strncpy(utn->ut_host, oldut->ut_host, 16);
}
| void uconv(undefined2 *param_1,undefined2 *param_2)
{
memset(param_2,0,0x180);
*param_2 = *param_1;
*(undefined4 *)(param_2 + 2) = *(undefined4 *)(param_1 + 2);
*(int *)(param_2 + 0xaa) = (int)*(undefined8 *)(param_1 + 0xc);
*(int *)(param_2 + 0xae) = (int)*(undefined8 *)(param_1 + 0x1c);
strncpy((char *)(param_2 + 4),(char *)(param_1 + 4),0xc);
strncpy((char *)(param_2 + 0x16),(char *)(param_1 + 0x10),8);
strncpy((char *)(param_2 + 0x26),(char *)(param_1 + 0x14),0x10);
return;
}
|
static float
estimate_pattern_match_rate (const char *pattern, int is_regex)
{
if (strpbrk (pattern, "*?[") || (is_regex && strpbrk(pattern, ".")))
{
return 0.8f;
}
else
{
return 0.1f;
}
}
| void estimate_pattern_match_rate(char *a0, unsigned long a1) {
if (strpbrk(a0, "*?[")) {
return;
} else if (!a1) {
return;
} else if (!strpbrk(a0, ".")) {
return;
} else {
return;
}
}
|
static int
parse_escape_char(const char ch)
{
char value = 0;
switch (ch)
{
case 'a':
value = '\a';
break;
case 'b':
value = '\b';
break;
case 'f':
value = '\f';
break;
case 'n':
value = '\n';
break;
case 'r':
value = '\r';
break;
case 't':
value = '\t';
break;
case 'v':
value = '\v';
break;
case '\\':
value = '\\';
break;
}
return value;
}
| undefined parse_escape_char(undefined param_1)
{
undefined local_9;
local_9 = 0;
switch(param_1) {
case 0x5c:
local_9 = 0x5c;
break;
case 0x61:
local_9 = 7;
break;
case 0x62:
local_9 = 8;
break;
case 0x66:
local_9 = 0xc;
break;
case 0x6e:
local_9 = 10;
break;
case 0x72:
local_9 = 0xd;
break;
case 0x74:
local_9 = 9;
break;
case 0x76:
local_9 = 0xb;
}
return local_9;
}
|
static void gre_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
{
char s2[64];
__u16 iflags = 0;
__u16 oflags = 0;
__u32 flags = 0;
__u32 flowinfo = 0;
__u8 ttl = 0;
if (!tb)
return;
if (tb[IFLA_GRE_COLLECT_METADATA]) {
print_bool(PRINT_ANY, "external", "external ",
1
);
}
if (tb[IFLA_GRE_FLAGS])
flags = rta_getattr_u32(tb[IFLA_GRE_FLAGS]);
if (tb[IFLA_GRE_FLOWINFO])
flowinfo = rta_getattr_u32(tb[IFLA_GRE_FLOWINFO]);
tnl_print_endpoint("remote", tb[IFLA_GRE_REMOTE],
10
);
tnl_print_endpoint("local", tb[IFLA_GRE_LOCAL],
10
);
if (tb[IFLA_GRE_LINK]) {
__u32 link = rta_getattr_u32(tb[IFLA_GRE_LINK]);
if (link) {
print_string(PRINT_ANY, "link", "dev %s ",
ll_index_to_name(link));
}
}
if (tb[IFLA_GRE_TTL])
ttl = rta_getattr_u8(tb[IFLA_GRE_TTL]);
if (is_json_context() || ttl)
print_uint(PRINT_ANY, "ttl", "hoplimit %u ", ttl);
else
print_string(PRINT_FP,
((void *)0)
, "hoplimit %s ", "inherit");
if (flags & 0x1) {
print_bool(PRINT_ANY,
"ip6_tnl_f_ign_encap_limit",
"encaplimit none ",
1
);
} else if (tb[IFLA_GRE_ENCAP_LIMIT]) {
__u8 val = rta_getattr_u8(tb[IFLA_GRE_ENCAP_LIMIT]);
print_uint(PRINT_ANY, "encap_limit", "encaplimit %u ", val);
}
if (flags & 0x2) {
print_bool(PRINT_ANY,
"ip6_tnl_f_use_orig_tclass",
"tclass inherit ",
1
);
} else if (tb[IFLA_GRE_FLOWINFO]) {
__u32 val = ntohl(flowinfo & htonl(0x0FF00000)) >> 20;
snprintf(s2, sizeof(s2), "0x%02x", val);
print_string(PRINT_ANY, "tclass", "tclass %s ", s2);
}
if (flags & 0x4) {
print_bool(PRINT_ANY,
"ip6_tnl_f_use_orig_flowlabel",
"flowlabel inherit ",
1
);
} else if (tb[IFLA_GRE_FLOWINFO]) {
__u32 val = ntohl(flowinfo & htonl(0x000FFFFF));
snprintf(s2, sizeof(s2), "0x%05x", val);
print_string(PRINT_ANY, "flowlabel", "flowlabel %s ", s2);
}
if (flags & 0x10)
print_bool(PRINT_ANY,
"ip6_tnl_f_rcv_dscp_copy",
"dscp inherit ",
1
);
if (tb[IFLA_GRE_IFLAGS])
iflags = rta_getattr_u16(tb[IFLA_GRE_IFLAGS]);
if (tb[IFLA_GRE_OFLAGS])
oflags = rta_getattr_u16(tb[IFLA_GRE_OFLAGS]);
if ((iflags &
((__be16)(__builtin_constant_p((__u16)((
0x2000
))) ? ((__u16)( (((__u16)((
0x2000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x2000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x2000
))))
) && tb[IFLA_GRE_IKEY]) {
inet_ntop(
2
, ((void*)(((char*)(tb[IFLA_GRE_IKEY])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), s2, sizeof(s2));
print_string(PRINT_ANY, "ikey", "ikey %s ", s2);
}
if ((oflags &
((__be16)(__builtin_constant_p((__u16)((
0x2000
))) ? ((__u16)( (((__u16)((
0x2000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x2000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x2000
))))
) && tb[IFLA_GRE_OKEY]) {
inet_ntop(
2
, ((void*)(((char*)(tb[IFLA_GRE_OKEY])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), s2, sizeof(s2));
print_string(PRINT_ANY, "okey", "okey %s ", s2);
}
if (iflags &
((__be16)(__builtin_constant_p((__u16)((
0x1000
))) ? ((__u16)( (((__u16)((
0x1000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x1000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x1000
))))
)
print_bool(PRINT_ANY, "iseq", "iseq ",
1
);
if (oflags &
((__be16)(__builtin_constant_p((__u16)((
0x1000
))) ? ((__u16)( (((__u16)((
0x1000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x1000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x1000
))))
)
print_bool(PRINT_ANY, "oseq", "oseq ",
1
);
if (iflags &
((__be16)(__builtin_constant_p((__u16)((
0x8000
))) ? ((__u16)( (((__u16)((
0x8000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x8000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x8000
))))
)
print_bool(PRINT_ANY, "icsum", "icsum ",
1
);
if (oflags &
((__be16)(__builtin_constant_p((__u16)((
0x8000
))) ? ((__u16)( (((__u16)((
0x8000
)) & (__u16)0x00ffU) << 8) | (((__u16)((
0x8000
)) & (__u16)0xff00U) >> 8))) : __fswab16((
0x8000
))))
)
print_bool(PRINT_ANY, "ocsum", "ocsum ",
1
);
if (flags & 0x40)
print_bool(PRINT_ANY,
"ip6_tnl_f_allow_local_remote",
"allow-localremote ",
1
);
if (flags & 0x20) {
print_bool(PRINT_ANY,
"ip6_tnl_f_use_orig_fwmark",
"fwmark inherit ",
1
);
} else if (tb[IFLA_GRE_FWMARK]) {
__u32 fwmark = rta_getattr_u32(tb[IFLA_GRE_FWMARK]);
if (fwmark) {
print_0xhex(PRINT_ANY,
"fwmark", "fwmark %#llx ", fwmark);
}
}
if (tb[IFLA_GRE_ERSPAN_INDEX]) {
__u32 erspan_idx = rta_getattr_u32(tb[IFLA_GRE_ERSPAN_INDEX]);
print_uint(PRINT_ANY,
"erspan_index", "erspan_index %u ", erspan_idx);
}
if (tb[IFLA_GRE_ERSPAN_VER]) {
__u8 erspan_ver = rta_getattr_u8(tb[IFLA_GRE_ERSPAN_VER]);
print_uint(PRINT_ANY,
"erspan_ver", "erspan_ver %u ", erspan_ver);
}
if (tb[IFLA_GRE_ERSPAN_DIR]) {
__u8 erspan_dir = rta_getattr_u8(tb[IFLA_GRE_ERSPAN_DIR]);
if (erspan_dir == 0)
print_string(PRINT_ANY, "erspan_dir",
"erspan_dir %s ", "ingress");
else
print_string(PRINT_ANY, "erspan_dir",
"erspan_dir %s ", "egress");
}
if (tb[IFLA_GRE_ERSPAN_HWID]) {
__u16 erspan_hwid = rta_getattr_u16(tb[IFLA_GRE_ERSPAN_HWID]);
print_0xhex(PRINT_ANY,
"erspan_hwid", "erspan_hwid %#llx ", erspan_hwid);
}
tnl_print_encap(tb,
IFLA_GRE_ENCAP_TYPE,
IFLA_GRE_ENCAP_FLAGS,
IFLA_GRE_ENCAP_SPORT,
IFLA_GRE_ENCAP_DPORT);
}
| long long gre_print_opt(unsigned long a0, unsigned long a1, unsigned long long a2[25]) {
unsigned long v0;
unsigned long v1;
char v2;
char v3;
char v4;
char v5;
unsigned short v6;
unsigned short v7;
unsigned short v8;
unsigned int v9;
unsigned int v10;
unsigned int v11;
unsigned int v12;
unsigned int v13;
unsigned int v14;
unsigned int v15;
char v16;
v1 = a0;
v0 = a1;
v6 = 0;
v7 = 0;
v9 = 0;
v10 = 0;
v2 = 0;
if (!a2)
return 0;
if (a2[18])
print_bool(0x4, "external", "external ", 0x1);
if (a2[13])
v9 = rta_getattr_u32(a2[13]);
if (a2[12])
v10 = rta_getattr_u32(a2[12]);
tnl_print_endpoint("remote", a2[7], 0xa);
tnl_print_endpoint("local", a2[6], 0xa);
if (a2[1]) {
v11 = rta_getattr_u32(a2[1]);
if (v11)
print_string(0x4, "link", "dev %s ", ll_index_to_name(v11));
}
if (a2[8])
v2 = rta_getattr_u8(a2[8]);
if (is_json_context() || v2)
print_uint(0x4, "ttl", "hoplimit %u ", v2);
else
print_string(0x1, 0x0, "hoplimit %s ", "inherit");
if ((v9 & 1)) {
print_bool(0x4, "ip6_tnl_f_ign_encap_limit", "encaplimit none ", 0x1);
} else if (a2[11]) {
v3 = rta_getattr_u8(a2[11]);
print_uint(0x4, "encap_limit", "encaplimit %u ", v3);
}
if ((v9 & 2)) {
print_bool(0x4, "ip6_tnl_f_use_orig_tclass", "tclass inherit ", 0x1);
} else if (a2[12]) {
v12 = ntohl(htonl(0xff00000) & v10) >> 20;
snprintf(&v16, 0x40, "0x%02x", v12);
print_string(0x4, "tclass", "tclass %s ", &v16);
}
if ((v9 & 4)) {
print_bool(0x4, "ip6_tnl_f_use_orig_flowlabel", "flowlabel inherit ", 0x1);
} else if (a2[12]) {
v13 = ntohl(htonl(0xfffff) & v10);
snprintf(&v16, 0x40, "0x%05x", v13);
print_string(0x4, "flowlabel", "flowlabel %s ", &v16);
}
if ((v9 & 16))
print_bool(0x4, "ip6_tnl_f_rcv_dscp_copy", "dscp inherit ", 0x1);
if (a2[2])
v6 = rta_getattr_u16(a2[2]);
if (a2[3])
v7 = rta_getattr_u16(a2[3]);
if ((v6 & 32) && a2[4]) {
inet_ntop(0x2, a2[4] + 4, &v16, 0x40);
print_string(0x4, "ikey", "ikey %s ", &v16);
}
if ((v7 & 32) && a2[5]) {
inet_ntop(0x2, a2[5] + 4, &v16, 0x40);
print_string(0x4, "okey", "okey %s ", &v16);
}
if ((v6 & 16))
print_bool(0x4, "iseq", "iseq ", 0x1);
if ((v7 & 16))
print_bool(0x4, "oseq", "oseq ", 0x1);
if ((v6 & 128))
print_bool(0x4, "icsum", "icsum ", 0x1);
if ((v7 & 128))
print_bool(0x4, "ocsum", "ocsum ", 0x1);
if ((v9 & 64))
print_bool(0x4, "ip6_tnl_f_allow_local_remote", "allow-localremote ", 0x1);
if ((v9 & 32)) {
print_bool(0x4, "ip6_tnl_f_use_orig_fwmark", "fwmark inherit ", 0x1);
} else if (a2[20]) {
v14 = rta_getattr_u32(a2[20]);
if (v14)
print_0xhex(0x4, "fwmark", "fwmark %#llx ", v14);
}
if (a2[21]) {
v15 = rta_getattr_u32(a2[21]);
print_uint(0x4, "erspan_index", "erspan_index %u ", v15);
}
if (a2[22]) {
v4 = rta_getattr_u8(a2[22]);
print_uint(0x4, "erspan_ver", "erspan_ver %u ", v4);
}
if (a2[23]) {
v5 = rta_getattr_u8(a2[23]);
if (v5)
print_string(0x4, "erspan_dir", "erspan_dir %s ", "egress");
else
print_string(0x4, "erspan_dir", "erspan_dir %s ", "ingress");
}
if (a2[24]) {
v8 = rta_getattr_u16(a2[24]);
print_0xhex(0x4, "erspan_hwid", "erspan_hwid %#llx ", v8);
}
tnl_print_encap(a2, 0xe, 0xf, 0x10, 0x11);
return 0;
}
|
HIST_ENTRY *
next_history(void)
{
HistEvent ev;
if (history_offset >= history_length)
return
((void *)0)
;
if (history(h, &ev, 4) != 0)
return
((void *)0)
;
history_offset++;
return current_history();
}
| long long next_history() {
char v0;
void* v2;
if (*(got.history_offset) >= *(got.history_length)) {
v2 = 0;
return v2;
} else if (!history(h, &v0, 0x4, &v0)) {
*(got.history_offset) = *(got.history_offset) + 1;
v2 = current_history();
return v2;
} else {
v2 = 0;
return v2;
}
}
|
void
posix_readline_initialize (on_or_off)
int on_or_off;
{
static char kseq[2] = { (('I') & 0x1f), 0 };
if (on_or_off)
rl_variable_bind ("comment-begin", "#");
if (on_or_off)
{
vi_tab_binding = rl_function_of_keyseq (kseq, vi_insertion_keymap, (int *)
((void *)0)
);
rl_bind_key_in_map ((('I') & 0x1f), rl_insert, vi_insertion_keymap);
}
else
{
if (rl_function_of_keyseq (kseq, vi_insertion_keymap, (int *)
((void *)0)
) == rl_insert)
rl_bind_key_in_map ((('I') & 0x1f), vi_tab_binding, vi_insertion_keymap);
}
}
| long long posix_readline_initialize(unsigned long a0) {
unsigned long long v1;
if (a0)
rl_variable_bind("comment-begin", "#");
if (a0) {
vi_tab_binding = rl_function_of_keyseq("\t", 0x500010, 0x0);
v1 = rl_bind_key_in_map(0x9, *(&got.rl_insert), 0x500010);
} else {
v1 = rl_function_of_keyseq("\t", 0x500010, 0x0);
if (v1 == *(&got.rl_insert))
v1 = rl_bind_key_in_map(0x9, vi_tab_binding, 0x500010);
}
return v1;
}
|
SHELL_VAR *
find_shell_variable (name)
const char *name;
{
SHELL_VAR *var;
var = var_lookup (name, shell_variables);
if (var && ((((var)->attributes) & (0x0000800))))
var = find_variable_nameref (var);
if (var == 0)
return ((SHELL_VAR *)
((void *)0)
);
return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var);
}
| long long find_shell_variable(unsigned long long a0) {
void* v0;
void* v2;
v0 = var_lookup(a0, shell_variables);
if (v0 && (v0[40] & 0x800))
v0 = find_variable_nameref(v0);
if (!v0) {
v2 = 0;
} else if (!v0[24]) {
v2 = v0;
} else {
v2 = *(((stack_base)[16] + 24))(v0);
}
return v2;
}
|
int
acl_check(acl_t acl, int *last)
{
acl_obj *acl_obj_p = ((acl_obj *)__ext2int_and_check(acl, (0x712C)));
id_t qual = 0;
int state = (0x01);
acl_entry_obj *entry_obj_p;
int needs_mask = 0;
if (!acl_obj_p)
return -1;
if (last)
*last = 0;
for( (entry_obj_p) = (acl_obj_p)->i.a_next; (entry_obj_p) != (acl_entry_obj *)(acl_obj_p); (entry_obj_p) = (entry_obj_p)->i.e_next ) {
switch (entry_obj_p->i.e_entry.e_tag) {
case (0x01):
if (state == (0x01)) {
qual = 0;
state = (0x02);
break;
}
do { return (0x1000); } while (0);
case (0x02):
if (state != (0x02))
do { return (0x3000); } while (0);
if (((entry_obj_p->i.e_entry.e_id).i.q_id) < qual ||
((entry_obj_p->i.e_entry.e_id).i.q_id) ==
((id_t)-1))
do { return (0x2000); } while (0);
qual = ((entry_obj_p->i.e_entry.e_id).i.q_id)+1;
needs_mask = 1;
break;
case (0x04):
if (state == (0x02)) {
qual = 0;
state = (0x08);
break;
}
if (state >= (0x08))
do { return (0x1000); } while (0);
do { return (0x3000); } while (0);
case (0x08):
if (state != (0x08))
do { return (0x3000); } while (0);
if (((entry_obj_p->i.e_entry.e_id).i.q_id) < qual ||
((entry_obj_p->i.e_entry.e_id).i.q_id) ==
((id_t)-1))
do { return (0x2000); } while (0);
qual = ((entry_obj_p->i.e_entry.e_id).i.q_id)+1;
needs_mask = 1;
break;
case (0x10):
if (state == (0x08)) {
state = (0x20);
break;
}
if (state >= (0x20))
do { return (0x1000); } while (0);
do { return (0x3000); } while (0);
case (0x20):
if (state == (0x20) ||
(state == (0x08) && !needs_mask)) {
state = 0;
break;
}
do { return (0x3000); } while (0);
default:
do { return (0x4000); } while (0);
}
if (last)
(*last)++;
}
if (state != 0)
do { return (0x3000); } while (0);
return 0;
}
| undefined8 acl_check(undefined8 param_1,int *param_2)
{
bool bVar1;
long lVar2;
undefined8 uVar3;
uint local_24;
uint local_20;
long local_18;
lVar2 = __ext2int_and_check(param_1,0x712c);
local_24 = 0;
local_20 = 1;
bVar1 = false;
if (lVar2 == 0) {
uVar3 = 0xffffffff;
}
else {
if (param_2 != (int *)0x0) {
*param_2 = 0;
}
for (local_18 = *(long *)(lVar2 + 0x10); local_18 != lVar2;
local_18 = *(long *)(local_18 + 0x10)) {
switch(*(undefined4 *)(local_18 + 0x20)) {
default:
return 0x4000;
case 1:
if (local_20 != 1) {
return 0x1000;
}
local_24 = 0;
local_20 = 2;
break;
case 2:
if (local_20 != 2) {
return 0x3000;
}
if ((*(uint *)(local_18 + 0x30) < local_24) || (*(int *)(local_18 + 0x30) == -1)) {
return 0x2000;
}
local_24 = *(int *)(local_18 + 0x30) + 1;
bVar1 = true;
break;
case 4:
if (local_20 != 2) {
if (7 < local_20) {
return 0x1000;
}
return 0x3000;
}
local_24 = 0;
local_20 = 8;
break;
case 8:
if (local_20 != 8) {
return 0x3000;
}
if ((*(uint *)(local_18 + 0x30) < local_24) || (*(int *)(local_18 + 0x30) == -1)) {
return 0x2000;
}
local_24 = *(int *)(local_18 + 0x30) + 1;
bVar1 = true;
break;
case 0x10:
if (local_20 != 8) {
if (0x1f < local_20) {
return 0x1000;
}
return 0x3000;
}
local_20 = 0x20;
break;
case 0x20:
if ((local_20 != 0x20) && ((local_20 != 8 || (bVar1)))) {
return 0x3000;
}
local_20 = 0;
}
if (param_2 != (int *)0x0) {
*param_2 = *param_2 + 1;
}
}
if (local_20 == 0) {
uVar3 = 0;
}
else {
uVar3 = 0x3000;
}
}
return uVar3;
}
|
static void
uid_decoder (struct tar_stat_info *st,
char const *keyword,
char const *arg,
size_t size __attribute__((unused)))
{
intmax_t u;
if (decode_signed_num (&u, arg, ((uid_t) ~ ((uid_t) (! (! ((uid_t) 0 < (uid_t) -1)) ? (uid_t) -1 : ((((uid_t) 1 << ((sizeof (uid_t) * 8) - 2)) - 1) * 2 + 1)))),
((uid_t) (! (! ((uid_t) 0 < (uid_t) -1)) ? (uid_t) -1 : ((((uid_t) 1 << ((sizeof (uid_t) * 8) - 2)) - 1) * 2 + 1))), keyword))
st->stat.st_uid = u;
}
| unsigned long uid_decoder(long a1, long a2, long a3)
{
long v4;
unsigned long v5;
v5 = __readfsqword(0x28u);
if ( (unsigned char)decode_signed_num(&v4, a3, 0LL, 0xFFFFFFFFLL, a2) )
*(_DWORD *)(a1 + 116) = v4;
return __readfsqword(0x28u) ^ v5;
}
|
static int do_add(int argc, char **argv)
{
struct { struct nlmsghdr n; struct genlmsghdr g; char buf[( ((0)+4U -1) & ~(4U -1) ) + (1024)]; } req = { .n = { .nlmsg_type = (genl_family), .nlmsg_flags = (0x01), .nlmsg_len = ((( ((sizeof(struct genlmsghdr))+4U -1) & ~(4U -1) ) + (0)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))), }, .g = { .cmd = (ILA_CMD_ADD), .version = (0x1), }, };
ila_parse_opt(argc, argv, &req.n,
1
);
if (rtnl_talk(&genl_rth, &req.n,
((void *)0)
) < 0)
return -2;
return 0;
}
| long do_add(int a1, _QWORD *a2)
{
int v3[262];
unsigned long v4;
v4 = __readfsqword(0x28u);
memset(v3, 0, 1044);
v3[0] = 20;
LOWORD(v3[1]) = genl_family;
HIWORD(v3[1]) = 1;
LOWORD(v3[4]) = 257;
ila_parse_opt(a1, a2, (long)v3, 1);
if ( (int)rtnl_talk(&genl_rth, v3, 0LL) >= 0 )
return 0LL;
else
return 4294967294LL;
}
|
char *
strnstr(const char *s, const char *find, size_t slen)
{
char c, sc;
size_t len;
if ((c = *find++) != '\0') {
len = strlen(find);
do {
do {
if (slen-- < 1 || (sc = *s++) == '\0')
return (
((void *)0)
);
} while (sc != c);
if (len > slen)
return (
((void *)0)
);
} while (strncmp(s, find, len) != 0);
s--;
}
return ((char *)s);
}
| long long strnstr(char *a0, unsigned long a1, unsigned long long a2) {
unsigned long long v0;
int tmp_31;
int tmp_11;
char *v1;
void* v2;
char v3;
char v4;
unsigned int v5;
unsigned long long v8;
void* v9;
v2 = a0;
v1 = a1;
v0 = a2;
tmp_31 = v1;
v1 += 1;
v3 = *(tmp_31);
if (v3) {
*(&v5) = strlen(v1);
do {
v8 = v0;
v0 -= 1;
if (!v8) {
LABEL_400069:
v9 = 0;
goto LABEL_4000ae;
}
tmp_11 = v2;
v2 += 1;
*(&v8) = *(tmp_11);
v4 = v8;
if (!v4)
goto LABEL_400069;
if (!(v4 == v3))
continue;
if (*(&v5) > v0) {
v9 = 0;
goto LABEL_4000ae;
}
} while (strncmp(v2, v1, *(&v5)));
v2 -= 1;
}
v9 = v2;
LABEL_4000ae:
return v9;
}
|
static struct delayed_set_stat *
find_direct_ancestor (char const *file_name)
{
struct delayed_set_stat *h = delayed_set_stat_head;
while (h)
{
if (! h->after_links
&& strncmp (file_name, h->file_name, h->file_name_len) == 0
&&
((
file_name[h->file_name_len]
) == '/')
&& (last_component (file_name) == file_name + h->file_name_len + 1))
break;
h = h->next;
}
return h;
}
| int find_direct_ancestor(char *a0) {
struct_0 *v0;
v0 = delayed_set_stat_head;
while (true) {
if (!v0)
break;
if ((v0->field_58 ^ 1) && !strncmp(a0, v0->field_a0, v0->field_98) && a0[v0->field_98] == 47 && last_component(a0) == &a0[v0->field_98 + 1])
break;
v0 = v0->field_0;
}
return v0;
}
|
static int
find_matching_open (char *string, int from, int closer)
{
register int i;
int opener, level, delimiter;
switch (closer)
{
case ']': opener = '['; break;
case '}': opener = '{'; break;
case ')': opener = '('; break;
default:
return (-1);
}
level = 1;
delimiter = 0;
for (i = from; i > -1; i--)
{
if (delimiter && (string[i] == delimiter))
delimiter = 0;
else if (rl_basic_quote_characters && strchr (rl_basic_quote_characters, string[i]))
delimiter = string[i];
else if (!delimiter && (string[i] == closer))
level++;
else if (!delimiter && (string[i] == opener))
level--;
if (!level)
break;
}
return (i);
}
| int find_matching_open(char *a0, unsigned long a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v4;
char *v5;
if (a2 == 125) {
v0 = 123;
} else if (a2 > 125) {
v4 = -1;
goto LABEL_4004ce;
} else if (a2 == 41) {
v0 = 40;
} else if (a2 == 93) {
v0 = 91;
}
v1 = 1;
v2 = 0;
v5 = a1;
while (true) {
if (v5 < 0)
break;
if (v2 && v2 == *((a0 + v5))) {
v2 = 0;
goto LABEL_4004b8;
}
if (rl_basic_quote_characters && strchr(rl_basic_quote_characters, *((a0 + v5)))) {
v2 = *((a0 + v5));
goto LABEL_4004b8;
}
if (!v2 && a2 == *((a0 + v5))) {
v1 += 1;
goto LABEL_4004b8;
}
if (!v2 && v0 == *((a0 + v5)))
v1 -= 1;
LABEL_4004b8:
if (!v1)
break;
v5 = v5 - 1;
}
v4 = v5;
LABEL_4004ce:
return v4;
}
|
int
sys_truncate (int fd)
{
off_t pos = lseek (fd, (off_t) 0,
1
);
return pos < 0 ? -1 : ftruncate (fd, pos);
}
| int sys_truncate(int a1)
{
long length;
length = lseek(a1, 0LL, 1);
if ( length < 0 )
return -1;
else
return ftruncate(a1, length);
}
|
static z_crc_t crc_word(data)
z_word_t data;
{
int k;
for (k = 0; k < 8; k++)
data = (data >> 8) ^ crc_table[data & 0xff];
return (z_crc_t)data;
}
| int crc_word(unsigned long a0) {
struct_0 *v0;
unsigned int v1;
v0 = a0;
for (v1 = 0; v1 <= 7; v1 += 1) {
v0 = *((0x4 * &v0->padding_0[0] + &crc_table)) ^ v0 >> 8;
}
return v0;
}
|
static int process_msg(struct nlmsghdr *n, void *arg)
{
struct rtattr *attrs[(__SEG6_ATTR_MAX - 1) + 1];
struct genlmsghdr *ghdr;
int len = n->nlmsg_len;
if (n->nlmsg_type != genl_family)
return -1;
len -= ((( ((sizeof(struct genlmsghdr))+4U -1) & ~(4U -1) )) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )));
if (len < 0)
return -1;
ghdr = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
parse_rtattr(attrs, (__SEG6_ATTR_MAX - 1), (void *)ghdr + ( ((sizeof(struct genlmsghdr))+4U -1) & ~(4U -1) ), len);
open_json_object(
((void *)0)
);
switch (ghdr->cmd) {
case SEG6_CMD_DUMPHMAC:
print_dumphmac(attrs);
break;
case SEG6_CMD_GET_TUNSRC:
print_tunsrc(attrs);
break;
}
close_json_object();
return 0;
}
| long process_msg(long a1)
{
long *v2;
int v3;
int v5;
long v6[10];
v6[9] = __readfsqword(0x28u);
if ( *(unsigned short *)(a1 + 4) != genl_family )
return 0xFFFFFFFFLL;
v5 = *(_DWORD *)a1 - 20;
if ( v5 < 0 )
return 0xFFFFFFFFLL;
parse_rtattr(v6, 7LL, a1 + 20, (unsigned int)v5);
v2 = 0LL;
open_json_object(0LL);
v3 = *(unsigned char *)(a1 + 16);
if ( v3 == 2 )
{
v2 = v6;
print_dumphmac(v6);
}
else if ( v3 == 4 )
{
v2 = v6;
print_tunsrc((long)v6);
}
close_json_object(v2);
return 0LL;
}
|
void
bash_history_reinit (interact)
int interact;
{
history_expansion = (interact == 0) ? histexp_flag : 1;
history_expansion_inhibited = (interact == 0) ? 1 - histexp_flag : 0;
history_inhibit_expansion_function = bash_history_inhibit_expansion;
remember_on_history = enable_history_list;
}
| long long bash_history_reinit(unsigned long a0) {
unsigned int v1;
unsigned int v2;
if (!a0)
v1 = histexp_flag;
else
v1 = 1;
history_expansion = v1;
if (!a0)
v2 = 1 - histexp_flag;
else
v2 = 0;
dont_save_function_defs = v2;
history_inhibit_expansion_function = bash_history_inhibit_expansion;
remember_on_history = enable_history_list;
return enable_history_list;
}
|
(r = sshpkt_put_u32(ssh, kbdintctxt->nreq)) != 0)
sshfatal("auth2-chall.c", __func__, 270, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "start packet");
for (i = 0; i < kbdintctxt->nreq; i++) {
if ((r = sshpkt_put_cstring(ssh, prompts[i])) != 0 ||
(r = sshpkt_put_u8(ssh, echo_on[i])) != 0)
sshfatal("auth2-chall.c", __func__, 274, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble packet");
}
| void sshpkt_put_u32(void)
{
halt_baddata();
}
|
char **
glob_filename (pathname, flags)
char *pathname;
int flags;
{
char **result, **new_result;
unsigned int result_size;
char *directory_name, *filename, *dname, *fn;
unsigned int directory_len;
int free_dirname;
int dflags, hasglob;
result = (char **) sh_malloc((sizeof (char *)), "glob.c", 1162);
result_size = 1;
if (result ==
((void *)0)
)
return (
((void *)0)
);
result[0] =
((void *)0)
;
directory_name =
((void *)0)
;
filename = strrchr (pathname, '/');
if (filename && extended_glob)
{
fn = glob_dirscan (pathname, '/');
filename = fn;
}
if (filename ==
((void *)0)
)
{
filename = pathname;
directory_name = "";
directory_len = 0;
free_dirname = 0;
}
else
{
directory_len = (filename - pathname) + 1;
directory_name = (char *) sh_malloc((directory_len + 1), "glob.c", 1195);
if (directory_name == 0)
{
sh_xfree((result), "glob.c", 1199);
return (
((void *)0)
);
}
bcopy (pathname, directory_name, directory_len);
directory_name[directory_len] = '\0';
++filename;
free_dirname = 1;
}
hasglob = 0;
if (directory_len > 0 && (hasglob = glob_pattern_p (directory_name)) == 1)
{
char **directories, *d, *p;
register unsigned int i;
int all_starstar, last_starstar;
all_starstar = last_starstar = 0;
d = directory_name;
dflags = flags & ~0x001;
if ((flags & 0x400) && d[0] == '*' && d[1] == '*' && (d[2] == '/' || d[2] == '\0'))
{
p = d;
while (d[0] == '*' && d[1] == '*' && (d[2] == '/' || d[2] == '\0'))
{
p = d;
if (d[2])
{
d += 3;
while (*d == '/')
d++;
if (*d == 0)
break;
}
}
if (*d == 0)
all_starstar = 1;
d = p;
dflags |= 0x010|0x200;
directory_len = strlen (d);
}
if ((flags & 0x400) && all_starstar == 0)
{
int dl, prev;
prev = dl = directory_len;
while (dl >= 4 && d[dl - 1] == '/' &&
d[dl - 2] == '*' &&
d[dl - 3] == '*' &&
d[dl - 4] == '/')
prev = dl, dl -= 3;
if (dl != directory_len)
last_starstar = 1;
directory_len = prev;
}
if (last_starstar && directory_len > 4 &&
filename[0] == '*' && filename[1] == '*' && filename[2] == 0)
{
directory_len -= 3;
}
if (d[directory_len - 1] == '/')
d[directory_len - 1] = '\0';
directories = glob_filename (d, dflags|0x800);
if (free_dirname)
{
sh_xfree((directory_name), "glob.c", 1281);
directory_name =
((void *)0)
;
}
if (directories ==
((void *)0)
)
goto memory_error;
else if (directories == (char **)&glob_error_return)
{
sh_xfree(((char *) result), "glob.c", 1289);
return ((char **) &glob_error_return);
}
else if (*directories ==
((void *)0)
)
{
sh_xfree(((char *) directories), "glob.c", 1294);
sh_xfree(((char *) result), "glob.c", 1295);
return ((char **) &glob_error_return);
}
if (all_starstar && filename[0] == '*' && filename[1] == '*' && filename[2] == 0)
{
sh_xfree(((char *) directories), "glob.c", 1303);
sh_xfree((directory_name), "glob.c", 1304);
directory_name =
((void *)0)
;
directory_len = 0;
goto only_filename;
}
for (i = 0; directories[i] !=
((void *)0)
; ++i)
{
char **temp_results;
int shouldbreak;
shouldbreak = 0;
dname = directories[i];
dflags = flags & ~(0x001|0x010|0x200);
if ((flags & 0x400) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0')
dflags |= 0x010|0x200;
if (dname[0] == '\0' && filename[0])
{
dflags |= 0x100;
dname = ".";
}
if (all_starstar && (dflags & 0x100) == 0)
{
int dlen;
if (glob_testdir (dname, flags|0x010) == -2 && glob_testdir (dname, 0) == 0)
{
if (filename[0] != 0)
temp_results = (char **)&glob_error_return;
else
{
temp_results = (char **)sh_malloc((2 * sizeof (char *)), "glob.c", 1354);
if (temp_results ==
((void *)0)
)
goto memory_error;
temp_results[0] = (char *)sh_malloc((1), "glob.c", 1357);
if (temp_results[0] == 0)
{
sh_xfree((temp_results), "glob.c", 1360);
goto memory_error;
}
**temp_results = '\0';
temp_results[1] =
((void *)0)
;
dflags |= 0x1000;
}
}
else
temp_results = glob_vector (filename, dname, dflags);
}
else
temp_results = glob_vector (filename, dname, dflags);
if (temp_results ==
((void *)0)
)
goto memory_error;
else if (temp_results == (char **)&glob_error_return)
;
else
{
char **array;
register unsigned int l;
if ((dflags & 0x010) && filename[0] == '*' && filename[1] == '*' && (filename[2] == '\0' || filename[2] == '/'))
{
if ((dflags & 0x100) && (flags & 0x100) == 0 &&
((temp_results) && *(temp_results) && **(temp_results) == 0))
{
register int i, n;
for (n = 0; temp_results[n] && *temp_results[n] == 0; n++)
;
i = n;
do
temp_results[i - n] = temp_results[i];
while (temp_results[i++] != 0);
array = temp_results;
shouldbreak = 1;
}
else
array = temp_results;
}
else if (dflags & 0x1000)
array = glob_dir_to_array (directories[i], temp_results, flags);
else
array = glob_dir_to_array (directories[i], temp_results, flags);
l = 0;
while (array[l] !=
((void *)0)
)
++l;
new_result = (char **)realloc (result, (result_size + l) * sizeof (char *));
if (new_result ==
((void *)0)
)
{
for (l = 0; array[l]; ++l)
sh_xfree((array[l]), "glob.c", 1433);
sh_xfree(((char *)array), "glob.c", 1434);
goto memory_error;
}
result = new_result;
for (l = 0; array[l] !=
((void *)0)
; ++l)
result[result_size++ - 1] = array[l];
result[result_size - 1] =
((void *)0)
;
if (array != temp_results)
sh_xfree(((char *) array), "glob.c", 1446);
else if ((dflags & 0x010) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0')
sh_xfree((temp_results), "glob.c", 1448);
if (shouldbreak)
break;
}
}
for (i = 0; directories[i]; i++)
sh_xfree((directories[i]), "glob.c", 1456);
sh_xfree(((char *) directories), "glob.c", 1458);
return (result);
}
only_filename:
if (*filename == '\0')
{
result = (char **) realloc ((char *) result, 2 * sizeof (char *));
if (result ==
((void *)0)
)
{
if (free_dirname)
sh_xfree((directory_name), "glob.c", 1471);
return (
((void *)0)
);
}
if (directory_len > 0 && hasglob == 2 && (flags & 0x800) != 0)
{
dequote_pathname (directory_name);
directory_len = strlen (directory_name);
}
if (directory_len > 0 && hasglob == 2 && (flags & 0x800) == 0)
{
dequote_pathname (directory_name);
if (glob_testdir (directory_name, 0) < 0)
{
if (free_dirname)
sh_xfree((directory_name), "glob.c", 1497);
sh_xfree(((char *) result), "glob.c", 1498);
return ((char **)&glob_error_return);
}
}
result[0] = (char *) sh_malloc((directory_len + 1), "glob.c", 1504);
if (result[0] ==
((void *)0)
)
goto memory_error;
bcopy (directory_name, result[0], directory_len + 1);
if (free_dirname)
sh_xfree((directory_name), "glob.c", 1509);
result[1] =
((void *)0)
;
return (result);
}
else
{
char **temp_results;
if (directory_len > 0)
dequote_pathname (directory_name);
sh_xfree((result), "glob.c", 1525);
dflags = flags & ~0x001;
if (directory_len == 0)
dflags |= 0x100;
if ((flags & 0x400) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0')
{
dflags |= 0x010|0x200;
if (directory_len == 0 && (flags & 0x010) == 0)
dflags &= ~0x200;
}
temp_results = glob_vector (filename,
(directory_len == 0 ? "." : directory_name),
dflags);
if (temp_results ==
((void *)0)
|| temp_results == (char **)&glob_error_return)
{
if (free_dirname)
sh_xfree((directory_name), "glob.c", 1554);
do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0);
run_pending_traps ();
return (temp_results);
}
result = glob_dir_to_array ((dflags & 0x010) ? "" : directory_name, temp_results, flags);
if (free_dirname)
sh_xfree((directory_name), "glob.c", 1563);
return (result);
}
memory_error:
if (result !=
((void *)0)
)
{
register unsigned int i;
for (i = 0; result[i] !=
((void *)0)
; ++i)
sh_xfree((result[i]), "glob.c", 1574);
sh_xfree(((char *) result), "glob.c", 1575);
}
if (free_dirname && directory_name)
sh_xfree((directory_name), "glob.c", 1579);
do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0);
run_pending_traps ();
return (
((void *)0)
);
}
| void ** glob_filename(char *param_1,uint param_2)
{
int iVar1;
bool bVar2;
int iVar3;
size_t sVar4;
long *plVar5;
char *pcVar6;
long lVar7;
void *pvVar8;
void **ppvVar9;
uint uVar10;
ulong uVar11;
ulong uVar12;
bool bVar13;
bool bVar14;
int local_b0;
uint local_ac;
uint local_a4;
int local_a0;
uint local_94;
uint local_90;
void **local_88;
char *local_80;
char *local_78;
char *local_70;
char *local_68;
char *local_60;
char **local_58;
char **local_50;
local_88 = (void **)sh_malloc(8,&DAT_001035b8,0x48a);
local_b0 = 1;
if (local_88 == (void **)0x0) {
return (void **)0x0;
}
*local_88 = (void *)0x0;
iVar3 = 0x2f;
local_78 = strrchr(param_1,0x2f);
if ((local_78 != (char *)0x0) && (extended_glob != 0)) {
iVar3 = 0x2f;
local_78 = (char *)glob_dirscan(param_1);
}
if (local_78 == (char *)0x0) {
local_80 = &DAT_001035bf;
local_ac = 0;
bVar2 = false;
local_78 = param_1;
}
else {
iVar3 = (int)local_78 - (int)param_1;
local_ac = iVar3 + 1;
local_80 = (char *)sh_malloc(iVar3 + 2,&DAT_001035b8,0x4ab);
if (local_80 == (char *)0x0) {
sh_xfree(local_88,&DAT_001035b8,0x4af);
return (void **)0x0;
}
pcVar6 = local_80;
bcopy(param_1,local_80,(ulong)local_ac);
iVar3 = (int)pcVar6;
local_80[local_ac] = '\0';
local_78 = local_78 + 1;
bVar2 = true;
}
local_a0 = 0;
if ((local_ac != 0) && (local_a0 = glob_pattern_p(local_80,iVar3), local_a0 == 1)) {
bVar14 = false;
bVar13 = false;
local_68 = local_80;
local_a4 = param_2 & 0xfffffffe;
if ((((param_2 & 0x400) != 0) && ((*local_80 == '*' && (local_80[1] == '*')))) &&
((local_80[2] == '/' || (local_80[2] == '\0')))) {
local_60 = local_80;
do {
do {
if (((*local_68 != '*') || (local_68[1] != '*')) ||
((local_68[2] != '/' && (local_68[2] != '\0')))) goto LAB_00102686;
local_60 = local_68;
} while (local_68[2] == '\0');
for (local_68 = local_68 + 3; *local_68 == '/'; local_68 = local_68 + 1) {
}
} while (*local_68 != '\0');
LAB_00102686:
bVar13 = *local_68 == '\0';
local_68 = local_60;
local_a4 = local_a4 | 0x210;
sVar4 = strlen(local_60);
local_ac = (uint)sVar4;
}
if (((param_2 & 0x400) != 0) && (!bVar13)) {
local_94 = local_ac;
local_90 = local_ac;
while ((((3 < (int)local_94 && (local_68[(long)(int)local_94 + -1] == '/')) &&
(local_68[(long)(int)local_94 + -2] == '*')) &&
((local_68[(long)(int)local_94 + -3] == '*' &&
(local_68[(long)(int)local_94 + -4] == '/'))))) {
local_90 = local_94;
local_94 = local_94 - 3;
}
bVar14 = local_ac != local_94;
local_ac = local_90;
}
if (((bVar14) && (4 < local_ac)) &&
((*local_78 == '*' && ((local_78[1] == '*' && (local_78[2] == '\0')))))) {
local_ac = local_ac - 3;
}
if (local_68[local_ac - 1] == '/') {
local_68[local_ac - 1] = '\0';
}
plVar5 = (long *)glob_filename(local_68,local_a4 | 0x800);
if (bVar2) {
sh_xfree(local_80,&DAT_001035b8,0x501);
local_80 = (char *)0x0;
}
if (plVar5 == (long *)0x0) goto LAB_001032d5;
if (plVar5 == &glob_error_return) {
sh_xfree(local_88,&DAT_001035b8,0x509);
return (void **)&glob_error_return;
}
if (*plVar5 == 0) {
sh_xfree(plVar5,&DAT_001035b8,0x50e);
sh_xfree(local_88,&DAT_001035b8,0x50f);
return (void **)&glob_error_return;
}
if ((((!bVar13) || (*local_78 != '*')) || (local_78[1] != '*')) || (local_78[2] != '\0')) {
for (uVar12 = 0; plVar5[uVar12] != 0; uVar12 = (ulong)((int)uVar12 + 1)) {
bVar14 = false;
local_70 = (char *)plVar5[uVar12];
local_a4 = param_2 & 0xfffffdee;
if ((((param_2 & 0x400) != 0) && (*local_78 == '*')) &&
((local_78[1] == '*' && (local_78[2] == '\0')))) {
local_a4 = local_a4 | 0x210;
}
if ((*local_70 == '\0') && (*local_78 != '\0')) {
local_a4 = local_a4 | 0x100;
local_70 = ".";
}
if ((bVar13) && ((local_a4 & 0x100) == 0)) {
iVar3 = glob_testdir(local_70,param_2 | 0x10);
if ((iVar3 == -2) && (iVar3 = glob_testdir(local_70,0), iVar3 == 0)) {
if (*local_78 == '\0') {
local_58 = (char **)sh_malloc(0x10,&DAT_001035b8,0x54a);
if (local_58 == (char **)0x0) goto LAB_001032d5;
pcVar6 = (char *)sh_malloc(1,&DAT_001035b8,0x54d);
*local_58 = pcVar6;
if (*local_58 == (char *)0x0) {
sh_xfree(local_58,&DAT_001035b8,0x550);
goto LAB_001032d5;
}
**local_58 = '\0';
local_58[1] = (char *)0x0;
local_a4 = local_a4 | 0x1000;
}
else {
local_58 = (char **)&glob_error_return;
}
}
else {
local_58 = (char **)glob_vector(local_78,local_70,local_a4);
}
}
else {
local_58 = (char **)glob_vector(local_78,local_70,local_a4);
}
if (local_58 == (char **)0x0) goto LAB_001032d5;
if (local_58 != (char **)&glob_error_return) {
if (((((local_a4 & 0x10) == 0) || (*local_78 != '*')) || (local_78[1] != '*')) ||
((local_78[2] != '\0' && (local_78[2] != '/')))) {
if ((local_a4 & 0x1000) == 0) {
local_50 = (char **)glob_dir_to_array(plVar5[uVar12],local_58,param_2);
}
else {
local_50 = (char **)glob_dir_to_array(plVar5[uVar12],local_58,param_2);
}
}
else if ((((local_a4 & 0x100) == 0) || ((param_2 & 0x100) != 0)) ||
((local_58 == (char **)0x0 || ((*local_58 == (char *)0x0 || (**local_58 != '\0')))
))) {
local_50 = local_58;
}
else {
iVar3 = 0;
while ((iVar1 = iVar3, local_58[iVar3] != (char *)0x0 && (*local_58[iVar3] == '\0'))) {
iVar3 = iVar3 + 1;
}
do {
local_58[iVar1 - iVar3] = local_58[iVar1];
lVar7 = (long)iVar1;
iVar1 = iVar1 + 1;
} while (local_58[lVar7] != (char *)0x0);
local_50 = local_58;
bVar14 = true;
}
for (uVar10 = 0; local_50[uVar10] != (char *)0x0; uVar10 = uVar10 + 1) {
}
ppvVar9 = (void **)realloc(local_88,(ulong)(local_b0 + uVar10) * 8);
if (ppvVar9 == (void **)0x0) {
for (uVar12 = 0; local_50[uVar12] != (char *)0x0; uVar12 = (ulong)((int)uVar12 + 1)) {
sh_xfree(local_50[uVar12],&DAT_001035b8,0x599);
}
sh_xfree(local_50,&DAT_001035b8,0x59a);
goto LAB_001032d5;
}
for (uVar11 = 0; local_50[uVar11] != (char *)0x0; uVar11 = (ulong)((int)uVar11 + 1)) {
ppvVar9[local_b0 - 1] = local_50[uVar11];
local_b0 = local_b0 + 1;
}
ppvVar9[local_b0 - 1] = (void *)0x0;
if (local_50 == local_58) {
if (((((local_a4 & 0x10) != 0) && (*local_78 == '*')) && (local_78[1] == '*')) &&
(local_78[2] == '\0')) {
sh_xfree(local_58,&DAT_001035b8,0x5a8);
}
}
else {
sh_xfree(local_50,&DAT_001035b8,0x5a6);
}
local_88 = ppvVar9;
if (bVar14) break;
}
}
for (uVar12 = 0; plVar5[uVar12] != 0; uVar12 = (ulong)((int)uVar12 + 1)) {
sh_xfree(plVar5[uVar12],&DAT_001035b8,0x5b0);
}
sh_xfree(plVar5,&DAT_001035b8,0x5b2);
return local_88;
}
sh_xfree(plVar5,&DAT_001035b8,0x517);
sh_xfree(local_80,&DAT_001035b8,0x518);
local_80 = (char *)0x0;
local_ac = 0;
}
if (*local_78 != '\0') {
if (local_ac != 0) {
dequote_pathname(local_80);
}
sh_xfree(local_88,&DAT_001035b8,0x5f5);
local_a4 = param_2 & 0xfffffffe;
if (local_ac == 0) {
local_a4 = local_a4 | 0x100;
}
if (((((param_2 & 0x400) != 0) && (*local_78 == '*')) &&
((local_78[1] == '*' &&
((local_78[2] == '\0' && (local_a4 = local_a4 | 0x210, local_ac == 0)))))) &&
((param_2 & 0x10) == 0)) {
local_a4 = local_a4 & 0xfffffdff;
}
pcVar6 = local_80;
if (local_ac == 0) {
pcVar6 = ".";
}
ppvVar9 = (void **)glob_vector(local_78,pcVar6,local_a4);
if ((ppvVar9 != (void **)0x0) && (ppvVar9 != (void **)&glob_error_return)) {
pcVar6 = local_80;
if ((local_a4 & 0x10) != 0) {
pcVar6 = &DAT_001035bf;
}
ppvVar9 = (void **)glob_dir_to_array(pcVar6,ppvVar9,param_2);
if (!bVar2) {
return ppvVar9;
}
sh_xfree(local_80,&DAT_001035b8,0x61b);
return ppvVar9;
}
if (bVar2) {
sh_xfree(local_80,&DAT_001035b8,0x612);
}
if (terminating_signal != 0) {
termsig_handler(terminating_signal);
}
if (interrupt_state != 0) {
throw_to_top_level();
}
run_pending_traps();
return ppvVar9;
}
local_88 = (void **)realloc(local_88,0x10);
if (local_88 == (void **)0x0) {
if (bVar2) {
sh_xfree(local_80,&DAT_001035b8,0x5bf);
}
return (void **)0x0;
}
if (((local_ac != 0) && (local_a0 == 2)) && ((param_2 & 0x800) != 0)) {
dequote_pathname(local_80);
sVar4 = strlen(local_80);
local_ac = (uint)sVar4;
}
if (((local_ac != 0) && (local_a0 == 2)) && ((param_2 & 0x800) == 0)) {
dequote_pathname(local_80);
iVar3 = glob_testdir(local_80,0);
if (iVar3 < 0) {
if (bVar2) {
sh_xfree(local_80,&DAT_001035b8,0x5d9);
}
sh_xfree(local_88,&DAT_001035b8,0x5da);
return (void **)&glob_error_return;
}
}
pvVar8 = (void *)sh_malloc(local_ac + 1,&DAT_001035b8,0x5e0);
*local_88 = pvVar8;
if (*local_88 != (void *)0x0) {
bcopy(local_80,*local_88,(ulong)(local_ac + 1));
if (bVar2) {
sh_xfree(local_80,&DAT_001035b8,0x5e5);
}
local_88[1] = (void *)0x0;
return local_88;
}
LAB_001032d5:
if (local_88 != (void **)0x0) {
for (uVar12 = 0; local_88[uVar12] != (void *)0x0; uVar12 = (ulong)((int)uVar12 + 1)) {
sh_xfree(local_88[uVar12],&DAT_001035b8,0x626);
}
sh_xfree(local_88,&DAT_001035b8,0x627);
}
if ((bVar2) && (local_80 != (char *)0x0)) {
sh_xfree(local_80,&DAT_001035b8,0x62b);
}
if (terminating_signal != 0) {
termsig_handler(terminating_signal);
}
if (interrupt_state != 0) {
throw_to_top_level();
}
run_pending_traps();
return (void **)0x0;
}
|
static int
ifdatasync (int fd)
{
int ret;
do
{
process_signals ();
ret = fdatasync (fd);
}
while (ret < 0 &&
(*__errno_location ())
==
4
);
return ret;
}
| int ifdatasync(unsigned long a0) {
unsigned int v0;
unsigned int v2;
unsigned int v3;
unsigned long long v4;
unsigned int v5;
unsigned int v6;
while (true) {
process_signals(a0, v2, v3, v4, v5, v6);
v0 = fdatasync(a0);
if (v0 >= 0)
break;
if (*(__errno_location()) != 4)
break;
}
return v0;
}
|
static int
cert_callback(gnutls_session_t session,
const gnutls_datum_t * req_ca_rdn, int nreqs,
const gnutls_pk_algorithm_t * sign_algos,
int sign_algos_length, gnutls_pcert_st ** pcert,
unsigned int *pcert_length, gnutls_privkey_t * pkey)
{
char issuer_dn[256];
int i, ret, cert_type;
size_t len;
if (verbose) {
if (nreqs > 0)
log_msg(
stdout
, "- Server's trusted authorities:\n");
else
log_msg
(
stdout
, "- Server did not send us any trusted authorities names.\n");
for (i = 0; i < nreqs; i++) {
len = sizeof(issuer_dn);
ret =
gnutls_x509_rdn_get(&req_ca_rdn[i], issuer_dn,
&len);
if (ret >= 0) {
log_msg(
stdout
, " [%d]: ", i);
log_msg(
stdout
, "%s\n", issuer_dn);
}
}
}
cert_type = gnutls_certificate_type_get2(session, GNUTLS_CTYPE_CLIENT);
*pcert_length = 0;
switch (cert_type) {
case GNUTLS_CRT_X509:
if (x509_crt_size > 0) {
if (x509_key !=
((void *)0)
) {
*pkey = x509_key;
} else {
log_msg
(
stdout
, "- Could not find a suitable key to send to server\n");
return -1;
}
*pcert_length = x509_crt_size;
*pcert = x509_crt;
}
break;
case GNUTLS_CRT_RAWPK:
if (rawpk_key ==
((void *)0)
|| rawpk.type != GNUTLS_CRT_RAWPK) {
log_msg
(
stdout
, "- Could not find a suitable key to send to server\n");
return -1;
}
*pkey = rawpk_key;
*pcert = &rawpk;
*pcert_length = 1;
break;
default:
log_msg(
stdout
, "- Could not retrieve unsupported certificate type %s.\n",
gnutls_certificate_type_get_name(cert_type));
return -1;
}
log_msg(
stdout
, "- Successfully sent %u certificate(s) to server.\n",
*pcert_length);
return 0;
}
| long long cert_callback(unsigned long long a0, unsigned long a1, unsigned long long a2, unsigned long a3, unsigned long a4, unsigned long long *a5, unsigned long v9, unsigned long a6) {
unsigned long long *v0;
unsigned int *v1;
unsigned long v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned long long v7;
char v8;
unsigned long long v10;
v2 = a3;
v3 = a4;
v1 = v9;
v0 = a6;
if (verbose) {
if (a2 > 0)
log_msg(*(&stdout), "- Server's trusted authorities:\n", a2);
else
log_msg(*(&stdout), "- Server did not send us any trusted authorities names.\n", a2);
for (v4 = 0; v4 < a2; v4 += 1) {
v7 = 0x100;
v5 = gnutls_x509_rdn_get(v4 * 16 + a1, &v8, &v7, v4 * 16 + a1);
if (v5 >= 0) {
log_msg(*(&stdout), " [%d]: ", v4);
log_msg(*(&stdout), "%s\n", &v8);
}
}
}
v6 = gnutls_certificate_type_get2(a0, 0x0);
*(v1) = 0;
if (v6 != 1) {
if (v6 != 3) {
log_msg(*(&stdout), "- Could not retrieve unsupported certificate type %s.\n", gnutls_certificate_type_get_name(v6));
v10 = 4294967295;
}
} else {
if (x509_crt_size) {
if (x509_key) {
*(v0) = x509_key;
*(v1) = x509_crt_size;
*(a5) = &x509_crt;
} else {
log_msg(*(&stdout), "- Could not find a suitable key to send to server\n", a2);
v10 = 4294967295;
}
}
}
if (v6 == 3) {
if (rawpk_key && g_4055b8 == 3) {
*(v0) = rawpk_key;
*(a5) = &rawpk;
*(v1) = 1;
}
if (!rawpk_key || g_4055b8 != 3) {
log_msg(*(&stdout), "- Could not find a suitable key to send to server\n", a2);
v10 = 4294967295;
}
}
if ((v6 == 1 || v6 == 3) && (v6 == 1 || g_4055b8 == 3) && (v6 == 1 || rawpk_key) && (!x509_crt_size || v6 == 3 || x509_key) && (!x509_crt_size || g_4055b8 == 3 || x509_key) && (!x509_crt_size || rawpk_key || x509_key)) {
log_msg(*(&stdout), "- Successfully sent %u certificate(s) to server.\n", *(v1));
v10 = 0;
}
return v10;
}
|
static void _print_timer(FILE *f, const char *attr, struct rtattr *timer)
{
struct timeval tv;
__jiffies_to_tv(&tv, rta_getattr_u64(timer));
if (is_json_context()) {
json_writer_t *jw = get_json_writer();
jsonw_name(jw, attr);
jsonw_printf(jw, "%i.%.2i",
(int)tv.tv_sec, (int)tv.tv_usec / 10000);
} else {
fprintf(f, "%s %4i.%.2i ", attr, (int)tv.tv_sec,
(int)tv.tv_usec / 10000);
}
}
| void _print_timer(void* a0, unsigned long long a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v0;
char v1;
char v2;
char v3;
unsigned long long *v5;
unsigned long long v6;
__jiffies_to_tv(&v1, rta_getattr_u64(a2));
if (!is_json_context(&v1, a1, a2, a3, a4, a5)) {
fprintf(a0, "%s %4i.%.2i ", a1, *(&v1), ((*(&v2) * 1759218605 >> 44) - (*(&v2) >> 31)));
} else {
v0 = get_json_writer();
jsonw_name(v0, a1, a1);
jsonw_printf(v0, "%i.%.2i", *(&v1), (*(&v2) * 1759218605 >> 44) - (*(&v2) >> 31));
}
v6 = *(&v3) ^ v5[5];
return;
}
|
get_stat_ctime (struct stat const *st)
{
return ((st)->st_ctim);
}
| void get_stat_ctime(void)
{
halt_baddata();
}
|
int main (int argc, char **argv)
{
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);
{
int c;
static struct option const longopts[] = {
{"before",
1
,
((void *)0)
, 'b'},
{"clear",
0
,
((void *)0)
, 'C'},
{"help",
0
,
((void *)0)
, 'h'},
{"root",
1
,
((void *)0)
, 'R'},
{"set",
0
,
((void *)0)
, 'S'},
{"time",
1
,
((void *)0)
, 't'},
{"user",
1
,
((void *)0)
, 'u'},
{
((void *)0)
, 0,
((void *)0)
, '\0'}
};
while ((c = getopt_long (argc, argv, "b:ChR:St:u:", longopts,
((void *)0)
)) != -1) {
switch (c) {
case 'b':
{
unsigned long inverse_days;
if (getulong (optarg, &inverse_days) == 0) {
fprintf (
stderr
,
gettext ("%s: invalid numeric argument '%s'\n"),
Prog, optarg);
exit (
1
);
}
inverse_seconds = (time_t) inverse_days * (24L*3600L);
bflg =
1
;
break;
}
case 'C':
{
Cflg =
1
;
break;
}
case 'h':
usage (
0
);
break;
case 'R':
break;
case 'S':
{
Sflg =
1
;
break;
}
case 't':
{
unsigned long days;
if (getulong (optarg, &days) == 0) {
fprintf (
stderr
,
gettext ("%s: invalid numeric argument '%s'\n"),
Prog, optarg);
exit (
1
);
}
seconds = (time_t) days * (24L*3600L);
tflg =
1
;
break;
}
case 'u':
{
const struct passwd *pwent;
uflg =
1
;
pwent = getpwnam (optarg);
if (
((void *)0)
!= pwent) {
umin = (unsigned long) pwent->pw_uid;
has_umin =
1
;
umax = umin;
has_umax =
1
;
} else {
if (getrange (optarg,
&umin, &has_umin,
&umax, &has_umax) == 0) {
fprintf (
stderr
,
gettext ("%s: Unknown user or range: %s\n"),
Prog, optarg);
exit (
1
);
}
}
break;
}
default:
usage (
1
);
break;
}
}
if (argc > optind) {
fprintf (
stderr
,
gettext ("%s: unexpected argument: %s\n"),
Prog, argv[optind]);
usage (
1
);
}
if (Cflg && Sflg) {
fprintf (
stderr
,
gettext ("%s: Option -C cannot be used together with option -S\n"),
Prog);
usage (
1
);
}
if ((Cflg || Sflg) && !uflg) {
fprintf (
stderr
,
gettext ("%s: Options -C and -S require option -u to specify the user\n"),
Prog);
usage (
1
);
}
}
lastlogfile = fopen ("/var/log/lastlog", (Cflg || Sflg)?"r+":"r");
if (
((void *)0)
== lastlogfile) {
perror ("/var/log/lastlog");
exit (
1
);
}
if (fstat (fileno (lastlogfile), &statbuf) != 0) {
fprintf (
stderr
,
gettext ("%s: Cannot get the size of %s: %s\n"),
Prog, "/var/log/lastlog", strerror (
(*__errno_location ())
));
exit (
1
);
}
if (Cflg || Sflg)
update ();
else
print ();
(void) fclose (lastlogfile);
return
0
;
}
| int main(int argc, const char **argv, const char **envp)
{
char *v3;
long v4;
char *v5;
char *v6;
long v7;
char *v8;
char *v9;
long v10;
char *v11;
const char *v12;
long v13;
char *v14;
long v15;
char *v16;
long v17;
char *v18;
const char *v19;
int v20;
int *v21;
char *v22;
long v23;
char *v24;
int v26;
long v27;
struct passwd *v28;
unsigned long v29;
v29 = __readfsqword(0x28u);
Prog = Basename(*argv, argv, envp);
log_set_progname(Prog);
log_set_logfd(stderr);
setlocale(6, &locale);
bindtextdomain("shadow", "/usr/share/locale");
textdomain("shadow");
process_root_flag("-R", (unsigned int)argc, argv);
while ( 1 )
{
v26 = getopt_long(argc, (char *const *)argv, "b:ChR:St:u:", &longopts_5863, 0LL);
if ( v26 == -1 )
break;
switch ( v26 )
{
case 'C':
Cflg = 1;
break;
case 'R':
continue;
case 'S':
Sflg = 1;
break;
case 'b':
if ( !(unsigned int)getulong(optarg, &v27) )
{
v3 = optarg;
v4 = Prog;
v5 = gettext("%s: invalid numeric argument '%s'\n");
fprintf(stderr, v5, v4, v3);
exit(1);
}
inverse_seconds = 86400 * v27;
bflg = 1;
break;
case 'h':
usage(0);
case 't':
if ( !(unsigned int)getulong(optarg, &v27) )
{
v6 = optarg;
v7 = Prog;
v8 = gettext("%s: invalid numeric argument '%s'\n");
fprintf(stderr, v8, v7, v6);
exit(1);
}
seconds = 86400 * v27;
tflg = 1;
break;
case 'u':
uflg = 1;
v28 = getpwnam(optarg);
if ( v28 )
{
*(_QWORD *)&umin = v28->pw_uid;
has_umin = 1;
umax = *(_QWORD *)&umin;
has_umax = 1;
}
else if ( !(unsigned int)getrange(optarg, &umin, &has_umin, &umax, &has_umax) )
{
v9 = optarg;
v10 = Prog;
v11 = gettext("%s: Unknown user or range: %s\n");
fprintf(stderr, v11, v10, v9);
exit(1);
}
break;
default:
usage(1);
}
}
if ( argc > optind )
{
v12 = argv[optind];
v13 = Prog;
v14 = gettext("%s: unexpected argument: %s\n");
fprintf(stderr, v14, v13, v12);
usage(1);
}
if ( Cflg && Sflg )
{
v15 = Prog;
v16 = gettext("%s: Option -C cannot be used together with option -S\n");
fprintf(stderr, v16, v15);
usage(1);
}
if ( (Cflg || Sflg) && uflg != 1 )
{
v17 = Prog;
v18 = gettext("%s: Options -C and -S require option -u to specify the user\n");
fprintf(stderr, v18, v17);
usage(1);
}
if ( Cflg || Sflg )
v19 = "r+";
else
v19 = "r";
lastlogfile = fopen("/var/log/lastlog", v19);
if ( !lastlogfile )
{
perror("/var/log/lastlog");
exit(1);
}
v20 = fileno(lastlogfile);
if ( fstat(v20, &statbuf) )
{
v21 = _errno_location();
v22 = strerror(*v21);
v23 = Prog;
v24 = gettext("%s: Cannot get the size of %s: %s\n");
fprintf(stderr, v24, v23, "/var/log/lastlog", v22);
exit(1);
}
if ( Cflg || Sflg )
update();
else
print();
fclose(lastlogfile);
return 0;
}
|
void
get_hostfile_hostname_ipaddr(char *hostname, struct sockaddr *hostaddr,
u_short port, char **hostfile_hostname, char **hostfile_ipaddr)
{
char ntop[
1025
];
socklen_t addrlen;
switch (hostaddr ==
((void *)0)
? -1 : hostaddr->sa_family) {
case -1:
addrlen = 0;
break;
case
2
:
addrlen = sizeof(struct sockaddr_in);
break;
case
10
:
addrlen = sizeof(struct sockaddr_in6);
break;
default:
addrlen = sizeof(struct sockaddr);
break;
}
if (hostfile_ipaddr !=
((void *)0)
) {
if (options.proxy_command ==
((void *)0)
) {
if (getnameinfo(hostaddr, addrlen,
ntop, sizeof(ntop),
((void *)0)
, 0,
1
) != 0)
sshfatal("sshconnect.c", __func__, 643, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "getnameinfo failed");
*hostfile_ipaddr = put_host_port(ntop, port);
} else {
*hostfile_ipaddr = xstrdup("<no hostip for proxy "
"command>");
}
}
if (hostfile_hostname !=
((void *)0)
) {
if (options.host_key_alias !=
((void *)0)
) {
*hostfile_hostname = xstrdup(options.host_key_alias);
sshlog("sshconnect.c", __func__, 660, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "using hostkeyalias: %s", *hostfile_hostname);
} else {
*hostfile_hostname = put_host_port(hostname, port);
}
}
}
| void get_hostfile_hostname_ipaddr(unsigned long long a0, unsigned short *a1, unsigned long a2, unsigned long long *a3, unsigned long long *a4) {
unsigned int v0;
char v1;
unsigned long long v2;
unsigned long v3;
char v4;
unsigned int v6;
unsigned long long *v7;
unsigned long long v8;
if (!a1)
v6 = -1;
else
v6 = *(a1);
if (v6 == 10) {
v0 = 28;
} else {
if (v6 <= 10) {
if (v6 == -1) {
v0 = 0;
goto LABEL_401a22;
}
if (v6 == 2) {
v0 = 16;
goto LABEL_401a22;
}
}
v0 = 16;
}
LABEL_401a22:
if (a4) {
if (htonl) {
*(a4) = xstrdup("<no hostip for proxy command>");
} else {
if (getnameinfo(a1, v0, &v1, 0x401, 0x0, 0x0))
sshfatal("sshconnect.c", "get_hostfile_hostname_ipaddr", 0x283, 0x1, 0x1, 0x0, "getnameinfo failed");
*(a4) = put_host_port(&v1, a2, a2);
}
}
if (a3) {
if (strcmp) {
*(a3) = xstrdup(strcmp);
v3 = *(a3);
v2 = "using hostkeyalias: %s";
sshlog("sshconnect.c", "get_hostfile_hostname_ipaddr", 0x294, 0x0, 0x5, 0x0, *(&v4));
} else {
*(a3) = put_host_port(a0, a2, a2);
}
}
v8 = v2 ^ v7[5];
return;
}
|
static int
handle_option (const char *str, struct name_elt const *ent)
{
struct wordsplit ws;
int i;
struct option_locus loc;
while (*str &&
((*__ctype_b_loc ())[(int) ((
*str
))] & (unsigned short int) _ISspace)
)
++str;
if (*str != '-')
return 1;
ws.ws_offs = 1;
if (wordsplit (str, &ws, (0x00000040 | 0x00000004 | (0x00000200|0x00000400) | 0x00000800 | 0x02000000)|0x00000002))
do { if (error_hook) error_hook (); error (0, 0, gettext ("cannot split string '%s': %s"), str, wordsplit_strerror (&ws)); fatal_exit (); } while (0)
;
ws.ws_wordv[0] = (char *) program_name;
loc.source = OPTS_FILE;
loc.name = ent->v.file.name;
loc.line = ent->v.file.line;
more_options (ws.ws_wordc+ws.ws_offs, ws.ws_wordv, &loc);
for (i = 0; i < ws.ws_wordc+ws.ws_offs; i++)
ws.ws_wordv[i] =
((void *)0)
;
wordsplit_free (&ws);
return 0;
}
| long handle_option(_BYTE *a1, long a2)
{
long v3;
char *v4;
int i;
int v7;
long v8;
long v9;
long v10;
_QWORD *v11;
long v12;
unsigned long v13;
v13 = __readfsqword(0x28u);
while ( *a1 && ((*_ctype_b_loc())[(char)*a1] & 0x2000) != 0 )
++a1;
if ( *a1 != 45 )
return 1LL;
v12 = 1LL;
if ( (unsigned int)wordsplit(a1, &v10, 33558086LL) )
{
if ( error_hook )
error_hook();
v3 = wordsplit_strerror(&v10);
v4 = gettext("cannot split string '%s': %s");
error(0, 0, v4, a1, v3);
fatal_exit();
}
*v11 = program_name;
v7 = 2;
v8 = *(_QWORD *)(a2 + 24);
v9 = *(_QWORD *)(a2 + 32);
more_options((unsigned int)(v10 + v12), v11, &v7);
for ( i = 0; i < (unsigned long)(v10 + v12); ++i )
v11[i] = 0LL;
wordsplit_free(&v10);
return 0LL;
}
|
static float
estimate_timestamp_success_rate (time_t when)
{
int num_days = (options.cur_day_start.tv_sec - when) / 86400;
return estimate_file_age_success_rate (num_days);
}
| void estimate_timestamp_success_rate(long param_1)
{
estimate_file_age_success_rate((float)(int)((_getfileconat - param_1) / 0x15180));
return;
}
|
static int dict_de_cf_cmp(const void *cmp_ctx, const void *a, const void *b)
{
const struct ext2fs_nls_table *tbl = cmp_ctx;
const struct ext2_dir_entry *de_a, *de_b;
int a_len, b_len;
de_a = (const struct ext2_dir_entry *) a;
a_len = ext2fs_dirent_name_len(de_a);
de_b = (const struct ext2_dir_entry *) b;
b_len = ext2fs_dirent_name_len(de_b);
return ext2fs_casefold_cmp(tbl,
(const unsigned char *) de_a->name, a_len,
(const unsigned char *) de_b->name, b_len);
}
| void dict_de_cf_cmp(undefined8 param_1,long param_2,long param_3)
{
int iVar1;
int iVar2;
iVar1 = ext2fs_dirent_name_len(param_2);
iVar2 = ext2fs_dirent_name_len(param_3);
ext2fs_casefold_cmp(param_1,param_2 + 8,(long)iVar1,param_3 + 8,(long)iVar2);
return;
}
|
static inline int
is_basic (char c)
{
return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31))
& 1;
}
| uint is_basic(byte param_1)
{
return *(uint *)(&is_basic_table + (long)(int)(uint)(param_1 >> 5) * 4) >> (param_1 & 0x1f) & 1;
}
|
int
rl_quoted_insert (int count, int key)
{
if ((rl_readline_state & (0x0080000)) == 0)
_rl_disable_tty_signals ();
if ((rl_readline_state & (0x0080000)))
{
_rl_callback_data = _rl_callback_data_alloc (count);
_rl_callback_func = _rl_insert_next_callback;
return (0);
}
if (count < 0)
{
int r;
do
r = _rl_insert_next (1);
while (r == 0 && ++count < 0);
return r;
}
return _rl_insert_next (count);
}
| long long rl_quoted_insert(unsigned long a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
void* v4;
v1 = a0;
v0 = a1;
if (!(rl_readline_state & 0x80000))
_rl_disable_tty_signals();
if ((rl_readline_state & 0x80000)) {
_rl_callback_data = _rl_callback_data_alloc(v1);
_rl_callback_func = _rl_insert_next_callback;
v4 = 0;
} else if (v1 < 0) {
do {
v2 = _rl_insert_next(0x1);
if (v2)
break;
v1 += 1;
} while (v1 < 0);
v4 = v2;
} else {
v4 = _rl_insert_next(v1);
}
return v4;
}
|
static inline __u32 rta_getattr_u32(const struct rtattr *rta)
{
return *(__u32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| long rta_getattr_u32(long a1)
{
return *(unsigned int *)(a1 + 4);
}
|
static char *
history_find_word (char *line, int ind)
{
char **words, *s;
int i, wind;
words = history_tokenize_internal (line, ind, &wind);
if (wind == -1 || words == 0)
{
if (words)
freewords (words, 0);
if (words) free (words);
return ((char *)
((void *)0)
);
}
s = words[wind];
for (i = 0; i < wind; i++)
xfree (words[i]);
freewords (words, wind + 1);
xfree (words);
return s;
}
| int history_find_word(unsigned long long a0, unsigned long a1) {
char v0;
unsigned int v1;
unsigned long long *v2;
unsigned long v3;
unsigned int v5;
v2 = history_tokenize_internal(a0, a1, &v0);
if (*(&v0) != -1 && v2) {
v3 = v2[*(&v0)];
for (v1 = 0; v1 < *(&v0); v1 += 1) {
xfree(v2[v1]);
}
freewords(v2, *(&v0) + 1);
xfree(v2);
v5 = v3;
}
if (!v2 || *(&v0) == -1) {
if (v2)
freewords(v2, 0x0);
if (v2)
free(v2);
v5 = 0;
}
return v5;
}
|
int
sshsig_sign_fd(struct sshkey *key, const char *hashalg,
const char *sk_provider, const char *sk_pin,
int fd, const char *sig_namespace, struct sshbuf **out,
sshsig_signer *signer, void *signer_ctx)
{
struct sshbuf *b =
((void *)0)
;
int r = -1;
if (hashalg ==
((void *)0)
)
hashalg = "sha512";
if (out !=
((void *)0)
)
*out =
((void *)0)
;
if ((r = hash_file(fd, hashalg, &b)) != 0) {
sshlog("sshsig.c", __func__, 573, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "hash_file");
return r;
}
if ((r = sshsig_wrap_sign(key, hashalg, sk_provider, sk_pin, b,
sig_namespace, out, signer, signer_ctx)) != 0)
goto out;
r = 0;
out:
sshbuf_free(b);
return r;
}
| long long sshsig_sign_fd(unsigned int *a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long a4, unsigned long long a5, unsigned int v6, unsigned int a6, unsigned int a7) {
unsigned int v0;
unsigned int v1;
unsigned long long *v2;
unsigned long long v3;
unsigned int v4;
void* v5;
unsigned long long v7;
v3 = a1;
v2 = *(&v6);
*(&v1) = *(&a6);
*(&v0) = *(&a7);
v5 = 0;
v4 = -1;
if (!v3)
v3 = "sha512";
if (v2)
*(v2) = 0;
v4 = hash_file(a4, v3, &v5);
if (v4) {
sshlog("sshsig.c", "sshsig_sign_fd", 0x23d, 0x1, 0x2, ssh_err(v4));
v7 = v4;
} else {
v4 = sshsig_wrap_sign(a0, v3, a2, a3, v5, a5, v2, *(&v1), *(&v0));
if (!v4)
v4 = 0;
sshbuf_free(v5);
v7 = v4;
}
return v7;
}
|
static
void testf ( Char *name )
{
FILE *inStr;
Bool allOK;
struct stat statBuf;
deleteOutputOnInterrupt = ((Bool)0);
if (name ==
((void *)0)
&& srcMode != 1)
panic ( "testf: bad modes\n" );
copyFileName ( outName, (Char*)"(none)" );
switch (srcMode) {
case 1: copyFileName ( inName, (Char*)"(stdin)" ); break;
case 3: copyFileName ( inName, name ); break;
case 2: copyFileName ( inName, name ); break;
}
if ( srcMode != 1 && containsDubiousChars ( inName ) ) {
if (noisy)
fprintf (
stderr
, "%s: There are no files matching `%s'.\n",
progName, inName );
setExit(1);
return;
}
if ( srcMode != 1 && !fileExists ( inName ) ) {
fprintf (
stderr
, "%s: Can't open input %s: %s.\n",
progName, inName, strerror(
(*__errno_location ())
) );
setExit(1);
return;
}
if ( srcMode != 1 ) {
stat(inName, &statBuf);
if (
((((
statBuf.st_mode
)) & 0170000) == (0040000))
) {
fprintf(
stderr
,
"%s: Input file %s is a directory.\n",
progName,inName);
setExit(1);
return;
}
}
switch ( srcMode ) {
case 1:
if ( isatty ( fileno (
stdin
) ) ) {
fprintf (
stderr
,
"%s: I won't read compressed data from a terminal.\n",
progName );
fprintf (
stderr
, "%s: For help, type: `%s --help'.\n",
progName, progName );
setExit(1);
return;
};
inStr =
stdin
;
break;
case 2: case 3:
inStr = fopen ( inName, "rb" );
if ( inStr ==
((void *)0)
) {
fprintf (
stderr
, "%s: Can't open input file %s:%s.\n",
progName, inName, strerror(
(*__errno_location ())
) );
setExit(1);
return;
};
break;
default:
panic ( "testf: bad srcMode" );
break;
}
if (verbosity >= 1) {
fprintf (
stderr
, " %s: ", inName );
pad ( inName );
fflush (
stderr
);
}
outputHandleJustInCase =
((void *)0)
;
allOK = testStream ( inStr );
if (allOK && verbosity >= 1) fprintf (
stderr
, "ok\n" );
if (!allOK) testFailsExist = ((Bool)1);
}
| unsigned long testf(const char *a1)
{
int *v1;
char *v2;
int v3;
FILE *v4;
int *v5;
char *v6;
char v8;
FILE *v9;
struct stat v10;
unsigned long v11;
v11 = __readfsqword(0x28u);
deleteOutputOnInterrupt = 0;
if ( !a1 && srcMode != 1 )
panic("testf: bad modes\n");
copyFileName(outName, "(none)");
if ( srcMode == 3 )
{
LABEL_10:
copyFileName(inName, a1);
goto LABEL_11;
}
if ( srcMode <= 3 )
{
if ( srcMode != 1 )
{
if ( srcMode != 2 )
goto LABEL_11;
goto LABEL_10;
}
copyFileName(inName, "(stdin)");
}
LABEL_11:
if ( srcMode == 1 || !(unsigned char)containsDubiousChars() )
{
if ( srcMode == 1 || fileExists(inName) )
{
if ( srcMode == 1 || (stat(inName, &v10), (v10.st_mode & 0xF000) != 0x4000) )
{
if ( srcMode == 1 )
{
v3 = fileno(stdin);
if ( isatty(v3) )
{
fprintf(stderr, "%s: I won't read compressed data from a terminal.\n", progName);
fprintf(stderr, "%s: For help, type: `%s --help'.\n", progName, progName);
setExit(1u);
return v11 - __readfsqword(0x28u);
}
v9 = stdin;
}
else
{
if ( srcMode <= 0 || (unsigned int)(srcMode - 2) > 1 )
panic("testf: bad srcMode");
v4 = fopen(inName, "rb");
v9 = v4;
if ( !v4 )
{
v5 = _errno_location();
v6 = strerror(*v5);
fprintf(stderr, "%s: Can't open input file %s:%s.\n", progName, inName, v6);
setExit(1u);
return v11 - __readfsqword(0x28u);
}
}
if ( verbosity > 0 )
{
fprintf(stderr, " %s: ", inName);
pad(inName);
fflush(stderr);
}
outputHandleJustInCase = 0LL;
v8 = testStream(v9);
if ( v8 && verbosity > 0 )
fprintf(stderr, "ok\n");
if ( !v8 )
testFailsExist = 1;
}
else
{
fprintf(stderr, "%s: Input file %s is a directory.\n", progName, inName);
setExit(1u);
}
}
else
{
v1 = _errno_location();
v2 = strerror(*v1);
fprintf(stderr, "%s: Can't open input %s: %s.\n", progName, inName, v2);
setExit(1u);
}
}
else
{
if ( noisy )
fprintf(stderr, "%s: There are no files matching `%s'.\n", progName, inName);
setExit(1u);
}
return v11 - __readfsqword(0x28u);
}
|
static void print_explain(struct link_util *lu, FILE *f)
{
fprintf(f,
"Usage: ... %s [ mode MODE ] [ FLAGS ]\n"
"\n"
"MODE: l3 | l3s | l2\n"
"FLAGS: bridge | private | vepa\n"
"(first values are the defaults if nothing is specified).\n",
lu->id);
}
| int print_explain(long a1, FILE *a2)
{
return fprintf(
a2,
"Usage: ... %s [ mode MODE ] [ FLAGS ]\n"
"\n"
"MODE: l3 | l3s | l2\n"
"FLAGS: bridge | private | vepa\n"
"(first values are the defaults if nothing is specified).\n",
*(const char **)(a1 + 8));
}
|
static int mode_arg(const char *arg)
{
fprintf(
stderr
,
"Error: argument of \"mode\" must be \"private\", \"vepa\", \"bridge\", \"passthru\" or \"source\", not \"%s\"\n",
arg);
return -1;
}
| void mode_arg(unsigned long a0) {
unsigned long long v1;
fprintf(stderr, "Error: argument of \"mode\" must be \"private\", \"vepa\", \"bridge\", \"passthru\" or \"source\", not \"%s\"\n", a0);
v1 = 4294967295;
return;
}
|
int
channel_setup_remote_fwd_listener(struct ssh *ssh, struct Forward *fwd,
int *allocated_listen_port, struct ForwardOptions *fwd_opts)
{
if (!check_rfwd_permission(ssh, fwd)) {
ssh_packet_send_debug(ssh, "port forwarding refused");
if (fwd->listen_path !=
((void *)0)
)
sshlog("channels.c", __func__, 4032, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Received request from %.100s port %d to " "remote forward to path \"%.100s\", " "but the request was denied.", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), fwd->listen_path)
;
else if(fwd->listen_host !=
((void *)0)
)
sshlog("channels.c", __func__, 4038, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Received request from %.100s port %d to " "remote forward to host %.100s port %d, " "but the request was denied.", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), fwd->listen_host, fwd->listen_port)
;
else
sshlog("channels.c", __func__, 4044, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Received request from %.100s port %d to remote " "forward, but the request was denied.", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh))
;
return 0;
}
if (fwd->listen_path !=
((void *)0)
) {
return channel_setup_fwd_listener_streamlocal(ssh,
19, fwd, fwd_opts);
} else {
return channel_setup_fwd_listener_tcpip(ssh,
11, fwd, allocated_listen_port,
fwd_opts);
}
}
| long long channel_setup_remote_fwd_listener(void* a0, struct_0 *a1, unsigned int *a2, unsigned int *a3) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
void* v5;
unsigned long long v6;
if (!check_rfwd_permission(a0, a1)) {
ssh_packet_send_debug(a0, "port forwarding refused", a2);
if (a1->field_10) {
v3 = a1->field_10;
v2 = ssh_remote_port(a0);
v1 = ssh_remote_ipaddr(a0);
sshlog("channels.c", "channel_setup_remote_fwd_listener", 0xfc0, 0x0, 0x3, 0x0, "Received request from %.100s port %d to remote forward to path \"%.100s\", but the request was denied.");
v5 = 0;
return v5;
}
if (a1->field_0) {
v6 = ssh_remote_port(a0);
v2 = a1->field_8;
v1 = a1->field_0;
v0 = ssh_remote_ipaddr(a0);
sshlog("channels.c", "channel_setup_remote_fwd_listener", 0xfc6, 0x0, 0x3, 0x0, "Received request from %.100s port %d to remote forward to host %.100s port %d, but the request was denied.");
v5 = 0;
return v5;
}
v2 = ssh_remote_port(a0);
v1 = ssh_remote_ipaddr(a0);
sshlog("channels.c", "channel_setup_remote_fwd_listener", 0xfcc, 0x0, 0x3, 0x0, "Received request from %.100s port %d to remote forward, but the request was denied.");
v5 = 0;
return v5;
} else if (a1->field_10) {
v5 = channel_setup_fwd_listener_streamlocal(a0, 0x13, a1, a3);
return v5;
} else {
v5 = channel_setup_fwd_listener_tcpip(a0, 0xb, a1, a2, a3);
return v5;
}
}
|
static rsRetVal
rsyslogd_InitGlobalClasses(void)
{
rsRetVal iRet = RS_RET_OK;
const char *pErrObj;
pErrObj = "rsyslog runtime";
if((iRet = rsrtInit(&pErrObj, &obj)) != RS_RET_OK) goto finalize_it;
rsrtSetErrLogger(rsyslogd_submitErrMsg);
pErrObj = "glbl";
if((iRet = obj.UseObj("rsyslogd.c", (uchar*)"glbl", (uchar*)
((void *)0)
, (void*) &glbl)) != RS_RET_OK) goto finalize_it;
pErrObj = "module";
if((iRet = obj.UseObj("rsyslogd.c", (uchar*)"module", (uchar*)
((void *)0)
, (void*) &module)) != RS_RET_OK) goto finalize_it;
pErrObj = "datetime";
if((iRet = obj.UseObj("rsyslogd.c", (uchar*)"datetime", (uchar*)
((void *)0)
, (void*) &datetime)) != RS_RET_OK) goto finalize_it;
pErrObj = "ruleset";
if((iRet = obj.UseObj("rsyslogd.c", (uchar*)"ruleset", (uchar*)
((void *)0)
, (void*) &ruleset)) != RS_RET_OK) goto finalize_it;
pErrObj = "prop";
if((iRet = obj.UseObj("rsyslogd.c", (uchar*)"prop", (uchar*)
((void *)0)
, (void*) &prop)) != RS_RET_OK) goto finalize_it;
pErrObj = "parser";
if((iRet = obj.UseObj("rsyslogd.c", (uchar*)"parser", (uchar*)
((void *)0)
, (void*) &parser)) != RS_RET_OK) goto finalize_it;
pErrObj = "rsconf";
if((iRet = obj.UseObj("rsyslogd.c", (uchar*)"rsconf", (uchar*)
((void *)0)
, (void*) &rsconf)) != RS_RET_OK) goto finalize_it;
pErrObj = "action";
if((iRet = actionClassInit()) != RS_RET_OK) goto finalize_it;
pErrObj = "template";
if((iRet = templateInit()) != RS_RET_OK) goto finalize_it;
pErrObj = "net";
if((iRet = obj.UseObj("rsyslogd.c", (uchar*)"net", (uchar*)"lmnet", (void*) &net)) != RS_RET_OK) goto finalize_it;
dnscacheInit();
initRainerscript();
ratelimitModInit();
if((iRet = prop.Construct(&pInternalInputName)) != RS_RET_OK) goto finalize_it;
if((iRet = prop.SetString(pInternalInputName, ((uchar*) ("rsyslogd")), sizeof("rsyslogd") - 1)) != RS_RET_OK) goto finalize_it;
if((iRet = prop.ConstructFinalize(pInternalInputName)) != RS_RET_OK) goto finalize_it;
finalize_it:
if(iRet != RS_RET_OK) {
fprintf(
stderr
, "Error during class init for object '%s' - failing...\n", pErrObj);
fprintf(
stderr
, "rsyslogd initialization failed - global classes could not be initialized.\n"
"Did you do a \"make install\"?\n"
"Suggested action: run rsyslogd with -d -n options to see what exactly "
"fails.\n");
}
return iRet;
}
| int rsyslogd_InitGlobalClasses(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned long long v1;
v0 = 0;
v1 = "rsyslog runtime";
v0 = rsrtInit(&v1, &obj);
if (!v0) {
rsrtSetErrLogger(rsyslogd_submitErrMsg);
v1 = "glbl";
v0 = *(4211432)("rsyslogd.c", "glbl", 0, "\n");
if (!v0) {
v1 = "module";
v0 = *(4211432)("rsyslogd.c", "module", 0, &module);
if (!v0) {
v1 = "datetime";
v0 = *(4211432)("rsyslogd.c", "datetime", 0, &datetime);
if (!v0) {
v1 = "ruleset";
v0 = *(4211432)("rsyslogd.c", "ruleset", 0, &ruleset);
if (!v0) {
v1 = "prop";
v0 = *(4211432)("rsyslogd.c", "prop", 0, &prop);
if (!v0) {
v1 = "parser";
v0 = *(4211432)("rsyslogd.c", "parser", 0, &parser);
if (!v0) {
v1 = "rsconf";
v0 = *(4211432)("rsyslogd.c", "rsconf", 0, &rsconf);
if (!v0) {
v1 = "action";
v0 = actionClassInit();
if (!v0) {
v1 = "template";
v0 = templateInit();
if (!v0) {
v1 = "net";
v0 = *(4211432)("rsyslogd.c", "net", "lmnet", "\n");
if (!v0) {
dnscacheInit();
initRainerscript("rsyslogd.c", "net", "lmnet", "\n", a4, a5);
ratelimitModInit("rsyslogd.c", "net", "lmnet", "\n", a4, a5);
v0 = *(4211568)(&pInternalInputName);
if (!v0) {
v0 = g_404388(pInternalInputName, "rsyslogd", 8, g_404388);
if (!v0)
v0 = *(4211576)(pInternalInputName);
}
}
}
}
}
}
}
}
}
}
}
}
if (v0) {
fprintf(stderr, "Error during class init for object '%s' - failing...\n", v1);
fprintf(stderr, "rsyslogd initialization failed - global classes could not be initialized.\nDid you do a \"make install\"?\nSuggested action: run rsyslogd with -d -n options to see what exactly fails.\n");
return v0;
}
return v0;
}
|
static void usage(void)
{
fprintf(
stderr
,
"Usage: ip ntable change name NAME [ dev DEV ]\n"
" [ thresh1 VAL ] [ thresh2 VAL ] [ thresh3 VAL ] [ gc_int MSEC ]\n"
" [ PARMS ]\n"
"Usage: ip ntable show [ dev DEV ] [ name NAME ]\n"
"PARMS := [ base_reachable MSEC ] [ retrans MSEC ] [ gc_stale MSEC ]\n"
" [ delay_probe MSEC ] [ queue LEN ]\n"
" [ app_probes VAL ] [ ucast_probes VAL ] [ mcast_probes VAL ]\n"
" [ anycast_delay MSEC ] [ proxy_delay MSEC ] [ proxy_queue LEN ]\n"
" [ locktime MSEC ]\n"
);
exit(-1);
}
| void usage() {
fprintf(stderr, "Usage: ip ntable change name NAME [ dev DEV ]\n [ thresh1 VAL ] [ thresh2 VAL ] [ thresh3 VAL ] [ gc_int MSEC ]\n [ PARMS ]\nUsage: ip ntable show [ dev DEV ] [ name NAME ]\nPARMS := [ base_reachable MSEC ] [ retrans MSEC ] [ gc_stale MSEC ]\n [ delay_probe MSEC ] [ queue LEN ]\n [ app_probes VAL ] [ ucast_probes VAL ] [ mcast_probes VAL ]\n [ anycast_delay MSEC ] [ proxy_delay MSEC ] [ proxy_queue LEN ]\n [ locktime MSEC ]\n");
exit(0xffffffff);
}
|
static void
format_ifdef (char const *format, lin beg0, lin end0, lin beg1, lin end1)
{
struct group groups[2];
groups[0].file = &files[0];
groups[0].from = beg0;
groups[0].upto = end0;
groups[1].file = &files[1];
groups[1].from = beg1;
groups[1].upto = end1;
format_group (outfile, format, 0, groups);
}
| void format_ifdef(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4) {
unsigned long long v0;
unsigned long v1;
unsigned long v2;
unsigned long long v3;
unsigned long v4;
unsigned long v5;
char v6;
unsigned long long *v8;
unsigned long long v9;
v0 = &files;
v1 = a1;
v2 = a2;
v3 = 5243184;
v4 = a3;
v5 = a4;
format_group(outfile, a0, 0x0, &v0);
v9 = *(&v6) ^ v8[5];
return;
}
|
static char *update_crypt_pw (char *cp)
{
if (do_update_pwd) {
cp = xstrdup (crypt_passwd);
}
if (dflg) {
*cp = '\0';
}
if (uflg && *cp == '!') {
if (cp[1] == '\0') {
(void) fprintf (
stderr
,
gettext ("%s: unlocking the password would result in a passwordless account.\n" "You should set a password with usermod -p to unlock the password of this account.\n")
,
Prog);
fail_exit (3);
} else {
cp++;
}
}
if (lflg && *cp != '!') {
char *newpw = xmalloc (strlen (cp) + 2);
strcpy (newpw, "!");
strcat (newpw, cp);
if (do_update_pwd) {
free (cp);
}
cp = newpw;
}
return cp;
}
| char * update_crypt_pw(long a1)
{
long v1;
char *v2;
size_t v3;
char *dest;
if ( do_update_pwd )
a1 = xstrdup(&crypt_passwd);
if ( dflg )
*(_BYTE *)a1 = 0;
if ( uflg && *(_BYTE *)a1 == 33 )
{
if ( !*(_BYTE *)(a1 + 1) )
{
v1 = Prog;
v2 = gettext(
"%s: unlocking the password would result in a passwordless account.\n"
"You should set a password with usermod -p to unlock the password of this account.\n");
fprintf(stderr, v2, v1);
fail_exit(3);
}
++a1;
}
if ( lflg && *(_BYTE *)a1 != 33 )
{
v3 = strlen((const char *)a1);
dest = (char *)xmalloc(v3 + 2);
strcpy(dest, "!");
strcat(dest, (const char *)a1);
if ( do_update_pwd )
free((void *)a1);
return dest;
}
return (char *)a1;
}
|
static gnutls_datum_t wrap_db_fetch(void *dbf, gnutls_datum_t key)
{
gnutls_datum_t res = {
((void *)0)
, 0 };
time_t now = time(0);
int i;
for (i = 0; i < cache_db_ptr; i++) {
if (key.size == cache_db[i].session_id_size &&
memcmp(key.data, cache_db[i].session_id,
key.size) == 0 &&
now < gnutls_db_check_entry_expire_time(&cache_db[i].
session_data)) {
res.size = cache_db[i].session_data.size;
res.data = malloc(res.size);
if (res.data ==
((void *)0)
)
return res;
memcpy(res.data, cache_db[i].session_data.data,
res.size);
return res;
}
}
return res;
}
| long long wrap_db_fetch(unsigned long a0, void* a1, unsigned long a2) {
unsigned long v0;
unsigned long v1;
unsigned int v2;
unsigned long v3;
void* v4;
unsigned int v5;
void* v7;
v1 = a0;
v0 = a2;
v4 = 0;
v5 = 0;
v3 = time(NULL);
v2 = 0;
while (true) {
if (v2 >= cache_db_ptr) {
v7 = v4;
return v7;
}
if (!(v0 != *(((((v2 << 3) + v2 << 1) + v2 << 3) + cache_db + 128))) && !(memcmp(a1, (((v2 << 3) + v2 << 1) + v2 << 3) + cache_db, v0)) && !(v3 >= gnutls_db_check_entry_expire_time((((v2 << 3) + v2 << 1) + v2 << 3) + cache_db + 136)))
break;
v2 += 1;
}
v5 = *((v2 * 152 + cache_db + 144));
v4 = malloc(v5);
if (!v4) {
v7 = v4;
return v7;
}
memcpy(v4, *((v2 * 152 + cache_db + 136)), v5);
v7 = v4;
return v7;
}
|
0
)
do { fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
| int fprintf(FILE *__stream,char *__format,...)
{
halt_baddata();
}
|
int
do_copy(struct sftp_conn *conn, const char *oldpath, const char *newpath)
{
Attrib junk, *a;
struct sshbuf *msg;
u_char *old_handle, *new_handle;
u_int mode, status, id;
size_t old_handle_len, new_handle_len;
int r;
if ((conn->exts & 0x00000100) == 0) {
sshlog("sftp-client.c", __func__, 1104, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Server does not support copy-data extension");
return -1;
}
if ((a = do_stat(conn, oldpath, 0)) ==
((void *)0)
)
return -1;
if (a->flags & 0x00000004) {
mode = a->perm & 0777;
if (!
((((
a->perm
)) & 0170000) == (0100000))
) {
sshlog("sftp-client.c", __func__, 1117, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Cannot copy non-regular file: %s", oldpath);
return -1;
}
} else {
mode = 0666;
}
attrib_clear(a);
a->perm = mode;
a->flags |= 0x00000004;
if ((msg = sshbuf_new()) ==
((void *)0)
)
sshfatal("sftp-client.c", __func__, 1131, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: sshbuf_new failed", __func__);
attrib_clear(&junk);
id = conn->msg_id++;
if ((r = sshbuf_put_u8(msg, 3)) != 0 ||
(r = sshbuf_put_u32(msg, id)) != 0 ||
(r = sshbuf_put_cstring(msg, oldpath)) != 0 ||
(r = sshbuf_put_u32(msg, 0x00000001)) != 0 ||
(r = encode_attrib(msg, &junk)) != 0)
sshfatal("sftp-client.c", __func__, 1142, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: buffer error: %s", __func__, ssh_err(r));
send_msg(conn, msg);
sshlog("sftp-client.c", __func__, 1144, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "Sent message SSH2_FXP_OPEN I:%u P:%s", id, oldpath);
sshbuf_reset(msg);
old_handle = get_handle(conn, id, &old_handle_len,
"remote open(\"%s\")", oldpath);
if (old_handle ==
((void *)0)
) {
sshbuf_free(msg);
return -1;
}
id = conn->msg_id++;
if ((r = sshbuf_put_u8(msg, 3)) != 0 ||
(r = sshbuf_put_u32(msg, id)) != 0 ||
(r = sshbuf_put_cstring(msg, newpath)) != 0 ||
(r = sshbuf_put_u32(msg, 0x00000002|0x00000008|
0x00000010)) != 0 ||
(r = encode_attrib(msg, a)) != 0)
sshfatal("sftp-client.c", __func__, 1163, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: buffer error: %s", __func__, ssh_err(r));
send_msg(conn, msg);
sshlog("sftp-client.c", __func__, 1165, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "Sent message SSH2_FXP_OPEN I:%u P:%s", id, newpath);
sshbuf_reset(msg);
new_handle = get_handle(conn, id, &new_handle_len,
"remote open(\"%s\")", newpath);
if (new_handle ==
((void *)0)
) {
sshbuf_free(msg);
free(old_handle);
return -1;
}
id = conn->msg_id++;
if ((r = sshbuf_put_u8(msg, 200)) != 0 ||
(r = sshbuf_put_u32(msg, id)) != 0 ||
(r = sshbuf_put_cstring(msg, "copy-data")) != 0 ||
(r = sshbuf_put_string(msg, old_handle, old_handle_len)) != 0 ||
(r = sshbuf_put_u64(msg, 0)) != 0 ||
(r = sshbuf_put_u64(msg, 0)) != 0 ||
(r = sshbuf_put_string(msg, new_handle, new_handle_len)) != 0 ||
(r = sshbuf_put_u64(msg, 0)) != 0)
sshfatal("sftp-client.c", __func__, 1187, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: buffer error: %s", __func__, ssh_err(r));
send_msg(conn, msg);
sshlog("sftp-client.c", __func__, 1189, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "Sent message copy-data \"%s\" 0 0 -> \"%s\" 0", oldpath, newpath)
;
status = get_status(conn, id);
if (status != 0)
sshlog("sftp-client.c", __func__, 1194, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Couldn't copy file \"%s\" to \"%s\": %s", oldpath, newpath, fx2txt(status))
;
sshbuf_free(msg);
do_close(conn, old_handle, old_handle_len);
do_close(conn, new_handle, new_handle_len);
free(old_handle);
free(new_handle);
return status == 0 ? 0 : -1;
}
| long long do_copy(unsigned int a0[8], unsigned long a1, unsigned long a2) {
unsigned long v0;
int tmp_14;
unsigned int v1[8];
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
char v6;
char v7;
unsigned int v8[7];
unsigned long long v9;
void* v10;
void* v11;
char v12;
unsigned long long v13;
unsigned long v14;
unsigned long v15;
unsigned long v16;
char v17;
unsigned long long v19;
*(&v1[0]) = a0;
if (!(a0[7] & 0x100)) {
sshlog("sftp-client.c", "do_copy", 0x450, 0x0, 0x2, 0x0, "Server does not support copy-data extension");
v19 = 4294967295;
} else {
*(&v8[0]) = do_stat(a0, a1, 0x0);
if (!v8) {
v19 = 4294967295;
} else {
if (!(v8[0] & 4)) {
v2 = 438;
} else {
v2 = v8[6] & 511;
if ((v8[6] & 0xf000) != 0x8000) {
v0 = a1;
sshlog("sftp-client.c", "do_copy", 0x45d, 0x0, 0x2, 0x0, "Cannot copy non-regular file: %s");
v19 = 4294967295;
goto LABEL_40497a;
}
}
attrib_clear(v8);
v8[6] = v2;
v8[0] = v8[0] | 4;
v9 = sshbuf_new();
if (!v9) {
v0 = "do_copy";
sshfatal("sftp-client.c", "do_copy", 0x46b, 0x0, 0x1, 0x0, "%s: sshbuf_new failed");
}
attrib_clear(&v12);
tmp_14 = a0[6];
a0[6] = a0[6] + 1;
v4 = tmp_14;
v3 = sshbuf_put_u8(v9, 0x3, a0);
if (!v3) {
v3 = sshbuf_put_u32(v9, v4, v4);
if (!v3) {
v3 = sshbuf_put_cstring(v9, a1);
if (!v3) {
v3 = sshbuf_put_u32(v9, 0x1, a2);
if (!v3) {
v3 = encode_attrib(v9, &v12, &v12);
if (!v3)
goto LABEL_4044b3;
}
}
}
}
v15 = ssh_err(v3);
v14 = "do_copy";
v13 = "%s: buffer error: %s";
sshfatal("sftp-client.c", "do_copy", 0x476, 0x0, 0x1, 0x0, *(&v17));
LABEL_4044b3:
send_msg(a0, v9);
v15 = a1;
v14 = v4;
v13 = "Sent message SSH2_FXP_OPEN I:%u P:%s";
sshlog("sftp-client.c", "do_copy", 0x478, 0x0, 0x7, 0x0, *(&v17));
sshbuf_reset(v9);
v10 = get_handle(a0, v4, &v6, "remote open(\"%s\")", a1, 0x0);
if (!v10) {
sshbuf_free(v9);
v19 = 4294967295;
} else {
tmp_14 = a0[6];
a0[6] = a0[6] + 1;
v4 = tmp_14;
v3 = sshbuf_put_u8(v9, 0x3, a0);
if (!v3) {
v3 = sshbuf_put_u32(v9, v4, v4);
if (!v3) {
v3 = sshbuf_put_cstring(v9, a2);
if (!v3) {
v3 = sshbuf_put_u32(v9, 0x1a, v4);
if (!v3) {
v3 = encode_attrib(v9, v8, v8);
if (!v3)
goto LABEL_404648;
}
}
}
}
v15 = ssh_err(v3);
v14 = "do_copy";
v13 = "%s: buffer error: %s";
sshfatal("sftp-client.c", "do_copy", 0x48b, 0x0, 0x1, 0x0, *(&v17));
LABEL_404648:
send_msg(a0, v9);
v15 = a2;
v14 = v4;
v13 = "Sent message SSH2_FXP_OPEN I:%u P:%s";
sshlog("sftp-client.c", "do_copy", 0x48d, 0x0, 0x7, 0x0, *(&v17));
sshbuf_reset(v9);
v11 = get_handle(a0, v4, &v7, "remote open(\"%s\")", a2, 0x0);
if (!v11) {
sshbuf_free(v9);
free(v10);
v19 = 4294967295;
} else {
tmp_14 = a0[6];
a0[6] = a0[6] + 1;
v4 = tmp_14;
v3 = sshbuf_put_u8(v9, 0xc8, a0);
if (!v3) {
v3 = sshbuf_put_u32(v9, v4, v4);
if (!v3) {
v3 = sshbuf_put_cstring(v9, "copy-data");
if (!v3) {
v3 = sshbuf_put_string(v9, v10, *(&v6), v10);
if (!v3) {
v3 = sshbuf_put_u64(v9, 0x0);
if (!v3) {
v3 = sshbuf_put_u64(v9, 0x0);
if (!v3) {
v3 = sshbuf_put_string(v9, v11, *(&v7), v11);
if (!v3) {
v3 = sshbuf_put_u64(v9, 0x0);
if (!v3)
goto LABEL_404850;
}
}
}
}
}
}
}
v15 = ssh_err(v3);
v14 = "do_copy";
v13 = "%s: buffer error: %s";
sshfatal("sftp-client.c", "do_copy", 0x4a3, 0x0, 0x1, 0x0, *(&v17));
LABEL_404850:
send_msg(a0, v9);
v15 = a2;
v14 = a1;
v13 = "Sent message copy-data \"%s\" 0 0 -> \"%s\" 0";
sshlog("sftp-client.c", "do_copy", 0x4a5, 0x0, 0x7, 0x0, *(&v17));
v5 = get_status(a0, v4);
if (v5) {
v16 = fx2txt(v5);
v15 = a2;
v14 = a1;
v13 = "Couldn\'t copy file \"%s\" to \"%s\": %s";
sshlog("sftp-client.c", "do_copy", 0x4aa, 0x0, 0x2, 0x0, *(&v17));
}
sshbuf_free(v9);
do_close(a0, v10, *(&v6));
do_close(a0, v11, *(&v7));
free(v10);
free(v11);
if (!v5)
v19 = 0;
else
v19 = 4294967295;
}
}
}
}
LABEL_40497a:
return v19;
}
|
int
main (int argc, char **argv)
{
if (argc == 2)
{
;
set_program_name (argv[0]);
setlocale (
6
, "");
bindtextdomain ("coreutils", "/usr/local/share/locale");
textdomain ("coreutils");
atexit (close_stdout);
if ((strcmp (argv[1], "--help") == 0))
usage (
1
);
if ((strcmp (argv[1], "--version") == 0))
version_etc (
stdout
, "false", "GNU coreutils", Version, ("Jim Meyering"),
(char *)
((void *)0)
);
}
return
1
;
}
| int main(unsigned long a0, unsigned long long a1[2]) {
if (a0 != 2)
return 1;
set_program_name(a1[0]);
setlocale(0x6, &g_400573);
bindtextdomain("coreutils", "/usr/local/share/locale");
textdomain("coreutils");
atexit(got.close_stdout);
if (!strcmp(a1[1], "--help")) {
usage(0x1);
} else if (strcmp(a1[1], "--version")) {
return 1;
} else {
version_etc(stdout, "false", "GNU coreutils", Version, "Jim Meyering", 0x0);
return 1;
}
}
|
static void
bind_compfunc_variables (line, ind, lwords, cw, exported)
char *line;
int ind;
WORD_LIST *lwords;
int cw, exported;
{
char ibuf[(((sizeof (int) * 8) - (! ((int) 0 < (int) -1))) * 302 / 1000 + 1 + (! ((int) 0 < (int) -1))) + 1];
char *value;
SHELL_VAR *v;
size_t llen;
int c;
v = bind_variable ("COMP_LINE", line, 0);
if (v && exported)
((v)->attributes |= (0x0000001));
c = line[ind];
line[ind] = '\0';
llen = ((
(__ctype_get_mb_cur_max ())
> 1) ? (((line) && (line)[0]) ? ((line)[1] ? mbstrlen (line) : 1) : 0) : (((line) && (line)[0]) ? ((line)[1] ? ((line)[2] ? strlen(line) : 2) : 1) : 0));
line[ind] = c;
value = inttostr (llen, ibuf, sizeof(ibuf));
v = bind_int_variable ("COMP_POINT", value, 0);
if (v && exported)
((v)->attributes |= (0x0000001));
value = inttostr (rl_completion_type, ibuf, sizeof (ibuf));
v = bind_int_variable ("COMP_TYPE", value, 0);
if (v && exported)
((v)->attributes |= (0x0000001));
value = inttostr (rl_completion_invoking_key, ibuf, sizeof (ibuf));
v = bind_int_variable ("COMP_KEY", value, 0);
if (v && exported)
((v)->attributes |= (0x0000001));
if (exported == 0)
{
v = bind_comp_words (lwords);
value = inttostr (cw, ibuf, sizeof(ibuf));
bind_int_variable ("COMP_CWORD", value, 0);
}
else
array_needs_making = 1;
}
| unsigned long bind_compfunc_variables(long a1, int a2, long a3, int a4, int a5)
{
size_t v5;
char v10;
long v11;
long v12;
long v13;
long v14;
long v15;
long v16;
long v17;
long v18;
char v19[12];
unsigned long v20;
v20 = __readfsqword(0x28u);
v11 = bind_variable("COMP_LINE", a1, 0LL);
if ( v11 && a5 )
*(_DWORD *)(v11 + 40) |= 1u;
v10 = *(_BYTE *)(a2 + a1);
*(_BYTE *)(a2 + a1) = 0;
if ( _ctype_get_mb_cur_max() <= 1 )
{
if ( a1 && *(_BYTE *)a1 )
{
if ( *(_BYTE *)(a1 + 1) )
{
if ( *(_BYTE *)(a1 + 2) )
v5 = strlen((const char *)a1);
else
v5 = 2LL;
}
else
{
v5 = 1LL;
}
}
else
{
v5 = 0LL;
}
}
else if ( a1 && *(_BYTE *)a1 )
{
if ( *(_BYTE *)(a1 + 1) )
v5 = mbstrlen(a1);
else
v5 = 1LL;
}
else
{
v5 = 0LL;
}
*(_BYTE *)(a2 + a1) = v10;
v15 = inttostr(v5, v19, 12LL);
v12 = bind_int_variable("COMP_POINT", v15, 0LL);
if ( v12 && a5 )
*(_DWORD *)(v12 + 40) |= 1u;
v16 = inttostr(rl_completion_type, v19, 12LL);
v13 = bind_int_variable("COMP_TYPE", v16, 0LL);
if ( v13 && a5 )
*(_DWORD *)(v13 + 40) |= 1u;
v17 = inttostr(rl_completion_invoking_key, v19, 12LL);
v14 = bind_int_variable("COMP_KEY", v17, 0LL);
if ( v14 && a5 )
*(_DWORD *)(v14 + 40) |= 1u;
if ( a5 )
{
array_needs_making = 1;
}
else
{
bind_comp_words(a3);
v18 = inttostr(a4, v19, 12LL);
bind_int_variable("COMP_CWORD", v18, 0LL);
}
return __readfsqword(0x28u) ^ v20;
}
|
static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
struct br_boolopt_multi bm = {};
__u32 val;
while (argc > 0) {
if (matches(*argv, "forward_delay") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&val, *argv, 0))
invarg("invalid forward_delay", *argv);
addattr32(n, 1024, IFLA_BR_FORWARD_DELAY, val);
} else if (matches(*argv, "hello_time") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&val, *argv, 0))
invarg("invalid hello_time", *argv);
addattr32(n, 1024, IFLA_BR_HELLO_TIME, val);
} else if (matches(*argv, "max_age") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&val, *argv, 0))
invarg("invalid max_age", *argv);
addattr32(n, 1024, IFLA_BR_MAX_AGE, val);
} else if (matches(*argv, "ageing_time") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&val, *argv, 0))
invarg("invalid ageing_time", *argv);
addattr32(n, 1024, IFLA_BR_AGEING_TIME, val);
} else if (matches(*argv, "stp_state") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&val, *argv, 0))
invarg("invalid stp_state", *argv);
addattr32(n, 1024, IFLA_BR_STP_STATE, val);
} else if (matches(*argv, "priority") == 0) {
__u16 prio;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u16(&prio, *argv, 0))
invarg("invalid priority", *argv);
addattr16(n, 1024, IFLA_BR_PRIORITY, prio);
} else if (matches(*argv, "vlan_filtering") == 0) {
__u8 vlan_filter;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&vlan_filter, *argv, 0))
invarg("invalid vlan_filtering", *argv);
addattr8(n, 1024, IFLA_BR_VLAN_FILTERING, vlan_filter);
} else if (matches(*argv, "vlan_protocol") == 0) {
__u16 vlan_proto;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (ll_proto_a2n(&vlan_proto, *argv))
invarg("invalid vlan_protocol", *argv);
addattr16(n, 1024, IFLA_BR_VLAN_PROTOCOL, vlan_proto);
} else if (matches(*argv, "group_fwd_mask") == 0) {
__u16 fwd_mask;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u16(&fwd_mask, *argv, 0))
invarg("invalid group_fwd_mask", *argv);
addattr16(n, 1024, IFLA_BR_GROUP_FWD_MASK, fwd_mask);
} else if (matches(*argv, "group_address") == 0) {
char llabuf[32];
int len;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
len = ll_addr_a2n(llabuf, sizeof(llabuf), *argv);
if (len < 0)
return -1;
addattr_l(n, 1024, IFLA_BR_GROUP_ADDR, llabuf, len);
} else if (matches(*argv, "fdb_flush") == 0) {
addattr(n, 1024, IFLA_BR_FDB_FLUSH);
} else if (matches(*argv, "vlan_default_pvid") == 0) {
__u16 default_pvid;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u16(&default_pvid, *argv, 0))
invarg("invalid vlan_default_pvid", *argv);
addattr16(n, 1024, IFLA_BR_VLAN_DEFAULT_PVID,
default_pvid);
} else if (matches(*argv, "vlan_stats_enabled") == 0) {
__u8 vlan_stats_enabled;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&vlan_stats_enabled, *argv, 0))
invarg("invalid vlan_stats_enabled", *argv);
addattr8(n, 1024, IFLA_BR_VLAN_STATS_ENABLED,
vlan_stats_enabled);
} else if (matches(*argv, "vlan_stats_per_port") == 0) {
__u8 vlan_stats_per_port;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&vlan_stats_per_port, *argv, 0))
invarg("invalid vlan_stats_per_port", *argv);
addattr8(n, 1024, IFLA_BR_VLAN_STATS_PER_PORT,
vlan_stats_per_port);
} else if (matches(*argv, "mcast_router") == 0) {
__u8 mcast_router;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&mcast_router, *argv, 0))
invarg("invalid mcast_router", *argv);
addattr8(n, 1024, IFLA_BR_MCAST_ROUTER, mcast_router);
} else if (matches(*argv, "mcast_snooping") == 0) {
__u8 mcast_snoop;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&mcast_snoop, *argv, 0))
invarg("invalid mcast_snooping", *argv);
addattr8(n, 1024, IFLA_BR_MCAST_SNOOPING, mcast_snoop);
} else if (strcmp(*argv, "mcast_vlan_snooping") == 0) {
__u32 mcvl_bit = 1 << BR_BOOLOPT_MCAST_VLAN_SNOOPING;
__u8 mcast_vlan_snooping;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&mcast_vlan_snooping, *argv, 0))
invarg("invalid mcast_vlan_snooping", *argv);
bm.optmask |= 1 << BR_BOOLOPT_MCAST_VLAN_SNOOPING;
if (mcast_vlan_snooping)
bm.optval |= mcvl_bit;
else
bm.optval &= ~mcvl_bit;
} else if (matches(*argv, "mcast_query_use_ifaddr") == 0) {
__u8 mcast_qui;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&mcast_qui, *argv, 0))
invarg("invalid mcast_query_use_ifaddr",
*argv);
addattr8(n, 1024, IFLA_BR_MCAST_QUERY_USE_IFADDR,
mcast_qui);
} else if (matches(*argv, "mcast_querier") == 0) {
__u8 mcast_querier;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&mcast_querier, *argv, 0))
invarg("invalid mcast_querier", *argv);
addattr8(n, 1024, IFLA_BR_MCAST_QUERIER, mcast_querier);
} else if (matches(*argv, "mcast_hash_elasticity") == 0) {
__u32 mcast_hash_el;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&mcast_hash_el, *argv, 0))
invarg("invalid mcast_hash_elasticity",
*argv);
addattr32(n, 1024, IFLA_BR_MCAST_HASH_ELASTICITY,
mcast_hash_el);
} else if (matches(*argv, "mcast_hash_max") == 0) {
__u32 mcast_hash_max;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&mcast_hash_max, *argv, 0))
invarg("invalid mcast_hash_max", *argv);
addattr32(n, 1024, IFLA_BR_MCAST_HASH_MAX,
mcast_hash_max);
} else if (matches(*argv, "mcast_last_member_count") == 0) {
__u32 mcast_lmc;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&mcast_lmc, *argv, 0))
invarg("invalid mcast_last_member_count",
*argv);
addattr32(n, 1024, IFLA_BR_MCAST_LAST_MEMBER_CNT,
mcast_lmc);
} else if (matches(*argv, "mcast_startup_query_count") == 0) {
__u32 mcast_sqc;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&mcast_sqc, *argv, 0))
invarg("invalid mcast_startup_query_count",
*argv);
addattr32(n, 1024, IFLA_BR_MCAST_STARTUP_QUERY_CNT,
mcast_sqc);
} else if (matches(*argv, "mcast_last_member_interval") == 0) {
__u64 mcast_last_member_intvl;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u64(&mcast_last_member_intvl, *argv, 0))
invarg("invalid mcast_last_member_interval",
*argv);
addattr64(n, 1024, IFLA_BR_MCAST_LAST_MEMBER_INTVL,
mcast_last_member_intvl);
} else if (matches(*argv, "mcast_membership_interval") == 0) {
__u64 mcast_membership_intvl;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u64(&mcast_membership_intvl, *argv, 0))
invarg("invalid mcast_membership_interval",
*argv);
addattr64(n, 1024, IFLA_BR_MCAST_MEMBERSHIP_INTVL,
mcast_membership_intvl);
} else if (matches(*argv, "mcast_querier_interval") == 0) {
__u64 mcast_querier_intvl;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u64(&mcast_querier_intvl, *argv, 0))
invarg("invalid mcast_querier_interval",
*argv);
addattr64(n, 1024, IFLA_BR_MCAST_QUERIER_INTVL,
mcast_querier_intvl);
} else if (matches(*argv, "mcast_query_interval") == 0) {
__u64 mcast_query_intvl;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u64(&mcast_query_intvl, *argv, 0))
invarg("invalid mcast_query_interval",
*argv);
addattr64(n, 1024, IFLA_BR_MCAST_QUERY_INTVL,
mcast_query_intvl);
} else if (!matches(*argv, "mcast_query_response_interval")) {
__u64 mcast_query_resp_intvl;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u64(&mcast_query_resp_intvl, *argv, 0))
invarg("invalid mcast_query_response_interval",
*argv);
addattr64(n, 1024, IFLA_BR_MCAST_QUERY_RESPONSE_INTVL,
mcast_query_resp_intvl);
} else if (!matches(*argv, "mcast_startup_query_interval")) {
__u64 mcast_startup_query_intvl;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u64(&mcast_startup_query_intvl, *argv, 0))
invarg("invalid mcast_startup_query_interval",
*argv);
addattr64(n, 1024, IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
mcast_startup_query_intvl);
} else if (matches(*argv, "mcast_stats_enabled") == 0) {
__u8 mcast_stats_enabled;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&mcast_stats_enabled, *argv, 0))
invarg("invalid mcast_stats_enabled", *argv);
addattr8(n, 1024, IFLA_BR_MCAST_STATS_ENABLED,
mcast_stats_enabled);
} else if (matches(*argv, "mcast_igmp_version") == 0) {
__u8 igmp_version;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&igmp_version, *argv, 0))
invarg("invalid mcast_igmp_version", *argv);
addattr8(n, 1024, IFLA_BR_MCAST_IGMP_VERSION,
igmp_version);
} else if (matches(*argv, "mcast_mld_version") == 0) {
__u8 mld_version;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&mld_version, *argv, 0))
invarg("invalid mcast_mld_version", *argv);
addattr8(n, 1024, IFLA_BR_MCAST_MLD_VERSION,
mld_version);
} else if (matches(*argv, "nf_call_iptables") == 0) {
__u8 nf_call_ipt;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&nf_call_ipt, *argv, 0))
invarg("invalid nf_call_iptables", *argv);
addattr8(n, 1024, IFLA_BR_NF_CALL_IPTABLES,
nf_call_ipt);
} else if (matches(*argv, "nf_call_ip6tables") == 0) {
__u8 nf_call_ip6t;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&nf_call_ip6t, *argv, 0))
invarg("invalid nf_call_ip6tables", *argv);
addattr8(n, 1024, IFLA_BR_NF_CALL_IP6TABLES,
nf_call_ip6t);
} else if (matches(*argv, "nf_call_arptables") == 0) {
__u8 nf_call_arpt;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u8(&nf_call_arpt, *argv, 0))
invarg("invalid nf_call_arptables", *argv);
addattr8(n, 1024, IFLA_BR_NF_CALL_ARPTABLES,
nf_call_arpt);
} else if (matches(*argv, "help") == 0) {
explain();
return -1;
} else {
fprintf(
stderr
, "bridge: unknown command \"%s\"?\n", *argv);
explain();
return -1;
}
argc--, argv++;
}
if (bm.optmask)
addattr_l(n, 1024, IFLA_BR_MULTI_BOOLOPT,
&bm, sizeof(bm));
return 0;
}
| long bridge_parse_opt(long a1, int a2, const char **a3, long a4)
{
unsigned int v8;
int v9;
unsigned int v10;
long v11;
long v12;
char v13[40];
unsigned long v14;
v14 = __readfsqword(0x28u);
v12 = 0LL;
while ( 1 )
{
if ( a2 <= 0 )
{
if ( HIDWORD(v12) )
addattr_l(a4, 1024LL, 46LL, &v12, 8LL);
return 0LL;
}
if ( (unsigned char)matches(*a3, "forward_delay") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u32(&v8, *a3, 0LL) )
invarg("invalid forward_delay", *a3);
addattr32(a4, 1024LL, 1LL, v8);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "hello_time") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u32(&v8, *a3, 0LL) )
invarg("invalid hello_time", *a3);
addattr32(a4, 1024LL, 2LL, v8);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "max_age") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u32(&v8, *a3, 0LL) )
invarg("invalid max_age", *a3);
addattr32(a4, 1024LL, 3LL, v8);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "ageing_time") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u32(&v8, *a3, 0LL) )
invarg("invalid ageing_time", *a3);
addattr32(a4, 1024LL, 4LL, v8);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "stp_state") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u32(&v8, *a3, 0LL) )
invarg("invalid stp_state", *a3);
addattr32(a4, 1024LL, 5LL, v8);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "priority") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u16(&v11, *a3, 0LL) )
invarg("invalid priority", *a3);
addattr16(a4, 1024LL, 6LL, (unsigned short)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "vlan_filtering") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v11, *a3, 0LL) )
invarg("invalid vlan_filtering", *a3);
addattr8(a4, 1024LL, 7LL, (unsigned char)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "vlan_protocol") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)ll_proto_a2n(&v11, *a3) )
invarg("invalid vlan_protocol", *a3);
addattr16(a4, 1024LL, 8LL, (unsigned short)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "group_fwd_mask") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u16(&v11, *a3, 0LL) )
invarg("invalid group_fwd_mask", *a3);
addattr16(a4, 1024LL, 9LL, (unsigned short)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "group_address") == 1 )
break;
++a3;
if ( --a2 <= 0 )
incomplete_command();
v10 = ll_addr_a2n(v13, 32LL, *a3);
if ( (v10 & 0x80000000) != 0 )
return 0xFFFFFFFFLL;
addattr_l(a4, 1024LL, 20LL, v13, v10);
LABEL_213:
--a2;
++a3;
}
if ( (unsigned char)matches(*a3, "fdb_flush") != 1 )
{
addattr(a4, 1024LL, 21LL);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "vlan_default_pvid") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u16(&v11, *a3, 0LL) )
invarg("invalid vlan_default_pvid", *a3);
addattr16(a4, 1024LL, 39LL, (unsigned short)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "vlan_stats_enabled") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v11, *a3, 0LL) )
invarg("invalid vlan_stats_enabled", *a3);
addattr8(a4, 1024LL, 41LL, (unsigned char)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "vlan_stats_per_port") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v11, *a3, 0LL) )
invarg("invalid vlan_stats_per_port", *a3);
addattr8(a4, 1024LL, 45LL, (unsigned char)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_router") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v11, *a3, 0LL) )
invarg("invalid mcast_router", *a3);
addattr8(a4, 1024LL, 22LL, (unsigned char)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_snooping") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v11, *a3, 0LL) )
invarg("invalid mcast_snooping", *a3);
addattr8(a4, 1024LL, 23LL, (unsigned char)v11);
goto LABEL_213;
}
if ( !strcmp(*a3, "mcast_vlan_snooping") )
{
v9 = 2;
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v11, *a3, 0LL) )
invarg("invalid mcast_vlan_snooping", *a3);
HIDWORD(v12) |= 2u;
if ( (_BYTE)v11 )
LODWORD(v12) = v9 | v12;
else
LODWORD(v12) = ~v9 & v12;
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_query_use_ifaddr") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v11, *a3, 0LL) )
invarg("invalid mcast_query_use_ifaddr", *a3);
addattr8(a4, 1024LL, 24LL, (unsigned char)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_querier") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v11, *a3, 0LL) )
invarg("invalid mcast_querier", *a3);
addattr8(a4, 1024LL, 25LL, (unsigned char)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_hash_elasticity") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u32(&v11, *a3, 0LL) )
invarg("invalid mcast_hash_elasticity", *a3);
addattr32(a4, 1024LL, 26LL, (unsigned int)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_hash_max") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u32(&v11, *a3, 0LL) )
invarg("invalid mcast_hash_max", *a3);
addattr32(a4, 1024LL, 27LL, (unsigned int)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_last_member_count") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u32(&v11, *a3, 0LL) )
invarg("invalid mcast_last_member_count", *a3);
addattr32(a4, 1024LL, 28LL, (unsigned int)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_startup_query_count") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u32(&v11, *a3, 0LL) )
invarg("invalid mcast_startup_query_count", *a3);
addattr32(a4, 1024LL, 29LL, (unsigned int)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_last_member_interval") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u64(&v11, *a3, 0LL) )
invarg("invalid mcast_last_member_interval", *a3);
addattr64(a4, 1024LL, 30LL, v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_membership_interval") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u64(&v11, *a3, 0LL) )
invarg("invalid mcast_membership_interval", *a3);
addattr64(a4, 1024LL, 31LL, v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_querier_interval") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u64(&v11, *a3, 0LL) )
invarg("invalid mcast_querier_interval", *a3);
addattr64(a4, 1024LL, 32LL, v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_query_interval") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u64(&v11, *a3, 0LL) )
invarg("invalid mcast_query_interval", *a3);
addattr64(a4, 1024LL, 33LL, v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_query_response_interval") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u64(&v11, *a3, 0LL) )
invarg("invalid mcast_query_response_interval", *a3);
addattr64(a4, 1024LL, 34LL, v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_startup_query_interval") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u64(&v11, *a3, 0LL) )
invarg("invalid mcast_startup_query_interval", *a3);
addattr64(a4, 1024LL, 35LL, v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_stats_enabled") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v11, *a3, 0LL) )
invarg("invalid mcast_stats_enabled", *a3);
addattr8(a4, 1024LL, 42LL, (unsigned char)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_igmp_version") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v11, *a3, 0LL) )
invarg("invalid mcast_igmp_version", *a3);
addattr8(a4, 1024LL, 43LL, (unsigned char)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "mcast_mld_version") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v11, *a3, 0LL) )
invarg("invalid mcast_mld_version", *a3);
addattr8(a4, 1024LL, 44LL, (unsigned char)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "nf_call_iptables") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v11, *a3, 0LL) )
invarg("invalid nf_call_iptables", *a3);
addattr8(a4, 1024LL, 36LL, (unsigned char)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "nf_call_ip6tables") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v11, *a3, 0LL) )
invarg("invalid nf_call_ip6tables", *a3);
addattr8(a4, 1024LL, 37LL, (unsigned char)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "nf_call_arptables") != 1 )
{
++a3;
if ( --a2 <= 0 )
incomplete_command();
if ( (unsigned int)get_u8(&v11, *a3, 0LL) )
invarg("invalid nf_call_arptables", *a3);
addattr8(a4, 1024LL, 38LL, (unsigned char)v11);
goto LABEL_213;
}
if ( (unsigned char)matches(*a3, "help") == 1 )
fprintf(stderr, "bridge: unknown command \"%s\"?\n", *a3);
explain();
return 0xFFFFFFFFLL;
}
|
int
sshkey_names_valid2(const char *names, int allow_wildcard)
{
char *s, *cp, *p;
const struct keytype *kt;
int type;
if (names ==
((void *)0)
|| strcmp(names, "") == 0)
return 0;
if ((s = cp = strdup(names)) ==
((void *)0)
)
return 0;
for ((p = strsep(&cp, ",")); p && *p != '\0';
(p = strsep(&cp, ","))) {
type = sshkey_type_from_name(p);
if (type == KEY_UNSPEC) {
if (allow_wildcard) {
for (kt = keytypes; kt->type != -1; kt++) {
if (match_pattern_list(kt->name,
p, 0) != 0)
break;
}
if (kt->type != -1)
continue;
}
free(s);
return 0;
}
}
free(s);
return 1;
}
| long sshkey_names_valid2(const char *a1, int a2)
{
char *stringp;
char *v4;
char **i;
void *ptr;
unsigned long v7;
v7 = __readfsqword(0x28u);
if ( !a1 || !strcmp(a1, &s2) )
return 0LL;
stringp = strdup(a1);
ptr = stringp;
if ( !stringp )
return 0LL;
while ( 1 )
{
v4 = strsep(&stringp, ",");
if ( !v4 || !*v4 )
break;
if ( (unsigned int)sshkey_type_from_name(v4) == 14 )
{
if ( !a2 )
goto LABEL_14;
for ( i = keytypes; *((_DWORD *)i + 6) != -1 && !(unsigned int)match_pattern_list(*i, v4, 0LL); i += 5 )
;
if ( *((_DWORD *)i + 6) == -1 )
{
LABEL_14:
free(ptr);
return 0LL;
}
}
}
free(ptr);
return 1LL;
}
|
static void
enqueue_pending(void)
{
struct pkg_hash_iter *iter;
struct pkginfo *pkg;
iter = pkg_hash_iter_new();
while ((pkg = pkg_hash_iter_next_pkg(iter)) !=
((void *)0)
) {
switch (cipaction->arg_int) {
case act_configure:
if (!(pkg->status == PKG_STAT_UNPACKED ||
pkg->status == PKG_STAT_HALFCONFIGURED ||
pkg->trigpend_head))
continue;
if (pkg->want != PKG_WANT_INSTALL &&
pkg->want != PKG_WANT_HOLD)
continue;
break;
case act_triggers:
if (!pkg->trigpend_head)
continue;
if (pkg->want != PKG_WANT_INSTALL &&
pkg->want != PKG_WANT_HOLD)
continue;
break;
case act_remove:
case act_purge:
if (pkg->want != PKG_WANT_PURGE) {
if (pkg->want != PKG_WANT_DEINSTALL)
continue;
if (pkg->status == PKG_STAT_CONFIGFILES)
continue;
}
if (pkg->status == PKG_STAT_NOTINSTALLED)
continue;
break;
default:
do_internerr("packages.c", 109, __func__, "unknown action '%d'", cipaction->arg_int);
}
enqueue_package(pkg);
}
pkg_hash_iter_free(iter);
}
| void enqueue_pending(void)
{
int iVar1;
undefined8 uVar2;
long lVar3;
uVar2 = pkg_hash_iter_new();
LAB_001001c8:
while( true ) {
lVar3 = pkg_hash_iter_next_pkg(uVar2);
if (lVar3 == 0) {
pkg_hash_iter_free(uVar2);
return;
}
iVar1 = *(int *)(cipaction + 0x28);
if (6 < iVar1) break;
if (iVar1 < 5) {
if (iVar1 == 2) goto LAB_001000ce;
if (iVar1 != 4) break;
if (*(long *)(lVar3 + 0x160) != 0) {
if (*(int *)(lVar3 + 0x10) == 1) goto LAB_001001bc;
iVar1 = *(int *)(lVar3 + 0x10);
goto joined_r0x00100115;
}
}
else if (((*(int *)(lVar3 + 0x10) == 4) ||
((*(int *)(lVar3 + 0x10) == 3 && (*(int *)(lVar3 + 0x18) != 1)))) &&
(*(int *)(lVar3 + 0x18) != 0)) goto LAB_001001bc;
}
do_internerr("packages.c",0x6d,"enqueue_pending","unknown action \'%d\'",
*(undefined4 *)(cipaction + 0x28));
goto LAB_001001bc;
LAB_001000ce:
if (((*(int *)(lVar3 + 0x18) == 3) || (*(int *)(lVar3 + 0x18) == 4)) ||
(*(long *)(lVar3 + 0x160) != 0)) {
if (*(int *)(lVar3 + 0x10) != 1) {
iVar1 = *(int *)(lVar3 + 0x10);
joined_r0x00100115:
if (iVar1 != 2) goto LAB_001001c8;
}
LAB_001001bc:
enqueue_package(lVar3);
}
goto LAB_001001c8;
}
|
static void _bridge_print_timer(FILE *f,
const char *attr,
struct rtattr *timer)
{
struct timeval tv;
__jiffies_to_tv(&tv, rta_getattr_u64(timer));
if (is_json_context()) {
json_writer_t *jw = get_json_writer();
jsonw_name(jw, attr);
jsonw_printf(jw, "%i.%.2i",
(int)tv.tv_sec,
(int)tv.tv_usec / 10000);
} else {
fprintf(f, "%s %4i.%.2i ", attr, (int)tv.tv_sec,
(int)tv.tv_usec / 10000);
}
}
| void _bridge_print_timer(void* a0, unsigned long long a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v0;
char v1;
char v2;
char v3;
unsigned long long *v5;
unsigned long long v6;
__jiffies_to_tv(&v1, rta_getattr_u64(a2));
if (!is_json_context(&v1, a1, a2, a3, a4, a5)) {
fprintf(a0, "%s %4i.%.2i ", a1, *(&v1), ((*(&v2) * 1759218605 >> 44) - (*(&v2) >> 31)));
} else {
v0 = get_json_writer();
jsonw_name(v0, a1, a1);
jsonw_printf(v0, "%i.%.2i", *(&v1), (*(&v2) * 1759218605 >> 44) - (*(&v2) >> 31));
}
v6 = *(&v3) ^ v5[5];
return;
}
|
BUCKET_CONTENTS *
hash_search (string, table, flags)
const char *string;
HASH_TABLE *table;
int flags;
{
BUCKET_CONTENTS *list;
int bucket;
unsigned int hv;
if (table == 0 || ((flags & 0x02) == 0 && ((table) ? (table)->nentries : 0) == 0))
return (BUCKET_CONTENTS *)
((void *)0)
;
bucket = (((hv) = hash_string (string)) & ((table)->nbuckets - 1));
for (list = table->bucket_array ? table->bucket_array[bucket] : 0; list; list = list->next)
{
if (hv == list->khash && ((list->key)[0] == (string)[0] && strcmp(list->key, string) == 0))
{
list->times_found++;
return (list);
}
}
if (flags & 0x02)
{
if (((table)->nentries >= (table)->nbuckets * 2))
{
hash_grow (table);
bucket = (((hv) = hash_string (string)) & ((table)->nbuckets - 1));
}
list = (BUCKET_CONTENTS *)sh_xmalloc((sizeof (BUCKET_CONTENTS)), "hashlib.c", 280);
list->next = table->bucket_array[bucket];
table->bucket_array[bucket] = list;
list->data =
((void *)0)
;
list->key = (char *)string;
list->khash = hv;
list->times_found = 0;
table->nentries++;
return (list);
}
return (BUCKET_CONTENTS *)
((void *)0)
;
}
| int hash_search(char *a0, struct_0 *a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
unsigned long v2;
unsigned int v4;
if (!a1) {
v4 = 0;
return v4;
}
if (!(a2 & 2)) {
if (!a1) {
v4 = 0;
return v4;
} else if (!a1->field_c) {
v4 = 0;
return v4;
}
}
v1 = hash_string(a0);
v0 = a1->field_8 - 1 & v1;
v4 = (!a1->field_0 ? *((a1->field_0 + v0 * 8)) : 0);
for (*(&v2) = v4; v2; v2 = *(v2)) {
if (v1 == *((v2 + 24)) && *(*((v2 + 8))) == *(a0) && !strcmp(*((v2 + 8)), a0)) {
*((v2 + 28)) = *((v2 + 28)) + 1;
v4 = v2;
return v4;
}
}
if (!(a2 & 2)) {
v4 = 0;
return v4;
}
if (a1->field_c >= a1->field_8 << 1) {
hash_grow(a1);
v1 = hash_string(a0);
v0 = a1->field_8 - 1 & v1;
}
v2 = sh_xmalloc(0x20, "hashlib.c", 0x118);
v2->field_0 = *((a1->field_0 + v0 * 8));
*((v0 * 8 + a1->field_0)) = v2;
v2->field_10 = 0;
v2->field_8 = a0;
v2->field_18 = v1;
*((v2 + 28)) = 0;
a1->field_c = a1->field_c + 1;
v4 = v2;
return v4;
}
|
static void
dummy_decoder (struct tar_stat_info *st __attribute__ ((unused)),
char const *keyword __attribute__ ((unused)),
char const *arg __attribute__ ((unused)),
size_t size __attribute__((unused)))
{
}
| long long dummy_decoder(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned long v5;
v3 = a0;
v2 = a1;
v1 = a2;
v0 = a3;
return v5;
}
|
static char *
nodesavestr(s)
char *s;
{
char *rtn = funcstring;
funcstring = stpcpy(funcstring, s) + 1;
return rtn;
}
| int nodesavestr(char *a0) {
unsigned long long v0;
v0 = 16752697131771134792;
funcstring = stpcpy(0xe87d894820ec8348, a0) + 1;
return v0;
}
|
static void print_channel_bindings(gnutls_session_t session, int print)
{
static const struct channel_binding_request requests[] = {
{ GNUTLS_CB_TLS_UNIQUE, "tls-unique" },
{ GNUTLS_CB_TLS_SERVER_END_POINT, "tls-server-end-point" },
{ GNUTLS_CB_TLS_EXPORTER, "tls-exporter" }
};
size_t i;
if (!print) {
return;
}
log_msg(
stdout
, "- Channel bindings\n");
for (i = 0; i < sizeof(requests) / sizeof(requests[0]); i++) {
gnutls_datum_t cb;
int rc;
rc = gnutls_session_channel_binding(session,
requests[i].type,
&cb);
if (rc == -213) {
log_msg(
stdout
, " - '%s': not available\n",
requests[i].name);
} else if (rc < 0) {
fprintf(
stderr
, " - '%s': error: %s\n",
requests[i].name, gnutls_strerror(rc));
} else {
size_t j;
log_msg(
stdout
, " - '%s': ",
requests[i].name);
for (j = 0; j < cb.size; j++)
log_msg(
stdout
, "%02x", cb.data[j]);
log_msg(
stdout
, "\n");
gnutls_free((void *) (cb.data)), cb.data=
((void *)0)
;
}
}
}
| void print_channel_bindings(undefined8 param_1,int param_2)
{
int iVar1;
long in_FS_OFFSET;
ulong local_38;
ulong local_30;
long local_28;
uint local_20;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
if (param_2 != 0) {
log_msg(stdout,"- Channel bindings\n");
for (local_38 = 0; local_38 < 3; local_38 = local_38 + 1) {
iVar1 = gnutls_session_channel_binding
(param_1,*(undefined4 *)(requests_11984 + local_38 * 0x10),&local_28);
if (iVar1 == -0xd5) {
log_msg(stdout," - \'%s\': not available\n",
*(undefined8 *)(requests_11984 + local_38 * 0x10 + 8));
}
else if (iVar1 < 0) {
gnutls_strerror(iVar1);
fprintf(stderr," - \'%s\': error: %s\n",
*(undefined8 *)(requests_11984 + local_38 * 0x10 + 8));
}
else {
log_msg(stdout," - \'%s\': ",*(undefined8 *)(requests_11984 + local_38 * 0x10 + 8));
for (local_30 = 0; local_30 < local_20; local_30 = local_30 + 1) {
log_msg(stdout,&DAT_00104688,*(undefined *)(local_30 + local_28));
}
log_msg(stdout);
(*gnutls_free)(local_28);
local_28 = 0;
}
}
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
__stack_chk_fail();
}
|
static intmax_t
grepbuf (char *beg, char const *lim)
{
intmax_t outleft0 = outleft;
char *endp;
for (char *p = beg; p < lim; p = endp)
{
idx_t match_size;
ptrdiff_t match_offset = execute (compiled_pattern, p, lim - p,
&match_size,
((void *)0)
);
if (match_offset < 0)
{
if (!out_invert)
break;
match_offset = lim - p;
match_size = 0;
}
char *b = p + match_offset;
endp = b + match_size;
if (!out_invert && b == lim)
break;
if (!out_invert || p < b)
{
char *prbeg = out_invert ? p : b;
char *prend = out_invert ? b : endp;
prtext (prbeg, prend);
if (!outleft || done_on_match)
{
if (exit_on_match)
exit (errseen ? exit_failure :
0
);
break;
}
}
}
return outleft0 - outleft;
}
| int grepbuf(unsigned long a0, unsigned long a1) {
void* v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned long v4;
unsigned long v5;
unsigned int v6;
unsigned int v7;
unsigned long v9;
unsigned int v10;
v3 = outleft;
v1 = a0;
while (true) {
if (v1 >= a1) {
LABEL_402074:
return v3 - outleft;
}
v2 = execute(compiled_pattern, v1, a1 - v1, &v0, 0, execute);
if ((v2 - 0 >> 63)) {
if (!(!(out_invert ^ 1)))
goto LABEL_402074;
v2 = a1 - v1;
v0 = 0;
}
v4 = v1 + v2;
v5 = v4 + v0;
if ((out_invert ^ 1) && v4 == a1)
goto LABEL_402074;
if (!(out_invert ^ 1) && !(v1 < v4))
goto LABEL_402055;
if (out_invert)
v9 = v1;
else
v9 = v4;
*(&v6) = v9;
if (!out_invert)
v10 = v5;
else
v10 = v4;
v7 = v10;
prtext(*(&v6), *(&v7));
if (!outleft) {
LABEL_40202b:
if (exit_on_match) {
if (!errseen) {
v10 = 0;
break;
} else {
v10 = exit_failure;
break;
}
}
} else if (!(!done_on_match)) {
goto LABEL_40202b;
}
LABEL_402055:
v1 = v5;
}
exit(v10);
}
|
static void cipher_mac_bench(int algo, int mac_algo, int size)
{
int ret;
gnutls_cipher_hd_t ctx;
gnutls_hmac_hd_t mac_ctx;
void *_key, *_iv;
gnutls_datum_t key, iv;
int ivsize = gnutls_cipher_get_iv_size(algo);
int keysize = gnutls_cipher_get_key_size(algo);
int step = size * 1024;
struct benchmark_st st;
void *output, *input;
unsigned char c, *i;
_key = malloc(keysize);
if (_key ==
((void *)0)
)
return;
memset(_key, 0xf0, keysize);
_iv = malloc(ivsize);
if (_iv ==
((void *)0)
) {
free(_key);
return;
}
memset(_iv, 0xf0, ivsize);
iv.data = _iv;
iv.size = ivsize;
key.data = _key;
key.size = keysize;
((void) sizeof ((
gnutls_rnd(GNUTLS_RND_NONCE, &c, 1) >= 0
) ? 1 : 0), __extension__ ({ if (
gnutls_rnd(GNUTLS_RND_NONCE, &c, 1) >= 0
) ; else __assert_fail (
"gnutls_rnd(GNUTLS_RND_NONCE, &c, 1) >= 0"
, "benchmark-cipher.c", 81, __extension__ __PRETTY_FUNCTION__); }))
;
printf("%19s-%s ", gnutls_cipher_get_name(algo),
gnutls_mac_get_name(mac_algo));
fflush(
stdout
);
{input=malloc(64*1024*1024);
((void) sizeof ((
input!=
((void *)0)) ? 1 : 0), __extension__ ({ if (
input!=
((void *)0)) ; else __assert_fail (
"input!=NULL"
, "benchmark-cipher.c", 87, __extension__ __PRETTY_FUNCTION__); }))
;
((void) sizeof ((
gnutls_rnd(GNUTLS_RND_NONCE, input, 64*1024*1024) >= 0
) ? 1 : 0), __extension__ ({ if (
gnutls_rnd(GNUTLS_RND_NONCE, input, 64*1024*1024) >= 0
) ; else __assert_fail ("gnutls_rnd(GNUTLS_RND_NONCE, input, 64*1024*1024) >= 0", "benchmark-cipher.c", 87, __extension__ __PRETTY_FUNCTION__); }))
;};
{output=malloc(step+64);
((void) sizeof ((
output!=
((void *)0)) ? 1 : 0), __extension__ ({ if (
output!=
((void *)0)) ; else __assert_fail (
"output!=NULL"
, "benchmark-cipher.c", 88, __extension__ __PRETTY_FUNCTION__); }))
;};
i = input;
start_benchmark(&st);
ret = gnutls_hmac_init(&mac_ctx, mac_algo, key.data, key.size);
if (ret < 0) {
fprintf(
stderr
, "error: %s\n", gnutls_strerror(ret));
goto leave;
}
ret = gnutls_cipher_init(&ctx, algo, &key, &iv);
if (ret < 0) {
fprintf(
stderr
, "error: %s\n", gnutls_strerror(ret));
goto leave;
}
do {
gnutls_hmac(mac_ctx, i, step);
gnutls_cipher_encrypt2(ctx, i, step, output, step + 64);
st.size += step;
i+=page_size; if ((i+step) >= (((unsigned char*)input) + 64*1024*1024)) { i = input; };
}
while (benchmark_must_finish == 0);
gnutls_cipher_deinit(ctx);
gnutls_hmac_deinit(mac_ctx,
((void *)0)
);
stop_benchmark(&st,
((void *)0)
, 1);
leave:
free(input);
free(output);
free(_key);
free(_iv);
}
| unsigned long cipher_mac_bench(unsigned int a1, unsigned int a2, int a3)
{
const char *name;
const char *v4;
const char *v5;
char v8;
int iv_size;
unsigned int key_size;
int v11;
int v12;
long v13;
long v14;
char *v15;
void *s;
void *v17;
void *ptr;
void *v19;
void *v20;
unsigned int v21;
void *v22;
int v23;
char v24[16];
long v25;
unsigned long v26;
v26 = __readfsqword(0x28u);
iv_size = gnutls_cipher_get_iv_size(a1);
key_size = gnutls_cipher_get_key_size(a1);
v11 = a3 << 10;
s = malloc((int)key_size);
if ( s )
{
memset(s, 240, (int)key_size);
v17 = malloc(iv_size);
if ( v17 )
{
memset(v17, 240, iv_size);
v22 = v17;
v23 = iv_size;
v20 = s;
v21 = key_size;
if ( (int)gnutls_rnd(0LL, &v8, 1LL) < 0 )
_assert_fail("gnutls_rnd(GNUTLS_RND_NONCE, &c, 1) >= 0", "benchmark-cipher.c", 0x51u, "cipher_mac_bench");
name = (const char *)gnutls_mac_get_name(a2);
v4 = (const char *)gnutls_cipher_get_name(a1);
printf("%19s-%s ", v4, name);
fflush(stdout);
ptr = malloc(0x4000000uLL);
if ( !ptr )
_assert_fail("input!=NULL", "benchmark-cipher.c", 0x57u, "cipher_mac_bench");
if ( (int)gnutls_rnd(0LL, ptr, 0x4000000LL) < 0 )
_assert_fail(
"gnutls_rnd(GNUTLS_RND_NONCE, input, 64*1024*1024) >= 0",
"benchmark-cipher.c",
0x57u,
"cipher_mac_bench");
v19 = malloc(v11 + 64);
if ( !v19 )
_assert_fail("output!=NULL", "benchmark-cipher.c", 0x58u, "cipher_mac_bench");
v15 = (char *)ptr;
start_benchmark(v24);
v12 = gnutls_hmac_init(&v14, a2, v20, v21);
if ( v12 < 0 || (v12 = gnutls_cipher_init(&v13, a1, &v20, &v22), v12 < 0) )
{
v5 = (const char *)gnutls_strerror((unsigned int)v12);
fprintf(stderr, "error: %s\n", v5);
}
else
{
do
{
gnutls_hmac(v14, v15, v11);
gnutls_cipher_encrypt2(v13, v15, v11, v19, v11 + 64);
v25 += v11;
v15 += (unsigned int)page_size;
if ( &v15[v11] >= (char *)ptr + 0x4000000 )
v15 = (char *)ptr;
}
while ( !benchmark_must_finish );
gnutls_cipher_deinit(v13);
gnutls_hmac_deinit(v14, 0LL);
stop_benchmark(v24, 0LL, 1LL);
}
free(ptr);
free(v19);
free(s);
free(v17);
}
else
{
free(s);
}
}
return __readfsqword(0x28u) ^ v26;
}
|
static void
prepare_options_buf(struct sshbuf *c, int which)
{
struct sshbuf *b;
size_t i;
int r;
const struct cert_ext *ext;
if ((b = sshbuf_new()) ==
((void *)0)
)
sshfatal("ssh-keygen.c", __func__, 1644, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new failed");
sshbuf_reset(c);
for (i = 0; i < ncert_ext; i++) {
ext = &cert_ext[i];
if ((ext->crit && (which & 2)) ||
(!ext->crit && (which & 1)))
continue;
if (ext->val ==
((void *)0)
) {
sshlog("ssh-keygen.c", __func__, 1653, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "%s", ext->key);
if ((r = sshbuf_put_cstring(c, ext->key)) != 0 ||
(r = sshbuf_put_string(c,
((void *)0)
, 0)) != 0)
sshfatal("ssh-keygen.c", __func__, 1656, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "prepare flag");
} else {
sshlog("ssh-keygen.c", __func__, 1659, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "%s=%s", ext->key, ext->val);
sshbuf_reset(b);
if ((r = sshbuf_put_cstring(c, ext->key)) != 0 ||
(r = sshbuf_put_cstring(b, ext->val)) != 0 ||
(r = sshbuf_put_stringb(c, b)) != 0)
sshfatal("ssh-keygen.c", __func__, 1664, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "prepare k/v");
}
}
sshbuf_free(b);
}
| void prepare_options_buf(unsigned long long a0, unsigned long a1) {
unsigned int v0;
unsigned long long v1;
unsigned long long v2;
unsigned long long v3;
unsigned long v4;
char v5;
unsigned long long v6;
unsigned long long v7;
v2 = sshbuf_new();
if (!v2)
sshfatal("ssh-keygen.c", "prepare_options_buf", 0x66c, 0x1, 0x1, 0x0, "sshbuf_new failed");
sshbuf_reset(a0);
v1 = 0;
while (true) {
if (v1 >= ncert_ext)
break;
v3 = v1 * 24 + cert_ext;
if (*((v3 + 16)) && !(!(a1 & 2)))
goto LABEL_40624b;
if (!*((v3 + 16)) && !(!(a1 & 1)))
goto LABEL_40624b;
if (!*((v3 + 8))) {
v4 = *(v3);
v3 = "%s";
sshlog("ssh-keygen.c", "prepare_options_buf", 0x675, 0x1, 0x7, 0x0, *(&v5), v6);
v0 = sshbuf_put_cstring(a0, *(v3), *(v3));
if (!v0) {
v0 = sshbuf_put_string(a0, 0x0, 0x0);
if (!v0)
goto LABEL_40624b;
}
v3 = "prepare flag";
sshfatal("ssh-keygen.c", "prepare_options_buf", 0x678, 0x1, 0x1, ssh_err(v0), *(&v5));
}
v3[0] = *((v3 + 8));
v2 = v3[0];
v1 = "%s=%s";
sshlog("ssh-keygen.c", "prepare_options_buf", 0x67b, 0x1, 0x7, 0x0, *(&v5), v6);
sshbuf_reset(v2);
v0 = sshbuf_put_cstring(a0, v3[0], v3[0]);
if (!v0) {
v0 = sshbuf_put_cstring(v2, v3[1], v3[1]);
if (!v0) {
v0 = sshbuf_put_stringb(a0, v2, v2);
if (!v0)
goto LABEL_40624b;
}
}
v3 = "prepare k/v";
sshfatal("ssh-keygen.c", "prepare_options_buf", 0x680, 0x1, 0x1, ssh_err(v0), *(&v5));
LABEL_40624b:
v1 += 1;
}
v7 = sshbuf_free(v2);
return;
}
|
void
usage (FILE *out, int status)
{
const char str[] =
"gnutls-serv - GnuTLS server\n"
"Usage: gnutls-serv [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \n"
"\n"
"None:\n"
"\n"
" -d, --debug=num Enable debugging\n"
" - it must be in the range:\n"
" 0 to 9999\n"
" --sni-hostname=str Server's hostname for server name extension\n"
" --sni-hostname-fatal Send fatal alert on sni-hostname mismatch\n"
" --alpn=str Specify ALPN protocol to be enabled by the server\n"
" --alpn-fatal Send fatal alert on non-matching ALPN name\n"
" --noticket Don't accept session tickets\n"
" --earlydata Accept early data\n"
" --maxearlydata=num The maximum early data size to accept\n"
" - it must be in the range:\n"
" 1 to 2147483648\n"
" --nocookie Don't require cookie on DTLS sessions\n"
" -g, --generate Generate Diffie-Hellman parameters\n"
" -q, --quiet Suppress some messages\n"
" --nodb Do not use a resumption database\n"
" --http Act as an HTTP server\n"
" --echo Act as an Echo server\n"
" --crlf Do not replace CRLF by LF in Echo server mode\n"
" -u, --udp Use DTLS (datagram TLS) over UDP\n"
" --mtu=num Set MTU for datagram TLS\n"
" - it must be in the range:\n"
" 0 to 17000\n"
" --srtp-profiles=str Offer SRTP profiles\n"
" -a, --disable-client-cert Do not request a client certificate\n"
" - prohibits the option 'require-client-cert'\n"
" -r, --require-client-cert Require a client certificate\n"
" --verify-client-cert If a client certificate is sent then verify it\n"
" --compress-cert=str Compress certificate\n"
" -b, --heartbeat Activate heartbeat support\n"
" --x509fmtder Use DER format for certificates to read from\n"
" --priority=str Priorities string\n"
" --dhparams=file DH params file to use\n"
" - file must pre-exist\n"
" --x509cafile=str Certificate file or PKCS #11 URL to use\n"
" --x509crlfile=file CRL file to use\n"
" - file must pre-exist\n"
" --x509keyfile=str X.509 key file or PKCS #11 URL to use\n"
" --x509certfile=str X.509 Certificate file or PKCS #11 URL to use\n"
" --rawpkkeyfile=str Private key file (PKCS #8 or PKCS #12) or PKCS #11 URL to use\n"
" --rawpkfile=str Raw public-key file to use\n"
" - requires the option 'rawpkkeyfile'\n"
" --srppasswd=file SRP password file to use\n"
" - file must pre-exist\n"
" --srppasswdconf=file SRP password configuration file to use\n"
" - file must pre-exist\n"
" --pskpasswd=file PSK password file to use\n"
" - file must pre-exist\n"
" --pskhint=str PSK identity hint to use\n"
" --ocsp-response=str The OCSP response to send to client\n"
" --ignore-ocsp-response-errors Ignore any errors when setting the OCSP response\n"
" -p, --port=num The port to connect to\n"
" -l, --list Print a list of the supported algorithms and modes\n"
" --provider=file Specify the PKCS #11 provider library\n"
" - file must pre-exist\n"
" --keymatexport=str Label used for exporting keying material\n"
" --keymatexportsize=num Size of the exported keying material\n"
" --recordsize=num The maximum record size to advertise\n"
" - it must be in the range:\n"
" 0 to 16384\n"
" --httpdata=file The data used as HTTP response\n"
" - file must pre-exist\n"
"\n"
"Version, usage and configuration options:\n"
"\n"
" -v, --version[=arg] output version information and exit\n"
" -h, --help display extended usage information and exit\n"
" -!, --more-help extended usage information passed thru pager\n"
"\n"
"Options are specified by doubled hyphens and their name or by a single\n"
"hyphen and the flag character.\n"
"\n"
"Server program that listens to incoming TLS connections.\n"
"\n"
"Please send bug reports to: <bugs@gnutls.org>\n"
"\n";
fprintf (out, "%s", str);
exit (status);
}
| void usage(FILE *a1, int a2)
{
char v2[3912];
unsigned long v3;
v3 = __readfsqword(0x28u);
strcpy(
v2,
"gnutls-serv - GnuTLS server\n"
"Usage: gnutls-serv [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \n"
"\n"
"None:\n"
"\n"
" -d, --debug=num Enable debugging\n"
"\t\t\t\t- it must be in the range:\n"
"\t\t\t\t 0 to 9999\n"
" --sni-hostname=str Server's hostname for server name extension\n"
" --sni-hostname-fatal Send fatal alert on sni-hostname mismatch\n"
" --alpn=str Specify ALPN protocol to be enabled by the server\n"
" --alpn-fatal Send fatal alert on non-matching ALPN name\n"
" --noticket Don't accept session tickets\n"
" --earlydata Accept early data\n"
" --maxearlydata=num The maximum early data size to accept\n"
"\t\t\t\t- it must be in the range:\n"
"\t\t\t\t 1 to 2147483648\n"
" --nocookie Don't require cookie on DTLS sessions\n"
" -g, --generate Generate Diffie-Hellman parameters\n"
" -q, --quiet Suppress some messages\n"
" --nodb Do not use a resumption database\n"
" --http Act as an HTTP server\n"
" --echo Act as an Echo server\n"
" --crlf Do not replace CRLF by LF in Echo server mode\n"
" -u, --udp Use DTLS (datagram TLS) over UDP\n"
" --mtu=num Set MTU for datagram TLS\n"
"\t\t\t\t- it must be in the range:\n"
"\t\t\t\t 0 to 17000\n"
" --srtp-profiles=str Offer SRTP profiles\n"
" -a, --disable-client-cert Do not request a client certificate\n"
"\t\t\t\t- prohibits the option 'require-client-cert'\n"
" -r, --require-client-cert Require a client certificate\n"
" --verify-client-cert If a client certificate is sent then verify it\n"
" --compress-cert=str Compress certificate\n"
" -b, --heartbeat Activate heartbeat support\n"
" --x509fmtder Use DER format for certificates to read from\n"
" --priority=str Priorities string\n"
" --dhparams=file DH params file to use\n"
"\t\t\t\t- file must pre-exist\n"
" --x509cafile=str Certificate file or PKCS #11 URL to use\n"
" --x509crlfile=file CRL file to use\n"
"\t\t\t\t- file must pre-exist\n"
" --x509keyfile=str X.509 key file or PKCS #11 URL to use\n"
" --x509certfile=str X.509 Certificate file or PKCS #11 URL to use\n"
" --rawpkkeyfile=str Private key file (PKCS #8 or PKCS #12) or PKCS #11 URL to use\n"
" --rawpkfile=str Raw public-key file to use\n"
"\t\t\t\t- requires the option 'rawpkkeyfile'\n"
" --srppasswd=file SRP password file to use\n"
"\t\t\t\t- file must pre-exist\n"
" --srppasswdconf=file SRP password configuration file to use\n"
"\t\t\t\t- file must pre-exist\n"
" --pskpasswd=file PSK password file to use\n"
"\t\t\t\t- file must pre-exist\n"
" --pskhint=str PSK identity hint to use\n"
" --ocsp-response=str The OCSP response to send to client\n"
" --ignore-ocsp-response-errors Ignore any errors when setting the OCSP response\n"
" -p, --port=num The port to connect to\n"
" -l, --list Print a list of the supported algorithms and modes\n"
" --provider=file Specify the PKCS #11 provider library\n"
"\t\t\t\t- file must pre-exist\n"
" --keymatexport=str Label used for exporting keying material\n"
" --keymatexportsize=num Size of the exported keying material\n"
" --recordsize=num The maximum record size to advertise\n"
"\t\t\t\t- it must be in the range:\n"
"\t\t\t\t 0 to 16384\n"
" --httpdata=file The data used as HTTP response\n"
"\t\t\t\t- file must pre-exist\n"
"\n"
"Version, usage and configuration options:\n"
"\n"
" -v, --version[=arg] output version information and exit\n"
" -h, --help display extended usage information and exit\n"
" -!, --more-help extended usage information passed thru pager\n"
"\n"
"Options are specified by doubled hyphens and their name or by a single\n"
"hyphen and the flag character.\n"
"\n"
"Server program that listens to incoming TLS connections.\n"
"\n"
"Please send bug reports to: <bugs@gnutls.org>\n"
"\n");
fprintf(a1, "%s", v2);
exit(a2);
}
|
void *
mmalloca (size_t n)
{
int plus = sizeof (small_t) + 2 * sa_alignment_max - 1;
idx_t nplus;
if (!__builtin_add_overflow (n, plus, &nplus) && !__builtin_mul_overflow_p (nplus, 1, (ptrdiff_t) 1))
{
char *mem = (char *) malloc (nplus);
if (mem !=
((void *)0)
)
{
char *p =
(char *)((((uintptr_t)mem + sizeof (small_t) + sa_alignment_max - 1)
& ~(uintptr_t)(2 * sa_alignment_max - 1))
+ sa_alignment_max);
((small_t *) p)[-1] = p - mem;
return p;
}
}
return
((void *)0)
;
}
| unsigned long mmalloca(unsigned long a1)
{
void *v2;
if ( a1 - 0x7FFFFFFFFFFFFFE0LL < a1 )
return 0LL;
v2 = malloc(a1 + 32);
if ( !v2 )
return 0LL;
*((_BYTE *)&loc_C + (((unsigned long)v2 + 16) & 0xFFFFFFFFFFFFFFE0LL) + 3) = (((_BYTE)v2 + 16) & 0xE0)
+ 16
- (_BYTE)v2;
return (((unsigned long)v2 + 16) & 0xFFFFFFFFFFFFFFE0LL) + 16;
}
|
static void
sshsk_free_sign_response(struct sk_sign_response *r)
{
if (r ==
((void *)0)
)
return;
freezero(r->sig_r, r->sig_r_len);
freezero(r->sig_s, r->sig_s_len);
freezero(r, sizeof(*r));
}
| void sshsk_free_sign_response(unsigned long long a0[5]) {
unsigned long long v1;
unsigned long long v2;
if (a0) {
freezero(a0[1], a0[2], a0[2]);
freezero(a0[3], a0[4], a0[4]);
v2 = freezero(a0, 0x28, v1);
}
return;
}
|
static el_action_t
cv_action(EditLine *el, wint_t c)
{
if (el->el_chared.c_vcmd.action != 0x00) {
if (c != (wint_t)el->el_chared.c_vcmd.action)
return 6;
if (!(c & 0x04))
cv_undo(el);
cv_yank(el, el->el_line.buffer,
(int)(el->el_line.lastchar - el->el_line.buffer));
el->el_chared.c_vcmd.action = 0x00;
el->el_chared.c_vcmd.pos = 0;
if (!(c & 0x04)) {
el->el_line.lastchar = el->el_line.buffer;
el->el_line.cursor = el->el_line.buffer;
}
if (c & 0x02)
el->el_map.current = el->el_map.key;
return 4;
}
el->el_chared.c_vcmd.pos = el->el_line.cursor;
el->el_chared.c_vcmd.action = c;
return 3;
}
| undefined8 cv_action(long param_1,uint param_2)
{
undefined8 uVar1;
if (*(int *)(param_1 + 0x3c0) == 0) {
*(undefined8 *)(param_1 + 0x3c8) = *(undefined8 *)(param_1 + 0x58);
*(uint *)(param_1 + 0x3c0) = param_2;
uVar1 = 3;
}
else if (param_2 == *(uint *)(param_1 + 0x3c0)) {
if ((param_2 & 4) == 0) {
cv_undo(param_1);
}
cv_yank(param_1,*(undefined8 *)(param_1 + 0x50),
*(long *)(param_1 + 0x60) - *(long *)(param_1 + 0x50) >> 2 & 0xffffffff);
*(undefined4 *)(param_1 + 0x3c0) = 0;
*(undefined8 *)(param_1 + 0x3c8) = 0;
if ((param_2 & 4) == 0) {
*(undefined8 *)(param_1 + 0x60) = *(undefined8 *)(param_1 + 0x50);
*(undefined8 *)(param_1 + 0x58) = *(undefined8 *)(param_1 + 0x50);
}
if ((param_2 & 2) != 0) {
*(undefined8 *)(param_1 + 0x400) = *(undefined8 *)(param_1 + 0x3f8);
}
uVar1 = 4;
}
else {
uVar1 = 6;
}
return uVar1;
}
|
static int show_handler(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
struct ifaddrmsg *ifa = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
open_json_object(
((void *)0)
);
print_int(PRINT_ANY, "index", "if%d:", ifa->ifa_index);
print_nl();
print_addrinfo(n,
stdout
);
close_json_object();
return 0;
}
| long long show_handler(unsigned long long a0, void* a1, unsigned long long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) {
unsigned long v0;
unsigned long v1;
struct_0 *v2;
v1 = a0;
v0 = a2;
v2 = &a1[16];
open_json_object(0x0);
print_int(0x4, "index", "if%d:", v2->field_4);
print_nl(0x4, "index", "if%d:", a3, a4, a5);
print_addrinfo(a1, stdout, stdout, a3, a4, a5);
close_json_object(a0, a1, a2, a3, a4, a5);
return 0;
}
|
_Bool
pred_and (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);
}
else
return
0
;
}
| long long pred_and(unsigned long long a0, unsigned long long a1, unsigned long long a2[36]) {
unsigned long long v1;
void* v2;
if (a2[34]) {
v1 = apply_predicate(a0, a1, a2[34], a1);
if (!v1)
v2 = 0;
}
if (!a2[34] || v1)
v2 = apply_predicate(a0, a1, a2[35], a1);
return v2;
}
|
static int print_mptcp_addrinfo(struct rtattr *addrinfo)
{
struct rtattr *tb[(__MPTCP_PM_ADDR_ATTR_MAX - 1) + 1];
__u8 family =
0
, addr_attr_type;
const char *ifname;
unsigned int flags;
__u16 id, port;
int index;
(parse_rtattr_flags((tb), ((__MPTCP_PM_ADDR_ATTR_MAX - 1)), ((void*)(((char*)(addrinfo)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((addrinfo)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)));
open_json_object(
((void *)0)
);
if (tb[MPTCP_PM_ADDR_ATTR_FAMILY])
family = rta_getattr_u8(tb[MPTCP_PM_ADDR_ATTR_FAMILY]);
addr_attr_type = family ==
2
? MPTCP_PM_ADDR_ATTR_ADDR4 :
MPTCP_PM_ADDR_ATTR_ADDR6;
if (tb[addr_attr_type]) {
print_string(PRINT_ANY, "address", "%s ",
format_host(family, ((int)((tb[addr_attr_type])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), ((void*)(((char*)(tb[addr_attr_type])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))))));
}
if (tb[MPTCP_PM_ADDR_ATTR_PORT]) {
port = rta_getattr_u16(tb[MPTCP_PM_ADDR_ATTR_PORT]);
if (port)
print_uint(PRINT_ANY, "port", "port %u ", port);
}
if (tb[MPTCP_PM_ADDR_ATTR_ID]) {
id = rta_getattr_u8(tb[MPTCP_PM_ADDR_ATTR_ID]);
print_uint(PRINT_ANY, "id", "id %u ", id);
}
if (tb[MPTCP_PM_ADDR_ATTR_FLAGS]) {
flags = rta_getattr_u32(tb[MPTCP_PM_ADDR_ATTR_FLAGS]);
print_mptcp_addr_flags(flags);
}
if (tb[MPTCP_PM_ADDR_ATTR_IF_IDX]) {
index = rta_getattr_s32(tb[MPTCP_PM_ADDR_ATTR_IF_IDX]);
ifname = index ? ll_index_to_name(index) :
((void *)0)
;
if (ifname)
print_string(PRINT_ANY, "dev", "dev %s ", ifname);
}
close_json_object();
print_string(PRINT_FP,
((void *)0)
, "\n",
((void *)0)
);
fflush(
stdout
);
return 0;
}
| long print_mptcp_addrinfo(unsigned short *a1)
{
long v1;
unsigned char v2;
long v3;
unsigned char v4;
long v5;
unsigned char v7;
unsigned short v8;
unsigned int v9;
unsigned int v10;
long v11;
long v12;
long v13;
long v14;
long v15;
long v16;
unsigned long v17;
v17 = __readfsqword(0x28u);
v7 = 0;
parse_rtattr_flags(&v11, 7LL, a1 + 2, (unsigned int)*a1 - 4, 0x8000LL);
v1 = 0LL;
open_json_object(0LL);
if ( v12 )
{
v1 = v12;
v7 = rta_getattr_u8(v12);
}
if ( v7 == 2 )
v2 = 3;
else
v2 = 4;
if ( *(&v11 + v2) )
{
v3 = format_host(v7, (unsigned int)*(unsigned short *)*(&v11 + v2) - 4, *(&v11 + v2) + 4);
v1 = 4LL;
print_string(4u, (long)"address", (long)"%s ", v3);
}
if ( v14 )
{
v1 = v14;
v8 = rta_getattr_u16(v14);
if ( v8 )
{
v1 = 4LL;
print_uint(4u, (long)"port", (long)"port %u ", v8);
}
}
if ( v13 )
{
v4 = rta_getattr_u8(v13);
v1 = 4LL;
print_uint(4u, (long)"id", (long)"id %u ", v4);
}
if ( v15 )
{
v9 = rta_getattr_u32(v15);
v1 = v9;
print_mptcp_addr_flags(v9);
}
if ( v16 )
{
v1 = v16;
v10 = rta_getattr_s32(v16);
if ( v10 )
{
v1 = v10;
v5 = ll_index_to_name(v10);
}
else
{
v5 = 0LL;
}
if ( v5 )
{
v1 = 4LL;
print_string(4u, (long)"dev", (long)"dev %s ", v5);
}
}
close_json_object(v1);
print_string(1u, 0LL, (long)"\n", 0LL);
fflush(stdout);
return 0LL;
}
|
void cu_prermremove(int argc, void **argv) {
struct pkginfo *pkg= (struct pkginfo*)argv[0];
enum pkgstatus *oldpkgstatus= (enum pkgstatus*)argv[1];
if (cleanup_pkg_failed++) return;
maintscript_postinst(pkg, "abort-remove",
((void *)0)
);
pkg_clear_eflags(pkg, PKG_EFLAG_REINSTREQ);
post_postinst_tasks(pkg, *oldpkgstatus);
cleanup_pkg_failed--;
}
| long long cu_prermremove(unsigned long a0, unsigned long long a1[2], unsigned long a2, unsigned long long a3) {
unsigned int v0;
unsigned long long v1;
unsigned int *v2;
unsigned long long v4;
v0 = a0;
v1 = a1[0];
v2 = a1[1];
v4 = cleanup_pkg_failed;
cleanup_pkg_failed = cleanup_pkg_failed + 1;
if (!v4) {
maintscript_postinst(v1, "abort-remove", 0x0, a3);
pkg_clear_eflags(v1, 0x1);
post_postinst_tasks(v1, *(v2));
v4 = cleanup_pkg_failed - 1;
cleanup_pkg_failed = cleanup_pkg_failed - 1;
}
return v4;
}
|
static int
strtoul_tcflag_t (char const *s, int base, char **p, tcflag_t *result,
char delim)
{
unsigned long ul;
(*__errno_location ())
= 0;
ul = strtoul (s, p, base);
if (
(*__errno_location ())
|| **p != delim || *p == s || (tcflag_t) ul != ul)
return -1;
*result = ul;
return 0;
}
| long strtoul_tcflag_t(const char *a1, int a2, char **a3, _DWORD *a4, char a5)
{
unsigned long v9;
*_errno_location() = 0;
v9 = strtoul(a1, a3, a2);
if ( *_errno_location() || a5 != **a3 || a1 == *a3 || v9 != (unsigned int)v9 )
return 0xFFFFFFFFLL;
*a4 = v9;
return 0LL;
}
|
static void
chan_shutdown_extended_read(struct ssh *ssh, Channel *c)
{
if (c->type == 10 || c->efd == -1)
return;
if (c->extended_usage != 1 &&
c->extended_usage != 0)
return;
sshlog("nchan.c", __func__, 435, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "channel %d: (i%d o%d sock %d wfd %d efd %d [%s])", c->self, c->istate, c->ostate, c->sock, c->rfd, c->efd, channel_format_extended_usage(c))
;
if (channel_close_fd(ssh, c, &c->efd) < 0) {
sshlog("nchan.c", __func__, 439, 1, SYSLOG_LEVEL_INFO,
((void *)0)
, "channel %d: close() failed for " "extended fd %d [i%d o%d]: %.100s", c->self, c->efd, c->istate, c->ostate, strerror(
(*__errno_location ())
))
;
}
}
| void chan_shutdown_extended_read(unsigned long long a0, unsigned int a1[49]) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v8;
v4 = a1[0];
if (!(a1[0] == 10 || (v5 = a1[9], a1[9] == -1))) {
switch (a1[48]) {
case 1:
LABEL_401580:
v2 = channel_format_extended_usage(a1);
v1 = a1[9];
v0 = a1[7];
sshlog("nchan.c", "chan_shutdown_extended_read", 0x1b3, 0x1, 0x5, 0x0, "channel %d: (i%d o%d sock %d wfd %d efd %d [%s])", a1[1], a1[4]);
if (channel_close_fd(a0, a1, &a1[9], a1) < 0) {
v2 = strerror(*(__errno_location()));
v1 = a1[5];
v0 = a1[4];
v8 = sshlog("nchan.c", "chan_shutdown_extended_read", 0x1b7, 0x1, 0x3, 0x0, "channel %d: close() failed for extended fd %d [i%d o%d]: %.100s", a1[1], a1[9]);
break;
}
case 0:
v6 = a1[48];
break;
default:
v6 = a1[48];
goto LABEL_401580;
}
}
return;
}
|
static SHELL_VAR *
bind_comp_words (lwords)
WORD_LIST *lwords;
{
SHELL_VAR *v;
v = find_variable_noref ("COMP_WORDS");
if (v == 0)
v = make_new_array_variable ("COMP_WORDS");
if (((((v)->attributes) & (0x0000800))))
((v)->attributes &= ~(0x0000800));
if (((((v)->attributes) & (0x0000004))) == 0)
v = convert_var_to_array (v);
v = assign_array_var_from_word_list (v, lwords, 0);
((v)->attributes &= ~(0x0001000));
return v;
}
| long bind_comp_words(long a1)
{
int v1;
int v2;
long variable_noref;
long v5;
variable_noref = find_variable_noref("COMP_WORDS");
if ( !variable_noref )
variable_noref = make_new_array_variable("COMP_WORDS");
if ( (*(_DWORD *)(variable_noref + 40) & 0x800) != 0 )
{
v1 = *(_DWORD *)(variable_noref + 40);
BYTE1(v1) &= ~8u;
*(_DWORD *)(variable_noref + 40) = v1;
}
if ( (*(_DWORD *)(variable_noref + 40) & 4) == 0 )
variable_noref = convert_var_to_array(variable_noref);
v5 = assign_array_var_from_word_list(variable_noref, a1, 0LL);
v2 = *(_DWORD *)(v5 + 40);
BYTE1(v2) &= ~0x10u;
*(_DWORD *)(v5 + 40) = v2;
return v5;
}
|
static void add_user (const char *user,
const struct group *grp)
{
struct group *newgrp;
if (is_on_list (grp->gr_mem, user)) {
fprintf (
stderr
,
gettext ("%s: user '%s' is already a member of '%s'\n"),
Prog, user, grp->gr_name);
fail_exit (7);
}
newgrp = __gr_dup(grp);
if (
((void *)0)
== newgrp) {
fprintf (
stderr
,
gettext ("%s: Out of memory. Cannot update %s.\n"),
Prog, gr_dbname ());
fail_exit (13);
}
newgrp->gr_mem = add_list (newgrp->gr_mem, user);
if (is_shadowgrp) {
const struct sgrp *sg = sgr_locate (newgrp->gr_name);
struct sgrp *newsg;
if (
((void *)0)
== sg) {
static struct sgrp sgrent;
sgrent.sg_name = xstrdup (newgrp->gr_name);
sgrent.sg_mem = dup_list (newgrp->gr_mem);
sgrent.sg_adm = (char **) xmalloc (sizeof (char *));
{
sgrent.sg_adm[0] =
((void *)0)
;
}
sgrent.sg_passwd = newgrp->gr_passwd;
newgrp->gr_passwd = "x";
newsg = &sgrent;
} else {
newsg = __sgr_dup (sg);
if (
((void *)0)
== newsg) {
fprintf (
stderr
,
gettext ("%s: Out of memory. Cannot update %s.\n"),
Prog, sgr_dbname ());
fail_exit (13);
}
newsg->sg_mem = add_list (newsg->sg_mem, user);
}
if (sgr_update (newsg) == 0) {
fprintf (
stderr
,
gettext ("%s: failed to prepare the new %s entry '%s'\n"),
Prog, sgr_dbname (), newsg->sg_name);
fail_exit (13);
}
}
if (gr_update (newgrp) == 0) {
fprintf (
stderr
,
gettext ("%s: failed to prepare the new %s entry '%s'\n"),
Prog, gr_dbname (), newgrp->gr_name);
fail_exit (13);
}
}
| long add_user(long a1, long *a2)
{
long v2;
long v3;
char *v4;
long v5;
long v6;
char *v7;
long v8;
long v9;
char *v10;
long v11;
long v12;
long v13;
char *v14;
long result;
long v16;
long v17;
long v18;
char *v19;
long *v20;
long *v21;
long v22;
if ( (unsigned char)is_on_list(a2[3], a1) )
{
v2 = *a2;
v3 = Prog;
v4 = gettext("%s: user '%s' is already a member of '%s'\n");
fprintf(stderr, v4, v3, a1, v2);
fail_exit(7);
}
v21 = (long *)_gr_dup(a2);
if ( !v21 )
{
v5 = gr_dbname();
v6 = Prog;
v7 = gettext("%s: Out of memory. Cannot update %s.\n");
fprintf(stderr, v7, v6, v5);
fail_exit(13);
}
v21[3] = add_list(v21[3], a1);
if ( is_shadowgrp )
{
v22 = sgr_locate(*v21);
if ( v22 )
{
v20 = (long *)_sgr_dup(v22);
if ( !v20 )
{
v8 = sgr_dbname();
v9 = Prog;
v10 = gettext("%s: Out of memory. Cannot update %s.\n");
fprintf(stderr, v10, v9, v8);
fail_exit(13);
}
v20[3] = add_list(v20[3], a1);
}
else
{
sgrent_5662 = xstrdup(*v21);
qword_16B8 = dup_list(v21[3]);
qword_16B0 = xmalloc(8LL);
*(_QWORD *)qword_16B0 = 0LL;
qword_16A8 = v21[1];
v21[1] = (long)"x";
v20 = &sgrent_5662;
}
if ( !(unsigned int)sgr_update(v20) )
{
v11 = *v20;
v12 = sgr_dbname();
v13 = Prog;
v14 = gettext("%s: failed to prepare the new %s entry '%s'\n");
fprintf(stderr, v14, v13, v12, v11);
fail_exit(13);
}
}
result = gr_update(v21);
if ( !(_DWORD)result )
{
v16 = *v21;
v17 = gr_dbname();
v18 = Prog;
v19 = gettext("%s: failed to prepare the new %s entry '%s'\n");
fprintf(stderr, v19, v18, v17, v16);
fail_exit(13);
}
return result;
}
|
static rsRetVal iminternalConstruct(iminternal_t **ppThis)
{
rsRetVal iRet = RS_RET_OK;
if((*ppThis = (iminternal_t*) calloc(1, sizeof(iminternal_t))) ==
((void *)0)
) {
iRet = RS_RET_OUT_OF_MEMORY;
}
return iRet;
}
| int iminternalConstruct(unsigned long long *a0) {
unsigned int v0;
v0 = 0;
*(a0) = calloc(0x1, 0x8);
if (!*(a0))
v0 = -6;
return v0;
}
|
static gl_list_node_t
gl_linked_nx_add_before (gl_list_t list, gl_list_node_t node, const void *elt)
{
gl_list_node_t new_node =
(struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
if (new_node ==
((void *)0)
)
return
((void *)0)
;
new_node->value = elt;
new_node->next = node;
new_node->prev = node->prev;
new_node->prev->next = new_node;
node->prev = new_node;
list->count++;
return new_node;
}
| void gl_linked_nx_add_before(struct_0 *a0, struct_1 *a1, unsigned long a2) {
struct_2 *v0;
void* v2;
unsigned long long v3[3];
v0 = malloc(0x18);
if (!v0) {
v2 = 0;
} else {
v0->field_10 = a2;
v0->field_0 = a1;
v0->field_8 = a1->field_8;
v0->field_8->field_0 = v0;
a1->field_8 = v0;
a0->field_40 = a0->field_40 + 1;
v3 = v0;
}
return;
}
|
void
open_archive (enum access_mode wanted_access)
{
flush_read_ptr = gnu_flush_read;
flush_write_ptr = gnu_flush_write;
_open_archive (wanted_access);
switch (wanted_access)
{
case ACCESS_READ:
case ACCESS_UPDATE:
if (volume_label_option)
match_volume_label ();
break;
case ACCESS_WRITE:
records_written = 0;
if (volume_label_option)
write_volume_label ();
break;
}
set_volume_start_time ();
}
| long long open_archive(unsigned int a0, unsigned long a1, unsigned long long a2, unsigned int a3, unsigned long long a4, unsigned long long a5) {
flush_read_ptr = gnu_flush_read;
flush_write_ptr = gnu_flush_write;
_open_archive(a0, a1, a2, a3, a4, a5);
switch (a0) {
case 0: case 2:
if (!*(&volume_label_option))
return set_volume_start_time();
match_volume_label(a0, a1, a2, a3, a4, a5);
return set_volume_start_time();
case 1:
continued_file_offset = 0;
if (*(&volume_label_option)) {
write_volume_label();
return set_volume_start_time();
}
return set_volume_start_time();
default:
return set_volume_start_time();
}
}
|
static void
balance (int total_stored)
{
COLUMN *p;
int i, lines;
int first_line = 0;
for (i = 1, p = column_vector; i <= columns; ++i, ++p)
{
lines = total_stored / columns;
if (i <= total_stored % columns)
++lines;
p->lines_stored = lines;
p->current_line = first_line;
first_line += lines;
}
}
| void balance(unsigned long a0) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3[12];
unsigned long long v5;
v2 = 0;
v0 = 1;
*(&v3[0]) = column_vector;
while (true) {
v5 = columns;
if (v0 > columns)
break;
v1 = (a0 >> 31 CONCAT a0) /m columns;
if (v0 <= (a0 >> 31 CONCAT a0) /m columns >> 32)
v1 += 1;
v3[11] = v1;
v3[10] = v2;
v2 += v1;
v0 += 1;
v3 = &v3[1 + 4];
}
return;
}
|
void
termsig_handler (sig)
int sig;
{
static int handling_termsig = 0;
int i, core;
sigset_t mask;
if (handling_termsig)
return;
handling_termsig = 1;
terminating_signal = 0;
if (sig ==
2
&& signal_is_trapped (
2
))
run_interrupt_trap (0);
if (interactive_shell && interactive && (sig ==
1
|| sig ==
15
) && remember_on_history)
maybe_save_shell_history ();
if (this_shell_builtin == read_builtin)
read_tty_cleanup ();
if (sig ==
1
&& (interactive || (subshell_environment & (0x04|0x20))))
hangup_all_jobs ();
if ((subshell_environment & (0x04|0x20)) == 0)
end_job_control ();
unlink_all_fifos ();
procsub_clear ();
loop_level = continuing = breaking = funcnest = 0;
executing_list = comsub_ignore_return = return_catch_flag = wait_intr_flag = 0;
run_exit_trap ();
restore_sigmask ();
set_signal_handler (sig,
((__sighandler_t) 0)
);
kill (getpid (), sig);
if (dollar_dollar_pid != 1)
exit (128+sig);
sigprocmask (
2
, (sigset_t *)
((void *)0)
, &mask);
for (i = core = 0; i < (sizeof (terminating_signals) / sizeof (struct termsig)); i++)
{
set_signal_handler ((terminating_signals[i].signum),
((__sighandler_t) 0)
);
sigdelset (&mask, (terminating_signals[i].signum));
if (sig == (terminating_signals[i].signum))
core = (terminating_signals[i].core_dump);
}
sigprocmask (
2
, &mask, (sigset_t *)
((void *)0)
);
if (core)
*((volatile unsigned long *)
((void *)0)
) = 0xdead0000 + sig;
exit (128+sig);
}
| void termsig_handler(int param_1)
{
int iVar1;
__pid_t __pid;
long in_FS_OFFSET;
uint local_a0;
int local_9c;
sigset_t local_98;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
if (handling_termsig_9257 != 0) {
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
handling_termsig_9257 = 1;
terminating_signal = 0;
if (param_1 == 2) {
iVar1 = signal_is_trapped();
if (iVar1 != 0) {
run_interrupt_trap();
}
}
if ((((interactive_shell != 0) && (interactive != 0)) && ((param_1 == 1 || (param_1 == 0xf)))) &&
(remember_on_history != 0)) {
maybe_save_shell_history();
}
if (this_shell_builtin == lRam00000000001009a9) {
read_tty_cleanup();
}
if ((param_1 == 1) && ((interactive != 0 || ((subshell_environment & 0x24) != 0)))) {
hangup_all_jobs();
}
if ((subshell_environment & 0x24) == 0) {
end_job_control();
}
unlink_all_fifos();
procsub_clear();
funcnest = 0;
breaking = 0;
continuing = 0;
_loop_level = 0;
wait_intr_flag = 0;
return_catch_flag = 0;
comsub_ignore_return = 0;
_executing_list = 0;
run_exit_trap();
restore_sigmask();
set_signal_handler();
__pid = getpid();
kill(__pid,param_1);
if (dollar_dollar_pid != 1) {
exit(param_1 + 0x80);
}
sigprocmask(2,(sigset_t *)0x0,&local_98);
local_9c = 0;
for (local_a0 = 0; local_a0 < 0x11; local_a0 = local_a0 + 1) {
set_signal_handler(*(undefined4 *)(terminating_signals + (long)(int)local_a0 * 0x18));
sigdelset(&local_98,*(int *)(terminating_signals + (long)(int)local_a0 * 0x18));
if (param_1 == *(int *)(terminating_signals + (long)(int)local_a0 * 0x18)) {
local_9c = *(int *)(terminating_signals + (long)(int)local_a0 * 0x18 + 0x14);
}
}
sigprocmask(2,&local_98,(sigset_t *)0x0);
if (local_9c != 0) {
uRam0000000000000000 = (ulong)(param_1 + 0xdead0000);
}
exit(param_1 + 0x80);
}
|
static void
remove_suffix (char *name, char const *suffix)
{
char *np;
char const *sp;
np = name + strlen (name);
sp = suffix + strlen (suffix);
while (np > name && sp > suffix)
if (*--np != *--sp)
return;
if (np > name)
*np = '\0';
}
| void remove_suffix(char *a0, char *a1) {
char *v0;
char *v1;
unsigned long long v4;
char *v5;
char *v6;
v0 = &a0[strlen(a0)];
v1 = &a1[strlen(a1)];
do {
if (v0 <= a0) {
LABEL_400472:
v5 = v0;
if (v0 > a0) {
v6 = v0;
*(v0) = 0;
break;
}
} else if (v1 <= a1) {
goto LABEL_400472;
}
v0 += 1;
v1 += 1;
v4 = *(v1);
} while (*(v0) == *(v1));
return;
}
|
char *first_word(const char *s, const char *t) {
static char retbuf[2][131072 + 1];
static int retsel = 0;
char *rb, *rp;
retsel = 1 - retsel;
rb = &retbuf[retsel][0];
rp = rb;
while (*s && (
((void *)0)
!= strchr(t, *s))) {
s++;
}
while (*s && (
((void *)0)
== strchr(t, *s)) && (rp < &rb[131072])) {
*rp++ = *s++;
}
*rp = '\0';
return (rb);
}
| char * first_word(char *param_1,char *param_2)
{
char *pcVar1;
char *pcVar2;
long lVar3;
char *local_20;
char *local_18;
retsel_4845 = 1 - retsel_4845;
lVar3 = (long)retsel_4845;
pcVar1 = retbuf_4844 + lVar3 * 0x20001;
local_20 = param_1;
while ((local_18 = pcVar1, *local_20 != '\0' &&
(pcVar2 = strchr(param_2,(int)*local_20), pcVar2 != (char *)0x0))) {
local_20 = local_20 + 1;
}
while (((*local_20 != '\0' && (pcVar2 = strchr(param_2,(int)*local_20), pcVar2 == (char *)0x0)) &&
(local_18 < retbuf_4844 + lVar3 * 0x20001 + 0x20000))) {
*local_18 = *local_20;
local_20 = local_20 + 1;
local_18 = local_18 + 1;
}
*local_18 = '\0';
return pcVar1;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.