input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
int
sshkey_perm_ok(int fd, const char *filename)
{
struct stat st;
if (fstat(fd, &st) == -1)
return -24;
if ((st.st_uid == getuid()) && (st.st_mode & 077) != 0) {
sshlog("authfile.c", __func__, 105, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
sshlog("authfile.c", __func__, 106, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "@ WARNING: UNPROTECTED PRIVATE KEY FILE! @");
sshlog("authfile.c", __func__, 107, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
sshlog("authfile.c", __func__, 108, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Permissions 0%3.3o for '%s' are too open.", (u_int)st.st_mode & 0777, filename)
;
sshlog("authfile.c", __func__, 110, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "It is required that your private key files are NOT accessible by others.");
sshlog("authfile.c", __func__, 111, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "This private key will be ignored.");
return -44;
}
return 0;
}
| int sshkey_perm_ok(unsigned long a0, unsigned long a1) {
unsigned long long v0;
unsigned long v1;
unsigned long long v2;
char v3;
char v4;
char v5;
unsigned int v7;
if (fstat(a0, &v3) == -1) {
v7 = -24;
} else {
if (*(&v5) == getuid() && (*(&v4) & 63)) {
v2 = "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@";
sshlog("authfile.c", "sshkey_perm_ok", 0x69, 0x0, 0x2, 0x0);
v2 = "@ WARNING: UNPROTECTED PRIVATE KEY FILE! @";
sshlog("authfile.c", "sshkey_perm_ok", 0x6a, 0x0, 0x2, 0x0);
v2 = "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@";
sshlog("authfile.c", "sshkey_perm_ok", 0x6b, 0x0, 0x2, 0x0);
v2 = a1;
v1 = *(&v4) & 511;
v0 = "Permissions 0%3.3o for '%s' are too open.";
sshlog("authfile.c", "sshkey_perm_ok", 0x6c, 0x0, 0x2, 0x0);
v2 = "It is required that your private key files are NOT accessible by others.";
sshlog("authfile.c", "sshkey_perm_ok", 0x6e, 0x0, 0x2, 0x0);
v2 = "This private key will be ignored.";
sshlog("authfile.c", "sshkey_perm_ok", 0x6f, 0x0, 0x2, 0x0);
v7 = -44;
goto LABEL_400300;
}
v7 = 0;
}
LABEL_400300:
return v7;
}
|
char *
colon(char *cp)
{
int flag = 0;
if (*cp == ':')
return
((void *)0)
;
if (*cp == '[')
flag = 1;
for (; *cp; ++cp) {
if (*cp == '@' && *(cp+1) == '[')
flag = 1;
if (*cp == ']' && *(cp+1) == ':' && flag)
return (cp+1);
if (*cp == ':' && !flag)
return (cp);
if (*cp == '/')
return
((void *)0)
;
}
return
((void *)0)
;
}
| _BYTE * colon(_BYTE *a1)
{
_BYTE *v2;
_BOOL4 v3;
v2 = a1;
if ( *a1 == 58 )
return 0LL;
v3 = *a1 == 91;
while ( *v2 )
{
if ( *v2 == 64 && v2[1] == 91 )
v3 = 1;
if ( *v2 == 93 && v2[1] == 58 && v3 )
return v2 + 1;
if ( *v2 == 58 && !v3 )
return v2;
if ( *v2 == 47 )
return 0LL;
++v2;
}
return 0LL;
}
|
int
match_host_and_ip(const char *host, const char *ipaddr,
const char *patterns)
{
int mhost, mip;
if ((mip = addr_match_list(ipaddr, patterns)) == -2)
return -1;
else if (host ==
((void *)0)
|| ipaddr ==
((void *)0)
|| mip == -1)
return 0;
if ((mhost = match_hostname(host, patterns)) == -1)
return 0;
if (mhost == 0 && mip == 0)
return 0;
return 1;
}
| long match_host_and_ip(long a1, long a2, const char *a3)
{
int matched;
int v6;
matched = addr_match_list(a2, a3);
if ( matched == -2 )
return 0xFFFFFFFFLL;
if ( !a1 || !a2 || matched == -1 )
return 0LL;
v6 = match_hostname(a1, a3);
if ( v6 == -1 )
return 0LL;
return v6 || matched;
}
|
static void
append_file (char *file_name)
{
int handle = openat (chdir_fd, file_name,
00
|
0
);
struct stat stat_data;
if (handle < 0)
{
open_error (file_name);
return;
}
if (fstat (handle, &stat_data) != 0)
stat_error (file_name);
else
{
off_t bytes_left = stat_data.st_size;
while (bytes_left > 0)
{
union block *start = find_next_block ();
size_t buffer_size = available_space_after (start);
size_t status;
char buf[((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)];
if (bytes_left < buffer_size)
{
buffer_size = bytes_left;
status = buffer_size % 512;
if (status)
memset (start->buffer + bytes_left, 0, 512 - status);
}
status = safe_read (handle, start->buffer, buffer_size);
if (status == ((size_t) -1))
read_fatal_details (file_name, stat_data.st_size - bytes_left,
buffer_size);
if (status == 0)
do { if (error_hook) error_hook (); error (0, 0, ngettext ("%s: File shrank by %s byte", "%s: File shrank by %s bytes", bytes_left), quotearg_colon (file_name), umaxtostr (bytes_left, buf)); fatal_exit (); } while (0)
;
bytes_left -= status;
set_next_block_after (start + (status - 1) / 512);
}
}
if (close (handle) != 0)
close_error (file_name);
}
| void append_file(unsigned long long a0, unsigned long a1, unsigned long long a2, unsigned long a3, unsigned long a4, unsigned long long a5) {
unsigned int v0;
unsigned long long v1;
unsigned long long v2;
unsigned long long v3;
unsigned long v4;
char v5;
char v6;
char v7;
char v8;
unsigned long long *v14;
unsigned long long v15;
v0 = openat(chdir_fd, a0, 0x0, a0);
if (v0 < 0) {
open_error(a0);
} else {
if (fstat(v0, &v5)) {
stat_error(a0);
} else {
v1 = *(&v6);
while (v1 > 0) {
v3 = find_next_block();
v2 = available_space_after(v3);
if (v2 > v1) {
v2 = v1;
v4 = v2 & 511;
if (v4)
memset(v3 + v1, 0x0, 0x200 - v4);
}
v4 = safe_read(v0, v3, v2, v3);
if (v4 == -1)
read_fatal_details(a0, *(&v6) - v1, v2, *(&v6) - v1);
if (!v4) {
if (error_hook)
*(5242960)();
error(0x0, 0x0, ngettext("%s: File shrank by %s byte", "%s: File shrank by %s bytes", v1));
fatal_exit(0x0, 0x0, a2, quotearg_colon(a0), umaxtostr(v1, &v7, &v7), a5);
}
v1 -= v4;
set_next_block_after(v3 + (v4 - 1 & -0x200));
}
}
if (close(v0))
close_error(a0);
}
v15 = *(&v8) ^ v14[5];
return;
}
|
static int
execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
SIMPLE_COM *simple_command;
int pipe_in, pipe_out, async;
struct fd_bitmap *fds_to_close;
{
WORD_LIST *words, *lastword;
char *command_line, *lastarg, *temp;
int first_word_quoted, result, builtin_is_special, already_forked, dofork;
int fork_flags, cmdflags;
pid_t old_last_async_pid;
sh_builtin_func_t *builtin;
SHELL_VAR *func;
volatile int old_builtin, old_command_builtin;
result = 0;
special_builtin_failed = builtin_is_special = 0;
command_line = (char *)0;
do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0);
if (variable_context && interactive_shell && sourcelevel == 0)
{
line_number -= function_line_number - 1;
if (line_number <= 0)
line_number = 1;
}
command_string_index = 0;
print_simple_command (simple_command);
if (signal_in_progress (
(64 + 1)
) == 0 && running_trap == 0)
{
do { if (the_printed_command_except_trap) sh_xfree((the_printed_command_except_trap), "execute_cmd.c", 4394); } while (0);
the_printed_command_except_trap = the_printed_command ? (char *)strcpy (sh_xmalloc((1 + strlen (the_printed_command)), "execute_cmd.c", 4395), (the_printed_command)) : (char *)0;
}
result = run_debug_trap ();
if (debugging_mode && result != 0)
return (0);
cmdflags = simple_command->flags;
first_word_quoted =
simple_command->words ? (simple_command->words->word->flags & (1 << 1)) : 0;
last_command_subst_pid = (pid_t)-1;
old_last_async_pid = last_asynchronous_pid;
already_forked = 0;
dofork = pipe_in != -1 || pipe_out != -1 || async;
if (dofork && pipe_in == -1 && pipe_out == -1 &&
simple_command->words && simple_command->words->word &&
simple_command->words->word->word &&
(simple_command->words->word->word[0] == '%'))
dofork = 0;
if (dofork)
{
char *p;
maybe_make_export_env ();
fork_flags = async ? 1 : 0;
if (make_child (p = (char *)strcpy (sh_xmalloc((1 + strlen (the_printed_command_except_trap)), "execute_cmd.c", 4443), (the_printed_command_except_trap)), fork_flags) == 0)
{
already_forked = 1;
cmdflags |= 0x40;
subshell_environment = 0x08|0x100;
if (pipe_in != -1 || pipe_out != -1)
subshell_environment |= 0x10;
if (async)
subshell_environment |= 0x01;
if (fds_to_close)
close_fd_bitmap (fds_to_close);
stdin_redir |= pipe_in != -1;
do_piping (pipe_in, pipe_out);
pipe_in = pipe_out = -1;
coproc_closeall ();
last_asynchronous_pid = old_last_async_pid;
if (async)
subshell_level++;
do { if (p) sh_xfree((p), "execute_cmd.c", 4477); } while (0);
}
else
{
if (pipe_out != -1)
result = last_command_exit_value;
close_pipes (pipe_in, pipe_out);
command_line = (char *)
((void *)0)
;
return (result);
}
}
do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0);
if ((cmdflags & 0x20) == 0)
{
current_fds_to_close = fds_to_close;
fix_assignment_words (simple_command->words);
fix_arrayref_words (simple_command->words);
if (cmdflags & 0x08)
comsub_ignore_return++;
words = expand_words (simple_command->words);
if (cmdflags & 0x08)
comsub_ignore_return--;
current_fds_to_close = (struct fd_bitmap *)
((void *)0)
;
}
else
words = copy_word_list (simple_command->words);
if (words == 0)
{
this_command_name = 0;
result = execute_null_command (simple_command->redirects,
pipe_in, pipe_out,
already_forked ? 0 : async);
if (already_forked)
sh_exit (result);
else
{
bind_lastarg ((char *)
((void *)0)
);
set_pipestatus_from_exit (result);
return (result);
}
}
lastarg = (char *)
((void *)0)
;
begin_unwind_frame ("simple-command");
if (echo_command_at_execute && (cmdflags & 0x0800) == 0)
xtrace_print_word_list (words, 1);
builtin = (sh_builtin_func_t *)
((void *)0)
;
func = (SHELL_VAR *)
((void *)0)
;
if ((cmdflags & 0x10) == 0)
{
if (posixly_correct)
{
builtin = find_special_builtin (words->word->word);
if (builtin)
builtin_is_special = 1;
}
if (builtin == 0)
func = find_function (words->word->word);
}
if (posixly_correct && tempenv_assign_error)
{
last_command_exit_value = 1;
if (interactive_shell == 0 && builtin_is_special)
jump_to_top_level (1);
else if (interactive_shell == 0)
jump_to_top_level (2);
else
jump_to_top_level (2);
}
tempenv_assign_error = 0;
old_command_builtin = -1;
if (builtin == 0 && func == 0)
{
WORD_LIST *disposer, *l;
int cmdtype;
builtin = find_shell_builtin (words->word->word);
while (builtin == command_builtin)
{
disposer = words;
cmdtype = 0;
words = check_command_builtin (words, &cmdtype);
if (cmdtype > 0)
{
for (l = disposer; l->next != words; l = l->next)
;
l->next = 0;
dispose_words (disposer);
cmdflags |= 0x0800 | 0x10;
if (cmdtype == 2)
cmdflags |= 0x4000;
builtin = find_shell_builtin (words->word->word);
}
else
break;
}
if (cmdflags & 0x0800)
{
old_command_builtin = executing_command_builtin;
unwind_protect_mem ((char *)&(executing_command_builtin), sizeof (executing_command_builtin));
executing_command_builtin |= 1;
}
builtin = 0;
}
add_unwind_protect (dispose_words, words);
do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0);
for (lastword = words; lastword->next; lastword = lastword->next)
;
lastarg = lastword->word->word;
if (words->word->word[0] == '%' && already_forked == 0)
{
this_command_name = async ? "bg" : "fg";
last_shell_builtin = this_shell_builtin;
this_shell_builtin = builtin_address (this_command_name);
result = (*this_shell_builtin) (words);
goto return_result;
}
if (job_control && already_forked == 0 && async == 0 &&
!first_word_quoted &&
!words->next &&
words->word->word[0] &&
!simple_command->redirects &&
pipe_in == -1 &&
pipe_out == -1 &&
(temp = get_string_value ("auto_resume")))
{
int job, jflags, started_status;
jflags = 0x08|0x10;
if (((temp)[0] == ("exact")[0] && strcmp(temp, "exact") == 0))
jflags |= 0x04;
else if (((temp)[0] == ("substring")[0] && strcmp(temp, "substring") == 0))
jflags |= 0x02;
else
jflags |= 0x01;
job = get_job_by_name (words->word->word, jflags);
if (job != -1)
{
run_unwind_frame ("simple-command");
this_command_name = "fg";
last_shell_builtin = this_shell_builtin;
this_shell_builtin = builtin_address ("fg");
started_status = start_job (job, 1);
return ((started_status < 0) ? 1 : started_status);
}
}
run_builtin:
this_command_name = words->word->word;
do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0);
if (func == 0 && builtin == 0)
builtin = find_shell_builtin (this_command_name);
last_shell_builtin = this_shell_builtin;
this_shell_builtin = builtin;
if (builtin || func)
{
if (builtin)
{
old_builtin = executing_builtin;
unwind_protect_mem ((char *)&(executing_builtin), sizeof (executing_builtin));
if (old_command_builtin == -1)
{
old_command_builtin = executing_command_builtin;
unwind_protect_mem ((char *)&(executing_command_builtin), sizeof (executing_command_builtin));
}
}
if (already_forked)
{
reset_signal_handlers ();
subshell_environment |= 0x80;
subshell_environment &= ~0x100;
if (async)
{
if ((cmdflags & 0x400) &&
pipe_in == -1 &&
(stdin_redirects (simple_command->redirects) == 0))
async_redirect_stdin ();
setup_async_signals ();
}
if (async == 0)
subshell_level++;
execute_subshell_builtin_or_function
(words, simple_command->redirects, builtin, func,
pipe_in, pipe_out, async, fds_to_close,
cmdflags);
subshell_level--;
}
else
{
result = execute_builtin_or_function
(words, builtin, func, simple_command->redirects, fds_to_close,
cmdflags);
if (builtin)
{
if (result > 256)
{
switch (result)
{
case 259:
case 260:
case 261:
if (posixly_correct && builtin_is_special && interactive_shell == 0)
{
last_command_exit_value = 1;
jump_to_top_level (4);
}
break;
case 262:
executing_builtin = old_builtin;
executing_command_builtin = old_command_builtin;
builtin = 0;
pipe_in = pipe_out = -1;
goto execute_from_filesystem;
}
result = builtin_status (result);
if (builtin_is_special)
special_builtin_failed = 1;
}
if (posixly_correct && builtin_is_special && temporary_env)
merge_temporary_env ();
}
else
{
if (result == 258)
result = 2;
else if (result > 256)
result = builtin_status (result);
}
set_pipestatus_from_exit (result);
goto return_result;
}
}
if (autocd && interactive && words->word && is_dirname (words->word->word))
{
words = make_word_list (make_word ("--"), words);
words = make_word_list (make_word ("cd"), words);
xtrace_print_word_list (words, 0);
func = find_function ("cd");
goto run_builtin;
}
execute_from_filesystem:
if (command_line == 0)
command_line = (char *)strcpy (sh_xmalloc((1 + strlen (the_printed_command_except_trap ? the_printed_command_except_trap : "")), "execute_cmd.c", 4802), (the_printed_command_except_trap ? the_printed_command_except_trap : ""));
if (already_forked == 0 && (cmdflags & 0x40) && fifos_pending() > 0)
cmdflags &= ~0x40;
result = execute_disk_command (words, simple_command->redirects, command_line,
pipe_in, pipe_out, async, fds_to_close,
cmdflags);
return_result:
bind_lastarg (lastarg);
do { if (command_line) sh_xfree((command_line), "execute_cmd.c", 4817); } while (0);
dispose_words (words);
if (builtin)
{
executing_builtin = old_builtin;
executing_command_builtin = old_command_builtin;
}
discard_unwind_frame ("simple-command");
this_command_name = (char *)
((void *)0)
;
return (result);
}
| long execute_simple_command(long a1, int a2, int a3, unsigned int a4, unsigned int *a5)
{
size_t v5;
const char *v6;
char *v7;
char *v8;
int v10;
_BOOL4 v11;
const char *v12;
size_t v13;
char *v14;
int v15;
const char *v16;
int v17;
long word;
long v19;
const char *v20;
const char *v21;
size_t v22;
char *v23;
int v29;
int v30;
unsigned int v31;
int v32;
int v33;
_BOOL4 v34;
int v35;
unsigned int v36;
int v37;
int v38;
_BOOL4 v39;
unsigned int job_by_name;
unsigned int started;
long ***word_list;
long ***j;
char *v44;
long ( *special_builtin)(_QWORD);
_QWORD *function;
long *i;
char *v48;
const char *v49;
long *v50;
char *s1;
unsigned long v52;
v52 = __readfsqword(0x28u);
v31 = 0;
v32 = 0;
special_builtin_failed = 0;
v44 = 0LL;
if ( terminating_signal )
termsig_handler(terminating_signal);
if ( interrupt_state )
throw_to_top_level();
if ( variable_context )
{
if ( interactive_shell )
{
if ( !sourcelevel )
{
line_number -= function_line_number - 1;
if ( line_number <= 0 )
line_number = 1;
}
}
}
command_string_index = 0;
print_simple_command(a1);
if ( !(unsigned int)signal_in_progress(65LL) && !running_trap )
{
if ( the_printed_command_except_trap )
sh_xfree(the_printed_command_except_trap, "execute_cmd.c", 4394LL);
if ( the_printed_command )
{
v5 = strlen(the_printed_command);
v6 = the_printed_command;
v7 = (char *)sh_xmalloc(v5 + 1, "execute_cmd.c", 4395LL);
v8 = strcpy(v7, v6);
}
else
{
v8 = 0LL;
}
the_printed_command_except_trap = v8;
}
v31 = run_debug_trap();
if ( debugging_mode && v31 )
return 0LL;
v35 = *(_DWORD *)a1;
if ( *(_QWORD *)(a1 + 8) )
v10 = *(_DWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 8) + 8LL) + 8LL) & 2;
else
v10 = 0;
v37 = v10;
last_command_subst_pid = -1;
v38 = last_asynchronous_pid;
v33 = 0;
v11 = a2 != -1 || a3 != -1 || a4;
v34 = v11;
if ( v11
&& a2 == -1
&& a3 == -1
&& *(_QWORD *)(a1 + 8)
&& *(_QWORD *)(*(_QWORD *)(a1 + 8) + 8LL)
&& **(_QWORD **)(*(_QWORD *)(a1 + 8) + 8LL)
&& ***(_BYTE ***)(*(_QWORD *)(a1 + 8) + 8LL) == 37 )
{
v34 = 0;
}
if ( v34 )
{
maybe_make_export_env();
v39 = a4 != 0;
v12 = the_printed_command_except_trap;
v13 = strlen(the_printed_command_except_trap);
v14 = (char *)sh_xmalloc(v13 + 1, "execute_cmd.c", 4443LL);
v48 = strcpy(v14, v12);
if ( (unsigned int)make_child(v48, a4 != 0) )
{
if ( a3 != -1 )
v31 = last_command_exit_value;
close_pipes(a2, a3);
v44 = 0LL;
return v31;
}
v33 = 1;
v35 |= 0x40u;
subshell_environment = 264;
if ( a2 != -1 || a3 != -1 )
subshell_environment |= 0x10u;
if ( a4 )
subshell_environment |= 1u;
if ( a5 )
close_fd_bitmap(a5);
stdin_redir |= a2 != -1;
do_piping(a2, a3);
a3 = -1;
a2 = -1;
coproc_closeall();
last_asynchronous_pid = v38;
if ( a4 )
++subshell_level;
if ( v48 )
sh_xfree(v48, "execute_cmd.c", 4477LL);
}
if ( terminating_signal )
termsig_handler(terminating_signal);
if ( interrupt_state )
throw_to_top_level();
if ( (v35 & 0x20) != 0 )
{
word_list = (long ***)copy_word_list(*(_QWORD *)(a1 + 8));
}
else
{
current_fds_to_close = (long)a5;
fix_assignment_words(*(long **)(a1 + 8));
fix_arrayref_words(*(_QWORD **)(a1 + 8));
if ( (v35 & 8) != 0 )
++comsub_ignore_return;
word_list = (long ***)expand_words(*(_QWORD *)(a1 + 8));
if ( (v35 & 8) != 0 )
--comsub_ignore_return;
current_fds_to_close = 0LL;
}
if ( !word_list )
{
this_command_name = 0LL;
if ( v33 )
v15 = 0;
else
v15 = a4;
v31 = execute_null_command(*(long **)(a1 + 16), a2, a3, v15);
if ( v33 )
sh_exit(v31);
bind_lastarg(0LL);
set_pipestatus_from_exit(v31);
return v31;
}
v49 = 0LL;
begin_unwind_frame("simple-command");
if ( echo_command_at_execute && (v35 & 0x800) == 0 )
xtrace_print_word_list(word_list, 1LL);
special_builtin = 0LL;
function = 0LL;
if ( (v35 & 0x10) == 0 )
{
if ( posixly_correct )
{
special_builtin = (long ( *)(_QWORD))find_special_builtin(*word_list[1]);
if ( special_builtin )
v32 = 1;
}
if ( !special_builtin )
function = (_QWORD *)find_function(*word_list[1]);
}
if ( posixly_correct && tempenv_assign_error )
{
last_command_exit_value = 1;
if ( !interactive_shell && v32 )
jump_to_top_level(1LL);
if ( !interactive_shell )
jump_to_top_level(2LL);
jump_to_top_level(2LL);
}
tempenv_assign_error = 0;
v29 = -1;
if ( !special_builtin && !function )
{
for ( special_builtin = (long ( *)(_QWORD))find_shell_builtin(*word_list[1]);
(char *)special_builtin == (char *)&command_builtin;
special_builtin = (long ( *)(_QWORD))find_shell_builtin(*word_list[1]) )
{
v50 = (long *)word_list;
v30 = 0;
word_list = check_command_builtin(word_list, &v30);
if ( v30 <= 0 )
break;
for ( i = v50; word_list != (long ***)*i; i = (long *)*i )
;
*i = 0LL;
dispose_words(v50);
v35 |= 0x810u;
if ( v30 == 2 )
v35 |= 0x4000u;
}
if ( (v35 & 0x800) != 0 )
{
v29 = executing_command_builtin;
unwind_protect_mem(&executing_command_builtin, 4LL);
executing_command_builtin |= 1u;
}
special_builtin = 0LL;
}
add_unwind_protect(&dispose_words, word_list);
if ( terminating_signal )
termsig_handler(terminating_signal);
if ( interrupt_state )
throw_to_top_level();
for ( j = word_list; *j; j = (long ***)*j )
;
v49 = (const char *)*j[1];
if ( *(_BYTE *)*word_list[1] == 37 && !v33 )
{
if ( a4 )
v16 = "bg";
else
v16 = "fg";
this_command_name = (long)v16;
last_shell_builtin = this_shell_builtin;
this_shell_builtin = (long ( *)(_QWORD))builtin_address(v16);
v31 = this_shell_builtin(word_list);
goto LABEL_199;
}
if ( job_control )
{
if ( !v33 && !a4 && !v37 && !*word_list )
{
if ( *(_BYTE *)*word_list[1] )
{
if ( !*(_QWORD *)(a1 + 16) && a2 == -1 && a3 == -1 )
{
s1 = (char *)get_string_value("auto_resume");
if ( s1 )
{
v36 = 24;
if ( *s1 == 101 && !strcmp(s1, "exact") )
v36 |= 4u;
else
v36 |= *s1 == 115 && !strcmp(s1, "substring") ? 2u : 1u;
job_by_name = get_job_by_name(*word_list[1], v36);
if ( job_by_name != -1 )
{
run_unwind_frame("simple-command");
this_command_name = (long)"fg";
last_shell_builtin = this_shell_builtin;
this_shell_builtin = (long ( *)(_QWORD))builtin_address("fg");
started = start_job(job_by_name, 1LL);
if ( (started & 0x80000000) != 0 )
return 1LL;
else
return started;
}
}
}
}
}
}
while ( 1 )
{
this_command_name = (long)*word_list[1];
if ( terminating_signal )
termsig_handler(terminating_signal);
if ( interrupt_state )
throw_to_top_level();
if ( !function && !special_builtin )
special_builtin = (long ( *)(_QWORD))find_shell_builtin(this_command_name);
last_shell_builtin = this_shell_builtin;
this_shell_builtin = special_builtin;
if ( special_builtin || function )
break;
LABEL_181:
if ( !autocd || !interactive || !word_list[1] || !(unsigned int)is_dirname((long)*word_list[1]) )
goto LABEL_186;
word = make_word("--");
word_list = (long ***)make_word_list(word, word_list);
v19 = make_word("cd");
word_list = (long ***)make_word_list(v19, word_list);
xtrace_print_word_list(word_list, 0LL);
function = (_QWORD *)find_function("cd");
}
if ( special_builtin )
{
v30 = executing_builtin;
unwind_protect_mem(&executing_builtin, 4LL);
if ( v29 == -1 )
{
v29 = executing_command_builtin;
unwind_protect_mem(&executing_command_builtin, 4LL);
}
}
if ( v33 )
{
reset_signal_handlers();
HIWORD(v17) = HIWORD(subshell_environment);
LOBYTE(v17) = subshell_environment | 0x80;
BYTE1(v17) = BYTE1(subshell_environment) & 0xFE;
subshell_environment = v17;
if ( a4 )
{
if ( (v35 & 0x400) != 0 && a2 == -1 && !(unsigned int)stdin_redirects(*(_QWORD *)(a1 + 16)) )
async_redirect_stdin();
setup_async_signals();
}
if ( !a4 )
++subshell_level;
execute_subshell_builtin_or_function(
word_list,
*(_QWORD *)(a1 + 16),
special_builtin,
function,
a2,
a3,
a4,
a5,
v35);
--subshell_level;
goto LABEL_181;
}
v31 = execute_builtin_or_function(word_list, special_builtin, function, *(_QWORD *)(a1 + 16), a5, v35);
if ( !special_builtin )
{
if ( v31 == 258 )
{
v31 = 2;
}
else if ( (int)v31 > 256 )
{
v31 = builtin_status(v31);
}
goto LABEL_180;
}
if ( (int)v31 <= 256 )
goto LABEL_172;
if ( (int)v31 <= 261 )
{
if ( (int)v31 >= 259 && posixly_correct && v32 && !interactive_shell )
{
last_command_exit_value = 1;
jump_to_top_level(4LL);
goto LABEL_169;
}
LABEL_170:
v31 = builtin_status(v31);
if ( v32 )
special_builtin_failed = 1;
LABEL_172:
if ( posixly_correct && v32 && temporary_env )
merge_temporary_env();
LABEL_180:
set_pipestatus_from_exit(v31);
goto LABEL_199;
}
if ( v31 != 262 )
goto LABEL_170;
LABEL_169:
executing_builtin = v30;
executing_command_builtin = v29;
special_builtin = 0LL;
a3 = -1;
a2 = -1;
LABEL_186:
if ( !v44 )
{
if ( the_printed_command_except_trap )
v20 = the_printed_command_except_trap;
else
v20 = &src;
if ( the_printed_command_except_trap )
v21 = the_printed_command_except_trap;
else
v21 = &src;
v22 = strlen(v21);
v23 = (char *)sh_xmalloc(v22 + 1, "execute_cmd.c", 4802LL);
v44 = strcpy(v23, v20);
}
if ( !v33 && (v35 & 0x40) != 0 && (int)fifos_pending() > 0 )
v35 &= ~0x40u;
v31 = execute_disk_command((long)word_list, *(_QWORD *)(a1 + 16), v44, a2, a3, a4, a5, v35);
LABEL_199:
bind_lastarg(v49);
if ( v44 )
sh_xfree(v44, "execute_cmd.c", 4817LL);
dispose_words(word_list);
if ( special_builtin )
{
executing_builtin = v30;
executing_command_builtin = v29;
}
discard_unwind_frame("simple-command");
this_command_name = 0LL;
return v31;
}
|
static void write_utmp(
char *user,
char *id,
int pid,
int type,
char *line,
char *oldline)
{
struct utmp utmp;
struct utmp tmp;
struct utmp *utmptr;
struct timeval tv;
if (access(
"/var/run/utmp"
,
2
) < 0)
return;
memset(&utmp, 0, sizeof(utmp));
utmp.ut_type = type;
utmp.ut_pid = pid;
strncpy(utmp.ut_id, id, sizeof(utmp.ut_id));
gettimeofday(&tv,
((void *)0)
);
utmp.ut_tv.tv_sec = tv.tv_sec;
utmp.ut_tv.tv_usec = tv.tv_usec;
strncpy(utmp.ut_user, user,
32
);
if (line) strncpy(utmp.ut_line, line,
32
);
if (type ==
8
) {
setutent();
tmp = utmp;
if ((utmptr = getutid(&tmp)) !=
((void *)0)
) {
strncpy(utmp.ut_line, utmptr->ut_line,
32
);
if (oldline)
strncpy(oldline, utmptr->ut_line,
32
);
}
}
setutent();
pututline(&utmp);
endutent();
}
| void write_utmp(char *param_1,char *param_2,undefined4 param_3,int param_4,char *param_5,
char *param_6)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined8 *puVar4;
long in_FS_OFFSET;
byte bVar5;
timeval local_328;
undefined8 local_318;
char local_310 [32];
char local_2f0 [4];
char local_2ec [340];
undefined8 local_198 [49];
long local_10;
bVar5 = 0;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
iVar1 = access("/var/run/utmp",2);
if (-1 < iVar1) {
memset(&local_318,0,0x180);
local_318._0_2_ = (undefined2)param_4;
local_318._4_4_ = param_3;
strncpy(local_2f0,param_2,4);
gettimeofday(&local_328,(__timezone_ptr_t)0x0);
strncpy(local_2ec,param_1,0x20);
if (param_5 != (char *)0x0) {
strncpy(local_310,param_5,0x20);
}
if (param_4 == 8) {
setutent();
puVar3 = &local_318;
puVar4 = local_198;
for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar4 = *puVar3;
puVar3 = puVar3 + (ulong)bVar5 * -2 + 1;
puVar4 = puVar4 + (ulong)bVar5 * -2 + 1;
}
lVar2 = getutid(local_198);
if (lVar2 != 0) {
strncpy(local_310,(char *)(lVar2 + 8),0x20);
if (param_6 != (char *)0x0) {
strncpy(param_6,(char *)(lVar2 + 8),0x20);
}
}
}
setutent();
pututline(&local_318);
endutent();
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static void
userauth_banner(struct ssh *ssh)
{
char *banner =
((void *)0)
;
if (options.banner ==
((void *)0)
)
return;
if ((banner = (use_privsep ? mm_auth2_read_banner() : auth2_read_banner())) ==
((void *)0)
)
goto done;
userauth_send_banner(ssh, banner);
done:
free(banner);
}
| void userauth_banner(long a1)
{
_BYTE *banner;
void *ptr;
if ( *(_QWORD *)&options[1916] )
{
if ( use_privsep )
banner = (_BYTE *)mm_auth2_read_banner();
else
banner = auth2_read_banner();
ptr = banner;
if ( banner )
userauth_send_banner(a1, (long)banner);
free(ptr);
}
}
|
_Bool
*changed);
static void fail_exit (int status)
{
if (gr_locked) {
if (gr_unlock () == 0) {
fprintf (
stderr
, gettext ("%s: failed to unlock %s\n"), Prog, gr_dbname ());
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
3
, "failed to unlock %s", gr_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
}
}
if (sgr_locked) {
if (sgr_unlock () == 0) {
fprintf (
stderr
, gettext ("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
3
, "failed to unlock %s", sgr_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
}
}
closelog ();
exit (status);
}
| void fail_exit(unsigned long a0) {
void* v0;
void* v1;
char *v2;
char *v3;
unsigned long v4;
unsigned long v5;
unsigned long v7;
unsigned long v8;
unsigned long long v9;
unsigned long long v10;
v5 = v7;
v4 = v8;
if (gr_locked && !gr_unlock()) {
v9 = gr_dbname();
fprintf(stderr, gettext("%s: failed to unlock %s\n"));
v2 = setlocale(0x6, NULL);
v0 = 0;
if (v2)
v0 = strdup(v2);
if (v0)
setlocale(0x6, "C");
gr_dbname();
syslog(0x3, "failed to unlock %s");
if (v0) {
setlocale(0x6, v0);
free(v0);
}
}
if (sgr_locked && !sgr_unlock()) {
v10 = sgr_dbname();
fprintf(stderr, gettext("%s: failed to unlock %s\n"));
v3 = setlocale(0x6, NULL);
v1 = 0;
if (v3)
v1 = strdup(v3);
if (v1)
setlocale(0x6, "C");
sgr_dbname();
syslog(0x3, "failed to unlock %s");
if (v1) {
setlocale(0x6, v1);
free(v1);
}
}
closelog();
exit(a0);
}
|
void
seedrand32 ()
{
unsigned int iv;
iv = genseed ();
sbrand32 (iv);
}
| long long seedrand32() {
unsigned int v0;
v0 = genseed();
return sbrand32(v0);
}
|
static ARITH_FOR_COM *
copy_arith_for_command (com)
ARITH_FOR_COM *com;
{
ARITH_FOR_COM *new_arith_for;
new_arith_for = (ARITH_FOR_COM *)sh_xmalloc((sizeof (ARITH_FOR_COM)), "copy_cmd.c", 201);
new_arith_for->flags = com->flags;
new_arith_for->line = com->line;
new_arith_for->init = copy_word_list (com->init);
new_arith_for->test = copy_word_list (com->test);
new_arith_for->step = copy_word_list (com->step);
new_arith_for->action = copy_command (com->action);
return (new_arith_for);
}
| int copy_arith_for_command(struct_0 *a0) {
struct_0 *v0;
v0 = sh_xmalloc(0x28, "copy_cmd.c", 0xc9);
v0->field_0 = a0->field_0;
v0->field_4 = a0->field_4;
v0->field_8 = copy_word_list(a0->field_8, "copy_cmd.c", a0->field_4);
v0->field_10 = copy_word_list(a0->field_10, "copy_cmd.c", v0);
v0->field_18 = copy_word_list(a0->field_18, "copy_cmd.c", v0);
v0->field_20 = copy_command(a0->field_20);
return v0;
}
|
int list(struct utmp *p, time_t t, int what)
{
time_t secs, tmp;
char logintime[32];
char logouttime[32];
char length[32];
char final[512];
char utline[
32
+1];
char domain[256];
char *s, **walk;
int mins, hours, days;
int r, len;
utline[0] = 0;
strncat(utline, p->ut_line,
32
);
if (strncmp(utline, "ftp", 3) == 0 &&
((*__ctype_b_loc ())[(int) ((
utline[3]
))] & (unsigned short int) _ISdigit)
)
utline[3] = 0;
if (strncmp(utline, "uucp", 4) == 0 &&
((*__ctype_b_loc ())[(int) ((
utline[4]
))] & (unsigned short int) _ISdigit)
)
utline[4] = 0;
if (show) {
for (walk = show; *walk; walk++) {
if (strncmp(p->
ut_user
, *walk,
32
) == 0 ||
strcmp(utline, *walk) == 0 ||
(strncmp(utline, "tty", 3) == 0 &&
strcmp(utline + 3, *walk) == 0)) break;
}
if (*walk ==
((void *)0)
) return 0;
}
tmp = (time_t)p->
ut_tv.tv_sec
;
strncpy(logintime, ctime(&tmp), sizeof(logintime));
logintime[sizeof(logintime)-1] = 0;
if (fulltime)
sprintf(logouttime, "- %s", ctime(&t));
else {
logintime[16] = 0;
sprintf(logouttime, "- %s", ctime(&t) + 11);
logouttime[7] = 0;
}
secs = t - p->
ut_tv.tv_sec
;
mins = (secs / 60) % 60;
hours = (secs / 3600) % 24;
days = secs / 86400;
if (days)
sprintf(length, "(%d+%02d:%02d)", days, hours, mins);
else
sprintf(length, " (%02d:%02d)", hours, mins);
switch(what) {
case 1:
sprintf(logouttime, "- crash");
break;
case 2:
sprintf(logouttime, "- down ");
break;
case 4:
length[0] = 0;
if (fulltime)
sprintf(logouttime, " still logged in");
else {
sprintf(logouttime, " still");
sprintf(length, "logged in");
}
break;
case 6:
length[0] = 0;
if (fulltime)
sprintf(logouttime, " gone - no logout");
else {
sprintf(logouttime, " gone");
sprintf(length, "- no logout");
}
break;
case 5:
break;
case 7:
logouttime[0] = 0;
length[0] = 0;
break;
case 3:
break;
}
r = -1;
if (usedns || useip)
r = dns_lookup(domain, sizeof(domain), useip, p->ut_addr_v6);
if (r < 0) {
len =
256
;
if (len >= (int)sizeof(domain)) len = sizeof(domain) - 1;
domain[0] = 0;
strncat(domain, p->ut_host, len);
}
if (showhost) {
if (!altlist) {
if (allow_long_username)
{
len = snprintf(final, sizeof(final),
oldfmt ? "%-" "8" "." "8" "s %-12.12s "
"%-16.16s %-16.16s %-7.7s %-12.12s\n"
: "%-" "32" "." "32" "s %-12.12s "
"%-16.16s %-16.16s %-7.7s %-12.12s\n",
p->
ut_user
, utline,
domain, logintime, logouttime, length);
}
else
{
len = snprintf(final, sizeof(final),
fulltime ?
"%-8.*s %-12.12s %-16.*s %-24.24s %-26.26s %-12.12s\n" :
"%-8.*s %-12.12s %-16.*s %-16.16s %-7.7s %-12.12s\n",
name_len, p->
ut_user
, utline,
domain_len, domain, logintime, logouttime, length);
}
} else {
if (allow_long_username)
{
len = snprintf(final, sizeof(final),
oldfmt ? "%-" "8" "." "8" "s %-12.12s "
"%-16.16s %-7.7s %-16.16s %s\n"
: "%-" "32" "." "32" "s %-12.12s "
"%-16.16s %-7.7s %-16.16s %s\n",
p->
ut_user
, utline,
logintime, logouttime, length, domain);
}
else
{
len = snprintf(final, sizeof(final),
fulltime ?
"%-8.*s %-12.12s %-24.24s %-26.26s %-12.12s %s\n" :
"%-8.*s %-12.12s %-16.16s %-7.7s %-12.12s %s\n",
name_len, p->
ut_user
, utline,
logintime, logouttime, length, domain);
}
}
} else
if (allow_long_username)
{
len = snprintf(final, sizeof(final),
oldfmt ? "%-" "8" "." "8" "s %-12.12s "
"%-16.16s %-7.7s %-12.12s\n"
: "%-" "32" "." "32" "s %-12.12s "
"%-16.16s %-7.7s %-12.12s\n",
p->
ut_user
, utline,
logintime, logouttime, length);
}
else
{
len = snprintf(final, sizeof(final),
fulltime ?
"%-8.*s %-12.12s %-24.24s %-26.26s %-12.12s\n" :
"%-8.*s %-12.12s %-16.16s %-7.7s %-12.12s\n",
name_len, p->
ut_user
, utline,
logintime, logouttime, length);
}
for (s = final; *s; s++) {
if (*s == '\n' || (*s >= 32 && (unsigned char)*s <= 126))
putchar(*s);
else
putchar('*');
}
if (len < 0 || (size_t)len >= sizeof(final))
putchar('\n');
recsdone++;
if (maxrecs && recsdone >= maxrecs)
return 1;
return 0;
}
| int list(struct_0 *a0, unsigned long a1, unsigned long a2) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned long v4;
unsigned long v5;
char v6;
unsigned int v7;
unsigned int v8;
unsigned int v9;
unsigned int v10;
unsigned int v11;
unsigned long v12;
char *v13;
unsigned long long *v14;
unsigned long v15;
char v16;
char v17;
char v18;
char v19;
char v20;
char v21;
char v22;
char v23;
char v24;
char v25;
char v26;
unsigned int v29;
unsigned int v30;
unsigned long long v31;
v22 = 0;
strncat(&v22, &a0->padding_0[8], 0x20);
if (!strncmp(&v22, "ftp", 0x3)) {
v29 = *((*(__ctype_b_loc()) + v23 * 2)) & 0x800;
if (v29)
v23 = 0;
}
if (!strncmp(&v22, "uucp", 0x4)) {
*(&v29) = *((*(__ctype_b_loc()) + v24 * 2));
v30 = v29 & 0x800;
if (v30)
v24 = 0;
}
if (show) {
v14 = show;
while (true) {
if (!*(v14))
break;
if (!strncmp(&a0->padding_0[44], *(v14), 0x20))
break;
if (!strcmp(&v22, *(v14)))
break;
if (!strncmp(&v22, "tty", 0x3) && !strcmp(&v23, *(v14)))
break;
v14 += 1;
}
if (!*(v14)) {
v31 = 0;
goto LABEL_401183;
}
}
v12 = a0->field_154;
strncpy(&v16, ctime(&v12), 0x20);
v18 = 0;
if (!fulltime) {
v17 = 0;
sprintf(&v19, "- %s", (ctime(&v6) + 11));
v20 = 0;
} else {
sprintf(&v19, "- %s", ctime(&v6));
}
v15 = a1 - a0->field_154;
v9 = ((v15 * 9838263505978427529 >> 64) + v15 >> 5) - (v15 >> 63) - ((((((v15 * 9838263505978427529 >> 64) + v15 >> 5) - (v15 >> 63)) * 9838263505978427529 >> 64) + ((v15 * 9838263505978427529 >> 64) + v15 >> 5) - (v15 >> 63) >> 5) - (((v15 * 9838263505978427529 >> 64) + v15 >> 5) - (v15 >> 63) >> 63)) * 60;
v10 = (v15 * 5247073869855161349 >> 64 >> 10) - (v15 >> 63) - ((((v15 * 5247073869855161349 >> 64 >> 10) - (v15 >> 63)) * 3074457345618258603 >> 64 >> 2) - ((v15 * 5247073869855161349 >> 64 >> 10) - (v15 >> 63) >> 63)) * 24;
v11 = (v15 * 1749024623285053783 >> 64 >> 13) - (v15 >> 63);
if (!v11)
sprintf(&v21, " (%02d:%02d)", v10, v9);
else
sprintf(&v21, "(%d+%02d:%02d)", v11, v10, v9);
switch (a2) {
case 1:
sprintf(&v19, "- crash");
break;
case 2:
sprintf(&v19, "- down ");
break;
case 4:
v21 = 0;
if (fulltime) {
sprintf(&v19, " still logged in");
break;
} else {
sprintf(&v19, " still");
sprintf(&v21, "logged in");
break;
}
case 6:
v21 = 0;
if (fulltime) {
sprintf(&v19, " gone - no logout");
break;
} else {
sprintf(&v19, " gone");
sprintf(&v21, "- no logout");
break;
}
case 7:
v19 = 0;
v21 = 0;
break;
}
v7 = -1;
if (!usedns && !useip)
goto LABEL_400d5e;
v7 = dns_lookup(&v25, 0x100, useip, &a0[1].padding_0[4]);
LABEL_400d5e:
if (v7 < 0) {
v8 = 0x100;
if (v8 > 255)
v8 = 255;
v25 = 0;
strncat(&v25, &a0->padding_0[76], v8);
}
if (showhost) {
if (altlist) {
if (!*(&allow_long_username)) {
if (fulltime)
v31 = "%-8.*s %-12.12s %-24.24s %-26.26s %-12.12s %s\n";
else
v31 = "%-8.*s %-12.12s %-16.16s %-7.7s %-12.12s %s\n";
v5 = &v25;
v4 = &v21;
v3 = &v19;
v2 = &v16;
v8 = snprintf(&v26, 0x200, v31);
} else {
if (*(&oldfmt))
v31 = "%-8.8s %-12.12s %-16.16s %-7.7s %-16.16s %s\n";
else
v31 = "%-32.32s %-12.12s %-16.16s %-7.7s %-16.16s %s\n";
v4 = &v25;
v3 = &v21;
v2 = &v19;
v8 = snprintf(&v26, 0x200, v31);
}
} else {
if (*(&allow_long_username)) {
if (*(&oldfmt))
v31 = "%-8.8s %-12.12s %-16.16s %-16.16s %-7.7s %-12.12s\n";
else
v31 = "%-32.32s %-12.12s %-16.16s %-16.16s %-7.7s %-12.12s\n";
v4 = &v21;
v3 = &v19;
v2 = &v16;
v8 = snprintf(&v26, 0x200, v31);
} else {
if (fulltime)
v31 = "%-8.*s %-12.12s %-16.*s %-24.24s %-26.26s %-12.12s\n";
else
v31 = "%-8.*s %-12.12s %-16.*s %-16.16s %-7.7s %-12.12s\n";
v4 = &v21;
v3 = &v19;
v2 = &v16;
v1 = &v25;
v0 = domain_len;
v8 = snprintf(&v26, 0x200, v31);
}
}
} else {
if (!*(&allow_long_username)) {
if (fulltime)
v31 = "%-8.*s %-12.12s %-24.24s %-26.26s %-12.12s\n";
else
v31 = "%-8.*s %-12.12s %-16.16s %-7.7s %-12.12s\n";
v4 = &v21;
v3 = &v19;
v2 = &v16;
v8 = snprintf(&v26, 0x200, v31);
} else {
if (*(&oldfmt))
v31 = "%-8.8s %-12.12s %-16.16s %-7.7s %-12.12s\n";
else
v31 = "%-32.32s %-12.12s %-16.16s %-7.7s %-12.12s\n";
v5 = &v21;
v4 = &v19;
v8 = snprintf(&v26, 0x200, v31);
}
}
v13 = &v26;
while (true) {
if (!*(v13))
break;
if (*(v13) == 10) {
LABEL_401102:
putchar(*(v13));
goto LABEL_401120;
} else if (*(v13) <= 31) {
LABEL_401116:
putchar(0x2a);
LABEL_401120:
v13 += 1;
} else {
if (!(*(v13) <= 126))
goto LABEL_401116;
goto LABEL_401102;
}
}
if (v8 >= 0 && v8 <= 511)
goto LABEL_40114e;
putchar(0xa);
LABEL_40114e:
recsdone = recsdone + 1;
if (maxrecs && recsdone >= maxrecs) {
v31 = 1;
goto LABEL_401183;
}
v31 = 0;
LABEL_401183:
return v31;
}
|
static void
print_context_label (char const *mark,
struct file_data *inf,
char const *name,
char const *label)
{
set_color_context (HEADER_CONTEXT);
if (label)
fprintf (outfile, "%s %s", mark, label);
else
{
char buf[(((((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) + 32) >= ((((((sizeof (time_t) * 8) - (! ((__typeof__ (time_t)) 0 < (__typeof__ (time_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (time_t)) 0 < (__typeof__ (time_t)) -1))) + 11) ? ((((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) + 32) : ((((((sizeof (time_t) * 8) - (! ((__typeof__ (time_t)) 0 < (__typeof__ (time_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (time_t)) 0 < (__typeof__ (time_t)) -1))) + 11))
];
struct tm const *tm = localtime (&inf->stat.
st_mtim.tv_sec
);
int nsec = get_stat_mtime_ns (&inf->stat);
if (! (tm && nstrftime (buf, sizeof buf, time_format, tm, 0, nsec)))
{
_Static_assert (((time_t) 1.5 == 1), "verify (" "TYPE_IS_INTEGER (time_t)" ")");
if (
(-0x7fffffffffffffffL - 1L)
<= ((time_t) ~ ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))))
&& ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))) <= 0x7fffffffffffffffL)
{
long int sec = inf->stat.
st_mtim.tv_sec
;
sprintf (buf, "%ld.%.9d", sec, nsec);
}
else if (((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))) <=
(9223372036854775807L)
)
{
intmax_t sec = inf->stat.
st_mtim.tv_sec
;
sprintf (buf, "%"
"l" "d"
".%.9d", sec, nsec);
}
else
{
uintmax_t sec = inf->stat.
st_mtim.tv_sec
;
sprintf (buf, "%"
"l" "u"
".%.9d", sec, nsec);
}
}
fprintf (outfile, "%s %s\t%s", mark, name, buf);
}
set_color_context (RESET_CONTEXT);
putc_unlocked ('\n',outfile);
}
| void print_context_label(unsigned long a0, struct_0 *a1, unsigned long a2, unsigned long a3) {
unsigned int v0;
unsigned long long v1;
unsigned long v2;
char v3;
char v4;
unsigned long long *v7;
unsigned long long v8;
set_color_context(0x0);
if (a3) {
fprintf(*(&outfile), "%s %s", a0, a3);
} else {
v1 = localtime(&a1->field_68);
v0 = get_stat_mtime_ns(&a1->padding_0[16]);
if (!v1 || !nstrftime(&v3, 0x2b, time_format, v1, 0x0, v0)) {
v2 = a1->field_68;
sprintf(&v3, "%ld.%.9d", v2, v0);
}
fprintf(*(&outfile), "%s %s\t%s", a0, a2, &v3);
}
set_color_context(0x3);
putc_unlocked(0xa, *(&outfile));
v8 = *(&v4) ^ v7[5];
return;
}
|
static int set_othername_utf8(int type, void *crt)
{
int ret = 0, i;
const char *oid;
if (batch) {
if (!cfg.other_name_utf8)
return 0;
for (i = 0; cfg.other_name_utf8[i] !=
((void *)0)
; i += 2) {
oid = cfg.other_name_utf8[i];
if (cfg.other_name_utf8[i + 1] ==
((void *)0)
) {
fprintf(
stderr
,
"other_name_utf8: %s does not have an argument.\n",
cfg.other_name_utf8[i]);
exit(1);
}
if (type == 1)
ret =
gnutls_x509_crt_set_subject_alt_othername
(crt, oid,
cfg.other_name_utf8[i + 1], strlen(cfg.other_name_utf8[i + 1]),
1|(1<<2));
else
ret =
gnutls_x509_crq_set_subject_alt_othername
(crt, oid,
cfg.other_name_utf8[i + 1], strlen(cfg.other_name_utf8[i + 1]),
1|(1<<2));
if (ret < 0)
break;
}
}
if (ret < 0) {
fprintf(
stderr
, "set_subject_alt_othername: %s\n",
gnutls_strerror(ret));
exit(1);
}
return ret;
}
| void set_othername_utf8(unsigned long a0, unsigned long long a1) {
unsigned int v0;
unsigned int v1;
unsigned long long v2;
void* v4;
unsigned long long v5;
v0 = 0;
if (*(got.batch)) {
if (!*((got.cfg + 360))) {
v4 = 0;
} else {
for (v1 = 0; *((*((got.cfg + 360)) + (v1 << 3))); v1 += 2) {
v2 = *((*((got.cfg + 360)) + v1 * 8));
if (!*((*((got.cfg + 360)) + (v1 + 1 << 3)))) {
fprintf(*(*(&got.stderr)), "other_name_utf8: %s does not have an argument.\n", *((*((got.cfg + 360)) + v1 * 8)));
exit(0x1);
}
if (a0 == 1)
v0 = gnutls_x509_crt_set_subject_alt_othername(a1, v2, *((*((got.cfg + 360)) + (v1 + 1) * 8)), strlen(*((*((got.cfg + 360)) + (v1 + 1) * 8))), 0x5);
else
v0 = gnutls_x509_crq_set_subject_alt_othername(a1, v2, *((*((got.cfg + 360)) + (v1 + 1) * 8)), strlen(*((*((got.cfg + 360)) + (v1 + 1) * 8))), 0x5);
if (v0 < 0)
break;
}
}
}
if (!*(got.batch) || *((got.cfg + 360))) {
if (v0 < 0) {
fprintf(*(*(&got.stderr)), "set_subject_alt_othername: %s\n", gnutls_strerror(v0));
exit(0x1);
}
v5 = v0;
}
if (v0 >= 0 || !*((got.cfg + 360)) && *(got.batch))
return;
}
|
static void
out_html(char *c)
{
if (!c)
return;
if (no_newline_output) {
int i = 0;
no_newline_output = 1;
while (c[i]) {
if (!no_newline_output)
c[i - 1] = c[i];
if (c[i] == '\n')
no_newline_output = 1;
i++;
}
if (!no_newline_output)
c[i - 1] = 0;
}
if (scaninbuff) {
while (*c) {
if (buffpos >= buffmax) {
char *h;
h = realloc(buffer, buffmax * 2);
if (!h)
return;
buffer = h;
buffmax *= 2;
}
buffer[buffpos++] = *c++;
}
} else if (output_possible) {
while (*c) {
outbuffer[obp++] = *c;
if (*c == '\n' || obp > 10000) {
outbuffer[obp] = '\0';
add_links(outbuffer);
obp = 0;
}
c++;
}
}
}
| void out_html(unsigned long a0) {
char *v0;
int tmp_12;
int tmp_14;
unsigned int v1;
unsigned long long v2;
struct_0 *v4;
unsigned long long v5;
unsigned long long v6;
v0 = a0;
if (v0) {
if (no_newline_output) {
v1 = 0;
for (no_newline_output = 1; v0[v1]; v1 += 1) {
if (!no_newline_output)
v0[1 + v1] = v0[v1];
if (v0[v1] == 10)
no_newline_output = 1;
}
if (!no_newline_output)
v0[1 + v1] = 0;
}
if (!scaninbuff) {
v4 = output_possible;
if (output_possible) {
while (true) {
v6 = *(v0);
if (!*(v0))
break;
tmp_12 = obp;
obp = obp + 1;
*(tmp_12 + &outbuffer) = *(v0);
if (*(v0) != 10 && obp <= 10000)
goto LABEL_401254;
*(obp + &outbuffer) = 0;
add_links(&outbuffer);
obp = 0;
LABEL_401254:
v0 += 1;
}
}
} else {
while (true) {
v5 = *(v0);
if (!*(v0))
break;
if (buffpos >= buffmax) {
v5 = realloc(buffer, buffmax * 2);
v2 = v5;
if (!v2)
break;
buffer = v2;
buffmax = buffmax * 2;
}
tmp_14 = v0;
v0 += 1;
buffpos = buffpos + 1;
*(&v5) = *(tmp_14);
*((buffpos + buffer)) = v5;
}
}
}
return;
}
|
static void usage(void)
{
fprintf(
stderr
,
"Usage: ip xfrm XFRM-OBJECT { COMMAND | help }\n"
"where XFRM-OBJECT := state | policy | monitor\n");
exit(-1);
}
| void usage() {
fprintf(stderr, "Usage: ip xfrm XFRM-OBJECT { COMMAND | help }\nwhere XFRM-OBJECT := state | policy | monitor\n");
exit(0xffffffff);
}
|
void print_list(const char *priorities, int verbose)
{
size_t i;
int ret;
unsigned int idx;
const char *name;
const char *err;
unsigned char id[2];
gnutls_kx_algorithm_t kx;
gnutls_cipher_algorithm_t cipher;
gnutls_mac_algorithm_t mac;
gnutls_protocol_t version;
gnutls_priority_t pcache;
const unsigned int *list;
if (priorities !=
((void *)0)
) {
log_msg(
stdout
, "Cipher suites for %s\n", priorities);
ret = gnutls_priority_init(&pcache, priorities, &err);
if (ret < 0) {
if (ret == -50)
fprintf(
stderr
, "Syntax error at: %s\n", err);
else
fprintf(
stderr
, "Error in priorities: %s\n", gnutls_strerror(ret));
exit(1);
}
for (i = 0;; i++) {
ret =
gnutls_priority_get_cipher_suite_index(pcache,
i,
&idx);
if (ret == -56)
break;
if (ret == -21)
continue;
name =
gnutls_cipher_suite_info(idx, id,
((void *)0)
,
((void *)0)
,
((void *)0)
, &version);
if (name !=
((void *)0)
)
log_msg(
stdout
, "%-50s\t0x%02x, 0x%02x\t%s\n",
name, (unsigned char) id[0],
(unsigned char) id[1],
gnutls_protocol_get_name(version));
}
log_msg(
stdout
, "\n");
{
ret = gnutls_priority_protocol_list(pcache, &list);
log_msg(
stdout
, "Protocols: ");
if (ret == 0)
log_msg(
stdout
, "none\n");
for (i = 0; i < (unsigned) ret; i++) {
log_msg(
stdout
, "VERS-%s",
gnutls_protocol_get_name(list[i]));
if (i + 1 != (unsigned) ret)
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
{
ret = gnutls_priority_cipher_list(pcache, &list);
log_msg(
stdout
, "Ciphers: ");
if (ret == 0)
log_msg(
stdout
, "none\n");
for (i = 0; i < (unsigned) ret; i++) {
log_msg(
stdout
, "%s",
gnutls_cipher_get_name(list[i]));
if (i + 1 != (unsigned) ret)
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
{
ret = gnutls_priority_mac_list(pcache, &list);
log_msg(
stdout
, "MACs: ");
if (ret == 0)
log_msg(
stdout
, "none\n");
for (i = 0; i < (unsigned) ret; i++) {
log_msg(
stdout
, "%s",
gnutls_mac_get_name(list[i]));
if (i + 1 != (unsigned) ret)
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
{
ret = gnutls_priority_kx_list(pcache, &list);
log_msg(
stdout
, "Key Exchange Algorithms: ");
if (ret == 0)
log_msg(
stdout
, "none\n");
for (i = 0; i < (unsigned) ret; i++) {
log_msg(
stdout
, "%s",
gnutls_kx_get_name(list[i]));
if (i + 1 != (unsigned) ret)
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
{
ret =
gnutls_priority_group_list(pcache, &list);
log_msg(
stdout
, "Groups: ");
if (ret == 0)
log_msg(
stdout
, "none\n");
for (i = 0; i < (unsigned) ret; i++) {
log_msg(
stdout
, "GROUP-%s",
gnutls_group_get_name(list[i]));
if (i + 1 != (unsigned) ret)
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
{
ret = gnutls_priority_sign_list(pcache, &list);
log_msg(
stdout
, "PK-signatures: ");
if (ret == 0)
log_msg(
stdout
, "none\n");
for (i = 0; i < (unsigned) ret; i++) {
log_msg(
stdout
, "SIGN-%s",
gnutls_sign_get_name(list
[i]));
if (i + 1 != (unsigned) ret)
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
gnutls_priority_deinit(pcache);
return;
}
log_msg(
stdout
, "Cipher suites:\n");
for (i = 0; (name = gnutls_cipher_suite_info
(i, id, &kx, &cipher, &mac, &version)); i++) {
log_msg(
stdout
, "%-50s\t0x%02x, 0x%02x\t%s\n",
name,
(unsigned char) id[0], (unsigned char) id[1],
gnutls_protocol_get_name(version));
if (verbose)
log_msg
(
stdout
, "\tKey exchange: %s\n\tCipher: %s\n\tMAC: %s\n\n",
gnutls_kx_get_name(kx),
gnutls_cipher_get_name(cipher),
gnutls_mac_get_name(mac));
}
log_msg(
stdout
, "\n");
{
const gnutls_certificate_type_t *p =
gnutls_certificate_type_list();
log_msg(
stdout
, "Certificate types: ");
for (; *p; p++) {
log_msg(
stdout
, "CTYPE-%s",
gnutls_certificate_type_get_name(*p));
if (*(p + 1))
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
{
const gnutls_protocol_t *p = gnutls_protocol_list();
log_msg(
stdout
, "Protocols: ");
for (; *p; p++) {
log_msg(
stdout
, "VERS-%s", gnutls_protocol_get_name(*p));
if (*(p + 1))
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
{
const gnutls_cipher_algorithm_t *p = gnutls_cipher_list();
log_msg(
stdout
, "Ciphers: ");
for (; *p; p++) {
log_msg(
stdout
, "%s", gnutls_cipher_get_name(*p));
if (*(p + 1))
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
{
const gnutls_mac_algorithm_t *p = gnutls_mac_list();
log_msg(
stdout
, "MACs: ");
for (; *p; p++) {
log_msg(
stdout
, "%s", gnutls_mac_get_name(*p));
if (*(p + 1))
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
{
const gnutls_digest_algorithm_t *p = gnutls_digest_list();
log_msg(
stdout
, "Digests: ");
for (; *p; p++) {
log_msg(
stdout
, "%s", gnutls_digest_get_name(*p));
if (*(p + 1))
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
{
const gnutls_kx_algorithm_t *p = gnutls_kx_list();
log_msg(
stdout
, "Key exchange algorithms: ");
for (; *p; p++) {
log_msg(
stdout
, "%s", gnutls_kx_get_name(*p));
if (*(p + 1))
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
{
const gnutls_compression_method_t *p =
gnutls_compression_list();
log_msg(
stdout
, "Compression: ");
for (; *p; p++) {
log_msg(
stdout
, "COMP-%s", gnutls_compression_get_name(*p));
if (*(p + 1))
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
{
const gnutls_group_t *p = gnutls_group_list();
log_msg(
stdout
, "Groups: ");
for (; *p; p++) {
log_msg(
stdout
, "GROUP-%s", gnutls_group_get_name(*p));
if (*(p + 1))
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
{
const gnutls_pk_algorithm_t *p = gnutls_pk_list();
log_msg(
stdout
, "Public Key Systems: ");
for (; *p; p++) {
log_msg(
stdout
, "%s", gnutls_pk_algorithm_get_name(*p));
if (*(p + 1))
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
{
const gnutls_sign_algorithm_t *p = gnutls_sign_list();
log_msg(
stdout
, "PK-signatures: ");
for (; *p; p++) {
log_msg(
stdout
, "SIGN-%s",
gnutls_sign_get_name(*p));
if (*(p + 1))
log_msg(
stdout
, ", ");
else
log_msg(
stdout
, "\n");
}
}
}
| void print_list(long param_1,int param_2)
{
undefined8 uVar1;
undefined8 uVar2;
undefined8 uVar3;
long in_FS_OFFSET;
undefined4 local_ac;
undefined4 local_a8;
uint local_a4;
undefined4 local_a0;
undefined4 uStack156;
undefined4 local_98;
undefined4 uStack148;
undefined4 local_90;
undefined4 uStack140;
ulong local_88;
int *local_80;
int *local_78;
int *local_70;
int *local_68;
int *local_60;
int *local_58;
int *local_50;
int *local_48;
int *local_40;
int *local_38;
long local_30;
undefined local_22;
undefined local_21;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
if (param_1 == 0) {
log_msg(stdout,"Cipher suites:\n");
local_88 = 0;
while( true ) {
local_30 = gnutls_cipher_suite_info
(local_88,&local_22,&local_a0,&local_98,&local_90,&local_a8);
if (local_30 == 0) break;
uVar1 = gnutls_protocol_get_name(local_a8);
log_msg(stdout,"%-50s\t0x%02x, 0x%02x\t%s\n",local_30,local_22,local_21,uVar1);
if (param_2 != 0) {
uVar1 = gnutls_mac_get_name(local_90);
uVar2 = gnutls_cipher_get_name(local_98);
uVar3 = gnutls_kx_get_name(local_a0);
log_msg(stdout,"\tKey exchange: %s\n\tCipher: %s\n\tMAC: %s\n\n",uVar3,uVar2,uVar1);
}
local_88 = local_88 + 1;
}
log_msg(stdout,&DAT_00104a88);
local_80 = (int *)gnutls_certificate_type_list();
log_msg(stdout,"Certificate types: ");
for (; *local_80 != 0; local_80 = local_80 + 1) {
uVar1 = gnutls_certificate_type_get_name(*local_80);
log_msg(stdout,"CTYPE-%s",uVar1);
if (local_80[1] == 0) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
local_78 = (int *)gnutls_protocol_list();
log_msg(stdout,"Protocols: ");
for (; *local_78 != 0; local_78 = local_78 + 1) {
uVar1 = gnutls_protocol_get_name(*local_78);
log_msg(stdout,"VERS-%s",uVar1);
if (local_78[1] == 0) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
local_70 = (int *)gnutls_cipher_list();
log_msg(stdout,"Ciphers: ");
for (; *local_70 != 0; local_70 = local_70 + 1) {
uVar1 = gnutls_cipher_get_name(*local_70);
log_msg(stdout,&DAT_00104d7b,uVar1);
if (local_70[1] == 0) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
local_68 = (int *)gnutls_mac_list();
log_msg(stdout,"MACs: ");
for (; *local_68 != 0; local_68 = local_68 + 1) {
uVar1 = gnutls_mac_get_name(*local_68);
log_msg(stdout,&DAT_00104d7b,uVar1);
if (local_68[1] == 0) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
local_60 = (int *)gnutls_digest_list();
log_msg(stdout,"Digests: ");
for (; *local_60 != 0; local_60 = local_60 + 1) {
uVar1 = gnutls_digest_get_name(*local_60);
log_msg(stdout,&DAT_00104d7b,uVar1);
if (local_60[1] == 0) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
local_58 = (int *)gnutls_kx_list();
log_msg(stdout,"Key exchange algorithms: ");
for (; *local_58 != 0; local_58 = local_58 + 1) {
uVar1 = gnutls_kx_get_name(*local_58);
log_msg(stdout,&DAT_00104d7b,uVar1);
if (local_58[1] == 0) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
local_50 = (int *)gnutls_compression_list();
log_msg(stdout,"Compression: ");
for (; *local_50 != 0; local_50 = local_50 + 1) {
uVar1 = gnutls_compression_get_name(*local_50);
log_msg(stdout,"COMP-%s",uVar1);
if (local_50[1] == 0) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
local_48 = (int *)gnutls_group_list();
log_msg(stdout,"Groups: ");
for (; *local_48 != 0; local_48 = local_48 + 1) {
uVar1 = gnutls_group_get_name(*local_48);
log_msg(stdout,"GROUP-%s",uVar1);
if (local_48[1] == 0) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
local_40 = (int *)gnutls_pk_list();
log_msg(stdout,"Public Key Systems: ");
for (; *local_40 != 0; local_40 = local_40 + 1) {
uVar1 = gnutls_pk_algorithm_get_name(*local_40);
log_msg(stdout,&DAT_00104d7b,uVar1);
if (local_40[1] == 0) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
local_38 = (int *)gnutls_sign_list();
log_msg(stdout,"PK-signatures: ");
for (; *local_38 != 0; local_38 = local_38 + 1) {
uVar1 = gnutls_sign_get_name(*local_38);
log_msg(stdout,"SIGN-%s",uVar1);
if (local_38[1] == 0) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
}
else {
log_msg(stdout,"Cipher suites for %s\n",param_1);
local_a4 = gnutls_priority_init(&local_98,param_1,&local_a0);
if ((int)local_a4 < 0) {
if (local_a4 == -0x32) {
fprintf(stderr,"Syntax error at: %s\n",CONCAT44(uStack156,local_a0));
}
else {
uVar1 = gnutls_strerror(local_a4);
fprintf(stderr,"Error in priorities: %s\n",uVar1);
}
exit(1);
}
local_88 = 0;
while( true ) {
local_a4 = gnutls_priority_get_cipher_suite_index
(CONCAT44(uStack148,local_98),local_88 & 0xffffffff,&local_ac);
if (local_a4 == -0x38) break;
if (local_a4 != -0x15) {
local_30 = gnutls_cipher_suite_info(local_ac,&local_22,0,0,0,&local_a8);
if (local_30 != 0) {
uVar1 = gnutls_protocol_get_name(local_a8);
log_msg(stdout,"%-50s\t0x%02x, 0x%02x\t%s\n",local_30,local_22,local_21,uVar1);
}
}
local_88 = local_88 + 1;
}
log_msg(stdout,&DAT_00104a88);
local_a4 = gnutls_priority_protocol_list(CONCAT44(uStack148,local_98),&local_90);
log_msg(stdout,"Protocols: ");
if (local_a4 == 0) {
log_msg(stdout,"none\n");
}
for (local_88 = 0; local_88 < local_a4; local_88 = local_88 + 1) {
uVar1 = gnutls_protocol_get_name(*(undefined4 *)(CONCAT44(uStack140,local_90) + local_88 * 4))
;
log_msg(stdout,"VERS-%s",uVar1);
if (local_88 + 1 == (ulong)local_a4) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
local_a4 = gnutls_priority_cipher_list(CONCAT44(uStack148,local_98),&local_90);
log_msg(stdout,"Ciphers: ");
if (local_a4 == 0) {
log_msg(stdout,"none\n");
}
for (local_88 = 0; local_88 < local_a4; local_88 = local_88 + 1) {
uVar1 = gnutls_cipher_get_name(*(undefined4 *)(CONCAT44(uStack140,local_90) + local_88 * 4));
log_msg(stdout,&DAT_00104d7b,uVar1);
if (local_88 + 1 == (ulong)local_a4) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
local_a4 = gnutls_priority_mac_list(CONCAT44(uStack148,local_98),&local_90);
log_msg(stdout,"MACs: ");
if (local_a4 == 0) {
log_msg(stdout,"none\n");
}
for (local_88 = 0; local_88 < local_a4; local_88 = local_88 + 1) {
uVar1 = gnutls_mac_get_name(*(undefined4 *)(CONCAT44(uStack140,local_90) + local_88 * 4));
log_msg(stdout,&DAT_00104d7b,uVar1);
if (local_88 + 1 == (ulong)local_a4) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
local_a4 = gnutls_priority_kx_list(CONCAT44(uStack148,local_98),&local_90);
log_msg(stdout,"Key Exchange Algorithms: ");
if (local_a4 == 0) {
log_msg(stdout,"none\n");
}
for (local_88 = 0; local_88 < local_a4; local_88 = local_88 + 1) {
uVar1 = gnutls_kx_get_name(*(undefined4 *)(CONCAT44(uStack140,local_90) + local_88 * 4));
log_msg(stdout,&DAT_00104d7b,uVar1);
if (local_88 + 1 == (ulong)local_a4) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
local_a4 = gnutls_priority_group_list(CONCAT44(uStack148,local_98),&local_90);
log_msg(stdout,"Groups: ");
if (local_a4 == 0) {
log_msg(stdout,"none\n");
}
for (local_88 = 0; local_88 < local_a4; local_88 = local_88 + 1) {
uVar1 = gnutls_group_get_name(*(undefined4 *)(CONCAT44(uStack140,local_90) + local_88 * 4));
log_msg(stdout,"GROUP-%s",uVar1);
if (local_88 + 1 == (ulong)local_a4) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
local_a4 = gnutls_priority_sign_list(CONCAT44(uStack148,local_98),&local_90);
log_msg(stdout,"PK-signatures: ");
if (local_a4 == 0) {
log_msg(stdout,"none\n");
}
for (local_88 = 0; local_88 < local_a4; local_88 = local_88 + 1) {
uVar1 = gnutls_sign_get_name(*(undefined4 *)(CONCAT44(uStack140,local_90) + local_88 * 4));
log_msg(stdout,"SIGN-%s",uVar1);
if (local_88 + 1 == (ulong)local_a4) {
log_msg(stdout,&DAT_00104a88);
}
else {
log_msg(stdout,&DAT_00104d6e);
}
}
gnutls_priority_deinit(CONCAT44(uStack148,local_98));
}
if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
DH *
choose_dh(int min, int wantbits, int max)
{
FILE *f;
char *line =
((void *)0)
;
size_t linesize = 0;
int best, bestcount, which, linenum;
struct dhgroup dhg;
if ((f = fopen(get_moduli_filename(), "r")) ==
((void *)0)
) {
sshlog("dh.c", __func__, 168, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "WARNING: could not open %s (%s), using fixed modulus", get_moduli_filename(), strerror(
(*__errno_location ())
))
;
return (dh_new_group_fallback(max));
}
linenum = 0;
best = bestcount = 0;
while (getline(&line, &linesize, f) != -1) {
linenum++;
if (!parse_prime(linenum, line, &dhg))
continue;
BN_clear_free(dhg.g);
BN_clear_free(dhg.p);
if (dhg.size > max || dhg.size < min)
continue;
if ((dhg.size > wantbits && dhg.size < best) ||
(dhg.size > best && best < wantbits)) {
best = dhg.size;
bestcount = 0;
}
if (dhg.size == best)
bestcount++;
}
free(line);
line =
((void *)0)
;
linesize = 0;
rewind(f);
if (bestcount == 0) {
fclose(f);
sshlog("dh.c", __func__, 200, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "WARNING: no suitable primes in %s", get_moduli_filename())
;
return (dh_new_group_fallback(max));
}
which = arc4random_uniform(bestcount);
linenum = 0;
bestcount = 0;
while (getline(&line, &linesize, f) != -1) {
linenum++;
if (!parse_prime(linenum, line, &dhg))
continue;
if ((dhg.size > max || dhg.size < min) ||
dhg.size != best ||
bestcount++ != which) {
BN_clear_free(dhg.g);
BN_clear_free(dhg.p);
continue;
}
break;
}
free(line);
line =
((void *)0)
;
fclose(f);
if (bestcount != which + 1) {
sshlog("dh.c", __func__, 225, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "WARNING: selected prime disappeared in %s, giving up", get_moduli_filename())
;
return (dh_new_group_fallback(max));
}
return (dh_new_group(dhg.g, dhg.p));
}
| void choose_dh(int param_1,int param_2,int param_3)
{
int iVar1;
int iVar2;
char *pcVar3;
int *piVar4;
undefined8 uVar5;
__ssize_t _Var6;
long in_FS_OFFSET;
bool bVar7;
undefined8 uVar8;
int local_60;
int local_5c;
undefined4 local_58;
char *local_50;
size_t local_48;
FILE *local_40;
int local_38 [2];
BIGNUM *local_30;
BIGNUM *local_28;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
local_50 = (char *)0x0;
local_48 = 0;
pcVar3 = (char *)get_moduli_filename();
local_40 = fopen(pcVar3,"r");
if (local_40 == (FILE *)0x0) {
piVar4 = __errno_location();
pcVar3 = strerror(*piVar4);
uVar8 = 0x100768;
uVar5 = get_moduli_filename();
sshlog(&DAT_00101228,"choose_dh",0xa8,0,3,0,
"WARNING: could not open %s (%s), using fixed modulus",uVar5,pcVar3,uVar8);
dh_new_group_fallback(param_3);
}
else {
local_58 = 0;
local_5c = 0;
local_60 = 0;
while (_Var6 = getline(&local_50,&local_48,local_40), _Var6 != -1) {
local_58 = __addvsi3(local_58,1);
iVar1 = parse_prime(local_58,local_50,local_38);
if (iVar1 != 0) {
BN_clear_free(local_30);
BN_clear_free(local_28);
if ((local_38[0] <= param_3) && (param_1 <= local_38[0])) {
if (((param_2 < local_38[0]) && (local_38[0] < local_60)) ||
((local_60 < local_38[0] && (local_60 < param_2)))) {
local_60 = local_38[0];
local_5c = 0;
}
if (local_60 == local_38[0]) {
local_5c = __addvsi3(local_5c,1);
}
}
}
}
free(local_50);
local_50 = (char *)0x0;
local_48 = 0;
rewind(local_40);
if (local_5c == 0) {
fclose(local_40);
uVar5 = get_moduli_filename();
sshlog(&DAT_00101228,"choose_dh",200,0,3,0,"WARNING: no suitable primes in %s",uVar5);
dh_new_group_fallback(param_3);
}
else {
iVar1 = arc4random_uniform(local_5c);
local_58 = 0;
local_5c = 0;
while (_Var6 = getline(&local_50,&local_48,local_40), _Var6 != -1) {
local_58 = __addvsi3(local_58,1);
iVar2 = parse_prime(local_58,local_50,local_38);
if (iVar2 != 0) {
if ((((local_38[0] <= param_3) && (param_1 <= local_38[0])) && (local_60 == local_38[0]))
&& (iVar2 = __addvsi3(local_5c,1), bVar7 = iVar1 == local_5c, local_5c = iVar2, bVar7))
break;
BN_clear_free(local_30);
BN_clear_free(local_28);
}
}
free(local_50);
local_50 = (char *)0x0;
fclose(local_40);
iVar1 = __addvsi3(iVar1,1);
if (local_5c == iVar1) {
dh_new_group(local_30,local_28);
}
else {
uVar5 = get_moduli_filename();
sshlog(&DAT_00101228,"choose_dh",0xe1,0,3,0,
"WARNING: selected prime disappeared in %s, giving up",uVar5);
dh_new_group_fallback(param_3);
}
}
}
if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
__stack_chk_fail();
}
|
static struct cpelement *
cpl_searchbyname (name)
const char *name;
{
struct cpelement *cp;
for (cp = coproc_list.head ; cp; cp = cp->next)
if (((cp->coproc->c_name)[0] == (name)[0] && strcmp(cp->coproc->c_name, name) == 0))
return cp;
return (struct cpelement *)
((void *)0)
;
}
| long long cpl_searchbyname(char *a0) {
struct_0 *v0;
void* v2;
v0 = coproc_list;
while (true) {
if (!v0) {
v2 = 0;
break;
} else {
if (*(v0->field_8)->field_0 == *(a0) && !strcmp(*(v0->field_8), a0)) {
v2 = v0;
break;
}
v0 = v0->field_0;
}
}
return v2;
}
|
static inline __u32 rta_getattr_u32(const struct rtattr *rta)
{
return *(__u32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| int rta_getattr_u32(struct_0 *a0) {
return a0->field_4;
}
|
const u_char *
sshpkt_ptr(struct ssh *ssh, size_t *lenp)
{
if (lenp !=
((void *)0)
)
*lenp = sshbuf_len(ssh->state->incoming_packet);
return sshbuf_ptr(ssh->state->incoming_packet);
}
| long long sshpkt_ptr(struct struct_0 **a0, unsigned long long *a1) {
if (a1)
*(a1) = sshbuf_len(*(a0)->field_38);
return sshbuf_ptr(*(a0)->field_38);
}
|
static void
add_regexp (struct regexp_list *reglist, char const *pattern)
{
size_t patlen = strlen (pattern);
char const *m = re_compile_pattern (pattern, patlen, reglist->buf);
if (m != 0)
error (2, 0, "%s: %s", pattern, m);
else
{
char *regexps = reglist->regexps;
size_t len = reglist->len;
_Bool
multiple_regexps = reglist->multiple_regexps = regexps != 0;
size_t newlen = reglist->len = len + 2 * multiple_regexps + patlen;
size_t size = reglist->size;
if (size <= newlen)
{
if (!size)
size = 1;
do size *= 2;
while (size <= newlen);
reglist->size = size;
reglist->regexps = regexps = xrealloc (regexps, size);
}
if (multiple_regexps)
{
regexps[len++] = '\\';
regexps[len++] = '|';
}
memcpy (regexps + len, pattern, patlen + 1);
}
}
| void add_regexp(struct_0 *a0, void* a1) {
char v0;
int tmp_18;
int tmp_29;
char *v1;
char *v2;
unsigned long long v3;
unsigned long long v4;
unsigned long v5;
unsigned long v6;
unsigned long long v8;
v4 = strlen(a1);
v5 = re_compile_pattern(a1, v4, a0->field_20, v4);
if (v5)
error(0x2, 0x0, "%s: %s");
v1 = a0->field_0;
v2 = a0->field_8;
a0->field_18 = v1;
v0 = a0->field_18;
a0->field_8 = &v2[2 * v0 + v4];
v6 = a0->field_8;
v3 = a0->field_10;
if (v3 <= v6) {
if (!v3)
v3 = 1;
do {
v3 *= 2;
} while (v3 <= v6);
a0->field_10 = v3;
v1 = xrealloc(v1, v3, v3);
a0->field_0 = v1;
}
if (v0) {
tmp_18 = v2;
v2 += 1;
v1[tmp_18] = 92;
tmp_29 = v2;
v2 += 1;
v1[tmp_29] = 124;
}
v8 = memcpy(v1 + v2, a1, v4 + 1);
return;
}
|
static void
get_point (char const *point, const struct stat *statp)
{
struct stat device_stats;
struct mount_entry *me;
struct mount_entry const *best_match =
((void *)0)
;
char *resolved = canonicalize_file_name (point);
if (resolved && resolved[0] == '/')
{
size_t resolved_len = strlen (resolved);
size_t best_match_len = 0;
for (me = mount_list; me; me = me->me_next)
{
if (!(strcmp (me->me_type, "lofs") == 0)
&& (!best_match || best_match->me_dummy || !me->me_dummy))
{
size_t len = strlen (me->me_mountdir);
if (best_match_len <= len && len <= resolved_len
&& (len == 1
|| ((len == resolved_len || resolved[len] == '/')
&& (strncmp (me->me_mountdir, resolved, len) == 0))))
{
best_match = me;
best_match_len = len;
}
}
}
}
free (resolved);
if (best_match
&& (stat (best_match->me_mountdir, &device_stats) != 0
|| device_stats.st_dev != statp->st_dev))
best_match =
((void *)0)
;
if (! best_match)
for (me = mount_list; me; me = me->me_next)
{
if (me->me_dev == (dev_t) -1)
{
if (stat (me->me_mountdir, &device_stats) == 0)
me->me_dev = device_stats.st_dev;
else
{
if (
(*__errno_location ())
==
5
)
{
error (0,
(*__errno_location ())
, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, me->me_mountdir));
exit_status =
1
;
}
me->me_dev = (dev_t) -2;
}
}
if (statp->st_dev == me->me_dev
&& !(strcmp (me->me_type, "lofs") == 0)
&& (!best_match || best_match->me_dummy || !me->me_dummy))
{
if (stat (me->me_mountdir, &device_stats) != 0
|| device_stats.st_dev != me->me_dev)
me->me_dev = (dev_t) -2;
else
best_match = me;
}
}
if (best_match)
get_dev (best_match->me_devname, best_match->me_mountdir, point, point,
best_match->me_type, best_match->me_dummy, best_match->me_remote,
((void *)0)
,
0
);
else
{
char *mp = find_mount_point (point, statp);
if (mp)
{
get_dev (
((void *)0)
, mp, point,
((void *)0)
,
((void *)0)
,
0
,
0
,
((void *)0)
,
0
);
free (mp);
}
}
}
| void get_point(char *param_1,__dev_t *param_2)
{
int iVar1;
char *__s;
size_t sVar2;
size_t __n;
int *piVar3;
undefined8 uVar4;
void *__ptr;
long in_FS_OFFSET;
undefined8 uVar5;
undefined8 *local_f0;
undefined8 *local_e8;
ulong local_e0;
stat local_b8;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
local_e8 = (undefined8 *)0x0;
__s = canonicalize_file_name(param_1);
if ((__s != (char *)0x0) && (*__s == '/')) {
sVar2 = strlen(__s);
local_e0 = 0;
for (local_f0 = mount_list; local_f0 != (undefined8 *)0x0; local_f0 = (undefined8 *)local_f0[6])
{
iVar1 = strcmp((char *)local_f0[3],"lofs");
if ((iVar1 != 0) &&
(((local_e8 == (undefined8 *)0x0 || ((*(byte *)(local_e8 + 5) & 1) != 0)) ||
((*(byte *)(local_f0 + 5) & 1) == 0)))) {
__n = strlen((char *)local_f0[1]);
if ((local_e0 <= __n) && (__n <= sVar2)) {
if (__n == 1) {
LAB_00102f91:
local_e8 = local_f0;
local_e0 = __n;
}
else if ((__n == sVar2) || (__s[__n] == '/')) {
iVar1 = strncmp((char *)local_f0[1],__s,__n);
if (iVar1 == 0) goto LAB_00102f91;
}
}
}
}
}
uVar5 = 0x102fdc;
free(__s);
if (local_e8 != (undefined8 *)0x0) {
uVar5 = 0x103003;
iVar1 = stat((char *)local_e8[1],&local_b8);
if ((iVar1 != 0) || (local_b8.st_dev != *param_2)) {
local_e8 = (undefined8 *)0x0;
}
}
if (local_e8 == (undefined8 *)0x0) {
for (local_f0 = mount_list; local_f0 != (undefined8 *)0x0; local_f0 = (undefined8 *)local_f0[6])
{
if (local_f0[4] == -1) {
uVar5 = 0x10307b;
iVar1 = stat((char *)local_f0[1],&local_b8);
if (iVar1 == 0) {
local_f0[4] = local_b8.st_dev;
}
else {
uVar5 = 0x103098;
piVar3 = __errno_location();
if (*piVar3 == 5) {
uVar4 = quotearg_n_style_colon(0,3,local_f0[1]);
piVar3 = __errno_location();
uVar5 = 0x1030e1;
error(0,*piVar3,&DAT_00104690,uVar4);
exit_status = 1;
}
local_f0[4] = 0xfffffffffffffffe;
}
}
if (*param_2 == local_f0[4]) {
uVar5 = 0x103132;
iVar1 = strcmp((char *)local_f0[3],"lofs");
if ((iVar1 != 0) &&
(((local_e8 == (undefined8 *)0x0 || ((*(byte *)(local_e8 + 5) & 1) != 0)) ||
((*(byte *)(local_f0 + 5) & 1) == 0)))) {
uVar5 = 0x103185;
iVar1 = stat((char *)local_f0[1],&local_b8);
if ((iVar1 == 0) && (local_b8.st_dev == local_f0[4])) {
local_e8 = local_f0;
}
else {
local_f0[4] = 0xfffffffffffffffe;
}
}
}
}
}
if (local_e8 == (undefined8 *)0x0) {
uVar5 = 0x103274;
__ptr = (void *)find_mount_point(param_1,param_2);
if (__ptr != (void *)0x0) {
get_dev(0,__ptr,param_1,0,0,0,0,0,0,uVar5);
free(__ptr);
}
}
else {
get_dev(*local_e8,local_e8[1],param_1,param_1,local_e8[3],(*(byte *)(local_e8 + 5) & 1) != 0,
(*(byte *)(local_e8 + 5) & 2) != 0,0,0,uVar5);
}
if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static void
dired_outstring (char const *s)
{
dired_outbuf (s, strlen (s));
}
| void dired_outstring(char *param_1)
{
size_t sVar1;
sVar1 = strlen(param_1);
dired_outbuf(param_1,sVar1);
return;
}
|
static void
matcher_error (void)
{
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"error in regular expression matcher\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, gettext ("error in regular expression matcher")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, gettext ("error in regular expression matcher")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
}
| void matcher_error() {
unsigned long v0;
unsigned long v2;
v0 = v2;
error(0x1, *(__errno_location()), gettext("error in regular expression matcher"));
}
|
static int iplink_parse_vf(int vf, int *argcp, char ***argvp,
struct iplink_req *req, const char *dev)
{
char new_rate_api = 0, count = 0, override_legacy_rate = 0;
struct ifla_vf_rate tivt;
int len, argc = *argcp;
char **argv = *argvp;
struct rtattr *vfinfo;
int ret;
tivt.min_tx_rate = -1;
tivt.max_tx_rate = -1;
vfinfo = addattr_nest(&req->n, sizeof(*req), IFLA_VF_INFO);
while ((argc - 1 > 0)) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
count++;
if (!matches(*argv, "max_tx_rate")) {
new_rate_api = 1;
override_legacy_rate = 1;
} else if (!matches(*argv, "min_tx_rate")) {
new_rate_api = 1;
}
}
while (count--) {
do { argv--; argc++; } while(0);
}
while ((argc - 1 > 0)) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (matches(*argv, "mac") == 0) {
struct ifla_vf_mac ivm = { 0 };
int halen = nl_get_ll_addr_len(dev);
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ivm.vf = vf;
len = ll_addr_a2n((char *)ivm.mac, 32, *argv);
if (len < 0)
return -1;
if (halen > 0 && len != halen) {
fprintf(
stderr
,
"Invalid address length %d - must be %d bytes\n",
len, halen);
return -1;
}
addattr_l(&req->n, sizeof(*req), IFLA_VF_MAC,
&ivm, sizeof(ivm));
} else if (matches(*argv, "vlan") == 0) {
struct ifla_vf_vlan_info ivvi;
iplink_parse_vf_vlan_info(vf, &argc, &argv, &ivvi);
if (ivvi.vlan_proto == htons(0x8100)) {
struct ifla_vf_vlan ivv;
ivv.vf = ivvi.vf;
ivv.vlan = ivvi.vlan;
ivv.qos = ivvi.qos;
addattr_l(&req->n, sizeof(*req),
IFLA_VF_VLAN, &ivv, sizeof(ivv));
} else {
struct rtattr *vfvlanlist;
vfvlanlist = addattr_nest(&req->n, sizeof(*req),
IFLA_VF_VLAN_LIST);
addattr_l(&req->n, sizeof(*req),
IFLA_VF_VLAN_INFO, &ivvi,
sizeof(ivvi));
while ((argc - 1 > 0)) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (matches(*argv, "vlan") != 0) {
do { argv--; argc++; } while(0);
break;
}
iplink_parse_vf_vlan_info(vf, &argc,
&argv, &ivvi);
addattr_l(&req->n, sizeof(*req),
IFLA_VF_VLAN_INFO, &ivvi,
sizeof(ivvi));
}
addattr_nest_end(&req->n, vfvlanlist);
}
} else if (matches(*argv, "rate") == 0) {
struct ifla_vf_tx_rate ivt;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_unsigned(&ivt.rate, *argv, 0))
invarg("Invalid \"rate\" value\n", *argv);
ivt.vf = vf;
if (!new_rate_api)
addattr_l(&req->n, sizeof(*req),
IFLA_VF_TX_RATE, &ivt, sizeof(ivt));
else if (!override_legacy_rate)
tivt.max_tx_rate = ivt.rate;
} else if (matches(*argv, "max_tx_rate") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_unsigned(&tivt.max_tx_rate, *argv, 0))
invarg("Invalid \"max tx rate\" value\n",
*argv);
tivt.vf = vf;
} else if (matches(*argv, "min_tx_rate") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_unsigned(&tivt.min_tx_rate, *argv, 0))
invarg("Invalid \"min tx rate\" value\n",
*argv);
tivt.vf = vf;
} else if (matches(*argv, "spoofchk") == 0) {
struct ifla_vf_spoofchk ivs;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ivs.setting = parse_on_off("spoofchk", *argv, &ret);
if (ret)
return ret;
ivs.vf = vf;
addattr_l(&req->n, sizeof(*req), IFLA_VF_SPOOFCHK,
&ivs, sizeof(ivs));
} else if (matches(*argv, "query_rss") == 0) {
struct ifla_vf_rss_query_en ivs;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ivs.setting = parse_on_off("query_rss", *argv, &ret);
if (ret)
return ret;
ivs.vf = vf;
addattr_l(&req->n, sizeof(*req), IFLA_VF_RSS_QUERY_EN,
&ivs, sizeof(ivs));
} else if (matches(*argv, "trust") == 0) {
struct ifla_vf_trust ivt;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ivt.setting = parse_on_off("trust", *argv, &ret);
if (ret)
return ret;
ivt.vf = vf;
addattr_l(&req->n, sizeof(*req), IFLA_VF_TRUST,
&ivt, sizeof(ivt));
} else if (matches(*argv, "state") == 0) {
struct ifla_vf_link_state ivl;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (matches(*argv, "auto") == 0)
ivl.link_state = IFLA_VF_LINK_STATE_AUTO;
else if (matches(*argv, "enable") == 0)
ivl.link_state = IFLA_VF_LINK_STATE_ENABLE;
else if (matches(*argv, "disable") == 0)
ivl.link_state = IFLA_VF_LINK_STATE_DISABLE;
else
invarg("Invalid \"state\" value\n", *argv);
ivl.vf = vf;
addattr_l(&req->n, sizeof(*req), IFLA_VF_LINK_STATE,
&ivl, sizeof(ivl));
} else if (matches(*argv, "node_guid") == 0) {
struct ifla_vf_guid ivg;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ivg.vf = vf;
if (get_guid(&ivg.guid, *argv)) {
invarg("Invalid GUID format\n", *argv);
return -1;
}
addattr_l(&req->n, sizeof(*req), IFLA_VF_IB_NODE_GUID,
&ivg, sizeof(ivg));
} else if (matches(*argv, "port_guid") == 0) {
struct ifla_vf_guid ivg;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ivg.vf = vf;
if (get_guid(&ivg.guid, *argv)) {
invarg("Invalid GUID format\n", *argv);
return -1;
}
addattr_l(&req->n, sizeof(*req), IFLA_VF_IB_PORT_GUID,
&ivg, sizeof(ivg));
} else {
do { argv--; argc++; } while(0);
break;
}
}
if (new_rate_api) {
int tmin, tmax;
if (tivt.min_tx_rate == -1 || tivt.max_tx_rate == -1) {
ipaddr_get_vf_rate(tivt.vf, &tmin, &tmax, dev);
if (tivt.min_tx_rate == -1)
tivt.min_tx_rate = tmin;
if (tivt.max_tx_rate == -1)
tivt.max_tx_rate = tmax;
}
if (tivt.max_tx_rate && tivt.min_tx_rate > tivt.max_tx_rate) {
fprintf(
stderr
,
"Invalid min_tx_rate %d - must be <= max_tx_rate %d\n",
tivt.min_tx_rate, tivt.max_tx_rate);
return -1;
}
addattr_l(&req->n, sizeof(*req), IFLA_VF_RATE, &tivt,
sizeof(tivt));
}
if (argc == *argcp)
incomplete_command();
addattr_nest_end(&req->n, vfinfo);
*argcp = argc;
*argvp = argv;
return 0;
}
| int iplink_parse_vf(uint param_1,int *param_2,undefined8 *param_3,undefined8 param_4,
undefined8 param_5)
{
bool bVar1;
bool bVar2;
uint16_t uVar3;
uint uVar4;
char cVar5;
byte bVar6;
uint16_t uVar7;
int iVar8;
long in_FS_OFFSET;
char local_9a;
int local_98;
int local_94;
uint local_90;
uint local_8c;
undefined8 *local_88;
undefined8 local_80;
undefined8 local_78;
uint local_70;
uint local_6c;
uint local_68;
uint local_64;
uint local_60;
undefined4 local_5c;
uint local_58;
uint local_54;
undefined4 local_50;
uint16_t local_4c;
undefined8 local_48;
undefined8 local_40;
undefined8 local_38;
undefined8 local_30;
undefined4 local_28;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
bVar1 = false;
local_9a = '\0';
bVar2 = false;
local_98 = *param_2;
local_88 = (undefined8 *)*param_3;
local_6c = 0xffffffff;
local_68 = 0xffffffff;
local_80 = addattr_nest(param_4,0x420,1);
while (1 < local_98) {
local_88 = local_88 + 1;
local_98 = local_98 + -1;
if (local_98 < 1) {
incomplete_command();
}
local_9a = local_9a + '\x01';
cVar5 = matches(*local_88,"max_tx_rate");
if (cVar5 == '\x01') {
cVar5 = matches(*local_88,"min_tx_rate");
if (cVar5 != '\x01') {
bVar1 = true;
}
}
else {
bVar1 = true;
bVar2 = true;
}
}
while (uVar4 = local_70, local_9a != '\0') {
local_88 = local_88 + -1;
local_98 = local_98 + 1;
local_9a = local_9a + -1;
}
while (local_70 = uVar4, 1 < local_98) {
local_88 = local_88 + 1;
local_98 = local_98 + -1;
if (local_98 < 1) {
incomplete_command();
}
cVar5 = matches(*local_88,&DAT_00106d82);
if (cVar5 == '\x01') {
cVar5 = matches(*local_88,&DAT_00106db6);
if (cVar5 == '\x01') {
cVar5 = matches(*local_88,&DAT_00106dbb);
if (cVar5 == '\x01') {
cVar5 = matches(*local_88,"max_tx_rate");
if (cVar5 == '\x01') {
cVar5 = matches(*local_88,"min_tx_rate");
if (cVar5 == '\x01') {
cVar5 = matches(*local_88,"spoofchk");
if (cVar5 == '\x01') {
cVar5 = matches(*local_88,"query_rss");
if (cVar5 == '\x01') {
cVar5 = matches(*local_88,"trust");
if (cVar5 == '\x01') {
cVar5 = matches(*local_88,"state");
if (cVar5 == '\x01') {
cVar5 = matches(*local_88,"node_guid");
if (cVar5 == '\x01') {
cVar5 = matches(*local_88,"port_guid");
if (cVar5 == '\x01') {
local_88 = local_88 + -1;
local_98 = local_98 + 1;
break;
}
local_88 = local_88 + 1;
local_98 = local_98 + -1;
if (local_98 < 1) {
incomplete_command();
}
local_58 = param_1;
iVar8 = get_guid(&local_50,*local_88);
if (iVar8 != 0) {
invarg("Invalid GUID format\n",*local_88);
}
addattr_l(param_4,0x420,0xb,&local_58,0x10);
uVar4 = local_70;
}
else {
local_88 = local_88 + 1;
local_98 = local_98 + -1;
if (local_98 < 1) {
incomplete_command();
}
local_58 = param_1;
iVar8 = get_guid(&local_50,*local_88);
if (iVar8 != 0) {
invarg("Invalid GUID format\n",*local_88);
}
addattr_l(param_4,0x420,10,&local_58,0x10);
uVar4 = local_70;
}
}
else {
local_88 = local_88 + 1;
local_98 = local_98 + -1;
if (local_98 < 1) {
incomplete_command();
}
cVar5 = matches(*local_88,&DAT_00106e2f);
if (cVar5 == '\x01') {
cVar5 = matches(*local_88,"enable");
if (cVar5 == '\x01') {
cVar5 = matches(*local_88,"disable");
if (cVar5 == '\x01') {
invarg("Invalid \"state\" value\n",*local_88);
}
else {
local_54 = 2;
}
}
else {
local_54 = 1;
}
}
else {
local_54 = 0;
}
local_58 = param_1;
addattr_l(param_4,0x420,5,&local_58,8);
uVar4 = local_70;
}
}
else {
local_88 = local_88 + 1;
local_98 = local_98 + -1;
if (local_98 < 1) {
incomplete_command();
}
bVar6 = parse_on_off("trust",*local_88,&local_94);
local_54 = (uint)bVar6;
if (local_94 != 0) goto LAB_00101632;
local_58 = param_1;
addattr_l(param_4,0x420,9,&local_58,8);
uVar4 = local_70;
}
}
else {
local_88 = local_88 + 1;
local_98 = local_98 + -1;
if (local_98 < 1) {
incomplete_command();
}
bVar6 = parse_on_off("query_rss",*local_88,&local_94);
local_54 = (uint)bVar6;
if (local_94 != 0) goto LAB_00101632;
local_58 = param_1;
addattr_l(param_4,0x420,7,&local_58,8);
uVar4 = local_70;
}
}
else {
local_88 = local_88 + 1;
local_98 = local_98 + -1;
if (local_98 < 1) {
incomplete_command();
}
bVar6 = parse_on_off("spoofchk",*local_88,&local_94);
local_54 = (uint)bVar6;
if (local_94 != 0) goto LAB_00101632;
local_58 = param_1;
addattr_l(param_4,0x420,4,&local_58,8);
uVar4 = local_70;
}
}
else {
local_88 = local_88 + 1;
local_98 = local_98 + -1;
if (local_98 < 1) {
incomplete_command();
}
iVar8 = get_unsigned(&local_6c,*local_88,0);
uVar4 = param_1;
if (iVar8 != 0) {
invarg("Invalid \"min tx rate\" value\n",*local_88);
uVar4 = param_1;
}
}
}
else {
local_88 = local_88 + 1;
local_98 = local_98 + -1;
if (local_98 < 1) {
incomplete_command();
}
iVar8 = get_unsigned(&local_68,*local_88,0);
uVar4 = param_1;
if (iVar8 != 0) {
invarg("Invalid \"max tx rate\" value\n",*local_88);
uVar4 = param_1;
}
}
}
else {
local_88 = local_88 + 1;
local_98 = local_98 + -1;
if (local_98 < 1) {
incomplete_command();
}
iVar8 = get_unsigned(&local_54,*local_88,0);
if (iVar8 != 0) {
invarg("Invalid \"rate\" value\n",*local_88);
}
if (bVar1) {
uVar4 = local_70;
local_58 = param_1;
if (!bVar2) {
local_68 = local_54;
}
}
else {
local_58 = param_1;
addattr_l(param_4,0x420,3,&local_58,8);
uVar4 = local_70;
}
}
}
else {
iplink_parse_vf_vlan_info(param_1,&local_98,&local_88,&local_58);
uVar3 = local_4c;
uVar7 = htons(0x8100);
if (uVar3 == uVar7) {
local_64 = local_58;
local_60 = local_54;
local_5c = local_50;
addattr_l(param_4,0x420,2,&local_64,0xc);
uVar4 = local_70;
}
else {
local_78 = addattr_nest(param_4,0x420,0xc);
addattr_l(param_4,0x420,1,&local_58,0x10);
while (1 < local_98) {
local_88 = local_88 + 1;
local_98 = local_98 + -1;
if (local_98 < 1) {
incomplete_command();
}
cVar5 = matches(*local_88,&DAT_00106db6);
if (cVar5 != '\0') {
local_88 = local_88 + -1;
local_98 = local_98 + 1;
break;
}
iplink_parse_vf_vlan_info(param_1,&local_98,&local_88,&local_58);
addattr_l(param_4,0x420,1,&local_58,0x10);
}
addattr_nest_end(param_4,local_78);
uVar4 = local_70;
}
}
}
else {
local_48 = 0;
local_40 = 0;
local_38 = 0;
local_30 = 0;
local_28 = 0;
local_90 = nl_get_ll_addr_len(param_5);
local_88 = local_88 + 1;
local_98 = local_98 + -1;
if (local_98 < 1) {
incomplete_command();
}
local_48 = local_48 & 0xffffffff00000000 | (ulong)param_1;
local_8c = ll_addr_a2n((long)&local_48 + 4,0x20,*local_88);
if ((int)local_8c < 0) {
local_94 = -1;
goto LAB_00101632;
}
if ((0 < (int)local_90) && (local_8c != local_90)) {
fprintf(stderr,"Invalid address length %d - must be %d bytes\n",(ulong)local_8c,
(ulong)local_90);
local_94 = -1;
goto LAB_00101632;
}
addattr_l(param_4,0x420,1,&local_48,0x24);
uVar4 = local_70;
}
}
if (bVar1) {
if ((local_6c == 0xffffffff) || (local_68 == 0xffffffff)) {
ipaddr_get_vf_rate(local_70,&local_64,&local_58,param_5);
if (local_6c == 0xffffffff) {
local_6c = local_64;
}
if (local_68 == 0xffffffff) {
local_68 = local_58;
}
}
if ((local_68 != 0) && (local_68 < local_6c)) {
fprintf(stderr,"Invalid min_tx_rate %d - must be <= max_tx_rate %d\n",(ulong)local_6c,
(ulong)local_68);
local_94 = -1;
goto LAB_00101632;
}
addattr_l(param_4,0x420,6,&local_70,0xc);
}
if (*param_2 == local_98) {
incomplete_command();
}
addattr_nest_end(param_4,local_80);
*param_2 = local_98;
*param_3 = local_88;
local_94 = 0;
LAB_00101632:
if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) {
return local_94;
}
__stack_chk_fail();
}
|
static cc_t
special_char_decode(u_int c)
{
if (c == 255)
return
'\0'
;
return c;
}
| int special_char_decode(unsigned long a0) {
unsigned int v1;
if (a0 == 255)
v1 = 0;
else
v1 = a0;
return v1;
}
|
void
print_func_list (list)
register SHELL_VAR **list;
{
register int i;
register SHELL_VAR *var;
for (i = 0; list && (var = list[i]); i++)
{
printf ("%s ", var->name);
print_var_function (var);
printf ("\n");
}
}
| int print_func_list(long a1)
{
int i;
const char ***v2;
const char **v3;
for ( i = 0; a1; ++i )
{
v2 = (const char ***)(a1 + 8LL * i);
v3 = *v2;
if ( !*v2 )
break;
printf("%s ", *v3);
print_var_function((long)v3);
LODWORD(v2) = printf("\n");
}
return (int)v2;
}
|
void get_extensions_crt_set(int type, void *crt)
{
int ret, i;
unsigned char *raw =
((void *)0)
;
unsigned raw_size;
if (batch) {
if (!cfg.extensions)
goto check_critical;
for (i = 0; cfg.extensions[i] !=
((void *)0)
; i += 2) {
if (cfg.extensions[i + 1] ==
((void *)0)
) {
fprintf(
stderr
,
"extensions: %s does not have an argument.\n",
cfg.extensions[i]);
exit(1);
}
raw = decode_ext_string(cfg.extensions[i+1], &raw_size);
if (type == 1)
ret =
gnutls_x509_crt_set_extension_by_oid(crt,
cfg.extensions[i],
raw, raw_size, 0);
else
ret =
gnutls_x509_crq_set_extension_by_oid(crt,
cfg.extensions[i],
raw, raw_size, 0);
gnutls_free((void *) (raw)), raw=
((void *)0)
;
if (ret < 0) {
fprintf(
stderr
, "set_extensions: %s\n",
gnutls_strerror(ret));
exit(1);
}
}
check_critical:
if (!cfg.crit_extensions)
return;
for (i = 0; cfg.crit_extensions[i] !=
((void *)0)
; i += 2) {
if (cfg.crit_extensions[i + 1] ==
((void *)0)
) {
fprintf(
stderr
,
"extensions: %s does not have an argument.\n",
cfg.crit_extensions[i]);
exit(1);
}
raw = decode_ext_string(cfg.crit_extensions[i+1], &raw_size);
if (type == 1)
ret =
gnutls_x509_crt_set_extension_by_oid(crt,
cfg.crit_extensions[i],
raw, raw_size, 1);
else
ret =
gnutls_x509_crq_set_extension_by_oid(crt,
cfg.crit_extensions[i],
raw, raw_size, 1);
gnutls_free((void *) (raw)), raw=
((void *)0)
;
if (ret < 0) {
fprintf(
stderr
, "set_extensions: %s\n",
gnutls_strerror(ret));
exit(1);
}
}
}
}
| long long get_extensions_crt_set(unsigned long a0, unsigned long long a1) {
char v0;
unsigned int v1;
unsigned int v2;
void* v3;
v3 = 0;
if (!*(got.batch))
return 0;
if (*((got.cfg + 392))) {
for (v2 = 0; *((*((got.cfg + 392)) + (v2 << 3))); v2 += 2) {
if (!*((*((got.cfg + 392)) + (v2 + 1 << 3)))) {
fprintf(*(*(&got.stderr)), "extensions: %s does not have an argument.\n", *((*((got.cfg + 392)) + v2 * 8)));
exit(0x1);
}
v3 = decode_ext_string(*((*((got.cfg + 392)) + (v2 + 1) * 8)), &v0);
if (a0 != 1)
v1 = gnutls_x509_crq_set_extension_by_oid(a1, *((*((got.cfg + 392)) + v2 * 8)), v3, *(&v0), 0x0);
else
v1 = gnutls_x509_crt_set_extension_by_oid(a1, *((*((got.cfg + 392)) + v2 * 8)), v3, *(&v0), 0x0);
*(*(5243304))(v3);
v3 = 0;
if (v1 < 0) {
fprintf(*(*(&got.stderr)), "set_extensions: %s\n", gnutls_strerror(v1));
exit(0x1);
}
}
}
if (!*((got.cfg + 400)))
return 0;
for (v2 = 0; *((*((got.cfg + 400)) + (v2 << 3))); v2 += 2) {
if (*((*((got.cfg + 400)) + (v2 + 1 << 3)))) {
v3 = decode_ext_string(*((*((got.cfg + 400)) + (v2 + 1) * 8)), &v0);
if (a0 != 1)
v1 = gnutls_x509_crq_set_extension_by_oid(a1, *((*((got.cfg + 400)) + v2 * 8)), v3, *(&v0), 0x1);
else
v1 = gnutls_x509_crt_set_extension_by_oid(a1, *((*((got.cfg + 400)) + v2 * 8)), v3, *(&v0), 0x1);
*(*(5243304))(v3);
v3 = 0;
if (v1 < 0) {
fprintf(*(*(&got.stderr)), "set_extensions: %s\n", gnutls_strerror(v1));
exit(0x1);
}
} else {
fprintf(*(*(&got.stderr)), "extensions: %s does not have an argument.\n", *((*((got.cfg + 400)) + v2 * 8)));
exit(0x1);
}
}
return 0;
}
|
static int
glob0(const Char *pattern, _ssh_compat_glob_t *pglob, struct glob_lim *limitp)
{
const Char *qpatnext;
int c, err;
size_t oldpathc;
Char *bufnext, patbuf[
4096
];
qpatnext = globtilde(pattern, patbuf,
4096
, pglob);
oldpathc = pglob->gl_pathc;
bufnext = patbuf;
while ((c = *qpatnext++) != '\0') {
switch (c) {
case '[':
c = *qpatnext;
if (c == '!')
++qpatnext;
if (*qpatnext == '\0' ||
g_strchr(qpatnext+1, ']') ==
((void *)0)
) {
*bufnext++ = '[';
if (c == '!')
--qpatnext;
break;
}
*bufnext++ = ((Char)(('[')|0x8000));
if (c == '!')
*bufnext++ = ((Char)(('!')|0x8000));
c = *qpatnext++;
do {
if (c == '[' && *qpatnext == ':') {
do {
err = g_charclass(&qpatnext,
&bufnext);
if (err)
break;
c = *qpatnext++;
} while (c == '[' && *qpatnext == ':');
if (err == -1 &&
!(pglob->gl_flags & 0x0010))
return (-3);
if (c == ']')
break;
}
*bufnext++ = ((Char)((c)&0x00ff));
if (*qpatnext == '-' &&
(c = qpatnext[1]) != ']') {
*bufnext++ = ((Char)(('-')|0x8000));
*bufnext++ = ((Char)((c)&0x00ff));
qpatnext += 2;
}
} while ((c = *qpatnext++) != ']');
pglob->gl_flags |= 0x0100;
*bufnext++ = ((Char)((']')|0x8000));
break;
case '?':
pglob->gl_flags |= 0x0100;
*bufnext++ = ((Char)(('?')|0x8000));
break;
case '*':
pglob->gl_flags |= 0x0100;
if (bufnext == patbuf || bufnext[-1] != ((Char)(('*')|0x8000)))
*bufnext++ = ((Char)(('*')|0x8000));
break;
default:
*bufnext++ = ((Char)((c)&0x00ff));
break;
}
}
*bufnext = '\0';
if ((err = glob1(patbuf, patbuf+
4096
-1, pglob, limitp)) != 0)
return(err);
if (pglob->gl_pathc == oldpathc) {
if ((pglob->gl_flags & 0x0010) ||
((pglob->gl_flags & 0x0200) &&
!(pglob->gl_flags & 0x0100)))
return(globextend(pattern, pglob, limitp,
((void *)0)
));
else
return((-3));
}
if (!(pglob->gl_flags & 0x0020)) {
if ((pglob->gl_flags & 0x4000)) {
struct glob_path_stat *path_stat;
size_t i;
size_t n = pglob->gl_pathc - oldpathc;
size_t o = pglob->gl_offs + oldpathc;
if ((path_stat = calloc(n, sizeof(*path_stat))) ==
((void *)0)
)
return (-1);
for (i = 0; i < n; i++) {
path_stat[i].gps_path = pglob->gl_pathv[o + i];
path_stat[i].gps_stat = pglob->gl_statv[o + i];
}
qsort(path_stat, n, sizeof(*path_stat), compare_gps);
for (i = 0; i < n; i++) {
pglob->gl_pathv[o + i] = path_stat[i].gps_path;
pglob->gl_statv[o + i] = path_stat[i].gps_stat;
}
free(path_stat);
} else {
qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc,
pglob->gl_pathc - oldpathc, sizeof(char *),
compare);
}
}
return(0);
}
| ulong glob0(undefined8 param_1,long *param_2,undefined8 param_3)
{
ushort uVar1;
ushort *puVar2;
int iVar3;
uint uVar4;
long lVar5;
ulong uVar6;
long in_FS_OFFSET;
ushort *local_2050;
ushort *local_2048;
ulong local_2040;
long local_2038;
size_t local_2030;
long local_2028;
void *local_2020;
ushort local_2018 [4095];
undefined auStack26 [10];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_2050 = (ushort *)globtilde(param_1,local_2018,0x1000);
local_2038 = *param_2;
local_2048 = local_2018;
while( true ) {
puVar2 = local_2050 + 1;
uVar1 = *local_2050;
if (uVar1 == 0) break;
if (uVar1 == 0x5b) {
uVar1 = *puVar2;
if (uVar1 == 0x21) {
puVar2 = local_2050 + 2;
}
local_2050 = puVar2;
if ((*local_2050 == 0) || (lVar5 = g_strchr(local_2050 + 1,0x5d), lVar5 == 0)) {
puVar2 = local_2048 + 1;
*local_2048 = 0x5b;
local_2048 = puVar2;
if (uVar1 == 0x21) {
local_2050 = local_2050 + -1;
}
}
else {
*local_2048 = 0x805b;
puVar2 = local_2048 + 1;
if (uVar1 == 0x21) {
local_2048[1] = 0x8021;
puVar2 = local_2048 + 2;
}
local_2048 = puVar2;
uVar1 = *local_2050;
local_2050 = local_2050 + 1;
do {
if ((uVar1 == 0x5b) && (*local_2050 == 0x3a)) {
while (iVar3 = g_charclass(&local_2050,&local_2048), iVar3 == 0) {
puVar2 = local_2050 + 1;
uVar1 = *local_2050;
local_2050 = puVar2;
if ((uVar1 != 0x5b) || (*puVar2 != 0x3a)) break;
}
if ((iVar3 == -1) && ((*(uint *)(param_2 + 3) & 0x10) == 0)) {
uVar6 = 0xfffffffd;
goto LAB_00101374;
}
if (uVar1 == 0x5d) break;
}
puVar2 = local_2048 + 1;
*local_2048 = uVar1 & 0xff;
if ((*local_2050 == 0x2d) && (uVar1 = local_2050[1], uVar1 != 0x5d)) {
*puVar2 = 0x802d;
local_2048[2] = uVar1 & 0xff;
local_2050 = local_2050 + 2;
puVar2 = local_2048 + 3;
}
local_2048 = puVar2;
puVar2 = local_2050 + 1;
uVar1 = *local_2050;
local_2050 = puVar2;
} while (uVar1 != 0x5d);
*(uint *)(param_2 + 3) = *(uint *)(param_2 + 3) | 0x100;
*local_2048 = 0x805d;
local_2048 = local_2048 + 1;
}
}
else if (uVar1 < 0x5c) {
if (uVar1 == 0x2a) {
*(uint *)(param_2 + 3) = *(uint *)(param_2 + 3) | 0x100;
if ((local_2048 == local_2018) || (local_2050 = puVar2, local_2048[-1] != 0x802a)) {
*local_2048 = 0x802a;
local_2050 = puVar2;
local_2048 = local_2048 + 1;
}
}
else {
if (uVar1 != 0x3f) goto LAB_00100fe9;
*(uint *)(param_2 + 3) = *(uint *)(param_2 + 3) | 0x100;
*local_2048 = 0x803f;
local_2050 = puVar2;
local_2048 = local_2048 + 1;
}
}
else {
LAB_00100fe9:
*local_2048 = uVar1 & 0xff;
local_2050 = puVar2;
local_2048 = local_2048 + 1;
}
}
*local_2048 = 0;
local_2050 = puVar2;
uVar4 = glob1(local_2018,auStack26,param_2,param_3);
if (uVar4 == 0) {
if (local_2038 == *param_2) {
if (((*(uint *)(param_2 + 3) & 0x10) == 0) &&
(((*(uint *)(param_2 + 3) & 0x200) == 0 || ((*(uint *)(param_2 + 3) & 0x100) != 0)))) {
uVar6 = 0xfffffffd;
}
else {
uVar6 = globextend(param_1,param_2,param_3,0);
}
}
else {
if ((*(uint *)(param_2 + 3) & 0x20) == 0) {
if ((*(uint *)(param_2 + 3) & 0x4000) == 0) {
qsort((void *)(param_2[4] + (local_2038 + param_2[2]) * 8),*param_2 - local_2038,8,compare
);
}
else {
local_2030 = *param_2 - local_2038;
local_2028 = local_2038 + param_2[2];
local_2020 = calloc(local_2030,0x10);
if (local_2020 == (void *)0x0) {
uVar6 = 0xffffffff;
goto LAB_00101374;
}
for (local_2040 = 0; local_2040 < local_2030; local_2040 = local_2040 + 1) {
*(undefined8 *)((long)local_2020 + local_2040 * 0x10) =
*(undefined8 *)(param_2[4] + (local_2040 + local_2028) * 8);
*(undefined8 *)((long)local_2020 + local_2040 * 0x10 + 8) =
*(undefined8 *)(param_2[5] + (local_2040 + local_2028) * 8);
}
qsort(local_2020,local_2030,0x10,compare_gps);
for (local_2040 = 0; local_2040 < local_2030; local_2040 = local_2040 + 1) {
*(undefined8 *)((local_2040 + local_2028) * 8 + param_2[4]) =
*(undefined8 *)(local_2040 * 0x10 + (long)local_2020);
*(undefined8 *)((local_2040 + local_2028) * 8 + param_2[5]) =
*(undefined8 *)((long)local_2020 + local_2040 * 0x10 + 8);
}
free(local_2020);
}
}
uVar6 = 0;
}
}
else {
uVar6 = (ulong)uVar4;
}
LAB_00101374:
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return uVar6;
}
__stack_chk_fail();
}
|
test_code_t test_3des(gnutls_session_t session)
{
int ret;
sprintf(prio_str,
"NONE:" "+3DES-CBC:" "+COMP-NULL" ":%s:"
"+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":" "+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH" ":+VKO-GOST-12" ":%s", protocol_str, rest);
{ int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 935)) != TEST_SUCCEED) { return _ret; } };
gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred);
ret = test_do_handshake(session);
return ret;
}
| long test_3des(long a1)
{
unsigned int v2;
sprintf(
prio_str,
"NONE:+3DES-CBC:+COMP-NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT:+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+E"
"CDHE-ECDSA:+ANON-ECDH:+VKO-GOST-12:%s",
protocol_str,
rest);
v2 = _gnutls_priority_set_direct(a1, prio_str, 0x3A7u);
if ( v2 )
return v2;
gnutls_credentials_set(a1, 1LL, xcred);
return (unsigned int)test_do_handshake(a1);
}
|
static void nlnoprompt(void)
{
(parsefile->linno)++;
needprompt = doprompt;
}
| void nlnoprompt() {
char v0;
unsigned long long v2;
unsigned long long v3;
*((parsefile + 8)) = *((parsefile + 8)) + 1;
v2 = -541125437600005304;
quoteflag = 17905618636109546312;
v3 = *(&v0);
return;
}
|
_Bool
is_fts_enabled (int *fts_options)
{
*fts_options = ftsoptions;
return
1
;
}
| long long is_fts_enabled(unsigned int *a0) {
*(a0) = ftsoptions;
return 1;
}
|
static inline void
emit_ancillary_info (char const *program)
{
struct infomap { char const *program; char const *node; } const infomap[] = {
{ "[", "test invocation" },
{ "coreutils", "Multi-call invocation" },
{ "sha224sum", "sha2 utilities" },
{ "sha256sum", "sha2 utilities" },
{ "sha384sum", "sha2 utilities" },
{ "sha512sum", "sha2 utilities" },
{
((void *)0)
,
((void *)0)
}
};
char const *node = program;
struct infomap const *map_prog = infomap;
while (map_prog->program && ! (strcmp (program, map_prog->program) == 0))
map_prog++;
if (map_prog->node)
node = map_prog->node;
printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https:
char const *lc_messages = setlocale (
5
,
((void *)0)
);
if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1))
{
fputs_unlocked (gettext ("Report any translation bugs to " "<https:
stdout
)
;
}
char const *url_program = (strcmp (program, "[") == 0) ? "test" : program;
printf (gettext ("Full documentation <%s%s>\n"),
"https:
printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"),
node, node == program ? " invocation" : "");
}
| void emit_ancillary_info(char *a0) {
unsigned long v0;
unsigned long long v1[2];
char *v2;
unsigned long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
void* v16;
void* v17;
char v18;
unsigned long long *v21;
unsigned long long v22;
v4 = "[";
v5 = "test invocation";
v6 = "coreutils";
v7 = "Multi-call invocation";
v8 = "sha224sum";
v9 = "sha2 utilities";
v10 = "sha256sum";
v11 = "sha2 utilities";
v12 = "sha384sum";
v13 = "sha2 utilities";
v14 = "sha512sum";
v15 = "sha2 utilities";
v16 = 0;
v17 = 0;
v0 = a0;
for (v1[0] = &v4; v1[0] && strcmp(a0, v1[0]); v1[0] = v1 + 1);
if (v1[1])
v0 = v1[1];
printf(gettext("\n%s online help: <%s>\n"));
v2 = setlocale(0x5, NULL);
if (v2 && strncmp(v2, "en_", 0x3))
fputs_unlocked(gettext("Report any translation bugs to <https:
*(&v3) = (!strcmp(a0, "[") ? a0 : "test");
printf(gettext("Full documentation <%s%s>\n"));
printf(gettext("or available locally via: info '(coreutils) %s%s'\n"));
v22 = *(&v18) ^ v21[5];
return;
}
|
static void
lbuf_flush (void)
{
size_t size = lbuf.end - lbuf.buf;
if (full_write (
1
, lbuf.buf, size) != size)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", gettext (\"write error\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, "%s", gettext ("write error")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, "%s", gettext ("write error")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
lbuf.end = lbuf.buf;
}
| long long lbuf_flush() {
unsigned long long v0;
unsigned long long v2;
v0 = g_405318 - lbuf;
if (v0 == full_write(0x1, lbuf, v0)) {
g_405318 = lbuf;
return lbuf;
}
v2 = gettext("write error");
error(0x1, *(__errno_location()), "%s");
}
|
static SHELL_VAR *
hash_lookup (name, hashed_vars)
const char *name;
HASH_TABLE *hashed_vars;
{
BUCKET_CONTENTS *bucket;
bucket = hash_search (name, hashed_vars, 0);
if (bucket)
last_table_searched = hashed_vars;
return (bucket ? (SHELL_VAR *)bucket->data : (SHELL_VAR *)
((void *)0)
);
}
| int hash_lookup(unsigned long long a0, unsigned long long a1) {
struct_0 *v0;
unsigned int v2;
v0 = hash_search(a0, a1, 0x0, a1);
if (v0)
last_table_searched = a1;
if (!v0)
v2 = 0;
else
v2 = v0->field_10;
return v2;
}
|
int
mm_answer_moduli(struct ssh *ssh, int sock, struct sshbuf *m)
{
DH *dh;
const BIGNUM *dh_p, *dh_g;
int r;
u_int min, want, max;
if ((r = sshbuf_get_u32(m, &min)) != 0 ||
(r = sshbuf_get_u32(m, &want)) != 0 ||
(r = sshbuf_get_u32(m, &max)) != 0)
sshfatal("monitor.c", __func__, 576, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse");
sshlog("monitor.c", __func__, 578, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "got parameters: %d %d %d", min, want, max);
if (max < min || want < min || max < want)
sshfatal("monitor.c", __func__, 581, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "bad parameters: %d %d %d", min, want, max);
sshbuf_reset(m);
dh = choose_dh(min, want, max);
if (dh ==
((void *)0)
) {
if ((r = sshbuf_put_u8(m, 0)) != 0)
sshfatal("monitor.c", __func__, 588, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble empty");
return (0);
} else {
DH_get0_pqg(dh, &dh_p,
((void *)0)
, &dh_g);
if ((r = sshbuf_put_u8(m, 1)) != 0 ||
(r = sshbuf_put_bignum2(m, dh_p)) != 0 ||
(r = sshbuf_put_bignum2(m, dh_g)) != 0)
sshfatal("monitor.c", __func__, 596, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble");
DH_free(dh);
}
mm_request_send(sock, MONITOR_ANS_MODULI, m);
return (0);
}
| undefined8 mm_answer_moduli(undefined8 param_1,undefined4 param_2,undefined8 param_3)
{
undefined8 uVar1;
long in_FS_OFFSET;
undefined8 uVar2;
uint local_38;
uint local_34;
uint local_30;
int local_2c;
undefined8 local_28;
undefined8 local_20;
DH *local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_2c = sshbuf_get_u32(param_3,&local_38);
if (((local_2c != 0) || (local_2c = sshbuf_get_u32(param_3,&local_34), local_2c != 0)) ||
(local_2c = sshbuf_get_u32(param_3,&local_30), local_2c != 0)) {
uVar2 = 0x1010a0;
uVar1 = ssh_err(local_2c);
sshfatal("monitor.c","mm_answer_moduli",0x240,1,1,uVar1,"parse",uVar2);
}
sshlog("monitor.c","mm_answer_moduli",0x242,1,7,0,"got parameters: %d %d %d",local_38,local_34,
local_30);
if (((local_38 <= local_30) && (local_38 <= local_34)) && (local_34 <= local_30)) {
sshbuf_reset(param_3);
local_18 = (DH *)choose_dh(local_38,local_34,local_30);
if (local_18 == (DH *)0x0) {
local_2c = sshbuf_put_u8(param_3,0);
if (local_2c != 0) {
uVar2 = 0x1011ce;
uVar1 = ssh_err(local_2c);
sshfatal("monitor.c","mm_answer_moduli",0x24c,1,1,uVar1,"assemble empty",uVar2);
}
}
else {
DH_get0_pqg(local_18,&local_28,0,&local_20);
local_2c = sshbuf_put_u8(param_3,1);
if (((local_2c != 0) || (local_2c = sshbuf_put_bignum2(param_3,local_28), local_2c != 0)) ||
(local_2c = sshbuf_put_bignum2(param_3,local_20), local_2c != 0)) {
uVar2 = 0x101287;
uVar1 = ssh_err(local_2c);
sshfatal("monitor.c","mm_answer_moduli",0x254,1,1,uVar1,"assemble",uVar2);
}
DH_free(local_18);
mm_request_send(param_2,1,param_3);
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return 0;
}
__stack_chk_fail();
}
sshfatal("monitor.c","mm_answer_moduli",0x245,1,1,0,"bad parameters: %d %d %d",local_38,local_34,
local_30);
}
|
static const char * get_moduli_filename(void)
{
return moduli_filename ? moduli_filename : "/usr/local/etc" "/moduli";
}
| int get_moduli_filename() {
unsigned int v1;
if (moduli_filename)
v1 = moduli_filename;
else
v1 = &g_401210;
return v1;
}
|
static size_t
quote_name (char const *name, struct quoting_options const *options,
int needs_general_quoting, const struct bin_str *color,
_Bool
allow_pad, struct obstack *stack, char const *absolute_name)
{
char smallbuf[
8192
];
char *buf = smallbuf;
size_t len;
_Bool
pad;
len = quote_name_buf (&buf, sizeof smallbuf, (char *) name, options,
needs_general_quoting,
((void *)0)
, &pad);
if (pad && allow_pad)
dired_outbyte (' ');
if (color)
print_color_indicator (color);
_Bool
skip_quotes =
0
;
if (absolute_name)
{
if (align_variable_outer_quotes && cwd_some_quoted && ! pad)
{
skip_quotes =
1
;
putchar_unlocked (*buf);
}
char *h = file_escape (hostname,
0
);
char *n = file_escape (absolute_name,
1
);
printf ("\033]8;;file:
free (h);
free (n);
}
if (stack)
push_current_dired_pos (stack);
fwrite_unlocked (buf + skip_quotes,1,len - (skip_quotes * 2),
stdout
);
dired_pos += len;
if (stack)
push_current_dired_pos (stack);
if (absolute_name)
{
fputs_unlocked ("\033]8;;\a",
stdout
);
if (skip_quotes)
putchar_unlocked (*(buf + len - 1));
}
if (buf != smallbuf && buf != name)
free (buf);
return len + pad;
}
| long quote_name(char *param_1,undefined8 param_2,undefined4 param_3,long param_4,char param_5,
long param_6,long param_7)
{
undefined *puVar1;
long in_FS_OFFSET;
byte local_203a;
byte local_2039;
char *local_2038;
long local_2030;
void *local_2028;
char *local_2020;
char local_2018 [8200];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_2038 = local_2018;
local_2030 = quote_name_buf(&local_2038,0x2000,param_1,param_2,param_3,0,&local_203a);
if ((local_203a != 0) && (param_5 != '\0')) {
dired_outbyte();
}
if (param_4 != 0) {
print_color_indicator();
}
local_2039 = 0;
if (param_7 != 0) {
if (((align_variable_outer_quotes != '\0') && (cwd_some_quoted != '\0')) && (local_203a != 1)) {
local_2039 = 1;
putchar_unlocked((int)*local_2038);
}
local_2028 = (void *)file_escape(hostname,0);
local_2020 = (char *)file_escape(param_7,1);
if (*local_2020 == '/') {
puVar1 = &DAT_0010bb1b;
}
else {
puVar1 = &DAT_0010deab;
}
printf("\x1b]8;;file:
free(local_2028);
free(local_2020);
}
if (param_6 != 0) {
push_current_dired_pos(param_6);
}
fwrite_unlocked(local_2038 + local_2039,1,local_2030 - (int)((uint)local_2039 * 2),stdout);
dired_pos = local_2030 + dired_pos;
if (param_6 != 0) {
push_current_dired_pos(param_6);
}
if (param_7 != 0) {
fputs_unlocked("\x1b]8;;\a",stdout);
if (local_2039 != 0) {
putchar_unlocked((int)local_2038[local_2030 + -1]);
}
}
if ((local_2038 != local_2018) && (param_1 != local_2038)) {
free(local_2038);
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return local_2030 + (ulong)local_203a;
}
|
void
__new_obj_p_here(int magic, void *here)
{
obj_prefix *obj_p = here;
obj_p->p_magic = (long)magic;
obj_p->p_flags = 0;
}
| void __new_obj_p_here(undefined2 param_1,undefined2 *param_2)
{
*param_2 = param_1;
param_2[1] = 0;
return;
}
|
BUCKET_CONTENTS *
hash_search (string, table, flags)
const char *string;
HASH_TABLE *table;
int flags;
{
BUCKET_CONTENTS *list;
int bucket;
unsigned int hv;
if (table == 0 || ((flags & 0x02) == 0 && ((table) ? (table)->nentries : 0) == 0))
return (BUCKET_CONTENTS *)
((void *)0)
;
bucket = (((hv) = hash_string (string)) & ((table)->nbuckets - 1));
for (list = table->bucket_array ? table->bucket_array[bucket] : 0; list; list = list->next)
{
if (hv == list->khash && ((list->key)[0] == (string)[0] && strcmp(list->key, string) == 0))
{
list->times_found++;
return (list);
}
}
if (flags & 0x02)
{
if (((table)->nentries >= (table)->nbuckets * 2))
{
hash_grow (table);
bucket = (((hv) = hash_string (string)) & ((table)->nbuckets - 1));
}
list = (BUCKET_CONTENTS *)sh_xmalloc((sizeof (BUCKET_CONTENTS)), "hashlib.c", 280);
list->next = table->bucket_array[bucket];
table->bucket_array[bucket] = list;
list->data =
((void *)0)
;
list->key = (char *)string;
list->khash = hv;
list->times_found = 0;
table->nentries++;
return (list);
}
return (BUCKET_CONTENTS *)
((void *)0)
;
}
| int hash_search(char *a0, struct_0 *a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
void* v2;
unsigned int v4;
if (a1 && (a1->field_c || (a2 & 2))) {
v1 = hash_string(a0);
v0 = a1->field_8 - 1 & v1;
if (a1->field_0)
v4 = *((a1->field_0 + v0 * 8));
else
v4 = 0;
v2 = v4;
while (true) {
if (v2) {
if (v1 == v2[24] && *(v2[8]) == *(a0)) {
v4 = strcmp(v2[8], a0);
if (!v4) {
*(&v2[28]) = v2[28] + 1;
v4 = v2;
break;
}
}
if (*(v2[8]) != *(a0) || v4 || v1 != v2[24])
v2 = *(v2);
} else if ((a2 & 2)) {
if (a1->field_c >= a1->field_8 << 1) {
hash_grow(a1);
v1 = hash_string(a0);
v0 = a1->field_8 - 1 & v1;
}
v2 = sh_xmalloc(0x20, "hashlib.c", 0x118);
v2->field_0 = *((a1->field_0 + v0 * 8));
*((v0 * 8 + a1->field_0)) = v2;
v2->field_10 = 0;
v2->field_8 = a0;
v2->field_18 = v1;
*(&v2[28]) = 0;
a1->field_c = a1->field_c + 1;
v4 = v2;
break;
} else {
v4 = 0;
break;
}
}
}
if (!a1 || !a1->field_c && !(a2 & 2))
v4 = 0;
return v4;
}
|
int add_pid_to_q(PIDQ_HEAD *q, PROC *p)
{
PIDQ *tmp;
tmp = (PIDQ *)xmalloc(sizeof(PIDQ));
tmp->proc = p;
tmp->next =
((void *)0)
;
if (empty_q(q)) {
q->head = tmp;
q->tail = tmp;
} else {
q->tail->next = tmp;
q->tail = tmp;
}
return 0;
}
| void add_pid_to_q(struct_0 *a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v0[2];
void* v3;
v0[0] = xmalloc(0x10, a1, a2, a3, a4, a5);
v0[0] = a1;
v0[1] = 0;
if (empty_q(a0)) {
a0->field_0 = v0;
a0->field_8 = &v0[0];
} else {
a0->field_8->field_8 = v0;
a0->field_8 = &v0[0];
}
v3 = 0;
return;
}
|
static int mptcp_monitor(void)
{
if (genl_add_mcast_grp(&genl_rth, genl_family, "mptcp_pm_events") < 0) {
perror("can't subscribe to mptcp events");
return 1;
}
if (rtnl_listen(&genl_rth, mptcp_monitor_msg,
stdout
) < 0)
return 2;
return 0;
}
| long mptcp_monitor()
{
if ( (int)genl_add_mcast_grp(&genl_rth, (unsigned short)genl_family, "mptcp_pm_events") >= 0 )
{
if ( (int)rtnl_listen(&genl_rth, mptcp_monitor_msg, stdout) >= 0 )
return 0LL;
else
return 2LL;
}
else
{
perror("can't subscribe to mptcp events");
return 1LL;
}
}
|
static void
mm_chall_setup(char **name, char **infotxt, u_int *numprompts,
char ***prompts, u_int **echo_on)
{
*name = xstrdup("");
*infotxt = xstrdup("");
*numprompts = 1;
*prompts = xcalloc(*numprompts, sizeof(char *));
*echo_on = xcalloc(*numprompts, sizeof(u_int));
(*echo_on)[0] = 0;
}
| void mm_chall_setup(undefined8 *param_1,undefined8 *param_2,undefined4 *param_3,undefined8 *param_4,
undefined8 *param_5)
{
undefined8 uVar1;
uVar1 = xstrdup(&DAT_00103f89);
*param_1 = uVar1;
uVar1 = xstrdup(&DAT_00103f89);
*param_2 = uVar1;
*param_3 = 1;
uVar1 = xcalloc(*param_3,8);
*param_4 = uVar1;
uVar1 = xcalloc(*param_3,4);
*param_5 = uVar1;
*(undefined4 *)*param_5 = 0;
return;
}
|
int
main (int argc, char **argv)
{
_Bool
have_tabval =
0
;
uintmax_t tabval ;
int c;
_Bool
convert_first_only =
0
;
;
set_program_name (argv[0]);
setlocale (
6
, "");
bindtextdomain ("coreutils", "/usr/local/share/locale");
textdomain ("coreutils");
atexit (close_stdout);
while ((c = getopt_long (argc, argv, ",0123456789at:", longopts,
((void *)0)
))
!= -1)
{
switch (c)
{
case '?':
usage (
1
);
case 'a':
convert_entire_line =
1
;
break;
case 't':
convert_entire_line =
1
;
parse_tab_stops (optarg);
break;
case CONVERT_FIRST_ONLY_OPTION:
convert_first_only =
1
;
break;
case ',':
if (have_tabval)
add_tab_stop (tabval);
have_tabval =
0
;
break;
case GETOPT_HELP_CHAR: usage (
0
); break;;
case GETOPT_VERSION_CHAR: version_etc (
stdout
, "unexpand", "GNU coreutils", Version, ("David MacKenzie"), (char *)
((void *)0)
); exit (
0
); break;;
default:
if (!have_tabval)
{
tabval = 0;
have_tabval =
1
;
}
if (!( (void) (&(tabval) == (uintmax_t *)
((void *)0)
), ((!!sizeof (struct { _Static_assert (! (! ((uintmax_t) 0 < (uintmax_t) -1)), "verify_expr (" "! TYPE_SIGNED (uintmax_t)" ", " "(((uintmax_t) -1 / 10 < (tabval) || (uintmax_t) ((tabval) * 10 + (c - '0')) < (tabval)) ? false : (((tabval) = (tabval) * 10 + (c - '0')), true))" ")"); int _gl_dummy; })) ? ((((uintmax_t) -1 / 10 < (tabval) || (uintmax_t) ((tabval) * 10 + (c - '0')) < (tabval)) ?
0
: (((tabval) = (tabval) * 10 + (c - '0')),
1
))) : ((((uintmax_t) -1 / 10 < (tabval) || (uintmax_t) ((tabval) * 10 + (c - '0')) < (tabval)) ?
0
: (((tabval) = (tabval) * 10 + (c - '0')),
1
)))) ))
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"tab stop value is too large\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("tab stop value is too large")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("tab stop value is too large")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
break;
}
}
if (convert_first_only)
convert_entire_line =
0
;
if (have_tabval)
add_tab_stop (tabval);
finalize_tab_stops ();
set_file_list ((optind < argc) ? &argv[optind] :
((void *)0)
);
unexpand ();
cleanup_file_list_stdin ();
return exit_status;
}
| int main(int argc, const char **argv, const char **envp)
{
char v3;
char *v4;
const char **v5;
char v7;
char v8;
int v9;
unsigned long v10;
v7 = 0;
v8 = 0;
set_program_name(*argv, argv, envp);
setlocale(6, locale);
bindtextdomain("coreutils", "/usr/local/share/locale");
textdomain("coreutils");
atexit((void (*)(void))&close_stdout);
while ( 1 )
{
v9 = getopt_long(argc, (char *const *)argv, ",0123456789at:", &longopts, 0LL);
if ( v9 == -1 )
break;
if ( v9 == 128 )
{
v8 = 1;
}
else
{
if ( v9 > 128 )
goto LABEL_24;
if ( v9 == 116 )
{
convert_entire_line = 1;
parse_tab_stops(optarg);
}
else
{
if ( v9 > 116 )
goto LABEL_24;
if ( v9 == 97 )
{
convert_entire_line = 1;
}
else
{
if ( v9 > 97 )
goto LABEL_24;
if ( v9 == 63 )
usage(1);
if ( v9 > 63 )
{
LABEL_24:
if ( v7 != 1 )
{
v10 = 0LL;
v7 = 1;
}
if ( v10 > 0x1999999999999999LL || v9 - 48 + 10 * v10 < v10 )
{
v3 = 1;
}
else
{
v10 = 10 * v10 + v9 - 48;
v3 = 0;
}
if ( v3 )
{
v4 = gettext("tab stop value is too large");
error(1, 0, v4);
}
}
else
{
if ( v9 != 44 )
{
if ( v9 <= 44 )
{
if ( v9 == -131 )
{
version_etc(stdout, "unexpand", "GNU coreutils", Version, "David MacKenzie", 0LL);
exit(0);
}
if ( v9 == -130 )
usage(0);
}
goto LABEL_24;
}
if ( v7 )
add_tab_stop(v10);
v7 = 0;
}
}
}
}
}
if ( v8 )
convert_entire_line = 0;
if ( v7 )
add_tab_stop(v10);
finalize_tab_stops();
if ( argc <= optind )
v5 = 0LL;
else
v5 = &argv[optind];
set_file_list(v5);
unexpand();
cleanup_file_list_stdin();
return exit_status;
}
|
void
rl_callback_handler_install(const char *prompt, rl_vcpfunc_t *linefunc)
{
if (e ==
((void *)0)
) {
rl_initialize();
}
(void)rl_set_prompt(prompt);
rl_linefunc = linefunc;
el_set(e, 15, 1);
}
| long long rl_callback_handler_install(char *a0, unsigned long a1) {
if (!e)
rl_initialize();
rl_set_prompt(a0);
*(got.rl_linefunc) = a1;
return el_set(e, 0xf, 0x1);
}
|
static void
dispose_mail_file (mf)
FILEINFO *mf;
{
sh_xfree((mf->name), "mailcheck.c", 228);
do { if (mf->msg) sh_xfree((mf->msg), "mailcheck.c", 229); } while (0);
sh_xfree((mf), "mailcheck.c", 230);
}
| void dispose_mail_file(unsigned long long a0[2]) {
unsigned long long v1;
sh_xfree(a0[0], "mailcheck.c", 0xe4);
if (a0[1])
sh_xfree(a0[1], "mailcheck.c", 0xe5);
v1 = sh_xfree(a0, "mailcheck.c", 0xe6);
return;
}
|
_Bool
pred_executable (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
(void) pathname;
(void) stat_buf;
(void) pred_ptr;
return 0 == faccessat (state.cwd_dir_fd, state.rel_pathname,
1
, 0);
}
| long long pred_executable(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned long long v4;
v2 = a0;
v1 = a1;
v0 = a2;
v4 = faccessat(__errno_location, strcmp, 0x1, 0x0);
*(&v4) = !v4;
return v4;
}
|
static gnutls_x509_crl_t
generate_crl(gnutls_x509_crt_t ca_crt, common_info_st * cinfo)
{
gnutls_x509_crl_t crl;
gnutls_x509_crt_t *crts;
gnutls_x509_crl_t *crls;
size_t size, crl_size;
int result;
unsigned int i;
time_t secs, this_update, exp;
crls = load_crl_list(0, &crl_size, cinfo);
if (crls !=
((void *)0)
) {
if (crl_size > 1) {
fprintf(
stderr
, "load_crl: too many CRLs present\n");
app_exit(1);
}
crl = crls[0];
gnutls_free((void *) (crls)), crls=
((void *)0)
;
} else {
result = gnutls_x509_crl_init(&crl);
if (result < 0) {
fprintf(
stderr
, "crl_init: %s\n", gnutls_strerror(result));
app_exit(1);
}
}
crts = load_cert_list(0, &size, cinfo);
exp = get_crl_revocation_date();
for (i = 0; i < size; i++) {
result = gnutls_x509_crl_set_crt(crl, crts[i], exp);
if (result < 0) {
fprintf(
stderr
, "crl_set_crt: %s\n",
gnutls_strerror(result));
app_exit(1);
}
gnutls_x509_crt_deinit(crts[i]);
}
gnutls_free((void *) (crts)), crts=
((void *)0)
;
this_update = get_crl_this_update_date();
result = gnutls_x509_crl_set_this_update(crl, this_update);
if (result < 0) {
fprintf(
stderr
, "this_update: %s\n",
gnutls_strerror(result));
app_exit(1);
}
secs = get_crl_next_update();
result =
gnutls_x509_crl_set_next_update(crl, secs);
if (result < 0) {
fprintf(
stderr
, "next_update: %s\n",
gnutls_strerror(result));
app_exit(1);
}
result = gnutls_x509_crl_set_version(crl, 2);
if (result < 0) {
fprintf(
stderr
, "set_version: %s\n",
gnutls_strerror(result));
app_exit(1);
}
if (ca_crt !=
((void *)0)
) {
size = lbuffer_size;
result = gnutls_x509_crt_get_subject_key_id(ca_crt, lbuffer,
&size,
((void *)0)
);
if (result >= 0) {
result =
gnutls_x509_crl_set_authority_key_id(crl,
lbuffer,
size);
if (result < 0) {
fprintf(
stderr
, "set_authority_key_id: %s\n",
gnutls_strerror(result));
app_exit(1);
}
}
}
{
size_t serial_size;
unsigned char serial[20];
serial_size = sizeof(serial);
get_crl_number(serial, &serial_size);
result = gnutls_x509_crl_set_number(crl, serial, serial_size);
if (result < 0) {
fprintf(
stderr
, "error setting CRL serial: %s\n",
gnutls_strerror(result));
app_exit(1);
}
}
return crl;
}
| int generate_crl(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
unsigned long long v2;
char v3;
char v4;
unsigned long long v5;
unsigned long long *v6;
unsigned long long *v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
char v11;
v6 = load_crl_list(0x0, &v4, a1);
if (!v6) {
v1 = gnutls_x509_crl_init(&v2);
if (v1 < 0) {
fprintf(*(&stderr), "crl_init: %s\n", gnutls_strerror(v1));
app_exit(0x1);
}
} else if (*(&v4) <= 1) {
v2 = *(v6);
*(5243720)(v6);
v6 = 0;
} else {
fprintf(*(&stderr), "load_crl: too many CRLs present\n");
app_exit(0x1);
}
v7 = load_cert_list(0x0, &v3, a1);
v8 = get_crl_revocation_date(0x0, &v3, a2, a3, a4, a5);
for (v0 = 0; v0 < *(&v3); v0 += 1) {
v1 = gnutls_x509_crl_set_crt(v2, v7[v0], v8, v7[v0]);
if (v1 < 0) {
fprintf(*(&stderr), "crl_set_crt: %s\n", gnutls_strerror(v1));
app_exit(0x1);
}
gnutls_x509_crt_deinit(v7[v0]);
}
gnutls_free(v7);
v7 = 0;
v9 = get_crl_this_update_date(a0, a1, gnutls_free, a3, a4, a5);
v1 = gnutls_x509_crl_set_this_update(v2, v9, v9);
if (v1 < 0) {
fprintf(*(&stderr), "this_update: %s\n", gnutls_strerror(v1));
app_exit(0x1);
}
v10 = get_crl_next_update();
v1 = gnutls_x509_crl_set_next_update(v2, v10, v10);
if (v1 < 0) {
fprintf(*(&stderr), "next_update: %s\n", gnutls_strerror(v1));
app_exit(0x1);
}
v1 = gnutls_x509_crl_set_version(v2, 0x2);
if (v1 < 0) {
fprintf(*(&stderr), "set_version: %s\n", gnutls_strerror(v1));
app_exit(0x1);
}
if (a0) {
v3 = lbuffer_size;
v1 = gnutls_x509_crt_get_subject_key_id(a0, lbuffer, &v3, 0x0);
if (v1 >= 0) {
v1 = gnutls_x509_crl_set_authority_key_id(v2, lbuffer, v3, lbuffer);
if (v1 < 0) {
fprintf(*(&stderr), "set_authority_key_id: %s\n", gnutls_strerror(v1));
app_exit(0x1);
}
}
}
v5 = 20;
get_crl_number(&v11, &v5, &v5);
v1 = gnutls_x509_crl_set_number(v2, &v11, v5, &v11);
if (v1 >= 0)
return v2;
fprintf(*(&stderr), "error setting CRL serial: %s\n", gnutls_strerror(v1));
app_exit(0x1);
}
|
static unsigned decode_c()
{
unsigned j, mask;
if (blocksize == 0) {
blocksize = getbits(16);
if (blocksize == 0) {
return (255 + 256 + 2 - 3);
}
read_pt_len((16 + 3), 5, 3);
read_c_len();
read_pt_len((13 + 1), 4, -1);
}
blocksize--;
j = d_buf[bitbuf >> ((8 * 2 * sizeof(char)) - 12)];
if (j >= (255 + 256 + 2 - 3)) {
mask = (unsigned) 1 << ((8 * 2 * sizeof(char)) - 1 - 12);
do {
if (bitbuf & mask) j = (prev+0x8000)[j];
else j = prev [j];
mask >>= 1;
} while (j >= (255 + 256 + 2 - 3));
}
fillbuf((int) outbuf[j]);
return j;
}
| int decode_c() {
unsigned int v0;
unsigned int v1;
unsigned int v3;
if (false) {
read_pt_len(0x13, 0x5, 0x3);
read_c_len();
read_pt_len(0xe, 0x4, 0xffffffff);
}
if (!blocksize) {
blocksize = getbits(0x10);
v3 = 510;
} else {
blocksize = blocksize - 1;
v0 = *((2 * (bitbuf >> 4) + &d_buf));
if (v0 > 509) {
v1 = 8;
do {
if ((bitbuf & v1))
v0 = *(&(&prev)[0x10000 + 2 * v0]);
else
v0 = *(&(&prev)[2 * v0]);
v1 >>= 1;
} while (v0 > 509);
}
fillbuf(*(v0 + &outbuf));
v3 = v0;
}
return v3;
}
|
static void
sighandler (int sig)
{
if (!
1
)
signal (sig,
((__sighandler_t) 1)
);
cleanup ();
signal (sig,
((__sighandler_t) 0)
);
raise (sig);
}
| long long sighandler(unsigned long a0) {
cleanup();
signal(a0, 0x0);
return raise(a0);
}
|
static inline struct dirent const *
readdir_ignoring_dot_and_dotdot (DIR *dirp)
{
while (
1
)
{
struct dirent const *dp = readdir (dirp);
if (dp ==
((void *)0)
|| ! dot_or_dotdot (dp->d_name))
return dp;
}
}
| int readdir_ignoring_dot_and_dotdot(unsigned long long a0) {
unsigned long v0;
while (true) {
v0 = readdir(a0);
if (!v0) {
return v0;
} else if ((dot_or_dotdot(v0 + 19) ^ 1)) {
return v0;
}
}
}
|
static int save_route(struct nlmsghdr *n, void *arg)
{
int ret;
int len = n->nlmsg_len;
struct rtmsg *r = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
struct rtattr *tb[(__RTA_MAX - 1)+1];
int host_len;
host_len = af_bit_len(r->rtm_family);
len -= ((sizeof(*r)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )));
parse_rtattr(tb, (__RTA_MAX - 1), ((struct rtattr*)(((char*)(r)) + ( ((sizeof(struct rtmsg))+4U -1) & ~(4U -1) ))), len);
if (!filter_nlmsg(n, tb, host_len))
return 0;
ret = write(
1
, n, n->nlmsg_len);
if ((ret > 0) && (ret != n->nlmsg_len)) {
fprintf(
stderr
, "Short write while saving nlmsg\n");
ret = -
5
;
}
return ret == n->nlmsg_len ? 0 : ret;
}
| long long save_route(unsigned int *a0, unsigned long a1) {
unsigned long v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
char *v4;
char v5;
void* v7;
v0 = a1;
v2 = *(a0);
v4 = &a0[4];
v3 = af_bit_len(*(v4));
v2 -= 28;
parse_rtattr(&v5, 0x1e, v4 + 12, v2);
if (!filter_nlmsg(a0, &v5, v3)) {
v7 = 0;
return v7;
}
v1 = write(0x1, a0, *(a0));
if (v1 > 0 && *(a0) != v1) {
fprintf(stderr, "Short write while saving nlmsg\n");
v1 = -5;
}
v7 = (*(a0) == v1 ? v1 : 0);
return v7;
}
|
0
)
do { fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
| int fprintf(FILE *__stream,char *__format,...)
{
halt_baddata();
}
|
static void
sshsk_free_resident_key(struct sshsk_resident_key *srk)
{
if (srk ==
((void *)0)
)
return;
sshkey_free(srk->key);
freezero(srk->user_id, srk->user_id_len);
free(srk);
}
| void sshsk_free_resident_key(unsigned long long a0[3]) {
unsigned long long v1;
if (a0) {
sshkey_free(a0[0]);
freezero(a0[1], a0[2], a0[2]);
v1 = free(a0);
}
return;
}
|
static int
noninc_search_from_pos (char *string, int pos, int dir, int flags, int *ncp)
{
int ret, old, sflags;
char *s;
if (pos < 0)
return -1;
old = where_history ();
if (history_set_pos (pos) == 0)
return -1;
(rl_readline_state |= (0x0000200));
if (flags & 0x10)
{
s = string;
sflags = 0;
if (*s == '^')
{
sflags |= 0x01;
s++;
}
ret = _hs_history_patsearch (s, dir, sflags);
}
else if (*string == '^')
ret = history_search_prefix (string + 1, dir);
else
ret = history_search (string, dir);
(rl_readline_state &= ~(0x0000200));
if (ncp)
*ncp = ret;
if (ret != -1)
ret = where_history ();
history_set_pos (old);
return (ret);
}
| int noninc_search_from_pos(char *param_1,int param_2,undefined4 param_3,uint param_4,int *param_5)
{
undefined4 uVar1;
int iVar2;
int local_1c;
char *local_10;
if (param_2 < 0) {
local_1c = -1;
}
else {
uVar1 = where_history();
iVar2 = history_set_pos(param_2);
if (iVar2 == 0) {
local_1c = -1;
}
else {
rl_readline_state = rl_readline_state | 0x200;
if ((param_4 & 0x10) == 0) {
if (*param_1 == '^') {
local_1c = history_search_prefix(param_1 + 1,param_3);
}
else {
local_1c = history_search(param_1,param_3);
}
}
else {
local_10 = param_1;
if (*param_1 == '^') {
local_10 = param_1 + 1;
}
local_1c = _hs_history_patsearch(local_10,param_3,*param_1 == '^');
}
rl_readline_state = rl_readline_state & 0xfffffffffffffdff;
if (param_5 != (int *)0x0) {
*param_5 = local_1c;
}
if (local_1c != -1) {
local_1c = where_history();
}
history_set_pos(uVar1);
}
}
return local_1c;
}
|
const char *get_challenge_pass(void)
{
if (batch && !ask_pass)
return cfg.challenge_password;
else
return getpass("Enter a challenge password: ");
}
| char *get_challenge_pass()
{
if ( !batch || ask_pass )
return getpass("Enter a challenge password: ");
else
return *(char **)&cfg[22];
}
|
static int
_rl_insert_next_callback (_rl_callback_generic_arg *data)
{
int count, r;
count = data->count;
r = 0;
if (count < 0)
{
data->count++;
r = _rl_insert_next (1);
_rl_want_redisplay = 1;
if (data->count < 0 && r == 0)
return r;
count = 0;
}
_rl_callback_func = 0;
_rl_want_redisplay = 1;
if (count == 0)
return r;
return _rl_insert_next (count);
}
| long long _rl_insert_next_callback(unsigned int *a0) {
unsigned int v0;
unsigned int v1;
unsigned long long v3;
v0 = *(a0);
v1 = 0;
if (v0 < 0) {
*(a0) = *(a0) + 1;
v1 = _rl_insert_next(0x1);
_rl_want_redisplay = 1;
if (*(a0) < 0 && !v1) {
v3 = v1;
return v3;
}
v0 = 0;
}
_rl_callback_func = 0;
_rl_want_redisplay = 1;
if (!v0) {
v3 = v1;
return v3;
}
v3 = _rl_insert_next(v0);
return v3;
}
|
void
platform_setusercontext(struct passwd *pw)
{
}
| long long platform_setusercontext(unsigned long a0) {
unsigned long v0;
unsigned long v2;
v0 = a0;
return v2;
}
|
static int
history_def_del(void *p, HistEvent *ev __attribute__((__unused__)),
const int num)
{
history_t *h = (history_t *) p;
if (history_def_set(h, ev, num) != 0)
return -1;
ev->str = strdup(h->cursor->ev.str);
ev->num = h->cursor->ev.num;
history_def_delete(h, ev, h->cursor);
return 0;
}
| long long history_def_del(struct_0 *a0, struct_1 *a1, unsigned long a2) {
unsigned long long v1;
if (history_def_set(a0, a1, a2)) {
v1 = 4294967295;
} else {
a1->field_8 = strdup(a0->field_28->field_8);
a1->field_0 = a0->field_28->field_0;
history_def_delete(a0, a1, a0->field_28);
v1 = 0;
}
return v1;
}
|
void
freezero(void *ptr, size_t sz)
{
if (ptr ==
((void *)0)
)
return;
explicit_bzero(ptr, sz);
free(ptr);
}
| void freezero(void *a1, long a2)
{
if ( a1 )
{
explicit_bzero(a1, a2);
free(a1);
}
}
|
static void
add_fifo_list (fd)
int fd;
{
if (dev_fd_list == 0 || fd >= totfds)
{
int ofds;
ofds = totfds;
totfds = getdtablesize ();
if (totfds < 0 || totfds > 256)
totfds = 256;
if (fd >= totfds)
totfds = fd + 2;
dev_fd_list = (pid_t *)sh_xrealloc((dev_fd_list), (totfds * sizeof (dev_fd_list[0])), "subst.c", 6280);
memset (dev_fd_list + ofds, '\0', (totfds - ofds) * sizeof (pid_t));
}
dev_fd_list[fd] = 1;
nfds++;
}
| long add_fifo_list(int a1)
{
int v2;
if ( !dev_fd_list || a1 >= totfds )
{
v2 = totfds;
totfds = getdtablesize();
if ( (unsigned int)totfds >= 0x101 )
totfds = 256;
if ( a1 >= totfds )
totfds = a1 + 2;
dev_fd_list = (void *)sh_xrealloc(dev_fd_list, 4LL * totfds, "subst.c", 6280LL);
memset((char *)dev_fd_list + 4 * v2, 0, 4LL * (totfds - v2));
}
*((_DWORD *)dev_fd_list + a1) = 1;
return (unsigned int)++nfds;
}
|
char *
remove_quoted_escapes (string)
char *string;
{
char *t;
if (string)
{
t = dequote_escapes (string);
strcpy (string, t);
sh_xfree((t), "subst.c", 4983);
}
return (string);
}
| char * remove_quoted_escapes(char *a1)
{
const char *src;
if ( a1 )
{
src = dequote_escapes(a1);
strcpy(a1, src);
sh_xfree(src, "subst.c", 4983LL);
}
return a1;
}
|
static void open_files (void)
{
if (pw_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, pw_dbname ());
fail_exit (1);
}
pw_locked =
1
;
if (pw_open (
0100
|
02
) == 0) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"), Prog, pw_dbname ());
fail_exit (1);
}
if (is_shadow_pwd) {
if (spw_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, spw_dbname ());
fail_exit (1);
}
spw_locked =
1
;
if (spw_open (
0100
|
02
) == 0) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"),
Prog, spw_dbname ());
fail_exit (1);
}
}
}
| void open_files() {
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
if (!pw_lock()) {
v3 = pw_dbname();
fprintf(*(&stderr), gettext("%s: cannot lock %s; try again later.\n"));
fail_exit(0x1);
}
pw_locked = 1;
if (!pw_open(0x42)) {
v6 = pw_dbname();
fprintf(*(&stderr), gettext("%s: cannot open %s\n"));
fail_exit(0x1);
}
v4 = is_shadow_pwd;
if (is_shadow_pwd) {
v5 = spw_lock();
if (!v5) {
v8 = spw_dbname();
fprintf(*(&stderr), gettext("%s: cannot lock %s; try again later.\n"));
fail_exit(0x1);
}
spw_locked = 1;
v7 = spw_open(0x42);
if (!v7) {
v9 = spw_dbname();
fprintf(*(&stderr), gettext("%s: cannot open %s\n"));
fail_exit(0x1);
}
}
if (!is_shadow_pwd || v7 && v5)
return;
}
|
static void
pr_sgr_end (char const *s)
{
if (*s)
print_end_colorize (sgr_end);
}
| long pr_sgr_end(unsigned char *a1)
{
long result;
result = *a1;
if ( (_BYTE)result )
return print_end_colorize(sgr_end);
return result;
}
|
static void
visit (FTS *p, FTSENT *ent, struct stat *pstat)
{
struct predicate *eval_tree;
state.have_stat = (ent->fts_info != 10) && (ent->fts_info != 11);
state.rel_pathname = ent->fts_accpath;
state.cwd_dir_fd = p->fts_cwd_fd;
eval_tree = get_eval_tree ();
apply_predicate (ent->fts_path, pstat, eval_tree);
if (state.stop_at_current_level)
{
rpl_fts_set (p, ent, 4);
}
}
| long visit(long a1, long a2, long a3)
{
bool v3;
long result;
long eval_tree;
v3 = *(_WORD *)(a2 + 104) != 10 && *(_WORD *)(a2 + 104) != 11;
LOBYTE(state[1]) = v3;
*(_QWORD *)&state[4] = *(_QWORD *)(a2 + 48);
state[6] = *(_DWORD *)(a1 + 44);
eval_tree = get_eval_tree();
apply_predicate(*(_QWORD *)(a2 + 56), a3, eval_tree);
result = LOBYTE(state[8]);
if ( (_BYTE)result )
return rpl_fts_set(a1, a2, 4LL);
return result;
}
|
static int
restorecon_private (struct selabel_handle *selabel_handle, char const *path)
{
int rc = -1;
struct stat sb;
char *scon =
((void *)0)
;
char *tcon =
((void *)0)
;
context_t scontext = 0, tcontext = 0;
char const *contype;
char *constr;
int fd;
if (!selabel_handle)
{
if (getfscreatecon (&tcon) < 0)
return rc;
if (!tcon)
{
(*__errno_location ())
=
61
;
return rc;
}
rc = lsetfilecon (path, tcon);
int err =
(*__errno_location ())
;
freecon (tcon);
(*__errno_location ())
= err;
return rc;
}
fd = open (path,
00
|
0400000
);
if (fd == -1 && (
(*__errno_location ())
!=
40
))
goto quit;
if (fd != -1)
{
if (fstat (fd, &sb) < 0)
goto quit;
}
else
{
if (lstat (path, &sb) < 0)
goto quit;
}
if (selabel_lookup (selabel_handle, &scon, path, sb.st_mode) < 0)
{
if (
(*__errno_location ())
==
2
)
(*__errno_location ())
=
61
;
goto quit;
}
if (!(scontext = context_new (scon)))
goto quit;
if (fd != -1)
{
if (rpl_fgetfilecon (fd, &tcon) < 0)
goto quit;
}
else
{
if (rpl_lgetfilecon (path, &tcon) < 0)
goto quit;
}
if (!(tcontext = context_new (tcon)))
goto quit;
if (!(contype = context_type_get (scontext)))
goto quit;
if (context_type_set (tcontext, contype))
goto quit;
if (!(constr = context_str (tcontext)))
goto quit;
if (fd != -1)
rc = fsetfilecon (fd, constr);
else
rc = lsetfilecon (path, constr);
quit:;
int err =
(*__errno_location ())
;
if (fd != -1)
close (fd);
context_free (scontext);
context_free (tcontext);
freecon (scon);
freecon (tcon);
(*__errno_location ())
= err;
return rc;
}
| int restorecon_private(unsigned long long a0, unsigned long long a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
void* v4;
void* v5;
void* v6;
void* v7;
unsigned long long v8;
unsigned long long v9;
char v10;
char v11;
unsigned int v13;
v0 = -1;
v4 = 0;
v5 = 0;
v6 = 0;
v7 = 0;
if (!a0) {
v13 = getfscreatecon(&v5);
if (v13 < 0) {
v13 = v0;
} else if (!v5) {
*(__errno_location()) = 61;
v13 = v0;
} else {
v0 = lsetfilecon(a1, v5, v5);
v3 = *(__errno_location());
freecon(v5);
*(__errno_location()) = v3;
v13 = v0;
}
} else {
v1 = open(a1, 0x20000, a2);
if (v1 == -1)
v13 = *(__errno_location());
if (v13 == 40 || v1 != -1) {
if (v1 != -1)
v13 = fstat(v1, &v10);
else
v13 = lstat(a1, &v10);
if (v1 == -1 && v13 >= 0 || v1 != -1 && v13 >= 0) {
v13 = selabel_lookup(a0, &v4, a1, *(&v11));
if (v13 < 0) {
v13 = *(__errno_location());
if (v13 == 2)
*(__errno_location()) = 61;
} else {
v6 = context_new(v4);
if (v6) {
if (v1 != -1)
v13 = rpl_fgetfilecon(v1, &v5, &v5);
else
v13 = rpl_lgetfilecon(a1, &v5, &v5);
if (v1 == -1 && v13 >= 0 || v1 != -1 && v13 >= 0) {
v7 = context_new(v5);
if (v7) {
v8 = context_type_get(v6);
if (v8) {
v13 = context_type_set(v7, v8, v8);
if (!v13) {
v9 = context_str(v7);
if (v9) {
if (v1 != -1)
v0 = fsetfilecon(v1, v9, v9);
else
v0 = lsetfilecon(a1, v9, v9);
}
}
}
}
}
}
}
}
}
v13 = *(__errno_location());
v2 = v13;
if (v1 != -1)
close(v1);
context_free(v6);
context_free(v7);
freecon(v4);
freecon(v5);
*(__errno_location()) = v2;
v13 = v0;
}
return v13;
}
|
literal_add(EditLine *el, const wchar_t *buf, const wchar_t *end, int *wp)
{
el_literal_t *l = &el->el_literal;
size_t i, len;
ssize_t w, n;
char *b;
w = wcwidth(end[1]);
*wp = (int)w;
if (w <= 0)
return 0;
len = (size_t)(end - buf);
for (w = 0, i = 0; i < len; i++)
w += ct_enc_width(buf[i]);
w += ct_enc_width(end[1]);
b = malloc((size_t)(w + 1));
if (b ==
((void *)0)
)
return 0;
for (n = 0, i = 0; i < len; i++)
n += ct_encode_char(b + n, (size_t)(w - n), buf[i]);
n += ct_encode_char(b + n, (size_t)(w - n), end[1]);
b[n] = '\0';
if (l->l_idx == l->l_len) {
char **bp;
l->l_len += 4;
bp = realloc(l->l_buf, sizeof(*l->l_buf) * l->l_len);
if (bp ==
((void *)0)
) {
free(b);
l->l_len -= 4;
return 0;
}
l->l_buf = bp;
}
l->l_buf[l->l_idx++] = b;
return ((wint_t)0x80000000) | (wint_t)(l->l_idx - 1);
}
| long long literal_add(unsigned long a0, unsigned long a1, struct_0 *a2, unsigned int *a3) {
void* v0;
int tmp_34;
void* v1;
void* v2;
void* v3;
unsigned long long v4[3];
unsigned long long v5;
char *v6;
unsigned long v7;
void* v9;
unsigned long long *v11;
v0 = a1;
v4[0] = a0 + 848;
v2 = wcwidth(a2->field_4);
*(a3) = v2;
if (v2 <= 0) {
v9 = 0;
return v9;
}
v5 = a2 - v0 >> 2;
v2 = 0;
for (v1 = 0; v1 < v5; v1 += 1) {
v2 = ct_enc_width(*((v0 + 0x4 * v1))) + v2;
}
v2 = ct_enc_width(a2->field_4) + v2;
v6 = malloc(v2 + 1);
if (!v6) {
v9 = 0;
return v9;
}
v3 = 0;
for (v1 = 0; v1 < v5; v1 += 1) {
v3 += ct_encode_char(v3 + v6, v2 - v3, *((v0 + 0x4 * v1)), v3 + v6);
}
v3 = v3 + ct_encode_char(v3 + v6, v2 - v3, a2->field_4, v3 + v6);
*((v6 + v3)) = 0;
if (v4[1] == v4[2]) {
v4[2] = v4[2] + 4;
v7 = realloc(v4[0], v4[2] * 8);
if (!v7) {
free(v6);
v4[2] = v4[2] - 4;
v9 = 0;
return v9;
}
v4[0] = v7;
}
v11 = v4[0];
tmp_34 = v4[1];
v4[1] = v4[1] + 1;
v11[tmp_34] = v6;
v9 = v4[1] - 1 | 0x80000000;
return v9;
}
|
BZFILE * BZ2_bzdopen
( int fd,
const char *mode )
{
return bzopen_or_bzdopen(
((void *)0)
,fd,mode, 1);
}
| _DWORD * BZ2_bzdopen(int a1, _BYTE *a2)
{
return bzopen_or_bzdopen(0LL, a1, a2, 1);
}
|
static int
monitor_allowed_key(const u_char *blob, u_int bloblen)
{
if (key_blob ==
((void *)0)
|| key_bloblen != bloblen ||
timingsafe_bcmp(key_blob, blob, key_bloblen))
return (0);
return (1);
}
| undefined8 monitor_allowed_key(undefined8 param_1,uint param_2)
{
int iVar1;
if (((key_blob != 0) && (param_2 == key_bloblen)) &&
(iVar1 = timingsafe_bcmp(key_blob,param_1,key_bloblen), iVar1 == 0)) {
return 1;
}
return 0;
}
|
static void
process_opendir(u_int32_t id)
{
DIR *dirp =
((void *)0)
;
char *path;
int r, handle, status = 4;
if ((r = sshbuf_get_cstring(iqueue, &path,
((void *)0)
)) != 0)
sshfatal("sftp-server.c", __func__, 1106, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse");
sshlog("sftp-server.c", __func__, 1108, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "request %u: opendir", id);
sshlog("sftp-server.c", __func__, 1109, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "opendir \"%s\"", path);
dirp = opendir(path);
if (dirp ==
((void *)0)
) {
status = errno_to_portable(
(*__errno_location ())
);
} else {
handle = handle_new(HANDLE_DIR, path, 0, 0, dirp);
if (handle < 0) {
closedir(dirp);
} else {
send_handle(id, handle);
status = 0;
}
}
if (status != 0)
send_status(id, status);
free(path);
}
| long long process_opendir(unsigned long a0) {
unsigned long long v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
char v4;
void* v5;
unsigned long long v6;
unsigned long v7;
unsigned long long v8;
unsigned long long v9;
v5 = 0;
v1 = 4;
v2 = sshbuf_get_cstring(0xe87d894820ec8348, &v4, 0x0, &v4);
if (v2) {
v0 = "parse";
sshfatal("sftp-server.c", "process_opendir", 0x452, 0x1, 0x1, ssh_err(v2));
}
v7 = a0;
v6 = "request %u: opendir";
sshlog("sftp-server.c", "process_opendir", 0x454, 0x0, 0x7, 0x0, *(&v8));
v9 = *(&v4);
v8 = "opendir \"%s\"";
sshlog("sftp-server.c", "process_opendir", 0x455, 0x0, 0x3, 0x0, "opendir \"%s\"");
v5 = opendir(*(&v4));
if (!v5) {
v1 = errno_to_portable(*(__errno_location()));
} else {
v3 = handle_new(0x1, *(&v4), 0x0, 0x0, v5);
if (v3 < 0) {
closedir(v5);
} else {
send_handle(a0, v3);
v1 = 0;
}
}
if (v1)
send_status(a0, v1);
free(*(&v4));
return 0;
}
|
int
execute_command (command)
COMMAND *command;
{
struct fd_bitmap *bitmap;
int result;
current_fds_to_close = (struct fd_bitmap *)
((void *)0)
;
bitmap = new_fd_bitmap (32);
begin_unwind_frame ("execute-command");
add_unwind_protect (dispose_fd_bitmap, (char *)bitmap);
result = execute_command_internal (command, 0, -1, -1, bitmap);
dispose_fd_bitmap (bitmap);
discard_unwind_frame ("execute-command");
if (variable_context == 0 && executing_list == 0)
unlink_fifo_list ();
do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0);
return (result);
}
| long long execute_command(void* a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long a5) {
unsigned int v0;
void* v1;
current_fds_to_close = 0;
v1 = new_fd_bitmap(0x20);
begin_unwind_frame("execute-command");
add_unwind_protect(dispose_fd_bitmap, v1);
v0 = execute_command_internal(a0, 0x0, 0xffffffff, 0xffffffff, v1, a5);
dispose_fd_bitmap(v1);
discard_unwind_frame("execute-command");
if (!variable_context && !executing_list)
unlink_fifo_list();
if (terminating_signal)
termsig_handler(terminating_signal);
if (interrupt_state)
throw_to_top_level();
return v0;
}
|
static int
pkcs11_rsa_private_encrypt(int flen, const u_char *from, u_char *to, RSA *rsa,
int padding)
{
struct pkcs11_key *k11;
struct pkcs11_slotinfo *si;
CK_FUNCTION_LIST *f;
CK_ULONG tlen = 0;
CK_RV rv;
int rval = -1;
if ((k11 = RSA_get_ex_data(rsa, rsa_idx)) ==
((void *)0)
) {
sshlog("ssh-pkcs11.c", __func__, 433, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "RSA_get_ex_data failed");
return (-1);
}
if (pkcs11_get_key(k11, (1)) == -1) {
sshlog("ssh-pkcs11.c", __func__, 438, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "pkcs11_get_key failed");
return (-1);
}
f = k11->provider->function_list;
si = &k11->provider->slotinfo[k11->slotidx];
tlen = RSA_size(rsa);
rv = f->C_Sign(si->session, (CK_BYTE *)from, flen, to, &tlen);
if (rv == (0))
rval = tlen;
else
sshlog("ssh-pkcs11.c", __func__, 451, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "C_Sign failed: %lu", rv);
return (rval);
}
| long long pkcs11_rsa_private_encrypt(unsigned long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long a4) {
unsigned long v0;
unsigned int v1;
unsigned int v2;
unsigned long v3;
struct_2 *v4;
struct_0 *v5;
struct_1 *v6;
unsigned long v7;
unsigned long long v10;
v1 = a4;
v3 = 0;
v2 = -1;
v4 = RSA_get_ex_data(a3, rsa_idx, rsa_idx);
if (!v4) {
sshlog("ssh-pkcs11.c", "pkcs11_rsa_private_encrypt", 0x1b1, 0x0, 0x2, 0x0, "RSA_get_ex_data failed");
v10 = 4294967295;
} else if (pkcs11_get_key(v4, 0x1) == -1) {
sshlog("ssh-pkcs11.c", "pkcs11_rsa_private_encrypt", 0x1b6, 0x0, 0x2, 0x0, "pkcs11_get_key failed");
v10 = 4294967295;
} else {
v5 = v4->field_0->field_10;
v6 = v4->field_8 * 224 + v4->field_0->field_80;
v3 = RSA_size(a3);
v7 = v5->field_160(v6->field_d0, a1, a0, a2, &v3, v5->field_160);
if (!v7) {
v2 = v3;
} else {
v0 = v7;
sshlog("ssh-pkcs11.c", "pkcs11_rsa_private_encrypt", 0x1c3, 0x0, 0x2, 0x0, "C_Sign failed: %lu");
}
v10 = v2;
}
return v10;
}
|
void
label_notfound (void)
{
struct name const *cursor;
if (!namelist)
return;
for (cursor = namelist; cursor; cursor = cursor->next)
if ((occurrence_option == 0 ? (cursor)->found_count != 0 : (cursor)->found_count >= occurrence_option))
return;
if (verbose_option)
error (0, 0, gettext ("Archive label mismatch"));
set_exit_status (1);
for (cursor = namelist; cursor; cursor = cursor->next)
{
if (regex_usage_warning (cursor->name))
break;
}
namelist =
((void *)0)
;
nametail =
((void *)0)
;
if (same_order_option)
{
const char *name;
while ((name = name_next (1)) !=
((void *)0)
&& regex_usage_warning (name) == 0)
;
}
}
| long long label_notfound() {
unsigned long long v0[3];
unsigned long long v1;
unsigned long long v3;
v3 = namelist;
if (!namelist)
return v3;
for (v0[0] = namelist; v0; v0[0] = v0[0]) {
if (!occurrence_option) {
v3 = v0[6];
*(&v3) = v0[6];
} else {
v3 = occurrence_option;
*(&v3) = occurrence_option <= v0[6];
}
if (v3)
return v3;
}
if (verbose_option)
error(0x0, 0x0, gettext("Archive label mismatch"));
set_exit_status(0x1);
for (v0[0] = namelist; v0 && !regex_usage_warning(v0[2]); v0[0] = v0[0]);
namelist = 0;
nametail = 0;
v3 = same_order_option;
if (!same_order_option)
return v3;
while (true) {
v3 = name_next(0x1);
v1 = v3;
if (!v1)
return v3;
v3 = regex_usage_warning(v1);
if (v3)
return v3;
}
}
|
static void
print_volume_label (void)
{
struct tar_stat_info vstat;
union block vblk;
enum archive_format dummy;
memset (&vblk, 0, sizeof (vblk));
vblk.header.typeflag = 'V';
if (recent_global_header)
memcpy (vblk.header.mtime, recent_global_header->header.mtime,
sizeof vblk.header.mtime);
tar_stat_init (&vstat);
assign_string (&vstat.file_name, ".");
decode_header (&vblk, &vstat, &dummy, 0);
assign_string (&vstat.file_name, volume_label);
simple_print_header (&vstat, &vblk, 0);
tar_stat_destroy (&vstat);
}
| void print_volume_label() {
char v0;
char v1;
char v2;
char v3;
char v4;
char v5;
char v6;
unsigned long long v8;
unsigned long long *v9;
unsigned long long v10;
memset(&v3, 0x0, 0x200);
v5 = 86;
if (recent_global_header)
memcpy(&v4, recent_global_header + 136, 0xc);
tar_stat_init(&v1);
assign_string(&v2, ".", v8);
decode_header(&v3, &v1, &v0, 0x0);
assign_string(&v2, volume_label, &v2);
simple_print_header(&v1, &v3, 0x0);
tar_stat_destroy(&v1);
v10 = *(&v6) ^ v9[5];
return;
}
|
static void
statdb_node_print(FILE *out, struct fsys_namenode *file)
{
struct file_stat *filestat = file->statoverride;
struct passwd *pw;
struct group *gr;
if (!filestat)
return;
pw = getpwuid(filestat->uid);
if (pw)
fprintf(out, "%s ", pw->pw_name);
else if (filestat->uname)
fprintf(out, "%s ", filestat->uname);
else
fprintf(out, "#%d ", filestat->uid);
gr = getgrgid(filestat->gid);
if (gr)
fprintf(out, "%s ", gr->gr_name);
else if (filestat->gname)
fprintf(out, "%s ", filestat->gname);
else
fprintf(out, "#%d ", filestat->gid);
fprintf(out, "%o %s\n", filestat->mode & ~
0170000
, file->name);
}
| void statdb_node_print(void* a0, unsigned long long a1[5]) {
struct_0 *v0;
int tmp_27;
unsigned long long *v1;
unsigned long long *v2;
unsigned long long v4;
unsigned long long v5;
unsigned long long v7;
v4 = a1[4];
v0 = a1[4];
if (v0) {
v1 = &getpwuid(v0->field_0)->pw_name;
if (v1) {
fprintf(a0, "%s ", *(v1));
} else if (!v0->field_10) {
fprintf(a0, "#%d ", v0->field_0);
} else {
fprintf(a0, "%s ", v0->field_10);
}
v2 = &getgrgid(v0->field_4)->gr_name;
if (v2) {
fprintf(a0, "%s ", *(v2));
} else if (!v0->field_18) {
fprintf(a0, "#%d ", v0->field_4);
} else {
fprintf(a0, "%s ", v0->field_18);
}
v5 = v0->field_8;
*(&v5) = (v0->field_8 >> 8) & 15;
tmp_27 = v5;
v7 = fprintf(a0, "%o %s\n", tmp_27, a1[1]);
}
return;
}
|
static struct dir_info *e2fsck_get_dir_info(e2fsck_t ctx, ext2_ino_t ino)
{
struct dir_info_db *db = ctx->dir_info;
ext2_ino_t low, high, mid;
if (!db)
return 0;
if (db->tdb) {
static struct dir_info ret_dir_info;
TDB_DATA key, data;
struct dir_info_ent *buf;
key.dptr = (unsigned char *) &ino;
key.dsize = sizeof(ext2_ino_t);
data = ext2fs_tdb_fetch(db->tdb, key);
if (!data.dptr) {
if (ext2fs_tdb_error(db->tdb) != TDB_ERR_NOEXIST)
printf("fetch failed: %s\n",
ext2fs_tdb_errorstr(db->tdb));
return 0;
}
buf = (struct dir_info_ent *) data.dptr;
ret_dir_info.ino = ino;
ret_dir_info.dotdot = buf->dotdot;
ret_dir_info.parent = buf->parent;
free(data.dptr);
return &ret_dir_info;
}
if (db->last_lookup && db->last_lookup->ino == ino)
return db->last_lookup;
low = 0;
high = ctx->dir_info->count - 1;
if (ino == ctx->dir_info->array[low].ino) {
return &ctx->dir_info->array[low];
}
if (ino == ctx->dir_info->array[high].ino) {
return &ctx->dir_info->array[high];
}
while (low < high) {
mid = (unsigned long long)(low + high) / 2;
if (mid == low || mid == high)
break;
if (ino == ctx->dir_info->array[mid].ino) {
return &ctx->dir_info->array[mid];
}
if (ino < ctx->dir_info->array[mid].ino)
high = mid;
else
low = mid;
}
return 0;
}
| undefined1 * e2fsck_get_dir_info(long param_1,uint param_2)
{
uint uVar1;
int iVar2;
uint uVar3;
undefined1 *puVar4;
undefined8 uVar5;
uint local_54;
long local_50;
uint local_44;
uint local_40;
long local_38;
undefined8 local_30;
uint *local_28;
undefined8 local_20;
undefined local_18 [16];
local_38 = *(long *)(param_1 + 0x230);
if (local_38 == 0) {
puVar4 = (undefined1 *)0x0;
}
else if (*(long *)(local_38 + 0x20) == 0) {
if ((*(long *)(local_38 + 0x10) == 0) || (**(uint **)(local_38 + 0x10) != param_2)) {
local_44 = 0;
local_40 = **(int **)(param_1 + 0x230) - 1;
if (**(uint **)(*(long *)(param_1 + 0x230) + 8) == param_2) {
puVar4 = *(undefined1 **)(*(long *)(param_1 + 0x230) + 8);
}
else {
uVar1 = local_44;
if (*(uint *)((ulong)local_40 * 0xc + *(long *)(*(long *)(param_1 + 0x230) + 8)) == param_2)
{
puVar4 = (undefined1 *)((ulong)local_40 * 0xc + *(long *)(*(long *)(param_1 + 0x230) + 8))
;
}
else {
while (((local_44 = uVar1, local_44 < local_40 &&
(uVar3 = local_40 + local_44 >> 1, uVar3 != local_44)) && (uVar3 != local_40))) {
if (*(uint *)((ulong)uVar3 * 0xc + *(long *)(*(long *)(param_1 + 0x230) + 8)) == param_2
) {
return (undefined1 *)((ulong)uVar3 * 0xc + *(long *)(*(long *)(param_1 + 0x230) + 8));
}
uVar1 = uVar3;
if (param_2 < *(uint *)((ulong)uVar3 * 0xc + *(long *)(*(long *)(param_1 + 0x230) + 8)))
{
uVar1 = local_44;
local_40 = uVar3;
}
}
puVar4 = (undefined1 *)0x0;
}
}
}
else {
puVar4 = *(undefined1 **)(local_38 + 0x10);
}
}
else {
local_28 = &local_54;
local_20 = 4;
local_54 = param_2;
local_50 = param_1;
local_18 = ext2fs_tdb_fetch(*(undefined8 *)(local_38 + 0x20),local_28,4);
if (local_18._0_8_ == (undefined4 *)0x0) {
iVar2 = ext2fs_tdb_error(*(undefined8 *)(local_38 + 0x20));
if (iVar2 != 8) {
uVar5 = ext2fs_tdb_errorstr(*(undefined8 *)(local_38 + 0x20));
printf("fetch failed: %s\n",uVar5);
}
puVar4 = (undefined1 *)0x0;
}
else {
ret_dir_info_9647._0_4_ = local_54;
ret_dir_info_9647._4_4_ = *local_18._0_8_;
ret_dir_info_9647._8_4_ = local_18._0_8_[1];
free(local_18._0_8_);
local_18._8_8_ = SUB168(local_18 >> 0x40,0);
local_30 = SUB168(local_18,0);
puVar4 = ret_dir_info_9647;
}
}
return puVar4;
}
|
static int readahead_dir_block(ext2_filsys fs, struct ext2_db_entry2 *db,
void *priv_data)
{
struct read_dblist *pr = priv_data;
e2_blkcnt_t count = (pr->flags & (0x01) ?
1 : db->blockcnt);
if (!pr->run_len || db->blk != pr->run_start + pr->run_len) {
if (pr->run_len) {
pr->err = io_channel_cache_readahead(fs->io,
pr->run_start,
pr->run_len);
;
}
pr->run_start = db->blk;
pr->run_len = 0;
}
pr->run_len += count;
return pr->err ? 1 : 0;
}
| long long readahead_dir_block(struct_1 *a0, unsigned long long a1[3], struct_0 *a2) {
struct_0 *v0;
unsigned long long v1;
unsigned long long v3;
v0 = a2;
if (!(a2->field_18 & 1))
v3 = a1[2];
else
v3 = 1;
v1 = v3;
if (!a2->field_10 || a1[1] != a2->field_10 + a2->field_8) {
if (a2->field_10)
a2->field_0 = io_channel_cache_readahead(a0->field_8, a2->field_8, a2->field_10, a2->field_8);
a2->field_8 = a1[1];
a2->field_10 = 0;
}
a2->field_10 = a2->field_10 + v1;
return a2->field_0;
}
|
static void
initialize_hostname_list ()
{
char *temp;
temp = get_string_value ("HOSTFILE");
if (temp == 0)
temp = get_string_value ("hostname_completion_file");
if (temp == 0)
temp = "/etc/hosts";
snarf_hosts_from_file (temp);
if (hostname_list)
hostname_list_initialized++;
}
| void initialize_hostname_list() {
unsigned long long v0;
unsigned long long v2;
unsigned long long v3;
v0 = get_string_value("HOSTFILE");
if (!v0)
v0 = get_string_value("hostname_completion_file");
if (!v0)
v0 = "/etc/hosts";
snarf_hosts_from_file(v0);
v2 = hostname_list;
if (hostname_list) {
v3 = hostname_list_initialized + 1;
hostname_list_initialized = hostname_list_initialized + 1;
}
return;
}
|
static
_Bool
disable_core_dumps (void)
{
if (prctl (
4
, 0) == 0)
return
1
;
error (0,
(*__errno_location ())
, gettext ("warning: disabling core dumps failed"));
return
0
;
}
| long disable_core_dumps()
{
char *v1;
int *v2;
if ( !prctl(4, 0LL) )
return 1LL;
v1 = gettext("warning: disabling core dumps failed");
v2 = _errno_location();
error(0, *v2, v1);
return 0LL;
}
|
char *
zap_slashes (char *name)
{
char *q;
if (!name || *name == 0)
return name;
q = name + strlen (name) - 1;
while (q > name &&
((
*q
) == '/')
)
*q-- = '\0';
return name;
}
| long long zap_slashes(char *a0) {
char *v0;
char *v2;
char *v4;
if (!a0) {
LABEL_40044c:
v2 = a0;
} else {
if (!*(a0))
goto LABEL_40044c;
v0 = &a0[1 + strlen(a0)];
while (true) {
if (v0 <= a0)
break;
if (*(v0) != 47)
break;
v4 = v0;
v0 += 1;
*(v4) = 0;
}
v2 = a0;
}
return v2;
}
|
int
rl_quoted_insert (int count, int key)
{
if ((rl_readline_state & (0x0080000)) == 0)
_rl_disable_tty_signals ();
if ((rl_readline_state & (0x0080000)))
{
_rl_callback_data = _rl_callback_data_alloc (count);
_rl_callback_func = _rl_insert_next_callback;
return (0);
}
if (count < 0)
{
int r;
do
r = _rl_insert_next (1);
while (r == 0 && ++count < 0);
return r;
}
return _rl_insert_next (count);
}
| long long rl_quoted_insert(unsigned long a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
void* v4;
v1 = a0;
v0 = a1;
if (!(rl_readline_state & 0x80000))
_rl_disable_tty_signals();
if ((rl_readline_state & 0x80000)) {
_rl_callback_data = _rl_callback_data_alloc(v1);
_rl_callback_func = _rl_insert_next_callback;
v4 = 0;
return v4;
} else if (v1 < 0) {
do { } while ((v2 = _rl_insert_next(0x1), !v2 && (v1 += 1, v1 < 0)));
v4 = v2;
return v4;
} else {
v4 = _rl_insert_next(v1);
return v4;
}
}
|
static int
history_def_init(void **p, HistEventW *ev __attribute__((__unused__)), int n)
{
history_t *h = (history_t *) malloc(sizeof(*h));
if (h ==
((void *)0)
)
return -1;
if (n <= 0)
n = 0;
h->eventid = 0;
h->cur = 0;
h->max = n;
h->list.next = h->list.prev = &h->list;
h->list.ev.str =
((void *)0)
;
h->list.ev.num = 0;
h->cursor = &h->list;
h->flags = 0;
*p = h;
return 0;
}
| undefined8 history_def_init(undefined8 *param_1,undefined8 param_2,int param_3)
{
undefined4 *puVar1;
undefined8 uVar2;
int local_2c;
puVar1 = (undefined4 *)malloc(0x40);
if (puVar1 == (undefined4 *)0x0) {
uVar2 = 0xffffffff;
}
else {
local_2c = param_3;
if (param_3 < 1) {
local_2c = 0;
}
puVar1[0xe] = 0;
puVar1[0xd] = 0;
puVar1[0xc] = local_2c;
*(undefined4 **)(puVar1 + 8) = puVar1;
*(undefined8 *)(puVar1 + 6) = *(undefined8 *)(puVar1 + 8);
*(undefined8 *)(puVar1 + 2) = 0;
*puVar1 = 0;
*(undefined4 **)(puVar1 + 10) = puVar1;
puVar1[0xf] = 0;
*param_1 = puVar1;
uVar2 = 0;
}
return uVar2;
}
|
static void
store_rename (struct directory *dir, struct obstack *stk)
{
struct directory *prev, *p;
for (prev = dir; prev && prev->orig != dir; prev = prev->orig)
;
if (prev ==
((void *)0)
)
{
for (p = dir; p && p->orig; p = p->orig)
obstack_code_rename (stk, p->orig->name, p->name);
}
else
{
char *temp_name;
temp_name = dir_name (dir->name);
__extension__ ({ struct obstack *__o = (stk); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < 1) _obstack_newchunk (__o, 1); ((void) (*((__o)->next_free)++ = ('X'))); });
__extension__ ({ struct obstack *__o = (stk); size_t __len = (strlen (temp_name) + 1); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < __len) _obstack_newchunk (__o, __len); memcpy (__o->next_free, temp_name, __len); __o->next_free += __len; (void) 0; });
obstack_code_rename (stk, dir->name, "");
for (p = dir; p != prev; p = p->orig)
obstack_code_rename (stk, p->orig->name, p->name);
obstack_code_rename (stk, "", prev->name);
free (temp_name);
}
}
| void store_rename(long param_1,long param_2)
{
undefined *puVar1;
char *__s;
size_t sVar2;
ulong __n;
long local_48;
long local_40;
for (local_48 = param_1; (local_48 != 0 && (param_1 != *(long *)(local_48 + 0x40)));
local_48 = *(long *)(local_48 + 0x40)) {
}
local_40 = param_1;
if (local_48 == 0) {
for (; (local_40 != 0 && (*(long *)(local_40 + 0x40) != 0));
local_40 = *(long *)(local_40 + 0x40)) {
obstack_code_rename(param_2,*(undefined8 *)(*(long *)(local_40 + 0x40) + 0x58),
*(undefined8 *)(local_40 + 0x58));
}
}
else {
__s = (char *)dir_name(*(undefined8 *)(param_1 + 0x58));
if (*(long *)(param_2 + 0x20) == *(long *)(param_2 + 0x18)) {
_obstack_newchunk(param_2,1);
}
puVar1 = *(undefined **)(param_2 + 0x18);
*(undefined **)(param_2 + 0x18) = puVar1 + 1;
*puVar1 = 0x58;
sVar2 = strlen(__s);
__n = sVar2 + 1;
if ((ulong)(*(long *)(param_2 + 0x20) - *(long *)(param_2 + 0x18)) < __n) {
_obstack_newchunk(param_2,__n);
}
memcpy(*(void **)(param_2 + 0x18),__s,__n);
*(ulong *)(param_2 + 0x18) = *(long *)(param_2 + 0x18) + __n;
obstack_code_rename(param_2,*(undefined8 *)(param_1 + 0x58),&DAT_00104c14);
for (; local_40 != local_48; local_40 = *(long *)(local_40 + 0x40)) {
obstack_code_rename(param_2,*(undefined8 *)(*(long *)(local_40 + 0x40) + 0x58),
*(undefined8 *)(local_40 + 0x58));
}
obstack_code_rename(param_2,&DAT_00104c14,*(undefined8 *)(local_48 + 0x58));
free(__s);
}
return;
}
|
int
acl_create_entry(acl_t *acl_p, acl_entry_t *entry_p)
{
acl_obj *acl_obj_p;
acl_entry_obj *entry_obj_p;
if (!acl_p || !entry_p) {
if (entry_p)
*entry_p =
((void *)0)
;
(*__errno_location ())
=
22
;
return -1;
}
acl_obj_p = ((acl_obj *)__ext2int_and_check(*acl_p, (0x712C)));
if (!acl_obj_p)
return -1;
entry_obj_p = __acl_create_entry_obj(acl_obj_p);
if (entry_obj_p ==
((void *)0)
)
return -1;
*entry_p = ((entry_obj_p) ? &(entry_obj_p)->i :
((void *)0)
);
return 0;
}
| undefined8 acl_create_entry(undefined8 *param_1,long *param_2)
{
int *piVar1;
undefined8 uVar2;
long lVar3;
if ((param_1 == (undefined8 *)0x0) || (param_2 == (long *)0x0)) {
if (param_2 != (long *)0x0) {
*param_2 = 0;
}
piVar1 = __errno_location();
*piVar1 = 0x16;
uVar2 = 0xffffffff;
}
else {
lVar3 = __ext2int_and_check(*param_1,0x712c);
if (lVar3 == 0) {
uVar2 = 0xffffffff;
}
else {
lVar3 = __acl_create_entry_obj(lVar3);
if (lVar3 == 0) {
uVar2 = 0xffffffff;
}
else {
if (lVar3 == 0) {
lVar3 = 0;
}
else {
lVar3 = lVar3 + 8;
}
*param_2 = lVar3;
uVar2 = 0;
}
}
}
return uVar2;
}
|
static intmax_t cond(int token, union yystype *val, int op, int noeval)
{
intmax_t a = or(token, val, op, noeval);
intmax_t b;
intmax_t c;
if (last_token != 37)
return a;
b = assignment(yylex(), noeval | !a);
if (last_token != 38)
yyerror("expecting ':'");
token = yylex();
*val = yylval;
c = cond(token, val, yylex(), noeval | !!a);
return a ? b : c;
}
| long cond(undefined4 param_1,undefined8 *param_2,undefined4 param_3,uint param_4)
{
undefined4 uVar1;
undefined4 uVar2;
long lVar3;
long lVar4;
long lVar5;
bool bVar6;
lVar3 = or(param_1,param_2,param_3,param_4);
if (last_token == 0x25) {
uVar1 = yylex();
lVar4 = assignment(uVar1,lVar3 == 0 | param_4);
if (last_token != 0x26) {
yyerror("expecting \':\'");
}
uVar1 = yylex();
*param_2 = yylval;
uVar2 = yylex();
lVar5 = cond(uVar1,param_2,uVar2,lVar3 != 0 | param_4);
bVar6 = lVar3 != 0;
lVar3 = lVar5;
if (bVar6) {
lVar3 = lVar4;
}
}
return lVar3;
}
|
void
append_incremental_renames (struct directory *dir)
{
struct obstack stk;
size_t size;
struct directory *dp;
const char *dump;
if (dirhead ==
((void *)0)
)
return;
_obstack_begin ((&stk), 0, 0, (xmalloc), (free));
dump = directory_contents (dir);
if (dump)
{
size = dumpdir_size (dump) - 1;
__extension__ ({ struct obstack *__o = (&stk); size_t __len = (size); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < __len) _obstack_newchunk (__o, __len); memcpy (__o->next_free, dump, __len); __o->next_free += __len; (void) 0; });
}
else
size = 0;
for (dp = dirhead; dp; dp = dp->next)
if (((dp)->flags & 0x0010))
store_rename (dp, &stk);
if (dir && __extension__ ({ struct obstack const *__o = (&stk); (size_t) (__o->next_free - __o->object_base); }) != size)
{
__extension__ ({ struct obstack *__o = (&stk); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < 1) _obstack_newchunk (__o, 1); ((void) (*((__o)->next_free)++ = (0))); });
dumpdir_free (dir->dump);
dir->dump = dumpdir_create (__extension__ ({ struct obstack *__o1 = (&stk); void *__value = (void *) __o1->object_base; if (__o1->next_free == __value) __o1->maybe_empty_object = 1; __o1->next_free = ((sizeof (ptrdiff_t) < sizeof (void *) ? (__o1->object_base) : (char *) 0) + (((__o1->next_free) - (sizeof (ptrdiff_t) < sizeof (void *) ? (__o1->object_base) : (char *) 0) + (__o1->alignment_mask)) & ~(__o1->alignment_mask))); if ((size_t) (__o1->next_free - (char *) __o1->chunk) > (size_t) (__o1->chunk_limit - (char *) __o1->chunk)) __o1->next_free = __o1->chunk_limit; __o1->object_base = __o1->next_free; __value; }));
}
__extension__ ({ struct obstack *__o = (&stk); void *__obj = (void *) (
((void *)0)
); if (__obj > (void *) __o->chunk && __obj < (void *) __o->chunk_limit) __o->next_free = __o->object_base = (char *) __obj; else _obstack_free (__o, __obj); });
}
| long long append_incremental_renames(struct_0 *a0) {
void* v0;
int tmp_15;
struct_5 *v1;
void* v2;
struct_1 *v3;
void* v4;
unsigned long long v5[5];
unsigned long long v6[4];
struct_3 *v7;
unsigned long long v8[5];
struct_2 *v9;
void* v10;
unsigned long long v11[5];
void* v12;
char v13;
if (dirhead) {
_obstack_begin(&v13, 0x0, 0x0, got.xmalloc, got.free);
v2 = directory_contents(a0);
if (!v2) {
v0 = 0;
} else {
v0 = dumpdir_size(v2) - 1;
v3 = &v13;
v4 = v0;
v5[0] = v3;
if (v5[4] - v5[3] < v4)
_obstack_newchunk(v3, v4);
memcpy(v3->field_18, v2, v4);
v3->field_18 = v3->field_18 + v4;
}
for (v1 = dirhead; v1; v1 = v1->field_0) {
if ((v1->field_3c & 16))
store_rename(v1, &v13);
}
if (a0) {
v6[0] = &v13;
if (v6[3] - v6[2] != v0) {
v7 = &v13;
v8[0] = v7;
if (!v8[4] - v8[3])
_obstack_newchunk(v7, 0x1);
tmp_15 = v7->field_18;
v7->field_18 = v7->field_18 + 1;
*(tmp_15) = 0;
dumpdir_free(a0->field_28);
v9 = &v13;
v10 = v9->field_10;
if (v10 == v9->field_18)
v9->field_50 = v9->field_50 | 2;
v9->field_18 = !(v9->field_30) & v9->field_18 + v9->field_30;
if (v9->field_18 - v9->field_8 > v9->field_20 - v9->field_8)
v9->field_18 = v9->field_20;
v9->field_10 = v9->field_18;
a0->field_28 = dumpdir_create(v10);
}
}
v11[0] = &v13;
v12 = 0;
if (v12 > v11[1] && v12 < v11[4]) {
v11[2] = v12;
v11[3] = v11[2];
goto LABEL_402407;
}
_obstack_free(v11, v12);
}
LABEL_402407:
return 0;
}
|
static int
send_userauth_info_request(struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
KbdintAuthctxt *kbdintctxt;
char *name, *instr, **prompts;
u_int r, i, *echo_on;
kbdintctxt = authctxt->kbdintctxt;
if (kbdintctxt->device->query(kbdintctxt->ctxt,
&name, &instr, &kbdintctxt->nreq, &prompts, &echo_on))
return 0;
if ((r = sshpkt_start(ssh, 60)) != 0 ||
(r = sshpkt_put_cstring(ssh, name)) != 0 ||
(r = sshpkt_put_cstring(ssh, instr)) != 0 ||
(r = sshpkt_put_cstring(ssh, "")) != 0 ||
(r = sshpkt_put_u32(ssh, kbdintctxt->nreq)) != 0)
sshfatal("auth2-chall.c", __func__, 270, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "start packet");
for (i = 0; i < kbdintctxt->nreq; i++) {
if ((r = sshpkt_put_cstring(ssh, prompts[i])) != 0 ||
(r = sshpkt_put_u8(ssh, echo_on[i])) != 0)
sshfatal("auth2-chall.c", __func__, 274, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble packet");
}
if ((r = sshpkt_send(ssh)) != 0 ||
(r = ssh_packet_write_wait(ssh)) != 0)
sshfatal("auth2-chall.c", __func__, 278, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "send packet");
for (i = 0; i < kbdintctxt->nreq; i++)
free(prompts[i]);
free(prompts);
free(echo_on);
free(name);
free(instr);
return 1;
}
| int send_userauth_info_request(struct_0 *a0) {
unsigned long long v0;
char v1;
unsigned int v2;
unsigned int v3;
char v4;
char v5;
char v6;
char v7;
struct_2 *v8;
struct_1 *v9;
unsigned long long v10;
unsigned int v12;
unsigned long long v13;
v8 = a0->field_860;
v9 = v8->field_58;
v12 = *((*(((stack_base)[24] + 16)) + 16))(v9->field_8, &v4, &v5, &v9->field_18, &v6, &v7, *(&v1));
if (v12) {
v12 = 0;
} else {
v2 = sshpkt_start(a0, 0x3c);
if (!v2) {
v2 = sshpkt_put_cstring(a0, *(&v4), *(&v4));
if (!v2) {
v2 = sshpkt_put_cstring(a0, *(&v5), *(&v5));
if (!v2) {
v2 = sshpkt_put_cstring(a0, &g_400f60, v13);
if (!v2)
v2 = sshpkt_put_u32(a0, v9->field_18, v9->field_18);
}
}
}
if (v2 || v2 || v2 || v2 || v2) {
v0 = "start packet";
sshfatal("auth2-c", "send_userauth_info_request", 0x10e, 0x1, 0x1, ssh_err(v2));
}
for (v3 = 0; v3 < v9->field_18; v3 += 1) {
v2 = sshpkt_put_cstring(a0, *((*(&v6) + v3 * 8)), *((*(&v6) + v3 * 8)));
if (!v2)
v2 = sshpkt_put_u8(a0, *((*(&v7) + v3 * 4)), *((*(&v7) + v3 * 4)));
if (v2 || v2) {
v10 = "assemble packet";
sshfatal("auth2-c", "send_userauth_info_request", 0x112, 0x1, 0x1, ssh_err(v2));
}
}
v2 = sshpkt_send(a0);
if (!v2)
v2 = ssh_packet_write_wait(a0);
if (v2 || v2) {
v10 = "send packet";
sshfatal("auth2-c", "send_userauth_info_request", 0x116, 0x1, 0x1, ssh_err(v2));
}
for (v3 = 0; v3 < v9->field_18; v3 += 1) {
free(*((*(&v6) + v3 * 8)));
}
free(*(&v6));
free(*(&v7));
free(*(&v4));
free(*(&v5));
v12 = 1;
}
return v12;
}
|
static int xfrm_policy_modify(int cmd, unsigned int flags, int argc, char **argv)
{
struct rtnl_handle rth;
struct {
struct nlmsghdr n;
struct xfrm_userpolicy_info xpinfo;
char buf[2048];
} req = {
.n.nlmsg_len = ((sizeof(req.xpinfo)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))),
.n.nlmsg_flags = 0x01 | flags,
.n.nlmsg_type = cmd,
.xpinfo.sel.family = preferred_family,
.xpinfo.lft.soft_byte_limit = (~(__u64)0),
.xpinfo.lft.hard_byte_limit = (~(__u64)0),
.xpinfo.lft.soft_packet_limit = (~(__u64)0),
.xpinfo.lft.hard_packet_limit = (~(__u64)0),
};
char *dirp =
((void *)0)
;
char *selp =
((void *)0)
;
char *ptypep =
((void *)0)
;
char *sctxp =
((void *)0)
;
struct xfrm_userpolicy_type upt = {};
char tmpls_buf[1024] = {};
int tmpls_len = 0;
struct xfrm_mark mark = {0, 0};
struct {
struct xfrm_user_sec_ctx sctx;
char str[256];
} ctx = {};
_Bool
is_if_id_set =
0
;
__u32 if_id = 0;
while (argc > 0) {
if (strcmp(*argv, "dir") == 0) {
if (dirp)
duparg("dir", *argv);
dirp = *argv;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
xfrm_policy_dir_parse(&req.xpinfo.dir, &argc, &argv);
} else if (strcmp(*argv, "ctx") == 0) {
char *context;
if (sctxp)
duparg("ctx", *argv);
sctxp = *argv;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
context = *argv;
xfrm_sctx_parse((char *)&ctx.str, context, &ctx.sctx);
} else if (strcmp(*argv, "mark") == 0) {
xfrm_parse_mark(&mark, &argc, &argv);
} else if (strcmp(*argv, "index") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&req.xpinfo.index, *argv, 0))
invarg("INDEX value is invalid", *argv);
} else if (strcmp(*argv, "ptype") == 0) {
if (ptypep)
duparg("ptype", *argv);
ptypep = *argv;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
xfrm_policy_ptype_parse(&upt.type, &argc, &argv);
} else if (strcmp(*argv, "action") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (strcmp(*argv, "allow") == 0)
req.xpinfo.action = 0;
else if (strcmp(*argv, "block") == 0)
req.xpinfo.action = 1;
else
invarg("ACTION value is invalid\n", *argv);
} else if (strcmp(*argv, "priority") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&req.xpinfo.priority, *argv, 0))
invarg("PRIORITY value is invalid", *argv);
} else if (strcmp(*argv, "flag") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
xfrm_policy_flag_parse(&req.xpinfo.flags, &argc,
&argv);
} else if (strcmp(*argv, "limit") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
xfrm_lifetime_cfg_parse(&req.xpinfo.lft, &argc, &argv);
} else if (strcmp(*argv, "tmpl") == 0) {
struct xfrm_user_tmpl *tmpl;
if (tmpls_len + sizeof(*tmpl) > sizeof(tmpls_buf)) {
fprintf(
stderr
, "Too many tmpls: buffer overflow\n");
exit(1);
}
tmpl = (struct xfrm_user_tmpl *)((char *)tmpls_buf + tmpls_len);
tmpl->family = preferred_family;
tmpl->aalgos = (~(__u32)0);
tmpl->ealgos = (~(__u32)0);
tmpl->calgos = (~(__u32)0);
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
xfrm_tmpl_parse(tmpl, &argc, &argv);
tmpls_len += sizeof(*tmpl);
} else if (strcmp(*argv, "if_id") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&if_id, *argv, 0))
invarg("IF_ID value is invalid", *argv);
is_if_id_set =
1
;
} else {
if (selp)
duparg("unknown", *argv);
selp = *argv;
xfrm_selector_parse(&req.xpinfo.sel, &argc, &argv);
if (preferred_family ==
0
)
preferred_family = req.xpinfo.sel.family;
}
argc--; argv++;
}
if (!dirp) {
fprintf(
stderr
, "Not enough information: DIR is required.\n");
exit(1);
}
if (ptypep) {
addattr_l(&req.n, sizeof(req), XFRMA_POLICY_TYPE,
(void *)&upt, sizeof(upt));
}
if (tmpls_len > 0) {
addattr_l(&req.n, sizeof(req), XFRMA_TMPL,
(void *)tmpls_buf, tmpls_len);
}
if (mark.m) {
int r = addattr_l(&req.n, sizeof(req.buf), XFRMA_MARK,
(void *)&mark, sizeof(mark));
if (r < 0) {
fprintf(
stderr
, "%s: XFRMA_MARK failed\n", __func__);
exit(1);
}
}
if (sctxp) {
addattr_l(&req.n, sizeof(req), XFRMA_SEC_CTX,
(void *)&ctx, ctx.sctx.len);
}
if (is_if_id_set)
addattr32(&req.n, sizeof(req.buf), XFRMA_IF_ID, if_id);
if (rtnl_open_byproto(&rth, 0, 6) < 0)
exit(1);
if (req.xpinfo.sel.family ==
0
)
req.xpinfo.sel.family =
2
;
if (rtnl_talk(&rth, &req.n,
((void *)0)
) < 0)
exit(2);
rtnl_close(&rth);
return 0;
}
| void xfrm_policy_modify(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3) {
unsigned long long *v0;
unsigned int v1;
unsigned int v2;
char v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned short v8;
void* v9;
unsigned long v10;
void* v11;
unsigned long v12;
struct_0 *v13;
void* v14;
unsigned int v15;
unsigned int v16;
char v17;
unsigned long v18;
char v19;
char v20;
unsigned short v21;
unsigned short v22;
char v23;
unsigned short v24;
unsigned long long v25;
unsigned long long v26;
unsigned long long v27;
unsigned long long v28;
char v29;
char v30;
char v31;
char v32;
char v33;
void* v34;
void* v35;
char v36;
unsigned long long v38;
unsigned long long *v39;
unsigned long v40;
unsigned long long *v41;
unsigned long long v42;
unsigned long long v43;
unsigned long long *v44;
void* v45;
v2 = a0;
v1 = a2;
v0 = a3;
v38 = 279;
for (v39 = &v20; v38; v39 = &v39[v40]) {
v38 -= 1;
v20 = 0;
}
v20 = 184;
v21 = v2;
v22 = a1 | 1;
v24 = preferred_family;
v25 = -1;
v26 = -1;
v27 = -1;
v28 = -1;
v9 = 0;
v10 = 0;
v11 = 0;
v12 = 0;
v7 = 0;
v8 = 0;
v34 = 0;
v35 = 0;
v42 = 126;
for (v41 = &v36; v42; v41 = &v41[v40]) {
v42 -= 1;
v36 = 0;
}
v5 = 0;
v15 = 0;
v16 = 0;
v43 = 33;
for (v44 = &v18; v43; v44 = &v44[v40]) {
v43 -= 1;
v18 = 0;
}
v3 = 0;
v4 = 0;
while (true) {
if (v1 <= 0)
break;
if (!strcmp(*(v0), "dir")) {
if (v9)
duparg("dir", *(v0));
v9 = *(v0);
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
xfrm_policy_dir_parse(&v31, &v1, &v0);
goto LABEL_400f5a;
}
if (!strcmp(*(v0), "ctx")) {
if (v12)
duparg("ctx", *(v0));
v12 = *(v0);
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v14 = *(v0);
xfrm_sctx_parse(&v19, v14, &v18);
goto LABEL_400f5a;
}
if (!strcmp(*(v0), "mark")) {
xfrm_parse_mark(&v15, &v1, &v0, &v1);
goto LABEL_400f5a;
}
if (!strcmp(*(v0), "index")) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
if (!get_u32(&v30, *(v0), 0x0, &v30))
goto LABEL_400f5a;
invarg("INDEX value is invalid", *(v0));
}
if (!strcmp(*(v0), "ptype")) {
if (v11)
duparg("ptype", *(v0));
v11 = *(v0);
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
xfrm_policy_ptype_parse(&v7, &v1, &v0);
goto LABEL_400f5a;
}
if (!strcmp(*(v0), "action")) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
if (!strcmp(*(v0), "allow")) {
v32 = 0;
goto LABEL_400f5a;
}
if (!strcmp(*(v0), "block")) {
v32 = 1;
goto LABEL_400f5a;
} else {
invarg("ACTION value is invalid\n", *(v0));
}
}
if (!strcmp(*(v0), "priority")) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
if (!get_u32(&v29, *(v0), 0x0, &v29))
goto LABEL_400f5a;
invarg("PRIORITY value is invalid", *(v0));
}
if (!strcmp(*(v0), "flag")) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
xfrm_policy_flag_parse(&v33, &v1, &v0);
} else if (!strcmp(*(v0), "limit")) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
xfrm_lifetime_cfg_parse(&v25, &v1, &v0, &v25);
} else if (strcmp(*(v0), "tmpl")) {
if (strcmp(*(v0), "if_id")) {
if (v10)
duparg("unknown", *(v0));
v10 = *(v0);
xfrm_selector_parse(&v23, &v1, &v0, &v23);
if (!preferred_family)
preferred_family = v24;
} else {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
if (get_u32(&v4, *(v0), 0x0, *(v0)))
invarg("IF_ID value is invalid", *(v0));
v3 = 1;
}
} else {
if (v5 + 64 > 0x400) {
fprintf(*(&stderr), "Too many tmpls: buffer overflow\n");
exit(0x1);
}
v13 = v5 + &v34;
v13->field_18 = preferred_family;
v13->field_34 = -1;
v13->field_38 = -1;
v13->field_3c = -1;
v0 += 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
xfrm_tmpl_parse(v13, &v1, &v0);
v5 += 64;
}
LABEL_400f5a:
v1 -= 1;
v0 += 1;
}
if (!v9) {
fprintf(*(&stderr), "Not enough information: DIR is required.\n");
exit(0x1);
}
if (v11)
addattr_l(&v20, 0x8b8, 0x10, &v7, 0x6);
if (v5 > 0)
addattr_l(&v20, 0x8b8, 0x5, &v34, v5);
if (v16) {
v6 = addattr_l(&v20, 0x800, 0x15, &v15, 0x8);
if (v6 < 0) {
fprintf(*(&stderr), "%s: XFRMA_MARK failed\n", &__func__.9275);
exit(0x1);
}
}
if (v12)
addattr_l(&v20, 0x8b8, 0x8, &v18, v18);
if (v3)
addattr32(&v20, 0x800, 0x1f, v4);
if (rtnl_open_byproto(&v17, 0x0, 0x6) < 0)
exit(0x1);
if (!v24)
v24 = 2;
if (rtnl_talk(&v17, &v20, 0x0, &v20) < 0)
exit(0x2);
rtnl_close(&v17);
v45 = 0;
return;
}
|
static int find_blocks(ext2_filsys fs, blk64_t *blocknr, e2_blkcnt_t blockcnt,
blk64_t ref_blk __attribute__((unused)),
int ref_offset __attribute__((unused)), void *priv_data)
{
struct extent_list *list = priv_data;
if (blockcnt < 0) {
list->blocks_freed++;
ext2fs_block_alloc_stats2(fs, *blocknr, -1);
return 0;
}
if (list->count) {
struct ext2fs_extent *last = list->extents +
list->count - 1;
blk64_t end = last->e_len + 1;
if (last->e_lblk + last->e_len == (__u64) blockcnt &&
last->e_pblk + last->e_len == *blocknr &&
end < (1ULL << 32)) {
last->e_len++;
return 0;
}
}
if (list->count == list->size) {
unsigned int new_size = (list->size + 341) *
sizeof(struct ext2fs_extent);
list->retval = ext2fs_resize_mem(0, new_size, &list->extents);
if (list->retval)
return 2;
list->size += 341;
}
list->extents[list->count].e_pblk = *blocknr;
list->extents[list->count].e_lblk = blockcnt;
list->extents[list->count].e_len = 1;
list->extents[list->count].e_flags = 0;
list->count++;
return 0;
}
| long long find_blocks(unsigned long long a0, unsigned long long *a1, unsigned long a2, unsigned long a3, unsigned long a4, struct_0 *a5) {
unsigned int v0;
unsigned long v1;
unsigned int v2;
struct_0 *v3;
struct_4 *v4;
unsigned long v5;
unsigned long long v7;
unsigned int v8;
v1 = a3;
v0 = a4;
v3 = a5;
if ((a2 - 0 >> 63)) {
a5->field_0 = a5->field_0 + 1;
ext2fs_block_alloc_stats2(a0, *(a1), 0xffffffff, *(a1));
v7 = 0;
} else {
if (a5->field_10) {
v4 = a5->field_10 * 24 - 24 + a5->field_8;
v5 = v4->field_10 + 1;
if (v4->field_8 + v4->field_10 == a2 && v4->field_0 + v4->field_10 == *(a1) && v5 <= 4294967295) {
v4->field_10 = v4->field_10 + 1;
v7 = 0;
goto LABEL_400656;
}
}
if (a5->field_10 == a5->field_14) {
v2 = (a5->field_14 * 24) + 8184;
a5->field_20 = ext2fs_resize_mem(0x0, v2, &a5->field_8);
if (a5->field_20) {
v7 = 2;
goto LABEL_400656;
} else {
a5->field_14 = a5->field_14 + 341;
}
}
*((a5->field_8 + a5->field_10 * 24)) = *(a1);
*((a5->field_8 + a5->field_10 * 24 + 8)) = a2;
*((a5->field_10 * 24 + a5->field_8 + 16)) = 1;
v8 = a5->field_10;
*((a5->field_10 * 24 + a5->field_8 + 20)) = 0;
a5->field_10 = v8 + 1;
v7 = 0;
}
LABEL_400656:
return v7;
}
|
static inline __u32 rta_getattr_u32(const struct rtattr *rta)
{
return *(__u32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| long rta_getattr_u32(long a1)
{
return *(unsigned int *)(a1 + 4);
}
|
void
session_unused(int id)
{
sshlog("session.c", __func__, 1721, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "session id %d unused", id);
if (id >= options.max_sessions ||
id >= sessions_nalloc) {
sshfatal("session.c", __func__, 1724, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "insane session id %d (max %d nalloc %d)", id, options.max_sessions, sessions_nalloc)
;
}
memset(&sessions[id], 0, sizeof(*sessions));
sessions[id].self = id;
sessions[id].used = 0;
sessions[id].chanid = -1;
sessions[id].ptyfd = -1;
sessions[id].ttyfd = -1;
sessions[id].ptymaster = -1;
sessions[id].x11_chanids =
((void *)0)
;
sessions[id].next_unused = sessions_first_unused;
sessions_first_unused = id;
}
| void session_unused(unsigned long a0) {
unsigned long long v0;
unsigned long v1;
unsigned long long v2;
unsigned long v3;
unsigned int v4;
unsigned long v6;
v4 = a0;
v3 = a0;
v2 = "session id %d unused";
sshlog("session.c", "session_unused", 0x6b9, 0x1, 0x7, 0x0);
if (a0 < *(5250732) && a0 < sessions_nalloc)
goto LABEL_403a66;
v3 = sessions_nalloc;
v2 = *(5250732);
v1 = a0;
v0 = "insane session id %d (max %d nalloc %d)";
sshfatal("session.c", "session_unused", 0x6bc, 0x1, 0x1, 0x0);
LABEL_403a66:
memset(a0 * 232 + sessions, 0x0, 0xe8);
*((sessions + a0 * 232 + 4)) = a0;
*((a0 * 232 + sessions)) = 0;
*((a0 * 232 + sessions + 188)) = -1;
*((a0 * 232 + sessions + 48)) = -1;
*((a0 * 232 + sessions + 52)) = -1;
*((a0 * 232 + sessions + 56)) = -1;
*((a0 * 232 + sessions + 192)) = 0;
*((sessions + a0 * 232 + 8)) = sessions_first_unused;
v6 = a0;
sessions_first_unused = a0;
return;
}
|
static int
describe_command(out, command, path, verbose)
struct output *out;
char *command;
const char *path;
int verbose;
{
struct cmdentry entry;
struct tblentry *cmdp;
const struct alias *ap;
if (verbose) {
outstr(command, out);
}
if (findkwd(command)) {
outstr(verbose ? " is a shell keyword" : command, out);
goto out;
}
if ((ap = lookupalias(command, 0)) !=
((void *)0)
) {
if (verbose) {
outfmt(out, " is an alias for %s", ap->val);
} else {
outstr("alias ", out);
printalias(ap);
return 0;
}
goto out;
}
if (path ==
((void *)0)
) {
path = ((&(&(&varinit[0])[1])[1])[1].text + 5);
cmdp = cmdlookup(command, 0);
} else {
cmdp =
((void *)0)
;
}
if (cmdp !=
((void *)0)
) {
entry.cmdtype = cmdp->cmdtype;
entry.u = cmdp->param;
} else {
find_command(command, &entry, 0x02, path);
}
switch (entry.cmdtype) {
case 0: {
int j = entry.u.index;
char *p;
if (j == -1) {
p = command;
} else {
do {
padvance(&path, command);
} while (--j >= 0);
p = ((void *)stacknxt);
}
if (verbose) {
outfmt(
out, " is%s %s",
cmdp ? " a tracked alias for" : nullstr, p
);
} else {
outstr(p, out);
}
break;
}
case 1:
if (verbose) {
outstr(" is a shell function", out);
} else {
outstr(command, out);
}
break;
case 2:
if (verbose) {
outfmt(
out, " is a %sshell builtin",
entry.u.cmd->flags & 0x1 ?
"special " : nullstr
);
} else {
outstr(command, out);
}
break;
default:
if (verbose) {
outstr(": not found\n", out);
}
return 127;
}
out:
outc('\n', out);
return 0;
}
| long describe_command(_QWORD *a1, char *a2, char *a3, int a4)
{
const char *v4;
const char *v6;
const char *v7;
char *v9;
char *v10;
_QWORD *v11;
int v12;
long *v13;
const char *v14;
long v15;
int v16;
long v17;
unsigned long v18;
v11 = a1;
v10 = a2;
v9 = a3;
v18 = __readfsqword(0x28u);
if ( a4 )
outstr(v10, v11);
if ( findkwd(v10) )
{
if ( a4 )
v4 = " is a shell keyword";
else
v4 = v10;
outstr(v4, v11);
goto LABEL_45;
}
v15 = lookupalias(v10, 0LL);
if ( v15 )
{
if ( !a4 )
{
outstr("alias ", v11);
printalias(v15);
return 0LL;
}
outfmt(v11, " is an alias for %s", *(const char **)(v15 + 16));
goto LABEL_45;
}
if ( v9 )
{
v13 = 0LL;
}
else
{
v9 = (char *)(varinit[14] + 5LL);
v13 = cmdlookup(v10, 0);
}
if ( v13 )
{
v16 = *((short *)v13 + 8);
v17 = v13[1];
}
else
{
find_command(v10, &v16, 2, (long)v9);
}
if ( v16 == 2 )
{
if ( a4 )
{
if ( (*(_DWORD *)(v17 + 16) & 1) != 0 )
v7 = "special ";
else
v7 = (const char *)&nullstr;
outfmt(v11, " is a %sshell builtin", v7);
goto LABEL_45;
}
goto LABEL_35;
}
if ( v16 <= 2 )
{
if ( !v16 )
{
v12 = v17;
if ( (_DWORD)v17 == -1 )
{
v14 = v10;
}
else
{
do
{
padvance(&v9, v10);
--v12;
}
while ( v12 >= 0 );
v14 = (const char *)stacknxt;
}
if ( a4 )
{
if ( v13 )
v6 = " a tracked alias for";
else
v6 = (const char *)&nullstr;
outfmt(v11, " is%s %s", v6, v14);
}
else
{
outstr(v14, v11);
}
goto LABEL_45;
}
if ( v16 == 1 )
{
if ( a4 )
{
outstr(" is a shell function", v11);
LABEL_45:
outc(0xAu, v11);
return 0LL;
}
LABEL_35:
outstr(v10, v11);
goto LABEL_45;
}
}
if ( a4 )
outstr(": not found\n", v11);
return 127LL;
}
|
static int
bash_spell_correct_shellword (count, key)
int count, key;
{
int opoint, wbeg, wend;
char *text, *newdir;
opoint = rl_point;
while (count)
{
bash_backward_shellword (1, key);
wbeg = rl_point;
bash_forward_shellword (1, key);
wend = rl_point;
if (wbeg > wend)
break;
text = rl_copy_text (wbeg, wend);
newdir = dirspell (text);
if (newdir)
{
rl_begin_undo_group ();
rl_delete_text (wbeg, wend);
rl_point = wbeg;
if (*newdir)
rl_insert_text (newdir);
rl_mark = wbeg;
rl_end_undo_group ();
}
sh_xfree((text), "bashline.c", 1374);
sh_xfree((newdir), "bashline.c", 1375);
if (rl_point >= rl_end)
break;
count--;
if (count)
bash_forward_shellword (1, key);
}
return 0;
}
| long long bash_spell_correct_shellword(unsigned long long a0, unsigned long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned long long v4;
char *v5;
v0 = a0;
v1 = rl_point;
while (v0) {
bash_backward_shellword(0x1, a1);
v2 = rl_point;
bash_forward_shellword(0x1, a1);
v3 = rl_point;
if (v2 > v3)
return 0;
v4 = rl_copy_text(v2, v3, v3);
v5 = dirspell(v4);
if (v5) {
rl_begin_undo_group(v2, a1, v3, a3, a4, a5);
rl_delete_text(v2, v3, v3);
rl_point = v2;
if (*(v5))
rl_insert_text(v5);
rl_mark = v2;
rl_end_undo_group(a0, a1, a2, a3, a4, a5);
}
sh_xfree(v4, "bashline.c", 0x55e);
sh_xfree(v5, "bashline.c", 0x55f);
if (rl_point >= rl_end)
return 0;
v0 = v0 - 1;
if (v0)
bash_forward_shellword(0x1, a1);
}
return 0;
}
|
static void syslog_sg (const char *name, const char *group)
{
const char *loginname = getlogin ();
const char *tty = ttyname (0);
char *free_login =
((void *)0)
, *free_tty =
((void *)0)
;
if (loginname !=
((void *)0)
) {
free_login = xstrdup (loginname);
loginname = free_login;
}
if (tty !=
((void *)0)
) {
free_tty = xstrdup (tty);
tty = free_tty;
}
if (loginname ==
((void *)0)
) {
loginname = "???";
}
if (tty ==
((void *)0)
) {
tty = "???";
} else if (strncmp (tty, "/dev/", 5) == 0) {
tty += 5;
}
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 (
6
, "user '%s' (login '%s' on %s) switched to group '%s'", name, loginname, tty, group) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
)
;
free(free_login);
free(free_tty);
}
| void syslog_sg(undefined8 param_1,undefined8 param_2)
{
int iVar1;
char *__s;
char *local_38;
char *local_30;
char *local_28;
char *local_20;
char *local_18;
local_38 = getlogin();
local_30 = ttyname(0);
local_28 = (char *)0x0;
local_20 = (char *)0x0;
if (local_38 != (char *)0x0) {
local_38 = (char *)xstrdup(local_38);
local_28 = local_38;
}
if (local_30 != (char *)0x0) {
local_30 = (char *)xstrdup(local_30);
local_20 = local_30;
}
if (local_38 == (char *)0x0) {
local_38 = "???";
}
if (local_30 == (char *)0x0) {
local_30 = "???";
}
else {
iVar1 = strncmp(local_30,"/dev/",5);
if (iVar1 == 0) {
local_30 = local_30 + 5;
}
}
__s = setlocale(6,(char *)0x0);
local_18 = (char *)0x0;
if (__s != (char *)0x0) {
local_18 = strdup(__s);
}
if (local_18 != (char *)0x0) {
setlocale(6,"C");
}
syslog(6,"user \'%s\' (login \'%s\' on %s) switched to group \'%s\'",param_1,local_38,local_30,
param_2);
if (local_18 != (char *)0x0) {
setlocale(6,local_18);
free(local_18);
}
free(local_28);
free(local_20);
return;
}
|
static void
propagate_temp_var (data)
void * data;
{
SHELL_VAR *var;
var = (SHELL_VAR *)data;
if (((((var)->attributes) & (0x0100000))) && (var->attributes & 0x0200000))
push_temp_var (data);
else
{
if (find_special_var (var->name) >= 0)
tempvar_list[tvlist_ind++] = (char *)strcpy (sh_xmalloc((1 + strlen (var->name)), "variables.c", 4665), (var->name));
dispose_variable (var);
}
}
| long long propagate_temp_var(struct_0 *a0) {
unsigned long long v1;
if ((a0->field_28 & 0x100000) && (a0->field_28 & 0x200000)) {
v1 = push_temp_var(a0);
return v1;
}
if (find_special_var(a0->field_0) >= 0) {
tvlist_ind = 3850979414;
g_69a58aa818cd8afb = strcpy(sh_xmalloc(strlen(a0->field_0) + 1, "variables.c", 0x1239), a0->field_0);
}
v1 = dispose_variable(a0);
return v1;
}
|
static int
compare_names_found (struct name const *n1, struct name const *n2)
{
int found_diff = (occurrence_option == 0 ? (n2)->found_count != 0 : (n2)->found_count >= occurrence_option) - (occurrence_option == 0 ? (n1)->found_count != 0 : (n1)->found_count >= occurrence_option);
return found_diff ? found_diff : strcmp (n1->name, n2->name);
}
| int compare_names_found(long a1, long a2)
{
int v2;
int v3;
if ( occurrence_option )
v2 = *(_QWORD *)(a2 + 48) >= occurrence_option;
else
v2 = *(_QWORD *)(a2 + 48) != 0LL;
if ( occurrence_option )
v3 = *(_QWORD *)(a1 + 48) >= occurrence_option;
else
v3 = *(_QWORD *)(a1 + 48) != 0LL;
if ( v2 == v3 )
return strcmp(*(const char **)(a1 + 16), *(const char **)(a2 + 16));
else
return v2 - v3;
}
|
static int
tilde_find_prefix (const char *string, int *len)
{
register int i, j, string_len;
register char **prefixes;
prefixes = tilde_additional_prefixes;
string_len = strlen (string);
*len = 0;
if (*string == '\0' || *string == '~')
return (0);
if (prefixes)
{
for (i = 0; i < string_len; i++)
{
for (j = 0; prefixes[j]; j++)
{
if (strncmp (string + i, prefixes[j], strlen (prefixes[j])) == 0)
{
*len = strlen (prefixes[j]) - 1;
return (i + *len);
}
}
}
}
return (string_len);
}
| int tilde_find_prefix(char *a0, unsigned int *a1) {
unsigned int v1;
unsigned long long v2;
void* v3;
unsigned int v4;
v1 = strlen(a0);
v2 = v1;
*(a1) = 0;
if (!*(a0)) {
LABEL_400051:
v1 = 0;
} else {
if (*(a0) == 126)
goto LABEL_400051;
if (tilde_additional_prefixes) {
v4 = 0;
while (v4 < v1) {
v3 = 0;
while (true) {
if (!*(((v3 << 3) + tilde_additional_prefixes))) {
v4 = 1;
break;
} else {
v1 = strncmp(a0, *((v3 * 8 + tilde_additional_prefixes)), strlen(*((v3 * 8 + tilde_additional_prefixes))));
if (!v1) {
*(a1) = strlen(*((v3 * 8 + tilde_additional_prefixes))) - 1;
v1 = *(a1);
goto LABEL_400106;
} else {
v3 = v3 + 1;
}
}
}
}
}
v1 = v2;
}
LABEL_400106:
return v1;
}
|
SHELL_VAR *
find_variable_notempenv (name)
const char *name;
{
SHELL_VAR *var;
var = find_variable_internal (name, 0);
if (var && ((((var)->attributes) & (0x0000800))))
var = find_variable_nameref (var);
return (var);
}
| long long find_variable_notempenv(unsigned long long a0) {
struct_0 *v0;
v0 = find_variable_internal(a0, 0x0);
if (!v0) {
return v0;
} else if (!(v0->field_28 & 0x800)) {
return v0;
} else {
v0 = find_variable_nameref(v0);
return v0;
}
}
|
static void tls_log_func(int level, const char *str)
{
fprintf(
stderr
, "|<%d>| %s", level, str);
}
| long long tls_log_func(unsigned long a0, unsigned long a1) {
return fprintf(stderr, "|<%d>| %s", a0, a1);
}
|
static int release_inode_block(ext2_filsys fs,
blk64_t *block_nr,
e2_blkcnt_t blockcnt,
blk64_t ref_blk __attribute__((unused)),
int ref_offset __attribute__((unused)),
void *priv_data)
{
struct process_block_struct *pb;
e2fsck_t ctx;
struct problem_context *pctx;
blk64_t blk = *block_nr;
blk64_t cluster = ((*block_nr) >> (fs)->cluster_ratio_bits);
int retval = 0;
pb = (struct process_block_struct *) priv_data;
ctx = pb->ctx;
pctx = pb->pctx;
pctx->blk = blk;
pctx->blkcount = blockcnt;
if (blk == 0)
return 0;
if (pb->last_cluster == cluster)
return 0;
pb->last_cluster = cluster;
if ((blk < fs->super->s_first_data_block) ||
(blk >= ext2fs_blocks_count(fs->super))) {
fix_problem(ctx, 0x000021, pctx);
return_abort:
pb->abort = 1;
return 2;
}
if (!ext2fs_test_block_bitmap2(fs->block_map, blk)) {
fix_problem(ctx, 0x000022, pctx);
goto return_abort;
}
if (pb->truncating) {
if (blockcnt < 0) {
int i, limit;
blk_t *bp;
pb->errcode = io_channel_read_blk64(fs->io, blk, 1,
pb->buf);
if (pb->errcode)
goto return_abort;
limit = fs->blocksize >> 2;
for (i = 0, bp = (blk_t *) pb->buf;
i < limit; i++, bp++)
if (*bp)
return 0;
}
if (blockcnt >= 0 && blockcnt < pb->truncate_block)
return 0;
if ((blockcnt == pb->truncate_block) && pb->truncate_offset) {
pb->errcode = io_channel_read_blk64(fs->io, blk, 1,
pb->buf);
if (pb->errcode)
goto return_abort;
memset(pb->buf + pb->truncate_offset, 0,
fs->blocksize - pb->truncate_offset);
pb->errcode = io_channel_write_blk64(fs->io, blk, 1,
pb->buf);
if (pb->errcode)
goto return_abort;
}
pb->truncated_blocks++;
*block_nr = 0;
retval |= 1;
}
if (ctx->qctx)
quota_data_sub(ctx->qctx, pb->inode, 0, ctx->fs->blocksize);
ext2fs_block_alloc_stats2(fs, blk, -1);
ctx->free_blocks++;
return retval;
}
| long long release_inode_block(struct_1 *a0, unsigned long long *a1, unsigned long a2, unsigned long a3, unsigned long a4, struct_0 *a5) {
unsigned int v0;
unsigned long v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int *v5;
unsigned long long v6;
unsigned long v7;
struct_3 *v8;
unsigned long long v9[8];
unsigned long long v11;
v1 = a3;
v0 = a4;
v6 = *(a1);
v7 = *(a1) >> (a0->field_c0 & 63);
v2 = 0;
v8 = a5->field_0;
v9[0] = a5->field_10;
v9[5] = v6;
v9[7] = a2;
if (!v6) {
v11 = 0;
} else if (v7 == a5->field_38) {
v11 = 0;
} else {
a5->field_38 = v7;
if (v6 < a0->field_20->field_14) {
LABEL_40058a:
fix_problem(v8, 0x21, v9);
goto LABEL_4005a8;
} else {
if (!(v6 < ext2fs_blocks_count(a0->field_20)))
goto LABEL_40058a;
if (!ext2fs_test_block_bitmap2(a0->field_58, v6, v6)) {
fix_problem(v8, 0x22, v9);
goto LABEL_4005a8;
}
if (!a5->field_18) {
LABEL_40079f:
if (v8->field_278)
quota_data_sub(v8->field_278, a5->field_40, 0x0, v8->field_0->field_28);
ext2fs_block_alloc_stats2(a0, v6, 0xffffffff, v6);
v8->field_70 = v8->field_70 + 1;
v11 = v2;
} else {
if ((a2 - 0 >> 63)) {
a5->field_30 = io_channel_read_blk64(a0->field_8, v6, 0x1, a5->field_8);
if (!(!a5->field_30))
goto LABEL_4005a8;
v4 = a0->field_28 >> 2;
v3 = 0;
v5 = a5->field_8;
while (true) {
if (v3 >= v4)
break;
if (*(v5)) {
v11 = 0;
goto LABEL_40080d;
} else {
v3 += 1;
v5 += 1;
}
}
}
if (!((a2 - 0 >> 63)) && a2 < a5->field_20) {
v11 = 0;
goto LABEL_40080d;
}
if (a2 == a5->field_20 && a5->field_1c) {
a5->field_30 = io_channel_read_blk64(a0->field_8, v6, 0x1, a5->field_8);
if (!a5->field_30) {
memset(a5->field_1c + a5->field_8, 0x0, a0->field_28 - a5->field_1c);
a5->field_30 = io_channel_write_blk64(a0->field_8, v6, 0x1, a5->field_8);
if (!a5->field_30)
goto LABEL_40077f;
}
LABEL_4005a8:
a5->field_2c = 1;
v11 = 2;
goto LABEL_40080d;
}
LABEL_40077f:
a5->field_28 = a5->field_28 + 1;
*(a1) = 0;
v2 |= 1;
goto LABEL_40079f;
}
}
}
LABEL_40080d:
return v11;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.