input
stringlengths
28
169k
output
stringlengths
20
317k
char * line_fullname(char *dst, const char *src, u_int dstsize) { memset(dst, '\0', dstsize); if ((strncmp(src, "/dev/", 5) == 0) || (dstsize < (strlen(src) + 5))) strlcpy(dst, src, dstsize); else { strlcpy(dst, "/dev/", dstsize); strlcat(dst, src, dstsize); } return (dst); }
void * line_fullname(void *param_1,char *param_2,uint param_3) { int iVar1; size_t sVar2; memset(param_1,0,(ulong)param_3); iVar1 = strncmp(param_2,"/dev/",5); if ((iVar1 != 0) && (sVar2 = strlen(param_2), sVar2 + 5 <= (ulong)param_3)) { strlcpy(param_1,"/dev/",param_3); strlcat(param_1,param_2,param_3); return param_1; } strlcpy(param_1,param_2,param_3); return param_1; }
static void usage(const struct cmdinfo *cip, const char *value) { printf(gettext("Usage: %s [<option>...] <command>\n" "\n") , dpkg_get_progname()); printf(gettext("Commands:\n" " [--add] <file> add a diversion.\n" " --remove <file> remove the diversion.\n" " --list [<glob-pattern>] show file diversions.\n" " --listpackage <file> show what package diverts the file.\n" " --truename <file> return the diverted file.\n" "\n") ); printf(gettext("Options:\n" " --package <package> name of the package whose copy of <file> will not\n" " be diverted.\n" " --local all packages' versions are diverted.\n" " --divert <divert-to> the name used by other packages' versions.\n" " --rename actually move the file aside (or back).\n" " --no-rename do not move the file aside (or back) (default).\n" " --admindir <directory> set the directory with the diversions file.\n" " --instdir <directory> set the root directory, but not the admin dir.\n" " --root <directory> set the directory of the root filesystem.\n" " --test don't do anything, just demonstrate.\n" " --quiet quiet operation, minimal output.\n" " --help show this help message.\n" " --version show the version.\n" "\n") ); printf(gettext("When adding, default is --local and --divert <original>.distrib.\n" "When removing, --package or --local and --divert must match if specified.\n" "Package preinst/postrm scripts should always specify --package and --divert.\n") ); m_output( stdout , gettext("<standard output>")); exit(0); }
long long usage() { unsigned long v0; unsigned long v1; unsigned long v2; unsigned long v4; unsigned long v5; unsigned long v6; unsigned long long v7; unsigned long long v8; v2 = v4; v1 = v5; v0 = v6; v7 = dpkg_get_progname(); printf(gettext("Usage: %s [<option>...] <command>\n\n")); printf(gettext("Commands:\n [--add] <file> add a diversion.\n --remove <file> remove the diversion.\n --list [<glob-pattern>] show file diversions.\n --listpackage <file> show what package diverts the file.\n --truename <file> return the diverted file.\n\n")); printf(gettext("Options:\n --package <package> name of the package whose copy of <file> will not\n be diverted.\n --local all packages' versions are diverted.\n --divert <divert-to> the name used by other packages' versions.\n --rename actually move the file aside (or back).\n --no-rename do not move the file aside (or back) (default).\n --admindir <directory> set the directory with the diversions file.\n --instdir <directory> set the root directory, but not the admin dir.\n --root <directory> set the directory of the root filesystem.\n --test don't do anything, just demonstrate.\n --quiet quiet operation, minimal output.\n --help show this help message.\n --version show the version.\n\n")); printf(gettext("When adding, default is --local and --divert <original>.distrib.\nWhen removing, --package or --local and --divert must match if specified.\nPackage preinst/postrm scripts should always specify --package and --divert.\n")); v8 = gettext("<standard output>"); m_output(stdout, v8, v8); exit(0x0); }
int rl_digit_argument (int ignore, int key) { _rl_arg_init (); if ((rl_readline_state & (0x0080000))) { _rl_arg_dispatch (_rl_argcxt, key); rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg); return 0; } else { rl_execute_next (key); return (rl_digit_loop ()); } }
long rl_digit_argument(long a1, unsigned int a2) { rl_arg_init(); if ( (rl_readline_state & 0x80000) != 0 ) { rl_arg_dispatch(rl_argcxt, a2); rl_message("(arg: %d) ", (unsigned int)(rl_arg_sign * rl_numeric_arg)); return 0LL; } else { rl_execute_next(a2); return rl_digit_loop(); } }
void mklocal(char *name, int flags) { struct localvar *lvp; struct var **vpp; struct var *vp; ({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; }); lvp = ckmalloc(sizeof (struct localvar)); if (name[0] == '-' && name[1] == '\0') { char *p; p = ckmalloc(sizeof(optlist)); lvp->text = memcpy(p, optlist, sizeof(optlist)); vp = ((void *)0) ; } else { char *eq; vpp = hashvar(name); vp = *findvar(vpp, name); eq = strchr(name, '='); if (vp == ((void *)0) ) { if (eq) vp = setvareq(name, 0x04 | flags); else vp = setvar(name, ((void *)0) , 0x04 | flags); lvp->flags = 0x20; } else { lvp->text = vp->text; lvp->flags = vp->flags; vp->flags |= 0x04|0x08; if (eq) setvareq(name, flags); } } lvp->vp = vp; lvp->next = localvar_stack->lv; localvar_stack->lv = lvp; ({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; }); }
void mklocal(char a0[2], unsigned long a1) { void* v0; struct_0 *v1; void* v2; unsigned long long v3; unsigned long v4; unsigned long long v6; unsigned long long v7; unsigned long long v8; suppressint = suppressint + 1; v1 = ckmalloc(0x20); if (a0[0] == 45 && !a0[1]) { v2 = ckmalloc(0x11); v1->field_18 = memcpy(v2, &optlist, 0x11); v0 = 0; goto LABEL_400bbf; } v3 = hashvar(a0); v0 = *(findvar(v3, a0)); v4 = strchr(a0, 0x3d); if (!v0) { if (!v4) v0 = setvar(a0, NULL, a1 | 4); else v0 = setvareq(a0, a1 | 4); v1->field_10 = 32; } else { v1->field_18 = v0[16]; v1->field_10 = v0[8]; *(&v0[8]) = v0[8] | 12; if (v4) setvareq(a0, a1); } LABEL_400bbf: v1->field_8 = v0; v1->field_0 = g_1e88303e0c1fc4d; g_1e88303e0c1fc4d = v1; suppressint = suppressint - 1; v6 = suppressint; if (!suppressint) { v7 = intpending; if (intpending) v8 = onint(); } return; }
static void ip_short(uhash_ctx_t ahc, UINT8 *nh_res, u_char *res) { UINT64 t; UINT64 *nhp = (UINT64 *)nh_res; t = ip_aux(0,ahc->ip_keys, nhp[0]); put_u32((UINT32 *)res+0, ip_reduce_p36(t) ^ ahc->ip_trans[0]); t = ip_aux(0,ahc->ip_keys+4, nhp[1]); put_u32((UINT32 *)res+1, ip_reduce_p36(t) ^ ahc->ip_trans[1]); }
long ip_short(long a1, long *a2, long a3) { long v3; unsigned int v4; unsigned int v5; long v8; v3 = ip_aux(0LL, (_QWORD *)(a1 + 1160), *a2); v4 = ip_reduce_p36(v3); put_u32(a3, v4 ^ *(_DWORD *)(a1 + 1224)); v8 = ip_aux(0LL, (_QWORD *)(a1 + 1192), a2[1]); v5 = ip_reduce_p36(v8); return put_u32(a3 + 4, v5 ^ *(_DWORD *)(a1 + 1228)); }
static void print_neigh_state(unsigned int nud) { open_json_array(PRINT_JSON, is_json_context() ? "state" : ""); if (nud & 0x01) { nud &= ~0x01; print_string(PRINT_ANY, ((void *)0) , "%s ", "INCOMPLETE"); }; if (nud & 0x02) { nud &= ~0x02; print_string(PRINT_ANY, ((void *)0) , "%s ", "REACHABLE"); }; if (nud & 0x04) { nud &= ~0x04; print_string(PRINT_ANY, ((void *)0) , "%s ", "STALE"); }; if (nud & 0x08) { nud &= ~0x08; print_string(PRINT_ANY, ((void *)0) , "%s ", "DELAY"); }; if (nud & 0x10) { nud &= ~0x10; print_string(PRINT_ANY, ((void *)0) , "%s ", "PROBE"); }; if (nud & 0x20) { nud &= ~0x20; print_string(PRINT_ANY, ((void *)0) , "%s ", "FAILED"); }; if (nud & 0x40) { nud &= ~0x40; print_string(PRINT_ANY, ((void *)0) , "%s ", "NOARP"); }; if (nud & 0x80) { nud &= ~0x80; print_string(PRINT_ANY, ((void *)0) , "%s ", "PERMANENT"); }; close_json_array(PRINT_JSON, ((void *)0) ); }
void print_neigh_state(unsigned long a0) { unsigned int v0; unsigned long long v4; v0 = a0; open_json_array(0x2, (!is_json_context() ? "state" : &g_402c5e)); if ((v0 & 1)) { v0 &= -2; print_string(0x4, 0x0, "%s ", "INCOMPLETE"); } if ((v0 & 2)) { v0 &= -3; print_string(0x4, 0x0, "%s ", "REACHABLE"); } if ((v0 & 4)) { v0 &= -5; print_string(0x4, 0x0, "%s ", "STALE"); } if ((v0 & 8)) { v0 &= -9; print_string(0x4, 0x0, "%s ", "DELAY"); } if ((v0 & 16)) { v0 &= -17; print_string(0x4, 0x0, "%s ", "PROBE"); } if ((v0 & 32)) { v0 &= -33; print_string(0x4, 0x0, "%s ", "FAILED"); } if ((v0 & 64)) { v0 &= -65; print_string(0x4, 0x0, "%s ", "NOARP"); } if ((v0 & 128)) { v0 &= -129; print_string(0x4, 0x0, "%s ", "PERMANENT"); } v4 = close_json_array(0x2, 0x0); return; }
matches(*argv, "priority") == 0 || matches(*argv, "preference") == 0) { __u32 metric; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&metric, *argv, 0)) invarg("\"metric\" value is invalid\n", *argv); addattr32(&req.n, sizeof(req), IFA_RT_PRIORITY, metric); } else if (matches(*argv, "valid_lft") == 0) {
void matches(void) { halt_baddata(); }
static void opt_rename_setup(void) { if (opt_rename >= 0) return; opt_rename = 0; warning(gettext("please specify --no-rename explicitly, the default " "will change to --rename in 1.20.x") ); }
void opt_rename_setup(void) { undefined8 uVar1; if (opt_rename < 0) { opt_rename = 0; uVar1 = gettext( "please specify --no-rename explicitly, the default will change to --rename in 1.20.x" ); warning(uVar1); } return; }
char * mbschr (const char *s, int c) { char *pos; mbstate_t state; size_t strlength, mblength; if (locale_utf8locale && c < 0x80) return (utf8_mbschr (s, c)); if ((unsigned char)c >= '0' && locale_mb_cur_max > 1) { pos = (char *)s; memset (&state, '\0', sizeof(mbstate_t)); strlength = strlen (s); while (strlength > 0) { if (is_basic (*pos)) mblength = 1; else { mblength = mbrlen (pos, strlength, &state); if (mblength == (size_t)-2 || mblength == (size_t)-1 || mblength == (size_t)0) mblength = 1; } if (mblength == 1 && c == (unsigned char)*pos) return pos; strlength -= mblength; pos += mblength; } return ((char *) ((void *)0) ); } else return (strchr (s, c)); }
char * mbschr(char *a1, int a2) { char *v3; size_t n; size_t v5; mbstate_t s[2]; s[1] = (mbstate_t)__readfsqword(0x28u); if ( locale_utf8locale && a2 <= 127 ) return (char *)utf8_mbschr(a1, (unsigned int)a2); if ( (unsigned char)a2 <= 0x2Fu || locale_mb_cur_max <= 1 ) return strchr(a1, a2); v3 = a1; memset(s, 0, 8uLL); n = strlen(a1); while ( n ) { if ( (unsigned int)is_basic(*v3) ) { v5 = 1LL; } else { v5 = mbrlen(v3, n, s); if ( v5 == -2LL || v5 == -1LL || !v5 ) v5 = 1LL; } if ( v5 == 1 && a2 == (unsigned char)*v3 ) return v3; n -= v5; v3 += v5; } return 0LL; }
int mm_receive_fd(int sock) { struct msghdr msg; union { struct cmsghdr hdr; char buf[ (((( sizeof(int) ) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1)) + (((sizeof (struct cmsghdr)) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1))) ]; } cmsgbuf; struct cmsghdr *cmsg; struct iovec vec; ssize_t n; char ch; int fd; struct pollfd pfd; memset(&msg, 0, sizeof(msg)); vec.iov_base = &ch; vec.iov_len = 1; msg.msg_iov = &vec; msg.msg_iovlen = 1; memset(&cmsgbuf, 0, sizeof(cmsgbuf)); msg.msg_control = &cmsgbuf.buf; msg.msg_controllen = sizeof(cmsgbuf.buf); pfd.fd = sock; pfd.events = 0x001 ; while ((n = recvmsg(sock, &msg, 0)) == -1 && ( (*__errno_location ()) == 11 || (*__errno_location ()) == 4 )) { sshlog("monitor_fdpass.c", __func__, 147, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "recvmsg: %s", strerror( (*__errno_location ()) )); (void)poll(&pfd, 1, -1); } if (n == -1) { sshlog("monitor_fdpass.c", __func__, 151, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "recvmsg: %s", strerror( (*__errno_location ()) )); return -1; } if (n != 1) { sshlog("monitor_fdpass.c", __func__, 156, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "recvmsg: expected received 1 got %zd", n); return -1; } cmsg = ((size_t) ( &msg )->msg_controllen >= sizeof (struct cmsghdr) ? (struct cmsghdr *) ( &msg )->msg_control : (struct cmsghdr *) 0) ; if (cmsg == ((void *)0) ) { sshlog("monitor_fdpass.c", __func__, 168, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "no message header"); return -1; } if (cmsg->cmsg_type != SCM_RIGHTS ) { sshlog("monitor_fdpass.c", __func__, 174, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "expected %d got %d", SCM_RIGHTS , cmsg->cmsg_type); return -1; } fd = (*(int *) (( cmsg )->__cmsg_data) ); return fd; }
long long mm_receive_fd(unsigned long a0) { unsigned long long v0; char v1; unsigned int v2; unsigned long long v3; void* v4; unsigned int v5; unsigned short v6; unsigned long v7; unsigned long long v8; char v9; unsigned long v10; unsigned long long v11; void* v12; unsigned long long v13; char v14; void* v18; unsigned long long v19; memset(&v9, 0x0, 0x38); v7 = &v1; v8 = 1; v10 = &v7; v11 = 1; memset(&v14, 0x0, 0x18); v12 = &v14; v13 = 24; v5 = a0; v6 = 1; while (true) { v3 = recvmsg(a0, &v9, 0x0, &v9); if (v3 != -1) break; if (*(__errno_location()) != 11 && *(__errno_location()) != 4) break; v0 = strerror(*(__errno_location())); sshlog("monitor_fdpass.c", "mm_receive_fd", 0x93, 0x1, 0x7, 0x0, "recvmsg: %s", v0); poll(&v5, 0x1, 0xffffffff); } if (v3 == -1) { sshlog("monitor_fdpass.c", "mm_receive_fd", 0x97, 0x1, 0x2, 0x0, "recvmsg: %s", strerror(*(__errno_location()))); v19 = 4294967295; } else if (v3 != 1) { sshlog("monitor_fdpass.c", "mm_receive_fd", 0x9c, 0x1, 0x2, 0x0, "recvmsg: expected received 1 got %zd", v3); v19 = 4294967295; } else { if (v13 <= 15) v18 = 0; else v18 = v12; v4 = v18; if (!v4) { sshlog("monitor_fdpass.c", "mm_receive_fd", 0xa8, 0x1, 0x2, 0x0, "no message header", v0); v19 = 4294967295; } else if (v4[12] == 1) { v2 = v4[16]; v19 = v2; } else { sshlog("monitor_fdpass.c", "mm_receive_fd", 0xae, 0x1, 0x2, 0x0, "expected %d got %d", 0x1); v19 = 4294967295; } } return v19; }
static int history_def_del(void *p, HistEventW *ev __attribute__((__unused__)), const int num) { history_t *h = (history_t *) p; if (history_def_set(h, ev, num) != 0) return -1; ev->str = wcsdup(h->cursor->ev.str); ev->num = h->cursor->ev.num; history_def_delete(h, ev, h->cursor); return 0; }
long long history_def_del(struct_1 *a0, struct_0 *a1, unsigned long a2) { unsigned long long v1; if (history_def_set(a0, a1, a2)) { v1 = 4294967295; } else { a1->field_8 = wcsdup(a0->field_28->field_8); a1->field_0 = a0->field_28->field_0; history_def_delete(a0, a1, a0->field_28); v1 = 0; } return v1; }
void _rl_term_executing_keyseq (void) { rl_executing_keyseq[rl_key_sequence_length] = '\0'; }
long long _rl_term_executing_keyseq() { *((rl_key_sequence_length + rl_executing_keyseq)) = 0; return rl_key_sequence_length + rl_executing_keyseq; }
const char *strxf_xfrmproto(__u8 proto) { static char str[16]; int i; for (i = 0; ; i++) { const struct typeent *t = &xfrmproto_types[i]; if (!t->t_name || t->t_type == -1) break; if (t->t_type == proto) return t->t_name; } sprintf(str, "%u", proto); return str; }
undefined1 * strxf_xfrmproto(byte param_1) { long lVar1; int local_14; local_14 = 0; while( true ) { lVar1 = (long)local_14 * 0x10; if ((*(long *)(xfrmproto_types + lVar1) == 0) || (*(int *)(xfrmproto_types + lVar1 + 8) == -1)) break; if (*(uint *)(xfrmproto_types + lVar1 + 8) == (uint)param_1) { return *(undefined1 **)(xfrmproto_types + lVar1); } local_14 = local_14 + 1; } sprintf(str_9239,"%u",(ulong)param_1); return str_9239; }
_Bool *changed); static void fail_exit (int code) { if (spw_locked) { if (spw_unlock () == 0) { fprintf ( stderr , gettext ("%s: failed to unlock %s\n"), Prog, spw_dbname ()); if (use_system_spw_file) { do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 3 , "failed to unlock %s", spw_dbname ()) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; } } } if (pw_locked) { if (pw_unlock () == 0) { fprintf ( stderr , gettext ("%s: failed to unlock %s\n"), Prog, pw_dbname ()); if (use_system_pw_file) { do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 3 , "failed to unlock %s", pw_dbname ()) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; } } } closelog (); exit (code); }
void fail_exit(int param_1) { int iVar1; undefined8 uVar2; char *pcVar3; undefined8 uVar4; char *local_38; char *local_30; if (spw_locked != '\0') { iVar1 = spw_unlock(); if (iVar1 == 0) { uVar2 = spw_dbname(); uVar4 = Prog; pcVar3 = (char *)gettext("%s: failed to unlock %s\n"); fprintf(stderr,pcVar3,uVar4,uVar2); if (use_system_spw_file != '\0') { pcVar3 = setlocale(6,(char *)0x0); local_38 = (char *)0x0; if (pcVar3 != (char *)0x0) { local_38 = strdup(pcVar3); } if (local_38 != (char *)0x0) { setlocale(6,"C"); } uVar4 = spw_dbname(); syslog(3,"failed to unlock %s",uVar4); if (local_38 != (char *)0x0) { setlocale(6,local_38); free(local_38); } } } } if (pw_locked != '\0') { iVar1 = pw_unlock(); if (iVar1 == 0) { uVar2 = pw_dbname(); uVar4 = Prog; pcVar3 = (char *)gettext("%s: failed to unlock %s\n"); fprintf(stderr,pcVar3,uVar4,uVar2); if (use_system_pw_file != '\0') { pcVar3 = setlocale(6,(char *)0x0); local_30 = (char *)0x0; if (pcVar3 != (char *)0x0) { local_30 = strdup(pcVar3); } if (local_30 != (char *)0x0) { setlocale(6,"C"); } uVar4 = pw_dbname(); syslog(3,"failed to unlock %s",uVar4); if (local_30 != (char *)0x0) { setlocale(6,local_30); free(local_30); } } } } closelog(); exit(param_1); }
static void check_root(e2fsck_t ctx) { ext2_filsys fs = ctx->fs; blk64_t blk; struct ext2_inode_large inode; struct ext2_inode *iptr = (struct ext2_inode *) &inode; char * block; struct problem_context pctx; clear_problem_context(&pctx); if (ext2fs_test_inode_bitmap2(ctx->inode_used_map, 2)) { if (!(ext2fs_test_inode_bitmap2(ctx->inode_dir_map, 2))) { fix_problem(ctx, 0x030014, &pctx); ctx->flags |= 0x0001; } return; } if (!fix_problem(ctx, 0x030001, &pctx)) { fix_problem(ctx, 0x030015, &pctx); ctx->flags |= 0x0001; return; } e2fsck_read_bitmaps(ctx); if (ctx->root_repair_block) { blk = ctx->root_repair_block; ctx->root_repair_block = 0; goto skip_new_block; } pctx.errcode = ext2fs_new_block2(fs, 0, ctx->block_found_map, &blk); if (pctx.errcode) { pctx.str = "ext2fs_new_block"; fix_problem(ctx, 0x030012, &pctx); ctx->flags |= 0x0001; return; } ext2fs_mark_block_bitmap2(ctx->block_found_map, blk); skip_new_block: ext2fs_mark_block_bitmap2(fs->block_map, blk); ext2fs_mark_bb_dirty(fs); memset(&inode, 0, sizeof(inode)); inode.i_mode = 040755; inode.i_size = fs->blocksize; inode.i_atime = inode.i_ctime = inode.i_mtime = ctx->now; inode.i_links_count = 2; ext2fs_iblk_set(fs, iptr, 1); inode.i_block[0] = blk; inode.i_extra_isize = sizeof(struct ext2_inode_large) - 128; pctx.errcode = ext2fs_write_new_inode(fs, 2, iptr); if (pctx.errcode) { pctx.str = "ext2fs_write_inode"; fix_problem(ctx, 0x030012, &pctx); ctx->flags |= 0x0001; return; } pctx.errcode = ext2fs_new_dir_block(fs, 2, 2, &block); if (pctx.errcode) { pctx.str = "ext2fs_new_dir_block"; fix_problem(ctx, 0x030012, &pctx); ctx->flags |= 0x0001; return; } pctx.errcode = ext2fs_write_dir_block4(fs, blk, block, 0, 2); ext2fs_free_mem(&block); if (pctx.errcode) { pctx.str = "ext2fs_write_dir_block4"; fix_problem(ctx, 0x030012, &pctx); ctx->flags |= 0x0001; return; } e2fsck_add_dir_info(ctx, 2, 2); ext2fs_icount_store(ctx->inode_count, 2, 2); ext2fs_icount_store(ctx->inode_link_info, 2, 2); ext2fs_mark_inode_bitmap2(ctx->inode_used_map, 2); ext2fs_mark_inode_bitmap2(ctx->inode_dir_map, 2); ext2fs_mark_inode_bitmap2(fs->inode_map, 2); ext2fs_mark_ib_dirty(fs); quota_data_add(ctx->qctx, &inode, 2, ((1 << 10) << (fs->super)->s_log_cluster_size)); quota_data_inodes(ctx->qctx, &inode, 2, +1); }
unsigned long check_root(long a1) { long v2; long v3; long v4; int *v5; long v6[12]; const char *v7; int s[42]; unsigned long v9; v9 = __readfsqword(0x28u); v4 = *(_QWORD *)a1; v5 = s; clear_problem_context(v6); if ( (unsigned int)ext2fs_test_inode_bitmap2(*(_QWORD *)(a1 + 360), 2LL) ) { if ( !(unsigned int)ext2fs_test_inode_bitmap2(*(_QWORD *)(a1 + 376), 2LL) ) { fix_problem(a1, 196628LL, v6); *(_DWORD *)(a1 + 72) |= 1u; } } else if ( (unsigned int)fix_problem(a1, 196609LL, v6) ) { e2fsck_read_bitmaps(a1); if ( *(_QWORD *)(a1 + 888) ) { v2 = *(_QWORD *)(a1 + 888); *(_QWORD *)(a1 + 888) = 0LL; } else { v6[0] = ext2fs_new_block2(v4, 0LL, *(_QWORD *)(a1 + 416), &v2); if ( v6[0] ) { v7 = "ext2fs_new_block"; fix_problem(a1, 196626LL, v6); *(_DWORD *)(a1 + 72) |= 1u; return __readfsqword(0x28u) ^ v9; } ext2fs_mark_block_bitmap2(*(_QWORD *)(a1 + 416), v2); } ext2fs_mark_block_bitmap2(*(_QWORD *)(v4 + 88), v2); ext2fs_mark_bb_dirty(v4); memset(s, 0, 0xA0uLL); LOWORD(s[0]) = 16877; s[1] = *(_DWORD *)(v4 + 40); s[4] = *(_QWORD *)(a1 + 840); s[3] = s[4]; s[2] = s[4]; HIWORD(s[6]) = 2; ext2fs_iblk_set(v4, v5, 1LL); s[10] = v2; LOWORD(s[32]) = 32; v6[0] = ext2fs_write_new_inode(v4, 2LL, v5); if ( v6[0] ) { v7 = "ext2fs_write_inode"; fix_problem(a1, 196626LL, v6); *(_DWORD *)(a1 + 72) |= 1u; } else { v6[0] = ext2fs_new_dir_block(v4, 2LL, 2LL, &v3); if ( v6[0] ) { v7 = "ext2fs_new_dir_block"; fix_problem(a1, 196626LL, v6); *(_DWORD *)(a1 + 72) |= 1u; } else { v6[0] = ext2fs_write_dir_block4(v4, v2, v3, 0LL, 2LL); ext2fs_free_mem(&v3); if ( v6[0] ) { v7 = "ext2fs_write_dir_block4"; fix_problem(a1, 196626LL, v6); *(_DWORD *)(a1 + 72) |= 1u; } else { e2fsck_add_dir_info(a1, 2LL, 2LL); ext2fs_icount_store(*(_QWORD *)(a1 + 440), 2LL, 2LL); ext2fs_icount_store(*(_QWORD *)(a1 + 448), 2LL, 2LL); ext2fs_mark_inode_bitmap2(*(_QWORD *)(a1 + 360), 2LL); ext2fs_mark_inode_bitmap2(*(_QWORD *)(a1 + 376), 2LL); ext2fs_mark_inode_bitmap2(*(_QWORD *)(v4 + 80), 2LL); ext2fs_mark_ib_dirty(v4); quota_data_add(*(_QWORD *)(a1 + 632), s, 2LL, 1024 << *(_DWORD *)(*(_QWORD *)(v4 + 32) + 28LL)); quota_data_inodes(*(_QWORD *)(a1 + 632), s, 2LL, 1LL); } } } } else { fix_problem(a1, 196629LL, v6); *(_DWORD *)(a1 + 72) |= 1u; } return __readfsqword(0x28u) ^ v9; }
static void reply_ok(struct sshbuf *reply, u_int rid) { int r; if ((r = sshbuf_put_u32(reply, 0x80000001)) != 0 || (r = sshbuf_put_u32(reply, rid)) != 0) sshfatal("mux.c", __func__, 317, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "reply"); }
void reply_ok(unsigned long long a0, unsigned long a1) { unsigned int v0; unsigned long long v3; v0 = sshbuf_put_u32(a0, 0x80000001); if (!v0) { v0 = sshbuf_put_u32(a0, a1); if (!v0) goto LABEL_400884; } v3 = sshfatal("mux.c", "reply_ok", 0x13d, 0x1, 0x1, ssh_err(v0), "reply"); LABEL_400884: return; }
static struct tempnode * maybe_create_temp (FILE **pfp, _Bool survive_fd_exhaustion) { int tempfd; struct tempnode *node = create_temp_file (&tempfd, survive_fd_exhaustion); if (! node) return ((void *)0) ; node->state = UNCOMPRESSED; if (compress_program) { int pipefds[2]; node->pid = pipe_fork (pipefds, MAX_FORK_TRIES_COMPRESS); if (0 < node->pid) { close (tempfd); close (pipefds[0]); tempfd = pipefds[1]; register_proc (node); } else if (node->pid == 0) { close (pipefds[1]); move_fd (tempfd, 1 ); move_fd (pipefds[0], 0 ); execlp (compress_program, compress_program, (char *) ((void *)0) ); async_safe_die ( (*__errno_location ()) , "couldn't execute compress program"); } } *pfp = fdopen (tempfd, "w"); if (! *pfp) sort_die (gettext ("couldn't create temporary file"), node->name); return node; }
long * maybe_create_temp(FILE **a1, char a2) { int v3; int *v4; char *v5; char *v6; int fd; long *v8; int v9; int v10; unsigned long v11; v11 = __readfsqword(0x28u); v8 = create_temp_file(&fd, a2); if ( !v8 ) return 0LL; *((_BYTE *)v8 + 12) = 0; if ( compress_program ) { v3 = pipe_fork(&v9, 4LL); *((_DWORD *)v8 + 2) = v3; if ( *((int *)v8 + 2) <= 0 ) { if ( !*((_DWORD *)v8 + 2) ) { close(v10); move_fd(fd, 1); move_fd(v9, 0); execlp(compress_program, compress_program, 0LL); v4 = _errno_location(); async_safe_die(*v4, "couldn't execute compress program"); } } else { close(fd); close(v9); fd = v10; register_proc((long)v8); } } *a1 = fdopen(fd, "w"); if ( !*a1 ) { v5 = (char *)v8 + 13; v6 = gettext("couldn't create temporary file"); sort_die(v6, v5); } return v8; }
static __inline void _rs_rekey(unsigned char *dat, size_t datlen) { chacha_encrypt_bytes(&rsx->rs_chacha, rsx->rs_buf, rsx->rs_buf, sizeof(rsx->rs_buf)); if (dat) { size_t i, m; m = ((datlen) < (32 + 8) ? (datlen) : (32 + 8)); for (i = 0; i < m; i++) rsx->rs_buf[i] ^= dat[i]; } _rs_init(rsx->rs_buf, 32 + 8); memset(rsx->rs_buf, 0, 32 + 8); rs->rs_have = sizeof(rsx->rs_buf) - 32 - 8; }
void _rs_rekey(void* a0, unsigned long long a1) { void* v0; unsigned long long v1; unsigned long long v3; unsigned long long *v4; chacha_encrypt_bytes(rsx, rsx + 64, rsx + 64, 0x400); if (a0) { if (a1 > 40) v3 = 40; else v3 = a1; v1 = v3; for (v0 = 0; v0 < v1; v0 += 1) { *(64 + v0 + rsx) = *(64 + v0 + rsx) ^ *((v0 + a0)); } } _rs_init(rsx + 64, 0x28); memset(rsx + 64, 0x0, 0x28); v4 = rs; *(rs) = 984; return; }
static rsRetVal changeToNs(instanceData *const pData __attribute__((unused))) { rsRetVal iRet = RS_RET_OK; int iErr; int destinationNs = -1; char *nsPath = ((void *)0) ; if(pData->networkNamespace) { pData->originalNamespace = open("/proc/self/ns/net", 00 ); if (pData->originalNamespace < 0) { LogError(0, RS_RET_IO_ERROR, "omfwd: could not read /proc/self/ns/net"); do { iRet = RS_RET_IO_ERROR; goto finalize_it; } while (0); } if (asprintf(&nsPath, "/var/run/netns/%s", pData->networkNamespace) == -1) { LogError(0, RS_RET_OUT_OF_MEMORY, "omfwd: asprintf failed"); do { iRet = RS_RET_OUT_OF_MEMORY; goto finalize_it; } while (0); } destinationNs = open(nsPath, 0); if (destinationNs < 0) { LogError(0, RS_RET_IO_ERROR, "omfwd: could not change to namespace '%s'", pData->networkNamespace); do { iRet = RS_RET_IO_ERROR; goto finalize_it; } while (0); } if((iErr = (setns(destinationNs, 0x40000000 ))) != 0) { LogError(0, RS_RET_IO_ERROR, "could not change to namespace '%s': %s", pData->networkNamespace, gai_strerror(iErr)); do { iRet = RS_RET_IO_ERROR; goto finalize_it; } while (0); } r_dbgprintf("omfwd.c", "omfwd: changed to network namespace '%s'\n", pData->networkNamespace); } finalize_it: free(nsPath); if(destinationNs >= 0) { close(destinationNs); } return iRet; }
int changeToNs(struct_0 *a0, unsigned long a1, unsigned long a2) { unsigned int v0; unsigned int v1; unsigned int v2; void* v3; v0 = 0; v1 = -1; v3 = 0; if (a0->field_80) { a0->field_88 = open("/proc/self/ns/net", 0x0, a2); if (a0->field_88 < 0) { LogError(0x0, 0xfffff815, "omfwd: could not read /proc/self/ns/net"); v0 = -2027; } else if (asprintf(&v3, "/var/run/netns/%s", a0->field_80) == -1) { LogError(0x0, 0xfffffffa, "omfwd: asprintf failed"); v0 = -6; } else { v1 = open(v3, 0x0, a0->field_80); if (v1 < 0) { LogError(0x0, 0xfffff815, "omfwd: could not change to namespace '%s'"); v0 = -2027; } else { v2 = setns(v1, 0x40000000); if (!v2) { r_dbgprintf("omfwd.c", "omfwd: changed to network namespace '%s'\n"); } else { gai_strerror(v2); LogError(0x0, 0xfffff815, "could not change to namespace '%s': %s"); v0 = -2027; } } } } free(v3); if (v1 >= 0) close(v1); return v0; }
static int get_uid(const char *token, uid_t *uid_p) { struct passwd *passwd; if (get_id(token, uid_p) == 0) return 0; (*__errno_location ()) = 0; passwd = getpwnam(token); if (passwd) { *uid_p = passwd->pw_uid; return 0; } if ( (*__errno_location ()) == 0) (*__errno_location ()) = 22 ; return -1; }
int get_uid(char *a0, unsigned int *a1) { struct_0 *v0; unsigned int v2; v2 = get_id(a0, a1); if (!v2) { v2 = 0; } else { *(__errno_location()) = 0; v0 = &getpwnam(a0)->pw_name; if (v0) { *(a1) = v0->field_10; v2 = 0; } else { v2 = *(__errno_location()); if (!v2) *(__errno_location()) = 22; v2 = -1; } } return v2; }
static _Bool elide_tail_lines_pipe (char const *filename, int fd, uintmax_t n_elide, off_t current_pos) { struct linebuffer { char buffer[ 8192 + 1]; size_t nbytes; size_t nlines; struct linebuffer *next; }; uintmax_t desired_pos = current_pos; typedef struct linebuffer LBUFFER; LBUFFER *first, *last, *tmp; size_t total_lines = 0; _Bool ok = 1 ; size_t n_read; first = last = xmalloc (sizeof (LBUFFER)); first->nbytes = first->nlines = 0; first->next = ((void *)0) ; tmp = xmalloc (sizeof (LBUFFER)); while ( 1 ) { n_read = safe_read (fd, tmp->buffer, 8192 ); if (n_read == 0 || n_read == ((size_t) -1)) break; if (! n_elide) { desired_pos += n_read; xwrite_stdout (tmp->buffer, n_read); continue; } tmp->nbytes = n_read; tmp->nlines = 0; tmp->next = ((void *)0) ; { char *buffer_end = tmp->buffer + n_read; *buffer_end = line_end; char const *p = tmp->buffer; while ((p = rawmemchr (p, line_end)) < buffer_end) { ++p; ++tmp->nlines; } } total_lines += tmp->nlines; if (tmp->nbytes + last->nbytes < 8192 ) { memcpy (&last->buffer[last->nbytes], tmp->buffer, tmp->nbytes); last->nbytes += tmp->nbytes; last->nlines += tmp->nlines; } else { last = last->next = tmp; if (n_elide < total_lines - first->nlines) { desired_pos += first->nbytes; xwrite_stdout (first->buffer, first->nbytes); tmp = first; total_lines -= first->nlines; first = first->next; } else tmp = xmalloc (sizeof (LBUFFER)); } } free (tmp); if (n_read == ((size_t) -1)) { error (0, (*__errno_location ()) , gettext ("error reading %s"), quotearg_style (shell_escape_always_quoting_style, filename)); ok = 0 ; goto free_lbuffers; } if (last->nbytes && last->buffer[last->nbytes - 1] != line_end) { ++last->nlines; ++total_lines; } for (tmp = first; n_elide < total_lines - tmp->nlines; tmp = tmp->next) { desired_pos += tmp->nbytes; xwrite_stdout (tmp->buffer, tmp->nbytes); total_lines -= tmp->nlines; } if (n_elide < total_lines) { size_t n = total_lines - n_elide; char const *buffer_end = tmp->buffer + tmp->nbytes; char const *p = tmp->buffer; while (n && (p = memchr (p, line_end, buffer_end - p))) { ++p; ++tmp->nlines; --n; } desired_pos += p - tmp->buffer; xwrite_stdout (tmp->buffer, p - tmp->buffer); } free_lbuffers: while (first) { tmp = first->next; free (first); first = tmp; } if (0 <= current_pos && elseek (fd, desired_pos, 0 , filename) < 0) ok = 0 ; return ok; }
void elide_tail_lines_pipe(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long a3) { char v0; unsigned long v1; struct_0 *v2; struct_0 *v3; struct_0 *v4; void* v5; struct_0 *v6; unsigned long v7; struct_0 *v8; unsigned long v9; char *v10; unsigned long v11; unsigned long long v12; unsigned long long v13; char v14; unsigned long long v16; unsigned long long v17; unsigned long long v18; unsigned long long v20; unsigned long long v21; unsigned long long v22; unsigned long long v23; v13 = v16; v12 = v17; v1 = a3; v5 = 0; v0 = 1; v3 = xmalloc(0x2020); v2 = v3; v2->field_2010 = 0; v2->field_2008 = v2->field_2010; v2->field_2018 = 0; v4 = xmalloc(0x2020); while (true) { v9 = safe_read(a1, v4, 0x2000, v4); if (!v9) break; if (v9 == -1) break; if (!a2) { v1 += v9; xwrite_stdout(v4, v9); } else { v4->field_2008 = v9; v4->field_2010 = 0; v4->field_2018 = 0; v10 = &(&v4->field_0)[v9]; *(v10) = line_end; v6 = v4; while (true) { v6 = rawmemchr(v6, line_end); if (v6 >= v10) break; v6 = &v6->padding_1; v4->field_2010 = v4->field_2010 + 1; } v5 += v4->field_2010; if (v3->field_2008 + v4->field_2008 <= 8191) { memcpy(&(&v3->field_0)[v3->field_2008], v4, v4->field_2008); v3->field_2008 = v3->field_2008 + v4->field_2008; v3->field_2010 = v3->field_2010 + v4->field_2010; continue; } else { v3->field_2018 = v4; v3 = v3->field_2018; if (a2 < v5 - v2->field_2010) { v1 += v2->field_2008; xwrite_stdout(v2, v2->field_2008); v4 = v2; v5 -= v2->field_2010; v2 = v2->field_2018; continue; } else { v4 = xmalloc(0x2020); } } } } free(v4); if (v9 == -1) { v18 = quotearg_style(0x4, a0); error(0x0, *(__errno_location()), gettext("error reading %s")); v0 = 0; } else { if (v3->field_2008 && v3->padding_1[v3->field_2008] != line_end) { v3->field_2010 = v3->field_2010 + 1; v5 += 1; } for (v4 = v2; a2 < v5 - v4->field_2010; v4 = v4->field_2018) { v1 += v4->field_2008; xwrite_stdout(v4, v4->field_2008); v5 -= v4->field_2010; } if (a2 < v5) { v7 = v5 - a2; v11 = &(&v4->field_0)[v4->field_2008]; for (v8 = v4; v7; v7 -= 1) { v8 = memchr(v8, line_end, v11 + -0x1 * v8); if (!v8) break; v8 = &v8->padding_1; v4->field_2010 = v4->field_2010 + 1; } *(&v1) = v1 + v8 - v4; xwrite_stdout(v4, v8 - v4); } } for (; v2; v2 = v4) { v4 = v2->field_2018; free(v2); } if (!((a3 - 0 >> 63)) && elseek(a1, *(&v1), 0x0, a0) < 0) v0 = 0; v20 = v0; v21 = v12; v22 = v13; v23 = *(&v14); return; }
void rl_replace_line(const char * text, int clear_undo __attribute__((__unused__))) { if (!text || *text == 0) return; if (h == ((void *)0) || e == ((void *)0) ) rl_initialize(); el_replacestr(e, text); }
long long rl_replace_line(char *a0, unsigned long a1) { unsigned int v0; unsigned long long v2; v0 = a1; if (a0) { v2 = *(a0); if (*(a0)) { if (!h || !e) rl_initialize(); v2 = el_replacestr(e, a0, a0); } } return v2; }
static void fixedtables(state) struct inflate_state *state; { static const code lenfix[512] = { {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48}, {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128}, {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59}, {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176}, {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20}, {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100}, {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8}, {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216}, {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76}, {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114}, {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2}, {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148}, {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42}, {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86}, {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15}, {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236}, {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62}, {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142}, {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31}, {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162}, {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25}, {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105}, {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4}, {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202}, {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69}, {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125}, {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13}, {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195}, {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35}, {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91}, {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19}, {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246}, {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55}, {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135}, {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99}, {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190}, {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16}, {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96}, {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6}, {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209}, {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72}, {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116}, {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4}, {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153}, {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44}, {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82}, {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11}, {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229}, {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58}, {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138}, {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51}, {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173}, {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30}, {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110}, {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0}, {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195}, {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65}, {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121}, {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9}, {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258}, {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37}, {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93}, {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23}, {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251}, {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51}, {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131}, {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67}, {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183}, {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23}, {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103}, {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9}, {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223}, {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79}, {0,9,255} }; static const code distfix[32] = { {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025}, {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193}, {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385}, {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577}, {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073}, {22,5,193},{64,5,0} }; state->lencode = lenfix; state->lenbits = 9; state->distcode = distfix; state->distbits = 5; }
long fixedtables(long a1) { long result; *(_QWORD *)(a1 + 104) = &lenfix_3277; *(_DWORD *)(a1 + 120) = 9; *(_QWORD *)(a1 + 112) = &distfix_3278; result = a1; *(_DWORD *)(a1 + 124) = 5; return result; }
intmax_t lookupvarint(const char *name) { return atomax(lookupvar(name) ?: nullstr, 0); }
long long lookupvarint(unsigned long long a0) { unsigned long long v1; v1 = lookupvar(a0); if (!v1) { v1 = &nullstr; return atomax(v1, 0x0); } return atomax(v1, 0x0); }
static _Bool parse_follow (const struct parser_table* entry, char **argv, int *arg_ptr) { set_follow_state (SYMLINK_ALWAYS_DEREF); return parse_noop (entry, argv, arg_ptr); }
long long parse_follow(unsigned long long a0, unsigned long long a1, unsigned long long a2) { set_follow_state(0x1); return parse_noop(a0, a1, a2); }
static inline __u32 rta_getattr_u32(const struct rtattr *rta) { return *(__u32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); }
int rta_getattr_u32(struct_0 *a0) { return a0->field_4; }
static rsRetVal TCPSendBuf(wrkrInstanceData_t *pWrkrData, uchar *buf, unsigned len, sbool bIsFlush) { rsRetVal iRet = RS_RET_OK; if(pWrkrData->pData->compressionMode >= 2) iRet = TCPSendBufCompressed(pWrkrData, buf, len, bIsFlush); else iRet = TCPSendBufUncompressed(pWrkrData, buf, len); return iRet; }
undefined4 TCPSendBuf(long *param_1,undefined8 param_2,undefined4 param_3,char param_4) { undefined4 local_c; if (*(byte *)(*param_1 + 0xcc) < 2) { local_c = TCPSendBufUncompressed(param_1,param_2,param_3); } else { local_c = TCPSendBufCompressed(param_1,param_2,param_3,(int)param_4); } return local_c; }
static struct index_node *index_create(void) { struct index_node *node; node = (calloc(sizeof(struct index_node), 1)); node->prefix = (strdup("")); node->first = 128; return node; }
int index_create() { struct_0 *v0; v0 = calloc(0x418, 0x1); v0->field_0 = strdup(&g_4004fd); v0->field_10 = 128; return v0; }
static int get_range(bitstr_t * bits, int low, int high, const char *names[], FILE * file) { int ch, i, num1, num2, num3; num3 = 1; range_state_t state = R_START; while (state != R_FINISH && ((ch = get_char(file)) != (-1) )) { switch (state) { case R_START: if (ch == '*') { num1 = low; num2 = high; state = R_AST; break; } if (ch == '~') { num1 = low; state = R_RANDOM; break; } unget_char(ch, file); if (get_number(&num1, low, names, file) != (-1) ) { state = R_NUM1; break; } return ( (-1) ); case R_AST: if (ch == '/') { state = R_STEP; break; } if (is_separator(ch)) { state = R_FINISH; break; } return ( (-1) ); case R_STEP: unget_char(ch, file); if (get_number(&num3, 0, ((const char **) ((void *)0) ), file) != (-1) && num3 != 0) { state = R_TERMS; break; } return ( (-1) ); case R_TERMS: if (is_separator(ch)) { state = R_FINISH; break; } return ( (-1) ); case R_NUM1: if (ch == '-') { state = R_RANGE; break; } if (ch == '~') { state = R_RANDOM; break; } if (is_separator(ch)) { num2 = num1; state = R_FINISH; break; } return ( (-1) ); case R_RANGE: unget_char(ch, file); if (get_number(&num2, low, names, file) != (-1) ) { state = R_RANGE_NUM2; break; } return ( (-1) ); case R_RANGE_NUM2: if (ch == '/') { state = R_STEP; break; } if (is_separator(ch)) { state = R_FINISH; break; } return ( (-1) ); case R_RANDOM: if (is_separator(ch)) { num2 = high; state = R_FINISH; } else if (unget_char(ch, file), get_number(&num2, low, names, file) != (-1) ) { state = R_TERMS; } else return ( (-1) ); if (num1 > num2) return ( (-1) ); num1 = num2 = random() % (num2 - num1 + 1) + num1; break; default: return ( (-1) ); } } if (state != R_FINISH || ch == (-1) ) return ( (-1) ); for (i = num1; i <= num2; i += num3) if ( (-1) == set_element(bits, low, high, i)) { unget_char(ch, file); return ( (-1) ); } return ch; }
int get_range(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long long a3, unsigned long long a4) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned long long v3; unsigned int v4; unsigned int v5; unsigned int v7; v2 = 1; v5 = 0; while (true) { if (v5 != 9) { *(&v3) = get_char(a4); if (v3 != -1) { switch (v5) { case 0: if (v3 == 42) { v0 = a1; v1 = a2; v5 = 1; break; } else if (v3 == 126) { v0 = a1; v5 = 7; break; } else { unget_char(v3, a4, a4); v7 = get_number(&v0, a1, a3, a4); if (v7 != -1) { v5 = 4; break; } else { v7 = -1; } } case 1: if (v3 == 47) { v5 = 2; break; } else { v7 = is_separator(v3); if (v7) { v5 = 9; break; } else { v7 = -1; } } case 2: unget_char(v3, a4, a4); v7 = get_number(&v2, 0, 0, a4); if (v7 == -1) { v7 = -1; } else if (v2) { v5 = 3; break; } case 3: v7 = is_separator(v3); if (v7) { v5 = 9; break; } else { v7 = -1; } case 4: if (v3 == 45) { v5 = 5; break; } else if (v3 == 126) { v5 = 7; break; } else { v7 = is_separator(v3); if (v7) { v1 = v0; v5 = 9; break; } else { v7 = -1; } } case 5: unget_char(v3, a4, a4); v7 = get_number(&v1, a1, a3, a4); if (v7 != -1) { v5 = 6; break; } else { v7 = -1; } case 6: if (v3 == 47) { v5 = 2; break; } else { v7 = is_separator(v3); if (v7) { v5 = 9; break; } else { v7 = -1; } } case 7: v7 = is_separator(v3); if (v7) { v1 = a2; v5 = 9; } else { unget_char(v3, a4, a4); v7 = get_number(&v1, a1, a3, a4); if (v7 != -1) v5 = 3; else v7 = -1; } if (v7 != -1 || v7) { if (v0 > v1) { v7 = -1; } else { v7 = random(); v1 = v0 + ((v7 >> 63 CONCAT v7) /m (v1 - v0 + 1) >> 64); v0 = v1; break; } } default: v7 = -1; } } } if (v3 == -1 || v5 == 9) { if (v5 == 9 && v3 != -1) { v4 = v0; while (true) { if (v4 <= v1) { v7 = set_element(a0, a1, a2, v4); if (v7 == -1) { unget_char(v3, a4, a4); v7 = -1; break; } else { v4 += v2; } } else { v7 = v3; break; } } } if (v3 == -1 || v5 != 9) { v7 = -1; break; } } } return v7; }
static int is_addr_fast(const char *name) { return (strchr(name, '%') != ((void *)0) || strchr(name, ':') != ((void *)0) || strspn(name, "0123456789.") == strlen(name)); }
_BOOL8 is_addr_fast(const char *a1) { size_t v1; _BOOL8 result; result = 1; if ( !strchr(a1, 37) && !strchr(a1, 58) ) { v1 = strspn(a1, "0123456789."); if ( v1 != strlen(a1) ) return 0; } return result; }
static void print_deadprocs (const STRUCT_UTMP *utmp_ent) { static char *exitstr; char *comment = make_id_equals_comment (utmp_ent); char pidstr[(((((sizeof (utmp_ent->ut_pid) * 8) - (! ((__typeof__ (utmp_ent->ut_pid)) 0 < (__typeof__ (utmp_ent->ut_pid)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (utmp_ent->ut_pid)) 0 < (__typeof__ (utmp_ent->ut_pid)) -1))) + 1]; sprintf (pidstr, "%ld", (long int) (utmp_ent->ut_pid)); if (!exitstr) exitstr = xmalloc (strlen (gettext ("term=")) + (((((sizeof (((utmp_ent)->ut_exit.e_termination)) * 8) - (! ((__typeof__ (((utmp_ent)->ut_exit.e_termination))) 0 < (__typeof__ (((utmp_ent)->ut_exit.e_termination))) -1))) * 146 + 484) / 485) + (! ((__typeof__ (((utmp_ent)->ut_exit.e_termination))) 0 < (__typeof__ (((utmp_ent)->ut_exit.e_termination))) -1))) + 1 + strlen (gettext ("exit=")) + (((((sizeof (((utmp_ent)->ut_exit.e_exit)) * 8) - (! ((__typeof__ (((utmp_ent)->ut_exit.e_exit))) 0 < (__typeof__ (((utmp_ent)->ut_exit.e_exit))) -1))) * 146 + 484) / 485) + (! ((__typeof__ (((utmp_ent)->ut_exit.e_exit))) 0 < (__typeof__ (((utmp_ent)->ut_exit.e_exit))) -1))) + 1); sprintf (exitstr, "%s%d %s%d", gettext ("term="), ((utmp_ent)->ut_exit.e_termination), gettext ("exit="), ((utmp_ent)->ut_exit.e_exit)); print_line (-1, "", ' ', sizeof utmp_ent->ut_line, utmp_ent->ut_line, time_string (utmp_ent), "", pidstr, comment, exitstr); free (comment); }
void print_deadprocs(struct_0 *a0) { unsigned long v0; char v1; char v2; unsigned long long *v4; unsigned long long v5; v0 = make_id_equals_comment(a0); sprintf(&v1, "%ld", a0->field_4); if (!exitstr.6661) exitstr.6661 = xmalloc(strlen(gettext("exit=")) + strlen(gettext("term=")) + 14); sprintf(exitstr.6661, "%s%d %s%d", gettext("term="), a0->field_14c, gettext("exit="), a0->field_14e); print_line(0xffffffff, &g_401de3, 0x20, 0x20, &a0->padding_8, time_string(a0), &g_401de3, &v1, v0, exitstr.6661); free(v0); v5 = *(&v2) ^ v4[5]; return; }
void do_command(entry *e, user *u) { (void)e; (void)u; }
long long do_command(unsigned long a0, unsigned long a1) { unsigned long v0; unsigned long v1; unsigned long v3; v1 = a0; v0 = a1; return v3; }
static void evalerror (msg) const char *msg; { char *name, *t; name = this_command_name; for (t = expression; t && (((*t) == ' ') || ((*t) == '\t')); t++) ; internal_error (gettext("%s%s%s: %s (error token is \"%s\")"), name ? name : "", name ? ": " : "", t ? t : "", msg, (lasttp && *lasttp) ? lasttp : ""); siglongjmp((evalbuf), (1)); }
void evalerror(unsigned long long a0) { char *v0; char *v1; unsigned long v2; unsigned long v3; unsigned long v4; unsigned long v5; unsigned long v7; unsigned long v8; unsigned long v9; unsigned long v10; unsigned long long v11; v5 = v7; v4 = v8; v3 = v9; v2 = v10; v1 = this_command_name; v0 = expression; while (true) { if (!v0) break; switch (*(v0)) { case 9: case 32: v0 += 1; break; default: goto LABEL_4028ae; } } LABEL_4028ae: if (!lasttp || !*(lasttp)) v11 = &g_403102; else v11 = lasttp; internal_error(gettext("%s%s%s: %s (error token is \"%s\")"), (!v1 ? v1 : &g_403102), (!v1 ? ": " : &g_403102), (!v0 ? v0 : &g_403102), a0, v11); siglongjmp(&evalbuf, 0x1); }
int fmprintf(FILE *stream, const char *fmt, ...) { va_list ap; int ret; __builtin_va_start( ap , fmt ) ; ret = vfmprintf(stream, fmt, ap); __builtin_va_end( ap ) ; return ret; }
long fmprintf(FILE *a1, const char *a2, long a3, long a4, long a5, long a6, ...) { gcc_va_list va; unsigned long v8; long v9; long v10; long v11; long v12; va_start(va, a6); v9 = a3; v10 = a4; v11 = a5; v12 = a6; v8 = __readfsqword(0x28u); va[0].gp_offset = 16; return (unsigned int)vfmprintf(a1, a2, va); }
int verify_host_key(char *host, struct sockaddr *hostaddr, struct sshkey *host_key, const struct ssh_conn_info *cinfo) { u_int i; int r = -1, flags = 0; char valid[64], *fp = ((void *)0) , *cafp = ((void *)0) ; struct sshkey *plain = ((void *)0) ; if ((fp = sshkey_fingerprint(host_key, options.fingerprint_hash, SSH_FP_DEFAULT)) == ((void *)0) ) { sshlog("sshconnect.c", __func__, 1430, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "fingerprint host key"); r = -1; goto out; } if (sshkey_is_cert(host_key)) { if ((cafp = sshkey_fingerprint(host_key->cert->signature_key, options.fingerprint_hash, SSH_FP_DEFAULT)) == ((void *)0) ) { sshlog("sshconnect.c", __func__, 1438, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "fingerprint CA key"); r = -1; goto out; } sshkey_format_cert_validity(host_key->cert, valid, sizeof(valid)); sshlog("sshconnect.c", __func__, 1444, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Server host certificate: %s %s, serial %llu " "ID \"%s\" CA %s %s valid %s", sshkey_ssh_name(host_key), fp, (unsigned long long)host_key->cert->serial, host_key->cert->key_id, sshkey_ssh_name(host_key->cert->signature_key), cafp, valid) ; for (i = 0; i < host_key->cert->nprincipals; i++) { sshlog("sshconnect.c", __func__, 1452, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "Server host certificate hostname: %s", host_key->cert->principals[i]) ; } } else { sshlog("sshconnect.c", __func__, 1456, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Server host key: %s %s", sshkey_ssh_name(host_key), fp); } if (sshkey_equal(previous_host_key, host_key)) { sshlog("sshconnect.c", __func__, 1460, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "server host key %s %s matches cached key", sshkey_type(host_key), fp) ; r = 0; goto out; } if (options.revoked_host_keys != ((void *)0) ) { r = sshkey_check_revoked(host_key, options.revoked_host_keys); switch (r) { case 0: break; case -51: sshlog("sshconnect.c", __func__, 1473, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Host key %s %s revoked by file %s", sshkey_type(host_key), fp, options.revoked_host_keys) ; r = -1; goto out; default: sshlog("sshconnect.c", __func__, 1479, 0, SYSLOG_LEVEL_ERROR, ssh_err(r), "Error checking host key %s %s in " "revoked keys file %s", sshkey_type(host_key), fp, options.revoked_host_keys) ; r = -1; goto out; } } if (options.verify_host_key_dns) { if ((r = sshkey_from_private(host_key, &plain)) != 0) goto out; if (sshkey_is_cert(plain)) sshkey_drop_cert(plain); if (verify_host_key_dns(host, hostaddr, plain, &flags) == 0) { if (flags & 0x00000001) { if (options.verify_host_key_dns == 1 && flags & 0x00000002 && flags & 0x00000004) { r = 0; goto out; } if (flags & 0x00000002) { matching_host_key_dns = 1; } else { warn_changed_key(plain); sshlog("sshconnect.c", __func__, 1508, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Update the SSHFP RR in DNS " "with the new host key to get rid " "of this message.") ; } } } } r = check_host_key(host, cinfo, hostaddr, options.port, host_key, 0, 0, options.user_hostfiles, options.num_user_hostfiles, options.system_hostfiles, options.num_system_hostfiles, options.known_hosts_command); out: sshkey_free(plain); free(fp); free(cafp); if (r == 0 && host_key != ((void *)0) ) { sshkey_free(previous_host_key); r = sshkey_from_private(host_key, &previous_host_key); } return r; }
int verify_host_key(undefined8 param_1,undefined8 param_2,long param_3,undefined8 param_4) { long lVar1; int iVar2; undefined8 uVar3; undefined8 uVar4; undefined8 uVar5; long in_FS_OFFSET; undefined8 uVar6; uint local_9c; uint local_98; int local_94; undefined8 local_90; void *local_88; void *local_80; undefined local_78 [72]; long local_30; local_30 = *(long *)(in_FS_OFFSET + 0x28); local_94 = -1; local_9c = 0; local_80 = (void *)0x0; local_88 = (void *)0x0; local_90 = 0; local_80 = (void *)sshkey_fingerprint(param_3,_DAT_001096d8,0); if (local_80 == (void *)0x0) { uVar6 = 0x10493b; uVar3 = ssh_err(local_94); sshlog("sshconnect.c","verify_host_key",0x596,1,2,uVar3,"fingerprint host key",uVar6); local_94 = -1; } else { iVar2 = sshkey_is_cert(param_3); if (iVar2 == 0) { uVar6 = 0x104b7c; uVar3 = sshkey_ssh_name(param_3); sshlog("sshconnect.c","verify_host_key",0x5b0,0,5,0,"Server host key: %s %s",uVar3,local_80, uVar6); } else { local_88 = (void *)sshkey_fingerprint(*(undefined8 *)(*(long *)(param_3 + 0x80) + 0x50), _DAT_001096d8,0); if (local_88 == (void *)0x0) { uVar6 = 0x1049db; uVar3 = ssh_err(local_94); sshlog("sshconnect.c","verify_host_key",0x59e,1,2,uVar3,"fingerprint CA key",uVar6); local_94 = -1; goto LAB_00104efa; } sshkey_format_cert_validity(*(undefined8 *)(param_3 + 0x80),local_78,0x40); uVar4 = sshkey_ssh_name(*(undefined8 *)(*(long *)(param_3 + 0x80) + 0x50)); uVar3 = *(undefined8 *)(*(long *)(param_3 + 0x80) + 0x18); uVar6 = *(undefined8 *)(*(long *)(param_3 + 0x80) + 0x10); uVar5 = sshkey_ssh_name(param_3); sshlog("sshconnect.c","verify_host_key",0x5a4,0,5,0, "Server host certificate: %s %s, serial %llu ID \"%s\" CA %s %s valid %s",uVar5, local_80,uVar6,uVar3,uVar4,local_88,local_78); for (local_98 = 0; local_98 < *(uint *)(*(long *)(param_3 + 0x80) + 0x20); local_98 = local_98 + 1) { sshlog("sshconnect.c","verify_host_key",0x5ac,0,6,0,"Server host certificate hostname: %s", *(undefined8 *)(*(long *)(*(long *)(param_3 + 0x80) + 0x28) + (ulong)local_98 * 8)); } } iVar2 = sshkey_equal(previous_host_key,param_3); if (iVar2 == 0) { if (_DAT_001096d0 != 0) { local_94 = sshkey_check_revoked(param_3,_DAT_001096d0); lVar1 = _DAT_001096d0; if (local_94 == -0x33) { uVar3 = sshkey_type(param_3); sshlog("sshconnect.c","verify_host_key",0x5c1,0,2,0,"Host key %s %s revoked by file %s", uVar3,local_80,lVar1); local_94 = -1; goto LAB_00104efa; } if (local_94 != 0) { uVar3 = sshkey_type(param_3); uVar6 = ssh_err(local_94); sshlog("sshconnect.c","verify_host_key",0x5c7,0,2,uVar6, "Error checking host key %s %s in revoked keys file %s",uVar3,local_80,lVar1); local_94 = -1; goto LAB_00104efa; } } if (_DAT_00108320 != 0) { local_94 = sshkey_from_private(param_3,&local_90); if (local_94 != 0) goto LAB_00104efa; iVar2 = sshkey_is_cert(local_90); if (iVar2 != 0) { sshkey_drop_cert(local_90); } iVar2 = verify_host_key_dns(param_1,param_2,local_90,&local_9c); if ((iVar2 == 0) && ((local_9c & 1) != 0)) { if ((_DAT_00108320 == 1) && (((local_9c & 2) != 0 && ((local_9c & 4) != 0)))) { local_94 = 0; goto LAB_00104efa; } if ((local_9c & 2) == 0) { uVar3 = 0x104e4d; warn_changed_key(local_90); sshlog("sshconnect.c","verify_host_key",0x5e4,0,2,0, "Update the SSHFP RR in DNS with the new host key to get rid of this message.", uVar3); } else { matching_host_key_dns = 1; } } } local_94 = check_host_key(param_1,param_4,param_2,_stdfd_devnull & 0xffff,param_3,0,0, sshkey_ssh_name,_argv_split,socket,DAT_001080ec,_DAT_00109710); } else { uVar6 = 0x104bea; uVar3 = sshkey_type(param_3); sshlog("sshconnect.c","verify_host_key",0x5b4,1,6,0,"server host key %s %s matches cached key" ,uVar3,local_80,uVar6); local_94 = 0; } } LAB_00104efa: sshkey_free(local_90); free(local_80); free(local_88); if ((local_94 == 0) && (param_3 != 0)) { sshkey_free(previous_host_key); local_94 = sshkey_from_private(param_3,&previous_host_key); } if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) { return local_94; } __stack_chk_fail(); }
void assign_string (char **string, const char *value) { free (*string); *string = value ? xstrdup (value) : 0; }
void assign_string(unsigned long long *a0, unsigned long long a1) { void* v1; unsigned long long *v2; free(*(a0)); if (a1) v1 = xstrdup(a1); else v1 = 0; v2 = a0; *(a0) = v1; return; }
map_init(EditLine *el) { el->el_map.alt = calloc(256, sizeof(*el->el_map.alt)); if (el->el_map.alt == ((void *)0) ) return -1; el->el_map.key = calloc(256, sizeof(*el->el_map.key)); if (el->el_map.key == ((void *)0) ) return -1; el->el_map.emacs = el_map_emacs; el->el_map.vic = el_map_vi_command; el->el_map.vii = el_map_vi_insert; el->el_map.help = calloc(96, sizeof(*el->el_map.help)); if (el->el_map.help == ((void *)0) ) return -1; (void) memcpy(el->el_map.help, el_func_help, sizeof(*el->el_map.help) * 96); el->el_map.func = calloc(96, sizeof(*el->el_map.func)); if (el->el_map.func == ((void *)0) ) return -1; memcpy(el->el_map.func, el_func, sizeof(*el->el_map.func) * 96); el->el_map.nfunc = 96; map_init_vi(el); return 0; }
long long map_init(unsigned long long a0[136]) { unsigned long long v1; a0[126] = calloc(0x100, 0x1); if (!a0[126]) { v1 = 4294967295; } else { a0[127] = calloc(0x100, 0x1); if (!a0[127]) { v1 = 4294967295; } else { a0[129] = &el_map_emacs; a0[130] = &el_map_vi_command; a0[131] = &el_map_vi_insert; a0[133] = calloc(0x60, 0x18); if (!a0[133]) { v1 = 4294967295; } else { memcpy(a0[133], &el_func_help, 0x900); a0[134] = calloc(0x60, 0x8); if (!a0[134]) { v1 = 4294967295; } else { memcpy(a0[134], &el_func, 0x300); a0[135] = 96; map_init_vi(a0); v1 = 0; } } } } return v1; }
static void copyFileName ( Char* to, Char* from ) { if ( strlen(from) > 1034 -10 ) { fprintf ( stderr , "bzip2: file name\n`%s'\n" "is suspiciously (more than %d chars) long.\n" "Try using a reasonable file name instead. Sorry! :-)\n", from, 1034 -10 ); setExit(1); exit(exitValue); } strncpy(to,from,1034 -10); to[1034 -10]='\0'; }
void copyFileName(struct_0 *a0, char *a1) { unsigned long long v2; if (strlen(a1) > 0x400) { fprintf(stderr, "bzip2: file name\n`%s'\nis suspiciously (more than %d chars) long.\nTry using a reasonable file name instead. Sorry! :-)\n", a1, 0x400); setExit(0x1); exit(exitValue); } strncpy(a0, a1, 0x400); v2 = &a0->field_400; a0->field_400 = 0; return; }
int auth_authorise_keyopts(struct passwd *pw, struct sshauthopt *opts, int allow_cert_authority, const char *remote_ip, const char *remote_host, const char *loc) { time_t now = time( ((void *)0) ); char buf[64]; if (opts->valid_before && now > 0 && opts->valid_before < (uint64_t)now) { format_absolute_time(opts->valid_before, buf, sizeof(buf)); sshlog("auth2-pubkeyfile.c", __func__, 70, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s: entry expired at %s", loc, buf); auth_debug_add("%s: entry expired at %s", loc, buf); return -1; } if (opts->cert_principals != ((void *)0) && !opts->cert_authority) { sshlog("auth2-pubkeyfile.c", __func__, 76, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s: principals on non-CA key", loc); auth_debug_add("%s: principals on non-CA key", loc); return -1; } if (!allow_cert_authority && opts->cert_authority) { sshlog("auth2-pubkeyfile.c", __func__, 83, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s: cert-authority flag invalid here", loc); auth_debug_add("%s: cert-authority flag invalid here", loc); return -1; } if (opts->required_from_host_keys != ((void *)0) ) { switch (match_host_and_ip(remote_host, remote_ip, opts->required_from_host_keys )) { case 1: break; case -1: default: sshlog("auth2-pubkeyfile.c", __func__, 98, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s: invalid from criteria", loc); auth_debug_add("%s: invalid from criteria", loc); case 0: sshlog("auth2-pubkeyfile.c", __func__, 102, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "%s: Authentication tried for %.100s with " "correct key but not from a permitted " "host (host=%.200s, ip=%.200s, required=%.200s).", loc, pw->pw_name, remote_host, remote_ip, opts->required_from_host_keys) ; auth_debug_add("%s: Your host '%.200s' is not " "permitted to use this key for login.", loc, remote_host); return -1; } } if (opts->required_from_host_cert != ((void *)0) ) { switch (addr_match_cidr_list(remote_ip, opts->required_from_host_cert)) { case 1: break; case -1: default: sshlog("auth2-pubkeyfile.c", __func__, 124, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "%s: Certificate source-address invalid", loc); case 0: sshlog("auth2-pubkeyfile.c", __func__, 127, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "%s: Authentication tried for %.100s with valid " "certificate but not from a permitted source " "address (%.200s).", loc, pw->pw_name, remote_ip) ; auth_debug_add("%s: Your address '%.200s' is not " "permitted to use this certificate for login.", loc, remote_ip); return -1; } } auth_log_authopts(loc, opts, 1); return 0; }
int auth_authorise_keyopts(unsigned long a0, struct_0 *a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned long v0; unsigned long v1; char v2; unsigned int v4; v0 = a0; v1 = time(NULL); if (a1->field_18 && v1 > 0 && a1->field_18 < v1) { format_absolute_time(a1->field_18, &v2, 0x40, &v2); sshlog("auth2-pubkeyfile.c", "auth_authorise_keyopts", 0x46, 0x0, 0x5, 0x0, "%s: entry expired at %s", a5); auth_debug_add("%s: entry expired at %s", a5, &v2); v4 = -1; goto LABEL_400426; } if (a1->field_28 && !a1->field_20) { sshlog("auth2-pubkeyfile.c", "auth_authorise_keyopts", 0x4c, 0x0, 0x5, 0x0, "%s: principals on non-CA key", a5); auth_debug_add("%s: principals on non-CA key", a5, 0x4c); v4 = -1; goto LABEL_400426; } if (!a2 && a1->field_20) { sshlog("auth2-pubkeyfile.c", "auth_authorise_keyopts", 0x53, 0x0, 0x5, 0x0, "%s: cert-authority flag invalid here", a5); auth_debug_add("%s: cert-authority flag invalid here", a5, 0x53); v4 = -1; goto LABEL_400426; } if (a1->field_78) { v4 = match_host_and_ip(a4, a3, a1->field_78, a3); if (!v4) { LABEL_400292: sshlog("auth2-pubkeyfile.c", "auth_authorise_keyopts", 0x66, 0x0, 0x3, 0x0, "%s: Authentication tried for %.100s with correct key but not from a permitted host (host=%.200s, ip=%.200s, required=%.200s).", a5); auth_debug_add("%s: Your host '%.200s' is not permitted to use this key for login.", a5, a4); v4 = -1; goto LABEL_400426; } else if (v4 != 1) { sshlog("auth2-pubkeyfile.c", "auth_authorise_keyopts", 0x62, 0x0, 0x5, 0x0, "%s: invalid from criteria", a5); auth_debug_add("%s: invalid from criteria", a5, 0x62); goto LABEL_400292; } } if (a1->field_70) { v4 = addr_match_cidr_list(a3, a1->field_70, a1->field_70); if (!v4) { LABEL_400391: sshlog("auth2-pubkeyfile.c", "auth_authorise_keyopts", 0x7f, 0x0, 0x3, 0x0, "%s: Authentication tried for %.100s with valid certificate but not from a permitted source address (%.200s).", a5); auth_debug_add("%s: Your address '%.200s' is not permitted to use this certificate for login.", a5, a3); v4 = -1; goto LABEL_400426; } else if (v4 != 1) { sshlog("auth2-pubkeyfile.c", "auth_authorise_keyopts", 0x7c, 0x0, 0x2, 0x0, "%s: Certificate source-address invalid", a5); goto LABEL_400391; } } auth_log_authopts(a5, a1, 0x1, a1); v4 = 0; LABEL_400426: return v4; }
int stravis(char **outp, const char *src, int flag) { char *buf; int len, serrno; buf = reallocarray( ((void *)0) , 4, strlen(src) + 1); if (buf == ((void *)0) ) return -1; len = strvis(buf, src, flag); serrno = (*__errno_location ()) ; *outp = realloc(buf, len + 1); if (*outp == ((void *)0) ) { *outp = buf; (*__errno_location ()) = serrno; } return (len); }
long stravis(void **a1, char *a2, short a3) { size_t v3; unsigned int v6; int v7; _BYTE *ptr; v3 = strlen(a2); ptr = (_BYTE *)reallocarray(0LL, 4LL, v3 + 1); if ( !ptr ) return 0xFFFFFFFFLL; v6 = (unsigned int)strvis(ptr, (unsigned char *)a2, a3); v7 = *_errno_location(); *a1 = realloc(ptr, (int)(v6 + 1)); if ( !*a1 ) { *a1 = ptr; *_errno_location() = v7; } return v6; }
static size_t count_newlines (char *buf, size_t bufsize) { size_t count = 0; char *p; char *lim = buf + bufsize; char ch = *lim; *lim = '\n'; for (p = buf; (p = rawmemchr (p, '\n')) != lim; p++) count++; *lim = ch; return count; }
int count_newlines(void* a0, unsigned long a1) { char v0; void* v1; void* v2; char *v3; v1 = 0; v3 = a1 + a0; v0 = *(v3); *(v3) = 10; v2 = a0; while (true) { v2 = rawmemchr(v2, 0xa); if (v2 == v3) break; v1 += 1; v2 += 1; } *(v3) = v0; return v1; }
int do_limits(struct sftp_conn *conn, struct sftp_limits *limits) { u_int id, msg_id; u_char type; struct sshbuf *msg; int r; if ((conn->exts & 0x00000040) == 0) { sshlog("sftp-client.c", __func__, 617, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Server does not support limits@openssh.com extension"); return -1; } if ((msg = sshbuf_new()) == ((void *)0) ) sshfatal("sftp-client.c", __func__, 622, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); id = conn->msg_id++; if ((r = sshbuf_put_u8(msg, 200)) != 0 || (r = sshbuf_put_u32(msg, id)) != 0 || (r = sshbuf_put_cstring(msg, "limits@openssh.com")) != 0) sshfatal("sftp-client.c", __func__, 628, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose"); send_msg(conn, msg); sshlog("sftp-client.c", __func__, 630, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "Sent message limits@openssh.com I:%u", id); get_msg(conn, msg); if ((r = sshbuf_get_u8(msg, &type)) != 0 || (r = sshbuf_get_u32(msg, &msg_id)) != 0) sshfatal("sftp-client.c", __func__, 636, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); sshlog("sftp-client.c", __func__, 638, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "Received limits reply T:%u I:%u", type, msg_id); if (id != msg_id) sshfatal("sftp-client.c", __func__, 640, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "ID mismatch (%u != %u)", msg_id, id); if (type != 201) { sshlog("sftp-client.c", __func__, 642, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "expected SSH2_FXP_EXTENDED_REPLY(%u) packet, got %u", 201, type) ; conn->exts &= ~0x00000040; sshbuf_free(msg); return 0; } memset(limits, 0, sizeof(*limits)); if ((r = sshbuf_get_u64(msg, &limits->packet_length)) != 0 || (r = sshbuf_get_u64(msg, &limits->read_length)) != 0 || (r = sshbuf_get_u64(msg, &limits->write_length)) != 0 || (r = sshbuf_get_u64(msg, &limits->open_handles)) != 0) sshfatal("sftp-client.c", __func__, 655, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse limits"); sshbuf_free(msg); return 0; }
undefined8 do_limits(long param_1,void *param_2) { long lVar1; void *pvVar2; undefined8 uVar3; char **ppcVar4; undefined *puVar5; undefined *puVar6; void **ppvVar7; long in_FS_OFFSET; char *apcStack176 [6]; ulong auStack128 [3]; char *pcStack104; ulong auStack96 [3]; char *pcStack72; undefined8 uStack64; void *local_38; long local_30; byte local_25; uint local_24; int local_20; uint local_1c; long local_18; long local_10; ppcVar4 = (char **)&local_38; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_38 = param_2; local_30 = param_1; if ((*(uint *)(param_1 + 0x1c) & 0x40) == 0) { pcStack72 = "Server does not support limits@openssh.com extension"; sshlog("sftp-client.c","do_limits",0x269,0,2,0); uVar3 = 0xffffffff; ppvVar7 = &local_38; goto LAB_001026a7; } uStack64 = 0x1022ec; local_18 = sshbuf_new(); if (local_18 == 0) { ppcVar4 = &pcStack72; pcStack72 = "sshbuf_new failed"; sshfatal("sftp-client.c","do_limits",0x26e,1,1,0); } local_1c = *(uint *)(local_30 + 0x18); *(uint *)(local_30 + 0x18) = local_1c + 1; *(undefined8 *)((long)ppcVar4 + -8) = 0x102356; local_20 = sshbuf_put_u8(local_18,200); if (local_20 == 0) { *(undefined8 *)((long)ppcVar4 + -8) = 0x102370; local_20 = sshbuf_put_u32(local_18,local_1c); if (local_20 != 0) goto LAB_00102395; *(undefined8 *)((long)ppcVar4 + -8) = 0x10238c; local_20 = sshbuf_put_cstring(local_18,"limits@openssh.com"); puVar6 = (undefined *)ppcVar4; if (local_20 != 0) goto LAB_00102395; } else { LAB_00102395: *(undefined8 *)((long)ppcVar4 + -8) = 0x10239f; uVar3 = ssh_err(local_20); puVar6 = (undefined *)((long)ppcVar4 + -0x10); *(char **)((long)ppcVar4 + -0x10) = "compose"; *(undefined8 *)((long)ppcVar4 + -0x18) = 0x1023d6; sshfatal("sftp-client.c","do_limits",0x274,1,1,uVar3); } *(undefined8 *)(puVar6 + -8) = 0x1023e9; send_msg(local_30,local_18); *(ulong *)(puVar6 + -8) = (ulong)local_1c; *(char **)(puVar6 + -0x10) = "Sent message limits@openssh.com I:%u"; *(undefined8 *)(puVar6 + -0x18) = 0x102423; sshlog("sftp-client.c","do_limits",0x276,0,7,0); *(undefined8 *)(puVar6 + -8) = 0x10243a; get_msg(local_30,local_18); *(undefined8 *)(puVar6 + -8) = 0x10244d; local_20 = sshbuf_get_u8(local_18,&local_25); if (local_20 == 0) { *(undefined8 *)(puVar6 + -8) = 0x102469; local_20 = sshbuf_get_u32(local_18,&local_24); puVar5 = puVar6; if (local_20 != 0) goto LAB_00102472; } else { LAB_00102472: *(undefined8 *)(puVar6 + -8) = 0x10247c; uVar3 = ssh_err(local_20); puVar5 = puVar6 + -0x10; *(char **)(puVar6 + -0x10) = "parse"; *(undefined8 *)(puVar6 + -0x18) = 0x1024b3; sshfatal("sftp-client.c","do_limits",0x27c,1,1,uVar3); } *(ulong *)(puVar5 + -0x10) = (ulong)local_24; *(ulong *)(puVar5 + -0x18) = (ulong)local_25; *(char **)(puVar5 + -0x20) = "Received limits reply T:%u I:%u"; *(undefined8 *)(puVar5 + -0x28) = 0x1024f9; sshlog("sftp-client.c","do_limits",0x27e,0,7,0); puVar6 = puVar5; if (local_1c != local_24) { *(ulong *)(puVar5 + -0x10) = (ulong)local_1c; *(ulong *)(puVar5 + -0x18) = (ulong)local_24; puVar6 = puVar5 + -0x20; *(char **)(puVar5 + -0x20) = "ID mismatch (%u != %u)"; *(undefined8 *)(puVar5 + -0x28) = 0x102547; sshfatal("sftp-client.c","do_limits",0x280,0,1,0); } pvVar2 = local_38; ppvVar7 = (void **)puVar6; if (local_25 != 0xc9) { *(ulong *)(puVar6 + -0x10) = (ulong)local_25; *(undefined8 *)(puVar6 + -0x18) = 0xc9; *(char **)(puVar6 + -0x20) = "expected SSH2_FXP_EXTENDED_REPLY(%u) packet, got %u"; *(undefined8 *)(puVar6 + -0x28) = 0x102596; sshlog("sftp-client.c","do_limits",0x282,1,5,0); *(uint *)(local_30 + 0x1c) = *(uint *)(local_30 + 0x1c) & 0xffffffbf; *(undefined8 *)(puVar6 + -8) = 0x1025b9; sshbuf_free(local_18); uVar3 = 0; goto LAB_001026a7; } *(undefined8 *)(puVar6 + -8) = 0x1025d9; memset(pvVar2,0,0x20); pvVar2 = local_38; *(undefined8 *)(puVar6 + -8) = 0x1025ec; local_20 = sshbuf_get_u64(local_18,pvVar2); if (local_20 == 0) { lVar1 = (long)local_38 + 8; *(undefined8 *)(puVar6 + -8) = 0x10260c; local_20 = sshbuf_get_u64(local_18,lVar1); if (local_20 != 0) goto LAB_00102655; lVar1 = (long)local_38 + 0x10; *(undefined8 *)(puVar6 + -8) = 0x10262c; local_20 = sshbuf_get_u64(local_18,lVar1); if (local_20 != 0) goto LAB_00102655; lVar1 = (long)local_38 + 0x18; *(undefined8 *)(puVar6 + -8) = 0x10264c; local_20 = sshbuf_get_u64(local_18,lVar1); if (local_20 != 0) goto LAB_00102655; } else { LAB_00102655: *(undefined8 *)(puVar6 + -8) = 0x10265f; uVar3 = ssh_err(local_20); ppvVar7 = (void **)(puVar6 + -0x10); *(char **)(puVar6 + -0x10) = "parse limits"; *(undefined8 *)(puVar6 + -0x18) = 0x102696; sshfatal("sftp-client.c","do_limits",0x28f,1,1,uVar3); } *(undefined8 *)((long)ppvVar7 + -8) = 0x1026a2; sshbuf_free(local_18); uVar3 = 0; LAB_001026a7: if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { *(undefined8 *)((long)ppvVar7 + -8) = 0x1026bb; __stack_chk_fail(); } return uVar3; }
static void mark_key (size_t offset, size_t width) { while (offset--) putchar_unlocked (' '); if (!width) printf (gettext ("^ no match for key\n")); else { do putchar_unlocked ('_'); while (--width); putchar_unlocked ('\n'); } }
void mark_key(long param_1,long param_2) { char *__format; long local_18; long local_10; local_10 = param_1; while( true ) { if (local_10 == 0) break; putchar_unlocked(0x20); local_10 = local_10 + -1; } local_18 = param_2; if (param_2 == 0) { __format = (char *)gettext("^ no match for key\n"); printf(__format); } else { do { putchar_unlocked(0x5f); local_18 = local_18 + -1; } while (local_18 != 0); putchar_unlocked(10); } return; }
static test_code_t test_do_handshake_and_send_record(gnutls_session_t session) { int ret; const char snd_buf[] = "GET / HTTP/1.0\r\n\r\n"; static char buf[5 * 1024]; ret = test_do_handshake(session); if (ret != TEST_SUCCEED) return ret; gnutls_record_send(session, snd_buf, sizeof(snd_buf) - 1); ret = gnutls_record_recv(session, buf, sizeof(buf) - 1); if (ret < 0) return TEST_FAILED; return TEST_SUCCEED; }
int test_do_handshake_and_send_record(unsigned long long a0) { unsigned int v0; unsigned long long v1; unsigned long long v2; unsigned short v3; char v4; unsigned int v6; v1 = 6073139484287059271; v2 = 724288090028331092; v3 = 2573; v4 = 0; v0 = test_do_handshake(a0); if (v0) { v6 = v0; } else { gnutls_record_send(a0, &v1, 0x12, &v1); v0 = gnutls_record_recv(a0, &buf.12046, 0x13ff); if (v0 < 0) v6 = 1; else v6 = 0; } return v6; }
static char ** expand_seqterm (text, tlen) char *text; size_t tlen; { char *t, *lhs, *rhs; int lhs_t, rhs_t, lhs_l, rhs_l, width; intmax_t lhs_v, rhs_v, incr; intmax_t tl, tr; char **result, *ep, *oep; t = strstr (text, ".."); if (t == 0) return ((char **) ((void *)0) ); lhs_l = t - text; lhs = substring (text, 0, lhs_l); rhs = substring (text, lhs_l + sizeof("..") - 1, tlen); if (lhs[0] == 0 || rhs[0] == 0) { sh_xfree((lhs), "braces.c", 492); sh_xfree((rhs), "braces.c", 493); return ((char **) ((void *)0) ); } lhs_t = (legal_number (lhs, &tl)) ? 1 : (((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)lhs[0] ))] & (unsigned short int) _ISalpha) ) && lhs[1] == 0) ? 2 : 0); ep = 0; if ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)rhs[0] ))] & (unsigned short int) _ISdigit) ) || ((rhs[0] == '+' || rhs[0] == '-') && (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)rhs[1] ))] & (unsigned short int) _ISdigit) ))) { rhs_t = 1; (*__errno_location ()) = 0; tr = strtoimax (rhs, &ep, 10); if ( (*__errno_location ()) == 34 || (ep && *ep != 0 && *ep != '.')) rhs_t = 0; } else if ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)rhs[0] ))] & (unsigned short int) _ISalpha) ) && (rhs[1] == 0 || rhs[1] == '.')) { rhs_t = 2; ep = rhs + 1; } else { rhs_t = 0; ep = 0; } incr = 1; if (rhs_t != 0) { oep = ep; (*__errno_location ()) = 0; if (ep && *ep == '.' && ep[1] == '.' && ep[2]) incr = strtoimax (ep + 2, &ep, 10); if (*ep != 0 || (*__errno_location ()) == 34 ) rhs_t = 0; tlen -= ep - oep; } if (lhs_t != rhs_t || lhs_t == 0 || rhs_t == 0) { sh_xfree((lhs), "braces.c", 538); sh_xfree((rhs), "braces.c", 539); return ((char **) ((void *)0) ); } if (lhs_t == 2) { lhs_v = (unsigned char)lhs[0]; rhs_v = (unsigned char)rhs[0]; width = 1; } else { lhs_v = tl; rhs_v = tr; rhs_l = tlen - lhs_l - sizeof ("..") + 1; width = 0; if (lhs_l > 1 && lhs[0] == '0') width = lhs_l, lhs_t = 3; if (lhs_l > 2 && lhs[0] == '-' && lhs[1] == '0') width = lhs_l, lhs_t = 3; if (rhs_l > 1 && rhs[0] == '0' && width < rhs_l) width = rhs_l, lhs_t = 3; if (rhs_l > 2 && rhs[0] == '-' && rhs[1] == '0' && width < rhs_l) width = rhs_l, lhs_t = 3; if (width < lhs_l && lhs_t == 3) width = lhs_l; if (width < rhs_l && lhs_t == 3) width = rhs_l; } result = mkseq (lhs_v, rhs_v, incr, lhs_t, width); sh_xfree((lhs), "braces.c", 578); sh_xfree((rhs), "braces.c", 579); return (result); }
undefined8 expand_seqterm(char *param_1,int param_2) { int iVar1; int iVar2; ushort **ppuVar3; int *piVar4; undefined8 uVar5; long in_FS_OFFSET; int local_98; int local_7c; int local_78; int local_74; ulong local_68; byte *local_60; ulong local_58; ulong local_50; intmax_t local_48; ulong local_40; char *local_38; byte *local_30; byte *local_28; byte *local_20; undefined8 local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_38 = strstr(param_1,".."); if (local_38 == (char *)0x0) { uVar5 = 0; goto LAB_001014f3; } iVar1 = (int)local_38 - (int)param_1; local_30 = (byte *)substring(param_1,0,iVar1); local_28 = (byte *)substring(param_1,iVar1 + 2,param_2); if ((*local_30 == 0) || (*local_28 == 0)) { sh_xfree(local_30,"braces.c",0x1ec); sh_xfree(local_28,"braces.c",0x1ed); uVar5 = 0; goto LAB_001014f3; } iVar2 = legal_number(local_30,&local_68); if (iVar2 == 0) { ppuVar3 = __ctype_b_loc(); if ((((*ppuVar3)[*local_30] & 0x400) == 0) || (local_30[1] != 0)) { local_7c = 0; } else { local_7c = 2; } } else { local_7c = 1; } local_60 = (byte *)0x0; ppuVar3 = __ctype_b_loc(); if (((*ppuVar3)[*local_28] & 0x800) == 0) { if ((*local_28 == 0x2b) || (*local_28 == 0x2d)) { ppuVar3 = __ctype_b_loc(); if (((*ppuVar3)[local_28[1]] & 0x800) != 0) goto LAB_001011b1; } ppuVar3 = __ctype_b_loc(); if ((((*ppuVar3)[*local_28] & 0x400) == 0) || ((local_28[1] != 0 && (local_28[1] != 0x2e)))) { local_78 = 0; local_60 = (byte *)0x0; } else { local_78 = 2; local_60 = local_28 + 1; } } else { LAB_001011b1: local_78 = 1; piVar4 = __errno_location(); *piVar4 = 0; local_40 = strtoimax((char *)local_28,(char **)&local_60,10); piVar4 = __errno_location(); if ((*piVar4 == 0x22) || (((local_60 != (byte *)0x0 && (*local_60 != 0)) && (*local_60 != 0x2e)))) { local_78 = 0; } } local_48 = 1; local_98 = param_2; if (local_78 != 0) { local_20 = local_60; piVar4 = __errno_location(); *piVar4 = 0; if (((local_60 != (byte *)0x0) && (*local_60 == 0x2e)) && ((local_60[1] == 0x2e && (local_60[2] != 0)))) { local_48 = strtoimax((char *)(local_60 + 2),(char **)&local_60,10); } if (*local_60 == 0) { piVar4 = __errno_location(); if (*piVar4 == 0x22) goto LAB_00101311; } else { LAB_00101311: local_78 = 0; } local_98 = param_2 - ((int)local_60 - (int)local_20); } if (((local_7c == local_78) && (local_7c != 0)) && (local_78 != 0)) { if (local_7c == 2) { local_58 = (ulong)*local_30; local_50 = (ulong)*local_28; local_74 = 1; } else { local_58 = local_68; local_50 = local_40; iVar2 = (local_98 - iVar1) + -2; local_74 = 0; if ((1 < iVar1) && (*local_30 == 0x30)) { local_7c = 3; local_74 = iVar1; } if (((2 < iVar1) && (*local_30 == 0x2d)) && (local_30[1] == 0x30)) { local_7c = 3; local_74 = iVar1; } if (((1 < iVar2) && (*local_28 == 0x30)) && (local_74 < iVar2)) { local_7c = 3; local_74 = iVar2; } if (((2 < iVar2) && (*local_28 == 0x2d)) && ((local_28[1] == 0x30 && (local_74 < iVar2)))) { local_7c = 3; local_74 = iVar2; } if ((local_74 < iVar1) && (local_7c == 3)) { local_74 = iVar1; } if ((local_74 < iVar2) && (local_7c == 3)) { local_74 = iVar2; } } local_18 = mkseq(local_58,local_50,local_48,local_7c,local_74); sh_xfree(local_30,"braces.c",0x242); sh_xfree(local_28,"braces.c",0x243); uVar5 = local_18; } else { sh_xfree(local_30,"braces.c",0x21a); sh_xfree(local_28,"braces.c",0x21b); uVar5 = 0; } LAB_001014f3: if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar5; }
static int rl_search_history (int direction, int invoking_key) { _rl_search_cxt *cxt; int c, r; (rl_readline_state |= (0x0000080)); cxt = _rl_isearch_init (direction); rl_display_search (cxt->search_string, cxt->sflags, -1); if ((rl_readline_state & (0x0080000))) return (0); r = -1; for (;;) { c = _rl_search_getchar (cxt); r = _rl_isearch_dispatch (cxt, cxt->lastc); if (r <= 0) break; } return (_rl_isearch_cleanup (cxt, r)); }
undefined8 rl_search_history(undefined4 param_1) { int iVar1; long lVar2; undefined8 uVar3; rl_readline_state = rl_readline_state | 0x80; lVar2 = _rl_isearch_init(param_1); rl_display_search(*(undefined8 *)(lVar2 + 8),*(undefined4 *)(lVar2 + 4),0xffffffff); if ((rl_readline_state & 0x80000) == 0) { do { _rl_search_getchar(lVar2); iVar1 = _rl_isearch_dispatch(lVar2,*(undefined4 *)(lVar2 + 0x6c)); } while (0 < iVar1); uVar3 = _rl_isearch_cleanup(lVar2,iVar1); } else { uVar3 = 0; } return uVar3; }
static char * path_strip(const char *path, const char *strip) { size_t len; if (strip == ((void *)0) ) return (xstrdup(path)); len = strlen(strip); if (strncmp(path, strip, len) == 0) { if (strip[len - 1] != '/' && path[len] == '/') len++; return (xstrdup(path + len)); } return (xstrdup(path)); }
int path_strip(char *a0, char *a1) { char *v0; unsigned long long v2; if (!a1) { v2 = xstrdup(a0); } else { v0 = strlen(a1); if (!strncmp(a0, a1, v0)) { if (*((a1 + v0 + 1)) != 47 && *((v0 + a0)) == 47) v0 += 1; v2 = xstrdup(v0 + a0); } else { v2 = xstrdup(a0); } } return v2; }
int rl_delete_text(int start, int end) { if (h == ((void *)0) || e == ((void *)0) ) rl_initialize(); return el_deletestr1(e, start, end); }
long long rl_delete_text(unsigned long a0, unsigned long a1) { if (!h || !e) rl_initialize(); return el_deletestr1(e, a0, a1, a0); }
static void separator_string (char const *optarg_S) { size_t len = strlen (optarg_S); if (0x7fffffff < len) integer_overflow (); col_sep_length = len; col_sep_string = optarg_S; }
void separator_string(char *a0) { unsigned long v0; unsigned long long v2; v0 = strlen(a0); if (v0 < 0x80000000) { col_sep_length = v0; v2 = a0; col_sep_string = a0; return; } integer_overflow(); }
static int hash_cmp(const void *a, const void *b, void *arg) { const struct name_cmp_ctx *ctx = (struct name_cmp_ctx *) arg; const struct hash_entry *he_a = (const struct hash_entry *) a; const struct hash_entry *he_b = (const struct hash_entry *) b; int ret; if (he_a->hash > he_b->hash) ret = 1; else if (he_a->hash < he_b->hash) ret = -1; else { if (he_a->minor_hash > he_b->minor_hash) ret = 1; else if (he_a->minor_hash < he_b->minor_hash) ret = -1; else { if (ctx->casefold) ret = name_cf_cmp(ctx, a, b); else ret = name_cmp(a, b); } } return ret; }
long hash_cmp(_DWORD *a1, _DWORD *a2, _DWORD *a3) { if ( *a1 <= *a2 ) { if ( *a1 >= *a2 ) { if ( a1[1] <= a2[1] ) { if ( a1[1] >= a2[1] ) { if ( *a3 ) return (unsigned int)name_cf_cmp((long)a3, (long)a1, (long)a2); else return (unsigned int)name_cmp((long)a1, (long)a2); } else { return (unsigned int)-1; } } else { return 1; } } else { return (unsigned int)-1; } } else { return 1; } }
usage(const struct cmdinfo *ci, const char *value) { printf(gettext("Usage: %s [<option>...] <command>\n" "\n") , "dpkg"); printf(gettext("Commands:\n" " -i|--install <.deb file name>... | -R|--recursive <directory>...\n" " --unpack <.deb file name>... | -R|--recursive <directory>...\n" " -A|--record-avail <.deb file name>... | -R|--recursive <directory>...\n" " --configure <package>... | -a|--pending\n" " --triggers-only <package>... | -a|--pending\n" " -r|--remove <package>... | -a|--pending\n" " -P|--purge <package>... | -a|--pending\n" " -V|--verify [<package>...] Verify the integrity of package(s).\n" " --get-selections [<pattern>...] Get list of selections to stdout.\n" " --set-selections Set package selections from stdin.\n" " --clear-selections Deselect every non-essential package.\n" " --update-avail [<Packages-file>] Replace available packages info.\n" " --merge-avail [<Packages-file>] Merge with info from file.\n" " --clear-avail Erase existing available info.\n" " --forget-old-unavail Forget uninstalled unavailable pkgs.\n" " -s|--status [<package>...] Display package status details.\n" " -p|--print-avail [<package>...] Display available version details.\n" " -L|--listfiles <package>... List files 'owned' by package(s).\n" " -l|--list [<pattern>...] List packages concisely.\n" " -S|--search <pattern>... Find package(s) owning file(s).\n" " -C|--audit [<package>...] Check for broken package(s).\n" " --yet-to-unpack Print packages selected for installation.\n" " --predep-package Print pre-dependencies to unpack.\n" " --add-architecture <arch> Add <arch> to the list of architectures.\n" " --remove-architecture <arch> Remove <arch> from the list of architectures.\n" " --print-architecture Print dpkg architecture.\n" " --print-foreign-architectures Print allowed foreign architectures.\n" " --assert-<feature> Assert support for the specified feature.\n" " --validate-<thing> <string> Validate a <thing>'s <string>.\n" " --compare-versions <a> <op> <b> Compare version numbers - see below.\n" " --force-help Show help on forcing.\n" " -Dh|--debug=help Show help on debugging.\n" "\n") ); printf(gettext(" -?, --help Show this help message.\n" " --version Show the version.\n" "\n") ); printf(gettext("Assertable features: support-predepends, working-epoch, long-filenames,\n" " multi-conrep, multi-arch, versioned-provides, protected-field.\n" "\n") ); printf(gettext("Validatable things: pkgname, archname, trigname, version.\n" "\n") ); printf(gettext("Use dpkg with -b, --build, -c, --contents, -e, --control, -I, --info,\n" " -f, --field, -x, --extract, -X, --vextract, --ctrl-tarfile, --fsys-tarfile\n" "on archives (type %s --help).\n" "\n") , "dpkg-deb"); printf(gettext("Options:\n" " --admindir=<directory> Use <directory> instead of %s.\n" " --root=<directory> Install on a different root directory.\n" " --instdir=<directory> Change installation dir without changing admin dir.\n" " --pre-invoke=<command> Set a pre-invoke hook.\n" " --post-invoke=<command> Set a post-invoke hook.\n" " --path-exclude=<pattern> Do not install paths which match a shell pattern.\n" " --path-include=<pattern> Re-include a pattern after a previous exclusion.\n" " -O|--selected-only Skip packages not selected for install/upgrade.\n" " -E|--skip-same-version Skip packages whose same version is installed.\n" " -G|--refuse-downgrade Skip packages with earlier version than installed.\n" " -B|--auto-deconfigure Install even if it would break some other package.\n" " --[no-]triggers Skip or force consequential trigger processing.\n" " --verify-format=<format> Verify output format (supported: 'rpm').\n" " --no-pager Disables the use of any pager.\n" " --no-debsig Do not try to verify package signatures.\n" " --no-act|--dry-run|--simulate\n" " Just say what we would do - don't do it.\n" " -D|--debug=<octal> Enable debugging (see -Dhelp or --debug=help).\n" " --status-fd <n> Send status change updates to file descriptor <n>.\n" " --status-logger=<command> Send status change updates to <command>'s stdin.\n" " --log=<filename> Log status changes and actions to <filename>.\n" " --ignore-depends=<package>[,...]\n" " Ignore dependencies involving <package>.\n" " --force-<thing>[,...] Override problems (see --force-help).\n" " --no-force-<thing>[,...] Stop when problems encountered.\n" " --refuse-<thing>[,...] Ditto.\n" " --abort-after <n> Abort after encountering <n> errors.\n" " --robot Use machine-readable output on some commands.\n" "\n") , "/usr/local/var/lib/dpkg"); printf(gettext("Comparison operators for --compare-versions are:\n" " lt le eq ne ge gt (treat empty version as earlier than any version);\n" " lt-nl le-nl ge-nl gt-nl (treat empty version as later than any version);\n" " < << <= = >= >> > (only for compatibility with control file syntax).\n" "\n") ); printf(gettext("Use 'apt' or 'aptitude' for user-friendly package management.\n") ); m_output( stdout , gettext("<standard output>")); exit(0); }
void usage() { char *v0; char *v1; char *v2; char *v3; char *v4; char *v5; char *v6; char *v7; char *v8; char *v9; v0 = gettext("Usage: %s [<option>...] <command>\n\n"); printf(v0, "dpkg"); v1 = gettext( "Commands:\n" " -i|--install <.deb file name>... | -R|--recursive <directory>...\n" " --unpack <.deb file name>... | -R|--recursive <directory>...\n" " -A|--record-avail <.deb file name>... | -R|--recursive <directory>...\n" " --configure <package>... | -a|--pending\n" " --triggers-only <package>... | -a|--pending\n" " -r|--remove <package>... | -a|--pending\n" " -P|--purge <package>... | -a|--pending\n" " -V|--verify [<package>...] Verify the integrity of package(s).\n" " --get-selections [<pattern>...] Get list of selections to stdout.\n" " --set-selections Set package selections from stdin.\n" " --clear-selections Deselect every non-essential package.\n" " --update-avail [<Packages-file>] Replace available packages info.\n" " --merge-avail [<Packages-file>] Merge with info from file.\n" " --clear-avail Erase existing available info.\n" " --forget-old-unavail Forget uninstalled unavailable pkgs.\n" " -s|--status [<package>...] Display package status details.\n" " -p|--print-avail [<package>...] Display available version details.\n" " -L|--listfiles <package>... List files 'owned' by package(s).\n" " -l|--list [<pattern>...] List packages concisely.\n" " -S|--search <pattern>... Find package(s) owning file(s).\n" " -C|--audit [<package>...] Check for broken package(s).\n" " --yet-to-unpack Print packages selected for installation.\n" " --predep-package Print pre-dependencies to unpack.\n" " --add-architecture <arch> Add <arch> to the list of architectures.\n" " --remove-architecture <arch> Remove <arch> from the list of architectures.\n" " --print-architecture Print dpkg architecture.\n" " --print-foreign-architectures Print allowed foreign architectures.\n" " --assert-<feature> Assert support for the specified feature.\n" " --validate-<thing> <string> Validate a <thing>'s <string>.\n" " --compare-versions <a> <op> <b> Compare version numbers - see below.\n" " --force-help Show help on forcing.\n" " -Dh|--debug=help Show help on debugging.\n" "\n"); printf(v1); v2 = gettext( " -?, --help Show this help message.\n" " --version Show the version.\n" "\n"); printf(v2); v3 = gettext( "Assertable features: support-predepends, working-epoch, long-filenames,\n" " multi-conrep, multi-arch, versioned-provides, protected-field.\n" "\n"); printf(v3); v4 = gettext("Validatable things: pkgname, archname, trigname, version.\n\n"); printf(v4); v5 = gettext( "Use dpkg with -b, --build, -c, --contents, -e, --control, -I, --info,\n" " -f, --field, -x, --extract, -X, --vextract, --ctrl-tarfile, --fsys-tarfile\n" "on archives (type %s --help).\n" "\n"); printf(v5, "dpkg-deb"); v6 = gettext( "Options:\n" " --admindir=<directory> Use <directory> instead of %s.\n" " --root=<directory> Install on a different root directory.\n" " --instdir=<directory> Change installation dir without changing admin dir.\n" " --pre-invoke=<command> Set a pre-invoke hook.\n" " --post-invoke=<command> Set a post-invoke hook.\n" " --path-exclude=<pattern> Do not install paths which match a shell pattern.\n" " --path-include=<pattern> Re-include a pattern after a previous exclusion.\n" " -O|--selected-only Skip packages not selected for install/upgrade.\n" " -E|--skip-same-version Skip packages whose same version is installed.\n" " -G|--refuse-downgrade Skip packages with earlier version than installed.\n" " -B|--auto-deconfigure Install even if it would break some other package.\n" " --[no-]triggers Skip or force consequential trigger processing.\n" " --verify-format=<format> Verify output format (supported: 'rpm').\n" " --no-pager Disables the use of any pager.\n" " --no-debsig Do not try to verify package signatures.\n" " --no-act|--dry-run|--simulate\n" " Just say what we would do - don't do it.\n" " -D|--debug=<octal> Enable debugging (see -Dhelp or --debug=help).\n" " --status-fd <n> Send status change updates to file descriptor <n>.\n" " --status-logger=<command> Send status change updates to <command>'s stdin.\n" " --log=<filename> Log status changes and actions to <filename>.\n" " --ignore-depends=<package>[,...]\n" " Ignore dependencies involving <package>.\n" " --force-<thing>[,...] Override problems (see --force-help).\n" " --no-force-<thing>[,...] Stop when problems encountered.\n" " --refuse-<thing>[,...] Ditto.\n" " --abort-after <n> Abort after encountering <n> errors.\n" " --robot Use machine-readable output on some commands.\n" "\n"); printf(v6, "/usr/local/var/lib/dpkg"); v7 = gettext( "Comparison operators for --compare-versions are:\n" " lt le eq ne ge gt (treat empty version as earlier than any version);\n" " lt-nl le-nl ge-nl gt-nl (treat empty version as later than any version);\n" " < << <= = >= >> > (only for compatibility with control file syntax).\n" "\n"); printf(v7); v8 = gettext("Use 'apt' or 'aptitude' for user-friendly package management.\n"); printf(v8); v9 = gettext("<standard output>"); m_output(stdout, v9); exit(0); }
int spname(oldname, newname) char *oldname; char *newname; { char *op, *np, *p; char guess[ 4096 + 1], best[ 4096 + 1]; op = oldname; np = newname; for (;;) { while (*op == '/') *np++ = *op++; *np = '\0'; if (*op == '\0') { if (oldname[1] == '\0' && newname[1] == '\0' && oldname[0] != '.' && newname[0] == '.') return -1; return strcmp(oldname, newname) != 0; } for (p = guess; *op != '/' && *op != '\0'; op++) if (p < guess + 4096 ) *p++ = *op; *p = '\0'; if (mindist(newname, guess, best) >= 3) return -1; for (p = best; *np = *p++; np++) ; } }
int spname(char a0[2], char a1[2]) { char v0[2]; int tmp_10; int tmp_13; char v1[2]; unsigned long v2; char v3; char v4; char v5; char v6; unsigned long long v7; unsigned long v9; v7 = *(&v7); v4 = *(&v4); *(&v0) = a0; while (true) { for (*(&v1) = a1; v0[0] == 47; v9[0] = *(tmp_10)) { tmp_10 = v0; *(&v0) = &v0[1]; v9 = v1; *(&v1) = &v1[1]; } v1[0] = 0; if (!v0[0]) { if (!a0[1] && !a1[1] && a0[0] != 46 && a1[0] == 46) { *(&v9) = -1; break; } *(&v9) = strcmp(a0, a1); break; } else { v2 = &v3; while (true) { if (v0[0] == 47) break; if (!v0[0]) break; if (v2 < &v5) { v9 = v2; v2 += 1; *(v9) = v0[0]; } *(&v0) = &v0[1]; } *(v2) = 0; if (mindist(a1, &v3, &v6) <= 2) { v2 = &v6; while (true) { tmp_13 = v2; v2 += 1; v1[0] = *(tmp_13); if (!v1[0]) break; *(&v1) = &v1[1]; } } else { *(&v9) = -1; break; } } } return v9; }
vi_delete_prev_char(EditLine *el, wint_t c __attribute__((__unused__))) { if (el->el_line.cursor <= el->el_line.buffer) return 6; c_delbefore1(el); el->el_line.cursor--; return 4; }
undefined8 vi_delete_prev_char(long param_1) { undefined8 uVar1; if (*(ulong *)(param_1 + 0x50) < *(ulong *)(param_1 + 0x58)) { c_delbefore1(param_1); *(long *)(param_1 + 0x58) = *(long *)(param_1 + 0x58) + -4; uVar1 = 4; } else { uVar1 = 6; } return uVar1; }
static _Bool diversion_is_owned_by_self(struct pkgset *set, struct fsys_namenode *namenode) { struct pkginfo *pkg; struct fsys_node_pkgs_iter *iter; _Bool owned = 0 ; if (set == ((void *)0) ) return 0 ; for (pkg = &set->pkg; pkg; pkg = pkg->arch_next) ensure_packagefiles_available(pkg); iter = fsys_node_pkgs_iter_new(namenode); while ((pkg = fsys_node_pkgs_iter_next(iter))) { if (pkg->set == set) { owned = 1 ; break; } } fsys_node_pkgs_iter_free(iter); return owned; }
int diversion_is_owned_by_self(unsigned long a0, unsigned long long a1) { char v0; struct_0 *v1; unsigned long long v2; unsigned int v4; v0 = 0; if (!a0) { v4 = 0; } else { for (v1 = a0 + 16; v1; v1 = v1->field_8) { ensure_packagefiles_available(v1); } v2 = fsys_node_pkgs_iter_new(a1); while (true) { v1 = fsys_node_pkgs_iter_next(v2); if (!v1) break; if (a0 != *(v1)) continue; v0 = 1; break; } fsys_node_pkgs_iter_free(v2); v4 = v0; } return v4; }
static void terminal_init_arrow(EditLine *el) { funckey_t *arrow = el->el_terminal.t_fkey; arrow[0].name = L"down"; arrow[0].key = 16; arrow[0].fun.cmd = 15; arrow[0].type = 0; arrow[1].name = L"up"; arrow[1].key = 19; arrow[1].fun.cmd = 18; arrow[1].type = 0; arrow[2].name = L"left"; arrow[2].key = 17; arrow[2].fun.cmd = 17; arrow[2].type = 0; arrow[3].name = L"right"; arrow[3].key = 18; arrow[3].fun.cmd = 14; arrow[3].type = 0; arrow[4].name = L"home"; arrow[4].key = 36; arrow[4].fun.cmd = 11; arrow[4].type = 0; arrow[5].name = L"end"; arrow[5].key = 37; arrow[5].fun.cmd = 12; arrow[5].type = 0; arrow[6].name = L"delete"; arrow[6].key = 38; arrow[6].fun.cmd = 3; arrow[6].type = 0; }
void terminal_init_arrow(struct_0 *a0) { struct_1 *v0; unsigned long long v2; v0 = a0->field_c8; v0->field_0 = "d"; v0->field_8 = 16; v0->field_10 = 15; v0->field_18 = 0; v0->field_20 = "u"; v0->field_28 = 19; v0->field_30 = 18; v0->field_38 = 0; v0->field_40 = "l"; v0->field_48 = 17; v0->field_50 = 17; v0->field_58 = 0; v0->field_60 = "r"; v0->field_68 = 18; v0->field_70 = 14; v0->field_78 = 0; *(&v0[83848836698679779].padding_6c) = "h"; *((&v0[83848836698679779].field_60 + 4)) = 36; v0[83848836698679779].padding_5c[0] = 11; *(&v0[83848836698679779].padding_51[3]) = 0; v0->field_a0 = "e"; v0->field_a8 = 37; v0->field_b0 = 12; v0->field_b8 = 0; v0->field_c0 = "d"; v0->field_c8 = 38; v0->field_d0 = 3; v2 = &v0->field_c0; v0->field_d8 = 0; return; }
gnutls_sec_param_t str_to_sec_param(const char *str) { if (strcasecmp(str, "low") == 0) { return GNUTLS_SEC_PARAM_LOW; } else if (strcasecmp(str, "legacy") == 0) { return GNUTLS_SEC_PARAM_LEGACY; } else if (strcasecmp(str, "normal") == 0 || strcasecmp(str, "medium") == 0) { return GNUTLS_SEC_PARAM_MEDIUM; } else if (strcasecmp(str, "high") == 0) { return GNUTLS_SEC_PARAM_HIGH; } else if (strcasecmp(str, "ultra") == 0) { return GNUTLS_SEC_PARAM_ULTRA; } else if (strcasecmp(str, "future") == 0) { return GNUTLS_SEC_PARAM_FUTURE; } else { fprintf( stderr , "Unknown security parameter string: %s\n", str); app_exit(1); } }
undefined8 str_to_sec_param(char *param_1) { int iVar1; undefined8 uVar2; iVar1 = strcasecmp(param_1,"low"); if (iVar1 == 0) { uVar2 = 0x19; } else { iVar1 = strcasecmp(param_1,"legacy"); if (iVar1 == 0) { uVar2 = 0x1e; } else { iVar1 = strcasecmp(param_1,"normal"); if ((iVar1 != 0) && (iVar1 = strcasecmp(param_1,"medium"), iVar1 != 0)) { iVar1 = strcasecmp(param_1,"high"); if (iVar1 == 0) { return 0x28; } iVar1 = strcasecmp(param_1,"ultra"); if (iVar1 == 0) { return 0x2d; } iVar1 = strcasecmp(param_1,"future"); if (iVar1 == 0) { return 0x32; } fprintf(stderr,"Unknown security parameter string: %s\n",param_1); uVar2 = app_exit(1); return uVar2; } uVar2 = 0x23; } } return uVar2; }
void get_ip_addr_set(int type, void *crt) { int ret = 0, i; unsigned char ip[16]; int len; if (batch) { if (!cfg.ip_addr) return; for (i = 0; cfg.ip_addr[i] != ((void *)0) ; i++) { len = string_to_ip(ip, cfg.ip_addr[i]); if (len <= 0) { fprintf( stderr , "Error parsing address: %s\n", cfg.ip_addr[i]); exit(1); } if (type == 1) ret = gnutls_x509_crt_set_subject_alt_name (crt, GNUTLS_SAN_IPADDRESS, ip, len, 1); else ret = gnutls_x509_crq_set_subject_alt_name (crt, GNUTLS_SAN_IPADDRESS, ip, len, 1); if (ret < 0) break; } } else { const char *p; p = read_str ("Enter the IP address of the subject of the certificate: "); if (!p) return; len = string_to_ip(ip, p); if (len <= 0) { fprintf( stderr , "Error parsing address: %s\n", p); exit(1); } if (type == 1) ret = gnutls_x509_crt_set_subject_alt_name(crt, GNUTLS_SAN_IPADDRESS, ip, len, 1); else ret = gnutls_x509_crq_set_subject_alt_name(crt, GNUTLS_SAN_IPADDRESS, ip, len, 1); } if (ret < 0) { fprintf( stderr , "set_subject_alt_name: %s\n", gnutls_strerror(ret)); exit(1); } }
long long get_ip_addr_set(unsigned long a0, unsigned long long a1) { unsigned int v0; unsigned int v1; unsigned int v2; char *v3; char v4; v0 = 0; if (!*(got.batch)) { v3 = read_str("Enter the IP address of the subject of the certificate: "); if (v3) { v2 = string_to_ip(&v4, v3); if (v2 <= 0) { fprintf(*(*(&got.stderr)), "Error parsing address: %s\n", v3); exit(0x1); } if (a0 == 1) v0 = gnutls_x509_crt_set_subject_alt_name(a1, 0x4, &v4, v2, 0x1); else v0 = gnutls_x509_crq_set_subject_alt_name(a1, 0x4, &v4, v2, 0x1); } } else if (*((got.cfg + 328))) { for (v1 = 0; *((*((got.cfg + 328)) + (v1 << 3))); v1 += 1) { v2 = string_to_ip(&v4, *((*((got.cfg + 328)) + v1 * 8))); if (v2 <= 0) { fprintf(*(*(&got.stderr)), "Error parsing address: %s\n", *((*((got.cfg + 328)) + v1 * 8))); exit(0x1); } if (a0 == 1) v0 = gnutls_x509_crt_set_subject_alt_name(a1, 0x4, &v4, v2, 0x1); else v0 = gnutls_x509_crq_set_subject_alt_name(a1, 0x4, &v4, v2, 0x1); if (v0 < 0) break; } } if ((!*(got.batch) || *((got.cfg + 328))) && (*(got.batch) || v3) && (*(got.batch) || v2 > 0) && v0 < 0) { fprintf(*(*(&got.stderr)), "set_subject_alt_name: %s\n", gnutls_strerror(v0)); exit(0x1); } if (!*(got.batch) && !v3 || !*((got.cfg + 328)) && *(got.batch) || *(got.batch) && v0 >= 0 || v0 >= 0 && v2 > 0) return 0; }
static inline void emit_ancillary_info (char const *program) { struct infomap { char const *program; char const *node; } const infomap[] = { { "[", "test invocation" }, { "coreutils", "Multi-call invocation" }, { "sha224sum", "sha2 utilities" }, { "sha256sum", "sha2 utilities" }, { "sha384sum", "sha2 utilities" }, { "sha512sum", "sha2 utilities" }, { ((void *)0) , ((void *)0) } }; char const *node = program; struct infomap const *map_prog = infomap; while (map_prog->program && ! (strcmp (program, map_prog->program) == 0)) map_prog++; if (map_prog->node) node = map_prog->node; printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https: char const *lc_messages = setlocale ( 5 , ((void *)0) ); if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1)) { fputs_unlocked (gettext ("Report any translation bugs to " "<https: stdout ) ; } char const *url_program = (strcmp (program, "[") == 0) ? "test" : program; printf (gettext ("Full documentation <%s%s>\n"), "https: printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"), node, node == program ? " invocation" : ""); }
void emit_ancillary_info(char *a0) { unsigned long v0; unsigned long long v1[2]; char *v2; unsigned long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long long v9; unsigned long long v10; unsigned long long v11; unsigned long long v12; unsigned long long v13; unsigned long long v14; unsigned long long v15; void* v16; void* v17; char v18; unsigned long long *v21; unsigned long long v22; v4 = "["; v5 = "test invocation"; v6 = "coreutils"; v7 = "Multi-call invocation"; v8 = "sha224sum"; v9 = "sha2 utilities"; v10 = "sha256sum"; v11 = "sha2 utilities"; v12 = "sha384sum"; v13 = "sha2 utilities"; v14 = "sha512sum"; v15 = "sha2 utilities"; v16 = 0; v17 = 0; v0 = a0; for (v1[0] = &v4; v1[0] && strcmp(a0, v1[0]); v1[0] = v1 + 1); if (v1[1]) v0 = v1[1]; printf(gettext("\n%s online help: <%s>\n")); v2 = setlocale(0x5, NULL); if (v2 && strncmp(v2, "en_", 0x3)) fputs_unlocked(gettext("Report any translation bugs to <https: *(&v3) = (!strcmp(a0, "[") ? a0 : "test"); printf(gettext("Full documentation <%s%s>\n")); printf(gettext("or available locally via: info '(coreutils) %s%s'\n")); v22 = *(&v18) ^ v21[5]; return; }
static struct alias ** __lookupalias(const char *name) { unsigned int hashval; struct alias **app; const char *p; unsigned int ch; p = name; ch = (unsigned char)*p; hashval = ch << 4; while (ch) { hashval += ch; ch = (unsigned char)*++p; } app = &atab[hashval % 39]; for (; *app; app = &(*app)->next) { if ((strcmp(name, (*app)->name) == 0)) { break; } } return app; }
int __lookupalias(char *a0) { unsigned int v0; unsigned int v1; struct_0 *v2; char *v3; v3 = a0; v1 = *(v3); for (v0 = v1 * 16; v1; v1 = *(v3)) { v0 += v1; v3 += 1; } for (v2 = &(&atab)[v0 + -39 * ((v0 * 2753184165 >> 32) + (v0 - (v0 * 2753184165 >> 32) >> 1) >> 5)]; v2->field_0; v2 = &v2->field_0->field_0) { if (!strcmp(a0, v2->field_0->field_8)) break; } return v2; }
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) { 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 index_add_value(struct index_value **values, const char *value, unsigned int priority) { struct index_value *v; int duplicate = 0; int len; for (v = *values; v; v = v->next) { if ((strcmp((v->value), (value)) == 0)) duplicate = 1; } while (*values && (*values)->priority < priority) values = &(*values)->next; len = strlen(value); v = (calloc(sizeof(struct index_value) + len + 1, 1)); v->next = *values; v->priority = priority; memcpy(v->value, value, len + 1); *values = v; return duplicate; }
void index_add_value(unsigned long a0, void* a1, unsigned long a2) { struct_1 *v0; unsigned int v1; unsigned int v2; struct_0 *v3; unsigned long long v5; v0 = a0; v1 = 0; for (v3 = v0->field_0; v3; v3 = v3->field_0) { if (!strcmp(v3 + 1, a1)) v1 = 1; } while (true) { if (!v0->field_0) break; if (a2 <= v0->field_0->field_8) break; v0 = &v0->field_0->field_0; } v2 = strlen(a1); v3 = calloc(v2 + 17, 0x1); v3->field_0 = v0->field_0; v3->field_8 = a2; memcpy(v3 + 1, a1, v2 + 1); v0->field_0 = v3; v5 = v1; return; }
static int cert_verify_callback(gnutls_session_t session) { listener_item * j = gnutls_session_get_ptr(session); unsigned int size; int ret; if (gnutls_auth_get_type(session) == GNUTLS_CRD_CERTIFICATE) { if (!require_cert && gnutls_certificate_get_peers(session, &size) == ((void *)0) ) return 0; if (gnutls_serv_options.enabled.verify_client_cert) { if (cert_verify(session, ((void *)0) , ((void *)0) ) == 0) { do { ret = gnutls_alert_send(session, GNUTLS_AL_FATAL, GNUTLS_A_ACCESS_DENIED); } while(ret == -52 || ret == -28); j->http_state = 3; return -1; } } else { printf("- Peer's certificate was NOT verified.\n"); } } return 0; }
long cert_verify_callback(long a1) { char v2[4]; int v3; long ptr; unsigned long v5; v5 = __readfsqword(0x28u); ptr = gnutls_session_get_ptr(a1); if ( (unsigned int)gnutls_auth_get_type(a1) != 1 ) return 0LL; if ( !require_cert && !gnutls_certificate_get_peers(a1, v2) ) return 0LL; if ( !gnutls_serv_options[380] ) { printf("- Peer's certificate was NOT verified.\n"); return 0LL; } if ( (unsigned int)cert_verify(a1, 0LL, 0LL) ) return 0LL; do { do v3 = gnutls_alert_send(a1, 2LL, 49LL); while ( v3 == -52 ); } while ( v3 == -28 ); *(_DWORD *)(ptr + 28) = 3; return 0xFFFFFFFFLL; }
gl_linked_get_at (gl_list_t list, size_t position) { size_t count = list->count; gl_list_node_t node; if (!(position < count)) abort (); if (position <= ((count - 1) / 2)) { node = list->root.next; for (; position > 0; position--) node = node->next; } else { position = count - 1 - position; node = list->root.prev; for (; position > 0; position--) node = node->prev; } return node->value; }
long long gl_linked_get_at(unsigned long long a0[9], unsigned long a1) { unsigned long v0; unsigned long long v1[3]; unsigned long v2; v0 = a1; v2 = a0[8]; if (v0 >= v2) { abort(); } else if (v0 > v2 - 1 >> 1) { v0 = v2 - v0 - 1; for (v1[0] = a0[6]; v0; v0 -= 1) { v1[0] = v1[1]; } return v1[2]; } else { for (v1[0] = a0[5]; v0; v0 -= 1) { v1[0] = v1[0]; } return v1[2]; } }
int main(int argc, char **argv) { int debug_flag = 0, log_level = SYSLOG_LEVEL_INFO; int opt, fopt_count = 0, j; char *tname, *cp, *line = ((void *)0) ; size_t linesize = 0; FILE *fp; __progname = ssh_get_progname(argv[0]); seed_rng(); do { (&tq)->tqh_first = ((void *)0) ; (&tq)->tqh_last = &(&tq)->tqh_first; } while (0); sanitise_stdfd(); if (argc <= 1) usage(); while ((opt = BSDgetopt(argc, argv, "cDHv46p:T:t:f:")) != -1) { switch (opt) { case 'H': hash_hosts = 1; break; case 'c': get_cert = 1; break; case 'D': print_sshfp = 1; break; case 'p': ssh_port = a2port(BSDoptarg); if (ssh_port <= 0) { fprintf( stderr , "Bad port '%s'\n", BSDoptarg); exit(1); } break; case 'T': timeout = convtime(BSDoptarg); if (timeout == -1 || timeout == 0) { fprintf( stderr , "Bad timeout '%s'\n", BSDoptarg); usage(); } break; case 'v': if (!debug_flag) { debug_flag = 1; log_level = SYSLOG_LEVEL_DEBUG1; } else if (log_level < SYSLOG_LEVEL_DEBUG3) log_level++; else sshfatal("ssh-keyscan.c", __func__, 725, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Too high debugging level."); break; case 'f': if (strcmp(BSDoptarg, "-") == 0) BSDoptarg = ((void *)0) ; argv[fopt_count++] = BSDoptarg; break; case 't': get_keytypes = 0; tname = strtok(BSDoptarg, ","); while (tname) { int type = sshkey_type_from_name(tname); switch (type) { case KEY_DSA: get_keytypes |= (1); break; case KEY_ECDSA: get_keytypes |= (1<<2); break; case KEY_RSA: get_keytypes |= (1<<1); break; case KEY_ED25519: get_keytypes |= (1<<3); break; case KEY_XMSS: get_keytypes |= (1<<4); break; case KEY_ED25519_SK: get_keytypes |= (1<<6); break; case KEY_ECDSA_SK: get_keytypes |= (1<<5); break; case KEY_UNSPEC: default: sshfatal("ssh-keyscan.c", __func__, 762, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Unknown key type \"%s\"", tname); } tname = strtok( ((void *)0) , ","); } break; case '4': IPv4or6 = 2 ; break; case '6': IPv4or6 = 10 ; break; case '?': default: usage(); } } if (BSDoptind == argc && !fopt_count) usage(); log_init("ssh-keyscan", log_level, SYSLOG_FACILITY_USER, 1); maxfd = fdlim_get(1); if (maxfd < 0) sshfatal("ssh-keyscan.c", __func__, 785, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: fdlim_get: bad value", __progname); if (maxfd > 256) maxfd = 256; if ((maxfd - 10) <= 0) sshfatal("ssh-keyscan.c", __func__, 789, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: not enough file descriptors", __progname); if (maxfd > fdlim_get(0)) fdlim_set(maxfd); fdcon = xcalloc(maxfd, sizeof(con)); read_wait = xcalloc(maxfd, sizeof(struct pollfd)); for (j = 0; j < maxfd; j++) read_wait[j].fd = -1; for (j = 0; j < fopt_count; j++) { if (argv[j] == ((void *)0) ) fp = stdin ; else if ((fp = fopen(argv[j], "r")) == ((void *)0) ) sshfatal("ssh-keyscan.c", __func__, 801, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: %s: %s", __progname, argv[j], strerror( (*__errno_location ()) )); while (getline(&line, &linesize, fp) != -1) { if ((cp = strchr(line, '#')) == ((void *)0) ) cp = line + strlen(line) - 1; while (cp >= line) { if (*cp == ' ' || *cp == '\t' || *cp == '\n' || *cp == '#') *cp-- = '\0'; else break; } if (*line == '\0') continue; do_host(line); } if (ferror(fp)) sshfatal("ssh-keyscan.c", __func__, 823, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: %s: %s", __progname, argv[j], strerror( (*__errno_location ()) )); fclose(fp); } free(line); while (BSDoptind < argc) do_host(argv[BSDoptind++]); while (ncon > 0) conloop(); return found_one ? 0 : 1; }
bool main(int param_1,undefined8 *param_2) { undefined8 uVar1; undefined8 *puVar2; char *pcVar3; FILE *pFVar4; undefined4 uVar5; int iVar6; int iVar7; size_t sVar8; __ssize_t _Var9; int *piVar10; char *pcVar11; undefined *puVar12; char **ppcVar13; undefined *puVar14; long in_FS_OFFSET; char *apcStack144 [4]; int local_6c; int local_60; int local_5c; int local_58; int local_54; int local_50; undefined4 local_4c; char *local_48; size_t local_40; char *local_38; char *local_30; FILE *local_28; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_60 = 0; local_5c = 3; local_58 = 0; local_48 = (char *)0x0; local_40 = 0; apcStack144[3] = (char *)param_2; local_6c = param_1; __progname = ssh_get_progname(*param_2); seed_rng(); tq._0_8_ = 0; tq._8_8_ = tq; sanitise_stdfd(); ppcVar13 = apcStack144 + 3; if (local_6c < 2) { usage(); ppcVar13 = apcStack144 + 3; } LAB_001025bf: puVar2 = (undefined8 *)apcStack144[3]; *(undefined8 *)((long)ppcVar13 + -8) = 0x1025d7; local_50 = BSDgetopt(local_6c,puVar2,"cDHv46p:T:t:f:"); if (local_50 == -1) { if ((local_6c == BSDoptind) && (local_58 == 0)) { *(undefined8 *)((long)ppcVar13 + -8) = 0x1025fa; usage(); } *(undefined8 *)((long)ppcVar13 + -8) = 0x102615; log_init("ssh-keyscan",local_5c,1,1); *(undefined8 *)((long)ppcVar13 + -8) = 0x10261f; maxfd = fdlim_get(1); puVar12 = (undefined *)ppcVar13; if (maxfd < 0) { *(undefined8 *)((long)ppcVar13 + -8) = __progname; puVar12 = (undefined *)((long)ppcVar13 + -0x10); *(char **)((long)ppcVar13 + -0x10) = "%s: fdlim_get: bad value"; *(undefined8 *)((long)ppcVar13 + -0x18) = 0x10266d; sshfatal("ssh-keyscan.c",&__func___19623,0x311,0,1,0); } if (0x100 < maxfd) { maxfd = 0x100; } *(undefined8 *)(puVar12 + -8) = 0x102696; iVar7 = __addvsi3(maxfd,0xfffffff6); puVar14 = puVar12; if (iVar7 < 1) { *(undefined8 *)(puVar12 + -8) = __progname; puVar14 = puVar12 + -0x10; *(char **)(puVar12 + -0x10) = "%s: not enough file descriptors"; *(undefined8 *)(puVar12 + -0x18) = 0x1026d8; sshfatal("ssh-keyscan.c",&__func___19623,0x315,0,1,0); } *(undefined8 *)(puVar14 + -8) = 0x1026e2; iVar7 = fdlim_get(0); if (iVar7 < maxfd) { *(undefined8 *)(puVar14 + -8) = 0x1026f9; fdlim_set(maxfd); } *(undefined8 *)(puVar14 + -8) = 0x10270e; fdcon = xcalloc((long)maxfd,0x70); *(undefined8 *)(puVar14 + -8) = 0x10272a; read_wait = xcalloc((long)maxfd,8); local_54 = 0; while (iVar7 = local_54, local_54 < maxfd) { *(undefined4 *)(read_wait + (long)local_54 * 8) = 0xffffffff; *(undefined8 *)(puVar14 + -8) = 0x102761; local_54 = __addvsi3(iVar7,1); } local_54 = 0; while (pcVar11 = local_48, local_54 < local_58) { if (*(long *)((long)apcStack144[3] + (long)local_54 * 8) == 0) { local_28 = stdin; } else { pcVar11 = *(char **)((long)apcStack144[3] + (long)local_54 * 8); *(undefined8 *)(puVar14 + -8) = 0x1027cd; local_28 = fopen(pcVar11,"r"); if (local_28 == (FILE *)0x0) { *(undefined8 *)(puVar14 + -8) = 0x1027e1; piVar10 = __errno_location(); iVar7 = *piVar10; *(undefined8 *)(puVar14 + -8) = 0x1027ea; pcVar11 = strerror(iVar7); uVar1 = *(undefined8 *)((long)apcStack144[3] + (long)local_54 * 8); *(char **)(puVar14 + -8) = pcVar11; *(undefined8 *)(puVar14 + -0x10) = uVar1; *(undefined8 *)(puVar14 + -0x18) = __progname; *(char **)(puVar14 + -0x20) = "%s: %s: %s"; *(undefined8 *)(puVar14 + -0x28) = 0x102842; sshfatal("ssh-keyscan.c",&__func___19623,0x321,0,1,0); puVar14 = puVar14 + -0x20; goto LAB_00102842; } } while( true ) { pFVar4 = local_28; *(undefined8 *)(puVar14 + -8) = 0x1028f0; _Var9 = getline(&local_48,&local_40,pFVar4); pFVar4 = local_28; if (_Var9 == -1) break; LAB_00102842: pcVar11 = local_48; *(undefined8 *)(puVar14 + -8) = 0x102853; local_30 = strchr(pcVar11,0x23); pcVar11 = local_48; if (local_30 == (char *)0x0) { *(undefined8 *)(puVar14 + -8) = 0x10286e; sVar8 = strlen(pcVar11); local_30 = pcVar11 + (sVar8 - 1); } while ((pcVar3 = local_30, pcVar11 = local_48, local_48 <= local_30 && ((((*local_30 == ' ' || (*local_30 == '\t')) || (*local_30 == '\n')) || (*local_30 == '#'))))) { local_30 = local_30 + -1; *pcVar3 = '\0'; } if (*local_48 != '\0') { *(undefined8 *)(puVar14 + -8) = 0x1028d9; do_host(pcVar11); } } *(undefined8 *)(puVar14 + -8) = 0x102906; iVar7 = ferror(pFVar4); if (iVar7 != 0) { *(undefined8 *)(puVar14 + -8) = 0x10290f; piVar10 = __errno_location(); iVar7 = *piVar10; *(undefined8 *)(puVar14 + -8) = 0x102918; pcVar11 = strerror(iVar7); uVar1 = *(undefined8 *)((long)apcStack144[3] + (long)local_54 * 8); *(char **)(puVar14 + -8) = pcVar11; *(undefined8 *)(puVar14 + -0x10) = uVar1; *(undefined8 *)(puVar14 + -0x18) = __progname; *(char **)(puVar14 + -0x20) = "%s: %s: %s"; *(undefined8 *)(puVar14 + -0x28) = 0x102970; sshfatal("ssh-keyscan.c",&__func___19623,0x337,0,1,0); puVar14 = puVar14 + -0x20; } pFVar4 = local_28; *(undefined8 *)(puVar14 + -8) = 0x10297c; fclose(pFVar4); iVar7 = local_54; *(undefined8 *)(puVar14 + -8) = 0x102989; local_54 = __addvsi3(iVar7,1); } *(undefined8 *)(puVar14 + -8) = 0x1029a4; free(pcVar11); while (BSDoptind < local_6c) { *(undefined8 *)(puVar14 + -8) = 0x1029b8; BSDoptind = __addvsi3(BSDoptind,1); *(undefined8 *)(puVar14 + -8) = 0x1029db; do_host(); } while (0 < ncon) { *(undefined8 *)(puVar14 + -8) = 0x1029ed; conloop(); } if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) { *(undefined8 *)(puVar14 + -8) = 0x102a19; __stack_chk_fail(); } return found_one == 0; } *(undefined8 *)((long)ppcVar13 + -8) = 0x10229c; uVar5 = __addvsi3(local_50,0xffffffcc); puVar12 = (undefined *)ppcVar13; switch(uVar5) { case 0: IPv4or6 = 2; goto LAB_001025bf; default: *(undefined8 *)((long)ppcVar13 + -8) = 0x1025bf; usage(); goto LAB_001025bf; case 2: IPv4or6 = 10; goto LAB_001025bf; case 0x10: print_sshfp = 1; goto LAB_001025bf; case 0x14: hash_hosts = 1; goto LAB_001025bf; case 0x20: *(undefined8 *)((long)ppcVar13 + -8) = 0x102353; timeout = convtime(); if ((timeout == -1) || (timeout == 0)) { *(undefined8 *)((long)ppcVar13 + -8) = 0x102394; fprintf(stderr,"Bad timeout \'%s\'\n",BSDoptarg); *(undefined8 *)((long)ppcVar13 + -8) = 0x102399; usage(); } goto LAB_001025bf; case 0x2f: get_cert = 1; goto LAB_001025bf; case 0x32: goto switchD_001022c5_caseD_32; case 0x3c: break; case 0x40: get_keytypes = 0; *(undefined8 *)((long)ppcVar13 + -8) = 0x102484; local_38 = strtok(BSDoptarg,","); while (local_38 != (char *)0x0) { *(undefined8 *)((long)ppcVar13 + -8) = 0x102499; local_4c = sshkey_type_from_name(local_38); switch(local_4c) { case 0: get_keytypes = get_keytypes | 2; break; case 1: get_keytypes = get_keytypes | 1; break; case 2: get_keytypes = get_keytypes | 4; break; case 3: get_keytypes = get_keytypes | 8; break; default: *(char **)((long)ppcVar13 + -8) = local_38; *(char **)((long)ppcVar13 + -0x10) = "Unknown key type \"%s\""; *(undefined8 *)((long)ppcVar13 + -0x18) = 0x102580; sshfatal("ssh-keyscan.c",&__func___19623,0x2fa,0,1,0); ppcVar13 = (char **)((long)ppcVar13 + -0x10); break; case 8: get_keytypes = get_keytypes | 0x10; break; case 10: get_keytypes = get_keytypes | 0x20; break; case 0xc: get_keytypes = get_keytypes | 0x40; } *(undefined8 *)((long)ppcVar13 + -8) = 0x102591; local_38 = strtok((char *)0x0,","); } goto LAB_001025bf; case 0x42: if (local_60 == 0) { local_60 = 1; local_5c = 5; goto LAB_001025bf; } if (local_5c < 7) { *(undefined8 *)((long)ppcVar13 + -8) = 0x1023ca; local_5c = __addvsi3(local_5c,1); goto LAB_001025bf; } puVar12 = (undefined *)((long)ppcVar13 + -0x10); *(char **)((long)ppcVar13 + -0x10) = "Too high debugging level."; *(undefined8 *)((long)ppcVar13 + -0x18) = 0x10240c; sshfatal("ssh-keyscan.c",&__func___19623,0x2d5,0,1,0); switchD_001022c5_caseD_32: *(undefined8 *)(puVar12 + -8) = 0x102422; iVar6 = strcmp(BSDoptarg,"-"); iVar7 = local_58; if (iVar6 == 0) { BSDoptarg = (char *)0x0; } *(undefined8 *)(puVar12 + -8) = 0x102440; local_58 = __addvsi3(local_58,1); *(char **)((long)apcStack144[3] + (long)iVar7 * 8) = BSDoptarg; ppcVar13 = (char **)puVar12; goto LAB_001025bf; } *(undefined8 *)((long)ppcVar13 + -8) = 0x102304; ssh_port = a2port(); if (ssh_port < 1) { *(undefined8 *)((long)ppcVar13 + -8) = 0x10233a; fprintf(stderr,"Bad port \'%s\'\n",BSDoptarg); *(undefined8 *)((long)ppcVar13 + -8) = 0x102344; exit(1); } goto LAB_001025bf; }
static int nan_compare (char const *sa, char const *sb) { long double a; memset (&a, 0, sizeof a); a = strtold (sa, ((void *)0) ); long double b; memset (&b, 0, sizeof b); b = strtold (sb, ((void *)0) ); return memcmp (&a, &b, sizeof a); }
int nan_compare(const char *a1, const char *a2) { LONG_DOUBLE_16 s; LONG_DOUBLE_16 s2; unsigned long v5; v5 = __readfsqword(0x28u); memset(&s, 0, sizeof(s)); *(long double *)&s = strtold(a1, 0LL); memset(&s2, 0, sizeof(s2)); *(long double *)&s2 = strtold(a2, 0LL); return memcmp(&s, &s2, 0x10uLL); }
1 , SOCK_STREAM , 0, pair) == -1) { sshlog("ssh-sk-client.c", __func__, 73, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "socketpair: %s", strerror( (*__errno_location ()) )); return -24; }
void sshlog(void) { halt_baddata(); }
static _Bool is_directory (const struct fileinfo *f) { return f->filetype == directory || f->filetype == arg_directory; }
_BOOL8 is_directory(long a1) { return *(_DWORD *)(a1 + 168) == 3 || *(_DWORD *)(a1 + 168) == 9; }
struct pkginfo * deppossi_pkg_iter_next(struct deppossi_pkg_iterator *iter) { struct pkginfo *pkg_cur; struct pkgbin *pkgbin; while ((pkg_cur = iter->pkg_next)) { iter->pkg_next = pkg_cur->arch_next; switch (iter->which_pkgbin) { case wpb_installed: pkgbin = &pkg_cur->installed; break; case wpb_available: pkgbin = &pkg_cur->available; break; case wpb_by_istobe: if (pkg_cur->clientdata && pkg_cur->clientdata->istobe == PKG_ISTOBE_INSTALLNEW) pkgbin = &pkg_cur->available; else pkgbin = &pkg_cur->installed; break; default: do_internerr("depcon.c", 85, __func__, "unknown which_pkgbin %d", iter->which_pkgbin); } if (archsatisfied(pkgbin, iter->possi)) return pkg_cur; } return ((void *)0) ; }
int deppossi_pkg_iter_next(struct_0 *a0) { unsigned long long v0; struct_1 *v1; unsigned int v3; do { v1 = a0->field_8; if (!v1) { v3 = 0; goto LABEL_400159; } a0->field_8 = v1->field_8; if (a0->field_10 != 2) { if (a0->field_10 <= 2) { if (!a0->field_10) { v0 = &v1->padding_10[56]; goto LABEL_40011d; } if (a0->field_10 == 1) { v0 = &v1->padding_10[176]; goto LABEL_40011d; } } do_internerr("depcon.c", 0x55, "deppossi_pkg_iter_next", "unknown which_pkgbin %d", a0->field_10); goto LABEL_40011d; } if (v1->field_138 && v1->field_138->field_0 == 2) { v0 = &v1->padding_10[176]; goto LABEL_40011d; } v0 = &v1->padding_10[56]; LABEL_40011d: } while (!archsatisfied(v0, a0->field_0, a0->field_0)); v3 = v1; LABEL_400159: return v3; }
sc->type != 3) { sshlog("mux.c", __func__, 229, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "channel %d: not open", sc->self); chan_mark_dead(ssh, sc); } else {
void sshlog(void) { halt_baddata(); }
_Bool pred_ok (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr) { if (is_ok (pred_ptr->args.exec_vec.replace_vec[0], pathname)) return impl_pred_exec (pathname, stat_buf, pred_ptr); else return 0 ; }
long long pred_ok(unsigned long a0, unsigned long long a1, struct_0 *a2, unsigned int a3, unsigned long long a4, unsigned long long a5) { void* v2; if (is_ok(a2->field_e8->field_0, a0, a0, a3, a4, a5)) v2 = impl_pred_exec(a0, a1, a2, a1); else v2 = 0; return v2; }
static errcode_t mark_bmap_range(ext2fs_block_bitmap map, blk64_t blk, unsigned int num) { if (blk >= ext2fs_get_generic_bmap_start(map) && blk + num <= ext2fs_get_generic_bmap_end(map)) ext2fs_mark_block_bitmap_range2(map, blk, num); else return (2133571399L); return 0; }
int mark_bmap_range(unsigned long long a0, unsigned long long a1, unsigned long a2) { unsigned int v1; if (a1 >= ext2fs_get_generic_bmap_start(a0) && a2 + a1 <= ext2fs_get_generic_bmap_end(a0)) { ext2fs_mark_block_bitmap_range2(a0, a1, a2, a1); v1 = 0; goto LABEL_400371; } v1 = 2133571399; LABEL_400371: return v1; }
static int connect_to_helper(struct ssh *ssh, const char *name, int port, int socktype, char *ctype, char *rname, struct channel_connect *cctx, int *reason, const char **errmsg) { struct addrinfo hints; int gaierr; int sock = -1; char strport[ 32 ]; if (port == -2) { struct sockaddr_un *sunaddr; struct addrinfo *ai; if (strlen(name) > sizeof(sunaddr->sun_path)) { sshlog("channels.c", __func__, 4476, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "%.100s: %.100s", name, strerror( 36 )); return -1; } ai = xmalloc(sizeof(*ai) + sizeof(*sunaddr)); memset(ai, 0, sizeof(*ai) + sizeof(*sunaddr)); ai->ai_addr = (struct sockaddr *)(ai + 1); ai->ai_addrlen = sizeof(*sunaddr); ai->ai_family = 1 ; ai->ai_socktype = socktype; ai->ai_protocol = 0 ; sunaddr = (struct sockaddr_un *)ai->ai_addr; sunaddr->sun_family = 1 ; strlcpy(sunaddr->sun_path, name, sizeof(sunaddr->sun_path)); cctx->aitop = ai; } else { memset(&hints, 0, sizeof(hints)); hints.ai_family = ssh->chanctxt->IPv4or6; hints.ai_socktype = socktype; snprintf(strport, sizeof strport, "%d", port); if ((gaierr = getaddrinfo(name, strport, &hints, &cctx->aitop)) != 0) { if (errmsg != ((void *)0) ) *errmsg = ssh_gai_strerror(gaierr); if (reason != ((void *)0) ) *reason = 2; sshlog("channels.c", __func__, 4507, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "connect_to %.100s: unknown host (%s)", name, ssh_gai_strerror(gaierr)) ; return -1; } } cctx->host = xstrdup(name); cctx->port = port; cctx->ai = cctx->aitop; if ((sock = connect_next(cctx)) == -1) { sshlog("channels.c", __func__, 4518, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "connect to %.100s port %d failed: %s", name, port, strerror( (*__errno_location ()) )) ; return -1; } return sock; }
int connect_to_helper(struct_0 *a0, unsigned long a1, unsigned long a2, unsigned long long a3, unsigned long a4, unsigned long a5, void* v16, unsigned long a6, unsigned long a7) { unsigned long v0; unsigned long v1; unsigned long v2; unsigned long long *v3; unsigned int *v4; struct_2 *v5; unsigned long v6; unsigned long v7; unsigned int v8; unsigned int v9; struct_3 *v10; unsigned short *v11; char v12; unsigned int v13; unsigned int v14; char v15; unsigned int v17; v7 = a4; v6 = a5; v5 = v16; v4 = a6; v3 = a7; v8 = -1; if (a2 != -2) { memset(&v12, 0x0, 0x30); v13 = a0->field_868->field_9c; v14 = a3; snprintf(&v15, 0x20, "%d", a2); v9 = getaddrinfo(a1, &v15, &v12, &v5->field_18); if (v9) { if (v3) *(v3) = ssh_gai_strerror(v9); if (v4) *(v4) = 2; v1 = ssh_gai_strerror(v9); v0 = a1; sshlog("channels.c", "connect_to_helper", 0x119b, 0x0, 0x2, 0x0, "connect_to %.100s: unknown host (%s)"); v17 = -1; return v17; } } else { if (strlen(a1) > 108) { v1 = strerror(0x24); v0 = a1; sshlog("channels.c", "connect_to_helper", 0x117c, 0x0, 0x2, 0x0, "%.100s: %.100s"); v17 = -1; return v17; } v10 = xmalloc(0x9e); memset(v10, 0x0, 0x9e); v10->field_18 = &v10[1].field_10; v10->field_10 = 110; v10->field_4 = 1; v10->field_8 = a3; v10->field_c = 0; v11 = v10->field_18; *(v11) = 1; strlcpy(v11 + 1, a1, 0x6c, v11 + 1); v5->field_18 = v10; } v5->field_0 = xstrdup(a1); v5->field_8 = a2; v5->field_10 = v5->field_18; v8 = connect_next(v5, a1, v5->field_18, a3); if (v8 != -1) { v17 = v8; return v17; } v2 = strerror(*(__errno_location())); v1 = a2; v0 = a1; sshlog("channels.c", "connect_to_helper", 0x11a6, 0x0, 0x2, 0x0, "connect to %.100s port %d failed: %s"); v17 = -1; return v17; }
static inline void setInstParamDefaults(instanceData *pData) { pData->tplName = ((void *)0) ; }
void setInstParamDefaults(struct_0 *a0) { char v0; struct_0 *v2; unsigned long long v3; v2 = a0; a0->field_8 = 0; v3 = *(&v0); return; }
static void open_some_spaces (int col) { char *buffer; register int i; if (_rl_term_IC) { buffer = tgoto (_rl_term_IC, 0, col); tputs (buffer, 1, _rl_output_character_function); } else if (_rl_term_im && *_rl_term_im) { tputs (_rl_term_im, 1, _rl_output_character_function); for (i = col; i--; ) _rl_output_character_function (' '); if (_rl_term_ei && *_rl_term_ei) tputs (_rl_term_ei, 1, _rl_output_character_function); _rl_backspace (col); } else if (_rl_term_ic && *_rl_term_ic) { for (i = col; i--; ) tputs (_rl_term_ic, 1, _rl_output_character_function); } }
long long open_some_spaces(unsigned long a0) { unsigned long long v0; char *v2; unsigned long long v3; unsigned int v4; unsigned long long v5; if (_rl_term_IC) { v0 = tgoto(_rl_term_IC, 0x0, a0); v2 = tputs(v0, 0x1, *(&got._rl_output_character_function)); return v2; } if (_rl_term_im && *(_rl_term_im)) { tputs(_rl_term_im, 0x1, *(&got._rl_output_character_function)); v3 = a0; while (true) { v4 = v3; v3 -= 1; if (!v4) break; _rl_output_character_function(32); } if (_rl_term_ei && *(_rl_term_ei)) tputs(_rl_term_ei, 0x1, *(&got._rl_output_character_function)); v2 = _rl_backspace(a0); return v2; } v2 = _rl_term_ic; if (!_rl_term_ic) return v2; v2 = *(_rl_term_ic); if (!*(_rl_term_ic)) return v2; v5 = a0; while (true) { v2 = v5; v5 -= 1; if (!v2) break; tputs(_rl_term_ic, 0x1, *(&got._rl_output_character_function)); } return v2; }
_Bool must_be_dot_or_slash (char const *file_name) { file_name += ((void) ( file_name ), 0) ; if ( (( file_name[0] ) == '/') ) { for (;;) if ( (( file_name[1] ) == '/') ) file_name++; else if (file_name[1] == '.' && (( file_name[2 + (file_name[2] == '.')] ) == '/') ) file_name += 2 + (file_name[2] == '.'); else return ! file_name[1]; } else { while (file_name[0] == '.' && (( file_name[1] ) == '/') ) { file_name += 2; while ( (( *file_name ) == '/') ) file_name++; } return ! file_name[0] || (file_name[0] == '.' && ! file_name[1]); } }
bool must_be_dot_or_slash(_BYTE *a1) { long v1; long v2; _BYTE *v5; v5 = a1; if ( *a1 == 47 ) { while ( 1 ) { while ( v5[1] == 47 ) ++v5; if ( v5[1] != 46 ) break; v1 = v5[2] == 46 ? 3LL : 2LL; if ( v5[v1] != 47 ) break; if ( v5[2] == 46 ) v2 = 3LL; else v2 = 2LL; v5 += v2; } return v5[1] == 0; } else { while ( *v5 == 46 && v5[1] == 47 ) { for ( v5 += 2; *v5 == 47; ++v5 ) ; } return !*v5 || *v5 == 46 && !v5[1]; } }
int _rl_qsort_string_compare (char **s1, char **s2) { return (strcoll (*s1, *s2)); }
void _rl_qsort_string_compare(char **param_1,char **param_2) { strcoll(*param_1,*param_2); return; }
static _Bool removal_bulk_file_is_shared(struct pkginfo *pkg, struct fsys_namenode *namenode) { struct fsys_node_pkgs_iter *iter; struct pkginfo *otherpkg; _Bool shared = 0 ; if (pkgset_installed_instances(pkg->set) <= 1) return 0 ; iter = fsys_node_pkgs_iter_new(namenode); while ((otherpkg = fsys_node_pkgs_iter_next(iter))) { if (otherpkg == pkg) continue; if (otherpkg->set != pkg->set) continue; debug(dbg_eachfiledetail, "removal_bulk file shared with %s, skipping", pkg_name(otherpkg, pnaw_always)); shared = 1 ; break; } fsys_node_pkgs_iter_free(iter); return shared; }
int removal_bulk_file_is_shared(unsigned long long *a0, unsigned long long a1) { char v0; unsigned long long v1; unsigned long long *v2; unsigned int v4; v0 = 0; v4 = pkgset_installed_instances(*(a0)); if (v4 <= 1) { v4 = 0; } else { v1 = fsys_node_pkgs_iter_new(a1); while (true) { v2 = fsys_node_pkgs_iter_next(v1); if (!v2) break; if (v2 == a0) continue; if (*(v2) != *(a0)) continue; debug(0x40, "removal_bulk file shared with %s, skipping", pkg_name(v2, 0x3)); v0 = 1; break; } fsys_node_pkgs_iter_free(v1); v4 = v0; } return v4; }
void ssh_krl_free(struct ssh_krl *krl) { struct revoked_blob *rb, *trb; struct revoked_certs *rc, *trc; if (krl == ((void *)0) ) return; free(krl->comment); for ((rb) = revoked_blob_tree_RB_MINMAX(&krl->revoked_keys, -1); ((rb) != ((void *)0) ) && ((trb) = revoked_blob_tree_RB_NEXT(rb), 1); (rb) = (trb)) { revoked_blob_tree_RB_REMOVE(&krl->revoked_keys, rb); free(rb->blob); free(rb); } for ((rb) = revoked_blob_tree_RB_MINMAX(&krl->revoked_sha1s, -1); ((rb) != ((void *)0) ) && ((trb) = revoked_blob_tree_RB_NEXT(rb), 1); (rb) = (trb)) { revoked_blob_tree_RB_REMOVE(&krl->revoked_sha1s, rb); free(rb->blob); free(rb); } for ((rb) = revoked_blob_tree_RB_MINMAX(&krl->revoked_sha256s, -1); ((rb) != ((void *)0) ) && ((trb) = revoked_blob_tree_RB_NEXT(rb), 1); (rb) = (trb)) { revoked_blob_tree_RB_REMOVE(&krl->revoked_sha256s, rb); free(rb->blob); free(rb); } for ((rc) = ((&krl->revoked_certs)->tqh_first); (rc) != ((void *)0) && ((trc) = ((rc)->entry.tqe_next), 1); (rc) = (trc)) { do { if (((rc)->entry.tqe_next) != ((void *)0) ) (rc)->entry.tqe_next->entry.tqe_prev = (rc)->entry.tqe_prev; else (&krl->revoked_certs)->tqh_last = (rc)->entry.tqe_prev; *(rc)->entry.tqe_prev = (rc)->entry.tqe_next; ; ; } while (0); revoked_certs_free(rc); } }
void ssh_krl_free(unsigned long long a0[9]) { unsigned long long *v0; struct_1 *v1; unsigned long long v2[5]; void* v3; unsigned long long v5; struct_0 *v6; if (a0) { free(a0[3]); for (v0 = revoked_blob_tree_RB_MINMAX(&a0[4], 0xffffffff); v0; v0 = v3) { v3 = revoked_blob_tree_RB_NEXT(v0); revoked_blob_tree_RB_REMOVE(&a0[4], v0); free(*(v0)); free(v0); } for (v0 = revoked_blob_tree_RB_MINMAX(&a0[5], 0xffffffff); v0; v0 = v3) { v3 = revoked_blob_tree_RB_NEXT(v0); revoked_blob_tree_RB_REMOVE(&a0[5], v0); free(*(v0)); free(v0); } for (v0 = revoked_blob_tree_RB_MINMAX(&a0[6], 0xffffffff); v0; v0 = v3) { v3 = revoked_blob_tree_RB_NEXT(v0); revoked_blob_tree_RB_REMOVE(&a0[6], v0); free(*(v0)); free(v0); } v5 = a0[7]; for (v1 = a0[7]; v1; v1 = &v2[0]) { v2[0] = v1->field_18; if (v1->field_18) v1->field_18->field_20 = v1->field_20; else a0[8] = v1->field_20; v1->field_20->field_0 = v1->field_18; revoked_certs_free(v1); v6 = v2; } } return; }
static void usage(void) { fprintf( stderr , "Usage: ip ila add loc_match LOCATOR_MATCH loc LOCATOR [ dev DEV ] OPTIONS\n" " ip ila del loc_match LOCATOR_MATCH [ loc LOCATOR ] [ dev DEV ]\n" " ip ila list\n" "OPTIONS := [ csum-mode { adj-transport | neutral-map |\n" " neutral-map-auto | no-action } ]\n" " [ ident-type { luid | use-format } ]\n"); exit(-1); }
void usage() { fprintf(stderr, "Usage: ip ila add loc_match LOCATOR_MATCH loc LOCATOR [ dev DEV ] OPTIONS\n ip ila del loc_match LOCATOR_MATCH [ loc LOCATOR ] [ dev DEV ]\n ip ila list\nOPTIONS := [ csum-mode { adj-transport | neutral-map |\n neutral-map-auto | no-action } ]\n [ ident-type { luid | use-format } ]\n"); exit(0xffffffff); }
static crypto_uint32 lt(crypto_uint32 a,crypto_uint32 b) { unsigned int x = a; x -= (unsigned int) b; x >>= 31; return x; }
int lt(unsigned long a0, unsigned long a1) { unsigned int v0; v0 = a0; v0 -= a1; v0 >>= 31; return v0; }
int acl_get_tag_type(acl_entry_t entry_d, acl_tag_t *tag_type_p) { acl_entry_obj *entry_obj_p = ((acl_entry_obj *)__ext2int_and_check(entry_d, (0x9D6B))); if (!entry_obj_p) return -1; if (!tag_type_p) { (*__errno_location ()) = 22 ; return -1; } *tag_type_p = entry_obj_p->i.e_entry.e_tag; return 0; }
long long acl_get_tag_type(unsigned long long a0, unsigned int *a1) { struct_0 *v0; unsigned long long v2; v0 = __ext2int_and_check(a0, 0x9d6b); if (!v0) { v2 = 4294967295; } else if (!a1) { *(__errno_location()) = 22; v2 = 4294967295; } else { *(a1) = v0->field_20; v2 = 0; } return v2; }
void optimize_connection_fork (command) COMMAND *command; { if (command->type == cm_connection && (command->value.Connection->connector == 288 || command->value.Connection->connector == 289 || command->value.Connection->connector == ';') && (command->value.Connection->second->flags & 0x8000) && ((startup_state == 2 && should_suppress_fork (command->value.Connection->second)) || ((subshell_environment & 0x02) && should_optimize_fork (command->value.Connection->second, 0)))) { command->value.Connection->second->flags |= 0x40; command->value.Connection->second->value.Simple->flags |= 0x40; } }
long long optimize_connection_fork(struct_0 *a0) { unsigned int *v1; v1 = a0->field_0; if (a0->field_0 == 6) { switch (a0->field_18->field_18) { case 288: case 289: LABEL_40023d: v1 = *((a0->field_18->field_10 + 4)) & 0x8000; if ((*((a0->field_18->field_10 + 4)) & 0x8000) && (startup_state == 2 && should_suppress_fork(a0->field_18->field_10) || (v1 = (subshell_environment & 2), (subshell_environment & 2) && v1))) { *((a0->field_18->field_10 + 4)) = *((a0->field_18->field_10 + 4)) | 64; v1 = *((a0->field_18->field_10 + 24)); *(*((a0->field_18->field_10 + 24))) = *(*((a0->field_18->field_10 + 24))) | 64; break; } case 59: v1 = a0->field_18->field_18; break; default: v1 = a0->field_18->field_18; goto LABEL_40023d; } } return v1; }
int sshbuf_put_bignum2_bytes(struct sshbuf *buf, const void *v, size_t len) { u_char *d; const u_char *s = (const u_char *)v; int r, prepend; if (len > 0x8000000 - 5) { ; return -9; } for (; len > 0 && *s == 0; len--, s++) ; prepend = len > 0 && (s[0] & 0x80) != 0; if ((r = sshbuf_reserve(buf, len + 4 + prepend, &d)) < 0) return r; do { const u_int32_t __v = (len + prepend); ((u_char *)(d))[0] = (__v >> 24) & 0xff; ((u_char *)(d))[1] = (__v >> 16) & 0xff; ((u_char *)(d))[2] = (__v >> 8) & 0xff; ((u_char *)(d))[3] = __v & 0xff; } while (0); if (prepend) d[4] = 0; if (len != 0) memcpy(d + 4 + prepend, s, len); return 0; }
long long sshbuf_put_bignum2_bytes(unsigned long long a0, void* a1, unsigned int a2) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned long long v4; char *v5; unsigned long long v7; unsigned int v8; v0 = a2; v5 = a1; if (*(&v0) > 134217723) { v7 = 4294967287; } else { while (true) { if (!*(&v0)) break; if (*(v5)) break; *(&v0) = *(&v0) - 1; v5 += 1; } if (*(&v0) && *(v5) < 0) { v8 = 1; goto LABEL_401912; } v8 = 0; LABEL_401912: v1 = v8; v2 = sshbuf_reserve(a0, *(&v0) + v1 + 4, &v4, *(&v0) + v1 + 4); if (v2 < 0) { v7 = v2; } else { v3 = v1 + *(&v0); *(v4) = v3 >> 24; *((v4 + 1)) = v3 >> 16; *((v4 + 2)) = v3 >> 8; *((v4 + 3)) = v3; if (v1) *((v4 + 4)) = 0; if (*(&v0)) memcpy(v4 + v1 + 4, v5, *(&v0)); v7 = 0; } } return v7; }
int main (int argc, char **argv) { set_start_time (); set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("tar", "/usr/local/share/locale"); textdomain ("tar"); exit_failure = 2; exit_status = 0; error_hook = checkpoint_flush_actions; set_quoting_style (0, escape_quoting_style); close_stdout_set_file_name (gettext ("stdout")); if (stdopen ()) do { if (error_hook) error_hook (); error (0, 0, "%s", gettext ("failed to assert availability of the standard file descriptors")); fatal_exit (); } while (0) ; allocated_archive_names = 10; archive_name_array = xmalloc (sizeof (const char *) * allocated_archive_names); archive_names = 0; signal ( 17 , ((__sighandler_t) 0) ); priv_set_remove_linkdir (); decode_options (argc, argv); name_init (); if (volno_file_option) init_volume_number (); switch (subcommand_option) { case UNKNOWN_SUBCOMMAND: do { if (error_hook) error_hook (); error (0, 0, gettext ("You must specify one of the '-Acdtrux', '--delete' or '--test-label' options")); usage (2); } while (0) ; case CAT_SUBCOMMAND: case UPDATE_SUBCOMMAND: case APPEND_SUBCOMMAND: update_archive (); break; case DELETE_SUBCOMMAND: delete_archive_members (); break; case CREATE_SUBCOMMAND: create_archive (); break; case EXTRACT_SUBCOMMAND: extr_init (); read_and (extract_archive); extract_finish (); break; case LIST_SUBCOMMAND: read_and (list_archive); break; case DIFF_SUBCOMMAND: diff_init (); read_and (diff_archive); break; case TEST_LABEL_SUBCOMMAND: test_archive_label (); } checkpoint_finish (); if (totals_option) print_total_stats (); if (check_links_option) check_links (); if (volno_file_option) closeout_volume_number (); free (archive_name_array); xattrs_clear_setup (); name_term (); if (exit_status == 2) error (0, 0, gettext ("Exiting with failure status due to previous errors")); if (stdlis == stdout ) close_stdout (); else if (ferror_unlocked ( stderr ) || fclose ( stderr ) != 0) set_exit_status (2); return exit_status; }
int main(unsigned int a0, unsigned long long *a1, unsigned long long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) { unsigned long long v2; set_start_time(); set_program_name(*(a1)); setlocale(0x6, &g_407b53); bindtextdomain("tar", "/usr/local/share/locale"); textdomain("tar"); exit_failure = 2; exit_status = 0; error_hook = got.checkpoint_flush_actions; set_quoting_style(0x0, 0x7); close_stdout_set_file_name(gettext("stdout")); if (stdopen(a0, 0x7, a2, a3, a4, a5)) { if (error_hook) *(5242888)(); a3 = gettext("failed to assert availability of the standard file descriptors"); error(0x0, 0x0, "%s"); fatal_exit(0x0, 0x0, "%s", a3, a4, a5); } allocated_archive_names = 10; root_device = xmalloc(allocated_archive_names * 8); root_device = 0; signal(0x11, 0x0); priv_set_remove_linkdir(0x11, 0x0, "%s", a3, a4, a5); decode_options(a0, a1, a1, a3, a4, a5); name_init(a0, a1, a1, a3, a4, a5); init_volume_number(); switch (13872494295903503755) { case 0: if (error_hook) *(5242888)(); error(0x0, 0x0, gettext("You must specify one of the '-Acdtrux', '--delete' or '--test-label' options")); usage(0x2); case 1: case 2: case 8: update_archive(); break; case 3: create_archive(); break; case 4: delete_archive_members(); break; case 5: diff_init(); read_and(got.diff_archive); break; case 6: extr_init(); read_and(got.extract_archive); extract_finish(a0, a1, &g_40871c, a3, a4, a5); break; case 7: read_and(got.list_archive); break; case 9: test_archive_label(); } checkpoint_finish(); print_total_stats(a0, a1, a2, a3, a4, a5); if (check_links_option) check_links(); closeout_volume_number(); free(0x5dc0950fc085000f); xattrs_clear_setup(0x5dc0950fc085000f, a1, a2, a3, a4, a5); name_term(0x5dc0950fc085000f, a1, a2, a3, a4, a5); if (exit_status == 2) { a1 = 0; a0 = 0; error(0x0, 0x0, gettext("Exiting with failure status due to previous errors")); } if (stdlis == stdout) { close_stdout(a0, a1, stdlis, a3, a4, a5); } else { v2 = ferror_unlocked(stderr); if (v2 || fclose(stderr)) set_exit_status(0x2); } return exit_status; }
int main (int margc, char **margv) { _Bool value; ; set_program_name (margv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); initialize_exit_failure (TEST_FAILURE); atexit (close_stdout); argv = margv; if (0) { if (margc == 2) { if ((strcmp (margv[1], "--help") == 0)) usage ( 0 ); if ((strcmp (margv[1], "--version") == 0)) { version_etc ( stdout , "test", "GNU coreutils", Version, ("Kevin Braunsdorf"), ("Matthew Bradburn"), (char *) ((void *)0) ); return 0 ; } } if (margc < 2 || !(strcmp (margv[margc - 1], "]") == 0)) test_syntax_error (gettext ("missing %s"), quote ("]")); --margc; } argc = margc; pos = 1; if (pos >= argc) return TEST_FALSE; value = posixtest (argc - 1); if (pos != argc) test_syntax_error (gettext ("extra argument %s"), quote (argv[pos])); return value ? TEST_TRUE : TEST_FALSE; }
int main(int argc, const char **argv, const char **envp) { long v4; char *v5; long v6; long v7; long v8; long v9; bool v10; set_program_name(*argv, argv, envp); setlocale(6, locale); bindtextdomain("coreutils", "/usr/local/share/locale"); textdomain("coreutils"); initialize_exit_failure(2u); atexit((void (*)(void))&close_stdout); _argv = (long)argv; _argc = argc; pos = 1; if ( argc <= 1 ) return 1; v10 = posixtest((const char *)(unsigned int)(_argc - 1), "/usr/local/share/locale"); if ( pos != _argc ) { v4 = quote(*(_QWORD *)(8LL * pos + _argv)); v5 = gettext("extra argument %s"); test_syntax_error((long)v5, v4, v6, v7, v8, v9); } return !v10; }
static int modinfo_path_do(struct kmod_ctx *ctx, const char *path) { struct kmod_module *mod; int err = kmod_module_new_from_path(ctx, path, &mod); if (err < 0) { log_printf( 3 , "Module file %s not found.\n", path); return err; } err = modinfo_do(mod); kmod_module_unref(mod); return err; }
int modinfo_path_do(undefined8 param_1,undefined8 param_2) { int iVar1; long in_FS_OFFSET; undefined8 local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); iVar1 = kmod_module_new_from_path(param_1,param_2,&local_18); if (iVar1 < 0) { log_printf(3,"Module file %s not found.\n",param_2); } else { iVar1 = modinfo_do(local_18); kmod_module_unref(local_18); } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return iVar1; }
static int cclass_test (c, char_class) int c; enum char_class char_class; { int result; switch (char_class) { case CC_ASCII: result = ((( c ) & ~0x7f) == 0) ; break; case CC_ALNUM: result = (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISalnum) ); break; case CC_ALPHA: result = (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISalpha) ); break; case CC_BLANK: result = (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISblank) ); break; case CC_CNTRL: result = (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _IScntrl) ); break; case CC_DIGIT: result = (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISdigit) ); break; case CC_GRAPH: result = (1 && ((*__ctype_b_loc ())[(int) (( c ))] & (unsigned short int) _ISgraph) ); break; case CC_LOWER: result = (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISlower) ); break; case CC_PRINT: result = (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISprint) ); break; case CC_PUNCT: result = (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISpunct) ); break; case CC_SPACE: result = (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISspace) ); break; case CC_UPPER: result = (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISupper) ); break; case CC_WORD: result = ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISalnum) ) || c == '_'); break; case CC_XDIGIT: result = (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)c ))] & (unsigned short int) _ISxdigit) ); break; default: result = -1; break; } return result; }
uint cclass_test(uint param_1,undefined4 param_2) { ushort **ppuVar1; uint local_c; switch(param_2) { default: local_c = 0xffffffff; break; case 1: local_c = (uint)((param_1 & 0xffffff80) == 0); break; case 2: ppuVar1 = __ctype_b_loc(); local_c = (uint)(((*ppuVar1)[param_1 & 0xff] & 8) != 0); break; case 3: ppuVar1 = __ctype_b_loc(); local_c = (uint)(((*ppuVar1)[param_1 & 0xff] & 0x400) != 0); break; case 4: ppuVar1 = __ctype_b_loc(); local_c = (uint)(((*ppuVar1)[param_1 & 0xff] & 1) != 0); break; case 5: ppuVar1 = __ctype_b_loc(); local_c = (uint)(((*ppuVar1)[param_1 & 0xff] & 2) != 0); break; case 6: ppuVar1 = __ctype_b_loc(); local_c = (uint)(((*ppuVar1)[param_1 & 0xff] & 0x800) != 0); break; case 7: ppuVar1 = __ctype_b_loc(); local_c = (uint)(byte)((*ppuVar1)[(int)param_1] >> 0xf); break; case 8: ppuVar1 = __ctype_b_loc(); local_c = (uint)(((*ppuVar1)[param_1 & 0xff] & 0x200) != 0); break; case 9: ppuVar1 = __ctype_b_loc(); local_c = (uint)(((*ppuVar1)[param_1 & 0xff] & 0x4000) != 0); break; case 10: ppuVar1 = __ctype_b_loc(); local_c = (uint)(((*ppuVar1)[param_1 & 0xff] & 4) != 0); break; case 0xb: ppuVar1 = __ctype_b_loc(); local_c = (uint)(((*ppuVar1)[param_1 & 0xff] & 0x2000) != 0); break; case 0xc: ppuVar1 = __ctype_b_loc(); local_c = (uint)(((*ppuVar1)[param_1 & 0xff] & 0x100) != 0); break; case 0xd: ppuVar1 = __ctype_b_loc(); if ((((*ppuVar1)[param_1 & 0xff] & 8) == 0) && (param_1 != 0x5f)) { local_c = 0; } else { local_c = 1; } break; case 0xe: ppuVar1 = __ctype_b_loc(); local_c = (uint)(((*ppuVar1)[param_1 & 0xff] & 0x1000) != 0); } return local_c; }
static char * make_dev_fd_filename (fd) int fd; { char *ret, intbuf[(((sizeof (int) * 8) - (! ((int) 0 < (int) -1))) * 302 / 1000 + 1 + (! ((int) 0 < (int) -1))) + 1], *p; ret = (char *)sh_xmalloc((sizeof ("/dev/fd/") + 8), "subst.c", 6447); strcpy (ret, "/dev/fd/"); p = inttostr (fd, intbuf, sizeof (intbuf)); strcpy (ret + sizeof ("/dev/fd/") - 1, p); add_fifo_list (fd); return (ret); }
int make_dev_fd_filename(unsigned long a0) { char *v0; char *v1; char v2; v0 = sh_xmalloc(0x11, "subst.c", 0x192f); strcpy(v0, "/dev/fd/"); v1 = inttostr(a0, &v2, 0xc, &v2); strcpy(v0 + 8, v1); add_fifo_list(a0); return v0; }
void xtrace_print_cond_term (type, invert, op, arg1, arg2) int type, invert; WORD_DESC *op; char *arg1, *arg2; { xtrace_fp = (xtrace_fp ? xtrace_fp : stderr ); command_string_index = 0; fprintf (xtrace_fp, "%s", indirection_level_string ()); fprintf (xtrace_fp, "[[ "); if (invert) fprintf (xtrace_fp, "! "); if (type == 3) { fprintf (xtrace_fp, "%s ", op->word); fprintf (xtrace_fp, "%s", (arg1 && *arg1) ? arg1 : "''"); } else if (type == 4) { fprintf (xtrace_fp, "%s", (arg1 && *arg1) ? arg1 : "''"); fprintf (xtrace_fp, " %s ", op->word); fprintf (xtrace_fp, "%s", (arg2 && *arg2) ? arg2 : "''"); } fprintf (xtrace_fp, " ]]\n"); fflush (xtrace_fp); }
long long xtrace_print_cond_term(unsigned long a0, unsigned long a1, unsigned long long *a2, char *a3, char *a4) { unsigned int v1; v1 = (!*(&xtrace_fp) ? *(&xtrace_fp) : stderr); *(&xtrace_fp) = v1; command_string_index = 0; fprintf(*(&xtrace_fp), "%s", indirection_level_string()); fprintf(*(&xtrace_fp), "[[ "); if (a1) fprintf(*(&xtrace_fp), "! "); switch (a0) { case 3: fprintf(*(&xtrace_fp), "%s ", *(a2)); if (!a3 || !*(a3)) v1 = &g_40375b; else v1 = a3; fprintf(*(&xtrace_fp), "%s", v1); break; case 4: if (!a3 || !*(a3)) v1 = &g_40375b; else v1 = a3; fprintf(*(&xtrace_fp), "%s", v1); fprintf(*(&xtrace_fp), " %s ", *(a2)); if (!a4 || !*(a4)) v1 = &g_40375b; else v1 = a4; fprintf(*(&xtrace_fp), "%s", v1); default: goto LABEL_401d76; } LABEL_401d76: fprintf(*(&xtrace_fp), " ]]\n"); return fflush(*(&xtrace_fp)); }
static void check_blocks_extents(e2fsck_t ctx, struct problem_context *pctx, struct process_block_struct *pb) { struct ext2_extent_info info; struct ext2_inode *inode = pctx->inode; ext2_extent_handle_t ehandle; ext2_filsys fs = ctx->fs; ext2_ino_t ino = pctx->ino; errcode_t retval; blk64_t eof_lblk; struct ext3_extent_header *eh; eh = (struct ext3_extent_header *) &inode->i_block[0]; retval = ext2fs_extent_header_verify(eh, sizeof(inode->i_block)); if (retval) { if (fix_problem(ctx, 0x010081, pctx)) e2fsck_clear_inode(ctx, ino, inode, 0, "check_blocks_extents"); pctx->errcode = 0; return; } pctx->errcode = ext2fs_extent_open2(fs, ino, inode, &ehandle); if (pctx->errcode) { if (fix_problem(ctx, 0x010056, pctx)) e2fsck_clear_inode(ctx, ino, inode, 0, "check_blocks_extents"); pctx->errcode = 0; return; } retval = ext2fs_extent_get_info(ehandle, &info); if (retval == 0) { int max_depth = info.max_depth; if (max_depth >= 5) max_depth = 5 -1; ctx->extent_depth_count[max_depth]++; } pctx->blk = info.max_depth; pctx->blk2 = ext2fs_max_extent_depth(ehandle); if (pctx->blk2 < pctx->blk && fix_problem(ctx, 0x01007F, pctx)) pb->eti.force_rebuild = 1; pctx->blk = 5; if (pctx->blk2 > pctx->blk) fix_problem(ctx, 0x014005, pctx); memset(pb->eti.ext_info, 0, sizeof(pb->eti.ext_info)); pb->eti.ino = pb->ino; pb->next_lblock = 0; eof_lblk = ((((inode)->i_size | ((__u64) (inode)->i_size_high << 32)) + fs->blocksize - 1) >> ((fs->super)->s_log_block_size + 10)) - 1; scan_extent_node(ctx, pctx, pb, 0, 0, eof_lblk, ehandle, 1); if (pctx->errcode && fix_problem(ctx, 0x010057, pctx)) { pb->num_blocks = 0; inode->i_blocks = 0; e2fsck_clear_inode(ctx, ino, inode, 0x0004, "check_blocks_extents"); pctx->errcode = 0; } ext2fs_extent_free(ehandle); if ((((inode->i_mode) & 00170000) == 0040000) && e2fsck_dir_will_be_rehashed(ctx, ino)) return; if (ctx->options & 0x4000) e2fsck_rebuild_extents_later(ctx, ino); else e2fsck_should_rebuild_extents(ctx, pctx, &pb->eti, &info); }
void check_blocks_extents(struct_2 *a0, struct_0 *a1, struct_1 *a2) { unsigned int v0; unsigned int v1; char v2; struct_5 *v3; struct_3 *v4; unsigned long long v5; unsigned long v6; unsigned long long v7; char v8; char v9; char v10; unsigned long long *v12; unsigned long long v13; v3 = a1->field_18; v4 = *(&a0->field_0); v1 = a1->field_8; v5 = &v3->padding_20[8]; v6 = ext2fs_extent_header_verify(v5, 0x3c); if (v6) { if (fix_problem(a0, 0x10081, a1)) e2fsck_clear_inode(a0, v1, v3, 0x0, "check_blocks_extents"); a1->field_0 = 0; } else { a1->field_0 = ext2fs_extent_open2(v4, v1, v3, &v2); if (a1->field_0) { if (fix_problem(a0, 0x10056, a1)) e2fsck_clear_inode(a0, v1, v3, 0x0, "check_blocks_extents"); a1->field_0 = 0; } else { v6 = ext2fs_extent_get_info(*(&v2), &v8, &v8); if (!v6) { v0 = *(&v9); if (v0 > 4) v0 = 4; *(&a0[10].padding_1[15 + 4 * v0]) = *(&a0[10].padding_1[15 + 4 * v0]) + 1; } a1->field_28 = *(&v9); a1->field_30 = ext2fs_max_extent_depth(*(&v2)); if (a1->field_30 < a1->field_28 && fix_problem(a0, 0x1007f, a1)) a2->field_6c = 1; a1->field_28 = 5; if (a1->field_30 > a1->field_28) fix_problem(a0, 0x14005, a1); memset(a2 + 1, 0x0, 0x28); a2->field_68 = a2->field_0; a2->field_60 = 0; v7 = (v4->field_28 + (v3->field_4 | v3->field_6c * 0x100000000) - 1 >> ((v4->field_20->field_18 + 10) & 63)) - 1; scan_extent_node(a0, a1, a2, 0x0, 0x0, v7, *(&v2), 0x1); if (a1->field_0 && fix_problem(a0, 0x10057, a1)) { a2->field_8 = 0; v3->field_1c = 0; e2fsck_clear_inode(a0, v1, v3, 0x4, "check_blocks_extents"); a1->field_0 = 0; } ext2fs_extent_free(*(&v2)); if ((v3->field_0 & 0xf000) == 0x4000 && !(!e2fsck_dir_will_be_rehashed(a0, v1, v1))) goto LABEL_409326; if ((a0->field_4c & 0x4000)) e2fsck_rebuild_extents_later(a0, v1, v1); else e2fsck_should_rebuild_extents(a0, a1, &a2->field_68, &v8); } } LABEL_409326: v13 = *(&v10) ^ v12[5]; return; }
static _Bool copy_stringlist (char * const fromptrs[], size_t const fromlengths[], char *toptrs[], size_t tolengths[], lin copynum) { register char * const *f = fromptrs; register char **t = toptrs; register size_t const *fl = fromlengths; register size_t *tl = tolengths; while (copynum--) { if (*t) { if (*fl != *tl || memcmp (*f, *t, *fl) != 0) return 0 ; } else { *t = *f; *tl = *fl; } t++; f++; tl++; fl++; } return 1 ; }
local_a0 = *(long **)((long)local_a0 + 0x40)) { lVar4 = *(long *)((long)local_a0 + 0x10) - lVar6; cVar2 = copy_stringlist(*(undefined8 *)((long)local_a0 + 0x28), *(undefined8 *)((long)local_a0 + 0x38), lVar4 * 8 + *(long *)(puVar3 + 0x12), *(long *)(puVar3 + 0x18) + lVar4 * 8, (*(long *)((long)local_a0 + 0x18) - *(long *)((long)local_a0 + 0x10)) + 1); if (cVar2 != '\x01') { puVar3 = (undefined4 *)0x0; goto LAB_001014ac; } }
void log_set(FILE *file) { logfile = file; }
long long log_set(unsigned long long a0) { logfile = a0; return a0; }
int channel_proxy_upstream(Channel *c, int type, u_int32_t seq, struct ssh *ssh) { struct sshbuf *b = ((void *)0) ; Channel *downstream; const u_char *cp = ((void *)0) ; size_t len; int r; if (c == ((void *)0) || c->type != 20) return 0; if ((downstream = c->mux_ctx) == ((void *)0) ) return 0; switch (type) { case 97: case 94: case 96: case 95: case 91: case 92: case 93: case 99: case 100: case 98: break; default: sshlog("channels.c", __func__, 3123, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "channel %u: unsupported type %u", c->self, type); return 0; } if ((b = sshbuf_new()) == ((void *)0) ) { sshlog("channels.c", __func__, 3127, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "alloc reply"); goto out; } cp = sshpkt_ptr(ssh, &len); if (cp == ((void *)0) ) { sshlog("channels.c", __func__, 3133, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "no packet"); goto out; } if ((r = sshbuf_put_u8(b, 0)) != 0 || (r = sshbuf_put_u8(b, type)) != 0 || (r = sshbuf_put_u32(b, c->mux_downstream_id)) != 0 || (r = sshbuf_put(b, cp, len)) != 0 || (r = sshbuf_put_stringb(downstream->output, b)) != 0) { sshlog("channels.c", __func__, 3142, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "compose muxclient"); goto out; } if (ssh_packet_log_type(type)) sshlog("channels.c", __func__, 3147, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "channel %u: up->down: type %u", c->self, type); out: switch (type) { case 91: if (cp && len > 4) { c->remote_id = (((u_int32_t)(((const u_char *)(cp))[0]) << 24) | ((u_int32_t)(((const u_char *)(cp))[1]) << 16) | ((u_int32_t)(((const u_char *)(cp))[2]) << 8) | (u_int32_t)(((const u_char *)(cp))[3])); c->have_remote_id = 1; } break; case 97: if (c->flags & 0x01) channel_free(ssh, c); else c->flags |= 0x02; break; } sshbuf_free(b); return 1; }
int channel_proxy_upstream(struct_0 *a0, unsigned long long a1, unsigned long long a2, void* a3, unsigned long long a4, unsigned long long a5) { unsigned long v0; unsigned int v1; unsigned int v2; char v3; void* v4; void* v5; struct_1 *v6; unsigned int v8; v1 = a2; v5 = 0; v4 = 0; if (!a0) { v8 = 0; return v8; } else if (a0->field_0 != 20) { v8 = 0; return v8; } else { v6 = a0->field_150; if (!v6) { v8 = 0; return v8; } else if (a1 - 91 <= 9) { v5 = sshbuf_new(a0, a1, a2, a3, a4, a5); if (!v5) { sshlog("channels.c", "channel_proxy_upstream", 0xc37, 0x1, 0x2, 0x0, "alloc reply"); } else { v4 = sshpkt_ptr(a3, &v3, &v3); if (!v4) { sshlog("channels.c", "channel_proxy_upstream", 0xc3d, 0x1, 0x2, 0x0, "no packet"); } else { v2 = sshbuf_put_u8(v5, 0x0); if (v2) { sshlog("channels.c", "channel_proxy_upstream", 0xc46, 0x1, 0x2, ssh_err(v2), "compose muxclient"); } else { v2 = sshbuf_put_u8(v5, a1); if (v2) { sshlog("channels.c", "channel_proxy_upstream", 0xc46, 0x1, 0x2, ssh_err(v2), "compose muxclient"); } else { v2 = sshbuf_put_u32(v5, a0->field_15c, a0->field_15c); if (v2) { sshlog("channels.c", "channel_proxy_upstream", 0xc46, 0x1, 0x2, ssh_err(v2), "compose muxclient"); } else { v2 = sshbuf_put(v5, v4, *(&v3), v4); if (v2) { sshlog("channels.c", "channel_proxy_upstream", 0xc46, 0x1, 0x2, ssh_err(v2), "compose muxclient"); } else { v2 = sshbuf_put_stringb(v6->field_70, v5, v5); if (v2) { sshlog("channels.c", "channel_proxy_upstream", 0xc46, 0x1, 0x2, ssh_err(v2), "compose muxclient"); } else if (ssh_packet_log_type(a1)) { v0 = a0->field_4; sshlog("channels.c", "channel_proxy_upstream", 0xc4b, 0x1, 0x7, 0x0, "channel %u: up->down: type %u"); } } } } } } } switch (a1) { case 91: if (v4 && *(&v3) > 4) { a0->field_8 = (*(v4) * 0x1000000) | (v4[1] * 0x10000) | (v4[2] * 0x100) | v4[3]; a0->field_c = 1; } break; case 97: if (!(a0->field_18 & 1)) { a0->field_18 = a0->field_18 | 2; break; } else { channel_free(a3, a0); break; } default: goto LABEL_40a869; } LABEL_40a869: sshbuf_free(v5); v8 = 1; return v8; } else { v0 = a0->field_4; sshlog("channels.c", "channel_proxy_upstream", 0xc33, 0x1, 0x6, 0x0, "channel %u: unsupported type %u"); v8 = 0; return v8; } } }
const wchar_t * el_wgets(EditLine *el, int *nread) { int retval; el_action_t cmdnum = 0; int num; wchar_t ch; int nrb; if (nread == ((void *)0) ) nread = &nrb; *nread = 0; el->el_read->read_errno = 0; if (el->el_flags & 0x002) { el->el_line.lastchar = el->el_line.buffer; return noedit_wgets(el, nread); } if ((el->el_flags & 0x008) == 0) read_prepare(el); if (el->el_flags & 0x004) { if ((el->el_flags & 0x008) == 0) el->el_line.lastchar = el->el_line.buffer; terminal__flush(el); return noedit_wgets(el, nread); } for (num = -1; num == -1;) { if (read_getcmd(el, &cmdnum, &ch) == -1) break; if ((size_t)cmdnum >= el->el_map.nfunc) continue; el->el_state.thiscmd = cmdnum; el->el_state.thisch = ch; if (el->el_map.type == 1 && el->el_map.current == el->el_map.key && el->el_chared.c_redo.pos < el->el_chared.c_redo.lim) { if (cmdnum == 58 && el->el_chared.c_redo.pos != el->el_chared.c_redo.buf && iswprint(el->el_chared.c_redo.pos[-1])) el->el_chared.c_redo.pos--; else *el->el_chared.c_redo.pos++ = ch; } retval = (*el->el_map.func[cmdnum]) (el, ch); el->el_state.lastcmd = cmdnum; switch (retval) { case 5: re_refresh_cursor(el); break; case 8: re_clear_lines(el); re_clear_display(el); case 4: re_refresh(el); break; case 9: re_refresh(el); terminal_beep(el); break; case 0: break; case 3: continue; case 2: if ((el->el_flags & 0x008) == 0) num = 0; else if (num == -1) { *el->el_line.lastchar++ = (('d') & 037); el->el_line.cursor = el->el_line.lastchar; num = 1; } break; case 1: num = (int)(el->el_line.lastchar - el->el_line.buffer); break; case 7: re_clear_display(el); ch_reset(el); read_clearmacros(&el->el_read->macros); re_refresh(el); break; case 6: default: terminal_beep(el); terminal__flush(el); break; } el->el_state.argument = 1; el->el_state.doingarg = 0; el->el_chared.c_vcmd.action = 0x00; if (el->el_flags & 0x008) break; } terminal__flush(el); if ((el->el_flags & 0x008) == 0) { read_finish(el); *nread = num != -1 ? num : 0; } else *nread = (int)(el->el_line.lastchar - el->el_line.buffer); if (*nread == 0) { if (num == -1) { *nread = -1; if (el->el_read->read_errno) (*__errno_location ()) = el->el_read->read_errno; } return ((void *)0) ; } else return el->el_line.buffer; }
long long el_wgets(struct_0 *a0, unsigned int *a1) { unsigned int *v0; int tmp_16; struct_3 *v1; char v2; char v3; char v4; unsigned int v5; unsigned int v6; void* v8; unsigned int *v9; v1 = &a0->padding_0; v0 = a1; v2 = 0; if (!v0) v0 = &v4; *(v0) = 0; a0->field_4c0->field_18 = 0; if ((a0->field_2c & 2)) { a0->field_60 = a0->field_50; v8 = noedit_wgets(a0, v0); return v8; } if (!(a0->field_2c & 8)) read_prepare(a0); if ((a0->field_2c & 4)) { if (!(a0->field_2c & 8)) a0->field_60 = a0->field_50; terminal__flush(a0); v8 = noedit_wgets(a0, v0); return v8; } else { v5 = -1; while (true) { if (!(v5 == -1) || !(read_getcmd(a0, &v2, &v3) != -1)) break; if (!(v2 < a0->field_438)) continue; a0->field_81 = v2; a0->field_84 = *(&v3); if (a0->field_420 == 1 && a0->field_400 == a0->field_3f8 && a0->field_3a0 < a0->field_3a8) { if (v2 != 58 || a0->field_3a0 == a0->field_398 || !iswprint(*((a0->field_3a0 - 4)))) { v9 = a0->field_3a0; a0->field_3a0 = a0->field_3a0 + 4; *(v9) = *(&v3); } else { a0->field_3a0 = a0->field_3a0 - 4; } } v6 = *((a0->field_430 + v2 * 8))(a0, *(&v3), *((a0->field_430 + v2 * 8)), *(&v3)); a0->field_80 = v2; switch (v6) { case 0: break; case 1: v5 = a0->field_60 + -1 * a0->field_50 >> 2; break; case 2: if (!(a0->field_2c & 8)) { v5 = 0; } else if (v5 == -1) { tmp_16 = a0->field_60; a0->field_60 = a0->field_60 + 1; *(tmp_16) = 4; a0->field_58 = a0->field_60; v5 = 1; } break; case 4: re_refresh(a0); break; case 5: re_refresh_cursor(a0); break; case 7: re_clear_display(a0); ch_reset(a0); read_clearmacros(a0->field_4c0); re_refresh(a0); break; case 8: re_clear_lines(a0); re_clear_display(a0); case 9: re_refresh(a0); terminal_beep(a0); break; default: terminal_beep(a0); terminal__flush(a0); break; } continue; a0->field_78 = 1; a0->field_74 = 0; a0->field_3c0 = 0; if ((a0->field_2c & 8)) break; } terminal__flush(a0); if ((a0->field_2c & 8)) { *(v0) = a0->field_60 + -1 * a0->field_50 >> 2; } else { read_finish(a0); *(&v9) = (v5 == -1 ? v5 : 0); *(v0) = v9; } if (*(v0)) { v8 = a0->field_50; return v8; } else if (v5 != -1) { v8 = 0; return v8; } else { *(v0) = -1; if (a0->field_4c0->field_18) { *(__errno_location()) = a0->field_4c0->field_18; v8 = 0; return v8; } v8 = 0; return v8; } } }
static void usage (int status) { FILE *usageout = ( 0 != status) ? stderr : stdout ; (void) fprintf (usageout, gettext ("Usage: %s [options]\n" "\n" "Options:\n") , Prog); (void) fprintf (usageout, gettext (" -c, --crypt-method METHOD the crypt method (one of %s)\n"), "NONE DES MD5" " SHA256 SHA512" ); (void) fputs (gettext (" -e, --encrypted supplied passwords are encrypted\n"), usageout); (void) fputs (gettext (" -h, --help display this help message and exit\n"), usageout); (void) fputs (gettext (" -m, --md5 encrypt the clear text password using\n" " the MD5 algorithm\n") , usageout); (void) fputs (gettext (" -R, --root CHROOT_DIR directory to chroot into\n"), usageout); (void) fputs (gettext (" -s, --sha-rounds number of rounds for the SHA, BCRYPT\n" " or YESCRYPT crypt algorithms\n") , usageout); (void) fputs ("\n", usageout); exit (status); }
void usage(int param_1) { undefined8 uVar1; FILE *__stream; char *pcVar2; uVar1 = Prog; __stream = stdout; if (param_1 != 0) { __stream = stderr; } pcVar2 = (char *)gettext("Usage: %s [options]\n\nOptions:\n"); fprintf(__stream,pcVar2,uVar1); pcVar2 = (char *)gettext(" -c, --crypt-method METHOD the crypt method (one of %s)\n"); fprintf(__stream,pcVar2,"NONE DES MD5 SHA256 SHA512"); pcVar2 = (char *)gettext(" -e, --encrypted supplied passwords are encrypted\n"); fputs(pcVar2,__stream); pcVar2 = (char *)gettext(" -h, --help display this help message and exit\n"); fputs(pcVar2,__stream); pcVar2 = (char *)gettext( " -m, --md5 encrypt the clear text password using\n the MD5 algorithm\n" ); fputs(pcVar2,__stream); pcVar2 = (char *)gettext(" -R, --root CHROOT_DIR directory to chroot into\n"); fputs(pcVar2,__stream); pcVar2 = (char *)gettext( " -s, --sha-rounds number of rounds for the SHA, BCRYPT\n or YESCRYPT crypt algorithms\n" ); fputs(pcVar2,__stream); fputs("\n",__stream); exit(param_1); }
int strvec_len (array) char **array; { register int i; for (i = 0; array[i]; i++); return (i); }
int strvec_len(unsigned long long *a0) { void* v1; for (v1 = 0; *((a0 + 0x8 * v1)); v1 = v1 + 1); return v1; }
static void setExit ( Int32 v ) { if (v > exitValue) exitValue = v; }
void setExit(int param_1) { if (exitValue < param_1) { exitValue = param_1; } return; }
char * shadow_pw(struct passwd *pw) { char *pw_password = pw->pw_passwd; struct spwd *spw = getspnam(pw->pw_name); if (spw != ((void *)0) ) pw_password = spw->sp_pwdp; return pw_password; }
int shadow_pw(unsigned long long a0[2]) { unsigned long v0; struct_0 *v1; v0 = a0[1]; v1 = getspnam(a0[0]); if (v1) v0 = v1->field_8; return v0; }
void update_parent_directory (struct tar_stat_info *parent) { struct directory *directory = find_directory (parent->orig_file_name); if (directory) { struct stat st; if (fstat (parent->fd, &st) != 0) stat_diag (directory->name); else directory->mtime = get_stat_mtime (&st); } }
long long update_parent_directory(struct_0 *a0) { unsigned long long v0[12]; char v1; unsigned long long v3[12]; v0[0] = find_directory(a0->field_0); if (!v0) { return 0; } else if (!fstat(a0->field_1a8, &v1)) { v3 = v0; v3[1] = get_stat_mtime(&v1); v3[2] = &v1; return 0; } else { stat_diag(v0[11]); return 0; } }
tty_noquotemode(EditLine *el) { if (el->el_tty.t_mode != 2) return 0; if (tty_setty(el, 1 , &el->el_tty.t_ed) == -1) { return -1; } el->el_tty.t_mode = 1; return 0; }
long long tty_noquotemode(struct_0 *a0) { unsigned long long v1; if (a0->field_308 != 2) { v1 = 0; } else if (tty_setty(a0, 0x1, &a0->padding_0[644]) == -1) { v1 = 4294967295; } else { a0->field_308 = 1; v1 = 0; } return v1; }