input
stringlengths
28
169k
output
stringlengths
20
317k
static int gz_look(state) gz_statep state; { z_streamp strm = &(state->strm); if (state->size == 0) { state->in = (unsigned char *)malloc(state->want); state->out = (unsigned char *)malloc(state->want << 1); if (state->in == ((void *)0) || state->out == ((void *)0) ) { free(state->out); free(state->in); gz_error(state, (-4), "out of memory"); return -1; } state->size = state->want; state->strm.zalloc = 0; state->strm.zfree = 0; state->strm.opaque = 0; state->strm.avail_in = 0; state->strm.next_in = 0; if (inflateInit2_((&(state->strm)), (15 + 16), "1.2.13", (int)sizeof(z_stream)) != 0) { free(state->out); free(state->in); state->size = 0; gz_error(state, (-4), "out of memory"); return -1; } } if (strm->avail_in < 2) { if (gz_avail(state) == -1) return -1; if (strm->avail_in == 0) return 0; } if (strm->avail_in > 1 && strm->next_in[0] == 31 && strm->next_in[1] == 139) { inflateReset(strm); state->how = 2; state->direct = 0; return 0; } if (state->direct == 0) { strm->avail_in = 0; state->eof = 1; state->x.have = 0; return 0; } state->x.next = state->out; memcpy(state->x.next, strm->next_in, strm->avail_in); state->x.have = strm->avail_in; strm->avail_in = 0; state->how = 1; state->direct = 1; return 0; }
undefined8 gz_look(undefined4 *param_1) { int iVar1; char **ppcVar2; void *pvVar3; ppcVar2 = (char **)(param_1 + 0x20); if (param_1[10] == 0) { pvVar3 = malloc((ulong)(uint)param_1[0xb]); *(void **)(param_1 + 0xc) = pvVar3; pvVar3 = malloc((ulong)(uint)(param_1[0xb] * 2)); *(void **)(param_1 + 0xe) = pvVar3; if ((*(long *)(param_1 + 0xc) == 0) || (*(long *)(param_1 + 0xe) == 0)) { free(*(void **)(param_1 + 0xe)); free(*(void **)(param_1 + 0xc)); gz_error(param_1,0xfffffffc,"out of memory"); return 0xffffffff; } param_1[10] = param_1[0xb]; *(undefined8 *)(param_1 + 0x30) = 0; *(undefined8 *)(param_1 + 0x32) = 0; *(undefined8 *)(param_1 + 0x34) = 0; param_1[0x22] = 0; *(undefined8 *)(param_1 + 0x20) = 0; iVar1 = inflateInit2_(param_1 + 0x20,0x1f,"1.2.13",0x70); if (iVar1 != 0) { free(*(void **)(param_1 + 0xe)); free(*(void **)(param_1 + 0xc)); param_1[10] = 0; gz_error(param_1,0xfffffffc,"out of memory"); return 0xffffffff; } } if ((uint)param_1[0x22] < 2) { iVar1 = gz_avail(param_1); if (iVar1 == -1) { return 0xffffffff; } if (param_1[0x22] == 0) { return 0; } } if ((((uint)param_1[0x22] < 2) || (**ppcVar2 != '\x1f')) || ((*ppcVar2)[1] != -0x75)) { if (param_1[0x10] == 0) { param_1[0x22] = 0; param_1[0x14] = 1; *param_1 = 0; } else { *(undefined8 *)(param_1 + 2) = *(undefined8 *)(param_1 + 0xe); memcpy(*(void **)(param_1 + 2),*ppcVar2,(ulong)(uint)param_1[0x22]); *param_1 = param_1[0x22]; param_1[0x22] = 0; param_1[0x11] = 1; param_1[0x10] = 1; } } else { inflateReset(ppcVar2); param_1[0x11] = 2; param_1[0x10] = 0; } return 0; }
static void give_help (void) { fprintf ( stderr , "%s", gettext ("ed:\tEdit then use both versions, each decorated with a header.\neb:\tEdit then use both versions.\nel or e1:\tEdit then use the left version.\ner or e2:\tEdit then use the right version.\ne:\tDiscard both versions then edit a new one.\nl or 1:\tUse the left version.\nr or 2:\tUse the right version.\ns:\tSilently include common lines.\nv:\tVerbosely include common lines.\nq:\tQuit.\n") ); }
void give_help() { unsigned long long v1; v1 = fprintf(stderr, "%s", gettext("ed:\tEdit then use both versions, each decorated with a header.\neb:\tEdit then use both versions.\nel or e1:\tEdit then use the left version.\ner or e2:\tEdit then use the right version.\ne:\tDiscard both versions then edit a new one.\nl or 1:\tUse the left version.\nr or 2:\tUse the right version.\ns:\tSilently include common lines.\nv:\tVerbosely include common lines.\nq:\tQuit.\n")); return; }
int sys_valid_rdomain(const char *name) { int fd; if ((fd = socket( 2 , SOCK_STREAM , 0)) == -1) return 0; if (setsockopt(fd, 1 , 25 , name, strlen(name)) == -1) { close(fd); return 0; } close(fd); return 1; }
long long sys_valid_rdomain(void* a0) { unsigned int v0; unsigned long long v2; v0 = socket(0x2, 0x1, 0x0); if (v0 == -1) { v2 = 0; } else if (setsockopt(v0, 0x1, 0x19, a0, strlen(a0)) == -1) { close(v0); v2 = 0; } else { close(v0); v2 = 1; } return v2; }
static size_t tab_from_to (size_t from, size_t to) { FILE *out = outfile; size_t tab; size_t tab_size = tabsize; if (!expand_tabs) for (tab = from + tab_size - from % tab_size; tab <= to; tab += tab_size) { putc_unlocked ('\t',out); from = tab; } while (from++ < to) putc_unlocked (' ',out); return to; }
int tab_from_to(unsigned long long a0, unsigned long a1) { unsigned long long v0; unsigned long v1; void* v2; unsigned long v3; unsigned long long v5; v0 = a0; v2 = outfile; v3 = tabsize; if ((expand_tabs ^ 1)) { for (v1 = v0 + v3 - ((0 CONCAT v0) /m v3 >> 64); v1 <= a1; v1 += v3) { putc_unlocked(0x9, v2); v0 = v1; } } while (true) { v5 = v0; v0 += 1; if (a1 <= v5) break; putc_unlocked(0x20, v2); } return a1; }
static void bi_windup(s) deflate_state *s; { if (s->bi_valid > 8) { { {s->pending_buf[s->pending++] = (Bytef)((uch)((s->bi_buf) & 0xff));}; {s->pending_buf[s->pending++] = (Bytef)((uch)((ush)(s->bi_buf) >> 8));}; }; } else if (s->bi_valid > 0) { {s->pending_buf[s->pending++] = (Bytef)((Byte)s->bi_buf);}; } s->bi_buf = 0; s->bi_valid = 0; }
void bi_windup(struct_2 *a0) { struct_2 *v0; int tmp_38; int tmp_46; int tmp_52; int tmp_98; int tmp_32; char *v3; char *v4; struct_2 *v5; v0 = a0; if (a0->field_1734 > 8) { tmp_38 = a0->field_1730; tmp_46 = a0->field_10; tmp_52 = a0->field_28; a0->field_28 = a0->field_28 + 1; *((tmp_52 + tmp_46)) = tmp_38; a0 = (a0->field_1730 >> 8); v3 = a0->field_10; tmp_98 = a0->field_28; a0->field_28 = a0->field_28 + 1; *(&v3[tmp_98]) = a0; } else if (a0->field_1734 > 0) { a0 = a0->field_1730; v4 = a0->field_10; tmp_32 = a0->field_28; a0->field_28 = a0->field_28 + 1; *(&v4[tmp_32]) = a0; } a0->field_1730 = 0; v5 = a0; a0->field_1734 = 0; return; }
static unsigned decode(count, buffer) unsigned count; uch buffer[]; { static unsigned i; unsigned r, c; r = 0; while (--j >= 0) { buffer[r] = buffer[i]; i = (i + 1) & (((unsigned) 1 << 13) - 1); if (++r == count) return r; } for ( ; ; ) { c = decode_c(); if (c == (255 + 256 + 2 - 3)) { done = 1; return r; } if (c <= 255) { buffer[r] = c; if (++r == count) return r; } else { j = c - (255 + 1 - 3); i = (r - decode_p() - 1) & (((unsigned) 1 << 13) - 1); while (--j >= 0) { buffer[r] = buffer[i]; i = (i + 1) & (((unsigned) 1 << 13) - 1); if (++r == count) return r; } } } }
long decode(int a1, long a2) { unsigned int v3; unsigned int v4; v3 = 0; while ( --j >= 0 ) { *(_BYTE *)(v3 + a2) = *(_BYTE *)((unsigned int)i_2862 + a2); i_2862 = ((_WORD)i_2862 + 1) & 0x1FFF; if ( ++v3 == a1 ) return v3; } do { while ( 1 ) { v4 = decode_c(); if ( v4 == 510 ) { done = 1; return v3; } if ( v4 <= 0xFF ) break; j = v4 - 253; i_2862 = ((_WORD)v3 - (unsigned short)decode_p() - 1) & 0x1FFF; while ( --j >= 0 ) { *(_BYTE *)(v3 + a2) = *(_BYTE *)((unsigned int)i_2862 + a2); i_2862 = ((_WORD)i_2862 + 1) & 0x1FFF; if ( ++v3 == a1 ) return v3; } } *(_BYTE *)(v3++ + a2) = v4; } while ( v3 != a1 ); return v3; }
int main (int argc, char **argv) { char *format; int args_used; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdout); exit_status = 0 ; posixly_correct = (getenv ("POSIXLY_CORRECT") != ((void *)0) ); if (argc == 2) { if ((strcmp (argv[1], "--help") == 0)) usage ( 0 ); if ((strcmp (argv[1], "--version") == 0)) { version_etc ( stdout , "printf", "GNU coreutils", Version, ("David MacKenzie"), (char *) ((void *)0) ); return 0 ; } } if (1 < argc && (strcmp (argv[1], "--") == 0)) { --argc; ++argv; } if (argc <= 1) { error (0, 0, gettext ("missing operand")); usage ( 1 ); } format = argv[1]; argc -= 2; argv += 2; do { args_used = print_formatted (format, argc, argv); argc -= args_used; argv += args_used; } while (args_used > 0 && argc > 0); if (argc > 0) error (0, 0, gettext ("warning: ignoring excess arguments, starting with %s"), quote (argv[0])); return exit_status; }
int main(unsigned long a0, unsigned long a1) { unsigned long long v0[2]; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v5; unsigned long long v6; unsigned long long v8; v1 = a0; v0[0] = a1; set_program_name(v0[0]); setlocale(0x6, &g_401d23); bindtextdomain("coreutils", "/usr/local/share/locale"); textdomain("coreutils"); atexit(got.close_stdout); exit_status = 0; v5 = getenv("POSIXLY_CORRECT"); posixly_correct = v5; if (v1 == 2) { v6 = strcmp(v0[1], "--help"); if (!v6) usage(0x0); v5 = strcmp(v0[1], "--version"); if (!v5) { version_etc(stdout, "printf", "GNU coreutils", Version, "David MacKenzie", 0x0); v5 = 0; } } if ((v1 != 2 || v5 && v6) && v1 > 1) { v5 = strcmp(v0[1], "--"); if (!v5) { v1 -= 1; v0[0] = &v0[1]; } } if ((v5 || v1 != 2) && (v1 != 2 || v6)) { if (v1 <= 1) { error(0x0, 0x0, gettext("missing operand")); usage(0x1); } *(&v3) = v0[1]; v1 -= 2; v0 = &v0[1]; do { v2 = print_formatted(*(&v3), v1, v0); v1 -= v2; v0 = &v0[v2]; if (v2 <= 0) break; } while (v1 > 0); if (v1 > 0) { v8 = quote(*(v0)); error(0x0, 0x0, gettext("warning: ignoring excess arguments, starting with %s")); } v5 = exit_status; } if ((!v5 || v1 > 1) && (v1 == 2 || v1 > 1) && (v1 != 2 || v6)) return v5; }
static void proc_body (void) { current_type = body_type; current_regex = &body_regex; reset_lineno (); putchar_unlocked ('\n'); }
int proc_body() { current_type = (long)body_type; current_regex = &body_regex; reset_lineno(); return putchar_unlocked(10); }
static inline char *_STPUTC(int c, char *p) { if (p == sstrend) p = growstackstr(); *p++ = c; return p; }
int _STPUTC(unsigned long a0, unsigned long a1) { char *v0; int tmp_13; v0 = a1; if (v0 == sstrend) v0 = growstackstr(); tmp_13 = v0; v0 += 1; *(tmp_13) = a0; return v0; }
_Bool digest_mode (mode_t *mode, const char *pathname, const char *name, struct stat *pstat, _Bool leaf) { if (*mode) { if ( (((( *mode )) & 0170000) == (0120000)) && following_links()) { if (get_statinfo (pathname, name, pstat) != 0) return 0 ; *mode = state.type = pstat->st_mode; state.have_type = 1 ; } else { state.have_type = 1 ; pstat->st_mode = state.type = *mode; } } else { if (leaf) { state.have_stat = 0 ; state.have_type = 0 ; state.type = 0; } else { if (get_statinfo (pathname, name, pstat) != 0) return 0 ; state.type = *mode = pstat->st_mode; state.have_type = 1 ; } } return 1 ; }
undefined8 digest_mode(uint *param_1,undefined8 param_2,undefined8 param_3,long param_4,char param_5) { char cVar1; int iVar2; if (*param_1 == 0) { if (param_5 == '\0') { iVar2 = get_statinfo(param_2,param_3,param_4); if (iVar2 != 0) { return 0; } *param_1 = *(uint *)(param_4 + 0x18); options = *param_1; DAT_00104055 = 1; } else { DAT_00104054 = 0; DAT_00104055 = 0; options = 0; } } else if (((*param_1 & 0xf000) == 0xa000) && (cVar1 = following_links(), cVar1 != '\0')) { iVar2 = get_statinfo(param_2,param_3,param_4); if (iVar2 != 0) { return 0; } options = *(uint *)(param_4 + 0x18); *param_1 = options; DAT_00104055 = 1; } else { DAT_00104055 = 1; options = *param_1; *(uint *)(param_4 + 0x18) = options; } return 1; }
static _Bool change_attributes (char const *name, int dirfd, char const *relname) { _Bool ok = 0 ; if (! (owner_id == (uid_t) -1 && group_id == (gid_t) -1) && lchownat (dirfd, relname, owner_id, group_id) != 0) error (0, (*__errno_location ()) , gettext ("cannot change ownership of %s"), quotearg_style (shell_escape_always_quoting_style, name)); else if (chmodat (dirfd, relname, mode) != 0) error (0, (*__errno_location ()) , gettext ("cannot change permissions of %s"), quotearg_style (shell_escape_always_quoting_style, name)); else ok = 1 ; if (use_default_selinux_context) setdefaultfilecon (name); return ok; }
long change_attributes(const char *a1, unsigned int a2, long a3) { long v3; char *v4; int *v5; long v6; char *v7; int *v8; unsigned char v11; v11 = 0; if ( owner_id == -1 && group_id == -1 || !(unsigned int)lchownat(a2, a3, (unsigned int)owner_id, (unsigned int)group_id) ) { if ( (unsigned int)chmodat(a2, a3, (unsigned int)mode) ) { v6 = quotearg_style(4LL, a1); v7 = gettext("cannot change permissions of %s"); v8 = _errno_location(); error(0, *v8, v7, v6); } else { v11 = 1; } } else { v3 = quotearg_style(4LL, a1); v4 = gettext("cannot change ownership of %s"); v5 = _errno_location(); error(0, *v5, v4, v3); } if ( use_default_selinux_context ) setdefaultfilecon(a1); return v11; }
static struct nh_entry *ipnh_cache_add(__u32 nh_id) { struct nlmsghdr *answer = ((void *)0) ; struct nh_entry *nhe = ((void *)0) ; if (nh_cache_rth.fd < 0 && rtnl_open(&nh_cache_rth, 0) < 0) { nh_cache_rth.fd = -1; goto out; } if (__ipnh_get_id(&nh_cache_rth, nh_id, &answer) < 0) goto out; nhe = malloc(sizeof(*nhe)); if (!nhe) goto out; if (__ipnh_cache_parse_nlmsg(answer, nhe)) goto out_free_nhe; ipnh_cache_link_entry(nhe); out: if (answer) free(answer); return nhe; out_free_nhe: free(nhe); nhe = ((void *)0) ; goto out; }
void * ipnh_cache_add(undefined4 param_1) { int iVar1; long in_FS_OFFSET; void *local_20; void *local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_20 = (void *)0x0; local_18 = (void *)0x0; if ((nh_cache_rth._0_4_ < 0) && (iVar1 = rtnl_open(nh_cache_rth,0), iVar1 < 0)) { nh_cache_rth._0_4_ = -1; } else { iVar1 = __ipnh_get_id(nh_cache_rth,param_1,&local_20); if ((-1 < iVar1) && (local_18 = malloc(0x70), local_18 != (void *)0x0)) { iVar1 = __ipnh_cache_parse_nlmsg(local_20,local_18); if (iVar1 == 0) { ipnh_cache_link_entry(local_18); } else { free(local_18); local_18 = (void *)0x0; } } } if (local_20 != (void *)0x0) { free(local_20); } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return local_18; } __stack_chk_fail(); }
static void mp_factor_insert (struct mp_factors *factors, mpz_t prime) { unsigned long int nfactors = factors->nfactors; mpz_t *p = factors->p; unsigned long int *e = factors->e; long i; for (i = nfactors - 1; i >= 0; i--) { if ( __gmpz_cmp (p[i], prime) <= 0) break; } if (i < 0 || __gmpz_cmp (p[i], prime) != 0) { p = xrealloc (p, (nfactors + 1) * sizeof p[0]); e = xrealloc (e, (nfactors + 1) * sizeof e[0]); __gmpz_init (p[nfactors]); for (long j = nfactors - 1; j > i; j--) { __gmpz_set (p[j + 1], p[j]); e[j + 1] = e[j]; } __gmpz_set (p[i + 1], prime); e[i + 1] = 1; factors->p = p; factors->e = e; factors->nfactors = nfactors + 1; } else { e[i] += 1; } }
void mp_factor_insert(unsigned long long a0[3], unsigned long long a1) { unsigned long long *v0; unsigned long long *v1; unsigned long v2; unsigned long long v3; unsigned long long *v4; unsigned long long v6; unsigned long long v7[3]; v2 = a0[2]; v3 = a0[0]; v4 = a0[1]; for (v0 = v2 - 1; !((v0 >> 63)) && __gmpz_cmp((v0 << 4) + v3, a1, (v0 << 4) + v3) > 0; v0 = v0 + 1); if (!((v0 >> 63)) && !__gmpz_cmp((v0 << 4) + v3, a1, (v0 << 4) + v3)) { v6 = v4 + 0x8 * v0; *((v4 + 0x8 * v0)) = *((v4 + 0x8 * v0)) + 1; return; } v3 = xrealloc(v3, (v2 + 1) * 16, (v2 + 1) * 16); v4 = xrealloc(v4, (v2 + 1) * 8, (v2 + 1) * 8); __gmpz_init(v3 + v2 * 16); for (v1 = v2 - 1; v1 > v0; v1 = v1 + 1) { __gmpz_set(v3 + (v1 + 1) * 16, v1 * 16 + v3, v1 * 16 + v3, (v1 + 1) * 16); *((8 + v4 + 0x8 * v1)) = *((v4 + 0x8 * v1)); } __gmpz_set((v0 + 1) * 16 + v3, a1, (v0 + 1) * 16 + v3, (v1 + 1) * 8); *((8 + v4 + 0x8 * v0)) = 1; a0[0] = v3; a0[1] = v4; v7 = a0; a0[2] = v2 + 1; return; }
void cleanup_exit(int i) { _exit(i); }
void cleanup_exit(unsigned long a0) { _exit(a0); }
gnutls_x509_privkey_t load_x509_private_key(int mand, common_info_st * info) { gnutls_x509_privkey_t key; int ret; gnutls_datum_t dat; size_t size; unsigned int flags = 0; const char *pass; if (!info->privkey && !mand) return ((void *)0) ; if (info->privkey == ((void *)0) ) { fprintf( stderr , "missing --load-privkey\n"); app_exit(1); } ret = gnutls_x509_privkey_init(&key); if (ret < 0) { fprintf( stderr , "privkey_init: %s\n", gnutls_strerror(ret)); app_exit(1); } dat.data = (void *) _gnutls_read_file(info->privkey, 0x1, &size); dat.size = size; if (!dat.data) { fprintf( stderr , "error reading file at --load-privkey: %s\n", info->privkey); app_exit(1); } if (info->pkcs8) { pass = get_password(info, &flags, 0); ret = gnutls_x509_privkey_import_pkcs8(key, &dat, info->incert_format, pass, flags); } else { ret = gnutls_x509_privkey_import2(key, &dat, info->incert_format, ((void *)0) , 0); if (ret == -24) { pass = get_password(info, &flags, 0); ret = gnutls_x509_privkey_import2(key, &dat, info-> incert_format, pass, flags); } } free(dat.data); if (ret == -207) { fprintf( stderr , "import error: could not find a valid PEM header; " "check if your key is PEM encoded\n"); app_exit(1); } if (ret < 0) { fprintf( stderr , "error importing private key: %s: %s\n", info->privkey, gnutls_strerror(ret)); app_exit(1); } return key; }
undefined8 load_x509_private_key(int param_1,long param_2) { undefined8 uVar1; long in_FS_OFFSET; undefined4 local_48; int local_44; undefined8 local_40; undefined local_38 [8]; undefined8 local_30; void *local_28 [3]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_48 = 0; if ((*(long *)(param_2 + 8) == 0) && (param_1 == 0)) { local_40 = 0; } else { if (*(long *)(param_2 + 8) == 0) { fprintf(stderr,"missing --load-privkey\n"); app_exit(1); } local_44 = gnutls_x509_privkey_init(&local_40); if (local_44 < 0) { uVar1 = gnutls_strerror(local_44); fprintf(stderr,"privkey_init: %s\n",uVar1); app_exit(1); } local_28[0] = (void *)_gnutls_read_file(*(undefined8 *)(param_2 + 8),1,local_38); if (local_28[0] == (void *)0x0) { fprintf(stderr,"error reading file at --load-privkey: %s\n",*(undefined8 *)(param_2 + 8)); app_exit(1); } if (*(int *)(param_2 + 0x18) == 0) { local_44 = gnutls_x509_privkey_import2(local_40,local_28,*(undefined4 *)(param_2 + 0x1c),0,0); if (local_44 == -0x18) { local_30 = get_password(param_2,&local_48,0); local_44 = gnutls_x509_privkey_import2 (local_40,local_28,*(undefined4 *)(param_2 + 0x1c),local_30,local_48); } } else { local_30 = get_password(param_2,&local_48,0); local_44 = gnutls_x509_privkey_import_pkcs8 (local_40,local_28,*(undefined4 *)(param_2 + 0x1c),local_30,local_48); } free(local_28[0]); if (local_44 == -0xcf) { fprintf(stderr, "import error: could not find a valid PEM header; check if your key is PEM encoded\n") ; app_exit(1); } if (local_44 < 0) { uVar1 = gnutls_strerror(local_44); fprintf(stderr,"error importing private key: %s: %s\n",*(undefined8 *)(param_2 + 8),uVar1); app_exit(1); } } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return local_40; } __stack_chk_fail(); }
static inline __u8 rta_getattr_u8(const struct rtattr *rta) { return *(__u8 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); }
int rta_getattr_u8(struct_0 *a0) { return a0->field_4; }
static int history_def_insert(history_t *h, HistEventW *ev, const wchar_t *str) { hentry_t *c; c = malloc(sizeof(*c)); if (c == ((void *)0) ) goto oomem; if ((c->ev.str = wcsdup(str)) == ((void *)0) ) { free(c); goto oomem; } c->data = ((void *)0) ; c->ev.num = ++h->eventid; c->next = h->list.next; c->prev = &h->list; h->list.next->prev = c; h->list.next = c; h->cur++; h->cursor = c; *ev = c->ev; return 0; oomem: { ev->num = 2; ev->str = he_errlist[2]; }; return -1; }
long history_def_insert(long a1, _QWORD *a2, const wchar_t *a3) { long v3; _QWORD *ptr; ptr = malloc(0x28uLL); if ( ptr ) { ptr[1] = wcsdup(a3); if ( ptr[1] ) { ptr[2] = 0LL; *(_DWORD *)ptr = ++*(_DWORD *)(a1 + 56); ptr[3] = *(_QWORD *)(a1 + 24); ptr[4] = a1; *(_QWORD *)(*(_QWORD *)(a1 + 24) + 32LL) = ptr; *(_QWORD *)(a1 + 24) = ptr; ++*(_DWORD *)(a1 + 52); *(_QWORD *)(a1 + 40) = ptr; v3 = ptr[1]; *a2 = *ptr; a2[1] = v3; return 0LL; } free(ptr); } *(_DWORD *)a2 = 2; a2[1] = "m"; return 0xFFFFFFFFLL; }
int gzgetc_(file) gzFile file; { return gzgetc(file); }
long long gzgetc_(void* a0) { return gzgetc(a0); }
static int speed_to_baud(speed_t speed) { switch (speed) { case 0000000 : return 0; case 0000001 : return 50; case 0000002 : return 75; case 0000003 : return 110; case 0000004 : return 134; case 0000005 : return 150; case 0000006 : return 200; case 0000007 : return 300; case 0000010 : return 600; case 0000011 : return 1200; case 0000012 : return 1800; case 0000013 : return 2400; case 0000014 : return 4800; case 0000015 : return 9600; case 0000016 : return 19200; case 0000017 : return 38400; case 0010001 : return 57600; case 0010002 : return 115200; case 0010003 : return 230400; default: return 9600; } }
int speed_to_baud(unsigned long a0) { unsigned int v1; if (a0 == 4099) { v1 = 0x38400; } else { if (!(a0 <= 4099)) goto LABEL_400109; if (a0 == 4098) { v1 = 0x1c200; } else { if (!(a0 <= 4098)) goto LABEL_400109; if (a0 > 15) { if (!(a0 == 4097)) goto LABEL_400109; v1 = 0xe100; } else { switch (a0) { case 0: v1 = 0; break; case 1: v1 = 50; break; case 2: v1 = 75; break; case 3: v1 = 110; break; case 4: v1 = 134; break; case 5: v1 = 150; break; case 6: v1 = 200; break; case 7: v1 = 300; break; case 8: v1 = 600; break; case 9: v1 = 1200; break; case 10: v1 = 1800; break; case 11: v1 = 2400; break; case 12: v1 = 4800; break; case 13: v1 = 9600; break; case 14: v1 = 0x4b00; break; case 15: v1 = 0x9600; break; default: LABEL_400109: v1 = 9600; break; } } } } return v1; }
static void check_password (const struct passwd *pw, const struct spwd *sp) { time_t now; int exp_status; exp_status = isexpired (pw, sp); if (kflg && (0 == exp_status)) { exit (0); } if (amroot) { return; } (void) time (&now); if ( (sp->sp_pwdp[0] == '!') || (exp_status > 1) || ( (sp->sp_max >= 0) && (sp->sp_min > sp->sp_max))) { (void) fprintf ( stderr , gettext ("The password for %s cannot be changed.\n"), sp->sp_namp); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 4 , "password locked for '%s'", sp->sp_namp) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); closelog (); exit (1); } if (sp->sp_lstchg > 0) { time_t ok; ok = (time_t) sp->sp_lstchg * (24L*3600L); if (sp->sp_min > 0) { ok += (time_t) sp->sp_min * (24L*3600L); } if (now < ok) { (void) fprintf ( stderr , gettext ("The password for %s cannot be changed yet.\n"), pw->pw_name); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 4 , "now < minimum age for '%s'", pw->pw_name) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); closelog (); exit (1); } } }
void check_password(undefined8 *param_1,undefined8 *param_2) { undefined8 uVar1; int iVar2; char *pcVar3; long in_FS_OFFSET; long local_50; char *local_48; long local_40; char *local_38; char *local_30; char *local_28; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); iVar2 = isexpired(param_1,param_2); if ((kflg != '\0') && (iVar2 == 0)) { exit(0); } if (amroot == '\0') { time(&local_50); if (((*(char *)param_2[1] == '!') || (1 < iVar2)) || ((-1 < (long)param_2[4] && ((long)param_2[4] < (long)param_2[3])))) { uVar1 = *param_2; pcVar3 = (char *)gettext("The password for %s cannot be changed.\n"); fprintf(stderr,pcVar3,uVar1); local_28 = setlocale(6,(char *)0x0); local_48 = (char *)0x0; if (local_28 != (char *)0x0) { local_48 = strdup(local_28); } if (local_48 != (char *)0x0) { setlocale(6,"C"); } syslog(4,"password locked for \'%s\'",*param_2); if (local_48 != (char *)0x0) { setlocale(6,local_48); free(local_48); } closelog(); exit(1); } if (0 < (long)param_2[2]) { local_40 = param_2[2] * 0x15180; if (0 < (long)param_2[3]) { local_40 = local_40 + param_2[3] * 0x15180; } if (local_50 < local_40) { uVar1 = *param_1; pcVar3 = (char *)gettext("The password for %s cannot be changed yet.\n"); fprintf(stderr,pcVar3,uVar1); local_30 = setlocale(6,(char *)0x0); local_38 = (char *)0x0; if (local_30 != (char *)0x0) { local_38 = strdup(local_30); } if (local_38 != (char *)0x0) { setlocale(6,"C"); } syslog(4,"now < minimum age for \'%s\'",*param_1); if (local_38 != (char *)0x0) { setlocale(6,local_38); free(local_38); } closelog(); exit(1); } } } if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
static _Bool elide_tail_lines_seekable (char const *pretty_filename, int fd, uintmax_t n_lines, off_t start_pos, off_t size) { char buffer[ 8192 ]; size_t bytes_read; off_t pos = size; bytes_read = (pos - start_pos) % 8192 ; if (bytes_read == 0) bytes_read = 8192 ; pos -= bytes_read; if (elseek (fd, pos, 0 , pretty_filename) < 0) return 0 ; bytes_read = safe_read (fd, buffer, bytes_read); if (bytes_read == ((size_t) -1)) { error (0, (*__errno_location ()) , gettext ("error reading %s"), quotearg_style (shell_escape_always_quoting_style, pretty_filename)); return 0 ; } const _Bool all_lines = !n_lines; if (n_lines && bytes_read && buffer[bytes_read - 1] != line_end) --n_lines; while ( 1 ) { size_t n = bytes_read; while (n) { if (all_lines) n -= 1; else { char const *nl; nl = memrchr (buffer, line_end, n); if (nl == ((void *)0) ) break; n = nl - buffer; } if (n_lines-- == 0) { if (start_pos < pos) { enum Copy_fd_status err; if (elseek (fd, start_pos, 0 , pretty_filename) < 0) return 0 ; err = copy_fd (fd, pos - start_pos); if (err != COPY_FD_OK) { diagnose_copy_fd_failure (err, pretty_filename); return 0 ; } } xwrite_stdout (buffer, n + 1); return 0 <= elseek (fd, pos + n + 1, 0 , pretty_filename); } } if (pos == start_pos) { return 1 ; } pos -= 8192 ; if (elseek (fd, pos, 0 , pretty_filename) < 0) return 0 ; bytes_read = safe_read (fd, buffer, 8192 ); if (bytes_read == ((size_t) -1)) { error (0, (*__errno_location ()) , gettext ("error reading %s"), quotearg_style (shell_escape_always_quoting_style, pretty_filename)); return 0 ; } if (bytes_read == 0) return 1 ; } }
int elide_tail_lines_seekable(unsigned long long a0, unsigned long a1, unsigned long long a2, unsigned int a3, unsigned long a4) { unsigned long long v0; char v1; unsigned int v2; unsigned long long v3; unsigned int v4; char *v5; unsigned long v6; char v7; char v8; char v9; unsigned long long v10; unsigned int v12; unsigned long long v13; unsigned long long v14; v10 = *(&v10); v9 = *(&v9); v0 = a2; v4 = a4; v3 = ((v4 - a3 + (v4 - a3 >> 63 >> 51)) & 8191) - (v4 - a3 >> 63 >> 51); if (!v3) v3 = 0x2000; *(&v4) = v4 - v3; v12 = elseek(a1, *(&v4), 0x0, a0); if (v12 < 0) { v12 = 0; } else { v3 = safe_read(a1, &v8, v3, &v8); if (v3 == -1) { v13 = quotearg_style(0x4, a0); error(0x0, *(__errno_location()), gettext("error reading %s")); v12 = 0; } else { v1 = !v0; if (v0 && v3 && *((&v7 + v3)) != line_end) v0 -= 1; do { v5 = v3; while (true) { if (v5) { if (v1) { v5 += 1; } else { v6 = memrchr(&v8, line_end, v5); if (v6) v5 = v6 + -0x1 * &v8; } if (v6 || v1) { v12 = v0; v0 -= 1; if (v12) continue; if (a3 < *(&v4)) { v12 = elseek(a1, a3, 0x0, a0); if (v12 < 0) { v12 = 0; break; } else { v2 = copy_fd(a1, *(&v4) - a3); if (v2) { diagnose_copy_fd_failure(v2, a0); v12 = 0; break; } } } if (a3 >= *(&v4) || !v2 && v12 >= 0) { xwrite_stdout(&v8, (v5 + 1)); v12 = !(elseek(a1, &v5[*(&v4) + 1], 0x0, a0)) >> 63; break; } } } if (!v5 || !v6 && !v1) { if (*(&v4) == a3) { v12 = 1; break; } else { *(&v4) = *(&v4) - 0x2000; v12 = elseek(a1, *(&v4), 0x0, a0); if (v12 < 0) { v12 = 0; break; } else { v3 = safe_read(a1, &v8, 0x2000, &v8); if (v3 == -1) { v14 = quotearg_style(0x4, a0); error(0x0, *(__errno_location()), gettext("error reading %s")); v12 = 0; break; } else { if (v3) break; if (!v3) { v12 = 1; break; } } } } } } } while ((!(v3 == -1) || !(*(&v4) != a3) || !(v12 >= 0) || !(!v6) && !(!v5) || !(!v1) && !(!v5)) && (!(!v12) || !(!v2) && !(a3 >= *(&v4)) || !(a3 >= *(&v4)) && !(v12 >= 0)) && (!(a3 < *(&v4)) || !(!v12) || !(v2) || !(v12 >= 0)) && (!(a3 < *(&v4)) || !(v12 < 0) || !(!v12)) && (!(*(&v4) == a3) || !(!v6) && !(!v5) || !(!v1) && !(!v5)) && (!(!v3) || !(*(&v4) != a3) || !(v3 != -1) || !(v12 >= 0) || !(!v6) && !(!v5) || !(!v1) && !(!v5)) && (!(v12 < 0) || !(*(&v4) != a3) || !(!v6) && !(!v5) || !(!v1) && !(!v5))); } } return v12; }
static gzFile gz_open(path, fd, mode) const void *path; int fd; const char *mode; { gz_statep state; z_size_t len; int oflag; int cloexec = 0; int exclusive = 0; if (path == ((void *)0) ) return ((void *)0) ; state = (gz_statep)malloc(sizeof(gz_state)); if (state == ((void *)0) ) return ((void *)0) ; state->size = 0; state->want = 8192; state->msg = ((void *)0) ; state->mode = 0; state->level = (-1); state->strategy = 0; state->direct = 0; while (*mode) { if (*mode >= '0' && *mode <= '9') state->level = *mode - '0'; else switch (*mode) { case 'r': state->mode = 7247; break; case 'w': state->mode = 31153; break; case 'a': state->mode = 1; break; case '+': free(state); return ((void *)0) ; case 'b': break; case 'e': cloexec = 1; break; case 'x': exclusive = 1; break; case 'f': state->strategy = 1; break; case 'h': state->strategy = 2; break; case 'R': state->strategy = 3; break; case 'F': state->strategy = 4; break; case 'T': state->direct = 1; break; default: ; } mode++; } if (state->mode == 0) { free(state); return ((void *)0) ; } if (state->mode == 7247) { if (state->direct) { free(state); return ((void *)0) ; } state->direct = 1; } len = strlen((const char *)path); state->path = (char *)malloc(len + 1); if (state->path == ((void *)0) ) { free(state); return ((void *)0) ; } (void)snprintf(state->path, len + 1, "%s", (const char *)path); oflag = 0 | (cloexec ? 02000000 : 0) | (state->mode == 7247 ? 00 : ( 01 | 0100 | (exclusive ? 0200 : 0) | (state->mode == 31153 ? 01000 : 02000 ))); state->fd = fd > -1 ? fd : ( open((const char *)path, oflag, 0666)); if (state->fd == -1) { free(state->path); free(state); return ((void *)0) ; } if (state->mode == 1) { lseek64(state->fd, 0, 2 ); state->mode = 31153; } if (state->mode == 7247) { state->start = lseek64(state->fd, 0, 1 ); if (state->start == -1) state->start = 0; } gz_reset(state); return (gzFile)state; }
void * gz_open(const char *a1, int a2, char *a3) { int v4; int v5; int v6; int v7; int v8; int v10; int v11; void *ptr; size_t v13; v10 = 0; v11 = 0; if ( !a1 ) return 0LL; ptr = malloc(0xF0uLL); if ( !ptr ) return 0LL; *((_DWORD *)ptr + 10) = 0; *((_DWORD *)ptr + 11) = 0x2000; *((_QWORD *)ptr + 15) = 0LL; *((_DWORD *)ptr + 6) = 0; *((_DWORD *)ptr + 22) = -1; *((_DWORD *)ptr + 23) = 0; *((_DWORD *)ptr + 16) = 0; while ( *a3 ) { if ( *a3 <= 47 || *a3 > 57 ) { switch ( *a3 ) { case '+': goto LABEL_27; case 'F': *((_DWORD *)ptr + 23) = 4; goto LABEL_20; case 'R': *((_DWORD *)ptr + 23) = 3; goto LABEL_20; case 'T': *((_DWORD *)ptr + 16) = 1; goto LABEL_20; case 'a': *((_DWORD *)ptr + 6) = 1; goto LABEL_20; case 'e': v10 = 1; goto LABEL_20; case 'f': *((_DWORD *)ptr + 23) = 1; goto LABEL_20; case 'h': *((_DWORD *)ptr + 23) = 2; goto LABEL_20; case 'r': *((_DWORD *)ptr + 6) = 7247; goto LABEL_20; case 'w': *((_DWORD *)ptr + 6) = 31153; goto LABEL_20; case 'x': v11 = 1; goto LABEL_20; default: goto LABEL_20; } } *((_DWORD *)ptr + 22) = *a3 - 48; LABEL_20: ++a3; } if ( !*((_DWORD *)ptr + 6) ) goto LABEL_27; if ( *((_DWORD *)ptr + 6) == 7247 ) { if ( *((_DWORD *)ptr + 16) ) { LABEL_27: free(ptr); return 0LL; } *((_DWORD *)ptr + 16) = 1; } v13 = strlen(a1); *((_QWORD *)ptr + 4) = malloc(v13 + 1); if ( !*((_QWORD *)ptr + 4) ) goto LABEL_27; snprintf(*((char **)ptr + 4), v13 + 1, "%s", a1); if ( v10 ) v4 = 0x80000; else v4 = 0; if ( *((_DWORD *)ptr + 6) == 7247 ) { v7 = 0; } else { if ( v11 ) v5 = 193; else v5 = 65; if ( *((_DWORD *)ptr + 6) == 31153 ) v6 = 512; else v6 = 1024; v7 = v5 | v6; } if ( a2 >= 0 ) v8 = a2; else v8 = open(a1, v4 | v7, 438LL); *((_DWORD *)ptr + 7) = v8; if ( *((_DWORD *)ptr + 7) == -1 ) { free(*((void **)ptr + 4)); free(ptr); return 0LL; } else { if ( *((_DWORD *)ptr + 6) == 1 ) { lseek64(*((_DWORD *)ptr + 7), 0LL, 2); *((_DWORD *)ptr + 6) = 31153; } if ( *((_DWORD *)ptr + 6) == 7247 ) { *((_QWORD *)ptr + 9) = lseek64(*((_DWORD *)ptr + 7), 0LL, 1); if ( *((_QWORD *)ptr + 9) == -1LL ) *((_QWORD *)ptr + 9) = 0LL; } gz_reset((long)ptr); return ptr; } }
static void stophandler (int sig) { if (! 1 ) signal (sig, stophandler); if (! interrupt_signal) stop_signal_count++; }
long long stophandler(unsigned long a0) { unsigned int v0; unsigned long long v2; v0 = a0; v2 = interrupt_signal; if (!interrupt_signal) { v2 = stop_signal_count + 1; stop_signal_count = stop_signal_count + 1; } return v2; }
ivvip->vlan_proto != htons(0x8100)) { char b1[64]; char b2[64]; char msg[64 + sizeof(b1) + sizeof(b2)]; sprintf(msg, "Invalid \"vlan protocol\" value - supported %s, %s\n", ll_proto_n2a(htons(0x8100), b1, sizeof(b1)), ll_proto_n2a(htons(0x88A8), b2, sizeof(b2))); invarg(msg, *argv); }
uint16_t htons(uint16_t __hostshort) { halt_baddata(); }
hist_command(EditLine *el, int argc, const wchar_t **argv) { const wchar_t *str; int num; HistEventW ev; if (el->el_history.ref == ((void *)0) ) return -1; if (argc == 1 || wcscmp(argv[1], L"list") == 0) { size_t maxlen = 0; char *buf = ((void *)0) ; int hno = 1; for (str = (((el)->el_flags & 0x040) ? hist_convert(el, 4, ((void *)0) ) : ((((*(el)->el_history.fun) ((el)->el_history.ref, &(el)->el_history.ev, 4, ((void *)0) )) == -1) ? ((void *)0) : (el)->el_history.ev.str)); str != ((void *)0) ; str = (((el)->el_flags & 0x040) ? hist_convert(el, 5, ((void *)0) ) : ((((*(el)->el_history.fun) ((el)->el_history.ref, &(el)->el_history.ev, 5, ((void *)0) )) == -1) ? ((void *)0) : (el)->el_history.ev.str))) { char *ptr = ct_encode_string(str, &el->el_scratch); size_t len = strlen(ptr); if (len > 0 && ptr[len - 1] == '\n') ptr[--len] = '\0'; len = len * 4 + 1; if (len >= maxlen) { maxlen = len + 1024; char *nbuf = realloc(buf, maxlen); if (nbuf == ((void *)0) ) { free(buf); return -1; } buf = nbuf; } strvis(buf, ptr, 0x0010); (void) fprintf(el->el_outfile, "%d\t%s\n", hno++, buf); } free(buf); return 0; } if (argc != 3) return -1; num = (int)wcstol(argv[2], ((void *)0) , 0); if (wcscmp(argv[1], L"size") == 0) return history_w(el->el_history.ref, &ev, 1, num); if (wcscmp(argv[1], L"unique") == 0) return history_w(el->el_history.ref, &ev, 20, num); return -1; }
long long hist_command(struct_0 *a0, unsigned long a1, unsigned long long a2[3]) { unsigned int v0; int tmp_11; unsigned int v1; void* v2; void* v3; void* v4; char *v5; char *v6; void* v7; char v8; unsigned long long v10; unsigned long long v11; void* v12; void* v17; if (!a0->field_478) { v10 = 4294967295; } else { if (a1 != 1) { v11 = wcscmp(a2[1], "l"); if (v11) { if (a1 != 3) { v10 = 4294967295; } else { v1 = wcstol(a2[2], NULL, 0x0); if (!wcscmp(a2[1], "s")) { v10 = history_w(a0->field_478, &v8, 0x1, v1); } else if (!wcscmp(a2[1], "u")) { v10 = history_w(a0->field_478, &v8, 0x14, v1); } else { v10 = 4294967295; } } } } if (a1 == 1 || !v11) { v3 = 0; v4 = 0; v0 = 1; if ((a0->field_2c & 64)) { v12 = hist_convert(a0, 0x4, 0x0); } else if (a0->field_480(a0->field_478, &a0->padding_488, 4, 0, a0->field_480) != -1) { v12 = a0->field_490; } else { v12 = 0; } v2 = v12; while (true) { if (v2) { v6 = ct_encode_string(v2, &a0[1].padding_30[32], &a0[1].padding_30[32]); v5 = strlen(v6); if (v5 && *((v6 + v5 + 1)) == 10) { v5 += 1; *((v5 + v6)) = 0; } v5 = v5 * 4 + 1; if (v5 >= v3) { *(&v3) = v5 + 0x400; v7 = realloc(v4, *(&v3)); if (!v7) { free(v4); v10 = 4294967295; break; } else { v4 = v7; } } if (v5 < v3 || v7) { strvis(v4, v6, 0x10, v6); tmp_11 = v0; v0 += 1; fprintf(a0->field_10, "%d\t%s\n", tmp_11, v4); if ((a0->field_2c & 64)) { v17 = hist_convert(a0, 0x5, 0x0); } else if (a0->field_480(a0->field_478, &a0->padding_488, 5, 0, a0->field_480) != -1) { v17 = a0->field_490; } else { v17 = 0; } v2 = v17; } } else { free(v4); v10 = 0; break; } } } } return v10; }
int ssh_digest_buffer(int alg, const struct sshbuf *b, u_char *d, size_t dlen) { return ssh_digest_memory(alg, sshbuf_ptr(b), sshbuf_len(b), d, dlen); }
long long ssh_digest_buffer(unsigned long a0, unsigned long long a1, unsigned long long a2, unsigned int a3) { return ssh_digest_memory(a0, sshbuf_ptr(a1), sshbuf_len(a1), a2, a3); }
char *add_envopt( int *argcp, char ***argvp, char const *envvar_name) { char *p; char **oargv; char **nargv; int nargc = 0; char *env_val; env_val = getenv(envvar_name); if (env_val == ((void *)0) ) return ((void *)0) ; env_val = xstrdup (env_val); for (p = env_val; *p; nargc++ ) { p += strspn(p, " \t"); if (*p == '\0') break; p += strcspn(p, " \t"); if (*p) *p++ = '\0'; } if (nargc == 0) { free(env_val); return ((void *)0) ; } *argcp = nargc + 1; nargv = xcalloc (*argcp + 1, sizeof (char *)); oargv = *argvp; *argvp = nargv; *nargv++ = *oargv; for (p = env_val; nargc > 0; nargc--) { p += strspn(p, " \t"); *(nargv++) = p; while (*p++) ; } *nargv = ((void *)0) ; return env_val; }
long long add_envopt(unsigned int *a0, unsigned long long *a1, char *a2) { unsigned int v0; int tmp_34; int tmp_9; char *v1; unsigned long long *v2; void* v3; unsigned long long *v4; void* v6; char *v7; unsigned long long *v8; v0 = 0; v3 = getenv(a2); if (!v3) { v6 = 0; return v6; } v3 = xstrdup(v3); for (v1 = v3; *(v1) && (v1 += strspn(v1, " \t"), *(v1)); v0 += 1) { v1 = &v1[strcspn(v1, " \t")]; if (*(v1)) { v7 = v1; v1 += 1; *(v7) = 0; } } if (!v0) { free(v3); v6 = 0; return v6; } *(a0) = v0 + 1; v2 = xcalloc(*(a0) + 1, 0x8, v0 + 1); v4 = *(a1); *(a1) = v2; tmp_34 = v2; v2 += 1; *(tmp_34) = *(v4); for (v1 = v3; v0 > 0; v0 -= 1) { v1 = &v1[strspn(v1, " \t")]; v8 = v2; v2 += 1; *(v8) = v1; do { tmp_9 = v1; v1 += 1; *(&v8) = *(tmp_9); } while (v8); } *(v2) = 0; v6 = v3; return v6; }
int sl_delete(StringList *sl, const char *name, int all) { size_t i, j; for (i = 0; i < sl->sl_cur; i++) if (strcmp(sl->sl_str[i], name) == 0) { if (all) free(sl->sl_str[i]); for (j = i + 1; j < sl->sl_cur; j++) sl->sl_str[j - 1] = sl->sl_str[j]; sl->sl_str[--sl->sl_cur] = ((void *)0) ; return 0; } return -1; }
undefined8 sl_delete(long *param_1,char *param_2,int param_3) { int iVar1; ulong local_18; ulong local_10; local_18 = 0; while( true ) { if ((ulong)param_1[2] <= local_18) { return 0xffffffff; } iVar1 = strcmp(*(char **)(*param_1 + local_18 * 8),param_2); if (iVar1 == 0) break; local_18 = local_18 + 1; } local_10 = local_18; if (param_3 != 0) { free(*(void **)(*param_1 + local_18 * 8)); } while (local_10 = local_10 + 1, local_10 < (ulong)param_1[2]) { *(undefined8 *)(local_10 * 8 + -8 + *param_1) = *(undefined8 *)(*param_1 + local_10 * 8); } param_1[2] = param_1[2] + -1; *(undefined8 *)(param_1[2] * 8 + *param_1) = 0; return 0; }
static _Bool prepare_to_extract (char const *file_name, int typeflag, tar_extractor_t *fun) { tar_extractor_t extractor = ((void *)0) ; switch (typeflag) { case 'S': extractor = extract_file; break; case '\0': case '0': case '7': if (current_stat_info.had_trailing_slash) extractor = extract_dir; else extractor = extract_file; break; case '2': extractor = extract_symlink; break; case '1': extractor = extract_link; break; case '3': current_stat_info.stat.st_mode |= 0020000 ; extractor = extract_node; break; case '4': current_stat_info.stat.st_mode |= 0060000 ; extractor = extract_node; break; case '6': extractor = extract_fifo; break; case '5': case 'D': extractor = extract_dir; if (current_stat_info.is_dumpdir) delay_directory_restore_option = 1 ; break; case 'V': return 0 ; case 'M': do { if (error_hook) error_hook (); error (0, 0, gettext ("%s: Cannot extract -- file is continued from another volume"), quotearg_colon (current_stat_info.file_name)); exit_status = 2; } while (0) ; return 0 ; case 'L': case 'K': do { if (error_hook) error_hook (); error (0, 0, gettext ("Unexpected long name header")); exit_status = 2; } while (0); return 0 ; default: do { if ((warning_option & (0x00010000))) do { if (error_hook) error_hook (); error (0, 0, gettext ("%s: Unknown file type '%c', extracted as normal file"), quotearg_colon (file_name), typeflag); } while (0); } while (0) ; extractor = extract_file; } if ((to_stdout_option || to_command_option)) { if (extractor != extract_file) return 0 ; } else { switch (old_files_option) { case UNLINK_FIRST_OLD_FILES: if (!remove_any_file (file_name, recursive_unlink_option ? RECURSIVE_REMOVE_OPTION : ORDINARY_REMOVE_OPTION) && (*__errno_location ()) && (*__errno_location ()) != 2 ) { unlink_error (file_name); return 0 ; } break; case KEEP_NEWER_FILES: if (file_newer_p (file_name, 0, &current_stat_info)) { do { if ((warning_option & (0x00000800))) do { if (error_hook) error_hook (); error (0, 0, gettext ("Current %s is newer or same age"), quote (file_name)); } while (0); } while (0) ; return 0 ; } break; default: break; } } *fun = extractor; return 1 ; }
int prepare_to_extract(unsigned long long a0, unsigned long a1, unsigned long long *a2) { unsigned long long v0; int tmp_11; unsigned int v2; unsigned long long v3; unsigned long long v4; unsigned long long v5; v0 = 0; switch (a1) { case 0: case 48: case 55: if (exit_status) { v0 = extract_dir; break; } else { v0 = extract_file; break; } case 49: v0 = extract_link; break; if (!to_stdout_option && !to_command_option) { if (old_files_option == 3) { v2 = remove_any_file(a0, recursive_unlink_option); if (!v2) v2 = *(__errno_location()); } else if (old_files_option == 6 && v2) { if ((warning_option & 0x800)) { if (*(&error_hook)) *(5243024)(); v5 = quote(a0); error(0x0, 0x0, gettext("Current %s is newer or same age")); } v2 = 0; } if (old_files_option == 6) v2 = file_newer_p(a0, 0x0, &current_stat_info); } if ((to_command_option || to_stdout_option) && v0 != extract_file) v2 = 0; if (false) { v2 = *(__errno_location()); unlink_error(a0); v2 = 0; } if (v0 == extract_file && to_command_option || v0 == extract_file && to_stdout_option || !to_command_option && old_files_option == 3 && !to_stdout_option || !to_command_option && !v2 && !to_stdout_option || !to_command_option && !to_stdout_option && old_files_option != 6) { *(a2) = v0; v2 = 1; } case 50: v0 = extract_symlink; break; case 51: v2 = remove_any_file; *(&v2) = (remove_any_file >> 8) | 32; tmp_11 = v2; remove_any_file = tmp_11; v0 = extract_node; break; case 52: v2 = remove_any_file; *(&v2) = (remove_any_file >> 8) | 96; tmp_11 = v2; remove_any_file = tmp_11; v0 = extract_node; break; case 53: case 68: v0 = extract_dir; if (symlink_error) delay_directory_restore_option = 1; break; case 54: v0 = extract_fifo; break; case 75: case 76: if (*(&error_hook)) *(5243024)(); error(0x0, 0x0, gettext("Unexpected long name header")); exit_status = 2; v2 = 0; case 77: if (*(&error_hook)) *(5243024)(); v3 = quotearg_colon(quotearg_colon); error(0x0, 0x0, gettext("%s: Cannot extract -- file is continued from another volume")); exit_status = 2; v2 = 0; case 83: v0 = extract_file; break; case 86: v2 = 0; default: if ((warning_option & 0x10000)) { if (*(&error_hook)) *(5243024)(); v4 = quotearg_colon(a0); error(0x0, 0x0, gettext("%s: Unknown file type '%c', extracted as normal file")); } v0 = extract_file; break; } return v2; }
static errcode_t e2fsck_journal_sb_csum_set(journal_t *j, journal_superblock_t *jsb) { __u32 crc; if (!jbd2_journal_has_csum_v2or3(j)) return 0; crc = e2fsck_journal_sb_csum(jsb); jsb->s_checksum = (( __be32)ext2fs_swab32((__u32)(crc))); return 0; }
void e2fsck_journal_sb_csum_set(void* a0, struct_0 *a1, unsigned int a2, unsigned long long a3) { unsigned int v0; void* v2; void* v3; if (!jbd2_journal_has_csum_v2or3(a0)) { v2 = 0; return; } v0 = e2fsck_journal_sb_csum(a1, a1, a2, a3); a1->field_fc = ext2fs_swab32(v0); v3 = 0; return; }
int gzclose_w(file) gzFile file; { int ret = 0; gz_statep state; if (file == ((void *)0) ) return (-2); state = (gz_statep)file; if (state->mode != 31153) return (-2); if (state->seek) { state->seek = 0; if (gz_zero(state, state->skip) == -1) ret = state->err; } if (gz_comp(state, 4) == -1) ret = state->err; if (state->size) { if (!state->direct) { (void)deflateEnd(&(state->strm)); free(state->out); } free(state->in); } gz_error(state, 0, ((void *)0) ); free(state->path); if (close(state->fd) == -1) ret = (-1); free(state); return ret; }
long long gzclose_w(struct_0 *a0) { unsigned int v0; unsigned long long v2; v0 = 0; if (!a0) { v2 = 4294967294; } else if (a0->field_18 != 31153) { v2 = 4294967294; } else { if (a0->field_70) { a0->field_70 = 0; if (gz_zero(a0, a0->field_68) == -1) v0 = a0->field_74; } if (gz_comp(a0, 0x4) == -1) v0 = a0->field_74; if (a0->field_28) { if (!a0->field_40) { deflateEnd(&a0[153722867280912929].padding_0[8]); free(a0->field_38); } free(a0->field_30); } gz_error(a0, 0x0, 0x0); free(a0->field_20); if (close(a0->field_1c) == -1) v0 = -1; free(a0); v2 = v0; } return v2; }
static _Bool looks_like_integer (char const *cp) { cp += (*cp == '-'); do if (! ((unsigned int) (*cp) - '0' <= 9)) return 0 ; while (*++cp); return 1 ; }
int looks_like_integer(unsigned long a0) { char *v0; unsigned int v2; v0 = a0; v0 = &v0[*(v0) == 45]; do { if (*(v0) - 48 > 9) { v2 = 0; goto LABEL_400d7b; } v0 += 1; } while (*(v0)); v2 = 1; LABEL_400d7b: return v2; }
static _Bool parse_noop (const struct parser_table* entry, char **argv, int *arg_ptr) { (void) entry; return parse_true (get_noop (), argv, arg_ptr); }
long parse_noop() { long noop; noop = get_noop(); return parse_true(noop); }
static void close_files (void) { if (gr_close () == 0) { fprintf ( stderr , gettext ("%s: failure while writing changes to %s\n"), Prog, gr_dbname ()); exit (10); } do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 6 , "group changed in %s (%s)", gr_dbname (), info_group.action) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; del_cleanup (cleanup_report_mod_group); cleanup_unlock_group ( ((void *)0) ); del_cleanup (cleanup_unlock_group); if ( is_shadow_grp && (pflg || nflg)) { if (sgr_close () == 0) { fprintf ( stderr , gettext ("%s: failure while writing changes to %s\n"), Prog, sgr_dbname ()); exit (10); } do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 6 , "group changed in %s (%s)", sgr_dbname (), info_gshadow.action) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; del_cleanup (cleanup_report_mod_gshadow); cleanup_unlock_gshadow ( ((void *)0) ); del_cleanup (cleanup_unlock_gshadow); } if (gflg) { if (pw_close () == 0) { fprintf ( stderr , gettext ("%s: failure while writing changes to %s\n"), Prog, pw_dbname ()); exit (10); } do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 6 , "group changed in %s (%s)", pw_dbname (), info_passwd.action) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; del_cleanup (cleanup_report_mod_passwd); cleanup_unlock_passwd ( ((void *)0) ); del_cleanup (cleanup_unlock_passwd); } }
long long close_files() { void* v0; void* v1; void* v2; char *v3; char *v4; char *v5; unsigned long long v7; unsigned long long v8; unsigned long long v9; unsigned long long v10; if (!gr_close()) { v7 = gr_dbname(); fprintf(*(&stderr), gettext("%s: failure while writing changes to %s\n")); exit(0xa); } v3 = setlocale(0x6, NULL); v0 = 0; if (v3) v0 = strdup(v3); if (v0) setlocale(0x6, "C"); gr_dbname(); syslog(0x6, "group changed in %s (%s)"); if (v0) { setlocale(0x6, v0); free(v0); } del_cleanup(got.cleanup_report_mod_group); cleanup_unlock_group(0); del_cleanup(got.cleanup_unlock_group); if (is_shadow_grp && (pflg || nflg)) { if (sgr_close()) { v4 = setlocale(0x6, NULL); v1 = 0; if (v4) v1 = strdup(v4); if (v1) setlocale(0x6, "C"); sgr_dbname(); syslog(0x6, "group changed in %s (%s)"); if (v1) { setlocale(0x6, v1); free(v1); } del_cleanup(got.cleanup_report_mod_gshadow); cleanup_unlock_gshadow(0); del_cleanup(got.cleanup_unlock_gshadow); } else { v8 = sgr_dbname(); fprintf(*(&stderr), gettext("%s: failure while writing changes to %s\n")); exit(0xa); } } v9 = gflg; if (!gflg) { return v9; } else if (pw_close()) { v5 = setlocale(0x6, NULL); v2 = 0; if (v5) v2 = strdup(v5); if (v2) setlocale(0x6, "C"); pw_dbname(); syslog(0x6, "group changed in %s (%s)"); if (v2) { setlocale(0x6, v2); free(v2); } del_cleanup(got.cleanup_report_mod_passwd); cleanup_unlock_passwd(0); v9 = del_cleanup(got.cleanup_unlock_passwd); return v9; } else { v10 = pw_dbname(); fprintf(*(&stderr), gettext("%s: failure while writing changes to %s\n")); exit(0xa); } }
static enum found_status found_forced_on(enum dependtry dependtry_forced) { if (dependtry >= dependtry_forced) return FOUND_FORCED; else return FOUND_DEFER; }
undefined8 found_forced_on(uint param_1) { undefined8 uVar1; if (dependtry < param_1) { uVar1 = 1; } else { uVar1 = 2; } return uVar1; }
static void restore_lastcom (x) char *x; { do { if (the_printed_command_except_trap) sh_xfree((the_printed_command_except_trap), "evalstring.c", 83); } while (0); the_printed_command_except_trap = x; }
void restore_lastcom(undefined8 param_1) { if (the_printed_command_except_trap != 0) { sh_xfree(the_printed_command_except_trap,"evalstring.c",0x53); } the_printed_command_except_trap = param_1; return; }
static void digest_word_file (char const *file_name, WORD_TABLE *table) { BLOCK file_contents; char *cursor; char *word_start; swallow_file_in_memory (file_name, &file_contents); table->start = ((void *)0) ; table->alloc = 0; table->length = 0; cursor = file_contents.start; while (cursor < file_contents.end) { word_start = cursor; while (cursor < file_contents.end && *cursor != '\n') cursor++; if (cursor > word_start) { if (table->length == table->alloc) table->start = x2nrealloc (table->start, &table->alloc, sizeof *table->start); table->start[table->length].start = word_start; table->start[table->length].size = cursor - word_start; table->length++; } if (cursor < file_contents.end) cursor++; } qsort (table->start, table->length, sizeof table->start[0], compare_words); }
void digest_word_file(char *a0, unsigned long long a1[3]) { unsigned long long v0; unsigned long long v1; char v2; char v3; char v4; unsigned long long *v6; unsigned long long v7; swallow_file_in_memory(a0, &v2); a1[0] = 0; a1[1] = 0; a1[2] = 0; v0 = *(&v2); while (true) { if (v0 < *(&v3)) { for (v1 = v0; v0 < *(&v3) && *(v0) != 10; v0 += 1); if (v0 > v1) { if (a1[2] == a1[1]) a1[0] = x2nrealloc(a1[0], &a1[1], 0x10, &a1[1]); *((a1[0] + a1[2] * 16)) = v1; *((a1[0] + a1[2] * 16 + 8)) = v0 - v1; a1[2] = a1[2] + 1; } if (v0 < *(&v3)) v0 += 1; } else { qsort(a1[0], a1[2], 0x10, compare_words); v7 = *(&v4) ^ v6[5]; return; } } }
int disown_builtin (list) WORD_LIST *list; { int opt, job, retval, nohup_only, running_jobs, all_jobs; sigset_t set, oset; intmax_t pid_value; nohup_only = running_jobs = all_jobs = 0; reset_internal_getopt (); while ((opt = internal_getopt (list, "ahr")) != -1) { switch (opt) { case 'a': all_jobs = 1; break; case 'h': nohup_only = 1; break; case 'r': running_jobs = 1; break; case -99: builtin_help (); return (258); default: builtin_usage (); return (258); } } list = loptend; retval = 0; if (list == 0 && (all_jobs || running_jobs)) { if (nohup_only) nohup_all_jobs (running_jobs); else delete_all_jobs (running_jobs); return (0); } do { do { sigemptyset (&set); sigaddset (&set, 17 ); sigemptyset (&oset); sigprocmask ( 0 , &set, &oset); } while (0); job = (list && legal_number (list->word->word, &pid_value) && pid_value == (pid_t) pid_value) ? get_job_by_pid ((pid_t) pid_value, 0, 0) : get_job_spec (list); if (job == -1 || jobs == 0 || ((job) < 0 || (job) >= js.j_jobslots || (jobs[(job)]) == 0)) { sh_badjob (list ? list->word->word : gettext("current")); retval = 1; } else if (nohup_only) nohup_job (job); else delete_job (job, 1); sigprocmask ( 2 , &oset, (sigset_t *) ((void *)0) ); if (list) list = list->next; } while (list); return (retval); }
long long disown_builtin(unsigned long long a0) { struct_0 *v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; char v7; char v8; char v9; unsigned long long v11; unsigned long long v12; unsigned long long v13; v0 = a0; v4 = 0; v3 = v4; v2 = v3; reset_internal_getopt(); while (true) { v5 = internal_getopt(v0, "ahr"); if (v5 == -1) { v0 = loptend; v1 = 0; if (v0) { do { LABEL_400615: sigemptyset(&v8); sigaddset(&v8, 0x11); sigemptyset(&v9); sigprocmask(0x0, &v8, &v9); if (v0 && legal_number(v0->field_8->field_0, &v7, &v7)) { v12 = get_job_by_pid(*(&v7), 0x0, 0x0); goto LABEL_4006cf; } v12 = get_job_spec(v0); LABEL_4006cf: v6 = v12; if (v6 == -1) { LABEL_400720: if (v0) v13 = v0->field_8->field_0; else v13 = gettext("current"); sh_badjob(v13); v1 = 1; continue; } else { if (!jobs) goto LABEL_400720; if (v6 < 0) goto LABEL_400720; if (!(v6 < g_5000ac)) goto LABEL_400720; if (!*((jobs + (v6 << 3)))) goto LABEL_400720; if (!v2) delete_job(v6, 0x1); else nohup_job(v6); } sigprocmask(0x2, &v9, NULL); if (v0) v0 = v0->field_0; } while (v0); v11 = v1; break; } else { if (!v4 && !v3) goto LABEL_400615; if (v2) nohup_all_jobs(v3); else delete_all_jobs(v3); v11 = 0; break; } } if (v5 == 114) { v3 = 1; continue; } if (v5 > 114) { LABEL_40057a: builtin_usage(); v11 = 258; break; } else { if (v5 == 104) { v2 = 1; continue; } if (!(v5 <= 104)) goto LABEL_40057a; if (v5 == -99) { builtin_help(); v11 = 258; break; } if (!(v5 == 97)) goto LABEL_40057a; v4 = 1; } } return v11; }
static void lwtunnel_print_erspan_opts(struct rtattr *attr) { struct rtattr *tb[(__LWTUNNEL_IP_OPT_ERSPAN_MAX - 1) + 1]; struct rtattr *i = ((void*)(((char*)(attr)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); char *name = "erspan_opts"; __u8 ver, hwid, dir; __u32 idx; parse_rtattr(tb, (__LWTUNNEL_IP_OPT_ERSPAN_MAX - 1), i, ((int)((attr)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); ver = rta_getattr_u8(tb[LWTUNNEL_IP_OPT_ERSPAN_VER]); if (ver == 1) { idx = rta_getattr_be32(tb[LWTUNNEL_IP_OPT_ERSPAN_INDEX]); dir = 0; hwid = 0; } else { idx = 0; dir = rta_getattr_u8(tb[LWTUNNEL_IP_OPT_ERSPAN_DIR]); hwid = rta_getattr_u8(tb[LWTUNNEL_IP_OPT_ERSPAN_HWID]); } print_nl(); print_string(PRINT_FP, name, "\t%s ", name); open_json_array(PRINT_JSON, name); open_json_object( ((void *)0) ); print_uint(PRINT_ANY, "ver", "%u", ver); print_uint(PRINT_ANY, "index", ":%u", idx); print_uint(PRINT_ANY, "dir", ":%u", dir); print_uint(PRINT_ANY, "hwid", ":%u ", hwid); close_json_object(); close_json_array(PRINT_JSON, name); }
void lwtunnel_print_erspan_opts(unsigned short *a0, unsigned long a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { char v0; char v1; char v2; unsigned int v3; unsigned long long v4; unsigned long long v5; char v6; char v7; char v8; char v9; char v10; char v11; unsigned long long *v13; unsigned long long v14; v4 = a0 + 2; v5 = "erspan_opts"; parse_rtattr(&v6, 0x4, v4, *(a0) - 4); v2 = rta_getattr_u8(*(&v7)); if (v2 == 1) { v3 = rta_getattr_be32(*(&v8)); v1 = 0; v0 = 0; } else { v3 = 0; v1 = rta_getattr_u8(*(&v9)); v0 = rta_getattr_u8(*(&v10)); } print_nl(); print_string(0x1, v5, "\t%s ", v5); open_json_array(0x2, v5); open_json_object(0x0); print_uint(0x4, "ver", "%u", v2); print_uint(0x4, "index", ":%u", v3); print_uint(0x4, "dir", ":%u", v1); print_uint(0x4, "hwid", ":%u ", v0); close_json_object(0x4, "hwid", ":%u ", a3, a4, a5); close_json_array(0x2, v5); v14 = *(&v11) ^ v13[5]; return; }
int sshkey_cert_check_authority_now(const struct sshkey *k, int want_host, int require_principal, int wildcard_pattern, const char *name, const char **reason) { time_t now; if ((now = time( ((void *)0) )) < 0) { *reason = "Certificate invalid: not yet valid"; return -25; } return sshkey_cert_check_authority(k, want_host, require_principal, wildcard_pattern, (uint64_t)now, name, reason); }
int sshkey_cert_check_authority_now(void* a0, unsigned long a1, unsigned long a2, unsigned long a3, char *a4, unsigned long long *a5) { unsigned int v0; unsigned int v2; *(&v0) = time(NULL); if ((*(&v0) - 0 >> 63)) { *(a5) = "Certificate invalid: not yet valid"; v2 = -25; return v2; } v2 = sshkey_cert_check_authority(a0, a1, a2, a3, *(&v0), a4, a5); return v2; }
int ipstats_print(struct nlmsghdr *n, void *arg) { struct ipstats_stat_enabled_one one = { .desc = &ipstats_stat_desc_offload_hw_s_info, }; struct ipstats_stat_enabled enabled = { .enabled = &one, .nenabled = 1, }; FILE *fp = arg; int rc; rc = ipstats_process_ifsm(n, &enabled); if (rc) return rc; fflush(fp); return 0; }
int ipstats_print(undefined8 param_1,FILE *param_2) { int iVar1; long in_FS_OFFSET; undefined1 **local_48; undefined8 local_40; undefined1 *local_38; undefined8 local_30; undefined8 local_28; undefined8 local_20; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_30 = 0; local_28 = 0; local_20 = 0; local_38 = ipstats_stat_desc_offload_hw_s_info; local_48 = &local_38; local_40 = 1; iVar1 = ipstats_process_ifsm(param_1,&local_48); if (iVar1 == 0) { fflush(param_2); iVar1 = 0; } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return iVar1; } __stack_chk_fail(); }
static inline intmax_t simple_round_from_zero (long double val) { return val < 0 ? simple_round_floor (val) : simple_round_ceiling (val); }
int simple_round_from_zero(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5, unsigned long v2, unsigned long a6) { unsigned long v0; unsigned long v1; unsigned long long v3; [D] t3 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t7) if ([D] GetI(968:I8x8)[t9,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] PutI(904:F64x8)[t0,0] = t3 [D] PutI(968:I8x8)[t0,0] = 0x01 [D] PutI(968:I8x8)[t16,0] = 0x00 [D] PutI(904:F64x8)[t30,0] = t31 [D] PutI(968:I8x8)[t30,0] = 0x01 [D] PutI(968:I8x8)[t30,0] = 0x00 if ((((BinaryOp CmpF & 69) | ((BinaryOp CmpF & 69) >> 6)) & 1) == 1) { v1 = a6; v0 = v2; v3 = simple_round_ceiling(); } else { v1 = a6; v0 = v2; v3 = simple_round_floor(); } return v3; }
static int channel_cancel_lport_listener_tcpip(struct ssh *ssh, const char *lhost, u_short lport, int cport, struct ForwardOptions *fwd_opts) { u_int i; int found = 0; const char *addr = channel_fwd_bind_addr(ssh, lhost, ((void *)0) , 1, fwd_opts); for (i = 0; i < ssh->chanctxt->channels_alloc; i++) { Channel *c = ssh->chanctxt->channels[i]; if (c == ((void *)0) || c->type != 2) continue; if (c->listening_port != lport) continue; if (cport == -1) { if (c->host_port == 0) continue; } else { if (c->host_port != cport) continue; } if ((c->listening_addr == ((void *)0) && addr != ((void *)0) ) || (c->listening_addr != ((void *)0) && addr == ((void *)0) )) continue; if (addr == ((void *)0) || strcmp(c->listening_addr, addr) == 0) { sshlog("channels.c", __func__, 3897, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "close channel %d", i); channel_free(ssh, c); found = 1; } } return found; }
undefined4 channel_cancel_lport_listener_tcpip (long param_1,undefined8 param_2,ushort param_3,int param_4,undefined8 param_5) { int *piVar1; int iVar2; char *__s2; uint local_20; undefined4 local_1c; local_1c = 0; __s2 = (char *)channel_fwd_bind_addr(param_1,param_2,0,1,param_5); local_20 = 0; do { if (*(uint *)(*(long *)(param_1 + 0x868) + 8) <= local_20) { return local_1c; } piVar1 = *(int **)(**(long **)(param_1 + 0x868) + (ulong)local_20 * 8); if (((piVar1 != (int *)0x0) && (*piVar1 == 2)) && (piVar1[0x22] == (uint)param_3)) { if (param_4 == -1) { if (piVar1[0x26] != 0) { LAB_0010d206: if ((((*(long *)(piVar1 + 0x24) != 0) || (__s2 == (char *)0x0)) && ((*(long *)(piVar1 + 0x24) == 0 || (__s2 != (char *)0x0)))) && ((__s2 == (char *)0x0 || (iVar2 = strcmp(*(char **)(piVar1 + 0x24),__s2), iVar2 == 0))) ) { sshlog("channels.c","channel_cancel_lport_listener_tcpip",0xf39,1,6,0,"close channel %d" ,local_20); channel_free(param_1,piVar1); local_1c = 1; } } } else if (param_4 == piVar1[0x26]) goto LAB_0010d206; } local_20 = local_20 + 1; } while( true ); }
static char * gid_to_str (gid_t gid) { char buf[((((((sizeof (intmax_t) * 8) - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) + 1)]; return xstrdup ((! ((gid_t) 0 < (gid_t) -1)) ? imaxtostr (gid, buf) : umaxtostr (gid, buf)); }
int gid_to_str(unsigned long a0) { char v0; return xstrdup(umaxtostr(a0, &v0, &v0)); }
static _Bool parse_daystart (const struct parser_table* entry, char **argv, int *arg_ptr) { struct tm *local; (void) entry; (void) argv; (void) arg_ptr; if (options.full_days == 0 ) { options.cur_day_start.tv_sec += 86400; options.cur_day_start.tv_nsec = 0; local = localtime (&options.cur_day_start.tv_sec); options.cur_day_start.tv_sec -= (local ? (local->tm_sec + local->tm_min * 60 + local->tm_hour * 3600) : options.cur_day_start.tv_sec % 86400); options.full_days = 1 ; } return 1 ; }
long long parse_daystart(unsigned long a0, unsigned long a1, unsigned long a2) { unsigned long v0; unsigned long v1; unsigned long v2; unsigned int v3[3]; unsigned long long v5; v2 = a0; v1 = a1; v0 = a2; if ((got.pred_delete ^ 1)) { getfileconat = getfileconat + 86400; pred_delete = 0; *(&v3[0]) = localtime(getfileconat); if (v3) v5 = v3[2] * 3600 + v3[0] + v3[1] * 60; else v5 = getfileconat - ((getfileconat * 1749024623285053783 >> 64 >> 13) - (getfileconat >> 63)) * 86400; getfileconat = getfileconat - v5; got.pred_delete = 1; } return 1; }
void print_word_list (list, separator) WORD_LIST *list; char *separator; { _print_word_list (list, separator, xprintf); }
void print_word_list(undefined8 param_1,undefined8 param_2) { _print_word_list(param_1,param_2,xprintf); return; }
static void close_startup_pipes(void) { int i; if (startup_pipes) for (i = 0; i < options.max_startups; i++) if (startup_pipes[i] != -1) close(startup_pipes[i]); }
long close_startup_pipes() { long result; int i; result = startup_pipes; if ( startup_pipes ) { for ( i = 0; ; ++i ) { result = (unsigned int)options[1910]; if ( i >= (int)result ) break; if ( *(_DWORD *)(4LL * i + startup_pipes) != -1 ) close(*(_DWORD *)(4LL * i + startup_pipes)); } } return result; }
void shtimer_dispose (sh_timer *t) { sh_xfree((t), "timers.c", 94); }
void shtimer_dispose(unsigned long long a0) { unsigned long long v1; v1 = sh_xfree(a0, "timers.c", 0x5e); return; }
void usage (int status) { if (status != 0 ) do { fprintf ( stderr , gettext ("Try '%s --help' for more information.\n"), program_name); } while (0); else { printf (gettext ("Usage: %s [OPTION]... [NUMBER]...\n") , program_name); fputs_unlocked (gettext ("Reformat NUMBER(s), or the numbers from standard input if none are specified.\n"), stdout ) ; emit_mandatory_arg_note (); fputs_unlocked (gettext (" --debug print warnings about invalid input\n"), stdout ) ; fputs_unlocked (gettext (" -d, --delimiter=X use X instead of whitespace for field delimiter\n"), stdout ) ; fputs_unlocked (gettext (" --field=FIELDS replace the numbers in these input fields (default=1);\n see FIELDS below\n"), stdout ) ; fputs_unlocked (gettext (" --format=FORMAT use printf style floating-point FORMAT;\n see FORMAT below for details\n"), stdout ) ; fputs_unlocked (gettext (" --from=UNIT auto-scale input numbers to UNITs; default is 'none';\n see UNIT below\n"), stdout ) ; fputs_unlocked (gettext (" --from-unit=N specify the input unit size (instead of the default 1)\n"), stdout ) ; fputs_unlocked (gettext (" --grouping use locale-defined grouping of digits, e.g. 1,000,000\n (which means it has no effect in the C/POSIX locale)\n"), stdout ) ; fputs_unlocked (gettext (" --header[=N] print (without converting) the first N header lines;\n N defaults to 1 if not specified\n"), stdout ) ; fputs_unlocked (gettext (" --invalid=MODE failure mode for invalid numbers: MODE can be:\n abort (default), fail, warn, ignore\n"), stdout ) ; fputs_unlocked (gettext (" --padding=N pad the output to N characters; positive N will\n right-align; negative N will left-align;\n padding is ignored if the output is wider than N;\n the default is to automatically pad if a whitespace\n is found\n"), stdout ) ; fputs_unlocked (gettext (" --round=METHOD use METHOD for rounding when scaling; METHOD can be:\n up, down, from-zero (default), towards-zero, nearest\n"), stdout ) ; fputs_unlocked (gettext (" --suffix=SUFFIX add SUFFIX to output numbers, and accept optional\n SUFFIX in input numbers\n"), stdout ) ; fputs_unlocked (gettext (" --to=UNIT auto-scale output numbers to UNITs; see UNIT below\n"), stdout ) ; fputs_unlocked (gettext (" --to-unit=N the output unit size (instead of the default 1)\n"), stdout ) ; fputs_unlocked (gettext (" -z, --zero-terminated line delimiter is NUL, not newline\n"), stdout ) ; fputs_unlocked (gettext (" --help display this help and exit\n"), stdout ); fputs_unlocked (gettext (" --version output version information and exit\n"), stdout ); fputs_unlocked (gettext ("\nUNIT options:\n"), stdout ) ; fputs_unlocked (gettext (" none no auto-scaling is done; suffixes will trigger an error\n"), stdout ) ; fputs_unlocked (gettext (" auto accept optional single/two letter suffix:\n 1K = 1000,\n 1Ki = 1024,\n 1M = 1000000,\n 1Mi = 1048576,\n"), stdout ) ; fputs_unlocked (gettext (" si accept optional single letter suffix:\n 1K = 1000,\n 1M = 1000000,\n ...\n"), stdout ) ; fputs_unlocked (gettext (" iec accept optional single letter suffix:\n 1K = 1024,\n 1M = 1048576,\n ...\n"), stdout ) ; fputs_unlocked (gettext (" iec-i accept optional two-letter suffix:\n 1Ki = 1024,\n 1Mi = 1048576,\n ...\n"), stdout ) ; fputs_unlocked (gettext ("\nFIELDS supports cut(1) style field ranges:\n N N'th field, counted from 1\n N- from N'th field, to end of line\n N-M from N'th to M'th field (inclusive)\n -M from first to M'th field (inclusive)\n - all fields\nMultiple fields/ranges can be separated with commas\n"), stdout ) ; fputs_unlocked (gettext ("\nFORMAT must be suitable for printing one floating-point argument '%f'.\nOptional quote (%'f) will enable --grouping (if supported by current locale).\nOptional width value (%10f) will pad output. Optional zero (%010f) width\nwill zero pad the number. Optional negative values (%-10f) will left align.\nOptional precision (%.1f) will override the input determined precision.\n"), stdout ) ; printf (gettext ("\nExit status is 0 if all input numbers were successfully converted.\nBy default, %s will stop at the first conversion error with exit status 2.\nWith --invalid='fail' a warning is printed for each conversion error\nand the exit status is 2. With --invalid='warn' each conversion error is\ndiagnosed, but the exit status is 0. With --invalid='ignore' conversion\nerrors are not diagnosed and the exit status is 0.\n") , program_name); printf (gettext ("\nExamples:\n $ %s --to=si 1000\n -> \"1.0K\"\n $ %s --to=iec 2048\n -> \"2.0K\"\n $ %s --to=iec-i 4096\n -> \"4.0Ki\"\n $ echo 1K | %s --from=si\n -> \"1000\"\n $ echo 1K | %s --from=iec\n -> \"1024\"\n $ df -B1 | %s --header --field 2-4 --to=si\n $ ls -l | %s --header --field 5 --to=iec\n $ ls -lh | %s --header --field 5 --from=iec --padding=10\n $ ls -lh | %s --header --field 5 --from=iec --format %%10f\n") , program_name, program_name, program_name, program_name, program_name, program_name, program_name, program_name, program_name); emit_ancillary_info ("numfmt"); } exit (status); }
void usage(unsigned long a0) { unsigned long v0; unsigned long v1; unsigned long v2; unsigned long v3; unsigned long v4; unsigned long v5; unsigned long v6; void* v7; unsigned long v8; unsigned long v9; unsigned long v10; unsigned long v11; unsigned long v12; unsigned long v14; unsigned long v15; unsigned long v16; unsigned long v17; unsigned long v18; v12 = v14; v11 = v15; v10 = v16; v9 = v17; v8 = v18; if (a0) { fprintf(stderr, gettext("Try '%s --help' for more information.\n")); } else { printf(gettext("Usage: %s [OPTION]... [NUMBER]...\n")); fputs_unlocked(gettext("Reformat NUMBER(s), or the numbers from standard input if none are specified.\n"), stdout); emit_mandatory_arg_note(); fputs_unlocked(gettext(" --debug print warnings about invalid input\n"), stdout); fputs_unlocked(gettext(" -d, --delimiter=X use X instead of whitespace for field delimiter\n"), stdout); fputs_unlocked(gettext(" --field=FIELDS replace the numbers in these input fields (default=1);\n see FIELDS below\n"), stdout); fputs_unlocked(gettext(" --format=FORMAT use printf style floating-point FORMAT;\n see FORMAT below for details\n"), stdout); fputs_unlocked(gettext(" --from=UNIT auto-scale input numbers to UNITs; default is 'none';\n see UNIT below\n"), stdout); fputs_unlocked(gettext(" --from-unit=N specify the input unit size (instead of the default 1)\n"), stdout); fputs_unlocked(gettext(" --grouping use locale-defined grouping of digits, e.g. 1,000,000\n (which means it has no effect in the C/POSIX locale)\n"), stdout); fputs_unlocked(gettext(" --header[=N] print (without converting) the first N header lines;\n N defaults to 1 if not specified\n"), stdout); fputs_unlocked(gettext(" --invalid=MODE failure mode for invalid numbers: MODE can be:\n abort (default), fail, warn, ignore\n"), stdout); fputs_unlocked(gettext(" --padding=N pad the output to N characters; positive N will\n right-align; negative N will left-align;\n padding is ignored if the output is wider than N;\n the default is to automatically pad if a whitespace\n is found\n"), stdout); fputs_unlocked(gettext(" --round=METHOD use METHOD for rounding when scaling; METHOD can be:\n up, down, from-zero (default), towards-zero, nearest\n"), stdout); fputs_unlocked(gettext(" --suffix=SUFFIX add SUFFIX to output numbers, and accept optional\n SUFFIX in input numbers\n"), stdout); fputs_unlocked(gettext(" --to=UNIT auto-scale output numbers to UNITs; see UNIT below\n"), stdout); fputs_unlocked(gettext(" --to-unit=N the output unit size (instead of the default 1)\n"), stdout); fputs_unlocked(gettext(" -z, --zero-terminated line delimiter is NUL, not newline\n"), stdout); fputs_unlocked(gettext(" --help display this help and exit\n"), stdout); fputs_unlocked(gettext(" --version output version information and exit\n"), stdout); fputs_unlocked(gettext("\nUNIT options:\n"), stdout); fputs_unlocked(gettext(" none no auto-scaling is done; suffixes will trigger an error\n"), stdout); fputs_unlocked(gettext(" auto accept optional single/two letter suffix:\n 1K = 1000,\n 1Ki = 1024,\n 1M = 1000000,\n 1Mi = 1048576,\n"), stdout); fputs_unlocked(gettext(" si accept optional single letter suffix:\n 1K = 1000,\n 1M = 1000000,\n ...\n"), stdout); fputs_unlocked(gettext(" iec accept optional single letter suffix:\n 1K = 1024,\n 1M = 1048576,\n ...\n"), stdout); fputs_unlocked(gettext(" iec-i accept optional two-letter suffix:\n 1Ki = 1024,\n 1Mi = 1048576,\n ...\n"), stdout); fputs_unlocked(gettext("\nFIELDS supports cut(1) style field ranges:\n N N'th field, counted from 1\n N- from N'th field, to end of line\n N-M from N'th to M'th field (inclusive)\n -M from first to M'th field (inclusive)\n - all fields\nMultiple fields/ranges can be separated with commas\n"), stdout); fputs_unlocked(gettext("\nFORMAT must be suitable for printing one floating-point argument '%f'.\nOptional quote (%'f) will enable --grouping (if supported by current locale).\nOptional width value (%10f) will pad output. Optional zero (%010f) width\nwill zero pad the number. Optional negative values (%-10f) will left align.\nOptional precision (%.1f) will override the input determined precision.\n"), stdout); printf(gettext("\nExit status is 0 if all input numbers were successfully converted.\nBy default, %s will stop at the first conversion error with exit status 2.\nWith --invalid='fail' a warning is printed for each conversion error\nand the exit status is 2. With --invalid='warn' each conversion error is\ndiagnosed, but the exit status is 0. With --invalid='ignore' conversion\nerrors are not diagnosed and the exit status is 0.\n")); v7 = program_name; v6 = program_name; v5 = program_name; v4 = program_name; v3 = v7; v2 = v6; v1 = program_name; v0 = program_name; printf(gettext("\nExamples:\n $ %s --to=si 1000\n -> \"1.0K\"\n $ %s --to=iec 2048\n -> \"2.0K\"\n $ %s --to=iec-i 4096\n -> \"4.0Ki\"\n $ echo 1K | %s --from=si\n -> \"1000\"\n $ echo 1K | %s --from=iec\n -> \"1024\"\n $ df -B1 | %s --header --field 2-4 --to=si\n $ ls -l | %s --header --field 5 --to=iec\n $ ls -lh | %s --header --field 5 --from=iec --padding=10\n $ ls -lh | %s --header --field 5 --from=iec --format %%10f\n")); emit_ancillary_info("numfmt"); } exit(a0); }
static rsRetVal initTCP(wrkrInstanceData_t *pWrkrData) { instanceData *pData; rsRetVal iRet = RS_RET_OK; pData = pWrkrData->pData; if(pData->protocol == 1) { if((iRet = tcpclt.Construct(&pWrkrData->pTCPClt)) != RS_RET_OK) goto finalize_it; if((iRet = tcpclt.SetResendLastOnRecon(pWrkrData->pTCPClt, pData->bResendLastOnRecon)) != RS_RET_OK) goto finalize_it; if((iRet = tcpclt.SetSendInit(pWrkrData->pTCPClt, TCPSendInit)) != RS_RET_OK) goto finalize_it; if((iRet = tcpclt.SetSendFrame(pWrkrData->pTCPClt, TCPSendFrame)) != RS_RET_OK) goto finalize_it; if((iRet = tcpclt.SetSendPrepRetry(pWrkrData->pTCPClt, TCPSendPrepRetry)) != RS_RET_OK) goto finalize_it; if((iRet = tcpclt.SetFraming(pWrkrData->pTCPClt, pData->tcp_framing)) != RS_RET_OK) goto finalize_it; if((iRet = tcpclt.SetFramingDelimiter(pWrkrData->pTCPClt, pData->tcp_framingDelimiter)) != RS_RET_OK) goto finalize_it; if((iRet = tcpclt.SetRebindInterval(pWrkrData->pTCPClt, pData->iRebindInterval)) != RS_RET_OK) goto finalize_it; } finalize_it: return iRet; }
int initTCP(unsigned long long a0[7]) { unsigned int v0; struct_0 *v1; v0 = 0; v1 = a0[0]; if (v1->field_78 != 1) return v0; v0 = *(4217448)(&a0[6]); if (v0) return v0; v0 = g_405a90(a0[6], v1->field_c8, v1->field_c8, g_405a90); if (v0) return v0; v0 = g_405a98(a0[6], TCPSendInit, g_405a98); if (v0) return v0; v0 = g_405aa0(a0[6], TCPSendFrame, g_405aa0); if (v0) return v0; v0 = g_405aa8(a0[6], TCPSendPrepRetry, g_405aa8); if (v0) return v0; v0 = g_405ab0(a0[6], v1->field_c0, v1->field_c0, g_405ab0); if (v0) return v0; v0 = g_405ac0(a0[6], v1->field_c4, v1->field_c4, g_405ac0); if (!v0) { v0 = g_405ab8(a0[6], v1->field_8c, v1->field_8c, g_405ab8); return v0; } return v0; }
(dup2(pair[1], 1 ) == -1)) { sshlog("ssh-sk-client.c", __func__, 89, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "dup2: %s", strerror( (*__errno_location ()) )); _exit(1); }
int dup2(int __fd,int __fd2) { halt_baddata(); }
void pkcs7_sign(common_info_st * cinfo, unsigned embed) { gnutls_pkcs7_t pkcs7; gnutls_privkey_t key; int ret; size_t size; gnutls_datum_t data; unsigned flags = 0; gnutls_x509_crt_t *crts; size_t crt_size; size_t i; if (certtool_options.enabled.p7_time) flags |= GNUTLS_PKCS7_INCLUDE_TIME; if (certtool_options.enabled.p7_include_cert) flags |= GNUTLS_PKCS7_INCLUDE_CERT; ret = gnutls_pkcs7_init(&pkcs7); if (ret < 0) { fprintf( stderr , "p7_init: %s\n", gnutls_strerror(ret)); app_exit(1); } data.data = (void *) _gnutls_fread_file(infile, 0, &size); data.size = size; if (!data.data) { fprintf( stderr , "%s", infile ? "file" : "standard input"); app_exit(1); } crts = load_cert_list(1, &crt_size, cinfo); key = load_private_key(1, cinfo); if (embed) flags |= GNUTLS_PKCS7_EMBED_DATA; ret = gnutls_pkcs7_sign(pkcs7, *crts, key, &data, ((void *)0) , ((void *)0) , get_dig(*crts, cinfo), flags); if (ret < 0) { fprintf( stderr , "Error signing: %s\n", gnutls_strerror(ret)); app_exit(1); } for (i=1;i<crt_size;i++) { ret = gnutls_pkcs7_set_crt(pkcs7, crts[i]); if (ret < 0) { fprintf( stderr , "Error adding cert: %s\n", gnutls_strerror(ret)); exit(1); } } size = lbuffer_size; ret = gnutls_pkcs7_export(pkcs7, outcert_format, lbuffer, &size); if (ret < 0) { fprintf( stderr , "pkcs7_export: %s\n", gnutls_strerror(ret)); app_exit(1); } fwrite(lbuffer, 1, size, outfile); gnutls_privkey_deinit(key); for (i=0;i<crt_size;i++) { gnutls_x509_crt_deinit(crts[i]); } gnutls_free((void *) (crts)), crts= ((void *)0) ; gnutls_pkcs7_deinit(pkcs7); app_exit(0); }
void pkcs7_sign(unsigned long long a0, unsigned long a1) { unsigned long v0; unsigned int v1; unsigned int v2; char v3; char v4; char v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long v9; unsigned int v10; unsigned long v11; unsigned long long *v13; unsigned int v14; v11 = v13[5]; v1 = 0; if (g_5001ec) v1 |= 2; if (g_5001eb) v1 |= 4; v2 = gnutls_pkcs7_init(&v3); if (v2 < 0) { fprintf(*(&stderr), "p7_init: %s\n", gnutls_strerror(v2)); app_exit(0x1); } v9 = _gnutls_fread_file(infile, 0x0, &v4); v10 = *(&v4); if (!v9) { if (!infile) v14 = &g_40b4c4; else v14 = "file"; fprintf(*(&stderr), "%s", v14); app_exit(0x1); } else { v7 = load_cert_list(0x1, &v5, a0); v8 = load_private_key(0x1, a0); if (a1) v1 |= 1; v0 = v1; v2 = gnutls_pkcs7_sign(*(&v3), *(v7), v8, &v9, 0x0, 0x0, get_dig(*(v7), a0)); if (v2 < 0) { fprintf(*(&stderr), "Error signing: %s\n", gnutls_strerror(v2)); app_exit(0x1); } for (v6 = 1; v6 < *(&v5); v6 += 1) { v2 = gnutls_pkcs7_set_crt(*(&v3), *((v7 + v6 * 8)), *((v7 + v6 * 8))); if (v2 < 0) { fprintf(*(&stderr), "Error adding cert: %s\n", gnutls_strerror(v2)); exit(0x1); } } *(&v4) = lbuffer_size; v2 = gnutls_pkcs7_export(*(&v3), outcert_format, lbuffer, &v4); if (v2 < 0) { fprintf(*(&stderr), "pkcs7_export: %s\n", gnutls_strerror(v2)); app_exit(0x1); } fwrite(lbuffer, 0x1, *(&v4), outfile); gnutls_privkey_deinit(v8); for (v6 = 0; v6 < *(&v5); v6 += 1) { gnutls_x509_crt_deinit(*((v7 + v6 * 8))); } *(5243720)(v7); v7 = 0; gnutls_pkcs7_deinit(*(&v3)); app_exit(0x0); } }
void channel_clear_permission(struct ssh *ssh, int who, int where) { struct permission **permp; u_int *npermp; permission_set_get_array(ssh, who, where, &permp, &npermp); *permp = xrecallocarray(*permp, *npermp, 0, sizeof(**permp)); *npermp = 0; }
void channel_clear_permission(undefined8 param_1,undefined4 param_2,undefined4 param_3) { undefined8 uVar1; long in_FS_OFFSET; undefined8 *local_30; undefined4 *local_28; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); permission_set_get_array(param_1,param_2,param_3,&local_30,&local_28); uVar1 = xrecallocarray(*local_30,*local_28,0,0x30); *local_30 = uVar1; *local_28 = 0; if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
void read_crq_set(gnutls_x509_crq_t crq, const char *input_str, const char *oid) { ssize_t ret; char *lineptr = ((void *)0) ; size_t linesize = 0; fputs(input_str, stderr ); ret = getline(&lineptr, &linesize, stdin ); if (ret == -1) return; if (((lineptr[0] == '\n') || (lineptr[0] == '\r'))) { free(lineptr); return; } linesize = strip_nl(lineptr, ret); ret = gnutls_x509_crq_set_dn_by_oid(crq, oid, 0, lineptr, linesize); if (ret < 0) { fprintf( stderr , "set_dn: %s\n", gnutls_strerror(ret)); exit(1); } free(lineptr); }
unsigned long read_crq_set(long a1, const char *a2, long a3) { const char *v3; char *lineptr; size_t n; long v8; unsigned long v9; v9 = __readfsqword(0x28u); lineptr = 0LL; n = 0LL; fputs(a2, stderr); v8 = getline(&lineptr, &n, stdin); if ( v8 != -1 ) { if ( *lineptr != 10 && *lineptr != 13 ) { n = strip_nl((long)lineptr, v8); v8 = (int)gnutls_x509_crq_set_dn_by_oid(a1, a3, 0LL, lineptr, (unsigned int)n); if ( v8 < 0 ) { v3 = (const char *)gnutls_strerror((unsigned int)v8); fprintf(stderr, "set_dn: %s\n", v3); exit(1); } } free(lineptr); } return __readfsqword(0x28u) ^ v9; }
static int compose_extension(struct sshbuf *msg, const char *name, const char *ver) { int r; const struct sftp_handler *exthnd; if ((exthnd = extended_handler_byname(name)) == ((void *)0) ) sshfatal("sftp-server.c", __func__, 696, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "internal error: no handler for %s", name); if (!request_permitted(exthnd)) { sshlog("sftp-server.c", __func__, 698, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "refusing to advertise disallowed extension %s", name); return 0; } if ((r = sshbuf_put_cstring(msg, name)) != 0 || (r = sshbuf_put_cstring(msg, ver)) != 0) sshfatal("sftp-server.c", __func__, 703, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose %s", name); return 0; }
void compose_extension(unsigned long long a0, char *a1, unsigned long long a2) { unsigned long long v0; unsigned long v1; unsigned int v2; unsigned long long v3; unsigned long v4; char v5; void* v7; void* v8; v3 = extended_handler_byname(a1); if (!v3) { v1 = a1; v0 = "internal error: no handler for %s"; sshfatal("sftp-server.c", "compose_extension", 0x2b8, 0x1, 0x1, 0x0); } if (!request_permitted(v3)) { v4 = a1; v3 = "refusing to advertise disallowed extension %s"; sshlog("sftp-server.c", "compose_extension", 0x2ba, 0x1, 0x6, 0x0, *(&v5)); v7 = 0; } else { v2 = sshbuf_put_cstring(a0, a1, a1); if (!v2) { v2 = sshbuf_put_cstring(a0, a2, a2); if (!v2) goto LABEL_401ba7; } v4 = a1; v3 = "compose %s"; sshfatal("sftp-server.c", "compose_extension", 0x2bf, 0x1, 0x1, ssh_err(v2)); LABEL_401ba7: v8 = 0; } return; }
strcmp(*argv, "remote") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (peer_len) duparg("peer", *argv); get_prefix(&peer, *argv, req.ifa.ifa_family); peer_len = peer.bytelen; if (req.ifa.ifa_family == 0 ) req.ifa.ifa_family = peer.family; addattr_l(&req.n, sizeof(req), IFA_ADDRESS, &peer.data, peer.bytelen); req.ifa.ifa_prefixlen = peer.bitlen; } else if (matches(*argv, "broadcast") == 0 ||
int strcmp(char *__s1,char *__s2) { halt_baddata(); }
void * xreallocarray (void *p, size_t n, size_t s) { void *r = reallocarray (p, n, s); if (!r && (!p || (n && s))) xalloc_die (); return r; }
long xreallocarray(long param_1,long param_2,long param_3) { long lVar1; lVar1 = reallocarray(param_1,param_2,param_3); if ((lVar1 == 0) && ((param_1 == 0 || ((param_2 != 0 && (param_3 != 0)))))) { xalloc_die(); } return lVar1; }
static void process_signals (void) { while (interrupt_signal || stop_signal_count) { int sig; int stops; sigset_t oldset; set_color_context (RESET_CONTEXT); fflush_unlocked ( stdout ); sigprocmask ( 0 , &caught_signals, &oldset); sig = interrupt_signal; stops = stop_signal_count; if (stops) { stop_signal_count = stops - 1; sig = 19 ; } else signal (sig, ((__sighandler_t) 0) ); raise (sig); sigprocmask ( 2 , &oldset, ((void *)0) ); } }
void process_signals() { unsigned int v0; unsigned int v1; char v2; char v3; unsigned long long *v5; unsigned long long v6; while (true) { if (!interrupt_signal) { if (!stop_signal_count) break; } set_color_context(0x3); fflush_unlocked(stdout); sigprocmask(0x0, &caught_signals, &v2); v0 = interrupt_signal; v1 = stop_signal_count; if (v1) { stop_signal_count = v1 - 1; v0 = 19; } else { signal(v0, 0x0); } raise(v0); sigprocmask(0x2, &v2, NULL); } v6 = *(&v3) ^ v5[5]; return; }
void usage (FILE *out, int status) { const char str[] = "systemkey-tool - GnuTLS system key tool\n" "Usage: systemkey-tool [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \n" "\n" "None:\n" "\n" " -d, --debug=num Enable debugging\n" " - it must be in the range:\n" " 0 to 9999\n" " --outfile=str Output file\n" " --list Lists all stored keys\n" " --delete=str Delete the key identified by the given URL\n" " --outder Use DER format for output keys\n" "\n" "Version, usage and configuration options:\n" "\n" " -v, --version[=arg] output version information and exit\n" " -h, --help display extended usage information and exit\n" " -!, --more-help extended usage information passed thru pager\n" "\n" "Options are specified by doubled hyphens and their name or by a single\n" "hyphen and the flag character.\n" "\n" "Program that allows handling user keys as stored in the system in a uniform way.\n" "\n" "Please send bug reports to: <bugs@gnutls.org>\n" "\n"; fprintf (out, "%s", str); exit (status); }
void usage(void* a0, unsigned long a1) { unsigned int v0; void* v1; unsigned long v2; unsigned long v3; unsigned long long *v5; unsigned long long v6; unsigned long long v7; unsigned long v8; struct_0 *v9; v1 = a0; v0 = a1; v3 = v5[5]; v6 = 116; v9 = &v2; for (v7 = "systemkey-tool - GnuTLS system key tool\nUsage: systemkey-tool [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \n\nNone:\n\n -d, --debug=num Enable debugging\n\t\t\t\t- it must be in the range:\n\t\t\t\t 0 to 9999\n --outfile=str Output file\n --list Lists all stored keys\n --delete=str Delete the key identified by the given URL\n --outder Use DER format for output keys\n\nVersion, usage and configuration options:\n\n -v, --version[=arg] output version information and exit\n -h, --help display extended usage information and exit\n -!, --more-help extended usage information passed thru pager\n\nOptions are specified by doubled hyphens and their name or by a single\nhyphen and the flag character.\n\nProgram that allows handling user keys as stored in the system in a uniform way.\n\nPlease send bug reports to: <bugs@gnutls.org>\n\n"; v6; v7 += v8 * 8) { v6 -= 1; v2 = *(v7); v9 = v9 + 8 * v8; } *(&v9->field_0) = *(v7); v9->field_4 = *((v7 + 4)); fprintf(v1, "%s", &v2); exit(v0); }
static void parsefname(void) { union node *n = redirnode; if (n->type == 23) checkkwd = 0x8; if (readtoken() != 12) synexpect(-1); if (n->type == 23) { struct heredoc *here = heredoc; struct heredoc *p; if (quoteflag == 0) n->type = 24; ; _rmescapes((wordtext), 0); here->eofmark = wordtext; here->next = ((void *)0) ; if (heredoclist == ((void *)0) ) heredoclist = here; else { for (p = heredoclist ; p->next ; p = p->next); p->next = here; } } else if (n->type == 21 || n->type == 22) { fixredir(n, wordtext, 0); } else { n->nfile.fname = makename(); } }
void parsefname(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned long long v0; unsigned long long v1; unsigned long long v2; unsigned long long v5; unsigned long long v6; unsigned long long v7; v1 = -556885833387505336; if (*(v1) == 23) quoteflag = 8; if (readtoken(a0, a1, a2, a3, a4, a5) != 12) synexpect(0xffffffff); if (*(v1) == 23) { v2 = -556885833387505336; if (false) *(v1) = 24; _rmescapes(0xf8458b48f87d8948, 0x0); *((v2 + 16)) = -556885833387505336; *(v2) = 0; if (false) { v6 = v2; heredoc = v2; } else { for (v0 = -556885833387505336; *(v0); v0 = *(v0)); v7 = v0; *(v0) = v2; } } else if (*(v1) == 21) { LABEL_4010cc: v5 = fixredir(v1, 0xf8458b48f87d8948, 0x0); } else { if (*(v1) == 22) goto LABEL_4010cc; *((v1 + 24)) = makename(); } return; }
static void print_problem(FILE *f, problem_t code, int answer, int fixed, struct e2fsck_problem *ptr, struct problem_context *pctx) { if (ptr->flags & 0x400000) { fprintf(f, "<header code=\"0x%06x\"/>\n", code); return; } fprintf(f, "<problem code=\"0x%06x\" answer=\"%d\"", code, answer); if (pctx->errcode) fprintf(f, " errcode=\"%lu\"", pctx->errcode); if (fixed) fputs(" fixed=\"1\"", f); if (pctx->ino) fprintf(f, " ino=\"%u\"", pctx->ino); if (pctx->ino2) fprintf(f, " ino2=\"%u\"", pctx->ino2); if (pctx->dir) fprintf(f, " dir=\"%u\"", pctx->dir); if (pctx->blk) fprintf(f, " blk=\"%llu\"", (unsigned long long) pctx->blk); if (pctx->blk2) fprintf(f, " blk2=\"%llu\"", (unsigned long long) pctx->blk2); if (pctx->blkcount != (e2_blkcnt_t) -1) fprintf(f, " blkcount=\"%lld\"", (unsigned long long) pctx->blkcount); if (pctx->group != (dgrp_t) -1) fprintf(f, " group=\"%u\"", pctx->group); if (pctx->csum1) fprintf(f, " csum1=\"%u\"", pctx->csum1); if (pctx->csum2) fprintf(f, " csum2=\"%u\"", pctx->csum2); if (pctx->num) fprintf(f, " num=\"%llu\"", (unsigned long long) pctx->num); if (pctx->num2) fprintf(f, " num2=\"%llu\"", (unsigned long long) pctx->num2); if (pctx->str) fprintf(f, " str=\"%s\"", pctx->str); fputs("/>\n", f); }
void print_problem(void* a0, unsigned long a1, unsigned long a2, unsigned long a3, struct_1 *a4, struct_0 *a5) { unsigned long long v1; unsigned long long v2; if ((a4->field_14 & find_problem)) { v1 = fprintf(a0, "<header code=\"0x%06x\"/>\n", a1); return; } fprintf(a0, "<problem code=\"0x%06x\" answer=\"%d\"", a1, a2); if (a5->field_0) fprintf(a0, " errcode=\"%lu\"", a5->field_0); if (a3) fputs(" fixed=\"1\"", a0); if (a5->field_8) fprintf(a0, " ino=\"%u\"", a5->field_8); if (a5->field_c) fprintf(a0, " ino2=\"%u\"", a5->field_c); if (a5->field_10) fprintf(a0, " dir=\"%u\"", a5->field_10); if (a5->field_28) fprintf(a0, " blk=\"%llu\"", a5->field_28); if (a5->field_30) fprintf(a0, " blk2=\"%llu\"", a5->field_30); if (a5->field_38 != -1) fprintf(a0, " blkcount=\"%lld\"", a5->field_38); if (a5->field_40 != -1) fprintf(a0, " group=\"%u\"", a5->field_40); if (a5->field_44) fprintf(a0, " csum1=\"%u\"", a5->field_44); if (a5->field_48) fprintf(a0, " csum2=\"%u\"", a5->field_48); if (a5->field_50) fprintf(a0, " num=\"%llu\"", a5->field_50); if (a5->field_58) fprintf(a0, " num2=\"%llu\"", a5->field_58); if (a5->field_60) fprintf(a0, " str=\"%s\"", a5->field_60); v2 = fputs("/>\n", a0); return; }
int do_rename(struct sftp_conn *conn, const char *oldpath, const char *newpath, int force_legacy) { struct sshbuf *msg; u_int status, id; int r, use_ext = (conn->exts & 0x00000001) && !force_legacy; if ((msg = sshbuf_new()) == ((void *)0) ) sshfatal("sftp-client.c", __func__, 1216, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); id = conn->msg_id++; if (use_ext) { sshlog("sftp-client.c", __func__, 1221, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "Sending SSH2_FXP_EXTENDED(posix-rename@openssh.com) " "\"%s\" to \"%s\"", oldpath, newpath) ; if ((r = sshbuf_put_u8(msg, 200)) != 0 || (r = sshbuf_put_u32(msg, id)) != 0 || (r = sshbuf_put_cstring(msg, "posix-rename@openssh.com")) != 0) sshfatal("sftp-client.c", __func__, 1227, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose posix-rename"); } else { sshlog("sftp-client.c", __func__, 1229, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "Sending SSH2_FXP_RENAME \"%s\" to \"%s\"", oldpath, newpath) ; if ((r = sshbuf_put_u8(msg, 18)) != 0 || (r = sshbuf_put_u32(msg, id)) != 0) sshfatal("sftp-client.c", __func__, 1233, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose rename"); } if ((r = sshbuf_put_cstring(msg, oldpath)) != 0 || (r = sshbuf_put_cstring(msg, newpath)) != 0) sshfatal("sftp-client.c", __func__, 1237, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose paths"); send_msg(conn, msg); sshlog("sftp-client.c", __func__, 1239, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "Sent message %s \"%s\" -> \"%s\"", use_ext ? "posix-rename@openssh.com" : "SSH2_FXP_RENAME", oldpath, newpath) ; sshbuf_free(msg); status = get_status(conn, id); if (status != 0) sshlog("sftp-client.c", __func__, 1246, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "remote rename \"%s\" to \"%s\": %s", oldpath, newpath, fx2txt(status)) ; return status == 0 ? 0 : -1; }
long long do_rename(unsigned int a0[8], unsigned long long a1, unsigned long long a2, unsigned long a3) { unsigned int v0; unsigned int v1; unsigned long v2; unsigned int v3; unsigned long long v4; unsigned long v5; char v6; unsigned int v8; unsigned int v9; unsigned long long v11; unsigned long long v12; if ((a0[7] & 1) && !a3) v8 = 1; if (!(a0[7] & 1) || a3) v8 = 0; v1 = v8; v4 = sshbuf_new(); if (!v4) sshfatal("sftp-client.c", "do_rename", 0x4c0, 0x1, 0x1, 0x0, "sshbuf_new failed"); v9 = a0[6]; a0[6] = a0[6] + 1; v2 = v9; if (v1) { v4 = a2; v2 = a1; v0 = "Sending SSH2_FXP_EXTENDED(posix-rename@openssh.com) \"%s\" to \"%s\""; sshlog("sftp-client.c", "do_rename", 0x4c5, 0x0, 0x6, 0x0, *(&v6)); v0 = sshbuf_put_u8(v4, 0xc8, 0x4c5); if (!v0) { v0 = sshbuf_put_u32(v4, v2, v2); if (!v0) v0 = sshbuf_put_cstring(v4, "posix-rename@openssh.com"); } if (v0 || v0 || v0) { v4 = "compose posix-rename"; sshfatal("sftp-client.c", "do_rename", 0x4cb, 0x1, 0x1, ssh_err(v0), *(&v6)); } } if (!v1 || v0 || v0 || v0) { v4 = a2; v2 = a1; v0 = "Sending SSH2_FXP_RENAME \"%s\" to \"%s\""; sshlog("sftp-client.c", "do_rename", 0x4cd, 0x0, 0x6, 0x0, *(&v6)); v0 = sshbuf_put_u8(v4, 0x12, 0x4cd); if (!v0) v0 = sshbuf_put_u32(v4, v2, v2); if (v0 || v0) { v4 = "compose rename"; sshfatal("sftp-client.c", "do_rename", 0x4d1, 0x1, 0x1, ssh_err(v0), *(&v6)); } } v0 = sshbuf_put_cstring(v4, a1); if (!v0) v0 = sshbuf_put_cstring(v4, a2); if (v0 || v0) { v4 = "compose paths"; sshfatal("sftp-client.c", "do_rename", 0x4d5, 0x1, 0x1, ssh_err(v0), *(&v6)); } send_msg(a0, v4); if (v1) v11 = "posix-rename@openssh.com"; else v11 = "SSH2_FXP_RENAME"; v5 = a2; v4 = a1; v2 = v11; v0 = "Sent message %s \"%s\" -> \"%s\""; sshlog("sftp-client.c", "do_rename", 0x4d7, 0x0, 0x7, 0x0, *(&v6)); sshbuf_free(v4); v3 = get_status(a0, v2); if (v3) { v5 = fx2txt(v3); v4 = a2; v2 = a1; v0 = "remote rename \"%s\" to \"%s\": %s"; sshlog("sftp-client.c", "do_rename", 0x4de, 0x0, 0x2, 0x0, *(&v6)); } if (!*((&v2 + 4))) v12 = 0; else v12 = 4294967295; return v12; }
"process_archive conffile '%s' in package %s - conff ? not '%s'", newconff->namenode->name, pkg_name(otherpkg, pnaw_always), searchconff->name); if (searchconff) { debug(dbg_conff, "process_archive conffile '%s' package=%s %s hash=%s", newconff->namenode->name, pkg_name(otherpkg, pnaw_always), otherpkg == pkg ? "same" : "different!", searchconff->hash); if (otherpkg == pkg) break; }
local_230 = (undefined8 *)*local_230) { uVar6 = pkg_name(param_1,3); debug(0x80,"%s: removing conffile \'%s\' for %s?","pkg_remove_old_files", *(undefined8 *)(local_230[1] + 8),uVar6); if ((*(uint *)(local_230[1] + 0x30) & 0x400) != 0) { pkg_remove_conffile_on_upgrade(param_1,local_230[1]); } }
int mm_bsdauth_query(void *ctx, char **name, char **infotxt, u_int *numprompts, char ***prompts, u_int **echo_on) { struct sshbuf *m; u_int success; char *challenge; int r; sshlog("monitor_wrap.c", __func__, 830, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "entering"); if ((m = sshbuf_new()) == ((void *)0) ) sshfatal("monitor_wrap.c", __func__, 833, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_BSDAUTHQUERY, m); mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_BSDAUTHQUERY, m); if ((r = sshbuf_get_u32(m, &success)) != 0) sshfatal("monitor_wrap.c", __func__, 839, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse success"); if (success == 0) { sshlog("monitor_wrap.c", __func__, 841, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "no challenge"); sshbuf_free(m); return (-1); } if ((r = sshbuf_get_cstring(m, &challenge, ((void *)0) )) != 0) sshfatal("monitor_wrap.c", __func__, 848, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse challenge"); sshbuf_free(m); mm_chall_setup(name, infotxt, numprompts, prompts, echo_on); (*prompts)[0] = challenge; sshlog("monitor_wrap.c", __func__, 854, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "received challenge: %s", challenge); return (0); }
long mm_bsdauth_query(long a1, _QWORD *a2, _QWORD *a3, _DWORD *a4, _QWORD *a5, _QWORD *a6) { long v6; long v8; int v13; unsigned int u32; const char *v15; long v16; unsigned long v17; v17 = __readfsqword(0x28u); sshlog("monitor_wrap.c", "mm_bsdauth_query", 830LL, 1LL, 7LL, 0LL, "entering"); v16 = sshbuf_new(); if ( !v16 ) sshfatal("monitor_wrap.c", "mm_bsdauth_query", 833LL, 1LL, 1LL, 0LL, "sshbuf_new failed"); mm_request_send(*pmonitor, 0xEu, v16); mm_request_receive_expect(*pmonitor, 0xFu, v16); u32 = sshbuf_get_u32(v16, &v13); if ( u32 ) { v6 = ssh_err(u32); sshfatal("monitor_wrap.c", "mm_bsdauth_query", 839LL, 1LL, 1LL, v6, "parse success"); } if ( v13 ) { u32 = sshbuf_get_cstring(v16, &v15, 0LL); if ( u32 ) { v8 = ssh_err(u32); sshfatal("monitor_wrap.c", "mm_bsdauth_query", 848LL, 1LL, 1LL, v8, "parse challenge"); } sshbuf_free(v16); mm_chall_setup(a2, a3, a4, a5, a6); *(_QWORD *)*a5 = v15; sshlog("monitor_wrap.c", "mm_bsdauth_query", 854LL, 1LL, 7LL, 0LL, "received challenge: %s", v15); return 0LL; } else { sshlog("monitor_wrap.c", "mm_bsdauth_query", 841LL, 1LL, 7LL, 0LL, "no challenge"); sshbuf_free(v16); return 0xFFFFFFFFLL; } }
void mark_buffer_uptodate(struct buffer_head *bh, int val) { bh->b_uptodate = val; }
long mark_buffer_uptodate(long a1, char a2) { long result; result = (2 * (a2 & 1)) | *(_BYTE *)(a1 + 24) & 0xFDu; *(_BYTE *)(a1 + 24) = (2 * (a2 & 1)) | *(_BYTE *)(a1 + 24) & 0xFD; return result; }
void flushall(void) { flushout(&output); }
long long flushall() { return flushout(&output); }
static void unconsumed_option_push (struct name_elt *elt) { elt->next = ((void *)0) ; elt->prev = unconsumed_option_tail; if (unconsumed_option_tail) unconsumed_option_tail->next = elt; unconsumed_option_tail = elt; }
long long unconsumed_option_push(unsigned long long a0[2]) { a0[0] = 0; a0[1] = &g_466e058d48ec7d89[0]; g_466e058d48ec7d89[0] = a0; gnu_list_name[0] = a0; return a0; }
int tarfileread(struct tar_archive *tar, char *buf, int len) { struct tarcontext *tc = (struct tarcontext *)tar->ctx; int r; r = fd_read(tc->backendpipe, buf, len); if (r < 0) ohshite(gettext("error reading from dpkg-deb pipe")); return r; }
long long tarfileread(struct_0 *a0, unsigned long long a1, unsigned long a2) { unsigned int v0; unsigned int *v1; v1 = a0->field_20; v0 = fd_read(*(v1), a1, a2, a1); if (v0 < 0) ohshite(gettext("error reading from dpkg-deb pipe")); return v0; }
static int depmod_load_modules(struct depmod *depmod) { struct mod **itr, **itr_end; log_printf( 7 , "load symbols (%zd modules)\n", depmod->modules.count); itr = (struct mod **)depmod->modules.array; itr_end = itr + depmod->modules.count; for (; itr < itr_end; itr++) { struct mod *mod = *itr; struct kmod_list *l, *list = ((void *)0) ; int err = kmod_module_get_symbols(mod->kmod, &list); if (err < 0) { if (err == - 2 ) log_printf( 7 , "ignoring %s: no symbols\n", mod->path); else log_printf( 3 , "failed to load symbols from %s: %s\n", mod->path, strerror(-err)) ; goto load_info; } for (l = ((list) == ((void *)0) ) ? ((void *)0) : (list); l != ((void *)0) ; l = (l->node.next == &((list)->node)) ? ((void *)0) : ((struct kmod_list *) ((char *)(l->node.next) - __builtin_offsetof ( struct kmod_list , node ) ) - ((typeof(*(l->node.next)) *)0 != (typeof(((struct kmod_list *)0)->node) *)0))) { const char *name = kmod_module_symbol_get_symbol(l); uint64_t crc = kmod_module_symbol_get_crc(l); depmod_symbol_add(depmod, name, 0 , crc, mod); } kmod_module_symbols_free_list(list); load_info: kmod_module_get_info(mod->kmod, &mod->info_list); kmod_module_get_dependency_symbols(mod->kmod, &mod->dep_sym_list); kmod_module_unref(mod->kmod); mod->kmod = ((void *)0) ; } log_printf( 7 , "loaded symbols (%zd modules, %u symbols)\n", depmod->modules.count, hash_get_count(depmod->symbols)) ; return 0; }
int depmod_load_modules(unsigned long long a0[9], unsigned long a1, unsigned long a2, unsigned long long a3, unsigned long long a4) { unsigned int v0; void* v1; unsigned long long *v2; void* v3; unsigned long v4; unsigned long long v5[2]; void* v6; unsigned int v7; void* v9; log_printf(0x7, "load symbols (%zd modules)\n", a0[3], a3, a4); v2 = a0[2]; for (v4 = &v2[a0[3]]; v2 < v4; v2 += 1) { v5[0] = *(v2); v1 = 0; v0 = kmod_module_get_symbols(v5[0], &v1, &v1); if (v0 >= 0) { for (v3 = v1; v3; v3 = v9) { v6 = kmod_module_symbol_get_symbol(v3); *(&v7) = kmod_module_symbol_get_crc(v3); depmod_symbol_add(a0, v6, 0x0, *(&v7), v5); if (*(v3) != v1) v9 = *(v3); else v9 = 0; } kmod_module_symbols_free_list(v1); } else if (v0 == -2) { log_printf(0x7, "ignoring %s: no symbols\n", v5[1], a3, v5); } else { log_printf(0x3, "failed to load symbols from %s: %s\n", v5[1], strerror(-(v0)), v5); } kmod_module_get_info(v5[0], v5 + 2, v5 + 2); kmod_module_get_dependency_symbols(v5[0], &v5[2 + 1], &v5[2 + 1]); kmod_module_unref(v5[0]); v5[0] = 0; } log_printf(0x7, "loaded symbols (%zd modules, %u symbols)\n", a0[3], hash_get_count(a0[8]), v5); return 0; }
static _Bool ignore_depends_possi(struct deppossi *possi) { struct deppossi_pkg_iterator *possi_iter; struct pkginfo *pkg; possi_iter = deppossi_pkg_iter_new(possi, wpb_installed); while ((pkg = deppossi_pkg_iter_next(possi_iter))) { if (ignore_depends(pkg)) { deppossi_pkg_iter_free(possi_iter); return 1 ; } } deppossi_pkg_iter_free(possi_iter); return 0 ; }
int ignore_depends_possi(unsigned long long a0) { unsigned long long v0; unsigned int v1; unsigned int v3; v0 = deppossi_pkg_iter_new(a0, 0x0); while (true) { *(&v1) = deppossi_pkg_iter_next(v0); if (*(&v1)) { v3 = ignore_depends(*(&v1)); if (!v3) continue; deppossi_pkg_iter_free(v0); v3 = 1; break; } else { deppossi_pkg_iter_free(v0); v3 = 0; break; } } return v3; }
char *first_word(const char *s, const char *t) { static char retbuf[2][131072 + 1]; static int retsel = 0; char *rb, *rp; retsel = 1 - retsel; rb = &retbuf[retsel][0]; rp = rb; while (*s && ( ((void *)0) != strchr(t, *s))) { s++; } while (*s && ( ((void *)0) == strchr(t, *s)) && (rp < &rb[131072])) { *rp++ = *s++; } *rp = '\0'; return (rb); }
long long first_word(unsigned long a0, char *a1) { char *v0; int tmp_10; char *v1; char *v2; unsigned long long v5; char *v6; v0 = a0; retsel.4845 = 1 - retsel.4845; v2 = 131073 * retsel.4845 + &retbuf.4844; for (v1 = v2; *(v0); v0 += 1) { if (!strchr(a1, *(v0))) break; } for (; *(v0); *(v6) = *(tmp_10)) { v5 = strchr(a1, *(v0)); if (v5) break; if (!v5) { if (v1 >= v2 + 0x20000) break; } tmp_10 = v0; v0 += 1; v6 = v1; v1 += 1; } *(v1) = 0; return v2; }
static int ipneigh_get(int argc, char **argv) { struct { struct nlmsghdr n; struct ndmsg ndm; char buf[1024]; } req = { .n.nlmsg_len = ((sizeof(struct ndmsg)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))), .n.nlmsg_flags = 0x01, .n.nlmsg_type = RTM_GETNEIGH, .ndm.ndm_family = preferred_family, }; struct nlmsghdr *answer; char *d = ((void *)0) ; int dst_ok = 0; int dev_ok = 0; inet_prefix dst; while (argc > 0) { if (strcmp(*argv, "dev") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); d = *argv; dev_ok = 1; } else if (matches(*argv, "proxy") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (matches(*argv, "help") == 0) usage(); if (dst_ok) duparg("address", *argv); get_addr(&dst, *argv, preferred_family); dst_ok = 1; dev_ok = 1; req.ndm.ndm_flags |= (1 << 3); } else { if (strcmp(*argv, "to") == 0) do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (matches(*argv, "help") == 0) usage(); if (dst_ok) duparg2("to", *argv); get_addr(&dst, *argv, preferred_family); dst_ok = 1; } argc--; argv++; } if (!dev_ok || !dst_ok || dst.family == 0 ) { fprintf( stderr , "Device and address are required arguments.\n"); return -1; } req.ndm.ndm_family = dst.family; if (addattr_l(&req.n, sizeof(req), NDA_DST, &dst.data, dst.bytelen) < 0) return -1; if (d) { req.ndm.ndm_ifindex = ll_name_to_index(d); if (!req.ndm.ndm_ifindex) { fprintf( stderr , "Cannot find device \"%s\"\n", d); return -1; } } if (rtnl_talk(&rth, &req.n, &answer) < 0) return -2; ipneigh_reset_filter(0); if (print_neigh(answer, stdout ) < 0) { fprintf( stderr , "An error :-)\n"); free(answer); return -1; } free(answer); return 0; }
void ipneigh_get(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) { unsigned long long *v0; unsigned int v1; unsigned int v2; unsigned int v3; char v4; void* v5; char v6; char v7; char v8; char v9; char v10; unsigned short v11; unsigned short v12; char v13; unsigned int v14; char v15; unsigned long long v17; void* v18; unsigned long v19; unsigned long long v20; unsigned long long v21; unsigned long long v23; unsigned long long v24; unsigned long long v26; unsigned long long v27; void* v29; unsigned long long v30; v1 = a0; v0 = a1; v17 = 131; for (v18 = &v10; v17; v18 += v19 * 8) { v17 -= 1; v10 = 0; } *(v18) = 0; v10 = 28; v11 = 30; v12 = 1; v13 = preferred_family; v5 = 0; v2 = 0; for (v3 = 0; v1 > 0; v0 += 1) { v20 = strcmp(*(v0), "dev"); if (!v20) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); v5 = *(v0); v3 = 1; } else { *(&v20) = matches(*(v0), "proxy") ^ 1; if (v20) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); *(&v20) = matches(*(v0), "help") ^ 1; usage(); } else { v21 = strcmp(*(v0), "to"); if (!v21) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); } *(&v21) = matches(*(v0), "help") ^ 1; if (v21) usage(); if (v2) duparg2("to", *(v0)); get_addr(&v6, *(v0), preferred_family, *(v0)); v2 = 1; } } if (false) { if (v2) duparg("address", *(v0)); get_addr(&v6, *(v0), preferred_family, *(v0)); v2 = 1; v3 = 1; v15 |= 8; } if (!v20 || !v20 && !v21) v1 -= 1; } if (v3 && v2 && *(&v8)) { v13 = *(&v8); if (addattr_l(&v10, 0x41c, 0x1, &v9, *(&v7)) < 0) { v24 = 4294967295; } else { if (v5) { v14 = ll_name_to_index(v5); if (!v14) { fprintf(*(&stderr), "Cannot find device \"%s\"\n", v5); v26 = 4294967295; } } if (!v5 || v14) { if (rtnl_talk(0x500060, &v10, &v4) < 0) { v27 = 4294967294; } else { ipneigh_reset_filter(0x0); if (print_neigh(*(&v4), stdout, stdout, &v9, a4, a5) < 0) { fprintf(*(&stderr), "An error :-)\n"); free(*(&v4)); v30 = 4294967295; } else { free(*(&v4)); v29 = 0; } } } } } if (!*(&v8) || !v3 || !v2) { fprintf(*(&stderr), "Device and address are required arguments.\n"); v23 = 4294967295; } return; }
static int accept_msg(struct rtnl_ctrl_data *ctrl, struct nlmsghdr *n, void *arg) { struct nlmsgerr *err = (struct nlmsgerr *)((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); if (n->nlmsg_type == 0x2 && (err->error == - 95 || err->error == - 22 )) have_rtnl_newlink = 0; else have_rtnl_newlink = 1; return -1; }
long accept_msg(long a1, long a2) { _DWORD *v3; v3 = (_DWORD *)(a2 + 16); have_rtnl_newlink = *(_WORD *)(a2 + 4) != 2 || *v3 != -95 && *v3 != -22; return 0xFFFFFFFFLL; }
((posixly_correct && interactive == 0 && special_builtin_failed) || (exit_immediately_on_error && pipe_in == -1 && pipe_out == -1 && exec_result != 0))) { last_command_exit_value = exec_result; run_pending_traps (); if (exit_immediately_on_error && signal_is_trapped (0) && unwind_protect_tag_on_stack ("saved-redirects")) run_unwind_frame ("saved-redirects"); jump_to_top_level (4); }
&& !v32 && (posixly_correct && !interactive && special_builtin_failed || exit_immediately_on_error && a3 == -1 && a4 == -1 && v31) ) { last_command_exit_value = v31; run_pending_traps(); if ( exit_immediately_on_error && (unsigned int)signal_is_trapped(0LL) && (unsigned int)unwind_protect_tag_on_stack("saved-redirects") ) { run_unwind_frame("saved-redirects"); } jump_to_top_level(4LL); LABEL_172: if ( v35 ) **((_DWORD **)a1 + 3) |= 8u; v31 = execute_for_command(*((_QWORD *)a1 + 3)); }
void extract_finish (void) { apply_nonancestor_delayed_set_stat ("", 0); apply_delayed_links (); apply_nonancestor_delayed_set_stat ("", 1); }
long long extract_finish() { apply_nonancestor_delayed_set_stat(&g_40453b, 0x0); apply_delayed_links(); return apply_nonancestor_delayed_set_stat(&g_40453b, 0x1); }
int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) { pthread_mutexattr_t attributes; int err; err = pthread_mutexattr_init (&attributes); if (err != 0) return err; err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); if (err != 0) { pthread_mutexattr_destroy (&attributes); return err; } err = pthread_mutex_init (lock, &attributes); if (err != 0) { pthread_mutexattr_destroy (&attributes); return err; } err = pthread_mutexattr_destroy (&attributes); if (err != 0) return err; return 0; }
long glthread_recursive_lock_init_multithreaded(pthread_mutex_t *a1) { unsigned int v2; unsigned int v3; unsigned int v4; pthread_mutexattr_t attr; unsigned long v6; v6 = __readfsqword(0x28u); v2 = pthread_mutexattr_init(&attr); if ( v2 ) return v2; v3 = pthread_mutexattr_settype(&attr, 1); if ( v3 || (v3 = pthread_mutex_init(a1, &attr)) != 0 ) { pthread_mutexattr_destroy(&attr); return v3; } else { v4 = pthread_mutexattr_destroy(&attr); if ( v4 ) return v4; else return 0LL; } }
int el_cursor(EditLine *el, int n) { if (n == 0) goto out; el->el_line.cursor += n; if (el->el_line.cursor < el->el_line.buffer) el->el_line.cursor = el->el_line.buffer; if (el->el_line.cursor > el->el_line.lastchar) el->el_line.cursor = el->el_line.lastchar; out: return (int)(el->el_line.cursor - el->el_line.buffer); }
long long el_cursor(unsigned long long a0[13], unsigned long a1) { if (!a1) return a0[11] - a0[10] >> 2; a0[11] = a1 * 4 + a0[11]; if (a0[11] < a0[10]) a0[11] = a0[10]; if (a0[11] > a0[12]) a0[11] = a0[12]; return a0[11] - a0[10] >> 2; }
static int send_signals (int signum, char *const *argv) { int status = 0 ; char const *arg = *argv; do { char *endp; intmax_t n = ( (*__errno_location ()) = 0, strtoimax (arg, &endp, 10)); pid_t pid = n; if ( (*__errno_location ()) == 34 || pid != n || arg == endp || *endp) { error (0, 0, gettext ("%s: invalid process id"), quote (arg)); status = 1 ; } else if (kill (pid, signum) != 0) { error (0, (*__errno_location ()) , "%s", quote (arg)); status = 1 ; } } while ((arg = *++argv)); return status; }
void send_signals(unsigned long a0, unsigned long a1) { unsigned long long *v0; unsigned int v1; unsigned int v2; char v3; char *v4; unsigned long v5; unsigned int v7; unsigned long long v9; unsigned long long v10; unsigned long long v11; v0 = a1; v1 = 0; v4 = *(v0); do { *(__errno_location()) = 0; v5 = strtoimax(v4, &v3, 0xa); v2 = v5; v7 = *(__errno_location()); if (v7 != 34 && v5 == v2 && v4 != *(&v3) && !*(*(&v3)) && kill(v2, a0)) { v10 = quote(v4); error(0x0, *(__errno_location()), "%s"); v1 = 1; } if (v4 == *(&v3) || v7 == 34 || *(*(&v3)) || v5 != v2) { v9 = quote(v4); error(0x0, 0x0, gettext("%s: invalid process id")); v1 = 1; } v0 += 1; v4 = *(v0); } while (v4); v11 = v1; return; }
static _Bool parse_okdir (const struct parser_table* entry, char **argv, int *arg_ptr) { return insert_exec_ok ("-okdir", entry, argv, arg_ptr); }
long long parse_okdir(unsigned long long a0, unsigned long long a1, unsigned long long a2) { return insert_exec_ok("-okdir", a0, a1, a2); }
static int huft_build( unsigned *b, unsigned n, unsigned s, ush *d, ush *e, struct huft **t, int *m ) { unsigned a; unsigned c[16 +1]; unsigned f; int g; int h; register unsigned i; register unsigned j; register int k; int l; register unsigned *p; register struct huft *q; struct huft r; struct huft *u[16]; unsigned v[288]; register int w; unsigned x[16 +1]; unsigned *xp; int y; unsigned z; memset ((voidp)(c), 0, (sizeof(c))); p = b; i = n; do { ; c[*p]++; p++; } while (--i); if (c[0] == n) { q = (struct huft *) malloc (3 * sizeof *q); if (!q) return 3; hufts += 3; q[0].v.t = (struct huft *) ((void *)0) ; q[1].e = 99; q[1].b = 1; q[2].e = 99; q[2].b = 1; *t = q + 1; *m = 1; return 0; } l = *m; for (j = 1; j <= 16; j++) if (c[j]) break; k = j; if ((unsigned)l < j) l = j; for (i = 16; i; i--) if (c[i]) break; g = i; if ((unsigned)l > i) l = i; *m = l; for (y = 1 << j; j < i; j++, y <<= 1) if ((y -= c[j]) < 0) return 2; if ((y -= c[i]) < 0) return 2; c[i] += y; x[1] = j = 0; p = c + 1; xp = x + 2; while (--i) { *xp++ = (j += *p++); } p = b; i = 0; do { if ((j = *p++) != 0) v[x[j]++] = i; } while (++i < n); n = x[g]; x[0] = i = 0; p = v; h = -1; w = -l; u[0] = (struct huft *) ((void *)0) ; q = (struct huft *) ((void *)0) ; z = 0; for (; k <= g; k++) { a = c[k]; while (a--) { while (k > w + l) { h++; w += l; z = (z = g - w) > (unsigned)l ? l : z; if ((f = 1 << (j = k - w)) > a + 1) { f -= a + 1; xp = c + k; if (j < z) while (++j < z) { if ((f <<= 1) <= *++xp) break; f -= *xp; } } z = 1 << j; if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) == (struct huft *) ((void *)0) ) { if (h) huft_free(u[0]); return 3; } hufts += z + 1; *t = q + 1; *(t = &(q->v.t)) = (struct huft *) ((void *)0) ; u[h] = ++q; if (h) { x[h] = i; r.b = (uch)l; r.e = (uch)(16 + j); r.v.t = q; j = i >> (w - l); u[h-1][j] = r; } } r.b = (uch)(k - w); if (p >= v + n) r.e = 99; else if (*p < s) { r.e = (uch)(*p < 256 ? 16 : 15); r.v.n = (ush)(*p); p++; } else { r.e = (uch)e[*p - s]; r.v.n = d[*p++ - s]; } f = 1 << (k - w); for (j = i >> w; j < z; j += f) q[j] = r; for (j = 1 << (k - 1); i & j; j >>= 1) i ^= j; i ^= j; while ((i & ((1 << w) - 1)) != x[h]) { h--; w -= l; } } } return y != 0 && g != 1; }
int huft_build(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned short *a4, unsigned long a5, unsigned long v26) { unsigned int v0; int tmp_9; int tmp_20; int tmp_12; unsigned int *v1; unsigned long long *v2; unsigned short *v3; unsigned int v4; unsigned long v5; unsigned int v6; unsigned int v7; unsigned int v8; unsigned int v9; unsigned int v10; unsigned int v11; unsigned int v12; unsigned long long v13; char v14; char v15; unsigned short v16; char v17; unsigned int v18; char v19; unsigned int v20; char v21; unsigned int v22; char v23; void* v24; char v25; unsigned int *v27; unsigned int v28; unsigned long v29; unsigned long v30; unsigned long v31; void* v32; unsigned int *v33; unsigned int *v34; unsigned long v35; unsigned int *v36; unsigned long long v37; void* v38; unsigned long long v39; unsigned long long v40; struct_0 *v41; void* v42; unsigned long long v43; v5 = a0; v4 = a1; v3 = a3; v2 = a5; v1 = v26; memset(&v17, 0x0, 0x44); v27 = v5; v28 = v4; do { *(&(&v17)[4 * *(v27)]) = *(&(&v17)[4 * *(v27)]) + 1; v27 += 1; v28 -= 1; } while (v28); if (v4 == *(&v17)) { v31 = malloc(0x30); if (!v31) { *(&v31) = 3; } else { hufts = hufts + 3; *((v31 + 8)) = 0; *((v31 + 16)) = 99; *((v31 + 17)) = 1; *((v31 + 32)) = 99; *((v31 + 33)) = 1; *(v2) = v31 + 16; *(v1) = 1; *(&v31) = 0; } } else { v9 = *(v1); for (v29 = 1; v29 <= 16; v29 = v29 + 1) { if (v18) break; } v0 = v29; if (v29 > v9) v9 = v29; for (v30 = 16; v30; v30 = v30 - 1) { if (v20) break; } v12 = v30; if (v30 < v9) v9 = v30; *(v1) = v9; v10 = 1 << (v29 & 31); while (true) { if (v29 < v30) { v10 -= *(&(&v17)[4 * v29]); if (v10 < 0) { v31 = 2; break; } else { v29 = v29 + 1; v10 *= 2; } } else { v10 -= *(&(&v17)[4 * v30]); if (v10 < 0) { v31 = 2; break; } else { *(&(&v17)[4 * v30]) = v10 + *(&(&v17)[4 * v30]); v32 = 0; v22 = 0; v33 = &v18; v13 = &v23; while (true) { *(&v30) = v30 - 1; if (!v30) break; tmp_9 = v33; v33 = &v19; tmp_20 = v32 + v18; v32 = v32 + v18; v34 = v13; v13 += 4; *(v34) = tmp_20; } v35 = v5; do { v31 = v35; v35 += 4; v36 = *(v31); if (*(v31)) { tmp_12 = *((&v21 + 0x4 * v36)); *((&v21 + 0x4 * v36)) = *((&v21 + 0x4 * v36)) + 1; *(&(&v25)[4 * tmp_12]) = 0; } } while (1 < v4); v4 = *(&(&v21)[4 * v12]); *(&v30) = 0; v21 = 0; v8 = -1; v37 = -(v9); v24 = 0; v38 = 0; v11 = 0; while (true) { if (v0 <= v12) { v6 = *(&(&v17)[4 * v0]); while (true) { *(&v31) = v6; v6 -= 1; if (v31) { while (true) { v39 = v0; if (v0 > v9 + v37) { v8 += 1; v37 = v9 + v37; v11 = v12 - v37; if (v11 > v9) *(&v31) = v9; else *(&v31) = v11; v11 = v31; v40 = v0 - v37; v7 = 1 << ((v0 - v37) & 31); if (v7 > v6 + 1) { v7 = v7 - v6 - 1; v13 = &(&v17)[4 * v0]; if (v0 - v37 < v11) { while (true) { v40 = v40 + 1; if (v40 >= v11) break; v7 *= 2; v13 += 4; if (v7 <= *(v13)) break; v7 -= *(v13); } } } v11 = 1 << (v40 & 31); v31 = malloc((v11 + 1) * 16); if (!v31) { if (v8) huft_free(v24); *(&v31) = 3; break; } else { hufts = v11 + hufts + 1; *(v2) = v31 + 16; v2 = v31 + 8; *(v2) = 0; v38 = v31 + 16; (&v24)[v8] = v31 + 16; if (!v8) continue; *(&(&v21)[4 * v8]) = 0; v15 = v9; v14 = v40 + 16; v16 = v31 + 16; v41 = (&v24)[1 + v8] + (0 >> ((v37 - v9) & 31)) * 16; *(((&v24)[1 + v8] + 16 * (0 >> ((v37 - v9) & 31)))) = *(&v14); v41->field_8 = v16; } } else { v15 = v39 - v37; if (&v25 >= &(&v25)[4 * v4]) { v14 = 99; } else if (a2 > *(&v25)) { if (*(&v25) <= 255) *(&v31) = 16; else *(&v31) = 15; v14 = v31; v16 = *(&v25); } else { v14 = a4[*(&v25) + -1 * a2]; v16 = v3[*(&v25) + -1 * a2]; } v7 = 1 << ((v0 - v37) & 31); for (v42 = 0 >> (v37 & 31); v42 < v11; v42 = v7 + v42) { *((v38 + 0x10 * v42)) = *(&v14); *((8 + v38 + 0x10 * v42)) = v16; } for (v43 = 1 << ((v0 - 1) & 31); (v30 & v43); v43 /= 2) { *(&v30) = v30 ^ v43; } for (*(&v30) = v30 ^ v43; ((1 << (v37 & 31)) - 1 & v30) != *(&(&v21)[4 * v8]); v37 = v37 - v9) { v8 -= 1; } } } if (!v31) break; } else { v0 += 1; break; } } if (!v31) break; } else { if (v10 && v12 != 1) { *(&v31) = 1; break; } if (!v10 || v12 == 1) { *(&v31) = 0; break; } } } } } } } return v31; }
int e2fsck_dir_info_set_parent(e2fsck_t ctx, ext2_ino_t ino, ext2_ino_t parent) { struct dir_info *p; p = e2fsck_get_dir_info(ctx, ino); if (!p) return 1; p->parent = parent; e2fsck_put_dir_info(ctx, p); return 0; }
long long e2fsck_dir_info_set_parent(void* a0, unsigned long a1, unsigned long a2) { struct_0 *v0; unsigned long long v2; v0 = e2fsck_get_dir_info(a0, a1); if (!v0) { v2 = 1; return v2; } v0->field_8 = a2; e2fsck_put_dir_info(a0, v0); v2 = 0; return v2; }
void get_ocsp_issuer_set(gnutls_x509_crt_t crt) { int ret, i; gnutls_datum_t uri; if (batch) { if (!cfg.ocsp_uris) return; for (i = 0; cfg.ocsp_uris[i] != ((void *)0) ; i++) { uri.data = (void*)cfg.ocsp_uris[i]; uri.size = strlen(cfg.ocsp_uris[i]); ret = gnutls_x509_crt_set_authority_info_access(crt, GNUTLS_IA_OCSP_URI, &uri); if (ret < 0) { fprintf( stderr , "set OCSP URI (%s): %s\n", cfg.ocsp_uris[i], gnutls_strerror(ret)); exit(1); } } } }
long long get_ocsp_issuer_set(unsigned long long a0) { unsigned int v0; unsigned int v1; unsigned long v2; unsigned int v3; if (*(got.batch) && *((got.cfg + 656))) { for (v0 = 0; *((*((got.cfg + 656)) + (v0 << 3))); v0 += 1) { v2 = *((*((got.cfg + 656)) + v0 * 8)); v3 = strlen(*((*((got.cfg + 656)) + v0 * 8))); v1 = gnutls_x509_crt_set_authority_info_access(a0, 0x2716, &v2); if (v1 < 0) { fprintf(*(got.stderr), "set OCSP URI (%s): %s\n", *((*((got.cfg + 656)) + v0 * 8)), gnutls_strerror(v1)); exit(0x1); } } } return 0; }
_Bool pred_executable (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr) { (void) pathname; (void) stat_buf; (void) pred_ptr; return 0 == faccessat (state.cwd_dir_fd, state.rel_pathname, 1 , 0); }
ulong pred_executable(void) { int iVar1; undefined4 extraout_var; iVar1 = faccessat(___errno_location,_strcmp,1,0); return CONCAT44(extraout_var,iVar1) & 0xffffffffffffff00 | (ulong)(iVar1 == 0); }
static void cpe_dispose (cpe) struct cpelement *cpe; { sh_xfree((cpe), "execute_cmd.c", 1798); }
long long cpe_dispose(unsigned long long a0) { return sh_xfree(a0, "execute_cmd.c", 0x706); }
size_t xdupmbstowcs (destp, indicesp, src) wchar_t **destp; char ***indicesp; const char *src; { const char *p; wchar_t wc; wchar_t *wsbuf; char **indices; size_t wsbuf_size; size_t wcnum; mbstate_t state; if (src == ((void *)0) || destp == ((void *)0) ) { if (destp) *destp = ((void *)0) ; if (indicesp) *indicesp = ((void *)0) ; return (size_t)-1; } if (indicesp == ((void *)0) ) return (xdupmbstowcs2 (destp, src)); memset (&state, '\0', sizeof(mbstate_t)); wsbuf_size = 32; wsbuf = (wchar_t *) malloc (wsbuf_size * sizeof(wchar_t)); if (wsbuf == ((void *)0) ) { *destp = ((void *)0) ; if (indicesp) *indicesp = ((void *)0) ; return (size_t)-1; } indices = ((void *)0) ; if (indicesp) { indices = (char **) malloc (wsbuf_size * sizeof(char *)); if (indices == ((void *)0) ) { free (wsbuf); *destp = ((void *)0) ; *indicesp = ((void *)0) ; return (size_t)-1; } } p = src; wcnum = 0; do { size_t mblength; if (mbsinit (&state)) { if (*p == '\0') { wc = L'\0'; mblength = 1; } else if (*p == '\\') { wc = L'\\'; mblength = 1; } else mblength = mbrtowc(&wc, p, 16 , &state); } else mblength = mbrtowc(&wc, p, 16 , &state); if (((mblength) == (size_t)-1 || (mblength) == (size_t)-2)) { free (wsbuf); do { if (indices) free (indices); } while (0); *destp = ((void *)0) ; if (indicesp) *indicesp = ((void *)0) ; return (size_t)-1; } ++wcnum; if (wsbuf_size < wcnum) { wchar_t *wstmp; char **idxtmp; wsbuf_size += 32; wstmp = (wchar_t *) realloc (wsbuf, wsbuf_size * sizeof (wchar_t)); if (wstmp == ((void *)0) ) { free (wsbuf); do { if (indices) free (indices); } while (0); *destp = ((void *)0) ; if (indicesp) *indicesp = ((void *)0) ; return (size_t)-1; } wsbuf = wstmp; if (indicesp) { idxtmp = (char **) realloc (indices, wsbuf_size * sizeof (char *)); if (idxtmp == ((void *)0) ) { free (wsbuf); free (indices); *destp = ((void *)0) ; if (indicesp) *indicesp = ((void *)0) ; return (size_t)-1; } indices = idxtmp; } } wsbuf[wcnum - 1] = wc; if (indices) indices[wcnum - 1] = (char *)p; p += mblength; } while (((wc) == 0) == 0); *destp = wsbuf; if (indicesp != ((void *)0) ) *indicesp = indices; return (wcnum - 1); }
long xdupmbstowcs(void **param_1,void **param_2,char *param_3) { void *pvVar1; int iVar2; long lVar3; long in_FS_OFFSET; wchar_t local_5c; char *local_58; void *local_50; void *local_48; ulong local_40; ulong local_38; size_t local_30; void *local_28; void *local_20; mbstate_t local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); if ((param_3 == (char *)0x0) || (param_1 == (void **)0x0)) { if (param_1 != (void **)0x0) { *param_1 = (void *)0x0; } if (param_2 != (void **)0x0) { *param_2 = (void *)0x0; } lVar3 = -1; } else if (param_2 == (void **)0x0) { lVar3 = xdupmbstowcs2(param_1,param_3); } else { memset(&local_18,0,8); local_40 = 0x20; local_50 = malloc(0x80); if (local_50 == (void *)0x0) { *param_1 = (void *)0x0; if (param_2 != (void **)0x0) { *param_2 = (void *)0x0; } lVar3 = -1; } else { local_48 = (void *)0x0; if ((param_2 == (void **)0x0) || (local_48 = malloc(local_40 << 3), local_48 != (void *)0x0)) { local_38 = 0; local_58 = param_3; do { iVar2 = mbsinit(&local_18); if (iVar2 == 0) { local_30 = mbrtowc(&local_5c,local_58,0x10,&local_18); } else if (*local_58 == '\0') { local_5c = L'\0'; local_30 = 1; } else if (*local_58 == '\\') { local_5c = L'\\'; local_30 = 1; } else { local_30 = mbrtowc(&local_5c,local_58,0x10,&local_18); } if ((local_30 == 0xffffffffffffffff) || (local_30 == 0xfffffffffffffffe)) { free(local_50); if (local_48 != (void *)0x0) { free(local_48); } *param_1 = (void *)0x0; if (param_2 != (void **)0x0) { *param_2 = (void *)0x0; } lVar3 = -1; goto LAB_001008c8; } local_38 = local_38 + 1; pvVar1 = local_48; if (local_40 < local_38) { local_40 = local_40 + 0x20; local_28 = realloc(local_50,local_40 * 4); if (local_28 == (void *)0x0) { free(local_50); if (local_48 != (void *)0x0) { free(local_48); } *param_1 = (void *)0x0; if (param_2 != (void **)0x0) { *param_2 = (void *)0x0; } lVar3 = -1; goto LAB_001008c8; } local_50 = local_28; pvVar1 = local_48; if ((param_2 != (void **)0x0) && (local_20 = realloc(local_48,local_40 * 8), pvVar1 = local_20, local_20 == (void *)0x0)) { free(local_50); free(local_48); *param_1 = (void *)0x0; if (param_2 != (void **)0x0) { *param_2 = (void *)0x0; } lVar3 = -1; goto LAB_001008c8; } } local_48 = pvVar1; *(wchar_t *)(local_38 * 4 + -4 + (long)local_50) = local_5c; if (local_48 != (void *)0x0) { *(char **)(local_38 * 8 + -8 + (long)local_48) = local_58; } local_58 = local_58 + local_30; } while (local_5c != L'\0'); *param_1 = local_50; if (param_2 != (void **)0x0) { *param_2 = local_48; } lVar3 = local_38 - 1; } else { free(local_50); *param_1 = (void *)0x0; *param_2 = (void *)0x0; lVar3 = -1; } } } LAB_001008c8: if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return lVar3; } __stack_chk_fail(); }
void create_archive (void) { struct name const *p; trivial_link_count = filename_args != FILES_MANY && ! dereference_option; open_archive (ACCESS_WRITE); buffer_write_global_xheader (); if (incremental_option) { size_t buffer_size = 0; char *buffer = ((void *)0) ; const char *q; collect_and_sort_names (); while ((p = name_from_list ()) != ((void *)0) ) if (!excluded_name (p->name, ((void *)0) )) dump_file (0, p->name, p->name); blank_name_list (); while ((p = name_from_list ()) != ((void *)0) ) if (!excluded_name (p->name, ((void *)0) )) { struct tar_stat_info st; size_t plen = strlen (p->name); while (buffer_size <= plen) buffer = x2realloc (buffer, &buffer_size); memcpy (buffer, p->name, plen); if (! (( buffer[plen - 1] ) == '/') ) buffer[plen++] = '/'; tar_stat_init (&st); q = directory_contents (p->directory); if (q) while (*q) { size_t qlen = strlen (q); if (*q == 'Y') { if (! st.orig_file_name) { int fd = openat (chdir_fd, p->name, open_searchdir_flags); if (fd < 0) { file_removed_diag (p->name, !p->parent, open_diag); break; } st.fd = fd; if (fstat (fd, &st.stat) != 0) { file_removed_diag (p->name, !p->parent, stat_diag); break; } st.orig_file_name = xstrdup (p->name); } while (buffer_size < plen + qlen) buffer = x2realloc (buffer, &buffer_size); strcpy (buffer + plen, q + 1); dump_file (&st, q + 1, buffer); } q += qlen + 1; } tar_stat_destroy (&st); } free (buffer); } else { const char *name; while ((name = name_next (1)) != ((void *)0) ) if (!excluded_name (name, ((void *)0) )) dump_file (0, name, name); } write_eot (); close_archive (); finish_deferred_unlinks (); if (listed_incremental_option) write_directory_file (); }
long long create_archive(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { int tmp_10; unsigned int v0; void* v1; void* v2; char *v3; void* v4; unsigned long long v5; unsigned long long v6[9]; unsigned long v7; unsigned long v8; char v9; unsigned int v10; unsigned long long v12; if (filename_args != 2 && (dereference_option ^ 1)) { v12 = 1; goto LABEL_402f27; } v12 = 0; LABEL_402f27: trivial_link_count = v12; open_archive(0x1); buffer_write_global_xheader(0x1, a1, a2, a3, a4, a5); if (incremental_option) { v1 = 0; v2 = 0; collect_and_sort_names(); while (true) { v6 = name_from_list(); if (!v6) break; *(&v12) = excluded_name(v6->field_10, 0x0, v6->field_10) ^ 1; if (v12) dump_file(0x0, v6->field_10, v6->field_10); } blank_name_list(); while (true) { v6[0] = name_from_list(); if (!v6) break; *(&v12) = excluded_name(v6[2], 0x0, a2) ^ 1; if (v12) { for (v4 = strlen(v6[2]); v4 >= v1; v2 = x2realloc(v2, &v1, &v1)); memcpy(v2, v6[2], v4); if (*((v2 + v4 - 1)) != 47) { tmp_10 = v4; v4 += 1; *(tmp_10 + v2) = 47; } tar_stat_init(&v8); v3 = directory_contents(v6[7]); if (v3) { while (true) { if (!*(v3)) break; v7 = strlen(v3); if (*(v3) == 89) { if (!v8) { v0 = openat(chdir_fd, v6[2], open_searchdir_flags, v6[2]); if (v0 < 0) { file_removed_diag(v6[2], !v6[8], got.open_diag, !v6[8]); break; } else { v10 = v0; if (!fstat(v0, &v9)) { v8 = xstrdup(v6[2]); } else { file_removed_diag(v6[2], !v6[8], got.stat_diag, !v6[8]); break; } } } for (; v4 + v7 > v1; v2 = x2realloc(v2, &v1, &v1)); strcpy(v4 + v2, v3 + 1); dump_file(&v8, v3 + 1, v2); } v3 = &v3[1 + v7]; } } tar_stat_destroy(&v8); } } free(v2); } else { while (true) { v5 = name_next(0x1); if (!v5) break; *(&v12) = excluded_name(v5, 0x0, v5) ^ 1; if (!v12) continue; dump_file(0x0, v5, v5); } } write_eot(); close_archive(a0, a1, a2, a3, a4, a5); finish_deferred_unlinks(a0, a1, a2, a3, a4, a5); if (listed_incremental_option) write_directory_file(); return 0; }
int jbd2_journal_skip_recovery(journal_t *journal) { int err; struct recovery_info info; memset (&info, 0, sizeof(info)); err = do_one_pass(journal, &info, PASS_SCAN); if (err) { printf("" "JBD2: error %d scanning journal\n", err); ++journal->j_transaction_sequence; } else { journal->j_transaction_sequence = ++info.end_transaction; } journal->j_tail = 0; return err; }
uint jbd2_journal_skip_recovery(long param_1) { uint uVar1; long in_FS_OFFSET; undefined local_28 [4]; int local_24; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); memset(local_28,0,0x14); uVar1 = do_one_pass(param_1,local_28,0); if (uVar1 == 0) { local_24 = local_24 + 1; *(int *)(param_1 + 0x94) = local_24; } else { printf("JBD2: error %d scanning journal\n",(ulong)uVar1); *(int *)(param_1 + 0x94) = *(int *)(param_1 + 0x94) + 1; } *(undefined8 *)(param_1 + 0x30) = 0; if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar1; }
void chld_handler(int sig __attribute__((unused))) { sigchild++; }
void chld_handler(void) { sigchild = sigchild + 1; return; }
static Channel * rdynamic_connect_prepare(struct ssh *ssh, char *ctype, char *rname) { Channel *c; int r; c = channel_new(ssh, ctype, 21, -1, -1, -1, (64*(32*1024)), (32*1024), 0, rname, 1); c->host_port = 0; c->path = ((void *)0) ; if ((r = sshpkt_start(ssh, 91)) != 0 || (r = sshpkt_put_u32(ssh, c->remote_id)) != 0 || (r = sshpkt_put_u32(ssh, c->self)) != 0 || (r = sshpkt_put_u32(ssh, c->local_window)) != 0 || (r = sshpkt_put_u32(ssh, c->local_maxpacket)) != 0) sshfatal("channels.c", __func__, 4751, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "channel %i; confirm", c->self); return c; }
void rdynamic_connect_prepare(void* a0, unsigned int a1, unsigned long long a2) { unsigned long v0; unsigned int v1; struct_0 *v2; struct_0 *v5; *(&v2) = channel_new(a0, a1, 0x15, 0xffffffff, 0xffffffff, 0xffffffff, 0x200000, 0x8000, 0x0, a2, 0x1); v2->field_98 = 0; v2->field_80 = 0; v1 = sshpkt_start(a0, 0x5b); if (v1) { LABEL_40fa09: v0 = v2->field_4; sshfatal("channels.c", "rdynamic_connect_prepare", 0x128f, 0x1, 0x1, ssh_err(v1)); } else { v1 = sshpkt_put_u32(a0, v2->field_8, v2->field_8); if (!(!v1) || !((v1 = sshpkt_put_u32(a0, v2->field_4, v2->field_4), !v1))) goto LABEL_40fa09; v1 = sshpkt_put_u32(a0, v2->field_b0, v2->field_b0); if (v1 || (v1 = sshpkt_put_u32(a0, v2->field_bc, v2->field_bc), v1)) goto LABEL_40fa09; } v5 = v2; return; }
static _Bool simple_strtoul (char const *s, char const **p, unsigned long int *val) { unsigned long int sum; sum = 0; while (((unsigned int) (*s) - '0' <= 9)) { int c = *s++ - '0'; if (sum > ( (0x7fffffffffffffffL * 2UL + 1UL) - c) / 10) return 0 ; sum = sum * 10 + c; } *p = s; *val = sum; return 1 ; }
int simple_strtoul(unsigned long a0, unsigned long long *a1, unsigned long long *a2) { char *v0; int tmp_29; unsigned int v1; void* v2; unsigned int v5; v0 = a0; v2 = 0; while (true) { if (*(v0) - 48 > 9) { *(a1) = v0; *(a2) = v2; v5 = 1; break; } else { tmp_29 = v0; v0 += 1; v1 = *(tmp_29) - 48; if (v2 <= !(v1) * 14757395258967641293 >> 64 >> 3) { v2 = v1 + v2 * 10; } else { v5 = 0; break; } } } return v5; }
int main(int argc, char **argv) { int r, in, out, ch, err, tmp, port = -1, noisy = 0; char *host = ((void *)0) , *user, *cp, **cpp, *file2 = ((void *)0) ; int debug_level = 0; char *file1 = ((void *)0) , *sftp_server = ((void *)0) ; char *ssh_program = "/usr/local/bin/ssh", *sftp_direct = ((void *)0) ; const char *errstr; LogLevel ll = SYSLOG_LEVEL_INFO; arglist args; struct sftp_conn *conn; size_t copy_buffer_len = 0; size_t num_requests = 0; long long limit_kbps = 0; sanitise_stdfd(); msetlocale(); __progname = ssh_get_progname(argv[0]); memset(&args, '\0', sizeof(args)); args.list = ((void *)0) ; addargs(&args, "%s", ssh_program); addargs(&args, "-oForwardX11 no"); addargs(&args, "-oPermitLocalCommand no"); addargs(&args, "-oClearAllForwardings yes"); ll = SYSLOG_LEVEL_INFO; infile = stdin ; while ((ch = BSDgetopt(argc, argv, "1246AafhNpqrvCc:D:i:l:o:s:S:b:B:F:J:P:R:") ) != -1) { switch (ch) { case 'A': case '4': case '6': case 'C': addargs(&args, "-%c", ch); break; case 'F': case 'J': case 'c': case 'i': case 'o': addargs(&args, "-%c", ch); addargs(&args, "%s", BSDoptarg); break; case 'q': ll = SYSLOG_LEVEL_ERROR; quiet = 1; showprogress = 0; addargs(&args, "-%c", ch); break; case 'P': port = a2port(BSDoptarg); if (port <= 0) sshfatal("sftp.c", __func__, 2479, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Bad port \"%s\"\n", BSDoptarg); break; case 'v': if (debug_level < 3) { addargs(&args, "-v"); ll = SYSLOG_LEVEL_DEBUG1 + debug_level; } debug_level++; break; case '1': sshfatal("sftp.c", __func__, 2489, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "SSH protocol v.1 is no longer supported"); break; case '2': break; case 'a': global_aflag = 1; break; case 'B': copy_buffer_len = strtol(BSDoptarg, &cp, 10); if (copy_buffer_len == 0 || *cp != '\0') sshfatal("sftp.c", __func__, 2500, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Invalid buffer size \"%s\"", BSDoptarg); break; case 'b': if (batchmode) sshfatal("sftp.c", __func__, 2504, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Batch file already specified."); if (strcmp(BSDoptarg, "-") != 0 && (infile = fopen(BSDoptarg, "r")) == ((void *)0) ) sshfatal("sftp.c", __func__, 2509, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s (%s).", strerror( (*__errno_location ()) ), BSDoptarg); showprogress = 0; quiet = batchmode = 1; addargs(&args, "-obatchmode yes"); break; case 'f': global_fflag = 1; break; case 'N': noisy = 1; break; case 'p': global_pflag = 1; break; case 'D': sftp_direct = BSDoptarg; break; case 'l': limit_kbps = strtonum(BSDoptarg, 1, 100 * 1024 * 1024, &errstr); if (errstr != ((void *)0) ) usage(); limit_kbps *= 1024; break; case 'r': global_rflag = 1; break; case 'R': num_requests = strtol(BSDoptarg, &cp, 10); if (num_requests == 0 || *cp != '\0') sshfatal("sftp.c", __func__, 2539, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Invalid number of requests \"%s\"", BSDoptarg) ; break; case 's': sftp_server = BSDoptarg; break; case 'S': ssh_program = BSDoptarg; replacearg(&args, 0, "%s", ssh_program); break; case 'h': default: usage(); } } addargs(&args, "-oForwardAgent no"); if (!isatty( 2 )) showprogress = 0; if (noisy) quiet = 0; log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1); if (sftp_direct == ((void *)0) ) { if (BSDoptind == argc || argc > (BSDoptind + 2)) usage(); argv += BSDoptind; switch (parse_uri("sftp", *argv, &user, &host, &tmp, &file1)) { case -1: usage(); break; case 0: if (tmp != -1) port = tmp; break; default: if (parse_user_host_path(*argv, &user, &host, &file1) == 0) break; if (parse_user_host_port(*argv, &user, &host, ((void *)0) ) == 0) break; host = xstrdup(*argv); host = cleanhostname(host); break; } file2 = *(argv + 1); if (!*host) { fprintf( stderr , "Missing hostname\n"); usage(); } if (port != -1) addargs(&args, "-oPort %d", port); if (user != ((void *)0) ) { addargs(&args, "-l"); addargs(&args, "%s", user); } if (sftp_server == ((void *)0) || strchr(sftp_server, '/') == ((void *)0) ) addargs(&args, "-s"); addargs(&args, "--"); addargs(&args, "%s", host); addargs(&args, "%s", (sftp_server != ((void *)0) ? sftp_server : "sftp")); connect_to_server(ssh_program, args.list, &in, &out); } else { if ((r = argv_split(sftp_direct, &tmp, &cpp, 1)) != 0) sshfatal("sftp.c", __func__, 2619, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "Parse -D arguments"); if (cpp[0] == 0) sshfatal("sftp.c", __func__, 2621, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "No sftp server specified via -D"); connect_to_server(cpp[0], cpp, &in, &out); argv_free(cpp, tmp); } freeargs(&args); conn = do_init(in, out, copy_buffer_len, num_requests, limit_kbps); if (conn == ((void *)0) ) sshfatal("sftp.c", __func__, 2629, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Couldn't initialise connection to server"); if (!quiet) { if (sftp_direct == ((void *)0) ) fprintf( stderr , "Connected to %s.\n", host); else fprintf( stderr , "Attached to %s.\n", sftp_direct); } err = interactive_loop(conn, file1, file2); shutdown(in, SHUT_RDWR ); shutdown(out, SHUT_RDWR ); close(in); close(out); if (batchmode) fclose(infile); while (waitpid(sshpid, ((void *)0) , 0) == -1 && sshpid > 1) if ( (*__errno_location ()) != 4 ) sshfatal("sftp.c", __func__, 2652, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Couldn't wait for ssh process: %s", strerror( (*__errno_location ()) )) ; exit(err == 0 ? 0 : 1); }
int main(unsigned long long a0, unsigned long long a1) { unsigned long long v0[2]; char v1; char v2; char v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned int v8; unsigned int v9; unsigned int v10; void* v11; char v12; char v13; char v14; void* v15; char v16; void* v17; void* v18; unsigned long long v19; void* v20; void* v21; void* v22; void* v23; void* v24; void* v25; unsigned long long v26; unsigned long v27; unsigned long long v28; unsigned long v29; char v30; unsigned long v32; unsigned long long *v33; unsigned long long v34; unsigned long long v35; unsigned long long v36; unsigned long long v37; struct_0 *v38; unsigned long long v39; unsigned long long v40; v28 = v32; v0 = a1; v26 = v33[5]; v4 = -1; v5 = 0; v11 = 0; v17 = 0; v6 = 0; v15 = 0; v18 = 0; v19 = "/usr/local/bin/ssh"; v20 = 0; v7 = 3; v21 = 0; v22 = 0; v23 = 0; sanitise_stdfd(); msetlocale(a0, a1, v34, v35, v36, v37); __progname = ssh_get_progname(*(v0)); memset(&v25, 0x0, 0x10); v25 = 0; addargs(&v25, "%s", v19); addargs(&v25, "-oForwardX11 no", v34); addargs(&v25, "-oPermitLocalCommand no", v34); addargs(&v25, "-oClearAllForwardings yes", v34); v7 = 3; sort_glob = stdin; while (true) { v8 = BSDgetopt(a0, v0, "1246AafhNpqrvCc:D:i:l:o:s:S:b:B:F:J:P:R:", v0); if (v8 == -1) { addargs(&v25, "-oForwardAgent no", "1246AafhNpqrvCc:D:i:l:o:s:S:b:B:F:J:P:R:"); if (!isatty(0x2)) showprogress = 0; if (v5) quiet = 0; log_init(*(v0), v7, 0x1, 0x1); if (v20) { v9 = argv_split(v20, &v3, &v14, 0x1); if (v9) { v28 = "Parse -D arguments"; sshfatal("sftp.c", "main", 0xa3b, 0x0, 0x1, ssh_err(v9), *(&v30)); } if (!*(*(&v14))) { v28 = "No sftp server specified via -D"; sshfatal("sftp.c", "main", 0xa3d, 0x0, 0x1, 0x0, *(&v30)); } connect_to_server(*(*(&v14)), *(&v14), &v1, &v2); argv_free(*(&v14), *(&v3), *(&v3)); break; } else { if (!(a0 != BSDoptind) || !(a0 <= __addvsi3(BSDoptind, 0x2))) usage(); v0[0] = &v0[BSDoptind]; v39 = parse_uri("sftp", v0[0], &v12, &v11, &v3, &v15); if (v39 == -1) usage(); if (!v39) { if (*(&v3) != -1) v4 = *(&v3); } else { if (parse_user_host_path(v0[0], &v12, &v11, &v15) && parse_user_host_port(v0[0], &v12, &v11, 0x0)) { v11 = xstrdup(v0[0]); v11 = cleanhostname(v11); } } v17 = v0[1]; if (!*(v11)) { fprintf(*(&stderr), "Missing hostname\n"); usage(); } if (v4 != -1) addargs(&v25, "-oPort %d", v4); if (*(&v12)) { addargs(&v25, "-l", &g_40a4f4); addargs(&v25, "%s", *(&v12)); } if (!v18 || !strchr(v18, 0x2f)) addargs(&v25, "-s", &g_40a4f4); addargs(&v25, "--", &g_40a4f4); addargs(&v25, "%s", v11); v40 = (!v18 ? v18 : "sftp"); addargs(&v25, "%s", v40); connect_to_server(v19, v25, &v1, &v2); break; } } else { v38 = __addvsi3(v8, 0xffffffcf); switch (v38) { case 0: v28 = "SSH protocol v.1 is no longer supported"; sshfatal("sftp.c", "main", 0x9b9, 0x0, 0x1, 0x0, *(&v30)); case 1: break; case 3: case 5: case 16: case 18: addargs(&v25, "-%c", v8); continue; case 17: v21 = strtol(*(&BSDoptarg), &v13, 0xa); if (!(!v21) && !(*(*(&v13)))) continue; v29 = *(&BSDoptarg); v28 = "Invalid buffer size \"%s\""; sshfatal("sftp.c", "main", 0x9c4, 0x0, 0x1, 0x0, *(&v30)); case 19: v20 = *(&BSDoptarg); continue; case 21: case 25: case 50: case 56: case 62: addargs(&v25, "-%c", v8); addargs(&v25, "%s", *(&BSDoptarg)); continue; case 29: v5 = 1; continue; case 31: v4 = a2port(*(&BSDoptarg)); if (!(v4 <= 0)) continue; v29 = *(&BSDoptarg); v28 = "Bad port \"%s\"\n"; sshfatal("sftp.c", "main", 0x9af, 0x0, 0x1, 0x0, *(&v30)); case 33: v22 = strtol(*(&BSDoptarg), &v13, 0xa); if (!(!v22) && !(*(*(&v13)))) continue; v29 = *(&BSDoptarg); v28 = "Invalid number of requests \"%s\""; sshfatal("sftp.c", "main", 0x9eb, 0x0, 0x1, 0x0, *(&v30)); case 34: v19 = *(&BSDoptarg); replacearg(&v25, 0x0, "%s", v19); continue; case 48: global_aflag = 1; continue; case 49: if (batchmode) { v28 = "Batch file already specified."; sshfatal("sftp.c", "main", 0x9c8, 0x0, 0x1, 0x0, *(&v30)); } if (strcmp(*(&BSDoptarg), "-")) { sort_glob = fopen(*(&BSDoptarg), "r"); if (false) { v28 = *(&BSDoptarg); v27 = strerror(*(__errno_location())); v26 = "%s (%s)."; sshfatal("sftp.c", "main", 0x9cd, 0x0, 0x1, 0x0, *(&v30)); } } showprogress = 0; batchmode = 1; quiet = batchmode; addargs(&v25, "-obatchmode yes", &g_40a4f4); continue; case 53: global_fflag = 1; continue; case 59: v23 = strtonum(*(&BSDoptarg), 0x1, 0x6400000, &v16); if (*(&v16)) usage(); v23 = __mulvdi3(v23, 0x400); continue; case 63: global_pflag = 1; continue; case 64: v7 = 2; quiet = 1; showprogress = 0; addargs(&v25, "-%c", v8); continue; case 65: global_rflag = 1; continue; case 66: v18 = *(&BSDoptarg); break; case 69: if (v6 <= 2) { addargs(&v25, "-v", &g_40a4f4); v7 = __addvsi3(v6, 0x5); } v6 = __addvsi3(v6, 0x1); continue; default: usage(); } } } freeargs(&v25); v24 = do_init(*(&v1), *(&v2), v21, v22, v23); if (!v24) { v28 = "Couldn't initialise connection to server"; sshfatal("sftp.c", "main", 0xa45, 0x0, 0x1, 0x0, *(&v30)); } if (!quiet) { if (v20) fprintf(*(&stderr), "Attached to %s.\n", v20); else fprintf(*(&stderr), "Connected to %s.\n", v11); } v10 = interactive_loop(v24, v15, v17); shutdown(*(&v1), 0x2); shutdown(*(&v2), 0x2); close(*(&v1)); close(*(&v2)); if (batchmode) fclose(0x8bec7d8920ec8348); while (true) { if (!(waitpid(sshpid, NULL, 0x0) == -1) || !(sshpid > 1)) break; *(&v40) = *(__errno_location()); if (v40 == 4) continue; v29 = strerror(*(__errno_location())); v28 = "Couldn't wait for ssh process: %s"; sshfatal("sftp.c", "main", 0xa5c, 0x0, 0x1, 0x0, *(&v30)); } exit(v10); }
static void help(void) { printf("Available commands:\n" "bye Quit sftp\n" "cd path Change remote directory to 'path'\n" "chgrp [-h] grp path Change group of file 'path' to 'grp'\n" "chmod [-h] mode path Change permissions of file 'path' to 'mode'\n" "chown [-h] own path Change owner of file 'path' to 'own'\n" "copy oldpath newpath Copy remote file\n" "cp oldpath newpath Copy remote file\n" "df [-hi] [path] Display statistics for current directory or\n" " filesystem containing 'path'\n" "exit Quit sftp\n" "get [-afpR] remote [local] Download file\n" "help Display this help text\n" "lcd path Change local directory to 'path'\n" "lls [ls-options [path]] Display local directory listing\n" "lmkdir path Create local directory\n" "ln [-s] oldpath newpath Link remote file (-s for symlink)\n" "lpwd Print local working directory\n" "ls [-1afhlnrSt] [path] Display remote directory listing\n" "lumask umask Set local umask to 'umask'\n" "mkdir path Create remote directory\n" "progress Toggle display of progress meter\n" "put [-afpR] local [remote] Upload file\n" "pwd Display remote working directory\n" "quit Quit sftp\n" "reget [-fpR] remote [local] Resume download file\n" "rename oldpath newpath Rename remote file\n" "reput [-fpR] local [remote] Resume upload file\n" "rm path Delete remote file\n" "rmdir path Remove remote directory\n" "symlink oldpath newpath Symlink remote file\n" "version Show SFTP version\n" "!command Execute 'command' in local shell\n" "! Escape to local shell\n" "? Synonym for help\n"); }
void help(void) { printf( "Available commands:\nbye Quit sftp\ncd path Change remote directory to \'path\'\nchgrp [-h] grp path Change group of file \'path\' to \'grp\'\nchmod [-h] mode path Change permissions of file \'path\' to \'mode\'\nchown [-h] own path Change owner of file \'path\' to \'own\'\ncopy oldpath newpath Copy remote file\ncp oldpath newpath Copy remote file\ndf [-hi] [path] Display statistics for current directory or\n filesystem containing \'path\'\nexit Quit sftp\nget [-afpR] remote [local] Download file\nhelp Display this help text\nlcd path Change local directory to \'path\'\nlls [ls-options [path]] Display local directory listing\nlmkdir path Create local directory\nln [-s] oldpath newpath Link remote file (-s for symlink)\nlpwd Print local working directory\nls [-1afhlnrSt] [path] Display remote directory listing\nlumask umask Set local umask to \'umask\'\nmkdir path Create remote directory\nprogress Toggle display of progress meter\nput [-afpR] local [remote] Upload file\npwd Display remote working directory\nquit Quit sftp\nreget [-fpR] remote [local] Resume download file\nrename oldpath newpath Rename remote file\nreput [-fpR] local [remote] Resume upload file\nrm path Delete remote file\nrmdir path Remove remote directory\nsymlink oldpath newpath Symlink remote file\nversion Show SFTP version\n!command Execute \'command\' in local shell\n! Escape to local shell\n? Syn..." ); return; }
static void cleanup_expansion_error () { char *to_free; int old_verify; old_verify = hist_verify; hist_verify = 0; fprintf (rl_outstream, "\r\n"); to_free = pre_process_line (rl_line_buffer, 1, 0); hist_verify = old_verify; if (to_free != rl_line_buffer) do { if (to_free) sh_xfree((to_free), "bashline.c", 2723); } while (0); putc ('\r', rl_outstream); rl_forced_update_display (); }
void cleanup_expansion_error() { unsigned int v0; unsigned long long v1; unsigned long long v3; v0 = hist_verify; hist_verify = 0; fprintf(rl_outstream, "\r\n"); v1 = pre_process_line(rl_line_buffer, 0x1, 0x0); hist_verify = v0; if (v1 != rl_line_buffer && v1) sh_xfree(v1, "bashline.c", 0xaa3); putc(0xd, rl_outstream); v3 = rl_forced_update_display(); return; }
static _Bool valid_options (const struct cp_options *co) { ((void) sizeof (( ((unsigned int) (co->backup_type) <= numbered_backups) ) ? 1 : 0), __extension__ ({ if ( ((unsigned int) (co->backup_type) <= numbered_backups) ) ; else __assert_fail ( "VALID_BACKUP_TYPE (co->backup_type)" , "src/copy.c", 3087, __extension__ __PRETTY_FUNCTION__); })) ; ((void) sizeof (( ((co->sparse_mode) == SPARSE_NEVER || (co->sparse_mode) == SPARSE_AUTO || (co->sparse_mode) == SPARSE_ALWAYS) ) ? 1 : 0), __extension__ ({ if ( ((co->sparse_mode) == SPARSE_NEVER || (co->sparse_mode) == SPARSE_AUTO || (co->sparse_mode) == SPARSE_ALWAYS) ) ; else __assert_fail ( "VALID_SPARSE_MODE (co->sparse_mode)" , "src/copy.c", 3088, __extension__ __PRETTY_FUNCTION__); })) ; ((void) sizeof (( ((co->reflink_mode) == REFLINK_NEVER || (co->reflink_mode) == REFLINK_AUTO || (co->reflink_mode) == REFLINK_ALWAYS) ) ? 1 : 0), __extension__ ({ if ( ((co->reflink_mode) == REFLINK_NEVER || (co->reflink_mode) == REFLINK_AUTO || (co->reflink_mode) == REFLINK_ALWAYS) ) ; else __assert_fail ( "VALID_REFLINK_MODE (co->reflink_mode)" , "src/copy.c", 3089, __extension__ __PRETTY_FUNCTION__); })) ; ((void) sizeof (( !(co->hard_link && co->symbolic_link) ) ? 1 : 0), __extension__ ({ if ( !(co->hard_link && co->symbolic_link) ) ; else __assert_fail ( "!(co->hard_link && co->symbolic_link)" , "src/copy.c", 3090, __extension__ __PRETTY_FUNCTION__); })) ; ((void) sizeof (( ! (co->reflink_mode == REFLINK_ALWAYS && co->sparse_mode != SPARSE_AUTO) ) ? 1 : 0), __extension__ ({ if ( ! (co->reflink_mode == REFLINK_ALWAYS && co->sparse_mode != SPARSE_AUTO) ) ; else __assert_fail ( "! (co->reflink_mode == REFLINK_ALWAYS && co->sparse_mode != SPARSE_AUTO)" , "src/copy.c", 3091, __extension__ __PRETTY_FUNCTION__); })) ; return 1 ; }
int valid_options(struct_0 *a0) { if (a0->field_0 > 3) __assert_fail(); if (a0->field_c != 1 && a0->field_c != 2 && a0->field_c != 3) __assert_fail(); if (a0->field_44 && a0->field_44 != 1 && a0->field_44 != 2) __assert_fail(); if (!(a0->field_17 ^ 1) && !(a0->field_3a ^ 1)) __assert_fail(); if (a0->field_44 == 2 && a0->field_c != 2) __assert_fail(); return 1; }
int comment_handler (self, defs, arg) char *self; DEF_FILE *defs; char *arg; { return (0); }
long comment_handler() { return 0LL; }
int ssh_digest_buffer(int alg, const struct sshbuf *b, u_char *d, size_t dlen) { return ssh_digest_memory(alg, sshbuf_ptr(b), sshbuf_len(b), d, dlen); }
long long ssh_digest_buffer(unsigned long a0, unsigned long long a1, unsigned long long a2, unsigned int a3) { return ssh_digest_memory(a0, sshbuf_ptr(a1), sshbuf_len(a1), a2, a3); }
static int parse_command_args(struct arglist *arglist, union node **argpp, const char **path) { struct strlist *sp = arglist->list; char *cp, c; for (;;) { sp = __builtin_expect(!!(sp->next),0) ? sp->next : fill_arglist(arglist, argpp); if (!sp) return 0; cp = sp->text; if (*cp++ != '-') break; if (!(c = *cp++)) break; if (c == '-' && !*cp) { if (__builtin_expect(!!(!sp->next),1) && !fill_arglist(arglist, argpp)) return 0; sp = sp->next; break; } do { switch (c) { case 'p': *path = (defpathvar + 36); break; default: return 0; } } while ((c = *cp++)); } arglist->list = sp; return 0x04; }
undefined8 parse_command_args(long **param_1,undefined8 param_2,undefined8 *param_3) { long *plVar1; long lVar2; char local_19; long **local_18; char *local_10; local_18 = (long **)*param_1; while( true ) { if (*local_18 == (long *)0x0) { local_18 = (long **)fill_arglist(param_1,param_2); } else { local_18 = (long **)*local_18; } if (local_18 == (long **)0x0) { return 0; } plVar1 = local_18[1]; if (*(char *)plVar1 != '-') break; local_10 = (char *)((long)plVar1 + 2); local_19 = *(char *)((long)plVar1 + 1); if (local_19 == '\0') break; if ((local_19 == '-') && (*local_10 == '\0')) { if ((*local_18 == (long *)0x0) && (lVar2 = fill_arglist(param_1,param_2), lVar2 == 0)) { return 0; } local_18 = (long **)*local_18; break; } do { if (local_19 != 'p') { return 0; } *param_3 = &DAT_001031c4; local_19 = *local_10; local_10 = local_10 + 1; } while (local_19 != '\0'); } *param_1 = (long *)local_18; return 4; }
void client_filter_cleanup(struct ssh *ssh, int cid, void *ctx) { free(ctx); }
void client_filter_cleanup(long a1, long a2, void *a3) { free(a3); }
u_char * sys_tun_outfilter(struct ssh *ssh, struct Channel *c, u_char **data, size_t *dlen) { u_char *buf; u_int32_t af; int r; if ((r = sshbuf_get_string(c->output, data, dlen)) != 0) sshfatal("port-net.c", __func__, 362, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: buffer error: %s", __func__, ssh_err(r)); if (*dlen < sizeof(af)) return ( ((void *)0) ); buf = *data; *dlen -= sizeof(af); buf = *data + sizeof(af); return (buf); }
long long sys_tun_outfilter(unsigned long a0, struct_0 *a1, unsigned long long *a2, unsigned long long *a3) { unsigned long v0; unsigned long long *v1; unsigned long v2; unsigned int v3; unsigned long v4; void* v6; v2 = a0; v1 = a3; v3 = sshbuf_get_string(a1->field_70, a2, a3, a2); if (v3) { v0 = ssh_err(v3); sshfatal("port-net.c", "sys_tun_outfilter", 0x16a, 0x0, 0x1, 0x0, "%s: buffer error: %s", "sys_tun_outfilter"); } if (*(a3) <= 3) { v6 = 0; } else { v4 = *(a2); *(a3) = *(a3) - 4; v4 = *(a2) + 4; v6 = v4; } return v6; }
static void bridge_slave_parse_on_off(char *arg_name, char *arg_val, struct nlmsghdr *n, int type) { int ret; __u8 val = parse_on_off(arg_name, arg_val, &ret); if (ret) exit(1); addattr8(n, 1024, type, val); }
unsigned long bridge_slave_parse_on_off(long a1, long a2, long a3, unsigned int a4) { unsigned char v7; int v8; unsigned long v9; v9 = __readfsqword(0x28u); v7 = parse_on_off(a1, a2, &v8); if ( v8 ) exit(1); addattr8(a3, 1024LL, a4, v7); return __readfsqword(0x28u) ^ v9; }