input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
void
pkcs11_terminate(void)
{
if (fd >= 0)
close(fd);
}
| long long pkcs11_terminate() {
unsigned long long v1;
v1 = fd;
if (fd >= 0)
v1 = close(fd);
return v1;
}
|
static inline
_Bool
c_isspace(int c)
{
return c_isbits(c, C_CTYPE_SPACE);
}
| void c_isspace(undefined4 param_1)
{
c_isbits(param_1,4);
return;
}
|
static errcode_t e2fsck_journal_fix_corrupt_super(e2fsck_t ctx,
journal_t *journal,
struct problem_context *pctx)
{
struct ext2_super_block *sb = ctx->fs->super;
int recover = ext2fs_has_feature_journal_needs_recovery(ctx->fs->super);
if (ext2fs_has_feature_journal(sb)) {
if (fix_problem(ctx, 0x000015, pctx)) {
e2fsck_journal_reset_super(ctx, journal->j_superblock,
journal);
journal->j_transaction_sequence = 1;
e2fsck_clear_recover(ctx, recover);
return 0;
}
return (2133571504L);
} else if (e2fsck_journal_fix_bad_inode(ctx, pctx))
return (2133571504L);
return 0;
}
| long e2fsck_journal_fix_corrupt_super(_QWORD *a1, long a2, long a3)
{
int has_feature_journal_needs_recovery;
long v6;
v6 = *(_QWORD *)(*a1 + 32LL);
has_feature_journal_needs_recovery = ext2fs_has_feature_journal_needs_recovery(v6);
if ( ext2fs_has_feature_journal(v6) )
{
if ( (unsigned int)fix_problem(a1, 21LL, a3) )
{
e2fsck_journal_reset_super((long)a1, *(uint32_t **)(a2 + 24), a2);
*(_DWORD *)(a2 + 148) = 1;
e2fsck_clear_recover(a1, has_feature_journal_needs_recovery);
return 0LL;
}
else
{
return 2133571504LL;
}
}
else if ( e2fsck_journal_fix_bad_inode(a1, a3) )
{
return 2133571504LL;
}
else
{
return 0LL;
}
}
|
static void open_files (void)
{
if (pw_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, pw_dbname ());
fail_exit (1);
}
pw_locked =
1
;
if (pw_open (
0100
|
02
) == 0) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"), Prog, pw_dbname ());
fail_exit (1);
}
if (is_shadow_pwd) {
if (spw_lock () == 0) {
fprintf (
stderr
,
gettext ("%s: cannot lock %s; try again later.\n"),
Prog, spw_dbname ());
fail_exit (1);
}
spw_locked =
1
;
if (spw_open (
0100
|
02
) == 0) {
fprintf (
stderr
,
gettext ("%s: cannot open %s\n"),
Prog, spw_dbname ());
fail_exit (1);
}
}
}
| void open_files() {
unsigned long long v1;
unsigned long long v2;
unsigned long long v3;
unsigned long long v5;
unsigned long long v6;
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)) {
v3 = pw_dbname();
fprintf(*(&stderr), gettext("%s: cannot open %s\n"));
fail_exit(0x1);
}
v2 = is_shadow_pwd;
if (!is_shadow_pwd) {
return;
} else if (!spw_lock()) {
v5 = spw_dbname();
fprintf(*(&stderr), gettext("%s: cannot lock %s; try again later.\n"));
fail_exit(0x1);
} else {
spw_locked = 1;
if (!spw_open(0x42)) {
v6 = spw_dbname();
fprintf(*(&stderr), gettext("%s: cannot open %s\n"));
fail_exit(0x1);
}
return;
}
}
|
int
crossload_dir(struct sftp_conn *from, struct sftp_conn *to,
const char *from_path, const char *to_path,
Attrib *dirattrib, int preserve_flag, int print_flag, int follow_link_flag)
{
char *from_path_canon;
int ret;
if ((from_path_canon = do_realpath(from, from_path)) ==
((void *)0)
) {
sshlog("sftp-client.c", __func__, 2750, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "crossload \"%s\": path canonicalization failed", from_path)
;
return -1;
}
ret = crossload_dir_internal(from, to, from_path_canon, to_path, 0,
dirattrib, preserve_flag, print_flag, follow_link_flag);
free(from_path_canon);
return ret;
}
| long long crossload_dir(void* a0, void* a1, unsigned long long a2, char *a3, unsigned int a4, unsigned long a5, unsigned int v3, unsigned int a6) {
unsigned long v0;
unsigned int v1;
void* v2;
unsigned long long v4;
v2 = do_realpath(a0, a2);
if (!v2) {
v0 = a2;
sshlog("sftp-client.c", "crossload_dir", 0xabe, 0x0, 0x2, 0x0, "crossload \"%s\": path canonicalization failed");
v4 = 4294967295;
return v4;
}
v1 = crossload_dir_internal(a0, a1, v2, a3, 0x0, a4, a5, v3, a6);
free(v2);
v4 = v1;
return v4;
}
|
static
_Bool
dc_parse_stream (FILE *fp, char const *filename)
{
size_t line_number = 0;
char const *next_G_line = G_line;
char *input_line =
((void *)0)
;
size_t input_line_size = 0;
char const *line;
char const *term;
char const *colorterm;
_Bool
ok =
1
;
enum { ST_TERMNO, ST_TERMYES, ST_TERMSURE, ST_GLOBAL } state = ST_GLOBAL;
term = getenv ("TERM");
if (term ==
((void *)0)
|| *term == '\0')
term = "none";
colorterm = getenv ("COLORTERM");
if (colorterm ==
((void *)0)
)
colorterm = "";
while (
1
)
{
char *keywd, *arg;
_Bool
unrecognized;
++line_number;
if (fp)
{
if (getline (&input_line, &input_line_size, fp) <= 0)
{
free (input_line);
break;
}
line = input_line;
}
else
{
if (next_G_line == G_line + sizeof G_line)
break;
line = next_G_line;
next_G_line += strlen (next_G_line) + 1;
}
parse_line (line, &keywd, &arg);
if (keywd ==
((void *)0)
)
continue;
if (arg ==
((void *)0)
)
{
error (0, 0, gettext ("%s:%lu: invalid line; missing second token"),
quotearg_n_style_colon (0, shell_escape_quoting_style, filename), (unsigned long int) line_number);
ok =
0
;
free (keywd);
continue;
}
unrecognized =
0
;
if (c_strcasecmp (keywd, "TERM") == 0)
{
if (state != ST_TERMSURE)
state = fnmatch (arg, term, 0) == 0 ? ST_TERMSURE : ST_TERMNO;
}
else if (c_strcasecmp (keywd, "COLORTERM") == 0)
{
if (state != ST_TERMSURE)
state = fnmatch (arg, colorterm, 0) == 0 ? ST_TERMSURE : ST_TERMNO;
}
else
{
if (state == ST_TERMSURE)
state = ST_TERMYES;
if (state != ST_TERMNO)
{
if (keywd[0] == '.')
append_entry ('*', keywd, arg);
else if (keywd[0] == '*')
append_entry (0, keywd, arg);
else if (c_strcasecmp (keywd, "OPTIONS") == 0
|| c_strcasecmp (keywd, "COLOR") == 0
|| c_strcasecmp (keywd, "EIGHTBIT") == 0)
{
}
else
{
int i;
for (i = 0; slack_codes[i] !=
((void *)0)
; ++i)
if (c_strcasecmp (keywd, slack_codes[i]) == 0)
break;
if (slack_codes[i] !=
((void *)0)
)
append_entry (0, ls_codes[i], arg);
else
unrecognized =
1
;
}
}
else
unrecognized =
1
;
}
if (unrecognized && (state == ST_TERMSURE || state == ST_TERMYES))
{
error (0, 0, gettext ("%s:%lu: unrecognized keyword %s"),
(filename ? quotearg_n_style_colon (0, shell_escape_quoting_style, filename) : gettext ("<internal>")),
(unsigned long int) line_number, keywd);
ok =
0
;
}
free (keywd);
free (arg);
}
return ok;
}
| int dc_parse_stream(void* a0, unsigned long long a1) {
char v0;
char v1;
unsigned int v2;
unsigned int v3;
void* v4;
void* v5;
char v6;
char v7;
void* v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long v13;
unsigned long long *v15;
unsigned long long v16;
unsigned long long v19;
unsigned int v21;
unsigned int v22;
unsigned long long v27;
unsigned long long v28;
v13 = v15[5];
v8 = 0;
v9 = "# Configuration file for dircolors, a utility to help you set the";
v4 = 0;
v5 = 0;
v0 = 1;
v2 = 3;
v11 = getenv("TERM");
if (!*(v11) || !v11)
v11 = "none";
v12 = getenv("COLORTERM");
if (!v12)
v12 = &g_4016b3;
while (true) {
v8 += 1;
if (a0) {
v16 = getline(&v4, &v5, a0);
if (v16 <= 0) {
free(v4);
break;
} else {
v10 = v4;
}
} else {
if (v9 == "NORMAL")
break;
if (v9 != "NORMAL") {
v10 = v9;
v9 += strlen(v9) + 1;
}
}
if (!a0 || v16 > 0) {
parse_line(v10, &v6, &v7);
if (*(&v6)) {
if (!*(&v7)) {
v19 = quotearg_n_style_colon(0x0, 0x3, a1);
error(0x0, 0x0, gettext("%s:%lu: invalid line; missing second token"));
v0 = 0;
free(*(&v6));
} else {
v1 = 0;
if (!c_strcasecmp(*(&v6), "TERM")) {
if (v2 != 2) {
v21 = fnmatch(*(&v7), v11, 0x0);
if (!v21)
v21 = 2;
else
v21 = 0;
v2 = v21;
}
} else {
if (c_strcasecmp(*(&v6), "COLORTERM")) {
if (v2 == 2)
v2 = 1;
if (v2) {
if (*(*(&v6)) == 46) {
append_entry(0x2a, *(&v6), *(&v7));
} else {
if (*(*(&v6)) == 42) {
append_entry(0x0, *(&v6), *(&v7));
} else {
if (c_strcasecmp(*(&v6), "OPTIONS") && c_strcasecmp(*(&v6), "COLOR") && c_strcasecmp(*(&v6), "EIGHTBIT")) {
for (v3 = 0; slack_codes[v3]; v3 += 1) {
if (!c_strcasecmp(*(&v6), slack_codes[v3]))
break;
}
if (slack_codes[v3])
append_entry(0x0, (&ls_codes)[v3], *(&v7));
else
v1 = 1;
}
}
}
} else {
v1 = 1;
}
} else if (v2 != 2) {
v22 = fnmatch(*(&v7), v12, 0x0);
if (!v22)
v22 = 2;
else
v22 = 0;
v2 = v22;
}
}
if (v1 && (v2 == 1 || v2 == 2)) {
if (a1)
v28 = quotearg_n_style_colon(0x0, 0x3, a1);
else
v27 = gettext("<internal>");
error(0x0, 0x0, gettext("%s:%lu: unrecognized keyword %s"));
v0 = 0;
}
free(*(&v6));
free(*(&v7));
continue;
}
}
}
}
if ((v13 ^ v15[5]))
__stack_chk_fail();
return v0;
}
|
static inline __u16 rta_getattr_u16(const struct rtattr *rta)
{
return *(__u16 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| int rta_getattr_u16(struct_0 *a0) {
return a0->field_4;
}
|
int
main(int argc, char **argv)
{
int ch, fflag, tflag, status, n;
char **newargv, *argv0;
const char *errstr;
enum scp_mode_e mode = MODE_SFTP;
char *sftp_direct =
((void *)0)
;
sanitise_stdfd();
msetlocale();
argv0 = argv[0];
newargv = xcalloc((((argc + 1) > (1)) ? (argc + 1) : (1)), sizeof(*newargv));
for (n = 0; n < argc; n++)
newargv[n] = xstrdup(argv[n]);
argv = newargv;
__progname = ssh_get_progname(argv[0]);
log_init(argv0, log_level, SYSLOG_FACILITY_USER, 2);
memset(&args, '\0', sizeof(args));
memset(&remote_remote_args, '\0', sizeof(remote_remote_args));
args.list = remote_remote_args.list =
((void *)0)
;
addargs(&args, "%s", ssh_program);
addargs(&args, "-x");
addargs(&args, "-oPermitLocalCommand=no");
addargs(&args, "-oClearAllForwardings=yes");
addargs(&args, "-oRemoteCommand=none");
addargs(&args, "-oRequestTTY=no");
fflag = Tflag = tflag = 0;
while ((ch = BSDgetopt(argc, argv, "12346ABCTdfOpqRrstvD:F:J:M:P:S:c:i:l:o:")
) != -1) {
switch (ch) {
case '1':
sshfatal("scp.c", __func__, 487, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "SSH protocol v.1 is no longer supported");
break;
case '2':
break;
case 'A':
case '4':
case '6':
case 'C':
addargs(&args, "-%c", ch);
addargs(&remote_remote_args, "-%c", ch);
break;
case 'D':
sftp_direct = BSDoptarg;
break;
case '3':
throughlocal = 1;
break;
case 'R':
throughlocal = 0;
break;
case 'o':
case 'c':
case 'i':
case 'F':
case 'J':
addargs(&remote_remote_args, "-%c", ch);
addargs(&remote_remote_args, "%s", BSDoptarg);
addargs(&args, "-%c", ch);
addargs(&args, "%s", BSDoptarg);
break;
case 'O':
mode = MODE_SCP;
break;
case 's':
mode = MODE_SFTP;
break;
case 'P':
sshport = a2port(BSDoptarg);
if (sshport <= 0)
sshfatal("scp.c", __func__, 527, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "bad port \"%s\"\n", BSDoptarg);
break;
case 'B':
addargs(&remote_remote_args, "-oBatchmode=yes");
addargs(&args, "-oBatchmode=yes");
break;
case 'l':
limit_kbps = strtonum(BSDoptarg, 1, 100 * 1024 * 1024,
&errstr);
if (errstr !=
((void *)0)
)
usage();
limit_kbps *= 1024;
bandwidth_limit_init(&bwlimit, limit_kbps, 16384);
break;
case 'p':
pflag = 1;
break;
case 'r':
iamrecursive = 1;
break;
case 'S':
ssh_program = xstrdup(BSDoptarg);
break;
case 'v':
addargs(&args, "-v");
addargs(&remote_remote_args, "-v");
if (verbose_mode == 0)
log_level = SYSLOG_LEVEL_DEBUG1;
else if (log_level < SYSLOG_LEVEL_DEBUG3)
log_level++;
verbose_mode = 1;
break;
case 'q':
addargs(&args, "-q");
addargs(&remote_remote_args, "-q");
showprogress = 0;
break;
case 'd':
targetshouldbedirectory = 1;
break;
case 'f':
iamremote = 1;
fflag = 1;
break;
case 't':
iamremote = 1;
tflag = 1;
break;
case 'T':
Tflag = 1;
break;
default:
usage();
}
}
argc -= BSDoptind;
argv += BSDoptind;
log_init(argv0, log_level, SYSLOG_FACILITY_USER, 2);
addargs(&args, "-oForwardAgent=no");
if (iamremote)
mode = MODE_SCP;
if ((pwd = getpwuid(userid = getuid())) ==
((void *)0)
)
sshfatal("scp.c", __func__, 599, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "unknown user %u", (u_int) userid);
if (!isatty(
1
))
showprogress = 0;
if (pflag) {
} else {
if (pledge("stdio rpath wpath cpath fattr tty proc exec",
((void *)0)
) == -1) {
perror("pledge");
exit(1);
}
}
remin =
0
;
remout =
1
;
if (fflag) {
(void) response();
source(argc, argv);
exit(errs != 0);
}
if (tflag) {
sink(argc, argv,
((void *)0)
);
exit(errs != 0);
}
if (argc < 2)
usage();
if (argc > 2)
targetshouldbedirectory = 1;
remin = remout = -1;
do_cmd_pid = -1;
(void) snprintf(cmd, sizeof cmd, "scp%s%s%s%s",
verbose_mode ? " -v" : "",
iamrecursive ? " -r" : "", pflag ? " -p" : "",
targetshouldbedirectory ? " -d" : "");
(void) ssh_signal(
13
, lostconn);
if (colon(argv[argc - 1]))
toremote(argc, argv, mode, sftp_direct);
else {
if (targetshouldbedirectory)
verifydir(argv[argc - 1]);
tolocal(argc, argv, mode, sftp_direct);
}
if (do_cmd_pid != -1 && (mode == MODE_SFTP || errs == 0)) {
if (remin != -1)
(void) close(remin);
if (remout != -1)
(void) close(remout);
if (waitpid(do_cmd_pid, &status, 0) == -1)
errs = 1;
else {
if (!
(((
status
) & 0x7f) == 0)
||
(((
status
) & 0xff00) >> 8)
!= 0)
errs = 1;
}
}
exit(errs != 0);
}
| int main(unsigned long long a0, unsigned long long a1) {
unsigned long long *v0;
unsigned int v1;
char v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
char v8;
void* v9;
unsigned long long v10;
unsigned long long *v11;
unsigned long v12;
unsigned long long v13;
unsigned long long v14;
unsigned long v16;
unsigned long long *v17;
unsigned long long v18;
unsigned long long v19;
unsigned long long v20;
unsigned long long v21;
unsigned long long v22;
struct_0 *v23;
unsigned long long v24;
unsigned long long v26;
unsigned long long v27;
unsigned long long v28;
unsigned long long v29;
v13 = v16;
v1 = a0;
v0 = a1;
v12 = v17[5];
v6 = 1;
v9 = 0;
sanitise_stdfd();
msetlocale(a0, a1, v18, v19, v20, v21);
v10 = *(v0);
v22 = __addvsi3(v1, 0x1);
if (v22 <= 0)
v22 = 1;
v11 = xcalloc(v22, 0x8, 0x1);
for (v5 = 0; v5 < v1; v5 = __addvsi3(v5, 0x1)) {
v11[v5] = xstrdup(v0[v5]);
}
v0 = v11;
__progname = ssh_get_progname(*(v0));
log_init(v10, log_level, 0x1, 0x2);
memset(&remote_remote_args, 0x0, 0x10);
memset(&remote_remote_args, 0x0, 0x10);
remote_remote_args = 0;
remote_remote_args = 142007424292452101;
addargs(&remote_remote_args, "%s");
addargs(&remote_remote_args, "-x");
addargs(&remote_remote_args, "-oPermitLocalCommand=no");
addargs(&remote_remote_args, "-oClearAllForwardings=yes");
addargs(&remote_remote_args, "-oRemoteCommand=none");
addargs(&remote_remote_args, "-oRequestTTY=no");
v4 = 0;
targetshouldbedirectory = v4;
v3 = 1219493948222425173;
if (true) {
while (true) {
v7 = BSDgetopt(v1, v0, "12346ABCTdfOpqRrstvD:F:J:M:P:S:c:i:l:o:", v0);
if (v7 != -1) {
v23 = __addvsi3(v7, 0xffffffcf);
switch (v23) {
case 0:
v13 = "SSH protocol v.1 is no longer supported";
sshfatal("scp.c", "main", 0x1e7, 0x0, 0x1, 0x0);
case 1:
break;
case 2:
throughlocal = 1;
break;
case 3: case 5: case 16: case 18:
addargs(&remote_remote_args, "-%c");
addargs(&remote_remote_args, "-%c");
break;
case 17:
addargs(&remote_remote_args, "-oBatchmode=yes");
addargs(&remote_remote_args, "-oBatchmode=yes");
break;
case 19:
v9 = *(&BSDoptarg);
break;
case 21: case 25: case 50: case 56: case 62:
addargs(&remote_remote_args, "-%c");
addargs(&remote_remote_args, "%s");
addargs(&remote_remote_args, "-%c");
addargs(&remote_remote_args, "%s");
break;
case 30:
v6 = 0;
break;
case 31:
sshport = a2port(*(&BSDoptarg));
if (sshport > 0)
continue;
v14 = *(&BSDoptarg);
v13 = "bad port \"%s\"\n";
sshfatal("scp.c", "main", 0x20f, 0x0, 0x1, 0x0);
case 33:
throughlocal = 0;
break;
case 34:
ssh_program = xstrdup(*(&BSDoptarg));
break;
case 35:
targetshouldbedirectory = 1;
break;
case 51:
targetshouldbedirectory = 1;
break;
case 53:
targetshouldbedirectory = 1;
v3 = 1;
break;
case 59:
limit_kbps = strtonum(*(&BSDoptarg), 0x1, 0x6400000, &v8);
if (*(&v8))
usage();
limit_kbps = __mulvdi3(limit_kbps, 0x400);
bandwidth_limit_init(&cmd, limit_kbps, 0x4000);
break;
case 63:
targetshouldbedirectory = 1;
break;
case 64:
addargs(&remote_remote_args, "-q");
addargs(&remote_remote_args, "-q");
showprogress = 0;
break;
case 65:
targetshouldbedirectory = 1;
break;
case 66:
v6 = 1;
break;
case 67:
targetshouldbedirectory = 1;
v4 = 1;
break;
case 69:
addargs(&remote_remote_args, "-v");
addargs(&remote_remote_args, "-v");
if (!verbose_mode) {
log_level = 5;
} else if (log_level <= 6) {
log_level = __addvsi3(log_level, 0x1);
}
verbose_mode = 1;
break;
default:
usage();
}
if (v23 <= 69)
v24 = *((0x4 * &v23->padding_0[0] + &g_406e80)) + &g_406e80;
} else {
v1 = __subvsi3(v1, BSDoptind);
v0 = &v0[BSDoptind];
log_init(v10, log_level, 0x1, 0x2);
addargs(&remote_remote_args, "-oForwardAgent=no");
v6 = 0;
targetshouldbedirectory = getuid();
pwd = getpwuid(0xe5894855);
if (true)
break;
if (false) {
v14 = 1219493948222425173;
v13 = "unknown user %u";
sshfatal("scp.c", "main", 0x257, 0x0, 0x1, 0x0);
break;
}
}
}
}
if (!isatty(0x1))
showprogress = 0;
if (false) {
v26 = pledge("stdio rpath wpath cpath fattr tty proc exec", 0x0);
perror("pledge");
exit(0x1);
}
targetshouldbedirectory = 0;
targetshouldbedirectory = 1;
if (v3) {
response();
source(v1, v0);
exit(1219493948222425173);
} else if (v4) {
sink(v1, v0, 0x0);
exit(1219493948222425173);
} else if (v1 <= 1) {
usage();
} else {
if (v1 > 2)
targetshouldbedirectory = 1;
targetshouldbedirectory = -1;
targetshouldbedirectory = 1219493948222425173;
do_cmd_pid = -1;
v27 = " -d";
if (false)
v27 = &g_406e67;
v28 = " -p";
if (false)
v28 = &g_406e67;
v29 = " -r";
if (false)
v29 = &g_406e67;
v13 = v27;
snprintf(&cmd, 0x40, "scp%s%s%s%s");
ssh_signal(0xd, lostconn);
if (colon(v0[__addvsi3(v1, 0xffffffff)])) {
toremote(v1, v0, v6, v9, v29, v28);
} else {
verifydir(v0[__addvsi3(v1, 0xffffffff)]);
tolocal(v1, v0, v6, v9, v29, v28);
}
if (do_cmd_pid != -1 && v6 == 1) {
close(0xe5894855);
close(0xe5894855);
if (waitpid(do_cmd_pid, &v2, 0x0) == -1) {
targetshouldbedirectory = 1;
} else if ((*(&v2) & 127) || (*(&v2) >> 8)) {
targetshouldbedirectory = 1;
}
}
exit(1219493948222425173);
}
}
|
void
sys_wait_for_child (pid_t child_pid,
_Bool
eof)
{
if (child_pid)
{
int wait_status;
while (waitpid (child_pid, &wait_status, 0) == -1)
if (
(*__errno_location ())
!=
4
)
{
waitpid_error (use_compress_program_option);
break;
}
if (
(((signed char) (((
wait_status
) & 0x7f) + 1) >> 1) > 0)
)
{
int sig =
((
wait_status
) & 0x7f)
;
if (!(!eof && sig ==
13
))
do { if (error_hook) error_hook (); error (0, 0, gettext ("Child died with signal %d"), sig); fatal_exit (); } while (0);
}
else if (
(((
wait_status
) & 0xff00) >> 8)
!= 0)
do { if (error_hook) error_hook (); error (0, 0, gettext ("Child returned status %d"),
(((
wait_status
) & 0xff00) >> 8)
); fatal_exit (); } while (0)
;
}
}
| long long sys_wait_for_child(unsigned long a0, unsigned long long a1, unsigned long long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) {
char v0;
unsigned int v1;
unsigned long long v3;
if (a0) {
while (true) {
v3 = waitpid(a0, &v0, 0x0);
if (v3 != -1)
break;
*(&v3) = *(__errno_location());
if (v3 == 4)
continue;
waitpid_error(use_compress_program_option);
break;
}
if (((*(&v0) & 127) + 1 >> 1) > 0) {
v1 = *(&v0) & 127;
if (v1 != 13 || a1) {
if (error_hook)
*(5243000)();
a1 = 0;
error(0x0, 0x0, gettext("Child died with signal %d"));
fatal_exit(0x0, reg_64, a2, v1, a4, a5);
}
}
if ((((*(&v0) & 127) + 1 >> 1) <= 0 || v1 != 13 || a1) && (*(&v0) >> 8)) {
if (error_hook)
*(5243000)();
a1 = 0;
error(0x0, 0x0, gettext("Child returned status %d"));
fatal_exit(0x0, a1, a2, *(&v0) >> 8, a4, a5);
}
}
return 0;
}
|
, "channel %d packet type 0x%08x len %zu", c->self, type, sshbuf_len(in))
;
if (type == 0x00000001)
rid = 0;
else {
if (!state->hello_rcvd) {
sshlog("mux.c", __func__, 1181, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "expected MUX_MSG_HELLO(0x%08x), " "received 0x%08x", 0x00000001, type)
;
goto out;
}
if ((r = sshbuf_get_u32(in, &rid)) != 0)
goto malf;
}
| void sshbuf_len(void)
{
halt_baddata();
}
|
static
_Bool
src_to_dest_compare (void const *x, void const *y)
{
struct Src_to_dest const *a = x;
struct Src_to_dest const *b = y;
return ((*a).st_ino == (*b).st_ino && (*a).st_dev == (*b).st_dev) ?
1
:
0
;
}
| long long src_to_dest_compare(unsigned long long a0[2], unsigned long long a1[2]) {
unsigned int v1;
unsigned long long v2;
if (a0[0] == a1[0] && a0[1] == a1[1]) {
v1 = 1;
goto LABEL_400081;
}
v1 = 0;
LABEL_400081:
v2 = v1 & 1;
return v2;
}
|
_Bool
is_dumpdir (struct tar_stat_info *stat_info)
{
if (stat_info->is_dumpdir && !stat_info->dumpdir)
get_gnu_dumpdir (stat_info);
return stat_info->is_dumpdir;
}
| undefined is_dumpdir(long param_1)
{
if ((*(char *)(param_1 + 0x188) != '\0') && (*(long *)(param_1 + 400) == 0)) {
get_gnu_dumpdir(param_1);
}
return *(undefined *)(param_1 + 0x188);
}
|
prompt_print(EditLine *el, int op)
{
el_prompt_t *elp;
wchar_t *p;
if (op == 0)
elp = &el->el_prompt;
else
elp = &el->el_rprompt;
if (elp->p_wide)
p = (*elp->p_func)(el);
else
p = ct_decode_string((char *)(void *)(*elp->p_func)(el),
&el->el_scratch);
for (; *p; p++) {
if (elp->p_ignore == *p) {
wchar_t *litstart = ++p;
while (*p && *p != elp->p_ignore)
p++;
if (!*p || !p[1]) {
break;
}
re_putliteral(el, litstart, p++);
continue;
}
re_putc(el, *p, 1);
}
elp->p_pos.v = el->el_refresh.r_cursor.v;
elp->p_pos.h = el->el_refresh.r_cursor.h;
}
| void prompt_print(long param_1,int param_2)
{
int *piVar1;
undefined8 uVar2;
code **local_30;
int *local_28;
if (param_2 == 0) {
local_30 = (code **)(param_1 + 800);
}
else {
local_30 = (code **)(param_1 + 0x338);
}
if (*(int *)((long)local_30 + 0x14) == 0) {
uVar2 = (**local_30)(param_1);
local_28 = (int *)ct_decode_string(uVar2,param_1 + 0x4e8);
}
else {
local_28 = (int *)(**local_30)(param_1);
}
for (; *local_28 != 0; local_28 = local_28 + 1) {
if (*(int *)(local_30 + 2) == *local_28) {
piVar1 = local_28 + 1;
for (local_28 = piVar1; (*local_28 != 0 && (*local_28 != *(int *)(local_30 + 2)));
local_28 = local_28 + 1) {
}
if ((*local_28 == 0) || (local_28[1] == 0)) break;
re_putliteral(param_1,piVar1,local_28);
local_28 = local_28 + 1;
}
else {
re_putc(param_1,*local_28,1);
}
}
*(undefined4 *)((long)local_30 + 0xc) = *(undefined4 *)(param_1 + 0x314);
*(undefined4 *)(local_30 + 1) = *(undefined4 *)(param_1 + 0x310);
return;
}
|
static int
do_print_resource_record(struct passwd *pw, char *fname, char *hname,
int print_generic)
{
struct sshkey *public;
char *comment =
((void *)0)
;
struct stat st;
int r;
if (fname ==
((void *)0)
)
sshfatal("ssh-keygen.c", __func__, 1490, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "no filename");
if (stat(fname, &st) == -1) {
if (
(*__errno_location ())
==
2
)
return 0;
sshfatal("ssh-keygen.c", __func__, 1494, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: %s", fname, strerror(
(*__errno_location ())
));
}
if ((r = sshkey_load_public(fname, &public, &comment)) != 0)
sshfatal("ssh-keygen.c", __func__, 1497, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "Failed to read v2 public key from \"%s\"", fname);
export_dns_rr(hname, public,
stdout
, print_generic);
sshkey_free(public);
free(comment);
return 1;
}
| int do_print_resource_record(unsigned long a0, char *a1, unsigned long long a2, unsigned long a3) {
unsigned long v0;
unsigned int v1;
char v2;
void* v3;
char v4;
unsigned long long v5;
unsigned long v6;
unsigned long long v7;
unsigned long v8;
char v9;
unsigned int v12;
v0 = a0;
v3 = 0;
if (!a1)
sshfatal("ssh-keygen.c", "do_print_resource_record", 0x5d2, 0x1, 0x1, 0x0, "no filename");
if (stat(a1, &v4) == -1) {
if (*(__errno_location()) == 2) {
v12 = 0;
goto LABEL_4056bf;
} else {
v7 = strerror(*(__errno_location()));
v6 = a1;
v5 = "%s: %s";
sshfatal("ssh-keygen.c", "do_print_resource_record", 0x5d6, 0x0, 0x1, 0x0, *(&v9));
}
}
v1 = sshkey_load_public(a1, &v2, &v3);
if (v1) {
v8 = a1;
v7 = "Failed to read v2 public key from \"%s\"";
sshfatal("ssh-keygen.c", "do_print_resource_record", 0x5d9, 0x0, 0x1, ssh_err(v1), *(&v9));
}
export_dns_rr(a2, *(&v2), stdout, a3);
sshkey_free(*(&v2));
free(v3);
v12 = 1;
LABEL_4056bf:
return v12;
}
|
static void usage (int status)
{
FILE *usageout = (
0
!= status) ?
stderr
:
stdout
;
(void) fprintf (usageout,
gettext ("Usage: %s [options]\n" "\n" "Options:\n")
,
Prog);
(void) fputs (gettext (" -b, --before DAYS print only lastlog records older than DAYS\n"), usageout);
(void) fputs (gettext (" -C, --clear clear lastlog record of an user (usable only with -u)\n"), usageout);
(void) fputs (gettext (" -h, --help display this help message and exit\n"), usageout);
(void) fputs (gettext (" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
(void) fputs (gettext (" -S, --set set lastlog record to current time (usable only with -u)\n"), usageout);
(void) fputs (gettext (" -t, --time DAYS print only lastlog records more recent than DAYS\n"), usageout);
(void) fputs (gettext (" -u, --user LOGIN print lastlog record of the specified LOGIN\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;
FILE *stream;
if ( a1 )
v1 = stderr;
else
v1 = stdout;
stream = v1;
v2 = Prog;
v3 = gettext("Usage: %s [options]\n\nOptions:\n");
fprintf(stream, v3, v2);
v4 = gettext(" -b, --before DAYS print only lastlog records older than DAYS\n");
fputs(v4, stream);
v5 = gettext(" -C, --clear clear lastlog record of an user (usable only with -u)\n");
fputs(v5, stream);
v6 = gettext(" -h, --help display this help message and exit\n");
fputs(v6, stream);
v7 = gettext(" -R, --root CHROOT_DIR directory to chroot into\n");
fputs(v7, stream);
v8 = gettext(" -S, --set set lastlog record to current time (usable only with -u)\n");
fputs(v8, stream);
v9 = gettext(" -t, --time DAYS print only lastlog records more recent than DAYS\n");
fputs(v9, stream);
v10 = gettext(" -u, --user LOGIN print lastlog record of the specified LOGIN\n");
fputs(v10, stream);
fputs("\n", stream);
exit(a1);
}
|
static float calc_percent(struct percent_tbl *tbl, int pass, int curr,
int max)
{
float percent;
if (pass <= 0)
return 0.0;
if (pass > tbl->max_pass || max == 0)
return 100.0;
percent = ((float) curr) / ((float) max);
return ((percent * (tbl->table[pass] - tbl->table[pass-1]))
+ tbl->table[pass-1]);
}
| void calc_percent(void)
{
return;
}
|
void
usage (int status)
{
if (status !=
0
)
do { fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
else
{
printf (gettext ("Usage: %s [OPTION]... NAME TYPE [MAJOR MINOR]\n"),
program_name);
fputs_unlocked (gettext ("Create the special file NAME of the given TYPE.\n"),
stdout
)
;
emit_mandatory_arg_note ();
fputs_unlocked (gettext (" -m, --mode=MODE set file permission bits to MODE, not a=rw - umask\n"),
stdout
)
;
fputs_unlocked (gettext (" -Z set the SELinux security context to default type\n --context[=CTX] like -Z, or if CTX is specified then set the SELinux\n or SMACK security context to CTX\n"),
stdout
)
;
fputs_unlocked (gettext (" --help display this help and exit\n"),
stdout
);
fputs_unlocked (gettext (" --version output version information and exit\n"),
stdout
);
fputs_unlocked (gettext ("\nBoth MAJOR and MINOR must be specified when TYPE is b, c, or u, and they\nmust be omitted when TYPE is p. If MAJOR or MINOR begins with 0x or 0X,\nit is interpreted as hexadecimal; otherwise, if it begins with 0, as octal;\notherwise, as decimal. TYPE may be:\n"),
stdout
)
;
fputs_unlocked (gettext ("\n b create a block (buffered) special file\n c, u create a character (unbuffered) special file\n p create a FIFO\n"),
stdout
)
;
printf (gettext ("\n" "NOTE: your shell may have its own version of %s, which usually supersedes\n" "the version described here. Please refer to your shell's documentation\n" "for details about the options it supports.\n"), "mknod");
emit_ancillary_info ("mknod");
}
exit (status);
}
| void usage(int param_1)
{
FILE *pFVar1;
undefined8 uVar2;
char *pcVar3;
uVar2 = program_name;
if (param_1 == 0) {
pcVar3 = (char *)gettext("Usage: %s [OPTION]... NAME TYPE [MAJOR MINOR]\n");
printf(pcVar3,uVar2);
pFVar1 = stdout;
pcVar3 = (char *)gettext("Create the special file NAME of the given TYPE.\n");
fputs_unlocked(pcVar3,pFVar1);
emit_mandatory_arg_note();
pFVar1 = stdout;
pcVar3 = (char *)gettext(
" -m, --mode=MODE set file permission bits to MODE, not a=rw - umask\n"
);
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(
" -Z set the SELinux security context to default type\n --context[=CTX] like -Z, or if CTX is specified then set the SELinux\n or SMACK security context to CTX\n"
);
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(" --help display this help and exit\n");
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(" --version output version information and exit\n");
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(
"\nBoth MAJOR and MINOR must be specified when TYPE is b, c, or u, and they\nmust be omitted when TYPE is p. If MAJOR or MINOR begins with 0x or 0X,\nit is interpreted as hexadecimal; otherwise, if it begins with 0, as octal;\notherwise, as decimal. TYPE may be:\n"
);
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(
"\n b create a block (buffered) special file\n c, u create a character (unbuffered) special file\n p create a FIFO\n"
);
fputs_unlocked(pcVar3,pFVar1);
pcVar3 = (char *)gettext(
"\nNOTE: your shell may have its own version of %s, which usually supersedes\nthe version described here. Please refer to your shell\'s documentation\nfor details about the options it supports.\n"
);
printf(pcVar3,"mknod");
emit_ancillary_info();
}
else {
pcVar3 = (char *)gettext("Try \'%s --help\' for more information.\n");
fprintf(stderr,pcVar3,uVar2);
}
exit(param_1);
}
|
void
print_for_command_head (for_command)
FOR_COM *for_command;
{
cprintf ("for %s in ", for_command->name->word);
command_print_word_list (for_command->map_list, " ");
}
| long * print_for_command_head(long a1, long a2, long a3, long a4, long a5, long a6)
{
cprintf("for %s in ", **(_QWORD **)(a1 + 8), a3, a4, a5, a6);
return command_print_word_list(*(long **)(a1 + 16), " ");
}
|
static long scale_age (long x)
{
if (x <= 0) {
return x;
}
return x * ((24L*3600L) / (24L*3600L));
}
| int scale_age(unsigned long a0) {
unsigned int v1;
if (a0 <= 0)
v1 = a0;
else
v1 = a0;
return v1;
}
|
static void
send_msg(struct sshbuf *m)
{
int r;
if ((r = sshbuf_put_stringb(oqueue, m)) != 0)
sshfatal("sftp-server.c", __func__, 526, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "enqueue");
sshbuf_reset(m);
}
| void send_msg(undefined8 param_1)
{
undefined8 uVar1;
char **ppcVar2;
char *pcStack56;
undefined8 uStack48;
undefined auStack40 [8];
undefined8 local_20;
int local_c;
ppcVar2 = (char **)auStack40;
uStack48 = 0x100ef6;
local_20 = param_1;
local_c = sshbuf_put_stringb(oqueue,param_1);
if (local_c != 0) {
uStack48 = 0x100f09;
uVar1 = ssh_err(local_c);
ppcVar2 = &pcStack56;
pcStack56 = "enqueue";
sshfatal("sftp-server.c","send_msg",0x20e,1,1,uVar1);
}
*(undefined8 *)((long)ppcVar2 + -8) = 0x100f4c;
sshbuf_reset(local_20);
return;
}
|
static void
channel_prepare_pollfd(Channel *c, u_int *next_pollfd,
struct pollfd *pfd, u_int npfd)
{
u_int ev, p = *next_pollfd;
if (c ==
((void *)0)
)
return;
if (p + 4 > npfd) {
sshfatal("channels.c", __func__, 2511, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "channel %d: bad pfd offset %u (max %u)", c->self, p, npfd)
;
}
c->pfds[0] = c->pfds[1] = c->pfds[2] = c->pfds[3] = -1;
if (c->rfd != -1) {
ev = 0;
if ((c->io_want & 0x01) != 0)
ev |=
0x001
;
if (c->wfd == c->rfd) {
if ((c->io_want & 0x02) != 0)
ev |=
0x004
;
}
if (c->efd == c->rfd) {
if ((c->io_want & 0x04) != 0)
ev |=
0x001
;
if ((c->io_want & 0x08) != 0)
ev |=
0x004
;
}
if (c->sock == c->rfd) {
if ((c->io_want & 0x10) != 0)
ev |=
0x001
;
if ((c->io_want & 0x20) != 0)
ev |=
0x004
;
}
if (ev != 0) {
c->pfds[0] = p;
pfd[p].fd = c->rfd;
pfd[p].events = ev;
dump_channel_poll(__func__, "rfd", c, p, &pfd[p]);
p++;
}
}
if (c->wfd != -1 && c->rfd != c->wfd) {
ev = 0;
if ((c->io_want & 0x02))
ev |=
0x004
;
if (ev != 0) {
c->pfds[1] = p;
pfd[p].fd = c->wfd;
pfd[p].events = ev;
dump_channel_poll(__func__, "wfd", c, p, &pfd[p]);
p++;
}
}
if (c->efd != -1 && c->rfd != c->efd) {
ev = 0;
if ((c->io_want & 0x04) != 0)
ev |=
0x001
;
if ((c->io_want & 0x08) != 0)
ev |=
0x004
;
if (ev != 0) {
c->pfds[2] = p;
pfd[p].fd = c->efd;
pfd[p].events = ev;
dump_channel_poll(__func__, "efd", c, p, &pfd[p]);
p++;
}
}
if (c->sock != -1 && c->rfd != c->sock) {
ev = 0;
if ((c->io_want & 0x10) != 0)
ev |=
0x001
;
if ((c->io_want & 0x20) != 0)
ev |=
0x004
;
if (ev != 0) {
c->pfds[3] = p;
pfd[p].fd = c->sock;
pfd[p].events = 0;
dump_channel_poll(__func__, "sock", c, p, &pfd[p]);
p++;
}
}
*next_pollfd = p;
}
| void channel_prepare_pollfd(unsigned int a0[17], unsigned int *a1, unsigned int *a2, unsigned long a3) {
unsigned long long v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned int v4;
unsigned int v5;
unsigned long long v7;
unsigned int *v8;
v7 = *(a1);
v5 = *(a1);
if (!a0)
return;
if (a3 < v5 + 4) {
v3 = a3;
v2 = v5;
v1 = a0[1];
v0 = "channel %d: bad pfd offset %u (max %u)";
sshfatal("channels.c", "channel_prepare_pollfd", 0x9cf, 0x1, 0x1, 0x0);
}
a0[16] = -1;
a0[15] = a0[16];
a0[14] = a0[15];
a0[13] = a0[14];
if (a0[7] != -1) {
v4 = 0;
if ((a0[11] & 1))
v4 |= 1;
if (a0[8] == a0[7] && (a0[11] & 2))
v4 |= 4;
if (a0[9] == a0[7]) {
if ((a0[11] & 4))
v4 |= 1;
if ((a0[11] & 8))
v4 |= 4;
}
if (a0[10] == a0[7]) {
if ((a0[11] & 16))
v4 |= 1;
if ((a0[11] & 32))
v4 |= 4;
}
if (v4) {
a0[13] = v5;
a2[2 * v5] = a0[7];
*(&a2[1 + 2 * v5]) = v4;
dump_channel_poll("channel_prepare_pollfd", "rfd", a0, v5, &a2[2 * v5]);
v5 += 1;
}
}
if (a0[8] != -1 && a0[7] != a0[8]) {
v4 = 0;
if ((a0[11] & 2))
v4 |= 4;
if (v4) {
a0[14] = v5;
a2[2 * v5] = a0[8];
*(&a2[1 + 2 * v5]) = v4;
dump_channel_poll("channel_prepare_pollfd", "wfd", a0, v5, &a2[2 * v5]);
v5 += 1;
}
}
if (a0[9] != -1 && a0[7] != a0[9]) {
v4 = 0;
if ((a0[11] & 4))
v4 |= 1;
if ((a0[11] & 8))
v4 |= 4;
if (v4) {
a0[15] = v5;
a2[2 * v5] = a0[9];
*(&a2[1 + 2 * v5]) = v4;
dump_channel_poll("channel_prepare_pollfd", "efd", a0, v5, &a2[2 * v5]);
v5 += 1;
}
}
if (a0[10] != -1 && a0[7] != a0[10]) {
v4 = 0;
if ((a0[11] & 16))
v4 |= 1;
if ((a0[11] & 32))
v4 |= 4;
if (v4) {
a0[16] = v5;
a2[2 * v5] = a0[10];
*(&a2[1 + 2 * v5]) = 0;
dump_channel_poll("channel_prepare_pollfd", "sock", a0, v5, &a2[2 * v5]);
v5 += 1;
}
}
v8 = a1;
*(a1) = v5;
return;
}
|
static
_Bool
check_sparse_region (struct tar_sparse_file *file, off_t beg, off_t end)
{
if (!lseek_or_error (file, beg))
return
0
;
while (beg < end)
{
size_t bytes_read;
size_t rdsize = 512 < end - beg ? 512 : end - beg;
char diff_buffer[512];
bytes_read = safe_read (file->fd, diff_buffer, rdsize);
if (bytes_read == ((size_t) -1))
{
read_diag_details (file->stat_info->orig_file_name,
beg,
rdsize);
return
0
;
}
else if (bytes_read == 0)
{
report_difference (file->stat_info, gettext ("Size differs"));
return
0
;
}
if (!zero_block_p (diff_buffer, bytes_read))
{
char begbuf[((((((sizeof (off_t) * 8) - (! ((__typeof__ (off_t)) 0 < (__typeof__ (off_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (off_t)) 0 < (__typeof__ (off_t)) -1))) + 1)];
report_difference (file->stat_info,
gettext ("File fragment at %s is not a hole"),
offtostr (beg, begbuf));
return
0
;
}
beg += bytes_read;
}
return
1
;
}
| long check_sparse_region(unsigned int *a1, __off_t a2, __off_t a3)
{
long v4;
char *v5;
long v6;
char *v7;
__off_t v9;
long v10;
long v11;
char v12[32];
char v13[520];
unsigned long v14;
v9 = a2;
v14 = __readfsqword(0x28u);
if ( (unsigned char)lseek_or_error((long)a1, a2) != 1 )
return 0LL;
while ( v9 < a3 )
{
v4 = a3 - v9;
if ( a3 - v9 > 512 )
v4 = 512LL;
v10 = v4;
v11 = safe_read(*a1, v13, v4);
if ( v11 == -1 )
{
read_diag_details(**((_QWORD **)a1 + 3), v9, v10);
return 0LL;
}
if ( !v11 )
{
v5 = gettext("Size differs");
report_difference(*((_QWORD *)a1 + 3), v5, v5);
return 0LL;
}
if ( (unsigned char)zero_block_p(v13, v11) != 1 )
{
v6 = offtostr(v9, v12);
v7 = gettext("File fragment at %s is not a hole");
report_difference(*((_QWORD *)a1 + 3), v7, v6);
return 0LL;
}
v9 += v11;
}
return 1LL;
}
|
static void
filter_mount_list (
_Bool
devices_only)
{
struct mount_entry *me;
struct devlist *device_list =
((void *)0)
;
int mount_list_size = 0;
for (me = mount_list; me; me = me->me_next)
mount_list_size++;
devlist_table = hash_initialize (mount_list_size,
((void *)0)
,
devlist_hash, devlist_compare,
((void *)0)
);
if (devlist_table ==
((void *)0)
)
xalloc_die ();
for (me = mount_list; me;)
{
struct stat buf;
struct mount_entry *discard_me =
((void *)0)
;
if ((me->me_remote && show_local_fs)
|| (me->me_dummy && !show_all_fs && !show_listed_fs)
|| (!selected_fstype (me->me_type) || excluded_fstype (me->me_type))
|| -1 == stat (me->me_mountdir, &buf))
{
buf.st_dev = me->me_dev;
}
else
{
struct devlist *seen_dev = devlist_for_dev (buf.st_dev);
if (seen_dev)
{
_Bool
target_nearer_root = strlen (seen_dev->me->me_mountdir)
> strlen (me->me_mountdir);
_Bool
source_below_root = seen_dev->me->me_mntroot !=
((void *)0)
&& me->me_mntroot !=
((void *)0)
&& (strlen (seen_dev->me->me_mntroot)
< strlen (me->me_mntroot));
if (! print_grand_total
&& me->me_remote && seen_dev->me->me_remote
&& ! (strcmp (seen_dev->me->me_devname, me->me_devname) == 0))
{
}
else if ((strchr (me->me_devname, '/')
&& ! strchr (seen_dev->me->me_devname, '/'))
|| (target_nearer_root && ! source_below_root)
|| (! (strcmp (seen_dev->me->me_devname, me->me_devname) == 0)
&& (strcmp (me->me_mountdir, seen_dev->me->me_mountdir) == 0)
))
{
discard_me = seen_dev->me;
seen_dev->me = me;
}
else
{
discard_me = me;
}
}
}
if (discard_me)
{
me = me->me_next;
if (! devices_only)
free_mount_entry (discard_me);
}
else
{
struct devlist *devlist = xmalloc (sizeof *devlist);
devlist->me = me;
devlist->dev_num = buf.st_dev;
devlist->next = device_list;
device_list = devlist;
struct devlist *hash_entry = hash_insert (devlist_table, devlist);
if (hash_entry ==
((void *)0)
)
xalloc_die ();
hash_entry->seen_last = devlist;
me = me->me_next;
}
}
if (! devices_only) {
mount_list =
((void *)0)
;
while (device_list)
{
me = device_list->me;
me->me_next = mount_list;
mount_list = me;
struct devlist *next = device_list->next;
free (device_list);
device_list = next;
}
hash_free (devlist_table);
devlist_table =
((void *)0)
;
}
}
| unsigned long filter_mount_list(char a1)
{
size_t v1;
size_t v2;
bool v3;
bool v5;
bool v6;
int v7;
long i;
long v9;
long v10;
__dev_t *ptr;
long v12;
__dev_t *v13;
long v14;
__dev_t *v15;
long v16;
struct stat v17;
unsigned long v18;
v18 = __readfsqword(0x28u);
ptr = 0LL;
v7 = 0;
for ( i = mount_list; i; i = *(_QWORD *)(i + 48) )
++v7;
devlist_table = hash_initialize(v7, 0LL, devlist_hash, devlist_compare, 0LL);
if ( !devlist_table )
xalloc_die();
v9 = mount_list;
while ( v9 )
{
v12 = 0LL;
if ( (*(_BYTE *)(v9 + 40) & 2) != 0 && show_local_fs
|| (*(_BYTE *)(v9 + 40) & 1) != 0 && show_all_fs != 1 && show_listed_fs != 1
|| (unsigned char)selected_fstype(*(const char **)(v9 + 24)) != 1
|| (unsigned char)excluded_fstype(*(const char **)(v9 + 24))
|| stat(*(const char **)(v9 + 8), &v17) == -1 )
{
v17.st_dev = *(_QWORD *)(v9 + 32);
}
else
{
v14 = devlist_for_dev(v17.st_dev);
if ( v14 )
{
v1 = strlen(*(const char **)(*(_QWORD *)(v14 + 8) + 8LL));
v5 = v1 > strlen(*(const char **)(v9 + 8));
v3 = 0;
if ( *(_QWORD *)(*(_QWORD *)(v14 + 8) + 16LL) )
{
if ( *(_QWORD *)(v9 + 16) )
{
v2 = strlen(*(const char **)(*(_QWORD *)(v14 + 8) + 16LL));
if ( v2 < strlen(*(const char **)(v9 + 16)) )
v3 = 1;
}
}
v6 = v3;
if ( print_grand_total == 1
|| (*(_BYTE *)(v9 + 40) & 2) == 0
|| (*(_BYTE *)(*(_QWORD *)(v14 + 8) + 40LL) & 2) == 0
|| !strcmp(**(const char ***)(v14 + 8), *(const char **)v9) )
{
if ( strchr(*(const char **)v9, 47) && !strchr(**(const char ***)(v14 + 8), 47)
|| v5 && !v6
|| strcmp(**(const char ***)(v14 + 8), *(const char **)v9)
&& !strcmp(*(const char **)(v9 + 8), *(const char **)(*(_QWORD *)(v14 + 8) + 8LL)) )
{
v12 = *(_QWORD *)(v14 + 8);
*(_QWORD *)(v14 + 8) = v9;
}
else
{
v12 = v9;
}
}
}
}
if ( v12 )
{
v9 = *(_QWORD *)(v9 + 48);
if ( a1 != 1 )
free_mount_entry(v12);
}
else
{
v15 = (__dev_t *)xmalloc(32LL);
v15[1] = v9;
*v15 = v17.st_dev;
v15[2] = (__dev_t)ptr;
ptr = v15;
v16 = hash_insert(devlist_table, v15);
if ( !v16 )
xalloc_die();
*(_QWORD *)(v16 + 24) = v15;
v9 = *(_QWORD *)(v9 + 48);
}
}
if ( a1 != 1 )
{
mount_list = 0LL;
while ( ptr )
{
v10 = ptr[1];
*(_QWORD *)(v10 + 48) = mount_list;
mount_list = v10;
v13 = (__dev_t *)ptr[2];
free(ptr);
ptr = v13;
}
hash_free(devlist_table);
devlist_table = 0LL;
}
return __readfsqword(0x28u) ^ v18;
}
|
int
kex_ecdh_enc(struct kex *kex, const struct sshbuf *client_blob,
struct sshbuf **server_blobp, struct sshbuf **shared_secretp)
{
const EC_GROUP *group;
const EC_POINT *pub_key;
EC_KEY *server_key =
((void *)0)
;
struct sshbuf *server_blob =
((void *)0)
;
int r;
*server_blobp =
((void *)0)
;
*shared_secretp =
((void *)0)
;
if ((server_key = EC_KEY_new_by_curve_name(kex->ec_nid)) ==
((void *)0)
) {
r = -2;
goto out;
}
if (EC_KEY_generate_key(server_key) != 1) {
r = -22;
goto out;
}
group = EC_KEY_get0_group(server_key);
pub_key = EC_KEY_get0_public_key(server_key);
if ((server_blob = sshbuf_new()) ==
((void *)0)
) {
r = -2;
goto out;
}
if ((r = sshbuf_put_ec(server_blob, pub_key, group)) != 0 ||
(r = sshbuf_get_u32(server_blob,
((void *)0)
)) != 0)
goto out;
if ((r = kex_ecdh_dec_key_group(kex, client_blob, server_key, group,
shared_secretp)) != 0)
goto out;
*server_blobp = server_blob;
server_blob =
((void *)0)
;
out:
EC_KEY_free(server_key);
sshbuf_free(server_blob);
return r;
}
| long long kex_ecdh_enc(struct_0 *a0, unsigned long long a1, unsigned long long *a2, unsigned long long *a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
void* v1;
void* v2;
unsigned long long v3;
unsigned long long v4;
v2 = 0;
v1 = 0;
*(a2) = 0;
*(a3) = 0;
v2 = EC_KEY_new_by_curve_name(a0->field_94);
if (!v2) {
v0 = -2;
} else if (EC_KEY_generate_key(v2) != 1) {
v0 = -22;
} else {
v3 = EC_KEY_get0_group(v2);
v4 = EC_KEY_get0_public_key(v2);
v1 = sshbuf_new(a0, a1, a2, a3, a4, a5);
if (!v1) {
v0 = -2;
} else {
v0 = sshbuf_put_ec(v1, v4, v3, v4);
if (!v0) {
v0 = sshbuf_get_u32(v1, 0x0);
if (!v0) {
v0 = kex_ecdh_dec_key_group(a0, a1, v2, v3, a3, a5);
if (!v0) {
*(a2) = v1;
v1 = 0;
goto LABEL_400270;
}
}
}
}
}
LABEL_400270:
EC_KEY_free(v2);
sshbuf_free(v1);
return v0;
}
|
void *
hash_get_next (const Hash_table *table, const void *entry)
{
struct hash_entry const *bucket = safe_hasher (table, entry);
struct hash_entry const *cursor;
cursor = bucket;
do
{
if (cursor->data == entry && cursor->next)
return cursor->next->data;
cursor = cursor->next;
}
while (cursor !=
((void *)0)
);
while (++bucket < table->bucket_limit)
if (bucket->data)
return bucket->data;
return
((void *)0)
;
}
| long long hash_get_next(struct_0 *a0, unsigned long long a1) {
unsigned long long v0[2];
struct_1 *v1;
void* v3;
v0[0] = safe_hasher(a0, a1);
v1 = &v0[0];
do {
if (a1 == v1->field_0 && v1->field_8) {
v3 = v1->field_8->field_0;
goto LABEL_400475;
}
v1 = &v1->field_8->field_0;
} while (v1);
do {
v0[0] = v0 + 1;
if (v0 >= a0->field_8) {
v3 = 0;
goto LABEL_400475;
}
} while (!v0[0]);
v3 = v0[0];
LABEL_400475:
return v3;
}
|
static enum Shell_syntax
guess_shell_syntax (void)
{
char *shell;
shell = getenv ("SHELL");
if (shell ==
((void *)0)
|| *shell == '\0')
return SHELL_SYNTAX_UNKNOWN;
shell = last_component (shell);
if ((strcmp (shell, "csh") == 0) || (strcmp (shell, "tcsh") == 0))
return SHELL_SYNTAX_C;
return SHELL_SYNTAX_BOURNE;
}
| long guess_shell_syntax()
{
char *s1;
char *s1a;
s1 = getenv("SHELL");
if ( !s1 || !*s1 )
return 2LL;
s1a = (char *)last_component(s1);
return !strcmp(s1a, "csh") || !strcmp(s1a, "tcsh");
}
|
static int
valid_length_expression (name)
char *name;
{
return (name[1] == '\0' ||
((sh_syntaxtab[(unsigned char) name[1]] & 0x0800) && name[2] == '\0') ||
(((name[1]) >= '0' && (name[1]) <= '9') && all_digits (name + 1)) ||
valid_array_reference (name + 1, 0) ||
legal_identifier (name + 1));
}
| int valid_length_expression(char a0[3]) {
unsigned int v1;
if (a0[1] && (!(sh_syntaxtab[a0[1]] & 0x800) || a0[2])) {
if (a0[1] > 47 && a0[1] <= 57)
v1 = all_digits(&a0[1]);
if (!v1 || a0[1] <= 47 || a0[1] > 57) {
v1 = valid_array_reference(&a0[1], 0x0);
if (!v1) {
v1 = legal_identifier(&a0[1]);
if (!v1)
v1 = 0;
}
}
}
if (!a0[1] || v1 || v1 || !a0[2] && (sh_syntaxtab[a0[1]] & 0x800) || a0[1] <= 57 && v1 && a0[1] > 47)
v1 = 1;
return v1;
}
|
static int ipstats_comp_enabled(const void *a, const void *b)
{
const struct ipstats_stat_enabled_one *en_a = a;
const struct ipstats_stat_enabled_one *en_b = b;
if (en_a->desc < en_b->desc)
return -1;
if (en_a->desc > en_b->desc)
return 1;
return 0;
}
| undefined8 ipstats_comp_enabled(ulong *param_1,ulong *param_2)
{
undefined8 uVar1;
if (*param_1 < *param_2) {
uVar1 = 0xffffffff;
}
else if (*param_2 < *param_1) {
uVar1 = 1;
}
else {
uVar1 = 0;
}
return uVar1;
}
|
static u_int
st_hash(const char *name, size_t len, int tabsz)
{
u_int key = 0;
((void) sizeof ((
name !=
((void *)0)) ? 1 : 0), __extension__ ({ if (
name !=
((void *)0)) ; else __assert_fail (
"name != NULL"
, "pwcache.c", 96, __extension__ __PRETTY_FUNCTION__); }))
;
while (len--) {
key += *name++;
key = (key << 8) | (key >> 24);
}
return key % tabsz;
}
| int st_hash(unsigned long a0, unsigned long long a1, unsigned long a2) {
unsigned long long v0;
int tmp_17;
int tmp_6;
char *v1;
unsigned int v2;
unsigned long long v4;
unsigned long long v5;
unsigned long v6;
v1 = a0;
v0 = a1;
v2 = 0;
if (!v1)
__assert_fail();
while (true) {
v4 = v0;
v0 -= 1;
if (!v4)
break;
tmp_17 = v1;
v1 += 1;
v5 = *(tmp_17);
tmp_6 = v2;
v2 += v5;
v6 = [D] amd64g_calculate_rflags_all(0x3<64>, Conv(32->64, t6), Conv(8->64, al<1>), cc_ndep<8>);
v2 = v2 * 0x100 | v2 >> 24;
}
return (0 CONCAT v2) /m a2 >> 32;
}
|
static int
_netopen(host, serv, typ)
char *host, *serv;
int typ;
{
return (_netopen6 (host, serv, typ));
}
| int _netopen(unsigned long long a0, unsigned long long a1, unsigned long a2) {
return _netopen6(a0, a1, a2);
}
|
static union node *
list(int nlflag)
{
int chknl = nlflag & 1 ? 0 : 0x4;
union node *n1, *n2, *n3;
int tok;
n1 =
((void *)0)
;
for (;;) {
checkkwd = chknl | 0x2 | 0x1;
tok = readtoken();
switch (tok) {
case 1:
parseheredoc();
return n1;
case 0:
if (!n1 && !chknl)
n1 = ((union node *)&tokpushback);
out_eof:
parseheredoc();
tokpushback++;
lasttoken = 0;
return n1;
}
tokpushback++;
if (nlflag == 2 && tokendlist[tok])
return n1;
nlflag |= 2;
n2 = andor();
tok = readtoken();
if (tok == 3) {
if (n2->type == 1) {
n2->npipe.backgnd = 1;
} else {
if (n2->type != 2) {
n3 = stalloc(sizeof(struct nredir));
n3->nredir.n = n2;
n3->nredir.redirect =
((void *)0)
;
n2 = n3;
}
n2->type = 3;
}
}
if (n1 ==
((void *)0)
) {
n1 = n2;
}
else {
n3 = (union node *)stalloc(sizeof (struct nbinary));
n3->type = 7;
n3->nbinary.ch1 = n1;
n3->nbinary.ch2 = n2;
n1 = n3;
}
switch (tok) {
case 0:
goto out_eof;
case 1:
tokpushback++;
case 3:
case 2:
break;
default:
if (!chknl)
synexpect(-1);
tokpushback++;
return n1;
}
}
}
| int list(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned int v8;
v0 = a0;
v1 = (!(v0 & 1) ? 0 : 4);
v3 = 0;
while (true) {
quoteflag = v1 | 3;
v2 = readtoken(a0, a1, a2, a3, a4, a5);
switch (v2) {
case 0:
if (!v3 && !v1) {
v3 = "eflag;
parseheredoc();
quoteflag = 283935561;
quoteflag = 0;
v8 = v3;
return v8;
}
parseheredoc();
quoteflag = 283935561;
quoteflag = 0;
v8 = v3;
return v8;
case 1:
parseheredoc();
v8 = v3;
return v8;
default:
quoteflag = 283935561;
if (v0 == 2) {
a2 = &tokendlist;
if (*(v2 + &tokendlist)) {
v8 = v3;
return v8;
}
}
v0 |= 2;
v4 = andor(a0, a1, a2, a3, a4, a5);
v2 = readtoken(a0, a1, a2, a3, a4, a5);
if (v2 == 3) {
switch (*(v4)) {
case 1:
*((v4 + 4)) = 1;
break;
case 2:
*(v4) = 3;
break;
default:
v5 = stalloc(0x18);
a2 = v4;
*((v5 + 8)) = v4;
*((v5 + 16)) = 0;
v4 = v5;
*(v4) = 3;
break;
}
}
if (!v3) {
v3 = v4;
break;
} else {
v5 = stalloc(0x18);
*(v5) = 7;
*((v5 + 8)) = v3;
a2 = v4;
*((v5 + 16)) = v4;
v3 = v5;
break;
}
switch (v2) {
case 0:
parseheredoc();
quoteflag = 283935561;
quoteflag = 0;
v8 = v3;
return v8;
case 1:
quoteflag = 283935561;
break;
default:
if (!v1)
synexpect(0xffffffff);
quoteflag = 283935561;
v8 = v3;
return v8;
}
continue;
}
}
}
|
int
owner_map_translate (uid_t uid, uid_t *new_uid, char const **new_name)
{
int rc = 1;
if (owner_map)
{
struct mapentry ent, *res;
ent.orig_id = uid;
res = hash_lookup (owner_map, &ent);
if (res)
{
*new_uid = res->new_id;
*new_name = res->new_name;
return 0;
}
}
if (owner_option != (uid_t) -1)
{
*new_uid = owner_option;
rc = 0;
}
if (owner_name_option)
{
*new_name = owner_name_option;
rc = 0;
}
return rc;
}
| long long owner_map_translate(unsigned long a0, unsigned int *a1, unsigned long long *a2) {
unsigned int v0;
unsigned long long v1[3];
unsigned long v2;
void* v4;
v0 = 1;
if (owner_map) {
v2 = a0;
v1[0] = hash_lookup(owner_map, &v2, &v2);
if (v1) {
*(a1) = v1[1];
*(a2) = v1[2];
v4 = 0;
return v4;
}
}
if (owner_option != -1) {
*(a1) = owner_option;
v0 = 0;
}
if (owner_name_option) {
*(a2) = owner_name_option;
v0 = 0;
}
v4 = v0;
return v4;
}
|
static int parse_encap_seg6(struct rtattr *rta, size_t len, int *argcp,
char ***argvp)
{
int mode_ok = 0, segs_ok = 0, hmac_ok = 0;
struct seg6_iptunnel_encap *tuninfo;
struct ipv6_sr_hdr *srh;
char **argv = *argvp;
char segbuf[1024] = "";
int argc = *argcp;
int encap = -1;
__u32 hmac = 0;
int ret = 0;
int srhlen;
while (argc > 0) {
if (strcmp(*argv, "mode") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (mode_ok++)
duparg2("mode", *argv);
encap = read_seg6mode_type(*argv);
if (encap < 0)
invarg("\"mode\" value is invalid\n", *argv);
} else if (strcmp(*argv, "segs") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (segs_ok++)
duparg2("segs", *argv);
if (encap == -1)
invarg("\"segs\" provided before \"mode\"\n",
*argv);
strlcpy(segbuf, *argv, 1024);
} else if (strcmp(*argv, "hmac") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (hmac_ok++)
duparg2("hmac", *argv);
get_u32(&hmac, *argv, 0);
} else {
break;
}
argc--; argv++;
}
srh = parse_srh(segbuf, hmac, encap);
srhlen = (srh->hdrlen + 1) << 3;
tuninfo = malloc(sizeof(*tuninfo) + srhlen);
memset(tuninfo, 0, sizeof(*tuninfo) + srhlen);
tuninfo->mode = encap;
memcpy(tuninfo->srh, srh, srhlen);
if (rta_addattr_l(rta, len, SEG6_IPTUNNEL_SRH, tuninfo,
sizeof(*tuninfo) + srhlen)) {
ret = -1;
goto out;
}
*argcp = argc + 1;
*argvp = argv - 1;
out:
free(tuninfo);
free(srh);
return ret;
}
| int parse_encap_seg6(unsigned long long a0, unsigned long long a1, unsigned int *a2, unsigned long a3) {
unsigned long long *v0;
int tmp_9;
unsigned long long 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 long long *v10;
struct_0 *v11;
unsigned int *v12;
void* v13;
void* v14;
void* v15;
unsigned long long v17;
unsigned long long *v18;
unsigned long v19;
v1 = a0;
v0 = a3;
v3 = 0;
v4 = 0;
v5 = 0;
v10 = *(v0);
v13 = 0;
v14 = 0;
v17 = 126;
for (v18 = &v15; v17; v18 = &v18[v19]) {
v17 -= 1;
v15 = 0;
}
v6 = *(a2);
v7 = -1;
v2 = 0;
for (v8 = 0; true; v10 += 1) {
if (v6 <= 0)
break;
if (!strcmp(*(v10), "mode")) {
v10 = v10 + 1;
v6 -= 1;
if (v6 <= 0)
incomplete_command();
tmp_9 = v3;
v3 += 1;
if (tmp_9)
duparg2("mode", *(v10));
v7 = read_seg6mode_type(*(v10));
if (v7 < 0) {
invarg("\"mode\" value is invalid\n", *(v10));
} else {
v6 -= 1;
continue;
}
}
if (!strcmp(*(v10), "segs")) {
v10 = v10 + 1;
v6 -= 1;
if (v6 <= 0)
incomplete_command();
tmp_9 = v4;
v4 += 1;
if (tmp_9)
duparg2("segs", *(v10));
if (v7 == -1)
invarg("\"segs\" provided before \"mode\"\n", *(v10));
strlcpy(&v13, *(v10), 0x400, *(v10));
} else {
if (strcmp(*(v10), "hmac"))
break;
v10 = v10 + 1;
v6 -= 1;
if (v6 <= 0)
incomplete_command();
tmp_9 = v5;
v5 += 1;
if (tmp_9)
duparg2("hmac", *(v10));
get_u32(&v2, *(v10), 0x0, *(v10));
}
v6 -= 1;
}
v11 = parse_srh(&v13, v2, v7);
v9 = (v11->field_1 + 1) * 8;
v12 = malloc(v9 + 4);
memset(v12, 0x0, v9 + 4);
*(v12) = v7;
memcpy(v12 + 1, v11, v9);
if (rta_addattr_l(v1, a1, 0x1, v12, v9 + 4)) {
v8 = -1;
} else {
*(a2) = v6 + 1;
*(v0) = v10 + 1;
}
free(v12);
free(v11);
return v8;
}
|
void
history_end(History *h)
{
HistEvent ev;
if (h->h_next == history_def_next)
history_def_clear(h->h_ref, &ev);
free(h->h_ref);
free(h);
}
| void history_end(unsigned long long a0[4]) {
char v0;
char v1;
unsigned long long *v3;
unsigned long long v4;
if (a0[3] == history_def_next)
history_def_clear(a0[0], &v0);
free(a0[0]);
free(a0);
v4 = *(&v1) ^ v3[5];
return;
}
|
static void
prepare_auth_info_file(struct passwd *pw, struct sshbuf *info)
{
int fd = -1, success = 0;
if (!options.expose_userauth_info || info ==
((void *)0)
)
return;
temporarily_use_uid(pw);
auth_info_file = xstrdup("/tmp/sshauth.XXXXXXXXXXXXXXX");
if ((fd = mkstemp(auth_info_file)) == -1) {
sshlog("session.c", __func__, 271, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "mkstemp: %s", strerror(
(*__errno_location ())
));
goto out;
}
if (atomicio((ssize_t (*)(int, void *, size_t))write, fd, sshbuf_mutable_ptr(info),
sshbuf_len(info)) != sshbuf_len(info)) {
sshlog("session.c", __func__, 276, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "write: %s", strerror(
(*__errno_location ())
));
goto out;
}
if (close(fd) != 0) {
sshlog("session.c", __func__, 280, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "close: %s", strerror(
(*__errno_location ())
));
goto out;
}
success = 1;
out:
if (!success) {
if (fd != -1)
close(fd);
free(auth_info_file);
auth_info_file =
((void *)0)
;
}
restore_uid();
}
| void prepare_auth_info_file(unsigned long a0, unsigned long long a1) {
unsigned long long v0;
unsigned long v1;
unsigned int v2;
unsigned int v3;
unsigned long long v5;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
v3 = -1;
v2 = 0;
v5 = *(5250924);
if (*(5250924) && a1) {
temporarily_use_uid(a0);
auth_info_file = xstrdup("/tmp/sshauth.XXXXXXXXXXXXXXX");
v3 = mkstemp(auth_info_file);
if (v3 == -1) {
v1 = strerror(*(__errno_location()));
v0 = "mkstemp: %s";
sshlog("session.c", "prepare_auth_info_file", 0x10f, 0x1, 0x2, 0x0);
} else if (atomicio(got.write, v3, sshbuf_mutable_ptr(a1), sshbuf_len(a1)) != sshbuf_len(a1)) {
v1 = strerror(*(__errno_location()));
v0 = "write: %s";
sshlog("session.c", "prepare_auth_info_file", 0x114, 0x1, 0x2, 0x0);
} else {
a0 = v3;
if (close(v3)) {
v1 = strerror(*(__errno_location()));
v0 = "close: %s";
sshlog("session.c", "prepare_auth_info_file", 0x118, 0x1, 0x2, 0x0);
} else {
v2 = 1;
}
}
if (!v2) {
if (v3 != -1)
close(v3);
free(auth_info_file);
auth_info_file = 0;
}
v13 = restore_uid(a0, a1, v9, v10, v11, v12);
}
return;
}
|
_Bool
*changed);
static void fail_exit (int code)
{
if (spw_locked) {
if (spw_unlock () == 0) {
fprintf (
stderr
, gettext ("%s: failed to unlock %s\n"), Prog, spw_dbname ());
if (use_system_spw_file) {
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
3
, "failed to unlock %s", spw_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
)
;
}
}
}
if (pw_locked) {
if (pw_unlock () == 0) {
fprintf (
stderr
, gettext ("%s: failed to unlock %s\n"), Prog, pw_dbname ());
if (use_system_pw_file) {
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
3
, "failed to unlock %s", pw_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
)
;
}
}
}
closelog ();
exit (code);
}
| void fail_exit(unsigned long a0) {
void* v0;
void* v1;
char *v2;
char *v3;
unsigned long v4;
unsigned long v5;
unsigned long v7;
unsigned long v8;
unsigned long long v9;
unsigned long long v10;
v5 = v7;
v4 = v8;
if (spw_locked && !spw_unlock()) {
v9 = spw_dbname();
fprintf(stderr, gettext("%s: failed to unlock %s\n"));
if (use_system_spw_file) {
v2 = setlocale(0x6, NULL);
v0 = 0;
if (v2)
v0 = strdup(v2);
if (v0)
setlocale(0x6, "C");
spw_dbname();
syslog(0x3, "failed to unlock %s");
if (v0) {
setlocale(0x6, v0);
free(v0);
}
}
}
if (pw_locked && !pw_unlock()) {
v10 = pw_dbname();
fprintf(stderr, gettext("%s: failed to unlock %s\n"));
if (use_system_pw_file) {
v3 = setlocale(0x6, NULL);
v1 = 0;
if (v3)
v1 = strdup(v3);
if (v1)
setlocale(0x6, "C");
pw_dbname();
syslog(0x3, "failed to unlock %s");
if (v1) {
setlocale(0x6, v1);
free(v1);
}
}
}
closelog();
exit(a0);
}
|
static union node *
andor(void)
{
union node *n1, *n2, *n3;
int t;
n1 = pipeline();
for (;;) {
if ((t = readtoken()) == 4) {
t = 5;
} else if (t == 5) {
t = 6;
} else {
tokpushback++;
return n1;
}
checkkwd = 0x4 | 0x2 | 0x1;
n2 = pipeline();
n3 = (union node *)stalloc(sizeof (struct nbinary));
n3->type = t;
n3->nbinary.ch1 = n1;
n3->nbinary.ch2 = n2;
n1 = n3;
}
}
| int *andor()
{
int v1;
int v2;
int *i;
int *v4;
long v5;
for ( i = pipeline(); ; i = (int *)v5 )
{
v1 = readtoken();
if ( v1 == 4 )
{
v2 = 5;
goto LABEL_7;
}
if ( v1 != 5 )
break;
v2 = 6;
LABEL_7:
checkkwd = 7;
v4 = pipeline();
v5 = stalloc(24LL);
*(_DWORD *)v5 = v2;
*(_QWORD *)(v5 + 8) = i;
*(_QWORD *)(v5 + 16) = v4;
}
++tokpushback;
return i;
}
|
static int depmod_module_del(struct depmod *depmod, struct mod *mod)
{
log_printf(
7
, "del %p kmod=%p, path=%s\n", mod, mod->kmod, mod->path);
if (mod->uncrelpath !=
((void *)0)
)
hash_del(depmod->modules_by_uncrelpath, mod->uncrelpath);
hash_del(depmod->modules_by_name, mod->modname);
mod_free(mod);
return 0;
}
| undefined8 depmod_module_del(long param_1,undefined8 *param_2)
{
log_printf(7,"del %p kmod=%p, path=%s\n",param_2,*param_2,param_2[1]);
if (param_2[3] != 0) {
hash_del(*(undefined8 *)(param_1 + 0x30),param_2[3]);
}
hash_del(*(undefined8 *)(param_1 + 0x38),param_2 + 0xf);
mod_free(param_2);
return 0;
}
|
static void create_home (void)
{
if (access (prefix_user_home,
0
) != 0) {
char path[strlen (prefix_user_home) + 2];
char *bhome, *cp;
path[0] = '\0';
bhome = strdup (prefix_user_home);
if (!bhome) {
fprintf (
stderr
,
gettext ("%s: error while duplicating string %s\n"),
Prog, user_home);
fail_exit (12);
}
cp = strtok (bhome, "/");
while (cp) {
if (bhome[0] == '/' || strlen (path) != 0) {
strcat (path, "/");
}
strcat (path, cp);
if (access (path,
0
) != 0) {
if (subvolflg && (strlen(prefix_user_home) - (int)strlen(path)) <= 1) {
char *btrfs_check = strdup(path);
if (!btrfs_check) {
fprintf (
stderr
,
gettext ("%s: error while duplicating string in BTRFS check %s\n"),
Prog, path);
fail_exit (12);
}
btrfs_check[strlen(path) - strlen(cp) - 1] = '\0';
if (is_btrfs(btrfs_check) <= 0) {
fprintf (
stderr
,
gettext ("%s: home directory \"%s\" must be mounted on BTRFS\n"),
Prog, path);
fail_exit (12);
}
if (btrfs_create_subvolume(path)) {
fprintf (
stderr
,
gettext ("%s: failed to create BTRFS subvolume: %s\n"),
Prog, path);
fail_exit (12);
}
}
else
if (mkdir (path, 0) != 0) {
fprintf (
stderr
,
gettext ("%s: cannot create directory %s\n"),
Prog, path);
fail_exit (12);
}
if (chown (path, 0, 0) < 0) {
fprintf (
stderr
,
gettext ("%s: warning: chown on `%s' failed: %m\n"),
Prog, path);
}
if (chmod (path, 0755) < 0) {
fprintf (
stderr
,
gettext ("%s: warning: chmod on `%s' failed: %m\n"),
Prog, path);
}
}
cp = strtok (
((void *)0)
, "/");
}
free (bhome);
(void) chown (prefix_user_home, user_id, user_gid);
mode_t mode = getdef_num ("HOME_MODE",
0777 & ~getdef_num ("UMASK", 022));
if (chmod (prefix_user_home, mode)) {
fprintf (
stderr
, gettext ("%s: warning: chown on '%s' failed: %m\n"),
Prog, path);
}
home_added =
1
;
}
}
| void create_home() {
unsigned long v0;
void* v1;
unsigned int v2;
char *v3;
unsigned long v4;
char *v5;
char *v6;
struct_0 *v7;
char v8;
unsigned long long v9;
char v10;
unsigned long long v12;
unsigned long v13;
unsigned long long *v16;
unsigned long long v17;
if (access(prefix_user_home, 0x0)) {
v12 = strlen(prefix_user_home);
v4 = v12 - -1;
v0 = v12 + 2;
v1 = 0;
for (v13 = (0 CONCAT v12 + 17) /m 16 * 16; &v10 != &v0 + -1 * (v13 & -0x1000); v9 = v9);
if ((v13 & 4095))
*((&v9 + (v13 & 4095))) = *((&v9 + (v13 & 4095)));
v5 = &v10;
*(v5) = 0;
v6 = strdup(prefix_user_home);
if (!v6) {
fprintf(*(&stderr), gettext("%s: error while duplicating string %s\n"));
fail_exit(0xc);
}
v3 = strtok(v6, "/");
while (true) {
if (!v3)
break;
if (*(v6) != 47 && !strlen(v5))
goto LABEL_405ae5;
strcat(v5, "/");
LABEL_405ae5:
strcat(v5, v3);
if (!access(v5, 0x0)) {
LABEL_405d63:
v3 = strtok(NULL, "/");
} else {
if (subvolflg && strlen(prefix_user_home) - strlen(v5) <= 1) {
v7 = &strdup(v5);
if (!v7) {
fprintf(*(&stderr), gettext("%s: error while duplicating string in BTRFS check %s\n"));
fail_exit(0xc);
}
v7->padding_0[1 + strlen(v5) + -1 * strlen(v3)] = 0;
if (is_btrfs(v7) <= 0) {
fprintf(*(&stderr), gettext("%s: home directory \"%s\" must be mounted on BTRFS\n"));
fail_exit(0xc);
} else if (btrfs_create_subvolume(v5)) {
fprintf(*(&stderr), gettext("%s: failed to create BTRFS subvolume: %s\n"));
fail_exit(0xc);
}
goto LABEL_405ccc;
}
if (mkdir(v5, 0x0)) {
fprintf(*(&stderr), gettext("%s: cannot create directory %s\n"));
fail_exit(0xc);
}
LABEL_405ccc:
if (chown(v5, 0x0, 0x0) < 0)
fprintf(*(&stderr), gettext("%s: warning: chown on `%s' failed: %m\n"));
if (chmod(v5, 0x1ed) < 0)
fprintf(*(&stderr), gettext("%s: warning: chmod on `%s' failed: %m\n"));
goto LABEL_405d63;
}
}
free(v6);
chown(prefix_user_home, user_id, user_gid);
v2 = getdef_num("HOME_MODE", !(getdef_num("UMASK", 0x12)) & 511);
if (chmod(prefix_user_home, v2))
fprintf(*(&stderr), gettext("%s: warning: chown on '%s' failed: %m\n"));
home_added = 1;
}
v17 = *(&v8) ^ v16[5];
return;
}
|
int
main (int argc, char **argv)
{
char *wd;
_Bool
logical = (getenv ("POSIXLY_CORRECT") !=
((void *)0)
);
;
set_program_name (argv[0]);
setlocale (
6
, "");
bindtextdomain ("coreutils", "/usr/local/share/locale");
textdomain ("coreutils");
atexit (close_stdout);
while (
1
)
{
int c = getopt_long (argc, argv, "LP", longopts,
((void *)0)
);
if (c == -1)
break;
switch (c)
{
case 'L':
logical =
1
;
break;
case 'P':
logical =
0
;
break;
case GETOPT_HELP_CHAR: usage (
0
); break;;
case GETOPT_VERSION_CHAR: version_etc (
stdout
, "pwd", "GNU coreutils", Version, ("Jim Meyering"), (char *)
((void *)0)
); exit (
0
); break;;
default:
usage (
1
);
}
}
if (optind < argc)
error (0, 0, gettext ("ignoring non-option arguments"));
if (logical)
{
wd = logical_getcwd ();
if (wd)
{
puts (wd);
return
0
;
}
}
wd = xgetcwd ();
if (wd !=
((void *)0)
)
{
puts (wd);
free (wd);
}
else
{
struct file_name *file_name = file_name_init ();
robust_getcwd (file_name);
puts (file_name->start);
file_name_free (file_name);
}
return
0
;
}
| undefined8 main(int param_1,undefined8 *param_2)
{
int iVar1;
char *pcVar2;
undefined8 uVar3;
long lVar4;
bool bVar5;
pcVar2 = getenv("POSIXLY_CORRECT");
bVar5 = pcVar2 != (char *)0x0;
set_program_name(*param_2);
setlocale(6,"");
bindtextdomain("coreutils","/usr/local/share/locale");
textdomain("coreutils");
atexit(p_Ram0000000000100ee2);
do {
while( true ) {
while( true ) {
iVar1 = getopt_long(param_1,param_2,&DAT_0010153e,longopts,0);
if (iVar1 == -1) {
if (optind < param_1) {
uVar3 = gettext("ignoring non-option arguments");
error(0,0,uVar3);
}
if ((bVar5) && (pcVar2 = (char *)logical_getcwd(), pcVar2 != (char *)0x0)) {
puts(pcVar2);
}
else {
pcVar2 = (char *)xgetcwd();
if (pcVar2 == (char *)0x0) {
lVar4 = file_name_init();
robust_getcwd(lVar4);
puts(*(char **)(lVar4 + 0x10));
file_name_free(lVar4);
}
else {
puts(pcVar2);
free(pcVar2);
}
}
return 0;
}
if (iVar1 != 0x50) break;
bVar5 = false;
}
if (iVar1 < 0x51) break;
LAB_00100f9e:
usage();
}
if (iVar1 != 0x4c) {
if (iVar1 < 0x4d) {
if (iVar1 == -0x83) {
LAB_00100f5b:
version_etc(stdout,&DAT_00101447,"GNU coreutils",Version,"Jim Meyering",0);
exit(0);
}
if (iVar1 == -0x82) {
usage(0);
goto LAB_00100f5b;
}
}
goto LAB_00100f9e;
}
bVar5 = true;
} while( true );
}
|
static
_Bool
process_field (char *text, uintmax_t field)
{
long double val = 0;
size_t precision = 0;
_Bool
valid_number =
1
;
if (include_field (field))
{
valid_number =
process_suffixed_number (text, &val, &precision, field);
if (valid_number)
valid_number = prepare_padded_number (val, precision);
if (valid_number)
print_padded_number ();
else
fputs_unlocked (text,
stdout
);
}
else
fputs_unlocked (text,
stdout
);
return valid_number;
}
| int process_field(char *a0, unsigned int a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5) {
char v0;
char v1;
char v2;
void* v3;
char v4;
[D] PutI(904:F64x8)[t40,0] = t43
[D] PutI(968:I8x8)[t40,0] = 0x01
[D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t50,t52)
[D] PutI(968:I8x8)[t40,0] = 0x00
v3 = 0;
v2 = 1;
if (!include_field(a1)) {
fputs_unlocked(a0, *(&stdout));
} else {
v2 = process_suffixed_number(a0, &v4, &v3, a1);
if (v2) {
[D] t2 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t6)
if ([D] GetI(968:I8x8)[t8,0]) {
[D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2)
[D] PutI(904:F64x8)[t4,0] = t7
[D] PutI(968:I8x8)[t4,0] = 0x01
} else {
[D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2)
[D] PutI(904:F64x8)[t4,0] = t7
[D] PutI(968:I8x8)[t4,0] = 0x01
}
if ([D] GetI(968:I8x8)[t8,0]) {
[D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t0,t1)
[D] PutI(968:I8x8)[t5,0] = 0x00
} else {
[D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t0,t1)
[D] PutI(968:I8x8)[t5,0] = 0x00
}
v2 = prepare_padded_number(v3, &v4, &v3, a1, a4, a5, *(&v0), *(&v1));
}
if (v2)
print_padded_number();
else
fputs_unlocked(a0, *(&stdout));
}
return v2;
}
|
static int
open_output_file (char const *file_name, int typeflag, mode_t mode,
int file_created, mode_t *current_mode,
mode_t *current_mode_mask)
{
int fd;
_Bool
overwriting_old_files = old_files_option == OVERWRITE_OLD_FILES;
int openflag = (
01
|
0
|
02000000
|
0400
|
04000
|
0100
| (overwriting_old_files
?
01000
| (dereference_option ? 0 :
0400000
)
:
0200
));
if (file_created)
openflag = openflag & ~
0200
;
if (typeflag == '7')
{
static int conttype_diagnosed;
if (!conttype_diagnosed)
{
conttype_diagnosed = 1;
do { if ((warning_option & (0x00000008))) do { if (error_hook) error_hook (); error (0, 0, gettext ("Extracting contiguous files as regular files")); } while (0); } while (0)
;
}
}
if (! 1
&& overwriting_old_files && ! dereference_option)
{
struct stat st;
if (fstatat (chdir_fd, file_name, &st,
0x100
) == 0
&&
((((
st.st_mode
)) & 0170000) == (0120000))
)
{
(*__errno_location ())
=
40
;
return -1;
}
}
fd = openat (chdir_fd, file_name, openflag, mode);
if (0 <= fd)
{
if (overwriting_old_files)
{
struct stat st;
if (fstat (fd, &st) != 0)
{
int e =
(*__errno_location ())
;
close (fd);
(*__errno_location ())
= e;
return -1;
}
if (!
((((
st.st_mode
)) & 0170000) == (0100000))
)
{
close (fd);
(*__errno_location ())
=
17
;
return -1;
}
*current_mode = st.st_mode;
*current_mode_mask = ((mode_t) ~ (mode_t) 0);
}
else
{
*current_mode = mode & ~ current_umask;
*current_mode_mask = (
0100
|
(0100 >> 3)
|
((0100 >> 3) >> 3)
| (
0200
|
(0200 >> 3)
|
((0200 >> 3) >> 3)
| (
0400
|
(0400 >> 3)
|
((0400 >> 3) >> 3)
)));
}
}
return fd;
}
| int open_output_file(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned int *a4, unsigned int *a5) {
char v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
char v4;
char v5;
unsigned int v7;
unsigned int v8;
v0 = old_files_option == 2;
if (!v0) {
v7 = 526785;
} else if (!dereference_option) {
v7 = 658241;
} else {
v7 = 527169;
}
v1 = v7;
if (a3)
v1 &= -129;
if (a1 == 55 && !conttype_diagnosed.7207) {
conttype_diagnosed.7207 = 1;
if ((warning_option & 8)) {
if (error_hook)
*(5243024)();
error(0x0, 0x0, gettext("Extracting contiguous files as regular files"));
}
}
v2 = openat(chdir_fd, a0, v1, a2);
if (v2 >= 0) {
if (!v0) {
*(a4) = !(current_umask) & a2;
*(a5) = 511;
} else {
if (fstat(v2, &v4)) {
v3 = *(__errno_location());
close(v2);
*(__errno_location()) = v3;
v8 = -1;
goto LABEL_4025d6;
}
if ((*(&v5) & 0xf000) == 0x8000) {
*(a4) = *(&v5);
*(a5) = -1;
} else {
close(v2);
*(__errno_location()) = 17;
v8 = -1;
goto LABEL_4025d6;
}
}
}
v8 = v2;
LABEL_4025d6:
return v8;
}
|
int
log_is_on_stderr(void)
{
return log_on_stderr && log_stderr_fd ==
2
;
}
| long long log_is_on_stderr() {
unsigned long long v1;
if (log_on_stderr && log_stderr_fd == 2) {
v1 = 1;
goto LABEL_400521;
}
v1 = 0;
LABEL_400521:
return v1;
}
|
int
ssh_set_newkeys(struct ssh *ssh, int mode)
{
struct session_state *state = ssh->state;
struct sshenc *enc;
struct sshmac *mac;
struct sshcomp *comp;
struct sshcipher_ctx **ccp;
struct packet_state *ps;
u_int64_t *max_blocks;
const char *wmsg;
int r, crypt_type;
const char *dir = mode == MODE_OUT ? "out" : "in";
sshlog("packet.c", __func__, 874, 1, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "mode %d", mode);
if (mode == MODE_OUT) {
ccp = &state->send_context;
crypt_type = 1;
ps = &state->p_send;
max_blocks = &state->max_blocks_out;
} else {
ccp = &state->receive_context;
crypt_type = 0;
ps = &state->p_read;
max_blocks = &state->max_blocks_in;
}
if (state->newkeys[mode] !=
((void *)0)
) {
sshlog("packet.c", __func__, 888, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "rekeying %s, input %llu bytes %llu blocks, " "output %llu bytes %llu blocks", dir, (unsigned long long)state->p_read.bytes, (unsigned long long)state->p_read.blocks, (unsigned long long)state->p_send.bytes, (unsigned long long)state->p_send.blocks)
;
kex_free_newkeys(state->newkeys[mode]);
state->newkeys[mode] =
((void *)0)
;
}
ps->packets = ps->blocks = 0;
if ((state->newkeys[mode] = ssh->kex->newkeys[mode]) ==
((void *)0)
)
return -1;
ssh->kex->newkeys[mode] =
((void *)0)
;
enc = &state->newkeys[mode]->enc;
mac = &state->newkeys[mode]->mac;
comp = &state->newkeys[mode]->comp;
if (cipher_authlen(enc->cipher) == 0) {
if ((r = mac_init(mac)) != 0)
return r;
}
mac->enabled = 1;
;
cipher_free(*ccp);
*ccp =
((void *)0)
;
if ((r = cipher_init(ccp, enc->cipher, enc->key, enc->key_len,
enc->iv, enc->iv_len, crypt_type)) != 0)
return r;
if (!state->cipher_warning_done &&
(wmsg = cipher_warning_message(*ccp)) !=
((void *)0)
) {
sshlog("packet.c", __func__, 919, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Warning: %s", wmsg);
state->cipher_warning_done = 1;
}
if ((comp->type == 1 ||
(comp->type == 2 &&
state->after_authentication)) && comp->enabled == 0) {
if ((r = ssh_packet_init_compression(ssh)) < 0)
return r;
if (mode == MODE_OUT) {
if ((r = start_compression_out(ssh, 6)) != 0)
return r;
} else {
if ((r = start_compression_in(ssh)) != 0)
return r;
}
comp->enabled = 1;
}
if (enc->block_size >= 16)
*max_blocks = (u_int64_t)1 << (enc->block_size*2);
else
*max_blocks = ((u_int64_t)1 << 30) / enc->block_size;
if (state->rekey_limit)
*max_blocks = (((*max_blocks) < (state->rekey_limit / enc->block_size)) ? (*max_blocks) : (state->rekey_limit / enc->block_size))
;
sshlog("packet.c", __func__, 952, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "rekey %s after %llu blocks", dir, (unsigned long long)*max_blocks)
;
return 0;
}
| int ssh_set_newkeys(unsigned long long a0[2], unsigned long a1) {
unsigned long long v0;
unsigned int v1;
unsigned long v2;
unsigned int v3;
unsigned long v4;
unsigned long v5;
unsigned int v6;
unsigned int v7;
unsigned long long *v8;
struct_2 *v9;
unsigned long long *v10;
struct_1 *v11;
unsigned int v12;
struct_3 *v13;
struct_4 *v14;
unsigned int v15[2];
unsigned long v16;
unsigned int v18;
unsigned long v20;
v11 = a0[0];
v18 = (a1 == 1 ? "in" : "out");
v12 = v18;
v5 = a1;
v4 = "mode %d";
sshlog("packet.c", "ssh_set_newkeys", 0x36a, 0x1, 0x6, 0x0);
if (a1 == 1) {
v8 = &v11->padding_0[24];
v6 = 1;
v9 = &v11->padding_180;
v10 = &v11->padding_198[8];
} else {
v8 = &v11->padding_0[16];
v6 = 0;
v9 = &v11->padding_14c[28];
v10 = &v11->padding_198[0];
}
if (*(&v11->padding_14c[12 + 8 * a1])) {
v5 = v11->field_188;
v4 = v11->field_190;
v3 = v11->field_170;
v2 = v11->field_178;
*(&v1) = *(&v12);
v0 = "rekeying %s, input %llu bytes %llu blocks, output %llu bytes %llu blocks";
sshlog("packet.c", "ssh_set_newkeys", 0x378, 0x1, 0x5, 0x0);
kex_free_newkeys(*(&v11->padding_14c[12 + 8 * a1]));
*(&v11->padding_14c[12 + 8 * a1]) = 0;
}
v9->field_8 = 0;
v9->field_4 = 0;
*(&v11->padding_14c[12 + 8 * a1]) = *((a0[1] + a1 * 8));
if (!*(&v11->padding_14c[12 + 8 * a1])) {
v18 = -1;
return v18;
}
*((a0[1] + a1 * 8)) = 0;
v13 = *(&v11->padding_14c[12 + 8 * a1]);
v14 = *(&v11->padding_14c[12 + 8 * a1]) + 48;
*(&v15[0]) = *(&v11->padding_14c[12 + 8 * a1]) + 104;
if (!cipher_authlen(v13->field_8)) {
v7 = mac_init(v14);
if (v7) {
v18 = v7;
return v18;
}
}
v14->field_8 = 1;
cipher_free(*(v8));
*(v8) = 0;
v4 = v6;
v7 = cipher_init(v8, v13->field_8, v13->field_20, v13->field_14, v13->field_28, v13->field_18);
if (v7) {
v18 = v7;
return v18;
}
if (!v11->field_1ec) {
v16 = cipher_warning_message(*(v8));
if (v16) {
v5 = v16;
v4 = "Warning: %s";
sshlog("packet.c", "ssh_set_newkeys", 0x397, 0x0, 0x2, 0x0);
v11->field_1ec = 1;
}
}
if ((v15[0] == 1 || v15[0] == 2 && v11->field_148) && !v15[1]) {
v7 = ssh_packet_init_compression(a0);
if (v7 < 0) {
v18 = v7;
return v18;
}
if (a1 == 1)
v7 = start_compression_out(a0, 0x6);
else
v7 = start_compression_in(a0);
if (v7) {
v18 = v7;
return v18;
}
v15[1] = 1;
}
if (v13->field_1c <= 15)
*(v10) = 0x40000000 /m v13->field_1c;
else
*(v10) = (((v13->field_1c << 1) & 63) ? 1 << ((v13->field_1c * 2) & 63) : 1 << ((v13->field_1c * 2) & 63));
if (v11->field_1a8) {
v20 = (0 CONCAT v11->field_1a8) /m v13->field_1c;
if ((0 CONCAT v11->field_1a8) /m v13->field_1c > (0 CONCAT v11->field_1a8) /m v13->field_1c)
v20 = *(((0 CONCAT v11->field_1a8) /m v13->field_1c));
*(v10) = v20;
}
v4 = *(v10);
*(&v3) = *(&v12);
v2 = "rekey %s after %llu blocks";
sshlog("packet.c", "ssh_set_newkeys", 0x3b8, 0x0, 0x5, 0x0);
v18 = 0;
return v18;
}
|
int
sshkey_equal(const struct sshkey *a, const struct sshkey *b)
{
if (a ==
((void *)0)
|| b ==
((void *)0)
|| a->type != b->type)
return 0;
if (sshkey_is_cert(a)) {
if (!cert_compare(a->cert, b->cert))
return 0;
}
return sshkey_equal_public(a, b);
}
| _BOOL8 sshkey_equal(long a1, long a2)
{
if ( !a1 || !a2 || *(_DWORD *)a1 != *(_DWORD *)a2 )
return 0LL;
if ( !(unsigned int)sshkey_is_cert((int *)a1) || cert_compare(*(_QWORD **)(a1 + 128), *(_QWORD **)(a2 + 128)) )
return sshkey_equal_public(a1, a2);
return 0LL;
}
|
static void print_rxsa_stats(const char *prefix, struct rtattr *attr)
{
struct rtattr *stats[MACSEC_SA_STATS_ATTR_MAX + 1];
if (!attr || show_stats == 0)
return;
(parse_rtattr_flags((stats), (MACSEC_SA_STATS_ATTR_MAX), ((void*)(((char*)(attr)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((attr)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)));
print_stats(prefix, rxsa_stats_names, NUM_MACSEC_SA_STATS_ATTR, stats);
}
| void print_rxsa_stats(unsigned int a0, unsigned short *a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long a5) {
char v0;
char v1;
unsigned long long *v3;
unsigned long long v4;
if (a1 && show_stats) {
parse_rtattr_flags(&v0, 0x7, a1 + 2, *(a1) - 4, 0x8000);
print_stats(a0, &rxsa_stats_names, 0x8, &v0, 0x8000, a5);
}
v4 = *(&v1) ^ v3[5];
return;
}
|
test_code_t test_aes_ccm(gnutls_session_t session)
{
int ret;
sprintf(prio_str, "NONE:"
"+AES-128-CCM:+AES-256-CCM:" "+COMP-NULL"
":%s:" "+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":" "+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH" ":+VKO-GOST-12" ":%s",
protocol_all_str, rest);
{ int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 782)) != TEST_SUCCEED) { return _ret; } };
gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred);
ret = test_do_handshake(session);
return ret;
}
| long long test_aes_ccm(unsigned long long a0) {
unsigned int v0;
unsigned int v1;
unsigned long long v3;
sprintf(&prio_str, "NONE:+AES-128-CCM:+AES-256-CCM:+COMP-NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT:+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH:+VKO-GOST-12:%s", &protocol_all_str, &rest);
v0 = __gnutls_priority_set_direct(a0, &prio_str, 0x30e);
if (v0) {
v3 = v0;
return v3;
}
gnutls_credentials_set(a0, 0x1, xcred);
v1 = test_do_handshake(a0);
v3 = v1;
return v3;
}
|
char *
strip_trailing_ifs_whitespace (string, separators, saw_escape)
char *string, *separators;
int saw_escape;
{
char *s;
s = string + (((string) && (string)[0]) ? ((string)[1] ? ((string)[2] ? strlen(string) : 2) : 1) : 0) - 1;
while (s > string && ((((*s) == ' ' || (*s) == '\t' || (*s) == '\n') && (ifs_cmap[(unsigned char)(*s)] != 0)) ||
(saw_escape && *s == '\001' && ((s[1]) == ' ' || (s[1]) == '\t' || (s[1]) == '\n'))))
s--;
*++s = '\0';
return string;
}
| long long strip_trailing_ifs_whitespace(char a0[3], unsigned long a1, unsigned long a2) {
unsigned long v0;
char v1[2];
unsigned long long v3;
unsigned long long v4;
v0 = a1;
if (a0 && a0[0]) {
if (!a0[1]) {
v3 = 0;
goto LABEL_40881f;
} else if (!a0[2]) {
v3 = 1;
goto LABEL_40881f;
} else {
v3 = strlen(a0) - 1;
goto LABEL_40881f;
}
}
v3 = -1;
LABEL_40881f:
v4 = &a0[v3];
*(&v1) = v4;
while (true) {
if (v1 <= a0)
break;
if (v1[0] != 32 && v1[0] != 9 && !(v1[0] == 10))
goto LABEL_408877;
if (!(!*(v1[0] + &ifs_cmap)))
goto LABEL_40882c;
LABEL_408877:
if (!a2)
break;
if (v1[0] != 1)
break;
if (v1[1] != 32 && v1[1] != 9 && v1[1] != 10)
break;
LABEL_40882c:
*(&v1) = &v1[1];
}
v1 = &v1[1];
*(v1) = 0;
return a0;
}
|
static char *
readnum (char *s, lin *pnum)
{
unsigned char c = *s;
lin num = 0;
if (! ((unsigned int) (c) - '0' <= 9))
return 0;
do
{
num = c - '0' + num * 10;
c = *++s;
}
while (((unsigned int) (c) - '0' <= 9));
*pnum = num;
return s;
}
| byte * readnum(byte *param_1,long *param_2)
{
byte *local_20;
byte local_11;
long local_10;
local_11 = *param_1;
local_10 = 0;
local_20 = param_1;
if (local_11 - 0x30 < 10) {
do {
local_10 = local_10 * 10 + (long)(int)(local_11 - 0x30);
local_20 = local_20 + 1;
local_11 = *local_20;
} while (local_11 - 0x30 < 10);
*param_2 = local_10;
}
else {
local_20 = (byte *)0x0;
}
return local_20;
}
|
static int ipaddr_link_get(int index, struct nlmsg_chain *linfo)
{
struct iplink_req req = {
.n.nlmsg_len = ((sizeof(struct ifinfomsg)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))),
.n.nlmsg_flags = 0x01,
.n.nlmsg_type = RTM_GETLINK,
.i.ifi_family = filter.family,
.i.ifi_index = index,
};
__u32 filt_mask = (1 << 0);
struct nlmsghdr *answer;
if (!show_stats)
filt_mask |= (1 << 3);
addattr32(&req.n, sizeof(req), IFLA_EXT_MASK, filt_mask);
if (rtnl_talk(&rth, &req.n, &answer) < 0) {
perror("Cannot send link request");
return 1;
}
if (store_nlmsg(answer, linfo) < 0) {
fprintf(
stderr
, "Failed to process link information\n");
free(answer);
return 1;
}
free(answer);
return 0;
}
| int ipaddr_link_get(unsigned long a0, void* a1) {
unsigned int v0;
unsigned int v1;
char v2;
unsigned int v3;
unsigned short v4;
unsigned short v5;
char v6;
unsigned int v7;
unsigned long long v9;
unsigned long long *v10;
unsigned long v11;
unsigned int v12;
v0 = a0;
v9 = 132;
for (v10 = &v3; v9; v10 = &v10[v11]) {
v9 -= 1;
v3 = 0;
}
v3 = 32;
v4 = 18;
v5 = 1;
v6 = g_408504;
v7 = v0;
v1 = 1;
if (!show_stats)
v1 |= 8;
addattr32(&v3, 0x420, 0x1d, v1);
if (rtnl_talk(0x5001d0, &v3, &v2) < 0) {
perror("Cannot send link request");
v12 = 1;
return v12;
} else if (store_nlmsg(*(&v2), a1) >= 0) {
free(*(&v2));
v12 = 0;
return v12;
} else {
fprintf(stderr, "Failed to process link information\n");
free(*(&v2));
v12 = 1;
return v12;
}
}
|
void issue_shutdown(char *halttype)
{
char *args[8];
int argp = 0;
int do_halt = (down_level[0] == '0');
issue_warn(0);
if (dontshut) {
hardsleep(1);
stopit(0);
}
openlog("shutdown",
0x01
,
(1<<3)
);
if (do_halt)
syslog(
5
, "shutting down for system halt");
else
syslog(
5
, "shutting down for system reboot");
closelog();
if (doself) fastdown();
args[argp++] = "/sbin/init";
if (sltime) {
args[argp++] = "-t";
args[argp++] = sltime;
}
args[argp++] = down_level;
args[argp] = (char *)
((void *)0)
;
unlink("/var/run/shutdown.pid");
unlink("/etc/nologin");
sync();
init_setenv("INIT_HALT", halttype);
execv("/sbin/init", args);
fprintf(
stderr
, "\rshutdown: cannot execute %s\r\n", "/sbin/init");
unlink("/fastboot");
unlink("/forcefsck");
init_setenv("INIT_HALT",
((void *)0)
);
openlog("shutdown",
0x01
,
(1<<3)
);
syslog(
5
, "shutdown failed");
closelog();
exit(1);
}
| void issue_shutdown(void* a0) {
unsigned int v0;
int tmp_11;
int tmp_12;
int tmp_33;
unsigned int v1;
char v2;
unsigned long v3;
unsigned long long *v5;
unsigned int v6;
unsigned int v7;
unsigned int v8;
unsigned int v9;
unsigned int v10;
v3 = v5[5];
v0 = 0;
v1 = 9892416630128516623 == 48;
issue_warn(0x0);
if (dontshut) {
hardsleep(0x1);
stopit(0x0);
}
openlog("shutdown", 0x1, 0x8);
if (v1)
syslog(0x5, "shutting down for system halt");
else
syslog(0x5, "shutting down for system reboot");
closelog();
if (doself)
fastdown(0x5, v6, v7, v8, v9, v10);
tmp_11 = v0;
v0 += 1;
*(&(&v2)[8 * tmp_11]) = "/sbin/init";
if (sltime) {
tmp_12 = v0;
v0 += 1;
*(&(&v2)[8 * tmp_12]) = "-t";
tmp_33 = v0;
v0 += 1;
*(&(&v2)[8 * tmp_33]) = sltime;
}
tmp_12 = v0;
v0 += 1;
*(&(&v2)[8 * tmp_12]) = &down_level;
*(&(&v2)[8 * v0]) = 0;
unlink("/var/run/shutdown.pid");
unlink("/etc/nologin");
sync();
init_setenv("INIT_HALT", a0);
execv("/sbin/init", &v2);
fprintf(stderr, "\rshutdown: cannot execute %s\r\n", &g_402280);
unlink("/fastboot");
unlink("/forcefsck");
init_setenv("INIT_HALT", NULL);
openlog("shutdown", 0x1, 0x8);
syslog(0x5, "shutdown failed");
closelog();
exit(0x1);
}
|
int
assertverprovides(const char *const *argv)
{
struct dpkg_version version = { 0, "1.17.11",
((void *)0)
};
return assert_version_support(argv, &version, gettext("versioned Provides"));
}
| long long assertverprovides(unsigned long long *a0) {
unsigned int v0;
unsigned long long v1;
void* v2;
v0 = 0;
v1 = "1.17.11";
v2 = 0;
return assert_version_support(a0, &v0, gettext("versioned Provides"));
}
|
static
_Bool
check_label_pattern (const char *label)
{
char *string;
_Bool
result =
0
;
if (fnmatch (volume_label_option, label, 0) == 0)
return
1
;
if (!multi_volume_option)
return
0
;
string = drop_volume_label_suffix (label);
if (string)
{
result = fnmatch (string, volume_label_option, 0) == 0;
free (string);
}
return result;
}
| bool check_label_pattern(char *param_1)
{
int iVar1;
char *__pattern;
bool local_11;
local_11 = false;
iVar1 = fnmatch(volume_label_option,param_1,0);
if (iVar1 == 0) {
local_11 = true;
}
else if (multi_volume_option == '\x01') {
__pattern = (char *)drop_volume_label_suffix(param_1);
if (__pattern != (char *)0x0) {
iVar1 = fnmatch(__pattern,volume_label_option,0);
local_11 = iVar1 == 0;
free(__pattern);
}
}
else {
local_11 = false;
}
return local_11;
}
|
static void print_explain(FILE *f)
{
fprintf(f,
"Usage: ... bridge [ fdb_flush ]\n"
" [ forward_delay FORWARD_DELAY ]\n"
" [ hello_time HELLO_TIME ]\n"
" [ max_age MAX_AGE ]\n"
" [ ageing_time AGEING_TIME ]\n"
" [ stp_state STP_STATE ]\n"
" [ priority PRIORITY ]\n"
" [ group_fwd_mask MASK ]\n"
" [ group_address ADDRESS ]\n"
" [ vlan_filtering VLAN_FILTERING ]\n"
" [ vlan_protocol VLAN_PROTOCOL ]\n"
" [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n"
" [ vlan_stats_enabled VLAN_STATS_ENABLED ]\n"
" [ vlan_stats_per_port VLAN_STATS_PER_PORT ]\n"
" [ mcast_snooping MULTICAST_SNOOPING ]\n"
" [ mcast_vlan_snooping MULTICAST_VLAN_SNOOPING ]\n"
" [ mcast_router MULTICAST_ROUTER ]\n"
" [ mcast_query_use_ifaddr MCAST_QUERY_USE_IFADDR ]\n"
" [ mcast_querier MULTICAST_QUERIER ]\n"
" [ mcast_hash_elasticity HASH_ELASTICITY ]\n"
" [ mcast_hash_max HASH_MAX ]\n"
" [ mcast_last_member_count LAST_MEMBER_COUNT ]\n"
" [ mcast_startup_query_count STARTUP_QUERY_COUNT ]\n"
" [ mcast_last_member_interval LAST_MEMBER_INTERVAL ]\n"
" [ mcast_membership_interval MEMBERSHIP_INTERVAL ]\n"
" [ mcast_querier_interval QUERIER_INTERVAL ]\n"
" [ mcast_query_interval QUERY_INTERVAL ]\n"
" [ mcast_query_response_interval QUERY_RESPONSE_INTERVAL ]\n"
" [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ]\n"
" [ mcast_stats_enabled MCAST_STATS_ENABLED ]\n"
" [ mcast_igmp_version IGMP_VERSION ]\n"
" [ mcast_mld_version MLD_VERSION ]\n"
" [ nf_call_iptables NF_CALL_IPTABLES ]\n"
" [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n"
" [ nf_call_arptables NF_CALL_ARPTABLES ]\n"
"\n"
"Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n"
);
}
| int print_explain(FILE *a1)
{
return fprintf(
a1,
"Usage: ... bridge [ fdb_flush ]\n"
"\t\t [ forward_delay FORWARD_DELAY ]\n"
"\t\t [ hello_time HELLO_TIME ]\n"
"\t\t [ max_age MAX_AGE ]\n"
"\t\t [ ageing_time AGEING_TIME ]\n"
"\t\t [ stp_state STP_STATE ]\n"
"\t\t [ priority PRIORITY ]\n"
"\t\t [ group_fwd_mask MASK ]\n"
"\t\t [ group_address ADDRESS ]\n"
"\t\t [ vlan_filtering VLAN_FILTERING ]\n"
"\t\t [ vlan_protocol VLAN_PROTOCOL ]\n"
"\t\t [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n"
"\t\t [ vlan_stats_enabled VLAN_STATS_ENABLED ]\n"
"\t\t [ vlan_stats_per_port VLAN_STATS_PER_PORT ]\n"
"\t\t [ mcast_snooping MULTICAST_SNOOPING ]\n"
"\t\t [ mcast_vlan_snooping MULTICAST_VLAN_SNOOPING ]\n"
"\t\t [ mcast_router MULTICAST_ROUTER ]\n"
"\t\t [ mcast_query_use_ifaddr MCAST_QUERY_USE_IFADDR ]\n"
"\t\t [ mcast_querier MULTICAST_QUERIER ]\n"
"\t\t [ mcast_hash_elasticity HASH_ELASTICITY ]\n"
"\t\t [ mcast_hash_max HASH_MAX ]\n"
"\t\t [ mcast_last_member_count LAST_MEMBER_COUNT ]\n"
"\t\t [ mcast_startup_query_count STARTUP_QUERY_COUNT ]\n"
"\t\t [ mcast_last_member_interval LAST_MEMBER_INTERVAL ]\n"
"\t\t [ mcast_membership_interval MEMBERSHIP_INTERVAL ]\n"
"\t\t [ mcast_querier_interval QUERIER_INTERVAL ]\n"
"\t\t [ mcast_query_interval QUERY_INTERVAL ]\n"
"\t\t [ mcast_query_response_interval QUERY_RESPONSE_INTERVAL ]\n"
"\t\t [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ]\n"
"\t\t [ mcast_stats_enabled MCAST_STATS_ENABLED ]\n"
"\t\t [ mcast_igmp_version IGMP_VERSION ]\n"
"\t\t [ mcast_mld_version MLD_VERSION ]\n"
"\t\t [ nf_call_iptables NF_CALL_IPTABLES ]\n"
"\t\t [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n"
"\t\t [ nf_call_arptables NF_CALL_ARPTABLES ]\n"
"\n"
"Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n");
}
|
static u_int64_t
handle_bytes_write(int handle)
{
if (handle_is_ok(handle, HANDLE_FILE))
return (handles[handle].bytes_write);
return 0;
}
| int handle_bytes_write(unsigned long a0) {
unsigned int v1;
if (!handle_is_ok(a0, 0x2))
v1 = 0;
else
v1 = *((a0 * 56 + handles + 40));
return v1;
}
|
static void mutate_name(char *str, unsigned int *len)
{
int i;
unsigned int l = *len;
for (i = l-1; i > 0; i--) {
if (!
((*__ctype_b_loc ())[(int) ((
str[i]
))] & (unsigned short int) _ISdigit)
)
break;
}
if ((i == (int)l - 1) || (str[i] != '~')) {
if (((l-1) & 3) < 2)
l += 2;
else
l = (l+3) & ~3;
str[l-2] = '~';
str[l-1] = '0';
*len = l;
return;
}
for (i = l-1; i >= 0; i--) {
if (
((*__ctype_b_loc ())[(int) ((
str[i]
))] & (unsigned short int) _ISdigit)
) {
if (str[i] == '9')
str[i] = '0';
else {
str[i]++;
return;
}
continue;
}
if (i == 1) {
if (str[0] == 'z')
str[0] = 'A';
else if (str[0] == 'Z') {
str[0] = '~';
str[1] = '0';
} else
str[0]++;
} else if (i > 0) {
str[i] = '1';
str[i-1] = '~';
} else {
if (str[0] == '~')
str[0] = 'a';
else
str[0]++;
}
break;
}
}
| void mutate_name(char a0[2], unsigned int *a1) {
unsigned int v0;
unsigned int v1;
unsigned int v4;
unsigned long long v5;
unsigned long long v6;
unsigned int *v7;
unsigned long long v8;
unsigned long long v9;
char v10[2];
char v11[2];
char v12[2];
unsigned long long v13;
char v14[2];
v1 = *(a1);
for (v0 = v1 - 1; v0 > 0; v0 -= 1) {
v4 = *((*(__ctype_b_loc()) + a0[v0] * 2)) & 0x800;
if (!v4)
break;
}
if (v0 != v1 - 1 && a0[v0] == 126) {
v5 = v1 - 1;
for (v0 = v1 - 1; v0 >= 0; v0 -= 1) {
*(&v5) = *((*(__ctype_b_loc()) + a0[v0] * 2));
*(&v5) = v5 & 0x800;
if (v5) {
if (a0[v0] == 57) {
v6 = &a0[v0];
a0[v0] = 48;
} else {
v8 = &a0[v0];
a0[v0] = a0[v0] + 1;
break;
}
} else {
if (v0 == 1) {
if (a0[0] == 122) {
v10 = a0;
a0[0] = 65;
break;
} else if (a0[0] == 90) {
a0[0] = 126;
v13 = &a0[1];
a0[1] = 48;
break;
} else {
v14 = a0;
a0[0] = a0[0] + 1;
break;
}
} else {
if (v0 > 0) {
a0[v0] = 49;
v9 = &a0[1 + v0];
a0[1 + v0] = 126;
break;
} else if (a0[0] == 126) {
v11 = a0;
a0[0] = 97;
break;
} else {
v12 = a0;
a0[0] = a0[0] + 1;
break;
}
}
}
}
}
if (v0 == v1 - 1 || a0[v0] != 126) {
if (!((v1 - 1) & 2))
v1 += 2;
else
v1 = v1 + 3 & -0x4;
a0[1 + v1] = 126;
a0[1 + v1] = 48;
v7 = a1;
*(a1) = v1;
}
return;
}
|
static int
channel_request_rforward_cancel_streamlocal(struct ssh *ssh, const char *path)
{
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_streamlocal(perm, path))
break;
perm =
((void *)0)
;
}
if (perm ==
((void *)0)
) {
sshlog("channels.c", __func__, 4250, 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-streamlocal-forward@openssh.com")) != 0 ||
(r = sshpkt_put_u8(ssh, 0)) != 0 ||
(r = sshpkt_put_cstring(ssh, path)) != 0 ||
(r = sshpkt_send(ssh)) != 0)
sshfatal("channels.c", __func__, 4259, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "send cancel");
fwd_perm_clear(perm);
return 0;
}
| void channel_request_rforward_cancel_streamlocal(struct_0 *a0, char *a1) {
unsigned int v0;
unsigned int v1;
void* v2;
unsigned long v3;
struct_1 *v4;
unsigned long long v6;
void* v7;
v3 = a0->field_868;
v4 = v3 + 32;
v2 = 0;
v1 = 0;
while (true) {
if (v1 >= v4->field_0)
break;
v2 = v1 * 48 + v4->field_8;
if (open_listen_match_streamlocal(v2, a1))
break;
v2 = 0;
v1 += 1;
}
if (!v2) {
sshlog("channels.c", "channel_request_rforward_cancel_streamlocal", 0x109a, 0x1, 0x5, 0x0, "requested forward not found");
v6 = 4294967295;
} else {
v0 = sshpkt_start(a0, 0x50);
if (!v0) {
v0 = sshpkt_put_cstring(a0, "cancel-streamlocal-forward@openssh.com");
if (!v0) {
v0 = sshpkt_put_u8(a0, 0x0);
if (!v0) {
v0 = sshpkt_put_cstring(a0, a1);
if (!v0) {
v0 = sshpkt_send(a0);
if (!v0)
goto LABEL_40e1aa;
}
}
}
}
sshfatal("channels.c", "channel_request_rforward_cancel_streamlocal", 0x10a3, 0x1, 0x1, ssh_err(v0));
LABEL_40e1aa:
fwd_perm_clear(v2);
v7 = 0;
}
return;
}
|
static void
printentry(struct tblentry *cmdp)
{
int idx;
const char *path;
char *name;
idx = cmdp->param.index;
path = ((&(&(&varinit[0])[1])[1])[1].text + 5);
do {
padvance(&path, cmdp->cmdname);
} while (--idx >= 0);
name = ((void *)stacknxt);
outstr((name), out1);
out1fmt(snlfmt, cmdp->rehash ? "*" : nullstr);
}
| void printentry(struct_0 *a0) {
unsigned int v0;
unsigned long v1;
unsigned long long v2;
char v3;
unsigned long long v5;
unsigned long long *v6;
unsigned long long v7;
v0 = a0->field_8;
v1 = onint + 5;
while (true) {
padvance(&v1, a0 + 1);
v0 -= 1;
if (v0 < 0)
break;
}
v2 = stacknxt;
outstr(v2, out1, out1);
if (a0->field_12)
v5 = "*";
else
v5 = &nullstr;
out1fmt(0x5000b8, v5);
v7 = *(&v3) ^ v6[5];
return;
}
|
int
umaskcmd(int argc, char **argv)
{
char *ap;
int mask;
int i;
int symbolic_mode = 0;
while ((i = nextopt("S")) != '\0') {
symbolic_mode = 1;
}
({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; });
mask = umask(0);
umask(mask);
({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; });
if ((ap = *argptr) ==
((void *)0)
) {
if (symbolic_mode) {
char buf[18];
int j;
mask = ~mask;
ap = buf;
for (i = 0; i < 3; i++) {
*ap++ = "ugo"[i];
*ap++ = '=';
for (j = 0; j < 3; j++)
if (mask & (1 << (8 - (3*i + j))))
*ap++ = "rwx"[j];
*ap++ = ',';
}
ap[-1] = '\0';
out1fmt("%s\n", buf);
} else {
out1fmt("%.4o\n", mask);
}
} else {
int new_mask;
if (
((*__ctype_b_loc ())[(int) ((
(unsigned char) *ap
))] & (unsigned short int) _ISdigit)
) {
new_mask = 0;
do {
if (*ap >= '8' || *ap < '0')
sh_error(illnum, *argptr);
new_mask = (new_mask << 3) + (*ap - '0');
} while (*++ap != '\0');
} else {
int positions, new_val;
char op;
mask = ~mask;
new_mask = mask;
positions = 0;
while (*ap) {
while (*ap && strchr("augo", *ap))
switch (*ap++) {
case 'a': positions |= 0111; break;
case 'u': positions |= 0100; break;
case 'g': positions |= 0010; break;
case 'o': positions |= 0001; break;
}
if (!positions)
positions = 0111;
if (!strchr("=+-", op = *ap))
break;
ap++;
new_val = 0;
while (*ap && strchr("rwxugoXs", *ap))
switch (*ap++) {
case 'r': new_val |= 04; break;
case 'w': new_val |= 02; break;
case 'x': new_val |= 01; break;
case 'u': new_val |= mask >> 6;
break;
case 'g': new_val |= mask >> 3;
break;
case 'o': new_val |= mask >> 0;
break;
case 'X': if (mask & 0111)
new_val |= 01;
break;
case 's':
break;
}
new_val = (new_val & 07) * positions;
switch (op) {
case '-':
new_mask &= ~new_val;
break;
case '=':
new_mask = new_val
| (new_mask & ~(positions * 07));
break;
case '+':
new_mask |= new_val;
}
if (*ap == ',') {
positions = 0;
ap++;
} else if (!strchr("=+-", *ap))
break;
}
if (*ap) {
sh_error("Illegal mode: %s", *argptr);
return 1;
}
new_mask = ~new_mask;
}
umask(new_mask);
}
return 0;
}
| long long umaskcmd(unsigned long a0, unsigned long a1) {
unsigned long v0;
int tmp_12;
int tmp_9;
int tmp_14;
int tmp_37;
unsigned int v1;
char v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned int v8;
unsigned int v9;
char *v10;
char v11;
unsigned long long v14;
char *v15;
char *v16;
struct_0 *v17;
v1 = a0;
v0 = a1;
v4 = 0;
while (true) {
v3 = nextopt("S");
if (!v3)
break;
v4 = 1;
}
suppressint = suppressint + 1;
v9 = umask(0x0);
umask(v9);
suppressint = suppressint - 1;
if (!suppressint && intpending)
onint();
v10 = *(argptr);
if (v10) {
v14 = *((*(v10) * 2 + *(__ctype_b_loc()))) & 0x800;
if (!v14) {
v9 = !(v9);
v6 = v9;
v7 = 0;
while (*(v10)) {
while (true) {
if (!*(v10)) {
LABEL_4006a7:
if (!v7)
v7 = 73;
v2 = *(v10);
if (!strchr("=+-", v2))
goto LABEL_40082c;
v10 += 1;
v8 = 0;
while (true) {
if (!*(v10)) {
LABEL_400791:
v8 = (v8 & 7) * v7;
if (v2 == 61) {
v6 = !((v7 * 8) - v7) & v6 | v8;
break;
} else {
if (v2 <= 61) {
if (v2 == 43) {
v6 |= v8;
break;
} else {
if (v2 == 45) {
v6 &= !(v8);
break;
}
}
}
}
} else {
if (!strchr("rwxugoXs", *(v10)))
goto LABEL_400791;
tmp_12 = v10;
v10 += 1;
*(&v14) = *(tmp_12);
v17 = v14 - 88;
switch (v17) {
case 0:
if ((v9 & 73)) {
v8 |= 1;
break;
}
case 15:
v8 |= (v9 >> 3);
break;
case 23:
v8 |= v9;
break;
case 26:
v8 |= 4;
break;
case 27:
break;
case 29:
v8 |= (v9 >> 6);
break;
case 31:
v8 |= 2;
break;
case 32:
v8 |= 1;
break;
}
}
}
if (*(v10) != 44) {
if (strchr("=+-", *(v10)))
break;
} else {
v7 = 0;
v10 += 1;
break;
}
} else {
if (!strchr("augo", *(v10)))
goto LABEL_4006a7;
tmp_9 = v10;
v10 += 1;
v14 = *(tmp_9);
if (v14 == 117) {
v7 |= 64;
} else {
if (v14 <= 117) {
if (v14 == 111) {
v7 |= 1;
} else {
if (v14 <= 111) {
if (v14 == 97) {
v7 |= 73;
} else {
if (v14 == 103)
v7 |= 8;
}
}
}
}
}
}
}
}
LABEL_40082c:
if (*(v10))
sh_error("Illegal mode: %s");
v6 = !(v6);
} else {
v6 = 0;
do {
if (*(v10) <= 55 && !(*(v10) <= 47))
continue;
sh_error(0x5000f0);
v6 = *(v10) - 48 + (v6 * 8);
v10 += 1;
} while (*(v10));
}
umask(v6);
} else if (!v4) {
out1fmt("%.4o\n", v9);
} else {
v9 = !(v9);
v10 = &v11;
for (v3 = 0; v3 <= 2; v3 += 1) {
tmp_14 = v10;
v10 += 1;
*(tmp_14) = *(v3 + &g_400c0d);
tmp_37 = v10;
v10 += 1;
*(tmp_37) = 61;
for (v5 = 0; v5 <= 2; v5 += 1) {
if (((v9 >> ((8 - (v5 + v3 + (v3 << 1))) & 31)) & 1)) {
v15 = v10;
v10 += 1;
*(v15) = *(v5 + &g_400c11);
}
}
v16 = v10;
v10 += 1;
*(v16) = 44;
}
v10[1] = 0;
out1fmt("%s\n", &v11);
}
return 0;
}
|
void __attribute__((visibility ("hidden"))) gz_error(state, err, msg)
gz_statep state;
int err;
const char *msg;
{
if (state->msg !=
((void *)0)
) {
if (state->err != (-4))
free(state->msg);
state->msg =
((void *)0)
;
}
if (err != 0 && err != (-5))
state->x.have = 0;
state->err = err;
if (msg ==
((void *)0)
)
return;
if (err == (-4))
return;
if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) ==
((void *)0)
) {
state->err = (-4);
return;
}
(void)snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
"%s%s%s", state->path, ": ", msg);
}
| void gz_error(struct_0 *a0, unsigned long a1, char *a2) {
struct_0 *v1;
struct_0 *v2;
unsigned long long v3;
if (a0->field_78) {
if (a0->field_74 != -0x4)
free(a0->field_78);
a0->field_78 = 0;
}
if (a1 && a1 != -5)
a0->field_0 = 0;
v1 = a0;
a0->field_74 = a1;
if (a2 && a1 != -0x4) {
a0->field_78 = malloc(strlen(a2) + strlen(a0->field_20) + 3);
if (!a0->field_78) {
v2 = a0;
a0->field_74 = -0x4;
} else {
v3 = snprintf(a0->field_78, strlen(a2) + strlen(a0->field_20) + 3, "%s%s%s", a0->field_20, &g_400e9b, a2);
}
}
return;
}
|
char *
percent_expand(const char *string, ...)
{
char *ret;
int err;
va_list ap;
__builtin_va_start(
ap
,
string
)
;
ret = vdollar_percent_expand(&err, 0, 1, string, ap);
__builtin_va_end(
ap
)
;
if (err)
sshfatal("misc.c", __func__, 1365, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "failed");
return ret;
}
| long long percent_expand() {
char v0;
unsigned long v1;
unsigned int v2;
unsigned int v3;
unsigned long v4;
unsigned long v5;
unsigned long v6;
char v7;
unsigned long v8;
unsigned long v9;
unsigned long v10;
unsigned long v11;
unsigned long v12;
int v13;
int v14;
int v15;
int v16;
int v17;
int v18;
int v19;
int v20;
unsigned long v21;
unsigned long v22;
unsigned long v23;
unsigned long v24;
unsigned long v25;
unsigned long v26;
char v27;
int v28;
int v29;
int v30;
int v31;
int v32;
int v33;
int v34;
int v35;
unsigned long long *v36;
unsigned int v37;
v8 = v22;
v9 = v23;
v10 = v24;
v11 = v25;
v12 = v26;
if (v27) {
v13 = v28;
v14 = v29;
v15 = v30;
v16 = v31;
v17 = v32;
v18 = v33;
v19 = v34;
v20 = v35;
}
v6 = v36[5];
v2 = 8;
v3 = 48;
v4 = &v21;
v5 = &v7;
v1 = vdollar_percent_expand(&v0, 0x0, 0x1, v37, &v2);
if (*(&v0))
sshfatal("misc.c", "percent_expand", 0x555, 0x1, 0x1, 0x0, "failed");
if ((v6 ^ v36[5]))
__stack_chk_fail();
return v1;
}
|
static inline void
emit_ancillary_info (char const *program)
{
struct infomap { char const *program; char const *node; } const infomap[] = {
{ "[", "test invocation" },
{ "coreutils", "Multi-call invocation" },
{ "sha224sum", "sha2 utilities" },
{ "sha256sum", "sha2 utilities" },
{ "sha384sum", "sha2 utilities" },
{ "sha512sum", "sha2 utilities" },
{
((void *)0)
,
((void *)0)
}
};
char const *node = program;
struct infomap const *map_prog = infomap;
while (map_prog->program && ! (strcmp (program, map_prog->program) == 0))
map_prog++;
if (map_prog->node)
node = map_prog->node;
printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https:
char const *lc_messages = setlocale (
5
,
((void *)0)
);
if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1))
{
fputs_unlocked (gettext ("Report any translation bugs to " "<https:
stdout
)
;
}
char const *url_program = (strcmp (program, "[") == 0) ? "test" : program;
printf (gettext ("Full documentation <%s%s>\n"),
"https:
printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"),
node, node == program ? " invocation" : "");
}
| void emit_ancillary_info(char *a0) {
unsigned long v0;
unsigned long long v1[2];
char *v2;
unsigned long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
void* v16;
void* v17;
char v18;
unsigned long long *v21;
unsigned long long v22;
v4 = "[";
v5 = "test invocation";
v6 = "coreutils";
v7 = "Multi-call invocation";
v8 = "sha224sum";
v9 = "sha2 utilities";
v10 = "sha256sum";
v11 = "sha2 utilities";
v12 = "sha384sum";
v13 = "sha2 utilities";
v14 = "sha512sum";
v15 = "sha2 utilities";
v16 = 0;
v17 = 0;
v0 = a0;
for (v1[0] = &v4; v1[0] && strcmp(a0, v1[0]); v1[0] = v1 + 1);
if (v1[1])
v0 = v1[1];
printf(gettext("\n%s online help: <%s>\n"));
v2 = setlocale(0x5, NULL);
if (v2 && strncmp(v2, "en_", 0x3))
fputs_unlocked(gettext("Report any translation bugs to <https:
*(&v3) = (!strcmp(a0, "[") ? a0 : "test");
printf(gettext("Full documentation <%s%s>\n"));
printf(gettext("or available locally via: info '(coreutils) %s%s'\n"));
v22 = *(&v18) ^ v21[5];
return;
}
|
static int
sshkey_parse_private_pem_fileblob(struct sshbuf *blob, int type,
const char *passphrase, struct sshkey **keyp)
{
EVP_PKEY *pk =
((void *)0)
;
struct sshkey *prv =
((void *)0)
;
BIO *bio =
((void *)0)
;
int r;
if (keyp !=
((void *)0)
)
*keyp =
((void *)0)
;
if ((bio = BIO_new(BIO_s_mem())) ==
((void *)0)
|| sshbuf_len(blob) > 0x7fffffff)
return -2;
if (BIO_write(bio, sshbuf_ptr(blob), sshbuf_len(blob)) !=
(int)sshbuf_len(blob)) {
r = -2;
goto out;
}
clear_libcrypto_errors();
if ((pk = PEM_read_bio_PrivateKey(bio,
((void *)0)
, pem_passphrase_cb,
(char *)passphrase)) ==
((void *)0)
) {
if (passphrase !=
((void *)0)
&& *passphrase != '\0')
r = -43;
else
r = convert_libcrypto_error();
goto out;
}
if (
EVP_PKEY_get_base_id
(pk) ==
6
&&
(type == KEY_UNSPEC || type == KEY_RSA)) {
if ((prv = sshkey_new(KEY_UNSPEC)) ==
((void *)0)
) {
r = -2;
goto out;
}
prv->rsa = EVP_PKEY_get1_RSA(pk);
prv->type = KEY_RSA;
if (RSA_blinding_on(prv->rsa,
((void *)0)
) != 1) {
r = -22;
goto out;
}
if ((r = sshkey_check_rsa_length(prv, 0)) != 0)
goto out;
} else if (
EVP_PKEY_get_base_id
(pk) ==
116
&&
(type == KEY_UNSPEC || type == KEY_DSA)) {
if ((prv = sshkey_new(KEY_UNSPEC)) ==
((void *)0)
) {
r = -2;
goto out;
}
prv->dsa = EVP_PKEY_get1_DSA(pk);
prv->type = KEY_DSA;
} else if (
EVP_PKEY_get_base_id
(pk) ==
408
&&
(type == KEY_UNSPEC || type == KEY_ECDSA)) {
if ((prv = sshkey_new(KEY_UNSPEC)) ==
((void *)0)
) {
r = -2;
goto out;
}
prv->ecdsa = EVP_PKEY_get1_EC_KEY(pk);
prv->type = KEY_ECDSA;
prv->ecdsa_nid = sshkey_ecdsa_key_to_nid(prv->ecdsa);
if (prv->ecdsa_nid == -1 ||
sshkey_curve_nid_to_name(prv->ecdsa_nid) ==
((void *)0)
||
sshkey_ec_validate_public(EC_KEY_get0_group(prv->ecdsa),
EC_KEY_get0_public_key(prv->ecdsa)) != 0 ||
sshkey_ec_validate_private(prv->ecdsa) != 0) {
r = -4;
goto out;
}
} else {
r = -4;
goto out;
}
r = 0;
if (keyp !=
((void *)0)
) {
*keyp = prv;
prv =
((void *)0)
;
}
out:
BIO_free(bio);
EVP_PKEY_free(pk);
sshkey_free(prv);
return r;
}
| long sshkey_parse_private_pem_fileblob(long a1, int a2, _BYTE *a3, _QWORD *a4)
{
long v4;
unsigned int v6;
long v7;
int v8;
long v9;
long v10;
unsigned int v13;
long bio_PrivateKey;
_QWORD *v15;
long v16;
bio_PrivateKey = 0LL;
v15 = 0LL;
if ( a4 )
*a4 = 0LL;
v4 = BIO_s_mem();
v16 = BIO_new(v4);
if ( !v16 || (unsigned long)sshbuf_len(a1) >= 0x80000000 )
return 4294967294LL;
v6 = sshbuf_len(a1);
v7 = sshbuf_ptr(a1);
v8 = BIO_write(v16, v7, v6);
if ( v8 == (unsigned int)sshbuf_len(a1) )
{
clear_libcrypto_errors();
bio_PrivateKey = PEM_read_bio_PrivateKey(v16, 0LL, pem_passphrase_cb, a3);
if ( !bio_PrivateKey )
{
if ( a3 && *a3 )
v13 = -43;
else
v13 = convert_libcrypto_error();
goto LABEL_41;
}
if ( (unsigned int)EVP_PKEY_get_base_id(bio_PrivateKey) == 6 && (a2 == 14 || !a2) )
{
v15 = sshkey_new(14);
if ( !v15 )
{
v13 = -2;
goto LABEL_41;
}
v15[1] = EVP_PKEY_get1_RSA(bio_PrivateKey);
*(_DWORD *)v15 = 0;
if ( (unsigned int)RSA_blinding_on(v15[1], 0LL) != 1 )
{
v13 = -22;
goto LABEL_41;
}
v13 = sshkey_check_rsa_length((long)v15, 0);
if ( v13 )
goto LABEL_41;
}
else if ( (unsigned int)EVP_PKEY_get_base_id(bio_PrivateKey) == 116 && (a2 == 14 || a2 == 1) )
{
v15 = sshkey_new(14);
if ( !v15 )
{
v13 = -2;
goto LABEL_41;
}
v15[2] = EVP_PKEY_get1_DSA(bio_PrivateKey);
*(_DWORD *)v15 = 1;
}
else
{
if ( (unsigned int)EVP_PKEY_get_base_id(bio_PrivateKey) != 408 || a2 != 14 && a2 != 2 )
{
v13 = -4;
goto LABEL_41;
}
v15 = sshkey_new(14);
if ( !v15 )
{
v13 = -2;
goto LABEL_41;
}
v15[4] = EVP_PKEY_get1_EC_KEY(bio_PrivateKey);
*(_DWORD *)v15 = 2;
*((_DWORD *)v15 + 6) = sshkey_ecdsa_key_to_nid(v15[4]);
if ( *((_DWORD *)v15 + 6) == -1
|| !sshkey_curve_nid_to_name(*((_DWORD *)v15 + 6))
|| (v9 = EC_KEY_get0_public_key(v15[4]),
v10 = EC_KEY_get0_group(v15[4]),
(unsigned int)sshkey_ec_validate_public(v10, v9))
|| (unsigned int)sshkey_ec_validate_private(v15[4]) )
{
v13 = -4;
goto LABEL_41;
}
}
v13 = 0;
if ( a4 )
{
*a4 = v15;
v15 = 0LL;
}
goto LABEL_41;
}
v13 = -2;
LABEL_41:
BIO_free(v16);
EVP_PKEY_free(bio_PrivateKey);
sshkey_free((long)v15);
return v13;
}
|
vi_repeat_search_prev(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_search.patlen == 0)
return 6;
else
return (cv_repeat_srch(el,
el->el_search.patdir == 24 ?
23 : 24));
}
| long vi_repeat_search_prev(long a1)
{
unsigned int v2;
if ( !*(_QWORD *)(a1 + 1184) )
return 6LL;
if ( *(_DWORD *)(a1 + 1192) == 24 )
v2 = 23;
else
v2 = 24;
return cv_repeat_srch(a1, v2);
}
|
static void endian_convert(void *buf, UWORD bpw, UINT32 num_bytes)
{
UWORD iters = num_bytes / bpw;
if (bpw == 4) {
UINT32 *p = (UINT32 *)buf;
do {
*p = get_u32(p);
p++;
} while (--iters);
} else if (bpw == 8) {
UINT32 *p = (UINT32 *)buf;
UINT32 t;
do {
t = get_u32(p+1);
p[1] = get_u32(p);
p[0] = t;
p += 2;
} while (--iters);
}
}
| void endian_convert(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
unsigned int *v2;
unsigned int v3[2];
unsigned int v5[2];
*(v5) = (0 CONCAT a2) /m a1;
v0 = (0 CONCAT a2) /m a1;
switch (a1) {
case 4:
v2 = a0;
do {
v5[0] = get_u32(v2);
} while ((*(v2) = *(v5), v2 += 4, v0 -= 1, v0));
return;
case 8:
*(&v3[0]) = a0;
do {
v1 = get_u32(&v3[1]);
v3[1] = get_u32(v3);
*(v5) = v3;
v3[0] = v1;
*(&v3[0]) = v3 + 1;
v0 -= 1;
} while (v0);
return;
default:
return;
}
}
|
static
_Bool
two_arguments (void)
{
_Bool
value;
if ((strcmp (argv[pos], "!") == 0))
{
advance (
0
);
value = ! one_argument ();
}
else if (argv[pos][0] == '-'
&& argv[pos][1] != '\0'
&& argv[pos][2] == '\0')
{
value = unary_operator ();
}
else
beyond ();
return (value);
}
| int two_arguments() {
char v0;
unsigned long long v2;
unsigned long long v3;
v2 = strcmp(*((argv + pos * 8)), "!");
if (!v2) {
advance(0x0);
v3 = one_argument();
*(&v3) = v3;
*(&v3) = v3 ^ 1;
v0 = v3;
v0 &= 1;
} else {
if (*(*((argv + (pos << 3)))) == 45 && *((*((argv + (pos << 3))) + 1)) && !*((*((argv + (pos << 3))) + 2)))
v0 = unary_operator();
if (!*((*((argv + (pos << 3))) + 1)) || *(*((argv + (pos << 3)))) != 45 || *((*((argv + (pos << 3))) + 2)))
beyond();
}
if (!v2 || *(*((argv + (pos << 3)))) == 45 && !*((*((argv + (pos << 3))) + 2)) && *((*((argv + (pos << 3))) + 1)))
return v0;
}
|
const char *
rgroup_name(uid_t gid)
{
return idname_lookup(&group_idname, (u_int)gid);
}
| void rgroup_name(undefined4 param_1)
{
idname_lookup(&group_idname,param_1);
return;
}
|
static __inline int
__get_cpuid_count (unsigned int __leaf, unsigned int __subleaf,
unsigned int *__eax, unsigned int *__ebx,
unsigned int *__ecx, unsigned int *__edx)
{
unsigned int __ext = __leaf & 0x80000000;
unsigned int __maxlevel = __get_cpuid_max (__ext, 0);
if (__maxlevel == 0 || __maxlevel < __leaf)
return 0;
__asm__ __volatile__ ("cpuid\n\t" : "=a" (*__eax), "=b" (*__ebx), "=c" (*__ecx), "=d" (*__edx) : "0" (__leaf), "2" (__subleaf));
return 1;
}
| int __get_cpuid_count(unsigned long a0, unsigned long a1, unsigned int *a2, unsigned int *a3, unsigned int *a4, unsigned int *a5) {
unsigned int v0;
unsigned int v1;
unsigned int v3;
unsigned int v4;
v0 = a0 & 0x80000000;
v1 = __get_cpuid_max(v0, NULL, a2, a3);
if (!v1) {
v3 = 0;
return v3;
} else if (v1 < a0) {
v3 = 0;
return v3;
} else {
[D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_CPUID_avx2(GSPTR)
[D] MBusEvent-Imbe_Fence
*(a2) = a0;
*(a3) = v4;
*(a4) = a1;
*(a5) = a1;
v3 = 1;
return v3;
}
}
|
static void
trig_transitional_activate(enum modstatdb_rw cstatus)
{
struct pkg_hash_iter *iter;
struct pkginfo *pkg;
iter = pkg_hash_iter_new();
while ((pkg = pkg_hash_iter_next_pkg(iter))) {
if (pkg->status <= PKG_STAT_HALFINSTALLED)
continue;
debug(dbg_triggersdetail, "trig_transitional_activate %s %s",
pkg_name(pkg, pnaw_always),
pkg_status_name(pkg));
pkg->trigpend_head =
((void *)0)
;
trig_parse_ci(pkg_infodb_get_file(pkg, &pkg->installed,
"triggers"),
cstatus >= msdbrw_write ?
transitional_interest_callback :
transitional_interest_callback_ro,
((void *)0)
,
pkg, &pkg->installed);
if (pkg->status < PKG_STAT_TRIGGERSAWAITED)
continue;
if (pkg->trigaw.head)
pkg_set_status(pkg, PKG_STAT_TRIGGERSAWAITED);
else if (pkg->trigpend_head)
pkg_set_status(pkg, PKG_STAT_TRIGGERSPENDING);
else
pkg_set_status(pkg, PKG_STAT_INSTALLED);
}
pkg_hash_iter_free(iter);
if (cstatus >= msdbrw_write) {
modstatdb_checkpoint();
trig_file_interests_save();
}
}
| void trig_transitional_activate(uint param_1)
{
undefined8 uVar1;
undefined8 uVar2;
undefined8 uVar3;
long lVar4;
code *pcVar5;
uVar1 = pkg_hash_iter_new();
while (lVar4 = pkg_hash_iter_next_pkg(uVar1), lVar4 != 0) {
if (2 < *(uint *)(lVar4 + 0x18)) {
uVar2 = pkg_status_name(lVar4);
uVar3 = pkg_name(lVar4,3);
debug(0x2000,"trig_transitional_activate %s %s",uVar3,uVar2);
*(undefined8 *)(lVar4 + 0x160) = 0;
if (param_1 < 3) {
pcVar5 = transitional_interest_callback_ro;
}
else {
pcVar5 = transitional_interest_callback;
}
uVar2 = pkg_infodb_get_file(lVar4,lVar4 + 0x48,"triggers");
trig_parse_ci(uVar2,pcVar5,0,lVar4,lVar4 + 0x48);
if (4 < *(uint *)(lVar4 + 0x18)) {
if (*(long *)(lVar4 + 0x148) == 0) {
if (*(long *)(lVar4 + 0x160) == 0) {
pkg_set_status(lVar4,7);
}
else {
pkg_set_status(lVar4,6);
}
}
else {
pkg_set_status(lVar4,5);
}
}
}
}
pkg_hash_iter_free(uVar1);
if (2 < param_1) {
modstatdb_checkpoint();
trig_file_interests_save();
}
return;
}
|
int do_ipmonitor(int argc, char **argv)
{
unsigned int groups = 0, lmask = 0;
char *file =
((void *)0)
;
int ifindex = 0;
rtnl_close(&rth);
while (argc > 0) {
if (matches(*argv, "file") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
file = *argv;
} else if (matches(*argv, "label") == 0) {
prefix_banner = 1;
} else if (matches(*argv, "link") == 0) {
lmask |= (1UL << (0));
} else if (matches(*argv, "address") == 0) {
lmask |= (1UL << (1));
} else if (matches(*argv, "route") == 0) {
lmask |= (1UL << (2));
} else if (matches(*argv, "mroute") == 0) {
lmask |= (1UL << (3));
} else if (matches(*argv, "prefix") == 0) {
lmask |= (1UL << (4));
} else if (matches(*argv, "neigh") == 0) {
lmask |= (1UL << (5));
} else if (matches(*argv, "netconf") == 0) {
lmask |= (1UL << (6));
} else if (matches(*argv, "rule") == 0) {
lmask |= (1UL << (8));
} else if (matches(*argv, "nsid") == 0) {
lmask |= (1UL << (9));
} else if (matches(*argv, "nexthop") == 0) {
lmask |= (1UL << (10));
} else if (strcmp(*argv, "stats") == 0) {
lmask |= (1UL << (7));
} else if (strcmp(*argv, "all") == 0) {
prefix_banner = 1;
} else if (matches(*argv, "all-nsid") == 0) {
listen_all_nsid = 1;
} else if (matches(*argv, "help") == 0) {
usage();
} else if (strcmp(*argv, "dev") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ifindex = ll_name_to_index(*argv);
if (!ifindex)
invarg("Device does not exist\n", *argv);
} else {
fprintf(
stderr
, "Argument \"%s\" is unknown, try \"ip monitor help\".\n", *argv);
exit(-1);
}
argc--; argv++;
}
ipaddr_reset_filter(1, ifindex);
iproute_reset_filter(ifindex);
ipmroute_reset_filter(ifindex);
ipneigh_reset_filter(ifindex);
ipnetconf_reset_filter(ifindex);
if (!lmask)
lmask = (~0);
if (lmask & (1UL << (0)))
groups |= nl_mgrp(RTNLGRP_LINK);
if (lmask & (1UL << (1))) {
if (!preferred_family || preferred_family ==
2
)
groups |= nl_mgrp(RTNLGRP_IPV4_IFADDR);
if (!preferred_family || preferred_family ==
10
)
groups |= nl_mgrp(RTNLGRP_IPV6_IFADDR);
}
if (lmask & (1UL << (2))) {
if (!preferred_family || preferred_family ==
2
)
groups |= nl_mgrp(RTNLGRP_IPV4_ROUTE);
if (!preferred_family || preferred_family ==
10
)
groups |= nl_mgrp(RTNLGRP_IPV6_ROUTE);
if (!preferred_family || preferred_family ==
28
)
groups |= nl_mgrp(RTNLGRP_MPLS_ROUTE);
}
if (lmask & (1UL << (3))) {
if (!preferred_family || preferred_family ==
2
)
groups |= nl_mgrp(RTNLGRP_IPV4_MROUTE);
if (!preferred_family || preferred_family ==
10
)
groups |= nl_mgrp(RTNLGRP_IPV6_MROUTE);
}
if (lmask & (1UL << (4))) {
if (!preferred_family || preferred_family ==
10
)
groups |= nl_mgrp(RTNLGRP_IPV6_PREFIX);
}
if (lmask & (1UL << (5))) {
groups |= nl_mgrp(RTNLGRP_NEIGH);
}
if (lmask & (1UL << (6))) {
if (!preferred_family || preferred_family ==
2
)
groups |= nl_mgrp(RTNLGRP_IPV4_NETCONF);
if (!preferred_family || preferred_family ==
10
)
groups |= nl_mgrp(RTNLGRP_IPV6_NETCONF);
if (!preferred_family || preferred_family ==
28
)
groups |= nl_mgrp(RTNLGRP_MPLS_NETCONF);
}
if (lmask & (1UL << (8))) {
if (!preferred_family || preferred_family ==
2
)
groups |= nl_mgrp(RTNLGRP_IPV4_RULE);
if (!preferred_family || preferred_family ==
10
)
groups |= nl_mgrp(RTNLGRP_IPV6_RULE);
}
if (lmask & (1UL << (9))) {
groups |= nl_mgrp(RTNLGRP_NSID);
}
if (file) {
FILE *fp;
int err;
fp = fopen(file, "r");
if (fp ==
((void *)0)
) {
perror("Cannot fopen");
exit(-1);
}
err = rtnl_from_file(fp, accept_msg,
stdout
);
fclose(fp);
return err;
}
if (rtnl_open(&rth, groups) < 0)
exit(1);
if (lmask & (1UL << (10)) &&
rtnl_add_nl_group(&rth, RTNLGRP_NEXTHOP) < 0) {
fprintf(
stderr
, "Failed to add nexthop group to list\n");
exit(1);
}
if (lmask & (1UL << (7)) &&
rtnl_add_nl_group(&rth, RTNLGRP_STATS) < 0) {
fprintf(
stderr
, "Failed to add stats group to list\n");
exit(1);
}
if (listen_all_nsid && rtnl_listen_all_nsid(&rth) < 0)
exit(1);
ll_init_map(&rth);
netns_nsid_socket_init();
netns_map_init();
if (rtnl_listen(&rth, accept_msg,
stdout
) < 0)
exit(2);
return 0;
}
| long do_ipmonitor(int a1, char **a2)
{
unsigned int v5;
int v6;
unsigned int v7;
unsigned int v8;
char *filename;
FILE *stream;
v5 = 0;
v6 = 0;
filename = 0LL;
v7 = 0;
rtnl_close(&rth);
while ( a1 > 0 )
{
if ( (unsigned char)matches(*a2, "file") != 1 )
{
++a2;
if ( --a1 <= 0 )
incomplete_command();
filename = *a2;
}
else if ( (unsigned char)matches(*a2, "label") != 1 )
{
prefix_banner = 1;
}
else if ( (unsigned char)matches(*a2, "link") != 1 )
{
v6 |= 1u;
}
else if ( (unsigned char)matches(*a2, "address") != 1 )
{
v6 |= 2u;
}
else if ( (unsigned char)matches(*a2, "route") != 1 )
{
v6 |= 4u;
}
else if ( (unsigned char)matches(*a2, "mroute") != 1 )
{
v6 |= 8u;
}
else if ( (unsigned char)matches(*a2, "prefix") != 1 )
{
v6 |= 0x10u;
}
else if ( (unsigned char)matches(*a2, "neigh") != 1 )
{
v6 |= 0x20u;
}
else if ( (unsigned char)matches(*a2, "netconf") != 1 )
{
v6 |= 0x40u;
}
else if ( (unsigned char)matches(*a2, "rule") != 1 )
{
v6 |= 0x100u;
}
else if ( (unsigned char)matches(*a2, "nsid") != 1 )
{
v6 |= 0x200u;
}
else if ( (unsigned char)matches(*a2, "nexthop") != 1 )
{
v6 |= 0x400u;
}
else if ( !strcmp(*a2, "stats") )
{
v6 |= 0x80u;
}
else if ( !strcmp(*a2, "all") )
{
prefix_banner = 1;
}
else if ( (unsigned char)matches(*a2, "all-nsid") != 1 )
{
listen_all_nsid = 1;
}
else
{
if ( (unsigned char)matches(*a2, "help") != 1 )
usage();
if ( strcmp(*a2, "dev") )
goto LABEL_41;
++a2;
if ( --a1 <= 0 )
incomplete_command();
v7 = ll_name_to_index(*a2);
if ( !v7 )
{
invarg("Device does not exist\n", *a2);
LABEL_41:
fprintf(stderr, "Argument \"%s\" is unknown, try \"ip monitor help\".\n", *a2);
exit(-1);
}
}
--a1;
++a2;
}
ipaddr_reset_filter(1LL, v7);
iproute_reset_filter(v7);
ipmroute_reset_filter(v7);
ipneigh_reset_filter(v7);
ipnetconf_reset_filter(v7);
if ( !v6 )
LOWORD(v6) = -1;
if ( (v6 & 1) != 0 )
v5 = nl_mgrp(1u);
if ( (v6 & 2) != 0 )
{
if ( !preferred_family || preferred_family == 2 )
v5 |= nl_mgrp(5u);
if ( !preferred_family || preferred_family == 10 )
v5 |= nl_mgrp(9u);
}
if ( (v6 & 4) != 0 )
{
if ( !preferred_family || preferred_family == 2 )
v5 |= nl_mgrp(7u);
if ( !preferred_family || preferred_family == 10 )
v5 |= nl_mgrp(0xBu);
if ( !preferred_family || preferred_family == 28 )
v5 |= nl_mgrp(0x1Bu);
}
if ( (v6 & 8) != 0 )
{
if ( !preferred_family || preferred_family == 2 )
v5 |= nl_mgrp(6u);
if ( !preferred_family || preferred_family == 10 )
v5 |= nl_mgrp(0xAu);
}
if ( (v6 & 0x10) != 0 && (!preferred_family || preferred_family == 10) )
v5 |= nl_mgrp(0x12u);
if ( (v6 & 0x20) != 0 )
v5 |= nl_mgrp(3u);
if ( (v6 & 0x40) != 0 )
{
if ( !preferred_family || preferred_family == 2 )
v5 |= nl_mgrp(0x18u);
if ( !preferred_family || preferred_family == 10 )
v5 |= nl_mgrp(0x19u);
if ( !preferred_family || preferred_family == 28 )
v5 |= nl_mgrp(0x1Du);
}
if ( (v6 & 0x100) != 0 )
{
if ( !preferred_family || preferred_family == 2 )
v5 |= nl_mgrp(8u);
if ( !preferred_family || preferred_family == 10 )
v5 |= nl_mgrp(0x13u);
}
if ( (v6 & 0x200) != 0 )
v5 |= nl_mgrp(0x1Cu);
if ( filename )
{
stream = fopen64(filename, "r");
if ( !stream )
{
perror("Cannot fopen");
exit(-1);
}
v8 = rtnl_from_file(stream, accept_msg, stdout);
fclose(stream);
return v8;
}
else
{
if ( (int)rtnl_open(&rth, v5) < 0 )
exit(1);
if ( (v6 & 0x400) != 0 && (int)rtnl_add_nl_group(&rth, 32LL) < 0 )
{
fprintf(stderr, "Failed to add nexthop group to list\n");
exit(1);
}
if ( (v6 & 0x80) != 0 && (int)rtnl_add_nl_group(&rth, 36LL) < 0 )
{
fprintf(stderr, "Failed to add stats group to list\n");
exit(1);
}
if ( listen_all_nsid && (int)rtnl_listen_all_nsid(&rth) < 0 )
exit(1);
ll_init_map(&rth);
netns_nsid_socket_init();
netns_map_init();
if ( (int)rtnl_listen(&rth, accept_msg, stdout) < 0 )
exit(2);
return 0LL;
}
}
|
static int detect_data_type(s)
deflate_state *s;
{
unsigned long block_mask = 0xf3ffc07fUL;
int n;
for (n = 0; n <= 31; n++, block_mask >>= 1)
if ((block_mask & 1) && (s->dyn_ltree[n].fc.freq != 0))
return 0;
if (s->dyn_ltree[9].fc.freq != 0 || s->dyn_ltree[10].fc.freq != 0
|| s->dyn_ltree[13].fc.freq != 0)
return 1;
for (n = 32; n < 256; n++)
if (s->dyn_ltree[n].fc.freq != 0)
return 1;
return 0;
}
| undefined8 detect_data_type(long param_1)
{
undefined8 uVar1;
int local_14;
ulong local_10;
local_10 = 0xf3ffc07f;
local_14 = 0;
while( true ) {
if (0x1f < local_14) {
if (((*(short *)(param_1 + 0xf8) == 0) && (*(short *)(param_1 + 0xfc) == 0)) &&
(*(short *)(param_1 + 0x108) == 0)) {
for (local_14 = 0x20; local_14 < 0x100; local_14 = local_14 + 1) {
if (*(short *)(param_1 + 4 + ((long)local_14 + 0x34) * 4) != 0) {
return 1;
}
}
uVar1 = 0;
}
else {
uVar1 = 1;
}
return uVar1;
}
if (((local_10 & 1) != 0) && (*(short *)(param_1 + 4 + ((long)local_14 + 0x34) * 4) != 0))
break;
local_14 = local_14 + 1;
local_10 = local_10 >> 1;
}
return 0;
}
|
void
compspec_dispose (cs)
COMPSPEC *cs;
{
cs->refcount--;
if (cs->refcount == 0)
{
do { if (cs->globpat) sh_xfree((cs->globpat), "pcomplib.c", 78); } while (0);
do { if (cs->words) sh_xfree((cs->words), "pcomplib.c", 79); } while (0);
do { if (cs->prefix) sh_xfree((cs->prefix), "pcomplib.c", 80); } while (0);
do { if (cs->suffix) sh_xfree((cs->suffix), "pcomplib.c", 81); } while (0);
do { if (cs->funcname) sh_xfree((cs->funcname), "pcomplib.c", 82); } while (0);
do { if (cs->command) sh_xfree((cs->command), "pcomplib.c", 83); } while (0);
do { if (cs->lcommand) sh_xfree((cs->lcommand), "pcomplib.c", 84); } while (0);
do { if (cs->filterpat) sh_xfree((cs->filterpat), "pcomplib.c", 85); } while (0);
sh_xfree((cs), "pcomplib.c", 87);
}
}
| void compspec_dispose(int *param_1)
{
*param_1 = *param_1 + -1;
if (*param_1 == 0) {
if (*(long *)(param_1 + 6) != 0) {
sh_xfree(*(undefined8 *)(param_1 + 6),"pcomplib.c",0x4e);
}
if (*(long *)(param_1 + 8) != 0) {
sh_xfree(*(undefined8 *)(param_1 + 8),"pcomplib.c",0x4f);
}
if (*(long *)(param_1 + 10) != 0) {
sh_xfree(*(undefined8 *)(param_1 + 10),"pcomplib.c",0x50);
}
if (*(long *)(param_1 + 0xc) != 0) {
sh_xfree(*(undefined8 *)(param_1 + 0xc),"pcomplib.c",0x51);
}
if (*(long *)(param_1 + 0xe) != 0) {
sh_xfree(*(undefined8 *)(param_1 + 0xe),"pcomplib.c",0x52);
}
if (*(long *)(param_1 + 0x10) != 0) {
sh_xfree(*(undefined8 *)(param_1 + 0x10),"pcomplib.c",0x53);
}
if (*(long *)(param_1 + 0x12) != 0) {
sh_xfree(*(undefined8 *)(param_1 + 0x12),"pcomplib.c",0x54);
}
if (*(long *)(param_1 + 0x14) != 0) {
sh_xfree(*(undefined8 *)(param_1 + 0x14),"pcomplib.c",0x55);
}
sh_xfree(param_1,"pcomplib.c",0x57);
}
return;
}
|
DH *
choose_dh(int min, int wantbits, int max)
{
FILE *f;
char *line =
((void *)0)
;
size_t linesize = 0;
int best, bestcount, which, linenum;
struct dhgroup dhg;
if ((f = fopen(get_moduli_filename(), "r")) ==
((void *)0)
) {
sshlog("dh.c", __func__, 168, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "WARNING: could not open %s (%s), using fixed modulus", get_moduli_filename(), strerror(
(*__errno_location ())
))
;
return (dh_new_group_fallback(max));
}
linenum = 0;
best = bestcount = 0;
while (getline(&line, &linesize, f) != -1) {
linenum++;
if (!parse_prime(linenum, line, &dhg))
continue;
BN_clear_free(dhg.g);
BN_clear_free(dhg.p);
if (dhg.size > max || dhg.size < min)
continue;
if ((dhg.size > wantbits && dhg.size < best) ||
(dhg.size > best && best < wantbits)) {
best = dhg.size;
bestcount = 0;
}
if (dhg.size == best)
bestcount++;
}
free(line);
line =
((void *)0)
;
linesize = 0;
rewind(f);
if (bestcount == 0) {
fclose(f);
sshlog("dh.c", __func__, 200, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "WARNING: no suitable primes in %s", get_moduli_filename())
;
return (dh_new_group_fallback(max));
}
which = arc4random_uniform(bestcount);
linenum = 0;
bestcount = 0;
while (getline(&line, &linesize, f) != -1) {
linenum++;
if (!parse_prime(linenum, line, &dhg))
continue;
if ((dhg.size > max || dhg.size < min) ||
dhg.size != best ||
bestcount++ != which) {
BN_clear_free(dhg.g);
BN_clear_free(dhg.p);
continue;
}
break;
}
free(line);
line =
((void *)0)
;
fclose(f);
if (bestcount != which + 1) {
sshlog("dh.c", __func__, 225, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "WARNING: selected prime disappeared in %s, giving up", get_moduli_filename())
;
return (dh_new_group_fallback(max));
}
return (dh_new_group(dhg.g, dhg.p));
}
| long long choose_dh(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
void* v4;
void* v5;
void* v6;
char v7;
char v8;
char v9;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
unsigned int v16;
unsigned long long v18;
v4 = 0;
v5 = 0;
v6 = fopen(get_moduli_filename(), "r");
if (!v6) {
v13 = strerror(*(__errno_location()));
sshlog("dh.c", "choose_dh", 0xa8, 0x0, 0x3, 0x0, "WARNING: could not open %s (%s), using fixed modulus", get_moduli_filename());
v18 = dh_new_group_fallback(a2);
} else {
v2 = 0;
v1 = 0;
v0 = v1;
while (true) {
if (getline(&v4, &v5, v6) != -1) {
v2 = __addvsi3(v2, 0x1);
if (!parse_prime(v2, v4, &v7))
continue;
BN_clear_free(*(&v8));
BN_clear_free(*(&v9));
if (a2 < *(&v7))
continue;
if (a0 > *(&v7))
continue;
if ((v0 < a1 || a1 < *(&v7)) && (a1 < *(&v7) || v0 < *(&v7)) && (v0 < a1 || v0 > *(&v7)) && (v0 < *(&v7) || v0 > *(&v7))) {
v0 = *(&v7);
v1 = 0;
}
if (v0 != *(&v7))
continue;
v1 = __addvsi3(v1, 0x1);
} else {
free(v4);
v4 = 0;
v5 = 0;
rewind(v6);
if (!v1) {
fclose(v6);
sshlog("dh.c", "choose_dh", 0xc8, 0x0, 0x3, 0x0, "WARNING: no suitable primes in %s", get_moduli_filename());
v18 = dh_new_group_fallback(a2);
break;
} else {
v3 = arc4random_uniform(v1);
v2 = 0;
v1 = 0;
while (true) {
v14 = getline(&v4, &v5, v6);
if (v14 != -1) {
v2 = __addvsi3(v2, 0x1);
v15 = parse_prime(v2, v4, &v7);
if (!v15)
continue;
if (v15) {
if (a2 >= *(&v7) && a0 <= *(&v7) && v0 == *(&v7)) {
v16 = v1;
v1 = __addvsi3(v1, 0x1);
}
if (a2 < *(&v7) || a0 > *(&v7) || v0 != *(&v7) || v3 != v16) {
BN_clear_free(*(&v8));
BN_clear_free(*(&v9));
continue;
}
}
}
if (v14 == -1 || a0 <= *(&v7) && v0 == *(&v7) && v3 == v16 && v15 && a2 >= *(&v7)) {
free(v4);
v4 = 0;
fclose(v6);
if (v1 != __addvsi3(v3, 0x1)) {
sshlog("dh.c", "choose_dh", 0xe1, 0x0, 0x3, 0x0, "WARNING: selected prime disappeared in %s, giving up", get_moduli_filename());
v18 = dh_new_group_fallback(a2);
break;
} else {
v18 = dh_new_group(*(&v8), *(&v9));
break;
}
}
}
}
}
}
}
return v18;
}
|
int
ssh_hmac_update_buffer(struct ssh_hmac_ctx *ctx, const struct sshbuf *b)
{
return ssh_digest_update_buffer(ctx->digest, b);
}
| long long ssh_hmac_update_buffer(struct_0 *a0, unsigned long long a1) {
return ssh_digest_update_buffer(a0->field_18, a1, a1);
}
|
static int
redir_varassign (redir, fd)
REDIRECT *redir;
int fd;
{
WORD_DESC *w;
SHELL_VAR *v;
w = redir->redirector.filename;
v = bind_var_to_int (w->word, fd, 0);
if (v == 0 || ((((v)->attributes) & (0x0000002))) || ((((v)->attributes) & (0x0004000))))
return -5;
stupidly_hack_special_variables (w->word);
return 0;
}
| int redir_varassign(struct_0 *a0, unsigned long a1) {
unsigned long long *v0;
struct_1 *v1;
unsigned int v3;
v0 = a0->field_8;
v1 = bind_var_to_int(*(v0), a1, 0x0, a1);
if (!v1) {
v3 = -5;
return v3;
} else if ((v1->field_28 & 2)) {
v3 = -5;
return v3;
} else if ((v1->field_28 & 0x4000)) {
v3 = -5;
return v3;
} else {
stupidly_hack_special_variables(*(v0));
v3 = 0;
return v3;
}
}
|
static void
bind_lastarg (arg)
char *arg;
{
SHELL_VAR *var;
if (arg == 0)
arg = "";
var = bind_variable ("_", arg, 0);
if (var)
((var)->attributes &= ~(0x0000001));
}
| long long bind_lastarg(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long long a3) {
unsigned long long v0;
struct_0 *v1;
struct_0 *v3;
v0 = a0;
if (!v0)
v0 = &g_40b366;
v3 = bind_variable("_", v0, 0x0, a3);
v1 = v3;
if (v1) {
v3 = v1;
v1->field_28 = v1->field_28 & -2;
}
return v3;
}
|
int
move_to_high_fd (fd, check_new, maxfd)
int fd, check_new, maxfd;
{
int script_fd, nfds, ignore;
if (maxfd < 20)
{
nfds = getdtablesize ();
if (nfds <= 0)
nfds = 20;
if (nfds > 256)
nfds = 256;
}
else
nfds = maxfd;
for (nfds--; check_new && nfds > 3; nfds--)
if (fcntl (nfds,
1
, &ignore) == -1)
break;
if (nfds > 3 && fd != nfds && (script_fd = dup2 (fd, nfds)) != -1)
{
if (check_new == 0 || fd != fileno (
stderr
))
close (fd);
return (script_fd);
}
return (fd);
}
| int move_to_high_fd(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned int v0;
unsigned long long v1;
unsigned long long v3;
if (a2 <= 19) {
v0 = getdtablesize();
if (v0 <= 0)
v0 = 20;
if (v0 > 0x100)
v0 = 0x100;
} else {
v0 = a2;
}
for (v0 = v0 - 1; a1; v0 = v0 - 1) {
if (v0 <= 3)
break;
if (v0 > 3) {
v3 = fcntl(v0, 0x1);
if (v3 == -1)
break;
}
}
if (v0 > 3 && a0 != v0) {
*(&v1) = dup2(a0, v0);
if (v1 != -1) {
if (a1)
v3 = fileno(stderr);
if (!a1 || a0 != v3)
close(a0);
*(&v3) = v1;
}
}
if (a0 == v0 || v0 <= 3 || v1 == -1)
*(&v3) = a0;
return v3;
}
|
static void
cpe_dispose (cpe)
struct cpelement *cpe;
{
sh_xfree((cpe), "execute_cmd.c", 1798);
}
| long long cpe_dispose(unsigned long long a0) {
return sh_xfree(a0, "execute_cmd.c", 0x706);
}
|
int
gl_sockets_startup (int version __attribute__ ((__unused__)))
{
return 0;
}
| long gl_sockets_startup()
{
return 0LL;
}
|
static __inline__ void __list_del(struct list_head * prev,
struct list_head * next)
{
next->prev = prev;
prev->next = next;
}
| void __list_del(unsigned long long *a0, struct_0 *a1) {
char v0;
unsigned long long *v2;
unsigned long long v3;
a1->field_8 = a0;
v2 = a0;
*(a0) = a1;
v3 = *(&v0);
return;
}
|
void
usage (int status)
{
if (status !=
0
)
do { fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
else
{
printf (gettext ("Usage: %s [OPTION]... DIRECTORY...\n"), program_name);
fputs_unlocked (gettext ("Remove the DIRECTORY(ies), if they are empty.\n\n"),
stdout
)
;
fputs_unlocked (gettext (" --ignore-fail-on-non-empty\n ignore each failure that is solely because a directory\n is non-empty\n\n"),
stdout
)
;
fputs_unlocked (gettext (" -p, --parents remove DIRECTORY and its ancestors; e.g., 'rmdir -p a/b/c'\n is similar to 'rmdir a/b/c a/b a'\n\n"),
stdout
)
;
fputs_unlocked (gettext (" -v, --verbose output a diagnostic for every directory processed\n"),
stdout
)
;
fputs_unlocked (gettext (" --help display this help and exit\n"),
stdout
);
fputs_unlocked (gettext (" --version output version information and exit\n"),
stdout
);
emit_ancillary_info ("rmdir");
}
exit (status);
}
| void usage(int a1)
{
long v1;
char *v2;
char *v3;
FILE *v4;
char *v5;
FILE *v6;
char *v7;
FILE *v8;
char *v9;
FILE *v10;
char *v11;
FILE *v12;
char *v13;
FILE *v14;
char *v15;
v1 = program_name;
if ( a1 )
{
v2 = gettext("Try '%s --help' for more information.\n");
fprintf(stderr, v2, v1);
}
else
{
v3 = gettext("Usage: %s [OPTION]... DIRECTORY...\n");
printf(v3, v1);
v4 = stdout;
v5 = gettext("Remove the DIRECTORY(ies), if they are empty.\n\n");
fputs_unlocked(v5, v4);
v6 = stdout;
v7 = gettext(
" --ignore-fail-on-non-empty\n"
" ignore each failure that is solely because a directory\n"
" is non-empty\n"
"\n");
fputs_unlocked(v7, v6);
v8 = stdout;
v9 = gettext(
" -p, --parents remove DIRECTORY and its ancestors; e.g., 'rmdir -p a/b/c'\n"
" is similar to 'rmdir a/b/c a/b a'\n"
"\n");
fputs_unlocked(v9, v8);
v10 = stdout;
v11 = gettext(" -v, --verbose output a diagnostic for every directory processed\n");
fputs_unlocked(v11, v10);
v12 = stdout;
v13 = gettext(" --help display this help and exit\n");
fputs_unlocked(v13, v12);
v14 = stdout;
v15 = gettext(" --version output version information and exit\n");
fputs_unlocked(v15, v14);
emit_ancillary_info("rmdir");
}
exit(a1);
}
|
char *
mitos (i)
intmax_t i;
{
char *p, lbuf[(((sizeof (intmax_t) * 8) - (! ((intmax_t) 0 < (intmax_t) -1))) * 302 / 1000 + 1 + (! ((intmax_t) 0 < (intmax_t) -1))) + 1];
p = fmtumax (i, 10, lbuf, sizeof(lbuf), 0);
return (strdup (p));
}
| long long mitos(unsigned long long a0) {
char *v0;
char v1;
v0 = fmtumax(a0, 0xa, &v1, 0x16, 0x0);
return strdup(v0);
}
|
void
sigpipe (sig)
int sig;
{
fprintf (
stderr
, "%d\n", nw);
exit (0);
}
| void sigpipe()
{
fprintf(stderr, "%d\n", (unsigned int)nw);
exit(0);
}
|
static char *
remove_pattern (param, pattern, op)
char *param, *pattern;
int op;
{
char *xret;
if (param ==
((void *)0)
)
return (param);
if (*param == '\0' || pattern ==
((void *)0)
|| *pattern == '\0')
return ((char *)strcpy (sh_xmalloc((1 + strlen (param)), "subst.c", 5287), (param)));
if (
(__ctype_get_mb_cur_max ())
> 1)
{
wchar_t *ret, *oret;
size_t n;
wchar_t *wparam, *wpattern;
mbstate_t ps;
n = xdupmbstowcs (&wpattern,
((void *)0)
, pattern);
if (n == (size_t)-1)
{
xret = remove_upattern (param, pattern, op);
return ((xret == param) ? (char *)strcpy (sh_xmalloc((1 + strlen (param)), "subst.c", 5304), (param)) : xret);
}
n = xdupmbstowcs (&wparam,
((void *)0)
, param);
if (n == (size_t)-1)
{
sh_xfree((wpattern), "subst.c", 5310);
xret = remove_upattern (param, pattern, op);
return ((xret == param) ? (char *)strcpy (sh_xmalloc((1 + strlen (param)), "subst.c", 5312), (param)) : xret);
}
oret = ret = remove_wpattern (wparam, n, wpattern, op);
if (ret == wparam)
{
sh_xfree((wparam), "subst.c", 5319);
sh_xfree((wpattern), "subst.c", 5320);
return ((char *)strcpy (sh_xmalloc((1 + strlen (param)), "subst.c", 5321), (param)));
}
sh_xfree((wparam), "subst.c", 5324);
sh_xfree((wpattern), "subst.c", 5325);
n = strlen (param);
xret = (char *)sh_xmalloc((n + 1), "subst.c", 5328);
memset (&ps, '\0', sizeof (mbstate_t));
n = wcsrtombs (xret, (const wchar_t **)&ret, n, &ps);
xret[n] = '\0';
sh_xfree((oret), "subst.c", 5332);
return xret;
}
else
{
xret = remove_upattern (param, pattern, op);
return ((xret == param) ? (char *)strcpy (sh_xmalloc((1 + strlen (param)), "subst.c", 5339), (param)) : xret);
}
}
| char * remove_pattern(char *a1, _BYTE *a2, int a3)
{
size_t v4;
char *v5;
size_t v6;
char *v7;
size_t v8;
char *v9;
size_t v10;
char *v11;
size_t v12;
char *v13;
wchar_t *src;
wchar_t *v16;
long v17;
char *dst;
size_t len;
wchar_t *v20;
mbstate_t ps;
unsigned long v22;
v22 = __readfsqword(0x28u);
if ( !a1 )
return 0LL;
if ( *a1 && a2 && *a2 )
{
if ( _ctype_get_mb_cur_max() <= 1 )
{
dst = remove_upattern((unsigned long)a1, (long)a2, a3);
if ( dst == a1 )
{
v12 = strlen(a1);
v13 = (char *)sh_xmalloc(v12 + 1, "subst.c", 5339LL);
return strcpy(v13, a1);
}
else
{
return dst;
}
}
else
{
len = xdupmbstowcs(&v17, 0LL, a2);
if ( len == -1LL )
{
dst = remove_upattern((unsigned long)a1, (long)a2, a3);
if ( dst == a1 )
{
v6 = strlen(a1);
v7 = (char *)sh_xmalloc(v6 + 1, "subst.c", 5304LL);
return strcpy(v7, a1);
}
else
{
return dst;
}
}
else
{
len = xdupmbstowcs(&v16, 0LL, a1);
if ( len == -1LL )
{
sh_xfree(v17, "subst.c", 5310LL);
dst = remove_upattern((unsigned long)a1, (long)a2, a3);
if ( dst == a1 )
{
v8 = strlen(a1);
v9 = (char *)sh_xmalloc(v8 + 1, "subst.c", 5312LL);
return strcpy(v9, a1);
}
else
{
return dst;
}
}
else
{
src = remove_wpattern(v16, len, v17, a3);
v20 = src;
if ( src == v16 )
{
sh_xfree(v16, "subst.c", 5319LL);
sh_xfree(v17, "subst.c", 5320LL);
v10 = strlen(a1);
v11 = (char *)sh_xmalloc(v10 + 1, "subst.c", 5321LL);
return strcpy(v11, a1);
}
else
{
sh_xfree(v16, "subst.c", 5324LL);
sh_xfree(v17, "subst.c", 5325LL);
len = strlen(a1);
dst = (char *)sh_xmalloc(len + 1, "subst.c", 5328LL);
memset(&ps, 0, sizeof(ps));
len = wcsrtombs(dst, (const wchar_t **)&src, len, &ps);
dst[len] = 0;
sh_xfree(v20, "subst.c", 5332LL);
return dst;
}
}
}
}
}
else
{
v4 = strlen(a1);
v5 = (char *)sh_xmalloc(v4 + 1, "subst.c", 5287LL);
return strcpy(v5, a1);
}
}
|
static void
chacha_ivsetup(chacha_ctx *x,const u8 *iv)
{
x->input[12] = 0;
x->input[13] = 0;
x->input[14] = (((u32)((iv + 0)[0]) ) | ((u32)((iv + 0)[1]) << 8) | ((u32)((iv + 0)[2]) << 16) | ((u32)((iv + 0)[3]) << 24));
x->input[15] = (((u32)((iv + 4)[0]) ) | ((u32)((iv + 4)[1]) << 8) | ((u32)((iv + 4)[2]) << 16) | ((u32)((iv + 4)[3]) << 24));
}
| void chacha_ivsetup(long param_1,undefined4 *param_2)
{
*(undefined4 *)(param_1 + 0x30) = 0;
*(undefined4 *)(param_1 + 0x34) = 0;
*(undefined4 *)(param_1 + 0x38) = *param_2;
*(undefined4 *)(param_1 + 0x3c) = param_2[1];
return;
}
|
void
platform_post_fork_child(void)
{
oom_adjust_restore();
}
| long long platform_post_fork_child() {
return oom_adjust_restore();
}
|
static int iprule_list_flush_or_save(int argc, char **argv, int action)
{
rtnl_filter_t filter_fn;
int af = preferred_family;
if (af ==
0
)
af =
2
;
if (action == IPRULE_SAVE && argc > 0) {
fprintf(
stderr
, "\"ip rule save\" does not take any arguments.\n");
return -1;
}
switch (action) {
case IPRULE_SAVE:
if (save_rule_prep())
return -1;
filter_fn = save_rule;
break;
case IPRULE_FLUSH:
filter_fn = flush_rule;
break;
default:
filter_fn = print_rule;
}
memset(&filter, 0, sizeof(filter));
while (argc > 0) {
if (matches(*argv, "preference") == 0 ||
matches(*argv, "order") == 0 ||
matches(*argv, "priority") == 0) {
__u32 pref;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&pref, *argv, 0))
invarg("preference value is invalid\n", *argv);
filter.pref = pref;
filter.prefmask = 1;
} else if (strcmp(*argv, "not") == 0) {
filter.not = 1;
} else if (strcmp(*argv, "tos") == 0 ||
strcmp(*argv, "dsfield") == 0) {
__u32 tos;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (rtnl_dsfield_a2n(&tos, *argv))
invarg("TOS value is invalid\n", *argv);
filter.tos = tos;
filter.tosmask = 1;
} else if (strcmp(*argv, "fwmark") == 0) {
char *slash;
__u32 fwmark, fwmask;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
slash = strchr(*argv, '/');
if (slash !=
((void *)0)
)
*slash = '\0';
if (get_u32(&fwmark, *argv, 0))
invarg("fwmark value is invalid\n", *argv);
filter.fwmark = fwmark;
if (slash) {
if (get_u32(&fwmask, slash+1, 0))
invarg("fwmask value is invalid\n",
slash+1);
filter.fwmask = fwmask;
}
} else if (strcmp(*argv, "dev") == 0 ||
strcmp(*argv, "iif") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_ifname(filter.iif, *argv))
invarg("\"iif\"/\"dev\" not a valid ifname", *argv);
filter.iifmask = 1;
} else if (strcmp(*argv, "oif") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_ifname(filter.oif, *argv))
invarg("\"oif\" not a valid ifname", *argv);
filter.oifmask = 1;
} else if (strcmp(*argv, "l3mdev") == 0) {
filter.l3mdev = 1;
} else if (strcmp(*argv, "uidrange") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
filter.uidrange = 1;
if (sscanf(*argv, "%u-%u",
&filter.range.start,
&filter.range.end) != 2)
invarg("invalid UID range\n", *argv);
} else if (matches(*argv, "tun_id") == 0) {
__u64 tun_id;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u64(&tun_id, *argv, 0))
invarg("\"tun_id\" value is invalid\n", *argv);
filter.tun_id = tun_id;
} else if (matches(*argv, "lookup") == 0 ||
matches(*argv, "table") == 0) {
__u32 tid;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (rtnl_rttable_a2n(&tid, *argv))
invarg("table id value is invalid\n", *argv);
filter.tb = tid;
} else if (matches(*argv, "from") == 0 ||
matches(*argv, "src") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_prefix(&filter.src, *argv, af))
invarg("from value is invalid\n", *argv);
} else if (matches(*argv, "protocol") == 0) {
__u32 prot;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
filter.protocolmask = -1;
if (rtnl_rtprot_a2n(&prot, *argv)) {
if (strcmp(*argv, "all") != 0)
invarg("invalid \"protocol\"\n", *argv);
prot = 0;
filter.protocolmask = 0;
}
filter.protocol = prot;
} else if (strcmp(*argv, "ipproto") == 0) {
int ipproto;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ipproto = inet_proto_a2n(*argv);
if (ipproto < 0)
invarg("Invalid \"ipproto\" value\n", *argv);
filter.ipproto = ipproto;
} else if (strcmp(*argv, "sport") == 0) {
struct fib_rule_port_range r;
int ret;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ret = sscanf(*argv, "%hu-%hu", &r.start, &r.end);
if (ret == 1)
r.end = r.start;
else if (ret != 2)
invarg("invalid port range\n", *argv);
filter.sport = r;
} else if (strcmp(*argv, "dport") == 0) {
struct fib_rule_port_range r;
int ret;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ret = sscanf(*argv, "%hu-%hu", &r.start, &r.end);
if (ret == 1)
r.end = r.start;
else if (ret != 2)
invarg("invalid dport range\n", *argv);
filter.dport = r;
} else{
if (matches(*argv, "dst") == 0 ||
matches(*argv, "to") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
}
if (get_prefix(&filter.dst, *argv, af))
invarg("to value is invalid\n", *argv);
}
argc--; argv++;
}
if (rtnl_ruledump_req(&rth, af) < 0) {
perror("Cannot send dump request");
return 1;
}
new_json_obj(json);
if (rtnl_dump_filter_nc(&rth, filter_fn,
stdout
, 0) < 0) {
fprintf(
stderr
, "Dump terminated\n");
return 1;
}
delete_json_obj();
return 0;
}
| void iprule_list_flush_or_save(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned long long *v0;
unsigned int v1;
char v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned short v8;
unsigned long long v9;
char *v10;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
unsigned long long v18;
unsigned long long v19;
unsigned long long v22;
unsigned long long v23;
unsigned long long v29;
unsigned long long v37;
unsigned long long v40;
void* v42;
unsigned long long v43;
v1 = a0;
v0 = a1;
v3 = preferred_family;
if (!v3)
v3 = 2;
if (a2 == 2 && v1 > 0) {
fprintf(*(&stderr), "\"ip rule save\" does not take any arguments.\n");
v13 = 4294967295;
}
if (v1 <= 0 || a2 != 2) {
if (a2 == 1) {
v9 = flush_rule;
} else if (a2 != 2) {
v9 = print_rule;
}
if (a2 == 2) {
v14 = save_rule_prep();
if (v14)
v15 = 4294967295;
else
v9 = save_rule;
}
if (!v14 || a2 == 1 || a2 != 2) {
memset(&filter, 0x0, 0x288);
for (; v1 > 0; v0 += 1) {
*(&v14) = matches(*(v0), "preference") ^ 1;
if (!v14) {
*(&v14) = matches(*(v0), "order") ^ 1;
*(&v14) = matches(*(v0), "priority") ^ 1;
if (!strcmp(*(v0), "not")) {
filter = 1;
} else {
v18 = strcmp(*(v0), "tos");
if (v18) {
v19 = strcmp(*(v0), "dsfield");
if (v19) {
if (!strcmp(*(v0), "fwmark")) {
v0 = v0 + 1;
v1 = v1 - 1;
if (v1 <= 0)
incomplete_command();
v10 = strchr(*(v0), 0x2f);
if (v10)
*(v10) = 0;
if (get_u32(&v2, *(v0), 0x0, *(v0)))
invarg("fwmark value is invalid\n", *(v0));
g_4038e8 = *(&v2);
if (v10) {
if (get_u32(&v7, v10 + 1, 0x0, v10 + 1))
invarg("fwmask value is invalid\n", v10 + 1);
g_4038ec = v7;
}
} else {
v22 = strcmp(*(v0), "dev");
if (v22) {
v23 = strcmp(*(v0), "iif");
if (v23) {
if (!strcmp(*(v0), "oif")) {
v0 = v0 + 1;
v1 = v1 - 1;
if (v1 <= 0)
incomplete_command();
if (get_ifname(&g_403908, *(v0)))
invarg("\"oif\" not a valid ifname", *(v0));
g_4038cc = 1;
} else if (!strcmp(*(v0), "l3mdev")) {
g_4038c4 = 1;
} else {
v29 = strcmp(*(v0), "uidrange");
if (!v29) {
v0 = v0 + 1;
v1 = v1 - 1;
if (v1 <= 0)
incomplete_command();
g_4038d0 = 1;
v29 = __isoc99_sscanf(*(v0), "%u-%u", &g_403918, &g_40391c);
if (v29 != 2)
invarg("invalid UID range\n", *(v0));
}
if (v29 != 2 || v29) {
*(&v29) = matches(*(v0), "tun_id") ^ 1;
if (v29) {
v0 = v0 + 1;
v1 = v1 - 1;
if (v1 <= 0)
incomplete_command();
if (get_u64(&v7, *(v0), 0x0, *(v0)))
invarg("\"tun_id\" value is invalid\n", *(v0));
g_4038f0 = *(&v7);
} else {
*(&v29) = matches(*(v0), "lookup") ^ 1;
if (!v29) {
*(&v29) = matches(*(v0), "table") ^ 1;
*(&v29) = matches(*(v0), "from") ^ 1;
if (!v29) {
*(&v29) = matches(*(v0), "src") ^ 1;
} else {
v0 = v0 + 1;
v1 = v1 - 1;
if (v1 <= 0)
incomplete_command();
v29 = get_prefix(&g_403920, *(v0), v3);
if (v29)
invarg("from value is invalid\n", *(v0));
}
if (!v29 || v29) {
*(&v29) = matches(*(v0), "protocol") ^ 1;
if (v29) {
v0 = v0 + 1;
v1 = v1 - 1;
if (v1 <= 0)
incomplete_command();
g_403b34 = -1;
if (rtnl_rtprot_a2n(&v7, *(v0), *(v0))) {
if (strcmp(*(v0), "all"))
invarg("invalid \"protocol\"\n", *(v0));
v7 = 0;
g_403b34 = 0;
}
g_403b30 = v7;
} else if (!strcmp(*(v0), "ipproto")) {
v0 = v0 + 1;
v1 = v1 - 1;
if (v1 <= 0)
incomplete_command();
v6 = inet_proto_a2n(*(v0));
if (v6 < 0)
invarg("Invalid \"ipproto\" value\n", *(v0));
g_403b40 = v6;
} else if (!strcmp(*(v0), "sport")) {
v0 = v0 + 1;
v1 = v1 - 1;
if (v1 <= 0)
incomplete_command();
v5 = __isoc99_sscanf(*(v0), "%hu-%hu", &v7, &v8);
if (v5 == 1) {
v8 = v7;
} else if (v5 != 2) {
invarg("invalid port range\n", *(v0));
}
g_403b38 = v7;
} else {
v37 = strcmp(*(v0), "dport");
if (!v37) {
v0 = v0 + 1;
v1 = v1 - 1;
if (v1 <= 0)
incomplete_command();
v4 = __isoc99_sscanf(*(v0), "%hu-%hu", &v7, &v8);
if (v4 == 1) {
v8 = v7;
} else if (v4 != 2) {
invarg("invalid dport range\n", *(v0));
}
g_403b3c = v7;
} else {
*(&v37) = matches(*(v0), "dst") ^ 1;
if (!v37) {
*(&v37) = matches(*(v0), "to") ^ 1;
} else {
v0 = v0 + 1;
v1 = v1 - 1;
if (v1 <= 0)
incomplete_command();
}
if (get_prefix(&g_403a28, *(v0), v3))
invarg("to value is invalid\n", *(v0));
}
}
}
} else {
v0 = v0 + 1;
v1 = v1 - 1;
if (v1 <= 0)
incomplete_command();
if (rtnl_rttable_a2n(&v7, *(v0), *(v0)))
invarg("table id value is invalid\n", *(v0));
g_4038d4 = *(&v7);
}
}
}
}
}
}
if (!v23 || !v22) {
v0 = v0 + 1;
v1 = v1 - 1;
if (v1 <= 0)
incomplete_command();
if (get_ifname(&g_4038f8, *(v0)))
invarg("\"iif\"/\"dev\" not a valid ifname", *(v0));
g_4038c8 = 1;
}
}
}
}
if (!v19 || !v18) {
v0 = v0 + 1;
v1 = v1 - 1;
if (v1 <= 0)
incomplete_command();
if (rtnl_dsfield_a2n(&v7, *(v0), *(v0)))
invarg("TOS value is invalid\n", *(v0));
g_4038d8 = v7;
g_4038dc = 1;
}
}
} else {
v0 = v0 + 1;
v1 = v1 - 1;
if (v1 <= 0)
incomplete_command();
if (get_u32(&v7, *(v0), 0x0, *(v0)))
invarg("preference value is invalid\n", *(v0));
g_4038e0 = *(&v7);
g_4038e4 = 1;
}
v1 = v1 - 1;
}
if (rtnl_ruledump_req(0x5001a0, v3) < 0) {
perror("Cannot send dump request");
v40 = 1;
} else {
new_json_obj(json);
if (rtnl_dump_filter_nc(0x5001a0, v9, stdout, 0x0) < 0) {
fprintf(*(&stderr), "Dump terminated\n");
v43 = 1;
} else {
delete_json_obj();
v42 = 0;
}
}
}
}
return;
}
|
static int
_getc_function(EditLine *el __attribute__((__unused__)), wchar_t *c)
{
int i;
i = (*rl_getc_function)(rl_instream);
if (i == -1)
return 0;
*c = (wchar_t)i;
return 1;
}
| long long _getc_function(unsigned long a0, unsigned int *a1) {
unsigned long v0;
unsigned int v1;
unsigned long long v3;
v0 = a0;
v1 = *(*(5242896))(*(got.rl_instream));
if (v1 == -1) {
v3 = 0;
return v3;
}
*(a1) = v1;
v3 = 1;
return v3;
}
|
static void
parse_block_signal_params (char const *optarg,
_Bool
block)
{
char signame[(sizeof "SIGRTMAX" + (((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) - 1)];
char *opt_sig;
char *optarg_writable;
if (! optarg)
{
sigfillset (block ? &block_signals : &unblock_signals);
sigemptyset (block ? &unblock_signals : &block_signals);
}
else if (! sig_mask_changed)
{
sigemptyset (&block_signals);
sigemptyset (&unblock_signals);
}
sig_mask_changed =
1
;
if (! optarg)
return;
optarg_writable = xstrdup (optarg);
opt_sig = strtok (optarg_writable, ",");
while (opt_sig)
{
int signum = operand2sig (opt_sig, signame);
if (signum == 0)
error (0, 0, gettext ("%s: invalid signal"), quote (opt_sig));
if (signum <= 0)
usage (exit_failure);
sigaddset (block ? &block_signals : &unblock_signals, signum);
sigdelset (block ? &unblock_signals : &block_signals, signum);
opt_sig = strtok (
((void *)0)
, ",");
}
free (optarg_writable);
}
| void parse_block_signal_params(long param_1,char param_2)
{
long lVar1;
int __signo;
undefined1 *puVar2;
char *__s;
undefined8 uVar3;
undefined8 uVar4;
long in_FS_OFFSET;
char *local_48;
lVar1 = *(long *)(in_FS_OFFSET + 0x28);
if (param_1 == 0) {
if (param_2 == '\0') {
puVar2 = unblock_signals;
}
else {
puVar2 = block_signals;
}
sigfillset((sigset_t *)puVar2);
if (param_2 == '\0') {
puVar2 = block_signals;
}
else {
puVar2 = unblock_signals;
}
sigemptyset((sigset_t *)puVar2);
}
else if (sig_mask_changed != '\x01') {
sigemptyset((sigset_t *)block_signals);
sigemptyset((sigset_t *)unblock_signals);
}
sig_mask_changed = 1;
if (param_1 != 0) {
__s = (char *)xstrdup(param_1);
local_48 = strtok(__s,",");
while (local_48 != (char *)0x0) {
__signo = operand2sig(local_48);
if (__signo == 0) {
uVar3 = quote(local_48);
uVar4 = gettext("%s: invalid signal");
error(0,0,uVar4,uVar3);
}
if (__signo < 1) {
usage(exit_failure);
}
if (param_2 == '\0') {
puVar2 = unblock_signals;
}
else {
puVar2 = block_signals;
}
sigaddset((sigset_t *)puVar2,__signo);
if (param_2 == '\0') {
puVar2 = block_signals;
}
else {
puVar2 = unblock_signals;
}
sigdelset((sigset_t *)puVar2,__signo);
local_48 = strtok((char *)0x0,",");
}
free(__s);
}
if (lVar1 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static
_Bool
read_line (COLUMN *p)
{
int c;
int chars;
int last_input_position;
int j, k;
COLUMN *q;
c = getc_unlocked (p->fp);
last_input_position = input_position;
if (c == '\f' && p->full_page_printed)
if ((c = getc_unlocked (p->fp)) == '\n')
c = getc_unlocked (p->fp);
p->full_page_printed =
0
;
switch (c)
{
case '\f':
if ((c = getc_unlocked (p->fp)) != '\n')
ungetc (c, p->fp);
FF_only =
1
;
if (print_a_header && !storing_columns)
{
pad_vertically =
1
;
print_header ();
}
else if (keep_FF)
print_a_FF =
1
;
hold_file (p);
return
1
;
case
(-1)
:
close_file (p);
return
1
;
case '\n':
break;
default:
chars = char_to_clump (c);
}
if (truncate_lines && input_position > chars_per_column)
{
input_position = last_input_position;
return
0
;
}
if (p->char_func != store_char)
{
pad_vertically =
1
;
if (print_a_header && !storing_columns)
print_header ();
if (parallel_files && align_empty_cols)
{
k = separators_not_printed;
separators_not_printed = 0;
for (j = 1, q = column_vector; j <= k; ++j, ++q)
{
align_column (q);
separators_not_printed += 1;
}
padding_not_printed = p->start_position;
if (truncate_lines)
spaces_not_printed = chars_per_column;
else
spaces_not_printed = 0;
align_empty_cols =
0
;
}
if (col_sep_length < padding_not_printed)
{
pad_across_to (padding_not_printed - col_sep_length);
padding_not_printed = 0;
}
if (use_col_separator)
print_sep_string ();
}
if (p->numbered)
add_line_number (p);
empty_line =
0
;
if (c == '\n')
return
1
;
print_clump (p, chars, clump_buff);
while (
1
)
{
c = getc_unlocked (p->fp);
switch (c)
{
case '\n':
return
1
;
case '\f':
if ((c = getc_unlocked (p->fp)) != '\n')
ungetc (c, p->fp);
if (keep_FF)
print_a_FF =
1
;
hold_file (p);
return
1
;
case
(-1)
:
close_file (p);
return
1
;
}
last_input_position = input_position;
chars = char_to_clump (c);
if (truncate_lines && input_position > chars_per_column)
{
input_position = last_input_position;
return
0
;
}
print_clump (p, chars, clump_buff);
}
}
| undefined8 read_line(FILE **param_1)
{
int iVar1;
int iVar2;
undefined4 uVar3;
undefined8 uVar4;
int local_24;
undefined4 local_20;
int local_1c;
long local_10;
local_24 = getc_unlocked(*param_1);
iVar2 = input_position;
if (((local_24 == 0xc) && (*(char *)((long)param_1 + 0x39) != '\0')) &&
(local_24 = getc_unlocked(*param_1), local_24 == 10)) {
local_24 = getc_unlocked(*param_1);
}
*(undefined *)((long)param_1 + 0x39) = 0;
if (local_24 == 0xc) {
iVar2 = getc_unlocked(*param_1);
if (iVar2 != 10) {
ungetc(iVar2,*param_1);
}
FF_only = 1;
if ((print_a_header == '\0') || (storing_columns == '\x01')) {
if (keep_FF != '\0') {
print_a_FF = 1;
}
}
else {
pad_vertically = 1;
print_header();
}
hold_file(param_1);
return 1;
}
if (local_24 < 0xd) {
if (local_24 == -1) {
close_file(param_1);
return 1;
}
if (local_24 == 10) goto LAB_0010320b;
}
local_20 = char_to_clump((int)(char)local_24);
LAB_0010320b:
if ((truncate_lines == '\0') || (input_position <= chars_per_column)) {
if (param_1[4] != (FILE *)store_char) {
pad_vertically = 1;
if ((print_a_header != '\0') && (storing_columns != '\x01')) {
print_header();
}
iVar2 = separators_not_printed;
if ((parallel_files != '\0') && (align_empty_cols != '\0')) {
separators_not_printed = 0;
local_10 = column_vector;
for (local_1c = 1; local_1c <= iVar2; local_1c = local_1c + 1) {
align_column(local_10);
separators_not_printed = separators_not_printed + 1;
local_10 = local_10 + 0x40;
}
padding_not_printed = *(int *)((long)param_1 + 0x34);
if (truncate_lines == '\0') {
spaces_not_printed = 0;
}
else {
spaces_not_printed = chars_per_column;
}
align_empty_cols = '\0';
}
if (col_sep_length < padding_not_printed) {
pad_across_to(padding_not_printed - col_sep_length);
padding_not_printed = 0;
}
if (use_col_separator != '\0') {
print_sep_string();
}
}
if (*(char *)(param_1 + 7) != '\0') {
add_line_number(param_1);
}
empty_line = 0;
if (local_24 == 10) {
uVar4 = 1;
}
else {
print_clump(param_1,local_20,clump_buff);
while (iVar1 = getc_unlocked(*param_1), iVar2 = input_position, iVar1 != 0xc) {
if (iVar1 < 0xd) {
if (iVar1 == -1) {
close_file(param_1);
return 1;
}
if (iVar1 == 10) {
return 1;
}
}
uVar3 = char_to_clump((int)(char)iVar1);
if ((truncate_lines != '\0') && (chars_per_column < input_position)) {
input_position = iVar2;
return 0;
}
print_clump(param_1,uVar3,clump_buff);
}
iVar2 = getc_unlocked(*param_1);
if (iVar2 != 10) {
ungetc(iVar2,*param_1);
}
if (keep_FF != '\0') {
print_a_FF = 1;
}
hold_file(param_1);
uVar4 = 1;
}
}
else {
uVar4 = 0;
input_position = iVar2;
}
return uVar4;
}
|
static void
cleanup_redirects (list)
REDIRECT *list;
{
do_redirections (list, 0x01);
dispose_redirects (list);
}
| long cleanup_redirects(long a1)
{
do_redirections(a1, 1LL);
return dispose_redirects(a1);
}
|
static void
print_compactions (acts)
unsigned long acts;
{
const struct _compacts *ca;
for (ca = compacts; ca->actname; ca++)
if (ca->actopt && (acts & ca->actflag))
printf ("-%c ", ca->actopt);
for (ca = compacts; ca->actname; ca++)
if (ca->actopt == 0 && (acts & ca->actflag))
printf ("-A %s ", ca->actname);
}
| char * print_compactions(long a1)
{
char *result;
char **i;
char **j;
for ( i = &compacts; *i; i += 3 )
{
if ( *((_DWORD *)i + 4) && (a1 & (unsigned long)i[1]) != 0 )
printf("-%c ", *((unsigned int *)i + 4));
}
for ( j = &compacts; ; j += 3 )
{
result = *j;
if ( !*j )
break;
if ( !*((_DWORD *)j + 4) && (a1 & (unsigned long)j[1]) != 0 )
printf("-A %s ", *j);
}
return result;
}
|
static void
handle_line_error (const struct control *p, intmax_t repetition)
{
char buf[((((((sizeof (intmax_t) * 8) - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) + 1)];
fprintf (
stderr
, gettext ("%s: %s: line number out of range"),
program_name, quote (imaxtostr (p->lines_required, buf)));
if (repetition)
fprintf (
stderr
, gettext (" on repetition %s\n"), imaxtostr (repetition, buf));
else
fprintf (
stderr
, "\n");
cleanup_fatal ();
}
| void handle_line_error(struct_0 *a0, unsigned long long a1, unsigned long a2) {
char v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned long v5;
unsigned long v6;
unsigned long long *v7;
unsigned long long v8;
v3 = v5;
v2 = v6;
v1 = v7[5];
quote(imaxtostr(a0->field_8, &v0, &v0));
fprintf(stderr, gettext("%s: %s: line number out of range"));
if (a1) {
v8 = imaxtostr(a1, &v0, &v0);
fprintf(stderr, gettext(" on repetition %s\n"));
} else {
fprintf(stderr, "\n");
}
cleanup_fatal();
}
|
static void
enforce_one_top_level (char **pfile_name)
{
char *file_name = *pfile_name;
char *p;
for (p = file_name; *p && (
((
*p
) == '/')
|| *p == '.'); p++)
;
if (*p)
{
int pos = strlen (one_top_level_dir);
if (strncmp (p, one_top_level_dir, pos) == 0)
{
if (
((
p[pos]
) == '/')
|| p[pos] == 0)
return;
}
*pfile_name = make_file_name (one_top_level_dir, file_name);
normalize_filename_x (*pfile_name);
}
else
*pfile_name = xstrdup (one_top_level_dir);
free (file_name);
}
| void enforce_one_top_level(unsigned long long *a0) {
unsigned int v0;
char *v1;
void* v2;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
v2 = *(a0);
for (v1 = v2; *(v1); v1 += 1) {
if (*(v1) != 47) {
if (*(v1) != 46)
break;
}
}
if (*(v1)) {
v0 = strlen(*(&one_top_level_dir));
v4 = strncmp(v1, *(&one_top_level_dir), v0);
if (!v4) {
v5 = v1[v0];
if (v1[v0] != 47)
v6 = v1[v0];
}
if ((v4 || v1[v0] != 47) && (v4 || v1[v0])) {
*(a0) = make_file_name(*(&one_top_level_dir), v2, v2);
normalize_filename_x(*(a0));
}
} else {
*(a0) = xstrdup(*(&one_top_level_dir));
}
if (v1[v0] != 47 || v1[v0])
v7 = free(v2);
return;
}
|
char *
client_request_tun_fwd(struct ssh *ssh, int tun_mode,
int local_tun, int remote_tun, channel_open_fn *cb, void *cbctx)
{
Channel *c;
int r, fd;
char *ifname =
((void *)0)
;
if (tun_mode == 0x00)
return 0;
sshlog("clientloop.c", __func__, 1627, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "Requesting tun unit %d in mode %d", local_tun, tun_mode);
if ((fd = tun_open(local_tun, tun_mode, &ifname)) == -1) {
sshlog("clientloop.c", __func__, 1631, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Tunnel device open failed.");
return
((void *)0)
;
}
sshlog("clientloop.c", __func__, 1634, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "Tunnel forwarding using interface %s", ifname);
c = channel_new(ssh, "tun", 3, fd, fd, -1,
(64*(32*1024)), (32*1024), 0, "tun", 1);
c->datagram = 1;
if (options.tun_open == 0x01)
channel_register_filter(ssh, c->self, sys_tun_infilter,
sys_tun_outfilter,
((void *)0)
,
((void *)0)
);
if (cb !=
((void *)0)
)
channel_register_open_confirm(ssh, c->self, cb, cbctx);
if ((r = sshpkt_start(ssh, 90)) != 0 ||
(r = sshpkt_put_cstring(ssh, "tun@openssh.com")) != 0 ||
(r = sshpkt_put_u32(ssh, c->self)) != 0 ||
(r = sshpkt_put_u32(ssh, c->local_window_max)) != 0 ||
(r = sshpkt_put_u32(ssh, c->local_maxpacket)) != 0 ||
(r = sshpkt_put_u32(ssh, tun_mode)) != 0 ||
(r = sshpkt_put_u32(ssh, remote_tun)) != 0 ||
(r = sshpkt_send(ssh)) != 0)
sshpkt_fatal(ssh, r, "%s: send reply", __func__);
return ifname;
}
| undefined8
client_request_tun_fwd
(undefined8 param_1,int param_2,undefined4 param_3,undefined4 param_4,long param_5,
undefined8 param_6)
{
int iVar1;
long in_FS_OFFSET;
undefined8 uVar2;
int local_28;
undefined8 local_20;
long local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_20 = 0;
if (param_2 == 0) {
uVar2 = 0;
}
else {
sshlog("clientloop.c","client_request_tun_fwd",0x65b,0,5,0,"Requesting tun unit %d in mode %d",
param_3,param_2);
uVar2 = 0x10479c;
iVar1 = tun_open(param_3,param_2,&local_20);
if (iVar1 == -1) {
sshlog("clientloop.c","client_request_tun_fwd",0x65f,0,2,0,"Tunnel device open failed.",uVar2)
;
uVar2 = 0;
}
else {
sshlog("clientloop.c","client_request_tun_fwd",0x662,0,5,0,
"Tunnel forwarding using interface %s",local_20);
local_18 = channel_new(param_1,&DAT_00109afd,3,iVar1,iVar1,0xffffffff,0x200000,0x8000,0,
&DAT_00109afd,1);
*(undefined4 *)(local_18 + 0x120) = 1;
if (_DAT_0010d3b8 == 1) {
channel_register_filter
(param_1,*(undefined4 *)(local_18 + 4),uRam00000000001048b8,uRam00000000001048ae,0
,0);
}
if (param_5 != 0) {
channel_register_open_confirm(param_1,*(undefined4 *)(local_18 + 4),param_5,param_6);
}
local_28 = sshpkt_start(param_1,0x5a);
if (((((local_28 != 0) ||
(local_28 = sshpkt_put_cstring(param_1,"tun@openssh.com"), local_28 != 0)) ||
(local_28 = sshpkt_put_u32(param_1,*(undefined4 *)(local_18 + 4)), local_28 != 0)) ||
((local_28 = sshpkt_put_u32(param_1,*(undefined4 *)(local_18 + 0xb4)), local_28 != 0 ||
(local_28 = sshpkt_put_u32(param_1,*(undefined4 *)(local_18 + 0xbc)), local_28 != 0))))
|| ((local_28 = sshpkt_put_u32(param_1,param_2), local_28 != 0 ||
((local_28 = sshpkt_put_u32(param_1,param_4), local_28 != 0 ||
(local_28 = sshpkt_send(param_1), uVar2 = local_20, local_28 != 0)))))) {
sshpkt_fatal(param_1,local_28,"%s: send reply","client_request_tun_fwd");
uVar2 = local_20;
}
}
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return uVar2;
}
__stack_chk_fail();
}
|
void
urandom_close ()
{
if (urandfd >= 0)
close (urandfd);
urandfd = -1;
}
| int urandom_close()
{
int result;
result = urandfd;
if ( urandfd >= 0 )
result = close(urandfd);
urandfd = -1;
return result;
}
|
static void ZEncrypt(unsigned char *C,const Inputs r,const unsigned char *pk)
{
Fq h[761];
Fq c[761];
Rq_decode(h,pk);
Encrypt(c,r,h);
Rounded_encode(C,c);
}
| void ZEncrypt(unsigned long long a0, unsigned long long a1, unsigned long long a2) {
char v0;
char v1;
char v2;
unsigned long long *v4;
unsigned long long v5;
Rq_decode(&v0, a2, a2);
Encrypt(&v1, a1, &v0);
Rounded_encode(a0, &v1);
v5 = *(&v2) ^ v4[5];
return;
}
|
void
kex_free_newkeys(struct newkeys *newkeys)
{
if (newkeys ==
((void *)0)
)
return;
if (newkeys->enc.key) {
explicit_bzero(newkeys->enc.key, newkeys->enc.key_len);
free(newkeys->enc.key);
newkeys->enc.key =
((void *)0)
;
}
if (newkeys->enc.iv) {
explicit_bzero(newkeys->enc.iv, newkeys->enc.iv_len);
free(newkeys->enc.iv);
newkeys->enc.iv =
((void *)0)
;
}
free(newkeys->enc.name);
explicit_bzero(&newkeys->enc, sizeof(newkeys->enc));
free(newkeys->comp.name);
explicit_bzero(&newkeys->comp, sizeof(newkeys->comp));
mac_clear(&newkeys->mac);
if (newkeys->mac.key) {
explicit_bzero(newkeys->mac.key, newkeys->mac.key_len);
free(newkeys->mac.key);
newkeys->mac.key =
((void *)0)
;
}
free(newkeys->mac.name);
explicit_bzero(&newkeys->mac, sizeof(newkeys->mac));
freezero(newkeys, sizeof(*newkeys));
}
| void kex_free_newkeys(struct_0 *a0) {
unsigned long long v1;
if (!a0)
return;
if (a0->field_20) {
explicit_bzero(a0->field_20, a0->field_14);
free(a0->field_20);
a0->field_20 = 0;
}
if (a0->field_28) {
explicit_bzero(a0->field_28, a0->field_18);
free(a0->field_28);
a0->field_28 = 0;
}
free(a0->field_0);
explicit_bzero(a0, 0x30);
free(a0->field_70);
explicit_bzero(&a0->padding_4c[28], 0x10);
mac_clear(&a0->field_30);
if (a0->field_40) {
explicit_bzero(a0->field_40, a0->field_48);
free(a0->field_40);
a0->field_40 = 0;
}
free(a0->field_30);
explicit_bzero(&a0->field_30, 0x38);
v1 = freezero(a0, 0x78);
return;
}
|
static void
pkg_remove_conffile_on_upgrade(struct pkginfo *pkg, struct fsys_namenode *namenode)
{
struct pkginfo *otherpkg;
struct fsys_namenode *usenode;
struct fsys_node_pkgs_iter *iter;
struct varbuf cdr = { 0, 0,
((void *)0)
};
struct varbuf cdrext = { 0, 0,
((void *)0)
};
struct varbuf_state cdrext_state;
char currenthash[32 + 1];
int rc;
usenode = namenodetouse(namenode, pkg, &pkg->installed);
rc = conffderef(pkg, &cdr, usenode->name);
if (rc == -1) {
debug(dbg_conffdetail, "%s: '%s' conffile dereference error: %s", __func__,
namenode->name, strerror(
(*__errno_location ())
));
namenode->oldhash = "-";
return;
}
varbuf_reset(&cdrext);
varbuf_add_buf(&cdrext, cdr.buf, strlen(cdr.buf));
varbuf_end_str(&cdrext);
varbuf_snapshot(&cdrext, &cdrext_state);
iter = fsys_node_pkgs_iter_new(namenode);
while ((otherpkg = fsys_node_pkgs_iter_next(iter))) {
debug(dbg_conffdetail, "%s: namenode '%s' owned by other %s?",
__func__, namenode->name, pkg_name(otherpkg, pnaw_always));
if (otherpkg == pkg)
continue;
debug(dbg_conff, "%s: namenode '%s' owned by other %s, remove-on-upgrade ignored",
__func__, namenode->name, pkg_name(otherpkg, pnaw_always));
fsys_node_pkgs_iter_free(iter);
return;
}
fsys_node_pkgs_iter_free(iter);
varbuf_rollback(&cdrext, &cdrext_state);
varbuf_add_buf(&cdrext, ".dpkg-dist", strlen(".dpkg-dist"));
varbuf_end_str(&cdrext);
if (unlink(cdrext.buf) < 0 &&
(*__errno_location ())
!=
2
)
warning(gettext("%s: failed to remove '%.250s': %s"),
pkg_name(pkg, pnaw_nonambig), cdrext.buf,
strerror(
(*__errno_location ())
));
md5hash(pkg, currenthash, cdr.buf);
if (strcmp(currenthash, "nonexistent") == 0)
return;
if (strcmp(currenthash, namenode->oldhash) == 0) {
printf(gettext("Removing obsolete conffile %s ...\n"), cdr.buf);
if (unlink(cdr.buf) < 0 &&
(*__errno_location ())
!=
2
)
warning(gettext("%s: failed to remove '%.250s': %s"),
pkg_name(pkg, pnaw_nonambig), cdr.buf, strerror(
(*__errno_location ())
));
return;
}
varbuf_rollback(&cdrext, &cdrext_state);
varbuf_add_buf(&cdrext, ".dpkg-old", strlen(".dpkg-old"));
varbuf_end_str(&cdrext);
printf(gettext("Obsolete conffile '%s' has been modified by you.\n"), cdr.buf);
printf(gettext("Saving as %s ...\n"), cdrext.buf);
if (rename(cdr.buf, cdrext.buf) < 0)
warning(gettext("%s: cannot rename obsolete conffile '%s' to '%s': %s"),
pkg_name(pkg, pnaw_nonambig),
cdr.buf, cdrext.buf, strerror(
(*__errno_location ())
));
}
| void pkg_remove_conffile_on_upgrade(unsigned long long a0, unsigned long long a1[8]) {
unsigned int v0;
char v1;
struct_0 *v2;
unsigned long long v3;
unsigned long long v4;
void* v5;
void* v6;
void* v7;
void* v8;
void* v9;
void* v10;
char v11;
char v12;
unsigned long long v14;
unsigned long long v15;
unsigned long long v16;
unsigned long long v18;
unsigned long long v19;
unsigned long long *v20;
unsigned long long v21;
v5 = 0;
v6 = 0;
v7 = 0;
v8 = 0;
v9 = 0;
v10 = 0;
v2 = namenodetouse(a1, a0, a0 + 72, a0);
v0 = conffderef(a0, &v5, v2->field_8, &v5);
if (v0 == -1) {
strerror(*(__errno_location()));
debug(0x80, "%s: '%s' conffile dereference error: %s", "pkg_remove_conffile_on_upgrade", a1[1]);
a1[7] = "-";
} else {
varbuf_reset(&v8);
varbuf_add_buf(&v8, v7, strlen(v7), v7);
varbuf_end_str(&v8);
varbuf_snapshot(&v8, &v1, &v1);
v3 = fsys_node_pkgs_iter_new(a1);
while (true) {
v4 = fsys_node_pkgs_iter_next(v3);
if (v4) {
pkg_name(v4, 0x3);
debug(0x80, "%s: namenode '%s' owned by other %s?", "pkg_remove_conffile_on_upgrade", a1[1]);
if (v4 == a0)
continue;
pkg_name(v4, 0x3);
debug(0x10, "%s: namenode '%s' owned by other %s, remove-on-upgrade ignored", "pkg_remove_conffile_on_upgrade", a1[1]);
fsys_node_pkgs_iter_free(v3);
break;
} else {
fsys_node_pkgs_iter_free(v3);
varbuf_rollback(&v8, &v1, &v1);
varbuf_add_buf(&v8, ".dpkg-dist", strlen(".dpkg-dist"), v14);
varbuf_end_str(&v8);
v15 = unlink(v10);
if (v15 < 0) {
*(&v15) = *(__errno_location());
if (v15 != 2) {
strerror(*(__errno_location()));
pkg_name(a0, 0x1);
warning(gettext("%s: failed to remove '%.250s': %s"));
}
}
md5hash(a0, &v11, v7, &v11);
v16 = strcmp(&v11, "nonexistent");
if (!v16)
break;
if (v16) {
if (!strcmp(&v11, a1[7])) {
printf(gettext("Removing obsolete conffile %s ...\n"));
v18 = unlink(v7);
if (v18 < 0) {
*(&v18) = *(__errno_location());
if (v18 != 2) {
strerror(*(__errno_location()));
pkg_name(a0, 0x1);
warning(gettext("%s: failed to remove '%.250s': %s"));
}
}
break;
} else {
varbuf_rollback(&v8, &v1, &v1);
varbuf_add_buf(&v8, ".dpkg-old", strlen(".dpkg-old"), &v11);
varbuf_end_str(&v8);
printf(gettext("Obsolete conffile '%s' has been modified by you.\n"));
printf(gettext("Saving as %s ...\n"));
v19 = rename(v7, v10);
if (v19 >= 0)
break;
if (v19 < 0) {
strerror(*(__errno_location()));
pkg_name(a0, 0x1);
warning(gettext("%s: cannot rename obsolete conffile '%s' to '%s': %s"));
break;
}
}
}
}
}
}
v21 = *(&v12) ^ v20[5];
return;
}
|
void
usage (int status)
{
if (status !=
0
)
do { fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
else
{
printf (gettext ("Usage: %s [OPTION]... STRING1 [STRING2]\n")
,
program_name);
fputs_unlocked (gettext ("Translate, squeeze, and/or delete characters from standard input,\nwriting to standard output. STRING1 and STRING2 specify arrays of\ncharacters ARRAY1 and ARRAY2 that control the action.\n\n -c, -C, --complement use the complement of ARRAY1\n -d, --delete delete characters in ARRAY1, do not translate\n -s, --squeeze-repeats replace each sequence of a repeated character\n that is listed in the last specified ARRAY,\n with a single occurrence of that character\n -t, --truncate-set1 first truncate ARRAY1 to length of ARRAY2\n"),
stdout
)
;
fputs_unlocked (gettext (" --help display this help and exit\n"),
stdout
);
fputs_unlocked (gettext (" --version output version information and exit\n"),
stdout
);
fputs_unlocked (gettext ("\nARRAYs are specified as strings of characters. Most represent themselves.\nInterpreted sequences are:\n\n \\NNN character with octal value NNN (1 to 3 octal digits)\n \\\\ backslash\n \\a audible BEL\n \\b backspace\n \\f form feed\n \\n new line\n \\r return\n \\t horizontal tab\n"),
stdout
)
;
fputs_unlocked (gettext (" \\v vertical tab\n CHAR1-CHAR2 all characters from CHAR1 to CHAR2 in ascending order\n [CHAR*] in ARRAY2, copies of CHAR until length of ARRAY1\n [CHAR*REPEAT] REPEAT copies of CHAR, REPEAT octal if starting with 0\n [:alnum:] all letters and digits\n [:alpha:] all letters\n [:blank:] all horizontal whitespace\n [:cntrl:] all control characters\n [:digit:] all digits\n"),
stdout
)
;
fputs_unlocked (gettext (" [:graph:] all printable characters, not including space\n [:lower:] all lower case letters\n [:print:] all printable characters, including space\n [:punct:] all punctuation characters\n [:space:] all horizontal or vertical whitespace\n [:upper:] all upper case letters\n [:xdigit:] all hexadecimal digits\n [=CHAR=] all characters which are equivalent to CHAR\n"),
stdout
)
;
fputs_unlocked (gettext ("\nTranslation occurs if -d is not given and both STRING1 and STRING2 appear.\n-t may be used only when translating. ARRAY2 is extended to length of\nARRAY1 by repeating its last character as necessary. Excess characters\nof ARRAY2 are ignored. Character classes expand in unspecified order;\nwhile translating, [:lower:] and [:upper:] may be used in pairs to\nspecify case conversion. Squeezing occurs after translation or deletion.\n"),
stdout
)
;
emit_ancillary_info ("tr");
}
exit (status);
}
| void usage(unsigned long a0) {
unsigned long v0;
unsigned long v2;
v0 = v2;
if (a0) {
fprintf(stderr, gettext("Try '%s --help' for more information.\n"));
} else {
printf(gettext("Usage: %s [OPTION]... STRING1 [STRING2]\n"));
fputs_unlocked(gettext("Translate, squeeze, and/or delete characters from standard input,\nwriting to standard output. STRING1 and STRING2 specify arrays of\ncharacters ARRAY1 and ARRAY2 that control the action.\n\n -c, -C, --complement use the complement of ARRAY1\n -d, --delete delete characters in ARRAY1, do not translate\n -s, --squeeze-repeats replace each sequence of a repeated character\n that is listed in the last specified ARRAY,\n with a single occurrence of that character\n -t, --truncate-set1 first truncate ARRAY1 to length of ARRAY2\n"), stdout);
fputs_unlocked(gettext(" --help display this help and exit\n"), stdout);
fputs_unlocked(gettext(" --version output version information and exit\n"), stdout);
fputs_unlocked(gettext("\nARRAYs are specified as strings of characters. Most represent themselves.\nInterpreted sequences are:\n\n \\NNN character with octal value NNN (1 to 3 octal digits)\n \\\\ backslash\n \\a audible BEL\n \\b backspace\n \\f form feed\n \\n new line\n \\r return\n \\t horizontal tab\n"), stdout);
fputs_unlocked(gettext(" \\v vertical tab\n CHAR1-CHAR2 all characters from CHAR1 to CHAR2 in ascending order\n [CHAR*] in ARRAY2, copies of CHAR until length of ARRAY1\n [CHAR*REPEAT] REPEAT copies of CHAR, REPEAT octal if starting with 0\n [:alnum:] all letters and digits\n [:alpha:] all letters\n [:blank:] all horizontal whitespace\n [:cntrl:] all control characters\n [:digit:] all digits\n"), stdout);
fputs_unlocked(gettext(" [:graph:] all printable characters, not including space\n [:lower:] all lower case letters\n [:print:] all printable characters, including space\n [:punct:] all punctuation characters\n [:space:] all horizontal or vertical whitespace\n [:upper:] all upper case letters\n [:xdigit:] all hexadecimal digits\n [=CHAR=] all characters which are equivalent to CHAR\n"), stdout);
fputs_unlocked(gettext("\nTranslation occurs if -d is not given and both STRING1 and STRING2 appear.\n-t may be used only when translating. ARRAY2 is extended to length of\nARRAY1 by repeating its last character as necessary. Excess characters\nof ARRAY2 are ignored. Character classes expand in unspecified order;\nwhile translating, [:lower:] and [:upper:] may be used in pairs to\nspecify case conversion. Squeezing occurs after translation or deletion.\n"), stdout);
emit_ancillary_info("tr");
}
exit(a0);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.