input
stringlengths 28
169k
| output
stringlengths 20
317k
|
|---|---|
void
usage (FILE *out, int status)
{
const char str[] =
"gnutls-cli-debug - GnuTLS debug client\n"
"Usage: gnutls-cli-debug [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostname]\n"
"\n"
"None:\n"
"\n"
" -d, --debug=num Enable debugging\n"
" - it must be in the range:\n"
" 0 to 9999\n"
" -V, --verbose More verbose output\n"
" -p, --port=num The port to connect to\n"
" - it must be in the range:\n"
" 0 to 65536\n"
" --app-proto an alias for the 'starttls-proto' option\n"
" --starttls-proto=str The application protocol to be used to obtain the server's certificate (https, ftp, smtp, imap, ldap, xmpp, lmtp, pop3, nntp, sieve, postgres)\n"
"\n"
"Version, usage and configuration options:\n"
"\n"
" -v, --version[=arg] output version information and exit\n"
" -h, --help display extended usage information and exit\n"
" -!, --more-help extended usage information passed thru pager\n"
"\n"
"Options are specified by doubled hyphens and their name or by a single\n"
"hyphen and the flag character.\n"
"Operands and options may be intermixed. They will be reordered.\n"
"\n"
"TLS debug client. It sets up multiple TLS connections to \n"
"a server and queries its capabilities. It was created to assist in debugging \n"
"GnuTLS, but it might be useful to extract a TLS server's capabilities.\n"
"It connects to a TLS server, performs tests and print the server's \n"
"capabilities. If called with the `-V' parameter more checks will be performed.\n"
"Can be used to check for servers with special needs or bugs.\n"
"\n"
"Please send bug reports to: <bugs@gnutls.org>\n"
"\n";
fprintf (out, "%s", str);
exit (status);
}
|
void usage(void* a0, unsigned long a1) {
unsigned int v0;
void* v1;
unsigned long v2;
unsigned long v3;
unsigned long long *v5;
unsigned long long v6;
unsigned long long v7;
unsigned long v8;
struct_0 *v9;
v1 = a0;
v0 = a1;
v3 = v5[5];
v6 = 188;
v9 = &v2;
for (v7 = "gnutls-cli-debug - GnuTLS debug client\nUsage: gnutls-cli-debug [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostname]\n\nNone:\n\n -d, --debug=num Enable debugging\n\t\t\t\t- it must be in the range:\n\t\t\t\t 0 to 9999\n -V, --verbose More verbose output\n -p, --port=num The port to connect to\n\t\t\t\t- it must be in the range:\n\t\t\t\t 0 to 65536\n --app-proto an alias for the 'starttls-proto' option\n --starttls-proto=str The application protocol to be used to obtain the server's certificate (https, ftp, smtp, imap, ldap, xmpp, lmtp, pop3, nntp, sieve, postgres)\n\nVersion, usage and configuration options:\n\n -v, --version[=arg] output version information and exit\n -h, --help display extended usage information and exit\n -!, --more-help extended usage information passed thru pager\n\nOptions are specified by doubled hyphens and their name or by a single\nhyphen and the flag character.\nOperands and options may be intermixed. The"; v6; v7 += v8 * 8) {
v6 -= 1;
v2 = *(v7);
v9 = v9 + 8 * v8;
}
*(&v9->field_0) = *(v7);
v9->field_4 = *((v7 + 4));
v9->field_6 = *((v7 + 6));
fprintf(v1, "%s", &v2);
exit(v0);
}
|
int
el_source(EditLine *el, const char *fname)
{
FILE *fp;
size_t len;
ssize_t slen;
char *ptr;
char *path =
((void *)0)
;
const wchar_t *dptr;
int error = 0;
fp =
((void *)0)
;
if (fname ==
((void *)0)
) {
if ((fname = secure_getenv("EDITRC")) ==
((void *)0)
) {
static const char elpath[] = "/.editrc";
size_t plen = sizeof(elpath);
if ((ptr = secure_getenv("HOME")) ==
((void *)0)
)
return -1;
plen += strlen(ptr);
if ((path = calloc(plen, sizeof(*path))) ==
((void *)0)
)
return -1;
(void)snprintf(path, plen, "%s%s", ptr,
elpath + (*ptr == '\0'));
fname = path;
}
}
if (fname[0] == '\0')
return -1;
if (fp ==
((void *)0)
)
fp = fopen(fname, "r");
if (fp ==
((void *)0)
) {
free(path);
return -1;
}
ptr =
((void *)0)
;
len = 0;
while ((slen = getline(&ptr, &len, fp)) != -1) {
if (*ptr == '\n')
continue;
if (slen > 0 && ptr[--slen] == '\n')
ptr[slen] = '\0';
dptr = ct_decode_string(ptr, &el->el_scratch);
if (!dptr)
continue;
while (*dptr != '\0' && iswspace(*dptr))
dptr++;
if (*dptr == '#')
continue;
if ((error = parse_line(el, dptr)) == -1)
break;
}
free(ptr);
free(path);
(void) fclose(fp);
return error;
}
|
int el_source(long param_1,char *param_2)
{
int iVar1;
size_t sVar2;
char *pcVar3;
long in_FS_OFFSET;
char *local_68;
int local_4c;
size_t local_48;
char *local_40;
FILE *local_38;
char *local_30;
wint_t *local_28;
size_t local_20;
long local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_30 = (char *)0x0;
local_4c = 0;
local_38 = (FILE *)0x0;
local_68 = param_2;
if ((param_2 == (char *)0x0) &&
(local_68 = (char *)secure_getenv("EDITRC"), local_68 == (char *)0x0)) {
local_20 = 9;
local_40 = (char *)secure_getenv(&DAT_00101ef7);
if (local_40 == (char *)0x0) {
local_4c = -1;
goto LAB_00101b96;
}
sVar2 = strlen(local_40);
local_20 = local_20 + sVar2;
local_30 = (char *)calloc(local_20,1);
if (local_30 == (char *)0x0) {
local_4c = -1;
goto LAB_00101b96;
}
if (*local_40 == '\0') {
pcVar3 = ".editrc";
}
else {
pcVar3 = "/.editrc";
}
snprintf(local_30,local_20,"%s%s",local_40,pcVar3);
local_68 = local_30;
}
if (*local_68 == '\0') {
local_4c = -1;
}
else {
if (local_38 == (FILE *)0x0) {
local_38 = fopen(local_68,"r");
}
if (local_38 == (FILE *)0x0) {
free(local_30);
local_4c = -1;
}
else {
local_40 = (char *)0x0;
local_48 = 0;
do {
do {
do {
local_18 = getline(&local_40,&local_48,local_38);
if (local_18 == -1) goto LAB_00101b6f;
} while (*local_40 == '\n');
if ((0 < local_18) && (local_18 = local_18 + -1, local_40[local_18] == '\n')) {
local_40[local_18] = '\0';
}
local_28 = (wint_t *)ct_decode_string(local_40,param_1 + 0x4e8);
} while (local_28 == (wint_t *)0x0);
while ((*local_28 != 0 && (iVar1 = iswspace(*local_28), iVar1 != 0))) {
local_28 = local_28 + 1;
}
} while ((*local_28 == 0x23) || (local_4c = parse_line(param_1,local_28), local_4c != -1));
LAB_00101b6f:
free(local_40);
free(local_30);
fclose(local_38);
}
}
LAB_00101b96:
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return local_4c;
}
__stack_chk_fail();
}
|
static
_Bool
depmod_is_path_starts_with(const char *path,
size_t pathlen,
const char *prefix,
size_t prefix_len)
{
if (pathlen <= prefix_len)
return
0
;
if (path[prefix_len] != '/')
return
0
;
if (memcmp(path, prefix, prefix_len) != 0)
return
0
;
return
1
;
}
|
int depmod_is_path_starts_with(char *a0, unsigned long a1, void* a2, char *a3) {
unsigned int v1;
if (a1 <= a3) {
v1 = 0;
} else if (*((a3 + a0)) != 47) {
v1 = 0;
} else {
v1 = memcmp(a0, a2, a3);
if (v1)
v1 = 0;
else
v1 = 1;
}
return v1;
}
|
double stop_benchmark(struct benchmark_st *st, const char *metric,
int quiet)
{
double secs;
unsigned long lsecs;
struct timespec stop;
double dspeed, ddata;
char imetric[16];
signal(
14
, st->old_handler);
clock_gettime(
2
, &stop);
lsecs = timespec_sub_ms(&stop, &st->start);
secs = lsecs;
secs /= 1000;
if (metric ==
((void *)0)
) {
value2human(st->size, secs, &ddata, &dspeed, imetric);
if (quiet == 0)
printf(" Processed %.2f %s in %.2f secs: ", ddata,
imetric, secs);
printf("%.2f %s/sec\n", dspeed, imetric);
} else {
ddata = (double) st->size;
dspeed = ddata / secs;
if (quiet == 0)
printf(" Processed %.2f %s in %.2f secs: ", ddata,
metric, secs);
printf("%.2f %s/sec\n", dspeed, metric);
}
return secs;
}
|
long long stop_benchmark(unsigned long long a0[4], unsigned long a1, unsigned long long a2) {
char v0;
unsigned long long v1;
unsigned long long v2;
unsigned long v3;
char v4;
char v5;
unsigned long long v7;
unsigned long long v8;
unsigned int v9;
signal(0xe, a0[3]);
clock_gettime(0x2, &v4, a2);
v2 = timespec_sub_ms(&v4, a0);
if (v2 >= 0)
v7 = v2;
else
v7 = (v2 >> 1 | v2 & 1) * 2;
v3 = v7;
s_40 =L Conv(128->64, (Conv(64->128, Load(addr=stack_base-64, size=8, endness=Iend_LE)) / 0x408f400000000000<128>))<8>
if (!a1) {
value2human(a0[2], &v1, &v0, &v5);
if (!a2)
printf(" Processed %.2f %s in %.2f secs: ", &v5, &v5, &v5);
printf("%.2f %s/sec\n", &v5, &v5);
} else {
if (a0[2] >= 0)
v8 = a0[2];
else
v8 = (a0[2] >> 1 | a0[2] & 1) * 2;
v1 = v8;
v0 = v1 / v3;
if (!a2)
printf(" Processed %.2f %s in %.2f secs: ", a1, a1, v9);
printf("%.2f %s/sec\n", a1, a1);
}
return 0;
}
|
static inline void
emit_ancillary_info (char const *program)
{
struct infomap { char const *program; char const *node; } const infomap[] = {
{ "[", "test invocation" },
{ "coreutils", "Multi-call invocation" },
{ "sha224sum", "sha2 utilities" },
{ "sha256sum", "sha2 utilities" },
{ "sha384sum", "sha2 utilities" },
{ "sha512sum", "sha2 utilities" },
{
((void *)0)
,
((void *)0)
}
};
char const *node = program;
struct infomap const *map_prog = infomap;
while (map_prog->program && ! (strcmp (program, map_prog->program) == 0))
map_prog++;
if (map_prog->node)
node = map_prog->node;
printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https:
char const *lc_messages = setlocale (
5
,
((void *)0)
);
if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1))
{
fputs_unlocked (gettext ("Report any translation bugs to " "<https:
stdout
)
;
}
char const *url_program = (strcmp (program, "[") == 0) ? "test" : program;
printf (gettext ("Full documentation <%s%s>\n"),
"https:
printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"),
node, node == program ? " invocation" : "");
}
|
void emit_ancillary_info(char *param_1)
{
FILE *__stream;
int iVar1;
char *pcVar2;
char *pcVar3;
long in_FS_OFFSET;
char *local_b8;
char **local_b0;
char *local_98;
char *local_90;
char *local_88;
char *local_80;
char *local_78;
char *local_70;
char *local_68;
char *local_60;
char *local_58;
char *local_50;
char *local_48;
char *local_40;
undefined8 local_38;
undefined8 local_30;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
local_98 = "[";
local_90 = "test invocation";
local_88 = "coreutils";
local_80 = "Multi-call invocation";
local_78 = "sha224sum";
local_70 = "sha2 utilities";
local_68 = "sha256sum";
local_60 = "sha2 utilities";
local_58 = "sha384sum";
local_50 = "sha2 utilities";
local_48 = "sha512sum";
local_40 = "sha2 utilities";
local_38 = 0;
local_30 = 0;
local_b0 = &local_98;
while ((*local_b0 != (char *)0x0 && (iVar1 = strcmp(param_1,*local_b0), iVar1 != 0))) {
local_b0 = local_b0 + 2;
}
local_b8 = param_1;
if (local_b0[1] != (char *)0x0) {
local_b8 = local_b0[1];
}
pcVar2 = (char *)gettext("\n%s online help: <%s>\n");
printf(pcVar2,"GNU coreutils","https:
pcVar2 = setlocale(5,(char *)0x0);
if ((pcVar2 != (char *)0x0) && (iVar1 = strncmp(pcVar2,"en_",3), __stream = stdout, iVar1 != 0)) {
pcVar2 = (char *)gettext(
"Report any translation bugs to <https:
);
fputs_unlocked(pcVar2,__stream);
}
iVar1 = strcmp(param_1,"[");
pcVar2 = param_1;
if (iVar1 == 0) {
pcVar2 = "test";
}
pcVar3 = (char *)gettext("Full documentation <%s%s>\n");
printf(pcVar3,"https:
if (local_b8 == param_1) {
pcVar2 = " invocation";
}
else {
pcVar2 = "";
}
pcVar3 = (char *)gettext("or available locally via: info \'(coreutils) %s%s\'\n");
printf(pcVar3,local_b8,pcVar2);
if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
__stack_chk_fail();
}
|
static int
monitor_valid_userblob(struct ssh *ssh, const u_char *data, u_int datalen)
{
struct sshbuf *b;
struct sshkey *hostkey =
((void *)0)
;
const u_char *p;
char *userstyle, *cp;
size_t len;
u_char type;
int hostbound = 0, r, fail = 0;
if ((b = sshbuf_from(data, datalen)) ==
((void *)0)
)
sshfatal("monitor.c", __func__, 1254, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_from");
if (ssh->compat & 0x00000010) {
p = sshbuf_ptr(b);
len = sshbuf_len(b);
if ((session_id2 ==
((void *)0)
) ||
(len < session_id2_len) ||
(timingsafe_bcmp(p, session_id2, session_id2_len) != 0))
fail++;
if ((r = sshbuf_consume(b, session_id2_len)) != 0)
sshfatal("monitor.c", __func__, 1264, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "consume");
} else {
if ((r = sshbuf_get_string_direct(b, &p, &len)) != 0)
sshfatal("monitor.c", __func__, 1267, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse sessionid");
if ((session_id2 ==
((void *)0)
) ||
(len != session_id2_len) ||
(timingsafe_bcmp(p, session_id2, session_id2_len) != 0))
fail++;
}
if ((r = sshbuf_get_u8(b, &type)) != 0)
sshfatal("monitor.c", __func__, 1274, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse type");
if (type != 50)
fail++;
if ((r = sshbuf_get_cstring(b, &cp,
((void *)0)
)) != 0)
sshfatal("monitor.c", __func__, 1278, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse userstyle");
xasprintf(&userstyle, "%s%s%s", authctxt->user,
authctxt->style ? ":" : "",
authctxt->style ? authctxt->style : "");
if (strcmp(userstyle, cp) != 0) {
sshlog("monitor.c", __func__, 1283, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "wrong user name passed to monitor: " "expected %s != %.100s", userstyle, cp)
;
fail++;
}
free(userstyle);
free(cp);
if ((r = sshbuf_get_string_direct(b,
((void *)0)
,
((void *)0)
)) != 0 ||
(r = sshbuf_get_cstring(b, &cp,
((void *)0)
)) != 0)
sshfatal("monitor.c", __func__, 1291, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse method");
if (strcmp("publickey", cp) != 0) {
if (strcmp("publickey-hostbound-v00@openssh.com", cp) == 0)
hostbound = 1;
else
fail++;
}
free(cp);
if ((r = sshbuf_get_u8(b, &type)) != 0)
sshfatal("monitor.c", __func__, 1300, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse pktype");
if (type == 0)
fail++;
if ((r = sshbuf_get_string_direct(b,
((void *)0)
,
((void *)0)
)) != 0 ||
(r = sshbuf_get_string_direct(b,
((void *)0)
,
((void *)0)
)) != 0 ||
(hostbound && (r = sshkey_froms(b, &hostkey)) != 0))
sshfatal("monitor.c", __func__, 1306, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse pk");
if (sshbuf_len(b) != 0)
fail++;
sshbuf_free(b);
if (hostkey !=
((void *)0)
) {
if (get_hostkey_index(hostkey, 1, ssh) == -1)
sshfatal("monitor.c", __func__, 1317, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "hostbound hostkey does not match");
sshkey_free(hostkey);
}
return (fail == 0);
}
|
int monitor_valid_userblob(struct_0 *a0, unsigned long long a1, unsigned long a2) {
unsigned int v0;
char v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
void* v5;
unsigned long long v6;
char v7;
char v8;
unsigned long v9;
unsigned long long v10;
unsigned long long v11;
char v12;
unsigned long long v16;
unsigned long long v17;
unsigned long long v19;
v0 = a2;
v5 = 0;
v2 = 0;
v4 = 0;
v10 = sshbuf_from(a1, v0, v0);
if (!v10)
sshfatal("monitor.c", "monitor_valid_userblob", 0x4e6, 0x1, 0x1, 0x0, "sshbuf_from");
if ((a0->field_83c & 16)) {
v6 = sshbuf_ptr(v10);
v9 = sshbuf_len(v10);
if (!session_id2 || timingsafe_bcmp(v6, session_id2, session_id2_len, session_id2) || session_id2_len > v9)
v4 = __addvsi3(v4, 0x1);
v3 = sshbuf_consume(v10, session_id2_len, session_id2_len);
if (v3) {
v11 = "consume";
sshfatal("monitor.c", "monitor_valid_userblob", 0x4f0, 0x1, 0x1, ssh_err(v3), *(&v12));
}
}
if (!(a0->field_83c & 16) || v3) {
v3 = sshbuf_get_string_direct(v10, &v6, &v9, &v6);
if (v3) {
v11 = "parse sessionid";
sshfatal("monitor.c", "monitor_valid_userblob", 0x4f3, 0x1, 0x1, ssh_err(v3), *(&v12));
}
if (!session_id2 || session_id2_len != v9 || timingsafe_bcmp(v6, session_id2, session_id2_len, session_id2))
v4 = __addvsi3(v4, 0x1);
}
v3 = sshbuf_get_u8(v10, &v1, &v1);
if (v3) {
v11 = "parse type";
sshfatal("monitor.c", "monitor_valid_userblob", 0x4fa, 0x1, 0x1, ssh_err(v3), *(&v12));
}
if (v1 != 50)
v4 = __addvsi3(v4, 0x1);
v3 = sshbuf_get_cstring(v10, &v8, 0x0, &v8);
if (v3) {
v11 = "parse userstyle";
sshfatal("monitor.c", "monitor_valid_userblob", 0x4fe, 0x1, 0x1, ssh_err(v3), *(&v12));
}
if (*((authctxt + 56)))
v16 = *((authctxt + 56));
else
v16 = &g_4063a3;
if (*((authctxt + 56)))
v17 = ":";
else
v17 = &g_4063a3;
xasprintf(&v7, "%s%s%s", *((authctxt + 32)), v17, v16);
if (strcmp(*(&v7), *(&v8))) {
v11 = *(&v8);
v10 = *(&v7);
v9 = "wrong user name passed to monitor: expected %s != %.100s";
sshlog("monitor.c", "monitor_valid_userblob", 0x503, 0x0, 0x3, 0x0);
v4 = __addvsi3(v4, 0x1);
}
free(*(&v7));
free(*(&v8));
v3 = sshbuf_get_string_direct(v10, 0x0, 0x0, v19);
if (!v3)
v3 = sshbuf_get_cstring(v10, &v8, 0x0, &v8);
if (v3 || v3) {
v11 = "parse method";
sshfatal("monitor.c", "monitor_valid_userblob", 0x50b, 0x1, 0x1, ssh_err(v3), *(&v12));
}
if (strcmp("publickey", *(&v8))) {
if (!strcmp("publickey-hostbound-v00@openssh.com", *(&v8)))
v2 = 1;
else
v4 = __addvsi3(v4, 0x1);
}
free(*(&v8));
v3 = sshbuf_get_u8(v10, &v1, &v1);
if (v3) {
v11 = "parse pktype";
sshfatal("monitor.c", "monitor_valid_userblob", 0x514, 0x1, 0x1, ssh_err(v3), *(&v12));
}
if (!v1)
v4 = __addvsi3(v4, 0x1);
v3 = sshbuf_get_string_direct(v10, 0x0, 0x0, v19);
if (!v3) {
v3 = sshbuf_get_string_direct(v10, 0x0, 0x0, v19);
if (!v3 && v2)
v3 = sshkey_froms(v10, &v5, &v5);
}
if (v3 || v3 || v2 && v3) {
v11 = "parse pk";
sshfatal("monitor.c", "monitor_valid_userblob", 0x51a, 0x1, 0x1, ssh_err(v3), *(&v12));
}
if (sshbuf_len(v10))
v4 = __addvsi3(v4, 0x1);
sshbuf_free(v10);
if (v5) {
if (get_hostkey_index(v5, 0x1, a0, v19) == -1) {
v11 = "hostbound hostkey does not match";
sshfatal("monitor.c", "monitor_valid_userblob", 0x525, 0x1, 0x1, 0x0, *(&v12));
}
sshkey_free(v5);
}
return !v4;
}
|
int
rl_vi_editing_mode (int count, int key)
{
_rl_set_insert_mode (1, 1);
rl_editing_mode = 0;
rl_vi_insert_mode (1, key);
return 0;
}
|
undefined8 rl_vi_editing_mode(undefined8 param_1,undefined4 param_2)
{
_rl_set_insert_mode(1,1);
rl_editing_mode = 0;
rl_vi_insert_mode(1,param_2);
return 0;
}
|
void
array_walk(a, func, udata)
ARRAY *a;
sh_ae_map_func_t *func;
void *udata;
{
register ARRAY_ELEMENT *ae;
if (a == 0 || ((a)->num_elements == 0))
return;
for (ae = ((a->head)->next); ae != a->head; ae = ((ae)->next))
if ((*func)(ae, udata) < 0)
return;
}
|
void array_walk(long a1, int ( *a2)(long, long), long a3)
{
long i;
if ( a1 && *(_QWORD *)(a1 + 8) )
{
for ( i = *(_QWORD *)(*(_QWORD *)(a1 + 16) + 16LL); i != *(_QWORD *)(a1 + 16) && a2(i, a3) >= 0; i = *(_QWORD *)(i + 16) )
;
}
}
|
_Bool
pred_ls (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
return pred_fls (pathname, stat_buf, pred_ptr);
}
|
long long pred_ls(unsigned long long a0, unsigned long long a1, void* a2) {
return pred_fls(a0, a1, a2);
}
|
int
main(int argc, char **argv)
{
struct sshbuf *b;
Options options;
struct sshkey *keys[5], *key =
((void *)0)
;
struct passwd *pw;
int r, key_fd[5], i, found, version = 2, fd;
u_char *signature, *data, rver;
char *host, *fp, *pkalg;
size_t slen, dlen;
if (pledge("stdio rpath getpw dns id",
((void *)0)
) != 0)
sshfatal("ssh-keysign.c", __func__, 189, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: pledge: %s", __progname, strerror(
(*__errno_location ())
));
if ((fd = open(
"/dev/null"
,
02
)) < 2)
exit(1);
if (fd > 2)
close(fd);
i = 0;
key_fd[i++] = open("/usr/local/etc" "/ssh_host_dsa_key",
00
);
key_fd[i++] = open("/usr/local/etc" "/ssh_host_ecdsa_key",
00
);
key_fd[i++] = open("/usr/local/etc" "/ssh_host_ed25519_key",
00
);
key_fd[i++] = open("/usr/local/etc" "/ssh_host_xmss_key",
00
);
key_fd[i++] = open("/usr/local/etc" "/ssh_host_rsa_key",
00
);
if ((pw = getpwuid(getuid())) ==
((void *)0)
)
sshfatal("ssh-keysign.c", __func__, 207, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "getpwuid failed");
pw = pwcopy(pw);
permanently_set_uid(pw);
seed_rng();
initialize_options(&options);
(void)read_config_file("/usr/local/etc" "/ssh_config", pw, "", "",
&options, 0,
((void *)0)
);
(void)fill_default_options(&options);
if (options.enable_ssh_keysign != 1)
sshfatal("ssh-keysign.c", __func__, 224, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "ssh-keysign not enabled in %s", "/usr/local/etc" "/ssh_config")
;
if (pledge("stdio dns",
((void *)0)
) != 0)
sshfatal("ssh-keysign.c", __func__, 228, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: pledge: %s", __progname, strerror(
(*__errno_location ())
));
for (i = found = 0; i < 5; i++) {
if (key_fd[i] != -1)
found = 1;
}
if (found == 0)
sshfatal("ssh-keysign.c", __func__, 235, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "could not open any host key");
found = 0;
for (i = 0; i < 5; i++) {
keys[i] =
((void *)0)
;
if (key_fd[i] == -1)
continue;
r = sshkey_load_private_type_fd(key_fd[i], KEY_UNSPEC,
((void *)0)
, &key,
((void *)0)
);
close(key_fd[i]);
if (r != 0)
sshlog("ssh-keysign.c", __func__, 246, 0, SYSLOG_LEVEL_DEBUG1, ssh_err(r), "parse key %d", i);
else if (key !=
((void *)0)
) {
keys[i] = key;
found = 1;
}
}
if (!found)
sshfatal("ssh-keysign.c", __func__, 253, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "no hostkey found");
if ((b = sshbuf_new()) ==
((void *)0)
)
sshfatal("ssh-keysign.c", __func__, 256, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: sshbuf_new failed", __progname);
if (ssh_msg_recv(
0
, b) < 0)
sshfatal("ssh-keysign.c", __func__, 258, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: ssh_msg_recv failed", __progname);
if ((r = sshbuf_get_u8(b, &rver)) != 0)
sshfatal("ssh-keysign.c", __func__, 260, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s: buffer error", __progname);
if (rver != version)
sshfatal("ssh-keysign.c", __func__, 262, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: bad version: received %d, expected %d", __progname, rver, version)
;
if ((r = sshbuf_get_u32(b, (u_int *)&fd)) != 0)
sshfatal("ssh-keysign.c", __func__, 265, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s: buffer error", __progname);
if (fd < 0 || fd ==
0
|| fd ==
1
)
sshfatal("ssh-keysign.c", __func__, 267, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: bad fd = %d", __progname, fd);
if ((host = get_local_name(fd)) ==
((void *)0)
)
sshfatal("ssh-keysign.c", __func__, 269, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: cannot get local name for fd", __progname);
if ((r = sshbuf_get_string(b, &data, &dlen)) != 0)
sshfatal("ssh-keysign.c", __func__, 272, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s: buffer error", __progname);
if (valid_request(pw, host, &key, &pkalg, data, dlen) < 0)
sshfatal("ssh-keysign.c", __func__, 274, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: not a valid request", __progname);
free(host);
found = 0;
for (i = 0; i < 5; i++) {
if (keys[i] !=
((void *)0)
&&
sshkey_equal_public(key, keys[i])) {
found = 1;
break;
}
}
if (!found) {
if ((fp = sshkey_fingerprint(key, options.fingerprint_hash,
SSH_FP_DEFAULT)) ==
((void *)0)
)
sshfatal("ssh-keysign.c", __func__, 288, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: sshkey_fingerprint failed", __progname);
sshfatal("ssh-keysign.c", __func__, 289, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: no matching hostkey found for key %s %s", __progname, sshkey_type(key), fp ? fp : "")
;
}
if ((r = sshkey_sign(keys[i], &signature, &slen, data, dlen,
pkalg,
((void *)0)
,
((void *)0)
, 0)) != 0)
sshfatal("ssh-keysign.c", __func__, 295, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s: sshkey_sign failed", __progname);
free(data);
sshbuf_reset(b);
if ((r = sshbuf_put_string(b, signature, slen)) != 0)
sshfatal("ssh-keysign.c", __func__, 301, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s: buffer error", __progname);
if (ssh_msg_send(
1
, version, b) == -1)
sshfatal("ssh-keysign.c", __func__, 303, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: ssh_msg_send failed", __progname);
return (0);
}
|
int main(unsigned long a0, unsigned long long a1) {
unsigned long long v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned int v4;
char v5;
unsigned int v6;
unsigned int v7;
unsigned int v8;
unsigned int v9;
unsigned int v10;
void* v11;
char v12;
char v13;
char v14;
char v15;
char v16;
unsigned long long *v17;
unsigned long long v18;
void* v19;
unsigned long v20;
char v21;
char v22;
char v23;
unsigned long long v24;
char v25;
char v26;
unsigned long long v27;
unsigned long v28;
unsigned long long v29;
unsigned long v30;
char v31;
unsigned long long v32;
unsigned int *v33;
unsigned int *v34;
unsigned int *v35;
unsigned int *v36;
unsigned int *v37;
unsigned long long v38;
unsigned long long v39;
unsigned long long v40;
unsigned long long v41;
unsigned long long v42;
v24 = *(&v24);
v4 = a0;
v3 = a1;
v11 = 0;
v9 = 2;
if (pledge("stdio rpath getpw dns id", 0x0)) {
v2 = strerror(*(__errno_location()));
v1 = __progname;
v0 = "%s: pledge: %s";
sshfatal("ssh-keysign.c", "main", 0xbd, 0x0, 0x1, 0x0);
}
v6 = open("/dev/null", 0x2, 0xbd);
if (v6 <= 1)
exit(0x1);
if (v6 > 2)
close(v6);
v7 = 0;
v33 = v7;
v7 = __addvsi3(v7, 0x1);
*((&v21 + 0x4 * v33)) = open("/usr/local/etc/ssh_host_dsa_key", 0x0, 0xbd);
v34 = v7;
v7 = __addvsi3(v7, 0x1);
*((&v21 + 0x4 * v34)) = open("/usr/local/etc/ssh_host_ecdsa_key", 0x0, 0xbd);
v35 = v7;
v7 = __addvsi3(v7, 0x1);
*((&v21 + 0x4 * v35)) = open("/usr/local/etc/ssh_host_ed25519_key", 0x0, 0xbd);
v36 = v7;
v7 = __addvsi3(v7, 0x1);
*((&v21 + 0x4 * v36)) = open("/usr/local/etc/ssh_host_xmss_key", 0x0, 0xbd);
v37 = v7;
v38 = v7;
v7 = __addvsi3(v7, 0x1);
*((&v21 + 0x4 * v37)) = open("/usr/local/etc/ssh_host_rsa_key", 0x0, 0xbd);
v17 = getpwuid(getuid());
if (!v17) {
v29 = "getpwuid failed";
sshfatal("ssh-keysign.c", "main", 0xcf, 0x0, 0x1, 0x0);
}
v17 = pwcopy(v17);
permanently_set_uid(v17);
seed_rng(v38, a1, v39, v40, v41, v42);
initialize_options(&v23);
v29 = 0;
read_config_file("/usr/local/etc/ssh_config", v17, &g_4015b8, &g_4015b8, &v23, 0x0);
fill_default_options(&v23);
if (*(&v25) != 1) {
v30 = "/usr/local/etc/ssh_config";
v29 = "ssh-keysign not enabled in %s";
sshfatal("ssh-keysign.c", "main", 0xe0, 0x0, 0x1, 0x0);
}
if (pledge("stdio dns", 0x0)) {
v29 = strerror(*(__errno_location()));
v28 = __progname;
v27 = "%s: pledge: %s";
sshfatal("ssh-keysign.c", "main", 0xe4, 0x0, 0x1, 0x0);
}
v8 = 0;
for (v7 = v8; v7 <= 4; v7 = __addvsi3(v7, 0x1)) {
if (*(&(&v21)[4 * v7]) != -1)
v8 = 1;
}
if (!v8) {
v29 = "could not open any host key";
sshfatal("ssh-keysign.c", "main", 0xeb, 0x0, 0x1, 0x0);
}
v8 = 0;
for (v7 = 0; v7 <= 4; v7 = __addvsi3(v7, 0x1)) {
*(&(&v22)[8 * v7]) = 0;
if (*(&(&v21)[4 * v7]) != -1) {
v10 = sshkey_load_private_type_fd(*(&(&v21)[4 * v7]), 0xe, 0x0, &v11, 0x0);
close(*(&(&v21)[4 * v7]));
if (v10) {
v30 = v7;
v29 = "parse key %d";
sshlog("ssh-keysign.c", "main", 0xf6, 0x0, 0x5, ssh_err(v10));
} else if (v11) {
*(&(&v22)[8 * v7]) = v11;
v8 = 1;
}
}
}
if (!v8) {
v29 = "no hostkey found";
sshfatal("ssh-keysign.c", "main", 0xfd, 0x0, 0x1, 0x0);
}
v18 = sshbuf_new();
if (!v18) {
v30 = __progname;
v29 = "%s: sshbuf_new failed";
sshfatal("ssh-keysign.c", "main", 0x100, 0x0, 0x1, 0x0);
}
if (ssh_msg_recv(0x0, v18) < 0) {
v30 = __progname;
v29 = "%s: ssh_msg_recv failed";
sshfatal("ssh-keysign.c", "main", 0x102, 0x0, 0x1, 0x0);
}
v10 = sshbuf_get_u8(v18, &v5, &v5);
if (v10) {
v30 = __progname;
v29 = "%s: buffer error";
sshfatal("ssh-keysign.c", "main", 0x104, 0x0, 0x1, ssh_err(v10));
}
if (v9 != v5) {
v30 = v9;
v29 = v5;
v28 = __progname;
v27 = "%s: bad version: received %d, expected %d";
sshfatal("ssh-keysign.c", "main", 0x106, 0x0, 0x1, 0x0);
}
v10 = sshbuf_get_u32(v18, &v6, &v6);
if (v10) {
v30 = __progname;
v29 = "%s: buffer error";
sshfatal("ssh-keysign.c", "main", 0x109, 0x0, 0x1, ssh_err(v10));
}
switch (v6) {
case 0: case 1:
v29 = v6;
v28 = __progname;
v27 = "%s: bad fd = %d";
sshfatal("ssh-keysign.c", "main", 0x10b, 0x0, 0x1, 0x0);
default:
goto LABEL_400f75;
}
LABEL_400f75:
v19 = get_local_name(v6);
if (!v19) {
v30 = __progname;
v29 = "%s: cannot get local name for fd";
sshfatal("ssh-keysign.c", "main", 0x10d, 0x0, 0x1, 0x0);
}
v10 = sshbuf_get_string(v18, &v13, &v16);
if (v10) {
v30 = __progname;
v29 = "%s: buffer error";
sshfatal("ssh-keysign.c", "main", 0x110, 0x0, 0x1, ssh_err(v10));
}
if (valid_request(v17, v19, &v11, &v14, *(&v13), *(&v16)) < 0) {
v30 = __progname;
v29 = "%s: not a valid request";
sshfatal("ssh-keysign.c", "main", 0x112, 0x0, 0x1, 0x0);
}
free(v19);
v8 = 0;
v7 = 0;
while (true) {
if (v7 > 4)
break;
if (!*(&(&v22)[8 * v7]) || !sshkey_equal_public(v11, *(&(&v22)[8 * v7]), *(&(&v22)[8 * v7]))) {
v7 = __addvsi3(v7, 0x1);
} else {
v8 = 1;
break;
}
}
if (!v8) {
v20 = sshkey_fingerprint(v11, *(&v26), 0x0, *(&v26));
if (!v20) {
v30 = __progname;
v29 = "%s: sshkey_fingerprint failed";
sshfatal("ssh-keysign.c", "main", 0x120, 0x0, 0x1, 0x0);
}
*(&v30) = (!v20 ? v20 : &g_4015b8);
v29 = sshkey_type(v11);
v28 = __progname;
v27 = "%s: no matching hostkey found for key %s %s";
sshfatal("ssh-keysign.c", "main", 0x121, 0x0, 0x1, 0x0);
}
v29 = 0;
v28 = 0;
v27 = 0;
v10 = sshkey_sign(*(&(&v22)[8 * v7]), &v12, &v15, *(&v13), *(&v16), *(&v14), *(&v31), v32);
if (v10) {
v30 = __progname;
v29 = "%s: sshkey_sign failed";
sshfatal("ssh-keysign.c", "main", 0x127, 0x0, 0x1, ssh_err(v10));
}
free(*(&v13));
sshbuf_reset(v18);
v10 = sshbuf_put_string(v18, *(&v12), *(&v15), *(&v12));
if (v10) {
v30 = __progname;
v29 = "%s: buffer error";
sshfatal("ssh-keysign.c", "main", 0x12d, 0x0, 0x1, ssh_err(v10));
}
if (ssh_msg_send(0x1, v9, v18) != -1)
return 0;
v30 = __progname;
v29 = "%s: ssh_msg_send failed";
sshfatal("ssh-keysign.c", "main", 0x12f, 0x0, 0x1, 0x0);
return 0;
}
|
void
trig_activate_packageprocessing(struct pkginfo *pkg)
{
debug(dbg_triggersdetail, "trigproc_activate_packageprocessing pkg=%s",
pkg_name(pkg, pnaw_always));
trig_parse_ci(pkg_infodb_get_file(pkg, &pkg->installed, "triggers"),
((void *)0)
, trig_cicb_statuschange_activate,
pkg, &pkg->installed);
}
|
long long trig_activate_packageprocessing(unsigned long long a0) {
debug(0x2000, "trigproc_activate_packageprocessing pkg=%s", pkg_name(a0, 0x3));
return trig_parse_ci(pkg_infodb_get_file(a0, a0 + 72, "triggers", a0 + 72), 0x0, got.trig_cicb_statuschange_activate, a0, a0 + 72);
}
|
static void
do_convert_from_ssh2(struct passwd *pw, struct sshkey **k, int *private)
{
int r, blen, escaped = 0;
u_int len;
char line[1024];
struct sshbuf *buf;
char encoded[8096];
FILE *fp;
if ((buf = sshbuf_new()) ==
((void *)0)
)
sshfatal("ssh-keygen.c", __func__, 646, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new failed");
if ((fp = fopen(identity_file, "r")) ==
((void *)0)
)
sshfatal("ssh-keygen.c", __func__, 648, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: %s: %s", __progname, identity_file, strerror(
(*__errno_location ())
));
encoded[0] = '\0';
while ((blen = get_line(fp, line, sizeof(line))) != -1) {
if (blen > 0 && line[blen - 1] == '\\')
escaped++;
if (strncmp(line, "----", 4) == 0 ||
strstr(line, ": ") !=
((void *)0)
) {
if (strstr(line, "---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ----") !=
((void *)0)
)
*private = 1;
if (strstr(line, " END ") !=
((void *)0)
) {
break;
}
continue;
}
if (escaped) {
escaped--;
continue;
}
strlcat(encoded, line, sizeof(encoded));
}
len = strlen(encoded);
if (((len % 4) == 3) &&
(encoded[len-1] == '=') &&
(encoded[len-2] == '=') &&
(encoded[len-3] == '='))
encoded[len-3] = '\0';
if ((r = sshbuf_b64tod(buf, encoded)) != 0)
sshfatal("ssh-keygen.c", __func__, 677, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "base64 decode");
if (*private) {
if ((*k = do_convert_private_ssh2(buf)) ==
((void *)0)
)
sshfatal("ssh-keygen.c", __func__, 680, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "private key conversion failed");
} else if ((r = sshkey_fromb(buf, k)) != 0)
sshfatal("ssh-keygen.c", __func__, 682, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse key");
sshbuf_free(buf);
fclose(fp);
}
|
void do_convert_from_ssh2(undefined8 param_1,long *param_2,int *param_3)
{
int iVar1;
int *piVar2;
char *pcVar3;
size_t sVar4;
undefined8 uVar5;
long lVar6;
char **ppcVar7;
undefined *puVar8;
undefined *puVar9;
long in_FS_OFFSET;
char *apcStack9312 [13];
undefined auStack9208 [8];
int *local_23f0;
long *local_23e8;
undefined8 local_23e0;
int local_23d8;
int local_23d4;
uint local_23d0;
int local_23cc;
long local_23c8;
FILE *local_23c0;
char local_23b8 [1024];
char local_1fb8 [8104];
long local_10;
ppcVar7 = (char **)auStack9208;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_23d8 = 0;
apcStack9312[12] = (char *)0x101dfc;
local_23f0 = param_3;
local_23e8 = param_2;
local_23e0 = param_1;
local_23c8 = sshbuf_new();
if (local_23c8 == 0) {
ppcVar7 = apcStack9312 + 0xb;
apcStack9312[11] = "sshbuf_new failed";
sshfatal("ssh-keygen.c","do_convert_from_ssh2",0x286,0,1,0);
}
*(undefined8 *)((long)ppcVar7 + -8) = 0x101e5a;
local_23c0 = fopen(identity_file,"r");
puVar8 = (undefined *)ppcVar7;
if (local_23c0 == (FILE *)0x0) {
*(undefined8 *)((long)ppcVar7 + -8) = 0x101e70;
piVar2 = __errno_location();
iVar1 = *piVar2;
*(undefined8 *)((long)ppcVar7 + -8) = 0x101e79;
pcVar3 = strerror(iVar1);
*(char **)((long)ppcVar7 + -8) = pcVar3;
*(undefined1 **)((long)ppcVar7 + -0x10) = identity_file;
*(undefined8 *)((long)ppcVar7 + -0x18) = __progname;
puVar8 = (undefined *)((long)ppcVar7 + -0x20);
*(char **)((long)ppcVar7 + -0x20) = "%s: %s: %s";
*(undefined8 *)((long)ppcVar7 + -0x28) = 0x101ec0;
sshfatal("ssh-keygen.c","do_convert_from_ssh2",0x288,0,1,0);
}
local_1fb8[0] = '\0';
LAB_00101fc7:
do {
*(undefined8 *)(puVar8 + -8) = 0x101fe5;
local_23d4 = get_line(local_23c0,local_23b8,0x400);
if (local_23d4 == -1) break;
if (0 < local_23d4) {
*(undefined8 *)(puVar8 + -8) = 0x101ee5;
iVar1 = __addvsi3(local_23d4,0xffffffff);
if (local_23b8[iVar1] == '\\') {
*(undefined8 *)(puVar8 + -8) = 0x101f03;
local_23d8 = __addvsi3(local_23d8,1);
}
}
*(undefined8 *)(puVar8 + -8) = 0x101f24;
iVar1 = strncmp(local_23b8,"----",4);
if (iVar1 != 0) {
*(undefined8 *)(puVar8 + -8) = 0x101f3e;
pcVar3 = strstr(local_23b8,": ");
if (pcVar3 == (char *)0x0) {
if (local_23d8 == 0) {
*(undefined8 *)(puVar8 + -8) = 0x101fc7;
strlcat(local_1fb8,local_23b8,0x1fa0);
}
else {
*(undefined8 *)(puVar8 + -8) = 0x101fa1;
local_23d8 = __addvsi3(local_23d8,0xffffffff);
}
goto LAB_00101fc7;
}
}
*(undefined8 *)(puVar8 + -8) = 0x101f59;
pcVar3 = strstr(local_23b8,"---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ----");
if (pcVar3 != (char *)0x0) {
*local_23f0 = 1;
}
*(undefined8 *)(puVar8 + -8) = 0x101f81;
pcVar3 = strstr(local_23b8," END ");
} while (pcVar3 == (char *)0x0);
*(undefined8 *)(puVar8 + -8) = 0x10200a;
sVar4 = strlen(local_1fb8);
local_23d0 = (uint)sVar4;
if (((((local_23d0 & 3) == 3) && (local_1fb8[local_23d0 - 1] == '=')) &&
(local_1fb8[local_23d0 - 2] == '=')) && (local_1fb8[local_23d0 - 3] == '=')) {
local_1fb8[local_23d0 - 3] = '\0';
}
*(undefined8 *)(puVar8 + -8) = 0x10208f;
local_23cc = sshbuf_b64tod(local_23c8,local_1fb8);
puVar9 = puVar8;
if (local_23cc != 0) {
*(undefined8 *)(puVar8 + -8) = 0x1020ab;
uVar5 = ssh_err(local_23cc);
puVar9 = puVar8 + -0x10;
*(char **)(puVar8 + -0x10) = "base64 decode";
*(undefined8 *)(puVar8 + -0x18) = 0x1020e2;
sshfatal("ssh-keygen.c","do_convert_from_ssh2",0x2a5,1,1,uVar5);
}
puVar8 = puVar9;
if (*local_23f0 != 0) {
*(undefined8 *)(puVar9 + -8) = 0x1020fe;
lVar6 = do_convert_private_ssh2(local_23c8);
*local_23e8 = lVar6;
if (*local_23e8 != 0) goto LAB_001021c1;
puVar8 = puVar9 + -0x10;
*(char **)(puVar9 + -0x10) = "private key conversion failed";
*(undefined8 *)(puVar9 + -0x18) = 0x102155;
sshfatal("ssh-keygen.c","do_convert_from_ssh2",0x2a8,1,1,0);
}
*(undefined8 *)(puVar8 + -8) = 0x10216e;
local_23cc = sshkey_fromb(local_23c8,local_23e8);
puVar9 = puVar8;
if (local_23cc != 0) {
*(undefined8 *)(puVar8 + -8) = 0x10218a;
uVar5 = ssh_err(local_23cc);
puVar9 = puVar8 + -0x10;
*(char **)(puVar8 + -0x10) = "parse key";
*(undefined8 *)(puVar8 + -0x18) = 0x1021c1;
sshfatal("ssh-keygen.c","do_convert_from_ssh2",0x2aa,1,1,uVar5);
}
LAB_001021c1:
*(undefined8 *)(puVar9 + -8) = 0x1021d0;
sshbuf_free(local_23c8);
*(undefined8 *)(puVar9 + -8) = 0x1021df;
fclose(local_23c0);
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
*(undefined8 *)(puVar9 + -8) = 0x1021f4;
__stack_chk_fail();
}
|
static
_Bool
to_tm_year (textint textyear,
_Bool
debug, int *tm_year)
{
intmax_t year = textyear.value;
if (0 <= year && textyear.digits == 2)
{
year += year < 69 ? 2000 : 1900;
if (debug)
dbg_printf (gettext ("warning: adjusting year value %"
"l" "d"
" to %"
"l" "d"
"\n")
,
textyear.value, year);
}
if (year < 0
? __builtin_sub_overflow (-TM_YEAR_BASE, year, tm_year)
: __builtin_sub_overflow (year, TM_YEAR_BASE, tm_year))
{
if (debug)
dbg_printf (gettext ("error: out-of-range year %"
"l" "d"
"\n"), year);
return
0
;
}
return
1
;
}
|
int to_tm_year(unsigned long a0, unsigned int *a1, unsigned int a2, unsigned long a3, unsigned long a4, unsigned long a5, unsigned long v1, unsigned long a6) {
unsigned long v0;
char v2;
unsigned long v3;
v0 = a6;
if (!((v0 - 0 >> 63)) && *(&v2) == 2) {
if (v0 <= 68)
v3 = 2000;
else
v3 = 1900;
v0 += v3;
if (a0) {
gettext("warning: adjusting year value %ld to %ld\n");
dbg_printf();
}
}
if ((v0 - 0 >> 63)) {
a2 = 0;
if ((((-1900 ^ v0) & (-1900 ^ -1900 - v0)) >> 63))
a2 = 1;
if (false)
a2 = 1;
*(a1) = -1900 - v0;
*(&v3) = a2 & 1;
} else {
a2 = 0;
if ((((v0 ^ 1900) & (v0 ^ v0 - 1900)) >> 63))
a2 = 1;
if (false)
a2 = 1;
*(a1) = v0 - 1900;
*(&v3) = a2 & 1;
}
if (v3) {
if (a0) {
gettext("error: out-of-range year %ld\n");
dbg_printf();
}
*(&v3) = 0;
} else {
*(&v3) = 1;
}
return v3;
}
|
int
packages(const char *const *argv)
{
trigproc_install_hooks();
modstatdb_open(f_noact ? msdbrw_readonly :
in_force(FORCE_NON_ROOT) ? msdbrw_write :
msdbrw_needsuperuser);
checkpath();
pkg_infodb_upgrade();
log_message("startup packages %s", cipaction->olong);
if (f_pending) {
if (*argv)
badusage(gettext("--%s --pending does not take any non-option arguments"),cipaction->olong);
enqueue_pending();
} else {
if (!*argv)
badusage(gettext("--%s needs at least one package name argument"), cipaction->olong);
enqueue_specified(argv);
}
ensure_diversions();
process_queue();
trigproc_run_deferred();
modstatdb_shutdown();
return 0;
}
|
long packages(char *a1)
{
unsigned int v1;
long v2;
char *v3;
long v4;
char *v5;
trigproc_install_hooks();
if ( f_noact )
{
v1 = 0;
}
else if ( (unsigned char)in_force((const char *)0x10000) )
{
v1 = 3;
}
else
{
v1 = 4;
}
modstatdb_open(v1);
checkpath();
pkg_infodb_upgrade();
v2 = *cipaction;
v3 = "startup packages %s";
log_message("startup packages %s", (const char *)*cipaction);
if ( f_pending )
{
if ( *(_QWORD *)a1 )
{
v2 = *cipaction;
v3 = gettext("--%s --pending does not take any non-option arguments");
badusage(v3);
}
enqueue_pending();
}
else
{
if ( !*(_QWORD *)a1 )
{
v4 = *cipaction;
v5 = gettext("--%s needs at least one package name argument");
v2 = v4;
badusage(v5);
}
v3 = a1;
enqueue_specified(a1);
}
ensure_diversions(v3, v2);
process_queue();
trigproc_run_deferred();
modstatdb_shutdown();
return 0LL;
}
|
static int insmod(struct kmod_ctx *ctx, const char *alias,
const char *extra_options)
{
struct kmod_list *l, *list =
((void *)0)
;
int err, flags = 0;
void (*show)(struct kmod_module *m,
_Bool
install,
const char *options) =
((void *)0)
;
err = kmod_module_new_from_lookup(ctx, alias, &list);
if (list ==
((void *)0)
|| err < 0) {
log_printf(log_priority, "Module %s not found in directory %s\n", alias, ctx ? kmod_get_dirname(ctx) : "(missing)")
;
return -
2
;
}
if (strip_modversion || force)
flags |= KMOD_PROBE_FORCE_MODVERSION;
if (strip_vermagic || force)
flags |= KMOD_PROBE_FORCE_VERMAGIC;
if (ignore_commands)
flags |= KMOD_PROBE_IGNORE_COMMAND;
if (ignore_loaded)
flags |= KMOD_PROBE_IGNORE_LOADED;
if (dry_run)
flags |= KMOD_PROBE_DRY_RUN;
if (do_show || verbose >
4
)
show = &print_action;
flags |= KMOD_PROBE_APPLY_BLACKLIST_ALIAS_ONLY;
if (use_blacklist)
flags |= KMOD_PROBE_APPLY_BLACKLIST;
if (first_time)
flags |= KMOD_PROBE_FAIL_ON_LOADED;
for (l = list; l !=
((void *)0)
; l = kmod_list_next(list, l)) {
struct kmod_module *mod = kmod_module_get_module(l);
if (lookup_only)
printf("%s\n", kmod_module_get_name(mod));
else {
err = kmod_module_probe_insert_module(mod, flags,
extra_options,
((void *)0)
,
((void *)0)
, show);
}
if (err >= 0)
err = 0;
else {
switch (err) {
case -
17
:
log_printf(
3
, "could not insert '%s': Module already in kernel\n", kmod_module_get_name(mod))
;
break;
case -
2
:
log_printf(
3
, "could not insert '%s': Unknown symbol in module, " "or unknown parameter (see dmesg)\n", kmod_module_get_name(mod))
;
break;
default:
log_printf(
3
, "could not insert '%s': %s\n", kmod_module_get_name(mod), strerror(-err))
;
break;
}
}
kmod_module_unref(mod);
}
kmod_module_unref_list(list);
return err;
}
|
long insmod(long a1, const char *a2, long a3)
{
const char *dirname;
const char *name;
const char *v6;
const char *v7;
char *v8;
const char *v9;
int inserted;
int v12;
unsigned int v13;
long v14;
long i;
int ( *v16)(long, char, const char *);
long module;
unsigned long v18;
v18 = __readfsqword(0x28u);
v14 = 0LL;
v12 = 0;
v16 = 0LL;
inserted = kmod_module_new_from_lookup(a1, a2, &v14);
if ( v14 && inserted >= 0 )
{
if ( strip_modversion || force )
v12 = 2;
if ( strip_vermagic || force )
v12 |= 1u;
if ( ignore_commands )
v12 |= 4u;
if ( ignore_loaded )
v12 |= 8u;
if ( dry_run )
v12 |= 0x10u;
if ( do_show || verbose > 4 )
v16 = print_action;
v13 = v12 | 0x40000;
if ( use_blacklist )
v13 |= 0x20000u;
if ( first_time )
v13 |= 0x20u;
for ( i = v14; i; i = kmod_list_next(v14, i) )
{
module = kmod_module_get_module(i);
if ( lookup_only )
{
name = (const char *)kmod_module_get_name(module);
printf("%s\n", name);
}
else
{
inserted = kmod_module_probe_insert_module(module, v13, a3, 0LL, 0LL, v16);
}
if ( inserted < 0 )
{
if ( inserted == -17 )
{
v6 = (const char *)kmod_module_get_name(module);
log_printf(3LL, "could not insert '%s': Module already in kernel\n", v6);
}
else if ( inserted == -2 )
{
v7 = (const char *)kmod_module_get_name(module);
log_printf(3LL, "could not insert '%s': Unknown symbol in module, or unknown parameter (see dmesg)\n", v7);
}
else
{
v8 = strerror(-inserted);
v9 = (const char *)kmod_module_get_name(module);
log_printf(3LL, "could not insert '%s': %s\n", v9, v8);
}
}
else
{
inserted = 0;
}
kmod_module_unref(module);
}
kmod_module_unref_list(v14);
return (unsigned int)inserted;
}
else
{
if ( a1 )
dirname = (const char *)kmod_get_dirname(a1);
else
dirname = "(missing)";
log_printf((unsigned int)log_priority, "Module %s not found in directory %s\n", a2, dirname);
return 4294967294LL;
}
}
|
void
rl_echo_signal_char (int sig)
{
char cstr[3];
int cslen, c;
if (_rl_echoctl == 0 || _rl_echo_control_chars == 0)
return;
switch (sig)
{
case
2
: c = _rl_intr_char; break;
case
3
: c = _rl_quit_char; break;
case
20
: c = _rl_susp_char; break;
default: return;
}
if (((c) < 0x020 && (((c) & 0x80) == 0)) || c == 0x7f)
{
cstr[0] = '^';
cstr[1] = ((c) < 0x020 && (((c) & 0x80) == 0)) ? ((1 && (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)((c)|0x40)
))] & (unsigned short int) _ISlower)
)) ? toupper((unsigned char)(((c)|0x40))) : (((c)|0x40))) : '?';
cstr[cslen = 2] = '\0';
}
else
{
cstr[0] = c;
cstr[cslen = 1] = '\0';
}
_rl_output_some_chars (cstr, cslen);
}
|
void rl_echo_signal_char(unsigned long a0) {
unsigned int v0;
unsigned int v1;
char v2;
char v3;
char v4;
char v6;
unsigned long long *v8;
unsigned long long v9;
if (_rl_echoctl && _rl_echo_control_chars) {
if (a0 == 20) {
v1 = _rl_susp_char;
LABEL_400b1c:
if (v1 <= 31 && !(v1 & 128))
goto LABEL_400b34;
if (v1 != 127) {
v2 = v1;
v0 = 1;
(&v2)[v0] = 0;
} else {
LABEL_400b34:
v2 = 94;
if (v1 <= 31 && !(v1 & 128)) {
v6 = *((*(__ctype_b_loc()) + (v1 | 64) * 2)) & 0x200;
if (!v6) {
v6 = v1 | 64;
goto LABEL_400b8f;
} else {
v6 = toupper(v1 | 64);
goto LABEL_400b8f;
}
}
v6 = 63;
LABEL_400b8f:
v3 = v6;
v0 = 2;
(&v2)[v0] = 0;
}
_rl_output_some_chars(&v2, v0, v0);
} else if (a0 <= 20) {
if (a0 == 2) {
v1 = _rl_intr_char;
goto LABEL_400b1c;
}
if (a0 == 3) {
v1 = _rl_quit_char;
goto LABEL_400b1c;
}
}
}
v9 = *(&v4) ^ v8[5];
return;
}
|
static gnutls_x509_crl_t
generate_crl(gnutls_x509_crt_t ca_crt, common_info_st * cinfo)
{
gnutls_x509_crl_t crl;
gnutls_x509_crt_t *crts;
gnutls_x509_crl_t *crls;
size_t size, crl_size;
int result;
unsigned int i;
time_t secs, this_update, exp;
crls = load_crl_list(0, &crl_size, cinfo);
if (crls !=
((void *)0)
) {
if (crl_size > 1) {
fprintf(
stderr
, "load_crl: too many CRLs present\n");
app_exit(1);
}
crl = crls[0];
gnutls_free((void *) (crls)), crls=
((void *)0)
;
} else {
result = gnutls_x509_crl_init(&crl);
if (result < 0) {
fprintf(
stderr
, "crl_init: %s\n", gnutls_strerror(result));
app_exit(1);
}
}
crts = load_cert_list(0, &size, cinfo);
exp = get_crl_revocation_date();
for (i = 0; i < size; i++) {
result = gnutls_x509_crl_set_crt(crl, crts[i], exp);
if (result < 0) {
fprintf(
stderr
, "crl_set_crt: %s\n",
gnutls_strerror(result));
app_exit(1);
}
gnutls_x509_crt_deinit(crts[i]);
}
gnutls_free((void *) (crts)), crts=
((void *)0)
;
this_update = get_crl_this_update_date();
result = gnutls_x509_crl_set_this_update(crl, this_update);
if (result < 0) {
fprintf(
stderr
, "this_update: %s\n",
gnutls_strerror(result));
app_exit(1);
}
secs = get_crl_next_update();
result =
gnutls_x509_crl_set_next_update(crl, secs);
if (result < 0) {
fprintf(
stderr
, "next_update: %s\n",
gnutls_strerror(result));
app_exit(1);
}
result = gnutls_x509_crl_set_version(crl, 2);
if (result < 0) {
fprintf(
stderr
, "set_version: %s\n",
gnutls_strerror(result));
app_exit(1);
}
if (ca_crt !=
((void *)0)
) {
size = lbuffer_size;
result = gnutls_x509_crt_get_subject_key_id(ca_crt, lbuffer,
&size,
((void *)0)
);
if (result >= 0) {
result =
gnutls_x509_crl_set_authority_key_id(crl,
lbuffer,
size);
if (result < 0) {
fprintf(
stderr
, "set_authority_key_id: %s\n",
gnutls_strerror(result));
app_exit(1);
}
}
}
{
size_t serial_size;
unsigned char serial[20];
serial_size = sizeof(serial);
get_crl_number(serial, &serial_size);
result = gnutls_x509_crl_set_number(crl, serial, serial_size);
if (result < 0) {
fprintf(
stderr
, "error setting CRL serial: %s\n",
gnutls_strerror(result));
app_exit(1);
}
}
return crl;
}
|
undefined8 generate_crl(long param_1,undefined8 param_2)
{
int iVar1;
undefined8 uVar2;
long in_FS_OFFSET;
uint local_78;
undefined8 local_70;
ulong local_68;
ulong local_60;
undefined8 local_58;
undefined8 *local_50;
long local_48;
undefined8 local_40;
undefined8 local_38;
undefined8 local_30;
undefined local_28 [24];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_50 = (undefined8 *)load_crl_list(0,&local_60,param_2);
if (local_50 == (undefined8 *)0x0) {
iVar1 = gnutls_x509_crl_init(&local_70);
if (iVar1 < 0) {
uVar2 = gnutls_strerror(iVar1);
fprintf(stderr,"crl_init: %s\n",uVar2);
app_exit(1);
}
}
else {
if (1 < local_60) {
fprintf(stderr,"load_crl: too many CRLs present\n");
app_exit(1);
}
local_70 = *local_50;
(*gnutls_free)(local_50);
local_50 = (undefined8 *)0x0;
}
local_48 = load_cert_list(0,&local_68,param_2);
local_40 = get_crl_revocation_date();
for (local_78 = 0; local_78 < local_68; local_78 = local_78 + 1) {
iVar1 = gnutls_x509_crl_set_crt
(local_70,*(undefined8 *)(local_48 + (ulong)local_78 * 8),local_40);
if (iVar1 < 0) {
uVar2 = gnutls_strerror(iVar1);
fprintf(stderr,"crl_set_crt: %s\n",uVar2);
app_exit(1);
}
gnutls_x509_crt_deinit(*(undefined8 *)(local_48 + (ulong)local_78 * 8));
}
(*gnutls_free)(local_48);
local_48 = 0;
local_38 = get_crl_this_update_date();
iVar1 = gnutls_x509_crl_set_this_update(local_70,local_38);
if (iVar1 < 0) {
uVar2 = gnutls_strerror(iVar1);
fprintf(stderr,"this_update: %s\n",uVar2);
app_exit(1);
}
local_30 = get_crl_next_update();
iVar1 = gnutls_x509_crl_set_next_update(local_70,local_30);
if (iVar1 < 0) {
uVar2 = gnutls_strerror(iVar1);
fprintf(stderr,"next_update: %s\n",uVar2);
app_exit(1);
}
iVar1 = gnutls_x509_crl_set_version(local_70,2);
if (iVar1 < 0) {
uVar2 = gnutls_strerror(iVar1);
fprintf(stderr,"set_version: %s\n",uVar2);
app_exit(1);
}
if (param_1 != 0) {
local_68 = lbuffer_size;
iVar1 = gnutls_x509_crt_get_subject_key_id(param_1,lbuffer,&local_68,0);
if (-1 < iVar1) {
iVar1 = gnutls_x509_crl_set_authority_key_id(local_70,lbuffer,local_68);
if (iVar1 < 0) {
uVar2 = gnutls_strerror(iVar1);
fprintf(stderr,"set_authority_key_id: %s\n",uVar2);
app_exit(1);
}
}
}
local_58 = 0x14;
get_crl_number(local_28,&local_58);
iVar1 = gnutls_x509_crl_set_number(local_70,local_28,local_58);
if (iVar1 < 0) {
uVar2 = gnutls_strerror(iVar1);
fprintf(stderr,"error setting CRL serial: %s\n",uVar2);
app_exit(1);
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return local_70;
}
|
static int
verify_host_key_callback(struct sshkey *hostkey, struct ssh *ssh)
{
int r;
if ((r = sshkey_check_rsa_length(hostkey,
options.required_rsa_size)) != 0)
sshfatal("sshconnect2.c", __func__, 103, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "Bad server host key");
if (verify_host_key(xxx_host, xxx_hostaddr, hostkey,
xxx_conn_info) == -1)
sshfatal("sshconnect2.c", __func__, 106, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Host key verification failed.");
return 0;
}
|
long long verify_host_key_callback(unsigned long long a0, unsigned long a1) {
unsigned long long v0;
unsigned long v1;
unsigned long long v2;
unsigned int v3;
v1 = a1;
v3 = sshkey_check_rsa_length(a0, *(5248792), *(5248792));
if (v3) {
v0 = "Bad server host key";
sshfatal("sshconnect2.c", "verify_host_key_callback", 0x67, 0x0, 0x1, ssh_err(v3));
}
if (verify_host_key(xxx_host, xxx_hostaddr, a0, xxx_conn_info) == -1) {
v2 = "Host key verification failed.";
sshfatal("sshconnect2.c", "verify_host_key_callback", 0x6a, 0x0, 0x1, 0x0);
}
return 0;
}
|
static void
print_heredocs (heredocs)
REDIRECT *heredocs;
{
REDIRECT *hdtail;
cprintf (" ");
for (hdtail = heredocs; hdtail; hdtail = hdtail->next)
{
print_redirection (hdtail);
cprintf ("\n");
}
was_heredoc = 1;
}
|
long long print_heredocs(unsigned long long a0) {
unsigned long long *v0;
unsigned long long v2;
cprintf(" ");
v2 = a0;
for (v0 = a0; v0; v0 = *(v0)) {
print_redirection(v0);
cprintf("\n");
v2 = *(v0);
}
was_heredoc = 1;
return v2;
}
|
static int
session_x11_req(struct ssh *ssh, Session *s)
{
int r, success;
u_char single_connection = 0;
if (s->auth_proto !=
((void *)0)
|| s->auth_data !=
((void *)0)
) {
sshlog("session.c", __func__, 2000, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "session_x11_req: session %d: " "x11 forwarding already active", s->self)
;
return 0;
}
if ((r = sshpkt_get_u8(ssh, &single_connection)) != 0 ||
(r = sshpkt_get_cstring(ssh, &s->auth_proto,
((void *)0)
)) != 0 ||
(r = sshpkt_get_cstring(ssh, &s->auth_data,
((void *)0)
)) != 0 ||
(r = sshpkt_get_u32(ssh, &s->screen)) != 0 ||
(r = sshpkt_get_end(ssh)) != 0)
sshpkt_fatal(ssh, r, "%s: parse packet", __func__);
s->single_connection = single_connection;
if (xauth_valid_string(s->auth_proto) &&
xauth_valid_string(s->auth_data))
success = session_setup_x11fwd(ssh, s);
else {
success = 0;
sshlog("session.c", __func__, 2018, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Invalid X11 forwarding data");
}
if (!success) {
free(s->auth_proto);
free(s->auth_data);
s->auth_proto =
((void *)0)
;
s->auth_data =
((void *)0)
;
}
return success;
}
|
long session_x11_req(long a1, long a2)
{
unsigned char v3;
unsigned int u8;
unsigned int v5;
unsigned long v6;
v6 = __readfsqword(0x28u);
v3 = 0;
if ( *(_QWORD *)(a2 + 168) || *(_QWORD *)(a2 + 176) )
{
sshlog(
"session.c",
"session_x11_req",
2000LL,
0LL,
2LL,
0LL,
"session_x11_req: session %d: x11 forwarding already active",
*(unsigned int *)(a2 + 4));
return 0LL;
}
else
{
u8 = sshpkt_get_u8(a1, &v3);
if ( u8
|| (u8 = sshpkt_get_cstring(a1, a2 + 168, 0LL)) != 0
|| (u8 = sshpkt_get_cstring(a1, a2 + 176, 0LL)) != 0
|| (u8 = sshpkt_get_u32(a1, a2 + 152)) != 0
|| (u8 = sshpkt_get_end(a1)) != 0 )
{
sshpkt_fatal(a1, u8, "%s: parse packet", "session_x11_req");
}
*(_DWORD *)(a2 + 184) = v3;
if ( (unsigned int)xauth_valid_string(*(_QWORD *)(a2 + 168))
&& (unsigned int)xauth_valid_string(*(_QWORD *)(a2 + 176)) )
{
v5 = session_setup_x11fwd(a1, a2);
}
else
{
v5 = 0;
sshlog("session.c", "session_x11_req", 2018LL, 0LL, 2LL, 0LL, "Invalid X11 forwarding data");
}
if ( !v5 )
{
free(*(void **)(a2 + 168));
free(*(void **)(a2 + 176));
*(_QWORD *)(a2 + 168) = 0LL;
*(_QWORD *)(a2 + 176) = 0LL;
}
return v5;
}
}
|
static struct globval *
finddirs (pat, sdir, flags, ep, np)
char *pat;
char *sdir;
int flags;
struct globval **ep;
int *np;
{
char **r, *n;
int ndirs;
struct globval *ret, *e, *g;
e = ret = 0;
r = glob_vector (pat, sdir, flags);
if (r == 0 || r[0] == 0)
{
if (np)
*np = 0;
if (ep)
*ep = 0;
if (r && r != &glob_error_return)
sh_xfree((r), "glob.c", 620);
return (struct globval *)0;
}
for (ndirs = 0; r[ndirs] != 0; ndirs++)
{
g = (struct globval *) sh_malloc((sizeof (struct globval)), "glob.c", 625);
if (g == 0)
{
while (ret)
{
g = ret->next;
sh_xfree((ret), "glob.c", 631);
ret = g;
}
sh_xfree((r), "glob.c", 635);
if (np)
*np = 0;
if (ep)
*ep = 0;
return (&finddirs_error_return);
}
if (e == 0)
e = g;
g->next = ret;
ret = g;
g->name = r[ndirs];
}
sh_xfree((r), "glob.c", 651);
if (ep)
*ep = e;
if (np)
*np = ndirs;
return ret;
}
|
int finddirs(unsigned long long a0, unsigned long long a1, unsigned long a2, unsigned long long *a3, unsigned int *a4) {
unsigned int v0;
void* v1;
void* v2;
unsigned long long *v3;
unsigned long long v4[2];
unsigned int v6;
v1 = 0;
v2 = v1;
v3 = glob_vector(a0, a1, a2);
if (v3 && *(v3)) {
v0 = 0;
while (true) {
if (!v3[v0]) {
sh_xfree(v3, "glob.c", 0x28b);
if (a3)
*(a3) = v2;
if (a4)
*(a4) = v0;
v6 = v1;
break;
} else if (!v4) {
for (v4[0] = sh_malloc(0x10, "glob.c", 0x271); v1; v1 = v4) {
v4 = *(v1);
sh_xfree(v1, "glob.c", 0x277);
}
sh_xfree(v3, "glob.c", 0x27b);
if (a4)
*(a4) = 0;
if (a3)
*(a3) = 0;
v6 = &finddirs_error_return;
break;
} else {
if (!v2)
v2[0] = v4;
v4[0] = v1;
v1 = v4;
v4[1] = v3[v0];
v0 += 1;
}
}
}
if (!v3 || !*(v3)) {
if (a4)
*(a4) = 0;
if (a3)
*(a3) = 0;
if (v3 && v3 != 4194312)
sh_xfree(v3, "glob.c", 0x26c);
v6 = 0;
}
return v6;
}
|
static void open_files (void)
{
if (pw_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, pw_dbname ());
fail_exit (1);
}
pw_locked =
1
;
if (pw_open (
0100
|
02
) == 0) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"),
Prog, pw_dbname ());
fail_exit (1);
}
if (is_shadow_pwd && (spw_lock () == 0)) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, spw_dbname ());
fail_exit (1);
}
spw_locked =
1
;
if (is_shadow_pwd && (spw_open (
0100
|
02
) == 0)) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"),
Prog, spw_dbname ());
fail_exit (1);
}
if (Gflg || lflg) {
if (gr_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, gr_dbname ());
fail_exit (10);
}
gr_locked =
1
;
if (gr_open (
0100
|
02
) == 0) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"),
Prog, gr_dbname ());
fail_exit (10);
}
if (is_shadow_grp && (sgr_lock () == 0)) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, sgr_dbname ());
fail_exit (10);
}
sgr_locked =
1
;
if (is_shadow_grp && (sgr_open (
0100
|
02
) == 0)) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"),
Prog, sgr_dbname ());
fail_exit (10);
}
}
if (vflg || Vflg) {
if (sub_uid_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, sub_uid_dbname ());
fail_exit (16);
}
sub_uid_locked =
1
;
if (sub_uid_open (
0100
|
02
) == 0) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"),
Prog, sub_uid_dbname ());
fail_exit (16);
}
}
if (wflg || Wflg) {
if (sub_gid_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, sub_gid_dbname ());
fail_exit (18);
}
sub_gid_locked =
1
;
if (sub_gid_open (
0100
|
02
) == 0) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"),
Prog, sub_gid_dbname ());
fail_exit (18);
}
}
}
|
void open_files() {
unsigned long long 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;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v13;
unsigned long long v14;
if (!pw_lock()) {
v1 = pw_dbname();
fprintf(*(&stderr), gettext("%s: cannot lock %s; try again later.\n"));
fail_exit(0x1);
}
pw_locked = 1;
if (!pw_open(0x42)) {
v2 = pw_dbname();
fprintf(*(&stderr), gettext("%s: cannot open %s\n"));
fail_exit(0x1);
}
if (is_shadow_pwd && !spw_lock()) {
v3 = spw_dbname();
fprintf(*(&stderr), gettext("%s: cannot lock %s; try again later.\n"));
fail_exit(0x1);
}
spw_locked = 1;
if (is_shadow_pwd && !spw_open(0x42)) {
v4 = spw_dbname();
fprintf(*(&stderr), gettext("%s: cannot open %s\n"));
fail_exit(0x1);
}
if (!Gflg && !lflg)
goto LABEL_4043b1;
if (!gr_lock()) {
v5 = gr_dbname();
fprintf(*(&stderr), gettext("%s: cannot lock %s; try again later.\n"));
fail_exit(0xa);
}
gr_locked = 1;
if (!gr_open(0x42)) {
v6 = gr_dbname();
fprintf(*(&stderr), gettext("%s: cannot open %s\n"));
fail_exit(0xa);
}
if (is_shadow_grp && !sgr_lock()) {
v7 = sgr_dbname();
fprintf(*(&stderr), gettext("%s: cannot lock %s; try again later.\n"));
fail_exit(0xa);
}
sgr_locked = 1;
if (is_shadow_grp && !sgr_open(0x42)) {
v8 = sgr_dbname();
fprintf(*(&stderr), gettext("%s: cannot open %s\n"));
fail_exit(0xa);
}
LABEL_4043b1:
if (!vflg && !Vflg)
goto LABEL_40446d;
if (!sub_uid_lock()) {
v9 = sub_uid_dbname();
fprintf(*(&stderr), gettext("%s: cannot lock %s; try again later.\n"));
fail_exit(0x10);
}
sub_uid_locked = 1;
if (!sub_uid_open(0x42)) {
v11 = sub_uid_dbname();
fprintf(*(&stderr), gettext("%s: cannot open %s\n"));
fail_exit(0x10);
}
LABEL_40446d:
if (!wflg) {
v10 = Wflg;
if (!Wflg)
goto LABEL_404529;
}
if (!sub_gid_lock()) {
v13 = sub_gid_dbname();
fprintf(*(&stderr), gettext("%s: cannot lock %s; try again later.\n"));
fail_exit(0x12);
}
sub_gid_locked = 1;
if (!sub_gid_open(0x42)) {
v14 = sub_gid_dbname();
fprintf(*(&stderr), gettext("%s: cannot open %s\n"));
fail_exit(0x12);
}
LABEL_404529:
return;
}
|
static void
ipstats_stat_desc_pack_l3_stats(struct ipstats_stat_dump_filters *filters,
const struct ipstats_stat_desc *desc)
{
ipstats_stat_desc_enable_bit(filters,
IFLA_STATS_LINK_OFFLOAD_XSTATS,
IFLA_OFFLOAD_XSTATS_L3_STATS);
ipstats_stat_desc_enable_bit(filters,
IFLA_STATS_LINK_OFFLOAD_XSTATS,
IFLA_OFFLOAD_XSTATS_HW_S_INFO);
}
|
void ipstats_stat_desc_pack_l3_stats(undefined8 param_1)
{
ipstats_stat_desc_enable_bit(param_1,4,3);
ipstats_stat_desc_enable_bit(param_1,4,2);
return;
}
|
void BZ2_hbAssignCodes ( Int32 *code,
UChar *length,
Int32 minLen,
Int32 maxLen,
Int32 alphaSize )
{
Int32 n, vec, i;
vec = 0;
for (n = minLen; n <= maxLen; n++) {
for (i = 0; i < alphaSize; i++)
if (length[i] == n) { code[i] = vec; vec++; };
vec <<= 1;
}
}
|
long long BZ2_hbAssignCodes(unsigned int *a0, char *a1, unsigned long a2, unsigned long a3, unsigned long a4) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
v1 = 0;
for (v0 = a2; v0 <= a3; v0 += 1) {
for (v2 = 0; v2 < a4; v2 += 1) {
if (v0 == a1[v2]) {
a0[v2] = v1;
v1 += 1;
}
}
v1 *= 2;
}
return v0;
}
|
char *
auth2_read_banner(void)
{
struct stat st;
char *banner =
((void *)0)
;
size_t len, n;
int fd;
if ((fd = open(options.banner,
00
)) == -1)
return (
((void *)0)
);
if (fstat(fd, &st) == -1) {
close(fd);
return (
((void *)0)
);
}
if (st.st_size <= 0 || st.st_size > 1*1024*1024) {
close(fd);
return (
((void *)0)
);
}
len = (size_t)st.st_size;
banner = xmalloc(len + 1);
n = atomicio(read, fd, banner, len);
close(fd);
if (n != len) {
free(banner);
return (
((void *)0)
);
}
banner[n] = '\0';
return (banner);
}
|
void * auth2_read_banner(void)
{
int __fd;
int iVar1;
void *__ptr;
long lVar2;
long in_FS_OFFSET;
stat local_a8;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
__fd = open(_DAT_00105e18,0);
if (__fd == -1) {
__ptr = (void *)0x0;
}
else {
iVar1 = fstat(__fd,&local_a8);
if (iVar1 == -1) {
close(__fd);
__ptr = (void *)0x0;
}
else if ((local_a8.st_size < 1) || (0x100000 < local_a8.st_size)) {
close(__fd);
__ptr = (void *)0x0;
}
else {
__ptr = (void *)xmalloc(local_a8.st_size + 1);
lVar2 = atomicio(uRam00000000001000fc,__fd,__ptr,local_a8.st_size);
close(__fd);
if (lVar2 == local_a8.st_size) {
*(undefined *)(lVar2 + (long)__ptr) = 0;
}
else {
free(__ptr);
__ptr = (void *)0x0;
}
}
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return __ptr;
}
|
const char *
channel_format_extended_usage(const Channel *c)
{
if (c->efd == -1)
return "closed";
switch (c->extended_usage) {
case 2:
return "write";
case 1:
return "read";
case 0:
return "ignore";
default:
return "UNKNOWN";
}
}
|
int channel_format_extended_usage(unsigned int a0[49]) {
unsigned int v1;
if (a0[9] == -1) {
v1 = &g_4111ac;
return v1;
}
switch (a0[48]) {
case 2:
v1 = &g_4111b3;
return v1;
case 0:
v1 = &g_4111be;
return v1;
case 1:
v1 = &g_4111b9;
return v1;
default:
v1 = &g_4111c5;
return v1;
}
}
|
static void open_files (void)
{
if (gr_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, gr_dbname ());
exit (10);
}
add_cleanup (cleanup_unlock_group,
((void *)0)
);
if (is_shadow_grp) {
if (sgr_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, sgr_dbname ());
exit (10);
}
add_cleanup (cleanup_unlock_gshadow,
((void *)0)
);
}
add_cleanup (cleanup_report_del_group, group_name);
if (gr_open (
0100
|
02
) == 0) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"),
Prog, gr_dbname ());
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
4
, "cannot open %s", gr_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
exit (10);
}
if (is_shadow_grp) {
if (sgr_open (
0100
|
02
) == 0) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"),
Prog, sgr_dbname ());
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
4
, "cannot open %s", sgr_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
);
exit (10);
}
}
}
|
long open_files()
{
long v0;
long v1;
char *v2;
long v3;
long v4;
char *v5;
long v6;
long v7;
char *v8;
const char *v9;
long result;
long v11;
long v12;
char *v13;
const char *v14;
char *locale;
char *v16;
const char *v17;
const char *s;
if ( !(unsigned int)gr_lock() )
{
v0 = gr_dbname();
v1 = Prog;
v2 = gettext("%s: cannot lock %s; try again later.\n");
fprintf(stderr, v2, v1, v0);
exit(10);
}
add_cleanup(&cleanup_unlock_group, 0LL);
if ( is_shadow_grp )
{
if ( !(unsigned int)sgr_lock() )
{
v3 = sgr_dbname();
v4 = Prog;
v5 = gettext("%s: cannot lock %s; try again later.\n");
fprintf(stderr, v5, v4, v3);
exit(10);
}
add_cleanup(&cleanup_unlock_gshadow, 0LL);
}
add_cleanup(&cleanup_report_del_group, group_name);
if ( !(unsigned int)gr_open(66LL) )
{
v6 = gr_dbname();
v7 = Prog;
v8 = gettext("%s: cannot open %s\n");
fprintf(stderr, v8, v7, v6);
s = setlocale(6, 0LL);
locale = 0LL;
if ( s )
locale = strdup(s);
if ( locale )
setlocale(6, "C");
v9 = (const char *)gr_dbname();
syslog(4, "cannot open %s", v9);
if ( locale )
{
setlocale(6, locale);
free(locale);
}
exit(10);
}
result = (unsigned char)is_shadow_grp;
if ( is_shadow_grp )
{
result = sgr_open(66LL);
if ( !(_DWORD)result )
{
v11 = sgr_dbname();
v12 = Prog;
v13 = gettext("%s: cannot open %s\n");
fprintf(stderr, v13, v12, v11);
v17 = setlocale(6, 0LL);
v16 = 0LL;
if ( v17 )
v16 = strdup(v17);
if ( v16 )
setlocale(6, "C");
v14 = (const char *)sgr_dbname();
syslog(4, "cannot open %s", v14);
if ( v16 )
{
setlocale(6, v16);
free(v16);
}
exit(10);
}
}
return result;
}
|
static int
execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
SIMPLE_COM *simple_command;
int pipe_in, pipe_out, async;
struct fd_bitmap *fds_to_close;
{
WORD_LIST *words, *lastword;
char *command_line, *lastarg, *temp;
int first_word_quoted, result, builtin_is_special, already_forked, dofork;
int fork_flags, cmdflags;
pid_t old_last_async_pid;
sh_builtin_func_t *builtin;
SHELL_VAR *func;
volatile int old_builtin, old_command_builtin;
result = 0;
special_builtin_failed = builtin_is_special = 0;
command_line = (char *)0;
do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0);
if (variable_context && interactive_shell && sourcelevel == 0)
{
line_number -= function_line_number - 1;
if (line_number <= 0)
line_number = 1;
}
command_string_index = 0;
print_simple_command (simple_command);
if (signal_in_progress (
(64 + 1)
) == 0 && running_trap == 0)
{
do { if (the_printed_command_except_trap) sh_xfree((the_printed_command_except_trap), "execute_cmd.c", 4394); } while (0);
the_printed_command_except_trap = the_printed_command ? (char *)strcpy (sh_xmalloc((1 + strlen (the_printed_command)), "execute_cmd.c", 4395), (the_printed_command)) : (char *)0;
}
result = run_debug_trap ();
if (debugging_mode && result != 0)
return (0);
cmdflags = simple_command->flags;
first_word_quoted =
simple_command->words ? (simple_command->words->word->flags & (1 << 1)) : 0;
last_command_subst_pid = (pid_t)-1;
old_last_async_pid = last_asynchronous_pid;
already_forked = 0;
dofork = pipe_in != -1 || pipe_out != -1 || async;
if (dofork && pipe_in == -1 && pipe_out == -1 &&
simple_command->words && simple_command->words->word &&
simple_command->words->word->word &&
(simple_command->words->word->word[0] == '%'))
dofork = 0;
if (dofork)
{
char *p;
maybe_make_export_env ();
fork_flags = async ? 1 : 0;
if (make_child (p = (char *)strcpy (sh_xmalloc((1 + strlen (the_printed_command_except_trap)), "execute_cmd.c", 4443), (the_printed_command_except_trap)), fork_flags) == 0)
{
already_forked = 1;
cmdflags |= 0x40;
subshell_environment = 0x08|0x100;
if (pipe_in != -1 || pipe_out != -1)
subshell_environment |= 0x10;
if (async)
subshell_environment |= 0x01;
if (fds_to_close)
close_fd_bitmap (fds_to_close);
stdin_redir |= pipe_in != -1;
do_piping (pipe_in, pipe_out);
pipe_in = pipe_out = -1;
coproc_closeall ();
last_asynchronous_pid = old_last_async_pid;
if (async)
subshell_level++;
do { if (p) sh_xfree((p), "execute_cmd.c", 4477); } while (0);
}
else
{
if (pipe_out != -1)
result = last_command_exit_value;
close_pipes (pipe_in, pipe_out);
command_line = (char *)
((void *)0)
;
return (result);
}
}
do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0);
if ((cmdflags & 0x20) == 0)
{
current_fds_to_close = fds_to_close;
fix_assignment_words (simple_command->words);
fix_arrayref_words (simple_command->words);
if (cmdflags & 0x08)
comsub_ignore_return++;
words = expand_words (simple_command->words);
if (cmdflags & 0x08)
comsub_ignore_return--;
current_fds_to_close = (struct fd_bitmap *)
((void *)0)
;
}
else
words = copy_word_list (simple_command->words);
if (words == 0)
{
this_command_name = 0;
result = execute_null_command (simple_command->redirects,
pipe_in, pipe_out,
already_forked ? 0 : async);
if (already_forked)
sh_exit (result);
else
{
bind_lastarg ((char *)
((void *)0)
);
set_pipestatus_from_exit (result);
return (result);
}
}
lastarg = (char *)
((void *)0)
;
begin_unwind_frame ("simple-command");
if (echo_command_at_execute && (cmdflags & 0x0800) == 0)
xtrace_print_word_list (words, 1);
builtin = (sh_builtin_func_t *)
((void *)0)
;
func = (SHELL_VAR *)
((void *)0)
;
if ((cmdflags & 0x10) == 0)
{
if (posixly_correct)
{
builtin = find_special_builtin (words->word->word);
if (builtin)
builtin_is_special = 1;
}
if (builtin == 0)
func = find_function (words->word->word);
}
if (posixly_correct && tempenv_assign_error)
{
last_command_exit_value = 1;
if (interactive_shell == 0 && builtin_is_special)
jump_to_top_level (1);
else if (interactive_shell == 0)
jump_to_top_level (2);
else
jump_to_top_level (2);
}
tempenv_assign_error = 0;
old_command_builtin = -1;
if (builtin == 0 && func == 0)
{
WORD_LIST *disposer, *l;
int cmdtype;
builtin = find_shell_builtin (words->word->word);
while (builtin == command_builtin)
{
disposer = words;
cmdtype = 0;
words = check_command_builtin (words, &cmdtype);
if (cmdtype > 0)
{
for (l = disposer; l->next != words; l = l->next)
;
l->next = 0;
dispose_words (disposer);
cmdflags |= 0x0800 | 0x10;
if (cmdtype == 2)
cmdflags |= 0x4000;
builtin = find_shell_builtin (words->word->word);
}
else
break;
}
if (cmdflags & 0x0800)
{
old_command_builtin = executing_command_builtin;
unwind_protect_mem ((char *)&(executing_command_builtin), sizeof (executing_command_builtin));
executing_command_builtin |= 1;
}
builtin = 0;
}
add_unwind_protect (dispose_words, words);
do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0);
for (lastword = words; lastword->next; lastword = lastword->next)
;
lastarg = lastword->word->word;
if (words->word->word[0] == '%' && already_forked == 0)
{
this_command_name = async ? "bg" : "fg";
last_shell_builtin = this_shell_builtin;
this_shell_builtin = builtin_address (this_command_name);
result = (*this_shell_builtin) (words);
goto return_result;
}
if (job_control && already_forked == 0 && async == 0 &&
!first_word_quoted &&
!words->next &&
words->word->word[0] &&
!simple_command->redirects &&
pipe_in == -1 &&
pipe_out == -1 &&
(temp = get_string_value ("auto_resume")))
{
int job, jflags, started_status;
jflags = 0x08|0x10;
if (((temp)[0] == ("exact")[0] && strcmp(temp, "exact") == 0))
jflags |= 0x04;
else if (((temp)[0] == ("substring")[0] && strcmp(temp, "substring") == 0))
jflags |= 0x02;
else
jflags |= 0x01;
job = get_job_by_name (words->word->word, jflags);
if (job != -1)
{
run_unwind_frame ("simple-command");
this_command_name = "fg";
last_shell_builtin = this_shell_builtin;
this_shell_builtin = builtin_address ("fg");
started_status = start_job (job, 1);
return ((started_status < 0) ? 1 : started_status);
}
}
run_builtin:
this_command_name = words->word->word;
do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0);
if (func == 0 && builtin == 0)
builtin = find_shell_builtin (this_command_name);
last_shell_builtin = this_shell_builtin;
this_shell_builtin = builtin;
if (builtin || func)
{
if (builtin)
{
old_builtin = executing_builtin;
unwind_protect_mem ((char *)&(executing_builtin), sizeof (executing_builtin));
if (old_command_builtin == -1)
{
old_command_builtin = executing_command_builtin;
unwind_protect_mem ((char *)&(executing_command_builtin), sizeof (executing_command_builtin));
}
}
if (already_forked)
{
reset_signal_handlers ();
subshell_environment |= 0x80;
subshell_environment &= ~0x100;
if (async)
{
if ((cmdflags & 0x400) &&
pipe_in == -1 &&
(stdin_redirects (simple_command->redirects) == 0))
async_redirect_stdin ();
setup_async_signals ();
}
if (async == 0)
subshell_level++;
execute_subshell_builtin_or_function
(words, simple_command->redirects, builtin, func,
pipe_in, pipe_out, async, fds_to_close,
cmdflags);
subshell_level--;
}
else
{
result = execute_builtin_or_function
(words, builtin, func, simple_command->redirects, fds_to_close,
cmdflags);
if (builtin)
{
if (result > 256)
{
switch (result)
{
case 259:
case 260:
case 261:
if (posixly_correct && builtin_is_special && interactive_shell == 0)
{
last_command_exit_value = 1;
jump_to_top_level (4);
}
break;
case 262:
executing_builtin = old_builtin;
executing_command_builtin = old_command_builtin;
builtin = 0;
pipe_in = pipe_out = -1;
goto execute_from_filesystem;
}
result = builtin_status (result);
if (builtin_is_special)
special_builtin_failed = 1;
}
if (posixly_correct && builtin_is_special && temporary_env)
merge_temporary_env ();
}
else
{
if (result == 258)
result = 2;
else if (result > 256)
result = builtin_status (result);
}
set_pipestatus_from_exit (result);
goto return_result;
}
}
if (autocd && interactive && words->word && is_dirname (words->word->word))
{
words = make_word_list (make_word ("--"), words);
words = make_word_list (make_word ("cd"), words);
xtrace_print_word_list (words, 0);
func = find_function ("cd");
goto run_builtin;
}
execute_from_filesystem:
if (command_line == 0)
command_line = (char *)strcpy (sh_xmalloc((1 + strlen (the_printed_command_except_trap ? the_printed_command_except_trap : "")), "execute_cmd.c", 4802), (the_printed_command_except_trap ? the_printed_command_except_trap : ""));
if (already_forked == 0 && (cmdflags & 0x40) && fifos_pending() > 0)
cmdflags &= ~0x40;
result = execute_disk_command (words, simple_command->redirects, command_line,
pipe_in, pipe_out, async, fds_to_close,
cmdflags);
return_result:
bind_lastarg (lastarg);
do { if (command_line) sh_xfree((command_line), "execute_cmd.c", 4817); } while (0);
dispose_words (words);
if (builtin)
{
executing_builtin = old_builtin;
executing_command_builtin = old_command_builtin;
}
discard_unwind_frame ("simple-command");
this_command_name = (char *)
((void *)0)
;
return (result);
}
|
long long execute_simple_command(struct_0 *a0, unsigned long a1, unsigned long a2, unsigned long long a3, void* a4, unsigned long long a5) {
int tmp_23;
unsigned long v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned int v8;
unsigned int v9;
unsigned int v10;
unsigned int v11;
unsigned int v12;
unsigned int v13;
unsigned int v14;
unsigned int v15;
struct_2 *v16;
struct_2 *v17;
void* v18;
void* v19;
void* v20;
unsigned long long v21[2];
unsigned long long v22;
void* v23;
unsigned long long v24[2];
char *v25;
unsigned long v27;
void* v29;
unsigned long long v30;
unsigned long long v31;
unsigned long v32;
unsigned long long v33;
unsigned long long v34;
v2 = a1;
v1 = a2;
v5 = 0;
v6 = 0;
special_builtin_failed = v6;
v18 = 0;
if (terminating_signal)
termsig_handler(terminating_signal);
if (interrupt_state)
throw_to_top_level();
if (variable_context && interactive_shell && !sourcelevel) {
line_number = line_number - (function_line_number - 1);
if (line_number <= 0)
line_number = 1;
}
command_string_index = 0;
print_simple_command(a0);
if (!signal_in_progress(0x41) && !running_trap) {
sh_xfree(0xbaec7d8920ec8348, "execute_cmd.c", 0x112a);
if (!the_printed_command)
v27 = 0;
else
v27 = strcpy(sh_xmalloc(strlen(the_printed_command) + 1, "execute_cmd.c", 0x112b), the_printed_command);
this_shell_function = v27;
}
v5 = run_debug_trap();
if (debugging_mode && v5) {
v30 = 0;
goto LABEL_408a53;
}
v9 = a0->field_0;
if (!a0->field_8)
*(&v27) = 0;
else
*(&v27) = *((a0->field_8->field_8 + 8)) & 2;
v11 = v27;
last_command_subst_pid = -1;
v12 = last_asynchronous_pid;
v7 = 0;
if (v2 != -1) {
LABEL_407cbb:
*(&v27) = 1;
} else {
if (!(v1 == -1))
goto LABEL_407cbb;
if (!(!a3))
goto LABEL_407cbb;
*(&v27) = 0;
}
v8 = v27;
if (v8 && v2 == -1 && v1 == -1 && a0->field_8 && a0->field_8->field_8 && *(a0->field_8->field_8) && *(*(a0->field_8->field_8)) == 37)
v8 = 0;
if (v8) {
maybe_make_export_env();
v13 = a3;
v22 = strcpy(sh_xmalloc(strlen(0xbaec7d8920ec8348) + 1, "execute_cmd.c", 0x115b), 0xbaec7d8920ec8348);
if (make_child(v22, v13, v13)) {
if (v1 != -1)
v5 = 2372415452829272149;
close_pipes(v2, v1);
v18 = 0;
v30 = v5;
goto LABEL_408a53;
} else {
v7 = 1;
v9 |= 64;
line_number_for_err_trap = 264;
if (v2 == -1 && v1 == -1)
goto LABEL_407dfa;
line_number_for_err_trap = 2372415452829272149 | 16;
LABEL_407dfa:
if (a3)
line_number_for_err_trap = 2372415452829272149 | 1;
if (a4)
close_fd_bitmap(a4);
line_number_for_err_trap = 2372415452829272149 | v2 != -1;
do_piping(v2, v1);
v1 = -1;
v2 = v1;
coproc_closeall();
last_asynchronous_pid = v12;
if (a3)
subshell_level = subshell_level + 1;
if (v22)
sh_xfree(v22, "execute_cmd.c", 0x117d);
}
}
if (terminating_signal)
termsig_handler(terminating_signal);
if (interrupt_state)
throw_to_top_level();
if ((v9 & 32)) {
v16 = copy_word_list(a0->field_8);
} else {
current_fds_to_close = a4;
fix_assignment_words(a0->field_8);
fix_arrayref_words(a0->field_8);
if ((v9 & 8))
comsub_ignore_return = comsub_ignore_return + 1;
v16 = expand_words(a0->field_8);
if ((v9 & 8))
comsub_ignore_return = comsub_ignore_return - 1;
current_fds_to_close = 0;
}
if (v16) {
v23 = 0;
begin_unwind_frame("simple-command");
if (echo_command_at_execute && !(v9 & 0x800))
xtrace_print_word_list(v16, 0x1);
v19 = 0;
v20 = 0;
if (!(v9 & 16)) {
if (posixly_correct) {
v19 = find_special_builtin(v16->field_8->field_0);
if (v19)
v6 = 1;
}
if (!v19)
v20 = find_function(v16->field_8->field_0);
}
if (posixly_correct && tempenv_assign_error) {
line_number_for_err_trap = 1;
if (!interactive_shell && v6)
jump_to_top_level(0x1);
if (!interactive_shell)
jump_to_top_level(0x2);
jump_to_top_level(0x2);
}
tempenv_assign_error = 0;
v3 = -1;
if (!v19 && !v20) {
v19 = find_shell_builtin(v16->field_8->field_0);
while (true) {
if (v19 != got.command_builtin)
break;
v24[0] = v16;
v4 = 0;
v16 = check_command_builtin(v16, &v4, &v4);
if (v4 <= 0)
break;
for (v21[0] = v24; v16 != v21[0]; v21[0] = v21[0]);
v21[0] = 0;
dispose_words(v24);
v9 |= 2064;
if (v4 == 2)
v9 |= 0x4000;
v19 = find_shell_builtin(v16->field_8->field_0);
}
if ((v9 & 0x800)) {
v3 = executing_command_builtin;
unwind_protect_mem(&executing_command_builtin, 0x4);
executing_command_builtin = executing_command_builtin | 1;
}
v19 = 0;
}
add_unwind_protect(got.dispose_words, v16);
if (terminating_signal)
termsig_handler(terminating_signal);
if (interrupt_state)
throw_to_top_level();
for (v17 = v16; v17->field_0; v17 = v17->field_0);
v23 = v17->field_8->field_0;
if (*(v16->field_8->field_0) == 37 && !v7) {
if (a3)
v31 = "bg";
else
v31 = "fg";
this_shell_function = v31;
last_shell_builtin = this_shell_builtin;
this_shell_builtin = builtin_address(0xbaec7d8920ec8348);
v5 = *(5244552)(v16);
goto LABEL_4089e0;
}
if (job_control && !v7 && !a3 && !v11 && !v16->field_0 && *(v16->field_8->field_0) && !a0->field_10 && v2 == -1 && v1 == -1) {
v25 = get_string_value("auto_resume");
if (v25) {
v10 = 24;
if (*(v25) == 101 && !strcmp(v25, "exact")) {
v10 |= 4;
goto LABEL_408497;
}
if (*(v25) == 115 && !strcmp(v25, "substring")) {
v10 |= 2;
goto LABEL_408497;
}
v10 |= 1;
LABEL_408497:
v14 = get_job_by_name(v16->field_8->field_0, v10, v10);
if (v14 != -1) {
run_unwind_frame("simple-command");
this_shell_function = "fg";
last_shell_builtin = this_shell_builtin;
this_shell_builtin = builtin_address("fg");
v15 = start_job(v14, 0x1);
if (v15 < 0) {
v30 = 1;
goto LABEL_408a53;
} else {
v30 = v15;
goto LABEL_408a53;
}
}
}
}
while (true) {
this_shell_function = v16->field_8->field_0;
if (terminating_signal)
termsig_handler(terminating_signal);
if (interrupt_state)
throw_to_top_level();
if (!v20 && !v19)
v19 = find_shell_builtin(0xbaec7d8920ec8348);
last_shell_builtin = this_shell_builtin;
this_shell_builtin = v19;
if (v19) {
LABEL_4085a2:
if (v19) {
v4 = executing_builtin;
unwind_protect_mem(&executing_builtin, 0x4);
if (v3 == -1) {
v3 = executing_command_builtin;
unwind_protect_mem(&executing_command_builtin, 0x4);
}
}
if (v7) {
reset_signal_handlers(a0, a1, a2, a3, a4, a5);
*(&line_number_for_err_trap) = 15042888 CONCAT 85 | 128;
v32 = 2372415452829272149;
*(&v32) = 72;
tmp_23 = v32;
line_number_for_err_trap = tmp_23;
if (a3) {
if ((v9 & 0x400) && v2 == -1 && !stdin_redirects(a0->field_10))
async_redirect_stdin(a0, a1, a2);
setup_async_signals();
}
if (!a3)
subshell_level = subshell_level + 1;
execute_subshell_builtin_or_function(v16, a0->field_10, v19, v20, v2, v1, a3, a4);
}
v5 = execute_builtin_or_function(v16, v19, v20, a0->field_10, a4, v9);
if (!v19) {
if (v5 == 258) {
v5 = 2;
} else if (v5 > 0x100) {
v5 = builtin_status(v5);
}
LABEL_408840:
set_pipestatus_from_exit(v5);
break;
}
if (v5 <= 0x100) {
LABEL_4087e3:
if (posixly_correct && v6 && temporary_env) {
merge_temporary_env();
goto LABEL_408840;
}
}
if (v5 > 261) {
if (v5 == 262)
goto LABEL_408781;
} else {
if (v5 >= 259 && posixly_correct && v6 && !interactive_shell) {
line_number_for_err_trap = 1;
jump_to_top_level(0x4);
LABEL_408781:
executing_builtin = v4;
executing_command_builtin = v3;
v19 = 0;
v1 = -1;
v2 = v1;
goto LABEL_408905;
}
}
v5 = builtin_status(v5);
if (v6) {
special_builtin_failed = 1;
goto LABEL_4087e3;
}
} else {
if (!(!v20))
goto LABEL_4085a2;
if (!autocd) {
LABEL_408905:
if (!v18) {
if (false)
v33 = &g_40b366;
else
v33 = 13469278613474673480;
if (false)
v34 = &g_40b366;
else
v34 = 13469278613474673480;
v18 = strcpy(sh_xmalloc(strlen(v34) + 1, "execute_cmd.c", 0x12c2), v33);
}
if (!v7 && (v9 & 64) && fifos_pending() > 0)
v9 &= -65;
v0 = v9;
v5 = execute_disk_command(v16, a0->field_10, v18, v2, v1, a3, a4);
break;
} else {
if (!interactive)
goto LABEL_408905;
if (!v16->field_8)
goto LABEL_408905;
if (!is_dirname(v16->field_8->field_0))
goto LABEL_408905;
v16 = make_word_list(make_word("--"), v16);
v16 = make_word_list(make_word("cd"), v16);
xtrace_print_word_list(v16, 0x0);
v20 = find_function("cd");
}
}
}
LABEL_4089e0:
bind_lastarg(v23);
if (v18)
sh_xfree(v18, "execute_cmd.c", 0x12d1);
dispose_words(v16);
if (v19) {
executing_builtin = v4;
executing_command_builtin = v3;
}
discard_unwind_frame("simple-command");
this_shell_function = 0;
v30 = v5;
} else {
this_shell_function = 0;
if (v7)
v29 = 0;
else
v29 = a3;
v5 = execute_null_command(a0->field_10, v2, v1, v29);
if (v7)
sh_exit(v5);
bind_lastarg(0);
set_pipestatus_from_exit(v5);
v30 = v5;
}
LABEL_408a53:
return v30;
}
|
static char *
array_var_assignment (v, itype, quoted, atype)
SHELL_VAR *v;
int itype, quoted, atype;
{
char *ret, *val, flags[16];
int i;
if (v == 0)
return (char *)
((void *)0)
;
if (atype == 2)
val = ((((v)->attributes) & (0x0000004))) ? array_to_kvpair ((ARRAY *)((v)->value), 0)
: assoc_to_kvpair ((HASH_TABLE *)((v)->value), 0);
else
val = ((((v)->attributes) & (0x0000004))) ? array_to_assign ((ARRAY *)((v)->value), 0)
: assoc_to_assign ((HASH_TABLE *)((v)->value), 0);
if (val == 0 && (((((v)->attributes) & (0x0001000))) || ((v)->value != 0) == 0))
;
else if (val == 0)
{
val = (char *)sh_xmalloc((3), "subst.c", 8396);
val[0] = '(';
val[1] = ')';
val[2] = 0;
}
else
{
ret = (quoted & (0x001|0x002)) ? quote_string (val) : quote_escapes (val);
sh_xfree((val), "subst.c", 8404);
val = ret;
}
if (atype == 2)
return val;
i = var_attribute_string (v, 0, flags);
ret = (char *)sh_xmalloc((i + (((val) && (val)[0]) ? ((val)[1] ? ((val)[2] ? strlen(val) : 2) : 1) : 0) + strlen (v->name) + 16), "subst.c", 8412);
if (val)
sprintf (ret, "declare -%s %s=%s", flags, v->name, val);
else
sprintf (ret, "declare -%s %s", flags, v->name);
sh_xfree((val), "subst.c", 8417);
return ret;
}
|
void array_var_assignment(struct_0 *a0, unsigned long a1, unsigned long a2, unsigned long a3) {
unsigned int v0;
unsigned int v1;
char v2[3];
char v3[3];
char v4;
void* v6;
char v7[3];
char v8[3];
char v10[3];
char v11[3];
unsigned long long v12;
char *v13;
unsigned long long v14;
v0 = a1;
if (!a0) {
v6 = 0;
return;
}
if (a3 != 2) {
if (!(a0->field_28 & 4))
*(&v8) = assoc_to_assign(a0->field_8, 0x0);
else
*(&v8) = array_to_assign(a0->field_8, 0x0);
*(&v2) = v8;
} else {
if (!(a0->field_28 & 4))
*(&v7) = assoc_to_kvpair(a0->field_8, 0x0);
else
*(&v7) = array_to_kvpair(a0->field_8, 0x0);
*(&v2) = v7;
}
if (v2 || !(a0->field_28 & 0x1000) && a0->field_8) {
if (v2) {
if (!(a2 & 3))
*(&v10) = quote_escapes(v2);
else
*(&v10) = quote_string(v2);
*(&v3) = v10;
sh_xfree(v2, "subst.c", 0x20d4);
*(&v2) = v3;
} else {
*(&v2) = sh_xmalloc(0x3, "subst.c", 0x20cc);
v2[0] = 40;
v2[1] = 41;
v2[2] = 0;
}
}
if (a3 == 2) {
v11 = v2;
return;
}
v1 = var_attribute_string(a0, 0x0, &v4);
if (!v2 || !v2[0]) {
v12 = 0;
} else if (!v2[1]) {
v12 = 1;
} else if (!v2[2]) {
v12 = 2;
} else {
v12 = strlen(v2);
}
v13 = sh_xmalloc(strlen(a0->field_0) + v1 + v12 + 16, "subst.c", 0x20dc);
v3 = v13;
if (!v2)
sprintf(v3, "declare -%s %s", &v4, a0->field_0);
else
sprintf(v3, "declare -%s %s=%s", &v4, a0->field_0, v2);
sh_xfree(v2, "subst.c", 0x20e1);
v14 = v3;
return;
}
|
static void
run_invoke_hooks(const char *action, struct invoke_list *hook_list)
{
struct invoke_hook *hook;
setenv("DPKG_HOOK_ACTION", action, 1);
for (hook = hook_list->head; hook; hook = hook->next) {
int status;
status = system(hook->command);
if (status != 0)
ohshit(gettext("error executing hook '%s', exit code %d"), hook->command,
status);
}
unsetenv("DPKG_HOOK_ACTION");
}
|
void run_invoke_hooks(char *a0, unsigned long long *a1) {
unsigned int v0;
unsigned long long v1[2];
unsigned long long v3;
unsigned long long v4;
setenv("DPKG_HOOK_ACTION", a0, 0x1);
for (v1[0] = *(a1); v1; v1[0] = v1[0]) {
v0 = system(v1[1]);
if (v0) {
v3 = gettext("error executing hook '%s', exit code %d");
ohshit(v3, v1[1], v0, v3);
}
}
v4 = unsetenv("DPKG_HOOK_ACTION");
return;
}
|
static void
read_environment_file(char ***env, u_int *envsize,
const char *filename, const char *allowlist)
{
FILE *f;
char *line =
((void *)0)
, *cp, *value;
size_t linesize = 0;
u_int lineno = 0;
f = fopen(filename, "r");
if (!f)
return;
while (getline(&line, &linesize, f) != -1) {
if (++lineno > 1000)
sshfatal("session.c", __func__, 859, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Too many lines in environment file %s", filename);
for (cp = line; *cp == ' ' || *cp == '\t'; cp++)
;
if (!*cp || *cp == '#' || *cp == '\n')
continue;
cp[strcspn(cp, "\n")] = '\0';
value = strchr(cp, '=');
if (value ==
((void *)0)
) {
fprintf(
stderr
, "Bad line %u in %.100s\n", lineno,
filename);
continue;
}
*value = '\0';
value++;
if (allowlist !=
((void *)0)
&&
match_pattern_list(cp, allowlist, 0) != 1)
continue;
child_set_env(env, envsize, cp, value);
}
free(line);
fclose(f);
}
|
void read_environment_file(unsigned long long a0, unsigned long long a1, char *a2, unsigned long long a3) {
unsigned int v0;
void* v1;
void* v2;
void* v3;
void* v4;
char *v5;
unsigned long long v6;
unsigned long v7;
unsigned long long *v9;
unsigned long long v10;
v1 = 0;
v2 = 0;
v0 = 0;
v4 = fopen(a2, "r");
if (v4) {
while (true) {
if (getline(&v1, &v2, v4) == -1) {
free(v1);
fclose(v4);
break;
} else {
v0 += 1;
if (v0 > 1000) {
v7 = a2;
v6 = "Too many lines in environment file %s";
sshfatal("session.c", "read_environment_file", 0x35b, 0x0, 0x1, 0x0);
}
v3 = v1;
while (true) {
if (*(v3) != 32 && *(v3) != 9)
break;
v3 += 1;
}
if (!*(v3))
continue;
if (*(v3) == 35)
continue;
if (*(v3) == 10)
continue;
*(strcspn(v3, "\n") + v3) = 0;
v5 = strchr(v3, 0x3d);
if (!v5) {
fprintf(stderr, "Bad line %u in %.100s\n", v0, a2);
} else {
*(v5) = 0;
v5 += 1;
if (a3 && !(match_pattern_list(v3, a3, 0x0, a3) == 1))
continue;
child_set_env(a0, a1, v3, v5);
}
}
}
}
v10 = v6 ^ v9[5];
return;
}
|
static inline
_Bool
key_numeric (struct keyfield const *key)
{
return key->numeric || key->general_numeric || key->human_numeric;
}
|
int key_numeric(char a0[54]) {
unsigned int v1;
unsigned int v2;
if (a0[50]) {
LABEL_403ee7:
v1 = 1;
} else {
if (!(!a0[52]))
goto LABEL_403ee7;
if (!(!a0[53]))
goto LABEL_403ee7;
v1 = 0;
}
v2 = v1 & 1;
return v2;
}
|
static inline
_Bool
str_is_set(const char *str)
{
return str !=
((void *)0)
&& str[0] != '\0';
}
|
_BOOL8 str_is_set(_BYTE *a1)
{
return a1 && *a1;
}
|
ed_quoted_insert(EditLine *el, wint_t c __attribute__((__unused__)))
{
int num;
wchar_t ch;
tty_quotemode(el);
num = el_wgetc(el, &ch);
tty_noquotemode(el);
if (num == 1)
return ed_insert(el, ch);
else
return ed_end_of_file(el, 0);
}
|
long ed_quoted_insert(long a1)
{
int v2;
int v3;
unsigned long v4;
v4 = __readfsqword(0x28u);
tty_quotemode(a1);
v3 = el_wgetc(a1, &v2);
tty_noquotemode(a1);
if ( v3 == 1 )
return ed_insert(a1, v2);
else
return ed_end_of_file(a1);
}
|
map_init_vi(EditLine *el)
{
int i;
el_action_t *key = el->el_map.key;
el_action_t *alt = el->el_map.alt;
const el_action_t *vii = el->el_map.vii;
const el_action_t *vic = el->el_map.vic;
el->el_map.type = 1;
el->el_map.current = el->el_map.key;
keymacro_reset(el);
for (i = 0; i < 256; i++) {
key[i] = vii[i];
alt[i] = vic[i];
}
map_init_meta(el);
map_init_nls(el);
tty_bind_char(el, 1);
terminal_bind_arrow(el);
}
|
void map_init_vi(struct_0 *a0) {
unsigned int v0;
char *v1;
char *v2;
char *v3;
char *v4;
unsigned long long v6;
v1 = a0->field_3f8;
v2 = a0->field_3f0;
v3 = a0->field_418;
v4 = a0->field_410;
a0->field_420 = 1;
a0->field_400 = a0->field_3f8;
keymacro_reset(a0);
for (v0 = 0; v0 <= 255; v0 += 1) {
v1[v0] = v3[v0];
v2[v0] = v4[v0];
}
map_init_meta(a0);
map_init_nls(a0);
tty_bind_char(a0, 0x1);
v6 = terminal_bind_arrow(a0);
return;
}
|
off64_t gzoffset64(file)
gzFile file;
{
off64_t offset;
gz_statep state;
if (file ==
((void *)0)
)
return -1;
state = (gz_statep)file;
if (state->mode != 7247 && state->mode != 31153)
return -1;
offset = lseek64(state->fd, 0,
1
);
if (offset == -1)
return -1;
if (state->mode == 7247)
offset -= state->strm.avail_in;
return offset;
}
|
int gzoffset64(unsigned int a0[35]) {
unsigned long v0;
unsigned int v2;
if (!a0) {
v2 = -1;
} else {
if (a0[6] != 7247 && a0[6] != 31153)
v2 = -1;
if (a0[6] == 7247 || a0[6] == 31153) {
v0 = lseek64(a0[7], 0x0, 0x1);
if (v0 == -1) {
v2 = -1;
} else {
if (a0[6] == 7247)
v0 -= a0[34];
v2 = v0;
}
}
}
return v2;
}
|
static char const *
parse_field_count (char const *string, size_t *val, char const *msgid)
{
char *suffix;
uintmax_t n;
switch (xstrtoumax (string, &suffix, 10, &n, ""))
{
case LONGINT_OK:
case LONGINT_INVALID_SUFFIX_CHAR:
*val = n;
if (*val == n)
break;
__attribute__ ((__fallthrough__));
case LONGINT_OVERFLOW:
case LONGINT_OVERFLOW | LONGINT_INVALID_SUFFIX_CHAR:
*val =
(18446744073709551615UL)
;
break;
case LONGINT_INVALID:
if (msgid)
((!!sizeof (struct { _Static_assert (SORT_FAILURE, "verify_expr (" "SORT_FAILURE" ", " "(error (SORT_FAILURE, 0, gettext (\"%s: invalid count at start of %s\"), gettext (msgid), quote (string)), assume (false))" ")"); int _gl_dummy; })) ? ((error (SORT_FAILURE, 0, gettext ("%s: invalid count at start of %s"), gettext (msgid), quote (string)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (SORT_FAILURE, 0, gettext ("%s: invalid count at start of %s"), gettext (msgid), quote (string)), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
return
((void *)0)
;
}
return suffix;
}
|
int parse_field_count(unsigned long long a0, unsigned long long *a1, char *a2) {
char v0;
char v1;
unsigned int v3;
unsigned long long v4;
unsigned long long v5;
v3 = xstrtoumax(a0, &v0, 0xa, &v1, &g_40bb5b);
switch (v3) {
case 0: case 2:
*(a1) = *(&v1);
if (*(a1) == *(&v1))
goto LABEL_40977e;
else
goto LABEL_40971b;
case 1: case 3:
LABEL_40971b:
*(a1) = -1;
break;
case 4:
if (!a2) {
v3 = 0;
goto LABEL_409782;
} else {
v4 = quote(a0);
v5 = gettext(a2);
error(0x2, 0x0, gettext("%s: invalid count at start of %s"));
}
default:
LABEL_40977e:
v3 = *(&v0);
LABEL_409782:
return v3;
}
}
|
DH *
dh_new_group(BIGNUM *gen, BIGNUM *modulus)
{
DH *dh;
if ((dh = DH_new()) ==
((void *)0)
)
return
((void *)0)
;
if (!DH_set0_pqg(dh, modulus,
((void *)0)
, gen)) {
DH_free(dh);
return
((void *)0)
;
}
return dh;
}
|
DH * dh_new_group(undefined8 param_1,undefined8 param_2)
{
int iVar1;
DH *dh;
dh = DH_new();
if (dh == (DH *)0x0) {
dh = (DH *)0x0;
}
else {
iVar1 = DH_set0_pqg(dh,param_2,0,param_1);
if (iVar1 == 0) {
DH_free(dh);
dh = (DH *)0x0;
}
}
return dh;
}
|
static
void crcError ( void )
{
fprintf (
stderr
,
"\n%s: Data integrity error when decompressing.\n",
progName );
showFileNames();
cadvise();
cleanUpAndFail( 2 );
}
|
void crcError(void)
{
fprintf(stderr,"\n%s: Data integrity error when decompressing.\n",progName);
showFileNames();
cadvise();
cleanUpAndFail(2);
}
|
int
main(int argc, const char *const *argv)
{
const char *badname;
enum trigdef_update_flags tduf;
enum trigdef_update_status tdus;
dpkg_locales_init("dpkg");
dpkg_program_init("dpkg-trigger");
dpkg_options_parse(&argv, cmdinfos, printforhelp);
admindir = dpkg_db_set_dir(admindir);
if (f_check) {
if (*argv)
badusage(gettext("--%s takes no arguments"),
"check-supported");
return do_check();
}
if (!*argv || argv[1])
badusage(gettext("takes one argument, the trigger name"));
badname = parse_awaiter_package();
if (badname)
badusage(gettext("illegal awaited package name '%.250s': %.250s"),
bypackage, badname);
activate = argv[0];
badname = trig_name_is_illegal(activate);
if (badname)
badusage(gettext("invalid trigger name '%.250s': %.250s"),
activate, badname);
trigdef_set_methods(&tdm_add);
tduf = TDUF_NO_LOCK_OK;
if (!f_noact)
tduf |= TDUF_WRITE | TDUF_WRITE_IF_EMPTY;
tdus = trigdef_update_start(tduf);
if (tdus >= 0) {
trigdef_parse();
if (!done_trig)
trigdef_update_printf("%s %s\n", activate, bypackage);
trigdef_process_done();
}
dpkg_program_done();
dpkg_locales_done();
return 0;
}
|
int main(int argc, const char **argv, const char **envp)
{
char **v3;
char *v4;
char *v6;
char *v7;
char *v8;
char *v9;
char *v10;
void *v11;
int v12;
unsigned int v13;
int updated;
long is_illegal;
v12 = argc;
v11 = argv;
dpkg_locales_init("dpkg", argv, envp);
dpkg_program_init("dpkg-trigger");
v3 = &cmdinfos;
dpkg_options_parse(&v11, &cmdinfos, "Type dpkg-trigger --help for help about this utility.");
admindir = dpkg_db_set_dir(admindir);
if ( f_check )
{
if ( *(_QWORD *)v11 )
{
v4 = gettext("--%s takes no arguments");
badusage(v4);
}
return do_check();
}
else
{
if ( !*(_QWORD *)v11 || *((_QWORD *)v11 + 1) )
{
v6 = gettext("takes one argument, the trigger name");
badusage(v6);
}
is_illegal = parse_awaiter_package();
if ( is_illegal )
{
v7 = bypackage;
v8 = gettext("illegal awaited package name '%.250s': %.250s");
v3 = (char **)v7;
badusage(v8);
}
activate = *(char **)v11;
is_illegal = trig_name_is_illegal(activate, v3);
if ( is_illegal )
{
v9 = activate;
v10 = gettext("invalid trigger name '%.250s': %.250s");
v3 = (char **)v9;
badusage(v10);
}
trigdef_set_methods(tdm_add, v3);
v13 = 1;
if ( !f_noact )
v13 |= 0xAu;
updated = trigdef_update_start(v13);
if ( updated >= 0 )
{
trigdef_parse();
if ( done_trig != 1 )
trigdef_update_printf("%s %s\n", activate, bypackage);
trigdef_process_done();
}
dpkg_program_done();
dpkg_locales_done();
return 0;
}
}
|
int
stravis(char **mbdstp, const char *mbsrc, int flags)
{
*mbdstp =
((void *)0)
;
return istrsenvisxl(mbdstp,
((void *)0)
, mbsrc, flags, "",
((void *)0)
);
}
|
long long stravis(unsigned long long *a0, char *a1, unsigned long a2) {
*(a0) = 0;
return istrsenvisxl(a0, NULL, a1, a2, &g_4018e8, 0x0);
}
|
static unsigned int
cols_ready_to_print (void)
{
COLUMN *q;
unsigned int i;
unsigned int n;
n = 0;
for (q = column_vector, i = 0; i < columns; ++q, ++i)
if (q->status == OPEN
|| q->status == FF_FOUND
|| (storing_columns && q->lines_stored > 0 && q->lines_to_print > 0))
++n;
return n;
}
|
int cols_ready_to_print() {
unsigned int v0;
unsigned int v1;
unsigned int v2[13];
v1 = 0;
*(&v2[0]) = column_vector;
v0 = 0;
while (true) {
if (v0 >= columns)
break;
if (v2[4] && v2[4] != 1) {
if (!storing_columns)
goto LABEL_400399;
if (v2[11] <= 0)
goto LABEL_400399;
if (v2[12] <= 0)
goto LABEL_400399;
}
v1 += 1;
LABEL_400399:
*(&v2[0]) = &v2[1 + 3];
v0 += 1;
}
return v1;
}
|
static intmax_t
expband ()
{
register intmax_t val1, val2;
val1 = exp5 ();
while (curtok == '&')
{
readtok ();
val2 = exp5 ();
val1 = val1 & val2;
lasttok = 6;
}
return (val1);
}
|
int expband(unsigned long long a0, unsigned long long a1, unsigned long a2, unsigned long long a3) {
unsigned long long v1;
unsigned long long v2;
unsigned long long v3;
for (v1 = exp5(a0, a1, a2, a3); curtok == 38; lasttok = 6) {
readtok(a0, a1, a2, a3, v2, v3);
v1 &= exp5(a0, a1, a2, a3);
}
return v1;
}
|
void
rl_cleanup_after_signal (void)
{
_rl_clean_up_for_exit ();
if (rl_deprep_term_function)
(*rl_deprep_term_function) ();
rl_clear_pending_input ();
rl_clear_signals ();
}
|
void rl_cleanup_after_signal(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3) {
unsigned long long v1;
_rl_clean_up_for_exit();
if (rl_deprep_term_function)
*(5243000)();
rl_clear_pending_input();
v1 = rl_clear_signals(a0, a1, a2, a3);
return;
}
|
static
_Bool
want_subgids(void)
{
if (get_subid_nss_handle() !=
((void *)0)
)
return
0
;
if (getdef_ulong ("SUB_GID_COUNT", 65536) == 0)
return
0
;
return
1
;
}
|
undefined8 want_subgids(void)
{
long lVar1;
undefined8 uVar2;
lVar1 = get_subid_nss_handle();
if (lVar1 == 0) {
lVar1 = getdef_ulong("SUB_GID_COUNT",0x10000);
if (lVar1 == 0) {
uVar2 = 0;
}
else {
uVar2 = 1;
}
}
else {
uVar2 = 0;
}
return uVar2;
}
|
static int modinfo_do(struct kmod_module *mod)
{
struct kmod_list *l, *list =
((void *)0)
;
struct param *params =
((void *)0)
;
int err, is_builtin;
const char *filename = kmod_module_get_path(mod);
is_builtin = (filename ==
((void *)0)
);
if (is_builtin) {
if (field ==
((void *)0)
)
printf("%-16s%s%c", "name:",
kmod_module_get_name(mod), separator);
else if (field !=
((void *)0)
&& (strcmp((field), ("name")) == 0))
printf("%s%c", kmod_module_get_name(mod), separator);
filename = "(builtin)";
}
if (field !=
((void *)0)
&& (strcmp((field), ("filename")) == 0)) {
printf("%s%c", filename, separator);
return 0;
} else if (field ==
((void *)0)
) {
printf("%-16s%s%c", "filename:",
filename, separator);
}
err = kmod_module_get_info(mod, &list);
if (err < 0) {
if (is_builtin && err == -
2
) {
return 0;
}
log_printf(
3
, "could not get modinfo from '%s': %s\n", kmod_module_get_name(mod), strerror(-err))
;
return err;
}
if (field !=
((void *)0)
&& (strcmp((field), ("parm")) == 0)) {
err = modinfo_params_do(list);
goto end;
}
for (l = list; l !=
((void *)0)
; l = kmod_list_next(list, l)) {
const char *key = kmod_module_info_get_key(l);
const char *value = kmod_module_info_get_value(l);
int keylen;
if (field !=
((void *)0)
) {
if (!(strcmp((field), (key)) == 0))
continue;
printf("%s%c", value, separator);
continue;
}
if ((strcmp((key), ("parm")) == 0) || (strcmp((key), ("parmtype")) == 0)) {
err = process_parm(key, value, ¶ms);
if (err < 0)
goto end;
continue;
}
if (separator == '\0') {
printf("%s=%s%c", key, value, separator);
continue;
}
keylen = strlen(key);
printf("%s:%-*s%s%c", key, 15 - keylen, "", value, separator);
}
if (field !=
((void *)0)
)
goto end;
while (params !=
((void *)0)
) {
struct param *p = params;
params = p->next;
if (p->param ==
((void *)0)
)
printf("%-16s%.*s:%.*s%c", "parm:",
p->namelen, p->name, p->typelen, p->type,
separator);
else if (p->type !=
((void *)0)
)
printf("%-16s%.*s:%.*s (%.*s)%c", "parm:",
p->namelen, p->name,
p->paramlen, p->param,
p->typelen, p->type,
separator);
else
printf("%-16s%.*s:%.*s%c",
"parm:",
p->namelen, p->name,
p->paramlen, p->param,
separator);
free(p);
}
end:
while (params !=
((void *)0)
) {
void *tmp = params;
params = params->next;
free(tmp);
}
kmod_module_info_free_list(list);
return err;
}
|
long modinfo_do(long a1)
{
unsigned int v1;
const char *v2;
unsigned int v3;
const char *name;
char *v6;
const char *v7;
int info;
_BOOL4 v9;
int v10;
long v11;
void **v12;
long i;
const char *path;
void *ptr;
char *s2;
const char *value;
void *v18;
unsigned long v19;
v19 = __readfsqword(0x28u);
v11 = 0LL;
v12 = 0LL;
path = (const char *)kmod_module_get_path(a1);
v9 = path == 0LL;
if ( !path )
{
if ( field )
{
if ( !strcmp(field, "name") )
{
v3 = separator;
name = (const char *)kmod_module_get_name(a1);
printf("%s%c", name, v3);
}
}
else
{
v1 = separator;
v2 = (const char *)kmod_module_get_name(a1);
printf("%-16s%s%c", "name:", v2, v1);
}
path = "(builtin)";
}
if ( field && !strcmp(field, "filename") )
{
printf("%s%c", path, (unsigned int)separator);
return 0LL;
}
else
{
if ( !field )
printf("%-16s%s%c", "filename:", path, (unsigned int)separator);
info = kmod_module_get_info(a1, &v11);
if ( info >= 0 )
{
if ( field && !strcmp(field, "parm") )
{
info = modinfo_params_do(v11);
}
else
{
for ( i = v11; i; i = kmod_list_next(v11, i) )
{
s2 = (char *)kmod_module_info_get_key(i);
value = (const char *)kmod_module_info_get_value(i);
if ( field )
{
if ( !strcmp(field, s2) )
printf("%s%c", value, (unsigned int)separator);
}
else if ( !strcmp(s2, "parm") || !strcmp(s2, "parmtype") )
{
info = process_parm(s2, value, (void **)&v12);
if ( info < 0 )
goto LABEL_45;
}
else if ( separator )
{
v10 = strlen(s2);
printf("%s:%-*s%s%c", s2, 15 - v10, (const char *)&unk_21D, value, (unsigned int)separator);
}
else
{
printf("%s=%s%c", s2, value, (unsigned int)separator);
}
}
if ( !field )
{
while ( v12 )
{
ptr = v12;
v12 = (void **)*v12;
if ( *((_QWORD *)ptr + 2) )
{
if ( *((_QWORD *)ptr + 3) )
printf(
"%-16s%.*s:%.*s (%.*s)%c",
"parm:",
*((_DWORD *)ptr + 8),
*((const char **)ptr + 1),
*((_DWORD *)ptr + 9),
*((const char **)ptr + 2),
*((_DWORD *)ptr + 10),
*((const char **)ptr + 3),
(unsigned int)separator);
else
printf(
"%-16s%.*s:%.*s%c",
"parm:",
*((_DWORD *)ptr + 8),
*((const char **)ptr + 1),
*((_DWORD *)ptr + 9),
*((const char **)ptr + 2),
(unsigned int)separator);
}
else
{
printf(
"%-16s%.*s:%.*s%c",
"parm:",
*((_DWORD *)ptr + 8),
*((const char **)ptr + 1),
*((_DWORD *)ptr + 10),
*((const char **)ptr + 3),
(unsigned int)separator);
}
free(ptr);
}
}
}
LABEL_45:
while ( v12 )
{
v18 = v12;
v12 = (void **)*v12;
free(v18);
}
kmod_module_info_free_list(v11);
return (unsigned int)info;
}
else if ( v9 && info == -2 )
{
return 0LL;
}
else
{
v6 = strerror(-info);
v7 = (const char *)kmod_module_get_name(a1);
log_printf(3LL, "could not get modinfo from '%s': %s\n", v7, v6);
return (unsigned int)info;
}
}
}
|
int
num_posix_options ()
{
return ((sizeof (posix_vars) / sizeof (posix_vars[0])) - 1);
}
|
int num_posix_options() {
return 5;
}
|
static int get_cmd(FILE *f)
{
char cmd[4] = " ";
int i;
if (fread(cmd, 1, sizeof(cmd) - 1, f) != sizeof(cmd) - 1)
return -1;
for(i = 0; cmds[i].cmd && strcmp(cmds[i].name, cmd) != 0; i++)
;
return cmds[i].cmd;
}
|
int get_cmd(void* a0) {
unsigned int v0;
unsigned int v1;
unsigned int v3;
v1 = 2105376;
if (fread(&v1, 0x1, 0x3, a0) != 3) {
v3 = -1;
} else {
v0 = 0;
while (true) {
if (!g_407004[2 * v0])
break;
if (!strcmp((0x407000 + 8 * v0), &v1))
break;
v0 += 1;
}
v3 = g_407004[2 * v0];
}
return v3;
}
|
size_t ext2fs_get_refcount_size(ext2_refcount_t refcount)
{
if (!refcount)
return 0;
return refcount->size;
}
|
long ext2fs_get_refcount_size(long a1)
{
if ( a1 )
return *(_QWORD *)(a1 + 8);
else
return 0LL;
}
|
void cu_preinstupgrade(int argc, void **argv) {
struct pkginfo *pkg= (struct pkginfo*)argv[0];
char *cidir= (char*)argv[1];
char *cidirrest= (char*)argv[2];
enum pkgstatus *oldstatusp= (enum pkgstatus*)argv[3];
if (cleanup_pkg_failed++) return;
maintscript_new(pkg, "postrm", "post-removal", cidir, cidirrest,
"abort-upgrade",
versiondescribe(&pkg->installed.version, vdew_nonambig),
versiondescribe(&pkg->available.version, vdew_nonambig),
((void *)0)
);
pkg_set_status(pkg, *oldstatusp);
pkg_clear_eflags(pkg, PKG_EFLAG_REINSTREQ);
modstatdb_note(pkg);
cleanup_pkg_failed--;
}
|
long long cu_preinstupgrade(unsigned long a0, unsigned long long a1[4]) {
unsigned long v0;
unsigned long v1;
void* v2;
unsigned int v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned int *v7;
unsigned long long v9;
v3 = a0;
v4 = a1[0];
v5 = a1[1];
v6 = a1[2];
v7 = a1[3];
v9 = cleanup_pkg_failed;
cleanup_pkg_failed = cleanup_pkg_failed + 1;
if (!v9) {
v2 = 0;
v1 = versiondescribe(v4 + 272, 0x1);
v0 = versiondescribe(v4 + 152, 0x1);
maintscript_new(v4, "postrm", "post-removal", v5, v6, "abort-upgrade");
pkg_set_status(v4, *(v7));
pkg_clear_eflags(v4, 0x1);
modstatdb_note(v4);
v9 = cleanup_pkg_failed - 1;
cleanup_pkg_failed = cleanup_pkg_failed - 1;
}
return v9;
}
|
static int
evalfor(union node *n, int flags)
{
struct arglist arglist;
union node *argp;
struct strlist *sp;
int status;
errlinno = lineno = n->nfor.linno;
if (funcline)
lineno -= funcline - 1;
arglist.lastp = &arglist.list;
for (argp = n->nfor.args ; argp ; argp = argp->narg.next) {
expandarg(argp, &arglist, 0x1 | 0x2);
}
*arglist.lastp =
((void *)0)
;
status = 0;
loopnest++;
flags &= 02;
for (sp = arglist.list ; sp ; sp = sp->next) {
setvar(n->nfor.var, sp->text, 0);
status = evaltree(n->nfor.body, flags);
if (skiploop() & ~(1 << 1))
break;
}
loopnest--;
return status;
}
|
long long evalfor(struct_0 *a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
struct_1 *v2;
unsigned long long v3;
char v4;
unsigned long long *v5;
v0 = a1;
lineno = a0->field_4;
errlinno = lineno;
if (funcline)
lineno = lineno - (funcline - 1);
v5 = &v4;
for (v2 = a0->field_8; v2; v2 = v2->field_8) {
expandarg(v2, &v4, 0x3, &v4);
}
*(v5) = 0;
v1 = 0;
inps4 = 283935561;
v0 &= 2;
v3 = *(&v4);
while (true) {
if (!v3)
break;
setvar(a0->field_18, *((v3 + 8)), 0x0, *((v3 + 8)));
v1 = evaltree(a0->field_10, v0);
if ((skiploop() & -3))
break;
v3 = *(v3);
}
inps4 = 283935559;
return v1;
}
|
static int insert_revoke_hash(journal_t *journal, unsigned long long blocknr,
tid_t seq)
{
struct list_head *hash_list;
struct jbd2_revoke_record_s *record;
gfp_t gfp_mask = 0;
if (0)
gfp_mask |= 0;
record = malloc((jbd2_revoke_record_cache)->object_length);
if (!record)
return -
12
;
record->sequence = seq;
record->blocknr = blocknr;
hash_list = &journal->j_revoke->hash_table[hash(journal, blocknr)];
;
list_add(&record->hash, hash_list);
;
return 0;
}
|
undefined8 insert_revoke_hash(long param_1,undefined8 param_2,undefined4 param_3)
{
long lVar1;
int iVar2;
void *pvVar3;
undefined8 uVar4;
pvVar3 = malloc((long)*jbd2_revoke_record_cache);
if (pvVar3 == (void *)0x0) {
uVar4 = 0xfffffff4;
}
else {
*(undefined4 *)((long)pvVar3 + 0x10) = param_3;
*(undefined8 *)((long)pvVar3 + 0x18) = param_2;
lVar1 = *(long *)(*(long *)(param_1 + 0xa8) + 8);
iVar2 = hash(param_1,param_2);
list_add(pvVar3,(long)iVar2 * 0x10 + lVar1);
uVar4 = 0;
}
return uVar4;
}
|
static int
channel_request_rforward_cancel_tcpip(struct ssh *ssh,
const char *host, u_short port)
{
struct ssh_channels *sc = ssh->chanctxt;
struct permission_set *pset = &sc->local_perms;
int r;
u_int i;
struct permission *perm =
((void *)0)
;
for (i = 0; i < pset->num_permitted_user; i++) {
perm = &pset->permitted_user[i];
if (open_listen_match_tcpip(perm, host, port, 0))
break;
perm =
((void *)0)
;
}
if (perm ==
((void *)0)
) {
sshlog("channels.c", __func__, 4214, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "requested forward not found");
return -1;
}
if ((r = sshpkt_start(ssh, 80)) != 0 ||
(r = sshpkt_put_cstring(ssh, "cancel-tcpip-forward")) != 0 ||
(r = sshpkt_put_u8(ssh, 0)) != 0 ||
(r = sshpkt_put_cstring(ssh, channel_rfwd_bind_host(host))) != 0 ||
(r = sshpkt_put_u32(ssh, port)) != 0 ||
(r = sshpkt_send(ssh)) != 0)
sshfatal("channels.c", __func__, 4223, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "send cancel");
fwd_perm_clear(perm);
return 0;
}
|
void channel_request_rforward_cancel_tcpip(struct_0 *a0, char *a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
void* v2;
unsigned long v3;
struct_1 *v4;
unsigned long long v7;
void* v8;
v3 = a0->field_868;
v4 = v3 + 32;
v2 = 0;
for (v1 = 0; v1 < v4->field_0; v1 += 1) {
v2 = v1 * 48 + v4->field_8;
if (open_listen_match_tcpip(v2, a1, a2, 0x0))
break;
v2 = 0;
}
if (!v2) {
sshlog("channels.c", "channel_request_rforward_cancel_tcpip", 0x1076, 0x1, 0x5, 0x0, "requested forward not found");
v7 = 4294967295;
} else {
v0 = sshpkt_start(a0, 0x50);
if (!v0) {
v0 = sshpkt_put_cstring(a0, "cancel-tcpip-forward");
if (!v0) {
v0 = sshpkt_put_u8(a0, 0x0);
if (!v0) {
v0 = sshpkt_put_cstring(a0, channel_rfwd_bind_host(a1));
if (!v0) {
v0 = sshpkt_put_u32(a0, a2, a2);
if (!v0)
v0 = sshpkt_send(a0);
}
}
}
}
if (v0 || v0 || v0 || v0 || v0 || v0)
sshfatal("channels.c", "channel_request_rforward_cancel_tcpip", 0x107f, 0x1, 0x1, ssh_err(v0));
fwd_perm_clear(v2);
v8 = 0;
}
return;
}
|
static void ipaddr_filter(struct nlmsg_chain *linfo, struct nlmsg_chain *ainfo)
{
struct nlmsg_list *l, **lp;
lp = &linfo->head;
while ((l = *lp) !=
((void *)0)
) {
int ok = 0;
int missing_net_address = 1;
struct ifinfomsg *ifi = ((void *)(((char *)&l->h) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
struct nlmsg_list *a;
for (a = ainfo->head; a; a = a->next) {
struct nlmsghdr *n = &a->h;
struct ifaddrmsg *ifa = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
struct rtattr *tb[(__IFA_MAX - 1) + 1];
unsigned int ifa_flags;
if (ifa->ifa_index != ifi->ifi_index)
continue;
missing_net_address = 0;
if (filter.family && filter.family != ifa->ifa_family)
continue;
if ((filter.scope^ifa->ifa_scope)&filter.scopemask)
continue;
parse_rtattr(tb, (__IFA_MAX - 1), ((struct rtattr*)(((char*)(ifa)) + ( ((sizeof(struct ifaddrmsg))+4U -1) & ~(4U -1) ))), ((n)->nlmsg_len - ( (((((sizeof(struct ifaddrmsg))) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))))+4U -1) & ~(4U -1) )));
ifa_flags = get_ifa_flags(ifa, tb[IFA_FLAGS]);
if ((filter.flags ^ ifa_flags) & filter.flagmask)
continue;
if (ifa_label_match_rta(ifa->ifa_index, tb[IFA_LABEL]))
continue;
if (!tb[IFA_LOCAL])
tb[IFA_LOCAL] = tb[IFA_ADDRESS];
if (inet_addr_match_rta(&filter.pfx, tb[IFA_LOCAL]))
continue;
ok = 1;
break;
}
if (missing_net_address &&
(filter.family ==
0
|| filter.family ==
17
))
ok = 1;
if (!ok) {
*lp = l->next;
free(l);
} else
lp = &l->next;
}
}
|
void ipaddr_filter(unsigned long a0, unsigned long long *a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned long long *v3;
unsigned long long *v4;
unsigned long long *v5;
struct_1 *v6;
unsigned int *v7;
struct_0 *v8;
char v9;
char v10;
unsigned long long v11;
char v12;
char v13;
char v14;
unsigned long long *v16;
unsigned long long v17;
v3 = a0;
while (true) {
v5 = *(v3);
if (!v5)
break;
v0 = 0;
v1 = 1;
v6 = &v5[3];
v4 = *(a1);
while (true) {
if (!v4)
break;
v7 = &v4[1];
v8 = &v7[4];
if (v8->field_4 == v6->field_4 && (!g_408504 || g_408504 == v8->field_0) && !(g_40861c & (g_408618 ^ v8->field_3))) {
parse_rtattr(&v9, 0xb, v8 + 1, *(v7) - 24);
v2 = get_ifa_flags(v8, *(&v13));
if (!((g_408620 ^ v2) & g_408624) && !ifa_label_match_rta(v8->field_4, *(&v12))) {
if (!v11)
v11 = *(&v10);
if (!inet_addr_match_rta(&g_408510, v11)) {
v0 = 1;
break;
}
}
}
v4 = *(v4);
}
if (v1) {
switch (g_408504) {
case 0: case 17:
v0 = 1;
break;
default:
goto LABEL_405ee3;
}
}
LABEL_405ee3:
if (!v0) {
*(v3) = *(v5);
free(v5);
} else {
v3 = v5;
}
}
v17 = *(&v14) ^ v16[5];
return;
}
|
int
process_options (int argc, char **argv)
{
struct systemkey_tool_options *opts = &systemkey_tool_options;
int opt;
while ((opt = getopt_long (argc, argv, "!d:hv:",
long_options,
((void *)0)
)) !=
(-1)
)
switch (opt)
{
case '\0':
break;
case 'd':
opts->present.debug =
1
;
opts->arg.debug = optarg;
opts->value.debug = parse_number(optarg);
opts->enabled.debug =
1
;
break;
case 0x7f + 1:
opts->present.outfile =
1
;
opts->arg.outfile = optarg;
opts->enabled.outfile =
1
;
break;
case 0x7f + 2:
opts->present.list =
1
;
opts->enabled.list =
1
;
break;
case 0x7f + 3:
opts->present.delete =
1
;
opts->arg.delete = optarg;
opts->enabled.delete =
1
;
break;
case 0x7f + 4:
opts->present.outder =
1
;
opts->enabled.outder =
1
;
break;
case 0x7f + 5:
opts->present.outder =
1
;
opts->enabled.outder =
0
;
break;
case 'v':
opts->present.version =
1
;
opts->arg.version = optarg;
opts->enabled.version =
1
;
break;
case 'h':
opts->present.help =
1
;
opts->enabled.help =
1
;
break;
case '!':
opts->present.more_help =
1
;
opts->enabled.more_help =
1
;
break;
default:
usage (
stderr
,
1
);
break;
}
if (systemkey_tool_options.present.debug && systemkey_tool_options.value.debug < 0)
{
error (
1
, 0, "%s option value %d is out of range.",
"debug", opts->value.debug);
}
if (systemkey_tool_options.present.debug && systemkey_tool_options.value.debug > 9999)
{
error (
1
, 0, "%s option value %d is out of range",
"debug", opts->value.debug);
}
if (optind < argc)
{
error (
1
, 0, "Command line arguments are not allowed.");
}
if (systemkey_tool_options.present.help)
{
usage (
stdout
, (0));
}
if (systemkey_tool_options.present.more_help)
{
pid_t pid;
int pfds[2];
if (pipe (pfds) < 0)
error (
1
,
(*__errno_location ())
, "pipe");
pid = fork ();
if (pid < 0)
error (
1
,
(*__errno_location ())
, "fork");
if (pid == 0)
{
close (pfds[0]);
dup2 (pfds[1],
1
);
close (pfds[1]);
usage (
stdout
, 0);
}
else
{
const char *args[2];
const char *envvar;
close (pfds[1]);
dup2 (pfds[0],
0
);
close (pfds[0]);
envvar = secure_getenv ("PAGER");
if (!envvar || *envvar == '\0')
args[0] = "more";
else
args[0] = envvar;
args[1] =
((void *)0)
;
execvp (args[0], (char * const *)args);
exit (
1
);
}
}
if (systemkey_tool_options.present.version)
{
if (!systemkey_tool_options.arg.version || !strcmp (systemkey_tool_options.arg.version, "c"))
{
const char str[] =
"systemkey-tool 3.7.8\n"
"Copyright (C) 2000-2021 Free Software Foundation, and others\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the GNU General Public License,\n"
"version 3 or later <http:
"\n"
"Please send bug reports to: <bugs@gnutls.org> \n";
fprintf (
stdout
, "%s", str);
exit(0);
}
else if (!strcmp (systemkey_tool_options.arg.version, "v"))
{
const char str[] =
"systemkey-tool 3.7.8\n";
fprintf (
stdout
, "%s", str);
exit(0);
}
else if (!strcmp (systemkey_tool_options.arg.version, "n"))
{
const char str[] =
"systemkey-tool 3.7.8\n"
"Copyright (C) 2000-2021 Free Software Foundation, and others\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the GNU General Public License,\n"
"version 3 or later <http:
"\n"
"gnutls is free software: you can redistribute it and/or\n"
"modify it under the terms of the GNU General Public License\n"
"as published by the Free Software Foundation,\n"
"either version 3 of the License, or (at your option) any later version.\n"
"\n"
"gnutls is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty\n"
"of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
"See the GNU General Public License for more details.\n"
"\n"
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see <http:
"\n"
"Please send bug reports to: <bugs@gnutls.org> \n";
fprintf (
stdout
, "%s", str);
exit(0);
}
else
{
error (
1
, 0,
"version option argument 'a' invalid. Use:\n"
" 'v' - version only\n"
" 'c' - version and copyright\n"
" 'n' - version and full copyright notice");
}
}
return optind;
}
|
long long process_options(unsigned long a0, char **a1) {
char **v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
struct_1 *v4;
unsigned long long v5;
char v6;
char v7;
unsigned long long v8;
void* v9;
unsigned long v10;
unsigned long long v11;
unsigned int v12;
unsigned short v13;
unsigned long long v15;
unsigned long v16;
unsigned long long v17;
struct_0 *v18;
unsigned long long v19;
struct_0 *v20;
unsigned long long v21;
unsigned long v22;
v1 = a0;
v0 = a1;
v4 = got.systemkey_tool_options;
while (true) {
v2 = getopt_long(v1, v0, "!d:hv:", &long_options, NULL);
if (v2 == -1)
break;
if (!(v2 <= 132))
goto LABEL_400362;
if (v2 >= 100) {
switch (v2) {
case 100:
v4->field_0 = 1;
v4->field_8 = *(*(&got.optarg));
v4->field_28 = parse_number(*(*(&got.optarg)));
v4->field_2c = 1;
break;
case 104:
v4->field_6 = 1;
v4->field_32 = 1;
break;
case 118:
v4->field_5 = 1;
v4->field_20 = *(*(&got.optarg));
v4->field_31 = 1;
break;
case 128:
v4->field_1 = 1;
v4->field_10 = *(*(&got.optarg));
v4->field_2d = 1;
break;
case 129:
v4->field_2 = 1;
v4->field_2e = 1;
break;
case 130:
v4->field_3 = 1;
v4->field_18 = *(*(&got.optarg));
v4->field_2f = 1;
break;
case 131:
v4->field_4 = 1;
v4->field_30 = 1;
break;
case 132:
v4->field_4 = 1;
v4->field_30 = 0;
break;
default:
LABEL_400362:
usage(*(got.stderr), 0x1);
}
} else if (v2) {
if (!(v2 == 33))
goto LABEL_400362;
v4->field_7 = 1;
v4->field_33 = 1;
}
}
if (*(got.systemkey_tool_options) && *((got.systemkey_tool_options + 40)) < 0)
error(0x1, 0x0, "%s option value %d is out of range.");
if (*(got.systemkey_tool_options) && *((got.systemkey_tool_options + 40)) > 9999)
error(0x1, 0x0, "%s option value %d is out of range");
if (v1 > *(got.optind))
error(0x1, 0x0, "Command line arguments are not allowed.");
if (*((got.systemkey_tool_options + 6)))
usage(*(*(&got.stdout)), 0x0);
if (*((got.systemkey_tool_options + 7))) {
if (pipe(&v6) < 0)
error(0x1, *(__errno_location()), "pipe");
v3 = fork();
if (v3 < 0)
error(0x1, *(__errno_location()), "fork");
if (!v3) {
close(*(&v6));
dup2(*(&v7), 0x1);
close(*(&v7));
usage(*(*(&got.stdout)), 0x0);
}
close(*(&v7));
dup2(*(&v6), 0x0);
close(*(&v6));
v5 = secure_getenv("PAGER");
if (v5 && *(v5)) {
v8 = v5;
LABEL_4005de:
v9 = 0;
execvp(v8, &v8);
exit(0x1);
}
v8 = "more";
goto LABEL_4005de;
}
if (!*((got.systemkey_tool_options + 5)))
return *(got.optind);
if (!*((got.systemkey_tool_options + 32))) {
LABEL_40064d:
v15 = 40;
v18 = &v10;
for (v17 = "systemkey-tool 3.7.8\nCopyright (C) 2000-2021 Free Software Foundation, and others\nThis is free software. It is licensed for use, modification and\nredistribution under the terms of the GNU General Public License,\nversion 3 or later <http:
v15 -= 1;
v10 = *(v17);
v18 = v18 + 8 * v16;
}
*(&v18->field_0) = *(v17);
v18->field_4 = *((v17 + 4));
v18->field_6 = *((v17 + 6));
fprintf(*(*(&got.stdout)), "%s", &v10);
exit(0x0);
} else {
if (!strcmp(*((got.systemkey_tool_options + 32)), "c"))
goto LABEL_40064d;
if (!strcmp(*((got.systemkey_tool_options + 32)), "v")) {
v10 = 7308055102851610995;
v11 = 3684063721056120185;
v12 = 942552878;
v13 = 10;
fprintf(*(*(&got.stdout)), "%s", &v10);
exit(0x0);
} else if (strcmp(*((got.systemkey_tool_options + 32)), "n")) {
error(0x1, 0x0, "version option argument 'a' invalid. Use:\n\t'v' - version only\n\t'c' - version and copyright\n\t'n' - version and full copyright notice");
} else {
v19 = 115;
v20 = &v10;
for (v21 = "systemkey-tool 3.7.8\nCopyright (C) 2000-2021 Free Software Foundation, and others\nThis is free software. It is licensed for use, modification and\nredistribution under the terms of the GNU General Public License,\nversion 3 or later <http:
v19 -= 1;
v10 = *(v21);
v20 = v20 + 8 * v22;
}
}
}
*(&v20->field_0) = *(v21);
v20->field_4 = *((v21 + 4));
v20->field_6 = *((v21 + 6));
fprintf(*(*(&got.stdout)), "%s", &v10);
exit(0x0);
}
|
static
_Bool
recurse_tree (struct item *root,
_Bool
(*action) (struct item *))
{
if (root->left ==
((void *)0)
&& root->right ==
((void *)0)
)
return (*action) (root);
else
{
if (root->left !=
((void *)0)
)
if (recurse_tree (root->left, action))
return
1
;
if ((*action) (root))
return
1
;
if (root->right !=
((void *)0)
)
if (recurse_tree (root->right, action))
return
1
;
}
return
0
;
}
|
int recurse_tree(unsigned long long a0[3], unsigned long long a1) {
unsigned long v0;
unsigned int v2;
v0 = a1;
if (!a0[1] && !a0[2])
v2 = (stack_base)[24](a0);
if (a0[1] || a0[2]) {
if (a0[1]) {
v2 = recurse_tree(a0[1], a1);
if (v2)
v2 = 1;
}
if (!a0[1] || !v2) {
v2 = (stack_base)[24](a0);
if (v2) {
v2 = 1;
} else {
if (a0[2]) {
v2 = recurse_tree(a0[2], a1);
if (v2)
v2 = 1;
}
if (!v2 || !a0[2])
v2 = 0;
}
}
}
return v2;
}
|
int
sshbuf_put_u32(struct sshbuf *buf, u_int32_t val)
{
u_char *p;
int r;
if ((r = sshbuf_reserve(buf, 4, &p)) < 0)
return r;
do { const u_int32_t __v = (val); ((u_char *)(p))[0] = (__v >> 24) & 0xff; ((u_char *)(p))[1] = (__v >> 16) & 0xff; ((u_char *)(p))[2] = (__v >> 8) & 0xff; ((u_char *)(p))[3] = __v & 0xff; } while (0);
return 0;
}
|
long long sshbuf_put_u32(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long long a3) {
unsigned int v0;
unsigned long long v1;
void* v3;
v0 = sshbuf_reserve(a0, 0x4, &v1, a3);
if (v0 < 0) {
v3 = v0;
return v3;
}
*(v1) = a1 >> 24;
*((v1 + 1)) = a1 >> 16;
*((v1 + 2)) = a1 >> 8;
*((v1 + 3)) = a1;
v3 = 0;
return v3;
}
|
static void check_perms (void)
{
if (!list) {
}
}
|
void check_perms(void)
{
return;
}
|
static void print_encap_seg6(FILE *fp, struct rtattr *encap)
{
struct rtattr *tb[(__SEG6_IPTUNNEL_MAX - 1)+1];
struct seg6_iptunnel_encap *tuninfo;
(parse_rtattr_flags((tb), ((__SEG6_IPTUNNEL_MAX - 1)), ((void*)(((char*)(encap)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((encap)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)));
if (!tb[SEG6_IPTUNNEL_SRH])
return;
tuninfo = ((void*)(((char*)(tb[SEG6_IPTUNNEL_SRH])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
print_string(PRINT_ANY, "mode",
"mode %s ", format_seg6mode_type(tuninfo->mode));
print_srh(fp, tuninfo->srh);
}
|
void print_encap_seg6(void* a0, unsigned short *a1) {
unsigned int *v0;
char v1;
char v2;
char v3;
unsigned long long *v5;
unsigned long long v6;
parse_rtattr_flags(&v1, 0x1, a1 + 2, *(a1) - 4, 0x8000);
if (*(&v2)) {
v0 = *(&v2) + 4;
print_string(0x4, "mode", "mode %s ", format_seg6mode_type(*(v0)));
print_srh(a0, v0 + 1);
}
v6 = *(&v3) ^ v5[5];
return;
}
|
static void
_gnu_flush_read (void)
{
size_t status;
checkpoint_run (
0
);
read_error_count = 0;
if (write_archive_to_stdout && record_start_block != 0)
{
archive =
1
;
status = sys_write_archive_buffer ();
archive =
0
;
if (status != record_size)
archive_write_error (status);
}
for (;;)
{
status = (((archive) >= (1 << 30)) ? rmt_read__ (archive - (1 << 30), record_start->buffer, record_size) : safe_read (archive, record_start->buffer, record_size));
if (status == record_size)
{
records_read++;
return;
}
if ((status == 0
|| (status == ((size_t) -1) &&
(*__errno_location ())
==
28
))
&& multi_volume_option)
{
while (!try_new_volume ())
;
if (current_block == record_end)
flush_archive();
return;
}
else if (status == ((size_t) -1))
{
archive_read_error ();
continue;
}
break;
}
short_read (status);
}
|
void _gnu_flush_read(unsigned int a0, unsigned long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long v0;
unsigned long long v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
checkpoint_run(0x0);
read_error_count = 0;
if (record_start_block) {
archive = 1;
v0 = sys_write_archive_buffer();
archive = 0;
if (v0 != record_size)
archive_write_error(v0);
}
if (!record_start_block || v0 == record_size) {
while (true) {
if (archive > 1073741823)
v2 = rmt_read__(archive - 0x40000000, 0xe87d894830ec8348, record_size, archive - 0x40000000);
else
v2 = safe_read(archive, 0xe87d894830ec8348, record_size, 0xe87d894830ec8348);
v0 = v2;
if (v0 == record_size) {
v3 = 16752697132039570249;
continued_file_offset = 16752697132039570249;
break;
} else {
if (v0 == -1)
*(&v2) = *(__errno_location());
if (multi_volume_option && (v2 == 28 || !v0) && (v0 == -1 || !v0)) {
while (true) {
*(&v2) = try_new_volume(a0, 0xe87d894830ec8348, a2, a3, a4, a5) ^ 1;
if (!v2)
break;
}
v5 = 16752697132039570248;
v6 = flush_archive();
break;
}
if (!multi_volume_option || v0 == -1 && v2 != 28 || v0 != -1 && v0) {
if (v0 == -1) {
archive_read_error(a0, 0x30ec8348, a2, a3, a4, a5);
} else {
v4 = short_read(v0, 0xe87d894830ec8348, a2, a3, a4, a5);
break;
}
}
}
}
return;
}
}
|
translate_line_number (struct file_data const *file, lin i)
{
return i + file->prefix_lines + 1;
}
|
long translate_line_number(long a1, long a2)
{
return *(_QWORD *)(a1 + 232) + a2 + 1;
}
|
static unsigned char *decode_ext_string(char *str, unsigned int *ret_size)
{
char *p, *p2;
unsigned char *tmp;
unsigned char *raw;
unsigned int raw_size;
unsigned action = 0;
unsigned char tag[
(4 +9)
];
unsigned int tag_len;
int ret, res;
p = strchr(str, '(');
if (p != 0) {
if (strncmp(str, "octet_string", 12) == 0) {
action = 1;
} else {
fprintf(
stderr
, "cannot parse: %s\n", str);
exit(1);
}
p++;
p2 = strchr(p, ')');
if (p2 ==
((void *)0)
) {
fprintf(
stderr
, "there is no terminating parenthesis in: %s\n", str);
exit(1);
}
*p2 = 0;
} else {
p = str;
}
if (strncmp(p, "0x", 2) == 0)
p+=2;
{ gnutls_datum_t _input = {(void*)p, strlen(p)}; gnutls_datum_t _output; ret = gnutls_hex_decode2(&_input, &_output); if (ret < 0) { fprintf(
stderr
, "error in hex ID: %s\n", p); exit(1); } raw = _output.data; raw_size = _output.size; };
switch(action) {
case 1:
tag_len = sizeof(tag);
res = asn1_encode_simple_der(
7
, raw, raw_size, tag, &tag_len);
if (res !=
0
) {
fprintf(
stderr
, "error in DER encoding: %s\n", asn1_strerror(res));
exit(1);
}
tmp = gnutls_malloc(raw_size+tag_len);
if (tmp ==
((void *)0)
) {
fprintf(
stderr
, "error in allocation\n");
exit(1);
}
memcpy(tmp, tag, tag_len);
memcpy(tmp+tag_len, raw, raw_size);
gnutls_free((void *) (raw)), raw=
((void *)0)
;
raw = tmp;
raw_size += tag_len;
break;
}
*ret_size = raw_size;
return raw;
}
|
int decode_ext_string(char *a0, unsigned int *a1) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
char *v4;
unsigned long long v5;
char *v6;
void* v7;
unsigned long v8;
unsigned int v9;
char v10;
char v11;
char v12;
v1 = 0;
v4 = strchr(a0, 0x28);
if (!v4) {
v4 = a0;
} else {
if (strncmp(a0, "octet_string", 0xc)) {
fprintf(*(*(&got.stderr)), "cannot parse: %s\n", a0);
exit(0x1);
}
v1 = 1;
v4 += 1;
v6 = strchr(v4, 0x29);
if (!v6) {
fprintf(*(*(&got.stderr)), "there is no terminating parenthesis in: %s\n", a0);
exit(0x1);
}
*(v6) = 0;
}
if (!strncmp(v4, "0x", 0x2))
v4 += 2;
v8 = v4;
v9 = strlen(v4);
v2 = gnutls_hex_decode2(&v8, &v10, &v10);
if (v2 < 0) {
fprintf(*(*(&got.stderr)), "error in hex ID: %s\n", v4);
exit(0x1);
}
v5 = *(&v10);
v0 = *(&v11);
if (v1 == 1) {
v10 = 13;
v3 = asn1_encode_simple_der(0x7, v5, v0, &v12, &v10);
if (v3) {
fprintf(*(*(&got.stderr)), "error in DER encoding: %s\n", asn1_strerror(v3));
exit(0x1);
}
v7 = *(*(5243144))(v0 + v10);
if (!v7) {
fprintf(*(*(&got.stderr)), "error in allocation\n");
exit(0x1);
}
memcpy(v7, &v12, v10);
memcpy(v10 + v7, v5, v0);
*(*(5243304))(v5);
v5 = 0;
v5 = v7;
v0 += v10;
}
*(a1) = v0;
return v5;
}
|
static int iproute_dump_filter(struct nlmsghdr *nlh, int reqlen)
{
struct rtmsg *rtm = ((void *)(((char *)nlh) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
int err;
rtm->rtm_protocol = filter.protocol;
if (filter.cloned)
rtm->rtm_flags |= 0x200;
if (filter.tb) {
err = addattr32(nlh, reqlen, RTA_TABLE, filter.tb);
if (err)
return err;
}
if (filter.oif) {
err = addattr32(nlh, reqlen, RTA_OIF, filter.oif);
if (err)
return err;
}
return 0;
}
|
long iproute_dump_filter(long a1, unsigned int a2)
{
int v2;
unsigned int v4;
unsigned int v5;
*(_BYTE *)(a1 + 21) = dword_8D40;
if ( dword_8D24 )
{
v2 = *(_DWORD *)(a1 + 24);
BYTE1(v2) |= 2u;
*(_DWORD *)(a1 + 24) = v2;
}
if ( filter )
{
v4 = addattr32(a1, a2, 15LL, (unsigned int)filter);
if ( v4 )
return v4;
}
if ( dword_8D68 )
{
v5 = addattr32(a1, a2, 4LL, (unsigned int)dword_8D68);
if ( v5 )
return v5;
}
return 0LL;
}
|
static void
atime_coder (struct tar_stat_info const *st, char const *keyword,
struct xheader *xhdr, void const *data __attribute__ ((unused)))
{
code_time (st->atime, keyword, xhdr);
}
|
long long atime_coder(unsigned long long a0[31], unsigned long a1, void* a2, unsigned long a3) {
unsigned long v0;
v0 = a3;
return code_time(a0[29], a0[30], a1, a2);
}
|
static void
atime_coder (struct tar_stat_info const *st, char const *keyword,
struct xheader *xhdr, void const *data __attribute__ ((unused)))
{
code_time (st->atime, keyword, xhdr);
}
|
void atime_coder(long param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
undefined8 param_5,undefined8 param_6)
{
code_time(*(undefined8 *)(param_1 + 0xe8),*(undefined8 *)(param_1 + 0xf0),param_2,param_3,param_5,
param_6,param_4);
return;
}
|
int mount_proc(void)
{
struct stat st;
char *args[] = { "mount", "-t", "proc", "proc", "/proc", 0 };
pid_t pid, rc;
int wst;
int did_mount = 0;
if (stat("/proc/version", &st) < 0 &&
(*__errno_location ())
==
2
) {
if ((pid = fork()) < 0) {
nsyslog(
3
, "cannot fork");
exit(1);
}
if (pid == 0) {
execv("/bin/mount", args);
execv("/sbin/mount", args);
nsyslog(
3
, "cannot execute mount");
exit(1);
}
while ((rc = wait(&wst)) != pid)
if (rc < 0 &&
(*__errno_location ())
==
10
)
break;
if (rc != pid ||
(((
wst
) & 0xff00) >> 8)
!= 0)
nsyslog(
3
, "mount returned non-zero exit status");
did_mount = 1;
}
if (stat("/proc/version", &st) < 0) {
if (
(*__errno_location ())
==
2
)
nsyslog(
3
, "/proc not mounted, failed to mount.");
else
nsyslog(
3
, "/proc unavailable.");
exit(1);
}
return did_mount;
}
|
undefined4 mount_proc(void)
{
int iVar1;
int *piVar2;
long in_FS_OFFSET;
int local_e8;
undefined4 local_e4;
__pid_t local_e0;
__pid_t local_dc;
char *local_d8;
undefined *local_d0;
undefined *local_c8;
undefined *local_c0;
char *local_b8;
undefined8 local_b0;
stat local_a8;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_d8 = "mount";
local_d0 = &DAT_00102aec;
local_c8 = &DAT_00102aef;
local_c0 = &DAT_00102aef;
local_b8 = "/proc";
local_b0 = 0;
local_e4 = 0;
iVar1 = stat("/proc/version",&local_a8);
if ((iVar1 < 0) && (piVar2 = __errno_location(), *piVar2 == 2)) {
local_e0 = fork();
if (local_e0 < 0) {
nsyslog(3,"cannot fork");
exit(1);
}
if (local_e0 == 0) {
execv("/bin/mount",&local_d8);
execv("/sbin/mount",&local_d8);
nsyslog(3,"cannot execute mount");
exit(1);
}
do {
local_dc = wait(&local_e8);
if (local_dc == local_e0) break;
} while ((-1 < local_dc) || (piVar2 = __errno_location(), *piVar2 != 10));
if ((local_dc != local_e0) || ((local_e8 >> 8 & 0xffU) != 0)) {
nsyslog(3,"mount returned non-zero exit status");
}
local_e4 = 1;
}
iVar1 = stat("/proc/version",&local_a8);
if (iVar1 < 0) {
piVar2 = __errno_location();
if (*piVar2 == 2) {
nsyslog(3,"/proc not mounted, failed to mount.");
}
else {
nsyslog(3,"/proc unavailable.");
}
exit(1);
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return local_e4;
}
__stack_chk_fail();
}
|
int
_rl_nchars_available ()
{
int chars_avail, fd, result;
chars_avail = 0;
fd = fileno (rl_instream);
(*__errno_location ())
= 0;
result = ioctl (fd,
0x541B
, &chars_avail);
if (result == -1 &&
(*__errno_location ())
==
5
)
return -1;
return chars_avail;
}
|
long long _rl_nchars_available() {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned long long v5;
v0 = 0;
v1 = fileno(rl_instream);
*(__errno_location()) = 0;
v2 = ioctl(v1, 0x541b);
if (v2 == -1 && *(__errno_location()) == 5) {
v5 = 4294967295;
goto LABEL_40082e;
}
v5 = v0;
LABEL_40082e:
return v5;
}
|
COMMAND *
make_coproc_command (name, command)
char *name;
COMMAND *command;
{
COPROC_COM *temp;
temp = (COPROC_COM *)sh_xmalloc((sizeof (COPROC_COM)), "make_cmd.c", 835);
temp->name = (char *)strcpy (sh_xmalloc((1 + strlen (name)), "make_cmd.c", 836), (name));
temp->command = command;
temp->flags = 0x01|0x1000;
return (make_command (cm_coproc, (SIMPLE_COM *)temp));
}
|
long long make_coproc_command(char *a0, unsigned long a1) {
struct_0 *v0;
v0 = sh_xmalloc(0x18, "make_cmd.c", 0x343);
v0->field_8 = strcpy(sh_xmalloc(strlen(a0) + 1, "make_cmd.c", 0x344), a0);
v0->field_10 = a1;
v0->field_0 = 4097;
return make_command(0xe, v0);
}
|
void e2fsck_pass5(e2fsck_t ctx)
{
struct resource_track rtrack;
struct problem_context pctx;
init_resource_track(&rtrack, ctx->fs->io);
clear_problem_context(&pctx);
if (!(ctx->options & 0x0002))
fix_problem(ctx, 0x050000, &pctx);
if (ctx->progress)
if ((ctx->progress)(ctx, 5, 0, ctx->fs->group_desc_count*2))
return;
e2fsck_read_bitmaps(ctx);
check_block_bitmaps(ctx);
if (ctx->flags & (0x0001 | 0x0002))
return;
check_inode_bitmaps(ctx);
if (ctx->flags & (0x0001 | 0x0002))
return;
check_inode_end(ctx);
if (ctx->flags & (0x0001 | 0x0002))
return;
check_block_end(ctx);
if (ctx->flags & (0x0001 | 0x0002))
return;
check_inode_bitmap_checksum(ctx);
check_block_bitmap_checksum(ctx);
ext2fs_free_inode_bitmap(ctx->inode_used_map);
ctx->inode_used_map = 0;
ext2fs_free_inode_bitmap(ctx->inode_dir_map);
ctx->inode_dir_map = 0;
ext2fs_free_block_bitmap(ctx->block_found_map);
ctx->block_found_map = 0;
ext2fs_free_block_bitmap(ctx->block_metadata_map);
ctx->block_metadata_map = 0;
print_resource_track(ctx, (gettext ("Pass 5")), &rtrack, ctx->fs->io);
}
|
long long e2fsck_pass5(struct_0 *a0) {
char v0;
char v1;
init_resource_track(&v0, a0->field_0->field_8, a0->field_0->field_8);
clear_problem_context(&v1);
if (!(a0->field_4c & 2))
fix_problem(a0, 0x50000, &v1);
if (!a0->field_160(a0, 5, 0, a0->field_0->field_30 * 2, a0->field_160) || !a0->field_160) {
e2fsck_read_bitmaps(a0);
check_block_bitmaps(a0);
if (!(a0->field_48 & 3)) {
check_inode_bitmaps(a0);
if (!(a0->field_48 & 3)) {
check_inode_end(a0);
if (!(a0->field_48 & 3)) {
check_block_end(a0);
if (!(a0->field_48 & 3)) {
check_inode_bitmap_checksum(a0);
check_block_bitmap_checksum(a0);
ext2fs_free_inode_bitmap(a0->field_168);
a0->field_168 = 0;
ext2fs_free_inode_bitmap(a0->field_178);
a0->field_178 = 0;
ext2fs_free_block_bitmap(a0->field_1a0);
a0->field_1a0 = 0;
ext2fs_free_block_bitmap(a0->field_390);
a0->field_390 = 0;
print_resource_track(a0, gettext("Pass 5"), &v0, a0->field_0->field_8);
}
}
}
}
}
return 0;
}
|
static struct change *
add_change (lin line0, lin line1, lin deleted, lin inserted,
struct change *old)
{
struct change *new = xmalloc (sizeof *new);
new->line0 = line0;
new->line1 = line1;
new->inserted = inserted;
new->deleted = deleted;
new->link = old;
return new;
}
|
int add_change(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4) {
unsigned long long v0[5];
v0[0] = xmalloc(0x30);
v0[3] = a0;
v0[4] = a1;
v0[1] = a3;
v0[2] = a2;
v0[0] = a4;
return v0;
}
|
void
print_message_queue (void)
{
char const *arg[5];
int i;
struct msg *m = msg_chain;
while (m)
{
struct msg *next = m->next;
arg[0] = m->args;
for (i = 0; i < 4; i++)
arg[i + 1] = arg[i] + strlen (arg[i]) + 1;
printf (gettext (arg[0]), arg[1], arg[2], arg[3], arg[4]);
free (m);
m = next;
}
}
|
void print_message_queue() {
unsigned int v0;
unsigned long long *v1;
void* v2;
char *v3;
char v4;
unsigned long long *v6;
unsigned long long v7;
for (v1 = msg_chain; v1; v1 = v2) {
v2 = *(v1);
v3 = &v1[1];
for (v0 = 0; v0 <= 3; v0 += 1) {
(&v3)[1 + v0] = &((&v3)[v0])[1 + strlen((&v3)[v0])];
}
printf(gettext(v3));
free(v1);
}
v7 = *(&v4) ^ v6[5];
return;
}
|
void
defun(union node *func)
{
struct cmdentry entry;
({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; });
entry.cmdtype = 1;
entry.u.func = copyfunc(func);
addcmdentry(func->ndefun.text, &entry);
({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; });
}
|
long long defun(struct_0 *a0) {
unsigned int v0;
unsigned long v1;
suppressint = suppressint + 1;
v0 = 1;
v1 = copyfunc(a0);
addcmdentry(a0->field_8, &v0);
suppressint = suppressint - 1;
if (suppressint) {
return 0;
} else if (!intpending) {
return 0;
} else {
onint();
return 0;
}
}
|
static int
compute_number_width (size_t nfiles, struct fstatus const *fstatus)
{
int width = 1;
if (0 < nfiles && fstatus[0].failed <= 0)
{
int minimum_width = 1;
uintmax_t regular_total = 0;
for (size_t i = 0; i < nfiles; i++)
if (! fstatus[i].failed)
{
if (
((((
fstatus[i].st.st_mode
)) & 0170000) == (0100000))
)
regular_total += fstatus[i].st.st_size;
else
minimum_width = 7;
}
for (; 10 <= regular_total; regular_total /= 10)
width++;
if (width < minimum_width)
width = minimum_width;
}
return width;
}
|
int compute_number_width(unsigned long a0, unsigned int *a1) {
unsigned int v0;
unsigned int v1;
unsigned long long v2;
void* v3;
v0 = 1;
if (a0 && *(a1) <= 0) {
v1 = 1;
v2 = 0;
for (v3 = 0; v3 < a0; v3 += 1) {
if (!*((a1 + 0x80 * v3 + 0x10 * v3 + 0x8 * v3))) {
if ((*((32 + a1 + 0x80 * v3 + 0x10 * v3 + 0x8 * v3)) & 0xf000) == 0x8000)
v2 += *((56 + a1 + 0x98 * v3));
else
v1 = 7;
}
}
for (; v2 > 9; v2 = v2 * 14757395258967641293 >> 64 >> 3) {
v0 += 1;
}
if (v0 < v1)
v0 = v1;
}
return v0;
}
|
static void
finalize_input (int fd, struct stat const *st,
_Bool
ineof)
{
if (fd ==
0
&& (outleft
? (!ineof
&& (seek_failed
|| (lseek (fd, 0,
2
) < 0
&&
(*__errno_location ())
!=
22
))
&& ! drain_input (fd, st))
: (bufoffset != after_last_match && !seek_failed
&& lseek (fd, after_last_match,
0
) < 0)))
suppressible_error (
(*__errno_location ())
);
}
|
void finalize_input(unsigned long a0, void* a1, unsigned long long a2) {
unsigned int v1;
unsigned long v2;
unsigned long long v3;
v1 = a2;
if (a0)
return;
if (outleft) {
if (!(a2 ^ 1) || !seek_failed && (lseek(a0, 0x0, 0x2) >= 0 || !((v1 = *(__errno_location()), v1 != 22))) || !((*(&v1) = (drain_input(a0, a1) ^ 1), v1)))
v1 = 0;
else
v1 = 1;
v2 = v1 & 1;
} else {
if (bufoffset == after_last_match || !(seek_failed ^ 1) || lseek(a0, after_last_match, 0x0) >= 0)
v1 = 0;
else
v1 = 1;
v2 = v1 & 1;
}
if (v2) {
v3 = suppressible_error(*(__errno_location()));
return;
}
return;
}
|
static
int check_pipe(int fd)
{
struct timeval t;
fd_set s;
char signature[8];
do { unsigned int __i; fd_set *__arr = (
&s
); for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) ((__arr)->fds_bits)[__i] = 0; } while (0)
;
((void) (((
&s
)->fds_bits)[((
fd
) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << ((
fd
) % (8 * (int) sizeof (__fd_mask)))))))
;
t.tv_sec = t.tv_usec = 0;
if (select(fd+1, &s,
((void *)0)
,
((void *)0)
, &t) != 1)
return 0;
if (read(fd, signature, 8) != 8)
return 0;
return strncmp(Signature, signature, 8) == 0;
}
|
_BOOL8 check_pipe(int a1)
{
unsigned int i;
struct timeval timeout;
fd_set readfds;
char buf[8];
unsigned long v6;
v6 = __readfsqword(0x28u);
for ( i = 0; i <= 0xF; ++i )
readfds.fds_bits[i] = 0LL;
readfds.fds_bits[a1 / 64] |= 1LL << (a1 % 64);
timeout.tv_usec = 0LL;
timeout.tv_sec = 0LL;
if ( select(a1 + 1, &readfds, 0LL, 0LL, &timeout) != 1 )
return 0LL;
if ( read(a1, buf, 8uLL) == 8 )
return strncmp(Signature, buf, 8uLL) == 0;
return 0LL;
}
|
Keymap
rl_make_keymap (void)
{
register int i;
Keymap newmap;
newmap = rl_make_bare_keymap ();
for (i = ' '; i < 127; i++)
newmap[i].function = rl_insert;
newmap['\t'].function = rl_insert;
newmap[0x7f].function = rl_rubout;
newmap[(('H') & 0x1f)].function = rl_rubout;
for (i = 128; i < 256; i++)
newmap[i].function = rl_insert;
return (newmap);
}
|
long long rl_make_keymap() {
unsigned long long v0[256];
unsigned long long v2;
unsigned long long v3;
v0[0] = rl_make_bare_keymap();
for (v2 = 32; v2 <= 126; v2 = v2 + 1) {
v0[1 + 2 * v2] = got.rl_insert;
}
v0[19] = got.rl_insert;
v0[255] = got.rl_rubout;
v0[9007199254740991 + 239] = got.rl_rubout;
for (v3 = 128; v3 <= 255; v3 = v3 + 1) {
v0[1 + 2 * v3] = got.rl_insert;
}
return v0;
}
|
static int veth_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
char *type =
((void *)0)
;
int err;
struct rtattr *data;
struct ifinfomsg *ifm, *peer_ifm;
unsigned int ifi_flags, ifi_change, ifi_index;
if (strcmp(argv[0], "peer") != 0) {
usage();
return -1;
}
ifm = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
ifi_flags = ifm->ifi_flags;
ifi_change = ifm->ifi_change;
ifi_index = ifm->ifi_index;
ifm->ifi_flags = 0;
ifm->ifi_change = 0;
ifm->ifi_index = 0;
data = addattr_nest(n, 1024, VETH_INFO_PEER);
n->nlmsg_len += sizeof(struct ifinfomsg);
err = iplink_parse(argc - 1, argv + 1, (struct iplink_req *)n, &type);
if (err < 0)
return err;
if (type)
duparg("type", argv[err]);
peer_ifm = ((void*)(((char*)(data)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
peer_ifm->ifi_index = ifm->ifi_index;
peer_ifm->ifi_flags = ifm->ifi_flags;
peer_ifm->ifi_change = ifm->ifi_change;
ifm->ifi_flags = ifi_flags;
ifm->ifi_change = ifi_change;
ifm->ifi_index = ifi_index;
addattr_nest_end(n, data);
return argc - 1 - err;
}
|
long long veth_parse_opt(unsigned long a0, unsigned long a1, unsigned long long *a2, unsigned int *a3) {
unsigned long v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
void* v5;
unsigned int v6[4];
unsigned long long v7;
unsigned int v8[4];
unsigned long long v10;
v0 = a0;
v5 = 0;
if (strcmp(*(a2), "peer")) {
usage();
v10 = 4294967295;
return v10;
}
*(&v6[0]) = a3 + 4;
v1 = v6[2];
v2 = v6[3];
v3 = v6[1];
v6[2] = 0;
v6[3] = 0;
v6[1] = 0;
v7 = addattr_nest(a3, 0x400, 0x1);
*(a3) = *(a3) + 16;
v4 = iplink_parse(a1 - 1, a2 + 1, a3, &v5);
if (v4 < 0) {
v10 = v4;
return v10;
}
if (v5)
duparg("type", a2[v4], v4 * 8);
*(&v8[0]) = v7 + 4;
v8[1] = v6[1];
v8[2] = v6[2];
v8[3] = v6[3];
v6[2] = v1;
v6[3] = v2;
v6[1] = v3;
addattr_nest_end(a3, v7, v7);
v10 = a1 - 1 - v4;
return v10;
}
|
int
falsecmd(int argc, char **argv)
{
return 1;
}
|
long falsecmd()
{
return 1LL;
}
|
static char *
parameter_brace_transform (varname, value, estatep, xform, rtype, quoted, pflags, flags)
char *varname, *value;
array_eltstate_t *estatep;
char *xform;
int rtype, quoted, pflags, flags;
{
int vtype, xc, starsub;
char *temp1, *val, *oname;
SHELL_VAR *v;
xc = xform[0];
if (value == 0 && xc != 'A' && xc != 'a')
return ((char *)
((void *)0)
);
oname = this_command_name;
this_command_name = varname;
vtype = get_var_and_type (varname, value, estatep, quoted, flags, &v, &val);
if (vtype == -1)
{
this_command_name = oname;
return ((char *)
((void *)0)
);
}
if (xform[0] == 0 || valid_parameter_transform (xform) == 0)
{
this_command_name = oname;
if (vtype == 0)
do { if (val) sh_xfree((val), "subst.c", 8667); } while (0);
return (interactive_shell ? &expand_param_error : &expand_param_fatal);
}
starsub = vtype & 128;
vtype &= ~128;
if ((xc == 'a' || xc == 'A') && vtype == 0 && varname && v == 0)
v = find_variable (varname);
temp1 = (char *)
((void *)0)
;
switch (vtype)
{
case 0:
case 3:
temp1 = string_transform (xc, v, val);
if (vtype == 0)
do { if (val) sh_xfree((val), "subst.c", 8686); } while (0);
if (temp1)
{
val = (quoted & (0x002|0x001))
? quote_string (temp1)
: quote_escapes (temp1);
sh_xfree((temp1), "subst.c", 8692);
temp1 = val;
}
break;
case 2:
temp1 = array_transform (xc, v, starsub, quoted);
if (temp1 && quoted == 0 && ifs_is_null)
{
}
else if (temp1 && ((quoted & (0x002|0x001)) == 0))
{
val = quote_escapes (temp1);
sh_xfree((temp1), "subst.c", 8706);
temp1 = val;
}
break;
case 1:
temp1 = parameter_list_transform (xc, varname[0], quoted);
if (temp1 && quoted == 0 && ifs_is_null)
{
}
else if (temp1 && ((quoted & (0x002|0x001)) == 0))
{
val = quote_escapes (temp1);
sh_xfree((temp1), "subst.c", 8720);
temp1 = val;
}
break;
}
this_command_name = oname;
return temp1;
}
|
int parameter_brace_transform(char *a0, void* a1, void* a2, char *a3, unsigned long long a4, unsigned long a5, unsigned int v8) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned long v4;
void* v5;
unsigned long v6;
unsigned long long v7;
char v9;
unsigned int v10;
v0 = a4;
v1 = *(a3);
if (!a1 && v1 != 65 && v1 != 97) {
v10 = 0;
goto LABEL_4149ca;
}
v7 = this_command_name;
this_command_name = a0;
v2 = get_var_and_type(a0, a1, a2, a5, *(&v9), &v5, &v4);
if (v2 == -1) {
this_command_name = v7;
v10 = 0;
} else if (!*(a3)) {
LABEL_41474e:
this_command_name = v7;
if (!v2 && *(&v4))
sh_xfree(*(&v4), "subst.c", 0x21db);
if (!interactive_shell)
v10 = &expand_param_fatal;
else
v10 = &expand_param_error;
} else {
if (!valid_parameter_transform(a3))
goto LABEL_41474e;
v3 = v2 & 128;
v2 &= -129;
if (v1 != 97 && !(v1 == 65))
goto LABEL_4147e6;
if (!v2 && a0 && !v5)
v5 = find_variable(a0);
LABEL_4147e6:
v6 = 0;
if (v2 == 3) {
v6 = string_transform(v1, v5, *(&v4));
if (!v2 && *(&v4))
sh_xfree(*(&v4), "subst.c", 0x21ee);
if (v6) {
if (!(a5 & 3))
v10 = quote_escapes(v6);
else
v10 = quote_string(v6);
v4 = v10;
sh_xfree(v6, "subst.c", 0x21f4);
*(&v6) = *(&v4);
}
} else {
if (!(v2 <= 3))
goto LABEL_4149bb;
if (v2 == 2) {
v6 = array_transform(v1, v5, v3, a5, a4, &v5);
if (v6 && !a5 && !(!5023220010551146633))
goto LABEL_4149b7;
if (v6 && !(a5 & 3)) {
v4 = quote_escapes(v6);
sh_xfree(v6, "subst.c", 0x2202);
v6 = v4;
}
LABEL_4149b7:
} else {
if (!(v2 <= 2))
goto LABEL_4149bb;
if (v2 && v2 == 1) {
v6 = parameter_list_transform(v1, *(a0), a5, *(a0), a4, &v5);
if (v6 && !a5 && !(!5023220010551146633))
goto LABEL_4149ba;
if (v6 && !(a5 & 3)) {
v4 = quote_escapes(v6);
sh_xfree(v6, "subst.c", 0x2210);
v6 = v4;
}
LABEL_4149ba:
}
}
}
LABEL_4149bb:
this_command_name = v7;
v10 = v6;
}
LABEL_4149ca:
return v10;
}
|
static union block *
write_long_name (struct tar_stat_info *st)
{
switch (archive_format)
{
case POSIX_FORMAT:
xheader_store ("path", st,
((void *)0)
);
break;
case V7_FORMAT:
if (strlen (st->file_name) > 100 -1)
{
do { if (error_hook) error_hook (); error (0, 0, gettext ("%s: file name is too long (max %d); not dumped"), quotearg_colon (st->file_name), 100 - 1); exit_status = 2; } while (0)
;
return
((void *)0)
;
}
break;
case USTAR_FORMAT:
case STAR_FORMAT:
return write_ustar_long_name (st->file_name);
case OLDGNU_FORMAT:
case GNU_FORMAT:
write_gnu_long_link (st, st->file_name, 'L');
break;
default:
abort();
}
return write_short_name (st);
}
|
undefined8 write_long_name(long param_1)
{
size_t sVar1;
undefined8 uVar2;
undefined8 uVar3;
switch(archive_format) {
default:
abort();
case 1:
sVar1 = strlen(*(char **)(param_1 + 8));
if (99 < sVar1) {
if (error_hook != (code *)0x0) {
(*error_hook)();
}
uVar3 = quotearg_colon(*(undefined8 *)(param_1 + 8));
uVar2 = gettext("%s: file name is too long (max %d); not dumped");
error(0,0,uVar2,uVar3,99);
_exit_status = 2;
return 0;
}
break;
case 2:
case 6:
write_gnu_long_link(param_1,*(undefined8 *)(param_1 + 8),0x4c);
break;
case 3:
case 5:
uVar3 = write_ustar_long_name(*(undefined8 *)(param_1 + 8));
return uVar3;
case 4:
xheader_store(&DAT_00104dc4,param_1,0);
}
uVar3 = write_short_name(param_1);
return uVar3;
}
|
void generate_self_signed(common_info_st * cinfo)
{
gnutls_x509_crt_t crt;
gnutls_datum_t out;
gnutls_privkey_t key;
int result;
unsigned int flags = 0;
fprintf(stdlog, "Generating a self signed certificate...\n");
crt = generate_certificate(&key,
((void *)0)
, 0, cinfo);
if (!key)
key = load_private_key(1, cinfo);
print_certificate_info(crt, stdlog, 0);
fprintf(stdlog, "\n\nSigning certificate...\n");
if (cinfo->rsa_pss_sign)
flags |= GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS;
result =
gnutls_x509_crt_privkey_sign(crt, crt, key, get_dig(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);
gnutls_privkey_deinit(key);
}
|
void generate_self_signed(struct_0 *a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
unsigned long long v2;
unsigned long long v3;
void* v4;
char v5;
char v6;
unsigned long long *v8;
unsigned long long v9;
v0 = 0;
fprintf(stdlog, "Generating a self signed certificate...\n");
v3 = generate_certificate(&v2, 0x0, 0x0, a0, a4, a5);
if (!v2)
v2 = load_private_key(0x1, a0);
print_certificate_info(v3, stdlog, 0x0, stdlog);
fprintf(stdlog, "\n\nSigning certificate...\n");
if (a0->field_c8)
v0 |= 128;
v1 = gnutls_x509_crt_privkey_sign(v3, 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(v3, outcert_format, &v4, outcert_format);
if (v1 >= 0) {
fwrite(*(&v4), 0x1, *(&v5), outfile);
*(5243720)(*(&v4));
v4 = 0;
gnutls_x509_crt_deinit(v3);
gnutls_privkey_deinit(v2);
v9 = *(&v6) ^ v8[5];
return;
}
fprintf(*(&stderr), "crt_export: %s\n", gnutls_strerror(v1));
app_exit(0x1);
}
|
vi_delete_meta(EditLine *el, wint_t c __attribute__((__unused__)))
{
return cv_action(el, 0x01);
}
|
long vi_delete_meta(long a1)
{
return cv_action(a1, 1);
}
|
static unsigned char *
parse_collsym (p, vp)
unsigned char *p;
int *vp;
{
register int pc;
int val;
p++;
for (pc = 0; p[pc]; pc++)
if (p[pc] == '.' && p[pc+1] == ']')
break;
if (p[pc] == 0)
{
if (vp)
*vp = -1;
return (p + pc);
}
val = collsym (p, pc);
if (vp)
*vp = val;
return (p + pc + 2);
}
|
const char * parse_collsym(long a1, _DWORD *a2)
{
int i;
const char *v4;
int v5;
v4 = (const char *)(a1 + 1);
for ( i = 0; v4[i] && (v4[i] != 46 || v4[i + 1] != 93); ++i )
;
if ( v4[i] )
{
v5 = collsym(v4, i);
if ( a2 )
*a2 = v5;
return &v4[i + 2];
}
else
{
if ( a2 )
*a2 = -1;
return &v4[i];
}
}
|
char* scandev(DIR *dir)
{
char *name = (char*)0;
struct dirent *dent;
int fd;
fd = dirfd(dir);
rewinddir(dir);
while ((dent = readdir(dir))) {
char *path;
struct stat st;
if (fstatat(fd, dent->d_name, &st, 0) < 0)
continue;
if (!
((((
st.st_mode
)) & 0170000) == (0020000))
)
continue;
if (comparedev != st.st_rdev)
continue;
if (asprintf(&path, "/dev/%s", dent->d_name) < 0)
continue;
name = realpath(path,
((void *)0)
);
free(path);
break;
}
return name;
}
|
char * scandev(DIR *param_1)
{
int __fd;
int iVar1;
long in_FS_OFFSET;
char *local_c0;
char *local_b8;
dirent *local_b0;
stat local_a8;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_b8 = (char *)0x0;
__fd = dirfd(param_1);
rewinddir(param_1);
do {
local_b0 = readdir(param_1);
if (local_b0 == (dirent *)0x0) goto LAB_00100398;
iVar1 = fstatat(__fd,local_b0->d_name,&local_a8,0);
} while ((((iVar1 < 0) || ((local_a8.st_mode & 0xf000) != 0x2000)) ||
(local_a8.st_rdev != comparedev)) ||
(iVar1 = asprintf(&local_c0,"/dev/%s",local_b0->d_name), iVar1 < 0));
local_b8 = realpath(local_c0,(char *)0x0);
free(local_c0);
LAB_00100398:
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return local_b8;
}
__stack_chk_fail();
}
|
ed_prev_line(EditLine *el, wint_t c __attribute__((__unused__)))
{
wchar_t *ptr;
int nchars = c_hpos(el);
if (*(ptr = el->el_line.cursor) == '\n')
ptr--;
for (; ptr >= el->el_line.buffer; ptr--)
if (*ptr == '\n' && --el->el_state.argument <= 0)
break;
if (el->el_state.argument > 0)
return 6;
for (ptr--; ptr >= el->el_line.buffer && *ptr != '\n'; ptr--)
continue;
for (ptr++;
nchars-- > 0 && ptr < el->el_line.lastchar && *ptr != '\n';
ptr++)
continue;
el->el_line.cursor = ptr;
return 5;
}
|
long ed_prev_line(long a1)
{
int v2;
int v3;
_DWORD *v4;
_DWORD *i;
_DWORD *j;
v3 = c_hpos(a1);
v4 = *(_DWORD **)(a1 + 88);
if ( *v4 == 10 )
--v4;
while ( (unsigned long)v4 >= *(_QWORD *)(a1 + 80) )
{
if ( *v4 == 10 && (int)--*(_DWORD *)(a1 + 120) <= 0 )
break;
--v4;
}
if ( *(int *)(a1 + 120) > 0 )
return 6LL;
for ( i = v4 - 1; (unsigned long)i >= *(_QWORD *)(a1 + 80) && *i != 10; --i )
;
for ( j = i + 1; ; ++j )
{
v2 = v3--;
if ( v2 <= 0 || (unsigned long)j >= *(_QWORD *)(a1 + 96) || *j == 10 )
break;
}
*(_QWORD *)(a1 + 88) = j;
return 5LL;
}
|
static inline void
_rl_vi_backup (void)
{
if (
(__ctype_get_mb_cur_max ())
> 1 && rl_byte_oriented == 0)
rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, 0x01);
else
rl_point--;
}
|
void _rl_vi_backup() {
unsigned long long v1;
if (__ctype_get_mb_cur_max() > 1 && !rl_byte_oriented) {
rl_point = _rl_find_prev_mbchar(rl_line_buffer, rl_point, 0x1, rl_point);
goto LABEL_40089c;
}
v1 = rl_point - 1;
rl_point = rl_point - 1;
LABEL_40089c:
return;
}
|
static int
istrsenvisxna(char *mbdst, size_t *dlen, const char *mbsrc, size_t mblength,
int flags, const char *mbextra, int *cerr_ptr)
{
((void) sizeof ((
mbdst !=
((void *)0)) ? 1 : 0), __extension__ ({ if (
mbdst !=
((void *)0)) ; else __assert_fail (
"mbdst != NULL"
, "vis.c", 590, __extension__ __PRETTY_FUNCTION__); }))
;
return istrsenvisx(&mbdst, dlen, mbsrc, mblength,
flags, mbextra, cerr_ptr);
}
|
void istrsenvisxna(unsigned long a0, unsigned long long *a1, char *a2, unsigned int a3, unsigned long a4, void* a5, unsigned int *v1) {
char v0;
unsigned long long v2;
if (!a0)
__assert_fail();
v2 = istrsenvisx(&v0, a1, a2, a3, a4, a5, v1);
return;
}
|
static void sigintterm_handler(int x __attribute__ ((__unused__))) {
got_sigintterm = 1;
}
|
void sigintterm_handler(void)
{
got_sigintterm = 1;
return;
}
|
static int filecopy(const char *src, const char *dst)
{
FILE *fp, *fp2;
char line[5 * 1024];
char *p;
fp = fopen(dst, "w");
if (fp ==
((void *)0)
) {
fprintf(
stderr
, "Cannot open '%s' for write\n", dst);
return -1;
}
fp2 = fopen(src, "r");
if (fp2 ==
((void *)0)
) {
fclose(fp);
return 0;
}
line[sizeof(line) - 1] = 0;
do {
p = fgets(line, sizeof(line) - 1, fp2);
if (p ==
((void *)0)
)
break;
fputs(line, fp);
}
while (1);
fclose(fp);
fclose(fp2);
return 0;
}
|
int filecopy(char *a0, char *a1) {
void* v0;
void* v1;
unsigned long v2;
char v3;
unsigned long long v4;
char v5;
unsigned int v7;
v4 = *(&v4);
v0 = fopen(a1, "w");
if (!v0) {
fprintf(stderr, "Cannot open '%s' for write\n", a1);
v7 = -1;
return v7;
}
v1 = fopen(a0, "r");
if (!v1) {
fclose(v0);
v7 = 0;
return v7;
}
v5 = 0;
while (true) {
v2 = fgets(&v3, 0x13ff, v1);
if (!v2)
break;
fputs(&v3, v0);
}
fclose(v0);
fclose(v1);
v7 = 0;
return v7;
}
|
static void usage (int status)
{
FILE *usageout = (0 != status) ?
stderr
:
stdout
;
(void) fprintf (usageout,
gettext ("Usage: %s [options] LOGIN\n" "\n" "Options:\n")
,
Prog);
(void) fputs (gettext (" -a, --append append the user to the supplemental GROUPS\n" " mentioned by the -G option without removing\n" " the user from other groups\n")
, usageout);
(void) fputs (gettext (" -b, --badname allow bad names\n"), usageout);
(void) fputs (gettext (" -c, --comment COMMENT new value of the GECOS field\n"), usageout);
(void) fputs (gettext (" -d, --home HOME_DIR new home directory for the user account\n"), usageout);
(void) fputs (gettext (" -e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE\n"), usageout);
(void) fputs (gettext (" -f, --inactive INACTIVE set password inactive after expiration\n" " to INACTIVE\n")
, usageout);
(void) fputs (gettext (" -g, --gid GROUP force use GROUP as new primary group\n"), usageout);
(void) fputs (gettext (" -G, --groups GROUPS new list of supplementary GROUPS\n"), usageout);
(void) fputs (gettext (" -h, --help display this help message and exit\n"), usageout);
(void) fputs (gettext (" -l, --login NEW_LOGIN new value of the login name\n"), usageout);
(void) fputs (gettext (" -L, --lock lock the user account\n"), usageout);
(void) fputs (gettext (" -m, --move-home move contents of the home directory to the\n" " new location (use only with -d)\n")
, usageout);
(void) fputs (gettext (" -o, --non-unique allow using duplicate (non-unique) UID\n"), usageout);
(void) fputs (gettext (" -p, --password PASSWORD use encrypted password for the new password\n"), usageout);
(void) fputs (gettext (" -P, --prefix PREFIX_DIR prefix directory where are located the /etc/* files\n"), usageout);
(void) fputs (gettext (" -r, --remove remove the user from only the supplemental GROUPS\n" " mentioned by the -G option without removing\n" " the user from other groups\n")
, usageout);
(void) fputs (gettext (" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
(void) fputs (gettext (" -s, --shell SHELL new login shell for the user account\n"), usageout);
(void) fputs (gettext (" -u, --uid UID new UID for the user account\n"), usageout);
(void) fputs (gettext (" -U, --unlock unlock the user account\n"), usageout);
(void) fputs (gettext (" -v, --add-subuids FIRST-LAST add range of subordinate uids\n"), usageout);
(void) fputs (gettext (" -V, --del-subuids FIRST-LAST remove range of subordinate uids\n"), usageout);
(void) fputs (gettext (" -w, --add-subgids FIRST-LAST add range of subordinate gids\n"), usageout);
(void) fputs (gettext (" -W, --del-subgids FIRST-LAST remove range of subordinate gids\n"), usageout);
(void) fputs ("\n", usageout);
exit (status);
}
|
void usage(int a1)
{
struct _IO_FILE *v1;
long v2;
char *v3;
char *v4;
char *v5;
char *v6;
char *v7;
char *v8;
char *v9;
char *v10;
char *v11;
char *v12;
char *v13;
char *v14;
char *v15;
char *v16;
char *v17;
char *v18;
char *v19;
char *v20;
char *v21;
char *v22;
char *v23;
char *v24;
char *v25;
char *v26;
char *v27;
FILE *stream;
if ( a1 )
v1 = stderr;
else
v1 = stdout;
stream = v1;
v2 = Prog;
v3 = gettext("Usage: %s [options] LOGIN\n\nOptions:\n");
fprintf(stream, v3, v2);
v4 = gettext(
" -a, --append append the user to the supplemental GROUPS\n"
" mentioned by the -G option without removing\n"
" the user from other groups\n");
fputs(v4, stream);
v5 = gettext(" -b, --badname allow bad names\n");
fputs(v5, stream);
v6 = gettext(" -c, --comment COMMENT new value of the GECOS field\n");
fputs(v6, stream);
v7 = gettext(" -d, --home HOME_DIR new home directory for the user account\n");
fputs(v7, stream);
v8 = gettext(" -e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE\n");
fputs(v8, stream);
v9 = gettext(
" -f, --inactive INACTIVE set password inactive after expiration\n"
" to INACTIVE\n");
fputs(v9, stream);
v10 = gettext(" -g, --gid GROUP force use GROUP as new primary group\n");
fputs(v10, stream);
v11 = gettext(" -G, --groups GROUPS new list of supplementary GROUPS\n");
fputs(v11, stream);
v12 = gettext(" -h, --help display this help message and exit\n");
fputs(v12, stream);
v13 = gettext(" -l, --login NEW_LOGIN new value of the login name\n");
fputs(v13, stream);
v14 = gettext(" -L, --lock lock the user account\n");
fputs(v14, stream);
v15 = gettext(
" -m, --move-home move contents of the home directory to the\n"
" new location (use only with -d)\n");
fputs(v15, stream);
v16 = gettext(" -o, --non-unique allow using duplicate (non-unique) UID\n");
fputs(v16, stream);
v17 = gettext(" -p, --password PASSWORD use encrypted password for the new password\n");
fputs(v17, stream);
v18 = gettext(" -P, --prefix PREFIX_DIR prefix directory where are located the /etc/* files\n");
fputs(v18, stream);
v19 = gettext(
" -r, --remove remove the user from only the supplemental GROUPS\n"
" mentioned by the -G option without removing\n"
" the user from other groups\n");
fputs(v19, stream);
v20 = gettext(" -R, --root CHROOT_DIR directory to chroot into\n");
fputs(v20, stream);
v21 = gettext(" -s, --shell SHELL new login shell for the user account\n");
fputs(v21, stream);
v22 = gettext(" -u, --uid UID new UID for the user account\n");
fputs(v22, stream);
v23 = gettext(" -U, --unlock unlock the user account\n");
fputs(v23, stream);
v24 = gettext(" -v, --add-subuids FIRST-LAST add range of subordinate uids\n");
fputs(v24, stream);
v25 = gettext(" -V, --del-subuids FIRST-LAST remove range of subordinate uids\n");
fputs(v25, stream);
v26 = gettext(" -w, --add-subgids FIRST-LAST add range of subordinate gids\n");
fputs(v26, stream);
v27 = gettext(" -W, --del-subgids FIRST-LAST remove range of subordinate gids\n");
fputs(v27, stream);
fputs("\n", stream);
exit(a1);
}
|
static const char *prio_to_str(char buf[static 32], int prio)
{
const char *prioname;
switch (prio) {
case
2
:
prioname = "FATAL";
break;
case
3
:
prioname = "ERROR";
break;
case
4
:
prioname = "WARNING";
break;
case
5
:
prioname = "NOTICE";
break;
case
6
:
prioname = "INFO";
break;
case
7
:
prioname = "DEBUG";
break;
default:
snprintf(buf, 32, "LOG-%03d", prio);
prioname = buf;
}
return prioname;
}
|
int prio_to_str(char *a0, unsigned long a1) {
unsigned long long v0;
switch (a1) {
case 2:
v0 = "FATAL";
break;
case 3:
v0 = "ERROR";
break;
case 4:
v0 = "WARNING";
break;
case 5:
v0 = "NOTICE";
break;
case 6:
v0 = "INFO";
break;
case 7:
v0 = "DEBUG";
break;
default:
snprintf(a0, 0x20, "LOG-%03d", a1);
v0 = a0;
break;
}
return v0;
}
|
int e2fsck_dir_will_be_rehashed(e2fsck_t ctx, ext2_ino_t ino)
{
if (ctx->options & 0x0400)
return 1;
if (!ctx->dirs_to_hash)
return 0;
return ext2fs_u32_list_test(ctx->dirs_to_hash, ino);
}
|
long e2fsck_dir_will_be_rehashed(long a1, unsigned int a2)
{
if ( (*(_DWORD *)(a1 + 76) & 0x400) != 0 )
return 1LL;
if ( *(_QWORD *)(a1 + 584) )
return ext2fs_u32_list_test(*(_QWORD *)(a1 + 584), a2);
return 0LL;
}
|
void
rl_activate_mark (void)
{
mark_active = 1;
rl_keep_mark_active ();
}
|
void rl_activate_mark() {
unsigned long long v1;
mark_active = 1;
v1 = rl_keep_mark_active();
return;
}
|
void
rl_save_prompt(void)
{
rl_prompt_saved = strdup(rl_prompt);
}
|
long long rl_save_prompt() {
*(got.rl_prompt_saved) = strdup(*(got.rl_prompt));
return got.rl_prompt_saved;
}
|
void
sshkey_sig_details_free(struct sshkey_sig_details *details)
{
freezero(details, sizeof(*details));
}
|
long long sshkey_sig_details_free(unsigned long long a0) {
return freezero(a0, 0x8);
}
|
static
_Bool
to_tm_year (textint textyear,
_Bool
debug, int *tm_year)
{
intmax_t year = textyear.value;
if (0 <= year && textyear.digits == 2)
{
year += year < 69 ? 2000 : 1900;
if (debug)
dbg_printf (gettext ("warning: adjusting year value %"
"l" "d"
" to %"
"l" "d"
"\n")
,
textyear.value, year);
}
if (year < 0
? __builtin_sub_overflow (-TM_YEAR_BASE, year, tm_year)
: __builtin_sub_overflow (year, TM_YEAR_BASE, tm_year))
{
if (debug)
dbg_printf (gettext ("error: out-of-range year %"
"l" "d"
"\n"), year);
return
0
;
}
return
1
;
}
|
undefined8 to_tm_year(char param_1,int *param_2)
{
int iVar1;
undefined8 uVar2;
bool bVar3;
long in_stack_00000010;
long in_stack_00000018;
long local_20;
local_20 = in_stack_00000010;
if ((-1 < in_stack_00000010) && (in_stack_00000018 == 2)) {
if (in_stack_00000010 < 0x45) {
local_20 = 2000;
}
else {
local_20 = 0x76c;
}
local_20 = in_stack_00000010 + local_20;
if (param_1 != '\0') {
gettext("warning: adjusting year value %ld to %ld\n");
}
}
if (local_20 < 0) {
iVar1 = (int)(-0x76c - local_20);
bVar3 = -0x76c - local_20 != (long)iVar1 || SBORROW8(-0x76c,local_20);
*param_2 = iVar1;
}
else {
iVar1 = (int)(local_20 + -0x76c);
bVar3 = local_20 + -0x76c != (long)iVar1 || SBORROW8(local_20,0x76c);
*param_2 = iVar1;
}
if (bVar3) {
if (param_1 != '\0') {
gettext("error: out-of-range year %ld\n");
}
uVar2 = 0;
}
else {
uVar2 = 1;
}
return uVar2;
}
|
void
set_option_defaults (struct options *p)
{
if (getenv ("POSIXLY_CORRECT"))
p->posixly_correct =
1
;
else
p->posixly_correct =
0
;
p->open_nofollow_available = check_nofollow ();
p->regex_options = 0;
if (isatty (0))
{
p->warnings =
1
;
p->literal_control_chars =
0
;
}
else
{
p->warnings =
0
;
p->literal_control_chars =
0
;
}
if (p->posixly_correct)
{
p->warnings =
0
;
}
p->do_dir_first =
1
;
p->explicit_depth =
0
;
p->maxdepth = p->mindepth = -1;
p->start_time = now ();
p->cur_day_start.tv_sec = p->start_time.tv_sec - 86400;
p->cur_day_start.tv_nsec = p->start_time.tv_nsec;
p->full_days =
0
;
p->stay_on_filesystem =
0
;
p->ignore_readdir_race =
0
;
if (p->posixly_correct)
p->output_block_size = 512;
else
p->output_block_size = 1024;
p->debug_options = 0uL;
p->optimisation_level = 2;
if (getenv ("FIND_BLOCK_SIZE"))
{
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"The environment variable FIND_BLOCK_SIZE is not supported, \" \"the only thing that affects the block size is the \" \"POSIXLY_CORRECT environment variable\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("The environment variable FIND_BLOCK_SIZE is not supported, " "the only thing that affects the block size is the " "POSIXLY_CORRECT environment variable")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("The environment variable FIND_BLOCK_SIZE is not supported, " "the only thing that affects the block size is the " "POSIXLY_CORRECT environment variable")), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
p->no_leaf_check =
0
;
set_follow_state (SYMLINK_NEVER_DEREF);
p->err_quoting_style = locale_quoting_style;
p->files0_from =
((void *)0)
;
p->ok_prompt_stdin =
0
;
}
|
void set_option_defaults(undefined *param_1)
{
undefined uVar1;
int iVar2;
char *pcVar3;
undefined8 uVar4;
undefined auVar5 [16];
pcVar3 = getenv("POSIXLY_CORRECT");
if (pcVar3 == (char *)0x0) {
param_1[0x11] = 0;
}
else {
param_1[0x11] = 1;
}
uVar1 = check_nofollow();
param_1[0x58] = uVar1;
*(undefined4 *)(param_1 + 0x5c) = 0;
iVar2 = isatty(0);
if (iVar2 == 0) {
param_1[0x10] = 0;
param_1[0xf] = 0;
}
else {
param_1[0x10] = 1;
param_1[0xf] = 0;
}
if (param_1[0x11] != '\0') {
param_1[0x10] = 0;
}
*param_1 = 1;
param_1[1] = 0;
*(undefined4 *)(param_1 + 8) = 0xffffffff;
*(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_1 + 8);
auVar5 = now();
*(long *)(param_1 + 0x18) = SUB168(auVar5,0);
*(long *)(param_1 + 0x20) = SUB168(auVar5 >> 0x40,0);
*(long *)(param_1 + 0x28) = *(long *)(param_1 + 0x18) + -0x15180;
*(undefined8 *)(param_1 + 0x30) = *(undefined8 *)(param_1 + 0x20);
param_1[0x38] = 0;
param_1[0xd] = 0;
param_1[0xe] = 0;
if (param_1[0x11] == '\0') {
*(undefined4 *)(param_1 + 0x3c) = 0x400;
}
else {
*(undefined4 *)(param_1 + 0x3c) = 0x200;
}
*(undefined8 *)(param_1 + 0x40) = 0;
*(undefined2 *)(param_1 + 0x68) = 2;
pcVar3 = getenv("FIND_BLOCK_SIZE");
if (pcVar3 != (char *)0x0) {
uVar4 = gettext(
"The environment variable FIND_BLOCK_SIZE is not supported, the only thing that affects the block size is the POSIXLY_CORRECT environment variable"
);
error(1,0,uVar4);
}
param_1[0xc] = 0;
set_follow_state(0);
*(undefined4 *)(param_1 + 0x6c) = 8;
*(undefined8 *)(param_1 + 0x70) = 0;
param_1[0x78] = 0;
return;
}
|
int
rl_abort (int count, int key)
{
return (_rl_abort_internal ());
}
|
long long rl_abort(unsigned long long a0, unsigned long long a1) {
unsigned int v0;
unsigned int v1;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
v1 = a0;
v0 = a1;
_rl_abort_internal(a0, a1, v3, v4, v5, v6);
}
|
static inline void
emit_mandatory_arg_note (void)
{
fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"),
stdout
)
;
}
|
void emit_mandatory_arg_note() {
unsigned long long v1;
v1 = fputs_unlocked(gettext("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout);
return;
}
|
static int do_ipnh_bucket(int argc, char **argv)
{
if (argc < 1)
return ipnh_bucket_list(0,
((void *)0)
);
if (!matches(*argv, "list") ||
!matches(*argv, "show") ||
!matches(*argv, "lst"))
return ipnh_bucket_list(argc-1, argv+1);
if (!matches(*argv, "get"))
return ipnh_bucket_get(argc-1, argv+1);
if (!matches(*argv, "help"))
usage();
fprintf(
stderr
,
"Command \"%s\" is unknown, try \"ip nexthop help\".\n", *argv);
exit(-1);
}
|
void do_ipnh_bucket(unsigned long a0, unsigned long long *a1) {
unsigned long long v1;
char v2;
char v3;
char v4;
unsigned long long v5;
char v6;
unsigned long long v7;
if (a0 <= 0) {
v1 = ipnh_bucket_list(0x0, 0x0);
} else {
v2 = matches(*(a1), "list") ^ 1;
if (!v2) {
v3 = matches(*(a1), "show") ^ 1;
if (!v3) {
v4 = matches(*(a1), "lst") ^ 1;
if (!v4) {
v6 = matches(*(a1), "get") ^ 1;
if (v6) {
v7 = ipnh_bucket_get(a0 - 1, a1 + 1);
} else if ((matches(*(a1), "help") ^ 1)) {
usage();
} else {
fprintf(stderr, "Command \"%s\" is unknown, try \"ip nexthop help\".\n", *(a1));
exit(0xffffffff);
}
}
}
}
if (v4 || v3 || v2)
v5 = ipnh_bucket_list(a0 - 1, a1 + 1);
}
if (a0 <= 0 || v4 || v6 || v3 || v2)
return;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.