input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
static void
specify_value (char const **var, char const *value, char const *option)
{
if (*var && ! (strcmp (*var, value) == 0))
{
error (0, 0, gettext ("conflicting %s option value '%s'"), option, value);
try_help (
((void *)0)
,
((void *)0)
);
}
*var = value;
}
| const char ** specify_value(const char **a1, const char *a2, long a3)
{
char *v3;
const char **result;
if ( *a1 && strcmp(*a1, a2) )
{
v3 = gettext("conflicting %s option value '%s'");
error(0, 0, v3, a3, a2);
try_help(0LL, 0LL);
}
result = a1;
*a1 = a2;
return result;
}
|
static void usage(void)
{
fprintf(
stderr
,
"Usage: ip monitor [ all | OBJECTS ] [ FILE ] [ label ] [ all-nsid ]\n"
" [ dev DEVICE ]\n"
"OBJECTS := address | link | mroute | neigh | netconf |\n"
" nexthop | nsid | prefix | route | rule | stats\n"
"FILE := file FILENAME\n");
exit(-1);
}
| void usage() {
fprintf(stderr, "Usage: ip monitor [ all | OBJECTS ] [ FILE ] [ label ] [ all-nsid ]\n [ dev DEVICE ]\nOBJECTS := address | link | mroute | neigh | netconf |\n nexthop | nsid | prefix | route | rule | stats\nFILE := file FILENAME\n");
exit(0xffffffff);
}
|
) {
sshlog("auth-shadow.c", __func__, 96, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Could not get shadow information for %.100s", user);
return 0;
}
| void sshlog(void)
{
halt_baddata();
}
|
static error_t
names_parse_opt (int key, char *arg, struct argp_state *state)
{
switch (key)
{
case 'C':
name_add_dir (arg);
break;
case 'T':
name_add_file (arg);
break;
case ADD_FILE_OPTION:
name_add_name (arg);
break;
case 0x1000005:
{
struct tar_args *args = state->input;
if (args->loc->source == OPTS_FILE)
{
error (0, 0, gettext ("%s:%lu: unrecognized option"), args->loc->name,
(unsigned long) args->loc->line);
set_exit_status (2);
}
return
7
;
}
default:
if (is_file_selection_option (key))
name_add_option (key, arg);
else
return
7
;
}
return 0;
}
| long names_parse_opt(int a1, long a2, long a3)
{
long v3;
long v4;
char *v5;
long v7;
if ( a1 != 16777221 )
{
if ( a1 <= 16777221 )
{
if ( a1 == 256 )
{
name_add_name(a2);
return 0LL;
}
if ( a1 <= 256 )
{
if ( a1 == 67 )
{
name_add_dir(a2);
}
else
{
if ( a1 != 84 )
goto LABEL_14;
name_add_file(a2);
}
return 0LL;
}
}
LABEL_14:
if ( !is_file_selection_option(a1) )
return 7LL;
name_add_option(a1, a2);
return 0LL;
}
v7 = *(_QWORD *)(a3 + 40);
if ( **(_DWORD **)v7 == 2 )
{
v3 = *(_QWORD *)(*(_QWORD *)v7 + 16LL);
v4 = *(_QWORD *)(*(_QWORD *)v7 + 8LL);
v5 = gettext("%s:%lu: unrecognized option");
error(0, 0, v5, v4, v3);
set_exit_status(2LL);
}
return 7LL;
}
|
COMMAND *
make_bare_simple_command ()
{
COMMAND *command;
SIMPLE_COM *temp;
command = (COMMAND *)sh_xmalloc((sizeof (COMMAND)), "make_cmd.c", 501);
command->value.Simple = temp = (SIMPLE_COM *)sh_xmalloc((sizeof (SIMPLE_COM)), "make_cmd.c", 502);
temp->flags = 0;
temp->line = line_number;
temp->words = (WORD_LIST *)
((void *)0)
;
temp->redirects = (REDIRECT *)
((void *)0)
;
command->type = cm_simple;
command->redirects = (REDIRECT *)
((void *)0)
;
command->flags = 0;
return (command);
}
| int make_bare_simple_command() {
struct_0 *v0;
struct_1 *v1;
v0 = sh_xmalloc(0x20, "make_cmd.c", 0x1f5);
v1 = sh_xmalloc(0x18, "make_cmd.c", 0x1f6);
v0->field_18 = v1;
v1->field_0 = 0;
v1->field_4 = line_number;
v1->field_8 = 0;
v1->field_10 = 0;
v0->field_0 = 4;
v0->field_10 = 0;
v0->field_4 = 0;
return v0;
}
|
static inline __u8 rta_getattr_u8(const struct rtattr *rta)
{
return *(__u8 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| undefined rta_getattr_u8(long param_1)
{
return *(undefined *)(param_1 + 4);
}
|
static void
print_char (char c)
{
if (tabify_output)
{
if (c == ' ')
{
++spaces_not_printed;
return;
}
else if (spaces_not_printed > 0)
print_white_space ();
if (!
((*__ctype_b_loc ())[(int) ((
to_uchar (c)
))] & (unsigned short int) _ISprint)
)
{
if (c == '\b')
--output_position;
}
else
++output_position;
}
putchar_unlocked (c);
}
| void print_char(unsigned long a0) {
unsigned long long v1;
unsigned short v3;
unsigned int v4;
unsigned long long v5;
if (tabify_output) {
if (a0 == 32) {
v1 = spaces_not_printed + 1;
spaces_not_printed = spaces_not_printed + 1;
} else {
if (spaces_not_printed > 0)
print_white_space();
v3 = *((to_uchar(a0) * 2 + *(__ctype_b_loc())));
v4 = v3 & 0x4000;
if (v4) {
output_position = output_position + 1;
} else if (a0 == 8) {
output_position = output_position - 1;
}
}
}
if (!tabify_output || a0 != 32)
v5 = putchar_unlocked(a0);
return;
}
|
void
channel_free(struct ssh *ssh, Channel *c)
{
struct ssh_channels *sc = ssh->chanctxt;
char *s;
u_int i, n;
Channel *other;
struct channel_confirm *cc;
for (n = 0, i = 0; i < sc->channels_alloc; i++) {
if ((other = sc->channels[i]) ==
((void *)0)
)
continue;
n++;
if (c->type == 16 &&
other->type == 20 &&
other->mux_ctx == c) {
other->mux_ctx =
((void *)0)
;
other->type = 4;
other->istate = 3;
other->ostate = 3;
}
}
sshlog("channels.c", __func__, 630, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "channel %d: free: %s, nchannels %u", c->self, c->remote_name ? c->remote_name : "???", n)
;
if (c->type == 16) {
mux_remove_remote_forwardings(ssh, c);
free(c->mux_ctx);
c->mux_ctx =
((void *)0)
;
} else if (c->type == 15) {
free(c->mux_ctx);
c->mux_ctx =
((void *)0)
;
}
if (log_level_get() >= SYSLOG_LEVEL_DEBUG3) {
s = channel_open_message(ssh);
sshlog("channels.c", __func__, 644, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "channel %d: status: %s", c->self, s);
free(s);
}
channel_close_fds(ssh, c);
sshbuf_free(c->input);
sshbuf_free(c->output);
sshbuf_free(c->extended);
c->input = c->output = c->extended =
((void *)0)
;
free(c->remote_name);
c->remote_name =
((void *)0)
;
free(c->path);
c->path =
((void *)0)
;
free(c->listening_addr);
c->listening_addr =
((void *)0)
;
while ((cc = ((&c->status_confirms)->tqh_first)) !=
((void *)0)
) {
if (cc->abandon_cb !=
((void *)0)
)
cc->abandon_cb(ssh, c, cc->ctx);
do { if (((cc)->entry.tqe_next) !=
((void *)0)
) (cc)->entry.tqe_next->entry.tqe_prev = (cc)->entry.tqe_prev; else (&c->status_confirms)->tqh_last = (cc)->entry.tqe_prev; *(cc)->entry.tqe_prev = (cc)->entry.tqe_next; ; ; } while (0);
freezero(cc, sizeof(*cc));
}
if (c->filter_cleanup !=
((void *)0)
&& c->filter_ctx !=
((void *)0)
)
c->filter_cleanup(ssh, c->self, c->filter_ctx);
sc->channels[c->self] =
((void *)0)
;
freezero(c, sizeof(*c));
}
| void channel_free(struct_2 *a0, struct_0 *a1) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned int v3;
unsigned int v4;
struct_6 *v5;
void* v6;
struct_4 *v7;
struct_3 *v8;
unsigned long long v10;
struct_1 *v11;
unsigned long long v12;
unsigned long long v13;
v5 = a0->field_868;
v4 = 0;
for (v3 = 0; v3 < v5->field_8; v3 += 1) {
v8 = *((v5->field_0 + v3 * 8));
if (v8) {
v4 += 1;
if (a1->field_0 == 16 && v8->field_0 == 20 && a1 == v8->field_150) {
v8->field_150 = 0;
v8->field_0 = 4;
v8->field_10 = 3;
v8->field_14 = 3;
}
}
}
if (!a1->field_a0)
v10 = "???";
else
v10 = a1->field_a0;
v2 = v4;
v1 = v10;
v0 = a1->field_4;
sshlog("channels.c", "channel_free", 0x276, 0x0, 0x5, 0x0, "channel %d: free: %s, nchannels %u");
if (a1->field_0 == 16) {
mux_remove_remote_forwardings(a0, a1);
free(a1->field_150);
a1->field_150 = 0;
} else if (a1->field_0 == 15) {
free(a1->field_150);
a1->field_150 = 0;
}
if (log_level_get() > 6) {
v6 = channel_open_message(a0, a1, 0x276, 0x0, 0x5, 0x0);
v1 = v6;
v0 = a1->field_4;
sshlog("channels.c", "channel_free", 0x284, 0x0, 0x7, 0x0, "channel %d: status: %s");
free(v6);
}
channel_close_fds(a0, a1);
sshbuf_free(a1->field_68);
sshbuf_free(a1->field_70);
sshbuf_free(a1->field_78);
a1->field_78 = 0;
a1->field_70 = a1->field_78;
a1->field_68 = a1->field_70;
free(a1->field_a0);
a1->field_a0 = 0;
free(a1->field_80);
a1->field_80 = 0;
free(a1->field_90);
a1->field_90 = 0;
while (true) {
v7 = a1->field_f0;
if (!v7)
break;
if (v7->field_18)
v7->field_18(a0, a1, v7->field_20, a1, v7->field_18);
if (v7->field_0)
v7->field_0->field_8 = v7->field_8;
else
a1->field_f8 = v7->field_8;
v11 = v7->field_0;
v7->field_8->field_0 = v7->field_0;
freezero(v7, 0x28, v11);
}
if (a1->field_118 && a1->field_110)
a1->field_118(a0, a1->field_4, a1->field_110, a1->field_4, a1->field_118);
v12 = v5->field_0;
*((a1->field_4 * 8 + v5->field_0)) = 0;
v13 = freezero(a1, 0x160, v12);
return;
}
|
void *
hash_insert (Hash_table *table, void const *entry)
{
void const *matched_ent;
int err = hash_insert_if_absent (table, entry, &matched_ent);
return (err == -1
?
((void *)0)
: (void *) (err == 0 ? matched_ent : entry));
}
| long hash_insert(_QWORD *a1, long a2)
{
int inserted;
long v4[2];
v4[1] = __readfsqword(0x28u);
inserted = hash_insert_if_absent(a1, a2, v4);
if ( inserted == -1 )
return 0LL;
if ( inserted )
return a2;
return v4[0];
}
|
unsigned char crypto_sign_ed25519_ref_fe25519_getparity(const crypto_sign_ed25519_ref_fe25519 *x)
{
crypto_sign_ed25519_ref_fe25519 t = *x;
crypto_sign_ed25519_ref_fe25519_freeze(&t);
return t.v[0] & 1;
}
| long crypto_sign_ed25519_ref_fe25519_getparity(long *a1)
{
long v1;
long v2;
long v3;
long v4;
long v5;
long v6;
long v7;
long v8;
long v10[20];
v10[17] = __readfsqword(0x28u);
v1 = a1[1];
v10[0] = *a1;
v10[1] = v1;
v2 = a1[3];
v10[2] = a1[2];
v10[3] = v2;
v3 = a1[5];
v10[4] = a1[4];
v10[5] = v3;
v4 = a1[7];
v10[6] = a1[6];
v10[7] = v4;
v5 = a1[9];
v10[8] = a1[8];
v10[9] = v5;
v6 = a1[11];
v10[10] = a1[10];
v10[11] = v6;
v7 = a1[13];
v10[12] = a1[12];
v10[13] = v7;
v8 = a1[15];
v10[14] = a1[14];
v10[15] = v8;
crypto_sign_ed25519_ref_fe25519_freeze((long)v10);
return v10[0] & 1;
}
|
stderr
,
gettext ("%s: Cannot determine your user name.\n"),
Prog);
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
4
, "Cannot determine the user name of the caller (UID %lu)", (unsigned long) caller_uid) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
| void gettext(void)
{
halt_baddata();
}
|
ARRAY *
array_from_word_list (list)
WORD_LIST *list;
{
ARRAY *a;
if (list == 0)
return((ARRAY *)
((void *)0)
);
a = array_create();
return (array_assign_list (a, list));
}
| long long array_from_word_list(unsigned long long a0) {
unsigned long long v0;
void* v2;
if (!a0) {
v2 = 0;
return v2;
}
v0 = array_create();
v2 = array_assign_list(v0, a0);
return v2;
}
|
static void print_explain(struct link_util *lu, FILE *f)
{
fprintf(f,
"Usage: ... %s [ mode MODE ] [ FLAGS ]\n"
"\n"
"MODE: l3 | l3s | l2\n"
"FLAGS: bridge | private | vepa\n"
"(first values are the defaults if nothing is specified).\n",
lu->id);
}
| void print_explain(long param_1,FILE *param_2)
{
fprintf(param_2,
"Usage: ... %s [ mode MODE ] [ FLAGS ]\n\nMODE: l3 | l3s | l2\nFLAGS: bridge | private | vepa\n(first values are the defaults if nothing is specified).\n"
,*(undefined8 *)(param_1 + 8));
return;
}
|
PIDQ_HEAD *init_pid_q(PIDQ_HEAD *q)
{
q->head = q->next = q->tail =
((void *)0)
;
return q;
}
| undefined8 * init_pid_q(undefined8 *param_1)
{
param_1[1] = 0;
param_1[2] = param_1[1];
*param_1 = param_1[2];
return param_1;
}
|
void
xheader_xattr_init (struct tar_stat_info *st)
{
st->xattr_map =
((void *)0)
;
st->xattr_map_size = 0;
st->acls_a_ptr =
((void *)0)
;
st->acls_a_len = 0;
st->acls_d_ptr =
((void *)0)
;
st->acls_d_len = 0;
st->cntx_name =
((void *)0)
;
}
| _QWORD * xheader_xattr_init(_QWORD *a1)
{
_QWORD *result;
a1[44] = 0LL;
a1[43] = 0LL;
a1[7] = 0LL;
a1[8] = 0LL;
a1[9] = 0LL;
a1[10] = 0LL;
result = a1;
a1[6] = 0LL;
return result;
}
|
static inline void
emit_stdin_note (void)
{
fputs_unlocked (gettext ("\nWith no FILE, or when FILE is -, read standard input.\n"),
stdout
)
;
}
| void emit_stdin_note(void)
{
char *__s;
FILE *__stream;
__stream = stdout;
__s = (char *)gettext("\nWith no FILE, or when FILE is -, read standard input.\n");
fputs_unlocked(__s,__stream);
return;
}
|
int gzwrite(file, buf, len)
gzFile file;
voidpc buf;
unsigned len;
{
gz_statep state;
if (file ==
((void *)0)
)
return 0;
state = (gz_statep)file;
if (state->mode != 31153 || state->err != 0)
return 0;
if ((int)len < 0) {
gz_error(state, (-3), "requested length does not fit in int");
return 0;
}
return (int)gz_write(state, buf, len);
}
| undefined8 gzwrite(long param_1,undefined8 param_2,int param_3)
{
undefined8 uVar1;
if (param_1 == 0) {
uVar1 = 0;
}
else if ((*(int *)(param_1 + 0x18) == 0x79b1) && (*(int *)(param_1 + 0x74) == 0)) {
if (param_3 < 0) {
gz_error(param_1,0xfffffffd,"requested length does not fit in int");
uVar1 = 0;
}
else {
uVar1 = gz_write(param_1,param_2,param_3);
}
}
else {
uVar1 = 0;
}
return uVar1;
}
|
static char *
pos_params_modcase (string, pat, modop, mflags)
char *string, *pat;
int modop;
int mflags;
{
WORD_LIST *save, *params;
WORD_DESC *w;
char *ret;
int pchar, qflags, pflags;
save = params = list_rest_of_args ();
if (save == 0)
return ((char *)
((void *)0)
);
for ( ; params; params = params->next)
{
ret = sh_modcase (params->word->word, pat, modop);
w = alloc_word_desc ();
w->word = ret ? ret : (char *)strcpy (sh_xmalloc((1 + strlen ("")), "subst.c", 9313), (""));
dispose_word (params->word);
params->word = w;
}
pchar = (mflags & 0x080) == 0x080 ? '*' : '@';
qflags = (mflags & 0x020) == 0x020 ? 0x001 : 0;
pflags = (mflags & 0x040) == 0x040 ? 0x08 : 0;
if (pchar == '*' && (mflags & 0x040) && ifs_is_null)
qflags |= 0x001;
ret = string_list_pos_params (pchar, save, qflags, pflags);
dispose_words (save);
return (ret);
}
| char * pos_params_modcase(long a1, long a2, unsigned int a3, int a4)
{
size_t v5;
char *v6;
char *v7;
int v8;
int v11;
long v12;
long **v13;
long v14;
char *v15;
char **v16;
v12 = list_rest_of_args();
v13 = (long **)v12;
if ( !v12 )
return 0LL;
while ( v12 )
{
v14 = sh_modcase(**(_QWORD **)(v12 + 8), a2, a3);
v16 = (char **)alloc_word_desc();
if ( v14 )
{
v7 = (char *)v14;
}
else
{
v5 = strlen(&src);
v6 = (char *)sh_xmalloc(v5 + 1, "subst.c", 9313LL);
v7 = strcpy(v6, &src);
}
*v16 = v7;
dispose_word(*(_QWORD *)(v12 + 8));
*(_QWORD *)(v12 + 8) = v16;
v12 = *(_QWORD *)v12;
}
if ( (a4 & 0x80) != 0 )
v8 = 42;
else
v8 = 64;
v11 = (a4 >> 5) & 1;
if ( v8 == 42 && (a4 & 0x40) != 0 )
{
if ( ifs_is_null )
v11 = 1;
}
v15 = string_list_pos_params(v8, v13, v11, (a4 >> 3) & 8);
dispose_words(v13);
return v15;
}
|
int
open_redir_file (r, fnp)
REDIRECT *r;
char **fnp;
{
char *fn;
int fd, rval;
if (r->instruction != r_input_direction)
return -1;
if (posixly_correct && !interactive_shell)
disallow_filename_globbing++;
fn = redirection_expand (r->redirectee.filename);
if (posixly_correct && !interactive_shell)
disallow_filename_globbing--;
if (fn == 0)
{
redirection_error (r, -1, fn);
return -1;
}
fd = open(fn,
00
);
if (fd < 0)
{
file_error (fn);
sh_xfree((fn), "evalstring.c", 735);
if (fnp)
*fnp = 0;
return -1;
}
if (fnp)
*fnp = fn;
return fd;
}
| int open_redir_file(long param_1,char **param_2)
{
int iVar1;
char *__file;
if (*(int *)(param_1 + 0x18) == 1) {
if ((posixly_correct != 0) && (interactive_shell == 0)) {
disallow_filename_globbing = disallow_filename_globbing + 1;
}
__file = (char *)redirection_expand(*(undefined8 *)(param_1 + 0x20));
if ((posixly_correct != 0) && (interactive_shell == 0)) {
disallow_filename_globbing = disallow_filename_globbing + -1;
}
if (__file == (char *)0x0) {
redirection_error(param_1,0xffffffff,0);
iVar1 = -1;
}
else {
iVar1 = open(__file,0);
if (iVar1 < 0) {
file_error(__file);
sh_xfree(__file,"evalstring.c",0x2df);
if (param_2 != (char **)0x0) {
*param_2 = (char *)0x0;
}
iVar1 = -1;
}
else if (param_2 != (char **)0x0) {
*param_2 = __file;
}
}
}
else {
iVar1 = -1;
}
return iVar1;
}
|
static int
rl_digit_loop1 (void)
{
int c, r;
while (1)
{
if (_rl_arg_overflow ())
return 1;
c = _rl_arg_getchar ();
r = _rl_vi_arg_dispatch (c);
if (r <= 0)
break;
}
(rl_readline_state &= ~(0x0000400));
return (0);
}
| void rl_digit_loop1() {
unsigned int v0;
int tmp_7;
unsigned int v1;
unsigned long long v3;
void* v4;
unsigned long long v5;
while (true) {
if (!_rl_arg_overflow()) {
v0 = _rl_arg_getchar();
v1 = _rl_vi_arg_dispatch(v0);
if (v1 <= 0) {
v3 = rl_readline_state;
*(&v3) = (rl_readline_state >> 8) & 251;
tmp_7 = v3;
rl_readline_state = tmp_7;
v4 = 0;
return;
}
} else {
v5 = 1;
return;
}
}
}
|
void
ssh_packet_set_timeout(struct ssh *ssh, int timeout, int count)
{
struct session_state *state = ssh->state;
if (timeout <= 0 || count <= 0) {
state->packet_timeout_ms = -1;
return;
}
if ((0x7fffffff / 1000) / count < timeout)
state->packet_timeout_ms = 0x7fffffff;
else
state->packet_timeout_ms = timeout * count * 1000;
}
| long long ssh_packet_set_timeout(unsigned long long *a0, unsigned long a1, unsigned long a2) {
struct_0 *v0;
struct_0 *v2;
v0 = *(a0);
if (a1 > 0 && a2 > 0) {
if (a1 > (2147483 /m a2)) {
v2 = v0;
v0->field_150 = 2147483647;
} else {
v2 = v0;
v0->field_150 = __mulvsi3(__mulvsi3(a1, a2), 0x3e8);
}
}
if (a1 <= 0 || a2 <= 0) {
v2 = v0;
v0->field_150 = -1;
}
return v2;
}
|
int do_ipila(int argc, char **argv)
{
if (argc < 1)
usage();
if (matches(*argv, "help") == 0)
usage();
if (genl_init_handle(&genl_rth, "ila", &genl_family))
exit(1);
if (matches(*argv, "add") == 0)
return do_add(argc-1, argv+1);
if (matches(*argv, "delete") == 0)
return do_del(argc-1, argv+1);
if (matches(*argv, "list") == 0)
return do_list(argc-1, argv+1);
fprintf(
stderr
, "Command \"%s\" is unknown, try \"ip ila help\".\n",
*argv);
exit(-1);
}
| long long do_ipila(unsigned long a0, unsigned long long *a1) {
unsigned long long v3;
if (a0 <= 0) {
usage();
} else if ((matches(*(a1), "help") ^ 1)) {
usage();
} else if (genl_init_handle(&genl_rth, "ila", &genl_family)) {
exit(0x1);
} else {
if ((matches(*(a1), "add") ^ 1)) {
v3 = do_add(a0 - 1, a1 + 8);
} else if ((matches(*(a1), "delete") ^ 1)) {
v3 = do_del(a0 - 1, a1 + 8);
} else if ((matches(*(a1), "list") ^ 1)) {
v3 = do_list(a0 - 1, a1 + 1);
} else {
fprintf(stderr, "Command \"%s\" is unknown, try \"ip ila help\".\n", *(a1));
exit(0xffffffff);
}
return v3;
}
}
|
(!iswspace(c) && (c < 33 || (c > 60 && c < 62) || c > 126)) ||
wcschr(L"#$@[\\]^`{|}~", c) !=
| && (iswspace(a2) || a2 > 0x20 && a2 != 61 && a2 <= 0x7E)
&& !wcschr(U"#$@[\\]^`{|}~", a2) )
|
int
match_user(const char *user, const char *host, const char *ipaddr,
const char *pattern)
{
char *p, *pat;
int ret;
if (user ==
((void *)0)
&& host ==
((void *)0)
&& ipaddr ==
((void *)0)
) {
if ((p = strchr(pattern, '@')) !=
((void *)0)
&&
match_host_and_ip(
((void *)0)
,
((void *)0)
, p + 1) < 0)
return -1;
return 0;
}
if ((p = strchr(pattern, '@')) ==
((void *)0)
)
return match_pattern(user, pattern);
pat = xstrdup(pattern);
p = strchr(pat, '@');
*p++ = '\0';
if ((ret = match_pattern(user, pat)) == 1)
ret = match_host_and_ip(host, ipaddr, p);
free(pat);
return ret;
}
| long match_user(__int128 a1, long a3, char *a4)
{
char *v4;
unsigned int matched;
char *v8;
const char *v9;
char *v10;
if ( a1 != 0 || a3 )
{
if ( strchr(a4, 64) )
{
v10 = (char *)xstrdup(a4);
v4 = strchr(v10, 64);
v9 = v4 + 1;
*v4 = 0;
matched = match_pattern((_BYTE *)a1, v10);
if ( matched == 1 )
matched = match_host_and_ip(*((long *)&a1 + 1), a3, v9);
free(v10);
return matched;
}
else
{
return match_pattern((_BYTE *)a1, a4);
}
}
else
{
v8 = strchr(a4, 64);
if ( v8 && (int)match_host_and_ip(0LL, 0LL, v8 + 1) < 0 )
return 0xFFFFFFFFLL;
else
return 0LL;
}
}
|
int
tok_line(Tokenizer *tok, const LineInfo *line,
int *argc, const char ***argv, int *cursorc, int *cursoro)
{
const char *ptr;
int cc, co;
cc = co = -1;
ptr = line->buffer;
for (ptr = line->buffer; ;ptr++) {
if (ptr >= line->lastchar)
ptr = "";
if (ptr == line->cursor) {
cc = (int)tok->argc;
co = (int)(tok->wptr - tok->wstart);
}
switch (*ptr) {
case '\'':
tok->flags |= 1;
tok->flags &= ~2;
switch (tok->quote) {
case Q_none:
tok->quote = Q_single;
break;
case Q_single:
tok->quote = Q_none;
break;
case Q_one:
tok->quote = Q_none;
*tok->wptr++ = *ptr;
break;
case Q_double:
*tok->wptr++ = *ptr;
break;
case Q_doubleone:
tok->quote = Q_double;
*tok->wptr++ = *ptr;
break;
default:
return -1;
}
break;
case '"':
tok->flags &= ~2;
tok->flags |= 1;
switch (tok->quote) {
case Q_none:
tok->quote = Q_double;
break;
case Q_double:
tok->quote = Q_none;
break;
case Q_one:
tok->quote = Q_none;
*tok->wptr++ = *ptr;
break;
case Q_single:
*tok->wptr++ = *ptr;
break;
case Q_doubleone:
tok->quote = Q_double;
*tok->wptr++ = *ptr;
break;
default:
return -1;
}
break;
case '\\':
tok->flags |= 1;
tok->flags &= ~2;
switch (tok->quote) {
case Q_none:
tok->quote = Q_one;
break;
case Q_double:
tok->quote = Q_doubleone;
break;
case Q_one:
*tok->wptr++ = *ptr;
tok->quote = Q_none;
break;
case Q_single:
*tok->wptr++ = *ptr;
break;
case Q_doubleone:
tok->quote = Q_double;
*tok->wptr++ = *ptr;
break;
default:
return -1;
}
break;
case '\n':
tok->flags &= ~2;
switch (tok->quote) {
case Q_none:
goto tok_line_outok;
case Q_single:
case Q_double:
*tok->wptr++ = *ptr;
break;
case Q_doubleone:
tok->flags |= 2;
tok->quote = Q_double;
break;
case Q_one:
tok->flags |= 2;
tok->quote = Q_none;
break;
default:
return 0;
}
break;
case '\0':
switch (tok->quote) {
case Q_none:
if (tok->flags & 2) {
tok->flags &= ~2;
return 3;
}
goto tok_line_outok;
case Q_single:
return 1;
case Q_double:
return 2;
case Q_doubleone:
tok->quote = Q_double;
*tok->wptr++ = *ptr;
break;
case Q_one:
tok->quote = Q_none;
*tok->wptr++ = *ptr;
break;
default:
return -1;
}
break;
default:
tok->flags &= ~2;
switch (tok->quote) {
case Q_none:
if (strchr(tok->ifs, *ptr) !=
((void *)0)
)
tok_finish(tok);
else
*tok->wptr++ = *ptr;
break;
case Q_single:
case Q_double:
*tok->wptr++ = *ptr;
break;
case Q_doubleone:
*tok->wptr++ = '\\';
tok->quote = Q_double;
*tok->wptr++ = *ptr;
break;
case Q_one:
tok->quote = Q_none;
*tok->wptr++ = *ptr;
break;
default:
return -1;
}
break;
}
if (tok->wptr >= tok->wmax - 4) {
size_t size = (size_t)(tok->wmax - tok->wspace + 20);
char *s = realloc(tok->wspace, size * sizeof(*s))
;
if (s ==
((void *)0)
)
return -1;
if (s != tok->wspace) {
size_t i;
for (i = 0; i < tok->argc; i++) {
tok->argv[i] =
(tok->argv[i] - tok->wspace) + s;
}
tok->wptr = (tok->wptr - tok->wspace) + s;
tok->wstart = (tok->wstart - tok->wspace) + s;
tok->wspace = s;
}
tok->wmax = s + size;
}
if (tok->argc >= tok->amax - 4) {
char **p;
tok->amax += 10;
p = realloc(tok->argv, tok->amax * sizeof(*p));
if (p ==
((void *)0)
) {
tok->amax -= 10;
return -1;
}
tok->argv = p;
}
}
tok_line_outok:
if (cc == -1 && co == -1) {
cc = (int)tok->argc;
co = (int)(tok->wptr - tok->wstart);
}
if (cursorc !=
((void *)0)
)
*cursorc = cc;
if (cursoro !=
((void *)0)
)
*cursoro = co;
tok_finish(tok);
*argv = (const char **)tok->argv;
*argc = (int)tok->argc;
return 0;
}
| undefined8
tok_line(char **param_1,char **param_2,undefined4 *param_3,char **param_4,int *param_5,int *param_6)
{
char cVar1;
uint uVar2;
char *pcVar3;
char *pcVar4;
char *pcVar5;
int local_38;
int local_34;
char *local_30;
char *local_28;
local_34 = -1;
local_38 = -1;
local_30 = *param_2;
do {
if (param_2[2] <= local_30) {
local_30 = "";
}
if (local_30 == param_2[1]) {
local_38 = (int)param_1[1];
local_34 = (int)param_1[4] - (int)param_1[6];
}
cVar1 = *local_30;
if (cVar1 == '\\') {
*(uint *)((long)param_1 + 0x44) = *(uint *)((long)param_1 + 0x44) | 1;
*(uint *)((long)param_1 + 0x44) = *(uint *)((long)param_1 + 0x44) & 0xfffffffd;
switch(*(undefined4 *)(param_1 + 8)) {
case 0:
*(undefined4 *)(param_1 + 8) = 3;
break;
case 1:
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
break;
case 2:
*(undefined4 *)(param_1 + 8) = 4;
break;
case 3:
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
*(undefined4 *)(param_1 + 8) = 0;
break;
case 4:
*(undefined4 *)(param_1 + 8) = 2;
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
break;
default:
return 0xffffffff;
}
}
else if (cVar1 < ']') {
if (cVar1 == '\'') {
*(uint *)((long)param_1 + 0x44) = *(uint *)((long)param_1 + 0x44) | 1;
*(uint *)((long)param_1 + 0x44) = *(uint *)((long)param_1 + 0x44) & 0xfffffffd;
switch(*(undefined4 *)(param_1 + 8)) {
case 0:
*(undefined4 *)(param_1 + 8) = 1;
break;
case 1:
*(undefined4 *)(param_1 + 8) = 0;
break;
case 2:
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
break;
case 3:
*(undefined4 *)(param_1 + 8) = 0;
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
break;
case 4:
*(undefined4 *)(param_1 + 8) = 2;
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
break;
default:
return 0xffffffff;
}
}
else {
if ('\'' < cVar1) goto LAB_00100844;
if (cVar1 == '\"') {
*(uint *)((long)param_1 + 0x44) = *(uint *)((long)param_1 + 0x44) & 0xfffffffd;
*(uint *)((long)param_1 + 0x44) = *(uint *)((long)param_1 + 0x44) | 1;
switch(*(undefined4 *)(param_1 + 8)) {
case 0:
*(undefined4 *)(param_1 + 8) = 2;
break;
case 1:
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
break;
case 2:
*(undefined4 *)(param_1 + 8) = 0;
break;
case 3:
*(undefined4 *)(param_1 + 8) = 0;
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
break;
case 4:
*(undefined4 *)(param_1 + 8) = 2;
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
break;
default:
return 0xffffffff;
}
}
else {
if ('\"' < cVar1) goto LAB_00100844;
if (cVar1 == '\0') {
switch(*(undefined4 *)(param_1 + 8)) {
case 0:
if ((*(uint *)((long)param_1 + 0x44) & 2) != 0) {
*(uint *)((long)param_1 + 0x44) = *(uint *)((long)param_1 + 0x44) & 0xfffffffd;
return 3;
}
LAB_00100b58:
if ((local_38 == -1) && (local_34 == -1)) {
local_38 = (int)param_1[1];
local_34 = (int)param_1[4] - (int)param_1[6];
}
if (param_5 != (int *)0x0) {
*param_5 = local_38;
}
if (param_6 != (int *)0x0) {
*param_6 = local_34;
}
tok_finish(param_1);
*param_4 = param_1[3];
*param_3 = (int)param_1[1];
return 0;
case 1:
return 1;
case 2:
return 2;
case 3:
*(undefined4 *)(param_1 + 8) = 0;
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
break;
case 4:
*(undefined4 *)(param_1 + 8) = 2;
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
break;
default:
return 0xffffffff;
}
}
else {
if (cVar1 != '\n') goto LAB_00100844;
*(uint *)((long)param_1 + 0x44) = *(uint *)((long)param_1 + 0x44) & 0xfffffffd;
uVar2 = *(uint *)(param_1 + 8);
if (uVar2 == 4) {
*(uint *)((long)param_1 + 0x44) = *(uint *)((long)param_1 + 0x44) | 2;
*(undefined4 *)(param_1 + 8) = 2;
}
else {
if (4 < uVar2) {
return 0;
}
if (uVar2 == 3) {
*(uint *)((long)param_1 + 0x44) = *(uint *)((long)param_1 + 0x44) | 2;
*(undefined4 *)(param_1 + 8) = 0;
}
else {
if (3 < uVar2) {
return 0;
}
if (uVar2 == 0) goto LAB_00100b58;
if (1 < uVar2 - 1) {
return 0;
}
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
}
}
}
}
}
}
else {
LAB_00100844:
*(uint *)((long)param_1 + 0x44) = *(uint *)((long)param_1 + 0x44) & 0xfffffffd;
uVar2 = *(uint *)(param_1 + 8);
if (uVar2 == 4) {
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = '\\';
*(undefined4 *)(param_1 + 8) = 2;
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
}
else {
if (4 < uVar2) {
return 0xffffffff;
}
if (uVar2 == 3) {
*(undefined4 *)(param_1 + 8) = 0;
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
}
else {
if (3 < uVar2) {
return 0xffffffff;
}
if (uVar2 == 0) {
pcVar5 = strchr(*param_1,(int)*local_30);
if (pcVar5 == (char *)0x0) {
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
}
else {
tok_finish(param_1);
}
}
else {
if (1 < uVar2 - 1) {
return 0xffffffff;
}
pcVar5 = param_1[4];
param_1[4] = pcVar5 + 1;
*pcVar5 = *local_30;
}
}
}
}
if (param_1[5] + -4 <= param_1[4]) {
pcVar5 = param_1[5];
pcVar3 = param_1[7];
pcVar4 = (char *)realloc(param_1[7],(size_t)(pcVar5 + (0x14 - (long)pcVar3)));
if (pcVar4 == (char *)0x0) {
return 0xffffffff;
}
if (pcVar4 != param_1[7]) {
for (local_28 = (char *)0x0; local_28 < param_1[1]; local_28 = local_28 + 1) {
*(char **)(param_1[3] + (long)local_28 * 8) =
pcVar4 + (*(long *)(param_1[3] + (long)local_28 * 8) - (long)param_1[7]);
}
param_1[4] = pcVar4 + ((long)param_1[4] - (long)param_1[7]);
param_1[6] = pcVar4 + ((long)param_1[6] - (long)param_1[7]);
param_1[7] = pcVar4;
}
param_1[5] = pcVar4 + (long)(pcVar5 + (0x14 - (long)pcVar3));
}
if (param_1[2] + -4 <= param_1[1]) {
param_1[2] = param_1[2] + 10;
pcVar5 = (char *)realloc(param_1[3],(long)param_1[2] * 8);
if (pcVar5 == (char *)0x0) {
param_1[2] = param_1[2] + -10;
return 0xffffffff;
}
param_1[3] = pcVar5;
}
local_30 = local_30 + 1;
} while( true );
}
|
int xfrm_parse_mark(struct xfrm_mark *mark, int *argcp, char ***argvp)
{
int argc = *argcp;
char **argv = *argvp;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&mark->v, *argv, 0)) {
invarg("MARK value is invalid\n", *argv);
}
if (argc > 1)
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
else {
mark->m = 0xffffffff;
goto done;
}
if (strcmp(*argv, "mask") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&mark->m, *argv, 0)) {
invarg("MASK value is invalid\n", *argv);
}
} else {
mark->m = 0xffffffff;
do { argv--; argc++; } while(0);
}
done:
*argcp = argc;
*argvp = argv;
return 0;
}
| long long xfrm_parse_mark(struct_0 *a0, unsigned int *a1, unsigned long long *a2) {
unsigned int v0;
unsigned long long *v1;
unsigned long long v4;
unsigned long long v5;
v0 = *(a1);
v1 = *(a2);
v1 += 8;
v0 -= 1;
if (v0 <= 0)
incomplete_command();
if (get_u32(a0, *(v1), 0x0, *(v1)))
invarg("MARK value is invalid\n", *(v1));
if (v0 > 1) {
v1 += 8;
v0 -= 1;
if (v0 <= 0) {
incomplete_command();
} else {
v4 = strcmp(*(v1), "mask");
if (!v4) {
v1 += 8;
v0 -= 1;
if (v0 <= 0)
incomplete_command();
v5 = get_u32(&a0->field_4, *(v1), 0x0, &a0->field_4);
if (v5)
invarg("MASK value is invalid\n", *(v1));
}
if (v5 || v4) {
a0->field_4 = -1;
v1 += 1;
v0 += 1;
}
}
}
if (v0 <= 0 || v0 <= 1)
a0->field_4 = -1;
*(a1) = v0;
*(a2) = v1;
return 0;
}
|
static void
tarobject_skip_entry(struct tarcontext *tc, struct tar_entry *ti)
{
if (ti->type == TAR_FILETYPE_FILE) {
struct dpkg_error err;
char fnamebuf[256];
if (buffer_skip_Int(tc->backendpipe, 0, ti->size, &err) < 0)
ohshit(gettext("cannot skip file '%.255s' (replaced or excluded?) from pipe: %s"),
path_quote_filename(fnamebuf, ti->name, 256), err.str);
tarobject_skip_padding(tc, ti);
}
}
| unsigned long tarobject_skip_entry(unsigned int *a1, long a2)
{
long v2;
long v3;
char *v4;
char v6[8];
long v7;
char v8[264];
unsigned long v9;
v9 = __readfsqword(0x28u);
if ( *(_DWORD *)(a2 + 4) == 48 )
{
if ( buffer_skip_Int(*a1, 0LL, *(_QWORD *)(a2 + 24), v6) < 0 )
{
v2 = v7;
v3 = path_quote_filename(v8, *(_QWORD *)(a2 + 8), 256LL);
v4 = gettext("cannot skip file '%.255s' (replaced or excluded?) from pipe: %s");
ohshit(v4, v3, v2);
}
tarobject_skip_padding(a1, a2);
}
return __readfsqword(0x28u) ^ v9;
}
|
void
print_header (struct tar_stat_info *st, union block *blk,
off_t block_ordinal)
{
if (current_format == POSIX_FORMAT && !volume_label_printed && volume_label)
{
print_volume_label ();
volume_label_printed =
1
;
}
simple_print_header (st, blk, block_ordinal);
}
| void print_header(undefined8 param_1,undefined8 param_2,undefined8 param_3)
{
if (((current_format == 4) && (volume_label_printed != '\x01')) && (volume_label != 0)) {
print_volume_label();
volume_label_printed = '\x01';
}
simple_print_header(param_1,param_2,param_3);
return;
}
|
int main (int argc, char **argv)
{
long sys_ngroups;
gid_t *groups;
sys_ngroups = sysconf (
_SC_NGROUPS_MAX
);
groups = (gid_t *) malloc (sizeof (gid_t) * sys_ngroups);
(void) setlocale (
6
, "");
(void) bindtextdomain ("shadow", "/usr/share/locale");
(void) textdomain ("shadow");
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(
stderr
);
if (argc == 1) {
int i;
int pri_grp;
int ngroups = getgroups (sys_ngroups, groups);
if (ngroups < 0) {
perror ("getgroups");
exit (
1
);
}
pri_grp = getegid ();
for (i = 0; i < ngroups; i++) {
if (pri_grp == (int) groups[i]) {
break;
}
}
if (i != ngroups) {
pri_grp = -1;
}
if (-1 != pri_grp) {
struct group *gr;
gr = getgrgid (pri_grp);
if (
((void *)0)
!= gr) {
(void) printf ("%s", gr->gr_name);
} else {
(void) printf ("%d", pri_grp);
}
}
for (i = 0; i < ngroups; i++) {
struct group *gr;
if ((0 != i) || (-1 != pri_grp)) {
(void) putchar (' ');
}
gr = getgrgid (groups[i]);
if (
((void *)0)
!= gr) {
(void) printf ("%s", gr->gr_name);
} else {
(void) printf ("%ld", (long) groups[i]);
}
}
(void) putchar ('\n');
} else {
print_groups (argv[1]);
}
return
0
;
}
| undefined8 main(int param_1,undefined8 *param_2)
{
int iVar1;
long lVar2;
__gid_t *__list;
group *pgVar3;
int local_34;
__gid_t local_30;
lVar2 = sysconf(3);
__list = (__gid_t *)malloc(lVar2 << 2);
setlocale(6,"");
bindtextdomain("shadow","/usr/share/locale");
textdomain("shadow");
Prog = Basename(*param_2);
log_set_progname(Prog);
log_set_logfd();
if (param_1 == 1) {
iVar1 = getgroups((int)lVar2,__list);
if (iVar1 < 0) {
perror("getgroups");
exit(1);
}
local_30 = getegid();
for (local_34 = 0; (local_34 < iVar1 && (local_30 != __list[local_34])); local_34 = local_34 + 1
) {
}
if (local_34 != iVar1) {
local_30 = 0xffffffff;
}
if (local_30 != 0xffffffff) {
pgVar3 = getgrgid(local_30);
if (pgVar3 == (group *)0x0) {
printf("%d",(ulong)local_30);
}
else {
printf("%s",pgVar3->gr_name);
}
}
for (local_34 = 0; local_34 < iVar1; local_34 = local_34 + 1) {
if ((local_34 != 0) || (local_30 != 0xffffffff)) {
putchar(0x20);
}
pgVar3 = getgrgid(__list[local_34]);
if (pgVar3 == (group *)0x0) {
printf("%ld",(ulong)__list[local_34]);
}
else {
printf("%s",pgVar3->gr_name);
}
}
putchar(10);
}
else {
print_groups(param_2[1]);
}
return 0;
}
|
static void
oct_to_env (char const *envar, unsigned long num)
{
char buf[1+1+(sizeof(unsigned long)*8 +2)/3];
snprintf (buf, sizeof buf, "0%lo", num);
if (setenv (envar, buf, 1) != 0)
xalloc_die ();
}
| unsigned long oct_to_env(const char *a1, long a2)
{
char s[24];
unsigned long v4;
v4 = __readfsqword(0x28u);
snprintf(s, 0x18uLL, "0%lo", a2);
if ( setenv(a1, s, 1) )
xalloc_die(a1);
return __readfsqword(0x28u) ^ v4;
}
|
static int ino_cmp(const void *a, const void *b)
{
const struct hash_entry *he_a = (const struct hash_entry *) a;
const struct hash_entry *he_b = (const struct hash_entry *) b;
return (he_a->ino - he_b->ino);
}
| int ino_cmp(long param_1,long param_2)
{
return (int)*(undefined8 *)(param_1 + 8) - (int)*(undefined8 *)(param_2 + 8);
}
|
static char *
pcomp_filename_completion_function (text, state)
const char *text;
int state;
{
static char *dfn;
int iscompgen, iscompleting;
if (state == 0)
{
do { if (dfn) sh_xfree((dfn), "pcomplete.c", 739); } while (0);
iscompgen = this_shell_builtin == compgen_builtin;
iscompleting = (rl_readline_state & (0x0004000));
if (iscompgen && iscompleting == 0 && rl_completion_found_quote == 0
&& rl_filename_dequoting_function)
{
dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
}
else if (iscompgen && iscompleting &&
pcomp_curtxt && *pcomp_curtxt == 0 &&
text && (*text == '\'' || *text == '"') && text[1] == text[0] && text[2] == 0 &&
rl_filename_dequoting_function)
dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
else if (iscompgen && iscompleting && rl_filename_dequoting_function &&
pcomp_curtxt && text &&
((pcomp_curtxt)[0] == (text)[0] && strcmp(pcomp_curtxt, text) == 0) == 0 &&
variable_context &&
sh_contains_quotes (text))
dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
else
dfn = (char *)strcpy (sh_xmalloc((1 + strlen (text)), "pcomplete.c", 792), (text));
}
return (rl_filename_completion_function (dfn, state));
}
| void pcomp_filename_completion_function(char *param_1,int param_2)
{
int iVar1;
size_t sVar2;
char *__dest;
bool bVar3;
if (param_2 != 0) goto LAB_00101630;
if (dfn_10077 != (char *)0x0) {
sh_xfree(dfn_10077,"pcomplete.c",0x2e3);
}
bVar3 = this_shell_builtin == lRam0000000000101439;
if ((((bVar3) && ((rl_readline_state & 0x4000) == 0)) && (rl_completion_found_quote == 0)) &&
(rl_filename_dequoting_function != (code *)0x0)) {
dfn_10077 = (char *)(*rl_filename_dequoting_function)(param_1,rl_completion_quote_character);
goto LAB_00101630;
}
if (((((bVar3) && ((rl_readline_state & 0x4000) != 0)) &&
((pcomp_curtxt != (char *)0x0 && ((*pcomp_curtxt == '\0' && (param_1 != (char *)0x0)))))) &&
((*param_1 == '\'' || (*param_1 == '\"')))) &&
(((param_1[1] == *param_1 && (param_1[2] == '\0')) &&
(rl_filename_dequoting_function != (code *)0x0)))) {
dfn_10077 = (char *)(*rl_filename_dequoting_function)(param_1,rl_completion_quote_character);
goto LAB_00101630;
}
if (((bVar3) && ((rl_readline_state & 0x4000) != 0)) &&
((rl_filename_dequoting_function != (code *)0x0 &&
((pcomp_curtxt != (char *)0x0 && (param_1 != (char *)0x0)))))) {
if (*pcomp_curtxt == *param_1) {
iVar1 = strcmp(pcomp_curtxt,param_1);
if (iVar1 != 0) goto LAB_001015af;
bVar3 = true;
}
else {
LAB_001015af:
bVar3 = false;
}
if ((!bVar3) && (variable_context != 0)) {
iVar1 = sh_contains_quotes(param_1);
if (iVar1 != 0) {
dfn_10077 = (char *)(*rl_filename_dequoting_function)(param_1,rl_completion_quote_character)
;
goto LAB_00101630;
}
}
}
sVar2 = strlen(param_1);
__dest = (char *)sh_xmalloc(sVar2 + 1,"pcomplete.c",0x318);
dfn_10077 = strcpy(__dest,param_1);
LAB_00101630:
rl_filename_completion_function(dfn_10077,param_2);
return;
}
|
char *
host_hash(const char *host, const char *name_from_hostfile, u_int src_len)
{
struct ssh_hmac_ctx *ctx;
u_char salt[256], result[256];
char uu_salt[512], uu_result[512];
char *encoded =
((void *)0)
;
u_int len;
len = ssh_digest_bytes(1);
if (name_from_hostfile ==
((void *)0)
) {
arc4random_buf(salt, len);
} else {
if (extract_salt(name_from_hostfile, src_len, salt,
sizeof(salt)) == -1)
return (
((void *)0)
);
}
if ((ctx = ssh_hmac_start(1)) ==
((void *)0)
||
ssh_hmac_init(ctx, salt, len) < 0 ||
ssh_hmac_update(ctx, host, strlen(host)) < 0 ||
ssh_hmac_final(ctx, result, sizeof(result)))
sshfatal("hostfile.c", __func__, 140, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "ssh_hmac failed");
ssh_hmac_free(ctx);
if (
__b64_ntop
(salt,len,uu_salt,sizeof(uu_salt)) == -1 ||
__b64_ntop
(result,len,uu_result,sizeof(uu_result)) == -1)
sshfatal("hostfile.c", __func__, 145, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "__b64_ntop failed");
xasprintf(&encoded, "%s%s%c%s", "|1|", uu_salt, '|',
uu_result);
return (encoded);
}
| int host_hash(char *a0, unsigned long long a1, unsigned long a2) {
unsigned long long v0;
unsigned int v1;
void* v2;
unsigned long long v3;
char v4;
char v5;
char v6;
char v7;
unsigned long long v8;
unsigned int v10;
unsigned long long v11;
unsigned long long v12;
v2 = 0;
v1 = ssh_digest_bytes(0x1);
if (!a1) {
arc4random_buf(&v4, v1, v1);
} else {
v10 = extract_salt(a1, a2, &v4, 0x100);
if (v10 == -1)
v10 = 0;
}
if (!a1 || v10 != -1) {
v3 = ssh_hmac_start(0x1);
if (v3) {
v11 = ssh_hmac_init(v3, &v4, v1, &v4);
if (v11 >= 0)
v12 = ssh_hmac_update(v3, a0, strlen(a0), a0);
}
if (!v3 || v11 < 0 || v12 < 0 || ssh_hmac_final(v3, &v5, 0x100, &v5)) {
v0 = "ssh_hmac failed";
sshfatal("hostfile.c", "host_hash", 0x8c, 0x1, 0x1, 0x0);
}
ssh_hmac_free(v3);
v10 = __b64_ntop(&v4, v1, &v6, 0x200);
if (v10 != -1)
v10 = __b64_ntop(&v5, v1, &v7, 0x200);
if (v10 == -1 || v10 == -1) {
v8 = "__b64_ntop failed";
sshfatal("hostfile.c", "host_hash", 0x91, 0x1, 0x1, 0x0);
}
xasprintf(&v2, "%s%s%c%s", "|1|", &v6, 0x7c, &v7);
v10 = v2;
}
return v10;
}
|
int
sh_contains_quotes (string)
const char *string;
{
const char *s;
for (s = string; s && *s; s++)
{
if (*s == '\'' || *s == '"' || *s == '\\')
return 1;
}
return 0;
}
| undefined8 sh_contains_quotes(char *param_1)
{
char *local_10;
local_10 = param_1;
while( true ) {
if ((local_10 == (char *)0x0) || (*local_10 == '\0')) {
return 0;
}
if (((*local_10 == '\'') || (*local_10 == '\"')) || (*local_10 == '\\')) break;
local_10 = local_10 + 1;
}
return 1;
}
|
int
parse_forward(struct Forward *fwd, const char *fwdspec, int dynamicfwd, int remotefwd)
{
struct fwdarg fwdargs[4];
char *p, *cp;
int i, err;
memset(fwd, 0, sizeof(*fwd));
memset(fwdargs, 0, sizeof(fwdargs));
cp = p = dollar_expand(&err, fwdspec);
if (p ==
((void *)0)
|| err)
return 0;
while (
((*__ctype_b_loc ())[(int) ((
(u_char)*cp
))] & (unsigned short int) _ISspace)
)
cp++;
for (i = 0; i < 4; ++i) {
if (parse_fwd_field(&cp, &fwdargs[i]) != 0)
break;
}
if (cp !=
((void *)0)
&& *cp != '\0') {
i = 0;
}
switch (i) {
case 1:
if (fwdargs[0].ispath) {
fwd->listen_path = xstrdup(fwdargs[0].arg);
fwd->listen_port = -2;
} else {
fwd->listen_host =
((void *)0)
;
fwd->listen_port = a2port(fwdargs[0].arg);
}
fwd->connect_host = xstrdup("socks");
break;
case 2:
if (fwdargs[0].ispath && fwdargs[1].ispath) {
fwd->listen_path = xstrdup(fwdargs[0].arg);
fwd->listen_port = -2;
fwd->connect_path = xstrdup(fwdargs[1].arg);
fwd->connect_port = -2;
} else if (fwdargs[1].ispath) {
fwd->listen_host =
((void *)0)
;
fwd->listen_port = a2port(fwdargs[0].arg);
fwd->connect_path = xstrdup(fwdargs[1].arg);
fwd->connect_port = -2;
} else {
fwd->listen_host = xstrdup(fwdargs[0].arg);
fwd->listen_port = a2port(fwdargs[1].arg);
fwd->connect_host = xstrdup("socks");
}
break;
case 3:
if (fwdargs[0].ispath) {
fwd->listen_path = xstrdup(fwdargs[0].arg);
fwd->listen_port = -2;
fwd->connect_host = xstrdup(fwdargs[1].arg);
fwd->connect_port = a2port(fwdargs[2].arg);
} else if (fwdargs[2].ispath) {
fwd->listen_host = xstrdup(fwdargs[0].arg);
fwd->listen_port = a2port(fwdargs[1].arg);
fwd->connect_path = xstrdup(fwdargs[2].arg);
fwd->connect_port = -2;
} else {
fwd->listen_host =
((void *)0)
;
fwd->listen_port = a2port(fwdargs[0].arg);
fwd->connect_host = xstrdup(fwdargs[1].arg);
fwd->connect_port = a2port(fwdargs[2].arg);
}
break;
case 4:
fwd->listen_host = xstrdup(fwdargs[0].arg);
fwd->listen_port = a2port(fwdargs[1].arg);
fwd->connect_host = xstrdup(fwdargs[2].arg);
fwd->connect_port = a2port(fwdargs[3].arg);
break;
default:
i = 0;
}
free(p);
if (dynamicfwd) {
if (!(i == 1 || i == 2))
goto fail_free;
} else {
if (!(i == 3 || i == 4)) {
if (fwd->connect_path ==
((void *)0)
&&
fwd->listen_path ==
((void *)0)
)
goto fail_free;
}
if (fwd->connect_port <= 0 && fwd->connect_path ==
((void *)0)
)
goto fail_free;
}
if ((fwd->listen_port < 0 && fwd->listen_path ==
((void *)0)
) ||
(!remotefwd && fwd->listen_port == 0))
goto fail_free;
if (fwd->connect_host !=
((void *)0)
&&
strlen(fwd->connect_host) >=
1025
)
goto fail_free;
if (fwd->connect_path !=
((void *)0)
&&
strlen(fwd->connect_path) >= (sizeof((struct sockaddr_un *)0)->sun_path))
goto fail_free;
if (fwd->listen_host !=
((void *)0)
&&
strlen(fwd->listen_host) >=
1025
)
goto fail_free;
if (fwd->listen_path !=
((void *)0)
&&
strlen(fwd->listen_path) >= (sizeof((struct sockaddr_un *)0)->sun_path))
goto fail_free;
return (i);
fail_free:
free(fwd->connect_host);
fwd->connect_host =
((void *)0)
;
free(fwd->connect_path);
fwd->connect_path =
((void *)0)
;
free(fwd->listen_host);
fwd->listen_host =
((void *)0)
;
free(fwd->listen_path);
fwd->listen_path =
((void *)0)
;
return (0);
}
| int parse_forward(struct_0 *a0, unsigned long long a1, unsigned long a2, unsigned long a3) {
char v0;
unsigned int v1;
char *v2;
void* v3;
char v4;
char v5;
char v6;
char v7;
char v8;
char v9;
char v10;
unsigned int v12;
unsigned int v14;
memset(a0, 0x0, 0x38);
memset(&v4, 0x0, 0x40);
v3 = dollar_expand(&v0, a1, a1);
v2 = v3;
if (!v3) {
LABEL_408d4e:
v12 = 0;
} else {
if (!(!*(&v0)))
goto LABEL_408d4e;
while (true) {
v14 = *((*(v2) * 2 + *(__ctype_b_loc()))) & 0x2000;
if (!v14)
break;
v2 += 1;
}
v1 = 0;
while (true) {
if (v1 > 3)
break;
if (parse_fwd_field(&v2, &(&v4)[16 * v1]))
break;
v1 = __addvsi3(v1, 0x1);
}
if (v2 && *(v2))
v1 = 0;
if (v1 == 4) {
a0->field_0 = xstrdup(*(&v4));
a0->field_8 = a2port(*(&v6));
a0->field_18 = xstrdup(*(&v8));
a0->field_20 = a2port(*(&v10));
} else {
if (v1 <= 4) {
if (v1 == 3) {
if (*(&v5)) {
a0->field_10 = xstrdup(*(&v4));
a0->field_8 = -2;
a0->field_18 = xstrdup(*(&v6));
a0->field_20 = a2port(*(&v8));
goto LABEL_40909d;
} else if (*(&v9)) {
a0->field_0 = xstrdup(*(&v4));
a0->field_8 = a2port(*(&v6));
a0->field_28 = xstrdup(*(&v8));
a0->field_20 = -2;
goto LABEL_40909d;
} else {
a0->field_0 = 0;
a0->field_8 = a2port(*(&v4));
a0->field_18 = xstrdup(*(&v6));
a0->field_20 = a2port(*(&v8));
goto LABEL_40909d;
}
} else {
if (v1 <= 3) {
if (v1 == 1) {
if (*(&v5)) {
a0->field_10 = xstrdup(*(&v4));
a0->field_8 = -2;
} else {
a0->field_0 = 0;
a0->field_8 = a2port(*(&v4));
}
a0->field_18 = xstrdup("socks");
goto LABEL_40909d;
}
if (v1 == 2) {
if (*(&v5) && *(&v7)) {
a0->field_10 = xstrdup(*(&v4));
a0->field_8 = -2;
a0->field_28 = xstrdup(*(&v6));
a0->field_20 = -2;
goto LABEL_40909d;
}
if (!*(&v7)) {
a0->field_0 = xstrdup(*(&v4));
a0->field_8 = a2port(*(&v6));
a0->field_18 = xstrdup("socks");
goto LABEL_40909d;
} else {
a0->field_0 = 0;
a0->field_8 = a2port(*(&v4));
a0->field_28 = xstrdup(*(&v6));
a0->field_20 = -2;
goto LABEL_40909d;
}
}
}
}
}
v1 = 0;
}
LABEL_40909d:
free(v3);
if (!a2) {
if (v1 != 3 && v1 != 4 && !a0->field_28 && !a0->field_10)
goto LABEL_4091e6;
if (a0->field_20 <= 0 && !a0->field_28)
goto LABEL_4091e6;
} else if (v1 != 1 && !(v1 == 2)) {
goto LABEL_4091e6;
}
if (a0->field_8 < 0 && !a0->field_10)
goto LABEL_4091d9;
if (a3) {
LABEL_40913d:
if (a0->field_18 && !(strlen(a0->field_18) <= 0x400))
goto LABEL_4091e6;
if (a0->field_28 && !(strlen(a0->field_28) <= 107))
goto LABEL_4091e6;
if (a0->field_0 && !(strlen(a0->field_0) <= 0x400))
goto LABEL_4091e6;
if (a0->field_10 && !(strlen(a0->field_10) <= 107))
goto LABEL_4091e6;
v12 = v1;
} else {
if (!(!a0->field_8))
goto LABEL_40913d;
LABEL_4091d9:
LABEL_4091e6:
free(a0->field_18);
a0->field_18 = 0;
free(a0->field_28);
a0->field_28 = 0;
free(a0->field_0);
a0->field_0 = 0;
free(a0->field_10);
a0->field_10 = 0;
v12 = 0;
}
}
return v12;
}
|
static void Decode(crypto_uint16 *out,const unsigned char *S,const crypto_uint16 *M,long long len)
{
if (len == 1) {
if (M[0] == 1)
*out = 0;
else if (M[0] <= 256)
*out = uint32_mod_uint14(S[0],M[0]);
else
*out = uint32_mod_uint14(S[0]+(((crypto_uint16)S[1])<<8),M[0]);
}
if (len > 1) {
crypto_uint16 R2[(len+1)/2];
crypto_uint16 M2[(len+1)/2];
crypto_uint16 bottomr[len/2];
crypto_uint32 bottomt[len/2];
long long i;
for (i = 0;i < len-1;i += 2) {
crypto_uint32 m = M[i]*(crypto_uint32) M[i+1];
if (m > 256*16383) {
bottomt[i/2] = 256*256;
bottomr[i/2] = S[0]+256*S[1];
S += 2;
M2[i/2] = (((m+255)>>8)+255)>>8;
} else if (m >= 16384) {
bottomt[i/2] = 256;
bottomr[i/2] = S[0];
S += 1;
M2[i/2] = (m+255)>>8;
} else {
bottomt[i/2] = 1;
bottomr[i/2] = 0;
M2[i/2] = m;
}
}
if (i < len)
M2[i/2] = M[i];
Decode(R2,S,M2,(len+1)/2);
for (i = 0;i < len-1;i += 2) {
crypto_uint32 r = bottomr[i/2];
crypto_uint32 r1;
crypto_uint16 r0;
r += bottomt[i/2]*R2[i/2];
uint32_divmod_uint14(&r1,&r0,r,M[i]);
r1 = uint32_mod_uint14(r1,M[i+1]);
*out++ = r0;
*out++ = r1;
}
if (i < len)
*out++ = R2[i/2];
}
}
| unsigned long Decode(_WORD *a1, unsigned char *a2, unsigned short *a3, long a4)
{
unsigned long v4;
void *v5;
unsigned long v6;
void *v7;
unsigned long v8;
void *v9;
unsigned long v10;
void *v11;
_WORD *v12;
_WORD *v13;
_WORD *v14;
long v16[10];
long v17;
long v18;
long v19;
long v20;
long v21;
unsigned short *v22;
unsigned char *v23;
_WORD *v24;
short v25;
unsigned int v26;
unsigned int v27;
unsigned int v28;
long i;
long v30;
long *v31;
long v32;
unsigned short *v33;
long v34;
long *v35;
long v36;
long *v37;
unsigned long v38;
v24 = a1;
v23 = a2;
v22 = a3;
v21 = a4;
v38 = __readfsqword(0x28u);
if ( a4 == 1 )
{
if ( *v22 == 1 )
{
*v24 = 0;
}
else if ( *v22 > 0x100u )
{
*v24 = uint32_mod_uint14(*v23 + (v23[1] << 8), *v22);
}
else
{
*v24 = uint32_mod_uint14(*v23, *v22);
}
}
if ( v21 > 1 )
{
v30 = (v21 + 1) / 2 - 1;
v19 = (v21 + 1) / 2;
v20 = 0LL;
v4 = 16 * ((2 * v19 + 15) / 0x10uLL);
while ( v16 != (long *)((char *)v16 - (v4 & 0xFFFFFFFFFFFFF000LL)) )
;
v5 = alloca(v4 & 0xFFF);
if ( (v4 & 0xFFF) != 0 )
*(long *)((char *)&v16[-1] + (v4 & 0xFFF)) = *(long *)((char *)&v16[-1] + (v4 & 0xFFF));
v31 = v16;
v32 = (v21 + 1) / 2 - 1;
v17 = (v21 + 1) / 2;
v18 = 0LL;
v16[8] = v17;
v16[9] = 0LL;
v6 = 16 * ((2 * v17 + 15) / 0x10uLL);
while ( v16 != (long *)((char *)v16 - (v6 & 0xFFFFFFFFFFFFF000LL)) )
;
v7 = alloca(v6 & 0xFFF);
if ( (v6 & 0xFFF) != 0 )
*(long *)((char *)&v16[-1] + (v6 & 0xFFF)) = *(long *)((char *)&v16[-1] + (v6 & 0xFFF));
v33 = (unsigned short *)v16;
v34 = v21 / 2 - 1;
v16[6] = v21 / 2;
v16[7] = 0LL;
v16[4] = v21 / 2;
v16[5] = 0LL;
v8 = 16 * ((2 * (v21 / 2) + 15) / 0x10uLL);
while ( v16 != (long *)((char *)v16 - (v8 & 0xFFFFFFFFFFFFF000LL)) )
;
v9 = alloca(v8 & 0xFFF);
if ( (v8 & 0xFFF) != 0 )
*(long *)((char *)&v16[-1] + (v8 & 0xFFF)) = *(long *)((char *)&v16[-1] + (v8 & 0xFFF));
v35 = v16;
v36 = v21 / 2 - 1;
v16[2] = v21 / 2;
v16[3] = 0LL;
v16[0] = v21 / 2;
v16[1] = 0LL;
v10 = 16 * ((4 * (v21 / 2) + 15) / 0x10uLL);
while ( v16 != (long *)((char *)v16 - (v10 & 0xFFFFFFFFFFFFF000LL)) )
;
v11 = alloca(v10 & 0xFFF);
if ( (v10 & 0xFFF) != 0 )
*(long *)((char *)&v16[-1] + (v10 & 0xFFF)) = *(long *)((char *)&v16[-1] + (v10 & 0xFFF));
v37 = v16;
for ( i = 0LL; i < v21 - 1; i += 2LL )
{
v28 = v22[i] * v22[i + 1];
if ( v28 <= 0x3FFF00 )
{
if ( v28 <= 0x3FFF )
{
*((_DWORD *)v37 + i / 2) = 1;
*((_WORD *)v35 + i / 2) = 0;
v33[i / 2] = v28;
}
else
{
*((_DWORD *)v37 + i / 2) = 256;
*((_WORD *)v35 + i / 2) = *v23++;
v33[i / 2] = (v28 + 255) >> 8;
}
}
else
{
*((_DWORD *)v37 + i / 2) = 0x10000;
*((_WORD *)v35 + i / 2) = (v23[1] << 8) + *v23;
v23 += 2;
v33[i / 2] = (((v28 + 255) >> 8) + 255) >> 8;
}
}
if ( i < v21 )
v33[i / 2] = v22[i];
Decode(v31, v23, v33, (v21 + 1) / 2);
for ( i = 0LL; i < v21 - 1; i += 2LL )
{
v27 = *((unsigned short *)v35 + i / 2);
v27 += *((_DWORD *)v37 + i / 2) * *((unsigned short *)v31 + i / 2);
uint32_divmod_uint14(&v26, &v25, v27, v22[i]);
v26 = (unsigned short)uint32_mod_uint14(v26, v22[i + 1]);
v12 = v24++;
*v12 = v25;
v13 = v24++;
*v13 = v26;
}
if ( i < v21 )
{
v14 = v24++;
*v14 = *((_WORD *)v31 + i / 2);
}
}
return __readfsqword(0x28u) ^ v38;
}
|
inline void
md5_process_bytes (const void *buf, size_t len, struct md5_ctx *ctx)
{ MD5_Update ((MD5_CTX *) ctx, buf, len); }
| void md5_process_bytes(void)
{
halt_baddata();
}
|
kwset_t
kwsinit (
_Bool
mb_trans)
{
char *trans =
((void *)0)
;
if (match_icase && (
(__ctype_get_mb_cur_max ())
== 1 || mb_trans))
{
trans = ximalloc (NCHAR);
for (int i = 0; i < NCHAR; i++)
trans[i] = toupper (i);
}
return kwsalloc (trans);
}
| long long kwsinit(unsigned long a0) {
unsigned int v0;
void* v1;
v1 = 0;
if (match_icase && (__ctype_get_mb_cur_max() == 1 || a0)) {
v1 = ximalloc(0x100);
for (v0 = 0; v0 <= 255; v0 += 1) {
*(v1 + v0) = toupper(v0);
}
}
return kwsalloc(v1);
}
|
int
channel_find_open(struct ssh *ssh)
{
u_int i;
Channel *c;
for (i = 0; i < ssh->chanctxt->channels_alloc; i++) {
c = ssh->chanctxt->channels[i];
if (c ==
((void *)0)
|| !c->have_remote_id)
continue;
switch (c->type) {
case 5:
case 13:
case 21:
case 22:
case 1:
case 2:
case 11:
case 15:
case 16:
case 20:
case 3:
case 12:
case 14:
case 17:
case 18:
case 19:
continue;
case 10:
case 6:
case 4:
case 7:
return i;
default:
sshfatal("channels.c", __func__, 843, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "bad channel type %d", c->type);
}
}
return -1;
}
| long long channel_find_open(struct_0 *a0) {
unsigned int v0;
unsigned int v1[4];
unsigned long v2;
unsigned long long v4;
for (v0 = 0; v0 < a0->field_868->field_8; v0 += 1) {
*(&v1[0]) = *((a0->field_868->field_0 + v0 * 8));
if (!(!v1 || !v1[3])) {
switch (v1[0]) {
case 1: case 2: case 3: case 5: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20: case 21: case 22:
break;
case 4: case 6: case 7: case 10:
v4 = v0;
return v4;
default:
v2 = v1[0];
v1 = "bad channel type %d";
sshfatal("channels.c", "channel_find_open", 0x34b, 0x1, 0x1, 0x0);
break;
}
}
}
v4 = 4294967295;
return v4;
}
|
static struct lvalue *
alloc_lvalue ()
{
struct lvalue *lv;
lv = sh_xmalloc((sizeof (struct lvalue)), "expr.c", 1128);
init_lvalue (lv);
return (lv);
}
| long long alloc_lvalue() {
void* v0;
v0 = sh_xmalloc(0x20, "expr.c", 0x468);
init_lvalue(v0);
return v0;
}
|
static struct lvalue *
alloc_lvalue ()
{
struct lvalue *lv;
lv = sh_xmalloc((sizeof (struct lvalue)), "expr.c", 1128);
init_lvalue (lv);
return (lv);
}
| _QWORD *alloc_lvalue()
{
_QWORD *v1;
v1 = (_QWORD *)sh_xmalloc(32LL, "expr.c", 1128LL);
init_lvalue(v1);
return v1;
}
|
COMMAND *
make_coproc_command (name, command)
char *name;
COMMAND *command;
{
COPROC_COM *temp;
temp = (COPROC_COM *)sh_xmalloc((sizeof (COPROC_COM)), "make_cmd.c", 835);
temp->name = (char *)strcpy (sh_xmalloc((1 + strlen (name)), "make_cmd.c", 836), (name));
temp->command = command;
temp->flags = 0x01|0x1000;
return (make_command (cm_coproc, (SIMPLE_COM *)temp));
}
| long long make_coproc_command(char *a0, unsigned long a1) {
struct_0 *v0;
v0 = sh_xmalloc(0x18, "make_cmd.c", 0x343);
v0->field_8 = strcpy(sh_xmalloc(strlen(a0) + 1, "make_cmd.c", 0x344), a0);
v0->field_10 = a1;
v0->field_0 = 4097;
return make_command(0xe, v0);
}
|
static void
who (char const *filename, int options)
{
size_t n_users;
STRUCT_UTMP *utmp_buf;
if (read_utmp (filename, &n_users, &utmp_buf, options) != 0)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", quotearg_n_style_colon (0, shell_escape_quoting_style, filename)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, filename)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, filename)), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
if (short_list)
list_entries_who (n_users, utmp_buf);
else
scan_entries (n_users, utmp_buf);
free (utmp_buf);
}
| void who(unsigned long long a0, unsigned long a1) {
char v0;
char v1;
char v2;
unsigned long long v5;
unsigned long long *v6;
unsigned long long v7;
if (read_utmp(a0, &v0, &v1, a1)) {
v5 = quotearg_n_style_colon(0x0, 0x3, a0);
error(0x1, *(__errno_location()), "%s");
}
if (short_list)
list_entries_who(*(&v0), *(&v1));
else
scan_entries(*(&v0), *(&v1));
free(*(&v1));
v7 = *(&v2) ^ v6[5];
return;
}
|
ed_prev_line(EditLine *el, wint_t c __attribute__((__unused__)))
{
wchar_t *ptr;
int nchars = c_hpos(el);
if (*(ptr = el->el_line.cursor) == '\n')
ptr--;
for (; ptr >= el->el_line.buffer; ptr--)
if (*ptr == '\n' && --el->el_state.argument <= 0)
break;
if (el->el_state.argument > 0)
return 6;
for (ptr--; ptr >= el->el_line.buffer && *ptr != '\n'; ptr--)
continue;
for (ptr++;
nchars-- > 0 && ptr < el->el_line.lastchar && *ptr != '\n';
ptr++)
continue;
el->el_line.cursor = ptr;
return 5;
}
| long long ed_prev_line(struct_0 *a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned int *v2;
unsigned long long v4;
unsigned int v5;
v0 = a1;
v1 = c_hpos(a0);
v2 = a0->field_58;
if (*(v2) == 10)
v2 += 1;
for (; v2 >= a0->field_50 && (*(v2) != 10 || (a0->field_78 = a0->field_78 - 1, a0->field_78 > 0)); v2 = v2 + 1);
if (a0->field_78 > 0) {
v4 = 6;
return v4;
}
for (v2 = v2 + 1; v2 >= a0->field_50 && *(v2) != 10; v2 = v2 + 1);
v2 = v2 + 1;
while (true) {
v5 = v1;
v1 -= 1;
if (!(v5 > 0) || !(v2 < a0->field_60) || !(*(v2) != 10))
break;
v2 = v2 + 1;
}
a0->field_58 = v2;
v4 = 5;
return v4;
}
|
static inline void
emit_ancillary_info (char const *program)
{
struct infomap { char const *program; char const *node; } const infomap[] = {
{ "[", "test invocation" },
{ "coreutils", "Multi-call invocation" },
{ "sha224sum", "sha2 utilities" },
{ "sha256sum", "sha2 utilities" },
{ "sha384sum", "sha2 utilities" },
{ "sha512sum", "sha2 utilities" },
{
((void *)0)
,
((void *)0)
}
};
char const *node = program;
struct infomap const *map_prog = infomap;
while (map_prog->program && ! (strcmp (program, map_prog->program) == 0))
map_prog++;
if (map_prog->node)
node = map_prog->node;
printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https:
char const *lc_messages = setlocale (
5
,
((void *)0)
);
if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1))
{
fputs_unlocked (gettext ("Report any translation bugs to " "<https:
stdout
)
;
}
char const *url_program = (strcmp (program, "[") == 0) ? "test" : program;
printf (gettext ("Full documentation <%s%s>\n"),
"https:
printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"),
node, node == program ? " invocation" : "");
}
| void emit_ancillary_info(char *a0) {
unsigned long long v0;
unsigned long long v1[2];
char *v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
void* v16;
void* v17;
char v18;
unsigned long long v23;
unsigned long long *v24;
unsigned long long v25;
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]; v1[0] = v1 + 1) {
if (!strcmp(a0, v1[0]))
break;
}
if (v1[1])
v0 = v1[1];
printf(gettext("\n%s online help: <%s>\n"));
v2 = setlocale(0x5, NULL);
if (v2 && strncmp(v2, "en_", 0x3))
fputs_unlocked(gettext("Report any translation bugs to <https:
if (strcmp(a0, "["))
v23 = a0;
else
v23 = "test";
v3 = v23;
printf(gettext("Full documentation <%s%s>\n"));
printf(gettext("or available locally via: info '(coreutils) %s%s'\n"));
v25 = *(&v18) ^ v24[5];
return;
}
|
static
_Bool
oldgnu_dump_header (struct tar_sparse_file *file)
{
off_t block_ordinal = current_block_ordinal ();
union block *blk;
size_t i;
blk = start_header (file->stat_info);
blk->header.typeflag = 'S';
if (file->stat_info->sparse_map_avail > 4)
blk->oldgnu_header.isextended = 1;
off_to_chars (file->stat_info->stat.st_size, blk->oldgnu_header.realsize, sizeof (blk->oldgnu_header.realsize));
off_to_chars (file->stat_info->archive_file_size, blk->header.size, sizeof (blk->header.size));
i = 0;
oldgnu_store_sparse_info (file, &i,
blk->oldgnu_header.sp,
4);
blk->oldgnu_header.isextended = i < file->stat_info->sparse_map_avail;
finish_header (file->stat_info, blk, block_ordinal);
while (i < file->stat_info->sparse_map_avail)
{
blk = find_next_block ();
memset (blk->buffer, 0, 512);
oldgnu_store_sparse_info (file, &i,
blk->sparse_header.sp,
21);
if (i < file->stat_info->sparse_map_avail)
blk->sparse_header.isextended = 1;
set_next_block_after (blk);
}
return
1
;
}
| undefined8 oldgnu_dump_header(long param_1)
{
long in_FS_OFFSET;
ulong local_28;
undefined8 local_20;
void *local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_20 = current_block_ordinal();
local_18 = (void *)start_header(*(undefined8 *)(param_1 + 0x18));
*(undefined *)((long)local_18 + 0x9c) = 0x53;
if (4 < *(ulong *)(*(long *)(param_1 + 0x18) + 0x130)) {
*(undefined *)((long)local_18 + 0x1e2) = 1;
}
off_to_chars(*(undefined8 *)(*(long *)(param_1 + 0x18) + 0x88),(long)local_18 + 0x1e3,0xc);
off_to_chars(*(undefined8 *)(*(long *)(param_1 + 0x18) + 0x118),(long)local_18 + 0x7c,0xc);
local_28 = 0;
oldgnu_store_sparse_info(param_1,&local_28,(long)local_18 + 0x182,4);
*(bool *)((long)local_18 + 0x1e2) = local_28 < *(ulong *)(*(long *)(param_1 + 0x18) + 0x130);
finish_header(*(undefined8 *)(param_1 + 0x18),local_18,local_20);
while (local_28 < *(ulong *)(*(long *)(param_1 + 0x18) + 0x130)) {
local_18 = (void *)find_next_block();
memset(local_18,0,0x200);
oldgnu_store_sparse_info(param_1,&local_28,local_18,0x15);
if (local_28 < *(ulong *)(*(long *)(param_1 + 0x18) + 0x130)) {
*(undefined *)((long)local_18 + 0x1f8) = 1;
}
set_next_block_after(local_18);
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return 1;
}
|
void BZ2_hbMakeCodeLengths ( UChar *len,
Int32 *freq,
Int32 alphaSize,
Int32 maxLen )
{
Int32 nNodes, nHeap, n1, n2, i, j, k;
Bool tooLong;
Int32 heap [ 258 + 2 ];
Int32 weight [ 258 * 2 ];
Int32 parent [ 258 * 2 ];
for (i = 0; i < alphaSize; i++)
weight[i+1] = (freq[i] == 0 ? 1 : freq[i]) << 8;
while (((Bool)1)) {
nNodes = alphaSize;
nHeap = 0;
heap[0] = 0;
weight[0] = 0;
parent[0] = -2;
for (i = 1; i <= alphaSize; i++) {
parent[i] = -1;
nHeap++;
heap[nHeap] = i;
{ Int32 zz, tmp; zz = nHeap; tmp = heap[zz]; while (weight[tmp] < weight[heap[zz >> 1]]) { heap[zz] = heap[zz >> 1]; zz >>= 1; } heap[zz] = tmp; };
}
{ if (!(nHeap < (258 +2))) BZ2_bz__AssertH__fail ( 2001 ); };
while (nHeap > 1) {
n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; { Int32 zz, yy, tmp; zz = 1; tmp = heap[zz]; while (((Bool)1)) { yy = zz << 1; if (yy > nHeap) break; if (yy < nHeap && weight[heap[yy+1]] < weight[heap[yy]]) yy++; if (weight[tmp] < weight[heap[yy]]) break; heap[zz] = heap[yy]; zz = yy; } heap[zz] = tmp; };
n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; { Int32 zz, yy, tmp; zz = 1; tmp = heap[zz]; while (((Bool)1)) { yy = zz << 1; if (yy > nHeap) break; if (yy < nHeap && weight[heap[yy+1]] < weight[heap[yy]]) yy++; if (weight[tmp] < weight[heap[yy]]) break; heap[zz] = heap[yy]; zz = yy; } heap[zz] = tmp; };
nNodes++;
parent[n1] = parent[n2] = nNodes;
weight[nNodes] = (((weight[n1]) & 0xffffff00)+((weight[n2]) & 0xffffff00)) | (1 + ((((weight[n1]) & 0x000000ff)) > (((weight[n2]) & 0x000000ff)) ? (((weight[n1]) & 0x000000ff)) : (((weight[n2]) & 0x000000ff))));
parent[nNodes] = -1;
nHeap++;
heap[nHeap] = nNodes;
{ Int32 zz, tmp; zz = nHeap; tmp = heap[zz]; while (weight[tmp] < weight[heap[zz >> 1]]) { heap[zz] = heap[zz >> 1]; zz >>= 1; } heap[zz] = tmp; };
}
{ if (!(nNodes < (258 * 2))) BZ2_bz__AssertH__fail ( 2002 ); };
tooLong = ((Bool)0);
for (i = 1; i <= alphaSize; i++) {
j = 0;
k = i;
while (parent[k] >= 0) { k = parent[k]; j++; }
len[i-1] = j;
if (j > maxLen) tooLong = ((Bool)1);
}
if (! tooLong) break;
for (i = 1; i <= alphaSize; i++) {
j = weight[i] >> 8;
j = 1 + (j / 2);
weight[i] = j << 8;
}
}
}
| unsigned long BZ2_hbMakeCodeLengths(long a1, long a2, int a3, int a4)
{
int v4;
int v5;
int v6;
int v7;
int v8;
int v9;
char v13;
int v14;
int v15;
int v16;
int v17;
int i;
int j;
int k;
int m;
int v22;
int v23;
int v24;
int v25;
int v26;
int v27;
int v28;
int v29;
int v30;
int v31;
int v32;
int v33;
int v34;
int v35;
int v36;
int v37;
int v38[12];
int v39[518];
unsigned long v40;
v40 = __readfsqword(0x28u);
for ( i = 0; i < a3; ++i )
{
if ( *(_DWORD *)(4LL * i + a2) )
v4 = *(_DWORD *)(4LL * i + a2) << 8;
else
v4 = 256;
v38[i + 1] = v4;
}
while ( 1 )
{
v14 = a3;
v15 = 0;
v36 = 0;
v38[0] = 0;
v39[0] = -2;
for ( j = 1; j <= a3; ++j )
{
v39[j] = -1;
*(&v36 + ++v15) = j;
v24 = v15;
v35 = *(&v36 + v15);
while ( v38[v35] < v38[*(&v36 + (v24 >> 1))] )
{
*(&v36 + v24) = *(&v36 + (v24 >> 1));
v24 >>= 1;
}
*(&v36 + v24) = v35;
}
if ( v15 > 259 )
BZ2_bz__AssertH__fail(2001LL);
while ( v15 > 1 )
{
v30 = v37;
v37 = *(&v36 + v15);
v16 = v15 - 1;
v25 = 1;
v31 = v37;
while ( 1 )
{
v26 = 2 * v25;
if ( 2 * v25 > v16 )
break;
if ( v26 < v16 && v38[*(&v36 + v26 + 1)] < v38[*(&v36 + v26)] )
++v26;
if ( v38[v31] < v38[*(&v36 + v26)] )
break;
*(&v36 + v25) = *(&v36 + v26);
v25 = v26;
}
*(&v36 + v25) = v31;
v32 = v37;
v37 = *(&v36 + v16);
v17 = v16 - 1;
v27 = 1;
v33 = v37;
while ( 1 )
{
v28 = 2 * v27;
if ( 2 * v27 > v17 )
break;
if ( v28 < v17 && v38[*(&v36 + v28 + 1)] < v38[*(&v36 + v28)] )
++v28;
if ( v38[v33] < v38[*(&v36 + v28)] )
break;
*(&v36 + v27) = *(&v36 + v28);
v27 = v28;
}
*(&v36 + v27) = v33;
v39[v32] = ++v14;
v39[v30] = v39[v32];
v5 = v38[v30];
LOBYTE(v5) = 0;
v6 = v5;
v7 = v38[v32];
LOBYTE(v7) = 0;
v8 = v6 + v7;
v9 = (unsigned char)v38[v30];
if ( (unsigned char)v38[v32] >= v9 )
v9 = (unsigned char)v38[v32];
v38[v14] = v8 | (v9 + 1);
v39[v14] = -1;
v15 = v17 + 1;
*(&v36 + v15) = v14;
v29 = v15;
v34 = *(&v36 + v15);
while ( v38[v34] < v38[*(&v36 + (v29 >> 1))] )
{
*(&v36 + v29) = *(&v36 + (v29 >> 1));
v29 >>= 1;
}
*(&v36 + v29) = v34;
}
if ( v14 > 515 )
BZ2_bz__AssertH__fail(2002LL);
v13 = 0;
for ( k = 1; k <= a3; ++k )
{
v22 = 0;
v23 = k;
while ( v39[v23] >= 0 )
{
v23 = v39[v23];
++v22;
}
*(_BYTE *)(k - 1LL + a1) = v22;
if ( v22 > a4 )
v13 = 1;
}
if ( !v13 )
break;
for ( m = 1; m <= a3; ++m )
v38[m] = ((v38[m] >> 8) / 2 + 1) << 8;
}
return v40 - __readfsqword(0x28u);
}
|
int
makunbound (name, vc)
const char *name;
VAR_CONTEXT *vc;
{
BUCKET_CONTENTS *elt, *new_elt;
SHELL_VAR *old_var;
VAR_CONTEXT *v;
char *t;
for (elt = (BUCKET_CONTENTS *)
((void *)0)
, v = vc; v; v = v->down)
if (elt = hash_remove (name, v->table, 0))
break;
if (elt == 0)
return (-1);
old_var = (SHELL_VAR *)elt->data;
if (old_var && ((((old_var)->attributes) & (0x0000001))))
array_needs_making++;
if (old_var && ((((old_var)->attributes) & (0x0000020))) &&
(old_var->context == variable_context || (localvar_unset && old_var->context < variable_context)))
{
if (((((old_var)->attributes) & (0x0020000))))
((old_var)->value = ((char *)
((void *)0)
));
else if (((((old_var)->attributes) & (0x0000004))))
array_dispose ((ARRAY *)((old_var)->value));
else if (((((old_var)->attributes) & (0x0000040))))
assoc_dispose ((HASH_TABLE *)((old_var)->value));
else if (((((old_var)->attributes) & (0x0000800))))
do { if (((old_var)->value)) sh_xfree((((old_var)->value)), "variables.c", 4016); } while (0);
else
do { if (((old_var)->value)) sh_xfree((((old_var)->value)), "variables.c", 4018); } while (0);
old_var->attributes = (((((old_var)->attributes) & (0x0000001))) && ((((old_var)->attributes) & (0x0100000)))) ? 0x0000001 : 0;
((old_var)->attributes |= (0x0000020));
((old_var)->attributes |= (0x0001000));
((old_var)->value = ((char *)
((void *)0)
));
do { if ((old_var)->exportstr) { sh_xfree(((old_var)->exportstr), "variables.c", 4026); (old_var)->exportstr = (char *)
((void *)0)
; } } while (0);
new_elt = hash_insert ((char *)strcpy (sh_xmalloc((1 + strlen (old_var->name)), "variables.c", 4028), (old_var->name)), v->table, 0);
new_elt->data = (void *)old_var;
stupidly_hack_special_variables (old_var->name);
sh_xfree((elt->key), "variables.c", 4032);
sh_xfree((elt), "variables.c", 4033);
return (0);
}
t = (char *)strcpy (sh_xmalloc((1 + strlen (name)), "variables.c", 4040), (name));
sh_xfree((elt->key), "variables.c", 4042);
sh_xfree((elt), "variables.c", 4043);
dispose_variable (old_var);
stupidly_hack_special_variables (t);
sh_xfree((t), "variables.c", 4047);
return (0);
}
| undefined8 makunbound(char *param_1,long param_2)
{
char **ppcVar1;
undefined8 uVar2;
size_t sVar3;
char *__dest;
char *pcVar4;
long lVar5;
undefined4 uVar6;
long local_40;
long local_38;
local_40 = 0;
local_38 = param_2;
while ((local_38 != 0 &&
(local_40 = hash_remove(param_1,*(undefined8 *)(local_38 + 0x20),0), local_40 == 0))) {
local_38 = *(long *)(local_38 + 0x18);
}
if (local_40 == 0) {
uVar2 = 0xffffffff;
}
else {
ppcVar1 = *(char ***)(local_40 + 0x10);
if ((ppcVar1 != (char **)0x0) && ((*(uint *)(ppcVar1 + 5) & 1) != 0)) {
array_needs_making = array_needs_making + 1;
}
if (((ppcVar1 == (char **)0x0) || ((*(uint *)(ppcVar1 + 5) & 0x20) == 0)) ||
((*(int *)((long)ppcVar1 + 0x2c) != variable_context &&
((localvar_unset == 0 || (variable_context <= *(int *)((long)ppcVar1 + 0x2c))))))) {
sVar3 = strlen(param_1);
pcVar4 = (char *)sh_xmalloc(sVar3 + 1,"variables.c",0xfc8);
pcVar4 = strcpy(pcVar4,param_1);
sh_xfree(*(undefined8 *)(local_40 + 8),"variables.c",0xfca);
sh_xfree(local_40,"variables.c",0xfcb);
dispose_variable(ppcVar1);
stupidly_hack_special_variables(pcVar4);
sh_xfree(pcVar4,"variables.c",0xfcf);
uVar2 = 0;
}
else {
if ((*(uint *)(ppcVar1 + 5) & 0x20000) == 0) {
if ((*(uint *)(ppcVar1 + 5) & 4) == 0) {
if ((*(uint *)(ppcVar1 + 5) & 0x40) == 0) {
if ((*(uint *)(ppcVar1 + 5) & 0x800) == 0) {
if (ppcVar1[1] != (char *)0x0) {
sh_xfree(ppcVar1[1],"variables.c",0xfb2);
}
}
else if (ppcVar1[1] != (char *)0x0) {
sh_xfree(ppcVar1[1],"variables.c",0xfb0);
}
}
else {
assoc_dispose(ppcVar1[1]);
}
}
else {
array_dispose(ppcVar1[1]);
}
}
else {
ppcVar1[1] = (char *)0x0;
}
if (((*(uint *)(ppcVar1 + 5) & 1) == 0) || ((*(uint *)(ppcVar1 + 5) & 0x100000) == 0)) {
uVar6 = 0;
}
else {
uVar6 = 1;
}
*(undefined4 *)(ppcVar1 + 5) = uVar6;
*(uint *)(ppcVar1 + 5) = *(uint *)(ppcVar1 + 5) | 0x20;
*(uint *)(ppcVar1 + 5) = *(uint *)(ppcVar1 + 5) | 0x1000;
ppcVar1[1] = (char *)0x0;
if (ppcVar1[2] != (char *)0x0) {
sh_xfree(ppcVar1[2],"variables.c",0xfba);
ppcVar1[2] = (char *)0x0;
}
uVar2 = *(undefined8 *)(local_38 + 0x20);
pcVar4 = *ppcVar1;
sVar3 = strlen(*ppcVar1);
__dest = (char *)sh_xmalloc(sVar3 + 1,"variables.c",0xfbc);
pcVar4 = strcpy(__dest,pcVar4);
lVar5 = hash_insert(pcVar4,uVar2,0);
*(char ***)(lVar5 + 0x10) = ppcVar1;
stupidly_hack_special_variables(*ppcVar1);
sh_xfree(*(undefined8 *)(local_40 + 8),"variables.c",0xfc0);
sh_xfree(local_40,"variables.c",0xfc1);
uVar2 = 0;
}
}
return uVar2;
}
|
) {
(void)fprintf(rl_outstream, "%s: Bad word specifier",
command + offs + idx);
if (aptr)
free(aptr);
return -1;
}
| int fprintf(FILE *__stream,char *__format,...)
{
halt_baddata();
}
|
static void print_channel_bindings(gnutls_session_t session, int print)
{
static const struct channel_binding_request requests[] = {
{ GNUTLS_CB_TLS_UNIQUE, "tls-unique" },
{ GNUTLS_CB_TLS_SERVER_END_POINT, "tls-server-end-point" },
{ GNUTLS_CB_TLS_EXPORTER, "tls-exporter" }
};
size_t i;
if (!print) {
return;
}
log_msg(
stdout
, "- Channel bindings\n");
for (i = 0; i < sizeof(requests) / sizeof(requests[0]); i++) {
gnutls_datum_t cb;
int rc;
rc = gnutls_session_channel_binding(session,
requests[i].type,
&cb);
if (rc == -213) {
log_msg(
stdout
, " - '%s': not available\n",
requests[i].name);
} else if (rc < 0) {
fprintf(
stderr
, " - '%s': error: %s\n",
requests[i].name, gnutls_strerror(rc));
} else {
size_t j;
log_msg(
stdout
, " - '%s': ",
requests[i].name);
for (j = 0; j < cb.size; j++)
log_msg(
stdout
, "%02x", cb.data[j]);
log_msg(
stdout
, "\n");
gnutls_free((void *) (cb.data)), cb.data=
((void *)0)
;
}
}
}
| unsigned long print_channel_bindings(long a1, int a2, long a3, long a4, long a5, long a6)
{
long v6;
long v7;
long v8;
const char *v9;
long v10;
long v11;
long v12;
long v13;
int v15;
unsigned long i;
unsigned long j;
long v18;
unsigned int v19;
unsigned long v20;
v20 = __readfsqword(0x28u);
if ( a2 )
{
log_msg(stdout, "- Channel bindings\n", a3, a4, a5, a6);
for ( i = 0LL; i <= 2; ++i )
{
v15 = gnutls_session_channel_binding(a1, *((unsigned int *)&requests_11984 + 4 * i), &v18);
if ( v15 == -213 )
{
log_msg(stdout, " - '%s': not available\n", (long)(&off_5248)[2 * i], v6, v7, v8);
}
else if ( v15 >= 0 )
{
log_msg(stdout, " - '%s': ", (long)(&off_5248)[2 * i], v6, v7, v8);
for ( j = 0LL; j < v19; ++j )
log_msg(stdout, "%02x", *(unsigned char *)(v18 + j), v11, v12, v13);
log_msg(stdout, "\n", v10, v11, v12, v13);
gnutls_free(v18);
v18 = 0LL;
}
else
{
v9 = (const char *)gnutls_strerror((unsigned int)v15);
fprintf(stderr, " - '%s': error: %s\n", (&off_5248)[2 * i], v9);
}
}
}
return __readfsqword(0x28u) ^ v20;
}
|
int
strsvisx(char *mbdst, const char *mbsrc, size_t len, int flags, const char *mbextra)
{
return istrsenvisxna(mbdst,
((void *)0)
, mbsrc, len, flags, mbextra,
((void *)0)
);
}
| long strsvisx(char *a1, const char *a2, unsigned long a3, unsigned int a4, const char *a5)
{
return istrsenvisxna(a1, 0LL, a2, a3, a4, a5, 0LL);
}
|
char *
readline (const char *prompt)
{
char *value;
if (rl_pending_input ==
(-1)
)
{
rl_clear_pending_input ();
return ((char *)
((void *)0)
);
}
rl_set_prompt (prompt);
rl_initialize ();
if (rl_prep_term_function)
(*rl_prep_term_function) (_rl_meta_flag);
rl_set_signals ();
value = readline_internal ();
if (rl_deprep_term_function)
(*rl_deprep_term_function) ();
rl_clear_signals ();
return (value);
}
| long long readline(char *a0, unsigned long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v0;
void* v2;
if (rl_pending_input == -1) {
rl_clear_pending_input();
v2 = 0;
} else {
rl_set_prompt(a0);
rl_initialize(a0, a1, a2, a3, a4, a5);
if (rl_prep_term_function)
rl_prep_term_function(_rl_meta_flag);
rl_set_signals();
v0 = readline_internal(a0, a1, rl_prep_term_function, a3, a4, a5);
if (rl_deprep_term_function)
*(5242952)();
rl_clear_signals();
v2 = v0;
}
return v2;
}
|
fix_problem(ctx, 0x010077, pctx)) {
inode->i_flags &= ~0x10000000;
dirty = 1;
goto out;
}
| && ((*(_WORD *)s & 0xF000) != 0x4000 && (unsigned int)fix_problem(a1, 65672LL, &inode_bitmap)
|| !has_feature_casefold && (unsigned int)fix_problem(a1, 65673LL, &inode_bitmap)) )
{
*((_DWORD *)s + 8) &= ~0x40000000u;
e2fsck_write_inode(a1, v26, s, "pass1");
}
|
static char const *
first_percent_b (char const *fmt)
{
for (; *fmt; fmt++)
if (fmt[0] == '%')
switch (fmt[1])
{
case 'b': return fmt;
case '%': fmt++; break;
}
return
((void *)0)
;
}
| int first_percent_b(unsigned long a0) {
char v0[2];
unsigned int v2;
*(&v0) = a0;
while (true) {
if (!v0[0]) {
v2 = 0;
break;
} else {
if (v0[0] == 37) {
if (v0[1] == 37) {
*(&v0) = &v0[1];
} else if (v0[1] == 98) {
v2 = v0;
break;
}
}
*(&v0) = &v0[1];
}
}
return v2;
}
|
rsRetVal
submitMsg(smsg_t *pMsg)
{
return submitMsgWithDfltRatelimiter(pMsg);
}
| long submitMsg(long a1)
{
return submitMsgWithDfltRatelimiter(a1);
}
|
void
remove_unwind_protect ()
{
if (unwind_protect_list)
without_interrupts
(remove_unwind_protect_internal, (char *)
((void *)0)
, (char *)
((void *)0)
);
}
| long long remove_unwind_protect() {
unsigned long long v1;
v1 = unwind_protect_list;
if (unwind_protect_list)
v1 = without_interrupts(remove_unwind_protect_internal, 0x0, 0x0);
return v1;
}
|
int mm_answer_auth2_read_banner(struct ssh *ssh, int sock, struct sshbuf *m)
{
char *banner;
int r;
sshbuf_reset(m);
banner = auth2_read_banner();
if ((r = sshbuf_put_cstring(m, banner !=
((void *)0)
? banner : "")) != 0)
sshfatal("monitor.c", __func__, 819, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble");
mm_request_send(sock, MONITOR_ANS_AUTH2_READ_BANNER, m);
free(banner);
return (0);
}
| long mm_answer_auth2_read_banner(long a1, unsigned int a2, long a3)
{
void *v3;
long v4;
unsigned int v7;
void *ptr;
sshbuf_reset(a3);
ptr = (void *)auth2_read_banner();
if ( ptr )
v3 = ptr;
else
v3 = &unk_63A3;
v7 = sshbuf_put_cstring(a3, v3);
if ( v7 )
{
v4 = ssh_err(v7);
sshfatal("monitor.c", "mm_answer_auth2_read_banner", 819LL, 1LL, 1LL, v4, "assemble");
}
mm_request_send(a2, 11LL, a3);
free(ptr);
return 0LL;
}
|
int
sshbuf_dtourlb64(const struct sshbuf *d, struct sshbuf *b64, int wrap)
{
int r = -1;
u_char *p;
struct sshbuf *b =
((void *)0)
;
size_t i, l;
if ((b = sshbuf_new()) ==
((void *)0)
)
return -2;
if ((r = sshbuf_dtob64(d, b, wrap)) != 0)
goto out;
for (;;) {
l = sshbuf_len(b);
if (l <= 1 || sshbuf_ptr(b) ==
((void *)0)
) {
r = -1;
goto out;
}
if (sshbuf_ptr(b)[l - 1] != '=')
break;
if ((r = sshbuf_consume_end(b, 1)) != 0)
goto out;
}
l = sshbuf_len(b);
if ((p = sshbuf_mutable_ptr(b)) ==
((void *)0)
) {
r = -1;
goto out;
}
for (i = 0; i < l; i++) {
if (p[i] == '+')
p[i] = '-';
else if (p[i] == '/')
p[i] = '_';
}
r = sshbuf_putb(b64, b);
out:
sshbuf_free(b);
return r;
}
| long long sshbuf_dtourlb64(unsigned long long a0, unsigned long long a1, unsigned long a2) {
unsigned int v0;
void* v1;
void* v2;
unsigned long v3;
void* v4;
unsigned long long v6;
v0 = -1;
v2 = 0;
v2 = sshbuf_new();
if (!v2) {
v6 = 4294967294;
} else {
v0 = sshbuf_dtob64(a0, v2, a2);
if (!v0) {
do {
v3 = sshbuf_len(v2);
if (v3 <= 1) {
LABEL_4007c4:
v0 = -1;
break;
} else {
if (!sshbuf_ptr(v2))
goto LABEL_4007c4;
if (*((sshbuf_ptr(v2) + v3 - 1)) != 61) {
v3 = sshbuf_len(v2);
v4 = sshbuf_mutable_ptr(v2);
if (!v4) {
v0 = -1;
break;
} else {
for (v1 = 0; v1 < v3; v1 += 1) {
if (*((v1 + v4)) == 43) {
*((v1 + v4)) = 45;
} else if (*((v1 + v4)) == 47) {
*((v1 + v4)) = 95;
}
}
v0 = sshbuf_putb(a1, v2, v2);
break;
}
}
}
v0 = sshbuf_consume_end(v2, 0x1);
} while (!v0);
}
sshbuf_free(v2);
v6 = v0;
}
return v6;
}
|
int e2fsck_dir_info_get_dotdot(e2fsck_t ctx, ext2_ino_t ino,
ext2_ino_t *dotdot)
{
struct dir_info *p;
p = e2fsck_get_dir_info(ctx, ino);
if (!p)
return 1;
*dotdot = p->dotdot;
return 0;
}
| long long e2fsck_dir_info_get_dotdot(void* a0, unsigned long a1, unsigned int *a2) {
struct_0 *v0;
unsigned long long v2;
v0 = e2fsck_get_dir_info(a0, a1);
if (!v0) {
v2 = 1;
return v2;
}
*(a2) = v0->field_4;
v2 = 0;
return v2;
}
|
static int
input_userauth_passwd_changereq(int type, u_int32_t seqnr, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
char *info =
((void *)0)
, *lang =
((void *)0)
, *password =
((void *)0)
, *retype =
((void *)0)
;
char prompt[256];
const char *host;
int r;
sshlog("sshconnect2.c", __func__, 1117, 0, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "input_userauth_passwd_changereq");
if (authctxt ==
((void *)0)
)
sshfatal("sshconnect2.c", __func__, 1120, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "input_userauth_passwd_changereq: " "no authentication context")
;
host = options.host_key_alias ? options.host_key_alias : authctxt->host;
if ((r = sshpkt_get_cstring(ssh, &info,
((void *)0)
)) != 0 ||
(r = sshpkt_get_cstring(ssh, &lang,
((void *)0)
)) != 0)
goto out;
if (strlen(info) > 0)
sshlog("sshconnect2.c", __func__, 1128, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "%s", info);
if ((r = sshpkt_start(ssh, 50)) != 0 ||
(r = sshpkt_put_cstring(ssh, authctxt->server_user)) != 0 ||
(r = sshpkt_put_cstring(ssh, authctxt->service)) != 0 ||
(r = sshpkt_put_cstring(ssh, authctxt->method->name)) != 0 ||
(r = sshpkt_put_u8(ssh, 1)) != 0)
goto out;
snprintf(prompt, sizeof(prompt),
"Enter %.30s@%.128s's old password: ",
authctxt->server_user, host);
password = read_passphrase(prompt, 0);
if ((r = sshpkt_put_cstring(ssh, password)) != 0)
goto out;
freezero(password, strlen(password));
password =
((void *)0)
;
while (password ==
((void *)0)
) {
snprintf(prompt, sizeof(prompt),
"Enter %.30s@%.128s's new password: ",
authctxt->server_user, host);
password = read_passphrase(prompt, 0x0004);
if (password ==
((void *)0)
) {
r = 0;
goto out;
}
snprintf(prompt, sizeof(prompt),
"Retype %.30s@%.128s's new password: ",
authctxt->server_user, host);
retype = read_passphrase(prompt, 0);
if (strcmp(password, retype) != 0) {
freezero(password, strlen(password));
sshlog("sshconnect2.c", __func__, 1161, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Mismatch; try again, EOF to quit.");
password =
((void *)0)
;
}
freezero(retype, strlen(retype));
}
if ((r = sshpkt_put_cstring(ssh, password)) != 0 ||
(r = sshpkt_add_padding(ssh, 64)) != 0 ||
(r = sshpkt_send(ssh)) != 0)
goto out;
ssh_dispatch_set(ssh, 60,
&input_userauth_passwd_changereq);
r = 0;
out:
if (password)
freezero(password, strlen(password));
free(info);
free(lang);
return r;
}
| int input_userauth_passwd_changereq(undefined4 param_1,undefined4 param_2,long param_3)
{
undefined8 uVar1;
long lVar2;
int iVar3;
size_t sVar4;
char **ppcVar5;
long in_FS_OFFSET;
char *apcStack376 [2];
long local_168;
undefined4 local_160;
undefined4 local_15c;
int local_14c;
char *local_148;
void *local_140;
char *local_138;
undefined8 *local_130;
char *local_128;
long local_120;
char local_118 [264];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_130 = *(undefined8 **)(param_3 + 0x860);
local_148 = (char *)0x0;
local_140 = (void *)0x0;
local_138 = (char *)0x0;
local_128 = (char *)0x0;
apcStack376[0] = "input_userauth_passwd_changereq";
local_168 = param_3;
local_160 = param_2;
local_15c = param_1;
sshlog("sshconnect2.c","input_userauth_passwd_changereq",0x45d,0,6,0);
ppcVar5 = (char **)&local_168;
if (local_130 == (undefined8 *)0x0) {
ppcVar5 = apcStack376;
apcStack376[0] = "input_userauth_passwd_changereq: no authentication context";
sshfatal("sshconnect2.c","input_userauth_passwd_changereq",0x460,0,1,0);
}
lVar2 = local_168;
local_120 = _sshkey_alg_list;
if (_sshkey_alg_list == 0) {
local_120 = local_130[2];
}
*(undefined8 *)((long)ppcVar5 + -8) = 0x102261;
local_14c = sshpkt_get_cstring(lVar2,&local_148,0);
lVar2 = local_168;
if (local_14c == 0) {
*(undefined8 *)((long)ppcVar5 + -8) = 0x102292;
local_14c = sshpkt_get_cstring(lVar2,&local_140,0);
if (local_14c == 0) {
*(undefined8 *)((long)ppcVar5 + -8) = 0x1022b4;
sVar4 = strlen(local_148);
if (sVar4 != 0) {
*(char **)((long)ppcVar5 + -8) = local_148;
*(undefined **)((long)ppcVar5 + -0x10) = &DAT_00107e34;
*(undefined8 *)((long)ppcVar5 + -0x18) = 0x1022f7;
sshlog("sshconnect2.c","input_userauth_passwd_changereq",0x468,0,3,0);
}
lVar2 = local_168;
*(undefined8 *)((long)ppcVar5 + -8) = 0x10230f;
local_14c = sshpkt_start(lVar2,0x32);
lVar2 = local_168;
if (local_14c == 0) {
uVar1 = *local_130;
*(undefined8 *)((long)ppcVar5 + -8) = 0x10233e;
local_14c = sshpkt_put_cstring(lVar2,uVar1);
lVar2 = local_168;
if (local_14c == 0) {
uVar1 = local_130[3];
*(undefined8 *)((long)ppcVar5 + -8) = 0x10236e;
local_14c = sshpkt_put_cstring(lVar2,uVar1);
lVar2 = local_168;
if (local_14c == 0) {
uVar1 = *(undefined8 *)local_130[4];
*(undefined8 *)((long)ppcVar5 + -8) = 0x1023a1;
local_14c = sshpkt_put_cstring(lVar2,uVar1);
lVar2 = local_168;
if (local_14c == 0) {
*(undefined8 *)((long)ppcVar5 + -8) = 0x1023c8;
local_14c = sshpkt_put_u8(lVar2,1);
if (local_14c == 0) {
uVar1 = *local_130;
*(undefined8 *)((long)ppcVar5 + -8) = 0x102412;
snprintf(local_118,0x100,"Enter %.30s@%.128s\'s old password: ",uVar1,local_120);
*(undefined8 *)((long)ppcVar5 + -8) = 0x102426;
local_138 = (char *)read_passphrase(local_118,0);
lVar2 = local_168;
*(undefined8 *)((long)ppcVar5 + -8) = 0x102446;
local_14c = sshpkt_put_cstring(lVar2,local_138);
if (local_14c == 0) {
*(undefined8 *)((long)ppcVar5 + -8) = 0x102468;
sVar4 = strlen(local_138);
*(undefined8 *)((long)ppcVar5 + -8) = 0x10247d;
freezero(local_138,sVar4);
local_138 = (char *)0x0;
while (lVar2 = local_168, local_138 == (char *)0x0) {
uVar1 = *local_130;
*(undefined8 *)((long)ppcVar5 + -8) = 0x1024c4;
snprintf(local_118,0x100,"Enter %.30s@%.128s\'s new password: ",uVar1,local_120)
;
*(undefined8 *)((long)ppcVar5 + -8) = 0x1024d8;
local_138 = (char *)read_passphrase(local_118,4);
if (local_138 == (char *)0x0) {
local_14c = 0;
goto LAB_001026a0;
}
uVar1 = *local_130;
*(undefined8 *)((long)ppcVar5 + -8) = 0x10252f;
snprintf(local_118,0x100,"Retype %.30s@%.128s\'s new password: ",uVar1,local_120
);
*(undefined8 *)((long)ppcVar5 + -8) = 0x102543;
local_128 = (char *)read_passphrase(local_118,0);
*(undefined8 *)((long)ppcVar5 + -8) = 0x102563;
iVar3 = strcmp(local_138,local_128);
if (iVar3 != 0) {
*(undefined8 *)((long)ppcVar5 + -8) = 0x102576;
sVar4 = strlen(local_138);
*(undefined8 *)((long)ppcVar5 + -8) = 0x10258b;
freezero(local_138,sVar4);
*(char **)((long)ppcVar5 + -0x10) = "Mismatch; try again, EOF to quit.";
*(undefined8 *)((long)ppcVar5 + -0x18) = 0x1025c5;
sshlog("sshconnect2.c","input_userauth_passwd_changereq",0x489,0,3,0);
local_138 = (char *)0x0;
}
*(undefined8 *)((long)ppcVar5 + -8) = 0x1025e3;
sVar4 = strlen(local_128);
*(undefined8 *)((long)ppcVar5 + -8) = 0x1025f8;
freezero(local_128,sVar4);
}
*(undefined8 *)((long)ppcVar5 + -8) = 0x10261f;
local_14c = sshpkt_put_cstring(lVar2,local_138);
lVar2 = local_168;
if (local_14c == 0) {
*(undefined8 *)((long)ppcVar5 + -8) = 0x102642;
local_14c = sshpkt_add_padding(lVar2,0x40);
lVar2 = local_168;
if (local_14c == 0) {
*(undefined8 *)((long)ppcVar5 + -8) = 0x102660;
local_14c = sshpkt_send(lVar2);
lVar2 = local_168;
if (local_14c == 0) {
*(undefined8 *)((long)ppcVar5 + -8) = 0x10268a;
ssh_dispatch_set(lVar2,0x3c,input_userauth_passwd_changereq);
local_14c = 0;
}
}
}
}
}
}
}
}
}
}
}
LAB_001026a0:
if (local_138 != (char *)0x0) {
*(undefined8 *)((long)ppcVar5 + -8) = 0x1026b9;
sVar4 = strlen(local_138);
*(undefined8 *)((long)ppcVar5 + -8) = 0x1026ce;
freezero(local_138,sVar4);
}
*(undefined8 *)((long)ppcVar5 + -8) = 0x1026dd;
free(local_148);
*(undefined8 *)((long)ppcVar5 + -8) = 0x1026ec;
free(local_140);
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return local_14c;
}
*(undefined8 *)((long)ppcVar5 + -8) = 0x102706;
__stack_chk_fail();
}
|
static void
put_paragraph (WORD *finish)
{
WORD *w;
put_line (unused_word_type, first_indent);
for (w = unused_word_type->next_break; w != finish; w = w->next_break)
put_line (w, other_indent);
}
| void put_paragraph(unsigned long a0) {
struct_0 *v0;
struct_0 *v2;
put_line(&unused_word_type, first_indent);
v0 = g_402f40;
while (true) {
v2 = v0;
if (v0 == a0)
break;
put_line(v0, other_indent);
v0 = v0->field_20;
}
return;
}
|
static char *
gidtostr_ptr (gid_t const *gid)
{
static 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)];
return umaxtostr (*gid, buf);
}
| int gidtostr_ptr(unsigned int *a0) {
return umaxtostr(*(a0), &buf.5863);
}
|
static int
history_def_init(void **p, HistEvent *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;
}
| int history_def_init(unsigned long long *a0, unsigned long a1, unsigned long a2) {
unsigned int v0;
unsigned long v1;
struct_0 *v2;
unsigned int v4;
v1 = a1;
v0 = a2;
v2 = malloc(0x40);
if (!v2) {
v4 = -1;
return v4;
}
if (v0 <= 0)
v0 = 0;
v2->field_38 = 0;
v2->field_34 = 0;
v2->field_30 = v0;
v2->field_20 = v2;
v2->field_18 = v2->field_20;
v2->field_8 = 0;
v2->field_0 = 0;
v2->field_28 = v2;
v2->field_3c = 0;
*(a0) = v2;
v4 = 0;
return v4;
}
|
static char *
quote_assign (string)
const char *string;
{
size_t slen;
int saw_eq;
char *temp, *t, *subs;
const char *s, *send;
int ss, se;
mbstate_t state; memset (&state, '\0', sizeof (mbstate_t));
slen = strlen (string);
send = string + slen;
t = temp = (char *)sh_xmalloc((slen * 2 + 1), "arrayfunc.c", 918);
saw_eq = 0;
for (s = string; *s; )
{
if (*s == '=')
saw_eq = 1;
if (saw_eq == 0 && *s == '[')
{
ss = s - string;
se = skipsubscript (string, ss, 0);
subs = substring (s, ss, se);
*t++ = '\\';
strcpy (t, subs);
t += se - ss;
*t++ = '\\';
*t++ = ']';
s += se + 1;
sh_xfree((subs), "arrayfunc.c", 935);
continue;
}
if (saw_eq == 0 && (glob_char_p (s) || (ifs_cmap[(unsigned char)(*s)] != 0)))
*t++ = '\\';
do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _k; _k = is_basic (*(s)); if (_k) mblength = 1; else if (locale_utf8locale && ((*(s) & 0x80) == 0)) mblength = *(s) != 0; else { state_bak = state; mblength = mbrlen ((s), (send) - (s), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; mblength = 1; } else mblength = (mblength < 1) ? 1 : mblength; for (_k = 0; _k < mblength; _k++) *(t)++ = *(s)++; } else *(t)++ = *(s)++; } while (0);
}
*t = '\0';
return temp;
}
| int quote_assign(char *a0) {
unsigned int v0;
int tmp_14;
int tmp_47;
int tmp_55;
int tmp_10;
unsigned int v1;
unsigned int v2;
unsigned int v3;
char *v4;
char *v5;
unsigned long long v6;
unsigned long v7;
unsigned long v8;
char *v9;
char *v10;
unsigned long long v11;
unsigned long long v12;
char *v14;
char *v15;
unsigned long long v17;
char *v18;
memset(&v11, 0x0, 0x8);
v7 = strlen(a0);
v8 = &a0[v7];
v9 = sh_xmalloc(v7 * 2 + 1, "arrayfunc.c", 0x396);
v4 = v9;
v0 = 0;
v5 = a0;
while (true) {
if (!*(v5))
break;
if (*(v5) == 61)
v0 = 1;
if (!v0 && *(v5) == 91) {
v2 = v5 - a0;
v3 = skipsubscript(a0, v2, 0x0);
v10 = substring(v5, v2, v3, v2);
tmp_14 = v4;
v4 += 1;
*(tmp_14) = 92;
strcpy(v4, v10);
v4 = &v4[v3 + -1 * v2];
tmp_47 = v4;
v4 += 1;
*(tmp_47) = 92;
tmp_55 = v4;
v4 += 1;
*(tmp_55) = 93;
v5 = &v5[1 + v3];
sh_xfree(v10, "arrayfunc.c", 0x3a7);
continue;
}
if (!v0) {
if (!glob_char_p(v5) && !*(*(v5) + &ifs_cmap))
goto LABEL_401d67;
v14 = v4;
v4 += 1;
*(v14) = 92;
}
LABEL_401d67:
if (locale_mb_cur_max <= 1) {
tmp_10 = v5;
v5 += 1;
v15 = v4;
v4 += 1;
*(v15) = *(tmp_10);
continue;
}
v1 = is_basic(*(v5));
if (v1) {
v6 = 1;
goto LABEL_401dee;
}
if (locale_utf8locale && *(v5) >= 0) {
v6 = *(v5);
goto LABEL_401dee;
}
v12 = v11;
v6 = mbrlen(v5, v8 + -0x1 * v5, &v11, v8 + -0x1 * v5);
LABEL_401dee:
if (v6 == -2) {
LABEL_401dfc:
v11 = v12;
v6 = 1;
goto LABEL_401e24;
} else {
if (v6 == -1)
goto LABEL_401dfc;
if (!v6)
v17 = 1;
else
v17 = v6;
v6 = v17;
LABEL_401e24:
for (v1 = 0; v6 > v1; v1 += 1) {
tmp_14 = v5;
v5 += 1;
v18 = v4;
v4 += 1;
*(v18) = *(tmp_14);
}
}
}
*(v4) = 0;
return v9;
}
|
static enum char_class
is_valid_cclass (name)
const char *name;
{
enum char_class ret;
int i;
ret = CC_NO_CLASS;
for (i = 1; i < (sizeof(cclass_name) / sizeof (cclass_name[0])); i++)
{
if (((name)[0] == (cclass_name[i])[0] && strcmp(name, cclass_name[i]) == 0))
{
ret = (enum char_class)i;
break;
}
}
return ret;
}
| long is_valid_cclass(const char *a1)
{
unsigned int v2;
int i;
v2 = 0;
for ( i = 1; (unsigned int)i <= 0xE; ++i )
{
if ( *a1 == *(_BYTE *)*(&cclass_name + i) && !strcmp(a1, (const char *)*(&cclass_name + i)) )
return (unsigned int)i;
}
return v2;
}
|
static int
grow_dst(char **dst, size_t *sz, size_t maxsz, char **dp, size_t need)
{
char *tp;
size_t tsz;
if (*dp + need < *dst + *sz)
return 0;
tsz = *sz + 128;
if (tsz > maxsz)
tsz = maxsz;
if ((tp = recallocarray(*dst, *sz, tsz, 1)) ==
((void *)0)
)
return -1;
*dp = tp + (*dp - *dst);
*dst = tp;
*sz = tsz;
return 0;
}
| int grow_dst(unsigned long long *a0, unsigned long long *a1, unsigned long long a2, unsigned long long *a3, unsigned long a4) {
unsigned long long v0;
unsigned long v1;
unsigned int v3;
if (*(a3) + a4 < *(a1) + *(a0)) {
v3 = 0;
} else {
v0 = *(a1) - -128;
if (v0 > a2)
v0 = a2;
v1 = recallocarray(*(a0), *(a1), v0, 0x1);
if (!v1) {
v3 = -1;
} else {
*(a3) = __subvdi3(*(a3), *(a0), *(a0)) + v1;
*(a0) = v1;
*(a1) = v0;
v3 = 0;
}
}
return v3;
}
|
static void print_encap_seg6local(FILE *fp, struct rtattr *encap)
{
struct rtattr *tb[(__SEG6_LOCAL_MAX - 1) + 1];
int action;
char b1[64];
(parse_rtattr_flags((tb), ((__SEG6_LOCAL_MAX - 1)), ((void*)(((char*)(encap)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((encap)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)));
if (!tb[SEG6_LOCAL_ACTION])
return;
action = rta_getattr_u32(tb[SEG6_LOCAL_ACTION]);
print_string(PRINT_ANY, "action",
"action %s ", format_action_type(action));
if (tb[SEG6_LOCAL_SRH]) {
open_json_object("srh");
print_srh(fp, ((void*)(((char*)(tb[SEG6_LOCAL_SRH])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))));
close_json_object();
}
if (tb[SEG6_LOCAL_TABLE])
print_string(PRINT_ANY, "table", "table %s ",
rtnl_rttable_n2a(rta_getattr_u32(tb[SEG6_LOCAL_TABLE]),
b1, sizeof(b1)));
if (tb[SEG6_LOCAL_VRFTABLE])
print_string(PRINT_ANY, "vrftable", "vrftable %s ",
rtnl_rttable_n2a(rta_getattr_u32(tb[SEG6_LOCAL_VRFTABLE]),
b1, sizeof(b1)));
if (tb[SEG6_LOCAL_NH4]) {
print_string(PRINT_ANY, "nh4",
"nh4 %s ", rt_addr_n2a(
2
, ((int)((tb[SEG6_LOCAL_NH4])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), ((void*)(((char*)(tb[SEG6_LOCAL_NH4])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))))));
}
if (tb[SEG6_LOCAL_NH6]) {
print_string(PRINT_ANY, "nh6",
"nh6 %s ", rt_addr_n2a(
10
, ((int)((tb[SEG6_LOCAL_NH6])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), ((void*)(((char*)(tb[SEG6_LOCAL_NH6])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))))));
}
if (tb[SEG6_LOCAL_IIF]) {
int iif = rta_getattr_u32(tb[SEG6_LOCAL_IIF]);
print_string(PRINT_ANY, "iif",
"iif %s ", ll_index_to_name(iif));
}
if (tb[SEG6_LOCAL_OIF]) {
int oif = rta_getattr_u32(tb[SEG6_LOCAL_OIF]);
print_string(PRINT_ANY, "oif",
"oif %s ", ll_index_to_name(oif));
}
if (tb[SEG6_LOCAL_BPF])
print_encap_bpf_prog(fp, tb[SEG6_LOCAL_BPF], "endpoint");
if (tb[SEG6_LOCAL_COUNTERS] && show_stats)
print_seg6_local_counters(fp, tb[SEG6_LOCAL_COUNTERS]);
}
| void print_encap_seg6local(void* a0, unsigned short *a1, unsigned long a2, unsigned long long a3, unsigned long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
char v3;
char v4;
char v5;
char v6;
char v7;
char v8;
char v9;
char v10;
char v11;
char v12;
char v13;
char v14;
char v15;
unsigned long long v17;
unsigned long long v18;
unsigned long long *v19;
unsigned long long v20;
parse_rtattr_flags(&v3, 0xa, a1 + 2, *(a1) - 4, 0x8000);
if (*(&v4)) {
v0 = rta_getattr_u32(*(&v4));
print_string(0x4, "action", "action %s ", format_action_type(v0));
if (*(&v5)) {
open_json_object("srh");
print_srh(a0, *(&v5) + 4);
close_json_object(a0, a1, "action %s ", a3, 0x8000, a5);
}
if (*(&v6)) {
v17 = rta_getattr_u32(*(&v6));
print_string(0x4, "table", "table %s ", rtnl_rttable_n2a(v17, &v14, 0x40, v17));
}
if (*(&v12)) {
v18 = rta_getattr_u32(*(&v12));
print_string(0x4, "vrftable", "vrftable %s ", rtnl_rttable_n2a(v18, &v14, 0x40, v18));
}
if (*(&v7))
print_string(0x4, "nh4", "nh4 %s ", rt_addr_n2a(0x2, *(*(&v7)) - 4, *(&v7) + 4));
if (*(&v8))
print_string(0x4, "nh6", "nh6 %s ", rt_addr_n2a(0xa, *(*(&v8)) - 4, *(&v8) + 4));
if (*(&v9)) {
v1 = rta_getattr_u32(*(&v9));
print_string(0x4, "iif", "iif %s ", ll_index_to_name(v1));
}
if (*(&v10)) {
v2 = rta_getattr_u32(*(&v10));
print_string(0x4, "oif", "oif %s ", ll_index_to_name(v2));
}
if (*(&v11))
print_encap_bpf_prog(a0, *(&v11), "endpoint");
if (*(&v13) && show_stats)
print_seg6_local_counters(a0, *(&v13), *(&v13), a3, 0x8000, a5);
}
v20 = *(&v15) ^ v19[5];
return;
}
|
static const char *
channel_fwd_bind_addr(struct ssh *ssh, const char *listen_addr, int *wildcardp,
int is_client, struct ForwardOptions *fwd_opts)
{
const char *addr =
((void *)0)
;
int wildcard = 0;
if (listen_addr ==
((void *)0)
) {
if (fwd_opts->gateway_ports)
wildcard = 1;
} else if (fwd_opts->gateway_ports || is_client) {
if (((ssh->compat & 0x01000000) &&
strcmp(listen_addr, "0.0.0.0") == 0 && is_client == 0) ||
*listen_addr == '\0' || strcmp(listen_addr, "*") == 0 ||
(!is_client && fwd_opts->gateway_ports == 1)) {
wildcard = 1;
if (*listen_addr != '\0' &&
strcmp(listen_addr, "0.0.0.0") != 0 &&
strcmp(listen_addr, "*") != 0) {
ssh_packet_send_debug(ssh,
"Forwarding listen address "
"\"%s\" overridden by server "
"GatewayPorts", listen_addr);
}
} else if (strcmp(listen_addr, "localhost") != 0 ||
strcmp(listen_addr, "127.0.0.1") == 0 ||
strcmp(listen_addr, "::1") == 0) {
addr = listen_addr;
}
} else if (strcmp(listen_addr, "127.0.0.1") == 0 ||
strcmp(listen_addr, "::1") == 0) {
addr = listen_addr;
}
if (wildcardp !=
((void *)0)
)
*wildcardp = wildcard;
return addr;
}
| int channel_fwd_bind_addr(struct_0 *a0, void* a1, unsigned int *a2, unsigned long a3, unsigned int *a4) {
unsigned int v0;
void* v1;
v1 = 0;
v0 = 0;
if (a1) {
if (*(a4) || a3) {
if ((a0->field_83c & 0x1000000) && !strcmp(a1, "0.0.0.0") && !a3 || !*(a1) || !strcmp(a1, "*") || !a3 && *(a4) == 1) {
v0 = 1;
if (*(a1) && strcmp(a1, "0.0.0.0") && strcmp(a1, "*"))
ssh_packet_send_debug(a0, "Forwarding listen address \"%s\" overridden by server GatewayPorts", a1);
} else if (strcmp(a1, "localhost") || !strcmp(a1, "127.0.0.1") || !strcmp(a1, "::1")) {
v1 = a1;
}
} else {
if (!strcmp(a1, "127.0.0.1") || !strcmp(a1, "::1"))
v1 = a1;
}
} else {
if (*(a4))
v0 = 1;
}
if (a2)
*(a2) = v0;
return v1;
}
|
int
get_job_by_name (name, flags)
const char *name;
int flags;
{
register int i, wl, cl, match, job;
register PROCESS *p;
register JOB *j;
job = -1;
wl = strlen (name);
for (i = js.j_jobslots - 1; i >= 0; i--)
{
j = (jobs[(i)]);
if (j == 0 || ((flags & 0x08) && ((j)->state) != JSTOPPED))
continue;
p = j->pipe;
do
{
if (flags & 0x04)
{
cl = strlen (p->command);
match = ((cl == 0) ? (1) : ((p->command)[0] == (name)[0] && strncmp(p->command, name, cl) == 0));
}
else if (flags & 0x02)
match = strcasestr (p->command, name) != (char *)0;
else
match = ((wl == 0) ? (1) : ((p->command)[0] == (name)[0] && strncmp(p->command, name, wl) == 0));
if (match == 0)
{
p = p->next;
continue;
}
else if (flags & 0x10)
return i;
else if (job != -1)
{
if (this_shell_builtin)
builtin_error (gettext("%s: ambiguous job spec"), name);
else
internal_error (gettext("%s: ambiguous job spec"), name);
return (-2);
}
else
job = i;
}
while (p != j->pipe);
}
return (job);
}
| int get_job_by_name(char *param_1,uint param_2)
{
long lVar1;
int iVar2;
int iVar3;
size_t sVar4;
size_t sVar5;
char *pcVar6;
undefined8 uVar7;
undefined8 *puVar8;
int iVar9;
bool bVar10;
iVar9 = -1;
sVar4 = strlen(param_1);
iVar2 = DAT_001031b4;
do {
do {
iVar2 = iVar2 + -1;
if (iVar2 < 0) {
return iVar9;
}
lVar1 = *(long *)(jobs + (long)iVar2 * 8);
} while ((lVar1 == 0) || (((param_2 & 8) != 0 && (*(int *)(lVar1 + 0x14) != 2))));
puVar8 = *(undefined8 **)(lVar1 + 8);
do {
if ((param_2 & 4) == 0) {
if ((param_2 & 2) == 0) {
if (((int)sVar4 == 0) ||
((*(char *)puVar8[3] == *param_1 &&
(iVar3 = strncmp((char *)puVar8[3],param_1,(long)(int)sVar4), iVar3 == 0)))) {
bVar10 = true;
}
else {
bVar10 = false;
}
}
else {
pcVar6 = strcasestr((char *)puVar8[3],param_1);
bVar10 = pcVar6 != (char *)0x0;
}
}
else {
sVar5 = strlen((char *)puVar8[3]);
if (((int)sVar5 == 0) ||
((*(char *)puVar8[3] == *param_1 &&
(iVar3 = strncmp((char *)puVar8[3],param_1,(long)(int)sVar5), iVar3 == 0)))) {
bVar10 = true;
}
else {
bVar10 = false;
}
}
if (bVar10) {
if ((param_2 & 0x10) != 0) {
return iVar2;
}
bVar10 = iVar9 != -1;
iVar9 = iVar2;
if (bVar10) {
if (this_shell_builtin == 0) {
uVar7 = gettext("%s: ambiguous job spec");
internal_error(uVar7,param_1);
}
else {
uVar7 = gettext("%s: ambiguous job spec");
builtin_error(uVar7,param_1);
}
return -2;
}
}
else {
puVar8 = (undefined8 *)*puVar8;
}
} while (puVar8 != *(undefined8 **)(lVar1 + 8));
} while( true );
}
|
static int
regex_usage_warning (const char *name)
{
static int warned_once = 0;
if (wildcards == default_wildcards
&& fnmatch_pattern_has_wildcards (name, 0))
{
warned_once = 1;
do { if (error_hook) error_hook (); error (0, 0, gettext ("Pattern matching characters used in file names")); } while (0)
;
do { if (error_hook) error_hook (); error (0, 0, gettext ("Use --wildcards to enable pattern matching," " or --no-wildcards to suppress this warning")); } while (0)
;
}
return warned_once;
}
| long regex_usage_warning(long a1)
{
char *v1;
char *v2;
if ( !wildcards && (unsigned char)fnmatch_pattern_has_wildcards(a1, 0LL) )
{
warned_once_7632 = 1;
if ( error_hook )
error_hook();
v1 = gettext("Pattern matching characters used in file names");
error(0, 0, v1);
if ( error_hook )
error_hook();
v2 = gettext("Use --wildcards to enable pattern matching, or --no-wildcards to suppress this warning");
error(0, 0, v2);
}
return (unsigned int)warned_once_7632;
}
|
static int same_name(const struct name_cmp_ctx *cmp_ctx, char *s1,
int len1, char *s2, int len2)
{
if (!cmp_ctx->casefold)
return (len1 == len2 && !memcmp(s1, s2, len1));
else
return !ext2fs_casefold_cmp(cmp_ctx->tbl,
(unsigned char *) s1, len1,
(unsigned char *) s2, len2);
}
| _BOOL8 same_name(long a1, const void *a2, int a3, const void *a4, int a5)
{
if ( *(_DWORD *)a1 )
return (unsigned int)ext2fs_casefold_cmp(*(_QWORD *)(a1 + 8), a2, a3, a4, a5) == 0;
return a3 == a5 && !memcmp(a2, a4, a3);
}
|
int
unalias(const char *name)
{
struct alias **app;
app = __lookupalias(name);
if (*app) {
({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; });
*app = freealias(*app);
({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; });
return (0);
}
return (1);
}
| long unalias(const char *a1)
{
void ***v2;
v2 = (void ***)_lookupalias(a1);
if ( !*v2 )
return 1LL;
++suppressint;
*v2 = freealias(*v2);
if ( !--suppressint )
{
if ( intpending )
onint();
}
return 0LL;
}
|
static int insmod_all(struct kmod_ctx *ctx, char **args, int nargs)
{
int i, err = 0;
for (i = 0; i < nargs; i++) {
int r = insmod(ctx, args[i],
((void *)0)
);
if (r < 0)
err = r;
}
return err;
}
| int insmod_all(unsigned long long a0, unsigned long long *a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
v1 = 0;
for (v0 = 0; v0 < a2; v0 += 1) {
v2 = insmod(a0, a1[v0], 0x0);
if (v2 < 0)
v1 = v2;
}
return v1;
}
|
int
kex_protocol_error(int type, u_int32_t seq, struct ssh *ssh)
{
int r;
sshlog("kex.c", __func__, 413, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "kex protocol error: type %d seq %u", type, seq);
if ((r = sshpkt_start(ssh, 3)) != 0 ||
(r = sshpkt_put_u32(ssh, seq)) != 0 ||
(r = sshpkt_send(ssh)) != 0)
return r;
return 0;
}
| long kex_protocol_error(unsigned int a1, unsigned int a2, long a3)
{
unsigned int v5;
sshlog("kex.c", "kex_protocol_error", 413LL, 0LL, 2LL, 0LL, "kex protocol error: type %d seq %u", a1, a2);
v5 = sshpkt_start(a3, 3LL);
if ( v5 )
return v5;
v5 = sshpkt_put_u32(a3, a2);
if ( v5 )
return v5;
v5 = sshpkt_send(a3);
if ( v5 )
return v5;
else
return 0LL;
}
|
const wchar_t *
el_wgets(EditLine *el, int *nread)
{
int retval;
el_action_t cmdnum = 0;
int num;
wchar_t ch;
int nrb;
if (nread ==
((void *)0)
)
nread = &nrb;
*nread = 0;
el->el_read->read_errno = 0;
if (el->el_flags & 0x002) {
el->el_line.lastchar = el->el_line.buffer;
return noedit_wgets(el, nread);
}
if ((el->el_flags & 0x008) == 0)
read_prepare(el);
if (el->el_flags & 0x004) {
if ((el->el_flags & 0x008) == 0)
el->el_line.lastchar = el->el_line.buffer;
terminal__flush(el);
return noedit_wgets(el, nread);
}
for (num = -1; num == -1;) {
if (read_getcmd(el, &cmdnum, &ch) == -1)
break;
if ((size_t)cmdnum >= el->el_map.nfunc)
continue;
el->el_state.thiscmd = cmdnum;
el->el_state.thisch = ch;
if (el->el_map.type == 1 &&
el->el_map.current == el->el_map.key &&
el->el_chared.c_redo.pos < el->el_chared.c_redo.lim) {
if (cmdnum == 58 &&
el->el_chared.c_redo.pos != el->el_chared.c_redo.buf
&& iswprint(el->el_chared.c_redo.pos[-1]))
el->el_chared.c_redo.pos--;
else
*el->el_chared.c_redo.pos++ = ch;
}
retval = (*el->el_map.func[cmdnum]) (el, ch);
el->el_state.lastcmd = cmdnum;
switch (retval) {
case 5:
re_refresh_cursor(el);
break;
case 8:
re_clear_lines(el);
re_clear_display(el);
case 4:
re_refresh(el);
break;
case 9:
re_refresh(el);
terminal_beep(el);
break;
case 0:
break;
case 3:
continue;
case 2:
if ((el->el_flags & 0x008) == 0)
num = 0;
else if (num == -1) {
*el->el_line.lastchar++ = (('d') & 037);
el->el_line.cursor = el->el_line.lastchar;
num = 1;
}
break;
case 1:
num = (int)(el->el_line.lastchar - el->el_line.buffer);
break;
case 7:
re_clear_display(el);
ch_reset(el);
read_clearmacros(&el->el_read->macros);
re_refresh(el);
break;
case 6:
default:
terminal_beep(el);
terminal__flush(el);
break;
}
el->el_state.argument = 1;
el->el_state.doingarg = 0;
el->el_chared.c_vcmd.action = 0x00;
if (el->el_flags & 0x008)
break;
}
terminal__flush(el);
if ((el->el_flags & 0x008) == 0) {
read_finish(el);
*nread = num != -1 ? num : 0;
} else
*nread = (int)(el->el_line.lastchar - el->el_line.buffer);
if (*nread == 0) {
if (num == -1) {
*nread = -1;
if (el->el_read->read_errno)
(*__errno_location ())
= el->el_read->read_errno;
}
return
((void *)0)
;
} else
return el->el_line.buffer;
}
| long long el_wgets(struct_0 *a0, unsigned int *a1) {
unsigned int *v0;
int tmp_16;
struct_3 *v1;
char v2;
char v3;
char v4;
unsigned int v5;
unsigned int v6;
void* v8;
unsigned long v9;
v1 = &a0->padding_0;
v0 = a1;
v2 = 0;
if (!v0)
v0 = &v4;
*(v0) = 0;
a0->field_4c0->field_18 = 0;
if ((a0->field_2c & 2)) {
a0->field_60 = a0->field_50;
v8 = noedit_wgets(a0, v0);
} else {
if (!(a0->field_2c & 8))
read_prepare(a0);
if ((a0->field_2c & 4)) {
if (!(a0->field_2c & 8))
a0->field_60 = a0->field_50;
terminal__flush(a0);
v8 = noedit_wgets(a0, v0);
} else {
v5 = -1;
while (true) {
if (v5 != -1)
break;
if (read_getcmd(a0, &v2, &v3) == -1)
break;
if (!(v2 < a0->field_438))
continue;
a0->field_81 = v2;
a0->field_84 = *(&v3);
if (a0->field_420 == 1) {
if (!(a0->field_400 == a0->field_3f8))
goto LABEL_400c4a;
if (!(a0->field_3a0 < a0->field_3a8))
goto LABEL_400c4a;
if (v2 == 58 && a0->field_3a0 != a0->field_398 && iswprint(*((a0->field_3a0 - 4)))) {
a0->field_3a0 = a0->field_3a0 - 4;
goto LABEL_400c4a;
}
v9 = a0->field_3a0;
a0->field_3a0 = a0->field_3a0 + 4;
*(v9) = *(&v3);
}
LABEL_400c4a:
v6 = *((a0->field_430 + v2 * 8))(a0, *(&v3), *((a0->field_430 + v2 * 8)), *(&v3));
a0->field_80 = v2;
switch (v6) {
case 0:
break;
case 1:
v5 = a0->field_60 + -1 * a0->field_50 >> 2;
break;
case 2:
if (!(a0->field_2c & 8)) {
v5 = 0;
} else if (v5 == -1) {
tmp_16 = a0->field_60;
a0->field_60 = a0->field_60 + 1;
*(tmp_16) = 4;
a0->field_58 = a0->field_60;
v5 = 1;
}
break;
case 4:
re_refresh(a0);
break;
case 5:
re_refresh_cursor(a0);
break;
case 7:
re_clear_display(a0);
ch_reset(a0);
read_clearmacros(a0->field_4c0);
re_refresh(a0);
break;
case 8:
re_clear_lines(a0);
re_clear_display(a0);
case 9:
re_refresh(a0);
terminal_beep(a0);
break;
default:
terminal_beep(a0);
terminal__flush(a0);
break;
}
continue;
a0->field_78 = 1;
a0->field_74 = 0;
a0->field_3c0 = 0;
if ((a0->field_2c & 8))
break;
}
terminal__flush(a0);
if ((a0->field_2c & 8)) {
*(v0) = a0->field_60 + -1 * a0->field_50 >> 2;
} else {
read_finish(a0);
if (v5 == -1)
*(&v9) = 0;
else
*(&v9) = v5;
*(v0) = v9;
}
if (*(v0)) {
v8 = a0->field_50;
} else {
if (v5 == -1) {
*(v0) = -1;
if (a0->field_4c0->field_18)
*(__errno_location()) = a0->field_4c0->field_18;
}
v8 = 0;
}
}
}
return v8;
}
|
void
_rl_errmsg (const char *format, ...)
{
va_list args;
__builtin_va_start(
args
,
format
)
;
fprintf (
stderr
, "readline: ");
vfprintf (
stderr
, format, args);
fprintf (
stderr
, "\n");
fflush (
stderr
);
__builtin_va_end(
args
)
;
}
| long long _rl_errmsg() {
unsigned int v0;
unsigned int v1;
unsigned long v2;
unsigned long v3;
unsigned long v4;
char v5;
unsigned long v6;
unsigned long v7;
unsigned long v8;
unsigned long v9;
unsigned long v10;
int v11;
int v12;
int v13;
int v14;
int v15;
int v16;
int v17;
int v18;
unsigned long v19;
unsigned long v20;
unsigned long v21;
unsigned long v22;
unsigned long v23;
unsigned long v24;
char v25;
int v26;
int v27;
int v28;
int v29;
int v30;
int v31;
int v32;
int v33;
unsigned long long *v34;
char *v35;
v6 = v20;
v7 = v21;
v8 = v22;
v9 = v23;
v10 = v24;
if (v25) {
v11 = v26;
v12 = v27;
v13 = v28;
v14 = v29;
v15 = v30;
v16 = v31;
v17 = v32;
v18 = v33;
}
v4 = v34[5];
v0 = 8;
v1 = 48;
v2 = &v19;
v3 = &v5;
fprintf(stderr, "readline: ");
vfprintf(stderr, v35, &v0);
fprintf(stderr, "\n");
fflush(stderr);
if (!(v4 ^ v34[5]))
return 0;
__stack_chk_fail();
}
|
SHELL_VAR **
all_shell_functions ()
{
return (fapply ((sh_var_map_func_t *)
((void *)0)
));
}
| void all_shell_functions(void)
{
fapply(0);
return;
}
|
static int
session_auth_agent_req(struct ssh *ssh, Session *s)
{
static int called = 0;
int r;
if ((r = sshpkt_get_end(ssh)) != 0)
sshpkt_fatal(ssh, r, "%s: parse packet", __func__);
if (!auth_opts->permit_agent_forwarding_flag ||
!options.allow_agent_forwarding) {
sshlog("session.c", __func__, 2186, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "agent forwarding disabled");
return 0;
}
if (called) {
return 0;
} else {
called = 1;
return auth_input_request_forwarding(ssh, s->pw);
}
}
| int session_auth_agent_req(unsigned long long a0, struct_0 *a1, unsigned long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v0;
unsigned int v1;
unsigned int v3;
v1 = sshpkt_get_end(a0);
if (v1)
sshpkt_fatal(a0, v1, "%s: parse packet", "session_auth_agent_req");
if (*((auth_opts + 4)) && g_500624) {
if (called.21333) {
v3 = 0;
} else {
called.21333 = 1;
v3 = auth_input_request_forwarding(a0, a1->field_10, a1->field_10, "session_auth_agent_req", a4, a5);
}
}
if (!*((auth_opts + 4)) || !g_500624) {
v0 = "agent forwarding disabled";
sshlog("session.c", "session_auth_agent_req", 0x88a, 0x1, 0x5, 0x0);
v3 = 0;
}
return v3;
}
|
static
_Bool
change_env (timezone_t tz)
{
if (setenv_TZ (tz->tz_is_set ? tz->abbrs :
((void *)0)
) != 0)
return
0
;
tzset ();
return
1
;
}
| long change_env(long a1)
{
const char *v1;
if ( *(_BYTE *)(a1 + 8) )
v1 = (const char *)(a1 + 9);
else
v1 = 0LL;
if ( setenv_TZ(v1) )
return 0LL;
tzset();
return 1LL;
}
|
void
shtimer_flush (sh_timer *t)
{
do { if (t->data) sh_xfree((t->data), "timers.c", 87); } while (0);
shtimer_zero (t);
}
| long long shtimer_flush(struct_0 *a0) {
if (a0->field_100)
sh_xfree(a0->field_100, "timers.c", 0x57);
return shtimer_zero(a0);
}
|
static
_Bool
has_capability_cache (char const *file, struct fileinfo *f)
{
static dev_t unsupported_device;
if (f->stat.st_dev == unsupported_device)
{
(*__errno_location ())
=
95
;
return 0;
}
_Bool
b = has_capability (file);
if ( !b && errno_unsupported (
(*__errno_location ())
))
unsupported_device = f->stat.st_dev;
return b;
}
| int has_capability_cache(unsigned long long a0, struct_0 *a1) {
char v0;
unsigned int v2;
if (a1->field_18 == unsupported_device.9573) {
*(__errno_location()) = 95;
v2 = 0;
} else {
v0 = has_capability(a0);
if ((v0 ^ 1) && errno_unsupported(*(__errno_location())))
unsupported_device.9573 = a1->field_18;
v2 = v0;
}
return v2;
}
|
int unlzh(in, out)
int in;
int out;
{
unsigned n;
ifd = in;
ofd = out;
decode_start();
while (!done) {
n = decode((unsigned) ((unsigned) 1 << 13), window);
if (n > 0)
write_buf (out, window, n);
}
return 0;
}
| long unlzh(int a1, unsigned int a2)
{
unsigned int v3;
ifd = a1;
ofd = a2;
decode_start();
while ( !done )
{
v3 = decode(0x2000, (long)&window);
if ( v3 )
write_buf(a2, &window, v3);
}
return 0LL;
}
|
static int do_help(int argc, char **argv)
{
usage();
return 0;
}
| long long do_help(unsigned long a0) {
unsigned long v0;
unsigned int v1;
unsigned long v3;
v1 = a0;
v0 = v3;
usage();
}
|
int main(int argc, char *argv[]) {
int exitstatus;
if ((ProgramName = strrchr(argv[0], '/')) ==
((void *)0)
) {
ProgramName = argv[0];
}
else {
++ProgramName;
}
Pid = getpid();
MailCmd[0] = '\0';
cron_default_mail_charset[0] = '\0';
setlocale(
6
, "");
parse_args(argc, argv);
check_spool_dir();
if (!allowed(RealUser, "/usr/local/etc/cron.allow", "/usr/local/etc/cron.deny")) {
fprintf(
stderr
,
"You (%s) are not allowed to use this program (%s)\n",
User, ProgramName);
fprintf(
stderr
, "See crontab(1) for more information\n");
log_it(RealUser, Pid, "AUTH", "crontab command not allowed", 0);
exit(1);
}
exitstatus = 0;
switch (Option) {
case opt_unknown:
exitstatus = 1;
break;
case opt_list:
list_cmd();
break;
case opt_delete:
delete_cmd();
break;
case opt_edit:
edit_cmd();
break;
case opt_replace:
if (replace_cmd() < 0)
exitstatus = 1;
break;
case opt_hostset:
if (hostset_cmd() < 0)
exitstatus = 1;
break;
case opt_hostget:
if (hostget_cmd() < 0)
exitstatus = 1;
break;
case opt_test:
if (test_cmd() < 0)
exitstatus = 1;
break;
default:
abort();
}
exit(exitstatus);
}
| int main(unsigned long long a0) {
unsigned int v0;
unsigned long long *v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
RandomScale = strrchr(*(v2), 0x2f);
if (true)
RandomScale = -541125437600005303;
else
RandomScale = *(v2);
Pid = getpid();
cron_default_mail_charset = 0;
cron_default_mail_charset = 0;
setlocale(0x6, &g_406013);
parse_args(a0, v2);
check_spool_dir(a0, v2, v3, v4, v5, v6);
if (!allowed(&RealUser, "/usr/local/etc/cron.allow", "/usr/local/etc/cron.deny")) {
fprintf(stderr, "You (%s) are not allowed to use this program (%s)\n", &User, 283935560);
fprintf(stderr, "See crontab(1) for more information\n");
log_it(&RealUser, Pid, "AUTH", "crontab command not allowed", 0x0);
exit(0x1);
}
v0 = 0;
switch (Option) {
case 0:
v0 = 1;
break;
case 1:
list_cmd();
break;
case 2:
delete_cmd();
break;
case 3:
edit_cmd();
break;
case 4:
if (replace_cmd() < 0)
v0 = 1;
break;
case 5:
if (hostset_cmd() < 0)
v0 = 1;
break;
case 6:
if (hostget_cmd() < 0)
v0 = 1;
break;
case 7:
if (test_cmd() < 0)
v0 = 1;
break;
default:
abort();
}
exit(v0);
}
|
static int ip_addr_list(struct nlmsg_chain *ainfo)
{
if (rtnl_addrdump_req(&rth, filter.family, ipaddr_dump_filter) < 0) {
perror("Cannot send dump request");
return 1;
}
if (rtnl_dump_filter_nc(&rth, store_nlmsg, ainfo, 0) < 0) {
fprintf(
stderr
, "Dump terminated\n");
return 1;
}
return 0;
}
| int ip_addr_list(unsigned long long a0) {
unsigned int v1;
if (rtnl_addrdump_req(0x5001d0, g_408504, ipaddr_dump_filter) < 0) {
perror("Cannot send dump request");
v1 = 1;
return v1;
} else if (rtnl_dump_filter_nc(0x5001d0, store_nlmsg, a0, 0x0) < 0) {
fprintf(stderr, "Dump terminated\n");
v1 = 1;
return v1;
} else {
v1 = 0;
return v1;
}
}
|
static int updatewindow(strm, end, copy)
z_streamp strm;
const Bytef *end;
unsigned copy;
{
struct inflate_state *state;
unsigned dist;
state = (struct inflate_state *)strm->state;
if (state->window == 0) {
state->window = (unsigned char *)
(*((strm)->zalloc))((strm)->opaque, (1U << state->wbits), (sizeof(unsigned char)))
;
if (state->window == 0) return 1;
}
if (state->wsize == 0) {
state->wsize = 1U << state->wbits;
state->wnext = 0;
state->whave = 0;
}
if (copy >= state->wsize) {
memcpy(state->window, end - state->wsize, state->wsize);
state->wnext = 0;
state->whave = state->wsize;
}
else {
dist = state->wsize - state->wnext;
if (dist > copy) dist = copy;
memcpy(state->window + state->wnext, end - copy, dist);
copy -= dist;
if (copy) {
memcpy(state->window, end - copy, copy);
state->wnext = copy;
state->whave = state->wsize;
}
else {
state->wnext += dist;
if (state->wnext == state->wsize) state->wnext = 0;
if (state->whave < state->wsize) state->whave += dist;
}
}
return 0;
}
| int updatewindow(unsigned long long a0[11], unsigned long a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
struct_0 *v2;
unsigned int v4;
v0 = a2;
v2 = a0[7];
if (!v2->field_48) {
v2->field_48 = a0[8](a0[10], 1 << (v2->field_38 & 31), 1, 1 << (v2->field_38 & 31), a0[8]);
if (!v2->field_48) {
v4 = 1;
goto LABEL_4007ba;
}
}
if (!v2->field_3c) {
v2->field_3c = 1 << (v2->field_38 & 31);
v2->field_44 = 0;
v2->field_40 = 0;
}
if (v0 >= v2->field_3c) {
memcpy(v2->field_48, -(v2->field_3c) + a1, v2->field_3c);
v2->field_44 = 0;
v2->field_40 = v2->field_3c;
} else {
v1 = v2->field_3c - v2->field_44;
if (v1 > v0)
v1 = v0;
memcpy(v2->field_48 + v2->field_44, -(v0) + a1, v1);
v0 -= v1;
if (v0) {
memcpy(v2->field_48, -(v0) + a1, v0);
v2->field_44 = v0;
v2->field_40 = v2->field_3c;
} else {
v2->field_44 = v2->field_44 + v1;
if (v2->field_44 == v2->field_3c)
v2->field_44 = 0;
if (v2->field_40 < v2->field_3c)
v2->field_40 = v2->field_40 + v1;
}
}
v4 = 0;
LABEL_4007ba:
return v4;
}
|
time_t cronnext(cron_db database,
time_t start, time_t end,
char *include, char *exclude, char *command, int flags) {
time_t closest, next;
user *u;
entry *e;
char *indent = "";
if (flags & 0x02) {
printf("crontabs:\n");
indent = " ";
}
else if (flags & 0x08)
printf("jobs:\n");
closest = -1;
for (u = database.head; u; u = u->next) {
if (include && !matchuser(u->name, include))
continue;
if (exclude && matchuser(u->name, exclude))
continue;
if (!(flags & 0x04) && u->system)
continue;
if (flags & 0x02)
printcrontab(u);
for (e = u->crontab; e; e = e->next) {
if (command && strstr(e->cmd, command) ==
((void *)0)
)
continue;
for (next = nextmatch(e, start, end);
next <= end;
next = nextmatch(e, next + 60, end)) {
if (next < 0)
break;
if (closest < 0 || next < closest)
closest = next;
if (flags & 0x01)
printentry(indent, e, next);
if (! (flags & 0x08))
break;
}
}
}
return closest;
}
| long cronnext(undefined8 param_1,long param_2,long param_3,long param_4,char *param_5,uint param_6,
undefined8 *param_7)
{
int iVar1;
char *pcVar2;
long local_30;
long local_28;
undefined8 *local_20;
undefined8 *local_18;
undefined *local_10;
local_10 = &DAT_00101244;
if ((param_6 & 2) == 0) {
if ((param_6 & 8) != 0) {
printf("jobs:\n");
}
}
else {
printf("crontabs:\n");
local_10 = &DAT_00101250;
}
local_30 = -1;
local_20 = param_7;
do {
if (local_20 == (undefined8 *)0x0) {
return local_30;
}
if ((((param_3 == 0) || (iVar1 = matchuser(local_20[2],param_3), iVar1 != 0)) &&
((param_4 == 0 || (iVar1 = matchuser(local_20[2],param_4), iVar1 == 0)))) &&
(((param_6 & 4) != 0 || (*(int *)((long)local_20 + 0x34) == 0)))) {
if ((param_6 & 2) != 0) {
printcrontab(local_20);
}
for (local_18 = (undefined8 *)local_20[5]; local_18 != (undefined8 *)0x0;
local_18 = (undefined8 *)*local_18) {
if ((param_5 == (char *)0x0) ||
(pcVar2 = strstr((char *)local_18[3],param_5), pcVar2 != (char *)0x0)) {
for (local_28 = nextmatch(local_18,param_1,param_2);
(local_28 <= param_2 && (-1 < local_28));
local_28 = nextmatch(local_18,local_28 + 0x3c,param_2)) {
if ((local_30 < 0) || (local_28 < local_30)) {
local_30 = local_28;
}
if ((param_6 & 1) != 0) {
printentry(local_10,local_18,local_28);
}
if ((param_6 & 8) == 0) break;
}
}
}
}
local_20 = (undefined8 *)*local_20;
} while( true );
}
|
int
sshbuf_put_u8(struct sshbuf *buf, u_char val)
{
u_char *p;
int r;
if ((r = sshbuf_reserve(buf, 1, &p)) < 0)
return r;
p[0] = val;
return 0;
}
| long long sshbuf_put_u8(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long long a3) {
unsigned int v0;
unsigned long long v1;
void* v3;
v0 = sshbuf_reserve(a0, 0x1, &v1, a3);
if (v0 < 0) {
v3 = v0;
} else {
*(v1) = a1;
v3 = 0;
}
return v3;
}
|
int
rl_pending_signal (void)
{
return (_rl_caught_signal);
}
| undefined4 rl_pending_signal(void)
{
return _rl_caught_signal;
}
|
static enum simple_strtod_error
parse_human_number (char const *str, long double *value,
size_t *precision)
{
char *ptr =
((void *)0)
;
enum simple_strtod_error e =
simple_strtod_human (str, &ptr, value, precision, scale_from);
if (e != SSE_OK && e != SSE_OK_PRECISION_LOSS)
{
simple_strtod_fatal (e, str);
return e;
}
if (ptr && *ptr != '\0')
{
if (inval_style != inval_ignore)
error (conv_exit_code, 0, gettext ("invalid suffix in input %s: %s"),
quote_n (0, str), quote_n (1, ptr));
e = SSE_INVALID_SUFFIX;
}
return e;
}
| int parse_human_number(undefined8 param_1,undefined8 param_2,undefined8 param_3)
{
undefined8 uVar1;
undefined8 uVar2;
undefined8 uVar3;
long in_FS_OFFSET;
int local_2c;
char *local_28;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
local_28 = (char *)0x0;
local_2c = simple_strtod_human(param_1,&local_28,param_2,param_3,scale_from);
if ((local_2c == 0) || (local_2c == 1)) {
if ((local_28 != (char *)0x0) && (*local_28 != '\0')) {
if (inval_style != 3) {
uVar1 = quote_n(1,local_28);
uVar2 = quote_n(0,param_1);
uVar3 = gettext("invalid suffix in input %s: %s");
error(conv_exit_code,0,uVar3,uVar2,uVar1);
}
local_2c = 5;
}
}
else {
simple_strtod_fatal(local_2c,param_1);
}
if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) {
return local_2c;
}
__stack_chk_fail();
}
|
const char *
sshkey_sigalg_by_name(const char *name)
{
const struct keytype *kt;
for (kt = keytypes; kt->type != -1; kt++) {
if (strcmp(kt->name, name) != 0)
continue;
if (kt->sigalg !=
((void *)0)
)
return kt->sigalg;
if (!kt->cert)
return kt->name;
return sshkey_ssh_name_from_type_nid(
sshkey_type_plain(kt->type), kt->nid);
}
return
((void *)0)
;
}
| int sshkey_sigalg_by_name(char *a0) {
unsigned long long v0;
unsigned int v2;
v0 = &keytypes;
while (true) {
if (*((v0 + 24)) == -1) {
v2 = 0;
break;
} else if (strcmp(*(v0), a0)) {
v0 += 40;
} else if (*((v0 + 16))) {
v2 = *((v0 + 16));
break;
} else if (!*((v0 + 32))) {
v2 = *(v0);
break;
} else {
v2 = sshkey_ssh_name_from_type_nid(sshkey_type_plain(*((v0 + 24))), *((v0 + 28)));
break;
}
}
return v2;
}
|
(*__errno_location ())
, gettext ("string comparison failed"));
error (0, 0, gettext ("set LC_ALL='C' to work around the problem"));
((!!sizeof (struct { _Static_assert (EXPR_INVALID, "verify_expr (" "EXPR_INVALID" ", " "(error (EXPR_INVALID, 0, gettext (\"the strings compared were %s and %s\"), quotearg_n_style (0, locale_quoting_style, l->u.s), quotearg_n_style (1, locale_quoting_style, r->u.s)), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXPR_INVALID, 0, gettext ("the strings compared were %s and %s"), quotearg_n_style (0, locale_quoting_style, l->u.s), quotearg_n_style (1, locale_quoting_style, r->u.s)), ((
| int * __errno_location(void)
{
halt_baddata();
}
|
void
posix_initialize (on)
int on;
{
if (on != 0)
{
interactive_comments = source_uses_path = expand_aliases = 1;
inherit_errexit = 1;
source_searches_cwd = 0;
print_shift_error = 1;
}
else if (saved_posix_vars)
{
set_posix_options (saved_posix_vars);
sh_xfree((saved_posix_vars), "general.c", 119);
saved_posix_vars = 0;
}
else
{
source_searches_cwd = 1;
expand_aliases = interactive_shell;
print_shift_error = 0;
}
}
| long long posix_initialize(unsigned long a0) {
unsigned long long v1;
if (a0) {
expand_aliases = 1;
source_uses_path = expand_aliases;
v1 = source_uses_path;
interactive_comments = source_uses_path;
inherit_errexit = 1;
source_searches_cwd = 0;
print_shift_error = 1;
return v1;
} else if (saved_posix_vars) {
set_posix_options(saved_posix_vars);
v1 = sh_xfree(saved_posix_vars, "general.c", 0x77);
saved_posix_vars = 0;
return v1;
} else {
source_searches_cwd = 1;
v1 = interactive_shell;
expand_aliases = interactive_shell;
print_shift_error = 0;
return v1;
}
}
|
int
kex_assemble_names(char **listp, const char *def, const char *all)
{
char *cp, *tmp, *patterns;
char *list =
((void *)0)
, *ret =
((void *)0)
, *matching =
((void *)0)
, *opatterns =
((void *)0)
;
int r = -1;
if (listp ==
((void *)0)
|| def ==
((void *)0)
|| all ==
((void *)0)
)
return -10;
if (*listp ==
((void *)0)
|| **listp == '\0') {
if ((*listp = strdup(def)) ==
((void *)0)
)
return -2;
return 0;
}
list = *listp;
*listp =
((void *)0)
;
if (*list == '+') {
if ((tmp = kex_names_cat(def, list + 1)) ==
((void *)0)
) {
r = -2;
goto fail;
}
free(list);
list = tmp;
} else if (*list == '-') {
if ((*listp = match_filter_denylist(def, list + 1)) ==
((void *)0)
) {
r = -2;
goto fail;
}
free(list);
return 0;
} else if (*list == '^') {
if ((tmp = kex_names_cat(list + 1, def)) ==
((void *)0)
) {
r = -2;
goto fail;
}
free(list);
list = tmp;
} else {
}
ret =
((void *)0)
;
if ((patterns = opatterns = strdup(list)) ==
((void *)0)
) {
r = -2;
goto fail;
}
while ((cp = strsep(&patterns, ",")) !=
((void *)0)
) {
if (*cp == '!') {
r = -10;
goto fail;
}
free(matching);
if ((matching = match_filter_allowlist(all, cp)) ==
((void *)0)
) {
r = -2;
goto fail;
}
if ((tmp = kex_names_cat(ret, matching)) ==
((void *)0)
) {
r = -2;
goto fail;
}
free(ret);
ret = tmp;
}
if (ret ==
((void *)0)
|| *ret == '\0') {
r = -10;
goto fail;
}
*listp = ret;
ret =
((void *)0)
;
r = 0;
fail:
free(matching);
free(opatterns);
free(list);
free(ret);
return r;
}
| long long kex_assemble_names(char **a0, char *a1, unsigned long long a2) {
unsigned int v0;
void* v1;
char *v2;
void* v3;
void* v4;
void* v5;
void* v6;
char *v7;
unsigned long long v9;
v2 = 0;
v3 = 0;
v4 = 0;
v5 = 0;
v0 = -1;
if (!a0) {
v9 = 4294967286;
return v9;
} else if (!a1) {
v9 = 4294967286;
return v9;
} else if (!a2) {
v9 = 4294967286;
return v9;
} else {
if (*(a0) && *(*(a0))) {
v2 = *(a0);
*(a0) = 0;
switch (*(v2)) {
case 43:
v6 = kex_names_cat(a1, v2 + 1);
if (!v6) {
v0 = -2;
break;
} else {
free(v2);
v2 = v6;
goto LABEL_4006ad;
}
case 45:
*(a0) = match_filter_denylist(a1, v2 + 1, v2 + 1);
if (*(a0)) {
free(v2);
v9 = 0;
return v9;
}
v0 = -2;
break;
case 94:
v6 = kex_names_cat(v2 + 1, a1);
if (!v6) {
v0 = -2;
break;
} else {
free(v2);
v2 = v6;
goto LABEL_4006ad;
}
default:
LABEL_4006ad:
v3 = 0;
v5 = strdup(v2);
v1 = v5;
if (!v1) {
v0 = -2;
break;
} else {
while (true) {
v7 = strsep(&v1, ",");
if (!v7) {
if (!v3 || !*(v3)) {
v0 = -10;
break;
} else {
*(a0) = v3;
v3 = 0;
v0 = 0;
break;
}
} else {
if (*(v7) == 33) {
v0 = -10;
break;
} else {
free(v4);
v4 = match_filter_allowlist(a2, v7, v7);
if (!v4) {
v0 = -2;
break;
} else {
v6 = kex_names_cat(v3, v4);
if (v6) {
free(v3);
v3 = v6;
} else {
v0 = -2;
break;
}
}
}
}
}
}
}
free(v4);
free(v5);
free(v2);
free(v3);
v9 = v0;
return v9;
}
*(a0) = strdup(a1);
v9 = (!*(a0) ? 0 : 4294967294);
return v9;
}
}
|
int
sshkey_load_private_type(int type, const char *filename, const char *passphrase,
struct sshkey **keyp, char **commentp)
{
int fd, r;
if (keyp !=
((void *)0)
)
*keyp =
((void *)0)
;
if (commentp !=
((void *)0)
)
*commentp =
((void *)0)
;
if ((fd = open(filename,
00
)) == -1)
return -24;
r = sshkey_perm_ok(fd, filename);
if (r != 0)
goto out;
r = sshkey_load_private_type_fd(fd, type, passphrase, keyp, commentp);
if (r == 0 && keyp && *keyp)
r = sshkey_set_filename(*keyp, filename);
out:
close(fd);
return r;
}
| long long sshkey_load_private_type(unsigned long a0, unsigned long a1, unsigned long long a2, unsigned long long *a3, unsigned long long *a4) {
unsigned int v0;
unsigned int v1;
unsigned long long v3;
if (a3)
*(a3) = 0;
if (a4)
*(a4) = 0;
v1 = open(a1, 0x0, a2);
if (v1 == -1) {
v3 = 4294967272;
} else {
v0 = sshkey_perm_ok(v1, a1);
if (!v0) {
v0 = sshkey_load_private_type_fd(v1, a0, a2, a3, a4);
if (!v0 && a3 && *(a3)) {
v0 = sshkey_set_filename(*(a3), a1, a1);
goto LABEL_4003f4;
}
}
LABEL_4003f4:
close(v1);
v3 = v0;
}
return v3;
}
|
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 *param_1)
{
FILE *__stream;
int iVar1;
char *pcVar2;
char *pcVar3;
long in_FS_OFFSET;
char *local_b8;
char **local_b0;
char *local_98;
char *local_90;
char *local_88;
char *local_80;
char *local_78;
char *local_70;
char *local_68;
char *local_60;
char *local_58;
char *local_50;
char *local_48;
char *local_40;
undefined8 local_38;
undefined8 local_30;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
local_98 = "[";
local_90 = "test invocation";
local_88 = "coreutils";
local_80 = "Multi-call invocation";
local_78 = "sha224sum";
local_70 = "sha2 utilities";
local_68 = "sha256sum";
local_60 = "sha2 utilities";
local_58 = "sha384sum";
local_50 = "sha2 utilities";
local_48 = "sha512sum";
local_40 = "sha2 utilities";
local_38 = 0;
local_30 = 0;
local_b0 = &local_98;
while ((*local_b0 != (char *)0x0 && (iVar1 = strcmp(param_1,*local_b0), iVar1 != 0))) {
local_b0 = local_b0 + 2;
}
local_b8 = param_1;
if (local_b0[1] != (char *)0x0) {
local_b8 = local_b0[1];
}
pcVar2 = (char *)gettext("\n%s online help: <%s>\n");
printf(pcVar2,"GNU coreutils","https:
pcVar2 = setlocale(5,(char *)0x0);
if ((pcVar2 != (char *)0x0) && (iVar1 = strncmp(pcVar2,"en_",3), __stream = stdout, iVar1 != 0)) {
pcVar2 = (char *)gettext(
"Report any translation bugs to <https:
);
fputs_unlocked(pcVar2,__stream);
}
iVar1 = strcmp(param_1,"[");
pcVar2 = param_1;
if (iVar1 == 0) {
pcVar2 = "test";
}
pcVar3 = (char *)gettext("Full documentation <%s%s>\n");
printf(pcVar3,"https:
if (local_b8 == param_1) {
pcVar2 = " invocation";
}
else {
pcVar2 = "";
}
pcVar3 = (char *)gettext("or available locally via: info \'(coreutils) %s%s\'\n");
printf(pcVar3,local_b8,pcVar2);
if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
__stack_chk_fail();
}
|
static void
make_command_string_internal (command)
COMMAND *command;
{
char s[3];
if (command == 0)
cprintf ("");
else
{
if (skip_this_indent)
skip_this_indent--;
else
indent (indentation);
if (command->flags & 0x80)
{
cprintf ("time ");
if (command->flags & 0x100)
cprintf ("-p ");
}
if (command->flags & 0x04)
cprintf ("! ");
switch (command->type)
{
case cm_for:
print_for_command (command->value.For);
break;
case cm_arith_for:
print_arith_for_command (command->value.ArithFor);
break;
case cm_select:
print_select_command (command->value.Select);
break;
case cm_case:
print_case_command (command->value.Case);
break;
case cm_while:
print_while_command (command->value.While);
break;
case cm_until:
print_until_command (command->value.While);
break;
case cm_if:
print_if_command (command->value.If);
break;
case cm_arith:
print_arith_command (command->value.Arith->exp);
break;
case cm_cond:
print_cond_command (command->value.Cond);
break;
case cm_simple:
print_simple_command (command->value.Simple);
break;
case cm_connection:
skip_this_indent++;
printing_connection++;
make_command_string_internal (command->value.Connection->first);
switch (command->value.Connection->connector)
{
case '&':
case '|':
{
char c = command->value.Connection->connector;
s[0] = ' ';
s[1] = c;
s[2] = '\0';
print_deferred_heredocs (s);
if (c != '&' || command->value.Connection->second)
{
cprintf (" ");
skip_this_indent++;
}
}
break;
case 288:
print_deferred_heredocs (" && ");
if (command->value.Connection->second)
skip_this_indent++;
break;
case 289:
print_deferred_heredocs (" || ");
if (command->value.Connection->second)
skip_this_indent++;
break;
case ';':
case '\n':
{
char c = command->value.Connection->connector;
s[0] = printing_comsub ? c : ';';
s[1] = '\0';
if (deferred_heredocs == 0)
{
if (was_heredoc == 0)
cprintf ("%s", s);
else
was_heredoc = 0;
}
else
print_deferred_heredocs (inside_function_def ? "" : ";");
if (inside_function_def)
cprintf ("\n");
else
{
if (c == ';')
cprintf (" ");
if (command->value.Connection->second)
skip_this_indent++;
}
break;
}
default:
cprintf (gettext("print_command: bad connector `%d'"),
command->value.Connection->connector);
break;
}
make_command_string_internal (command->value.Connection->second);
do { if (deferred_heredocs) print_deferred_heredocs (""); } while (0);
printing_connection--;
break;
case cm_function_def:
print_function_def (command->value.Function_def);
break;
case cm_group:
print_group_command (command->value.Group);
break;
case cm_subshell:
cprintf ("( ");
skip_this_indent++;
make_command_string_internal (command->value.Subshell->command);
do { if (deferred_heredocs) print_deferred_heredocs (""); } while (0);
cprintf (" )");
break;
case cm_coproc:
cprintf ("coproc %s ", command->value.Coproc->name);
skip_this_indent++;
make_command_string_internal (command->value.Coproc->command);
break;
default:
command_error ("print_command", 1, command->type, 0);
break;
}
if (command->redirects)
{
cprintf (" ");
print_redirection_list (command->redirects);
}
}
}
| void make_command_string_internal(struct_0 *a0) {
char v0;
char v1;
char v2;
char v3;
char v4;
char v5;
char v7;
unsigned long long v8;
unsigned long long *v9;
unsigned long long v10;
if (!a0) {
cprintf(&g_403583);
} else {
if (skip_this_indent)
skip_this_indent = skip_this_indent - 1;
else
indent(indentation);
if ((a0->field_4 & 128)) {
cprintf("time ");
if ((a0->field_4 & 0x100))
cprintf("-p ");
}
if ((a0->field_4 & 4))
cprintf("! ");
switch (a0->field_0) {
case 0:
print_for_command(a0->field_18);
break;
case 1:
print_case_command(a0->field_18);
break;
case 2:
print_while_command(a0->field_18);
break;
case 3:
print_if_command(a0->field_18);
break;
case 4:
print_simple_command(a0->field_18);
break;
case 5:
print_select_command(a0->field_18);
break;
case 6:
skip_this_indent = skip_this_indent + 1;
printing_connection = printing_connection + 1;
make_command_string_internal(a0->field_18->field_8);
if (a0->field_18->field_18 != 289) {
if (a0->field_18->field_18 <= 289) {
if (a0->field_18->field_18 == 288) {
print_deferred_heredocs(" && ");
if (a0->field_18->field_10)
skip_this_indent = skip_this_indent + 1;
} else if (a0->field_18->field_18 <= 288 && a0->field_18->field_18 != 124 && a0->field_18->field_18 <= 124 && (a0->field_18->field_18 == 10 || a0->field_18->field_18 == 59) && (a0->field_18->field_18 == 59 || a0->field_18->field_18 <= 59)) {
v1 = a0->field_18->field_18;
if (printing_comsub)
v7 = v1;
else
v7 = 59;
v2 = v7;
v3 = 0;
if (*(&deferred_heredocs)) {
if (inside_function_def)
v8 = &g_403583;
else
v8 = ";";
print_deferred_heredocs(v8);
} else if (!was_heredoc) {
cprintf("%s");
} else {
was_heredoc = 0;
}
if (inside_function_def) {
cprintf("\n");
} else {
if (v1 == 59)
cprintf(" ");
if (a0->field_18->field_10)
skip_this_indent = skip_this_indent + 1;
}
}
}
if (a0->field_18->field_18 > 289 || a0->field_18->field_18 <= 289 && a0->field_18->field_18 != 288 && a0->field_18->field_18 > 288 || a0->field_18->field_18 <= 288 && a0->field_18->field_18 <= 289 && a0->field_18->field_18 != 288 && a0->field_18->field_18 != 124 && a0->field_18->field_18 > 124 || a0->field_18->field_18 <= 288 && a0->field_18->field_18 <= 124 && a0->field_18->field_18 <= 289 && a0->field_18->field_18 != 288 && a0->field_18->field_18 != 59 && a0->field_18->field_18 != 124 && a0->field_18->field_18 > 59 || a0->field_18->field_18 <= 288 && a0->field_18->field_18 <= 59 && a0->field_18->field_18 <= 124 && a0->field_18->field_18 <= 289 && a0->field_18->field_18 != 288 && a0->field_18->field_18 != 10 && a0->field_18->field_18 != 59 && a0->field_18->field_18 != 124 && a0->field_18->field_18 != 38)
cprintf(gettext("print_command: bad connector `%d'"));
if (a0->field_18->field_18 <= 288 && a0->field_18->field_18 == 124 && a0->field_18->field_18 <= 289 && a0->field_18->field_18 != 288 || a0->field_18->field_18 <= 288 && a0->field_18->field_18 == 38 && a0->field_18->field_18 <= 59 && a0->field_18->field_18 <= 124 && a0->field_18->field_18 <= 289 && a0->field_18->field_18 != 288 && a0->field_18->field_18 != 10 && a0->field_18->field_18 != 59 && a0->field_18->field_18 != 124) {
v0 = a0->field_18->field_18;
v2 = 32;
v3 = v0;
v4 = 0;
print_deferred_heredocs(&v2);
if (a0->field_18->field_10 || v0 != 38) {
cprintf(" ");
skip_this_indent = skip_this_indent + 1;
}
}
} else {
print_deferred_heredocs(" || ");
if (a0->field_18->field_10)
skip_this_indent = skip_this_indent + 1;
}
make_command_string_internal(a0->field_18->field_10);
if (*(&deferred_heredocs))
print_deferred_heredocs(&g_403583);
printing_connection = printing_connection - 1;
break;
case 7:
print_function_def(a0->field_18);
break;
case 8:
print_until_command(a0->field_18);
break;
case 9:
print_group_command(a0->field_18);
break;
case 10:
print_arith_command(a0->field_18->field_8);
break;
case 11:
print_cond_command(a0->field_18);
break;
case 12:
print_arith_for_command(a0->field_18);
break;
case 13:
cprintf("( ");
skip_this_indent = skip_this_indent + 1;
make_command_string_internal(a0->field_18->field_8);
if (*(&deferred_heredocs))
print_deferred_heredocs(&g_403583);
cprintf(" )");
break;
case 14:
cprintf("coproc %s ");
skip_this_indent = skip_this_indent + 1;
make_command_string_internal(a0->field_18->field_10);
break;
default:
command_error("print_command", 0x1, a0->field_0, 0x0);
break;
}
if (a0->field_10) {
cprintf(" ");
print_redirection_list(a0->field_10);
}
}
v10 = *(&v5) ^ v9[5];
return;
}
|
static void
trig_transitional_activate(enum modstatdb_rw cstatus)
{
struct pkg_hash_iter *iter;
struct pkginfo *pkg;
iter = pkg_hash_iter_new();
while ((pkg = pkg_hash_iter_next_pkg(iter))) {
if (pkg->status <= PKG_STAT_HALFINSTALLED)
continue;
debug(dbg_triggersdetail, "trig_transitional_activate %s %s",
pkg_name(pkg, pnaw_always),
pkg_status_name(pkg));
pkg->trigpend_head =
((void *)0)
;
trig_parse_ci(pkg_infodb_get_file(pkg, &pkg->installed,
"triggers"),
cstatus >= msdbrw_write ?
transitional_interest_callback :
transitional_interest_callback_ro,
((void *)0)
,
pkg, &pkg->installed);
if (pkg->status < PKG_STAT_TRIGGERSAWAITED)
continue;
if (pkg->trigaw.head)
pkg_set_status(pkg, PKG_STAT_TRIGGERSAWAITED);
else if (pkg->trigpend_head)
pkg_set_status(pkg, PKG_STAT_TRIGGERSPENDING);
else
pkg_set_status(pkg, PKG_STAT_INSTALLED);
}
pkg_hash_iter_free(iter);
if (cstatus >= msdbrw_write) {
modstatdb_checkpoint();
trig_file_interests_save();
}
}
| long long trig_transitional_activate(unsigned long long a0, unsigned long long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long a5) {
unsigned long long v0;
struct_0 *v1;
unsigned long long v4;
v0 = pkg_hash_iter_new();
while (true) {
while (true) {
while (true) {
do {
do {
v1 = pkg_hash_iter_next_pkg(v0);
if (!v1) {
v4 = pkg_hash_iter_free(v0);
if (a0 > 2) {
modstatdb_checkpoint();
v4 = trig_file_interests_save(a0, a1, 0x0, v1, &v1->padding_1c[44], a5);
return v4;
}
return v4;
}
} while (v1->field_18 <= 2);
pkg_status_name(v1);
debug(0x2000, "trig_transitional_activate %s %s", pkg_name(v1, 0x3));
v1->field_160 = 0;
trig_parse_ci(pkg_infodb_get_file(v1, &v1->padding_1c[44], "triggers", &v1->padding_1c[44]), (a0 <= 2 ? transitional_interest_callback : transitional_interest_callback_ro), 0x0, v1, &v1->padding_1c[44]);
} while (v1->field_18 <= 4);
if (!v1->field_148)
break;
pkg_set_status(v1, 0x5);
}
if (v1->field_160)
break;
pkg_set_status(v1, 0x7);
}
pkg_set_status(v1, 0x6);
}
}
|
static int xfrm_spd_getinfo(int argc, char **argv)
{
struct rtnl_handle rth;
struct {
struct nlmsghdr n;
__u32 flags;
} req = {
.n.nlmsg_len = ((sizeof(__u32)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))),
.n.nlmsg_flags = 0x01,
.n.nlmsg_type = XFRM_MSG_GETSPDINFO,
.flags = 0XFFFFFFFF,
};
struct nlmsghdr *answer;
if (rtnl_open_byproto(&rth, 0, 6) < 0)
exit(1);
if (rtnl_talk(&rth, &req.n, &answer) < 0)
exit(2);
print_spdinfo(answer, (void *)
stdout
);
free(answer);
rtnl_close(&rth);
return 0;
}
| void xfrm_spd_getinfo(unsigned long a0, unsigned long a1) {
unsigned long v0;
unsigned int v1;
char v2;
unsigned int v3;
unsigned short v4;
unsigned short v5;
void* v6;
unsigned int v7;
char v8;
void* v10;
v1 = a0;
v0 = a1;
v3 = 0;
v6 = 0;
v7 = 0;
v3 = 20;
v4 = 37;
v5 = 1;
v7 = -1;
if (rtnl_open_byproto(&v8, 0x0, 0x6) < 0) {
exit(0x1);
} else if (rtnl_talk(&v8, &v3, &v2, &v3) < 0) {
exit(0x2);
} else {
print_spdinfo(*(&v2), stdout);
free(*(&v2));
rtnl_close(&v8);
v10 = 0;
return;
}
}
|
SHELL_VAR **
map_over (function, vc)
sh_var_map_func_t *function;
VAR_CONTEXT *vc;
{
VAR_CONTEXT *v;
VARLIST *vlist;
SHELL_VAR **ret;
int nentries;
for (nentries = 0, v = vc; v; v = v->down)
nentries += ((v->table) ? (v->table)->nentries : 0);
if (nentries == 0)
return (SHELL_VAR **)
((void *)0)
;
vlist = vlist_alloc (nentries);
for (v = vc; v; v = v->down)
flatten (v->table, function, vlist, 0);
ret = vlist->list;
sh_xfree((vlist), "variables.c", 4241);
return ret;
}
| int map_over(unsigned long long a0, unsigned long a1) {
unsigned int v0;
struct_0 *v1;
unsigned long long *v2;
unsigned long v3;
unsigned int v5;
unsigned int v6;
v0 = 0;
for (v1 = a1; v1; v1 = v1->field_18) {
if (v1->field_20)
v5 = v1->field_20->field_c;
else
v5 = 0;
v0 += v5;
}
if (!v0) {
v6 = 0;
} else {
v2 = vlist_alloc(v0);
for (v1[0] = a1; v1; v1[0] = v1[3]) {
flatten(v1[4], a0, v2, 0x0);
}
v3 = *(v2);
sh_xfree(v2, "variables.c", 0x1091);
v6 = v3;
}
return v6;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.