input
stringlengths
28
169k
output
stringlengths
20
317k
static void usage(void) { iplink_usage(); }
void usage() { iplink_usage(); }
static void xattr_acls_a_decoder (struct tar_stat_info *st, char const *keyword, char const *arg, size_t size) { st->acls_a_ptr = xmemdup (arg, size + 1); st->acls_a_len = size; }
long long xattr_acls_a_decoder(unsigned long long a0[9], unsigned long a1, unsigned long long a2, unsigned long long a3) { unsigned long v0; v0 = a1; a0[7] = xmemdup(a2, a3 + 1, a3 + 1, a3); a0[8] = a3; return a0; }
int xfrm_mode_parse(__u8 *mode, int *argcp, char ***argvp) { int argc = *argcp; char **argv = *argvp; if (matches(*argv, "transport") == 0) *mode = 0; else if (matches(*argv, "tunnel") == 0) *mode = 1; else if (matches(*argv, "ro") == 0) *mode = 2; else if (matches(*argv, "in_trigger") == 0) *mode = 3; else if (matches(*argv, "beet") == 0) *mode = 4; else invarg("MODE value is invalid", *argv); *argcp = argc; *argvp = argv; return 0; }
long long xfrm_mode_parse(char *a0, unsigned int *a1, unsigned long long *a2) { unsigned int v0; unsigned long long *v1; v0 = *(a1); v1 = *(a2); if ((matches(*(v1), "transport") ^ 1)) { *(a0) = 0; } else if ((matches(*(v1), "tunnel") ^ 1)) { *(a0) = 1; } else if ((matches(*(v1), "ro") ^ 1)) { *(a0) = 2; } else if ((matches(*(v1), "in_trigger") ^ 1)) { *(a0) = 3; } else if (!(matches(*(v1), "beet") ^ 1)) { invarg("MODE value is invalid", *(v1)); } else { *(a0) = 4; } *(a1) = v0; *(a2) = v1; return 0; }
void _rl_parse_colors(void) { const char *p; char *buf; int state; int ind_no; char label[3]; COLOR_EXT_TYPE *ext; p = sh_get_env_value ("LS_COLORS"); if (p == 0 || *p == '\0') { _rl_color_ext_list = ((void *)0) ; return; } ext = ((void *)0) ; strcpy (label, "??"); buf = color_buf = strcpy ((char *)xmalloc (1 + strlen (p)), (p)); state = 1; while (state > 0) { switch (state) { case 1: switch (*p) { case ':': ++p; break; case '*': ext = (COLOR_EXT_TYPE *)xmalloc (sizeof *ext); ext->next = _rl_color_ext_list; _rl_color_ext_list = ext; ++p; ext->ext.string = buf; state = (get_funky_string (&buf, &p, 1 , &ext->ext.len) ? 4 : -1); break; case '\0': state = 0; break; default: label[0] = *(p++); state = 2; break; } break; case 2: if (*p) { label[1] = *(p++); state = 3; } else state = -1; break; case 3: state = -1; if (*(p++) == '=') { for (ind_no = 0; indicator_name[ind_no] != ((void *)0) ; ++ind_no) { if ((((label)[0] == (indicator_name[ind_no])[0]) && (strcmp ((label), (indicator_name[ind_no])) == 0))) { _rl_color_indicator[ind_no].string = buf; state = (get_funky_string (&buf, &p, 0 , &_rl_color_indicator[ind_no].len) ? 1 : -1); break; } } if (state == -1) { _rl_errmsg ("LS_COLORS: unrecognized prefix: %s", label); while (p && *p && *p != ':') p++; if (p && *p == ':') state = 1; else if (p && *p == 0) state = 0; } } break; case 4: if (*(p++) == '=') { ext->seq.string = buf; state = (get_funky_string (&buf, &p, 0 , &ext->seq.len) ? 1 : -1); } else state = -1; if (state == -1 && ext->ext.string) _rl_errmsg ("LS_COLORS: syntax error: %s", ext->ext.string); break; } } if (state < 0) { COLOR_EXT_TYPE *e; COLOR_EXT_TYPE *e2; _rl_errmsg ("unparsable value for LS_COLORS environment variable"); free (color_buf); for (e = _rl_color_ext_list; e != ((void *)0) ; ) { e2 = e; e = e->next; free (e2); } _rl_color_ext_list = ((void *)0) ; _rl_colored_stats = 0; } }
void _rl_parse_colors(void) { char *pcVar1; void *__ptr; char cVar2; int iVar3; size_t sVar4; char *__dest; long in_FS_OFFSET; int local_58; int local_54; char *local_50; char *local_48; void *local_40; void *local_38; void *local_30; char local_23; char local_22; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_50 = (char *)sh_get_env_value("LS_COLORS"); if ((local_50 == (char *)0x0) || (*local_50 == '\0')) { _rl_color_ext_list = (void *)0x0; } else { local_40 = (void *)0x0; strcpy(&local_23,"??"); pcVar1 = local_50; sVar4 = strlen(local_50); __dest = (char *)xmalloc(sVar4 + 1); color_buf = strcpy(__dest,pcVar1); local_58 = 1; local_48 = color_buf; LAB_001007d1: if (0 < local_58) { if (local_58 == 4) { if (*local_50 == '=') { *(char **)((long)local_40 + 0x18) = local_48; local_50 = local_50 + 1; cVar2 = get_funky_string(&local_48,&local_50,0,(long)local_40 + 0x10); if (cVar2 == '\0') { local_58 = -1; } else { local_58 = 1; } } else { local_58 = -1; local_50 = local_50 + 1; } if ((local_58 == -1) && (*(long *)((long)local_40 + 8) != 0)) { _rl_errmsg("LS_COLORS: syntax error: %s",*(undefined8 *)((long)local_40 + 8)); } } else if (local_58 < 5) { if (local_58 == 3) { local_58 = -1; pcVar1 = local_50 + 1; cVar2 = *local_50; local_50 = pcVar1; if (cVar2 == '=') { local_54 = 0; while (*(long *)(indicator_name + (long)local_54 * 8) != 0) { if ((local_23 == **(char **)(indicator_name + (long)local_54 * 8)) && (iVar3 = strcmp(&local_23,*(char **)(indicator_name + (long)local_54 * 8)), iVar3 == 0)) { *(char **)(_rl_color_indicator + (long)local_54 * 0x10 + 8) = local_48; cVar2 = get_funky_string(&local_48,&local_50,0, _rl_color_indicator + (long)local_54 * 0x10); if (cVar2 == '\0') { local_58 = -1; } else { local_58 = 1; } break; } local_54 = local_54 + 1; } if (local_58 == -1) { _rl_errmsg("LS_COLORS: unrecognized prefix: %s",&local_23); for (; ((local_50 != (char *)0x0 && (*local_50 != '\0')) && (*local_50 != ':')); local_50 = local_50 + 1) { } if ((local_50 == (char *)0x0) || (*local_50 != ':')) { if ((local_50 != (char *)0x0) && (*local_50 == '\0')) { local_58 = 0; } } else { local_58 = 1; } } } goto LAB_001007d1; } if (3 < local_58) goto LAB_001007d1; if (local_58 != 1) { if (local_58 == 2) { if (*local_50 == '\0') { local_58 = -1; } else { local_22 = *local_50; local_58 = 3; local_50 = local_50 + 1; } } goto LAB_001007d1; } cVar2 = *local_50; if (cVar2 != ':') { if (cVar2 < ';') { if (cVar2 == '\0') { local_58 = 0; goto LAB_001007d1; } if (cVar2 == '*') { local_40 = (void *)xmalloc(0x28); *(void **)((long)local_40 + 0x20) = _rl_color_ext_list; local_50 = local_50 + 1; _rl_color_ext_list = local_40; *(char **)((long)local_40 + 8) = local_48; cVar2 = get_funky_string(&local_48,&local_50,1,local_40); if (cVar2 == '\0') { local_58 = -1; } else { local_58 = 4; } goto LAB_001007d1; } } local_23 = *local_50; local_58 = 2; local_50 = local_50 + 1; goto LAB_001007d1; } local_50 = local_50 + 1; } goto LAB_001007d1; } if (local_58 < 0) { _rl_errmsg("unparsable value for LS_COLORS environment variable"); free(color_buf); local_38 = _rl_color_ext_list; while (__ptr = local_38, local_38 != (void *)0x0) { local_30 = local_38; local_38 = *(void **)((long)local_38 + 0x20); free(__ptr); } _rl_color_ext_list = (void *)0x0; __rl_colored_stats = 0; } } if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
int sshkey_type_is_cert(int type) { const struct keytype *kt; for (kt = keytypes; kt->type != -1; kt++) { if (kt->type == type) return kt->cert; } return 0; }
int sshkey_type_is_cert(unsigned long a0) { unsigned long long v0; unsigned int v2; for (v0 = &keytypes; *((v0 + 24)) != -1; v0 += 40) { if (a0 == *((v0 + 24))) { v2 = *((v0 + 32)); return v2; } } v2 = 0; return v2; }
static struct ipv6_rpl_sr_hdr *parse_rpl_srh(char *segbuf) { struct ipv6_rpl_sr_hdr *srh; int nsegs = 0; int srhlen; char *s; int i; s = segbuf; for (i = 0; *s; *s++ == ',' ? i++ : *s); nsegs = i + 1; srhlen = 8 + 16 * nsegs; srh = calloc(1, srhlen); srh->hdrlen = (srhlen >> 3) - 1; srh->type = 3; srh->segments_left = nsegs; for (s = strtok(segbuf, ","); s; s = strtok( ((void *)0) , ",")) { inet_prefix addr; get_addr(&addr, s, 10 ); memcpy(&srh->segments.addr[i], addr.data, sizeof(struct in6_addr)); i--; } return srh; }
int parse_rpl_srh(char *a0) { unsigned int v0; int tmp_9; unsigned int v1; unsigned int v2; unsigned long long v3; char v4[4]; char v5; char v6; v1 = 0; v3 = a0; v0 = 0; while (true) { if (*(v3)) { tmp_9 = v3; v3 += 1; if (*(tmp_9) == 44) v0 += 1; } else { v1 = v0 + 1; v2 = (v1 * 16) + 8; *(&v4) = calloc(0x1, v2); v4[1] = (v2 >> 3) - 1; v4[2] = 3; v4[3] = v1; for (v3 = strtok(a0, ","); v3; v3 = strtok(NULL, ",")) { get_addr(&v5, v3, 0xa, v3); memcpy(&v4[4 * v0 + 8], &v6, 0x10); v0 -= 1; } return v4; } } }
const char * ssh_remote_ipaddr(struct ssh *ssh) { int sock; if (ssh->remote_ipaddr == ((void *)0) ) { if (ssh_packet_connection_is_on_socket(ssh)) { sock = ssh->state->connection_in; ssh->remote_ipaddr = get_peer_ipaddr(sock); ssh->remote_port = get_peer_port(sock); ssh->local_ipaddr = get_local_ipaddr(sock); ssh->local_port = get_local_port(sock); } else { ssh->remote_ipaddr = xstrdup("UNKNOWN"); ssh->remote_port = 65535; ssh->local_ipaddr = xstrdup("UNKNOWN"); ssh->local_port = 65535; } } return ssh->remote_ipaddr; }
int ssh_remote_ipaddr(struct_0 *a0) { unsigned int v0; if (!a0->field_10) { if (ssh_packet_connection_is_on_socket(a0)) { v0 = a0->field_0->field_0; a0->field_10 = get_peer_ipaddr(v0); a0->field_18 = get_peer_port(v0); a0->field_20 = get_local_ipaddr(v0); a0->field_28 = get_local_port(v0); } else { a0->field_10 = xstrdup("UNKNOWN"); a0->field_18 = 65535; a0->field_20 = xstrdup("UNKNOWN"); a0->field_28 = 65535; } } return a0->field_10; }
static int ipvrf_exec(int argc, char **argv) { if (argc < 1) { fprintf( stderr , "No VRF name specified\n"); return -1; } if (argc < 2) { fprintf( stderr , "No command specified\n"); return -1; } return -cmd_exec(argv[1], argv + 1, !!batch_mode, do_switch, argv[0]); }
void ipvrf_exec(unsigned long a0, unsigned long long a1[2]) { unsigned long long v1; unsigned long long v2; unsigned long long v3; if (a0 <= 0) { fprintf(*(&stderr), "No VRF name specified\n"); v1 = 4294967295; return; } else if (a0 > 1) { v3 = -(cmd_exec(a1[1], &a1[1], batch_mode, do_switch, a1[0])); return; } else { fprintf(*(&stderr), "No command specified\n"); v2 = 4294967295; return; } }
int rl_history_search_backward (int count, int ignore) { if (count == 0) return (0); if (rl_last_func != rl_history_search_forward && rl_last_func != rl_history_search_backward) rl_history_search_reinit (0x01); if (_rl_history_search_len == 0) return (rl_get_previous_history (count, ignore)); return (rl_history_search_internal ((((count) >= 0) ? (count) : -(count)), (count > 0) ? -1 : 1)); }
long rl_history_search_backward(int a1, unsigned int a2) { unsigned int v3; if ( !a1 ) return 0LL; if ( (long ( *)(int, unsigned int))rl_last_func != rl_history_search_forward && (long ( *)(int, unsigned int))rl_last_func != rl_history_search_backward ) { rl_history_search_reinit(1); } if ( !rl_history_search_len ) return rl_get_previous_history((unsigned int)a1, a2); if ( a1 <= 0 ) v3 = 1; else v3 = -1; return rl_history_search_internal(abs32(a1), v3); }
errcode_t e2fsck_rebuild_extents_later(e2fsck_t ctx, ext2_ino_t ino) { errcode_t retval = 0; if (!ext2fs_has_feature_extents(ctx->fs->super) || (ctx->options & 0x0008) || (ino != 2 && ino < ctx->fs->super->s_first_ino)) return 0; if (ctx->flags & 0x8000) return e2fsck_rebuild_extents(ctx, ino); if (!ctx->inodes_to_rebuild) retval = e2fsck_allocate_inode_bitmap(ctx->fs, (gettext ("extent rebuild inode map")), 2, "inodes_to_rebuild", &ctx->inodes_to_rebuild); if (retval) return retval; ext2fs_mark_inode_bitmap2(ctx->inodes_to_rebuild, ino); return 0; }
long e2fsck_rebuild_extents_later(_QWORD *a1, unsigned int a2) { char *v3; long inode_bitmap; inode_bitmap = 0LL; if ( !ext2fs_has_feature_extents(*(_QWORD *)(*a1 + 32LL)) || (*((_DWORD *)a1 + 19) & 8) != 0 || a2 != 2 && a2 < *(_DWORD *)(*(_QWORD *)(*a1 + 32LL) + 84LL) ) { return 0LL; } if ( (a1[9] & 0x8000) != 0 ) return e2fsck_rebuild_extents(a1, a2); if ( !a1[116] ) { v3 = gettext("extent rebuild inode map"); inode_bitmap = e2fsck_allocate_inode_bitmap(*a1, v3, 2LL, "inodes_to_rebuild", a1 + 116); } if ( inode_bitmap ) return inode_bitmap; ext2fs_mark_inode_bitmap2(a1[116], a2); return 0LL; }
void rl_callback_handler_remove (void) { rl_linefunc = ((void *)0) ; (rl_readline_state &= ~(0x0080000)); do { if (_rl_caught_signal) _rl_signal_handler (_rl_caught_signal); } while (0); if (in_handler) { in_handler = 0; if (rl_deprep_term_function) (*rl_deprep_term_function) (); rl_clear_signals (); } }
long rl_callback_handler_remove() { long result; rl_linefunc = 0LL; rl_readline_state &= ~0x80000uLL; if ( rl_caught_signal ) rl_signal_handler(rl_caught_signal); result = (unsigned int)in_handler; if ( in_handler ) { in_handler = 0; if ( rl_deprep_term_function ) rl_deprep_term_function(); return rl_clear_signals(); } return result; }
static void add_char_segment (struct transform *tf, int chr) { struct replace_segm *segm = add_segment (tf); segm->type = segm_literal; segm->v.literal.ptr = xmalloc (2); segm->v.literal.ptr[0] = chr; segm->v.literal.ptr[1] = 0; segm->v.literal.size = 1; }
void add_char_segment(void* a0, unsigned long a1) { struct_1 *v0; struct_0 *v3; *(&v0) = add_segment(a0); v0->field_8 = 0; v0->field_10 = xmalloc(0x2); v0->field_10->field_0 = a1; v0->field_10->field_1 = 0; v3 = v0; v0->field_18 = 1; return; }
static inline struct line * buffer_linelim (struct buffer const *buf) { void *linelim = buf->buf + buf->alloc; return linelim; }
long buffer_linelim(_QWORD *a1) { return *a1 + a1[3]; }
void crypto_sign_ed25519_ref_sc25519_mul_shortsc(crypto_sign_ed25519_ref_sc25519 *r, const crypto_sign_ed25519_ref_sc25519 *x, const crypto_sign_ed25519_ref_shortsc25519 *y) { crypto_sign_ed25519_ref_sc25519 t; crypto_sign_ed25519_ref_sc25519_from_shortsc(&t, y); crypto_sign_ed25519_ref_sc25519_mul(r, x, &t); }
long long crypto_sign_ed25519_ref_sc25519_mul_shortsc(unsigned long long a0, unsigned int *a1, unsigned int *a2) { char v0; crypto_sign_ed25519_ref_sc25519_from_shortsc(&v0, a2); crypto_sign_ed25519_ref_sc25519_mul(a0, a1, &v0); return 0; }
static void default_bzfree ( void* opaque, void* addr ) { if (addr != ((void *)0) ) free ( addr ); }
void default_bzfree(undefined8 param_1,void *param_2) { if (param_2 != (void *)0x0) { free(param_2); } return; }
static void client_global_hostkeys_private_confirm(struct ssh *ssh, int type, u_int32_t seq, void *_ctx) { struct hostkeys_update_ctx *ctx = (struct hostkeys_update_ctx *)_ctx; size_t i, ndone; struct sshbuf *signdata; int r, plaintype; const u_char *sig; const char *rsa_kexalg = ((void *)0) ; char *alg = ((void *)0) ; size_t siglen; if (ctx->nnew == 0) sshfatal("clientloop.c", __func__, 2116, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "ctx->nnew == 0"); if (type != 81) { sshlog("clientloop.c", __func__, 2118, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Server failed to confirm ownership of " "private host keys") ; hostkeys_update_ctx_free(ctx); return; } if (sshkey_type_plain(sshkey_type_from_name( ssh->kex->hostkey_alg)) == KEY_RSA) rsa_kexalg = ssh->kex->hostkey_alg; if ((signdata = sshbuf_new()) == ((void *)0) ) sshfatal("clientloop.c", __func__, 2127, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); for (ndone = i = 0; i < ctx->nkeys; i++) { if (ctx->keys_match[i]) continue; plaintype = sshkey_type_plain(ctx->keys[i]->type); sshbuf_reset(signdata); if ( (r = sshbuf_put_cstring(signdata, "hostkeys-prove-00@openssh.com")) != 0 || (r = sshbuf_put_stringb(signdata, ssh->kex->session_id)) != 0 || (r = sshkey_puts(ctx->keys[i], signdata)) != 0) sshfatal("clientloop.c", __func__, 2144, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose signdata"); if ((r = sshpkt_get_string_direct(ssh, &sig, &siglen)) != 0) { sshlog("clientloop.c", __func__, 2147, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "parse sig"); goto out; } if ((r = sshkey_get_sigtype(sig, siglen, &alg)) != 0) { sshlog("clientloop.c", __func__, 2151, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "server gave unintelligible signature " "for %s key %zu", sshkey_type(ctx->keys[i]), i) ; goto out; } if (plaintype == KEY_RSA && rsa_kexalg == ((void *)0) && 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; } sshlog("clientloop.c", __func__, 2171, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "verify %s key %zu using sigalg %s", sshkey_type(ctx->keys[i]), i, alg) ; free(alg); if ((r = sshkey_verify(ctx->keys[i], sig, siglen, sshbuf_ptr(signdata), sshbuf_len(signdata), plaintype == KEY_RSA ? rsa_kexalg : ((void *)0) , 0, ((void *)0) )) != 0) { sshlog("clientloop.c", __func__, 2177, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "server gave bad signature for %s key %zu", sshkey_type(ctx->keys[i]), i) ; goto out; } ctx->keys_verified[i] = 1; ndone++; } if (ndone != ctx->nnew) sshfatal("clientloop.c", __func__, 2187, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "ndone != ctx->nnew (%zu / %zu)", ndone, ctx->nnew); if ((r = sshpkt_get_end(ssh)) != 0) { sshlog("clientloop.c", __func__, 2189, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "protocol error"); goto out; } update_known_hosts(ctx); out: hostkeys_update_ctx_free(ctx); }
long long client_global_hostkeys_private_confirm(struct_0 *a0, unsigned long a1, unsigned long long a2, unsigned long long a3[7]) { unsigned long long v0; unsigned int v1; unsigned int v2; unsigned int v3; char v4; void* v5; char v6; void* v7; void* v8; void* v9; unsigned long long v10; unsigned long long v11; unsigned long v12; void* v13; void* v14; char v15; unsigned long long v18; void* v19; v1 = a2; v9 = 0; v5 = 0; if (!a3[6]) { v0 = "ctx->nnew == 0"; sshfatal("clientloop.c", "client_global_hostkeys_private_confirm", 0x844, 0x1, 0x1, 0x0); } if (a1 != 81) { v13 = "Server failed to confirm ownership of private host keys"; sshlog("clientloop.c", "client_global_hostkeys_private_confirm", 0x846, 0x0, 0x2, 0x0); hostkeys_update_ctx_free(a3); } else { if (!sshkey_type_plain(sshkey_type_from_name(a0->field_8->field_28))) v9 = a0->field_8->field_28; v10 = sshbuf_new(a0, "client_global_hostkeys_private_confirm", 0x844, 0x1, 0x1, 0x0); if (!v10) { v13 = "sshbuf_new failed"; sshfatal("clientloop.c", "client_global_hostkeys_private_confirm", 0x84f, 0x1, 0x1, 0x0); } v7 = 0; v8 = v7; while (true) { if (v7 < a3[5]) { if (!*((a3[3] + (v7 << 2)))) { v3 = sshkey_type_plain(*(*((a3[2] + v7 * 8)))); sshbuf_reset(v10); v2 = sshbuf_put_cstring(v10, "hostkeys-prove-00@openssh.com", a2); if (!v2) { v2 = sshbuf_put_stringb(v10, a0->field_8->field_70, a0->field_8->field_70); if (!v2) v2 = sshkey_puts(*((a3[2] + v7 * 8)), v10, v10); } if (v2 || v2 || v2) { v13 = "compose signdata"; sshfatal("clientloop.c", "client_global_hostkeys_private_confirm", 0x860, 0x1, 0x1, ssh_err(v2)); } v2 = sshpkt_get_string_direct(a0, &v4, &v6, &v4); if (v2) { v13 = "parse sig"; sshlog("clientloop.c", "client_global_hostkeys_private_confirm", 0x863, 0x1, 0x2, ssh_err(v2)); break; } else { v2 = sshkey_get_sigtype(*(&v4), *(&v6), &v5, *(&v6)); if (v2) { v13 = v7; v12 = sshkey_type(*((a3[2] + v7 * 8))); v11 = "server gave unintelligible signature for %s key %zu"; sshlog("clientloop.c", "client_global_hostkeys_private_confirm", 0x867, 0x1, 0x2, ssh_err(v2)); break; } else { if (!v3 && !v9) { v18 = match_pattern_list(v5, "rsa-sha2-512,rsa-sha2-256", 0x0); if (v18 != 1) { v13 = v7; v12 = v5; v11 = "server used untrusted RSA signature algorithm %s for key %zu, disregarding"; sshlog("clientloop.c", "client_global_hostkeys_private_confirm", 0x872, 0x1, 0x5, 0x0); free(v5); sshkey_free(*((a3[2] + v7 * 8))); *((a3[2] + v7 * 8)) = 0; v8 += 1; } } if (v18 == 1 || v9 || v3) { v14 = v5; v13 = v7; v12 = sshkey_type(*((a3[2] + v7 * 8))); v11 = "verify %s key %zu using sigalg %s"; sshlog("clientloop.c", "client_global_hostkeys_private_confirm", 0x87b, 0x1, 0x7, 0x0); free(v5); if (!v3) v19 = v9; else v19 = 0; v14 = 0; v13 = 0; v2 = sshkey_verify(*((a3[2] + v7 * 8)), *(&v4), *(&v6), sshbuf_ptr(v10), sshbuf_len(v10), v19, *(&v15)); if (v2) { v13 = v7; v12 = sshkey_type(*((a3[2] + v7 * 8))); v11 = "server gave bad signature for %s key %zu"; sshlog("clientloop.c", "client_global_hostkeys_private_confirm", 0x881, 0x1, 0x2, ssh_err(v2)); break; } else { *((a3[4] + v7 * 4)) = 1; v8 += 1; } } } } } if (*((a3[3] + (v7 << 2))) || !v2 && !v2 && !v2 || !v9 && !v2 && !v2 && !v3 && v18 != 1) v7 += 1; } else { if (v8 != a3[6]) { v13 = a3[6]; v12 = v8; v11 = "ndone != ctx->nnew (%zu / %zu)"; sshfatal("clientloop.c", "client_global_hostkeys_private_confirm", 0x88b, 0x1, 0x1, 0x0); } v2 = sshpkt_get_end(a0); if (v2) { v13 = "protocol error"; sshlog("clientloop.c", "client_global_hostkeys_private_confirm", 0x88d, 0x1, 0x2, 0x0); break; } else { update_known_hosts(a3); break; } } } hostkeys_update_ctx_free(a3); } return 0; }
static int handle_conn_read(u_int socknum) { char buf[(4096)]; ssize_t len; int r; if ((len = read(sockets[socknum].fd, buf, sizeof(buf))) <= 0) { if (len == -1) { if ( (*__errno_location ()) == 11 || (*__errno_location ()) == 4 ) return 0; sshlog("ssh-agent.c", __func__, 1773, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "read error on socket %u (fd %d): %s", socknum, sockets[socknum].fd, strerror( (*__errno_location ()) )) ; } return -1; } if ((r = sshbuf_put(sockets[socknum].input, buf, len)) != 0) sshfatal("ssh-agent.c", __func__, 1779, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose"); explicit_bzero(buf, sizeof(buf)); for (;;) { if ((r = process_message(socknum)) == -1) return -1; else if (r == 0) break; } return 0; }
int handle_conn_read(unsigned long a0) { char v0; unsigned int v1; unsigned long long v2; char v3; char v4; unsigned int v8; v4 = *(&v4); v2 = read(*((a0 * 48 + sockets)), &v3, 0x1000); if (v2 > 0) { v1 = sshbuf_put(*((a0 * 48 + sockets + 8)), &v3, v2, &v3); if (v1) sshfatal("ssh-agent.c", "handle_conn_read", 0x6f3, 0x1, 0x1, ssh_err(v1)); explicit_bzero(&v3, 0x1000); while (true) { v1 = process_message(a0); if (v1 == -1) { v8 = -1; return v8; } if (!v1) { v8 = 0; return v8; } } } else if (v2 != -1) { v8 = -1; return v8; } else if (*(__errno_location()) == 11) { v8 = 0; return v8; } else if (*(__errno_location()) == 4) { v8 = 0; return v8; } else { sshlog("ssh-agent.c", "handle_conn_read", 0x6ed, 0x1, 0x2, 0x0, "read error on socket %u (fd %d): %s", a0, *((a0 * 48 + sockets)), strerror(*(__errno_location())), *(&v0)); v8 = -1; return v8; } }
void sh_notfound (s) char *s; { builtin_error (gettext("%s: not found"), s); }
long long sh_notfound(unsigned long a0) { unsigned long v0; v0 = a0; gettext("%s: not found"); return builtin_error(); }
int vasnmprintf(char **str, size_t maxsz, int *wp, const char *fmt, va_list ap) { char *src; char *sp; char *dst; char *dp; char *tp; size_t sz; wchar_t wc; int len; int ret; int width; int total_width, max_width, print; src = ((void *)0) ; if ((ret = vasprintf(&src, fmt, ap)) <= 0) goto fail; sz = strlen(src) + 1; if ((dst = malloc(sz)) == ((void *)0) ) { free(src); ret = -1; goto fail; } if (maxsz > 0x7fffffff) maxsz = 0x7fffffff; sp = src; dp = dst; ret = 0; print = 1; total_width = 0; max_width = wp == ((void *)0) ? 0x7fffffff : *wp; while (*sp != '\0') { if ((len = mbtowc(&wc, sp, (__ctype_get_mb_cur_max ()) )) == -1) { (void)mbtowc( ((void *)0) , ((void *)0) , (__ctype_get_mb_cur_max ()) ); if (dangerous_locale()) { ret = -1; break; } len = 1; width = -1; } else if (wp == ((void *)0) && (wc == L'\n' || wc == L'\r' || wc == L'\t')) { width = 0; } else if ((width = wcwidth(wc)) == -1 && dangerous_locale()) { ret = -1; break; } if (width >= 0) { if (print && (dp - dst >= (int)maxsz - len || total_width > max_width - width)) print = 0; if (print) { if (grow_dst(&dst, &sz, maxsz, &dp, len) == -1) { ret = -1; break; } total_width += width; memcpy(dp, sp, len); dp += len; } sp += len; if (ret >= 0) ret += len; continue; } while (len > 0) { if (print && (dp - dst >= (int)maxsz - 4 || total_width > max_width - 4)) print = 0; if (print) { if (grow_dst(&dst, &sz, maxsz, &dp, 4) == -1) { ret = -1; break; } tp = vis(dp, *sp, 0x01 | 0x400, 0); width = tp - dp; total_width += width; dp = tp; } else width = 4; len--; sp++; if (ret >= 0) ret += width; } if (len > 0) break; } free(src); *dp = '\0'; *str = dst; if (wp != ((void *)0) ) *wp = total_width; if (ret < (int)maxsz && !print) ret = -1; return ret; fail: if (wp != ((void *)0) ) *wp = 0; if (ret == 0) { *str = src; return 0; } else { *str = ((void *)0) ; return -1; } }
int vasnmprintf(unsigned long long *a0, unsigned long long a1, unsigned int *a2, char *a3, unsigned long a4) { unsigned long long v0; char v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; void* v8; void* v9; unsigned long v10; unsigned int v11; void* v12; unsigned long long v13; unsigned int v16; v0 = a1; v8 = 0; v3 = vasprintf(&v8, a3, a4); if (v3 > 0) { *(&v11) = strlen(v8) + 1; v9 = malloc(*(&v11)); if (v9) { if (v0 >= 0x80000000) v0 = 2147483647; v12 = v8; v10 = v9; v3 = 0; v6 = 1; v5 = 0; v7 = (!a2 ? *(a2) : 2147483647); while (true) { if (!*(v12)) break; v2 = mbtowc(&v1, v12, __ctype_get_mb_cur_max()); if (v2 == -1) { mbtowc(NULL, NULL, __ctype_get_mb_cur_max()); if (!dangerous_locale()) { v2 = 1; v4 = -1; } else { v3 = -1; break; } } else { if (!(!a2)) goto LABEL_400332; switch (*(&v1)) { case 9: case 10: case 13: v4 = 0; break; default: LABEL_400332: v4 = wcwidth(*(&v1)); if (v4 == -1 && dangerous_locale()) { v3 = -1; goto LABEL_400563; } } } if (v4 < 0) { while (true) { if (v2 <= 0) break; if (v6 && (__subvdi3(v10, v9, v9) >= __addvsi3(v0, 0xfffffffc) || v5 > __addvsi3(v7, 0xfffffffc))) v6 = 0; if (!v6) { v4 = 4; } else if (grow_dst(&v9, &v11, v0, &v10, 0x4) != -1) { v13 = vis(v10, *(v12), 0x401, 0x0); v4 = __subvdi3(v13, v10, 0x401); v5 = __addvsi3(v5, v4); v10 = v13; } else { v3 = -1; break; } v2 = __addvsi3(v2, 0xffffffff); v12 += 1; if (v3 >= 0) v3 = __addvsi3(v3, v4); } if (v2 > 0) break; } else { if (v6 && (__subvdi3(v10, v9, v9) >= __subvsi3(v0, v2) || v5 > __subvsi3(v7, v4))) v6 = 0; if (v6) { if (grow_dst(&v9, &v11, v0, &v10, v2) != -1) { v5 = __addvsi3(v5, v4); memcpy(v10, v12, v2); v10 = &v10[v2]; } else { v3 = -1; break; } } v12 += v2; if (v3 >= 0) v3 = __addvsi3(v3, v2); } } LABEL_400563: free(v8); *(v10) = 0; *(a0) = v9; if (a2) *(a2) = v5; if (v3 < v0 && !v6) v3 = -1; v16 = v3; return v16; } free(v8); v3 = -1; } if (a2) *(a2) = 0; if (!v3) { *(a0) = v8; v16 = 0; return v16; } *(a0) = 0; v16 = -1; return v16; }
int input_avail (fd) int fd; { int result, chars_avail; fd_set readfds, exceptfds; struct timeval timeout; if (fd < 0) return -1; chars_avail = 0; do { unsigned int __i; fd_set *__arr = ( &readfds ); for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) ((__arr)->fds_bits)[__i] = 0; } while (0) ; do { unsigned int __i; fd_set *__arr = ( &exceptfds ); for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) ((__arr)->fds_bits)[__i] = 0; } while (0) ; ((void) ((( &readfds )->fds_bits)[(( fd ) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << (( fd ) % (8 * (int) sizeof (__fd_mask))))))) ; ((void) ((( &exceptfds )->fds_bits)[(( fd ) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << (( fd ) % (8 * (int) sizeof (__fd_mask))))))) ; timeout.tv_sec = 0; timeout.tv_usec = 0; result = select (fd + 1, &readfds, (fd_set *) ((void *)0) , &exceptfds, &timeout); return ((result <= 0) ? 0 : 1); (*__errno_location ()) = 0; result = ioctl (fd, 0x541B , &chars_avail); if (result == -1 && (*__errno_location ()) == 5 ) return -1; return (chars_avail); return 0; }
ulong input_avail(int param_1) { byte bVar1; int iVar2; ulong uVar3; long in_FS_OFFSET; uint local_144; uint local_140; timeval local_128; fd_set local_118; fd_set local_98; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); if (param_1 < 0) { uVar3 = 0xffffffff; } else { for (local_144 = 0; local_144 < 0x10; local_144 = local_144 + 1) { local_118.fds_bits[local_144] = 0; } for (local_140 = 0; local_140 < 0x10; local_140 = local_140 + 1) { local_98.fds_bits[local_140] = 0; } iVar2 = param_1; if (param_1 < 0) { iVar2 = param_1 + 0x3f; } bVar1 = (byte)(param_1 >> 0x37); local_118.fds_bits[iVar2 >> 6] = local_118.fds_bits[iVar2 >> 6] | 1 << (((char)param_1 + (bVar1 >> 2) & 0x3f) - (bVar1 >> 2) & 0x3f); iVar2 = param_1; if (param_1 < 0) { iVar2 = param_1 + 0x3f; } local_98.fds_bits[iVar2 >> 6] = local_98.fds_bits[iVar2 >> 6] | 1 << (((char)param_1 + (bVar1 >> 2) & 0x3f) - (bVar1 >> 2) & 0x3f); local_128.tv_sec = 0; local_128.tv_usec = 0; iVar2 = select(param_1 + 1,&local_118,(fd_set *)0x0,&local_98,&local_128); uVar3 = (ulong)(0 < iVar2); } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar3; }
static int rpl_fcntl_DUPFD (int fd, int target) { int result; result = fcntl (fd, 0 , target); return result; }
int rpl_fcntl_DUPFD(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned int v1; v0 = a1; v1 = fcntl(a0, 0x0); return v1; }
static void treedelta (struct tree const *tree, idx_t depth, unsigned char delta[]) { if (!tree) return; treedelta (tree->llink, depth, delta); treedelta (tree->rlink, depth, delta); if (depth < delta[tree->label]) delta[tree->label] = depth; }
void treedelta(undefined8 *param_1,long param_2,long param_3) { if (param_1 != (undefined8 *)0x0) { treedelta(*param_1,param_2,param_3); treedelta(param_1[1],param_2,param_3); if (param_2 < (long)(ulong)*(byte *)(param_3 + (ulong)*(byte *)(param_1 + 3))) { *(char *)(param_3 + (ulong)*(byte *)(param_1 + 3)) = (char)param_2; } } return; }
void xfree (void * string) { if (string) free (string); }
long long xfree(void* a0) { return free(a0); }
static void verify_numeric (char const *s, char const *end) { if ( (*__errno_location ()) ) { error (0, (*__errno_location ()) , "%s", quote (s)); exit_status = 1 ; } else if (*end) { if (s == end) error (0, 0, gettext ("%s: expected a numeric value"), quote (s)); else error (0, 0, gettext ("%s: value not completely converted"), quote (s)); exit_status = 1 ; } }
void verify_numeric(unsigned long long a0, char *a1) { unsigned long long 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; if (*(__errno_location())) { v3 = quote(a0); v4 = error(0x0, *(__errno_location()), "%s"); exit_status = 1; } else { v2 = *(a1); if (*(a1)) { if (a0 == a1) { v5 = quote(a0); v7 = error(0x0, 0x0, gettext("%s: expected a numeric value")); } else { v6 = quote(a0); v8 = error(0x0, 0x0, gettext("%s: value not completely converted")); } exit_status = 1; } } return; }
static void print_volume_label (void) { struct tar_stat_info vstat; union block vblk; enum archive_format dummy; memset (&vblk, 0, sizeof (vblk)); vblk.header.typeflag = 'V'; if (recent_global_header) memcpy (vblk.header.mtime, recent_global_header->header.mtime, sizeof vblk.header.mtime); tar_stat_init (&vstat); assign_string (&vstat.file_name, "."); decode_header (&vblk, &vstat, &dummy, 0); assign_string (&vstat.file_name, volume_label); simple_print_header (&vstat, &vblk, 0); tar_stat_destroy (&vstat); }
void print_volume_label() { char v0; char v1; char v2; char v3; char v4; char v5; char v6; unsigned long long v8; unsigned long long *v9; unsigned long long v10; memset(&v3, 0x0, 0x200); v5 = 86; if (recent_global_header) memcpy(&v4, recent_global_header + 136, 0xc); tar_stat_init(&v1); assign_string(&v2, ".", v8); decode_header(&v3, &v1, &v0, 0x0); assign_string(&v2, volume_label, &v2); simple_print_header(&v1, &v3, 0x0); tar_stat_destroy(&v1); v10 = *(&v6) ^ v9[5]; return; }
static void queue_check_insert_parent (struct merge_node_queue *queue, struct merge_node *node) { if (node->level > MERGE_ROOT) { lock_node (node->parent); queue_check_insert (queue, node->parent); unlock_node (node->parent); } else if (node->nlo + node->nhi == 0) { queue_insert (queue, node->parent); } }
void queue_check_insert_parent(undefined8 param_1,long param_2) { if (*(uint *)(param_2 + 0x50) < 2) { if (*(long *)(param_2 + 0x30) + *(long *)(param_2 + 0x28) == 0) { queue_insert(param_1,*(undefined8 *)(param_2 + 0x38)); } } else { lock_node(*(undefined8 *)(param_2 + 0x38)); queue_check_insert(param_1,*(undefined8 *)(param_2 + 0x38)); unlock_node(*(undefined8 *)(param_2 + 0x38)); } return; }
static void redundant ( Char* flag ) { fprintf ( stderr , "%s: %s is redundant in versions 0.9.5 and above\n", progName, flag ); }
void redundant(undefined8 param_1) { fprintf(stderr,"%s: %s is redundant in versions 0.9.5 and above\n",progName,param_1); return; }
int login_write(struct logininfo *li) { if (geteuid() != 0) { sshlog("loginrec.c", __func__, 444, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Attempt to write login records by non-root user (aborting)"); return (1); } login_set_current_time(li); syslogin_write_entry(li); if (li->type == 7) lastlog_write_entry(li); return (0); }
void login_write(struct_0 *a0) { char v0; char v1; unsigned long long v3; void* v4; if (geteuid()) { sshlog("loginrec.c", "login_write", 0x1bc, 0x0, 0x3, 0x0, "Attempt to write login records by non-root user (aborting)", *(&v0), *(&v1)); v3 = 1; } else { login_set_current_time(a0); syslogin_write_entry(a0); if (a0->field_44 == 7) lastlog_write_entry(a0); v4 = 0; } return; }
static inline char * timetostr (time_t t, char *buf) { return ((! ((time_t) 0 < (time_t) -1)) ? imaxtostr (t, buf) : umaxtostr (t, buf)); }
int timetostr(unsigned long long a0, unsigned long long a1) { return imaxtostr(a0, a1, a1); }
int kex_input_kexinit(int type, u_int32_t seq, struct ssh *ssh) { struct kex *kex = ssh->kex; const u_char *ptr; u_int i; size_t dlen; int r; sshlog("kex.c", __func__, 598, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "SSH2_MSG_KEXINIT received"); if (kex == ((void *)0) ) { sshlog("kex.c", __func__, 600, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "no kex"); return -1; } ssh_dispatch_set(ssh, 20, ((void *)0) ); ptr = sshpkt_ptr(ssh, &dlen); if ((r = sshbuf_put(kex->peer, ptr, dlen)) != 0) return r; for (i = 0; i < 16; i++) { if ((r = sshpkt_get_u8(ssh, ((void *)0) )) != 0) { sshlog("kex.c", __func__, 611, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "discard cookie"); return r; } } for (i = 0; i < PROPOSAL_MAX; i++) { if ((r = sshpkt_get_string(ssh, ((void *)0) , ((void *)0) )) != 0) { sshlog("kex.c", __func__, 617, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "discard proposal"); return r; } } if ((r = sshpkt_get_u8(ssh, ((void *)0) )) != 0 || (r = sshpkt_get_u32(ssh, ((void *)0) )) != 0 || (r = sshpkt_get_end(ssh)) != 0) return r; if (!(kex->flags & 0x0001)) if ((r = kex_send_kexinit(ssh)) != 0) return r; if ((r = kex_choose_conf(ssh)) != 0) return r; if (kex->kex_type < KEX_MAX && kex->kex[kex->kex_type] != ((void *)0) ) return (kex->kex[kex->kex_type])(ssh); sshlog("kex.c", __func__, 645, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "unknown kex type %u", kex->kex_type); return -1; }
long long kex_input_kexinit(unsigned long a0, unsigned long a1, struct_0 *a2) { unsigned long v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; char v5; struct_1 *v6; unsigned long long v7; unsigned long long v9; unsigned long long v10; v2 = a0; v1 = a1; v6 = a2->field_8; sshlog("kex.c", "kex_input_kexinit", 0x256, 0x0, 0x5, 0x0, "SSH2_MSG_KEXINIT received"); if (!v6) { sshlog("kex.c", "kex_input_kexinit", 0x258, 0x1, 0x2, 0x0, "no kex"); v9 = 4294967295; return v9; } ssh_dispatch_set(a2, 0x14, 0x0); v7 = sshpkt_ptr(a2, &v5, &v5); v4 = sshbuf_put(v6->field_58, v7, *(&v5), v7); if (v4) { v9 = v4; return v9; } for (v3 = 0; v3 <= 15; v3 += 1) { v4 = sshpkt_get_u8(a2, 0x0); if (v4) { sshlog("kex.c", "kex_input_kexinit", 0x263, 0x1, 0x2, ssh_err(v4), "discard cookie"); v9 = v4; return v9; } } for (v3 = 0; v3 <= 9; v3 += 1) { v4 = sshpkt_get_string(a2, 0x0, 0x0, v10); if (v4) { sshlog("kex.c", "kex_input_kexinit", 0x269, 0x1, 0x2, ssh_err(v4), "discard proposal"); v9 = v4; return v9; } } v4 = sshpkt_get_u8(a2, 0x0); if (!v4) { v4 = sshpkt_get_u32(a2, 0x0, a2); if (!v4) { v4 = sshpkt_get_end(a2); if (!v4) { if (!(v6->field_8c & 1)) { v4 = kex_send_kexinit(a2); if (v4) { v9 = v4; return v9; } } v4 = kex_choose_conf(a2); if (v4) { v9 = v4; return v9; } if (v6->field_38 <= 9 && *(&(&v6[1].field_38)[2 * v6->field_38])) { v9 = *(((stack_base)[32] + (*(((stack_base)[32] + 56)) + 24) * 8 + 8))(a2); return v9; } v0 = *(((stack_base)[32] + 56)); sshlog("kex.c", "kex_input_kexinit", 0x285, 0x1, 0x2, 0x0, "unknown kex type %u"); v9 = 4294967295; return v9; } } } v9 = v4; return v9; }
char * ansic_quote (str, flags, rlen) char *str; int flags, *rlen; { char *r, *ret, *s; int l, rsize; unsigned char c; size_t clen; int b; wchar_t wc; if (str == 0 || *str == 0) return ((char *)0); l = strlen (str); rsize = 4 * l + 4; r = ret = (char *)sh_xmalloc((rsize), "strtrans.c", 248); *r++ = '$'; *r++ = '\''; for (s = str; c = *s; s++) { b = l = 1; clen = 1; switch (c) { case '\033': c = 'E'; break; case '\a': c = 'a'; break; case '\v': c = 'v'; break; case '\b': c = 'b'; break; case '\f': c = 'f'; break; case '\n': c = 'n'; break; case '\r': c = 'r'; break; case '\t': c = 't'; break; case '\\': case '\'': break; default: b = is_basic (c); if ((b == 0 && ((clen = mbrtowc (&wc, s, (__ctype_get_mb_cur_max ()) , 0)) < 0 || ((clen) == (size_t)-1 || (clen) == (size_t)-2) || iswprint (wc) == 0)) || (b == 1 && (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISprint) ) == 0)) { *r++ = '\\'; *r++ = (((c >> 6) & 07) + '0'); *r++ = (((c >> 3) & 07) + '0'); *r++ = ((c & 07) + '0'); continue; } l = 0; break; } if (b == 0 && clen == 0) break; if (l) *r++ = '\\'; if (clen == 1) *r++ = c; else { for (b = 0; b < (int)clen; b++) *r++ = (unsigned char)s[b]; s += clen - 1; } } *r++ = '\''; *r = '\0'; if (rlen) *rlen = r - ret; return ret; }
undefined * ansic_quote(byte *param_1,undefined8 param_2,int *param_3) { byte *pbVar1; int iVar2; size_t sVar3; ushort **ppuVar4; undefined *puVar5; long in_FS_OFFSET; byte local_41; wchar_t local_40; int local_3c; int local_38; int local_34; byte *local_30; byte *local_28; size_t local_20; undefined *local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); if ((param_1 == (byte *)0x0) || (*param_1 == 0)) { puVar5 = (undefined *)0x0; } else { sVar3 = strlen((char *)param_1); local_3c = (int)sVar3; local_34 = (local_3c + 1) * 4; local_18 = (undefined *)sh_xmalloc((long)local_34,"strtrans.c",0xf8); *local_18 = 0x24; local_30 = local_18 + 2; local_18[1] = 0x27; for (local_28 = param_1; local_41 = *local_28, local_41 != 0; local_28 = local_28 + 1) { local_3c = 1; local_38 = 1; local_20 = 1; if (local_41 < 0x28) { if (local_41 < 7) goto switchD_00100880_caseD_e; switch(local_41) { case 7: local_41 = 0x61; break; case 8: local_41 = 0x62; break; case 9: local_41 = 0x74; break; case 10: local_41 = 0x6e; break; case 0xb: local_41 = 0x76; break; case 0xc: local_41 = 0x66; break; case 0xd: local_41 = 0x72; break; default: goto switchD_00100880_caseD_e; case 0x1b: local_41 = 0x45; break; case 0x27: break; } LAB_001009c4: if ((local_38 == 0) && (local_20 == 0)) break; if (local_3c != 0) { *local_30 = 0x5c; local_30 = local_30 + 1; } if (local_20 == 1) { *local_30 = local_41; local_30 = local_30 + 1; } else { for (local_38 = 0; local_38 < (int)local_20; local_38 = local_38 + 1) { *local_30 = local_28[local_38]; local_30 = local_30 + 1; } local_28 = local_28 + (local_20 - 1); } } else { if (local_41 == 0x5c) goto LAB_001009c4; switchD_00100880_caseD_e: local_38 = is_basic((int)(char)local_41); if (local_38 == 0) { sVar3 = __ctype_get_mb_cur_max(); local_20 = mbrtowc(&local_40,(char *)local_28,sVar3,(mbstate_t *)0x0); if (((local_20 != 0xffffffffffffffff) && (local_20 != 0xfffffffffffffffe)) && (iVar2 = iswprint(local_40), iVar2 != 0)) goto LAB_0010092a; } else { LAB_0010092a: if ((local_38 != 1) || (ppuVar4 = __ctype_b_loc(), ((*ppuVar4)[local_41] & 0x4000) != 0)) { local_3c = 0; goto LAB_001009c4; } } *local_30 = 0x5c; local_30[1] = (local_41 >> 6) + 0x30; local_30[2] = (local_41 >> 3 & 7) + 0x30; local_30[3] = (local_41 & 7) + 0x30; local_30 = local_30 + 4; } } pbVar1 = local_30 + 1; *local_30 = 0x27; *pbVar1 = 0; puVar5 = local_18; local_30 = pbVar1; if (param_3 != (int *)0x0) { *param_3 = (int)pbVar1 - (int)local_18; } } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return puVar5; }
int xasprintf(char **sp, const char *f, ...) { va_list ap; int ret; __builtin_va_start( ap , f ) ; ret = xvasprintf(sp, 0, f, ap); __builtin_va_end( ap ) ; return ret; }
long long xasprintf() { unsigned int v0; unsigned int v1; unsigned int v2; unsigned long v3; unsigned long v4; unsigned long v5; char v6; unsigned long v7; unsigned long v8; unsigned long v9; unsigned long v10; int v11; int v12; int v13; int v14; int v15; int v16; int v17; int v18; unsigned long v19; unsigned long v20; unsigned long v21; unsigned long v22; unsigned long v23; char v24; int v25; int v26; int v27; int v28; int v29; int v30; int v31; int v32; unsigned long long *v33; unsigned long long *v34; char *v35; v7 = v20; v8 = v21; v9 = v22; v10 = v23; if (v24) { v11 = v25; v12 = v26; v13 = v27; v14 = v28; v15 = v29; v16 = v30; v17 = v31; v18 = v32; } v5 = v33[5]; v1 = 16; v2 = 48; v3 = &v19; v4 = &v6; v0 = xvasprintf(v34, 0x0, v35, &v1); if (!(v5 ^ v33[5])) return v0; __stack_chk_fail(); }
static _Bool unary_operator (void) { struct stat stat_buf; switch (argv[pos][1]) { default: test_syntax_error (gettext ("%s: unary operator expected"), quote (argv[pos])); return 0 ; case 'e': unary_advance (); return stat (argv[pos - 1], &stat_buf) == 0; case 'r': unary_advance (); return euidaccess (argv[pos - 1], 4 ) == 0; case 'w': unary_advance (); return euidaccess (argv[pos - 1], 2 ) == 0; case 'x': unary_advance (); return euidaccess (argv[pos - 1], 1 ) == 0; case 'N': { unary_advance (); if (stat (argv[pos - 1], &stat_buf) != 0) return 0 ; struct timespec atime = get_stat_atime (&stat_buf); struct timespec mtime = get_stat_mtime (&stat_buf); return (timespec_cmp (mtime, atime) > 0); } case 'O': { unary_advance (); if (stat (argv[pos - 1], &stat_buf) != 0) return 0 ; (*__errno_location ()) = 0; uid_t euid = geteuid (); uid_t NO_UID = -1; return ! (euid == NO_UID && (*__errno_location ()) ) && euid == stat_buf.st_uid; } case 'G': { unary_advance (); if (stat (argv[pos - 1], &stat_buf) != 0) return 0 ; (*__errno_location ()) = 0; gid_t egid = getegid (); gid_t NO_GID = -1; return ! (egid == NO_GID && (*__errno_location ()) ) && egid == stat_buf.st_gid; } case 'f': unary_advance (); return (stat (argv[pos - 1], &stat_buf) == 0 && (((( stat_buf.st_mode )) & 0170000) == (0100000)) ); case 'd': unary_advance (); return (stat (argv[pos - 1], &stat_buf) == 0 && (((( stat_buf.st_mode )) & 0170000) == (0040000)) ); case 's': unary_advance (); return (stat (argv[pos - 1], &stat_buf) == 0 && 0 < stat_buf.st_size); case 'S': unary_advance (); return (stat (argv[pos - 1], &stat_buf) == 0 && (((( stat_buf.st_mode )) & 0170000) == (0140000)) ); case 'c': unary_advance (); return (stat (argv[pos - 1], &stat_buf) == 0 && (((( stat_buf.st_mode )) & 0170000) == (0020000)) ); case 'b': unary_advance (); return (stat (argv[pos - 1], &stat_buf) == 0 && (((( stat_buf.st_mode )) & 0170000) == (0060000)) ); case 'p': unary_advance (); return (stat (argv[pos - 1], &stat_buf) == 0 && (((( stat_buf.st_mode )) & 0170000) == (0010000)) ); case 'L': case 'h': unary_advance (); return (lstat (argv[pos - 1], &stat_buf) == 0 && (((( stat_buf.st_mode )) & 0170000) == (0120000)) ); case 'u': unary_advance (); return (stat (argv[pos - 1], &stat_buf) == 0 && (stat_buf.st_mode & 04000 )); case 'g': unary_advance (); return (stat (argv[pos - 1], &stat_buf) == 0 && (stat_buf.st_mode & 02000 )); case 'k': unary_advance (); return (stat (argv[pos - 1], &stat_buf) == 0 && (stat_buf.st_mode & 01000 )); case 't': { long int fd; char const *arg; unary_advance (); arg = find_int (argv[pos - 1]); (*__errno_location ()) = 0; fd = strtol (arg, ((void *)0) , 10); return ( (*__errno_location ()) != 34 && 0 <= fd && fd <= 0x7fffffff && isatty (fd)); } case 'n': unary_advance (); return argv[pos - 1][0] != 0; case 'z': unary_advance (); return argv[pos - 1][0] == '\0'; } }
int unary_operator() { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; char *v4; unsigned long v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long long v9; char v10; char v11; char v12; char v13; char v14; unsigned int v16; unsigned int v17; unsigned int v18; unsigned int v19; 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 v29; unsigned int v30; unsigned int v31; unsigned int v32; unsigned int v33; switch (*((*((argv + (pos << 3))) + 1))) { case 71: unary_advance(); if (stat(*((argv + (pos << 3) - 8)), &v10)) { v16 = 0; return v16; } *(__errno_location()) = 0; v2 = getegid(); v3 = -1; if (v2 == v3 && !((v30 = *(__errno_location()), !v30)) || v2 != *(&v13)) { v32 = 0; break; } else { v32 = 1; break; } v16 = v32 & 1; return v16; case 76: case 104: unary_advance(); if (lstat(*((argv + (pos << 3) - 8)), &v10) || (*(&v11) & 0xf000) != 0xa000) v23 = 0; else v23 = 1; v16 = v23 & 1; return v16; case 78: unary_advance(); if (stat(*((argv + (pos << 3) - 8)), &v10)) { v16 = 0; return v16; } v6 = get_stat_atime(&v10); v7 = &v10; v8 = get_stat_mtime(&v10); v9 = &v10; v16 = timespec_cmp(v8, v9, v6, v7); *(&v16) = v16 > 0; return v16; case 79: unary_advance(); if (stat(*((argv + (pos << 3) - 8)), &v10)) { v16 = 0; return v16; } *(__errno_location()) = 0; v0 = geteuid(); v1 = -1; if (v0 == v1 && !((v29 = *(__errno_location()), !v29)) || v0 != *(&v12)) v31 = 0; else v31 = 1; v16 = v31 & 1; return v16; case 83: unary_advance(); if (stat(*((argv + (pos << 3) - 8)), &v10) || (*(&v11) & 0xf000) != 0xc000) v24 = 0; else v24 = 1; v16 = v24 & 1; return v16; case 98: unary_advance(); if (stat(*((argv + (pos << 3) - 8)), &v10) || (*(&v11) & 0xf000) != 0x6000) v18 = 0; else v18 = 1; v16 = v18 & 1; return v16; case 99: unary_advance(); if (stat(*((argv + (pos << 3) - 8)), &v10) || (*(&v11) & 0xf000) != 0x2000) v21 = 0; else v21 = 1; v16 = v21 & 1; return v16; case 100: unary_advance(); if (stat(*((argv + (pos << 3) - 8)), &v10) || (*(&v11) & 0xf000) != 0x4000) v19 = 0; else v19 = 1; v16 = v19 & 1; return v16; case 101: unary_advance(); v16 = stat(*((argv + pos * 8 - 8)), &v10); *(&v16) = !v16; return v16; case 102: unary_advance(); if (stat(*((argv + (pos << 3) - 8)), &v10) || (*(&v11) & 0xf000) != 0x8000) v22 = 0; else v22 = 1; v16 = v22 & 1; return v16; case 103: unary_advance(); if (stat(*((argv + (pos << 3) - 8)), &v10) || !(*(&v11) & 0x400)) v17 = 0; else v17 = 1; v16 = v17 & 1; return v16; case 107: unary_advance(); if (stat(*((argv + (pos << 3) - 8)), &v10) || !(*(&v11) & 0x200)) v25 = 0; else v25 = 1; v16 = v25 & 1; return v16; case 110: unary_advance(); v16 = *(*((argv + pos * 8 - 8))); *(&v16) = *(*((argv + (pos << 3) - 8))); return v16; case 112: unary_advance(); if (stat(*((argv + (pos << 3) - 8)), &v10) || (*(&v11) & 0xf000) != 0x1000) v26 = 0; else v26 = 1; v16 = v26 & 1; return v16; case 114: unary_advance(); v16 = euidaccess(*((argv + pos * 8 - 8)), 0x4, pos * 8 - 8); *(&v16) = !v16; return v16; case 115: unary_advance(); if (stat(*((argv + (pos << 3) - 8)), &v10) || *(&v14) <= 0) v27 = 0; else v27 = 1; v16 = v27 & 1; return v16; case 116: unary_advance(); v4 = find_int(*((argv + pos * 8 - 8))); *(__errno_location()) = 0; v5 = strtol(v4, NULL, 0xa); if (*(__errno_location()) == 34 || (v5 - 0 >> 63) || v5 >= 0x80000000 || !isatty(v5)) v33 = 0; else v33 = 1; v16 = v33 & 1; return v16; case 117: unary_advance(); if (stat(*((argv + (pos << 3) - 8)), &v10) || !(*(&v11) & 0x800)) v20 = 0; else v20 = 1; v16 = v20 & 1; return v16; case 119: unary_advance(); v16 = euidaccess(*((argv + pos * 8 - 8)), 0x2, pos * 8 - 8); *(&v16) = !v16; return v16; case 120: unary_advance(); v16 = euidaccess(*((argv + pos * 8 - 8)), 0x1, pos * 8 - 8); *(&v16) = !v16; return v16; case 122: unary_advance(); v16 = *(*((argv + pos * 8 - 8))); *(&v16) = !*(*((argv + (pos << 3) - 8))); return v16; default: test_syntax_error(gettext("%s: unary operator expected"), quote(*((argv + pos * 8)))); } }
keymacro_delete(EditLine *el, const wchar_t *key) { if (key[0] == '\0') { (void) fprintf(el->el_errfile, "keymacro_delete: Null extended-key not allowed.\n"); return -1; } if (el->el_keymacro.map == ((void *)0) ) return 0; (void) node__delete(el, &el->el_keymacro.map, key); return 0; }
long keymacro_delete(long a1, _DWORD *a2) { if ( *a2 ) { if ( *(_QWORD *)(a1 + 1096) ) node__delete(a1, (_QWORD *)(a1 + 1096), a2); return 0LL; } else { fprintf(*(FILE **)(a1 + 24), "keymacro_delete: Null extended-key not allowed.\n"); return 0xFFFFFFFFLL; } }
void rl_replace_line(const char * text, int clear_undo __attribute__((__unused__))) { if (!text || *text == 0) return; if (h == ((void *)0) || e == ((void *)0) ) rl_initialize(); el_replacestr(e, text); }
long rl_replace_line(unsigned char *a1) { long result; if ( a1 ) { result = *a1; if ( (_BYTE)result ) { if ( !h || !e ) rl_initialize(); return el_replacestr(e, a1); } } return result; }
errcode_t e2fsck_read_extents(e2fsck_t ctx, struct extent_list *extents) { struct ext2_inode_large inode; errcode_t retval; extents->extents = ((void *)0) ; extents->count = 0; extents->blocks_freed = 0; extents->ext_read = 0; extents->size = 341; retval = ext2fs_get_array(341, sizeof(struct ext2fs_extent), &extents->extents); if (retval) return 12 ; retval = ext2fs_read_inode(ctx->fs, extents->ino, EXT2_INODE(&inode)); if (retval) goto err_out; retval = load_extents(ctx, extents); if (!retval) return 0; err_out: ext2fs_free_mem(&extents->extents); extents->size = 0; extents->count = 0; return retval; }
long long e2fsck_read_extents(unsigned long long *a0, struct_0 *a1) { unsigned long long v0; char v1; unsigned long long v3; a1->field_8 = 0; a1->field_10 = 0; a1->field_0 = 0; a1->field_18 = 0; a1->field_14 = 341; v0 = ext2fs_get_array(0x155, 0x18, &a1->field_8); if (v0) { v3 = 12; } else { v0 = ext2fs_read_inode(*(a0), a1->field_28, EXT2_INODE(&v1), a1->field_28); if (!v0) { v0 = load_extents(a0, a1); if (!v0) { v3 = 0; goto LABEL_400ce9; } } ext2fs_free_mem(&a1->field_8); a1->field_14 = 0; a1->field_10 = 0; v3 = v0; } LABEL_400ce9: return v3; }
int acl_equiv_mode(acl_t acl, mode_t *mode_p) { acl_obj *acl_obj_p = ((acl_obj *)__ext2int_and_check(acl, (0x712C))); acl_entry_obj *entry_obj_p, *mask_obj_p = ((void *)0) ; int not_equiv = 0; mode_t mode = 0; if (!acl_obj_p) return -1; for( (entry_obj_p) = (acl_obj_p)->i.a_next; (entry_obj_p) != (acl_entry_obj *)(acl_obj_p); (entry_obj_p) = (entry_obj_p)->i.e_next ) { switch(entry_obj_p->i.e_entry.e_tag) { case (0x01): mode |= (entry_obj_p->i.e_entry.e_perm.i.s_perm & (((0400|0200|0100) >> 3) >> 3) ) << 6; break; case (0x04): mode |= (entry_obj_p->i.e_entry.e_perm.i.s_perm & (((0400|0200|0100) >> 3) >> 3) ) << 3; break; case (0x20): mode |= (entry_obj_p->i.e_entry.e_perm.i.s_perm & (((0400|0200|0100) >> 3) >> 3) ); break; case (0x10): mask_obj_p = entry_obj_p; case (0x02): case (0x08): not_equiv = 1; break; default: (*__errno_location ()) = 22 ; return -1; } } if (mode_p) { if (mask_obj_p) mode = (mode & ~ ((0400|0200|0100) >> 3) ) | ((mask_obj_p->i.e_entry.e_perm.i.s_perm & (((0400|0200|0100) >> 3) >> 3) ) << 3); *mode_p = mode; } return not_equiv; }
long long acl_equiv_mode(unsigned long long a0, unsigned int *a1) { unsigned int v0; unsigned int v1; struct_1 *v2; void* v3; struct_0 *v4; unsigned long long v6; v4 = __ext2int_and_check(a0, 0x712c); v3 = 0; v0 = 0; v1 = 0; if (!v4) { v6 = 4294967295; return v6; } for (v2 = v4->field_10; v2 != v4; v2 = v2->field_10) { switch (v2->field_20) { case 1: v1 |= (v2->field_40 * 64) & 448; break; case 4: v1 |= (v2->field_40 * 8) & 56; break; case 32: v1 |= v2->field_40 & 7; break; case 16: v3 = v2; case 2: case 8: v0 = 1; break; default: *(__errno_location()) = 22; v6 = 4294967295; return v6; } } if (a1) { if (v3) v1 = (v3[64] * 8) & 56 | v1 & -57; *(a1) = v1; } v6 = v0; return v6; }
static void ck_fwrite (char const *buf, size_t size, FILE *f) { if (fwrite_unlocked (buf,sizeof (char),size,f) != size) perror_fatal (gettext ("write failed")); }
void ck_fwrite(void *param_1,size_t param_2,FILE *param_3) { size_t sVar1; undefined8 uVar2; sVar1 = fwrite_unlocked(param_1,1,param_2,param_3); if (param_2 != sVar1) { uVar2 = gettext("write failed"); perror_fatal(uVar2); } return; }
static struct ext2_dx_entry *set_int_node(ext2_filsys fs, char *buf) { struct ext2_dir_entry *dir; struct ext2_dx_countlimit *limits; int csum_size = 0; memset(buf, 0, fs->blocksize); dir = (struct ext2_dir_entry *) buf; dir->inode = 0; (void) ext2fs_set_rec_len(fs, fs->blocksize, dir); if (ext2fs_has_feature_metadata_csum(fs->super)) csum_size = sizeof(struct ext2_dx_tail); limits = (struct ext2_dx_countlimit *) (buf+8); limits->limit = (fs->blocksize - (8 + csum_size)) / sizeof(struct ext2_dx_entry); limits->count = 0; return (struct ext2_dx_entry *) limits; }
int set_int_node(struct_0 *a0, unsigned int *a1) { unsigned int v0; unsigned short v1[2]; v0 = 0; memset(a1, 0x0, a0->field_28); *(a1) = 0; ext2fs_set_rec_len(a0, a0->field_28, a1, a0->field_28); if (ext2fs_has_feature_metadata_csum(a0->field_20)) v0 = 8; *(&v1) = a1 + 2; v1[0] = a0->field_28 - v0 - 8 >> 3; v1[1] = 0; return v1; }
static void die(int x __attribute__ ((__unused__))) { if (TempFilename[0]) (void) unlink(TempFilename); _exit(1); }
long long die(unsigned long a0) { unsigned int v0; v0 = a0; if (TempFilename) unlink(&TempFilename); _exit(0x1); }
int sshbuf_set_max_size(struct sshbuf *buf, size_t max_size) { size_t rlen; u_char *dp; int r; ; if ((r = sshbuf_check_sanity(buf)) != 0) return r; if (max_size == buf->max_size) return 0; if (buf->readonly || buf->refcount > 1) return -49; if (max_size > 0x8000000) return -9; sshbuf_maybe_pack(buf, max_size < buf->size); if (max_size < buf->alloc && max_size > buf->size) { if (buf->size < 256) rlen = 256; else rlen = ((((buf->size)+((256)-1))/(256))*(256)); if (rlen > max_size) rlen = max_size; ; if ((dp = recallocarray(buf->d, buf->alloc, rlen, 1)) == ((void *)0) ) return -2; buf->cd = buf->d = dp; buf->alloc = rlen; } ; if (max_size < buf->alloc) return -9; buf->max_size = max_size; return 0; }
long long sshbuf_set_max_size(struct_0 *a0, unsigned long long a1) { unsigned int v0; unsigned long v1; unsigned long v2; unsigned long long v4; char v5; v0 = sshbuf_check_sanity(a0); if (v0) { v4 = v0; } else if (a1 == a0->field_20) { v4 = 0; } else if (a0->field_30) { LABEL_4006a7: v4 = 4294967247; } else { if (!(a0->field_38 <= 1)) goto LABEL_4006a7; if (a1 > 0x8000000) { v4 = 4294967287; } else { sshbuf_maybe_pack(a0, a1 < a0->field_18); if (a1 < a0->field_28 && a1 > a0->field_18) { if (a0->field_18 <= 255) { v1 = 0x100; } else { v5 = a0->field_18 + 255; v5 = 0; *(&v1) = v5; } if (v1 > a1) v1 = a1; v2 = recallocarray(a0->field_0, a0->field_28, v1, 0x1); if (!v2) { v4 = 4294967294; goto LABEL_4007c7; } else { a0->field_0 = v2; a0->field_8 = a0->field_0; a0->field_28 = v1; } } if (a1 < a0->field_28) { v4 = 4294967287; } else { a0->field_20 = a1; v4 = 0; } } } LABEL_4007c7: return v4; }
int channel_request_remote_forwarding(struct ssh *ssh, struct Forward *fwd) { int r, success = 0, idx = -1; char *host_to_connect, *listen_host, *listen_path; int port_to_connect, listen_port; if (fwd->listen_path != ((void *)0) ) { if ((r = sshpkt_start(ssh, 80)) != 0 || (r = sshpkt_put_cstring(ssh, "streamlocal-forward@openssh.com")) != 0 || (r = sshpkt_put_u8(ssh, 1)) != 0 || (r = sshpkt_put_cstring(ssh, fwd->listen_path)) != 0 || (r = sshpkt_send(ssh)) != 0 || (r = ssh_packet_write_wait(ssh)) != 0) sshfatal("channels.c", __func__, 4096, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "request streamlocal"); } else { if ((r = sshpkt_start(ssh, 80)) != 0 || (r = sshpkt_put_cstring(ssh, "tcpip-forward")) != 0 || (r = sshpkt_put_u8(ssh, 1)) != 0 || (r = sshpkt_put_cstring(ssh, channel_rfwd_bind_host(fwd->listen_host))) != 0 || (r = sshpkt_put_u32(ssh, fwd->listen_port)) != 0 || (r = sshpkt_send(ssh)) != 0 || (r = ssh_packet_write_wait(ssh)) != 0) sshfatal("channels.c", __func__, 4106, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "request tcpip-forward"); } success = 1; if (success) { host_to_connect = listen_host = listen_path = ((void *)0) ; port_to_connect = listen_port = 0; if (fwd->connect_path != ((void *)0) ) { host_to_connect = xstrdup(fwd->connect_path); port_to_connect = -2; } else { host_to_connect = xstrdup(fwd->connect_host); port_to_connect = fwd->connect_port; } if (fwd->listen_path != ((void *)0) ) { listen_path = xstrdup(fwd->listen_path); listen_port = -2; } else { if (fwd->listen_host != ((void *)0) ) listen_host = xstrdup(fwd->listen_host); listen_port = fwd->listen_port; } idx = permission_set_add(ssh, 0x101, (1<<1), host_to_connect, port_to_connect, listen_host, listen_path, listen_port, ((void *)0) ); } return idx; }
long channel_request_remote_forwarding(long a1, _QWORD *a2) { long v2; const char *v3; long v4; long result; unsigned int v6; unsigned int v7; int v8; long v9; long v10; long v11; if ( a2[2] ) { v6 = sshpkt_start(a1, 80LL); if ( !v6 ) { v6 = sshpkt_put_cstring(a1, "streamlocal-forward@openssh.com"); if ( !v6 ) { v6 = sshpkt_put_u8(a1, 1LL); if ( !v6 ) { v6 = sshpkt_put_cstring(a1, a2[2]); if ( !v6 ) { v6 = sshpkt_send(a1); if ( !v6 ) { v6 = ssh_packet_write_wait(a1); if ( !v6 ) goto LABEL_17; } } } } } v2 = ssh_err(v6); sshfatal("channels.c", "channel_request_remote_forwarding", 4096LL, 1LL, 1LL, v2, "request streamlocal"); } v7 = sshpkt_start(a1, 80LL); if ( v7 || (v7 = sshpkt_put_cstring(a1, "tcpip-forward")) != 0 || (v7 = sshpkt_put_u8(a1, 1LL)) != 0 || (v3 = channel_rfwd_bind_host((const char *)*a2), (v7 = sshpkt_put_cstring(a1, v3)) != 0) || (v7 = sshpkt_put_u32(a1, *((unsigned int *)a2 + 2))) != 0 || (v7 = sshpkt_send(a1)) != 0 || (v7 = ssh_packet_write_wait(a1)) != 0 ) { v4 = ssh_err(v7); sshfatal("channels.c", "channel_request_remote_forwarding", 4106LL, 1LL, 1LL, v4, "request tcpip-forward"); } LABEL_17: v10 = 0LL; if ( a2[5] ) { v9 = xstrdup(a2[5]); v8 = -2; } else { v9 = xstrdup(a2[3]); v8 = *((_DWORD *)a2 + 8); } if ( a2[2] ) { v11 = xstrdup(a2[2]); LODWORD(result) = permission_set_add(a1, 0x101u, 2u, v9, v8, 0LL, v11, -2, 0LL); } else { if ( *a2 ) v10 = xstrdup(*a2); LODWORD(result) = permission_set_add(a1, 0x101u, 2u, v9, v8, v10, 0LL, *((_DWORD *)a2 + 2), 0LL); } return (unsigned int)result; }
static _Bool debugging (parser_control const *pc) { return 0 ; }
int debugging(unsigned long a0) { unsigned long v0; v0 = a0; return 0; }
static int verify_result_rpm(enum verify_result result, int check) { switch (result) { case VERIFY_FAIL: return check; case VERIFY_PASS: return '.'; case VERIFY_NONE: default: return '?'; } }
int verify_result_rpm(unsigned long a0, unsigned long a1) { unsigned int v1; if (a0 == 1) { v1 = 46; } else if (a0 == 2) { v1 = a1; } else { v1 = 63; } return v1; }
void log_close(void) { if (log_use_syslog) closelog(); }
void log_close() { if ( log_use_syslog ) closelog(); }
static void copy_attr_error (__attribute__ ((__unused__)) struct error_context *ctx, char const *fmt, ...) { if (!errno_unsupported ( (*__errno_location ()) )) { int err = (*__errno_location ()) ; va_list ap; __builtin_va_start( ap , fmt ) ; verror (0, err, fmt, ap); __builtin_va_end( ap ) ; } }
void copy_attr_error(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined8 param_9,undefined8 param_10,undefined8 param_11,undefined8 param_12, undefined8 param_13,undefined8 param_14) { char in_AL; char cVar1; int *piVar2; long in_FS_OFFSET; undefined4 local_d8; undefined4 local_d4; undefined *local_d0; undefined *local_c8; long local_c0; undefined local_b8 [16]; undefined8 local_a8; undefined8 local_a0; undefined8 local_98; undefined8 local_90; undefined4 local_88; undefined4 local_78; undefined4 local_68; undefined4 local_58; undefined4 local_48; undefined4 local_38; undefined4 local_28; undefined4 local_18; if (in_AL != '\0') { local_88 = param_1; local_78 = param_2; local_68 = param_3; local_58 = param_4; local_48 = param_5; local_38 = param_6; local_28 = param_7; local_18 = param_8; } local_c0 = *(long *)(in_FS_OFFSET + 0x28); local_a8 = param_11; local_a0 = param_12; local_98 = param_13; local_90 = param_14; piVar2 = __errno_location(); cVar1 = errno_unsupported(*piVar2); if (cVar1 != '\x01') { piVar2 = __errno_location(); local_d8 = 0x10; local_d4 = 0x30; local_d0 = &stack0x00000008; local_c8 = local_b8; verror(0,*piVar2,param_10,&local_d8); } if (local_c0 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
int syslogin_write_entry(struct logininfo *li) { switch (li->type) { case 7: return (syslogin_perform_login(li)); case 8: return (syslogin_perform_logout(li)); default: sshlog("loginrec.c", __func__, 1461, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "%s: Invalid type field", __func__); return (0); } }
void syslogin_write_entry(struct_0 *a0) { char v0; unsigned long long v2; unsigned long long v3; void* v4; if (a0->field_44 == 7) { v2 = syslogin_perform_login(a0); } else if (a0->field_44 != 8) { sshlog("loginrec.c", "syslogin_write_entry", 0x5b5, 0x0, 0x3, 0x0, "%s: Invalid type field", "syslogin_write_entry", *(&v0)); v4 = 0; } else { v3 = syslogin_perform_logout(a0); } return; }
static void print_tunnel(const void *t) { const struct ip6_tnl_parm2 *p = t; char b1[64]; open_json_object( ((void *)0) ); print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "%s: ", p->name); snprintf(b1, sizeof(b1), "%s/ipv6", tnl_strproto(p->proto)); print_string(PRINT_ANY, "mode", "%s ", b1); print_string(PRINT_FP, ((void *)0) , "%s", "remote "); print_color_string(PRINT_ANY, COLOR_INET6, "remote", "%s ", format_host_r( 10 , 16, &p->raddr, b1, sizeof(b1))); print_string(PRINT_FP, ((void *)0) , "%s", "local "); print_color_string(PRINT_ANY, COLOR_INET6, "local", "%s", rt_addr_n2a_r( 10 , 16, &p->laddr, b1, sizeof(b1))); if (p->link) { const char *n = ll_index_to_name(p->link); if (n) print_string(PRINT_ANY, "link", " dev %s", n); } if (p->flags & 0x1) print_null(PRINT_ANY, "ip6_tnl_f_ign_encap_limit", " encaplimit none", ((void *)0) ); else print_uint(PRINT_ANY, "encap_limit", " encaplimit %u", p->encap_limit); if (p->hop_limit) print_uint(PRINT_ANY, "hoplimit", " hoplimit %u", p->hop_limit); else print_string(PRINT_FP, "hoplimit", " hoplimit %s", "inherit"); if (p->flags & 0x2) { print_null(PRINT_ANY, "ip6_tnl_f_use_orig_tclass", " tclass inherit", ((void *)0) ); } else { __u32 val = ntohl(p->flowinfo & htonl(0x0FF00000)); snprintf(b1, sizeof(b1), "0x%02x", (__u8)(val >> 20)); print_string(PRINT_ANY, "tclass", " tclass %s", b1); } if (p->flags & 0x4) { print_null(PRINT_ANY, "ip6_tnl_f_use_orig_flowlabel", " flowlabel inherit", ((void *)0) ); } else { __u32 val = ntohl(p->flowinfo & htonl(0x000FFFFF)); snprintf(b1, sizeof(b1), "0x%05x", val); print_string(PRINT_ANY, "flowlabel", " flowlabel %s", b1); } snprintf(b1, sizeof(b1), "0x%08x", ntohl(p->flowinfo)); print_string(PRINT_ANY, "flowinfo", " (flowinfo %s)", b1); if (p->flags & 0x10) print_null(PRINT_ANY, "ip6_tnl_f_rcv_dscp_copy", " dscp inherit", ((void *)0) ); if (p->flags & 0x40) print_null(PRINT_ANY, "ip6_tnl_f_allow_local_remote", " allow-localremote", ((void *)0) ); tnl_print_gre_flags(p->proto, p->i_flags, p->o_flags, p->i_key, p->o_key); close_json_object(); }
void print_tunnel(struct_0 *a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned int v0; unsigned int v1; unsigned long long v2; char v3; char v4; unsigned long long *v6; unsigned long long v7; open_json_object(0x0); print_color_string(0x4, 0x0, "ifname", "%s: ", a0); snprintf(&v3, 0x40, "%s/ipv6", tnl_strproto(a0->field_14)); print_string(0x4, "mode", "%s ", &v3); print_string(0x1, 0x0, "%s", "remote "); print_color_string(0x4, 0x3, "remote", "%s ", format_host_r(0xa, 0x10, &a0->padding_20[16], &v3, 0x40)); print_string(0x1, 0x0, "%s", "local "); print_color_string(0x4, 0x3, "local", "%s", rt_addr_n2a_r(0xa, 0x10, &a0->padding_20, &v3, 0x40)); if (a0->field_10) { v2 = ll_index_to_name(a0->field_10); if (v2) print_string(0x4, "link", " dev %s", v2); } if ((a0->field_1c & 1)) print_null(0x4, "ip6_tnl_f_ign_encap_limit", " encaplimit none", 0x0); else print_uint(0x4, "encap_limit", " encaplimit %u", a0->field_15); if (a0->field_16) print_uint(0x4, "hoplimit", " hoplimit %u", a0->field_16); else print_string(0x1, "hoplimit", " hoplimit %s", "inherit"); if ((a0->field_1c & 2)) { print_null(0x4, "ip6_tnl_f_use_orig_tclass", " tclass inherit", 0x0); } else { v0 = ntohl(htonl(0xff00000) & a0->field_18); snprintf(&v3, 0x40, "0x%02x", (v0 >> 20)); print_string(0x4, "tclass", " tclass %s", &v3); } if ((a0->field_1c & 4)) { print_null(0x4, "ip6_tnl_f_use_orig_flowlabel", " flowlabel inherit", 0x0); } else { v1 = ntohl(htonl(0xfffff) & a0->field_18); snprintf(&v3, 0x40, "0x%05x", v1); print_string(0x4, "flowlabel", " flowlabel %s", &v3); } snprintf(&v3, 0x40, "0x%08x", ntohl(a0->field_18)); print_string(0x4, "flowinfo", " (flowinfo %s)", &v3); if ((a0->field_1c & 16)) print_null(0x4, "ip6_tnl_f_rcv_dscp_copy", " dscp inherit", 0x0); if ((a0->field_1c & 64)) print_null(0x4, "ip6_tnl_f_allow_local_remote", " allow-localremote", 0x0); tnl_print_gre_flags(a0->field_14, a0->field_40, a0->field_42, a0->field_44, a0->field_48); close_json_object(a0->field_14, a1, a2, a3, a4, a5); v7 = *(&v4) ^ v6[5]; return; }
void do_command(entry *e, user *u) { (void)e; (void)u; }
long long do_command(unsigned long a0, unsigned long a1) { unsigned long v0; unsigned long v1; unsigned long v3; v1 = a0; v0 = a1; return v3; }
static void tdm_add_trig_begin(const char *trig) { ctrig = strcmp(trig, activate) == 0; trigdef_update_printf("%s", trig); if (!ctrig || done_trig) return; yespackage(bypackage); done_trig = 1 ; }
long long tdm_add_trig_begin(char *a0) { unsigned long long v1; ctrig = !strcmp(a0, activate); trigdef_update_printf("%s", a0); v1 = ctrig ^ 1; if (!(ctrig ^ 1)) { v1 = done_trig; if (!done_trig) { v1 = yespackage(bypackage); done_trig = 1; } } return v1; }
static void check_perms (void) { if (!amroot && !lflg) { fprintf ( stderr , gettext ("%s: Permission denied.\n"), Prog); fail_exit (1); } }
void check_perms() { unsigned long long v1; unsigned long long v2; v1 = amroot ^ 1; if ((amroot ^ 1)) { v2 = lflg ^ 1; if ((lflg ^ 1)) { fprintf(stderr, gettext("%s: Permission denied.\n")); fail_exit(0x1); } } if (!(amroot ^ 1) || !(lflg ^ 1)) return; }
static inline void flush_file (void) { off_t blocks_to_skip; set_next_block_after (current_header); blocks_to_skip = (current_stat_info.stat.st_size + 512 - 1) / 512; while (record_end - current_block <= blocks_to_skip) { blocks_to_skip -= (record_end - current_block); flush_archive (); } current_block += blocks_to_skip; }
void flush_file(void) { long local_10; set_next_block_after(current_header); local_10 = _xmalloc + 0x1ff; if (_xmalloc + 0x1ff < 0) { local_10 = _xmalloc + 0x3fe; } local_10 = local_10 >> 9; while (record_end - current_block >> 9 <= local_10) { local_10 = local_10 - (record_end - current_block >> 9); flush_archive(); } current_block = current_block + local_10 * 0x200; return; }
static void new_grent (struct group *grent) { explicit_bzero((grent), (sizeof *grent)); grent->gr_name = (char *) user_name; if (is_shadow_grp) { grent->gr_passwd = "x"; } else { grent->gr_passwd = "!"; } grent->gr_gid = user_gid; grent->gr_mem = &empty_list; }
void new_grent(undefined8 *param_1) { explicit_bzero(param_1,0x20); *param_1 = user_name; if (is_shadow_grp == '\0') { param_1[1] = &DAT_001069fd; } else { param_1[1] = &DAT_00107749; } *(undefined4 *)(param_1 + 2) = user_gid; param_1[3] = &empty_list; return; }
static void process_symlink(u_int32_t id) { char *oldpath, *newpath; int r, status; if ((r = sshbuf_get_cstring(iqueue, &oldpath, ((void *)0) )) != 0 || (r = sshbuf_get_cstring(iqueue, &newpath, ((void *)0) )) != 0) sshfatal("sftp-server.c", __func__, 1360, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); sshlog("sftp-server.c", __func__, 1362, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "request %u: symlink", id); sshlog("sftp-server.c", __func__, 1363, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "symlink old \"%s\" new \"%s\"", oldpath, newpath); r = symlink(oldpath, newpath); status = (r == -1) ? errno_to_portable( (*__errno_location ()) ) : 0; send_status(id, status); free(oldpath); free(newpath); }
unsigned long process_symlink(unsigned int a1) { long v1; int *v2; unsigned int v3; unsigned int cstring; char *from; char *to; unsigned long v8; v8 = __readfsqword(0x28u); cstring = sshbuf_get_cstring(iqueue, &from, 0LL); if ( cstring || (cstring = sshbuf_get_cstring(iqueue, &to, 0LL)) != 0 ) { v1 = ssh_err(cstring); sshfatal("sftp-server.c", "process_symlink", 1360LL, 1LL, 1LL, v1, "parse"); } sshlog("sftp-server.c", "process_symlink", 1362LL, 0LL, 7LL, 0LL, "request %u: symlink", a1); sshlog("sftp-server.c", "process_symlink", 1363LL, 0LL, 3LL, 0LL, "symlink old \"%s\" new \"%s\"", from, to); if ( symlink(from, to) == -1 ) { v2 = _errno_location(); v3 = errno_to_portable(*v2); } else { v3 = 0; } send_status(a1, v3); free(from); free(to); return __readfsqword(0x28u) ^ v8; }
static void send_read_request(struct sftp_conn *conn, u_int id, u_int64_t offset, u_int len, const u_char *handle, u_int handle_len) { struct sshbuf *msg; int r; if ((msg = sshbuf_new()) == ((void *)0) ) sshfatal("sftp-client.c", __func__, 1519, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); if ((r = sshbuf_put_u8(msg, 5)) != 0 || (r = sshbuf_put_u32(msg, id)) != 0 || (r = sshbuf_put_string(msg, handle, handle_len)) != 0 || (r = sshbuf_put_u64(msg, offset)) != 0 || (r = sshbuf_put_u32(msg, len)) != 0) sshfatal("sftp-client.c", __func__, 1525, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose"); send_msg(conn, msg); sshbuf_free(msg); }
void send_read_request(void* a0, unsigned long a1, unsigned long long a2, unsigned long a3, unsigned long long a4, unsigned long a5) { unsigned int v0; unsigned long long v1; char v2; unsigned long long v4; v1 = sshbuf_new(); if (!v1) sshfatal("sftp-client.c", "send_read_request", 0x5ef, 0x1, 0x1, 0x0, "sshbuf_new failed"); v0 = sshbuf_put_u8(v1, 0x5, 0x5ef); if (v0) { LABEL_405a17: v1 = "compose"; sshfatal("sftp-client.c", "send_read_request", 0x5f5, 0x1, 0x1, ssh_err(v0), *(&v2)); } else { v0 = sshbuf_put_u32(v1, a1, a1); if (!(!v0) || !((v0 = sshbuf_put_string(v1, a4, a5, a4), !v0))) goto LABEL_405a17; v0 = sshbuf_put_u64(v1, a2); if (v0 || (v0 = sshbuf_put_u32(v1, a3, a3), v0)) goto LABEL_405a17; } send_msg(a0, v1); v4 = sshbuf_free(v1); return; }
static void send_status(u_int32_t id, u_int32_t status) { send_status_errmsg(id, status, ((void *)0) ); }
void send_status(undefined4 param_1,undefined4 param_2) { send_status_errmsg(param_1,param_2,0); return; }
static _Bool subtree_has_side_effects (const struct predicate *p) { if (p) { return p->side_effects || subtree_has_side_effects (p->pred_left) || subtree_has_side_effects (p->pred_right); } else { return 0 ; } }
int subtree_has_side_effects(struct_0 *a0) { unsigned int v1; unsigned int v2; if (!a0) { v1 = 0; } else { if (a0->field_18) { LABEL_400bf7: v2 = 1; } else { if (!(!subtree_has_side_effects(a0->field_110))) goto LABEL_400bf7; if (!(!subtree_has_side_effects(a0->field_118))) goto LABEL_400bf7; v2 = 0; } v1 = v2 & 1; } return v1; }
static int readahead_dir_block(ext2_filsys fs, struct ext2_db_entry2 *db, void *priv_data) { struct read_dblist *pr = priv_data; e2_blkcnt_t count = (pr->flags & (0x01) ? 1 : db->blockcnt); if (!pr->run_len || db->blk != pr->run_start + pr->run_len) { if (pr->run_len) { pr->err = io_channel_cache_readahead(fs->io, pr->run_start, pr->run_len); ; } pr->run_start = db->blk; pr->run_len = 0; } pr->run_len += count; return pr->err ? 1 : 0; }
long long readahead_dir_block(struct_1 *a0, unsigned long long a1[3], struct_0 *a2) { struct_0 *v0; unsigned long long v1; unsigned long long v3; v0 = a2; if ((a2->field_18 & 1)) v3 = 1; else v3 = a1[2]; v1 = v3; if (a2->field_10 && a1[1] == a2->field_10 + a2->field_8) goto LABEL_4000c1; if (a2->field_10) a2->field_0 = io_channel_cache_readahead(a0->field_8, a2->field_8, a2->field_10, a2->field_8); a2->field_8 = a1[1]; a2->field_10 = 0; LABEL_4000c1: a2->field_10 = a2->field_10 + v1; return a2->field_0; }
void usage (int status) { if (status != 0 ) do { fprintf ( stderr , gettext ("Try '%s --help' for more information.\n"), program_name); } while (0); else { printf (gettext ("Usage: %s FILE1 FILE2\n or: %s OPTION\n") , program_name, program_name); fputs_unlocked (gettext ("Call the link function to create a link named FILE2 to an existing FILE1.\n\n"), stdout ) ; fputs_unlocked (gettext (" --help display this help and exit\n"), stdout ); fputs_unlocked (gettext (" --version output version information and exit\n"), stdout ); emit_ancillary_info ("link"); } exit (status); }
void usage(int param_1) { FILE *pFVar1; undefined8 uVar2; char *pcVar3; uVar2 = program_name; if (param_1 == 0) { pcVar3 = (char *)gettext("Usage: %s FILE1 FILE2\n or: %s OPTION\n"); printf(pcVar3,uVar2,uVar2); pFVar1 = stdout; pcVar3 = (char *)gettext( "Call the link function to create a link named FILE2 to an existing FILE1.\n\n" ); fputs_unlocked(pcVar3,pFVar1); pFVar1 = stdout; pcVar3 = (char *)gettext(" --help display this help and exit\n"); fputs_unlocked(pcVar3,pFVar1); pFVar1 = stdout; pcVar3 = (char *)gettext(" --version output version information and exit\n"); fputs_unlocked(pcVar3,pFVar1); emit_ancillary_info(); } else { pcVar3 = (char *)gettext("Try \'%s --help\' for more information.\n"); fprintf(stderr,pcVar3,uVar2); } exit(param_1); }
int option_clear_or_none(const char *o) { return o == ((void *)0) || strcasecmp(o, "none") == 0; }
undefined8 option_clear_or_none(char *param_1) { int iVar1; if ((param_1 != (char *)0x0) && (iVar1 = strcasecmp(param_1,"none"), iVar1 != 0)) { return 0; } return 1; }
static inline void emit_mandatory_arg_note (void) { fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout ) ; }
void emit_mandatory_arg_note() { unsigned long long v1; v1 = fputs_unlocked(gettext("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout); return; }
_Bool find_command(const char *prog) { struct varbuf filename = { 0, 0, ((void *)0) }; struct stat stab; const char *path_list; const char *path, *path_end; size_t path_len; path_list = getenv("PATH"); if (!path_list) ohshit(gettext("PATH is not set")); for (path = path_list; path; path = *path_end ? path_end + 1 : ((void *)0) ) { path_end = strchrnul(path, ':'); path_len = (size_t)(path_end - path); varbuf_reset(&filename); varbuf_add_buf(&filename, path, path_len); if (path_len) varbuf_add_char(&filename, '/'); varbuf_add_buf(&filename, prog, strlen(prog)); varbuf_end_str(&filename); if (stat(filename.buf, &stab) == 0 && (stab.st_mode & 0111)) { varbuf_destroy(&filename); return 1 ; } } varbuf_destroy(&filename); return 0 ; }
long find_command(const char *a1) { char *v1; size_t v2; char *v4; char *s; char *v6; char *v7; long v8[2]; char *file; struct stat v10; unsigned long v11; v11 = __readfsqword(0x28u); v8[0] = 0LL; v8[1] = 0LL; file = 0LL; v6 = getenv("PATH"); if ( !v6 ) { v1 = gettext("PATH is not set"); ohshit(v1); } for ( s = v6; s; s = v4 ) { v7 = strchrnul(s, 58); varbuf_reset(v8); varbuf_add_buf(v8, s, v7 - s); if ( v7 != s ) varbuf_add_char(v8, 47LL); v2 = strlen(a1); varbuf_add_buf(v8, a1, v2); varbuf_end_str(v8); if ( !stat(file, &v10) && (v10.st_mode & 0x49) != 0 ) { varbuf_destroy(v8); return 1LL; } if ( *v7 ) v4 = v7 + 1; else v4 = 0LL; } varbuf_destroy(v8); return 0LL; }
static const char * fmt_multistate_int(int val, const struct multistate *m) { u_int i; for (i = 0; m[i].key != ((void *)0) ; i++) { if (m[i].value == val) return m[i].key; } return "UNKNOWN"; }
void fmt_multistate_int(unsigned long a0, unsigned long long *a1) { unsigned int v0; unsigned long long v2; unsigned long long v3; v0 = 0; while (true) { if (!a1[2 * v0]) { v2 = "UNKNOWN"; break; } else if (a0 != a1[1 + 2 * v0]) { v0 += 1; } else { v3 = a1[2 * v0]; break; } } return; }
static void print_txsc_stats(const char *prefix, struct rtattr *attr) { struct rtattr *stats[MACSEC_TXSC_STATS_ATTR_MAX + 1]; if (!attr || show_stats == 0) return; (parse_rtattr_flags((stats), (MACSEC_TXSC_STATS_ATTR_MAX), ((void*)(((char*)(attr)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((attr)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))); print_stats(prefix, txsc_stats_names, NUM_MACSEC_TXSC_STATS_ATTR, stats); }
void print_txsc_stats(unsigned int a0, unsigned short *a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long a5) { char v0; char v1; unsigned long long *v3; unsigned long long v4; if (a1 && show_stats) { parse_rtattr_flags(&v0, 0x5, a1 + 2, *(a1) - 4, 0x8000); print_stats(a0, &txsc_stats_names, 0x6, &v0, 0x8000, a5); } v4 = *(&v1) ^ v3[5]; return; }
static void usage(void) { iplink_usage(); }
void usage(void) { iplink_usage(); }
static unsigned int genseed () { struct timeval tv; unsigned int iv; gettimeofday (&tv, ((void *)0) ); iv = (unsigned int)seedrand; iv = tv.tv_sec ^ tv.tv_usec ^ getpid () ^ getppid () ^ current_user.uid ^ iv; return (iv); }
int genseed() { unsigned int v0; char v1; char v2; unsigned int v5; gettimeofday(&v1, NULL); *(&v0) = seedrand; v5 = *(&v1) ^ *(&v2) ^ getpid(); v0 ^= v5 ^ getppid() ^ current_user; return v0; }
static int fd_stat (int fd, char const *file, struct stat *st, int atflag) { return (0 <= fd ? fstat (fd, st) : fstatat (chdir_fd, file, st, atflag)); }
int fd_stat(unsigned long a0, unsigned long long a1, unsigned long long a2, unsigned long a3) { unsigned long long v1; if (a0 >= 0) v1 = fstat(a0, a2); else v1 = fstatat(chdir_fd, a1, a2, a3); return v1; }
static inline char * timetostr (time_t t, char *buf) { return ((! ((time_t) 0 < (time_t) -1)) ? imaxtostr (t, buf) : umaxtostr (t, buf)); }
int timetostr(unsigned long long a0, unsigned long long a1) { return imaxtostr(a0, a1, a1); }
int sshbuf_putf(struct sshbuf *buf, const char *fmt, ...) { va_list ap; int r; __builtin_va_start( ap , fmt ) ; r = sshbuf_putfv(buf, fmt, ap); __builtin_va_end( ap ) ; return r; }
long sshbuf_putf(long a1, const char *a2, long a3, long a4, long a5, long a6, ...) { gcc_va_list va; unsigned long v8; long v9; long v10; long v11; long v12; va_start(va, a6); v9 = a3; v10 = a4; v11 = a5; v12 = a6; v8 = __readfsqword(0x28u); va[0].gp_offset = 16; return (unsigned int)sshbuf_putfv(a1, a2, (long *)va); }
int can_optimize_cat_file (command) COMMAND *command; { return (command->type == cm_simple && !command->redirects && (command->flags & 0x80) == 0 && command->value.Simple->words == 0 && command->value.Simple->redirects && command->value.Simple->redirects->next == 0 && command->value.Simple->redirects->instruction == r_input_direction && command->value.Simple->redirects->redirector.dest == 0); }
undefined8 can_optimize_cat_file(int *param_1) { undefined8 uVar1; if (((((*param_1 == 4) && (*(long *)(param_1 + 4) == 0)) && ((param_1[1] & 0x80U) == 0)) && ((*(long *)(*(long *)(param_1 + 6) + 8) == 0 && (*(long *)(*(long *)(param_1 + 6) + 0x10) != 0)))) && ((**(long **)(*(long *)(param_1 + 6) + 0x10) == 0 && ((*(int *)(*(long *)(*(long *)(param_1 + 6) + 0x10) + 0x18) == 1 && (*(int *)(*(long *)(*(long *)(param_1 + 6) + 0x10) + 8) == 0)))))) { uVar1 = 1; } else { uVar1 = 0; } return uVar1; }
int audit(const char *const *argv) { const struct audit_problem *problem; struct pkg_array array; _Bool head_running = 0 ; int i; modstatdb_open(msdbrw_readonly); if (!*argv) pkg_array_init_from_hash(&array); else pkg_array_init_from_names(&array, pkg_array_mapper, (const char **)argv); pkg_array_sort(&array, pkg_sorter_by_nonambig_name_arch); for (problem = audit_problems; problem->check; problem++) { _Bool head = 0 ; for (i = 0; i < array.n_pkgs; i++) { struct pkginfo *pkg = array.pkgs[i]; if (!problem->check(pkg, problem)) continue; if (!head_running) { if (modstatdb_is_locked()) puts(gettext("Another process has locked the database for writing, and might currently be\n" "modifying it, some of the following problems might just be due to that.\n") ); head_running = 1 ; } if (!head) { fputs(gettext(problem->explanation), stdout ); head = 1 ; } describebriefly(pkg); } if (head) putchar('\n'); } pkg_array_destroy(&array); m_output( stdout , gettext("<standard output>")); return 0; }
long long audit(unsigned long long *a0) { char v0; char v1; unsigned int v2; unsigned long long v3; void* *v4; char v5; char v6; unsigned long long v9; v0 = 0; modstatdb_open(0x0); if (*(a0)) pkg_array_init_from_names(&v5, pkg_array_mapper, a0); else pkg_array_init_from_hash(&v5); pkg_array_sort(&v5, got.pkg_sorter_by_nonambig_name_arch, got.pkg_sorter_by_nonambig_name_arch); for (v3 = &audit_problems; *(v3); v3 += 24) { v1 = 0; for (v2 = 0; v2 < *(&v5); v2 += 1) { v4 = *((*(&v6) + v2 * 8)); if (!(*(v3)(v4, v3, v3, *(v3)) ^ 1)) { if ((v0 ^ 1)) { if (modstatdb_is_locked()) puts(gettext("Another process has locked the database for writing, and might currently be\nmodifying it, some of the following problems might just be due to that.\n")); v0 = 1; } if ((v1 ^ 1)) { fputs(gettext(*((v3 + 16))), stdout); v1 = 1; } describebriefly(v4); } } if (v1) putchar(0xa); } pkg_array_destroy(&v5); v9 = gettext("<standard output>"); m_output(stdout, v9, v9); return 0; }
static int hostspec_is_complex(const char *hosts) { char *cp; if (strchr(hosts, '*') != ((void *)0) || strchr(hosts, '?') != ((void *)0) ) return 1; if ((cp = strchr(hosts, ',')) == ((void *)0) ) return 0; if (strchr(cp + 1, ',') != ((void *)0) ) return 1; return 0; }
undefined8 hostspec_is_complex(char *param_1) { char *pcVar1; pcVar1 = strchr(param_1,0x2a); if ((pcVar1 != (char *)0x0) || (pcVar1 = strchr(param_1,0x3f), pcVar1 != (char *)0x0)) { return 1; } pcVar1 = strchr(param_1,0x2c); if (pcVar1 == (char *)0x0) { return 0; } pcVar1 = strchr(pcVar1 + 1,0x2c); if (pcVar1 != (char *)0x0) { return 1; } return 0; }
int acl_set_qualifier(acl_entry_t entry_d, const void *tag_qualifier_p) { acl_entry_obj *entry_obj_p = ((acl_entry_obj *)__ext2int_and_check(entry_d, (0x9D6B))); if (!entry_obj_p) return -1; switch(entry_obj_p->i.e_entry.e_tag) { case (0x02): entry_obj_p->i.e_entry.e_id.i.q_id = *(id_t *)tag_qualifier_p; break; case (0x08): entry_obj_p->i.e_entry.e_id.i.q_id = *(id_t *)tag_qualifier_p; break; default: (*__errno_location ()) = 22 ; return -1; } __acl_reorder_entry_obj_p(entry_obj_p); return 0; }
long long acl_set_qualifier(unsigned long long a0, unsigned int *a1) { unsigned int v0[13]; unsigned long long v2; *(&v0[0]) = __ext2int_and_check(a0, 0x9d6b); if (!v0) { v2 = 4294967295; } else { if (v0[8] == 2) { v0[12] = *(a1); } else if (v0[8] != 8) { *(__errno_location()) = 22; v2 = 4294967295; } if (v0[8] == 8) v0[12] = *(a1); if (v0[8] == 2 || v0[8] == 8) { __acl_reorder_entry_obj_p(v0); v2 = 0; } } return v2; }
static inline void emit_mandatory_arg_note (void) { fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout ) ; }
void emit_mandatory_arg_note() { unsigned long long v1; v1 = fputs_unlocked(gettext("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout); return; }
static int sshkey_from_blob_internal(struct sshbuf *b, struct sshkey **keyp, int allow_cert) { int type, ret = -1; char *ktype = ((void *)0) , *curve = ((void *)0) , *xmss_name = ((void *)0) ; struct sshkey *key = ((void *)0) ; size_t len; u_char *pk = ((void *)0) ; struct sshbuf *copy; BIGNUM *rsa_n = ((void *)0) , *rsa_e = ((void *)0) ; BIGNUM *dsa_p = ((void *)0) , *dsa_q = ((void *)0) , *dsa_g = ((void *)0) , *dsa_pub_key = ((void *)0) ; EC_POINT *q = ((void *)0) ; if (keyp != ((void *)0) ) *keyp = ((void *)0) ; if ((copy = sshbuf_fromb(b)) == ((void *)0) ) { ret = -2; goto out; } if (sshbuf_get_cstring(b, &ktype, ((void *)0) ) != 0) { ret = -4; goto out; } type = sshkey_type_from_name(ktype); if (!allow_cert && sshkey_type_is_cert(type)) { ret = -19; goto out; } switch (type) { case KEY_RSA_CERT: if (sshbuf_get_string_direct(b, ((void *)0) , ((void *)0) ) != 0) { ret = -4; goto out; } case KEY_RSA: if ((key = sshkey_new(type)) == ((void *)0) ) { ret = -2; goto out; } if (sshbuf_get_bignum2(b, &rsa_e) != 0 || sshbuf_get_bignum2(b, &rsa_n) != 0) { ret = -4; goto out; } if (!RSA_set0_key(key->rsa, rsa_n, rsa_e, ((void *)0) )) { ret = -22; goto out; } rsa_n = rsa_e = ((void *)0) ; if ((ret = sshkey_check_rsa_length(key, 0)) != 0) goto out; break; case KEY_DSA_CERT: if (sshbuf_get_string_direct(b, ((void *)0) , ((void *)0) ) != 0) { ret = -4; goto out; } case KEY_DSA: if ((key = sshkey_new(type)) == ((void *)0) ) { ret = -2; goto out; } if (sshbuf_get_bignum2(b, &dsa_p) != 0 || sshbuf_get_bignum2(b, &dsa_q) != 0 || sshbuf_get_bignum2(b, &dsa_g) != 0 || sshbuf_get_bignum2(b, &dsa_pub_key) != 0) { ret = -4; goto out; } if (!DSA_set0_pqg(key->dsa, dsa_p, dsa_q, dsa_g)) { ret = -22; goto out; } dsa_p = dsa_q = dsa_g = ((void *)0) ; if (!DSA_set0_key(key->dsa, dsa_pub_key, ((void *)0) )) { ret = -22; goto out; } dsa_pub_key = ((void *)0) ; break; case KEY_ECDSA_CERT: case KEY_ECDSA_SK_CERT: if (sshbuf_get_string_direct(b, ((void *)0) , ((void *)0) ) != 0) { ret = -4; goto out; } case KEY_ECDSA: case KEY_ECDSA_SK: if ((key = sshkey_new(type)) == ((void *)0) ) { ret = -2; goto out; } key->ecdsa_nid = sshkey_ecdsa_nid_from_name(ktype); if (sshbuf_get_cstring(b, &curve, ((void *)0) ) != 0) { ret = -4; goto out; } if (key->ecdsa_nid != sshkey_curve_name_to_nid(curve)) { ret = -15; goto out; } EC_KEY_free(key->ecdsa); if ((key->ecdsa = EC_KEY_new_by_curve_name(key->ecdsa_nid)) == ((void *)0) ) { ret = -12; goto out; } if ((q = EC_POINT_new(EC_KEY_get0_group(key->ecdsa))) == ((void *)0) ) { ret = -2; goto out; } if (sshbuf_get_ec(b, q, EC_KEY_get0_group(key->ecdsa)) != 0) { ret = -4; goto out; } if (sshkey_ec_validate_public(EC_KEY_get0_group(key->ecdsa), q) != 0) { ret = -20; goto out; } if (EC_KEY_set_public_key(key->ecdsa, q) != 1) { ret = -2; goto out; } if (type == KEY_ECDSA_SK || type == KEY_ECDSA_SK_CERT) { if (sshbuf_get_cstring(b, &key->sk_application, ((void *)0) ) != 0) { ret = -4; goto out; } } break; case KEY_ED25519_CERT: case KEY_ED25519_SK_CERT: if (sshbuf_get_string_direct(b, ((void *)0) , ((void *)0) ) != 0) { ret = -4; goto out; } case KEY_ED25519: case KEY_ED25519_SK: if ((ret = sshbuf_get_string(b, &pk, &len)) != 0) goto out; if (len != 32U) { ret = -4; goto out; } if ((key = sshkey_new(type)) == ((void *)0) ) { ret = -2; goto out; } if (type == KEY_ED25519_SK || type == KEY_ED25519_SK_CERT) { if (sshbuf_get_cstring(b, &key->sk_application, ((void *)0) ) != 0) { ret = -4; goto out; } } key->ed25519_pk = pk; pk = ((void *)0) ; break; case KEY_UNSPEC: default: ret = -14; goto out; } if (sshkey_is_cert(key) && (ret = cert_parse(b, key, copy)) != 0) goto out; if (key != ((void *)0) && sshbuf_len(b) != 0) { ret = -4; goto out; } ret = 0; if (keyp != ((void *)0) ) { *keyp = key; key = ((void *)0) ; } out: sshbuf_free(copy); sshkey_free(key); free(xmss_name); free(ktype); free(curve); free(pk); BN_clear_free(rsa_n); BN_clear_free(rsa_e); BN_clear_free(dsa_p); BN_clear_free(dsa_q); BN_clear_free(dsa_g); BN_clear_free(dsa_pub_key); EC_POINT_free(q); return ret; }
long sshkey_from_blob_internal(long a1, _QWORD *a2, int a3) { int v3; int v4; long v5; long v6; long v7; unsigned int string; int v11; void *v12; void *v13; long v14; void *v15; long v16; long v17; long v18; long v19; long v20; long v21; int *v22; long v23; void *ptr; long v25; unsigned long v26; v26 = __readfsqword(0x28u); v12 = 0LL; v13 = 0LL; ptr = 0LL; v22 = 0LL; v15 = 0LL; v16 = 0LL; v17 = 0LL; v18 = 0LL; v19 = 0LL; v20 = 0LL; v21 = 0LL; v23 = 0LL; if ( a2 ) *a2 = 0LL; v25 = sshbuf_fromb(a1); if ( v25 ) { if ( (unsigned int)sshbuf_get_cstring(a1, &v12, 0LL) ) { string = -4; } else { v11 = sshkey_type_from_name((const char *)v12); if ( a3 || !(unsigned int)sshkey_type_is_cert(v11) ) { switch ( v11 ) { case 0: goto LABEL_13; case 1: goto LABEL_24; case 2: case 10: goto LABEL_38; case 3: case 12: goto LABEL_60; case 4: if ( (unsigned int)sshbuf_get_string_direct(a1, 0LL, 0LL) ) { string = -4; break; } LABEL_13: v22 = (int *)sshkey_new(v11); if ( !v22 ) { string = -2; break; } if ( (unsigned int)sshbuf_get_bignum2(a1, &v17) || (unsigned int)sshbuf_get_bignum2(a1, &v16) ) { string = -4; break; } if ( !(unsigned int)RSA_set0_key(*((_QWORD *)v22 + 1), v16, v17, 0LL) ) { string = -22; break; } v17 = 0LL; v16 = 0LL; string = sshkey_check_rsa_length((long)v22, 0); if ( string ) break; goto LABEL_71; case 5: if ( (unsigned int)sshbuf_get_string_direct(a1, 0LL, 0LL) ) { string = -4; break; } LABEL_24: v22 = (int *)sshkey_new(v11); if ( !v22 ) { string = -2; break; } if ( (unsigned int)sshbuf_get_bignum2(a1, &v18) || (unsigned int)sshbuf_get_bignum2(a1, &v19) || (unsigned int)sshbuf_get_bignum2(a1, &v20) || (unsigned int)sshbuf_get_bignum2(a1, &v21) ) { string = -4; break; } if ( !(unsigned int)DSA_set0_pqg(*((_QWORD *)v22 + 2), v18, v19, v20) ) { string = -22; break; } v20 = 0LL; v19 = 0LL; v18 = 0LL; if ( !(unsigned int)DSA_set0_key(*((_QWORD *)v22 + 2), v21, 0LL) ) { string = -22; break; } v21 = 0LL; goto LABEL_71; case 6: case 11: if ( (unsigned int)sshbuf_get_string_direct(a1, 0LL, 0LL) ) { string = -4; break; } LABEL_38: v22 = (int *)sshkey_new(v11); if ( !v22 ) { string = -2; break; } v3 = sshkey_ecdsa_nid_from_name((const char *)v12); v22[6] = v3; if ( (unsigned int)sshbuf_get_cstring(a1, &v13, 0LL) ) { string = -4; break; } v4 = v22[6]; if ( v4 != (unsigned int)sshkey_curve_name_to_nid((const char *)v13) ) { string = -15; break; } EC_KEY_free(*((_QWORD *)v22 + 4)); *((_QWORD *)v22 + 4) = EC_KEY_new_by_curve_name((unsigned int)v22[6]); if ( !*((_QWORD *)v22 + 4) ) { string = -12; break; } v5 = EC_KEY_get0_group(*((_QWORD *)v22 + 4)); v23 = EC_POINT_new(v5); if ( !v23 ) { string = -2; break; } v6 = EC_KEY_get0_group(*((_QWORD *)v22 + 4)); if ( (unsigned int)sshbuf_get_ec(a1, v23, v6) ) { string = -4; break; } v7 = EC_KEY_get0_group(*((_QWORD *)v22 + 4)); if ( (unsigned int)sshkey_ec_validate_public(v7, v23) ) { string = -20; break; } if ( (unsigned int)EC_KEY_set_public_key(*((_QWORD *)v22 + 4), v23) != 1 ) { string = -2; break; } if ( v11 != 10 && v11 != 11 || !(unsigned int)sshbuf_get_cstring(a1, v22 + 24, 0LL) ) goto LABEL_71; string = -4; break; case 7: case 13: if ( (unsigned int)sshbuf_get_string_direct(a1, 0LL, 0LL) ) { string = -4; } else { LABEL_60: string = sshbuf_get_string(a1, &v15, &v14); if ( !string ) { if ( v14 == 32 ) { v22 = (int *)sshkey_new(v11); if ( v22 ) { if ( (v11 == 12 || v11 == 13) && (unsigned int)sshbuf_get_cstring(a1, v22 + 24, 0LL) ) { string = -4; } else { *((_QWORD *)v22 + 6) = v15; v15 = 0LL; LABEL_71: if ( !(unsigned int)sshkey_is_cert(v22) || (string = cert_parse(a1, (long)v22, v25)) == 0 ) { if ( v22 && sshbuf_len(a1) ) { string = -4; } else { string = 0; if ( a2 ) { *a2 = v22; v22 = 0LL; } } } } } else { string = -2; } } else { string = -4; } } } break; default: string = -14; break; } } else { string = -19; } } } else { string = -2; } sshbuf_free(v25); sshkey_free((long)v22); free(ptr); free(v12); free(v13); free(v15); BN_clear_free(v16); BN_clear_free(v17); BN_clear_free(v18); BN_clear_free(v19); BN_clear_free(v20); BN_clear_free(v21); EC_POINT_free(v23); return string; }
static void xwrite_stdout (char const *buffer, size_t n_bytes) { if (n_bytes > 0 && fwrite_unlocked (buffer,1,n_bytes, stdout ) < n_bytes) { clearerr_unlocked ( stdout ); ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"error writing %s\"), quotearg_style (shell_escape_always_quoting_style, \"standard output\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , gettext ("error writing %s"), quotearg_style (shell_escape_always_quoting_style, "standard output")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , gettext ("error writing %s"), quotearg_style (shell_escape_always_quoting_style, "standard output")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; } }
void xwrite_stdout(void* a0, unsigned int a1) { unsigned long long v2; if (a1 && a1 > fwrite_unlocked(a0, 0x1, a1, stdout)) { clearerr_unlocked(stdout); v2 = quotearg_style(0x4, "standard output"); error(0x1, *(__errno_location()), gettext("error writing %s")); } return; }
static int is_localvar_builtin (name) char *name; { return (_find_in_table (name, localvar_builtins)); }
int is_localvar_builtin(unsigned long long a0) { return _find_in_table(a0, &localvar_builtins); }
static inline void emit_stdin_note (void) { fputs_unlocked (gettext ("\nWith no FILE, or when FILE is -, read standard input.\n"), stdout ) ; }
int emit_stdin_note() { FILE *v0; char *v1; v0 = stdout; v1 = gettext("\nWith no FILE, or when FILE is -, read standard input.\n"); return fputs_unlocked(v1, v0); }
void showjobs(struct output *out, int mode) { struct job *jp; ; dowait(0, ((void *)0) ); for (jp = curjob; jp; jp = jp->prev_job) { if (!(mode & 0x08) || jp->changed) showjob(out, jp, mode); } }
void showjobs(unsigned long long a0, unsigned long a1) { struct_0 *v0; unsigned long long v2; unsigned long long v3; dowait(0x0, 0x0); v2 = curjob; for (v0 = curjob; v0; v0 = v0->field_20) { if (!(a1 & 8) || (v0->field_1f & 16)) showjob(a0, v0, a1); v3 = v0->field_20; } return; }
static int flags_from_portable(int pflags) { int flags = 0; if ((pflags & 0x00000001) && (pflags & 0x00000002)) { flags = 02 ; } else if (pflags & 0x00000001) { flags = 00 ; } else if (pflags & 0x00000002) { flags = 01 ; } if (pflags & 0x00000004) flags |= 02000 ; if (pflags & 0x00000008) flags |= 0100 ; if (pflags & 0x00000010) flags |= 01000 ; if (pflags & 0x00000020) flags |= 0200 ; return flags; }
uint flags_from_portable(uint param_1) { uint local_c; local_c = 0; if (((param_1 & 1) == 0) || ((param_1 & 2) == 0)) { if ((param_1 & 1) == 0) { if ((param_1 & 2) != 0) { local_c = 1; } } else { local_c = 0; } } else { local_c = 2; } if ((param_1 & 4) != 0) { local_c = local_c | 0x400; } if ((param_1 & 8) != 0) { local_c = local_c | 0x40; } if ((param_1 & 0x10) != 0) { local_c = local_c | 0x200; } if ((param_1 & 0x20) != 0) { local_c = local_c | 0x80; } return local_c; }
void removerecordregions(int endoff) { if (ifslastp == ((void *)0) ) return; if (ifsfirst.endoff > endoff) { while (ifsfirst.next != ((void *)0) ) { struct ifsregion *ifsp; ({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; }); ifsp = ifsfirst.next->next; free((pointer)(ifsfirst.next)); ifsfirst.next = ifsp; ({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; }); } if (ifsfirst.begoff > endoff) ifslastp = ((void *)0) ; else { ifslastp = &ifsfirst; ifsfirst.endoff = endoff; } return; } ifslastp = &ifsfirst; while (ifslastp->next && ifslastp->next->begoff < endoff) ifslastp=ifslastp->next; while (ifslastp->next != ((void *)0) ) { struct ifsregion *ifsp; ({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; }); ifsp = ifslastp->next->next; free((pointer)(ifslastp->next)); ifslastp->next = ifsp; ({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; }); } if (ifslastp->endoff > endoff) ifslastp->endoff = endoff; }
void removerecordregions(unsigned long a0) { unsigned long v0; unsigned long long v1; struct_0 *v3; unsigned long long v4; unsigned long v5; unsigned long long v6; struct_0 *v7; v3 = ifslastp; if (ifslastp) { if (a0 < g_402aac) { while (true) { if (ifsfirst) { suppressint = suppressint + 1; v1 = ifsfirst->field_0; free(ifsfirst); ifsfirst = v1; suppressint = suppressint - 1; if (suppressint) continue; if (!*(&intpending)) continue; onint(); } else { v4 = g_402aa8; if (a0 < g_402aa8) { ifslastp = 0; break; } else { ifslastp = &ifsfirst; v5 = a0; g_402aac = a0; break; } } } } else { for (ifslastp = &ifsfirst; *(ifslastp); ifslastp = *(ifslastp)) { if (a0 <= *((*(ifslastp) + 8))) break; } while (true) { if (*(ifslastp)) { suppressint = suppressint + 1; v0 = *(*(ifslastp)); free(*(ifslastp)); *(ifslastp) = v0; suppressint = suppressint - 1; if (suppressint) continue; if (!*(&intpending)) continue; onint(); } else { v6 = *((ifslastp + 12)); if (a0 >= *((ifslastp + 12))) break; if (a0 < *((ifslastp + 12))) { v7 = ifslastp; *((ifslastp + 12)) = a0; break; } } } } } return; }
static int handle_to_flags(int handle) { if (handle_is_ok(handle, HANDLE_FILE)) return handles[handle].flags; return 0; }
int handle_to_flags(unsigned long a0) { unsigned int v1; v1 = handle_is_ok(a0, 0x2); if (v1) v1 = *((a0 * 56 + handles + 20)); else v1 = 0; return v1; }
void crq_extensions_set(gnutls_x509_crt_t crt, gnutls_x509_crq_t crq) { int ret, i; if (batch) { if (!cfg.exts_to_honor) return; for (i = 0; cfg.exts_to_honor[i]; ++i) { ret = gnutls_x509_crt_set_crq_extension_by_oid(crt, crq, cfg.exts_to_honor[i], 0); if (ret < 0) { fprintf( stderr , "setting extension failed: %s: %s\n", cfg.exts_to_honor[i], gnutls_strerror(ret)); } } } }
long long crq_extensions_set(unsigned long long a0, unsigned long long a1) { unsigned int v0; unsigned int v1; unsigned long long v3; v3 = *(got.batch); if (!*(got.batch)) return v3; v3 = *((got.cfg + 648)); if (!*((got.cfg + 648))) return v3; v0 = 0; while (true) { v3 = *((*((got.cfg + 648)) + v0 * 8)); if (!*((*((got.cfg + 648)) + (v0 << 3)))) break; v1 = gnutls_x509_crt_set_crq_extension_by_oid(a0, a1, *((*((got.cfg + 648)) + v0 * 8)), 0x0); if (v1 < 0) fprintf(*(got.stderr), "setting extension failed: %s: %s\n", *((*((got.cfg + 648)) + v0 * 8)), gnutls_strerror(v1)); v0 += 1; } return v3; }
void test_large_deflate(compr, comprLen, uncompr, uncomprLen) Byte *compr, *uncompr; uLong comprLen, uncomprLen; { z_stream c_stream; int err; c_stream.zalloc = zalloc; c_stream.zfree = zfree; c_stream.opaque = (voidpf)0; err = deflateInit_((&c_stream), (1), "1.2.13", (int)sizeof(z_stream)); { if (err != 0) { fprintf( stderr , "%s error: %d\n", "deflateInit", err); exit(1); } }; c_stream.next_out = compr; c_stream.avail_out = (uInt)comprLen; c_stream.next_in = uncompr; c_stream.avail_in = (uInt)uncomprLen; err = deflate(&c_stream, 0); { if (err != 0) { fprintf( stderr , "%s error: %d\n", "deflate", err); exit(1); } }; if (c_stream.avail_in != 0) { fprintf( stderr , "deflate not greedy\n"); exit(1); } deflateParams(&c_stream, 0, 0); c_stream.next_in = compr; c_stream.avail_in = (uInt)comprLen/2; err = deflate(&c_stream, 0); { if (err != 0) { fprintf( stderr , "%s error: %d\n", "deflate", err); exit(1); } }; deflateParams(&c_stream, 9, 1); c_stream.next_in = uncompr; c_stream.avail_in = (uInt)uncomprLen; err = deflate(&c_stream, 0); { if (err != 0) { fprintf( stderr , "%s error: %d\n", "deflate", err); exit(1); } }; err = deflate(&c_stream, 4); if (err != 1) { fprintf( stderr , "deflate should report Z_STREAM_END\n"); exit(1); } err = deflateEnd(&c_stream); { if (err != 0) { fprintf( stderr , "%s error: %d\n", "deflateEnd", err); exit(1); } }; }
void test_large_deflate(undefined8 param_1,ulong param_2,undefined8 param_3,int param_4) { uint uVar1; int iVar2; long in_FS_OFFSET; undefined8 local_88; uint local_80; undefined8 local_70; undefined4 local_68; undefined8 local_48; undefined8 local_40; undefined8 local_38; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_48 = zalloc; local_40 = zfree; local_38 = 0; uVar1 = deflateInit_(&local_88,1,"1.2.13",0x70); if (uVar1 != 0) { fprintf(stderr,"%s error: %d\n","deflateInit",(ulong)uVar1); exit(1); } local_68 = (undefined4)param_2; local_88 = param_3; local_80 = param_4; local_70 = param_1; uVar1 = deflate(&local_88,0); if (uVar1 != 0) { fprintf(stderr,"%s error: %d\n","deflate",(ulong)uVar1); exit(1); } if (local_80 != 0) { fprintf(stderr,"deflate not greedy\n"); exit(1); } deflateParams(&local_88,0,0); local_80 = (uint)(param_2 >> 1) & 0x7fffffff; local_88 = param_1; uVar1 = deflate(&local_88,0); if (uVar1 != 0) { fprintf(stderr,"%s error: %d\n","deflate",(ulong)uVar1); exit(1); } deflateParams(&local_88,9,1); local_88 = param_3; local_80 = param_4; uVar1 = deflate(&local_88,0); if (uVar1 != 0) { fprintf(stderr,"%s error: %d\n","deflate",(ulong)uVar1); exit(1); } iVar2 = deflate(&local_88,4); if (iVar2 != 1) { fprintf(stderr,"deflate should report Z_STREAM_END\n"); exit(1); } uVar1 = deflateEnd(&local_88); if (uVar1 != 0) { fprintf(stderr,"%s error: %d\n","deflateEnd",(ulong)uVar1); exit(1); } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
static inline __u64 rta_getattr_u64(const struct rtattr *rta) { __u64 tmp; memcpy(&tmp, ((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), sizeof(__u64)); return tmp; }
int rta_getattr_u64(unsigned long a0) { char v0; memcpy(&v0, a0 + 4, 0x8); return *(&v0); }
static void readline_set_char_offset (ind, varp) int ind; int *varp; { int i; i = ind; if (i > 0 && locale_mb_cur_max > 1) i = _rl_find_next_mbchar (rl_line_buffer, 0, i, 0); if (i != *varp) { if (i > rl_end) i = rl_end; else if (i < 0) i = 0; *varp = i; } }
unsigned long readline_set_char_offset(unsigned int a1, int *a2) { unsigned long result; int next_mbchar; next_mbchar = a1; if ( (int)a1 > 0 && locale_mb_cur_max > 1 ) next_mbchar = rl_find_next_mbchar(rl_line_buffer, 0LL, a1, 0LL); result = (unsigned int)*a2; if ( next_mbchar != (_DWORD)result ) { if ( next_mbchar <= rl_end ) { if ( next_mbchar < 0 ) next_mbchar = 0; } else { next_mbchar = rl_end; } result = (unsigned long)a2; *a2 = next_mbchar; } return result; }
static ssize_t client_pull(gnutls_transport_ptr_t tr, void *data, size_t len) { ; if (to_client_len == 0) { gnutls_transport_set_errno((gnutls_session_t) tr, 11 ); return -1; } len = ((len)<(to_client_len)?(len):(to_client_len)); memcpy(data, to_client, len); memmove(to_client, to_client + len, to_client_len - len); to_client_len -= len; return len; }
long long client_pull(unsigned long long a0, void* a1, unsigned long a2) { unsigned long v0; unsigned long v2; unsigned long long v3; v0 = a2; if (!to_client_len) { gnutls_transport_set_errno(a0, 0xb); v3 = -1; } else { v2 = to_client_len; if (v0 <= to_client_len) v2 = v0; v0 = v2; memcpy(a1, &to_client, v0); memmove(&to_client, &to_client + v0, to_client_len - v0); to_client_len = to_client_len - v0; v3 = v0; } return v3; }
histdata_t free_history_entry(HIST_ENTRY *he) { return he ? ((void *)0) : ((void *)0) ; }
undefined8 free_history_entry(void) { return 0; }
static int kmod_help(int argc, char *argv[]) { size_t i; printf("kmod - Manage kernel modules: list, load, unload, etc\n" "Usage:\n" "\t%s [options] command [command_options]\n\n" "Options:\n" "\t-V, --version show version\n" "\t-h, --help show this help\n\n" "Commands:\n", basename(argv[0])); for (i = 0; i < (sizeof(kmod_cmds) / sizeof((kmod_cmds)[0]) + ({ _Static_assert((!__builtin_types_compatible_p(typeof(kmod_cmds), typeof(&(kmod_cmds)[0]))), "!__builtin_types_compatible_p(typeof(kmod_cmds), typeof(&(kmod_cmds)[0]))"); 0; })); i++) { if (kmod_cmds[i]->help != ((void *)0) ) { printf(" %-12s %s\n", kmod_cmds[i]->name, kmod_cmds[i]->help); } } puts("\nkmod also handles gracefully if called from following symlinks:"); for (i = 0; i < (sizeof(kmod_compat_cmds) / sizeof((kmod_compat_cmds)[0]) + ({ _Static_assert((!__builtin_types_compatible_p(typeof(kmod_compat_cmds), typeof(&(kmod_compat_cmds)[0]))), "!__builtin_types_compatible_p(typeof(kmod_compat_cmds), typeof(&(kmod_compat_cmds)[0]))"); 0; })); i++) { if (kmod_compat_cmds[i]->help != ((void *)0) ) { printf(" %-12s %s\n", kmod_compat_cmds[i]->name, kmod_compat_cmds[i]->help); } } return 0 ; }
long kmod_help(long a1, const char **a2) { char *v2; unsigned long i; unsigned long j; v2 = basename(*a2); printf( "kmod - Manage kernel modules: list, load, unload, etc\n" "Usage:\n" "\t%s [options] command [command_options]\n" "\n" "Options:\n" "\t-V, --version show version\n" "\t-h, --help show this help\n" "\n" "Commands:\n", v2); for ( i = 0LL; i <= 2; ++i ) { if ( (&kmod_cmds)[i][2] ) printf(" %-12s %s\n", *(&kmod_cmds)[i], (&kmod_cmds)[i][2]); } puts("\nkmod also handles gracefully if called from following symlinks:"); for ( j = 0LL; j <= 5; ++j ) { if ( *((_QWORD *)*(&kmod_compat_cmds + j) + 2) ) printf(" %-12s %s\n", *(const char **)*(&kmod_compat_cmds + j), *((const char **)*(&kmod_compat_cmds + j) + 2)); } return 0LL; }
static unsigned char *decode_ext_string(char *str, unsigned int *ret_size) { char *p, *p2; unsigned char *tmp; unsigned char *raw; unsigned int raw_size; unsigned action = 0; unsigned char tag[ (4 +9) ]; unsigned int tag_len; int ret, res; p = strchr(str, '('); if (p != 0) { if (strncmp(str, "octet_string", 12) == 0) { action = 1; } else { fprintf( stderr , "cannot parse: %s\n", str); exit(1); } p++; p2 = strchr(p, ')'); if (p2 == ((void *)0) ) { fprintf( stderr , "there is no terminating parenthesis in: %s\n", str); exit(1); } *p2 = 0; } else { p = str; } if (strncmp(p, "0x", 2) == 0) p+=2; { gnutls_datum_t _input = {(void*)p, strlen(p)}; gnutls_datum_t _output; ret = gnutls_hex_decode2(&_input, &_output); if (ret < 0) { fprintf( stderr , "error in hex ID: %s\n", p); exit(1); } raw = _output.data; raw_size = _output.size; }; switch(action) { case 1: tag_len = sizeof(tag); res = asn1_encode_simple_der( 7 , raw, raw_size, tag, &tag_len); if (res != 0 ) { fprintf( stderr , "error in DER encoding: %s\n", asn1_strerror(res)); exit(1); } tmp = gnutls_malloc(raw_size+tag_len); if (tmp == ((void *)0) ) { fprintf( stderr , "error in allocation\n"); exit(1); } memcpy(tmp, tag, tag_len); memcpy(tmp+tag_len, raw, raw_size); gnutls_free((void *) (raw)), raw= ((void *)0) ; raw = tmp; raw_size += tag_len; break; } *ret_size = raw_size; return raw; }
int decode_ext_string(char *a0, unsigned int *a1) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; char *v4; unsigned long long v5; char *v6; void* v7; unsigned long v8; unsigned int v9; char v10; char v11; char v12; v1 = 0; v4 = strchr(a0, 0x28); if (!v4) { v4 = a0; } else if (strncmp(a0, "octet_string", 0xc)) { fprintf(*(*(&got.stderr)), "cannot parse: %s\n", a0); exit(0x1); } else { v1 = 1; v4 += 1; v6 = strchr(v4, 0x29); if (v6) { *(v6) = 0; } else { fprintf(*(*(&got.stderr)), "there is no terminating parenthesis in: %s\n", a0); exit(0x1); } } if (!strncmp(v4, "0x", 0x2)) v4 += 2; v8 = v4; v9 = strlen(v4); v2 = gnutls_hex_decode2(&v8, &v10, &v10); if (v2 < 0) { fprintf(*(*(&got.stderr)), "error in hex ID: %s\n", v4); exit(0x1); } v5 = *(&v10); v0 = *(&v11); if (v1 == 1) { v10 = 13; v3 = asn1_encode_simple_der(0x7, v5, v0, &v12, &v10); if (v3) { fprintf(*(*(&got.stderr)), "error in DER encoding: %s\n", asn1_strerror(v3)); exit(0x1); } v7 = *(*(5243144))(v0 + v10); if (!v7) { fprintf(*(*(&got.stderr)), "error in allocation\n"); exit(0x1); } memcpy(v7, &v12, v10); memcpy(v10 + v7, v5, v0); *(*(5243304))(v5); v5 = 0; v5 = v7; v0 += v10; } *(a1) = v0; return v5; }
u_int cipher_keylen(const struct sshcipher *c) { return (c->key_len); }
long cipher_keylen(long a1) { return *(unsigned int *)(a1 + 12); }
printversion(const struct cmdinfo *ci, const char *value) { if (f_robot) { printf("%s", "1.20.12"); } else { printf(gettext("Debian '%s' package management program version %s.\n"), "dpkg", "1.20.12" " (" "amd64" ")"); printf(gettext("This is free software; see the GNU General Public License version 2 or\n" "later for copying conditions. There is NO warranty.\n") ); } m_output( stdout , gettext("<standard output>")); exit(0); }
long long printversion() { unsigned long v0; unsigned long v1; unsigned long v3; unsigned long v4; unsigned long long v5; v1 = v3; v0 = v4; if (f_robot) { printf("%s", &g_401340); } else { printf(gettext("Debian '%s' package management program version %s.\n")); printf(gettext("This is free software; see the GNU General Public License version 2 or\nlater for copying conditions. There is NO warranty.\n")); } v5 = gettext("<standard output>"); m_output(stdout, v5, v5); exit(0x0); }
const char * zlibVersion() { return "1.2.13"; }
char * zlibVersion(void) { return "1.2.13"; }
static void read_clearmacros(struct macros *ma) { while (ma->level >= 0) free(ma->macro[ma->level--]); ma->offset = 0; }
void read_clearmacros(unsigned long long a0) { struct_0 *v0; int tmp_23; int tmp_29; struct_0 *v3; v0 = a0; while (v0->field_8 >= 0) { tmp_23 = v0->field_0; tmp_29 = v0->field_8; v0->field_8 = v0->field_8 - 1; free(*((tmp_29 * 8 + tmp_23))); } v3 = v0; v0->field_c = 0; return; }
static void ipmacsec_usage(void) { fprintf( stderr , "Usage: ip macsec add DEV tx sa { 0..3 } [ OPTS ] key ID KEY\n" " ip macsec set DEV tx sa { 0..3 } [ OPTS ]\n" " ip macsec del DEV tx sa { 0..3 }\n" " ip macsec add DEV rx SCI [ on | off ]\n" " ip macsec set DEV rx SCI [ on | off ]\n" " ip macsec del DEV rx SCI\n" " ip macsec add DEV rx SCI sa { 0..3 } [ OPTS ] key ID KEY\n" " ip macsec set DEV rx SCI sa { 0..3 } [ OPTS ]\n" " ip macsec del DEV rx SCI sa { 0..3 }\n" " ip macsec show\n" " ip macsec show DEV\n" " ip macsec offload DEV [ off | phy | mac ]\n" "where OPTS := [ pn <u32> ] [ on | off ]\n" " ID := 128-bit hex string\n" " KEY := 128-bit or 256-bit hex string\n" " SCI := { sci <u64> | port { 1..2^16-1 } address <lladdr> }\n"); exit(-1); }
void ipmacsec_usage() { fprintf(stderr, "Usage: ip macsec add DEV tx sa { 0..3 } [ OPTS ] key ID KEY\n ip macsec set DEV tx sa { 0..3 } [ OPTS ]\n ip macsec del DEV tx sa { 0..3 }\n ip macsec add DEV rx SCI [ on | off ]\n ip macsec set DEV rx SCI [ on | off ]\n ip macsec del DEV rx SCI\n ip macsec add DEV rx SCI sa { 0..3 } [ OPTS ] key ID KEY\n ip macsec set DEV rx SCI sa { 0..3 } [ OPTS ]\n ip macsec del DEV rx SCI sa { 0..3 }\n ip macsec show\n ip macsec show DEV\n ip macsec offload DEV [ off | phy | mac ]\nwhere OPTS := [ pn <u32> ] [ on | off ]\n ID := 128-bit hex string\n KEY := 128-bit or 256-bit hex string\n SCI := { sci <u64> | port { 1..2^16-1 } address <lladdr> }\n"); exit(0xffffffff); }
static z_crc_t multmodp(a, b) z_crc_t a; z_crc_t b; { z_crc_t m, p; m = (z_crc_t)1 << 31; p = 0; for (;;) { if (a & m) { p ^= b; if ((a & (m - 1)) == 0) break; } m >>= 1; b = b & 1 ? (b >> 1) ^ 0xedb88320 : b >> 1; } return p; }
int multmodp(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned int v1; unsigned int v2; v0 = a1; v1 = 0x80000000; for (v2 = 0; !(a0 & v1) || (v2 ^= v0, (v1 - 1 & a0)); v0 = (!(v0 & 1) ? (v0 >> 1) ^ 3988292384 : (v0 >> 1))) { v1 >>= 1; } return v2; }
void rl_save_prompt(void) { rl_prompt_saved = strdup(rl_prompt); }
long long rl_save_prompt() { *(got.rl_prompt_saved) = strdup(*(got.rl_prompt)); return got.rl_prompt_saved; }
static errcode_t pass1_read_inode(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode) { e2fsck_t ctx = (e2fsck_t) fs->priv_data; if ((ino != ctx->stashed_ino) || !ctx->stashed_inode) return (2133571393L); *inode = *ctx->stashed_inode; return 0; }
long long pass1_read_inode(struct_0 *a0, unsigned long a1, unsigned long a2) { unsigned long long v0[16]; int tmp_47; int tmp_57; int tmp_69; int tmp_81; int tmp_93; int tmp_105; int tmp_117; struct_1 *v1; unsigned long long v3; unsigned long long v4[16]; unsigned long long v5; v0[0] = a2; v1 = a0->field_e0; if (a1 != v1->field_218) { v3 = 2133571393; return v3; } else if (!v1->field_220) { v3 = 2133571393; return v3; } else { v4 = v1->field_220; tmp_47 = v1->field_220->field_8; v0[0] = v1->field_220->field_0; v0[1] = tmp_47; tmp_57 = v4[3]; v0[2] = v4[2]; v0[3] = tmp_57; tmp_69 = v4[5]; v0[4] = v4[4]; v0[5] = tmp_69; tmp_81 = v4[7]; v0[6] = v4[6]; v0[7] = tmp_81; tmp_93 = v4[9]; v0[8] = v4[8]; v0[9] = tmp_93; tmp_105 = v4[11]; v0[10] = v4[10]; v0[11] = tmp_105; tmp_117 = v4[13]; v0[12] = v4[12]; v0[13] = tmp_117; v5 = v4[15]; v0[14] = v4[14]; v0[15] = v5; v3 = 0; return v3; } }
static inline void grabstackblock(size_t len) { stalloc(len); }
void grabstackblock(unsigned long long a0) { unsigned long long v1; v1 = stalloc(a0); return; }
int match_pattern(const char *s, const char *pattern) { for (;;) { if (!*pattern) return !*s; if (*pattern == '*') { while (*pattern == '*') pattern++; if (!*pattern) return 1; if (*pattern != '?' && *pattern != '*') { for (; *s; s++) if (*s == *pattern && match_pattern(s + 1, pattern + 1)) return 1; return 0; } for (; *s; s++) if (match_pattern(s, pattern)) return 1; return 0; } if (!*s) return 0; if (*pattern != '?' && *pattern != *s) return 0; s++; pattern++; } }
int match_pattern(unsigned long long a0, unsigned long long a1) { char *v0; char *v1; unsigned int v3; v1 = a0; v0 = a1; while (true) { switch (*(v0)) { case 0: v3 = !*(v1); return v3; case 42: for (; *(v0) == 42; v0 += 1); default: if (*(v1)) { if (*(v0) != 63 && *(v0) != *(v1)) { v3 = 0; return v3; } v1 += 1; v0 += 1; break; } else { v3 = 0; return v3; } } } if (!*(v0)) { v3 = 1; return v3; } if (*(v0) != 63 && *(v0) != 42) { while (true) { if (*(v1)) { if (*(v1) == *(v0) && match_pattern(v1 + 1, v0 + 1)) { v3 = 1; return v3; } v1 += 1; } else { v3 = 0; return v3; } } } while (true) { if (!*(v1)) { v3 = 0; return v3; } else if (!match_pattern(v1, v0)) { v1 += 1; } else { v3 = 1; return v3; } } }