input
stringlengths
28
169k
output
stringlengths
20
317k
static int generate_create_conf(const char *tpasswd_conf) { FILE *fp; char line[5 * 1024]; int index = 1, srp_idx; gnutls_datum_t g, n; gnutls_datum_t str_g, str_n; fp = fopen(tpasswd_conf, "w"); if (fp == ((void *)0) ) { fprintf( stderr , "Cannot open file '%s'\n", tpasswd_conf); return -1; } for (index = 1; index <= 5; index++) { if (index == 1) { srp_idx = 2; n = gnutls_srp_1536_group_prime; g = gnutls_srp_1536_group_generator; } else if (index == 2) { srp_idx = 3; n = gnutls_srp_2048_group_prime; g = gnutls_srp_2048_group_generator; } else if (index == 3) { srp_idx = 4; n = gnutls_srp_3072_group_prime; g = gnutls_srp_3072_group_generator; } else if (index == 4) { srp_idx = 5; n = gnutls_srp_4096_group_prime; g = gnutls_srp_4096_group_generator; } else if (index == 5) { srp_idx = 7; n = gnutls_srp_8192_group_prime; g = gnutls_srp_8192_group_generator; } else { fprintf( stderr , "Unknown index: %d\n", index); fclose(fp); return -1; } printf("\nGroup %d, of %d bits:\n", srp_idx, n.size * 8); print_num("Generator", &g); print_num("Prime", &n); if (gnutls_srp_base64_encode2(&n, &str_n) < 0) { fprintf( stderr , "Could not encode\n"); fclose(fp); return -1; } if (gnutls_srp_base64_encode2(&g, &str_g) < 0) { fprintf( stderr , "Could not encode\n"); fclose(fp); return -1; } sprintf(line, "%d:%s:%s\n", srp_idx, str_n.data, str_g.data); gnutls_free((void *) (str_n.data)), str_n.data= ((void *)0) ; gnutls_free((void *) (str_g.data)), str_g.data= ((void *)0) ; fwrite(line, 1, strlen(line), fp); } fclose(fp); return 0; }
void generate_create_conf(char *a0) { unsigned int v0; unsigned int v1; void* v2; unsigned long v3; unsigned long v4; unsigned long v5; unsigned long v6; void* v7; char v8; char v9; unsigned long long v10; unsigned long long v12; void* v13; unsigned long long v14; unsigned long long v15; unsigned long long v16; v10 = *(&v10); v0 = 1; v2 = fopen(a0, "w"); if (!v2) { fprintf(*(&stderr), "Cannot open file '%s'\n", a0); v12 = 4294967295; return; } v0 = 1; while (true) { if (v0 <= 5) { switch (v0) { case 1: v1 = 2; v5 = gnutls_srp_1536_group_prime; v6 = gnutls_srp_1536_group_generator; v3 = gnutls_srp_1536_group_generator; v4 = *(&gnutls_srp_2048_group_prime); break; case 2: v1 = 3; v5 = *(&gnutls_srp_2048_group_prime); v6 = gnutls_srp_2048_group_generator; v3 = gnutls_srp_2048_group_generator; v4 = *(&gnutls_srp_3072_group_prime); break; case 3: v1 = 4; v5 = *(&gnutls_srp_3072_group_prime); v6 = gnutls_srp_3072_group_generator; v3 = gnutls_srp_3072_group_generator; v4 = *(&gnutls_srp_4096_group_prime); break; case 4: v1 = 5; v5 = *(&gnutls_srp_4096_group_prime); v6 = gnutls_srp_4096_group_generator; v3 = gnutls_srp_4096_group_generator; v4 = *(&gnutls_srp_8192_group_prime); break; case 5: v1 = 7; v5 = *(&gnutls_srp_8192_group_prime); v6 = gnutls_srp_8192_group_generator; v3 = gnutls_srp_8192_group_generator; v4 = fclose; break; default: fprintf(*(&stderr), "Unknown index: %d\n", v0); fclose(v2); v14 = 4294967295; return; } printf("\nGroup %d, of %d bits:\n", v1, (v6 * 8)); print_num("Generator", &v3); print_num("Prime", &v5); if (gnutls_srp_base64_encode2(&v5, &v8, &v8) < 0) { fprintf(*(&stderr), "Could not encode\n"); fclose(v2); v15 = 4294967295; return; } else if (gnutls_srp_base64_encode2(&v3, &v7, &v7) >= 0) { sprintf(&v9, "%d:%s:%s\n", v1, v8, *(&v7)); *(5243016)(v8); v8 = 0; *(5243016)(*(&v7)); v7 = 0; fwrite(&v9, 0x1, strlen(&v9), v2); v0 += 1; } else { fprintf(*(&stderr), "Could not encode\n"); fclose(v2); v16 = 4294967295; return; } } else { fclose(v2); v13 = 0; return; } } }
static int extract_file (char *file_name, int typeflag) { int fd; off_t size; union block *data_block; int status; size_t count; size_t written; _Bool interdir_made = 0 ; mode_t mode = (current_stat_info.stat.st_mode & ( 0100 | (0100 >> 3) | ((0100 >> 3) >> 3) | ( 0200 | (0200 >> 3) | ((0200 >> 3) >> 3) | ( 0400 | (0400 >> 3) | ((0400 >> 3) >> 3) ))) & ~ (0 < same_owner_option ? ((0400|0200|0100) >> 3) | (((0400|0200|0100) >> 3) >> 3) : 0)); mode_t invert_permissions = 0 < same_owner_option ? mode & ( ((0400|0200|0100) >> 3) | (((0400|0200|0100) >> 3) >> 3) ) : 0; mode_t current_mode = 0; mode_t current_mode_mask = 0; if (to_stdout_option) fd = 1 ; else if (to_command_option) { fd = sys_exec_command (file_name, 'f', &current_stat_info); if (fd < 0) { skip_member (); return 0; } } else { int file_created = 0; if (set_xattr (file_name, &current_stat_info, invert_permissions, typeflag, &file_created)) return 1; while ((fd = open_output_file (file_name, typeflag, mode, file_created, &current_mode, &current_mode_mask)) < 0) { int recover = maybe_recoverable (file_name, 1 , &interdir_made); if (recover != 1) { skip_member (); if (recover == 2) return 0; open_error (file_name); return 1; } } } mv_begin_read (&current_stat_info); if (current_stat_info.is_sparse) sparse_extract_file (fd, &current_stat_info, &size); else for (size = current_stat_info.stat.st_size; size > 0; ) { mv_size_left (size); data_block = find_next_block (); if (! data_block) { do { if (error_hook) error_hook (); error (0, 0, gettext ("Unexpected EOF in archive")); exit_status = 2; } while (0); break; } written = available_space_after (data_block); if (written > size) written = size; (*__errno_location ()) = 0; count = blocking_write (fd, data_block->buffer, written); size -= written; set_next_block_after ((union block *) (data_block->buffer + written - 1)); if (count != written) { if (!to_command_option) write_error_details (file_name, count, written); break; } } skip_file (size); mv_end (); if (to_stdout_option) return 0; if (! to_command_option) set_stat (file_name, &current_stat_info, fd, current_mode, current_mode_mask, typeflag, 0 , (old_files_option == OVERWRITE_OLD_FILES ? 0 : 0x100 )); status = close (fd); if (status < 0) close_error (file_name); if (to_command_option) sys_wait_command (); return status; }
int extract_file(undefined8 param_1,undefined4 param_2) { uint uVar1; int iVar2; int *piVar3; undefined8 uVar4; long in_FS_OFFSET; undefined local_4d; undefined4 local_4c; undefined4 local_48; int local_44; uint local_40; uint local_3c; int local_38; int local_34; ulong local_30; ulong local_28; long local_20; ulong local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_4d = 0; if (same_owner_option < 1) { uVar1 = 0xffffffff; } else { uVar1 = 0xffffffc0; } local_40 = uVar1 & _remove_any_file & 0x1ff; if (same_owner_option < 1) { local_3c = 0; } else { local_3c = uVar1 & _remove_any_file & 0x3f; } local_4c = 0; local_48 = 0; if (to_stdout_option == '\0') { if (to_command_option == 0) { local_30 = local_30 & 0xffffffff00000000; iVar2 = set_xattr(param_1,&current_stat_info,local_3c,(int)(char)param_2,&local_30); if (iVar2 == 0) { do { local_44 = open_output_file(param_1,param_2,local_40,local_30 & 0xffffffff,&local_4c, &local_48); if (-1 < local_44) goto LAB_00102764; local_38 = maybe_recoverable(param_1,1,&local_4d); } while (local_38 == 1); skip_member(); if (local_38 == 2) { iVar2 = 0; } else { open_error(param_1); iVar2 = 1; } } else { iVar2 = 1; } goto LAB_0010295e; } local_44 = sys_exec_command(param_1,0x66,&current_stat_info); if (local_44 < 0) { skip_member(); iVar2 = 0; goto LAB_0010295e; } } else { local_44 = 1; } LAB_00102764: mv_begin_read(&current_stat_info); if (blocking_write == (code)0x0) { local_30 = _skip_member; do { if ((long)local_30 < 1) goto LAB_001028b0; mv_size_left(local_30); local_20 = find_next_block(); if (local_20 == 0) { if (error_hook != (code *)0x0) { (*error_hook)(); } uVar4 = gettext("Unexpected EOF in archive"); error(0,0,uVar4); _exit_status = 2; goto LAB_001028b0; } local_28 = available_space_after(local_20); if (local_30 < local_28) { local_28 = local_30; } piVar3 = __errno_location(); *piVar3 = 0; local_18 = blocking_write(local_44,local_20,local_28); local_30 = local_30 - local_28; set_next_block_after(local_20 + (local_28 - 1)); } while (local_18 == local_28); if (to_command_option == 0) { write_error_details(param_1,local_18,local_28); } } else { sparse_extract_file(local_44,&current_stat_info,&local_30); } LAB_001028b0: skip_file(); mv_end(); if (to_stdout_option == '\0') { if (to_command_option == 0) { if (old_files_option == 2) { uVar4 = 0; } else { uVar4 = 0x100; } set_stat(param_1,&current_stat_info,local_44,local_4c,local_48,(int)(char)param_2,0,uVar4); } local_34 = close(local_44); if (local_34 < 0) { close_error(param_1); } iVar2 = local_34; if (to_command_option != 0) { sys_wait_command(); iVar2 = local_34; } } else { iVar2 = 0; } LAB_0010295e: if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return iVar2; } __stack_chk_fail(); }
static void new_sgent (struct sgrp *sgent) { explicit_bzero((sgent), (sizeof *sgent)); sgent->sg_name = group_name; if (pflg) { sgent->sg_passwd = group_passwd; } else { sgent->sg_passwd = "!"; } sgent->sg_adm = &empty_list; sgent->sg_mem = &empty_list; }
long long new_sgent(unsigned long long a0[4]) { explicit_bzero(a0, 0x20); a0[0] = group_name; if (pflg) a0[1] = group_passwd; else a0[1] = "!"; a0[2] = &empty_list; a0[3] = &empty_list; return a0; }
void save_bash_argv () { WORD_LIST *list; list = list_rest_of_args (); push_args (list); dispose_words (list); }
void save_bash_argv() { unsigned long long v0; unsigned long long v2; v0 = list_rest_of_args(); push_args(v0); v2 = dispose_words(v0); return; }
static void add_field (int file, size_t field) { struct outlist *o; ((void) sizeof (( file == 0 || file == 1 || file == 2 ) ? 1 : 0), __extension__ ({ if ( file == 0 || file == 1 || file == 2 ) ; else __assert_fail ( "file == 0 || file == 1 || file == 2" , "src/join.c", 823, __extension__ __PRETTY_FUNCTION__); })) ; ((void) sizeof (( file != 0 || field == 0 ) ? 1 : 0), __extension__ ({ if ( file != 0 || field == 0 ) ; else __assert_fail ( "file != 0 || field == 0" , "src/join.c", 824, __extension__ __PRETTY_FUNCTION__); })) ; o = xmalloc (sizeof *o); o->file = file; o->field = field; o->next = ((void *)0) ; outlist_end->next = o; outlist_end = o; }
void add_field(int param_1,long param_2) { int *piVar1; if (((param_1 != 0) && (param_1 != 1)) && (param_1 != 2)) { __assert_fail("file == 0 || file == 1 || file == 2","src/join.c",0x337,"add_field"); } if ((param_1 == 0) && (param_2 != 0)) { __assert_fail("file != 0 || field == 0","src/join.c",0x338,"add_field"); } piVar1 = (int *)xmalloc(0x18); *piVar1 = param_1; *(long *)(piVar1 + 2) = param_2; *(undefined8 *)(piVar1 + 4) = 0; *(int **)(outlist_end + 0x10) = piVar1; outlist_end = (undefined *)piVar1; return; }
void print_arith_command (arith_cmd_list) WORD_LIST *arith_cmd_list; { cprintf ("(("); command_print_word_list (arith_cmd_list, " "); cprintf ("))"); }
void print_arith_command(undefined8 param_1) { cprintf(&DAT_00103750); command_print_word_list(param_1,&DAT_00103591); cprintf(&DAT_001036e3); return; }
int main (int argc, char *argv[]) { size_t i; if (argc < 2) { fprintf( stderr , "Usage: fstab-decode command [arguments]\n"); return 1 ; } for (i = 2; i < (size_t)argc; i++) decode(argv[i]); execvp(argv[1], argv + 1); fprintf( stderr , "fstab-decode: %s: %s\n", argv[1], strerror( (*__errno_location ()) )); return 127; }
int main(int argc, const char **argv, const char **envp) { int *v4; char *v5; unsigned long i; if ( argc > 1 ) { for ( i = 2LL; i < argc; ++i ) decode(argv[i]); execvp(argv[1], (char *const *)argv + 1); v4 = _errno_location(); v5 = strerror(*v4); fprintf(stderr, "fstab-decode: %s: %s\n", argv[1], v5); return 127; } else { fprintf(stderr, "Usage: fstab-decode command [arguments]\n"); return 1; } }
void initialize_options(Options * options) { memset(options, 'X', sizeof(*options)); options->forward_agent = -1; options->forward_agent_sock_path = ((void *)0) ; options->forward_x11 = -1; options->forward_x11_trusted = -1; options->forward_x11_timeout = -1; options->stdio_forward_host = ((void *)0) ; options->stdio_forward_port = 0; options->clear_forwardings = -1; options->exit_on_forward_failure = -1; options->xauth_location = ((void *)0) ; options->fwd_opts.gateway_ports = -1; options->fwd_opts.streamlocal_bind_mask = (mode_t)-1; options->fwd_opts.streamlocal_bind_unlink = -1; options->pubkey_authentication = -1; options->gss_authentication = -1; options->gss_deleg_creds = -1; options->password_authentication = -1; options->kbd_interactive_authentication = -1; options->kbd_interactive_devices = ((void *)0) ; options->hostbased_authentication = -1; options->batch_mode = -1; options->check_host_ip = -1; options->strict_host_key_checking = -1; options->compression = -1; options->tcp_keep_alive = -1; options->port = -1; options->address_family = -1; options->connection_attempts = -1; options->connection_timeout = -1; options->number_of_password_prompts = -1; options->ciphers = ((void *)0) ; options->macs = ((void *)0) ; options->kex_algorithms = ((void *)0) ; options->hostkeyalgorithms = ((void *)0) ; options->ca_sign_algorithms = ((void *)0) ; options->num_identity_files = 0; memset(options->identity_keys, 0, sizeof(options->identity_keys)); options->num_certificate_files = 0; memset(options->certificates, 0, sizeof(options->certificates)); options->hostname = ((void *)0) ; options->host_key_alias = ((void *)0) ; options->proxy_command = ((void *)0) ; options->jump_user = ((void *)0) ; options->jump_host = ((void *)0) ; options->jump_port = -1; options->jump_extra = ((void *)0) ; options->user = ((void *)0) ; options->escape_char = -1; options->num_system_hostfiles = 0; options->num_user_hostfiles = 0; options->local_forwards = ((void *)0) ; options->num_local_forwards = 0; options->remote_forwards = ((void *)0) ; options->num_remote_forwards = 0; options->permitted_remote_opens = ((void *)0) ; options->num_permitted_remote_opens = 0; options->log_facility = SYSLOG_FACILITY_NOT_SET; options->log_level = SYSLOG_LEVEL_NOT_SET; options->num_log_verbose = 0; options->log_verbose = ((void *)0) ; options->preferred_authentications = ((void *)0) ; options->bind_address = ((void *)0) ; options->bind_interface = ((void *)0) ; options->pkcs11_provider = ((void *)0) ; options->sk_provider = ((void *)0) ; options->enable_ssh_keysign = - 1; options->no_host_authentication_for_localhost = - 1; options->identities_only = - 1; options->rekey_limit = - 1; options->rekey_interval = -1; options->verify_host_key_dns = -1; options->server_alive_interval = -1; options->server_alive_count_max = -1; options->send_env = ((void *)0) ; options->num_send_env = 0; options->setenv = ((void *)0) ; options->num_setenv = 0; options->control_path = ((void *)0) ; options->control_master = -1; options->control_persist = -1; options->control_persist_timeout = 0; options->hash_known_hosts = -1; options->tun_open = -1; options->tun_local = -1; options->tun_remote = -1; options->local_command = ((void *)0) ; options->permit_local_command = -1; options->remote_command = ((void *)0) ; options->add_keys_to_agent = -1; options->add_keys_to_agent_lifespan = -1; options->identity_agent = ((void *)0) ; options->visual_host_key = -1; options->ip_qos_interactive = -1; options->ip_qos_bulk = -1; options->request_tty = -1; options->session_type = -1; options->stdin_null = -1; options->fork_after_authentication = -1; options->proxy_use_fdpass = -1; options->ignored_unknown = ((void *)0) ; options->num_canonical_domains = 0; options->num_permitted_cnames = 0; options->canonicalize_max_dots = -1; options->canonicalize_fallback_local = -1; options->canonicalize_hostname = -1; options->revoked_host_keys = ((void *)0) ; options->fingerprint_hash = -1; options->update_hostkeys = -1; options->hostbased_accepted_algos = ((void *)0) ; options->pubkey_accepted_algos = ((void *)0) ; options->known_hosts_command = ((void *)0) ; options->required_rsa_size = -1; }
long long initialize_options(struct_0 *a0) { memset(a0, 0x58, 0x1728); a0->field_0 = -1; a0->field_8 = 0; a0->field_10 = -1; a0->field_18 = -1; a0->field_14 = -1; a0->field_1318 = 0; a0->field_1320 = 0; a0->field_1300 = -1; a0->field_1c = -1; a0->field_20 = 0; a0->field_28 = -1; a0->field_2c = -1; a0->field_30 = -1; a0->field_34 = -1; a0->field_3c = -1; a0->field_40 = -1; a0->field_44 = -1; a0->field_48 = -1; a0->field_50 = 0; a0->field_38 = -1; a0->field_58 = -1; a0->field_5c = -1; a0->field_60 = -1; a0->field_64 = -1; a0->field_68 = -1; a0->field_88 = -1; a0->field_8c = -1; a0->field_90 = -1; a0->field_94 = -1; a0->field_98 = -1; a0->field_a0 = 0; a0->field_a8 = 0; a0->field_b8 = 0; a0->field_b0 = 0; a0->field_c0 = 0; a0->field_324 = 0; memset(&a0->padding_328[1200], 0x0, 0x320); a0->field_af8 = 0; memset(&a0->padding_afc[1204], 0x0, 0x320); a0->field_c8 = 0; a0->field_d0 = 0; a0->field_d8 = 0; a0->field_16f0 = 0; a0->field_16f8 = 0; a0->field_1700 = -1; a0->field_1708 = 0; a0->field_e0 = 0; a0->field_e8 = -1; a0->field_ec = 0; a0->field_1f0 = 0; a0->field_12e8 = 0; a0->field_12e0 = 0; a0->field_12f8 = 0; a0->field_12f0 = 0; a0->field_1308 = 0; a0->field_1310 = 0; a0->field_74 = -1; a0->field_78 = -1; a0->field_7c = 0; a0->field_80 = 0; a0->field_2f8 = 0; a0->field_300 = 0; a0->field_308 = 0; a0->field_310 = 0; a0->field_318 = 0; a0->field_1324 = -1; a0->field_1334 = -1; a0->field_1338 = -1; a0->field_1328 = -1; a0->field_1330 = -1; a0->field_320 = -1; a0->field_133c = -1; a0->field_1340 = -1; a0->field_1348 = 0; a0->field_1344 = 0; a0->field_1358 = 0; a0->field_1350 = 0; a0->field_1360 = 0; a0->field_1368 = -1; a0->field_136c = -1; a0->field_1370 = 0; a0->field_1374 = -1; a0->field_1378 = -1; a0->field_137c = -1; a0->field_1380 = -1; a0->field_1388 = 0; a0->field_1390 = -1; a0->field_1398 = 0; a0->field_12d0 = -1; a0->field_12d4 = -1; a0->field_12d8 = 0; a0->field_13a0 = -1; a0->field_6c = -1; a0->field_70 = -1; a0->field_13a4 = -1; a0->field_13a8 = -1; a0->field_13ac = -1; a0->field_13b0 = -1; a0->field_13b4 = -1; a0->field_1720 = 0; a0->field_13b8 = 0; a0->field_14cc = 0; a0->field_14c4 = -1; a0->field_14c8 = -1; a0->field_14c0 = -1; a0->field_16d0 = 0; a0->field_16d8 = -1; a0->field_16dc = -1; a0->field_16e0 = 0; a0->field_16e8 = 0; a0->field_1710 = 0; a0->field_1718 = -1; return a0; }
WORD_LIST * copy_word_list (list) WORD_LIST *list; { WORD_LIST *new_list, *tl; for (new_list = tl = (WORD_LIST *) ((void *)0) ; list; list = list->next) { if (new_list == 0) new_list = tl = make_word_list (copy_word (list->word), new_list); else { tl->next = make_word_list (copy_word (list->word), (WORD_LIST *) ((void *)0) ); tl = tl->next; } } return (new_list); }
undefined8 * copy_word_list(undefined8 *param_1) { undefined8 uVar1; undefined8 *local_20; undefined8 *local_18; undefined8 *local_10; local_10 = (undefined8 *)0x0; local_18 = (undefined8 *)0x0; for (local_20 = param_1; local_20 != (undefined8 *)0x0; local_20 = (undefined8 *)*local_20) { if (local_18 == (undefined8 *)0x0) { uVar1 = copy_word(local_20[1]); local_18 = (undefined8 *)make_word_list(uVar1,0); local_10 = local_18; } else { uVar1 = copy_word(local_20[1]); uVar1 = make_word_list(uVar1,0); *local_10 = uVar1; local_10 = (undefined8 *)*local_10; } } return local_18; }
static void print_numbers (char const *fmt, struct layout layout, long double first, long double step, long double last) { _Bool out_of_range = (step < 0 ? first < last : last < first); if (! out_of_range) { long double x = first; long double i; for (i = 1; ; i++) { long double x0 = x; if (printf (fmt, x) < 0) io_error (); if (out_of_range) break; x = first + i * step; out_of_range = (step < 0 ? x < last : last < x); if (out_of_range) { _Bool print_extra_number = 0 ; long double x_val; char *x_str; int x_strlen; if (locale_ok) setlocale ( 1 , "C"); x_strlen = asprintf (&x_str, fmt, x); if (locale_ok) setlocale ( 1 , ""); if (x_strlen < 0) xalloc_die (); x_str[x_strlen - layout.suffix_len] = '\0'; if (xstrtold (x_str + layout.prefix_len, ((void *)0) , &x_val, cl_strtold) && x_val == last) { char *x0_str = ((void *)0) ; int x0_strlen = asprintf (&x0_str, fmt, x0); if (x0_strlen < 0) xalloc_die (); x0_str[x0_strlen - layout.suffix_len] = '\0'; print_extra_number = !(strcmp (x0_str, x_str) == 0); free (x0_str); } free (x_str); if (! print_extra_number) break; } if (fputs_unlocked (separator, stdout ) == (-1) ) io_error (); } if (fputs_unlocked (terminator, stdout ) == (-1) ) io_error (); } }
void print_numbers(char *a0, unsigned long a1, unsigned long a2) { unsigned long long v0; unsigned long long v1; char v2; char v3; unsigned int v4; unsigned int v5; char v6; void* v7; char v8; char v9; char v10; char v11; char v12; char v13; unsigned int v15; unsigned int v16; unsigned int v17; unsigned int v18; unsigned int v20; unsigned int v21; unsigned int v22; unsigned int v23; unsigned int v24; unsigned int v25; unsigned int v26; unsigned int v27; unsigned int v28; unsigned int v29; unsigned int v30; char v31; unsigned int v32; unsigned int v33; unsigned int v34; unsigned int v35; unsigned int v36; unsigned int v37; unsigned int v38; unsigned int v39; unsigned long long v40; unsigned int v41; unsigned int v42; unsigned int v43; unsigned int v44; unsigned int v45; unsigned int v47; unsigned int v48; unsigned int v49; unsigned int v50; unsigned int v51; unsigned int v52; unsigned int v53; unsigned int v54; unsigned int v55; unsigned int v56; unsigned int v57; unsigned int v58; unsigned int v59; unsigned int v60; unsigned int v61; unsigned int v62; unsigned long long v63; unsigned int v64; unsigned int v65; unsigned int v66; unsigned int v67; unsigned int v68; unsigned int v69; unsigned int v70; unsigned int v71; unsigned int v72; unsigned int v74; unsigned int v75; unsigned int v76; unsigned int v78; unsigned long long v79; unsigned long long *v80; unsigned long long v81; [D] t14 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t44) v16 = v15 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v17 = v16 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v17 = v16 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } v18 = v17 - 1; [D] PutI(904:F64x8)[t0,0] = t3 [D] PutI(968:I8x8)[t0,0] = 0x01 [D] PutI(968:I8x8)[t16,0] = 0x00 [D] PutI(904:F64x8)[t30,0] = t31 [D] PutI(968:I8x8)[t30,0] = 0x01 [D] PutI(968:I8x8)[t30,0] = 0x00 v20 = v18 + 1 + 1; if ((((BinaryOp CmpF & 69) | ((BinaryOp CmpF & 69) >> 6)) & 1) != 1) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v21 = v20 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v23 = v21 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v23 = v21 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v25 = v23 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v27 = v25 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v27 = v25 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] PutI(968:I8x8)[t7,0] = 0x00 v29 = v27 + 1; [D] PutI(904:F64x8)[t21,0] = t22 [D] PutI(968:I8x8)[t21,0] = 0x01 [D] PutI(968:I8x8)[t21,0] = 0x00 v30 = v29 + 1; v31 = !((BinaryOp CmpF & 69 | (BinaryOp CmpF & 69) >> 6) & 1); } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v22 = v20 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v24 = v22 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v24 = v22 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v26 = v24 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v28 = v26 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v28 = v26 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] PutI(968:I8x8)[t7,0] = 0x00 v32 = v28 + 1; [D] PutI(904:F64x8)[t21,0] = t22 [D] PutI(968:I8x8)[t21,0] = 0x01 [D] PutI(968:I8x8)[t21,0] = 0x00 v30 = v32 + 1; v31 = !((BinaryOp CmpF & 69 | (BinaryOp CmpF & 69) >> 6) & 1); } v2 = v31; if ((v2 ^ 1)) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v33 = v30 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v34 = v33 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v34 = v33 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } if ([D] GetI(968:I8x8)[t4,0]) { [D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t1,t3) [D] PutI(968:I8x8)[t7,0] = 0x00 v35 = v34 + 1; } else { [D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t1,t3) [D] PutI(968:I8x8)[t7,0] = 0x00 v35 = v34 + 1; } v36 = v35 - 1; [D] PutI(904:F64x8)[t1,0] = t4 [D] PutI(968:I8x8)[t1,0] = 0x01 [D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t11,t13) [D] PutI(968:I8x8)[t17,0] = 0x00 v78 = v36 + 1; while (true) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v37 = v78 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v38 = v37 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v38 = v37 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } if ([D] GetI(968:I8x8)[t4,0]) { [D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t1,t3) [D] PutI(968:I8x8)[t7,0] = 0x00 v39 = v38 + 1; } else { [D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t1,t3) [D] PutI(968:I8x8)[t7,0] = 0x00 v39 = v38 + 1; } v1 = *(&v10); v0 = *(&v9); v40 = printf(a0); if (v40 < 0) io_error(); if (v2) break; if (!v2) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v41 = v39 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v42 = v41 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v42 = v41 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v43 = v42 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v44 = v43 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v44 = v43 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] PutI(904:F64x8)[t5,1] = t6 [D] PutI(968:I8x8)[t5,1] = 0x01 [D] PutI(968:I8x8)[t5,0] = 0x00 v45 = v44 + 1; [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t25) [D] PutI(904:F64x8)[t27,0] = t30 [D] PutI(968:I8x8)[t27,0] = 0x01 [D] PutI(904:F64x8)[t37,1] = t38 [D] PutI(968:I8x8)[t37,1] = 0x01 [D] PutI(968:I8x8)[t37,0] = 0x00 v47 = v45 - 1 + 1; [D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t57,t59) [D] PutI(968:I8x8)[t63,0] = 0x00 v48 = v47 + 1; [D] t4 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t70) v49 = v48 - 1; [D] PutI(904:F64x8)[t72,0] = t75 [D] PutI(968:I8x8)[t72,0] = 0x01 v50 = v49 - 1; [D] PutI(904:F64x8)[t82,0] = t85 [D] PutI(968:I8x8)[t82,0] = 0x01 [D] PutI(968:I8x8)[t98,0] = 0x00 v51 = v50 + 1; [D] PutI(904:F64x8)[t112,0] = t113 [D] PutI(968:I8x8)[t112,0] = 0x01 [D] PutI(968:I8x8)[t112,0] = 0x00 v52 = v51 + 1; if ((((BinaryOp CmpF & 69) | ((BinaryOp CmpF & 69) >> 6)) & 1) != 1) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v53 = v52 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v55 = v53 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v55 = v53 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v57 = v55 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v59 = v57 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v59 = v57 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] PutI(968:I8x8)[t7,0] = 0x00 v61 = v59 + 1; [D] PutI(904:F64x8)[t21,0] = t22 [D] PutI(968:I8x8)[t21,0] = 0x01 [D] PutI(968:I8x8)[t21,0] = 0x00 v72 = v61 + 1; *(&v40) = !((BinaryOp CmpF & 69 | (BinaryOp CmpF & 69) >> 6) & 1); } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v54 = v52 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v56 = v54 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v56 = v54 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v58 = v56 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v60 = v58 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v60 = v58 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] PutI(968:I8x8)[t7,0] = 0x00 v62 = v60 + 1; [D] PutI(904:F64x8)[t21,0] = t22 [D] PutI(968:I8x8)[t21,0] = 0x01 [D] PutI(968:I8x8)[t21,0] = 0x00 v72 = v62 + 1; *(&v40) = !((BinaryOp CmpF & 69 | (BinaryOp CmpF & 69) >> 6) & 1); } v2 = v40; if (v2) { v3 = 0; if (locale_ok) setlocale(0x1, "C"); v1 = *(&v10); v0 = *(&v9); v4 = asprintf(&v6, a0); if (locale_ok) setlocale(0x1, &g_402203); if (v4 < 0) xalloc_die(); *((*(&v6) + v4 - a2)) = 0; v63 = xstrtold(*(&v6) + a1, 0x0, &v8, got.cl_strtold); if (v63) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v64 = v72 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v65 = v64 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v65 = v64 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v66 = v65 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v67 = v66 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v67 = v66 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] PutI(968:I8x8)[t6,0] = 0x00 v68 = v67 + 1; if (!(((BinaryOp CmpF & 69) >> 2) & 1)) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v69 = v68 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v70 = v69 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v70 = v69 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] PutI(968:I8x8)[t6,0] = 0x00 v71 = v70 + 1; [D] PutI(904:F64x8)[t20,0] = t21 [D] PutI(968:I8x8)[t20,0] = 0x01 [D] PutI(968:I8x8)[t20,0] = 0x00 v72 = v71 + 1; if ((((BinaryOp CmpF & 69) >> 6) & 1) == 1) { v7 = 0; v1 = *(&v12); v0 = *(&v11); v5 = asprintf(&v7, a0); if (v5 < 0) xalloc_die(); *(v7 + v5 + -1 * a2) = 0; v3 = strcmp(v7, *(&v6)); free(v7); } } else { [D] PutI(904:F64x8)[t0,0] = t1 [D] PutI(968:I8x8)[t0,0] = 0x01 [D] PutI(968:I8x8)[t0,0] = 0x00 v72 = v68 + 1; } } if (!v63 || v5 >= 0 || (((BinaryOp CmpF & 69) >> 2) & 1) || (((BinaryOp CmpF & 69) >> 6) & 1) != 1) { free(*(&v6)); if ((v3 ^ 1)) break; } } if (v4 >= 0 && v2 && (!v63 || v5 >= 0 || (((BinaryOp CmpF & 69) >> 2) & 1) || (((BinaryOp CmpF & 69) >> 6) & 1) != 1) && !(v3 ^ 1) || !v2) { if (fputs_unlocked(separator, stdout) == -1) io_error(); [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v74 = v72 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v75 = v74 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v75 = v74 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } v76 = v75 - 1; [D] PutI(904:F64x8)[t1,0] = t4 [D] PutI(968:I8x8)[t1,0] = 0x01 [D] PutI(904:F64x8)[t11,1] = t12 [D] PutI(968:I8x8)[t11,1] = 0x01 [D] PutI(968:I8x8)[t11,0] = 0x00 [D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t31,t33) [D] PutI(968:I8x8)[t37,0] = 0x00 v78 = v76 + 1 + 1; } } } v79 = fputs_unlocked("\n", stdout); if (v79 == -1) io_error(); } if (!(v2 ^ 1) || v79 != -1) { v81 = *(&v13) ^ v80[5]; return; } }
static char ** mkseq (start, end, incr, type, width) intmax_t start, end, incr; int type, width; { intmax_t n, prevn; int i, nelem; char **result, *t; if (incr == 0) incr = 1; if (start > end && incr > 0) incr = -incr; else if (start < end && incr < 0) { if (incr == (-9223372036854775807L -1) ) return ((char **) ((void *)0) ); incr = -incr; } if (((((start) > 0) && ((end) < (( (-9223372036854775807L -1) +3) + (start)))) || (((start) < 0) && ((end) > (( (9223372036854775807L) -2) + (start)))))) return ((char **) ((void *)0) ); prevn = (((end - start) >= 0) ? (end - start) : -(end - start)); if (0x7fffffff == (9223372036854775807L) && (((((prevn) > 0) && ((2) > ((0x7fffffff) - (prevn)))) || (((prevn) < 0) && ((2) < (( (-0x7fffffff - 1) ) - (prevn))))))) return ((char **) ((void *)0) ); else if ((((((prevn/(((incr) >= 0) ? (incr) : -(incr)))) > 0) && ((1) > (( (9223372036854775807L) ) - ((prevn/(((incr) >= 0) ? (incr) : -(incr))))))) || ((((prevn/(((incr) >= 0) ? (incr) : -(incr)))) < 0) && ((1) < (( (-9223372036854775807L -1) ) - ((prevn/(((incr) >= 0) ? (incr) : -(incr))))))))) return ((char **) ((void *)0) ); if ((prevn / (((incr) >= 0) ? (incr) : -(incr))) > 0x7fffffff - 3) return ((char **) ((void *)0) ); nelem = (prevn / (((incr) >= 0) ? (incr) : -(incr))) + 1; result = strvec_mcreate (nelem + 1); if (result == 0) { internal_error (gettext("brace expansion: failed to allocate memory for %u elements"), (unsigned int)nelem); return ((char **) ((void *)0) ); } i = 0; n = start; do { if (interrupt_state != 0) { result[i] = (char *) ((void *)0) ; strvec_dispose (result); result = (char **) ((void *)0) ; } do { if (terminating_signal) termsig_handler (terminating_signal); if (interrupt_state) throw_to_top_level (); } while (0); if (type == 1) result[i++] = t = itos (n); else if (type == 3) { int len, arg; arg = n; len = asprintf (&t, "%0*d", width, arg); result[i++] = t; } else { if (t = (char *)sh_malloc((2), "braces.c", 435)) { t[0] = n; t[1] = '\0'; } result[i++] = t; } if (t == 0) { char *p, lbuf[(((sizeof (intmax_t) * 8) - (! ((intmax_t) 0 < (intmax_t) -1))) * 302 / 1000 + 1 + (! ((intmax_t) 0 < (intmax_t) -1))) + 1]; p = inttostr (n, lbuf, sizeof (lbuf)); internal_error (gettext("brace expansion: failed to allocate memory for `%s'"), p); strvec_dispose (result); return ((char **) ((void *)0) ); } if (((((n) > 0) && ((incr) > (( (9223372036854775807L) ) - (n)))) || (((n) < 0) && ((incr) < (( (-9223372036854775807L -1) ) - (n)))))) break; n += incr; if ((incr < 0 && n < end) || (incr > 0 && n > end)) break; } while (1); result[i] = (char *)0; return (result); }
int mkseq(unsigned long long a0, unsigned long a1, unsigned long long a2, unsigned long a3, unsigned long a4) { unsigned int v0; int tmp_16; int tmp_17; int tmp_12; unsigned long long v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; char v6[2]; unsigned long long v7; void* v8; unsigned long v9; unsigned long long v10; char v11; unsigned int v13; v1 = a2; v0 = a4; if (!v1) v1 = 1; if (a0 > a1 && v1 > 0) v1 = -(v1); if ((v1 <= 0 || a0 <= a1) && a0 < a1 && (v1 - 0 >> 63)) { if (v1 == 0x8000000000000000) v13 = 0; else v1 = -(v1); } if (!((v1 - 0 >> 63)) || v1 != 0x8000000000000000 || a0 >= a1 || v1 > 0 && a0 > a1) { if (((a0 - 0 >> 63) || a1 < a0 - 9223372036854775805) && ((a0 - 0 >> 63) || a0 > 0) && (a1 < a0 - 9223372036854775805 || a1 > a0 + 9223372036854775805) && (a0 > 0 || a1 > a0 + 9223372036854775805)) { v13 = 0; } else { v9 = a1 - a0 ^ a1 - a0 >> 63; v9 -= a1 - a0 >> 63; if (((v9 >> 63 CONCAT v9) /m ((v1 >> 63 ^ v1) - (v1 >> 63)) < 0 || 9223372036854775807 - (v9 >> 63 CONCAT v9) /m ((v1 >> 63 ^ v1) - (v1 >> 63)) <= 0) && ((v9 >> 63 CONCAT v9) /m ((v1 >> 63 ^ v1) - (v1 >> 63)) < 0 || (v9 >> 63 CONCAT v9) /m ((v1 >> 63 ^ v1) - (v1 >> 63)) > 0) && (9223372036854775807 - (v9 >> 63 CONCAT v9) /m ((v1 >> 63 ^ v1) - (v1 >> 63)) <= 0 || 0x8000000000000000 - (v9 >> 63 CONCAT v9) /m ((v1 >> 63 ^ v1) - (v1 >> 63)) > 1) && ((v9 >> 63 CONCAT v9) /m ((v1 >> 63 ^ v1) - (v1 >> 63)) > 0 || 0x8000000000000000 - (v9 >> 63 CONCAT v9) /m ((v1 >> 63 ^ v1) - (v1 >> 63)) > 1)) { v13 = 0; } else if ((v9 >> 63 CONCAT v9) /m ((v1 >> 63 ^ v1) - (v1 >> 63)) > 2147483644) { v13 = 0; } else { v3 = ((v9 >> 63 CONCAT v9) /m ((v1 >> 63 ^ v1) - (v1 >> 63))) + 1; v8 = strvec_mcreate(v3 + 1, (v1 >> 63 ^ v1) - (v1 >> 63), (v9 >> 63 CONCAT v9) /m ((v1 >> 63 ^ v1) - (v1 >> 63)) >> 64); if (!v8) { internal_error(gettext("brace expansion: failed to allocate memory for %u elements"), v3, a2); v13 = 0; } else { v2 = 0; v7 = a0; while (true) { if (interrupt_state) { *((v8 + 8 * v2)) = 0; strvec_dispose(v8); v8 = 0; } if (terminating_signal) termsig_handler(terminating_signal); if (interrupt_state) throw_to_top_level(); if (a3 == 1) { *(&v6) = itos(v7); tmp_16 = v2; v2 += 1; *((8 * tmp_16 + v8)) = v6; } else if (a3 == 3) { v4 = v7; v5 = asprintf(&v6, "%0*d"); tmp_17 = v2; v2 += 1; *((8 * tmp_17 + v8)) = v6; } else { *(&v6) = sh_malloc(0x2, "braces.c", 0x1b3); if (v6) { v6[0] = v7; v6[1] = 0; } tmp_12 = v2; v2 += 1; *((8 * tmp_12 + v8)) = v6; } if (!v6) { v10 = inttostr(v7, &v11, 0x16, &v11); v13 = gettext("brace expansion: failed to allocate memory for `%s'"); internal_error(v13, v10, v13); strvec_dispose(v8); v13 = 0; break; } else { if ((v1 <= 9223372036854775807 - v7 || v7 <= 0) && (!((v7 - 0 >> 63)) || v1 >= 0x8000000000000000 - v7)) { v7 += v1; if (!((v1 - 0 >> 63)) || v7 >= a1) { if (v1 <= 0) continue; continue; } } *((v8 + 8 * v2)) = 0; v13 = v8; break; } } } } } } return v13; }
static void print_explain(FILE *f) { fprintf(f, "Usage: ... bond_slave [ queue_id ID ] [ prio PRIORITY ]\n"); }
void print_explain(void* a0) { unsigned long long v1; v1 = fprintf(a0, "Usage: ... bond_slave [ queue_id ID ] [ prio PRIORITY ]\n"); return; }
static void usage (void) { char const * const *p; printf (gettext ("Usage: %s [OPTION]... FILES\n"), program_name); printf ("%s\n\n", gettext ("Compare 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) putchar_unlocked ('\n'); else { char const *msg = gettext (*p); char const *nl; while ((nl = strchr (msg, '\n'))) { int msglen = nl + 1 - msg; ((void) sizeof (( msglen < 4096 ) ? 1 : 0), __extension__ ({ if ( msglen < 4096 ) ; else __assert_fail ( "msglen < 4096" , "diff.c", 1016, __extension__ __PRETTY_FUNCTION__); })) ; printf (" %.*s", msglen, msg); msg = nl + 1; } printf (&" %s\n"[2 * (*msg != ' ' && *msg != '-')], msg); } } emit_bug_reporting_address (); }
void usage(void) { FILE *__stream; uint uVar1; int iVar2; char *pcVar3; undefined8 uVar4; undefined1 *local_30; char *local_28; uVar4 = program_name; pcVar3 = (char *)gettext("Usage: %s [OPTION]... FILES\n"); printf(pcVar3,uVar4); uVar4 = gettext("Compare FILES line by line."); printf("%s\n\n",uVar4); __stream = stdout; pcVar3 = (char *)gettext( "Mandatory arguments to long options are mandatory for short options too.\n" ); fputs_unlocked(pcVar3,__stream); local_30 = option_help_msgid; do { if (*(char **)local_30 == (char *)0x0) { emit_bug_reporting_address(); return; } if (**(char **)local_30 == '\0') { putchar_unlocked(10); } else { local_28 = (char *)gettext(*(char **)local_30); while( true ) { pcVar3 = strchr(local_28,10); if (pcVar3 == (char *)0x0) break; uVar1 = ((int)pcVar3 + 1) - (int)local_28; if (0xfff < (int)uVar1) { __assert_fail("msglen < 4096","diff.c",0x3f8,"usage"); } printf(" %.*s",(ulong)uVar1,local_28); local_28 = pcVar3 + 1; } if ((*local_28 == ' ') || (*local_28 == '-')) { iVar2 = 0; } else { iVar2 = 1; } printf(&DAT_00104d4e + iVar2 * 2,local_28); } local_30 = (undefined1 *)((long)local_30 + 8); } while( true ); }
static void Small_decode(small *f,const unsigned char *s) { unsigned char x; int i; for (i = 0;i < 761/4;++i) { x = *s++; *f++ = ((small)(x&3))-1; x >>= 2; *f++ = ((small)(x&3))-1; x >>= 2; *f++ = ((small)(x&3))-1; x >>= 2; *f++ = ((small)(x&3))-1; } x = *s++; *f++ = ((small)(x&3))-1; }
void Small_decode(unsigned long long a0, unsigned long a1) { char *v0; int tmp_70; int tmp_97; int tmp_135; int tmp_173; int tmp_211; int tmp_21; char *v1; char v2; unsigned int v3; char *v7; v1 = a0; v0 = a1; for (v3 = 0; v3 <= 189; v3 = __addvsi3(v3, 0x1, (v2 & 3) - 1)) { tmp_70 = v0; v0 += 1; v2 = *(tmp_70); tmp_97 = v1; v1 += 1; *(tmp_97) = (v2 & 3) - 1; v2 >>= 2; tmp_135 = v1; v1 += 1; *(tmp_135) = (v2 & 3) - 1; v2 >>= 2; tmp_173 = v1; v1 += 1; *(tmp_173) = (v2 & 3) - 1; v2 >>= 2; tmp_211 = v1; v1 += 1; *(tmp_211) = (v2 & 3) - 1; } tmp_21 = v0; v0 += 1; v2 = *(tmp_21); v7 = v1; v1 += 1; *(v7) = (v2 & 3) - 1; return; }
int rl_vi_insert_mode (int count, int key) { rl_vi_start_inserting (key, 1, rl_arg_sign); return (0); }
long long rl_vi_insert_mode(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned int v0; v0 = a0; rl_vi_start_inserting(a1, 0x1, rl_arg_sign, a3, a4, a5); return 0; }
) { fprintf( stderr , "error reading request\n"); app_exit(1); }
int fprintf(FILE *__stream,char *__format,...) { halt_baddata(); }
static void print_encap_seg6local(FILE *fp, struct rtattr *encap) { struct rtattr *tb[(__SEG6_LOCAL_MAX - 1) + 1]; int action; char b1[64]; (parse_rtattr_flags((tb), ((__SEG6_LOCAL_MAX - 1)), ((void*)(((char*)(encap)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((encap)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))); if (!tb[SEG6_LOCAL_ACTION]) return; action = rta_getattr_u32(tb[SEG6_LOCAL_ACTION]); print_string(PRINT_ANY, "action", "action %s ", format_action_type(action)); if (tb[SEG6_LOCAL_SRH]) { open_json_object("srh"); print_srh(fp, ((void*)(((char*)(tb[SEG6_LOCAL_SRH])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))))); close_json_object(); } if (tb[SEG6_LOCAL_TABLE]) print_string(PRINT_ANY, "table", "table %s ", rtnl_rttable_n2a(rta_getattr_u32(tb[SEG6_LOCAL_TABLE]), b1, sizeof(b1))); if (tb[SEG6_LOCAL_VRFTABLE]) print_string(PRINT_ANY, "vrftable", "vrftable %s ", rtnl_rttable_n2a(rta_getattr_u32(tb[SEG6_LOCAL_VRFTABLE]), b1, sizeof(b1))); if (tb[SEG6_LOCAL_NH4]) { print_string(PRINT_ANY, "nh4", "nh4 %s ", rt_addr_n2a( 2 , ((int)((tb[SEG6_LOCAL_NH4])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), ((void*)(((char*)(tb[SEG6_LOCAL_NH4])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))))); } if (tb[SEG6_LOCAL_NH6]) { print_string(PRINT_ANY, "nh6", "nh6 %s ", rt_addr_n2a( 10 , ((int)((tb[SEG6_LOCAL_NH6])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), ((void*)(((char*)(tb[SEG6_LOCAL_NH6])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))))); } if (tb[SEG6_LOCAL_IIF]) { int iif = rta_getattr_u32(tb[SEG6_LOCAL_IIF]); print_string(PRINT_ANY, "iif", "iif %s ", ll_index_to_name(iif)); } if (tb[SEG6_LOCAL_OIF]) { int oif = rta_getattr_u32(tb[SEG6_LOCAL_OIF]); print_string(PRINT_ANY, "oif", "oif %s ", ll_index_to_name(oif)); } if (tb[SEG6_LOCAL_BPF]) print_encap_bpf_prog(fp, tb[SEG6_LOCAL_BPF], "endpoint"); if (tb[SEG6_LOCAL_COUNTERS] && show_stats) print_seg6_local_counters(fp, tb[SEG6_LOCAL_COUNTERS]); }
void print_encap_seg6local(undefined8 param_1,ushort *param_2) { undefined4 uVar1; undefined8 uVar2; long in_FS_OFFSET; undefined local_b8 [8]; long local_b0; long local_a8; long local_a0; ushort *local_98; ushort *local_90; long local_88; long local_80; long local_78; long local_70; long local_68; undefined local_58 [72]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); parse_rtattr_flags(local_b8,10,param_2 + 2,*param_2 - 4,0x8000); if (local_b0 != 0) { uVar1 = rta_getattr_u32(local_b0); uVar2 = format_action_type(uVar1); print_string(4,"action","action %s ",uVar2); if (local_a8 != 0) { open_json_object(&DAT_00106e9b); print_srh(param_1,local_a8 + 4); close_json_object(); } if (local_a0 != 0) { uVar1 = rta_getattr_u32(local_a0); uVar2 = rtnl_rttable_n2a(uVar1,local_58,0x40); print_string(4,"table","table %s ",uVar2); } if (local_70 != 0) { uVar1 = rta_getattr_u32(local_70); uVar2 = rtnl_rttable_n2a(uVar1,local_58,0x40); print_string(4,"vrftable","vrftable %s ",uVar2); } if (local_98 != (ushort *)0x0) { uVar2 = rt_addr_n2a(2,*local_98 - 4,local_98 + 2); print_string(4,&DAT_00106ecd,"nh4 %s ",uVar2); } if (local_90 != (ushort *)0x0) { uVar2 = rt_addr_n2a(10,*local_90 - 4,local_90 + 2); print_string(4,&DAT_00106ed9,"nh6 %s ",uVar2); } if (local_88 != 0) { uVar1 = rta_getattr_u32(local_88); uVar2 = ll_index_to_name(uVar1); print_string(4,&DAT_00106ee5,"iif %s ",uVar2); } if (local_80 != 0) { uVar1 = rta_getattr_u32(local_80); uVar2 = ll_index_to_name(uVar1); print_string(4,&DAT_00106ef1,"oif %s ",uVar2); } if (local_78 != 0) { print_encap_bpf_prog(param_1,local_78,"endpoint"); } if ((local_68 != 0) && (show_stats != 0)) { print_seg6_local_counters(param_1,local_68); } } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
static int test_do_handshake(gnutls_session_t session) { int ret, alert; do { ret = gnutls_handshake(session); } while (ret < 0 && gnutls_error_is_fatal(ret) == 0); handshake_output = ret; if (ret < 0 && verbose > 1) { if (ret == -12) { alert = gnutls_alert_get(session); printf("\n"); printf("*** Received alert [%d]: %s\n", alert, gnutls_alert_get_name(alert)); } } if (ret < 0) return TEST_FAILED; gnutls_session_get_data(session, ((void *)0) , &session_data_size); if (sfree != 0) { free(session_data); sfree = 0; } session_data = malloc(session_data_size); sfree = 1; if (session_data == ((void *)0) ) { fprintf( stderr , "Memory error\n"); exit(1); } gnutls_session_get_data(session, session_data, &session_data_size); session_id_size = sizeof(session_id); gnutls_session_get_id(session, session_id, &session_id_size); return TEST_SUCCEED; }
undefined8 test_do_handshake(undefined8 param_1) { int iVar1; int iVar2; uint uVar3; undefined8 uVar4; do { iVar1 = gnutls_handshake(param_1); if (-1 < iVar1) break; iVar2 = gnutls_error_is_fatal(iVar1); } while (iVar2 == 0); handshake_output = iVar1; if (((iVar1 < 0) && (1 < verbose)) && (iVar1 == -0xc)) { uVar3 = gnutls_alert_get(param_1); printf("\n"); uVar4 = gnutls_alert_get_name(uVar3); printf("*** Received alert [%d]: %s\n",(ulong)uVar3,uVar4); } if (iVar1 < 0) { uVar4 = 1; } else { gnutls_session_get_data(param_1,0,&session_data_size); if (sfree != 0) { free(session_data); sfree = 0; } session_data = malloc(session_data_size); sfree = 1; if (session_data == (void *)0x0) { fprintf(stderr,"Memory error\n"); exit(1); } gnutls_session_get_data(param_1,session_data,&session_data_size); session_id_size = 0x20; gnutls_session_get_id(param_1,session_id,&session_id_size); uVar4 = 0; } return uVar4; }
static void print_until_or_while (while_command, which) WHILE_COM *while_command; char *which; { cprintf ("%s ", which); skip_this_indent++; make_command_string_internal (while_command->test); do { if (deferred_heredocs) print_deferred_heredocs (""); } while (0); semicolon (); cprintf (" do\n"); indentation += indentation_amount; make_command_string_internal (while_command->action); do { if (deferred_heredocs) print_deferred_heredocs (""); } while (0); indentation -= indentation_amount; semicolon (); newline ("done"); }
void print_until_or_while(unsigned long long a0[3], unsigned long a1) { unsigned long v0; unsigned long long v2; v0 = a1; cprintf("%s "); skip_this_indent = skip_this_indent + 1; make_command_string_internal(a0[1]); if (deferred_heredocs) print_deferred_heredocs(&g_403583); semicolon(); cprintf(" do\n"); indentation = indentation_amount + indentation; make_command_string_internal(a0[2]); if (deferred_heredocs) print_deferred_heredocs(&g_403583); indentation = indentation - indentation_amount; semicolon(); v2 = newline("done"); return; }
static void tar_set_quoting_style (char *arg) { int i; for (i = 0; quoting_style_args[i]; i++) if (strcmp (arg, quoting_style_args[i]) == 0) { set_quoting_style ( ((void *)0) , i); return; } do { if (error_hook) error_hook (); error (0, 0, gettext ("Unknown quoting style '%s'. Try '%s --quoting-style=help' to get a list."), arg, program_name); fatal_exit (); } while (0) ; }
long tar_set_quoting_style(char *a1) { char *v2; char *v3; char *s1; unsigned int i; s1 = a1; for ( i = 0; quoting_style_args[i]; ++i ) { a1 = s1; if ( !strcmp(s1, (const char *)quoting_style_args[i]) ) return set_quoting_style(0LL, i); } if ( error_hook ) error_hook(a1); v2 = program_name; v3 = gettext("Unknown quoting style '%s'. Try '%s --quoting-style=help' to get a list."); error(0, 0, v3, s1, v2); return fatal_exit(); }
static size_t size_opt (char const *opt, char const *msgid) { uintmax_t size; switch (xstrtoumax (opt, ((void *)0) , 10, &size, "")) { case LONGINT_OK: case LONGINT_OVERFLOW: break; default: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, \"%s: %s\", opt, gettext (msgid)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, "%s: %s", opt, gettext (msgid)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, "%s: %s", opt, gettext (msgid)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); } return ((( size )<((18446744073709551615UL)))?( size ):((18446744073709551615UL))) ; }
int size_opt(unsigned long long a0, char *a1) { char v0; if (xstrtoumax(a0, 0x0, 0xa, &v0, &g_401733) > 1) { gettext(a1); error(0x1, 0x0, "%s: %s"); } return *(&v0); }
int main (int argc, char **argv) { int c; _Bool ok; _Bool make_backups = 0 ; char const *backup_suffix = ((void *)0) ; char *version_control_string = ((void *)0) ; char const *target_directory = ((void *)0) ; int destdir_fd; _Bool no_target_directory = 0 ; int n_files; char **file; int link_errno = -1; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdin); symbolic_link = remove_existing_files = interactive = verbose = hard_dir_link = 0 ; while ((c = getopt_long (argc, argv, "bdfinrst:vFLPS:T", long_options, ((void *)0) )) != -1) { switch (c) { case 'b': make_backups = 1 ; if (optarg) version_control_string = optarg; break; case 'd': case 'F': hard_dir_link = 1 ; break; case 'f': remove_existing_files = 1 ; interactive = 0 ; break; case 'i': remove_existing_files = 0 ; interactive = 1 ; break; case 'L': logical = 1 ; break; case 'n': dereference_dest_dir_symlinks = 0 ; break; case 'P': logical = 0 ; break; case 'r': relative = 1 ; break; case 's': symbolic_link = 1 ; break; case 't': if (target_directory) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"multiple target directories specified\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("multiple target directories specified")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("multiple target directories specified")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); else { struct stat st; if (stat (optarg, &st) != 0) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"failed to access %s\"), quotearg_style (shell_escape_always_quoting_style, optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , gettext ("failed to access %s"), quotearg_style (shell_escape_always_quoting_style, optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , gettext ("failed to access %s"), quotearg_style (shell_escape_always_quoting_style, optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; if (! (((( st.st_mode )) & 0170000) == (0040000)) ) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"target %s is not a directory\"), quotearg_style (shell_escape_always_quoting_style, optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("target %s is not a directory"), quotearg_style (shell_escape_always_quoting_style, optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("target %s is not a directory"), quotearg_style (shell_escape_always_quoting_style, optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; } target_directory = optarg; break; case 'T': no_target_directory = 1 ; break; case 'v': verbose = 1 ; break; case 'S': make_backups = 1 ; backup_suffix = optarg; break; case GETOPT_HELP_CHAR: usage ( 0 ); break;; case GETOPT_VERSION_CHAR: version_etc ( stdout , "ln", "GNU coreutils", Version, ("Mike Parker"), ("David MacKenzie"), (char *) ((void *)0) ); exit ( 0 ); break;; default: usage ( 1 ); break; } } n_files = argc - optind; file = argv + optind; if (n_files <= 0) { error (0, 0, gettext ("missing file operand")); usage ( 1 ); } if (relative && !symbolic_link) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot do --relative without --symbolic\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("cannot do --relative without --symbolic")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("cannot do --relative without --symbolic")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (!hard_dir_link) { priv_set_remove_linkdir (); beware_hard_dir_link = ! 1 ; } if (no_target_directory) { if (target_directory) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot combine --target-directory \" \"and --no-target-directory\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("cannot combine --target-directory " "and --no-target-directory")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("cannot combine --target-directory " "and --no-target-directory")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; if (n_files != 2) { if (n_files < 2) error (0, 0, gettext ("missing destination file operand after %s"), quotearg_style (shell_escape_always_quoting_style, file[0])); else error (0, 0, gettext ("extra operand %s"), quotearg_style (shell_escape_always_quoting_style, file[2])); usage ( 1 ); } } else if (n_files < 2 && !target_directory) { target_directory = "."; destdir_fd = -100 ; } else { if (n_files == 2 && !target_directory) link_errno = atomic_link (file[0], -100 , file[1]); if (link_errno < 0 || link_errno == 17 || link_errno == 20 || link_errno == 22 ) { char const *d = target_directory ? target_directory : file[n_files - 1]; int flags = (O_PATHSEARCH | 0200000 | (dereference_dest_dir_symlinks ? 0 : 0400000 )); destdir_fd = openat_safer ( -100 , d, flags); int err = (*__errno_location ()) ; if (! 0200000 && 0 <= destdir_fd) { struct stat st; err = (fstat (destdir_fd, &st) != 0 ? (*__errno_location ()) : (((( st.st_mode )) & 0170000) == (0040000)) ? 0 : 20 ); if (err != 0) { close (destdir_fd); destdir_fd = -1; } } if (0 <= destdir_fd) { n_files -= !target_directory; target_directory = d; } else if (! (n_files == 2 && !target_directory)) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, err, gettext (\"target %s\"), quotearg_style (shell_escape_always_quoting_style, d)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , err, gettext ("target %s"), quotearg_style (shell_escape_always_quoting_style, d)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , err, gettext ("target %s"), quotearg_style (shell_escape_always_quoting_style, d)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); } } backup_type = (make_backups ? xget_version (gettext ("backup type"), version_control_string) : no_backups); set_simple_backup_suffix (backup_suffix); if (target_directory) { if (2 <= n_files && remove_existing_files && ! symbolic_link && backup_type != numbered_backups) { dest_set = hash_initialize (DEST_INFO_INITIAL_CAPACITY, ((void *)0) , triple_hash, triple_compare, triple_free); if (dest_set == ((void *)0) ) xalloc_die (); } ok = 1 ; for (int i = 0; i < n_files; ++i) { char *dest_base; char *dest = file_name_concat (target_directory, last_component (file[i]), &dest_base); strip_trailing_slashes (dest_base); ok &= do_link (file[i], destdir_fd, dest_base, dest, -1); free (dest); } } else ok = do_link (file[0], -100 , file[1], file[1], link_errno); return ok ? 0 : 1 ; }
int main(unsigned long a0, unsigned long long *a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long a5) { void* v0; char v1; char v2; char v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned int v8; unsigned int v9; unsigned int v10; char v11; unsigned long v12; unsigned long v13; unsigned long v14; unsigned long long v15[3]; unsigned long v16; void* v17; char v18; char v19; unsigned long v21; unsigned long long v22; unsigned long long v23; unsigned long long v24; unsigned long long v25; unsigned long long v26; unsigned long long v27; unsigned long long v28; v1 = 0; v12 = 0; v13 = 0; v14 = 0; v3 = 0; v6 = -1; set_program_name(*(a1)); setlocale(0x6, &g_401d03); bindtextdomain("coreutils", "/usr/local/share/locale"); textdomain("coreutils"); atexit(got.close_stdin); hard_dir_link = 0; verbose = hard_dir_link; interactive = verbose; remove_existing_files = interactive; symbolic_link = remove_existing_files; while (true) { v8 = getopt_long(a0, a1, "bdfinrst:vFLPS:T", &long_options, NULL); if (v8 == -1) { v5 = a0 - optind; v15[0] = &a1[optind]; if (v5 <= 0) { error(0x0, 0x0, gettext("missing file operand")); usage(0x1); } if (relative && (symbolic_link ^ 1)) error(0x1, 0x0, gettext("cannot do --relative without --symbolic")); if (!(symbolic_link ^ 1) || !relative) { if (!(hard_dir_link ^ 1)) break; if ((hard_dir_link ^ 1)) { priv_set_remove_linkdir(); beware_hard_dir_link = 0; break; } } } else if (v8 <= 118) { if (v8 < 70) { if (v8 == -131) { v0 = 0; version_etc(stdout, "ln", "GNU coreutils", Version, "Mike Parker", "David MacKenzie"); exit(0x0); } if (v8 == -130) usage(0x0); } else { switch (v8) { case 70: case 100: hard_dir_link = 1; break; case 76: logical = 1; break; case 80: logical = 0; break; case 83: v1 = 1; v12 = *(&optarg); break; case 84: v3 = 1; break; case 98: v1 = 1; if (!*(&optarg)) continue; v13 = *(&optarg); break; case 102: remove_existing_files = 1; interactive = 0; break; case 105: remove_existing_files = 0; interactive = 1; break; case 110: dereference_dest_dir_symlinks = 0; break; case 114: relative = 1; break; case 115: symbolic_link = 1; break; case 116: if (v14) error(0x1, 0x0, gettext("multiple target directories specified")); v21 = stat(*(&optarg), &v18); if (v21) { v23 = quotearg_style(0x4, *(&optarg)); error(0x1, *(__errno_location()), gettext("failed to access %s")); } else if ((*(&v19) & 0xf000) != 0x4000) { v22 = quotearg_style(0x4, *(&optarg)); error(0x1, 0x0, gettext("target %s is not a directory")); } else { v14 = *(&optarg); break; } case 118: verbose = 1; break; default: usage(0x1); } } } } if (!v3) { if (v5 <= 1 && !v14) { v14 = "."; v4 = -100; } if (v5 > 1 || v14) { if (v5 == 2 && !v14) v6 = atomic_link(v15[0], 0xffffff9c, v15[1]); if (v6 == 20 || v6 < 0 || v6 == 22 || v6 == 17) { if (!v14) v21 = v15[1 + v5]; else v21 = v14; v16 = v21; if (dereference_dest_dir_symlinks) *(&v21) = 0x210000; else *(&v21) = 0x230000; v9 = v21; v4 = openat_safer(0xffffff9c, v16, v9); *(&v21) = *(__errno_location()); v10 = v21; if (v4 >= 0) { v5 -= !v14; v14 = v16; } } } } else if (v14) { error(0x1, 0x0, gettext("cannot combine --target-directory and --no-target-directory")); } else if (v5 != 2) { if (v5 <= 1) { v24 = quotearg_style(0x4, v15[0]); error(0x0, 0x0, gettext("missing destination file operand after %s")); } else { v25 = quotearg_style(0x4, v15[2]); error(0x0, 0x0, gettext("extra operand %s")); } usage(0x1); } if (!v3 && v4 < 0 && v5 != 2 && (v5 > 1 || v14) && (v6 == 20 || v6 < 0 || v6 == 22 || v6 == 17) || !v3 && v5 == 2 && v4 < 0 && v14 && (v5 > 1 || v14) && (v6 == 20 || v6 < 0 || v6 == 22 || v6 == 17)) { v27 = quotearg_style(0x4, v16); error(0x1, v10, gettext("target %s")); } if (v5 <= 1 && !v3 && !v14 || v5 == 2 && !v14 && v3 || !v3 && v4 >= 0 && (v5 > 1 || v14) && (v6 == 20 || v6 < 0 || v6 == 22 || v6 == 17) || !v3 && v5 == 2 && !v14 && v4 < 0 && (v5 > 1 || v14) && (v6 == 20 || v6 < 0 || v6 == 22 || v6 == 17) || !v3 && v6 != 20 && v6 >= 0 && v6 != 22 && v6 != 17 && (v5 > 1 || v14)) { if (v1) { v26 = gettext("backup type"); v21 = xget_version(v26, v13, v26); } else { v21 = 0; } backup_type = v21; set_simple_backup_suffix(v12); if (v14) { if (v5 > 1 && remove_existing_files && (symbolic_link ^ 1) && backup_type != 3) { dest_set = hash_initialize(0x3d, 0x0, got.triple_hash, got.triple_compare, got.triple_free); if (!dest_set) xalloc_die(); } if (backup_type == 3 || !remove_existing_files || !(symbolic_link ^ 1) || v5 <= 1 || dest_set) { v2 = 1; for (v7 = 0; v7 < v5; v7 += 1) { v28 = last_component(v15[v7]); v17 = file_name_concat(v14, v28, &v11, v28); strip_trailing_slashes(*(&v11)); v2 = (do_link(v15[v7], v4, *(&v11), v17, 0xffffffff, a5) & v2); free(v17); } } } else { v2 = do_link(v15[0], 0xffffff9c, v15[1], v15[1], v6, a5); } if (backup_type == 3 || !remove_existing_files || !(symbolic_link ^ 1) || v5 <= 1 || !v14 || dest_set) return v2 ^ 1; } }
int utf8_mbsnlen(src, srclen, maxlen) const char *src; size_t srclen; int maxlen; { register int sind, count; for (sind = count = 0; src[sind] && sind <= maxlen; sind++) { if ((src[sind] & 0xc0) != 0x80) count++; } return (count); }
long utf8_mbsnlen(long a1, long a2, int a3) { unsigned int v3; int i; v3 = 0; for ( i = 0; *(_BYTE *)(i + a1) && i <= a3; ++i ) { if ( (*(_BYTE *)(i + a1) & 0xC0) != 128 ) ++v3; } return v3; }
static void debug_key (struct line const *line, struct keyfield const *key) { char *text = line->text; char *beg = text; char *lim = text + line->length - 1; if (key) { if (key->sword != (18446744073709551615UL) ) beg = begfield (line, key); if (key->eword != (18446744073709551615UL) ) lim = limfield (line, key); if ((key->skipsblanks && key->sword == (18446744073709551615UL) ) || key->month || key_numeric (key)) { char saved = *lim; *lim = '\0'; while (blanks[to_uchar (*beg)]) beg++; char *tighter_lim = beg; if (lim < beg) tighter_lim = lim; else if (key->month) getmonth (beg, &tighter_lim); else if (key->general_numeric) (__extension__ ({ __typeof__ (strtold (beg, &tighter_lim)) __x = (strtold (beg, &tighter_lim)); (void) __x; })); else if (key->numeric || key->human_numeric) { char const *p = beg + (beg < lim && *beg == '-'); char max_digit = traverse_raw_number (&p); if ('0' <= max_digit) { unsigned char ch = *p; tighter_lim = (char *) p + (key->human_numeric && unit_order[ch]); } } else tighter_lim = lim; *lim = saved; lim = tighter_lim; } } size_t offset = debug_width (text, beg); size_t width = debug_width (beg, lim); mark_key (offset, width); }
void debug_key(unsigned long long a0[2], struct_0 *a1) { char v0; char v1; char v2; char *v3; char *v4; char *v5; char *v6; char *v7; unsigned long long v8; unsigned int v9; char v10; unsigned long long v13; unsigned long long v14; unsigned long long v15; unsigned long long *v16; unsigned long long v17; v7 = a0[0]; v5 = v7; v6 = &v7[1 + a0[1]]; if (a1) { if (a1->field_0 != -1) v5 = begfield(a0, a1); if (a1->field_10 != -1) v6 = limfield(a0, a1); if (a1->field_30 && a1->field_0 == -1 || a1->field_36 || key_numeric(a1)) { v0 = *(v6); *(v6) = 0; while (true) { if (!*(to_uchar(*(v5)) + &blanks)) break; v5 += 1; } v3 = v5; if (v6 < v5) { v3 = v6; } else if (a1->field_36) { getmonth(v5, &v3); } else if (a1->field_34) { strtold(v5, &v3); if ([D] GetI(968:I8x8)[t7,0]) { [D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t1,t3) [D] PutI(968:I8x8)[t7,0] = 0x00 } else { [D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t1,t3) [D] PutI(968:I8x8)[t7,0] = 0x00 } } else if (a1->field_32 || a1->field_35) { if (v5 >= v6 || *(v5) != 45) v13 = 0; else v13 = 1; v4 = &v5[v13]; v1 = traverse_raw_number(&v4); if (v1 > 47) { v2 = *(v4); if (!a1->field_35 || !*(v2 + &unit_order)) v14 = 0; else v14 = 1; v15 = &v4[v14]; v3 = v15; } } else { v3 = v6; } *(v6) = v0; v6 = v3; } } v8 = debug_width(v7, v5); *(&v9) = debug_width(v5, v6); mark_key(v8, *(&v9)); v17 = *(&v10) ^ v16[5]; return; }
static int channel_cancel_rport_listener_tcpip(struct ssh *ssh, const char *host, u_short port) { u_int i; int found = 0; for (i = 0; i < ssh->chanctxt->channels_alloc; i++) { Channel *c = ssh->chanctxt->channels[i]; if (c == ((void *)0) || c->type != 11) continue; if (strcmp(c->path, host) == 0 && c->listening_port == port) { sshlog("channels.c", __func__, 3827, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "close channel %d", i); channel_free(ssh, c); found = 1; } } return found; }
undefined4 channel_cancel_rport_listener_tcpip(long param_1,char *param_2,ushort param_3) { int *piVar1; int iVar2; uint local_18; undefined4 local_14; local_14 = 0; for (local_18 = 0; local_18 < *(uint *)(*(long *)(param_1 + 0x868) + 8); local_18 = local_18 + 1) { piVar1 = *(int **)(**(long **)(param_1 + 0x868) + (ulong)local_18 * 8); if ((piVar1 != (int *)0x0) && (*piVar1 == 0xb)) { iVar2 = strcmp(*(char **)(piVar1 + 0x20),param_2); if ((iVar2 == 0) && (piVar1[0x22] == (uint)param_3)) { sshlog("channels.c","channel_cancel_rport_listener_tcpip",0xef3,1,6,0,"close channel %d", local_18); channel_free(param_1,piVar1); local_14 = 1; } } } return local_14; }
static FOR_COM * copy_for_command (com) FOR_COM *com; { FOR_COM *new_for; new_for = (FOR_COM *)sh_xmalloc((sizeof (FOR_COM)), "copy_cmd.c", 185); new_for->flags = com->flags; new_for->line = com->line; new_for->name = copy_word (com->name); new_for->map_list = copy_word_list (com->map_list); new_for->action = copy_command (com->action); return (new_for); }
long copy_for_command(long a1) { long v2; v2 = sh_xmalloc(32LL, "copy_cmd.c", 185LL); *(_DWORD *)v2 = *(_DWORD *)a1; *(_DWORD *)(v2 + 4) = *(_DWORD *)(a1 + 4); *(_QWORD *)(v2 + 8) = copy_word(*(_QWORD *)(a1 + 8)); *(_QWORD *)(v2 + 16) = copy_word_list(*(_QWORD **)(a1 + 16)); *(_QWORD *)(v2 + 24) = copy_command(*(_QWORD *)(a1 + 24)); return v2; }
static inline void emit_ancillary_info (char const *program) { struct infomap { char const *program; char const *node; } const infomap[] = { { "[", "test invocation" }, { "coreutils", "Multi-call invocation" }, { "sha224sum", "sha2 utilities" }, { "sha256sum", "sha2 utilities" }, { "sha384sum", "sha2 utilities" }, { "sha512sum", "sha2 utilities" }, { ((void *)0) , ((void *)0) } }; char const *node = program; struct infomap const *map_prog = infomap; while (map_prog->program && ! (strcmp (program, map_prog->program) == 0)) map_prog++; if (map_prog->node) node = map_prog->node; printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https: char const *lc_messages = setlocale ( 5 , ((void *)0) ); if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1)) { fputs_unlocked (gettext ("Report any translation bugs to " "<https: stdout ) ; } char const *url_program = (strcmp (program, "[") == 0) ? "test" : program; printf (gettext ("Full documentation <%s%s>\n"), "https: printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"), node, node == program ? " invocation" : ""); }
void emit_ancillary_info(char *a0) { unsigned long long v0; unsigned long long v1[2]; char *v2; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long long v9; unsigned long long v10; unsigned long long v11; unsigned long long v12; unsigned long long v13; unsigned long long v14; unsigned long long v15; void* v16; void* v17; char v18; unsigned long long v23; unsigned long long *v24; unsigned long long v25; v4 = "["; v5 = "test invocation"; v6 = "coreutils"; v7 = "Multi-call invocation"; v8 = "sha224sum"; v9 = "sha2 utilities"; v10 = "sha256sum"; v11 = "sha2 utilities"; v12 = "sha384sum"; v13 = "sha2 utilities"; v14 = "sha512sum"; v15 = "sha2 utilities"; v16 = 0; v17 = 0; v0 = a0; for (v1[0] = &v4; v1[0]; v1[0] = v1 + 1) { if (!strcmp(a0, v1[0])) break; } if (v1[1]) v0 = v1[1]; printf(gettext("\n%s online help: <%s>\n")); v2 = setlocale(0x5, NULL); if (v2 && strncmp(v2, "en_", 0x3)) fputs_unlocked(gettext("Report any translation bugs to <https: if (strcmp(a0, "[")) v23 = a0; else v23 = "test"; v3 = v23; printf(gettext("Full documentation <%s%s>\n")); printf(gettext("or available locally via: info '(coreutils) %s%s'\n")); v25 = *(&v18) ^ v24[5]; return; }
test_code_t test_heartbeat_extension(gnutls_session_t session) { if (tls_ext_ok == 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, 1352)) != TEST_SUCCEED) { return _ret; } }; gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred); gnutls_record_set_max_size(session, 4096); gnutls_heartbeat_enable(session, (1)); test_do_handshake(session); switch (gnutls_heartbeat_allowed(session, (1<<2))) { case 0: return TEST_FAILED; default: return TEST_SUCCEED; } }
long long test_heartbeat_extension(unsigned long long a0) { unsigned int v0; unsigned long long v2; if (!tls_ext_ok) { v2 = 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, 0x548); if (v0) { v2 = v0; } else { gnutls_credentials_set(a0, 0x1, xcred); gnutls_record_set_max_size(a0, 0x1000); gnutls_heartbeat_enable(a0, 0x1); test_do_handshake(a0); if (!gnutls_heartbeat_allowed(a0, 0x4)) v2 = 1; else v2 = 0; } } return v2; }
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); }
void dns_lookup(char *param_1,socklen_t param_2,int param_3,int *param_4) { uint32_t uVar1; bool bVar2; uint32_t uVar3; long in_FS_OFFSET; socklen_t local_5c; sockaddr *local_50; undefined local_48 [4]; int local_44; undefined local_38 [8]; undefined local_30 [32]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); bVar2 = false; if ((*param_4 == 0) && (param_4[1] == 0)) { uVar1 = param_4[2]; uVar3 = htonl(0xffff); if (uVar1 == uVar3) { bVar2 = true; } } if ((bVar2) || (((param_4[1] == 0 && (param_4[2] == 0)) && (param_4[3] == 0)))) { local_48._0_2_ = 2; local_48._2_2_ = 0; if (bVar2) { local_44 = param_4[3]; } else { local_44 = *param_4; } local_50 = (sockaddr *)local_48; local_5c = 0x10; } else { memset(local_38,0,0x1c); local_38._0_2_ = 10; local_38._2_2_ = 0; memcpy(local_30,param_4,0x10); local_50 = (sockaddr *)local_38; local_5c = 0x1c; } getnameinfo(local_50,local_5c,param_1,param_2,(char *)0x0,0,(uint)(param_3 != 0)); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
WORD_DESC * make_bare_word (string) const char *string; { WORD_DESC *temp; temp = alloc_word_desc (); if (*string) temp->word = (char *)strcpy (sh_xmalloc((1 + strlen (string)), "make_cmd.c", 91), (string)); else { temp->word = (char *)sh_xmalloc((1), "make_cmd.c", 94); temp->word[0] = '\0'; } return (temp); }
int make_bare_word(char *a0) { char **v0; v0 = alloc_word_desc(); if (!*(a0)) { *(v0) = sh_xmalloc(0x1, "make_cmd.c", 0x5e); *(*(v0)) = 0; return v0; } *(v0) = strcpy(sh_xmalloc(strlen(a0) + 1, "make_cmd.c", 0x5b), a0); return v0; }
static int console_open(int mode) { int f, fd = -1; int m; m = mode | 04000 ; for(f = 0; f < 5; f++) { if ((fd = open(console_dev, m)) >= 0) break; usleep(10000); } if (fd < 0) return fd; if (m != mode) fcntl(fd, 4 , mode); return fd; }
int console_open(unsigned long a0) { unsigned int v0; int tmp_25; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v5; v0 = a0; v2 = -1; v5 = v0; *(&v5) = (v0 >> 8) | 8; tmp_25 = v5; v3 = tmp_25; for (v1 = 0; v1 <= 4 && (v2 = open(0x48b48640c247c89, v3, v3), v2 < 0); v1 += 1) { usleep(0x2710); } if (v2 < 0) { v5 = v2; return v5; } if (v3 != v0) fcntl(v2, 0x4); v5 = v2; return v5; }
void posix_initialize (on) int on; { if (on != 0) { interactive_comments = source_uses_path = expand_aliases = 1; inherit_errexit = 1; source_searches_cwd = 0; print_shift_error = 1; } else if (saved_posix_vars) { set_posix_options (saved_posix_vars); sh_xfree((saved_posix_vars), "general.c", 119); saved_posix_vars = 0; } else { source_searches_cwd = 1; expand_aliases = interactive_shell; print_shift_error = 0; } }
long long posix_initialize(unsigned long a0) { unsigned long long v1; if (a0) { expand_aliases = 1; source_uses_path = expand_aliases; v1 = source_uses_path; interactive_comments = source_uses_path; inherit_errexit = 1; source_searches_cwd = 0; print_shift_error = 1; } else if (!saved_posix_vars) { source_searches_cwd = 1; v1 = interactive_shell; expand_aliases = interactive_shell; print_shift_error = 0; } else { set_posix_options(saved_posix_vars); v1 = sh_xfree(saved_posix_vars, "general.c", 0x77); saved_posix_vars = 0; } return v1; }
static _Bool parse_rxsci(int *argcp, char ***argvp, struct rxsc_desc *rxsc, struct sa_desc *rxsa) { struct sci sci = { 0 }; if (*argcp == 0 || get_sci_portaddr(&sci, argcp, argvp, 0 , 0 ) < 0) { fprintf( stderr , "expected sci\n"); ipmacsec_usage(); } rxsc->sci = sci.sci; return get_sa(argcp, argvp, &rxsa->an); }
int parse_rxsci(unsigned int *a0, unsigned long long *a1, struct_0 *a2, char *a3) { void* v0; void* v1; unsigned long long v3; v0 = 0; v1 = 0; if (*(a0)) { v3 = get_sci_portaddr(&v0, a0, a1, 0x0, 0x0); if (v3 >= 0) { a2->field_8 = v0; return get_sa(a0, a1, a3); } } if (!*(a0) || v3 < 0) { fprintf(stderr, "expected sci\n"); ipmacsec_usage(); } }
rsRetVal queryLocalHostname(void) { uchar *LocalHostName = ((void *)0) ; uchar *LocalDomain = ((void *)0) ; uchar *LocalFQDNName; rsRetVal iRet = RS_RET_OK; if((iRet = net.getLocalHostname(&LocalFQDNName)) != RS_RET_OK) goto finalize_it; uchar *dot = (uchar*) strstr((char*)LocalFQDNName, "."); if(dot == ((void *)0) ) { if((LocalHostName = (uchar*) strdup((char*)LocalFQDNName)) == ((void *)0) ) do { iRet = RS_RET_OUT_OF_MEMORY; goto finalize_it; } while (0); if((LocalDomain = (uchar*)strdup("")) == ((void *)0) ) do { iRet = RS_RET_OUT_OF_MEMORY; goto finalize_it; } while (0); } else { const size_t lenhn = dot - LocalFQDNName; if((LocalHostName = (uchar*) strndup((char*) LocalFQDNName, lenhn)) == ((void *)0) ) do { iRet = RS_RET_OUT_OF_MEMORY; goto finalize_it; } while (0); if((LocalDomain = (uchar*) strdup((char*) dot+1)) == ((void *)0) ) do { iRet = RS_RET_OUT_OF_MEMORY; goto finalize_it; } while (0); } glbl.SetLocalFQDNName(LocalFQDNName); glbl.SetLocalHostName(LocalHostName); glbl.SetLocalDomain(LocalDomain); glbl.GenerateLocalHostNameProperty(); LocalHostName = ((void *)0) ; LocalDomain = ((void *)0) ; finalize_it: free(LocalHostName); free(LocalDomain); return iRet; }
int queryLocalHostname(void) { long in_FS_OFFSET; int local_3c; char *local_38; char *local_30; char *local_28; char *local_20; size_t local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_30 = (char *)0x0; local_28 = (char *)0x0; local_3c = (*net._72_8_)(&local_38); if (local_3c != 0) goto LAB_001001b1; local_20 = strstr(local_38,"."); if (local_20 == (char *)0x0) { local_30 = strdup(local_38); if (local_30 == (char *)0x0) { local_3c = -6; goto LAB_001001b1; } local_28 = strdup(""); if (local_28 == (char *)0x0) { local_3c = -6; goto LAB_001001b1; } } else { local_18 = (long)local_20 - (long)local_38; local_30 = strndup(local_38,local_18); if (local_30 == (char *)0x0) { local_3c = -6; goto LAB_001001b1; } local_28 = strdup(local_20 + 1); if (local_28 == (char *)0x0) { local_3c = -6; goto LAB_001001b1; } } (*glbl._64_8_)(local_38); (*glbl._96_8_)(local_30); (*glbl._112_8_)(local_28); (*glbl._120_8_)(); local_30 = (char *)0x0; local_28 = (char *)0x0; LAB_001001b1: free(local_30); free(local_28); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return local_3c; }
int sshbuf_put_u8(struct sshbuf *buf, u_char val) { u_char *p; int r; if ((r = sshbuf_reserve(buf, 1, &p)) < 0) return r; p[0] = val; return 0; }
long sshbuf_put_u8(long a1, char a2) { int v3; long v4[2]; v4[1] = __readfsqword(0x28u); v3 = sshbuf_reserve(a1, 1LL, v4); if ( v3 < 0 ) return (unsigned int)v3; *(_BYTE *)v4[0] = a2; return 0LL; }
static int optloc_eq (struct option_locus *a, struct option_locus *b) { if (a->source != b->source) return 0; if (a->source == OPTS_COMMAND_LINE) return 1; return strcmp (a->name, b->name) == 0; }
bool optloc_eq(int *param_1,int *param_2) { int iVar1; bool bVar2; if (*param_1 == *param_2) { if (*param_1 == 1) { bVar2 = true; } else { iVar1 = strcmp(*(char **)(param_1 + 2),*(char **)(param_2 + 2)); bVar2 = iVar1 == 0; } } else { bVar2 = false; } return bVar2; }
int sshpkt_putb(struct ssh *ssh, const struct sshbuf *b) { return sshbuf_putb(ssh->state->outgoing_packet, b); }
void sshpkt_putb(long *param_1,undefined8 param_2) { sshbuf_putb(*(undefined8 *)(*param_1 + 0x30),param_2); return; }
void construct_utmp(struct logininfo *li, struct utmp *ut) { struct sockaddr_in6 *sa6; memset(ut, '\0', sizeof(*ut)); line_abbrevname(ut->ut_id, li->line, sizeof(ut->ut_id)); switch (li->type) { case 7: ut->ut_type = 7 ; break; case 8: ut->ut_type = 8 ; break; } set_utmp_time(li, ut); line_stripname(ut->ut_line, li->line, sizeof(ut->ut_line)); ut->ut_pid = li->pid; if (li->type == 8) return; strncpy(ut-> ut_user , li->username, (sizeof(ut-> ut_user ) < sizeof(li->username) ? sizeof(ut-> ut_user ) : sizeof(li->username))); strncpy(ut->ut_host, li->hostname, (sizeof(ut->ut_host) < sizeof(li->hostname) ? sizeof(ut->ut_host) : sizeof(li->hostname))); if (li->hostaddr.sa.sa_family == 2 ) ut-> ut_addr_v6[0] = li->hostaddr.sa_in.sin_addr.s_addr; if (li->hostaddr.sa.sa_family == 10 ) { sa6 = ((struct sockaddr_in6 *)&li->hostaddr.sa); memcpy(ut->ut_addr_v6, sa6->sin6_addr. __in6_u.__u6_addr8 , 16); if ( (__extension__ ({ const struct in6_addr *__a = (const struct in6_addr *) ( &sa6->sin6_addr ); __a->__in6_u.__u6_addr32[0] == 0 && __a->__in6_u.__u6_addr32[1] == 0 && __a->__in6_u.__u6_addr32[2] == htonl (0xffff); })) ) { ut->ut_addr_v6[0] = ut->ut_addr_v6[3]; ut->ut_addr_v6[1] = 0; ut->ut_addr_v6[2] = 0; ut->ut_addr_v6[3] = 0; } } }
void construct_utmp(struct_0 *a0, struct_1 *a1) { unsigned long v0; unsigned int v1[3]; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; struct_1 *v7; memset(a1, 0x0, 0x180); line_abbrevname(&a1->padding_8[32], &a0->padding_4c[4], 0x4); if (a0->field_44 == 7) { a1->field_0 = 7; } else if (a0->field_44 == 8) { a1->field_0 = 8; } set_utmp_time(a0, a1); line_stripname(&a1->padding_8, &a0->padding_4c[4], 0x20); a1->field_4 = a0->field_48; v3 = a0->field_44; if (a0->field_44 != 8) { strncpy(&a1->padding_8[36], &a0->padding_4c[68], 0x20); strncpy(&a1->padding_8[68], &a0->padding_4c[580], 0x100); if (a0->field_3a0 == 2) a1->field_15c = a0->field_3a4; v4 = a0->field_3a0; if (a0->field_3a0 == 10) { v0 = &a0->field_3a0; memcpy(&a1->field_15c, v0 + 8, 0x10); *(&v1[0]) = v0 + 8; if (!v1[0] && !v1[1]) { v5 = htonl(0xffff); if (v1[2] == v5) v6 = 1; } if (v1[0] || v1[1] || v1[2] != v5) v6 = 0; if (v6) { a1->field_15c = a1->field_168; a1->field_160 = 0; a1->field_164 = 0; v7 = a1; a1->field_168 = 0; } } } return; }
static int pkcs11_rsa_start_wrapper(void) { if (rsa_method != ((void *)0) ) return (0); rsa_method = RSA_meth_dup(RSA_get_default_method()); if (rsa_method == ((void *)0) ) return (-1); rsa_idx = CRYPTO_get_ex_new_index(9, 0 , "ssh-pkcs11-rsa" , ((void *)0), ((void *)0), pkcs11_k11_free ) ; if (rsa_idx == -1) return (-1); if (!RSA_meth_set1_name(rsa_method, "pkcs11") || !RSA_meth_set_priv_enc(rsa_method, pkcs11_rsa_private_encrypt) || !RSA_meth_set_priv_dec(rsa_method, pkcs11_rsa_private_decrypt)) { sshlog("ssh-pkcs11.c", __func__, 478, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "setup pkcs11 method failed"); return (-1); } return (0); }
long pkcs11_rsa_start_wrapper() { long default_method; if ( rsa_method ) return 0LL; default_method = RSA_get_default_method(); rsa_method = RSA_meth_dup(default_method); if ( !rsa_method ) return 0xFFFFFFFFLL; rsa_idx = CRYPTO_get_ex_new_index(9LL, 0LL, "ssh-pkcs11-rsa", 0LL, 0LL, pkcs11_k11_free); if ( rsa_idx == -1 ) return 0xFFFFFFFFLL; if ( (unsigned int)RSA_meth_set1_name(rsa_method, "pkcs11") && (unsigned int)RSA_meth_set_priv_enc(rsa_method, pkcs11_rsa_private_encrypt) && (unsigned int)RSA_meth_set_priv_dec(rsa_method, pkcs11_rsa_private_decrypt) ) { return 0LL; } sshlog("ssh-pkcs11.c", "pkcs11_rsa_start_wrapper", 478LL, 1LL, 2LL, 0LL, "setup pkcs11 method failed"); return 0xFFFFFFFFLL; }
static inline ext2_ino_t *quota_sb_inump(struct ext2_super_block *sb, enum quota_type qtype) { switch (qtype) { case USRQUOTA: return &sb->s_usr_quota_inum; case GRPQUOTA: return &sb->s_grp_quota_inum; case PRJQUOTA: return &sb->s_prj_quota_inum; default: return ((void *)0) ; } return ((void *)0) ; }
long quota_sb_inump(long a1, unsigned int a2) { if ( a2 == 2 ) return a1 + 620; if ( a2 > 2 ) return 0LL; if ( a2 ) return a1 + 580; return a1 + 576; }
static void init_RL ( EState* s ) { s->state_in_ch = 256; s->state_in_len = 0; }
void init_RL(long param_1) { *(undefined4 *)(param_1 + 0x5c) = 0x100; *(undefined4 *)(param_1 + 0x60) = 0; return; }
static int mptcp_addr_flush(int argc, char **argv) { struct { struct nlmsghdr n; struct genlmsghdr g; char buf[( ((0)+4U -1) & ~(4U -1) ) + (4096)]; } req = { .n = { .nlmsg_type = (genl_family), .nlmsg_flags = (0x01), .nlmsg_len = ((( ((sizeof(struct genlmsghdr))+4U -1) & ~(4U -1) ) + (0)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))), }, .g = { .cmd = (MPTCP_PM_CMD_FLUSH_ADDRS), .version = (0x1), }, }; if (rtnl_talk(&genl_rth, &req.n, ((void *)0) ) < 0) return -2; return 0; }
void mptcp_addr_flush(unsigned long a0, unsigned long a1) { unsigned long v0; unsigned int v1; unsigned int v2; unsigned short v3; unsigned short v4; char v5; char v6; unsigned long long v7; unsigned long long v9; void* v10; unsigned long v11; unsigned long long v13; void* v14; v7 = *(&v7); v1 = a0; v0 = a1; v9 = 514; for (v10 = &v2; v9; v10 += v11 * 8) { v9 -= 1; v2 = 0; } *(v10) = 0; v2 = 20; v3 = genl_family; v4 = 1; v5 = 4; v6 = 1; if (rtnl_talk(&genl_rth, &v2, 0x0) < 0) v13 = 4294967294; else v14 = 0; return; }
static void hdlr_sigchld(void) { pthread_mutex_lock(&mutChildDied); bChildDied = 1; pthread_mutex_unlock(&mutChildDied); }
void hdlr_sigchld(void) { pthread_mutex_lock((pthread_mutex_t *)mutChildDied); bChildDied = 1; pthread_mutex_unlock((pthread_mutex_t *)mutChildDied); return; }
int main(int argc, char **argv) { char *tty = ((void *)0) ; struct passwd *pwd; int c, status = 0; int reconnect = 0; int opt_e = 0; struct console *con; pid_t pid; if ((pid = getpid()) == 1) { setsid(); (void)ioctl(0, 0x540E , (char *)1); } opterr = 0; while((c = getopt(argc, argv, "ept:")) != (-1) ) switch(c) { case 't': timeout = atoi(optarg); break; case 'p': profile = 1; break; case 'e': opt_e = 1; break; default: usage(); break; } if (geteuid() != 0) { fprintf( stderr , "sulogin: only root can run sulogin.\n\r"); exit(1); } saved_sigint = signal( 2 , ((__sighandler_t) 1) ); saved_sigquit = signal( 3 , ((__sighandler_t) 1) ); saved_sigtstp = signal( 20 , ((__sighandler_t) 1) ); saved_sighup = signal( 1 , ((__sighandler_t) 1) ); if (optind < argc) tty = argv[optind]; if (!tty || *tty == '\0') tty = getenv("CONSOLE"); reconnect = detect_consoles(tty, 0); if (!consoles) { if (! (*__errno_location ()) ) (*__errno_location ()) = 12 ; fprintf( stderr , "sulogin: cannot open console: %m\n\r"); exit(1); } if (reconnect) { if (isatty(1) == 0) dup2(0, 1); if (isatty(2) == 0) dup2(0, 2); } if ((pwd = getrootpwent(opt_e)) == ((void *)0) ) { fprintf( stderr , "sulogin: cannot open password database!\n\r"); sleep(2); } for (con = consoles; con && con->id < 16; con = con->next) { if (con->fd >= 0) { openfd |= (1<<con->fd); tcinit(con); continue; } if ((con->fd = open(con->tty, 02 | 0400 | 04000 )) < 0) continue; openfd |= (1<<con->fd); tcinit(con); } con = consoles; usemask = (uint32_t*)mmap( ((void *)0) , sizeof(uint32_t), 0x1 | 0x2 , 0x20 | 0x01 , -1, 0); if (con->next == (struct console*)0) goto nofork; signal( 17 , chld_handler); do { switch ((con->pid = fork())) { case 0: signal( 17 , ((__sighandler_t) 0) ); nofork: setup(con); while (1) { char *passwd = pwd->pw_passwd; char *answer; int failed = 0, doshell = 0; doprompt(passwd, con); if ((answer = getpasswd(con)) == ((void *)0) ) break; if (passwd[0] == '\0') doshell++; else { char *cryptbuf; cryptbuf = crypt(answer, passwd); if (cryptbuf == ((void *)0) ) fprintf( stderr , "sulogin: crypt failed: %m\n\r"); else if (strcmp(cryptbuf, pwd->pw_passwd) == 0) doshell++; } if (doshell) { *usemask |= (1<<con->id); sushell(pwd); *usemask &= ~(1<<con->id); failed++; } signal( 3 , ((__sighandler_t) 1) ); signal( 20 , ((__sighandler_t) 1) ); signal( 2 , ((__sighandler_t) 1) ); if (failed) { fprintf( stderr , "sulogin: can not execute su shell.\n\r"); break; } fprintf( stderr , "Login incorrect.\n\r"); sleep(3); } if (alarm_rised) { tcfinal(con); fprintf( stderr , "Timed out.\n\r"); } exit(0); case -1: fprintf( stderr , "sulogin: can not fork: %m\n\r"); default: break; } } while ((con = con->next) && (con->id < 16)); while ((pid = wait(&status))) { if ( (*__errno_location ()) == 10 ) break; if (pid < 0) continue; for (con = consoles; con && con->id < 16; con = con->next) { if (con->pid == pid) { *usemask &= ~(1<<con->id); continue; } if (kill(con->pid, 0) < 0) { *usemask &= ~(1<<con->id); continue; } if (*usemask & (1<<con->id)) continue; kill(con->pid, 1 ); usleep(5000); kill(con->pid, 9 ); } } signal( 17 , ((__sighandler_t) 0) ); return 0; }
int main(unsigned long a0, unsigned long long *a1) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; void* v7; struct_0 *v8; struct_1 *v9; char *v10; char *v11; char *v12; unsigned int v15; v7 = 0; v0 = 0; v4 = 0; v1 = 0; v5 = getpid(); if (v5 == 1) { setsid(); ioctl(0x0, 0x540e); } opterr = 0; while (true) { v6 = getopt(a0, a1, "ept:"); if (v6 == -1) break; switch (v6) { case 116: timeout = atoi(optarg); break; case 101: v1 = 1; break; case 112: profile = 1; break; default: usage(); break; } } if (geteuid()) { fprintf(*(&stderr), "sulogin: only root can run sulogin.\n\r"); exit(0x1); } saved_sigint = signal(0x2, 0x1); saved_sigquit = signal(0x3, 0x1); saved_sigtstp = signal(0x14, 0x1); saved_sighup = signal(0x1, 0x1); if (a0 > optind) v7 = a1[optind]; if (!v7 || !*(v7)) v7 = getenv("CONSOLE"); v4 = detect_consoles(v7, 0x0); if (consoles) { if (v4) { if (!isatty(0x1)) dup2(0x0, 0x1); if (!isatty(0x2)) dup2(0x0, 0x2); } v9 = getrootpwent(v1); if (!v9) { fprintf(*(&stderr), "sulogin: cannot open password database!\n\r"); sleep(0x2); } for (v8 = consoles; v8 && v8->field_18 <= 15; v8 = v8->field_60) { if (v8->field_14 >= 0) { openfd = openfd | (1 << (v8->field_14 & 31)); tcinit(v8); } else { v8->field_14 = open(*(&v8->field_0), 0x902, v8); if (v8->field_14 >= 0) { openfd = openfd | (1 << (v8->field_14 & 31)); tcinit(v8); } } } v8 = consoles; usemask = mmap(NULL, 0x4, 0x3, 0x21, 0xffffffff, 0x0); if (v8->field_60) { signal(0x11, chld_handler); while (true) { v8->field_1c = fork(); if (v8->field_1c == -1) { fprintf(*(&stderr), "sulogin: can not fork: %m\n\r"); } else if (!v8->field_1c) { signal(0x11, 0x0); break; } v8 = v8->field_60; if (!(v8) || !(v8->field_18 <= 15)) { while (true) { v5 = wait(&v0); if (!(v5) || !((v15 = *(__errno_location()), v15 != 10))) break; if (v5 < 0) continue; for (v8 = consoles; v8 && v8->field_18 <= 15; v8 = v8->field_60) { if (v5 == v8->field_1c) { *(usemask) = *(usemask) & !((1 << (v8->field_18 & 31))); } else if (kill(v8->field_1c, 0x0) < 0) { *(usemask) = *(usemask) & !((1 << (v8->field_18 & 31))); } else if (!((1 << (v8->field_18 & 31)) & *(usemask))) { kill(v8->field_1c, 0x1); usleep(0x1388); kill(v8->field_1c, 0x9); } } } signal(0x11, 0x0); return 0; } } } setup(v8); while (true) { v10 = v9->field_8; v2 = 0; v3 = 0; doprompt(v10, v8); v11 = getpasswd(v8); if (!v11) break; if (!*(v10)) { v3 += 1; } else { v12 = crypt(v11, v10); if (!v12) { fprintf(*(&stderr), "sulogin: crypt failed: %m\n\r"); } else if (!strcmp(v12, v9->field_8)) { v3 += 1; } } if (v3) { *(usemask) = *(usemask) | (1 << (v8->field_18 & 31)); sushell(v9); *(usemask) = *(usemask) & !((1 << (v8->field_18 & 31))); v2 += 1; } signal(0x3, 0x1); signal(0x14, 0x1); signal(0x2, 0x1); if (v2) { fprintf(*(&stderr), "sulogin: can not execute su shell.\n\r"); break; } else { fprintf(*(&stderr), "Login incorrect.\n\r"); sleep(0x3); } } if (alarm_rised) { tcfinal(v8); fprintf(*(&stderr), "Timed out.\n\r"); } exit(0x0); } else { if (!*(__errno_location())) *(__errno_location()) = 12; fprintf(*(&stderr), "sulogin: cannot open console: %m\n\r"); exit(0x1); } }
void rl_resize_terminal (void) { int width, height; width = _rl_screenwidth; height = _rl_screenheight; _rl_get_screen_size (fileno (rl_instream), 1); if (_rl_echoing_p && (width != _rl_screenwidth || height != _rl_screenheight)) { if ((rl_redisplay_function != rl_redisplay)) rl_forced_update_display (); else if ((rl_readline_state & (0x1000000)) == 0) _rl_redisplay_after_sigwinch (); } }
void rl_resize_terminal(void) { int iVar1; int iVar2; int iVar3; iVar2 = _rl_screenheight; iVar1 = _rl_screenwidth; iVar3 = fileno(rl_instream); _rl_get_screen_size(iVar3,1); if ((_rl_echoing_p != 0) && ((iVar1 != _rl_screenwidth || (iVar2 != _rl_screenheight)))) { if (rl_redisplay_function == lRam00000000001003a4) { if ((rl_readline_state & 0x1000000) == 0) { _rl_redisplay_after_sigwinch(); } } else { rl_forced_update_display(); } } return; }
static void out_epoch_sec (char *pformat, size_t prefix_len, struct timespec arg) { char *dot = memchr (pformat, '.', prefix_len); size_t sec_prefix_len = prefix_len; int width = 0; int precision = 0; _Bool frac_left_adjust = 0 ; if (dot) { sec_prefix_len = dot - pformat; pformat[prefix_len] = '\0'; if (((unsigned int) (dot[1]) - '0' <= 9)) { long int lprec = strtol (dot + 1, ((void *)0) , 10); precision = (lprec <= 0x7fffffff ? lprec : 0x7fffffff); } else { precision = 9; } if (precision && ((unsigned int) (dot[-1]) - '0' <= 9)) { char *p = dot; *dot = '\0'; do --p; while (((unsigned int) (p[-1]) - '0' <= 9)); long int lwidth = strtol (p, ((void *)0) , 10); width = (lwidth <= 0x7fffffff ? lwidth : 0x7fffffff); if (1 < width) { p += (*p == '0'); sec_prefix_len = p - pformat; int w_d = (decimal_point_len < width ? width - decimal_point_len : 0); if (1 < w_d) { int w = w_d - precision; if (1 < w) { char *dst = pformat; for (char const *src = dst; src < p; src++) { if (*src == '-') frac_left_adjust = 1 ; else *dst++ = *src; } sec_prefix_len = (dst - pformat + (frac_left_adjust ? 0 : sprintf (dst, "%d", w))); } } } } } int divisor = 1; for (int i = precision; i < 9; i++) divisor *= 10; int frac_sec = arg.tv_nsec / divisor; int int_len; if ((! ((time_t) 0 < (time_t) -1))) { _Bool minus_zero = 0 ; if (arg.tv_sec < 0 && arg.tv_nsec != 0) { int frac_sec_modulus = 1000000000 / divisor; frac_sec = (frac_sec_modulus - frac_sec - (arg.tv_nsec % divisor != 0)); arg.tv_sec += (frac_sec != 0); minus_zero = (arg.tv_sec == 0); } int_len = (minus_zero ? out_minus_zero (pformat, sec_prefix_len) : out_int (pformat, sec_prefix_len, arg.tv_sec)); } else int_len = out_uint (pformat, sec_prefix_len, arg.tv_sec); if (precision) { int prec = (precision < 9 ? precision : 9); int trailing_prec = precision - prec; int ilen = (int_len < 0 ? 0 : int_len); int trailing_width = (ilen < width && decimal_point_len < width - ilen ? width - ilen - decimal_point_len - prec : 0); printf ("%s%.*d%-*.*d", decimal_point, prec, frac_sec, trailing_width, trailing_prec, 0); } }
void out_epoch_sec(char *param_1,char *param_2,long param_3,long param_4) { char cVar1; char *__nptr; int iVar2; uint uVar3; int iVar4; long lVar5; char *pcVar6; uint uVar7; bool bVar8; undefined8 uVar9; long local_a8; int local_84; uint local_80; int local_7c; uint local_78; uint local_74; char *local_50; char *local_48; char *local_40; char *local_38; local_48 = (char *)memchr(param_1,0x2e,(size_t)param_2); local_84 = 0; local_80 = 0; bVar8 = false; local_50 = param_2; if (local_48 != (char *)0x0) { local_50 = local_48 + -(long)param_1; param_1[(long)param_2] = '\0'; if ((int)local_48[1] - 0x30U < 10) { lVar5 = strtol(local_48 + 1,(char **)0x0,10); local_80 = 0x7fffffff; if (lVar5 < 0x80000000) { local_80 = (uint)lVar5; } } else { local_80 = 9; } if ((local_80 != 0) && ((int)local_48[-1] - 0x30U < 10)) { *local_48 = '\0'; do { __nptr = local_48 + -1; pcVar6 = local_48 + -2; local_48 = __nptr; } while ((int)*pcVar6 - 0x30U < 10); lVar5 = strtol(__nptr,(char **)0x0,10); local_84 = 0x7fffffff; if (lVar5 < 0x80000000) { local_84 = (int)lVar5; } if (1 < local_84) { cVar1 = *__nptr; local_50 = __nptr + (cVar1 == '0') + -(long)param_1; if (decimal_point_len < (ulong)(long)local_84) { iVar2 = local_84 - (int)decimal_point_len; } else { iVar2 = 0; } if ((1 < iVar2) && (local_40 = param_1, local_38 = param_1, 1 < (int)(iVar2 - local_80))) { for (; local_38 < __nptr + (cVar1 == '0'); local_38 = local_38 + 1) { if (*local_38 == '-') { bVar8 = true; } else { *local_40 = *local_38; local_40 = local_40 + 1; } } if (bVar8) { lVar5 = 0; } else { iVar2 = sprintf(local_40,"%d",(ulong)(iVar2 - local_80)); lVar5 = (long)iVar2; } local_50 = local_40 + (lVar5 - (long)param_1); } } } } local_7c = 1; for (local_78 = local_80; (int)local_78 < 9; local_78 = local_78 + 1) { local_7c = local_7c * 10; } local_74 = (uint)(param_4 / (long)local_7c); bVar8 = false; local_a8 = param_3; if ((param_3 < 0) && (param_4 != 0)) { local_74 = ((int)(1000000000 / (long)local_7c) - local_74) - (uint)(param_4 % (long)local_7c != 0); local_a8 = (ulong)(local_74 != 0) + param_3; bVar8 = local_a8 == 0; } if (bVar8) { uVar9 = 0x101e81; iVar2 = out_minus_zero(param_1,local_50); } else { uVar9 = 0x101ea0; iVar2 = out_int(param_1,local_50,local_a8); } if (local_80 != 0) { uVar3 = 9; if ((int)local_80 < 10) { uVar3 = local_80; } iVar4 = 0; if (-1 < iVar2) { iVar4 = iVar2; } if ((iVar4 < local_84) && (decimal_point_len < (ulong)(long)(local_84 - iVar4))) { uVar7 = ((local_84 - iVar4) - (int)decimal_point_len) - uVar3; } else { uVar7 = 0; } printf("%s%.*d%-*.*d",decimal_point,(ulong)uVar3,(ulong)local_74,(ulong)uVar7, (ulong)(local_80 - uVar3),0,uVar9); } return; }
static void print_pathname(FILE *f, ext2_filsys fs, ext2_ino_t dir, ext2_ino_t ino) { errcode_t retval = 0; char *path; if (!dir && (ino < 11)) { fputs((gettext (special_inode_name[ino])), f); return; } if (fs) retval = ext2fs_get_pathname(fs, dir, ino, &path); if (!fs || retval) fputs("???", f); else { safe_print(f, path, -1); ext2fs_free_mem(&path); } }
void print_pathname(void* a0, unsigned long long a1, unsigned long a2, unsigned long a3) { char v0; void* v1; char v2; unsigned long long *v4; unsigned long long v5; v1 = 0; if (!a2 && a3 <= 10) { fputs(gettext((&special_inode_name)[a3]), a0); goto LABEL_400194; } if (a1) v1 = ext2fs_get_pathname(a1, a2, a3, &v0); if (!a1) { LABEL_40015b: fputs("???", a0); } else { if (!(!v1)) goto LABEL_40015b; safe_print(a0, *(&v0), 0xffffffff); ext2fs_free_mem(&v0); } LABEL_400194: v5 = *(&v2) ^ v4[5]; return; }
static crypto_uint32 times38(crypto_uint32 a) { return (a << 5) + (a << 2) + (a << 1); }
int times38(unsigned long a0) { return a0 * 2 + (a0 * 36); }
void transform_stat_info (int typeflag, struct tar_stat_info *stat_info) { if (typeflag == 'V') return; transform_member_name (&stat_info->file_name, 0x01); switch (typeflag) { case '2': transform_member_name (&stat_info->link_name, 0x04); break; case '1': transform_member_name (&stat_info->link_name, 0x02); } if (one_top_level_option) enforce_one_top_level (&current_stat_info.file_name); }
void transform_stat_info(unsigned long a0, unsigned long a1) { unsigned long long v1; unsigned long long v2; if (a0 == 86) return; transform_member_name(a1 + 8, 0x1); switch (a0) { case 49: transform_member_name(a1 + 24, 0x2); case 50: transform_member_name(a1 + 24, 0x4); break; default: goto LABEL_4002cd; } LABEL_4002cd: v1 = one_top_level_option; if (one_top_level_option) { v2 = enforce_one_top_level(name_gather); return; } return; }
static _Bool do_stdin (void) { _Bool ok = 1 ; token_buffer tokenbuffer; init_tokenbuffer (&tokenbuffer); while ( 1 ) { size_t token_length = readtoken ( stdin , "\n\t ", sizeof ("\n\t ") - 1, &tokenbuffer); if (token_length == (size_t) -1) break; ok &= print_factors (tokenbuffer.buffer); } free (tokenbuffer.buffer); return ok; }
long long do_stdin() { char v0; unsigned long v1; char v2; char v3; v0 = 1; init_tokenbuffer(&v2); while (true) { v1 = readtoken(stdin, "\n\t ", 0x3, &v2); if (v1 == -1) break; v0 = (print_factors(*(&v3)) & v0); } free(*(&v3)); return v0; }
static int usage(void) { fprintf( stderr , "Usage: ip netns list\n" " ip netns add NAME\n" " ip netns attach NAME PID\n" " ip netns set NAME NETNSID\n" " ip [-all] netns delete [NAME]\n" " ip netns identify [PID]\n" " ip netns pids NAME\n" " ip [-all] netns exec [NAME] cmd ...\n" " ip netns monitor\n" " ip netns list-id [target-nsid POSITIVE-INT] [nsid POSITIVE-INT]\n" "NETNSID := auto | POSITIVE-INT\n"); exit(-1); }
void usage() { fprintf(stderr, "Usage:\tip netns list\n\tip netns add NAME\n\tip netns attach NAME PID\n\tip netns set NAME NETNSID\n\tip [-all] netns delete [NAME]\n\tip netns identify [PID]\n\tip netns pids NAME\n\tip [-all] netns exec [NAME] cmd ...\n\tip netns monitor\n\tip netns list-id [target-nsid POSITIVE-INT] [nsid POSITIVE-INT]\nNETNSID := auto | POSITIVE-INT\n"); exit(0xffffffff); }
static void mainSimpleSort ( UInt32* ptr, UChar* block, UInt16* quadrant, Int32 nblock, Int32 lo, Int32 hi, Int32 d, Int32* budget ) { Int32 i, j, h, bigN, hp; UInt32 v; bigN = hi - lo + 1; if (bigN < 2) return; hp = 0; while (incs[hp] < bigN) hp++; hp--; for (; hp >= 0; hp--) { h = incs[hp]; i = lo + h; while (((Bool)1)) { if (i > hi) break; v = ptr[i]; j = i; while ( mainGtU ( ptr[j-h]+d, v+d, block, quadrant, nblock, budget ) ) { ptr[j] = ptr[j-h]; j = j - h; if (j <= (lo + h - 1)) break; } ptr[j] = v; i++; if (i > hi) break; v = ptr[i]; j = i; while ( mainGtU ( ptr[j-h]+d, v+d, block, quadrant, nblock, budget ) ) { ptr[j] = ptr[j-h]; j = j - h; if (j <= (lo + h - 1)) break; } ptr[j] = v; i++; if (i > hi) break; v = ptr[i]; j = i; while ( mainGtU ( ptr[j-h]+d, v+d, block, quadrant, nblock, budget ) ) { ptr[j] = ptr[j-h]; j = j - h; if (j <= (lo + h - 1)) break; } ptr[j] = v; i++; if (*budget < 0) return; } } }
void mainSimpleSort(long param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4, int param_5,int param_6,int param_7,int *param_8) { int iVar1; char cVar2; int iVar3; int local_20; int local_1c; int local_18; iVar3 = (param_6 - param_5) + 1; if (1 < iVar3) { local_18 = 0; while (*(int *)(incs + (long)local_18 * 4) < iVar3) { local_18 = local_18 + 1; } LAB_00101ebe: local_18 = local_18 + -1; if (-1 < local_18) { iVar3 = *(int *)(incs + (long)local_18 * 4); local_20 = iVar3 + param_5; while (local_20 <= param_6) { iVar1 = *(int *)(param_1 + (long)local_20 * 4); local_1c = local_20; do { cVar2 = mainGtU(*(int *)(param_1 + (long)(local_1c - iVar3) * 4) + param_7,param_7 + iVar1 ,param_2,param_3,param_4,param_8); if (cVar2 == '\0') break; *(undefined4 *)(param_1 + (long)local_1c * 4) = *(undefined4 *)(param_1 + (long)(local_1c - iVar3) * 4); local_1c = local_1c - iVar3; } while (iVar3 + param_5 <= local_1c); *(int *)((long)local_1c * 4 + param_1) = iVar1; local_1c = local_20 + 1; if (param_6 < local_1c) break; iVar1 = *(int *)(param_1 + (long)local_1c * 4); do { cVar2 = mainGtU(*(int *)(param_1 + (long)(local_1c - iVar3) * 4) + param_7,param_7 + iVar1 ,param_2,param_3,param_4,param_8); if (cVar2 == '\0') break; *(undefined4 *)(param_1 + (long)local_1c * 4) = *(undefined4 *)(param_1 + (long)(local_1c - iVar3) * 4); local_1c = local_1c - iVar3; } while (iVar3 + param_5 <= local_1c); *(int *)((long)local_1c * 4 + param_1) = iVar1; local_1c = local_20 + 2; if (param_6 < local_1c) break; iVar1 = *(int *)(param_1 + (long)local_1c * 4); do { cVar2 = mainGtU(*(int *)(param_1 + (long)(local_1c - iVar3) * 4) + param_7,param_7 + iVar1 ,param_2,param_3,param_4,param_8); if (cVar2 == '\0') break; *(undefined4 *)(param_1 + (long)local_1c * 4) = *(undefined4 *)(param_1 + (long)(local_1c - iVar3) * 4); local_1c = local_1c - iVar3; } while (iVar3 + param_5 <= local_1c); *(int *)((long)local_1c * 4 + param_1) = iVar1; local_20 = local_20 + 3; if (*param_8 < 0) { return; } } goto LAB_00101ebe; } } return; }
int main (int argc, char **argv) { char *cwd_only[2]; _Bool max_depth_specified = 0 ; _Bool ok = 1 ; char *files_from = ((void *)0) ; int bit_flags = 0x0008; int symlink_deref_bits = 0x0010; _Bool opt_summarize_only = 0 ; cwd_only[0] = bad_cast ("."); cwd_only[1] = ((void *)0) ; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdout); exclude = new_exclude (); human_options (getenv ("DU_BLOCK_SIZE"), &human_output_opts, &output_block_size); while ( 1 ) { int oi = -1; int c = getopt_long (argc, argv, "0abd:chHklmst:xB:DLPSX:", long_options, &oi); if (c == -1) break; switch (c) { case '0': opt_nul_terminate_output = 1 ; break; case 'a': opt_all = 1 ; break; case APPARENT_SIZE_OPTION: apparent_size = 1 ; break; case 'b': apparent_size = 1 ; human_output_opts = 0; output_block_size = 1; break; case 'c': print_grand_total = 1 ; break; case 'h': human_output_opts = human_autoscale | human_SI | human_base_1024; output_block_size = 1; break; case HUMAN_SI_OPTION: human_output_opts = human_autoscale | human_SI; output_block_size = 1; break; case 'k': human_output_opts = 0; output_block_size = 1024; break; case 'd': { uintmax_t tmp; if (xstrtoumax (optarg, ((void *)0) , 0, &tmp, "") == LONGINT_OK && tmp <= (18446744073709551615UL) ) { max_depth_specified = 1 ; max_depth = tmp; } else { error (0, 0, gettext ("invalid maximum depth %s"), quote (optarg)); ok = 0 ; } } break; case 'm': human_output_opts = 0; output_block_size = 1024 * 1024; break; case 'l': opt_count_all = 1 ; break; case 's': opt_summarize_only = 1 ; break; case 't': { enum strtol_error e; e = xstrtoimax (optarg, ((void *)0) , 0, &opt_threshold, "kKmMGTPEZY0"); if (e != LONGINT_OK) xstrtol_fatal (e, oi, c, long_options, optarg); if (opt_threshold == 0 && *optarg == '-') { ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"invalid --threshold argument '-0'\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("invalid --threshold argument '-0'")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("invalid --threshold argument '-0'")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); } } break; case 'x': bit_flags |= 0x0040; break; case 'B': { enum strtol_error e = human_options (optarg, &human_output_opts, &output_block_size); if (e != LONGINT_OK) xstrtol_fatal (e, oi, c, long_options, optarg); } break; case 'H': case 'D': symlink_deref_bits = 0x0001 | 0x0010; break; case 'L': symlink_deref_bits = 0x0002; break; case 'P': symlink_deref_bits = 0x0010; break; case 'S': opt_separate_dirs = 1 ; break; case 'X': if (add_exclude_file (add_exclude, exclude, optarg, (1 << 28), '\n')) { error (0, (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, optarg)); ok = 0 ; } break; case FILES0_FROM_OPTION: files_from = optarg; break; case EXCLUDE_OPTION: add_exclude (exclude, optarg, (1 << 28)); break; case INODES_OPTION: opt_inodes = 1 ; break; case TIME_OPTION: opt_time = 1 ; time_type = (optarg ? ((time_types) [__xargmatch_internal ("--time", optarg, time_args, (void const *) (time_types), sizeof *(time_types), argmatch_die, 1 )]) : time_mtime); localtz = tzalloc (getenv ("TZ")); break; case TIME_STYLE_OPTION: time_style = optarg; break; case GETOPT_HELP_CHAR: usage ( 0 ); break;; case GETOPT_VERSION_CHAR: version_etc ( stdout , "du", "GNU coreutils", Version, ("Torbjorn Granlund"), ("David MacKenzie"), ("Paul Eggert"), ("Jim Meyering"), (char *) ((void *)0) ); exit ( 0 ); break;; default: ok = 0 ; } } if (!ok) usage ( 1 ); if (opt_all && opt_summarize_only) { error (0, 0, gettext ("cannot both summarize and show all entries")); usage ( 1 ); } if (opt_summarize_only && max_depth_specified && max_depth == 0) { error (0, 0, gettext ("warning: summarizing is the same as using --max-depth=0")); } if (opt_summarize_only && max_depth_specified && max_depth != 0) { unsigned long int d = max_depth; error (0, 0, gettext ("warning: summarizing conflicts with --max-depth=%lu"), d); usage ( 1 ); } if (opt_summarize_only) max_depth = 0; if (opt_inodes) { if (apparent_size) { error (0, 0, gettext ("warning: options --apparent-size and -b are " "ineffective with --inodes") ); } output_block_size = 1; } if (opt_time) { if (! time_style) { time_style = getenv ("TIME_STYLE"); if (! time_style || (strcmp (time_style, "locale") == 0)) time_style = "long-iso"; else if (*time_style == '+') { char *p = strchr (time_style, '\n'); if (p) *p = '\0'; } else { static char const posix_prefix[] = "posix-"; static const size_t prefix_len = sizeof posix_prefix - 1; while ((strncmp (time_style, posix_prefix, prefix_len) == 0)) time_style += prefix_len; } } if (*time_style == '+') time_format = time_style + 1; else { switch (((time_style_types) [__xargmatch_internal ("time style", time_style, time_style_args, (void const *) (time_style_types), sizeof *(time_style_types), argmatch_die, 1 )]) ) { case full_iso_time_style: time_format = "%Y-%m-%d %H:%M:%S.%N %z"; break; case long_iso_time_style: time_format = "%Y-%m-%d %H:%M"; break; case iso_time_style: time_format = "%Y-%m-%d"; break; } } } struct argv_iterator *ai; if (files_from) { if (optind < argc) { error (0, 0, gettext ("extra operand %s"), quote (argv[optind])); fprintf ( stderr , "%s\n", gettext ("file operands cannot be combined with --files0-from")); usage ( 1 ); } if (! ((strcmp (files_from, "-") == 0) || freopen_safer (files_from, "r", stdin ))) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"cannot open %s for reading\"), quotearg_style (shell_escape_always_quoting_style, files_from)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , gettext ("cannot open %s for reading"), quotearg_style (shell_escape_always_quoting_style, files_from)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , gettext ("cannot open %s for reading"), quotearg_style (shell_escape_always_quoting_style, files_from)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; ai = argv_iter_init_stream ( stdin ); hash_all = 1 ; } else { char **files = (optind < argc ? argv + optind : cwd_only); ai = argv_iter_init_argv (files); hash_all = (optind + 1 < argc || symlink_deref_bits == 0x0002); } if (!ai) xalloc_die (); di_files = di_set_alloc (); if (!di_files) xalloc_die (); if (opt_count_all || ! hash_all) bit_flags |= 0x0100; bit_flags |= symlink_deref_bits; static char *temp_argv[] = { ((void *)0) , ((void *)0) }; while ( 1 ) { _Bool skip_file = 0 ; enum argv_iter_err ai_err; char *file_name = argv_iter (ai, &ai_err); if (!file_name) { switch (ai_err) { case AI_ERR_EOF: goto argv_iter_done; case AI_ERR_READ: error (0, (*__errno_location ()) , gettext ("%s: read error"), quotearg_n_style_colon (0, shell_escape_quoting_style, files_from)); ok = 0 ; goto argv_iter_done; case AI_ERR_MEM: xalloc_die (); default: ((void) sizeof (( !"unexpected error code from argv_iter" ) ? 1 : 0), __extension__ ({ if ( !"unexpected error code from argv_iter" ) ; else __assert_fail ( "!\"unexpected error code from argv_iter\"" , "src/du.c", 1081, __extension__ __PRETTY_FUNCTION__); })) ; } } if (files_from && (strcmp (files_from, "-") == 0) && (strcmp (file_name, "-") == 0)) { error (0, 0, gettext ("when reading file names from stdin, " "no file name of %s allowed") , quotearg_style (shell_escape_always_quoting_style, file_name)); skip_file = 1 ; } if (!file_name[0]) { if (files_from == ((void *)0) ) error (0, 0, "%s", gettext ("invalid zero-length file name")); else { unsigned long int file_number = argv_iter_n_args (ai); error (0, 0, "%s:%lu: %s", quotearg_n_style_colon (0, shell_escape_quoting_style, files_from), file_number, gettext ("invalid zero-length file name")); } skip_file = 1 ; } if (skip_file) ok = 0 ; else { temp_argv[0] = file_name; ok &= du_files (temp_argv, bit_flags); } } argv_iter_done: argv_iter_free (ai); di_set_free (di_files); if (di_mnt) di_set_free (di_mnt); if (files_from && (ferror_unlocked ( stdin ) || rpl_fclose ( stdin ) != 0) && ok) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"error reading %s\"), quotearg_style (shell_escape_always_quoting_style, files_from)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("error reading %s"), quotearg_style (shell_escape_always_quoting_style, files_from)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("error reading %s"), quotearg_style (shell_escape_always_quoting_style, files_from)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (print_grand_total) print_size (&tot_dui, gettext ("total")); return ok ? 0 : 1 ; }
byte main(int param_1,undefined8 *param_2) { uint uVar1; bool bVar2; bool bVar3; byte bVar4; int iVar5; char *pcVar6; undefined8 uVar7; long lVar8; int *piVar9; long in_FS_OFFSET; undefined8 uVar10; bool local_93; undefined4 local_90; uint local_8c; uint local_88; int local_84; int local_80; int local_7c; uint local_78; undefined4 uStack116; char *local_70; long local_68; long local_60; char *local_58; undefined8 *local_50; char *local_48; undefined8 local_40; undefined8 local_38; undefined8 local_30; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); bVar3 = false; local_93 = true; local_70 = (char *)0x0; local_8c = 8; local_88 = 0x10; bVar2 = false; local_38 = bad_cast(&DAT_00103507); local_30 = 0; set_program_name(*param_2); setlocale(6,""); bindtextdomain("coreutils","/usr/local/share/locale"); textdomain("coreutils"); atexit(p_Ram0000000000101467); exclude = new_exclude(); pcVar6 = getenv("DU_BLOCK_SIZE"); human_options(pcVar6,&human_output_opts,&output_block_size); LAB_0010149d: local_90 = 0xffffffff; uVar10 = 0x1014d3; local_84 = getopt_long(param_1,param_2,"0abd:chHklmst:xB:DLPSX:",long_options,&local_90); if (local_84 != -1) { if (0x87 < local_84) { switchD_00101554_caseD_31: local_93 = false; goto LAB_0010149d; } if (local_84 < 0x30) { if (local_84 == -0x83) { LAB_00101940: version_etc(stdout,&DAT_001033a4,"GNU coreutils",Version,"Torbjorn Granlund", "David MacKenzie","Paul Eggert","Jim Meyering",0,uVar10); exit(0); } if (local_84 == -0x82) { uVar10 = 0x101940; usage(0); goto LAB_00101940; } goto switchD_00101554_caseD_31; } switch(local_84) { case 0x30: opt_nul_terminate_output = 1; break; default: goto switchD_00101554_caseD_31; case 0x42: local_7c = human_options(optarg,&human_output_opts,&output_block_size); if (local_7c == 0) break; xstrtol_fatal(local_7c,local_90,(int)(char)local_84,long_options,optarg); case 0x44: case 0x48: local_88 = 0x11; break; case 0x4c: local_88 = 2; break; case 0x50: local_88 = 0x10; break; case 0x53: opt_separate_dirs = 1; break; case 0x58: iVar5 = add_exclude_file(uRam00000000001017fa,exclude,optarg,0x10000000,10); if (iVar5 != 0) { uVar10 = quotearg_n_style_colon(0,3,optarg); piVar9 = __errno_location(); error(0,*piVar9,&DAT_0010340a,uVar10); local_93 = false; } break; case 0x61: opt_all = '\x01'; break; case 0x62: apparent_size = '\x01'; human_output_opts = 0; output_block_size = 1; break; case 99: print_grand_total = '\x01'; break; case 100: iVar5 = xstrtoumax(optarg,0,0,&local_78,&DAT_0010259b); if (iVar5 == 0) { bVar3 = true; max_depth = CONCAT44(uStack116,local_78); } else { uVar10 = quote(optarg); uVar7 = gettext("invalid maximum depth %s"); error(0,0,uVar7,uVar10); local_93 = false; } break; case 0x68: human_output_opts = 0xb0; output_block_size = 1; break; case 0x6b: human_output_opts = 0; output_block_size = 0x400; break; case 0x6c: opt_count_all = '\x01'; break; case 0x6d: human_output_opts = 0; output_block_size = 0x100000; break; case 0x73: bVar2 = true; break; case 0x74: local_80 = xstrtoimax(optarg,0,0,&opt_threshold,"kKmMGTPEZY0"); if (local_80 != 0) { xstrtol_fatal(local_80,local_90,(int)(char)local_84,long_options,optarg); } if ((opt_threshold == 0) && (*optarg == '-')) { uVar10 = gettext("invalid --threshold argument \'-0\'"); error(1,0,uVar10); } break; case 0x78: local_8c = local_8c | 0x40; break; case 0x80: apparent_size = '\x01'; break; case 0x81: add_exclude(exclude,optarg,0x10000000); break; case 0x82: local_70 = optarg; break; case 0x83: human_output_opts = 0x90; output_block_size = 1; break; case 0x85: opt_time = '\x01'; if (optarg == (char *)0x0) { time_type = 0; } else { lVar8 = __xargmatch_internal("--time",optarg,time_args,time_types,4,argmatch_die,1,uVar10); time_type = *(undefined4 *)(time_types + lVar8 * 4); } getenv("TZ"); localtz = tzalloc(); break; case 0x86: time_style = optarg; break; case 0x87: goto switchD_00101554_caseD_87; } goto LAB_0010149d; } if (local_93 != true) { uVar10 = 0x1019c6; usage(1); } if ((opt_all != '\0') && (bVar2)) { uVar10 = gettext("cannot both summarize and show all entries"); error(0,0,uVar10); uVar10 = 0x101a07; usage(1); } if (((bVar2) && (bVar3)) && (max_depth == 0)) { uVar7 = gettext("warning: summarizing is the same as using --max-depth=0"); uVar10 = 0x101a48; error(0,0,uVar7); } if (((bVar2) && (bVar3)) && (max_depth != 0)) { local_60 = max_depth; uVar10 = gettext("warning: summarizing conflicts with --max-depth=%lu"); error(0,0,uVar10,local_60); uVar10 = 0x101aa5; usage(1); } if (bVar2) { max_depth = 0; } if (opt_inodes != '\0') { if (apparent_size != '\0') { uVar7 = gettext("warning: options --apparent-size and -b are ineffective with --inodes"); uVar10 = 0x101af2; error(0,0,uVar7); } output_block_size = 1; } if (opt_time != '\0') { if (time_style == (char *)0x0) { uVar10 = 0x101b28; time_style = getenv("TIME_STYLE"); if (time_style != (char *)0x0) { uVar10 = 0x101b51; iVar5 = strcmp(time_style,"locale"); if (iVar5 != 0) { if (*time_style == '+') { uVar10 = 0x101b87; local_58 = strchr(time_style,10); if (local_58 != (char *)0x0) { *local_58 = '\0'; } } else { while( true ) { uVar10 = 0x101bd0; iVar5 = strncmp(time_style,"posix-",prefix_len_6268); if (iVar5 != 0) break; time_style = time_style + prefix_len_6268; } } goto LAB_00101bd4; } } time_style = "long-iso"; } LAB_00101bd4: if (*time_style == '+') { time_format = time_style + 1; } else { lVar8 = __xargmatch_internal ("time style",time_style,time_style_args,time_style_types,4,argmatch_die,1, uVar10); uVar1 = *(uint *)(time_style_types + lVar8 * 4); if (uVar1 == 2) { time_format = "%Y-%m-%d"; } else if (uVar1 < 3) { if (uVar1 == 0) { time_format = "%Y-%m-%d %H:%M:%S.%N %z"; } else if (uVar1 == 1) { time_format = "%Y-%m-%d %H:%M"; } } } } if (local_70 == (char *)0x0) { if (optind < param_1) { local_50 = param_2 + optind; } else { local_50 = &local_38; } local_68 = argv_iter_init_argv(local_50); if ((optind + 1 < param_1) || (local_88 == 2)) { hash_all = '\x01'; } else { hash_all = '\0'; } } else { if (optind < param_1) { uVar10 = quote(param_2[optind]); uVar7 = gettext("extra operand %s"); error(0,0,uVar7,uVar10); uVar10 = gettext("file operands cannot be combined with --files0-from"); fprintf(stderr,"%s\n",uVar10); usage(1); } iVar5 = strcmp(local_70,"-"); if ((iVar5 != 0) && (lVar8 = freopen_safer(local_70,&DAT_0010375a,stdin), lVar8 == 0)) { uVar10 = quotearg_style(4,local_70); uVar7 = gettext("cannot open %s for reading"); piVar9 = __errno_location(); error(1,*piVar9,uVar7,uVar10); } local_68 = argv_iter_init_stream(stdin); hash_all = '\x01'; } if (local_68 == 0) { xalloc_die(); } di_files = di_set_alloc(); if (di_files == 0) { xalloc_die(); } if ((opt_count_all != '\0') || (hash_all != '\x01')) { local_8c = local_8c | 0x100; } local_8c = local_8c | local_88; while( true ) { bVar2 = false; local_48 = (char *)argv_iter(local_68,&local_78); if (local_48 == (char *)0x0) break; if (((local_70 != (char *)0x0) && (iVar5 = strcmp(local_70,"-"), iVar5 == 0)) && (iVar5 = strcmp(local_48,"-"), iVar5 == 0)) { uVar10 = quotearg_style(4,local_48); uVar7 = gettext("when reading file names from stdin, no file name of %s allowed"); error(0,0,uVar7,uVar10); bVar2 = true; } if (*local_48 == '\0') { if (local_70 == (char *)0x0) { uVar10 = gettext("invalid zero-length file name"); error(0,0,&DAT_0010340a,uVar10); } else { local_40 = argv_iter_n_args(local_68); uVar10 = gettext("invalid zero-length file name"); uVar7 = quotearg_n_style_colon(0,3,local_70); error(0,0,"%s:%lu: %s",uVar7,local_40,uVar10); } bVar2 = true; } if (bVar2) { local_93 = false; } else { temp_argv_6280._0_8_ = local_48; bVar4 = du_files(temp_argv_6280,local_8c); local_93 = (bVar4 & local_93) != 0; } } if (local_78 == 4) { uVar10 = quotearg_n_style_colon(0,3,local_70); uVar7 = gettext("%s: read error"); piVar9 = __errno_location(); error(0,*piVar9,uVar7,uVar10); local_93 = false; LAB_001020ad: argv_iter_free(local_68); di_set_free(di_files); if (di_mnt != 0) { di_set_free(di_mnt); } if ((local_70 != (char *)0x0) && (((iVar5 = ferror_unlocked(stdin), iVar5 != 0 || (iVar5 = rpl_fclose(stdin), iVar5 != 0)) && (local_93 != false)))) { uVar10 = quotearg_style(4,local_70); uVar7 = gettext("error reading %s"); error(1,0,uVar7,uVar10); } if (print_grand_total != '\0') { uVar10 = gettext("total"); print_size(tot_dui,uVar10); } if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return local_93 ^ 1; } if (local_78 < 5) { if (local_78 == 2) goto LAB_001020ad; if (local_78 == 3) { xalloc_die(); } } __assert_fail("!\"unexpected error code from argv_iter\"","src/du.c",0x439, (char *)&__PRETTY_FUNCTION___6289); switchD_00101554_caseD_87: opt_inodes = '\x01'; goto LAB_0010149d; }
int * get_group_array (ngp) int *ngp; { int i; static int *group_iarray = (int *) ((void *)0) ; if (group_iarray) { if (ngp) *ngp = ngroups; return (group_iarray); } if (ngroups == 0) initialize_group_array (); if (ngroups <= 0) { if (ngp) *ngp = 0; return (int *) ((void *)0) ; } group_iarray = (int *)sh_xmalloc((ngroups * sizeof (int)), "general.c", 1385); for (i = 0; i < ngroups; i++) group_iarray[i] = (int)group_array[i]; if (ngp) *ngp = ngroups; return group_iarray; }
long long get_group_array(unsigned int *a0) { unsigned int v0; void* v2; if (group_iarray.8434) { if (a0) *(a0) = *(&ngroups); v2 = group_iarray.8434; return v2; } else { if (!*(&ngroups)) initialize_group_array(); if (*(&ngroups) <= 0) { if (a0) *(a0) = 0; v2 = 0; return v2; } else { group_iarray.8434 = sh_xmalloc(*(&ngroups) * 4, "general.c", 0x569); for (v0 = 0; v0 < *(&ngroups); v0 += 1) { *((group_iarray.8434 + v0 * 4)) = *((group_array + v0 * 4)); } if (a0) *(a0) = *(&ngroups); v2 = group_iarray.8434; return v2; } } }
static void cleanup_handler(int sig) { cleanup_socket(); pkcs11_terminate(); _exit(2); }
void cleanup_handler(void) { cleanup_socket(); pkcs11_terminate(); _exit(2); }
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; }
int cert_new() { unsigned long long v0[12]; unsigned int v2; v0[0] = calloc(0x1, 0x60); if (!v0) { v2 = 0; } else { v0[0] = sshbuf_new(); if (!v0[0]) { LABEL_400c0f: cert_free(v0); v2 = 0; } else { v0[8] = sshbuf_new(); if (!v0[8]) goto LABEL_400c0f; v0[9] = sshbuf_new(); if (!v0[9]) goto LABEL_400c0f; v0[3] = 0; v0[5] = 0; v0[10] = 0; v0[11] = 0; v2 = v0; } } return v2; }
int mm_key_allowed(enum mm_keytype type, const char *user, const char *host, struct sshkey *key, int pubkey_auth_attempt, struct sshauthopt **authoptp) { struct sshbuf *m; int r, allowed = 0; struct sshauthopt *opts = ((void *)0) ; sshlog("monitor_wrap.c", __func__, 459, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "entering"); if (authoptp != ((void *)0) ) *authoptp = ((void *)0) ; if ((m = sshbuf_new()) == ((void *)0) ) sshfatal("monitor_wrap.c", __func__, 465, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); if ((r = sshbuf_put_u32(m, type)) != 0 || (r = sshbuf_put_cstring(m, user ? user : "")) != 0 || (r = sshbuf_put_cstring(m, host ? host : "")) != 0 || (r = sshkey_puts(key, m)) != 0 || (r = sshbuf_put_u32(m, pubkey_auth_attempt)) != 0) sshfatal("monitor_wrap.c", __func__, 471, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble"); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYALLOWED, m); sshlog("monitor_wrap.c", __func__, 475, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "waiting for MONITOR_ANS_KEYALLOWED"); mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KEYALLOWED, m); if ((r = sshbuf_get_u32(m, &allowed)) != 0) sshfatal("monitor_wrap.c", __func__, 480, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); if (allowed && type == MM_USERKEY && (r = sshauthopt_deserialise(m, &opts)) != 0) sshfatal("monitor_wrap.c", __func__, 483, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "sshauthopt_deserialise"); sshbuf_free(m); if (authoptp != ((void *)0) ) { *authoptp = opts; opts = ((void *)0) ; } sshauthopt_free(opts); return allowed; }
long mm_key_allowed(unsigned int a1, void *a2, void *a3, long a4, unsigned int a5, _QWORD *a6) { void *v6; void *v7; long v8; long v9; long v10; unsigned int v16; unsigned int u32; long v18; long v19; unsigned long v20; v20 = __readfsqword(0x28u); v16 = 0; v18 = 0LL; sshlog("monitor_wrap.c", "mm_key_allowed", 459LL, 1LL, 7LL, 0LL, "entering"); if ( a6 ) *a6 = 0LL; v19 = sshbuf_new(); if ( !v19 ) sshfatal("monitor_wrap.c", "mm_key_allowed", 465LL, 1LL, 1LL, 0LL, "sshbuf_new failed"); u32 = sshbuf_put_u32(v19, a1); if ( u32 || (!a2 ? (v6 = &unk_3F89) : (v6 = a2), (u32 = sshbuf_put_cstring(v19, v6)) != 0 || (!a3 ? (v7 = &unk_3F89) : (v7 = a3), (u32 = sshbuf_put_cstring(v19, v7)) != 0 || (u32 = sshkey_puts(a4, v19)) != 0 || (u32 = sshbuf_put_u32(v19, a5)) != 0)) ) { v8 = ssh_err(u32); sshfatal("monitor_wrap.c", "mm_key_allowed", 471LL, 1LL, 1LL, v8, "assemble"); } mm_request_send(*pmonitor, 0x16u, v19); sshlog("monitor_wrap.c", "mm_key_allowed", 475LL, 1LL, 7LL, 0LL, "waiting for MONITOR_ANS_KEYALLOWED"); mm_request_receive_expect(*pmonitor, 0x17u, v19); u32 = sshbuf_get_u32(v19, &v16); if ( u32 ) { v9 = ssh_err(u32); sshfatal("monitor_wrap.c", "mm_key_allowed", 480LL, 1LL, 1LL, v9, "parse"); } if ( v16 ) { if ( a1 == 2 ) { u32 = sshauthopt_deserialise(v19, &v18); if ( u32 ) { v10 = ssh_err(u32); sshfatal("monitor_wrap.c", "mm_key_allowed", 483LL, 1LL, 1LL, v10, "sshauthopt_deserialise"); } } } sshbuf_free(v19); if ( a6 ) { *a6 = v18; v18 = 0LL; } sshauthopt_free(v18); return v16; }
void restore_sigmask () { sigprocmask ( 2 , &top_level_mask, (sigset_t *) ((void *)0) ); }
void restore_sigmask() { unsigned long long v1; v1 = sigprocmask(0x2, &top_level_mask, NULL); return; }
static inline void initialize_exit_failure (int status) { if (status != 1 ) exit_failure = status; }
void initialize_exit_failure(unsigned long long a0) { unsigned long long v1; if (a0 != 1) { v1 = a0; exit_failure = a0; } return; }
void using_history(void) { if (h == ((void *)0) || e == ((void *)0) ) rl_initialize(); history_offset = history_length; }
long long using_history() { if (!h || !e) rl_initialize(); *(got.history_offset) = *(got.history_length); return got.history_offset; }
sshbuf_len(nprincipals) != 0 ? "," : "", cert->cert->principals[i])) != 0) { sshlog("sshsig.c", __func__, 853, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "buffer error"); goto out; }
void sshbuf_len(void) { halt_baddata(); }
int set_netnsid_from_name(const char *name, int nsid) { struct { struct nlmsghdr n; struct rtgenmsg g; char buf[1024]; } req = { .n.nlmsg_len = ((sizeof(struct rtgenmsg)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))), .n.nlmsg_flags = 0x01, .n.nlmsg_type = RTM_NEWNSID, .g.rtgen_family = 0 , }; int fd, err = 0; netns_nsid_socket_init(); fd = netns_get_fd(name); if (fd < 0) return fd; addattr32(&req.n, 1024, NETNSA_FD, fd); addattr32(&req.n, 1024, NETNSA_NSID, nsid); if (rtnl_talk(&rth, &req.n, ((void *)0) ) < 0) err = -2; close(fd); return err; }
void set_netnsid_from_name(unsigned long long a0, unsigned long a1) { unsigned long long v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned short v4; unsigned short v5; unsigned long long v7; void* v8; unsigned long v9; unsigned long long v10; unsigned long long v11; v0 = a0; v7 = 130; for (v8 = &v3; v7; v8 += v9 * 8) { v7 -= 1; v3 = 0; } *(v8) = 0; v3 = 17; v4 = 88; v5 = 1; v1 = 0; netns_nsid_socket_init(); v2 = netns_get_fd(v0); if (v2 < 0) { v10 = v2; } else { addattr32(&v3, 0x400, 0x3, v2); addattr32(&v3, 0x400, 0x1, a1); if (rtnl_talk(0x500050, &v3, 0x0) < 0) v1 = -2; close(v2); v11 = v1; } return; }
static struct bin_str * _rl_custom_readline_prefix (void) { size_t len; COLOR_EXT_TYPE *ext; len = strlen ("readline-colored-completion-prefix"); for (ext = _rl_color_ext_list; ext; ext = ext->next) if (ext->ext.len == len && (((len) == 0) ? (1) : ((ext->ext.string)[0] == ("readline-colored-completion-prefix")[0]) && (strncmp ((ext->ext.string), ("readline-colored-completion-prefix"), (len)) == 0))) return (&ext->seq); return ( ((void *)0) ); }
size_t * _rl_custom_readline_prefix(void) { int iVar1; size_t __n; size_t *local_18; __n = strlen("readline-colored-completion-prefix"); local_18 = _rl_color_ext_list; while( true ) { if (local_18 == (size_t *)0x0) { return (size_t *)0x0; } if ((__n == *local_18) && ((__n == 0 || ((*(char *)local_18[1] == 'r' && (iVar1 = strncmp((char *)local_18[1],"readline-colored-completion-prefix",__n), iVar1 == 0) ))))) break; local_18 = (size_t *)local_18[4]; } return local_18 + 2; }
static void short_read (size_t status) { size_t left; char *more; more = record_start->buffer + status; left = record_size - status; if (left && left % 512 == 0 && (warning_option & 0x00400000) && record_start_block == 0 && status != 0 && archive_is_dev ()) { unsigned long rsize = status / 512; do { if (error_hook) error_hook (); error (0, 0, ngettext ("Record size = %lu block", "Record size = %lu blocks", rsize), rsize); } while (0) ; } while (left % 512 != 0 || (left && status && read_full_records)) { if (status) while ((status = (((archive) >= (1 << 30)) ? rmt_read__ (archive - (1 << 30), more, left) : safe_read (archive, more, left))) == ((size_t) -1)) archive_read_error (); if (status == 0) break; if (! read_full_records) { unsigned long rest = record_size - left; do { if (error_hook) error_hook (); error (0, 0, ngettext ("Unaligned block (%lu byte) in archive", "Unaligned block (%lu bytes) in archive", rest), rest); fatal_exit (); } while (0) ; } left -= status; more += status; } record_end = record_start + (record_size - left) / 512; records_read++; }
void short_read(unsigned int a0, unsigned long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned long v0; unsigned long long v1; unsigned long long v2; unsigned long long v3; unsigned long v4; unsigned long long v6; unsigned long long v7; *(&v0) = a0; v2 = v0 + 16752697132039570248; v1 = record_size - v0; if (v1 && !(v1 & 511) && (warning_option & mv_begin_write) && !record_start_block && v0 && archive_is_dev()) { v3 = v0 >> 9; if (error_hook) *(5243096)(); error(0x0, 0x0, ngettext("Record size = %lu block", "Record size = %lu blocks", v3)); } while (true) { if (!((v1 & 511)) && (!(v1) || !(v0) || !(read_full_records))) break; if (v0) { while (true) { if (archive <= 1073741823) v6 = safe_read(archive, v2, v1, v2); else v6 = rmt_read__(archive - 0x40000000, v2, v1, archive - 0x40000000); v0 = v6; if (v0 != -1) break; archive_read_error(a0, a1, a2, a3, a4, a5); } } if (!v0) break; if ((read_full_records ^ 1)) { v4 = record_size - v1; if (error_hook) *(5243096)(); error(0x0, 0x0, ngettext("Unaligned block (%lu byte) in archive", "Unaligned block (%lu bytes) in archive", v4)); fatal_exit(0x0, 0x0, a2, v4, a4, a5); } v1 -= v0; v2 += v0; } continued_file_offset = (record_size - v1 & -0x200) + 16752697132039570248; v7 = 16752697132039570249; continued_file_offset = 16752697132039570249; return; }
static struct cpelement * cpl_add (cp) Coproc *cp; { struct cpelement *cpe; cpe = cpe_alloc (cp); if (coproc_list.head == 0) { coproc_list.head = coproc_list.tail = cpe; coproc_list.ncoproc = 0; } else { coproc_list.tail->next = cpe; coproc_list.tail = cpe; } coproc_list.ncoproc++; return cpe; }
long long cpl_add(unsigned int a0) { unsigned long long v0; v0 = cpe_alloc(a0); if (!coproc_list) { g_40b118 = v0; coproc_list = g_40b118; g_40b120 = 0; } else { *(g_40b118) = v0; g_40b118 = v0; } g_40b120 = g_40b120 + 1; return v0; }
static inline void emit_ancillary_info (char const *program) { struct infomap { char const *program; char const *node; } const infomap[] = { { "[", "test invocation" }, { "coreutils", "Multi-call invocation" }, { "sha224sum", "sha2 utilities" }, { "sha256sum", "sha2 utilities" }, { "sha384sum", "sha2 utilities" }, { "sha512sum", "sha2 utilities" }, { ((void *)0) , ((void *)0) } }; char const *node = program; struct infomap const *map_prog = infomap; while (map_prog->program && ! (strcmp (program, map_prog->program) == 0)) map_prog++; if (map_prog->node) node = map_prog->node; printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https: char const *lc_messages = setlocale ( 5 , ((void *)0) ); if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1)) { fputs_unlocked (gettext ("Report any translation bugs to " "<https: stdout ) ; } char const *url_program = (strcmp (program, "[") == 0) ? "test" : program; printf (gettext ("Full documentation <%s%s>\n"), "https: printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"), node, node == program ? " invocation" : ""); }
long long emit_ancillary_info(char *a0) { unsigned long v0; unsigned long long v1[2]; char *v2; unsigned long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long long v9; unsigned long long v10; unsigned long long v11; unsigned long long v12; unsigned long long v13; unsigned long long v14; unsigned long long v15; void* v16; void* v17; v4 = "["; v5 = "test invocation"; v6 = "coreutils"; v7 = "Multi-call invocation"; v8 = "sha224sum"; v9 = "sha2 utilities"; v10 = "sha256sum"; v11 = "sha2 utilities"; v12 = "sha384sum"; v13 = "sha2 utilities"; v14 = "sha512sum"; v15 = "sha2 utilities"; v16 = 0; v17 = 0; v0 = a0; for (v1[0] = &v4; v1[0] && strcmp(a0, v1[0]); v1[0] = v1 + 1); if (v1[1]) v0 = v1[1]; printf(gettext("\n%s online help: <%s>\n")); v2 = setlocale(0x5, NULL); if (v2 && strncmp(v2, "en_", 0x3)) fputs_unlocked(gettext("Report any translation bugs to <https: *(&v3) = (!strcmp(a0, "[") ? a0 : "test"); printf(gettext("Full documentation <%s%s>\n")); printf(gettext("or available locally via: info '(coreutils) %s%s'\n")); return 0; }
static int extract_salt(const char *s, u_int l, u_char *salt, size_t salt_len) { char *p, *b64salt; u_int b64len; int ret; if (l < sizeof("|1|") - 1) { sshlog("hostfile.c", __func__, 76, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "extract_salt: string too short"); return (-1); } if (strncmp(s, "|1|", sizeof("|1|") - 1) != 0) { sshlog("hostfile.c", __func__, 80, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "extract_salt: invalid magic identifier"); return (-1); } s += sizeof("|1|") - 1; l -= sizeof("|1|") - 1; if ((p = memchr(s, '|', l)) == ((void *)0) ) { sshlog("hostfile.c", __func__, 86, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "extract_salt: missing salt termination character"); return (-1); } b64len = p - s; if (b64len == 0 || b64len > 1024) { sshlog("hostfile.c", __func__, 93, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "extract_salt: bad encoded salt length %u", b64len); return (-1); } b64salt = xmalloc(1 + b64len); memcpy(b64salt, s, b64len); b64salt[b64len] = '\0'; ret = __b64_pton (b64salt,salt,salt_len); free(b64salt); if (ret == -1) { sshlog("hostfile.c", __func__, 103, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "extract_salt: salt decode error"); return (-1); } if (ret != (int)ssh_hmac_bytes(1)) { sshlog("hostfile.c", __func__, 107, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "extract_salt: expected salt len %zd, got %d", ssh_hmac_bytes(1), ret) ; return (-1); } return (0); }
long extract_salt(const char *a1, unsigned int a2, u_char *a3, size_t a4) { long v5; long v6; const char *n_4; unsigned int v10; unsigned int v11; void *v12; void *dest; if ( a2 > 2 ) { if ( !strncmp(a1, "|1|", 3uLL) ) { n_4 = a1 + 3; v12 = memchr(a1 + 3, 124, a2 - 3); if ( v12 ) { v10 = (_DWORD)v12 - (_DWORD)n_4; if ( (_DWORD)v12 == (_DWORD)n_4 || v10 > 0x400 ) { sshlog("hostfile.c", "extract_salt", 93LL, 0LL, 6LL, 0LL, "extract_salt: bad encoded salt length %u", v10); return 0xFFFFFFFFLL; } else { dest = (void *)xmalloc(v10 + 1, v5); memcpy(dest, n_4, v10); *((_BYTE *)dest + v10) = 0; v11 = _b64_pton((const char *)dest, a3, a4); free(dest); if ( v11 == -1 ) { sshlog("hostfile.c", "extract_salt", 103LL, 0LL, 6LL, 0LL, "extract_salt: salt decode error"); return 0xFFFFFFFFLL; } else if ( v11 == (unsigned int)ssh_hmac_bytes(1LL) ) { return 0LL; } else { v6 = ssh_hmac_bytes(1LL); sshlog( "hostfile.c", "extract_salt", 107LL, 0LL, 6LL, 0LL, "extract_salt: expected salt len %zd, got %d", v6, v11); return 0xFFFFFFFFLL; } } } else { sshlog("hostfile.c", "extract_salt", 86LL, 0LL, 6LL, 0LL, "extract_salt: missing salt termination character"); return 0xFFFFFFFFLL; } } else { sshlog("hostfile.c", "extract_salt", 80LL, 0LL, 6LL, 0LL, "extract_salt: invalid magic identifier"); return 0xFFFFFFFFLL; } } else { sshlog("hostfile.c", "extract_salt", 76LL, 0LL, 6LL, 0LL, "extract_salt: string too short"); return 0xFFFFFFFFLL; } }
static void attach (char *dest, char const *dirname, char const *name) { char const *dirnamep = dirname; if (dirname[0] != '.' || dirname[1] != 0) { while (*dirnamep) *dest++ = *dirnamep++; if (dirnamep > dirname && dirnamep[-1] != '/') *dest++ = '/'; } while (*name) *dest++ = *name++; *dest = 0; }
void attach(unsigned long long a0, char a1[2], unsigned long long a2) { char *v0; int tmp_10; char *v1; char v2[2]; char *v4; char *v5; char *v6; char *v7; v1 = a0; v0 = a2; for (*(&v2) = a1; v2[0]; *(v4) = a2) { tmp_10 = v2; *(&v2) = &v2[1]; v4 = v1; v1 += 1; a2 = *(tmp_10); } if (v2 > a1 && v2[1] != 47) { v5 = v1; v1 += 1; *(v5) = 47; } for (; *(v0); *(v6) = a2) { tmp_10 = v0; v0 += 1; v6 = v1; v1 += 1; *(&a2) = *(tmp_10); } v7 = v1; *(v1) = 0; return; }
static void summarize_regexp_list (struct regexp_list *reglist) { if (reglist->regexps) { reglist->buf->fastmap = xmalloc (1 << 8); if (reglist->multiple_regexps) { char const *m = re_compile_pattern (reglist->regexps, reglist->len, reglist->buf); if (m) ((!!sizeof (struct { _Static_assert (2, "verify_expr (" "2" ", " "(error (2, 0, \"%s: %s\", reglist->regexps, m), assume (false))" ")"); int _gl_dummy; })) ? ((error (2, 0, "%s: %s", reglist->regexps, m), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (2, 0, "%s: %s", reglist->regexps, m), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); } } }
void summarize_regexp_list(char **param_1) { undefined8 uVar1; char *pcVar2; if (*param_1 != (char *)0x0) { pcVar2 = param_1[4]; uVar1 = xmalloc(0x100); *(undefined8 *)(pcVar2 + 0x20) = uVar1; if (*(char *)(param_1 + 3) != '\0') { pcVar2 = re_compile_pattern(*param_1,(size_t)param_1[1],(re_pattern_buffer *)param_1[4]); if (pcVar2 != (char *)0x0) { error(2,0,"%s: %s",*param_1,pcVar2); } } } return; }
static int putx(c) int c; { int x; x = putc (c, rl_outstream); return x; }
long putx(int a1) { return (unsigned int)putc(a1, rl_outstream); }
const char * channel_format_extended_usage(const Channel *c) { if (c->efd == -1) return "closed"; switch (c->extended_usage) { case 2: return "write"; case 1: return "read"; case 0: return "ignore"; default: return "UNKNOWN"; } }
int channel_format_extended_usage(unsigned int a0[49]) { unsigned int v1; if (a0[9] == -1) { v1 = &g_4111ac; } else if (a0[48] != 2) { if (a0[48] <= 2) { if (!a0[48]) v1 = &g_4111be; if (a0[48] == 1) v1 = &g_4111b9; } if (a0[48] > 2 || a0[48] != 1 && a0[48]) v1 = &g_4111c5; } else { v1 = &g_4111b3; } return v1; }
static int parse_args(int argc, char **argv, int cmd, struct l2tp_parm *p) { memset(p, 0, sizeof(*p)); if (argc == 0) usage(); p->l2spec_type = L2TP_L2SPECTYPE_DEFAULT; p->l2spec_len = 4; p->udp6_csum_rx = 1; p->udp6_csum_tx = 1; while (argc > 0) { if (strcmp(*argv, "encap") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (strcmp(*argv, "ip") == 0) { p->encap = L2TP_ENCAPTYPE_IP; } else if (strcmp(*argv, "udp") == 0) { p->encap = L2TP_ENCAPTYPE_UDP; } else { fprintf( stderr , "Unknown tunnel encapsulation \"%s\"\n", *argv); exit(-1); } } else if (strcmp(*argv, "name") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (check_ifname(*argv)) invarg("\"name\" not a valid ifname", *argv); p->ifname = *argv; } else if (strcmp(*argv, "remote") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_addr(&p->peer_ip, *argv, 0 )) invarg("invalid remote address\n", *argv); } else if (strcmp(*argv, "local") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_addr(&p->local_ip, *argv, 0 )) invarg("invalid local address\n", *argv); } else if ((strcmp(*argv, "tunnel_id") == 0) || (strcmp(*argv, "tid") == 0)) { __u32 uval; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&uval, *argv, 0)) invarg("invalid ID\n", *argv); p->tunnel_id = uval; } else if ((strcmp(*argv, "peer_tunnel_id") == 0) || (strcmp(*argv, "ptid") == 0)) { __u32 uval; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&uval, *argv, 0)) invarg("invalid ID\n", *argv); p->peer_tunnel_id = uval; } else if ((strcmp(*argv, "session_id") == 0) || (strcmp(*argv, "sid") == 0)) { __u32 uval; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&uval, *argv, 0)) invarg("invalid ID\n", *argv); p->session_id = uval; } else if ((strcmp(*argv, "peer_session_id") == 0) || (strcmp(*argv, "psid") == 0)) { __u32 uval; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&uval, *argv, 0)) invarg("invalid ID\n", *argv); p->peer_session_id = uval; } else if (strcmp(*argv, "udp_sport") == 0) { __u16 uval; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u16(&uval, *argv, 0)) invarg("invalid port\n", *argv); p->local_udp_port = uval; } else if (strcmp(*argv, "udp_dport") == 0) { __u16 uval; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u16(&uval, *argv, 0)) invarg("invalid port\n", *argv); p->peer_udp_port = uval; } else if (strcmp(*argv, "udp_csum") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (strcmp(*argv, "on") == 0) p->udp_csum = 1; else if (strcmp(*argv, "off") == 0) p->udp_csum = 0; else invarg("invalid option for udp_csum\n", *argv); } else if (strcmp(*argv, "udp6_csum_rx") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (strcmp(*argv, "on") == 0) p->udp6_csum_rx = 1; else if (strcmp(*argv, "off") == 0) p->udp6_csum_rx = 0; else invarg("invalid option for udp6_csum_rx\n" , *argv); } else if (strcmp(*argv, "udp6_csum_tx") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (strcmp(*argv, "on") == 0) p->udp6_csum_tx = 1; else if (strcmp(*argv, "off") == 0) p->udp6_csum_tx = 0; else invarg("invalid option for udp6_csum_tx\n" , *argv); } else if (strcmp(*argv, "offset") == 0) { fprintf( stderr , "Ignoring option \"offset\"\n"); do { argv++; if (--argc <= 0) incomplete_command(); } while(0); } else if (strcmp(*argv, "peer_offset") == 0) { fprintf( stderr , "Ignoring option \"peer_offset\"\n"); do { argv++; if (--argc <= 0) incomplete_command(); } while(0); } else if (strcmp(*argv, "cookie") == 0) { int slen; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); slen = strlen(*argv); if ((slen != 8) && (slen != 16)) invarg("cookie must be either 8 or 16 hex digits\n", *argv); p->cookie_len = slen / 2; if (hex2mem(*argv, p->cookie, p->cookie_len) < 0) invarg("cookie must be a hex string\n", *argv); } else if (strcmp(*argv, "peer_cookie") == 0) { int slen; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); slen = strlen(*argv); if ((slen != 8) && (slen != 16)) invarg("cookie must be either 8 or 16 hex digits\n", *argv); p->peer_cookie_len = slen / 2; if (hex2mem(*argv, p->peer_cookie, p->peer_cookie_len) < 0) invarg("cookie must be a hex string\n", *argv); } else if (strcmp(*argv, "l2spec_type") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (strcasecmp(*argv, "default") == 0) { p->l2spec_type = L2TP_L2SPECTYPE_DEFAULT; p->l2spec_len = 4; } else if (strcasecmp(*argv, "none") == 0) { p->l2spec_type = L2TP_L2SPECTYPE_NONE; p->l2spec_len = 0; } else { fprintf( stderr , "Unknown layer2specific header type \"%s\"\n", *argv); exit(-1); } } else if (strcmp(*argv, "seq") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (strcasecmp(*argv, "both") == 0) { p->recv_seq = 1; p->send_seq = 1; } else if (strcasecmp(*argv, "recv") == 0) { p->recv_seq = 1; } else if (strcasecmp(*argv, "send") == 0) { p->send_seq = 1; } else if (strcasecmp(*argv, "none") == 0) { p->recv_seq = 0; p->send_seq = 0; } else { fprintf( stderr , "Unknown seq value \"%s\"\n", *argv); exit(-1); } } else if (strcmp(*argv, "tunnel") == 0) { p->tunnel = 1; } else if (strcmp(*argv, "session") == 0) { p->session = 1; } else if (matches(*argv, "help") == 0) { usage(); } else { fprintf( stderr , "Unknown command: %s\n", *argv); usage(); } argc--; argv++; } return 0; }
int parse_args(unsigned long a0, unsigned long a1, unsigned long a2, struct_0 *a3) { unsigned long long *v0; unsigned int v1; unsigned int v2; char v3; unsigned int v4; unsigned int v5; v2 = a0; v0 = a1; v1 = a2; memset(a3, 0x0, 0x258); if (!v2) usage(); a3->field_250 = 1; a3->field_251 = 4; a3->field_242 = a3->field_242 | 2; a3->field_242 = a3->field_242 | 1; while (true) { if (v2 <= 0) return 0; if (!strcmp(*(v0), "encap")) { v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (!strcmp(*(v0), "ip")) { a3->field_10 = 1; goto LABEL_402867; } else if (!strcmp(*(v0), "udp")) { a3->field_10 = 0; goto LABEL_402867; } else { fprintf(stderr, "Unknown tunnel encapsulation \"%s\"\n", *(v0)); exit(0xffffffff); } } if (!strcmp(*(v0), "name")) { v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (check_ifname(*(v0))) invarg("\"name\" not a valid ifname", *(v0)); a3->field_248 = *(v0); goto LABEL_402867; } if (!strcmp(*(v0), "remote")) { v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (!get_addr(&a3->padding_28[272], *(v0), 0x0, &a3->padding_28[272])) goto LABEL_402867; invarg("invalid remote address\n", *(v0)); } if (!strcmp(*(v0), "local")) { v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (!get_addr(&a3->padding_28[8], *(v0), 0x0, &a3->padding_28[8])) goto LABEL_402867; invarg("invalid local address\n", *(v0)); } if (!strcmp(*(v0), "tunnel_id")) { LABEL_401ea9: v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (get_u32(&v3, *(v0), 0x0, *(v0))) invarg("invalid ID\n", *(v0)); a3->field_0 = *(&v3); goto LABEL_402867; } else { if (!strcmp(*(v0), "tid")) goto LABEL_401ea9; if (!strcmp(*(v0), "peer_tunnel_id")) { LABEL_401f34: v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (get_u32(&v3, *(v0), 0x0, *(v0))) invarg("invalid ID\n", *(v0)); a3->field_4 = *(&v3); goto LABEL_402867; } else { if (!strcmp(*(v0), "ptid")) goto LABEL_401f34; if (!strcmp(*(v0), "session_id")) { LABEL_401fc0: v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (get_u32(&v3, *(v0), 0x0, *(v0))) invarg("invalid ID\n", *(v0)); a3->field_8 = *(&v3); goto LABEL_402867; } else { if (!strcmp(*(v0), "sid")) goto LABEL_401fc0; if (!strcmp(*(v0), "peer_session_id")) { LABEL_40204c: v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (get_u32(&v3, *(v0), 0x0, *(v0))) invarg("invalid ID\n", *(v0)); a3->field_c = *(&v3); goto LABEL_402867; } else { if (!strcmp(*(v0), "psid")) goto LABEL_40204c; if (!strcmp(*(v0), "udp_sport")) { v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (get_u16(&v3, *(v0), 0x0, *(v0))) invarg("invalid port\n", *(v0)); a3->field_14 = *(&v3); goto LABEL_402867; } if (!strcmp(*(v0), "udp_dport")) { v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (get_u16(&v3, *(v0), 0x0, *(v0))) invarg("invalid port\n", *(v0)); a3->field_16 = *(&v3); goto LABEL_402867; } if (!strcmp(*(v0), "udp_csum")) { v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (!strcmp(*(v0), "on")) { a3->field_242 = a3->field_242 | 4; goto LABEL_402867; } if (strcmp(*(v0), "off")) { invarg("invalid option for udp_csum\n", *(v0)); } else { a3->field_242 = a3->field_242 & 4294967291; goto LABEL_402867; } } if (!strcmp(*(v0), "udp6_csum_rx")) { v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (!strcmp(*(v0), "on")) { a3->field_242 = a3->field_242 | 2; goto LABEL_402867; } if (strcmp(*(v0), "off")) { invarg("invalid option for udp6_csum_rx\n", *(v0)); } else { a3->field_242 = a3->field_242 & 4294967293; goto LABEL_402867; } } if (!strcmp(*(v0), "udp6_csum_tx")) { v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (!strcmp(*(v0), "on")) { a3->field_242 = a3->field_242 | 1; goto LABEL_402867; } if (strcmp(*(v0), "off")) { invarg("invalid option for udp6_csum_tx\n", *(v0)); } else { a3->field_242 = a3->field_242 & 4294967294; goto LABEL_402867; } } if (!strcmp(*(v0), "offset")) { fprintf(stderr, "Ignoring option \"offset\"\n"); v0 = v0 + 1; v2 -= 1; if (!(v2 <= 0)) goto LABEL_402867; incomplete_command(); } if (!strcmp(*(v0), "peer_offset")) { fprintf(stderr, "Ignoring option \"peer_offset\"\n"); v0 = v0 + 1; v2 -= 1; if (!(v2 <= 0)) goto LABEL_402867; incomplete_command(); } if (!strcmp(*(v0), "cookie")) { v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); v5 = strlen(*(v0)); if (v5 != 8 && v5 != 16) invarg("cookie must be either 8 or 16 hex digits\n", *(v0)); a3->field_18 = v5 + (v5 >> 31) >> 1; if (!(hex2mem(*(v0), &a3->padding_1c, a3->field_18, &a3->padding_1c) < 0)) goto LABEL_402867; invarg("cookie must be a hex string\n", *(v0)); } if (!strcmp(*(v0), "peer_cookie")) { v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); v4 = strlen(*(v0)); if (v4 != 8 && v4 != 16) invarg("cookie must be either 8 or 16 hex digits\n", *(v0)); a3->field_24 = v4 + (v4 >> 31) >> 1; if (!(hex2mem(*(v0), &a3->padding_28, a3->field_24, &a3->padding_28) < 0)) goto LABEL_402867; invarg("cookie must be a hex string\n", *(v0)); } if (!strcmp(*(v0), "l2spec_type")) { v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (!strcasecmp(*(v0), "default")) { a3->field_250 = 1; a3->field_251 = 4; } else { if (strcasecmp(*(v0), "none")) { fprintf(stderr, "Unknown layer2specific header type \"%s\"\n", *(v0)); exit(0xffffffff); } a3->field_250 = 0; a3->field_251 = 0; } } else if (!strcmp(*(v0), "seq")) { v0 = v0 + 1; v2 -= 1; if (v2 <= 0) incomplete_command(); if (!strcasecmp(*(v0), "both")) { a3->field_242 = a3->field_242 | 8; a3->field_242 = a3->field_242 | 16; } else { if (!strcasecmp(*(v0), "recv")) { a3->field_242 = a3->field_242 | 8; } else { if (!strcasecmp(*(v0), "send")) { a3->field_242 = a3->field_242 | 16; } else { if (!strcasecmp(*(v0), "none")) { a3->field_242 = a3->field_242 & 4294967287; a3->field_242 = a3->field_242 & 4294967279; } else { fprintf(stderr, "Unknown seq value \"%s\"\n", *(v0)); exit(0xffffffff); } } } } } else if (!strcmp(*(v0), "tunnel")) { a3->field_242 = a3->field_242 | 32; } else { if (strcmp(*(v0), "session")) break; a3->field_242 = a3->field_242 | 64; } LABEL_402867: v2 -= 1; v0 += 1; } } } } } if ((matches(*(v0), "help") ^ 1)) usage(); fprintf(stderr, "Unknown command: %s\n", *(v0)); usage(); }
static int get_agent_identities(struct ssh *ssh, int *agent_fdp, struct ssh_identitylist **idlistp) { int r, agent_fd; struct ssh_identitylist *idlist; if ((r = ssh_get_authentication_socket(&agent_fd)) != 0) { if (r != -47) sshlog("sshconnect2.c", __func__, 1673, 1, SYSLOG_LEVEL_DEBUG1, ssh_err(r), "ssh_get_authentication_socket"); return r; } if ((r = ssh_agent_bind_hostkey(agent_fd, ssh->kex->initial_hostkey, ssh->kex->session_id, ssh->kex->initial_sig, 0)) == 0) sshlog("sshconnect2.c", __func__, 1678, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "bound agent to hostkey"); else sshlog("sshconnect2.c", __func__, 1680, 1, SYSLOG_LEVEL_DEBUG2, ssh_err(r), "ssh_agent_bind_hostkey"); if ((r = ssh_fetch_identitylist(agent_fd, &idlist)) != 0) { sshlog("sshconnect2.c", __func__, 1683, 1, SYSLOG_LEVEL_DEBUG1, ssh_err(r), "ssh_fetch_identitylist"); close(agent_fd); return r; } *agent_fdp = agent_fd; *idlistp = idlist; sshlog("sshconnect2.c", __func__, 1690, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "agent returned %zu keys", idlist->nkeys); return 0; }
int get_agent_identities(unsigned long a0, unsigned int *a1, unsigned long long *a2) { unsigned long v0; struct_0 *v1; char v2; unsigned int v3; char v4; unsigned int v6; v1 = a0; v3 = ssh_get_authentication_socket(&v2); if (!v3) { v3 = ssh_agent_bind_hostkey(*(&v2), v1->field_8->field_80, v1->field_8->field_70, v1->field_8->field_78, 0x0); if (!v3) sshlog("sshconnect2.c", "get_agent_identities", 0x68e, 0x1, 0x5, 0x0, "bound agent to hostkey"); else sshlog("sshconnect2.c", "get_agent_identities", 0x690, 0x1, 0x6, ssh_err(v3), "ssh_agent_bind_hostkey"); v3 = ssh_fetch_identitylist(*(&v2), &v4, &v4); if (!v3) { *(a1) = *(&v2); *(a2) = *(&v4); v0 = *(*(&v4)); sshlog("sshconnect2.c", "get_agent_identities", 0x69a, 0x1, 0x5, 0x0, "agent returned %zu keys"); v6 = 0; } else { sshlog("sshconnect2.c", "get_agent_identities", 0x693, 0x1, 0x5, ssh_err(v3), "ssh_fetch_identitylist"); close(*(&v2)); v6 = v3; } } else { if (v3 != -47) sshlog("sshconnect2.c", "get_agent_identities", 0x689, 0x1, 0x5, ssh_err(v3), "ssh_get_authentication_socket"); v6 = v3; } return v6; }
static void try_save_cert(gnutls_session_t session) { const gnutls_datum_t *cert_list; unsigned int cert_list_size = 0; int ret; unsigned i; gnutls_datum_t t; FILE *fp; cert_list = gnutls_certificate_get_peers(session, &cert_list_size); if (cert_list_size == 0) { fprintf( stderr , "no certificates sent by server!\n"); exit(1); } fp = fopen(gnutls_cli_options.arg.save_cert, "w"); if (fp == ((void *)0) ) { fprintf( stderr , "could not open %s\n", gnutls_cli_options.arg.save_cert); exit(1); } for (i=0;i<cert_list_size;i++) { ret = gnutls_pem_base64_encode2("CERTIFICATE", &cert_list[i], &t); if (ret < 0) { fprintf( stderr , "error[%d]: %s\n", 359, gnutls_strerror(ret)); exit(1); } fwrite(t.data, t.size, 1, fp); gnutls_free((void *) (t.data)), t.data= ((void *)0) ; } fclose(fp); return; }
void try_save_cert(unsigned long long a0) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned long v3; void* v4; void* v5; char v6; char v7; unsigned long long *v9; unsigned long long v10; v0 = 0; v3 = gnutls_certificate_get_peers(a0, &v0, &v0); if (!v0) { fprintf(*(&stderr), "no certificates sent by server!\n"); exit(0x1); } v4 = fopen(port_to_service, "w"); if (!v4) { fprintf(*(&stderr), "could not open %s\n", port_to_service); exit(0x1); } v1 = 0; while (true) { if (v1 < v0) { v2 = gnutls_pem_base64_encode2("CERTIFICATE", v1 * 16 + v3, &v5, v1 * 16 + v3); if (v2 >= 0) { fwrite(v5, *(&v6), 0x1, v4); *(5243000)(v5); v5 = 0; v1 += 1; } else { fprintf(*(&stderr), "error[%d]: %s\n", 359, gnutls_strerror(v2)); exit(0x1); } } else { fclose(v4); v10 = *(&v7) ^ v9[5]; return; } } }
static void print_formatted_time (fp, format, rs, rsf, us, usf, ss, ssf, cpu) FILE *fp; char *format; time_t rs; int rsf; time_t us; int usf; time_t ss; int ssf, cpu; { int prec, lng, len; char *str, *s, ts[(((sizeof (time_t) * 8) - (! ((time_t) 0 < (time_t) -1))) * 302 / 1000 + 1 + (! ((time_t) 0 < (time_t) -1))) + sizeof ("mSS.FFFF")]; time_t sum; int sum_frac; int sindex, ssize; len = strlen (format); ssize = (len + 64) - (len % 64); str = (char *)sh_xmalloc((ssize), "execute_cmd.c", 1263); sindex = 0; for (s = format; *s; s++) { if (*s != '%' || s[1] == '\0') { do { if ((sindex) + (1) >= ssize) { while ((sindex) + (1) >= ssize) ssize += (64); str = sh_xrealloc((str), (ssize), "execute_cmd.c", 1270); } } while (0); str[sindex++] = *s; } else if (s[1] == '%') { s++; do { if ((sindex) + (1) >= ssize) { while ((sindex) + (1) >= ssize) ssize += (64); str = sh_xrealloc((str), (ssize), "execute_cmd.c", 1276); } } while (0); str[sindex++] = *s; } else if (s[1] == 'P') { s++; sum = cpu / 100; sum_frac = (cpu % 100) * 10; len = mkfmt (ts, 2, 0, sum, sum_frac); do { if ((sindex) + (len) >= ssize) { while ((sindex) + (len) >= ssize) ssize += (64); str = sh_xrealloc((str), (ssize), "execute_cmd.c", 1290); } } while (0); strcpy (str + sindex, ts); sindex += len; } else { prec = 3; lng = 0; s++; if (((*s) >= '0' && (*s) <= '9')) { prec = *s++ - '0'; if (prec > 3) prec = 3; } if (*s == 'l') { lng = 1; s++; } if (*s == 'R' || *s == 'E') len = mkfmt (ts, prec, lng, rs, rsf); else if (*s == 'U') len = mkfmt (ts, prec, lng, us, usf); else if (*s == 'S') len = mkfmt (ts, prec, lng, ss, ssf); else { internal_error (gettext("TIMEFORMAT: `%c': invalid format character"), *s); sh_xfree((str), "execute_cmd.c", 1318); return; } do { if ((sindex) + (len) >= ssize) { while ((sindex) + (len) >= ssize) ssize += (64); str = sh_xrealloc((str), (ssize), "execute_cmd.c", 1321); } } while (0); strcpy (str + sindex, ts); sindex += len; } } str[sindex] = '\0'; fprintf (fp, "%s\n", str); fflush (fp); sh_xfree((str), "execute_cmd.c", 1331); }
long long print_formatted_time(void* a0, char *a1, unsigned long long a2, unsigned long a3, unsigned long long a4, unsigned long a5, unsigned long long v10, unsigned int a6, unsigned int a7) { int tmp_12; unsigned int v0; int tmp_14; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; char *v6; char v7[2]; unsigned long long v8; char v9; unsigned int v12; v2 = strlen(a1); v4 = v2 + 64 - ((v2 + (v2 >> 31 >> 26) & 63) - (v2 >> 31 >> 26)); v6 = sh_xmalloc(v4, "execute_cmd.c", 0x4ef); v3 = 0; *(&v7) = a1; while (true) { if (v7[0]) { if (v7[0] == 37 && v7[1]) { if (v7[1] == 37) { if (v4 <= v3 + 1) { for (*(&v7) = &v7[1]; v4 <= v3 + 1; v4 += 64); v6 = sh_xrealloc(v6, v4, "execute_cmd.c", 0x4fc); } tmp_12 = v3; v3 += 1; v6[tmp_12] = v7[0]; } else if (v7[1] == 80) { *(&v7) = &v7[1]; v8 = (a7 * 1374389535 >> 37) - (a7 >> 31); v5 = (((a7 - ((a7 * 1374389535 >> 37) - (a7 >> 31)) * 100) * 4) + a7 - ((a7 * 1374389535 >> 37) - (a7 >> 31)) * 100) * 2; if (v4 <= v2 + v3) { for (v2 = mkfmt(&v9, 0x2, 0x0, v8, v5); v4 <= v2 + v3; v4 += 64); v6 = sh_xrealloc(v6, v4, "execute_cmd.c", 0x50a); } strcpy(&v6[v3], &v9); v3 += v2; } else { v0 = 3; v1 = 0; *(&v7) = &v7[1]; if (v7[0] > 47 && v7[0] <= 57) { tmp_14 = v7; *(&v7) = &v7[1]; v12 = *(tmp_14) - 48; v0 = v12; if (v0 > 3) v0 = 3; } if (v7[0] == 108) { v1 = 1; *(&v7) = &v7[1]; } if (v7[0] != 82 && v7[0] != 69) { if (v7[0] == 85) { v2 = mkfmt(&v9, v0, v1, a4, a5); } else if (v7[0] == 83) { v2 = mkfmt(&v9, v0, v1, v10, a6); } else { internal_error(gettext("TIMEFORMAT: `%c': invalid format"), v7[0]); sh_xfree(v6, "execute_cmd.c", 0x526); break; } } if (v7[0] == 82 || v7[0] == 69) v2 = mkfmt(&v9, v0, v1, a2, a3); if (v7[0] == 82 || v7[0] == 83 || v7[0] == 85 || v7[0] == 69) { if (v4 <= v2 + v3) { for (; v4 <= v2 + v3; v4 += 64); v6 = sh_xrealloc(v6, v4, "execute_cmd.c", 0x529); } strcpy(&v6[v3], &v9); v3 += v2; } } } if (!v7[1] || v7[0] != 37) { if (v4 <= v3 + 1) { for (; v4 <= v3 + 1; v4 += 64); v6 = sh_xrealloc(v6, v4, "execute_cmd.c", 0x4f6); } tmp_12 = v3; v3 += 1; v6[tmp_12] = v7[0]; } if (v7[0] == 82 || v7[0] == 83 || v7[0] == 85 || !v7[1] || v7[0] == 69 || v7[1] == 37 || v7[1] == 80 || v7[0] != 37) *(&v7) = &v7[1]; } else { v6[v3] = 0; fprintf(a0, "%s\n", v6); fflush(a0); sh_xfree(v6, "execute_cmd.c", 0x533); break; } } return 0; }
void * sh_valloc (size, file, line) size_t size; const char *file; int line; { return internal_valloc (size, file, line, 0x01); }
long long sh_valloc(unsigned long a0, unsigned long long a1, unsigned long a2) { return internal_valloc(a0, a1, a2, 0x1); }
static visfun_t getvisfun(int flags) { if (flags & 0x0080) return do_hvis; if (flags & 0x0100) return do_mvis; return do_svis; }
code * getvisfun(uint param_1) { code *pcVar1; if ((param_1 & 0x80) == 0) { if ((param_1 & 0x100) == 0) { pcVar1 = do_svis; } else { pcVar1 = do_mvis; } } else { pcVar1 = do_hvis; } return pcVar1; }
static inline _Bool usable_st_size (struct stat const *sb) { return ( (((( sb->st_mode )) & 0170000) == (0100000)) || (((( sb->st_mode )) & 0170000) == (0120000)) || (( sb )->st_mode - ( sb )->st_mode) || 0 ); }
int usable_st_size(struct_0 *a0) { unsigned int v1; unsigned int v2; switch (a0->field_18 & 0xf000) { case 32768: case 40960: v1 = 1; break; default: v1 = 0; break; } v2 = v1 & 1; return v2; }
char * argv_next(int *argcp, char ***argvp) { char *ret = (*argvp)[0]; if (*argcp > 0 && ret != ((void *)0) ) { (*argcp)--; (*argvp)++; } return ret; }
long argv_next(int *a1, long **a2) { long v3; v3 = **a2; if ( *a1 > 0 && v3 ) { --*a1; ++*a2; } return v3; }
int execute_shell_function (var, words) SHELL_VAR *var; WORD_LIST *words; { int ret; struct fd_bitmap *bitmap; bitmap = new_fd_bitmap (32); begin_unwind_frame ("execute-shell-function"); add_unwind_protect (dispose_fd_bitmap, (char *)bitmap); ret = execute_function (var, words, 0, bitmap, 0, 0); dispose_fd_bitmap (bitmap); discard_unwind_frame ("execute-shell-function"); return ret; }
long execute_shell_function(_QWORD *a1, _QWORD *a2) { unsigned int v3; unsigned int *v4; v4 = (unsigned int *)new_fd_bitmap(32); begin_unwind_frame("execute-shell-function"); add_unwind_protect(dispose_fd_bitmap, v4); v3 = execute_function(a1, a2, 0, v4, 0, 0); dispose_fd_bitmap((long)v4); discard_unwind_frame("execute-shell-function"); return v3; }
static void specify_colors_style (char const *value) { if (value == ((void *)0) || (strcmp (value, "auto") == 0)) colors_style = AUTO; else if ((strcmp (value, "always") == 0)) colors_style = ALWAYS; else if ((strcmp (value, "never") == 0)) colors_style = NEVER; else try_help ("invalid color '%s'", value); }
void specify_colors_style(const char *a1) { if ( a1 && strcmp(a1, "auto") ) { if ( !strcmp(a1, "always") ) { colors_style = 2; } else if ( !strcmp(a1, "never") ) { colors_style = 0; } else { try_help("invalid color '%s'", (long)a1); } } else { colors_style = 1; } }
void _rl_refresh_line (void) { rl_clear_visible_line (); rl_redraw_prompt_last_line (); rl_keep_mark_active (); }
long long _rl_refresh_line(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { rl_clear_visible_line(); rl_redraw_prompt_last_line(); return rl_keep_mark_active(a0, a1, a2, a3, a4, a5); }
static char * find_absolute_program (name, flags) const char *name; int flags; { int st; st = file_status (name); if ((st & 0x1) == 0) return ((char *) ((void *)0) ); if ((flags & 0x1) || ((flags & 0x8) && (st & 0x2))) return ((char *)strcpy (sh_xmalloc((1 + strlen (name)), "findcmd.c", 517), (name))); return ( ((void *)0) ); }
int find_absolute_program(char *a0, unsigned long a1) { unsigned int v0; unsigned int v2; v0 = file_status(a0); if (!(v0 & 1)) { v2 = 0; return v2; } if (!(a1 & 1)) { if (!(a1 & 8)) { v2 = 0; return v2; } else if (!(v0 & 2)) { v2 = 0; return v2; } } v2 = strcpy(sh_xmalloc(strlen(a0) + 1, "findcmd.c", 0x205), a0); return v2; }
int acl_valid(acl_t acl) { int result; result = acl_check(acl, ((void *)0) ); if (result != 0) { if (result > 0) (*__errno_location ()) = 22 ; return -1; } return 0; }
long long acl_valid(unsigned long long a0) { unsigned int v0; unsigned long long v2; v0 = acl_check(a0, 0x0); if (!v0) { v2 = 0; } else { if (v0 > 0) *(__errno_location()) = 22; v2 = 4294967295; } return v2; }
static inline void unlock_node (struct merge_node *node) { pthread_mutex_unlock (&node->lock); }
void unlock_node(unsigned long a0) { unsigned long long v1; v1 = pthread_mutex_unlock(a0 + 88); return; }
int acl_cmp(acl_t acl1, acl_t acl2) { acl_obj *acl1_obj_p = ((acl_obj *)__ext2int_and_check(acl1, (0x712C))), *acl2_obj_p = ((acl_obj *)__ext2int_and_check(acl2, (0x712C))); acl_entry_obj *p1_obj_p, *p2_obj_p; if (!acl1_obj_p || !acl2_obj_p) return -1; if (acl1_obj_p->i.a_used != acl2_obj_p->i.a_used) return 1; p2_obj_p = acl2_obj_p->i.a_next; for( (p1_obj_p) = (acl1_obj_p)->i.a_next; (p1_obj_p) != (acl_entry_obj *)(acl1_obj_p); (p1_obj_p) = (p1_obj_p)->i.e_next ) { if (p1_obj_p->i.e_entry.e_tag != p2_obj_p->i.e_entry.e_tag) return 1; if (!((p1_obj_p->i.e_entry.e_perm).i.s_perm == (p2_obj_p->i.e_entry.e_perm).i.s_perm)) return 1; switch(p1_obj_p->i.e_entry.e_tag) { case (0x02): case (0x08): if (((p1_obj_p->i.e_entry.e_id).i.q_id) != ((p2_obj_p->i.e_entry.e_id).i.q_id)) return 1; } p2_obj_p = p2_obj_p->i.e_next; } return 0; }
long long acl_cmp(unsigned long long a0, unsigned long long a1) { struct_0 *v0; struct_0 *v1; unsigned long long v2[7]; unsigned long long v3[7]; unsigned long long v5; v2[0] = __ext2int_and_check(a0, 0x712c); v3[0] = __ext2int_and_check(a1, 0x712c); if (v2 && v3) { if (v2[6] != v3[6]) { v5 = 1; } else { v1 = v3[2]; v0 = v2[2]; while (true) { if (v0 == v2) { v5 = 0; break; } else if (v0->field_20 != v1->field_20) { v5 = 1; break; } else if (v0->field_40 != v1->field_40) { v5 = 1; break; } else { if ((v0->field_20 == 2 || v0->field_20 == 8) && v0->field_30 != v1->field_30) { v5 = 1; break; } if (v0->field_30 == v1->field_30 || v0->field_20 != 2 && v0->field_20 != 8) { v1 = v1->field_10; v0 = v0->field_10; } } } } } if (!v2 || !v3) v5 = 4294967295; return v5; }
static inline void emit_stdin_note (void) { fputs_unlocked (gettext ("\nWith no FILE, or when FILE is -, read standard input.\n"), stdout ) ; }
void emit_stdin_note() { unsigned long long v1; v1 = fputs_unlocked(gettext("\nWith no FILE, or when FILE is -, read standard input.\n"), stdout); return; }
static int xfrm_policy_dir_parse(__u8 *dir, int *argcp, char ***argvp) { int argc = *argcp; char **argv = *argvp; if (strcmp(*argv, "in") == 0) *dir = XFRM_POLICY_IN; else if (strcmp(*argv, "out") == 0) *dir = XFRM_POLICY_OUT; else if (strcmp(*argv, "fwd") == 0) *dir = XFRM_POLICY_FWD; else invarg("DIR value is invalid", *argv); *argcp = argc; *argvp = argv; return 0; }
void xfrm_policy_dir_parse(char *a0, unsigned int *a1, unsigned long long *a2) { unsigned int v0; unsigned long long *v1; void* v3; v0 = *(a1); v1 = *(a2); if (!strcmp(*(v1), "in")) { *(a0) = 0; } else if (!strcmp(*(v1), "out")) { *(a0) = 1; } else if (strcmp(*(v1), "fwd")) { invarg("DIR value is invalid", *(v1)); } else { *(a0) = 2; } *(a1) = v0; *(a2) = v1; v3 = 0; return; }
int channel_input_open_failure(int type, u_int32_t seq, struct ssh *ssh) { Channel *c = channel_from_packet_id(ssh, __func__, "open failure"); u_int32_t reason; char *msg = ((void *)0) ; int r; if (channel_proxy_upstream(c, type, seq, ssh)) return 0; if (c->type != 3) ssh_packet_disconnect(ssh, "Received open failure for " "non-opening channel %d.", c->self); if ((r = sshpkt_get_u32(ssh, &reason)) != 0) { sshlog("channels.c", __func__, 3424, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "parse reason"); ssh_packet_disconnect(ssh, "Invalid open failure message"); } if ((r = sshpkt_get_cstring(ssh, &msg, ((void *)0) )) != 0 || (r = sshpkt_get_string_direct(ssh, ((void *)0) , ((void *)0) )) != 0 || (r = sshpkt_get_end(ssh)) != 0) { sshlog("channels.c", __func__, 3431, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "parse msg/lang"); ssh_packet_disconnect(ssh, "Invalid open failure message"); } sshlog("channels.c", __func__, 3434, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "channel %d: open failed: %s%s%s", c->self, reason2txt(reason), msg ? ": ": "", msg ? msg : "") ; free(msg); if (c->open_confirm) { sshlog("channels.c", __func__, 3438, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "channel %d: callback start", c->self); c->open_confirm(ssh, c->self, 0, c->open_confirm_ctx); sshlog("channels.c", __func__, 3440, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "channel %d: callback done", c->self); } chan_mark_dead(ssh, c); return 0; }
long long channel_input_open_failure(unsigned long a0, unsigned long a1, void* a2, unsigned long a3, unsigned long long a4, unsigned long long a5) { unsigned long v0; unsigned long v1; unsigned long long v2; unsigned long v3; char v4; unsigned int v5; void* v6; struct_0 *v7; unsigned long long v10; v7 = channel_from_packet_id(a2, 0x413b80, "open failure"); v6 = 0; if (!channel_proxy_upstream(v7, a0, a1, a2, a4, a5)) { if (v7->field_0 != 3) ssh_packet_disconnect(a2, "Received open failure for non-opening channel %d.", v7->field_4); v5 = sshpkt_get_u32(a2, &v4, &v4); if (v5) { sshlog("channels.c", "channel_input_open_failure", 0xd60, 0x1, 0x2, ssh_err(v5), "parse reason"); ssh_packet_disconnect(a2, "Invalid open failure message", 0xd60); } v5 = sshpkt_get_cstring(a2, &v6, 0x0, &v6); if (!v5) { v5 = sshpkt_get_string_direct(a2, 0x0, 0x0, &v6); if (!v5) v5 = sshpkt_get_end(a2); } if (v5 || v5 || v5) { sshlog("channels.c", "channel_input_open_failure", 0xd67, 0x1, 0x2, ssh_err(v5), "parse msg/lang"); ssh_packet_disconnect(a2, "Invalid open failure message", 0xd67); } if (v6) v10 = ": "; else v10 = &g_411b22; v2 = v10; v1 = reason2txt(*(&v4)); v0 = v7->field_4; sshlog("channels.c", "channel_input_open_failure", 0xd6a, 0x0, 0x3, 0x0, "channel %d: open failed: %s%s%s"); free(v6); if (v7->field_d0) { v3 = v7->field_4; sshlog("channels.c", "channel_input_open_failure", 0xd6e, 0x1, 0x6, 0x0, "channel %d: callback start"); v7->field_d0(a2, v7->field_4, 0, v7->field_d8, v7->field_d0); v3 = v7->field_4; sshlog("channels.c", "channel_input_open_failure", 0xd70, 0x1, 0x6, 0x0, "channel %d: callback done"); } chan_mark_dead(a2, v7, v7); } return 0; }
static Bool uInt64_isZero ( UInt64* n ) { Int32 i; for (i = 0; i < 8; i++) if (n->b[i] != 0) return 0; return 1; }
int uInt64_isZero(char *a0) { unsigned int v0; unsigned int v2; for (v0 = 0; v0 <= 7; v0 += 1) { if (a0[v0]) { v2 = 0; return v2; } } v2 = 1; return v2; }
&& match_pattern_list(alg, "rsa-sha2-512,rsa-sha2-256", 0) != 1) { sshlog("clientloop.c", __func__, 2162, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "server used untrusted RSA signature algorithm " "%s for key %zu, disregarding", alg, i) ; free(alg); sshkey_free(ctx->keys[i]); ctx->keys[i] = ((void *)0) ; ndone++; continue; }
void match_pattern_list(void) { halt_baddata(); }
static void check_perms (const struct group *gr, const struct sgrp *sg) { if (!(0 == bywho) && (Aflg || Mflg)) { failure (); } if (is_shadowgrp) { if (!(0 == bywho) && !is_on_list (sg->sg_adm, myname)) { failure (); } } else { if (!(0 == bywho)) { failure (); } } }
void check_perms(undefined8 param_1,long param_2) { char cVar1; if ((bywho != 0) && ((Aflg != '\0' || (Mflg != '\0')))) { failure(); } if (is_shadowgrp == '\0') { if (bywho != 0) { failure(); } } else if (bywho != 0) { cVar1 = is_on_list(*(undefined8 *)(param_2 + 0x10),myname); if (cVar1 != '\x01') { failure(); } } return; }
static _Bool three_arguments (void) { _Bool value; if (binop (argv[pos + 1])) value = binary_operator ( 0 ); else if ((strcmp (argv[pos], "!") == 0)) { advance ( 1 ); value = !two_arguments (); } else if ((strcmp (argv[pos], "(") == 0) && (strcmp (argv[pos + 2], ")") == 0)) { advance ( 0 ); value = one_argument (); advance ( 0 ); } else if ((strcmp (argv[pos + 1], "-a") == 0) || (strcmp (argv[pos + 1], "-o") == 0)) value = expr (); else test_syntax_error (gettext ("%s: binary operator expected"), quote (argv[pos + 1])); return (value); }
_BOOL8 three_arguments(long a1, const char *a2) { const char *v2; const char *v3; long v4; char *v5; long v6; long v7; long v8; long v9; bool v11; if ( binop(*(const char **)(8 * (pos + 1LL) + argv)) ) { return binary_operator(0, a2); } else if ( !strcmp(*(const char **)(8LL * pos + argv), "!") ) { advance(1); return !two_arguments(); } else if ( !strcmp(*(const char **)(8LL * pos + argv), "(") && !strcmp(*(const char **)(8 * (pos + 2LL) + argv), ")") ) { advance(0); v11 = one_argument(); advance(0); } else { v2 = "-a"; v3 = *(const char **)(8 * (pos + 1LL) + argv); if ( strcmp(v3, "-a") ) { v2 = "-o"; v3 = *(const char **)(8 * (pos + 1LL) + argv); if ( strcmp(v3, "-o") ) { v4 = quote(*(_QWORD *)(8 * (pos + 1LL) + argv)); v5 = gettext("%s: binary operator expected"); test_syntax_error((long)v5, v4, v6, v7, v8, v9); } } return (bool)expr((long)v3, v2); } return v11; }
char * quote_globbing_chars (string) const char *string; { size_t slen; char *temp, *t; const char *s, *send; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); slen = strlen (string); send = string + slen; temp = (char *)sh_xmalloc((slen * 2 + 1), "pathexp.c", 391); for (t = temp, s = string; *s; ) { if (glob_char_p (s)) *t++ = '\\'; do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _k; _k = is_basic (*(s)); if (_k) mblength = 1; else if (locale_utf8locale && ((*(s) & 0x80) == 0)) mblength = *(s) != 0; else { state_bak = state; mblength = mbrlen ((s), (send) - (s), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; mblength = 1; } else mblength = (mblength < 1) ? 1 : mblength; for (_k = 0; _k < mblength; _k++) *(t)++ = *(s)++; } else *(t)++ = *(s)++; } while (0); } *t = '\0'; return temp; }
char * quote_globbing_chars(char *param_1) { int iVar1; size_t sVar2; char *pcVar3; long in_FS_OFFSET; int local_54; char *local_50; char *local_48; ulong local_40; mbstate_t local_20; mbstate_t local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); memset(&local_20,0,8); sVar2 = strlen(param_1); pcVar3 = (char *)sh_xmalloc(sVar2 * 2 + 1,"pathexp.c",0x187); local_50 = pcVar3; local_48 = param_1; while (*local_48 != '\0') { iVar1 = glob_char_p(local_48); if (iVar1 != 0) { *local_50 = '\\'; local_50 = local_50 + 1; } if (locale_mb_cur_max < 2) { *local_50 = *local_48; local_50 = local_50 + 1; local_48 = local_48 + 1; } else { iVar1 = is_basic((int)*local_48); if (iVar1 == 0) { if ((locale_utf8locale == 0) || (*local_48 < '\0')) { local_18 = local_20; local_40 = mbrlen(local_48,(size_t)(param_1 + (sVar2 - (long)local_48)),&local_20); } else { local_40 = (ulong)(*local_48 != '\0'); } } else { local_40 = 1; } if ((local_40 == 0xfffffffffffffffe) || (local_40 == 0xffffffffffffffff)) { local_20 = local_18; local_40 = 1; } else if (local_40 == 0) { local_40 = 1; } for (local_54 = 0; (ulong)(long)local_54 < local_40; local_54 = local_54 + 1) { *local_50 = *local_48; local_50 = local_50 + 1; local_48 = local_48 + 1; } } } *local_50 = '\0'; if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return pcVar3; } __stack_chk_fail(); }
int sshsig_verify_fd(struct sshbuf *signature, int fd, const char *expect_namespace, struct sshkey **sign_keyp, struct sshkey_sig_details **sig_details) { struct sshbuf *b = ((void *)0) ; int r = -1; char *hashalg = ((void *)0) ; if (sig_details != ((void *)0) ) *sig_details = ((void *)0) ; if (sign_keyp != ((void *)0) ) *sign_keyp = ((void *)0) ; if ((r = sshsig_peek_hashalg(signature, &hashalg)) != 0) return r; sshlog("sshsig.c", __func__, 601, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "signature made with hash \"%s\"", hashalg); if ((r = hash_file(fd, hashalg, &b)) != 0) { sshlog("sshsig.c", __func__, 603, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "hash_file"); goto out; } if ((r = sshsig_wrap_verify(signature, hashalg, b, expect_namespace, sign_keyp, sig_details)) != 0) goto out; r = 0; out: sshbuf_free(b); free(hashalg); return r; }
long long sshsig_verify_fd(unsigned long long a0, unsigned long a1, char *a2, unsigned long long *a3, unsigned long long *a4) { unsigned long long v0; void* v1; unsigned int v2; void* v3; void* v4; unsigned long long v6; v3 = 0; v2 = -1; v4 = 0; if (a4) *(a4) = 0; if (a3) *(a3) = 0; v2 = sshsig_peek_hashalg(a0, &v4); if (v2) { v6 = v2; } else { v1 = v4; v0 = "signature made with hash \"%s\""; sshlog("sshsig.c", "sshsig_verify_fd", 0x259, 0x1, 0x5, 0x0); v2 = hash_file(a1, v4, &v3); if (v2) { v0 = "hash_file"; sshlog("sshsig.c", "sshsig_verify_fd", 0x25b, 0x1, 0x2, ssh_err(v2)); } else { v2 = sshsig_wrap_verify(a0, v4, v3, a2, a3, a4); if (!v2) v2 = 0; } sshbuf_free(v3); free(v4); v6 = v2; } return v6; }
static Session * session_by_channel(int id) { int i; for (i = 0; i < sessions_nalloc; i++) { Session *s = &sessions[i]; if (s->used && s->chanid == id) { sshlog("session.c", __func__, 1836, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "session_by_channel: session %d channel %d", i, id) ; return s; } } sshlog("session.c", __func__, 1841, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "session_by_channel: unknown channel %d", id); session_dump(); return ((void *)0) ; }
int session_by_channel(unsigned long a0) { unsigned long long v0; unsigned long v1; unsigned long long v2; unsigned long v3; unsigned int v4; unsigned int v5[48]; unsigned int v7; v4 = 0; while (true) { if (v4 < sessions_nalloc) { *(&v5[0]) = v4 * 232 + sessions; if (v5[0] && a0 == v5[47]) { v2 = a0; v1 = v4; v0 = "session_by_channel: session %d channel %d"; sshlog("session.c", "session_by_channel", 0x72c, 0x0, 0x5, 0x0); v7 = v5; break; } if (!v5[0] || a0 != v5[47]) v4 = __addvsi3(v4, 0x1); } else { v3 = a0; v2 = "session_by_channel: unknown channel %d"; sshlog("session.c", "session_by_channel", 0x731, 0x0, 0x5, 0x0); session_dump(); v7 = 0; break; } } return v7; }
int _rl_qsort_string_compare (char **s1, char **s2) { return (strcoll (*s1, *s2)); }
long long _rl_qsort_string_compare(unsigned long long *a0, unsigned long long *a1) { return strcoll(*(a0), *(a1)); }
static inline size_t xsum (size_t size1, size_t size2) { size_t sum = size1 + size2; return (sum >= size1 ? sum : (18446744073709551615UL) ); }
int xsum(unsigned long a0, unsigned long a1) { unsigned long v0; unsigned int v2; v0 = a1 + a0; if (v0 >= a0) v2 = v0; else v2 = -1; return v2; }
static int do_print_resource_record(struct passwd *pw, char *fname, char *hname, int print_generic) { struct sshkey *public; char *comment = ((void *)0) ; struct stat st; int r; if (fname == ((void *)0) ) sshfatal("ssh-keygen.c", __func__, 1490, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "no filename"); if (stat(fname, &st) == -1) { if ( (*__errno_location ()) == 2 ) return 0; sshfatal("ssh-keygen.c", __func__, 1494, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: %s", fname, strerror( (*__errno_location ()) )); } if ((r = sshkey_load_public(fname, &public, &comment)) != 0) sshfatal("ssh-keygen.c", __func__, 1497, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "Failed to read v2 public key from \"%s\"", fname); export_dns_rr(hname, public, stdout , print_generic); sshkey_free(public); free(comment); return 1; }
long do_print_resource_record(long a1, const char *a2, long a3, unsigned int a4) { int *v5; char *v6; long v7; unsigned int v10; long v11; void *ptr; struct stat v13; unsigned long v14; v14 = __readfsqword(0x28u); ptr = 0LL; if ( !a2 ) sshfatal("ssh-keygen.c", "do_print_resource_record", 1490LL, 1LL, 1LL, 0LL, "no filename"); if ( stat(a2, &v13) == -1 ) { if ( *_errno_location() == 2 ) return 0LL; v5 = _errno_location(); v6 = strerror(*v5); sshfatal("ssh-keygen.c", "do_print_resource_record", 1494LL, 0LL, 1LL, 0LL, "%s: %s", a2, v6); } v10 = sshkey_load_public(a2, &v11, &ptr); if ( v10 ) { v7 = ssh_err(v10); sshfatal( "ssh-keygen.c", "do_print_resource_record", 1497LL, 0LL, 1LL, v7, "Failed to read v2 public key from \"%s\"", a2); } export_dns_rr(a3, v11, stdout, a4); sshkey_free(v11); free(ptr); return 1LL; }
static void show_options(struct sshbuf *optbuf, int in_critical) { char *name, *arg, *hex; struct sshbuf *options, *option = ((void *)0) ; int r; if ((options = sshbuf_fromb(optbuf)) == ((void *)0) ) sshfatal("ssh-keygen.c", __func__, 2059, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_fromb failed"); while (sshbuf_len(options) != 0) { sshbuf_free(option); option = ((void *)0) ; if ((r = sshbuf_get_cstring(options, &name, ((void *)0) )) != 0 || (r = sshbuf_froms(options, &option)) != 0) sshfatal("ssh-keygen.c", __func__, 2065, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse option"); printf(" %s", name); if (!in_critical && (strcmp(name, "permit-X11-forwarding") == 0 || strcmp(name, "permit-agent-forwarding") == 0 || strcmp(name, "permit-port-forwarding") == 0 || strcmp(name, "permit-pty") == 0 || strcmp(name, "permit-user-rc") == 0 || strcmp(name, "no-touch-required") == 0)) { printf("\n"); } else if (in_critical && (strcmp(name, "force-command") == 0 || strcmp(name, "source-address") == 0)) { if ((r = sshbuf_get_cstring(option, &arg, ((void *)0) )) != 0) sshfatal("ssh-keygen.c", __func__, 2079, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse critical"); printf(" %s\n", arg); free(arg); } else if (in_critical && strcmp(name, "verify-required") == 0) { printf("\n"); } else if (sshbuf_len(option) > 0) { hex = sshbuf_dtob16(option); printf(" UNKNOWN OPTION: %s (len %zu)\n", hex, sshbuf_len(option)); sshbuf_reset(option); free(hex); } else printf(" UNKNOWN FLAG OPTION\n"); free(name); if (sshbuf_len(option) != 0) sshfatal("ssh-keygen.c", __func__, 2095, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Option corrupt: extra data at end"); } sshbuf_free(option); sshbuf_free(options); }
void show_options(undefined8 param_1,int param_2) { int iVar1; undefined8 uVar2; long lVar3; undefined *puVar4; char **ppcVar5; long in_FS_OFFSET; char *pcStack104; undefined8 uStack96; undefined auStack88 [4]; int local_54; undefined8 local_50; int local_3c; char *local_38; void *local_30; undefined8 local_28; long local_20; void *local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_28 = 0; uStack96 = 0x107ed6; local_54 = param_2; local_50 = param_1; local_20 = sshbuf_fromb(param_1); ppcVar5 = (char **)auStack88; if (local_20 != 0) goto LAB_00108234; ppcVar5 = &pcStack104; pcStack104 = "sshbuf_fromb failed"; sshfatal("ssh-keygen.c","show_options",0x80b,1,1,0); do { *(undefined8 *)((long)ppcVar5 + -8) = 0x107f2b; sshbuf_free(local_28); local_28 = 0; *(undefined8 *)((long)ppcVar5 + -8) = 0x107f4b; local_3c = sshbuf_get_cstring(local_20,&local_38,0); if (local_3c == 0) { *(undefined8 *)((long)ppcVar5 + -8) = 0x107f67; local_3c = sshbuf_froms(local_20,&local_28); puVar4 = (undefined *)ppcVar5; if (local_3c != 0) goto LAB_00107f70; } else { LAB_00107f70: *(undefined8 *)((long)ppcVar5 + -8) = 0x107f7a; uVar2 = ssh_err(local_3c); puVar4 = (undefined *)((long)ppcVar5 + -0x10); *(char **)((long)ppcVar5 + -0x10) = "parse option"; *(undefined8 *)((long)ppcVar5 + -0x18) = 0x107fb1; sshfatal("ssh-keygen.c","show_options",0x811,1,1,uVar2); } *(undefined8 *)(puVar4 + -8) = 0x107fc9; printf(" %s",local_38); if (local_54 == 0) { *(undefined8 *)(puVar4 + -8) = 0x107fe6; iVar1 = strcmp(local_38,"permit-X11-forwarding"); if (iVar1 != 0) { *(undefined8 *)(puVar4 + -8) = 0x107ffd; iVar1 = strcmp(local_38,"permit-agent-forwarding"); if (iVar1 != 0) { *(undefined8 *)(puVar4 + -8) = 0x108014; iVar1 = strcmp(local_38,"permit-port-forwarding"); if (iVar1 != 0) { *(undefined8 *)(puVar4 + -8) = 0x10802b; iVar1 = strcmp(local_38,"permit-pty"); if (iVar1 != 0) { *(undefined8 *)(puVar4 + -8) = 0x108042; iVar1 = strcmp(local_38,"permit-user-rc"); if (iVar1 != 0) { *(undefined8 *)(puVar4 + -8) = 0x108059; iVar1 = strcmp(local_38,"no-touch-required"); if (iVar1 != 0) goto LAB_00108073; } } } } } *(undefined8 *)(puVar4 + -8) = 0x10806e; printf("\n"); } else { LAB_00108073: if (local_54 == 0) { LAB_0010813a: if (local_54 != 0) { *(undefined8 *)(puVar4 + -8) = 0x108153; iVar1 = strcmp(local_38,"verify-required"); if (iVar1 == 0) { *(undefined8 *)(puVar4 + -8) = 0x108168; printf("\n"); goto LAB_001081dd; } } *(undefined8 *)(puVar4 + -8) = 0x108176; lVar3 = sshbuf_len(local_28); if (lVar3 == 0) { *(undefined8 *)(puVar4 + -8) = 0x1081dd; printf(" UNKNOWN FLAG OPTION\n"); } else { *(undefined8 *)(puVar4 + -8) = 0x108187; local_18 = (void *)sshbuf_dtob16(local_28); *(undefined8 *)(puVar4 + -8) = 0x108197; uVar2 = sshbuf_len(local_28); *(undefined8 *)(puVar4 + -8) = 0x1081b2; printf(" UNKNOWN OPTION: %s (len %zu)\n",local_18,uVar2); *(undefined8 *)(puVar4 + -8) = 0x1081be; sshbuf_reset(local_28); *(undefined8 *)(puVar4 + -8) = 0x1081ca; free(local_18); } } else { *(undefined8 *)(puVar4 + -8) = 0x108090; iVar1 = strcmp(local_38,"force-command"); if (iVar1 != 0) { *(undefined8 *)(puVar4 + -8) = 0x1080a7; iVar1 = strcmp(local_38,"source-address"); if (iVar1 != 0) goto LAB_0010813a; } *(undefined8 *)(puVar4 + -8) = 0x1080c7; local_3c = sshbuf_get_cstring(local_28,&local_30,0); if (local_3c != 0) { *(undefined8 *)(puVar4 + -8) = 0x1080da; uVar2 = ssh_err(local_3c); *(char **)(puVar4 + -0x10) = "parse critical"; *(undefined8 *)(puVar4 + -0x18) = 0x108111; sshfatal("ssh-keygen.c","show_options",0x81f,1,1,uVar2); puVar4 = puVar4 + -0x10; } *(undefined8 *)(puVar4 + -8) = 0x108129; printf(" %s\n",local_30); *(undefined8 *)(puVar4 + -8) = 0x108135; free(local_30); } } LAB_001081dd: *(undefined8 *)(puVar4 + -8) = 0x1081e9; free(local_38); *(undefined8 *)(puVar4 + -8) = 0x1081f5; lVar3 = sshbuf_len(local_28); ppcVar5 = (char **)puVar4; if (lVar3 != 0) { ppcVar5 = (char **)(puVar4 + -0x10); *(char **)(puVar4 + -0x10) = "Option corrupt: extra data at end"; *(undefined8 *)(puVar4 + -0x18) = 0x108234; sshfatal("ssh-keygen.c","show_options",0x82f,0,1,0); } LAB_00108234: *(undefined8 *)((long)ppcVar5 + -8) = 0x108240; lVar3 = sshbuf_len(local_20); if (lVar3 == 0) { *(undefined8 *)((long)ppcVar5 + -8) = 0x108255; sshbuf_free(local_28); *(undefined8 *)((long)ppcVar5 + -8) = 0x108261; sshbuf_free(local_20); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { *(undefined8 *)((long)ppcVar5 + -8) = 0x108276; __stack_chk_fail(); } return; } } while( true ); }