input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
static enum section
check_section (void)
{
size_t len = line_buf.length - 1;
if (len < 2 || footer_del_len < 2
|| memcmp (line_buf.buffer, section_del, 2))
return Text;
if (len == header_del_len
&& !memcmp (line_buf.buffer, header_del, header_del_len))
return Header;
if (len == body_del_len
&& !memcmp (line_buf.buffer, body_del, body_del_len))
return Body;
if (len == footer_del_len
&& !memcmp (line_buf.buffer, footer_del, footer_del_len))
return Footer;
return Text;
}
| int check_section() {
unsigned long v0;
unsigned int v2;
v0 = g_401788 - 1;
if (v0 <= 1) {
LABEL_40092c:
v2 = 3;
} else {
if (footer_del_len <= 1)
goto LABEL_40092c;
if (!(!memcmp(g_401790, section_del, 0x2)))
goto LABEL_40092c;
if (v0 == header_del_len && !memcmp(g_401790, header_del, header_del_len)) {
v2 = 0;
goto LABEL_4009e3;
}
if (v0 == body_del_len && !memcmp(g_401790, body_del, body_del_len)) {
v2 = 1;
goto LABEL_4009e3;
}
if (v0 == footer_del_len && !memcmp(g_401790, footer_del, footer_del_len)) {
v2 = 2;
goto LABEL_4009e3;
}
v2 = 3;
}
LABEL_4009e3:
return v2;
}
|
void
coproc_closeall ()
{
coproc_close (&sh_coproc);
}
| void coproc_closeall() {
unsigned long long v1;
v1 = coproc_close(&sh_coproc);
return;
}
|
int padvance_magic(const char **path, const char *name, int magic)
{
const char *term = "%:";
const char *lpathopt;
const char *p;
char *q;
const char *start;
size_t qlen;
size_t len;
if (*path ==
((void *)0)
)
return -1;
lpathopt =
((void *)0)
;
start = *path;
if (*start == '%' && (p = legal_pathopt(start + 1, term, magic))) {
lpathopt = start + 1;
start = p;
term = ":";
}
len = strcspn(start, term);
p = start + len;
if (*p == '%') {
size_t extra = strchrnul(p, ':') - p;
if (legal_pathopt(p + 1, term, magic))
lpathopt = p + 1;
else
len += extra;
p += extra;
}
pathopt = lpathopt;
*path = *p == ':' ? p + 1 :
((void *)0)
;
qlen = len + strlen(name) + 2;
q = growstackto(qlen);
if (__builtin_expect(!!(len),1)) {
q = mempcpy(q, start, len);
*q++ = '/';
}
strcpy(q, name);
return qlen;
}
| long padvance_magic(char **param_1,char *param_2,undefined4 param_3)
{
long lVar1;
char *pcVar2;
size_t sVar3;
undefined *puVar4;
char *local_48;
char *local_40;
char *local_38;
char *local_30;
char *local_28;
size_t local_20;
local_48 = "%:";
if (*param_1 == (char *)0x0) {
lVar1 = 0xffffffff;
}
else {
local_40 = (char *)0x0;
local_28 = *param_1;
if (*local_28 == '%') {
pcVar2 = (char *)legal_pathopt(local_28 + 1,&DAT_00101814,param_3);
if (pcVar2 != (char *)0x0) {
local_40 = local_28 + 1;
local_48 = ":";
local_28 = pcVar2;
}
}
local_20 = strcspn(local_28,local_48);
local_38 = local_28 + local_20;
if (*local_38 == '%') {
pcVar2 = strchrnul(local_38,0x3a);
lVar1 = legal_pathopt(local_38 + 1,local_48,param_3);
if (lVar1 == 0) {
local_20 = local_20 + ((long)pcVar2 - (long)local_38);
}
else {
local_40 = local_38 + 1;
}
local_38 = local_38 + ((long)pcVar2 - (long)local_38);
}
pathopt = local_40;
if (*local_38 == ':') {
local_38 = local_38 + 1;
}
else {
local_38 = (char *)0x0;
}
*param_1 = local_38;
sVar3 = strlen(param_2);
lVar1 = sVar3 + local_20 + 2;
local_30 = (char *)growstackto(lVar1);
if (local_20 != 0) {
puVar4 = (undefined *)mempcpy(local_30,local_28,local_20);
local_30 = puVar4 + 1;
*puVar4 = 0x2f;
}
strcpy(local_30,param_2);
}
return lVar1;
}
|
int
close_stream (FILE *stream)
{
const
_Bool
some_pending = (__fpending (stream) != 0);
const
_Bool
prev_fail = (ferror (stream) != 0);
const
_Bool
fclose_fail = (fclose (stream) != 0);
if (prev_fail || (fclose_fail && (some_pending ||
(*__errno_location ())
!=
9
)))
{
if (! fclose_fail)
(*__errno_location ())
= 0;
return
(-1)
;
}
return 0;
}
| undefined8 close_stream(FILE *param_1)
{
int iVar1;
int iVar2;
long lVar3;
int *piVar4;
lVar3 = __fpending(param_1);
iVar1 = ferror(param_1);
iVar2 = fclose(param_1);
if ((iVar1 == 0) &&
((iVar2 == 0 || ((lVar3 == 0 && (piVar4 = __errno_location(), *piVar4 == 9)))))) {
return 0;
}
if (iVar2 == 0) {
piVar4 = __errno_location();
*piVar4 = 0;
}
return 0xffffffff;
}
|
static int
rl_domove_read_callback (_rl_vimotion_cxt *m)
{
int c, save;
c = m->motion;
if (((c) ? (char *)strchr ((vi_motion), (c)) != (char *)
((void *)0)
: 0))
{
if ((rl_readline_state & (0x0080000)) && ((rl_readline_state & (0x0100000)) && (rl_readline_state & (0x0000400))))
(rl_readline_state &= ~(0x0000400));
return (rl_domove_motion_callback (m));
}
else if (m->key == c && (m->key == 'd' || m->key == 'y' || m->key == 'c'))
{
rl_mark = rl_end;
rl_beg_of_line (1, c);
_rl_vi_last_motion = c;
(rl_readline_state &= ~(0x0100000));
return (vidomove_dispatch (m));
}
else if (((c) >= '0' && (c) <= '9') && (rl_readline_state & (0x0080000)) && ((rl_readline_state & (0x0100000)) && (rl_readline_state & (0x0000400))))
{
return (_rl_vi_arg_dispatch (c));
}
else if (((c) >= '0' && (c) <= '9') && (rl_readline_state & (0x0080000)) && (rl_readline_state & (0x0100000)) && ((rl_readline_state & (0x0000400)) == 0))
{
(rl_readline_state |= (0x0000400));
return (_rl_vi_arg_dispatch (c));
}
else if (((c) >= '0' && (c) <= '9'))
{
save = rl_numeric_arg;
rl_numeric_arg = ((c) - '0');
rl_explicit_arg = 1;
(rl_readline_state |= (0x0000400));
rl_digit_loop1 ();
rl_numeric_arg *= save;
c = rl_vi_domove_getchar (m);
if (c < 0)
{
m->motion = 0;
return -1;
}
m->motion = c;
return (rl_domove_motion_callback (m));
}
else
{
(rl_readline_state &= ~(0x0100000));
(rl_readline_state &= ~(0x0000400));
return (1);
}
}
| undefined8 rl_domove_read_callback(long param_1)
{
int iVar1;
int iVar2;
char *pcVar3;
undefined8 uVar4;
iVar2 = *(int *)(param_1 + 0x20);
if ((iVar2 != 0) && (pcVar3 = strchr(" hl^$0ftFT;,%wbeWBE|`",iVar2), pcVar3 != (char *)0x0)) {
if (((rl_readline_state & 0x80000) != 0) &&
(((rl_readline_state & 0x100000) != 0 && ((rl_readline_state & 0x400) != 0)))) {
rl_readline_state = rl_readline_state & 0xfffffffffffffbff;
}
uVar4 = rl_domove_motion_callback(param_1);
return uVar4;
}
iVar1 = rl_numeric_arg;
if ((iVar2 == *(int *)(param_1 + 0x1c)) &&
(((*(int *)(param_1 + 0x1c) == 100 || (*(int *)(param_1 + 0x1c) == 0x79)) ||
(*(int *)(param_1 + 0x1c) == 99)))) {
rl_mark = rl_end;
rl_beg_of_line(1,iVar2);
rl_readline_state = rl_readline_state & 0xffffffffffefffff;
_rl_vi_last_motion = iVar2;
uVar4 = vidomove_dispatch(param_1);
}
else if ((((iVar2 < 0x30) || (0x39 < iVar2)) || ((rl_readline_state & 0x80000) == 0)) ||
(((rl_readline_state & 0x100000) == 0 || ((rl_readline_state & 0x400) == 0)))) {
if ((iVar2 < 0x30) ||
((((0x39 < iVar2 || ((rl_readline_state & 0x80000) == 0)) ||
((rl_readline_state & 0x100000) == 0)) || ((rl_readline_state & 0x400) != 0)))) {
if ((iVar2 < 0x30) || (0x39 < iVar2)) {
rl_readline_state = rl_readline_state & 0xffffffffffeffbff;
uVar4 = 1;
}
else {
rl_numeric_arg = iVar2 + -0x30;
rl_explicit_arg = 1;
rl_readline_state = rl_readline_state | 0x400;
rl_digit_loop1();
rl_numeric_arg = rl_numeric_arg * iVar1;
iVar2 = rl_vi_domove_getchar(param_1);
if (iVar2 < 0) {
*(undefined4 *)(param_1 + 0x20) = 0;
uVar4 = 0xffffffff;
}
else {
*(int *)(param_1 + 0x20) = iVar2;
uVar4 = rl_domove_motion_callback(param_1);
}
}
}
else {
rl_readline_state = rl_readline_state | 0x400;
uVar4 = _rl_vi_arg_dispatch(iVar2);
}
}
else {
uVar4 = _rl_vi_arg_dispatch(iVar2);
}
return uVar4;
}
|
static void sighup_handler(int x __attribute__ ((__unused__))) {
got_sighup = 1;
}
| void sighup_handler()
{
got_sighup = 1;
}
|
SHELL_VAR *
bind_function (name, value)
const char *name;
COMMAND *value;
{
SHELL_VAR *entry;
entry = find_function (name);
if (entry == 0)
{
BUCKET_CONTENTS *elt;
elt = hash_insert ((char *)strcpy (sh_xmalloc((1 + strlen (name)), "variables.c", 3519), (name)), shell_functions, 0x01);
entry = new_shell_variable (name);
elt->data = (void *)entry;
}
else
do { if ((entry)->exportstr) { sh_xfree(((entry)->exportstr), "variables.c", 3524); (entry)->exportstr = (char *)
((void *)0)
; } } while (0);
if (((entry)->value != 0))
dispose_command ((COMMAND *)((entry)->value));
if (value)
((entry)->value = (char *)(copy_command (value)));
else
((entry)->value = (char *)(0));
((entry)->attributes |= (0x0000008));
if (mark_modified_vars)
((entry)->attributes |= (0x0000001));
((entry)->attributes &= ~(0x0001000));
if (((((entry)->attributes) & (0x0000001))))
array_needs_making = 1;
set_itemlist_dirty (&it_functions);
return (entry);
}
| long long bind_function(char *a0, unsigned long long a1, unsigned long a2, unsigned long long a3) {
struct_0 *v0;
int tmp_25;
struct_1 *v1;
unsigned long long v3;
v0 = find_function(a0);
if (!v0) {
v1 = hash_insert(strcpy(sh_xmalloc(strlen(a0) + 1, "variables.c", 0xdbf), a0), shell_functions, 0x1, a3);
v0 = new_shell_variable(a0);
v1->field_10 = v0;
} else if (v0->field_10) {
sh_xfree(v0->field_10, "variables.c", 0xdc4);
v0->field_10 = 0;
}
if (v0->field_8)
dispose_command(v0->field_8);
if (a1)
v0->field_8 = copy_command(a1);
else
v0->field_8 = 0;
v0->field_28 = v0->field_28 | 8;
if (mark_modified_vars)
v0->field_28 = v0->field_28 | 1;
v3 = v0->field_28;
*(&v3) = (v0->field_28 >> 8) & 239;
tmp_25 = v3;
v0->field_28 = tmp_25;
if ((v0->field_28 & 1))
array_needs_making = 1;
set_itemlist_dirty(0x500448);
return v0;
}
|
void br_dump_bridge_id(const struct ifla_bridge_id *id, char *buf, size_t len)
{
char eaddr[18];
ether_ntoa_r((const struct ether_addr *)id->addr, eaddr);
snprintf(buf, len, "%.2x%.2x.%s", id->prio[0], id->prio[1], eaddr);
}
| void br_dump_bridge_id(char a0[2], char *a1, unsigned int a2) {
char v0;
char v1;
unsigned long long *v3;
unsigned long long v4;
ether_ntoa_r(a0 + 1, &v0, a0 + 1);
snprintf(a1, a2, "%.2x%.2x.%s", a0[0], a0[1], &v0);
v4 = *(&v1) ^ v3[5];
return;
}
|
struct sshauthopt *
sshauthopt_new(void)
{
struct sshauthopt *ret;
if ((ret = calloc(1, sizeof(*ret))) ==
((void *)0)
)
return
((void *)0)
;
ret->force_tun_device = -1;
return ret;
}
| void * sshauthopt_new(void)
{
void *pvVar1;
pvVar1 = calloc(1,0x88);
if (pvVar1 == (void *)0x0) {
pvVar1 = (void *)0x0;
}
else {
*(undefined4 *)((long)pvVar1 + 0x30) = 0xffffffff;
}
return pvVar1;
}
|
get_stat_mtime (struct stat const *st)
{
return ((st)->st_mtim);
}
| void get_stat_mtime(void)
{
halt_baddata();
}
|
static int
prepare_padded_number (const long double val, size_t precision)
{
char buf[128];
size_t precision_used = user_precision == -1 ? precision : user_precision;
unsigned int x;
expld (val, 10, &x);
if (scale_to == scale_none
&& x + precision_used > MAX_UNSCALED_DIGITS)
{
if (inval_style != inval_ignore)
{
if (precision_used)
error (conv_exit_code, 0,
gettext ("value/precision too large to be printed: '%Lg/%"
"l" "u"
"'" " (consider using --to)")
, val, (uintmax_t)precision_used);
else
error (conv_exit_code, 0,
gettext ("value too large to be printed: '%Lg'" " (consider using --to)")
, val);
}
return 0;
}
if (x > MAX_ACCEPTABLE_DIGITS - 1)
{
if (inval_style != inval_ignore)
error (conv_exit_code, 0, gettext ("value too large to be printed: '%Lg'" " (cannot handle values > 999Y)")
, val);
return 0;
}
double_to_human (val, precision_used, buf, sizeof (buf),
scale_to, grouping, round_style);
if (suffix)
strncat (buf, suffix, sizeof (buf) - strlen (buf) -1);
do { if (dev_debug) fprintf (
stderr
, "formatting output:\n value: %Lf\n humanized: %s\n", val, quote (buf)); } while (0)
;
if (padding_width && strlen (buf) < padding_width)
{
size_t w = padding_width;
mbsalign (buf, padding_buffer, padding_buffer_size, &w,
padding_alignment, MBA_UNIBYTE_ONLY);
do { if (dev_debug) fprintf (
stderr
, " After padding: %s\n", quote (padding_buffer)); } while (0);
}
else
{
setup_padding_buffer (strlen (buf) + 1);
strcpy (padding_buffer, buf);
}
return 1;
}
| int prepare_padded_number(unsigned long a0, unsigned long a1, unsigned int a2, unsigned int a3, unsigned int a4, unsigned int a5, unsigned int v4, unsigned int a6) {
char v0;
unsigned long v1;
unsigned int v2;
char v3;
unsigned int v5;
v5 = (user_precision == -1 ? user_precision : a0);
v2 = v5;
expld(0xa, &v0, a2, a3, a4, a5, *(&v4), *(&a6));
[D] PutI(904:F64x8)[t7,0] = t8
[D] PutI(968:I8x8)[t7,0] = 0x01
[D] PutI(968:I8x8)[t7,0] = 0x00
if (!scale_to && *(&v2) + *(&v0) > 18) {
if (*(&inval_style) == 3) {
v5 = 0;
return v5;
} else if (*(&v2)) {
error(*(&conv_exit_code), 0x0, gettext("value/precision too large to be printed: '%Lg/%lu' (consider using --to)"));
} else {
error(*(&conv_exit_code), 0x0, gettext("value too large to be printed: '%Lg' (consider using --to)"));
}
}
if (*(&v0) <= 26) {
double_to_human(*(&v2), &v3, 0x80, scale_to, grouping, round_style, *(&v4), *(&a6));
if (suffix)
strncat(&v3, suffix, 127 - strlen(&v3));
if (dev_debug)
fprintf(stderr, "formatting output:\n value: %Lf\n humanized: %s\n", quote(&v3));
if (padding_width && strlen(&v3) < padding_width) {
v1 = padding_width;
mbsalign(&v3, *(&padding_buffer), padding_buffer_size, &v1, padding_alignment, 0x2);
if (dev_debug) {
fprintf(stderr, " After padding: %s\n", quote(*(&padding_buffer)));
v5 = 1;
return v5;
}
v5 = 1;
return v5;
}
setup_padding_buffer(strlen(&v3) + 1);
strcpy(*(&padding_buffer), &v3);
v5 = 1;
return v5;
}
if (*(&inval_style) == 3) {
v5 = 0;
return v5;
}
error(*(&conv_exit_code), 0x0, gettext("value too large to be printed: '%Lg' (cannot handle values > 999Y)"));
}
|
static int
unbind_keyseq (seq)
char *seq;
{
char *kseq;
int kslen, type;
rl_command_func_t *f;
kseq = (char *)sh_xmalloc(((2 * strlen (seq)) + 1), "./bind.def", 374);
if (rl_translate_keyseq (seq, kseq, &kslen))
{
sh_xfree((kseq), "./bind.def", 377);
builtin_error (gettext("`%s': cannot unbind"), seq);
return 1;
}
if ((f = rl_function_of_keyseq_len (kseq, kslen, (Keymap)0, &type)) == 0)
{
sh_xfree((kseq), "./bind.def", 383);
return (0);
}
if (type == 1)
f = ((Keymap) f)[257 -1].function;
if (rl_bind_keyseq (seq, (rl_command_func_t *)
((void *)0)
) != 0)
{
sh_xfree((kseq), "./bind.def", 394);
builtin_error (gettext("`%s': cannot unbind"), seq);
return (1);
}
if (f == bash_execute_unix_command)
unbind_unix_command (seq);
sh_xfree((kseq), "./bind.def", 402);
return (0);
}
| undefined8 unbind_keyseq(char *param_1)
{
int iVar1;
size_t sVar2;
undefined8 uVar3;
long in_FS_OFFSET;
int local_28;
int local_24;
long local_20;
undefined8 local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
sVar2 = strlen(param_1);
local_18 = sh_xmalloc(sVar2 * 2 + 1,"./bind.def",0x176);
iVar1 = rl_translate_keyseq(param_1,local_18,&local_28);
if (iVar1 == 0) {
local_20 = rl_function_of_keyseq_len(local_18,(long)local_28,0,&local_24);
if (local_20 == 0) {
sh_xfree(local_18,"./bind.def",0x17f);
uVar3 = 0;
}
else {
if (local_24 == 1) {
local_20 = *(long *)(local_20 + 0x1008);
}
iVar1 = rl_bind_keyseq(param_1,0);
if (iVar1 == 0) {
if (local_20 == lRam000000000010093e) {
unbind_unix_command(param_1);
}
sh_xfree(local_18,"./bind.def",0x192);
uVar3 = 0;
}
else {
sh_xfree(local_18,"./bind.def",0x18a);
uVar3 = gettext("`%s\': cannot unbind");
builtin_error(uVar3,param_1);
uVar3 = 1;
}
}
}
else {
sh_xfree(local_18,"./bind.def",0x179);
uVar3 = gettext("`%s\': cannot unbind");
builtin_error(uVar3,param_1);
uVar3 = 1;
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar3;
}
|
int
nchars_avail (fd, nchars)
int fd;
int nchars;
{
int result, chars_avail;
fd_set readfds, exceptfds;
sigset_t set, oset;
if (fd < 0 || nchars < 0)
return -1;
if (nchars == 0)
return (input_avail (fd));
chars_avail = 0;
do { unsigned int __i; fd_set *__arr = (
&readfds
); for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) ((__arr)->fds_bits)[__i] = 0; } while (0)
;
do { unsigned int __i; fd_set *__arr = (
&exceptfds
); for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) ((__arr)->fds_bits)[__i] = 0; } while (0)
;
((void) (((
&readfds
)->fds_bits)[((
fd
) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << ((
fd
) % (8 * (int) sizeof (__fd_mask)))))))
;
((void) (((
&exceptfds
)->fds_bits)[((
fd
) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << ((
fd
) % (8 * (int) sizeof (__fd_mask)))))))
;
sigprocmask (
0
, (sigset_t *)
((void *)0)
, &set);
sigaddset (&set,
17
);
sigemptyset (&oset);
while (1)
{
result = 0;
result = pselect (fd + 1, &readfds, (fd_set *)
((void *)0)
, &exceptfds, (struct timespec *)
((void *)0)
, &set);
if (result < 0)
return -1;
(*__errno_location ())
= 0;
result = ioctl (fd,
0x541B
, &chars_avail);
if (result == -1 &&
(*__errno_location ())
==
5
)
return -1;
if (chars_avail >= nchars)
break;
}
return 0;
}
| long long nchars_avail(unsigned long a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned long long *v4;
unsigned long long *v5;
char v6;
char v7;
char v8;
char v9;
unsigned long long v11;
if (a0 < 0) {
LABEL_400205:
v11 = 4294967295;
} else {
if (a1 < 0)
goto LABEL_400205;
if (!a1) {
v11 = input_avail(a0);
} else {
v0 = 0;
v4 = &v6;
for (v1 = 0; v1 <= 15; v1 += 1) {
v4[v1] = 0;
}
v5 = &v7;
for (v2 = 0; v2 <= 15; v2 += 1) {
v5[v2] = 0;
}
*(&(&v6)[8 * ((a0 < 0 ? a0 + 63 : a0) >> 6)]) = *(&(&v6)[8 * ((a0 < 0 ? a0 + 63 : a0) >> 6)]) | 1 << (((a0 + (a0 >> 31 >> 26) & 63) - (a0 >> 31 >> 26)) & 63);
*(&(&v7)[8 * ((a0 < 0 ? a0 + 63 : a0) >> 6)]) = *(&(&v7)[8 * ((a0 < 0 ? a0 + 63 : a0) >> 6)]) | 1 << (((a0 + (a0 >> 31 >> 26) & 63) - (a0 >> 31 >> 26)) & 63);
sigprocmask(0x0, NULL, &v8);
sigaddset(&v8, 0x11);
sigemptyset(&v9);
do {
v3 = 0;
v3 = pselect(a0 + 1, &v6, 0x0, &v7, 0x0, &v8);
if (v3 < 0) {
v11 = 4294967295;
goto LABEL_400448;
}
*(__errno_location()) = 0;
v3 = ioctl(a0, 0x541b);
if (v3 == -1 && *(__errno_location()) == 5) {
v11 = 4294967295;
goto LABEL_400448;
}
} while (a1 > v0);
v11 = 0;
}
}
LABEL_400448:
return v11;
}
|
int
ssh_digest_alg_by_name(const char *name)
{
int alg;
for (alg = 0; digests[alg].id != -1; alg++) {
if (strcasecmp(name, digests[alg].name) == 0)
return digests[alg].id;
}
return -1;
}
| undefined4 ssh_digest_alg_by_name(char *param_1)
{
int iVar1;
int local_c;
local_c = 0;
while( true ) {
if (*(int *)(digests + (long)local_c * 0x20) == -1) {
return 0xffffffff;
}
iVar1 = strcasecmp(param_1,*(char **)(digests + (long)local_c * 0x20 + 8));
if (iVar1 == 0) break;
local_c = __addvsi3(local_c,1);
}
return *(undefined4 *)(digests + (long)local_c * 0x20);
}
|
static EFT
get_next_format(const char **pf, EFT eft)
{
int infmt;
const char *f;
if (eft == FMTCHECK_WIDTH) {
(*pf)++;
return get_next_format_from_width(pf);
} else if (eft == FMTCHECK_PRECISION) {
(*pf)++;
return get_next_format_from_precision(pf);
}
f = *pf;
infmt = 0;
while (!infmt) {
f = strchr(f, '%');
if (f ==
((void *)0)
)
do { *(pf) = (f); return FMTCHECK_DONE; } while (0);
f++;
if (!*f)
do { *(pf) = (f); return FMTCHECK_UNKNOWN; } while (0);
if (*f != '%')
infmt = 1;
else
f++;
}
while (*f && (strchr("#'0- +", *f)))
f++;
if (*f == '*') {
do { *(pf) = (f); return FMTCHECK_WIDTH; } while (0);
}
while (
((*__ctype_b_loc ())[(int) ((
(unsigned char)*f
))] & (unsigned short int) _ISdigit)
) f++;
if (!*f) {
do { *(pf) = (f); return FMTCHECK_UNKNOWN; } while (0);
}
do { *(pf) = (f); return get_next_format_from_width(pf); } while (0);
}
| undefined8 get_next_format(byte **param_1,int param_2)
{
bool bVar1;
undefined8 uVar2;
char *pcVar3;
ushort **ppuVar4;
byte *local_10;
if (param_2 == 0x16) {
*param_1 = *param_1 + 1;
uVar2 = get_next_format_from_width(param_1);
}
else if (param_2 == 0x17) {
*param_1 = *param_1 + 1;
uVar2 = get_next_format_from_precision(param_1);
}
else {
local_10 = *param_1;
bVar1 = false;
while (!bVar1) {
pcVar3 = strchr((char *)local_10,0x25);
if (pcVar3 == (char *)0x0) {
*param_1 = (byte *)0x0;
return 0x18;
}
local_10 = (byte *)(pcVar3 + 1);
if (*local_10 == 0) {
*param_1 = local_10;
return 0x19;
}
if (*local_10 == 0x25) {
local_10 = (byte *)(pcVar3 + 2);
}
else {
bVar1 = true;
}
}
while ((*local_10 != 0 &&
(pcVar3 = strchr("#\'0- +",(int)(char)*local_10), pcVar3 != (char *)0x0))) {
local_10 = local_10 + 1;
}
if (*local_10 == 0x2a) {
*param_1 = local_10;
uVar2 = 0x16;
}
else {
while (ppuVar4 = __ctype_b_loc(), ((*ppuVar4)[*local_10] & 0x800) != 0) {
local_10 = local_10 + 1;
}
if (*local_10 == 0) {
*param_1 = local_10;
uVar2 = 0x19;
}
else {
*param_1 = local_10;
uVar2 = get_next_format_from_width(param_1);
}
}
}
return uVar2;
}
|
char *
sh_backslash_quote_for_double_quotes (string, flags)
char *string;
int flags;
{
unsigned char c;
char *result, *r, *s, *send;
size_t slen;
int mb_cur_max;
mbstate_t state; memset (&state, '\0', sizeof (mbstate_t));
slen = strlen (string);
send = string + slen;
mb_cur_max =
(__ctype_get_mb_cur_max ())
;
result = (char *)sh_xmalloc((2 * slen + 1), "shquote.c", 331);
for (r = result, s = string; s && (c = *s); s++)
{
if ((sh_syntaxtab[c] & 0x0040) && c != '\n')
*r++ = '\\';
else if (c == '\001' || c == '\177')
*r++ = '\001';
if ((locale_utf8locale && (c & 0x80)) ||
(locale_utf8locale == 0 && mb_cur_max > 1 && is_basic (c) == 0))
{
do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _k; _k = is_basic (*(s)); if (_k) mblength = 1; else if (locale_utf8locale && ((*(s) & 0x80) == 0)) mblength = *(s) != 0; else { state_bak = state; mblength = mbrlen ((s), (send) - (s), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; mblength = 1; } else mblength = (mblength < 1) ? 1 : mblength; for (_k = 0; _k < mblength; _k++) *(r)++ = *(s)++; } else *(r)++ = *(s)++; } while (0);
s--;
continue;
}
*r++ = c;
}
*r = '\0';
return (result);
}
| long long sh_backslash_quote_for_double_quotes(char *a0, unsigned long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
int tmp_14;
int tmp_10;
char v1;
unsigned int v2;
unsigned int v3;
char *v4;
char *v5;
unsigned long long v6;
unsigned long v7;
unsigned long v8;
char *v9;
unsigned long long v10;
unsigned long long v11;
unsigned int v13;
char *v15;
char *v16;
char *v18;
char *v19;
unsigned long long v20;
char *v21;
v0 = a1;
v13 = 0;
memset(&v10, 0x0, 0x8);
v7 = strlen(a0);
v8 = &a0[v7];
v3 = __ctype_get_mb_cur_max(a0, reg_64, a0, a3, a4, a5);
v9 = sh_xmalloc(v7 * 2 + 1, "shquote.c", 0x14b);
v4 = v9;
for (v5 = a0; v5; v5 += 1) {
v1 = *(v5);
if (!v1)
break;
if (v1) {
if ((sh_syntaxtab[v1] & 64) && v1 != 10) {
v15 = v4;
v4 += 1;
*(v15) = 92;
}
if ((v1 == 10 || !(sh_syntaxtab[v1] & 64)) && (v1 == 127 || v1 == 1)) {
v16 = v4;
v4 += 1;
*(v16) = 1;
}
if ((v1 < 0 || !locale_utf8locale) && (!is_basic(v1) || locale_utf8locale) && (v3 > 1 || locale_utf8locale)) {
if (locale_mb_cur_max > 1) {
v2 = is_basic(*(v5));
if (v2) {
v6 = 1;
} else {
if (locale_utf8locale && *(v5) >= 0)
v6 = *(v5);
if (!locale_utf8locale || *(v5) < 0) {
v11 = v10;
v6 = mbrlen(v5, v8 + -0x1 * v5, &v10, v8 + -0x1 * v5);
}
}
if (v6 != -2 && v6 != -1) {
if (v6)
v20 = v6;
else
v20 = 1;
v6 = v20;
}
if (v6 == -1 || v6 == -2) {
v10 = v11;
v6 = 1;
}
for (v2 = 0; v6 > v2; v2 += 1) {
tmp_14 = v5;
v5 += 1;
v21 = v4;
v4 += 1;
*(&a2) = *(tmp_14);
*(v21) = a2;
}
} else {
tmp_10 = v5;
v5 += 1;
v19 = v4;
v4 += 1;
*(&a2) = *(tmp_10);
*(v19) = a2;
}
v5 += 1;
} else {
v18 = v4;
v4 += 1;
*(v18) = v1;
}
}
}
*(v4) = 0;
return v9;
}
|
static void
print_stats (void)
{
if (status_level == STATUS_NONE)
return;
if (0 < progress_len)
{
fputc_unlocked ('\n',
stderr
);
progress_len = 0;
}
fprintf (
stderr
,
gettext ("%"
"l" "d"
"+%"
"l" "d"
" records in\n" "%"
"l" "d"
"+%"
"l" "d"
" records out\n")
,
r_full, r_partial, w_full, w_partial);
if (r_truncate != 0)
fprintf (
stderr
,
ngettext ("%"
"l" "d"
" truncated record\n",
"%"
"l" "d"
" truncated records\n",
select_plural (r_truncate)),
r_truncate);
if (status_level == STATUS_NOXFER)
return;
print_xfer_stats (0);
}
| unsigned long print_stats()
{
unsigned long result;
long v1;
long v2;
long v3;
long v4;
char *v5;
long v6;
long v7;
char *v8;
result = (unsigned int)status_level;
if ( status_level != 1 )
{
if ( progress_len > 0 )
{
fputc_unlocked(10, stderr);
progress_len = 0;
}
v1 = w_partial;
v2 = w_full;
v3 = r_partial;
v4 = r_full;
v5 = gettext("%ld+%ld records in\n%ld+%ld records out\n");
fprintf(stderr, v5, v4, v3, v2, v1);
if ( r_truncate )
{
v6 = r_truncate;
v7 = select_plural(r_truncate);
v8 = ngettext("%ld truncated record\n", "%ld truncated records\n", v7);
fprintf(stderr, v8, v6);
}
result = (unsigned int)status_level;
if ( status_level != 2 )
return print_xfer_stats(0LL);
}
return result;
}
|
static void
deb_parse_conffiles(struct pkginfo *pkg, const char *control_conffiles,
struct fsys_namenode_queue *newconffiles)
{
FILE *conff;
char conffilenamebuf[1000];
conff = fopen(control_conffiles, "r");
if (conff ==
((void *)0)
) {
if (
(*__errno_location ())
==
2
)
return;
ohshite(gettext("error trying to open %.250s"), control_conffiles);
}
push_cleanup(cu_closestream, ehflag_bombout, 1, conff);
while (fgets(conffilenamebuf, 1000 - 2, conff)) {
struct pkginfo *otherpkg;
struct fsys_node_pkgs_iter *iter;
struct fsys_namenode *namenode;
struct fsys_namenode_list *newconff;
struct conffile *searchconff;
char *conffilename = conffilenamebuf;
char *p;
enum fsys_namenode_flags confflags = FNNF_NEW_CONFF;
p = conffilename + strlen(conffilename);
if (p == conffilename)
ohshit(gettext("conffile file contains an empty line"));
if (p[-1] != '\n')
ohshit(gettext("conffile name '%s' is too long, or missing final newline"),
conffilename);
p = str_rtrim_spaces(conffilename, p);
if (p == conffilename)
continue;
if (conffilename[0] != '/') {
char *flag = conffilename;
char *flag_end = strchr(flag, ' ');
if (flag_end)
conffilename = flag_end + 1;
if (flag_end ==
((void *)0)
|| (conffilename[0] && conffilename[0] != '/'))
ohshit(gettext("conffile name '%s' is not an absolute pathname"), conffilename);
flag_end[0] = '\0';
if (conffilename[0] == '\0')
ohshit(gettext("conffile name missing after flag '%s'"), flag);
if (strcmp(flag, "remove-on-upgrade") == 0) {
confflags |= FNNF_RM_CONFF_ON_UPGRADE;
confflags &= ~FNNF_NEW_CONFF;
} else {
if (c_isspace(flag[0]))
warning(gettext("line with conffile filename '%s' has leading white spaces"),
conffilename);
ohshit(gettext("unknown flag '%s' for conffile '%s'"), flag, conffilename);
}
}
namenode = fsys_hash_find_node(conffilename, 0);
namenode->oldhash = "newconffile";
newconff = tar_fsys_namenode_queue_push(newconffiles, namenode);
searchconff =
((void *)0)
;
iter = fsys_node_pkgs_iter_new(newconff->namenode);
while ((otherpkg = fsys_node_pkgs_iter_next(iter))) {
debug(dbg_conffdetail,
"process_archive conffile '%s' in package %s - conff ?",
newconff->namenode->name, pkg_name(otherpkg, pnaw_always));
for (searchconff = otherpkg->installed.conffiles;
searchconff && strcmp(newconff->namenode->name, searchconff->name);
searchconff = searchconff->next)
debug(dbg_conffdetail,
"process_archive conffile '%s' in package %s - conff ? not '%s'",
newconff->namenode->name, pkg_name(otherpkg, pnaw_always),
searchconff->name);
if (searchconff) {
debug(dbg_conff,
"process_archive conffile '%s' package=%s %s hash=%s",
newconff->namenode->name, pkg_name(otherpkg, pnaw_always),
otherpkg == pkg ? "same" : "different!",
searchconff->hash);
if (otherpkg == pkg)
break;
}
}
fsys_node_pkgs_iter_free(iter);
if (searchconff) {
newconff->namenode->oldhash = searchconff->hash;
} else {
debug(dbg_conff, "process_archive conffile '%s' no package, no hash",
newconff->namenode->name);
}
newconff->namenode->flags |= confflags;
}
if (ferror(conff))
ohshite(gettext("read error in %.250s"), control_conffiles);
pop_cleanup(ehflag_normaltidy);
if (fclose(conff))
ohshite(gettext("error closing %.250s"), control_conffiles);
}
| void deb_parse_conffiles(long param_1,char *param_2,undefined8 param_3)
{
char cVar1;
int iVar2;
FILE *__stream;
int *piVar3;
undefined8 uVar4;
size_t sVar5;
char *pcVar6;
long lVar7;
undefined8 uVar8;
undefined8 uVar9;
long lVar10;
char *pcVar11;
long in_FS_OFFSET;
uint local_45c;
undefined8 *local_458;
char *local_450;
char acStack1033 [1001];
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
__stream = fopen(param_2,"r");
if (__stream == (FILE *)0x0) {
piVar3 = __errno_location();
if (*piVar3 != 2) {
uVar4 = gettext("error trying to open %.250s");
ohshite(uVar4,param_2);
}
}
else {
push_cleanup(uRam0000000000100c02,2,1,__stream);
while (pcVar11 = fgets(acStack1033 + 1,0x3e6,__stream), pcVar11 != (char *)0x0) {
pcVar11 = acStack1033 + 1;
local_45c = 1;
sVar5 = strlen(pcVar11);
if (pcVar11 + sVar5 == pcVar11) {
uVar4 = gettext("conffile file contains an empty line");
ohshit(uVar4);
}
if (acStack1033[sVar5] != '\n') {
uVar4 = gettext("conffile name \'%s\' is too long, or missing final newline");
ohshit(uVar4,pcVar11);
}
pcVar6 = (char *)str_rtrim_spaces(pcVar11,pcVar11 + sVar5);
if (pcVar6 != pcVar11) {
local_450 = pcVar11;
if (acStack1033[1] != '/') {
pcVar6 = strchr(pcVar11,0x20);
if ((pcVar6 == (char *)0x0) ||
((local_450 = pcVar6 + 1, *local_450 != '\0' && (*local_450 != '/')))) {
uVar4 = gettext("conffile name \'%s\' is not an absolute pathname");
ohshit(uVar4,local_450);
}
*pcVar6 = '\0';
if (*local_450 == '\0') {
uVar4 = gettext("conffile name missing after flag \'%s\'");
ohshit(uVar4,pcVar11);
}
iVar2 = strcmp(pcVar11,"remove-on-upgrade");
if (iVar2 == 0) {
local_45c = 0x400;
}
else {
cVar1 = c_isspace((int)acStack1033[1]);
if (cVar1 != '\0') {
uVar4 = gettext("line with conffile filename \'%s\' has leading white spaces");
warning(uVar4,local_450);
}
uVar4 = gettext("unknown flag \'%s\' for conffile \'%s\'");
ohshit(uVar4,pcVar11,local_450);
}
}
lVar7 = fsys_hash_find_node(local_450,0);
*(char **)(lVar7 + 0x38) = "newconffile";
lVar7 = tar_fsys_namenode_queue_push(param_3,lVar7);
local_458 = (undefined8 *)0x0;
uVar4 = fsys_node_pkgs_iter_new(*(undefined8 *)(lVar7 + 8));
do {
do {
lVar10 = fsys_node_pkgs_iter_next(uVar4);
if (lVar10 == 0) goto LAB_0010107b;
uVar8 = pkg_name(lVar10,3);
debug(0x80,"process_archive conffile \'%s\' in package %s - conff ?",
*(undefined8 *)(*(long *)(lVar7 + 8) + 8),uVar8);
local_458 = *(undefined8 **)(lVar10 + 0xb0);
while ((local_458 != (undefined8 *)0x0 &&
(iVar2 = strcmp(*(char **)(*(long *)(lVar7 + 8) + 8),(char *)local_458[1]),
iVar2 != 0))) {
uVar8 = local_458[1];
uVar9 = pkg_name(lVar10,3);
debug(0x80,"process_archive conffile \'%s\' in package %s - conff ? not \'%s\'",
*(undefined8 *)(*(long *)(lVar7 + 8) + 8),uVar9,uVar8);
local_458 = (undefined8 *)*local_458;
}
} while (local_458 == (undefined8 *)0x0);
uVar8 = local_458[2];
if (lVar10 == param_1) {
pcVar11 = "same";
}
else {
pcVar11 = "different!";
}
uVar9 = pkg_name(lVar10,3);
debug(0x10,"process_archive conffile \'%s\' package=%s %s hash=%s",
*(undefined8 *)(*(long *)(lVar7 + 8) + 8),uVar9,pcVar11,uVar8);
} while (lVar10 != param_1);
LAB_0010107b:
fsys_node_pkgs_iter_free(uVar4);
if (local_458 == (undefined8 *)0x0) {
debug(0x10,"process_archive conffile \'%s\' no package, no hash",
*(undefined8 *)(*(long *)(lVar7 + 8) + 8));
}
else {
*(undefined8 *)(*(long *)(lVar7 + 8) + 0x38) = local_458[2];
}
*(uint *)(*(long *)(lVar7 + 8) + 0x30) = *(uint *)(*(long *)(lVar7 + 8) + 0x30) | local_45c;
}
}
iVar2 = ferror(__stream);
if (iVar2 != 0) {
uVar4 = gettext("read error in %.250s");
ohshite(uVar4,param_2);
}
pop_cleanup(1);
iVar2 = fclose(__stream);
if (iVar2 != 0) {
uVar4 = gettext("error closing %.250s");
ohshite(uVar4,param_2);
}
}
if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
tty_quotemode(EditLine *el)
{
if (el->el_tty.t_mode == 2)
return 0;
el->el_tty.t_ts = el->el_tty.t_ed;
tty_setup_flags(el, &el->el_tty.t_ts, 2);
if (tty_setty(el,
1
, &el->el_tty.t_ts) == -1) {
return -1;
}
el->el_tty.t_mode = 2;
return 0;
}
| long long tty_quotemode(struct_0 *a0) {
struct_0 *v0;
int tmp_34;
int tmp_46;
unsigned long long v2;
unsigned long long v3;
v0 = a0;
if (a0->padding_2fc[4] == 2) {
v2 = 0;
return v2;
}
tmp_34 = *((&a0->field_284 + 4));
*(&a0->field_2bc) = *(&(&a0->padding_0)[1]);
a0->field_2c0 = tmp_34;
tmp_46 = *((&a0->field_294 + 4));
a0->field_2c8 = *((&a0->field_28c + 4));
a0->field_2d0 = tmp_46;
v3 = *((&a0->field_2a4 + 4));
a0->field_2d8 = *((&a0->field_29c + 4));
a0->field_2e0 = v3;
a0->field_2e8 = *((&a0->field_2ac + 4));
*(&a0->field_2f0) = *((&a0->field_2b4 + 4));
tty_setup_flags(a0, &a0->field_2bc, 0x2);
if (tty_setty(a0, 0x1, &a0->field_2bc) == -1) {
v2 = 4294967295;
return v2;
}
a0->padding_2fc[4] = 2;
v2 = 0;
return v2;
}
|
static int
mux_client_read_packet(int fd, struct sshbuf *m)
{
struct sshbuf *queue;
size_t need, have;
const u_char *ptr;
int r, oerrno;
if ((queue = sshbuf_new()) ==
((void *)0)
)
sshfatal("mux.c", __func__, 1552, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new");
if (mux_client_read(fd, queue, 4) != 0) {
if ((oerrno =
(*__errno_location ())
) ==
32
)
sshlog("mux.c", __func__, 1555, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "read header failed: %s", strerror(
(*__errno_location ())
))
;
sshbuf_free(queue);
(*__errno_location ())
= oerrno;
return -1;
}
need = (((u_int32_t)(((const u_char *)(sshbuf_ptr(queue)))[0]) << 24) | ((u_int32_t)(((const u_char *)(sshbuf_ptr(queue)))[1]) << 16) | ((u_int32_t)(((const u_char *)(sshbuf_ptr(queue)))[2]) << 8) | (u_int32_t)(((const u_char *)(sshbuf_ptr(queue)))[3]));
if (mux_client_read(fd, queue, need) != 0) {
oerrno =
(*__errno_location ())
;
sshlog("mux.c", __func__, 1564, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "read body failed: %s", strerror(
(*__errno_location ())
));
sshbuf_free(queue);
(*__errno_location ())
= oerrno;
return -1;
}
if ((r = sshbuf_get_string_direct(queue, &ptr, &have)) != 0 ||
(r = sshbuf_put(m, ptr, have)) != 0)
sshfatal("mux.c", __func__, 1571, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "dequeue");
sshbuf_free(queue);
return 0;
}
| int mux_client_read_packet(unsigned long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
char v2;
char v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long v7;
char v8;
unsigned int v12;
unsigned int v14;
unsigned int v15;
unsigned int v16;
v4 = sshbuf_new(a0, a1, a2, a3, a4, a5);
if (!v4)
sshfatal("mux.c", "mux_client_read_packet", 0x610, 0x1, 0x1, 0x0, "sshbuf_new");
if (mux_client_read(a0, v4, 0x4)) {
v1 = *(__errno_location());
if (v1 == 32) {
v7 = strerror(*(__errno_location()));
v6 = "read header failed: %s";
sshlog("mux.c", "mux_client_read_packet", 0x613, 0x1, 0x7, 0x0, *(&v8));
}
sshbuf_free(v4);
*(__errno_location()) = v1;
v15 = -1;
} else {
v12 = *(sshbuf_ptr(v4)) * 0x1000000;
v14 = v12 | (*((sshbuf_ptr(v4) + 1)) * 0x10000);
v15 = *((sshbuf_ptr(v4) + 2));
v16 = v14 | (v15 * 0x100);
v15 = *((sshbuf_ptr(v4) + 3));
v5 = v15 | v16;
if (mux_client_read(a0, v4, v5)) {
v1 = *(__errno_location());
v7 = strerror(*(__errno_location()));
v6 = "read body failed: %s";
sshlog("mux.c", "mux_client_read_packet", 0x61c, 0x1, 0x7, 0x0, *(&v8));
sshbuf_free(v4);
*(__errno_location()) = v1;
v15 = -1;
} else {
v0 = sshbuf_get_string_direct(v4, &v3, &v2);
if (!v0) {
v0 = sshbuf_put(a1, *(&v3), *(&v2), *(&v3));
if (!v0)
goto LABEL_405159;
}
v6 = "dequeue";
sshfatal("mux.c", "mux_client_read_packet", 0x623, 0x1, 0x1, ssh_err(v0), *(&v8));
LABEL_405159:
sshbuf_free(v4);
v15 = 0;
}
}
return v15;
}
|
static int clone_file_block(ext2_filsys fs,
blk64_t *block_nr,
e2_blkcnt_t blockcnt,
blk64_t ref_block __attribute__((unused)),
int ref_offset __attribute__((unused)),
void *priv_data)
{
struct dup_cluster *p =
((void *)0)
;
blk64_t new_block;
errcode_t retval;
struct clone_struct *cs = (struct clone_struct *) priv_data;
dnode_t *n;
e2fsck_t ctx;
blk64_t c;
int is_meta = 0;
int should_write = 1;
ctx = cs->ctx;
deferred_dec_badcount(cs);
if (*block_nr == 0)
return 0;
if (ext2fs_has_feature_shared_blocks(ctx->fs->super) &&
(ctx->options & 0x40000) &&
(ctx->options & 0x0008))
should_write = 0;
c = ((blockcnt) >> (fs)->cluster_ratio_bits);
if (check_if_fs_cluster(ctx, ((*block_nr) >> (fs)->cluster_ratio_bits)))
is_meta = 1;
if (c == cs->dup_cluster && cs->alloc_block) {
new_block = cs->alloc_block;
goto got_block;
}
if (ext2fs_test_block_bitmap2(ctx->block_dup_map, *block_nr)) {
n = dict_lookup(&clstr_dict,
((void *)(intptr_t)(((*block_nr) >> (fs)->cluster_ratio_bits))));
if (!n) {
com_err("clone_file_block", 0,
(gettext ("internal error: can't find dup_blk for %llu\n")),
(unsigned long long) *block_nr);
return 0;
}
p = (struct dup_cluster *) ((n)->dict_data);
cs->dup_cluster = c;
new_block = 0;
retval = ext2fs_map_cluster_block(fs, cs->ino,
EXT2_INODE(cs->inode),
blockcnt, &new_block);
if (retval == 0 && new_block != 0 &&
((new_block) >> (ctx->fs)->cluster_ratio_bits) !=
((*block_nr) >> (ctx->fs)->cluster_ratio_bits))
goto cluster_alloc_ok;
retval = ext2fs_new_block2(fs, 0, ctx->block_found_map,
&new_block);
if (retval) {
cs->errcode = retval;
return 2;
}
if (ext2fs_has_feature_shared_blocks(fs->super)) {
ext2fs_block_alloc_stats2(fs, new_block, +1);
}
cluster_alloc_ok:
cs->alloc_block = new_block;
got_block:
new_block &= ~((1 << (fs)->cluster_ratio_bits) - 1);
new_block += ((1 << (fs)->cluster_ratio_bits) - 1) & blockcnt;
if (cs->dir && (blockcnt >= 0)) {
retval = ext2fs_set_dir_block2(fs->dblist,
cs->dir, new_block, blockcnt);
if (retval) {
cs->errcode = retval;
return 2;
}
}
retval = io_channel_read_blk64(fs->io, *block_nr, 1, cs->buf);
if (retval) {
cs->errcode = retval;
return 2;
}
if (should_write) {
retval = io_channel_write_blk64(fs->io, new_block, 1, cs->buf);
if (retval) {
cs->errcode = retval;
return 2;
}
}
cs->save_dup_cluster = (is_meta ?
((void *)0)
: p);
cs->save_blocknr = *block_nr;
*block_nr = new_block;
ext2fs_mark_block_bitmap2(ctx->block_found_map, new_block);
ext2fs_mark_block_bitmap2(fs->block_map, new_block);
if (!should_write) {
return 0;
}
return 1;
}
return 0;
}
| undefined8
clone_file_block(long param_1,ulong *param_2,ulong param_3,undefined8 param_4,undefined8 param_5,
long *param_6)
{
ulong uVar1;
bool bVar2;
int iVar3;
int iVar4;
undefined8 uVar5;
long lVar6;
long in_FS_OFFSET;
ulong local_58;
long local_50;
long *local_48;
long *local_40;
long local_38;
long local_30;
long local_28;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
local_50 = 0;
bVar2 = true;
local_40 = (long *)param_6[5];
local_48 = param_6;
deferred_dec_badcount(param_6);
if (*param_2 == 0) {
uVar5 = 0;
goto LAB_00102303;
}
iVar3 = ext2fs_has_feature_shared_blocks(*(undefined8 *)(*local_40 + 0x20));
if (((iVar3 != 0) && ((*(uint *)((long)local_40 + 0x4c) & 0x40000) != 0)) &&
((*(uint *)((long)local_40 + 0x4c) & 8) != 0)) {
bVar2 = false;
}
local_38 = (long)param_3 >> ((byte)*(undefined4 *)(param_1 + 0xc0) & 0x3f);
iVar3 = check_if_fs_cluster(local_40,*param_2 >> ((byte)*(undefined4 *)(param_1 + 0xc0) & 0x3f));
if ((local_38 == local_48[1]) && (local_48[2] != 0)) {
local_58 = local_48[2];
}
else {
iVar4 = ext2fs_test_block_bitmap2(local_40[0x35],*param_2);
if (iVar4 == 0) {
uVar5 = 0;
goto LAB_00102303;
}
local_30 = dict_lookup(clstr_dict,*param_2 >> ((byte)*(undefined4 *)(param_1 + 0xc0) & 0x3f));
if (local_30 == 0) {
uVar1 = *param_2;
uVar5 = gettext("internal error: can\'t find dup_blk for %llu\n");
com_err("clone_file_block",0,uVar5,uVar1);
uVar5 = 0;
goto LAB_00102303;
}
local_50 = *(long *)(local_30 + 0x28);
local_48[1] = local_38;
local_58 = 0;
uVar5 = EXT2_INODE(local_48[6]);
local_28 = ext2fs_map_cluster_block
(param_1,*(undefined4 *)((long)local_48 + 0x1c),uVar5,param_3,&local_58);
if (((local_28 != 0) || (local_58 == 0)) ||
(local_58 >> ((byte)*(undefined4 *)(*local_40 + 0xc0) & 0x3f) ==
*param_2 >> ((byte)*(undefined4 *)(*local_40 + 0xc0) & 0x3f))) {
local_28 = ext2fs_new_block2(param_1,0,local_40[0x34]);
if (local_28 != 0) {
*local_48 = local_28;
uVar5 = 2;
goto LAB_00102303;
}
iVar4 = ext2fs_has_feature_shared_blocks(*(undefined8 *)(param_1 + 0x20));
if (iVar4 != 0) {
ext2fs_block_alloc_stats2(param_1,local_58,1);
}
}
local_48[2] = local_58;
}
local_58 = (local_58 & (long)-(1 << ((byte)*(undefined4 *)(param_1 + 0xc0) & 0x1f))) +
((long)((1 << ((byte)*(undefined4 *)(param_1 + 0xc0) & 0x1f)) + -1) & param_3);
if (((*(int *)(local_48 + 3) == 0) || ((long)param_3 < 0)) ||
(local_28 = ext2fs_set_dir_block2
(*(undefined8 *)(param_1 + 0x90),*(undefined4 *)(local_48 + 3),local_58,
param_3), local_28 == 0)) {
local_28 = io_channel_read_blk64(*(undefined8 *)(param_1 + 8),*param_2,1,local_48[4]);
if (local_28 == 0) {
if ((bVar2) &&
(local_28 = io_channel_write_blk64(*(undefined8 *)(param_1 + 8),local_58,1,local_48[4]),
local_28 != 0)) {
*local_48 = local_28;
uVar5 = 2;
}
else {
lVar6 = local_50;
if (iVar3 != 0) {
lVar6 = 0;
}
local_48[7] = lVar6;
local_48[8] = *param_2;
*param_2 = local_58;
ext2fs_mark_block_bitmap2(local_40[0x34],local_58);
ext2fs_mark_block_bitmap2(*(undefined8 *)(param_1 + 0x58),local_58);
if (bVar2) {
uVar5 = 1;
}
else {
uVar5 = 0;
}
}
}
else {
*local_48 = local_28;
uVar5 = 2;
}
}
else {
*local_48 = local_28;
uVar5 = 2;
}
LAB_00102303:
if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar5;
}
|
static void
set_join_field (size_t *var, size_t val)
{
if (*var !=
(18446744073709551615UL)
&& *var != val)
{
unsigned long int var1 = *var + 1;
unsigned long int val1 = val + 1;
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"incompatible join fields %lu, %lu\"), var1, val1), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("incompatible join fields %lu, %lu"), var1, val1), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("incompatible join fields %lu, %lu"), var1, val1), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
*var = val;
}
| void set_join_field(unsigned long long *a0, unsigned long a1) {
unsigned long v0;
unsigned long v1;
unsigned long long *v3;
if (*(a0) != -1 && a1 != *(a0)) {
v0 = *(a0) + 1;
v1 = a1 + 1;
error(0x1, 0x0, gettext("incompatible join fields %lu, %lu"));
}
if (a1 == *(a0) || *(a0) == -1) {
v3 = a0;
*(a0) = a1;
return;
}
}
|
static void open_files (void)
{
if (!read_only) {
if (gr_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, grp_file);
fail_exit (4);
}
gr_locked =
1
;
if (is_shadow) {
if (sgr_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, sgr_file);
fail_exit (4);
}
sgr_locked =
1
;
}
}
if (gr_open (read_only ?
00
:
0100
|
02
) == 0) {
fprintf (
stderr
, gettext ("%s: cannot open %s\n"), Prog,
grp_file);
if (use_system_grp_file) {
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
4
, "cannot open %s", grp_file) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
}
fail_exit (3);
}
if (is_shadow && (sgr_open (read_only ?
00
:
0100
|
02
) == 0)) {
fprintf (
stderr
, gettext ("%s: cannot open %s\n"), Prog,
sgr_file);
if (use_system_sgr_file) {
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
4
, "cannot open %s", sgr_file) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
}
fail_exit (3);
}
}
| void open_files() {
void* v0;
void* v1;
char *v2;
char *v3;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
if ((read_only ^ 1)) {
v5 = gr_lock();
if (!v5) {
fprintf(*(&stderr), gettext("%s: cannot lock %s; try again later.\n"));
fail_exit(0x4);
}
gr_locked = 1;
if (is_shadow) {
v6 = sgr_lock();
if (!v6) {
fprintf(*(&stderr), gettext("%s: cannot lock %s; try again later.\n"));
fail_exit(0x4);
}
sgr_locked = 1;
}
}
if (!(read_only ^ 1) || !is_shadow && v5 || v5 && v6) {
if (read_only)
v7 = 0;
else
v7 = 66;
v8 = gr_open(v7);
if (!v8) {
fprintf(*(&stderr), gettext("%s: cannot open %s\n"));
if (use_system_grp_file) {
v2 = setlocale(0x6, NULL);
v0 = 0;
if (v2)
v0 = strdup(v2);
if (v0)
setlocale(0x6, "C");
syslog(0x4, "cannot open %s");
if (v0) {
setlocale(0x6, v0);
free(v0);
}
}
fail_exit(0x3);
} else {
v9 = is_shadow;
if (is_shadow) {
if (read_only)
v10 = 0;
else
v10 = 66;
v11 = sgr_open(v10);
if (!v11) {
fprintf(*(&stderr), gettext("%s: cannot open %s\n"));
if (use_system_sgr_file) {
v3 = setlocale(0x6, NULL);
v1 = 0;
if (v3)
v1 = strdup(v3);
if (v1)
setlocale(0x6, "C");
syslog(0x4, "cannot open %s");
if (v1) {
setlocale(0x6, v1);
free(v1);
}
}
fail_exit(0x3);
}
}
if (!is_shadow || v11)
return;
}
}
}
|
static int ext4_modify_extent_list(e2fsck_t ctx, struct extent_list *list,
struct ext2fs_extent *ex, int del)
{
int ret, offset;
unsigned int i;
struct ext2fs_extent add_ex = *ex;
for (i = 0; i < list->count; i++) {
if (((&list->extents[i])->e_lblk + (&list->extents[i])->e_len - 1) < add_ex.e_lblk)
continue;
if (list->extents[i].e_lblk > ((&add_ex)->e_lblk + (&add_ex)->e_len - 1))
break;
ext2fs_unmark_block_bitmap_range2(ctx->fs->block_map,
list->extents[i].e_pblk, list->extents[i].e_len);
if (list->extents[i].e_lblk < add_ex.e_lblk &&
((&list->extents[i])->e_lblk + (&list->extents[i])->e_len - 1) > ((&add_ex)->e_lblk + (&add_ex)->e_len - 1)) {
ret = make_room(list, i + 1);
if (ret)
return ret;
list->extents[i + 1] = list->extents[i];
offset = ((&add_ex)->e_lblk + (&add_ex)->e_len - 1) + 1 - list->extents[i].e_lblk;
list->extents[i + 1].e_lblk += offset;
list->extents[i + 1].e_pblk += offset;
list->extents[i + 1].e_len -= offset;
list->extents[i].e_len =
add_ex.e_lblk - list->extents[i].e_lblk;
break;
}
if (add_ex.e_lblk <= list->extents[i].e_lblk &&
((&list->extents[i])->e_lblk + (&list->extents[i])->e_len - 1) <= ((&add_ex)->e_lblk + (&add_ex)->e_len - 1)) {
list->extents[i].e_len = 0;
continue;
}
if (((&list->extents[i])->e_lblk + (&list->extents[i])->e_len - 1) > ((&add_ex)->e_lblk + (&add_ex)->e_len - 1)) {
offset = ((&add_ex)->e_lblk + (&add_ex)->e_len - 1) + 1 - list->extents[i].e_lblk;
list->extents[i].e_lblk += offset;
list->extents[i].e_pblk += offset;
list->extents[i].e_len -= offset;
break;
}
if (((&add_ex)->e_lblk + (&add_ex)->e_len - 1) >= ((&list->extents[i])->e_lblk + (&list->extents[i])->e_len - 1))
list->extents[i].e_len =
add_ex.e_lblk > list->extents[i].e_lblk ?
add_ex.e_lblk - list->extents[i].e_lblk : 0;
}
if (add_ex.e_len && !del) {
make_room(list, list->count);
list->extents[list->count - 1] = add_ex;
}
ex_sort_and_merge(list);
for (i = 0; i < list->count; i++)
ext2fs_mark_block_bitmap_range2(ctx->fs->block_map,
list->extents[i].e_pblk, list->extents[i].e_len);
ext2fs_mark_bb_dirty(ctx->fs);
return 0;
}
| int ext4_modify_extent_list(long *param_1,long param_2,undefined8 *param_3,int param_4)
{
undefined8 *puVar1;
undefined8 *puVar2;
long lVar3;
undefined8 uVar4;
ulong uVar5;
ulong uVar6;
undefined8 uVar7;
int iVar8;
int iVar9;
long in_FS_OFFSET;
uint local_34;
int local_18;
lVar3 = *(long *)(in_FS_OFFSET + 0x28);
uVar4 = *param_3;
uVar5 = param_3[1];
uVar6 = param_3[2];
local_34 = 0;
do {
local_18 = (int)uVar6;
if (*(uint *)(param_2 + 0x10) <= local_34) {
LAB_00101fad:
if ((local_18 != 0) && (param_4 == 0)) {
make_room(param_2,*(undefined4 *)(param_2 + 0x10));
puVar2 = (undefined8 *)
(*(long *)(param_2 + 8) + (ulong)(*(int *)(param_2 + 0x10) - 1) * 0x18);
*puVar2 = uVar4;
puVar2[1] = uVar5;
puVar2[2] = uVar6;
}
ex_sort_and_merge(param_2);
for (local_34 = 0; local_34 < *(uint *)(param_2 + 0x10); local_34 = local_34 + 1) {
ext2fs_mark_block_bitmap_range2
(*(undefined8 *)(*param_1 + 0x58),
*(undefined8 *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8)),
*(undefined4 *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 0x10));
}
ext2fs_mark_bb_dirty(*param_1);
iVar8 = 0;
LAB_0010209a:
if (lVar3 == *(long *)(in_FS_OFFSET + 0x28)) {
return iVar8;
}
__stack_chk_fail();
}
if (uVar5 <= ((ulong)*(uint *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 0x10) +
*(long *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8)) - 1) {
if ((uVar5 + (uVar6 & 0xffffffff)) - 1 <
*(ulong *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8)) goto LAB_00101fad;
ext2fs_unmark_block_bitmap_range2
(*(undefined8 *)(*param_1 + 0x58),
*(undefined8 *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8)),
*(undefined4 *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 0x10));
iVar9 = (int)uVar5;
if ((*(ulong *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8) < uVar5) &&
((uVar5 + (uVar6 & 0xffffffff)) - 1 <
((ulong)*(uint *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 0x10) +
*(long *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8)) - 1)) {
iVar8 = make_room(param_2,local_34 + 1);
if (iVar8 != 0) goto LAB_0010209a;
puVar2 = (undefined8 *)(*(long *)(param_2 + 8) + (ulong)local_34 * 0x18);
puVar1 = (undefined8 *)(*(long *)(param_2 + 8) + (ulong)(local_34 + 1) * 0x18);
uVar7 = puVar2[1];
*puVar1 = *puVar2;
puVar1[1] = uVar7;
puVar1[2] = puVar2[2];
iVar8 = (iVar9 + local_18) -
(int)*(undefined8 *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8);
*(long *)((ulong)(local_34 + 1) * 0x18 + *(long *)(param_2 + 8) + 8) =
(long)iVar8 + *(long *)((ulong)(local_34 + 1) * 0x18 + *(long *)(param_2 + 8) + 8);
*(long *)((ulong)(local_34 + 1) * 0x18 + *(long *)(param_2 + 8)) =
(long)iVar8 + *(long *)((ulong)(local_34 + 1) * 0x18 + *(long *)(param_2 + 8));
*(int *)((ulong)(local_34 + 1) * 0x18 + *(long *)(param_2 + 8) + 0x10) =
*(int *)((ulong)(local_34 + 1) * 0x18 + *(long *)(param_2 + 8) + 0x10) - iVar8;
*(int *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 0x10) =
iVar9 - (int)*(undefined8 *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8);
goto LAB_00101fad;
}
if ((*(ulong *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8) < uVar5) ||
((uVar5 + (uVar6 & 0xffffffff)) - 1 <
((ulong)*(uint *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 0x10) +
*(long *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8)) - 1)) {
if ((uVar5 + (uVar6 & 0xffffffff)) - 1 <
((ulong)*(uint *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 0x10) +
*(long *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8)) - 1) {
iVar9 = (iVar9 + local_18) -
(int)*(undefined8 *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8);
*(long *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8) =
*(long *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8) + (long)iVar9;
*(long *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8)) =
*(long *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8)) + (long)iVar9;
*(int *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 0x10) =
*(int *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 0x10) - iVar9;
goto LAB_00101fad;
}
if (((ulong)*(uint *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 0x10) +
*(long *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8)) - 1 <=
(uVar5 + (uVar6 & 0xffffffff)) - 1) {
if (*(ulong *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8) < uVar5) {
iVar9 = iVar9 - (int)*(undefined8 *)
((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 8);
}
else {
iVar9 = 0;
}
*(int *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 0x10) = iVar9;
}
}
else {
*(undefined4 *)((ulong)local_34 * 0x18 + *(long *)(param_2 + 8) + 0x10) = 0;
}
}
local_34 = local_34 + 1;
} while( true );
}
|
int
function_handler (self, defs, arg)
char *self;
DEF_FILE *defs;
char *arg;
{
register BUILTIN_DESC *builtin;
builtin = current_builtin (self, defs);
if (builtin == 0)
{
line_error (defs, "syntax error: no current builtin for $FUNCTION directive");
exit (1);
}
if (builtin->function)
line_error (defs, "%s already has a function (%s)",
builtin->name, builtin->function);
else
builtin->function = get_arg (self, defs, arg);
return (0);
}
| long long function_handler(unsigned int a0, unsigned long a1, unsigned int a2, unsigned int a3) {
unsigned long long v1[2];
v1 = current_builtin(a0, a1, a1, a3);
if (!v1) {
line_error(a1, "syntax error: no current builtin for $FUNCTION directive", a2, a3);
exit(0x1);
}
if (v1[1])
line_error(a1, "%s already has a function (%s)", v1[0], v1[1]);
else
v1[1] = get_arg(a0, a1, a2, a1);
return 0;
}
|
void
initialize_server_options(ServerOptions *options)
{
memset(options, 0, sizeof(*options));
options->use_pam = -1;
options->num_ports = 0;
options->ports_from_cmdline = 0;
options->queued_listen_addrs =
((void *)0)
;
options->num_queued_listens = 0;
options->listen_addrs =
((void *)0)
;
options->num_listen_addrs = 0;
options->address_family = -1;
options->routing_domain =
((void *)0)
;
options->num_host_key_files = 0;
options->num_host_cert_files = 0;
options->host_key_agent =
((void *)0)
;
options->pid_file =
((void *)0)
;
options->login_grace_time = -1;
options->permit_root_login = -1;
options->ignore_rhosts = -1;
options->ignore_user_known_hosts = -1;
options->print_motd = -1;
options->print_lastlog = -1;
options->x11_forwarding = -1;
options->x11_display_offset = -1;
options->x11_use_localhost = -1;
options->permit_tty = -1;
options->permit_user_rc = -1;
options->xauth_location =
((void *)0)
;
options->strict_modes = -1;
options->tcp_keep_alive = -1;
options->log_facility = SYSLOG_FACILITY_NOT_SET;
options->log_level = SYSLOG_LEVEL_NOT_SET;
options->num_log_verbose = 0;
options->log_verbose =
((void *)0)
;
options->hostbased_authentication = -1;
options->hostbased_uses_name_from_packet_only = -1;
options->hostbased_accepted_algos =
((void *)0)
;
options->hostkeyalgorithms =
((void *)0)
;
options->pubkey_authentication = -1;
options->pubkey_auth_options = -1;
options->pubkey_accepted_algos =
((void *)0)
;
options->kerberos_authentication = -1;
options->kerberos_or_local_passwd = -1;
options->kerberos_ticket_cleanup = -1;
options->kerberos_get_afs_token = -1;
options->gss_authentication=-1;
options->gss_cleanup_creds = -1;
options->gss_strict_acceptor = -1;
options->password_authentication = -1;
options->kbd_interactive_authentication = -1;
options->permit_empty_passwd = -1;
options->permit_user_env = -1;
options->permit_user_env_allowlist =
((void *)0)
;
options->compression = -1;
options->rekey_limit = -1;
options->rekey_interval = -1;
options->allow_tcp_forwarding = -1;
options->allow_streamlocal_forwarding = -1;
options->allow_agent_forwarding = -1;
options->num_allow_users = 0;
options->num_deny_users = 0;
options->num_allow_groups = 0;
options->num_deny_groups = 0;
options->ciphers =
((void *)0)
;
options->macs =
((void *)0)
;
options->kex_algorithms =
((void *)0)
;
options->ca_sign_algorithms =
((void *)0)
;
options->fwd_opts.gateway_ports = -1;
options->fwd_opts.streamlocal_bind_mask = (mode_t)-1;
options->fwd_opts.streamlocal_bind_unlink = -1;
options->num_subsystems = 0;
options->max_startups_begin = -1;
options->max_startups_rate = -1;
options->max_startups = -1;
options->per_source_max_startups = -1;
options->per_source_masklen_ipv4 = -1;
options->per_source_masklen_ipv6 = -1;
options->max_authtries = -1;
options->max_sessions = -1;
options->banner =
((void *)0)
;
options->use_dns = -1;
options->client_alive_interval = -1;
options->client_alive_count_max = -1;
options->num_authkeys_files = 0;
options->num_accept_env = 0;
options->num_setenv = 0;
options->permit_tun = -1;
options->permitted_opens =
((void *)0)
;
options->permitted_listens =
((void *)0)
;
options->adm_forced_command =
((void *)0)
;
options->chroot_directory =
((void *)0)
;
options->authorized_keys_command =
((void *)0)
;
options->authorized_keys_command_user =
((void *)0)
;
options->revoked_keys_file =
((void *)0)
;
options->sk_provider =
((void *)0)
;
options->trusted_user_ca_keys =
((void *)0)
;
options->authorized_principals_file =
((void *)0)
;
options->authorized_principals_command =
((void *)0)
;
options->authorized_principals_command_user =
((void *)0)
;
options->ip_qos_interactive = -1;
options->ip_qos_bulk = -1;
options->version_addendum =
((void *)0)
;
options->fingerprint_hash = -1;
options->disable_forwarding = -1;
options->expose_userauth_info = -1;
options->required_rsa_size = -1;
}
| void initialize_server_options(struct_0 *a0) {
struct_0 *v1;
memset(a0, 0x0, 0x1ec8);
a0->field_1e18 = -1;
a0->field_0 = 0;
a0->field_4 = 0;
a0->field_408 = 0;
a0->field_410 = 0;
a0->field_418 = 0;
a0->field_420 = 0;
a0->field_424 = -1;
a0->field_428 = 0;
a0->field_440 = 0;
a0->field_450 = 0;
a0->field_458 = 0;
a0->field_460 = 0;
a0->field_470 = -1;
a0->field_474 = -1;
a0->field_478 = -1;
a0->field_47c = -1;
a0->field_480 = -1;
a0->field_484 = -1;
a0->field_488 = -1;
a0->field_48c = -1;
a0->field_490 = -1;
a0->field_4a0 = -1;
a0->field_4a4 = -1;
a0->field_498 = 0;
a0->field_4a8 = -1;
a0->field_4ac = -1;
a0->field_4dc = -1;
a0->field_4e0 = -1;
a0->field_4e4 = 0;
a0->field_4e8 = 0;
a0->field_4f0 = -1;
a0->field_4f4 = -1;
a0->field_4f8 = 0;
a0->field_500 = 0;
a0->field_510 = -1;
a0->field_520 = -1;
a0->field_518 = 0;
a0->field_524 = -1;
a0->field_528 = -1;
a0->field_52c = -1;
a0->field_530 = -1;
a0->field_534 = -1;
a0->field_538 = -1;
a0->field_53c = -1;
a0->field_540 = -1;
a0->field_544 = -1;
a0->field_548 = -1;
a0->field_54c = -1;
a0->field_550 = 0;
a0->field_558 = -1;
a0->field_1e80 = -1;
a0->field_1e88 = -1;
a0->field_55c = -1;
a0->field_560 = -1;
a0->field_564 = -1;
a0->field_56c = 0;
a0->field_578 = 0;
a0->field_588 = 0;
a0->field_598 = 0;
a0->field_4b8 = 0;
a0->field_4c0 = 0;
a0->field_4c8 = 0;
a0->field_508 = 0;
a0->field_4d0 = -1;
a0->field_4d4 = -1;
a0->field_4d8 = -1;
a0->field_5a8 = 0;
a0->field_1dd0 = -1;
a0->field_1dd4 = -1;
a0->field_1dd8 = -1;
a0->field_1ddc = -1;
a0->field_1de0 = -1;
a0->field_1de4 = -1;
a0->field_1de8 = -1;
a0->field_1dec = -1;
a0->field_1df0 = 0;
a0->field_1df8 = -1;
a0->field_1dfc = -1;
a0->field_1e00 = -1;
a0->field_1e04 = 0;
a0->field_1db0 = 0;
a0->field_1dc0 = 0;
a0->field_1e1c = -1;
a0->field_1e20 = 0;
a0->field_1e30 = 0;
a0->field_1e10 = 0;
a0->field_1e40 = 0;
a0->field_1e58 = 0;
a0->field_1e60 = 0;
a0->field_1e48 = 0;
a0->field_1eb8 = 0;
a0->field_1e50 = 0;
a0->field_1e68 = 0;
a0->field_1e70 = 0;
a0->field_1e78 = 0;
a0->field_4b0 = -1;
a0->field_4b4 = -1;
a0->field_1e90 = 0;
a0->field_1ea8 = -1;
a0->field_568 = -1;
a0->field_1eac = -1;
v1 = a0;
a0->field_1ec0 = -1;
return;
}
|
void __attribute__((visibility ("hidden"))) _tr_stored_block(s, buf, stored_len, last)
deflate_state *s;
charf *buf;
ulg stored_len;
int last;
{
{ int len = 3; if (s->bi_valid > (int)16 - len) { int val = (int)(0<<1) + last; s->bi_buf |= (ush)val << s->bi_valid; { {s->pending_buf[s->pending++] = (Bytef)((uch)((s->bi_buf) & 0xff));}; {s->pending_buf[s->pending++] = (Bytef)((uch)((ush)(s->bi_buf) >> 8));}; }; s->bi_buf = (ush)val >> (16 - s->bi_valid); s->bi_valid += len - 16; } else { s->bi_buf |= (ush)((0<<1) + last) << s->bi_valid; s->bi_valid += len; }};
bi_windup(s);
{ {s->pending_buf[s->pending++] = (Bytef)((uch)(((ush)stored_len) & 0xff));}; {s->pending_buf[s->pending++] = (Bytef)((uch)((ush)((ush)stored_len) >> 8));}; };
{ {s->pending_buf[s->pending++] = (Bytef)((uch)(((ush)~stored_len) & 0xff));}; {s->pending_buf[s->pending++] = (Bytef)((uch)((ush)((ush)~stored_len) >> 8));}; };
if (stored_len)
memcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
s->pending += stored_len;
}
| void _tr_stored_block(struct_0 *a0, void* a1, unsigned long a2, unsigned long a3) {
void* v0;
int tmp_153;
int tmp_161;
int tmp_167;
int tmp_213;
int tmp_73;
int tmp_79;
int tmp_114;
int tmp_120;
int tmp_144;
int tmp_150;
int tmp_199;
struct_0 *v1;
unsigned int v2;
char v4;
char *v5;
char *v6;
struct_0 *v7;
v1 = a0;
v0 = a1;
v2 = 3;
if (a0->field_1734 > 16 - v2) {
a0->field_1730 = (a3 << (a0->field_1734 & 31)) | a0->field_1730;
tmp_153 = a0->field_1730;
tmp_161 = a0->field_10;
tmp_167 = a0->field_28;
a0->field_28 = a0->field_28 + 1;
*(&a2) = tmp_153;
*((tmp_167 + tmp_161)) = a2;
v4 = a0->field_1730 >> 8;
v5 = a0->field_10;
tmp_213 = a0->field_28;
a0->field_28 = a0->field_28 + 1;
v5[tmp_213] = v4;
a0->field_1730 = a3 >> ((16 - a0->field_1734) & 31);
a0->field_1734 = v2 - 16 + a0->field_1734;
} else {
a0->field_1730 = (a3 << (a0->field_1734 & 31)) | a0->field_1730;
a0->field_1734 = a0->field_1734 + v2;
}
bi_windup(a0);
tmp_73 = a0->field_10;
tmp_79 = a0->field_28;
a0->field_28 = a0->field_28 + 1;
*((tmp_79 + tmp_73)) = a2;
tmp_114 = a0->field_10;
tmp_120 = a0->field_28;
a0->field_28 = a0->field_28 + 1;
*((tmp_120 + tmp_114)) = a2 / 0x100;
tmp_144 = a0->field_10;
tmp_150 = a0->field_28;
a0->field_28 = a0->field_28 + 1;
*((tmp_150 + tmp_144)) = !(a2);
v6 = a0->field_10;
tmp_199 = a0->field_28;
a0->field_28 = a0->field_28 + 1;
v6[tmp_199] = !(a2) >> 8;
if (a2)
memcpy(a0->field_10 + a0->field_28, v0, a2);
v7 = a0;
a0->field_28 = a0->field_28 + a2;
return;
}
|
int
sshsk_load_resident(const char *provider_path, const char *device,
const char *pin, u_int flags, struct sshsk_resident_key ***srksp,
size_t *nsrksp)
{
struct sshsk_provider *skp =
((void *)0)
;
int r = -1;
struct sk_resident_key **rks =
((void *)0)
;
size_t i, nrks = 0, nsrks = 0;
struct sshkey *key =
((void *)0)
;
struct sshsk_resident_key *srk =
((void *)0)
, **srks =
((void *)0)
, **tmp;
uint8_t sk_flags;
struct sk_option **opts =
((void *)0)
;
sshlog("ssh-sk.c", __func__, 797, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "provider \"%s\"%s", provider_path, (pin !=
((void *)0)
&& *pin != '\0') ? ", have-pin": "")
;
if (srksp ==
((void *)0)
|| nsrksp ==
((void *)0)
)
return -10;
*srksp =
((void *)0)
;
*nsrksp = 0;
if ((r = make_options(device,
((void *)0)
, &opts)) != 0)
goto out;
if ((skp = sshsk_open(provider_path)) ==
((void *)0)
) {
r = -4;
goto out;
}
if ((r = skp->sk_load_resident_keys(pin, opts, &rks, &nrks)) != 0) {
sshlog("ssh-sk.c", __func__, 812, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Provider \"%s\" returned failure %d", provider_path, r);
r = skerr_to_ssherr(r);
goto out;
}
for (i = 0; i < nrks; i++) {
sshlog("ssh-sk.c", __func__, 817, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "rk %zu: slot %zu, alg %d, app \"%s\", uidlen %zu", i, rks[i]->slot, rks[i]->alg, rks[i]->application, rks[i]->user_id_len)
;
if (strncmp(rks[i]->application, "ssh:", 4) != 0)
continue;
switch (rks[i]->alg) {
case 0x00:
case 0x01:
break;
default:
continue;
}
sk_flags = 0x01|0x20;
if ((rks[i]->flags & 0x04))
sk_flags |= 0x04;
if ((r = sshsk_key_from_response(rks[i]->alg,
rks[i]->application, sk_flags, &rks[i]->key, &key)) != 0)
goto out;
if ((srk = calloc(1, sizeof(*srk))) ==
((void *)0)
) {
sshlog("ssh-sk.c", __func__, 837, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "calloc failed");
r = -2;
goto out;
}
srk->key = key;
key =
((void *)0)
;
if ((srk->user_id = calloc(1, rks[i]->user_id_len)) ==
((void *)0)
) {
sshlog("ssh-sk.c", __func__, 844, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "calloc failed");
r = -2;
goto out;
}
memcpy(srk->user_id, rks[i]->user_id, rks[i]->user_id_len);
srk->user_id_len = rks[i]->user_id_len;
if ((tmp = recallocarray(srks, nsrks, nsrks + 1,
sizeof(*tmp))) ==
((void *)0)
) {
sshlog("ssh-sk.c", __func__, 852, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "recallocarray failed");
r = -2;
goto out;
}
srks = tmp;
srks[nsrks++] = srk;
srk =
((void *)0)
;
}
*srksp = srks;
*nsrksp = nsrks;
srks =
((void *)0)
;
nsrks = 0;
r = 0;
out:
sshsk_free_options(opts);
sshsk_free(skp);
sshsk_free_sk_resident_keys(rks, nrks);
sshkey_free(key);
sshsk_free_resident_key(srk);
sshsk_free_resident_keys(srks, nsrks);
return r;
}
| long sshsk_load_resident(const char *a1, const char *a2, _BYTE *a3, long a4, _QWORD *a5, _QWORD *a6)
{
const char *v6;
void *v8;
unsigned long v9;
char v13;
unsigned int options;
unsigned int v15;
_QWORD *v16;
unsigned long v17;
long v18;
void ***v19;
void **v20;
size_t i;
unsigned long v22;
_QWORD *v23;
_QWORD **v24;
_QWORD **v25;
unsigned long v26;
v26 = __readfsqword(0x28u);
v20 = 0LL;
v16 = 0LL;
v17 = 0LL;
v22 = 0LL;
v18 = 0LL;
v23 = 0LL;
v24 = 0LL;
v19 = 0LL;
if ( a3 && *a3 )
v6 = ", have-pin";
else
v6 = (const char *)&unk_2C5E;
sshlog("ssh-sk.c", "sshsk_load_resident", 797LL, 1LL, 5LL, 0LL, "provider \"%s\"%s", a1, v6);
if ( !a5 || !a6 )
return 4294967286LL;
*a5 = 0LL;
*a6 = 0LL;
options = make_options(a2, 0LL, &v19);
if ( !options )
{
v20 = (void **)sshsk_open(a1);
if ( v20 )
{
v15 = ((long ( *)(_BYTE *, void ***, _QWORD **, unsigned long *))v20[5])(a3, v19, &v16, &v17);
if ( v15 )
{
sshlog("ssh-sk.c", "sshsk_load_resident", 812LL, 0LL, 2LL, 0LL, "Provider \"%s\" returned failure %d", a1, v15);
options = skerr_to_ssherr(v15);
}
else
{
for ( i = 0LL; i < v17; ++i )
{
sshlog(
"ssh-sk.c",
"sshsk_load_resident",
817LL,
1LL,
7LL,
0LL,
"rk %zu: slot %zu, alg %d, app \"%s\", uidlen %zu",
i,
*(_QWORD *)(v16[i] + 8LL),
*(unsigned int *)v16[i],
*(const char **)(v16[i] + 16LL),
*(_QWORD *)(v16[i] + 128LL));
if ( !strncmp(*(const char **)(v16[i] + 16LL), "ssh:", 4uLL) && *(_DWORD *)v16[i] <= 1u )
{
v13 = 33;
if ( (*(_BYTE *)(v16[i] + 112LL) & 4) != 0 )
v13 = 37;
options = sshsk_key_from_response(
*(_DWORD *)v16[i],
*(const char **)(v16[i] + 16LL),
v13,
(_QWORD *)(v16[i] + 24LL),
&v18);
if ( options )
goto LABEL_29;
v23 = calloc(1uLL, 0x18uLL);
if ( !v23 )
{
sshlog("ssh-sk.c", "sshsk_load_resident", 837LL, 1LL, 2LL, 0LL, "calloc failed");
options = -2;
goto LABEL_29;
}
*v23 = v18;
v18 = 0LL;
v8 = calloc(1uLL, *(_QWORD *)(v16[i] + 128LL));
v23[1] = v8;
if ( !v23[1] )
{
sshlog("ssh-sk.c", "sshsk_load_resident", 844LL, 1LL, 2LL, 0LL, "calloc failed");
options = -2;
goto LABEL_29;
}
memcpy((void *)v23[1], *(const void **)(v16[i] + 120LL), *(_QWORD *)(v16[i] + 128LL));
v23[2] = *(_QWORD *)(v16[i] + 128LL);
v25 = (_QWORD **)recallocarray(v24, v22, v22 + 1, 8LL);
if ( !v25 )
{
sshlog("ssh-sk.c", "sshsk_load_resident", 852LL, 1LL, 2LL, 0LL, "recallocarray failed");
options = -2;
goto LABEL_29;
}
v24 = v25;
v9 = v22++;
v25[v9] = v23;
v23 = 0LL;
}
}
*a5 = v24;
*a6 = v22;
v24 = 0LL;
v22 = 0LL;
options = 0;
}
}
else
{
options = -4;
}
}
LABEL_29:
sshsk_free_options(v19);
sshsk_free(v20);
sshsk_free_sk_resident_keys(v16, v17);
sshkey_free(v18);
sshsk_free_resident_key(v23);
sshsk_free_resident_keys(v24, v22);
return options;
}
|
void
_rl_set_cursor (int im, int force)
{
if (_rl_term_ve && _rl_term_vs)
{
if (force || im != rl_insert_mode)
{
if (im == 0)
tputs (_rl_term_vs, 1, _rl_output_character_function);
else
tputs (_rl_term_ve, 1, _rl_output_character_function);
}
}
}
| long long _rl_set_cursor(unsigned long a0, unsigned long a1) {
unsigned long long v1;
v1 = _rl_term_ve;
if (_rl_term_ve) {
v1 = _rl_term_vs;
if (_rl_term_vs) {
if (!a1) {
v1 = rl_insert_mode;
if (a0 == rl_insert_mode)
goto LABEL_401182;
}
if (a0)
v1 = tputs(_rl_term_ve, 0x1, _rl_output_character_function);
else
v1 = tputs(_rl_term_vs, 0x1, _rl_output_character_function);
}
}
LABEL_401182:
return v1;
}
|
static void
dev_ino_free (void *x)
{
free (x);
}
| void dev_ino_free(void* a0) {
unsigned long long v1;
v1 = free(a0);
return;
}
|
void
usage (int status)
{
if (status !=
0
)
do { fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
else
{
printf (gettext ("Usage: %s [OPTION]... [-T] SOURCE DEST\n or: %s [OPTION]... SOURCE... DIRECTORY\n or: %s [OPTION]... -t DIRECTORY SOURCE...\n")
,
program_name, program_name, program_name);
fputs_unlocked (gettext ("Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n"),
stdout
)
;
emit_mandatory_arg_note ();
fputs_unlocked (gettext (" -a, --archive same as -dR --preserve=all\n --attributes-only don't copy the file data, just the attributes\n --backup[=CONTROL] make a backup of each existing destination file\n -b like --backup but does not accept an argument\n --copy-contents copy contents of special files when recursive\n -d same as --no-dereference --preserve=links\n"),
stdout
)
;
fputs_unlocked (gettext (" -f, --force if an existing destination file cannot be\n opened, remove it and try again (this option\n is ignored when the -n option is also used)\n -i, --interactive prompt before overwrite (overrides a previous -n\n option)\n -H follow command-line symbolic links in SOURCE\n"),
stdout
)
;
fputs_unlocked (gettext (" -l, --link hard link files instead of copying\n -L, --dereference always follow symbolic links in SOURCE\n"),
stdout
)
;
fputs_unlocked (gettext (" -n, --no-clobber do not overwrite an existing file (overrides\n a previous -i option)\n -P, --no-dereference never follow symbolic links in SOURCE\n"),
stdout
)
;
fputs_unlocked (gettext (" -p same as --preserve=mode,ownership,timestamps\n --preserve[=ATTR_LIST] preserve the specified attributes (default:\n mode,ownership,timestamps), if possible\n additional attributes: context, links, xattr,\n all\n"),
stdout
)
;
fputs_unlocked (gettext (" --no-preserve=ATTR_LIST don't preserve the specified attributes\n --parents use full source file name under DIRECTORY\n"),
stdout
)
;
fputs_unlocked (gettext (" -R, -r, --recursive copy directories recursively\n --reflink[=WHEN] control clone/CoW copies. See below\n --remove-destination remove each existing destination file before\n attempting to open it (contrast with --force)\n"),
stdout
)
;
fputs_unlocked (gettext (" --sparse=WHEN control creation of sparse files. See below\n --strip-trailing-slashes remove any trailing slashes from each SOURCE\n argument\n"),
stdout
)
;
fputs_unlocked (gettext (" -s, --symbolic-link make symbolic links instead of copying\n -S, --suffix=SUFFIX override the usual backup suffix\n -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY\n -T, --no-target-directory treat DEST as a normal file\n"),
stdout
)
;
fputs_unlocked (gettext (" -u, --update copy only when the SOURCE file is newer\n than the destination file or when the\n destination file is missing\n -v, --verbose explain what is being done\n -x, --one-file-system stay on this file system\n"),
stdout
)
;
fputs_unlocked (gettext (" -Z set SELinux security context of destination\n file to default type\n --context[=CTX] like -Z, or if CTX is specified then set the\n SELinux or SMACK security context to CTX\n"),
stdout
)
;
fputs_unlocked (gettext (" --help display this help and exit\n"),
stdout
);
fputs_unlocked (gettext (" --version output version information and exit\n"),
stdout
);
fputs_unlocked (gettext ("\nBy default, sparse SOURCE files are detected by a crude heuristic and the\ncorresponding DEST file is made sparse as well. That is the behavior\nselected by --sparse=auto. Specify --sparse=always to create a sparse DEST\nfile whenever the SOURCE file contains a long enough sequence of zero bytes.\nUse --sparse=never to inhibit creation of sparse files.\n"),
stdout
)
;
fputs_unlocked (gettext ("\nWhen --reflink[=always] is specified, perform a lightweight copy, where the\ndata blocks are copied only when modified. If this is not possible the copy\nfails, or if --reflink=auto is specified, fall back to a standard copy.\nUse --reflink=never to ensure a standard copy is performed.\n"),
stdout
)
;
emit_backup_suffix_note ();
fputs_unlocked (gettext ("\nAs a special case, cp makes a backup of SOURCE when the force and backup\noptions are given and SOURCE and DEST are the same name for an existing,\nregular file.\n"),
stdout
)
;
emit_ancillary_info ("cp");
}
exit (status);
}
| void usage(unsigned long a0) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned long v4;
unsigned long v5;
unsigned long v6;
v2 = v4;
v1 = v5;
v0 = v6;
if (a0) {
fprintf(stderr, gettext("Try '%s --help' for more information.\n"));
} else {
printf(gettext("Usage: %s [OPTION]... [-T] SOURCE DEST\n or: %s [OPTION]... SOURCE... DIRECTORY\n or: %s [OPTION]... -t DIRECTORY SOURCE...\n"));
fputs_unlocked(gettext("Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n"), stdout);
emit_mandatory_arg_note();
fputs_unlocked(gettext(" -a, --archive same as -dR --preserve=all\n --attributes-only don't copy the file data, just the attributes\n --backup[=CONTROL] make a backup of each existing destination file\n -b like --backup but does not accept an argument\n --copy-contents copy contents of special files when recursive\n -d same as --no-dereference --preserve=links\n"), stdout);
fputs_unlocked(gettext(" -f, --force if an existing destination file cannot be\n opened, remove it and try again (this option\n is ignored when the -n option is also used)\n -i, --interactive prompt before overwrite (overrides a previous -n\n option)\n -H follow command-line symbolic links in SOURCE\n"), stdout);
fputs_unlocked(gettext(" -l, --link hard link files instead of copying\n -L, --dereference always follow symbolic links in SOURCE\n"), stdout);
fputs_unlocked(gettext(" -n, --no-clobber do not overwrite an existing file (overrides\n a previous -i option)\n -P, --no-dereference never follow symbolic links in SOURCE\n"), stdout);
fputs_unlocked(gettext(" -p same as --preserve=mode,ownership,timestamps\n --preserve[=ATTR_LIST] preserve the specified attributes (default:\n mode,ownership,timestamps), if possible\n additional attributes: context, links, xattr,\n all\n"), stdout);
fputs_unlocked(gettext(" --no-preserve=ATTR_LIST don't preserve the specified attributes\n --parents use full source file name under DIRECTORY\n"), stdout);
fputs_unlocked(gettext(" -R, -r, --recursive copy directories recursively\n --reflink[=WHEN] control clone/CoW copies. See below\n --remove-destination remove each existing destination file before\n attempting to open it (contrast with --force)\n"), stdout);
fputs_unlocked(gettext(" --sparse=WHEN control creation of sparse files. See below\n --strip-trailing-slashes remove any trailing slashes from each SOURCE\n argument\n"), stdout);
fputs_unlocked(gettext(" -s, --symbolic-link make symbolic links instead of copying\n -S, --suffix=SUFFIX override the usual backup suffix\n -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY\n -T, --no-target-directory treat DEST as a normal file\n"), stdout);
fputs_unlocked(gettext(" -u, --update copy only when the SOURCE file is newer\n than the destination file or when the\n destination file is missing\n -v, --verbose explain what is being done\n -x, --one-file-system stay on this file system\n"), stdout);
fputs_unlocked(gettext(" -Z set SELinux security context of destination\n file to default type\n --context[=CTX] like -Z, or if CTX is specified then set the\n SELinux or SMACK security context to CTX\n"), stdout);
fputs_unlocked(gettext(" --help display this help and exit\n"), stdout);
fputs_unlocked(gettext(" --version output version information and exit\n"), stdout);
fputs_unlocked(gettext("\nBy default, sparse SOURCE files are detected by a crude heuristic and the\ncorresponding DEST file is made sparse as well. That is the behavior\nselected by --sparse=auto. Specify --sparse=always to create a sparse DEST\nfile whenever the SOURCE file contains a long enough sequence of zero bytes.\nUse --sparse=never to inhibit creation of sparse files.\n"), stdout);
fputs_unlocked(gettext("\nWhen --reflink[=always] is specified, perform a lightweight copy, where the\ndata blocks are copied only when modified. If this is not possible the copy\nfails, or if --reflink=auto is specified, fall back to a standard copy.\nUse --reflink=never to ensure a standard copy is performed.\n"), stdout);
emit_backup_suffix_note();
fputs_unlocked(gettext("\nAs a special case, cp makes a backup of SOURCE when the force and backup\noptions are given and SOURCE and DEST are the same name for an existing,\nregular file.\n"), stdout);
emit_ancillary_info("cp");
}
exit(a0);
}
|
static int
jobno(const struct job *jp)
{
return jp - jobtab + 1;
}
| int jobno(unsigned long a0) {
return ((a0 - jobtab >> 3) * 14757395258967641293) + 1;
}
|
void
pcomp_set_readline_variables (flags, nval)
int flags, nval;
{
if (flags & (1<<2))
rl_filename_completion_desired = nval;
if (flags & (1<<5))
rl_completion_suppress_append = nval;
if (flags & (1<<4))
rl_filename_quoting_desired = 1 - nval;
if (flags & (1<<8))
rl_sort_completion_matches = 1 - nval;
}
| long pcomp_set_readline_variables(short a1, int a2)
{
long result;
if ( (a1 & 4) != 0 )
rl_filename_completion_desired = a2;
if ( (a1 & 0x20) != 0 )
rl_completion_suppress_append = a2;
if ( (a1 & 0x10) != 0 )
rl_filename_quoting_desired = 1 - a2;
result = a1 & 0x100;
if ( (a1 & 0x100) != 0 )
{
result = (unsigned int)(1 - a2);
rl_sort_completion_matches = 1 - a2;
}
return result;
}
|
static int route_dump_check_magic(void)
{
int ret;
__u32 magic = 0;
if (isatty(
0
)) {
fprintf(
stderr
, "Can't restore route dump from a terminal\n");
return -1;
}
ret = fread(&magic, sizeof(magic), 1,
stdin
);
if (magic != route_dump_magic) {
fprintf(
stderr
, "Magic mismatch (%d elems, %x magic)\n", ret, magic);
return -1;
}
return 0;
}
| long route_dump_check_magic()
{
unsigned int ptr;
unsigned int v2;
unsigned long v3;
v3 = __readfsqword(0x28u);
ptr = 0;
if ( isatty(0) )
{
fprintf(stderr, "Can't restore route dump from a terminal\n");
return 0xFFFFFFFFLL;
}
else
{
v2 = fread(&ptr, 4uLL, 1uLL, stdin);
if ( ptr == route_dump_magic )
{
return 0LL;
}
else
{
fprintf(stderr, "Magic mismatch (%d elems, %x magic)\n", v2, ptr);
return 0xFFFFFFFFLL;
}
}
}
|
static int
statdb_node_remove(const char *filename)
{
struct fsys_namenode *file;
file = fsys_hash_find_node(filename, FHFF_NONE);
if (!file || !file->statoverride)
return 0;
file->statoverride =
((void *)0)
;
return 1;
}
| long statdb_node_remove(long a1)
{
long node;
node = fsys_hash_find_node(a1, 2LL);
if ( !node || !*(_QWORD *)(node + 32) )
return 0LL;
*(_QWORD *)(node + 32) = 0LL;
return 1LL;
}
|
static inline __u8 rta_getattr_u8(const struct rtattr *rta)
{
return *(__u8 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| int rta_getattr_u8(struct_0 *a0) {
return a0->field_4;
}
|
static int detect_data_type(s)
deflate_state *s;
{
unsigned long block_mask = 0xf3ffc07fUL;
int n;
for (n = 0; n <= 31; n++, block_mask >>= 1)
if ((block_mask & 1) && (s->dyn_ltree[n].fc.freq != 0))
return 0;
if (s->dyn_ltree[9].fc.freq != 0 || s->dyn_ltree[10].fc.freq != 0
|| s->dyn_ltree[13].fc.freq != 0)
return 1;
for (n = 32; n < 256; n++)
if (s->dyn_ltree[n].fc.freq != 0)
return 1;
return 0;
}
| int detect_data_type(unsigned short a0[133]) {
unsigned int v0;
unsigned long long v1;
unsigned int v3;
v1 = 4093624447;
v0 = 0;
while (true) {
if (v0 <= 31) {
if ((v1 & 1) && a0[106 + 2 * v0]) {
v3 = 0;
break;
}
v0 += 1;
v1 >>= 1;
} else {
if (!a0[124] && !a0[126] && !a0[132]) {
v0 = 32;
while (true) {
if (v0 > 255) {
v3 = 0;
break;
} else if (!a0[106 + 2 * v0]) {
v0 += 1;
} else {
v3 = 1;
break;
}
}
}
v3 = 1;
break;
}
}
return v3;
}
|
static int
binop(void)
{
const char *opnd1, *opnd2;
struct t_op const *op;
opnd1 = *t_wp;
(void) t_lex(++t_wp);
op = t_wp_op;
if ((opnd2 = *++t_wp) == (char *)0)
syntax(op->op_text, "argument expected");
switch (op->op_num) {
default:
case STREQ:
return strcmp(opnd1, opnd2) == 0;
case STRNE:
return strcmp(opnd1, opnd2) != 0;
case STRLT:
return strcmp(opnd1, opnd2) < 0;
case STRGT:
return strcmp(opnd1, opnd2) > 0;
case INTEQ:
return getn(opnd1) == getn(opnd2);
case INTNE:
return getn(opnd1) != getn(opnd2);
case INTGE:
return getn(opnd1) >= getn(opnd2);
case INTGT:
return getn(opnd1) > getn(opnd2);
case INTLE:
return getn(opnd1) <= getn(opnd2);
case INTLT:
return getn(opnd1) < getn(opnd2);
case FILNT:
return newerf (opnd1, opnd2);
case FILOT:
return olderf (opnd1, opnd2);
case FILEQ:
return equalf (opnd1, opnd2);
}
}
| void binop() {
char *v0;
struct_0 *v1;
char *v2;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long v8;
unsigned long v9;
unsigned long v10;
unsigned long v11;
unsigned long v12;
unsigned long v13;
unsigned long v14;
unsigned long v15;
unsigned long v16;
v0 = *(t_wp);
t_wp = t_wp + 8;
t_lex(t_wp);
v1 = t_wp_op;
t_wp = t_wp + 8;
v2 = *(t_wp);
if (!v2)
syntax(v1->field_0, "argument expected");
switch (v1->field_8) {
case 17:
v6 = newerf(v0, v2);
return;
case 18:
v5 = olderf(v0, v2);
return;
case 19:
v4 = equalf(v0, v2);
return;
case 25:
v10 = strcmp(v0, v2);
return;
case 26:
v7 = strcmp(v0, v2) >> 31;
return;
case 27:
v9 = strcmp(v0, v2) > 0;
return;
case 28:
v12 = getn(v0) == getn(v2);
return;
case 29:
v14 = getn(v0) != getn(v2);
return;
case 30:
v16 = getn(v2) <= getn(v0);
return;
case 31:
v11 = getn(v2) < getn(v0);
return;
case 32:
v13 = getn(v0) <= getn(v2);
return;
case 33:
v15 = getn(v0) < getn(v2);
return;
default:
v8 = !strcmp(v0, v2);
return;
}
}
|
static inline void
emit_mandatory_arg_note (void)
{
fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"),
stdout
)
;
}
| void emit_mandatory_arg_note(void)
{
char *__s;
FILE *__stream;
__stream = stdout;
__s = (char *)gettext(
"\nMandatory arguments to long options are mandatory for short options too.\n"
);
fputs_unlocked(__s,__stream);
return;
}
|
static void
send_msg(struct sftp_conn *conn, struct sshbuf *m)
{
u_char mlen[4];
struct iovec iov[2];
if (sshbuf_len(m) > (256 * 1024))
sshfatal("sftp-client.c", __func__, 171, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Outbound message too long %zu", sshbuf_len(m));
put_u32(mlen, sshbuf_len(m));
iov[0].iov_base = mlen;
iov[0].iov_len = sizeof(mlen);
iov[1].iov_base = (u_char *)sshbuf_ptr(m);
iov[1].iov_len = sshbuf_len(m);
if (atomiciov6(writev, conn->fd_out, iov, 2, sftpio,
conn->limit_kbps > 0 ? &conn->bwlimit_out :
((void *)0)
) !=
sshbuf_len(m) + sizeof(mlen))
sshfatal("sftp-client.c", __func__, 183, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Couldn't send packet: %s", strerror(
(*__errno_location ())
));
sshbuf_reset(m);
}
| void send_msg(struct_0 *a0, unsigned long long a1) {
unsigned long v0;
unsigned long v1;
unsigned long long v2;
unsigned long v3;
unsigned long v4;
char v5;
char v6;
unsigned long long v7;
unsigned long v8;
char v9;
unsigned long long v11;
void* v12;
unsigned long long *v14;
unsigned long long v15;
if (sshbuf_len(a1) > 0x40000) {
v0 = sshbuf_len(a1);
sshfatal("sftp-client.c", "send_msg", 0xab, 0x0, 0x1, 0x0, "Outbound message too long %zu");
}
v11 = sshbuf_len(a1);
put_u32(&v5, v11, v11);
v1 = &v5;
v2 = 4;
v3 = sshbuf_ptr(a1);
v4 = sshbuf_len(a1);
if (!a0->field_20)
v12 = 0;
else
v12 = &a0[2].padding_8[16];
if (atomiciov6(got.writev, a0->field_4, &v1, 0x2, sftpio, v12) != sshbuf_len(a1) + 4) {
v8 = strerror(*(__errno_location()));
v7 = "Couldn't send packet: %s";
sshfatal("sftp-client.c", "send_msg", 0xb7, 0x0, 0x1, 0x0, *(&v9));
}
sshbuf_reset(a1);
v15 = *(&v6) ^ v14[5];
return;
}
|
static void
sigstat (int signo)
{
compute_duration ();
print_total_stats ();
signal (signo, sigstat);
}
| long long sigstat(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
compute_duration();
print_total_stats(a0, a1, a2, a3, a4, a5);
return signal(a0, sigstat);
}
|
_Bool
pred_execdir (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
(void) &pathname;
return impl_pred_exec (state.rel_pathname, stat_buf, pred_ptr);
}
| void pred_execdir(undefined8 param_1,undefined8 param_2,undefined8 param_3)
{
impl_pred_exec(_strcmp,param_2,param_3);
return;
}
|
static int depmod_load_symvers(struct depmod *depmod, const char *filename)
{
char line[10240];
FILE *fp;
unsigned int linenum = 0;
fp = fopen(filename, "r");
if (fp ==
((void *)0)
) {
int err = -
(*__errno_location ())
;
log_printf(
7
, "load symvers: %s: %m\n", filename);
return err;
}
log_printf(
7
, "load symvers: %s\n", filename);
while (fgets(line, sizeof(line), fp) !=
((void *)0)
) {
const char *ver, *sym, *where;
char *verend;
uint64_t crc;
linenum++;
ver = strtok(line, " \t");
sym = strtok(
((void *)0)
, " \t");
where = strtok(
((void *)0)
, " \t");
if (!ver || !sym || !where)
continue;
if (!(strcmp((where), ("vmlinux")) == 0))
continue;
crc = strtoull(ver, &verend, 16);
if (verend[0] != '\0') {
log_printf(
3
, "%s:%u Invalid symbol version %s: %m\n", filename, linenum, ver)
;
continue;
}
depmod_symbol_add(depmod, sym,
0
, crc,
((void *)0)
);
}
depmod_add_fake_syms(depmod);
log_printf(
7
, "loaded symvers: %s\n", filename);
fclose(fp);
return 0;
}
| int depmod_load_symvers(void* a0, char *a1, unsigned long a2, unsigned long long a3, unsigned long long a4) {
unsigned int v0;
unsigned int v1;
char v2;
void* v3;
char *v4;
void* v5;
char *v6;
unsigned int v7;
char v8;
unsigned long long v9;
char v10;
unsigned int v12;
v10 = *(&v10);
v9 = *(&v9);
v0 = 0;
v3 = fopen(a1, "r");
if (!v3) {
v1 = -(*(__errno_location()));
log_printf(0x7, "load symvers: %s: %m\n", a1, a3, a4);
v12 = v1;
} else {
log_printf(0x7, "load symvers: %s\n", a1, a3, a4);
while (true) {
if (!fgets(&v8, 0x2800, v3)) {
depmod_add_fake_syms(a0);
log_printf(0x7, "loaded symvers: %s\n", a1, a3, a4);
fclose(v3);
v12 = 0;
break;
}
v0 += 1;
v4 = strtok(&v8, " \t");
v5 = strtok(NULL, " \t");
v6 = strtok(NULL, " \t");
if (!v4) {
LABEL_40843f:
} else {
if (!v5)
goto LABEL_40843f;
if (!v6)
goto LABEL_40843f;
if (!strcmp(v6, "vmlinux")) {
*(&v7) = strtoull(v4, &v2, 0x10);
if (!*(*(&v2)))
depmod_symbol_add(a0, v5, 0x0, *(&v7), 0x0);
else
log_printf(0x3, "%s:%u Invalid symbol version %s: %m\n", a1, v0, v4);
}
}
}
}
return v12;
}
|
void
usage (int status)
{
if (status !=
0
)
do { fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
else
{
printf (gettext ("Usage: %s [OPTION]... [FILE]...\n")
,
program_name);
fputs_unlocked (gettext ("Write each FILE to standard output, with line numbers added.\n"),
stdout
)
;
emit_stdin_note ();
emit_mandatory_arg_note ();
fputs_unlocked (gettext (" -b, --body-numbering=STYLE use STYLE for numbering body lines\n -d, --section-delimiter=CC use CC for logical page delimiters\n -f, --footer-numbering=STYLE use STYLE for numbering footer lines\n"),
stdout
)
;
fputs_unlocked (gettext (" -h, --header-numbering=STYLE use STYLE for numbering header lines\n -i, --line-increment=NUMBER line number increment at each line\n -l, --join-blank-lines=NUMBER group of NUMBER empty lines counted as one\n -n, --number-format=FORMAT insert line numbers according to FORMAT\n -p, --no-renumber do not reset line numbers for each section\n -s, --number-separator=STRING add STRING after (possible) line number\n"),
stdout
)
;
fputs_unlocked (gettext (" -v, --starting-line-number=NUMBER first line number for each section\n -w, --number-width=NUMBER use NUMBER columns for line numbers\n"),
stdout
)
;
fputs_unlocked (gettext (" --help display this help and exit\n"),
stdout
);
fputs_unlocked (gettext (" --version output version information and exit\n"),
stdout
);
fputs_unlocked (gettext ("\nDefault options are: -bt -d'\\:' -fn -hn -i1 -l1 -n'rn' -s<TAB> -v1 -w6\n\nCC are two delimiter characters used to construct logical page delimiters;\na missing second character implies ':'. As a GNU extension one can specify\nmore than two characters, and also specifying the empty string (-d '')\ndisables section matching.\n"),
stdout
)
;
fputs_unlocked (gettext ("\nSTYLE is one of:\n\n a number all lines\n t number only nonempty lines\n n number no lines\n pBRE number only lines that contain a match for the basic regular\n expression, BRE\n"),
stdout
)
;
fputs_unlocked (gettext ("\nFORMAT is one of:\n\n ln left justified, no leading zeros\n rn right justified, no leading zeros\n rz right justified, leading zeros\n\n"),
stdout
)
;
emit_ancillary_info ("nl");
}
exit (status);
}
| void usage(int param_1)
{
FILE *pFVar1;
undefined8 uVar2;
char *pcVar3;
uVar2 = program_name;
if (param_1 == 0) {
pcVar3 = (char *)gettext("Usage: %s [OPTION]... [FILE]...\n");
printf(pcVar3,uVar2);
pFVar1 = stdout;
pcVar3 = (char *)gettext("Write each FILE to standard output, with line numbers added.\n");
fputs_unlocked(pcVar3,pFVar1);
emit_stdin_note();
emit_mandatory_arg_note();
pFVar1 = stdout;
pcVar3 = (char *)gettext(
" -b, --body-numbering=STYLE use STYLE for numbering body lines\n -d, --section-delimiter=CC use CC for logical page delimiters\n -f, --footer-numbering=STYLE use STYLE for numbering footer lines\n"
);
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(
" -h, --header-numbering=STYLE use STYLE for numbering header lines\n -i, --line-increment=NUMBER line number increment at each line\n -l, --join-blank-lines=NUMBER group of NUMBER empty lines counted as one\n -n, --number-format=FORMAT insert line numbers according to FORMAT\n -p, --no-renumber do not reset line numbers for each section\n -s, --number-separator=STRING add STRING after (possible) line number\n"
);
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(
" -v, --starting-line-number=NUMBER first line number for each section\n -w, --number-width=NUMBER use NUMBER columns for line numbers\n"
);
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(" --help display this help and exit\n");
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(" --version output version information and exit\n");
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(
"\nDefault options are: -bt -d\'\\:\' -fn -hn -i1 -l1 -n\'rn\' -s<TAB> -v1 -w6\n\nCC are two delimiter characters used to construct logical page delimiters;\na missing second character implies \':\'. As a GNU extension one can specify\nmore than two characters, and also specifying the empty string (-d \'\')\ndisables section matching.\n"
);
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(
"\nSTYLE is one of:\n\n a number all lines\n t number only nonempty lines\n n number no lines\n pBRE number only lines that contain a match for the basic regular\n expression, BRE\n"
);
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(
"\nFORMAT is one of:\n\n ln left justified, no leading zeros\n rn right justified, no leading zeros\n rz right justified, leading zeros\n\n"
);
fputs_unlocked(pcVar3,pFVar1);
emit_ancillary_info();
}
else {
pcVar3 = (char *)gettext("Try \'%s --help\' for more information.\n");
fprintf(stderr,pcVar3,uVar2);
}
exit(param_1);
}
|
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;
return v2;
} else if (v0[24]) {
v2 = *(((stack_base)[16] + 24))(v0);
return v2;
} else {
v2 = v0;
return v2;
}
}
|
int
mm_bsdauth_respond(void *ctx, u_int numresponses, char **responses)
{
struct sshbuf *m;
int r, authok;
sshlog("monitor_wrap.c", __func__, 865, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "entering");
if (numresponses != 1)
return (-1);
if ((m = sshbuf_new()) ==
((void *)0)
)
sshfatal("monitor_wrap.c", __func__, 870, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new failed");
if ((r = sshbuf_put_cstring(m, responses[0])) != 0)
sshfatal("monitor_wrap.c", __func__, 872, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble");
mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_BSDAUTHRESPOND, m);
mm_request_receive_expect(pmonitor->m_recvfd,
MONITOR_ANS_BSDAUTHRESPOND, m);
if ((r = sshbuf_get_u32(m, &authok)) != 0)
sshfatal("monitor_wrap.c", __func__, 879, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse");
sshbuf_free(m);
return ((authok == 0) ? -1 : 0);
}
| long long mm_bsdauth_respond(unsigned long a0, unsigned long a1, unsigned long long *a2) {
unsigned long v0;
char v1;
unsigned int v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v6;
v0 = a0;
sshlog("monitor_wrap.c", "mm_bsdauth_respond", 0x361, 0x1, 0x7, 0x0, "entering");
if (a1 != 1) {
v6 = 4294967295;
} else {
v3 = sshbuf_new();
if (!v3)
sshfatal("monitor_wrap.c", "mm_bsdauth_respond", 0x366, 0x1, 0x1, 0x0);
v2 = sshbuf_put_cstring(v3, *(a2), *(a2));
if (v2) {
v4 = "assemble";
sshfatal("monitor_wrap.c", "mm_bsdauth_respond", 0x368, 0x1, 0x1, ssh_err(v2));
}
mm_request_send(*(pmonitor), 0x10, v3);
mm_request_receive_expect(*(pmonitor), 0x11, v3);
v2 = sshbuf_get_u32(v3, &v1, &v1);
if (v2) {
v4 = "parse";
sshfatal("monitor_wrap.c", "mm_bsdauth_respond", 0x36f, 0x1, 0x1, ssh_err(v2));
}
sshbuf_free(v3);
if (!*(&v1))
v6 = 4294967295;
else
v6 = 0;
}
return v6;
}
|
static int depmod_load_module_dependencies(struct depmod *depmod, struct mod *mod)
{
const struct cfg *cfg = depmod->cfg;
struct kmod_list *l;
log_printf(
7
, "do dependencies of %s\n", mod->path);
for (l = ((mod->dep_sym_list) ==
((void *)0)
) ?
((void *)0)
: (mod->dep_sym_list); l !=
((void *)0)
; l = (l->node.next == &((mod->dep_sym_list)->node)) ?
((void *)0)
: ((struct kmod_list *) ((char *)(l->node.next) -
__builtin_offsetof (
struct kmod_list
,
node
)
) - ((typeof(*(l->node.next)) *)0 != (typeof(((struct kmod_list *)0)->node) *)0))) {
const char *name = kmod_module_dependency_symbol_get_symbol(l);
uint64_t crc = kmod_module_dependency_symbol_get_crc(l);
int bindtype = kmod_module_dependency_symbol_get_bind(l);
struct symbol *sym = depmod_symbol_find(depmod, name);
uint8_t is_weak = bindtype == KMOD_SYMBOL_WEAK;
if (sym ==
((void *)0)
) {
log_printf(
7
, "%s needs (%c) unknown symbol %s\n", mod->path, bindtype, name)
;
if (cfg->print_unknown && !is_weak)
log_printf(
4
, "%s needs unknown symbol %s\n", mod->path, name)
;
continue;
}
if (cfg->check_symvers && sym->crc != crc && !is_weak) {
log_printf(
7
, "symbol %s (%#"
"l" "x"
") module %s (%#"
"l" "x"
")\n", sym->name, sym->crc, mod->path, crc)
;
if (cfg->print_unknown)
log_printf(
4
, "%s disagrees about version of symbol %s\n", mod->path, name)
;
}
mod_add_dependency(mod, sym);
}
return 0;
}
| void depmod_load_module_dependencies(unsigned long long *a0, unsigned long long a1[6], unsigned long a2, unsigned long long a3, unsigned long long a4) {
char v0;
unsigned int v1;
unsigned long long *v2;
char v3[4115];
unsigned long long v4;
unsigned long v5;
struct_0 *v6;
void* v9;
*(&v3[0]) = *(a0);
log_printf(0x7, "do dependencies of %s\n", a1[1], a3, a4);
for (v2 = a1[5]; v2; *(&v2) = (*(v2) == a1[5] ? *(v2) : 0)) {
v4 = kmod_module_dependency_symbol_get_symbol(v2);
v5 = kmod_module_dependency_symbol_get_crc(v2);
v1 = kmod_module_dependency_symbol_get_bind(v2);
v6 = depmod_symbol_find(a0, v4);
v0 = v1 == 87;
if (v6) {
if (v3[4113] && v5 != v6->field_8 && !v0) {
log_printf(0x7, "symbol %s (%#lx) module %s (%#lx)\n", v6 + 1, v6->field_8, a1[1]);
if (v3[4114])
log_printf(0x4, "%s disagrees about version of symbol %s\n", a1[1], v4, a4);
}
mod_add_dependency(a1, v6);
} else {
log_printf(0x7, "%s needs (%c) unknown symbol %s\n", a1[1], v1, v4);
if (v3[4114] && !v0)
log_printf(0x4, "%s needs unknown symbol %s\n", a1[1], v4, a4);
}
}
v9 = 0;
return;
}
|
static int
vflopenat(int dirfd, const char *path, int flags, va_list ap)
{
int fd, operation, serrno, trunc;
struct stat sb, fsb;
mode_t mode;
mode = 0;
if (flags &
0100
) {
mode = (mode_t)
__builtin_va_arg(
ap
,
int
)
;
}
operation =
2
;
if (flags &
04000
)
operation |=
4
;
trunc = (flags &
01000
);
flags &= ~
01000
;
for (;;) {
if ((fd = openat(dirfd, path, flags, mode)) == -1)
return (-1);
if (flock(fd, operation) == -1) {
serrno =
(*__errno_location ())
;
(void)close(fd);
(*__errno_location ())
= serrno;
return (-1);
}
if (fstatat(dirfd, path, &sb, 0) == -1) {
(void)close(fd);
continue;
}
if (fstat(fd, &fsb) == -1) {
serrno =
(*__errno_location ())
;
(void)close(fd);
(*__errno_location ())
= serrno;
return (-1);
}
if (sb.st_dev != fsb.st_dev ||
sb.st_ino != fsb.st_ino) {
(void)close(fd);
continue;
}
if (trunc && ftruncate(fd, 0) != 0) {
serrno =
(*__errno_location ())
;
(void)close(fd);
(*__errno_location ())
= serrno;
return (-1);
}
return (fd);
}
}
| int vflopenat(unsigned long a0, unsigned long long a1, unsigned long a2, struct_0 *a3) {
struct_0 *v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
char v7;
char v8;
char v9;
char v10;
unsigned long v12;
v1 = a2;
v0 = a3;
v3 = 0;
if ((v1 & 64)) {
if (a3->field_0 > 47) {
v12 = a3->field_8;
a3->field_8 = a3->field_8 + 8;
} else {
v12 = a3->field_0 + a3->field_10;
a3->field_0 = a3->field_0 + 8;
}
*(&v12) = *(v12);
v3 = v12;
}
v2 = 2;
if ((v1 & 0x800))
v2 |= 4;
v4 = v1 & 0x200;
v1 &= -513;
while (true) {
v5 = openat(a0, a1, v1, v3);
if (v5 == -1) {
*(&v12) = -1;
return v12;
}
if (flock(v5, v2, v2) == -1) {
v6 = *(__errno_location());
close(v5);
*(__errno_location()) = v6;
*(&v12) = -1;
return v12;
}
if (fstatat(a0, a1, &v7, 0x0) == -1) {
close(v5);
} else {
if (fstat(v5, &v9) == -1) {
v6 = *(__errno_location());
close(v5);
*(__errno_location()) = v6;
*(&v12) = -1;
return v12;
}
if (!(*(&v7) != *(&v9)) && !(*(&v8) != *(&v10)))
break;
close(v5);
}
}
if (v4 && ftruncate(v5, 0x0)) {
v6 = *(__errno_location());
close(v5);
*(__errno_location()) = v6;
*(&v12) = -1;
return v12;
}
*(&v12) = v5;
return v12;
}
|
void
userauth_finish(struct ssh *ssh, int authenticated, const char *packet_method,
const char *submethod)
{
Authctxt *authctxt = ssh->authctxt;
Authmethod *m =
((void *)0)
;
const char *method = packet_method;
char *methods;
int r, partial = 0;
if (authenticated) {
if (!authctxt->valid) {
sshfatal("auth2.c", __func__, 364, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "INTERNAL ERROR: authenticated invalid user %s", authctxt->user)
;
}
if (authctxt->postponed)
sshfatal("auth2.c", __func__, 368, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "INTERNAL ERROR: authenticated and postponed");
if ((m = authmethod_byname(method)) ==
((void *)0)
)
sshfatal("auth2.c", __func__, 371, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "INTERNAL ERROR: bad method %s", method);
method = m->name;
}
if (authenticated && authctxt->pw->pw_uid == 0 &&
!auth_root_allowed(ssh, method)) {
authenticated = 0;
}
if (authenticated && options.num_auth_methods != 0) {
if (!auth2_update_methods_lists(authctxt, method, submethod)) {
authenticated = 0;
partial = 1;
}
}
auth_log(ssh, authenticated, partial, method, submethod);
if (authenticated || partial)
auth2_update_session_info(authctxt, method, submethod);
if (authctxt->postponed)
return;
if (authenticated == 1) {
ssh_dispatch_set(ssh, 50,
&dispatch_protocol_ignore);
if ((r = sshpkt_start(ssh, 52)) != 0 ||
(r = sshpkt_send(ssh)) != 0 ||
(r = ssh_packet_write_wait(ssh)) != 0)
sshfatal("auth2.c", __func__, 430, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "send success packet");
authctxt->success = 1;
ssh_packet_set_log_preamble(ssh, "user %s", authctxt->user);
} else {
if (!partial && !authctxt->server_caused_failure &&
(authctxt->attempt > 1 || strcmp(method, "none") != 0))
authctxt->failures++;
if (authctxt->failures >= options.max_authtries) {
auth_maxtries_exceeded(ssh);
}
methods = authmethods_get(authctxt);
sshlog("auth2.c", __func__, 446, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "failure partial=%d next methods=\"%s\"", partial, methods)
;
if ((r = sshpkt_start(ssh, 51)) != 0 ||
(r = sshpkt_put_cstring(ssh, methods)) != 0 ||
(r = sshpkt_put_u8(ssh, partial)) != 0 ||
(r = sshpkt_send(ssh)) != 0 ||
(r = ssh_packet_write_wait(ssh)) != 0)
sshfatal("auth2.c", __func__, 453, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "send failure packet");
free(methods);
}
}
| void userauth_finish(struct_0 *a0, unsigned long a1, char *a2, unsigned long long a3) {
unsigned long long v0;
unsigned long v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
char *v5;
unsigned long long v6;
unsigned long long *v7;
unsigned long long v8;
unsigned long v9;
char v10;
unsigned long long v12;
unsigned long long v13;
unsigned long long v14;
v2 = a1;
v6 = a0->field_860;
v7 = 0;
v5 = a2;
v4 = 0;
if (v2) {
if (!v6->field_c) {
v1 = v6->field_20;
v0 = "INTERNAL ERROR: authenticated invalid user %s";
sshfatal("auth2.c", "userauth_finish", 0x16c, 0x0, 0x1, 0x0);
}
if (v6->field_8) {
v8 = "INTERNAL ERROR: authenticated and postponed";
sshfatal("auth2.c", "userauth_finish", 0x170, 0x0, 0x1, 0x0);
}
v7 = authmethod_byname(v5);
if (!v7) {
v9 = v5;
v8 = "INTERNAL ERROR: bad method %s";
sshfatal("auth2.c", "userauth_finish", 0x173, 0x0, 0x1, 0x0);
}
v5 = *(v7);
}
if (v2 && !v6->field_30->field_10 && !auth_root_allowed(a0, v5, v5))
v2 = 0;
if (v2 && *(5250712) && !auth2_update_methods_lists(v6, v5, a3)) {
v2 = 0;
v4 = 1;
}
auth_log(a0, v2, v4, v5, a3);
if (!v2 && !v4)
goto LABEL_401068;
auth2_update_session_info(v6, v5, a3);
LABEL_401068:
v12 = v6->field_8;
if (!v6->field_8) {
if (v2 == 1) {
ssh_dispatch_set(a0, 0x32, got.dispatch_protocol_ignore);
v3 = sshpkt_start(a0, 0x34);
if (!v3) {
v3 = sshpkt_send(a0);
if (!v3) {
v3 = ssh_packet_write_wait(a0);
if (!v3)
goto LABEL_40111e;
}
}
v8 = "send success packet";
sshfatal("auth2.c", "userauth_finish", 0x1ae, 0x1, 0x1, ssh_err(v3));
LABEL_40111e:
v6->field_0 = 1;
v13 = ssh_packet_set_log_preamble(a0, "user %s", v6->field_20, a3);
} else {
if (!v4 && !v6->field_18) {
if (v6->field_10 <= 1 && !strcmp(v5, "none"))
goto LABEL_40119d;
v6->field_14 = __addvsi3(v6->field_14, 0x1);
}
LABEL_40119d:
if (v6->field_14 >= *(5250536))
auth_maxtries_exceeded(a0);
v8 = authmethods_get(v6);
v8 = v8;
v7 = v4;
v6 = "failure partial=%d next methods=\"%s\"";
sshlog("auth2.c", "userauth_finish", 0x1be, 0x1, 0x7, 0x0, *(&v10));
v3 = sshpkt_start(a0, 0x33);
if (!v3) {
v3 = sshpkt_put_cstring(a0, v8, v8);
if (!v3) {
v3 = sshpkt_put_u8(a0, v4, v4);
if (!v3) {
v3 = sshpkt_send(a0);
if (!v3) {
v3 = ssh_packet_write_wait(a0);
if (!v3)
goto LABEL_4012cd;
}
}
}
}
v8 = "send failure packet";
sshfatal("auth2.c", "userauth_finish", 0x1c5, 0x1, 0x1, ssh_err(v3));
LABEL_4012cd:
v14 = free(v8);
}
}
return;
}
|
static void
print_clump (COLUMN *p, int n, char *clump)
{
while (n--)
(p->char_func) (*clump++);
}
| void print_clump(unsigned long a0, unsigned long a1, unsigned long a2) {
char *v0;
int tmp_9;
int tmp_17;
unsigned int v1;
unsigned long long v3;
v1 = a1;
v0 = a2;
while (true) {
tmp_9 = v1;
v3 = v1;
v1 -= 1;
if (!tmp_9)
break;
tmp_17 = v0;
v0 += 1;
*((reg_72 + 32))(*(tmp_17));
}
return;
}
|
static int
parse_additional_groups (char const *groups, gid_t **pgids,
size_t *pn_gids,
_Bool
show_errors)
{
gid_t *gids =
((void *)0)
;
size_t n_gids_allocated = 0;
size_t n_gids = 0;
char *buffer = xstrdup (groups);
char const *tmp;
int ret = 0;
for (tmp = strtok (buffer, ","); tmp; tmp = strtok (
((void *)0)
, ","))
{
struct group *g;
uintmax_t value;
if (xstrtoumax (tmp,
((void *)0)
, 10, &value, "") == LONGINT_OK
&& value <= ((gid_t) (! (! ((gid_t) 0 < (gid_t) -1)) ? (gid_t) -1 : ((((gid_t) 1 << ((sizeof (gid_t) * 8) - 2)) - 1) * 2 + 1))))
{
while (
((*__ctype_b_loc ())[(int) ((
to_uchar (*tmp)
))] & (unsigned short int) _ISspace)
)
tmp++;
if (*tmp != '+')
{
g = getgrnam (tmp);
if (g !=
((void *)0)
)
value = g->gr_gid;
}
g = (struct group *) (intptr_t) !
((void *)0)
;
}
else
{
g = getgrnam (tmp);
if (g !=
((void *)0)
)
value = g->gr_gid;
}
if (g ==
((void *)0)
)
{
ret = -1;
if (show_errors)
{
error (0,
(*__errno_location ())
, gettext ("invalid group %s"), quote (tmp));
continue;
}
break;
}
if (n_gids == n_gids_allocated)
gids = ((!!sizeof (struct { _Static_assert (sizeof *(gids) != 1, "verify_expr (" "sizeof *(gids) != 1" ", " "x2nrealloc (gids, &n_gids_allocated, sizeof *(gids))" ")"); int _gl_dummy; })) ? (x2nrealloc (gids, &n_gids_allocated, sizeof *(gids))) : (x2nrealloc (gids, &n_gids_allocated, sizeof *(gids))));
gids[n_gids++] = value;
}
if (ret == 0 && n_gids == 0)
{
if (show_errors)
error (0, 0, gettext ("invalid group list %s"), quote (groups));
ret = -1;
}
*pgids = gids;
if (ret == 0)
*pn_gids = n_gids;
free (buffer);
return ret;
}
| int parse_additional_groups(unsigned long long a0, unsigned long long *a1, unsigned long long *a2, unsigned long a3) {
unsigned int v0;
int tmp_15;
void* v1;
unsigned long v2;
void* v3;
void* v4;
char *v5;
unsigned long long v6;
void* v7;
unsigned short v10;
unsigned int v11;
unsigned long long v12;
unsigned long long v13;
v3 = 0;
v1 = 0;
v4 = 0;
v7 = xstrdup(a0);
v0 = 0;
v5 = strtok(v7, ",");
while (true) {
if (!v5)
break;
if (xstrtoumax(v5, 0x0, 0xa, &v2, &g_4011db) || v2 > 4294967295) {
v6 = getgrnam(v5);
if (v6)
v2 = *((v6 + 16));
} else {
while (true) {
v10 = *((to_uchar(*(v5)) * 2 + *(__ctype_b_loc())));
v11 = v10 & 0x2000;
if (!v11)
break;
v5 += 1;
}
if (*(v5) != 43) {
v6 = &getgrnam(v5)->gr_name;
if (v6)
v2 = *((v6 + 16));
}
v6 = 1;
}
if (v6) {
if (v4 == v1)
v3 = x2nrealloc(v3, &v1, 0x4, &v1);
tmp_15 = v4;
v4 += 1;
*((v3 + 4 * tmp_15)) = v2;
} else {
v0 = -1;
if (!a3)
break;
v12 = quote(v5);
error(0x0, *(__errno_location()), gettext("invalid group %s"));
}
v5 = strtok(NULL, ",");
}
if (!v0 && !v4) {
if (a3) {
v13 = quote(a0);
error(0x0, 0x0, gettext("invalid group list %s"));
}
v0 = -1;
}
*(a1) = v3;
if (!v0)
*(a2) = v4;
free(v7);
return v0;
}
|
static void
sparse_add_map (struct tar_stat_info *st, struct sp_array const *sp)
{
struct sp_array *sparse_map = st->sparse_map;
size_t avail = st->sparse_map_avail;
if (avail == st->sparse_map_size)
st->sparse_map = sparse_map =
x2nrealloc (sparse_map, &st->sparse_map_size, sizeof *sparse_map);
sparse_map[avail] = *sp;
st->sparse_map_avail = avail + 1;
}
| void sparse_add_map(unsigned long long a0[41], unsigned long long a1[2]) {
unsigned long long v0[2];
int tmp_49;
unsigned long long *v1;
unsigned long long *v2;
unsigned long long v4[41];
v0[0] = a1;
v1 = a0[40];
v2 = a0[38];
if (v2 == a0[39]) {
v1 = x2nrealloc(v1, &a0[39], 0x10, &a0[39]);
a0[40] = v1;
}
tmp_49 = a1[1];
*((0x10 * v2 + v1)) = a1[0];
*((8 + 0x10 * v2 + v1)) = tmp_49;
v4 = a0;
a0[38] = v2 + 1;
return;
}
|
int
rl_getc (FILE *stream)
{
int result;
unsigned char c;
int fd;
sigset_t empty_set;
fd_set readfds;
fd = fileno (stream);
while (1)
{
do { if (_rl_caught_signal) _rl_signal_handler (_rl_caught_signal); } while (0);
result = 0;
do { unsigned int __i; fd_set *__arr = (
&readfds
); for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) ((__arr)->fds_bits)[__i] = 0; } while (0)
;
((void) (((
&readfds
)->fds_bits)[((
fd
) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << ((
fd
) % (8 * (int) sizeof (__fd_mask)))))))
;
result = _rl_timeout_select (fd + 1, &readfds,
((void *)0)
,
((void *)0)
,
((void *)0)
, &_rl_orig_sigset);
if (result == 0)
_rl_timeout_handle ();
if (result >= 0)
result = read (fd, &c, sizeof (unsigned char));
if (result == sizeof (unsigned char))
return (c);
if (result == 0)
return (
(-1)
);
if (
(*__errno_location ())
==
11
||
(*__errno_location ())
==
11
)
{
if (sh_unset_nodelay_mode (fd) < 0)
return (
(-1)
);
continue;
}
handle_error:
if (
(*__errno_location ())
!=
4
)
return ((rl_readline_state & (0x0000008)) ? (-2) :
(-1)
);
else if (_rl_caught_signal ==
1
|| _rl_caught_signal ==
15
)
return ((rl_readline_state & (0x0000008)) ? (-2) :
(-1)
);
else if (_rl_caught_signal ==
2
|| _rl_caught_signal ==
3
)
do { if (_rl_caught_signal) _rl_signal_handler (_rl_caught_signal); } while (0);
else if (_rl_caught_signal ==
20
)
do { if (_rl_caught_signal) _rl_signal_handler (_rl_caught_signal); } while (0);
else if (_rl_caught_signal ==
28
)
do { if (_rl_caught_signal) _rl_signal_handler (_rl_caught_signal); } while (0);
else if (_rl_caught_signal ==
14
|| _rl_caught_signal ==
26
)
do { if (_rl_caught_signal) _rl_signal_handler (_rl_caught_signal); } while (0);
if (rl_signal_event_hook)
(*rl_signal_event_hook) ();
}
}
| int rl_getc(void* a0) {
char v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned long long *v4;
char v5;
unsigned int v10;
v3 = fileno(a0);
while (true) {
if (_rl_caught_signal)
_rl_signal_handler(_rl_caught_signal);
v1 = 0;
v4 = &v5;
for (v2 = 0; v2 <= 15; v2 += 1) {
v4[v2] = 0;
}
*(&(&v5)[8 * ((v3 < 0 ? v3 + 63 : v3) >> 6)]) = *(&(&v5)[8 * ((v3 < 0 ? v3 + 63 : v3) >> 6)]) | 1 << (((v3 + (v3 >> 31 >> 26) & 63) - (v3 >> 31 >> 26)) & 63);
v1 = _rl_timeout_select(v3 + 1, &v5, 0x0, 0x0, 0x0, 0x5000b0);
if (!v1)
_rl_timeout_handle();
if (v1 >= 0)
v1 = read(v3, &v0, 0x1);
switch (v1) {
case 1:
v10 = v0;
return v10;
case 0:
v10 = -1;
return v10;
default:
if (*(__errno_location()) == 11 || *(__errno_location()) == 11) {
if (sh_unset_nodelay_mode(v3) < 0) {
v10 = -1;
return v10;
}
break;
} else if (*(__errno_location()) != 4) {
v10 = (!(*(&rl_readline_state) & 8) ? -2 : -1);
return v10;
} else {
switch (_rl_caught_signal) {
case 1: case 15:
v10 = (!(*(&rl_readline_state) & 8) ? -2 : -1);
return v10;
case 2: case 3:
if (_rl_caught_signal) {
_rl_signal_handler(_rl_caught_signal);
break;
}
case 20:
if (_rl_caught_signal) {
_rl_signal_handler(_rl_caught_signal);
break;
}
case 28:
if (_rl_caught_signal) {
_rl_signal_handler(_rl_caught_signal);
break;
}
case 14: case 26:
if (_rl_caught_signal)
_rl_signal_handler(_rl_caught_signal);
default:
if (rl_signal_event_hook) {
*(4199752)();
break;
}
}
}
}
}
}
|
static int
compare_collated (char const *name1, char const *name2)
{
int r;
(*__errno_location ())
= 0;
if (ignore_file_name_case)
r = strcasecmp (name1, name2);
else
r = strcoll (name1, name2);
if (
(*__errno_location ())
)
{
error (0,
(*__errno_location ())
, gettext ("cannot compare file names '%s' and '%s'"),
name1, name2);
longjmp (failed_locale_specific_sorting, 1);
}
return r;
}
| long compare_collated(const char *a1, const char *a2)
{
char *v2;
int *v3;
unsigned int v5;
*_errno_location() = 0;
if ( ignore_file_name_case )
v5 = strcasecmp(a1, a2);
else
v5 = strcoll(a1, a2);
if ( *_errno_location() )
{
v2 = gettext("cannot compare file names '%s' and '%s'");
v3 = _errno_location();
error(0, *v3, v2, a1, a2);
longjmp(failed_locale_specific_sorting, 1);
}
return v5;
}
|
static inline char *
timetostr (time_t t, char *buf)
{
return ((! ((time_t) 0 < (time_t) -1))
? imaxtostr (t, buf)
: umaxtostr (t, buf));
}
| int timetostr(unsigned long long a0, unsigned long long a1) {
return imaxtostr(a0, a1, a1);
}
|
static void check_inode_end(e2fsck_t ctx)
{
ext2_filsys fs = ctx->fs;
ext2_ino_t end, save_inodes_count, i;
struct problem_context pctx;
int asked = 0;
clear_problem_context(&pctx);
end = (__u64)((fs->super)->s_inodes_per_group) * fs->group_desc_count;
pctx.errcode = ext2fs_fudge_inode_bitmap_end(fs->inode_map, end,
&save_inodes_count);
if (pctx.errcode) {
pctx.num = 1;
fix_problem(ctx, 0x050011, &pctx);
ctx->flags |= 0x0001;
return;
}
if (save_inodes_count == end)
goto check_intra_bg_tail;
for (i = save_inodes_count + 1; i <= end && i > save_inodes_count; i++) {
if (!ext2fs_test_inode_bitmap(fs->inode_map, i)) {
asked = 1;
if (fix_problem(ctx, 0x050001, &pctx)) {
for (; i <= end; i++)
ext2fs_mark_inode_bitmap(fs->inode_map,
i);
ext2fs_mark_ib_dirty(fs);
} else
ext2fs_unmark_valid(fs);
break;
}
}
pctx.errcode = ext2fs_fudge_inode_bitmap_end(fs->inode_map,
save_inodes_count, 0);
if (pctx.errcode) {
pctx.num = 2;
fix_problem(ctx, 0x050011, &pctx);
ctx->flags |= 0x0001;
return;
}
check_intra_bg_tail:
if (!asked && fs->flags & 0x2000000) {
if (fix_problem(ctx, 0x050001, &pctx))
ext2fs_mark_ib_dirty(fs);
else
ext2fs_unmark_valid(fs);
}
}
| void check_inode_end(struct_0 *a0) {
char v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
struct_1 *v4;
unsigned long v5;
unsigned long long v6;
char v7;
unsigned long long *v9;
unsigned long long v10;
v4 = a0->field_0;
v2 = 0;
clear_problem_context(&v5);
v3 = v4->field_20->field_28 * v4->field_30;
v5 = ext2fs_fudge_inode_bitmap_end(v4->field_50, v3, &v0, v3);
if (v5) {
v6 = 1;
fix_problem(a0, 0x50011, &v5);
a0->field_48 = a0->field_48 | 1;
} else {
if (v3 != *(&v0)) {
v1 = *(&v0) + 1;
while (true) {
if (!(v1 <= v3) || !(v1 > *(&v0)))
break;
if (ext2fs_test_inode_bitmap(v4->field_50, v1, v1)) {
v1 += 1;
} else if (!fix_problem(a0, 0x50001, &v5)) {
ext2fs_unmark_valid(v4);
break;
} else {
for (v2 = 1; v1 <= v3; v1 += 1) {
ext2fs_mark_inode_bitmap(v4->field_50, v1, v1);
}
ext2fs_mark_ib_dirty(v4);
break;
}
}
v5 = ext2fs_fudge_inode_bitmap_end(v4->field_50, *(&v0), 0x0, *(&v0));
if (v5) {
v6 = 2;
fix_problem(a0, 0x50011, &v5);
a0->field_48 = a0->field_48 | 1;
v10 = *(&v7) ^ v9[5];
return;
}
}
if (!v2 && (v4->field_10 & 0x2000000)) {
if (!fix_problem(a0, 0x50001, &v5))
ext2fs_unmark_valid(v4);
else
ext2fs_mark_ib_dirty(v4);
}
}
v10 = *(&v7) ^ v9[5];
return;
}
|
static struct option_locus *
optloc_lookup (int id)
{
return option_class[id];
}
| long optloc_lookup(int a1)
{
return option_class[a1];
}
|
static int lwtunnel_parse_geneve_opt(char *str, size_t len, struct rtattr *rta)
{
struct rtattr *nest;
char *token;
int i, err;
nest = rta_nest(rta, len, LWTUNNEL_IP_OPTS_GENEVE | (1 << 15));
i = 1;
token = strsep(&str, ":");
while (token) {
switch (i) {
case LWTUNNEL_IP_OPT_GENEVE_CLASS:
{
__be16 opt_class;
if (!strlen(token))
break;
err = get_be16(&opt_class, token, 0);
if (err)
return err;
rta_addattr16(rta, len, i, opt_class);
break;
}
case LWTUNNEL_IP_OPT_GENEVE_TYPE:
{
__u8 opt_type;
if (!strlen(token))
break;
err = get_u8(&opt_type, token, 0);
if (err)
return err;
rta_addattr8(rta, len, i, opt_type);
break;
}
case LWTUNNEL_IP_OPT_GENEVE_DATA:
{
size_t token_len = strlen(token);
__u8 *opts;
if (!token_len)
break;
opts = malloc(token_len / 2);
if (!opts)
return -1;
if (hex2mem(token, opts, token_len / 2) < 0) {
free(opts);
return -1;
}
rta_addattr_l(rta, len, i, opts, token_len / 2);
free(opts);
break;
}
default:
fprintf(
stderr
, "Unknown \"geneve_opts\" type\n");
return -1;
}
token = strsep(&str, ":");
i++;
}
rta_nest_end(rta, nest);
return 0;
}
| int lwtunnel_parse_geneve_opt(unsigned long a0, unsigned long long a1, unsigned long long a2) {
unsigned long v0;
char v1;
unsigned int v2;
unsigned long long v3;
char *v4;
unsigned long long v5;
unsigned long v6;
void* v7;
unsigned int v9;
v0 = a0;
v5 = rta_nest(a2, a1, 0x8001, a1);
v2 = 1;
v4 = strsep(&v0, ":");
while (true) {
if (v4) {
if (v2 != 3) {
if (v2 <= 3) {
if (v2 == 1) {
v9 = strlen(v4);
if (v9) {
*(&v3) = get_be16(&v1, v4, 0x0, v4);
if (v3) {
v9 = v3;
break;
} else {
rta_addattr16(a2, a1, v2, *(&v1));
}
}
} else if (v2 == 2 && v9) {
*(&v3) = get_u8(&v1, v4, 0x0, v4);
if (v3) {
v9 = v3;
break;
} else {
rta_addattr8(a2, a1, v2, v1);
}
}
if (v2 == 2)
v9 = strlen(v4);
}
if ((v2 != 2 || v2 > 3) && (v2 > 3 || v2 != 1)) {
fprintf(stderr, "Unknown \"geneve_opts\" type\n");
v9 = -1;
break;
}
} else {
v6 = strlen(v4);
if (v6) {
v7 = malloc(v6 >> 1);
if (!v7) {
v9 = -1;
break;
} else {
v9 = hex2mem(v4, v7, v6 >> 1, v7);
if (v9 < 0) {
free(v7);
v9 = -1;
break;
} else {
rta_addattr_l(a2, a1, v2, v7, v6 >> 1);
free(v7);
}
}
}
}
if (!v6 && v2 == 3 || v2 <= 3 && v2 == 1 && !v9 && v2 != 3 || v2 == 3 && v6 && v7 && v9 >= 0 || v2 == 2 && v2 <= 3 && !v9 && v2 != 1 && v2 != 3 || v2 <= 3 && !v3 && v2 == 1 && v2 != 3 && v9 || !v3 && v2 == 2 && v2 <= 3 && v9 && v2 != 1 && v2 != 3) {
v4 = strsep(&v0, ":");
v2 += 1;
}
} else {
rta_nest_end(a2, v5, v5);
v9 = 0;
break;
}
}
return v9;
}
|
void e2fsck_pass5(e2fsck_t ctx)
{
struct resource_track rtrack;
struct problem_context pctx;
init_resource_track(&rtrack, ctx->fs->io);
clear_problem_context(&pctx);
if (!(ctx->options & 0x0002))
fix_problem(ctx, 0x050000, &pctx);
if (ctx->progress)
if ((ctx->progress)(ctx, 5, 0, ctx->fs->group_desc_count*2))
return;
e2fsck_read_bitmaps(ctx);
check_block_bitmaps(ctx);
if (ctx->flags & (0x0001 | 0x0002))
return;
check_inode_bitmaps(ctx);
if (ctx->flags & (0x0001 | 0x0002))
return;
check_inode_end(ctx);
if (ctx->flags & (0x0001 | 0x0002))
return;
check_block_end(ctx);
if (ctx->flags & (0x0001 | 0x0002))
return;
check_inode_bitmap_checksum(ctx);
check_block_bitmap_checksum(ctx);
ext2fs_free_inode_bitmap(ctx->inode_used_map);
ctx->inode_used_map = 0;
ext2fs_free_inode_bitmap(ctx->inode_dir_map);
ctx->inode_dir_map = 0;
ext2fs_free_block_bitmap(ctx->block_found_map);
ctx->block_found_map = 0;
ext2fs_free_block_bitmap(ctx->block_metadata_map);
ctx->block_metadata_map = 0;
print_resource_track(ctx, (gettext ("Pass 5")), &rtrack, ctx->fs->io);
}
| long long e2fsck_pass5(struct_0 *a0) {
char v0;
char v1;
init_resource_track(&v0, a0->field_0->field_8, a0->field_0->field_8);
clear_problem_context(&v1);
if (!(a0->field_4c & 2))
fix_problem(a0, 0x50000, &v1);
if (a0->field_160 && !(!a0->field_160(a0, 5, 0, a0->field_0->field_30 << 1, a0->field_160)))
goto LABEL_4002ed;
e2fsck_read_bitmaps(a0);
check_block_bitmaps(a0);
if (!(a0->field_48 & 3)) {
check_inode_bitmaps(a0);
if (!(a0->field_48 & 3)) {
check_inode_end(a0);
if (!(a0->field_48 & 3)) {
check_block_end(a0);
if (!(a0->field_48 & 3)) {
check_inode_bitmap_checksum(a0);
check_block_bitmap_checksum(a0);
ext2fs_free_inode_bitmap(a0->field_168);
a0->field_168 = 0;
ext2fs_free_inode_bitmap(a0->field_178);
a0->field_178 = 0;
ext2fs_free_block_bitmap(a0->field_1a0);
a0->field_1a0 = 0;
ext2fs_free_block_bitmap(a0->field_390);
a0->field_390 = 0;
print_resource_track(a0, gettext("Pass 5"), &v0, a0->field_0->field_8);
}
}
}
}
LABEL_4002ed:
return 0;
}
|
char *growstackto(size_t len)
{
if (stacknleft < len)
growstackblock(len);
return ((void *)stacknxt);
}
| undefined * growstackto(ulong param_1)
{
if (stacknleft < param_1) {
growstackblock(param_1);
}
return stacknxt;
}
|
static
_Bool
ignorable_sync_errno (int errno_val)
{
return (errno_val ==
22
|| errno_val ==
9
|| errno_val ==
21
);
}
| undefined4 ignorable_sync_errno(int param_1)
{
undefined4 uVar1;
if (((param_1 == 0x16) || (param_1 == 9)) || (param_1 == 0x15)) {
uVar1 = 1;
}
else {
uVar1 = 0;
}
return uVar1;
}
|
int
auth2_challenge(struct ssh *ssh, char *devs)
{
Authctxt *authctxt = ssh->authctxt;
sshlog("auth2-chall.c", __func__, 196, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "auth2_challenge: user=%s devs=%s", authctxt->user ? authctxt->user : "<nouser>", devs ? devs : "<no devs>")
;
if (authctxt->user ==
((void *)0)
|| !devs)
return 0;
if (authctxt->kbdintctxt ==
((void *)0)
)
authctxt->kbdintctxt = kbdint_alloc(devs);
return auth2_challenge_start(ssh);
}
| undefined8 auth2_challenge(long param_1,char *param_2)
{
long lVar1;
char *pcVar2;
undefined8 uVar3;
char *pcVar4;
lVar1 = *(long *)(param_1 + 0x860);
pcVar4 = param_2;
if (param_2 == (char *)0x0) {
pcVar4 = "<no devs>";
}
if (*(long *)(lVar1 + 0x20) == 0) {
pcVar2 = "<nouser>";
}
else {
pcVar2 = *(char **)(lVar1 + 0x20);
}
sshlog("auth2-chall.c","auth2_challenge",0xc4,0,5,0,"auth2_challenge: user=%s devs=%s",pcVar2,
pcVar4);
if ((*(long *)(lVar1 + 0x20) == 0) || (param_2 == (char *)0x0)) {
uVar3 = 0;
}
else {
if (*(long *)(lVar1 + 0x58) == 0) {
uVar3 = kbdint_alloc(param_2);
*(undefined8 *)(lVar1 + 0x58) = uVar3;
}
uVar3 = auth2_challenge_start(param_1);
}
return uVar3;
}
|
static
_Bool
get_mtime (char const *filename, struct timespec *mtime)
{
struct stat finfo;
_Bool
ok = (stat (filename, &finfo) == 0);
if (ok)
*mtime = get_stat_mtime (&finfo);
return ok;
}
| int get_mtime(char *a0, unsigned long long a1[2]) {
char v0;
char v1;
v0 = !stat(a0, &v1);
if (v0) {
a1[0] = get_stat_mtime(&v1);
a1[1] = &v1;
}
return v0;
}
|
struct umac128_ctx *umac128_new(const u_char key[])
{
struct umac128_ctx *ctx, *octx;
size_t bytes_to_add;
aes_int_key prf_key;
octx = ctx = xcalloc(1, sizeof(*ctx) + 16);
if (ctx) {
if (16) {
bytes_to_add = 16 -
((ptrdiff_t)ctx & (16 - 1));
ctx = (struct umac128_ctx *)((u_char *)ctx + bytes_to_add);
}
ctx->free_ptr = octx;
AES_set_encrypt_key((const u_char *)(key),16*8,prf_key);
pdf_init(&ctx->pdf, prf_key);
uhash_init(&ctx->hash, prf_key);
explicit_bzero(prf_key, sizeof(prf_key));
}
return (ctx);
}
| long long umac128_new(unsigned long long a0) {
struct_0 *v0;
struct_0 *v1;
unsigned long v2;
char v3;
v0 = xcalloc(0x1, 0x6a0);
v1 = v0;
if (v0) {
v2 = __subvdi3(0x10, v0 & 15);
v0 = &v0->padding_0[v2];
v0->field_688 = v1;
AES_set_encrypt_key(a0, 0x80, &v3);
pdf_init(&v0->padding_0[1392], &v3);
uhash_init(v0, &v3);
explicit_bzero(&v3, 0xf4);
}
return v0;
}
|
void
arc4random_buf(void *buf, size_t n)
{
;
_rs_random_buf(buf, n);
;
}
| long long arc4random_buf(void* a0, unsigned int a1) {
return _rs_random_buf(a0, a1);
}
|
static int
hostkeys_find_by_key_hostfile(const char *file, const char *which,
struct find_by_key_ctx *ctx)
{
int r;
sshlog("sshconnect.c", __func__, 746, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "trying %s hostfile \"%s\"", which, file);
if ((r = hostkeys_foreach(file, hostkeys_find_by_key_cb, ctx,
ctx->host, ctx->ip, (1<<1), 0)) != 0) {
if (r == -24 &&
(*__errno_location ())
==
2
) {
sshlog("sshconnect.c", __func__, 750, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "hostkeys file %s does not exist", file);
return 0;
}
sshlog("sshconnect.c", __func__, 753, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "hostkeys_foreach failed for %s", file);
return r;
}
return 0;
}
| int hostkeys_find_by_key_hostfile(unsigned long long a0, unsigned long a1, unsigned long long a2[2]) {
unsigned long v0;
unsigned long v1;
unsigned int v2;
unsigned int v4;
v0 = a1;
sshlog("sshconnect.c", "hostkeys_find_by_key_hostfile", 0x2ea, 0x1, 0x7, 0x0, "trying %s hostfile \"%s\"");
v2 = hostkeys_foreach(a0, hostkeys_find_by_key_cb, a2, a2[0], a2[1], 0x2);
switch (v2) {
case 0:
v4 = 0;
return v4;
case 4294967272:
if (*(__errno_location()) == 2) {
v1 = a0;
sshlog("sshconnect.c", "hostkeys_find_by_key_hostfile", 0x2ee, 0x1, 0x5, 0x0, "hostkeys file %s does not exist");
v4 = 0;
return v4;
}
default:
v1 = a0;
sshlog("sshconnect.c", "hostkeys_find_by_key_hostfile", 0x2f1, 0x1, 0x2, ssh_err(v2), "hostkeys_foreach failed for %s");
v4 = v2;
return v4;
}
}
|
static void copy_stat(ifstat)
struct stat *ifstat;
{
mode_t mode = ifstat->st_mode &
((0400|0200|0100) | ((0400|0200|0100) >> 3) | (((0400|0200|0100) >> 3) >> 3))
;
int r;
_Bool
restoring;
struct timespec timespec[2];
timespec[0] = get_stat_atime (ifstat);
timespec[1] = get_stat_mtime (ifstat);
restoring = (decompress && 0 <= time_stamp.tv_nsec
&& ! (timespec[1].tv_sec == time_stamp.tv_sec
&& timespec[1].tv_nsec == time_stamp.tv_nsec));
if (restoring)
timespec[1] = time_stamp;
if (fdutimens (ofd, ofname, timespec) == 0)
{
if (restoring && 1 < verbose) {
fprintf(
stderr
, "%s: timestamp restored\n", ofname);
}
}
else
{
int e =
(*__errno_location ())
;
{if (!quiet) fprintf (
stderr
, "%s: ", program_name) ; if (exit_code == 0) exit_code = 2;};
if (!quiet)
{
(*__errno_location ())
= e;
perror (ofname);
}
}
do_chown (ofd, ofname, -1, ifstat->st_gid);
r = fchmod (ofd, mode);
if (r != 0) {
int e =
(*__errno_location ())
;
{if (!quiet) fprintf (
stderr
, "%s: ", program_name) ; if (exit_code == 0) exit_code = 2;};
if (!quiet) {
(*__errno_location ())
= e;
perror(ofname);
}
}
do_chown (ofd, ofname, ifstat->st_uid, -1);
}
| void copy_stat(unsigned int a0[9], unsigned long a1, unsigned long a2) {
char v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned long v5;
unsigned long v6;
unsigned long long v7;
unsigned long long v8;
char v9;
char v11;
unsigned long long *v12;
unsigned long long v13;
v1 = a0[6] & 511;
v5 = get_stat_atime(a0);
v6 = a2;
v7 = get_stat_mtime(a0);
v8 = a2;
if (decompress && false) {
if (v7 != 10180387026389042571) {
LABEL_4035b4:
v11 = 1;
goto LABEL_4035c0;
} else if (!(v8 == 14378102450199071541)) {
goto LABEL_4035b4;
}
}
v11 = 0;
LABEL_4035c0:
v0 = v11;
v0 &= 1;
if (v0) {
v7 = 10180387026389042571;
v8 = 14378102450199071541;
}
if (fdutimens(0xf9158b48e5894855, &ofname, &v5)) {
v2 = *(__errno_location());
if (!quiet)
fprintf(*(&stderr), "%s: ", -116028600);
if (!exit_code)
exit_code = 2;
if (!quiet) {
*(__errno_location()) = v2;
perror(&ofname);
}
} else if (v0 && verbose > 1) {
fprintf(*(&stderr), "%s: timestamp restored\n", &ofname);
}
do_chown(0xf9158b48e5894855, &ofname, 0xffffffff, a0[8]);
v3 = fchmod(0xe5894855, v1);
if (v3) {
v4 = *(__errno_location());
if (!quiet)
fprintf(*(&stderr), "%s: ", -116028600);
if (!exit_code)
exit_code = 2;
if (!quiet) {
*(__errno_location()) = v4;
perror(&ofname);
}
}
do_chown(0xf9158b48e5894855, &ofname, a0[7], 0xffffffff);
v13 = *(&v9) ^ v12[5];
return;
}
|
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(unsigned long long a0) {
unsigned long long v0;
unsigned int v1;
unsigned int v2;
char v3;
char v4;
char v5;
char v6;
unsigned short v7;
unsigned short v8;
char v9;
unsigned int v10;
unsigned long long v12;
unsigned long long *v13;
unsigned long v14;
unsigned int v15;
v0 = a0;
v1 = ll_name_to_index(v0);
v12 = 132;
for (v13 = &v6; v12; v13 = &v13[v14]) {
v12 -= 1;
v6 = 0;
}
v6 = 32;
v7 = 18;
v8 = 1;
v9 = preferred_family;
v10 = v1;
if (!v1) {
v15 = -1;
} else if (rtnl_talk(0x500058, &v6, &v3) < 0) {
v15 = -1;
} else {
v2 = *(*(&v3)) - 32;
if (v2 < 0) {
free(*(&v3));
v15 = -1;
} else {
parse_rtattr_flags(&v4, 0x3c, *(&v3) + 32, v2, 0x8000);
if (!*(&v5)) {
free(*(&v3));
v15 = -1;
} else {
v2 = *(*(&v5)) - 4;
free(*(&v3));
v15 = v2;
}
}
}
return v15;
}
|
Channel *
channel_lookup(struct ssh *ssh, int id)
{
Channel *c;
if ((c = channel_by_id(ssh, id)) ==
((void *)0)
)
return
((void *)0)
;
switch (c->type) {
case 7:
case 10:
case 12:
case 13:
case 21:
case 22:
case 3:
case 4:
case 17:
case 20:
return c;
}
sshlog("channels.c", __func__, 295, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Non-public channel %d, type %d.", id, c->type);
return
((void *)0)
;
}
| int channel_lookup(void* a0, unsigned long a1) {
unsigned long v0;
unsigned long v1;
unsigned int *v2;
unsigned int v4;
v2 = channel_by_id(a0, a1);
if (!v2) {
v4 = 0;
} else {
v4 = __addvsi3(*(v2), 0xfffffffd);
switch (v4) {
case 0: case 1: case 4: case 7: case 9: case 10: case 14: case 17: case 18: case 19:
v4 = v2;
break;
default:
v1 = *(v2);
v0 = a1;
sshlog("channels.c", "channel_lookup", 0x127, 0x0, 0x3, 0x0, "Non-public channel %d, type %d.");
v4 = 0;
break;
}
}
return v4;
}
|
int inflatePrime(strm, bits, value)
z_streamp strm;
int bits;
int value;
{
struct inflate_state *state;
if (inflateStateCheck(strm)) return (-2);
state = (struct inflate_state *)strm->state;
if (bits < 0) {
state->hold = 0;
state->bits = 0;
return 0;
}
if (bits > 16 || state->bits + (uInt)bits > 32) return (-2);
value &= (1L << bits) - 1;
state->hold += (unsigned)value << state->bits;
state->bits += (uInt)bits;
return 0;
}
| undefined8 inflatePrime(long param_1,int param_2,uint param_3)
{
long lVar1;
int iVar2;
undefined8 uVar3;
iVar2 = inflateStateCheck(param_1);
if (iVar2 == 0) {
lVar1 = *(long *)(param_1 + 0x38);
if (param_2 < 0) {
*(undefined8 *)(lVar1 + 0x50) = 0;
*(undefined4 *)(lVar1 + 0x58) = 0;
uVar3 = 0;
}
else if ((param_2 < 0x11) && ((uint)(param_2 + *(int *)(lVar1 + 0x58)) < 0x21)) {
*(ulong *)(lVar1 + 0x50) =
*(long *)(lVar1 + 0x50) +
(ulong)((param_3 & (int)(1 << ((byte)param_2 & 0x3f)) - 1U) <<
((byte)*(undefined4 *)(lVar1 + 0x58) & 0x1f));
*(int *)(lVar1 + 0x58) = *(int *)(lVar1 + 0x58) + param_2;
uVar3 = 0;
}
else {
uVar3 = 0xfffffffe;
}
}
else {
uVar3 = 0xfffffffe;
}
return uVar3;
}
|
int
forcible_nonroot_error(int rc)
{
if (in_force(FORCE_NON_ROOT) &&
(*__errno_location ())
==
1
)
return 0;
return rc;
}
| long long forcible_nonroot_error(unsigned long a0) {
unsigned long long v1;
void* v2;
v1 = in_force(0x10000);
if (v1) {
*(&v1) = *(__errno_location());
if (v1 == 1)
v2 = 0;
}
if (!v1 || v1 != 1)
v2 = a0;
return v2;
}
|
Session *
session_new(void)
{
Session *s, *tmp;
if (sessions_first_unused == -1) {
if (sessions_nalloc >= options.max_sessions)
return
((void *)0)
;
sshlog("session.c", __func__, 1747, 1, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "allocate (allocated %d max %d)", sessions_nalloc, options.max_sessions)
;
tmp = xrecallocarray(sessions, sessions_nalloc,
sessions_nalloc + 1, sizeof(*sessions));
if (tmp ==
((void *)0)
) {
sshlog("session.c", __func__, 1752, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "cannot allocate %d sessions", sessions_nalloc + 1)
;
return
((void *)0)
;
}
sessions = tmp;
session_unused(sessions_nalloc++);
}
if (sessions_first_unused >= sessions_nalloc ||
sessions_first_unused < 0) {
sshfatal("session.c", __func__, 1762, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "insane first_unused %d max %d nalloc %d", sessions_first_unused, options.max_sessions, sessions_nalloc)
;
}
s = &sessions[sessions_first_unused];
if (s->used)
sshfatal("session.c", __func__, 1769, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "session %d already used", sessions_first_unused);
sessions_first_unused = s->next_unused;
s->used = 1;
s->next_unused = -1;
sshlog("session.c", __func__, 1773, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "session_new: session %d", s->self);
return s;
}
| int session_new() {
unsigned long long v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned long long v4;
unsigned int v5[3];
unsigned long long v6;
unsigned long v7;
unsigned int v9;
unsigned long v10;
if (sessions_first_unused == -1) {
if (*(5250732) <= sessions_nalloc) {
v9 = 0;
} else {
v2 = *(5250732);
v1 = sessions_nalloc;
v0 = "allocate (allocated %d max %d)";
sshlog("session.c", "session_new", 0x6d3, 0x1, 0x6, 0x0);
v4 = xrecallocarray(sessions, sessions_nalloc, __addvsi3(sessions_nalloc, 0x1), 0xe8);
if (!v4) {
v3 = __addvsi3(sessions_nalloc, 0x1);
v2 = "cannot allocate %d sessions";
sshlog("session.c", "session_new", 0x6d8, 0x1, 0x2, 0x0);
v9 = 0;
} else {
sessions = v4;
v10 = sessions_nalloc;
sessions_nalloc = __addvsi3(sessions_nalloc, 0x1);
session_unused(v10);
}
}
}
if (sessions_first_unused != -1 || v4 && *(5250732) > sessions_nalloc) {
if (sessions_first_unused < 0 || sessions_first_unused >= sessions_nalloc) {
v3 = sessions_nalloc;
v2 = *(5250732);
v1 = sessions_first_unused;
v0 = "insane first_unused %d max %d nalloc %d";
sshfatal("session.c", "session_new", 0x6e2, 0x1, 0x1, 0x0);
}
*(&v5[0]) = sessions_first_unused * 232 + sessions;
if (v5[0]) {
v7 = sessions_first_unused;
v6 = "session %d already used";
sshfatal("session.c", "session_new", 0x6e9, 0x1, 0x1, 0x0);
}
sessions_first_unused = v5[2];
v5[0] = 1;
v5[2] = -1;
v7 = v5[1];
v6 = "session_new: session %d";
sshlog("session.c", "session_new", 0x6ed, 0x0, 0x5, 0x0);
v9 = v5;
}
return v9;
}
|
static void
append_unset_var (char const *var)
{
if (usvars_used == usvars_alloc)
usvars = x2nrealloc (usvars, &usvars_alloc, sizeof *usvars);
usvars[usvars_used++] = var;
}
| void append_unset_var(undefined8 param_1)
{
long lVar1;
if (usvars_used == usvars_alloc) {
usvars = x2nrealloc(usvars,&usvars_alloc,8);
}
lVar1 = usvars_used * 8;
usvars_used = usvars_used + 1;
*(undefined8 *)(usvars + lVar1) = param_1;
return;
}
|
static void handler(int s)
{
signo[s] = 1;
}
| long long handler(unsigned long a0) {
*((4 * a0 + &signo)) = 1;
return &signo;
}
|
static int
_netopen6 (host, serv, typ)
char *host, *serv;
int typ;
{
int s, e;
struct addrinfo hints, *res, *res0;
int gerr;
memset ((char *)&hints, 0, sizeof (hints));
hints.ai_family =
0
;
hints.ai_socktype = (typ == 't') ?
SOCK_STREAM
:
SOCK_DGRAM
;
gerr = getaddrinfo (host, serv, &hints, &res0);
if (gerr)
{
if (gerr ==
-8
)
internal_error ("%s: %s", serv, gai_strerror (gerr));
else
internal_error ("%s: %s", host, gai_strerror (gerr));
(*__errno_location ())
=
22
;
return -1;
}
for (res = res0; res; res = res->ai_next)
{
if ((s = socket (res->ai_family, res->ai_socktype, res->ai_protocol)) < 0)
{
if (res->ai_next)
continue;
sys_error ("socket");
freeaddrinfo (res0);
return -1;
}
if (connect (s, res->ai_addr, res->ai_addrlen) < 0)
{
if (res->ai_next)
{
close (s);
continue;
}
e =
(*__errno_location ())
;
sys_error ("connect");
close (s);
freeaddrinfo (res0);
(*__errno_location ())
= e;
return -1;
}
freeaddrinfo (res0);
break;
}
return s;
}
| int _netopen6(char *param_1,char *param_2,int param_3)
{
int iVar1;
char *pcVar2;
int *piVar3;
long in_FS_OFFSET;
int local_64;
addrinfo *local_58;
addrinfo *local_50;
addrinfo local_48;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
memset(&local_48,0,0x30);
local_48.ai_family = 0;
if (param_3 == 0x74) {
local_48.ai_socktype = 1;
}
else {
local_48.ai_socktype = 2;
}
iVar1 = getaddrinfo(param_1,param_2,&local_48,&local_58);
if (iVar1 == 0) {
for (local_50 = local_58; local_50 != (addrinfo *)0x0; local_50 = local_50->ai_next) {
local_64 = socket(local_50->ai_family,local_50->ai_socktype,local_50->ai_protocol);
if (local_64 < 0) {
if (local_50->ai_next == (addrinfo *)0x0) {
sys_error("socket");
freeaddrinfo(local_58);
local_64 = -1;
break;
}
}
else {
iVar1 = connect(local_64,local_50->ai_addr,local_50->ai_addrlen);
if (-1 < iVar1) {
freeaddrinfo(local_58);
break;
}
if (local_50->ai_next == (addrinfo *)0x0) {
piVar3 = __errno_location();
iVar1 = *piVar3;
sys_error();
close(local_64);
freeaddrinfo(local_58);
piVar3 = __errno_location();
*piVar3 = iVar1;
local_64 = -1;
break;
}
close(local_64);
}
}
}
else {
if (iVar1 == -8) {
pcVar2 = gai_strerror(-8);
internal_error("%s: %s",param_2,pcVar2);
}
else {
pcVar2 = gai_strerror(iVar1);
internal_error("%s: %s",param_1,pcVar2);
}
piVar3 = __errno_location();
*piVar3 = 0x16;
local_64 = -1;
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return local_64;
}
__stack_chk_fail();
}
|
void
set_compression_program_by_suffix (const char *name, const char *defprog)
{
const char *program = find_compression_program (name, defprog);
if (program)
use_compress_program_option = program;
}
| long long set_compression_program_by_suffix(char *a0, unsigned int a1) {
unsigned long long v0;
unsigned long long v2;
v2 = find_compression_program(a0, a1);
v0 = v2;
if (v0) {
v2 = v0;
use_compress_program_option = v0;
}
return v2;
}
|
(r = sshbuf_put_u32(b, originator_port)) != 0 ||
(r = sshbuf_put_stringb(c->output, b)) != 0) {
sshlog("clientloop.c", __func__, 1508, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "compose for muxclient");
goto out;
}
| void sshbuf_put_u32(void)
{
halt_baddata();
}
|
static struct fstatus *
get_input_fstatus (size_t nfiles, char *const *file)
{
struct fstatus *fstatus = xnmalloc (nfiles ? nfiles : 1, sizeof *fstatus);
if (nfiles == 0
|| (nfiles == 1
&& ((print_lines + print_words + print_chars
+ print_bytes + print_linelength)
== 1)))
fstatus[0].failed = 1;
else
{
for (size_t i = 0; i < nfiles; i++)
fstatus[i].failed = (! file[i] || (strcmp (file[i], "-") == 0)
? fstat (
0
, &fstatus[i].st)
: stat (file[i], &fstatus[i].st));
}
return fstatus;
}
| undefined4 * get_input_fstatus(ulong param_1,long param_2)
{
int iVar1;
ulong uVar2;
undefined4 *puVar3;
ulong local_18;
uVar2 = param_1;
if (param_1 == 0) {
uVar2 = 1;
}
puVar3 = (undefined4 *)xnmalloc(uVar2,0x98);
if ((param_1 == 0) ||
((param_1 == 1 &&
((uint)print_linelength +
(uint)print_lines + (uint)print_words + (uint)print_chars + (uint)print_bytes == 1)))) {
*puVar3 = 1;
}
else {
for (local_18 = 0; local_18 < param_1; local_18 = local_18 + 1) {
if ((*(long *)(param_2 + local_18 * 8) == 0) ||
(iVar1 = strcmp(*(char **)(param_2 + local_18 * 8),"-"), iVar1 == 0)) {
iVar1 = fstat(0,(stat *)(puVar3 + local_18 * 0x26 + 2));
}
else {
iVar1 = stat(*(char **)(param_2 + local_18 * 8),(stat *)(puVar3 + local_18 * 0x26 + 2));
}
puVar3[local_18 * 0x26] = iVar1;
}
}
return puVar3;
}
|
_Bool
pred_samefile (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
(void) pathname;
if (stat_buf->st_ino)
{
if (stat_buf->st_ino != pred_ptr->args.samefileid.ino)
return
0
;
}
if (0 == get_statinfo (pathname, state.rel_pathname, stat_buf))
{
return stat_buf->st_ino == pred_ptr->args.samefileid.ino
&& stat_buf->st_dev == pred_ptr->args.samefileid.dev;
}
else
{
return
0
;
}
}
| _BOOL8 pred_samefile(long a1, _QWORD *a2, long a3)
{
if ( a2[1] && a2[1] != *(_QWORD *)(a3 + 56) )
return 0LL;
if ( (unsigned int)get_statinfo(a1, state[2], a2) )
return 0LL;
return a2[1] == *(_QWORD *)(a3 + 56) && *a2 == *(_QWORD *)(a3 + 64);
}
|
static int session_nlmsg(struct nlmsghdr *n, void *arg)
{
int ret = get_response(n, arg);
if (ret == 0)
print_session(arg);
return ret;
}
| int session_nlmsg(undefined8 param_1,undefined8 param_2)
{
int iVar1;
iVar1 = get_response(param_1,param_2);
if (iVar1 == 0) {
print_session(param_2);
}
return iVar1;
}
|
void
set_ppid ()
{
char namebuf[(((sizeof (pid_t) * 8) - (! ((pid_t) 0 < (pid_t) -1))) * 302 / 1000 + 1 + (! ((pid_t) 0 < (pid_t) -1))) + 1], *name;
SHELL_VAR *temp_var;
name = inttostr (getppid (), namebuf, sizeof(namebuf));
temp_var = find_variable ("PPID");
if (temp_var)
((temp_var)->attributes &= ~((0x0000002 | 0x0000001)));
temp_var = bind_variable ("PPID", name, 0);
((temp_var)->attributes |= ((0x0000002 | 0x0000010)));
}
| unsigned long set_ppid()
{
__pid_t v0;
char *v2;
long *variable;
long v4;
char v5[12];
unsigned long v6;
v6 = __readfsqword(0x28u);
v0 = getppid();
v2 = (char *)inttostr(v0, v5, 12LL);
variable = find_variable((long)"PPID");
if ( variable )
*((_DWORD *)variable + 10) &= 0xFFFFFFFC;
v4 = bind_variable("PPID", v2, 0);
*(_DWORD *)(v4 + 40) |= 0x12u;
return __readfsqword(0x28u) ^ v6;
}
|
int main(int argc, char **argv)
{
int ret;
int i;
char portname[6];
socket_st hd;
_Bool
socket_opened =
0
;
char app_proto[32] = "";
cmd_parser(argc, argv);
signal(
13
,
((__sighandler_t) 1)
);
sockets_init();
if (gnutls_global_init() < 0) {
fprintf(
stderr
, "global state initialization error\n");
exit(1);
}
gnutls_global_set_log_function(tls_log_func);
gnutls_global_set_log_level(debug);
snprintf(portname, sizeof(portname), "%d", port);
if (gnutls_certificate_allocate_credentials(&xcred) < 0) {
fprintf(
stderr
, "memory error\n");
exit(1);
}
if (gnutls_srp_allocate_client_credentials(&srp_cred) < 0) {
fprintf(
stderr
, "memory error\n");
exit(1);
}
if (gnutls_anon_allocate_client_credentials(&anon_cred) < 0) {
fprintf(
stderr
, "memory error\n");
exit(1);
}
if (gnutls_cli_debug_options.present.starttls_proto) {
snprintf(app_proto, sizeof(app_proto), "%s", gnutls_cli_debug_options.arg.starttls_proto);
}
if (app_proto[0] == 0) {
snprintf(app_proto, sizeof(app_proto), "%s", port_to_service(portname, "tcp"));
}
sockets_init();
printf("GnuTLS debug client %s\n", gnutls_check_version(
((void *)0)
));
canonicalize_host(hostname, portname, sizeof(portname));
printf("Checking %s:%s\n", hostname, portname);
for (i = 0;
tls_tests[i].test_name !=
((void *)0)
;
i++) {
if (strcmp(app_proto, "https") != 0 && tls_tests[i].https_only != 0) {
continue;
}
if (!socket_opened) {
socket_open2(&hd, hostname, portname, app_proto, (1<<2)|(1<<3),
((void *)0)
,
((void *)0)
,
((void *)0)
,
((void *)0)
,
((void *)0)
);
hd.verbose = verbose;
socket_opened =
1
;
}
ret = tls_tests[i].func(hd.session);
if ((ret != TEST_IGNORE && ret != TEST_IGNORE2) || verbose) {
printf("%58s...", tls_tests[i].test_name);
fflush(
stdout
);
}
if (ret == TEST_SUCCEED) {
if (tls_tests[i].suc_str ==
((void *)0)
)
printf(" %s\n", ext_text);
else
printf(" %s\n", tls_tests[i].suc_str);
} else if (ret == TEST_FAILED)
printf(" %s\n", tls_tests[i].fail_str);
else if (ret == TEST_UNSURE)
printf(" %s\n", tls_tests[i].unsure_str);
else if ((ret == TEST_IGNORE || ret == TEST_IGNORE2) && verbose) {
printf(" skipped\n");
}
if (ret != TEST_IGNORE) {
socket_bye(&hd, 1);
socket_opened =
0
;
}
if (ret == TEST_FAILED && tls_tests[i].fatal_failure)
break;
}
gnutls_srp_free_client_credentials(srp_cred);
gnutls_certificate_free_credentials(xcred);
gnutls_anon_free_client_credentials(anon_cred);
gnutls_global_deinit();
return 0;
}
| undefined8 main(undefined4 param_1,undefined8 param_2)
{
bool bVar1;
int iVar2;
undefined8 uVar3;
long in_FS_OFFSET;
int local_150;
undefined local_148 [8];
undefined8 local_140;
int local_100;
char local_3e [6];
undefined8 local_38;
undefined8 local_30;
undefined8 local_28;
undefined8 local_20;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
bVar1 = false;
local_38 = 0;
local_30 = 0;
local_28 = 0;
local_20 = 0;
cmd_parser(param_1,param_2);
signal(0xd,(__sighandler_t)0x1);
sockets_init();
iVar2 = gnutls_global_init();
if (iVar2 < 0) {
fprintf(stderr,"global state initialization error\n");
exit(1);
}
gnutls_global_set_log_function(tls_log_func);
gnutls_global_set_log_level(debug);
snprintf(local_3e,6,"%d",(ulong)port);
iVar2 = gnutls_certificate_allocate_credentials(&xcred);
if (iVar2 < 0) {
fprintf(stderr,"memory error\n");
exit(1);
}
iVar2 = gnutls_srp_allocate_client_credentials(&srp_cred);
if (iVar2 < 0) {
fprintf(stderr,"memory error\n");
exit(1);
}
iVar2 = gnutls_anon_allocate_client_credentials(&anon_cred);
if (iVar2 < 0) {
fprintf(stderr,"memory error\n");
exit(1);
}
if (DAT_00102273 != '\0') {
snprintf((char *)&local_38,0x20,"%s",_printf);
}
if ((char)local_38 == '\0') {
uVar3 = port_to_service(local_3e,&DAT_001012e7);
snprintf((char *)&local_38,0x20,"%s",uVar3);
}
sockets_init();
uVar3 = gnutls_check_version(0);
printf("GnuTLS debug client %s\n",uVar3);
canonicalize_host(hostname,local_3e,6);
printf("Checking %s:%s\n",hostname,local_3e);
local_150 = 0;
while (*(long *)(tls_tests + (long)local_150 * 0x30) != 0) {
iVar2 = strcmp((char *)&local_38,"https");
if ((iVar2 == 0) || (*(int *)(tls_tests + (long)local_150 * 0x30 + 0x28) == 0)) {
if (!bVar1) {
socket_open2(local_148,hostname,local_3e,&local_38,0xc,0,0,0,0,0);
local_100 = verbose;
bVar1 = true;
}
iVar2 = (**(code **)(tls_tests + (long)local_150 * 0x30 + 8))(local_140);
if (((iVar2 != 3) && (iVar2 != 4)) || (verbose != 0)) {
printf("%58s...",*(undefined8 *)(tls_tests + (long)local_150 * 0x30));
fflush(stdout);
}
if (iVar2 == 0) {
if (*(long *)(tls_tests + (long)local_150 * 0x30 + 0x10) == 0) {
printf(" %s\n",ext_text);
}
else {
printf(" %s\n",*(undefined8 *)(tls_tests + (long)local_150 * 0x30 + 0x10));
}
}
else if (iVar2 == 1) {
printf(" %s\n",*(undefined8 *)(tls_tests + (long)local_150 * 0x30 + 0x18));
}
else if (iVar2 == 2) {
printf(" %s\n",*(undefined8 *)(tls_tests + (long)local_150 * 0x30 + 0x20));
}
else if (((iVar2 == 3) || (iVar2 == 4)) && (verbose != 0)) {
printf(" skipped\n");
}
if (iVar2 != 3) {
socket_bye(local_148,1);
bVar1 = false;
}
if ((iVar2 == 1) && (*(int *)(tls_tests + (long)local_150 * 0x30 + 0x2c) != 0)) break;
}
local_150 = local_150 + 1;
}
gnutls_srp_free_client_credentials(srp_cred);
gnutls_certificate_free_credentials(xcred);
gnutls_anon_free_client_credentials(anon_cred);
gnutls_global_deinit();
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return 0;
}
__stack_chk_fail();
}
|
int matchuser(char *user_name, char *list) {
char *pos;
size_t l = strlen(user_name);
for (pos = list; (pos = strstr(pos, user_name)) !=
((void *)0)
; pos += l) {
if ((pos != list) && (*(pos - 1) != ','))
continue;
if ((pos[l] != '\0') && (pos[l] != ','))
continue;
return 1;
}
return 0;
}
| long matchuser(const char *a1, char *a2)
{
char *i;
size_t v4;
v4 = strlen(a1);
for ( i = strstr(a2, a1); i; i = strstr(&i[v4], a1) )
{
if ( (i == a2 || *(i - 1) == 44) && (!i[v4] || i[v4] == 44) )
return 1LL;
}
return 0LL;
}
|
static
_Bool
parse_amin (const struct parser_table* entry, char **argv, int *arg_ptr)
{
return do_parse_xmin (entry, argv, arg_ptr, XVAL_ATIME);
}
| long long parse_amin(unsigned long long a0, unsigned long long a1, unsigned long long a2) {
return do_parse_xmin(a0, a1, a2, 0x0);
}
|
char *
stputs(const char *s, char *p)
{
return stnputs(s, strlen(s), p);
}
| long long stputs(void* a0, unsigned long a1) {
return stnputs(a0, strlen(a0), a1);
}
|
static int do_del(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_DEL), .version = (0x1), }, };
ila_parse_opt(argc, argv, &req.n,
0
);
if (rtnl_talk(&genl_rth, &req.n,
((void *)0)
) < 0)
return -2;
return 0;
}
| void do_del(unsigned long a0, unsigned int a1) {
unsigned int v0;
void* v1;
unsigned short v2;
unsigned short v3;
char v4;
char v5;
unsigned long long v7;
void* v8;
unsigned long v9;
unsigned long v10;
v0 = a0;
v7 = 130;
for (v8 = &v1; v7; v8 += v9 * 8) {
v7 -= 1;
v1 = 0;
}
*(v8) = 0;
v1 = 20;
v2 = genl_family;
v3 = 1;
v4 = 2;
v5 = 1;
ila_parse_opt(v0, a1, &v1, 0x0);
v10 = (rtnl_talk(&genl_rth, &v1, 0x0) < 0 ? 0 : 4294967294);
return;
}
|
static
_Bool
tail (char const *filename, int fd, uintmax_t n_units,
uintmax_t *read_pos)
{
*read_pos = 0;
if (count_lines)
return tail_lines (filename, fd, n_units, read_pos);
else
return tail_bytes (filename, fd, n_units, read_pos);
}
| long tail(const char *a1, unsigned int a2, size_t a3, signed long *a4)
{
*a4 = 0LL;
if ( count_lines )
return tail_lines(a1, a2, a3, a4);
else
return tail_bytes(a1, a2, a3, a4);
}
|
static void
delete_chars (int count)
{
if (count > _rl_screenwidth)
return;
if (_rl_term_DC && *_rl_term_DC)
{
char *buffer;
buffer = tgoto (_rl_term_DC, count, count);
tputs (buffer, count, _rl_output_character_function);
}
else
{
if (_rl_term_dc && *_rl_term_dc)
while (count--)
tputs (_rl_term_dc, 1, _rl_output_character_function);
}
}
| int delete_chars(int a1)
{
int result;
int v2;
const char *v3;
v2 = a1;
result = rl_screenwidth;
if ( a1 <= rl_screenwidth )
{
if ( rl_term_DC && *rl_term_DC )
{
v3 = tgoto(rl_term_DC, a1, a1);
return tputs(v3, a1, (int (*)(int))&rl_output_character_function);
}
else
{
result = (int)rl_term_dc;
if ( rl_term_dc )
{
result = (unsigned char)*rl_term_dc;
if ( (_BYTE)result )
{
while ( 1 )
{
result = v2--;
if ( !result )
break;
tputs(rl_term_dc, 1, (int (*)(int))&rl_output_character_function);
}
}
}
}
}
return result;
}
|
void
dump_file (struct tar_stat_info *parent, char const *name,
char const *fullname)
{
struct tar_stat_info st;
tar_stat_init (&st);
st.parent = parent;
dump_file0 (&st, name, fullname);
if (parent && listed_incremental_option)
update_parent_directory (parent);
tar_stat_destroy (&st);
}
| void dump_file(unsigned long long a0, unsigned long long a1, unsigned long long a2) {
char v0;
unsigned long v1;
char v2;
unsigned long long *v4;
unsigned long long v5;
tar_stat_init(&v0);
v1 = a0;
dump_file0(&v0, a1, a2, a1);
if (a0 && listed_incremental_option)
update_parent_directory(a0);
tar_stat_destroy(&v0);
v5 = *(&v2) ^ v4[5];
return;
}
|
static rsRetVal
TCPSendBufUncompressed(wrkrInstanceData_t *pWrkrData, uchar *const buf, const unsigned len)
{
rsRetVal iRet = RS_RET_OK;
unsigned alreadySent;
ssize_t lenSend;
alreadySent = 0;
if((iRet = netstrm.CheckConnection(pWrkrData->pNetstrm)) != RS_RET_OK) goto finalize_it;
while(alreadySent != len) {
lenSend = len - alreadySent;
if((iRet = netstrm.Send(pWrkrData->pNetstrm, buf+alreadySent, &lenSend)) != RS_RET_OK) goto finalize_it;
if(Debug) { r_dbgprintf("omfwd.c", "omfwd: TCP sent %ld bytes, requested %u\n", (long) lenSend, len - alreadySent); };
alreadySent += lenSend;
}
((void) __sync_fetch_and_add(&pWrkrData->pData->sentBytes, len));
finalize_it:
if(iRet != RS_RET_OK) {
if(iRet == RS_RET_IO_ERROR) {
static unsigned int conErrCnt = 0;
const int skipFactor = pWrkrData->pData->iConErrSkip;
if (skipFactor <= 1) {
LogError(0, iRet, "omfwd: remote server at %s:%s seems to have closed connection. "
"This often happens when the remote peer (or an interim system like a load "
"balancer or firewall) shuts down or aborts a connection. Rsyslog will "
"re-open the connection if configured to do so (we saw a generic IO Error, "
"which usually goes along with that behaviour).",
pWrkrData->pData->target, pWrkrData->pData->port);
} else if ((conErrCnt++ % skipFactor) == 0) {
LogError(0, iRet, "omfwd: remote server at %s:%s seems to have closed connection. "
"This often happens when the remote peer (or an interim system like a load "
"balancer or firewall) shuts down or aborts a connection. Rsyslog will "
"re-open the connection if configured to do so (we saw a generic IO Error, "
"which usually goes along with that behaviour). Note that the next %d "
"connection error messages will be skipped.",
pWrkrData->pData->target, pWrkrData->pData->port, skipFactor-1);
}
} else {
LogError(0, iRet, "omfwd: TCPSendBuf error %d, destruct TCP Connection to %s:%s",
iRet, pWrkrData->pData->target, pWrkrData->pData->port);
}
DestructTCPInstanceData(pWrkrData);
iRet = RS_RET_SUSPENDED;
}
return iRet;
}
| int TCPSendBufUncompressed(struct_0 *a0, unsigned long a1, unsigned long a2) {
unsigned int v0;
int tmp_6;
int tmp_4;
int tmp_2;
int tmp_10;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned long v4;
v0 = a2;
v1 = 0;
v2 = 0;
v1 = *(4217304)(a0->field_10);
if (!v1) {
while (true) {
if (v2 != v0) {
v4 = v0 - v2;
v1 = g_405998(a0->field_10, v2 + a1, &v4, g_405998);
if (v1)
break;
if (!v1) {
if (Debug)
r_dbgprintf("omfwd.c", "omfwd: TCP sent %ld bytes, requested %u\n");
v2 += v4;
}
} else {
do {
*(&a0->field_0[1].padding_0[76]) = *(&a0->field_0[1].padding_0[76]) + v0;
tmp_6 = BinaryOp CasCmpNE;
} while (tmp_6);
}
}
}
if (v1) {
if (v1 == -2027) {
v3 = a0->field_0->field_a0;
if (v3 <= 1) {
LogError(0x0, v1, "omfwd: remote server at %s:%s seems to have closed connection. This often happens when the remote peer (or an interim system like a load balancer or firewall) shuts down or aborts a connection. Rsyslog will re-open the connection if configured to do so (we saw a generic IO Error, which usually goes along with that behaviour).");
} else {
tmp_10 = conErrCnt.11218;
conErrCnt.11218 = conErrCnt.11218 + 1;
if (!(0 CONCAT tmp_10) /m v3 >> 32)
LogError(0x0, v1, "omfwd: remote server at %s:%s seems to have closed connection. This often happens when the remote peer (or an interim system like a load balancer or firewall) shuts down or aborts a connection. Rsyslog will re-open the connection if configured to do so (we saw a generic IO Error, which usually goes along with that behaviour). Note that the next %d connection error messages will be skipped.");
}
} else {
LogError(0x0, v1, "omfwd: TCPSendBuf error %d, destruct TCP Connection to %s:%s");
}
DestructTCPInstanceData(a0);
v1 = -2007;
}
return v1;
}
|
char *
chop(char *s)
{
char *t = s;
while (*t) {
if (*t == '\n' || *t == '\r') {
*t = '\0';
return s;
}
t++;
}
return s;
}
| char * chop(char *param_1)
{
char *local_10;
local_10 = param_1;
while( true ) {
if (*local_10 == '\0') {
return param_1;
}
if ((*local_10 == '\n') || (*local_10 == '\r')) break;
local_10 = local_10 + 1;
}
*local_10 = '\0';
return param_1;
}
|
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;
}
|
void
seedrand32 ()
{
unsigned int iv;
iv = genseed ();
sbrand32 (iv);
}
| long long seedrand32() {
unsigned int v0;
v0 = genseed();
return sbrand32(v0);
}
|
static int rule_dump_check_magic(void)
{
int ret;
__u32 magic = 0;
if (isatty(
0
)) {
fprintf(
stderr
, "Can't restore rule dump from a terminal\n");
return -1;
}
ret = fread(&magic, sizeof(magic), 1,
stdin
);
if (magic != rule_dump_magic) {
fprintf(
stderr
, "Magic mismatch (%d elems, %x magic)\n",
ret, magic);
return -1;
}
return 0;
}
| int rule_dump_check_magic() {
unsigned int v0;
unsigned int v1;
unsigned int v3;
v0 = 0;
if (isatty(0x0)) {
fprintf(*(&stderr), "Can't restore rule dump from a terminal\n");
v3 = -1;
return v3;
}
v1 = fread(&v0, 0x4, 0x1, stdin);
if (v0 == rule_dump_magic) {
v3 = 0;
return v3;
}
fprintf(*(&stderr), "Magic mismatch (%d elems, %x magic)\n", v1, v0);
v3 = -1;
return v3;
}
|
void
xtrace_set (fd, fp)
int fd;
FILE *fp;
{
if (fd >= 0 && sh_validfd (fd) == 0)
{
internal_error (gettext("xtrace_set: %d: invalid file descriptor"), fd);
return;
}
if (fp == 0)
{
internal_error (gettext("xtrace_set: NULL file pointer"));
return;
}
if (fd >= 0 && fileno (fp) != fd)
internal_warning (gettext("xtrace fd (%d) != fileno xtrace fp (%d)"), fd, fileno (fp));
xtrace_fd = fd;
xtrace_fp = fp;
}
| void xtrace_set(unsigned long a0, void* a1, unsigned long long a2) {
unsigned long long v1;
unsigned long long v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
if (a0 >= 0 && !sh_validfd(a0)) {
v1 = gettext("xtrace_set: %d: invalid file descriptor");
v2 = internal_error(v1, a0, v1);
return;
}
if (!a1) {
v3 = internal_error(gettext("xtrace_set: NULL file pointer"), a1, a2);
return;
}
if (a0 >= 0 && a0 != fileno(a1)) {
v4 = gettext("xtrace fd (%d) != fileno xtrace fp (%d)");
internal_warning(v4, a0, fileno(a1), v4);
}
xtrace_fd = a0;
v5 = a1;
xtrace_fp = a1;
return;
}
|
void usage(void)
{
fprintf(
stderr
,
"Usage:\t shutdown [-akrhPHfFnc] [-t sec] time [warning message]\n"
"\t\t -a: use /etc/shutdown.allow\n"
"\t\t -k: don't really shutdown, only warn.\n"
"\t\t -r: reboot after shutdown.\n"
"\t\t -h: halt after shutdown.\n"
"\t\t -P: halt action is to turn off power.\n"
"\t\t can only be used along with -h flag.\n"
"\t\t -H: halt action is to just halt.\n"
"\t\t can only be used along with -h flag.\n"
"\t\t -f: do a 'fast' reboot (skip fsck).\n"
"\t\t -F: Force fsck on reboot.\n"
"\t\t -n: do not go through \"init\" but go down real fast.\n"
"\t\t -c: cancel a running shutdown.\n"
"\t\t -q: quiet mode - display fewer shutdown warnings.\n"
"\t\t -Q: full quiet mode - display only final shutdown warning.\n"
"\t\t -t secs: delay between warning and kill signal.\n"
"\t\t ** the \"time\" argument is mandatory! (try \"now\") **\n");
exit(1);
}
| void usage(void)
{
fprintf(stderr,
"Usage:\t shutdown [-akrhPHfFnc] [-t sec] time [warning message]\n\t\t -a: use /etc/shutdown.allow\n\t\t -k: don\'t really shutdown, only warn.\n\t\t -r: reboot after shutdown.\n\t\t -h: halt after shutdown.\n\t\t -P: halt action is to turn off power.\n\t\t can only be used along with -h flag.\n\t\t -H: halt action is to just halt.\n\t\t can only be used along with -h flag.\n\t\t -f: do a \'fast\' reboot (skip fsck).\n\t\t -F: Force fsck on reboot.\n\t\t -n: do not go through \"init\" but go down real fast.\n\t\t -c: cancel a running shutdown.\n\t\t -q: quiet mode - display fewer shutdown warnings.\n\t\t -Q: full quiet mode - display only final shutdown warning.\n\t\t -t secs: delay between warning and kill signal.\n\t\t ** the \"time\" argument is mandatory! (try \"now\") **\n"
);
exit(1);
}
|
void
fgrep_to_grep_pattern (char **keys_p, idx_t *len_p)
{
idx_t len = *len_p;
char *keys = *keys_p;
mbstate_t mb_state = { 0 };
char *new_keys = xnmalloc (len + 1, 2);
char *p = new_keys;
for (ptrdiff_t n; len; keys += n, len -= n)
{
n = mb_clen (keys, len, &mb_state);
switch (n)
{
case -2:
n = len;
__attribute__ ((__fallthrough__));
default:
p = mempcpy (p, keys, n);
break;
case -1:
memset (&mb_state, 0, sizeof mb_state);
n = 1;
__attribute__ ((__fallthrough__));
case 1:
switch (*keys)
{
case '$': case '*': case '.': case '[': case '\\': case '^':
*p++ = '\\'; break;
}
*p++ = *keys;
break;
}
}
*p = '\n';
free (*keys_p);
*keys_p = new_keys;
*len_p = p - new_keys;
}
| void fgrep_to_grep_pattern(char **param_1,size_t *param_2)
{
char *pcVar1;
long in_FS_OFFSET;
size_t local_40;
char *local_38;
char *local_30;
size_t local_28;
undefined8 local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_40 = *param_2;
local_38 = *param_1;
local_18 = 0;
pcVar1 = (char *)xnmalloc(local_40 + 1,2);
local_30 = pcVar1;
do {
if (local_40 == 0) {
*local_30 = '\n';
free(*param_1);
*param_1 = pcVar1;
*param_2 = (long)local_30 - (long)pcVar1;
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
__stack_chk_fail();
}
local_28 = mb_clen(local_38,local_40,&local_18);
if (local_28 == 1) {
LAB_00103c82:
if (((int)*local_38 - 0x24U < 0x3b) &&
((1 << ((byte)((int)*local_38 - 0x24U) & 0x3f) & 0x580000000000441U) != 0)) {
*local_30 = '\\';
local_30 = local_30 + 1;
}
*local_30 = *local_38;
local_30 = local_30 + 1;
}
else {
if ((long)local_28 < 2) {
if (local_28 == 0xfffffffffffffffe) {
local_28 = local_40;
}
else if (local_28 == 0xffffffffffffffff) {
memset(&local_18,0,8);
local_28 = 1;
goto LAB_00103c82;
}
}
local_30 = (char *)mempcpy(local_30,local_38,local_28);
}
local_38 = local_38 + local_28;
local_40 = local_40 - local_28;
} while( true );
}
|
const u_char *
sshbuf_ptr(const struct sshbuf *buf)
{
if (sshbuf_check_sanity(buf) != 0)
return
((void *)0)
;
return buf->cd + buf->off;
}
| int sshbuf_ptr(unsigned long long a0[3]) {
unsigned int v1;
v1 = sshbuf_check_sanity(a0);
if (v1)
v1 = 0;
else
v1 = a0[2] + a0[1];
return v1;
}
|
static void xdp_dump_json_one(struct rtattr *tb[(__IFLA_XDP_MAX - 1) + 1], __u32 attr,
__u8 mode)
{
if (!tb[attr])
return;
open_json_object(
((void *)0)
);
print_uint(PRINT_JSON, "mode",
((void *)0)
, mode);
bpf_dump_prog_info(
((void *)0)
, rta_getattr_u32(tb[attr]));
close_json_object();
}
| long xdp_dump_json_one(long a1, unsigned int a2, unsigned char a3)
{
long result;
long v4;
result = *(_QWORD *)(8LL * a2 + a1);
if ( result )
{
open_json_object(0LL);
print_uint(2u, (long)"mode", 0LL, a3);
v4 = (unsigned int)rta_getattr_u32(*(_QWORD *)(8LL * a2 + a1));
bpf_dump_prog_info(0LL, v4);
return close_json_object();
}
return result;
}
|
void crypto_sign_ed25519_ref_fe25519_unpack(crypto_sign_ed25519_ref_fe25519 *r, const unsigned char x[32])
{
int i;
for(i=0;i<32;i++) r->v[i] = x[i];
r->v[31] &= 127;
}
| long long crypto_sign_ed25519_ref_fe25519_unpack(unsigned int a0[32], char *a1) {
unsigned int v0;
for (v0 = 0; v0 <= 31; v0 = __addvsi3(v0, 0x1, v0)) {
a0[v0] = a1[v0];
}
a0[31] = a0[31] & 127;
return a0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.