input
stringlengths
28
169k
output
stringlengths
20
317k
int rl_modifying (int start, int end) { if (start > end) { do { int t; t = start; start = end; end = t; } while (0); } if (start != end) { char *temp = rl_copy_text (start, end); rl_begin_undo_group (); rl_add_undo (UNDO_DELETE, start, end, temp); rl_add_undo (UNDO_INSERT, start, end, (char *) ((void *)0) ); rl_end_undo_group (); } return 0; }
long long rl_modifying(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned long long v3; v1 = a0; v0 = a1; if (v1 > v0) { v2 = v1; v1 = v0; v0 = v2; } if (v1 != v0) { v3 = rl_copy_text(v1, v0, v0); rl_begin_undo_group(); rl_add_undo(0x0, v1, v0, v3); rl_add_undo(0x1, v1, v0, 0x0); rl_end_undo_group(); return 0; } return 0; }
static const char * get_fts_info_name (int info) { static char buf[1 + ((((((sizeof (info) * 8) - (! ((__typeof__ (info)) 0 < (__typeof__ (info)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (info)) 0 < (__typeof__ (info)) -1))) + 1) + 1]; switch (info) { case 1: return "FTS_D";; case 2: return "FTS_DC";; case 3: return "FTS_DEFAULT";; case 4: return "FTS_DNR";; case 5: return "FTS_DOT";; case 6: return "FTS_DP";; case 7: return "FTS_ERR";; case 8: return "FTS_F";; case 9: return "FTS_INIT";; case 10: return "FTS_NS";; case 11: return "FTS_NSOK";; case 12: return "FTS_SL";; case 13: return "FTS_SLNONE";; case 14: return "FTS_W";; default: sprintf (buf, "[%d]", info); return buf; } }
undefined1 * get_fts_info_name(uint param_1) { undefined1 *puVar1; switch(param_1) { default: sprintf(buf_6077,"[%d]",(ulong)param_1); puVar1 = buf_6077; break; case 1: puVar1 = "FTS_D"; break; case 2: puVar1 = "FTS_DC"; break; case 3: puVar1 = "FTS_DEFAULT"; break; case 4: puVar1 = "FTS_DNR"; break; case 5: puVar1 = "FTS_DOT"; break; case 6: puVar1 = "FTS_DP"; break; case 7: puVar1 = "FTS_ERR"; break; case 8: puVar1 = "FTS_F"; break; case 9: puVar1 = "FTS_INIT"; break; case 10: puVar1 = "FTS_NS"; break; case 0xb: puVar1 = "FTS_NSOK"; break; case 0xc: puVar1 = "FTS_SL"; break; case 0xd: puVar1 = "FTS_SLNONE"; break; case 0xe: puVar1 = "FTS_W"; } return puVar1; }
&& (getpwnam (fields[0]) != ((void *)0) )) { fprintf ( stderr , gettext ("%s: cannot update the entry of user %s (not in the passwd database)\n"), Prog, fields[0]); errors++; continue; }
(ppVar4 = getpwnam(local_2078[0]), uVar1 = Prog, ppVar4 != (passwd *)0x0)) { pcVar9 = (char *)gettext( "%s: cannot update the entry of user %s (not in the passwd database)\n" ); fprintf(stderr,pcVar9,uVar1); local_20cc = local_20cc + 1; }
HIST_ENTRY * history_get(int num) { static HIST_ENTRY she; HistEvent ev; int curr_num; if (h == ((void *)0) || e == ((void *)0) ) rl_initialize(); if (num < history_base) return ((void *)0) ; if (history(h, &ev, 8) != 0) return ((void *)0) ; curr_num = ev.num; if (history(h, &ev, 24, num - history_base, (void **)-1) != 0) goto out; if (history(h, &ev, 8) != 0) goto out; if (history(h, &ev, 23, ev.num, &she.data) != 0) goto out; she.line = ev.str; (void)history(h, &ev, 7, curr_num); return &she; out: (void)history(h, &ev, 7, curr_num); return ((void *)0) ; }
int history_get(unsigned long a0) { unsigned int v0; char v1; char v2; unsigned int v4; if (!h || !e) rl_initialize(); if (a0 < *(got.history_base)) { v4 = 0; return v4; } else if (!history(h, &v1, 0x8, &v1)) { v0 = *(&v1); if (!history(h, &v1, 0x18, a0 - *(got.history_base)) && !history(h, &v1, 0x8, &v1) && !history(h, &v1, 0x17, *(&v1))) { she.6812 = *(&v2); history(h, &v1, 0x7, v0); v4 = &she.6812; return v4; } history(h, &v1, 0x7, v0); v4 = 0; return v4; } else { v4 = 0; return v4; } }
int main(int argc, char **argv) { int ret; int i; char portname[6]; socket_st hd; _Bool socket_opened = 0 ; char app_proto[32] = ""; cmd_parser(argc, argv); signal( 13 , ((__sighandler_t) 1) ); sockets_init(); if (gnutls_global_init() < 0) { fprintf( stderr , "global state initialization error\n"); exit(1); } gnutls_global_set_log_function(tls_log_func); gnutls_global_set_log_level(debug); snprintf(portname, sizeof(portname), "%d", port); if (gnutls_certificate_allocate_credentials(&xcred) < 0) { fprintf( stderr , "memory error\n"); exit(1); } if (gnutls_srp_allocate_client_credentials(&srp_cred) < 0) { fprintf( stderr , "memory error\n"); exit(1); } if (gnutls_anon_allocate_client_credentials(&anon_cred) < 0) { fprintf( stderr , "memory error\n"); exit(1); } if (gnutls_cli_debug_options.present.starttls_proto) { snprintf(app_proto, sizeof(app_proto), "%s", gnutls_cli_debug_options.arg.starttls_proto); } if (app_proto[0] == 0) { snprintf(app_proto, sizeof(app_proto), "%s", port_to_service(portname, "tcp")); } sockets_init(); printf("GnuTLS debug client %s\n", gnutls_check_version( ((void *)0) )); canonicalize_host(hostname, portname, sizeof(portname)); printf("Checking %s:%s\n", hostname, portname); for (i = 0; tls_tests[i].test_name != ((void *)0) ; i++) { if (strcmp(app_proto, "https") != 0 && tls_tests[i].https_only != 0) { continue; } if (!socket_opened) { socket_open2(&hd, hostname, portname, app_proto, (1<<2)|(1<<3), ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) ); hd.verbose = verbose; socket_opened = 1 ; } ret = tls_tests[i].func(hd.session); if ((ret != TEST_IGNORE && ret != TEST_IGNORE2) || verbose) { printf("%58s...", tls_tests[i].test_name); fflush( stdout ); } if (ret == TEST_SUCCEED) { if (tls_tests[i].suc_str == ((void *)0) ) printf(" %s\n", ext_text); else printf(" %s\n", tls_tests[i].suc_str); } else if (ret == TEST_FAILED) printf(" %s\n", tls_tests[i].fail_str); else if (ret == TEST_UNSURE) printf(" %s\n", tls_tests[i].unsure_str); else if ((ret == TEST_IGNORE || ret == TEST_IGNORE2) && verbose) { printf(" skipped\n"); } if (ret != TEST_IGNORE) { socket_bye(&hd, 1); socket_opened = 0 ; } if (ret == TEST_FAILED && tls_tests[i].fatal_failure) break; } gnutls_srp_free_client_credentials(srp_cred); gnutls_certificate_free_credentials(xcred); gnutls_anon_free_client_credentials(anon_cred); gnutls_global_deinit(); return 0; }
int main(unsigned long long a0, unsigned long long a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { void* v0; char v1; unsigned int v2; unsigned int v3; char v4; char v5; unsigned int v6; char v7; void* v8; void* v9; void* v10; void* v11; unsigned int v14; unsigned int v18; v1 = 0; v8 = 0; v9 = 0; v10 = 0; v11 = 0; cmd_parser(a0, a1); signal(0xd, 0x1); sockets_init(0xd, 0x1, a2, a3, a4, a5); if (gnutls_global_init(0xd, 0x1, a2, a3, a4, a5) < 0) { fprintf(*(&stderr), "global state initialization error\n"); exit(0x1); } gnutls_global_set_log_function(tls_log_func); gnutls_global_set_log_level(debug); v14 = port; snprintf(&v7, 0x6, "%d", port); if (gnutls_certificate_allocate_credentials(&xcred) < 0) { fprintf(*(&stderr), "memory error\n"); exit(0x1); } else if (gnutls_srp_allocate_client_credentials(&srp_cred) < 0) { fprintf(*(&stderr), "memory error\n"); exit(0x1); } else if (gnutls_anon_allocate_client_credentials(&anon_cred) < 0) { fprintf(*(&stderr), "memory error\n"); exit(0x1); } else { if (g_500093) { v14 = printf; snprintf(&v8, 0x20, "%s", printf); } if (!v8) { v14 = port_to_service(&v7, "tcp"); snprintf(&v8, 0x20, "%s", v14); } sockets_init(a0, a1, a2, *(&v14), a4, a5); printf("GnuTLS debug client %s\n", gnutls_check_version(0x0)); canonicalize_host(hostname, &v7, 0x6, &v7); a2 = &v7; v18 = hostname; printf("Checking %s:%s\n", hostname, &v7); for (v2 = 0; tls_tests[4 * v2 + 2 * v2]; v2 += 1) { if (!strcmp(&v8, "https") || !g_401368[8 * v2 + 4 * v2]) { if ((v1 ^ 1)) { v0 = 0; socket_open2(&v4, hostname, &v7, &v8, 0xc, 0x0, 0x0, 0x0, 0x0); v6 = verbose; v1 = 1; } a2 = (&g_401348)[6 * v2]; v3 = (&g_401348)[6 * v2](*(&v5)); if (verbose || v3 != 3 && v3 != 4) { a2 = v2 * 48; v18 = tls_tests[6 * v2]; printf("%58s...", tls_tests[6 * v2]); fflush(stdout); } if (!v3) { a2 = v2 * 48; if (!g_401350[4 * v2 + 2 * v2]) { v18 = ext_text; printf(" %s\n", ext_text); } else { a2 = v2 * 48; v18 = g_401350[6 * v2]; printf(" %s\n", g_401350[6 * v2]); } } else if (v3 == 1) { a2 = v2 * 48; v18 = (&g_401358)[6 * v2]; printf(" %s\n", (&g_401358)[6 * v2]); } else if (v3 == 2) { a2 = v2 * 48; v18 = (&g_401360)[6 * v2]; printf(" %s\n", (&g_401360)[6 * v2]); } else if ((v3 == 3 || v3 == 4) && verbose) { printf(" skipped\n"); } if (v3 != 3) { socket_bye(&v4, 0x1); v1 = 0; } if (v3 == 1) { if (g_40136c[8 * v2 + 4 * v2]) break; } } } gnutls_srp_free_client_credentials(srp_cred); gnutls_certificate_free_credentials(xcred); gnutls_anon_free_client_credentials(anon_cred); gnutls_global_deinit(a0, *(&v18), a2, *(&v14), 0xc, 0x0); return 0; } }
static const char * _rl_completion_append_character_function(const char *dummy __attribute__((__unused__))) { static char buf[2]; buf[0] = (char)rl_completion_append_character; buf[1] = '\0'; return buf; }
long long _rl_completion_append_character_function(unsigned long a0) { unsigned long v0; v0 = a0; buf.6921 = *(got.rl_completion_append_character); g_406491 = 0; return &buf.6921; }
static int process_rawdata (size_t bytes, char *buffer) { size_t status = blocking_read (diff_handle, diff_buffer, bytes); if (status != bytes) { if (status == ((size_t) -1)) { read_error (current_stat_info.file_name); report_difference (&current_stat_info, ((void *)0) ); } else { report_difference (&current_stat_info, ngettext ("Could only read %lu of %lu byte", "Could only read %lu of %lu bytes", bytes), (unsigned long) status, (unsigned long) bytes); } return 0; } if (memcmp (buffer, diff_buffer, bytes)) { report_difference (&current_stat_info, gettext ("Contents differ")); return 0; } return 1; }
long long process_rawdata(unsigned long a0, void* a1) { unsigned long v0; unsigned long long v3; v0 = blocking_read(diff_handle, diff_buffer, a0, diff_buffer); if (v0 != a0) { if (v0 == -1) { read_error(read_error); report_difference(); } else { ngettext("Could only read %lu of %lu byte", "Could only read %lu of %lu bytes", a0); report_difference(); } v3 = 0; } else if (memcmp(a1, diff_buffer, a0)) { gettext("Contents differ"); report_difference(); v3 = 0; } else { v3 = 1; } return v3; }
void check_dev_tty () { int tty_fd; char *tty; tty_fd = open ("/dev/tty", 02 | 04000 ); if (tty_fd < 0) { tty = (char *)ttyname (fileno ( stdin )); if (tty == 0) return; tty_fd = open (tty, 02 | 04000 ); } if (tty_fd >= 0) close (tty_fd); }
int check_dev_tty() { char *v0; int v1; int fd; LODWORD(v0) = open("/dev/tty", 2050); fd = (int)v0; if ( (int)v0 < 0 ) { v1 = fileno(stdin); v0 = ttyname(v1); if ( !v0 ) return (int)v0; LODWORD(v0) = open(v0, 2050); fd = (int)v0; } if ( fd >= 0 ) LODWORD(v0) = close(fd); return (int)v0; }
static inline __s32 rta_getattr_s32(const struct rtattr *rta) { return *(__s32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); }
undefined4 rta_getattr_s32(long param_1) { return *(undefined4 *)(param_1 + 4); }
static void fail_exit (int status) { if (gr_locked) { if (gr_unlock () == 0) { fprintf ( stderr , gettext ("%s: failed to unlock %s\n"), Prog, gr_dbname ()); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 3 , "failed to unlock %s", gr_dbname ()) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); } } if (sgr_locked) { if (sgr_unlock () == 0) { fprintf ( stderr , gettext ("%s: failed to unlock %s\n"), Prog, sgr_dbname ()); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 3 , "failed to unlock %s", sgr_dbname ()) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); } } exit (status); }
void fail_exit(unsigned long a0) { void* v0; void* v1; char *v2; char *v3; unsigned long v4; unsigned long v5; unsigned long v7; unsigned long v8; unsigned long long v10; unsigned long long v12; v5 = v7; v4 = v8; if (gr_locked && !gr_unlock()) { v10 = gr_dbname(); fprintf(stderr, gettext("%s: failed to un")); v2 = setlocale(0x6, NULL); v0 = 0; if (v2) v0 = strdup(v2); if (v0) setlocale(0x6, "C"); gr_dbname(); syslog(0x3, "failed to unlock %s"); if (v0) { setlocale(0x6, v0); free(v0); } } if (sgr_locked && !sgr_unlock()) { v12 = sgr_dbname(); fprintf(stderr, gettext("%s: failed to un")); v3 = setlocale(0x6, NULL); v1 = 0; if (v3) v1 = strdup(v3); if (v1) setlocale(0x6, "C"); sgr_dbname(); syslog(0x3, "failed to unlock %s"); if (v1) { setlocale(0x6, v1); free(v1); } } exit(a0); }
static enum Copy_fd_status copy_fd (int src_fd, uintmax_t n_bytes) { char buf[ 8192 ]; const size_t buf_size = sizeof (buf); while (0 < n_bytes) { size_t n_to_read = ((( buf_size )<( n_bytes ))?( buf_size ):( n_bytes )) ; size_t n_read = safe_read (src_fd, buf, n_to_read); if (n_read == ((size_t) -1)) return COPY_FD_READ_ERROR; n_bytes -= n_read; if (n_read == 0 && n_bytes != 0) return COPY_FD_UNEXPECTED_EOF; xwrite_stdout (buf, n_read); } return COPY_FD_OK; }
int copy_fd(unsigned long a0, unsigned long long a1) { unsigned long v0; unsigned long long v1; unsigned long v2; unsigned long v3; char v4; unsigned long long v5; unsigned long long v6; unsigned long v8; v6 = *(&v6); v5 = *(&v5); v0 = a1; v1 = 0x2000; while (!v0) { *(&v8) = 0; return v8; } v8 = v1; if (v0 <= v1) v8 = v0; v2 = v8; v3 = safe_read(a0, &v4, v2, &v4); if (v3 == -1) { *(&v8) = 1; return v8; } v0 -= v3; if (!v3 && v0) { *(&v8) = 2; return v8; } xwrite_stdout(&v4, v3); }
static void describe_change (char const *file, struct change_status const *ch) { char perms[12]; char old_perms[12]; char const *fmt; char const *quoted_file = quotearg_style (shell_escape_always_quoting_style, file); switch (ch->status) { case CH_NOT_APPLIED: printf (gettext ("neither symbolic link %s nor referent has been changed\n"), quoted_file); return; case CH_NO_STAT: printf (gettext ("%s could not be accessed\n"), quoted_file); return; default: break; } unsigned long int old_m = ch->old_mode & ( 04000 | 02000 | 01000 | (0400|0200|0100) | ((0400|0200|0100) >> 3) | (((0400|0200|0100) >> 3) >> 3) ), m = ch->new_mode & ( 04000 | 02000 | 01000 | (0400|0200|0100) | ((0400|0200|0100) >> 3) | (((0400|0200|0100) >> 3) >> 3) ); strmode (ch->new_mode, perms); perms[10] = '\0'; strmode (ch->old_mode, old_perms); old_perms[10] = '\0'; switch (ch->status) { case CH_SUCCEEDED: fmt = gettext ("mode of %s changed from %04lo (%s) to %04lo (%s)\n"); break; case CH_FAILED: fmt = gettext ("failed to change mode of %s from %04lo (%s) to %04lo (%s)\n"); break; case CH_NO_CHANGE_REQUESTED: fmt = gettext ("mode of %s retained as %04lo (%s)\n"); printf (fmt, quoted_file, m, &perms[1]); return; default: abort (); } printf (fmt, quoted_file, old_m, &old_perms[1], m, &perms[1]); }
void describe_change(undefined8 param_1,uint *param_2) { uint uVar1; uint uVar2; uint uVar3; undefined8 uVar4; char *pcVar5; long in_FS_OFFSET; char *local_48; undefined local_28; undefined local_27 [9]; undefined local_1e; undefined local_1c; undefined local_1b [9]; undefined local_12; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); uVar4 = quotearg_style(4,param_1); if (*param_2 == 0) { pcVar5 = (char *)gettext("%s could not be accessed\n"); printf(pcVar5,uVar4); } else if (*param_2 == 2) { pcVar5 = (char *)gettext("neither symbolic link %s nor referent has been changed\n"); printf(pcVar5,uVar4); } else { uVar1 = param_2[1]; uVar2 = param_2[2]; strmode(param_2[2],&local_28); local_1e = 0; strmode(param_2[1],&local_1c); local_12 = 0; uVar3 = *param_2; if (uVar3 == 4) { local_48 = (char *)gettext("mode of %s changed from %04lo (%s) to %04lo (%s)\n"); } else { if (4 < uVar3) { LAB_001004f2: abort(); } if (uVar3 != 1) { if (uVar3 == 3) { pcVar5 = (char *)gettext("mode of %s retained as %04lo (%s)\n"); printf(pcVar5,uVar4,(ulong)(uVar2 & 0xfff),local_27); goto LAB_0010052a; } goto LAB_001004f2; } local_48 = (char *)gettext("failed to change mode of %s from %04lo (%s) to %04lo (%s)\n"); } printf(local_48,uVar4,(ulong)(uVar1 & 0xfff),local_1b,(ulong)(uVar2 & 0xfff),local_27); } LAB_0010052a: if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
int rl_universal_argument (int count, int key) { _rl_arg_init (); rl_numeric_arg *= 4; return ((rl_readline_state & (0x0080000)) ? 0 : rl_digit_loop ()); }
long long rl_universal_argument(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned int v0; unsigned int v1; void* v3; v1 = a0; v0 = a1; _rl_arg_init(); rl_numeric_arg = rl_numeric_arg * 4; if (!(rl_readline_state & 0x80000)) v3 = rl_digit_loop(a0, a1, a2, a3, a4, a5); else v3 = 0; return v3; }
test_code_t test_dhe(gnutls_session_t session) { int ret; sprintf(prio_str, "NONE:" "+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL" ":%s:" "+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":+DHE-RSA:+DHE-DSS:%s", protocol_str, rest); { int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 220)) != TEST_SUCCEED) { return _ret; } }; gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred); ret = test_do_handshake(session); gnutls_dh_get_pubkey(session, &pubkey); return ret; return TEST_IGNORE; }
long long test_dhe(unsigned long long a0) { unsigned int v0; unsigned int v1; unsigned long long v3; sprintf(&prio_str, "NONE:+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC:+GOST28147-TC26Z-CNT:+COMP-NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT:+DHE-RSA:+DHE-DSS:%s", &protocol_str, &rest); v0 = __gnutls_priority_set_direct(a0, &prio_str, 0xdc); if (v0) { v3 = v0; } else { gnutls_credentials_set(a0, 0x1, xcred); v1 = test_do_handshake(a0); gnutls_dh_get_pubkey(a0, &pubkey); v3 = v1; } return v3; }
static void unbind_compfunc_variables (exported) int exported; { unbind_variable_noref ("COMP_LINE"); unbind_variable_noref ("COMP_POINT"); unbind_variable_noref ("COMP_TYPE"); unbind_variable_noref ("COMP_KEY"); unbind_variable_noref ("COMP_WORDS"); unbind_variable_noref ("COMP_CWORD"); if (exported) array_needs_making = 1; }
void unbind_compfunc_variables(unsigned long a0) { unsigned long long v1; unbind_variable_noref("COMP_LINE"); unbind_variable_noref("COMP_POINT"); unbind_variable_noref("COMP_TYPE"); unbind_variable_noref("COMP_KEY"); unbind_variable_noref("COMP_WORDS"); v1 = unbind_variable_noref("COMP_CWORD"); if (a0) array_needs_making = 1; return; }
static int diversion_truename(const char *const *argv) { const char *filename = argv[0]; struct fsys_namenode *namenode; if (!filename || argv[1]) badusage(gettext("--%s needs a single argument"), cipaction->olong); diversion_check_filename(filename); namenode = fsys_hash_find_node(filename, FHFF_NONE); if (namenode && namenode->divert && namenode->divert->useinstead) printf("%s\n", namenode->divert->useinstead->name); else printf("%s\n", filename); return 0; }
long long diversion_truename(unsigned long long a0[2], unsigned long a1, unsigned long long a2) { char *v0; struct_0 *v1; v0 = a0[0]; if (!v0 || a0[1]) badusage(gettext("--%s needs a single argument"), *(cipaction), a2); diversion_check_filename(v0); v1 = fsys_hash_find_node(v0, 0x2); if (v1 && v1->field_18 && *(v1->field_18)) printf("%s\n", *(v1->field_18)->field_8); if (!*(v1->field_18) || !v1->field_18 || !v1) printf("%s\n", v0); return 0; }
static inline __u64 rta_getattr_u64(const struct rtattr *rta) { __u64 tmp; memcpy(&tmp, ((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), sizeof(__u64)); return tmp; }
long rta_getattr_u64(long a1) { long dest[2]; dest[1] = __readfsqword(0x28u); memcpy(dest, (const void *)(a1 + 4), 8uLL); return dest[0]; }
terminal_overwrite(EditLine *el, const wchar_t *cp, size_t n) { if (n == 0) return; if (n > (size_t)el->el_terminal.t_size.h) { return; } do { terminal__putc(el, *cp++); el->el_cursor.h++; } while (--n); if (el->el_cursor.h >= el->el_terminal.t_size.h) { if (((el)->el_terminal.t_flags & 0x080)) { el->el_cursor.h = 0; if (el->el_cursor.v + 1 < el->el_terminal.t_size.v) el->el_cursor.v++; if (((el)->el_terminal.t_flags & 0x100)) { wchar_t c; if ((c = el->el_display[el->el_cursor.v] [el->el_cursor.h]) != '\0') { terminal_overwrite(el, &c, (size_t)1); while (el->el_display[el->el_cursor.v] [el->el_cursor.h] == ((wint_t)-1)) el->el_cursor.h++; } else { terminal__putc(el, ' '); el->el_cursor.h = 1; } } } else el->el_cursor.h = el->el_terminal.t_size.h - 1; } }
void terminal_overwrite(long param_1,undefined4 *param_2,ulong param_3) { long in_FS_OFFSET; ulong local_30; undefined4 *local_28; int local_14; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); if ((param_3 != 0) && (local_30 = param_3, local_28 = param_2, param_3 <= (ulong)(long)*(int *)(param_1 + 0x90))) { do { terminal__putc(param_1,*local_28); *(int *)(param_1 + 0x30) = *(int *)(param_1 + 0x30) + 1; local_30 = local_30 - 1; local_28 = local_28 + 1; } while (local_30 != 0); if (*(int *)(param_1 + 0x90) <= *(int *)(param_1 + 0x30)) { if ((*(uint *)(param_1 + 0x98) & 0x80) == 0) { *(int *)(param_1 + 0x30) = *(int *)(param_1 + 0x90) + -1; } else { *(undefined4 *)(param_1 + 0x30) = 0; if (*(int *)(param_1 + 0x34) + 1 < *(int *)(param_1 + 0x94)) { *(int *)(param_1 + 0x34) = *(int *)(param_1 + 0x34) + 1; } if ((*(uint *)(param_1 + 0x98) & 0x100) != 0) { local_14 = *(int *)((long)*(int *)(param_1 + 0x30) * 4 + *(long *)((long)*(int *)(param_1 + 0x34) * 8 + *(long *)(param_1 + 0x38))); if (local_14 == 0) { terminal__putc(param_1,0x20); *(undefined4 *)(param_1 + 0x30) = 1; } else { terminal_overwrite(param_1,&local_14,1); while (*(int *)((long)*(int *)(param_1 + 0x30) * 4 + *(long *)((long)*(int *)(param_1 + 0x34) * 8 + *(long *)(param_1 + 0x38)) ) == -1) { *(int *)(param_1 + 0x30) = *(int *)(param_1 + 0x30) + 1; } } } } } } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
int maintscript_new(struct pkginfo *pkg, const char *scriptname, const char *desc, const char *cidir, char *cidirrest, ...) { struct command cmd; struct stat stab; va_list args; char *buf; strcpy(cidirrest, scriptname); m_asprintf(&buf, gettext("new %s package %s script"), pkg_name(pkg, pnaw_nonambig), desc); __builtin_va_start( args , cidirrest ) ; command_init(&cmd, cidir, buf); command_add_arg(&cmd, scriptname); command_add_argv(&cmd, args); __builtin_va_end( args ) ; if (stat(cidir, &stab)) { command_destroy(&cmd); if ( (*__errno_location ()) == 2 ) { debug(dbg_scripts, "maintscript_new nonexistent %s '%s'", scriptname, cidir); free(buf); return 0; } ohshite(gettext("unable to stat %s '%.250s'"), buf, cidir); } maintscript_exec(pkg, &pkg->available, &cmd, &stab, 0); command_destroy(&cmd); free(buf); post_script_tasks(); return 1; }
long long maintscript_new() { char v0; char v1; unsigned int v2; unsigned int v3; unsigned long v4; unsigned long v5; char v6; unsigned long v7; char v8; unsigned long v9; int v10; int v11; int v12; int v13; int v14; int v15; int v16; int v17; unsigned long v18; unsigned long long v19; char v20; int v21; int v22; int v23; int v24; int v25; int v26; int v27; int v28; unsigned long long *v29; char *v30; unsigned long v31; unsigned long v32; unsigned long long v33; char *v34; unsigned long long v35; unsigned long long v37; v9 = v19; if (v20) { v10 = v21; v11 = v22; v12 = v23; v13 = v24; v14 = v25; v15 = v26; v16 = v27; v17 = v28; } v7 = v29[5]; strcpy(v30, v31); m_asprintf(&v0, gettext("new %s package %s script"), pkg_name(v32, 0x1), v33); v2 = 40; v3 = 48; v4 = &v18; v5 = &v8; command_init(&v1, v34, *(&v0), v34); command_add_arg(&v1, v31, v31); command_add_argv(&v1, &v2, &v2); v35 = stat(v34, &v6); if (v35) { command_destroy(&v1); *(&v35) = *(__errno_location()); if (v35 != 2) ohshite(gettext("unable to stat %s '%.250s'"), *(&v0), v34); } if (v35 == 2) { debug(0x2, "maintscript_new nonexistent %s '%s'"); free(*(&v0)); v37 = 0; } if (!v35 || v35 != 2) { maintscript_exec(v32, v32 + 192, &v1, &v6, 0x0, v19); command_destroy(&v1); free(*(&v0)); post_script_tasks(v32, v31, &v1, &v6, 0x0, v19); v37 = 1; } if ((v7 ^ v29[5])) __stack_chk_fail(); return v37; }
static void ssh_sandbox_child_debugging(void) { struct sigaction act; sigset_t mask; sshlog("sandbox-seccomp-filter.c", __func__, 388, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "%s: installing SIGSYS handler", __func__); memset(&act, 0, sizeof(act)); sigemptyset(&mask); sigaddset(&mask, 31 ); act. __sigaction_handler.sa_sigaction = &ssh_sandbox_violation; act.sa_flags = 4 ; if (sigaction( 31 , &act, ((void *)0) ) == -1) sshfatal("sandbox-seccomp-filter.c", __func__, 396, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: sigaction(SIGSYS): %s", __func__, strerror( (*__errno_location ()) )); if (sigprocmask( 1 , &mask, ((void *)0) ) == -1) sshfatal("sandbox-seccomp-filter.c", __func__, 398, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: sigprocmask(SIGSYS): %s", __func__, strerror( (*__errno_location ()) )) ; }
void ssh_sandbox_child_debugging(void) { int iVar1; int *piVar2; char *pcVar3; sigset_t *psVar4; undefined *puVar5; long in_FS_OFFSET; char *apcStack368 [9]; sigset_t local_128; sigaction local_a8; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); apcStack368[8] = "ssh_sandbox_child_debugging"; apcStack368[7] = "%s: installing SIGSYS handler"; apcStack368[6] = (char *)0x100185; sshlog("sandbox-seccomp-filter.c","ssh_sandbox_child_debugging",0x184,0,7,0); psVar4 = &local_128; apcStack368[8] = (char *)0x1001a2; memset(&local_a8,0,0x98); apcStack368[8] = (char *)0x1001b1; sigemptyset(&local_128); apcStack368[8] = (char *)0x1001c5; sigaddset(&local_128,0x1f); local_a8.__sigaction_handler = ssh_sandbox_violation; local_a8.sa_flags = 4; apcStack368[8] = (char *)0x1001f3; iVar1 = sigaction(0x1f,&local_a8,(sigaction *)0x0); if (iVar1 == -1) { apcStack368[8] = (char *)0x1001fd; piVar2 = __errno_location(); apcStack368[8] = (char *)0x100206; apcStack368[7] = strerror(*piVar2); apcStack368[6] = "ssh_sandbox_child_debugging"; psVar4 = (sigset_t *)(apcStack368 + 5); apcStack368[5] = "%s: sigaction(SIGSYS): %s"; sshfatal("sandbox-seccomp-filter.c","ssh_sandbox_child_debugging",0x18c,0,1,0); } *(undefined8 *)((long)psVar4 + -8) = 0x100262; iVar1 = sigprocmask(1,&local_128,(sigset_t *)0x0); puVar5 = (undefined *)psVar4; if (iVar1 == -1) { *(undefined8 *)((long)psVar4 + -8) = 0x10026c; piVar2 = __errno_location(); iVar1 = *piVar2; *(undefined8 *)((long)psVar4 + -8) = 0x100275; pcVar3 = strerror(iVar1); *(char **)((long)psVar4 + -0x10) = pcVar3; *(char **)((long)psVar4 + -0x18) = "ssh_sandbox_child_debugging"; puVar5 = (undefined *)((long)psVar4 + -0x20); *(char **)((long)psVar4 + -0x20) = "%s: sigprocmask(SIGSYS): %s"; *(undefined8 *)((long)psVar4 + -0x28) = 0x1002b8; sshfatal("sandbox-seccomp-filter.c","ssh_sandbox_child_debugging",0x18e,0,1,0); } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { *(undefined8 *)(puVar5 + -8) = 0x1002cd; __stack_chk_fail(); } return; }
void oom_adjust_restore(void) { FILE *fp; sshlog("port-linux.c", __func__, 296, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "%s", __func__); if (oom_adj_save == (-0x7fffffff - 1) || oom_adj_path == ((void *)0) || (fp = fopen(oom_adj_path, "w")) == ((void *)0) ) return; if (fprintf(fp, "%d\n", oom_adj_save) <= 0) sshlog("port-linux.c", __func__, 302, 0, SYSLOG_LEVEL_VERBOSE, ((void *)0) , "error writing %s: %s", oom_adj_path, strerror( (*__errno_location ()) )); else sshlog("port-linux.c", __func__, 304, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Set %s to %d", oom_adj_path, oom_adj_save); fclose(fp); return; }
long long oom_adjust_restore() { unsigned long v0; unsigned long long v1; void* v2; unsigned long long v4; v1 = "oom_adjust_restore"; sshlog("port-linux.c", "oom_adjust_restore", 0x128, 0x0, 0x7, 0x0, "%s"); v4 = oom_adj_save; if (oom_adj_save == 0x80000000) return v4; v4 = oom_adj_path; if (!oom_adj_path) return v4; v4 = fopen(oom_adj_path, "w"); v2 = v4; if (!v2) return v4; if (fprintf(v2, "%d\n", oom_adj_save) <= 0) { strerror(*(__errno_location())); v0 = oom_adj_path; sshlog("port-linux.c", "oom_adjust_restore", 0x12e, 0x0, 0x4, 0x0, "error writing %s: %s"); } else { v0 = oom_adj_path; sshlog("port-linux.c", "oom_adjust_restore", 0x130, 0x0, 0x5, 0x0, "Set %s to %d"); } v4 = fclose(v2); return v4; }
static void amt_print_help(struct link_util *lu, int argc, char **argv, FILE *f) { print_usage(f); }
long long amt_print_help(unsigned long a0, unsigned long a1, unsigned long a2, void* a3) { unsigned long v0; unsigned int v1; unsigned long v2; v2 = a0; v1 = a1; v0 = a2; return print_usage(a3); }
static int screen_columns (void) { struct winsize win; if (get_win_size ( 1 , &win) == 0 && 0 < win.ws_col) return win.ws_col; { char *col_string = getenv ("COLUMNS"); long int n_columns; if (!(col_string != ((void *)0) && xstrtol (col_string, ((void *)0) , 0, &n_columns, "") == LONGINT_OK && 0 < n_columns && n_columns <= 0x7fffffff)) n_columns = 80; return n_columns; } }
int screen_columns() { unsigned long long v0; unsigned long long v1; char v2; char v3; unsigned int v5; if (!get_win_size(0x1, &v2) && *(&v3)) { v5 = *(&v3); return v5; } v1 = getenv("COLUMNS"); if (!v1 || xstrtol(v1, 0x0, 0x0, &v0, &g_403df3) || v0 <= 0 || v0 >= 0x80000000) v0 = 80; v5 = v0; return v5; }
static int _rl_vi_set_mark (void) { int ch; (rl_readline_state |= (0x0000040)); ch = rl_read_key (); (rl_readline_state &= ~(0x0000040)); if (ch < 0 || ch < 'a' || ch > 'z') { rl_ding (); return 1; } ch -= 'a'; vi_mark_chars[ch] = rl_point; return 0; }
undefined8 _rl_vi_set_mark(void) { int iVar1; undefined8 uVar2; rl_readline_state = rl_readline_state | 0x40; iVar1 = rl_read_key(); rl_readline_state = rl_readline_state & 0xffffffffffffffbf; if (((iVar1 < 0) || (iVar1 < 0x61)) || (0x7a < iVar1)) { rl_ding(); uVar2 = 1; } else { *(undefined4 *)(vi_mark_chars + (long)(iVar1 + -0x61) * 4) = rl_point; uVar2 = 0; } return uVar2; }
int main(int argc, char **argv) { fix_lbuffer(0); cmd_parser(argc, argv); return 0; }
int main(unsigned long a0, unsigned long long a1) { fix_lbuffer(0x0); cmd_parser(a0, a1); return 0; }
void * xmalloc (size_t size) { void *ret; ret = malloc (size); if (ret == 0) { fprintf( stderr , "man2html: out of memory"); exit( 1 ); } return ret; }
int xmalloc(unsigned int a0) { unsigned long v0; v0 = malloc(a0); if (!v0) { fprintf(stderr, "man2html: out of memory"); exit(0x1); } return v0; }
static _Bool raw_comparator (const void *a, const void *b) { return a == b; }
long long raw_comparator(unsigned long long a0, unsigned long a1) { unsigned long long v1; v1 = a0; *(&v1) = a0 == a1; return v1; }
static int ipaddr_link_get(int index, struct nlmsg_chain *linfo) { struct iplink_req req = { .n.nlmsg_len = ((sizeof(struct ifinfomsg)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))), .n.nlmsg_flags = 0x01, .n.nlmsg_type = RTM_GETLINK, .i.ifi_family = filter.family, .i.ifi_index = index, }; __u32 filt_mask = (1 << 0); struct nlmsghdr *answer; if (!show_stats) filt_mask |= (1 << 3); addattr32(&req.n, sizeof(req), IFLA_EXT_MASK, filt_mask); if (rtnl_talk(&rth, &req.n, &answer) < 0) { perror("Cannot send link request"); return 1; } if (store_nlmsg(answer, linfo) < 0) { fprintf( stderr , "Failed to process link information\n"); free(answer); return 1; } free(answer); return 0; }
undefined8 ipaddr_link_get(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6) { int iVar1; undefined8 uVar2; long lVar3; undefined8 *puVar4; long in_FS_OFFSET; undefined4 local_444; void *local_440; undefined8 local_438; undefined local_428; undefined4 local_424; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); puVar4 = &local_438; for (lVar3 = 0x84; lVar3 != 0; lVar3 = lVar3 + -1) { *puVar4 = 0; puVar4 = puVar4 + 1; } local_438._0_4_ = 0x20; local_438._4_2_ = 0x12; local_438._6_2_ = 1; local_428 = (undefined)filter._4_4_; local_444 = 1; if (show_stats == 0) { local_444 = 9; } local_424 = param_1; addattr32(&local_438,0x420,0x1d,local_444,param_5,param_6,param_2); iVar1 = rtnl_talk(&rth,&local_438,&local_440); if (iVar1 < 0) { perror("Cannot send link request"); uVar2 = 1; } else { iVar1 = store_nlmsg(local_440,param_2); if (iVar1 < 0) { fprintf(stderr,"Failed to process link information\n"); free(local_440); uVar2 = 1; } else { free(local_440); uVar2 = 0; } } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar2; }
void sv_strict_posix (name) char *name; { SHELL_VAR *var; var = find_variable (name); posixly_correct = var && ((var)->value != 0); posix_initialize (posixly_correct); if (interactive_shell) posix_readline_initialize (posixly_correct); set_shellopts (); }
void sv_strict_posix(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { struct_0 *v0; unsigned int v2; unsigned long long v3; v0 = find_variable(a0); if (v0 && v0->field_8) v2 = 1; if (!v0 || !v0->field_8) v2 = 0; posixly_correct = v2; posix_initialize(posixly_correct); if (interactive_shell) posix_readline_initialize(posixly_correct); v3 = set_shellopts(posixly_correct, a1, a2, a3, a4, a5); return; }
static const char *BAGTYPE(gnutls_pkcs12_bag_type_t x) { switch (x) { case GNUTLS_BAG_PKCS8_ENCRYPTED_KEY: return "PKCS #8 Encrypted key"; case GNUTLS_BAG_EMPTY: return "Empty"; case GNUTLS_BAG_PKCS8_KEY: return "PKCS #8 Key"; case GNUTLS_BAG_CERTIFICATE: return "Certificate"; case GNUTLS_BAG_ENCRYPTED: return "Encrypted"; case GNUTLS_BAG_CRL: return "CRL"; case GNUTLS_BAG_SECRET: return "Secret"; default: return "Unknown"; } }
int BAGTYPE(unsigned long a0) { unsigned int v1; switch (a0) { case 0: v1 = &g_40be49; break; case 1: v1 = &g_40be33; break; case 2: v1 = &g_40be4f; break; case 3: v1 = &g_40be5b; break; case 4: v1 = &g_40be71; break; case 5: v1 = &g_40be75; break; case 10: v1 = &g_40be67; break; default: v1 = &g_40be7c; break; } return v1; }
int exportable_function_name (string) const char *string; { if (absolute_program (string)) return 0; if (mbschr (string, '=') != 0) return 0; return 1; }
long long exportable_function_name(unsigned long long a0) { return (!absolute_program(a0) ? 0 : (!mbschr(a0, 0x3d) ? 0 : 1)); }
void check_conflict(struct dependency *dep, struct pkginfo *pkg, const char *pfilename) { struct pkginfo *fixbyrm; struct deppossi *pdep, flagdeppossi = { 0 }; struct varbuf conflictwhy = { 0, 0, ((void *)0) }, removalwhy = { 0, 0, ((void *)0) }; struct dependency *providecheck; fixbyrm = ((void *)0) ; if (depisok(dep, &conflictwhy, &fixbyrm, ((void *)0) , 0 )) { varbuf_destroy(&conflictwhy); varbuf_destroy(&removalwhy); return; } if (fixbyrm) { ensure_package_clientdata(fixbyrm); if (fixbyrm->clientdata->istobe == PKG_ISTOBE_INSTALLNEW) { fixbyrm= dep->up; ensure_package_clientdata(fixbyrm); } if (((pkg->available.essential || pkg->available.is_protected) && (fixbyrm->installed.essential || fixbyrm->installed.is_protected)) || (((fixbyrm->want != PKG_WANT_INSTALL && fixbyrm->want != PKG_WANT_HOLD) || does_replace(pkg, &pkg->available, fixbyrm, &fixbyrm->installed)) && ((!fixbyrm->installed.essential || in_force(FORCE_REMOVE_ESSENTIAL)) || (!fixbyrm->installed.is_protected || in_force(FORCE_REMOVE_PROTECTED))))) { if (fixbyrm->clientdata->istobe != PKG_ISTOBE_NORMAL && fixbyrm->clientdata->istobe != PKG_ISTOBE_DECONFIGURE) do_internerr("archives.c", 1373, __func__, "package %s to be fixed by removal is not to be normal " "nor deconfigure, is to be %d", pkg_name(pkg, pnaw_always), fixbyrm->clientdata->istobe) ; fixbyrm->clientdata->istobe = PKG_ISTOBE_REMOVE; notice(gettext("considering removing %s in favour of %s ..."), pkg_name(fixbyrm, pnaw_nonambig), pkgbin_name(pkg, &pkg->available, pnaw_nonambig)); if (!(fixbyrm->status == PKG_STAT_INSTALLED || fixbyrm->status == PKG_STAT_TRIGGERSPENDING || fixbyrm->status == PKG_STAT_TRIGGERSAWAITED)) { notice(gettext("%s is not properly installed; ignoring any dependencies on it"), pkg_name(fixbyrm, pnaw_nonambig)); pdep = ((void *)0) ; } else { for (pdep = fixbyrm->set->depended.installed; pdep; pdep = pdep->rev_next) { if (pdep->up->type != dep_depends && pdep->up->type != dep_predepends) continue; if (depisok(pdep->up, &removalwhy, ((void *)0) , ((void *)0) , 0 )) continue; varbuf_end_str(&removalwhy); if (!try_remove_can(pdep,fixbyrm,removalwhy.buf)) break; } if (!pdep) { for (providecheck= fixbyrm->installed.depends; providecheck; providecheck= providecheck->next) { if (providecheck->type != dep_provides) continue; for (pdep = providecheck->list->ed->depended.installed; pdep; pdep = pdep->rev_next) { if (pdep->up->type != dep_depends && pdep->up->type != dep_predepends) continue; if (depisok(pdep->up, &removalwhy, ((void *)0) , ((void *)0) , 0 )) continue; varbuf_end_str(&removalwhy); notice(gettext("may have trouble removing %s, as it provides %s ..."), pkg_name(fixbyrm, pnaw_nonambig), providecheck->list->ed->name); if (!try_remove_can(pdep,fixbyrm,removalwhy.buf)) goto break_from_both_loops_at_once; } } break_from_both_loops_at_once:; } } if (!pdep && skip_due_to_hold(fixbyrm)) { pdep= &flagdeppossi; } if (!pdep && (fixbyrm->eflag & PKG_EFLAG_REINSTREQ)) { if (in_force(FORCE_REMOVE_REINSTREQ)) { notice(gettext("package %s requires reinstallation, but will " "remove anyway as you requested") , pkg_name(fixbyrm, pnaw_nonambig)); } else { notice(gettext("package %s requires reinstallation, will not remove"), pkg_name(fixbyrm, pnaw_nonambig)); pdep= &flagdeppossi; } } if (!pdep) { enqueue_conflictor(fixbyrm); varbuf_destroy(&conflictwhy); varbuf_destroy(&removalwhy); notice(gettext("yes, will remove %s in favour of %s"), pkg_name(fixbyrm, pnaw_nonambig), pkgbin_name(pkg, &pkg->available, pnaw_nonambig)); return; } fixbyrm->clientdata->istobe = PKG_ISTOBE_NORMAL; } } varbuf_end_str(&conflictwhy); notice(gettext("regarding %s containing %s:\n%s"), pfilename, pkgbin_name(pkg, &pkg->available, pnaw_nonambig), conflictwhy.buf); if (!force_conflicts(dep->list)) ohshit(gettext("conflicting packages - not installing %.250s"), pkgbin_name(pkg, &pkg->available, pnaw_nonambig)); warning(gettext("ignoring conflict, may proceed anyway!")); varbuf_destroy(&conflictwhy); return; }
long long check_conflict(unsigned long long a0[3], char a1[202], unsigned long long a2) { void* v0; struct_0 *v1; struct_2 *v2; void* v3; void* v4; void* v5; void* v6; void* v7; void* v8; void* v9; void* v10; void* v11; void* v12; void* v13; void* v14; void* v15; void* v16; void* v17; void* v18; unsigned long long v20; unsigned long long v21; v9 = 0; v10 = 0; v11 = 0; v12 = 0; v13 = 0; v14 = 0; v15 = 0; v16 = 0; v17 = 0; v18 = 0; v3 = 0; v4 = 0; v5 = 0; v6 = 0; v7 = 0; v8 = 0; v0 = 0; v20 = depisok(a0, &v3, &v0, 0x0, 0x0); if (v20) { varbuf_destroy(&v3); varbuf_destroy(&v6); } else { if (v0) { ensure_package_clientdata(v0); if (*(v0[312]) == 2) { v0 = a0[0]; ensure_package_clientdata(v0); } if ((!v0[80] || !a1[200]) && (!v0[80] || !a1[201]) && (!v0[81] || !a1[200]) && (!v0[81] || !a1[201])) { if (v0[16] == 1 || v0[16] == 2) v20 = does_replace(a1, &a1[192], v0, v0 + 72); if ((v20 || v0[16] != 1 && v0[16] != 2) && !(v0[80] ^ 1)) { v20 = in_force(0x100000); if (!v20 && !(v0[81] ^ 1)) v20 = in_force(0x8000000); } } } if (...) { if (*(v0[312]) && *(v0[312]) != 3) do_internerr("archives.c", 0x55d, "check_conflict", "package %s to be fixed by removal is not to be normal nor deconfigure, is to be %d", pkg_name(a1, 0x3)); *(v0[312]) = 1; notice(gettext("considering removing %s in favour of %s ..."), pkg_name(v0, 0x1), pkgbin_name(a1, &a1[192], 0x1, &a1[192]), v21); if (v0[24] != 7 && v0[24] != 6 && v0[24] != 5) { notice(gettext("%s is not properly installed; ignoring any dependencies on it"), pkg_name(v0, 0x1), a2, v21); v1 = 0; } if (v0[24] == 6 || v0[24] == 7 || v0[24] == 5) { for (v1 = *((*(v0) + 408)); v1; v1 = v1->field_18) { if (v1->field_0->field_18 == 2 || v1->field_0->field_18 == 3) { v20 = depisok(v1->field_0, &v6, 0x0, 0x0, 0x0); if (!v20) { varbuf_end_str(&v6); v20 = try_remove_can(v1, v0, v8); if (!v20) break; } } } if (!v1) { for (v2 = v0[72]; v2; v2 = v2->field_8) { if (v2->field_18 == 6) { for (v1 = v2->field_10->field_8->field_198; v1; v1 = v1[24]) { if (v1->field_0->field_18 == 2 || v1->field_0->field_18 == 3) { v20 = depisok(*(v1), &v6, 0x0, 0x0, 0x0); if (!v20) { varbuf_end_str(&v6); notice(gettext("may have trouble removing %s, as it provides %s ..."), pkg_name(v0, 0x1), v2->field_10->field_8->field_8, 0x0); v20 = try_remove_can(v1, v0, v8); if (!v20) break; } } } if (!v20 && !v20) break; } } } } if (!v1) { v20 = skip_due_to_hold(v0); if (v20) v1 = &v9; } if (!v1 && (v0[20] & 1)) { v20 = in_force(0x200000); if (v20) { notice(gettext("package %s requires reinstallation, but will remove anyway as you requested"), pkg_name(v0, 0x1), a2, v21); } else { notice(gettext("package %s requires reinstallation, will not remove"), pkg_name(v0, 0x1), a2, v21); v1 = &v9; } } if (!v1) { enqueue_conflictor(v0); varbuf_destroy(&v3); varbuf_destroy(&v6); notice(gettext("yes, will remove %s in favour of %s"), pkg_name(v0, 0x1), pkgbin_name(a1, &a1[192], 0x1, &a1[192]), v21); } else { *(v0[312]) = 0; } } if (...) { varbuf_end_str(&v3); notice(gettext("regarding %s containing %s:\n%s"), a2, pkgbin_name(a1, &a1[192], 0x1, &a1[192]), v5); *(&v20) = force_conflicts(a0[2]) ^ 1; if (v20) ohshit(gettext("conflicting packages - not installing %.250s"), pkgbin_name(a1, &a1[192], 0x1, &a1[192]), 0x1); warning(gettext("ignoring conflict, may proceed anyway!"), a1, a2, v21); varbuf_destroy(&v3); } } return 0; }
static void __ipstats_show_hw_s_info_one(const struct ipstats_hw_s_info_one *hwsio) { if (hwsio == ((void *)0) ) return; ipstats_print_moo(PRINT_ANY, "request", " %s", hwsio->request); ipstats_print_moo(PRINT_ANY, "used", " used %s", hwsio->used); }
void __ipstats_show_hw_s_info_one(undefined4 *param_1) { if (param_1 != (undefined4 *)0x0) { ipstats_print_moo(4,"request",&DAT_001031b8,*param_1); ipstats_print_moo(4,&DAT_001031b0," used %s",param_1[1]); } return; }
static int save_route(struct nlmsghdr *n, void *arg) { int ret; int len = n->nlmsg_len; struct rtmsg *r = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); struct rtattr *tb[(__RTA_MAX - 1)+1]; int host_len; host_len = af_bit_len(r->rtm_family); len -= ((sizeof(*r)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))); parse_rtattr(tb, (__RTA_MAX - 1), ((struct rtattr*)(((char*)(r)) + ( ((sizeof(struct rtmsg))+4U -1) & ~(4U -1) ))), len); if (!filter_nlmsg(n, tb, host_len)) return 0; ret = write( 1 , n, n->nlmsg_len); if ((ret > 0) && (ret != n->nlmsg_len)) { fprintf( stderr , "Short write while saving nlmsg\n"); ret = - 5 ; } return ret == n->nlmsg_len ? 0 : ret; }
long long save_route(unsigned int *a0, unsigned long a1) { unsigned long v0; unsigned int v1; unsigned int v2; unsigned int v3; char *v4; char v5; void* v8; v0 = a1; v2 = *(a0); v4 = &a0[4]; v3 = af_bit_len(*(v4)); v2 -= 28; parse_rtattr(&v5, 0x1e, v4 + 12, v2); if (!filter_nlmsg(a0, &v5, v3)) { v8 = 0; } else { v1 = write(0x1, a0, *(a0)); if (v1 > 0 && *(a0) != v1) { fprintf(stderr, "Short write while saving nlmsg\n"); v1 = -5; } if (*(a0) != v1) v8 = v1; else v8 = 0; } return v8; }
int main (int argc, char **argv) { ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdout); parse_gnu_standard_options_only (argc, argv, "users", "GNU coreutils", Version, 1 , usage, ("Joseph Arceneaux"), ("David MacKenzie"), (char const *) ((void *)0) ); switch (argc - optind) { case 0: users ( "/var/run/utmp" , READ_UTMP_CHECK_PIDS); break; case 1: users (argv[optind], 0); break; default: error (0, 0, gettext ("extra operand %s"), quote (argv[optind + 1])); usage ( 1 ); } return 0 ; }
undefined8 main(int param_1,undefined8 *param_2) { undefined8 uVar1; undefined8 uVar2; set_program_name(*param_2); setlocale(6,""); bindtextdomain("coreutils","/usr/local/share/locale"); textdomain("coreutils"); atexit(p_Ram0000000000100610); parse_gnu_standard_options_only (param_1,param_2,"users","GNU coreutils",Version,1,usage,"Joseph Arceneaux", "David MacKenzie",0); if (param_1 == optind) { users("/var/run/utmp",1); } else if (param_1 - optind == 1) { users(param_2[optind],0); } else { uVar1 = quote(param_2[(long)optind + 1]); uVar2 = gettext("extra operand %s"); error(0,0,uVar2,uVar1); usage(1); } return 0; }
static int rule_dump_check_magic(void) { int ret; __u32 magic = 0; if (isatty( 0 )) { fprintf( stderr , "Can't restore rule dump from a terminal\n"); return -1; } ret = fread(&magic, sizeof(magic), 1, stdin ); if (magic != rule_dump_magic) { fprintf( stderr , "Magic mismatch (%d elems, %x magic)\n", ret, magic); return -1; } return 0; }
undefined8 rule_dump_check_magic(void) { int iVar1; undefined8 uVar2; size_t sVar3; long in_FS_OFFSET; uint local_18; undefined4 local_14; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_18 = 0; iVar1 = isatty(0); if (iVar1 == 0) { sVar3 = fread(&local_18,4,1,stdin); local_14 = (undefined4)sVar3; if (local_18 == rule_dump_magic) { uVar2 = 0; } else { fprintf(stderr,"Magic mismatch (%d elems, %x magic)\n",sVar3 & 0xffffffff,(ulong)local_18); uVar2 = 0xffffffff; } } else { fprintf(stderr,"Can\'t restore rule dump from a terminal\n"); uVar2 = 0xffffffff; } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar2; }
int get_latch_flags(int mask, int *value) { struct latch_descr *ldesc; ldesc = find_latch(mask); if (!ldesc) return -1; *value = ldesc->flags; return 0; }
undefined8 get_latch_flags(undefined4 param_1,undefined4 *param_2) { long lVar1; undefined8 uVar2; lVar1 = find_latch(param_1); if (lVar1 == 0) { uVar2 = 0xffffffff; } else { *param_2 = *(undefined4 *)(lVar1 + 0xc); uVar2 = 0; } return uVar2; }
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; unsigned long 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; unsigned long long v19; unsigned long long v20; unsigned long v21; unsigned long long v22; unsigned long v23; unsigned long long v24; unsigned long long v25; unsigned long long *v26; unsigned long long v28; unsigned long v29; unsigned long long v30; 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; } v28 = stat(&identity_file, &v14); if (v28) { 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 && (a4 || a3)) { v28 = strlcpy(&v16, &identity_file, 0x1000); if (v28 <= 4095) { v28 = strlcat(&v16, ".XXXXXXXXXX", 0x1000, a3); if (v28 <= 4095) { v28 = strlcpy(&v18, &identity_file, 0x1000); if (v28 <= 4095) v28 = strlcat(&v18, ".old", 0x1000, a3); } } if (v28 > 4095 || v28 > 4095 || v28 > 4095 || v28 > 4095) { v22 = "known_hosts path too long"; sshfatal("ssh-keygen.c", "do_known_hosts", 0x533, 0x0, 0x1, 0x0, *(&v24)); } 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; } v3 = a2; if (print_fingerprint) v28 = 2; else v28 = 0; v3 |= v28; if (!a2 && a4) v29 = known_hosts_hash; if (!a4 || a2) v29 = known_hosts_find_delete; v22 = 0; v4 = hostkeys_foreach(&identity_file, v29, &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); } if ((!a3 || *(&v9)) && v0) { v30 = unlink(&v18); if (v30 == -1) { *(&v30) = *(__errno_location()); if (v30 != 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)); } v29 = rename(&v16, &identity_file); if (v29 == -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); } } if (!v0 || v29 != -1 || !*(&v9) && a3) { if (a2 && !*(&v9)) *(&v29) = 1; if (!a2 || *(&v9)) *(&v29) = 0; exit(v29); } } }
static struct cpelement * cpl_delete (pid) pid_t pid; { struct cpelement *prev, *p; for (prev = p = coproc_list.head; p; prev = p, p = p->next) if (p->coproc->c_pid == pid) { prev->next = p->next; break; } if (p == 0) return 0; ; if (p == coproc_list.head) coproc_list.head = coproc_list.head->next; else if (p == coproc_list.tail) coproc_list.tail = prev; coproc_list.ncoproc--; if (coproc_list.ncoproc == 0) coproc_list.head = coproc_list.tail = 0; else if (coproc_list.ncoproc == 1) coproc_list.tail = coproc_list.head; return (p); }
long long cpl_delete(unsigned long a0) { void* v0; void* v1; void* v3; v1 = coproc_list; v0 = v1; while (true) { if (!v1) break; if (a0 != *((v1[8] + 8))) { v0 = v1; v1 = *(v1); } else { *(v0) = *(v1); break; } } if (!v1) { v3 = 0; return v3; } if (v1 == coproc_list) { coproc_list = *(coproc_list); } else if (v1 == g_40b118) { g_40b118 = v0; } g_40b120 = g_40b120 - 1; switch (g_40b120) { case 0: g_40b118 = 0; coproc_list = g_40b118; break; case 1: g_40b118 = coproc_list; break; default: goto LABEL_402b03; } LABEL_402b03: v3 = v1; return v3; }
static int execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close) COMMAND *command; int asynchronous, pipe_in, pipe_out; struct fd_bitmap *fds_to_close; { int prev, fildes[2], new_bitmap_size, dummyfd, ignore_return, exec_result; int lstdin, lastpipe_flag, lastpipe_jid, old_frozen, stdin_valid; COMMAND *cmd; struct fd_bitmap *fd_bitmap; pid_t lastpid; sigset_t set, oset; do { sigemptyset (&set); sigaddset (&set, 17 ); sigemptyset (&oset); sigprocmask ( 0 , &set, &oset); } while (0); ignore_return = (command->flags & 0x08) != 0; stdin_valid = sh_validfd (0); prev = pipe_in; cmd = command; while (cmd && cmd->type == cm_connection && cmd->value.Connection && cmd->value.Connection->connector == '|') { if (pipe (fildes) < 0) { sys_error (gettext("pipe error")); terminate_current_pipeline (); kill_current_pipeline (); sigprocmask ( 2 , &oset, (sigset_t *) ((void *)0) ); last_command_exit_value = 1; throw_to_top_level (); return (1); } new_bitmap_size = (fildes[0] < fds_to_close->size) ? fds_to_close->size : fildes[0] + 8; fd_bitmap = new_fd_bitmap (new_bitmap_size); xbcopy ((char *)fds_to_close->bitmap, (char *)fd_bitmap->bitmap, fds_to_close->size); fd_bitmap->bitmap[fildes[0]] = 1; begin_unwind_frame ("pipe-file-descriptors"); add_unwind_protect (dispose_fd_bitmap, fd_bitmap); add_unwind_protect (close_fd_bitmap, fd_bitmap); if (prev >= 0) add_unwind_protect (close, prev); dummyfd = fildes[1]; add_unwind_protect (close, dummyfd); add_unwind_protect (restore_signal_mask, &oset); if (ignore_return && cmd->value.Connection->first) cmd->value.Connection->first->flags |= 0x08; execute_command_internal (cmd->value.Connection->first, asynchronous, prev, fildes[1], fd_bitmap); if (prev >= 0) close (prev); prev = fildes[0]; close (fildes[1]); dispose_fd_bitmap (fd_bitmap); discard_unwind_frame ("pipe-file-descriptors"); cmd = cmd->value.Connection->second; } lastpid = last_made_pid; if (ignore_return && cmd) cmd->flags |= 0x08; lastpipe_flag = 0; begin_unwind_frame ("lastpipe-exec"); lstdin = -2; if (lastpipe_opt && job_control == 0 && asynchronous == 0 && pipe_out == -1 && prev >= 0) { lstdin = (prev > 0 && stdin_valid) ? move_to_high_fd (0, 1, -1) : -1; if (lstdin > 0 || lstdin == -1) { do_piping (prev, pipe_out); prev = -1; add_unwind_protect (restore_stdin, lstdin); lastpipe_flag = 1; old_frozen = freeze_jobs_list (); lastpipe_jid = stop_pipeline (0, (COMMAND *) ((void *)0) ); add_unwind_protect (lastpipe_cleanup, old_frozen); sigprocmask ( 2 , &oset, (sigset_t *) ((void *)0) ); } if (cmd) cmd->flags |= 0x2000; } if (prev >= 0) add_unwind_protect (close, prev); exec_result = execute_command_internal (cmd, asynchronous, prev, pipe_out, fds_to_close); if (prev >= 0) close (prev); if (lstdin > 0 || lstdin == -1) restore_stdin (lstdin); sigprocmask ( 2 , &oset, (sigset_t *) ((void *)0) ); do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0); if (lastpipe_flag) { if (((lastpipe_jid) < 0 || (lastpipe_jid) >= js.j_jobslots || (jobs[(lastpipe_jid)]) == 0) == 0) { append_process ((char *)strcpy (sh_xmalloc((1 + strlen (the_printed_command_except_trap)), "execute_cmd.c", 2654), (the_printed_command_except_trap)), dollar_dollar_pid, exec_result, lastpipe_jid); lstdin = wait_for (lastpid, 0); } else { lstdin = wait_for_single_pid (lastpid, 0); if (lstdin > 256) lstdin = 127; } if (((lastpipe_jid) < 0 || (lastpipe_jid) >= js.j_jobslots || (jobs[(lastpipe_jid)]) == 0) == 0) exec_result = job_exit_status (lastpipe_jid); else if (pipefail_opt) exec_result = exec_result | lstdin; set_jobs_list_frozen (old_frozen); } discard_unwind_frame ("lastpipe-exec"); return (exec_result); }
long execute_pipeline(long a1, unsigned int a2, int a3, unsigned int a4, int *a5) { char *v5; int v7; int v8; int v9; unsigned int v11; const char *v12; size_t v13; char *v14; char *v15; int fd; unsigned int v21; int v22; int v23; int v24; int v25; unsigned int v26; _BOOL4 v27; int v28; unsigned int v29; long i; long v31; int pipedes[2]; sigset_t set; sigset_t oset; unsigned long v35; v35 = __readfsqword(0x28u); sigemptyset(&set); sigaddset(&set, 17); sigemptyset(&oset); sigprocmask(0, &set, &oset); v27 = (*(_DWORD *)(a1 + 4) & 8) != 0; v28 = sh_validfd(0LL); fd = a3; for ( i = a1; i && *(_DWORD *)i == 6 && *(_QWORD *)(i + 24) && *(_DWORD *)(*(_QWORD *)(i + 24) + 24LL) == 124; i = *(_QWORD *)(*(_QWORD *)(i + 24) + 16LL) ) { if ( pipe(pipedes) < 0 ) { v5 = gettext("pipe error"); sys_error(v5); terminate_current_pipeline(); kill_current_pipeline(); sigprocmask(2, &oset, 0LL); last_command_exit_value = 1; throw_to_top_level(); return 1LL; } if ( pipedes[0] >= *a5 ) v7 = pipedes[0] + 8; else v7 = *a5; v31 = new_fd_bitmap(v7); xbcopy(*((_QWORD *)a5 + 1), *(_QWORD *)(v31 + 8), (unsigned int)*a5); *(_BYTE *)(*(_QWORD *)(v31 + 8) + pipedes[0]) = 1; begin_unwind_frame("pipe-file-descriptors"); add_unwind_protect(dispose_fd_bitmap, v31); add_unwind_protect(close_fd_bitmap, v31); if ( fd >= 0 ) add_unwind_protect(&close, (unsigned int)fd); add_unwind_protect(&close, (unsigned int)pipedes[1]); add_unwind_protect(restore_signal_mask, &oset); if ( v27 && *(_QWORD *)(*(_QWORD *)(i + 24) + 8LL) ) *(_DWORD *)(*(_QWORD *)(*(_QWORD *)(i + 24) + 8LL) + 4LL) |= 8u; execute_command_internal(*(unsigned int **)(*(_QWORD *)(i + 24) + 8LL), a2, fd, pipedes[1], (unsigned int *)v31); if ( fd >= 0 ) close(fd); fd = pipedes[0]; close(pipedes[1]); dispose_fd_bitmap(v31); discard_unwind_frame("pipe-file-descriptors"); } v29 = last_made_pid; if ( v27 && i ) *(_DWORD *)(i + 4) |= 8u; v24 = 0; begin_unwind_frame("lastpipe-exec"); v22 = -2; if ( lastpipe_opt && !job_control && !a2 && a4 == -1 && fd >= 0 ) { if ( fd > 0 && v28 ) v8 = move_to_high_fd(0LL, 1LL, 0xFFFFFFFFLL); else v8 = -1; v22 = v8; if ( v8 > 0 || v8 == -1 ) { do_piping(fd, -1); fd = -1; add_unwind_protect(restore_stdin, (unsigned int)v22); v24 = 1; v26 = freeze_jobs_list(); v25 = stop_pipeline(0LL, 0LL); add_unwind_protect(lastpipe_cleanup, v26); sigprocmask(2, &oset, 0LL); } if ( i ) { v9 = *(_DWORD *)(i + 4); BYTE1(v9) |= 0x20u; *(_DWORD *)(i + 4) = v9; } } if ( fd >= 0 ) add_unwind_protect(&close, (unsigned int)fd); v21 = execute_command_internal((unsigned int *)i, a2, fd, a4, (unsigned int *)a5); if ( fd >= 0 ) close(fd); if ( v22 > 0 || v22 == -1 ) restore_stdin(v22); sigprocmask(2, &oset, 0LL); if ( terminating_signal ) termsig_handler(terminating_signal); if ( interrupt_state ) throw_to_top_level(); if ( v24 ) { if ( v25 < 0 || v25 >= js[7] || !*(_QWORD *)(8LL * v25 + jobs) ) { v23 = wait_for_single_pid(v29, 0LL); if ( v23 > 256 ) v23 = 127; } else { v11 = dollar_dollar_pid; v12 = the_printed_command_except_trap; v13 = strlen(the_printed_command_except_trap); v14 = (char *)sh_xmalloc(v13 + 1, "execute_cmd.c", 2654LL); v15 = strcpy(v14, v12); append_process(v15, v11, v21, (unsigned int)v25); v23 = wait_for(v29, 0LL); } if ( v25 < 0 || v25 >= js[7] || !*(_QWORD *)(8LL * v25 + jobs) ) { if ( pipefail_opt ) v21 |= v23; } else { v21 = job_exit_status((unsigned int)v25); } set_jobs_list_frozen(v26); } discard_unwind_frame("lastpipe-exec"); return v21; }
static int strtoul_tcflag_t (char const *s, int base, char **p, tcflag_t *result, char delim) { unsigned long ul; (*__errno_location ()) = 0; ul = strtoul (s, p, base); if ( (*__errno_location ()) || **p != delim || *p == s || (tcflag_t) ul != ul) return -1; *result = ul; return 0; }
int strtoul_tcflag_t(unsigned long long a0, unsigned long a1, char **a2, unsigned int *a3, unsigned long a4) { unsigned long v0; unsigned int v3; *(__errno_location()) = 0; v0 = strtoul(a0, a2, a1, a2); if (*(__errno_location())) { LABEL_403475: v3 = -1; } else { if (!(a4 == *(*(a2)))) goto LABEL_403475; if (a0 == *(a2)) goto LABEL_403475; if (!(v0 == v0)) goto LABEL_403475; *(a3) = v0; v3 = 0; } return v3; }
static void deferred_configure_conffile(struct pkginfo *pkg, struct conffile *conff) { struct fsys_namenode *usenode; char currenthash[32 + 1], newdisthash[32 + 1]; int useredited, distedited; enum conffopt what; struct stat stab; struct varbuf cdr = { 0, 0, ((void *)0) }, cdr2 = { 0, 0, ((void *)0) }; char *cdr2rest; int rc; usenode = namenodetouse(fsys_hash_find_node(conff->name, FHFF_NOCOPY), pkg, &pkg->installed); rc = conffderef(pkg, &cdr, usenode->name); if (rc == -1) { conff->hash = "-"; return; } md5hash(pkg, currenthash, cdr.buf); varbuf_reset(&cdr2); varbuf_add_buf(&cdr2, cdr.buf, strlen(cdr.buf)); varbuf_end_str(&cdr2); varbuf_grow(&cdr2, 50); cdr2rest = cdr2.buf + strlen(cdr.buf); strcpy(cdr2rest, ".dpkg-new"); if (lstat(cdr2.buf, &stab)) { if ( (*__errno_location ()) == 2 ) { deferred_configure_ghost_conffile(pkg, conff); return; } ohshite(gettext("unable to stat new distributed conffile '%.250s'"), cdr2.buf); } md5hash(pkg, newdisthash, cdr2.buf); if (!stat(cdr.buf, &stab)) file_copy_perms(cdr.buf, cdr2.buf); else if ( (*__errno_location ()) != 2 ) ohshite(gettext("unable to stat current installed conffile '%.250s'"), cdr.buf); if (strcmp(currenthash, newdisthash) == 0) { useredited = -1; distedited = -1; what = CFO_IDENTICAL; } else if (strcmp(currenthash, "nonexistent") == 0 && in_force(FORCE_CONFF_MISS)) { fprintf( stderr , gettext("\n" "Configuration file '%s', does not exist on system.\n" "Installing new config file as you requested.\n") , usenode->name); what = CFO_NEW_CONFF; useredited = -1; distedited = -1; } else if (strcmp(conff->hash, "newconffile") == 0) { if (strcmp(currenthash, "nonexistent") == 0) { what = CFO_NEW_CONFF; useredited = -1; distedited = -1; } else { useredited = 1; distedited = 1; what = conffoptcells[useredited][distedited] | CFOF_IS_NEW; } } else { useredited = strcmp(conff->hash, currenthash) != 0; distedited = strcmp(conff->hash, newdisthash) != 0; if (in_force(FORCE_CONFF_ASK) && useredited) what = CFO_PROMPT_KEEP; else what = conffoptcells[useredited][distedited]; if (strcmp(currenthash, "nonexistent") == 0) what |= CFOF_USER_DEL; } debug(dbg_conff, "deferred_configure '%s' (= '%s') useredited=%d distedited=%d what=%o", usenode->name, cdr.buf, useredited, distedited, what); what = promptconfaction(pkg, usenode->name, cdr.buf, cdr2.buf, useredited, distedited, what); switch (what & ~(CFOF_IS_NEW | CFOF_USER_DEL)) { case CFO_KEEP | CFOF_BACKUP: strcpy(cdr2rest, ".dpkg-old"); if (unlink(cdr2.buf) && (*__errno_location ()) != 2 ) warning(gettext("%s: failed to remove old backup '%.250s': %s"), pkg_name(pkg, pnaw_nonambig), cdr2.buf, strerror( (*__errno_location ()) )); varbuf_add_buf(&cdr, ".dpkg-dist", strlen(".dpkg-dist")); varbuf_end_str(&cdr); strcpy(cdr2rest, ".dpkg-new"); trig_path_activate(usenode, pkg); if (rename(cdr2.buf, cdr.buf)) warning(gettext("%s: failed to rename '%.250s' to '%.250s': %s"), pkg_name(pkg, pnaw_nonambig), cdr2.buf, cdr.buf, strerror( (*__errno_location ()) )); break; case CFO_KEEP: strcpy(cdr2rest, ".dpkg-new"); if (unlink(cdr2.buf)) warning(gettext("%s: failed to remove '%.250s': %s"), pkg_name(pkg, pnaw_nonambig), cdr2.buf, strerror( (*__errno_location ()) )); break; case CFO_INSTALL | CFOF_BACKUP: strcpy(cdr2rest, ".dpkg-dist"); if (unlink(cdr2.buf) && (*__errno_location ()) != 2 ) warning(gettext("%s: failed to remove old distributed version '%.250s': %s"), pkg_name(pkg, pnaw_nonambig), cdr2.buf, strerror( (*__errno_location ()) )); strcpy(cdr2rest, ".dpkg-old"); if (unlink(cdr2.buf) && (*__errno_location ()) != 2 ) warning(gettext("%s: failed to remove '%.250s' (before overwrite): %s"), pkg_name(pkg, pnaw_nonambig), cdr2.buf, strerror( (*__errno_location ()) )); if (!(what & CFOF_USER_DEL)) if (link(cdr.buf, cdr2.buf)) warning(gettext("%s: failed to link '%.250s' to '%.250s': %s"), pkg_name(pkg, pnaw_nonambig), cdr.buf, cdr2.buf, strerror( (*__errno_location ()) )); case CFO_INSTALL: printf(gettext("Installing new version of config file %s ...\n"), usenode->name); case CFO_NEW_CONFF: strcpy(cdr2rest, ".dpkg-new"); trig_path_activate(usenode, pkg); if (rename(cdr2.buf, cdr.buf)) ohshite(gettext("unable to install '%.250s' as '%.250s'"), cdr2.buf, cdr.buf); break; default: do_internerr("configure.c", 526, __func__, "unknown conffopt '%d'", what); } conff->hash = nfstrsave(newdisthash); modstatdb_note(pkg); varbuf_destroy(&cdr); varbuf_destroy(&cdr2); }
unsigned long deferred_configure_conffile(_QWORD *a1, long a2) { long node; size_t v3; char *v4; char *v5; long v6; char *v7; unsigned int v8; int *v9; char *v10; char *v11; long v12; char *v13; size_t v14; int *v15; char *v16; char *v17; long v18; char *v19; int *v20; char *v21; char *v22; long v23; char *v24; int *v25; char *v26; char *v27; long v28; char *v29; int *v30; char *v31; char *v32; long v33; char *v34; int *v35; char *v36; char *v37; long v38; char *v39; long v40; char *v41; char *v42; unsigned int v44; unsigned int v45; unsigned int v46; unsigned int v47; long v48; char *dest; long v50[2]; char *s; long v52[2]; char *file; struct stat v54; char s1[48]; char s2[40]; unsigned long v57; v57 = __readfsqword(0x28u); v50[0] = 0LL; v50[1] = 0LL; s = 0LL; v52[0] = 0LL; v52[1] = 0LL; file = 0LL; node = fsys_hash_find_node(*(_QWORD *)(a2 + 8), 1LL); v48 = namenodetouse(node, a1, a1 + 9); if ( (unsigned int)conffderef((long)a1, (long)v50, *(const char **)(v48 + 8)) == -1 ) { *(_QWORD *)(a2 + 16) = "-"; } else { md5hash((long)a1, s1, s); varbuf_reset(v52); v3 = strlen(s); varbuf_add_buf(v52, s, v3); varbuf_end_str(v52); varbuf_grow(v52, 50LL); dest = &file[strlen(s)]; strcpy(dest, ".dpkg-new"); if ( lstat(file, &v54) ) { if ( *_errno_location() == 2 ) { deferred_configure_ghost_conffile(a1, a2); return __readfsqword(0x28u) ^ v57; } v4 = gettext("unable to stat new distributed conffile '%.250s'"); ohshite(v4); } md5hash((long)a1, s2, file); if ( stat(s, &v54) ) { if ( *_errno_location() != 2 ) { v5 = gettext("unable to stat current installed conffile '%.250s'"); ohshite(v5); } } else { file_copy_perms(s, file); } if ( !strcmp(s1, s2) ) { v44 = -1; v45 = -1; v46 = 2; } else if ( !strcmp(s1, "nonexistent") && (unsigned char)in_force(128LL) ) { v6 = *(_QWORD *)(v48 + 8); v7 = gettext("\nConfiguration file '%s', does not exist on system.\nInstalling new config file as you requested.\n"); fprintf(stderr, v7, v6); v46 = 20; v44 = -1; v45 = -1; } else if ( !strcmp(*(const char **)(a2 + 16), "newconffile") ) { if ( !strcmp(s1, "nonexistent") ) { v46 = 20; v44 = -1; v45 = -1; } else { v44 = 1; v45 = 1; v46 = conffoptcells[3] | 0x20; } } else { v44 = strcmp(*(const char **)(a2 + 16), s1) != 0; v45 = strcmp(*(const char **)(a2 + 16), s2) != 0; if ( (unsigned char)in_force(32LL) && v44 ) v46 = 3; else v46 = conffoptcells[2 * v44 + v45]; if ( !strcmp(s1, "nonexistent") ) v46 |= 0x80u; } debug( 16LL, "deferred_configure '%s' (= '%s') useredited=%d distedited=%d what=%o", *(const char **)(v48 + 8), s, v44, v45, v46); v8 = promptconfaction((long)a1, *(const char **)(v48 + 8), s, file, v44, v45, v46); v47 = v8; LOBYTE(v8) = v8 & 0x5F; switch ( v8 ) { case 2u: strcpy(dest, ".dpkg-new"); if ( unlink(file) ) { v20 = _errno_location(); v21 = strerror(*v20); v22 = file; v23 = pkg_name(a1, 1LL); v24 = gettext("%s: failed to remove '%.250s': %s"); warning(v24, v23, v22, v21); } goto LABEL_47; case 4u: goto LABEL_43; case 0xAu: strcpy(dest, ".dpkg-old"); if ( unlink(file) && *_errno_location() != 2 ) { v9 = _errno_location(); v10 = strerror(*v9); v11 = file; v12 = pkg_name(a1, 1LL); v13 = gettext("%s: failed to remove old backup '%.250s': %s"); warning(v13, v12, v11, v10); } v14 = strlen(".dpkg-dist"); varbuf_add_buf(v50, ".dpkg-dist", v14); varbuf_end_str(v50); strcpy(dest, ".dpkg-new"); trig_path_activate(v48, a1); if ( rename(file, s) ) { v15 = _errno_location(); strerror(*v15); v16 = s; v17 = file; v18 = pkg_name(a1, 1LL); v19 = gettext("%s: failed to rename '%.250s' to '%.250s': %s"); warning(v19, v18, v17, v16); } goto LABEL_47; case 0xCu: strcpy(dest, ".dpkg-dist"); if ( unlink(file) && *_errno_location() != 2 ) { v25 = _errno_location(); v26 = strerror(*v25); v27 = file; v28 = pkg_name(a1, 1LL); v29 = gettext("%s: failed to remove old distributed version '%.250s': %s"); warning(v29, v28, v27, v26); } strcpy(dest, ".dpkg-old"); if ( unlink(file) && *_errno_location() != 2 ) { v30 = _errno_location(); v31 = strerror(*v30); v32 = file; v33 = pkg_name(a1, 1LL); v34 = gettext("%s: failed to remove '%.250s' (before overwrite): %s"); warning(v34, v33, v32, v31); } if ( (v47 & 0x80) == 0 && link(s, file) ) { v35 = _errno_location(); strerror(*v35); v36 = file; v37 = s; v38 = pkg_name(a1, 1LL); v39 = gettext("%s: failed to link '%.250s' to '%.250s': %s"); warning(v39, v38, v37, v36); } LABEL_43: v40 = *(_QWORD *)(v48 + 8); v41 = gettext("Installing new version of config file %s ...\n"); printf(v41, v40); goto LABEL_44; case 0x14u: LABEL_44: strcpy(dest, ".dpkg-new"); trig_path_activate(v48, a1); if ( !rename(file, s) ) goto LABEL_47; v42 = gettext("unable to install '%.250s' as '%.250s'"); ohshite(v42); LABEL_46: do_internerr("configure.c", 526LL, "deferred_configure_conffile", "unknown conffopt '%d'", v47); LABEL_47: *(_QWORD *)(a2 + 16) = nfstrsave(s2); modstatdb_note(a1); varbuf_destroy(v50); varbuf_destroy(v52); break; default: goto LABEL_46; } } return __readfsqword(0x28u) ^ v57; }
static struct sshbuf * process_enroll(struct sshbuf *req) { int r; u_int type; char *provider, *application, *pin, *device, *userid; uint8_t flags; struct sshbuf *challenge, *attest, *kbuf, *resp; struct sshkey *key; if ((attest = sshbuf_new()) == ((void *)0) || (kbuf = sshbuf_new()) == ((void *)0) ) sshfatal("ssh-sk-helper.c", __func__, 161, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: sshbuf_new failed", __progname); if ((r = sshbuf_get_u32(req, &type)) != 0 || (r = sshbuf_get_cstring(req, &provider, ((void *)0) )) != 0 || (r = sshbuf_get_cstring(req, &device, ((void *)0) )) != 0 || (r = sshbuf_get_cstring(req, &application, ((void *)0) )) != 0 || (r = sshbuf_get_cstring(req, &userid, ((void *)0) )) != 0 || (r = sshbuf_get_u8(req, &flags)) != 0 || (r = sshbuf_get_cstring(req, &pin, ((void *)0) )) != 0 || (r = sshbuf_froms(req, &challenge)) != 0) sshfatal("ssh-sk-helper.c", __func__, 171, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s: parse", __progname); if (sshbuf_len(req) != 0) sshfatal("ssh-sk-helper.c", __func__, 173, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: trailing data in request", __progname); if (type > 0x7fffffff) sshfatal("ssh-sk-helper.c", __func__, 176, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: bad type %u", __progname, type); if (sshbuf_len(challenge) == 0) { sshbuf_free(challenge); challenge = ((void *)0) ; } null_empty(&device); null_empty(&userid); null_empty(&pin); if ((r = sshsk_enroll((int)type, provider, device, application, userid, flags, pin, challenge, &key, attest)) != 0) { resp = reply_error(r, "Enrollment failed: %s", ssh_err(r)); goto out; } if ((resp = sshbuf_new()) == ((void *)0) ) sshfatal("ssh-sk-helper.c", __func__, 192, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: sshbuf_new failed", __progname); if ((r = sshkey_private_serialize(key, kbuf)) != 0) sshfatal("ssh-sk-helper.c", __func__, 194, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s: encode key", __progname); if ((r = sshbuf_put_u32(resp, 2)) != 0 || (r = sshbuf_put_stringb(resp, kbuf)) != 0 || (r = sshbuf_put_stringb(resp, attest)) != 0) sshfatal("ssh-sk-helper.c", __func__, 198, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s: compose", __progname); out: sshkey_free(key); sshbuf_free(kbuf); sshbuf_free(attest); sshbuf_free(challenge); free(provider); free(application); if (pin != ((void *)0) ) freezero(pin, strlen(pin)); return resp; }
long process_enroll(undefined8 param_1) { undefined8 uVar1; long lVar2; undefined8 uVar3; size_t sVar4; char **ppcVar5; undefined *puVar6; undefined *puVar7; long in_FS_OFFSET; char *apcStack288 [6]; long lStack240; char *apcStack232 [2]; ulong auStack216 [2]; char *apcStack200 [6]; undefined auStack152 [8]; undefined8 local_90; undefined local_79; uint local_78; int local_74; void *local_70; void *local_68; char *local_60; undefined8 local_58; undefined8 local_50; undefined8 local_48; undefined8 local_40; long local_38; long local_30; long local_28; long local_20; ppcVar5 = (char **)auStack152; local_20 = *(long *)(in_FS_OFFSET + 0x28); apcStack200[5] = (char *)0x10076d; local_90 = param_1; local_30 = sshbuf_new(); if (local_30 == 0) { LAB_00100788: apcStack200[5] = (char *)__progname; ppcVar5 = apcStack200 + 4; apcStack200[4] = "%s: sshbuf_new failed"; sshfatal("ssh-sk-helper.c","process_enroll",0xa1,0,1,0); } else { apcStack200[5] = (char *)0x10077d; local_28 = sshbuf_new(); if (local_28 == 0) goto LAB_00100788; } *(undefined8 *)((long)ppcVar5 + -8) = 0x1007dc; local_74 = sshbuf_get_u32(local_90,&local_78); if (local_74 == 0) { *(undefined8 *)((long)ppcVar5 + -8) = 0x100804; local_74 = sshbuf_get_cstring(local_90,&local_70,0); if (local_74 != 0) goto LAB_001008e7; *(undefined8 *)((long)ppcVar5 + -8) = 0x10082c; local_74 = sshbuf_get_cstring(local_90,&local_58,0); if (local_74 != 0) goto LAB_001008e7; *(undefined8 *)((long)ppcVar5 + -8) = 0x100854; local_74 = sshbuf_get_cstring(local_90,&local_68,0); if (local_74 != 0) goto LAB_001008e7; *(undefined8 *)((long)ppcVar5 + -8) = 0x10087c; local_74 = sshbuf_get_cstring(local_90,&local_50,0); if (local_74 != 0) goto LAB_001008e7; *(undefined8 *)((long)ppcVar5 + -8) = 0x10089b; local_74 = sshbuf_get_u8(local_90,&local_79); if (local_74 != 0) goto LAB_001008e7; *(undefined8 *)((long)ppcVar5 + -8) = 0x1008bf; local_74 = sshbuf_get_cstring(local_90,&local_60,0); if (local_74 != 0) goto LAB_001008e7; *(undefined8 *)((long)ppcVar5 + -8) = 0x1008de; local_74 = sshbuf_froms(local_90,&local_48); puVar6 = (undefined *)ppcVar5; if (local_74 != 0) goto LAB_001008e7; } else { LAB_001008e7: uVar3 = __progname; *(undefined8 *)((long)ppcVar5 + -8) = 0x1008f8; uVar1 = ssh_err(local_74); *(undefined8 *)((long)ppcVar5 + -8) = uVar3; puVar6 = (undefined *)((long)ppcVar5 + -0x10); *(char **)((long)ppcVar5 + -0x10) = "%s: parse"; *(undefined8 *)((long)ppcVar5 + -0x18) = 0x10092c; sshfatal("ssh-sk-helper.c","process_enroll",0xab,0,1,uVar1); } *(undefined8 *)(puVar6 + -8) = 0x10093b; lVar2 = sshbuf_len(local_90); puVar7 = puVar6; if (lVar2 != 0) { *(undefined8 *)(puVar6 + -8) = __progname; puVar7 = puVar6 + -0x10; *(char **)(puVar6 + -0x10) = "%s: trailing data in request"; *(undefined8 *)(puVar6 + -0x18) = 0x10097e; sshfatal("ssh-sk-helper.c","process_enroll",0xad,0,1,0); } puVar6 = puVar7; if ((int)local_78 < 0) { *(ulong *)(puVar7 + -0x10) = (ulong)local_78; *(undefined8 *)(puVar7 + -0x18) = __progname; puVar6 = puVar7 + -0x20; *(char **)(puVar7 + -0x20) = "%s: bad type %u"; *(undefined8 *)(puVar7 + -0x28) = 0x1009cb; sshfatal("ssh-sk-helper.c","process_enroll",0xb0,0,1,0); } *(undefined8 *)(puVar6 + -8) = 0x1009d7; lVar2 = sshbuf_len(local_48); if (lVar2 == 0) { *(undefined8 *)(puVar6 + -8) = 0x1009e8; sshbuf_free(local_48); local_48 = 0; } *(undefined8 *)(puVar6 + -8) = 0x1009fc; null_empty(&local_58); *(undefined8 *)(puVar6 + -8) = 0x100a08; null_empty(&local_50); *(undefined8 *)(puVar6 + -8) = 0x100a14; null_empty(&local_60); *(long *)(puVar6 + -8) = local_30; *(undefined8 **)(puVar6 + -0x10) = &local_40; *(undefined8 *)(puVar6 + -0x18) = local_48; *(char **)(puVar6 + -0x20) = local_60; *(undefined8 *)(puVar6 + -0x28) = 0x100a54; local_74 = sshsk_enroll(local_78,local_70,local_58,local_68,local_50,local_79); if (local_74 == 0) { *(undefined8 *)(puVar6 + -8) = 0x100a92; local_38 = sshbuf_new(); puVar7 = puVar6; if (local_38 == 0) { *(undefined8 *)(puVar6 + -8) = __progname; puVar7 = puVar6 + -0x10; *(char **)(puVar6 + -0x10) = "%s: sshbuf_new failed"; *(undefined8 *)(puVar6 + -0x18) = 0x100adb; sshfatal("ssh-sk-helper.c","process_enroll",0xc0,0,1,0); } *(undefined8 *)(puVar7 + -8) = 0x100aee; local_74 = sshkey_private_serialize(local_40,local_28); uVar3 = __progname; puVar6 = puVar7; if (local_74 != 0) { *(undefined8 *)(puVar7 + -8) = 0x100b08; uVar1 = ssh_err(local_74); *(undefined8 *)(puVar7 + -8) = uVar3; puVar6 = puVar7 + -0x10; *(char **)(puVar7 + -0x10) = "%s: encode key"; *(undefined8 *)(puVar7 + -0x18) = 0x100b3c; sshfatal("ssh-sk-helper.c","process_enroll",0xc2,0,1,uVar1); } *(undefined8 *)(puVar6 + -8) = 0x100b4d; local_74 = sshbuf_put_u32(local_38,2); if (local_74 == 0) { *(undefined8 *)(puVar6 + -8) = 0x100b69; local_74 = sshbuf_put_stringb(local_38,local_28); if (local_74 == 0) { *(undefined8 *)(puVar6 + -8) = 0x100b85; local_74 = sshbuf_put_stringb(local_38,local_30); puVar7 = puVar6; if (local_74 == 0) goto LAB_00100bd4; } } uVar3 = __progname; *(undefined8 *)(puVar6 + -8) = 0x100b9f; uVar1 = ssh_err(local_74); *(undefined8 *)(puVar6 + -8) = uVar3; puVar7 = puVar6 + -0x10; *(char **)(puVar6 + -0x10) = "%s: compose"; *(undefined8 *)(puVar6 + -0x18) = 0x100bd3; sshfatal("ssh-sk-helper.c","process_enroll",0xc6,0,1,uVar1); } else { *(undefined8 *)(puVar6 + -8) = 0x100a6b; uVar3 = ssh_err(local_74); *(undefined8 *)(puVar6 + -8) = 0x100a84; local_38 = reply_error(local_74,"Enrollment failed: %s",uVar3); puVar7 = puVar6; } LAB_00100bd4: *(undefined8 *)(puVar7 + -8) = 0x100be0; sshkey_free(local_40); *(undefined8 *)(puVar7 + -8) = 0x100bec; sshbuf_free(local_28); *(undefined8 *)(puVar7 + -8) = 0x100bf8; sshbuf_free(local_30); *(undefined8 *)(puVar7 + -8) = 0x100c04; sshbuf_free(local_48); *(undefined8 *)(puVar7 + -8) = 0x100c10; free(local_70); *(undefined8 *)(puVar7 + -8) = 0x100c1c; free(local_68); if (local_60 != (char *)0x0) { *(undefined8 *)(puVar7 + -8) = 0x100c31; sVar4 = strlen(local_60); *(undefined8 *)(puVar7 + -8) = 0x100c43; freezero(local_60,sVar4); } if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) { *(undefined8 *)(puVar7 + -8) = 0x100c5b; __stack_chk_fail(); } return local_38; }
static int openredirect(union node *redir) { struct stat64 sb; char *fname; int flags; int f; switch (redir->nfile.type) { case 18: flags = 00 ; do_open: f = sh_open(redir->nfile.expfname, flags, 0); break; case 19: flags = 02 | 0100 ; goto do_open; case 16: if (optlist[11]) { fname = redir->nfile.expfname; if (stat64(fname, &sb) < 0) { flags = 01 | 0100 | 0200 ; goto do_open; } if ( (((( sb.st_mode )) & 0170000) == (0100000)) ) goto ecreate; f = sh_open(fname, 01 , 0); if (!fstat64(f, &sb) && (((( sb.st_mode )) & 0170000) == (0100000)) ) { close(f); goto ecreate; } break; } case 17: flags = 01 | 0100 | 01000 ; goto do_open; case 20: flags = 01 | 0100 | 02000 ; goto do_open; case 21: case 22: f = redir->ndup.dupfd; if (f == redir->nfile.fd) f = -2; break; default: case 23: case 24: f = openhere(redir); break; } return f; ecreate: sh_open_fail(fname, 0100 , 17 ); }
long openredirect(long a1) { unsigned int fd; char *file; struct stat64 v5; unsigned long v6; v6 = __readfsqword(0x28u); switch ( *(_DWORD *)a1 ) { case 0x10: if ( !optlist[11] ) return (unsigned int)sh_open(*(const char **)(a1 + 32), 65, 0); file = *(char **)(a1 + 32); if ( stat64(file, &v5) >= 0 ) { if ( (v5.st_mode & 0xF000) != 0x8000 ) { fd = sh_open(file, 1, 0); if ( fstat64(fd, &v5) || (v5.st_mode & 0xF000) != 0x8000 ) return fd; close(fd); } sh_open_fail(file, 64, 0x11u); } return (unsigned int)sh_open(*(const char **)(a1 + 32), 193, 0); case 0x11: case 0x14: return (unsigned int)sh_open(*(const char **)(a1 + 32), 65, 0); case 0x12: return (unsigned int)sh_open(*(const char **)(a1 + 32), 0, 0); case 0x13: return (unsigned int)sh_open(*(const char **)(a1 + 32), 66, 0); case 0x15: case 0x16: fd = *(_DWORD *)(a1 + 20); if ( fd == *(_DWORD *)(a1 + 16) ) return (unsigned int)-2; return fd; default: return (unsigned int)openhere(a1); } }
static void hostkey_change_preamble(LogLevel loglevel) { sshlog("clientloop.c", __func__, 2002, 0, loglevel, ((void *)0) , "The server has updated its host keys."); sshlog("clientloop.c", __func__, 2003, 0, loglevel, ((void *)0) , "These changes were verified by the server's " "existing trusted key.") ; }
void hostkey_change_preamble(unsigned long a0) { unsigned long long v0; unsigned long long v2; v0 = "The server has updated its host keys."; sshlog("clientloop.c", "hostkey_change_preamble", 0x7d2, 0x0, a0, 0x0); v0 = "These changes were verified by the server's existing trusted key."; v2 = sshlog("clientloop.c", "hostkey_change_preamble", 0x7d3, 0x0, a0, 0x0); return; }
void xheader_xattr_init (struct tar_stat_info *st) { st->xattr_map = ((void *)0) ; st->xattr_map_size = 0; st->acls_a_ptr = ((void *)0) ; st->acls_a_len = 0; st->acls_d_ptr = ((void *)0) ; st->acls_d_len = 0; st->cntx_name = ((void *)0) ; }
long long xheader_xattr_init(unsigned long long a0[45]) { a0[44] = 0; a0[43] = 0; a0[7] = 0; a0[8] = 0; a0[9] = 0; a0[10] = 0; a0[6] = 0; return a0; }
) == ((void *)0) ) { nsyslog( 3 , "strdupa(): %s\n", strerror( (*__errno_location ()) )); return 0; }
void nsyslog(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,int param_9, char *param_10,undefined8 param_11,undefined8 param_12,undefined8 param_13, undefined8 param_14) { char in_AL; char *pcVar1; long in_FS_OFFSET; undefined4 local_d8; undefined4 local_d4; undefined *local_d0; undefined *local_c8; long local_c0; undefined local_b8 [16]; undefined8 local_a8; undefined8 local_a0; undefined8 local_98; undefined8 local_90; undefined4 local_88; undefined4 local_78; undefined4 local_68; undefined4 local_58; undefined4 local_48; undefined4 local_38; undefined4 local_28; undefined4 local_18; if (in_AL != '\0') { local_88 = param_1; local_78 = param_2; local_68 = param_3; local_58 = param_4; local_48 = param_5; local_38 = param_6; local_28 = param_7; local_18 = param_8; } local_c0 = *(long *)(in_FS_OFFSET + 0x28); local_d8 = 0x10; local_d4 = 0x30; local_d0 = &stack0x00000008; local_c8 = local_b8; local_a8 = param_11; local_a0 = param_12; local_98 = param_13; local_90 = param_14; pcVar1 = ttyname(0); if (pcVar1 == (char *)0x0) { vsyslog(param_9,param_10,&local_d8); } else { fprintf(stderr,"%s: ",progname); vfprintf(stderr,param_10,&local_d8); fprintf(stderr,"\n"); } if (local_c0 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
void gzclearerr(file) gzFile file; { gz_statep state; if (file == ((void *)0) ) return; state = (gz_statep)file; if (state->mode != 7247 && state->mode != 31153) return; if (state->mode == 7247) { state->eof = 0; state->past = 0; } gz_error(state, 0, ((void *)0) ); }
long long gzclearerr(unsigned int a0[22]) { unsigned long long v1; if (a0) { switch (a0[6]) { case 7247: LABEL_400bc3: if (a0[6] == 7247) { a0[20] = 0; a0[21] = 0; } v1 = gz_error(a0, 0x0, NULL); break; case 31153: v1 = a0[6]; break; default: v1 = a0[6]; goto LABEL_400bc3; } } return v1; }
int ssh_packet_read(struct ssh *ssh) { u_char type; int r; if ((r = ssh_packet_read_seqnr(ssh, &type, ((void *)0) )) != 0) sshfatal("packet.c", __func__, 1413, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "read"); return type; }
long long ssh_packet_read(unsigned long long *a0) { unsigned long long v0; char v1; unsigned int v2; v2 = ssh_packet_read_seqnr(a0, &v1, 0x0); if (v2) { v0 = "read"; sshfatal("packet.c", "ssh_packet_read", 0x585, 0x1, 0x1, ssh_err(v2)); } return v1; }
void generate_self_signed(common_info_st * cinfo) { gnutls_x509_crt_t crt; gnutls_datum_t out; gnutls_privkey_t key; int result; unsigned int flags = 0; fprintf(stdlog, "Generating a self signed certificate...\n"); crt = generate_certificate(&key, ((void *)0) , 0, cinfo); if (!key) key = load_private_key(1, cinfo); print_certificate_info(crt, stdlog, 0); fprintf(stdlog, "\n\nSigning certificate...\n"); if (cinfo->rsa_pss_sign) flags |= GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS; result = gnutls_x509_crt_privkey_sign(crt, crt, key, get_dig(crt, cinfo), flags); if (result < 0) { fprintf( stderr , "crt_sign: %s\n", gnutls_strerror(result)); app_exit(1); } result = gnutls_x509_crt_export2(crt, outcert_format, &out); if (result < 0) { fprintf( stderr , "crt_export: %s\n", gnutls_strerror(result)); app_exit(1); } fwrite(out.data, 1, out.size, outfile); gnutls_free((void *) (out.data)), out.data= ((void *)0) ; gnutls_x509_crt_deinit(crt); gnutls_privkey_deinit(key); }
unsigned long generate_self_signed(long a1) { unsigned int dig; const char *v2; const char *v3; unsigned int v5; int v6; int v7; long private_key; long v9; void *ptr; size_t n; unsigned long v12; v12 = __readfsqword(0x28u); v5 = 0; fprintf(stdlog, "Generating a self signed certificate...\n"); v9 = generate_certificate(&private_key, 0LL, 0, a1); if ( !private_key ) private_key = load_private_key(1LL, a1); print_certificate_info(v9, stdlog, 0); fprintf(stdlog, "\n\nSigning certificate...\n"); if ( *(_DWORD *)(a1 + 200) ) v5 = 128; dig = get_dig(v9, a1); v6 = gnutls_x509_crt_privkey_sign(v9, v9, private_key, dig, v5); if ( v6 < 0 ) { v2 = (const char *)gnutls_strerror((unsigned int)v6); fprintf(stderr, "crt_sign: %s\n", v2); app_exit(1); } v7 = gnutls_x509_crt_export2(v9, (unsigned int)outcert_format, &ptr); if ( v7 < 0 ) { v3 = (const char *)gnutls_strerror((unsigned int)v7); fprintf(stderr, "crt_export: %s\n", v3); app_exit(1); } fwrite(ptr, 1uLL, (unsigned int)n, outfile); gnutls_free(ptr); ptr = 0LL; gnutls_x509_crt_deinit(v9); gnutls_privkey_deinit(private_key); return __readfsqword(0x28u) ^ v12; }
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]... [USERNAME]...\n"), program_name); fputs_unlocked (gettext ("Print group memberships for each USERNAME or, if no USERNAME is specified, for\nthe current process (which may differ if the groups database has changed).\n"), stdout ) ; fputs_unlocked (gettext (" --help display this help and exit\n"), stdout ); fputs_unlocked (gettext (" --version output version information and exit\n"), stdout ); emit_ancillary_info ("groups"); } exit (status); }
void usage(unsigned long a0) { unsigned long v0; unsigned long v2; v0 = v2; if (a0) { fprintf(stderr, gettext("Try '%s --help' for more information.\n")); } else { printf(gettext("Usage: %s [OPTION]... [USERNAME]...\n")); fputs_unlocked(gettext("Print group memberships for each USERNAME or, if no USERNAME is specified, for\nthe current process (which may differ if the groups database has changed).\n"), stdout); fputs_unlocked(gettext(" --help display this help and exit\n"), stdout); fputs_unlocked(gettext(" --version output version information and exit\n"), stdout); emit_ancillary_info("groups"); } exit(a0); }
static int output_builtin_bin(struct depmod *depmod, FILE *out) { FILE *in; struct index_node *idx; char line[ 4096 ], modname[ 4096 ]; if (out == stdout ) return 0; in = dfdopen(depmod->cfg->dirname, "modules.builtin", 00 , "r"); if (in == ((void *)0) ) return 0; idx = index_create(); if (idx == ((void *)0) ) { fclose(in); return - 12 ; } while (fgets(line, sizeof(line), in) != ((void *)0) ) { if (! ((*__ctype_b_loc ())[(int) (( line[0] ))] & (unsigned short int) _ISalpha) ) { log_printf( 3 , "Invalid modules.builtin line: %s\n", line); continue; } path_to_modname(line, modname, ((void *)0) ); index_insert(idx, modname, "", 0); } index_write(idx, out); index_destroy(idx); fclose(in); return 0; }
long long output_builtin_bin(unsigned long long *a0, void* a1, unsigned long a2, unsigned long long a3, unsigned long long a4) { void* v0; void* v1; char v2; char v3; char v4; unsigned long long v5; unsigned long long v7; unsigned int v9; v5 = *(&v5); v3 = *(&v3); if (a1 == stdout) { v7 = 0; return v7; } v0 = dfdopen(*(a0) + 8, "modules.builtin", 0x0, "r", a4); if (!v0) { v7 = 0; return v7; } v1 = index_create(); if (!v1) { fclose(v0); v7 = 4294967284; return v7; } while (fgets(&v2, 0x1000, v0)) { v9 = *((*(__ctype_b_loc()) + v2 * 2)) & 0x400; if (v9) { path_to_modname(&v2, &v4, 0x0, &v4); index_insert(v1, &v4, &g_4004fd, 0x0); } else { log_printf(0x3, "Invalid modules.builtin line: %s\n", &v2, a3, a4); } } index_write(v1, a1); index_destroy(v1); fclose(v0); v7 = 0; return v7; }
static void add_regexp (struct regexp_list *reglist, char const *pattern) { size_t patlen = strlen (pattern); char const *m = re_compile_pattern (pattern, patlen, reglist->buf); if (m != 0) error (2, 0, "%s: %s", pattern, m); else { char *regexps = reglist->regexps; size_t len = reglist->len; _Bool multiple_regexps = reglist->multiple_regexps = regexps != 0; size_t newlen = reglist->len = len + 2 * multiple_regexps + patlen; size_t size = reglist->size; if (size <= newlen) { if (!size) size = 1; do size *= 2; while (size <= newlen); reglist->size = size; reglist->regexps = regexps = xrealloc (regexps, size); } if (multiple_regexps) { regexps[len++] = '\\'; regexps[len++] = '|'; } memcpy (regexps + len, pattern, patlen + 1); } }
void add_regexp(struct_0 *a0, void* a1) { char v0; int tmp_18; int tmp_29; char *v1; char *v2; unsigned long long v3; unsigned long long v4; unsigned long v5; unsigned long v6; unsigned long long v8; v4 = strlen(a1); v5 = re_compile_pattern(a1, v4, a0->field_20, v4); if (v5) error(0x2, 0x0, "%s: %s"); v1 = a0->field_0; v2 = a0->field_8; a0->field_18 = v1; v0 = a0->field_18; a0->field_8 = &v2[2 * v0 + v4]; v6 = a0->field_8; v3 = a0->field_10; if (v3 <= v6) { if (!v3) v3 = 1; do { v3 *= 2; } while (v3 <= v6); a0->field_10 = v3; v1 = xrealloc(v1, v3, v3); a0->field_0 = v1; } if (v0) { tmp_18 = v2; v2 += 1; v1[tmp_18] = 92; tmp_29 = v2; v2 += 1; v1[tmp_29] = 124; } v8 = memcpy(v1 + v2, a1, v4 + 1); return; }
static int rev_xstrcoll_version (V a, V b) { return cmp_version (b, a); }
long long rev_xstrcoll_version(unsigned long long *a0, unsigned long long *a1) { return cmp_version(a1, a0); }
static struct passwd *getrootpwent(int try_manually) { static struct passwd pwd; struct passwd *pw; struct spwd *spw; FILE *fp; static char line[256]; static char sline[256]; char *p; if ((pw = getpwnam("root")) && !strcmp(pw->pw_passwd, "x") && (spw = getspnam("root"))) pw->pw_passwd = spw->sp_pwdp; if (pw || !try_manually) return pw; pwd.pw_name = "root"; pwd.pw_passwd = ""; pwd.pw_gecos = "Super User"; pwd.pw_dir = "/"; pwd.pw_shell = ""; pwd.pw_uid = 0; pwd.pw_gid = 0; if ((fp = fopen("/etc/passwd", "r")) == ((void *)0) ) { perror("/etc/passwd"); return &pwd; } while((p = fgets(line, 256, fp)) != ((void *)0) ) { if (strncmp(line, "root:", 5) != 0) continue; p += 5; set(&pwd.pw_passwd, strsep(&p, ":")); (void)strsep(&p, ":"); (void)strsep(&p, ":"); set(&pwd.pw_gecos, strsep(&p, ":")); set(&pwd.pw_dir, strsep(&p, ":")); set(&pwd.pw_shell, strsep(&p, "\n")); p = line; break; } fclose(fp); if (p == ((void *)0) ) { fprintf( stderr , "sulogin: %s: no entry for root\n\r", "/etc/passwd"); return &pwd; } if (valid(pwd.pw_passwd)) return &pwd; strcpy(pwd.pw_passwd, ""); if ((fp = fopen("/etc/shadow", "r")) == ((void *)0) ) { fprintf( stderr , "sulogin: %s: root password garbled\n\r", "/etc/passwd"); return &pwd; } while((p = fgets(sline, 256, fp)) != ((void *)0) ) { if (strncmp(sline, "root:", 5) != 0) continue; p += 5; set(&pwd.pw_passwd, strsep(&p, ":")); break; } fclose(fp); if (p == ((void *)0) ) { fprintf( stderr , "sulogin: %s: no entry for root\n\r", "/etc/shadow"); strcpy(pwd.pw_passwd, ""); } if (!valid(pwd.pw_passwd)) { fprintf( stderr , "sulogin: %s: root password garbled\n\r", "/etc/shadow"); strcpy(pwd.pw_passwd, ""); } return &pwd; }
int getrootpwent(unsigned long a0) { unsigned long v0; struct_0 *v1; struct_0 *v2; void* v3; unsigned int v5; v1 = &getpwnam("root")->pw_name; if (v1 && !strcmp(v1->field_8, "x")) { v2 = getspnam("root"); if (v2) v1->field_8 = v2->field_8; } if (v1) { LABEL_400863: v5 = v1; } else { if (!a0) goto LABEL_400863; pwd.4705 = "root"; g_402188 = &g_402496; g_402198 = "Super User"; g_4021a0 = "/"; g_4021a8 = &g_402496; g_402190 = 0; g_402194 = 0; v3 = fopen("/etc/passwd", "r"); if (!v3) { perror("/etc/passwd"); v5 = &pwd.4705; } else { do { v0 = fgets(&line.4709, 0x100, v3); if (!v0) goto LABEL_400a20; } while (strncmp(&line.4709, "root:", 0x5)); v0 += 5; set(&g_402188, strsep(&v0, ":")); strsep(&v0, ":"); strsep(&v0, ":"); set(&g_402198, strsep(&v0, ":")); set(&g_4021a0, strsep(&v0, ":")); set(&g_4021a8, strsep(&v0, "\n")); v0 = &line.4709; LABEL_400a20: fclose(v3); if (!v0) { fprintf(*(&stderr), "sulogin: %s: no entry for root\n\r", &g_4024a6); v5 = &pwd.4705; } else if (valid(g_402188)) { v5 = &pwd.4705; } else { strcpy(g_402188, &g_402496); v3 = fopen("/etc/shadow", "r"); if (!v3) { fprintf(*(&stderr), "sulogin: %s: root password garbled\n\r", &g_4024a6); v5 = &pwd.4705; } else { do { v0 = fgets(&sline.4710, 0x100, v3); if (!v0) goto LABEL_400b61; } while (strncmp(&sline.4710, "root:", 0x5)); v0 += 5; set(&g_402188, strsep(&v0, ":")); LABEL_400b61: fclose(v3); if (!v0) { fprintf(*(&stderr), "sulogin: %s: no entry for root\n\r", &g_4024e1); strcpy(g_402188, &g_402496); } if (!valid(g_402188)) { fprintf(*(&stderr), "sulogin: %s: root password garbled\n\r", &g_4024e1); strcpy(g_402188, &g_402496); } v5 = &pwd.4705; } } } } return v5; }
static int display_traps (list, show_all) WORD_LIST *list; int show_all; { int result, i; if (list == 0) { for (i = 0; i < (64 + 1) +3; i++) showtrap (i, show_all); return (0); } for (result = 0; list; list = list->next) { i = decode_signal (list->word->word, 0x02|0x01); if (i == -1) { sh_invalidsig (list->word->word); result = 1; } else showtrap (i, show_all); } return (result); }
int display_traps(unsigned long a0, unsigned long a1, unsigned long long a2) { struct_0 *v0; unsigned int v1; unsigned int v2; unsigned int v4; v0 = a0; if (v0) { for (v1 = 0; v0; v0 = v0->field_0) { v2 = decode_signal(v0->field_8->field_0, 0x3, a2); if (v2 != -1) { showtrap(v2, a1); } else { sh_invalidsig(v0->field_8->field_0); v1 = 1; } } v4 = v1; return v4; } else { for (v2 = 0; v2 <= 67; v2 += 1) { showtrap(v2, a1); } v4 = 0; return v4; } }
void mm_inform_authserv(char *service, char *style) { struct sshbuf *m; int r; sshlog("monitor_wrap.c", __func__, 385, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "entering"); if ((m = sshbuf_new()) == ((void *)0) ) sshfatal("monitor_wrap.c", __func__, 388, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); if ((r = sshbuf_put_cstring(m, service)) != 0 || (r = sshbuf_put_cstring(m, style ? style : "")) != 0) sshfatal("monitor_wrap.c", __func__, 391, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble"); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, m); sshbuf_free(m); }
long mm_inform_authserv(long a1, void *a2) { void *v2; long v3; unsigned int v5; long v6; sshlog("monitor_wrap.c", "mm_inform_authserv", 385LL, 1LL, 7LL, 0LL, "entering"); v6 = sshbuf_new(); if ( !v6 ) sshfatal("monitor_wrap.c", "mm_inform_authserv", 388LL, 1LL, 1LL, 0LL, "sshbuf_new failed"); v5 = sshbuf_put_cstring(v6, a1); if ( v5 || (!a2 ? (v2 = &unk_3F89) : (v2 = a2), (v5 = sshbuf_put_cstring(v6, v2)) != 0) ) { v3 = ssh_err(v5); sshfatal("monitor_wrap.c", "mm_inform_authserv", 391LL, 1LL, 1LL, v3, "assemble"); } mm_request_send(*pmonitor, 4u, v6); return sshbuf_free(v6); }
cv_yank(EditLine *el, const wchar_t *ptr, int size) { c_kill_t *k = &el->el_chared.c_kill; (void)memcpy(k->buf, ptr, (size_t)size * sizeof(*k->buf)); k->last = k->buf + size; }
void cv_yank(unsigned long a0, void* a1, unsigned long a2) { unsigned long long v0[2]; unsigned long long v2[2]; v0[0] = a0 + 896; memcpy(v0[0], a1, a2 * 4); v2 = v0; v0[1] = a2 * 4 + v0[0]; return; }
static struct passwd *getrootpwent(int try_manually) { static struct passwd pwd; struct passwd *pw; struct spwd *spw; FILE *fp; static char line[256]; static char sline[256]; char *p; if ((pw = getpwnam("root")) && !strcmp(pw->pw_passwd, "x") && (spw = getspnam("root"))) pw->pw_passwd = spw->sp_pwdp; if (pw || !try_manually) return pw; pwd.pw_name = "root"; pwd.pw_passwd = ""; pwd.pw_gecos = "Super User"; pwd.pw_dir = "/"; pwd.pw_shell = ""; pwd.pw_uid = 0; pwd.pw_gid = 0; if ((fp = fopen("/etc/passwd", "r")) == ((void *)0) ) { perror("/etc/passwd"); return &pwd; } while((p = fgets(line, 256, fp)) != ((void *)0) ) { if (strncmp(line, "root:", 5) != 0) continue; p += 5; set(&pwd.pw_passwd, strsep(&p, ":")); (void)strsep(&p, ":"); (void)strsep(&p, ":"); set(&pwd.pw_gecos, strsep(&p, ":")); set(&pwd.pw_dir, strsep(&p, ":")); set(&pwd.pw_shell, strsep(&p, "\n")); p = line; break; } fclose(fp); if (p == ((void *)0) ) { fprintf( stderr , "sulogin: %s: no entry for root\n\r", "/etc/passwd"); return &pwd; } if (valid(pwd.pw_passwd)) return &pwd; strcpy(pwd.pw_passwd, ""); if ((fp = fopen("/etc/shadow", "r")) == ((void *)0) ) { fprintf( stderr , "sulogin: %s: root password garbled\n\r", "/etc/passwd"); return &pwd; } while((p = fgets(sline, 256, fp)) != ((void *)0) ) { if (strncmp(sline, "root:", 5) != 0) continue; p += 5; set(&pwd.pw_passwd, strsep(&p, ":")); break; } fclose(fp); if (p == ((void *)0) ) { fprintf( stderr , "sulogin: %s: no entry for root\n\r", "/etc/shadow"); strcpy(pwd.pw_passwd, ""); } if (!valid(pwd.pw_passwd)) { fprintf( stderr , "sulogin: %s: root password garbled\n\r", "/etc/shadow"); strcpy(pwd.pw_passwd, ""); } return &pwd; }
passwd * getrootpwent(int param_1) { int iVar1; char *pcVar2; passwd *ppVar3; long in_FS_OFFSET; char *local_30; passwd *local_28; long local_20; FILE *local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_28 = getpwnam("root"); if (((local_28 != (passwd *)0x0) && (iVar1 = strcmp(local_28->pw_passwd,"x"), iVar1 == 0)) && (local_20 = getspnam(&DAT_0010248f), local_20 != 0)) { local_28->pw_passwd = *(char **)(local_20 + 8); } ppVar3 = local_28; if ((local_28 == (passwd *)0x0) && (param_1 != 0)) { pwd_4705._0_8_ = &DAT_0010248f; pwd_4705._8_8_ = ""; pwd_4705._24_8_ = "Super User"; pwd_4705._32_8_ = &DAT_001024a2; pwd_4705._40_8_ = &DAT_00102496; pwd_4705._16_4_ = 0; pwd_4705._20_4_ = 0; local_18 = fopen("/etc/passwd","r"); if (local_18 == (FILE *)0x0) { perror("/etc/passwd"); ppVar3 = (passwd *)pwd_4705; } else { do { local_30 = fgets(line_4709,0x100,local_18); if (local_30 == (char *)0x0) goto LAB_00100a20; iVar1 = strncmp(line_4709,"root:",5); } while (iVar1 != 0); local_30 = local_30 + 5; pcVar2 = strsep(&local_30,":"); set(0x102188,pcVar2); strsep(&local_30,":"); strsep(&local_30,":"); pcVar2 = strsep(&local_30,":"); set(0x102198,pcVar2); pcVar2 = strsep(&local_30,":"); set(0x1021a0,pcVar2); pcVar2 = strsep(&local_30,"\n"); set(0x1021a8,pcVar2); local_30 = line_4709; LAB_00100a20: fclose(local_18); if (local_30 == (char *)0x0) { fprintf(stderr,"sulogin: %s: no entry for root\n\r","/etc/passwd"); ppVar3 = (passwd *)pwd_4705; } else { iVar1 = valid(pwd_4705._8_8_); if (iVar1 == 0) { strcpy(pwd_4705._8_8_,""); local_18 = fopen("/etc/shadow","r"); if (local_18 == (FILE *)0x0) { fprintf(stderr,"sulogin: %s: root password garbled\n\r","/etc/passwd"); ppVar3 = (passwd *)pwd_4705; } else { do { local_30 = fgets(sline_4710,0x100,local_18); if (local_30 == (char *)0x0) goto LAB_00100b61; iVar1 = strncmp(sline_4710,"root:",5); } while (iVar1 != 0); local_30 = local_30 + 5; pcVar2 = strsep(&local_30,":"); set(0x102188,pcVar2); LAB_00100b61: fclose(local_18); if (local_30 == (char *)0x0) { fprintf(stderr,"sulogin: %s: no entry for root\n\r","/etc/shadow"); strcpy(pwd_4705._8_8_,""); } iVar1 = valid(pwd_4705._8_8_); if (iVar1 == 0) { fprintf(stderr,"sulogin: %s: root password garbled\n\r","/etc/shadow"); strcpy(pwd_4705._8_8_,""); } ppVar3 = (passwd *)pwd_4705; } } else { ppVar3 = (passwd *)pwd_4705; } } } } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return ppVar3; } __stack_chk_fail(); }
Keymap rl_make_bare_keymap (void) { register int i; Keymap keymap; keymap = (Keymap)xmalloc (257 * sizeof (KEYMAP_ENTRY)); for (i = 0; i < 257; i++) { keymap[i].type = 0; keymap[i].function = (rl_command_func_t *) ((void *)0) ; } return (keymap); }
long rl_make_bare_keymap() { int i; long v2; v2 = xmalloc(4112LL); for ( i = 0; i <= 256; ++i ) { *(_BYTE *)(16LL * i + v2) = 0; *(_QWORD *)(16LL * i + v2 + 8) = 0LL; } return v2; }
el_editmode(EditLine *el, int argc, const wchar_t **argv) { const wchar_t *how; if (argv == ((void *)0) || argc != 2 || argv[1] == ((void *)0) ) return -1; how = argv[1]; if (wcscmp(how, L"on") == 0) { el->el_flags &= ~0x004; tty_rawmode(el); } else if (wcscmp(how, L"off") == 0) { tty_cookedmode(el); el->el_flags |= 0x004; } else { (void) fprintf(el->el_errfile, "edit: Bad value `%ls'.\n", how); return -1; } return 0; }
undefined8 el_editmode(long param_1,int param_2,long param_3) { wchar_t *__s1; int iVar1; undefined8 uVar2; if (((param_3 == 0) || (param_2 != 2)) || (*(long *)(param_3 + 8) == 0)) { uVar2 = 0xffffffff; } else { __s1 = *(wchar_t **)(param_3 + 8); iVar1 = wcscmp(__s1,L"on"); if (iVar1 == 0) { *(uint *)(param_1 + 0x2c) = *(uint *)(param_1 + 0x2c) & 0xfffffffb; tty_rawmode(param_1); } else { iVar1 = wcscmp(__s1,L"off"); if (iVar1 != 0) { fprintf(*(FILE **)(param_1 + 0x18),"edit: Bad value `%ls\'.\n",__s1); return 0xffffffff; } tty_cookedmode(param_1); *(uint *)(param_1 + 0x2c) = *(uint *)(param_1 + 0x2c) | 4; } uVar2 = 0; } return uVar2; }
char * vis(char *dst, int c, int flag, int nextc) { if ((((c) == '\\' || (flag & 0x400) == 0) && (((u_int)(c) <= (0x7f * 2 + 1) && ((( (u_char)(c) ) & ~0x7f) == 0) && (((c) != '*' && (c) != '?' && (c) != '[' && (c) != '#') || (flag & 0x100) == 0) && ((*__ctype_b_loc ())[(int) (( (u_char)(c) ))] & (unsigned short int) _ISgraph) ) || ((flag & 0x04) == 0 && (c) == ' ') || ((flag & 0x08) == 0 && (c) == '\t') || ((flag & 0x10) == 0 && (c) == '\n') || ((flag & 0x20) && ((c) == '\b' || (c) == '\007' || (c) == '\r' || ((*__ctype_b_loc ())[(int) (( (u_char)(c) ))] & (unsigned short int) _ISgraph) ))))) { if ((c == '"' && (flag & 0x200) != 0) || (c == '\\' && (flag & 0x40) == 0)) *dst++ = '\\'; *dst++ = c; *dst = '\0'; return (dst); } if (flag & 0x02) { switch(c) { case '\n': *dst++ = '\\'; *dst++ = 'n'; goto done; case '\r': *dst++ = '\\'; *dst++ = 'r'; goto done; case '\b': *dst++ = '\\'; *dst++ = 'b'; goto done; case '\a': *dst++ = '\\'; *dst++ = 'a'; goto done; case '\v': *dst++ = '\\'; *dst++ = 'v'; goto done; case '\t': *dst++ = '\\'; *dst++ = 't'; goto done; case '\f': *dst++ = '\\'; *dst++ = 'f'; goto done; case ' ': *dst++ = '\\'; *dst++ = 's'; goto done; case '\0': *dst++ = '\\'; *dst++ = '0'; if ((((u_char)(nextc)) >= '0' && ((u_char)(nextc)) <= '7')) { *dst++ = '0'; *dst++ = '0'; } goto done; } } if (((c & 0177) == ' ') || (flag & 0x01) || ((flag & 0x100) && (c == '*' || c == '?' || c == '[' || c == '#'))) { *dst++ = '\\'; *dst++ = ((u_char)c >> 6 & 07) + '0'; *dst++ = ((u_char)c >> 3 & 07) + '0'; *dst++ = ((u_char)c & 07) + '0'; goto done; } if ((flag & 0x40) == 0) *dst++ = '\\'; if (c & 0200) { c &= 0177; *dst++ = 'M'; } if ( ((*__ctype_b_loc ())[(int) (( (u_char)c ))] & (unsigned short int) _IScntrl) ) { *dst++ = '^'; if (c == 0177) *dst++ = '?'; else *dst++ = c + '@'; } else { *dst++ = '-'; *dst++ = c; } done: *dst = '\0'; return (dst); }
byte * vis(byte *param_1,uint param_2,uint param_3,byte param_4) { byte *pbVar1; ushort **ppuVar2; byte bVar3; uint local_14; byte *local_10; bVar3 = (byte)param_2; local_10 = param_1; if (((param_2 == 0x5c) || ((param_3 & 0x400) == 0)) && ((((param_2 < 0x100 && ((param_2 & 0x80) == 0)) && ((((((param_2 != 0x2a && (param_2 != 0x3f)) && (param_2 != 0x5b)) && (param_2 != 0x23)) || ((param_3 & 0x100) == 0)) && (ppuVar2 = __ctype_b_loc(), (short)(*ppuVar2)[param_2 & 0xff] < 0)))) || ((((((param_3 & 4) == 0 && (param_2 == 0x20)) || (((param_3 & 8) == 0 && (param_2 == 9)))) || (((param_3 & 0x10) == 0 && (param_2 == 10)))) || (((param_3 & 0x20) != 0 && ((((param_2 == 8 || (param_2 == 7)) || (param_2 == 0xd)) || (ppuVar2 = __ctype_b_loc(), (short)(*ppuVar2)[param_2 & 0xff] < 0)))))))))) { if (((param_2 == 0x22) && ((param_3 & 0x200) != 0)) || ((param_2 == 0x5c && ((param_3 & 0x40) == 0)))) { local_10 = param_1 + 1; *param_1 = 0x5c; } *local_10 = bVar3; local_10[1] = 0; return local_10 + 1; } if ((param_3 & 2) == 0) { switchD_0010017d_caseD_1: if ((((param_2 & 0x7f) == 0x20) || ((param_3 & 1) != 0)) || (((param_3 & 0x100) != 0 && ((((param_2 == 0x2a || (param_2 == 0x3f)) || (param_2 == 0x5b)) || (param_2 == 0x23)))))) { *param_1 = 0x5c; param_1[1] = (bVar3 >> 6) + 0x30; param_1[2] = (bVar3 >> 3 & 7) + 0x30; local_10 = param_1 + 4; param_1[3] = (bVar3 & 7) + 0x30; } else { if ((param_3 & 0x40) == 0) { local_10 = param_1 + 1; *param_1 = 0x5c; } local_14 = param_2; if ((param_2 & 0x80) != 0) { local_14 = param_2 & 0x7f; *local_10 = 0x4d; local_10 = local_10 + 1; } ppuVar2 = __ctype_b_loc(); if (((*ppuVar2)[local_14 & 0xff] & 2) == 0) { pbVar1 = local_10 + 1; *local_10 = 0x2d; local_10 = local_10 + 2; *pbVar1 = (byte)local_14; } else { pbVar1 = local_10 + 1; *local_10 = 0x5e; if (local_14 == 0x7f) { local_10 = local_10 + 2; *pbVar1 = 0x3f; } else { local_10 = local_10 + 2; *pbVar1 = (byte)local_14 + 0x40; } } } } else { switch(param_2) { case 0: *param_1 = 0x5c; local_10 = param_1 + 2; param_1[1] = 0x30; if ((0x2f < param_4) && (param_4 < 0x38)) { *local_10 = 0x30; local_10 = param_1 + 4; param_1[3] = 0x30; } break; default: goto switchD_0010017d_caseD_1; case 7: *param_1 = 0x5c; local_10 = param_1 + 2; param_1[1] = 0x61; break; case 8: *param_1 = 0x5c; local_10 = param_1 + 2; param_1[1] = 0x62; break; case 9: *param_1 = 0x5c; local_10 = param_1 + 2; param_1[1] = 0x74; break; case 10: *param_1 = 0x5c; local_10 = param_1 + 2; param_1[1] = 0x6e; break; case 0xb: *param_1 = 0x5c; local_10 = param_1 + 2; param_1[1] = 0x76; break; case 0xc: *param_1 = 0x5c; local_10 = param_1 + 2; param_1[1] = 0x66; break; case 0xd: *param_1 = 0x5c; local_10 = param_1 + 2; param_1[1] = 0x72; break; case 0x20: *param_1 = 0x5c; local_10 = param_1 + 2; param_1[1] = 0x73; } } *local_10 = 0; return local_10; }
static int optionp_getfilecon (int fd, const char *name, char **p) { return lgetfileconat (fd, name, p); }
long long optionp_getfilecon(unsigned long a0, unsigned long long a1, unsigned long long a2) { return lgetfileconat(a0, a1, a2, a1); }
static char * fmt_time(time_t seconds) { int day, hr, min; static char buf[128]; min = (seconds / 60) % 60; hr = (seconds / 60 / 60) % 24; day = seconds / 60 / 60 / 24; if (day > 0) snprintf(buf, sizeof buf, "%dd %d:%02d", day, hr, min); else snprintf(buf, sizeof buf, "%d:%02d", hr, min); return buf; }
int fmt_time(unsigned long long a0) { unsigned int v0; unsigned int v1; unsigned int v2; v0 = ((a0 * 9838263505978427529 >> 64) + a0 >> 5) - (a0 >> 63) - __mulvdi3((((((a0 * 9838263505978427529 >> 64) + a0 >> 5) - (a0 >> 63)) * 9838263505978427529 >> 64) + ((a0 * 9838263505978427529 >> 64) + a0 >> 5) - (a0 >> 63) >> 5) - (((a0 * 9838263505978427529 >> 64) + a0 >> 5) - (a0 >> 63) >> 63), 0x3c, (((((a0 * 9838263505978427529 >> 64) + a0 >> 5) - (a0 >> 63)) * 9838263505978427529 >> 64) + ((a0 * 9838263505978427529 >> 64) + a0 >> 5) - (a0 >> 63) >> 5) - (((a0 * 9838263505978427529 >> 64) + a0 >> 5) - (a0 >> 63) >> 63), a0); v1 = (a0 * 5247073869855161349 >> 64 >> 10) - (a0 >> 63) - __mulvdi3((((a0 * 5247073869855161349 >> 64 >> 10) - (a0 >> 63)) * 3074457345618258603 >> 64 >> 2) - ((a0 * 5247073869855161349 >> 64 >> 10) - (a0 >> 63) >> 63), 0x18, (((a0 * 5247073869855161349 >> 64 >> 10) - (a0 >> 63)) * 3074457345618258603 >> 64 >> 2) - ((a0 * 5247073869855161349 >> 64 >> 10) - (a0 >> 63) >> 63), a0); v2 = (a0 * 1749024623285053783 >> 64 >> 13) - (a0 >> 63); if (v2 > 0) snprintf(&buf.17754, 0x80, "%dd %d:%02d", v2, v1, v0); else snprintf(&buf.17754, 0x80, "%d:%02d", v1, v0); return &buf.17754; }
int sshbuf_poke_u8(struct sshbuf *buf, size_t offset, u_char val) { u_char *p = ((void *)0) ; int r; if ((r = check_woffset(buf, offset, 1, &p)) != 0) return r; *p = val; return 0; }
long sshbuf_poke_u8(long a1, unsigned long a2, char a3) { unsigned int v5; long v6[2]; v6[1] = __readfsqword(0x28u); v6[0] = 0LL; v5 = check_woffset(a1, a2, 1LL, v6); if ( v5 ) return v5; *(_BYTE *)v6[0] = a3; return 0LL; }
static void xfrm_lifetime_print(struct xfrm_lifetime_cfg *cfg, struct xfrm_lifetime_cur *cur, FILE *fp, const char *prefix) { if (cfg) { if (prefix) fputs(prefix, fp); fprintf(fp, "lifetime config:%s", _SL_); if (prefix) fputs(prefix, fp); fprintf(fp, " limit: soft %s(bytes),", strxf_limit(cfg->soft_byte_limit)); fprintf(fp, " hard %s(bytes)%s", strxf_limit(cfg->hard_byte_limit), _SL_); if (prefix) fputs(prefix, fp); fprintf(fp, " limit: soft %s(packets),", strxf_limit(cfg->soft_packet_limit)); fprintf(fp, " hard %s(packets)%s", strxf_limit(cfg->hard_packet_limit), _SL_); if (prefix) fputs(prefix, fp); fprintf(fp, " expire add: soft %llu(sec), hard %llu(sec)%s", (unsigned long long) cfg->soft_add_expires_seconds, (unsigned long long) cfg->hard_add_expires_seconds, _SL_); if (prefix) fputs(prefix, fp); fprintf(fp, " expire use: soft %llu(sec), hard %llu(sec)%s", (unsigned long long) cfg->soft_use_expires_seconds, (unsigned long long) cfg->hard_use_expires_seconds, _SL_); } if (cur) { if (prefix) fputs(prefix, fp); fprintf(fp, "lifetime current:%s", _SL_); if (prefix) fputs(prefix, fp); fprintf(fp, " %llu(bytes), %llu(packets)%s", (unsigned long long) cur->bytes, (unsigned long long) cur->packets, _SL_); if (prefix) fputs(prefix, fp); fprintf(fp, " add %s ", strxf_time(cur->add_time)); fprintf(fp, "use %s%s", strxf_time(cur->use_time), _SL_); } }
void xfrm_lifetime_print(unsigned long long a0[8], unsigned long long a1[4], void* a2, char *a3) { unsigned long long v1; unsigned long long v2; if (a0) { if (a3) fputs(a3, a2); fprintf(a2, "lifetime config:%s", _SL_); if (a3) fputs(a3, a2); fprintf(a2, " limit: soft %s(bytes),", strxf_limit(a0[0])); fprintf(a2, " hard %s(bytes)%s", strxf_limit(a0[1]), _SL_); if (a3) fputs(a3, a2); fprintf(a2, " limit: soft %s(packets),", strxf_limit(a0[2])); fprintf(a2, " hard %s(packets)%s", strxf_limit(a0[3]), _SL_); if (a3) fputs(a3, a2); fprintf(a2, " expire add: soft %llu(sec), hard %llu(sec)%s", a0[4], a0[5], _SL_); if (a3) fputs(a3, a2); v1 = fprintf(a2, " expire use: soft %llu(sec), hard %llu(sec)%s", a0[6], a0[7], _SL_); } if (a1) { if (a3) fputs(a3, a2); fprintf(a2, "lifetime current:%s", _SL_); if (a3) fputs(a3, a2); fprintf(a2, " %llu(bytes), %llu(packets)%s", a1[0], a1[1], _SL_); if (a3) fputs(a3, a2); fprintf(a2, " add %s ", strxf_time(a1[2])); v2 = fprintf(a2, "use %s%s", strxf_time(a1[3]), _SL_); } return; }
static KbdintAuthctxt * kbdint_alloc(const char *devs) { KbdintAuthctxt *kbdintctxt; struct sshbuf *b; int i, r; kbdintctxt = xcalloc(1, sizeof(KbdintAuthctxt)); if (strcmp(devs, "") == 0) { if ((b = sshbuf_new()) == ((void *)0) ) sshfatal("auth2-chall.c", __func__, 115, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); for (i = 0; devices[i]; i++) { if ((r = sshbuf_putf(b, "%s%s", sshbuf_len(b) ? "," : "", devices[i]->name)) != 0) sshfatal("auth2-chall.c", __func__, 119, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "buffer error"); } if ((kbdintctxt->devices = sshbuf_dup_string(b)) == ((void *)0) ) sshfatal("auth2-chall.c", __func__, 122, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_dup_string failed"); sshbuf_free(b); } else { kbdintctxt->devices = xstrdup(devs); } sshlog("auth2-chall.c", __func__, 127, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "kbdint_alloc: devices '%s'", kbdintctxt->devices); kbdintctxt->ctxt = ((void *)0) ; kbdintctxt->device = ((void *)0) ; kbdintctxt->nreq = 0; return kbdintctxt; }
long kbdint_alloc(const char *a1) { const char *v1; const char *v2; long v3; int i; unsigned int v6; long v7; long v8; v7 = xcalloc(1LL, 32LL); if ( !strcmp(a1, &s2) ) { v8 = sshbuf_new(); if ( !v8 ) sshfatal("auth2-chall.c", "kbdint_alloc", 115LL, 1LL, 1LL, 0LL, "sshbuf_new failed"); for ( i = 0; *((_QWORD *)&devices + i); ++i ) { v1 = (const char *)**((_QWORD **)&devices + i); if ( sshbuf_len(v8) ) v2 = ","; else v2 = &s2; v6 = sshbuf_putf(v8, "%s%s", v2, v1); if ( v6 ) { v3 = ssh_err(v6); sshfatal("auth2-chall.c", "kbdint_alloc", 119LL, 1LL, 1LL, v3, "buffer error"); } } *(_QWORD *)v7 = sshbuf_dup_string(v8); if ( !*(_QWORD *)v7 ) sshfatal("auth2-chall.c", "kbdint_alloc", 122LL, 1LL, 1LL, 0LL, "sshbuf_dup_string failed"); sshbuf_free(v8); } else { *(_QWORD *)v7 = xstrdup(a1); } sshlog("auth2-chall.c", "kbdint_alloc", 127LL, 0LL, 5LL, 0LL, "kbdint_alloc: devices '%s'", *(const char **)v7); *(_QWORD *)(v7 + 8) = 0LL; *(_QWORD *)(v7 + 16) = 0LL; *(_DWORD *)(v7 + 24) = 0; return v7; }
void xheader_set_option (char *string) { char *token; for (token = strtok (string, ","); token; token = strtok ( ((void *)0) , ",")) { char *p = strchr (token, '='); if (!p) xheader_set_single_keyword (token); else xheader_set_keyword_equal (token, p); } }
long long xheader_set_option(char *a0) { unsigned long v0; unsigned int v1; unsigned long v3; v3 = strtok(a0, ","); v0 = v3; while (true) { if (v0) { *(&v1) = strchr(v0, 0x3d); if (!*(&v1)) xheader_set_single_keyword(v0); xheader_set_keyword_equal(v0, *(&v1)); v3 = strtok(NULL, ","); v0 = v3; } else { return v3; } } }
void xbcopy (s, d, n) char *s, *d; int n; { __builtin_memcpy ((d), (s), (n)); }
long long xbcopy(void* a0, void* a1, unsigned long a2) { return memcpy(a1, a0, a2); }
int sh_regmatch (string, pattern, flags) const char *string; const char *pattern; int flags; { regex_t regex = { 0 }; regmatch_t *matches; int rflags; SHELL_VAR *rematch; ARRAY *amatch; int subexp_ind; char *subexp_str; int subexp_len; int result; rematch = (SHELL_VAR *) ((void *)0) ; rflags = 1 ; if (match_ignore_case) rflags |= (1 << 1) ; if (regcomp (&regex, pattern, rflags)) return 2; matches = (regmatch_t *)sh_malloc((sizeof (regmatch_t) * (regex.re_nsub + 1)), "shmatch.c", 81); if (regexec (&regex, string, matches ? regex.re_nsub + 1 : 0, matches, 0)) result = 1; else result = 0; subexp_len = strlen (string) + 10; subexp_str = sh_malloc((subexp_len + 1), "shmatch.c", 94); unbind_global_variable_noref ("BASH_REMATCH"); rematch = make_new_array_variable ("BASH_REMATCH"); amatch = rematch ? (ARRAY *)((rematch)->value) : (ARRAY *)0; if (matches && amatch && (flags & 0x001) && result == 0 && subexp_str) { for (subexp_ind = 0; subexp_ind <= regex.re_nsub; subexp_ind++) { memset (subexp_str, 0, subexp_len); strncpy (subexp_str, string + matches[subexp_ind].rm_so, matches[subexp_ind].rm_eo - matches[subexp_ind].rm_so); array_insert (amatch, subexp_ind, subexp_str); } } sh_xfree((subexp_str), "shmatch.c", 123); sh_xfree((matches), "shmatch.c", 124); regfree (&regex); return result; }
long long sh_regmatch(char *a0, unsigned long long a1, unsigned long a2) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; struct_1 *v4; unsigned int *v5; void* v6; unsigned long long v7; void* v8; void* v9; void* v10; void* v11; void* v12; void* v13; void* v14; void* v15; unsigned long long v17; v8 = 0; v9 = 0; v10 = 0; v11 = 0; v12 = 0; v13 = 0; v14 = 0; v15 = 0; v4 = 0; v0 = 1; if (match_ignore_case) v0 |= 2; if (regcomp(&v8, a1, v0, a1)) { v17 = 2; return v17; } v5 = sh_malloc((v14 + 1) * 8, "shmatch.c", 0x51); if (regexec(&v8, a0)) v2 = 1; else v2 = 0; v3 = strlen(a0) + 10; v6 = sh_malloc(v3 + 1, "shmatch.c", 0x5e); unbind_global_variable_noref("BASH_REMATCH"); v4 = make_new_array_variable("BASH_REMATCH"); *(&v7) = (!v4 ? v4->field_8 : 0); if (v5 && v7 && (a2 & 1) && !v2 && v6) { for (v1 = 0; v1 <= v14; v1 += 1) { memset(v6, 0x0, v3); strncpy(v6, &a0[v5[2 * v1]], v5[1 + 2 * v1] - v5[2 * v1]); array_insert(v7, v1, v6, v1); } } sh_xfree(v6, "shmatch.c", 0x7b); sh_xfree(v5, "shmatch.c", 0x7c); regfree(&v8); v17 = v2; return v17; }
_Bool millerrabin2 (const uintmax_t *np, uintmax_t ni, const uintmax_t *bp, const uintmax_t *qp, unsigned int k, const uintmax_t *one) { uintmax_t y1, y0, nm1_1, nm1_0, r1m; y0 = powm2 (&r1m, bp, qp, np, ni, one); y1 = r1m; if (y0 == one[0] && y1 == one[1]) return 1 ; __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (nm1_1), "=&r" (nm1_0) : "0" ((UDItype)(np[1])), "rme" ((UDItype)(one[1])), "1" ((UDItype)(np[0])), "rme" ((UDItype)(one[0]))); if (y0 == nm1_0 && y1 == nm1_1) return 1 ; for (unsigned int i = 1; i < k; i++) { y0 = mulredc2 (&r1m, y1, y0, y1, y0, np[1], np[0], ni); y1 = r1m; if (y0 == nm1_0 && y1 == nm1_1) return 1 ; if (y0 == one[0] && y1 == one[1]) return 0 ; } return 0 ; }
long long millerrabin2(unsigned long long a0[2], unsigned int a1, void* a2, void* a3, unsigned long a4, unsigned long long a5[2]) { unsigned int v0; char v1; unsigned long long v2; unsigned int v3; unsigned long v4; unsigned long v5; unsigned long long v7; *(&v3) = powm2(&v1, a2, a3, a0, a1, a5); v2 = *(&v1); if (*(&v3) == a5[0] && v2 == a5[1]) { v7 = 1; return v7; } v4 = a0[1] - a5[1] - (a0[0] < a5[0]); v5 = a0[0] - a5[0]; if (*(&v3) == v5 && v2 == v4) { v7 = 1; return v7; } v0 = 1; while (true) { if (v0 < a4) { *(&v3) = mulredc2(&v1, v2, *(&v3), v2, *(&v3), a0[1], a0[0], a1); v2 = *(&v1); if (*(&v3) == v5 && v2 == v4) { v7 = 1; return v7; } if (*(&v3) == a5[0] && v2 == a5[1]) { v7 = 0; return v7; } v0 += 1; } else { v7 = 0; return v7; } } }
static struct ext2_dx_root_info *set_root_node(ext2_filsys fs, char *buf, ext2_ino_t ino, ext2_ino_t parent, struct ext2_inode *inode) { struct ext2_dir_entry *dir; struct ext2_dx_root_info *root; struct ext2_dx_countlimit *limits; int filetype = 0; int csum_size = 0; if (ext2fs_has_feature_filetype(fs->super)) filetype = 2; memset(buf, 0, fs->blocksize); dir = (struct ext2_dir_entry *) buf; dir->inode = ino; dir->name[0] = '.'; ext2fs_dirent_set_name_len(dir, 1); ext2fs_dirent_set_file_type(dir, filetype); dir->rec_len = 12; dir = (struct ext2_dir_entry *) (buf + 12); dir->inode = parent; dir->name[0] = '.'; dir->name[1] = '.'; ext2fs_dirent_set_name_len(dir, 2); ext2fs_dirent_set_file_type(dir, filetype); dir->rec_len = fs->blocksize - 12; root = (struct ext2_dx_root_info *) (buf+24); root->reserved_zero = 0; if (ext4_hash_in_dirent(inode)) root->hash_version = 6; else root->hash_version = fs->super->s_def_hash_version; root->info_length = 8; root->indirect_levels = 0; root->unused_flags = 0; if (ext2fs_has_feature_metadata_csum(fs->super)) csum_size = sizeof(struct ext2_dx_tail); limits = (struct ext2_dx_countlimit *) (buf+32); limits->limit = (fs->blocksize - (32 + csum_size)) / sizeof(struct ext2_dx_entry); limits->count = 0; return root; }
undefined4 * set_root_node(long param_1,undefined4 *param_2,undefined4 param_3,undefined4 param_4, undefined8 param_5) { int iVar1; undefined4 *puVar2; undefined4 local_28; int local_24; local_28 = 0; local_24 = 0; iVar1 = ext2fs_has_feature_filetype(*(undefined8 *)(param_1 + 0x20)); if (iVar1 != 0) { local_28 = 2; } memset(param_2,0,(ulong)*(uint *)(param_1 + 0x28)); *param_2 = param_3; *(undefined *)(param_2 + 2) = 0x2e; ext2fs_dirent_set_name_len(param_2,1); ext2fs_dirent_set_file_type(param_2,local_28); *(undefined2 *)(param_2 + 1) = 0xc; puVar2 = param_2 + 3; *puVar2 = param_4; *(undefined *)(param_2 + 5) = 0x2e; *(undefined *)((long)param_2 + 0x15) = 0x2e; ext2fs_dirent_set_name_len(puVar2,2); ext2fs_dirent_set_file_type(puVar2,local_28); *(short *)(param_2 + 4) = (short)*(undefined4 *)(param_1 + 0x28) + -0xc; param_2[6] = 0; iVar1 = ext4_hash_in_dirent(param_5); if (iVar1 == 0) { *(undefined *)(param_2 + 7) = *(undefined *)(*(long *)(param_1 + 0x20) + 0xfc); } else { *(undefined *)(param_2 + 7) = 6; } *(undefined *)((long)param_2 + 0x1d) = 8; *(undefined *)((long)param_2 + 0x1e) = 0; *(undefined *)((long)param_2 + 0x1f) = 0; iVar1 = ext2fs_has_feature_metadata_csum(*(undefined8 *)(param_1 + 0x20)); if (iVar1 != 0) { local_24 = 8; } *(short *)(param_2 + 8) = (short)((*(int *)(param_1 + 0x28) - local_24) - 0x20U >> 3); *(undefined2 *)((long)param_2 + 0x22) = 0; return param_2 + 6; }
static void finish_up (void) { process_signals (); cleanup (); print_stats (); }
unsigned long finish_up() { process_signals(); cleanup(); return print_stats(); }
static int write_random_lines (struct randint_source *s, size_t count, char *const *lines, size_t n_lines) { for (size_t i = 0; i < count; i++) { const randint j = randint_choose (s, n_lines); char *const *p = lines + j; size_t len = p[1] - p[0]; if (fwrite_unlocked (p[0],sizeof *p[0],len, stdout ) != len) return -1; } return 0; }
undefined8 write_random_lines(undefined8 param_1,ulong param_2,long param_3,undefined8 param_4) { void *pvVar1; void *pvVar2; long lVar3; void **ppvVar4; size_t sVar5; ulong local_28; local_28 = 0; while( true ) { if (param_2 <= local_28) { return 0; } lVar3 = randint_choose(param_1,param_4); ppvVar4 = (void **)(param_3 + lVar3 * 8); pvVar1 = ppvVar4[1]; pvVar2 = *ppvVar4; sVar5 = fwrite_unlocked(*ppvVar4,1,(long)pvVar1 - (long)pvVar2,stdout); if ((long)pvVar1 - (long)pvVar2 != sVar5) break; local_28 = local_28 + 1; } return 0xffffffff; }
static void print_seg6_local_counters(FILE *fp, struct rtattr *encap) { struct rtattr *tb[(__SEG6_LOCAL_CNT_MAX - 1) + 1]; __u64 packets = 0, bytes = 0, errors = 0; (parse_rtattr_flags((tb), ((__SEG6_LOCAL_CNT_MAX - 1)), ((void*)(((char*)(encap)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((encap)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))); if (tb[SEG6_LOCAL_CNT_PACKETS]) packets = rta_getattr_u64(tb[SEG6_LOCAL_CNT_PACKETS]); if (tb[SEG6_LOCAL_CNT_BYTES]) bytes = rta_getattr_u64(tb[SEG6_LOCAL_CNT_BYTES]); if (tb[SEG6_LOCAL_CNT_ERRORS]) errors = rta_getattr_u64(tb[SEG6_LOCAL_CNT_ERRORS]); if (is_json_context()) { open_json_object("stats64"); print_u64(PRINT_JSON, "packets", ((void *)0) , packets); print_u64(PRINT_JSON, "bytes", ((void *)0) , bytes); print_u64(PRINT_JSON, "errors", ((void *)0) , errors); close_json_object(); } else { print_string(PRINT_FP, ((void *)0) , "%s ", "packets"); print_num(fp, 1, packets); print_string(PRINT_FP, ((void *)0) , "%s ", "bytes"); print_num(fp, 1, bytes); print_string(PRINT_FP, ((void *)0) , "%s ", "errors"); print_num(fp, 1, errors); } }
unsigned long print_seg6_local_counters(long a1, unsigned short *a2) { char *v2; long v5; long v6; long v7; char v8[16]; char *v9; char *v10; char *v11; unsigned long v12; v12 = __readfsqword(0x28u); v5 = 0LL; v6 = 0LL; v7 = 0LL; v2 = v8; parse_rtattr_flags(v8, 4LL, a2 + 2, (unsigned int)*a2 - 4, 0x8000LL); if ( v9 ) { v2 = v9; v5 = rta_getattr_u64((long)v9); } if ( v10 ) { v2 = v10; v6 = rta_getattr_u64((long)v10); } if ( v11 ) { v2 = v11; v7 = rta_getattr_u64((long)v11); } if ( (unsigned char)is_json_context(v2) ) { open_json_object("stats64"); print_u64(2u, (long)"packets", 0LL, v5); print_u64(2u, (long)"bytes", 0LL, v6); print_u64(2u, (long)"errors", 0LL, v7); close_json_object(2LL); } else { print_string(1u, 0LL, "%s ", (long)"packets"); print_num(a1, 1LL, v5); print_string(1u, 0LL, "%s ", (long)"bytes"); print_num(a1, 1LL, v6); print_string(1u, 0LL, "%s ", (long)"errors"); print_num(a1, 1LL, v7); } return __readfsqword(0x28u) ^ v12; }
static _Bool valid_options (const struct cp_options *co) { ((void) sizeof (( ((unsigned int) (co->backup_type) <= numbered_backups) ) ? 1 : 0), __extension__ ({ if ( ((unsigned int) (co->backup_type) <= numbered_backups) ) ; else __assert_fail ( "VALID_BACKUP_TYPE (co->backup_type)" , "src/copy.c", 3087, __extension__ __PRETTY_FUNCTION__); })) ; ((void) sizeof (( ((co->sparse_mode) == SPARSE_NEVER || (co->sparse_mode) == SPARSE_AUTO || (co->sparse_mode) == SPARSE_ALWAYS) ) ? 1 : 0), __extension__ ({ if ( ((co->sparse_mode) == SPARSE_NEVER || (co->sparse_mode) == SPARSE_AUTO || (co->sparse_mode) == SPARSE_ALWAYS) ) ; else __assert_fail ( "VALID_SPARSE_MODE (co->sparse_mode)" , "src/copy.c", 3088, __extension__ __PRETTY_FUNCTION__); })) ; ((void) sizeof (( ((co->reflink_mode) == REFLINK_NEVER || (co->reflink_mode) == REFLINK_AUTO || (co->reflink_mode) == REFLINK_ALWAYS) ) ? 1 : 0), __extension__ ({ if ( ((co->reflink_mode) == REFLINK_NEVER || (co->reflink_mode) == REFLINK_AUTO || (co->reflink_mode) == REFLINK_ALWAYS) ) ; else __assert_fail ( "VALID_REFLINK_MODE (co->reflink_mode)" , "src/copy.c", 3089, __extension__ __PRETTY_FUNCTION__); })) ; ((void) sizeof (( !(co->hard_link && co->symbolic_link) ) ? 1 : 0), __extension__ ({ if ( !(co->hard_link && co->symbolic_link) ) ; else __assert_fail ( "!(co->hard_link && co->symbolic_link)" , "src/copy.c", 3090, __extension__ __PRETTY_FUNCTION__); })) ; ((void) sizeof (( ! (co->reflink_mode == REFLINK_ALWAYS && co->sparse_mode != SPARSE_AUTO) ) ? 1 : 0), __extension__ ({ if ( ! (co->reflink_mode == REFLINK_ALWAYS && co->sparse_mode != SPARSE_AUTO) ) ; else __assert_fail ( "! (co->reflink_mode == REFLINK_ALWAYS && co->sparse_mode != SPARSE_AUTO)" , "src/copy.c", 3091, __extension__ __PRETTY_FUNCTION__); })) ; return 1 ; }
int valid_options(struct_0 *a0) { if (a0->field_0 > 3) __assert_fail(); switch (a0->field_c) { case 1: case 2: case 3: switch (a0->field_44) { case 0: case 1: case 2: if (!(a0->field_17 ^ 1) && !(a0->field_3a ^ 1)) __assert_fail(); if (a0->field_44 != 2) { return 1; } else if (a0->field_c != 2) { __assert_fail(); } else { return 1; } default: __assert_fail(); } default: __assert_fail(); } }
int mm_hostbased_key_allowed(struct ssh *ssh, struct passwd *pw, const char *user, const char *host, struct sshkey *key) { return (mm_key_allowed(MM_HOSTKEY, user, host, key, 0, ((void *)0) )); }
void mm_hostbased_key_allowed (undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5) { mm_key_allowed(1,param_3,param_4,param_5,0,0); return; }
static void estimate_costs (struct predicate *tree) { if (tree) { estimate_costs (tree->pred_right); estimate_costs (tree->pred_left); tree->p_cost = get_pred_cost(tree); } }
void estimate_costs(struct_0 *a0) { if (a0) { estimate_costs(a0->field_118); estimate_costs(a0->field_110); a0->field_20 = get_pred_cost(a0); } return; }
int kex_input_ext_info(int type, u_int32_t seq, struct ssh *ssh) { struct kex *kex = ssh->kex; u_int32_t i, ninfo; char *name; u_char *val; size_t vlen; int r; sshlog("kex.c", __func__, 484, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "SSH2_MSG_EXT_INFO received"); ssh_dispatch_set(ssh, 7, &kex_protocol_error); if ((r = sshpkt_get_u32(ssh, &ninfo)) != 0) return r; for (i = 0; i < ninfo; i++) { if ((r = sshpkt_get_cstring(ssh, &name, ((void *)0) )) != 0) return r; if ((r = sshpkt_get_string(ssh, &val, &vlen)) != 0) { free(name); return r; } if (strcmp(name, "server-sig-algs") == 0) { if (memchr(val, '\0', vlen) != ((void *)0) ) { sshlog("kex.c", __func__, 498, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "nul byte in %s", name); return -4; } sshlog("kex.c", __func__, 501, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s=<%s>", name, val); kex->server_sig_algs = val; val = ((void *)0) ; } else if (strcmp(name, "publickey-hostbound@openssh.com") == 0) { if (memchr(val, '\0', vlen) != ((void *)0) ) { sshlog("kex.c", __func__, 509, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "nul byte in %s", name); return -4; } sshlog("kex.c", __func__, 512, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s=<%s>", name, val); if (strcmp(val, "0") == 0) kex->flags |= 0x0004; else { sshlog("kex.c", __func__, 516, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "unsupported version of %s extension", name) ; } } else sshlog("kex.c", __func__, 520, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s (unrecognised)", name); free(name); free(val); } return sshpkt_get_end(ssh); }
long long kex_input_ext_info(unsigned long a0, unsigned long a1, struct_0 *a2) { unsigned long long v0; unsigned long long v1; unsigned int v2; unsigned int v3; char v4; unsigned int v5; unsigned int v6; char v7; void* v8; char v9; struct_1 *v10; unsigned long long v12; unsigned long long v13; unsigned long long v14; unsigned long long v15; unsigned long long v16; v3 = a0; v2 = a1; v10 = a2->field_8; sshlog("kex.c", "kex_input_ext_info", 0x1e4, 0x0, 0x5, 0x0, "SSH2_MSG_EXT_INFO received"); ssh_dispatch_set(a2, 0x7, kex_protocol_error); v6 = sshpkt_get_u32(a2, &v4, &v4); if (v6) { v12 = v6; } else { v5 = 0; while (true) { if (v5 < *(&v4)) { v6 = sshpkt_get_cstring(a2, &v7, 0x0, &v7); if (v6) { v12 = v6; break; } else { v6 = sshpkt_get_string(a2, &v8, &v9, &v8); if (v6) { free(*(&v7)); v12 = v6; break; } else { v13 = strcmp(*(&v7), "server-sig-algs"); if (!v13) { v14 = memchr(v8, 0x0, *(&v9)); if (v14) { v1 = *(&v7); sshlog("kex.c", "kex_input_ext_info", 0x1f2, 0x1, 0x2, 0x0, "nul byte in %s"); v12 = 0xfffffffc; break; } else { v0 = *(&v7); sshlog("kex.c", "kex_input_ext_info", 0x1f5, 0x1, 0x5, 0x0, "%s=<%s>"); v10->field_40 = v8; v8 = 0; } } else { v15 = strcmp(*(&v7), "publickey-hostbound@openssh.com"); if (!v15) { v16 = memchr(v8, 0x0, *(&v9)); if (v16) { v1 = *(&v7); sshlog("kex.c", "kex_input_ext_info", 0x1fd, 0x1, 0x2, 0x0, "nul byte in %s"); v12 = 0xfffffffc; break; } else { v0 = *(&v7); sshlog("kex.c", "kex_input_ext_info", 0x200, 0x1, 0x5, 0x0, "%s=<%s>"); if (!strcmp(v8, "0")) { v10->field_8c = v10->field_8c | 4; } else { v1 = *(&v7); sshlog("kex.c", "kex_input_ext_info", 0x204, 0x1, 0x5, 0x0, "unsupported version of %s extension"); } } } else { v1 = *(&v7); sshlog("kex.c", "kex_input_ext_info", 0x208, 0x1, 0x5, 0x0, "%s (unrecognised)"); } } if (!v13 && !v14 || !v16 && v13 || v15 && v13) { free(*(&v7)); free(v8); v5 += 1; } } } } else { v12 = sshpkt_get_end(a2); break; } } } return v12; }
static void check_flags (int argc, int opt_index) { int exclusive = 0; if (aflg) { exclusive++; } if (dflg) { exclusive++; } if (rflg) { exclusive++; } if (Rflg) { exclusive++; } if (Aflg || Mflg) { exclusive++; } if (exclusive > 1) { usage (2); } if ((argc != (opt_index+1)) || ( ((void *)0) == group)) { usage (2); } }
long check_flags(int a1, int a2) { long result; int v3; v3 = aflg != 0; if ( dflg ) ++v3; if ( rflg ) ++v3; if ( Rflg ) ++v3; if ( Aflg || Mflg ) ++v3; if ( v3 > 1 ) usage(2); if ( a1 != a2 + 1 || (result = group) == 0 ) usage(2); return result; }
static void process_config_files(const char *host_name, struct passwd *pw, int final_pass, int *want_final_pass) { char buf[ 4096 ]; int r; if (config != ((void *)0) ) { if (strcasecmp(config, "none") != 0 && !read_config_file(config, pw, host, host_name, &options, 2 | (final_pass ? 4 : 0), want_final_pass)) sshfatal("ssh.c", __func__, 566, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Can't open user config file %.100s: " "%.100s", config, strerror( (*__errno_location ()) )) ; } else { r = snprintf(buf, sizeof buf, "%s/%s", pw->pw_dir, ".ssh" "/config"); if (r > 0 && (size_t)r < sizeof(buf)) (void)read_config_file(buf, pw, host, host_name, &options, 1 | 2 | (final_pass ? 4 : 0), want_final_pass); (void)read_config_file("/usr/local/etc" "/ssh_config", pw, host, host_name, &options, final_pass ? 4 : 0, want_final_pass); } }
void process_config_files(unsigned long long a0, unsigned long long a1, unsigned long a2, unsigned long long a3) { unsigned long long v0; unsigned long v1; unsigned long v2; struct_0 *v3; unsigned long long v4; unsigned int v5; char v6; unsigned long long v7; unsigned long v8; unsigned long long *v13; unsigned long long v14; v7 = *(&v7); v4 = a0; v3 = a1; if (!config) { LABEL_401569: v5 = snprintf(&v6, 0x1000, "%s/%s", v3->field_20, &g_408bc3); if (v5 > 0 && v5 <= 4095) { v8 = a3; read_config_file(&v6, v3, 0x48000ffff1058b48, v4, &hostaddr, (!a2 ? 7 : 3)); } v8 = a3; read_config_file("/usr/local/etc/ssh_config", v3, 0x48000ffff1058b48, v4, &hostaddr, (!a2 ? 4 : 0)); } else if (strcasecmp(config, "none") && (v2 = a3, !read_config_file(config, v3, 0x48000ffff1058b48, v4, &hostaddr, (!a2 ? 6 : 2)))) { v2 = strerror(*(__errno_location())); v1 = config; v0 = "Can't open user config file %.100s: %.100s"; sshfatal("ssh.c", "process_config_files", 0x236, 0x0, 0x1, 0x0); goto LABEL_401569; } v14 = v8 ^ v13[5]; return; }
void rl_restore_prompt(void) { if (!rl_prompt_saved) return; rl_prompt = rl_prompt_saved; rl_prompt_saved = ((void *)0) ; }
long long rl_restore_prompt() { unsigned long long *v1; v1 = *(got.rl_prompt_saved); if (*(got.rl_prompt_saved)) { *(got.rl_prompt) = *(got.rl_prompt_saved); v1 = got.rl_prompt_saved; *(got.rl_prompt_saved) = 0; } return v1; }
((*__ctype_b_loc ())[(int) (( (unsigned char)ch ))] & (unsigned short int) _ISalpha) ) { if ((flags & 0x04 )) ch = (char)tolower((unsigned char)ch); if ((flags & 0x08 )) ch = (char)toupper((unsigned char)ch); }
ushort ** __ctype_b_loc(void) { halt_baddata(); }
static void channel_before_prepare_io(struct ssh *ssh) { struct ssh_channels *sc = ssh->chanctxt; Channel *c; u_int i, oalloc; for (i = 0, oalloc = sc->channels_alloc; i < oalloc; i++) { c = sc->channels[i]; if (c == ((void *)0) ) continue; if (c->type == 21) channel_before_prepare_io_rdynamic(ssh, c); } }
void channel_before_prepare_io(struct_0 *a0) { unsigned int v0; unsigned int v1; struct_1 *v2; unsigned int *v3; unsigned long long v5; v2 = a0->field_868; v0 = 0; v1 = v2->field_8; while (true) { v5 = v0; if (v0 >= v1) break; v3 = *((v2->field_0 + v0 * 8)); if (v3 && *(v3) == 21) channel_before_prepare_io_rdynamic(a0, v3); v0 += 1; } return; }
static _Bool isdst_differ (int a, int b) { return (!a != !b) && (0 <= a) && (0 <= b); }
_BOOL8 isdst_differ(int a1, int a2) { return (a1 == 0) != (a2 == 0) && a1 >= 0 && a2 >= 0; }
inline int ext2fs_test_block_bitmap2(ext2fs_block_bitmap bitmap, blk64_t block) { return ext2fs_test_generic_bmap((ext2fs_generic_bitmap) bitmap, block); }
void ext2fs_test_block_bitmap2(void) { halt_baddata(); }
static char * memcpy_lowcase (char *dest, const char *src, size_t len ) { while (len-- > 0) dest[len] = tolower ((unsigned char) src[len]); return dest; }
void memcpy_lowcase(char *a0, char *a1, unsigned long long a2) { char *v0; char *v2; char *v3; v0 = a2; while (true) { v2 = v0; v0 += 1; if (!v2) break; *((v0 + a0)) = tolower(*((v0 + a1))); } v3 = a0; return; }
static int gmatch (string, se, pattern, pe, ends, flags) unsigned char *string, *se; unsigned char *pattern, *pe; struct smat_struct *ends; int flags; { unsigned char *p, *n; int c; int sc; p = pattern; n = string; if (string == 0 || pattern == 0) return 1; while (p < pe) { c = *p++; c = ((flags & (1 << 4)) ? ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)(unsigned char)c ))] & (unsigned short int) _ISupper) ) ? tolower((unsigned char)c) : ((unsigned char)c)) : ((unsigned char)c)); sc = n < se ? *n : '\0'; if (interrupt_state || terminating_signal) return 1; if ((flags & (1 << 5)) && *p == '(' && (c == '+' || c == '*' || c == '?' || c == '@' || c == '!')) { int lflags; lflags = (n == string) ? flags : (flags & ~((1 << 2)|(1 << 7))); return (extmatch (c, n, se, p, pe, lflags)); } switch (c) { case '?': if (sc == '\0') return 1; else if ((flags & (1 << 0)) && sc == '/') return 1; else if ((flags & (1 << 2)) && sc == '.' && (n == string || ((flags & (1 << 0)) && n[-1] == '/'))) return 1; if ((flags & (1 << 7)) && ((n == string && (n[0] == '.' && (n[1] == 0 || (n[1] == '.' && n[2] == 0)))) || ((flags & (1 << 0)) && n[-1] == '/' && (n[0] == '.' && ((((n[1]) == '/') || (n[1]) == 0) || (n[1] == '.' && (((n[2]) == '/') || (n[2]) == 0))))))) return 1; break; case '\\': if (p == pe && sc == '\\' && (n+1 == se)) break; if (p == pe) return 1; if ((flags & (1 << 1)) == 0) { c = *p++; if (p > pe) return 1; c = ((flags & (1 << 4)) ? ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)(unsigned char)c ))] & (unsigned short int) _ISupper) ) ? tolower((unsigned char)c) : ((unsigned char)c)) : ((unsigned char)c)); } if (((flags & (1 << 4)) ? ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)(unsigned char)sc ))] & (unsigned short int) _ISupper) ) ? tolower((unsigned char)sc) : ((unsigned char)sc)) : ((unsigned char)sc)) != (unsigned char)c) return 1; break; case '*': if (ends != ((void *)0) ) { ends->pattern = p - 1; ends->string = n; return (0); } if ((flags & (1 << 2)) && sc == '.' && (n == string || ((flags & (1 << 0)) && n[-1] == '/'))) return 1; if ((flags & (1 << 7)) && ((n == string && (n[0] == '.' && (n[1] == 0 || (n[1] == '.' && n[2] == 0)))) || ((flags & (1 << 0)) && n[-1] == '/' && (n[0] == '.' && ((((n[1]) == '/') || (n[1]) == 0) || (n[1] == '.' && (((n[2]) == '/') || (n[2]) == 0))))))) return 1; if (p == pe) return 0; for (c = *p++; (c == '?' || c == '*'); c = *p++) { if ((flags & (1 << 0)) && sc == '/') return 1; else if ((flags & (1 << 5)) && c == '?' && *p == '(') { unsigned char *newn; if (extmatch (c, n, se, p, pe, flags) == 0) return (0); newn = glob_patscan (p + 1, pe, 0); p = newn ? newn : pe; } else if (c == '?') { if (sc == '\0') return 1; n++; sc = n < se ? *n : '\0'; } if ((flags & (1 << 5)) && c == '*' && *p == '(') { unsigned char *newn; for (newn = n; newn < se; ++newn) { if (extmatch (c, newn, se, p, pe, flags) == 0) return (0); } newn = glob_patscan (p + 1, pe, 0); p = newn ? newn : pe; } if (p == pe) break; } if (c == '\0') { int r = (flags & (1 << 0)) == 0 ? 0 : 1; if (flags & (1 << 0)) { if (flags & (1 << 3)) r = 0; else if (memchr((n), ('/'), (se - n)) == ((void *)0) ) r = 0; } return r; } if (p == pe && (c == '?' || c == '*')) return (0); if (n == se && ((flags & (1 << 5)) && (c == '!' || c == '?') && *p == '(')) { --p; if (extmatch (c, n, se, p, pe, flags) == 0) return (c == '!' ? 1 : 0); return (c == '!' ? 0 : 1); } if (c == '/' && (flags & (1 << 0))) { while (n < se && *n != '/') ++n; if (n < se && *n == '/' && (gmatch (n+1, se, p, pe, ((void *)0) , flags) == 0)) return 0; return 1; } { unsigned char c1; const unsigned char *endp; struct smat_struct end; end.pattern = ((void *)0) ; endp = memchr((n), ((flags & (1 << 0)) ? '/' : '\0'), (se - n)); if (endp == 0) endp = se; c1 = ((flags & (1 << 1)) == 0 && c == '\\') ? *p : c; c1 = ((flags & (1 << 4)) ? ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)(unsigned char)c1 ))] & (unsigned short int) _ISupper) ) ? tolower((unsigned char)c1) : ((unsigned char)c1)) : ((unsigned char)c1)); for (--p; n < endp; ++n) { if ((flags & (1 << 5)) == 0 && c != '[' && ((flags & (1 << 4)) ? ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)(unsigned char)*n ))] & (unsigned short int) _ISupper) ) ? tolower((unsigned char)*n) : ((unsigned char)*n)) : ((unsigned char)*n)) != c1) continue; if ((flags & (1 << 5)) && p[1] != '(' && strchr(("?*+@!"), (*p)) == 0 && c != '[' && ((flags & (1 << 4)) ? ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)(unsigned char)*n ))] & (unsigned short int) _ISupper) ) ? tolower((unsigned char)*n) : ((unsigned char)*n)) : ((unsigned char)*n)) != c1) continue; if (gmatch (n, se, p, pe, &end, flags & ~((1 << 2)|(1 << 7))) == 0) { if (end.pattern == ((void *)0) ) return (0); break; } } if (end.pattern != ((void *)0) ) { p = end.pattern; n = end.string; continue; } return 1; } case '[': { if (sc == '\0' || n == se) return 1; if ((flags & (1 << 2)) && sc == '.' && (n == string || ((flags & (1 << 0)) && n[-1] == '/'))) return (1); if ((flags & (1 << 7)) && ((n == string && (n[0] == '.' && (n[1] == 0 || (n[1] == '.' && n[2] == 0)))) || ((flags & (1 << 0)) && n[-1] == '/' && (n[0] == '.' && ((((n[1]) == '/') || (n[1]) == 0) || (n[1] == '.' && (((n[2]) == '/') || (n[2]) == 0))))))) return 1; p = brackmatch (p, sc, flags); if (p == 0) return 1; } break; default: if ((unsigned char)c != ((flags & (1 << 4)) ? ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)(unsigned char)sc ))] & (unsigned short int) _ISupper) ) ? tolower((unsigned char)sc) : ((unsigned char)sc)) : ((unsigned char)sc))) return (1); } ++n; } if (n == se) return (0); if ((flags & (1 << 3)) && *n == '/') return 0; return (1); }
int gmatch(void* a0, unsigned long long a1, unsigned long a2, unsigned int a3, unsigned long long a4[2], unsigned long a5) { unsigned int v0; int tmp_14; int tmp_12; int tmp_7; char v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned long v6; unsigned long long v7; unsigned long long v8; unsigned long v9; unsigned long long v10; void* v11; char v12; unsigned int v14; unsigned int v15; unsigned int v16; unsigned int v17; v0 = a5; v6 = a2; v7 = a0; if (!a0) { LABEL_400604: v14 = 1; } else { if (!a2) goto LABEL_400604; while (true) { if (v6 >= a3) { if (v7 == a1) { v14 = 0; break; } else { if ((v0 & 8) && *(v7) == 47) { v14 = 0; break; } v14 = 1; break; } } tmp_14 = v6; v6 = &v6[1]; v15 = *(tmp_14); v2 = v15; if (!(v0 & 16)) { v14 = v2; } else { *(&v15) = *((*(__ctype_b_loc()) + v2 * 2)); v16 = v15 & 0x100; if (!v16) v14 = v2; else v14 = tolower(v2); } v2 = v14; if (v7 >= a1) v14 = 0; else v14 = *(v7); v3 = v14; if (interrupt_state) { LABEL_4006a5: v14 = 1; break; } else { if (!(!terminating_signal)) goto LABEL_4006a5; if ((v0 & 32) && *(v6) == 40) { if (v2 != 43 && v2 != 42 && v2 != 63 && v2 != 64 && !(v2 == 33)) goto LABEL_40072e; if (v7 != a0) { v14 = v0; *(&v14) = v0 & 123; } else { v14 = v0; } v5 = v14; v14 = extmatch(v2, v7, a1, v6, a3, v5); break; } LABEL_40072e: if (v2 == 92) { if (v6 == a3 && v3 == 92 && a1 == v7 + 1) goto LABEL_40131d; if (v6 == a3) { v14 = 1; break; } else { if (!(v0 & 2)) { tmp_12 = v6; v6 = &v6[1]; v14 = *(tmp_12); v2 = v15; if (v6 <= a3) { if (!(v0 & 16)) { v14 = v2; } else { *(&v14) = *((*(__ctype_b_loc()) + v2 * 2)); v14 = v14 & 0x100; if (v14) v14 = tolower(v2); else v14 = v2; } v2 = v14; } else { v14 = 1; break; } } if (!(v0 & 16)) { v14 = v3; } else { *(&v14) = *((*(__ctype_b_loc()) + v3 * 2)); v14 = v14 & 0x100; if (!v14) v14 = v3; else v14 = tolower(v3); } if (v14 != v2) { v14 = 1; break; } } } if (v2 > 92) { LABEL_4012bf: if (!(v0 & 16)) { v14 = v3; } else { *(&v14) = *((*(__ctype_b_loc()) + v3 * 2)); v14 = v14 & 0x100; if (!v14) v14 = v3; else v14 = tolower(v3); } if (v14 != v2) { v14 = 1; break; } } else { if (v2 == 91) { if (v3 && v7 != a1) { if ((v0 & 4) && v3 == 46) { if (v7 == a0) { LABEL_4011b1: v14 = 1; break; } else if ((v0 & 1)) { if (!(*((v7 - 1)) == 47)) goto LABEL_4011bb; goto LABEL_4011b1; } } LABEL_4011bb: if ((v0 & 128)) { if (v7 == a0 && *(v7) == 46) { if (!*((v7 + 1))) goto LABEL_401286; if (*((v7 + 1)) == 46 && !*((v7 + 2))) goto LABEL_401286; } if ((v0 & 1) && *((v7 - 1)) == 47 && *(v7) == 46) { if (*((v7 + 1)) == 47) { LABEL_401286: v14 = 1; break; } else { if (!*((v7 + 1))) goto LABEL_401286; if (*((v7 + 1)) == 46 && *((v7 + 2)) != 47) { if (!(!*((v7 + 2)))) goto LABEL_401290; goto LABEL_401286; } } } } LABEL_401290: v6 = brackmatch(v6, v3, v0); if (!v6) { v14 = 1; break; } } v14 = 1; break; } if (!(v2 <= 91)) goto LABEL_4012bf; if (v2 == 42) { if (a4) { a4[0] = v6 + 1; a4[1] = v7; v14 = 0; break; } if ((v0 & 4) && v3 == 46) { if (v7 == a0) { LABEL_400a5f: v14 = 1; break; } else if ((v0 & 1)) { if (!(*((v7 - 1)) == 47)) goto LABEL_400a69; goto LABEL_400a5f; } } LABEL_400a69: if ((v0 & 128)) { if (v7 == a0 && *(v7) == 46) { if (!*((v7 + 1))) goto LABEL_400b34; if (*((v7 + 1)) == 46 && !*((v7 + 2))) goto LABEL_400b34; } if ((v0 & 1) && *((v7 - 1)) == 47 && *(v7) == 46) { if (*((v7 + 1)) == 47) { LABEL_400b34: v14 = 1; break; } else { if (!*((v7 + 1))) goto LABEL_400b34; if (*((v7 + 1)) == 46 && *((v7 + 2)) != 47) { if (!(!*((v7 + 2)))) goto LABEL_400b3e; goto LABEL_400b34; } } } } LABEL_400b3e: if (v6 != a3) { tmp_7 = v6; v6 = &v6[1]; v14 = *(tmp_7); v2 = v15; while (true) { if (v2 != 63 && !(v2 == 42)) goto LABEL_400d4f; if ((v0 & 1) && v3 == 47) { v14 = 1; goto LABEL_401372; } if ((v0 & 32) && v2 == 63 && *(v6) == 40) { if (!extmatch(v2, v7, a1, v6, a3, v0)) { v14 = 0; goto LABEL_401372; } else { v10 = glob_patscan(v6 + 1, a3, 0x0); if (!v10) v14 = a3; else v14 = v10; *(&v6) = v14; goto LABEL_400c60; } } if (v2 == 63) { if (!v3) { v14 = 1; goto LABEL_401372; } else { v7 += 1; if (v7 >= a1) v14 = 0; else v14 = *(v7); v3 = v14; } } LABEL_400c60: if ((v0 & 32) && v2 == 42 && *(v6) == 40) { v8 = v7; while (true) { if (v8 >= a1) { *(&v8) = glob_patscan(v6 + 1, a3, 0x0); if (*(&v8)) v14 = *(&v8); else v14 = a3; *(&v6) = v14; break; } else if (extmatch(v2, v8, a1, v6, a3, v0)) { v8 += 1; } else { v14 = 0; goto LABEL_401372; } } } if (v6 != a3) { tmp_7 = v6; v6 = &v6[1]; v14 = *(tmp_7); v2 = v15; } else { LABEL_400d4f: if (!v2) { v4 = (v0 & 1); if ((v0 & 1)) { if ((v0 & 8)) { v4 = 0; } else if (!memchr(v7, 0x2f, a1 - v7)) { v4 = 0; } } v14 = v4; goto LABEL_401372; } if (v6 != a3) { LABEL_400ddf: if (v7 == a1 && (v0 & 32)) { if (v2 != 33 && !(v2 == 63)) goto LABEL_400e5e; if (*(v6) == 40) { v6 += 1; if (!extmatch(v2, v7, a1, v6, a3, v0)) { v14 = v2 == 33; goto LABEL_401372; } else { v14 = v2 != 33; goto LABEL_401372; } } } LABEL_400e5e: if (v2 == 47 && (v0 & 1)) { while (true) { if (v7 >= a1) break; if (*(v7) == 47) break; v7 += 1; } if (v7 < a1 && *(v7) == 47 && !gmatch(v7 + 1, a1, v6, a3, NULL, v0)) { v14 = 0; goto LABEL_401372; } v14 = 1; goto LABEL_401372; } v11 = 0; if (!(v0 & 1)) a3 = 0; else a3 = 47; v9 = memchr(v7, a3, a1 - v7); if (!v9) v9 = a1; if (!(v0 & 2) && v2 == 92) { *(&v14) = *(v6); goto LABEL_400f58; } *(&v14) = v2; LABEL_400f58: v1 = v14; if (!(v0 & 16)) { *(&v14) = v1; } else { *(&v14) = *((*(__ctype_b_loc()) + v1 * 2)); v14 = v14 & 0x100; if (!v14) *(&v14) = v1; else v14 = tolower(v1); } v1 = v14; *(&v6) = v6 + 1; while (true) { if (v7 >= v9) { if (!v11) { v14 = 1; goto LABEL_401372; } else { v6 = v11; v7 = *(&v12); break; } } if (!(v0 & 32) && v2 != 91) { if (!(v0 & 16)) { v14 = *(v7); } else { *(&v14) = *((*(v7) * 2 + *(__ctype_b_loc()))); v14 = v14 & 0x100; if (!v14) v14 = *(v7); else v14 = tolower(*(v7)); } if (!(v14 == v1)) goto LABEL_401120; } if ((v0 & 32) && v6[1] != 40 && !strchr("?*+@!", v6[0]) && v2 != 91) { if (!(v0 & 16)) { v14 = *(v7); } else { *(&v14) = *((*(v7) * 2 + *(__ctype_b_loc()))); v14 = v14 & 0x100; if (!v14) v14 = *(v7); else v14 = tolower(*(v7)); } if (!(v14 == v1)) goto LABEL_401120; } v17 = v0; *(&v17) = v0 & 123; v14 = gmatch(v7, a1, v6, a3, &v11, v17); if (!v14 && !v11) { v14 = 0; goto LABEL_401372; } LABEL_401120: v7 += 1; } } else { if (v2 != 63 && !(v2 == 42)) goto LABEL_400ddf; v14 = 0; goto LABEL_401372; } } } } else { v14 = 0; break; } } if (!(v2 == 63)) goto LABEL_4012bf; if (!v3) { v14 = 1; break; } if ((v0 & 1) && v3 == 47) { v14 = 1; break; } if ((v0 & 4) && v3 == 46) { if (v7 == a0) { LABEL_4007d0: v14 = 1; break; } else if ((v0 & 1)) { if (!(*((v7 - 1)) == 47)) goto LABEL_4007da; goto LABEL_4007d0; } } LABEL_4007da: if ((v0 & 128)) { if (v7 == a0 && *(v7) == 46) { if (!*((v7 + 1))) goto LABEL_4008bd; if (*((v7 + 1)) == 46 && !*((v7 + 2))) goto LABEL_4008bd; } if ((v0 & 1) && *((v7 - 1)) == 47 && *(v7) == 46) { if (*((v7 + 1)) == 47) { LABEL_4008bd: v14 = 1; break; } else { if (!*((v7 + 1))) goto LABEL_4008bd; if (*((v7 + 1)) == 46 && *((v7 + 2)) != 47) { if (!(!*((v7 + 2)))) goto LABEL_40131d; goto LABEL_4008bd; } } } } LABEL_40131d: v7 += 1; } } } } LABEL_401372: return v14; }
static struct fstatus * get_input_fstatus (size_t nfiles, char *const *file) { struct fstatus *fstatus = xnmalloc (nfiles ? nfiles : 1, sizeof *fstatus); if (nfiles == 0 || (nfiles == 1 && ((print_lines + print_words + print_chars + print_bytes + print_linelength) == 1))) fstatus[0].failed = 1; else { for (size_t i = 0; i < nfiles; i++) fstatus[i].failed = (! file[i] || (strcmp (file[i], "-") == 0) ? fstat ( 0 , &fstatus[i].st) : stat (file[i], &fstatus[i].st)); } return fstatus; }
int get_input_fstatus(unsigned long a0, void* a1) { void* v0; void* v1; unsigned int v4; v1 = xnmalloc((!a0 ? a0 : 1), 0x98); switch (a0) { case 0: *(v1) = 1; return v1; case 1: if (print_linelength + print_lines + print_words + print_chars + print_bytes == 1) { *(v1) = 1; return v1; } default: for (v0 = 0; v0 < a0; v0 += 1) { if (!*((a1 + 0x8 * v0)) || !strcmp(*((a1 + 0x8 * v0)), "-")) { v4 = fstat(0x0, v1 + v0 * 152 + 8); break; } else { v4 = stat(*((a1 + 0x8 * v0)), v1 + v0 * 152 + 8); break; } *((v1 + 0x98 * v0)) = v4; } return v1; } }
static int chk_atstar (name, quoted, pflags, quoted_dollar_atp, contains_dollar_at) char *name; int quoted, pflags; int *quoted_dollar_atp, *contains_dollar_at; { char *temp1; if (name == 0) { if (quoted_dollar_atp) *quoted_dollar_atp = 0; if (contains_dollar_at) *contains_dollar_at = 0; return 0; } if (name[0] == '@' && name[1] == 0) { if ((quoted & (0x002|0x001)) && quoted_dollar_atp) *quoted_dollar_atp = 1; if (contains_dollar_at) *contains_dollar_at = 1; return 1; } else if (name[0] == '*' && name[1] == '\0' && quoted == 0) { if (contains_dollar_at && expand_no_split_dollar_star == 0) *contains_dollar_at = 1; return 1; } else if (valid_array_reference (name, 0)) { temp1 = mbschr (name, '['); if (temp1 && temp1[1] == '@' && temp1[2] == ']') { if ((quoted & (0x002|0x001)) && quoted_dollar_atp) *quoted_dollar_atp = 1; if (contains_dollar_at) *contains_dollar_at = 1; return 1; } if (temp1 && temp1[1] == '*' && temp1[2] == ']' && quoted == 0) { if (contains_dollar_at) *contains_dollar_at = 1; return 1; } } return 0; }
int chk_atstar(char a0[2], unsigned long a1, unsigned long a2, unsigned int *a3, unsigned int *a4) { unsigned int v0; char v1[3]; unsigned int v3; v0 = a2; if (!a0) { if (a3) *(a3) = 0; if (a4) *(a4) = 0; v3 = 0; } else { if (a0[0] == 64 && !a0[1]) { if ((a1 & 3) && a3) *(a3) = 1; if (a4) *(a4) = 1; v3 = 1; goto LABEL_410d3c; } if (a0[0] == 42 && !a0[1] && !a1) { if (a4 && !expand_no_split_dollar_star) *(a4) = 1; v3 = 1; goto LABEL_410d3c; } if (valid_array_reference(a0, 0x0)) { *(&v1) = mbschr(a0, 0x5b); if (v1 && v1[1] == 64 && v1[2] == 93) { if ((a1 & 3) && a3) *(a3) = 1; if (a4) *(a4) = 1; v3 = 1; goto LABEL_410d3c; } if (v1 && v1[1] == 42 && v1[2] == 93 && !a1) { if (a4) *(a4) = 1; v3 = 1; goto LABEL_410d3c; } } v3 = 0; } LABEL_410d3c: return v3; }
void request_stdin (const char *rpl_option) { if (stdin_used_by) do { if (error_hook) error_hook (); error (0, 0, gettext ("Options '%s' and '%s' both want standard input"), stdin_used_by, rpl_option); usage (2); } while (0) ; stdin_used_by = rpl_option; }
void request_stdin(unsigned long long a0) { unsigned long long v1; if (stdin_used_by) { if (error_hook) *(5242888)(); error(0x0, 0x0, gettext("Options '%s' and '%s' both want standard input")); usage(0x2); } else { v1 = a0; stdin_used_by = a0; return; } }
static void to_base256 (int negative, uintmax_t value, char *where, size_t size) { uintmax_t v = value; uintmax_t propagated_sign_bits = ((uintmax_t) - negative << (8 * sizeof v - 8)); size_t i = size; do { where[--i] = v & ((1 << 8) - 1); v = propagated_sign_bits | (v >> 8); } while (i); }
void to_base256(unsigned long a0, unsigned long a1, char *a2, unsigned long a3) { unsigned int v0; unsigned long long v1; char *v2; unsigned long v3; unsigned long long v5; v0 = a0; v1 = a1; v3 = -(v0) * 0x100000000000000; v2 = a3; do { v2 += 1; *((v2 + a2)) = v1; v5 = v1 >> 8 | v3; v1 = v1 >> 8 | v3; } while (v2); return; }
void usage (int status) { if (status != 0 ) do { fprintf ( stderr , gettext ("Try '%s --help' for more information.\n"), program_name); } while (0); else { printf (gettext ("Usage: %s [OPTION]... [FILE]...\n") , program_name); fputs_unlocked (gettext ("Convert tabs in each FILE to spaces, writing to standard output.\n"), stdout ) ; emit_stdin_note (); emit_mandatory_arg_note (); fputs_unlocked (gettext (" -i, --initial do not convert tabs after non blanks\n -t, --tabs=N have tabs N characters apart, not 8\n"), stdout ) ; emit_tab_list_info (); fputs_unlocked (gettext (" --help display this help and exit\n"), stdout ); fputs_unlocked (gettext (" --version output version information and exit\n"), stdout ); emit_ancillary_info ("expand"); } exit (status); }
void usage(int param_1) { FILE *pFVar1; undefined8 uVar2; char *pcVar3; uVar2 = program_name; if (param_1 == 0) { pcVar3 = (char *)gettext("Usage: %s [OPTION]... [FILE]...\n"); printf(pcVar3,uVar2); pFVar1 = stdout; pcVar3 = (char *)gettext("Convert tabs in each FILE to spaces, writing to standard output.\n"); fputs_unlocked(pcVar3,pFVar1); emit_stdin_note(); emit_mandatory_arg_note(); pFVar1 = stdout; pcVar3 = (char *)gettext( " -i, --initial do not convert tabs after non blanks\n -t, --tabs=N have tabs N characters apart, not 8\n" ); fputs_unlocked(pcVar3,pFVar1); emit_tab_list_info(); pFVar1 = stdout; pcVar3 = (char *)gettext(" --help display this help and exit\n"); fputs_unlocked(pcVar3,pFVar1); pFVar1 = stdout; pcVar3 = (char *)gettext(" --version output version information and exit\n"); fputs_unlocked(pcVar3,pFVar1); emit_ancillary_info(); } else { pcVar3 = (char *)gettext("Try \'%s --help\' for more information.\n"); fprintf(stderr,pcVar3,uVar2); } exit(param_1); }
static void process_output(struct ssh *ssh, int connection_out) { int r; if ((r = ssh_packet_write_poll(ssh)) != 0) { sshpkt_fatal(ssh, r, "%s: ssh_packet_write_poll", __func__); } }
long process_output(long a1) { long result; result = ssh_packet_write_poll(a1); if ( (_DWORD)result ) return sshpkt_fatal(a1, (unsigned int)result, "%s: ssh_packet_write_poll", "process_output"); return result; }
== nonexistent || strcmp (pwd->pw_dir, nonexistent) != 0) { printf (gettext ("user '%s': directory '%s' does not exist\n"), pwd->pw_name, pwd->pw_dir); *errors += 1; }
int strcmp(char *__s1,char *__s2) { halt_baddata(); }
inline void flush_eltstate (array_eltstate_t *estatep) { if (estatep) do { if (estatep->key) sh_xfree((estatep->key), "arrayfunc.c", 337); } while (0); }
long long flush_eltstate(struct_0 *a0) { unsigned long long v1; if (a0) { v1 = a0->field_10; if (a0->field_10) v1 = sh_xfree(a0->field_10, "arrayfunc.c", 0x151); } return v1; }
int ga_match_pattern_list(const char *group_pattern) { int i, found = 0; for (i = 0; i < ngroups; i++) { switch (match_usergroup_pattern_list(groups_byname[i], group_pattern)) { case -1: return 0; case 0: continue; case 1: found = 1; } } return found; }
long ga_match_pattern_list(long a1) { int matched; int i; unsigned int v4; v4 = 0; for ( i = 0; i < ngroups; ++i ) { matched = match_usergroup_pattern_list(*((_QWORD *)groups_byname + i), a1); if ( matched == 1 ) { v4 = 1; } else if ( matched == -1 ) { return 0LL; } } return v4; }
static void really_add_history (line) char *line; { hist_last_line_added = 1; hist_last_line_pushed = 0; add_history (line); history_lines_this_session++; }
void really_add_history(unsigned long long a0) { unsigned long long v1; dont_save_function_defs = 1; dont_save_function_defs = 0; add_history(a0); v1 = 3850979414; dont_save_function_defs = 3850979414; return; }
int main (int argc, char **argv) { const struct spwd *sp; uid_t ruid; gid_t rgid; const struct passwd *pw; Prog = Basename (argv[0]); log_set_progname(Prog); log_set_logfd( stderr ); sanitize_env (); (void) setlocale ( 6 , ""); (void) bindtextdomain ("shadow", "/usr/share/locale"); (void) textdomain ("shadow"); process_root_flag ("-R", argc, argv); openlog("chage", ( 0x01 ), (10<<3) ); ruid = getuid (); rgid = getgid (); amroot = (ruid == 0); process_flags (argc, argv); check_perms (); if (!spw_file_present ()) { fprintf ( stderr , gettext ("%s: the shadow password file is not present\n"), Prog); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 4 , "can't find the shadow password file") ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); closelog (); exit (15); } open_files (lflg); if (lflg && ( (setregid (rgid, rgid) != 0) || (setreuid (ruid, ruid) != 0))) { fprintf ( stderr , gettext ("%s: failed to drop privileges (%s)\n"), Prog, strerror ( (*__errno_location ()) )); fail_exit (1); } pw = pw_locate (argv[optind]); if ( ((void *)0) == pw) { fprintf ( stderr , gettext ("%s: user '%s' does not exist in %s\n"), Prog, argv[optind], pw_dbname ()); closelog (); fail_exit (1); } (strncpy((user_name), (pw->pw_name), sizeof(user_name) - 1), (user_name)[sizeof(user_name) - 1] = '\0'); user_uid = pw->pw_uid; sp = spw_locate (argv[optind]); get_defaults (sp); if (lflg) { if (!amroot && (ruid != user_uid)) { fprintf ( stderr , gettext ("%s: Permission denied.\n"), Prog); fail_exit (1); } list_fields (); fail_exit ( 0 ); } if (!mflg && !Mflg && !dflg && !Wflg && !Iflg && !Eflg) { printf (gettext ("Changing the aging information for %s\n"), user_name); if (new_fields () == 0) { fprintf ( stderr , gettext ("%s: error changing fields\n"), Prog); fail_exit (1); } } else { } update_age (sp, pw); close_files (); 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 ( 6 , "changed password expiry for %s", user_name) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); closelog (); exit ( 0 ); }
int main(unsigned long long a0, unsigned long long *a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned int v0; unsigned int v1; void* v2; void* v3; struct_0 *v4; void* v5; char *v6; char *v7; unsigned long v8; unsigned long v9; unsigned long v10; unsigned long v12; unsigned long v13; unsigned long v14; unsigned long long v16; unsigned long long v17; v10 = v12; v9 = v13; v8 = v14; Prog = Basename(*(a1)); log_set_progname(0x8930ec8348535441); log_set_logfd(stderr); sanitize_env(a0, a1, a2, a3, a4, a5); setlocale(0x6, &g_404394); bindtextdomain("shadow", "/usr/share/locale"); textdomain("shadow"); process_root_flag("-R", a0, a1); openlog("chage", 0x1, 0x50); v0 = getuid(); v1 = getgid(); amroot = !v0; process_flags(a0, a1); check_perms(); if ((spw_file_present(a0, a1, a2, a3, a4, a5) ^ 1)) { fprintf(stderr, gettext("%s: the shadow password file is not present\n")); v7 = setlocale(0x6, NULL); v2 = 0; if (v7) v2 = strdup(v7); if (v2) setlocale(0x6, "C"); syslog(0x4, "can't find the shadow password file"); if (v2) { setlocale(0x6, v2); free(v2); } closelog(); exit(0xf); } else { open_files(lflg); if (lflg && (!(!setregid(v1, v1)) || !(!setreuid(v0, v0)))) { v16 = strerror(*(__errno_location())); fprintf(stderr, gettext("%s: failed to drop privileges (%s)\n")); fail_exit(0x1); } v4 = pw_locate(a1[optind]); if (!v4) { v17 = pw_dbname(); fprintf(stderr, gettext("%s: user '%s' does not exist in %s\n")); closelog(); fail_exit(0x1); } strncpy(&user_name, v4->field_0, 0x1fff); g_403f5f = 0; user_uid = v4->field_10; v5 = spw_locate(a1[optind]); get_defaults(v5); if (lflg) { if ((amroot ^ 1) && v0 != user_uid) { fprintf(stderr, gettext("%s: Permission denied.\n")); fail_exit(0x1); } list_fields(); fail_exit(0x0); } else { if ((mflg ^ 1) && (Mflg ^ 1) && (dflg ^ 1) && (Wflg ^ 1) && (Iflg ^ 1) && (Eflg ^ 1)) { printf(gettext("Changing the aging information for %s\n")); if (!new_fields()) { fprintf(stderr, gettext("%s: error changing fields\n")); fail_exit(0x1); } } update_age(v5, v4); close_files(); v6 = setlocale(0x6, NULL); v3 = 0; if (v6) v3 = strdup(v6); if (v3) setlocale(0x6, "C"); syslog(0x6, "changed password expiry for %s"); if (v3) { setlocale(0x6, v3); free(v3); } closelog(); exit(0x0); } } }
static void cmd_parser(int argc, char **argv) { process_options(argc,argv); disable_client_cert = gnutls_serv_options.present.disable_client_cert; require_cert = gnutls_serv_options.enabled.require_client_cert; if (gnutls_serv_options.present.debug) debug = gnutls_serv_options.value.debug; if (gnutls_serv_options.present.quiet) verbose = 0; if (gnutls_serv_options.present.priority) priorities = gnutls_serv_options.arg.priority; if (gnutls_serv_options.present.list) { print_list(priorities, verbose); exit(0); } nodb = gnutls_serv_options.present.nodb; noticket = gnutls_serv_options.present.noticket; earlydata = gnutls_serv_options.present.earlydata; if (gnutls_serv_options.present.echo) { http = 0; if (gnutls_serv_options.present.crlf) strip_crlf = 0; } else http = 1; record_max_size = gnutls_serv_options.value.recordsize; if (gnutls_serv_options.present.x509fmtder) x509ctype = GNUTLS_X509_FMT_DER; else x509ctype = GNUTLS_X509_FMT_PEM; generate = gnutls_serv_options.present.generate; if (gnutls_serv_options.present.dhparams) dh_params_file = gnutls_serv_options.arg.dhparams; if (gnutls_serv_options.present.alpn) { alpn_protos = gnutls_serv_options.list.alpn.args; alpn_protos_size = gnutls_serv_options.list.alpn.count; } if (gnutls_serv_options.present.x509keyfile) { x509_keyfile = gnutls_serv_options.list.x509keyfile.args; x509_keyfile_size = gnutls_serv_options.list.x509keyfile.count; } if (gnutls_serv_options.present.x509certfile) { x509_certfile = gnutls_serv_options.list.x509certfile.args; x509_certfile_size = gnutls_serv_options.list.x509certfile.count; } if (x509_certfile_size != x509_keyfile_size) { fprintf( stderr , "The certificate number provided (%u) doesn't match the keys (%u)\n", x509_certfile_size, x509_keyfile_size); exit(1); } if (gnutls_serv_options.present.x509cafile) x509_cafile = gnutls_serv_options.arg.x509cafile; if (gnutls_serv_options.present.x509crlfile) x509_crlfile = gnutls_serv_options.arg.x509crlfile; if (gnutls_serv_options.present.rawpkkeyfile) { rawpk_keyfile = gnutls_serv_options.list.rawpkkeyfile.args; rawpk_keyfile_size = gnutls_serv_options.list.rawpkkeyfile.count; } if (gnutls_serv_options.present.rawpkfile) { rawpk_file = gnutls_serv_options.list.rawpkfile.args; rawpk_file_size = gnutls_serv_options.list.rawpkfile.count; } if (rawpk_file_size != rawpk_keyfile_size) { fprintf( stderr , "The number of raw public-keys provided (%u) doesn't match the number of corresponding private keys (%u)\n", rawpk_file_size, rawpk_keyfile_size); exit(1); } if (gnutls_serv_options.present.srppasswd) srp_passwd = gnutls_serv_options.arg.srppasswd; if (gnutls_serv_options.present.srppasswdconf) srp_passwd_conf = gnutls_serv_options.arg.srppasswdconf; if (gnutls_serv_options.present.pskpasswd) psk_passwd = gnutls_serv_options.arg.pskpasswd; if (gnutls_serv_options.present.ocsp_response) { ocsp_responses = gnutls_serv_options.list.ocsp_response.args; ocsp_responses_size = gnutls_serv_options.list.ocsp_response.count; } if (gnutls_serv_options.present.sni_hostname) sni_hostname = gnutls_serv_options.arg.sni_hostname; if (gnutls_serv_options.present.sni_hostname_fatal) sni_hostname_fatal = 1; if (gnutls_serv_options.present.httpdata) http_data_file = gnutls_serv_options.arg.httpdata; }
void cmd_parser(unsigned long a0, unsigned long long a1) { unsigned long long v1; unsigned long long v2; process_options(a0, a1, a1); disable_client_cert = g_5000d2; require_cert = g_50023b; if (gnutls_serv_options) debug = gnutls_srtp_set_profile_direct; if (g_5000ca) verbose = 0; if (malloc) priorities = gnutls_db_set_remove_function; if (realloc) { print_list(priorities, verbose, verbose); exit(0x0); } nodb = g_5000cb; noticket = g_5000c5; earlydata = g_5000c6; if (g_5000cd) { http = 0; if (g_5000ce) strip_crlf = 0; } else { http = 1; } record_max_size = g_5001b4; if (g_5000d7) x509ctype = 0; else x509ctype = 1; generate = g_5000c9; if (g_5000d9) dh_params_file = gnutls_db_set_store_function; if (g_5000c3) { alpn_protos = gnutls_x509_crt_init; alpn_protos_size = gnutls_x509_crt_import; } if (g_5000dd) { x509_keyfile = memcpy; x509_keyfile_size = gnutls_free; } if (g_5000de) { x509_certfile = gnutls_x509_crt_deinit; x509_certfile_size = gnutls_protocol_get_version; } if (x509_certfile_size != x509_keyfile_size) { fprintf(*(&stderr), "The certificate number provided (%u) doesn't match the keys (%u)\n", x509_certfile_size, x509_keyfile_size); exit(0x1); } if (g_5000da) x509_cafile = gnutls_db_set_ptr; if (g_5000db) x509_crlfile = gnutls_session_ticket_enable_server; if (g_5000df) { rawpk_keyfile = gnutls_session_get_id; rawpk_keyfile_size = snprintf; } if (gnutls_server_name_get) { rawpk_file = gnutls_kx_get; rawpk_file_size = gnutls_srp_server_get_username; } if (rawpk_file_size != rawpk_keyfile_size) { fprintf(*(&stderr), "The number of raw public-keys provided (%u) doesn't match the number of corresponding private keys (%u)\n", rawpk_file_size, rawpk_keyfile_size); exit(0x1); } if (g_5000e1) srp_passwd = gnutls_record_set_max_early_data_size; if (g_5000e2) srp_passwd_conf = gnutls_handshake_set_post_client_hello_function; if (g_5000e3) psk_passwd = gnutls_set_default_priority; if (g_5000e5) { ocsp_responses = gnutls_psk_server_get_username; ocsp_responses_size = strcat; } if (g_5000c1) sni_hostname = gnutls_init; if (g_5000c2) sni_hostname_fatal = 1; v1 = g_5000ed; if (g_5000ed) { v2 = compress_cert_set_methods; http_data_file = compress_cert_set_methods; } return; }