input
stringlengths
28
169k
output
stringlengths
20
317k
int cipher_crypt(struct sshcipher_ctx *cc, u_int seqnr, u_char *dest, const u_char *src, u_int len, u_int aadlen, u_int authlen) { if ((cc->cipher->flags & (1<<1)) != 0) { return chachapoly_crypt(cc->cp_ctx, seqnr, dest, src, len, aadlen, authlen, cc->encrypt); } if ((cc->cipher->flags & (1<<3)) != 0) { memcpy(dest, src, aadlen + len); return 0; } if (authlen) { u_char lastiv[1]; if (authlen != cipher_authlen(cc->cipher)) return -10; if (!EVP_CIPHER_CTX_ctrl(cc->evp, 0x13 , 1, lastiv)) return -22; if (!cc->encrypt && !EVP_CIPHER_CTX_ctrl(cc->evp, 0x11 , authlen, (u_char *)src + aadlen + len)) return -22; } if (aadlen) { if (authlen && EVP_Cipher(cc->evp, ((void *)0) , (u_char *)src, aadlen) < 0) return -22; memcpy(dest, src, aadlen); } if (len % cc->cipher->block_size) return -10; if (EVP_Cipher(cc->evp, dest + aadlen, (u_char *)src + aadlen, len) < 0) return -22; if (authlen) { if (EVP_Cipher(cc->evp, ((void *)0) , ((void *)0) , 0) < 0) return cc->encrypt ? -22 : -30; if (cc->encrypt && !EVP_CIPHER_CTX_ctrl(cc->evp, 0x10 , authlen, dest + aadlen + len)) return -22; } return 0; }
long long cipher_crypt(struct_0 *a0, unsigned long a1, void* a2, unsigned long long a3, unsigned long a4, unsigned long a5, unsigned int v2) { unsigned long v0; char v1; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; unsigned long long v9; unsigned long long v10; if ((a0->field_120->field_18 & 2)) { v0 = a0->field_4; v3 = chachapoly_crypt(a0->field_10, a1, a2, a3, a4, a5, v2); } else if ((a0->field_120->field_18 & 8)) { memcpy(a2, a3, a4 + a5); v3 = 0; } else { if (v2) { v4 = cipher_authlen(a0->field_120); if (v2 != v4) { v3 = 4294967286; } else { v5 = EVP_CIPHER_CTX_ctrl(a0->field_8, 0x13, 0x1, &v1); if (!v5) { v3 = 4294967274; } else if (!a0->field_4) { v6 = EVP_CIPHER_CTX_ctrl(a0->field_8, 0x11, v2, a5 + a4 + a3); if (!v6) v3 = 4294967274; } } } if (!v2 || v2 == v4 && v6 && v5 || v2 == v4 && v5 && a0->field_4) { if (a5) { if (v2) { v7 = EVP_Cipher(a0->field_8, 0x0, a3, a5); if (v7 < 0) v3 = 4294967274; } if (!v2 || v7 >= 0) memcpy(a2, a3, a5); } if (!a5 || !v2 || v7 >= 0) { if ((0 CONCAT a4) /m a0->field_120->field_8 >> 32) { v3 = 4294967286; } else if (EVP_Cipher(a0->field_8, a5 + a2, a5 + a3, a4) < 0) { v3 = 4294967274; } else { if (v2) { v9 = EVP_Cipher(a0->field_8, 0x0, 0x0, 0x0); if (v9 < 0) { if (a0->field_4) v3 = 4294967274; else v3 = 4294967266; } else { if (a0->field_4) { v10 = EVP_CIPHER_CTX_ctrl(a0->field_8, 0x10, v2, a5 + a4 + a2); if (!v10) v3 = 4294967274; } } } if (!v2 || !a0->field_4 && v9 >= 0 || v10 && v9 >= 0) v3 = 0; } } } } return v3; }
int main (int argc, char **argv) { unsigned int n_files; _Bool old_options = 0 ; _Bool old_w = 0 ; _Bool old_s = 0 ; char **file_names; char *column_count_string = ((void *)0) ; size_t n_digits = 0; size_t n_alloc = 0; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdout); n_files = 0; file_names = (argc > 1 ? xnmalloc (argc - 1, sizeof (char *)) : ((void *)0) ); while ( 1 ) { int oi = -1; int c = getopt_long (argc, argv, short_options, long_options, &oi); if (c == -1) break; if (((unsigned int) (c) - '0' <= 9)) { if (n_digits + 1 >= n_alloc) column_count_string = ((!!sizeof (struct { _Static_assert (sizeof *(column_count_string) == 1, "verify_expr (" "sizeof *(column_count_string) == 1" ", " "x2realloc (column_count_string, &n_alloc)" ")"); int _gl_dummy; })) ? (x2realloc (column_count_string, &n_alloc)) : (x2realloc (column_count_string, &n_alloc))); column_count_string[n_digits++] = c; column_count_string[n_digits] = '\0'; continue; } n_digits = 0; switch (c) { case 1: if (! (first_page_number == 0 && *optarg == '+' && first_last_page (-2, '+', optarg + 1))) file_names[n_files++] = optarg; break; case PAGES_OPTION: { if (! optarg) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"'--pages=FIRST_PAGE[:LAST_PAGE]' missing argument\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("'--pages=FIRST_PAGE[:LAST_PAGE]' missing argument")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("'--pages=FIRST_PAGE[:LAST_PAGE]' missing argument")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; else if (! first_last_page (oi, 0, optarg)) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"invalid page range %s\"), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("invalid page range %s"), quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("invalid page range %s"), quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; break; } case COLUMNS_OPTION: { parse_column_count (optarg); free (column_count_string); column_count_string = ((void *)0) ; n_alloc = 0; break; } case 'a': print_across_flag = 1 ; storing_columns = 0 ; break; case 'b': balance_columns = 1 ; break; case 'c': use_cntrl_prefix = 1 ; break; case 'd': double_space = 1 ; break; case 'D': date_format = optarg; break; case 'e': if (optarg) getoptarg (optarg, 'e', &input_tab_char, &chars_per_input_tab); untabify_input = 1 ; break; case 'f': case 'F': use_form_feed = 1 ; break; case 'h': custom_header = optarg; break; case 'i': if (optarg) getoptarg (optarg, 'i', &output_tab_char, &chars_per_output_tab); tabify_output = 1 ; break; case 'J': join_lines = 1 ; break; case 'l': getoptnum (optarg, 1, &lines_per_page, gettext ("'-l PAGE_LENGTH' invalid number of lines")); break; case 'm': parallel_files = 1 ; storing_columns = 0 ; break; case 'n': numbered_lines = 1 ; if (optarg) getoptarg (optarg, 'n', &number_separator, &chars_per_number); break; case 'N': skip_count = 0 ; getoptnum (optarg, (-0x7fffffff - 1) , &start_line_num, gettext ("'-N NUMBER' invalid starting line number")); break; case 'o': getoptnum (optarg, 0, &chars_per_margin, gettext ("'-o MARGIN' invalid line offset")); break; case 'r': ignore_failed_opens = 1 ; break; case 's': old_options = 1 ; old_s = 1 ; if (!use_col_separator && optarg) separator_string (optarg); break; case 'S': old_s = 0 ; col_sep_string = ""; col_sep_length = 0; use_col_separator = 1 ; if (optarg) separator_string (optarg); break; case 't': extremities = 0 ; keep_FF = 1 ; break; case 'T': extremities = 0 ; keep_FF = 0 ; break; case 'v': use_esc_sequence = 1 ; break; case 'w': old_options = 1 ; old_w = 1 ; { int tmp_cpl; getoptnum (optarg, 1, &tmp_cpl, gettext ("'-w PAGE_WIDTH' invalid number of characters")); if (! truncate_lines) chars_per_line = tmp_cpl; } break; case 'W': old_w = 0 ; truncate_lines = 1 ; getoptnum (optarg, 1, &chars_per_line, gettext ("'-W PAGE_WIDTH' invalid number of characters")); break; case GETOPT_HELP_CHAR: usage ( 0 ); break;; case GETOPT_VERSION_CHAR: version_etc ( stdout , "pr", "GNU coreutils", Version, ("Pete TerMaat"), ("Roland Huebner"), (char *) ((void *)0) ); exit ( 0 ); break;; default: usage ( 1 ); break; } } if (column_count_string) { parse_column_count (column_count_string); free (column_count_string); } if (! date_format) date_format = (getenv ("POSIXLY_CORRECT") && !hard_locale ( 2 ) ? "%b %e %H:%M %Y" : "%Y-%m-%d %H:%M"); localtz = tzalloc (getenv ("TZ")); if (first_page_number == 0) first_page_number = 1; if (parallel_files && explicit_columns) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot specify number of columns when printing in parallel\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("cannot specify number of columns when printing in parallel")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("cannot specify number of columns when printing in parallel")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; if (parallel_files && print_across_flag) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot specify both printing across and printing in parallel\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("cannot specify both printing across and printing in parallel")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("cannot specify both printing across and printing in parallel")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; if (old_options) { if (old_w) { if (parallel_files || explicit_columns) { truncate_lines = 1 ; if (old_s) use_col_separator = 1 ; } else join_lines = 1 ; } else if (!use_col_separator) { if (old_s && (parallel_files || explicit_columns)) { if (!truncate_lines) { join_lines = 1 ; if (col_sep_length > 0) use_col_separator = 1 ; } else use_col_separator = 1 ; } } } for (; optind < argc; optind++) { file_names[n_files++] = argv[optind]; } if (n_files == 0) { print_files (0, ((void *)0) ); } else { if (parallel_files) print_files (n_files, file_names); else { for (unsigned int i = 0; i < n_files; i++) print_files (1, &file_names[i]); } } cleanup (); if (have_read_stdin && rpl_fclose ( stdin ) == (-1) ) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"standard input\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , gettext ("standard input")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , gettext ("standard input")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); return failed_opens ? 1 : 0 ; }
int main(unsigned long a0, unsigned long long *a1) { int tmp_17; int tmp_12; void* v0; int tmp_36; char v1; char v2; char v3; unsigned int v4; char v5; unsigned int v6; unsigned int v7; unsigned int v8; void* v9; void* v10; void* v11; void* v12; void* v14; unsigned long long v15; unsigned long long v16; v1 = 0; v2 = 0; v3 = 0; v10 = 0; v11 = 0; v9 = 0; set_program_name(*(a1)); setlocale(0x6, &g_403efb); bindtextdomain("coreutils", "/usr/local/share/locale"); textdomain("coreutils"); atexit(got.close_stdout); v6 = 0; if (a0 <= 1) v14 = 0; else v14 = xnmalloc(a0 - 1, 0x8); v12 = v14; while (true) { v4 = -1; v8 = getopt_long(a0, a1, "-0123456789D:FJN:S::TW:abcde::fh:i::l:mn::o:rs::tvw:", &long_options, &v4); if (v8 == -1) break; if (v8 - 48 <= 9) { if (v11 + 1 >= v9) v10 = x2realloc(v10, &v9, &v9); tmp_17 = v11; v11 += 1; *(tmp_17 + v10) = v8; *((v11 + v10)) = 0; continue; } v11 = 0; if (!(v8 <= 129)) goto LABEL_400c0d; if (v8 > 0) { switch (v8) { case 1: if (!first_page_number && *(*(&optarg)) == 43) { *(&v14) = first_last_page(0xfffffffe, 0x2b, *(&optarg) + 1) ^ 1; if (!v14) goto LABEL_400c17; } tmp_12 = v6; v6 += 1; *((8 * tmp_12 + v12)) = *(&optarg); LABEL_400c17: continue; case 68: date_format = *(&optarg); break; case 70: case 102: use_form_feed = 1; break; case 74: join_lines = 1; break; case 78: skip_count = 0; getoptnum(*(&optarg), 0x80000000, &start_line_num, gettext("'-N NUMBER' invalid starting line number")); break; case 83: v3 = 0; col_sep_string = &g_403efb; col_sep_length = 0; use_col_separator = 1; if (*(&optarg)) separator_string(*(&optarg)); continue; case 84: extremities = 0; keep_FF = 0; break; case 87: v2 = 0; truncate_lines = 1; getoptnum(*(&optarg), 0x1, &chars_per_line, gettext("'-W PAGE_WIDTH' invalid number of characters")); continue; case 97: print_across_flag = 1; storing_columns = 0; break; case 98: balance_columns = 1; break; case 99: use_cntrl_prefix = 1; break; case 100: double_space = 1; break; case 101: if (*(&optarg)) getoptarg(*(&optarg), 0x65, &input_tab_char, &chars_per_input_tab); untabify_input = 1; break; case 104: custom_header = *(&optarg); break; case 105: if (*(&optarg)) getoptarg(*(&optarg), 0x69, &output_tab_char, &chars_per_output_tab); tabify_output = 1; break; case 108: getoptnum(*(&optarg), 0x1, &lines_per_page, gettext("'-l PAGE_LENGTH' invalid number of lines")); break; case 109: parallel_files = 1; storing_columns = 0; break; case 110: numbered_lines = 1; if (*(&optarg)) getoptarg(*(&optarg), 0x6e, &number_separator, &chars_per_number); continue; case 111: getoptnum(*(&optarg), 0x0, &chars_per_margin, gettext("'-o MARGIN' invalid line offset")); break; case 114: ignore_failed_opens = 1; break; case 115: v1 = 1; v3 = 1; if ((use_col_separator ^ 1) && *(&optarg)) separator_string(*(&optarg)); continue; case 116: extremities = 0; keep_FF = 1; break; case 118: use_esc_sequence = 1; break; case 119: v1 = 1; v2 = 1; getoptnum(*(&optarg), 0x1, &v5, gettext("'-w PAGE_WIDTH' invalid number of characters")); if ((truncate_lines ^ 1)) chars_per_line = *(&v5); break; case 128: parse_column_count(*(&optarg)); free(v10); v10 = 0; v9 = 0; break; case 129: if (!*(&optarg)) error(0x1, 0x0, gettext("'--pages=FIRST_PAGE[:LAST_PAGE]' missing argument")); *(&v14) = first_last_page(v4, 0x0, *(&optarg)) ^ 1; if (v14) { v15 = quote(*(&optarg)); error(0x1, 0x0, gettext("invalid page range %s")); } continue; default: LABEL_400c0d: usage(0x1); } } else if (v8 == -131) { v0 = 0; version_etc(stdout, "pr", "GNU coreutils", Version, "Pete TerMaat", "Roland Huebner"); exit(0x0); } else if (v8 == -130) { usage(0x0); } } if (v10) { parse_column_count(v10); free(v10); } if (date_format) goto LABEL_400c98; if (getenv("POSIXLY_CORRECT")) { *(&v14) = hard_locale(0x2) ^ 1; if (v14) { v16 = "%b %e %H:%M %Y"; goto LABEL_400c91; } } v16 = "%Y-%m-%d %H:%M"; LABEL_400c91: date_format = v16; LABEL_400c98: localtz = tzalloc(getenv("TZ")); if (!first_page_number) first_page_number = 1; if (parallel_files && explicit_columns) error(0x1, 0x0, gettext("cannot specify number of columns when printing in parallel")); if (parallel_files && print_across_flag) error(0x1, 0x0, gettext("cannot specify both printing across and printing in parallel")); if (v1) { if (v2) { if (!parallel_files && !explicit_columns) join_lines = 1; truncate_lines = 1; if (v3) use_col_separator = 1; } else if (!(truncate_lines ^ 1)) { use_col_separator = 1; } else { join_lines = 1; if (col_sep_length > 0) use_col_separator = 1; } } for (; a0 > optind; optind = optind + 1) { tmp_36 = v6; v6 += 1; *((8 * tmp_36 + v12)) = a1[optind]; } if (!v6) { print_files(0x0, 0x0); } else if (parallel_files) { print_files(v6, v12); } else { for (v7 = 0; v7 < v6; v7 += 1) { print_files(0x1, v12 + v7 * 8); } } cleanup(); if (have_read_stdin && rpl_fclose(stdin) == -1) error(0x1, *(__errno_location()), gettext("standard input")); return failed_opens; }
static void usage (void) { char const * const *p; printf (gettext ("Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"), program_name); printf ("%s\n\n", gettext ("Compare three files line by line.")); fputs_unlocked (gettext ("Mandatory arguments to long options are mandatory for short options too.\n"), stdout ) ; for (p = option_help_msgid; *p; p++) if (**p) printf (" %s\n", gettext (*p)); else putchar_unlocked ('\n'); fputs_unlocked (gettext ("\nThe default output format is a somewhat human-readable representation of\nthe changes.\n\nThe -e, -E, -x, -X (and corresponding long) options cause an ed script\nto be output instead of the default.\n\nFinally, the -m (--merge) option causes diff3 to do the merge internally\nand output the actual merged file. For unusual input, this is more\nrobust than using ed.\n"), stdout ) ; printf ("\n%s\n%s\n", gettext ("If a FILE is '-', read standard input."), gettext ("Exit status is 0 if successful, 1 if conflicts, 2 if trouble.")); emit_bug_reporting_address (); }
long usage() { long v0; char *v1; char *v2; FILE *v3; char *v4; char *v5; FILE *v6; char *v7; char *v8; char *v9; const char **i; v0 = program_name; v1 = gettext("Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"); printf(v1, v0); v2 = gettext("Compare three files line by line."); printf("%s\n\n", v2); v3 = stdout; v4 = gettext("Mandatory arguments to long options are mandatory for short options too.\n"); fputs_unlocked(v4, v3); for ( i = (const char **)&option_help_msgid; *i; ++i ) { if ( **i ) { v5 = gettext(*i); printf(" %s\n", v5); } else { putchar_unlocked(10); } } v6 = stdout; v7 = gettext( "\n" "The default output format is a somewhat human-readable representation of\n" "the changes.\n" "\n" "The -e, -E, -x, -X (and corresponding long) options cause an ed script\n" "to be output instead of the default.\n" "\n" "Finally, the -m (--merge) option causes diff3 to do the merge internally\n" "and output the actual merged file. For unusual input, this is more\n" "robust than using ed.\n"); fputs_unlocked(v7, v6); v8 = gettext("Exit status is 0 if successful, 1 if conflicts, 2 if trouble."); v9 = gettext("If a FILE is '-', read standard input."); printf("\n%s\n%s\n", v9, v8); return emit_bug_reporting_address(); }
static int option_clear_or_none(const char *o) { return o == ((void *)0) || strcasecmp(o, "none") == 0; }
int option_clear_or_none(char *a0) { unsigned int v1; if (!a0) { v1 = 1; return v1; } else if (!strcasecmp(a0, "none")) { v1 = 1; return v1; } else { v1 = 0; return v1; } }
static void store_rename (struct directory *dir, struct obstack *stk) { struct directory *prev, *p; for (prev = dir; prev && prev->orig != dir; prev = prev->orig) ; if (prev == ((void *)0) ) { for (p = dir; p && p->orig; p = p->orig) obstack_code_rename (stk, p->orig->name, p->name); } else { char *temp_name; temp_name = dir_name (dir->name); __extension__ ({ struct obstack *__o = (stk); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < 1) _obstack_newchunk (__o, 1); ((void) (*((__o)->next_free)++ = ('X'))); }); __extension__ ({ struct obstack *__o = (stk); size_t __len = (strlen (temp_name) + 1); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < __len) _obstack_newchunk (__o, __len); memcpy (__o->next_free, temp_name, __len); __o->next_free += __len; (void) 0; }); obstack_code_rename (stk, dir->name, ""); for (p = dir; p != prev; p = p->orig) obstack_code_rename (stk, p->orig->name, p->name); obstack_code_rename (stk, "", prev->name); free (temp_name); } }
void store_rename(long a1, struct obstack *a2) { char *next_free; long i; long k; long j; char *s; size_t n; for ( i = a1; i && a1 != *(_QWORD *)(i + 64); i = *(_QWORD *)(i + 64) ) ; if ( i ) { s = (char *)dir_name(*(_QWORD *)(a1 + 88)); if ( a2->chunk_limit == a2->next_free ) obstack_newchunk(a2, 1); next_free = a2->next_free; a2->next_free = next_free + 1; *next_free = 88; n = strlen(s) + 1; if ( a2->chunk_limit - a2->next_free < n ) obstack_newchunk(a2, n); memcpy(a2->next_free, s, n); a2->next_free += n; obstack_code_rename(a2, *(char **)(a1 + 88), byte_4C14); for ( j = a1; j != i; j = *(_QWORD *)(j + 64) ) obstack_code_rename(a2, *(char **)(*(_QWORD *)(j + 64) + 88LL), *(char **)(j + 88)); obstack_code_rename(a2, byte_4C14, *(char **)(i + 88)); free(s); } else { for ( k = a1; k && *(_QWORD *)(k + 64); k = *(_QWORD *)(k + 64) ) obstack_code_rename(a2, *(char **)(*(_QWORD *)(k + 64) + 88LL), *(char **)(k + 88)); } }
static int gz_fetch(state) gz_statep state; { z_streamp strm = &(state->strm); do { switch(state->how) { case 0: if (gz_look(state) == -1) return -1; if (state->how == 0) return 0; break; case 1: if (gz_load(state, state->out, state->size << 1, &(state->x.have)) == -1) return -1; state->x.next = state->out; return 0; case 2: strm->avail_out = state->size << 1; strm->next_out = state->out; if (gz_decomp(state) == -1) return -1; } } while (state->x.have == 0 && (!state->eof || strm->avail_in)); return 0; }
int gz_fetch(struct_0 *a0) { struct_1 *v0; unsigned int v2; v0 = &a0[219604096115589898].field_38; while (true) { if (a0->field_44 == 2) { v0->field_20 = a0->field_28 * 2; v0->field_18 = a0->field_38; v2 = gz_decomp(a0); if (v2 == -1) { v2 = -1; break; } } else if (a0->field_44 <= 2) { if (!a0->field_44) { v2 = gz_look(a0); if (v2 == -1) { v2 = -1; break; } else if (!a0->field_44) { v2 = 0; break; } } if (a0->field_44 == 1) { v2 = gz_load(a0, a0->field_38, a0->field_28 * 2, a0); if (v2 == -1) { v2 = -1; break; } else { a0->field_8 = a0->field_38; v2 = 0; break; } } } if (a0->field_44 == 2 && v2 != -1 || a0->field_44 > 2 && a0->field_44 != 2 || a0->field_44 != 1 && a0->field_44 && a0->field_44 != 2 || !a0->field_44 && a0->field_44 && v2 != -1 && a0->field_44 != 2) { if (!a0->field_0) { if (!a0->field_50) continue; continue; } v2 = 0; break; } } return v2; }
gnutls_x509_crl_t *load_crl_list(int mand, size_t * crl_size, common_info_st * info) { FILE *fp; static gnutls_x509_crl_t *crl; unsigned int crl_max; int ret; gnutls_datum_t dat; size_t size; *crl_size = 0; if (info->verbose) fprintf( stderr , "Loading CRL list...\n"); if (info->crl == ((void *)0) ) { if (mand) { fprintf( stderr , "missing --load-crl\n"); app_exit(1); } else return ((void *)0) ; } fp = fopen(info->crl, "r"); if (fp == ((void *)0) ) { fprintf( stderr , "Could not open %s\n", info->crl); app_exit(1); } fix_lbuffer(file_size(fp)); size = fread(lbuffer, 1, lbuffer_size - 1, fp); lbuffer[size] = 0; fclose(fp); dat.data = (void *) lbuffer; dat.size = size; ret = gnutls_x509_crl_list_import2(&crl, &crl_max, &dat, GNUTLS_X509_FMT_PEM, 0); if (ret == -34) { ret = gnutls_x509_crl_list_import2(&crl, &crl_max, &dat, GNUTLS_X509_FMT_DER, 0); } if (ret < 0) { fprintf( stderr , "Error loading CRLs: %s\n", gnutls_strerror(ret)); app_exit(1); } *crl_size = crl_max; if (info->verbose) fprintf( stderr , "Loaded %d CRLs.\n", (int) *crl_size); return crl; }
long long load_crl_list(unsigned long a0, unsigned long long *a1, struct_0 *a2) { char v0; unsigned int v1; void* v2; char *v3; unsigned long v4; unsigned int v5; void* v7; *(a1) = 0; if (a2->field_c4) fprintf(stderr, "Loading CRL list...\n"); if (!a2->field_38) { if (a0) { fprintf(stderr, "missing --load-crl\n"); app_exit(0x1); } v7 = 0; } else { v2 = fopen(a2->field_38, "r"); if (!v2) { fprintf(stderr, "Could not open %s\n", a2->field_38); app_exit(0x1); } fix_lbuffer(file_size(v2)); v3 = fread(lbuffer, 0x1, lbuffer_size - 1, v2); v3[lbuffer] = 0; fclose(v2); v4 = lbuffer; v5 = v3; v1 = gnutls_x509_crl_list_import2(&crl.12525, &v0, &v4, 0x1, 0x0); if (v1 == -34) v1 = gnutls_x509_crl_list_import2(&crl.12525, &v0, &v4, 0x0, 0x0); if (v1 < 0) { fprintf(stderr, "Error loading CRLs: %s\n", gnutls_strerror(v1)); app_exit(0x1); } *(a1) = *(&v0); if (a2->field_c4) fprintf(stderr, "Loaded %d CRLs.\n", *(a1)); v7 = crl.12525; } return v7; }
static int server_input_channel_open(int type, u_int32_t seq, struct ssh *ssh) { Channel *c = ((void *)0) ; char *ctype = ((void *)0) ; const char *errmsg = ((void *)0) ; int r, reason = 2; u_int rchan = 0, rmaxpack = 0, rwindow = 0; if ((r = sshpkt_get_cstring(ssh, &ctype, ((void *)0) )) != 0 || (r = sshpkt_get_u32(ssh, &rchan)) != 0 || (r = sshpkt_get_u32(ssh, &rwindow)) != 0 || (r = sshpkt_get_u32(ssh, &rmaxpack)) != 0) sshpkt_fatal(ssh, r, "%s: parse packet", __func__); sshlog("serverloop.c", __func__, 635, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "ctype %s rchan %u win %u max %u", ctype, rchan, rwindow, rmaxpack) ; if (strcmp(ctype, "session") == 0) { c = server_request_session(ssh); } else if (strcmp(ctype, "direct-tcpip") == 0) { c = server_request_direct_tcpip(ssh, &reason, &errmsg); } else if (strcmp(ctype, "direct-streamlocal@openssh.com") == 0) { c = server_request_direct_streamlocal(ssh); } else if (strcmp(ctype, "tun@openssh.com") == 0) { c = server_request_tun(ssh); } if (c != ((void *)0) ) { sshlog("serverloop.c", __func__, 648, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "confirm %s", ctype); c->remote_id = rchan; c->have_remote_id = 1; c->remote_window = rwindow; c->remote_maxpacket = rmaxpack; if (c->type != 12) { if ((r = sshpkt_start(ssh, 91)) != 0 || (r = sshpkt_put_u32(ssh, c->remote_id)) != 0 || (r = sshpkt_put_u32(ssh, c->self)) != 0 || (r = sshpkt_put_u32(ssh, c->local_window)) != 0 || (r = sshpkt_put_u32(ssh, c->local_maxpacket)) != 0 || (r = sshpkt_send(ssh)) != 0) { sshpkt_fatal(ssh, r, "%s: send open confirm", __func__); } } } else { sshlog("serverloop.c", __func__, 665, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "failure %s", ctype); if ((r = sshpkt_start(ssh, 92)) != 0 || (r = sshpkt_put_u32(ssh, rchan)) != 0 || (r = sshpkt_put_u32(ssh, reason)) != 0 || (r = sshpkt_put_cstring(ssh, errmsg ? errmsg : "open failed")) != 0 || (r = sshpkt_put_cstring(ssh, "")) != 0 || (r = sshpkt_send(ssh)) != 0) { sshpkt_fatal(ssh, r, "%s: send open failure", __func__); } } free(ctype); return 0; }
undefined8 server_input_channel_open(undefined8 param_1,undefined4 param_2,undefined8 param_3) { int iVar1; char *pcVar2; long in_FS_OFFSET; undefined8 uVar3; undefined4 local_3c; int local_38; int local_34; int local_30; int local_2c; char *local_28; char *local_20; int *local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_18 = (int *)0x0; local_28 = (char *)0x0; local_20 = (char *)0x0; local_3c = 2; local_38 = 0; local_34 = 0; local_30 = 0; local_2c = sshpkt_get_cstring(param_3,&local_28,0); if (((local_2c == 0) && (local_2c = sshpkt_get_u32(param_3), local_2c == 0)) && (local_2c = sshpkt_get_u32(param_3), local_2c == 0)) { uVar3 = 0x101986; local_2c = sshpkt_get_u32(param_3); if (local_2c != 0) goto LAB_0010198f; } else { LAB_0010198f: uVar3 = 0x1019b1; sshpkt_fatal(param_3,local_2c,"%s: parse packet"); } sshlog("serverloop.c","server_input_channel_open",0x27b,1,5,0,"ctype %s rchan %u win %u max %u", local_28,local_38,local_30,local_34,uVar3,param_3,param_2); iVar1 = strcmp(local_28,"session"); if (iVar1 == 0) { local_18 = (int *)server_request_session(param_3); } else { iVar1 = strcmp(local_28,"direct-tcpip"); if (iVar1 == 0) { local_18 = (int *)server_request_direct_tcpip(param_3,&local_3c,&local_20); } else { iVar1 = strcmp(local_28,"direct-streamlocal@openssh.com"); if (iVar1 == 0) { local_18 = (int *)server_request_direct_streamlocal(param_3); } else { iVar1 = strcmp(local_28,"tun@openssh.com"); if (iVar1 == 0) { local_18 = (int *)server_request_tun(param_3); } } } } if (local_18 != (int *)0x0) { sshlog("serverloop.c","server_input_channel_open",0x288,1,5,0,"confirm %s",local_28); local_18[2] = local_38; local_18[3] = 1; local_18[0x2a] = local_30; local_18[0x2b] = local_34; if ((*local_18 == 0xc) || ((((local_2c = sshpkt_start(param_3,0x5b), local_2c == 0 && (local_2c = sshpkt_put_u32(param_3,local_18[2]), local_2c == 0)) && ((local_2c = sshpkt_put_u32(param_3,local_18[1]), local_2c == 0 && ((local_2c = sshpkt_put_u32(param_3,local_18[0x2c]), local_2c == 0 && (local_2c = sshpkt_put_u32(param_3,local_18[0x2f]), local_2c == 0)))))) && (local_2c = sshpkt_send(param_3), local_2c == 0)))) goto LAB_00101d25; sshpkt_fatal(param_3,local_2c,"%s: send open confirm","server_input_channel_open"); } sshlog("serverloop.c","server_input_channel_open",0x299,1,5,0,"failure %s",local_28); local_2c = sshpkt_start(param_3,0x5c); if (((local_2c == 0) && (local_2c = sshpkt_put_u32(param_3,local_38), local_2c == 0)) && (local_2c = sshpkt_put_u32(param_3,local_3c), local_2c == 0)) { pcVar2 = local_20; if (local_20 == (char *)0x0) { pcVar2 = "open failed"; } local_2c = sshpkt_put_cstring(param_3,pcVar2); if (((local_2c == 0) && (local_2c = sshpkt_put_cstring(param_3,&DAT_00103301), local_2c == 0)) && (local_2c = sshpkt_send(param_3), local_2c == 0)) goto LAB_00101d25; } sshpkt_fatal(param_3,local_2c,"%s: send open failure","server_input_channel_open"); LAB_00101d25: free(local_28); if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return 0; } __stack_chk_fail(); }
static void nh_update(nh_ctx *hc, const UINT8 *buf, UINT32 nbytes) { UINT32 i,j; j = hc->next_data_empty; if ((j + nbytes) >= 64) { if (j) { i = 64 - j; memcpy(hc->data+j, buf, i); nh_transform(hc,hc->data,64); nbytes -= i; buf += i; hc->bytes_hashed += 64; } if (nbytes >= 64) { i = nbytes & ~(64 - 1); nh_transform(hc, buf, i); nbytes -= i; buf += i; hc->bytes_hashed += i; } j = 0; } memcpy(hc->data + j, buf, nbytes); hc->next_data_empty = j + nbytes; }
void nh_update(unsigned int a0[278], void* a1, unsigned long a2) { unsigned int v0; void* v1; unsigned int v2; unsigned int v3; unsigned int v7[278]; v1 = a1; v0 = a2; v2 = a0[276]; if (v0 + v2 > 63) { if (v2) { v3 = 64 - v2; memcpy(&a0[260] + v2, v1, v3); nh_transform(a0, &a0[260], 0x40); v0 -= v3; v1 += v3; a0[277] = __addvsi3(a0[277], 0x40); } if (v0 > 63) { v3 = v0 & -64; nh_transform(a0, v1, v3); v0 -= v3; v1 += v3; a0[277] = v3 + a0[277]; } v2 = 0; } memcpy(&a0[260] + v2, v1, v0); v7 = a0; a0[276] = v0 + v2; return; }
static struct sshkey_cert * cert_new(void) { struct sshkey_cert *cert; if ((cert = calloc(1, sizeof(*cert))) == ((void *)0) ) return ((void *)0) ; if ((cert->certblob = sshbuf_new()) == ((void *)0) || (cert->critical = sshbuf_new()) == ((void *)0) || (cert->extensions = sshbuf_new()) == ((void *)0) ) { cert_free(cert); return ((void *)0) ; } cert->key_id = ((void *)0) ; cert->principals = ((void *)0) ; cert->signature_key = ((void *)0) ; cert->signature_type = ((void *)0) ; return cert; }
long * cert_new(void) { long *plVar1; long lVar2; plVar1 = (long *)calloc(1,0x60); if (plVar1 != (long *)0x0) { lVar2 = sshbuf_new(); *plVar1 = lVar2; if (*plVar1 != 0) { lVar2 = sshbuf_new(); plVar1[8] = lVar2; if (plVar1[8] != 0) { lVar2 = sshbuf_new(); plVar1[9] = lVar2; if (plVar1[9] != 0) { plVar1[3] = 0; plVar1[5] = 0; plVar1[10] = 0; plVar1[0xb] = 0; return plVar1; } } } cert_free(plVar1); } return (long *)0x0; }
static inline void emit_ancillary_info (char const *program) { struct infomap { char const *program; char const *node; } const infomap[] = { { "[", "test invocation" }, { "coreutils", "Multi-call invocation" }, { "sha224sum", "sha2 utilities" }, { "sha256sum", "sha2 utilities" }, { "sha384sum", "sha2 utilities" }, { "sha512sum", "sha2 utilities" }, { ((void *)0) , ((void *)0) } }; char const *node = program; struct infomap const *map_prog = infomap; while (map_prog->program && ! (strcmp (program, map_prog->program) == 0)) map_prog++; if (map_prog->node) node = map_prog->node; printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https: char const *lc_messages = setlocale ( 5 , ((void *)0) ); if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1)) { fputs_unlocked (gettext ("Report any translation bugs to " "<https: stdout ) ; } char const *url_program = (strcmp (program, "[") == 0) ? "test" : program; printf (gettext ("Full documentation <%s%s>\n"), "https: printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"), node, node == program ? " invocation" : ""); }
unsigned long emit_ancillary_info(const char *a1) { char *v1; FILE *v2; char *v3; const char *v4; char *v5; const char *v6; char *v7; const char *v9; long *i; const char *v11; const char *v12; long v13[15]; unsigned long v14; v14 = __readfsqword(0x28u); v13[0] = (long)"["; v13[1] = (long)"test invocation"; v13[2] = (long)"coreutils"; v13[3] = (long)"Multi-call invocation"; v13[4] = (long)"sha224sum"; v13[5] = (long)"sha2 utilities"; v13[6] = (long)"sha256sum"; v13[7] = (long)"sha2 utilities"; v13[8] = (long)"sha384sum"; v13[9] = (long)"sha2 utilities"; v13[10] = (long)"sha512sum"; v13[11] = (long)"sha2 utilities"; v13[12] = 0LL; v13[13] = 0LL; v9 = a1; for ( i = v13; *i && strcmp(a1, (const char *)*i); i += 2 ) ; if ( i[1] ) v9 = (const char *)i[1]; v1 = gettext("\n%s online help: <%s>\n"); printf(v1, "GNU coreutils", "https: v11 = setlocale(5, 0LL); if ( v11 && strncmp(v11, "en_", 3uLL) ) { v2 = stdout; v3 = gettext("Report any translation bugs to <https: fputs_unlocked(v3, v2); } if ( !strcmp(a1, "[") ) v4 = "test"; else v4 = a1; v12 = v4; v5 = gettext("Full documentation <%s%s>\n"); printf(v5, "https: if ( v9 == a1 ) v6 = " invocation"; else v6 = locale; v7 = gettext("or available locally via: info '(coreutils) %s%s'\n"); printf(v7, v9, v6); return __readfsqword(0x28u) ^ v14; }
ch_init(EditLine *el) { el->el_line.buffer = calloc(((size_t)1024), sizeof(*el->el_line.buffer)) ; if (el->el_line.buffer == ((void *)0) ) return -1; el->el_line.cursor = el->el_line.buffer; el->el_line.lastchar = el->el_line.buffer; el->el_line.limit = &el->el_line.buffer[((size_t)1024) - 2]; el->el_chared.c_undo.buf = calloc(((size_t)1024), sizeof(*el->el_chared.c_undo.buf)) ; if (el->el_chared.c_undo.buf == ((void *)0) ) return -1; el->el_chared.c_undo.len = -1; el->el_chared.c_undo.cursor = 0; el->el_chared.c_redo.buf = calloc(((size_t)1024), sizeof(*el->el_chared.c_redo.buf)) ; if (el->el_chared.c_redo.buf == ((void *)0) ) return -1; el->el_chared.c_redo.pos = el->el_chared.c_redo.buf; el->el_chared.c_redo.lim = el->el_chared.c_redo.buf + ((size_t)1024); el->el_chared.c_redo.cmd = 28; el->el_chared.c_vcmd.action = 0x00; el->el_chared.c_vcmd.pos = el->el_line.buffer; el->el_chared.c_kill.buf = calloc(((size_t)1024), sizeof(*el->el_chared.c_kill.buf)) ; if (el->el_chared.c_kill.buf == ((void *)0) ) return -1; el->el_chared.c_kill.mark = el->el_line.buffer; el->el_chared.c_kill.last = el->el_chared.c_kill.buf; el->el_chared.c_resizefun = ((void *)0) ; el->el_chared.c_resizearg = ((void *)0) ; el->el_chared.c_aliasfun = ((void *)0) ; el->el_chared.c_aliasarg = ((void *)0) ; el->el_map.current = el->el_map.key; el->el_state.inputmode = 0; el->el_state.doingarg = 0; el->el_state.metanext = 0; el->el_state.argument = 1; el->el_state.lastcmd = 28; return 0; }
long long ch_init(struct_0 *a0) { unsigned long long v1; a0->field_50 = calloc(0x400, 0x4); if (!a0->field_50) { v1 = 4294967295; } else { a0->field_58 = a0->field_50; a0->field_60 = a0->field_50; a0->field_68 = a0->field_50 + 4088; a0->field_378 = calloc(0x400, 0x4); if (!a0->field_378) { v1 = 4294967295; } else { a0->field_368 = -1; a0->field_370 = 0; a0->field_398 = calloc(0x400, 0x4); if (!a0->field_398) { v1 = 4294967295; } else { a0->field_3a0 = a0->field_398; a0->field_3a8 = a0->field_398 + 0x1000; a0->field_3b0 = 28; a0->field_3c0 = 0; a0->field_3c8 = a0->field_50; a0->field_380 = calloc(0x400, 0x4); if (!a0->field_380) { v1 = 4294967295; } else { a0->field_390 = a0->field_50; a0->field_388 = a0->field_380; a0->field_3d0 = 0; a0->field_3e0 = 0; a0->field_3d8 = 0; a0->field_3e8 = 0; a0->field_400 = a0->field_3f8; a0->field_70 = 0; a0->field_74 = 0; a0->field_7c = 0; a0->field_78 = 1; a0->field_80 = 28; v1 = 0; } } } } return v1; }
static _Bool usable_st_size (struct stat const *st) { return (((( st->st_mode )) & 0170000) == (0100000)) || (( st )->st_mode - ( st )->st_mode) || 0 ; }
bool usable_st_size(long a1) { return (*(_DWORD *)(a1 + 24) & 0xF000) == 0x8000; }
static void check_ordering_compatibility (void) { struct keyfield *key; for (key = keylist; key; key = key->next) if (1 < (key->numeric + key->general_numeric + key->human_numeric + key->month + (key->version | key->random | !!key->ignore))) { char opts[sizeof short_options]; key->skipsblanks = key->skipeblanks = key->reverse = 0 ; key_to_opts (key, opts); incompatible_options (opts); } }
void check_ordering_compatibility(void) { long in_FS_OFFSET; long local_40; undefined local_38 [40]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); for (local_40 = keylist; local_40 != 0; local_40 = *(long *)(local_40 + 0x40)) { if (1 < (uint)(byte)(*(long *)(local_40 + 0x20) != 0 | *(byte *)(local_40 + 0x33) | *(byte *)(local_40 + 0x38)) + (uint)*(byte *)(local_40 + 0x32) + (uint)*(byte *)(local_40 + 0x34) + (uint)*(byte *)(local_40 + 0x35) + (uint)*(byte *)(local_40 + 0x36)) { *(undefined *)(local_40 + 0x37) = 0; *(undefined *)(local_40 + 0x31) = *(undefined *)(local_40 + 0x37); *(undefined *)(local_40 + 0x30) = *(undefined *)(local_40 + 0x31); key_to_opts(local_40,local_38); incompatible_options(local_38); } } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
int short_doc_handler (self, defs, arg) char *self; DEF_FILE *defs; char *arg; { register BUILTIN_DESC *builtin; builtin = current_builtin (self, defs); if (builtin->shortdoc) line_error (defs, "%s already has short documentation (%s)", builtin->name, builtin->shortdoc); else builtin->shortdoc = get_arg (self, defs, arg); return (0); }
long long short_doc_handler(unsigned int a0, unsigned long a1, char *a2, unsigned int a3) { unsigned long long v1[3]; v1 = current_builtin(a0, a1, a1, a3); if (v1[2]) line_error(a1, "%s already has short documentation (%s)", v1[0], v1[2]); else v1[2] = get_arg(a0, a1, a2, a1); return 0; }
int owner_map_translate (uid_t uid, uid_t *new_uid, char const **new_name) { int rc = 1; if (owner_map) { struct mapentry ent, *res; ent.orig_id = uid; res = hash_lookup (owner_map, &ent); if (res) { *new_uid = res->new_id; *new_name = res->new_name; return 0; } } if (owner_option != (uid_t) -1) { *new_uid = owner_option; rc = 0; } if (owner_name_option) { *new_name = owner_name_option; rc = 0; } return rc; }
long long owner_map_translate(unsigned long a0, unsigned int *a1, unsigned long long *a2) { unsigned int v0; unsigned long long v1[3]; unsigned long v2; void* v4; v0 = 1; if (owner_map) { v2 = a0; v1[0] = hash_lookup(owner_map, &v2, &v2); if (v1) { *(a1) = v1[1]; *(a2) = v1[2]; v4 = 0; } } if (!v1 || !owner_map) { if (owner_option != -1) { *(a1) = owner_option; v0 = 0; } if (owner_name_option) { *(a2) = owner_name_option; v0 = 0; } v4 = v0; } return v4; }
vi_repeat_prev_char(EditLine *el, wint_t c __attribute__((__unused__))) { el_action_t r; int dir = el->el_search.chadir; r = cv_csearch(el, -dir, el->el_search.chacha, el->el_state.argument, el->el_search.chatflg); el->el_search.chadir = dir; return r; }
undefined vi_repeat_prev_char(long param_1) { int iVar1; undefined uVar2; iVar1 = *(int *)(param_1 + 0x4ac); uVar2 = cv_csearch(param_1,-iVar1,*(undefined4 *)(param_1 + 0x4b0),*(undefined4 *)(param_1 + 0x78) ,(int)*(char *)(param_1 + 0x4b4)); *(int *)(param_1 + 0x4ac) = iVar1; return uVar2; }
static void check_order (const struct line *prev, const struct line *current, int whatfile) { if (check_input_order != CHECK_ORDER_DISABLED && ((check_input_order == CHECK_ORDER_ENABLED) || seen_unpairable)) { if (!issued_disorder_warning[whatfile - 1]) { size_t join_field = whatfile == 1 ? join_field_1 : join_field_2; if (keycmp (prev, current, join_field, join_field) > 0) { size_t len = current->buf.length; if (0 < len && current->buf.buffer[len - 1] == '\n') --len; len = (((0x7fffffff)<( len ))?(0x7fffffff):( len )) ; error ((check_input_order == CHECK_ORDER_ENABLED ? 1 : 0), 0, gettext ("%s:%" "l" "u" ": is not sorted: %.*s"), g_names[whatfile - 1], line_no[whatfile - 1], (int) len, current->buf.buffer); issued_disorder_warning[whatfile - 1] = 1 ; } } } }
long check_order(long a1, long a2, int a3) { long result; unsigned long v4; int v5; long v6; unsigned int v7; long v8; char *v9; char *v10; unsigned long v12; result = (unsigned int)check_input_order; if ( check_input_order != 2 ) { if ( check_input_order == 1 || (result = (unsigned char)seen_unpairable, seen_unpairable) ) { result = (unsigned char)issued_disorder_warning[a3 - 1] ^ 1u; if ( issued_disorder_warning[a3 - 1] != 1 ) { v4 = a3 == 1 ? join_field_1 : join_field_2; result = keycmp(a1, a2, v4, v4); if ( (int)result > 0 ) { v12 = *(_QWORD *)(a2 + 8); if ( v12 && *(_BYTE *)(v12 - 1 + *(_QWORD *)(a2 + 16)) == 10 ) --v12; v5 = 0x7FFFFFFF; if ( v12 < 0x80000000 ) v5 = v12; v6 = *(_QWORD *)(a2 + 16); v7 = v5; v8 = line_no[a3 - 1]; v9 = (&g_names)[a3 - 1]; v10 = gettext("%s:%lu: is not sorted: %.*s"); error(check_input_order == 1, 0, v10, v9, v8, v7, v6); result = a3 - 1; issued_disorder_warning[result] = 1; } } } } return result; }
int main (int argc, char **argv) { _Bool ok = 1 ; int optc; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdout); remove_empty_parents = 0 ; while ((optc = getopt_long (argc, argv, "pv", longopts, ((void *)0) )) != -1) { switch (optc) { case 'p': remove_empty_parents = 1 ; break; case IGNORE_FAIL_ON_NON_EMPTY_OPTION: ignore_fail_on_non_empty = 1 ; break; case 'v': verbose = 1 ; break; case GETOPT_HELP_CHAR: usage ( 0 ); break;; case GETOPT_VERSION_CHAR: version_etc ( stdout , "rmdir", "GNU coreutils", Version, ("David MacKenzie"), (char *) ((void *)0) ); exit ( 0 ); break;; default: usage ( 1 ); } } if (optind == argc) { error (0, 0, gettext ("missing operand")); usage ( 1 ); } for (; optind < argc; ++optind) { char *dir = argv[optind]; if (verbose) prog_fprintf ( stdout , gettext ("removing directory, %s"), quotearg_style (shell_escape_always_quoting_style, dir)); if (rmdir (dir) != 0) { int rmdir_errno = (*__errno_location ()) ; if (ignorable_failure (rmdir_errno, dir)) continue; _Bool custom_error = 0 ; if (rmdir_errno == 20 ) { char const *last_unix_slash = strrchr (dir, '/'); if (last_unix_slash && (*(last_unix_slash + 1) == '\0')) { struct stat st; int ret = stat (dir, &st); if ((ret != 0 && (*__errno_location ()) != 20 ) || (ret == 0 && (((( st.st_mode )) & 0170000) == (0040000)) )) { char *dir_arg = xstrdup (dir); strip_trailing_slashes (dir); ret = lstat (dir, &st); if (ret == 0 && (((( st.st_mode )) & 0170000) == (0120000)) ) { error (0, 0, gettext ("failed to remove %s:" " Symbolic link not followed") , quotearg_style (shell_escape_always_quoting_style, dir_arg)); custom_error = 1 ; } free (dir_arg); } } } if (! custom_error) error (0, rmdir_errno, gettext ("failed to remove %s"), quotearg_style (shell_escape_always_quoting_style, dir)); ok = 0 ; } else if (remove_empty_parents) { ok &= remove_parents (dir); } } return ok ? 0 : 1 ; }
int main(unsigned long a0, unsigned long long *a1) { char v0; char v1; unsigned int v2; unsigned int v3; unsigned int v4; char *v5; struct_0 *v6; void* v7; char v8; char v9; unsigned long long v11; unsigned long long v12; unsigned long long v13; v0 = 1; set_program_name(*(a1)); setlocale(0x6, &g_400d3b); bindtextdomain("coreutils", "/usr/local/share/locale"); textdomain("coreutils"); atexit(got.close_stdout); remove_empty_parents = 0; while (true) { while (true) { v2 = getopt_long(a0, a1, "pv", &longopts, NULL); if (v2 == -1) { if (a0 == optind) { error(0x0, 0x0, gettext("missing operand")); usage(0x1); } while (true) { if (a0 <= optind) goto LABEL_400bd4; v5 = a1[optind]; if (verbose) { v11 = gettext("removing directory, %s"); prog_fprintf(*(&stdout), v11, quotearg_style(0x4, v5), v11); } if (rmdir(v5)) break; if (remove_empty_parents) { *(&v11) = remove_parents(v5) & v0; v0 = v11; } LABEL_400bb3: optind = optind + 1; } v3 = *(__errno_location()); if (!(!ignorable_failure(v3, v5))) goto LABEL_400bb3; v1 = 0; if (v3 != 20) { LABEL_400b28: if ((v1 ^ 1)) { v13 = quotearg_style(0x4, v5); error(0x0, v3, gettext("failed to remove %s")); } v0 = 0; goto LABEL_400bb3; } v6 = &strrchr(v5, 0x2f); if (!v6) goto LABEL_400b28; if (!(!v6->field_1)) goto LABEL_400b28; v4 = stat(v5, &v8); if (v4) { *(&v11) = *(__errno_location()); if (!(v11 == 20)) goto LABEL_400a76; } if (!(!v4)) goto LABEL_400b28; if (!((*(&v9) & 0xf000) == 0x4000)) goto LABEL_400b28; LABEL_400a76: v7 = xstrdup(v5); strip_trailing_slashes(v5); v4 = lstat(v5, &v8); if (!v4 && (*(&v9) & 0xf000) == 0xa000) { v12 = quotearg_style(0x4, v7); error(0x0, 0x0, gettext("failed to remove %s: Symbolic link not followed")); v1 = 1; } free(v7); LABEL_400bd4: return v0 ^ 1; } if (v2 != 128) break; ignore_fail_on_non_empty = 1; } if (v2 > 128) { LABEL_400896: usage(0x1); } if (v2 == 118) { verbose = 1; continue; } if (!(v2 <= 118)) goto LABEL_400896; if (v2 == 112) { remove_empty_parents = 1; } else { if (v2 <= 112) { if (v2 == -131) { version_etc(*(&stdout), "rmdir", "GNU coreutils", Version, "David MacKenzie", 0x0); exit(0x0); } else if (v2 == -130) { usage(0x0); } } goto LABEL_400896; } } }
static ssize_t funopen_read(void *cookie, char *buf, size_t size) { struct funopen_cookie *cookiewrap = cookie; if (cookiewrap->readfn == ((void *)0) ) { (*__errno_location ()) = 9 ; return -1; } return cookiewrap->readfn(cookiewrap->orig_cookie, buf, size); }
long funopen_read(undefined8 *param_1,undefined8 param_2,undefined4 param_3) { int iVar1; int *piVar2; long lVar3; if (param_1[1] == 0) { piVar2 = __errno_location(); *piVar2 = 9; lVar3 = -1; } else { iVar1 = (*(code *)param_1[1])(*param_1,param_2,param_3); lVar3 = (long)iVar1; } return lVar3; }
int assignment (string, flags) const char *string; int flags; { register unsigned char c; register int newi, indx; c = string[indx = 0]; if ((flags & 1) && c != '[') return (0); else if ((flags & 1) == 0 && ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISalpha) ) || (c == '_')) == 0) return (0); while (c = string[indx]) { if (c == '=') return (indx); if (c == '[') { newi = skipsubscript (string, indx, (flags & 2) ? 1 : 0); if (string[newi++] != ']') return (0); if (string[newi] == '+' && string[newi+1] == '=') return (newi + 1); return ((string[newi] == '=') ? newi : 0); } if (c == '+' && string[indx+1] == '=') return (indx + 1); if (((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISalnum) ) || c == '_') == 0) return (0); indx++; } return (0); }
long assignment(unsigned char *a1, int a2) { unsigned int v2; unsigned char v3; int v6; unsigned int v7; unsigned char v9; v2 = 0; v3 = *a1; if ( (a2 & 1) != 0 && v3 != 91 ) return 0LL; if ( (a2 & 1) == 0 && ((*_ctype_b_loc())[v3] & 0x400) == 0 && v3 != 95 ) return 0LL; while ( 1 ) { v9 = a1[v2]; if ( !v9 ) return 0LL; if ( v9 == 61 ) return v2; if ( v9 == 91 ) break; if ( v9 == 43 && a1[v2 + 1] == 61 ) return v2 + 1; if ( ((*_ctype_b_loc())[v9] & 8) == 0 && v9 != 95 ) return 0LL; ++v2; } v6 = skipsubscript(a1, v2, (a2 >> 1) & 1); v7 = v6 + 1; if ( a1[v6] != 93 ) return 0LL; if ( a1[v7] == 43 && a1[v7 + 1] == 61 ) return (unsigned int)(v6 + 2); if ( a1[v7] == 61 ) return v7; return 0LL; }
static void usage(void) { fprintf( stderr , "Usage: ip fou add port PORT { ipproto PROTO | gue }\n" " [ local IFADDR ] [ peer IFADDR ]\n" " [ peer_port PORT ] [ dev IFNAME ]\n" " ip fou del port PORT [ local IFADDR ]\n" " [ peer IFADDR ] [ peer_port PORT ]\n" " [ dev IFNAME ]\n" " ip fou show\n" "\n" "Where: PROTO { ipproto-name | 1..255 }\n" " PORT { 1..65535 }\n" " IFADDR { addr }\n"); exit(-1); }
void usage() { fprintf(stderr, "Usage: ip fou add port PORT { ipproto PROTO | gue }\n\t\t [ local IFADDR ] [ peer IFADDR ]\n\t\t [ peer_port PORT ] [ dev IFNAME ]\n ip fou del port PORT [ local IFADDR ]\n\t\t [ peer IFADDR ] [ peer_port PORT ]\n\t\t [ dev IFNAME ]\n ip fou show\n\nWhere: PROTO { ipproto-name | 1..255 }\n PORT { 1..65535 }\n IFADDR { addr }\n"); exit(0xffffffff); }
char * tilde_expand(char *name) { return fn_tilde_expand(name); }
long tilde_expand(long a1) { return fn_tilde_expand(a1); }
int main(int argc, char **argv) { int do_reboot = 0; int do_sync = 1; int do_wtmp = 1; int do_nothing = 0; int do_hard = 0; int do_ifdown = 0; int do_hddown = 0; int do_poweroff = 0; int c; char *tm = ((void *)0) ; if (argv[0][0] == '-') argv[0]++; if ((progname = strrchr(argv[0], '/')) != ((void *)0) ) progname++; else progname = argv[0]; if (!strcmp(progname, "reboot")) do_reboot = 1; if (!strcmp(progname, "poweroff")) do_poweroff = 1; while((c = getopt(argc, argv, ":ihdfnpwt:")) != (-1) ) { switch(c) { case 'n': do_sync = 0; do_wtmp = 0; break; case 'w': do_nothing = 1; break; case 'd': do_wtmp = 0; break; case 'f': do_hard = 1; break; case 'i': do_ifdown = 1; break; case 'h': do_hddown = 1; break; case 'p': do_poweroff = 1; break; case 't': tm = optarg; break; default: usage(); } } if (argc != optind) usage(); if (geteuid() != 0) { fprintf( stderr , "%s: must be superuser.\n", progname); exit(1); } if (chdir("/")) { fprintf( stderr , "%s: chdir(/): %m\n", progname); exit(1); } if (!do_hard && !do_nothing) { c = get_runlevel(); if (c != '0' && c != '6') do_shutdown(do_reboot ? "-r" : "-h", do_poweroff, tm); } if (do_wtmp) write_wtmp("shutdown", "~~", 0, 1 , "~~"); if (do_nothing && !do_hddown && !do_ifdown) exit(0); if (do_sync) { sync(); } if (do_ifdown) (void)ifdown(); if (do_hddown) (void)hddown(); else (void)hdflush(); if (do_nothing) exit(0); if (do_reboot) { reboot( 0x01234567 ); } else { reboot( 0x89abcdef ); kill(1, 20 ); if (do_poweroff) reboot( 0x4321fedc ); reboot( 0xcdef0123 ); } reboot( 0 ); kill(1, 18 ); exit(0); }
int main(unsigned long a0) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned int v8; void* v9; unsigned long long *v11; unsigned long long v16; v0 = 0; v1 = 1; v2 = 1; v3 = 0; v4 = 0; v5 = 0; v6 = 0; v7 = 0; v9 = 0; if (*(*(v11)) == 45) *(v11) = *(v11) + 1; progname = strrchr(*(v11), 0x2f); progname = 5260204364651662153; if (false) progname = *(v11); if (!strcmp(0x48fffffff9058b48, "reboot")) v0 = 1; if (!strcmp(0x48fffffff9058b48, "poweroff")) v7 = 1; while (true) { v8 = getopt(a0, v11, ":ihdfnpwt:"); if (v8 == -1) break; switch (v8) { case 100: v2 = 0; break; case 102: v4 = 1; break; case 104: v6 = 1; break; case 105: v5 = 1; break; case 110: v1 = 0; v2 = 0; break; case 112: v7 = 1; break; case 116: v9 = optarg; break; case 119: v3 = 1; break; default: usage(); } } if (a0 != optind) { usage(); } else if (geteuid()) { fprintf(*(&stderr), "%s: must be superuser.\n", -117077176); exit(0x1); } else if (chdir("/")) { fprintf(*(&stderr), "%s: chdir(/): %m\n", -117077176); exit(0x1); } else { if (!v4 && !v3) { v8 = get_runlevel(); if (v8 != 48 && v8 != 54) { if (v0) v16 = "-r"; else v16 = "-h"; do_shutdown(v16, v7); } } if (v8 == 54 || v8 == 48 || v3 || v4) { if (v2) write_wtmp("shutdown", "~~", 0x0, 0x1, "~~"); if (v3 && !v6 && !v5) exit(0x0); if (!v3 || v6 || v5) { if (v1) sync(); if (v5) ifdown(); if (v6) hddown(); else hdflush(); if (v3) exit(0x0); if (v0) { reboot(0x1234567); } else { reboot(0x89abcdef); kill(0x1, 0x14); if (v7) reboot(0x4321fedc); reboot(0xcdef0123); } reboot(0x0); kill(0x1, 0x12); exit(0x0); } } } }
static void request_info(void) { gnutls_ocsp_req_t req; int ret; gnutls_datum_t dat, rbuf; size_t size; ret = gnutls_ocsp_req_init(&req); if (ret < 0) { fprintf( stderr , "ocsp_req_init: %s\n", gnutls_strerror(ret)); app_exit(1); } if (ocsptool_options.present.load_request) dat.data = (void *) _gnutls_read_file(ocsptool_options.arg.load_request, 0x1, &size); else dat.data = (void *) _gnutls_fread_file(infile, 0, &size); if (dat.data == ((void *)0) ) { fprintf( stderr , "error reading request\n"); app_exit(1); } dat.size = size; ret = gnutls_ocsp_req_import(req, &dat); free(dat.data); if (ret < 0) { fprintf( stderr , "error importing request: %s\n", gnutls_strerror(ret)); app_exit(1); } ret = gnutls_ocsp_req_print(req, GNUTLS_OCSP_PRINT_FULL, &dat); if (ret != 0) { fprintf( stderr , "ocsp_req_print: %s\n", gnutls_strerror(ret)); app_exit(1); } if (ocsptool_options.present.outfile) { ret = gnutls_ocsp_req_export(req, &rbuf); if (ret < 0) { fprintf( stderr , "error exporting request: %s\n", gnutls_strerror(ret)); app_exit(1); } if (outcert_format == GNUTLS_X509_FMT_PEM) { fprintf( stderr , "Cannot export requests into PEM form\n"); app_exit(1); } else { fwrite(rbuf.data, 1, rbuf.size, outfile); } gnutls_free((void *) (rbuf.data)), rbuf.data= ((void *)0) ; } else { printf("%.*s", dat.size, dat.data); } gnutls_free((void *) (dat.data)), dat.data= ((void *)0) ; gnutls_ocsp_req_deinit(req); }
void request_info() { unsigned int v0; char v1; char v2; void* v3; unsigned int v4; char v5; char v6; char v7; unsigned long long *v9; unsigned long long v10; v0 = gnutls_ocsp_req_init(&v1); if (v0 < 0) { fprintf(*(&stderr), "ocsp_req_init: %s\n", gnutls_strerror(v0)); app_exit(0x1); } if (g_50004a) v3 = _gnutls_read_file(gnutls_ocsp_resp_import2, 0x1, &v2); else v3 = _gnutls_fread_file(infile, 0x0, &v2); if (!v3) { fprintf(*(&stderr), "error reading request\n"); app_exit(0x1); } v4 = *(&v2); v0 = gnutls_ocsp_req_import(*(&v1), &v3, &v3); free(v3); if (v0 < 0) { fprintf(*(&stderr), "error importing request: %s\n", gnutls_strerror(v0)); app_exit(0x1); } v0 = gnutls_ocsp_req_print(*(&v1), 0x0, &v3); if (v0) { fprintf(*(&stderr), "ocsp_req_print: %s\n", gnutls_strerror(v0)); app_exit(0x1); } if (!g_50003b) { printf("%.*s", v4); } else { v0 = gnutls_ocsp_req_export(*(&v1), &v5, &v5); if (v0 < 0) { fprintf(*(&stderr), "error exporting request: %s\n", gnutls_strerror(v0)); app_exit(0x1); } if (outcert_format == 1) { fprintf(*(&stderr), "Cannot export requests into PEM form\n"); app_exit(0x1); } fwrite(*(&v5), 0x1, *(&v6), outfile); *(5243000)(*(&v5)); v5 = 0; } *(5243000)(v3); v3 = 0; gnutls_ocsp_req_deinit(*(&v1)); v10 = *(&v7) ^ v9[5]; return; }
static void pad ( Char *s ) { Int32 i; if ( (Int32)strlen(s) >= longestFileName ) return; for (i = 1; i <= longestFileName - (Int32)strlen(s); i++) fprintf ( stderr , " " ); }
void pad(char *a0) { unsigned int v0; unsigned long long v2; v2 = longestFileName; if (strlen(a0) < longestFileName) { v0 = 1; while (true) { if (v0 > (longestFileName - strlen(a0))) break; fprintf(stderr, " "); v0 += 1; } } return; }
int updateavailable(const char *const *argv) { const char *sourcefile= argv[0]; char *availfile; int count= 0; modstatdb_init(); switch (cipaction->arg_int) { case act_avclear: if (sourcefile) badusage(gettext("--%s takes no arguments"),cipaction->olong); break; case act_avreplace: case act_avmerge: if (sourcefile == ((void *)0) ) sourcefile = "-"; else if (argv[1]) badusage(gettext("--%s takes at most one Packages-file argument"), cipaction->olong); break; default: do_internerr("update.c", 58, __func__, "unknown action '%d'", cipaction->arg_int); } if (!f_noact) { const char *dbdir = dpkg_db_get_dir(); if (access(dbdir, 2 )) { if ( (*__errno_location ()) != 13 ) ohshite(gettext("unable to access dpkg database directory '%s' for bulk available update"), dbdir); else ohshit(gettext("required write access to dpkg database directory '%s' for bulk available update"), dbdir); } modstatdb_lock(); } switch (cipaction->arg_int) { case act_avreplace: printf(gettext("Replacing available packages info, using %s.\n"),sourcefile); break; case act_avmerge: printf(gettext("Updating available packages info, using %s.\n"),sourcefile); break; case act_avclear: break; default: do_internerr("update.c", 85, __func__, "unknown action '%d'", cipaction->arg_int); } availfile = dpkg_db_get_path("available"); if (cipaction->arg_int == act_avmerge) parsedb(availfile, pdb_parse_available, ((void *)0) ); if (cipaction->arg_int != act_avclear) count += parsedb(sourcefile, pdb_parse_available | pdb_ignoreolder | pdb_dash_is_stdin, ((void *)0) ); if (!f_noact) { writedb(availfile, wdb_dump_available); modstatdb_unlock(); } free(availfile); if (cipaction->arg_int != act_avclear) printf(ngettext("Information about %d package was updated.\n", "Information about %d packages was updated.\n", count) , count); modstatdb_done(); return 0; }
long long updateavailable(unsigned long long a0[2], unsigned long a1, char *a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned int v0; unsigned long long v1; char *v2; void* v3; unsigned long long v6; unsigned long long v7; v1 = a0[0]; v0 = 0; modstatdb_init(); if (*((cipaction + 40)) == 40) { if (!v1) goto LABEL_4000f6; badusage(gettext("--%s takes no arguments"), *(cipaction)); } else { if (*((cipaction + 40)) < 40) goto LABEL_4000c5; if (!(*((cipaction + 40)) - 41 <= 1)) goto LABEL_4000c5; } if (!v1) { v1 = "-"; } else if (a0[1]) { badusage(gettext("--%s takes at most one Packages-file argument"), *(cipaction)); LABEL_4000c5: do_internerr("update.c", 0x3a, "updateavailable", "unknown action '%d'", *((cipaction + 40))); LABEL_4000f6: } if (!f_noact) { v2 = dpkg_db_get_dir(); if (access(v2, 0x2)) { if (*(__errno_location()) != 13) { v6 = gettext("unable to access dpkg database directory '%s' for bulk available update"); ohshite(v6, v2, v6); } v7 = gettext("required write access to dpkg database directory '%s' for bulk available update"); ohshit(v7, v2, v7); } modstatdb_lock(); } if (*((cipaction + 40)) == 42) { a2 = gettext("Updating available packages info, using %s.\n"); printf(a2); } else { if (*((cipaction + 40)) <= 42) { if (*((cipaction + 40)) == 40) goto LABEL_400216; if (*((cipaction + 40)) == 41) { a2 = gettext("Replacing available packages info, using %s.\n"); printf(a2); goto LABEL_400217; } } do_internerr("update.c", 0x55, "updateavailable", "unknown action '%d'", *((cipaction + 40))); LABEL_400216: } LABEL_400217: v3 = dpkg_db_get_path("available"); if (*((cipaction + 40)) == 42) parsedb(v3, 0x246, 0x0); if (*((cipaction + 40)) != 40) v0 += parsedb(v1, 0x366, 0x0); if (!f_noact) { writedb(v3, 0x1); modstatdb_unlock(a0, 0x1, a2, a3, a4, a5); } free(v3); if (*((cipaction + 40)) != 40) printf(ngettext("Information about %d package was updated.\n", "Information about %d packages was updated.\n", v0)); modstatdb_done(); return 0; }
static void readline_set_char_offset (ind, varp) int ind; int *varp; { int i; i = ind; if (i > 0 && locale_mb_cur_max > 1) i = _rl_find_next_mbchar (rl_line_buffer, 0, i, 0); if (i != *varp) { if (i > rl_end) i = rl_end; else if (i < 0) i = 0; *varp = i; } }
void readline_set_char_offset(int param_1,int *param_2) { int local_c; local_c = param_1; if ((0 < param_1) && (1 < locale_mb_cur_max)) { local_c = _rl_find_next_mbchar(rl_line_buffer,0,param_1,0); } if (local_c != *param_2) { if (rl_end < local_c) { local_c = rl_end; } else if (local_c < 0) { local_c = 0; } *param_2 = local_c; } return; }
static _Bool predicate_is_cost_free (const struct predicate *p) { if (( ((p)->pred_func) == (pred_name) ) || ( ((p)->pred_func) == (pred_path) ) || ( ((p)->pred_func) == (pred_iname) ) || ( ((p)->pred_func) == (pred_ipath) )) { return 1 ; } else if (options.optimisation_level > 0) { if (( ((p)->pred_func) == (pred_and) ) || ( ((p)->pred_func) == (pred_negate) ) || ( ((p)->pred_func) == (pred_comma) ) || ( ((p)->pred_func) == (pred_or) )) return 0 ; else return NeedsNothing == p->p_cost; } else { return 0 ; } }
int predicate_is_cost_free(struct_0 *a0) { unsigned int v1; if (a0->field_0 == got.pred_name) { v1 = 1; return v1; } else if (a0->field_0 == got.pred_path) { v1 = 1; return v1; } else if (a0->field_0 == got.pred_iname) { v1 = 1; return v1; } else if (a0->field_0 == got.pred_ipath) { v1 = 1; return v1; } else if (!got.pred_regex) { v1 = 0; return v1; } else if (a0->field_0 == got.pred_and) { v1 = 0; return v1; } else if (a0->field_0 == got.pred_negate) { v1 = 0; return v1; } else if (a0->field_0 == got.pred_comma) { v1 = 0; return v1; } else if (a0->field_0 == got.pred_or) { v1 = 0; return v1; } else { v1 = a0->field_20; *(&v1) = !a0->field_20; return v1; } }
_Bool pred_true (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr) { (void) pathname; (void) stat_buf; (void) pred_ptr; return 1 ; }
long long pred_true(unsigned long a0, unsigned long a1, unsigned long a2) { unsigned long v0; unsigned long v1; unsigned long v2; v2 = a0; v1 = a1; v0 = a2; return 1; }
static const struct mod **mod_get_all_sorted_dependencies(const struct mod *mod, size_t *n_deps) { const struct mod **deps; size_t last = 0; *n_deps = mod_count_all_dependencies(mod); if (*n_deps == 0) return ((void *)0) ; deps = malloc(sizeof(struct mod *) * (*n_deps)); if (deps == ((void *)0) ) return ((void *)0) ; if (mod_fill_all_unique_dependencies(mod, deps, *n_deps, &last) < 0) { free(deps); return ((void *)0) ; } qsort(deps, last, sizeof(struct mod *), dep_cmp); *n_deps = last; return deps; }
int mod_get_all_sorted_dependencies(void* a0, unsigned long long *a1) { void* v0; void* v1; unsigned int v3; v0 = 0; *(a1) = mod_count_all_dependencies(a0); if (!*(a1)) { v3 = 0; } else { v1 = malloc(*(a1) * 8); if (!v1) { v3 = 0; } else if (mod_fill_all_unique_dependencies(a0, v1, *(a1), &v0) < 0) { free(v1); v3 = 0; } else { qsort(v1, v0, 0x8, dep_cmp); *(a1) = v0; v3 = v1; } } return v3; }
static ServerOpCodes parse_token(const char *cp, const char *filename, int linenum, u_int *flags) { u_int i; for (i = 0; keywords[i].name; i++) if (strcasecmp(cp, keywords[i].name) == 0) { *flags = keywords[i].flags; return keywords[i].opcode; } sshlog("servconf.c", __func__, 728, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "%s: line %d: Bad configuration option: %s", filename, linenum, cp) ; return sBadOption; }
long parse_token(const char *a1, const char *a2, unsigned int a3, _DWORD *a4) { unsigned int i; for ( i = 0; (&keywords)[2 * i]; ++i ) { if ( !strcasecmp(a1, (&keywords)[2 * i]) ) { *a4 = *((_DWORD *)&unk_D72C + 4 * i); return *((unsigned int *)&unk_D728 + 4 * i); } } sshlog("servconf.c", "parse_token", 728LL, 0LL, 2LL, 0LL, "%s: line %d: Bad configuration option: %s", a2, a3, a1); return 0LL; }
strcasecmp(opts[i], "print-pubkey") == 0) { *print_pubkey = 1; } else {
(iVar1 = strcasecmp(*(char **)(param_1 + local_18 * 8),"print-pubkey"), iVar1 != 0)) { sshlog("ssh-keygen.c","sig_process_opts",0xa70,0,2,0,"Invalid option \"%s\"", *(undefined8 *)(param_1 + local_18 * 8)); return 0xfffffff6; }
static void compare_members_lists (const char *groupname, char **members, char **other_members, const char *file, const char *other_file) { char **pmem, **other_pmem; for (pmem = members; ((void *)0) != *pmem; pmem++) { for (other_pmem = other_members; ((void *)0) != *other_pmem; other_pmem++) { if (strcmp (*pmem, *other_pmem) == 0) { break; } } if (!silence_warnings && *other_pmem == ((void *)0) ) { printf ("'%s' is a member of the '%s' group in %s but not in %s\n", *pmem, groupname, file, other_file); } } }
void compare_members_lists(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4) { unsigned long long *v0; unsigned long long *v1; unsigned long long v3; v0 = a1; while (true) { v3 = *(v0); if (!*(v0)) break; for (v1 = a2; *(v1) && strcmp(*(v0), *(v1)); v1 += 1); if ((silence_warnings ^ 1) && !*(v1)) printf("'%s' is a member of the '%s' group in %s but not in %s\n", *(v0), a0, a3, a4); v0 += 1; } return; }
static inline void emit_ancillary_info (char const *program) { struct infomap { char const *program; char const *node; } const infomap[] = { { "[", "test invocation" }, { "coreutils", "Multi-call invocation" }, { "sha224sum", "sha2 utilities" }, { "sha256sum", "sha2 utilities" }, { "sha384sum", "sha2 utilities" }, { "sha512sum", "sha2 utilities" }, { ((void *)0) , ((void *)0) } }; char const *node = program; struct infomap const *map_prog = infomap; while (map_prog->program && ! (strcmp (program, map_prog->program) == 0)) map_prog++; if (map_prog->node) node = map_prog->node; printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https: char const *lc_messages = setlocale ( 5 , ((void *)0) ); if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1)) { fputs_unlocked (gettext ("Report any translation bugs to " "<https: stdout ) ; } char const *url_program = (strcmp (program, "[") == 0) ? "test" : program; printf (gettext ("Full documentation <%s%s>\n"), "https: printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"), node, node == program ? " invocation" : ""); }
void emit_ancillary_info(char *a0) { unsigned long v0; unsigned long long v1[2]; char *v2; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long long v9; unsigned long long v10; unsigned long long v11; unsigned long long v12; unsigned long long v13; unsigned long long v14; unsigned long long v15; void* v16; void* v17; char v18; unsigned long long v20; unsigned long long *v21; unsigned long long v22; v4 = "["; v5 = "test invocation"; v6 = "coreutils"; v7 = "Multi-call invocation"; v8 = "sha224sum"; v9 = "sha2 utilities"; v10 = "sha256sum"; v11 = "sha2 utilities"; v12 = "sha384sum"; v13 = "sha2 utilities"; v14 = "sha512sum"; v15 = "sha2 utilities"; v16 = 0; v17 = 0; v0 = a0; v1[0] = &v4; while (true) { if (!v1[0]) break; if (!strcmp(a0, v1[0])) break; v1[0] = v1 + 1; } if (v1[1]) v0 = v1[1]; printf(gettext("\n%s online help: <%s>\n")); v2 = setlocale(0x5, NULL); if (v2 && strncmp(v2, "en_", 0x3)) fputs_unlocked(gettext("Report any translation bugs to <https: if (!strcmp(a0, "[")) v20 = "test"; else v20 = a0; v3 = v20; printf(gettext("Full documentation <%s%s>\n")); printf(gettext("or available locally via: info '(coreutils) %s%s'\n")); v22 = *(&v18) ^ v21[5]; return; }
void verify_crl(common_info_st * cinfo) { size_t size; gnutls_datum_t dn; unsigned int output; int ret, rc; gnutls_datum_t pem, pout; gnutls_x509_crl_t crl; gnutls_x509_crt_t issuer; issuer = load_ca_cert(1, cinfo); fprintf(outfile, "\nCA certificate:\n"); ret = gnutls_x509_crt_get_dn3(issuer, &dn, 0); if (ret < 0) { fprintf( stderr , "crt_get_dn: %s\n", gnutls_strerror(ret)); app_exit(1); } fprintf(outfile, "\tSubject: %s\n\n", dn.data); ret = gnutls_x509_crl_init(&crl); if (ret < 0) { fprintf( stderr , "crl_init: %s\n", gnutls_strerror(ret)); app_exit(1); } pem.data = (void *) _gnutls_fread_file(infile, 0, &size); pem.size = size; if (!pem.data) { fprintf( stderr , "%s", infile ? "file" : "standard input"); app_exit(1); } ret = gnutls_x509_crl_import(crl, &pem, incert_format); free(pem.data); if (ret < 0) { fprintf( stderr , "import error: %s\n", gnutls_strerror(ret)); app_exit(1); } print_crl_info(crl, outfile, cinfo); ret = gnutls_x509_crl_verify(crl, &issuer, 1, 0, &output); if (ret < 0) { fprintf( stderr , "verification error: %s\n", gnutls_strerror(ret)); app_exit(1); } fprintf(outfile, "Verification output: "); if (output) { fprintf(outfile, "Not verified. "); rc = 1; } else { fprintf(outfile, "Verified."); rc = 0; } ret = gnutls_certificate_verification_status_print(output, GNUTLS_CRT_X509, &pout, 0); if (ret < 0) { fprintf( stderr , "error: %s\n", gnutls_strerror(ret)); app_exit( 1 ); } fprintf(outfile, " %s", pout.data); gnutls_free((void *) (pout.data)), pout.data= ((void *)0) ; fprintf(outfile, "\n"); app_exit(rc); }
void verify_crl(unsigned long long a0) { char v0; unsigned int v1; unsigned int v2; char v3; char v4; unsigned long long v5; char v6; void* v7; unsigned int v8; void* v9; unsigned long v10; unsigned long long *v12; unsigned int v13; v10 = v12[5]; v5 = load_ca_cert(0x1, a0); fprintf(outfile, "\nCA certificate:\n"); v2 = gnutls_x509_crt_get_dn3(v5, &v6, 0x0, &v6); if (v2 < 0) { fprintf(*(&stderr), "crt_get_dn: %s\n", gnutls_strerror(v2)); app_exit(0x1); } fprintf(outfile, "\tSubject: %s\n\n", *(&v6)); v2 = gnutls_x509_crl_init(&v4); if (v2 < 0) { fprintf(*(&stderr), "crl_init: %s\n", gnutls_strerror(v2)); app_exit(0x1); } v7 = _gnutls_fread_file(infile, 0x0, &v3); v8 = *(&v3); if (!v7) { if (!infile) v13 = &g_40b4c4; else v13 = "file"; fprintf(*(&stderr), "%s", v13); app_exit(0x1); } else { v2 = gnutls_x509_crl_import(*(&v4), &v7, incert_format, &v7); free(v7); if (v2 < 0) { fprintf(*(&stderr), "import error: %s\n", gnutls_strerror(v2)); app_exit(0x1); } print_crl_info(*(&v4), outfile, a0); v2 = gnutls_x509_crl_verify(*(&v4), &v5, 0x1, 0x0, &v0); if (v2 < 0) { fprintf(*(&stderr), "verification error: %s\n", gnutls_strerror(v2)); app_exit(0x1); } fprintf(outfile, "Verification output: "); if (!*(&v0)) { fprintf(outfile, "Verified."); v1 = 0; } else { fprintf(outfile, "Not verified. "); v1 = 1; } v2 = gnutls_certificate_verification_status_print(*(&v0), 0x1, &v9, 0x0); if (v2 < 0) { fprintf(*(&stderr), "error: %s\n", gnutls_strerror(v2)); app_exit(0x1); } fprintf(outfile, " %s", *(&v9)); *(5243720)(*(&v9)); v9 = 0; fprintf(outfile, "\n"); app_exit(v1); } }
static int history_tokenize_word (const char *string, int ind) { register int i, j; int delimiter, nestdelim, delimopen; i = ind; delimiter = nestdelim = 0; if (((string[i]) ? ((char *)strchr (("()\n"), (string[i])) != (char *) ((void *)0) ) : 0)) { i++; return i; } if ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)string[i] ))] & (unsigned short int) _ISdigit) )) { j = i; while (string[j] && (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)string[j] ))] & (unsigned short int) _ISdigit) )) j++; if (string[j] == 0) return (j); if (string[j] == '<' || string[j] == '>') i = j; else { i = j; goto get_word; } } if (((string[i]) ? ((char *)strchr (("<>;&|"), (string[i])) != (char *) ((void *)0) ) : 0)) { int peek = string[i + 1]; if (peek == string[i]) { if (peek == '<' && string[i + 2] == '-') i++; else if (peek == '<' && string[i + 2] == '<') i++; i += 2; return i; } else if (peek == '&' && (string[i] == '>' || string[i] == '<')) { j = i + 2; while (string[j] && (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)string[j] ))] & (unsigned short int) _ISdigit) )) j++; if (string[j] =='-') j++; return j; } else if ((peek == '>' && string[i] == '&') || (peek == '|' && string[i] == '>')) { i += 2; return i; } else if (peek == '(' && (string[i] == '>' || string[i] == '<')) { i += 2; delimopen = '('; delimiter = ')'; nestdelim = 1; goto get_word; } i++; return i; } get_word: if (delimiter == 0 && ((string[i]) ? ((char *)strchr (("\"'`"), (string[i])) != (char *) ((void *)0) ) : 0)) delimiter = string[i++]; for (; string[i]; i++) { if (string[i] == '\\' && string[i + 1] == '\n') { i++; continue; } if (string[i] == '\\' && delimiter != '\'' && (delimiter != '"' || ((string[i]) ? ((char *)strchr (("\\`\"$"), (string[i])) != (char *) ((void *)0) ) : 0))) { i++; continue; } if (nestdelim && string[i] == delimopen) { nestdelim++; continue; } if (nestdelim && string[i] == delimiter) { nestdelim--; if (nestdelim == 0) delimiter = 0; continue; } if (delimiter && string[i] == delimiter) { delimiter = 0; continue; } if (nestdelim == 0 && delimiter == 0 && ((string[i]) ? ((char *)strchr (("<>$!@?+*"), (string[i])) != (char *) ((void *)0) ) : 0) && string[i+1] == '(') { i += 2; delimopen = '('; delimiter = ')'; nestdelim = 1; continue; } if (delimiter == 0 && (((string[i]) ? ((char *)strchr ((history_word_delimiters), (string[i])) != (char *) ((void *)0) ) : 0))) break; if (delimiter == 0 && ((string[i]) ? ((char *)strchr (("\"'`"), (string[i])) != (char *) ((void *)0) ) : 0)) delimiter = string[i]; } return i; }
int history_tokenize_word(char *a0, unsigned long a1) { unsigned int v0; int tmp_7; unsigned int v1; unsigned int v2; unsigned int v3; char *v5; unsigned long long v6; char *v7; unsigned long long v8; unsigned long long v9; unsigned long long v10; v5 = a1; v1 = 0; v0 = v1; if (a0[a1]) { v6 = strchr("()\n", a0[a1]); if (v6) *(&v6) = a1 + 1; } if (!a0[a1] || !v6) { *(&v6) = *((*(__ctype_b_loc()) + a0[a1] * 2)); if (v6) { for (*(&v6) = v6 & 0x800; *((a0 + v5)); v5 = v5 + 1) { *(&v6) = *((*(__ctype_b_loc()) + *((a0 + v5)) * 2)); *(&v6) = v6 & 0x800; if (!v6) break; } if (!*((a0 + v5))) *(&v6) = v5; } if (*((a0 + v5)) && (!v6 || *((a0 + v5))) && (*((a0 + v5)) == 60 || *((a0 + v5)) == 62 || !v6)) { v6 = strchr("<>;&|", *((a0 + v5))); if (v6) { v3 = *((a0 + v5 + 1)); if (v3 == *((a0 + v5))) { *(&v5) = a1 + 2; *(&v6) = *(&v5); } } } if (v3 == 38 && v3 != *((a0 + v5)) && v6 && *((a0 + v5)) && (!v6 || *((a0 + v5))) && (*((a0 + v5)) == 60 || *((a0 + v5)) == 62 || !v6) && *((a0 + v5)) != 62 && *((a0 + v5)) == 60 || v3 == 38 && v3 != *((a0 + v5)) && v6 && *((a0 + v5)) && (!v6 || *((a0 + v5))) && (*((a0 + v5)) == 60 || *((a0 + v5)) == 62 || !v6) && *((a0 + v5)) == 62) { for (v7 = v5 + 2; *((a0 + v7)); v7 = v7 + 1) { *(&v6) = *((*(__ctype_b_loc()) + *((a0 + v7)) * 2)); *(&v6) = v6 & 0x800; if (!v6) break; } if (*((a0 + v7)) == 45) *(&v7) = v7 + 1; *(&v6) = v7; } if (...) { *(&v5) = v5 + 2; *(&v6) = *(&v5); } if (...) { v5 = v5 + 2; v2 = 40; v0 = 41; v1 = 1; } if (...) { *(&v5) = v5 + 1; *(&v6) = *(&v5); } if (...) { if (!v0 && *((a0 + v5))) { v6 = strchr("\"\'`", *((a0 + v5))); if (v6) { tmp_7 = v5; v5 += 1; *(&v6) = a0[tmp_7]; v0 = v6; } } for (; *((a0 + v5)); v5 = a1 + 1) { if (*((a0 + v5 + 1)) != 10 || *((a0 + v5)) != 92) { if (*((a0 + v5)) == 92 && v0 != 39 && v0 == 34 && *((a0 + v5))) v8 = strchr("\\`\"$", *((a0 + v5))); if (v0 == 39 || *((a0 + v5)) != 92 || !v8 && v0 == 34 || !*((a0 + v5)) && v0 == 34) { if (v1 && v2 == *((a0 + v5))) v1 += 1; if (!v1 || v2 != *((a0 + v5))) { if (v1 && v0 == *((a0 + v5))) { v1 -= 1; if (!v1) v0 = 0; } if (!v1 || v0 != *((a0 + v5))) { if (v0 && v0 == *((a0 + v5))) v0 = 0; if (!v0 || v0 != *((a0 + v5))) { if (!v1 && !v0 && *((a0 + v5))) { v9 = strchr("<>$!@?+*", *((a0 + v5))); if (v9 && *((a0 + v5 + 1)) == 40) { v2 = 40; v0 = 41; v1 = 1; } } if (!v9 || !*((a0 + v5)) || *((a0 + v5 + 1)) != 40 || v1 || v0) { if (!v0 && *((a0 + v5))) { v6 = strchr(history_word_delimiters, *((a0 + v5))); if (v6) break; } if (!v6 && !v0 && *((a0 + v5))) { v10 = strchr("\"\'`", *((a0 + v5))); if (v10) v0 = *((a0 + v5)); } } } } } } } } *(&v6) = v5; } } return v6; }
void _rl_free_history_entry (HIST_ENTRY *entry) { if (entry == 0) return; if (entry->line) free (entry->line); if (entry->timestamp) free (entry->timestamp); xfree (entry); }
void _rl_free_history_entry(unsigned long long a0[2]) { unsigned long long v1; if (a0) { if (a0[0]) free(a0[0]); if (a0[1]) free(a0[1]); v1 = xfree(a0); } return; }
static int flush_addrlabel(struct nlmsghdr *n, void *arg) { struct rtnl_handle rth2; struct rtmsg *r = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); int len = n->nlmsg_len; struct rtattr *tb[(__IFAL_MAX - 1)+1]; len -= ((sizeof(*r)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))); if (len < 0) return -1; parse_rtattr(tb, (__IFAL_MAX - 1), ((struct rtattr*)(((char*)(r)) + ( ((sizeof(struct rtmsg))+4U -1) & ~(4U -1) ))), len); if (tb[IFAL_ADDRESS]) { n->nlmsg_type = RTM_DELADDRLABEL; n->nlmsg_flags = 0x01; if (rtnl_open(&rth2, 0) < 0) return -1; if (rtnl_talk(&rth2, n, ((void *)0) ) < 0) return -2; rtnl_close(&rth2); } return 0; }
long long flush_addrlabel(struct_0 *a0, unsigned long a1) { unsigned long v0; unsigned int v1; unsigned long v2; char v3; char v4; char v5; unsigned long long v7; unsigned long long v8; unsigned long long v9; v0 = a1; v2 = a0 + 2; v1 = a0->field_0; v1 -= 28; if (v1 < 0) { v7 = 4294967295; } else { parse_rtattr(&v4, 0x2, v2 + 12, v1); if (*(&v5)) { a0->field_4 = 73; a0->field_6 = 1; v8 = rtnl_open(&v3, 0x0); if (v8 < 0) { v7 = 4294967295; } else { v9 = rtnl_talk(&v3, a0, 0x0); if (v9 < 0) v7 = 4294967294; else rtnl_close(&v3); } } if (!*(&v5) || v8 >= 0 && v9 >= 0) v7 = 0; } return v7; }
static void pubkey_reset(Authctxt *authctxt) { Identity *id; for((id) = ((&authctxt->keys)->tqh_first); (id) != ((void *)0) ; (id) = ((id)->next.tqe_next)) id->tried = 0; }
long * pubkey_reset(long a1) { long *result; long *i; result = *(long **)(a1 + 56); for ( i = result; i; i = (long *)*i ) { *((_DWORD *)i + 10) = 0; result = (long *)*i; } return result; }
test_code_t test_session_resume2(gnutls_session_t session) { int ret; char tmp_session_id[32]; size_t tmp_session_id_size; if (session == ((void *)0) ) return TEST_IGNORE; sprintf(prio_str, "NONE:" "+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL" ":%s:" "+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":" "+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH" ":+VKO-GOST-12" ":%s", protocol_str, rest); { int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 1490)) != TEST_SUCCEED) { return _ret; } }; gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred); gnutls_credentials_set(session, GNUTLS_CRD_ANON, anon_cred); gnutls_session_set_data(session, session_data, session_data_size); memcpy(tmp_session_id, session_id, session_id_size); tmp_session_id_size = session_id_size; ret = test_do_handshake(session); if (ret == TEST_FAILED) return ret; session_id_size = sizeof(session_id); gnutls_session_get_id(session, session_id, &session_id_size); if (session_id_size == 0) return TEST_FAILED; if (gnutls_session_is_resumed(session)) return TEST_SUCCEED; if (tmp_session_id_size == session_id_size && memcmp(tmp_session_id, session_id, tmp_session_id_size) == 0) return TEST_SUCCEED; else return TEST_FAILED; }
long long test_session_resume2(unsigned long long a0) { unsigned int v0; unsigned int v1; unsigned int v2; char v3; unsigned long long v5; unsigned long long v7; if (!a0) { v5 = 3; } else { sprintf(&prio_str, "NONE:+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC:+GOST28147-TC26Z-CNT:+COMP-NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT:+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH:+VKO-GOST-12:%s", &protocol_str, &rest); v0 = __gnutls_priority_set_direct(a0, &prio_str, 0x5d2); if (v0) { v5 = v0; } else { gnutls_credentials_set(a0, 0x1, xcred); gnutls_credentials_set(a0, 0x2, anon_cred); gnutls_session_set_data(a0, session_data, session_data_size, session_data); memcpy(&v3, &session_id, session_id_size); *(&v2) = session_id_size; v1 = test_do_handshake(a0); if (v1 == 1) { v5 = v1; } else { session_id_size = 32; gnutls_session_get_id(a0, &session_id, &session_id_size); if (!session_id_size) { v5 = 1; } else if (gnutls_session_is_resumed(a0)) { v5 = 0; } else { if (*(&v2) == session_id_size) { v7 = memcmp(&v3, &session_id, *(&v2)); if (!v7) v5 = 0; } if (v7 || *(&v2) != session_id_size) v5 = 1; } } } } return v5; }
static void enqueue_pending(void) { struct pkg_hash_iter *iter; struct pkginfo *pkg; iter = pkg_hash_iter_new(); while ((pkg = pkg_hash_iter_next_pkg(iter)) != ((void *)0) ) { switch (cipaction->arg_int) { case act_configure: if (!(pkg->status == PKG_STAT_UNPACKED || pkg->status == PKG_STAT_HALFCONFIGURED || pkg->trigpend_head)) continue; if (pkg->want != PKG_WANT_INSTALL && pkg->want != PKG_WANT_HOLD) continue; break; case act_triggers: if (!pkg->trigpend_head) continue; if (pkg->want != PKG_WANT_INSTALL && pkg->want != PKG_WANT_HOLD) continue; break; case act_remove: case act_purge: if (pkg->want != PKG_WANT_PURGE) { if (pkg->want != PKG_WANT_DEINSTALL) continue; if (pkg->status == PKG_STAT_CONFIGFILES) continue; } if (pkg->status == PKG_STAT_NOTINSTALLED) continue; break; default: do_internerr("packages.c", 109, __func__, "unknown action '%d'", cipaction->arg_int); } enqueue_package(pkg); } pkg_hash_iter_free(iter); }
void enqueue_pending() { unsigned long long v0; struct_0 *v1; unsigned long long v3; v0 = pkg_hash_iter_new(); while (true) { while (true) { v1 = pkg_hash_iter_next_pkg(v0); if (v1) { if (*((cipaction + 40)) <= 6) { if (*((cipaction + 40)) < 5) { if (*((cipaction + 40)) == 2) { if (v1->field_18 != 3 && v1->field_18 == 4) continue; if (v1->field_10 == 1) continue; } if (*((cipaction + 40)) == 4) { if (!v1->field_160) continue; if (v1->field_10 == 1) break; if (v1->field_10 != 1) { if (v1->field_10 == 2) break; } } } else { if (v1->field_10 != 4) { if (v1->field_10 != 3) continue; continue; } continue; } } if (*((cipaction + 40)) > 6 || *((cipaction + 40)) < 5 && *((cipaction + 40)) != 4 && *((cipaction + 40)) != 2) do_internerr("packages.c", 0x6d, "enqueue_pending", "unknown action '%d'", *((cipaction + 40))); if (*((cipaction + 40)) != 4) enqueue_package(v1); } else { v3 = pkg_hash_iter_free(v0); return; } } } }
static void exp_jump_to_top_level (v) int v; { set_pipestatus_from_exit (last_command_exit_value); expand_no_split_dollar_star = 0; if (expanding_redir) undo_partial_redirects (); expanding_redir = 0; assigning_in_environment = 0; if (parse_and_execute_level == 0) top_level_cleanup (); jump_to_top_level (v); }
undefined8 * exp_jump_to_top_level(uint param_1) { undefined8 *puVar1; undefined8 *puVar2; undefined8 *puVar3; undefined8 *puStack72; undefined8 *puStack56; set_pipestatus_from_exit(); expand_no_split_dollar_star = 0; if (expanding_redir != 0) { undo_partial_redirects(); } expanding_redir = 0; assigning_in_environment = 0; if (parse_and_execute_level == 0) { top_level_cleanup(); } puStack72 = (undefined8 *)(ulong)param_1; jump_to_top_level(); if (puStack72 == (undefined8 *)0x0) { puStack72 = (undefined8 *)0x0; } else { if (subst_assign_varlist != (undefined8 *)0x0) { dispose_words(subst_assign_varlist); } subst_assign_varlist = (undefined8 *)0x0; puVar1 = puStack72; puVar3 = puStack72; while ((puVar2 = puVar1, puVar2 != (undefined8 *)0x0 && ((*(uint *)(puVar2[1] + 8) & 4) != 0))) { puVar1 = (undefined8 *)*puVar2; puVar3 = puVar2; } if (puVar2 != puStack72) { subst_assign_varlist = puStack72; *puVar3 = 0; puStack72 = puVar2; } if (puStack72 == (undefined8 *)0x0) { puStack72 = (undefined8 *)0x0; } else if (place_keywords_in_env != 0) { puStack56 = puStack72; puVar1 = (undefined8 *)*puStack72; while (puVar2 = puVar1, puVar2 != (undefined8 *)0x0) { if ((*(uint *)(puVar2[1] + 8) & 4) == 0) { puVar1 = (undefined8 *)*puVar2; puStack56 = puVar2; } else { puVar1 = puVar2; if (subst_assign_varlist != (undefined8 *)0x0) { *puVar3 = puVar2; puVar1 = subst_assign_varlist; } subst_assign_varlist = puVar1; *puStack56 = *puVar2; *puVar2 = 0; puVar1 = (undefined8 *)*puStack56; puVar3 = puVar2; } } } } return puStack72; }
static void bsClose ( BitStream* bs ) { Int32 retVal; if ( bs->mode == 'w' ) { while ( bs->buffLive < 8 ) { bs->buffLive++; bs->buffer <<= 1; }; retVal = putc ( (UChar) (bs->buffer), bs->handle ); if (retVal == (-1) ) writeError(); bytesOut++; retVal = fflush ( bs->handle ); if (retVal == (-1) ) writeError(); } retVal = fclose ( bs->handle ); if (retVal == (-1) ) { if (bs->mode == 'w') writeError(); else readError(); } free ( bs ); }
void bsClose(FILE **param_1) { int iVar1; if (*(char *)(param_1 + 2) == 'w') { while (*(int *)((long)param_1 + 0xc) < 8) { *(int *)((long)param_1 + 0xc) = *(int *)((long)param_1 + 0xc) + 1; *(int *)(param_1 + 1) = *(int *)(param_1 + 1) * 2; } iVar1 = putc(*(uint *)(param_1 + 1) & 0xff,*param_1); if (iVar1 == -1) { writeError(); } bytesOut = bytesOut + 1; iVar1 = fflush(*param_1); if (iVar1 == -1) { writeError(); } } iVar1 = fclose(*param_1); if (iVar1 == -1) { if (*(char *)(param_1 + 2) == 'w') { writeError(); } else { readError(); } } free(param_1); return; }
static COST line_cost (WORD *next, int len) { int n; COST cost; if (next == word_limit) return 0; n = goal_width - len; cost = (((COST) ((n) * 10)) * ((COST) ((n) * 10))); if (next->next_break != word_limit) { n = len - next->line_length; cost += ((((COST) ((n) * 10)) * ((COST) ((n) * 10))) / 2); } return cost; }
int line_cost(struct_0 *a0, unsigned long a1) { unsigned int v0; unsigned long v1; unsigned int v3; if (a0 == word_limit) { v3 = 0; return v3; } v0 = goal_width - a1; v1 = ((v0 * 4) + v0) * 2 * ((v0 * 4) + v0) * 2; if (a0->field_20 != word_limit) { v0 = a1 - a0->field_14; v1 += ((v0 * 4) + v0) * 2 * ((v0 * 4) + v0) * 2 + (((v0 * 4) + v0) * 2 * ((v0 * 4) + v0) * 2 >> 63) >> 1; } v3 = v1; return v3; }
static void ssh_packet_close_internal(struct ssh *ssh, int do_close) { struct session_state *state = ssh->state; u_int mode; if (!state->initialized) return; state->initialized = 0; if (do_close) { if (state->connection_in == state->connection_out) { close(state->connection_out); } else { close(state->connection_in); close(state->connection_out); } } sshbuf_free(state->input); sshbuf_free(state->output); sshbuf_free(state->outgoing_packet); sshbuf_free(state->incoming_packet); for (mode = 0; mode < MODE_MAX; mode++) { kex_free_newkeys(state->newkeys[mode]); state->newkeys[mode] = ((void *)0) ; ssh_clear_newkeys(ssh, mode); } if (do_close && state->compression_buffer) { sshbuf_free(state->compression_buffer); if (state->compression_out_started) { z_streamp stream = &state->compression_out_stream; sshlog("packet.c", __func__, 613, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "compress outgoing: " "raw data %llu, compressed %llu, factor %.2f", (unsigned long long)stream->total_in, (unsigned long long)stream->total_out, stream->total_in == 0 ? 0.0 : (double) stream->total_out / stream->total_in) ; if (state->compression_out_failures == 0) deflateEnd(stream); } if (state->compression_in_started) { z_streamp stream = &state->compression_in_stream; sshlog("packet.c", __func__, 624, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "compress incoming: " "raw data %llu, compressed %llu, factor %.2f", (unsigned long long)stream->total_out, (unsigned long long)stream->total_in, stream->total_out == 0 ? 0.0 : (double) stream->total_in / stream->total_out) ; if (state->compression_in_failures == 0) inflateEnd(stream); } } cipher_free(state->send_context); cipher_free(state->receive_context); state->send_context = state->receive_context = ((void *)0) ; if (do_close) { free(ssh->local_ipaddr); ssh->local_ipaddr = ((void *)0) ; free(ssh->remote_ipaddr); ssh->remote_ipaddr = ((void *)0) ; free(ssh->state); ssh->state = ((void *)0) ; kex_free(ssh->kex); ssh->kex = ((void *)0) ; } }
void ssh_packet_close_internal(unsigned long long a0[5], unsigned long a1) { unsigned long long v0; unsigned long v1; unsigned long v2; unsigned int v3; struct_1 *v4; unsigned long long v5[6]; unsigned long long v6[6]; unsigned long long v8; struct_1 *v9; unsigned long long v10[5]; v4 = a0[0]; v8 = v4->field_13c; if (v4->field_13c) { v4->field_13c = 0; if (a1) { if (v4->field_0 == v4->field_4) { close(v4->field_4); } else { close(v4->field_0); close(v4->field_4); } } sshbuf_free(v4->field_20); sshbuf_free(v4->field_28); sshbuf_free(v4->field_30); sshbuf_free(v4->field_38); for (v3 = 0; v3 <= 1; v3 += 1) { kex_free_newkeys((&v4[1].field_18)[v3]); (&v4[1].field_18)[v3] = 0; ssh_clear_newkeys(a0, v3); } if (a1 && v4->field_40) { sshbuf_free(v4->field_40); if (v4->field_12c) { v5[0] = &v4->padding_48[112]; v2 = v5[5]; v1 = v5[2]; v0 = "compress outgoing: raw data %llu, compressed %llu, factor %.2f"; sshlog("packet.c", "ssh_packet_close_internal", 0x265, 0x0, 0x5, 0x0); if (!v4->field_134) deflateEnd(v5); } if (v4->field_128) { v6[0] = &v4->padding_48; v2 = v6[2]; v1 = v6[5]; v0 = "compress incoming: raw data %llu, compressed %llu, factor %.2f"; sshlog("packet.c", "ssh_packet_close_internal", 0x270, 0x0, 0x5, 0x0); if (!v4->field_130) inflateEnd(v6); } } cipher_free(v4->field_18); cipher_free(v4->field_10); v4->field_10 = 0; v9 = v4; v4->field_18 = v4->field_10; if (a1) { free(a0[4]); a0[4] = 0; free(a0[2]); a0[2] = 0; free(a0[0]); a0[0] = 0; kex_free(a0[1]); v10 = a0; a0[1] = 0; } } return; }
BUCKET_CONTENTS * hash_search (string, table, flags) const char *string; HASH_TABLE *table; int flags; { BUCKET_CONTENTS *list; int bucket; unsigned int hv; if (table == 0 || ((flags & 0x02) == 0 && ((table) ? (table)->nentries : 0) == 0)) return (BUCKET_CONTENTS *) ((void *)0) ; bucket = (((hv) = hash_string (string)) & ((table)->nbuckets - 1)); for (list = table->bucket_array ? table->bucket_array[bucket] : 0; list; list = list->next) { if (hv == list->khash && ((list->key)[0] == (string)[0] && strcmp(list->key, string) == 0)) { list->times_found++; return (list); } } if (flags & 0x02) { if (((table)->nentries >= (table)->nbuckets * 2)) { hash_grow (table); bucket = (((hv) = hash_string (string)) & ((table)->nbuckets - 1)); } list = (BUCKET_CONTENTS *)sh_xmalloc((sizeof (BUCKET_CONTENTS)), "hashlib.c", 280); list->next = table->bucket_array[bucket]; table->bucket_array[bucket] = list; list->data = ((void *)0) ; list->key = (char *)string; list->khash = hv; list->times_found = 0; table->nentries++; return (list); } return (BUCKET_CONTENTS *) ((void *)0) ; }
int hash_search(char *a0, struct_0 *a1, unsigned long a2) { unsigned int v0; unsigned int v1; unsigned long v2; unsigned long v4; if (!a1) { LABEL_40058e: v4 = 0; } else if ((a2 & 2)) { LABEL_400598: v1 = hash_string(a0); v0 = a1->field_8 - 1 & v1; if (!a1->field_0) v4 = 0; else v4 = *((a1->field_0 + v0 * 8)); v2 = v4; while (true) { if (!v2) { if (!(a2 & 2)) { *(&v4) = 0; break; } else { if (a1->field_c >= a1->field_8 << 1) { hash_grow(a1); v1 = hash_string(a0); v0 = a1->field_8 - 1 & v1; } v2 = sh_xmalloc(0x20, "hashlib.c", 0x118); v2->field_0 = *((a1->field_0 + v0 * 8)); *((v0 * 8 + a1->field_0)) = v2; v2->field_10 = 0; v2->field_8 = a0; v2->field_18 = v1; v2->field_1c = 0; a1->field_c = a1->field_c + 1; *(&v4) = v2; break; } } else { if (v1 == *((v2 + 24)) && *(*((v2 + 8))) == *(a0) && !strcmp(*((v2 + 8)), a0)) { v2->field_1c = v2->field_1c + 1; *(&v4) = v2; break; } v2 = *(v2); } } } else if (a1) { if (!(!a1->field_c)) goto LABEL_400598; goto LABEL_40058e; } return v4; }
static void set_no_pager(const struct cmdinfo *ci, const char *value) { pager_enable( 0 ); setenv("DPKG_PAGER", "cat", 1); }
void set_no_pager(void) { pager_enable(0); setenv("DPKG_PAGER","cat",1); return; }
int do_xfrm_policy(int argc, char **argv) { if (argc < 1) return xfrm_policy_list_or_deleteall(0, ((void *)0) , 0); if (matches(*argv, "add") == 0) return xfrm_policy_modify(XFRM_MSG_NEWPOLICY, 0, argc-1, argv+1); if (matches(*argv, "update") == 0) return xfrm_policy_modify(XFRM_MSG_UPDPOLICY, 0, argc-1, argv+1); if (matches(*argv, "delete") == 0) return xfrm_policy_delete(argc-1, argv+1); if (matches(*argv, "deleteall") == 0 || matches(*argv, "delall") == 0) return xfrm_policy_list_or_deleteall(argc-1, argv+1, 1); if (matches(*argv, "list") == 0 || matches(*argv, "show") == 0 || matches(*argv, "lst") == 0) return xfrm_policy_list_or_deleteall(argc-1, argv+1, 0); if (matches(*argv, "get") == 0) return xfrm_policy_get(argc-1, argv+1); if (matches(*argv, "flush") == 0) return xfrm_policy_flush(argc-1, argv+1); if (matches(*argv, "count") == 0) return xfrm_spd_getinfo(argc, argv); if (matches(*argv, "set") == 0) return xfrm_spd_setinfo(argc-1, argv+1); if (matches(*argv, "setdefault") == 0) return xfrm_spd_setdefault(argc-1, argv+1); if (matches(*argv, "getdefault") == 0) return xfrm_spd_getdefault(argc-1, argv+1); if (matches(*argv, "help") == 0) usage(); fprintf( stderr , "Command \"%s\" is unknown, try \"ip xfrm policy help\".\n", *argv); exit(-1); }
long do_xfrm_policy(int a1, const char **a2) { if ( a1 <= 0 ) xfrm_policy_list_or_deleteall(0, 0LL, 0); if ( (unsigned char)matches(*a2, "add") != 1 ) return xfrm_policy_modify(19, 0, a1 - 1, a2 + 1); if ( (unsigned char)matches(*a2, "update") != 1 ) return xfrm_policy_modify(25, 0, a1 - 1, a2 + 1); if ( (unsigned char)matches(*a2, "delete") != 1 ) return xfrm_policy_delete(a1 - 1, a2 + 1); if ( (unsigned char)matches(*a2, "deleteall") != 1 || (unsigned char)matches(*a2, "delall") != 1 ) xfrm_policy_list_or_deleteall(a1 - 1, a2 + 1, 1); if ( (unsigned char)matches(*a2, "list") != 1 || (unsigned char)matches(*a2, "show") != 1 || (unsigned char)matches(*a2, "lst") != 1 ) { xfrm_policy_list_or_deleteall(a1 - 1, a2 + 1, 0); } if ( (unsigned char)matches(*a2, "get") != 1 ) return xfrm_policy_get(a1 - 1, a2 + 1); if ( (unsigned char)matches(*a2, "flush") != 1 ) return xfrm_policy_flush(a1 - 1, a2 + 1); if ( (unsigned char)matches(*a2, "count") != 1 ) return xfrm_spd_getinfo(); if ( (unsigned char)matches(*a2, "set") != 1 ) return xfrm_spd_setinfo(a1 - 1, a2 + 1); if ( (unsigned char)matches(*a2, "setdefault") != 1 ) return xfrm_spd_setdefault(a1 - 1, a2 + 1); if ( (unsigned char)matches(*a2, "getdefault") == 1 ) { if ( (unsigned char)matches(*a2, "help") != 1 ) usage(); fprintf(stderr, "Command \"%s\" is unknown, try \"ip xfrm policy help\".\n", *a2); exit(-1); } return xfrm_spd_getdefault(); }
obj_prefix * __ext2int_and_check(void *ext_p, int magic) { obj_prefix *obj_p = ((obj_prefix *)ext_p)-1; if (!ext_p) { (*__errno_location ()) = 22 ; return ((void *)0) ; } return __check_obj_p(obj_p, magic); }
undefined8 __ext2int_and_check(long param_1,undefined4 param_2) { int *piVar1; undefined8 uVar2; if (param_1 == 0) { piVar1 = __errno_location(); *piVar1 = 0x16; uVar2 = 0; } else { uVar2 = __check_obj_p(param_1 + -8,param_2); } return uVar2; }
static void symbol_free(struct symbol *sym) { log_printf( 7 , "free %p sym=%s, owner=%p %s\n", sym, sym->name, sym->owner, sym->owner != ((void *)0) ? sym->owner->path : "") ; free(sym); }
void symbol_free(char *a1) { const char *v1; if ( *(_QWORD *)a1 ) v1 = *(const char **)(*(_QWORD *)a1 + 8LL); else v1 = s; log_printf(7LL, "free %p sym=%s, owner=%p %s\n", a1, a1 + 16, *(const void **)a1, v1); free(a1); }
int rl_stop_output (int count, int key) { int fildes = fileno (rl_instream); tcflow (fildes, 0 ); return 0; }
long long rl_stop_output(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned int v1; unsigned int v2; v1 = a0; v0 = a1; v2 = fileno(rl_instream); tcflow(v2, 0x0); return 0; }
SHELL_VAR * find_global_variable_last_nameref (name, vflags) const char *name; int vflags; { SHELL_VAR *v, *nv; char *newname; int level; nv = v = find_global_variable_noref (name); level = 0; while (v && ((((v)->attributes) & (0x0000800)))) { level++; if (level > 8) return ((SHELL_VAR *)0); newname = ((v)->value); if (newname == 0 || *newname == '\0') return ((vflags && ((((v)->attributes) & (0x0001000)))) ? v : (SHELL_VAR *)0); nv = v; v = find_global_variable_noref (newname); } return nv; }
int find_global_variable_last_nameref(unsigned long long a0, unsigned long a1) { unsigned int v0; struct_0 *v1; struct_0 *v2; char *v3; unsigned int v5; v1 = find_global_variable_noref(a0); v2 = v1; v0 = 0; while (true) { if (v1 && (v1->field_28 & 0x800)) { v0 += 1; if (v0 > 8) { v5 = 0; break; } else { v3 = v1->field_8; if (v3 && *(v3)) { v2 = v1; v1 = find_global_variable_noref(v3); continue; } if (!v3 || !*(v3)) { if (a1 && (v1->field_28 & 0x1000)) { v5 = v1; break; } if (!a1 || !(v1->field_28 & 0x1000)) { v5 = 0; break; } } } } if (!v1 || !(v1->field_28 & 0x800)) { v5 = v2; break; } } return v5; }
int tty_in_ttygrp(struct stat *st) { struct group *gr; if ((gr = getgrgid(st->st_gid)) == ((void *)0) ) return 0; if (strcmp(gr->gr_name, "tty") != 0) return 0; return 1; }
int tty_in_ttygrp(struct_0 *a0) { unsigned long long *v0; unsigned int v2; v0 = &getgrgid(a0->field_20)->gr_name; if (!v0) { v2 = 0; } else if (strcmp(*(v0), "tty")) { v2 = 0; } else { v2 = 1; } return v2; }
static int copy_from_stdin(void) { int c, bad_read = 0; while (1) { c = do_read(0); if ((c == 0 ) || ((c < 0) && (( (*__errno_location ()) == 11 ) || ( (*__errno_location ()) == 4 )))) { if (bad_read++ > 3) break; continue; } if (c < 0) { perror("read"); exit(1); } bad_read = 0; } return 0; }
undefined8 copy_from_stdin(void) { bool bVar1; int iVar2; int *piVar3; int local_10; local_10 = 0; do { while ((iVar2 = do_read(0), iVar2 != 0 && ((-1 < iVar2 || ((piVar3 = __errno_location(), *piVar3 != 0xb && (piVar3 = __errno_location(), *piVar3 != 4))))))) { if (iVar2 < 0) { perror("read"); exit(1); } local_10 = 0; } bVar1 = local_10 < 4; local_10 = local_10 + 1; } while (bVar1); return 0; }
static _Bool is_root (char const *dir) { char *resolved = canonicalize_file_name (dir); _Bool is_res_root = resolved && (strcmp ("/", resolved) == 0); free (resolved); return is_res_root; }
int is_root(char *a0) { char v0; void* v1; char v3; v1 = canonicalize_file_name(a0); if (v1) { *(&v3) = strcmp("/", v1); if (!*(&v3)) v3 = 1; } if (!v1 || *(&v3)) v3 = 0; v0 = v3; v0 &= 1; free(v1); return v0; }
static void long_pinky (const int argc_names, char *const argv_names[]) { for (int i = 0; i < argc_names; i++) print_long_entry (argv_names[i]); }
void long_pinky(unsigned long a0, unsigned long long *a1) { unsigned int v0; unsigned long long v2; v0 = 0; while (true) { v2 = v0; if (v0 >= a0) break; print_long_entry(a1[v0]); v0 += 1; } return; }
int rl_vi_editing_mode (int count, int key) { _rl_set_insert_mode (1, 1); rl_editing_mode = 0; rl_vi_insert_mode (1, key); return 0; }
long rl_vi_editing_mode(long a1, unsigned int a2) { rl_set_insert_mode(1u); rl_editing_mode = 0; rl_vi_insert_mode(1LL, a2); return 0LL; }
static char ** splitbuf_finishup (struct splitbuf *ss) { int argc = ss->argc; char **argv = ss->argv; char *stringbase = (char *) (ss->argv + ss->half_alloc); for (int i = 1; i < argc; i++) argv[i] = stringbase + (intptr_t) argv[i]; return argv; }
long splitbuf_finishup(long *a1) { int i; int v3; long v4; long v5; v3 = *((_DWORD *)a1 + 2); v4 = *a1; v5 = *a1 + 8 * a1[2]; for ( i = 1; i < v3; ++i ) *(_QWORD *)(8LL * i + v4) += v5; return v4; }
static void xsplit (mp, nu) union mhead *mp; int nu; { union mhead *nh; int nbuck, nblks, split_max; unsigned long siz; nbuck = nu - 1; while (nbuck >= 1 && busy[nbuck]) nbuck--; if (nbuck < 1) return; siz = binsizes[(nu)]; nblks = siz / binsizes[(nbuck)]; siz = binsizes[(nbuck)]; nh = mp; while (1) { mp->minfo.mi_alloc = ((char) 0x54); mp->minfo.mi_index = nbuck; if (--nblks <= 0) break; (*(union mhead **) (sizeof (char *) + (char *) (mp))) = (union mhead *)((char *)mp + siz); mp = (union mhead *)((char *)mp + siz); } busy[nbuck] = 1; (*(union mhead **) (sizeof (char *) + (char *) (mp))) = nextf[nbuck]; nextf[nbuck] = nh; busy[nbuck] = 0; }
void xsplit(unsigned long a0, unsigned long a1) { struct_1 *v0; unsigned int v1; unsigned int v2; unsigned long v3; struct_1 *v4; unsigned long long v6; unsigned long long v7; unsigned long long v8[525365]; v0 = a0; v6 = a1 - 1; v1 = a1 - 1; while (true) { if (v1 <= 0) break; v7 = *(v1 + &busy); if (!*(v1 + &busy)) break; v1 -= 1; } if (v1 > 0) { v3 = *((4202912 + 8 * a1)); v2 = (0 CONCAT v3) /m *((4202912 + 8 * v1)); v3 = *((4202912 + 8 * v1)); v4 = v0; while (true) { v0->field_0 = 84; v0->field_1 = v1; v2 -= 1; if (v2 <= 0) break; v0->field_8 = &(&v0->field_0)[v3]; v0 = &(&v0->field_0)[v3]; } *(v1 + &busy) = 1; v0->field_8 = (&nextf)[v1]; (&nextf)[v1] = v4; v8 = v1; *(v1 + &busy) = 0; } return; }
&& ! ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISdigit) ) { switch (c) { case '\'': case '"': case '`': case ' ': case '#': goto bad; default: break; } }
ushort ** __ctype_b_loc(void) { halt_baddata(); }
static void str_to_env (char const *envar, char const *str) { if (str) { if (setenv (envar, str, 1) != 0) xalloc_die (); } else unsetenv (envar); }
void str_to_env(char *a0, char *a1) { unsigned long long v1; if (!a1) { v1 = unsetenv(a0); } else if (setenv(a0, a1, 0x1)) { xalloc_die(); } return; }
static char * default_format ( _Bool fs, _Bool terse, _Bool device) { char *format; if (fs) { if (terse) format = xstrdup (fmt_terse_fs); else { format = xstrdup (gettext (" File: \"%n\"\n" " ID: %-8i Namelen: %-7l Type: %T\n" "Block size: %-10s Fundamental block size: %S\n" "Blocks: Total: %-10b Free: %-10f Available: %a\n" "Inodes: Total: %-10c Free: %d\n") ); } } else { if (terse) { if (0 < is_selinux_enabled ()) format = xstrdup (fmt_terse_selinux); else format = xstrdup (fmt_terse_regular); } else { char *temp; format = xstrdup (gettext (" File: %N\n Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n") ); temp = format; if (device) { format = xasprintf ("%s%s", format, gettext ("" "Device: %Hd,%Ld\tInode: %-10i Links: %-5h Device type: %Hr,%Lr\n") ); } else { format = xasprintf ("%s%s", format, gettext ("" "Device: %Hd,%Ld\tInode: %-10i Links: %h\n") ); } free (temp); temp = format; format = xasprintf ("%s%s", format, gettext ("" "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n") ); free (temp); if (0 < is_selinux_enabled ()) { temp = format; format = xasprintf ("%s%s", format, gettext ("Context: %C\n")); free (temp); } temp = format; format = xasprintf ("%s%s", format, gettext ("Access: %x\n" "Modify: %y\n" "Change: %z\n" " Birth: %w\n") ); free (temp); } } return format; }
int default_format(unsigned long a0, unsigned long a1, unsigned long a2) { void* v0; void* v1; if (a0) { if (a1) v0 = xstrdup("%n %i %l %t %s %S %b %f %a %c %d\n"); else v0 = xstrdup(gettext(" File: \"%n\"\n ID: %-8i Namelen: %-7l Type: %T\nBlock size: %-10s Fundamental block size: %S\nBlocks: Total: %-10b Free: %-10f Available: %a\nInodes: Total: %-10c Free: %d\n")); } else { if (!a1) { v0 = xstrdup(gettext(" File: %N\n Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n")); v1 = v0; if (a2) v0 = xasprintf("%s%s", v0, gettext("Device: %Hd,%Ld\tInode: %-10i Links: %-5h Device type: %Hr,%Lr\n")); else v0 = xasprintf("%s%s", v0, gettext("Device: %Hd,%Ld\tInode: %-10i Links: %h\n")); free(v1); v1 = v0; v0 = xasprintf("%s%s", v0, gettext("Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n")); free(v1); if (is_selinux_enabled() > 0) { v1 = v0; v0 = xasprintf("%s%s", v0, gettext("Context: %C\n")); free(v1); } v1 = v0; v0 = xasprintf("%s%s", v0, gettext("Access: %x\nModify: %y\nChange: %z\n Birth: %w\n")); free(v1); } else if (is_selinux_enabled() > 0) { v0 = xstrdup("%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o %C\n"); } else { v0 = xstrdup("%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o\n"); } } return v0; }
int rl_operate_and_get_next (int count, int c) { rl_newline (1, c); saved_history_logical_offset = rl_explicit_arg ? count : where_history () + history_base + 1; _rl_saved_internal_startup_hook = _rl_internal_startup_hook; _rl_internal_startup_hook = set_saved_history; return 0; }
long long rl_operate_and_get_next(unsigned long a0, unsigned long a1) { unsigned int v1; rl_newline(0x1, a1); if (!rl_explicit_arg) v1 = where_history() + history_base + 1; else v1 = a0; saved_history_logical_offset = v1; _rl_saved_internal_startup_hook = _rl_internal_startup_hook; _rl_internal_startup_hook = set_saved_history; return 0; }
static void cp_option_init (struct cp_options *x) { _Bool selinux_enabled = (0 < is_selinux_enabled ()); cp_options_default (x); x->copy_as_regular = 0 ; x->reflink_mode = REFLINK_AUTO; x->dereference = DEREF_NEVER; x->unlink_dest_before_opening = 0 ; x->unlink_dest_after_failed_open = 0 ; x->hard_link = 0 ; x->interactive = I_UNSPECIFIED; x->move_mode = 1 ; x->install_mode = 0 ; x->one_file_system = 0 ; x->preserve_ownership = 1 ; x->preserve_links = 1 ; x->preserve_mode = 1 ; x->preserve_timestamps = 1 ; x->explicit_no_preserve_mode= 0 ; x->preserve_security_context = selinux_enabled; x->set_security_context = ((void *)0) ; x->reduce_diagnostics = 0 ; x->data_copy_required = 1 ; x->require_preserve = 0 ; x->require_preserve_context = 0 ; x->preserve_xattr = 1 ; x->require_preserve_xattr = 0 ; x->recursive = 1 ; x->sparse_mode = SPARSE_AUTO; x->symbolic_link = 0 ; x->set_mode = 0 ; x->mode = 0; x->stdin_tty = isatty ( 0 ); x->open_dangling_dest_symlink = 0 ; x->update = 0 ; x->verbose = 0 ; x->dest_info = ((void *)0) ; x->src_info = ((void *)0) ; }
void cp_option_init(long param_1) { int iVar1; iVar1 = is_selinux_enabled(); cp_options_default(param_1); *(undefined *)(param_1 + 0x14) = 0; *(undefined4 *)(param_1 + 0x44) = 1; *(undefined4 *)(param_1 + 4) = 2; *(undefined *)(param_1 + 0x15) = 0; *(undefined *)(param_1 + 0x16) = 0; *(undefined *)(param_1 + 0x17) = 0; *(undefined4 *)(param_1 + 8) = 4; *(undefined *)(param_1 + 0x18) = 1; *(undefined *)(param_1 + 0x19) = 0; *(undefined *)(param_1 + 0x1c) = 0; *(undefined *)(param_1 + 0x1d) = 1; *(undefined *)(param_1 + 0x30) = 1; *(undefined *)(param_1 + 0x1e) = 1; *(undefined *)(param_1 + 0x1f) = 1; *(undefined *)(param_1 + 0x20) = 0; *(bool *)(param_1 + 0x33) = 0 < iVar1; *(undefined8 *)(param_1 + 0x28) = 0; *(undefined *)(param_1 + 0x37) = 0; *(undefined *)(param_1 + 0x31) = 1; *(undefined *)(param_1 + 0x32) = 0; *(undefined *)(param_1 + 0x34) = 0; *(undefined *)(param_1 + 0x35) = 1; *(undefined *)(param_1 + 0x36) = 0; *(undefined *)(param_1 + 0x38) = 1; *(undefined4 *)(param_1 + 0xc) = 2; *(undefined *)(param_1 + 0x3a) = 0; *(undefined *)(param_1 + 0x39) = 0; *(undefined4 *)(param_1 + 0x10) = 0; iVar1 = isatty(0); *(bool *)(param_1 + 0x3d) = iVar1 != 0; *(undefined *)(param_1 + 0x3e) = 0; *(undefined *)(param_1 + 0x3b) = 0; *(undefined *)(param_1 + 0x3c) = 0; *(undefined8 *)(param_1 + 0x48) = 0; *(undefined8 *)(param_1 + 0x50) = 0; return; }
static void rsyslogd_destructAllActions(void) { ruleset.DestructAllActions(runConf); __sync_fetch_and_and(&bHaveMainQueue, 0); }
void rsyslogd_destructAllActions(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5, unsigned long v1, unsigned long a6) { int tmp_0; int tmp_12; int tmp_3; char v0; unsigned int v2; unsigned long long v3; *(4211824)(runConf); v2 = 0; while (true) { LABEL_403e98: tmp_0 = bHaveMainQueue; bHaveMainQueue = v2; tmp_12 = BinaryOp CasCmpNE; if (tmp_12) goto LABEL_403e98; v2 = bHaveMainQueue; v3 = *(&v0); return; } }
int print_mroute(struct nlmsghdr *n, void *arg) { struct rtmsg *r = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); int len = n->nlmsg_len; struct rtattr *tb[(__RTA_MAX - 1)+1]; FILE *fp = arg; const char *src, *dst; char b1[64]; char b2[64]; __u32 table; int iif = 0; int family; if ((n->nlmsg_type != RTM_NEWROUTE && n->nlmsg_type != RTM_DELROUTE)) { fprintf( stderr , "Not a multicast route: %08x %08x %08x\n", n->nlmsg_len, n->nlmsg_type, n->nlmsg_flags); return 0; } len -= ((sizeof(*r)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))); if (len < 0) { fprintf( stderr , "BUG: wrong nlmsg len %d\n", len); return -1; } if (r->rtm_type != RTN_MULTICAST) { fprintf( stderr , "Non multicast route received, kernel does support IP multicast?\n"); return -1; } parse_rtattr(tb, (__RTA_MAX - 1), ((struct rtattr*)(((char*)(r)) + ( ((sizeof(struct rtmsg))+4U -1) & ~(4U -1) ))), len); table = rtm_get_table(r, tb); if (filter.tb > 0 && filter.tb != table) return 0; if (tb[RTA_IIF]) iif = rta_getattr_u32(tb[RTA_IIF]); if (filter.iif && filter.iif != iif) return 0; if (filter.af && filter.af != r->rtm_family) return 0; if (inet_addr_match_rta(&filter.mdst, tb[RTA_DST])) return 0; if (inet_addr_match_rta(&filter.msrc, tb[RTA_SRC])) return 0; family = get_real_family(r->rtm_type, r->rtm_family); open_json_object( ((void *)0) ); if (n->nlmsg_type == RTM_DELROUTE) print_bool(PRINT_ANY, "deleted", "Deleted ", 1 ); if (tb[RTA_SRC]) src = rt_addr_n2a_r(family, ((int)((tb[RTA_SRC])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), ((void*)(((char*)(tb[RTA_SRC])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), b1, sizeof(b1)); else src = "unknown"; if (tb[RTA_DST]) dst = rt_addr_n2a_r(family, ((int)((tb[RTA_DST])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), ((void*)(((char*)(tb[RTA_DST])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), b2, sizeof(b2)); else dst = "unknown"; if (is_json_context()) { print_string(PRINT_JSON, "src", ((void *)0) , src); print_string(PRINT_JSON, "dst", ((void *)0) , dst); } else { char obuf[256]; snprintf(obuf, sizeof(obuf), "(%s,%s)", src, dst); print_string(PRINT_FP, ((void *)0) , "%-32s Iif: ", obuf); } if (iif) print_color_string(PRINT_ANY, COLOR_IFNAME, "iif", "%-10s ", ll_index_to_name(iif)); else print_string(PRINT_ANY,"iif", "%s ", "unresolved"); if (tb[RTA_MULTIPATH]) { struct rtnexthop *nh = ((void*)(((char*)(tb[RTA_MULTIPATH])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); int first = 1; open_json_array(PRINT_JSON, "multipath"); len = ((int)((tb[RTA_MULTIPATH])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))); for (;;) { if (len < sizeof(*nh)) break; if (nh->rtnh_len > len) break; open_json_object( ((void *)0) ); if (first) { print_string(PRINT_FP, ((void *)0) , "Oifs: ", ((void *)0) ); first = 0; } print_color_string(PRINT_ANY, COLOR_IFNAME, "oif", "%s", ll_index_to_name(nh->rtnh_ifindex)); if (nh->rtnh_hops > 1) print_uint(PRINT_ANY, "ttl", "(ttl %u) ", nh->rtnh_hops); else print_string(PRINT_FP, ((void *)0) , " ", ((void *)0) ); close_json_object(); len -= ( ((nh->rtnh_len)+4U -1) & ~(4U -1) ); nh = ((struct rtnexthop*)(((char*)(nh)) + ( (((nh)->rtnh_len)+4 -1) & ~(4 -1) ))); } close_json_array(PRINT_JSON, ((void *)0) ); } print_string(PRINT_ANY, "state", " State: %s", (r->rtm_flags & 32) ? "unresolved" : "resolved"); if (r->rtm_flags & 8) print_null(PRINT_ANY, "offload", " offload", ((void *)0) ); if (show_stats && tb[RTA_MFC_STATS]) { struct rta_mfc_stats *mfcs = ((void*)(((char*)(tb[RTA_MFC_STATS])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); print_nl(); print_u64(PRINT_ANY, "packets", " %" "l" "u" " packets,", mfcs->mfcs_packets); print_u64(PRINT_ANY, "bytes", " %" "l" "u" " bytes", mfcs->mfcs_bytes); if (mfcs->mfcs_wrong_if) print_u64(PRINT_ANY, "wrong_if", ", %" "l" "u" " arrived on wrong iif.", mfcs->mfcs_wrong_if); } if (show_stats && tb[RTA_EXPIRES]) { struct timeval tv; double age; __jiffies_to_tv(&tv, rta_getattr_u64(tb[RTA_EXPIRES])); age = tv.tv_sec; age += tv.tv_usec / 1000000.; print_float(PRINT_ANY, "expires", ", Age %.2f", age); } if (table && (table != RT_TABLE_MAIN || show_details > 0) && !filter.tb) print_string(PRINT_ANY, "table", " Table: %s", rtnl_rttable_n2a(table, b1, sizeof(b1))); print_string(PRINT_FP, ((void *)0) , "\n", ((void *)0) ); close_json_object(); fflush(fp); return 0; }
undefined8 print_mroute(uint *param_1,FILE *param_2) { bool bVar1; char cVar2; uint uVar3; int iVar4; int iVar5; undefined4 uVar6; uint *puVar7; undefined8 uVar8; char *pcVar9; long in_FS_OFFSET; uint local_2f4; int local_2f0; char *local_2e0; char *local_2d8; ushort *local_2d0; long local_2a8; long local_2a0; undefined local_298 [8]; ushort *local_290; ushort *local_288; long local_280; ushort *local_250; long local_210; long local_1e0; undefined local_198 [64]; undefined local_158 [64]; char local_118 [264]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); puVar7 = param_1 + 4; local_2f0 = 0; if ((*(short *)(param_1 + 1) == 0x18) || (*(short *)(param_1 + 1) == 0x19)) { uVar3 = *param_1 - 0x1c; if ((int)uVar3 < 0) { fprintf(stderr,"BUG: wrong nlmsg len %d\n",(ulong)uVar3); uVar8 = 0xffffffff; } else if (*(char *)((long)param_1 + 0x17) == '\x05') { parse_rtattr(local_298,0x1e,param_1 + 7,uVar3); iVar4 = rtm_get_table(puVar7,local_298); if ((filter._0_4_ < 1) || (iVar4 == filter._0_4_)) { if (local_280 != 0) { local_2f0 = rta_getattr_u32(local_280); } if ((filter._8_4_ == 0) || (local_2f0 == filter._8_4_)) { if ((filter._4_4_ == 0) || (filter._4_4_ == *(byte *)puVar7)) { iVar5 = inet_addr_match_rta(0x10104c,local_290); if (iVar5 == 0) { iVar5 = inet_addr_match_rta(0x101154,local_288); if (iVar5 == 0) { uVar6 = get_real_family(*(undefined *)((long)param_1 + 0x17),*(byte *)puVar7); open_json_object(0); if (*(short *)(param_1 + 1) == 0x19) { print_bool(4,"deleted","Deleted ",1); } if (local_288 == (ushort *)0x0) { local_2e0 = "unknown"; } else { local_2e0 = (char *)rt_addr_n2a_r(uVar6,*local_288 - 4,local_288 + 2,local_198, 0x40); } if (local_290 == (ushort *)0x0) { local_2d8 = "unknown"; } else { local_2d8 = (char *)rt_addr_n2a_r(uVar6,*local_290 - 4,local_290 + 2,local_158, 0x40); } cVar2 = is_json_context(); if (cVar2 == '\0') { snprintf(local_118,0x100,"(%s,%s)",local_2e0,local_2d8); print_string(1,0,"%-32s Iif: ",local_118); } else { print_string(2,&DAT_001013a2,0,local_2e0); print_string(2,&DAT_001013a6,0,local_2d8); } if (local_2f0 == 0) { print_string(4,&DAT_001013c5,&DAT_001013d4,"unresolved"); } else { uVar8 = ll_index_to_name(local_2f0); print_color_string(4,0,&DAT_001013c5,"%-10s ",uVar8); } if (local_250 != (ushort *)0x0) { local_2d0 = local_250 + 2; bVar1 = true; open_json_array(2,"multipath"); local_2f4 = *local_250 - 4; for (; (7 < local_2f4 && ((int)(uint)*local_2d0 <= (int)local_2f4)); local_2d0 = (ushort *) ((long)local_2d0 + (long)(int)(*local_2d0 + 3 & 0xfffffffc))) { open_json_object(0); if (bVar1) { print_string(1,0,"Oifs: ",0); bVar1 = false; } uVar8 = ll_index_to_name(*(undefined4 *)(local_2d0 + 2)); print_color_string(4,0,&DAT_001013ec,&DAT_001013e9,uVar8); if (*(byte *)((long)local_2d0 + 3) < 2) { print_string(1,0,&DAT_001013fe,0); } else { print_uint(4,&DAT_001013fa,"(ttl %u) ",*(undefined *)((long)local_2d0 + 3)); } close_json_object(); local_2f4 = local_2f4 - (*local_2d0 + 3 & 0xfffffffc); } close_json_array(2,0); } if ((param_1[6] & 0x20) == 0) { pcVar9 = "resolved"; } else { pcVar9 = "unresolved"; } print_string(4,"state"," State: %s",pcVar9); if ((param_1[6] & 8) != 0) { print_null(4,"offload"," offload",0); } if ((show_stats != 0) && (local_210 != 0)) { print_nl(); print_u64(4,"packets"," %lu packets,",*(undefined8 *)(local_210 + 4)); print_u64(4,"bytes"," %lu bytes",*(undefined8 *)(local_210 + 0xc)); if (*(long *)(local_210 + 0x14) != 0) { print_u64(4,"wrong_if",", %lu arrived on wrong iif.", *(undefined8 *)(local_210 + 0x14)); } } if ((show_stats != 0) && (local_1e0 != 0)) { uVar8 = rta_getattr_u64(local_1e0); __jiffies_to_tv(&local_2a8,uVar8); print_float((double)local_2a0 / DAT_00101560 + (double)local_2a8,4,"expires", ", Age %.2f"); } if ((iVar4 != 0) && (((iVar4 != 0xfe || (0 < show_details)) && (filter._0_4_ == 0))) ) { uVar8 = rtnl_rttable_n2a(iVar4,local_198,0x40); print_string(4,"table"," Table: %s",uVar8); } print_string(1,0,&DAT_0010149c,0); close_json_object(); fflush(param_2); uVar8 = 0; } else { uVar8 = 0; } } else { uVar8 = 0; } } else { uVar8 = 0; } } else { uVar8 = 0; } } else { uVar8 = 0; } } else { fprintf(stderr,"Non multicast route received, kernel does support IP multicast?\n"); uVar8 = 0xffffffff; } } else { fprintf(stderr,"Not a multicast route: %08x %08x %08x\n",(ulong)*param_1, (ulong)*(ushort *)(param_1 + 1),(ulong)*(ushort *)((long)param_1 + 6)); uVar8 = 0; } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return uVar8; } __stack_chk_fail(); }
static void setup_db(e2fsck_t ctx) { struct dir_info_db *db; ext2_ino_t num_dirs; errcode_t retval; db = (struct dir_info_db *) e2fsck_allocate_memory(ctx, sizeof(struct dir_info_db), "directory map db"); db->count = db->size = 0; db->array = 0; ctx->dir_info = db; retval = ext2fs_get_num_dirs(ctx->fs, &num_dirs); if (retval) num_dirs = 1024; setup_tdb(ctx, num_dirs); if (db->tdb) { return; } db->size = num_dirs + 10; db->array = (struct dir_info *) e2fsck_allocate_memory(ctx, db->size * sizeof (struct dir_info), "directory map"); }
unsigned long setup_db(_QWORD *a1) { long v1; unsigned int v3; long memory; unsigned long v6; v6 = __readfsqword(0x28u); memory = e2fsck_allocate_memory(a1, 40LL, "directory map db"); *(_DWORD *)(memory + 4) = 0; *(_DWORD *)memory = *(_DWORD *)(memory + 4); *(_QWORD *)(memory + 8) = 0LL; a1[70] = memory; if ( ext2fs_get_num_dirs(*a1, &v3) ) v3 = 1024; setup_tdb(a1, v3); if ( !*(_QWORD *)(memory + 32) ) { *(_DWORD *)(memory + 4) = v3 + 10; v1 = e2fsck_allocate_memory(a1, 12LL * *(unsigned int *)(memory + 4), "directory map"); *(_QWORD *)(memory + 8) = v1; } return __readfsqword(0x28u) ^ v6; }
static int evalsubshell(union node *n, int flags) { struct job *jp; int backgnd = (n->type == 3); int status; errlinno = lineno = n->nredir.linno; if (funcline) lineno -= funcline - 1; expredir(n->nredir.redirect); ({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; }); if (!backgnd && flags & 01 && !have_traps()) { forkreset(); goto nofork; } jp = makejob(n, 1); if (forkshell(jp, n, backgnd) == 0) { flags |= 01; if (backgnd) flags &=~ 02; nofork: ({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; }); redirect(n->nredir.redirect, 0); evaltreenr(n->nredir.n, flags); } status = 0; if (! backgnd) status = waitforjob(jp); ({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; }); return status; }
long evalsubshell(long a1, unsigned int a2) { unsigned int v3; unsigned int v4; _BOOL4 v5; long v6; v3 = a2; v5 = *(_DWORD *)a1 == 3; lineno = *(_DWORD *)(a1 + 4); errlinno = lineno; if ( funcline ) lineno -= funcline - 1; expredir(*(_QWORD *)(a1 + 16)); ++suppressint; if ( !v5 && (a2 & 1) != 0 && !(unsigned int)have_traps() ) { forkreset(); goto LABEL_10; } v6 = makejob(a1, 1LL); if ( !(unsigned int)forkshell(v6, a1, v5) ) { v3 = a2 | 1; if ( v5 ) v3 = a2 & 0xFFFFFFFC | 1; LABEL_10: if ( !--suppressint ) { if ( intpending ) onint(); } redirect(*(_QWORD *)(a1 + 16), 0LL); evaltreenr(*(_QWORD *)(a1 + 8), v3); } v4 = 0; if ( !v5 ) v4 = waitforjob(v6); if ( !--suppressint && intpending ) onint(); return v4; }
char * make_file_name (const char *directory_name, const char *name) { size_t dirlen = strlen (directory_name); size_t namelen = strlen (name) + 1; int slash = dirlen && ! (( directory_name[dirlen - 1] ) == '/') ; char *buffer = xmalloc (dirlen + slash + namelen); memcpy (buffer, directory_name, dirlen); buffer[dirlen] = '/'; memcpy (buffer + dirlen + slash, name, namelen); return buffer; }
long long make_file_name(char *a0, void* a1) { unsigned int v0; char *v1; unsigned int v2; char *v3; unsigned int v5; v1 = strlen(a0); v5 = strlen(a1) + 1; v2 = v5; if (!v1 || *((a0 + v1 + 1)) == 47) v5 = 0; else v5 = 1; v0 = v5; v3 = xmalloc(&v1[v0 + *(&v2)]); memcpy(v3, a0, v1); *((v1 + v3)) = 47; memcpy(&v1[v0] + v3, a1, *(&v2)); return v3; }
struct predicate * get_new_pred (const struct parser_table *entry) { register struct predicate *new_pred; (void) entry; ((void) sizeof (( entry->type != ARG_OPTION ) ? 1 : 0), __extension__ ({ if ( entry->type != ARG_OPTION ) ; else __assert_fail ( "entry->type != ARG_OPTION" , "tree.c", 1485, __extension__ __PRETTY_FUNCTION__); })) ; ((void) sizeof (( entry->type != ARG_POSITIONAL_OPTION ) ? 1 : 0), __extension__ ({ if ( entry->type != ARG_POSITIONAL_OPTION ) ; else __assert_fail ( "entry->type != ARG_POSITIONAL_OPTION" , "tree.c", 1486, __extension__ __PRETTY_FUNCTION__); })) ; new_pred = xzalloc (sizeof (struct predicate)); if (predicates == ((void *)0) ) { last_pred = predicates = new_pred; } else { last_pred->pred_next = new_pred; last_pred = new_pred; } last_pred->parser_entry = entry; last_pred->p_type = NO_TYPE; last_pred->p_prec = NO_PREC; last_pred->need_stat = 1 ; last_pred->need_type = 1 ; last_pred->p_cost = NeedsUnknown; last_pred->arg_text = "ThisShouldBeSetToSomethingElse"; last_pred->literal_control_chars = options.literal_control_chars; last_pred->est_success_rate = 1.0; init_pred_perf (last_pred); return last_pred; }
int get_new_pred(unsigned int *a0) { unsigned long long v1; unsigned long long v2; if (!*(a0)) { __assert_fail(); } else if (*(a0) == 2) { __assert_fail(); } else { v1 = xzalloc(0x138); v2 = v1; if (predicates) { last_pred->field_108 = v2; last_pred = v2; } else { predicates = v1; last_pred = predicates; } last_pred->field_130 = a0; last_pred->field_10 = 0; last_pred->field_14 = 0; last_pred->field_1a = 1; last_pred->field_1b = 1; last_pred->field_20 = 10; last_pred->field_30 = "ThisShouldBeSetToSomethingElse"; last_pred->field_28 = g_500067; last_pred->field_24 = g_403c34; init_pred_perf(last_pred); return last_pred; } }
char * readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) { ssize_t nr; int input, output, save_errno, i, need_restart; char ch, *p, *end; struct termios term, oterm; struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm; struct sigaction savetstp, savettin, savettou, savepipe; if (bufsiz == 0) { (*__errno_location ()) = 22 ; return( ((void *)0) ); } restart: for (i = 0; i < (64 + 1) ; i++) signo[i] = 0; nr = -1; save_errno = 0; need_restart = 0; if ((flags & 0x20 ) || (input = output = open( "/dev/tty" , 02 )) == -1) { if (flags & 0x02 ) { (*__errno_location ()) = 25 ; return( ((void *)0) ); } input = 0 ; output = 2 ; } if (input != 0 && tcgetattr(input, &oterm) == 0) { memcpy(&term, &oterm, sizeof(term)); if (!(flags & 0x01 )) term.c_lflag &= ~( 0000010 | 0000100 ); (void)tcsetattr(input, 2 |0, &term); } else { memset(&term, 0, sizeof(term)); term.c_lflag |= 0000010 ; memset(&oterm, 0, sizeof(oterm)); oterm.c_lflag |= 0000010 ; } sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa. __sigaction_handler.sa_handler = handler; (void)sigaction( 14 , &sa, &savealrm); (void)sigaction( 1 , &sa, &savehup); (void)sigaction( 2 , &sa, &saveint); (void)sigaction( 13 , &sa, &savepipe); (void)sigaction( 3 , &sa, &savequit); (void)sigaction( 15 , &sa, &saveterm); (void)sigaction( 20 , &sa, &savetstp); (void)sigaction( 21 , &sa, &savettin); (void)sigaction( 22 , &sa, &savettou); if (!(flags & 0x20 )) (void)write(output, prompt, strlen(prompt)); end = buf + bufsiz - 1; p = buf; while ((nr = read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r') { if (p < end) { if ((flags & 0x10 )) ch &= 0x7f; if ( ((*__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); } *p++ = ch; } } *p = '\0'; save_errno = (*__errno_location ()) ; if (!(term.c_lflag & 0000010 )) (void)write(output, "\n", 1); if (memcmp(&term, &oterm, sizeof(term)) != 0) { const int sigttou = signo[ 22 ]; while (tcsetattr(input, 2 |0, &oterm) == -1 && (*__errno_location ()) == 4 && !signo[ 22 ]) continue; signo[ 22 ] = sigttou; } (void)sigaction( 14 , &savealrm, ((void *)0) ); (void)sigaction( 1 , &savehup, ((void *)0) ); (void)sigaction( 2 , &saveint, ((void *)0) ); (void)sigaction( 3 , &savequit, ((void *)0) ); (void)sigaction( 13 , &savepipe, ((void *)0) ); (void)sigaction( 15 , &saveterm, ((void *)0) ); (void)sigaction( 20 , &savetstp, ((void *)0) ); (void)sigaction( 21 , &savettin, ((void *)0) ); (void)sigaction( 22 , &savettou, ((void *)0) ); if (input != 0 ) (void)close(input); for (i = 0; i < (64 + 1) ; i++) { if (signo[i]) { kill(getpid(), i); switch (i) { case 20 : case 21 : case 22 : need_restart = 1; } } } if (need_restart) goto restart; if (save_errno) (*__errno_location ()) = save_errno; return(nr == -1 ? ((void *)0) : buf); }
byte * readpassphrase(char *param_1,byte *param_2,long param_3,uint param_4) { int iVar1; __pid_t __pid; int *piVar2; size_t __n; ushort **ppuVar3; long in_FS_OFFSET; byte local_6f9; int local_6f8; int local_6f4; int local_6f0; int local_6ec; int local_6e8; int local_6e4; byte *local_6e0; ssize_t local_6d8; byte *local_6d0; termios local_6c8; termios local_688; sigaction local_648; sigaction local_5a8; sigaction local_508; sigaction local_468; sigaction local_3c8; sigaction local_328; sigaction local_288; sigaction local_1e8; sigaction local_148; sigaction local_a8; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); if (param_3 == 0) { piVar2 = __errno_location(); *piVar2 = 0x16; param_2 = (byte *)0x0; } else { do { for (local_6f0 = 0; local_6f0 < 0x41; local_6f0 = local_6f0 + 1) { *(undefined4 *)(signo + (long)local_6f0 * 4) = 0; } local_6d8 = -1; local_6e8 = 0; local_6ec = 0; if (((param_4 & 0x20) != 0) || (local_6f8 = open("/dev/tty",2), local_6f4 = local_6f8, local_6f8 == -1)) { if ((param_4 & 2) != 0) { piVar2 = __errno_location(); *piVar2 = 0x19; param_2 = (byte *)0x0; goto LAB_001006bd; } local_6f8 = 0; local_6f4 = 2; } if ((local_6f8 == 0) || (iVar1 = tcgetattr(local_6f8,&local_688), iVar1 != 0)) { memset(&local_6c8,0,0x3c); local_6c8.c_lflag = local_6c8.c_lflag | 8; memset(&local_688,0,0x3c); local_688.c_lflag = local_688.c_lflag | 8; } else { memcpy(&local_6c8,&local_688,0x3c); if ((param_4 & 1) == 0) { local_6c8.c_lflag = local_6c8.c_lflag & 0xffffffb7; } tcsetattr(local_6f8,2,&local_6c8); } sigemptyset(&local_648.sa_mask); local_648.sa_flags = 0; local_648.__sigaction_handler = handler; sigaction(0xe,&local_648,&local_5a8); sigaction(1,&local_648,&local_468); sigaction(2,&local_648,&local_508); sigaction(0xd,&local_648,&local_a8); sigaction(3,&local_648,&local_3c8); sigaction(0xf,&local_648,&local_328); sigaction(0x14,&local_648,&local_288); sigaction(0x15,&local_648,&local_1e8); sigaction(0x16,&local_648,&local_148); if ((param_4 & 0x20) == 0) { __n = strlen(param_1); write(local_6f4,param_1,__n); } local_6d0 = param_2 + param_3 + -1; local_6e0 = param_2; while (((local_6d8 = read(local_6f8,&local_6f9,1), local_6d8 == 1 && (local_6f9 != 10)) && (local_6f9 != 0xd))) { if (local_6e0 < local_6d0) { if ((param_4 & 0x10) != 0) { local_6f9 = local_6f9 & 0x7f; } ppuVar3 = __ctype_b_loc(); if (((*ppuVar3)[local_6f9] & 0x400) != 0) { if ((param_4 & 4) != 0) { iVar1 = tolower((uint)local_6f9); local_6f9 = (byte)iVar1; } if ((param_4 & 8) != 0) { iVar1 = toupper((uint)local_6f9); local_6f9 = (byte)iVar1; } } *local_6e0 = local_6f9; local_6e0 = local_6e0 + 1; } } *local_6e0 = 0; piVar2 = __errno_location(); local_6e8 = *piVar2; if ((local_6c8.c_lflag & 8) == 0) { write(local_6f4,&DAT_0010080d,1); } iVar1 = memcmp(&local_6c8,&local_688,0x3c); if (iVar1 != 0) { local_6e4 = signo._88_4_; do { iVar1 = tcsetattr(local_6f8,2,&local_688); if ((iVar1 != -1) || (piVar2 = __errno_location(), *piVar2 != 4)) break; } while (signo._88_4_ == 0); signo._88_4_ = local_6e4; } sigaction(0xe,&local_5a8,(sigaction *)0x0); sigaction(1,&local_468,(sigaction *)0x0); sigaction(2,&local_508,(sigaction *)0x0); sigaction(3,&local_3c8,(sigaction *)0x0); sigaction(0xd,&local_a8,(sigaction *)0x0); sigaction(0xf,&local_328,(sigaction *)0x0); sigaction(0x14,&local_288,(sigaction *)0x0); sigaction(0x15,&local_1e8,(sigaction *)0x0); sigaction(0x16,&local_148,(sigaction *)0x0); if (local_6f8 != 0) { close(local_6f8); } for (local_6f0 = 0; local_6f0 < 0x41; local_6f0 = local_6f0 + 1) { if (*(int *)(signo + (long)local_6f0 * 4) != 0) { __pid = getpid(); kill(__pid,local_6f0); if (local_6f0 - 0x14U < 3) { local_6ec = 1; } } } } while (local_6ec != 0); if (local_6e8 != 0) { piVar2 = __errno_location(); *piVar2 = local_6e8; } if (local_6d8 == -1) { param_2 = (byte *)0x0; } } LAB_001006bd: if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return param_2; } __stack_chk_fail(); }
static __inline void _rs_forkdetect(void) { static pid_t _rs_pid = 0; pid_t pid = getpid(); if (_rs_pid == 0 || _rs_pid == 1 || _rs_pid != pid || _rs_forked) { _rs_pid = pid; _rs_forked = 0; if (rs) memset(rs, 0, sizeof(*rs)); } }
void _rs_forkdetect() { unsigned int v0; unsigned long long v2; unsigned long long v3; unsigned long long v4; v0 = getpid(); if (_rs_pid.6618 && _rs_pid.6618 != 1 && v0 == _rs_pid.6618) { v2 = _rs_forked; if (!_rs_forked) goto LABEL_4012cd; } _rs_pid.6618 = v0; _rs_forked = 0; v3 = rs; if (rs) v4 = memset(rs, 0x0, 0x10); LABEL_4012cd: return; }
static int do_file(int agent_fd, int deleting, int key_only, char *file, int qflag, const char *skprovider, struct dest_constraint **dest_constraints, size_t ndest_constraints) { if (deleting) { if (delete_file(agent_fd, file, key_only, qflag) == -1) return -1; } else { if (add_file(agent_fd, file, key_only, qflag, skprovider, dest_constraints, ndest_constraints) == -1) return -1; } return 0; }
undefined8 do_file(undefined4 param_1,int param_2,undefined4 param_3,undefined8 param_4,undefined4 param_5, undefined8 param_6,undefined8 param_7,undefined8 param_8) { int iVar1; if (param_2 == 0) { iVar1 = add_file(param_1,param_4,param_3,param_5,param_6,param_7,param_8); if (iVar1 == -1) { return 0xffffffff; } } else { iVar1 = delete_file(param_1,param_4,param_3,param_5); if (iVar1 == -1) { return 0xffffffff; } } return 0; }
static void discard_input_bytes (nbytes, flags) size_t nbytes; unsigned int flags; { while (nbytes != 0) { uch c = (inptr < insize ? inbuf[inptr++] : fill_inbuf(0)); if (flags & 0x02) updcrc (&c, 1); if (nbytes != (size_t) -1) nbytes--; else if (! c) break; } }
void discard_input_bytes(unsigned long a0, unsigned long a1) { unsigned long v0; char v1; char v2; unsigned long v4; unsigned long long *v5; unsigned long long v6; v0 = a0; while (true) { if (!v0) break; if (true) { v4 = fill_inbuf(0x0); } else { outcnt = 3850979414; v4 = *(-498339038545487787); } v1 = v4; if ((a1 & 2)) updcrc(&v1, 0x1); if (v0 != -1) { v0 -= 1; } else if (!v1) { break; } } v6 = *(&v2) ^ v5[5]; return; }
static _Bool fold_file (char const *filename, size_t width) { FILE *istream; int c; size_t column = 0; size_t offset_out = 0; static char *line_out = ((void *)0) ; static size_t allocated_out = 0; int saved_errno; if ((strcmp (filename, "-") == 0)) { istream = stdin ; have_read_stdin = 1 ; } else istream = fopen (filename, "r"); if (istream == ((void *)0) ) { error (0, (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, filename)); return 0 ; } fadvise (istream, FADVISE_SEQUENTIAL); while ((c = getc_unlocked (istream)) != (-1) ) { if (offset_out + 1 >= allocated_out) line_out = ((!!sizeof (struct { _Static_assert (sizeof *(line_out) == 1, "verify_expr (" "sizeof *(line_out) == 1" ", " "x2realloc (line_out, &allocated_out)" ")"); int _gl_dummy; })) ? (x2realloc (line_out, &allocated_out)) : (x2realloc (line_out, &allocated_out))); if (c == '\n') { line_out[offset_out++] = c; fwrite_unlocked (line_out,sizeof (char),offset_out, stdout ); column = offset_out = 0; continue; } rescan: column = adjust_column (column, c); if (column > width) { if (break_spaces) { _Bool found_blank = 0 ; size_t logical_end = offset_out; while (logical_end) { --logical_end; if ( ((*__ctype_b_loc ())[(int) (( to_uchar (line_out[logical_end]) ))] & (unsigned short int) _ISblank) ) { found_blank = 1 ; break; } } if (found_blank) { size_t i; logical_end++; fwrite_unlocked (line_out,sizeof (char),(size_t) logical_end, stdout ) ; putchar_unlocked ('\n'); memmove (line_out, line_out + logical_end, offset_out - logical_end); offset_out -= logical_end; for (column = i = 0; i < offset_out; i++) column = adjust_column (column, line_out[i]); goto rescan; } } if (offset_out == 0) { line_out[offset_out++] = c; continue; } line_out[offset_out++] = '\n'; fwrite_unlocked (line_out,sizeof (char),(size_t) offset_out, stdout ); column = offset_out = 0; goto rescan; } line_out[offset_out++] = c; } saved_errno = (*__errno_location ()) ; if (!ferror_unlocked (istream)) saved_errno = 0; if (offset_out) fwrite_unlocked (line_out,sizeof (char),(size_t) offset_out, stdout ); if ((strcmp (filename, "-") == 0)) clearerr_unlocked (istream); else if ( rpl_fclose (istream) != 0 && !saved_errno) saved_errno = (*__errno_location ()) ; if (saved_errno) { error (0, saved_errno, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, filename)); return 0 ; } return 1 ; }
long fold_file(const char *a1, unsigned long a2) { const char *v2; int *v3; unsigned long i; const unsigned short *v6; size_t v7; const char *v8; char v9; int errnum; int v11; struct _IO_FILE *stream; long v13; size_t n; size_t v15; size_t v16; size_t v17; v13 = 0LL; n = 0LL; if ( !strcmp(a1, "-") ) { stream = stdin; have_read_stdin = 1; } else { stream = fopen(a1, "r"); } if ( stream ) { fadvise(stream, 2LL); LABEL_27: while ( 1 ) { v11 = getc_unlocked(stream); if ( v11 == -1 ) break; if ( n + 1 >= allocated_out_5794 ) line_out_5793 = (void *)x2realloc(line_out_5793, &allocated_out_5794); if ( v11 == 10 ) { *((_BYTE *)line_out_5793 + n) = 10; fwrite_unlocked(line_out_5793, 1uLL, n + 1, stdout); n = 0LL; v13 = 0LL; } else { LABEL_11: for ( i = adjust_column(v13, v11); ; i = adjust_column(0LL, v11) ) { v13 = i; if ( i <= a2 ) break; if ( break_spaces ) { v9 = 0; v15 = n; while ( v15 ) { --v15; v6 = *_ctype_b_loc(); if ( (v6[(unsigned char)to_uchar(*((_BYTE *)line_out_5793 + v15))] & 1) != 0 ) { v9 = 1; break; } } if ( v9 ) { v16 = v15 + 1; fwrite_unlocked(line_out_5793, 1uLL, v16, stdout); putchar_unlocked(10); memmove(line_out_5793, (char *)line_out_5793 + v16, n - v16); n -= v16; v17 = 0LL; v13 = 0LL; while ( v17 < n ) v13 = adjust_column(v13, *((_BYTE *)line_out_5793 + v17++)); goto LABEL_11; } } if ( !n ) { n = 1LL; *(_BYTE *)line_out_5793 = v11; goto LABEL_27; } *((_BYTE *)line_out_5793 + n) = 10; fwrite_unlocked(line_out_5793, 1uLL, n + 1, stdout); n = 0LL; } v7 = n++; *((_BYTE *)line_out_5793 + v7) = v11; } } errnum = *_errno_location(); if ( !ferror_unlocked(stream) ) errnum = 0; if ( n ) fwrite_unlocked(line_out_5793, 1uLL, n, stdout); if ( !strcmp(a1, "-") ) { clearerr_unlocked(stream); } else if ( (unsigned int)rpl_fclose(stream) && !errnum ) { errnum = *_errno_location(); } if ( errnum ) { v8 = (const char *)quotearg_n_style_colon(0LL, 3LL, a1); error(0, errnum, "%s", v8); return 0LL; } else { return 1LL; } } else { v2 = (const char *)quotearg_n_style_colon(0LL, 3LL, a1); v3 = _errno_location(); error(0, *v3, "%s", v2); return 0LL; } }
static inline __u32 nl_mgrp(__u32 group) { if (group > 31 ) { fprintf( stderr , "Use setsockopt for this group %d\n", group); exit(-1); } return group ? (1 << (group - 1)) : 0; }
int nl_mgrp(unsigned long a0) { unsigned int v1; if (a0 > 31) { fprintf(stderr, "Use setsockopt for this group %d\n", a0); exit(0xffffffff); } if (!a0) v1 = 0; else v1 = 1 << (a0 - 1 & 31); return v1; }
int check4nfs(const char * path, char * real) { char buf[ 4096 +1]; const char *curr; int deep = maxsymlinks(); if (!nlist) return 0; curr = path; do { const char *prev; int len; if ((prev = (__extension__ ({ const char *__old = ( curr ); size_t __len = strlen (__old) + 1; char *__new = (char *) __builtin_alloca (__len); (char *) memcpy (__new, __old, __len); })) ) == ((void *)0) ) { nsyslog( 3 , "strdupa(): %s\n", strerror( (*__errno_location ()) )); return 0; } (*__errno_location ()) = 0; if ((len = readlink(curr, buf, 4096 )) < 0) break; buf[len] = '\0'; if (buf[0] != '/') { const char *slash; if ((slash = strrchr(prev, '/'))) { size_t off = slash - prev + 1; if (off + len > 4096 ) len = 4096 - off; memmove(&buf[off], &buf[0], len + 1); memcpy(&buf[0], prev, off); } } curr = &buf[0]; if (deep-- <= 0) return 0; } while (1); if (real) { memset(real, '\0', 4096 + 1); strncpy(real, curr, 4096 ); } if ( (*__errno_location ()) == 22 ) { const size_t nlen = strlen(curr); NFS *p; for (p = nlist; p; p = p->next) { if (nlen < p->nlen) continue; if (curr[p->nlen] != '\0' && curr[p->nlen] != '/') continue; if (!strncmp(curr, p->name, p->nlen)) { if (shadow(p->shadow, curr, nlen)) continue; return 1; } } } return 0; }
long check4nfs(char *a1, char *a2) { size_t v3; unsigned long v4; void *v5; int *v6; char *v7; int v8; char *v9; char *v10; int v11; int v12; char *path; long i; char *s; size_t n; void *dest; char *v18; char *v19; size_t v20; unsigned long v21; char buf[16]; unsigned long v23; v10 = a1; v9 = a2; v23 = __readfsqword(0x28u); v11 = maxsymlinks(); if ( !nlist ) return 0LL; path = v10; while ( 1 ) { s = path; v3 = strlen(path); n = v3 + 1; v4 = 16 * ((v3 + 24) / 0x10); while ( &v9 != (char **)((char *)&v9 - (v4 & 0xFFFFFFFFFFFFF000LL)) ) ; v5 = alloca(v4 & 0xFFF); if ( (v4 & 0xFFF) != 0 ) *(char **)((char *)&v9 + (v4 & 0xFFF) - 8) = *(char **)((char *)&v9 + (v4 & 0xFFF) - 8); dest = &v9; v18 = (char *)memcpy(&v9, s, n); if ( !v18 ) { v6 = _errno_location(); v7 = strerror(*v6); nsyslog(3, "strdupa(): %s\n", v7); return 0LL; } *_errno_location() = 0; v12 = readlink(path, buf, 0x1000uLL); if ( v12 < 0 ) break; buf[v12] = 0; if ( buf[0] != 47 ) { v19 = strrchr(v18, 47); if ( v19 ) { v20 = v19 - v18 + 1; if ( v12 + v20 > 0x1000 ) v12 = 4096 - v20; memmove(&buf[v20], buf, v12 + 1); memcpy(buf, v18, v20); } } path = buf; v8 = v11--; if ( v8 <= 0 ) return 0LL; } if ( v9 ) { memset(v9, 0, 0x1001uLL); strncpy(v9, path, 0x1000uLL); } if ( *_errno_location() == 22 ) { v21 = strlen(path); for ( i = nlist; i; i = *(_QWORD *)i ) { if ( v21 >= *(_QWORD *)(i + 24) && (!path[*(_QWORD *)(i + 24)] || path[*(_QWORD *)(i + 24)] == 47) && !strncmp(path, *(const char **)(i + 32), *(_QWORD *)(i + 24)) && !(unsigned int)shadow(*(long ***)(i + 16), path, v21) ) { return 1LL; } } } return 0LL; }
void verify_pkcs7(common_info_st * cinfo, const char *purpose, unsigned display_data) { gnutls_pkcs7_t pkcs7; int ret, ecode; size_t size; gnutls_datum_t data, detached = { ((void *)0) ,0}; gnutls_datum_t tmp = { ((void *)0) ,0}; int i; gnutls_pkcs7_signature_info_st info; gnutls_x509_trust_list_t tl = ((void *)0) ; gnutls_typed_vdata_st vdata[2]; unsigned vdata_size = 0; gnutls_x509_crt_t signer = ((void *)0) ; unsigned flags = 0; ret = gnutls_pkcs7_init(&pkcs7); if (ret < 0) { fprintf( stderr , "p7_init: %s\n", gnutls_strerror(ret)); app_exit(1); } data.data = (void *) _gnutls_fread_file(infile, 0, &size); data.size = size; if (!data.data) { fprintf( stderr , "%s", infile ? "file" : "standard input"); app_exit(1); } ret = gnutls_pkcs7_import(pkcs7, &data, cinfo->incert_format); free(data.data); if (ret < 0) { fprintf( stderr , "import error: %s\n", gnutls_strerror(ret)); app_exit(1); } if (cinfo->cert != ((void *)0) ) { signer = load_cert(1, cinfo); } else { tl = load_tl(cinfo); if (tl == ((void *)0) ) { fprintf( stderr , "error loading trust list\n"); } } if (cinfo->data_file) load_data(cinfo, &detached); if (purpose) { vdata[vdata_size].type = GNUTLS_DT_KEY_PURPOSE_OID; vdata[vdata_size].data = (void*)purpose; vdata[vdata_size].size = strlen(purpose); vdata_size++; } ecode = 1; for (i=0;;i++) { ret = gnutls_pkcs7_get_signature_info(pkcs7, i, &info); if (ret < 0) break; if (!display_data) { if (i==0) { fprintf(outfile, "eContent Type: %s\n", gnutls_pkcs7_get_embedded_data_oid(pkcs7)); fprintf(outfile, "Signers:\n"); } print_pkcs7_sig_info(&info, cinfo); } else if (i == 0) { if (!detached.data) { ret = gnutls_pkcs7_get_embedded_data(pkcs7, 0, &tmp); if (ret < 0) { fprintf( stderr , "error getting embedded data: %s\n", gnutls_strerror(ret)); app_exit(1); } fwrite(tmp.data, 1, tmp.size, outfile); gnutls_free((void *) (tmp.data)), tmp.data= ((void *)0) ; tmp.data = ((void *)0) ; } else { fwrite(detached.data, 1, detached.size, outfile); } } gnutls_pkcs7_signature_info_deinit(&info); if (certtool_options.present.verify_allow_broken) flags |= (GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD2|GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5); if (signer) { ret = gnutls_pkcs7_verify_direct(pkcs7, signer, i, detached.data!= ((void *)0) ?&detached: ((void *)0) , flags); if (ret >= 0 && purpose) { unsigned res = gnutls_x509_crt_check_key_purpose(signer, purpose, 0); if (res == 0) ret = -101; } } else { ((void) sizeof (( tl != ((void *)0)) ? 1 : 0), __extension__ ({ if ( tl != ((void *)0)) ; else __assert_fail ( "tl != NULL" , "certtool.c", 2756, __extension__ __PRETTY_FUNCTION__); })) ; ret = gnutls_pkcs7_verify(pkcs7, tl, vdata, vdata_size, i, detached.data!= ((void *)0) ?&detached: ((void *)0) , flags); } if (ret < 0) { fprintf( stderr , "\tSignature status: verification failed: %s\n", gnutls_strerror(ret)); ecode = 1; } else { fprintf( stderr , "\tSignature status: ok\n"); ecode = 0; } } gnutls_pkcs7_deinit(pkcs7); if (signer) gnutls_x509_crt_deinit(signer); else gnutls_x509_trust_list_deinit(tl, 1); free(detached.data); app_exit(ecode); }
void verify_pkcs7(long param_1,char *param_2,int param_3) { bool bVar1; int iVar2; undefined8 uVar3; char *pcVar4; size_t sVar5; void **ppvVar6; long in_FS_OFFSET; int local_150; int local_148; undefined4 local_140; undefined8 local_138; undefined local_130 [8]; long local_128; long local_120; void *local_118 [2]; void *local_108; uint local_100; void *local_f8; uint local_f0; undefined4 local_e8 [2]; char *pcStack224; undefined4 uStack216; undefined local_b8 [168]; undefined8 local_10; local_10 = *(undefined8 *)(in_FS_OFFSET + 0x28); local_108 = (void *)0x0; local_100 = 0; local_f8 = (void *)0x0; local_f0 = 0; local_128 = 0; local_120 = 0; local_140 = 0; iVar2 = gnutls_pkcs7_init(&local_138); if (iVar2 < 0) { uVar3 = gnutls_strerror(iVar2); fprintf(stderr,"p7_init: %s\n",uVar3); app_exit(1); } local_118[0] = (void *)_gnutls_fread_file(infile,0,local_130); if (local_118[0] == (void *)0x0) { if (infile == 0) { pcVar4 = "standard input"; } else { pcVar4 = "file"; } fprintf(stderr,"%s",pcVar4); app_exit(1); } iVar2 = gnutls_pkcs7_import(local_138,local_118,*(undefined4 *)(param_1 + 0x1c)); free(local_118[0]); if (iVar2 < 0) { uVar3 = gnutls_strerror(iVar2); fprintf(stderr,"import error: %s\n",uVar3); app_exit(1); } if (*(long *)(param_1 + 0x28) == 0) { local_128 = load_tl(param_1); if (local_128 == 0) { fprintf(stderr,"error loading trust list\n"); } } else { local_120 = load_cert(1); } if (*(long *)(param_1 + 0x48) != 0) { load_data(param_1); } if (param_2 != (char *)0x0) { local_e8[0] = 2; pcStack224 = param_2; sVar5 = strlen(param_2); uStack216 = (undefined4)sVar5; } bVar1 = true; local_148 = 0; do { iVar2 = gnutls_pkcs7_get_signature_info(local_138,local_148,local_b8); if (iVar2 < 0) { gnutls_pkcs7_deinit(local_138); if (local_120 == 0) { gnutls_x509_trust_list_deinit(local_128,1); } else { gnutls_x509_crt_deinit(local_120); } free(local_108); app_exit(bVar1); } if (param_3 == 0) { if (local_148 == 0) { uVar3 = gnutls_pkcs7_get_embedded_data_oid(local_138); fprintf(outfile,"eContent Type: %s\n",uVar3); fprintf(outfile,"Signers:\n"); } print_pkcs7_sig_info(local_b8,param_1); } else if (local_148 == 0) { if (local_108 == (void *)0x0) { iVar2 = gnutls_pkcs7_get_embedded_data(local_138,0,&local_f8); if (iVar2 < 0) { uVar3 = gnutls_strerror(iVar2); fprintf(stderr,"error getting embedded data: %s\n",uVar3); app_exit(1); } fwrite(local_f8,1,(ulong)local_f0,outfile); (*gnutls_free)(local_f8); local_f8 = (void *)0x0; } else { fwrite(local_108,1,(ulong)local_100,outfile); } } uVar3 = 0x106e07; gnutls_pkcs7_signature_info_deinit(); if (DAT_0010d09a != '\0') { local_140 = 0x30; } if (local_120 == 0) { if (local_128 == 0) { __assert_fail("tl != NULL","certtool.c",0xac4,"verify_pkcs7"); } if (local_108 == (void *)0x0) { ppvVar6 = (void **)0x0; } else { ppvVar6 = &local_108; } local_150 = gnutls_pkcs7_verify(local_138,local_128,local_e8,param_2 != (char *)0x0,local_148, ppvVar6,local_140,uVar3); } else { if (local_108 == (void *)0x0) { ppvVar6 = (void **)0x0; } else { ppvVar6 = &local_108; } local_150 = gnutls_pkcs7_verify_direct(local_138,local_120,local_148,ppvVar6,local_140); if ((-1 < local_150) && (param_2 != (char *)0x0)) { iVar2 = gnutls_x509_crt_check_key_purpose(local_120,param_2,0); if (iVar2 == 0) { local_150 = -0x65; } } } if (-1 < local_150) { fprintf(stderr,"\tSignature status: ok\n"); } else { uVar3 = gnutls_strerror(local_150); fprintf(stderr,"\tSignature status: verification failed: %s\n",uVar3); } bVar1 = -1 >= local_150; local_148 = local_148 + 1; } while( true ); }
static int posix_edit_macros (count, key) int count, key; { int c; char alias_name[3], *alias_value, *macro; c = rl_read_key (); if (c <= 0) return 0; alias_name[0] = '_'; alias_name[1] = c; alias_name[2] = '\0'; alias_value = get_alias_value (alias_name); if (alias_value && *alias_value) { macro = (char *)strcpy (sh_xmalloc((1 + strlen (alias_value)), "bashline.c", 1055), (alias_value)); rl_push_macro_input (macro); } return 0; }
undefined8 posix_edit_macros(void) { int iVar1; char *pcVar2; size_t sVar3; char *__dest; long in_FS_OFFSET; undefined local_13; undefined local_12; undefined local_11; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); iVar1 = rl_read_key(); if (0 < iVar1) { local_13 = 0x5f; local_12 = (undefined)iVar1; local_11 = 0; pcVar2 = (char *)get_alias_value(&local_13); if ((pcVar2 != (char *)0x0) && (*pcVar2 != '\0')) { sVar3 = strlen(pcVar2); __dest = (char *)sh_xmalloc(sVar3 + 1,"bashline.c",0x41f); pcVar2 = strcpy(__dest,pcVar2); rl_push_macro_input(pcVar2); } } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return 0; } __stack_chk_fail(); }
static char * ssh_askpass(char *askpass, const char *msg, const char *env_hint) { pid_t pid, ret; size_t len; char *pass; int p[2], status; char buf[1024]; void (*osigchld)(int); if (fflush( stdout ) != 0) sshlog("readpass.c", __func__, 61, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "fflush: %s", strerror( (*__errno_location ()) )); if (askpass == ((void *)0) ) sshfatal("readpass.c", __func__, 63, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "internal error: askpass undefined"); if (pipe(p) == -1) { sshlog("readpass.c", __func__, 65, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "pipe: %s", strerror( (*__errno_location ()) )); return ((void *)0) ; } osigchld = ssh_signal( 17 , ((__sighandler_t) 0) ); if ((pid = fork()) == -1) { sshlog("readpass.c", __func__, 70, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "fork: %s", strerror( (*__errno_location ()) )); ssh_signal( 17 , osigchld); return ((void *)0) ; } if (pid == 0) { close(p[0]); if (dup2(p[1], 1 ) == -1) sshfatal("readpass.c", __func__, 77, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "dup2: %s", strerror( (*__errno_location ()) )); if (env_hint != ((void *)0) ) setenv("SSH_ASKPASS_PROMPT", env_hint, 1); execlp(askpass, askpass, msg, (char *) ((void *)0) ); sshfatal("readpass.c", __func__, 81, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "exec(%s): %s", askpass, strerror( (*__errno_location ()) )); } close(p[1]); len = 0; do { ssize_t r = read(p[0], buf + len, sizeof(buf) - 1 - len); if (r == -1 && (*__errno_location ()) == 4 ) continue; if (r <= 0) break; len += r; } while (sizeof(buf) - 1 - len > 0); buf[len] = '\0'; close(p[0]); while ((ret = waitpid(pid, &status, 0)) == -1) if ( (*__errno_location ()) != 4 ) break; ssh_signal( 17 , osigchld); if (ret == -1 || ! ((( status ) & 0x7f) == 0) || ((( status ) & 0xff00) >> 8) != 0) { explicit_bzero(buf, sizeof(buf)); return ((void *)0) ; } buf[strcspn(buf, "\r\n")] = '\0'; pass = xstrdup(buf); explicit_bzero(buf, sizeof(buf)); return pass; }
undefined8 ssh_askpass(char *param_1,undefined8 param_2,char *param_3) { int iVar1; int *piVar2; char *pcVar3; size_t sVar4; undefined8 uVar5; undefined *puVar6; char **ppcVar7; long in_FS_OFFSET; char *apcStack1216 [9]; undefined auStack1144 [8]; char *local_470; undefined8 local_468; char *local_460; uint local_44c; __pid_t local_448; __pid_t local_444; long local_440; undefined8 local_438; ssize_t local_430; undefined8 local_428; int local_420; int local_41c; char local_418 [1032]; long local_10; ppcVar7 = (char **)auStack1144; local_10 = *(long *)(in_FS_OFFSET + 0x28); apcStack1216[8] = (char *)0x100042; local_470 = param_3; local_468 = param_2; local_460 = param_1; iVar1 = fflush(stdout); if (iVar1 != 0) { apcStack1216[8] = (char *)0x10004b; piVar2 = __errno_location(); apcStack1216[8] = (char *)0x100054; apcStack1216[8] = strerror(*piVar2); apcStack1216[7] = "fflush: %s"; sshlog("readpass.c","ssh_askpass",0x3d,1,2,0); } if (local_460 == (char *)0x0) { ppcVar7 = apcStack1216 + 7; apcStack1216[7] = "internal error: askpass undefined"; sshfatal("readpass.c","ssh_askpass",0x3f,0,1,0); } *(undefined8 *)((long)ppcVar7 + -8) = 0x1000e2; iVar1 = pipe(&local_420); if (iVar1 == -1) { *(undefined8 *)((long)ppcVar7 + -8) = 0x1000ec; piVar2 = __errno_location(); iVar1 = *piVar2; *(undefined8 *)((long)ppcVar7 + -8) = 0x1000f5; pcVar3 = strerror(iVar1); *(char **)((long)ppcVar7 + -8) = pcVar3; *(char **)((long)ppcVar7 + -0x10) = "pipe: %s"; *(undefined8 *)((long)ppcVar7 + -0x18) = 0x10012c; sshlog("readpass.c","ssh_askpass",0x41,1,2,0); uVar5 = 0; } else { *(undefined8 *)((long)ppcVar7 + -8) = 0x100149; local_438 = ssh_signal(0x11,0); *(undefined8 *)((long)ppcVar7 + -8) = 0x100155; local_448 = fork(); if (local_448 == -1) { *(undefined8 *)((long)ppcVar7 + -8) = 0x100169; piVar2 = __errno_location(); iVar1 = *piVar2; *(undefined8 *)((long)ppcVar7 + -8) = 0x100172; pcVar3 = strerror(iVar1); *(char **)((long)ppcVar7 + -8) = pcVar3; *(char **)((long)ppcVar7 + -0x10) = "fork: %s"; *(undefined8 *)((long)ppcVar7 + -0x18) = 0x1001a9; sshlog("readpass.c","ssh_askpass",0x46,1,2,0); *(undefined8 *)((long)ppcVar7 + -8) = 0x1001c1; ssh_signal(0x11,local_438); uVar5 = 0; } else { if (local_448 == 0) { *(undefined8 *)((long)ppcVar7 + -8) = 0x1001e5; close(local_420); *(undefined8 *)((long)ppcVar7 + -8) = 0x1001f7; iVar1 = dup2(local_41c,1); puVar6 = (undefined *)ppcVar7; if (iVar1 == -1) { *(undefined8 *)((long)ppcVar7 + -8) = 0x100201; piVar2 = __errno_location(); iVar1 = *piVar2; *(undefined8 *)((long)ppcVar7 + -8) = 0x10020a; pcVar3 = strerror(iVar1); *(char **)((long)ppcVar7 + -8) = pcVar3; puVar6 = (undefined *)((long)ppcVar7 + -0x10); *(char **)((long)ppcVar7 + -0x10) = "dup2: %s"; *(undefined8 *)((long)ppcVar7 + -0x18) = 0x100241; sshfatal("readpass.c","ssh_askpass",0x4d,1,1,0); } if (local_470 != (char *)0x0) { *(undefined8 *)(puVar6 + -8) = 0x100266; setenv("SSH_ASKPASS_PROMPT",local_470,1); } *(undefined8 *)(puVar6 + -8) = 0x10028d; execlp(local_460,local_460,local_468,0); *(undefined8 *)(puVar6 + -8) = 0x100292; piVar2 = __errno_location(); iVar1 = *piVar2; *(undefined8 *)(puVar6 + -8) = 0x10029b; pcVar3 = strerror(iVar1); *(char **)(puVar6 + -0x10) = pcVar3; *(char **)(puVar6 + -0x18) = local_460; ppcVar7 = (char **)(puVar6 + -0x20); *(char **)(puVar6 + -0x20) = "exec(%s): %s"; *(undefined8 *)(puVar6 + -0x28) = 0x1002dc; sshfatal("readpass.c","ssh_askpass",0x51,1,1,0); } *(undefined8 *)((long)ppcVar7 + -8) = 0x1002e9; close(local_41c); local_440 = 0; do { *(undefined8 *)((long)ppcVar7 + -8) = 0x100324; local_430 = read(local_420,local_418 + local_440,0x3ff - local_440); if (local_430 == -1) { *(undefined8 *)((long)ppcVar7 + -8) = 0x10033a; piVar2 = __errno_location(); if (*piVar2 != 4) goto LAB_00100341; } else { LAB_00100341: if (local_430 < 1) break; local_440 = local_440 + local_430; } } while (local_440 != 0x3ff); local_418[local_440] = '\0'; *(undefined8 *)((long)ppcVar7 + -8) = 0x10038d; close(local_420); do { *(undefined8 *)((long)ppcVar7 + -8) = 0x1003b7; local_444 = waitpid(local_448,(int *)&local_44c,0); if (local_444 != -1) break; *(undefined8 *)((long)ppcVar7 + -8) = 0x100394; piVar2 = __errno_location(); } while (*piVar2 == 4); *(undefined8 *)((long)ppcVar7 + -8) = 0x1003dd; ssh_signal(0x11,local_438); if (((local_444 == -1) || ((local_44c & 0x7f) != 0)) || (((int)local_44c >> 8 & 0xffU) != 0)) { *(undefined8 *)((long)ppcVar7 + -8) = 0x100417; explicit_bzero(local_418,0x400); uVar5 = 0; } else { *(undefined8 *)((long)ppcVar7 + -8) = 0x100434; sVar4 = strcspn(local_418,"\r\n"); local_418[sVar4] = '\0'; *(undefined8 *)((long)ppcVar7 + -8) = 0x10044b; local_428 = xstrdup(local_418); *(undefined8 *)((long)ppcVar7 + -8) = 0x100466; explicit_bzero(local_418,0x400); uVar5 = local_428; } } } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return uVar5; } *(undefined8 *)((long)ppcVar7 + -8) = 0x100481; __stack_chk_fail(); }
static int mux_client_request_stdio_fwd(int fd) { struct sshbuf *m; char *e; u_int type, rid, sid; int r; sshlog("mux.c", __func__, 2096, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "entering"); if ((muxserver_pid = mux_client_request_alive(fd)) == 0) { sshlog("mux.c", __func__, 2099, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "master alive request failed"); return -1; } ssh_signal( 13 , ((__sighandler_t) 1) ); if (options.stdin_null && stdfd_devnull(1, 0, 0) == -1) sshfatal("mux.c", __func__, 2106, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "stdfd_devnull failed"); if ((m = sshbuf_new()) == ((void *)0) ) sshfatal("mux.c", __func__, 2109, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new"); if ((r = sshbuf_put_u32(m, 0x10000008)) != 0 || (r = sshbuf_put_u32(m, muxclient_request_id)) != 0 || (r = sshbuf_put_string(m, ((void *)0) , 0)) != 0 || (r = sshbuf_put_cstring(m, options.stdio_forward_host)) != 0 || (r = sshbuf_put_u32(m, options.stdio_forward_port)) != 0) sshfatal("mux.c", __func__, 2115, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "request"); if (mux_client_write_packet(fd, m) != 0) sshfatal("mux.c", __func__, 2118, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "write packet: %s", strerror( (*__errno_location ()) )); if (mm_send_fd(fd, 0 ) == -1 || mm_send_fd(fd, 1 ) == -1) sshfatal("mux.c", __func__, 2123, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "send fds failed"); if (pledge("stdio proc tty", ((void *)0) ) == -1) sshfatal("mux.c", __func__, 2126, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "pledge(): %s", strerror( (*__errno_location ()) )); platform_pledge_mux(); sshlog("mux.c", __func__, 2129, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "stdio forward request sent"); sshbuf_reset(m); if (mux_client_read_packet(fd, m) != 0) { sshlog("mux.c", __func__, 2135, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "read from master failed: %s", strerror( (*__errno_location ()) )); sshbuf_free(m); return -1; } if ((r = sshbuf_get_u32(m, &type)) != 0 || (r = sshbuf_get_u32(m, &rid)) != 0) sshfatal("mux.c", __func__, 2142, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); if (rid != muxclient_request_id) sshfatal("mux.c", __func__, 2144, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "out of sequence reply: my id %u theirs %u", muxclient_request_id, rid) ; switch (type) { case 0x80000006: if ((r = sshbuf_get_u32(m, &sid)) != 0) sshfatal("mux.c", __func__, 2149, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse session ID"); sshlog("mux.c", __func__, 2150, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "master session id: %u", sid); break; case 0x80000002: if ((r = sshbuf_get_cstring(m, &e, ((void *)0) )) != 0) sshfatal("mux.c", __func__, 2154, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse error message"); sshbuf_free(m); sshfatal("mux.c", __func__, 2156, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Master refused stdio forwarding request: %s", e); case 0x80000003: if ((r = sshbuf_get_cstring(m, &e, ((void *)0) )) != 0) sshfatal("mux.c", __func__, 2159, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse error message"); sshbuf_free(m); sshfatal("mux.c", __func__, 2161, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Stdio forwarding request failed: %s", e); default: sshbuf_free(m); sshlog("mux.c", __func__, 2164, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "unexpected response from master 0x%08x", type); return -1; } muxclient_request_id++; ssh_signal( 1 , control_client_sighandler); ssh_signal( 2 , control_client_sighandler); ssh_signal( 15 , control_client_sighandler); ssh_signal( 28 , control_client_sigrelay); sshbuf_reset(m); if (mux_client_read_packet(fd, m) != 0) { if ( (*__errno_location ()) == 32 || ( (*__errno_location ()) == 4 && muxclient_terminate != 0)) return 0; sshfatal("mux.c", __func__, 2182, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "mux_client_read_packet: %s", strerror( (*__errno_location ()) )); } sshfatal("mux.c", __func__, 2184, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "master returned unexpected message %u", type); }
void mux_client_request_stdio_fwd(unsigned long long a0) { char v0; char v1; unsigned int v2; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long v6; char v7; unsigned long long v9; unsigned long long v11; unsigned long long v12; unsigned long long v13; unsigned long long v14; unsigned long long v16; unsigned int v19; unsigned long long v20; unsigned long long v21; unsigned long long v22; void* v23; unsigned long long v24; sshlog("mux.c", "mux_client_request_stdio_fwd", 0x830, 0x1, 0x7, 0x0, "entering"); muxserver_pid = mux_client_request_alive(a0); if (!muxserver_pid) { sshlog("mux.c", "mux_client_request_stdio_fwd", 0x833, 0x1, 0x2, 0x0, "master alive request failed"); v9 = 4294967295; } else { ssh_signal(0xd, 0x1); if (*(5248004) && stdfd_devnull(0x1, 0x0, 0x0) == -1) sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x83a, 0x1, 0x1, 0x0, "stdfd_devnull failed"); v4 = sshbuf_new(a0, v11, v12, 0x1, v13, 0x0); if (!v4) { v5 = "sshbuf_new"; sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x83d, 0x1, 0x1, 0x0, *(&v7)); } v2 = sshbuf_put_u32(v4, 0x10000008); if (!v2) { v2 = sshbuf_put_u32(v4, muxclient_request_id); if (!v2) { v2 = sshbuf_put_string(v4, 0x0, 0x0); if (!v2) { v2 = sshbuf_put_cstring(v4, *(5247856), *(5247856)); if (!v2) v2 = sshbuf_put_u32(v4, *(5247864)); } } } if (v2 || v2 || v2 || v2 || v2) { v5 = "request"; sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x843, 0x1, 0x1, ssh_err(v2), *(&v7)); } if (mux_client_write_packet(a0, v4, v4, 0x1, v13, v14)) { v6 = strerror(*(__errno_location())); v5 = "write packet: %s"; sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x846, 0x1, 0x1, 0x0, *(&v7)); } v16 = mm_send_fd(a0, 0x0); if (v16 == -1 || mm_send_fd(a0, 0x1) == -1) { v5 = "send fds failed"; sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x84b, 0x1, 0x1, 0x0, *(&v7)); } if (pledge("stdio proc tty", 0x0) == -1) { v6 = strerror(*(__errno_location())); v5 = "pledge(): %s"; sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x84e, 0x1, 0x1, 0x0, *(&v7)); } platform_pledge_mux(); v5 = "stdio forward request sent"; sshlog("mux.c", "mux_client_request_stdio_fwd", 0x851, 0x1, 0x7, 0x0, *(&v7)); sshbuf_reset(v4); v19 = mux_client_read_packet(a0, v4, v4, 0x1, 0x7, 0x0); if (v19) { v6 = strerror(*(__errno_location())); v5 = "read from master failed: %s"; sshlog("mux.c", "mux_client_request_stdio_fwd", 0x857, 0x1, 0x2, 0x0, *(&v7)); sshbuf_free(v4); v20 = 4294967295; } else { v2 = sshbuf_get_u32(v4, &v0, &v0); if (!v2) v2 = sshbuf_get_u32(v4, &v1, &v1); if (v2 || v2) { v5 = "parse"; sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x85e, 0x1, 0x1, ssh_err(v2), *(&v7)); } if (*(&v1) != muxclient_request_id) { v5 = *(&v1); v4 = muxclient_request_id; v3 = "out of sequence reply: my id %u theirs %u"; sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x860, 0x1, 0x1, 0x0, *(&v7)); } v19 = *(&v0); if (*(&v0) != 2147483654) { if (v19 <= 2147483654) { if (v19 == 2147483650) { v2 = sshbuf_get_cstring(v4, &v3, 0x0, &v3); if (v2) { v5 = "parse error message"; sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x86a, 0x1, 0x1, ssh_err(v2), *(&v7)); } sshbuf_free(v4); v6 = v3; v5 = "Master refused stdio forwarding request: %s"; sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x86c, 0x0, 0x1, 0x0, *(&v7)); } if (v19 == 2147483651 || v19 == 2147483650) { v2 = sshbuf_get_cstring(v4, &v3, 0x0, &v3); if (v2) { v5 = "parse error message"; sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x86f, 0x1, 0x1, ssh_err(v2), *(&v7)); } sshbuf_free(v4); v6 = v3; v5 = "Stdio forwarding request failed: %s"; sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x871, 0x0, 0x1, 0x0, *(&v7)); } } sshbuf_free(v4); v6 = *(&v0); v5 = "unexpected response from master 0x%08x"; sshlog("mux.c", "mux_client_request_stdio_fwd", 0x874, 0x1, 0x2, 0x0, *(&v7)); v22 = 4294967295; } else { v2 = sshbuf_get_u32(v4, &v3, &v3); if (v2) { v5 = "parse session ID"; sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x865, 0x1, 0x1, ssh_err(v2), *(&v7)); } v6 = v3; v5 = "master session id: %u"; sshlog("mux.c", "mux_client_request_stdio_fwd", 0x866, 0x1, 0x5, 0x0, *(&v7)); muxclient_request_id = muxclient_request_id + 1; ssh_signal(0x1, control_client_sighandler); ssh_signal(0x2, control_client_sighandler); ssh_signal(0xf, control_client_sighandler); ssh_signal(0x1c, control_client_sigrelay); sshbuf_reset(v4); v21 = mux_client_read_packet(a0, v4, v4, 0x1, 0x5, 0x0); if (v21) { *(&v21) = *(__errno_location()); if (v21 != 32) *(&v21) = *(__errno_location()); } if (v21 == 32 || v21 == 4 && muxclient_terminate) v23 = 0; if ((!muxclient_terminate || v21 != 4) && (v21 == 4 || v21) && (v21 == 4 || v21 != 32)) { v6 = strerror(*(__errno_location())); v5 = "mux_client_read_packet: %s"; sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x886, 0x1, 0x1, 0x0, *(&v7)); } if (v21 != 32 || !muxclient_terminate) { v6 = *(&v0); v5 = "master returned unexpected message %u"; v24 = sshfatal("mux.c", "mux_client_request_stdio_fwd", 0x888, 0x1, 0x1, 0x0, *(&v7)); } } } } return; }
static int tnl_gen_ioctl(int cmd, const char *name, void *p, int skiperr) { struct ifreq ifr; int fd; int err; strlcpy(ifr.ifr_ifrn.ifrn_name, name, 16); ifr.ifr_ifru.ifru_data = p; fd = socket(preferred_family, SOCK_DGRAM , 0); if (fd < 0) { fprintf( stderr , "create socket failed: %s\n", strerror( (*__errno_location ()) )); return -1; } err = ioctl(fd, cmd, &ifr); if (err && (*__errno_location ()) != skiperr) fprintf( stderr , "%s: ioctl %x failed: %s\n", name, cmd, strerror( (*__errno_location ()) )); close(fd); return err; }
void tnl_gen_ioctl(unsigned long a0, unsigned long long a1, unsigned long a2, unsigned long a3) { unsigned int v0; unsigned int v1; char v2; unsigned long v3; unsigned long long v6; unsigned long long v7; strlcpy(&v2, a1, 0x10, a1); v3 = a2; v0 = socket(preferred_family, 0x2, 0x0); if (v0 < 0) { fprintf(*(&stderr), "create socket failed: %s\n", strerror(*(__errno_location()))); v6 = 4294967295; } else { v1 = ioctl(v0, a0); if (v1 && a3 != *(__errno_location())) fprintf(*(&stderr), "%s: ioctl %x failed: %s\n", a1, a0, strerror(*(__errno_location()))); close(v0); v7 = v1; } return; }
void _rl_clear_to_eol (int count) { if (_rl_term_clreol) tputs (_rl_term_clreol, 1, _rl_output_character_function); else if (count) space_to_eol (count); }
long long _rl_clear_to_eol(unsigned long a0) { unsigned long long v1; v1 = _rl_term_clreol; if (_rl_term_clreol) { v1 = tputs(_rl_term_clreol, 0x1, got._rl_output_character_function); } else if (a0) { v1 = space_to_eol(a0); } return v1; }
int bash_delete_history_range (first, last) int first, last; { register int i; HIST_ENTRY **discard_list; discard_list = remove_history_range (first, last); if (discard_list == 0) return 0; for (i = 0; discard_list[i]; i++) free_history_entry (discard_list[i]); sh_xfree((discard_list), "bashhist.c", 381); history_lines_this_session -= i; return 1; }
undefined8 bash_delete_history_range(undefined4 param_1,undefined4 param_2) { long lVar1; undefined8 uVar2; int iVar3; lVar1 = remove_history_range(param_1,param_2); if (lVar1 == 0) { uVar2 = 0; } else { iVar3 = 0; while (*(long *)(lVar1 + (long)iVar3 * 8) != 0) { free_history_entry(*(undefined8 *)(lVar1 + (long)iVar3 * 8)); iVar3 = iVar3 + 1; } sh_xfree(lVar1,"bashhist.c",0x17d); history_lines_this_session = history_lines_this_session - iVar3; uVar2 = 1; } return uVar2; }
static void print_af_spec(FILE *fp, struct rtattr *af_spec_attr) { struct rtattr *inet6_attr; struct rtattr *tb[(__IFLA_INET6_MAX - 1) + 1]; inet6_attr = (parse_rtattr_one( 10 , ((void*)(((char*)(af_spec_attr)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((af_spec_attr)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))))); if (!inet6_attr) return; (parse_rtattr_flags((tb), ((__IFLA_INET6_MAX - 1)), ((void*)(((char*)(inet6_attr)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((inet6_attr)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))); if (tb[IFLA_INET6_ADDR_GEN_MODE]) { __u8 mode = rta_getattr_u8(tb[IFLA_INET6_ADDR_GEN_MODE]); char b1[64]; switch (mode) { case IN6_ADDR_GEN_MODE_EUI64: print_string(PRINT_ANY, "inet6_addr_gen_mode", "addrgenmode %s ", "eui64"); break; case IN6_ADDR_GEN_MODE_NONE: print_string(PRINT_ANY, "inet6_addr_gen_mode", "addrgenmode %s ", "none"); break; case IN6_ADDR_GEN_MODE_STABLE_PRIVACY: print_string(PRINT_ANY, "inet6_addr_gen_mode", "addrgenmode %s ", "stable_secret"); break; case IN6_ADDR_GEN_MODE_RANDOM: print_string(PRINT_ANY, "inet6_addr_gen_mode", "addrgenmode %s ", "random"); break; default: snprintf(b1, sizeof(b1), "%#.2hhx", mode); print_string(PRINT_ANY, "inet6_addr_gen_mode", "addrgenmode %s ", b1); break; } } }
void print_af_spec(unsigned long a0, unsigned short *a1) { unsigned long v0; char v1; unsigned short *v2; char v3; char v4; char v5; char v6; unsigned long long *v8; unsigned long long v9; v0 = a0; v2 = parse_rtattr_one(0xa, a1 + 2, *(a1) - 4); if (v2) { parse_rtattr_flags(&v3, 0x9, v2 + 2, *(v2) - 4, 0x8000); if (*(&v4)) { v1 = rta_getattr_u8(*(&v4)); if (v1 == 3) { print_string(0x4, "inet6_addr_gen_mode", "addrgenmode %s ", "random"); } else { if (v1 <= 3) { if (v1 == 2) { print_string(0x4, "inet6_addr_gen_mode", "addrgenmode %s ", "stable_secret"); goto LABEL_4012f0; } else if (v1 <= 2) { if (!v1) { print_string(0x4, "inet6_addr_gen_mode", "addrgenmode %s ", "eui64"); goto LABEL_4012f0; } if (v1 == 1) { print_string(0x4, "inet6_addr_gen_mode", "addrgenmode %s ", "none"); goto LABEL_4012f0; } } } snprintf(&v5, 0x40, "%#.2hhx"); print_string(0x4, "inet6_addr_gen_mode", "addrgenmode %s ", &v5); } } } LABEL_4012f0: v9 = *(&v6) ^ v8[5]; return; }
int get_bits(gnutls_pk_algorithm_t key_type, int info_bits, const char *info_sec_param, int warn) { int bits; if (info_bits != 0) { static int warned = 0; if (warned == 0 && warn != 0 && (((unsigned int)(info_bits)) & 0x80000000)==0) { warned = 1; fprintf( stderr , "** Note: You may use '--sec-param %s' instead of '--bits %d'\n", bits_to_sp(key_type, info_bits), info_bits); } bits = info_bits; } else { if (info_sec_param == 0) { info_sec_param = "HIGH"; } bits = gnutls_sec_param_to_pk_bits(key_type, str_to_sec_param (info_sec_param)); } return bits; }
uint get_bits(undefined4 param_1,uint param_2,undefined *param_3,int param_4) { undefined4 uVar1; undefined8 uVar2; undefined *local_28; uint local_c; if (param_2 == 0) { local_28 = param_3; if (param_3 == (undefined *)0x0) { local_28 = &DAT_00104ba6; } uVar1 = str_to_sec_param(local_28); local_c = gnutls_sec_param_to_pk_bits(param_1,uVar1); } else { local_c = param_2; if (((warned_12578 == 0) && (param_4 != 0)) && (-1 < (int)param_2)) { warned_12578 = 1; uVar2 = bits_to_sp(param_1,param_2); fprintf(stderr,"** Note: You may use \'--sec-param %s\' instead of \'--bits %d\'\n",uVar2, (ulong)param_2); } } return local_c; }
int check_identifier (word, check_word) WORD_DESC *word; int check_word; { if (word->flags & ((1 << 0)|(1 << 1))) { internal_error (gettext("`%s': not a valid identifier"), word->word); return (0); } else if (check_word && (all_digits (word->word) || legal_identifier (word->word) == 0)) { internal_error (gettext("`%s': not a valid identifier"), word->word); return (0); } else return (1); }
long long check_identifier(struct_0 *a0, unsigned long a1) { unsigned long long v1; unsigned long long v2; unsigned long long v3; if ((a0->field_8 & 3)) { internal_error(gettext("`%s': not a valid identifier"), a0->field_0); v2 = 0; } else { if (a1) { v1 = all_digits(a0->field_0); if (!v1) v3 = legal_identifier(a0->field_0); if (!v3 || v1) { internal_error(gettext("`%s': not a valid identifier"), a0->field_0); v2 = 0; } } if (!a1 || !v1 && v3) v2 = 1; } return v2; }
int sshbuf_putfv(struct sshbuf *buf, const char *fmt, va_list ap) { va_list ap2; int r, len; u_char *p; __builtin_va_copy( ap2 , ap ) ; if ((len = vsnprintf( ((void *)0) , 0, fmt, ap2)) < 0) { r = -10; goto out; } if (len == 0) { r = 0; goto out; } __builtin_va_end( ap2 ) ; __builtin_va_copy( ap2 , ap ) ; if ((r = sshbuf_reserve(buf, (size_t)len + 1, &p)) < 0) goto out; if ((r = vsnprintf((char *)p, len + 1, fmt, ap2)) != len) { r = -1; goto out; } if ((r = sshbuf_consume_end(buf, 1)) != 0) goto out; r = 0; out: __builtin_va_end( ap2 ) ; return r; }
int sshbuf_putfv(unsigned long long a0, char *a1, unsigned long long a2[3]) { unsigned int v0; unsigned int v1; char v2; unsigned long v3; unsigned long v4; unsigned long v5; v3 = a2[0]; v4 = a2[1]; v5 = a2[2]; v1 = vsnprintf(NULL, 0x0, a1, &v3); if (v1 < 0) { v0 = -10; } else if (!v1) { v0 = 0; } else { v3 = a2[0]; v4 = a2[1]; v5 = a2[2]; v0 = sshbuf_reserve(a0, v1 + 1, &v2, v1 + 1); if (v0 >= 0) { v0 = vsnprintf(*(&v2), __addvsi3(v1, 0x1), a1, &v3); if (v0 != v1) { v0 = -1; } else { v0 = sshbuf_consume_end(a0, 0x1); if (!v0) v0 = 0; } } } return v0; }
char * indirection_level_string () { register int i, j; char *ps4; char ps4_firstc[ 16 +1]; int ps4_firstc_len, ps4_len, ineed, old; ps4 = get_string_value ("PS4"); if (indirection_string == 0) indirection_string = sh_xmalloc((indirection_stringsiz = 100), "print_cmd.c", 457); indirection_string[0] = '\0'; if (ps4 == 0 || *ps4 == '\0') return (indirection_string); old = change_flag ('x', '+'); ps4 = decode_prompt_string (ps4); if (old) change_flag ('x', '-'); if (ps4 == 0 || *ps4 == '\0') { do { if (ps4) sh_xfree((ps4), "print_cmd.c", 470); } while (0); return (indirection_string); } ps4_len = strnlen (ps4, (__ctype_get_mb_cur_max ()) ); ps4_firstc_len = (( (__ctype_get_mb_cur_max ()) > 1) ? mblen ((ps4), (ps4_len)) : 1); if (ps4_firstc_len == 1 || ps4_firstc_len == 0 || ps4_firstc_len < 0) { ps4_firstc[0] = ps4[0]; ps4_firstc[ps4_firstc_len = 1] = '\0'; } else memcpy (ps4_firstc, ps4, ps4_firstc_len); ineed = (ps4_firstc_len * indirection_level) + strlen (ps4); if (ineed > indirection_stringsiz - 1) { indirection_stringsiz = ineed + 1; indirection_string = sh_xrealloc((indirection_string), (indirection_stringsiz), "print_cmd.c", 495); } for (i = j = 0; ps4_firstc[0] && j < indirection_level && i < indirection_stringsiz - 1; i += ps4_firstc_len, j++) { if (ps4_firstc_len == 1) indirection_string[i] = ps4_firstc[0]; else memcpy (indirection_string+i, ps4_firstc, ps4_firstc_len); } for (j = ps4_firstc_len; *ps4 && ps4[j] && i < indirection_stringsiz - 1; i++, j++) indirection_string[i] = ps4[j]; indirection_string[i] = '\0'; sh_xfree((ps4), "print_cmd.c", 510); return (indirection_string); }
int indirection_level_string() { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; char *v4; char v5; unsigned int v7; unsigned int v8; void* v9; char *v10; v4 = get_string_value("PS4"); if (!indirection_string) { indirection_stringsiz = 100; indirection_string = sh_xmalloc(0x64, "print_cmd.c", 0x1c9); } *(indirection_string) = 0; if (!v4) { LABEL_40092e: v7 = indirection_string; } else { if (!*(v4)) goto LABEL_40092e; v1 = change_flag(0x78, 0x2b); v4 = decode_prompt_string(v4); if (v1) change_flag(0x78, 0x2d); if (!v4) { LABEL_400983: if (v4) sh_xfree(v4, "print_cmd.c", 0x1d6); v7 = indirection_string; } else { if (!*(v4)) goto LABEL_400983; v2 = strnlen(v4, __ctype_get_mb_cur_max()); if (__ctype_get_mb_cur_max() <= 1) v7 = 1; else v7 = mblen(v4, v2); v0 = v7; if (v0 == 1) { LABEL_400a04: v5 = *(v4); v0 = 1; (&v5)[v0] = 0; } else { if (!v0) goto LABEL_400a04; if (v0 < 0) goto LABEL_400a04; memcpy(&v5, v4, v0); } v3 = strlen(v4) + v0 * indirection_level; if (v3 >= indirection_stringsiz) { indirection_stringsiz = v3 + 1; indirection_string = sh_xrealloc(indirection_string, indirection_stringsiz, "print_cmd.c", 0x1ef); } v8 = 0; v9 = 0; while (true) { if (!v5) break; if (v8 >= indirection_level) break; if (v9 >= indirection_stringsiz - 1) break; if (v0 != 1) memcpy(indirection_string + v9, &v5, v0); else *(indirection_string + v9) = v5; v9 = v0 + v9; v8 += 1; } v10 = v0; while (true) { if (!*(v4)) break; if (!*((v4 + v10))) break; if (v9 >= indirection_stringsiz - 1) break; *(v9 + indirection_string) = *((v4 + v10)); v9 = v9 + 1; v10 = v10 + 1; } *(v9 + indirection_string) = 0; sh_xfree(v4, "print_cmd.c", 0x1fe); v7 = indirection_string; } } return v7; }
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, "unlink", "GNU coreutils", Version, 1 , usage, ("Michael Stone"), (char const *) ((void *)0) ); if (argc < optind + 1) { error (0, 0, gettext ("missing operand")); usage ( 1 ); } if (optind + 1 < argc) { error (0, 0, gettext ("extra operand %s"), quote (argv[optind + 1])); usage ( 1 ); } if (unlink (argv[optind]) != 0) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"cannot unlink %s\"), quotearg_style (shell_escape_always_quoting_style, argv[optind])), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , gettext ("cannot unlink %s"), quotearg_style (shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , gettext ("cannot unlink %s"), quotearg_style (shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); return 0 ; }
int main(unsigned long a0, unsigned long long *a1) { void* v0; unsigned long long v3; unsigned long long v4; set_program_name(*(a1)); setlocale(0x6, &g_400673); bindtextdomain("coreutils", "/usr/local/share/locale"); textdomain("coreutils"); atexit(got.close_stdout); v0 = 0; parse_gnu_standard_options_only(a0, a1, "unlink", "GNU coreutils", Version, 0x1, usage, "Michael Stone"); if (a0 <= optind) { error(0x0, 0x0, gettext("missing operand")); usage(0x1); } else if (a0 > optind + 1) { v3 = quote(a1[1 + optind]); error(0x0, 0x0, gettext("extra operand %s")); usage(0x1); } else if (unlink(a1[optind])) { v4 = quotearg_style(0x4, a1[optind], optind * 8); error(0x1, *(__errno_location()), gettext("cannot unlink %s")); } else { return 0; } }
static inline void emit_stdin_note (void) { fputs_unlocked (gettext ("\nWith no FILE, or when FILE is -, read standard input.\n"), stdout ) ; }
int emit_stdin_note() { FILE *v0; char *v1; v0 = stdout; v1 = gettext("\nWith no FILE, or when FILE is -, read standard input.\n"); return fputs_unlocked(v1, v0); }
static int ipstats_stat_desc_show_afstats_mpls(struct ipstats_stat_show_attrs *attrs, const struct ipstats_stat_desc *desc) { struct rtattr *mrtb[(__MPLS_STATS_MAX - 1)+1]; struct mpls_link_stats stats; const struct rtattr *at; int err; at = ipstats_stat_show_get_attr(attrs, IFLA_STATS_AF_SPEC, 28 , &err); if (at == ((void *)0) ) return err; (parse_rtattr_flags((mrtb), ((__MPLS_STATS_MAX - 1)), ((void*)(((char*)(at)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((at)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))); if (mrtb[MPLS_STATS_LINK] == ((void *)0) ) return - 2 ; do { const struct rtattr *__at = (mrtb[MPLS_STATS_LINK]); size_t __at_sz = __at->rta_len - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)); size_t __var_sz = sizeof(stats); typeof(stats) *__dest = &stats; memset(__dest, 0, __var_sz); memcpy(__dest, ((void*)(((char*)(__at)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((( __at_sz )<( __var_sz ))?( __at_sz ):( __var_sz )) ); } while (0); print_nl(); open_json_object("mpls_stats"); print_mpls_link_stats( stdout , &stats, " "); close_json_object(); return 0; }
long long ipstats_stat_desc_show_afstats_mpls(void* a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long a5) { unsigned long v0; char v1; unsigned short *v2; unsigned long long v3; unsigned long v4; unsigned long long v5; void* v6; char v7; char v8; char v9; unsigned long long v11; unsigned long long v12; v0 = a1; v2 = ipstats_stat_show_get_attr(a0, 0x5, 0x1c, &v1); if (!v2) { v11 = *(&v1); } else { parse_rtattr_flags(&v8, 0x1, v2 + 2, *(v2) - 4, 0x8000); if (!*(&v9)) { v11 = 4294967294; } else { v3 = *(&v9); v4 = *(v3) - 4; v5 = 72; v6 = &v7; memset(v6, 0x0, v5); v12 = v4; if (v5 <= v4) v12 = v5; memcpy(v12, v12 + 4, v12); print_nl(); open_json_object("mpls_stats"); print_mpls_link_stats(stdout, &v7, " ", &v7); close_json_object(a0, &v7, " ", &v7, 0x8000, a5); v11 = 0; } } return v11; }
void socket_bye(socket_st * socket, unsigned polite) { int ret; if (socket->secure && socket->session) { if (polite) { do ret = gnutls_bye(socket->session, GNUTLS_SHUT_WR); while (ret == -52 || ret == -28); if (socket->verbose && ret < 0) fprintf( stderr , "*** gnutls_bye() error: %s\n", gnutls_strerror(ret)); } } if (socket->session) { gnutls_deinit(socket->session); socket->session = ((void *)0) ; } freeaddrinfo(socket->addr_info); socket->addr_info = socket->ptr = ((void *)0) ; socket->connect_addrlen = 0; free(socket->ip); free(socket->hostname); free(socket->service); shutdown(socket->fd, SHUT_RDWR ); close(socket->fd); gnutls_free((void *) (socket->rdata.data)), socket->rdata.data= ((void *)0) ; socket->rdata.data = ((void *)0) ; if (socket->server_trace) fclose(socket->server_trace); if (socket->client_trace) fclose(socket->client_trace); socket->fd = -1; socket->secure = 0; }
void socket_bye(int *param_1,int param_2) { int iVar1; undefined8 uVar2; if (((param_1[4] != 0) && (*(long *)(param_1 + 2) != 0)) && (param_2 != 0)) { do { do { iVar1 = gnutls_bye(*(undefined8 *)(param_1 + 2),1); } while (iVar1 == -0x34); } while (iVar1 == -0x1c); if ((param_1[0x12] != 0) && (iVar1 < 0)) { uVar2 = gnutls_strerror(iVar1); fprintf(stderr,"*** gnutls_bye() error: %s\n",uVar2); } } if (*(long *)(param_1 + 2) != 0) { gnutls_deinit(*(undefined8 *)(param_1 + 2)); *(undefined8 *)(param_1 + 2) = 0; } freeaddrinfo(*(addrinfo **)(param_1 + 0x10)); *(undefined8 *)(param_1 + 0xe) = 0; *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(param_1 + 0xe); param_1[0x34] = 0; free(*(void **)(param_1 + 10)); free(*(void **)(param_1 + 6)); free(*(void **)(param_1 + 0xc)); shutdown(*param_1,2); close(*param_1); (*gnutls_free)(*(undefined8 *)(param_1 + 0x3a)); *(undefined8 *)(param_1 + 0x3a) = 0; *(undefined8 *)(param_1 + 0x3a) = 0; if (*(long *)(param_1 + 0x36) != 0) { fclose(*(FILE **)(param_1 + 0x36)); } if (*(long *)(param_1 + 0x38) != 0) { fclose(*(FILE **)(param_1 + 0x38)); } *param_1 = -1; param_1[4] = 0; return; }
struct predicate * get_new_pred_chk_op (const struct parser_table *entry, const char *arg) { struct predicate *new_pred; static const struct parser_table *entry_and = ((void *)0) ; if ( ((void *)0) == entry_and) entry_and = find_parser ("and"); ((void) sizeof (( entry_and != ((void *)0)) ? 1 : 0), __extension__ ({ if ( entry_and != ((void *)0)) ; else __assert_fail ( "entry_and != NULL" , "tree.c", 1528, __extension__ __PRETTY_FUNCTION__); })) ; if (last_pred) switch (last_pred->p_type) { case NO_TYPE: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"oops -- invalid default insertion of and!\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("oops -- invalid default insertion of and!")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("oops -- invalid default insertion of and!")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); break; case PRIMARY_TYPE: case CLOSE_PAREN: new_pred = get_new_pred_noarg (entry_and); new_pred->pred_func = pred_and; new_pred->p_name = "-a"; new_pred->p_type = BI_OP; new_pred->p_prec = AND_PREC; new_pred->need_stat = 0 ; new_pred->need_type = 0 ; new_pred->need_inum = 0 ; new_pred->arg_text = ((void *)0) ; new_pred->args.str = ((void *)0) ; new_pred->side_effects = 0 ; new_pred->no_default_print = 0 ; break; default: break; } new_pred = get_new_pred (entry); new_pred->arg_text = arg; new_pred->parser_entry = entry; return new_pred; }
long long get_new_pred_chk_op(unsigned int *a0, unsigned long a1) { unsigned long long v0[39]; if (!entry_and.6007) entry_and.6007 = find_parser("and"); if (!entry_and.6007) __assert_fail(); if (last_pred) { if (*((last_pred + 16)) != 5 && *((last_pred + 16)) <= 5 && !*((last_pred + 16))) error(0x1, 0x0, gettext("oops -- invalid default insertion of and!")); if ((*((last_pred + 16)) <= 5 || *((last_pred + 16)) == 5) && (*((last_pred + 16)) == 1 || *((last_pred + 16)) == 5) && (*((last_pred + 16)) == 5 || *((last_pred + 16)))) { v0 = get_new_pred_noarg(entry_and.6007); v0->field_0 = got.pred_and; v0->field_8 = "-a"; v0->field_10 = 3; v0->field_14 = 3; v0->field_1a = 0; v0->field_1b = 0; v0->field_1c = 0; v0->field_30 = 0; v0->field_38 = 0; v0->field_18 = 0; v0->field_19 = 0; } } if (!last_pred || *((last_pred + 16)) == 5 || *((last_pred + 16)) > 5 || *((last_pred + 16))) { v0[0] = get_new_pred(a0); v0->field_30 = a1; v0[38] = a0; return v0; } }
static inline int _rl_vi_advance_point (void) { int point; point = rl_point; if (rl_point < rl_end) { if ( (__ctype_get_mb_cur_max ()) == 1 || rl_byte_oriented) rl_point++; else { point = rl_point; rl_point = _rl_forward_char_internal (1); if (point == rl_point || rl_point > rl_end) rl_point = rl_end; } } return point; }
void _rl_vi_advance_point() { unsigned int v0; unsigned long long v2; v0 = rl_point; if (rl_point < rl_end) { if (__ctype_get_mb_cur_max() == 1 || rl_byte_oriented) { rl_point = rl_point + 1; } else { v0 = rl_point; rl_point = _rl_forward_char_internal(0x1); if (v0 == rl_point || rl_point > rl_end) rl_point = rl_end; } } v2 = v0; return; }
z_size_t gzfwrite(buf, size, nitems, file) voidpc buf; z_size_t size; z_size_t nitems; gzFile file; { z_size_t len; gz_statep state; if (file == ((void *)0) ) return 0; state = (gz_statep)file; if (state->mode != 31153 || state->err != 0) return 0; len = nitems * size; if (size && len / size != nitems) { gz_error(state, (-2), "request does not fit in a size_t"); return 0; } return len ? gz_write(state, buf, len) / size : 0; }
long long gzfwrite(void* a0, unsigned int a1, unsigned long a2, unsigned int a3[30]) { unsigned int v0; void* v2; if (!a3) { v2 = 0; return v2; } else if (a3[6] != 31153) { v2 = 0; return v2; } else if (a3[29]) { v2 = 0; return v2; } else { *(&v0) = a1 * a2; if (a1 && a2 != (0 CONCAT *(&v0)) /m a1) { gz_error(a3, 0xfffffffe, "request does not fit in a size_t"); v2 = 0; return v2; } v2 = (!*(&v0) ? (0 CONCAT gz_write(a3, a0, *(&v0))) /m a1 : 0); return v2; } }
static void wcomment (fp, i) FILE *fp; int i; { fputs ("\t\t", fp); }
void wcomment(void* a0, unsigned long a1) { unsigned long long v1; fputs("\t\t", a0); return; }
int dns_lookup(char *result, int size, int useip, int32_t *a) { struct sockaddr_in sin; struct sockaddr_in6 sin6; struct sockaddr *sa; int salen, flags; int mapped = 0; flags = useip ? 1 : 0; if (a[0] == 0 && a[1] == 0 && a[2] == (int32_t)htonl (0xffff)) mapped = 1; if (mapped || (a[1] == 0 && a[2] == 0 && a[3] == 0)) { sin.sin_family = 2 ; sin.sin_port = 0; sin.sin_addr.s_addr = mapped ? a[3] : a[0]; sa = (struct sockaddr *)&sin; salen = sizeof(sin); } else { memset(&sin6, 0, sizeof(sin6)); sin6.sin6_family = 10 ; sin6.sin6_port = 0; memcpy(sin6.sin6_addr. __in6_u.__u6_addr8 , a, 16); sa = (struct sockaddr *)&sin6; salen = sizeof(sin6); } return getnameinfo(sa, salen, result, size, ((void *)0) , 0, flags); }
int dns_lookup(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned int a3[4]) { unsigned long v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned long long v4; unsigned short v5; unsigned short v6; unsigned int v7; unsigned short v8; unsigned short v9; char v10; unsigned long long v11; unsigned long long v13; unsigned long long v14; unsigned long long v15; v11 = v13; v2 = 0; v3 = a2; if (!a3[0] && !a3[1]) { v14 = htonl(0xffff); if (a3[2] == v14) v2 = 1; } if (!v2 && (a3[3] || a3[1] || a3[2])) { memset(&v8, 0x0, 0x1c); v8 = 10; v9 = 0; memcpy(&v10, a3, 0x10); v4 = &v8; v1 = 28; } if (v2 || !a3[3] && !a3[1] && !a3[2]) { v5 = 2; v6 = 0; if (v2) *(&v14) = a3[3]; else *(&v14) = a3[0]; v7 = v14; v4 = &v5; v1 = 16; } v0 = v3; v15 = v11; return getnameinfo(v4, v1, a0, a1, 0x0, 0x0); }
em_gosmacs_transpose(EditLine *el, wint_t c) { if (el->el_line.cursor > &el->el_line.buffer[1]) { c = el->el_line.cursor[-2]; el->el_line.cursor[-2] = el->el_line.cursor[-1]; el->el_line.cursor[-1] = c; return 4; } else return 6; }
long em_gosmacs_transpose(long a1) { int v2; if ( *(_QWORD *)(a1 + 88) <= (unsigned long)(*(_QWORD *)(a1 + 80) + 4LL) ) return 6LL; v2 = *(_DWORD *)(*(_QWORD *)(a1 + 88) - 8LL); *(_DWORD *)(*(_QWORD *)(a1 + 88) - 8LL) = *(_DWORD *)(*(_QWORD *)(a1 + 88) - 4LL); *(_DWORD *)(*(_QWORD *)(a1 + 88) - 4LL) = v2; return 4LL; }