input
stringlengths 28
169k
| output
stringlengths 20
317k
|
|---|---|
static void bond_print_3ad_stats(const struct rtattr *lacpattr)
{
struct rtattr *lacptb[(__BOND_3AD_STAT_MAX - 1)+1];
__u64 val;
parse_rtattr(lacptb, (__BOND_3AD_STAT_MAX - 1), ((void*)(((char*)(lacpattr)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))),
((int)((lacpattr)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
open_json_object("802.3ad");
if (lacptb[BOND_3AD_STAT_LACPDU_RX]) {
print_string(PRINT_FP,
((void *)0)
, "%-16s ", "");
print_u64(PRINT_ANY, "lacpdu_rx", "LACPDU Rx %llu\n",
rta_getattr_u64(lacptb[BOND_3AD_STAT_LACPDU_RX]));
}
if (lacptb[BOND_3AD_STAT_LACPDU_TX]) {
print_string(PRINT_FP,
((void *)0)
, "%-16s ", "");
print_u64(PRINT_ANY, "lacpdu_tx", "LACPDU Tx %llu\n",
rta_getattr_u64(lacptb[BOND_3AD_STAT_LACPDU_TX]));
}
if (lacptb[BOND_3AD_STAT_LACPDU_UNKNOWN_RX]) {
print_string(PRINT_FP,
((void *)0)
, "%-16s ", "");
val = rta_getattr_u64(lacptb[BOND_3AD_STAT_LACPDU_UNKNOWN_RX]);
print_u64(PRINT_ANY,
"lacpdu_unknown_rx",
"LACPDU Unknown type Rx %llu\n",
val);
}
if (lacptb[BOND_3AD_STAT_LACPDU_ILLEGAL_RX]) {
print_string(PRINT_FP,
((void *)0)
, "%-16s ", "");
val = rta_getattr_u64(lacptb[BOND_3AD_STAT_LACPDU_ILLEGAL_RX]);
print_u64(PRINT_ANY,
"lacpdu_illegal_rx",
"LACPDU Illegal Rx %llu\n",
val);
}
if (lacptb[BOND_3AD_STAT_MARKER_RX]) {
print_string(PRINT_FP,
((void *)0)
, "%-16s ", "");
print_u64(PRINT_ANY, "marker_rx", "Marker Rx %llu\n",
rta_getattr_u64(lacptb[BOND_3AD_STAT_MARKER_RX]));
}
if (lacptb[BOND_3AD_STAT_MARKER_TX]) {
print_string(PRINT_FP,
((void *)0)
, "%-16s ", "");
print_u64(PRINT_ANY, "marker_tx", "Marker Tx %llu\n",
rta_getattr_u64(lacptb[BOND_3AD_STAT_MARKER_TX]));
}
if (lacptb[BOND_3AD_STAT_MARKER_RESP_RX]) {
print_string(PRINT_FP,
((void *)0)
, "%-16s ", "");
val = rta_getattr_u64(lacptb[BOND_3AD_STAT_MARKER_RESP_RX]);
print_u64(PRINT_ANY,
"marker_response_rx",
"Marker response Rx %llu\n",
val);
}
if (lacptb[BOND_3AD_STAT_MARKER_RESP_TX]) {
print_string(PRINT_FP,
((void *)0)
, "%-16s ", "");
val = rta_getattr_u64(lacptb[BOND_3AD_STAT_MARKER_RESP_TX]);
print_u64(PRINT_ANY,
"marker_response_tx",
"Marker response Tx %llu\n",
val);
}
if (lacptb[BOND_3AD_STAT_MARKER_UNKNOWN_RX]) {
print_string(PRINT_FP,
((void *)0)
, "%-16s ", "");
val = rta_getattr_u64(lacptb[BOND_3AD_STAT_MARKER_UNKNOWN_RX]);
print_u64(PRINT_ANY,
"marker_unknown_rx",
"Marker unknown type Rx %llu\n",
val);
}
close_json_object();
}
|
void bond_print_3ad_stats(unsigned short *a0) {
unsigned long long v0;
char v1;
char v2;
char v3;
char v4;
char v5;
char v6;
char v7;
char v8;
char v9;
char v10;
unsigned long long *v12;
unsigned long long v13;
parse_rtattr(&v1, 0x9, a0 + 2, *(a0) - 4);
open_json_object("802.3ad");
if (*(&v1)) {
print_string(0x1, 0x0, "%-1", &g_4040a2);
print_u64(0x4, "lacpdu_rx", "LACPDU Rx %llu\n", rta_getattr_u64(*(&v1)));
}
if (*(&v2)) {
print_string(0x1, 0x0, "%-1", &g_4040a2);
print_u64(0x4, "lacpdu_tx", "LACPDU Tx %llu\n", rta_getattr_u64(*(&v2)));
}
if (*(&v3)) {
print_string(0x1, 0x0, "%-1", &g_4040a2);
v0 = rta_getattr_u64(*(&v3));
print_u64(0x4, "lacpdu_unknown_rx", "LACPDU Unknown type Rx %llu\n", v0);
}
if (*(&v4)) {
print_string(0x1, 0x0, "%-1", &g_4040a2);
v0 = rta_getattr_u64(*(&v4));
print_u64(0x4, "lacpdu_illegal_rx", "LACPDU Illegal Rx %llu\n", v0);
}
if (*(&v5)) {
print_string(0x1, 0x0, "%-1", &g_4040a2);
print_u64(0x4, "marker_rx", "Marker Rx %llu\n", rta_getattr_u64(*(&v5)));
}
if (*(&v6)) {
print_string(0x1, 0x0, "%-1", &g_4040a2);
print_u64(0x4, "marker_tx", "Marker Tx %llu\n", rta_getattr_u64(*(&v6)));
}
if (*(&v7)) {
print_string(0x1, 0x0, "%-1", &g_4040a2);
v0 = rta_getattr_u64(*(&v7));
print_u64(0x4, "marker_response_rx", "Marker response Rx %llu\n", v0);
}
if (*(&v8)) {
print_string(0x1, 0x0, "%-1", &g_4040a2);
v0 = rta_getattr_u64(*(&v8));
print_u64(0x4, "marker_response_tx", "Marker response Tx %llu\n", v0);
}
if (*(&v9)) {
print_string(0x1, 0x0, "%-1", &g_4040a2);
v0 = rta_getattr_u64(*(&v9));
print_u64(0x4, "marker_unknown_rx", "Marker unknown type Rx %llu\n", v0);
}
close_json_object();
v13 = *(&v10) ^ v12[5];
return;
}
|
static void kdf(void *bufp, aes_int_key key, UINT8 ndx, int nbytes)
{
UINT8 in_buf[16] = {0};
UINT8 out_buf[16];
UINT8 *dst_buf = (UINT8 *)bufp;
int i;
in_buf[16 -9] = ndx;
in_buf[16 -1] = i = 1;
while (nbytes >= 16) {
AES_encrypt((u_char *)(in_buf),(u_char *)(out_buf),(AES_KEY *)key);
memcpy(dst_buf,out_buf,16);
in_buf[16 -1] = ++i;
nbytes -= 16;
dst_buf += 16;
}
if (nbytes) {
AES_encrypt((u_char *)(in_buf),(u_char *)(out_buf),(AES_KEY *)key);
memcpy(dst_buf,out_buf,nbytes);
}
explicit_bzero(in_buf, sizeof(in_buf));
explicit_bzero(out_buf, sizeof(out_buf));
}
|
void kdf(void *param_1,AES_KEY *param_2,byte param_3,int param_4)
{
long in_FS_OFFSET;
int local_60;
undefined4 local_44;
void *local_40;
long local_38;
ulong local_30;
uchar local_28 [24];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_38 = (ulong)param_3 << 0x38;
local_44 = 1;
local_30 = 0x100000000000000;
local_60 = param_4;
local_40 = param_1;
while (0xf < local_60) {
AES_encrypt((uchar *)&local_38,local_28,param_2);
memcpy(local_40,local_28,0x10);
local_44 = __addvsi3(local_44,1);
local_30 = local_30 & 0xffffffffffffff | (ulong)(byte)local_44 << 0x38;
local_60 = __addvsi3(local_60,0xfffffff0);
local_40 = (void *)((long)local_40 + 0x10);
}
if (local_60 != 0) {
AES_encrypt((uchar *)&local_38,local_28,param_2);
memcpy(local_40,local_28,(long)local_60);
}
explicit_bzero(&local_38,0x10);
explicit_bzero(local_28,0x10);
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
int
strsnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags, const char *mbextra)
{
return istrsenvisxl(mbdst, &dlen, mbsrc, flags, mbextra,
((void *)0)
);
}
|
void strsnvis(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4,
undefined8 param_5)
{
undefined8 local_18;
undefined8 local_10;
local_18 = param_2;
local_10 = param_1;
istrsenvisxl(param_1,&local_18,param_3,param_4,param_5,0);
return;
}
|
static char **
expand_amble (text, tlen, flags)
char *text;
size_t tlen;
int flags;
{
char **result, **partial, **tresult;
char *tem;
int start, i, c;
mbstate_t state; memset (&state, '\0', sizeof (mbstate_t));
result = (char **)
((void *)0)
;
start = i = 0;
c = 1;
while (c)
{
c = brace_gobbler (text, tlen, &i, brace_arg_separator);
tem = substring (text, start, i);
partial = brace_expand (tem);
if (!result)
result = partial;
else
{
register int lr, lp, j;
lr = strvec_len (result);
lp = strvec_len (partial);
tresult = strvec_mresize (result, lp + lr + 1);
if (tresult == 0)
{
internal_error (gettext("brace expansion: cannot allocate memory for %s"), tem);
sh_xfree((tem), "braces.c", 328);
strvec_dispose (partial);
strvec_dispose (result);
result = (char **)
((void *)0)
;
return result;
}
else
result = tresult;
for (j = 0; j < lp; j++)
result[lr + j] = partial[j];
result[lr + j] = (char *)
((void *)0)
;
sh_xfree((partial), "braces.c", 341);
}
sh_xfree((tem), "braces.c", 343);
do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((text)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((text)[i] & 0x80) == 0)) mblength = (text)[i] != 0; else { state_bak = state; mblength = mbrlen ((text) + (i), (tlen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0);
start = i;
}
return (result);
}
|
int expand_amble(char *a0, unsigned int a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
void* v5;
unsigned long long v6;
char *v7;
void* v8;
unsigned long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v13;
unsigned long long v14;
void* v15;
v0 = a2;
memset(&v10, 0x0, 0x8);
v5 = 0;
v1 = 0;
v2 = v1;
v3 = 1;
while (true) {
if (v3) {
v3 = brace_gobbler(a0, a1, &v1, 0x2c);
v7 = substring(a0, v2, v1);
v8 = brace_expand(v7);
if (!v5) {
v5 = v8;
} else {
v13 = strvec_len(v5);
v14 = strvec_len(v8);
v9 = strvec_mresize(v5, v14 + v13 + 1, v14 + v13 + 1);
if (!v9) {
v14 = gettext("brace expansion: cannot allocate memory for %s");
internal_error(v14, v7, v14);
sh_xfree(v7, "braces.c", 0x148);
strvec_dispose(v8);
strvec_dispose(v5);
v5 = 0;
*(&v14) = v5;
break;
} else {
v5 = v9;
for (v15 = 0; v15 < v14; v15 = v15 + 1) {
*((&v5[v13] + 0x8 * v15)) = *((v8 + 0x8 * v15));
}
*((&v5[v13] + 0x8 * v15)) = 0;
sh_xfree(v8, "braces.c", 0x155);
}
}
if (!v5 || v9) {
sh_xfree(v7, "braces.c", 0x157);
if (locale_mb_cur_max > 1) {
v4 = is_basic(a0[v1]);
if (v4) {
v6 = 1;
} else {
if (locale_utf8locale && a0[v1] >= 0)
v6 = a0[v1];
if (!locale_utf8locale || a0[v1] < 0) {
v11 = v10;
v6 = mbrlen(&a0[v1], a1 - v1, &v10, &a0[v1]);
}
}
if (v6 != -2 && v6 != -1) {
if (!v6)
v1 += 1;
else
v1 += v6;
}
if (v6 == -1 || v6 == -2) {
v10 = v11;
v1 += 1;
}
} else {
v1 += 1;
}
v2 = v1;
}
} else {
*(&v14) = v5;
break;
}
}
return v14;
}
|
void log_it(const char *username, pid_t xpid, const char *event,
const char *detail, int err) {
pid_t pid = xpid;
if (!syslog_open) {
openlog(ProgramName,
0x01
,
(9<<3)
);
syslog_open = 1;
}
syslog(err != 0 ?
3
:
6
,
"(%s) %s (%s)%s%s", username, event, detail,
err != 0 ? ": " : "", err != 0 ? strerror(err) : "");
if (DebugFlags) {
fprintf(
stderr
, "log_it: (%s %ld) %s (%s)%s%s\n",
username, (long) pid, event, detail,
err != 0 ? ": " : "", err != 0 ? strerror(err) : "");
}
}
|
void log_it(undefined8 param_1,int param_2,undefined8 param_3,undefined8 param_4,int param_5)
{
char *pcVar1;
undefined *puVar2;
int __pri;
if (syslog_open == 0) {
openlog(ProgramName,1,0x48);
syslog_open = 1;
}
if (param_5 == 0) {
pcVar1 = "";
puVar2 = &DAT_00141309;
__pri = 6;
}
else {
pcVar1 = strerror(param_5);
puVar2 = &DAT_0014130a;
__pri = 3;
}
syslog(__pri,"(%s) %s (%s)%s%s",param_1,param_3,param_4,puVar2,pcVar1);
if (DebugFlags != 0) {
if (param_5 == 0) {
pcVar1 = "";
puVar2 = &DAT_00141309;
}
else {
pcVar1 = strerror(param_5);
puVar2 = &DAT_0014130a;
}
fprintf(stderr,"log_it: (%s %ld) %s (%s)%s%s\n",param_1,(long)param_2,param_3,param_4,puVar2,
pcVar1);
}
return;
}
|
static void
conread(int s)
{
con *c = &fdcon[s];
size_t n;
if (c->c_status == 1) {
congreet(s);
return;
}
n = atomicio(read, s, c->c_data + c->c_off, c->c_len - c->c_off);
if (n == 0) {
sshlog("ssh-keyscan.c", __func__, 571, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "read (%s): %s", c->c_name, strerror(
(*__errno_location ())
));
confree(s);
return;
}
c->c_off += n;
if (c->c_off == c->c_len)
switch (c->c_status) {
case 2:
c->c_plen = htonl(c->c_plen);
c->c_len = c->c_plen + 8 - (c->c_plen & 7);
c->c_off = 0;
c->c_data = xmalloc(c->c_len);
c->c_status = 3;
break;
default:
sshfatal("ssh-keyscan.c", __func__, 587, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "conread: invalid status %d", c->c_status);
break;
}
contouch(s);
}
|
void conread(unsigned long a0) {
unsigned long v0;
struct_0 *v1;
unsigned long v2;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
v1 = a0 * 112 + 7267821926853935944;
if (v1->field_0 == 1) {
v4 = congreet(a0);
} else {
v2 = atomicio(got.read, a0, v1->field_40 + v1->field_10, __subvsi3(v1->field_c, v1->field_10, v1->field_10));
if (!v2) {
strerror(*(__errno_location()));
sshlog("ssh-keyscan.c", "conread", 0x23b, 0x0, 0x2, 0x0, "read (%s): %s", v1->field_28);
v8 = confree(a0);
} else {
v1->field_10 = v2 + v1->field_10;
if (v1->field_10 == v1->field_c) {
if (v1->field_0 == 2) {
v5 = htonl(v1->field_8);
v1->field_8 = v5;
v7 = __addvsi3(v1->field_8, 0x8, v5, v6);
v1->field_c = __subvsi3(v7, v1->field_8 & 7, v7);
v1->field_10 = 0;
v1->field_40 = xmalloc(v1->field_c);
v1->field_0 = 3;
} else {
v0 = v1->field_0;
sshfatal("ssh-keyscan.c", "conread", 0x24b, 0x0, 0x1, 0x0, "conread: invalid status %d");
}
}
if (v1->field_0 == 2 || v1->field_10 != v1->field_c)
v9 = contouch(a0);
}
}
if (v1->field_0 == 2 || v1->field_0 == 1 || !v2 || v1->field_10 != v1->field_c)
return;
}
|
static void
get_term_capabilities (char **bp)
{
register int i;
for (i = 0; i < (sizeof (tc_strings) / sizeof (struct _tc_string)); i++)
*(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp);
tcap_initialized = 1;
}
|
void get_term_capabilities(unsigned long long a0) {
void* v1;
void* v2;
v1 = 0;
while (true) {
v2 = v1;
if (v1 > 33)
break;
*(*((0x10 * v1 + &g_401328))) = tgetstr(*((0x10 * v1 + &tc_strings)), a0, a0, v1 * 16);
v1 = v1 + 1;
}
tcap_initialized = 1;
return;
}
|
int
rl_discard_argument (void)
{
rl_ding ();
rl_clear_message ();
_rl_reset_argument ();
return 0;
}
|
long rl_discard_argument()
{
rl_ding();
rl_clear_message();
rl_reset_argument();
return 0LL;
}
|
void alrm_handler(int sig)
{
got_alrm = sig;
}
|
void alrm_handler(undefined4 param_1)
{
got_alrm = param_1;
return;
}
|
static
_Bool
wipefile (char *name, char const *qname,
struct randint_source *s, struct Options const *flags)
{
_Bool
ok;
int fd;
fd = open_safer (name,
01
|
0400
|
0
);
if (fd < 0
&& (
(*__errno_location ())
==
13
&& flags->force)
&& chmod (name,
0200
) == 0)
fd = open_safer (name,
01
|
0400
|
0
);
if (fd < 0)
{
error (0,
(*__errno_location ())
, gettext ("%s: failed to open for writing"), qname);
return
0
;
}
ok = do_wipefd (fd, qname, s, flags);
if (close (fd) != 0)
{
error (0,
(*__errno_location ())
, gettext ("%s: failed to close"), qname);
ok =
0
;
}
if (ok && flags->remove_file)
ok = wipename (name, qname, flags);
return ok;
}
|
char wipefile(char *param_1,undefined8 param_2,undefined8 param_3,char *param_4)
{
int iVar1;
int *piVar2;
undefined8 uVar3;
char local_1d;
int local_1c;
local_1c = open_safer(param_1,0x101);
if ((((local_1c < 0) && (piVar2 = __errno_location(), *piVar2 == 0xd)) && (*param_4 != '\0')) &&
(iVar1 = chmod(param_1,0x80), iVar1 == 0)) {
local_1c = open_safer(param_1,0x101);
}
if (local_1c < 0) {
uVar3 = gettext("%s: failed to open for writing");
piVar2 = __errno_location();
error(0,*piVar2,uVar3,param_2);
local_1d = '\0';
}
else {
local_1d = do_wipefd(local_1c,param_2,param_3,param_4);
iVar1 = close(local_1c);
if (iVar1 != 0) {
uVar3 = gettext("%s: failed to close");
piVar2 = __errno_location();
error(0,*piVar2,uVar3,param_2);
local_1d = '\0';
}
if ((local_1d != '\0') && (*(int *)(param_4 + 0x18) != 0)) {
local_1d = wipename(param_1,param_2,param_4);
}
}
return local_1d;
}
|
int
rl_vi_domove (int x, int *ignore)
{
int r;
_rl_vimotion_cxt *m;
m = _rl_vimvcxt;
*ignore = m->motion = rl_vi_domove_getchar (m);
if (m->motion < 0)
{
m->motion = 0;
return -1;
}
return (rl_domove_read_callback (m));
}
|
int rl_vi_domove(unsigned long a0, unsigned int *a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
struct_0 *v1;
unsigned int v3;
v0 = a0;
v1 = _rl_vimvcxt;
v1->field_20 = rl_vi_domove_getchar(v1);
*(&a2) = v1->field_20;
*(a1) = v1->field_20;
if (a2 < 0) {
v1->field_20 = 0;
v3 = -1;
} else {
v3 = rl_domove_read_callback(v1, a1, v1->field_20, a3, a4, a5);
}
return v3;
}
|
static void
print_lineno (void)
{
if (line_no_overflow)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"line number overflow\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("line number overflow")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("line number overflow")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
printf (lineno_format, lineno_width, line_no, separator_str);
if (__builtin_add_overflow (line_no, page_incr, &line_no))
line_no_overflow =
1
;
}
|
void print_lineno() {
unsigned long v1;
unsigned long v2;
if (line_no_overflow)
error(0x1, 0x0, gettext("line number overflow"));
printf(lineno_format);
v1 = 0;
if ([D] amd64g_calculate_condition(0x0<64>, 0x4<64>, Load(addr=0x401328<64>, size=8, endness=Iend_LE), Load(addr=0x4017a0<64>, size=8, endness=Iend_LE), cc_ndep<8>))
*(&v1) = 1;
line_no = page_incr + line_no;
v2 = v1 & 1;
if ((v1 & 1))
line_no_overflow = 1;
return;
}
|
static void
set_use_compress_program_option (const char *string, struct option_locus *loc)
{
struct option_locus *p = optloc_save (OC_COMPRESS, loc);
if (use_compress_program_option
&& strcmp (use_compress_program_option, string) != 0
&& p->source == OPTS_COMMAND_LINE)
do { if (error_hook) error_hook (); error (0, 0, gettext ("Conflicting compression options")); usage (2); } while (0);
use_compress_program_option = string;
}
|
const char * set_use_compress_program_option(const char *a1, long a2)
{
char *v2;
char *v3;
const char *result;
_DWORD *v6;
v6 = (_DWORD *)optloc_save(0, a2);
if ( use_compress_program_option )
{
v2 = use_compress_program_option;
if ( strcmp(use_compress_program_option, a1) )
{
if ( *v6 == 1 )
{
if ( error_hook )
error_hook(v2);
v3 = gettext("Conflicting compression options");
error(0, 0, v3);
usage(2);
}
}
}
result = a1;
use_compress_program_option = (char *)a1;
return result;
}
|
static void set_environment (struct passwd *pw)
{
const char *cp;
if (change_environment && fakelogin) {
cp = getenv ("TERM");
if (
((void *)0)
!= cp) {
addenv ("TERM", cp);
}
cp = getenv ("COLORTERM");
if (
((void *)0)
!= cp) {
addenv ("COLORTERM", cp);
}
cp = getdef_str ("ENV_TZ");
if (
((void *)0)
!= cp) {
addenv (('/' == *cp) ? tz (cp) : cp,
((void *)0)
);
}
cp = getdef_str ("ENV_HZ");
if (
((void *)0)
!= cp) {
addenv (cp,
((void *)0)
);
}
cp = getenv ("DISPLAY");
if (
((void *)0)
!= cp) {
addenv ("DISPLAY", cp);
}
cp = getenv ("XAUTHORITY");
if (
((void *)0)
!= cp) {
addenv ("XAUTHORITY", cp);
}
} else {
char **envp = environ;
while (
((void *)0)
!= *envp) {
addenv (*envp,
((void *)0)
);
envp++;
}
}
cp = getdef_str ((pw->pw_uid == 0) ? "ENV_SUPATH" : "ENV_PATH");
if (
((void *)0)
== cp) {
addenv ((pw->pw_uid == 0) ? "PATH=/sbin:/bin:/usr/sbin:/usr/bin" : "PATH=/bin:/usr/bin",
((void *)0)
);
} else if (strchr (cp, '=') !=
((void *)0)
) {
addenv (cp,
((void *)0)
);
} else {
addenv ("PATH", cp);
}
if (getenv ("IFS") !=
((void *)0)
) {
addenv ("IFS= \t\n",
((void *)0)
);
}
environ = newenvp;
if (change_environment) {
if (fakelogin) {
if (shellstr != pw->pw_shell) {
free (pw->pw_shell);
pw->pw_shell = xstrdup (shellstr);
}
setup_env (pw);
} else {
addenv ("HOME", pw->pw_dir);
addenv ("USER", pw->pw_name);
addenv ("LOGNAME", pw->pw_name);
addenv ("SHELL", shellstr);
}
}
}
|
void set_environment(struct_0 *a0) {
unsigned long long *v0;
unsigned long long v1;
char *v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
if (change_environment && fakelogin) {
v1 = getenv("TERM");
if (v1)
addenv("TERM", v1);
v1 = getenv("COLORTERM");
if (v1)
addenv("COLORTERM", v1);
*(&v1) = getdef_str("ENV_TZ");
if (v1) {
if (*(v1) != 47)
v4 = v1;
else
v4 = tz(v1);
addenv(v4, 0x0);
}
v1 = getdef_str("ENV_HZ");
if (v1)
addenv(v1, 0x0);
v1 = getenv("DISPLAY");
if (v1)
addenv("DISPLAY", v1);
v1 = getenv("XAUTHORITY");
if (v1) {
addenv("XAUTHORITY", v1);
goto LABEL_4010ac;
}
}
for (v0 = environ; *(v0); v0 += 1) {
addenv(*(v0), 0x0);
}
LABEL_4010ac:
if (!a0->field_10)
v5 = "ENV_SUPATH";
else
v5 = "ENV_PATH";
v1 = getdef_str(v5);
if (!v1) {
if (!a0->field_10)
v6 = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
else
v6 = "PATH=/bin:/usr/bin";
addenv(v6, 0x0);
} else if (!strchr(v1, 0x3d)) {
addenv("PATH", v1);
} else {
addenv(v1, 0x0);
}
if (getenv("IFS"))
addenv("IFS= \t\n", 0x0);
environ = newenvp;
v7 = change_environment;
if (change_environment) {
if (!fakelogin) {
addenv("HOME", a0->field_20);
addenv("USER", a0->field_0);
addenv("LOGNAME", a0->field_0);
v8 = addenv("SHELL", *(&shellstr));
} else {
if (a0->field_28 != *(&shellstr)) {
free(a0->field_28);
a0->field_28 = xstrdup(*(&shellstr));
}
v9 = setup_env(a0);
}
}
return;
}
|
static int
mux_master_read_cb(struct ssh *ssh, Channel *c)
{
struct mux_master_state *state = (struct mux_master_state *)c->mux_ctx;
struct sshbuf *in =
((void *)0)
, *out =
((void *)0)
;
u_int type, rid, i;
int r, ret = -1;
if ((out = sshbuf_new()) ==
((void *)0)
)
sshfatal("mux.c", __func__, 1144, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new");
if (c->mux_ctx ==
((void *)0)
) {
state = xcalloc(1, sizeof(*state));
c->mux_ctx = state;
channel_register_cleanup(ssh, c->self,
mux_master_control_cleanup_cb, 0);
if ((r = sshbuf_put_u32(out, 0x00000001)) != 0 ||
(r = sshbuf_put_u32(out, 4)) != 0)
sshfatal("mux.c", __func__, 1156, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "reply");
if ((r = sshbuf_put_stringb(c->output, out)) != 0)
sshfatal("mux.c", __func__, 1159, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "enqueue");
sshlog("mux.c", __func__, 1160, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "channel %d: hello sent", c->self);
ret = 0;
goto out;
}
if ((r = sshbuf_froms(c->input, &in)) != 0) {
malf:
sshlog("mux.c", __func__, 1168, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "malformed message");
goto out;
}
if ((r = sshbuf_get_u32(in, &type)) != 0)
goto malf;
sshlog("mux.c", __func__, 1174, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "channel %d packet type 0x%08x len %zu", c->self, type, sshbuf_len(in))
;
if (type == 0x00000001)
rid = 0;
else {
if (!state->hello_rcvd) {
sshlog("mux.c", __func__, 1181, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "expected MUX_MSG_HELLO(0x%08x), " "received 0x%08x", 0x00000001, type)
;
goto out;
}
if ((r = sshbuf_get_u32(in, &rid)) != 0)
goto malf;
}
for (i = 0; mux_master_handlers[i].handler !=
((void *)0)
; i++) {
if (type == mux_master_handlers[i].type) {
ret = mux_master_handlers[i].handler(ssh, rid,
c, in, out);
break;
}
}
if (mux_master_handlers[i].handler ==
((void *)0)
) {
sshlog("mux.c", __func__, 1197, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "unsupported mux message 0x%08x", type);
reply_error(out, 0x80000003, rid, "unsupported request");
ret = 0;
}
if (sshbuf_len(out) != 0 &&
(r = sshbuf_put_stringb(c->output, out)) != 0)
sshfatal("mux.c", __func__, 1204, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "enqueue");
out:
sshbuf_free(in);
sshbuf_free(out);
return ret;
}
|
long long mux_master_read_cb(unsigned long long a0, struct_0 *a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
char v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
void* v5;
unsigned long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long v9;
char v10;
v6 = a1->field_150;
v5 = 0;
v7 = 0;
v4 = -1;
v7 = sshbuf_new(a0, a1, a2, a3, a4, a5);
if (!v7)
sshfatal("mux.c", "mux_master_read_cb", 0x478, 0x1, 0x1, 0x0, "sshbuf_new");
if (!a1->field_150) {
v6 = xcalloc(0x1, 0x4);
a1->field_150 = v6;
channel_register_cleanup(a0, a1->field_4, mux_master_control_cleanup_cb, 0x0);
v3 = sshbuf_put_u32(v7, 0x1);
if (v3 || (v3 = sshbuf_put_u32(v7, 0x4), v3)) {
v8 = "reply";
sshfatal("mux.c", "mux_master_read_cb", 0x484, 0x1, 0x1, ssh_err(v3), *(&v10));
}
v3 = sshbuf_put_stringb(a1->field_70, v7, v7);
if (v3) {
v8 = "enqueue";
sshfatal("mux.c", "mux_master_read_cb", 0x487, 0x1, 0x1, ssh_err(v3), *(&v10));
}
v9 = a1->field_4;
v8 = "channel %d: hello sent";
sshlog("mux.c", "mux_master_read_cb", 0x488, 0x1, 0x7, 0x0, *(&v10));
v4 = 0;
sshbuf_free(v5);
sshbuf_free(v7);
return v4;
} else {
v3 = sshbuf_froms(a1->field_68, &v5, &v5);
if (!v3 && (v3 = sshbuf_get_u32(v5, &v0, &v0), !v3)) {
v9 = sshbuf_len(v5);
v8 = *(&v0);
v7 = a1->field_4;
v6 = "channel %d packet type 0x%08x len %zu";
sshlog("mux.c", "mux_master_read_cb", 0x496, 0x1, 0x7, 0x0, *(&v10));
if (*(&v0) != 1) {
if (!*(v6)) {
v8 = *(&v0);
v7 = 1;
v6 = "expected MUX_MSG_HELLO(0x%08x), received 0x%08x";
sshlog("mux.c", "mux_master_read_cb", 0x49d, 0x1, 0x2, 0x0, *(&v10));
sshbuf_free(v5);
sshbuf_free(v7);
return v4;
}
v3 = sshbuf_get_u32(v5, &v1, &v1);
if (!v3) {
v2 = 0;
goto LABEL_403bd1;
}
} else {
v1 = 0;
v2 = 0;
while (true) {
LABEL_403bd1:
if (!g_408e48[2 * v2])
break;
if (mux_master_handlers[4 * v2] != *(&v0)) {
v2 += 1;
} else {
v4 = g_408e48[2 * v2](a0, v1, a1, v5, v7, g_408e48[2 * v2]);
break;
}
}
if (!g_408e48[2 * v2]) {
v9 = *(&v0);
v8 = "unsupported mux message 0x%08x";
sshlog("mux.c", "mux_master_read_cb", 0x4ad, 0x1, 0x2, 0x0, *(&v10));
reply_error(v7, 0x80000003, v1, "unsupported request");
v4 = 0;
}
if (sshbuf_len(v7)) {
v3 = sshbuf_put_stringb(a1->field_70, v7, v7);
if (v3) {
v8 = "enqueue";
sshfatal("mux.c", "mux_master_read_cb", 0x4b4, 0x1, 0x1, ssh_err(v3), *(&v10));
}
}
sshbuf_free(v5);
sshbuf_free(v7);
return v4;
}
}
v8 = "malformed message";
sshlog("mux.c", "mux_master_read_cb", 0x490, 0x1, 0x2, 0x0, *(&v10));
sshbuf_free(v5);
sshbuf_free(v7);
return v4;
}
}
|
test_code_t test_rfc7507(gnutls_session_t session)
{
int ret;
const char *pstr =
((void *)0)
;
if (tls1_2_ok && tls1_1_ok)
pstr = "-VERS-TLS-ALL:+VERS-TLS1.1:%FALLBACK_SCSV";
else if (tls1_1_ok && tls1_ok)
pstr = "-VERS-TLS-ALL:+VERS-TLS1.0:%FALLBACK_SCSV";
else
return TEST_IGNORE;
sprintf(prio_str, "NONE:"
"+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL" ":%s:" "+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT"
":""+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH" ":+VKO-GOST-12"":%s", pstr, rest);
{ int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 393)) != TEST_SUCCEED) { return _ret; } };
gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred);
ret = test_do_handshake(session);
if (ret < 0)
return TEST_IGNORE2;
if (handshake_output < 0)
return TEST_SUCCEED;
return TEST_FAILED;
}
|
long long test_rfc7507(unsigned long long a0) {
unsigned int v0;
unsigned int v1;
unsigned long long v2;
unsigned long long v4;
v2 = 0;
if (tls1_2_ok) {
if (tls1_1_ok)
v2 = "-VERS-TLS-ALL:+VERS-TLS1.1:%FALLBACK_SCSV";
} else if (tls1_1_ok) {
if (tls1_ok)
v2 = "-VERS-TLS-ALL:+VERS-TLS1.0:%FALLBACK_SCSV";
}
if (!tls1_1_ok || !tls1_ok && !tls1_2_ok) {
v4 = 3;
} else {
sprintf(&prio_str, "NONE:+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC:+GOST28147-TC26Z-CNT:+COMP-NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT:+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH:+VKO-GOST-12:%s", v2, &rest);
v0 = __gnutls_priority_set_direct(a0, &prio_str, 0x189);
if (v0) {
v4 = v0;
} else {
gnutls_credentials_set(a0, 0x1, xcred);
v1 = test_do_handshake(a0);
if (v1 < 0) {
v4 = 4;
} else if (handshake_output < 0) {
v4 = 0;
} else {
v4 = 1;
}
}
}
return v4;
}
|
void *
xmemdup (void const *p, size_t s)
{
return memcpy (xmalloc (s), p, s);
}
|
void xmemdup(void* a0, unsigned int a1) {
unsigned long long v1;
v1 = memcpy(xmalloc(a1), a0, a1);
return;
}
|
void
names_notfound (void)
{
struct name const *cursor;
for (cursor = namelist; cursor; cursor = cursor->next)
if (!(occurrence_option == 0 ? (cursor)->found_count != 0 : (cursor)->found_count >= occurrence_option) && cursor->name[0])
{
regex_usage_warning (cursor->name);
do { if (error_hook) error_hook (); error (0, 0, (cursor->found_count == 0) ? gettext ("%s: Not found in archive") : gettext ("%s: Required occurrence not found in archive"), quotearg_colon (cursor->name)); exit_status = 2; } while (0)
;
}
namelist =
((void *)0)
;
nametail =
((void *)0)
;
if (same_order_option)
{
const char *name;
while ((name = name_next (1)) !=
((void *)0)
)
{
regex_usage_warning (name);
do { if (error_hook) error_hook (); error (0, 0, gettext ("%s: Not found in archive"), quotearg_colon (name)); exit_status = 2; } while (0)
;
}
}
}
|
long long names_notfound() {
struct_0 *v0;
unsigned long long v1;
unsigned long long v4;
char *v5;
unsigned long long v6;
unsigned long long v7;
for (v0 = namelist; v0; v0 = v0->field_0) {
if ((!occurrence_option ? v0->field_30 < occurrence_option : !v0->field_30) && v0->field_10->field_0) {
regex_usage_warning(v0->field_10);
if (error_hook)
*(5243000)();
v4 = quotearg_colon(v0->field_10);
if (v0->field_30)
v5 = gettext("%s: Required occurrence not found in archive");
else
v5 = gettext("%s: Not found in archive");
error(0x0, 0x0, v5);
exit_status = 2;
}
}
namelist = 0;
nametail = 0;
v7 = same_order_option;
if (!same_order_option)
return v7;
while (true) {
v7 = name_next(0x1);
v1 = v7;
if (!v1)
break;
regex_usage_warning(v1);
if (error_hook)
*(5243000)();
v6 = quotearg_colon(v1);
error(0x0, 0x0, gettext("%s: Not found in archive"));
exit_status = 2;
}
return v7;
}
|
void
xextendf(char **sp, const char *sep, const char *fmt, ...)
{
va_list ap;
char *tmp1, *tmp2;
__builtin_va_start(
ap
,
fmt
)
;
xvasprintf(&tmp1, fmt, ap);
__builtin_va_end(
ap
)
;
if (*sp ==
((void *)0)
|| **sp == '\0') {
free(*sp);
*sp = tmp1;
return;
}
xasprintf(&tmp2, "%s%s%s", *sp, sep ==
((void *)0)
? "" : sep, tmp1);
free(tmp1);
free(*sp);
*sp = tmp2;
}
|
long long xextendf() {
char v0;
char v1;
unsigned int v2;
unsigned int v3;
unsigned long v4;
unsigned long v5;
unsigned long v6;
char v7;
unsigned long v8;
unsigned long v9;
unsigned long v10;
int v11;
int v12;
int v13;
int v14;
int v15;
int v16;
int v17;
int v18;
unsigned long v19;
unsigned long v20;
unsigned long v21;
unsigned long v22;
char v23;
int v24;
int v25;
int v26;
int v27;
int v28;
int v29;
int v30;
int v31;
unsigned long long *v32;
unsigned long long v33;
char **v34;
unsigned long long v36;
unsigned long long v37;
v8 = v20;
v9 = v21;
v10 = v22;
if (v23) {
v11 = v24;
v12 = v25;
v13 = v26;
v14 = v27;
v15 = v28;
v16 = v29;
v17 = v30;
v18 = v31;
}
v6 = v32[5];
v2 = 24;
v3 = 48;
v4 = &v19;
v5 = &v7;
xvasprintf(&v0, v33, &v2, v33);
if (*(v34) && *(*(v34))) {
if (v36)
v37 = v36;
else
v37 = &g_4084c8;
xasprintf(&v1, "%s%s%s", *(v34), v37, *(&v0));
free(*(&v0));
free(*(v34));
*(v34) = *(&v1);
}
if (!*(v34) || !*(*(v34))) {
free(*(v34));
*(v34) = *(&v0);
}
if ((v6 ^ v32[5]))
__stack_chk_fail();
return 0;
}
|
static int rmmod_do_module(struct kmod_module *mod, int flags)
{
const char *modname = kmod_module_get_name(mod);
struct kmod_list *pre =
((void *)0)
, *post =
((void *)0)
;
const char *cmd =
((void *)0)
;
int err;
if (!ignore_commands) {
err = kmod_module_get_softdeps(mod, &pre, &post);
if (err < 0) {
log_printf(
4
, "could not get softdeps of '%s': %s\n", modname, strerror(-err))
;
return err;
}
cmd = kmod_module_get_remove_commands(mod);
}
if (!cmd && !ignore_loaded) {
int state = kmod_module_get_initstate(mod);
if (state < 0) {
if (first_time) {
log_printf(log_priority, "Module %s is not in kernel.\n", modname);
err = -
2
;
} else {
err = 0;
}
goto error;
} else if (state == KMOD_MODULE_BUILTIN) {
if (flags & 0x2) {
err = 0;
} else {
log_printf(log_priority, "Module %s is builtin.\n", modname);
err = -
2
;
}
goto error;
}
}
rmmod_do_modlist(post,
0
);
if (flags & 0x1) {
struct kmod_list *holders = kmod_module_get_holders(mod);
err = rmmod_do_modlist(holders,
1
);
if (err < 0)
goto error;
}
if (!cmd && !ignore_loaded && !wait_msec) {
int usage = kmod_module_get_refcnt(mod);
if (usage > 0) {
if (!quiet_inuse)
log_printf(log_priority, "Module %s is in use.\n", modname);
err = -
16
;
goto error;
}
}
if (!cmd)
err = rmmod_do_remove_module(mod);
else
err = command_do(mod, "remove", cmd,
((void *)0)
);
if (err < 0)
goto error;
if (!cmd) {
struct kmod_list *deps, *itr;
deps = kmod_module_get_dependencies(mod);
for (itr = deps; itr !=
((void *)0)
; itr = kmod_list_next(deps, itr)) {
struct kmod_module *dep = kmod_module_get_module(itr);
if (kmod_module_get_refcnt(dep) == 0)
rmmod_do_remove_module(dep);
kmod_module_unref(dep);
}
kmod_module_unref_list(deps);
}
rmmod_do_modlist(pre,
0
);
error:
kmod_module_unref_list(pre);
kmod_module_unref_list(post);
return err;
}
|
long rmmod_do_module(long a1, char a2)
{
char *v2;
int softdeps;
int v5;
int initstate;
long v7;
long v8;
const char *v9;
long i;
const char *name;
long holders;
long dependencies;
long module;
unsigned long v15;
v15 = __readfsqword(0x28u);
name = (const char *)kmod_module_get_name(a1);
v7 = 0LL;
v8 = 0LL;
v9 = 0LL;
if ( !ignore_commands )
{
softdeps = kmod_module_get_softdeps(a1, &v7, &v8);
if ( softdeps < 0 )
{
v2 = strerror(-softdeps);
log_printf(4LL, "could not get softdeps of '%s': %s\n", name, v2);
return (unsigned int)softdeps;
}
v9 = (const char *)kmod_module_get_remove_commands(a1);
}
if ( v9 || ignore_loaded )
goto LABEL_15;
initstate = kmod_module_get_initstate(a1);
if ( initstate >= 0 )
{
if ( !initstate )
{
if ( (a2 & 2) != 0 )
{
v5 = 0;
}
else
{
log_printf((unsigned int)log_priority, "Module %s is builtin.\n", name);
v5 = -2;
}
goto LABEL_36;
}
LABEL_15:
rmmod_do_modlist(v8, 0);
if ( (a2 & 1) == 0 || (holders = kmod_module_get_holders(a1), v5 = rmmod_do_modlist(holders, 1), v5 >= 0) )
{
if ( v9 || ignore_loaded || wait_msec || (int)kmod_module_get_refcnt(a1) <= 0 )
{
if ( v9 )
v5 = command_do(a1, "remove", v9, 0LL);
else
v5 = rmmod_do_remove_module(a1);
if ( v5 >= 0 )
{
if ( !v9 )
{
dependencies = kmod_module_get_dependencies(a1);
for ( i = dependencies; i; i = kmod_list_next(dependencies, i) )
{
module = kmod_module_get_module(i);
if ( !(unsigned int)kmod_module_get_refcnt(module) )
rmmod_do_remove_module(module);
kmod_module_unref(module);
}
kmod_module_unref_list(dependencies);
}
rmmod_do_modlist(v7, 0);
}
}
else
{
if ( !quiet_inuse )
log_printf((unsigned int)log_priority, "Module %s is in use.\n", name);
v5 = -16;
}
}
goto LABEL_36;
}
if ( first_time )
{
log_printf((unsigned int)log_priority, "Module %s is not in kernel.\n", name);
v5 = -2;
}
else
{
v5 = 0;
}
LABEL_36:
kmod_module_unref_list(v7);
kmod_module_unref_list(v8);
return (unsigned int)v5;
}
|
static int
collequiv (c, equiv)
int c, equiv;
{
if (charcmp (c, equiv, 1) == 0)
return 1;
return 0;
}
|
bool collequiv(undefined4 param_1,undefined4 param_2)
{
int iVar1;
iVar1 = charcmp(param_1,param_2,1);
return iVar1 == 0;
}
|
static
_Bool
show_date (char const *format, struct timespec when, timezone_t tz)
{
struct tm tm;
if (parse_datetime_flags & 1)
error (0, 0, gettext ("output format: %s"), quote (format));
if (localtime_rz (tz, &when.tv_sec, &tm))
{
if (format == rfc_email_format)
setlocale (
2
, "C");
fprintftime (
stdout
, format, &tm, tz, when.tv_nsec);
if (format == rfc_email_format)
setlocale (
2
, "");
fputc_unlocked ('\n',
stdout
);
return
1
;
}
else
{
char buf[((((((sizeof (intmax_t) * 8) - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) + 1)];
error (0, 0, gettext ("time %s is out of range"),
quote (timetostr (when.tv_sec, buf)));
return
0
;
}
}
|
int show_date(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3) {
char v0;
char v1;
char v2;
unsigned long long v4;
unsigned int v5;
if ((parse_datetime_flags & 1)) {
v4 = quote(a0);
error(0x0, 0x0, gettext("output format: %s"));
}
if (!localtime_rz(a3, &v0, &v1, &v0)) {
quote(timetostr(a1, &v2));
error(0x0, 0x0, gettext("time %s is out of range"));
v5 = 0;
} else {
if (a0 == "%a, %d %b %Y %H:%M:%S %z")
setlocale(0x2, "C");
fprintftime(stdout, a0, &v1, a3, a2);
if (a0 == "%a, %d %b %Y %H:%M:%S %z")
setlocale(0x2, &g_4016a3);
fputc_unlocked(0xa, stdout);
v5 = 1;
}
return v5;
}
|
void
set_dollar_vars_changed ()
{
if (variable_context)
changed_dollar_vars |= 0x02;
else if (this_shell_builtin == set_builtin)
changed_dollar_vars |= 0x04;
else
changed_dollar_vars |= 0x01;
}
|
void set_dollar_vars_changed() {
unsigned long long v1;
unsigned long long v2;
unsigned long long v3;
if (variable_context) {
v1 = changed_dollar_vars | 2;
changed_dollar_vars = changed_dollar_vars | 2;
return;
} else if (this_shell_builtin != got.set_builtin) {
v3 = changed_dollar_vars | 1;
changed_dollar_vars = changed_dollar_vars | 1;
return;
} else {
v2 = changed_dollar_vars | 4;
changed_dollar_vars = changed_dollar_vars | 4;
return;
}
}
|
static void
pad_across_to (int position)
{
int h = output_position;
if (tabify_output)
spaces_not_printed = position - output_position;
else
{
while (++h <= position)
putchar_unlocked (' ');
output_position = position;
}
}
|
long pad_across_to(unsigned int a1)
{
long result;
int v2;
v2 = output_position;
if ( tabify_output )
{
result = a1 - output_position;
spaces_not_printed = a1 - output_position;
}
else
{
while ( ++v2 <= (int)a1 )
putchar_unlocked(32);
result = a1;
output_position = a1;
}
return result;
}
|
static void find_jobs(int vtime, cron_db * db, int doWild, int doNonWild, long vGMToff) {
char *orig_tz, *job_tz;
struct tm *tm;
int minute, hour, dom, month, dow;
user *u;
entry *e;
orig_tz = getenv("TZ");
for (u = db->head; u !=
((void *)0)
; u = u->next) {
for (e = u->crontab; e !=
((void *)0)
; e = e->next) {
time_t virtualSecond = (time_t)(vtime - e->delay) * (time_t)60;
time_t virtualGMTSecond = virtualSecond - vGMToff;
job_tz = env_get("CRON_TZ", e->envp);
do { char *t = job_tz; if (t !=
((void *)0)
&& *t != '\0') { setenv("TZ", t, 1); tm = localtime(&virtualGMTSecond); } else { if ((orig_tz) !=
((void *)0)
) setenv("TZ", (orig_tz), 1); else unsetenv("TZ"); tm = gmtime(&virtualSecond); } minute = tm->tm_min -0; hour = tm->tm_hour -0; dom = tm->tm_mday -1; month = tm->tm_mon +1 -1; dow = tm->tm_wday -0; } while (0);
if (((e->minute)[((minute) >> 3)] & (1 << ((minute)&0x7))) &&
((e->hour)[((hour) >> 3)] & (1 << ((hour)&0x7))) &&
((e->month)[((month) >> 3)] & (1 << ((month)&0x7))) &&
(((e->flags & 0x04) || (e->flags & 0x08))
? (((e->dow)[((dow) >> 3)] & (1 << ((dow)&0x7))) && ((e->dom)[((dom) >> 3)] & (1 << ((dom)&0x7))))
: (((e->dow)[((dow) >> 3)] & (1 << ((dow)&0x7))) || ((e->dom)[((dom) >> 3)] & (1 << ((dom)&0x7))))
)
) {
if (job_tz !=
((void *)0)
&& vGMToff != GMToff)
continue;
if ((doNonWild &&
!(e->flags & (0x01 | 0x02))) ||
(doWild && (e->flags & (0x01 | 0x02))))
job_add(e, u);
}
}
}
if (orig_tz !=
((void *)0)
)
setenv("TZ", orig_tz, 1);
else
unsetenv("TZ");
}
|
void find_jobs(int param_1,undefined8 *param_2,int param_3,int param_4,long param_5)
{
bool bVar1;
byte bVar2;
byte bVar3;
int iVar4;
int iVar5;
long in_FS_OFFSET;
long local_50;
long local_48;
tm *local_40;
undefined8 *local_38;
undefined8 *local_30;
char *local_28;
char *local_20;
char *local_18;
long local_10;
int iVar6;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_28 = getenv("TZ");
for (local_38 = (undefined8 *)*param_2; local_38 != (undefined8 *)0x0;
local_38 = (undefined8 *)*local_38) {
for (local_30 = (undefined8 *)local_38[5]; local_30 != (undefined8 *)0x0;
local_30 = (undefined8 *)*local_30) {
local_50 = (long)(param_1 - *(int *)(local_30 + 7)) * 0x3c;
local_48 = local_50 - param_5;
local_20 = (char *)env_get("CRON_TZ",local_30[2]);
local_18 = local_20;
if ((local_20 == (char *)0x0) || (*local_20 == '\0')) {
if (local_28 == (char *)0x0) {
unsetenv("TZ");
}
else {
setenv("TZ",local_28,1);
}
local_40 = gmtime(&local_50);
}
else {
setenv("TZ",local_20,1);
local_40 = localtime(&local_48);
}
iVar4 = local_40->tm_mday + -1;
if (((((int)(uint)*(byte *)((long)local_30 + (long)(local_40->tm_min >> 3) + 0x20) >>
((byte)local_40->tm_min & 7) & 1U) != 0) &&
(((int)(uint)*(byte *)((long)local_30 + (long)(local_40->tm_hour >> 3) + 0x28) >>
((byte)local_40->tm_hour & 7) & 1U) != 0)) &&
(((int)(uint)*(byte *)((long)local_30 + (long)(local_40->tm_mon >> 3) + 0x2f) >>
((byte)local_40->tm_mon & 7) & 1U) != 0)) {
iVar5 = local_40->tm_wday >> 3;
iVar6 = iVar4 >> 3;
bVar2 = (byte)local_40->tm_wday;
bVar3 = (byte)iVar4;
if (((*(uint *)((long)local_30 + 0x34) & 4) == 0) &&
((*(uint *)((long)local_30 + 0x34) & 8) == 0)) {
if ((((int)(uint)*(byte *)((long)local_30 + (long)iVar5 + 0x31) >> (bVar2 & 7) & 1U) == 0)
&& (((int)(uint)*(byte *)((long)local_30 + (long)iVar6 + 0x2b) >> (bVar3 & 7) & 1U) ==
0)) {
bVar1 = false;
}
else {
bVar1 = true;
}
}
else if ((((int)(uint)*(byte *)((long)local_30 + (long)iVar5 + 0x31) >> (bVar2 & 7) & 1U) ==
0) || (((int)(uint)*(byte *)((long)local_30 + (long)iVar6 + 0x2b) >> (bVar3 & 7) &
1U) == 0)) {
bVar1 = false;
}
else {
bVar1 = true;
}
if (((bVar1) && ((local_20 == (char *)0x0 || (param_5 == GMToff)))) &&
(((param_4 != 0 && ((*(uint *)((long)local_30 + 0x34) & 3) == 0)) ||
((param_3 != 0 && ((*(uint *)((long)local_30 + 0x34) & 3) != 0)))))) {
job_add(local_30,local_38);
}
}
}
}
if (local_28 == (char *)0x0) {
unsetenv("TZ");
}
else {
setenv("TZ",local_28,1);
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
__stack_chk_fail();
}
|
Keymap
rl_make_bare_keymap (void)
{
register int i;
Keymap keymap;
keymap = (Keymap)xmalloc (257 * sizeof (KEYMAP_ENTRY));
for (i = 0; i < 257; i++)
{
keymap[i].type = 0;
keymap[i].function = (rl_command_func_t *)
((void *)0)
;
}
return (keymap);
}
|
int rl_make_bare_keymap() {
void* v0;
void* v2;
v0 = xmalloc(0x1010);
for (v2 = 0; v2 <= 0x100; v2 = v2 + 1) {
*(v0 + 0x10 * v2) = 0;
*((8 + v0 + 0x10 * v2)) = 0;
}
return v0;
}
|
void ea_refcount_free(ext2_refcount_t refcount)
{
if (!refcount)
return;
if (refcount->list)
ext2fs_free_mem(&refcount->list);
ext2fs_free_mem(&refcount);
}
|
void ea_refcount_free(struct_0 *a0) {
char v0;
struct_0 *v2;
unsigned long long v3;
v2 = a0;
if (a0) {
if (a0->field_18)
ext2fs_free_mem(&a0->field_18);
v3 = ext2fs_free_mem(&v0);
}
return;
}
|
static int parse_encap_seg6(struct rtattr *rta, size_t len, int *argcp,
char ***argvp)
{
int mode_ok = 0, segs_ok = 0, hmac_ok = 0;
struct seg6_iptunnel_encap *tuninfo;
struct ipv6_sr_hdr *srh;
char **argv = *argvp;
char segbuf[1024] = "";
int argc = *argcp;
int encap = -1;
__u32 hmac = 0;
int ret = 0;
int srhlen;
while (argc > 0) {
if (strcmp(*argv, "mode") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (mode_ok++)
duparg2("mode", *argv);
encap = read_seg6mode_type(*argv);
if (encap < 0)
invarg("\"mode\" value is invalid\n", *argv);
} else if (strcmp(*argv, "segs") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (segs_ok++)
duparg2("segs", *argv);
if (encap == -1)
invarg("\"segs\" provided before \"mode\"\n",
*argv);
strlcpy(segbuf, *argv, 1024);
} else if (strcmp(*argv, "hmac") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (hmac_ok++)
duparg2("hmac", *argv);
get_u32(&hmac, *argv, 0);
} else {
break;
}
argc--; argv++;
}
srh = parse_srh(segbuf, hmac, encap);
srhlen = (srh->hdrlen + 1) << 3;
tuninfo = malloc(sizeof(*tuninfo) + srhlen);
memset(tuninfo, 0, sizeof(*tuninfo) + srhlen);
tuninfo->mode = encap;
memcpy(tuninfo->srh, srh, srhlen);
if (rta_addattr_l(rta, len, SEG6_IPTUNNEL_SRH, tuninfo,
sizeof(*tuninfo) + srhlen)) {
ret = -1;
goto out;
}
*argcp = argc + 1;
*argvp = argv - 1;
out:
free(tuninfo);
free(srh);
return ret;
}
|
long parse_encap_seg6(long a1, unsigned int a2, int *a3, const char ***a4)
{
uint32_t v10;
int v11;
int v12;
int v13;
int v14;
int seg6mode_type;
unsigned int v16;
int v17;
const char **v18;
void *src;
void *s;
long v21[130];
v21[129] = __readfsqword(0x28u);
v11 = 0;
v12 = 0;
v13 = 0;
v18 = *a4;
memset(v21, 0, 1024);
v14 = *a3;
seg6mode_type = -1;
v10 = 0;
v16 = 0;
while ( v14 > 0 )
{
if ( !strcmp(*v18, "mode") )
{
++v18;
if ( --v14 <= 0 )
incomplete_command();
if ( v11++ )
duparg2("mode", *v18);
seg6mode_type = read_seg6mode_type(*v18);
if ( seg6mode_type >= 0 )
goto LABEL_23;
invarg("\"mode\" value is invalid\n", *v18);
}
if ( !strcmp(*v18, "segs") )
{
++v18;
if ( --v14 <= 0 )
incomplete_command();
if ( v12++ )
duparg2("segs", *v18);
if ( seg6mode_type == -1 )
invarg("\"segs\" provided before \"mode\"\n", *v18);
strlcpy(v21, *v18, 1024LL);
}
else
{
if ( strcmp(*v18, "hmac") )
break;
++v18;
if ( --v14 <= 0 )
incomplete_command();
if ( v13++ )
duparg2("hmac", *v18);
get_u32(&v10, *v18, 0LL);
}
LABEL_23:
--v14;
++v18;
}
src = parse_srh((char *)v21, v10, seg6mode_type != 0);
v17 = 8 * (*((unsigned char *)src + 1) + 1);
s = malloc(v17 + 4LL);
memset(s, 0, v17 + 4LL);
*(_DWORD *)s = seg6mode_type;
memcpy((char *)s + 4, src, v17);
if ( (unsigned int)rta_addattr_l(a1, a2, 1LL, s, (unsigned int)(v17 + 4)) )
{
v16 = -1;
}
else
{
*a3 = v14 + 1;
*a4 = v18 - 1;
}
free(s);
free(src);
return v16;
}
|
static errcode_t mark_bmap_range(ext2fs_block_bitmap map,
blk64_t blk, unsigned int num)
{
if (blk >= ext2fs_get_generic_bmap_start(map) &&
blk + num <= ext2fs_get_generic_bmap_end(map))
ext2fs_mark_block_bitmap_range2(map, blk, num);
else
return (2133571399L);
return 0;
}
|
long mark_bmap_range(long a1, unsigned long a2, unsigned int a3)
{
if ( a2 < ext2fs_get_generic_bmap_start(a1) || a3 + a2 > ext2fs_get_generic_bmap_end(a1) )
return 2133571399LL;
ext2fs_mark_block_bitmap_range2(a1, a2, a3);
return 0LL;
}
|
static void
cmdlist(union node *np, int sep)
{
for (; np; np = np->narg.next) {
if (!sep)
cmdputs(spcstr);
cmdtxt(np);
if (sep && np->narg.next)
cmdputs(spcstr);
}
}
|
long cmdlist(long a1, int a2)
{
long result;
while ( a1 )
{
if ( !a2 )
cmdputs((const char *)&spcstr);
cmdtxt(a1);
if ( a2 )
{
if ( *(_QWORD *)(a1 + 8) )
cmdputs((const char *)&spcstr);
}
result = *(_QWORD *)(a1 + 8);
a1 = result;
}
return result;
}
|
cv_repeat_srch(EditLine *el, wint_t c)
{
el->el_state.lastcmd = (el_action_t) c;
el->el_line.lastchar = el->el_line.buffer;
switch (c) {
case 23:
return ed_search_next_history(el, 0);
case 24:
return ed_search_prev_history(el, 0);
default:
return 6;
}
}
|
undefined8 cv_repeat_srch(long param_1,int param_2)
{
undefined8 uVar1;
*(char *)(param_1 + 0x80) = (char)param_2;
*(undefined8 *)(param_1 + 0x60) = *(undefined8 *)(param_1 + 0x50);
if (param_2 == 0x17) {
uVar1 = ed_search_next_history(param_1,0);
}
else if (param_2 == 0x18) {
uVar1 = ed_search_prev_history(param_1,0);
}
else {
uVar1 = 6;
}
return uVar1;
}
|
int
ttnocanon ()
{
struct termios tt;
if (ttsaved == 0)
return -1;
tt = ttin;
return (ttfd_nocanon (0, &tt));
}
|
int ttnocanon()
{
struct termios v1;
unsigned long v2;
v2 = __readfsqword(0x28u);
if ( !ttsaved )
return -1;
v1 = *(struct termios *)ttin;
return ttfd_nocanon(0, &v1);
}
|
int
_ssh_host_key_sign(struct ssh *ssh, struct sshkey *privkey,
struct sshkey *pubkey, u_char **signature, size_t *slen,
const u_char *data, size_t dlen, const char *alg)
{
return sshkey_sign(privkey, signature, slen, data, dlen,
alg,
((void *)0)
,
((void *)0)
, ssh->compat);
}
|
long long _ssh_host_key_sign(struct_0 *a0, unsigned long long a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5, unsigned long long v2, unsigned long long a6) {
unsigned long v0;
unsigned long v1;
v1 = a2;
v0 = a0->field_83c;
return sshkey_sign(a1, a3, a4, a5, v2, a6, 0x0, 0x0);
}
|
static void
perform_basename (char const *string, char const *suffix,
_Bool
use_nuls)
{
char *name = base_name (string);
strip_trailing_slashes (name);
if (suffix && (! (((name)[0]) == '/')) && ! ((void) (name), 0))
remove_suffix (name, suffix);
fputs_unlocked (name,
stdout
);
putchar_unlocked (use_nuls ? '\0' : '\n');
free (name);
}
|
void perform_basename(unsigned long long a0, char *a1, unsigned long a2) {
char *v0;
unsigned int v2;
unsigned long long v3;
v0 = base_name(a0);
strip_trailing_slashes(v0);
if (a1 && *(v0) != 47)
remove_suffix(v0, a1);
fputs_unlocked(v0, stdout);
if (!a2)
v2 = 10;
else
v2 = 0;
putchar_unlocked(v2);
v3 = free(v0);
return;
}
|
static void faillog_reset (uid_t uid)
{
struct faillog fl;
int fd;
off_t offset_uid = (off_t) (sizeof fl) * uid;
struct stat st;
if (stat ("/var/log/faillog", &st) != 0 || st.st_size <= offset_uid) {
return;
}
explicit_bzero((&fl), (sizeof (fl)));
fd = open ("/var/log/faillog",
02
);
if (-1 == fd) {
fprintf (
stderr
,
gettext ("%s: failed to open the faillog file for UID %lu: %s\n"),
Prog, (unsigned long) uid, strerror (
(*__errno_location ())
));
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
, "failed to open the faillog file for UID %lu", (unsigned long) uid) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
return;
}
if ( (lseek (fd, offset_uid,
0
) != offset_uid)
|| (write (fd, &fl, sizeof (fl)) != (ssize_t) sizeof (fl))
|| (fsync (fd) != 0)) {
fprintf (
stderr
,
gettext ("%s: failed to reset the faillog entry of UID %lu: %s\n"),
Prog, (unsigned long) uid, strerror (
(*__errno_location ())
));
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
, "failed to reset the faillog entry of UID %lu", (unsigned long) uid) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
}
if (close (fd) != 0) {
fprintf (
stderr
,
gettext ("%s: failed to close the faillog file for UID %lu: %s\n"),
Prog, (unsigned long) uid, strerror (
(*__errno_location ())
));
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
, "failed to close the faillog file for UID %lu", (unsigned long) uid) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
}
}
|
void faillog_reset(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned int v0;
void* v1;
void* v2;
void* v3;
unsigned int v4;
char *v5;
char *v6;
char *v7;
char v8;
char v9;
char v10;
char v11;
unsigned long long v13;
unsigned long long v14;
unsigned long long *v15;
unsigned long long v16;
*(&v4) = a0 * 32;
if (!stat("/var/log/faillog", &v9) && *(&v4) < *(&v10)) {
explicit_bzero(&v8, 0x20);
v0 = open("/var/log/faillog", 0x2, a2);
if (v0 == -1) {
v13 = strerror(*(__errno_location()));
fprintf(*(&stderr), gettext("%s: failed to open the faillog file for UID %lu: %s\n"));
v7 = setlocale(0x6, NULL);
v1 = 0;
if (v7)
v1 = strdup(v7);
if (v1)
setlocale(0x6, "C");
syslog(0x4, "failed to open the faillog file for UID %lu");
if (v1) {
setlocale(0x6, v1);
free(v1);
}
} else {
if (*(&v4) == lseek(v0, *(&v4), 0x0) && write(v0, &v8, 0x20) == 32 && !fsync(v0))
goto LABEL_404e3d;
strerror(*(__errno_location()));
fprintf(*(&stderr), gettext("%s: failed to reset the faillog entry of UID %lu: %s\n"));
v5 = setlocale(0x6, NULL);
v2 = 0;
if (v5)
v2 = strdup(v5);
if (v2)
setlocale(0x6, "C");
syslog(0x4, "failed to reset the faillog entry of UID %lu");
if (v2) {
setlocale(0x6, v2);
free(v2);
}
LABEL_404e3d:
if (close(v0)) {
v14 = strerror(*(__errno_location()));
fprintf(*(&stderr), gettext("%s: failed to close the faillog file for UID %lu: %s\n"));
v6 = setlocale(0x6, NULL);
v3 = 0;
if (v6)
v3 = strdup(v6);
if (v3)
setlocale(0x6, "C");
syslog(0x4, "failed to close the faillog file for UID %lu");
if (v3) {
setlocale(0x6, v3);
free(v3);
}
}
}
}
v16 = *(&v11) ^ v15[5];
return;
}
|
void
_rl_move_vert (int to)
{
register int delta, i;
if (_rl_last_v_pos == to || to > _rl_screenheight)
return;
if ((delta = to - _rl_last_v_pos) > 0)
{
for (i = 0; i < delta; i++)
putc ('\n', rl_outstream);
_rl_cr ();
_rl_last_c_pos = 0;
}
else
{
if (_rl_term_up && *_rl_term_up)
for (i = 0; i < -delta; i++)
tputs (_rl_term_up, 1, _rl_output_character_function);
}
_rl_last_v_pos = to;
}
|
long long _rl_move_vert(unsigned long a0) {
unsigned long v1;
unsigned int v2;
unsigned int v3;
v1 = _rl_last_v_pos;
if (a0 == _rl_last_v_pos)
return v1;
v1 = _rl_screenheight;
if (a0 > _rl_screenheight)
return v1;
if (a0 - _rl_last_v_pos > 0) {
for (v2 = 0; v2 < a0 - _rl_last_v_pos; v2 += 1) {
putc(0xa, rl_outstream);
}
_rl_cr();
_rl_last_c_pos = 0;
} else if (_rl_term_up && *(_rl_term_up)) {
for (v3 = 0; v3 < !(a0 - _rl_last_v_pos); v3 += 1) {
tputs(_rl_term_up, 0x1, got._rl_output_character_function);
}
}
v1 = a0;
_rl_last_v_pos = a0;
return v1;
}
|
int do_netns(int argc, char **argv)
{
netns_nsid_socket_init();
if (argc < 1) {
netns_map_init();
return netns_list(0,
((void *)0)
);
}
if (!do_all && argc > 1 && invalid_name(argv[1])) {
fprintf(
stderr
, "Invalid netns name \"%s\"\n", argv[1]);
exit(-1);
}
if ((matches(*argv, "list") == 0) || (matches(*argv, "show") == 0) ||
(matches(*argv, "lst") == 0)) {
netns_map_init();
return netns_list(argc-1, argv+1);
}
if ((matches(*argv, "list-id") == 0)) {
netns_map_init();
return netns_list_id(argc-1, argv+1);
}
if (matches(*argv, "help") == 0)
return usage();
if (matches(*argv, "add") == 0)
return netns_add(argc-1, argv+1,
1
);
if (matches(*argv, "set") == 0)
return netns_set(argc-1, argv+1);
if (matches(*argv, "delete") == 0)
return netns_delete(argc-1, argv+1);
if (matches(*argv, "identify") == 0)
return netns_identify(argc-1, argv+1);
if (matches(*argv, "pids") == 0)
return netns_pids(argc-1, argv+1);
if (matches(*argv, "exec") == 0)
return netns_exec(argc-1, argv+1);
if (matches(*argv, "monitor") == 0)
return netns_monitor(argc-1, argv+1);
if (matches(*argv, "attach") == 0)
return netns_add(argc-1, argv+1,
0
);
fprintf(
stderr
, "Command \"%s\" is unknown, try \"ip netns help\".\n", *argv);
exit(-1);
}
|
long long do_netns(unsigned long a0, unsigned long long a1[2], unsigned int a2, unsigned int a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v1;
netns_nsid_socket_init();
if (a0 <= 0) {
netns_map_init();
v1 = netns_list(0x0, 0x0, a2, a3, a4, a5);
return v1;
}
if ((do_all ^ 1) && a0 > 1 && invalid_name(a1[1])) {
fprintf(*(&stderr), "Invalid netns name \"%s\"\n", a1[1]);
exit(0xffffffff);
}
if (!(matches(a1[0], "list") ^ 1) && !(matches(a1[0], "show") ^ 1) && !(matches(a1[0], "lst") ^ 1)) {
if ((matches(a1[0], "list-id") ^ 1)) {
netns_map_init();
v1 = netns_list_id(a0 - 1, &a1[1], &a1[1], a3, a4, a5);
return v1;
} else if ((matches(a1[0], "help") ^ 1)) {
usage();
} else if ((matches(a1[0], "add") ^ 1)) {
v1 = netns_add(a0 - 1, &a1[1], 0x1);
return v1;
} else if ((matches(a1[0], "set") ^ 1)) {
v1 = netns_set(a0 - 1, &a1[1]);
return v1;
} else if ((matches(a1[0], "delete") ^ 1)) {
v1 = netns_delete(a0 - 1, &a1[1]);
return v1;
} else if ((matches(a1[0], "identify") ^ 1)) {
v1 = netns_identify(a0 - 1, &a1[1]);
return v1;
} else if ((matches(a1[0], "pids") ^ 1)) {
v1 = netns_pids(a0 - 1, &a1[1]);
return v1;
} else if ((matches(a1[0], "exec") ^ 1)) {
v1 = netns_exec(a0 - 1, &a1[1]);
return v1;
} else if ((matches(a1[0], "monitor") ^ 1)) {
v1 = netns_monitor(a0 - 1, &a1[1]);
return v1;
} else if (!(matches(a1[0], "attach") ^ 1)) {
fprintf(*(&stderr), "Command \"%s\" is unknown, try \"ip netns help\".\n", a1[0]);
exit(0xffffffff);
} else {
v1 = netns_add(a0 - 1, &a1[1], 0x0);
return v1;
}
}
netns_map_init();
v1 = netns_list(a0 - 1, &a1[1], &a1[1], a3, a4, a5);
return v1;
}
|
char *
nvis(char *mbdst, size_t dlen, int c, int flags, int nextc)
{
char cc[2];
int ret;
cc[0] = c;
cc[1] = nextc;
ret = istrsenvisx(&mbdst, &dlen, cc, 1, flags, "",
((void *)0)
);
if (ret < 0)
return
((void *)0)
;
return mbdst + ret;
}
|
char * nvis(char *a1, size_t a2, char a3, unsigned int a4, char a5)
{
size_t v6;
char *v7;
int v8;
char v9[2];
unsigned long v10;
v7 = a1;
v6 = a2;
v10 = __readfsqword(0x28u);
v9[0] = a3;
v9[1] = a5;
v8 = istrsenvisx(&v7, &v6, v9, 1uLL, a4, byte_18FC, 0LL);
if ( v8 >= 0 )
return &v7[v8];
else
return 0LL;
}
|
void
_rl_init_executing_keyseq (void)
{
rl_executing_keyseq[rl_key_sequence_length = 0] = '\0';
}
|
void _rl_init_executing_keyseq(void)
{
rl_key_sequence_length = 0;
*rl_executing_keyseq = 0;
return;
}
|
static int
_pidfile_remove(struct pidfh *pfh, int freeit)
{
int error;
error = pidfile_verify(pfh);
if (error != 0) {
(*__errno_location ())
= error;
return (-1);
}
if (unlink(pfh->pf_path) == -1)
error =
(*__errno_location ())
;
if (close(pfh->pf_fd) == -1) {
if (error == 0)
error =
(*__errno_location ())
;
}
if (freeit) {
free(pfh->pf_path);
free(pfh);
} else
pfh->pf_fd = -1;
if (error != 0) {
(*__errno_location ())
= error;
return (-1);
}
return (0);
}
|
void _pidfile_remove(struct_0 *a0, unsigned long a1) {
unsigned int v0;
unsigned long long v2;
void* v5;
unsigned long long v6;
v0 = pidfile_verify(a0);
if (v0) {
*(__errno_location()) = v0;
v2 = 4294967295;
} else {
if (unlink(a0->field_8) == -1)
v0 = *(__errno_location());
if (close(a0->field_0) == -1 && !v0)
v0 = *(__errno_location());
if (!a1) {
a0->field_0 = -1;
} else {
free(a0->field_8);
free(a0);
}
if (!v0) {
v5 = 0;
} else {
*(__errno_location()) = v0;
v6 = 4294967295;
}
}
return;
}
|
static void update_signed_certificate(common_info_st * cinfo)
{
gnutls_x509_crt_t crt;
int result;
gnutls_privkey_t ca_key;
gnutls_privkey_t pkey;
gnutls_pubkey_t pubkey;
gnutls_x509_crt_t ca_crt;
gnutls_datum_t out;
time_t tim;
unsigned int flags = 0;
fprintf(stdlog, "Generating a signed certificate...\n");
ca_key = load_ca_private_key(cinfo);
ca_crt = load_ca_cert(1, cinfo);
crt = load_cert(1, cinfo);
fprintf(
stderr
, "Activation/Expiration time.\n");
tim = get_activation_date();
result = gnutls_x509_crt_set_activation_time(crt, tim);
if (result < 0) {
fprintf(
stderr
, "set_activation: %s\n",
gnutls_strerror(result));
app_exit(1);
}
tim = get_expiration_date();
result = gnutls_x509_crt_set_expiration_time(crt, tim);
if (result < 0) {
fprintf(
stderr
, "set_expiration: %s\n",
gnutls_strerror(result));
app_exit(1);
}
pkey = load_private_key(0, cinfo);
pubkey = load_public_key_or_import(0, pkey, cinfo);
if (pubkey) {
fprintf(
stderr
, "Updating public key\n");
result = gnutls_x509_crt_set_pubkey(crt, pubkey);
if (result < 0) {
fprintf(
stderr
, "cannot set public key: %s\n",
gnutls_strerror(result));
app_exit(1);
}
}
fprintf(
stderr
, "\n\nSigning certificate...\n");
if (cinfo->rsa_pss_sign)
flags |= GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS;
result =
gnutls_x509_crt_privkey_sign(crt, ca_crt, ca_key,
get_dig(ca_crt, cinfo), flags);
if (result < 0) {
fprintf(
stderr
, "crt_sign: %s\n", gnutls_strerror(result));
app_exit(1);
}
result =
gnutls_x509_crt_export2(crt, outcert_format, &out);
if (result < 0) {
fprintf(
stderr
, "crt_export: %s\n", gnutls_strerror(result));
app_exit(1);
}
fwrite(out.data, 1, out.size, outfile);
gnutls_free((void *) (out.data)), out.data=
((void *)0)
;
gnutls_x509_crt_deinit(crt);
}
|
void update_signed_certificate(struct_0 *a0) {
unsigned int v0;
unsigned int v1;
unsigned long long v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
void* v8;
char v9;
char v10;
unsigned long long *v12;
unsigned long long v13;
v0 = 0;
fprintf(stdlog, "Generating a signed certificate...\n");
v2 = load_ca_private_key(a0);
v3 = load_ca_cert(0x1, a0);
v4 = load_cert(0x1, a0);
fprintf(stderr, "Activation/Expiration time.\n");
v5 = get_activation_date();
v1 = gnutls_x509_crt_set_activation_time(v4, v5, v5);
if (v1 < 0) {
fprintf(stderr, "set_activation: %s\n", gnutls_strerror(v1));
app_exit(0x1);
}
v5 = get_expiration_date();
v1 = gnutls_x509_crt_set_expiration_time(v4, v5, v5);
if (v1 < 0) {
fprintf(stderr, "set_expiration: %s\n", gnutls_strerror(v1));
app_exit(0x1);
}
v6 = load_private_key(0x0, a0);
v7 = load_public_key_or_import(0x0, v6, a0);
if (v7) {
fprintf(stderr, "Updating public key\n");
v1 = gnutls_x509_crt_set_pubkey(v4, v7, v7);
if (v1 < 0) {
fprintf(stderr, "cannot set public key: %s\n", gnutls_strerror(v1));
app_exit(0x1);
}
}
if (!v7 || v1 >= 0) {
fprintf(stderr, "\n\nSigning certificate...\n");
if (a0->field_c8)
v0 |= 128;
v1 = gnutls_x509_crt_privkey_sign(v4, v3, v2, get_dig(v3, a0), v0);
if (v1 < 0) {
fprintf(stderr, "crt_sign: %s\n", gnutls_strerror(v1));
app_exit(0x1);
}
v1 = gnutls_x509_crt_export2(v4, outcert_format, &v8, outcert_format);
if (v1 < 0) {
fprintf(stderr, "crt_export: %s\n", gnutls_strerror(v1));
app_exit(0x1);
}
fwrite(*(&v8), 0x1, *(&v9), outfile);
*(5243720)(*(&v8));
v8 = 0;
gnutls_x509_crt_deinit(v4);
v13 = *(&v10) ^ v12[5];
return;
}
}
|
int
lastlog_write_entry(struct logininfo *li)
{
struct lastlog last;
int fd;
switch(li->type) {
case 7:
memset(&last, '\0', sizeof(last));
line_stripname(last.ll_line, li->line, sizeof(last.ll_line));
strlcpy(last.ll_host, li->hostname,
(sizeof(last.ll_host) < sizeof(li->hostname) ? sizeof(last.ll_host) : sizeof(li->hostname)));
last.ll_time = li->tv_sec;
if (!lastlog_openseek(li, &fd,
02
|
0100
))
return (0);
if (atomicio((ssize_t (*)(int, void *, size_t))write, fd, &last, sizeof(last)) != sizeof(last)) {
close(fd);
sshlog("loginrec.c", __func__, 1557, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "%s: Error writing to %s: %s", __func__,
"/var/log/lastlog"
, strerror(
(*__errno_location ())
))
;
return (0);
}
close(fd);
return (1);
default:
sshlog("loginrec.c", __func__, 1565, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "%s: Invalid type field", __func__);
return (0);
}
}
|
undefined8 lastlog_write_entry(long param_1)
{
int iVar1;
undefined8 uVar2;
long lVar3;
int *piVar4;
char *pcVar5;
long in_FS_OFFSET;
int local_13c;
undefined4 local_138;
undefined auStack308 [32];
undefined auStack276 [260];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
if (*(short *)(param_1 + 0x44) == 7) {
memset(&local_138,0,0x124);
line_stripname(auStack308,param_1 + 0x50,0x20);
strlcpy(auStack276,param_1 + 0x290,0x100);
local_138 = *(undefined4 *)(param_1 + 0x398);
iVar1 = lastlog_openseek(param_1,&local_13c,0x42);
if (iVar1 == 0) {
uVar2 = 0;
}
else {
lVar3 = atomicio(uRam0000000000100ebf,local_13c,&local_138,0x124);
if (lVar3 == 0x124) {
close(local_13c);
uVar2 = 1;
}
else {
close(local_13c);
piVar4 = __errno_location();
pcVar5 = strerror(*piVar4);
sshlog("loginrec.c","lastlog_write_entry",0x615,0,3,0,"%s: Error writing to %s: %s",
"lastlog_write_entry","/var/log/lastlog",pcVar5);
uVar2 = 0;
}
}
}
else {
sshlog("loginrec.c","lastlog_write_entry",0x61d,0,3,0,"%s: Invalid type field",
"lastlog_write_entry");
uVar2 = 0;
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar2;
}
|
acl_t
acl_get_file(const char *path_p, acl_type_t type)
{
const size_t size_guess = acl_ea_size(16);
char *ext_acl_p =
__builtin_alloca (
size_guess
)
;
const char *name;
int retval;
switch(type) {
case (0x8000):
name = "system.posix_acl_access";
break;
case (0x4000):
name = "system.posix_acl_default";
break;
default:
(*__errno_location ())
=
22
;
return
((void *)0)
;
}
if (!ext_acl_p)
return
((void *)0)
;
retval = getxattr(path_p, name, ext_acl_p, size_guess);
if (retval == -1 &&
(*__errno_location ())
==
34
) {
retval = getxattr(path_p, name,
((void *)0)
, 0);
if (retval > 0) {
ext_acl_p =
__builtin_alloca (
retval
)
;
if (!ext_acl_p)
return
((void *)0)
;
retval = getxattr(path_p, name, ext_acl_p, retval);
}
}
if (retval > 0) {
acl_t acl = __acl_from_xattr(ext_acl_p, retval);
return acl;
} else if (retval == 0 ||
(*__errno_location ())
==
61
||
(*__errno_location ())
==
61
) {
struct stat st;
if (stat(path_p, &st) != 0)
return
((void *)0)
;
if (type == (0x4000)) {
if (
((((
st.st_mode
)) & 0170000) == (0040000))
)
return acl_init(0);
else {
(*__errno_location ())
=
13
;
return
((void *)0)
;
}
} else
return acl_from_mode(st.st_mode);
} else
return
((void *)0)
;
}
|
long acl_get_file(char *a1, int a2)
{
size_t v2;
void *v3;
long result;
unsigned long v5;
void *v6;
_BYTE v7[4];
int v8;
char *path;
int v10;
void *value;
char *name;
size_t size;
long v14;
struct stat v15;
unsigned long v16;
path = a1;
v8 = a2;
v16 = __readfsqword(0x28u);
size = acl_ea_size(16);
v2 = 16 * ((size + 23) / 0x10);
while ( v7 != &v7[-(v2 & 0xFFFFFFFFFFFFF000LL)] )
;
v3 = alloca(v2 & 0xFFF);
if ( (v2 & 0xFFF) != 0 )
*(_QWORD *)&v7[(v2 & 0xFFF) - 8] = *(_QWORD *)&v7[(v2 & 0xFFF) - 8];
value = v7;
if ( v8 == 0x4000 )
{
name = "system.posix_acl_default";
}
else
{
if ( v8 != 0x8000 )
{
*_errno_location() = 22;
return 0LL;
}
name = "system.posix_acl_access";
}
if ( !value )
return 0LL;
v10 = getxattr(path, name, value, size);
if ( v10 == -1 && *_errno_location() == 34 )
{
v10 = getxattr(path, name, 0LL, 0LL);
if ( v10 > 0 )
{
v5 = 16 * ((v10 + 23LL) / 0x10uLL);
while ( v7 != &v7[-(v5 & 0xFFFFFFFFFFFFF000LL)] )
;
v6 = alloca(v5 & 0xFFF);
if ( (v5 & 0xFFF) != 0 )
*(_QWORD *)&v7[(v5 & 0xFFF) - 8] = *(_QWORD *)&v7[(v5 & 0xFFF) - 8];
value = v7;
if ( !v7 )
return 0LL;
v10 = getxattr(path, name, value, v10);
}
}
if ( v10 <= 0 )
{
if ( !v10 || *_errno_location() == 61 || *_errno_location() == 61 )
{
if ( stat(path, &v15) )
{
return 0LL;
}
else if ( v8 == 0x4000 )
{
if ( (v15.st_mode & 0xF000) == 0x4000 )
{
return acl_init(0LL);
}
else
{
*_errno_location() = 13;
return 0LL;
}
}
else
{
return acl_from_mode(v15.st_mode);
}
}
else
{
return 0LL;
}
}
else
{
result = _acl_from_xattr(value, v10);
v14 = result;
}
return result;
}
|
void
Blowfish_initstate(blf_ctx *c)
{
static const blf_ctx initstate =
{ {
{
0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a},
{
0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7},
{
0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0},
{
0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6}
},
{
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
0x9216d5d9, 0x8979fb1b
} };
*c = initstate;
}
|
void Blowfish_initstate(undefined8 *param_1)
{
ulong uVar1;
long lVar2;
undefined8 *puVar3;
undefined8 *puVar4;
*param_1 = initstate_5651._0_8_;
param_1[0x208] = initstate_5651._4160_8_;
lVar2 = (long)param_1 - (long)(undefined8 *)((ulong)(param_1 + 1) & 0xfffffffffffffff8);
puVar3 = (undefined8 *)(initstate_5651 + -lVar2);
puVar4 = (undefined8 *)((ulong)(param_1 + 1) & 0xfffffffffffffff8);
for (uVar1 = (ulong)((int)lVar2 + 0x1048U >> 3); uVar1 != 0; uVar1 = uVar1 - 1) {
*puVar4 = *puVar3;
puVar3 = puVar3 + 1;
puVar4 = puVar4 + 1;
}
return;
}
|
void
login_free_entry(struct logininfo *li)
{
free(li);
}
|
long long login_free_entry(void* a0) {
return free(a0);
}
|
static
_Bool
portable_chars_only (char const *file, size_t filelen)
{
size_t validlen = strspn (file,
("/"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789._-"));
char const *invalid = file + validlen;
if (*invalid)
{
mbstate_t mbstate = { 0, };
size_t charlen =
rpl_mbrlen
(invalid, filelen - validlen, &mbstate);
error (0, 0,
gettext ("nonportable character %s in file name %s"),
quotearg_n_style_mem (1, locale_quoting_style, invalid,
(charlen <=
16
? charlen : 1)),
quotearg_n_style (0, shell_escape_always_quoting_style, file));
return
0
;
}
return
1
;
}
|
int portable_chars_only(char *a0, unsigned long a1) {
unsigned long v0;
char *v1;
unsigned long v2;
void* v3;
unsigned long v5;
unsigned long long v6;
unsigned long long v7;
v0 = strspn(a0, "/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-");
v1 = &a0[v0];
if (*(v1)) {
v3 = 0;
v2 = rpl_mbrlen(v1, a1 - v0, &v3, a1 - v0);
v6 = quotearg_n_style(0x0, 0x4, a0);
if (v2 <= 16)
v5 = v2;
else
v5 = 1;
v7 = quotearg_n_style_mem(0x1, 0x8, v1, v5);
error(0x0, 0x0, gettext("nonportable character %s in file name %s"));
*(&v5) = 0;
} else {
v5 = 1;
}
return v5;
}
|
static const char *
parse_awaiter_package(void)
{
struct dpkg_error err = { DPKG_MSG_NONE, 0,
((void *)0)
};
struct pkginfo *pkg;
if (!f_await)
bypackage = "-";
if (bypackage ==
((void *)0)
) {
const char *pkgname, *archname;
pkgname = getenv("DPKG_MAINTSCRIPT_PACKAGE");
archname = getenv("DPKG_MAINTSCRIPT_ARCH");
if (pkgname ==
((void *)0)
|| archname ==
((void *)0)
)
badusage(gettext("must be called from a maintainer script" " (or with a --by-package option)")
);
pkg = pkg_spec_find_pkg(pkgname, archname, &err);
} else if (strcmp(bypackage, "-") == 0) {
pkg =
((void *)0)
;
} else {
pkg = pkg_spec_parse_pkg(bypackage, &err);
}
if (pkg)
bypackage = pkg_name(pkg, pnaw_nonambig);
return err.str;
}
|
int parse_awaiter_package() {
void* v0;
unsigned long long v1;
unsigned long long v2;
unsigned int v3;
unsigned int v4;
void* v5;
v3 = 0;
v4 = 0;
v5 = 0;
if (!f_await)
bypackage = "-";
if (!bypackage) {
v1 = getenv("DPKG_MAINTSCRIPT_PACKAGE");
v2 = getenv("DPKG_MAINTSCRIPT_ARCH");
if (v1 && !(!v2))
goto LABEL_40020e;
badusage(gettext("must be called from a maintainer script (or with a --by-package option)"));
LABEL_40020e:
v0 = pkg_spec_find_pkg(v1, v2, &v3, v2);
} else if (!strcmp(bypackage, "-")) {
v0 = 0;
} else {
v0 = pkg_spec_parse_pkg(bypackage, &v3, &v3);
}
if (v0)
bypackage = pkg_name(v0, 0x1);
return v5;
}
|
static void slide_hash(s)
deflate_state *s;
{
unsigned n, m;
Posf *p;
uInt wsize = s->w_size;
n = s->hash_size;
p = &s->head[n];
do {
m = *--p;
*p = (Pos)(m >= wsize ? m - wsize : 0);
} while (--n);
n = wsize;
p = &s->prev[n];
do {
m = *--p;
*p = (Pos)(m >= wsize ? m - wsize : 0);
} while (--n);
}
|
void slide_hash(long param_1)
{
uint uVar1;
ushort uVar2;
uint local_1c;
ushort *local_10;
uVar1 = *(uint *)(param_1 + 0x50);
local_1c = *(uint *)(param_1 + 0x84);
local_10 = (ushort *)(*(long *)(param_1 + 0x78) + (ulong)local_1c * 2);
do {
local_10 = local_10 + -1;
if (*local_10 < uVar1) {
uVar2 = 0;
}
else {
uVar2 = *local_10 - (short)uVar1;
}
*local_10 = uVar2;
local_1c = local_1c - 1;
} while (local_1c != 0);
local_10 = (ushort *)(*(long *)(param_1 + 0x70) + (ulong)uVar1 * 2);
local_1c = uVar1;
do {
local_10 = local_10 + -1;
if (*local_10 < uVar1) {
uVar2 = 0;
}
else {
uVar2 = *local_10 - (short)uVar1;
}
*local_10 = uVar2;
local_1c = local_1c - 1;
} while (local_1c != 0);
return;
}
|
) ==
((void *)0)
) {
nsyslog(
3
, "strdupa(): %s\n", strerror(
(*__errno_location ())
));
return 0;
}
|
void nsyslog(unsigned long a0, char *a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5) {
unsigned int v0;
unsigned int v1;
unsigned long v2;
unsigned long v3;
unsigned long long v4;
char v5;
unsigned long v6;
unsigned long v7;
unsigned long v8;
unsigned long v9;
int v10;
int v11;
int v12;
int v13;
int v14;
int v15;
int v16;
int v17;
unsigned long v18;
char v19;
int v20;
int v21;
int v22;
int v23;
int v24;
int v25;
int v26;
int v27;
unsigned long long *v28;
unsigned long long v30;
v6 = a2;
v7 = a3;
v8 = a4;
v9 = a5;
if (v19) {
v10 = v20;
v11 = v21;
v12 = v22;
v13 = v23;
v14 = v24;
v15 = v25;
v16 = v26;
v17 = v27;
}
v4 = v28[5];
v0 = 16;
v1 = 48;
v2 = &v18;
v3 = &v5;
if (!ttyname(0x0)) {
vsyslog(a0, a1, &v0);
} else {
fprintf(stderr, "%s: ", 612141384);
vfprintf(stderr, a1, &v0);
fprintf(stderr, "\n");
}
v30 = v4 ^ v28[5];
if ((v4 ^ v28[5]))
__stack_chk_fail();
return;
}
|
static int get_groups (char *list)
{
char *cp;
struct group *grp;
int errors = 0;
int ngroups = 0;
if ('\0' == *list) {
return 0;
}
open_group_files ();
do {
cp = strchr (list, ',');
if (
((void *)0)
!= cp) {
*cp++ = '\0';
}
grp = get_local_group (list);
if (
((void *)0)
== grp) {
fprintf (
stderr
,
gettext ("%s: group '%s' does not exist\n"),
Prog, list);
errors++;
}
list = cp;
if (
((void *)0)
== grp) {
continue;
}
if (ngroups == sys_ngroups) {
fprintf (
stderr
,
gettext ("%s: too many groups specified (max %d).\n"),
Prog, ngroups);
gr_free(grp);
break;
}
user_groups[ngroups++] = xstrdup (grp->gr_name);
gr_free (grp);
} while (
((void *)0)
!= list);
close_group_files ();
unlock_group_files ();
user_groups[ngroups] = (char *) 0;
if (0 != errors) {
return -1;
}
return 0;
}
|
int get_groups(char *a0) {
char *v0;
int tmp_23;
unsigned int v1;
unsigned int v2;
unsigned long v3;
unsigned long long *v4;
unsigned long v6;
v0 = a0;
v1 = 0;
v2 = 0;
if (!*(v0)) {
v6 = 0;
} else {
open_group_files();
while (true) {
v3 = strchr(v0, 0x2c);
if (v3) {
v6 = v3;
v3 += 1;
*(v6) = 0;
}
v4 = get_local_group(v0);
if (!v4) {
fprintf(stderr, gettext("%s: group '%s' does not exist\n"));
v1 += 1;
}
v0 = v3;
if (v4) {
if (v2 == sys_ngroups) {
fprintf(stderr, gettext("%s: too many groups specified (max %d).\n"));
gr_free(v4);
break;
} else {
tmp_23 = v2;
v2 += 1;
*((user_groups + tmp_23 * 8)) = xstrdup(*(v4));
gr_free(v4);
}
}
if (!v4 || v2 != sys_ngroups) {
if (!v0)
break;
}
}
close_group_files();
unlock_group_files();
*((user_groups + v2 * 8)) = 0;
if (v1)
*(&v6) = -1;
else
*(&v6) = 0;
}
return v6;
}
|
static inline void sort_r_simple(void *base, size_t nel, size_t w,
int (*compar)(const void *_a,
const void *_b,
void *_arg),
void *arg)
{
char *b = (char *)base, *end = b + nel*w;
if(nel < 10) {
char *pi, *pj;
for(pi = b+w; pi < end; pi += w) {
for(pj = pi; pj > b && sort_r_cmpswap(pj-w,pj,w,compar,arg); pj -= w) {}
}
}
else
{
int cmp;
char *pl, *ple, *pr, *pre, *pivot;
char *last = b+w*(nel-1), *tmp;
char *l[3];
l[0] = b + w;
l[1] = b+w*(nel/2);
l[2] = last - w;
if(compar(l[0],l[1],arg) > 0) { ((tmp) = (l[0]), (l[0]) = (l[1]), (l[1]) = (tmp)); }
if(compar(l[1],l[2],arg) > 0) {
((tmp) = (l[1]), (l[1]) = (l[2]), (l[2]) = (tmp));
if(compar(l[0],l[1],arg) > 0) { ((tmp) = (l[0]), (l[0]) = (l[1]), (l[1]) = (tmp)); }
}
if(l[1] != last) { sort_r_swap(l[1], last, w); }
pivot = last;
ple = pl = b;
pre = pr = last;
while(pl < pr) {
for(; pl < pr; pl += w) {
cmp = compar(pl, pivot, arg);
if(cmp > 0) { break; }
else if(cmp == 0) {
if(ple < pl) { sort_r_swap(ple, pl, w); }
ple += w;
}
}
if(pl >= pr) { break; }
for(; pl < pr; ) {
pr -= w;
cmp = compar(pr, pivot, arg);
if(cmp == 0) {
pre -= w;
if(pr < pre) { sort_r_swap(pr, pre, w); }
}
else if(cmp < 0) {
if(pl < pr) { sort_r_swap(pl, pr, w); }
pl += w;
break;
}
}
}
pl = pr;
sort_r_swap_blocks(b, ple-b, pl-ple);
sort_r_swap_blocks(pr, pre-pr, end-pre);
sort_r_simple(b, (pl-ple)/w, w, compar, arg);
sort_r_simple(end-(pre-pr), (pre-pr)/w, w, compar, arg);
}
}
|
void sort_r_simple(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long long a3, unsigned long long a4) {
unsigned long v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned long v4;
unsigned long long v5;
unsigned long v6;
unsigned int v7;
unsigned long v8;
unsigned long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
unsigned long v14;
char v15;
unsigned long long *v17;
unsigned long long v18;
v0 = a2;
v8 = a0 + a2 * a1;
if (a1 > 9) {
v9 = a0 + a2 * (a1 - 1);
v12 = a2 + a0;
v13 = a0 + a2 * (a1 >> 1);
v14 = v9 + -(v0);
if ((stack_base)[168](v12, v13, a4, v13, a3) > 0) {
v10 = v12;
v12 = v13;
v13 = v10;
}
if ((stack_base)[168](v13, v14, a4, v14, a3) > 0) {
v10 = v13;
v13 = v14;
v14 = v10;
if ((stack_base)[168](v12, v13, a4, v13, a3) > 0) {
v10 = v12;
v12 = v13;
v13 = v10;
}
}
if (v9 != v13)
sort_r_swap(v13, v9, a2);
v11 = v9;
v4 = a0;
v5 = v4;
v6 = v9;
*(&v7) = v6;
while (true) {
LABEL_40059e:
if (v4 >= v6)
break;
while (true) {
if (v4 >= v6)
break;
v1 = (stack_base)[168](v4, v11, a4, v11, a3);
if (v1 > 0)
break;
if (!v1) {
if (v5 < v4)
sort_r_swap(v5, v4, a2);
v5 += a2;
}
v4 += a2;
}
if (v4 >= v6)
break;
do {
if (v4 >= v6)
goto LABEL_40059e;
v6 += -(v0);
v1 = (stack_base)[168](v6, v11, a4, v11, a3);
if (!v1) {
*(&v7) = *(&v7) + -(v0);
if (v6 < *(&v7))
sort_r_swap(v6, *(&v7), a2);
continue;
}
} while (v1 >= 0);
if (v4 < v6)
sort_r_swap(v4, v6, a2);
v4 += a2;
}
v4 = v6;
sort_r_swap_blocks(a0, v5 - a0, v4 - v5);
sort_r_swap_blocks(v6, *(&v7) - v6, v8 - *(&v7));
sort_r_simple(a0, (0 CONCAT v4 - v5) /m a2, a2, a3, a4);
sort_r_simple(-(*(&v7) - v6) + v8, (0 CONCAT *(&v7) - v6) /m a2, a2, a3, a4);
} else {
for (*(&v2) = a2 + a0; *(&v2) < v8; *(&v2) = *(&v2) + a2) {
*(&v3) = *(&v2);
while (true) {
if (*(&v3) <= a0)
break;
if (!sort_r_cmpswap(-(v0) + *(&v3), *(&v3), a2, a3, a4))
break;
*(&v3) = *(&v3) + -(v0);
}
}
}
v18 = *(&v15) ^ v17[5];
return;
}
|
void e2fsck_read_inode_full(e2fsck_t ctx, unsigned long ino,
struct ext2_inode *inode, int bufsize,
const char *proc)
{
errcode_t retval;
retval = ext2fs_read_inode_full(ctx->fs, ino, inode, bufsize);
if (retval) {
com_err("ext2fs_read_inode_full", retval,
(gettext ("while reading inode %lu in %s")), ino, proc);
fatal_error(ctx, 0);
}
}
|
long long e2fsck_read_inode_full(unsigned long long *a0, unsigned long long a1, unsigned long long a2, unsigned long a3, unsigned long a4) {
unsigned long v0;
unsigned long long v1;
v0 = a4;
v1 = ext2fs_read_inode_full(*(a0), a1, a2, a3);
if (v1) {
com_err("ext2fs_read_inode_full", v1, gettext("while reading inode %lu in %s"), a1);
fatal_error();
}
return v1;
}
|
static void
fork_postauth(void)
{
if (need_controlpersist_detach)
control_persist_detach();
sshlog("ssh.c", __func__, 1758, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "forking to background");
options.fork_after_authentication = 0;
if (daemon(1, 1) == -1)
sshfatal("ssh.c", __func__, 1761, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "daemon() failed: %.200s", strerror(
(*__errno_location ())
));
if (stdfd_devnull(1, 1, !(log_is_on_stderr() && debug_flag)) == -1)
sshlog("ssh.c", __func__, 1763, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "stdfd_devnull failed");
}
|
void fork_postauth() {
char v0;
char v1;
unsigned long long v2;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
if (need_controlpersist_detach)
control_persist_detach();
sshlog("ssh.c", "fork_postauth", 0x6de, 0x0, 0x5, 0x0, "forking to background", *(&v0));
g_4013d0 = 0;
if (daemon(0x1, 0x1) == -1) {
strerror(*(__errno_location()));
sshfatal("ssh.c", "fork_postauth", 0x6e1, 0x0, 0x1, 0x0);
}
v4 = log_is_on_stderr();
if (v4 && debug_flag)
v5 = 0;
if (!debug_flag || !v4)
v5 = 1;
v6 = stdfd_devnull(0x1, 0x1, v5);
if (v6 == -1)
v7 = sshlog("ssh.c", "fork_postauth", 0x6e3, 0x1, 0x2, 0x0, *(&v1), v2);
return;
}
|
static int
bash_backward_kill_shellword (count, key)
int count, key;
{
int p;
if (count < 0)
return (bash_kill_shellword (-count, key));
p = rl_point;
bash_backward_shellword (count, key);
if (rl_point != p)
rl_kill_text (p, rl_point);
if (rl_editing_mode == 1)
rl_mark = rl_point;
return 0;
}
|
undefined8 bash_backward_kill_shellword(int param_1,undefined4 param_2)
{
int iVar1;
undefined8 uVar2;
iVar1 = rl_point;
if (param_1 < 0) {
uVar2 = bash_kill_shellword(-param_1,param_2);
}
else {
bash_backward_shellword(param_1,param_2);
if (iVar1 != rl_point) {
rl_kill_text(iVar1,rl_point);
}
if (rl_editing_mode == 1) {
rl_mark = rl_point;
}
uVar2 = 0;
}
return uVar2;
}
|
static
_Bool
operand_matches (char const *str, char const *pattern, char delim)
{
while (*pattern)
if (*str++ != *pattern++)
return
0
;
return !*str || *str == delim;
}
|
_BOOL8 operand_matches(char *a1, _BYTE *a2, char a3)
{
char *v3;
char v4;
_BYTE *v5;
while ( *a2 )
{
v3 = a1++;
v4 = *v3;
v5 = a2++;
if ( v4 != *v5 )
return 0LL;
}
return !*a1 || a3 == *a1;
}
|
static void
copy_attr_free (__attribute__ ((__unused__)) struct error_context *ctx,
__attribute__ ((__unused__)) char const *str)
{
}
|
void copy_attr_free()
{
;
}
|
static int ipvrf_exec(int argc, char **argv)
{
if (argc < 1) {
fprintf(
stderr
, "No VRF name specified\n");
return -1;
}
if (argc < 2) {
fprintf(
stderr
, "No command specified\n");
return -1;
}
return -cmd_exec(argv[1], argv + 1, !!batch_mode, do_switch, argv[0]);
}
|
void ipvrf_exec(unsigned long a0, unsigned long long a1[2]) {
unsigned long long v1;
unsigned long long v2;
unsigned long long v3;
if (a0 <= 0) {
fprintf(*(&stderr), "No VRF name specified\n");
v1 = 4294967295;
} else if (a0 <= 1) {
fprintf(*(&stderr), "No command specified\n");
v2 = 4294967295;
} else {
v3 = -(cmd_exec(a1[1], &a1[1], batch_mode, do_switch, a1[0]));
}
return;
}
|
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 ())
));
}
|
long long sock_set_v6only(unsigned long a0) {
unsigned int v0;
v0 = 1;
sshlog("misc.c", "sock_set_v6only", 0x781, 0x0, 0x7, 0x0, "%s: set socket %d IPV6_V6ONLY", "sock_set_v6only");
if (setsockopt(a0, 0x29, 0x1a, &v0, 0x4) == -1)
sshlog("misc.c", "sock_set_v6only", 0x783, 0x0, 0x2, 0x0, "setsockopt IPV6_V6ONLY: %s", strerror(*(__errno_location())));
return 0;
}
|
static void
validate (struct Spec_list *s1, struct Spec_list *s2)
{
get_s1_spec_stats (s1);
if (s1->n_indefinite_repeats > 0)
{
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"the [c*] repeat construct may not appear in string1\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("the [c*] repeat construct may not appear in string1")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("the [c*] repeat construct may not appear in string1")), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
if (s2)
{
get_s2_spec_stats (s2, s1->length);
if (s2->n_indefinite_repeats > 1)
{
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"only one [c*] repeat construct may appear in string2\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("only one [c*] repeat construct may appear in string2")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("only one [c*] repeat construct may appear in string2")), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
if (translating)
{
if (s2->has_equiv_class)
{
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"[=c=] expressions may not appear in string2 when translating\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("[=c=] expressions may not appear in string2 when translating")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("[=c=] expressions may not appear in string2 when translating")), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
if (s2->has_restricted_char_class)
{
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"when translating, the only character classes that may appear in\\nstring2 are 'upper' and 'lower'\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("when translating, the only character classes that may appear in\nstring2 are 'upper' and 'lower'")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("when translating, the only character classes that may appear in\nstring2 are 'upper' and 'lower'")), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
validate_case_classes (s1, s2);
if (s1->length > s2->length)
{
if (!truncate_set1)
{
if (s2->length == 0)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"when not truncating set1, string2 must be non-empty\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("when not truncating set1, string2 must be non-empty")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("when not truncating set1, string2 must be non-empty")), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
string2_extend (s1, s2);
}
}
if (complement && s1->has_char_class
&& ! (s2->length == s1->length && homogeneous_spec_list (s2)))
{
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"when translating with complemented character classes,\\nstring2 must map all characters in the domain to one\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("when translating with complemented character classes,\nstring2 must map all characters in the domain to one")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("when translating with complemented character classes,\nstring2 must map all characters in the domain to one")), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
}
else
{
if (s2->n_indefinite_repeats > 0)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"the [c*] construct may appear in string2 only when translating\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("the [c*] construct may appear in string2 only when translating")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("the [c*] construct may appear in string2 only when translating")), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
}
}
|
void validate(long a1, long a2)
{
char *v2;
char *v3;
char *v4;
char *v5;
char *v6;
char *v7;
char *v8;
get_s1_spec_stats((_QWORD *)a1);
if ( *(_QWORD *)(a1 + 32) )
{
v2 = gettext("the [c*] repeat construct may not appear in string1");
error(1, 0, v2);
}
if ( a2 )
{
get_s2_spec_stats((_QWORD *)a2, *(_QWORD *)(a1 + 24));
if ( *(_QWORD *)(a2 + 32) > 1uLL )
{
v3 = gettext("only one [c*] repeat construct may appear in string2");
error(1, 0, v3);
}
if ( !translating )
goto LABEL_21;
if ( *(_BYTE *)(a2 + 48) )
{
v4 = gettext("[=c=] expressions may not appear in string2 when translating");
error(1, 0, v4);
}
if ( *(_BYTE *)(a2 + 50) )
{
v5 = gettext("when translating, the only character classes that may appear in\nstring2 are 'upper' and 'lower'");
error(1, 0, v5);
}
validate_case_classes((_QWORD *)a1, a2);
if ( *(_QWORD *)(a1 + 24) > *(_QWORD *)(a2 + 24) && truncate_set1 != 1 )
{
if ( !*(_QWORD *)(a2 + 24) )
{
v6 = gettext("when not truncating set1, string2 must be non-empty");
error(1, 0, v6);
}
string2_extend(a1, a2);
}
if ( complement
&& *(_BYTE *)(a1 + 49)
&& (*(_QWORD *)(a2 + 24) != *(_QWORD *)(a1 + 24) || (unsigned char)homogeneous_spec_list((_QWORD *)a2) != 1) )
{
v7 = gettext(
"when translating with complemented character classes,\n"
"string2 must map all characters in the domain to one");
error(1, 0, v7);
LABEL_21:
if ( *(_QWORD *)(a2 + 32) )
{
v8 = gettext("the [c*] construct may appear in string2 only when translating");
error(1, 0, v8);
}
}
}
}
|
static void print_encap_bpf(FILE *fp, struct rtattr *encap)
{
struct rtattr *tb[(__LWT_BPF_MAX - 1)+1];
(parse_rtattr_flags((tb), ((__LWT_BPF_MAX - 1)), ((void*)(((char*)(encap)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((encap)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)));
if (tb[LWT_BPF_IN])
print_encap_bpf_prog(fp, tb[LWT_BPF_IN], "in");
if (tb[LWT_BPF_OUT])
print_encap_bpf_prog(fp, tb[LWT_BPF_OUT], "out");
if (tb[LWT_BPF_XMIT])
print_encap_bpf_prog(fp, tb[LWT_BPF_XMIT], "xmit");
if (tb[LWT_BPF_XMIT_HEADROOM])
print_uint(PRINT_ANY, "headroom",
" %u ", rta_getattr_u32(tb[LWT_BPF_XMIT_HEADROOM]));
}
|
void print_encap_bpf(undefined8 param_1,ushort *param_2)
{
undefined4 uVar1;
long in_FS_OFFSET;
undefined local_38 [8];
long local_30;
long local_28;
long local_20;
long local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
parse_rtattr_flags(local_38,4,param_2 + 2,*param_2 - 4,0x8000);
if (local_30 != 0) {
print_encap_bpf_prog(param_1,local_30,&DAT_00107035);
}
if (local_28 != 0) {
print_encap_bpf_prog(param_1,local_28,&DAT_00107038);
}
if (local_20 != 0) {
print_encap_bpf_prog(param_1,local_20,&DAT_0010703c);
}
if (local_18 != 0) {
uVar1 = rta_getattr_u32(local_18);
print_uint(4,"headroom",&DAT_00107041,uVar1);
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
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 (" -h, --help display this help message and exit\n"), usageout);
(void) fputs (gettext (" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
(void) fputs ("\n", usageout);
exit (status);
}
|
void usage(unsigned long a0) {
void* v0;
unsigned long v1;
unsigned long v3;
void* v4;
v1 = v3;
if (a0)
v4 = stderr;
else
v4 = stdout;
v0 = v4;
fprintf(v0, gettext("Usage: %s [options]\n\nOptions:\n"));
fputs(gettext(" -h, --help display this help message and exit\n"), v0);
fputs(gettext(" -R, --root CHROOT_DIR directory to chroot into\n"), v0);
fputs("\n", v0);
exit(a0);
}
|
static
_Bool
stream_is_tty (FILE *fp)
{
int fd = fileno (fp);
if (-1 == fd)
{
return
0
;
}
else
{
return isatty (fd) ?
1
:
0
;
}
}
|
ulong stream_is_tty(FILE *param_1)
{
int iVar1;
ulong uVar2;
undefined4 extraout_var;
iVar1 = fileno(param_1);
if (iVar1 == -1) {
uVar2 = 0;
}
else {
iVar1 = isatty(iVar1);
uVar2 = CONCAT44(extraout_var,iVar1) & 0xffffffffffffff00 | (ulong)(iVar1 != 0);
}
return uVar2;
}
|
static void
do_change_passphrase(struct passwd *pw)
{
char *comment;
char *old_passphrase, *passphrase1, *passphrase2;
struct stat st;
struct sshkey *private;
int r;
if (!have_identity)
ask_filename(pw, "Enter file in which the key is");
if (stat(identity_file, &st) == -1)
sshfatal("ssh-keygen.c", __func__, 1413, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: %s", identity_file, strerror(
(*__errno_location ())
));
r = sshkey_load_private(identity_file, "", &private, &comment);
if (r == -43) {
if (identity_passphrase)
old_passphrase = xstrdup(identity_passphrase);
else
old_passphrase =
read_passphrase("Enter old passphrase: ",
0x0002);
r = sshkey_load_private(identity_file, old_passphrase,
&private, &comment);
freezero(old_passphrase, strlen(old_passphrase));
if (r != 0)
goto badkey;
} else if (r != 0) {
badkey:
sshfatal("ssh-keygen.c", __func__, 1430, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "Failed to load key %s", identity_file);
}
if (comment)
mprintf("Key has comment '%s'\n", comment);
if (identity_new_passphrase) {
passphrase1 = xstrdup(identity_new_passphrase);
passphrase2 =
((void *)0)
;
} else {
passphrase1 =
read_passphrase("Enter new passphrase (empty for no "
"passphrase): ", 0x0002);
passphrase2 = read_passphrase("Enter same passphrase again: ",
0x0002);
if (strcmp(passphrase1, passphrase2) != 0) {
explicit_bzero(passphrase1, strlen(passphrase1));
explicit_bzero(passphrase2, strlen(passphrase2));
free(passphrase1);
free(passphrase2);
printf("Pass phrases do not match. Try again.\n");
exit(1);
}
freezero(passphrase2, strlen(passphrase2));
}
if ((r = sshkey_save_private(private, identity_file, passphrase1,
comment, private_key_format, openssh_format_cipher, rounds)) != 0) {
sshlog("ssh-keygen.c", __func__, 1462, 0, SYSLOG_LEVEL_ERROR, ssh_err(r), "Saving key \"%s\" failed", identity_file);
freezero(passphrase1, strlen(passphrase1));
sshkey_free(private);
free(comment);
exit(1);
}
freezero(passphrase1, strlen(passphrase1));
sshkey_free(private);
free(comment);
printf("Your identification has been saved with the new passphrase.\n");
exit(0);
}
|
void do_change_passphrase(void* a0) {
unsigned long long v0;
unsigned long v1;
unsigned int v2;
char v3;
char v4;
char *v5;
void* v6;
void* v7;
char v8;
unsigned long long v9;
unsigned long long v10;
char v11;
unsigned long long v12;
unsigned long long *v13;
unsigned long long v14;
unsigned long long v15;
unsigned long long v16;
unsigned long long v17;
unsigned long long v18;
unsigned long long v19;
unsigned long long v20;
v9 = v13[5];
if (!have_identity)
ask_filename(a0, "Enter file in which the key is");
if (stat(&identity_file, &v8) == -1) {
v1 = strerror(*(__errno_location()));
v0 = &identity_file;
sshfatal("ssh-keygen.c", "do_change_passphrase", 0x585, 0x0, 0x1, 0x0, "%s: %s");
}
v2 = sshkey_load_private(&identity_file, &g_410d75, &v4, &v3);
if (v2 == -43) {
if (identity_passphrase)
v5 = xstrdup(identity_passphrase);
else
v5 = read_passphrase("Enter old passphrase: ", 0x2);
v2 = sshkey_load_private(&identity_file, v5, &v4, &v3);
v14 = strlen(v5);
freezero(v5, v14, v14);
}
if (v2) {
v10 = &identity_file;
v9 = "Failed to load key %s";
sshfatal("ssh-keygen.c", "do_change_passphrase", 0x596, 0x0, 0x1, ssh_err(v2), *(&v11));
}
if (*(&v3))
mprintf("Key has comment '%s'\n", *(&v3), v15, v16, v17);
if (identity_new_passphrase) {
v6 = xstrdup(identity_new_passphrase);
v7 = 0;
} else {
v6 = read_passphrase("Enter new passphrase (empty for no passphrase): ", 0x2);
v7 = read_passphrase("Enter same passphrase again: ", 0x2);
if (strcmp(v6, v7)) {
explicit_bzero(v6, strlen(v6));
explicit_bzero(v7, strlen(v7));
free(v6);
free(v7);
printf("Pass phrases do not match. Try again.\n");
exit(0x1);
}
v18 = strlen(v7);
freezero(v7, v18, v18);
}
v9 = rounds;
v2 = sshkey_save_private(*(&v4), &identity_file, v6, *(&v3), private_key_format, openssh_format_cipher);
if (!v2) {
v19 = strlen(v6);
freezero(v6, v19, v19);
sshkey_free(*(&v4));
free(*(&v3));
printf("Your identification has been saved with the new passphrase.\n");
exit(0x0);
}
v10 = &identity_file;
v9 = "Saving key \"%s\" failed";
sshlog("ssh-keygen.c", "do_change_passphrase", 0x5b6, 0x0, 0x2, ssh_err(v2), *(&v11), v12);
v20 = strlen(v6);
freezero(v6, v20, v20);
sshkey_free(*(&v4));
free(*(&v3));
exit(0x1);
}
|
static void
statdb_node_apply(const char *filename, struct file_stat *filestat)
{
if (chown(filename, filestat->uid, filestat->gid) < 0)
ohshite(gettext("error setting ownership of '%.255s'"), filename);
if (chmod(filename, filestat->mode & ~
0170000
))
ohshite(gettext("error setting permissions of '%.255s'"), filename);
dpkg_selabel_load();
dpkg_selabel_set_context(filename, filename, filestat->mode);
dpkg_selabel_close();
}
|
void statdb_node_apply(char *a0, unsigned int a1[3], unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
int tmp_18;
unsigned long long v2;
unsigned long long v3;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
if (chown(a0, a1[0], a1[1]) < 0) {
v2 = gettext("error setting ownership of '%.255s'");
ohshite(v2, a0, v2);
}
v3 = a1[2];
*(&v3) = (a1[2] >> 8) & 15;
tmp_18 = v3;
v5 = chmod(a0, tmp_18);
if (v5) {
v6 = gettext("error setting permissions of '%.255s'");
ohshite(v6, a0, v6);
}
dpkg_selabel_load();
dpkg_selabel_set_context(a0, a0, a1[2], a0);
v7 = dpkg_selabel_close(a0, reg_64, a2, a3, a4, a5);
return;
}
|
void
source(int argc, char **argv)
{
struct stat stb;
static BUF buffer;
BUF *bp;
off_t i, statbytes;
size_t amt, nr;
int fd = -1, haderr, indx;
char *last, *name, buf[
4096
+ 128], encname[
4096
];
int len;
for (indx = 0; indx < argc; ++indx) {
name = argv[indx];
statbytes = 0;
len = strlen(name);
while (len > 1 && name[len-1] == '/')
name[--len] = '\0';
if ((fd = open(name,
00
|
04000
)) == -1)
goto syserr;
if (strchr(name, '\n') !=
((void *)0)
) {
strnvis(encname, name, sizeof(encname), 0x10);
name = encname;
}
if (fstat(fd, &stb) == -1) {
syserr: run_err("%s: %s", name, strerror(
(*__errno_location ())
));
goto next;
}
if (stb.st_size < 0) {
run_err("%s: %s", name, "Negative file size");
goto next;
}
unset_nonblock(fd);
switch (stb.st_mode &
0170000
) {
case
0100000
:
break;
case
0040000
:
if (iamrecursive) {
rsource(name, &stb);
goto next;
}
default:
run_err("%s: not a regular file", name);
goto next;
}
if ((last = strrchr(name, '/')) ==
((void *)0)
)
last = name;
else
++last;
curfile = last;
if (pflag) {
if (do_times(remout, verbose_mode, &stb) < 0)
goto next;
}
snprintf(buf, sizeof buf, "C%04o %lld %s\n",
(u_int) (stb.st_mode & (
04000
|
02000
|
(0400|0200|0100)
|
((0400|0200|0100) >> 3)
|
(((0400|0200|0100) >> 3) >> 3)
)),
(long long)stb.st_size, last);
if (verbose_mode)
fmprintf(
stderr
, "Sending file modes: %s", buf);
(void) atomicio((ssize_t (*)(int, void *, size_t))write, remout, buf, strlen(buf));
if (response() < 0)
goto next;
if ((bp = allocbuf(&buffer, fd, 16384)) ==
((void *)0)
) {
next: if (fd != -1) {
(void) close(fd);
fd = -1;
}
continue;
}
if (showprogress)
start_progress_meter(curfile, stb.st_size, &statbytes);
set_nonblock(remout);
for (haderr = i = 0; i < stb.st_size; i += bp->cnt) {
amt = bp->cnt;
if (i + (off_t)amt > stb.st_size)
amt = stb.st_size - i;
if (!haderr) {
if ((nr = atomicio(read, fd,
bp->buf, amt)) != amt) {
haderr =
(*__errno_location ())
;
memset(bp->buf + nr, 0, amt - nr);
}
}
if (haderr) {
(void)atomicio((ssize_t (*)(int, void *, size_t))write, remout, bp->buf, amt);
memset(bp->buf, 0, amt);
continue;
}
if (atomicio6((ssize_t (*)(int, void *, size_t))write, remout, bp->buf, amt, scpio,
&statbytes) != amt)
haderr =
(*__errno_location ())
;
}
unset_nonblock(remout);
if (fd != -1) {
if (close(fd) == -1 && !haderr)
haderr =
(*__errno_location ())
;
fd = -1;
}
if (!haderr)
(void) atomicio((ssize_t (*)(int, void *, size_t))write, remout, "", 1);
else
run_err("%s: %s", name, strerror(haderr));
(void) response();
if (showprogress)
stop_progress_meter();
}
}
|
void source(unsigned long a0, unsigned long long *a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
void* v4;
void* v5;
unsigned long v6;
char *v7;
char *v8;
unsigned long long v9[2];
unsigned long v10;
char v11;
char v12;
char v13;
char v14;
unsigned long long v15;
char v16;
unsigned long long v17;
char v18;
char *v20;
unsigned short v21;
unsigned int v23;
unsigned long long v24;
unsigned long long v25;
unsigned long long v27;
unsigned long long v28;
unsigned long long *v29;
unsigned long long v30;
v17 = *(&v17);
v15 = *(&v15);
v3 = -1;
for (v1 = 0; v1 < a0; v1 = __addvsi3(v1, 0x1)) {
v8 = a1[v1];
v4 = 0;
for (v2 = strlen(v8); v2 > 1; v8[v2] = 0) {
v20 = __addvsi3(v2, 0xffffffff);
v21 = v20;
*(&v20) = *((v8 + v20));
if (v20 != 47)
break;
v2 = __addvsi3(v2, 0xffffffff);
v21 = v2;
}
v3 = open(v8, 0x800, v21);
if (v3 != -1) {
if (strchr(v8, 0xa)) {
strnvis(&v14, v8, 0x1000, 0x10);
v8 = &v14;
}
v23 = fstat(v3, &v11);
if (v23 != -1) {
if (*(&v13) < 0) {
run_err();
} else {
unset_nonblock(v3);
v23 = *(&v12) & 0xf000;
if ((*(&v12) & 0xf000) == 0x4000) {
rsource(v8, &v11);
} else if (v23 != 0x8000) {
run_err();
} else {
v7 = strrchr(v8, 0x2f);
if (!v7)
v7 = v8;
else
v7 += 1;
pwd = v7;
v24 = do_times(0x10ec8348e5894855, verbose_mode, &v11);
if (v24 >= 0) {
snprintf(&v16, 0x1080, "C%04o %lld %s\n", *(&v12) & 3583, *(&v13), v7);
if (verbose_mode)
fmprintf(stderr, "Sending file modes: %s", &v16);
atomicio(got.write, 0x10ec8348e5894855, &v16, strlen(&v16));
v25 = response();
if (v25 >= 0) {
v9[0] = allocbuf(&buffer.8140, v3, 0x4000);
if (v9) {
if (showprogress)
start_progress_meter(0x8bfc7d8910ec8348, *(&v13), &v4, *(&v13));
set_nonblock(0x10ec8348e5894855);
v5 = 0;
for (v0 = 0; v5 < *(&v13); v5 += v9[0]) {
v6 = v9[0];
if (__addvdi3(v6, v5) > *(&v13))
v6 = __subvdi3(*(&v13), v5);
if (!v0) {
v10 = atomicio(got.read, v3, v9[1], v6);
if (v10 != v6) {
v0 = *(__errno_location());
memset(v9[1] + v10, 0x0, v6 - v10);
}
}
if (v0) {
atomicio(got.write, 0x10ec8348e5894855, v9[1], v6);
memset(v9[1], 0x0, v6);
} else {
v27 = atomicio6(got.write, 0x10ec8348e5894855, v9[1], v6, scpio, &v4);
if (v6 != v27) {
*(&v27) = *(__errno_location());
v0 = v27;
}
}
}
unset_nonblock(0x10ec8348e5894855);
if (v3 != -1) {
v28 = close(v3);
if (v28 == -1 && !v0) {
*(&v28) = *(__errno_location());
v0 = v28;
}
v3 = -1;
}
if (!v0) {
atomicio(got.write, 0x10ec8348e5894855, &g_406e67, 0x1);
} else {
strerror(v0);
run_err();
}
response();
if (showprogress)
stop_progress_meter();
}
}
}
}
}
}
}
if (v3 == -1 || v23 == -1) {
strerror(*(__errno_location()));
run_err();
}
if ((!v9 || v24 < 0 || (*(&v12) & 0xf000) == 0x4000 || *(&v13) < 0 || v3 == -1 || v23 == -1 || v25 < 0 || v23 != 0x8000) && v3 != -1) {
close(v3);
v3 = -1;
}
}
v30 = *(&v18) ^ v29[5];
return;
}
|
int load_env(char *envstr, FILE * f) {
long filepos;
int fileline;
enum env_state state;
char quotechar, *c, *str, *val;
filepos = ftell(f);
fileline = LineNumber;
if (
(-1)
== get_string(envstr, 131072, f, "\n"))
return ((-1));
if ((DebugFlags & (0x0008)) != 0) printf ("load_env, read <%s>\n", envstr);
val = str = envstr;
state = NAMEI;
quotechar = '\0';
c = envstr;
while (state != ERROR && *c) {
switch (state) {
case NAMEI:
case VALUEI:
if (*c == '\'' || *c == '"')
quotechar = *c++;
state++;
case NAME:
case VALUE:
if (quotechar) {
if (*c == quotechar) {
state++;
c++;
break;
}
if (state == NAME && *c == '=') {
state = ERROR;
break;
}
}
else {
if (state == NAME) {
if (
((*__ctype_b_loc ())[(int) ((
(unsigned char) *c
))] & (unsigned short int) _ISspace)
) {
c++;
state++;
break;
}
if (*c == '=') {
state++;
break;
}
}
}
*str++ = *c++;
break;
case EQ1:
if (*c == '=') {
state++;
quotechar = '\0';
*str++ = *c;
val = str;
}
else {
if (!
((*__ctype_b_loc ())[(int) ((
(unsigned char) *c
))] & (unsigned short int) _ISspace)
)
state = ERROR;
}
c++;
break;
case EQ2:
case FINI:
if (
((*__ctype_b_loc ())[(int) ((
(unsigned char) *c
))] & (unsigned short int) _ISspace)
)
c++;
else
state++;
break;
default:
abort();
}
}
if (state != FINI && state != EQ2 && !(state == VALUE && !quotechar)) {
if ((DebugFlags & (0x0008)) != 0) printf ("load_env, not an env var, state = %d\n", state);
if (fseek(f, filepos, 0)) {
return (-1);
}
{if ((DebugFlags & (0x0008|0x0001)) != 0) printf ("linenum=%d\n",fileline); LineNumber = fileline; };
return (0);
}
*str = '\0';
if (state == VALUE) {
while (str > val &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)str[-1]
))] & (unsigned short int) _ISspace)
)
*(--str) = '\0';
}
return 1;
}
|
long long load_env(unsigned long long a0, void* a1) {
char v0;
int tmp_21;
int tmp_7;
int tmp_10;
unsigned int v1;
unsigned int v2;
char *v3;
char *v4;
char *v5;
unsigned int v6;
unsigned long long v8;
unsigned long long v9;
*(&v6) = ftell(a1);
v2 = LineNumber;
v8 = get_string(a0, 0x20000, a1, "\n");
if (v8 == -1) {
v9 = 4294967295;
} else {
if ((DebugFlags & 8))
printf("load_env, read <%s>\n", a0);
v4 = a0;
v5 = v4;
v1 = 0;
v0 = 0;
v3 = a0;
while (v1 != 7) {
if (!*(v3))
break;
switch (v1) {
case 2:
if (*(v3) == 61) {
v1 += 1;
v0 = 0;
tmp_21 = v4;
v4 += 1;
*(tmp_21) = *(v3);
v5 = v4;
} else {
*(&v8) = *((*(v3) * 2 + *(__ctype_b_loc())));
*(&v8) = v8 & 0x2000;
if (!v8)
v1 = 7;
}
v3 += 1;
break;
case 3: case 6:
*(&v8) = *((*(v3) * 2 + *(__ctype_b_loc())));
*(&v8) = v8 & 0x2000;
if (v8) {
v3 += 1;
break;
} else {
v1 += 1;
break;
}
case 0: case 4:
if (*(v3) == 39 || *(v3) == 34) {
tmp_7 = v3;
v3 += 1;
*(&v8) = *(tmp_7);
v0 = v8;
}
v1 += 1;
case 1: case 5:
if (v0) {
if (v0 == *(v3)) {
v1 += 1;
v3 += 1;
break;
} else if (v1 == 1 && *(v3) == 61) {
v1 = 7;
break;
}
} else {
if (v1 == 1) {
*(&v8) = *((*(v3) * 2 + *(__ctype_b_loc())));
*(&v8) = v8 & 0x2000;
if (v8) {
v3 += 1;
v1 += 1;
break;
} else if (*(v3) == 61) {
v1 += 1;
break;
}
}
}
if ((!v0 || v0 != *(v3)) && (!v0 || *(v3) != 61 || v1 != 1) && (!v8 || v0 || v1 != 1) && (v0 || v1 != 1 || *(v3) != 61)) {
tmp_10 = v3;
v3 += 1;
v8 = v4;
v4 += 1;
*(v8) = *(tmp_10);
break;
}
default:
abort();
}
}
if ((v1 == 5 || v1 != 3) && (v1 == 5 || v1 != 6) && (v0 || v1 != 5)) {
if ((DebugFlags & 8))
printf("load_env, not an env var, state = %d\n", v1);
if (fseek(a1, *(&v6), 0x0)) {
v9 = 4294967295;
} else {
if ((DebugFlags & 9))
printf("linenum=%d\n", v2);
LineNumber = v2;
v9 = 0;
}
}
if (v1 == 3 || v1 == 6 || !v0 && v1 == 5) {
if (v1 == 5) {
for (*(v4) = 0; v4 > v5; *(v4) = 0) {
*(&v8) = *((*(__ctype_b_loc()) + v4[1] * 2));
*(&v8) = v8 & 0x2000;
if (!v8)
break;
v4 += 1;
}
}
v9 = 1;
}
}
return v9;
}
|
static void
initSigprov(instanceData *__restrict__ const pData, struct nvlst *lst)
{
uchar szDrvrName[1024];
if(snprintf((char*)szDrvrName, sizeof(szDrvrName), "lmsig_%s", pData->sigprovName)
== sizeof(szDrvrName)) {
parser_errmsg("omfile: signature provider "
"name is too long: '%s' - signatures disabled",
pData->sigprovName);
goto done;
}
pData->sigprovNameFull = (uchar*)strdup((char*)(szDrvrName));
pData->sigprov.ifVersion = 1;
if(obj.UseObj("omfile.c", szDrvrName, szDrvrName, (void*) &pData->sigprov)
!= RS_RET_OK) {
parser_errmsg("omfile: could not load "
"signature provider '%s' - signatures disabled",
szDrvrName);
goto done;
}
if(pData->sigprov.Construct(&pData->sigprovData) != RS_RET_OK) {
parser_errmsg("omfile: error constructing "
"signature provider %s dataset - signatures disabled",
szDrvrName);
goto done;
}
pData->sigprov.SetCnfParam(pData->sigprovData, lst);
r_dbgprintf("omfile.c", "loaded signature provider %s, data instance at %p\n", szDrvrName, pData->sigprovData)
;
pData->useSigprov = 1;
done: return;
}
|
void initSigprov(struct_0 *a0, unsigned long long a1) {
char v0;
char v1;
unsigned long long *v3;
unsigned long long v4;
if (snprintf(&v0, 0x400, "lmsig_%s", a0->field_70) == 0x400) {
parser_errmsg("omfile: signature provider name is too long: '%s' - signatures disabled");
} else {
a0->field_78 = strdup(&v0);
a0->field_80 = 1;
if (g_405368("omfile.c", &v0, &v0, &a0->field_80, g_405368)) {
parser_errmsg("omfile: could not load signature provider '%s' - signatures disabled");
} else if (*(&a0->padding_84[4])(&a0->field_b8)) {
parser_errmsg("omfile: error constructing signature provider %s dataset - signatures disabled");
} else {
a0->field_90(a0->field_b8, a1, a1, a0->field_90);
r_dbgprintf("omfile.c", "loaded signature provider %s, data instance at %p\n");
a0->field_c8 = 1;
}
}
v4 = *(&v1) ^ v3[5];
return;
}
|
static int
sshsk_ed25519_sig(struct sk_sign_response *resp, struct sshbuf *sig)
{
int r = -1;
if (resp->sig_r ==
((void *)0)
) {
sshlog("ssh-sk.c", __func__, 614, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "sk_sign response invalid");
r = -4;
goto out;
}
if ((r = sshbuf_put_string(sig,
resp->sig_r, resp->sig_r_len)) != 0 ||
(r = sshbuf_put_u8(sig, resp->flags)) != 0 ||
(r = sshbuf_put_u32(sig, resp->counter)) != 0) {
sshlog("ssh-sk.c", __func__, 622, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "compose");
goto out;
}
r = 0;
out:
return r;
}
|
int sshsk_ed25519_sig(struct_0 *a0, unsigned long long a1) {
unsigned long long v0;
unsigned int v1;
v1 = -1;
if (!a0->field_8) {
v0 = "sk_sign response invalid";
sshlog("ssh-sk.c", "sshsk_ed25519_sig", 0x266, 0x1, 0x2, 0x0);
v1 = -0x4;
} else {
v1 = sshbuf_put_string(a1, a0->field_8, a0->field_10, a0->field_8);
if (v1) {
LABEL_401b95:
v0 = "compose";
sshlog("ssh-sk.c", "sshsk_ed25519_sig", 0x26e, 0x1, 0x2, ssh_err(v1));
} else {
v1 = sshbuf_put_u8(a1, a0->field_0, a0->field_0);
if (!(!v1))
goto LABEL_401b95;
v1 = sshbuf_put_u32(a1, a0->field_4);
if (!(!v1))
goto LABEL_401b95;
v1 = 0;
}
}
return v1;
}
|
|| !strlen(passphrase)) {
ciphername = "none";
kdfname = "none";
} else if (ciphername ==
|
size_t strlen(char *__s)
{
halt_baddata();
}
|
static
_Bool
diversion_is_owned_by_self(struct pkgset *set, struct fsys_namenode *namenode)
{
struct pkginfo *pkg;
struct fsys_node_pkgs_iter *iter;
_Bool
owned =
0
;
if (set ==
((void *)0)
)
return
0
;
for (pkg = &set->pkg; pkg; pkg = pkg->arch_next)
ensure_packagefiles_available(pkg);
iter = fsys_node_pkgs_iter_new(namenode);
while ((pkg = fsys_node_pkgs_iter_next(iter))) {
if (pkg->set == set) {
owned =
1
;
break;
}
}
fsys_node_pkgs_iter_free(iter);
return owned;
}
|
int diversion_is_owned_by_self(unsigned long a0, unsigned long long a1) {
char v0;
struct_0 *v1;
unsigned long long v2;
unsigned int v4;
v0 = 0;
if (!a0) {
v4 = 0;
return v4;
}
for (v1 = a0 + 16; v1; v1 = v1->field_8) {
ensure_packagefiles_available(v1);
}
v2 = fsys_node_pkgs_iter_new(a1);
while (true) {
v1 = fsys_node_pkgs_iter_next(v2);
if (!v1) {
fsys_node_pkgs_iter_free(v2);
v4 = v0;
return v4;
} else if (a0 == *(v1)) {
v0 = 1;
fsys_node_pkgs_iter_free(v2);
v4 = v0;
return v4;
}
}
}
|
static int
bash_transpose_shellwords (count, key)
int count, key;
{
char *word1, *word2;
int w1_beg, w1_end, w2_beg, w2_end;
int orig_point = rl_point;
if (count == 0)
return 0;
bash_forward_shellword (count, key);
w2_end = rl_point;
bash_backward_shellword (1, key);
w2_beg = rl_point;
bash_backward_shellword (count, key);
w1_beg = rl_point;
bash_forward_shellword (1, key);
w1_end = rl_point;
if ((w1_beg == w2_beg) || (w2_beg < w1_end))
{
rl_ding ();
rl_point = orig_point;
return 1;
}
word1 = rl_copy_text (w1_beg, w1_end);
word2 = rl_copy_text (w2_beg, w2_end);
rl_begin_undo_group ();
rl_point = w2_beg;
rl_delete_text (w2_beg, w2_end);
rl_insert_text (word1);
rl_point = w1_beg;
rl_delete_text (w1_beg, w1_end);
rl_insert_text (word2);
rl_point = w2_end;
rl_end_undo_group ();
sh_xfree((word1), "bashline.c", 1334);
sh_xfree((word2), "bashline.c", 1335);
return 0;
}
|
undefined8 bash_transpose_shellwords(int param_1,undefined4 param_2)
{
int iVar1;
int iVar2;
int iVar3;
int iVar4;
int iVar5;
undefined8 uVar6;
undefined8 uVar7;
iVar1 = rl_point;
if (param_1 == 0) {
uVar6 = 0;
rl_point = iVar1;
}
else {
bash_forward_shellword(param_1,param_2);
iVar2 = rl_point;
bash_backward_shellword(1,param_2);
iVar3 = rl_point;
bash_backward_shellword(param_1,param_2);
iVar4 = rl_point;
bash_forward_shellword(1,param_2);
iVar5 = rl_point;
if ((iVar4 == iVar3) || (iVar3 < rl_point)) {
rl_ding();
uVar6 = 1;
rl_point = iVar1;
}
else {
uVar6 = rl_copy_text(iVar4,rl_point);
uVar7 = rl_copy_text(iVar3,iVar2);
rl_begin_undo_group();
rl_point = iVar3;
rl_delete_text(iVar3,iVar2);
rl_insert_text(uVar6);
rl_point = iVar4;
rl_delete_text(iVar4,iVar5);
rl_insert_text(uVar7);
rl_point = iVar2;
rl_end_undo_group();
sh_xfree(uVar6,"bashline.c",0x536);
sh_xfree(uVar7,"bashline.c",0x537);
uVar6 = 0;
}
}
return uVar6;
}
|
static int
showpackages(const char *const *argv)
{
struct dpkg_error err;
struct pkg_array array;
struct pkginfo *pkg;
struct pkg_format_node *fmt;
_Bool
fmt_needs_db_fsys;
int i;
int rc = 0;
fmt = pkg_format_parse(showformat, &err);
if (!fmt) {
notice(gettext("error in show format: %s"), err.str);
dpkg_error_destroy(&err);
rc++;
return rc;
}
fmt_needs_db_fsys = pkg_format_needs_db_fsys(fmt);
if (!opt_loadavail)
modstatdb_open(msdbrw_readonly);
else
modstatdb_open(msdbrw_readonly | msdbrw_available_readonly);
pkg_array_init_from_hash(&array);
pkg_array_sort(&array, pkg_sorter_by_nonambig_name_arch);
if (!*argv) {
if (fmt_needs_db_fsys)
ensure_allinstfiles_available_quiet();
for (i = 0; i < array.n_pkgs; i++) {
pkg = array.pkgs[i];
if (pkg->status == PKG_STAT_NOTINSTALLED)
continue;
pkg_format_show(fmt, pkg, &pkg->installed);
}
} else {
if (fmt_needs_db_fsys)
pkg_array_foreach(&array, pkg_array_load_db_fsys,
((void *)0)
);
rc = pkg_array_match_patterns(&array, pkg_array_show_item, fmt, argv);
}
m_output(
stdout
, gettext("<standard output>"));
m_output(
stderr
, gettext("<standard error>"));
pkg_array_destroy(&array);
pkg_format_free(fmt);
modstatdb_shutdown();
return rc;
}
|
undefined4 showpackages(long *param_1)
{
long lVar1;
char cVar2;
long lVar3;
undefined8 uVar4;
long in_FS_OFFSET;
int local_60;
undefined4 local_5c;
undefined local_48 [8];
undefined8 local_40;
int local_38 [2];
long local_30;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
local_5c = 0;
lVar3 = pkg_format_parse(showformat,local_48);
if (lVar3 == 0) {
uVar4 = gettext("error in show format: %s");
notice(uVar4,local_40);
dpkg_error_destroy(local_48);
local_5c = 1;
}
else {
cVar2 = pkg_format_needs_db_fsys(lVar3);
if (opt_loadavail == 0) {
modstatdb_open(0);
}
else {
modstatdb_open(0x100);
}
pkg_array_init_from_hash(local_38);
pkg_array_sort(local_38,uRam00000000001016a1);
if (*param_1 == 0) {
if (cVar2 != '\0') {
ensure_allinstfiles_available_quiet();
}
for (local_60 = 0; local_60 < local_38[0]; local_60 = local_60 + 1) {
lVar1 = *(long *)(local_30 + (long)local_60 * 8);
if (*(int *)(lVar1 + 0x18) != 0) {
pkg_format_show(lVar3,lVar1,lVar1 + 0x48);
}
}
}
else {
if (cVar2 != '\0') {
pkg_array_foreach(local_38,pkg_array_load_db_fsys,0);
}
local_5c = pkg_array_match_patterns(local_38,pkg_array_show_item,lVar3,param_1);
}
uVar4 = gettext("<standard output>");
m_output(stdout,uVar4);
uVar4 = gettext("<standard error>");
m_output(stderr,uVar4);
pkg_array_destroy(local_38);
pkg_format_free(lVar3);
modstatdb_shutdown();
}
if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) {
return local_5c;
}
__stack_chk_fail();
}
|
static int
cluster_host_is_local(void)
{
char filename[
255
+1];
int is_local;
FILE *f;
char hostname[64], myhostname[64];
if (!EnableClustering)
return (1);
is_local = 0;
if (glue_strings(filename, sizeof filename, "/usr/local/var/spool/cron", ".cron.hostname", '/')) {
if ((f = fopen(filename, "r"))) {
if (
(-1)
!= get_string(hostname, 64, f, "\n") &&
gethostname(myhostname, 64) == 0) {
is_local = (strcmp(myhostname, hostname) == 0);
} else {
if ((DebugFlags & (0x0010)) != 0) printf ("cluster: hostname comparison error\n");
}
fclose(f);
} else {
if ((DebugFlags & (0x0010)) != 0) printf ("cluster: file %s not found\n", filename);
}
}
return (is_local);
}
|
bool cluster_host_is_local(void)
{
int iVar1;
FILE *__stream;
long in_FS_OFFSET;
bool bVar2;
char local_198 [64];
char local_158 [64];
char local_118 [264];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
if (EnableClustering == 0) {
bVar2 = true;
}
else {
bVar2 = false;
iVar1 = glue_strings(local_118,0x100,"/usr/local/var/spool/cron",".cron.hostname",0x2f);
if (iVar1 != 0) {
__stream = fopen(local_118,"r");
if (__stream == (FILE *)0x0) {
if ((DebugFlags & 0x10) != 0) {
printf("cluster: file %s not found\n",local_118);
}
}
else {
iVar1 = get_string(local_198,0x40,__stream,&DAT_00101568);
if ((iVar1 == -1) || (iVar1 = gethostname(local_158,0x40), iVar1 != 0)) {
if ((DebugFlags & 0x10) != 0) {
printf("cluster: hostname comparison error\n");
}
}
else {
iVar1 = strcmp(local_158,local_198);
bVar2 = iVar1 == 0;
}
fclose(__stream);
}
}
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return bVar2;
}
__stack_chk_fail();
}
|
static ssize_t
varvalue(char *name, int varflags, int flags, int quoted)
{
int num;
char *p;
int i;
int sep;
char sepc;
char **ap;
int subtype = varflags & 0x0f;
int discard = (subtype == 0x3 || subtype == 0xa) |
(flags & 0x400);
ssize_t len = 0;
char c;
if (!subtype) {
if (discard)
return -1;
sh_error("Bad substitution");
}
flags |= 0x200;
flags &= discard ? ~(0x1 | 0x10) : ~0;
sep = (flags & 0x1) << 8;
switch (*name) {
case '$':
num = rootpid;
goto numvar;
case '?':
num = exitstatus;
goto numvar;
case '#':
num = shellparam.nparam;
goto numvar;
case '!':
num = backgndpid;
if (num == 0)
return -1;
numvar:
len = cvtnum(num, flags);
break;
case '-':
p = makestrspace(17, expdest);
for (i = 17 - 1; i >= 0; i--) {
if (optlist[i] && optletters[i]) {
(*p++ = (optletters[i]));
len++;
}
}
expdest = p;
break;
case '@':
if (quoted && sep)
goto param;
case '*':
c = !((quoted | ~sep) & 0x100) - 1;
sep &= ~quoted;
sep |= ((varinit[0].flags & 0x20) == 0) ? (unsigned char)(c & (varinit[0].text + 4)[0]) : ' ';
param:
sepc = sep;
if (!(ap = shellparam.p))
return -1;
while ((p = *ap++)) {
len += strtodest(p, flags);
if (*ap && sep) {
len++;
memtodest(&sepc, 1, flags);
}
}
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
num = atoi(name);
if (num < 0 || num > shellparam.nparam)
return -1;
p = num ? shellparam.p[num - 1] : arg0;
goto value;
default:
p = lookupvar(name);
value:
if (!p)
return -1;
len = strtodest(p, flags);
break;
}
if (discard)
(expdest += (-len));
return len;
}
|
int varvalue(char *a0, unsigned long a1, unsigned long a2, unsigned long a3) {
unsigned int v0;
int tmp_11;
unsigned int v1;
char v2;
char v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned int v8;
char *v9;
struct_0 *v10;
void* v11;
unsigned int v13;
unsigned int v14;
v1 = a2;
v0 = a3;
v7 = a1 & 15;
switch (v7) {
case 3: case 10:
v13 = 1;
break;
default:
v13 = 0;
break;
}
v8 = v1 & 0x400 | v13;
v11 = 0;
if (!v7) {
if (!v8) {
sh_error("Bad substitution");
} else {
v14 = -1;
return v14;
}
}
v1 |= 0x200;
v14 = (!v8 ? -18 : -1);
v1 &= v14;
v6 = (v1 * 0x100) & 0x100;
switch (*(a0)) {
case 33:
v4 = backgndpid;
if (!v4) {
v14 = -1;
return v14;
}
v11 = cvtnum(v4, v1);
break;
case 35:
v4 = *(&shellparam);
v11 = cvtnum(v4, v1);
break;
case 36:
v4 = rootpid;
v11 = cvtnum(v4, v1);
break;
case 42:
*(&v14) = (!((!(v6) | a3) & 0x100) ? 255 : 0);
v3 = v14;
v6 &= !(v0);
if ((atoi & 32))
v14 = 32;
else
v14 = *((*(&arg0) + 4)) & v3;
v6 |= v14;
goto LABEL_4016ba;
case 45:
v9 = makestrspace(0x11, expdest, &g_402b14);
for (v5 = 16; v5 >= 0; v5 -= 1) {
if (*(v5 + &optlist) && *(v5 + &optletters)) {
v14 = v9;
v9 += 1;
*(v14) = *(v5 + &optletters);
v11 += 1;
}
}
expdest = v9;
break;
case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57:
v4 = atoi(a0);
if (v4 < 0) {
v14 = -1;
return v14;
}
if (v4 > *(&shellparam)) {
v14 = -1;
return v14;
}
v14 = (!v4 ? *((*(&dqsyntax) + v4 * 8 - 8)) : *(&arg0));
v9 = v14;
LABEL_4017b0:
if (!v9) {
v14 = -1;
return v14;
}
v11 = strtodest(v9, v1);
break;
case 63:
v4 = exitstatus;
v11 = cvtnum(v4, v1);
break;
case 64:
if (!(!a3) && !(!v6)) {
LABEL_4016ba:
v2 = v6;
v10 = *(&dqsyntax);
if (!v10) {
v14 = -1;
return v14;
}
while (true) {
tmp_11 = v10;
v10 = &v10->field_4;
v9 = *(tmp_11);
if (!v9)
break;
v11 = strtodest(v9, v1) + v11;
if (!(v10->field_0) || !(v6))
continue;
v11 += 1;
memtodest(&v2, 0x1, v1);
}
break;
}
default:
v9 = lookupvar(a0);
goto LABEL_4017b0;
}
if (v8)
expdest = expdest + -(v11);
v14 = v11;
return v14;
}
|
static int
get_next (struct Spec_list *s, enum Upper_Lower_class *class)
{
struct List_element *p;
int return_val;
int i;
if (class)
*class = UL_NONE;
if (s->state == (
(18446744073709551615UL)
- 1))
{
s->tail = s->head->next;
s->state = ((
(18446744073709551615UL)
- 1) + 1);
}
p = s->tail;
if (p ==
((void *)0)
)
return -1;
switch (p->type)
{
case RE_NORMAL_CHAR:
return_val = p->u.normal_char;
s->state = ((
(18446744073709551615UL)
- 1) + 1);
s->tail = p->next;
break;
case RE_RANGE:
if (s->state == ((
(18446744073709551615UL)
- 1) + 1))
s->state = p->u.range.first_char;
else
++(s->state);
return_val = s->state;
if (s->state == p->u.range.last_char)
{
s->tail = p->next;
s->state = ((
(18446744073709551615UL)
- 1) + 1);
}
break;
case RE_CHAR_CLASS:
if (class)
{
switch (p->u.char_class)
{
case CC_LOWER:
*class = UL_LOWER;
break;
case CC_UPPER:
*class = UL_UPPER;
break;
default:
break;
}
}
if (s->state == ((
(18446744073709551615UL)
- 1) + 1))
{
for (i = 0; i < N_CHARS; i++)
if (is_char_class_member (p->u.char_class, i))
break;
((void) sizeof ((
i < N_CHARS
) ? 1 : 0), __extension__ ({ if (
i < N_CHARS
) ; else __assert_fail (
"i < N_CHARS"
, "src/tr.c", 1079, __extension__ __PRETTY_FUNCTION__); }))
;
s->state = i;
}
((void) sizeof ((
is_char_class_member (p->u.char_class, s->state)
) ? 1 : 0), __extension__ ({ if (
is_char_class_member (p->u.char_class, s->state)
) ; else __assert_fail (
"is_char_class_member (p->u.char_class, s->state)"
, "src/tr.c", 1082, __extension__ __PRETTY_FUNCTION__); }))
;
return_val = s->state;
for (i = s->state + 1; i < N_CHARS; i++)
if (is_char_class_member (p->u.char_class, i))
break;
if (i < N_CHARS)
s->state = i;
else
{
s->tail = p->next;
s->state = ((
(18446744073709551615UL)
- 1) + 1);
}
break;
case RE_EQUIV_CLASS:
return_val = p->u.equiv_code;
s->state = ((
(18446744073709551615UL)
- 1) + 1);
s->tail = p->next;
break;
case RE_REPEATED_CHAR:
if (p->u.repeated_char.repeat_count == 0)
{
s->tail = p->next;
s->state = ((
(18446744073709551615UL)
- 1) + 1);
return_val = get_next (s, class);
}
else
{
if (s->state == ((
(18446744073709551615UL)
- 1) + 1))
{
s->state = 0;
}
++(s->state);
return_val = p->u.repeated_char.the_repeated_char;
if (s->state == p->u.repeated_char.repeat_count)
{
s->tail = p->next;
s->state = ((
(18446744073709551615UL)
- 1) + 1);
}
}
break;
default:
abort ();
}
return return_val;
}
|
int get_next(struct_0 *a0, unsigned int *a1) {
unsigned int v0;
unsigned int v1;
struct_2 *v2;
unsigned int v4;
if (a1)
*(a1) = 2;
if (a0->field_10 == -2) {
a0->field_8 = a0->field_0->field_8;
a0->field_10 = -1;
}
v2 = a0->field_8;
if (!v2) {
v4 = -1;
} else {
switch (v2->field_0) {
case 0:
v0 = v2->field_10;
a0->field_10 = -1;
a0->field_8 = v2->field_8;
break;
case 1:
if (a0->field_10 == -1)
a0->field_10 = v2->field_10;
else
a0->field_10 = a0->field_10 + 1;
v0 = a0->field_10;
if (a0->field_10 == v2->field_11) {
a0->field_8 = v2->field_8;
a0->field_10 = -1;
}
break;
case 2:
if (a1) {
if (*(&v2->field_10) == 6) {
*(a1) = 0;
} else if (*(&v2->field_10) == 10) {
*(a1) = 1;
}
}
if (a0->field_10 == -1) {
for (v1 = 0; v1 <= 255; v1 += 1) {
if (is_char_class_member(*(&v2->field_10), v1))
break;
}
__assert_fail();
a0->field_10 = v1;
} else {
v4 = is_char_class_member(*(&v2->field_10), a0->field_10);
__assert_fail();
v0 = a0->field_10;
for (v1 = a0->field_10 + 1; v1 <= 255; v1 += 1) {
v4 = is_char_class_member(*(&v2->field_10), v1);
if (v4)
break;
}
if (v1 <= 255) {
a0->field_10 = v1;
break;
} else {
a0->field_8 = v2->field_8;
a0->field_10 = -1;
break;
}
}
case 3:
v0 = v2->field_10;
a0->field_10 = -1;
a0->field_8 = v2->field_8;
break;
v4 = v0;
case 4:
if (!v2->field_18) {
a0->field_8 = v2->field_8;
a0->field_10 = -1;
v0 = get_next(a0, a1);
} else {
if (a0->field_10 == -1)
a0->field_10 = 0;
a0->field_10 = a0->field_10 + 1;
v0 = v2->field_10;
if (a0->field_10 == v2->field_18) {
a0->field_8 = v2->field_8;
a0->field_10 = -1;
}
}
break;
default:
abort();
}
}
return v4;
}
|
char *
single_quote(const char *s) {
char *p;
((p) = ((void *)stacknxt));
do {
char *q;
size_t len;
len = strchrnul(s, '\'') - s;
q = p = makestrspace(len + 3, p);
*q++ = '\'';
q = mempcpy(q, s, len);
*q++ = '\'';
s += len;
(p += (q - p));
len = strspn(s, "'");
if (!len)
break;
q = p = makestrspace(len + 3, p);
*q++ = '"';
q = mempcpy(q, s, len);
*q++ = '"';
s += len;
(p += (q - p));
} while (*s);
(*p++ = (0));
return ((void *)stacknxt);
}
|
long single_quote(const char *a1)
{
_BYTE *v1;
_BYTE *v2;
_BYTE *v3;
_BYTE *v4;
char *sa;
_BYTE *v8;
size_t na;
size_t n;
v8 = (_BYTE *)stacknxt;
do
{
na = strchrnul(a1, 39) - a1;
v1 = (_BYTE *)makestrspace(na + 3, v8);
*v1 = 39;
v2 = mempcpy(v1 + 1, a1, na);
*v2 = 39;
sa = (char *)&a1[na];
v8 = v2 + 1;
n = strspn(sa, "'");
if ( !n )
break;
v3 = (_BYTE *)makestrspace(n + 3, v8);
*v3 = 34;
v4 = mempcpy(v3 + 1, sa, n);
*v4 = 34;
a1 = &sa[n];
v8 = v4 + 1;
}
while ( *a1 );
*v8 = 0;
return stacknxt;
}
|
static int
write_protected_non_symlink (int fd_cwd,
char const *file,
struct stat *buf)
{
if (can_write_any_file ())
return 0;
if (cache_fstatat (fd_cwd, file, buf,
0x100
) != 0)
return -1;
if (
((((
buf->st_mode
)) & 0170000) == (0120000))
)
return 0;
{
if (faccessat (fd_cwd, file,
2
,
0x200
) == 0)
return 0;
return
(*__errno_location ())
==
13
? 1 : -1;
}
}
|
int write_protected_non_symlink(unsigned long a0, unsigned long long a1, struct_0 *a2) {
unsigned int v1;
if (can_write_any_file()) {
v1 = 0;
} else if (cache_fstatat(a0, a1, a2, 0x100)) {
v1 = -1;
} else if ((a2->field_18 & 0xf000) == 0xa000) {
v1 = 0;
} else if (!faccessat(a0, a1, 0x2, 0x200)) {
v1 = 0;
} else if (*(__errno_location()) == 13) {
v1 = 1;
} else {
v1 = -1;
}
return v1;
}
|
static SHELL_VAR *
bind_tempenv_variable (name, value)
const char *name;
char *value;
{
SHELL_VAR *var;
var = temporary_env ? hash_lookup (name, temporary_env) : (SHELL_VAR *)
((void *)0)
;
if (var)
{
do { if (((var)->value)) sh_xfree((((var)->value)), "variables.c", 4527); } while (0);
((var)->value = ((char *)strcpy (sh_xmalloc((1 + strlen (value)), "variables.c", 4528), (value))));
do { if ((var)->exportstr) { sh_xfree(((var)->exportstr), "variables.c", 4529); (var)->exportstr = (char *)
((void *)0)
; } } while (0);
}
return (var);
}
|
void bind_tempenv_variable(unsigned long long a0, char *a1) {
void* v0;
void* v2;
void* v3;
if (!temporary_env)
v2 = 0;
else
v2 = hash_lookup(a0, temporary_env);
v0 = v2;
if (v0) {
if (v0[8])
sh_xfree(v0[8], "variables.c", 0x11af);
*(&v0[8]) = strcpy(sh_xmalloc(strlen(a1) + 1, "variables.c", 0x11b0), a1);
if (v0[16]) {
sh_xfree(v0[16], "variables.c", 0x11b1);
*(&v0[16]) = 0;
}
}
v3 = v0;
return;
}
|
void
dispose_function_def (c)
FUNCTION_DEF *c;
{
dispose_function_def_contents (c);
sh_xfree((c), "dispose_cmd.c", 241);
}
|
void dispose_function_def(unsigned long long a0) {
unsigned long long v1;
dispose_function_def_contents(a0);
v1 = sh_xfree(a0, "dispose_cmd.c", 0xf1);
return;
}
|
test_code_t test_anonymous(gnutls_session_t session)
{
int ret;
sprintf(prio_str,
"NONE:" "+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL" ":%s:"
"+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":+ANON-DH:+ANON-ECDH:+CURVE-ALL:%s",
protocol_str, rest);
{ int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 1466)) != TEST_SUCCEED) { return _ret; } };
gnutls_credentials_set(session, GNUTLS_CRD_ANON, anon_cred);
ret = test_do_handshake(session);
if (ret == TEST_SUCCEED)
gnutls_dh_get_pubkey(session, &pubkey);
return ret;
}
|
long long test_anonymous(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:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT:+ANON-DH:+ANON-ECDH:+CURVE-ALL:%s", &protocol_str, &rest);
v0 = __gnutls_priority_set_direct(a0, &prio_str, 0x5ba);
if (v0) {
v3 = v0;
} else {
gnutls_credentials_set(a0, 0x2, anon_cred);
v1 = test_do_handshake(a0);
if (!v1)
gnutls_dh_get_pubkey(a0, &pubkey);
v3 = v1;
}
return v3;
}
|
ssize_t
zreadintr (fd, buf, len)
int fd;
char *buf;
size_t len;
{
check_signals ();
return (read (fd, buf, len));
}
|
int zreadintr(unsigned long a0, void* a1, unsigned int a2) {
check_signals();
return read(a0, a1, a2);
}
|
void
print_array_assignment (var, quoted)
SHELL_VAR *var;
int quoted;
{
char *vstr;
vstr = array_to_assign ((ARRAY *)((var)->value), quoted);
if (vstr == 0)
printf ("%s=%s\n", var->name, quoted ? "'()'" : "()");
else
{
printf ("%s=%s\n", var->name, vstr);
sh_xfree((vstr), "arrayfunc.c", 1225);
}
}
|
long long print_array_assignment(unsigned long long a0[2], unsigned long a1) {
unsigned long long v0;
unsigned int v2;
unsigned long long v3;
v0 = array_to_assign(a0[1], a1, a1);
if (v0) {
printf("%s=%s\n", a0[0], v0);
v3 = sh_xfree(v0, "arrayfunc.c", 0x4c9);
} else {
if (!a1)
v2 = &g_403b2a;
else
v2 = "'()'";
v3 = printf("%s=%s\n", a0[0], v2);
}
return v3;
}
|
int
rijndaelKeySetupEnc(u32 rk[ ], const u8 cipherKey[], int keyBits)
{
int i = 0;
u32 temp;
rk[0] = (((u32)(cipherKey)[0] << 24) ^ ((u32)(cipherKey)[1] << 16) ^ ((u32)(cipherKey)[2] << 8) ^ ((u32)(cipherKey)[3]));
rk[1] = (((u32)(cipherKey + 4)[0] << 24) ^ ((u32)(cipherKey + 4)[1] << 16) ^ ((u32)(cipherKey + 4)[2] << 8) ^ ((u32)(cipherKey + 4)[3]));
rk[2] = (((u32)(cipherKey + 8)[0] << 24) ^ ((u32)(cipherKey + 8)[1] << 16) ^ ((u32)(cipherKey + 8)[2] << 8) ^ ((u32)(cipherKey + 8)[3]));
rk[3] = (((u32)(cipherKey + 12)[0] << 24) ^ ((u32)(cipherKey + 12)[1] << 16) ^ ((u32)(cipherKey + 12)[2] << 8) ^ ((u32)(cipherKey + 12)[3]));
if (keyBits == 128) {
for (;;) {
temp = rk[3];
rk[4] = rk[0] ^
(Te2[(temp >> 16) & 0xff] & 0xff000000) ^
(Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^
(Te0[(temp ) & 0xff] & 0x0000ff00) ^
(Te1[(temp >> 24) ] & 0x000000ff) ^
rcon[i];
rk[5] = rk[1] ^ rk[4];
rk[6] = rk[2] ^ rk[5];
rk[7] = rk[3] ^ rk[6];
if (++i == 10) {
return 10;
}
rk += 4;
}
}
rk[4] = (((u32)(cipherKey + 16)[0] << 24) ^ ((u32)(cipherKey + 16)[1] << 16) ^ ((u32)(cipherKey + 16)[2] << 8) ^ ((u32)(cipherKey + 16)[3]));
rk[5] = (((u32)(cipherKey + 20)[0] << 24) ^ ((u32)(cipherKey + 20)[1] << 16) ^ ((u32)(cipherKey + 20)[2] << 8) ^ ((u32)(cipherKey + 20)[3]));
if (keyBits == 192) {
for (;;) {
temp = rk[ 5];
rk[ 6] = rk[ 0] ^
(Te2[(temp >> 16) & 0xff] & 0xff000000) ^
(Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^
(Te0[(temp ) & 0xff] & 0x0000ff00) ^
(Te1[(temp >> 24) ] & 0x000000ff) ^
rcon[i];
rk[ 7] = rk[ 1] ^ rk[ 6];
rk[ 8] = rk[ 2] ^ rk[ 7];
rk[ 9] = rk[ 3] ^ rk[ 8];
if (++i == 8) {
return 12;
}
rk[10] = rk[ 4] ^ rk[ 9];
rk[11] = rk[ 5] ^ rk[10];
rk += 6;
}
}
rk[6] = (((u32)(cipherKey + 24)[0] << 24) ^ ((u32)(cipherKey + 24)[1] << 16) ^ ((u32)(cipherKey + 24)[2] << 8) ^ ((u32)(cipherKey + 24)[3]));
rk[7] = (((u32)(cipherKey + 28)[0] << 24) ^ ((u32)(cipherKey + 28)[1] << 16) ^ ((u32)(cipherKey + 28)[2] << 8) ^ ((u32)(cipherKey + 28)[3]));
if (keyBits == 256) {
for (;;) {
temp = rk[ 7];
rk[ 8] = rk[ 0] ^
(Te2[(temp >> 16) & 0xff] & 0xff000000) ^
(Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^
(Te0[(temp ) & 0xff] & 0x0000ff00) ^
(Te1[(temp >> 24) ] & 0x000000ff) ^
rcon[i];
rk[ 9] = rk[ 1] ^ rk[ 8];
rk[10] = rk[ 2] ^ rk[ 9];
rk[11] = rk[ 3] ^ rk[10];
if (++i == 7) {
return 14;
}
temp = rk[11];
rk[12] = rk[ 4] ^
(Te2[(temp >> 24) ] & 0xff000000) ^
(Te3[(temp >> 16) & 0xff] & 0x00ff0000) ^
(Te0[(temp >> 8) & 0xff] & 0x0000ff00) ^
(Te1[(temp ) & 0xff] & 0x000000ff);
rk[13] = rk[ 5] ^ rk[12];
rk[14] = rk[ 6] ^ rk[13];
rk[15] = rk[ 7] ^ rk[14];
rk += 8;
}
}
return 0;
}
|
undefined8 rijndaelKeySetupEnc(uint *param_1,byte *param_2,int param_3)
{
uint uVar1;
undefined8 uVar2;
uint *local_20;
int local_10;
local_10 = 0;
*param_1 = (uint)*param_2 << 0x18 ^ (uint)param_2[1] << 0x10 ^ (uint)param_2[2] << 8 ^
(uint)param_2[3];
param_1[1] = (uint)param_2[7] ^
(uint)param_2[4] << 0x18 ^ (uint)param_2[5] << 0x10 ^ (uint)param_2[6] << 8;
param_1[2] = (uint)param_2[0xb] ^
(uint)param_2[8] << 0x18 ^ (uint)param_2[9] << 0x10 ^ (uint)param_2[10] << 8;
param_1[3] = (uint)param_2[0xf] ^
(uint)param_2[0xc] << 0x18 ^ (uint)param_2[0xd] << 0x10 ^ (uint)param_2[0xe] << 8;
local_20 = param_1;
if (param_3 == 0x80) {
while( true ) {
uVar1 = local_20[3];
local_20[4] = *(uint *)(rcon + (long)local_10 * 4) ^
*local_20 ^ *(uint *)(Te2 + (ulong)(uVar1 >> 0x10 & 0xff) * 4) & 0xff000000 ^
*(uint *)(Te3 + (ulong)(uVar1 >> 8 & 0xff) * 4) & 0xff0000 ^
*(uint *)(Te0 + (ulong)(uVar1 & 0xff) * 4) & 0xff00 ^
*(uint *)(Te1 + (ulong)(uVar1 >> 0x18) * 4) & 0xff;
local_20[5] = local_20[4] ^ local_20[1];
local_20[6] = local_20[5] ^ local_20[2];
local_20[7] = local_20[6] ^ local_20[3];
local_10 = __addvsi3(local_10,1);
if (local_10 == 10) break;
local_20 = local_20 + 4;
}
uVar2 = 10;
}
else {
param_1[4] = (uint)param_2[0x13] ^
(uint)param_2[0x10] << 0x18 ^ (uint)param_2[0x11] << 0x10 ^
(uint)param_2[0x12] << 8;
param_1[5] = (uint)param_2[0x17] ^
(uint)param_2[0x14] << 0x18 ^ (uint)param_2[0x15] << 0x10 ^
(uint)param_2[0x16] << 8;
if (param_3 == 0xc0) {
while( true ) {
uVar1 = local_20[5];
local_20[6] = *(uint *)(rcon + (long)local_10 * 4) ^
*local_20 ^ *(uint *)(Te2 + (ulong)(uVar1 >> 0x10 & 0xff) * 4) & 0xff000000 ^
*(uint *)(Te3 + (ulong)(uVar1 >> 8 & 0xff) * 4) & 0xff0000 ^
*(uint *)(Te0 + (ulong)(uVar1 & 0xff) * 4) & 0xff00 ^
*(uint *)(Te1 + (ulong)(uVar1 >> 0x18) * 4) & 0xff;
local_20[7] = local_20[6] ^ local_20[1];
local_20[8] = local_20[7] ^ local_20[2];
local_20[9] = local_20[8] ^ local_20[3];
local_10 = __addvsi3(local_10,1);
if (local_10 == 8) break;
local_20[10] = local_20[9] ^ local_20[4];
local_20[0xb] = local_20[10] ^ local_20[5];
local_20 = local_20 + 6;
}
uVar2 = 0xc;
}
else {
param_1[6] = (uint)param_2[0x1b] ^
(uint)param_2[0x18] << 0x18 ^ (uint)param_2[0x19] << 0x10 ^
(uint)param_2[0x1a] << 8;
param_1[7] = (uint)param_2[0x1f] ^
(uint)param_2[0x1c] << 0x18 ^ (uint)param_2[0x1d] << 0x10 ^
(uint)param_2[0x1e] << 8;
if (param_3 == 0x100) {
while( true ) {
uVar1 = local_20[7];
local_20[8] = *(uint *)(rcon + (long)local_10 * 4) ^
*local_20 ^ *(uint *)(Te2 + (ulong)(uVar1 >> 0x10 & 0xff) * 4) & 0xff000000
^ *(uint *)(Te3 + (ulong)(uVar1 >> 8 & 0xff) * 4) & 0xff0000 ^
*(uint *)(Te0 + (ulong)(uVar1 & 0xff) * 4) & 0xff00 ^
*(uint *)(Te1 + (ulong)(uVar1 >> 0x18) * 4) & 0xff;
local_20[9] = local_20[8] ^ local_20[1];
local_20[10] = local_20[9] ^ local_20[2];
local_20[0xb] = local_20[10] ^ local_20[3];
local_10 = __addvsi3(local_10,1);
if (local_10 == 7) break;
uVar1 = local_20[0xb];
local_20[0xc] =
*(uint *)(Te1 + (ulong)(uVar1 & 0xff) * 4) & 0xff ^
local_20[4] ^ *(uint *)(Te2 + (ulong)(uVar1 >> 0x18) * 4) & 0xff000000 ^
*(uint *)(Te3 + (ulong)(uVar1 >> 0x10 & 0xff) * 4) & 0xff0000 ^
*(uint *)(Te0 + (ulong)(uVar1 >> 8 & 0xff) * 4) & 0xff00;
local_20[0xd] = local_20[0xc] ^ local_20[5];
local_20[0xe] = local_20[0xd] ^ local_20[6];
local_20[0xf] = local_20[0xe] ^ local_20[7];
local_20 = local_20 + 8;
}
uVar2 = 0xe;
}
else {
uVar2 = 0;
}
}
}
return uVar2;
}
|
int
rl_transpose_words (int count, int key)
{
char *word1, *word2;
int w1_beg, w1_end, w2_beg, w2_end;
int orig_point, orig_end;
orig_point = rl_point;
orig_end = rl_end;
if (!count)
return 0;
rl_forward_word (count, key);
w2_end = rl_point;
rl_backward_word (1, key);
w2_beg = rl_point;
rl_backward_word (count, key);
w1_beg = rl_point;
rl_forward_word (1, key);
w1_end = rl_point;
if ((w1_beg == w2_beg) || (w2_beg < w1_end))
{
rl_ding ();
rl_point = orig_point;
return 1;
}
word1 = rl_copy_text (w1_beg, w1_end);
word2 = rl_copy_text (w2_beg, w2_end);
rl_begin_undo_group ();
rl_point = w2_beg;
rl_delete_text (w2_beg, w2_end);
rl_insert_text (word1);
rl_point = w1_beg;
rl_delete_text (w1_beg, w1_end);
rl_insert_text (word2);
rl_point = w2_end;
rl_end = orig_end;
rl_end_undo_group ();
xfree (word1);
xfree (word2);
return 0;
}
|
long long rl_transpose_words(unsigned long a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
char *v6;
char *v7;
unsigned long long v9;
v0 = rl_point;
v1 = rl_end;
if (!a0) {
v9 = 0;
} else {
rl_forward_word(a0, a1);
v2 = rl_point;
rl_backward_word(0x1, a1);
v3 = rl_point;
rl_backward_word(a0, a1);
v4 = rl_point;
rl_forward_word(0x1, a1);
v5 = rl_point;
if (v4 == v3) {
LABEL_40263b:
rl_ding();
rl_point = v0;
v9 = 1;
} else {
if (v3 < v5)
goto LABEL_40263b;
v6 = rl_copy_text(v4, v5, v5);
v7 = rl_copy_text(v3, v2, v2);
rl_begin_undo_group();
rl_point = v3;
rl_delete_text(v3, v2);
rl_insert_text(v6);
rl_point = v4;
rl_delete_text(v4, v5);
rl_insert_text(v7);
rl_point = v2;
rl_end = v1;
rl_end_undo_group();
xfree(v6);
xfree(v7);
v9 = 0;
}
}
return v9;
}
|
otherpkg, &otherpkg->installed)) {
printf(gettext("Replacing files in old package %s (%s) ...\n"),
pkg_name(otherpkg, pnaw_nonambig),
versiondescribe(&otherpkg->installed.version, vdew_nonambig));
otherpkg->clientdata->replacingfilesandsaid = 1;
} else if (does_replace(otherpkg, &otherpkg->installed,
|
int printf(char *__format,...)
{
halt_baddata();
}
|
int
ttcbreak ()
{
struct termios tt;
if (ttsaved == 0)
return -1;
tt = ttin;
return (ttfd_cbreak (0, &tt));
}
|
undefined8 ttcbreak(void)
{
undefined8 uVar1;
long in_FS_OFFSET;
undefined8 local_58;
undefined8 local_50;
undefined8 local_48;
undefined8 local_40;
undefined8 local_38;
undefined8 local_30;
undefined8 local_28;
undefined4 local_20;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
if (ttsaved == 0) {
uVar1 = 0xffffffff;
}
else {
local_58 = ttin._0_8_;
local_50 = ttin._8_8_;
local_48 = ttin._16_8_;
local_40 = ttin._24_8_;
local_38 = ttin._32_8_;
local_30 = ttin._40_8_;
local_28 = ttin._48_8_;
local_20 = ttin._56_4_;
uVar1 = ttfd_cbreak(0,&local_58);
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar1;
}
|
static void
file_copy(const char *src, const char *dst)
{
struct dpkg_error err;
char *tmp;
int srcfd, dstfd;
srcfd = open(src,
00
);
if (srcfd < 0)
ohshite(gettext("unable to open file '%s'"), src);
tmp = str_fmt("%s%s", dst, ".dpkg-divert.tmp");
dstfd = creat(tmp, 0600);
if (dstfd < 0)
ohshite(gettext("unable to create file '%s'"), tmp);
push_cleanup(cu_filename, ~ehflag_normaltidy, 1, tmp);
if (buffer_copy_IntInt(srcfd, 0,
((void *)0)
, 4, dstfd, 2, -1, &err) < 0)
ohshit(gettext("cannot copy '%s' to '%s': %s"), src, tmp, err.str);
close(srcfd);
if (fsync(dstfd))
ohshite(gettext("unable to sync file '%s'"), tmp);
if (close(dstfd))
ohshite(gettext("unable to close file '%s'"), tmp);
file_copy_perms(src, tmp);
if (rename(tmp, dst) != 0)
ohshite(gettext("cannot rename '%s' to '%s'"), tmp, dst);
free(tmp);
pop_cleanup(ehflag_normaltidy);
}
|
unsigned long file_copy(const char *a1, const char *a2)
{
char *v2;
char *v3;
char *v4;
char *v5;
char *v6;
char *v7;
int fd;
int v10;
char *old;
char v12[8];
unsigned long v13;
v13 = __readfsqword(0x28u);
fd = open(a1, 0);
if ( fd < 0 )
{
v2 = gettext("unable to open file '%s'");
ohshite(v2, a1);
}
old = (char *)str_fmt("%s%s", a2, ".dpkg-divert.tmp");
v10 = creat(old, 0x180u);
if ( v10 < 0 )
{
v3 = gettext("unable to create file '%s'");
ohshite(v3, old);
}
push_cleanup(&cu_filename, 4294967294LL, 1LL, old);
if ( buffer_copy_IntInt((unsigned int)fd, 0LL, 0LL, 4LL, (unsigned int)v10, 2LL, -1LL, v12) < 0 )
{
v4 = gettext("cannot copy '%s' to '%s': %s");
ohshit(v4, a1, old);
}
close(fd);
if ( fsync(v10) )
{
v5 = gettext("unable to sync file '%s'");
ohshite(v5, old);
}
if ( close(v10) )
{
v6 = gettext("unable to close file '%s'");
ohshite(v6, old);
}
file_copy_perms(a1, old);
if ( rename(old, a2) )
{
v7 = gettext("cannot rename '%s' to '%s'");
ohshite(v7, old);
}
free(old);
pop_cleanup(1LL);
return __readfsqword(0x28u) ^ v13;
}
|
static int
write_host_entry(FILE *f, const char *host, const char *ip,
const struct sshkey *key, int store_hash)
{
int r, success = 0;
char *hashed_host =
((void *)0)
, *lhost;
lhost = xstrdup(host);
lowercase(lhost);
if (store_hash) {
if ((hashed_host = host_hash(lhost,
((void *)0)
, 0)) ==
((void *)0)
) {
sshlog("hostfile.c", __func__, 448, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "host_hash failed");
free(lhost);
return 0;
}
fprintf(f, "%s ", hashed_host);
} else if (ip !=
((void *)0)
)
fprintf(f, "%s,%s ", lhost, ip);
else {
fprintf(f, "%s ", lhost);
}
free(hashed_host);
free(lhost);
if ((r = sshkey_write(key, f)) == 0)
success = 1;
else
sshlog("hostfile.c", __func__, 463, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "sshkey_write");
fputc('\n', f);
if (success && store_hash && ip !=
((void *)0)
)
success = write_host_entry(f, ip,
((void *)0)
, key, 1);
return success;
}
|
int write_host_entry(void* a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long a4) {
unsigned long long v0;
unsigned int v1;
unsigned int v2;
void* v3;
void* v4;
unsigned int v6;
v1 = 0;
v3 = 0;
v4 = xstrdup(a1, a1, a2, a3);
lowercase(v4);
if (a4) {
v3 = host_hash(v4, 0x0, 0x0);
if (v3) {
fprintf(a0, "%s ", v3);
} else {
v0 = "host_hash failed";
sshlog("hostfile.c", "write_host_entry", 0x1c0, 0x1, 0x2, 0x0);
free(v4);
v6 = 0;
goto LABEL_40141f;
}
} else if (!a2) {
fprintf(a0, "%s ", v4);
} else {
fprintf(a0, "%s,%s ", v4, a2);
}
free(v3);
free(v4);
v2 = sshkey_write(a3, a0, a0);
if (!v2) {
v1 = 1;
} else {
v0 = "sshkey_write";
sshlog("hostfile.c", "write_host_entry", 0x1cf, 0x1, 0x2, ssh_err(v2));
}
fputc(0xa, a0);
if (v1 && a4 && a2)
v1 = write_host_entry(a0, a2, 0x0, a3, 0x1);
v6 = v1;
LABEL_40141f:
return v6;
}
|
static
_Bool
parse_ok (const struct parser_table* entry, char **argv, int *arg_ptr)
{
return insert_exec_ok ("-ok", entry, argv, arg_ptr);
}
|
long long parse_ok(unsigned long long a0, unsigned long long a1, unsigned long long a2) {
return insert_exec_ok("-ok", a0, a1, a2);
}
|
static
_Bool
head_file (char const *filename, uintmax_t n_units,
_Bool
count_lines,
_Bool
elide_from_end)
{
int fd;
_Bool
ok;
_Bool
is_stdin = (strcmp (filename, "-") == 0);
if (is_stdin)
{
have_read_stdin =
1
;
fd =
0
;
filename = gettext ("standard input");
xset_binary_mode (
0
,
0
);
}
else
{
fd = open (filename,
00
|
0
);
if (fd < 0)
{
error (0,
(*__errno_location ())
, gettext ("cannot open %s for reading"), quotearg_style (shell_escape_always_quoting_style, filename));
return
0
;
}
}
ok = head (filename, fd, n_units, count_lines, elide_from_end);
if (!is_stdin && close (fd) != 0)
{
error (0,
(*__errno_location ())
, gettext ("failed to close %s"), quotearg_style (shell_escape_always_quoting_style, filename));
return
0
;
}
return ok;
}
|
int head_file(unsigned long a0, unsigned long long a1, unsigned long a2, unsigned long a3) {
unsigned long v0;
char v1;
char v2;
unsigned int v3;
unsigned long long v6;
unsigned int v7;
unsigned long long v8;
v0 = a0;
v1 = !strcmp(v0, "-");
if (v1) {
have_read_stdin = 1;
v3 = 0;
v0 = gettext("standard input");
xset_binary_mode(0x0, 0x0);
} else {
v3 = open(v0, 0x0, a2);
if (v3 < 0) {
v6 = quotearg_style(0x4, v0);
error(0x0, *(__errno_location()), gettext("cannot open %s for reading"));
v7 = 0;
return v7;
}
}
v2 = head(v0, v3, a1, a2, a3);
if ((v1 ^ 1) && close(v3)) {
v8 = quotearg_style(0x4, v0);
error(0x0, *(__errno_location()), gettext("failed to close %s"));
v7 = 0;
return v7;
}
v7 = v2;
return v7;
}
|
int
rl_skip_csi_sequence (int count, int key)
{
int ch;
(rl_readline_state |= (0x0000040));
do
ch = rl_read_key ();
while (ch >= 0x20 && ch < 0x40);
(rl_readline_state &= ~(0x0000040));
return (ch < 0);
}
|
uint rl_skip_csi_sequence(void)
{
uint uVar1;
rl_readline_state = rl_readline_state | 0x40;
do {
uVar1 = rl_read_key();
if ((int)uVar1 < 0x20) break;
} while ((int)uVar1 < 0x40);
rl_readline_state = rl_readline_state & 0xffffffffffffffbf;
return uVar1 >> 0x1f;
}
|
COMMAND *
make_cond_command (cond_node)
COND_COM *cond_node;
{
COMMAND *command;
command = (COMMAND *)sh_xmalloc((sizeof (COMMAND)), "make_cmd.c", 480);
command->value.Cond = cond_node;
command->type = cm_cond;
command->redirects = (REDIRECT *)
((void *)0)
;
command->flags = 0;
command->line = cond_node ? cond_node->line : 0;
return (command);
}
|
long long make_cond_command(struct_0 *a0) {
struct_1 *v0;
unsigned int v2;
v0 = sh_xmalloc(0x20, "make_cmd.c", 0x1e0);
v0->field_18 = a0;
v0->field_0 = 11;
v0->field_10 = 0;
v0->field_4 = 0;
if (a0)
v2 = a0->field_4;
else
v2 = 0;
v0->field_8 = v2;
return v0;
}
|
int
mailstat(path, st)
const char *path;
struct stat *st;
{
static struct stat st_new_last, st_ret_last;
struct stat st_ret, st_tmp;
DIR *dd;
struct dirent *fn;
char dir[
4096
* 2], file[
4096
* 2 + 1];
int i, l;
time_t atime, mtime;
atime = mtime = 0;
if ((i = stat(path, st)) != 0 ||
((((
st->st_mode
)) & 0170000) == (0040000))
== 0)
return i;
if (strlen(path) > sizeof(dir) - 5)
{
(*__errno_location ())
=
36
;
return -1;
}
st_ret = *st;
st_ret.st_nlink = 1;
st_ret.st_size = 0;
st_ret.st_blocks = 0;
st_ret.st_mode &= ~
0040000
;
st_ret.st_mode |=
0100000
;
sprintf(dir, "%s/cur", path);
if (stat(dir, &st_tmp) ||
((((
st_tmp.st_mode
)) & 0170000) == (0040000))
== 0)
return 0;
st_ret.
st_atim.tv_sec
= st_tmp.
st_atim.tv_sec
;
sprintf(dir, "%s/tmp", path);
if (stat(dir, &st_tmp) ||
((((
st_tmp.st_mode
)) & 0170000) == (0040000))
== 0)
return 0;
st_ret.
st_mtim.tv_sec
= st_tmp.
st_mtim.tv_sec
;
sprintf(dir, "%s/new", path);
if (stat(dir, &st_tmp) ||
((((
st_tmp.st_mode
)) & 0170000) == (0040000))
== 0)
return 0;
st_ret.
st_mtim.tv_sec
= st_tmp.
st_mtim.tv_sec
;
if (st_tmp.st_dev == st_new_last.st_dev &&
st_tmp.st_ino == st_new_last.st_ino &&
st_tmp.
st_atim.tv_sec
== st_new_last.
st_atim.tv_sec
&&
st_tmp.
st_mtim.tv_sec
== st_new_last.
st_mtim.tv_sec
)
{
*st = st_ret_last;
return 0;
}
st_new_last = st_tmp;
for (i = 0; i < 2; i++)
{
sprintf(dir, "%s/%s", path, i ? "cur" : "new");
sprintf(file, "%s/", dir);
l = strlen(file);
if ((dd = opendir(dir)) ==
((void *)0)
)
return 0;
while ((fn = readdir(dd)) !=
((void *)0)
)
{
if (fn->d_name[0] == '.' || strlen(fn->d_name) + l >= sizeof(file))
continue;
strcpy(file + l, fn->d_name);
if (stat(file, &st_tmp) != 0)
continue;
st_ret.st_size += st_tmp.st_size;
st_ret.st_blocks++;
if (st_tmp.
st_atim.tv_sec
!= st_tmp.
st_mtim.tv_sec
&& st_tmp.
st_atim.tv_sec
> atime)
atime = st_tmp.
st_atim.tv_sec
;
if (st_tmp.
st_mtim.tv_sec
> mtime)
mtime = st_tmp.
st_mtim.tv_sec
;
}
closedir(dd);
}
st_ret.
st_atim.tv_sec
= atime;
if (mtime)
st_ret.
st_mtim.tv_sec
= mtime;
*st = st_ret_last = st_ret;
return 0;
}
|
int mailstat(char *param_1,stat *param_2)
{
__dev_t _Var1;
__ino_t _Var2;
undefined8 uVar3;
__dev_t _Var4;
__blksize_t _Var5;
long lVar6;
long lVar7;
__time_t _Var8;
long lVar9;
long lVar10;
long lVar11;
long lVar12;
__ino_t _Var13;
ulong uVar14;
int iVar15;
size_t sVar16;
int *piVar17;
undefined *puVar18;
DIR *__dirp;
size_t sVar19;
dirent *pdVar20;
undefined *puVar21;
long in_FS_OFFSET;
int local_4170;
__time_t local_4168;
long local_4160;
ulong local_4130;
long local_4118;
long local_4108;
__time_t local_40f0;
undefined local_40b8 [40];
__dev_t local_4090;
long local_4088;
__blksize_t local_4080;
__blkcnt_t local_4078;
long local_4070;
long local_4068;
long local_4060;
long local_4058;
__time_t local_4050;
long local_4048;
long local_4040;
long local_4038;
long local_4030;
char local_4028 [24];
undefined local_4010 [8168];
char local_2028 [8200];
long local_20;
puVar18 = &stack0xfffffffffffffff0;
do {
puVar21 = puVar18;
*(undefined8 *)(puVar21 + -0x1000) = *(undefined8 *)(puVar21 + -0x1000);
puVar18 = puVar21 + -0x1000;
} while (puVar21 + -0x1000 != local_4010);
local_20 = *(long *)(in_FS_OFFSET + 0x28);
local_4160 = 0;
local_4168 = 0;
*(undefined8 *)(puVar21 + -0x1180) = 0x100078;
iVar15 = stat(param_1,param_2);
if ((iVar15 == 0) && ((param_2->st_mode & 0xf000) == 0x4000)) {
*(undefined8 *)(puVar21 + -0x1180) = 0x1000b7;
sVar16 = strlen(param_1);
if (sVar16 < 0x1ffc) {
_Var1 = param_2->st_dev;
_Var2 = param_2->st_ino;
uVar3 = *(undefined8 *)¶m_2->st_gid;
_Var4 = param_2->st_rdev;
_Var5 = param_2->st_blksize;
lVar6 = (param_2->st_atim).tv_nsec;
lVar7 = (param_2->st_mtim).tv_nsec;
_Var8 = (param_2->st_ctim).tv_sec;
lVar9 = (param_2->st_ctim).tv_nsec;
lVar10 = param_2->__unused[0];
lVar11 = param_2->__unused[2];
lVar12 = param_2->__unused[1];
local_4118 = 0;
local_4108 = 0;
local_4130 = *(ulong *)¶m_2->st_mode & 0xffffffffffffbfff;
local_4130 = local_4130 | 0x8000;
*(undefined8 *)(puVar21 + -0x1180) = 0x100207;
sprintf(local_4028,"%s/cur",param_1);
*(undefined8 *)(puVar21 + -0x1180) = 0x100220;
iVar15 = stat(local_4028,(stat *)local_40b8);
if ((iVar15 == 0) && ((local_40b8._24_4_ & 0xf000) == 0x4000)) {
*(undefined8 *)(puVar21 + -0x1180) = 0x100270;
sprintf(local_4028,"%s/tmp",param_1);
*(undefined8 *)(puVar21 + -0x1180) = 0x100289;
iVar15 = stat(local_4028,(stat *)local_40b8);
if ((iVar15 == 0) && ((local_40b8._24_4_ & 0xf000) == 0x4000)) {
*(undefined8 *)(puVar21 + -0x1180) = 0x1002d9;
sprintf(local_4028,"%s/new",param_1);
*(undefined8 *)(puVar21 + -0x1180) = 0x1002f2;
iVar15 = stat(local_4028,(stat *)local_40b8);
_Var13 = st_ret_last_4795._8_8_;
if ((iVar15 == 0) && ((local_40b8._24_4_ & 0xf000) == 0x4000)) {
local_40f0 = local_4060;
if ((((local_40b8._0_8_ == st_new_last_4794._0_8_) &&
(local_40b8._8_8_ == st_new_last_4794._8_8_)) &&
(local_4070 == st_new_last_4794._72_8_)) && (local_4060 == st_new_last_4794._88_8_))
{
param_2->st_dev = st_ret_last_4795._0_8_;
param_2->st_ino = _Var13;
uVar14 = st_ret_last_4795._24_8_;
param_2->st_nlink = st_ret_last_4795._16_8_;
*(ulong *)¶m_2->st_mode = uVar14;
_Var1 = st_ret_last_4795._40_8_;
*(undefined8 *)¶m_2->st_gid = st_ret_last_4795._32_8_;
param_2->st_rdev = _Var1;
_Var5 = st_ret_last_4795._56_8_;
param_2->st_size = st_ret_last_4795._48_8_;
param_2->st_blksize = _Var5;
_Var8 = st_ret_last_4795._72_8_;
param_2->st_blocks = st_ret_last_4795._64_8_;
(param_2->st_atim).tv_sec = _Var8;
_Var8 = st_ret_last_4795._88_8_;
(param_2->st_atim).tv_nsec = st_ret_last_4795._80_8_;
(param_2->st_mtim).tv_sec = _Var8;
_Var8 = st_ret_last_4795._104_8_;
(param_2->st_mtim).tv_nsec = st_ret_last_4795._96_8_;
(param_2->st_ctim).tv_sec = _Var8;
lVar6 = st_ret_last_4795._120_8_;
(param_2->st_ctim).tv_nsec = st_ret_last_4795._112_8_;
param_2->__unused[0] = lVar6;
lVar6 = st_ret_last_4795._136_8_;
param_2->__unused[1] = st_ret_last_4795._128_8_;
param_2->__unused[2] = lVar6;
iVar15 = 0;
}
else {
st_new_last_4794._0_8_ = local_40b8._0_8_;
st_new_last_4794._8_8_ = local_40b8._8_8_;
st_new_last_4794._24_8_ = CONCAT44(local_40b8._28_4_,local_40b8._24_4_);
st_new_last_4794._16_8_ = local_40b8._16_8_;
st_new_last_4794._32_8_ = local_40b8._32_8_;
st_new_last_4794._40_8_ = local_4090;
st_new_last_4794._48_8_ = local_4088;
st_new_last_4794._56_8_ = local_4080;
st_new_last_4794._64_8_ = local_4078;
st_new_last_4794._72_8_ = local_4070;
st_new_last_4794._80_8_ = local_4068;
st_new_last_4794._88_8_ = local_4060;
st_new_last_4794._96_8_ = local_4058;
st_new_last_4794._104_8_ = local_4050;
st_new_last_4794._112_8_ = local_4048;
st_new_last_4794._120_8_ = local_4040;
st_new_last_4794._128_8_ = local_4038;
st_new_last_4794._136_8_ = local_4030;
for (local_4170 = 0; local_4170 < 2; local_4170 = local_4170 + 1) {
if (local_4170 == 0) {
puVar18 = &DAT_00100aa9;
}
else {
puVar18 = &DAT_00100aa5;
}
*(undefined8 *)(puVar21 + -0x1180) = 0x10059e;
sprintf(local_4028,"%s/%s",param_1,puVar18);
*(undefined8 *)(puVar21 + -0x1180) = 0x1005c0;
sprintf(local_2028,"%s/",local_4028);
*(undefined8 *)(puVar21 + -0x1180) = 0x1005cf;
sVar16 = strlen(local_2028);
*(undefined8 *)(puVar21 + -0x1180) = 0x1005e4;
__dirp = opendir(local_4028);
if (__dirp == (DIR *)0x0) {
iVar15 = 0;
goto LAB_00100942;
}
while( true ) {
*(undefined8 *)(puVar21 + -0x1180) = 0x100711;
pdVar20 = readdir(__dirp);
if (pdVar20 == (dirent *)0x0) break;
if (pdVar20->d_name[0] != '.') {
*(undefined8 *)(puVar21 + -0x1180) = 0x100629;
sVar19 = strlen(pdVar20->d_name);
if (sVar19 + (long)(int)sVar16 < 0x2001) {
*(undefined8 *)(puVar21 + -0x1180) = 0x10066a;
strcpy(local_2028 + (int)sVar16,pdVar20->d_name);
*(undefined8 *)(puVar21 + -0x1180) = 0x100683;
iVar15 = stat(local_2028,(stat *)local_40b8);
if (iVar15 == 0) {
local_4118 = local_4088 + local_4118;
local_4108 = local_4108 + 1;
if ((local_4070 != local_4060) && (local_4168 < local_4070)) {
local_4168 = local_4070;
}
if (local_4160 < local_4060) {
local_4160 = local_4060;
}
}
}
}
}
*(undefined8 *)(puVar21 + -0x1180) = 0x100735;
closedir(__dirp);
}
if (local_4160 != 0) {
local_40f0 = local_4160;
}
st_ret_last_4795._16_8_ = 1;
st_ret_last_4795._24_8_ = local_4130;
st_ret_last_4795._48_8_ = local_4118;
st_ret_last_4795._64_8_ = local_4108;
st_ret_last_4795._72_8_ = local_4168;
st_ret_last_4795._88_8_ = local_40f0;
st_ret_last_4795._0_8_ = _Var1;
st_ret_last_4795._8_8_ = _Var2;
st_ret_last_4795._32_8_ = uVar3;
st_ret_last_4795._40_8_ = _Var4;
st_ret_last_4795._56_8_ = _Var5;
st_ret_last_4795._80_8_ = lVar6;
st_ret_last_4795._96_8_ = lVar7;
st_ret_last_4795._104_8_ = _Var8;
st_ret_last_4795._112_8_ = lVar9;
st_ret_last_4795._120_8_ = lVar10;
st_ret_last_4795._128_8_ = lVar12;
st_ret_last_4795._136_8_ = lVar11;
param_2->st_dev = _Var1;
param_2->st_ino = _Var2;
uVar14 = st_ret_last_4795._24_8_;
param_2->st_nlink = st_ret_last_4795._16_8_;
*(ulong *)¶m_2->st_mode = uVar14;
_Var1 = st_ret_last_4795._40_8_;
*(undefined8 *)¶m_2->st_gid = st_ret_last_4795._32_8_;
param_2->st_rdev = _Var1;
_Var5 = st_ret_last_4795._56_8_;
param_2->st_size = st_ret_last_4795._48_8_;
param_2->st_blksize = _Var5;
_Var8 = st_ret_last_4795._72_8_;
param_2->st_blocks = st_ret_last_4795._64_8_;
(param_2->st_atim).tv_sec = _Var8;
_Var8 = st_ret_last_4795._88_8_;
(param_2->st_atim).tv_nsec = st_ret_last_4795._80_8_;
(param_2->st_mtim).tv_sec = _Var8;
_Var8 = st_ret_last_4795._104_8_;
(param_2->st_mtim).tv_nsec = st_ret_last_4795._96_8_;
(param_2->st_ctim).tv_sec = _Var8;
lVar6 = st_ret_last_4795._120_8_;
(param_2->st_ctim).tv_nsec = st_ret_last_4795._112_8_;
param_2->__unused[0] = lVar6;
lVar6 = st_ret_last_4795._136_8_;
param_2->__unused[1] = st_ret_last_4795._128_8_;
param_2->__unused[2] = lVar6;
iVar15 = 0;
}
}
else {
iVar15 = 0;
}
}
else {
iVar15 = 0;
}
}
else {
iVar15 = 0;
}
}
else {
*(undefined8 *)(puVar21 + -0x1180) = 0x1000c4;
piVar17 = __errno_location();
*piVar17 = 0x24;
iVar15 = -1;
}
}
LAB_00100942:
if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) {
return iVar15;
}
*(undefined8 *)(puVar21 + -0x1180) = 0x100956;
__stack_chk_fail();
}
|
static struct fsys_namenode *th_nn_find(const char *name,
_Bool
nonew) { return fsys_hash_find_node(name, nonew ? FHFF_NONE : 0); } static struct trigfileint **th_nn_interested(struct fsys_namenode *fnn) { return &fnn->trig_interested; } static const char *th_nn_name(struct fsys_namenode *fnn) { return fnn->name; }
|
long long th_nn_find(unsigned long long a0, unsigned long a1) {
return fsys_hash_find_node(a0, (!a1 ? 2 : 0));
}
|
static void
init_page (void)
{
int j;
COLUMN *p;
if (storing_columns)
{
store_columns ();
for (j = columns - 1, p = column_vector; j; --j, ++p)
{
p->lines_to_print = p->lines_stored;
}
if (balance_columns)
{
p->lines_to_print = p->lines_stored;
}
else
{
if (p->status == OPEN)
{
p->lines_to_print = lines_per_body;
}
else
p->lines_to_print = 0;
}
}
else
for (j = columns, p = column_vector; j; --j, ++p)
if (p->status == OPEN)
{
p->lines_to_print = lines_per_body;
}
else
p->lines_to_print = 0;
}
|
void *init_page()
{
void *result;
int v1;
int v2;
_DWORD *v3;
_DWORD *v4;
if ( storing_columns )
{
store_columns();
v1 = columns - 1;
v3 = column_vector;
while ( v1 )
{
v3[12] = v3[11];
--v1;
v3 += 16;
}
if ( balance_columns )
{
result = v3;
v3[12] = v3[11];
}
else
{
result = v3;
if ( v3[4] )
v3[12] = 0;
else
v3[12] = lines_per_body;
}
}
else
{
v2 = columns;
result = column_vector;
v4 = column_vector;
while ( v2 )
{
result = v4;
if ( v4[4] )
v4[12] = 0;
else
v4[12] = lines_per_body;
--v2;
v4 += 16;
}
}
return result;
}
|
static void
next_line_num (void)
{
char *endp = line_num_end;
do
{
if ((*endp)++ < '9')
return;
*endp-- = '0';
}
while (endp >= line_num_start);
if (line_num_start > line_buf)
*--line_num_start = '1';
else
*line_buf = '>';
if (line_num_start < line_num_print)
line_num_print--;
}
|
void next_line_num(void)
{
char *pcVar1;
char cVar2;
char *local_10;
local_10 = line_num_end;
do {
cVar2 = *local_10;
*local_10 = cVar2 + '\x01';
if (cVar2 < '9') {
return;
}
pcVar1 = local_10 + -1;
*local_10 = '0';
local_10 = pcVar1;
} while (line_num_start <= pcVar1);
if (line_num_start < line_buf + 1) {
line_buf[0] = 0x3e;
}
else {
line_num_start = line_num_start + -1;
*line_num_start = '1';
}
if (line_num_start < line_num_print) {
line_num_print = line_num_print + -1;
}
return;
}
|
ed_command(EditLine *el, wint_t c __attribute__((__unused__)))
{
wchar_t tmpbuf[((size_t)1024)];
int tmplen;
tmplen = c_gets(el, tmpbuf, L"\n: ");
terminal__putc(el, '\n');
if (tmplen < 0 || (tmpbuf[tmplen] = 0, parse_line(el, tmpbuf)) == -1)
terminal_beep(el);
el->el_map.current = el->el_map.key;
re_clear_display(el);
return 4;
}
|
undefined8 ed_command(long param_1)
{
int iVar1;
long in_FS_OFFSET;
undefined4 local_1018 [1026];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
iVar1 = c_gets(param_1,local_1018,&DAT_0010151c);
terminal__putc(param_1,10);
if (-1 < iVar1) {
local_1018[iVar1] = 0;
iVar1 = parse_line(param_1,local_1018);
if (iVar1 != -1) goto LAB_001014d3;
}
terminal_beep(param_1);
LAB_001014d3:
*(undefined8 *)(param_1 + 0x400) = *(undefined8 *)(param_1 + 0x3f8);
re_clear_display(param_1);
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return 4;
}
|
static void *
hg_initfn (void *data)
{
static int hg_options;
int *hgopt = data ? data : &hg_options;
*hgopt = (1 << 27);
return hgopt;
}
|
long long hg_initfn(unsigned long long a0) {
unsigned long long v0;
unsigned long long v2;
if (a0)
v2 = a0;
else
v2 = &hg_options.7094;
v0 = v2;
*(v0) = 0x8000000;
return v0;
}
|
static
_Bool
output_diff3_edscript (FILE *outputfile, struct diff3_block *diff,
int const mapping[3], int const rev_mapping[3],
char const *file0, char const *file1, char const *file2)
{
_Bool
leading_dot;
_Bool
conflicts_found =
0
;
_Bool
conflict;
struct diff3_block *b;
for (b = reverse_diff3_blocklist (diff); b; b = b->next)
{
enum diff_type type
= (b->correspond == DIFF_ALL
? DIFF_ALL
: DIFF_1ST + rev_mapping[b->correspond - DIFF_1ST]);
printint low0, high0;
switch (type)
{
default: continue;
case DIFF_2ND: if (!show_2nd) continue; conflict =
1
; break;
case DIFF_3RD: if (overlap_only) continue; conflict =
0
; break;
case DIFF_ALL: if (simple_only) continue; conflict = flagging; break;
}
low0 = ((b)->ranges[mapping[0]][0]);
high0 = ((b)->ranges[mapping[0]][1]);
if (conflict)
{
conflicts_found =
1
;
fprintf (outputfile, "%""l""da\n", high0);
leading_dot =
0
;
if (type == DIFF_ALL)
{
if (show_2nd)
{
fprintf (outputfile, "||||||| %s\n", file1);
leading_dot = dotlines (outputfile, b, mapping[1]);
}
fputs_unlocked ("=======\n",outputfile);
leading_dot |= dotlines (outputfile, b, mapping[2]);
}
fprintf (outputfile, ">>>>>>> %s\n", file2);
undotlines (outputfile, leading_dot, high0 + 2,
((((b)->ranges[mapping[1]][1]) - ((b)->ranges[mapping[1]][0]) + 1)
+ (((b)->ranges[mapping[2]][1]) - ((b)->ranges[mapping[2]][0]) + 1) + 1));
fprintf (outputfile, "%""l""da\n<<<<<<< %s\n", low0 - 1,
type == DIFF_ALL ? file0 : file1);
leading_dot =
0
;
if (type == DIFF_2ND)
{
leading_dot = dotlines (outputfile, b, mapping[1]);
fputs_unlocked ("=======\n",outputfile);
}
undotlines (outputfile, leading_dot, low0 + 1,
(((b)->ranges[mapping[1]][1]) - ((b)->ranges[mapping[1]][0]) + 1));
}
else if ((((b)->ranges[mapping[2]][1]) - ((b)->ranges[mapping[2]][0]) + 1) == 0)
{
if (low0 == high0)
fprintf (outputfile, "%""l""dd\n", low0);
else
fprintf (outputfile, "%""l""d,%""l""dd\n", low0, high0);
}
else
{
switch (high0 - low0)
{
case -1:
fprintf (outputfile, "%""l""da\n", high0);
break;
case 0:
fprintf (outputfile, "%""l""dc\n", high0);
break;
default:
fprintf (outputfile, "%""l""d,%""l""dc\n", low0, high0);
break;
}
undotlines (outputfile, dotlines (outputfile, b, mapping[2]),
low0, (((b)->ranges[mapping[2]][1]) - ((b)->ranges[mapping[2]][0]) + 1));
}
}
if (finalwrite)
fputs_unlocked ("w\nq\n",outputfile);
return conflicts_found;
}
|
int output_diff3_edscript(void* a0, unsigned long long a1, unsigned int a2[3], unsigned int *a3, unsigned long a4, unsigned long a5, unsigned long v7) {
char v0;
char v1;
char v2;
unsigned int v3;
struct_2 *v4;
unsigned long long v5;
unsigned long v6;
unsigned int v10;
v1 = 0;
v4 = reverse_diff3_blocklist(a1);
while (true) {
if (!v4)
break;
v3 = (v4->field_0 == 4 ? a3[5 + v4->field_0] + 5 : 4);
switch (v3) {
case 7:
if (!(!overlap_only))
break;
v2 = 0;
goto LABEL_4029de;
case 4:
if (!(!simple_only))
break;
v2 = flagging;
goto LABEL_4029de;
case 6:
if (!(!(show_2nd ^ 1)))
break;
v2 = 1;
goto LABEL_4029de;
default:
break;
}
LABEL_4029de:
v5 = *(&v4->padding_4[4 + 16 * a2[0]]);
v6 = *(&v4->padding_4[12 + 16 * a2[0]]);
if (v2) {
v1 = 1;
fprintf(a0, "%lda\n", v6);
v0 = 0;
if (v3 == 4) {
if (show_2nd) {
fprintf(a0, "||||||| ", a5);
v0 = dotlines(a0, v4, a2[1]);
}
fputs_unlocked("=======\n", a0);
v0 = (dotlines(a0, v4, a2[2]) | v0);
}
fprintf(a0, ">>>>>>> %s\n", v7);
undotlines(a0, v0, v6 + 2, *(&v4->padding_4[12 + 16 * a2[2]]) - *(&v4->padding_4[4 + 16 * a2[2]]) + 1 + *(&v4->padding_4[12 + 16 * a2[1]]) - *(&v4->padding_4[4 + 16 * a2[1]]) + 1 + 1);
if (v3 == 4)
v10 = a4;
else
v10 = a5;
fprintf(a0, "%lda\n<<<<<<< %s\n", (v5 - 1), v10);
v0 = 0;
if (v3 == 6) {
v0 = dotlines(a0, v4, a2[1]);
fputs_unlocked("=======\n", a0);
}
undotlines(a0, v0, v5 + 1, *(&v4->padding_4[12 + 16 * a2[1]]) - *(&v4->padding_4[4 + 16 * a2[1]]) + 1);
} else if (*(&v4->padding_4[12 + 16 * a2[2]]) - *(&v4->padding_4[4 + 16 * a2[2]]) != -1) {
if (v6 - v5 == -1) {
fprintf(a0, "%lda\n", v6);
} else {
if (!v6 - v5)
fprintf(a0, "%ldc\n", v6);
else
fprintf(a0, "%ld,%ldc\n", v5, v6);
}
undotlines(a0, dotlines(a0, v4, a2[2]), v5, *(&v4->padding_4[12 + 16 * a2[2]]) - *(&v4->padding_4[4 + 16 * a2[2]]) + 1);
} else if (v5 == v6) {
fprintf(a0, "%ldd\n", v5);
} else {
fprintf(a0, "%ld,%ldd\n", v5, v6);
}
v4 = v4->field_68;
}
if (finalwrite)
fputs_unlocked("w\nq\n", a0);
return v1;
}
|
static unsigned long int
integer_arg (char const *s, unsigned long int maxval)
{
return xnumtoumax (s, 0, 0, maxval, "bB", gettext ("invalid integer argument"), 0);
}
|
int integer_arg(unsigned long long a0, unsigned long long a1) {
void* v0;
v0 = 0;
return xnumtoumax(a0, 0x0, 0x0, a1, "bB", gettext("invalid integer argument"));
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.