input
stringlengths
28
169k
output
stringlengths
20
317k
_Bool in_force(int flags) { return (flags & force_flags) == flags; }
uint in_force(uint param_1) { return force_flags & param_1 & 0xffffff00 | (uint)(param_1 == (force_flags & param_1)); }
void set_var_read_only (name) char *name; { SHELL_VAR *entry; do { entry = find_variable (name); if (!entry) { entry = bind_variable (name, "", 0); if (entry) entry->attributes |= 0x0001000; } } while (0); ((entry)->attributes |= (0x0000002)); }
long long set_var_read_only(unsigned long long a0) { struct_0 *v0; int tmp_17; unsigned long long v2; v0 = find_variable(a0); if (!v0) { v0 = bind_variable(a0, &g_40bcf4, 0x0); if (v0) { v2 = v0->field_28; *(&v2) = (v0->field_28 >> 8) | 16; tmp_17 = v2; v0->field_28 = tmp_17; } } v0->field_28 = v0->field_28 | 2; return v0; }
static void reapChild(void) { pid_t child; do { int status; child = waitpid(-1, &status, 1 ); if(child != -1 && child != 0) { glblReportChildProcessExit(runConf, ((void *)0) , child, status); } } while(child > 0); }
void reapChild() { char v0; unsigned int v1; char v2; unsigned long long *v4; unsigned long long v5; do { v1 = waitpid(0xffffffff, &v0, 0x1); if (v1 != -1 && v1) glblReportChildProcessExit(runConf, 0x0, v1, *(&v0)); } while (v1 > 0); v5 = *(&v2) ^ v4[5]; return; }
static int open_compressed_archive (void) { archive = ((!force_local_option && (rmt_dev_name__ = strchr (archive_name_array[0], ':')) && rmt_dev_name__ > (archive_name_array[0]) && ! memchr (archive_name_array[0], '/', rmt_dev_name__ - (archive_name_array[0]))) ? rmt_open__ (archive_name_array[0], 00 | 0 , (1 << 30), rsh_command_option) : open (archive_name_array[0], 00 | 0 , ( 0200 | (0200 >> 3) | ((0200 >> 3) >> 3) | ( 0400 | (0400 >> 3) | ((0400 >> 3) >> 3) )))) ; if (archive == -1) return archive; if (!multi_volume_option) { if (!use_compress_program_option) { _Bool shortfile; enum compress_type type = check_compressed_archive (&shortfile); switch (type) { case ct_tar: if (shortfile) do { if (error_hook) error_hook (); error (0, 0, gettext ("This does not look like a tar archive")); exit_status = 2; } while (0); return archive; case ct_none: if (shortfile) do { if (error_hook) error_hook (); error (0, 0, gettext ("This does not look like a tar archive")); exit_status = 2; } while (0); set_compression_program_by_suffix (archive_name_array[0], ((void *)0) ); if (!use_compress_program_option) return archive; break; default: archive_compression_type = type; break; } } (((archive) >= (1 << 30)) ? rmt_close__ (archive - (1 << 30)) : close (archive)); hit_eof = 0 ; child_pid = sys_child_open_for_uncompress (); read_full_records = 1 ; } records_read = 0; record_end = record_start; return archive; }
int open_compressed_archive(unsigned long long a0, unsigned int a1, unsigned short a2, unsigned long a3, unsigned long long a4, unsigned long long a5) { char v0; unsigned int v1; unsigned long long v3; if ((force_local_option ^ 1)) { rmt_dev_name__ = strchr(*(archive_name_array), 0x3a); if (rmt_dev_name__ && *(archive_name_array) < rmt_dev_name__ && !memchr(*(archive_name_array), 0x2f, rmt_dev_name__ - *(archive_name_array))) { v3 = rmt_open__(*(archive_name_array), 0x0, 0x40000000, rsh_command_option); goto LABEL_400897; } } v3 = open(*(archive_name_array), 0x0, 0x1b6); LABEL_400897: archive = v3; if (archive == -1) { *(&v3) = archive; } else { if ((multi_volume_option ^ 1)) { if (!use_compress_program_option) { v1 = check_compressed_archive(&v0); if (!v1) { if (v0) { if (*(&error_hook)) *(5243096)(); error(0x0, 0x0, gettext("This does not look like a tar archive")); exit_status = 2; } set_compression_program_by_suffix(*(archive_name_array), 0x0); if (!use_compress_program_option) { *(&v3) = archive; goto LABEL_400a30; } } else if (v1 != 1) { archive_compression_type = v1; } else { if (v0) { if (*(&error_hook)) *(5243096)(); error(0x0, 0x0, gettext("This does not look like a tar archive")); exit_status = 2; } *(&v3) = archive; goto LABEL_400a30; } } if (archive <= 1073741823) { *(&a0) = archive; close(archive); } else { rmt_close__(archive - 0x40000000); } hit_eof = 0; v3 = sys_child_open_for_uncompress(a0, 0x0, 0x1b6, rsh_command_option, a4, a5); child_pid = v3; read_full_records = 1; } continued_file_offset = 0; continued_file_offset = 16752697132039570248; *(&v3) = archive; } LABEL_400a30: return v3; }
static int kex_to_blob(struct sshbuf *m, struct kex *kex) { int r; if ((r = sshbuf_put_u32(m, kex->we_need)) != 0 || (r = sshbuf_put_cstring(m, kex->hostkey_alg)) != 0 || (r = sshbuf_put_u32(m, kex->hostkey_type)) != 0 || (r = sshbuf_put_u32(m, kex->hostkey_nid)) != 0 || (r = sshbuf_put_u32(m, kex->kex_type)) != 0 || (r = sshbuf_put_stringb(m, kex->my)) != 0 || (r = sshbuf_put_stringb(m, kex->peer)) != 0 || (r = sshbuf_put_stringb(m, kex->client_version)) != 0 || (r = sshbuf_put_stringb(m, kex->server_version)) != 0 || (r = sshbuf_put_stringb(m, kex->session_id)) != 0 || (r = sshbuf_put_u32(m, kex->flags)) != 0) return r; return 0; }
int kex_to_blob(unsigned long long a0, struct_0 *a1) { unsigned int v0; unsigned int v2; v0 = sshbuf_put_u32(a0, a1->field_10, a1->field_10); if (v0) { LABEL_4058df: v2 = v0; } else { v0 = sshbuf_put_cstring(a0, a1->field_28, a1->field_28); if (!(!v0)) goto LABEL_4058df; v0 = sshbuf_put_u32(a0, a1->field_30, a1->field_30); if (!(!v0)) goto LABEL_4058df; v0 = sshbuf_put_u32(a0, a1->field_34, a1->field_34); if (!(!v0)) goto LABEL_4058df; v0 = sshbuf_put_u32(a0, a1->field_38, a1->field_38); if (!(!v0)) goto LABEL_4058df; v0 = sshbuf_put_stringb(a0, a1->field_50, a1->field_50); if (!(!v0)) goto LABEL_4058df; v0 = sshbuf_put_stringb(a0, a1->field_58, a1->field_58); if (!(!v0)) goto LABEL_4058df; v0 = sshbuf_put_stringb(a0, a1->field_60, a1->field_60); if (!(!v0)) goto LABEL_4058df; v0 = sshbuf_put_stringb(a0, a1->field_68, a1->field_68); if (!(!v0)) goto LABEL_4058df; v0 = sshbuf_put_stringb(a0, a1->field_70, a1->field_70); if (!(!v0)) goto LABEL_4058df; v0 = sshbuf_put_u32(a0, a1->field_8c, a1->field_8c); if (!(!v0)) goto LABEL_4058df; v2 = 0; } return v2; }
void print_cert_info(gnutls_session_t session, int verbose, int print_cert) { print_cert_info2(session, verbose, stdout , print_cert); }
void print_cert_info(unsigned long long a0, unsigned long a1, unsigned long a2) { unsigned long long v1; v1 = print_cert_info2(a0, a1, stdout, a2); return; }
void session_pty_cleanup2(Session *s) { if (s == ((void *)0) ) { sshlog("session.c", __func__, 2265, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "no session"); return; } if (s->ttyfd == -1) return; sshlog("session.c", __func__, 2271, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "session %d release %s", s->self, s->tty); if (s->pid != 0) record_logout(s->pid, s->tty, s->pw->pw_name); if (getuid() == 0) pty_release(s->tty); if (s->ptymaster != -1 && close(s->ptymaster) == -1) sshlog("session.c", __func__, 2287, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "close(s->ptymaster/%d): %s", s->ptymaster, strerror( (*__errno_location ()) )) ; s->ttyfd = -1; }
long session_pty_cleanup2(long a1) { long result; int *v2; char *v3; if ( !a1 ) return sshlog("session.c", "session_pty_cleanup2", 2265LL, 1LL, 2LL, 0LL, "no session"); result = *(unsigned int *)(a1 + 52); if ( (_DWORD)result != -1 ) { sshlog( "session.c", "session_pty_cleanup2", 2271LL, 1LL, 5LL, 0LL, "session %d release %s", *(unsigned int *)(a1 + 4), (const char *)(a1 + 76)); if ( *(_DWORD *)(a1 + 32) ) record_logout(*(unsigned int *)(a1 + 32), a1 + 76, **(_QWORD **)(a1 + 16)); if ( !getuid() ) pty_release(a1 + 76); if ( *(_DWORD *)(a1 + 56) != -1 && close(*(_DWORD *)(a1 + 56)) == -1 ) { v2 = _errno_location(); v3 = strerror(*v2); sshlog( "session.c", "session_pty_cleanup2", 2287LL, 0LL, 2LL, 0LL, "close(s->ptymaster/%d): %s", *(unsigned int *)(a1 + 56), v3); } result = a1; *(_DWORD *)(a1 + 52) = -1; } return result; }
static void check_flags (void) { if (sflg && !( ((void *)0) != crypt_method)) { fprintf ( stderr , gettext ("%s: %s flag is only allowed with the %s flag\n"), Prog, "-s", "-c"); usage (2); } if ((eflg && (md5flg || ( ((void *)0) != crypt_method))) || (md5flg && ( ((void *)0) != crypt_method))) { fprintf ( stderr , gettext ("%s: the -c, -e, and -m flags are exclusive\n"), Prog); usage (2); } if (( ((void *)0) != crypt_method)) { if ( (0 != strcmp (crypt_method, "DES")) && (0 != strcmp (crypt_method, "MD5")) && (0 != strcmp (crypt_method, "NONE")) && (0 != strcmp (crypt_method, "SHA256")) && (0 != strcmp (crypt_method, "SHA512")) ) { fprintf ( stderr , gettext ("%s: unsupported crypt method: %s\n"), Prog, crypt_method); usage (2); } } }
void check_flags() { unsigned long long v1; unsigned long long v2; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; if (sflg && !crypt_method) { fprintf(*(&stderr), gettext("%s: %s flag is only allowed with the %s flag\n")); usage(0x2); } if (!sflg || crypt_method) { if (eflg && md5flg || eflg && crypt_method || md5flg && crypt_method) { fprintf(*(&stderr), gettext("%s: the -c, -e, and -m flags are exclusive\n")); usage(0x2); } if (!eflg && !md5flg || !eflg && !crypt_method || !md5flg && !crypt_method) { v1 = crypt_method; if (crypt_method) { v2 = strcmp(crypt_method, "DES"); if (v2) { v3 = strcmp(crypt_method, "MD5"); if (v3) { v4 = strcmp(crypt_method, "NONE"); if (v4) { v5 = strcmp(crypt_method, "SHA256"); if (v5) { v6 = strcmp(crypt_method, "SHA512"); if (v6) { fprintf(*(&stderr), gettext("%s: unsupported crypt method: %s\n")); usage(0x2); } } } } } } if (!v2 || !v4 || !v6 || !v3 || !v5 || !crypt_method) return; } } }
int auth_shadow_pwexpired(Authctxt *ctxt) { struct spwd *spw = ((void *)0) ; const char *user = ctxt->pw->pw_name; time_t today; int r, daysleft, disabled = 0; if ((spw = getspnam((char *)user)) == ((void *)0) ) { sshlog("auth-shadow.c", __func__, 96, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Could not get shadow information for %.100s", user); return 0; } today = time( ((void *)0) ) / (24L * 60 * 60); sshlog("auth-shadow.c", __func__, 101, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "%s: today %d sp_lstchg %d sp_max %d", __func__, (int)today, (int)spw->sp_lstchg, (int)spw->sp_max) ; daysleft = spw->sp_lstchg + spw->sp_max - today; if (disabled) { sshlog("auth-shadow.c", __func__, 122, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "password expiration disabled"); } else if (spw->sp_lstchg == 0) { sshlog("auth-shadow.c", __func__, 124, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "User %.100s password has expired (root forced)", user); return 1; } else if (spw->sp_max == -1) { sshlog("auth-shadow.c", __func__, 127, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "password expiration disabled"); } else if (daysleft < 0) { sshlog("auth-shadow.c", __func__, 129, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "User %.100s password has expired (password aged)", user); return 1; } else if (daysleft <= spw->sp_warn) { sshlog("auth-shadow.c", __func__, 132, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "password will expire in %d days", daysleft); if ((r = sshbuf_putf(loginmsg, "Your password will expire in %d day%s.\n", daysleft, daysleft == 1 ? "" : "s")) != 0) sshfatal("auth-shadow.c", __func__, 136, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: buffer error: %s", __func__, ssh_err(r)); } return 0; }
long long auth_shadow_pwexpired(struct_0 *a0) { char v0; char v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned long long v5[6]; unsigned long long v6; unsigned long long v7; unsigned long long v10; unsigned long long v11; v5 = 0; v6 = a0->field_30->field_0; v2 = 0; v5[0] = getspnam(v6); if (!v5) { sshlog("auth-shadow.c", "auth_shadow_pwexpired", 0x60, 0x0, 0x2, 0x0, "Could not get shadow information for %.100s", v6, *(&v1), a0); v10 = 0; } else { v7 = (time(NULL) * 1749024623285053783 >> 64 >> 13) - (time(NULL) >> 63); sshlog("auth-shadow.c", "auth_shadow_pwexpired", 0x65, 0x0, 0x7, 0x0, "%s: today %d sp_lstchg %d sp_max %d", "auth_shadow_pwexpired", v7, v5[2]); v3 = v5[2] + v5[4] - v7; if (v2) { sshlog("auth-shadow.c", "auth_shadow_pwexpired", 0x7a, 0x0, 0x7, 0x0, "password expiration disabled", *(&v0), *(&v1), a0); } else if (!v5[2]) { sshlog("auth-shadow.c", "auth_shadow_pwexpired", 0x7c, 0x0, 0x3, 0x0, "User %.100s password has expired (root forced)", v6, *(&v1), a0); v10 = 1; } else if (v5[4] == -1) { sshlog("auth-shadow.c", "auth_shadow_pwexpired", 0x7f, 0x0, 0x7, 0x0, "password expiration disabled", *(&v0), *(&v1), a0); } else if (v3 < 0) { sshlog("auth-shadow.c", "auth_shadow_pwexpired", 0x81, 0x0, 0x3, 0x0, "User %.100s password has expired (password aged)", v6, *(&v1), a0); v10 = 1; } else if (v3 <= v5[5]) { sshlog("auth-shadow.c", "auth_shadow_pwexpired", 0x84, 0x0, 0x7, 0x0, "password will expire in %d days", v3, *(&v1), a0); if (v3 == 1) v11 = &g_40062f; else v11 = "s"; v4 = sshbuf_putf(loginmsg, "Your password will expire in %d day%s.\n", v3, v11); if (v4) { ssh_err(v4); sshfatal("auth-shadow.c", "auth_shadow_pwexpired", 0x88, 0x0, 0x1, 0x0, "%s: buffer error: %s", "auth_shadow_pwexpired"); } } if (v2 || v5[4] == -1 && v5[2] || v5[2] && v3 >= 0) v10 = 0; } return v10; }
void usage (int status) { if (status != 0 ) do { fprintf ( stderr , gettext ("Try '%s --help' for more information.\n"), program_name); } while (0); else { printf (gettext ("Usage: %s [OPTION]... [FILE]\n"), program_name); fputs_unlocked (gettext ("Output commands to set the LS_COLORS environment variable.\n\nDetermine format of output:\n -b, --sh, --bourne-shell output Bourne shell code to set LS_COLORS\n -c, --csh, --c-shell output C shell code to set LS_COLORS\n -p, --print-database output defaults\n --print-ls-colors output fully escaped colors for display\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 ("\nIf FILE is specified, read it to determine which colors to use for which\nfile types and extensions. Otherwise, a precompiled database is used.\nFor details on the format of these files, run 'dircolors --print-database'.\n"), stdout ) ; emit_ancillary_info ("dircolors"); } 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; v1 = program_name; if ( a1 ) { v2 = gettext("Try '%s --help' for more information.\n"); fprintf(stderr, v2, v1); } else { v3 = gettext("Usage: %s [OPTION]... [FILE]\n"); printf(v3, v1); v4 = stdout; v5 = gettext( "Output commands to set the LS_COLORS environment variable.\n" "\n" "Determine format of output:\n" " -b, --sh, --bourne-shell output Bourne shell code to set LS_COLORS\n" " -c, --csh, --c-shell output C shell code to set LS_COLORS\n" " -p, --print-database output defaults\n" " --print-ls-colors output fully escaped colors for display\n"); fputs_unlocked(v5, v4); v6 = stdout; v7 = gettext(" --help display this help and exit\n"); fputs_unlocked(v7, v6); v8 = stdout; v9 = gettext(" --version output version information and exit\n"); fputs_unlocked(v9, v8); v10 = stdout; v11 = gettext( "\n" "If FILE is specified, read it to determine which colors to use for which\n" "file types and extensions. Otherwise, a precompiled database is used.\n" "For details on the format of these files, run 'dircolors --print-database'.\n"); fputs_unlocked(v11, v10); emit_ancillary_info("dircolors"); } exit(a1); }
int _rl_walphabetic (wchar_t wc) { int c; if (iswalnum (wc)) return (1); c = wc & 0177; return (_rl_allow_pathname_alphabetic_chars && strchr (pathname_alphabetic_chars, c) != ((void *)0) ); }
long long _rl_walphabetic(unsigned long a0) { char v0; unsigned int v1; unsigned long long v4; unsigned long long v5; if (iswalnum(a0)) { v4 = 1; } else { v1 = *(&v0) & 127; if (_rl_allow_pathname_alphabetic_chars) { v5 = strchr("/-_=~.#$", v1); if (v5) v4 = 1; } if (!_rl_allow_pathname_alphabetic_chars || !v5) v4 = 0; } return v4; }
static _Bool sync_arg (enum sync_mode mode, char const *file) { _Bool ret = 1 ; int open_flags = 00 | 04000 ; int fd; fd = open (file, open_flags); if (fd < 0) { int rd_errno = (*__errno_location ()) ; if (open_flags != ( 01 | 04000 )) fd = open (file, 01 | 04000 ); if (fd < 0) { error (0, rd_errno, gettext ("error opening %s"), quotearg_style (shell_escape_always_quoting_style, file)); return 0 ; } } int fdflags = rpl_fcntl (fd, 3 ); if (fdflags == -1 || rpl_fcntl (fd, 4 , fdflags & ~ 04000 ) < 0) { error (0, (*__errno_location ()) , gettext ("couldn't reset non-blocking mode %s"), quotearg_style (shell_escape_always_quoting_style, file)); ret = 0 ; } if (ret == 1 ) { int sync_status = -1; switch (mode) { case MODE_DATA: sync_status = fdatasync (fd); break; case MODE_FILE: sync_status = fsync (fd); break; case MODE_FILE_SYSTEM: sync_status = syncfs (fd); break; default: ((void) sizeof (( "invalid sync_mode" ) ? 1 : 0), __extension__ ({ if ( "invalid sync_mode" ) ; else __assert_fail ( "\"invalid sync_mode\"" , "src/sync.c", 152, __extension__ __PRETTY_FUNCTION__); })) ; } if (sync_status < 0) { error (0, (*__errno_location ()) , gettext ("error syncing %s"), quotearg_style (shell_escape_always_quoting_style, file)); ret = 0 ; } } if (close (fd) < 0) { error (0, (*__errno_location ()) , gettext ("failed to close %s"), quotearg_style (shell_escape_always_quoting_style, file)); ret = 0 ; } return ret; }
int sync_arg(unsigned long a0, char *a1) { char v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned long long v8; unsigned long long v10; unsigned long long v11; unsigned long long v12; unsigned int v13; v0 = 1; v3 = 0x800; v1 = open(a1, v3, v3); if (v1 < 0) { v4 = *(__errno_location()); if (v3 != 2049) v1 = open(a1, 0x801, v3); if (v1 < 0) { v8 = quotearg_style(0x4, a1); error(0x0, v4, gettext("error opening %s")); v13 = 0; } } if (v1 >= 0 || v1 >= 0) { v5 = rpl_fcntl(v1, 0x3); if (v5 == -1 || rpl_fcntl(v1, 0x4) < 0) { v10 = quotearg_style(0x4, a1); error(0x0, *(__errno_location()), gettext("couldn't reset non-blocking mode %s")); v0 = 0; } if (v0) { v2 = -1; if (a0 == 2) { v2 = syncfs(v1); } else if (a0 <= 2) { if (!a0) { v2 = fsync(v1); } else if (a0 == 1) { v2 = fdatasync(v1); } } if (v2 < 0) { v11 = quotearg_style(0x4, a1); error(0x0, *(__errno_location()), gettext("error syncing %s")); v0 = 0; } } v13 = close(v1); if (v13 < 0) { v12 = quotearg_style(0x4, a1); error(0x0, *(__errno_location()), gettext("failed to close %s")); v0 = 0; } v13 = v0; } return v13; }
static Authmethod * authmethod_byname(const char *name) { int i; if (name == ((void *)0) ) sshfatal("auth2.c", __func__, 517, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "NULL authentication method name"); for (i = 0; authmethods[i] != ((void *)0) ; i++) { if (strcmp(name, authmethods[i]->name) == 0 || (authmethods[i]->synonym != ((void *)0) && strcmp(name, authmethods[i]->synonym) == 0)) return authmethods[i]; } sshlog("auth2.c", __func__, 524, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "unrecognized authentication method name: %s", name); return ((void *)0) ; }
int authmethod_byname(char *a0) { unsigned long long v0; unsigned long long v1; unsigned int v2; unsigned long v3; char v4; unsigned int v6; if (!a0) { v0 = "NULL authentication method name"; sshfatal("auth2.c", "authmethod_byname", 0x205, 0x1, 0x1, 0x0); } v2 = 0; while (true) { if (authmethods[v2]) { v6 = strcmp(a0, *(authmethods[v2])); if (v6) { if (*((authmethods[v2] + 8))) v6 = strcmp(a0, *((authmethods[v2] + 8))); if (!*((authmethods[v2] + 8)) || v6) { v2 = __addvsi3(v2, 0x1); continue; } } if (!v6 || !v6 && *((authmethods[v2] + 8))) { v6 = authmethods[v2]; break; } } else { v3 = a0; v1 = "unrecognized authentication method name: %s"; sshlog("auth2.c", "authmethod_byname", 0x20c, 0x1, 0x5, 0x0, *(&v4)); v6 = 0; break; } } return v6; }
cfg_option_t cfg_load(const char *filename) { struct parser_st parser; struct options_st options; struct cfg_option_st null_option = { ((void *)0) , ((void *)0) }; memset(&parser, 0, sizeof(parser)); memset(&options, 0, sizeof(options)); parser.fp = fopen(filename, "r"); if (!parser.fp) { return ((void *)0) ; } for (;;) { struct cfg_option_st option; option.name = read_name(&parser); if (!option.name) { break; } option.value = read_value(&parser); if (!option.value) { clear_option(&option); goto error; } if (take_option(&options, &option) < 0) { clear_option(&option); goto error; } ((void) sizeof (( !option.name && !option.value ) ? 1 : 0), __extension__ ({ if ( !option.name && !option.value ) ; else __assert_fail ( "!option.name && !option.value" , "cfg.c", 423, __extension__ __PRETTY_FUNCTION__); })) ; } fclose(parser.fp); take_option(&options, &null_option); return options.data; error: clear_options(&options); fclose(parser.fp); return ((void *)0) ; }
long long cfg_load(char *a0) { void* v0; void* v1; unsigned long v2; unsigned long v3; char v4; char v5; unsigned long long v7; v0 = 0; v1 = 0; memset(&v5, 0x0, 0x18); memset(&v4, 0x0, 0x18); v5 = fopen(a0, "r"); if (!v5) { v7 = 0; return v7; } do { v2 = read_name(&v5); if (!v2) { fclose(v5); take_option(&v4, &v0); v7 = *(&v4); return v7; } v3 = read_value(&v5); if (!v3) { clear_option(&v2); clear_options(&v4); fclose(v5); v7 = 0; return v7; } if (take_option(&v4, &v2) < 0) { clear_option(&v2); clear_options(&v4); fclose(v5); v7 = 0; return v7; } } while (!v2 && !v3); __assert_fail(); }
void _rl_keyseq_chain_dispose (void) { _rl_keyseq_cxt *cxt; while (_rl_kscxt) { cxt = _rl_kscxt; _rl_kscxt = _rl_kscxt->ocxt; _rl_keyseq_cxt_dispose (cxt); } }
long long _rl_keyseq_chain_dispose() { struct_0 *v0; while (_rl_kscxt) { v0 = _rl_kscxt; _rl_kscxt = *((_rl_kscxt + 32)); _rl_keyseq_cxt_dispose(v0); } return 0; }
static void diff_symlink (void) { char buf[1024]; size_t len = strlen (current_stat_info.link_name); char *linkbuf = len < sizeof buf ? buf : xmalloc (len + 1); ssize_t status = readlinkat (chdir_fd, current_stat_info.file_name, linkbuf, len + 1); if (status < 0) { if ( (*__errno_location ()) == 2 ) readlink_warn (current_stat_info.file_name); else readlink_error (current_stat_info.file_name); report_difference (&current_stat_info, ((void *)0) ); } else if (status != len || memcmp (current_stat_info.link_name, linkbuf, len) != 0) report_difference (&current_stat_info, gettext ("Symlink differs")); if (linkbuf != buf) free (linkbuf); }
void diff_symlink() { unsigned int v0; void* v1; unsigned long v2; char v3; char v4; void* v6; unsigned long long *v7; unsigned long long v8; *(&v0) = strlen(memcmp); if (*(&v0) <= 1023) v6 = &v3; else v6 = xmalloc(*(&v0) + 1); v1 = v6; v2 = readlinkat(chdir_fd, read_error, v1, *(&v0) + 1); if ((v2 - 0 >> 63)) { *(&v6) = *(__errno_location()); if (v6 != 2) readlink_error(read_error); else readlink_warn(read_error); report_difference(); } else { if (v2 == *(&v0) && !memcmp(memcmp, v1, *(&v0))) goto LABEL_400a35; gettext("Symlink differs"); report_difference(); } LABEL_400a35: if (v1 != &v3) free(v1); v8 = *(&v4) ^ v7[5]; return; }
PROC *get_next_from_pid_q(PIDQ_HEAD *q) { PROC *p; PIDQ *tmp = q->head; if (!empty_q(q)) { p = q->head->proc; q->head = tmp->next; free(tmp); return p; } return ((void *)0) ; }
long get_next_from_pid_q(long **a1) { long *ptr; long v3; ptr = *a1; if ( empty_q(a1) ) return 0LL; v3 = **a1; *a1 = (long *)ptr[1]; free(ptr); return v3; }
static _Bool posixtest (int nargs) { _Bool value; switch (nargs) { case 1: value = one_argument (); break; case 2: value = two_arguments (); break; case 3: value = three_arguments (); break; case 4: if ((strcmp (argv[pos], "!") == 0)) { advance ( 1 ); value = !three_arguments (); break; } if ((strcmp (argv[pos], "(") == 0) && (strcmp (argv[pos + 3], ")") == 0)) { advance ( 0 ); value = two_arguments (); advance ( 0 ); break; } __attribute__ ((__fallthrough__)); case 5: default: if (nargs <= 0) abort (); value = expr (); } return (value); }
int posixtest(unsigned long a0) { char v0; unsigned long long v2; if (a0 == 4) { if (!strcmp(*((argv + (pos << 3))), "!")) { advance(0x1); v2 = three_arguments(); *(&v2) = v2; *(&v2) = v2 ^ 1; v0 = v2; v0 &= 1; goto LABEL_402325; } if (!strcmp(*((argv + (pos << 3))), "(") && !strcmp(*((argv + (pos + 3 << 3))), ")")) { advance(0x0); v0 = two_arguments(); advance(0x0); goto LABEL_402325; } } else if (a0 <= 4) { if (a0 == 3) { v0 = three_arguments(); goto LABEL_402325; } else if (a0 <= 3) { if (a0 == 1) { v0 = one_argument(); goto LABEL_402325; } if (a0 == 2) { v0 = two_arguments(); goto LABEL_402325; } } } if (a0 <= 0) abort(); v0 = expr(); LABEL_402325: return v0; }
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 _Bool read_header0 (struct tar_stat_info *info) { enum read_header rc; tar_stat_init (info); rc = read_header (&current_header, info, read_header_auto); if (rc == HEADER_SUCCESS) { set_next_block_after (current_header); return 1 ; } do { if (error_hook) error_hook (); error (0, 0, gettext ("This does not look like a tar archive")); exit_status = 2; } while (0); return 0 ; }
int read_header0(unsigned long long a0) { unsigned int v0; unsigned int v2; tar_stat_init(a0); v0 = read_header(0x500350, a0, 0x0); if (v0 == 1) { set_next_block_after(current_header); v2 = 1; } else { if (error_hook) *(5243096)(); error(0x0, 0x0, gettext("This does not look like a tar archive")); exit_status = 2; v2 = 0; } return v2; }
int addr_and(struct xaddr *dst, const struct xaddr *a, const struct xaddr *b) { int i; if (dst == ((void *)0) || a == ((void *)0) || b == ((void *)0) || a->af != b->af) return -1; memcpy(dst, a, sizeof(*dst)); switch (a->af) { case 2 : dst->xa.v4.s_addr &= b->xa.v4.s_addr; return 0; case 10 : dst->scope_id = a->scope_id; for (i = 0; i < 4; i++) dst->xa.addr32[i] &= b->xa.addr32[i]; return 0; default: return -1; } }
long addr_and(_DWORD *a1, _WORD *a2, long a3) { int v4; int i; if ( !a1 || !a2 || !a3 || *a2 != *(_WORD *)a3 ) return 0xFFFFFFFFLL; memcpy(a1, a2, 0x18uLL); v4 = (unsigned short)*a2; if ( v4 == 2 ) { a1[1] &= *(_DWORD *)(a3 + 4); return 0LL; } else if ( v4 == 10 ) { a1[5] = *((_DWORD *)a2 + 5); for ( i = 0; i <= 3; ++i ) a1[i + 1] &= *(_DWORD *)(a3 + 4LL * i + 4); return 0LL; } else { return 0xFFFFFFFFLL; } }
static void init_pred_perf (struct predicate *pred) { struct predicate_performance_info *p = &pred->perf; p->visits = p->successes = 0; }
void init_pred_perf(unsigned long a0) { unsigned long long v0[2]; char v1; unsigned long long v3[2]; unsigned long long v4; v0[0] = a0 + 288; v0[1] = 0; v3 = v0; v0[0] = v0[1]; v4 = *(&v1); return; }
inline errcode_t ext2fs_resize_mem(unsigned long __attribute__((unused)) old_size, unsigned long size, void *ptr) { void *p; memcpy(&p, ptr, sizeof(p)); p = realloc(p, size); if (!p) return (2133571398L); memcpy(ptr, &p, sizeof(p)); return 0; }
void ext2fs_resize_mem(void) { halt_baddata(); }
static size_t get_data(void *buf, size_t size, size_t nmemb, void *userp) { gnutls_datum_t *ud = userp; size *= nmemb; ud->data = realloc(ud->data, size + ud->size); if (ud->data == ((void *)0) ) { fprintf( stderr , "Not enough memory for the request\n"); exit(1); } memcpy(&ud->data[ud->size], buf, size); ud->size += size; return size; }
void get_data(void* a0, unsigned long a1, unsigned long a2, struct_0 *a3) { unsigned long v0; struct_0 *v1; unsigned long long v3; v0 = a1; v1 = a3; v0 = a2 * v0; a3->field_0 = realloc(a3->field_0, a3->field_8 + v0); if (!a3->field_0) { fprintf(stderr, "Not enough memory for the request\n"); exit(0x1); } memcpy(a3->field_0 + a3->field_8, a0, v0); a3->field_8 = v0 + a3->field_8; v3 = v0; return; }
static int handle_kmod_compat_commands(int argc, char *argv[]) { const char *cmd; size_t i; cmd = basename(argv[0]); for (i = 0; i < (sizeof(kmod_compat_cmds) / sizeof((kmod_compat_cmds)[0]) + ({ _Static_assert((!__builtin_types_compatible_p(typeof(kmod_compat_cmds), typeof(&(kmod_compat_cmds)[0]))), "!__builtin_types_compatible_p(typeof(kmod_compat_cmds), typeof(&(kmod_compat_cmds)[0]))"); 0; })); i++) { if ((strcmp((kmod_compat_cmds[i]->name), (cmd)) == 0)) return kmod_compat_cmds[i]->cmd(argc, argv); } return - 2 ; }
int handle_kmod_compat_commands(unsigned long a0, unsigned long long *a1) { void* v0; char *v1; unsigned int v3; v1 = basename(*(a1)); v0 = 0; while (true) { if (v0 > 5) { v3 = -2; return v3; } else if (strcmp(*(*((0x8 * v0 + &kmod_compat_cmds[0]))), v1)) { v0 += 1; } else { v3 = *((*((0x8 * v0 + &kmod_compat_cmds[0])) + 8))(a0, a1, a1, *((*((0x8 * v0 + &kmod_compat_cmds[0])) + 8))); return v3; } } }
static uLong adler32_combine_(adler1, adler2, len2) uLong adler1; uLong adler2; off64_t len2; { unsigned long sum1; unsigned long sum2; unsigned rem; if (len2 < 0) return 0xffffffffUL; len2 %= 65521U; rem = (unsigned)len2; sum1 = adler1 & 0xffff; sum2 = rem * sum1; sum2 %= 65521U; sum1 += (adler2 & 0xffff) + 65521U - 1; sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + 65521U - rem; if (sum1 >= 65521U) sum1 -= 65521U; if (sum1 >= 65521U) sum1 -= 65521U; if (sum2 >= ((unsigned long)65521U << 1)) sum2 -= ((unsigned long)65521U << 1); if (sum2 >= 65521U) sum2 -= 65521U; return sum1 | (sum2 << 16); }
void adler32_combine_(unsigned long a0, unsigned long a1, unsigned long a2) { unsigned long v0; unsigned int v1; unsigned long v2; unsigned long long v3; unsigned long long v5; unsigned long long v6; v0 = a2; if ((v0 - 0 >> 63)) { v5 = 4294967295; return; } v0 -= (((v0 * 9225483582474543847 >> 64) + v0 >> 15) - (v0 >> 63)) * 65521; v1 = v0; v2 = a0; v3 = v2 * v1; v3 -= ((v3 - (v3 * 4223091239536077 >> 64) >> 1) + (v3 * 4223091239536077 >> 64) >> 15) * 65521; v2 = v2 + a1 + 65520; v3 = v3 + (a0 >> 16) + (a1 >> 16) - v1 + 65521; if (v2 > 65520) v2 -= 65521; if (v2 > 65520) v2 -= 65521; if (v3 > 131041) v3 -= 131042; if (v3 > 65520) v3 -= 65521; v6 = v3 * 0x10000 | v2; return; }
static void system_join (FILE *fp1, FILE *fp2) { struct seq seq1, seq2; int diff; _Bool eof1, eof2; fadvise (fp1, FADVISE_SEQUENTIAL); fadvise (fp2, FADVISE_SEQUENTIAL); initseq (&seq1); getseq (fp1, &seq1, 1); initseq (&seq2); getseq (fp2, &seq2, 2); if (autoformat) { autocount_1 = seq1.count ? seq1.lines[0]->nfields : 0; autocount_2 = seq2.count ? seq2.lines[0]->nfields : 0; } if (join_header_lines && (seq1.count || seq2.count)) { struct line const *hline1 = seq1.count ? seq1.lines[0] : &uni_blank; struct line const *hline2 = seq2.count ? seq2.lines[0] : &uni_blank; prjoin (hline1, hline2); prevline[0] = ((void *)0) ; prevline[1] = ((void *)0) ; if (seq1.count) advance_seq (fp1, &seq1, 1 , 1); if (seq2.count) advance_seq (fp2, &seq2, 1 , 2); } while (seq1.count && seq2.count) { diff = keycmp (seq1.lines[0], seq2.lines[0], join_field_1, join_field_2); if (diff < 0) { if (print_unpairables_1) prjoin (seq1.lines[0], &uni_blank); advance_seq (fp1, &seq1, 1 , 1); seen_unpairable = 1 ; continue; } if (diff > 0) { if (print_unpairables_2) prjoin (&uni_blank, seq2.lines[0]); advance_seq (fp2, &seq2, 1 , 2); seen_unpairable = 1 ; continue; } eof1 = 0 ; do if (!advance_seq (fp1, &seq1, 0 , 1)) { eof1 = 1 ; ++seq1.count; break; } while (!keycmp (seq1.lines[seq1.count - 1], seq2.lines[0], join_field_1, join_field_2)); eof2 = 0 ; do if (!advance_seq (fp2, &seq2, 0 , 2)) { eof2 = 1 ; ++seq2.count; break; } while (!keycmp (seq1.lines[0], seq2.lines[seq2.count - 1], join_field_1, join_field_2)); if (print_pairables) { for (size_t i = 0; i < seq1.count - 1; ++i) { size_t j; for (j = 0; j < seq2.count - 1; ++j) prjoin (seq1.lines[i], seq2.lines[j]); } } if (!eof1) { do { struct line *tmp = seq1.lines[0]; seq1.lines[0] = seq1.lines[seq1.count - 1]; seq1.lines[seq1.count - 1] = tmp; } while (0);; seq1.count = 1; } else seq1.count = 0; if (!eof2) { do { struct line *tmp = seq2.lines[0]; seq2.lines[0] = seq2.lines[seq2.count - 1]; seq2.lines[seq2.count - 1] = tmp; } while (0);; seq2.count = 1; } else seq2.count = 0; } struct line *line = ((void *)0) ; _Bool checktail = 0 ; if (check_input_order != CHECK_ORDER_DISABLED && !(issued_disorder_warning[0] && issued_disorder_warning[1])) checktail = 1 ; if ((print_unpairables_1 || checktail) && seq1.count) { if (print_unpairables_1) prjoin (seq1.lines[0], &uni_blank); if (seq2.count) seen_unpairable = 1 ; while (get_line (fp1, &line, 1)) { if (print_unpairables_1) prjoin (line, &uni_blank); if (issued_disorder_warning[0] && !print_unpairables_1) break; } } if ((print_unpairables_2 || checktail) && seq2.count) { if (print_unpairables_2) prjoin (&uni_blank, seq2.lines[0]); if (seq1.count) seen_unpairable = 1 ; while (get_line (fp2, &line, 2)) { if (print_unpairables_2) prjoin (&uni_blank, line); if (issued_disorder_warning[1] && !print_unpairables_2) break; } } freeline (line); free (line); delseq (&seq1); delseq (&seq2); }
void system_join(undefined8 param_1,undefined8 param_2) { bool bVar1; bool bVar2; char cVar3; int iVar4; long in_FS_OFFSET; void *local_80; ulong local_78; ulong local_70; undefined1 *local_68; undefined1 *local_60; long local_58; long local_50; ulong local_48 [2]; long *local_38; long local_28 [2]; long *local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); fadvise(param_1,2); fadvise(param_2,2); initseq(local_48); getseq(param_1,local_48,1); initseq(local_28); getseq(param_2,local_28,2); if (autoformat != '\0') { if (local_48[0] == 0) { autocount_1 = 0; } else { autocount_1 = *(undefined8 *)(*local_38 + 0x18); } if (local_28[0] == 0) { autocount_2 = 0; } else { autocount_2 = *(undefined8 *)(*local_18 + 0x18); } } if ((join_header_lines != '\0') && ((local_48[0] != 0 || (local_28[0] != 0)))) { if (local_48[0] == 0) { local_68 = uni_blank; } else { local_68 = (undefined1 *)*local_38; } if (local_28[0] == 0) { local_60 = uni_blank; } else { local_60 = (undefined1 *)*local_18; } prjoin(local_68,local_60); prevline._0_8_ = 0; prevline._8_8_ = 0; if (local_48[0] != 0) { advance_seq(param_1,local_48,1,1); } if (local_28[0] != 0) { advance_seq(param_2,local_28,1,2); } } while ((local_48[0] != 0 && (local_28[0] != 0))) { iVar4 = keycmp(*local_38,*local_18,join_field_1,join_field_2); if (iVar4 < 0) { if (print_unpairables_1 != '\0') { prjoin(*local_38,uni_blank); } advance_seq(param_1,local_48,1,1); seen_unpairable = 1; } else if (iVar4 < 1) { bVar1 = false; do { cVar3 = advance_seq(param_1,local_48,0,1); if (cVar3 != '\x01') { bVar1 = true; local_48[0] = local_48[0] + 1; break; } iVar4 = keycmp(local_38[local_48[0] - 1],*local_18,join_field_1,join_field_2); } while (iVar4 == 0); bVar2 = false; do { cVar3 = advance_seq(param_2,local_28,0,2); if (cVar3 != '\x01') { bVar2 = true; local_28[0] = local_28[0] + 1; break; } iVar4 = keycmp(*local_38,local_18[local_28[0] + -1],join_field_1,join_field_2); } while (iVar4 == 0); if (print_pairables != '\0') { for (local_78 = 0; local_78 < local_48[0] - 1; local_78 = local_78 + 1) { for (local_70 = 0; local_70 < local_28[0] - 1U; local_70 = local_70 + 1) { prjoin(local_38[local_78],local_18[local_70]); } } } if (!bVar1) { local_58 = *local_38; *local_38 = local_38[local_48[0] - 1]; local_38[local_48[0] - 1] = local_58; } local_48[0] = (ulong)!bVar1; if (bVar2) { local_28[0] = 0; } else { local_50 = *local_18; *local_18 = local_18[local_28[0] + -1]; local_18[local_28[0] + -1] = local_50; local_28[0] = 1; } } else { if (print_unpairables_2 != '\0') { prjoin(uni_blank,*local_18); } advance_seq(param_2,local_28,1,2); seen_unpairable = 1; } } local_80 = (void *)0x0; bVar1 = false; if ((check_input_order != 2) && (((char)issued_disorder_warning != '\x01' || (issued_disorder_warning._1_1_ != '\x01')))) { bVar1 = true; } if (((print_unpairables_1 != '\0') || (bVar1)) && (local_48[0] != 0)) { if (print_unpairables_1 != '\0') { prjoin(*local_38,uni_blank); } if (local_28[0] != 0) { seen_unpairable = 1; } do { cVar3 = get_line(param_1,&local_80,1); if (cVar3 == '\0') break; if (print_unpairables_1 != '\0') { prjoin(local_80,uni_blank); } } while (((char)issued_disorder_warning == '\0') || (print_unpairables_1 == '\x01')); } if (((print_unpairables_2 != '\0') || (bVar1)) && (local_28[0] != 0)) { if (print_unpairables_2 != '\0') { prjoin(uni_blank,*local_18); } if (local_48[0] != 0) { seen_unpairable = 1; } do { cVar3 = get_line(param_2,&local_80,2); if (cVar3 == '\0') break; if (print_unpairables_2 != '\0') { prjoin(uni_blank,local_80); } } while ((issued_disorder_warning._1_1_ == '\0') || (print_unpairables_2 == '\x01')); } freeline(local_80); free(local_80); delseq(local_48); delseq(local_28); if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
static void process_readlink(u_int32_t id) { int r, len; char buf[ 4096 ]; char *path; if ((r = sshbuf_get_cstring(iqueue, &path, ((void *)0) )) != 0) sshfatal("sftp-server.c", __func__, 1335, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); sshlog("sftp-server.c", __func__, 1337, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "request %u: readlink", id); sshlog("sftp-server.c", __func__, 1338, 0, SYSLOG_LEVEL_VERBOSE, ((void *)0) , "readlink \"%s\"", path); if ((len = readlink(path, buf, sizeof(buf) - 1)) == -1) send_status(id, errno_to_portable( (*__errno_location ()) )); else { Stat s; buf[len] = '\0'; attrib_clear(&s.attrib); s.name = s.long_name = buf; send_names(id, 1, &s); } free(path); }
void process_readlink(uint param_1) { int iVar1; undefined4 uVar2; undefined8 uVar3; ssize_t sVar4; int *piVar5; char **ppcVar6; long in_FS_OFFSET; char *pcStack4232; undefined8 uStack4224; undefined auStack4216 [12]; uint local_106c; int local_1068; int local_1064; char *local_1060; char *local_1058; char *local_1050; undefined auStack4168 [48]; char local_1018 [4104]; long local_10; ppcVar6 = (char **)auStack4216; local_10 = *(long *)(in_FS_OFFSET + 0x28); uStack4224 = 0x104630; local_106c = param_1; local_1068 = sshbuf_get_cstring(iqueue,&local_1060,0); if (local_1068 != 0) { uStack4224 = 0x10464c; uVar3 = ssh_err(local_1068); ppcVar6 = &pcStack4232; pcStack4232 = "parse"; sshfatal("sftp-server.c","process_readlink",0x537,1,1,uVar3); } *(ulong *)((long)ppcVar6 + -8) = (ulong)local_106c; *(char **)((long)ppcVar6 + -0x10) = "request %u: readlink"; *(undefined8 *)((long)ppcVar6 + -0x18) = 0x1046c0; sshlog("sftp-server.c","process_readlink",0x539,0,7,0); *(char **)((long)ppcVar6 + -8) = local_1060; *(char **)((long)ppcVar6 + -0x10) = "readlink \"%s\""; *(undefined8 *)((long)ppcVar6 + -0x18) = 0x104702; sshlog("sftp-server.c","process_readlink",0x53a,0,4,0); *(undefined8 *)((long)ppcVar6 + -8) = 0x104724; sVar4 = readlink(local_1060,local_1018,0xfff); local_1064 = (int)sVar4; if (local_1064 == -1) { *(undefined8 *)((long)ppcVar6 + -8) = 0x104738; piVar5 = __errno_location(); iVar1 = *piVar5; *(undefined8 *)((long)ppcVar6 + -8) = 0x104741; uVar2 = errno_to_portable(iVar1); *(undefined8 *)((long)ppcVar6 + -8) = 0x104752; send_status(local_106c,uVar2); } else { local_1018[local_1064] = '\0'; *(undefined8 *)((long)ppcVar6 + -8) = 0x104777; attrib_clear(auStack4168); local_1058 = local_1018; *(undefined8 *)((long)ppcVar6 + -8) = 0x1047ac; local_1050 = local_1058; send_names(local_106c,1,&local_1058); } *(undefined8 *)((long)ppcVar6 + -8) = 0x1047bb; free(local_1060); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { *(undefined8 *)((long)ppcVar6 + -8) = 0x1047d0; __stack_chk_fail(); } return; }
skipwhite (char *s) { while (*s == ' ' || *s == '\t') s++; return s; }
_BYTE * skipwhite(_BYTE *a1) { while ( *a1 == 32 || *a1 == 9 ) ++a1; return a1; }
static ssize_t push_func(gnutls_transport_ptr_t p, const void *data, size_t size) { priv_data_st *priv = p; return sendto(priv->fd, data, size, 0, (struct sockaddr*)priv->cli_addr, priv->cli_addr_size); }
void push_func(long param_1,void *param_2,size_t param_3) { sendto(*(int *)(param_1 + 8),param_2,param_3,0,*(sockaddr **)(param_1 + 0x10), *(socklen_t *)(param_1 + 0x18)); return; }
_Bool pred_ls (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr) { return pred_fls (pathname, stat_buf, pred_ptr); }
long long pred_ls(unsigned long long a0, unsigned long long a1, void* a2) { return pred_fls(a0, a1, a2); }
static int do_chflags(const char *dev, __u32 flags, __u32 mask) { struct ifreq ifr; int fd; int err; strlcpy(ifr.ifr_ifrn.ifrn_name, dev, 16); fd = get_ctl_fd(); if (fd < 0) return -1; err = ioctl(fd, 0x8913 , &ifr); if (err) { perror("SIOCGIFFLAGS"); close(fd); return -1; } if ((ifr.ifr_ifru.ifru_flags^flags)&mask) { ifr.ifr_ifru.ifru_flags &= ~mask; ifr.ifr_ifru.ifru_flags |= mask&flags; err = ioctl(fd, 0x8914 , &ifr); if (err) perror("SIOCSIFFLAGS"); } close(fd); return err; }
void do_chflags(unsigned long long a0, unsigned long a1, unsigned long a2) { unsigned int v0; unsigned int v1; unsigned int v2; char v3; unsigned short v4; unsigned long long v6; unsigned long long v7; unsigned long long v8; v0 = a2; strlcpy(&v3, a0, 0x10, a0); v2 = get_ctl_fd(); if (v2 < 0) { v6 = 4294967295; return; } v1 = ioctl(v2, 0x8913); if (v1) { perror("SIOCGIFFLAGS"); close(v2); v7 = 4294967295; return; } if (((*(&v4) ^ a1) & a2)) { v4 = !(v0) & *(&v4); v4 = a1 & a2 | *(&v4); v1 = ioctl(v2, 0x8914); if (v1) perror("SIOCSIFFLAGS"); } close(v2); v8 = v1; return; }
static void copy_stat(ifstat) struct stat *ifstat; { mode_t mode = ifstat->st_mode & ((0400|0200|0100) | ((0400|0200|0100) >> 3) | (((0400|0200|0100) >> 3) >> 3)) ; int r; _Bool restoring; struct timespec timespec[2]; timespec[0] = get_stat_atime (ifstat); timespec[1] = get_stat_mtime (ifstat); restoring = (decompress && 0 <= time_stamp.tv_nsec && ! (timespec[1].tv_sec == time_stamp.tv_sec && timespec[1].tv_nsec == time_stamp.tv_nsec)); if (restoring) timespec[1] = time_stamp; if (fdutimens (ofd, ofname, timespec) == 0) { if (restoring && 1 < verbose) { fprintf( stderr , "%s: timestamp restored\n", ofname); } } else { int e = (*__errno_location ()) ; {if (!quiet) fprintf ( stderr , "%s: ", program_name) ; if (exit_code == 0) exit_code = 2;}; if (!quiet) { (*__errno_location ()) = e; perror (ofname); } } do_chown (ofd, ofname, -1, ifstat->st_gid); r = fchmod (ofd, mode); if (r != 0) { int e = (*__errno_location ()) ; {if (!quiet) fprintf ( stderr , "%s: ", program_name) ; if (exit_code == 0) exit_code = 2;}; if (!quiet) { (*__errno_location ()) = e; perror(ofname); } } do_chown (ofd, ofname, ifstat->st_uid, -1); }
void copy_stat(unsigned int a0[9], unsigned long a1, unsigned long a2) { char v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned long v5; unsigned long v6; unsigned long long v7; unsigned long long v8; char v9; char v11; unsigned long long *v13; unsigned long long v14; v1 = a0[6] & 511; v5 = get_stat_atime(a0); v6 = a2; v7 = get_stat_mtime(a0); v8 = a2; if (false) v11 = 1; v11 = 0; v0 = v11; v0 &= 1; if (v0) { v7 = 10180387026389042571; v8 = 14378102450199071541; } if (fdutimens(0xf9158b48e5894855, &ofname, &v5)) { v2 = *(__errno_location()); if (!quiet) fprintf(*(&stderr), "%s: ", -116028600); if (!exit_code) exit_code = 2; if (!quiet) { *(__errno_location()) = v2; perror(&ofname); } } else if (v0 && verbose > 1) { fprintf(*(&stderr), "%s: timestamp restored\n", &ofname); } do_chown(0xf9158b48e5894855, &ofname, 0xffffffff, a0[8]); v3 = fchmod(0xe5894855, v1); if (v3) { v4 = *(__errno_location()); if (!quiet) fprintf(*(&stderr), "%s: ", -116028600); if (!exit_code) exit_code = 2; if (!quiet) { *(__errno_location()) = v4; perror(&ofname); } } do_chown(0xf9158b48e5894855, &ofname, a0[7], 0xffffffff); v14 = *(&v9) ^ v13[5]; return; }
int bridge_print_xstats(struct nlmsghdr *n, void *arg) { struct if_stats_msg *ifsm = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); struct rtattr *tb[(__IFLA_STATS_MAX - 1)+1]; int len = n->nlmsg_len; len -= ((sizeof(*ifsm)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))); if (len < 0) { fprintf( stderr , "BUG: wrong nlmsg len %d\n", len); return -1; } if (filter_index && filter_index != ifsm->ifindex) return 0; parse_rtattr(tb, (__IFLA_STATS_MAX - 1), ((struct rtattr *)(((char *)(ifsm)) + ( ((sizeof(struct if_stats_msg))+4U -1) & ~(4U -1) ))), len); if (tb[IFLA_STATS_LINK_XSTATS]) bridge_print_stats_attr(tb[IFLA_STATS_LINK_XSTATS], ifsm->ifindex); if (tb[IFLA_STATS_LINK_XSTATS_SLAVE]) bridge_print_stats_attr(tb[IFLA_STATS_LINK_XSTATS_SLAVE], ifsm->ifindex); return 0; }
long long bridge_print_xstats(unsigned int *a0, unsigned long a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned long v0; unsigned int v1; struct_0 *v2; char v3; char v4; char v5; unsigned long long v7; v0 = a1; v2 = &a0[4]; v1 = *(a0); v1 -= 28; if (v1 < 0) { fprintf(stderr, "BUG: wrong nlmsg len %d\n", v1); v7 = 4294967295; return v7; } if (filter_index && v2->field_4 != filter_index) { v7 = 0; return v7; } parse_rtattr(&v3, 0x5, &v2[1].field_4, v1); if (*(&v4)) bridge_print_stats_attr(*(&v4), v2->field_4, v2->field_4, a3, a4, a5); if (*(&v5)) bridge_print_stats_attr(*(&v5), v2->field_4, v2->field_4, a3, a4, a5); v7 = 0; return v7; }
static int n_shell_variables () { VAR_CONTEXT *vc; int n; for (n = 0, vc = shell_variables; vc; vc = vc->down) n += ((vc->table) ? (vc->table)->nentries : 0); return n; }
void n_shell_variables() { unsigned int v0; struct_0 *v1; unsigned int v3; unsigned long long v4; v0 = 0; for (v1 = shell_variables; v1; v1 = v1->field_18) { if (v1->field_20) v3 = v1->field_20->field_c; else v3 = 0; v0 += v3; } v4 = v0; return; }
static void fifo_new_level(int level) { int oldlevel; if (level == runlevel) return; { oldlevel = runlevel; runlevel = read_level(level); if (runlevel == 'U') { runlevel = oldlevel; my_re_exec(); } else { if (oldlevel != 'S' && runlevel == 'S') console_stty(); if (runlevel == '6' || runlevel == '0' || runlevel == '1') console_stty(); if (runlevel > '1' && runlevel < '6') redo_utmp_wtmp(); read_inittab(); fail_cancel(); setproctitle("init [%c]", (int)runlevel); } } Write_Runlevel_Log(runlevel); }
long fifo_new_level(int a1) { long result; long v2; long v3; long v4; long v5; int v6; result = (unsigned int)runlevel; if ( a1 != (_DWORD)result ) { v6 = runlevel; runlevel = read_level(a1); if ( runlevel == 85 ) { runlevel = v6; my_re_exec(); } else { if ( v6 != 83 && runlevel == 83 ) console_stty(); if ( runlevel == 54 || runlevel == 48 || runlevel == 49 ) console_stty(); if ( runlevel > 49 && runlevel <= 53 ) redo_utmp_wtmp(); read_inittab(); fail_cancel(); setproctitle("init [%c]", (unsigned int)runlevel, v2, v3, v4, v5); } return Write_Runlevel_Log((unsigned int)runlevel); } return result; }
int print_color_bool(enum output_type t, enum color_attr color, const char *key, const char *fmt, _Bool value); static inline int print_bool(enum output_type t, const char *key, const char *fmt, _Bool value) { return print_color_bool(t, COLOR_NONE, key, fmt, value); }
void print_color_bool(void) { halt_baddata(); }
static void scan_entries (size_t n, const STRUCT_UTMP *utmp_buf, const int argc_names, char *const argv_names[]) { if (hard_locale ( 2 )) { time_format = "%Y-%m-%d %H:%M"; time_format_width = 4 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2; } else { time_format = "%b %e %H:%M"; time_format_width = 3 + 1 + 2 + 1 + 2 + 1 + 2; } if (include_heading) print_heading (); while (n--) { if ((((utmp_buf)-> ut_user )[0] && (((utmp_buf)->ut_type == ( 7 )) || (0 && ((utmp_buf)->ut_tv.tv_sec) != 0)))) { if (argc_names) { for (int i = 0; i < argc_names; i++) if ((strncmp (((utmp_buf)-> ut_user ), argv_names[i], UT_USER_SIZE) == 0)) { print_entry (utmp_buf); break; } } else print_entry (utmp_buf); } utmp_buf++; } }
long scan_entries(long a1, long a2, int a3, long a4) { long result; int i; if ( (unsigned char)hard_locale(2LL) ) { time_format = "%Y-%m-%d %H:%M"; time_format_width = 16; } else { time_format = "%b %e %H:%M"; time_format_width = 12; } if ( include_heading ) print_heading(); while ( 1 ) { result = a1--; if ( !result ) return result; if ( *(_BYTE *)(a2 + 44) && *(_WORD *)a2 == 7 ) { if ( a3 ) { for ( i = 0; i < a3; ++i ) { if ( !strncmp((const char *)(a2 + 44), *(const char **)(8LL * i + a4), 0x20uLL) ) goto LABEL_14; } } else { LABEL_14: print_entry(a2); } } a2 += 384LL; } }
static void do_known_hosts(struct passwd *pw, const char *name, int find_host, int delete_host, int hash_hosts) { char *cp, tmp[ 4096 ], old[ 4096 ]; int r, fd, oerrno, inplace = 0; struct known_hosts_ctx ctx; u_int foreach_options; struct stat sb; if (!have_identity) { cp = tilde_expand_filename("~/" ".ssh" "/known_hosts", pw->pw_uid); if (strlcpy(identity_file, cp, sizeof(identity_file)) >= sizeof(identity_file)) sshfatal("ssh-keygen.c", __func__, 1308, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Specified known hosts path too long"); free(cp); have_identity = 1; } if (stat(identity_file, &sb) != 0) sshfatal("ssh-keygen.c", __func__, 1313, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Cannot stat %s: %s", identity_file, strerror( (*__errno_location ()) )); memset(&ctx, 0, sizeof(ctx)); ctx.out = stdout ; ctx.host = name; ctx.hash_hosts = hash_hosts; ctx.find_host = find_host; ctx.delete_host = delete_host; if (!find_host && (hash_hosts || delete_host)) { if (strlcpy(tmp, identity_file, sizeof(tmp)) >= sizeof(tmp) || strlcat(tmp, ".XXXXXXXXXX", sizeof(tmp)) >= sizeof(tmp) || strlcpy(old, identity_file, sizeof(old)) >= sizeof(old) || strlcat(old, ".old", sizeof(old)) >= sizeof(old)) sshfatal("ssh-keygen.c", __func__, 1331, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "known_hosts path too long"); umask(077); if ((fd = mkstemp(tmp)) == -1) sshfatal("ssh-keygen.c", __func__, 1334, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "mkstemp: %s", strerror( (*__errno_location ()) )); if ((ctx.out = fdopen(fd, "w")) == ((void *)0) ) { oerrno = (*__errno_location ()) ; unlink(tmp); sshfatal("ssh-keygen.c", __func__, 1338, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "fdopen: %s", strerror(oerrno)); } fchmod(fd, sb.st_mode & 0644); inplace = 1; } foreach_options = find_host ? (1) : 0; foreach_options |= print_fingerprint ? (1<<1) : 0; if ((r = hostkeys_foreach(identity_file, (find_host || !hash_hosts) ? known_hosts_find_delete : known_hosts_hash, &ctx, name, ((void *)0) , foreach_options, 0)) != 0) { if (inplace) unlink(tmp); sshfatal("ssh-keygen.c", __func__, 1351, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "hostkeys_foreach"); } if (inplace) fclose(ctx.out); if (ctx.invalid) { sshlog("ssh-keygen.c", __func__, 1358, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "%s is not a valid known_hosts file.", identity_file); if (inplace) { sshlog("ssh-keygen.c", __func__, 1360, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Not replacing existing known_hosts " "file because of errors") ; unlink(tmp); } exit(1); } else if (delete_host && !ctx.found_key) { sshlog("ssh-keygen.c", __func__, 1366, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Host %s not found in %s", name, identity_file); if (inplace) unlink(tmp); } else if (inplace) { if (unlink(old) == -1 && (*__errno_location ()) != 2 ) sshfatal("ssh-keygen.c", __func__, 1372, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "unlink %.100s: %s", old, strerror( (*__errno_location ()) )); if (link(identity_file, old) == -1) sshfatal("ssh-keygen.c", __func__, 1374, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "link %.100s to %.100s: %s", identity_file, old, strerror( (*__errno_location ()) )) ; if (rename(tmp, identity_file) == -1) { sshlog("ssh-keygen.c", __func__, 1378, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "rename\"%s\" to \"%s\": %s", tmp, identity_file, strerror( (*__errno_location ()) )) ; unlink(tmp); unlink(old); exit(1); } printf("%s updated.\n", identity_file); printf("Original contents retained as %s\n", old); if (ctx.has_unhashed) { sshlog("ssh-keygen.c", __func__, 1388, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "WARNING: %s contains unhashed entries", old); sshlog("ssh-keygen.c", __func__, 1389, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Delete this file to ensure privacy " "of hostnames") ; } } exit (find_host && !ctx.found_key); }
void do_known_hosts(struct_0 *a0, unsigned long long a1, unsigned long a2, unsigned long long a3, unsigned long a4) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; void* v5; char v6; void* v7; char v8; char v9; char v10; unsigned int v11; unsigned int v12; unsigned int v13; char v14; char v15; char v16; char v17; char v18; char v19; unsigned long long v20; unsigned long v21; unsigned long long v22; unsigned long v23; char v24; unsigned long long v25; unsigned long long *v26; unsigned int v27; unsigned long v28; v19 = *(&v19); v17 = *(&v17); v22 = v26[5]; v0 = 0; if (!have_identity) { v5 = tilde_expand_filename("~/.ssh/known_hosts", a0->field_10); if (strlcpy(&identity_file, v5, 0x1000) > 4095) sshfatal("ssh-keygen.c", "do_known_hosts", 0x51c, 0x0, 0x1, 0x0, "Specified known hosts path too long"); free(v5); have_identity = 1; } if (stat(&identity_file, &v14)) { v22 = strerror(*(__errno_location())); v21 = &identity_file; v20 = "Cannot stat %s: %s"; sshfatal("ssh-keygen.c", "do_known_hosts", 0x521, 0x0, 0x1, 0x0, *(&v24)); } memset(&v6, 0x0, 0x28); v7 = stdout; v6 = a1; v11 = a4; v12 = a2; v13 = a3; if (!a2) { if (!a4 && !a3) goto LABEL_404bdb; if (strlcpy(&v16, &identity_file, 0x1000) <= 4095 && strlcat(&v16, ".XXXXXXXXXX", 0x1000, a3) <= 4095 && strlcpy(&v18, &identity_file, 0x1000) <= 4095 && strlcat(&v18, ".old", 0x1000, a3) <= 4095) goto LABEL_404ac1; v22 = "known_hosts path too long"; sshfatal("ssh-keygen.c", "do_known_hosts", 0x533, 0x0, 0x1, 0x0, *(&v24)); LABEL_404ac1: umask(0x3f); v1 = mkstemp(&v16); if (v1 == -1) { v23 = strerror(*(__errno_location())); v22 = "mkstemp: %s"; sshfatal("ssh-keygen.c", "do_known_hosts", 0x536, 0x0, 0x1, 0x0, *(&v24)); } v7 = fdopen(v1, "w"); if (!v7) { v2 = *(__errno_location()); unlink(&v16); v23 = strerror(v2); v22 = "fdopen: %s"; sshfatal("ssh-keygen.c", "do_known_hosts", 0x53a, 0x0, 0x1, 0x0, *(&v24)); } fchmod(v1, *(&v15) & 420); v0 = 1; } LABEL_404bdb: v3 = a2; if (!print_fingerprint) v27 = 0; else v27 = 2; v3 |= v27; if (a2) { LABEL_404c1c: v28 = known_hosts_find_delete; } else { if (!a4) goto LABEL_404c1c; v28 = known_hosts_hash; } v22 = 0; v4 = hostkeys_foreach(&identity_file, v28, &v6, a1, 0x0, v3); if (v4) { if (v0) unlink(&v16); v22 = "hostkeys_foreach"; sshfatal("ssh-keygen.c", "do_known_hosts", 0x547, 0x1, 0x1, ssh_err(v4), *(&v24)); } if (v0) fclose(v7); if (*(&v10)) { v23 = &identity_file; v22 = "%s is not a valid known_hosts file."; sshlog("ssh-keygen.c", "do_known_hosts", 0x54e, 0x0, 0x2, 0x0, *(&v24), v25); if (v0) { v22 = "Not replacing existing known_hosts file because of errors"; sshlog("ssh-keygen.c", "do_known_hosts", 0x550, 0x0, 0x2, 0x0, *(&v24), v25); unlink(&v16); } exit(0x1); } else { if (a3 && !*(&v9)) { v22 = &identity_file; v21 = a1; v20 = "Host %s not found in %s"; sshlog("ssh-keygen.c", "do_known_hosts", 0x556, 0x0, 0x3, 0x0, *(&v24), v25); if (v0) { unlink(&v16); goto LABEL_405064; } } if (v0) { if (unlink(&v18) == -1) { *(&v28) = *(__errno_location()); if (v28 != 2) { v22 = strerror(*(__errno_location())); v21 = &v18; v20 = "unlink %.100s: %s"; sshfatal("ssh-keygen.c", "do_known_hosts", 0x55c, 0x0, 0x1, 0x0, *(&v24)); } } if (link(&identity_file, &v18) == -1) { v23 = strerror(*(__errno_location())); v22 = &v18; v21 = &identity_file; v20 = "link %.100s to %.100s: %s"; sshfatal("ssh-keygen.c", "do_known_hosts", 0x55e, 0x0, 0x1, 0x0, *(&v24)); } if (rename(&v16, &identity_file) == -1) { v23 = strerror(*(__errno_location())); v22 = &identity_file; v21 = &v16; v20 = "rename\"%s\" to \"%s\": %s"; sshlog("ssh-keygen.c", "do_known_hosts", 0x562, 0x0, 0x2, 0x0, *(&v24), v25); unlink(&v16); unlink(&v18); exit(0x1); } printf("%s updated.\n", &identity_file); printf("Original contents retained as %s\n", &v18); if (*(&v8)) { v23 = &v18; v22 = "WARNING: %s contains unhashed entries"; sshlog("ssh-keygen.c", "do_known_hosts", 0x56c, 0x0, 0x3, 0x0, *(&v24), v25); v24 = "Delete this file to ensure privacy of hostnames"; sshlog("ssh-keygen.c", "do_known_hosts", 0x56d, 0x0, 0x3, 0x0, "Delete this file to ensure privacy of hostnames", v25); } } LABEL_405064: if (a2 && !*(&v9)) { *(&v28) = 1; goto LABEL_405083; } *(&v28) = 0; LABEL_405083: exit(v28); } }
static int bash_possible_username_completions (ignore, ignore2) int ignore, ignore2; { return bash_complete_username_internal ('?'); }
long long bash_possible_username_completions(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned int v1; v1 = a0; v0 = a1; return bash_complete_username_internal(0x3f); }
static void _rs_stir(void) { unsigned char rnd[32 + 8]; uint32_t rekey_fuzz = 0; if (getentropy(rnd, sizeof rnd) == -1) _getentropy_fail(); if (!rs) _rs_init(rnd, sizeof(rnd)); else _rs_rekey(rnd, sizeof(rnd)); explicit_bzero(rnd, sizeof(rnd)); rs->rs_have = 0; memset(rsx->rs_buf, 0, sizeof(rsx->rs_buf)); chacha_encrypt_bytes(&rsx->rs_chacha, (uint8_t *)&rekey_fuzz, (uint8_t *)&rekey_fuzz, sizeof(rekey_fuzz)); rs->rs_count = (1024*1024) + (rekey_fuzz % (1024*1024)); }
void _rs_stir(void) { int iVar1; long in_FS_OFFSET; uint local_3c; undefined local_38 [40]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_3c = 0; iVar1 = getentropy(local_38,0x28); if (iVar1 == -1) { _getentropy_fail(); } if (rs == (undefined8 *)0x0) { _rs_init(local_38,0x28); } else { _rs_rekey(local_38,0x28); } explicit_bzero(local_38,0x28); *rs = 0; memset((void *)(rsx + 0x40),0,0x400); chacha_encrypt_bytes(rsx,&local_3c,&local_3c,4); rs[1] = (ulong)((local_3c & 0xfffff) + 0x100000); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
u_int cipher_ctx_is_plaintext(struct sshcipher_ctx *cc) { return cc->plaintext; }
long long cipher_ctx_is_plaintext(unsigned int *a0) { return *(a0); }
static unsigned int time_type_to_statx (void) { switch (time_type) { case time_ctime: return 0x00000080U ; case time_mtime: return 0x00000040U ; case time_atime: return 0x00000020U ; case time_btime: return 0x00000800U ; default: abort (); } return 0; }
long time_type_to_statx() { if ( time_type == 3 ) return 2048LL; if ( (unsigned int)time_type > 3 ) goto LABEL_10; if ( time_type == 2 ) return 32LL; if ( (unsigned int)time_type > 2 ) LABEL_10: abort(); if ( time_type ) return 128LL; else return 64LL; }
void * xcalloc (size_t n, size_t s) { void *p = calloc (n, s); if (!p) xalloc_die (); return p; }
void xcalloc(unsigned int a0, unsigned int a1) { unsigned long long v0; unsigned long long v2; v0 = calloc(a0, a1); if (!v0) xalloc_die(); v2 = v0; return; }
static _Bool recurse_tree (struct item *root, _Bool (*action) (struct item *)) { if (root->left == ((void *)0) && root->right == ((void *)0) ) return (*action) (root); else { if (root->left != ((void *)0) ) if (recurse_tree (root->left, action)) return 1 ; if ((*action) (root)) return 1 ; if (root->right != ((void *)0) ) if (recurse_tree (root->right, action)) return 1 ; } return 0 ; }
int recurse_tree(unsigned long long a0[3], unsigned long long a1) { unsigned long v0; unsigned int v2; v0 = a1; if (!a0[1] && !a0[2]) { v2 = (stack_base)[24](a0); goto LABEL_400baf; } if (a0[1] && recurse_tree(a0[1], a1)) { v2 = 1; goto LABEL_400baf; } if ((stack_base)[24](a0)) { v2 = 1; } else { if (a0[2] && recurse_tree(a0[2], a1)) { v2 = 1; goto LABEL_400baf; } v2 = 0; } LABEL_400baf: return v2; }
void sh_readonly (s) const char *s; { builtin_error (gettext("%s: readonly variable"), s); }
long long sh_readonly(unsigned long a0) { unsigned long v0; v0 = a0; gettext("%s: readonly variable"); return builtin_error(); }
static size_t strip_nl(char *str, size_t str_size) { if ((str_size > 0) && (str[str_size - 1] == '\n')) { str_size--; str[str_size] = 0; } if ((str_size > 0) && (str[str_size - 1] == '\r')) { str_size--; str[str_size] = 0; } return str_size; }
long strip_nl(long param_1,long param_2) { long local_18; local_18 = param_2; if ((param_2 != 0) && (*(char *)(param_1 + param_2 + -1) == '\n')) { local_18 = param_2 + -1; *(undefined *)(local_18 + param_1) = 0; } if ((local_18 != 0) && (*(char *)(param_1 + local_18 + -1) == '\r')) { local_18 = local_18 + -1; *(undefined *)(local_18 + param_1) = 0; } return local_18; }
SHELL_VAR * bind_assoc_variable (entry, name, key, value, flags) SHELL_VAR *entry; char *name; char *key; char *value; int flags; { if ((((((entry)->attributes) & (0x0000002))) && (flags&0x0020) == 0) || ((((entry)->attributes) & (0x0004000)))) { if (((((entry)->attributes) & (0x0000002)))) err_readonly (name); return (entry); } return (bind_assoc_var_internal (entry, (HASH_TABLE *)((entry)->value), key, value, flags)); }
int bind_assoc_variable(struct_0 *a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long a4) { unsigned long v1; if ((!(a0->field_28 & 2) || (a4 & 32)) && !(a0->field_28 & 0x4000)) { v1 = bind_assoc_var_internal(a0, a0->field_8, a2, a3, a4); return v1; } if ((a0->field_28 & 2)) err_readonly(a1); v1 = a0; return v1; }
static void vipwexit (const char *msg, int syserr, int ret) { int err = (*__errno_location ()) ; if (createedit) { if (unlink (fileeditname) != 0) { fprintf ( stderr , gettext ("%s: failed to remove %s\n"), Prog, fileeditname); } } if (filelocked) { if ((*unlock) () == 0) { fprintf ( stderr , gettext ("%s: failed to unlock %s\n"), Prog, fileeditname); 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", fileeditname) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); } } if ( ((void *)0) != msg) { fprintf ( stderr , "%s: %s", Prog, msg); } if (0 != syserr) { fprintf ( stderr , ": %s", strerror (err)); } if ( ( ((void *)0) != msg) || (0 != syserr)) { (void) fputs ("\n", stderr ); } if (!quiet) { fprintf ( stdout , gettext ("%s: %s is unchanged\n"), Prog, filename); } exit (ret); }
void vipwexit(unsigned long a0, unsigned long a1, unsigned long a2) { unsigned int v0; void* v1; char *v2; unsigned long v3; unsigned long v4; unsigned long v6; unsigned long v7; v4 = v6; v3 = v7; v0 = *(__errno_location()); if (createedit && unlink(fileeditname)) fprintf(stderr, gettext("%s: failed to remove %s\n")); if (filelocked && !*(4199216)()) { fprintf(stderr, gettext("%s: failed to unlock %s\n")); v2 = setlocale(0x6, NULL); v1 = 0; if (v2) v1 = strdup(v2); if (v1) setlocale(0x6, "C"); syslog(0x3, "failed to unlock %s"); if (v1) { setlocale(0x6, v1); free(v1); } } if (a0) fprintf(stderr, "%s: %s", 3968026707, a0); if (a1) fprintf(stderr, ": %s", strerror(v0)); if (a0 || a1) fputs("\n", stderr); if ((quiet ^ 1)) fprintf(stdout, gettext("%s: %s is unchanged\n")); exit(a2); }
const char * safe_directory_contents (struct directory *dir) { const char *ret = directory_contents (dir); return ret ? ret : "\0\0\0\0"; }
long long safe_directory_contents(void* a0) { unsigned long long v0; unsigned long long v2; v0 = directory_contents(a0); if (v0) v2 = v0; else v2 = &g_404cd8; return v2; }
static Keymap get_cmd_xmap_from_keymap (kmap) Keymap kmap; { if (emacs_std_cmd_xmap == 0) init_unix_command_map (); if (kmap == emacs_standard_keymap) return emacs_std_cmd_xmap; else if (kmap == emacs_meta_keymap) return ((Keymap)(emacs_std_cmd_xmap[(('[') & 0x1f)].function)); else if (kmap == emacs_ctlx_keymap) return ((Keymap)(emacs_std_cmd_xmap[(('X') & 0x1f)].function)); else if (kmap == vi_insertion_keymap) return vi_insert_cmd_xmap; else if (kmap == vi_movement_keymap) return vi_movement_cmd_xmap; else return (Keymap) ((void *)0) ; }
long get_cmd_xmap_from_keymap(undefined *param_1) { long lVar1; if (emacs_std_cmd_xmap == 0) { init_unix_command_map(); } lVar1 = emacs_std_cmd_xmap; if (param_1 != &emacs_standard_keymap) { if (param_1 == &emacs_meta_keymap) { lVar1 = *(long *)(emacs_std_cmd_xmap + 0x1b8); } else if (param_1 == &emacs_ctlx_keymap) { lVar1 = *(long *)(emacs_std_cmd_xmap + 0x188); } else { lVar1 = vi_insert_cmd_xmap; if ((param_1 != &vi_insertion_keymap) && (lVar1 = vi_movement_cmd_xmap, param_1 != &vi_movement_keymap)) { lVar1 = 0; } } } return lVar1; }
void err_badarraysub (s) const char *s; { report_error ("%s: %s", s, gettext(bash_badsub_errmsg)); }
unsigned long err_badarraysub(long a1) { char *v1; long v2; long v3; long v4; v1 = gettext(bash_badsub_errmsg); return report_error("%s: %s", a1, (long)v1, v2, v3, v4); }
double monotime_double(void) { struct timespec ts; monotime_ts(&ts); return ts.tv_sec + ((double)ts.tv_nsec / 1000000000); }
long long monotime_double() { char v0; monotime_ts(&v0); return 0; }
static crypto_uint32 ge(crypto_uint32 a,crypto_uint32 b) { unsigned int x = a; x -= (unsigned int) b; x >>= 31; x ^= 1; return x; }
uint ge(int param_1,int param_2) { return (uint)(param_1 - param_2) >> 0x1f ^ 1; }
void unlink_all_fifos () { unlink_fifo_list (); }
long long unlink_all_fifos() { return unlink_fifo_list(); }
void auth_log_authopts(const char *loc, const struct sshauthopt *opts, int do_remote) { int do_env = options.permit_user_env && opts->nenv > 0; int do_permitopen = opts->npermitopen > 0 && (options.allow_tcp_forwarding & (1<<1)) != 0; int do_permitlisten = opts->npermitlisten > 0 && (options.allow_tcp_forwarding & (1)) != 0; size_t i; char msg[1024], buf[64]; snprintf(buf, sizeof(buf), "%d", opts->force_tun_device); snprintf(msg, sizeof(msg), "key options:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", opts->permit_agent_forwarding_flag ? " agent-forwarding" : "", opts->force_command == ((void *)0) ? "" : " command", do_env ? " environment" : "", opts->valid_before == 0 ? "" : "expires", opts->no_require_user_presence ? " no-touch-required" : "", do_permitopen ? " permitopen" : "", do_permitlisten ? " permitlisten" : "", opts->permit_port_forwarding_flag ? " port-forwarding" : "", opts->cert_principals == ((void *)0) ? "" : " principals", opts->permit_pty_flag ? " pty" : "", opts->require_verify ? " uv" : "", opts->force_tun_device == -1 ? "" : " tun=", opts->force_tun_device == -1 ? "" : buf, opts->permit_user_rc ? " user-rc" : "", opts->permit_x11_forwarding_flag ? " x11-forwarding" : ""); sshlog("auth.c", __func__, 787, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s: %s", loc, msg); if (do_remote) auth_debug_add("%s: %s", loc, msg); if (options.permit_user_env) { for (i = 0; i < opts->nenv; i++) { sshlog("auth.c", __func__, 793, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s: environment: %s", loc, opts->env[i]); if (do_remote) { auth_debug_add("%s: environment: %s", loc, opts->env[i]); } } } if (opts->valid_before != 0) { format_absolute_time(opts->valid_before, buf, sizeof(buf)); sshlog("auth.c", __func__, 804, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s: expires at %s", loc, buf); } if (opts->cert_principals != ((void *)0) ) { sshlog("auth.c", __func__, 807, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s: authorized principals: \"%s\"", loc, opts->cert_principals) ; } if (opts->force_command != ((void *)0) ) sshlog("auth.c", __func__, 811, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s: forced command: \"%s\"", loc, opts->force_command); if (do_permitopen) { for (i = 0; i < opts->npermitopen; i++) { sshlog("auth.c", __func__, 814, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s: permitted open: %s", loc, opts->permitopen[i]) ; } } if (do_permitlisten) { for (i = 0; i < opts->npermitlisten; i++) { sshlog("auth.c", __func__, 820, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s: permitted listen: %s", loc, opts->permitlisten[i]) ; } } }
long long auth_log_authopts(unsigned long long a0, unsigned long long a1, unsigned int a2) { unsigned long long v0; unsigned long long v1; struct_0 *v2; unsigned long long v3; unsigned int v4; unsigned int v5; unsigned int v6; void* v7; char v8; char v9; unsigned int v11; unsigned int v12; unsigned int v13; unsigned long long v14; unsigned long long v15; unsigned long long v16; unsigned long long v17; unsigned long long v18; unsigned long long v19; unsigned long long v20; unsigned long long v21; unsigned long long v22; unsigned long long v23; v3 = a0; v2 = a1; if (*(5244236) && v2->field_40) { v11 = 1; goto LABEL_401f91; } v11 = 0; LABEL_401f91: v4 = v11; if (v2->field_50 && (*(5244252) & 2)) { v12 = 1; goto LABEL_401fc0; } v12 = 0; LABEL_401fc0: v5 = v12; if (v2->field_60 && (*(5244252) & 1)) { v13 = 1; goto LABEL_401fef; } v13 = 0; LABEL_401fef: v6 = v13; snprintf(&v8, 0x40, "%d", v2->field_30); if (v2->field_8) v14 = " x11-forwarding"; else v14 = &g_402b2c; if (v2->field_10) v15 = " user-rc"; else v15 = &g_402b2c; if (v2->field_30 != -1) a1 = &v8; else a1 = &g_402b2c; if (v2->field_30 == -1) v16 = &g_402b2c; else v16 = " tun="; if (v2->field_84) v17 = " uv"; else v17 = &g_402b2c; if (v2->field_c) v18 = " pty"; else v18 = &g_402b2c; if (!v2->field_28) v19 = &g_402b2c; else v19 = " principals"; if (v2->field_0) v20 = " port-forwarding"; else v20 = &g_402b2c; if (v6) v21 = " permitlisten"; else v21 = &g_402b2c; if (v5) v22 = " permitopen"; else v22 = &g_402b2c; if (v2->field_80) v23 = " no-touch-required"; else v23 = &g_402b2c; if (!v2->field_18) a0 = &g_402b2c; else a0 = "expires"; if (v4) v1 = " environment"; else v1 = &g_402b2c; if (!v2->field_38) v0 = &g_402b2c; else v0 = " com"; if (!v2->field_4) a2 = &g_402b2c; else a2 = " agent-forwarding"; snprintf(&v9, 0x400, "key options:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", a2, v0, v1, a0, v23, v22, v21, v20, v19, v18, v17, v16, a1, v15, v14); sshlog("auth.c", "auth_log_authopts", 0x313, 0x0, 0x5, 0x0, "%s: %s"); if (a2) auth_debug_add(); if (*(5244236)) { for (v7 = 0; v7 < v2->field_40; v7 += 1) { sshlog("auth.c", "auth_log_authopts", 0x319, 0x0, 0x5, 0x0, "%s: environment: %s"); if (a2) auth_debug_add(); } } if (v2->field_18) { format_absolute_time(v2->field_18, &v8, 0x40, &v8); sshlog("auth.c", "auth_log_authopts", 0x324, 0x0, 0x5, 0x0, "%s: expires at %s"); } if (v2->field_28) sshlog("auth.c", "auth_log_authopts", 0x327, 0x0, 0x5, 0x0, "%s: authorized principals: \"%s\""); if (v2->field_38) sshlog("auth.c", "auth_log_authopts", 0x32b, 0x0, 0x5, 0x0, "%s: forced command: \"%s\""); if (v5) { for (v7 = 0; v7 < v2->field_50; v7 += 1) { sshlog("auth.c", "auth_log_authopts", 0x32e, 0x0, 0x5, 0x0, "%s: permitted open: %s"); } } if (v6) { for (v7 = 0; v7 < v2->field_60; v7 += 1) { sshlog("auth.c", "auth_log_authopts", 0x334, 0x0, 0x5, 0x0, "%s: permitted listen: %s"); } } return 0; }
static inline _Bool is_smack_enabled (void) { return 0 ; }
int is_smack_enabled() { return 0; }
static void usage (int status) { FILE *usageout = ( 0 != status) ? stderr : stdout ; (void) fprintf (usageout, gettext ("Usage: %s [options] [LOGIN]\n" "\n" "Options:\n") , Prog); (void) fputs (gettext (" -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, --shell SHELL new login shell for the user account\n"), usageout); (void) fputs ("\n", usageout); exit (status); }
void usage(unsigned long a0) { void* v0; unsigned long v1; unsigned long v3; void* v4; v1 = v3; if (a0) v4 = stderr; else v4 = stdout; v0 = v4; fprintf(v0, gettext("Usage: %s [options] [LOGIN]\n\nOptions:\n")); fputs(gettext(" -h, --help display this help message and exit\n"), v0); fputs(gettext(" -R, --root CHROOT_DIR directory to chroot into\n"), v0); fputs(gettext(" -s, --shell SHELL new login shell for the user account\n"), v0); fputs("\n", v0); exit(a0); }
int do_exec(struct ssh *ssh, Session *s, const char *command) { int ret; const char *forced = ((void *)0) , *tty = ((void *)0) ; char session_type[1024]; if (options.adm_forced_command) { original_command = command; command = options.adm_forced_command; forced = "(config)"; } else if (auth_opts->force_command != ((void *)0) ) { original_command = command; command = auth_opts->force_command; forced = "(key-option)"; } s->forced = 0; if (forced != ((void *)0) ) { s->forced = 1; if ((!strncmp(command, "internal-sftp", sizeof("internal-sftp") - 1) && (command[sizeof("internal-sftp") - 1] == '\0' || command[sizeof("internal-sftp") - 1] == ' ' || command[sizeof("internal-sftp") - 1] == '\t'))) { s->is_subsystem = s->is_subsystem ? 2 : 3; } else if (s->is_subsystem) s->is_subsystem = 1; snprintf(session_type, sizeof(session_type), "forced-command %s '%.900s'", forced, command); } else if (s->is_subsystem) { snprintf(session_type, sizeof(session_type), "subsystem '%.900s'", s->subsys); } else if (command == ((void *)0) ) { snprintf(session_type, sizeof(session_type), "shell"); } else { snprintf(session_type, sizeof(session_type), "command"); } if (s->ttyfd != -1) { tty = s->tty; if (strncmp(tty, "/dev/", 5) == 0) tty += 5; } sshlog("session.c", __func__, 699, 0, SYSLOG_LEVEL_VERBOSE, ((void *)0) , "Starting session: %s%s%s for %s from %.200s port %d id %d", session_type, tty == ((void *)0) ? "" : " on ", tty == ((void *)0) ? "" : tty, s->pw->pw_name, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), s->self) ; if (s->ttyfd != -1) ret = do_exec_pty(ssh, s, command); else ret = do_exec_no_pty(ssh, s, command); original_command = ((void *)0) ; sshbuf_reset(loginmsg); return ret; }
int do_exec(unsigned long long a0, struct_0 *a1, char *a2) { unsigned long long v0; unsigned long v1; unsigned long long v2; unsigned long long v3; unsigned long v4; unsigned long v5; unsigned long v6; unsigned long v7; void* v8; unsigned int v9; unsigned long long v10; void* v11; char v12; unsigned int v14; unsigned long long v17; unsigned long long v18; v8 = a2; v10 = 0; v11 = 0; if (*(5250768)) { original_command = v8; v8 = *(5250768); v10 = "(config)"; } else if (*((auth_opts + 56))) { original_command = v8; v8 = *((auth_opts + 56)); v10 = "(key-option)"; } a1->field_24 = 0; if (v10) { a1->field_24 = 1; if (strncmp(v8, "internal-sftp", 0xd)) { LABEL_40142c: if (a1->field_c8) a1->field_c8 = 1; } else { if (v8[13] && v8[13] != 32 && !(v8[13] == 9)) goto LABEL_40142c; if (!a1->field_c8) v14 = 3; else v14 = 2; a1->field_c8 = v14; } snprintf(&v12, 0x400, "forced-co", v10, v8); } else if (a1->field_c8) { snprintf(&v12, 0x400, "subsystem '%.900s'", a1->field_d0); } else if (v8) { snprintf(&v12, 0x400, "command"); } else { snprintf(&v12, 0x400, "shell"); } if (a1->field_34 != -1) { v11 = &a1->padding_38[20]; if (!strncmp(v11, "/dev/", 0x5)) v11 += 5; } if (!v11) v17 = &g_407897; else v17 = v11; if (!v11) v18 = &g_407897; else v18 = " on "; v7 = a1->field_4; v6 = ssh_remote_port(a0); v5 = ssh_remote_ipaddr(a0); v4 = a1->field_10->field_0; v3 = v17; v2 = v18; v1 = &v12; v0 = "Starting session: %s%s%s for %s from %.200s port %d id %d"; sshlog("session.c", "do_exec", 0x2bb, 0x0, 0x4, 0x0); if (a1->field_34 == -1) v9 = do_exec_no_pty(a0, a1, v8); else v9 = do_exec_pty(a0, a1, v8); original_command = 0; sshbuf_reset(loginmsg); return v9; }
static inline _Bool field_sep (unsigned char ch) { return ((*__ctype_b_loc ())[(int) (( ch ))] & (unsigned short int) _ISblank) || ch == '\n'; }
int field_sep(unsigned long a0) { unsigned int v2; unsigned int v3; unsigned int v4; v2 = *((*(__ctype_b_loc()) + a0 * 2)) & 1; if (v2 || a0 == 10) v3 = 1; else v3 = 0; v4 = v3 & 1; return v4; }
hist_init(EditLine *el) { el->el_history.fun = ((void *)0) ; el->el_history.ref = ((void *)0) ; el->el_history.buf = calloc(((size_t)1024), sizeof(*el->el_history.buf)); if (el->el_history.buf == ((void *)0) ) return -1; el->el_history.sz = ((size_t)1024); el->el_history.last = el->el_history.buf; return 0; }
long hist_init(_QWORD *a1) { a1[144] = 0LL; a1[143] = 0LL; a1[139] = calloc(0x400uLL, 4uLL); if ( !a1[139] ) return 0xFFFFFFFFLL; a1[140] = 1024LL; a1[141] = a1[139]; return 0LL; }
static void gnu_add_multi_volume_header (struct bufmap *map) { int tmp; union block *block = find_next_block (); size_t len = strlen (map->file_name); if (len > 100) { do { if (error_hook) error_hook (); error (0, 0, gettext ("%s: file name too long to be stored in a GNU multivolume header, truncated"), quotearg_colon (map->file_name)); } while (0) ; len = 100; } memset (block, 0, 512); memcpy (block->header.name, map->file_name, len); block->header.typeflag = 'M'; off_to_chars (map->sizeleft, block->header.size, sizeof (block->header.size)); off_to_chars (map->sizetotal - map->sizeleft, block->oldgnu_header.offset, sizeof (block->oldgnu_header.offset)) ; tmp = verbose_option; verbose_option = 0; finish_header (&current_stat_info, block, -1); verbose_option = tmp; set_next_block_after (block); }
void gnu_add_multi_volume_header(unsigned long long a0[5]) { unsigned int v0; unsigned long long v1; struct_0 *v2; unsigned long long v4; unsigned long long v5; v2 = find_next_block(); v1 = strlen(a0[2]); if (v1 > 100) { if (error_hook) *(5243096)(); v4 = quotearg_colon(a0[2]); error(0x0, 0x0, gettext("%s: file name too long to be stored in a GNU multivolume header, truncated")); v1 = 100; } memset(v2, 0x0, 0x200); memcpy(v2, a0[2], v1); v2->field_9c = 77; off_to_chars(a0[4], &v2->padding_0[124], 0xc, &v2->padding_0[124]); off_to_chars(a0[3] - a0[4], &v2[2].padding_0[55], 0xc, &v2[2].padding_0[55]); v0 = verbose_option; verbose_option = 0; finish_header(0x500188, v2, 0xffffffffffffffff); verbose_option = v0; v5 = set_next_block_after(v2); return; }
time_t get_crl_revocation_date(void) { if (batch && cfg.revocation_date != ((void *)0) ) { return get_date(cfg.revocation_date); } return time( ((void *)0) ); }
void get_crl_revocation_date(void) { if ((*piRam000000000010710a == 0) || (*(long *)(lRam0000000000107117 + 0x1f0) == 0)) { time((time_t *)0x0); } else { get_date(*(undefined8 *)(lRam000000000010712a + 0x1f0)); } return; }
static inline void emit_ancillary_info (char const *program) { struct infomap { char const *program; char const *node; } const infomap[] = { { "[", "test invocation" }, { "coreutils", "Multi-call invocation" }, { "sha224sum", "sha2 utilities" }, { "sha256sum", "sha2 utilities" }, { "sha384sum", "sha2 utilities" }, { "sha512sum", "sha2 utilities" }, { ((void *)0) , ((void *)0) } }; char const *node = program; struct infomap const *map_prog = infomap; while (map_prog->program && ! (strcmp (program, map_prog->program) == 0)) map_prog++; if (map_prog->node) node = map_prog->node; printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https: char const *lc_messages = setlocale ( 5 , ((void *)0) ); if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1)) { fputs_unlocked (gettext ("Report any translation bugs to " "<https: stdout ) ; } char const *url_program = (strcmp (program, "[") == 0) ? "test" : program; printf (gettext ("Full documentation <%s%s>\n"), "https: printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"), node, node == program ? " invocation" : ""); }
void emit_ancillary_info(char *a0) { unsigned long long v0; unsigned long long v1[2]; char *v2; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long long v9; unsigned long long v10; unsigned long long v11; unsigned long long v12; unsigned long long v13; unsigned long long v14; unsigned long long v15; void* v16; void* v17; char v18; unsigned long long v23; unsigned long long *v24; unsigned long long v25; v4 = "["; v5 = "test invocation"; v6 = "coreutils"; v7 = "Multi-call invocation"; v8 = "sha224sum"; v9 = "sha2 utilities"; v10 = "sha256sum"; v11 = "sha2 utilities"; v12 = "sha384sum"; v13 = "sha2 utilities"; v14 = "sha512sum"; v15 = "sha2 utilities"; v16 = 0; v17 = 0; v0 = a0; for (v1[0] = &v4; v1[0]; v1[0] = v1 + 1) { if (!strcmp(a0, v1[0])) break; } if (v1[1]) v0 = v1[1]; printf(gettext("\n%s online help: <%s>\n")); v2 = setlocale(0x5, NULL); if (v2 && strncmp(v2, "en_", 0x3)) fputs_unlocked(gettext("Report any translation bugs to <https: if (strcmp(a0, "[")) v23 = a0; else v23 = "test"; v3 = v23; printf(gettext("Full documentation <%s%s>\n")); printf(gettext("or available locally via: info '(coreutils) %s%s'\n")); v25 = *(&v18) ^ v24[5]; return; }
void iproute_reset_filter(int ifindex) { memset(&filter, 0, sizeof(filter)); filter.mdst.bitlen = -1; filter.msrc.bitlen = -1; filter.oif = ifindex; if (filter.oif > 0) filter.oifmask = -1; }
void iproute_reset_filter(unsigned long a0) { unsigned long long v1; memset(&filter, 0x0, 0x698); g_4090a4 = 65535; g_4092b4 = 65535; g_408d68 = a0; v1 = g_408d68; if (g_408d68 > 0) { g_408d6c = -1; return; } return; }
static void vlan_print_flags(FILE *fp, __u32 flags) { open_json_array(PRINT_ANY, is_json_context() ? "flags" : "<"); if (flags & VLAN_FLAG_REORDER_HDR) { flags &= ~VLAN_FLAG_REORDER_HDR; print_string(PRINT_ANY, ((void *)0) , flags ? "%s," : "%s", "REORDER_HDR"); }; if (flags & VLAN_FLAG_GVRP) { flags &= ~VLAN_FLAG_GVRP; print_string(PRINT_ANY, ((void *)0) , flags ? "%s," : "%s", "GVRP"); }; if (flags & VLAN_FLAG_MVRP) { flags &= ~VLAN_FLAG_MVRP; print_string(PRINT_ANY, ((void *)0) , flags ? "%s," : "%s", "MVRP"); }; if (flags & VLAN_FLAG_LOOSE_BINDING) { flags &= ~VLAN_FLAG_LOOSE_BINDING; print_string(PRINT_ANY, ((void *)0) , flags ? "%s," : "%s", "LOOSE_BINDING"); }; if (flags & VLAN_FLAG_BRIDGE_BINDING) { flags &= ~VLAN_FLAG_BRIDGE_BINDING; print_string(PRINT_ANY, ((void *)0) , flags ? "%s," : "%s", "BRIDGE_BINDING"); }; if (flags) print_hex(PRINT_ANY, ((void *)0) , "%x", flags); close_json_array(PRINT_ANY, "> "); }
void vlan_print_flags(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned long v1; unsigned long long v4; unsigned long long v5; unsigned long long v7; unsigned long long v8; unsigned long long v9; unsigned long long v10; unsigned long long v11; v1 = a0; v0 = a1; if (is_json_context()) v4 = "flags"; else v4 = "<"; open_json_array(0x4, v4); if ((v0 & 1)) { v0 &= -2; if (v0) v5 = "%s,"; else v5 = "%s"; print_string(0x4, 0x0, v5, "REORDER_HDR"); } if ((v0 & 2)) { v0 &= -3; if (v0) v7 = "%s,"; else v7 = "%s"; print_string(0x4, 0x0, v7, "GVRP"); } if ((v0 & 8)) { v0 &= -9; if (v0) v8 = "%s,"; else v8 = "%s"; print_string(0x4, 0x0, v8, "MVRP"); } if ((v0 & 4)) { v0 &= -5; if (v0) v9 = "%s,"; else v9 = "%s"; print_string(0x4, 0x0, v9, "LOOSE_BINDING"); } if ((v0 & 16)) { v0 &= -17; if (v0) v10 = "%s,"; else v10 = "%s"; print_string(0x4, 0x0, v10, "BRIDGE_BINDING"); } if (v0) print_hex(0x4, 0x0, "%x", v0); v11 = close_json_array(0x4, "> "); return; }
void sh_getopt_dispose_istate (gs) sh_getopt_state_t *gs; { sh_xfree((gs), "getopt.c", 239); }
void sh_getopt_dispose_istate(undefined8 param_1) { sh_xfree(param_1,"getopt.c",0xef); return; }
literal_add(EditLine *el, const wchar_t *buf, const wchar_t *end, int *wp) { el_literal_t *l = &el->el_literal; size_t i, len; ssize_t w, n; char *b; w = wcwidth(end[1]); *wp = (int)w; if (w <= 0) return 0; len = (size_t)(end - buf); for (w = 0, i = 0; i < len; i++) w += ct_enc_width(buf[i]); w += ct_enc_width(end[1]); b = malloc((size_t)(w + 1)); if (b == ((void *)0) ) return 0; for (n = 0, i = 0; i < len; i++) n += ct_encode_char(b + n, (size_t)(w - n), buf[i]); n += ct_encode_char(b + n, (size_t)(w - n), end[1]); b[n] = '\0'; if (l->l_idx == l->l_len) { char **bp; l->l_len += 4; bp = realloc(l->l_buf, sizeof(*l->l_buf) * l->l_len); if (bp == ((void *)0) ) { free(b); l->l_len -= 4; return 0; } l->l_buf = bp; } l->l_buf[l->l_idx++] = b; return ((wint_t)0x80000000) | (wint_t)(l->l_idx - 1); }
long literal_add(_QWORD *a1, long a2, long a3, int *a4) { int v4; long v6; long v7; unsigned long i; unsigned long j; long v12; long v13; long v14; long *v15; unsigned long v16; _BYTE *ptr; void *v18; v15 = a1 + 106; v4 = wcwidth(*(_DWORD *)(a3 + 4)); *a4 = v4; if ( v4 <= 0LL ) return 0LL; v16 = (a3 - a2) >> 2; v12 = 0LL; for ( i = 0LL; i < v16; ++i ) v12 += ct_enc_width(*(unsigned int *)(4 * i + a2)); v13 = v12 + ct_enc_width(*(unsigned int *)(a3 + 4)); ptr = malloc(v13 + 1); if ( !ptr ) return 0LL; v14 = 0LL; for ( j = 0LL; j < v16; ++j ) v14 += ct_encode_char(&ptr[v14], v13 - v14, *(unsigned int *)(4 * j + a2)); ptr[ct_encode_char(&ptr[v14], v13 - v14, *(unsigned int *)(a3 + 4)) + v14] = 0; if ( a1[107] == a1[108] ) { a1[108] += 4LL; v18 = realloc((void *)a1[106], 8LL * a1[108]); if ( !v18 ) { free(ptr); a1[108] -= 4LL; return 0LL; } *v15 = (long)v18; } v6 = *v15; v7 = a1[107]; a1[107] = v7 + 1; *(_QWORD *)(v6 + 8 * v7) = ptr; return ((unsigned int)a1[107] - 1) | 0x80000000; }
int rl_vi_eof_maybe (int count, int c) { return (rl_newline (1, '\n')); }
long long rl_vi_eof_maybe(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned int v1; v1 = a0; v0 = a1; return rl_newline(1, 10); }
keymacro_delete(EditLine *el, const wchar_t *key) { if (key[0] == '\0') { (void) fprintf(el->el_errfile, "keymacro_delete: Null extended-key not allowed.\n"); return -1; } if (el->el_keymacro.map == ((void *)0) ) return 0; (void) node__delete(el, &el->el_keymacro.map, key); return 0; }
undefined8 keymacro_delete(long param_1,int *param_2) { undefined8 uVar1; if (*param_2 == 0) { fprintf(*(FILE **)(param_1 + 0x18),"keymacro_delete: Null extended-key not allowed.\n"); uVar1 = 0xffffffff; } else if (*(long *)(param_1 + 0x448) == 0) { uVar1 = 0; } else { node__delete(param_1,param_1 + 0x448,param_2); uVar1 = 0; } return uVar1; }
int main (int argc, char **argv) { _Bool have_read_stdin = 0 ; struct stat stat_buf; _Bool number = 0 ; _Bool number_nonblank = 0 ; _Bool squeeze_blank = 0 ; _Bool show_ends = 0 ; _Bool show_nonprinting = 0 ; _Bool show_tabs = 0 ; int file_open_mode = 00 ; static struct option const long_options[] = { {"number-nonblank", 0 , ((void *)0) , 'b'}, {"number", 0 , ((void *)0) , 'n'}, {"squeeze-blank", 0 , ((void *)0) , 's'}, {"show-nonprinting", 0 , ((void *)0) , 'v'}, {"show-ends", 0 , ((void *)0) , 'E'}, {"show-tabs", 0 , ((void *)0) , 'T'}, {"show-all", 0 , ((void *)0) , 'A'}, {"help", 0 , ((void *)0) , GETOPT_HELP_CHAR}, {"version", 0 , ((void *)0) , GETOPT_VERSION_CHAR}, { ((void *)0) , 0, ((void *)0) , 0} }; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdout); int c; while ((c = getopt_long (argc, argv, "benstuvAET", long_options, ((void *)0) )) != -1) { switch (c) { case 'b': number = 1 ; number_nonblank = 1 ; break; case 'e': show_ends = 1 ; show_nonprinting = 1 ; break; case 'n': number = 1 ; break; case 's': squeeze_blank = 1 ; break; case 't': show_tabs = 1 ; show_nonprinting = 1 ; break; case 'u': break; case 'v': show_nonprinting = 1 ; break; case 'A': show_nonprinting = 1 ; show_ends = 1 ; show_tabs = 1 ; break; case 'E': show_ends = 1 ; break; case 'T': show_tabs = 1 ; break; case GETOPT_HELP_CHAR: usage ( 0 ); break;; case GETOPT_VERSION_CHAR: version_etc ( stdout , "cat", "GNU coreutils", Version, ("Torbjorn Granlund"), ("Richard M. Stallman"), (char *) ((void *)0) ); exit ( 0 ); break;; default: usage ( 1 ); } } if (fstat ( 1 , &stat_buf) < 0) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"standard output\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , gettext ("standard output")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , gettext ("standard output")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); idx_t outsize = io_blksize (stat_buf); dev_t out_dev = stat_buf.st_dev; ino_t out_ino = stat_buf.st_ino; _Bool out_isreg = (((( stat_buf.st_mode )) & 0170000) == (0100000)) != 0; if (! (number || show_ends || squeeze_blank)) { file_open_mode |= 0 ; xset_binary_mode ( 1 , 0 ); } infile = "-"; int argind = optind; _Bool ok = 1 ; idx_t page_size = getpagesize (); do { if (argind < argc) infile = argv[argind]; _Bool reading_stdin = (strcmp (infile, "-") == 0); if (reading_stdin) { have_read_stdin = 1 ; input_desc = 0 ; if (file_open_mode & 0 ) xset_binary_mode ( 0 , 0 ); } else { input_desc = open (infile, file_open_mode); if (input_desc < 0) { error (0, (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)); ok = 0 ; continue; } } if (fstat (input_desc, &stat_buf) < 0) { error (0, (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)); ok = 0 ; goto contin; } idx_t insize = io_blksize (stat_buf); fdadvise (input_desc, 0, 0, FADVISE_SEQUENTIAL); if (out_isreg && stat_buf.st_dev == out_dev && stat_buf.st_ino == out_ino && lseek (input_desc, 0, 1 ) < stat_buf.st_size) { error (0, 0, gettext ("%s: input file is output file"), quotearg_n_style_colon (0, shell_escape_quoting_style, infile)); ok = 0 ; goto contin; } char *inbuf; if (! (number || show_ends || show_nonprinting || show_tabs || squeeze_blank)) { int copy_cat_status = out_isreg && (((( stat_buf.st_mode )) & 0170000) == (0100000)) ? copy_cat () : 0; if (copy_cat_status != 0) { inbuf = ((void *)0) ; ok &= 0 < copy_cat_status; } else { insize = ((( insize )>( outsize ))?( insize ):( outsize )) ; inbuf = xalignalloc (page_size, insize); ok &= simple_cat (inbuf, insize); } } else { inbuf = xalignalloc (page_size, insize + 1); idx_t bufsize; if (__builtin_mul_overflow (insize, 4, &bufsize) || __builtin_add_overflow (bufsize, outsize, &bufsize) || __builtin_add_overflow (bufsize, 20 - 1, &bufsize)) xalloc_die (); char *outbuf = xalignalloc (page_size, bufsize); ok &= cat (inbuf, insize, outbuf, outsize, show_nonprinting, show_tabs, number, number_nonblank, show_ends, squeeze_blank); alignfree (outbuf); } alignfree (inbuf); contin: if (!reading_stdin && close (input_desc) < 0) { error (0, (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)); ok = 0 ; } } while (++argind < argc); if (pending_cr) { if (full_write ( 1 , "\r", 1) != 1) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"write error\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , gettext ("write error")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , gettext ("write error")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); } if (have_read_stdin && close ( 0 ) < 0) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"closing standard input\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , gettext ("closing standard input")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , gettext ("closing standard input")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); return ok ? 0 : 1 ; }
int main(int argc, const char **argv, const char **envp) { long p_buf; long v4; long v5; long v6; long v7; char *v8; int v9; long v10; long v11; long v12; long v13; long v14; const char *v15; int *v16; long v17; char *v18; int v19; long v20; unsigned char v21; bool v22; bool v23; const char *v24; int *v25; char *v26; int *v27; char *v28; int *v29; char v33; char v34; char v35; char v36; char v37; char v38; char v39; bool v40; bool v41; bool v42; int v43; int v44; long v45; long v46; char *v47; long v48; __dev_t st_dev; __ino_t st_ino; long v51; long v52; long v53; char *v54; struct stat buf; unsigned long v56; v56 = __readfsqword(0x28u); v33 = 0; v34 = 0; v35 = 0; v36 = 0; v37 = 0; v38 = 0; v39 = 0; set_program_name(*argv, argv, envp); setlocale(6, locale); bindtextdomain("coreutils", "/usr/local/share/locale"); textdomain("coreutils"); atexit((void (*)(void))&close_stdout); while ( 2 ) { v44 = getopt_long(argc, (char *const *)argv, "benstuvAET", &long_options_5884, 0LL); if ( v44 != -1 ) { if ( v44 <= 118 ) { if ( v44 >= 65 ) { switch ( v44 ) { case 'A': v38 = 1; v37 = 1; v39 = 1; continue; case 'E': v37 = 1; continue; case 'T': v39 = 1; continue; case 'b': v34 = 1; v35 = 1; continue; case 'e': v37 = 1; v38 = 1; continue; case 'n': v34 = 1; continue; case 's': v36 = 1; continue; case 't': v39 = 1; v38 = 1; continue; case 'u': continue; case 'v': v38 = 1; continue; default: goto LABEL_19; } } if ( v44 == -131 ) { version_etc(stdout, "cat", "GNU coreutils", Version, "Torbjorn Granlund", "Richard M. Stallman", 0LL); exit(0); } if ( v44 == -130 ) usage(0); } LABEL_19: usage(1); } break; } p_buf = (long)&buf; if ( fstat(1, &buf) < 0 ) { v8 = gettext("standard output"); p_buf = (unsigned int)*_errno_location(); error(1, p_buf, v8); } v48 = io_blksize( 1LL, p_buf, v4, v5, v6, v7, buf.st_dev, buf.st_ino, buf.st_nlink, buf.st_mode, buf.st_gid, buf.st_rdev, buf.st_size, buf.st_blksize); st_dev = buf.st_dev; st_ino = buf.st_ino; v41 = (buf.st_mode & 0xF000) == 0x8000; if ( v34 != 1 && v37 != 1 && v36 != 1 ) xset_binary_mode(1LL, 0LL); infile = "-"; v43 = optind; v40 = 1; v51 = getpagesize(); do { if ( v43 < argc ) infile = (char *)argv[v43]; v9 = strcmp(infile, "-"); v42 = v9 == 0; if ( v9 ) { input_desc = open(infile, 0); if ( input_desc < 0 ) goto LABEL_61; } else { v33 = 1; input_desc = 0; } v10 = (unsigned int)input_desc; if ( fstat(input_desc, &buf) >= 0 ) { v52 = io_blksize( v10, (long)&buf, v11, v12, v13, v14, buf.st_dev, buf.st_ino, buf.st_nlink, buf.st_mode, buf.st_gid, buf.st_rdev, buf.st_size, buf.st_blksize); fdadvise((unsigned int)input_desc, 0LL, 0LL, 2LL); if ( v41 && st_dev == buf.st_dev && st_ino == buf.st_ino && lseek(input_desc, 0LL, 1) < buf.st_size ) { v17 = quotearg_n_style_colon(0LL, 3LL, infile); v18 = gettext("%s: input file is output file"); error(0, 0, v18, v17); v40 = 0; } else if ( v34 != 1 && v37 != 1 && v38 != 1 && v39 != 1 && v36 != 1 ) { if ( v41 && (buf.st_mode & 0xF000) == 0x8000 ) v19 = copy_cat(); else v19 = 0; if ( v19 ) { v40 = v40 && v19 > 0; alignfree(0LL); } else { v20 = v52; if ( v48 >= v52 ) v20 = v48; v53 = v20; v46 = xalignalloc(v51, v20); simple_cat(v46, v53); v40 = (v40 & v21) != 0; alignfree(v46); } } else { v47 = (char *)xalignalloc(v51, v52 + 1); v45 = 4 * v52; if ( !is_mul_ok(4uLL, v52) || (v22 = __OFADD__(v45, v48), v45 += v48, v22) || (v23 = __OFADD__(19LL, v45), v45 += 19LL, v23) ) { xalloc_die(); } v54 = (char *)xalignalloc(v51, v45); v40 = (v40 & (unsigned char)cat(v47, v52, v54, v48, v38, v39, v34, v35, v37, v36)) != 0; alignfree(v54); alignfree(v47); } } else { v15 = (const char *)quotearg_n_style_colon(0LL, 3LL, infile); v16 = _errno_location(); error(0, *v16, "%s", v15); v40 = 0; } if ( !v42 && close(input_desc) < 0 ) { LABEL_61: v24 = (const char *)quotearg_n_style_colon(0LL, 3LL, infile); v25 = _errno_location(); error(0, *v25, "%s", v24); v40 = 0; } ++v43; } while ( v43 < argc ); if ( pending_cr && full_write(1LL, "\r", 1LL) != 1 ) { v26 = gettext("write error"); v27 = _errno_location(); error(1, *v27, v26); } if ( v33 && close(0) < 0 ) { v28 = gettext("closing standard input"); v29 = _errno_location(); error(1, *v29, v28); } return !v40; }
static WORD_LIST * assoc_to_word_list_internal (h, t) HASH_TABLE *h; int t; { WORD_LIST *list; int i; BUCKET_CONTENTS *tlist; char *w; if (h == 0 || ((h)->nentries == 0)) return((WORD_LIST *) ((void *)0) ); list = (WORD_LIST *) ((void *)0) ; for (i = 0; i < h->nbuckets; i++) for (tlist = ((h && (i < h->nbuckets)) ? h->bucket_array[i] : (BUCKET_CONTENTS *) ((void *)0) ); tlist; tlist = tlist->next) { w = (t == 0) ? (char *)tlist->data : (char *)tlist->key; list = make_word_list (make_bare_word(w), list); } return (((list && list->next) ? (WORD_LIST *)list_reverse ((GENERIC_LIST *)list) : (WORD_LIST *)(list))); }
_QWORD * assoc_to_word_list_internal(long a1, int a2) { long v3; long bare_word; int i; _QWORD *word_list; _QWORD *j; if ( !a1 || !*(_DWORD *)(a1 + 12) ) return 0LL; word_list = 0LL; for ( i = 0; i < *(_DWORD *)(a1 + 8); ++i ) { for ( j = *(_QWORD **)(8LL * i + *(_QWORD *)a1); j; j = (_QWORD *)*j ) { if ( a2 ) v3 = j[1]; else v3 = j[2]; bare_word = make_bare_word(v3); word_list = (_QWORD *)make_word_list(bare_word, word_list); } } if ( word_list && *word_list ) return (_QWORD *)list_reverse(word_list); else return word_list; }
Channel * channel_by_id(struct ssh *ssh, int id) { Channel *c; if (id < 0 || (u_int)id >= ssh->chanctxt->channels_alloc) { sshlog("channels.c", __func__, 245, 1, SYSLOG_LEVEL_INFO, ((void *)0) , "%d: bad id", id); return ((void *)0) ; } c = ssh->chanctxt->channels[id]; if (c == ((void *)0) ) { sshlog("channels.c", __func__, 250, 1, SYSLOG_LEVEL_INFO, ((void *)0) , "%d: bad id: channel free", id); return ((void *)0) ; } return c; }
long channel_by_id(long param_1,uint param_2) { long lVar1; if (((int)param_2 < 0) || (*(uint *)(*(long *)(param_1 + 0x868) + 8) <= param_2)) { sshlog("channels.c","channel_by_id",0xf5,1,3,0,"%d: bad id",param_2); lVar1 = 0; } else { lVar1 = *(long *)(**(long **)(param_1 + 0x868) + (long)(int)param_2 * 8); if (lVar1 == 0) { sshlog("channels.c","channel_by_id",0xfa,1,3,0,"%d: bad id: channel free",param_2); lVar1 = 0; } } return lVar1; }
static WORD_LIST * expand_string_leave_quoted (string, quoted) char *string; int quoted; { WORD_LIST *tlist; WORD_LIST *tresult; if (string == 0 || *string == '\0') return ((WORD_LIST *) ((void *)0) ); tlist = expand_string_internal (string, quoted); if (tlist) { tresult = word_list_split (tlist); dispose_words (tlist); return (tresult); } return ((WORD_LIST *) ((void *)0) ); }
_QWORD * expand_string_leave_quoted(const char *a1, unsigned int a2) { long **v3; _QWORD *v4; if ( !a1 || !*a1 ) return 0LL; v3 = expand_string_internal(a1, a2); if ( !v3 ) return 0LL; v4 = word_list_split(v3); dispose_words(v3); return v4; }
static el_action_t cv_paste(EditLine *el, wint_t c) { c_kill_t *k = &el->el_chared.c_kill; size_t len = (size_t)(k->last - k->buf); if (k->buf == ((void *)0) || len == 0) return 6; cv_undo(el); if (!c && el->el_line.cursor < el->el_line.lastchar) el->el_line.cursor++; c_insert(el, (int)len); if (el->el_line.cursor + len > el->el_line.lastchar) return 6; (void) memcpy(el->el_line.cursor, k->buf, len * sizeof(*el->el_line.cursor)); return 4; }
void cv_paste(unsigned long long a0[13], unsigned long a1) { unsigned long long v0[2]; unsigned long long v1; unsigned long long v3; unsigned long long v4; unsigned long long v5; v0[0] = &a0[8 + 8]; v1 = v0[1] - v0[0] >> 2; if (v0[0] && v1) { cv_undo(a0); if (!a1 && a0[11] < a0[12]) a0[11] = a0[11] + 4; c_insert(a0, v1, v1); if ((v1 << 2) + a0[11] > a0[12]) { v4 = 6; } else { memcpy(a0[11], v0[0], v1 * 4); v5 = 4; } } if (!v0[0] || !v1) v3 = 6; return; }
int acl_free(void *obj_p) { obj_prefix *int_p = ((obj_prefix *)obj_p)-1; if (!obj_p || !int_p) { (*__errno_location ()) = 22 ; return -1; } switch(int_p->p_magic) { case (0x712C): __acl_free_acl_obj((acl_obj *)int_p); return 0; case (0x1C27): case (0xD5F2): (__free_obj_p((obj_prefix *)(int_p))); return 0; case (0x9D6B): case (0x1ED5): break; default: break; } (*__errno_location ()) = 22 ; return -1; }
long long acl_free(unsigned long a0) { unsigned short *v0; unsigned long long v2; v0 = a0 - 8; if (a0 && v0) { switch (*(v0)) { case 7207: case 54770: __free_obj_p(v0); v2 = 0; return v2; case 7893: case 40299: break; case 28972: __acl_free_acl_obj(v0); v2 = 0; return v2; default: break; } *(__errno_location()) = 22; v2 = 4294967295; return v2; } *(__errno_location()) = 22; v2 = 4294967295; return v2; }
static void print_rcs_hunk (struct change *hunk) { lin i, f0, l0, f1, l1; printint tf0, tl0, tf1, tl1; enum changes changes = analyze_hunk (hunk, &f0, &l0, &f1, &l1); if (!changes) return; begin_output (); translate_range (&files[0], f0, l0, &tf0, &tl0); if (changes & OLD) { fprintf (outfile, "d%""l""d %""l""d\n", tf0, tf0 <= tl0 ? tl0 - tf0 + 1 : 1); } if (changes & NEW) { translate_range (&files[1], f1, l1, &tf1, &tl1); fprintf (outfile, "a%""l""d %""l""d\n", tl0, tf1 <= tl1 ? tl1 - tf1 + 1 : 1); for (i = f1; i <= l1; i++) print_1_line ("", &files[1].linbuf[i]); } }
unsigned long print_rcs_hunk(long a1) { long v1; long v2; int v4; long v5; long v6; long v7; long v8; long v9; long v10; long v11; long v12; long i; unsigned long v14; v14 = __readfsqword(0x28u); v4 = analyze_hunk(a1, &v5, &v6, &v7, &v8); if ( v4 ) { begin_output(); translate_range(files, v5, v6, &v9, &v10); if ( (v4 & 1) != 0 ) { if ( v9 > v10 ) v1 = 1LL; else v1 = v10 - v9 + 1; fprintf(outfile, "d%ld %ld\n", v9, v1); } if ( (v4 & 2) != 0 ) { translate_range(&files[38], v7, v8, &v11, &v12); if ( v11 > v12 ) v2 = 1LL; else v2 = v12 - v11 + 1; fprintf(outfile, "a%ld %ld\n", v10, v2); for ( i = v7; i <= v8; ++i ) print_1_line(&unk_4E7, 8 * i + files[61]); } } return __readfsqword(0x28u) ^ v14; }
static void process_extended_limits(u_int32_t id) { struct sshbuf *msg; int r; uint64_t nfiles = 0; struct rlimit rlim; sshlog("sftp-server.c", __func__, 1526, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "request %u: limits", id); if (getrlimit( RLIMIT_NOFILE , &rlim) != -1 && rlim.rlim_cur > 5) nfiles = rlim.rlim_cur - 5; if ((msg = sshbuf_new()) == ((void *)0) ) sshfatal("sftp-server.c", __func__, 1534, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); if ((r = sshbuf_put_u8(msg, 201)) != 0 || (r = sshbuf_put_u32(msg, id)) != 0 || (r = sshbuf_put_u64(msg, (256 * 1024))) != 0 || (r = sshbuf_put_u64(msg, ((256 * 1024) - 1024))) != 0 || (r = sshbuf_put_u64(msg, (256 * 1024) - 1024)) != 0 || (r = sshbuf_put_u64(msg, nfiles)) != 0) sshfatal("sftp-server.c", __func__, 1545, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose"); send_msg(msg); sshbuf_free(msg); }
long long process_extended_limits(unsigned long a0) { unsigned long v0; unsigned int v1; void* v2; unsigned long long v3; char v4; unsigned long long v5; unsigned long long v7; v2 = 0; v0 = a0; sshlog("sftp-server.c", "process_extended_limits", 0x5f6, 0x0, 0x5, 0x0, "request %u: limits"); if (getrlimit(0x7, &v4) != -1 && *(&v4) > 5) v2 = *(&v4) - 5; v3 = sshbuf_new(); if (!v3) sshfatal("sftp-server.c", "process_extended_limits", 0x5fe, 0x1, 0x1, 0x0); v1 = sshbuf_put_u8(v3, 0xc9); if (v1 || (v1 = sshbuf_put_u32(v3, a0, a0), v1)) { v5 = "compose"; sshfatal("sftp-server.c", "process_extended_limits", 0x609, 0x1, 0x1, ssh_err(v1)); send_msg(v3); sshbuf_free(v3); } else { v1 = sshbuf_put_u64(v3, 0x40000, v7); if (v1) { v5 = "compose"; sshfatal("sftp-server.c", "process_extended_limits", 0x609, 0x1, 0x1, ssh_err(v1)); send_msg(v3); sshbuf_free(v3); } else { v1 = sshbuf_put_u64(v3, 0x3fc00, v7); if (v1) { v5 = "compose"; sshfatal("sftp-server.c", "process_extended_limits", 0x609, 0x1, 0x1, ssh_err(v1)); send_msg(v3); sshbuf_free(v3); } else { v1 = sshbuf_put_u64(v3, 0x3fc00, v7); if (v1) { v5 = "compose"; sshfatal("sftp-server.c", "process_extended_limits", 0x609, 0x1, 0x1, ssh_err(v1)); send_msg(v3); sshbuf_free(v3); } else { v1 = sshbuf_put_u64(v3, v2, v2); if (!v1) { send_msg(v3); sshbuf_free(v3); } else { v5 = "compose"; sshfatal("sftp-server.c", "process_extended_limits", 0x609, 0x1, 0x1, ssh_err(v1)); send_msg(v3); sshbuf_free(v3); } } } } } return 0; }
void e2fsck_pass3(e2fsck_t ctx) { ext2_filsys fs = ctx->fs; struct dir_info_iter *iter = ((void *)0) ; struct resource_track rtrack; struct problem_context pctx; struct dir_info *dir; unsigned long maxdirs, count; init_resource_track(&rtrack, ctx->fs->io); clear_problem_context(&pctx); if (!(ctx->options & 0x0002)) fix_problem(ctx, 0x030000, &pctx); pctx.errcode = e2fsck_allocate_inode_bitmap(fs, (gettext ("inode done bitmap")), 3, "inode_done_map", &inode_done_map); if (pctx.errcode) { pctx.num = 2; fix_problem(ctx, 0x030011, &pctx); ctx->flags |= 0x0001; goto abort_exit; } print_resource_track(ctx, (gettext ("Peak memory")), &ctx->global_rtrack, ((void *)0) ); check_root(ctx); if (ctx->flags & (0x0001 | 0x0002)) goto abort_exit; ext2fs_mark_inode_bitmap2(inode_done_map, 2); maxdirs = e2fsck_get_num_dirinfo(ctx); count = 1; if (ctx->progress) if ((ctx->progress)(ctx, 3, 0, maxdirs)) goto abort_exit; iter = e2fsck_dir_info_iter_begin(ctx); while ((dir = e2fsck_dir_info_iter(ctx, iter)) != 0) { if (ctx->flags & (0x0001 | 0x0002) || ctx->flags & 0x0004) goto abort_exit; if (ctx->progress && (ctx->progress)(ctx, 3, count++, maxdirs)) goto abort_exit; if (ext2fs_test_inode_bitmap2(ctx->inode_dir_map, dir->ino)) if (check_directory(ctx, dir->ino, &pctx)) goto abort_exit; } if ((ctx->options & 0x0001) == 0) e2fsck_get_lost_and_found(ctx, 1); e2fsck_rehash_directories(ctx); abort_exit: if (iter) e2fsck_dir_info_iter_end(ctx, iter); e2fsck_free_dir_info(ctx); if (inode_loop_detect) { ext2fs_free_inode_bitmap(inode_loop_detect); inode_loop_detect = 0; } if (inode_done_map) { ext2fs_free_inode_bitmap(inode_done_map); inode_done_map = 0; } if (ctx->lnf_repair_block) { ext2fs_unmark_block_bitmap2(ctx->block_found_map, ctx->lnf_repair_block); ctx->lnf_repair_block = 0; } if (ctx->root_repair_block) { ext2fs_unmark_block_bitmap2(ctx->block_found_map, ctx->root_repair_block); ctx->root_repair_block = 0; } print_resource_track(ctx, (gettext ("Pass 3")), &rtrack, ctx->fs->io); }
unsigned long e2fsck_pass3(long *a1) { char *v1; char *v2; long i; long v4; long v5; char *v6; long v8; long v9; long v10; long num_dirinfo; unsigned int *v12; char v13[80]; long v14[13]; unsigned long v15; v15 = __readfsqword(0x28u); v10 = *a1; v8 = 0LL; init_resource_track(v13, *(_QWORD *)(*a1 + 8)); clear_problem_context(v14); if ( (*((_DWORD *)a1 + 19) & 2) == 0 ) fix_problem(a1, 196608LL, v14); v1 = gettext("inode done bitmap"); v14[0] = e2fsck_allocate_inode_bitmap(v10, v1, 3LL, "inode_done_map", &inode_done_map); if ( v14[0] ) { v14[10] = 2LL; fix_problem(a1, 196625LL, v14); *((_DWORD *)a1 + 18) |= 1u; } else { v2 = gettext("Peak memory"); print_resource_track(a1, v2, a1 + 80, 0LL); check_root((long)a1); if ( (a1[9] & 3) == 0 ) { ext2fs_mark_inode_bitmap2(inode_done_map, 2LL); num_dirinfo = (int)e2fsck_get_num_dirinfo(a1); v9 = 1LL; if ( !a1[44] || !((unsigned int ( *)(long *, long, _QWORD, long))a1[44])(a1, 3LL, 0LL, num_dirinfo) ) { v8 = e2fsck_dir_info_iter_begin(a1); for ( i = e2fsck_dir_info_iter(a1, v8); ; i = e2fsck_dir_info_iter(a1, v8) ) { v12 = (unsigned int *)i; if ( !i ) break; if ( (a1[9] & 3) != 0 ) goto LABEL_20; if ( (a1[9] & 4) != 0 ) goto LABEL_20; if ( a1[44] ) { v4 = v9++; if ( ((unsigned int ( *)(long *, long, long, long))a1[44])(a1, 3LL, v4, num_dirinfo) ) goto LABEL_20; } if ( (unsigned int)ext2fs_test_inode_bitmap2(a1[47], *v12) && (unsigned int)check_directory((unsigned int *)a1, *v12, (long)v14) ) { goto LABEL_20; } } if ( (*((_DWORD *)a1 + 19) & 1) == 0 ) e2fsck_get_lost_and_found((unsigned int *)a1, 1); e2fsck_rehash_directories(a1); } } } LABEL_20: if ( v8 ) e2fsck_dir_info_iter_end(a1, v8); e2fsck_free_dir_info(a1); if ( inode_loop_detect ) { ext2fs_free_inode_bitmap(inode_loop_detect); inode_loop_detect = 0LL; } if ( inode_done_map ) { ext2fs_free_inode_bitmap(inode_done_map); inode_done_map = 0LL; } if ( a1[112] ) { ext2fs_unmark_block_bitmap2(a1[52], a1[112]); a1[112] = 0LL; } if ( a1[111] ) { ext2fs_unmark_block_bitmap2(a1[52], a1[111]); a1[111] = 0LL; } v5 = *(_QWORD *)(*a1 + 8); v6 = gettext("Pass 3"); print_resource_track(a1, v6, v13, v5); return __readfsqword(0x28u) ^ v15; }
static inline void emit_ancillary_info (char const *program) { struct infomap { char const *program; char const *node; } const infomap[] = { { "[", "test invocation" }, { "coreutils", "Multi-call invocation" }, { "sha224sum", "sha2 utilities" }, { "sha256sum", "sha2 utilities" }, { "sha384sum", "sha2 utilities" }, { "sha512sum", "sha2 utilities" }, { ((void *)0) , ((void *)0) } }; char const *node = program; struct infomap const *map_prog = infomap; while (map_prog->program && ! (strcmp (program, map_prog->program) == 0)) map_prog++; if (map_prog->node) node = map_prog->node; printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https: char const *lc_messages = setlocale ( 5 , ((void *)0) ); if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1)) { fputs_unlocked (gettext ("Report any translation bugs to " "<https: stdout ) ; } char const *url_program = (strcmp (program, "[") == 0) ? "test" : program; printf (gettext ("Full documentation <%s%s>\n"), "https: printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"), node, node == program ? " invocation" : ""); }
void emit_ancillary_info(char *param_1) { FILE *__stream; int iVar1; char *pcVar2; char *pcVar3; long in_FS_OFFSET; char *local_b8; char **local_b0; char *local_98; char *local_90; char *local_88; char *local_80; char *local_78; char *local_70; char *local_68; char *local_60; char *local_58; char *local_50; char *local_48; char *local_40; undefined8 local_38; undefined8 local_30; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_98 = "["; local_90 = "test invocation"; local_88 = "coreutils"; local_80 = "Multi-call invocation"; local_78 = "sha224sum"; local_70 = "sha2 utilities"; local_68 = "sha256sum"; local_60 = "sha2 utilities"; local_58 = "sha384sum"; local_50 = "sha2 utilities"; local_48 = "sha512sum"; local_40 = "sha2 utilities"; local_38 = 0; local_30 = 0; local_b0 = &local_98; while ((*local_b0 != (char *)0x0 && (iVar1 = strcmp(param_1,*local_b0), iVar1 != 0))) { local_b0 = local_b0 + 2; } local_b8 = param_1; if (local_b0[1] != (char *)0x0) { local_b8 = local_b0[1]; } pcVar2 = (char *)gettext("\n%s online help: <%s>\n"); printf(pcVar2,"GNU coreutils","https: pcVar2 = setlocale(5,(char *)0x0); if ((pcVar2 != (char *)0x0) && (iVar1 = strncmp(pcVar2,"en_",3), __stream = stdout, iVar1 != 0)) { pcVar2 = (char *)gettext( "Report any translation bugs to <https: ); fputs_unlocked(pcVar2,__stream); } iVar1 = strcmp(param_1,"["); pcVar2 = param_1; if (iVar1 == 0) { pcVar2 = "test"; } pcVar3 = (char *)gettext("Full documentation <%s%s>\n"); printf(pcVar3,"https: if (local_b8 == param_1) { pcVar2 = " invocation"; } else { pcVar2 = ""; } pcVar3 = (char *)gettext("or available locally via: info \'(coreutils) %s%s\'\n"); printf(pcVar3,local_b8,pcVar2); if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
static int ipstats_show_hw64(const struct rtattr *at) { struct rtnl_hw_stats64 stats; do { const struct rtattr *__at = (at); size_t __at_sz = __at->rta_len - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)); size_t __var_sz = sizeof(stats); typeof(stats) *__dest = &stats; memset(__dest, 0, __var_sz); memcpy(__dest, ((void*)(((char*)(__at)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((( __at_sz )<( __var_sz ))?( __at_sz ):( __var_sz )) ); } while (0); print_hw_stats64( stdout , &stats); return 0; }
undefined8 ipstats_show_hw64(ushort *param_1) { size_t __n; long in_FS_OFFSET; undefined local_58 [72]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); __n = (ulong)*param_1 - 4; memset(local_58,0,0x48); if (0x47 < __n) { __n = 0x48; } memcpy(local_58,param_1 + 2,__n); print_hw_stats64(stdout,local_58); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return 0; }
void namebuf_free (namebuf_t buf) { free (buf->buffer); free (buf); }
void namebuf_free(void **param_1) { free(*param_1); free(param_1); return; }
static void print_priority_list(void) { unsigned int idx; const char *str; unsigned int lineb = 0; log_msg( stdout , "Priority strings in GnuTLS %s:\n", gnutls_check_version( ((void *)0) )); fputs("\t", stdout ); for (idx=0;;idx++) { str = gnutls_priority_string_list(idx, 1); if (str == ((void *)0) ) break; lineb += log_msg( stdout , "%s ", str); if (lineb > 64) { lineb = 0; log_msg( stdout , "\n\t"); } } log_msg( stdout , "\n\nSpecial strings:\n"); lineb = 0; fputs("\t", stdout ); for (idx=0;;idx++) { str = gnutls_priority_string_list(idx, 2); if (str == ((void *)0) ) break; if (str[0] == 0) continue; lineb += log_msg( stdout , "%%%s ", str); if (lineb > 64) { lineb = 0; log_msg( stdout , "\n\t"); } } log_msg( stdout , "\n"); return; }
void print_priority_list() { unsigned int v0; unsigned int v1; unsigned long long v2; unsigned long long v4; unsigned long long v5; v1 = 0; log_msg(stdout, "Priority strings in GnuTLS %s:\n", gnutls_check_version(0x0)); fputs("\t", stdout); v0 = 0; while (true) { v2 = gnutls_priority_string_list(v0, 0x1); if (!v2) break; v1 += log_msg(stdout, "%s ", v2); if (v1 > 64) { v1 = 0; log_msg(stdout, "\n\t", v4); } v0 += 1; } log_msg(stdout, "\n\nSpecial strings:\n", v4); v1 = 0; fputs("\t", stdout); v0 = 0; while (true) { v2 = gnutls_priority_string_list(v0, 0x2); if (!v2) break; if (*(v2)) { v1 += log_msg(stdout, "%%%s ", v2); if (v1 > 64) { v1 = 0; log_msg(stdout, "\n\t", v4); } } v0 += 1; } v5 = log_msg(stdout, "\n", v4); return; }
"nh4 %s ", rt_addr_n2a( 2 , ((int)((tb[SEG6_LOCAL_NH4])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), ((void*)(((char*)(tb[SEG6_LOCAL_NH4])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))))); } if (tb[SEG6_LOCAL_NH6]) { print_string(PRINT_ANY, "nh6", "nh6 %s ", rt_addr_n2a( 10 , ((int)((tb[SEG6_LOCAL_NH6])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), ((void*)(((char*)(tb[SEG6_LOCAL_NH6])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))))); }
void rt_addr_n2a(void) { halt_baddata(); }
static inline _Bool ignorable (int err) { return filter_command && err == 32 ; }
int ignorable(unsigned long a0) { unsigned int v1; unsigned int v2; if (!filter_command || a0 != 32) v1 = 0; else v1 = 1; v2 = v1 & 1; return v2; }
static int post_client_hello(gnutls_session_t session) { int ret; char *name; size_t len = 256; unsigned int type; int i; name = malloc(len); if (name == ((void *)0) ) return -25; for (i=0; ; ) { ret = gnutls_server_name_get(session, name, &len, &type, i); if (ret == -51) { char *new_name; new_name = realloc(name, len); if (new_name == ((void *)0) ) { ret = -25; goto end; } name = new_name; continue; } if (ret == -56) break; i++; if (ret != 0) goto end; if (type != GNUTLS_NAME_DNS) continue; if (strlen(sni_hostname) != len) continue; if (!strncmp(name, sni_hostname, len)) { ret = 0; goto end; } }; if (i == 0) { fprintf( stderr , "Warning: client did not include SNI extension, using default host\n"); ret = 0; goto end; } if (sni_hostname_fatal == 1) { ret = -294; goto end; } fprintf( stderr , "Warning: client provided unrecognized host name\n"); do { ret = gnutls_alert_send(session, GNUTLS_AL_WARNING, GNUTLS_A_UNRECOGNIZED_NAME); } while (ret == -28 || ret == -52); end: free(name); return ret; }
long long post_client_hello(unsigned long long a0) { char v0; unsigned int v1; unsigned int v2; unsigned long long v3; void* v4; unsigned long v5; unsigned long long v7; v3 = 0x100; v4 = malloc(v3); if (!v4) { v7 = 4294967271; } else { v2 = 0; do { v1 = gnutls_server_name_get(a0, v4, &v3, &v0, v2); if (v1 == -51) { v5 = realloc(v4, v3); if (v5) { v4 = v5; goto LABEL_40058d; } else { v1 = -25; goto LABEL_400614; } } if (v1 == -56) { if (!v2) { fprintf(*(&stderr), "Warning: client did not include SNI extension, using default host\n"); v1 = 0; goto LABEL_400614; } else if (sni_hostname_fatal == 1) { v1 = -294; goto LABEL_400614; } else { fprintf(*(&stderr), "Warning: client provided unrecognized host name\n"); while (true) { v1 = gnutls_alert_send(a0, 0x1, 0x70); if (v1 == -28) continue; if (v1 != -52) break; } } } v2 += 1; if (v1) goto LABEL_400614; if (!(*(&v0) == 1)) continue; if (strlen(sni_hostname) != v3) { LABEL_40058d: continue; } } while (strncmp(v4, sni_hostname, v3)); v1 = 0; LABEL_400614: free(v4); v7 = v1; } return v7; }
void crypto_sign_ed25519_ref_pack(unsigned char r[32], const crypto_sign_ed25519_ref_ge25519 *p) { crypto_sign_ed25519_ref_fe25519 tx, ty, zi; crypto_sign_ed25519_ref_fe25519_invert(&zi, &p->z); crypto_sign_ed25519_ref_fe25519_mul(&tx, &p->x, &zi); crypto_sign_ed25519_ref_fe25519_mul(&ty, &p->y, &zi); crypto_sign_ed25519_ref_fe25519_pack(r, &ty); r[31] ^= crypto_sign_ed25519_ref_fe25519_getparity(&tx) << 7; }
long long crypto_sign_ed25519_ref_pack(struct_0 *a0, unsigned long long a1) { char v0; char v1; char v2; crypto_sign_ed25519_ref_fe25519_invert(&v2, a1 + 0x100, a1 + 0x100); crypto_sign_ed25519_ref_fe25519_mul(&v0, a1, &v2, a1); crypto_sign_ed25519_ref_fe25519_mul(&v1, a1 + 128, &v2, a1 + 128); crypto_sign_ed25519_ref_fe25519_pack(a0, &v1, &v1); a0->field_1f = a0->field_1f ^ (crypto_sign_ed25519_ref_fe25519_getparity(&v0) * 128); return 0; }
static __inline__ void list_add(struct list_head *new, struct list_head *head) { __list_add(new, head, head->next); }
_QWORD * list_add(_QWORD *a1, long *a2) { return _list_add(a1, a2, *a2); }
int mm_answer_moduli(struct ssh *ssh, int sock, struct sshbuf *m) { DH *dh; const BIGNUM *dh_p, *dh_g; int r; u_int min, want, max; if ((r = sshbuf_get_u32(m, &min)) != 0 || (r = sshbuf_get_u32(m, &want)) != 0 || (r = sshbuf_get_u32(m, &max)) != 0) sshfatal("monitor.c", __func__, 576, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); sshlog("monitor.c", __func__, 578, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "got parameters: %d %d %d", min, want, max); if (max < min || want < min || max < want) sshfatal("monitor.c", __func__, 581, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "bad parameters: %d %d %d", min, want, max); sshbuf_reset(m); dh = choose_dh(min, want, max); if (dh == ((void *)0) ) { if ((r = sshbuf_put_u8(m, 0)) != 0) sshfatal("monitor.c", __func__, 588, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble empty"); return (0); } else { DH_get0_pqg(dh, &dh_p, ((void *)0) , &dh_g); if ((r = sshbuf_put_u8(m, 1)) != 0 || (r = sshbuf_put_bignum2(m, dh_p)) != 0 || (r = sshbuf_put_bignum2(m, dh_g)) != 0) sshfatal("monitor.c", __func__, 596, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble"); DH_free(dh); } mm_request_send(sock, MONITOR_ANS_MODULI, m); return (0); }
long long mm_answer_moduli(unsigned long a0, unsigned long a1, unsigned long long a2) { unsigned long v0; char v1; char v2; char v3; unsigned int v4; char v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long v9; char v10; v0 = a0; v4 = sshbuf_get_u32(a2, &v1, &v1); if (!v4) { v4 = sshbuf_get_u32(a2, &v2, &v2); if (!v4) v4 = sshbuf_get_u32(a2, &v3, &v3); } if (v4 || v4 || v4) sshfatal("monitor.c", "mm_answer_moduli", 0x240, 0x1, 0x1, ssh_err(v4), "parse"); v9 = *(&v3); v8 = *(&v2); v7 = *(&v1); v6 = "got parameters: %d %d %d"; sshlog("monitor.c", "mm_answer_moduli", 0x242, 0x1, 0x7, 0x0); if (*(&v2) < *(&v1) || *(&v3) < *(&v1) || *(&v3) < *(&v2)) { v9 = *(&v3); v8 = *(&v2); v7 = *(&v1); v6 = "bad parameters: %d %d %d"; sshfatal("monitor.c", "mm_answer_moduli", 0x245, 0x1, 0x1, 0x0, *(&v10)); } sshbuf_reset(a2); v7 = choose_dh(*(&v1), *(&v2), *(&v3), *(&v2)); if (!v7) { v4 = sshbuf_put_u8(a2, 0x0); if (v4) { v8 = "assemble empty"; sshfatal("monitor.c", "mm_answer_moduli", 0x24c, 0x1, 0x1, ssh_err(v4), *(&v10)); } } else { DH_get0_pqg(v7, &v5, 0x0, &v6); v4 = sshbuf_put_u8(a2, 0x1); if (!v4) { v4 = sshbuf_put_bignum2(a2, *(&v5), *(&v5)); if (!v4) v4 = sshbuf_put_bignum2(a2, v6, v6); } if (v4 || v4 || v4) { v8 = "assemble"; sshfatal("monitor.c", "mm_answer_moduli", 0x254, 0x1, 0x1, ssh_err(v4), *(&v10)); } DH_free(v7); mm_request_send(a1, 0x1, a2); } return 0; }
static int parse_dest_constraint_hop(struct sshbuf *b, struct dest_constraint_hop *dch) { u_char key_is_ca; size_t elen = 0; int r; struct sshkey *k = ((void *)0) ; char *fp; memset(dch, '\0', sizeof(*dch)); if ((r = sshbuf_get_cstring(b, &dch->user, ((void *)0) )) != 0 || (r = sshbuf_get_cstring(b, &dch->hostname, ((void *)0) )) != 0 || (r = sshbuf_get_string_direct(b, ((void *)0) , &elen)) != 0) { sshlog("ssh-agent.c", __func__, 967, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "parse"); goto out; } if (elen != 0) { sshlog("ssh-agent.c", __func__, 971, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "unsupported extensions (len %zu)", elen); r = -59; goto out; } if (*dch->hostname == '\0') { free(dch->hostname); dch->hostname = ((void *)0) ; } if (*dch->user == '\0') { free(dch->user); dch->user = ((void *)0) ; } while (sshbuf_len(b) != 0) { dch->keys = xrecallocarray(dch->keys, dch->nkeys, dch->nkeys + 1, sizeof(*dch->keys)); dch->key_is_ca = xrecallocarray(dch->key_is_ca, dch->nkeys, dch->nkeys + 1, sizeof(*dch->key_is_ca)); if ((r = sshkey_froms(b, &k)) != 0 || (r = sshbuf_get_u8(b, &key_is_ca)) != 0) goto out; if ((fp = sshkey_fingerprint(k, 2, SSH_FP_DEFAULT)) == ((void *)0) ) sshfatal("ssh-agent.c", __func__, 993, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "fingerprint failed"); sshlog("ssh-agent.c", __func__, 994, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "%s%s%s: adding %skey %s %s", dch->user == ((void *)0) ? "" : dch->user, dch->user == ((void *)0) ? "" : "@", dch->hostname, key_is_ca ? "CA " : "", sshkey_type(k), fp) ; free(fp); dch->keys[dch->nkeys] = k; dch->key_is_ca[dch->nkeys] = key_is_ca != 0; dch->nkeys++; k = ((void *)0) ; } r = 0; out: sshkey_free(k); return r; }
int parse_dest_constraint_hop(unsigned long long a0, void* a1) { char v0; struct_0 *v1; unsigned long long v2; char v3; unsigned long v4; char v5; unsigned int v6; char *v7; void* v8; void* v9; unsigned long v10; char v11; unsigned long long v12; char v13; char v14; char v15; void* v16; unsigned long v17; unsigned long v18; v2 = a0; v1 = a1; v7 = 0; v8 = 0; memset(v1, 0x0, 0x28); v6 = sshbuf_get_cstring(v2, v1, 0x0, v1); if (v6) { sshlog("ssh-agent.c", "parse_dest_constraint_hop", 0x3c7, 0x1, 0x2, ssh_err(v6), "parse", *(&v0), a1, a0, *(&v3)); } else { v6 = sshbuf_get_cstring(v2, &v1->field_8, 0x0, &v1->field_8); if (v6) { sshlog("ssh-agent.c", "parse_dest_constraint_hop", 0x3c7, 0x1, 0x2, ssh_err(v6), "parse", *(&v0), a1, a0, *(&v3)); } else { v6 = sshbuf_get_string_direct(v2, 0x0, &v7); if (v6) { sshlog("ssh-agent.c", "parse_dest_constraint_hop", 0x3c7, 0x1, 0x2, ssh_err(v6), "parse", *(&v0), a1, a0, *(&v3)); } else if (v7) { sshlog("ssh-agent.c", "parse_dest_constraint_hop", 0x3cb, 0x1, 0x2, 0x0, "unsupported extensions (len %zu)", v7, a1, a0, *(&v3)); v6 = -59; } else { if (!v1->field_8->field_0) { free(v1->field_8); v1->field_8 = 0; } if (!v1->field_0->field_0) { free(v1->field_0); v1->field_0 = 0; } while (true) { if (!sshbuf_len(v2)) { v6 = 0; break; } else { v1->field_18 = xrecallocarray(v1->field_18, v1->field_14, v1->field_14 + 1, 0x8); v1->field_20 = xrecallocarray(v1->field_20, v1->field_14, v1->field_14 + 1, 0x4); v6 = sshkey_froms(v2, &v8, &v8); if (!(v6) && !((v6 = sshbuf_get_u8(v2, &v5, &v5), v6))) { v9 = sshkey_fingerprint(v8, 0x2, 0x0); if (!v9) { v10 = "fingerprint failed"; sshfatal("ssh-agent.c", "parse_dest_constraint_hop", 0x3e1, 0x1, 0x1, 0x0); } v16 = sshkey_type(v8); v17 = (!v5 ? "CA " : &g_407fb9); v18 = (!v1->field_0 ? "@" : &g_407fb9); v10 = v9; v9 = v16; v8 = v17; v7 = &v1->field_8->field_0; v4 = v18; v2 = "%s%s%s: adding %skey %s %s"; sshlog("ssh-agent.c", "parse_dest_constraint_hop", 0x3e2, 0x1, 0x7, 0x0, *(&v11), v12, *(&v13), *(&v14), *(&v15)); free(v9); *((v1->field_18 + v1->field_14 * 8)) = v8; *((v1->field_20 + v1->field_14 * 4)) = *(&v4 + 3); v1->field_14 = v1->field_14 + 1; v8 = 0; } else { break; } } } } } } sshkey_free(v8); return v6; }
void reset_shell_flags () { mark_modified_vars = disallow_filename_globbing = 0; place_keywords_in_env = read_but_dont_execute = just_one_command = 0; noclobber = unbound_vars_is_error = 0; echo_command_at_execute = jobs_m_flag = forced_interactive = 0; no_symbolic_links = 0; privileged_mode = pipefail_opt = 0; error_trace_mode = function_trace_mode = 0; exit_immediately_on_error = errexit_flag = 0; echo_input_at_read = verbose_flag = 0; hashing_enabled = interactive_comments = 1; asynchronous_notification = 0; histexp_flag = 0; brace_expansion = 1; restricted = 0; }
long long reset_shell_flags() { disallow_filename_globbing = 0; mark_modified_vars = disallow_filename_globbing; just_one_command = 0; read_but_dont_execute = just_one_command; place_keywords_in_env = read_but_dont_execute; unbound_vars_is_error = 0; noclobber = unbound_vars_is_error; forced_interactive = 0; jobs_m_flag = forced_interactive; echo_command_at_execute = jobs_m_flag; no_symbolic_links = 0; pipefail_opt = 0; privileged_mode = pipefail_opt; function_trace_mode = 0; error_trace_mode = function_trace_mode; errexit_flag = 0; exit_immediately_on_error = errexit_flag; verbose_flag = 0; echo_input_at_read = verbose_flag; interactive_comments = 1; hashing_enabled = interactive_comments; asynchronous_notification = 0; histexp_flag = 0; brace_expansion = 1; restricted = 0; return interactive_comments; }
void print_assoc_assignment (var, quoted) SHELL_VAR *var; int quoted; { char *vstr; vstr = assoc_to_assign ((HASH_TABLE *)((var)->value), quoted); if (vstr == 0) printf ("%s=%s\n", var->name, quoted ? "'()'" : "()"); else { printf ("%s=%s\n", var->name, vstr); sh_xfree((vstr), "arrayfunc.c", 1245); } }
long long print_assoc_assignment(unsigned long long a0[2], unsigned long a1) { unsigned long long v0; unsigned int v2; unsigned long long v3; v0 = assoc_to_assign(a0[1], a1, a1); if (v0) { printf("%s=%s\n", a0[0], v0); v3 = sh_xfree(v0, "arrayfunc.c", 0x4dd); return v3; } if (!a1) v2 = &g_403b2a; else v2 = "'()'"; v3 = printf("%s=%s\n", a0[0], v2); return v3; }
static int extmatch_wc (xc, s, se, p, pe, flags) wint_t xc; wchar_t *s, *se; wchar_t *p, *pe; int flags; { wchar_t *prest; wchar_t *psub; wchar_t *pnext; wchar_t *srest; int m1, m2, xflags; prest = glob_patscan_wc (p + (*p == L'('), pe, 0); if (prest == 0) return (wscompare (p - 1, pe, s, se)); switch (xc) { case L'+': case L'*': if (xc == L'*' && (gmatch_wc (s, se, prest, pe, ((void *)0) , flags) == 0)) return 0; for (psub = p + 1; ; psub = pnext) { pnext = glob_patscan_wc (psub, pe, L'|'); for (srest = s; srest <= se; srest++) { m1 = gmatch_wc (s, srest, psub, pnext - 1, ((void *)0) , flags) == 0; if (m1) { xflags = (srest > s) ? (flags & ~((1 << 2)|(1 << 7))) : flags; m2 = (gmatch_wc (srest, se, prest, pe, ((void *)0) , xflags) == 0) || (s != srest && gmatch_wc (srest, se, p - 1, pe, ((void *)0) , xflags) == 0); } if (m1 && m2) return (0); } if (pnext == prest) break; } return (1); case L'?': case L'@': if (xc == L'?' && (gmatch_wc (s, se, prest, pe, ((void *)0) , flags) == 0)) return 0; for (psub = p + 1; ; psub = pnext) { pnext = glob_patscan_wc (psub, pe, L'|'); srest = (prest == pe) ? se : s; for ( ; srest <= se; srest++) { xflags = (srest > s) ? (flags & ~((1 << 2)|(1 << 7))) : flags; if (gmatch_wc (s, srest, psub, pnext - 1, ((void *)0) , flags) == 0 && gmatch_wc (srest, se, prest, pe, ((void *)0) , xflags) == 0) return (0); } if (pnext == prest) break; } return (1); case '!': for (srest = s; srest <= se; srest++) { m1 = 0; for (psub = p + 1; ; psub = pnext) { pnext = glob_patscan_wc (psub, pe, L'|'); if (m1 = (gmatch_wc (s, srest, psub, pnext - 1, ((void *)0) , flags) == 0)) break; if (pnext == prest) break; } if (m1 == 0 && (flags & (1 << 2)) && *s == '.') return (1); if (m1 == 0 && (flags & (1 << 7)) && ((s[0] == L'.' && (s[1] == L'\0' || (s[1] == L'.' && s[2] == L'\0'))) || ((flags & (1 << 0)) && s[-1] == L'/' && (s[0] == L'.' && ((((s[1]) == L'/') || (s[1]) == L'\0') || (s[1] == L'.' && (((s[2]) == L'/') || (s[2]) == L'\0'))))))) return (1); xflags = (srest > s) ? (flags & ~((1 << 2)|(1 << 7))) : flags; if (m1 == 0 && gmatch_wc (srest, se, prest, pe, ((void *)0) , xflags) == 0) return (0); } return (1); } return (1); }
undefined8 extmatch_wc(uint param_1,int *param_2,int *param_3,int *param_4,int *param_5,uint param_6) { int iVar1; uint uVar2; int iVar3; int *piVar4; undefined8 uVar5; int *piVar6; long lVar7; bool bVar8; int local_34; int *local_28; int *local_20; if (*param_4 == 0x28) { lVar7 = 4; } else { lVar7 = 0; } piVar4 = (int *)glob_patscan_wc(lVar7 + (long)param_4,param_5,0); if (piVar4 == (int *)0x0) { uVar5 = wscompare(param_4 + -1,param_5,param_2,param_3); return uVar5; } if (param_1 < 0x41) { if (0x3e < param_1) { if ((param_1 == 0x3f) && (iVar1 = gmatch_wc(param_2,param_3,piVar4,param_5,0,param_6), iVar1 == 0)) { return 0; } local_28 = param_4 + 1; do { piVar6 = (int *)glob_patscan_wc(local_28,param_5,0x7c); local_20 = param_2; if (piVar4 == param_5) { local_20 = param_3; } for (; local_20 <= param_3; local_20 = local_20 + 1) { uVar2 = param_6; if (param_2 < local_20) { uVar2 = param_6 & 0xffffff7b; } iVar1 = gmatch_wc(param_2,local_20,local_28,piVar6 + -1,0,param_6); if ((iVar1 == 0) && (iVar1 = gmatch_wc(local_20,param_3,piVar4,param_5,0,uVar2), iVar1 == 0)) { return 0; } } local_28 = piVar6; if (piVar6 == piVar4) { return 1; } } while( true ); } local_20 = param_2; if (param_1 == 0x21) { do { if (param_3 < local_20) { return 1; } local_28 = param_4 + 1; do { piVar6 = (int *)glob_patscan_wc(local_28,param_5,0x7c); iVar1 = gmatch_wc(param_2,local_20,local_28,piVar6 + -1,0,param_6); bVar8 = iVar1 == 0; if (bVar8) break; local_28 = piVar6; } while (piVar6 != piVar4); if (((!bVar8) && ((param_6 & 4) != 0)) && (*param_2 == 0x2e)) { return 1; } if (((!bVar8) && ((param_6 & 0x80) != 0)) && (((*param_2 == 0x2e && ((param_2[1] == 0 || ((param_2[1] == 0x2e && (param_2[2] == 0))))) ) || ((((param_6 & 1) != 0 && ((param_2[-1] == 0x2f && (*param_2 == 0x2e)))) && (((param_2[1] == 0x2f || (param_2[1] == 0)) || ((param_2[1] == 0x2e && ((param_2[2] == 0x2f || (param_2[2] == 0)))))))))))) { return 1; } uVar2 = param_6; if (param_2 < local_20) { uVar2 = param_6 & 0xffffff7b; } if ((!bVar8) && (iVar1 = gmatch_wc(local_20,param_3,piVar4,param_5,0,uVar2), iVar1 == 0)) { return 0; } local_20 = local_20 + 1; } while( true ); } if ((0x20 < param_1) && (param_1 - 0x2a < 2)) { if ((param_1 == 0x2a) && (iVar1 = gmatch_wc(param_2,param_3,piVar4,param_5,0,param_6), iVar1 == 0)) { return 0; } local_28 = param_4 + 1; do { piVar6 = (int *)glob_patscan_wc(local_28,param_5,0x7c); for (local_20 = param_2; local_20 <= param_3; local_20 = local_20 + 1) { iVar1 = gmatch_wc(param_2,local_20,local_28,piVar6 + -1,0,param_6); if (iVar1 == 0) { uVar2 = param_6; if (param_2 < local_20) { uVar2 = param_6 & 0xffffff7b; } iVar3 = gmatch_wc(local_20,param_3,piVar4,param_5,0,uVar2); if ((iVar3 == 0) || ((param_2 != local_20 && (iVar3 = gmatch_wc(local_20,param_3,param_4 + -1,param_5,0,uVar2), iVar3 == 0)))) { local_34 = 1; } else { local_34 = 0; } } if ((iVar1 == 0) && (local_34 != 0)) { return 0; } } local_28 = piVar6; if (piVar6 == piVar4) { return 1; } } while( true ); } } return 1; }
char * string_list_dollar_at (list, quoted, flags) WORD_LIST *list; int quoted; int flags; { char *ifs, *ret; char sep[ (__ctype_get_mb_cur_max ()) + 1]; WORD_LIST *tlist; ifs = ifs_var ? ((ifs_var)->value) : (char *)0; if (flags & 0x08) { sep[0] = ' '; sep[1] = '\0'; } else if (ifs && *ifs) { if (ifs_firstc_len == 1) { sep[0] = ifs_firstc[0]; sep[1] = '\0'; } else { memcpy (sep, ifs_firstc, ifs_firstc_len); sep[ifs_firstc_len] = '\0'; } } else { sep[0] = ' '; sep[1] = '\0'; } tlist = (quoted & (0x002|0x001|0x008)) ? quote_list (list) : list_quote_escapes (list); ret = string_list_internal (tlist, sep); return ret; }
undefined8 string_list_dollar_at(undefined8 param_1,uint param_2,uint param_3) { long lVar1; undefined *puVar2; ulong uVar3; undefined8 uVar4; uint *puVar5; long in_FS_OFFSET; uint local_78; uint local_74; undefined8 local_70; size_t local_68; undefined *local_60; char *local_58; undefined8 local_50; undefined8 local_48; long local_40; local_40 = *(long *)(in_FS_OFFSET + 0x28); local_78 = param_3; local_74 = param_2; local_70 = param_1; local_68 = __ctype_get_mb_cur_max(); uVar3 = ((local_68 + 0x10) / 0x10) * 0x10; for (puVar5 = &local_78; puVar5 != (uint *)((long)&local_78 - (uVar3 & 0xfffffffffffff000)); puVar5 = (uint *)((long)puVar5 + -0x1000)) { *(undefined8 *)((long)puVar5 + -8) = *(undefined8 *)((long)puVar5 + -8); } lVar1 = -(ulong)((uint)uVar3 & 0xfff); if ((uVar3 & 0xfff) != 0) { *(undefined8 *)((long)puVar5 + ((ulong)((uint)uVar3 & 0xfff) - 8) + lVar1) = *(undefined8 *)((long)puVar5 + ((ulong)((uint)uVar3 & 0xfff) - 8) + lVar1); } local_60 = (undefined *)((long)puVar5 + lVar1); if (ifs_var == 0) { local_58 = (char *)0x0; } else { local_58 = *(char **)(ifs_var + 8); } if ((local_78 & 8) == 0) { if ((local_58 == (char *)0x0) || (*local_58 == '\0')) { *(undefined *)((long)puVar5 + lVar1) = 0x20; local_60[1] = 0; } else if (ifs_firstc_len == 1) { *(undefined *)((long)puVar5 + lVar1) = ifs_firstc[0]; local_60[1] = 0; } else { *(undefined8 *)((long)puVar5 + lVar1 + -8) = 0x10751b; memcpy((undefined *)((long)puVar5 + lVar1),ifs_firstc,ifs_firstc_len); local_60[ifs_firstc_len] = 0; } } else { *(undefined *)((long)puVar5 + lVar1) = 0x20; local_60[1] = 0; } uVar4 = local_70; if ((local_74 & 0xb) == 0) { *(undefined8 *)((long)puVar5 + lVar1 + -8) = 0x10755f; uVar4 = list_quote_escapes(uVar4); } else { *(undefined8 *)((long)puVar5 + lVar1 + -8) = 0x107551; uVar4 = quote_list(uVar4); } puVar2 = local_60; local_50 = uVar4; *(undefined8 *)((long)puVar5 + lVar1 + -8) = 0x107576; local_48 = string_list_internal(uVar4,puVar2); if (local_40 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return local_48; }
static void do_authenticated2(struct ssh *ssh, Authctxt *authctxt) { server_loop2(ssh, authctxt); }
void do_authenticated2(undefined8 param_1,undefined8 param_2) { server_loop2(param_1,param_2); return; }
void sort_variables (array) SHELL_VAR **array; { qsort (array, strvec_len ((char **)array), sizeof (SHELL_VAR *), (QSFUNC *)qsort_var_comp); }
void sort_variables(unsigned long long a0) { unsigned long long v1; v1 = qsort(a0, strvec_len(a0), 0x8, qsort_var_comp); return; }
const char *get_pass(void) { if (batch && !ask_pass) return cfg.password; else return getpass("Enter password: "); }
long long get_pass() { unsigned long long v1; if (*(got.batch) && !*(got.ask_pass)) v1 = *((got.cfg + 464)); if (!*(got.batch) || *(got.ask_pass)) v1 = getpass("Enter password: "); return v1; }
static int history_load(HistoryW *h, const char *fname) { FILE *fp; char *line; size_t llen; ssize_t sz; size_t max_size; char *ptr; int i = -1; HistEventW ev; wchar_t *decode_result; static ct_buffer_t conv; if ((fp = fopen(fname, "r")) == ((void *)0) ) return i; line = ((void *)0) ; llen = 0; if ((sz = getline(&line, &llen, fp)) == -1) goto done; if (strncmp(line, hist_cookie, (size_t)sz) != 0) goto done; ptr = malloc((max_size = 1024) * sizeof(*ptr)); if (ptr == ((void *)0) ) goto done; for (i = 0; (sz = getline(&line, &llen, fp)) != -1; i++) { if (sz > 0 && line[sz - 1] == '\n') line[--sz] = '\0'; if (max_size < (size_t)sz) { char *nptr; max_size = ((size_t)sz + 1024) & (size_t)~1023; nptr = realloc((ptr), (max_size * sizeof(*ptr))); if (nptr == ((void *)0) ) { i = -1; goto oomem; } ptr = nptr; } (void) strunvis(ptr, line); decode_result = ct_decode_string(ptr, &conv); if (decode_result == ((void *)0) ) continue; if ((*(h)->h_enter)((h)->h_ref, &ev, decode_result) == -1) { i = -1; goto oomem; } } oomem: free(ptr); done: free(line); (void) fclose(fp); return i; }
int history_load(unsigned long long a0[11], char *a1) { unsigned int v0; void* v1; void* v2; void* v3; unsigned long long v4; void* v5; void* v6; void* v7; unsigned long long v8; char v9; unsigned int v11; v0 = -1; v6 = fopen(a1, "r"); if (!v6) { v11 = v0; } else { v1 = 0; v2 = 0; *(&v3) = getline(&v1, &v2, v6); if (*(&v3) != -1) { v11 = strncmp(v1, "_HiStOrY_V2_\n", *(&v3)); if (!v11) { v4 = 0x400; v5 = malloc(0x400); if (v5) { v0 = 0; while (true) { v3 = getline(&v1, &v2, v6); if (v3 == -1) break; if (v3 > 0 && *((v1 + v3 - 1)) == 10) { v3 -= 1; *((v3 + v1)) = 0; } if (v4 < v3) { *(&v4) = v3 + 0x400 & -0x400; v7 = realloc(v5, *(&v4)); if (!v7) { v0 = -1; break; } else { v5 = v7; } } if (v4 >= v3 || v7) { strunvis(v5, v1, v1); v8 = ct_decode_string(v5, &conv.4127); if (v8) { v11 = a0[10](a0[0], &v9, v8, &v9, a0[10]); if (v11 == -1) { v0 = -1; break; } } if (!v8 || v11 != -1) v0 += 1; } } free(v5); } } } free(v1); fclose(v6); v11 = v0; } return v11; }
int main (int argc, char **argv) { char buf[ 8192 ]; char *name; char *newpwd; char *cp; const struct sgrp *sg; struct sgrp newsg; const struct group *gr; struct group newgr; int errors = 0; int line = 0; Prog = Basename (argv[0]); log_set_progname(Prog); log_set_logfd( stderr ); (void) setlocale ( 6 , ""); (void) bindtextdomain ("shadow", "/usr/share/locale"); (void) textdomain ("shadow"); process_root_flag ("-R", argc, argv); process_flags (argc, argv); openlog("chgpasswd", ( 0x01 ), (10<<3) ); check_perms (); is_shadow_grp = sgr_file_present (); open_files (); while (fgets (buf, (int) sizeof buf, stdin ) != (char *) 0) { line++; cp = strrchr (buf, '\n'); if ( ((void *)0) != cp) { *cp = '\0'; } else { fprintf ( stderr , gettext ("%s: line %d: line too long\n"), Prog, line); errors++; continue; } name = buf; cp = strchr (name, ':'); if ( ((void *)0) != cp) { *cp = '\0'; cp++; } else { fprintf ( stderr , gettext ("%s: line %d: missing new password\n"), Prog, line); errors++; continue; } newpwd = cp; if ( (!eflg) && ( ( ((void *)0) == crypt_method) || (0 != strcmp (crypt_method, "NONE")))) { void *arg = ((void *)0) ; const char *salt; if (md5flg) { crypt_method = "MD5"; } if (sflg) { if ( (0 == strcmp (crypt_method, "SHA256")) || (0 == strcmp (crypt_method, "SHA512"))) { arg = &sha_rounds; } } salt = crypt_make_salt (crypt_method, arg); cp = pw_encrypt (newpwd, salt); if ( ((void *)0) == cp) { fprintf ( stderr , gettext ("%s: failed to crypt password with salt '%s': %s\n"), Prog, salt, strerror ( (*__errno_location ()) )); fail_exit (1); } } gr = gr_locate (name); if ( ((void *)0) == gr) { fprintf ( stderr , gettext ("%s: line %d: group '%s' does not exist\n"), Prog, line, name); errors++; continue; } if (is_shadow_grp) { sg = sgr_locate (name); if ( ( ((void *)0) == sg) && (strcmp (gr->gr_passwd, "x") == 0)) { static char *empty = ((void *)0) ; newsg.sg_name = name; newsg.sg_adm = &empty; newsg.sg_mem = dup_list (gr->gr_mem); sg = &newsg; } } else { sg = ((void *)0) ; } if ( ((void *)0) != sg) { newsg = *sg; newsg.sg_passwd = cp; } if ( ( ((void *)0) == sg) || (strcmp (gr->gr_passwd, "x") != 0)) { newgr = *gr; newgr.gr_passwd = cp; } if ( ((void *)0) != sg) { if (sgr_update (&newsg) == 0) { fprintf ( stderr , gettext ("%s: line %d: failed to prepare the new %s entry '%s'\n"), Prog, line, sgr_dbname (), newsg.sg_name); errors++; continue; } } if ( ( ((void *)0) == sg) || (strcmp (gr->gr_passwd, "x") != 0)) { if (gr_update (&newgr) == 0) { fprintf ( stderr , gettext ("%s: line %d: failed to prepare the new %s entry '%s'\n"), Prog, line, gr_dbname (), newgr.gr_name); errors++; continue; } } } if (0 != errors) { fprintf ( stderr , gettext ("%s: error detected, changes ignored\n"), Prog); fail_exit (1); } close_files (); nscd_flush_cache ("group"); sssd_flush_cache (0x002); return (0); }
int main(unsigned 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 long long v2; void* v3; unsigned long long v4; char *v5; unsigned long long v6; unsigned long long v7; unsigned long long v8[4]; unsigned long v9; unsigned long v10; unsigned long long v11; unsigned long v12; unsigned long v13; unsigned long v14; unsigned long v15; unsigned long v16; char v17; char v18; unsigned long long v19; unsigned long long v22; unsigned long long v23; unsigned long long v27; unsigned long long v28; unsigned long long v29; unsigned long long v31; unsigned long long v32; v19 = *(&v19); v18 = *(&v18); v0 = 0; v1 = 0; Prog = Basename(*(a1)); log_set_progname(0x8930ec8348535441); log_set_logfd(stderr); setlocale(0x6, &g_4016d4); bindtextdomain("shadow", "/usr/share/locale"); textdomain("shadow"); process_root_flag("-R", a0, a1); process_flags(a0, a1); openlog("chgpasswd", 0x1, 0x50); check_perms(); is_shadow_grp = sgr_file_present("chgpasswd", a1, a2, a3, a4, a5); open_files(); while (true) { if (!fgets(&v17, 0x2000, stdin)) break; v1 += 1; v2 = strrchr(&v17, 0xa); if (v2) { *(v2) = 0; v5 = &v17; v2 = strchr(v5, 0x3a); if (v2) { *(v2) = 0; v2 += 1; v6 = v2; if ((eflg ^ 1)) { if (crypt_method) v22 = strcmp(crypt_method, "NONE"); if (!crypt_method || v22) { v4 = 0; if (md5flg) crypt_method = "MD5"; if (sflg) { v23 = strcmp(crypt_method, "SHA256"); if (!v23 || !strcmp(crypt_method, "SHA512")) v4 = &sha_rounds; } v7 = crypt_make_salt(crypt_method, v4, v4); v2 = pw_encrypt(v6, v7, v7); if (!v2) { v32 = strerror(*(__errno_location())); fprintf(stderr, gettext("%s: failed to crypt password with salt '%s': %s\n")); fail_exit(0x1); } } } if (!(eflg ^ 1) || v2 || !v22 && crypt_method) { v8[0] = gr_locate(v5); if (!v8) { fprintf(stderr, gettext("%s: line %d: group '%s' does not exist\n")); v0 += 1; } else { if (is_shadow_grp) { v3 = sgr_locate(v5); if (!v3 && !strcmp(v8[1], "x")) { v9 = v5; v11 = &empty.5713; v12 = dup_list(v8[3]); v3 = &v9; } } else { v3 = 0; } if (v3) { v9 = *(v3); v10 = v3[8]; v11 = v3[16]; v12 = v3[24]; v10 = v2; } if (!v3 || strcmp(v8[1], "x")) { v13 = v8[0]; v14 = v8[1]; v15 = v8[2]; v16 = v8[3]; v14 = v2; } if (v3) { v27 = sgr_update(&v9); if (!v27) { v29 = sgr_dbname(); fprintf(stderr, gettext("%s: line %d: failed to prepare the new %s entry '%s'\n")); v0 += 1; continue; } } if (!v3 || v27) { if (v3) { v28 = strcmp(v8[1], "x"); continue; } if (gr_update(&v13)) continue; v31 = gr_dbname(); fprintf(stderr, gettext("%s: line %d: failed to prepare the new %s entry '%s'\n")); v0 += 1; } } } } else { fprintf(stderr, gettext("%s: line %d: missing new password\n")); v0 += 1; } } else { fprintf(stderr, gettext("%s: line %d: line too long\n")); v0 += 1; } } if (v0) { fprintf(stderr, gettext("%s: error detected, changes ignored\n")); fail_exit(0x1); } close_files(); nscd_flush_cache("group"); sssd_flush_cache(0x2); return 0; }
void * zalloc (size_t size) { void *p = xmalloc (size); memset (p, 0, size); return p; }
long long zalloc(unsigned long a0) { void* v0; v0 = xmalloc(a0); memset(v0, 0x0, a0); return v0; }