input
stringlengths 28
169k
| output
stringlengths 20
317k
|
|---|---|
static int
history_getunique(HistoryW *h, HistEventW *ev)
{
if (h->h_next != history_def_next) {
{ ev->num = 14; ev->str = he_errlist[14]; };
return -1;
}
ev->num = (((((history_t *)h->h_ref)->flags) & 1) != 0);
return 0;
}
|
int history_getunique(struct_0 *a0, unsigned int *a1) {
unsigned int v1;
if (a0->field_18 != history_def_next) {
*(a1) = 14;
*(&a1[2]) = "f";
v1 = -1;
} else {
*(a1) = (a0->field_0->field_3c & 1);
v1 = 0;
}
return v1;
}
|
static void
_rl_mvcxt_dispose (_rl_vimotion_cxt *m)
{
xfree (m);
}
|
void _rl_mvcxt_dispose(undefined8 param_1)
{
xfree(param_1);
return;
}
|
void print_rta_gateway(FILE *fp, unsigned char family, const struct rtattr *rta)
{
const char *gateway = format_host(family, ((int)((rta)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), ((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))));
__print_rta_gateway(fp, family, gateway);
}
|
long print_rta_gateway(FILE *a1, unsigned char a2, unsigned short *a3)
{
const char *v4;
v4 = (const char *)format_host(a2, (unsigned int)*a3 - 4, a3 + 2);
return _print_rta_gateway(a1, a2, v4);
}
|
static int depmod_module_add(struct depmod *depmod, struct kmod_module *kmod)
{
const struct cfg *cfg = depmod->cfg;
const char *modname, *lastslash;
size_t modnamesz;
struct mod *mod;
int err;
modname = kmod_module_get_name(kmod);
modnamesz = strlen(modname) + 1;
mod = calloc(1, sizeof(struct mod) + modnamesz);
if (mod ==
((void *)0)
)
return -
12
;
mod->kmod = kmod;
mod->sort_idx = depmod->modules.count + 1;
mod->dep_sort_idx =
(2147483647)
;
memcpy(mod->modname, modname, modnamesz);
mod->modnamesz = modnamesz;
array_init(&mod->deps, 4);
mod->path = strdup(kmod_module_get_path(kmod));
lastslash = strrchr(mod->path, '/');
mod->baselen = lastslash - mod->path;
if (strncmp(mod->path, cfg->dirname, cfg->dirnamelen) == 0 &&
mod->path[cfg->dirnamelen] == '/')
mod->relpath = mod->path + cfg->dirnamelen + 1;
else
mod->relpath =
((void *)0)
;
err = hash_add_unique(depmod->modules_by_name, mod->modname, mod);
if (err < 0) {
log_printf(
3
, "hash_add_unique %s: %s\n", mod->modname, strerror(-err));
goto fail;
}
if (mod->relpath !=
((void *)0)
) {
size_t uncrelpathlen = lastslash - mod->relpath + modnamesz
+ strlen(".ko");
mod->uncrelpath = memdup(mod->relpath, uncrelpathlen + 1);
mod->uncrelpath[uncrelpathlen] = '\0';
err = hash_add_unique(depmod->modules_by_uncrelpath,
mod->uncrelpath, mod);
if (err < 0) {
log_printf(
3
, "hash_add_unique %s: %s\n", mod->uncrelpath, strerror(-err))
;
hash_del(depmod->modules_by_name, mod->modname);
goto fail;
}
}
log_printf(
7
, "add %p kmod=%p, path=%s\n", mod, kmod, mod->path);
return 0;
fail:
free(mod->uncrelpath);
free(mod);
return err;
}
|
int depmod_module_add(unsigned long long a0[8], unsigned long long a1, unsigned long a2, unsigned long a3, unsigned long long a4) {
unsigned int v0;
struct_0 *v1;
void* v2;
unsigned long v3;
struct_1 *v4;
unsigned long v5;
char *v6;
unsigned int v8;
v1 = a0[0];
v2 = kmod_module_get_name(a1);
v3 = strlen(v2) + 1;
v4 = calloc(0x1, v3 + 120);
if (!v4) {
v8 = -12;
return v8;
}
v4->field_0 = a1;
v4->field_60 = a0[3] + 1;
v4->field_64 = 2147483647;
memcpy(&v4[1].field_10, v2, v3);
v4->field_58 = v3;
array_init(&v4->padding_20[16], 0x4, v3);
v4->field_8 = strdup(kmod_module_get_path(a1));
v5 = strrchr(v4->field_8, 0x2f);
v4->field_50 = v5 - v4->field_8;
if (strncmp(v4->field_8, &v1->padding_0[8], v1->field_1008) || *((v1->field_1008 + v4->field_8)) != 47)
v4->field_10 = 0;
else
v4->field_10 = v4->field_8 + v1->field_1008 + 1;
v0 = hash_add_unique(a0[7], &v4[1].field_10, v4, &v4[1].field_10);
if (v0 < 0) {
log_printf(0x3, "hash_add_unique %s: %s\n", &v4[1].field_10, strerror(-(v0)), a4);
free(v4->field_18);
free(v4);
v8 = v0;
return v8;
}
if (v4->field_10) {
v6 = strlen(".ko") + v5 - v4->field_10 + v3;
v4->field_18 = memdup(v4->field_10, v6 + 1, v6 + 1);
v6[v4->field_18] = 0;
v0 = hash_add_unique(a0[6], v4->field_18, v4, v4->field_18);
if (v0 < 0) {
log_printf(0x3, "hash_add_unique %s: %s\n", v4->field_18, strerror(-(v0)), a4);
hash_del(a0[7], &v4[1].field_10, &v4[1].field_10);
free(v4->field_18);
free(v4);
v8 = v0;
return v8;
}
}
log_printf(0x7, "add %p kmod=%p, path=%s\n", v4, a1, v4->field_8);
v8 = 0;
return v8;
}
|
static
_Bool
mode_to_chars (mode_t v, char *p, size_t s)
{
int negative;
uintmax_t u;
if (
04000
== 04000 &&
02000
== 02000 &&
01000
== 01000
&&
0400
== 00400 &&
0200
== 00200 &&
0100
== 00100
&&
(0400 >> 3)
== 00040 &&
(0200 >> 3)
== 00020 &&
(0100 >> 3)
== 00010
&&
((0400 >> 3) >> 3)
== 00004 &&
((0200 >> 3) >> 3)
== 00002 &&
((0100 >> 3) >> 3)
== 00001
&& archive_format != POSIX_FORMAT
&& archive_format != USTAR_FORMAT
&& archive_format != GNU_FORMAT)
{
negative = v < 0;
u = v;
}
else
{
negative = 0;
u = ((v &
04000
? 04000 : 0)
| (v &
02000
? 02000 : 0)
| (v &
01000
? 01000 : 0)
| (v &
0400
? 00400 : 0)
| (v &
0200
? 00200 : 0)
| (v &
0100
? 00100 : 0)
| (v &
(0400 >> 3)
? 00040 : 0)
| (v &
(0200 >> 3)
? 00020 : 0)
| (v &
(0100 >> 3)
? 00010 : 0)
| (v &
((0400 >> 3) >> 3)
? 00004 : 0)
| (v &
((0200 >> 3) >> 3)
? 00002 : 0)
| (v &
((0100 >> 3) >> 3)
? 00001 : 0));
}
return to_chars (negative, u, sizeof v, 0, p, s, "mode_t");
}
|
void mode_to_chars(uint param_1,undefined8 param_2,undefined8 param_3)
{
if (((archive_format == 4) || (archive_format == 3)) || (archive_format == 6)) {
param_1 = param_1 & 0xfff;
}
to_chars(0,param_1,4,0,param_2,param_3,"mode_t");
return;
}
|
static void
install_sigchld (void)
{
struct sigaction sa;
sigemptyset (&sa.sa_mask);
sa.
__sigaction_handler.sa_handler
= chld;
sa.sa_flags =
0x10000000
;
sigaction (
17
, &sa,
((void *)0)
);
unblock_signal (
17
);
}
|
void install_sigchld() {
unsigned long long v0;
char v1;
unsigned int v2;
char v3;
unsigned long long *v5;
unsigned long long v6;
sigemptyset(&v1);
v0 = chld;
v2 = 0x10000000;
sigaction(0x11, &v0, 0x0);
unblock_signal(0x11);
v6 = *(&v3) ^ v5[5];
return;
}
|
_Bool
pred_links (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
(void) pathname;
switch (pred_ptr->args.numinfo.kind)
{
case COMP_GT:
if (stat_buf->st_nlink > pred_ptr->args.numinfo.l_val)
return (
1
);
break;
case COMP_LT:
if (stat_buf->st_nlink < pred_ptr->args.numinfo.l_val)
return (
1
);
break;
case COMP_EQ:
if (stat_buf->st_nlink == pred_ptr->args.numinfo.l_val)
return (
1
);
break;
}
return (
0
);
}
|
long pred_links(long a1, long a2, long a3)
{
unsigned int v3;
v3 = *(_DWORD *)(a3 + 56);
if ( v3 == 2 )
{
if ( *(_QWORD *)(a2 + 16) == *(_QWORD *)(a3 + 64) )
return 1LL;
}
else if ( v3 <= 2 )
{
if ( v3 )
{
if ( *(_QWORD *)(a2 + 16) < *(_QWORD *)(a3 + 64) )
return 1LL;
}
else if ( *(_QWORD *)(a2 + 16) > *(_QWORD *)(a3 + 64) )
{
return 1LL;
}
}
return 0LL;
}
|
static void
monitor_permit_authentications(int permit)
{
struct mon_table *ent = mon_dispatch;
while (ent->f !=
((void *)0)
) {
if (ent->flags & (0x0004|0x0008)) {
ent->flags &= ~0x1000;
ent->flags |= permit ? 0x1000 : 0;
}
ent++;
}
}
|
long monitor_permit_authentications(int a1)
{
int v1;
int v2;
long result;
long i;
for ( i = mon_dispatch; ; i += 16LL )
{
result = *(_QWORD *)(i + 8);
if ( !result )
break;
if ( (*(_DWORD *)(i + 4) & 0xC) != 0 )
{
v1 = *(_DWORD *)(i + 4);
BYTE1(v1) &= ~0x10u;
*(_DWORD *)(i + 4) = v1;
if ( a1 )
v2 = 4096;
else
v2 = 0;
*(_DWORD *)(i + 4) |= v2;
}
}
return result;
}
|
static void
dump_cfg_strarray(ServerOpCodes code, u_int count, char **vals)
{
u_int i;
for (i = 0; i < count; i++)
printf("%s %s\n", lookup_opcode_name(code), vals[i]);
}
|
long dump_cfg_strarray(int a1, unsigned int a2, long a3)
{
const char *v3;
const char *v4;
long result;
unsigned int i;
for ( i = 0; ; ++i )
{
result = i;
if ( i >= a2 )
break;
v3 = *(const char **)(8LL * i + a3);
v4 = lookup_opcode_name(a1);
printf("%s %s\n", v4, v3);
}
return result;
}
|
static
Cell *snocString ( Cell *root, Char *name )
{
if (root ==
((void *)0)
) {
Cell *tmp = mkCell();
tmp->name = (Char*) myMalloc ( 5 + strlen(name) );
strcpy ( tmp->name, name );
return tmp;
} else {
Cell *tmp = root;
while (tmp->link !=
((void *)0)
) tmp = tmp->link;
tmp->link = snocString ( tmp->link, name );
return root;
}
}
|
char ** snocString(long a1, const char *a2)
{
int v2;
long i;
char **v5;
if ( a1 )
{
for ( i = a1; *(_QWORD *)(i + 8); i = *(_QWORD *)(i + 8) )
;
*(_QWORD *)(i + 8) = snocString(*(_QWORD *)(i + 8), a2);
return (char **)a1;
}
else
{
v5 = (char **)mkCell();
v2 = strlen(a2);
*v5 = (char *)myMalloc(v2 + 5);
strcpy(*v5, a2);
return v5;
}
}
|
static WORD_DESC *
parameter_brace_expand_word (name, var_is_special, quoted, pflags, estatep)
char *name;
int var_is_special, quoted, pflags;
array_eltstate_t *estatep;
{
WORD_DESC *ret;
char *temp, *tt;
intmax_t arg_index;
SHELL_VAR *var;
int rflags;
array_eltstate_t es;
ret = 0;
temp = 0;
rflags = 0;
if (estatep)
es = *estatep;
else
{
init_eltstate (&es);
es.ind =
(-9223372036854775807L -1)
;
}
if (legal_number (name, &arg_index))
{
tt = get_dollar_var_value (arg_index);
if (tt)
temp = (*tt && (quoted & (0x001|0x002)))
? quote_string (tt)
: quote_escapes (tt);
else
temp = (char *)
((void *)0)
;
do { if (tt) sh_xfree((tt), "subst.c", 7416); } while (0);
}
else if (var_is_special)
{
int sindex;
tt = (char *)sh_xmalloc((2 + strlen (name)), "subst.c", 7421);
tt[sindex = 0] = '$';
strcpy (tt + 1, name);
ret = param_expand (tt, &sindex, quoted, (int *)
((void *)0)
, (int *)
((void *)0)
,
(int *)
((void *)0)
, (int *)
((void *)0)
, pflags);
if ((quoted & (0x001|0x002)) && ((((name)[0]) == '@' || ((name)[0]) == '*') && (name)[1] == '\0') &&
ret && ret->word && ((ret->word)[0] == '\177' && (ret->word)[1] == '\0'))
ret->flags |= (1 << 18);
sh_xfree((tt), "subst.c", 7434);
}
else if (valid_array_reference (name, 0))
{
expand_arrayref:
var = array_variable_part (name, 0, &tt, (int *)0);
if (pflags & 0x08)
{
if (((tt[0]) == '@' || (tt[0]) == '*') && tt[1] == ']')
{
if (var && (((((var)->attributes) & (0x0000004))) || ((((var)->attributes) & (0x0000040)))))
temp = array_value (name, quoted|0x001, 0x010, &es);
else
temp = array_value (name, quoted, 0, &es);
}
else
temp = array_value (name, quoted, 0, &es);
}
else if (pflags & 0x04)
{
if (tt[0] == '@' && tt[1] == ']' && var && quoted == 0 && ifs_is_set && ifs_is_null == 0 && ifs_firstc[0] != ' ')
temp = array_value (name, 0x001, 0x010, &es);
else if (tt[0] == '@' && tt[1] == ']')
temp = array_value (name, quoted, 0, &es);
else if (tt[0] == '*' && tt[1] == ']' && expand_no_split_dollar_star && ifs_is_null)
temp = array_value (name, 0x001|0x002, 0, &es);
else if (tt[0] == '*' && tt[1] == ']')
temp = array_value (name, quoted, 0, &es);
else
temp = array_value (name, quoted, 0, &es);
}
else if (tt[0] == '*' && tt[1] == ']' && expand_no_split_dollar_star && ifs_is_null)
temp = array_value (name, 0x001|0x002, 0, &es);
else
temp = array_value (name, quoted, 0, &es);
if (es.subtype == 0 && temp)
{
temp = (*temp && (quoted & (0x001|0x002)))
? quote_string (temp)
: quote_escapes (temp);
rflags |= (1 << 24);
if (estatep)
*estatep = es;
}
else if (es.subtype == 1 && temp && ((temp)[0] == '\177' && (temp)[1] == '\0') && (quoted & (0x001|0x002)))
rflags |= (1 << 18);
else if (es.subtype == 2 && temp && ((temp)[0] == '\177' && (temp)[1] == '\0') && (quoted & (0x001|0x002)))
rflags |= (1 << 18);
if (estatep == 0)
flush_eltstate (&es);
}
else if (var = find_variable (name))
{
if (((var)->value != 0) && ((((var)->attributes) & (0x0001000))) == 0)
{
tt = (char *)
((void *)0)
;
if ((pflags & 0x40) && ((((var)->attributes) & (0x0000040))))
tt = temp = (((HASH_TABLE *)((var)->value))->nentries == 0) ? (char *)
((void *)0)
: assoc_to_string ((HASH_TABLE *)((var)->value), " ", quoted);
else if ((pflags & 0x40) && ((((var)->attributes) & (0x0000004))))
tt = temp = (((ARRAY *)((var)->value))->num_elements == 0) ? (char *)
((void *)0)
: array_to_string ((ARRAY *)((var)->value), " ", quoted);
else if (((((var)->attributes) & (0x0000040))))
temp = assoc_reference ((HASH_TABLE *)((var)->value), "0");
else if (((((var)->attributes) & (0x0000004))))
temp = array_reference ((ARRAY *)((var)->value), 0);
else
temp = ((var)->value);
if (temp)
temp = (*temp && (quoted & (0x001|0x002)))
? quote_string (temp)
: ((pflags & 0x08) ? quote_rhs (temp)
: quote_escapes (temp));
do { if (tt) sh_xfree((tt), "subst.c", 7526); } while (0);
}
else
temp = (char *)
((void *)0)
;
}
else if (var = find_variable_last_nameref (name, 0))
{
temp = ((var)->value);
if (temp && *temp && valid_array_reference (temp, 0))
{
name = temp;
goto expand_arrayref;
}
else
if (temp && *temp && legal_identifier (temp) == 0)
{
set_exit_status (1);
report_error (gettext("%s: invalid variable name for name reference"), temp);
temp = &expand_param_error;
}
else
temp = (char *)
((void *)0)
;
}
else
temp = (char *)
((void *)0)
;
if (ret == 0)
{
ret = alloc_word_desc ();
ret->word = temp;
ret->flags |= rflags;
}
return ret;
}
|
int parameter_brace_expand_word(char *a0, unsigned long a1, unsigned long a2, unsigned long long a3, unsigned long long a4[4]) {
char v0[2];
unsigned int v1;
unsigned int v2;
void* v3;
char v4;
void* v5;
char v6[2];
struct_1 *v7;
unsigned long v8;
unsigned long long v9;
unsigned long v10;
unsigned long v11;
unsigned long long v14;
unsigned long long v15;
unsigned long long v16;
void* v17;
void* v19;
unsigned long long v21;
unsigned long long v22;
unsigned long long v23;
unsigned long long v24;
*(&v0) = a0;
v5 = 0;
v6 = 0;
v2 = 0;
if (a4) {
v8 = a4[0];
v9 = a4[1];
v10 = a4[2];
v11 = a4[3];
} else {
init_eltstate(&v8);
v9 = 0x8000000000000000;
}
if (legal_number(v0, &v4, &v4)) {
v3 = get_dollar_var_value(*(&v4));
if (v3) {
if (*(v3) && (a2 & 3))
v15 = quote_string(v3);
if (!*(v3) || !(a2 & 3))
v15 = quote_escapes(v3);
v6 = v15;
} else {
v6 = 0;
}
if (v3)
sh_xfree(v3, "subst.c", 0x1cf8);
} else if (a1) {
v3 = sh_xmalloc(strlen(v0) + 2, "subst.c", 0x1cfd);
v1 = 0;
*(v3) = 36;
strcpy(v3 + 1, v0);
v5 = param_expand(v3, &v1, a2, 0x0, 0x0, 0x0, 0x0, a3);
if ((a2 & 3) && (v0[0] == 64 || v0[0] == 42) && !v0[1] && v5 && *(v5) && *(*(v5)) == 127 && !*((*(v5) + 1)))
*(&v5[8]) = v5[8] | 0x40000;
sh_xfree(v3, "subst.c", 0x1d0a);
} else {
v14 = valid_array_reference(v0, 0x0);
if (!v14) {
v7 = find_variable(v0);
if (v7) {
if (v7->field_8 && !(v7->field_28 & 0x1000)) {
v3 = 0;
if ((a3 & 64) && (v7->field_28 & 64)) {
if (v7->field_8[12])
v17 = assoc_to_string(v7->field_8, " ", a2);
else
v17 = 0;
v6 = v17;
v3 = v6;
}
if (!(a3 & 64) || !(v7->field_28 & 64)) {
if ((a3 & 64) && (v7->field_28 & 4)) {
if (v7->field_8[8])
v19 = array_to_string(v7->field_8, " ", a2);
else
v19 = 0;
v6 = v19;
*(&v3) = v6;
}
if (!(a3 & 64) || !(v7->field_28 & 4)) {
if ((v7->field_28 & 64)) {
*(&v6) = assoc_reference(v7->field_8, "0", &v4);
} else if ((v7->field_28 & 4)) {
*(&v6) = array_reference(v7->field_8, 0x0, &v4);
} else {
v6 = v7->field_8;
}
}
}
if (v6) {
if (*(v6) && (a2 & 3))
v23 = quote_string(v6);
if (!(a2 & 3) || !*(v6)) {
if ((a3 & 8))
v23 = quote_rhs(v6);
else
v23 = quote_escapes(v6);
}
v6 = v23;
}
if (v3)
sh_xfree(v3, "subst.c", 0x1d66);
}
if (!v7->field_8 || (v7->field_28 & 0x1000))
v6 = 0;
} else {
v7 = find_variable_last_nameref(v0, 0x0);
if (v7) {
*(&v6) = v7->field_8;
if (v6 && *(v6)) {
v16 = valid_array_reference(v6, 0x0);
if (v16)
*(&v0) = v6;
}
if (!*(v6) || !v16 || !v6) {
if (v6 && *(v6)) {
v21 = legal_identifier(v6);
if (!v21) {
set_exit_status(0x1);
v22 = gettext("%s: invalid variable name for name reference");
report_error(v22, v6, v22, a3);
v6 = &expand_param_error;
}
}
if (!*(v6) || !v6 || v21)
v6 = 0;
}
} else {
v6 = 0;
}
}
}
if (v14 || !v7 && *(v6) && v16 && v7 && v6) {
v7 = array_variable_part(v0, 0x0, &v3, 0x0);
if ((a3 & 8)) {
if ((v3[0] == 42 || v3[0] == 64) && v3[1] == 93) {
if (v7 && ((v7->field_28 & 64) || (v7->field_28 & 4)))
*(&v6) = array_value(v0, a2 | 1, 0x10, &v8);
if (!v7 || !(v7->field_28 & 64) && !(v7->field_28 & 4))
*(&v6) = array_value(v0, a2, 0x0, &v8);
}
if (v3[1] != 93 || v3[0] != 42 && v3[0] != 64)
*(&v6) = array_value(v0, a2, 0x0, &v8);
} else if ((a3 & 4)) {
if (false)
*(&v6) = array_value(v0, 0x1, 0x10, &v8);
if (v3[0] == 64 && v3[1] == 93)
*(&v6) = array_value(v0, a2, 0x0, &v8);
if (v3[1] != 93 || v3[0] != 64) {
if (v3[0] == 42 && v3[1] == 93 && *(&expand_no_split_dollar_star))
*(&v6) = array_value(v0, 0x3, 0x0, &v8);
if (!*(&expand_no_split_dollar_star) || v3[0] != 42 || v3[1] != 93) {
if (v3[0] == 42 && v3[1] == 93)
*(&v6) = array_value(v0, a2, 0x0, &v8);
if (v3[1] != 93 || v3[0] != 42)
*(&v6) = array_value(v0, a2, 0x0, &v8);
}
}
} else {
if (v3[0] == 42 && v3[1] == 93 && *(&expand_no_split_dollar_star))
*(&v6) = array_value(v0, 0x3, 0x0, &v8);
if (!*(&expand_no_split_dollar_star) || v3[0] != 42 || v3[1] != 93)
*(&v6) = array_value(v0, a2, 0x0, &v8);
}
if (!*((&v8 + 2)) && v6) {
if (*(v6) && (a2 & 3))
v24 = quote_string(v6);
if (!(a2 & 3) || !*(v6))
v24 = quote_escapes(v6);
v6 = v24;
v2 |= 0x1000000;
if (a4) {
a4[0] = v8;
a4[1] = v9;
a4[2] = v10;
a4[3] = v11;
}
}
if (!v6 || *((&v8 + 2))) {
if (*((&v8 + 2)) == 1 && v6 && v6[0] == 127 && !v6[1] && (a2 & 3))
v2 |= 0x40000;
if ((!(a2 & 3) || !v6 || *((&v8 + 2)) != 1 || v6[1] || v6[0] != 127) && *((&v8 + 2)) == 2 && v6 && v6[0] == 127 && !v6[1] && (a2 & 3))
v2 |= 0x40000;
}
if (!a4)
flush_eltstate(&v8);
}
}
if (!v5) {
v5 = alloc_word_desc();
*(v5) = v6;
*(&v5[8]) = v5[8] | v2;
}
return v5;
}
|
int
sshbuf_poke(struct sshbuf *buf, size_t offset, void *v, size_t len)
{
u_char *p =
((void *)0)
;
int r;
if ((r = check_woffset(buf, offset, len, &p)) != 0)
return r;
memcpy(p, v, len);
return 0;
}
|
long sshbuf_poke(long a1, unsigned long a2, const void *a3, size_t a4)
{
unsigned int v7;
void *dest[2];
dest[1] = (void *)__readfsqword(0x28u);
dest[0] = 0LL;
v7 = check_woffset(a1, a2, a4, dest);
if ( v7 )
return v7;
memcpy(dest[0], a3, a4);
return 0LL;
}
|
inline int ext2fs_dirent_name_len(const struct ext2_dir_entry *entry)
{
return entry->name_len & 0xff;
}
|
void ext2fs_dirent_name_len(void)
{
halt_baddata();
}
|
static inline void
emit_mandatory_arg_note (void)
{
fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"),
stdout
)
;
}
|
void emit_mandatory_arg_note() {
unsigned long long v1;
v1 = fputs_unlocked(gettext("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout);
return;
}
|
static inline
_Bool
should_dereference (const struct cp_options *x,
_Bool
command_line_arg)
{
return x->dereference == DEREF_ALWAYS
|| (x->dereference == DEREF_COMMAND_LINE_ARGUMENTS
&& command_line_arg);
}
|
int should_dereference(struct_0 *a0, unsigned long a1) {
unsigned int v1;
unsigned int v2;
if (a0->field_4 != 4 && (!a1 || a0->field_4 != 3))
v1 = 0;
if (a0->field_4 == 4 || a0->field_4 == 3 && a1)
v1 = 1;
v2 = v1 & 1;
return v2;
}
|
void
remove_trailing_whitespace (string)
char *string;
{
register int i;
i = strlen (string) - 1;
while (i > 0 && (((string[i]) == ' ') || ((string[i]) == '\t')))
i--;
string[++i] = '\0';
}
|
const char * remove_trailing_whitespace(const char *a1)
{
int i;
const char *result;
for ( i = strlen(a1) - 1; i > 0 && (a1[i] == 32 || a1[i] == 9); --i )
;
result = &a1[i + 1];
*result = 0;
return result;
}
|
char *
normalize_filename (int cdidx, const char *name)
{
char *copy =
((void *)0)
;
if (
(! (((
name
)[0]) == '/'))
)
{
const char *cdpath = tar_getcdpath (cdidx);
size_t copylen;
_Bool
need_separator;
copylen = strlen (cdpath);
need_separator = ! (
0
&& copylen == 2 &&
((
cdpath[1]
) == '/')
);
copy = xmalloc (copylen + need_separator + strlen (name) + 1);
strcpy (copy, cdpath);
copy[copylen] = '/';
strcpy (copy + copylen + need_separator, name);
}
if (!copy)
copy = xstrdup (name);
normalize_filename_x (copy);
return copy;
}
|
char * normalize_filename(undefined4 param_1,char *param_2)
{
char *__s;
size_t sVar1;
size_t sVar2;
char *local_30;
local_30 = (char *)0x0;
if (*param_2 != '/') {
__s = (char *)tar_getcdpath(param_1);
sVar1 = strlen(__s);
sVar2 = strlen(param_2);
local_30 = (char *)xmalloc(sVar2 + sVar1 + 2);
strcpy(local_30,__s);
local_30[sVar1] = '/';
strcpy(local_30 + sVar1 + 1,param_2);
}
if (local_30 == (char *)0x0) {
local_30 = (char *)xstrdup(param_2);
}
normalize_filename_x(local_30);
return local_30;
}
|
static void
parse_line (char const *line, char **keyword, char **arg)
{
char const *p;
char const *keyword_start;
char const *arg_start;
*keyword =
((void *)0)
;
*arg =
((void *)0)
;
for (p = line;
((*__ctype_b_loc ())[(int) ((
to_uchar (*p)
))] & (unsigned short int) _ISspace)
; ++p)
continue;
if (*p == '\0' || *p == '#')
return;
keyword_start = p;
while (!
((*__ctype_b_loc ())[(int) ((
to_uchar (*p)
))] & (unsigned short int) _ISspace)
&& *p != '\0')
{
++p;
}
*keyword = ximemdup0 (keyword_start, p - keyword_start);
if (*p == '\0')
return;
do
{
++p;
}
while (
((*__ctype_b_loc ())[(int) ((
to_uchar (*p)
))] & (unsigned short int) _ISspace)
);
if (*p == '\0' || *p == '#')
return;
arg_start = p;
while (*p != '\0' && *p != '#')
++p;
for (--p;
((*__ctype_b_loc ())[(int) ((
to_uchar (*p)
))] & (unsigned short int) _ISspace)
; --p)
continue;
++p;
*arg = ximemdup0 (arg_start, p - arg_start);
}
|
void parse_line(unsigned long long a0, unsigned long long *a1, unsigned long long *a2) {
char *v0;
char *v1;
char *v2;
unsigned short v5;
unsigned int v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v10;
unsigned long long v12;
unsigned long long v13;
unsigned long long *v15;
*(a1) = 0;
*(a2) = 0;
v0 = a0;
while (true) {
v5 = *((to_uchar(*(v0)) * 2 + *(__ctype_b_loc())));
v6 = v5 & 0x2000;
if (!v6)
break;
v0 += 1;
}
v7 = *(v0);
if (*(v0)) {
v8 = *(v0);
if (*(v0) != 35) {
v1 = v0;
while (true) {
*(&v8) = *((to_uchar(*(v0)) * 2 + *(__ctype_b_loc())));
*(&v8) = v8 & 0x2000;
if (v8)
break;
if (!*(v0))
break;
v0 += 1;
}
*(a1) = ximemdup0(v1, v0 - v1, v0 - v1);
v10 = *(v0);
if (*(v0)) {
do {
v0 += 1;
*(&v10) = *((to_uchar(*(v0)) * 2 + *(__ctype_b_loc())));
*(&v10) = v10 & 0x2000;
} while (v10);
v12 = *(v0);
if (*(v0)) {
v13 = *(v0);
if (*(v0) != 35) {
v2 = v0;
while (true) {
if (!*(v0))
break;
if (*(v0) == 35)
break;
v0 += 1;
}
v0 += 1;
while (true) {
*(&v13) = *((to_uchar(*(v0)) * 2 + *(__ctype_b_loc())));
*(&v13) = v13 & 0x2000;
if (!v13)
break;
v0 += 1;
}
v0 += 1;
v15 = a2;
*(a2) = ximemdup0(v2, v0 + -0x1 * v2, v0 + -0x1 * v2);
}
}
}
}
}
return;
}
|
void get_oid_crq_set(gnutls_x509_crq_t crq)
{
int ret, i;
if (batch) {
if (!cfg.dn_oid)
return;
for (i = 0; cfg.dn_oid[i] !=
((void *)0)
; i += 2) {
if (cfg.dn_oid[i + 1] ==
((void *)0)
) {
fprintf(
stderr
,
"dn_oid: %s does not have an argument.\n",
cfg.dn_oid[i]);
exit(1);
}
ret =
gnutls_x509_crq_set_dn_by_oid(crq,
cfg.dn_oid[i], 0,
cfg.dn_oid[i +
1],
strlen(cfg.
dn_oid[i +
1]));
if (ret < 0) {
fprintf(
stderr
, "set_dn_oid: %s\n",
gnutls_strerror(ret));
exit(1);
}
}
}
}
|
long get_oid_crq_set(long a1)
{
long result;
unsigned int v2;
const char *v3;
int i;
int v5;
result = batch;
if ( batch )
{
result = *(_QWORD *)&cfg[96];
if ( result )
{
for ( i = 0; ; i += 2 )
{
result = *(_QWORD *)(8LL * i + *(_QWORD *)&cfg[96]);
if ( !result )
break;
if ( !*(_QWORD *)(8 * (i + 1LL) + *(_QWORD *)&cfg[96]) )
{
fprintf(stderr, "dn_oid: %s does not have an argument.\n", *(const char **)(8LL * i + *(_QWORD *)&cfg[96]));
exit(1);
}
v2 = strlen(*(const char **)(8 * (i + 1LL) + *(_QWORD *)&cfg[96]));
v5 = gnutls_x509_crq_set_dn_by_oid(
a1,
*(_QWORD *)(8LL * i + *(_QWORD *)&cfg[96]),
0LL,
*(_QWORD *)(8 * (i + 1LL) + *(_QWORD *)&cfg[96]),
v2);
if ( v5 < 0 )
{
v3 = (const char *)gnutls_strerror((unsigned int)v5);
fprintf(stderr, "set_dn_oid: %s\n", v3);
exit(1);
}
}
}
}
return result;
}
|
void
ignore_glob_matches (names)
char **names;
{
if (globignore.num_ignores == 0)
return;
ignore_globbed_names (names, glob_name_is_acceptable);
}
|
void ignore_glob_matches(unsigned long long a0) {
unsigned long long v1;
unsigned long long v2;
v1 = g_4017b0;
if (g_4017b0) {
v2 = ignore_globbed_names(a0, glob_name_is_acceptable);
return;
}
return;
}
|
&& !okname(suser)) {
++errs;
continue;
}
|
int okname(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
char *v1;
unsigned long v3;
v1 = a0;
while (true) {
v0 = *(v1);
if ((v0 & 128))
break;
v3 = __ctype_b_loc(a0, a1, a2, v0 - 34, a4, a5);
a2 = v0 * 2;
*(&v3) = *((*(v3) + v0 * 2));
*(&v3) = v3 & 0x400;
if (!((a2 = v0 * 2, *(&v3) = *((*(__ctype_b_loc(a0, a1, v0 * 2, (v0 - 34), a4, a5)) + v0 * 2)), *(&v3) = (v3 & 0x800), v3)) && !(!(v0 == 32) && (!(v0 >= 32) || !(v0 <= 96) || !(v0 >= 34) || !((a2 = 1 << ((v0 - 34) & 63), (4611686018427387939 & 1 << ((v0 - 34) & 63)))))))
break;
v1 += 1;
if (!*(v1)) {
*(&v3) = 1;
return v3;
}
}
fmprintf(stderr, "%s: invalid user name\n", a0);
*(&v3) = 0;
return v3;
}
|
struct timeval *
multimeval (d, m)
struct timeval *d;
int m;
{
time_t t;
t = d->tv_usec * m;
d->tv_sec = d->tv_sec * m + t / 1000000;
d->tv_usec = t % 1000000;
return d;
}
|
long * multimeval(long *param_1,int param_2)
{
*param_1 = *param_1 * (long)param_2 + ((long)param_2 * param_1[1]) / 1000000;
param_1[1] = ((long)param_2 * param_1[1]) % 1000000;
return param_1;
}
|
int
strvis(char *mbdst, const char *mbsrc, int flags)
{
return istrsenvisxl(&mbdst,
((void *)0)
, mbsrc, flags, "",
((void *)0)
);
}
|
long strvis(char *a1, const char *a2, int a3)
{
char *v4;
v4 = a1;
return istrsenvisxl(&v4, 0LL, a2, a3, (char *)&unk_18E8, 0LL);
}
|
static void
path_coder (struct tar_stat_info const *st, char const *keyword,
struct xheader *xhdr, void const *data __attribute__ ((unused)))
{
code_string (st->file_name, keyword, xhdr);
}
|
unsigned long path_coder(long a1, char *a2, long a3)
{
return code_string(*(_QWORD *)(a1 + 8), a2, a3);
}
|
BZFILE* BZ2_bzWriteOpen
( int* bzerror,
FILE* f,
int blockSize100k,
int verbosity,
int workFactor )
{
Int32 ret;
bzFile* bzf =
((void *)0)
;
{ if (bzerror !=
((void *)0)
) *bzerror = 0; if (bzf !=
((void *)0)
) bzf->lastErr = 0; };
if (f ==
((void *)0)
||
(blockSize100k < 1 || blockSize100k > 9) ||
(workFactor < 0 || workFactor > 250) ||
(verbosity < 0 || verbosity > 4))
{ { if (bzerror !=
((void *)0)
) *bzerror = (-2); if (bzf !=
((void *)0)
) bzf->lastErr = (-2); }; return
((void *)0)
; };
if (ferror(f))
{ { if (bzerror !=
((void *)0)
) *bzerror = (-6); if (bzf !=
((void *)0)
) bzf->lastErr = (-6); }; return
((void *)0)
; };
bzf = malloc ( sizeof(bzFile) );
if (bzf ==
((void *)0)
)
{ { if (bzerror !=
((void *)0)
) *bzerror = (-3); if (bzf !=
((void *)0)
) bzf->lastErr = (-3); }; return
((void *)0)
; };
{ if (bzerror !=
((void *)0)
) *bzerror = 0; if (bzf !=
((void *)0)
) bzf->lastErr = 0; };
bzf->initialisedOk = ((Bool)0);
bzf->bufN = 0;
bzf->handle = f;
bzf->writing = ((Bool)1);
bzf->strm.bzalloc =
((void *)0)
;
bzf->strm.bzfree =
((void *)0)
;
bzf->strm.opaque =
((void *)0)
;
if (workFactor == 0) workFactor = 30;
ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k,
verbosity, workFactor );
if (ret != 0)
{ { if (bzerror !=
((void *)0)
) *bzerror = ret; if (bzf !=
((void *)0)
) bzf->lastErr = ret; }; free(bzf); return
((void *)0)
; };
bzf->strm.avail_in = 0;
bzf->initialisedOk = ((Bool)1);
return bzf;
}
|
int BZ2_bzWriteOpen(unsigned int *a0, void* a1, unsigned long a2, unsigned long a3, unsigned long a4) {
unsigned int v0;
unsigned int v1;
void* v2;
unsigned int v4;
v0 = a4;
v2 = 0;
if (a0)
*(a0) = 0;
if (v2)
*(&v2[5096]) = 0;
if (a1 && a2 > 0 && a2 <= 9 && v0 >= 0 && v0 <= 250 && a3 >= 0 && a3 <= 4) {
if (ferror(a1)) {
if (a0)
*(a0) = -6;
if (v2)
*(&v2[5096]) = -6;
v4 = 0;
return v4;
} else {
v2 = malloc(0x13f0);
if (v2) {
if (a0)
*(a0) = 0;
if (v2)
*(&v2[5096]) = 0;
v2->field_13ec = 0;
v2->field_1390 = 0;
v2->field_0 = a1;
v2->field_1394 = 1;
v2->field_13d0 = 0;
v2->field_13d8 = 0;
v2->field_13e0 = 0;
if (!v0)
v0 = 30;
v1 = BZ2_bzCompressInit(&v2->padding_1395[3], a2, a3, v0);
if (!v1) {
v2->field_13a0 = 0;
v2->field_13ec = 1;
v4 = v2;
return v4;
}
if (a0)
*(a0) = v1;
if (v2)
*(&v2[5096]) = v1;
free(v2);
v4 = 0;
return v4;
} else {
if (a0)
*(a0) = -3;
if (v2)
*(&v2[5096]) = -3;
v4 = 0;
return v4;
}
}
}
if (a0)
*(a0) = -2;
if (v2)
*(&v2[5096]) = -2;
v4 = 0;
return v4;
}
|
static int clone_file_block(ext2_filsys fs,
blk64_t *block_nr,
e2_blkcnt_t blockcnt,
blk64_t ref_block __attribute__((unused)),
int ref_offset __attribute__((unused)),
void *priv_data)
{
struct dup_cluster *p =
((void *)0)
;
blk64_t new_block;
errcode_t retval;
struct clone_struct *cs = (struct clone_struct *) priv_data;
dnode_t *n;
e2fsck_t ctx;
blk64_t c;
int is_meta = 0;
int should_write = 1;
ctx = cs->ctx;
deferred_dec_badcount(cs);
if (*block_nr == 0)
return 0;
if (ext2fs_has_feature_shared_blocks(ctx->fs->super) &&
(ctx->options & 0x40000) &&
(ctx->options & 0x0008))
should_write = 0;
c = ((blockcnt) >> (fs)->cluster_ratio_bits);
if (check_if_fs_cluster(ctx, ((*block_nr) >> (fs)->cluster_ratio_bits)))
is_meta = 1;
if (c == cs->dup_cluster && cs->alloc_block) {
new_block = cs->alloc_block;
goto got_block;
}
if (ext2fs_test_block_bitmap2(ctx->block_dup_map, *block_nr)) {
n = dict_lookup(&clstr_dict,
((void *)(intptr_t)(((*block_nr) >> (fs)->cluster_ratio_bits))));
if (!n) {
com_err("clone_file_block", 0,
(gettext ("internal error: can't find dup_blk for %llu\n")),
(unsigned long long) *block_nr);
return 0;
}
p = (struct dup_cluster *) ((n)->dict_data);
cs->dup_cluster = c;
new_block = 0;
retval = ext2fs_map_cluster_block(fs, cs->ino,
EXT2_INODE(cs->inode),
blockcnt, &new_block);
if (retval == 0 && new_block != 0 &&
((new_block) >> (ctx->fs)->cluster_ratio_bits) !=
((*block_nr) >> (ctx->fs)->cluster_ratio_bits))
goto cluster_alloc_ok;
retval = ext2fs_new_block2(fs, 0, ctx->block_found_map,
&new_block);
if (retval) {
cs->errcode = retval;
return 2;
}
if (ext2fs_has_feature_shared_blocks(fs->super)) {
ext2fs_block_alloc_stats2(fs, new_block, +1);
}
cluster_alloc_ok:
cs->alloc_block = new_block;
got_block:
new_block &= ~((1 << (fs)->cluster_ratio_bits) - 1);
new_block += ((1 << (fs)->cluster_ratio_bits) - 1) & blockcnt;
if (cs->dir && (blockcnt >= 0)) {
retval = ext2fs_set_dir_block2(fs->dblist,
cs->dir, new_block, blockcnt);
if (retval) {
cs->errcode = retval;
return 2;
}
}
retval = io_channel_read_blk64(fs->io, *block_nr, 1, cs->buf);
if (retval) {
cs->errcode = retval;
return 2;
}
if (should_write) {
retval = io_channel_write_blk64(fs->io, new_block, 1, cs->buf);
if (retval) {
cs->errcode = retval;
return 2;
}
}
cs->save_dup_cluster = (is_meta ?
((void *)0)
: p);
cs->save_blocknr = *block_nr;
*block_nr = new_block;
ext2fs_mark_block_bitmap2(ctx->block_found_map, new_block);
ext2fs_mark_block_bitmap2(fs->block_map, new_block);
if (!should_write) {
return 0;
}
return 1;
}
return 0;
}
|
int clone_file_block(struct_0 *a0, unsigned long long *a1, unsigned long long a2, unsigned long long a3, unsigned long a4, struct_1 *a5) {
unsigned int v0;
unsigned long v1;
unsigned long long v2;
unsigned int v3;
unsigned int v4;
void* v5;
void* v6;
struct_2 *v7;
unsigned long v8;
struct_4 *v9;
unsigned long v10;
unsigned long v12;
unsigned long long v14;
unsigned long v15;
unsigned long long v16;
v2 = a2;
v1 = a3;
v0 = a4;
v6 = 0;
v3 = 0;
v4 = 1;
v7 = a5->field_28;
deferred_dec_badcount(a5);
if (!*(a1)) {
v12 = 0;
} else {
if (ext2fs_has_feature_shared_blocks(v7->field_0->field_20) && (v7->field_4c & 0x40000) && (v7->field_4c & 8))
v4 = 0;
if ((a0->field_c0 & 63))
v14 = v2 >> (a0->field_c0 & 63);
else
v14 = v2 >> (a0->field_c0 & 63);
v8 = v14;
if ((a0->field_c0 & 63))
v15 = *(a1) >> (a0->field_c0 & 63);
else
v15 = *(a1) >> (a0->field_c0 & 63);
v12 = check_if_fs_cluster(v7, v15);
if (v12)
v3 = 1;
if (v8 == a5->field_8 && a5->field_10)
v5 = a5->field_10;
if (!a5->field_10 || v8 != a5->field_8) {
v12 = ext2fs_test_block_bitmap2(v7->field_1a8, *(a1), *(a1), a3);
if (v12) {
if ((a0->field_c0 & 63))
v16 = *(a1) >> (a0->field_c0 & 63);
else
v16 = *(a1) >> (a0->field_c0 & 63);
v9 = dict_lookup(&clstr_dict, v16);
if (!v9) {
com_err("clone_file_block", 0x0, gettext("internal error: can't find dup_blk for %llu\n"), *(a1));
*(&v12) = 0;
} else {
v6 = v9->field_28;
a5->field_8 = v8;
v5 = 0;
v10 = ext2fs_map_cluster_block(a0, a5->field_1c, EXT2_INODE(a5->field_30), v2, &v5);
}
} else {
*(&v12) = 0;
}
}
if (!v10 && v12 && v9 && v5 && (!a5->field_10 || v8 != a5->field_8) && v5 >> (v7->field_0->field_c0 & 63) == *(a1) >> (v7->field_0->field_c0 & 63) || !v10 && v12 && v9 && (!a5->field_10 || v8 != a5->field_8) && !v5 || v12 && v9 && (!a5->field_10 || v8 != a5->field_8) && v10) {
v10 = ext2fs_new_block2(a0, 0x0, v7->field_1a0, &v5);
if (v10) {
a5->field_0 = v10;
*(&v12) = 2;
} else {
v12 = ext2fs_has_feature_shared_blocks(a0->field_20);
if (v12)
ext2fs_block_alloc_stats2(a0, v5, 0x1, v5);
}
}
if ((!v10 && v12 && v9 && v5 && (!a5->field_10 || v8 != a5->field_8) && v5 >> (v7->field_0->field_c0 & 63) == *(a1) >> (v7->field_0->field_c0 & 63) || !v10 && v12 && v9 && (!a5->field_10 || v8 != a5->field_8) && !v5 || v12 && v9 && (!a5->field_10 || v8 != a5->field_8) && v10) && !v10 || !v10 && v12 && v9 && v5 && (!a5->field_10 || v8 != a5->field_8) && v5 >> (v7->field_0->field_c0 & 63) != *(a1) >> (v7->field_0->field_c0 & 63))
a5->field_10 = v5;
if (v8 == a5->field_8 && a5->field_10 || (!v10 && v12 && v9 && v5 && (!a5->field_10 || v8 != a5->field_8) && v5 >> (v7->field_0->field_c0 & 63) == *(a1) >> (v7->field_0->field_c0 & 63) || !v10 && v12 && v9 && (!a5->field_10 || v8 != a5->field_8) && !v5 || v12 && v9 && (!a5->field_10 || v8 != a5->field_8) && v10) && !v10 || !v10 && v12 && v9 && v5 && (!a5->field_10 || v8 != a5->field_8) && v5 >> (v7->field_0->field_c0 & 63) != *(a1) >> (v7->field_0->field_c0 & 63)) {
v5 &= -((1 << (a0->field_c0 & 31)));
v5 += (1 << (a0->field_c0 & 31)) - 1 & v2;
if (a5->field_18 && !((v2 - 0 >> 63))) {
v10 = ext2fs_set_dir_block2(a0->field_90, a5->field_18, v5, v2);
if (v10) {
a5->field_0 = v10;
*(&v12) = 2;
}
}
if (!v10 || !a5->field_18 || (v2 - 0 >> 63)) {
v10 = io_channel_read_blk64(a0->field_8, *(a1), 0x1, a5->field_20);
if (v10) {
a5->field_0 = v10;
*(&v12) = 2;
} else {
if (v4) {
v10 = io_channel_write_blk64(a0->field_8, v5, 0x1, a5->field_20);
if (v10) {
a5->field_0 = v10;
*(&v12) = 2;
}
}
if (!v10 || !v4) {
if (!v3)
v12 = v6;
else
v12 = 0;
a5->field_38 = v12;
a5->field_40 = *(a1);
*(a1) = v5;
ext2fs_mark_block_bitmap2(v7->field_1a0, v5, v5);
ext2fs_mark_block_bitmap2(a0->field_58, v5, v5);
if (!v4)
*(&v12) = 0;
else
*(&v12) = 1;
}
}
}
}
}
return v12;
}
|
static
_Bool
parse_samefile (const struct parser_table* entry, char **argv, int *arg_ptr)
{
struct predicate *our_pred;
struct stat st, fst;
int fd, openflags;
const char *filename;
set_stat_placeholders (&st);
if (!collect_arg_stat_info (argv, arg_ptr, &st, &filename))
return
0
;
set_stat_placeholders (&fst);
fd = -3;
openflags =
00
;
if (options.symlink_handling == SYMLINK_NEVER_DEREF)
{
if (options.open_nofollow_available)
{
((void) sizeof ((0400000
!= 0
) ? 1 : 0), __extension__ ({ if (0400000
!= 0
) ; else __assert_fail (
"O_NOFOLLOW != 0"
, "parser.c", 2209, __extension__ __PRETTY_FUNCTION__); }))
;
openflags |=
0400000
;
fd = -1;
}
else
{
if (
((((
st.st_mode
)) & 0170000) == (0120000))
)
{
fd = -2;
}
else
{
fd = -1;
}
}
}
else
{
fd = -1;
}
((void) sizeof ((
fd != -3
) ? 1 : 0), __extension__ ({ if (
fd != -3
) ; else __assert_fail (
"fd != -3"
, "parser.c", 2239, __extension__ __PRETTY_FUNCTION__); }))
;
if (fd == -1)
{
fd = open_cloexec (filename, openflags);
if (fd >= 0)
{
if (0 != fstat (fd, &fst))
{
fatal_target_file_error (
(*__errno_location ())
, filename);
}
else
{
if ((*options.xstat) (filename, &st))
fatal_target_file_error (
(*__errno_location ())
, filename);
if ((options.symlink_handling == SYMLINK_NEVER_DEREF)
&& (!options.open_nofollow_available))
{
if (
((((
st.st_mode
)) & 0170000) == (0120000))
)
{
close (fd);
fd = -1;
}
else
{
if ((st.st_dev == fst.st_dev)
&& (st.st_ino == fst.st_ino))
{
}
else
{
close (fd);
fd = -1;
}
}
}
else
{
st = fst;
}
}
}
}
our_pred = insert_primary (entry, filename);
our_pred->args.samefileid.ino = st.st_ino;
our_pred->args.samefileid.dev = st.st_dev;
our_pred->args.samefileid.fd = fd;
our_pred->need_type =
0
;
our_pred->need_stat =
1
;
our_pred->est_success_rate = 0.01f;
return
1
;
}
|
long parse_samefile(long a1, long a2, int *a3)
{
long v4;
int *v5;
long v6;
int *v7;
int fd;
unsigned int v10;
long v11;
long inserted;
struct stat v13;
struct stat v14;
unsigned long v15;
v15 = __readfsqword(0x28u);
set_stat_placeholders(&v13);
if ( (unsigned char)collect_arg_stat_info(a2, a3, (long)&v13, &v11) != 1 )
return 0LL;
set_stat_placeholders(&v14);
v10 = 0;
if ( LODWORD(options[9]) )
{
fd = -1;
}
else if ( LOBYTE(options[11]) )
{
v10 = 0x20000;
fd = -1;
}
else if ( (v13.st_mode & 0xF000) == 40960 )
{
fd = -2;
}
else
{
fd = -1;
}
if ( fd == -1 )
{
fd = open_cloexec(v11, v10);
if ( fd >= 0 )
{
if ( fstat(fd, &v14) )
{
v4 = v11;
v5 = _errno_location();
fatal_target_file_error((unsigned int)*v5, v4);
}
if ( options[10](v11) )
{
v6 = v11;
v7 = _errno_location();
fatal_target_file_error((unsigned int)*v7, v6);
}
if ( LODWORD(options[9]) || LOBYTE(options[11]) == 1 )
{
v13 = v14;
}
else if ( (v13.st_mode & 0xF000) == 40960 || v13.st_dev != v14.st_dev || v13.st_ino != v14.st_ino )
{
close(fd);
fd = -1;
}
}
}
inserted = insert_primary(a1, v11);
*(_QWORD *)(inserted + 56) = v13.st_ino;
*(_QWORD *)(inserted + 64) = v13.st_dev;
*(_DWORD *)(inserted + 72) = fd;
*(_BYTE *)(inserted + 27) = 0;
*(_BYTE *)(inserted + 26) = 1;
*(_DWORD *)(inserted + 36) = 1008981770;
return 1LL;
}
|
void
read_directory_file (void)
{
int fd;
char *buf =
((void *)0)
;
size_t bufsize = 0;
int flags =
02
|
0100
;
if (incremental_level == 0)
flags |=
01000
;
fd = open (listed_incremental_option, flags, (
0200
|
(0200 >> 3)
|
((0200 >> 3) >> 3)
| (
0400
|
(0400 >> 3)
|
((0400 >> 3) >> 3)
)));
if (fd < 0)
{
open_error (listed_incremental_option);
return;
}
listed_incremental_stream = fdopen (fd, "r+");
if (! listed_incremental_stream)
{
open_error (listed_incremental_option);
close (fd);
return;
}
name_from_list ();
blank_name_list ();
if (0 < getline (&buf, &bufsize, listed_incremental_stream))
{
char *ebuf;
uintmax_t incremental_version;
if (strncmp (buf, "GNU tar", sizeof "GNU tar" - 1) == 0)
{
ebuf = buf + sizeof "GNU tar" - 1;
if (*ebuf++ != '-')
do { if (error_hook) error_hook (); error (1, 0, gettext ("Bad incremental file format")); exit_status = 2; } while (0);
for (; *ebuf != '-'; ebuf++)
if (!*ebuf)
do { if (error_hook) error_hook (); error (1, 0, gettext ("Bad incremental file format")); exit_status = 2; } while (0);
incremental_version = strtoumax (ebuf + 1,
((void *)0)
, 10);
}
else
incremental_version = 0;
switch (incremental_version)
{
case 0:
case 1:
read_incr_db_01 (incremental_version, buf);
break;
case 2:
read_incr_db_2 ();
break;
default:
do { if (error_hook) error_hook (); error (1, 0, gettext ("Unsupported incremental format version: %"
"l" "u"
), incremental_version); exit_status = 2; } while (0)
;
}
}
if (ferror_unlocked (listed_incremental_stream))
read_error (listed_incremental_option);
free (buf);
}
|
long long read_directory_file(unsigned long long a0, unsigned long a1, unsigned int a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
int tmp_20;
unsigned int v1;
void* v2;
void* v3;
char *v4;
void* v5;
v2 = 0;
v3 = 0;
v0 = 66;
if (!incremental_level)
v0 |= 0x200;
v1 = open(listed_incremental_option, v0, 0x1b6);
if (v1 < 0) {
open_error(listed_incremental_option);
} else {
listed_incremental_stream = fdopen(v1, "r+");
if (!listed_incremental_stream) {
open_error(listed_incremental_option);
close(v1);
} else {
name_from_list();
blank_name_list(a0, "r+", a2, a3, a4, a5);
if (getline(&v2, &v3, listed_incremental_stream) > 0) {
if (strncmp(v2, "GNU tar", 0x7)) {
v5 = 0;
} else {
v4 = &v2[7];
tmp_20 = v4;
a2 = v4 + 1;
v4 += 1;
if (*(tmp_20) != 45) {
if (*(&error_hook))
*(5243072)();
error(0x1, 0x0, gettext("Bad incremental file format"));
} else {
while (*(v4) != 45) {
if (*(v4)) {
v4 += 1;
} else {
if (*(&error_hook))
*(5243072)();
error(0x1, 0x0, gettext("Bad incremental file format"));
}
}
a2 = 10;
v5 = strtoumax(v4 + 1, NULL, 0xa);
}
}
if (v5 <= 1) {
read_incr_db_01(v5, v2);
} else if (v5 == 2) {
read_incr_db_2(v1, a1, a2, a3, a4, a5);
} else {
if (*(&error_hook))
*(5243072)();
error(0x1, 0x0, gettext("Unsupported incremental format version: %lu"));
}
}
if (ferror_unlocked(listed_incremental_stream))
read_error(listed_incremental_option);
free(v2);
}
}
return 0;
}
|
void
channel_stop_listening(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)
) {
switch (c->type) {
case 6:
case 2:
case 11:
case 1:
case 18:
case 19:
channel_close_fd(ssh, c, &c->sock);
channel_free(ssh, c);
break;
}
}
}
}
|
long long channel_stop_listening(struct_0 *a0) {
unsigned int v0;
unsigned int *v1;
for (v0 = 0; v0 < a0->field_868->field_8; v0 += 1) {
v1 = *((a0->field_868->field_0 + v0 * 8));
if (v1 && 19 >= *(v1) && ((1 << (*(v1) & 63)) & 788550)) {
channel_close_fd(a0, v1, v1 + 10);
channel_free(a0, v1);
}
}
return a0->field_868->field_8;
}
|
int
acl_delete_def_file_at (int fd, char const *file )
{
;
if (fd ==
-100
||
(((
file
)[0]) == '/')
)
return (acl_delete_def_file (file ));
{
struct saved_cwd saved_cwd;
int saved_errno;
int err;
{
char proc_buf[
((4096) < (4096 - 64) ? (4096) : (4096 - 64))
];
char *proc_file = openat_proc_name (proc_buf, fd, file);
if (proc_file)
{
int proc_result = (acl_delete_def_file (proc_file ));
int proc_errno =
(*__errno_location ())
;
if (proc_file != proc_buf)
free (proc_file);
if (-1 != proc_result)
return proc_result;
if (!
((
proc_errno
) == 20 || (
proc_errno
) == 2 || (
proc_errno
) == 1 || (
proc_errno
) == 13 || (
proc_errno
) == 38 || (
proc_errno
) == 95 )
)
{
(*__errno_location ())
= proc_errno;
return proc_result;
}
}
}
if (save_cwd (&saved_cwd) != 0)
openat_save_fail (
(*__errno_location ())
);
if (0 <= fd && fd == saved_cwd.desc)
{
free_cwd (&saved_cwd);
(*__errno_location ())
=
9
;
return -1;
}
if (fchdir (fd) != 0)
{
saved_errno =
(*__errno_location ())
;
free_cwd (&saved_cwd);
(*__errno_location ())
= saved_errno;
return -1;
}
err = (acl_delete_def_file (file ));
saved_errno = (err == -1 ?
(*__errno_location ())
: 0);
if (restore_cwd (&saved_cwd) != 0)
openat_restore_fail (
(*__errno_location ())
);
free_cwd (&saved_cwd);
if (saved_errno)
(*__errno_location ())
= saved_errno;
return err;
}
}
|
ulong acl_delete_def_file_at(int param_1,char *param_2)
{
uint uVar1;
int iVar2;
int iVar3;
ulong uVar4;
undefined *__ptr;
int *piVar5;
long in_FS_OFFSET;
int local_fe8 [4];
undefined local_fd8 [4040];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
if ((param_1 == -100) || (*param_2 == '/')) {
uVar4 = acl_delete_def_file(param_2);
goto LAB_00100781;
}
__ptr = (undefined *)openat_proc_name(local_fd8,param_1,param_2);
if (__ptr != (undefined *)0x0) {
uVar1 = acl_delete_def_file(__ptr);
piVar5 = __errno_location();
iVar2 = *piVar5;
if (__ptr != local_fd8) {
free(__ptr);
}
if (uVar1 != 0xffffffff) {
uVar4 = (ulong)uVar1;
goto LAB_00100781;
}
if (((((iVar2 != 0x14) && (iVar2 != 2)) && (iVar2 != 1)) && ((iVar2 != 0xd && (iVar2 != 0x26))))
&& (iVar2 != 0x5f)) {
piVar5 = __errno_location();
*piVar5 = iVar2;
uVar4 = 0xffffffff;
goto LAB_00100781;
}
}
iVar2 = save_cwd();
if (iVar2 != 0) {
__errno_location();
openat_save_fail();
}
if ((param_1 < 0) || (param_1 != local_fe8[0])) {
iVar2 = fchdir(param_1);
if (iVar2 == 0) {
uVar1 = acl_delete_def_file(param_2);
if (uVar1 == 0xffffffff) {
piVar5 = __errno_location();
iVar2 = *piVar5;
}
else {
iVar2 = 0;
}
iVar3 = restore_cwd(local_fe8);
if (iVar3 != 0) {
piVar5 = __errno_location();
openat_restore_fail(*piVar5);
}
free_cwd(local_fe8);
if (iVar2 != 0) {
piVar5 = __errno_location();
*piVar5 = iVar2;
}
uVar4 = (ulong)uVar1;
}
else {
piVar5 = __errno_location();
iVar2 = *piVar5;
free_cwd(local_fe8);
piVar5 = __errno_location();
*piVar5 = iVar2;
uVar4 = 0xffffffff;
}
}
else {
free_cwd(local_fe8);
piVar5 = __errno_location();
*piVar5 = 9;
uVar4 = 0xffffffff;
}
LAB_00100781:
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar4;
}
|
int
read_config_file(const char *filename, struct passwd *pw, const char *host,
const char *original_host, Options *options, int flags,
int *want_final_pass)
{
int active = 1;
return read_config_file_depth(filename, pw, host, original_host,
options, flags, &active, want_final_pass, 0);
}
|
void read_config_file(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
undefined8 param_5,undefined4 param_6,undefined8 param_7)
{
long in_FS_OFFSET;
undefined4 local_14;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_14 = 1;
read_config_file_depth(param_1,param_2,param_3,param_4,param_5,param_6,&local_14,param_7,0);
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static
_Bool
parse_type (const struct parser_table* entry, char **argv, int *arg_ptr)
{
return insert_type (argv, arg_ptr, entry, pred_type);
}
|
long long parse_type(unsigned long long a0, unsigned long long a1, unsigned long long a2) {
return insert_type(a1, a2, a0, got.pred_type);
}
|
void
delete_all_variables (hashed_vars)
HASH_TABLE *hashed_vars;
{
hash_flush (hashed_vars, free_variable_hash_data);
}
|
void delete_all_variables(undefined8 param_1)
{
hash_flush(param_1,free_variable_hash_data);
return;
}
|
static int create_tunnel(struct l2tp_parm *p)
{
uint32_t local_attr = L2TP_ATTR_IP_SADDR;
uint32_t peer_attr = L2TP_ATTR_IP_DADDR;
struct { struct nlmsghdr n; struct genlmsghdr g; char buf[( ((0)+4U -1) & ~(4U -1) ) + (1024)]; } req = { .n = { .nlmsg_type = (genl_family), .nlmsg_flags = (0x01 | 0x04), .nlmsg_len = ((( ((sizeof(struct genlmsghdr))+4U -1) & ~(4U -1) ) + (0)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))), }, .g = { .cmd = (L2TP_CMD_TUNNEL_CREATE), .version = (0x1), }, }
;
addattr32(&req.n, 1024, L2TP_ATTR_CONN_ID, p->tunnel_id);
addattr32(&req.n, 1024, L2TP_ATTR_PEER_CONN_ID, p->peer_tunnel_id);
addattr8(&req.n, 1024, L2TP_ATTR_PROTO_VERSION, 3);
addattr16(&req.n, 1024, L2TP_ATTR_ENCAP_TYPE, p->encap);
if (p->local_ip.family ==
10
)
local_attr = L2TP_ATTR_IP6_SADDR;
addattr_l(&req.n, 1024, local_attr, &p->local_ip.data,
p->local_ip.bytelen);
if (p->peer_ip.family ==
10
)
peer_attr = L2TP_ATTR_IP6_DADDR;
addattr_l(&req.n, 1024, peer_attr, &p->peer_ip.data,
p->peer_ip.bytelen);
if (p->encap == L2TP_ENCAPTYPE_UDP) {
addattr16(&req.n, 1024, L2TP_ATTR_UDP_SPORT, p->local_udp_port);
addattr16(&req.n, 1024, L2TP_ATTR_UDP_DPORT, p->peer_udp_port);
if (p->udp_csum)
addattr8(&req.n, 1024, L2TP_ATTR_UDP_CSUM, 1);
if (!p->udp6_csum_tx)
addattr(&req.n, 1024, L2TP_ATTR_UDP_ZERO_CSUM6_TX);
if (!p->udp6_csum_rx)
addattr(&req.n, 1024, L2TP_ATTR_UDP_ZERO_CSUM6_RX);
}
if (rtnl_talk(&genl_rth, &req.n,
((void *)0)
) < 0)
return -2;
return 0;
}
|
int create_tunnel(unsigned long a0) {
struct_0 *v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned short v4;
unsigned short v5;
char v6;
char v7;
unsigned long long v9;
void* v10;
unsigned long v11;
v0 = a0;
v1 = 24;
v2 = 25;
v9 = 130;
for (v10 = &v3; v9; v10 += v11 * 8) {
v9 -= 1;
v3 = 0;
}
*(v10) = 0;
v3 = 20;
v4 = genl_family;
v5 = 5;
v6 = 1;
v7 = 1;
addattr32(&v3, 0x400, 0x9, v0->field_0);
addattr32(&v3, 0x400, 0xa, v0->field_4);
addattr8(&v3, 0x400, 0x7, 0x3);
addattr16(&v3, 0x400, 0x2, v0->field_10);
if (v0->field_36 == 10)
v1 = 31;
addattr_l(&v3, 0x400, v1, &v0->padding_38, v0->field_32);
if (v0->field_13e == 10)
v2 = 32;
addattr_l(&v3, 0x400, v2, &v0->padding_140, v0->field_13a);
if (!v0->field_10) {
addattr16(&v3, 0x400, 0x1a, v0->field_14);
addattr16(&v3, 0x400, 0x1b, v0->field_16);
if ((v0->field_242 & 4))
addattr8(&v3, 0x400, 0xd, 0x1);
if (!(v0->field_242 & 1))
addattr(&v3, 0x400, 0x21);
if (!(v0->field_242 & 2))
addattr(&v3, 0x400, 0x22);
}
return (rtnl_talk(&genl_rth, &v3, 0x0) < 0 ? 0 : -2);
}
|
static
_Bool
two_arguments (void)
{
_Bool
value;
if ((strcmp (argv[pos], "!") == 0))
{
advance (
0
);
value = ! one_argument ();
}
else if (argv[pos][0] == '-'
&& argv[pos][1] != '\0'
&& argv[pos][2] == '\0')
{
value = unary_operator ();
}
else
beyond ();
return (value);
}
|
undefined two_arguments(void)
{
char cVar1;
int iVar2;
undefined local_9;
iVar2 = strcmp(*(char **)(argv + (long)pos * 8),"!");
if (iVar2 == 0) {
advance(0);
cVar1 = one_argument();
local_9 = cVar1 == '\0';
}
else if (((**(char **)(argv + (long)pos * 8) == '-') &&
(*(char *)(*(long *)(argv + (long)pos * 8) + 1) != '\0')) &&
(*(char *)(*(long *)(argv + (long)pos * 8) + 2) == '\0')) {
local_9 = unary_operator();
}
else {
beyond();
}
return local_9;
}
|
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;
}
|
long open_redir_file(long a1, char **a2)
{
int v3;
char *file;
if ( *(_DWORD *)(a1 + 24) != 1 )
return 0xFFFFFFFFLL;
if ( posixly_correct && !interactive_shell )
++disallow_filename_globbing;
file = (char *)redirection_expand(*(_QWORD *)(a1 + 32));
if ( posixly_correct && !interactive_shell )
--disallow_filename_globbing;
if ( file )
{
v3 = open(file, 0);
if ( v3 >= 0 )
{
if ( a2 )
*a2 = file;
return (unsigned int)v3;
}
else
{
file_error(file);
sh_xfree(file, "evalstring.c", 735LL);
if ( a2 )
*a2 = 0LL;
return 0xFFFFFFFFLL;
}
}
else
{
redirection_error(a1, 0xFFFFFFFFLL, 0LL);
return 0xFFFFFFFFLL;
}
}
|
static
_Bool
pax_dump_header_1 (struct tar_sparse_file *file)
{
off_t block_ordinal = current_block_ordinal ();
union block *blk;
char *p, *q;
size_t i;
char nbuf[((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)];
off_t size = 0;
struct sp_array *map = file->stat_info->sparse_map;
char *save_file_name = file->stat_info->file_name;
p = umaxtostr (file->stat_info->sparse_map_avail, nbuf);
size += strlen (p) + 1;
for (i = 0; i < file->stat_info->sparse_map_avail; i++)
{
p = umaxtostr (map[i].offset, nbuf);
size += strlen (p) + 1;
p = umaxtostr (map[i].numbytes, nbuf);
size += strlen (p) + 1;
}
size = (size + 512 - 1) / 512;
file->stat_info->archive_file_size += size * 512;
file->dumped_size += size * 512;
xheader_store ("GNU.sparse.major", file->stat_info,
((void *)0)
);
xheader_store ("GNU.sparse.minor", file->stat_info,
((void *)0)
);
xheader_store ("GNU.sparse.name", file->stat_info,
((void *)0)
);
xheader_store ("GNU.sparse.realsize", file->stat_info,
((void *)0)
);
file->stat_info->file_name =
xheader_format_name (file->stat_info, "%d/GNUSparseFile.%p/%f", 0);
if (strlen (file->stat_info->file_name) > 100)
file->stat_info->file_name[100] = 0;
blk = pax_start_header (file->stat_info);
finish_header (file->stat_info, blk, block_ordinal);
free (file->stat_info->file_name);
file->stat_info->file_name = save_file_name;
blk = find_next_block ();
q = blk->buffer;
p = umaxtostr (file->stat_info->sparse_map_avail, nbuf);
do { char *endp = blk->buffer + 512; char const *srcp = p; while (*srcp) { if (q == endp) { set_next_block_after (blk); blk = find_next_block (); q = blk->buffer; endp = blk->buffer + 512; } *q++ = *srcp++; } } while (0);
do { char *endp = blk->buffer + 512; char const *srcp = "\n"; while (*srcp) { if (q == endp) { set_next_block_after (blk); blk = find_next_block (); q = blk->buffer; endp = blk->buffer + 512; } *q++ = *srcp++; } } while (0);
for (i = 0; i < file->stat_info->sparse_map_avail; i++)
{
p = umaxtostr (map[i].offset, nbuf);
do { char *endp = blk->buffer + 512; char const *srcp = p; while (*srcp) { if (q == endp) { set_next_block_after (blk); blk = find_next_block (); q = blk->buffer; endp = blk->buffer + 512; } *q++ = *srcp++; } } while (0);
do { char *endp = blk->buffer + 512; char const *srcp = "\n"; while (*srcp) { if (q == endp) { set_next_block_after (blk); blk = find_next_block (); q = blk->buffer; endp = blk->buffer + 512; } *q++ = *srcp++; } } while (0);
p = umaxtostr (map[i].numbytes, nbuf);
do { char *endp = blk->buffer + 512; char const *srcp = p; while (*srcp) { if (q == endp) { set_next_block_after (blk); blk = find_next_block (); q = blk->buffer; endp = blk->buffer + 512; } *q++ = *srcp++; } } while (0);
do { char *endp = blk->buffer + 512; char const *srcp = "\n"; while (*srcp) { if (q == endp) { set_next_block_after (blk); blk = find_next_block (); q = blk->buffer; endp = blk->buffer + 512; } *q++ = *srcp++; } } while (0);
}
memset (q, 0, 512 - (q - blk->buffer));
set_next_block_after (blk);
return
1
;
}
|
undefined8 pax_dump_header_1(long param_1)
{
long lVar1;
undefined8 uVar2;
undefined8 uVar3;
char *pcVar4;
size_t sVar5;
size_t sVar6;
long lVar7;
undefined8 uVar8;
long in_FS_OFFSET;
char *local_d8;
char *local_d0;
ulong local_c8;
long local_c0;
char *local_b8;
char *local_b0;
char *local_a8;
char *local_a0;
char *local_98;
char *local_90;
char *local_88;
char *local_80;
char *local_78;
char *local_70;
char *local_68;
char *local_60;
undefined local_38 [24];
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
uVar3 = current_block_ordinal();
lVar1 = *(long *)(*(long *)(param_1 + 0x18) + 0x140);
uVar2 = *(undefined8 *)(*(long *)(param_1 + 0x18) + 8);
pcVar4 = (char *)umaxtostr(*(undefined8 *)(*(long *)(param_1 + 0x18) + 0x130),local_38);
sVar5 = strlen(pcVar4);
local_c0 = sVar5 + 1;
for (local_c8 = 0; local_c8 < *(ulong *)(*(long *)(param_1 + 0x18) + 0x130);
local_c8 = local_c8 + 1) {
pcVar4 = (char *)umaxtostr(*(undefined8 *)(lVar1 + local_c8 * 0x10),local_38);
sVar5 = strlen(pcVar4);
pcVar4 = (char *)umaxtostr(*(undefined8 *)(lVar1 + local_c8 * 0x10 + 8),local_38);
sVar6 = strlen(pcVar4);
local_c0 = sVar6 + sVar5 + local_c0 + 2;
}
lVar7 = local_c0 + 0x1ff;
if (local_c0 + 0x1ff < 0) {
lVar7 = local_c0 + 0x3fe;
}
*(long *)(*(long *)(param_1 + 0x18) + 0x118) =
*(long *)(*(long *)(param_1 + 0x18) + 0x118) + (lVar7 >> 9) * 0x200;
*(long *)(param_1 + 0x10) = (lVar7 >> 9) * 0x200 + *(long *)(param_1 + 0x10);
xheader_store("GNU.sparse.major",*(undefined8 *)(param_1 + 0x18),0);
xheader_store("GNU.sparse.minor",*(undefined8 *)(param_1 + 0x18),0);
xheader_store("GNU.sparse.name",*(undefined8 *)(param_1 + 0x18),0);
xheader_store("GNU.sparse.realsize",*(undefined8 *)(param_1 + 0x18),0);
lVar7 = *(long *)(param_1 + 0x18);
uVar8 = xheader_format_name(*(undefined8 *)(param_1 + 0x18),"%d/GNUSparseFile.%p/%f",0);
*(undefined8 *)(lVar7 + 8) = uVar8;
sVar5 = strlen(*(char **)(*(long *)(param_1 + 0x18) + 8));
if (100 < sVar5) {
*(undefined *)(*(long *)(*(long *)(param_1 + 0x18) + 8) + 100) = 0;
}
uVar8 = pax_start_header(*(undefined8 *)(param_1 + 0x18));
finish_header(*(undefined8 *)(param_1 + 0x18),uVar8,uVar3);
free(*(void **)(*(long *)(param_1 + 0x18) + 8));
*(undefined8 *)(*(long *)(param_1 + 0x18) + 8) = uVar2;
local_d8 = (char *)find_next_block();
local_b0 = (char *)umaxtostr(*(undefined8 *)(*(long *)(param_1 + 0x18) + 0x130),local_38);
local_b8 = local_d8 + 0x200;
local_d0 = local_d8;
while (*local_b0 != '\0') {
if (local_d0 == local_b8) {
set_next_block_after(local_d8);
local_d8 = (char *)find_next_block();
local_b8 = local_d8 + 0x200;
local_d0 = local_d8;
}
*local_d0 = *local_b0;
local_d0 = local_d0 + 1;
local_b0 = local_b0 + 1;
}
local_a8 = local_d8 + 0x200;
local_a0 = "\n";
while (*local_a0 != '\0') {
if (local_d0 == local_a8) {
set_next_block_after(local_d8);
local_d8 = (char *)find_next_block();
local_a8 = local_d8 + 0x200;
local_d0 = local_d8;
}
*local_d0 = *local_a0;
local_d0 = local_d0 + 1;
local_a0 = local_a0 + 1;
}
for (local_c8 = 0; local_c8 < *(ulong *)(*(long *)(param_1 + 0x18) + 0x130);
local_c8 = local_c8 + 1) {
local_90 = (char *)umaxtostr(*(undefined8 *)(lVar1 + local_c8 * 0x10),local_38);
local_98 = local_d8 + 0x200;
while (*local_90 != '\0') {
if (local_d0 == local_98) {
set_next_block_after(local_d8);
local_d8 = (char *)find_next_block();
local_98 = local_d8 + 0x200;
local_d0 = local_d8;
}
*local_d0 = *local_90;
local_d0 = local_d0 + 1;
local_90 = local_90 + 1;
}
local_88 = local_d8 + 0x200;
local_80 = "\n";
while (*local_80 != '\0') {
if (local_d0 == local_88) {
set_next_block_after(local_d8);
local_d8 = (char *)find_next_block();
local_88 = local_d8 + 0x200;
local_d0 = local_d8;
}
*local_d0 = *local_80;
local_d0 = local_d0 + 1;
local_80 = local_80 + 1;
}
local_70 = (char *)umaxtostr(*(undefined8 *)(lVar1 + local_c8 * 0x10 + 8),local_38);
local_78 = local_d8 + 0x200;
while (*local_70 != '\0') {
if (local_d0 == local_78) {
set_next_block_after(local_d8);
local_d8 = (char *)find_next_block();
local_78 = local_d8 + 0x200;
local_d0 = local_d8;
}
*local_d0 = *local_70;
local_d0 = local_d0 + 1;
local_70 = local_70 + 1;
}
local_68 = local_d8 + 0x200;
local_60 = "\n";
while (*local_60 != '\0') {
if (local_d0 == local_68) {
set_next_block_after(local_d8);
local_d8 = (char *)find_next_block();
local_68 = local_d8 + 0x200;
local_d0 = local_d8;
}
*local_d0 = *local_60;
local_d0 = local_d0 + 1;
local_60 = local_60 + 1;
}
}
memset(local_d0,0,0x200 - ((long)local_d0 - (long)local_d8));
set_next_block_after(local_d8);
if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return 1;
}
|
void
sh_needarg (s)
char *s;
{
builtin_error (gettext("%s: option requires an argument"), s);
}
|
void sh_needarg(undefined8 param_1)
{
undefined8 uVar1;
uVar1 = gettext("%s: option requires an argument");
builtin_error(uVar1,param_1);
return;
}
|
static SHELL_VAR *
get_bashpid (var)
SHELL_VAR *var;
{
int pid;
pid = getpid ();
return (set_int_value (var, pid, 1));
}
|
long long get_bashpid(void* a0) {
unsigned int v0;
v0 = getpid();
return set_int_value(a0, v0, 0x1);
}
|
char *
get_force_string(void)
{
const struct forceinfo *fip;
struct varbuf vb = { 0, 0,
((void *)0)
};
for (fip = forceinfos; fip->name; fip++) {
if ((enum force_flags)fip->flag == FORCE_ALL ||
(fip->flag & force_mask) != fip->flag ||
!in_force(fip->flag))
continue;
if (vb.used)
varbuf_add_char(&vb, ',');
varbuf_add_buf(&vb, fip->name, strlen(fip->name));
}
varbuf_end_str(&vb);
return varbuf_detach(&vb);
}
|
int get_force_string() {
unsigned long long v0;
void* v1;
void* v2;
void* v3;
v1 = 0;
v2 = 0;
v3 = 0;
for (v0 = &forceinfos; *(v0); v0 += 24) {
if (!(*((v0 + 8)) == -1 || (*((v0 + 8)) & force_mask) != *((v0 + 8)) || !(!(in_force(*((v0 + 8))) ^ 1)))) {
if (v1)
varbuf_add_char(&v1, 0x2c);
varbuf_add_buf(&v1, *(v0), strlen(*(v0)), *(v0));
}
}
varbuf_end_str(&v1);
return varbuf_detach(&v1);
}
|
test_code_t test_sha256(gnutls_session_t session)
{
int ret;
sprintf(prio_str,
"NONE:" "+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL"
":%s:+SHA256:" "+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH" ":+VKO-GOST-12" ":%s",
protocol_all_str, rest);
{ int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 901)) != TEST_SUCCEED) { return _ret; } };
gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred);
ret = test_do_handshake(session);
return ret;
}
|
long long test_sha256(unsigned long long a0) {
unsigned int v0;
unsigned int v1;
unsigned long long v3;
sprintf(&prio_str, "NONE:+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC:+GOST28147-TC26Z-CNT:+COMP-NULL:%s:+SHA256:+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH:+VKO-GOST-12:%s", &protocol_all_str, &rest);
v0 = __gnutls_priority_set_direct(a0, &prio_str, 0x385);
if (v0) {
v3 = v0;
} else {
gnutls_credentials_set(a0, 0x1, xcred);
v1 = test_do_handshake(a0);
v3 = v1;
}
return v3;
}
|
int
ssh_krl_revoke_key_sha256(struct ssh_krl *krl, const u_char *p, size_t len)
{
sshlog("krl.c", __func__, 445, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "revoke by sha256");
if (len != 32)
return -4;
return revoke_by_hash(&krl->revoked_sha256s, p, len);
}
|
long long ssh_krl_revoke_key_sha256(unsigned long a0, void* a1, unsigned long a2) {
unsigned long long v1;
sshlog("krl.c", "ssh_krl_revoke_key_sha256", 0x1bd, 0x1, 0x7, 0x0, "revoke by sha256");
if (a2 != 32)
v1 = 0xfffffffc;
else
v1 = revoke_by_hash(a0 + 48, a1, a2);
return v1;
}
|
int
kex_gen_client(struct ssh *ssh)
{
struct kex *kex = ssh->kex;
int r;
switch (kex->kex_type) {
case KEX_DH_GRP1_SHA1:
case KEX_DH_GRP14_SHA1:
case KEX_DH_GRP14_SHA256:
case KEX_DH_GRP16_SHA512:
case KEX_DH_GRP18_SHA512:
r = kex_dh_keypair(kex);
break;
case KEX_ECDH_SHA2:
r = kex_ecdh_keypair(kex);
break;
case KEX_C25519_SHA256:
r = kex_c25519_keypair(kex);
break;
case KEX_KEM_SNTRUP761X25519_SHA512:
r = kex_kem_sntrup761x25519_keypair(kex);
break;
default:
r = -10;
break;
}
if (r != 0)
return r;
if ((r = sshpkt_start(ssh, 30)) != 0 ||
(r = sshpkt_put_stringb(ssh, kex->client_pub)) != 0 ||
(r = sshpkt_send(ssh)) != 0)
return r;
sshlog("kexgen.c", __func__, 133, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "expecting SSH2_MSG_KEX_ECDH_REPLY");
ssh_dispatch_set(ssh, 31, &input_kex_gen_reply);
return 0;
}
|
long long kex_gen_client(struct_0 *a0) {
unsigned long long v0;
unsigned int v1;
struct_1 *v2;
void* v4;
v2 = a0->field_8;
if (v2->field_38 != 9) {
if (v2->field_38 <= 9) {
if (v2->field_38 == 8) {
v1 = kex_c25519_keypair(v2);
} else if (v2->field_38 <= 8) {
if (v2->field_38 <= 4) {
v1 = kex_dh_keypair(v2);
} else if (v2->field_38 == 7) {
v1 = kex_ecdh_keypair(v2);
}
}
}
if (v2->field_38 > 9 || v2->field_38 > 8 && v2->field_38 != 8 || v2->field_38 != 8 && v2->field_38 != 7 && v2->field_38 > 4)
v1 = -10;
} else {
v1 = kex_kem_sntrup761x25519_keypair(v2);
}
if (v1) {
v4 = v1;
} else {
v1 = sshpkt_start(a0, 0x1e);
if (!v1) {
v1 = sshpkt_put_stringb(a0, v2->field_868, v2->field_868);
if (!v1) {
v1 = sshpkt_send(a0);
if (!v1) {
v0 = "expecting SSH2_MSG_KEX_ECDH_REPLY";
sshlog("kexgen.c", "kex_gen_client", 0x85, 0x0, 0x5, 0x0);
ssh_dispatch_set(a0, 0x1f, input_kex_gen_reply);
v4 = 0;
}
}
}
if (v1 || v1 || v1)
v4 = v1;
}
return v4;
}
|
void
ssh_packet_set_input_hook(struct ssh *ssh, ssh_packet_hook_fn *hook, void *ctx)
{
ssh->state->hook_in = hook;
ssh->state->hook_in_ctx = ctx;
}
|
void ssh_packet_set_input_hook(long *param_1,undefined8 param_2,undefined8 param_3)
{
*(undefined8 *)(*param_1 + 0x1f0) = param_2;
*(undefined8 *)(*param_1 + 0x1f8) = param_3;
return;
}
|
int
ssh_compatible_openssl(long headerver, long libver)
{
long mask, hfix, lfix;
if (headerver == libver)
return 1;
if (headerver < 0x1000000f) {
mask = 0xfffff00fL;
return (headerver & mask) == (libver & mask);
}
mask = 0xfff0000fL;
hfix = (headerver & 0x000ff000) >> 12;
lfix = (libver & 0x000ff000) >> 12;
if ( (headerver & mask) == (libver & mask) && lfix >= hfix)
return 1;
return 0;
}
|
bool ssh_compatible_openssl(ulong param_1,ulong param_2)
{
bool bVar1;
if (param_1 == param_2) {
bVar1 = true;
}
else if ((long)param_1 < 0x1000000f) {
bVar1 = ((param_1 ^ param_2) & 0xfffff00f) == 0;
}
else if ((((param_1 ^ param_2) & 0xfff0000f) == 0) &&
(((uint)((long)param_1 >> 0xc) & 0xff) <= ((uint)((long)param_2 >> 0xc) & 0xff))) {
bVar1 = true;
}
else {
bVar1 = false;
}
return bVar1;
}
|
void
fn_display_match_list(EditLine * el, char **matches, size_t num, size_t width,
const char *(*app_func) (const char *))
{
size_t line, lines, col, cols, thisguy;
int screenwidth = el->el_terminal.t_size.h;
if (app_func ==
((void *)0)
)
app_func = append_char_function;
matches++;
num--;
cols = (size_t)screenwidth / (width + 2);
if (cols == 0)
cols = 1;
lines = (num + cols - 1) / cols;
qsort(matches, num, sizeof(char *), _fn_qsort_string_compare);
for (line = 0; line < lines; line++) {
for (col = 0; col < cols; col++) {
thisguy = line + col * lines;
if (thisguy >= num)
break;
(void)fprintf(el->el_outfile, "%s%s%s",
col == 0 ? "" : " ", matches[thisguy],
(*app_func)(matches[thisguy]));
(void)fprintf(el->el_outfile, "%-*s",
(int) (width - strlen(matches[thisguy])), "");
}
(void)fprintf(el->el_outfile, "\n");
}
}
|
void fn_display_match_list(struct_0 *a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4) {
unsigned long long v0;
unsigned long long v1;
unsigned long v2;
unsigned int v3;
void* v4;
void* v5;
unsigned long long v6;
unsigned long v7;
unsigned long long *v8;
unsigned long v10;
unsigned int v12;
v2 = a1;
v1 = a2;
v0 = a4;
v3 = a0->field_90;
if (!v0)
v0 = append_char_function;
v2 += 8;
v1 -= 1;
v6 = (0 CONCAT v3) /m (a3 + 2);
if (!v6)
v6 = 1;
v7 = (0 CONCAT v6 + v1 - 1) /m v6;
qsort(v2, v1, 0x8, _fn_qsort_string_compare);
v4 = 0;
while (true) {
v10 = v4;
if (v4 >= v7)
break;
for (v5 = 0; v5 < v6 && (v8 = (v4 + v7 * v5), v8 < v1); v5 += 1) {
if (v5)
*(&v10) = &g_401c31;
else
*(&v10) = &g_401c28;
v12 = (stack_base)[112](*((v2 + 0x8 * v8)));
fprintf(a0->field_10, "%s%s%s", v10, *((v2 + 0x8 * v8)), v12);
strlen(*((v2 + 0x8 * v8)));
fprintf(a0->field_10, "%-*s");
}
fprintf(a0->field_10, "\n");
v4 += 1;
}
return;
}
|
static void
users (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 ()))));
list_entries_users (n_users, utmp_buf);
free (utmp_buf);
}
|
void users(unsigned long long a0, unsigned long a1) {
char v0;
char v1;
char v2;
unsigned long long v4;
unsigned long long *v5;
unsigned long long v6;
if (!read_utmp(a0, &v0, &v1, a1)) {
list_entries_users(*(&v0), *(&v1));
free(*(&v1));
v6 = *(&v2) ^ v5[5];
return;
}
v4 = quotearg_n_style_colon(0x0, 0x3, a0);
error(0x1, *(__errno_location()), "%s");
}
|
inline errcode_t ext2fs_get_mem(unsigned long size, void *ptr)
{
void *pp;
pp = malloc(size);
if (!pp)
return (2133571398L);
memcpy(ptr, &pp, sizeof (pp));
return 0;
}
|
void ext2fs_get_mem(void)
{
halt_baddata();
}
|
void
shtimer_set (sh_timer *t, time_t sec, long usec)
{
struct timeval now;
if (t->flags & 0x01)
{
t->alrmflag = 0;
t->old_handler = set_signal_handler (
14
, t->alrm_handler);
t->flags |= 0x100;
falarm (t->tmout.tv_sec = sec, t->tmout.tv_usec = usec);
t->flags |= 0x200;
return;
}
if (gettimeofday (&now, 0) < 0)
((
&now
)->tv_sec = (
&now
)->tv_usec = 0)
;
t->tmout.tv_sec = now.tv_sec + sec;
t->tmout.tv_usec = now.tv_usec + usec;
if (t->tmout.tv_usec > 1000000)
{
t->tmout.tv_sec++;
t->tmout.tv_usec -= 1000000;
}
}
|
long long shtimer_set(struct_0 *a0, unsigned long long a1, unsigned long a2) {
int tmp_37;
int tmp_17;
void* v0;
void* v1;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
if ((a0->field_14 & 1)) {
a0->field_18 = 0;
a0->field_28 = set_signal_handler(0xe, a0->field_20);
v3 = a0->field_14;
*(&v3) = (a0->field_14 >> 8) | 1;
tmp_37 = v3;
a0->field_14 = tmp_37;
a0->field_8 = a2;
v4 = a0->field_8;
a0->field_0 = a1;
falarm(a0->field_0, v4, a1, v4);
v5 = a0->field_14;
*(&v5) = (a0->field_14 >> 8) | 2;
tmp_17 = v5;
a0->field_14 = tmp_17;
} else {
if (gettimeofday(&v0, NULL) < 0) {
v1 = 0;
v0 = v1;
}
a0->field_0 = v0 + a1;
a0->field_8 = v1 + a2;
if (a0->field_8 > 1000000) {
a0->field_0 = a0->field_0 + 1;
a0->field_8 = a0->field_8 - 1000000;
}
}
return 0;
}
|
static intmax_t do_binop(int op, intmax_t a, intmax_t b)
{
switch (op) {
default:
case 13:
case 22:
if (!b)
yyerror("division by zero");
return op == 13 ? a % b : a / b;
case 17:
return a * b;
case 18:
return a + b;
case 20:
return a - b;
case 15:
return a << b;
case 16:
return a >> b;
case 10:
return a < b;
case 8:
return a <= b;
case 11:
return a > b;
case 9:
return a >= b;
case 12:
return a == b;
case 23:
return a != b;
case 14:
return a & b;
case 21:
return a ^ b;
case 19:
return a | b;
}
}
|
ulong do_binop(int param_1,ulong param_2,ulong param_3)
{
switch(param_1) {
case 8:
param_2 = (ulong)((long)param_2 <= (long)param_3);
break;
case 9:
param_2 = (ulong)((long)param_3 <= (long)param_2);
break;
case 10:
param_2 = (ulong)((long)param_2 < (long)param_3);
break;
case 0xb:
param_2 = (ulong)((long)param_3 < (long)param_2);
break;
case 0xc:
param_2 = (ulong)(param_2 == param_3);
break;
default:
if (param_3 == 0) {
yyerror("division by zero");
}
if (param_1 == 0xd) {
param_2 = (long)param_2 % (long)param_3;
}
else {
param_2 = (long)param_2 / (long)param_3;
}
break;
case 0xe:
param_2 = param_2 & param_3;
break;
case 0xf:
param_2 = param_2 << ((byte)param_3 & 0x3f);
break;
case 0x10:
param_2 = (long)param_2 >> ((byte)param_3 & 0x3f);
break;
case 0x11:
param_2 = param_2 * param_3;
break;
case 0x12:
param_2 = param_3 + param_2;
break;
case 0x13:
param_2 = param_2 | param_3;
break;
case 0x14:
param_2 = param_2 - param_3;
break;
case 0x15:
param_2 = param_2 ^ param_3;
break;
case 0x17:
param_2 = (ulong)(param_2 != param_3);
}
return param_2;
}
|
int
kexc25519_shared_key_ext(const u_char key[32],
const u_char pub[32], struct sshbuf *out, int raw)
{
u_char shared_key[32];
u_char zero[32];
int r;
crypto_scalarmult_curve25519(shared_key, key, pub);
explicit_bzero(zero, 32);
if (timingsafe_bcmp(zero, shared_key, 32) == 0)
return -20;
if (raw)
r = sshbuf_put(out, shared_key, 32);
else
r = sshbuf_put_bignum2_bytes(out, shared_key, 32);
explicit_bzero(shared_key, 32);
return r;
}
|
int kexc25519_shared_key_ext(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long a3) {
unsigned int v0;
char v1;
char v2;
unsigned int v4;
crypto_scalarmult_curve25519(&v1, a0, a1, a0);
explicit_bzero(&v2, 0x20);
if (!timingsafe_bcmp(&v2, &v1, 0x20, &v1)) {
v4 = -20;
} else {
if (!a3)
v0 = sshbuf_put_bignum2_bytes(a2, &v1, 0x20, &v1);
else
v0 = sshbuf_put(a2, &v1, 0x20, &v1);
explicit_bzero(&v1, 0x20);
v4 = v0;
}
return v4;
}
|
void
rl_display_match_list(char **matches, int len, int max)
{
fn_display_match_list(e, matches, (size_t)len, (size_t)max,
_rl_completion_append_character_function);
}
|
void rl_display_match_list(undefined8 param_1,int param_2,int param_3)
{
fn_display_match_list
(e,param_1,(long)param_2,(long)param_3,_rl_completion_append_character_function);
return;
}
|
static void open_files (void)
{
if (gr_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, gr_dbname ());
exit (10);
}
add_cleanup (cleanup_unlock_group,
((void *)0)
);
if (is_shadow_grp) {
if (sgr_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, sgr_dbname ());
exit (10);
}
add_cleanup (cleanup_unlock_gshadow,
((void *)0)
);
}
add_cleanup (cleanup_report_add_group, group_name);
if (gr_open (
0100
|
02
) == 0) {
fprintf (
stderr
, gettext ("%s: cannot open %s\n"), Prog, gr_dbname ());
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
4
, "cannot open %s", gr_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
exit (10);
}
if (is_shadow_grp) {
if (sgr_open (
0100
|
02
) == 0) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"),
Prog, sgr_dbname ());
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
4
, "cannot open %s", sgr_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
exit (10);
}
}
}
|
long long open_files() {
void* v0;
void* v1;
char *v2;
char *v3;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
if (!gr_lock()) {
v5 = gr_dbname();
fprintf(*(&stderr), gettext("%s: cannot lock %s; try again later.\n"));
exit(0xa);
}
add_cleanup(got.cleanup_unlock_group, 0x0);
if (is_shadow_grp) {
if (sgr_lock()) {
add_cleanup(got.cleanup_unlock_gshadow, 0x0);
} else {
v6 = sgr_dbname();
fprintf(*(&stderr), gettext("%s: cannot lock %s; try again later.\n"));
exit(0xa);
}
}
add_cleanup(got.cleanup_report_add_group, group_name);
if (!gr_open(0x42)) {
v8 = gr_dbname();
fprintf(*(&stderr), gettext("%s: cannot open %s\n"));
v3 = setlocale(0x6, NULL);
v0 = 0;
if (v3)
v0 = strdup(v3);
if (v0)
setlocale(0x6, "C");
gr_dbname();
syslog(0x4, "cannot open %s");
if (v0) {
setlocale(0x6, v0);
free(v0);
}
exit(0xa);
} else {
v7 = is_shadow_grp;
if (is_shadow_grp) {
v7 = sgr_open(0x42);
if (!v7) {
v9 = sgr_dbname();
fprintf(*(&stderr), gettext("%s: cannot open %s\n"));
v2 = setlocale(0x6, NULL);
v1 = 0;
if (v2)
v1 = strdup(v2);
if (v1)
setlocale(0x6, "C");
sgr_dbname();
syslog(0x4, "cannot open %s");
if (v1) {
setlocale(0x6, v1);
free(v1);
}
exit(0xa);
}
}
return v7;
}
}
|
char *
get_array_value (s, flags, estatep)
const char *s;
int flags;
array_eltstate_t *estatep;
{
char *retval;
retval = array_value_internal (s, 0, flags, estatep);
return retval;
}
|
long long get_array_value(char *a0, unsigned long a1, void* a2) {
unsigned long v0;
v0 = array_value_internal(a0, 0x0, a1, a2);
return v0;
}
|
static void usage (int status)
{
FILE *usageout = (
0
!= status) ?
stderr
:
stdout
;
(void) fprintf (usageout,
gettext ("Usage: %s [options]\n" "\n" "Options:\n")
,
Prog);
(void) fputs (gettext (" -b, --badname allow bad names\n"), usageout);
(void) fprintf (usageout,
gettext (" -c, --crypt-method METHOD the crypt method (one of %s)\n"),
"NONE DES MD5"
" SHA256 SHA512"
);
(void) fputs (gettext (" -h, --help display this help message and exit\n"), usageout);
(void) fputs (gettext (" -r, --system create system accounts\n"), usageout);
(void) fputs (gettext (" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
(void) fputs (gettext (" -s, --sha-rounds number of rounds for the SHA, BCRYPT\n" " or YESCRYPT crypt algorithms\n")
,
usageout);
(void) fputs ("\n", usageout);
exit (status);
}
|
void usage(int param_1)
{
undefined8 uVar1;
FILE *__stream;
char *pcVar2;
uVar1 = Prog;
__stream = stdout;
if (param_1 != 0) {
__stream = stderr;
}
pcVar2 = (char *)gettext("Usage: %s [options]\n\nOptions:\n");
fprintf(__stream,pcVar2,uVar1);
pcVar2 = (char *)gettext(" -b, --badname allow bad names\n");
fputs(pcVar2,__stream);
pcVar2 = (char *)gettext(" -c, --crypt-method METHOD the crypt method (one of %s)\n");
fprintf(__stream,pcVar2,"NONE DES MD5 SHA256 SHA512");
pcVar2 = (char *)gettext(" -h, --help display this help message and exit\n");
fputs(pcVar2,__stream);
pcVar2 = (char *)gettext(" -r, --system create system accounts\n");
fputs(pcVar2,__stream);
pcVar2 = (char *)gettext(" -R, --root CHROOT_DIR directory to chroot into\n");
fputs(pcVar2,__stream);
pcVar2 = (char *)gettext(
" -s, --sha-rounds number of rounds for the SHA, BCRYPT\n or YESCRYPT crypt algorithms\n"
);
fputs(pcVar2,__stream);
fputs("\n",__stream);
exit(param_1);
}
|
int
sradixsort(const unsigned char **a, int n, const unsigned char *tab,
unsigned int endch)
{
const unsigned char *tr, **ta;
unsigned int c;
unsigned char tr0[256];
if (a ==
((void *)0)
) {
(*__errno_location ())
=
14
;
return (-1);
}
{ if (tab ==
((void *)0)
) { tr = tr0; for (c = 0; c < endch; c++) tr0[c] = c + 1; tr0[c] = 0; for (c++; c < 256; c++) tr0[c] = c; endch = 0; } else { endch = tab[endch]; tr = tab; if (endch != 0 && endch != 255) {
(*__errno_location ())
=
22
; return (-1); } } };
if (n < 20)
simplesort(a, n, 0, tr, endch);
else {
ta = reallocarray(
((void *)0)
, n, sizeof(*a));
if (ta ==
((void *)0)
)
return (-1);
r_sort_b(a, ta, n, 0, tr, endch);
free(ta);
}
return (0);
}
|
long long sradixsort(unsigned int a0, unsigned long a1, char *a2, unsigned long a3) {
unsigned int v0;
unsigned int v1;
char *v2;
void* v3;
char v4;
unsigned long long v6;
v0 = a3;
if (!a0) {
*(__errno_location()) = 14;
v6 = 4294967295;
} else {
if (!a2) {
v2 = &v4;
for (v1 = 0; v1 < v0; v1 += 1) {
(&v4)[v1] = v1 + 1;
}
(&v4)[v1] = 0;
for (v1 += 1; v1 <= 255; v1 += 1) {
(&v4)[v1] = v1;
}
v0 = 0;
} else {
v0 = a2[v0];
v2 = a2;
if (v0 && v0 != 255) {
*(__errno_location()) = 22;
v6 = 4294967295;
}
}
if (!a2 || !v0 || v0 == 255) {
if (a1 <= 19) {
simplesort(a0, a1, 0x0, v2, v0);
} else {
v3 = reallocarray(NULL, a1, 0x8);
if (!v3) {
v6 = 4294967295;
} else {
r_sort_b(a0, v3, a1, 0x0, v2, v0);
free(v3);
}
}
if (a1 <= 19 || v3)
v6 = 0;
}
}
return v6;
}
|
void get_extensions_crt_set(int type, void *crt)
{
int ret, i;
unsigned char *raw =
((void *)0)
;
unsigned raw_size;
if (batch) {
if (!cfg.extensions)
goto check_critical;
for (i = 0; cfg.extensions[i] !=
((void *)0)
; i += 2) {
if (cfg.extensions[i + 1] ==
((void *)0)
) {
fprintf(
stderr
,
"extensions: %s does not have an argument.\n",
cfg.extensions[i]);
exit(1);
}
raw = decode_ext_string(cfg.extensions[i+1], &raw_size);
if (type == 1)
ret =
gnutls_x509_crt_set_extension_by_oid(crt,
cfg.extensions[i],
raw, raw_size, 0);
else
ret =
gnutls_x509_crq_set_extension_by_oid(crt,
cfg.extensions[i],
raw, raw_size, 0);
gnutls_free((void *) (raw)), raw=
((void *)0)
;
if (ret < 0) {
fprintf(
stderr
, "set_extensions: %s\n",
gnutls_strerror(ret));
exit(1);
}
}
check_critical:
if (!cfg.crit_extensions)
return;
for (i = 0; cfg.crit_extensions[i] !=
((void *)0)
; i += 2) {
if (cfg.crit_extensions[i + 1] ==
((void *)0)
) {
fprintf(
stderr
,
"extensions: %s does not have an argument.\n",
cfg.crit_extensions[i]);
exit(1);
}
raw = decode_ext_string(cfg.crit_extensions[i+1], &raw_size);
if (type == 1)
ret =
gnutls_x509_crt_set_extension_by_oid(crt,
cfg.crit_extensions[i],
raw, raw_size, 1);
else
ret =
gnutls_x509_crq_set_extension_by_oid(crt,
cfg.crit_extensions[i],
raw, raw_size, 1);
gnutls_free((void *) (raw)), raw=
((void *)0)
;
if (ret < 0) {
fprintf(
stderr
, "set_extensions: %s\n",
gnutls_strerror(ret));
exit(1);
}
}
}
}
|
unsigned long get_extensions_crt_set(int a1, long a2)
{
const char *v2;
const char *v3;
unsigned int v5;
unsigned int v6;
int i;
void *v8;
unsigned long v9;
v9 = __readfsqword(0x28u);
v8 = 0LL;
if ( batch )
{
if ( *(_QWORD *)&cfg[98] )
{
for ( i = 0; *(_QWORD *)(8LL * i + *(_QWORD *)&cfg[98]); i += 2 )
{
if ( !*(_QWORD *)(8 * (i + 1LL) + *(_QWORD *)&cfg[98]) )
{
fprintf(
stderr,
"extensions: %s does not have an argument.\n",
*(const char **)(8LL * i + *(_QWORD *)&cfg[98]));
exit(1);
}
v8 = decode_ext_string(*(char **)(8 * (i + 1LL) + *(_QWORD *)&cfg[98]), &v5);
if ( a1 == 1 )
v6 = gnutls_x509_crt_set_extension_by_oid(a2, *(_QWORD *)(8LL * i + *(_QWORD *)&cfg[98]), v8, v5, 0LL);
else
v6 = gnutls_x509_crq_set_extension_by_oid(a2, *(_QWORD *)(8LL * i + *(_QWORD *)&cfg[98]), v8, v5, 0LL);
gnutls_free(v8);
v8 = 0LL;
if ( (v6 & 0x80000000) != 0 )
{
v2 = (const char *)gnutls_strerror(v6);
fprintf(stderr, "set_extensions: %s\n", v2);
exit(1);
}
}
}
if ( *(_QWORD *)&cfg[100] )
{
for ( i = 0; *(_QWORD *)(8LL * i + *(_QWORD *)&cfg[100]); i += 2 )
{
if ( !*(_QWORD *)(8 * (i + 1LL) + *(_QWORD *)&cfg[100]) )
{
fprintf(
stderr,
"extensions: %s does not have an argument.\n",
*(const char **)(8LL * i + *(_QWORD *)&cfg[100]));
exit(1);
}
v8 = decode_ext_string(*(char **)(8 * (i + 1LL) + *(_QWORD *)&cfg[100]), &v5);
if ( a1 == 1 )
v6 = gnutls_x509_crt_set_extension_by_oid(a2, *(_QWORD *)(8LL * i + *(_QWORD *)&cfg[100]), v8, v5, 1LL);
else
v6 = gnutls_x509_crq_set_extension_by_oid(a2, *(_QWORD *)(8LL * i + *(_QWORD *)&cfg[100]), v8, v5, 1LL);
gnutls_free(v8);
v8 = 0LL;
if ( (v6 & 0x80000000) != 0 )
{
v3 = (const char *)gnutls_strerror(v6);
fprintf(stderr, "set_extensions: %s\n", v3);
exit(1);
}
}
}
}
return __readfsqword(0x28u) ^ v9;
}
|
_Bool
filter_should_skip(struct tar_entry *ti)
{
struct filter_node *f;
_Bool
skip =
0
;
if (!filter_head)
return
0
;
for (f = filter_head; f !=
((void *)0)
; f = f->next) {
debug(dbg_eachfile, "filter comparing '%s' and '%s'",
&ti->name[1], f->pattern);
if (fnmatch(f->pattern, &ti->name[1], 0) == 0) {
if (f->include) {
skip =
0
;
debug(dbg_eachfile, "filter including %s",
ti->name);
} else {
skip =
1
;
debug(dbg_eachfile, "filter removing %s",
ti->name);
}
}
}
if (skip && (ti->type == TAR_FILETYPE_DIR ||
ti->type == TAR_FILETYPE_SYMLINK)) {
debug(dbg_eachfile,
"filter seeing if '%s' needs to be reincluded",
&ti->name[1]);
for (f = filter_head; f !=
((void *)0)
; f = f->next) {
const char *wildcard;
int path_len;
if (!f->include)
continue;
wildcard = strpbrk(f->pattern, "*?[\\");
if (wildcard)
path_len = wildcard - f->pattern;
else
path_len = strlen(f->pattern);
while (path_len && f->pattern[path_len - 1] == '/')
path_len--;
debug(dbg_eachfiledetail,
"filter subpattern '%.*s'", path_len, f->pattern);
if (strncmp(&ti->name[1], f->pattern, path_len) == 0) {
debug(dbg_eachfile, "filter reincluding %s",
ti->name);
return
0
;
}
}
}
return skip;
}
|
char filter_should_skip(long param_1)
{
int iVar1;
char *pcVar2;
size_t sVar3;
char local_1d;
int local_1c;
undefined8 *local_18;
local_1d = '\0';
if (filter_head == (undefined8 *)0x0) {
local_1d = '\0';
}
else {
for (local_18 = filter_head; local_18 != (undefined8 *)0x0; local_18 = (undefined8 *)*local_18)
{
debug(8,"filter comparing \'%s\' and \'%s\'",*(long *)(param_1 + 8) + 1,local_18[1]);
iVar1 = fnmatch((char *)local_18[1],(char *)(*(long *)(param_1 + 8) + 1),0);
if (iVar1 == 0) {
if (*(char *)(local_18 + 2) == '\0') {
local_1d = '\x01';
debug(8,"filter removing %s",*(undefined8 *)(param_1 + 8));
}
else {
local_1d = '\0';
debug(8,"filter including %s",*(undefined8 *)(param_1 + 8));
}
}
}
if ((local_1d != '\0') && ((*(int *)(param_1 + 4) == 0x35 || (*(int *)(param_1 + 4) == 0x32))))
{
debug(8,"filter seeing if \'%s\' needs to be reincluded",*(long *)(param_1 + 8) + 1);
for (local_18 = filter_head; local_18 != (undefined8 *)0x0; local_18 = (undefined8 *)*local_18
) {
if (*(char *)(local_18 + 2) == '\x01') {
pcVar2 = strpbrk((char *)local_18[1],"*?[\\");
if (pcVar2 == (char *)0x0) {
sVar3 = strlen((char *)local_18[1]);
local_1c = (int)sVar3;
}
else {
local_1c = (int)pcVar2 - (int)local_18[1];
}
while ((local_1c != 0 && (*(char *)(local_18[1] + (long)local_1c + -1) == '/'))) {
local_1c = local_1c + -1;
}
debug(0x40,"filter subpattern \'%.*s\'",local_1c,local_18[1]);
iVar1 = strncmp((char *)(*(long *)(param_1 + 8) + 1),(char *)local_18[1],(long)local_1c);
if (iVar1 == 0) {
debug(8,"filter reincluding %s",*(undefined8 *)(param_1 + 8));
return '\0';
}
}
}
}
}
return local_1d;
}
|
int
rl_backward (int count, int key)
{
return (rl_backward_char (count, key));
}
|
void rl_backward(undefined4 param_1,undefined4 param_2)
{
rl_backward_char(param_1,param_2);
return;
}
|
const char *get_pkcs12_key_name(void)
{
const char *name;
if (batch) {
if (!cfg.pkcs12_key_name)
return "Anonymous";
return cfg.pkcs12_key_name;
} else {
do {
name = read_str("Enter a name for the key: ");
}
while (name ==
((void *)0)
);
}
return name;
}
|
char *get_pkcs12_key_name()
{
char *str;
if ( batch )
{
if ( *(_QWORD *)&cfg[118] )
return *(char **)&cfg[118];
else
return "Anonymous";
}
else
{
do
str = read_str("Enter a name for the key: ");
while ( !str );
return str;
}
}
|
static inline __u16 rta_getattr_u16(const struct rtattr *rta)
{
return *(__u16 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
|
int rta_getattr_u16(struct_0 *a0) {
return a0->field_4;
}
|
void
sshbuf_reset(struct sshbuf *buf)
{
u_char *d;
if (buf->readonly || buf->refcount > 1) {
buf->off = buf->size;
return;
}
if (sshbuf_check_sanity(buf) != 0)
return;
buf->off = buf->size = 0;
if (buf->alloc != 256) {
if ((d = recallocarray(buf->d, buf->alloc, 256,
1)) !=
((void *)0)
) {
buf->cd = buf->d = d;
buf->alloc = 256;
}
}
explicit_bzero(buf->d, buf->alloc);
}
|
long * sshbuf_reset(long *a1)
{
long *result;
long v2;
if ( *((_DWORD *)a1 + 12) || *((_DWORD *)a1 + 14) > 1u )
{
result = a1;
a1[2] = a1[3];
}
else
{
result = (long *)sshbuf_check_sanity((long)a1);
if ( !(_DWORD)result )
{
a1[3] = 0LL;
a1[2] = a1[3];
if ( a1[5] != 256 )
{
v2 = recallocarray(*a1, a1[5], 256LL, 1LL);
if ( v2 )
{
*a1 = v2;
a1[1] = *a1;
a1[5] = 256LL;
}
}
return (long *)explicit_bzero(*a1, a1[5]);
}
}
return result;
}
|
int inflateGetDictionary(strm, dictionary, dictLength)
z_streamp strm;
Bytef *dictionary;
uInt *dictLength;
{
struct inflate_state *state;
if (inflateStateCheck(strm)) return (-2);
state = (struct inflate_state *)strm->state;
if (state->whave && dictionary != 0) {
memcpy(dictionary, state->window + state->wnext,
state->whave - state->wnext);
memcpy(dictionary + state->whave - state->wnext,
state->window, state->wnext);
}
if (dictLength != 0)
*dictLength = state->whave;
return 0;
}
|
long long inflateGetDictionary(struct_0 *a0, void* a1, unsigned int *a2) {
struct_1 *v0;
unsigned long long v2;
if (inflateStateCheck(a0)) {
v2 = 4294967294;
return v2;
}
v0 = a0->field_38;
if (v0->field_40 && a1) {
memcpy(a1, v0->field_48 + v0->field_44, v0->field_40 - v0->field_44);
memcpy(v0->field_40 - v0->field_44 + a1, v0->field_48, v0->field_44);
}
if (a2)
*(a2) = v0->field_40;
v2 = 0;
return v2;
}
|
keymacro_add(EditLine *el, const wchar_t *key, keymacro_value_t *val,
int ntype)
{
if (key[0] == '\0') {
(void) fprintf(el->el_errfile,
"keymacro_add: Null extended-key not allowed.\n");
return;
}
if (ntype == 0 && val->cmd == 25) {
(void) fprintf(el->el_errfile,
"keymacro_add: sequence-lead-in command not allowed\n");
return;
}
if (el->el_keymacro.map ==
((void *)0)
)
el->el_keymacro.map = node__get(key[0]);
(void) node__try(el, el->el_keymacro.map, key, val, ntype);
return;
}
|
long long keymacro_add(struct_0 *a0, unsigned int *a1, char *a2, unsigned long a3) {
unsigned long long v1;
if (!*(a1)) {
v1 = fprintf(a0->field_18, "keymacro_add: Null extended-key not allowed.\n");
} else {
if (!a3 && *(a2) == 25)
v1 = fprintf(a0->field_18, "keymacro_add: sequence-lead-in command not allowed\n");
if (*(a2) != 25 || a3) {
if (!*(&a0[34].padding_0[8]))
*(&a0[34].padding_0[8]) = node__get(*(a1));
v1 = node__try(a0, *(&a0[34].padding_0[8]), a1, a2, a3);
}
}
return v1;
}
|
Channel *
channel_connect_by_listen_address(struct ssh *ssh, const char *listen_host,
u_short listen_port, char *ctype, char *rname)
{
struct ssh_channels *sc = ssh->chanctxt;
struct permission_set *pset = &sc->local_perms;
u_int i;
struct permission *perm;
for (i = 0; i < pset->num_permitted_user; i++) {
perm = &pset->permitted_user[i];
if (open_listen_match_tcpip(perm,
listen_host, listen_port, 1)) {
if (perm->downstream)
return perm->downstream;
if (perm->port_to_connect == 0)
return rdynamic_connect_prepare(ssh,
ctype, rname);
return connect_to(ssh,
perm->host_to_connect, perm->port_to_connect,
ctype, rname);
}
}
sshlog("channels.c", __func__, 4578, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "WARNING: Server requests forwarding for unknown listen_port %d", listen_port)
;
return
((void *)0)
;
}
|
undefined8
channel_connect_by_listen_address
(long param_1,undefined8 param_2,undefined2 param_3,undefined8 param_4,undefined8 param_5)
{
long lVar1;
int iVar2;
undefined8 *puVar3;
undefined8 uVar4;
uint local_24;
lVar1 = *(long *)(param_1 + 0x868);
local_24 = 0;
while( true ) {
if (*(uint *)(lVar1 + 0x20) <= local_24) {
sshlog("channels.c","channel_connect_by_listen_address",0x11e2,0,2,0,
"WARNING: Server requests forwarding for unknown listen_port %d",param_3);
return 0;
}
puVar3 = (undefined8 *)((ulong)local_24 * 0x30 + *(long *)(lVar1 + 0x28));
iVar2 = open_listen_match_tcpip(puVar3,param_2,param_3,1);
if (iVar2 != 0) break;
local_24 = local_24 + 1;
}
if (puVar3[5] != 0) {
return puVar3[5];
}
if (*(int *)(puVar3 + 1) == 0) {
uVar4 = rdynamic_connect_prepare(param_1,param_4,param_5);
return uVar4;
}
uVar4 = connect_to(param_1,*puVar3,*(undefined4 *)(puVar3 + 1),param_4,param_5);
return uVar4;
}
|
static void bsClose ( BitStream* bs )
{
Int32 retVal;
if ( bs->mode == 'w' ) {
while ( bs->buffLive < 8 ) {
bs->buffLive++;
bs->buffer <<= 1;
};
retVal = putc ( (UChar) (bs->buffer), bs->handle );
if (retVal ==
(-1)
) writeError();
bytesOut++;
retVal = fflush ( bs->handle );
if (retVal ==
(-1)
) writeError();
}
retVal = fclose ( bs->handle );
if (retVal ==
(-1)
) {
if (bs->mode == 'w') writeError(); else readError();
}
free ( bs );
}
|
void bsClose(struct_0 *a0) {
unsigned int v0;
unsigned long long v2;
if (a0->field_10 == 119) {
for (; a0->field_c <= 7; a0->field_8 = a0->field_8 * 2) {
a0->field_c = a0->field_c + 1;
}
v0 = putc(a0->field_8, a0->field_0);
if (v0 == -1)
writeError();
bytesOut = bytesOut + 1;
v0 = fflush(a0->field_0);
if (v0 == -1)
writeError();
}
if (a0->field_10 != 119 || v0 != -1 && v0 != -1) {
v0 = fclose(a0->field_0);
if (v0 != -1) {
v2 = free(a0);
return;
} else if (a0->field_10 == 119) {
writeError();
} else {
readError();
}
}
}
|
static int
cert_option_list(struct sshauthopt *opts, struct sshbuf *oblob,
u_int which, int crit)
{
char *command, *allowed;
char *name =
((void *)0)
;
struct sshbuf *c =
((void *)0)
, *data =
((void *)0)
;
int r, ret = -1, found;
if ((c = sshbuf_fromb(oblob)) ==
((void *)0)
) {
sshlog("auth-options.c", __func__, 82, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "sshbuf_fromb failed");
goto out;
}
while (sshbuf_len(c) > 0) {
sshbuf_free(data);
data =
((void *)0)
;
if ((r = sshbuf_get_cstring(c, &name,
((void *)0)
)) != 0 ||
(r = sshbuf_froms(c, &data)) != 0) {
sshlog("auth-options.c", __func__, 91, 0, SYSLOG_LEVEL_ERROR, ssh_err(r), "Unable to parse certificate options");
goto out;
}
sshlog("auth-options.c", __func__, 94, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "found certificate option \"%.100s\" len %zu", name, sshbuf_len(data))
;
found = 0;
if ((which & 2) != 0) {
if (strcmp(name, "no-touch-required") == 0) {
opts->no_require_user_presence = 1;
found = 1;
} else if (strcmp(name, "permit-X11-forwarding") == 0) {
opts->permit_x11_forwarding_flag = 1;
found = 1;
} else if (strcmp(name,
"permit-agent-forwarding") == 0) {
opts->permit_agent_forwarding_flag = 1;
found = 1;
} else if (strcmp(name,
"permit-port-forwarding") == 0) {
opts->permit_port_forwarding_flag = 1;
found = 1;
} else if (strcmp(name, "permit-pty") == 0) {
opts->permit_pty_flag = 1;
found = 1;
} else if (strcmp(name, "permit-user-rc") == 0) {
opts->permit_user_rc = 1;
found = 1;
}
}
if (!found && (which & 1) != 0) {
if (strcmp(name, "verify-required") == 0) {
opts->require_verify = 1;
found = 1;
} else if (strcmp(name, "force-command") == 0) {
if ((r = sshbuf_get_cstring(data, &command,
((void *)0)
)) != 0) {
sshlog("auth-options.c", __func__, 127, 0, SYSLOG_LEVEL_ERROR, ssh_err(r), "Unable to parse \"%s\" " "section", name)
;
goto out;
}
if (opts->force_command !=
((void *)0)
) {
sshlog("auth-options.c", __func__, 132, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Certificate has multiple " "force-command options")
;
free(command);
goto out;
}
opts->force_command = command;
found = 1;
} else if (strcmp(name, "source-address") == 0) {
if ((r = sshbuf_get_cstring(data, &allowed,
((void *)0)
)) != 0) {
sshlog("auth-options.c", __func__, 142, 0, SYSLOG_LEVEL_ERROR, ssh_err(r), "Unable to parse \"%s\" " "section", name)
;
goto out;
}
if (opts->required_from_host_cert !=
((void *)0)
) {
sshlog("auth-options.c", __func__, 147, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Certificate has multiple " "source-address options")
;
free(allowed);
goto out;
}
if (addr_match_cidr_list(
((void *)0)
, allowed) == -1) {
sshlog("auth-options.c", __func__, 154, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Certificate source-address " "contents invalid")
;
goto out;
}
opts->required_from_host_cert = allowed;
found = 1;
}
}
if (!found) {
if (crit) {
sshlog("auth-options.c", __func__, 165, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Certificate critical option \"%s\" " "is not supported", name)
;
goto out;
} else {
sshlog("auth-options.c", __func__, 169, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Certificate extension \"%s\" " "is not supported", name)
;
}
} else if (sshbuf_len(data) != 0) {
sshlog("auth-options.c", __func__, 173, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Certificate option \"%s\" corrupt " "(extra data)", name)
;
goto out;
}
free(name);
name =
((void *)0)
;
}
ret = 0;
out:
free(name);
sshbuf_free(data);
sshbuf_free(c);
return ret;
}
|
long cert_option_list(long a1, long a2, char a3, int a4)
{
long v4;
long v5;
char *v6;
long v7;
char *v8;
long v9;
unsigned int cstring;
unsigned int v14;
unsigned int v15;
unsigned int v16;
int v17;
void *ptr;
void *v19;
char *s1;
long v21;
long v22;
unsigned long v23;
v23 = __readfsqword(0x28u);
s1 = 0LL;
v21 = 0LL;
v16 = -1;
v22 = sshbuf_fromb(a2);
if ( v22 )
{
while ( sshbuf_len(v22) )
{
sshbuf_free(v21);
v21 = 0LL;
cstring = sshbuf_get_cstring(v22, &s1, 0LL);
if ( cstring || (cstring = sshbuf_froms(v22, &v21)) != 0 )
{
v4 = ssh_err(cstring);
sshlog("auth-options.c", "cert_option_list", 91LL, 0LL, 2LL, v4, "Unable to parse certificate options");
goto LABEL_46;
}
v5 = sshbuf_len(v21);
sshlog(
"auth-options.c",
"cert_option_list",
94LL,
0LL,
7LL,
0LL,
"found certificate option \"%.100s\" len %zu",
s1,
v5);
v17 = 0;
if ( (a3 & 2) != 0 )
{
if ( !strcmp(s1, "no-touch-required") )
{
*(_DWORD *)(a1 + 128) = 1;
v17 = 1;
}
else if ( !strcmp(s1, "permit-X11-forwarding") )
{
*(_DWORD *)(a1 + 8) = 1;
v17 = 1;
}
else if ( !strcmp(s1, "permit-agent-forwarding") )
{
*(_DWORD *)(a1 + 4) = 1;
v17 = 1;
}
else if ( !strcmp(s1, "permit-port-forwarding") )
{
*(_DWORD *)a1 = 1;
v17 = 1;
}
else if ( !strcmp(s1, "permit-pty") )
{
*(_DWORD *)(a1 + 12) = 1;
v17 = 1;
}
else if ( !strcmp(s1, "permit-user-rc") )
{
*(_DWORD *)(a1 + 16) = 1;
v17 = 1;
}
}
if ( !v17 && (a3 & 1) != 0 )
{
if ( !strcmp(s1, "verify-required") )
{
*(_DWORD *)(a1 + 132) = 1;
v17 = 1;
}
else if ( !strcmp(s1, "force-command") )
{
v14 = sshbuf_get_cstring(v21, &ptr, 0LL);
if ( v14 )
{
v6 = s1;
v7 = ssh_err(v14);
sshlog("auth-options.c", "cert_option_list", 127LL, 0LL, 2LL, v7, "Unable to parse \"%s\" section", v6);
goto LABEL_46;
}
if ( *(_QWORD *)(a1 + 56) )
{
sshlog(
"auth-options.c",
"cert_option_list",
132LL,
0LL,
2LL,
0LL,
"Certificate has multiple force-command options");
free(ptr);
goto LABEL_46;
}
*(_QWORD *)(a1 + 56) = ptr;
v17 = 1;
}
else if ( !strcmp(s1, "source-address") )
{
v15 = sshbuf_get_cstring(v21, &v19, 0LL);
if ( v15 )
{
v8 = s1;
v9 = ssh_err(v15);
sshlog("auth-options.c", "cert_option_list", 142LL, 0LL, 2LL, v9, "Unable to parse \"%s\" section", v8);
goto LABEL_46;
}
if ( *(_QWORD *)(a1 + 112) )
{
sshlog(
"auth-options.c",
"cert_option_list",
147LL,
0LL,
2LL,
0LL,
"Certificate has multiple source-address options");
free(v19);
goto LABEL_46;
}
if ( (unsigned int)addr_match_cidr_list(0LL, v19) == -1 )
{
sshlog(
"auth-options.c",
"cert_option_list",
154LL,
0LL,
2LL,
0LL,
"Certificate source-address contents invalid");
goto LABEL_46;
}
*(_QWORD *)(a1 + 112) = v19;
v17 = 1;
}
}
if ( v17 )
{
if ( sshbuf_len(v21) )
{
sshlog(
"auth-options.c",
"cert_option_list",
173LL,
0LL,
2LL,
0LL,
"Certificate option \"%s\" corrupt (extra data)",
s1);
goto LABEL_46;
}
}
else
{
if ( a4 )
{
sshlog(
"auth-options.c",
"cert_option_list",
165LL,
0LL,
2LL,
0LL,
"Certificate critical option \"%s\" is not supported",
s1);
goto LABEL_46;
}
sshlog(
"auth-options.c",
"cert_option_list",
169LL,
0LL,
3LL,
0LL,
"Certificate extension \"%s\" is not supported",
s1);
}
free(s1);
s1 = 0LL;
}
v16 = 0;
}
else
{
sshlog("auth-options.c", "cert_option_list", 82LL, 1LL, 2LL, 0LL, "sshbuf_fromb failed");
}
LABEL_46:
free(s1);
sshbuf_free(v21);
sshbuf_free(v22);
return v16;
}
|
int
_rl_pushed_input_available (void)
{
return (push_index != pop_index);
}
|
long long _rl_pushed_input_available() {
return push_index != pop_index;
}
|
static int
match_cfg_line_group(const char *grps, int line, const char *user)
{
int result = 0;
struct passwd *pw;
if (user ==
((void *)0)
)
goto out;
if ((pw = getpwnam(user)) ==
((void *)0)
) {
sshlog("servconf.c", __func__, 1005, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "Can't match group at line %d because user %.100s does " "not exist", line, user)
;
} else if (ga_init(pw->pw_name, pw->pw_gid) == 0) {
sshlog("servconf.c", __func__, 1008, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "Can't Match group because user %.100s not in any group " "at line %d", user, line)
;
} else if (ga_match_pattern_list(grps) != 1) {
sshlog("servconf.c", __func__, 1011, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "user %.100s does not match group list %.100s at line %d", user, grps, line)
;
} else {
sshlog("servconf.c", __func__, 1014, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "user %.100s matched group list %.100s at line %d", user, grps, line)
;
result = 1;
}
out:
ga_free();
return result;
}
|
long match_cfg_line_group(const char *a1, unsigned int a2, const char *a3)
{
unsigned int v5;
struct passwd *v6;
v5 = 0;
if ( a3 )
{
v6 = getpwnam(a3);
if ( v6 )
{
if ( (unsigned int)ga_init(v6->pw_name, v6->pw_gid) )
{
if ( (unsigned int)ga_match_pattern_list(a1) == 1 )
{
sshlog(
"servconf.c",
"match_cfg_line_group",
1014LL,
0LL,
5LL,
0LL,
"user %.100s matched group list %.100s at line %d",
a3,
a1,
a2);
v5 = 1;
}
else
{
sshlog(
"servconf.c",
"match_cfg_line_group",
1011LL,
0LL,
5LL,
0LL,
"user %.100s does not match group list %.100s at line %d",
a3,
a1,
a2);
}
}
else
{
sshlog(
"servconf.c",
"match_cfg_line_group",
1008LL,
0LL,
5LL,
0LL,
"Can't Match group because user %.100s not in any group at line %d",
a3,
a2);
}
}
else
{
sshlog(
"servconf.c",
"match_cfg_line_group",
1005LL,
0LL,
5LL,
0LL,
"Can't match group at line %d because user %.100s does not exist",
a2,
a3);
}
}
ga_free();
return v5;
}
|
static
_Bool
__valid_nh_group_attr(const struct rtattr *g_attr)
{
int num = ((int)((g_attr)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) / sizeof(struct nexthop_grp);
return num && num * sizeof(struct nexthop_grp) == ((int)((g_attr)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)));
}
|
int __valid_nh_group_attr(unsigned short *a0) {
unsigned int v0;
unsigned int v2;
unsigned int v3;
v0 = *(a0) - 4 >> 3;
if (v0 && v0 << 3 == *(a0) - 4) {
v2 = 1;
goto LABEL_40081c;
}
v2 = 0;
LABEL_40081c:
v3 = v2 & 1;
return v3;
}
|
void
cipher_free(struct sshcipher_ctx *cc)
{
if (cc ==
((void *)0)
)
return;
if ((cc->cipher->flags & (1<<1)) != 0) {
chachapoly_free(cc->cp_ctx);
cc->cp_ctx =
((void *)0)
;
} else if ((cc->cipher->flags & (1<<2)) != 0)
explicit_bzero(&cc->ac_ctx, sizeof(cc->ac_ctx));
EVP_CIPHER_CTX_free(cc->evp);
cc->evp =
((void *)0)
;
freezero(cc, sizeof(*cc));
}
|
void cipher_free(long param_1)
{
if (param_1 != 0) {
if ((*(uint *)(*(long *)(param_1 + 0x120) + 0x18) & 2) == 0) {
if ((*(uint *)(*(long *)(param_1 + 0x120) + 0x18) & 4) != 0) {
explicit_bzero(param_1 + 0x18,0x104);
}
}
else {
chachapoly_free(*(undefined8 *)(param_1 + 0x10));
*(undefined8 *)(param_1 + 0x10) = 0;
}
EVP_CIPHER_CTX_free(*(EVP_CIPHER_CTX **)(param_1 + 8));
*(undefined8 *)(param_1 + 8) = 0;
freezero(param_1,0x128);
}
return;
}
|
int
assertlongfilenames(const char *const *argv)
{
struct dpkg_version version = { 0, "1.4.1.17",
((void *)0)
};
return assert_version_support(argv, &version, gettext("long filenames"));
}
|
long long assertlongfilenames(unsigned long long *a0) {
unsigned int v0;
unsigned long long v1;
void* v2;
v0 = 0;
v1 = "1.4.1.17";
v2 = 0;
return assert_version_support(a0, &v0, gettext("long filenames"));
}
|
static void pdf_gen_xor(pdf_ctx *pc, const UINT8 nonce[8], UINT8 buf[8])
{
union {
UINT8 tmp_nonce_lo[4];
UINT32 align;
} t;
*(UINT32 *)t.tmp_nonce_lo = ((const UINT32 *)nonce)[1];
t.tmp_nonce_lo[3] &= ~0;
if ( (((UINT32 *)t.tmp_nonce_lo)[0] != ((UINT32 *)pc->nonce)[1]) ||
(((const UINT32 *)nonce)[0] != ((UINT32 *)pc->nonce)[0]) )
{
((UINT32 *)pc->nonce)[0] = ((const UINT32 *)nonce)[0];
((UINT32 *)pc->nonce)[1] = ((UINT32 *)t.tmp_nonce_lo)[0];
AES_encrypt((u_char *)(pc->nonce),(u_char *)(pc->cache),(AES_KEY *)pc->prf_key);
}
((UINT64 *)buf)[0] ^= ((UINT64 *)pc->cache)[0];
((UINT64 *)buf)[1] ^= ((UINT64 *)pc->cache)[1];
}
|
void pdf_gen_xor(struct_0 *a0, unsigned int a1[2], unsigned long long a2[2]) {
unsigned int v0;
char v1;
char v2;
unsigned long long *v4;
unsigned long long v5;
v0 = a1[1];
v1 = *(&v0 + 3);
if (v0 != a0->field_14 || a1[0] != a0->field_10) {
a0->field_10 = a1[0];
a0->field_14 = v0;
AES_encrypt(&a0->field_10, a0, &a0[1].field_8, &a0->field_10);
}
a2[0] = a2[0] ^ a0->field_0;
a2[1] = a0->field_8 ^ a2[1];
v5 = *(&v2) ^ v4[5];
return;
}
|
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;
do {
if (_rl_arg_overflow()) {
v5 = 1;
goto LABEL_402031;
}
v0 = _rl_arg_getchar();
v1 = _rl_vi_arg_dispatch(v0);
} while (v1 > 0);
v3 = rl_readline_state;
*(&v3) = (rl_readline_state >> 8) & 251;
tmp_7 = v3;
rl_readline_state = tmp_7;
v4 = 0;
LABEL_402031:
return;
}
|
ed_delete_next_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.lastchar) {
if (el->el_map.type == 1) {
if (el->el_line.cursor == el->el_line.buffer) {
return 6;
} else {
el->el_line.cursor--;
}
} else
return 6;
}
c_delafter(el, el->el_state.argument);
if (el->el_map.type == 1 &&
el->el_line.cursor >= el->el_line.lastchar &&
el->el_line.cursor > el->el_line.buffer)
el->el_line.cursor = el->el_line.lastchar - 1;
return 4;
}
|
long long ed_delete_next_char(struct_0 *a0, unsigned long a1) {
unsigned int v0;
unsigned long long v2;
v0 = a1;
if (a0->field_58 == a0->field_60) {
if (a0->field_420 != 1) {
v2 = 6;
return v2;
}
if (a0->field_58 == a0->field_50) {
v2 = 6;
return v2;
}
a0->field_58 = a0->field_58 - 4;
}
c_delafter(a0, a0->field_78, a0->field_78);
if (a0->field_420 != 1) {
v2 = 4;
return v2;
} else if (a0->field_58 < a0->field_60) {
v2 = 4;
return v2;
} else if (a0->field_58 <= a0->field_50) {
v2 = 4;
return v2;
} else {
a0->field_58 = a0->field_60 - 4;
v2 = 4;
return v2;
}
}
|
el_match(const wchar_t *str, const wchar_t *pat)
{
static ct_buffer_t conv;
regex_t re;
int rv;
if (wcsstr(str, pat) != 0)
return 1;
if (regcomp(&re, ct_encode_string(pat, &conv), 0) == 0) {
rv = regexec(&re, ct_encode_string(str, &conv), (size_t)0,
((void *)0)
,
0) == 0;
regfree(&re);
} else {
rv = 0;
}
return rv;
}
|
int el_match(unsigned short *a0, unsigned short *a1) {
unsigned int v0;
char v1;
unsigned int v3;
if (wcsstr(a0, a1)) {
v3 = 1;
return v3;
}
v3 = ct_encode_string(a1, &conv.5484);
if (regcomp(&v1, v3, 0x0, v3)) {
v0 = 0;
} else {
v0 = !regexec(&v1, ct_encode_string(a0, &conv.5484), 0x0, 0x0, 0x0);
regfree(&v1);
}
v3 = v0;
return v3;
}
|
int
rl_vi_next_word (int count, int key)
{
if (count < 0)
return (rl_vi_prev_word (-count, key));
if (rl_point >= (rl_end - 1))
{
rl_ding ();
return (0);
}
if ((1 && (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)key
))] & (unsigned short int) _ISupper)
)))
rl_vi_fWord (count, key);
else
rl_vi_fword (count, key);
return (0);
}
|
long rl_vi_next_word(int a1, unsigned char a2)
{
if ( a1 < 0 )
return rl_vi_prev_word(-a1, a2);
if ( rl_end - 1 > rl_point )
{
if ( ((*_ctype_b_loc())[a2] & 0x100) != 0 )
rl_vi_fWord(a1);
else
rl_vi_fword(a1);
return 0LL;
}
else
{
rl_ding();
return 0LL;
}
}
|
int
main (int argc, char **argv)
{
;
set_program_name (argv[0]);
setlocale (
6
, "");
bindtextdomain ("coreutils", "/usr/local/share/locale");
textdomain ("coreutils");
atexit (close_stdout);
parse_gnu_standard_options_only (argc, argv, "link", "GNU coreutils",
Version,
1
, usage, ("Michael Stone"),
(char const *)
((void *)0)
);
if (argc < optind + 2)
{
if (argc < optind + 1)
error (0, 0, gettext ("missing operand"));
else
error (0, 0, gettext ("missing operand after %s"), quote (argv[optind]));
usage (
1
);
}
if (optind + 2 < argc)
{
error (0, 0, gettext ("extra operand %s"), quote (argv[optind + 2]));
usage (
1
);
}
if (link (argv[optind], argv[optind + 1]) != 0)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"cannot create link %s to %s\"), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, gettext ("cannot create link %s to %s"), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, gettext ("cannot create link %s to %s"), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
return
0
;
}
|
int main(int argc, const char **argv, const char **envp)
{
char *v3;
long v4;
char *v5;
long v6;
char *v7;
long v8;
long v9;
char *v10;
int *v11;
set_program_name(*argv, argv, envp);
setlocale(6, locale);
bindtextdomain("coreutils", "/usr/local/share/locale");
textdomain("coreutils");
atexit((void (*)(void))&close_stdout);
parse_gnu_standard_options_only(
(unsigned int)argc,
argv,
"link",
"GNU coreutils",
Version,
1LL,
usage,
"Michael Stone",
0LL);
if ( argc <= optind + 1 )
{
if ( argc > optind )
{
v4 = quote(argv[optind]);
v5 = gettext("missing operand after %s");
error(0, 0, v5, v4);
}
else
{
v3 = gettext("missing operand");
error(0, 0, v3);
}
usage(1);
}
if ( argc > optind + 2 )
{
v6 = quote(argv[optind + 2]);
v7 = gettext("extra operand %s");
error(0, 0, v7, v6);
usage(1);
}
if ( link(argv[optind], argv[optind + 1]) )
{
v8 = quotearg_n_style(1LL, 4LL, argv[optind]);
v9 = quotearg_n_style(0LL, 4LL, argv[optind + 1]);
v10 = gettext("cannot create link %s to %s");
v11 = _errno_location();
error(1, *v11, v10, v9, v8);
}
return 0;
}
|
static
_Bool
isdir (char const *path)
{
struct stat sb;
if (stat (path, &sb) != 0)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"cannot stat %s\"), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, gettext ("cannot stat %s"), quotearg_style (shell_escape_always_quoting_style, path)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, gettext ("cannot stat %s"), quotearg_style (shell_escape_always_quoting_style, path)), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
return
((((
sb.st_mode
)) & 0170000) == (0040000))
;
}
|
int isdir(char *a0) {
char v0;
char v1;
unsigned int v3;
unsigned long long v4;
if (stat(a0, &v0)) {
v4 = quotearg_style(0x4, a0);
error(0x1, *(__errno_location()), gettext("cannot stat %s"));
}
v3 = *(&v1) & 0xf000;
*(&v3) = (*(&v1) & 0xf000) == 0x4000;
return v3;
}
|
void
throw_to_top_level ()
{
int print_newline = 0;
if (interrupt_state)
{
if (last_command_exit_value < 128)
last_command_exit_value = 128 +
2
;
set_pipestatus_from_exit (last_command_exit_value);
print_newline = 1;
interrupt_state--;
}
if (interrupt_state)
return;
last_command_exit_signal = (last_command_exit_value > 128) ?
(last_command_exit_value - 128) : 0;
last_command_exit_value |= 128;
set_pipestatus_from_exit (last_command_exit_value);
if (signal_is_trapped (
2
) && signal_is_pending (
2
))
run_interrupt_trap (1);
while (parse_and_execute_level)
parse_and_execute_cleanup (-1);
if (running_trap > 0)
{
run_trap_cleanup (running_trap - 1);
running_trap = 0;
}
give_terminal_to (shell_pgrp, 0);
restore_sigmask ();
reset_parser ();
if (interactive)
bashline_reset ();
unlink_fifo_list ();
run_unwind_protects ();
loop_level = continuing = breaking = funcnest = 0;
executing_list = comsub_ignore_return = return_catch_flag = wait_intr_flag = 0;
if (interactive && print_newline)
{
fflush (
stdout
);
fprintf (
stderr
, "\n");
fflush (
stderr
);
}
if (interactive || (interactive_shell && !shell_initialized) ||
(print_newline && signal_is_trapped (
2
)))
jump_to_top_level (2);
else
jump_to_top_level (3);
}
|
long throw_to_top_level()
{
long result;
int v1;
unsigned int v2;
int v3;
v3 = 0;
if ( interrupt_state )
{
if ( last_command_exit_value <= 127 )
last_command_exit_value = 130;
set_pipestatus_from_exit(last_command_exit_value);
v3 = 1;
--interrupt_state;
}
result = (unsigned int)interrupt_state;
if ( !interrupt_state )
{
if ( last_command_exit_value <= 128 )
v1 = 0;
else
v1 = last_command_exit_value - 128;
last_command_exit_signal = v1;
v2 = last_command_exit_value;
LOBYTE(v2) = last_command_exit_value | 0x80;
last_command_exit_value = v2;
set_pipestatus_from_exit(v2);
if ( (unsigned int)signal_is_trapped(2LL) && (unsigned int)signal_is_pending(2LL) )
run_interrupt_trap(1LL);
while ( parse_and_execute_level )
parse_and_execute_cleanup(0xFFFFFFFFLL);
if ( running_trap > 0 )
{
run_trap_cleanup((unsigned int)(running_trap - 1));
running_trap = 0;
}
give_terminal_to(shell_pgrp, 0LL);
restore_sigmask();
reset_parser();
if ( interactive )
bashline_reset();
unlink_fifo_list();
run_unwind_protects();
funcnest = 0;
breaking = 0;
continuing = 0;
loop_level = 0;
wait_intr_flag = 0;
return_catch_flag = 0;
comsub_ignore_return = 0;
executing_list = 0;
if ( interactive && v3 )
{
fflush(stdout);
fprintf(stderr, "\n");
fflush(stderr);
}
if ( !interactive && (!interactive_shell || shell_initialized) && (!v3 || !(unsigned int)signal_is_trapped(2LL)) )
jump_to_top_level(3);
jump_to_top_level(2);
}
return result;
}
|
int
shtimer_chktimeout (sh_timer *t)
{
struct timeval now;
int r;
if (t->flags & 0x01)
return t->alrmflag;
if (t->tmout.tv_sec == 0 && t->tmout.tv_usec == 0)
return 0;
if (gettimeofday (&now, 0) < 0)
return 0;
r = ((now.tv_sec > t->tmout.tv_sec) ||
(now.tv_sec == t->tmout.tv_sec && now.tv_usec >= t->tmout.tv_usec));
return r;
}
|
long long shtimer_chktimeout(struct_0 *a0) {
unsigned int v0;
char v1;
char v2;
void* v4;
unsigned int v5;
if ((a0->field_14 & 1)) {
v4 = a0->field_18;
} else {
if (!a0->field_0 && !a0->field_8)
v4 = 0;
if (a0->field_0 || a0->field_8) {
v5 = gettimeofday(&v1, NULL);
if (v5 < 0) {
v4 = 0;
} else {
if (*(&v1) <= a0->field_0 && (*(&v2) < a0->field_8 || *(&v1) != a0->field_0))
v5 = 0;
if (*(&v1) > a0->field_0 || *(&v1) == a0->field_0 && *(&v2) >= a0->field_8)
v5 = 1;
v0 = v5;
v4 = v0;
}
}
}
return v4;
}
|
int
sh_regmatch (string, pattern, flags)
const char *string;
const char *pattern;
int flags;
{
regex_t regex = { 0 };
regmatch_t *matches;
int rflags;
SHELL_VAR *rematch;
ARRAY *amatch;
int subexp_ind;
char *subexp_str;
int subexp_len;
int result;
rematch = (SHELL_VAR *)
((void *)0)
;
rflags =
1
;
if (match_ignore_case)
rflags |=
(1 << 1)
;
if (regcomp (®ex, pattern, rflags))
return 2;
matches = (regmatch_t *)sh_malloc((sizeof (regmatch_t) * (regex.re_nsub + 1)), "shmatch.c", 81);
if (regexec (®ex, string, matches ? regex.re_nsub + 1 : 0, matches, 0))
result = 1;
else
result = 0;
subexp_len = strlen (string) + 10;
subexp_str = sh_malloc((subexp_len + 1), "shmatch.c", 94);
unbind_global_variable_noref ("BASH_REMATCH");
rematch = make_new_array_variable ("BASH_REMATCH");
amatch = rematch ? (ARRAY *)((rematch)->value) : (ARRAY *)0;
if (matches && amatch && (flags & 0x001) && result == 0 && subexp_str)
{
for (subexp_ind = 0; subexp_ind <= regex.re_nsub; subexp_ind++)
{
memset (subexp_str, 0, subexp_len);
strncpy (subexp_str, string + matches[subexp_ind].rm_so,
matches[subexp_ind].rm_eo - matches[subexp_ind].rm_so);
array_insert (amatch, subexp_ind, subexp_str);
}
}
sh_xfree((subexp_str), "shmatch.c", 123);
sh_xfree((matches), "shmatch.c", 124);
regfree (®ex);
return result;
}
|
long long sh_regmatch(char *a0, unsigned long long a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
struct_1 *v4;
unsigned int *v5;
void* v6;
void* v7;
void* v8;
void* v9;
void* v10;
void* v11;
void* v12;
void* v13;
void* v14;
void* v15;
unsigned long long v18;
void* v20;
v8 = 0;
v9 = 0;
v10 = 0;
v11 = 0;
v12 = 0;
v13 = 0;
v14 = 0;
v15 = 0;
v4 = 0;
v0 = 1;
if (match_ignore_case)
v0 |= 2;
if (regcomp(&v8, a1, v0, a1)) {
v18 = 2;
} else {
v5 = sh_malloc((v14 + 1) * 8, "shmatch.c", 0x51);
if (regexec(&v8, a0))
v2 = 1;
else
v2 = 0;
v3 = strlen(a0) + 10;
v6 = sh_malloc(v3 + 1, "shmatch.c", 0x5e);
unbind_global_variable_noref("BASH_REMATCH");
v4 = make_new_array_variable("BASH_REMATCH");
if (v4)
v20 = v4->field_8;
else
v20 = 0;
v7 = v20;
if (v5 && v7 && (a2 & 1) && !v2 && v6) {
for (v1 = 0; v1 <= v14; v1 += 1) {
memset(v6, 0x0, v3);
strncpy(v6, &a0[v5[2 * v1]], v5[1 + 2 * v1] - v5[2 * v1]);
array_insert(v7, v1, v6, v1);
}
}
sh_xfree(v6, "shmatch.c", 0x7b);
sh_xfree(v5, "shmatch.c", 0x7c);
regfree(&v8);
v18 = v2;
}
return v18;
}
|
static int
execute_while_command (while_command)
WHILE_COM *while_command;
{
return (execute_while_or_until (while_command, 0));
}
|
long long execute_while_command(unsigned long long a0) {
return execute_while_or_until(a0, 0);
}
|
void
sock_set_v6only(int s)
{
int on = 1;
sshlog("misc.c", __func__, 1921, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "%s: set socket %d IPV6_V6ONLY", __func__, s);
if (setsockopt(s,
IPPROTO_IPV6
,
26
, &on, sizeof(on)) == -1)
sshlog("misc.c", __func__, 1923, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "setsockopt IPV6_V6ONLY: %s", strerror(
(*__errno_location ())
));
}
|
void sock_set_v6only(int param_1)
{
int iVar1;
int *piVar2;
char *pcVar3;
long in_FS_OFFSET;
undefined4 local_14;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_14 = 1;
sshlog("misc.c","sock_set_v6only",0x781,0,7,0,"%s: set socket %d IPV6_V6ONLY","sock_set_v6only",
param_1);
iVar1 = setsockopt(param_1,0x29,0x1a,&local_14,4);
if (iVar1 == -1) {
piVar2 = __errno_location();
pcVar3 = strerror(*piVar2);
sshlog("misc.c","sock_set_v6only",0x783,0,2,0,"setsockopt IPV6_V6ONLY: %s",pcVar3);
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
void
usage (int status)
{
if (status !=
0
)
do { fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
else
{
printf (gettext ("Usage: %s [OPTION]... [FILE]...\n or: %s [-abcdfilosx]... [FILE] [[+]OFFSET[.][b]]\n or: %s --traditional [OPTION]... [FILE] [[+]OFFSET[.][b] [+][LABEL][.][b]]\n")
,
program_name, program_name, program_name);
fputs_unlocked (gettext ("\nWrite an unambiguous representation, octal bytes by default,\nof FILE to standard output. With more than one FILE argument,\nconcatenate them in the listed order to form the input.\n"),
stdout
)
;
emit_stdin_note ();
fputs_unlocked (gettext ("\nIf first and second call formats both apply, the second format is assumed\nif the last operand begins with + or (if there are 2 operands) a digit.\nAn OFFSET operand means -j OFFSET. LABEL is the pseudo-address\nat first byte printed, incremented when dump is progressing.\nFor OFFSET and LABEL, a 0x or 0X prefix indicates hexadecimal;\nsuffixes may be . for octal and b for multiply by 512.\n"),
stdout
)
;
emit_mandatory_arg_note ();
fputs_unlocked (gettext (" -A, --address-radix=RADIX output format for file offsets; RADIX is one\n of [doxn], for Decimal, Octal, Hex or None\n --endian={big|little} swap input bytes according the specified order\n -j, --skip-bytes=BYTES skip BYTES input bytes first\n"),
stdout
)
;
fputs_unlocked (gettext (" -N, --read-bytes=BYTES limit dump to BYTES input bytes\n -S BYTES, --strings[=BYTES] output strings of at least BYTES graphic chars;\n 3 is implied when BYTES is not specified\n -t, --format=TYPE select output format or formats\n -v, --output-duplicates do not use * to mark line suppression\n -w[BYTES], --width[=BYTES] output BYTES bytes per output line;\n 32 is implied when BYTES is not specified\n --traditional accept arguments in third form above\n"),
stdout
)
;
fputs_unlocked (gettext (" --help display this help and exit\n"),
stdout
);
fputs_unlocked (gettext (" --version output version information and exit\n"),
stdout
);
fputs_unlocked (gettext ("\n\nTraditional format specifications may be intermixed; they accumulate:\n -a same as -t a, select named characters, ignoring high-order bit\n -b same as -t o1, select octal bytes\n -c same as -t c, select printable characters or backslash escapes\n -d same as -t u2, select unsigned decimal 2-byte units\n"),
stdout
)
;
fputs_unlocked (gettext (" -f same as -t fF, select floats\n -i same as -t dI, select decimal ints\n -l same as -t dL, select decimal longs\n -o same as -t o2, select octal 2-byte units\n -s same as -t d2, select decimal 2-byte units\n -x same as -t x2, select hexadecimal 2-byte units\n"),
stdout
)
;
fputs_unlocked (gettext ("\n\nTYPE is made up of one or more of these specifications:\n a named character, ignoring high-order bit\n c printable character or backslash escape\n"),
stdout
)
;
fputs_unlocked (gettext (" d[SIZE] signed decimal, SIZE bytes per integer\n f[SIZE] floating point, SIZE bytes per float\n o[SIZE] octal, SIZE bytes per integer\n u[SIZE] unsigned decimal, SIZE bytes per integer\n x[SIZE] hexadecimal, SIZE bytes per integer\n"),
stdout
)
;
fputs_unlocked (gettext ("\nSIZE is a number. For TYPE in [doux], SIZE may also be C for\nsizeof(char), S for sizeof(short), I for sizeof(int) or L for\nsizeof(long). If TYPE is f, SIZE may also be F for sizeof(float), D\nfor sizeof(double) or L for sizeof(long double).\n"),
stdout
)
;
fputs_unlocked (gettext ("\nAdding a z suffix to any type displays printable characters at the end of\neach output line.\n"),
stdout
)
;
fputs_unlocked (gettext ("\n\nBYTES is hex with 0x or 0X prefix, and may have a multiplier suffix:\n b 512\n KB 1000\n K 1024\n MB 1000*1000\n M 1024*1024\nand so on for G, T, P, E, Z, Y.\nBinary prefixes can be used, too: KiB=K, MiB=M, and so on.\n"),
stdout
)
;
emit_ancillary_info ("od");
}
exit (status);
}
|
void usage(unsigned long a0) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned long v4;
unsigned long v5;
unsigned long v6;
v2 = v4;
v1 = v5;
v0 = v6;
if (a0) {
fprintf(stderr, gettext("Try '%s --help' for more information.\n"));
} else {
printf(gettext("Usage: %s [OPTION]... [FILE]...\n or: %s [-abcdfilosx]... [FILE] [[+]OFFSET[.][b]]\n or: %s --traditional [OPTION]... [FILE] [[+]OFFSET[.][b] [+][LABEL][.][b]]\n"));
fputs_unlocked(gettext("\nWrite an unambiguous representation, octal bytes by default,\nof FILE to standard output. With more than one FILE argument,\nconcatenate them in the listed order to form the input.\n"), stdout);
emit_stdin_note();
fputs_unlocked(gettext("\nIf first and second call formats both apply, the second format is assumed\nif the last operand begins with + or (if there are 2 operands) a digit.\nAn OFFSET operand means -j OFFSET. LABEL is the pseudo-address\nat first byte printed, incremented when dump is progressing.\nFor OFFSET and LABEL, a 0x or 0X prefix indicates hexadecimal;\nsuffixes may be . for octal and b for multiply by 512.\n"), stdout);
emit_mandatory_arg_note();
fputs_unlocked(gettext(" -A, --address-radix=RADIX output format for file offsets; RADIX is one\n of [doxn], for Decimal, Octal, Hex or None\n --endian={big|little} swap input bytes according the specified order\n -j, --skip-bytes=BYTES skip BYTES input bytes first\n"), stdout);
fputs_unlocked(gettext(" -N, --read-bytes=BYTES limit dump to BYTES input bytes\n -S BYTES, --strings[=BYTES] output strings of at least BYTES graphic chars;\n 3 is implied when BYTES is not specified\n -t, --format=TYPE select output format or formats\n -v, --output-duplicates do not use * to mark line suppression\n -w[BYTES], --width[=BYTES] output BYTES bytes per output line;\n 32 is implied when BYTES is not specified\n --traditional accept arguments in third form above\n"), stdout);
fputs_unlocked(gettext(" --help display this help and exit\n"), stdout);
fputs_unlocked(gettext(" --version output version information and exit\n"), stdout);
fputs_unlocked(gettext("\n\nTraditional format specifications may be intermixed; they accumulate:\n -a same as -t a, select named characters, ignoring high-order bit\n -b same as -t o1, select octal bytes\n -c same as -t c, select printable characters or backslash escapes\n -d same as -t u2, select unsigned decimal 2-byte units\n"), stdout);
fputs_unlocked(gettext(" -f same as -t fF, select floats\n -i same as -t dI, select decimal ints\n -l same as -t dL, select decimal longs\n -o same as -t o2, select octal 2-byte units\n -s same as -t d2, select decimal 2-byte units\n -x same as -t x2, select hexadecimal 2-byte units\n"), stdout);
fputs_unlocked(gettext("\n\nTYPE is made up of one or more of these specifications:\n a named character, ignoring high-order bit\n c printable character or backslash escape\n"), stdout);
fputs_unlocked(gettext(" d[SIZE] signed decimal, SIZE bytes per integer\n f[SIZE] floating point, SIZE bytes per float\n o[SIZE] octal, SIZE bytes per integer\n u[SIZE] unsigned decimal, SIZE bytes per integer\n x[SIZE] hexadecimal, SIZE bytes per integer\n"), stdout);
fputs_unlocked(gettext("\nSIZE is a number. For TYPE in [doux], SIZE may also be C for\nsizeof(char), S for sizeof(short), I for sizeof(int) or L for\nsizeof(long). If TYPE is f, SIZE may also be F for sizeof(float), D\nfor sizeof(double) or L for sizeof(long double).\n"), stdout);
fputs_unlocked(gettext("\nAdding a z suffix to any type displays printable characters at the end of\neach output line.\n"), stdout);
fputs_unlocked(gettext("\n\nBYTES is hex with 0x or 0X prefix, and may have a multiplier suffix:\n b 512\n KB 1000\n K 1024\n MB 1000*1000\n M 1024*1024\nand so on for G, T, P, E, Z, Y.\nBinary prefixes can be used, too: KiB=K, MiB=M, and so on.\n"), stdout);
emit_ancillary_info("od");
}
exit(a0);
}
|
void
auth_restrict_session(struct ssh *ssh)
{
struct sshauthopt *restricted;
sshlog("auth.c", __func__, 847, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "restricting session");
if ((restricted = sshauthopt_new()) ==
((void *)0)
)
sshfatal("auth.c", __func__, 851, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshauthopt_new failed");
restricted->permit_pty_flag = 1;
restricted->restricted = 1;
if (auth_activate_options(ssh, restricted) != 0)
sshfatal("auth.c", __func__, 856, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "failed to restrict session");
sshauthopt_free(restricted);
}
|
long long auth_restrict_session(unsigned int a0) {
unsigned long long v0;
char v1;
sshlog("auth.c", "auth_restrict_session", 0x34f, 0x1, 0x5, 0x0, "restricting session");
v0 = sshauthopt_new("auth.c", "auth_restrict_session", 0x34f, 0x1, 0x5, 0x0, *(&v1));
if (!v0)
sshfatal("auth.c", "auth_restrict_session", 0x353, 0x1, 0x1, 0x0, "sshauthopt_new failed");
*((v0 + 12)) = 1;
*((v0 + 20)) = 1;
if (auth_activate_options(a0, v0)) {
v0 = "failed to restrict session";
sshfatal("auth.c", "auth_restrict_session", 0x358, 0x1, 0x1, 0x0, *(&v1));
}
return sshauthopt_free(v0);
}
|
(*__errno_location ())
= saved_errno;
do { if ((
ctx
) && (
ctx
)->error) (
ctx
)->error((
ctx
),
gettext("preserving permissions for %s"), qpath
); } while(0)
|
int * __errno_location(void)
{
halt_baddata();
}
|
static inline __u8 rta_getattr_u8(const struct rtattr *rta)
{
return *(__u8 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
|
int rta_getattr_u8(struct_0 *a0) {
return a0->field_4;
}
|
static gnutls_digest_algorithm_t get_dig_for_pub(gnutls_pubkey_t pubkey, common_info_st * cinfo)
{
gnutls_digest_algorithm_t dig;
int result;
unsigned int mand;
result =
gnutls_pubkey_get_preferred_hash_algorithm(pubkey, &dig,
&mand);
if (result < 0) {
{
fprintf(
stderr
,
"crt_get_preferred_hash_algorithm: %s\n",
gnutls_strerror(result));
app_exit(1);
}
}
if (mand == 0 && cinfo->hash != GNUTLS_DIG_UNKNOWN)
dig = cinfo->hash;
return dig;
}
|
int get_dig_for_pub(unsigned long long a0, struct_0 *a1) {
unsigned int v0;
char v1;
unsigned int v2;
v2 = gnutls_pubkey_get_preferred_hash_algorithm(a0, &v0, &v1, &v0);
if (v2 < 0) {
fprintf(stderr, "crt_get_preferred_hash_algorithm: %s\n", gnutls_strerror(v2));
app_exit(0x1);
}
if (!*(&v1) && a1->field_b0)
v0 = a1->field_b0;
return v0;
}
|
static int check_encrypted_dirent(e2fsck_t ctx,
const struct ext2_dir_entry *dirent,
__u32 dir_encpolicy_id,
struct problem_context *pctx)
{
if (encrypted_check_name(ctx, dirent, pctx))
return 1;
if (check_encryption_policy(ctx, dirent, dir_encpolicy_id, pctx))
return 1;
return 0;
}
|
_BOOL8 check_encrypted_dirent(_QWORD *a1, unsigned int *a2, int a3, long a4)
{
return (unsigned int)encrypted_check_name(a1, (long)a2, a4)
|| (unsigned int)check_encryption_policy((long)a1, a2, a3, a4) != 0;
}
|
void
enter_raw_mode(int quiet)
{
struct termios tio;
if (tcgetattr(fileno(
stdin
), &tio) == -1) {
if (!quiet)
perror("tcgetattr");
return;
}
_saved_tio = tio;
tio.c_iflag |=
0000004
;
tio.c_iflag &= ~(
0000040
|
0000100
|
0000200
|
0000400
|
0002000
|
0004000
|
0010000
);
tio.c_iflag &= ~
0001000
;
tio.c_lflag &= ~(
0000001
|
0000002
|
0000010
|
0000020
|
0000040
|
0000100
);
tio.c_lflag &= ~
0100000
;
tio.c_oflag &= ~
0000001
;
tio.c_cc[
6
] = 1;
tio.c_cc[
5
] = 0;
if (tcsetattr(fileno(
stdin
),
1
, &tio) == -1) {
if (!quiet)
perror("tcsetattr");
} else
_in_raw_mode = 1;
}
|
long long enter_raw_mode(unsigned long a0) {
unsigned int v0;
int tmp_117;
int tmp_138;
unsigned int v1;
char v2;
unsigned int v3;
char v4;
char v5;
char v6;
char v7;
char v8;
char v9;
char v10;
char v11;
unsigned long long v13;
unsigned long long v14;
if (tcgetattr(fileno(stdin), &v0) != -1) {
_saved_tio = *(&v0);
g_4001e8 = *(&v2);
g_4001f0 = *(&v4);
g_4001f8 = *(&v7);
g_400200 = *(&v8);
g_400208 = *(&v9);
g_400210 = *(&v10);
g_400218 = *(&v11);
v0 = *(&v0) | 4;
v0 &= -7649;
v13 = v0;
*(&v13) = (v0 >> 8) & 253;
tmp_117 = v13;
v0 = tmp_117;
v3 = *(&(&v2)[4]) & -124;
v14 = v3;
*(&v14) = (v3 >> 8) & 127;
tmp_138 = v14;
v3 = tmp_138;
v1 = *(&(&v0)[4]) & -2;
v6 = 1;
v5 = 0;
if (tcsetattr(fileno(stdin), 0x1, &v0) != -1) {
_in_raw_mode = 1;
return 0;
}
if (a0)
return 0;
perror("tcsetattr");
return 0;
} else if (a0) {
return 0;
} else {
perror("tcgetattr");
return 0;
}
}
|
static inline void hlist_del(struct hlist_node *n)
{
struct hlist_node *next = n->next;
struct hlist_node **pprev = n->pprev;
*pprev = next;
if (next)
next->pprev = pprev;
}
|
void hlist_del(long *param_1)
{
long lVar1;
long *plVar2;
lVar1 = *param_1;
plVar2 = (long *)param_1[1];
*plVar2 = lVar1;
if (lVar1 != 0) {
*(long **)(lVar1 + 8) = plVar2;
}
return;
}
|
static
_Bool
is_valid_user_list (const char *users)
{
const char *username;
char *end;
_Bool
is_valid =
1
;
char *tmpusers = xstrdup (users);
for (username = tmpusers;
(
((void *)0)
!= username) && ('\0' != *username);
username = end) {
end = strchr (username, ',');
if (
((void *)0)
!= end) {
*end = '\0';
end++;
}
if (getpwnam (username) ==
((void *)0)
) {
fprintf (
stderr
, gettext ("%s: user '%s' does not exist\n"),
Prog, username);
is_valid =
0
;
}
}
free (tmpusers);
return is_valid;
}
|
long is_valid_user_list(long a1)
{
long v1;
char *v2;
unsigned char v4;
char *s;
char *v6;
char *ptr;
v4 = 1;
ptr = (char *)xstrdup(a1);
for ( s = ptr; s && *s; s = v6 )
{
v6 = strchr(s, 44);
if ( v6 )
*v6++ = 0;
if ( !getpwnam(s) )
{
v1 = Prog;
v2 = gettext("%s: user '%s' does not exist\n");
fprintf(stderr, v2, v1, s);
v4 = 0;
}
}
free(ptr);
return v4;
}
|
static char *
scan_diff_line (char *scan_ptr, char **set_start, size_t *set_length,
char *limit, char leadingchar)
{
char *line_ptr;
if (!(scan_ptr[0] == leadingchar
&& scan_ptr[1] == ' '))
fatal ("invalid diff format; incorrect leading line chars");
*set_start = line_ptr = scan_ptr + 2;
while (*line_ptr++ != '\n')
continue;
*set_length = line_ptr - *set_start;
if (line_ptr < limit && *line_ptr == '\\')
{
if (edscript)
fprintf (
stderr
, "%s:", program_name);
else
--*set_length;
line_ptr++;
do
{
if (edscript)
putc_unlocked (*line_ptr,
stderr
);
}
while (*line_ptr++ != '\n');
}
return line_ptr;
}
|
int scan_diff_line(char a0[2], unsigned long long *a1, unsigned long long *a2, unsigned long a3, unsigned long a4) {
unsigned long long *v0;
int tmp_9;
char *v1;
char v3;
v0 = a2;
if (a4 == a0[0] && a0[1] == 32) {
v1 = &a0[1];
*(a1) = v1;
do {
tmp_9 = v1;
v1 += 1;
v3 = *(tmp_9);
} while (v3 != 10);
*(a2) = &v1[-1 * *(a1)];
if (v1 < a3 && *(v1) == 92) {
if (!edscript)
*(a2) = *(a2) - 1;
else
fprintf(stderr, "%s:", program_name);
v1 += 1;
do {
if (edscript)
putc_unlocked(*(v1), stderr);
tmp_9 = v1;
v1 += 1;
} while (*(tmp_9) != 10);
}
return v1;
}
fatal("invalid diff format; incorrect leading line chars");
}
|
static int
make_ancestor (char const *dir, char const *component, void *options)
{
struct cp_options const *x = options;
if (x->set_security_context
&& defaultcon (x->set_security_context, component,
0040000
) < 0
&& ! ignorable_ctx_err (
(*__errno_location ())
))
error (0,
(*__errno_location ())
, gettext ("failed to set default creation context for %s"),
quotearg_style (shell_escape_always_quoting_style, dir));
int r = mkdir (component, (
(0400|0200|0100)
|
(0400 >> 3)
|
(0100 >> 3)
|
((0400 >> 3) >> 3)
|
((0100 >> 3) >> 3)
));
if (r == 0)
announce_mkdir (dir, options);
return r;
}
|
long long make_ancestor(unsigned long long a0, char *a1, struct_0 *a2) {
unsigned int v0;
unsigned long long v3;
if (a2->field_28 && defaultcon(a2->field_28, a1, 0x4000, a1) < 0 && (ignorable_ctx_err(*(__errno_location())) ^ 1)) {
v3 = quotearg_style(0x4, a0);
error(0x0, *(__errno_location()), gettext("failed to set default creation context for %s"));
}
v0 = mkdir(a1, 0x1ed);
if (!v0)
announce_mkdir(a0, a2);
return v0;
}
|
void e2fsck_clear_progbar(e2fsck_t ctx)
{
if (!(ctx->flags & 0x0020))
return;
printf("%s%s\r%s", ctx->start_meta, spaces + (sizeof(spaces) - 80),
ctx->stop_meta);
fflush(
stdout
);
ctx->flags &= ~0x0020;
}
|
void e2fsck_clear_progbar(long param_1)
{
if ((*(uint *)(param_1 + 0x48) & 0x20) != 0) {
printf("%s%s\r%s",param_1 + 0x2dc,0x1069d0,param_1 + 0x2de);
fflush(stdout);
*(uint *)(param_1 + 0x48) = *(uint *)(param_1 + 0x48) & 0xffffffdf;
}
return;
}
|
static void pqdownheap(s, tree, k)
deflate_state *s;
ct_data *tree;
int k;
{
int v = s->heap[k];
int j = k << 1;
while (j <= s->heap_len) {
if (j < s->heap_len &&
(tree[s->heap[j + 1]].fc.freq < tree[s->heap[j]].fc.freq || (tree[s->heap[j + 1]].fc.freq == tree[s->heap[j]].fc.freq && s->depth[s->heap[j + 1]] <= s->depth[s->heap[j]]))) {
j++;
}
if ((tree[v].fc.freq < tree[s->heap[j]].fc.freq || (tree[v].fc.freq == tree[s->heap[j]].fc.freq && s->depth[v] <= s->depth[s->heap[j]]))) break;
s->heap[k] = s->heap[j]; k = j;
j <<= 1;
}
s->heap[k] = v;
}
|
void pqdownheap(unsigned int a0[1326], unsigned short *a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v5[1326];
v0 = a2;
v2 = a0[752 + v0];
v1 = v0 * 2;
while (true) {
if (v1 > a0[1325])
break;
if (v1 < a0[1325]) {
if (!([D] amd64g_calculate_condition(0x2<64>, 0x6<64>, Conv(16->64, Load(addr=(rsi<8> + (Conv(32->s64, Load(addr=(rdi<8> + (Conv(32->64, (Load(addr=stack_base-16, size=4, endness=Iend_LE) + 0x2f1<32>)) << 0x2<8>)), size=4, endness=Iend_LE)) << 0x2<8>)), size=2, endness=Iend_LE)), Conv(16->64, Load(addr=(rsi<8> + (Conv(32->s64, Load(addr=(rdi<8> + (Conv(32->s64, (Load(addr=stack_base-16, size=4, endness=Iend_LE) + 0x2f0<32>)) << 0x2<8>)), size=4, endness=Iend_LE)) << 0x2<8>)), size=2, endness=Iend_LE)), cc_ndep<8>))) {
if (!(a1[2 * a0[753 + v1]] == a1[2 * a0[752 + v1]]))
goto LABEL_4002f3;
if (!(*(5308 + &a0[0] + a0[753 + v1]) <= *(5308 + &a0[0] + a0[752 + v1])))
goto LABEL_4002f3;
}
v1 += 1;
}
LABEL_4002f3:
if ([D] amd64g_calculate_condition(0x2<64>, 0x6<64>, Conv(16->64, Load(addr=(rsi<8> + (Conv(32->s64, Load(addr=(rdi<8> + (Conv(32->64, (Load(addr=stack_base-16, size=4, endness=Iend_LE) + 0x2f1<32>)) << 0x2<8>)), size=4, endness=Iend_LE)) << 0x2<8>)), size=2, endness=Iend_LE)), Conv(16->64, Load(addr=(rsi<8> + (Conv(32->s64, Load(addr=(rdi<8> + (Conv(32->s64, (Load(addr=stack_base-16, size=4, endness=Iend_LE) + 0x2f0<32>)) << 0x2<8>)), size=4, endness=Iend_LE)) << 0x2<8>)), size=2, endness=Iend_LE)), cc_ndep<8>))
break;
if (a1[2 * v2] == a1[2 * a0[752 + v1]] && *(5308 + &a0[0] + v2) <= *(5308 + &a0[0] + a0[752 + v1]))
break;
a0[752 + v0] = a0[752 + v1];
v0 = v1;
v1 *= 2;
}
v5 = a0;
a0[752 + v0] = v2;
return;
}
|
static void
parse_cert_times(char *timespec)
{
char *from, *to;
time_t now = time(
((void *)0)
);
int64_t secs;
if (*timespec == '+' && strchr(timespec, ':') ==
((void *)0)
) {
if ((secs = convtime(timespec + 1)) == -1)
sshfatal("ssh-keygen.c", __func__, 1944, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Invalid relative certificate life %s", timespec);
cert_valid_to = now + secs;
cert_valid_from = ((now - 59)/ 60) * 60;
return;
}
from = xstrdup(timespec);
to = strchr(from, ':');
if (to ==
((void *)0)
|| from == to || *(to + 1) == '\0')
sshfatal("ssh-keygen.c", __func__, 1962, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Invalid certificate life specification %s", timespec);
*to++ = '\0';
if (*from == '-' || *from == '+')
cert_valid_from = parse_relative_time(from, now);
else if (strcmp(from, "always") == 0)
cert_valid_from = 0;
else if (strncmp(from, "0x", 2) == 0)
parse_hex_u64(from, &cert_valid_from);
else if (parse_absolute_time(from, &cert_valid_from) != 0)
sshfatal("ssh-keygen.c", __func__, 1972, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Invalid from time \"%s\"", from);
if (*to == '-' || *to == '+')
cert_valid_to = parse_relative_time(to, now);
else if (strcmp(to, "forever") == 0)
cert_valid_to = ~(u_int64_t)0;
else if (strncmp(from, "0x", 2) == 0)
parse_hex_u64(to, &cert_valid_to);
else if (parse_absolute_time(to, &cert_valid_to) != 0)
sshfatal("ssh-keygen.c", __func__, 1981, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Invalid to time \"%s\"", to);
if (cert_valid_to <= cert_valid_from)
sshfatal("ssh-keygen.c", __func__, 1984, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Empty certificate validity interval");
free(from);
}
|
void parse_cert_times(char *a0) {
char *v0;
int tmp_11;
unsigned long v1;
unsigned long long v2;
char *v3;
unsigned long long v4;
char *v5;
char v6;
unsigned long long v8;
unsigned long long v10;
v1 = time(NULL);
if (*(a0) == 43 && !strchr(a0, 0x3a)) {
v2 = convtime(a0 + 1);
if (v2 == -1) {
v0 = a0;
sshfatal("ssh-keygen.c", "parse_cert_times", 0x798, 0x0, 0x1, 0x0, "Invalid relative certificate life %s");
}
cert_valid_to = __addvdi3(v1, v2);
v8 = __addvdi3(v1, 0xffffffffffffffc5);
*(&cert_valid_from) = __mulvdi3(((v8 * 9838263505978427529 >> 64) + v8 >> 5) - (v8 >> 63), 0x3c);
goto LABEL_40792a;
}
v3 = xstrdup(a0);
*(&v4) = strchr(v3, 0x3a);
if (v4 && v3 != v4 && !(!v4[1]))
goto LABEL_407708;
v0 = a0;
sshfatal("ssh-keygen.c", "parse_cert_times", 0x7aa, 0x0, 0x1, 0x0, "Invalid certificate life specification %s");
LABEL_407708:
tmp_11 = v4;
v4 = &v4[1];
*(tmp_11) = 0;
if (*(v3) == 45) {
LABEL_40772d:
cert_valid_from = parse_relative_time(v3, v1);
} else {
if (*(v3) == 43)
goto LABEL_40772d;
if (!strcmp(v3, "always")) {
cert_valid_from = 0;
} else if (!strncmp(v3, "0x", 0x2)) {
parse_hex_u64(v3, &cert_valid_from);
} else if (parse_absolute_time(v3, &cert_valid_from)) {
v5 = v3;
v4 = "Invalid from time \"%s\"";
sshfatal("ssh-keygen.c", "parse_cert_times", 0x7b4, 0x0, 0x1, 0x0, *(&v6));
}
}
if (*(v4) == 45) {
LABEL_40780a:
cert_valid_to = parse_relative_time(v4, v1);
} else {
if (*(v4) == 43)
goto LABEL_40780a;
if (!strcmp(v4, "forever")) {
cert_valid_to = -1;
} else if (!strncmp(v3, "0x", 0x2)) {
parse_hex_u64(v4, &cert_valid_to);
} else if (parse_absolute_time(v4, &cert_valid_to)) {
v5 = v4;
v4 = "Invalid to time \"%s\"";
sshfatal("ssh-keygen.c", "parse_cert_times", 0x7bd, 0x0, 0x1, 0x0, *(&v6));
}
}
if (cert_valid_to <= cert_valid_from) {
v4 = "Empty certificate validity interval";
sshfatal("ssh-keygen.c", "parse_cert_times", 0x7c0, 0x0, 0x1, 0x0, *(&v6));
}
v10 = free(v3);
LABEL_40792a:
return;
}
|
static void print_slave_oper_state(FILE *fp, const char *name, __u16 state)
{
open_json_array(PRINT_ANY, name);
print_string(PRINT_FP,
((void *)0)
, " <",
((void *)0)
);
if (state & 0x1) { state &= ~0x1; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "active"); };
if (state & 0x2) { state &= ~0x2; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "short_timeout"); };
if (state & 0x4) { state &= ~0x4; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "aggregating"); };
if (state & 0x8) { state &= ~0x8; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "in_sync"); };
if (state & 0x10) { state &= ~0x10; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "collecting"); };
if (state & 0x20) { state &= ~0x20; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "distributing"); };
if (state & 0x40) { state &= ~0x40; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "defaulted"); };
if (state & 0x80) { state &= ~0x80; print_string(PRINT_ANY,
((void *)0)
, state ? "%s," : "%s", "expired"); };
close_json_array(PRINT_ANY, "> ");
}
|
long print_slave_oper_state(long a1, long a2, short a3)
{
const char *v3;
const char *v4;
const char *v5;
const char *v6;
const char *v7;
const char *v8;
const char *v9;
const char *v10;
open_json_array(4LL, a2);
print_string(1u, 0LL, (long)" <", 0LL);
if ( (a3 & 1) != 0 )
{
a3 &= ~1u;
if ( a3 )
v3 = "%s,";
else
v3 = "%s";
print_string(4u, 0LL, (long)v3, (long)"active");
}
if ( (a3 & 2) != 0 )
{
a3 &= ~2u;
if ( a3 )
v4 = "%s,";
else
v4 = "%s";
print_string(4u, 0LL, (long)v4, (long)"short_timeout");
}
if ( (a3 & 4) != 0 )
{
a3 &= ~4u;
if ( a3 )
v5 = "%s,";
else
v5 = "%s";
print_string(4u, 0LL, (long)v5, (long)"aggregating");
}
if ( (a3 & 8) != 0 )
{
a3 &= ~8u;
if ( a3 )
v6 = "%s,";
else
v6 = "%s";
print_string(4u, 0LL, (long)v6, (long)"in_sync");
}
if ( (a3 & 0x10) != 0 )
{
a3 &= ~0x10u;
if ( a3 )
v7 = "%s,";
else
v7 = "%s";
print_string(4u, 0LL, (long)v7, (long)"collecting");
}
if ( (a3 & 0x20) != 0 )
{
a3 &= ~0x20u;
if ( a3 )
v8 = "%s,";
else
v8 = "%s";
print_string(4u, 0LL, (long)v8, (long)"distributing");
}
if ( (a3 & 0x40) != 0 )
{
a3 &= ~0x40u;
if ( a3 )
v9 = "%s,";
else
v9 = "%s";
print_string(4u, 0LL, (long)v9, (long)"defaulted");
}
if ( (a3 & 0x80) != 0 )
{
if ( (a3 & 0xFF7F) != 0 )
v10 = "%s,";
else
v10 = "%s";
print_string(4u, 0LL, (long)v10, (long)"expired");
}
return close_json_array(4LL, "> ");
}
|
static int
spt_clearenv(void)
{
return clearenv();
}
|
int spt_clearenv() {
return clearenv();
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.