input
stringlengths
28
169k
output
stringlengths
20
317k
static void init_header (char const *filename, int desc) { char *buf = ((void *)0) ; struct stat st; struct timespec t; int ns; struct tm tm; if ((strcmp (filename, "-") == 0)) desc = -1; if (0 <= desc && fstat (desc, &st) == 0) t = get_stat_mtime (&st); else { static struct timespec timespec; if (! timespec.tv_sec) gettime (&timespec); t = timespec; } ns = t.tv_nsec; if (localtime_rz (localtz, &t.tv_sec, &tm)) { size_t bufsize = nstrftime ( ((void *)0) , (18446744073709551615UL) , date_format, &tm, localtz, ns) + 1; buf = xmalloc (bufsize); nstrftime (buf, bufsize, date_format, &tm, localtz, ns); } else { char secbuf[((((((sizeof (intmax_t) * 8) - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) + 1)]; buf = xmalloc (sizeof secbuf + ((( 10 )>( ((((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) + 1) ))?( 10 ):( ((((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) + 1) )) ); sprintf (buf, "%s.%09d", timetostr (t.tv_sec, secbuf), ns); } free (date_text); date_text = buf; file_text = custom_header ? custom_header : desc < 0 ? "" : filename; header_width_available = (chars_per_line - gnu_mbswidth (date_text, 0) - gnu_mbswidth (file_text, 0)); }
void init_header(char *param_1,int param_2) { ulong uVar1; int iVar2; int iVar3; int iVar4; long lVar5; undefined8 uVar6; long in_FS_OFFSET; int local_144; char *local_128; undefined local_118 [16]; undefined local_108 [64]; stat local_c8; undefined local_38 [24]; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); iVar2 = strcmp(param_1,"-"); local_144 = param_2; if (iVar2 == 0) { local_144 = -1; } if ((local_144 < 0) || (iVar2 = fstat(local_144,&local_c8), iVar2 != 0)) { if (timespec_6247._0_8_ == 0) { gettime(timespec_6247); } local_118 = CONCAT88(timespec_6247._8_8_,timespec_6247._0_8_); } else { local_118 = get_stat_mtime(&local_c8); } local_118._8_8_ = SUB168(local_118 >> 0x40,0); uVar1 = local_118._8_8_; lVar5 = localtime_rz(localtz,local_118,local_108); if (lVar5 == 0) { local_128 = (char *)xmalloc(0x21); uVar6 = timetostr(local_118._0_8_,local_38); sprintf(local_128,"%s.%09d",uVar6,uVar1 & 0xffffffff); } else { lVar5 = nstrftime(0,0xffffffffffffffff,date_format,local_108,localtz,uVar1 & 0xffffffff); local_128 = (char *)xmalloc(lVar5 + 1); nstrftime(local_128,lVar5 + 1,date_format,local_108,localtz,uVar1 & 0xffffffff); } free(date_text); iVar2 = chars_per_line; date_text = local_128; file_text = custom_header; if ((custom_header == (char *)0x0) && (file_text = param_1, local_144 < 0)) { file_text = ""; } iVar3 = gnu_mbswidth(local_128,0); iVar4 = gnu_mbswidth(file_text,0); header_width_available = (iVar2 - iVar3) - iVar4; if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
static const char * fmt_intarg(OpCodes code, int val) { if (val == -1) return "unset"; switch (code) { case oAddressFamily: return fmt_multistate_int(val, multistate_addressfamily); case oVerifyHostKeyDNS: case oUpdateHostkeys: return fmt_multistate_int(val, multistate_yesnoask); case oStrictHostKeyChecking: return fmt_multistate_int(val, multistate_strict_hostkey); case oControlMaster: return fmt_multistate_int(val, multistate_controlmaster); case oTunnel: return fmt_multistate_int(val, multistate_tunnel); case oRequestTTY: return fmt_multistate_int(val, multistate_requesttty); case oSessionType: return fmt_multistate_int(val, multistate_sessiontype); case oCanonicalizeHostname: return fmt_multistate_int(val, multistate_canonicalizehostname); case oAddKeysToAgent: return fmt_multistate_int(val, multistate_yesnoaskconfirm); case oPubkeyAuthentication: return fmt_multistate_int(val, multistate_pubkey_auth); case oFingerprintHash: return ssh_digest_alg_name(val); default: switch (val) { case 0: return "no"; case 1: return "yes"; default: return "UNKNOWN"; } } }
int fmt_intarg(unsigned long a0, unsigned long a1) { unsigned int v1; if (a1 == -1) { v1 = &g_40c972; return v1; } switch (a0) { case 19: v1 = fmt_multistate_int(a1, &multistate_yesnoaskconfirm); return v1; case 29: v1 = fmt_multistate_int(a1, &multistate_strict_hostkey); return v1; case 38: v1 = fmt_multistate_int(a1, &multistate_pubkey_auth); return v1; case 53: case 90: v1 = fmt_multistate_int(a1, &multistate_yesnoask); return v1; case 55: v1 = fmt_multistate_int(a1, &multistate_addressfamily); return v1; case 64: v1 = fmt_multistate_int(a1, &multistate_controlmaster); return v1; case 67: v1 = fmt_multistate_int(a1, &multistate_tunnel); return v1; case 75: v1 = fmt_multistate_int(a1, &multistate_requesttty); return v1; case 76: v1 = fmt_multistate_int(a1, &multistate_sessiontype); return v1; case 82: v1 = fmt_multistate_int(a1, &multistate_canonicalizehostname); return v1; case 89: v1 = ssh_digest_alg_name(a1); return v1; default: v1 = (!a1 ? (a1 == 1 ? &g_40c96a : &g_40b7b5) : &g_40b7b9); return v1; } }
void sshlogdie(const char *file, const char *func, int line, int showfunc, LogLevel level, const char *suffix, const char *fmt, ...) { va_list args; __builtin_va_start( args , fmt ) ; sshlogv(file, func, line, showfunc, SYSLOG_LEVEL_INFO, suffix, fmt, args); __builtin_va_end( args ) ; cleanup_exit(255); }
long long sshlogdie(unsigned long long a0, unsigned long long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long a5, unsigned long long v16) { unsigned long long v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned long v4; unsigned long v5; unsigned long v6; char v7; int v8; int v9; int v10; int v11; int v12; int v13; int v14; int v15; char v17; char v18; int v19; int v20; int v21; int v22; int v23; int v24; int v25; int v26; unsigned long long *v27; v1 = a4; if (v18) { v8 = v19; v9 = v20; v10 = v21; v11 = v22; v12 = v23; v13 = v24; v14 = v25; v15 = v26; } v0 = v16; v6 = v27[5]; v2 = 48; v3 = 48; v4 = &v17; v5 = &v7; sshlogv(a0, a1, a2, a3, 0x3, a5, v0, &v2); cleanup_exit(0xff); }
char * string_list_internal (list, sep) WORD_LIST *list; char *sep; { register WORD_LIST *t; char *result, *r; size_t word_len, sep_len, result_size; if (list == 0) return ((char *) ((void *)0) ); if (list->next == 0) return ((char *)strcpy (sh_xmalloc((1 + strlen (list->word->word)), "subst.c", 2807), (list->word->word))); sep_len = (((sep) && (sep)[0]) ? ((sep)[1] ? ((sep)[2] ? strlen(sep) : 2) : 1) : 0); result_size = 0; for (t = list; t; t = t->next) { if (t != list) result_size += sep_len; result_size += strlen (t->word->word); } r = result = (char *)sh_xmalloc((result_size + 1), "subst.c", 2820); for (t = list; t; t = t->next) { if (t != list && sep_len) { if (sep_len > 1) { __builtin_memcpy ((r), (sep), (sep_len)); r += sep_len; } else *r++ = sep[0]; } word_len = strlen (t->word->word); __builtin_memcpy ((r), (t->word->word), (word_len)); r += word_len; } *r = '\0'; return (result); }
char * string_list_internal(long **param_1,char *param_2) { char *pcVar1; size_t sVar2; char *__dest; ulong __n; long **pplVar3; char *local_40; long local_38; if (param_1 == (long **)0x0) { pcVar1 = (char *)0x0; } else if (*param_1 == (long *)0x0) { pcVar1 = (char *)*param_1[1]; sVar2 = strlen((char *)*param_1[1]); __dest = (char *)sh_xmalloc(sVar2 + 1,"subst.c",0xaf7); pcVar1 = strcpy(__dest,pcVar1); } else { if ((param_2 == (char *)0x0) || (*param_2 == '\0')) { __n = 0; } else if (param_2[1] == '\0') { __n = 1; } else if (param_2[2] == '\0') { __n = 2; } else { __n = strlen(param_2); } local_38 = 0; for (pplVar3 = param_1; pplVar3 != (long **)0x0; pplVar3 = (long **)*pplVar3) { if (pplVar3 != param_1) { local_38 = local_38 + __n; } sVar2 = strlen((char *)*pplVar3[1]); local_38 = local_38 + sVar2; } pcVar1 = (char *)sh_xmalloc(local_38 + 1,"subst.c",0xb04); local_40 = pcVar1; for (pplVar3 = param_1; pplVar3 != (long **)0x0; pplVar3 = (long **)*pplVar3) { if ((pplVar3 != param_1) && (__n != 0)) { if (__n < 2) { *local_40 = *param_2; local_40 = local_40 + 1; } else { memcpy(local_40,param_2,__n); local_40 = local_40 + __n; } } sVar2 = strlen((char *)*pplVar3[1]); memcpy(local_40,(void *)*pplVar3[1],sVar2); local_40 = local_40 + sVar2; } *local_40 = '\0'; } return pcVar1; }
static int to_hour (intmax_t hours, int meridian) { switch (meridian) { default: case MER24: return 0 <= hours && hours < 24 ? hours : -1; case MERam: return 0 < hours && hours < 12 ? hours : hours == 12 ? 0 : -1; case MERpm: return 0 < hours && hours < 12 ? hours + 12 : hours == 12 ? 12 : -1; } }
ulong to_hour(ulong param_1,int param_2) { if (param_2 == 0) { if (((long)param_1 < 1) || (0xb < (long)param_1)) { if (param_1 == 0xc) { param_1 = 0; } else { param_1 = 0xffffffff; } } } else if (param_2 == 1) { if (((long)param_1 < 1) || (0xb < (long)param_1)) { if (param_1 == 0xc) { param_1 = 0xc; } else { param_1 = 0xffffffff; } } else { param_1 = (ulong)((int)param_1 + 0xc); } } else if (((long)param_1 < 0) || (0x17 < (long)param_1)) { param_1 = 0xffffffff; } return param_1; }
static void print_explain(FILE *f) { fprintf(f, "Usage: ... bond_slave [ queue_id ID ] [ prio PRIORITY ]\n"); }
void print_explain(void* a0) { unsigned long long v1; v1 = fprintf(a0, "Usage: ... bond_slave [ queue_id ID ] [ prio PRIORITY ]\n"); return; }
static int mod_cmp(const void *pa, const void *pb) { const struct mod *a = *(const struct mod **)pa; const struct mod *b = *(const struct mod **)pb; return a->sort_idx - b->sort_idx; }
long mod_cmp(long a1, long a2) { return (unsigned int)(*(_DWORD *)(*(_QWORD *)a1 + 96LL) - *(_DWORD *)(*(_QWORD *)a2 + 96LL)); }
static int strtoul_cc_t (char const *s, int base, char **p, cc_t *result, char delim) { unsigned long ul; (*__errno_location ()) = 0; ul = strtoul (s, p, base); if ( (*__errno_location ()) || **p != delim || *p == s || (cc_t) ul != ul) return -1; *result = ul; return 0; }
undefined8 strtoul_cc_t(char *param_1,int param_2,char **param_3,undefined *param_4,char param_5) { int *piVar1; ulong uVar2; undefined8 uVar3; piVar1 = __errno_location(); *piVar1 = 0; uVar2 = strtoul(param_1,param_3,param_2); piVar1 = __errno_location(); if ((((*piVar1 == 0) && (param_5 == **param_3)) && (param_1 != *param_3)) && (uVar2 == (uVar2 & 0xff))) { *param_4 = (char)uVar2; uVar3 = 0; } else { uVar3 = 0xffffffff; } return uVar3; }
_Bool contains_dot_dot (char const *name) { char const *p = name + ((void) ( name ), 0) ; for (;; p++) { if (p[0] == '.' && p[1] == '.' && ( (( p[2] ) == '/') || !p[2])) return 1; while (! (( *p ) == '/') ) { if (! *p++) return 0; } } }
undefined8 contains_dot_dot(char *param_1) { char cVar1; char *local_10; for (local_10 = param_1; ((*local_10 != '.' || (local_10[1] != '.')) || ((local_10[2] != '/' && (local_10[2] != '\0'))) ); local_10 = local_10 + 1) { while (*local_10 != '/') { cVar1 = *local_10; local_10 = local_10 + 1; if (cVar1 == '\0') { return 0; } } } return 1; }
static _Bool gl_linked_remove (gl_list_t list, const void *elt) { gl_list_node_t node = gl_linked_search_from_to (list, 0, list->count, elt); if (node != ((void *)0) ) return gl_linked_remove_node (list, node); else return 0 ; }
undefined8 gl_linked_remove(long param_1,undefined8 param_2) { long lVar1; undefined8 uVar2; lVar1 = gl_linked_search_from_to(param_1,0,*(undefined8 *)(param_1 + 0x40),param_2); if (lVar1 == 0) { uVar2 = 0; } else { uVar2 = gl_linked_remove_node(param_1,lVar1); } return uVar2; }
int heapsort(void *vbase, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) { size_t cnt, i, j, l; char tmp, *tmp1, *tmp2; char *base, *k, *p, *t; if (nmemb <= 1) return (0); if (!size) { (*__errno_location ()) = 22 ; return (-1); } if ((k = malloc(size)) == ((void *)0) ) return (-1); base = (char *)vbase - size; for (l = nmemb / 2 + 1; --l;) { for (i = l; (j = i * 2) <= nmemb; i = j) { p = base + j * size; if (j < nmemb && compar(p, p + size) < 0) { p += size; ++j; } t = base + i * size; if (compar(p, t) <= 0) break; { cnt = size; do { tmp = *t; *t++ = *p; *p++ = tmp; } while (--cnt); }; } }; while (nmemb > 1) { { cnt = size; tmp1 = k; tmp2 = base + nmemb * size; do { *tmp1++ = *tmp2++; } while (--cnt); }; { cnt = size; tmp1 = base + nmemb * size; tmp2 = base + size; do { *tmp1++ = *tmp2++; } while (--cnt); }; --nmemb; { for (i = 1; (j = i * 2) <= nmemb; i = j) { p = base + j * size; if (j < nmemb && compar(p, p + size) < 0) { p += size; ++j; } t = base + i * size; { cnt = size; tmp1 = t; tmp2 = p; do { *tmp1++ = *tmp2++; } while (--cnt); }; } for (;;) { j = i; i = j / 2; p = base + j * size; t = base + i * size; if (j == 1 || compar(k, t) < 0) { { cnt = size; tmp1 = p; tmp2 = k; do { *tmp1++ = *tmp2++; } while (--cnt); }; break; } { cnt = size; tmp1 = p; tmp2 = t; do { *tmp1++ = *tmp2++; } while (--cnt); }; } }; } free(k); return (0); }
long long heapsort(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long long a3) { unsigned long v0; int tmp_33; int tmp_18; unsigned long v1; char v2; unsigned long v3; unsigned long long v4; unsigned long long v5; unsigned long v6; unsigned long long v7; char *v8; unsigned long long v9; char *v10; void* v11; unsigned long v12; unsigned long long v14; char *v15; char *v16; char *v18; unsigned long long v19; char *v20; char v21; char *v23; char *v24; v1 = a1; v0 = a2; if (v1 <= 1) { v14 = 0; } else if (!a2) { *(__errno_location()) = 22; v14 = 4294967295; } else { v11 = malloc(a2); if (!v11) { v14 = 4294967295; } else { v12 = a0 + -(v0); v6 = (v1 >> 1) + 1; while (true) { v6 -= 1; if (!v6) break; v4 = v6; while (true) { v5 = v4 * 2; if (v5 > v1) break; v9 = v12 + a2 * v5; if (v5 < v1 && (stack_base)[136](v9, &v9[a2], a3, &v9[a2]) < 0) { v9 = &v9[a2]; v5 += 1; } v10 = v12 + a2 * v4; if ((stack_base)[136](v9, v10, v10, a3) <= 0) break; v3 = a2; do { v2 = *(v10); tmp_33 = v10; v10 += 1; *(tmp_33) = *(v9); v15 = v9; v9 += 1; *(v15) = v2; v3 -= 1; } while (v3); v4 = v5; } } while (v1 > 1) { v3 = a2; v7 = v11; v8 = v12 + a2 * v1; do { tmp_18 = v8; v8 += 1; v16 = v7; v7 += 1; *(v16) = *(tmp_18); v3 -= 1; } while (v3); v3 = a2; v7 = v12 + a2 * v1; v8 = a2 + v12; do { tmp_18 = v8; v8 += 1; v18 = v7; v7 += 1; v21 = *(tmp_18); *(v18) = v21; v3 -= 1; } while (v3); v1 -= 1; v4 = 1; while (true) { v5 = v4 * 2; if (v5 > v1) break; v9 = v12 + a2 * v5; if (v5 < v1) { v19 = (stack_base)[136](v9, v9 + a2, a3, v9 + a2); if (v19 < 0) { v9 = &v9[a2]; v5 += 1; } } v10 = v12 + a2 * v4; *(&v3) = a2; v7 = v10; v8 = v9; do { tmp_18 = v8; v8 += 1; v20 = v7; v7 += 1; v21 = *(tmp_18); *(v20) = v21; v3 -= 1; } while (v3); v4 = v5; } while (true) { v5 = v4; v4 = v5 >> 1; v9 = v12 + a2 * v5; v10 = v12 + a2 * v4; if (v5 == 1) break; if ((stack_base)[136](v11, v10, v10, a3) < 0) break; v3 = a2; v7 = v9; v8 = v10; do { tmp_18 = v8; v8 += 1; v23 = v7; v7 += 1; v21 = *(tmp_18); *(v23) = v21; v3 -= 1; } while (v3); } v3 = a2; v7 = v9; v8 = v11; do { tmp_18 = v8; v8 += 1; v24 = v7; v7 += 1; a2 = *(tmp_18); *(v24) = a2; v3 -= 1; } while (v3); } free(v11); v14 = 0; } } return v14; }
void generate_pkcs8(common_info_st * cinfo) { gnutls_x509_privkey_t key; int result; size_t size; unsigned int flags = 0; const char *password; fprintf( stderr , "Generating a PKCS #8 key structure...\n"); key = load_x509_private_key(1, cinfo); password = get_password(cinfo, &flags, 1); flags |= cipher_to_flags(cinfo->pkcs_cipher); size = lbuffer_size; result = gnutls_x509_privkey_export_pkcs8(key, outcert_format, password, flags, lbuffer, &size); if (result < 0) { fprintf( stderr , "key_export: %s\n", gnutls_strerror(result)); app_exit(1); } fwrite(lbuffer, 1, size, outfile); }
unsigned long generate_pkcs8(long a1) { int v1; const char *v2; unsigned int v4; unsigned int v5; size_t n; long x509_private_key; long password; unsigned long v9; v9 = __readfsqword(0x28u); v4 = 0; fprintf(stderr, "Generating a PKCS #8 key structure...\n"); x509_private_key = load_x509_private_key(1LL, a1); password = get_password(a1, &v4, 1LL); v1 = cipher_to_flags(*(_QWORD *)(a1 + 104)); v4 |= v1; n = lbuffer_size; v5 = gnutls_x509_privkey_export_pkcs8(x509_private_key, (unsigned int)outcert_format, password, v4, lbuffer, &n); if ( (v5 & 0x80000000) != 0 ) { v2 = (const char *)gnutls_strerror(v5); fprintf(stderr, "key_export: %s\n", v2); app_exit(1); } fwrite(lbuffer, 1uLL, n, outfile); return __readfsqword(0x28u) ^ v9; }
static int parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd, const char *startdir, int err_abort, int echo_command) { const char *ocmd = cmd; char *path1, *path2, *tmp; int ignore_errors = 0, disable_echo = 1; int aflag = 0, fflag = 0, hflag = 0, iflag = 0; int lflag = 0, pflag = 0, rflag = 0, sflag = 0; int cmdnum, i; unsigned long n_arg = 0; Attrib a, *aa; char path_buf[ 4096 ]; int err = 0; _ssh_compat_glob_t g; path1 = path2 = ((void *)0) ; cmdnum = parse_args(&cmd, &ignore_errors, &disable_echo, &aflag, &fflag, &hflag, &iflag, &lflag, &pflag, &rflag, &sflag, &n_arg, &path1, &path2); if (ignore_errors != 0) err_abort = 0; if (echo_command && !disable_echo) mprintf("sftp> %s\n", ocmd); memset(&g, 0, sizeof(g)); switch (cmdnum) { case 0: break; case -1: err = -1; break; case I_REGET: aflag = 1; case I_GET: err = process_get(conn, path1, path2, *pwd, pflag, rflag, aflag, fflag); break; case I_REPUT: aflag = 1; case I_PUT: err = process_put(conn, path1, path2, *pwd, pflag, rflag, aflag, fflag); break; case I_COPY: path1 = make_absolute(path1, *pwd); path2 = make_absolute(path2, *pwd); err = do_copy(conn, path1, path2); break; case I_RENAME: path1 = make_absolute(path1, *pwd); path2 = make_absolute(path2, *pwd); err = do_rename(conn, path1, path2, lflag); break; case I_SYMLINK: sflag = 1; case I_LINK: if (!sflag) path1 = make_absolute(path1, *pwd); path2 = make_absolute(path2, *pwd); err = (sflag ? do_symlink : do_hardlink)(conn, path1, path2); break; case I_RM: path1 = make_absolute_pwd_glob(path1, *pwd); remote_glob(conn, path1, 0x0010, ((void *)0) , &g); for (i = 0; g.gl_pathv[i] && !interrupted; i++) { if (!quiet) mprintf("Removing %s\n", g.gl_pathv[i]); err = do_rm(conn, g.gl_pathv[i]); if (err != 0 && err_abort) break; } break; case I_MKDIR: path1 = make_absolute(path1, *pwd); attrib_clear(&a); a.flags |= 0x00000004; a.perm = 0777; err = do_mkdir(conn, path1, &a, 1); break; case I_RMDIR: path1 = make_absolute(path1, *pwd); err = do_rmdir(conn, path1); break; case I_CHDIR: if (path1 == ((void *)0) || *path1 == '\0') path1 = xstrdup(startdir); path1 = make_absolute(path1, *pwd); if ((tmp = do_realpath(conn, path1)) == ((void *)0) ) { err = 1; break; } if ((aa = do_stat(conn, tmp, 0)) == ((void *)0) ) { free(tmp); err = 1; break; } if (!(aa->flags & 0x00000004)) { sshlog("sftp.c", __func__, 1639, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Can't change directory: Can't check target"); free(tmp); err = 1; break; } if (! (((( aa->perm )) & 0170000) == (0040000)) ) { sshlog("sftp.c", __func__, 1645, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Can't change directory: \"%s\" is not " "a directory", tmp) ; free(tmp); err = 1; break; } free(*pwd); *pwd = tmp; break; case I_LS: if (!path1) { do_ls_dir(conn, *pwd, *pwd, lflag); break; } tmp = ((void *)0) ; if (!path_absolute(path1)) tmp = *pwd; path1 = make_absolute_pwd_glob(path1, *pwd); err = do_globbed_ls(conn, path1, tmp, lflag); break; case I_DF: if (path1 == ((void *)0) ) path1 = xstrdup(*pwd); path1 = make_absolute(path1, *pwd); err = do_df(conn, path1, hflag, iflag); break; case I_LCHDIR: if (path1 == ((void *)0) || *path1 == '\0') path1 = xstrdup("~"); tmp = tilde_expand_filename(path1, getuid()); free(path1); path1 = tmp; if (chdir(path1) == -1) { sshlog("sftp.c", __func__, 1682, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Couldn't change local directory to " "\"%s\": %s", path1, strerror( (*__errno_location ()) )) ; err = 1; } break; case I_LMKDIR: if (mkdir(path1, 0777) == -1) { sshlog("sftp.c", __func__, 1689, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Couldn't create local directory " "\"%s\": %s", path1, strerror( (*__errno_location ()) )) ; err = 1; } break; case I_LLS: local_do_ls(cmd); break; case I_SHELL: local_do_shell(cmd); break; case I_LUMASK: umask(n_arg); printf("Local umask: %03lo\n", n_arg); break; case I_CHMOD: path1 = make_absolute_pwd_glob(path1, *pwd); attrib_clear(&a); a.flags |= 0x00000004; a.perm = n_arg; remote_glob(conn, path1, 0x0010, ((void *)0) , &g); for (i = 0; g.gl_pathv[i] && !interrupted; i++) { if (!quiet) mprintf("Changing mode on %s\n", g.gl_pathv[i]); err = (hflag ? do_lsetstat : do_setstat)(conn, g.gl_pathv[i], &a); if (err != 0 && err_abort) break; } break; case I_CHOWN: case I_CHGRP: path1 = make_absolute_pwd_glob(path1, *pwd); remote_glob(conn, path1, 0x0010, ((void *)0) , &g); for (i = 0; g.gl_pathv[i] && !interrupted; i++) { if (!(aa = (hflag ? do_lstat : do_stat)(conn, g.gl_pathv[i], 0))) { if (err_abort) { err = -1; break; } else continue; } if (!(aa->flags & 0x00000002)) { sshlog("sftp.c", __func__, 1734, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Can't get current ownership of " "remote file \"%s\"", g.gl_pathv[i]) ; if (err_abort) { err = -1; break; } else continue; } aa->flags &= 0x00000002; if (cmdnum == I_CHOWN) { if (!quiet) mprintf("Changing owner on %s\n", g.gl_pathv[i]); aa->uid = n_arg; } else { if (!quiet) mprintf("Changing group on %s\n", g.gl_pathv[i]); aa->gid = n_arg; } err = (hflag ? do_lsetstat : do_setstat)(conn, g.gl_pathv[i], aa); if (err != 0 && err_abort) break; } break; case I_PWD: mprintf("Remote working directory: %s\n", *pwd); break; case I_LPWD: if (!getcwd(path_buf, sizeof(path_buf))) { sshlog("sftp.c", __func__, 1765, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Couldn't get local cwd: %s", strerror( (*__errno_location ()) )); err = -1; break; } mprintf("Local working directory: %s\n", path_buf); break; case I_QUIT: break; case I_HELP: help(); break; case I_VERSION: printf("SFTP protocol version %u\n", sftp_proto_version(conn)); break; case I_PROGRESS: showprogress = !showprogress; if (showprogress) printf("Progress meter enabled\n"); else printf("Progress meter disabled\n"); break; default: sshfatal("sftp.c", __func__, 1788, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%d is not implemented", cmdnum); } if (g.gl_pathc) _ssh__compat_globfree(&g); free(path1); free(path2); if (err_abort && err != 0) return (-1); else if (cmdnum == I_QUIT) return (1); return (0); }
undefined8 parse_dispatch_command (undefined8 param_1,undefined8 param_2,char **param_3,undefined8 param_4,int param_5, int param_6) { undefined4 uVar1; int iVar2; __uid_t _Var3; uint uVar4; char *pcVar5; int *piVar6; undefined8 uVar7; char ***pppcVar8; code *pcVar9; long in_FS_OFFSET; char **ppcStack4440; void **ppvStack4432; undefined auStack4424 [8]; int local_1140; int local_113c; undefined8 local_1138; char **local_1130; undefined8 local_1128; undefined8 local_1120; int local_110c; int local_1108; uint local_1104; uint local_1100; int local_10fc; undefined4 local_10f8; undefined4 local_10f4; undefined4 local_10f0; undefined4 local_10ec; int local_10e8; int local_10e4; int local_10e0; uint local_10dc; char *local_10d8; void *local_10d0; undefined8 local_10c8; char *local_10c0; undefined8 local_10b8; uint *local_10b0; uint local_10a8 [6]; undefined4 local_1090; long local_1078 [4]; long local_1058; char local_1018 [4104]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_110c = 0; local_1108 = 1; local_1104 = 0; local_1100 = 0; local_10fc = 0; local_10f8 = 0; local_10f4 = 0; local_10f0 = 0; local_10ec = 0; local_10e8 = 0; local_10c8 = 0; local_10e0 = 0; local_10d0 = (void *)0x0; local_10d8 = (char *)0x0; ppvStack4432 = &local_10d0; ppcStack4440 = &local_10d8; local_1140 = param_6; local_113c = param_5; local_1138 = param_4; local_1130 = param_3; local_1128 = param_2; local_1120 = param_1; local_10b8 = param_2; local_10dc = parse_args(&local_1128,&local_110c,&local_1108,&local_1104,&local_1100,&local_10fc, &local_10f8,&local_10f4,&local_10f0,&local_10ec,&local_10e8,&local_10c8); pppcVar8 = (char ***)auStack4424; if (local_110c != 0) { local_113c = 0; } if ((local_1140 != 0) && (local_1108 == 0)) { ppvStack4432 = (void **)0x1045ad; mprintf("sftp> %s\n",local_10b8); } ppvStack4432 = (void **)0x1045c6; memset(local_1078,0,0x60); ppvStack4432 = (void **)0x1045d6; uVar1 = __addvsi3(local_10dc,1); switch(uVar1) { case 0: local_10e0 = -1; pppcVar8 = (char ***)auStack4424; break; case 1: case 0x14: break; case 2: if ((local_10d8 == (char *)0x0) || (*local_10d8 == '\0')) { ppvStack4432 = (void **)0x104a6d; local_10d8 = (char *)xstrdup(local_1138); } ppvStack4432 = (void **)0x104a90; local_10d8 = (char *)make_absolute(local_10d8,*local_1130); ppvStack4432 = (void **)0x104ab0; local_10c0 = (char *)do_realpath(local_1120,local_10d8); if (local_10c0 == (char *)0x0) { local_10e0 = 1; pppcVar8 = (char ***)auStack4424; } else { ppvStack4432 = (void **)0x104aee; local_10b0 = (uint *)do_stat(local_1120,local_10c0,0); if (local_10b0 == (uint *)0x0) { ppvStack4432 = (void **)0x104b0e; free(local_10c0); local_10e0 = 1; pppcVar8 = (char ***)auStack4424; } else if ((*local_10b0 & 4) == 0) { ppcStack4440 = (char **)0x109eb0; sshlog("sftp.c","parse_dispatch_command",0x667,0,2,0); ppvStack4432 = (void **)0x104b7a; free(local_10c0); local_10e0 = 1; pppcVar8 = (char ***)auStack4424; } else if ((local_10b0[6] & 0xf000) == 0x4000) { ppvStack4432 = (void **)0x104c0f; free(*local_1130); *local_1130 = local_10c0; pppcVar8 = (char ***)auStack4424; } else { ppvStack4432 = (void **)local_10c0; ppcStack4440 = (char **)0x109ee0; sshlog("sftp.c","parse_dispatch_command",0x66d,0,2,0); ppvStack4432 = (void **)0x104bee; free(local_10c0); local_10e0 = 1; pppcVar8 = (char ***)auStack4424; } } break; case 3: case 5: ppvStack4432 = (void **)0x1050a6; local_10d8 = (char *)make_absolute_pwd_glob(local_10d8,*local_1130); ppvStack4432 = (void **)0x1050d7; remote_glob(local_1120,local_10d8,0x10,0,local_1078); local_10e4 = 0; do { pppcVar8 = (char ***)auStack4424; if ((*(long *)(local_1058 + (long)local_10e4 * 8) == 0) || (pppcVar8 = (char ***)auStack4424, interrupted != 0)) break; pcVar9 = pcRam0000000000105103; if (local_10fc != 0) { pcVar9 = pcRam00000000001050f7; } ppvStack4432 = (void **)0x105135; local_10b0 = (uint *)(*pcVar9)(local_1120,*(undefined8 *)(local_1058 + (long)local_10e4 * 8),0 ); if (local_10b0 == (uint *)0x0) { if (local_113c != 0) { local_10e0 = -1; pppcVar8 = (char ***)auStack4424; break; } } else if ((*local_10b0 & 2) == 0) { ppvStack4432 = *(void ***)(local_1058 + (long)local_10e4 * 8); ppcStack4440 = (char **)0x109fa0; sshlog("sftp.c","parse_dispatch_command",0x6c6,0,2,0); if (local_113c != 0) { local_10e0 = -1; pppcVar8 = (char ***)auStack4424; break; } } else { *local_10b0 = *local_10b0 & 2; if (local_10dc == 4) { if (quiet == 0) { ppvStack4432 = (void **)0x10523b; mprintf("Changing owner on %s\n",*(undefined8 *)(local_1058 + (long)local_10e4 * 8)); } local_10b0[4] = (uint)local_10c8; } else { if (quiet == 0) { ppvStack4432 = (void **)0x105288; mprintf("Changing group on %s\n",*(undefined8 *)(local_1058 + (long)local_10e4 * 8)); } local_10b0[5] = (uint)local_10c8; } pcVar9 = pcRam00000000001052b8; if (local_10fc != 0) { pcVar9 = pcRam00000000001052ac; } ppvStack4432 = (void **)0x1052ec; local_10e0 = (*pcVar9)(local_1120,*(undefined8 *)(local_1058 + (long)local_10e4 * 8), local_10b0); if ((local_10e0 != 0) && (pppcVar8 = (char ***)auStack4424, local_113c != 0)) break; } ppvStack4432 = (void **)0x10531a; local_10e4 = __addvsi3(local_10e4,1); } while( true ); case 4: ppvStack4432 = (void **)0x104f2c; local_10d8 = (char *)make_absolute_pwd_glob(local_10d8,*local_1130); ppvStack4432 = (void **)0x104f42; attrib_clear(local_10a8); local_10a8[0] = local_10a8[0] | 4; local_1090 = (undefined4)local_10c8; ppvStack4432 = (void **)0x104f88; remote_glob(local_1120,local_10d8,0x10,0,local_1078); local_10e4 = 0; while ((pppcVar8 = (char ***)auStack4424, *(long *)(local_1058 + (long)local_10e4 * 8) != 0 && (pppcVar8 = (char ***)auStack4424, interrupted == 0))) { if (quiet == 0) { ppvStack4432 = (void **)0x104fcf; mprintf("Changing mode on %s\n",*(undefined8 *)(local_1058 + (long)local_10e4 * 8)); } pcVar9 = pcRam0000000000104fec; if (local_10fc != 0) { pcVar9 = pcRam0000000000104fe0; } ppvStack4432 = (void **)0x105020; local_10e0 = (*pcVar9)(local_1120,*(undefined8 *)(local_1058 + (long)local_10e4 * 8), local_10a8); if ((local_10e0 != 0) && (pppcVar8 = (char ***)auStack4424, local_113c != 0)) break; ppvStack4432 = (void **)0x105048; local_10e4 = __addvsi3(local_10e4,1); } break; case 6: ppvStack4432 = (void **)0x1046ef; local_10d8 = (char *)make_absolute(local_10d8,*local_1130); ppvStack4432 = (void **)0x104712; local_10d0 = (void *)make_absolute(local_10d0,*local_1130); ppvStack4432 = (void **)0x104739; local_10e0 = do_copy(local_1120,local_10d8,local_10d0); pppcVar8 = (char ***)auStack4424; break; case 7: if (local_10d8 == (char *)0x0) { ppvStack4432 = (void **)0x104cfd; local_10d8 = (char *)xstrdup(*local_1130); } ppvStack4432 = (void **)0x104d20; local_10d8 = (char *)make_absolute(local_10d8,*local_1130); ppvStack4432 = (void **)0x104d49; local_10e0 = do_df(local_1120,local_10d8,local_10fc,local_10f8); pppcVar8 = (char ***)auStack4424; break; case 9: ppvStack4432 = (void **)0x105415; help(); pppcVar8 = (char ***)auStack4424; break; case 10: if ((local_10d8 == (char *)0x0) || (*local_10d8 == '\0')) { ppvStack4432 = (void **)0x104d7a; local_10d8 = (char *)xstrdup(&DAT_00109f10); } ppvStack4432 = (void **)0x104d86; _Var3 = getuid(); ppvStack4432 = (void **)0x104d99; local_10c0 = (char *)tilde_expand_filename(local_10d8,_Var3); ppvStack4432 = (void **)0x104daf; free(local_10d8); local_10d8 = local_10c0; ppvStack4432 = (void **)0x104dcc; iVar2 = chdir(local_10c0); pppcVar8 = (char ***)auStack4424; if (iVar2 == -1) { ppvStack4432 = (void **)0x104dda; piVar6 = __errno_location(); ppvStack4432 = (void **)0x104de3; ppcStack4440 = (char **)strerror(*piVar6); sshlog("sftp.c","parse_dispatch_command",0x692,0,2,0, "Couldn\'t change local directory to \"%s\": %s",local_10d8); local_10e0 = 1; pppcVar8 = (char ***)auStack4424; } break; case 0xc: ppvStack4432 = (void **)0x104ec9; local_do_ls(local_1128); pppcVar8 = (char ***)auStack4424; break; case 0xd: ppvStack4432 = (void **)0x104e4d; iVar2 = mkdir(local_10d8,0x1ff); pppcVar8 = (char ***)auStack4424; if (iVar2 == -1) { ppvStack4432 = (void **)0x104e5b; piVar6 = __errno_location(); ppvStack4432 = (void **)0x104e64; ppcStack4440 = (char **)strerror(*piVar6); sshlog("sftp.c","parse_dispatch_command",0x699,0,2,0, "Couldn\'t create local directory \"%s\": %s",local_10d8); local_10e0 = 1; pppcVar8 = (char ***)auStack4424; } break; case 0xe: ppvStack4432 = (void **)0x105393; pcVar5 = getcwd(local_1018,0x1000); if (pcVar5 == (char *)0x0) { ppvStack4432 = (void **)0x10539d; piVar6 = __errno_location(); ppvStack4432 = (void **)0x1053a6; ppvStack4432 = (void **)strerror(*piVar6); ppcStack4440 = (char **)0x10a01a; sshlog("sftp.c","parse_dispatch_command",0x6e5,0,2,0); local_10e0 = -1; pppcVar8 = (char ***)auStack4424; } else { ppvStack4432 = (void **)0x10540b; mprintf("Local working directory: %s\n",local_1018); pppcVar8 = (char ***)auStack4424; } break; case 0xf: if (local_10d8 == (char *)0x0) { ppvStack4432 = (void **)0x104c5a; do_ls_dir(local_1120,*local_1130,*local_1130,local_10f4); pppcVar8 = (char ***)auStack4424; } else { local_10c0 = (char *)0x0; ppvStack4432 = (void **)0x104c79; iVar2 = path_absolute(local_10d8); if (iVar2 == 0) { local_10c0 = *local_1130; } ppvStack4432 = (void **)0x104caa; local_10d8 = (char *)make_absolute_pwd_glob(local_10d8,*local_1130); ppvStack4432 = (void **)0x104cd4; local_10e0 = do_globbed_ls(local_1120,local_10d8,local_10c0,local_10f4); pppcVar8 = (char ***)auStack4424; } break; case 0x10: ppvStack4432 = (void **)0x104ef0; umask((__mode_t)local_10c8); ppvStack4432 = (void **)0x104f0b; printf("Local umask: %03lo\n",local_10c8); pppcVar8 = (char ***)auStack4424; break; case 0x11: ppvStack4432 = (void **)0x1049a1; local_10d8 = (char *)make_absolute(local_10d8,*local_1130); ppvStack4432 = (void **)0x1049b7; attrib_clear(local_10a8); local_10a8[0] = local_10a8[0] | 4; local_1090 = 0x1ff; ppvStack4432 = (void **)0x1049f2; local_10e0 = do_mkdir(local_1120,local_10d8,local_10a8,1); pppcVar8 = (char ***)auStack4424; break; case 0x13: ppvStack4432 = (void **)0x10537a; mprintf("Remote working directory: %s\n",*local_1130); pppcVar8 = (char ***)auStack4424; break; case 0x15: local_1104 = 1; case 8: ppvStack4432 = (void **)(ulong)local_1100; ppcStack4440 = (char **)(ulong)local_1104; local_10e0 = process_get(local_1120,local_10d8,local_10d0,*local_1130,local_10f0,local_10ec); pppcVar8 = (char ***)auStack4424; break; case 0x16: ppvStack4432 = (void **)0x104760; local_10d8 = (char *)make_absolute(local_10d8,*local_1130); ppvStack4432 = (void **)0x104783; local_10d0 = (void *)make_absolute(local_10d0,*local_1130); ppvStack4432 = (void **)0x1047ad; local_10e0 = do_rename(local_1120,local_10d8,local_10d0,local_10f4); pppcVar8 = (char ***)auStack4424; break; case 0x17: local_1104 = 1; case 0x12: ppvStack4432 = (void **)(ulong)local_1100; ppcStack4440 = (char **)(ulong)local_1104; local_10e0 = process_put(local_1120,local_10d8,local_10d0,*local_1130,local_10f0,local_10ec); pppcVar8 = (char ***)auStack4424; break; case 0x18: ppvStack4432 = (void **)0x104877; local_10d8 = (char *)make_absolute_pwd_glob(local_10d8,*local_1130); ppvStack4432 = (void **)0x1048a8; remote_glob(local_1120,local_10d8,0x10,0,local_1078); local_10e4 = 0; while ((pppcVar8 = (char ***)auStack4424, *(long *)(local_1058 + (long)local_10e4 * 8) != 0 && (pppcVar8 = (char ***)auStack4424, interrupted == 0))) { if (quiet == 0) { ppvStack4432 = (void **)0x1048ef; mprintf("Removing %s\n",*(undefined8 *)(local_1058 + (long)local_10e4 * 8)); } ppvStack4432 = (void **)0x10491b; local_10e0 = do_rm(local_1120,*(undefined8 *)(local_1058 + (long)local_10e4 * 8)); if ((local_10e0 != 0) && (pppcVar8 = (char ***)auStack4424, local_113c != 0)) break; ppvStack4432 = (void **)0x104943; local_10e4 = __addvsi3(local_10e4,1); } break; case 0x19: ppvStack4432 = (void **)0x104a19; local_10d8 = (char *)make_absolute(local_10d8,*local_1130); ppvStack4432 = (void **)0x104a39; local_10e0 = do_rmdir(local_1120,local_10d8); pppcVar8 = (char ***)auStack4424; break; case 0x1a: ppvStack4432 = (void **)0x104edd; local_do_shell(local_1128); pppcVar8 = (char ***)auStack4424; break; case 0x1b: local_10e8 = 1; case 0xb: if (local_10e8 == 0) { ppvStack4432 = (void **)0x1047e8; local_10d8 = (char *)make_absolute(local_10d8,*local_1130); } ppvStack4432 = (void **)0x10480b; local_10d0 = (void *)make_absolute(local_10d0,*local_1130); pcVar9 = pcRam000000000010482f; if (local_10e8 != 0) { pcVar9 = pcRam0000000000104823; } ppvStack4432 = (void **)0x104850; local_10e0 = (*pcVar9)(local_1120,local_10d8,local_10d0); pppcVar8 = (char ***)auStack4424; break; case 0x1c: ppvStack4432 = (void **)0x105429; uVar4 = sftp_proto_version(local_1120); ppvStack4432 = (void **)0x10543c; printf("SFTP protocol version %u\n",(ulong)uVar4); pppcVar8 = (char ***)auStack4424; break; case 0x1d: showprogress = (uint)(showprogress == 0); if (showprogress == 0) { ppvStack4432 = (void **)0x105483; printf("Progress meter disabled\n"); pppcVar8 = (char ***)auStack4424; } else { ppvStack4432 = (void **)0x105470; printf("Progress meter enabled\n"); pppcVar8 = (char ***)auStack4424; } break; default: ppvStack4432 = (void **)(ulong)local_10dc; pppcVar8 = &ppcStack4440; ppcStack4440 = (char **)0x10a09d; sshfatal("sftp.c","parse_dispatch_command",0x6fc,0,1,0); } if (local_1078[0] != 0) { *(undefined8 *)((long)pppcVar8 + -8) = 0x1054ed; _ssh__compat_globfree(local_1078); } *(undefined8 *)((long)pppcVar8 + -8) = 0x1054fc; free(local_10d8); *(undefined8 *)((long)pppcVar8 + -8) = 0x10550b; free(local_10d0); if ((local_113c == 0) || (local_10e0 == 0)) { if (local_10dc == 0x13) { uVar7 = 1; } else { uVar7 = 0; } } else { uVar7 = 0xffffffff; } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { *(undefined8 *)((long)pppcVar8 + -8) = 0x10554d; __stack_chk_fail(); } return uVar7; }
static inline __be16 rta_getattr_be16(const struct rtattr *rta) { return ntohs(rta_getattr_u16(rta)); }
int rta_getattr_be16(void* a0) { return ntohs(rta_getattr_u16(a0)); }
static int get_tunnel(struct l2tp_data *p) { struct { struct nlmsghdr n; struct genlmsghdr g; char buf[( ((0)+4U -1) & ~(4U -1) ) + (1024)]; } req = { .n = { .nlmsg_type = (genl_family), .nlmsg_flags = (0x100 | 0x200 | 0x01), .nlmsg_len = ((( ((sizeof(struct genlmsghdr))+4U -1) & ~(4U -1) ) + (0)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))), }, .g = { .cmd = (L2TP_CMD_TUNNEL_GET), .version = (0x1), }, } ; req.n.nlmsg_seq = genl_rth.dump = ++genl_rth.seq; if (p->config.tunnel_id) addattr32(&req.n, 1024, L2TP_ATTR_CONN_ID, p->config.tunnel_id); if (rtnl_send(&genl_rth, &req, req.n.nlmsg_len) < 0) return -2; new_json_obj(json); if (rtnl_dump_filter_nc(&genl_rth, tunnel_nlmsg, p, 0) < 0) { fprintf( stderr , "Dump terminated\n"); exit(1); } delete_json_obj(); fflush( stdout ); return 0; }
undefined8 get_tunnel(int *param_1) { int iVar1; undefined8 uVar2; long lVar3; undefined8 *puVar4; long in_FS_OFFSET; undefined8 local_428; int local_420; undefined local_418; undefined local_417; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); puVar4 = &local_428; for (lVar3 = 0x82; lVar3 != 0; lVar3 = lVar3 + -1) { *puVar4 = 0; puVar4 = puVar4 + 1; } *(undefined4 *)puVar4 = 0; local_428._0_4_ = 0x14; local_428._4_2_ = (undefined2)genl_family; local_428._6_2_ = 0x301; local_418 = 4; local_417 = 1; genl_rth._28_4_ = genl_rth._28_4_ + 1; genl_rth._32_4_ = genl_rth._28_4_; local_420 = genl_rth._28_4_; if (*param_1 != 0) { addattr32(&local_428,0x400,9,*param_1); } iVar1 = rtnl_send(genl_rth,&local_428,(undefined4)local_428); if (iVar1 < 0) { uVar2 = 0xfffffffe; } else { new_json_obj(json); iVar1 = rtnl_dump_filter_nc(genl_rth,tunnel_nlmsg,param_1,0); if (iVar1 < 0) { fprintf(stderr,"Dump terminated\n"); exit(1); } delete_json_obj(); fflush(stdout); uVar2 = 0; } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar2; }
int verify_host_key_dns(const char *hostname, struct sockaddr *address, struct sshkey *hostkey, int *flags) { u_int counter; int result; struct rrsetinfo *fingerprints = ((void *)0) ; u_int8_t hostkey_algorithm; u_char *hostkey_digest; size_t hostkey_digest_len; u_int8_t dnskey_algorithm; u_int8_t dnskey_digest_type; u_char *dnskey_digest; size_t dnskey_digest_len; *flags = 0; sshlog("dns.c", __func__, 214, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "verify_host_key_dns"); if (hostkey == ((void *)0) ) sshfatal("dns.c", __func__, 216, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "No key to look up!"); if (is_numeric_hostname(hostname)) { sshlog("dns.c", __func__, 219, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "skipped DNS lookup for numerical hostname"); return -1; } result = getrrsetbyname(hostname, 1, 44, 0, &fingerprints); if (result) { sshlog("dns.c", __func__, 226, 0, SYSLOG_LEVEL_VERBOSE, ((void *)0) , "DNS lookup error: %s", dns_result_totext(result)); return -1; } if (fingerprints->rri_flags & 1) { *flags |= 0x00000004; sshlog("dns.c", __func__, 232, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "found %d secure fingerprints in DNS", fingerprints->rri_nrdatas) ; } else { sshlog("dns.c", __func__, 235, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "found %d insecure fingerprints in DNS", fingerprints->rri_nrdatas) ; } if (fingerprints->rri_nrdatas) *flags |= 0x00000001; for (counter = 0; counter < fingerprints->rri_nrdatas; counter++) { if (!dns_read_rdata(&dnskey_algorithm, &dnskey_digest_type, &dnskey_digest, &dnskey_digest_len, fingerprints->rri_rdatas[counter].rdi_data, fingerprints->rri_rdatas[counter].rdi_length)) { sshlog("dns.c", __func__, 251, 0, SYSLOG_LEVEL_VERBOSE, ((void *)0) , "Error parsing fingerprint from DNS."); continue; } sshlog("dns.c", __func__, 254, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "checking SSHFP type %d fptype %d", dnskey_algorithm, dnskey_digest_type) ; if (!dns_read_key(&hostkey_algorithm, &dnskey_digest_type, &hostkey_digest, &hostkey_digest_len, hostkey)) { sshlog("dns.c", __func__, 260, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Error calculating key fingerprint."); freerrset(fingerprints); return -1; } if (hostkey_algorithm == dnskey_algorithm && hostkey_digest_len == dnskey_digest_len) { if (timingsafe_bcmp(hostkey_digest, dnskey_digest, hostkey_digest_len) == 0) { sshlog("dns.c", __func__, 270, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "matched SSHFP type %d fptype %d", dnskey_algorithm, dnskey_digest_type) ; *flags |= 0x00000002; } else { sshlog("dns.c", __func__, 274, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "failed SSHFP type %d fptype %d", dnskey_algorithm, dnskey_digest_type) ; *flags |= 0x00000008; } } free(dnskey_digest); free(hostkey_digest); } freerrset(fingerprints); if (*flags & 0x00000008) *flags &= ~0x00000002; if (*flags & 0x00000001) if (*flags & 0x00000002) sshlog("dns.c", __func__, 291, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "matching host key fingerprint found in DNS"); else sshlog("dns.c", __func__, 293, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "mismatching host key fingerprint found in DNS"); else sshlog("dns.c", __func__, 295, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "no host key fingerprint found in DNS"); return 0; }
long long verify_host_key_dns(unsigned long long a0, unsigned long a1, unsigned int *a2, unsigned int *a3) { unsigned long long v0; unsigned int *v1; unsigned long v2; char v3; char v4; char v5; unsigned int v6; unsigned int v7; void* v8; char v9; char v10; unsigned long long v11; unsigned long v12; unsigned long long v13; unsigned long v14; unsigned long long v16; v2 = a1; v1 = a3; v8 = 0; *(a3) = 0; v0 = "verify_host_key_dns"; sshlog("dns.c", "verify_host_key_dns", 0xd6, 0x0, 0x7, 0x0); if (!a2) { v0 = "No key to look up!"; sshfatal("dns.c", "verify_host_key_dns", 0xd8, 0x0, 0x1, 0x0); } if (is_numeric_hostname(a0)) { v13 = "skipped DNS lookup for numerical hostname"; sshlog("dns.c", "verify_host_key_dns", 0xdb, 0x0, 0x5, 0x0); v16 = 4294967295; return v16; } v7 = getrrsetbyname(a0, 0x1, 0x2c, 0x0, &v8); if (v7) { v14 = dns_result_totext(v7); v13 = "DNS lookup error: %s"; sshlog("dns.c", "verify_host_key_dns", 0xe2, 0x0, 0x4, 0x0); v16 = 4294967295; return v16; } if ((*(v8) & 1)) { *(a3) = *(a3) | 4; v14 = v8[16]; v13 = "found %d secure fingerprints in DNS"; sshlog("dns.c", "verify_host_key_dns", 0xe8, 0x0, 0x5, 0x0); } else { v14 = v8[16]; v13 = "found %d insecure fingerprints in DNS"; sshlog("dns.c", "verify_host_key_dns", 0xeb, 0x0, 0x5, 0x0); } if (v8[16]) *(a3) = *(a3) | 1; for (v6 = 0; v6 < v8[16]; v6 += 1) { if (!dns_read_rdata(&v4, &v5, &v11, &v12, *((v8[32] + (v6 << 4) + 8)), *((v8[32] + (v6 << 4))))) { v13 = "Error parsing fingerprint from DNS."; sshlog("dns.c", "verify_host_key_dns", 0xfb, 0x0, 0x4, 0x0); } else { v13 = v5; v12 = v4; v11 = "checking SSHFP type %d fptype %d"; sshlog("dns.c", "verify_host_key_dns", 0xfe, 0x1, 0x7, 0x0); if (!dns_read_key(&v3, &v5, &v9, &v10, a2)) { v13 = "Error calculating key fingerprint."; sshlog("dns.c", "verify_host_key_dns", 0x104, 0x0, 0x2, 0x0); freerrset(v8); v16 = 4294967295; return v16; } if (v3 == v4 && *(&v10) == v12) { if (!timingsafe_bcmp(*(&v9), v11, *(&v10), v11)) { v13 = v5; v12 = v4; v11 = "matched SSHFP type %d fptype %d"; sshlog("dns.c", "verify_host_key_dns", 0x10e, 0x1, 0x5, 0x0); *(a3) = *(a3) | 2; } else { v13 = v5; v12 = v4; v11 = "failed SSHFP type %d fptype %d"; sshlog("dns.c", "verify_host_key_dns", 0x112, 0x1, 0x5, 0x0); *(a3) = *(a3) | 8; } } free(v11); free(*(&v9)); } } freerrset(v8); if ((*(a3) & 8)) *(a3) = *(a3) & -3; if (!(*(a3) & 1)) { v13 = "no host key fingerprint found in DNS"; sshlog("dns.c", "verify_host_key_dns", 0x127, 0x0, 0x5, 0x0); v16 = 0; return v16; } else if ((*(a3) & 2)) { v13 = "matching host key fingerprint found in DNS"; sshlog("dns.c", "verify_host_key_dns", 0x123, 0x0, 0x5, 0x0); v16 = 0; return v16; } else { v13 = "mismatching host key fingerprint found in DNS"; sshlog("dns.c", "verify_host_key_dns", 0x125, 0x0, 0x5, 0x0); v16 = 0; return v16; } }
static int rangecmp (c1, c2, forcecoll) int c1, c2; int forcecoll; { int r; r = charcmp (c1, c2, forcecoll); if (r != 0) return r; return (c1 - c2); }
int rangecmp(unsigned long a0, unsigned long a1, unsigned long a2) { unsigned int v0; v0 = charcmp(a0, a1, a2); return (!v0 ? v0 : a0 - a1); }
void bashline_set_event_hook () { rl_signal_event_hook = bash_event_hook; }
long long bashline_set_event_hook() { rl_signal_event_hook = bash_event_hook; return bash_event_hook; }
static int olderf (const char *f1, const char *f2) { struct stat64 b1, b2; return (stat64(f1, &b1) == 0 && stat64(f2, &b2) == 0 && (b1.st_mtim.tv_sec < b2.st_mtim.tv_sec || (b1.st_mtim.tv_sec == b2.st_mtim.tv_sec && (b1.st_mtim.tv_nsec < b2.st_mtim.tv_nsec ))) ); }
_BOOL8 olderf(const char *a1, const char *a2) { struct stat64 v3; struct stat64 v4; unsigned long v5; v5 = __readfsqword(0x28u); return !stat64(a1, &v3) && !stat64(a2, &v4) && (v3.st_mtim.tv_sec < v4.st_mtim.tv_sec || v3.st_mtim.tv_sec == v4.st_mtim.tv_sec && v3.st_mtim.tv_nsec < v4.st_mtim.tv_nsec); }
static void mark_ancestor_dirs (FTSENT *ent) { FTSENT *p; for (p = ent->fts_parent; 0 <= p->fts_level; p = p->fts_parent) { if (p->fts_number) break; p->fts_number = 1; } }
void mark_ancestor_dirs(long param_1) { long local_10; for (local_10 = *(long *)(param_1 + 8); (-1 < *(long *)(local_10 + 0x58) && (*(long *)(local_10 + 0x20) == 0)); local_10 = *(long *)(local_10 + 8)) { *(undefined8 *)(local_10 + 0x20) = 1; } return; }
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); }
int main(int argc, char **argv) { int c; FILE *fp; int reverse = 0, forever = 0, oldfmt = 0; while ((c = getopt(argc, argv, "froh")) != (-1) ) { switch (c) { case 'r': reverse = 1; break; case 'f': forever = 1; break; case 'o': oldfmt = 1; break; case 'h': usage(0); break; default: usage(1); } } if (optind < argc) { fprintf( stderr , "Utmp %sdump of %s\n", reverse ? "un" : "", argv[optind]); if ((fp = fopen(argv[optind], "r")) == ((void *)0) ) { perror("Unable to open file"); exit(1); } } else { fprintf( stderr , "Utmp %sdump of stdin\n", reverse ? "un" : ""); fp = stdin ; } if (reverse) undump(fp, forever, oldfmt); else dump(fp, forever, oldfmt); fclose(fp); return 0; }
int main(unsigned long a0, unsigned long long *a1) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; void* v4; unsigned int v6; unsigned int v7; v0 = 0; v1 = 0; v2 = 0; while (true) { v3 = getopt(a0, a1, "froh"); if (v3 == -1) break; switch (v3) { case 114: v0 = 1; break; case 111: v2 = 1; break; case 102: v1 = 1; break; case 104: usage(0x0); default: usage(0x1); } } if (a0 <= optind) { if (!v0) v6 = &g_400ed8; else v6 = "un"; fprintf(*(&stderr), "Utmp %sdump of stdin\n", v6); v4 = stdin; } else { if (!v0) v7 = &g_400ed8; else v7 = "un"; fprintf(*(&stderr), "Utmp %sdump of %s\n", v7, a1[optind]); v4 = fopen(a1[optind], "r"); if (!v4) { perror("Unable to open file"); exit(0x1); } } if (!v0) dump(v4, v1, v2); else undump(v4, v1, v2); fclose(v4); return 0; }
static VARLIST * vlist_alloc (nentries) int nentries; { VARLIST *vlist; vlist = (VARLIST *)sh_xmalloc((sizeof (VARLIST)), "variables.c", 4171); vlist->list = (SHELL_VAR **)sh_xmalloc(((nentries + 1) * sizeof (SHELL_VAR *)), "variables.c", 4172); vlist->list_size = nentries; vlist->list_len = 0; vlist->list[0] = (SHELL_VAR *) ((void *)0) ; return vlist; }
int vlist_alloc(unsigned long a0) { struct_0 *v0; v0 = sh_xmalloc(0x10, "variables.c", 0x104b); v0->field_0 = sh_xmalloc((a0 + 1) * 8, "variables.c", 0x104c); v0->field_8 = a0; v0->field_c = 0; v0->field_0->field_0 = 0; return v0; }
static void makeMaps_e ( EState* s ) { Int32 i; s->nInUse = 0; for (i = 0; i < 256; i++) if (s->inUse[i]) { s->unseqToSeq[i] = s->nInUse; s->nInUse++; } }
void makeMaps_e(struct_2 *a0) { unsigned int v0; struct_2 *v2; unsigned long long v3; unsigned int v4; struct_2 *v5; v2 = a0; a0->field_7c = 0; for (v0 = 0; v0 <= 255; v0 += 1) { v3 = a0[1].padding_0[v0]; if (a0[1].padding_0[v0]) { v4 = a0->field_7c; a0[3].padding_0[v0] = a0->field_7c; v5 = a0; a0->field_7c = v4 + 1; } } return; }
static void cmov_aff(ge25519_aff *r, const ge25519_aff *p, unsigned char b) { crypto_sign_ed25519_ref_fe25519_cmov(&r->x, &p->x, b); crypto_sign_ed25519_ref_fe25519_cmov(&r->y, &p->y, b); }
void cmov_aff(unsigned long long a0, unsigned long long a1, unsigned long a2) { unsigned long long v1; crypto_sign_ed25519_ref_fe25519_cmov(a0, a1, a2, a1); v1 = crypto_sign_ed25519_ref_fe25519_cmov(a0 + 128, a1 + 128, a2, a0 + 128); return; }
static _Bool decode_one_format (char const *s_orig, char const *s, char const **next, struct tspec *tspec) { enum size_spec size_spec; unsigned long int size; enum output_format fmt; void (*print_function) (size_t, size_t, void const *, char const *, int, int); char const *p; char c; int field_width; ((void) sizeof (( tspec != ((void *)0)) ? 1 : 0), __extension__ ({ if ( tspec != ((void *)0)) ; else __assert_fail ( "tspec != NULL" , "src/od.c", 648, __extension__ __PRETTY_FUNCTION__); })) ; switch (*s) { case 'd': case 'o': case 'u': case 'x': c = *s; ++s; switch (*s) { case 'C': ++s; size = sizeof (char); break; case 'S': ++s; size = sizeof (short int); break; case 'I': ++s; size = sizeof (int); break; case 'L': ++s; size = sizeof (long int); break; default: if (! simple_strtoul (s, &p, &size)) { error (0, 0, gettext ("invalid type string %s"), quote (s_orig)); return 0 ; } if (p == s) size = sizeof (int); else { if (sizeof (unsigned_long_long_int) < size || integral_type_size[size] == NO_SIZE) { error (0, 0, gettext ("invalid type string %s;\nthis system" " doesn't provide a %lu-byte integral type") , quote (s_orig), size); return 0 ; } s = p; } break; } size_spec = integral_type_size[size]; switch (c) { case 'd': fmt = SIGNED_DECIMAL; field_width = bytes_to_signed_dec_digits[size]; sprintf (tspec->fmt_string, "%%*%s", ((size_spec) == LONG_LONG ? ( "l" "d" ) : ((size_spec) == LONG ? ("ld") : ("d")))); break; case 'o': fmt = OCTAL; sprintf (tspec->fmt_string, "%%*.%d%s", (field_width = bytes_to_oct_digits[size]), ((size_spec) == LONG_LONG ? ( "l" "o" ) : ((size_spec) == LONG ? ("lo") : ("o")))); break; case 'u': fmt = UNSIGNED_DECIMAL; field_width = bytes_to_unsigned_dec_digits[size]; sprintf (tspec->fmt_string, "%%*%s", ((size_spec) == LONG_LONG ? ( "l" "u" ) : ((size_spec) == LONG ? ("lu") : ("u")))); break; case 'x': fmt = HEXADECIMAL; sprintf (tspec->fmt_string, "%%*.%d%s", (field_width = bytes_to_hex_digits[size]), ((size_spec) == LONG_LONG ? ( "l" "x" ) : ((size_spec) == LONG ? ("lx") : ("x")))); break; default: abort (); } ((void) sizeof (( strlen (tspec->fmt_string) < FMT_BYTES_ALLOCATED ) ? 1 : 0), __extension__ ({ if ( strlen (tspec->fmt_string) < FMT_BYTES_ALLOCATED ) ; else __assert_fail ( "strlen (tspec->fmt_string) < FMT_BYTES_ALLOCATED" , "src/od.c", 747, __extension__ __PRETTY_FUNCTION__); })) ; switch (size_spec) { case CHAR: print_function = (fmt == SIGNED_DECIMAL ? print_s_char : print_char); break; case SHORT: print_function = (fmt == SIGNED_DECIMAL ? print_s_short : print_short); break; case INT: print_function = print_int; break; case LONG: print_function = print_long; break; case LONG_LONG: print_function = print_long_long; break; default: abort (); } break; case 'f': fmt = FLOATING_POINT; ++s; switch (*s) { case 'F': ++s; size = sizeof (float); break; case 'D': ++s; size = sizeof (double); break; case 'L': ++s; size = sizeof (long double); break; default: if (! simple_strtoul (s, &p, &size)) { error (0, 0, gettext ("invalid type string %s"), quote (s_orig)); return 0 ; } if (p == s) size = sizeof (double); else { if (size > sizeof (long double) || fp_type_size[size] == NO_SIZE) { error (0, 0, gettext ("invalid type string %s;\n" "this system doesn't provide a %lu-byte" " floating point type") , quote (s_orig), size); return 0 ; } s = p; } break; } size_spec = fp_type_size[size]; { struct lconv const *locale = localeconv (); size_t decimal_point_len = (locale->decimal_point[0] ? strlen (locale->decimal_point) : 1); switch (size_spec) { case FLOAT_SINGLE: print_function = print_float; field_width = (1 + (((((24) * 1) * 146 + 484) / 485) + 1) + decimal_point_len + 1 + ( -100 < ((-37)) && (38) < 100 ? 3 : -1000 < ((-37)) && (38) < 1000 ? 4 : -10000 < ((-37)) && (38) < 10000 ? 5 : -100000 < ((-37)) && (38) < 100000 ? 6 : -1000000 < ((-37)) && (38) < 1000000 ? 7 : (((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) )); break; case FLOAT_DOUBLE: print_function = print_double; field_width = (1 + (((((53) * 1) * 146 + 484) / 485) + 1) + decimal_point_len + 1 + ( -100 < ((-307)) && (308) < 100 ? 3 : -1000 < ((-307)) && (308) < 1000 ? 4 : -10000 < ((-307)) && (308) < 10000 ? 5 : -100000 < ((-307)) && (308) < 100000 ? 6 : -1000000 < ((-307)) && (308) < 1000000 ? 7 : (((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) )); break; case FLOAT_LONG_DOUBLE: print_function = print_long_double; field_width = (1 + (((((64) * 1) * 146 + 484) / 485) + 1) + decimal_point_len + 1 + ( -100 < ((-4931)) && (4932) < 100 ? 3 : -1000 < ((-4931)) && (4932) < 1000 ? 4 : -10000 < ((-4931)) && (4932) < 10000 ? 5 : -100000 < ((-4931)) && (4932) < 100000 ? 6 : -1000000 < ((-4931)) && (4932) < 1000000 ? 7 : (((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) )); break; default: abort (); } break; } case 'a': ++s; fmt = NAMED_CHARACTER; size_spec = CHAR; print_function = print_named_ascii; field_width = 3; break; case 'c': ++s; fmt = CHARACTER; size_spec = CHAR; print_function = print_ascii; field_width = 3; break; default: error (0, 0, gettext ("invalid character '%c' in type string %s"), *s, quote (s_orig)); return 0 ; } tspec->size = size_spec; tspec->fmt = fmt; tspec->print_function = print_function; tspec->field_width = field_width; tspec->hexl_mode_trailer = (*s == 'z'); if (tspec->hexl_mode_trailer) s++; if (next != ((void *)0) ) *next = s; return 1 ; }
long decode_one_format(long a1, char *a2, char **a3, long a4) { int v4; long v5; char *v6; unsigned long v8; long v9; char *v10; const char *v11; const char *v12; const char *v13; void *v14; unsigned long ( *v15)(unsigned long, unsigned long, _WORD *, const char *, int, int); int v16; unsigned long v17; long v18; char *v19; size_t v20; long v21; unsigned int v22; char *v23; char *v26; char v27; unsigned int v28; int v29; unsigned int v30; unsigned long v31; char *v32; void *v33; struct lconv *v34; size_t v35; unsigned long v36; v36 = __readfsqword(0x28u); if ( !a4 ) _assert_fail("tspec != NULL", "src/od.c", 0x288u, "decode_one_format"); switch ( *a2 ) { case 'a': v26 = a2 + 1; v29 = 5; v28 = 1; v33 = print_named_ascii; v30 = 3; goto LABEL_99; case 'c': v26 = a2 + 1; v29 = 6; v28 = 1; v33 = print_ascii; v30 = 3; goto LABEL_99; case 'd': case 'o': case 'u': case 'x': v27 = *a2; v26 = a2 + 1; v4 = a2[1]; if ( v4 == 83 ) { v26 = a2 + 2; v31 = 2LL; goto LABEL_23; } if ( v4 > 83 ) goto LABEL_15; if ( v4 == 76 ) { v26 = a2 + 2; v31 = 8LL; } else { if ( v4 > 76 ) goto LABEL_15; if ( v4 == 67 ) { v26 = a2 + 2; v31 = 1LL; goto LABEL_23; } if ( v4 == 73 ) { v26 = a2 + 2; v31 = 4LL; } else { LABEL_15: if ( (unsigned char)simple_strtoul(v26, &v32, &v31) != 1 ) { LABEL_16: v5 = quote(a1); v6 = gettext("invalid type string %s"); error(0, 0, v6, v5); return 0LL; } if ( v26 == v32 ) { v31 = 4LL; } else { if ( v31 > 8 || !integral_type_size[v31] ) { v8 = v31; v9 = quote(a1); v10 = gettext("invalid type string %s;\nthis system doesn't provide a %lu-byte integral type"); error(0, 0, v10, v9, v8); return 0LL; } v26 = v32; } } } LABEL_23: v28 = integral_type_size[v31]; if ( v27 != 120 ) { if ( v27 > 120 ) goto LABEL_53; if ( v27 == 117 ) { v29 = 1; v30 = bytes_to_unsigned_dec_digits[v31]; if ( v28 == 5 ) { v11 = "lu"; } else if ( v28 == 4 ) { v11 = "lu"; } else { v11 = "u"; } } else { if ( v27 > 117 ) goto LABEL_53; if ( v27 != 100 ) { if ( v27 != 111 ) LABEL_53: abort(); v29 = 2; if ( v28 == 5 ) { v12 = "lo"; } else if ( v28 == 4 ) { v12 = "lo"; } else { v12 = "o"; } v30 = bytes_to_oct_digits[v31]; sprintf((char *)(a4 + 16), "%%*.%d%s", v30, v12); goto LABEL_54; } v29 = 0; v30 = bytes_to_signed_dec_digits[v31]; if ( v28 == 5 ) { v11 = "ld"; } else if ( v28 == 4 ) { v11 = "ld"; } else { v11 = "d"; } } sprintf((char *)(a4 + 16), "%%*%s", v11); goto LABEL_54; } v29 = 3; if ( v28 == 5 ) { v13 = "lx"; } else if ( v28 == 4 ) { v13 = "lx"; } else { v13 = "x"; } v30 = bytes_to_hex_digits[v31]; sprintf((char *)(a4 + 16), "%%*.%d%s", v30, v13); LABEL_54: if ( strlen((const char *)(a4 + 16)) > 7 ) _assert_fail("strlen (tspec->fmt_string) < FMT_BYTES_ALLOCATED", "src/od.c", 0x2EBu, "decode_one_format"); switch ( v28 ) { case 1u: if ( v29 ) v14 = print_char; else v14 = print_s_char; v33 = v14; break; case 2u: if ( v29 ) v15 = print_short; else v15 = print_s_short; v33 = v15; break; case 3u: v33 = print_int; break; case 4u: v33 = print_long; break; case 5u: v33 = print_long_long; break; default: abort(); } goto LABEL_99; case 'f': v29 = 4; v26 = a2 + 1; v16 = a2[1]; if ( v16 == 76 ) { v26 = a2 + 2; v31 = 16LL; } else { if ( v16 <= 76 ) { if ( v16 == 68 ) { v26 = a2 + 2; v31 = 8LL; goto LABEL_84; } if ( v16 == 70 ) { v26 = a2 + 2; v31 = 4LL; goto LABEL_84; } } if ( (unsigned char)simple_strtoul(v26, &v32, &v31) != 1 ) goto LABEL_16; if ( v26 == v32 ) { v31 = 8LL; } else { if ( v31 > 0x10 || !fp_type_size[v31] ) { v17 = v31; v18 = quote(a1); v19 = gettext("invalid type string %s;\nthis system doesn't provide a %lu-byte floating point type"); error(0, 0, v19, v18, v17); return 0LL; } v26 = v32; } } LABEL_84: v28 = fp_type_size[v31]; v34 = localeconv(); if ( *v34->decimal_point ) v20 = strlen(v34->decimal_point); else v20 = 1LL; v35 = v20; if ( v28 == 8 ) { v33 = print_long_double; v30 = v35 + 28; } else { if ( v28 > 8 ) goto LABEL_95; if ( v28 == 6 ) { v33 = print_float; v30 = v35 + 14; } else { if ( v28 != 7 ) LABEL_95: abort(); v33 = print_double; v30 = v35 + 23; } } LABEL_99: *(_DWORD *)(a4 + 4) = v28; *(_DWORD *)a4 = v29; *(_QWORD *)(a4 + 8) = v33; *(_DWORD *)(a4 + 28) = v30; *(_BYTE *)(a4 + 24) = *v26 == 122; if ( *(_BYTE *)(a4 + 24) ) ++v26; if ( a3 ) *a3 = v26; return 1LL; default: v21 = quote(a1); v22 = *a2; v23 = gettext("invalid character '%c' in type string %s"); error(0, 0, v23, v22, v21); return 0LL; } }
static int xfrm_state_list_or_deleteall(int argc, char **argv, int deleteall) { char *idp = ((void *)0) ; struct rtnl_handle rth; _Bool nokeys = 0 ; if (argc > 0 || preferred_family != 0 ) filter.use = 1; filter.xsinfo.family = preferred_family; while (argc > 0) { if (strcmp(*argv, "nokeys") == 0) { nokeys = 1 ; } else if (strcmp(*argv, "mode") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); xfrm_mode_parse(&filter.xsinfo.mode, &argc, &argv); filter.mode_mask = (~0); } else if (strcmp(*argv, "reqid") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); xfrm_reqid_parse(&filter.xsinfo.reqid, &argc, &argv); filter.reqid_mask = (~0); } else if (strcmp(*argv, "flag") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); xfrm_state_flag_parse(&filter.xsinfo.flags, &argc, &argv); filter.state_flags_mask = (~0); } else { if (idp) invarg("unknown", *argv); idp = *argv; xfrm_id_parse(&filter.xsinfo.saddr, &filter.xsinfo.id, &filter.xsinfo.family, 1, &argc, &argv); if (preferred_family == 0 ) preferred_family = filter.xsinfo.family; } argc--; argv++; } if (rtnl_open_byproto(&rth, 0, 6) < 0) exit(1); if (deleteall) { struct xfrm_buffer xb; char buf[8192]; int i; xb.buf = buf; xb.size = sizeof(buf); xb.rth = &rth; for (i = 0; ; i++) { struct { struct nlmsghdr n; char buf[4096]; } req = { .n.nlmsg_len = ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )), .n.nlmsg_flags = (0x100|0x200) | 0x01, .n.nlmsg_type = XFRM_MSG_GETSA, .n.nlmsg_seq = rth.dump = ++rth.seq, }; xb.offset = 0; xb.nlmsg_count = 0; if (show_stats > 1) fprintf( stderr , "Delete-all round = %d\n", i); if (rtnl_send(&rth, (void *)&req, req.n.nlmsg_len) < 0) { perror("Cannot send dump request"); exit(1); } if (rtnl_dump_filter_nc(&rth, xfrm_state_keep, &xb, 0) < 0) { fprintf( stderr , "Delete-all terminated\n"); exit(1); } if (xb.nlmsg_count == 0) { if (show_stats > 1) fprintf( stderr , "Delete-all completed\n"); break; } if (rtnl_send_check(&rth, xb.buf, xb.offset) < 0) { perror("Failed to send delete-all request\n"); exit(1); } if (show_stats > 1) fprintf( stderr , "Delete-all nlmsg count = %d\n", xb.nlmsg_count); xb.offset = 0; xb.nlmsg_count = 0; } } else { struct xfrm_address_filter addrfilter = { .saddr = filter.xsinfo.saddr, .daddr = filter.xsinfo.id.daddr, .family = filter.xsinfo.family, .splen = filter.id_src_mask, .dplen = filter.id_dst_mask, }; struct { struct nlmsghdr n; char buf[4096]; } req = { .n.nlmsg_len = ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )), .n.nlmsg_flags = (0x100|0x200) | 0x01, .n.nlmsg_type = XFRM_MSG_GETSA, .n.nlmsg_seq = rth.dump = ++rth.seq, }; if (filter.xsinfo.id.proto) addattr8(&req.n, sizeof(req), XFRMA_PROTO, filter.xsinfo.id.proto); addattr_l(&req.n, sizeof(req), XFRMA_ADDRESS_FILTER, &addrfilter, sizeof(addrfilter)); if (rtnl_send(&rth, (void *)&req, req.n.nlmsg_len) < 0) { perror("Cannot send dump request"); exit(1); } rtnl_filter_t filter = nokeys ? xfrm_state_print_nokeys : xfrm_state_print; if (rtnl_dump_filter_nc(&rth, filter, stdout , 0) < 0) { fprintf( stderr , "Dump terminated\n"); exit(1); } } rtnl_close(&rth); exit(0); }
void xfrm_state_list_or_deleteall(unsigned long a0, unsigned long a1, unsigned long a2) { unsigned long long *v0; unsigned int v1; char v2; unsigned int v3; void* v4; unsigned long long v5; unsigned long long v6; unsigned int v7; unsigned int v8; unsigned int v9; unsigned long v10; char v11; unsigned int v12; unsigned int v13; unsigned long v14; unsigned long v15; unsigned long v16; unsigned long v17; unsigned short v18; char v19; char v20; void* v21; unsigned short v22; unsigned short v23; unsigned int v24; char v25; char v26; char v27; unsigned long long v28; unsigned long v29; unsigned long long *v31; unsigned long v37; unsigned long long *v38; unsigned long long v39; unsigned long long v40; unsigned long long *v41; unsigned long v42; unsigned long long v46; unsigned long long v47; unsigned long long v48; v28 = *(&v28); v27 = *(&v27); v25 = *(&v25); v1 = a0; v0 = a1; v29 = v31[5]; v4 = 0; v2 = 0; if (v1 > 0 || preferred_family) filter = 1; for (g_500224 = preferred_family; v1 > 0; v0 += 1) { if (!strcmp(*(v0), "nokeys")) { v2 = 1; } else if (!strcmp(*(v0), "mode")) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); xfrm_mode_parse(0x500226, &v1, &v0, 0x1); g_500238 = 255; } else if (!strcmp(*(v0), "reqid")) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); xfrm_reqid_parse(0x500220, &v1, &v0, 0x1); g_50023c = -1; } else if (!strcmp(*(v0), "flag")) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); xfrm_state_flag_parse(&g_500228, &v1, &v0); g_500240 = 255; } else { if (v4) invarg("unknown", *(v0)); v4 = *(v0); xfrm_id_parse(rtnl_dump_filter_nc, 0x500188, 0x500224, 0x1, &v1, &v0); if (!preferred_family) preferred_family = g_500224; } v1 -= 1; } if (rtnl_open_byproto(&v11, 0x0, 0x6) < 0) exit(0x1); if (a2) { v6 = &v26; v7 = 0x2000; v10 = &v11; v3 = 0; while (true) { v40 = 514; for (v41 = &v21; v40; v41 = &v41[v42]) { v40 -= 1; v21 = 0; } v21 = 16; v22 = 18; v23 = 769; v12 = *(&v12) + 1; v13 = v12; v24 = v13; v8 = 0; v9 = 0; if (show_stats > 1) fprintf(*(&stderr), "Delete-all round = %d\n", v3); if (rtnl_send(&v11, &v21, v21, &v21) < 0) { perror("Cannot send dump request"); exit(0x1); } else if (rtnl_dump_filter_nc(&v11, xfrm_state_keep, &v6, 0x0) < 0) { fprintf(*(&stderr), "Delete-all terminated\n"); exit(0x1); } else { if (!v9) break; if (v9) { if (rtnl_send_check(&v11, v6, v8, v6) < 0) { perror("Failed to send delete-all request\n"); exit(0x1); } if (show_stats > 1) fprintf(*(&stderr), "Delete-all nlmsg count = %d\n", v9); v8 = 0; v9 = 0; v3 += 1; } } } if (show_stats > 1) fprintf(*(&stderr), "Delete-all completed\n"); } else { v14 = rtnl_dump_filter_nc; v15 = rtnl_send_check; v16 = show_stats; v17 = rtnl_send; v18 = g_500224; v19 = g_500230; v20 = g_500231; v39 = 514; for (v38 = &v21; v39; v38 = &v38[v37]) { v39 -= 1; v21 = 0; } v21 = 16; v22 = 18; v23 = 769; v12 = *(&v12) + 1; v13 = v12; v24 = v13; if (g_50019c) addattr8(&v21, 0x1010, 0x19, g_50019c); addattr_l(&v21, 0x1010, 0x1a, &v14, 0x24); v46 = rtnl_send(&v11, &v21, v21, &v21); if (v46 < 0) { perror("Cannot send dump request"); exit(0x1); } if (v2) v47 = xfrm_state_print_nokeys; else v47 = xfrm_state_print; v5 = v47; v48 = rtnl_dump_filter_nc(&v11, v5, stdout, 0x0); if (v48 < 0) { fprintf(*(&stderr), "Dump terminated\n"); exit(0x1); } } if (a2 || v46 >= 0 && v48 >= 0) { rtnl_close(&v11); exit(0x0); } }
int rl_vi_put (int count, int key) { if (!(1 && (1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)key ))] & (unsigned short int) _ISupper) )) && (rl_point + 1 <= rl_end)) rl_point = _rl_find_next_mbchar (rl_line_buffer, rl_point, 1, 0x01); while (count--) rl_yank (1, key); rl_backward_char (1, key); return (0); }
long long rl_vi_put(unsigned long a0, unsigned long a1) { unsigned int v0; int tmp_9; unsigned int v3; v0 = a0; v3 = *((*(__ctype_b_loc()) + a1 * 2)) & 0x100; if (!v3 && rl_point < rl_end) rl_point = _rl_find_next_mbchar(rl_line_buffer, rl_point, 0x1, 0x1); while (true) { tmp_9 = v0; v0 -= 1; if (!tmp_9) break; rl_yank(1, a1); } rl_backward_char(0x1, a1); return 0; }
static char * dumpdir_next (struct dumpdir_iter *itr) { size_t cur = itr->next; char *ret = ((void *)0) ; if (itr->all) { ret = itr->dump->contents + cur; if (*ret == 0) return ((void *)0) ; itr->next += strlen (ret) + 1; } else if (cur < itr->dump->elc) { ret = itr->dump->elv[cur] - 1; itr->next++; } return ret; }
int dumpdir_next(struct_0 *a0) { void* v0; unsigned long long *v1; unsigned int v3; v1 = a0->field_10; v0 = 0; if (a0->field_8) { v0 = v1 + a0->field_0->field_0; if (!*(v0)) { v3 = 0; goto LABEL_400368; } else { a0->field_10 = strlen(v0) + a0->field_10 + 1; } } else if (v1 < a0->field_0->field_10) { v0 = *((a0->field_0->field_18 + v1 * 8)) - 1; a0->field_10 = a0->field_10 + 1; } v3 = v0; LABEL_400368: return v3; }
static void ifb_print_help(struct link_util *lu, int argc, char **argv, FILE *f) { fprintf(f, "Usage: ... ifb\n"); }
long long ifb_print_help(unsigned long a0, unsigned long a1, unsigned long a2, void* a3) { unsigned long v0; unsigned int v1; unsigned long v2; v2 = a0; v1 = a1; v0 = a2; return fprintf(a3, "Usage: ... ifb\n"); }
void init_nfs(void) { struct stat st; struct mntent * ent; FILE * mnt; nlist = (NFS*)0; if (stat("/proc/version", &st) < 0) return; if ((mnt = setmntent("/proc/mounts", "r")) == (FILE*)0) return; while ((ent = getmntent(mnt))) { if (isnetfs(ent->mnt_type)) { size_t nlen = strlen(ent->mnt_dir); NFS *__restrict__ p; xmemalign((void*)&p, sizeof(void*), ((sizeof(NFS)+(sizeof(void*)-1)) & ~(sizeof(void*)-1))+(nlen+1)); p->name = ((char*)p)+((sizeof(NFS)+(sizeof(void*)-1)) & ~(sizeof(void*)-1)); p->nlen = nlen; p->shadow = (SHADOW*)0; strcpy(p->name, ent->mnt_dir); if (nlist) nlist->prev = p; p->next = nlist; p->prev = (NFS*)0; nlist = p; } } endmntent(mnt); if ((mnt = setmntent("/proc/mounts", "r")) == (FILE*)0) return; while ((ent = getmntent(mnt))) { NFS *p; for (p = nlist; p; p = p->next) { SHADOW * __restrict__ s; size_t nlen; if (strcmp(ent->mnt_dir, p->name) == 0) continue; if (strncmp(ent->mnt_dir, p->name, p->nlen) != 0) continue; nlen = strlen(ent->mnt_dir); xmemalign((void*)&s, sizeof(void*), ((sizeof(SHADOW)+(sizeof(void*)-1)) & ~(sizeof(void*)-1))+(nlen+1)); s->name = ((char*)s)+((sizeof(SHADOW)+(sizeof(void*)-1)) & ~(sizeof(void*)-1)); s->nlen = nlen; strcpy(s->name, ent->mnt_dir); if (p->shadow) p->shadow->prev = s; s->next = p->shadow; s->prev = (SHADOW*)0; p->shadow = s; } } endmntent(mnt); }
unsigned long init_nfs() { char *v1; long i; FILE *stream; struct mntent *v4; size_t v5; size_t v6; struct stat v7; unsigned long v8; v8 = __readfsqword(0x28u); nlist = 0LL; if ( stat("/proc/version", &v7) >= 0 ) { stream = setmntent("/proc/mounts", "r"); if ( stream ) { while ( 1 ) { v4 = getmntent(stream); if ( !v4 ) break; if ( (unsigned int)isnetfs(v4->mnt_type) ) { v6 = strlen(v4->mnt_dir); xmemalign((void **)&v1, 8uLL, v6 + 41); *((_QWORD *)v1 + 4) = v1 + 40; *((_QWORD *)v1 + 3) = v6; *((_QWORD *)v1 + 2) = 0LL; strcpy(*((char **)v1 + 4), v4->mnt_dir); if ( nlist ) *(_QWORD *)(nlist + 8) = v1; *(_QWORD *)v1 = nlist; *((_QWORD *)v1 + 1) = 0LL; nlist = (long)v1; } } endmntent(stream); stream = setmntent("/proc/mounts", "r"); if ( stream ) { while ( 1 ) { v4 = getmntent(stream); if ( !v4 ) break; for ( i = nlist; i; i = *(_QWORD *)i ) { if ( strcmp(v4->mnt_dir, *(const char **)(i + 32)) && !strncmp(v4->mnt_dir, *(const char **)(i + 32), *(_QWORD *)(i + 24)) ) { v5 = strlen(v4->mnt_dir); xmemalign((void **)&v1, 8uLL, v5 + 33); *((_QWORD *)v1 + 3) = v1 + 32; *((_QWORD *)v1 + 2) = v5; strcpy(*((char **)v1 + 3), v4->mnt_dir); if ( *(_QWORD *)(i + 16) ) *(_QWORD *)(*(_QWORD *)(i + 16) + 8LL) = v1; *(_QWORD *)v1 = *(_QWORD *)(i + 16); *((_QWORD *)v1 + 1) = 0LL; *(_QWORD *)(i + 16) = v1; } } } endmntent(stream); } } } return __readfsqword(0x28u) ^ v8; }
prompt_set(EditLine *el, el_pfunc_t prf, wchar_t c, int op, int wide) { el_prompt_t *p; if (op == 0 || op == 21) p = &el->el_prompt; else p = &el->el_rprompt; if (prf == ((void *)0) ) { if (op == 0 || op == 21) p->p_func = prompt_default; else p->p_func = prompt_default_r; } else { p->p_func = prf; } p->p_ignore = c; p->p_pos.v = 0; p->p_pos.h = 0; p->p_wide = wide; return 0; }
long long prompt_set(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4) { struct_0 *v0; switch (a3) { case 0: case 21: v0 = a0 + 800; break; default: v0 = a0 + 824; break; } if (a1) { v0->field_0 = a1; } else { switch (a3) { case 0: case 21: v0->field_0 = prompt_default; break; default: v0->field_0 = prompt_default_r; break; } } v0->field_10 = a2; v0->field_c = 0; v0->field_8 = 0; v0->field_14 = a4; return 0; }
SHELL_VAR * convert_var_to_assoc (var) SHELL_VAR *var; { char *oldval; HASH_TABLE *hash; oldval = ((var)->value); hash = (hash_create((0))); if (oldval) assoc_insert (hash, (char *)strcpy (sh_xmalloc((1 + strlen ("0")), "arrayfunc.c", 124), ("0")), oldval); do { if (((var)->value)) sh_xfree((((var)->value)), "arrayfunc.c", 126); } while (0); ((var)->value = (char *)(hash)); var->dynamic_value = (sh_var_value_func_t *) ((void *)0) ; var->assign_func = (sh_var_assign_func_t *) ((void *)0) ; do { if ((var)->exportstr) { sh_xfree(((var)->exportstr), "arrayfunc.c", 133); (var)->exportstr = (char *) ((void *)0) ; } } while (0); if (((((var)->attributes) & (0x0000001)))) array_needs_making++; ((var)->attributes |= (0x0000040)); if (oldval) ((var)->attributes &= ~(0x0001000)); ((var)->attributes &= ~(0x0000004)); ((var)->attributes &= ~(0x0000800)); return var; }
long convert_var_to_assoc(long a1) { size_t v1; char *v2; char *v3; int v4; int v5; long v7; long v8; v7 = *(_QWORD *)(a1 + 8); v8 = hash_create(0LL); if ( v7 ) { v1 = strlen("0"); v2 = (char *)sh_xmalloc(v1 + 1, "arrayfunc.c", 124LL); v3 = strcpy(v2, "0"); assoc_insert(v8, v3, v7); } if ( *(_QWORD *)(a1 + 8) ) sh_xfree(*(_QWORD *)(a1 + 8), "arrayfunc.c", 126LL); *(_QWORD *)(a1 + 8) = v8; *(_QWORD *)(a1 + 24) = 0LL; *(_QWORD *)(a1 + 32) = 0LL; if ( *(_QWORD *)(a1 + 16) ) { sh_xfree(*(_QWORD *)(a1 + 16), "arrayfunc.c", 133LL); *(_QWORD *)(a1 + 16) = 0LL; } if ( (*(_DWORD *)(a1 + 40) & 1) != 0 ) ++array_needs_making; *(_DWORD *)(a1 + 40) |= 0x40u; if ( v7 ) { v4 = *(_DWORD *)(a1 + 40); BYTE1(v4) &= ~0x10u; *(_DWORD *)(a1 + 40) = v4; } *(_DWORD *)(a1 + 40) &= ~4u; v5 = *(_DWORD *)(a1 + 40); BYTE1(v5) &= ~8u; *(_DWORD *)(a1 + 40) = v5; return a1; }
void ssh_tty_parse_modes(struct ssh *ssh, int fd) { struct termios tio; struct sshbuf *buf; const u_char *data; u_char opcode; u_int baud, u; int r, failure = 0; size_t len; if ((r = sshpkt_get_string_direct(ssh, &data, &len)) != 0) sshfatal("ttymodes.c", __func__, 354, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); if (len == 0) return; if ((buf = sshbuf_from(data, len)) == ((void *)0) ) { sshlog("ttymodes.c", __func__, 358, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "sshbuf_from failed"); return; } if (tcgetattr(fd, &tio) == -1) { sshlog("ttymodes.c", __func__, 368, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "tcgetattr: %.100s", strerror( (*__errno_location ()) )); failure = -1; } while (sshbuf_len(buf) > 0) { if ((r = sshbuf_get_u8(buf, &opcode)) != 0) sshfatal("ttymodes.c", __func__, 374, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse opcode"); switch (opcode) { case 0: goto set; case 128: if ((r = sshbuf_get_u32(buf, &baud)) != 0) sshfatal("ttymodes.c", __func__, 381, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse ispeed"); if (failure != -1 && cfsetispeed(&tio, baud_to_speed(baud)) == -1) sshlog("ttymodes.c", __func__, 384, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "cfsetispeed failed for %d", baud); break; case 129: if ((r = sshbuf_get_u32(buf, &baud)) != 0) sshfatal("ttymodes.c", __func__, 389, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse ospeed"); if (failure != -1 && cfsetospeed(&tio, baud_to_speed(baud)) == -1) sshlog("ttymodes.c", __func__, 392, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "cfsetospeed failed for %d", baud); break; case 1: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 61, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "VINTR"); tio.c_cc[ 0 ] = special_char_decode(u); break; case 2: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 62, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "VQUIT"); tio.c_cc[ 1 ] = special_char_decode(u); break; case 3: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 63, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "VERASE"); tio.c_cc[ 2 ] = special_char_decode(u); break; case 4: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 65, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "VKILL"); tio.c_cc[ 3 ] = special_char_decode(u); break; case 5: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 67, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "VEOF"); tio.c_cc[ 4 ] = special_char_decode(u); break; case 6: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 69, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "VEOL"); tio.c_cc[ 11 ] = special_char_decode(u); break; case 7: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 72, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "VEOL2"); tio.c_cc[ 16 ] = special_char_decode(u); break; case 8: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 74, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "VSTART"); tio.c_cc[ 8 ] = special_char_decode(u); break; case 9: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 75, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "VSTOP"); tio.c_cc[ 9 ] = special_char_decode(u); break; case 10: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 77, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "VSUSP"); tio.c_cc[ 10 ] = special_char_decode(u); break; case 12: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 83, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "VREPRINT"); tio.c_cc[ 12 ] = special_char_decode(u); break; case 13: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 86, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "VWERASE"); tio.c_cc[ 14 ] = special_char_decode(u); break; case 14: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 89, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "VLNEXT"); tio.c_cc[ 15 ] = special_char_decode(u); break; case 18: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 101, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "VDISCARD"); tio.c_cc[ 13 ] = special_char_decode(u); break; case 30: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 105, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "IGNPAR"); if (u) tio.c_iflag |= 0000004 ; else tio.c_iflag &= ~ 0000004 ; break; case 31: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 106, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "PARMRK"); if (u) tio.c_iflag |= 0000010 ; else tio.c_iflag &= ~ 0000010 ; break; case 32: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 107, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "INPCK"); if (u) tio.c_iflag |= 0000020 ; else tio.c_iflag &= ~ 0000020 ; break; case 33: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 108, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "ISTRIP"); if (u) tio.c_iflag |= 0000040 ; else tio.c_iflag &= ~ 0000040 ; break; case 34: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 109, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "INLCR"); if (u) tio.c_iflag |= 0000100 ; else tio.c_iflag &= ~ 0000100 ; break; case 35: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 110, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "IGNCR"); if (u) tio.c_iflag |= 0000200 ; else tio.c_iflag &= ~ 0000200 ; break; case 36: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 111, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "ICRNL"); if (u) tio.c_iflag |= 0000400 ; else tio.c_iflag &= ~ 0000400 ; break; case 37: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 113, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "IUCLC"); if (u) tio.c_iflag |= 0001000 ; else tio.c_iflag &= ~ 0001000 ; break; case 38: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 115, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "IXON"); if (u) tio.c_iflag |= 0002000 ; else tio.c_iflag &= ~ 0002000 ; break; case 39: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 116, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "IXANY"); if (u) tio.c_iflag |= 0004000 ; else tio.c_iflag &= ~ 0004000 ; break; case 40: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 117, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "IXOFF"); if (u) tio.c_iflag |= 0010000 ; else tio.c_iflag &= ~ 0010000 ; break; case 41: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 119, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "IMAXBEL"); if (u) tio.c_iflag |= 0020000 ; else tio.c_iflag &= ~ 0020000 ; break; case 42: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 122, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "IUTF8"); if (u) tio.c_iflag |= 0040000 ; else tio.c_iflag &= ~ 0040000 ; break; case 50: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 125, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "ISIG"); if (u) tio.c_lflag |= 0000001 ; else tio.c_lflag &= ~ 0000001 ; break; case 51: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 126, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "ICANON"); if (u) tio.c_lflag |= 0000002 ; else tio.c_lflag &= ~ 0000002 ; break; case 52: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 128, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "XCASE"); if (u) tio.c_lflag |= 0000004 ; else tio.c_lflag &= ~ 0000004 ; break; case 53: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 130, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "ECHO"); if (u) tio.c_lflag |= 0000010 ; else tio.c_lflag &= ~ 0000010 ; break; case 54: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 131, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "ECHOE"); if (u) tio.c_lflag |= 0000020 ; else tio.c_lflag &= ~ 0000020 ; break; case 55: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 132, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "ECHOK"); if (u) tio.c_lflag |= 0000040 ; else tio.c_lflag &= ~ 0000040 ; break; case 56: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 133, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "ECHONL"); if (u) tio.c_lflag |= 0000100 ; else tio.c_lflag &= ~ 0000100 ; break; case 57: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 134, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "NOFLSH"); if (u) tio.c_lflag |= 0000200 ; else tio.c_lflag &= ~ 0000200 ; break; case 58: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 135, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "TOSTOP"); if (u) tio.c_lflag |= 0000400 ; else tio.c_lflag &= ~ 0000400 ; break; case 59: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 137, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "IEXTEN"); if (u) tio.c_lflag |= 0100000 ; else tio.c_lflag &= ~ 0100000 ; break; case 60: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 140, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "ECHOCTL"); if (u) tio.c_lflag |= 0001000 ; else tio.c_lflag &= ~ 0001000 ; break; case 61: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 143, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "ECHOKE"); if (u) tio.c_lflag |= 0004000 ; else tio.c_lflag &= ~ 0004000 ; break; case 62: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 146, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "PENDIN"); if (u) tio.c_lflag |= 0040000 ; else tio.c_lflag &= ~ 0040000 ; break; case 70: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 149, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "OPOST"); if (u) tio.c_oflag |= 0000001 ; else tio.c_oflag &= ~ 0000001 ; break; case 71: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 151, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "OLCUC"); if (u) tio.c_oflag |= 0000002 ; else tio.c_oflag &= ~ 0000002 ; break; case 72: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 154, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "ONLCR"); if (u) tio.c_oflag |= 0000004 ; else tio.c_oflag &= ~ 0000004 ; break; case 73: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 157, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "OCRNL"); if (u) tio.c_oflag |= 0000010 ; else tio.c_oflag &= ~ 0000010 ; break; case 74: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 160, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "ONOCR"); if (u) tio.c_oflag |= 0000020 ; else tio.c_oflag &= ~ 0000020 ; break; case 75: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 163, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "ONLRET"); if (u) tio.c_oflag |= 0000040 ; else tio.c_oflag &= ~ 0000040 ; break; case 90: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 166, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "CS7"); if (u) tio.c_cflag |= 0000040 ; else tio.c_cflag &= ~ 0000040 ; break; case 91: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 167, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "CS8"); if (u) tio.c_cflag |= 0000060 ; else tio.c_cflag &= ~ 0000060 ; break; case 92: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 168, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "PARENB"); if (u) tio.c_cflag |= 0000400 ; else tio.c_cflag &= ~ 0000400 ; break; case 93: if ((r = sshbuf_get_u32(buf, &u)) != 0) sshfatal("ttymodes.h", __func__, 169, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse %s", "PARODD"); if (u) tio.c_cflag |= 0001000 ; else tio.c_cflag &= ~ 0001000 ; break; default: sshlog("ttymodes.c", __func__, 417, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Ignoring unsupported tty mode opcode %d (0x%x)", opcode, opcode) ; if (opcode > 0 && opcode < 160) { if ((r = sshbuf_get_u32(buf, ((void *)0) )) != 0) sshfatal("ttymodes.c", __func__, 428, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse arg"); break; } else { sshlog("ttymodes.c", __func__, 431, 1, SYSLOG_LEVEL_INFO, ((void *)0) , "unknown opcode %d", opcode); goto set; } } } set: len = sshbuf_len(buf); sshbuf_free(buf); if (len > 0) { sshlog("ttymodes.c", __func__, 441, 1, SYSLOG_LEVEL_INFO, ((void *)0) , "%zu bytes left", len); return; } if (failure == -1) return; if (tcsetattr(fd, 0 , &tio) == -1) sshlog("ttymodes.c", __func__, 449, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Setting tty modes failed: %.100s", strerror( (*__errno_location ()) )); }
void ssh_tty_parse_modes(undefined8 param_1,int param_2) { int iVar1; speed_t sVar2; undefined8 uVar3; int *piVar4; char *pcVar5; long lVar6; undefined *puVar7; char **ppcVar8; long in_FS_OFFSET; char *pcStack168; undefined8 uStack160; undefined auStack152 [4]; int local_94; undefined8 local_90; byte local_81; uint local_80; int local_7c; int local_78; int local_74; undefined8 local_70; long local_68; long local_60; termios local_58; long local_10; ppcVar8 = (char **)auStack152; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_78 = 0; uStack160 = 0x10213d; local_94 = param_2; local_90 = param_1; local_74 = sshpkt_get_string_direct(param_1,&local_70,&local_68); if (local_74 != 0) { uStack160 = 0x102150; uVar3 = ssh_err(local_74); ppcVar8 = &pcStack168; pcStack168 = "parse"; sshfatal("ttymodes.c","ssh_tty_parse_modes",0x162,1,1,uVar3); } if (local_68 == 0) goto LAB_00103f58; *(undefined8 *)((long)ppcVar8 + -8) = 0x1021a7; local_60 = sshbuf_from(local_70,local_68); iVar1 = local_94; if (local_60 == 0) { *(char **)((long)ppcVar8 + -0x10) = "sshbuf_from failed"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x1021ec; sshlog("ttymodes.c","ssh_tty_parse_modes",0x166,1,2,0); goto LAB_00103f58; } *(undefined8 *)((long)ppcVar8 + -8) = 0x102209; iVar1 = tcgetattr(iVar1,&local_58); if (iVar1 == -1) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102217; piVar4 = __errno_location(); iVar1 = *piVar4; *(undefined8 *)((long)ppcVar8 + -8) = 0x102220; pcVar5 = strerror(iVar1); *(char **)((long)ppcVar8 + -8) = pcVar5; *(char **)((long)ppcVar8 + -0x10) = "tcgetattr: %.100s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102257; sshlog("ttymodes.c","ssh_tty_parse_modes",0x170,0,3,0); local_78 = -1; } while( true ) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103e76; lVar6 = sshbuf_len(local_60); if (lVar6 == 0) break; *(undefined8 *)((long)ppcVar8 + -8) = 0x10227a; local_74 = sshbuf_get_u8(local_60,&local_81); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x10228d; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -0x10) = "parse opcode"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x1022c4; sshfatal("ttymodes.c","ssh_tty_parse_modes",0x176,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } switch(local_81) { case 0: goto LAB_00103e82; case 1: *(undefined8 *)((long)ppcVar8 + -8) = 0x1024a6; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1024b9; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "VINTR"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x1024f4; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x3d,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } *(undefined8 *)((long)ppcVar8 + -8) = 0x1024fe; local_58.c_cc[0] = special_char_decode(local_7c); break; case 2: *(undefined8 *)((long)ppcVar8 + -8) = 0x102519; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x10252c; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "VQUIT"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102567; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x3e,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } *(undefined8 *)((long)ppcVar8 + -8) = 0x102571; local_58.c_cc[1] = special_char_decode(local_7c); break; case 3: *(undefined8 *)((long)ppcVar8 + -8) = 0x10258c; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x10259f; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "VERASE"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x1025da; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x3f,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } *(undefined8 *)((long)ppcVar8 + -8) = 0x1025e4; local_58.c_cc[2] = special_char_decode(local_7c); break; case 4: *(undefined8 *)((long)ppcVar8 + -8) = 0x1025ff; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102612; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "VKILL"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x10264d; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x41,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } *(undefined8 *)((long)ppcVar8 + -8) = 0x102657; local_58.c_cc[3] = special_char_decode(local_7c); break; case 5: *(undefined8 *)((long)ppcVar8 + -8) = 0x102672; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102685; uVar3 = ssh_err(local_74); *(undefined **)((long)ppcVar8 + -8) = &DAT_00104023; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x1026c0; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x43,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } *(undefined8 *)((long)ppcVar8 + -8) = 0x1026ca; local_58.c_cc[4] = special_char_decode(local_7c); break; case 6: *(undefined8 *)((long)ppcVar8 + -8) = 0x1026e5; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1026f8; uVar3 = ssh_err(local_74); *(undefined **)((long)ppcVar8 + -8) = &DAT_00104028; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102733; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x45,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } *(undefined8 *)((long)ppcVar8 + -8) = 0x10273d; local_58.c_cc[11] = special_char_decode(local_7c); break; case 7: *(undefined8 *)((long)ppcVar8 + -8) = 0x102758; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x10276b; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "VEOL2"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x1027a6; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x48,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } *(undefined8 *)((long)ppcVar8 + -8) = 0x1027b0; local_58.c_cc[16] = special_char_decode(local_7c); break; case 8: *(undefined8 *)((long)ppcVar8 + -8) = 0x1027cb; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1027de; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "VSTART"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102819; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x4a,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } *(undefined8 *)((long)ppcVar8 + -8) = 0x102823; local_58.c_cc[8] = special_char_decode(local_7c); break; case 9: *(undefined8 *)((long)ppcVar8 + -8) = 0x10283e; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102851; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "VSTOP"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x10288c; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x4b,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } *(undefined8 *)((long)ppcVar8 + -8) = 0x102896; local_58.c_cc[9] = special_char_decode(local_7c); break; case 10: *(undefined8 *)((long)ppcVar8 + -8) = 0x1028b1; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1028c4; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "VSUSP"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x1028ff; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x4d,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } *(undefined8 *)((long)ppcVar8 + -8) = 0x102909; local_58.c_cc[10] = special_char_decode(local_7c); break; default: *(ulong *)((long)ppcVar8 + -0x10) = (ulong)local_81; *(ulong *)((long)ppcVar8 + -0x18) = (ulong)local_81; *(char **)((long)ppcVar8 + -0x20) = "Ignoring unsupported tty mode opcode %d (0x%x)"; *(undefined8 *)((long)ppcVar8 + -0x28) = 0x103db3; sshlog("ttymodes.c","ssh_tty_parse_modes",0x1a1,0,5,0); puVar7 = (undefined *)ppcVar8; if ((local_81 == 0) || (0x9f < local_81)) goto LAB_00103e26; *(undefined8 *)((long)ppcVar8 + -8) = 0x103dd8; local_74 = sshbuf_get_u32(local_60,0); if (local_74 != 0) goto code_r0x00103de5; break; case 0xc: *(undefined8 *)((long)ppcVar8 + -8) = 0x102924; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102937; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "VREPRINT"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102972; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x53,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } *(undefined8 *)((long)ppcVar8 + -8) = 0x10297c; local_58.c_cc[12] = special_char_decode(local_7c); break; case 0xd: *(undefined8 *)((long)ppcVar8 + -8) = 0x102997; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1029aa; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "VWERASE"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x1029e5; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x56,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } *(undefined8 *)((long)ppcVar8 + -8) = 0x1029ef; local_58.c_cc[14] = special_char_decode(local_7c); break; case 0xe: *(undefined8 *)((long)ppcVar8 + -8) = 0x102a0a; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102a1d; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "VLNEXT"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102a58; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x59,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } *(undefined8 *)((long)ppcVar8 + -8) = 0x102a62; local_58.c_cc[15] = special_char_decode(local_7c); break; case 0x12: *(undefined8 *)((long)ppcVar8 + -8) = 0x102a7d; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102a90; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "VDISCARD"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102acb; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x65,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } *(undefined8 *)((long)ppcVar8 + -8) = 0x102ad5; local_58.c_cc[13] = special_char_decode(local_7c); break; case 0x1e: *(undefined8 *)((long)ppcVar8 + -8) = 0x102af0; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102b03; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "IGNPAR"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102b3e; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x69,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_iflag = local_58.c_iflag & 0xfffffffb; } else { local_58.c_iflag = local_58.c_iflag | 4; } break; case 0x1f: *(undefined8 *)((long)ppcVar8 + -8) = 0x102b74; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102b87; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "PARMRK"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102bc2; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x6a,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_iflag = local_58.c_iflag & 0xfffffff7; } else { local_58.c_iflag = local_58.c_iflag | 8; } break; case 0x20: *(undefined8 *)((long)ppcVar8 + -8) = 0x102bf8; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102c0b; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "INPCK"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102c46; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x6b,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_iflag = local_58.c_iflag & 0xffffffef; } else { local_58.c_iflag = local_58.c_iflag | 0x10; } break; case 0x21: *(undefined8 *)((long)ppcVar8 + -8) = 0x102c7c; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102c8f; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "ISTRIP"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102cca; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x6c,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_iflag = local_58.c_iflag & 0xffffffdf; } else { local_58.c_iflag = local_58.c_iflag | 0x20; } break; case 0x22: *(undefined8 *)((long)ppcVar8 + -8) = 0x102d00; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102d13; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "INLCR"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102d4e; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x6d,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_iflag = local_58.c_iflag & 0xffffffbf; } else { local_58.c_iflag = local_58.c_iflag | 0x40; } break; case 0x23: *(undefined8 *)((long)ppcVar8 + -8) = 0x102d84; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102d97; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "IGNCR"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102dd2; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x6e,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_iflag = local_58.c_iflag & 0xffffff7f; } else { local_58.c_iflag = local_58.c_iflag | 0x80; } break; case 0x24: *(undefined8 *)((long)ppcVar8 + -8) = 0x102e06; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102e19; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "ICRNL"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102e54; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x6f,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_iflag = local_58.c_iflag & 0xfffffeff; } else { local_58.c_iflag = local_58.c_iflag | 0x100; } break; case 0x25: *(undefined8 *)((long)ppcVar8 + -8) = 0x102e8a; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102e9d; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "IUCLC"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102ed8; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x71,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_iflag = local_58.c_iflag & 0xfffffdff; } else { local_58.c_iflag = local_58.c_iflag | 0x200; } break; case 0x26: *(undefined8 *)((long)ppcVar8 + -8) = 0x102f0e; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102f21; uVar3 = ssh_err(local_74); *(undefined **)((long)ppcVar8 + -8) = &DAT_0010409a; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102f5c; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x73,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_iflag = local_58.c_iflag & 0xfffffbff; } else { local_58.c_iflag = local_58.c_iflag | 0x400; } break; case 0x27: *(undefined8 *)((long)ppcVar8 + -8) = 0x102f92; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102fa5; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "IXANY"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102fe0; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x74,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_iflag = local_58.c_iflag & 0xfffff7ff; } else { local_58.c_iflag = local_58.c_iflag | 0x800; } break; case 0x28: *(undefined8 *)((long)ppcVar8 + -8) = 0x103016; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103029; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "IXOFF"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103064; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x75,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_iflag = local_58.c_iflag & 0xffffefff; } else { local_58.c_iflag = local_58.c_iflag | 0x1000; } break; case 0x29: *(undefined8 *)((long)ppcVar8 + -8) = 0x10309a; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1030ad; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "IMAXBEL"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x1030e8; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x77,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_iflag = local_58.c_iflag & 0xffffdfff; } else { local_58.c_iflag = local_58.c_iflag | 0x2000; } break; case 0x2a: *(undefined8 *)((long)ppcVar8 + -8) = 0x10311e; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103131; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "IUTF8"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x10316c; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x7a,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_iflag = local_58.c_iflag & 0xffffbfff; } else { local_58.c_iflag = local_58.c_iflag | 0x4000; } break; case 0x32: *(undefined8 *)((long)ppcVar8 + -8) = 0x1031a2; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1031b5; uVar3 = ssh_err(local_74); *(undefined **)((long)ppcVar8 + -8) = &DAT_001040cd; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x1031f0; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x7d,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_lflag = local_58.c_lflag & 0xfffffffe; } else { local_58.c_lflag = local_58.c_lflag | 1; } break; case 0x33: *(undefined8 *)((long)ppcVar8 + -8) = 0x103226; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103239; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "ICANON"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103274; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x7e,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_lflag = local_58.c_lflag & 0xfffffffd; } else { local_58.c_lflag = local_58.c_lflag | 2; } break; case 0x34: *(undefined8 *)((long)ppcVar8 + -8) = 0x1032aa; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1032bd; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "XCASE"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x1032f8; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x80,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_lflag = local_58.c_lflag & 0xfffffffb; } else { local_58.c_lflag = local_58.c_lflag | 4; } break; case 0x35: *(undefined8 *)((long)ppcVar8 + -8) = 0x10332e; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103341; uVar3 = ssh_err(local_74); *(undefined **)((long)ppcVar8 + -8) = &DAT_001040df; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x10337c; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x82,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_lflag = local_58.c_lflag & 0xfffffff7; } else { local_58.c_lflag = local_58.c_lflag | 8; } break; case 0x36: *(undefined8 *)((long)ppcVar8 + -8) = 0x1033b2; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1033c5; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "ECHOE"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103400; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x83,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_lflag = local_58.c_lflag & 0xffffffef; } else { local_58.c_lflag = local_58.c_lflag | 0x10; } break; case 0x37: *(undefined8 *)((long)ppcVar8 + -8) = 0x103436; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103449; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "ECHOK"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103484; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x84,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_lflag = local_58.c_lflag & 0xffffffdf; } else { local_58.c_lflag = local_58.c_lflag | 0x20; } break; case 0x38: *(undefined8 *)((long)ppcVar8 + -8) = 0x1034ba; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1034cd; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "ECHONL"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103508; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x85,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_lflag = local_58.c_lflag & 0xffffffbf; } else { local_58.c_lflag = local_58.c_lflag | 0x40; } break; case 0x39: *(undefined8 *)((long)ppcVar8 + -8) = 0x10353e; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103551; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "NOFLSH"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x10358c; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x86,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_lflag = local_58.c_lflag & 0xffffff7f; } else { local_58.c_lflag = local_58.c_lflag | 0x80; } break; case 0x3a: *(undefined8 *)((long)ppcVar8 + -8) = 0x1035c0; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1035d3; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "TOSTOP"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x10360e; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x87,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_lflag = local_58.c_lflag & 0xfffffeff; } else { local_58.c_lflag = local_58.c_lflag | 0x100; } break; case 0x3b: *(undefined8 *)((long)ppcVar8 + -8) = 0x103644; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103657; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "IEXTEN"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103692; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x89,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_lflag = local_58.c_lflag & 0xffff7fff; } else { local_58.c_lflag = local_58.c_lflag | 0x8000; } break; case 0x3c: *(undefined8 *)((long)ppcVar8 + -8) = 0x1036c8; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1036db; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "ECHOCTL"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103716; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x8c,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_lflag = local_58.c_lflag & 0xfffffdff; } else { local_58.c_lflag = local_58.c_lflag | 0x200; } break; case 0x3d: *(undefined8 *)((long)ppcVar8 + -8) = 0x10374c; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x10375f; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "ECHOKE"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x10379a; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x8f,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_lflag = local_58.c_lflag & 0xfffff7ff; } else { local_58.c_lflag = local_58.c_lflag | 0x800; } break; case 0x3e: *(undefined8 *)((long)ppcVar8 + -8) = 0x1037d0; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1037e3; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "PENDIN"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x10381e; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x92,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_lflag = local_58.c_lflag & 0xffffbfff; } else { local_58.c_lflag = local_58.c_lflag | 0x4000; } break; case 0x46: *(undefined8 *)((long)ppcVar8 + -8) = 0x103854; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103867; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "OPOST"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x1038a2; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x95,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_oflag = local_58.c_oflag & 0xfffffffe; } else { local_58.c_oflag = local_58.c_oflag | 1; } break; case 0x47: *(undefined8 *)((long)ppcVar8 + -8) = 0x1038d8; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1038eb; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "OLCUC"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103926; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x97,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_oflag = local_58.c_oflag & 0xfffffffd; } else { local_58.c_oflag = local_58.c_oflag | 2; } break; case 0x48: *(undefined8 *)((long)ppcVar8 + -8) = 0x10395c; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x10396f; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "ONLCR"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x1039aa; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x9a,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_oflag = local_58.c_oflag & 0xfffffffb; } else { local_58.c_oflag = local_58.c_oflag | 4; } break; case 0x49: *(undefined8 *)((long)ppcVar8 + -8) = 0x1039e0; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1039f3; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "OCRNL"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103a2e; sshfatal("ttymodes.h","ssh_tty_parse_modes",0x9d,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_oflag = local_58.c_oflag & 0xfffffff7; } else { local_58.c_oflag = local_58.c_oflag | 8; } break; case 0x4a: *(undefined8 *)((long)ppcVar8 + -8) = 0x103a64; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103a77; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "ONOCR"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103ab2; sshfatal("ttymodes.h","ssh_tty_parse_modes",0xa0,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_oflag = local_58.c_oflag & 0xffffffef; } else { local_58.c_oflag = local_58.c_oflag | 0x10; } break; case 0x4b: *(undefined8 *)((long)ppcVar8 + -8) = 0x103ae8; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103afb; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "ONLRET"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103b36; sshfatal("ttymodes.h","ssh_tty_parse_modes",0xa3,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_oflag = local_58.c_oflag & 0xffffffdf; } else { local_58.c_oflag = local_58.c_oflag | 0x20; } break; case 0x5a: *(undefined8 *)((long)ppcVar8 + -8) = 0x103b6c; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103b7f; uVar3 = ssh_err(local_74); *(undefined **)((long)ppcVar8 + -8) = &DAT_00104147; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103bba; sshfatal("ttymodes.h","ssh_tty_parse_modes",0xa6,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_cflag = local_58.c_cflag & 0xffffffdf; } else { local_58.c_cflag = local_58.c_cflag | 0x20; } break; case 0x5b: *(undefined8 *)((long)ppcVar8 + -8) = 0x103bf0; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103c03; uVar3 = ssh_err(local_74); *(undefined **)((long)ppcVar8 + -8) = &DAT_0010414b; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103c3e; sshfatal("ttymodes.h","ssh_tty_parse_modes",0xa7,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_cflag = local_58.c_cflag & 0xffffffcf; } else { local_58.c_cflag = local_58.c_cflag | 0x30; } break; case 0x5c: *(undefined8 *)((long)ppcVar8 + -8) = 0x103c74; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103c87; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "PARENB"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103cc2; sshfatal("ttymodes.h","ssh_tty_parse_modes",0xa8,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_cflag = local_58.c_cflag & 0xfffffeff; } else { local_58.c_cflag = local_58.c_cflag | 0x100; } break; case 0x5d: *(undefined8 *)((long)ppcVar8 + -8) = 0x103cf8; local_74 = sshbuf_get_u32(local_60,&local_7c); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103d0b; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -8) = "PARODD"; *(char **)((long)ppcVar8 + -0x10) = "parse %s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103d46; sshfatal("ttymodes.h","ssh_tty_parse_modes",0xa9,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_7c == 0) { local_58.c_cflag = local_58.c_cflag & 0xfffffdff; } else { local_58.c_cflag = local_58.c_cflag | 0x200; } break; case 0x80: *(undefined8 *)((long)ppcVar8 + -8) = 0x10230c; local_74 = sshbuf_get_u32(local_60); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x10231f; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -0x10) = "parse ispeed"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102356; sshfatal("ttymodes.c","ssh_tty_parse_modes",0x17d,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_78 != -1) { *(undefined8 *)((long)ppcVar8 + -8) = 0x10236a; sVar2 = baud_to_speed(local_80); *(undefined8 *)((long)ppcVar8 + -8) = 0x10237a; iVar1 = cfsetispeed(&local_58,sVar2); if (iVar1 == -1) { *(ulong *)((long)ppcVar8 + -8) = (ulong)local_80; *(char **)((long)ppcVar8 + -0x10) = "cfsetispeed failed for %d"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x1023bd; sshlog("ttymodes.c","ssh_tty_parse_modes",0x180,0,2,0); } } break; case 0x81: *(undefined8 *)((long)ppcVar8 + -8) = 0x1023d9; local_74 = sshbuf_get_u32(local_60); if (local_74 != 0) { *(undefined8 *)((long)ppcVar8 + -8) = 0x1023ec; uVar3 = ssh_err(local_74); *(char **)((long)ppcVar8 + -0x10) = "parse ospeed"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x102423; sshfatal("ttymodes.c","ssh_tty_parse_modes",0x185,1,1,uVar3); ppcVar8 = (char **)((long)ppcVar8 + -0x10); } if (local_78 != -1) { *(undefined8 *)((long)ppcVar8 + -8) = 0x102437; sVar2 = baud_to_speed(local_80); *(undefined8 *)((long)ppcVar8 + -8) = 0x102447; iVar1 = cfsetospeed(&local_58,sVar2); if (iVar1 == -1) { *(ulong *)((long)ppcVar8 + -8) = (ulong)local_80; *(char **)((long)ppcVar8 + -0x10) = "cfsetospeed failed for %d"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x10248a; sshlog("ttymodes.c","ssh_tty_parse_modes",0x188,0,2,0); } } } } goto LAB_00103e82; code_r0x00103de5: *(undefined8 *)((long)ppcVar8 + -8) = 0x103def; uVar3 = ssh_err(local_74); puVar7 = (undefined *)((long)ppcVar8 + -0x10); *(char **)((long)ppcVar8 + -0x10) = "parse arg"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103e26; sshfatal("ttymodes.c","ssh_tty_parse_modes",0x1ac,1,1,uVar3); LAB_00103e26: *(ulong *)(puVar7 + -8) = (ulong)local_81; *(char **)(puVar7 + -0x10) = "unknown opcode %d"; *(undefined8 *)(puVar7 + -0x18) = 0x103e64; sshlog("ttymodes.c","ssh_tty_parse_modes",0x1af,1,3,0); ppcVar8 = (char **)puVar7; LAB_00103e82: lVar6 = local_60; *(undefined8 *)((long)ppcVar8 + -8) = 0x103e8e; local_68 = sshbuf_len(lVar6); *(undefined8 *)((long)ppcVar8 + -8) = 0x103e9e; sshbuf_free(); iVar1 = local_94; if (local_68 == 0) { if (local_78 != -1) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103f04; iVar1 = tcsetattr(iVar1,0,&local_58); if (iVar1 == -1) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103f0e; piVar4 = __errno_location(); iVar1 = *piVar4; *(undefined8 *)((long)ppcVar8 + -8) = 0x103f17; pcVar5 = strerror(iVar1); *(char **)((long)ppcVar8 + -8) = pcVar5; *(char **)((long)ppcVar8 + -0x10) = "Setting tty modes failed: %.100s"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103f4e; sshlog("ttymodes.c","ssh_tty_parse_modes",0x1c1,0,3,0); } } } else { *(long *)((long)ppcVar8 + -8) = local_68; *(char **)((long)ppcVar8 + -0x10) = "%zu bytes left"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x103ee2; sshlog("ttymodes.c","ssh_tty_parse_modes",0x1b9,1,3,0); } LAB_00103f58: if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { *(undefined8 *)((long)ppcVar8 + -8) = 0x103f6c; __stack_chk_fail(); } return; }
static struct hash_entry * allocate_entry (Hash_table *table) { struct hash_entry *new; if (table->free_entry_list) { new = table->free_entry_list; table->free_entry_list = new->next; } else { new = malloc (sizeof *new); } return new; }
int allocate_entry(struct_0 *a0) { struct_1 *v0; if (a0->field_48) { v0 = a0->field_48; a0->field_48 = v0->field_8; } else { v0 = malloc(0x10); } return v0; }
test_code_t test_vko_gost_12(gnutls_session_t session) { int ret; if (tls_ext_ok == 0) return TEST_IGNORE; sprintf(prio_str, "NONE:" "+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL" ":%s:" "+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":+VKO-GOST-12:%s", protocol_all_str, rest); { int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 290)) != TEST_SUCCEED) { return _ret; } }; gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred); ret = test_do_handshake(session); if (ret < 0) return TEST_FAILED; return ret; }
long long test_vko_gost_12(unsigned long long a0) { unsigned int v0; unsigned int v1; unsigned long long v3; if (!tls_ext_ok) { v3 = 3; } else { sprintf(&prio_str, "NONE:+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC:+GOST28147-TC26Z-CNT:+COMP-NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT:+VKO-GOST-12:%s", &protocol_all_str, &rest); v0 = __gnutls_priority_set_direct(a0, &prio_str, 0x122); if (v0) { v3 = v0; } else { gnutls_credentials_set(a0, 0x1, xcred); v1 = test_do_handshake(a0); if (v1 < 0) v3 = 1; else v3 = v1; } } return v3; }
static VALUE * eval3 ( _Bool evaluate) { VALUE *l; VALUE *r; enum { plus, minus } fxn; l = eval4 (evaluate); while ( 1 ) { if (nextarg ("+")) fxn = plus; else if (nextarg ("-")) fxn = minus; else return l; r = eval4 (evaluate); if (evaluate) { if (!toarith (l) || !toarith (r)) ((!!sizeof (struct { _Static_assert (EXPR_INVALID, "verify_expr (" "EXPR_INVALID" ", " "(error (EXPR_INVALID, 0, gettext (\"non-integer argument\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXPR_INVALID, 0, gettext ("non-integer argument")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXPR_INVALID, 0, gettext ("non-integer argument")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); (fxn == plus ? __gmpz_add : __gmpz_sub ) (l->u.i, l->u.i, r->u.i); } freev (r); } }
int eval3(unsigned long a0) { unsigned int v0; void* v1; void* v2; unsigned long long v6; unsigned long long v7; v1 = eval4(a0); while (true) { if (nextarg("+")) { v0 = 0; } else if (nextarg("-")) { v0 = 1; } else { return v1; } v2 = eval4(a0); if (a0) { if ((toarith(v1) ^ 1)) break; if ((toarith(v2) ^ 1)) break; if (!v0) v6 = got.__gmpz_add; else v7 = got.__gmpz_sub; reg_80(v1 + 8, v1 + 8, v2 + 8, v1 + 8); } freev(v2); } error(0x2, 0x0, gettext("non-integer argument")); }
_Bool pred_true (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr) { (void) pathname; (void) stat_buf; (void) pred_ptr; return 1 ; }
long pred_true() { return 1LL; }
void hash_free (Hash_table *table) { struct hash_entry *bucket; struct hash_entry *cursor; struct hash_entry *next; if (table->data_freer && table->n_entries) { for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) { if (bucket->data) { for (cursor = bucket; cursor; cursor = cursor->next) table->data_freer (cursor->data); } } } for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) { for (cursor = bucket->next; cursor; cursor = next) { next = cursor->next; free (cursor); } } for (cursor = table->free_entry_list; cursor; cursor = next) { next = cursor->next; free (cursor); } free (table->bucket); free (table); }
long long hash_free(unsigned long long a0[10]) { struct_0 *v0; struct_0 *v1; void* v2; if (a0[8] && a0[4]) { for (v0[0] = a0[0]; v0 < a0[1]; v0[0] = &v0[0] + 1) { if (v0[0]) { for (v1[0] = v0; v1; v1[0] = v1[1]) { a0[8](v1[0]); } } } } for (v0 = a0[0]; v0 < a0[1]; v0[0] = &v0[0] + 1) { for (v1 = v0->field_8; v1; v1 = v2) { v2 = v1->field_8; free(v1); } } for (v1 = a0[9]; v1; v1 = v2) { v2 = v1->field_8; free(v1); } free(a0[0]); return free(a0); }
double compute_duration (void) { struct timespec now; gettime (&now); duration += ((now.tv_sec - last_stat_time.tv_sec) + (now.tv_nsec - last_stat_time.tv_nsec) / 1e9); gettime (&last_stat_time); return duration; }
void compute_duration() { char v0; char v1; char v2; unsigned long long v4; unsigned long long v5; unsigned long long *v9; unsigned long long v10; gettime(&v0); v4 = *(&v0) - last_stat_time; v5 = *(&v1) - __stack_chk_fail; duration =L Conv(128->64, (Conv(64->128, Load(addr=0x404d18<64>, size=8, endness=Iend_LE)) + (xmm1<16> + (xmm0<16> / 0x41cdcd6500000000<128>))))<8> gettime(0x500040); v10 = *(&v2) ^ v9[5]; return; }
ssh_digest_final(ctx->digest, d, dlen) < 0) return -1; return 0; } void ssh_hmac_free(struct ssh_hmac_ctx *ctx) { if (ctx != ((void *)0) ) { ssh_digest_free(ctx->ictx); ssh_digest_free(ctx->octx); ssh_digest_free(ctx->digest); if (ctx->buf) { explicit_bzero(ctx->buf, ctx->buf_len); free(ctx->buf); } freezero(ctx, sizeof(*ctx)); } }
(iVar1 = ssh_digest_final(*(undefined8 *)(param_1 + 6),*(undefined8 *)(param_1 + 8),uVar2), iVar1 != 0)) { return 0xffffffff; }
static void synerror(const char *msg) { errlinno = (parsefile->linno); sh_error("Syntax error: %s", msg); }
void synerror(unsigned long long a0) { errlinno = *((parsefile + 8)); sh_error("Syntax error: %s", a0); }
static void usage(FILE *f) { fprintf(f, "Usage: ... macsec [ [ address <lladdr> ] port { 1..2^16-1 } | sci <u64> ]\n" " [ cipher { default | gcm-aes-128 | gcm-aes-256 } ]\n" " [ icvlen { 8..16 } ]\n" " [ encrypt { on | off } ]\n" " [ send_sci { on | off } ]\n" " [ end_station { on | off } ]\n" " [ scb { on | off } ]\n" " [ protect { on | off } ]\n" " [ replay { on | off} window { 0..2^32-1 } ]\n" " [ validate { strict | check | disabled } ]\n" " [ encodingsa { 0..3 } ]\n" " [ offload { mac | phy | off } ]\n" ); }
void usage(void* a0) { unsigned long long v1; v1 = fprintf(a0, "Usage: ... macsec [ [ address <lladdr> ] port { 1..2^16-1 } | sci <u64> ]\n [ cipher { default | gcm-aes-128 | gcm-aes-256 } ]\n [ icvlen { 8..16 } ]\n [ encrypt { on | off } ]\n [ send_sci { on | off } ]\n [ end_station { on | off } ]\n [ scb { on | off } ]\n [ protect { on | off } ]\n [ replay { on | off} window { 0..2^32-1 } ]\n [ validate { strict | check | disabled } ]\n [ encodingsa { 0..3 } ]\n [ offload { mac | phy | off } ]\n"); return; }
static void bond_print_help(struct link_util *lu, int argc, char **argv, FILE *f) { print_explain(f); }
int bond_print_help(long a1, long a2, long a3, FILE *a4) { return print_explain(a4); }
const char *const * findstring(const char *s, const char *const *array, size_t nmemb) { return bsearch(&s, array, nmemb, sizeof(const char *), pstrcmp); }
void findstring(undefined8 param_1,void *param_2,size_t param_3) { undefined8 local_10; local_10 = param_1; bsearch(&local_10,param_2,param_3,8,pstrcmp); return; }
static int _get_tty_settings (int tty, struct termios *tiop) { int ioctl_ret; while (1) { ioctl_ret = (tcgetattr (tty, tiop)); if (ioctl_ret < 0) { if ( (*__errno_location ()) != 4 ) return -1; else continue; } if ((tiop->c_lflag & 0010000 )) { _rl_errmsg ("warning: turning off output flushing"); tiop->c_lflag &= ~ 0010000 ; break; } break; } return 0; }
undefined8 _get_tty_settings(int param_1,termios *param_2) { int iVar1; int *piVar2; do { iVar1 = tcgetattr(param_1,param_2); if (-1 < iVar1) { if ((param_2->c_lflag & 0x1000) != 0) { _rl_errmsg("warning: turning off output flushing"); param_2->c_lflag = param_2->c_lflag & 0xffffefff; } return 0; } piVar2 = __errno_location(); } while (*piVar2 == 4); return 0xffffffff; }
char * hpdelim(char **cp) { char *r, delim = '\0'; r = hpdelim2(cp, &delim); if (delim == '/') return ((void *)0) ; return r; }
undefined8 hpdelim(undefined8 param_1) { undefined8 uVar1; long in_FS_OFFSET; char local_19; undefined8 local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_19 = '\0'; local_18 = hpdelim2(param_1,&local_19); uVar1 = local_18; if (local_19 == '/') { uVar1 = 0; } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return uVar1; } __stack_chk_fail(); }
int do_mptcp(int argc, char **argv) { if (argc == 0) usage(); if (matches(*argv, "help") == 0) usage(); if (genl_init_handle(&genl_rth, "mptcp_pm", &genl_family)) exit(1); if (matches(*argv, "endpoint") == 0) { do { argv++; argc--; } while(0); if (argc == 0) return mptcp_addr_show(0, ((void *)0) ); if (matches(*argv, "add") == 0) return mptcp_addr_modify(argc-1, argv+1, MPTCP_PM_CMD_ADD_ADDR); if (matches(*argv, "change") == 0) return mptcp_addr_modify(argc-1, argv+1, MPTCP_PM_CMD_SET_FLAGS); if (matches(*argv, "delete") == 0) return mptcp_addr_modify(argc-1, argv+1, MPTCP_PM_CMD_DEL_ADDR); if (matches(*argv, "show") == 0) return mptcp_addr_show(argc-1, argv+1); if (matches(*argv, "flush") == 0) return mptcp_addr_flush(argc-1, argv+1); goto unknown; } if (matches(*argv, "limits") == 0) { do { argv++; argc--; } while(0); if (argc == 0) return mptcp_limit_get_set(0, ((void *)0) , MPTCP_PM_CMD_GET_LIMITS); if (matches(*argv, "set") == 0) return mptcp_limit_get_set(argc-1, argv+1, MPTCP_PM_CMD_SET_LIMITS); if (matches(*argv, "show") == 0) return mptcp_limit_get_set(argc-1, argv+1, MPTCP_PM_CMD_GET_LIMITS); } if (matches(*argv, "monitor") == 0) { do { argv++; argc--; } while(0); if (argc == 0) return mptcp_monitor(); goto unknown; } unknown: fprintf( stderr , "Command \"%s\" is unknown, try \"ip mptcp help\".\n", *argv); exit(-1); }
long long do_mptcp(unsigned long a0, unsigned long a1, unsigned long a2, unsigned int a3, unsigned long long a4, unsigned long long a5) { unsigned long long *v0; unsigned int v1; unsigned long long v9; v1 = a0; v0 = a1; if (!v1) { usage(); } else if ((matches(*(v0), "help") ^ 1)) { usage(); } else if (genl_init_handle(&genl_rth, "mptcp_pm", &genl_family)) { exit(0x1); } else { if (!(matches(*(v0), "endpoint") ^ 1)) { if ((matches(*(v0), "limits") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (!v1) { v9 = mptcp_limit_get_set(0x0, 0x0, 0x6); return v9; } else if ((matches(*(v0), "set") ^ 1)) { v9 = mptcp_limit_get_set(v1 - 1, (v0 + 1), 0x5); return v9; } else if ((matches(*(v0), "show") ^ 1)) { v9 = mptcp_limit_get_set(v1 - 1, (v0 + 1), 0x6); return v9; } } if ((matches(*(v0), "monitor") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (!v1) { v9 = mptcp_monitor(); return v9; } } } else { v0 = v0 + 1; v1 -= 1; if (!v1) { v9 = mptcp_addr_show(0x0, 0x0, &genl_family, a3, a4, a5); return v9; } else if ((matches(*(v0), "add") ^ 1)) { v9 = mptcp_addr_modify(v1 - 1, (v0 + 1), 0x1); return v9; } else if ((matches(*(v0), "change") ^ 1)) { v9 = mptcp_addr_modify(v1 - 1, (v0 + 1), 0x7); return v9; } else if ((matches(*(v0), "delete") ^ 1)) { v9 = mptcp_addr_modify(v1 - 1, (v0 + 1), 0x2); return v9; } else if ((matches(*(v0), "show") ^ 1)) { v9 = mptcp_addr_show(v1 - 1, v0 + 1, v0 + 1, a3, a4, a5); return v9; } else if ((matches(*(v0), "flush") ^ 1)) { v9 = mptcp_addr_flush(v1 - 1, v0 + 1); return v9; } } fprintf(stderr, "Command \"%s\" is unknown, try \"ip mptcp help\".\n", *(v0)); exit(0xffffffff); } }
static void init_store_cols (void) { int total_lines, total_lines_1, chars_per_column_1, chars_if_truncate; if (__builtin_mul_overflow (lines_per_body, columns, &total_lines) || __builtin_add_overflow (total_lines, 1, &total_lines_1) || __builtin_add_overflow (chars_per_column, 1, &chars_per_column_1) || __builtin_mul_overflow (total_lines, chars_per_column_1, &chars_if_truncate) ) integer_overflow (); free (line_vector); line_vector = xnmalloc (total_lines_1, sizeof *line_vector); free (end_vector); end_vector = xnmalloc (total_lines, sizeof *end_vector); free (buff); buff = xnmalloc (chars_if_truncate, use_col_separator + 1); buff_allocated = chars_if_truncate; buff_allocated *= use_col_separator + 1; }
void init_store_cols() { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; char v4; unsigned long v6; unsigned long v7; unsigned long v8; unsigned long v9; unsigned long long *v10; unsigned long long v11; v6 = 0; if ([D] amd64g_calculate_condition(0x0<64>, 0x33<64>, Conv(32->64, Load(addr=stack_base-32, size=4, endness=Iend_LE)), Conv(32->64, Load(addr=stack_base-24, size=4, endness=Iend_LE)), cc_ndep<8>)) *(&v6) = 1; v0 = lines_per_body * columns; if (!(v6 & 1)) { v7 = 0; if ((!(v0 ^ 1) & (v0 ^ v0 + 1)) < 0) *(&v7) = 1; v1 = v0 + 1; if (!(v7 & 1)) { v8 = 0; if ((!(chars_per_column ^ 1) & (chars_per_column ^ chars_per_column + 1)) < 0) *(&v8) = 1; v2 = chars_per_column + 1; if (!(v8 & 1)) { v9 = 0; if ([D] amd64g_calculate_condition(0x0<64>, 0x33<64>, Conv(32->64, Load(addr=stack_base-32, size=4, endness=Iend_LE)), Conv(32->64, Load(addr=stack_base-24, size=4, endness=Iend_LE)), cc_ndep<8>)) *(&v9) = 1; v3 = v0 * v2; if (!(v9 & 1)) { free(line_vector); line_vector = xnmalloc(v1, 0x4); free(end_vector); end_vector = xnmalloc(v0, 0x4); free(buff); buff = xnmalloc(v3, use_col_separator + 1); buff_allocated = v3; buff_allocated = (use_col_separator + 1) * buff_allocated; v11 = *(&v4) ^ v10[5]; return; } } } } integer_overflow(); }
static void src_to_dest_free (void *x) { struct Src_to_dest *a = x; free (a->name); free (x); }
void src_to_dest_free(void *param_1) { free(*(void **)((long)param_1 + 0x10)); free(param_1); return; }
void stopit(int sig __attribute__((unused))) { unlink("/etc/nologin"); unlink("/fastboot"); unlink("/forcefsck"); unlink("/var/run/shutdown.pid"); printf("\r\nShutdown cancelled.\r\n"); exit(0); }
void stopit(unsigned long a0) { unsigned int v0; v0 = a0; unlink("/etc/nologin"); unlink("/fastboot"); unlink("/forcefsck"); unlink("/var/run/shutdown.pid"); printf("\r\nShutdown cancelled.\r\n"); exit(0x0); }
static int remove_method(char **methods, const char *method, const char *submethod) { char *omethods = *methods, *p; size_t l = strlen(method); int match; match = list_starts_with(omethods, method, submethod); if (match != 1 && match != 2) return 0; p = omethods + l; if (submethod && match == 2) p += 1 + strlen(submethod); if (*p == ',') p++; *methods = xstrdup(p); free(omethods); return 1; }
int remove_method(unsigned long long *a0, char *a1, char *a2) { unsigned int v0; char *v1; void* v2; unsigned long v3; unsigned int v5; v2 = *(a0); v3 = strlen(a1); v0 = list_starts_with(v2, a1, a2); if (v0 != 1 && v0 != 2) v5 = 0; if (v0 == 1 || v0 == 2) { v1 = v3 + v2; if (a2 && v0 == 2) { v5 = strlen(a2) + 1; v1 = &v1[v5]; } if (*(v1) == 44) v1 += 1; *(a0) = xstrdup(v1); free(v2); v5 = 1; } return v5; }
static _Bool expr (void) { if (pos >= argc) beyond (); return or (); }
long expr(long a1, const char *a2) { if ( pos >= argc ) beyond(); return or(a1, a2); }
int get_crq_extensions_status(void) { if (batch) { return cfg.honor_crq_extensions; } else { return read_yesno ("Do you want to honour all the extensions from the request? (y/N): ", 0); } }
long long get_crq_extensions_status() { unsigned long long v1; if (*(got.batch)) v1 = *((got.cfg + 636)); else v1 = read_yesno("Do you want to honour all the extensions from the request? (y/N): ", 0x0); return v1; }
static void process_add(void) { char *name, *pin; struct sshkey **keys = ((void *)0) ; int r, i, nkeys; u_char *blob; size_t blen; struct sshbuf *msg; char **labels = ((void *)0) ; if ((msg = sshbuf_new()) == ((void *)0) ) sshfatal("ssh-pkcs11-helper.c", __func__, 130, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); if ((r = sshbuf_get_cstring(iqueue, &name, ((void *)0) )) != 0 || (r = sshbuf_get_cstring(iqueue, &pin, ((void *)0) )) != 0) sshfatal("ssh-pkcs11-helper.c", __func__, 133, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); if ((nkeys = pkcs11_add_provider(name, pin, &keys, &labels)) > 0) { if ((r = sshbuf_put_u8(msg, 12)) != 0 || (r = sshbuf_put_u32(msg, nkeys)) != 0) sshfatal("ssh-pkcs11-helper.c", __func__, 138, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose"); for (i = 0; i < nkeys; i++) { if ((r = sshkey_to_blob(keys[i], &blob, &blen)) != 0) { sshlog("ssh-pkcs11-helper.c", __func__, 141, 1, SYSLOG_LEVEL_DEBUG1, ssh_err(r), "encode key"); continue; } if ((r = sshbuf_put_string(msg, blob, blen)) != 0 || (r = sshbuf_put_cstring(msg, labels[i])) != 0) sshfatal("ssh-pkcs11-helper.c", __func__, 146, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose key"); free(blob); add_key(keys[i], name, labels[i]); free(labels[i]); } } else if ((r = sshbuf_put_u8(msg, 5)) != 0 || (r = sshbuf_put_u32(msg, -nkeys)) != 0) sshfatal("ssh-pkcs11-helper.c", __func__, 153, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose"); free(labels); free(keys); free(pin); free(name); send_msg(msg); sshbuf_free(msg); }
void process_add(void) { undefined8 uVar1; void *pvVar2; long lVar3; int iVar4; undefined4 uVar5; undefined8 uVar6; char **ppcVar7; undefined *puVar8; undefined *puVar9; long in_FS_OFFSET; char *apcStack144 [7]; undefined auStack88 [4]; int local_54; int local_50; int local_4c; void *local_48; void *local_40; void *local_38; void *local_30; undefined8 local_28; void *local_20; long local_18; long local_10; ppcVar7 = (char **)auStack88; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_38 = (void *)0x0; local_20 = (void *)0x0; apcStack144[6] = (char *)0x1002e6; local_18 = sshbuf_new(); if (local_18 == 0) { ppcVar7 = apcStack144 + 5; apcStack144[5] = "sshbuf_new failed"; sshfatal("ssh-pkcs11-helper.c","process_add",0x82,1,1,0); } *(undefined8 *)((long)ppcVar7 + -8) = 0x100346; local_54 = sshbuf_get_cstring(iqueue,&local_48,0); if (local_54 == 0) { *(undefined8 *)((long)ppcVar7 + -8) = 0x10036a; local_54 = sshbuf_get_cstring(iqueue,&local_40,0); puVar8 = (undefined *)ppcVar7; if (local_54 != 0) goto LAB_00100373; } else { LAB_00100373: iVar4 = local_54; *(undefined8 *)((long)ppcVar7 + -8) = 0x10037d; uVar6 = ssh_err(iVar4); puVar8 = (undefined *)((long)ppcVar7 + -0x10); *(char **)((long)ppcVar7 + -0x10) = "parse"; *(undefined8 *)((long)ppcVar7 + -0x18) = 0x1003b4; sshfatal("ssh-pkcs11-helper.c","process_add",0x85,1,1,uVar6); } *(undefined8 *)(puVar8 + -8) = 0x1003cc; local_4c = pkcs11_add_provider(local_48,local_40,&local_38,&local_20); puVar9 = puVar8; if (local_4c < 1) { *(undefined8 *)(puVar8 + -8) = 0x1005ef; local_54 = sshbuf_put_u8(local_18,5); if (local_54 == 0) { *(undefined8 *)(puVar8 + -8) = 0x100600; uVar5 = __negvsi2(local_4c); *(undefined8 *)(puVar8 + -8) = 0x100610; local_54 = sshbuf_put_u32(local_18,uVar5); if (local_54 == 0) goto LAB_0010065a; } iVar4 = local_54; *(undefined8 *)(puVar8 + -8) = 0x100623; uVar6 = ssh_err(iVar4); puVar9 = puVar8 + -0x10; *(char **)(puVar8 + -0x10) = "compose"; *(undefined8 *)(puVar8 + -0x18) = 0x10065a; sshfatal("ssh-pkcs11-helper.c","process_add",0x99,1,1,uVar6); goto LAB_0010065a; } *(undefined8 *)(puVar8 + -8) = 0x1003ea; local_54 = sshbuf_put_u8(local_18,0xc); if (local_54 == 0) { *(undefined8 *)(puVar8 + -8) = 0x100404; local_54 = sshbuf_put_u32(local_18,local_4c); if (local_54 != 0) goto LAB_0010040d; } else { LAB_0010040d: iVar4 = local_54; *(undefined8 *)(puVar8 + -8) = 0x100417; uVar6 = ssh_err(iVar4); puVar9 = puVar8 + -0x10; *(char **)(puVar8 + -0x10) = "compose"; *(undefined8 *)(puVar8 + -0x18) = 0x10044e; sshfatal("ssh-pkcs11-helper.c","process_add",0x8a,1,1,uVar6); } for (local_50 = 0; local_50 < local_4c; local_50 = __addvsi3(local_50,1)) { uVar6 = *(undefined8 *)((long)local_38 + (long)local_50 * 8); *(undefined8 *)(puVar9 + -8) = 0x100481; iVar4 = sshkey_to_blob(uVar6,&local_30,&local_28); local_54 = iVar4; if (iVar4 == 0) { *(undefined8 *)(puVar9 + -8) = 0x1004eb; local_54 = sshbuf_put_string(local_18,local_30,local_28); if (local_54 == 0) { *(undefined8 *)(puVar9 + -8) = 0x100517; local_54 = sshbuf_put_cstring(local_18); if (local_54 != 0) goto LAB_00100520; } else { LAB_00100520: iVar4 = local_54; *(undefined8 *)(puVar9 + -8) = 0x10052a; uVar6 = ssh_err(iVar4); *(char **)(puVar9 + -0x10) = "compose key"; *(undefined8 *)(puVar9 + -0x18) = 0x100561; sshfatal("ssh-pkcs11-helper.c","process_add",0x92,1,1,uVar6); puVar9 = puVar9 + -0x10; } *(undefined8 *)(puVar9 + -8) = 0x10056d; free(local_30); uVar6 = *(undefined8 *)((long)local_20 + (long)local_50 * 8); uVar1 = *(undefined8 *)((long)local_38 + (long)local_50 * 8); *(undefined8 *)(puVar9 + -8) = 0x1005a4; add_key(uVar1,local_48,uVar6); pvVar2 = *(void **)((long)local_20 + (long)local_50 * 8); *(undefined8 *)(puVar9 + -8) = 0x1005c0; free(pvVar2); } else { *(undefined8 *)(puVar9 + -8) = 0x100494; uVar6 = ssh_err(iVar4); *(char **)(puVar9 + -0x10) = "encode key"; *(undefined8 *)(puVar9 + -0x18) = 0x1004cb; sshlog("ssh-pkcs11-helper.c","process_add",0x8d,1,5,uVar6); } *(undefined8 *)(puVar9 + -8) = 0x1005cd; } LAB_0010065a: pvVar2 = local_20; *(undefined8 *)(puVar9 + -8) = 0x100666; free(pvVar2); pvVar2 = local_38; *(undefined8 *)(puVar9 + -8) = 0x100672; free(pvVar2); *(undefined8 *)(puVar9 + -8) = 0x10067e; free(local_40); *(undefined8 *)(puVar9 + -8) = 0x10068a; free(local_48); lVar3 = local_18; *(undefined8 *)(puVar9 + -8) = 0x100696; send_msg(lVar3); lVar3 = local_18; *(undefined8 *)(puVar9 + -8) = 0x1006a2; sshbuf_free(lVar3); if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return; } *(undefined8 *)(puVar9 + -8) = 0x1006b7; __stack_chk_fail(); }
entry *load_entry(FILE * file, void (*error_func) (), struct passwd *pw, char **envp) { ecode_e ecode = e_none; entry *e = ((void *)0) ; int ch; char cmd[131072]; char envstr[131072]; char **tenvp; char *p; struct passwd temppw; int i; if ((DebugFlags & (0x0008)) != 0) printf ("load_entry()...about to eat comments\n"); ch = get_char(file); if (ch == (-1) ) return ( ((void *)0) ); e = (entry *) calloc(sizeof (entry), sizeof (char)); if (e == ((void *)0) ) { ecode = e_memory; goto eof; } if (ch == '-') { if (pw == ((void *)0) || pw->pw_uid == 0) e->flags |= 0x20; else { log_it("CRON", getpid(), "ERROR", "Only privileged user can disable logging", 0); ecode = e_option; goto eof; } ch = get_char(file); if (ch == (-1) ) { free(e); return ((void *)0) ; } } if (ch == '@') { ch = get_string(cmd, 131072, file, " \t\n"); if (!strcmp("reboot", cmd)) { e->flags |= 0x10; } else if (!strcmp("yearly", cmd) || !strcmp("annually", cmd)) { (e->minute)[((0) >> 3)] |= (bitstr_t)(1 << ((0)&0x7)); (e->hour)[((0) >> 3)] |= (bitstr_t)(1 << ((0)&0x7)); (e->dom)[((0) >> 3)] |= (bitstr_t)(1 << ((0)&0x7)); (e->month)[((0) >> 3)] |= (bitstr_t)(1 << ((0)&0x7)); { register bitstr_t *_name = e->dow; register int _start = 0, _stop = 7 - 0; register int _startbyte = ((_start) >> 3); register int _stopbyte = ((_stop) >> 3); if (_startbyte == _stopbyte) { _name[_startbyte] |= (bitstr_t)((0xff << (_start&0x7)) & (0xff >> (7 - (_stop&0x7)))); } else { _name[_startbyte] |= (bitstr_t)(0xff << ((_start)&0x7)); while (++_startbyte < _stopbyte) _name[_startbyte] = 0xff; _name[_stopbyte] |= (bitstr_t)(0xff >> (7 - (_stop&0x7))); } }; e->flags |= 0x08; } else if (!strcmp("monthly", cmd)) { (e->minute)[((0) >> 3)] |= (bitstr_t)(1 << ((0)&0x7)); (e->hour)[((0) >> 3)] |= (bitstr_t)(1 << ((0)&0x7)); (e->dom)[((0) >> 3)] |= (bitstr_t)(1 << ((0)&0x7)); { register bitstr_t *_name = e->month; register int _start = 0, _stop = 12 - 1; register int _startbyte = ((_start) >> 3); register int _stopbyte = ((_stop) >> 3); if (_startbyte == _stopbyte) { _name[_startbyte] |= (bitstr_t)((0xff << (_start&0x7)) & (0xff >> (7 - (_stop&0x7)))); } else { _name[_startbyte] |= (bitstr_t)(0xff << ((_start)&0x7)); while (++_startbyte < _stopbyte) _name[_startbyte] = 0xff; _name[_stopbyte] |= (bitstr_t)(0xff >> (7 - (_stop&0x7))); } }; { register bitstr_t *_name = e->dow; register int _start = 0, _stop = 7 - 0; register int _startbyte = ((_start) >> 3); register int _stopbyte = ((_stop) >> 3); if (_startbyte == _stopbyte) { _name[_startbyte] |= (bitstr_t)((0xff << (_start&0x7)) & (0xff >> (7 - (_stop&0x7)))); } else { _name[_startbyte] |= (bitstr_t)(0xff << ((_start)&0x7)); while (++_startbyte < _stopbyte) _name[_startbyte] = 0xff; _name[_stopbyte] |= (bitstr_t)(0xff >> (7 - (_stop&0x7))); } }; e->flags |= 0x08; } else if (!strcmp("weekly", cmd)) { (e->minute)[((0) >> 3)] |= (bitstr_t)(1 << ((0)&0x7)); (e->hour)[((0) >> 3)] |= (bitstr_t)(1 << ((0)&0x7)); { register bitstr_t *_name = e->dom; register int _start = 0, _stop = 31 - 1; register int _startbyte = ((_start) >> 3); register int _stopbyte = ((_stop) >> 3); if (_startbyte == _stopbyte) { _name[_startbyte] |= (bitstr_t)((0xff << (_start&0x7)) & (0xff >> (7 - (_stop&0x7)))); } else { _name[_startbyte] |= (bitstr_t)(0xff << ((_start)&0x7)); while (++_startbyte < _stopbyte) _name[_startbyte] = 0xff; _name[_stopbyte] |= (bitstr_t)(0xff >> (7 - (_stop&0x7))); } }; { register bitstr_t *_name = e->month; register int _start = 0, _stop = 12 - 1; register int _startbyte = ((_start) >> 3); register int _stopbyte = ((_stop) >> 3); if (_startbyte == _stopbyte) { _name[_startbyte] |= (bitstr_t)((0xff << (_start&0x7)) & (0xff >> (7 - (_stop&0x7)))); } else { _name[_startbyte] |= (bitstr_t)(0xff << ((_start)&0x7)); while (++_startbyte < _stopbyte) _name[_startbyte] = 0xff; _name[_stopbyte] |= (bitstr_t)(0xff >> (7 - (_stop&0x7))); } }; (e->dow)[((0) >> 3)] |= (bitstr_t)(1 << ((0)&0x7)); e->flags |= 0x04; } else if (!strcmp("daily", cmd) || !strcmp("midnight", cmd)) { (e->minute)[((0) >> 3)] |= (bitstr_t)(1 << ((0)&0x7)); (e->hour)[((0) >> 3)] |= (bitstr_t)(1 << ((0)&0x7)); { register bitstr_t *_name = e->dom; register int _start = 0, _stop = 31 - 1; register int _startbyte = ((_start) >> 3); register int _stopbyte = ((_stop) >> 3); if (_startbyte == _stopbyte) { _name[_startbyte] |= (bitstr_t)((0xff << (_start&0x7)) & (0xff >> (7 - (_stop&0x7)))); } else { _name[_startbyte] |= (bitstr_t)(0xff << ((_start)&0x7)); while (++_startbyte < _stopbyte) _name[_startbyte] = 0xff; _name[_stopbyte] |= (bitstr_t)(0xff >> (7 - (_stop&0x7))); } }; { register bitstr_t *_name = e->month; register int _start = 0, _stop = 12 - 1; register int _startbyte = ((_start) >> 3); register int _stopbyte = ((_stop) >> 3); if (_startbyte == _stopbyte) { _name[_startbyte] |= (bitstr_t)((0xff << (_start&0x7)) & (0xff >> (7 - (_stop&0x7)))); } else { _name[_startbyte] |= (bitstr_t)(0xff << ((_start)&0x7)); while (++_startbyte < _stopbyte) _name[_startbyte] = 0xff; _name[_stopbyte] |= (bitstr_t)(0xff >> (7 - (_stop&0x7))); } }; { register bitstr_t *_name = e->dow; register int _start = 0, _stop = 7 - 0; register int _startbyte = ((_start) >> 3); register int _stopbyte = ((_stop) >> 3); if (_startbyte == _stopbyte) { _name[_startbyte] |= (bitstr_t)((0xff << (_start&0x7)) & (0xff >> (7 - (_stop&0x7)))); } else { _name[_startbyte] |= (bitstr_t)(0xff << ((_start)&0x7)); while (++_startbyte < _stopbyte) _name[_startbyte] = 0xff; _name[_stopbyte] |= (bitstr_t)(0xff >> (7 - (_stop&0x7))); } }; } else if (!strcmp("hourly", cmd)) { (e->minute)[((0) >> 3)] |= (bitstr_t)(1 << ((0)&0x7)); { register bitstr_t *_name = e->hour; register int _start = 0, _stop = 23 - 0; register int _startbyte = ((_start) >> 3); register int _stopbyte = ((_stop) >> 3); if (_startbyte == _stopbyte) { _name[_startbyte] |= (bitstr_t)((0xff << (_start&0x7)) & (0xff >> (7 - (_stop&0x7)))); } else { _name[_startbyte] |= (bitstr_t)(0xff << ((_start)&0x7)); while (++_startbyte < _stopbyte) _name[_startbyte] = 0xff; _name[_stopbyte] |= (bitstr_t)(0xff >> (7 - (_stop&0x7))); } }; { register bitstr_t *_name = e->dom; register int _start = 0, _stop = 31 - 1; register int _startbyte = ((_start) >> 3); register int _stopbyte = ((_stop) >> 3); if (_startbyte == _stopbyte) { _name[_startbyte] |= (bitstr_t)((0xff << (_start&0x7)) & (0xff >> (7 - (_stop&0x7)))); } else { _name[_startbyte] |= (bitstr_t)(0xff << ((_start)&0x7)); while (++_startbyte < _stopbyte) _name[_startbyte] = 0xff; _name[_stopbyte] |= (bitstr_t)(0xff >> (7 - (_stop&0x7))); } }; { register bitstr_t *_name = e->month; register int _start = 0, _stop = 12 - 1; register int _startbyte = ((_start) >> 3); register int _stopbyte = ((_stop) >> 3); if (_startbyte == _stopbyte) { _name[_startbyte] |= (bitstr_t)((0xff << (_start&0x7)) & (0xff >> (7 - (_stop&0x7)))); } else { _name[_startbyte] |= (bitstr_t)(0xff << ((_start)&0x7)); while (++_startbyte < _stopbyte) _name[_startbyte] = 0xff; _name[_stopbyte] |= (bitstr_t)(0xff >> (7 - (_stop&0x7))); } }; { register bitstr_t *_name = e->dow; register int _start = 0, _stop = 7 - 0; register int _startbyte = ((_start) >> 3); register int _stopbyte = ((_stop) >> 3); if (_startbyte == _stopbyte) { _name[_startbyte] |= (bitstr_t)((0xff << (_start&0x7)) & (0xff >> (7 - (_stop&0x7)))); } else { _name[_startbyte] |= (bitstr_t)(0xff << ((_start)&0x7)); while (++_startbyte < _stopbyte) _name[_startbyte] = 0xff; _name[_stopbyte] |= (bitstr_t)(0xff >> (7 - (_stop&0x7))); } }; e->flags |= 0x02; } else { ecode = e_timespec; goto eof; } while (ch == '\t' || ch == ' ') ch = get_char(file);; if (ch == (-1) || ch == '\n') { ecode = e_cmd; goto eof; } } else { if ((DebugFlags & (0x0008)) != 0) printf ("load_entry()...about to parse numerics\n"); if (ch == '*') e->flags |= 0x01; ch = get_list(e->minute, 0, 59, ((const char **) ((void *)0) ), ch, file); if (ch == (-1) ) { ecode = e_minute; goto eof; } if (ch == '*') e->flags |= 0x02; ch = get_list(e->hour, 0, 23, ((const char **) ((void *)0) ), ch, file); if (ch == (-1) ) { ecode = e_hour; goto eof; } if (ch == '*') e->flags |= 0x04; ch = get_list(e->dom, 1, 31, ((const char **) ((void *)0) ), ch, file); if (ch == (-1) ) { ecode = e_dom; goto eof; } ch = get_list(e->month, 1, 12, MonthNames, ch, file); if (ch == (-1) ) { ecode = e_month; goto eof; } if (ch == '*') e->flags |= 0x08; ch = get_list(e->dow, 0, 7, DowNames, ch, file); if (ch == (-1) ) { ecode = e_dow; goto eof; } } if (((e->dow)[((0) >> 3)] & (1 << ((0)&0x7))) || ((e->dow)[((7) >> 3)] & (1 << ((7)&0x7)))) { (e->dow)[((0) >> 3)] |= (bitstr_t)(1 << ((0)&0x7)); (e->dow)[((7) >> 3)] |= (bitstr_t)(1 << ((7)&0x7)); } if (ch == '\n' || ch == '*') { ecode = e_cmd; goto eof; } unget_char(ch, file); if (!pw) { char *username = cmd; if ((DebugFlags & (0x0008)) != 0) printf ("load_entry()...about to parse username\n"); ch = get_string(username, 131072, file, " \t\n"); if ((DebugFlags & (0x0008)) != 0) printf ("load_entry()...got %s\n", username); if (ch == (-1) || ch == '\n' || ch == '*') { ecode = e_cmd; goto eof; } pw = getpwnam(username); if (pw == ((void *)0) ) { if ((DebugFlags & (0x0008)) != 0) printf ("load_entry()...unknown user entry\n"); memset(&temppw, 0, sizeof (temppw)); temppw.pw_name = username; temppw.pw_passwd = ""; pw = &temppw; } else { if ((DebugFlags & (0x0008)) != 0) printf ("load_entry()...uid %ld, gid %ld\n", (long) pw->pw_uid, (long) pw->pw_gid) ; } while (ch == '\t' || ch == ' ') ch = get_char(file);; if (ch == (-1) || ch == '\n') { ecode = e_cmd; goto eof; } unget_char(ch, file); } if ((e->pwd = pw_dup(pw)) == ((void *)0) ) { ecode = e_memory; goto eof; } memset(e->pwd->pw_passwd, 0, strlen(e->pwd->pw_passwd)); p = env_get("RANDOM_DELAY", envp); if (p) { char *endptr; long val; (*__errno_location ()) = 0; val = strtol(p, &endptr, 10); if ( (*__errno_location ()) != 0 || val < 0 || val > 24*60) { log_it("CRON", getpid(), "ERROR", "bad value of RANDOM_DELAY", 0); } else { e->delay = (int)((double)val * RandomScale); } } if ((e->envp = env_copy(envp)) == ((void *)0) ) { ecode = e_memory; goto eof; } if (!env_get("SHELL", e->envp)) { if (glue_strings(envstr, sizeof envstr, "SHELL", "/bin/sh" , '=')) { if ((tenvp = env_set(e->envp, envstr)) == ((void *)0) ) { ecode = e_memory; goto eof; } e->envp = tenvp; } else log_it("CRON", getpid(), "ERROR", "can't set SHELL", 0); } if ((tenvp = env_update_home(e->envp, pw->pw_dir)) == ((void *)0) ) { ecode = e_memory; goto eof; } e->envp = tenvp; if (!env_get("PATH", e->envp)) { char *defpath; if (ChangePath) defpath = "/usr/bin:/bin" ; else { defpath = getenv("PATH"); if (defpath == ((void *)0) ) defpath = "/usr/bin:/bin" ; } if (glue_strings(envstr, sizeof envstr, "PATH", defpath, '=')) { if ((tenvp = env_set(e->envp, envstr)) == ((void *)0) ) { ecode = e_memory; goto eof; } e->envp = tenvp; } else log_it("CRON", getpid(), "ERROR", "can't set PATH", 0); } if (glue_strings(envstr, sizeof envstr, "LOGNAME", pw->pw_name, '=')) { if ((tenvp = env_set(e->envp, envstr)) == ((void *)0) ) { ecode = e_memory; goto eof; } e->envp = tenvp; } else log_it("CRON", getpid(), "ERROR", "can't set LOGNAME", 0); if (glue_strings(envstr, sizeof envstr, "USER", pw->pw_name, '=')) { if ((tenvp = env_set(e->envp, envstr)) == ((void *)0) ) { ecode = e_memory; goto eof; } e->envp = tenvp; } else log_it("CRON", getpid(), "ERROR", "can't set USER", 0); if ((DebugFlags & (0x0008)) != 0) printf ("load_entry()...about to parse command\n"); ch = get_string(cmd, 131072, file, "\n"); if (ch == (-1) ) { ecode = e_cmd; goto eof; } if ((e->cmd = strdup(cmd)) == ((void *)0) ) { ecode = e_memory; goto eof; } if ((DebugFlags & (0x0008)) != 0) printf ("load_entry()...returning successfully\n"); return (e); eof: if (e) { if (e->envp) env_free(e->envp); free(e->pwd); free(e->cmd); free(e); } for (i = 0; i < 131072 && ch != '\n' && !feof(file); i++) ch = get_char(file); if (ecode != e_none && error_func) (*error_func) (ecodes[(int) ecode]); return ( ((void *)0) ); }
int load_entry() { struct_2 *v0; unsigned long v1; unsigned int v2; unsigned int v3; unsigned int v4; char v5; unsigned long long v6; void* v7; char *v8; char *v9; unsigned long long v10; unsigned long v11; unsigned long v12; unsigned long long v13; char v14; char v15; char v16; unsigned long long v17; unsigned long v18; unsigned long v19; unsigned long v20; unsigned long v21; unsigned long v22; unsigned long v23; char v25; char v26; char v27; char v28; char v29; char v30; unsigned long v31; unsigned long v32; unsigned long v33; unsigned long v34; unsigned long v35; unsigned long v36; unsigned long long v37; unsigned long long *v38; void* v39; unsigned long long v40; unsigned long long v42; unsigned long long v44; unsigned long long v45; unsigned long long v46; unsigned long long v47; unsigned long long v48; unsigned long long v49; v23 = v31; v22 = v32; v21 = v33; v20 = v34; v19 = v35; do { v17 = *(&v17); } while (&v17 != &v15); v1 = v36; v0 = v37; v18 = v38[5]; v2 = 0; v7 = 0; if ((DebugFlags & 8)) printf("load_entry()...about to eat comments\n"); v3 = get_char(v39); if (v3 != -1) { v7 = calloc(0x40, 0x1); if (!v7) { v2 = 10; goto LABEL_401907; } if (v3 == 45) { if (v0 && v0->field_10) { log_it("CRON", getpid(), "ERROR", "Only privileged user can disable logging", 0x0); v2 = 9; goto LABEL_401907; } v7->field_34 = v7->field_34 | 32; v3 = get_char(v39); if (v3 == -1) { free(v7); goto LABEL_4019fd; } } if (v3 != 64) { if ((DebugFlags & 8)) printf("load_entry()...about to parse numerics\n"); if (v3 == 42) v7->field_34 = v7->field_34 | 1; v3 = get_list(&v7->field_20, 0x0, 0x3b, 0x0, v3, v39); if (v3 == -1) { v2 = 1; goto LABEL_401907; } if (v3 == 42) v7->field_34 = v7->field_34 | 2; v3 = get_list(&v7->field_28, 0x0, 0x17, 0x0, v3, v39); if (v3 == -1) { v2 = 2; goto LABEL_401907; } if (v3 == 42) v7->field_34 = v7->field_34 | 4; v3 = get_list(&v7->field_2b, 0x1, 0x1f, 0x0, v3, v39); if (v3 == -1) { v2 = 3; goto LABEL_401907; } v3 = get_list(&v7->field_2f, 0x1, 0xc, 0x500050, v3, v39); if (v3 == -1) { v2 = 4; goto LABEL_401907; } if (v3 == 42) v7->field_34 = v7->field_34 | 8; v3 = get_list(&v7->field_31, 0x0, 0x7, 0x500058, v3, v39); if (v3 == -1) { v2 = 5; goto LABEL_401907; } LABEL_4010fa: if (!(v7->field_31 & 1) && !(v7->field_31 < 0)) goto LABEL_401152; v7->field_31 = v7->field_31 | 1; v7->field_31 = v7->field_31 | -128; LABEL_401152: if (v3 == 10) { LABEL_401164: v2 = 6; goto LABEL_401907; } else { if (v3 == 42) goto LABEL_401164; unget_char(v3, v39, v39); if (v0) { LABEL_40135b: v7->field_8 = pw_dup(v0); if (!v7->field_8) { v2 = 10; goto LABEL_401907; } memset(v7->field_8->field_8, 0x0, strlen(v7->field_8->field_8)); v9 = env_get("RANDOM_DELAY", v40); if (v9) { *(__errno_location()) = 0; v10 = strtol(v9, &v5, 0xa); if (*(__errno_location())) { LABEL_401447: log_it("CRON", getpid(), "ERROR", "bad value of RANDOM_DELAY", 0x0); } else { if ((v10 - 0 >> 63)) goto LABEL_401447; if (!(v10 <= 1440)) goto LABEL_401447; v42 = v10; STORE(addr=(Load(addr=stack_base-262304, size=8, endness=Iend_LE) + 0x38<64>), data=Conv(128->32, (Conv(64->128, Load(addr=0x5000a0<64>, size=8, endness=Iend_LE)) * xmm1<16>)), size=4, endness=Iend_LE, guard=None) } } v7->field_10 = env_copy(v40); if (!v7->field_10) { v2 = 10; goto LABEL_401907; } if (!env_get("SHELL", v7->field_10)) { if (!glue_strings(&v16, 0x20000, "SHELL", "/bin/sh", 0x3d)) { log_it("CRON", getpid(), "ERROR", "can't set SHELL", 0x0); } else { v11 = env_set(v7->field_10, &v16, &v16); if (!v11) { v2 = 10; goto LABEL_401907; } else { v7->field_10 = v11; } } } v11 = env_update_home(v7->field_10, v0->field_20, v0->field_20); if (!v11) { v2 = 10; goto LABEL_401907; } v7->field_10 = v11; if (!env_get("PATH", v7->field_10)) { if (ChangePath) { v6 = "/usr/bin:/bin"; } else { v6 = getenv("PATH"); if (!v6) v6 = "/usr/bin:/bin"; } if (!glue_strings(&v16, 0x20000, "PATH", v6, 0x3d)) { log_it("CRON", getpid(), "ERROR", "can't set PATH", 0x0); } else { v11 = env_set(v7->field_10, &v16, &v16); if (!v11) { v2 = 10; goto LABEL_401907; } else { v7->field_10 = v11; } } } if (!glue_strings(&v16, 0x20000, "LOGNAME", v0->field_0, 0x3d)) { log_it("CRON", getpid(), "ERROR", "can't set LOGNAME", 0x0); } else { v11 = env_set(v7->field_10, &v16, &v16); if (!v11) { v2 = 10; goto LABEL_401907; } else { v7->field_10 = v11; } } if (!glue_strings(&v16, 0x20000, "USER", v0->field_0, 0x3d)) { log_it("CRON", getpid(), "ERROR", "can't set USER", 0x0); } else { v11 = env_set(v7->field_10, &v16, &v16); if (!v11) { v2 = 10; goto LABEL_401907; } else { v7->field_10 = v11; } } if ((DebugFlags & 8)) printf("load_entry()...about to parse command\n"); v3 = get_string(&v14, 0x20000, v39, "\n"); if (v3 == -1) { v2 = 6; } else { v7->field_18 = strdup(&v14); if (!v7->field_18) { v2 = 10; } else { if ((DebugFlags & 8)) printf("load_entry()...returning successfully\n"); goto LABEL_4019fd; } } LABEL_401907: if (v7) { if (v7->field_10) env_free(v7->field_10); free(v7->field_8); free(v7->field_18); free(v7); } v4 = 0; while (true) { if (v4 > 131071) break; if (v3 == 10) break; if (feof(v39)) break; v3 = get_char(v39); v4 += 1; } if (v2 && v36) (stack_base)[262360]((&ecodes)[v2]); } else { v8 = &v14; if ((DebugFlags & 8)) printf("load_entry()...about to parse username\n"); v3 = get_string(v8, 0x20000, v39, " \t\n"); if ((DebugFlags & 8)) printf("load_entry()...got %s\n", v8); if (v3 != -1 && v3 != 10 && v3 != 42) { *(&v0[0]) = getpwnam(v8); if (!v0) { if ((DebugFlags & 8)) printf("load_entry()...unknown user entry\n"); memset(&v12, 0x0, 0x30); v12 = v8; v13 = &g_4024d3; v0 = &v12; } else if ((DebugFlags & 8)) { printf("load_entry()...uid %ld, gid %ld\n", v0[4], v0[5]); } while (true) { if (v3 != 9 && v3 != 32) break; v3 = get_char(v39); } if (v3 != -1 && v3 != 10) { unget_char(v3, v39, v39); goto LABEL_40135b; } v2 = 6; goto LABEL_401907; } v2 = 6; goto LABEL_401907; } } } else { v3 = get_string(&v14, 0x20000, v39, " \t\n"); if (!strcmp("reboot", &v14)) { v7->field_34 = v7->field_34 | 16; goto LABEL_400e7a; } if (strcmp("yearly", &v14) && strcmp("annually", &v14)) { if (!strcmp("monthly", &v14)) { v7->field_20 = v7->field_20 | 1; v7->field_28 = v7->field_28 | 1; v7->field_2b = v7->field_2b | 1; if (false) { v7->field_2f = v7->field_2f | (255 >> ((!(11) & 7) & 31)) & 255; } else { v7->field_2f = v7->field_2f | 255; while (false) { v7->padding_30[0] = 255; } v7->padding_30[0] = v7->padding_30 | (255 >> ((!(11) & 7) & 31)); } if (true) { v7->field_31 = v7->field_31 | (255 >> ((!(7) & 7) & 31)) & 255; } else { v7->field_31 = v7->field_31 | 255; while (false) { v7->padding_32[0] = 255; } v7->field_31 = v7->field_31 | (255 >> ((!(7) & 7) & 31)); } v7->field_34 = v7->field_34 | 8; goto LABEL_400e7a; } if (!strcmp("weekly", &v14)) { v7->field_20 = v7->field_20 | 1; v7->field_28 = v7->field_28 | 1; if (false) { v7->field_2b = v7->field_2b | (255 >> ((!(30) & 7) & 31)) & 255; } else { v7->field_2b = v7->field_2b | 255; while (true) { v7->padding_2c[0] = 255; } v7->padding_2c[2] = v7->padding_2c[2] | (255 >> ((!(30) & 7) & 31)); } if (false) { v7->field_2f = v7->field_2f | (255 >> ((!(11) & 7) & 31)) & 255; } else { v7->field_2f = v7->field_2f | 255; while (false) { v7->padding_30[0] = 255; } v7->padding_30[0] = v7->padding_30 | (255 >> ((!(11) & 7) & 31)); } v7->field_31 = v7->field_31 | 1; v7->field_34 = v7->field_34 | 4; goto LABEL_400e7a; } if (strcmp("daily", &v14) && strcmp("midnight", &v14)) { if (strcmp("hourly", &v14)) { v2 = 7; goto LABEL_401907; } else { v7->field_20 = v7->field_20 | 1; if (false) { v7->field_28 = v7->field_28 | (255 >> ((!(23) & 7) & 31)) & 255; } else { v7->field_28 = v7->field_28 | 255; while (true) { v7->padding_29[0] = 255; } v7->padding_29[1] = v7->padding_29[1] | (255 >> ((!(23) & 7) & 31)); } if (false) { v7->field_2b = v7->field_2b | (255 >> ((!(30) & 7) & 31)) & 255; } else { v7->field_2b = v7->field_2b | 255; while (true) { v7->padding_2c[0] = 255; } v7->padding_2c[2] = v7->padding_2c[2] | (255 >> ((!(30) & 7) & 31)); } if (false) { v7->field_2f = v7->field_2f | (255 >> ((!(11) & 7) & 31)) & 255; } else { v7->field_2f = v7->field_2f | 255; while (false) { v7->padding_30[0] = 255; } v7->padding_30[0] = v7->padding_30 | (255 >> ((!(11) & 7) & 31)); } if (true) { v7->field_31 = v7->field_31 | (255 >> ((!(7) & 7) & 31)) & 255; } else { v7->field_31 = v7->field_31 | 255; while (false) { v7->padding_32[0] = 255; } v7->field_31 = v7->field_31 | (255 >> ((!(7) & 7) & 31)); } v7->field_34 = v7->field_34 | 2; goto LABEL_400e7a; } } v7->field_20 = v7->field_20 | 1; v7->field_28 = v7->field_28 | 1; if (false) { v7->field_2b = v7->field_2b | (255 >> ((!(30) & 7) & 31)) & 255; } else { v7->field_2b = v7->field_2b | 255; while (true) { v7->padding_2c[0] = 255; } v7->padding_2c[2] = v7->padding_2c[2] | (255 >> ((!(30) & 7) & 31)); } if (false) { v7->field_2f = v7->field_2f | (255 >> ((!(11) & 7) & 31)) & 255; } else { v7->field_2f = v7->field_2f | 255; while (false) { v7->padding_30[0] = 255; } v7->padding_30[0] = v7->padding_30 | (255 >> ((!(11) & 7) & 31)); } if (true) { v7->field_31 = v7->field_31 | (255 >> ((!(7) & 7) & 31)) & 255; } else { v7->field_31 = v7->field_31 | 255; while (false) { v7->padding_32[0] = 255; } v7->field_31 = v7->field_31 | (255 >> ((!(7) & 7) & 31)); } LABEL_400e63: while (true) { LABEL_400e7a: if (v3 != 9 && v3 != 32) break; v3 = get_char(v39); } if (v3 != -1 && !(v3 == 10)) goto LABEL_4010fa; v2 = 6; goto LABEL_401907; } v7->field_20 = v7->field_20 | 1; v7->field_28 = v7->field_28 | 1; v7->field_2b = v7->field_2b | 1; v7->field_2f = v7->field_2f | 1; if (true) { v7->field_31 = v7->field_31 | (255 >> ((!(7) & 7) & 31)) & 255; } else { v7->field_31 = v7->field_31 | 255; while (false) { v7->padding_32[0] = 255; } v7->field_31 = v7->field_31 | (255 >> ((!(7) & 7) & 31)); } v7->field_34 = v7->field_34 | 8; goto LABEL_400e63; } } LABEL_4019fd: if (!(v18 ^ v38[5])) { v44 = *(&v25); v45 = *(&v26); v46 = *(&v27); v47 = *(&v28); v48 = *(&v29); v49 = *(&v30); return; } __stack_chk_fail(); }
static int iplink_afstats(int argc, char **argv) { __u32 filt_mask = (1 << (IFLA_STATS_AF_SPEC - 1)); const char *filter_dev = ((void *)0) ; struct af_stats_ctx ctx = { .fp = stdout , .ifindex = 0, }; while (argc > 0) { if (strcmp(*argv, "dev") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (filter_dev) duparg2("dev", *argv); filter_dev = *argv; } else if (matches(*argv, "help") == 0) { usage(); } else { fprintf( stderr , "Command \"%s\" is unknown, try \"ip link help\".\n", *argv); exit(-1); } argv++; argc--; } if (filter_dev) { ctx.ifindex = ll_name_to_index(filter_dev); if (ctx.ifindex <= 0) { fprintf( stderr , "Device \"%s\" does not exist.\n", filter_dev); return -1; } } if (rtnl_statsdump_req_filter(&rth, 0 , filt_mask, ((void *)0) , ((void *)0) ) < 0) { perror("Cannont send dump request"); return 1; } if (rtnl_dump_filter_nc(&rth, print_af_stats, &ctx, 0) < 0) { fprintf( stderr , "Dump terminated\n"); return 1; } return 0; }
void iplink_afstats(unsigned long a0, unsigned long a1) { unsigned long long *v0; unsigned int v1; unsigned int v2; void* v3; unsigned long v4; unsigned int v5; unsigned long long v8; unsigned long long v9; void* v10; unsigned long long v11; v1 = a0; v0 = a1; v2 = 16; v3 = 0; v4 = stdout; for (v5 = 0; v1 > 0; v1 -= 1) { if (!strcmp(*(v0), "dev")) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (v3) duparg2("dev", *(v0)); v3 = *(v0); v0 = v0 + 1; } else if ((matches(*(v0), "help") ^ 1)) { usage(); } else { fprintf(*(&stderr), "Command \"%s\" is unknown, try \"ip link help\".\n", *(v0)); exit(0xffffffff); } } if (v3) { v5 = ll_name_to_index(v3); if (v5 <= 0) { fprintf(*(&stderr), "Device \"%s\" does not exist.\n", v3); v8 = 4294967295; goto LABEL_405be3; } } if (rtnl_statsdump_req_filter(0x500058, 0x0, v2, 0x0, 0x0) < 0) { perror("Cannont send dump request"); v9 = 1; } else if (rtnl_dump_filter_nc(0x500058, print_af_stats, &v4, 0x0) >= 0) { v10 = 0; } else { fprintf(*(&stderr), "Dump terminated\n"); v11 = 1; } LABEL_405be3: return; }
WORD_LIST * strvec_to_word_list (array, alloc, starting_index) char **array; int alloc, starting_index; { WORD_LIST *list; WORD_DESC *w; int i, count; if (array == 0 || array[0] == 0) return (WORD_LIST *) ((void *)0) ; for (count = 0; array[count]; count++) ; for (i = starting_index, list = (WORD_LIST *) ((void *)0) ; i < count; i++) { w = make_bare_word (alloc ? array[i] : ""); if (alloc == 0) { sh_xfree((w->word), "stringvec.c", 266); w->word = array[i]; } list = make_word_list (w, list); } return (((list && list->next) ? (WORD_LIST *)list_reverse ((GENERIC_LIST *)list) : (WORD_LIST *)(list))); }
long * strvec_to_word_list(long *param_1,int param_2,int param_3) { undefined *puVar1; long *plVar2; int local_20; int local_1c; long *local_18; if ((param_1 == (long *)0x0) || (*param_1 == 0)) { local_18 = (long *)0x0; } else { for (local_1c = 0; param_1[local_1c] != 0; local_1c = local_1c + 1) { } local_18 = (long *)0x0; for (local_20 = param_3; local_20 < local_1c; local_20 = local_20 + 1) { if (param_2 == 0) { puVar1 = &DAT_0010080b; } else { puVar1 = (undefined *)param_1[local_20]; } plVar2 = (long *)make_bare_word(puVar1); if (param_2 == 0) { sh_xfree(*plVar2,"stringvec.c",0x10a); *plVar2 = param_1[local_20]; } local_18 = (long *)make_word_list(plVar2,local_18); } if ((local_18 != (long *)0x0) && (*local_18 != 0)) { local_18 = (long *)list_reverse(local_18); } } return local_18; }
static inline __u8 rta_getattr_u8(const struct rtattr *rta) { return *(__u8 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); }
undefined rta_getattr_u8(long param_1) { return *(undefined *)(param_1 + 4); }
static keymacro_node_t * node__get(wint_t ch) { keymacro_node_t *ptr; ptr = malloc(sizeof(*ptr)); if (ptr == ((void *)0) ) return ((void *)0) ; ptr->ch = ch; ptr->type = 2; ptr->val.str = ((void *)0) ; ptr->next = ((void *)0) ; ptr->sibling = ((void *)0) ; return ptr; }
_DWORD * node__get(int a1) { _DWORD *v2; v2 = malloc(0x20uLL); if ( !v2 ) return 0LL; *v2 = a1; v2[1] = 2; *((_QWORD *)v2 + 1) = 0LL; *((_QWORD *)v2 + 2) = 0LL; *((_QWORD *)v2 + 3) = 0LL; return v2; }
int ssh_add_identity_constrained(int sock, struct sshkey *key, const char *comment, u_int life, u_int confirm, u_int maxsign, const char *provider, struct dest_constraint **dest_constraints, size_t ndest_constraints) { struct sshbuf *msg; int r, constrained = (life || confirm || maxsign || provider || dest_constraints); u_char type; if ((msg = sshbuf_new()) == ((void *)0) ) return -2; switch (key->type) { case KEY_RSA: case KEY_RSA_CERT: case KEY_DSA: case KEY_DSA_CERT: case KEY_ECDSA: case KEY_ECDSA_CERT: case KEY_ECDSA_SK: case KEY_ECDSA_SK_CERT: case KEY_ED25519: case KEY_ED25519_CERT: case KEY_ED25519_SK: case KEY_ED25519_SK_CERT: case KEY_XMSS: case KEY_XMSS_CERT: type = constrained ? 25 : 17; if ((r = sshbuf_put_u8(msg, type)) != 0 || (r = sshkey_private_serialize_maxsign(key, msg, maxsign, 0)) != 0 || (r = sshbuf_put_cstring(msg, comment)) != 0) goto out; break; default: r = -10; goto out; } if (constrained && (r = encode_constraints(msg, life, confirm, maxsign, provider, dest_constraints, ndest_constraints)) != 0) goto out; if ((r = ssh_request_reply_decode(sock, msg)) != 0) goto out; r = 0; out: sshbuf_free(msg); return r; }
long ssh_add_identity_constrained( unsigned int a1, _DWORD *a2, long a3, unsigned int a4, int a5, unsigned int a6, long a7, long a8, unsigned long a9) { _BOOL4 v9; unsigned char v11; unsigned int v16; _BOOL4 v17; long v18; v9 = a4 || a5 || a6 || a7 || a8; v17 = v9; v18 = sshbuf_new(); if ( !v18 ) return 4294967294LL; if ( *a2 > 0xDu ) { v16 = -10; } else { if ( v17 ) v11 = 25; else v11 = 17; v16 = sshbuf_put_u8(v18, v11); if ( !v16 ) { v16 = sshkey_private_serialize_maxsign(a2, v18, a6, 0LL); if ( !v16 ) { v16 = sshbuf_put_cstring(v18, a3); if ( !v16 && (!v17 || (v16 = encode_constraints(v18, a4, a5, a6, a7, a8, a9)) == 0) ) { v16 = ssh_request_reply_decode(a1, v18); if ( !v16 ) v16 = 0; } } } } sshbuf_free(v18); return v16; }
static void fallbackQSort3 ( UInt32* fmap, UInt32* eclass, Int32 loSt, Int32 hiSt ) { Int32 unLo, unHi, ltLo, gtHi, n, m; Int32 sp, lo, hi; UInt32 med, r, r3; Int32 stackLo[100]; Int32 stackHi[100]; r = 0; sp = 0; { stackLo[sp] = loSt; stackHi[sp] = hiSt; sp++; }; while (sp > 0) { { if (!(sp < 100 - 1)) BZ2_bz__AssertH__fail ( 1004 ); }; { sp--; lo = stackLo[sp]; hi = stackHi[sp]; }; if (hi - lo < 10) { fallbackSimpleSort ( fmap, eclass, lo, hi ); continue; } r = ((r * 7621) + 1) % 32768; r3 = r % 3; if (r3 == 0) med = eclass[fmap[lo]]; else if (r3 == 1) med = eclass[fmap[(lo+hi)>>1]]; else med = eclass[fmap[hi]]; unLo = ltLo = lo; unHi = gtHi = hi; while (1) { while (1) { if (unLo > unHi) break; n = (Int32)eclass[fmap[unLo]] - (Int32)med; if (n == 0) { { Int32 zztmp = fmap[unLo]; fmap[unLo] = fmap[ltLo]; fmap[ltLo] = zztmp; }; ltLo++; unLo++; continue; }; if (n > 0) break; unLo++; } while (1) { if (unLo > unHi) break; n = (Int32)eclass[fmap[unHi]] - (Int32)med; if (n == 0) { { Int32 zztmp = fmap[unHi]; fmap[unHi] = fmap[gtHi]; fmap[gtHi] = zztmp; }; gtHi--; unHi--; continue; }; if (n < 0) break; unHi--; } if (unLo > unHi) break; { Int32 zztmp = fmap[unLo]; fmap[unLo] = fmap[unHi]; fmap[unHi] = zztmp; }; unLo++; unHi--; } ; if (gtHi < ltLo) continue; n = ((ltLo-lo) < (unLo-ltLo)) ? (ltLo-lo) : (unLo-ltLo); { Int32 yyp1 = (lo); Int32 yyp2 = (unLo-n); Int32 yyn = (n); while (yyn > 0) { { Int32 zztmp = fmap[yyp1]; fmap[yyp1] = fmap[yyp2]; fmap[yyp2] = zztmp; }; yyp1++; yyp2++; yyn--; } }; m = ((hi-gtHi) < (gtHi-unHi)) ? (hi-gtHi) : (gtHi-unHi); { Int32 yyp1 = (unLo); Int32 yyp2 = (hi-m+1); Int32 yyn = (m); while (yyn > 0) { { Int32 zztmp = fmap[yyp1]; fmap[yyp1] = fmap[yyp2]; fmap[yyp2] = zztmp; }; yyp1++; yyp2++; yyn--; } }; n = lo + unLo - ltLo - 1; m = hi - (gtHi - unHi) + 1; if (n - lo > hi - m) { { stackLo[sp] = lo; stackHi[sp] = n; sp++; }; { stackLo[sp] = m; stackHi[sp] = hi; sp++; }; } else { { stackLo[sp] = m; stackHi[sp] = hi; sp++; }; { stackLo[sp] = lo; stackHi[sp] = n; sp++; }; } } }
unsigned long fallbackQSort3(long a1, long a2, int a3, int a4) { long v4; int v5; int v6; int v8; int i; int v10; int v11; int v12; int v13; int v14; unsigned int v15; signed int v16; int v17; int j; int v19; int v20; int k; signed int v22; int v23; int v24; int v25; int v26; int v27; int v28; int v29; int v30; int v31; int v32; int v33[100]; int v34[102]; unsigned long v35; v35 = __readfsqword(0x28u); LOWORD(v15) = 0; v33[0] = a3; v34[0] = a4; v12 = 1; while ( v12 > 0 ) { if ( v12 > 98 ) BZ2_bz__AssertH__fail(1004LL); v22 = v33[--v12]; v23 = v34[v12]; if ( v23 - v22 > 9 ) { v15 = (7621 * (_WORD)v15 + 1) & 0x7FFF; if ( v15 % 3 ) { if ( v15 % 3 == 1 ) v4 = 4LL * *(unsigned int *)(4LL * ((v22 + v23) >> 1) + a1); else v4 = 4LL * *(unsigned int *)(4LL * v23 + a1); v14 = *(_DWORD *)(v4 + a2); } else { v14 = *(_DWORD *)(4LL * *(unsigned int *)(4LL * v22 + a1) + a2); } v10 = v33[v12]; v8 = v10; v11 = v34[v12]; for ( i = v11; ; --i ) { while ( 1 ) { while ( 1 ) { if ( v8 > i ) goto LABEL_18; v24 = *(_DWORD *)(4LL * *(unsigned int *)(4LL * v8 + a1) + a2) - v14; if ( v24 ) break; v27 = *(_DWORD *)(4LL * v8 + a1); *(_DWORD *)(4LL * v8 + a1) = *(_DWORD *)(4LL * v10 + a1); *(_DWORD *)(a1 + 4LL * v10++) = v27; ++v8; } if ( v24 > 0 ) break; ++v8; } LABEL_18: while ( v8 <= i ) { v25 = *(_DWORD *)(4LL * *(unsigned int *)(4LL * i + a1) + a2) - v14; if ( v25 ) { if ( v25 < 0 ) break; --i; } else { v28 = *(_DWORD *)(4LL * i + a1); *(_DWORD *)(4LL * i + a1) = *(_DWORD *)(4LL * v11 + a1); *(_DWORD *)(a1 + 4LL * v11--) = v28; --i; } } if ( v8 > i ) break; v29 = *(_DWORD *)(4LL * v8 + a1); *(_DWORD *)(4LL * v8 + a1) = *(_DWORD *)(4LL * i + a1); *(_DWORD *)(a1 + 4LL * i) = v29; ++v8; } if ( v11 >= v10 ) { v5 = v10 - v22; if ( v8 - v10 <= v10 - v22 ) v5 = v8 - v10; v16 = v22; v17 = v8 - v5; for ( j = v5; j > 0; --j ) { v32 = *(_DWORD *)(4LL * v16 + a1); *(_DWORD *)(4LL * v16 + a1) = *(_DWORD *)(4LL * v17 + a1); *(_DWORD *)(a1 + 4LL * v17) = v32; ++v16; ++v17; } v6 = v23 - v11; if ( v11 - i <= v23 - v11 ) v6 = v11 - i; v19 = v8; v20 = v23 - v6 + 1; for ( k = v6; k > 0; --k ) { v31 = *(_DWORD *)(4LL * v19 + a1); *(_DWORD *)(4LL * v19 + a1) = *(_DWORD *)(4LL * v20 + a1); *(_DWORD *)(a1 + 4LL * v20) = v31; ++v19; ++v20; } v26 = v22 + v8 - v10 - 1; v30 = v23 - (v11 - i) + 1; if ( v8 - v10 - 1 <= -(i - v11 + 1) ) { v33[v12] = v30; v34[v12] = v23; v13 = v12 + 1; v33[v13] = v22; v34[v13] = v26; } else { v33[v12] = v22; v34[v12] = v26; v13 = v12 + 1; v33[v13] = v30; v34[v13] = v23; } v12 = v13 + 1; } } else { fallbackSimpleSort(a1, a2, v22, v23); } } return v35 - __readfsqword(0x28u); }
static int input_userauth_passwd_changereq(int type, u_int32_t seqnr, struct ssh *ssh) { Authctxt *authctxt = ssh->authctxt; char *info = ((void *)0) , *lang = ((void *)0) , *password = ((void *)0) , *retype = ((void *)0) ; char prompt[256]; const char *host; int r; sshlog("sshconnect2.c", __func__, 1117, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "input_userauth_passwd_changereq"); if (authctxt == ((void *)0) ) sshfatal("sshconnect2.c", __func__, 1120, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "input_userauth_passwd_changereq: " "no authentication context") ; host = options.host_key_alias ? options.host_key_alias : authctxt->host; if ((r = sshpkt_get_cstring(ssh, &info, ((void *)0) )) != 0 || (r = sshpkt_get_cstring(ssh, &lang, ((void *)0) )) != 0) goto out; if (strlen(info) > 0) sshlog("sshconnect2.c", __func__, 1128, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "%s", info); if ((r = sshpkt_start(ssh, 50)) != 0 || (r = sshpkt_put_cstring(ssh, authctxt->server_user)) != 0 || (r = sshpkt_put_cstring(ssh, authctxt->service)) != 0 || (r = sshpkt_put_cstring(ssh, authctxt->method->name)) != 0 || (r = sshpkt_put_u8(ssh, 1)) != 0) goto out; snprintf(prompt, sizeof(prompt), "Enter %.30s@%.128s's old password: ", authctxt->server_user, host); password = read_passphrase(prompt, 0); if ((r = sshpkt_put_cstring(ssh, password)) != 0) goto out; freezero(password, strlen(password)); password = ((void *)0) ; while (password == ((void *)0) ) { snprintf(prompt, sizeof(prompt), "Enter %.30s@%.128s's new password: ", authctxt->server_user, host); password = read_passphrase(prompt, 0x0004); if (password == ((void *)0) ) { r = 0; goto out; } snprintf(prompt, sizeof(prompt), "Retype %.30s@%.128s's new password: ", authctxt->server_user, host); retype = read_passphrase(prompt, 0); if (strcmp(password, retype) != 0) { freezero(password, strlen(password)); sshlog("sshconnect2.c", __func__, 1161, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Mismatch; try again, EOF to quit."); password = ((void *)0) ; } freezero(retype, strlen(retype)); } if ((r = sshpkt_put_cstring(ssh, password)) != 0 || (r = sshpkt_add_padding(ssh, 64)) != 0 || (r = sshpkt_send(ssh)) != 0) goto out; ssh_dispatch_set(ssh, 60, &input_userauth_passwd_changereq); r = 0; out: if (password) freezero(password, strlen(password)); free(info); free(lang); return r; }
long long input_userauth_passwd_changereq(unsigned long a0, unsigned long a1, struct_0 *a2) { unsigned int v0; unsigned int v1; unsigned int v2; void* v3; void* v4; void* v5; struct_1 *v6; void* v7; unsigned long v8; char v9; unsigned long long v10; void* v11; char v12; unsigned long long v14; unsigned long long v16; unsigned long long v18; unsigned long long v19; unsigned long long v20; v1 = a0; v0 = a1; v6 = a2->field_860; v3 = 0; v4 = 0; v5 = 0; v7 = 0; sshlog("sshconnect2.c", "input_userauth_passwd_changereq", 0x45d, 0x0, 0x6, 0x0, "input_userauth_passwd_changereq"); if (!v6) sshfatal("sshconnect2.c", "input_userauth_passwd_changereq", 0x460, 0x0, 0x1, 0x0); if (sshkey_alg_list) v14 = sshkey_alg_list; else v14 = v6->field_10; v8 = v14; v2 = sshpkt_get_cstring(a2, &v3, 0x0, &v3); if (!v2) { v2 = sshpkt_get_cstring(a2, &v4, 0x0, &v4); if (!v2) { if (strlen(v3)) { v11 = v3; v10 = "%s"; sshlog("sshconnect2.c", "input_userauth_passwd_changereq", 0x468, 0x0, 0x3, 0x0, *(&v12)); } v2 = sshpkt_start(a2, 0x32); if (!v2) { v2 = sshpkt_put_cstring(a2, v6->field_0); if (!v2) { v2 = sshpkt_put_cstring(a2, v6->field_18); if (!v2) { v2 = sshpkt_put_cstring(a2, v6->field_20->field_0); if (!v2) { v2 = sshpkt_put_u8(a2, 0x1); if (!v2) { snprintf(&v9, 0x100, "Enter %.30s@%.128s's old password: ", v6->field_0, v8); v5 = read_passphrase(&v9, 0x0); v2 = sshpkt_put_cstring(a2, v5); if (!v2) { v16 = strlen(v5); freezero(v5, v16, v16); v5 = 0; while (true) { if (!v5) { snprintf(&v9, 0x100, "Enter %.30s@%.128s's new password: ", v6->field_0, v8); v5 = read_passphrase(&v9, 0x4); if (!v5) { v2 = 0; break; } else { snprintf(&v9, 0x100, "Retype %.30s@%.128s's new password: ", v6->field_0, v8); v7 = read_passphrase(&v9, 0x0); if (strcmp(v5, v7)) { v18 = strlen(v5); freezero(v5, v18, v18); v10 = "Mismatch; try again, EOF to quit."; sshlog("sshconnect2.c", "input_userauth_passwd_changereq", 0x489, 0x0, 0x3, 0x0, *(&v12)); v5 = 0; } v19 = strlen(v7); freezero(v7, v19, v19); } } else { v2 = sshpkt_put_cstring(a2, v5); if (!v2) { v2 = sshpkt_add_padding(a2, 0x40); if (!v2) { v2 = sshpkt_send(a2); if (!v2) { ssh_dispatch_set(a2, 0x3c, input_userauth_passwd_changereq); v2 = 0; break; } } } if (v2 || v2 || v2) break; } } } } } } } } } } if (v5) { v20 = strlen(v5); freezero(v5, v20, v20); } free(v3); free(v4); return v2; }
static inline void emit_mandatory_arg_note (void) { fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout ) ; }
void emit_mandatory_arg_note() { unsigned long long v1; v1 = fputs_unlocked(gettext("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout); return; }
static int print_token(struct nlmsghdr *n, void *arg) { struct rtnl_dump_args *args = arg; FILE *fp = args->fp; int ifindex = args->ifindex; struct ifinfomsg *ifi = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); int len = n->nlmsg_len; struct rtattr *tb[(__IFLA_MAX - 1) + 1]; struct rtattr *ltb[(__IFLA_INET6_MAX - 1) + 1]; if (n->nlmsg_type != RTM_NEWLINK) return -1; len -= ((sizeof(*ifi)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))); if (len < 0) return -1; if (ifi->ifi_family != 10 ) return 0; if (ifi->ifi_index == 0) return 0; if (ifindex > 0 && ifi->ifi_index != ifindex) return 0; if (ifi->ifi_flags & (IFF_LOOPBACK | IFF_NOARP)) return 0; parse_rtattr(tb, (__IFLA_MAX - 1), ((struct rtattr*)(((char*)(ifi)) + ( ((sizeof(struct ifinfomsg))+4U -1) & ~(4U -1) ))), len); if (!tb[IFLA_PROTINFO]) return -1; (parse_rtattr_flags((ltb), ((__IFLA_INET6_MAX - 1)), ((void*)(((char*)(tb[IFLA_PROTINFO])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((tb[IFLA_PROTINFO])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))); if (!ltb[IFLA_INET6_TOKEN]) { fprintf( stderr , "Seems there's no support for IPv6 token!\n"); return -1; } open_json_object( ((void *)0) ); print_string(PRINT_FP, ((void *)0) , "token ", ((void *)0) ); print_color_string(PRINT_ANY, ifa_family_color(ifi->ifi_family), "token", "%s", format_host(ifi->ifi_family, ((int)((ltb[IFLA_INET6_TOKEN])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), ((void*)(((char*)(ltb[IFLA_INET6_TOKEN])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))))); print_string(PRINT_FP, ((void *)0) , " dev ", ((void *)0) ); print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "%s\n", ll_index_to_name(ifi->ifi_index)); close_json_object(); fflush(fp); return 0; }
long print_token(long a1, long a2) { const char *v3; unsigned int v4; const char *v5; int v6; int v7; FILE *stream; _BYTE *v9; char v10[56]; unsigned short *v11; char v12[96]; unsigned short *v13; unsigned long v14; v14 = __readfsqword(0x28u); stream = *(FILE **)a2; v6 = *(_DWORD *)(a2 + 8); v9 = (_BYTE *)(a1 + 16); if ( *(_WORD *)(a1 + 4) != 16 ) return 0xFFFFFFFFLL; v7 = *(_DWORD *)a1 - 32; if ( v7 < 0 ) return 0xFFFFFFFFLL; if ( *v9 != 10 ) return 0LL; if ( !*(_DWORD *)(a1 + 20) ) return 0LL; if ( v6 > 0 && v6 != *(_DWORD *)(a1 + 20) ) return 0LL; if ( (*(_DWORD *)(a1 + 24) & 0x88) != 0 ) return 0LL; parse_rtattr(v12, 60LL, a1 + 32, (unsigned int)v7); if ( !v13 ) return 0xFFFFFFFFLL; parse_rtattr_flags(v10, 9LL, v13 + 2, (unsigned int)*v13 - 4, 0x8000LL); if ( v11 ) { open_json_object(0LL); print_string(1u, 0LL, "token ", 0LL); v3 = (const char *)format_host((unsigned char)*v9, (unsigned int)*v11 - 4, v11 + 2); v4 = ifa_family_color((unsigned char)*v9); print_color_string(4LL, v4, "token", "%s", v3); print_string(1u, 0LL, " dev ", 0LL); v5 = (const char *)ll_index_to_name(*(unsigned int *)(a1 + 20)); print_color_string(4LL, 0LL, "ifname", "%s\n", v5); close_json_object(4LL, 0LL); fflush(stream); return 0LL; } else { fprintf(stderr, "Seems there's no support for IPv6 token!\n"); return 0xFFFFFFFFLL; } }
static char * list_remove_pattern (list, pattern, patspec, itype, quoted) WORD_LIST *list; char *pattern; int patspec, itype, quoted; { WORD_LIST *new, *l; WORD_DESC *w; char *tword; for (new = (WORD_LIST *) ((void *)0) , l = list; l; l = l->next) { tword = remove_pattern (l->word->word, pattern, patspec); w = alloc_word_desc (); w->word = tword ? tword : (char *)strcpy (sh_xmalloc((1 + strlen ("")), "subst.c", 5789), ("")); new = make_word_list (w, new); } l = ((new && new->next) ? (WORD_LIST *)list_reverse ((GENERIC_LIST *)new) : (WORD_LIST *)(new)); tword = string_list_pos_params (itype, l, quoted, 0); dispose_words (l); return (tword); }
char * list_remove_pattern(long ***a1, _BYTE *a2, int a3, int a4, int a5) { size_t v5; char *v6; char *v7; long **v8; long **word_list; long **v15; char *v16; char *v17; char **v18; word_list = 0LL; while ( a1 ) { v16 = remove_pattern((char *)*a1[1], a2, a3); v18 = (char **)alloc_word_desc(); if ( v16 ) { v7 = v16; } else { v5 = strlen(&src); v6 = (char *)sh_xmalloc(v5 + 1, "subst.c", 5789LL); v7 = strcpy(v6, &src); } *v18 = v7; word_list = (long **)make_word_list(v18, word_list); a1 = (long ***)*a1; } if ( word_list && *word_list ) v8 = (long **)list_reverse(word_list); else v8 = word_list; v15 = v8; v17 = string_list_pos_params(a4, v8, a5, 0); dispose_words(v15); return v17; }
static int process_dir (char *dir, struct savewd *wd, void *options) { struct mkdir_options const *o = options; if (o->set_security_context) { if (! o->make_ancestor_function && defaultcon (o->set_security_context, dir, 0040000 ) < 0 && ! ignorable_ctx_err ( (*__errno_location ()) )) error (0, (*__errno_location ()) , gettext ("failed to set default creation context for %s"), quotearg_style (shell_escape_always_quoting_style, dir)); } int ret = (make_dir_parents (dir, wd, o->make_ancestor_function, options, o->mode, announce_mkdir, o->mode_bits, (uid_t) -1, (gid_t) -1, 1 ) ? 0 : 1 ); if (ret == 0 && o->set_security_context && o->make_ancestor_function) { if (! restorecon (o->set_security_context, last_component (dir), 0 ) && ! ignorable_ctx_err ( (*__errno_location ()) )) error (0, (*__errno_location ()) , gettext ("failed to restore context for %s"), quotearg_style (shell_escape_always_quoting_style, dir)); } return ret; }
long long process_dir(unsigned long long a0, unsigned long long a1, struct_0 *a2) { unsigned long long v0; unsigned int v1; unsigned long long v4; unsigned long long v6; unsigned long long v7; if (a2->field_18 && !a2->field_0 && defaultcon(a2->field_18, a0, 0x4000, a0) < 0 && (ignorable_ctx_err(*(__errno_location())) ^ 1)) { v4 = quotearg_style(0x4, a0); error(0x0, *(__errno_location()), gettext("failed to set default creation context for %s")); } v0 = 1; v1 = make_dir_parents(a0, a1, a2->field_0, a2, a2->field_10, announce_mkdir, a2->field_14, 0xffffffffffffffff, 0xffffffffffffffff) ^ 1; if (v1) { return v1; } else if (!a2->field_18) { return v1; } else if (!a2->field_0) { return v1; } else { v6 = last_component(a0); *(&v6) = restorecon(a2->field_18, v6, 0x0, v6) ^ 1; if (!v6) return v1; *(&v6) = ignorable_ctx_err(*(__errno_location())) ^ 1; if (v6) { v7 = quotearg_style(0x4, a0); error(0x0, *(__errno_location()), gettext("failed to restore context for %s")); return v1; } return v1; } }
static void perror_with_exit (char const *string) { ((!!sizeof (struct { _Static_assert (2, "verify_expr (" "2" ", " "(error (2, (*__errno_location ()), \"%s\", string), assume (false))" ")"); int _gl_dummy; })) ? ((error (2, (*__errno_location ()) , "%s", string), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (2, (*__errno_location ()) , "%s", string), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); }
void perror_with_exit(const char *a1) { int *v1; v1 = _errno_location(); error(2, *v1, "%s", a1); JUMPOUT(0x3455LL); }
static void usage(void) { const char **dflags; fprintf( stderr , "Usage:\n"); fprintf( stderr , " %s [options]\n", ProgramName); fprintf( stderr , "\n"); fprintf( stderr , "Options:\n"); fprintf( stderr , " -h print this message \n"); fprintf( stderr , " -i deamon runs without inotify support\n"); fprintf( stderr , " -m <comm> off, or specify preferred client for sending mails\n"); fprintf( stderr , " -n run in foreground\n"); fprintf( stderr , " -f run in foreground, the same as -n\n"); fprintf( stderr , " -p permit any crontab\n"); fprintf( stderr , " -P inherit PATH from environment instead of using default value"); fprintf( stderr , " of \"%s\"\n", "/usr/bin:/bin" ); fprintf( stderr , " -c enable clustering support\n"); fprintf( stderr , " -s log into syslog instead of sending mails\n"); fprintf( stderr , " -V print version and exit\n"); fprintf( stderr , " -x <flag> print debug information\n"); fprintf( stderr , "\n"); fprintf( stderr , "Debugging flags are: "); for (dflags = DebugFlagNames; *dflags; dflags++) fprintf( stderr , "%s%s", *dflags, dflags[1] ? "," : "\n"); exit(1); }
void usage() { unsigned long long v0; unsigned int v2; fprintf(stderr, "Usage:\n"); fprintf(stderr, " %s [options]\n", 283935560); fprintf(stderr, "\n"); fprintf(stderr, "Options:\n"); fprintf(stderr, " -h print this message \n"); fprintf(stderr, " -i deamon runs without inotify support\n"); fprintf(stderr, " -m <comm> off, or specify preferred client for sending mails\n"); fprintf(stderr, " -n run in foreground\n"); fprintf(stderr, " -f run in foreground, the same as -n\n"); fprintf(stderr, " -p permit any crontab\n"); fprintf(stderr, " -P inherit PATH from environment instead of using default value"); fprintf(stderr, " of \"%s\"\n", &g_401889); fprintf(stderr, " -c enable clustering support\n"); fprintf(stderr, " -s log into syslog instead of sending mails\n"); fprintf(stderr, " -V print version and exit\n"); fprintf(stderr, " -x <flag> print debug information\n"); fprintf(stderr, "\n"); fprintf(stderr, "Debugging flags are: "); for (v0 = &DebugFlagNames; *(v0); v0 += 8) { if (*((v0 + 8))) v2 = ","; else v2 = &g_401722; fprintf(stderr, "%s%s", *(v0), v2); } exit(0x1); }
static int cmp_size (struct fileinfo const *a, struct fileinfo const *b, int (*cmp) (char const *, char const *)) { int diff = off_cmp (b->stat.st_size, a->stat.st_size); return diff ? diff : cmp (a->name, b->name); }
void cmp_size(unsigned long long a0[10], unsigned long long a1[10], unsigned long long a2) { unsigned int v0; unsigned long long v2; unsigned long long v3; v0 = off_cmp(a1[9], a0[9]); if (v0) { v2 = v0; return; } v3 = (stack_base)[48](a0[0], a1[0], a1[0], a2); return; }
vi_end_word(EditLine *el, wint_t c __attribute__((__unused__))) { if (el->el_line.cursor == el->el_line.lastchar) return 6; el->el_line.cursor = cv__endword(el->el_line.cursor, el->el_line.lastchar, el->el_state.argument, cv__isword); if (el->el_chared.c_vcmd.action != 0x00) { el->el_line.cursor++; cv_delfini(el); return 4; } return 5; }
long long vi_end_word(struct_0 *a0, unsigned long a1) { unsigned int v0; unsigned long long v2; v0 = a1; if (a0->field_58 == a0->field_60) { v2 = 6; } else { a0->field_58 = cv__endword(a0->field_58, a0->field_60, a0->field_78, 0x500038); if (!a0->field_3c0) { v2 = 5; } else { a0->field_58 = a0->field_58 + 4; cv_delfini(a0); v2 = 4; } } return v2; }
static _Bool getseq (FILE *fp, struct seq *seq, int whichfile) { if (seq->count == seq->alloc) { seq->lines = ((!!sizeof (struct { _Static_assert (sizeof *(seq->lines) != 1, "verify_expr (" "sizeof *(seq->lines) != 1" ", " "x2nrealloc (seq->lines, &seq->alloc, sizeof *(seq->lines))" ")"); int _gl_dummy; })) ? (x2nrealloc (seq->lines, &seq->alloc, sizeof *(seq->lines))) : (x2nrealloc (seq->lines, &seq->alloc, sizeof *(seq->lines)))); for (size_t i = seq->count; i < seq->alloc; i++) seq->lines[i] = ((void *)0) ; } if (get_line (fp, &seq->lines[seq->count], whichfile)) { ++seq->count; return 1 ; } return 0 ; }
bool getseq(undefined8 param_1,ulong *param_2,undefined4 param_3) { char cVar1; ulong uVar2; ulong local_10; if (*param_2 == param_2[1]) { uVar2 = x2nrealloc(param_2[2],param_2 + 1,8); param_2[2] = uVar2; for (local_10 = *param_2; local_10 < param_2[1]; local_10 = local_10 + 1) { *(undefined8 *)(param_2[2] + local_10 * 8) = 0; } } cVar1 = get_line(param_1,param_2[2] + *param_2 * 8,param_3); if (cVar1 != '\0') { *param_2 = *param_2 + 1; } return cVar1 != '\0'; }
static const char * forcetype_str(enum forcetype type) { switch (type) { case FORCETYPE_DISABLED: return " "; case FORCETYPE_ENABLED: return "[*]"; case FORCETYPE_DAMAGE: return "[!]"; default: do_internerr("force.c", 60, __func__, "unknown force type '%d'", type); } }
int forcetype_str(unsigned long a0) { unsigned int v1; if (a0 != 2) { if (a0 <= 2) { if (!a0) v1 = &g_400750; if (a0 == 1) v1 = &g_400754; } if (a0 > 2 || a0 != 1 && a0) v1 = do_internerr("force.c", 0x3c, "forcetype_str", "unknown force type '%d'", a0); } else { v1 = &g_400758; } return v1; }
int main (int argc, char **argv) { int optc = 0; _Bool posixly_correct = (getenv ("POSIXLY_CORRECT") != ((void *)0) ); enum Skip_field_option_type skip_field_option_type = SFO_NONE; unsigned int nfiles = 0; char const *file[2]; char delimiter = '\n'; _Bool output_option_used = 0 ; file[0] = file[1] = "-"; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdout); skip_chars = 0; skip_fields = 0; check_chars = (18446744073709551615UL) ; output_unique = output_first_repeated = 1 ; output_later_repeated = 0 ; countmode = count_none; delimit_groups = DM_NONE; while ( 1 ) { if (optc == -1 || (posixly_correct && nfiles != 0) || ((optc = getopt_long (argc, argv, "-0123456789Dcdf:is:uw:z", longopts, ((void *)0) )) == -1)) { if (argc <= optind) break; if (nfiles == 2) { error (0, 0, gettext ("extra operand %s"), quote (argv[optind])); usage ( 1 ); } file[nfiles++] = argv[optind++]; } else switch (optc) { case 1: { uintmax_t size; if (optarg[0] == '+' && ! strict_posix2 () && xstrtoumax (optarg, ((void *)0) , 10, &size, "") == LONGINT_OK && size <= (18446744073709551615UL) ) skip_chars = size; else if (nfiles == 2) { error (0, 0, gettext ("extra operand %s"), quote (optarg)); usage ( 1 ); } else file[nfiles++] = optarg; } break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { if (skip_field_option_type == SFO_NEW) skip_fields = 0; if (!( (void) (&(skip_fields) == (size_t *) ((void *)0) ), ((!!sizeof (struct { _Static_assert (! (! ((size_t) 0 < (size_t) -1)), "verify_expr (" "! TYPE_SIGNED (size_t)" ", " "(((size_t) -1 / 10 < (skip_fields) || (size_t) ((skip_fields) * 10 + (optc - '0')) < (skip_fields)) ? false : (((skip_fields) = (skip_fields) * 10 + (optc - '0')), true))" ")"); int _gl_dummy; })) ? ((((size_t) -1 / 10 < (skip_fields) || (size_t) ((skip_fields) * 10 + (optc - '0')) < (skip_fields)) ? 0 : (((skip_fields) = (skip_fields) * 10 + (optc - '0')), 1 ))) : ((((size_t) -1 / 10 < (skip_fields) || (size_t) ((skip_fields) * 10 + (optc - '0')) < (skip_fields)) ? 0 : (((skip_fields) = (skip_fields) * 10 + (optc - '0')), 1 )))) )) skip_fields = (18446744073709551615UL) ; skip_field_option_type = SFO_OBSOLETE; } break; case 'c': countmode = count_occurrences; output_option_used = 1 ; break; case 'd': output_unique = 0 ; output_option_used = 1 ; break; case 'D': output_unique = 0 ; output_later_repeated = 1 ; if (optarg == ((void *)0) ) delimit_groups = DM_NONE; else delimit_groups = ((delimit_method_map) [__xargmatch_internal ("--all-repeated", optarg, delimit_method_string, (void const *) (delimit_method_map), sizeof *(delimit_method_map), argmatch_die, 1 )]) ; output_option_used = 1 ; break; case GROUP_OPTION: if (optarg == ((void *)0) ) grouping = GM_SEPARATE; else grouping = ((grouping_method_map) [__xargmatch_internal ("--group", optarg, grouping_method_string, (void const *) (grouping_method_map), sizeof *(grouping_method_map), argmatch_die, 1 )]) ; break; case 'f': skip_field_option_type = SFO_NEW; skip_fields = size_opt (optarg, "invalid number of fields to skip"); break; case 'i': ignore_case = 1 ; break; case 's': skip_chars = size_opt (optarg, "invalid number of bytes to skip"); break; case 'u': output_first_repeated = 0 ; output_option_used = 1 ; break; case 'w': check_chars = size_opt (optarg, "invalid number of bytes to compare"); break; case 'z': delimiter = '\0'; break; case GETOPT_HELP_CHAR: usage ( 0 ); break;; case GETOPT_VERSION_CHAR: version_etc ( stdout , "uniq", "GNU coreutils", Version, ("Richard M. Stallman"), ("David MacKenzie"), (char *) ((void *)0) ); exit ( 0 ); break;; default: usage ( 1 ); } } if (grouping != GM_NONE && output_option_used) { error (0, 0, gettext ("--group is mutually exclusive with -c/-d/-D/-u")); usage ( 1 ); } if (grouping != GM_NONE && countmode != count_none) { error (0, 0, gettext ("grouping and printing repeat counts is meaningless")); usage ( 1 ); } if (countmode == count_occurrences && output_later_repeated) { error (0, 0, gettext ("printing all duplicated lines and repeat counts is meaningless")); usage ( 1 ); } check_file (file[0], file[1], delimiter); return 0 ; }
int main(unsigned long a0, unsigned long long *a1) { unsigned long long v0; int tmp_34; int tmp_7; char v1; char v2; char v3; unsigned int v4; unsigned int v5; unsigned int v6; char v7; unsigned long long v8; unsigned long long v9; char v11; unsigned long long v12; char v15; unsigned long long v16; unsigned long long v17; v4 = 0; v3 = getenv("POSIXLY_CORRECT"); v5 = 0; v6 = 0; v1 = 10; v2 = 0; v9 = "-"; v8 = v9; set_program_name(*(a1)); setlocale(0x6, &g_401733); bindtextdomain("coreutils", "/usr/local/share/locale"); textdomain("coreutils"); atexit(got.close_stdout); skip_chars = 0; skip_fields = 0; check_chars = -1; output_first_repeated = 1; output_unique = output_first_repeated; output_later_repeated = 0; countmode = 1; delimit_groups = 0; while (true) { if (v4 != -1 && (!v3 || !v6)) { v4 = getopt_long(a0, a1, "-0123456789Dcdf:is:uw:z", &longopts, NULL); if (v4 != -1 && v4 <= 128) { if (v4 >= 48) { switch (v4) { case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: if (v5 == 2) skip_fields = 0; if (skip_fields <= 1844674407370955161 && ((skip_fields << 2) + skip_fields << 1) + v4 - 48 >= skip_fields) { skip_fields = v4 - 48 + skip_fields * 10; v15 = 0; } if (((skip_fields << 2) + skip_fields << 1) + v4 - 48 < skip_fields || skip_fields > 1844674407370955161) v15 = 1; if (v15) skip_fields = -1; v5 = 1; break; case 68: output_unique = 0; output_later_repeated = 1; if (!*(&optarg)) { delimit_groups = 0; } else { v0 = 1; delimit_groups = *((4 * __xargmatch_internal("--all-repeated", *(&optarg), &delimit_method_string, &delimit_method_map, 0x4, *(&argmatch_die)) + &delimit_method_map)); } v2 = 1; break; case 99: countmode = 0; v2 = 1; break; case 100: output_unique = 0; v2 = 1; break; case 102: v5 = 2; skip_fields = size_opt(*(&optarg), "invalid number of fields to skip"); break; case 105: ignore_case = 1; break; case 115: skip_chars = size_opt(*(&optarg), "invalid number of bytes to skip"); break; case 117: output_first_repeated = 0; v2 = 1; break; case 119: check_chars = size_opt(*(&optarg), "invalid number of bytes to compare"); break; case 122: v1 = 0; break; case 128: if (!*(&optarg)) { grouping = 3; break; } else { v0 = 1; grouping = *((4 * __xargmatch_internal("--group", *(&optarg), &grouping_method_string, &grouping_method_map, 0x4, *(&argmatch_die)) + &grouping_method_map)); break; } default: usage(0x1); } } else if (v4 != 1) { if (v4 <= 1) { if (v4 == -131) { v0 = 0; version_etc(stdout, "uniq", "GNU coreutils", Version, "Richard M. Stallman", "David MacKenzie"); exit(0x0); } if (v4 == -130) usage(0x0); } } else { if (*(*(&optarg)) == 43) { v11 = strict_posix2() ^ 1; if (v11) { v12 = xstrtoumax(*(&optarg), 0x0, 0xa, &v7, &g_401733); if (!v12) skip_chars = *(&v7); } } } } } if (a0 > optind && (v4 == -1 || v4 == -1 || v3) && (v4 == -1 || v4 == -1 || v6)) { if (v6 == 2) { v16 = quote(a1[optind]); error(0x0, 0x0, gettext("extra operand %s")); usage(0x1); } optind = optind + 1; tmp_34 = v6; v6 += 1; (&v8)[tmp_34] = a1[optind]; } if (a0 <= optind && (v4 == -1 || v4 == -1 || v3) && (v4 == -1 || v4 == -1 || v6)) { if (grouping && v2) { error(0x0, 0x0, gettext("--group is mutually exclusive with -c/-d/-D/-u")); usage(0x1); } if (!v2 || !grouping) { if (grouping && countmode != 1) { error(0x0, 0x0, gettext("grouping and printing repeat counts is meaningless")); usage(0x1); } if (countmode == 1 || !grouping) { if (!countmode && output_later_repeated) { error(0x0, 0x0, gettext("printing all duplicated lines and repeat counts is meaningless")); usage(0x1); } if (!output_later_repeated || countmode) { check_file(v8, v9, v1); break; } } } } if (v4 == 1 && v4 <= 128 && v4 < 48 && v4 != -1 && *(*(&optarg)) != 43 && v4 != -1 && (!v3 || !v6) || v4 == 1 && v4 <= 128 && *(*(&optarg)) == 43 && !v11 && v4 < 48 && v4 != -1 && v4 != -1 && (!v3 || !v6) || v4 == 1 && v4 <= 128 && *(*(&optarg)) == 43 && v4 < 48 && v4 != -1 && v11 && v12 && v4 != -1 && (!v3 || !v6)) { if (v6 == 2) { v17 = quote(*(&optarg)); error(0x0, 0x0, gettext("extra operand %s")); usage(0x1); } tmp_7 = v6; v6 += 1; (&v8)[tmp_7] = *(&optarg); } } return 0; }
Channel * channel_new(struct ssh *ssh, char *ctype, int type, int rfd, int wfd, int efd, u_int window, u_int maxpack, int extusage, const char *remote_name, int nonblock) { struct ssh_channels *sc = ssh->chanctxt; u_int i, found = 0; Channel *c; int r; for (i = 0; i < sc->channels_alloc; i++) { if (sc->channels[i] == ((void *)0) ) { found = i; break; } } if (i >= sc->channels_alloc) { found = sc->channels_alloc; if (sc->channels_alloc > (16*1024)) sshfatal("channels.c", __func__, 391, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "internal error: channels_alloc %d too big", sc->channels_alloc) ; sc->channels = xrecallocarray(sc->channels, sc->channels_alloc, sc->channels_alloc + 10, sizeof(*sc->channels)); sc->channels_alloc += 10; sshlog("channels.c", __func__, 396, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "channel: expanding %d", sc->channels_alloc); } c = sc->channels[found] = xcalloc(1, sizeof(Channel)); if ((c->input = sshbuf_new()) == ((void *)0) || (c->output = sshbuf_new()) == ((void *)0) || (c->extended = sshbuf_new()) == ((void *)0) ) sshfatal("channels.c", __func__, 403, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); if ((r = sshbuf_set_max_size(c->input, (16*1024*1024))) != 0) sshfatal("channels.c", __func__, 405, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "sshbuf_set_max_size"); c->ostate = 0; c->istate = 0; channel_register_fds(ssh, c, rfd, wfd, efd, extusage, nonblock, 0); c->self = found; c->type = type; c->ctype = ctype; c->local_window = window; c->local_window_max = window; c->local_maxpacket = maxpack; c->remote_name = xstrdup(remote_name); c->ctl_chan = -1; c->delayed = 1; do { (&c->status_confirms)->tqh_first = ((void *)0) ; (&c->status_confirms)->tqh_last = &(&c->status_confirms)->tqh_first; } while (0); sshlog("channels.c", __func__, 419, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "channel %d: new [%s]", found, remote_name); return c; }
int channel_new(struct_0 *a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5, unsigned int v11, unsigned int a6, unsigned int a7, unsigned long long a8, unsigned int a9) { unsigned long long v0; unsigned long v1; unsigned int v2; unsigned int v3; unsigned int v4; struct_2 *v5; unsigned long long v6; unsigned long v7; unsigned long long v8; void* v9; char v10; unsigned long long *v12; v5 = a0->field_868; v3 = 0; for (v2 = 0; v2 < v5->field_8; v2 += 1) { if (!*((v5->field_0 + (v2 << 3)))) { v3 = v2; break; } } if (v2 >= v5->field_8) { v3 = v5->field_8; if (v5->field_8 > 0x4000) { v1 = v5->field_8; v0 = "internal error: channels_alloc %d too big"; sshfatal("channels.c", "channel_new", 0x187, 0x1, 0x1, 0x0); } v5->field_0 = xrecallocarray(v5->field_0, v5->field_8, v5->field_8 + 10, 0x8); v5->field_8 = v5->field_8 + 10; v9 = v5->field_8; v8 = "channel: expanding %d"; sshlog("channels.c", "channel_new", 0x18c, 0x0, 0x6, 0x0, *(&v10)); } v12 = v5->field_0 + v3 * 8; *((v5->field_0 + v3 * 8)) = xcalloc(0x1, 0x160); v6 = *(v12); v6->field_68 = sshbuf_new(0x1, 0x160, 0x18c, 0x0, 0x6, 0x0); if (v6->field_68) { v6->field_70 = sshbuf_new(0x1, 0x160, v6, 0x0, 0x6, 0x0); if (v6->field_70) v6->field_78 = sshbuf_new(0x1, 0x160, v6, 0x0, 0x6, 0x0); } if (!v6->field_70 || !v6->field_68 || !v6->field_78) { v8 = "sshbuf_new failed"; sshfatal("channels.c", "channel_new", 0x193, 0x1, 0x1, 0x0); } v4 = sshbuf_set_max_size(v6->field_68, 0x1000000); if (v4) { v8 = "sshbuf_set_max_size"; sshfatal("channels.c", "channel_new", 0x195, 0x1, 0x1, ssh_err(v4)); } v6->field_14 = 0; v6->field_10 = 0; v9 = 0; v8 = a9; channel_register_fds(a0, v6, a3, a4, a5, a7, *(&v10), v11); v6->field_4 = v3; v6->field_0 = a2; v6->field_c8 = a1; v6->field_b0 = v11; v6->field_b4 = v11; v6->field_bc = a6; v6->field_a0 = xstrdup(a8); v6->field_44 = -1; v6->field_60 = 1; v6->field_f0 = 0; v6->field_f8 = &v6->field_f0; v8 = a8; v7 = v3; v6 = "channel %d: new [%s]"; sshlog("channels.c", "channel_new", 0x1a3, 0x0, 0x5, 0x0, *(&v10)); return v6; }
static void refcount_collapse(ext2_refcount_t refcount) { unsigned int i, j; struct ea_refcount_el *list; list = refcount->list; for (i = 0, j = 0; i < refcount->count; i++) { if (list[i].ea_value) { if (i != j) list[j] = list[i]; j++; } } refcount->count = j; }
void refcount_collapse(unsigned long long a0[4]) { unsigned int v0; unsigned int v1; unsigned long long *v2; unsigned long long v4; unsigned long long v5[4]; v2 = a0[3]; v0 = 0; for (v1 = 0; v0 < a0[0]; v0 += 1) { if (v2[1 + 2 * v0]) { if (v0 != v1) { v4 = v2[1 + 2 * v0]; v2[2 * v1] = v2[2 * v0]; v2[1 + 2 * v1] = v4; } v1 += 1; } } v5 = a0; a0[0] = v1; return; }
u_int cipher_authlen(const struct sshcipher *c) { return (c->auth_len); }
undefined4 cipher_authlen(long param_1) { return *(undefined4 *)(param_1 + 0x14); }
static void print_explain(FILE *f) { fprintf(f, "Usage: ... geneve id VNI\n" " remote ADDR\n" " [ ttl TTL ]\n" " [ tos TOS ]\n" " [ df DF ]\n" " [ flowlabel LABEL ]\n" " [ dstport PORT ]\n" " [ [no]external ]\n" " [ [no]udpcsum ]\n" " [ [no]udp6zerocsumtx ]\n" " [ [no]udp6zerocsumrx ]\n" " [ innerprotoinherit ]\n" "\n" "Where: VNI := 0-16777215\n" " ADDR := IP_ADDRESS\n" " TOS := { NUMBER | inherit }\n" " TTL := { 1..255 | auto | inherit }\n" " DF := { unset | set | inherit }\n" " LABEL := 0-1048575\n" ); }
void print_explain(FILE *param_1) { fprintf(param_1, "Usage: ... geneve id VNI\n\t\tremote ADDR\n\t\t[ ttl TTL ]\n\t\t[ tos TOS ]\n\t\t[ df DF ]\n\t\t[ flowlabel LABEL ]\n\t\t[ dstport PORT ]\n\t\t[ [no]external ]\n\t\t[ [no]udpcsum ]\n\t\t[ [no]udp6zerocsumtx ]\n\t\t[ [no]udp6zerocsumrx ]\n\t\t[ innerprotoinherit ]\n\nWhere:\tVNI := 0-16777215\n\tADDR := IP_ADDRESS\n\tTOS := { NUMBER | inherit }\n\tTTL := { 1..255 | auto | inherit }\n\tDF := { unset | set | inherit }\n\tLABEL := 0-1048575\n" ); return; }
static void lf_skip (struct line_filter *lf, lin lines) { while (lines) { lf->bufpos = rawmemchr (lf->bufpos, '\n'); if (lf->bufpos == lf->buflim) { if (! lf_refill (lf)) break; } else { --lines; ++lf->bufpos; } } }
void lf_skip(long a1, long a2) { while ( a2 ) { *(_QWORD *)(a1 + 8) = rawmemchr(*(const void **)(a1 + 8), 10); if ( *(_QWORD *)(a1 + 8) == *(_QWORD *)(a1 + 24) ) { if ( !lf_refill(a1) ) return; } else { --a2; ++*(_QWORD *)(a1 + 8); } } }
static _Bool binop (char const *s) { return (((strcmp (s, "=") == 0)) || ((strcmp (s, "!=") == 0)) || ((strcmp (s, "==") == 0)) || ((strcmp (s, "-nt") == 0)) || ((strcmp (s, "-ot") == 0)) || ((strcmp (s, "-ef") == 0)) || ((strcmp (s, "-eq") == 0)) || ((strcmp (s, "-ne") == 0)) || ((strcmp (s, "-lt") == 0)) || ((strcmp (s, "-le") == 0)) || ((strcmp (s, "-gt") == 0)) || ((strcmp (s, "-ge") == 0))); }
int binop(char *a0) { unsigned int v1; unsigned int v2; if (!strcmp(a0, "=")) { LABEL_400721: v1 = 1; } else { if (!strcmp(a0, "!=")) goto LABEL_400721; if (!strcmp(a0, "==")) goto LABEL_400721; if (!strcmp(a0, "-nt")) goto LABEL_400721; if (!strcmp(a0, "-ot")) goto LABEL_400721; if (!strcmp(a0, "-ef")) goto LABEL_400721; if (!strcmp(a0, "-eq")) goto LABEL_400721; if (!strcmp(a0, "-ne")) goto LABEL_400721; if (!strcmp(a0, "-lt")) goto LABEL_400721; if (!strcmp(a0, "-le")) goto LABEL_400721; if (!strcmp(a0, "-gt")) goto LABEL_400721; if (!strcmp(a0, "-ge")) goto LABEL_400721; v1 = 0; } v2 = v1 & 1; return v2; }
static char * scanleft( char *startp, char *rmesc, char *rmescend, char *str, int quotes, int zero ) { char *loc; char *loc2; char c; loc = startp; loc2 = rmesc; do { int match; const char *s = loc2; c = *loc2; if (zero) { *loc2 = '\0'; s = rmesc; } match = !fnmatch((str), (s), 0); *loc2 = c; if (match) return loc; if (quotes && *loc == (char)-127) loc++; loc++; loc2++; } while (c); return 0; }
long long scanleft(unsigned long long a0, char *a1, unsigned long a2, char *a3, unsigned long a4, unsigned long a5) { unsigned long v0; char v1; unsigned int v2; void* v3; char *v4; char *v5; void* v7; v0 = a2; v3 = a0; v4 = a1; do { v5 = v4; v1 = *(v4); if (a5) { *(v4) = 0; v5 = a1; } v2 = !fnmatch(a3, v5, 0x0); *(v4) = v1; if (v2) { v7 = v3; goto LABEL_400d21; } if (a4 && *(v3) == 129) v3 += 1; v3 += 1; v4 += 1; } while (v1); v7 = 0; LABEL_400d21: return v7; }
static void signal_progress_on(int sig __attribute__((unused))) { e2fsck_t ctx = e2fsck_global_ctx; if (!ctx) return; ctx->progress = e2fsck_update_progress; }
void signal_progress_on(void) { if (e2fsck_global_ctx != 0) { *(code **)(e2fsck_global_ctx + 0x160) = e2fsck_update_progress; } return; }
int rl_vi_insert_beg (int count, int key) { rl_beg_of_line (1, key); rl_vi_insert_mode (1, key); return (0); }
undefined8 rl_vi_insert_beg(undefined8 param_1,undefined4 param_2) { rl_beg_of_line(1,param_2); rl_vi_insert_mode(1,param_2); return 0; }
int tnl_add_ioctl(int cmd, const char *basedev, const char *name, void *p) { struct ifreq ifr; int fd; int err; if (cmd == ( 0x89F0 + 3) && name[0]) strlcpy(ifr.ifr_ifrn.ifrn_name, name, 16); else strlcpy(ifr.ifr_ifrn.ifrn_name, basedev, 16); ifr.ifr_ifru.ifru_data = p; fd = socket(preferred_family, SOCK_DGRAM , 0); if (fd < 0) { fprintf( stderr , "create socket failed: %s\n", strerror( (*__errno_location ()) )); return -1; } err = ioctl(fd, cmd, &ifr); if (err) fprintf( stderr , "add tunnel \"%s\" failed: %s\n", ifr.ifr_ifrn.ifrn_name, strerror( (*__errno_location ()) )); close(fd); return err; }
long long tnl_add_ioctl(unsigned long a0, unsigned long long a1, char *a2, unsigned long a3) { unsigned int v0; unsigned int v1; char v2; unsigned long v3; unsigned long long v5; if (a0 == 35315 && *(a2)) { strlcpy(&v2, a2, 0x10, a2); goto LABEL_4002fe; } strlcpy(&v2, a1, 0x10, a1); LABEL_4002fe: v3 = a3; v0 = socket(preferred_family, 0x2, 0x0); if (v0 < 0) { fprintf(*(&stderr), "create socket failed: %s\n", strerror(*(__errno_location()))); v5 = 4294967295; } else { v1 = ioctl(v0, a0); if (v1) fprintf(*(&stderr), "add tunnel \"%s\" failed: %s\n", &v2, strerror(*(__errno_location()))); close(v0); v5 = v1; } return v5; }
int sshsig_check_allowed_keys(const char *path, const struct sshkey *sign_key, const char *principal, const char *sig_namespace, uint64_t verify_time) { FILE *f = ((void *)0) ; char *line = ((void *)0) ; size_t linesize = 0; u_long linenum = 0; int r = -1, oerrno; if ((f = fopen(path, "r")) == ((void *)0) ) { oerrno = (*__errno_location ()) ; sshlog("sshsig.c", __func__, 985, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Unable to open allowed keys file \"%s\": %s", path, strerror( (*__errno_location ()) )) ; (*__errno_location ()) = oerrno; return -24; } while (getline(&line, &linesize, f) != -1) { linenum++; r = check_allowed_keys_line(path, linenum, line, sign_key, principal, sig_namespace, verify_time, ((void *)0) ); free(line); line = ((void *)0) ; linesize = 0; if (r == -46) continue; else if (r == 0) { fclose(f); return 0; } else break; } fclose(f); free(line); return r == 0 ? -46 : r; }
long long sshsig_check_allowed_keys(char *a0, void* a1, unsigned long long a2, unsigned long long a3, unsigned long long a4) { unsigned long long v0; unsigned long v1; unsigned int v2; unsigned int v3; void* v4; void* v5; void* v6; void* v7; unsigned long long v9; unsigned long long v10; v7 = 0; v4 = 0; v5 = 0; v6 = 0; v2 = -1; v7 = fopen(a0, "r"); if (!v7) { v3 = *(__errno_location()); strerror(*(__errno_location())); v1 = a0; v0 = "Unable to open allowed keys file \"%s\": %s"; sshlog("sshsig.c", "sshsig_check_allowed_keys", 0x3d9, 0x0, 0x2, 0x0); *(__errno_location()) = v3; v10 = 4294967272; } else { while (true) { v9 = getline(&v4, &v5, v7); if (v9 != -1) { v6 += 1; v2 = check_allowed_keys_line(a0, v6, v4, a1, a2, a3, a4, 0x0); free(v4); v4 = 0; v5 = 0; if (v2 == -46) continue; if (!v2) { fclose(v7); v10 = 0; break; } } if (v9 == -1 || v2 != -46 && v2) { fclose(v7); free(v4); if (v2) { v10 = v2; break; } else { v10 = 4294967250; break; } } } } return v10; }
static int ssh_keysign(struct ssh *ssh, struct sshkey *key, u_char **sigp, size_t *lenp, const u_char *data, size_t datalen) { struct sshbuf *b; struct stat st; pid_t pid; int r, to[2], from[2], status; int sock = ssh_packet_get_connection_in(ssh); u_char rversion = 0, version = 2; void (*osigchld)(int); *sigp = ((void *)0) ; *lenp = 0; if (stat("/usr/local/libexec/ssh-keysign", &st) == -1) { sshlog("sshconnect2.c", __func__, 2059, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "not installed: %s", strerror( (*__errno_location ()) )); return -1; } if (fflush( stdout ) != 0) { sshlog("sshconnect2.c", __func__, 2063, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "fflush: %s", strerror( (*__errno_location ()) )); return -1; } if (pipe(to) == -1) { sshlog("sshconnect2.c", __func__, 2067, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "pipe: %s", strerror( (*__errno_location ()) )); return -1; } if (pipe(from) == -1) { sshlog("sshconnect2.c", __func__, 2071, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "pipe: %s", strerror( (*__errno_location ()) )); return -1; } if ((pid = fork()) == -1) { sshlog("sshconnect2.c", __func__, 2075, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "fork: %s", strerror( (*__errno_location ()) )); return -1; } osigchld = ssh_signal( 17 , ((__sighandler_t) 0) ); if (pid == 0) { close(from[0]); if (dup2(from[1], 1 ) == -1) sshfatal("sshconnect2.c", __func__, 2082, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "dup2: %s", strerror( (*__errno_location ()) )); close(to[1]); if (dup2(to[0], 0 ) == -1) sshfatal("sshconnect2.c", __func__, 2085, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "dup2: %s", strerror( (*__errno_location ()) )); close(from[1]); close(to[0]); if (dup2(sock, 2 + 1) == -1) sshfatal("sshconnect2.c", __func__, 2090, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "dup2: %s", strerror( (*__errno_location ()) )); sock = 2 + 1; fcntl(sock, 2 , 0); closefrom(sock + 1); sshlog("sshconnect2.c", __func__, 2095, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "[child] pid=%ld, exec %s", (long)getpid(), "/usr/local/libexec/ssh-keysign") ; execl("/usr/local/libexec/ssh-keysign", "/usr/local/libexec/ssh-keysign", (char *) ((void *)0) ); sshfatal("sshconnect2.c", __func__, 2098, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "exec(%s): %s", "/usr/local/libexec/ssh-keysign", strerror( (*__errno_location ()) )) ; } close(from[1]); close(to[0]); sock = 2 + 1; if ((b = sshbuf_new()) == ((void *)0) ) sshfatal("sshconnect2.c", __func__, 2106, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); if ((r = sshbuf_put_u32(b, sock)) != 0 || (r = sshbuf_put_string(b, data, datalen)) != 0) sshfatal("sshconnect2.c", __func__, 2110, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "buffer error"); if (ssh_msg_send(to[1], version, b) == -1) sshfatal("sshconnect2.c", __func__, 2112, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "couldn't send request"); sshbuf_reset(b); r = ssh_msg_recv(from[0], b); close(from[0]); close(to[1]); if (r < 0) { sshlog("sshconnect2.c", __func__, 2118, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "no reply"); goto fail; } (*__errno_location ()) = 0; while (waitpid(pid, &status, 0) == -1) { if ( (*__errno_location ()) != 4 ) { sshlog("sshconnect2.c", __func__, 2125, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "waitpid %ld: %s", (long)pid, strerror( (*__errno_location ()) )); goto fail; } } if (! ((( status ) & 0x7f) == 0) ) { sshlog("sshconnect2.c", __func__, 2130, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "exited abnormally"); goto fail; } if ( ((( status ) & 0xff00) >> 8) != 0) { sshlog("sshconnect2.c", __func__, 2134, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "exited with status %d", ((( status ) & 0xff00) >> 8) ); goto fail; } if ((r = sshbuf_get_u8(b, &rversion)) != 0) { sshlog("sshconnect2.c", __func__, 2138, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "buffer error"); goto fail; } if (rversion != version) { sshlog("sshconnect2.c", __func__, 2142, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "bad version"); goto fail; } if ((r = sshbuf_get_string(b, sigp, lenp)) != 0) { sshlog("sshconnect2.c", __func__, 2146, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "buffer error"); fail: ssh_signal( 17 , osigchld); sshbuf_free(b); return -1; } ssh_signal( 17 , osigchld); sshbuf_free(b); return 0; }
int ssh_keysign(unsigned long long a0, unsigned long long a1, unsigned long long *a2, unsigned long long *a3, unsigned long long a4, unsigned long long a5) { unsigned long v0; unsigned long v1; char v2; char v3; char v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned long long v8; unsigned long long v9; char v10; char v11; char v12; char v13; char v14; unsigned long long v15; unsigned long v16; unsigned long long v17; unsigned long v18; char v19; unsigned int v21; unsigned int v25; v1 = a1; v6 = ssh_packet_get_connection_in(a0); v2 = 0; v3 = 2; *(a2) = 0; *(a3) = 0; v21 = stat("/usr/local/libexec/ssh-keysign", &v14); if (v21 == -1) { v0 = strerror(*(__errno_location())); sshlog("sshconnect2.c", "ssh_keysign", 0x80b, 0x1, 0x2, 0x0, "not installed: %s"); v21 = -1; } else { v21 = fflush(stdout); if (v21) { v0 = strerror(*(__errno_location())); sshlog("sshconnect2.c", "ssh_keysign", 0x80f, 0x1, 0x2, 0x0, "fflush: %s"); v21 = -1; } else { v21 = pipe(&v10); if (v21 == -1) { v0 = strerror(*(__errno_location())); sshlog("sshconnect2.c", "ssh_keysign", 0x813, 0x1, 0x2, 0x0, "pipe: %s"); v21 = -1; } else { v21 = pipe(&v12); if (v21 == -1) { v0 = strerror(*(__errno_location())); sshlog("sshconnect2.c", "ssh_keysign", 0x817, 0x1, 0x2, 0x0, "pipe: %s"); v21 = -1; } else { v7 = fork(); if (v7 == -1) { v0 = strerror(*(__errno_location())); sshlog("sshconnect2.c", "ssh_keysign", 0x81b, 0x1, 0x2, 0x0, "fork: %s"); v21 = -1; } else { v8 = ssh_signal(0x11, 0x0); if (!v7) { close(*(&v12)); if (dup2(*(&v13), 0x1) == -1) { v0 = strerror(*(__errno_location())); sshfatal("sshconnect2.c", "ssh_keysign", 0x822, 0x1, 0x1, 0x0); } close(*(&v11)); if (dup2(*(&v10), 0x0) == -1) { v18 = strerror(*(__errno_location())); v17 = "dup2: %s"; sshfatal("sshconnect2.c", "ssh_keysign", 0x825, 0x1, 0x1, 0x0); } close(*(&v13)); close(*(&v10)); if (dup2(v6, 0x3) == -1) { v18 = strerror(*(__errno_location())); v17 = "dup2: %s"; sshfatal("sshconnect2.c", "ssh_keysign", 0x82a, 0x1, 0x1, 0x0); } v6 = 3; fcntl(v6, 0x2); closefrom(__addvsi3(v6, 0x1)); v17 = "/usr/local/libexec/ssh-keysign"; v16 = getpid(); v15 = "[child] pid=%ld, exec %s"; sshlog("sshconnect2.c", "ssh_keysign", 0x82f, 0x1, 0x7, 0x0, *(&v19)); execl("/usr/local/libexec/ssh-keysign", "/usr/local/libexec/ssh-keysign"); v17 = strerror(*(__errno_location())); v16 = "/usr/local/libexec/ssh-keysign"; v15 = "exec(%s): %s"; sshfatal("sshconnect2.c", "ssh_keysign", 0x832, 0x1, 0x1, 0x0); } close(*(&v13)); v25 = *(&v10); close(*(&v10)); v6 = 3; *(&v9) = sshbuf_new(reg_72, a1, 0x832, 0x1, 0x1, 0x0); if (!v9) { v17 = "sshbuf_new failed"; sshfatal("sshconnect2.c", "ssh_keysign", 0x83a, 0x1, 0x1, 0x0); } v5 = sshbuf_put_u32(v9, v6, v6); if (!v5) v5 = sshbuf_put_string(v9, a4, a5, a4); if (v5 || v5) { v17 = "buffer error"; sshfatal("sshconnect2.c", "ssh_keysign", 0x83e, 0x1, 0x1, ssh_err(v5)); } v21 = ssh_msg_send(*(&v11), v3, v9, v3); if (v21 == -1) { v17 = "couldn't send request"; sshfatal("sshconnect2.c", "ssh_keysign", 0x840, 0x1, 0x1, 0x0); } sshbuf_reset(v9); v5 = ssh_msg_recv(*(&v12), v9, v9); close(*(&v12)); close(*(&v11)); if (v5 < 0) { v17 = "no reply"; sshlog("sshconnect2.c", "ssh_keysign", 0x846, 0x1, 0x2, 0x0, *(&v19)); } else { *(__errno_location()) = 0; while (true) { v21 = waitpid(v7, &v4, 0x0); if (v21 == -1) { v21 = *(__errno_location()); if (v21 == 4) continue; v17 = strerror(*(__errno_location())); v16 = v7; v15 = "waitpid %ld: %s"; sshlog("sshconnect2.c", "ssh_keysign", 0x84d, 0x1, 0x2, 0x0, *(&v19)); break; } else if ((*(&v4) & 127)) { v17 = "exited abnormally"; sshlog("sshconnect2.c", "ssh_keysign", 0x852, 0x1, 0x2, 0x0, *(&v19)); break; } else if ((*(&v4) >> 8)) { v18 = *(&v4) >> 8; v17 = "exited with status %d"; sshlog("sshconnect2.c", "ssh_keysign", 0x856, 0x1, 0x2, 0x0, *(&v19)); break; } else { v5 = sshbuf_get_u8(v9, &v2, &v2); if (v5) { v17 = "buffer error"; sshlog("sshconnect2.c", "ssh_keysign", 0x85a, 0x1, 0x2, ssh_err(v5), *(&v19)); break; } else if (v3 != v2) { v17 = "bad version"; sshlog("sshconnect2.c", "ssh_keysign", 0x85e, 0x1, 0x2, 0x0, *(&v19)); break; } else { v5 = sshbuf_get_string(v9, a2, a3, a2); if (v5) { v17 = "buffer error"; sshlog("sshconnect2.c", "ssh_keysign", 0x862, 0x1, 0x2, ssh_err(v5), *(&v19)); break; } else { ssh_signal(0x11, v8); sshbuf_free(v9); v21 = 0; break; } } } } } if (v5 < 0 || v21 == -1 || v3 != v2 || v5 || (*(&v4) & 127) || v5 || (*(&v4) >> 8)) { ssh_signal(0x11, v8); sshbuf_free(v9); v21 = -1; } } } } } } return v21; }
static IF_COM * copy_if_command (com) IF_COM *com; { IF_COM *new_if; new_if = (IF_COM *)sh_xmalloc((sizeof (IF_COM)), "copy_cmd.c", 282); new_if->flags = com->flags; new_if->test = copy_command (com->test); new_if->true_case = copy_command (com->true_case); new_if->false_case = com->false_case ? copy_command (com->false_case) : com->false_case; return (new_if); }
long copy_if_command(long a1) { long v1; long v3; v3 = sh_xmalloc(32LL, "copy_cmd.c", 282LL); *(_DWORD *)v3 = *(_DWORD *)a1; *(_QWORD *)(v3 + 8) = copy_command(*(_QWORD *)(a1 + 8)); *(_QWORD *)(v3 + 16) = copy_command(*(_QWORD *)(a1 + 16)); if ( *(_QWORD *)(a1 + 24) ) v1 = copy_command(*(_QWORD *)(a1 + 24)); else v1 = *(_QWORD *)(a1 + 24); *(_QWORD *)(v3 + 24) = v1; return v3; }
static void decode(char *s) { const char *src; char *dest; src = s; dest = s; while (*src != '\0') { if (*src != '\\') *dest = *src++; else { static const struct repl { char orig[4]; size_t len; char new; } repls[] = { { "\\", sizeof("\\") - 1, '\\' }, { "011", sizeof("011") - 1, '\t' }, { "012", sizeof("012") - 1, '\n' }, { "040", sizeof("040") - 1, ' ' }, { "134", sizeof("134") - 1, '\\' } }; size_t i; for (i = 0; i < sizeof (repls) / sizeof (repls[0]); i++) { if (memcmp(src + 1, repls[i].orig, repls[i].len) == 0) { *dest = repls[i].new; src += 1 + repls[i].len; goto found; } } *dest = *src++; found: ; } dest++; } *dest = '\0'; }
void decode(unsigned long long a0) { unsigned long v0; int tmp_8; char *v1; void* v2; char *v7; v0 = a0; for (v1 = a0; *(v0); v1 += 1) { if (*(v0) != 92) { tmp_8 = v0; v0 += 1; *(v1) = *(tmp_8); } else { v2 = 0; while (true) { if (v2 > 4) { tmp_8 = v0; v0 += 1; *(v1) = *(tmp_8); break; } else if (!memcmp(v0 + 1, 4194944 + 0x18 * v2, *((0x18 * v2 + &g_400288)))) { *(v1) = *((4194960 + 0x18 * v2)); v0 = &v0[1 + *((0x18 * v2 + &g_400288))]; break; } else { v2 += 1; } } } } v7 = v1; *(v1) = 0; return; }
static void read_igmp(struct ma_info **result_p) { struct ma_info m = { .addr.family = 2 , .addr.bitlen = 32, .addr.bytelen = 4, }; char buf[256]; FILE *fp = fopen("/proc/net/igmp", "r"); if (!fp) return; if (!fgets(buf, sizeof(buf), fp)) { fclose(fp); return; } while (fgets(buf, sizeof(buf), fp)) { struct ma_info *ma; if (buf[0] != '\t') { size_t len; sscanf(buf, "%d%s", &m.index, m.name); len = strlen(m.name); if (m.name[len - 1] == ':') m.name[len - 1] = '\0'; continue; } if (filter.dev && strcmp(filter.dev, m.name)) continue; sscanf(buf, "%08x%d", (__u32 *)&m.addr.data, &m.users); ma = malloc(sizeof(m)); memcpy(ma, &m, sizeof(m)); maddr_ins(result_p, ma); } fclose(fp); }
void read_igmp(undefined8 param_1) { int iVar1; char *pcVar2; size_t sVar3; void *__dest; long lVar4; undefined8 *puVar5; long in_FS_OFFSET; undefined8 local_270; FILE *local_260; undefined8 local_248; undefined local_240 [4]; undefined local_23c [11]; char acStack561 [19]; undefined2 local_21e; undefined2 local_21c; undefined2 local_21a; undefined local_218 [256]; char local_118 [264]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); puVar5 = &local_248; for (lVar4 = 0x26; lVar4 != 0; lVar4 = lVar4 + -1) { *puVar5 = 0; puVar5 = puVar5 + 1; } local_21e = 4; local_21c = 0x20; local_21a = 2; local_260 = fopen64("/proc/net/igmp","r"); if (local_260 != (FILE *)0x0) { pcVar2 = fgets(local_118,0x100,local_260); local_270 = param_1; if (pcVar2 == (char *)0x0) { fclose(local_260); } else { while (pcVar2 = fgets(local_118,0x100,local_260), pcVar2 != (char *)0x0) { if (local_118[0] == '\t') { if ((filter._0_8_ == (char *)0x0) || (iVar1 = strcmp(filter._0_8_,acStack561 + 1), iVar1 == 0)) { __isoc99_sscanf(local_118,"%08x%d",local_218,local_23c); __dest = malloc(0x130); memcpy(__dest,&local_248,0x130); maddr_ins(local_270,__dest); } } else { __isoc99_sscanf(local_118,&DAT_00101104,local_240,acStack561 + 1); sVar3 = strlen(acStack561 + 1); if (acStack561[sVar3] == ':') { acStack561[sVar3] = '\0'; } } } fclose(local_260); } } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
int times_builtin (list) WORD_LIST *list; { struct rusage self, kids; ((void) &(list)); if (no_options (list)) return (258); getrusage ( RUSAGE_SELF , &self); getrusage ( RUSAGE_CHILDREN , &kids); print_timeval ( stdout , &self.ru_utime); putchar (' '); print_timeval ( stdout , &self.ru_stime); putchar ('\n'); print_timeval ( stdout , &kids.ru_utime); putchar (' '); print_timeval ( stdout , &kids.ru_stime); putchar ('\n'); return (sh_chkwrite (0)); }
long long times_builtin(unsigned long long a0) { char v0; char v1; char v2; char v3; unsigned long long v5; if (no_options(a0)) { v5 = 258; return v5; } getrusage(0x0, &v0); getrusage(0xffffffff, &v2); print_timeval(stdout, &v0, &v0); putchar(0x20); print_timeval(stdout, &v1, &v1); putchar(0xa); print_timeval(stdout, &v2, &v2); putchar(0x20); print_timeval(stdout, &v3, &v3); putchar(0xa); v5 = sh_chkwrite(0x0); return v5; }
static inline char * bad_cast (char const *s) { return (char *) s; }
int bad_cast(unsigned long a0) { return a0; }
void _rl_internal_char_cleanup (void) { if (_rl_keep_mark_active) _rl_keep_mark_active = 0; else if (rl_mark_active_p ()) rl_deactivate_mark (); if (rl_editing_mode == 0 && _rl_keymap == vi_movement_keymap) rl_vi_check (); if (rl_num_chars_to_read && rl_end >= rl_num_chars_to_read) { (*rl_redisplay_function) (); _rl_want_redisplay = 0; rl_newline (1, '\n'); } if (rl_done == 0) { (*rl_redisplay_function) (); _rl_want_redisplay = 0; } if (rl_erase_empty_line && rl_done && rl_last_func == rl_newline && rl_point == 0 && rl_end == 0) _rl_erase_entire_line (); }
long long _rl_internal_char_cleanup(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned long long v1; if (_rl_keep_mark_active) { _rl_keep_mark_active = 0; } else if (rl_mark_active_p()) { rl_deactivate_mark(a0, a1, a2, a3, a4, a5); } if (!rl_editing_mode && _rl_keymap == 5243192) rl_vi_check(); if (rl_num_chars_to_read && 3850979413 >= rl_num_chars_to_read) { *(5243008)(); _rl_want_redisplay = 0; rl_newline(1, 10); } if (false) { *(5243008)(); _rl_want_redisplay = 0; } v1 = rl_erase_empty_line; if (rl_erase_empty_line) { v1 = 1219493948222425173; v1 = rl_last_func; if (rl_last_func == got.rl_newline) { v1 = 1219493948222425173; if (false) { v1 = 1219493948222425173; if (false) v1 = _rl_erase_entire_line(); } } } return v1; }
static size_t hash_directory_canonical_name (void const *entry, size_t n_buckets) { struct directory const *directory = entry; return hash_string (directory->caname, n_buckets); }
long hash_directory_canonical_name(long a1, long a2) { return hash_string(*(_QWORD *)(a1 + 80), a2); }
static int shell_builtin_compare (sbp1, sbp2) struct builtin *sbp1, *sbp2; { int result; if ((result = sbp1->name[0] - sbp2->name[0]) == 0) result = strcmp (sbp1->name, sbp2->name); return (result); }
long long shell_builtin_compare(char **a0, char **a1) { unsigned int v0; v0 = *(*(a0)) - *(*(a1)); if (!v0) { v0 = strcmp(*(a0), *(a1)); return v0; } return v0; }
_Bool pred_or (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr) { if (pred_ptr->pred_left == ((void *)0) || !apply_predicate (pathname, stat_buf, pred_ptr->pred_left)) { return apply_predicate (pathname, stat_buf, pred_ptr->pred_right); } else return 1 ; }
long pred_or(long a1, long a2, long a3) { if ( *(_QWORD *)(a3 + 272) && (unsigned char)apply_predicate(a1, a2, *(_QWORD *)(a3 + 272)) == 1 ) return 1LL; else return apply_predicate(a1, a2, *(_QWORD *)(a3 + 280)); }
static _Bool tail_lines (char const *pretty_filename, int fd, uintmax_t n_lines, uintmax_t *read_pos) { struct stat stats; if (fstat (fd, &stats)) { error (0, (*__errno_location ()) , gettext ("cannot fstat %s"), quotearg_style (shell_escape_always_quoting_style, pretty_filename)); return 0 ; } if (from_start) { int t = start_lines (pretty_filename, fd, n_lines, read_pos); if (t) return t < 0; *read_pos += dump_remainder ( 0 , pretty_filename, fd, (18446744073709551615UL) ); } else { off_t start_pos = -1; off_t end_pos; if ( ! presume_input_pipe && (((( stats.st_mode )) & 0170000) == (0100000)) && (start_pos = lseek (fd, 0, 1 )) != -1 && start_pos < (end_pos = lseek (fd, 0, 2 ))) { *read_pos = end_pos; if (end_pos != 0 && ! file_lines (pretty_filename, fd, n_lines, start_pos, end_pos, read_pos)) return 0 ; } else { if (start_pos != -1) xlseek (fd, start_pos, 0 , pretty_filename); return pipe_lines (pretty_filename, fd, n_lines, read_pos); } } return 1 ; }
void tail_lines(unsigned int a0, unsigned long a1, unsigned int a2, unsigned long long *a3) { unsigned long long *v0; unsigned int v1; char v2; unsigned int v3; unsigned long long v4; unsigned long v5; char v6; char v7; unsigned long long v9; unsigned long long v10; void* v12; unsigned long long v13; void* v15; unsigned long long v16; v1 = a2; v0 = a3; if (fstat(a1, &v6)) { v9 = quotearg_style(0x4, a0); error(0x0, *(__errno_location()), gettext("cannot fstat %s")); v12 = 0; return; } else if (from_start) { v3 = start_lines(a0, *(&v2), *(&v1), a3); if (v3) { v10 = v3 >> 31; return; } *(a3) = *(a3) + dump_remainder(0x0, a0, *(&v2), 0xffffffffffffffff); v16 = 1; return; } else { v4 = -1; if ((presume_input_pipe ^ 1) && (*(&v7) & 0xf000) == 0x8000) { v4 = lseek(*(&v2), 0x0, 0x1); if (v4 != -1) { v5 = lseek(*(&v2), 0x0, 0x2); if (v5 > v4) { *(a3) = v5; if (v5 && (file_lines(a0, *(&v2), *(&v1), v4, v5, a3) ^ 1)) { v15 = 0; return; } v16 = 1; return; } } } if (v4 != -1) xlseek(*(&v2), v4, 0x0, a0); v13 = pipe_lines(a0, *(&v2), *(&v1), a3); return; } }
static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx) { int flush = 0; int c, fd; e2fsck_t ctx; errcode_t retval; struct sigaction sa; char *extended_opts = 0; char *cp; int res; unsigned long long phys_mem_kb, blk; retval = e2fsck_allocate_context(&ctx); if (retval) return retval; *ret_ctx = ctx; e2fsck_global_ctx = ctx; setvbuf( stdout , ((void *)0) , 2 , 8192 ); setvbuf( stderr , ((void *)0) , 2 , 8192 ); if (getenv("E2FSCK_FORCE_INTERACTIVE") || (isatty(0) && isatty(1))) { ctx->interactive = 1; } else { ctx->start_meta[0] = '\001'; ctx->stop_meta[0] = '\002'; } memset(bar, '=', sizeof(bar)-1); memset(spaces, ' ', sizeof(spaces)-1); add_error_table(&et_ext2_error_table); add_error_table(&et_prof_error_table); blkid_get_cache(&ctx->blkid, ((void *)0) ); if (argc && *argv) ctx->program_name = *argv; else ctx->program_name = "e2fsck"; phys_mem_kb = get_memory_size() / 1024; ctx->readahead_kb = ~0ULL; while ((c = getopt(argc, argv, "panyrcC:B:dE:fvtFVM:b:I:j:P:l:L:N:SsDkz:")) != (-1) ) switch (c) { case 'C': ctx->progress = e2fsck_update_progress; res = sscanf(optarg, "%d", &ctx->progress_fd); if (res != 1) goto sscanf_err; if (ctx->progress_fd < 0) { ctx->progress = 0; ctx->progress_fd = ctx->progress_fd * -1; } if (!ctx->progress_fd) break; fd = dup(ctx->progress_fd); if (fd < 0) { fprintf( stderr , (gettext ("Error validating file descriptor %d: %s\n")), ctx->progress_fd, error_message( (*__errno_location ()) )); fatal_error(ctx, (gettext ("Invalid completion information file descriptor"))); } else close(fd); break; case 'D': ctx->options |= 0x0400; break; case 'E': extended_opts = optarg; break; case 'p': case 'a': if (ctx->options & (0x0004|0x0008)) { conflict_opt: fatal_error(ctx, (gettext ("Only one of the options -p/-a, -n or -y may be specified."))); } ctx->options |= 0x0002; break; case 'n': if (ctx->options & (0x0004|0x0002)) goto conflict_opt; ctx->options |= 0x0008; break; case 'y': if (ctx->options & (0x0002|0x0008)) goto conflict_opt; ctx->options |= 0x0004; break; case 't': if (ctx->options & 0x0010) ctx->options |= 0x0020; else ctx->options |= 0x0010; break; case 'c': if (cflag++) ctx->options |= 0x0200; ctx->options |= 0x0040; break; case 'r': break; case 'b': res = sscanf(optarg, "%llu", &blk); ctx->use_superblock = blk; if (res != 1) goto sscanf_err; ctx->flags |= 0x0100; break; case 'B': ctx->blocksize = atoi(optarg); break; case 'I': res = sscanf(optarg, "%d", &ctx->inode_buffer_blocks); if (res != 1) goto sscanf_err; break; case 'j': ctx->journal_name = blkid_get_devname(ctx->blkid, optarg, ((void *)0) ); if (!ctx->journal_name) { com_err(ctx->program_name, 0, (gettext ("Unable to resolve '%s'")), optarg); fatal_error(ctx, 0); } break; case 'P': res = sscanf(optarg, "%d", &ctx->process_inode_size); if (res != 1) goto sscanf_err; break; case 'L': replace_bad_blocks++; case 'l': if (bad_blocks_file) free(bad_blocks_file); bad_blocks_file = string_copy(ctx, optarg, 0); break; case 'd': ctx->options |= 0x0080; break; case 'f': ctx->options |= 0x0100; break; case 'F': flush = 1; break; case 'v': verbose = 1; break; case 'V': show_version_only = 1; break; case 'N': ctx->device_name = string_copy(ctx, optarg, 0); break; case 'k': keep_bad_blocks++; break; case 'z': ctx->undo_file = optarg; break; default: usage(ctx); } if (show_version_only) return 0; if (optind != argc - 1) usage(ctx); if ((ctx->options & 0x0008) && (ctx->options & 0x0400)) { com_err(ctx->program_name, 0, "%s", (gettext ("The -n and -D options are incompatible."))); fatal_error(ctx, 0); } if ((ctx->options & 0x0008) && cflag) { com_err(ctx->program_name, 0, "%s", (gettext ("The -n and -c options are incompatible."))); fatal_error(ctx, 0); } if ((ctx->options & 0x0008) && bad_blocks_file) { com_err(ctx->program_name, 0, "%s", (gettext ("The -n and -l/-L options are incompatible."))); fatal_error(ctx, 0); } if (ctx->options & 0x0008) ctx->options |= 0x0001; ctx->io_options = strchr(argv[optind], '?'); if (ctx->io_options) *ctx->io_options++ = 0; ctx->filesystem_name = blkid_get_devname(ctx->blkid, argv[optind], 0); if (!ctx->filesystem_name) { com_err(ctx->program_name, 0, (gettext ("Unable to resolve '%s'")), argv[optind]); fatal_error(ctx, 0); } if (extended_opts) parse_extended_opts(ctx, extended_opts); if (getenv("E2FSCK_FIXES_ONLY")) ctx->options |= 0x8000; if ((ctx->options & 0x0400) && (ctx->options & 0x8000)) { com_err(ctx->program_name, 0, "%s", (gettext ("The -D and -E fixes_only options are incompatible."))); fatal_error(ctx, 0); } if ((ctx->options & 0x4000) && (ctx->options & 0x8000)) { com_err(ctx->program_name, 0, "%s", (gettext ("The -E bmap2extent and fixes_only options are incompatible."))); fatal_error(ctx, 0); } if ((cp = getenv("E2FSCK_CONFIG")) != ((void *)0) ) config_fn[0] = cp; profile_set_syntax_err_cb(syntax_err_report); profile_init(config_fn, &ctx->profile); profile_get_boolean(ctx->profile, "options", "report_time", 0, 0, &c); if (c) ctx->options |= 0x0010 | 0x0020; profile_get_boolean(ctx->profile, "options", "report_verbose", 0, 0, &c); if (c) verbose = 1; profile_get_boolean(ctx->profile, "options", "no_optimize_extents", 0, 0, &c); if (c) ctx->options |= 0x10000; profile_get_boolean(ctx->profile, "options", "inode_count_fullmap", 0, 0, &c); if (c) ctx->options |= 0x20000; if (ctx->readahead_kb == ~0ULL) { profile_get_integer(ctx->profile, "options", "readahead_mem_pct", 0, -1, &c); if (c >= 0 && c <= 100) ctx->readahead_kb = phys_mem_kb * c / 100; profile_get_integer(ctx->profile, "options", "readahead_kb", 0, -1, &c); if (c >= 0) ctx->readahead_kb = c; if (ctx->readahead_kb != ~0ULL && ctx->readahead_kb > phys_mem_kb) ctx->readahead_kb = phys_mem_kb; } if ((ctx->options & 0x0008) && (ctx->options & 0x2000)) ctx->options &= ~0x2000; if (flush) { fd = open(ctx->filesystem_name, 00 , 0); if (fd < 0) { com_err("open", (*__errno_location ()) , (gettext ("while opening %s for flushing")), ctx->filesystem_name); fatal_error(ctx, 0); } if ((retval = ext2fs_sync_device(fd, 1))) { com_err("ext2fs_sync_device", retval, (gettext ("while trying to flush %s")), ctx->filesystem_name); fatal_error(ctx, 0); } close(fd); } if (cflag && bad_blocks_file) { fprintf( stderr , "%s", (gettext ("The -c and the -l/-L options may not " "be both used at the same time.\n")) ); exit(16); } memset(&sa, 0, sizeof(struct sigaction)); sa. __sigaction_handler.sa_handler = signal_cancel; sigaction( 2 , &sa, 0); sigaction( 15 , &sa, 0); sa.sa_flags = 0x10000000 ; sa. __sigaction_handler.sa_handler = signal_progress_on; sigaction( 10 , &sa, 0); sa. __sigaction_handler.sa_handler = signal_progress_off; sigaction( 12 , &sa, 0); if (cflag) { char *oldpath = getenv("PATH"); char *newpath; int len = sizeof("PATH=/sbin") + 1; if (oldpath) len += strlen(oldpath); newpath = malloc(len); if (!newpath) fatal_error(ctx, "Couldn't malloc() newpath"); strcpy(newpath, "PATH=/sbin"); if (oldpath) { strcat(newpath, ":"); strcat(newpath, oldpath); } putenv(newpath); } return 0; sscanf_err: fprintf( stderr , (gettext ("\nInvalid non-numeric argument to -%c (\"%s\")\n\n")), c, optarg); exit (1); }
int PRS(unsigned long a0, unsigned long long *a1, unsigned long a2) { unsigned long long *v0; int tmp_21; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; char v6; char v7; void* v8; unsigned long v9; unsigned long long v10; unsigned long long v11; char *v12; char *v13; unsigned long long v14; unsigned int v15; unsigned long v17; v0 = a2; v2 = 0; v8 = 0; v9 = e2fsck_allocate_context(&v6); if (v9) { v17 = v9; return v17; } *(v0) = *(&v6); e2fsck_global_ctx = *(&v6); setvbuf(stdout, NULL, 0x2, 0x2000); setvbuf(stderr, NULL, 0x2, 0x2000); if (getenv("E2FSCK_FORCE_INTERACTIVE") || isatty(0x0) && isatty(0x1)) { *((*(&v6) + 728)) = 1; } else { *((*(&v6) + 732)) = 1; *((*(&v6) + 734)) = 2; } memset(&bar, 0x3d, 0x7f); memset(&spaces, 0x20, 0x7f); add_error_table(0x5001c0); add_error_table(0x5001d0); blkid_get_cache(*(&v6) + 136, 0x0); if (!a0 || !*(a1)) *((*(&v6) + 8)) = "e2fsck"; else *((*(&v6) + 8)) = *(a1); v10 = get_memory_size() >> 10; *((*(&v6) + 920)) = -1; while (true) { v1 = getopt(a0, a1, "panyrcC:B:dE:fvtFVM:b:I:j:P:l:L:N:SsDkz:"); if (v1 != -1) { switch (v1) { case 66: *((*(&v6) + 80)) = atoi(*(&optarg)); continue; case 67: *((*(&v6) + 352)) = e2fsck_update_progress; v5 = __isoc99_sscanf(*(&optarg), "%d", (*(&v6) + 712)); if (v5 == 1) { if (*((*(&v6) + 712)) < 0) { *((*(&v6) + 352)) = 0; *((*(&v6) + 712)) = -(*((*(&v6) + 712))); } if (*((*(&v6) + 712))) { v4 = dup(*((*(&v6) + 712))); if (v4 < 0) { error_message(*(__errno_location())); fprintf(stderr, gettext("Error validating file descriptor %d: %s\n")); v17 = gettext("Invalid completion information file descriptor"); fatal_error(*(&v6), v17, v17); continue; } else { close(v4); } } continue; } break; case 68: a2 = *((*(&v6) + 76)); *(&a2) = (*((*(&v6) + 76)) >> 8) | 4; tmp_21 = a2; *((*(&v6) + 76)) = tmp_21; continue; case 69: v8 = *(&optarg); continue; case 70: v2 = 1; continue; case 73: v5 = __isoc99_sscanf(*(&optarg), "%d", (*(&v6) + 604)); if (v5 == 1) continue; break; case 78: *((*(&v6) + 24)) = string_copy(*(&v6), *(&optarg), 0x0, *(&optarg)); continue; case 80: v5 = __isoc99_sscanf(*(&optarg), "%d", (*(&v6) + 600)); if (v5 == 1) continue; break; case 86: show_version_only = 1; continue; case 97: case 112: if (!(*((*(&v6) + 76)) & 12)) goto LABEL_402cda; goto LABEL_402cb9; case 98: v5 = __isoc99_sscanf(*(&optarg), "%llu", &v7); *((*(&v6) + 88)) = *(&v7); if (v5 == 1) { a2 = *((*(&v6) + 72)); *(&a2) = (*((*(&v6) + 72)) >> 8) | 1; tmp_21 = a2; *((*(&v6) + 72)) = tmp_21; continue; } fprintf(stderr, gettext("\nInvalid non-numeric argument to -%c (\"%s\")\n\n")); exit(0x1); case 99: cflag = cflag + 1; if (cflag) { a2 = *((*(&v6) + 76)); *(&a2) = (*((*(&v6) + 76)) >> 8) | 2; tmp_21 = a2; *((*(&v6) + 76)) = tmp_21; } *((*(&v6) + 76)) = *((*(&v6) + 76)) | 64; continue; case 100: a2 = *((*(&v6) + 76)); *(&a2) = *((*(&v6) + 76)) | 128; *((*(&v6) + 76)) = a2; continue; case 102: a2 = *((*(&v6) + 76)); *(&a2) = (*((*(&v6) + 76)) >> 8) | 1; tmp_21 = a2; *((*(&v6) + 76)) = tmp_21; continue; case 106: *((*(&v6) + 624)) = blkid_get_devname(*((*(&v6) + 136)), *(&optarg), 0x0, *(&optarg)); if (!*((*(&v6) + 624))) { com_err(*((*(&v6) + 8)), 0x0, gettext("Unable to resolve '%s'"), *(&optarg)); fatal_error(*(&v6), 0x0, a2); } continue; case 107: keep_bad_blocks = keep_bad_blocks + 1; continue; case 110: if (!(*((*(&v6) + 76)) & 6)) { *((*(&v6) + 76)) = *((*(&v6) + 76)) | 8; continue; } case 114: continue; case 116: if (!(*((*(&v6) + 76)) & 16)) { *((*(&v6) + 76)) = *((*(&v6) + 76)) | 16; continue; } else { *((*(&v6) + 76)) = *((*(&v6) + 76)) | 32; } continue; case 118: verbose = 1; continue; case 121: if (!(*((*(&v6) + 76)) & 10)) { *((*(&v6) + 76)) = *((*(&v6) + 76)) | 4; continue; } case 122: *((*(&v6) + 936)) = *(&optarg); continue; case 76: replace_bad_blocks = replace_bad_blocks + 1; case 108: if (bad_blocks_file) free(bad_blocks_file); bad_blocks_file = string_copy(*(&v6), *(&optarg), 0x0, *(&optarg)); continue; default: usage(*(&v6)); } LABEL_402cb9: v17 = gettext("Only one of the options -p/-a, -n or -y may be specified."); fatal_error(*(&v6), v17, v17); LABEL_402cda: *((*(&v6) + 76)) = *((*(&v6) + 76)) | 2; } else if (show_version_only) { *(&v17) = 0; return v17; } else if (a0 - 1 != optind) { usage(*(&v6)); } else { if ((*((*(&v6) + 76)) & 8) && (*((*(&v6) + 76)) & 0x400)) { com_err(*((*(&v6) + 8)), 0x0, "%s", gettext("The -n and -D options are incompatible.")); fatal_error(*(&v6), 0x0, "%s"); } if ((*((*(&v6) + 76)) & 8) && cflag) { com_err(*((*(&v6) + 8)), 0x0, "%s", gettext("The -n and -c options are incompatible.")); fatal_error(*(&v6), 0x0, "%s"); } if ((*((*(&v6) + 76)) & 8) && bad_blocks_file) { com_err(*((*(&v6) + 8)), 0x0, "%s", gettext("The -n and -l/-L options are incompatible.")); fatal_error(*(&v6), 0x0, "%s"); break; } } } if ((*((*(&v6) + 76)) & 8)) *((*(&v6) + 76)) = *((*(&v6) + 76)) | 1; *((*(&v6) + 32)) = strchr(a1[optind], 0x3f); if (*((*(&v6) + 32))) { v17 = *((*(&v6) + 32)); *((*(&v6) + 32)) = *((*(&v6) + 32)) + 1; *(v17) = 0; } *((*(&v6) + 16)) = blkid_get_devname(*((*(&v6) + 136)), a1[optind], 0x0, a1[optind]); if (!*((*(&v6) + 16))) { com_err(*((*(&v6) + 8)), 0x0, gettext("Unable to resolve '%s'"), a1[optind]); fatal_error(*(&v6), 0x0, a2); } if (v8) parse_extended_opts(*(&v6), v8); if (getenv("E2FSCK_FIXES_ONLY")) { a2 = *((*(&v6) + 76)); *(&a2) = (*((*(&v6) + 76)) >> 8) | 128; tmp_21 = a2; *((*(&v6) + 76)) = tmp_21; } if ((*((*(&v6) + 76)) & 0x400) && (*((*(&v6) + 76)) & 0x8000)) { com_err(*((*(&v6) + 8)), 0x0, "%s", gettext("The -D and -E fixes_only options are incompatible.")); fatal_error(*(&v6), 0x0, "%s"); } if ((*((*(&v6) + 76)) & 0x4000) && (*((*(&v6) + 76)) & 0x8000)) { com_err(*((*(&v6) + 8)), 0x0, "%s", gettext("The -E bmap2extent and fixes_only options are incompatible.")); fatal_error(*(&v6), 0x0, "%s"); } v11 = getenv("E2FSCK_CONFIG"); if (v11) config_fn = v11; profile_set_syntax_err_cb(syntax_err_report); profile_init(&config_fn, *(&v6) + 864); profile_get_boolean(*((*(&v6) + 864)), "options", "report_time", 0x0, 0x0, &v1); if (v1) *((*(&v6) + 76)) = *((*(&v6) + 76)) | 48; profile_get_boolean(*((*(&v6) + 864)), "options", "report_verbose", 0x0, 0x0, &v1); if (v1) verbose = 1; profile_get_boolean(*((*(&v6) + 864)), "options", "no_optimize_extents", 0x0, 0x0, &v1); if (v1) *((*(&v6) + 76)) = *((*(&v6) + 76)) | 0x10000; profile_get_boolean(*((*(&v6) + 864)), "options", "inode_count_fullmap", 0x0, 0x0, &v1); if (v1) *((*(&v6) + 76)) = *((*(&v6) + 76)) | 0x20000; if (*((*(&v6) + 920)) == -1) { profile_get_integer(*((*(&v6) + 864)), "options", "readahead_mem_pct", 0x0, 0xffffffff, &v1); if (v1 >= 0 && v1 <= 100) *((*(&v6) + 920)) = (v10 * v1 >> 2) * 2951479051793528259 >> 64 >> 2; profile_get_integer(*((*(&v6) + 864)), "options", "readahead_kb", 0x0, 0xffffffff, &v1); if (v1 >= 0) *((*(&v6) + 920)) = v1; if (*((*(&v6) + 920)) != -1 && v10 < *((*(&v6) + 920))) *((*(&v6) + 920)) = v10; } if ((*((*(&v6) + 76)) & 8) && (*((*(&v6) + 76)) & 0x2000)) { a2 = *((*(&v6) + 76)); *(&a2) = (*((*(&v6) + 76)) >> 8) & 223; tmp_21 = a2; *((*(&v6) + 76)) = tmp_21; } if (v2) { v4 = open(*((*(&v6) + 16)), 0x0, 0x0); if (v4 < 0) { com_err("open", *(__errno_location()), gettext("while opening %s for flushing"), *((*(&v6) + 16))); fatal_error(*(&v6), 0x0, a2); } v9 = ext2fs_sync_device(v4, 0x1); if (v9) { com_err("ext2fs_sync_device", v9, gettext("while trying to flush %s"), *((*(&v6) + 16))); fatal_error(*(&v6), 0x0, a2); } close(v4); } if (cflag && bad_blocks_file) { fprintf(stderr, "%s", gettext("The -c and the -l/-L options may not be both used at the same time.\n")); exit(0x10); } memset(&v14, 0x0, 0x98); v14 = signal_cancel; sigaction(0x2, &v14, 0x0); sigaction(0xf, &v14, 0x0); v15 = 0x10000000; v14 = signal_progress_on; sigaction(0xa, &v14, 0x0); v14 = signal_progress_off; sigaction(0xc, &v14, 0x0); if (!cflag) { *(&v17) = 0; return v17; } v12 = getenv("PATH"); v3 = 12; if (v12) { *(&v17) = v3 + strlen(v12); v3 = v17; } v13 = malloc(v3); if (!v13) fatal_error(*(&v6), "Couldn't malloc() newpath", 0x0); strcpy(v13, "PATH=/sbin"); if (v12) { strcat(v13, ":"); strcat(v13, v12); } putenv(v13); *(&v17) = 0; return v17; }
static void handle_log_exit(void) { u_int i; for (i = 0; i < num_handles; i++) if (handles[i].use != HANDLE_UNUSED) handle_log_close(i, "forced"); }
void handle_log_exit() { unsigned int v0; unsigned long long v2; v0 = 0; while (true) { v2 = num_handles; if (v0 >= num_handles) break; if (*(((v0 * 7 << 3) + handles))) handle_log_close(v0, "forced"); v0 += 1; } return; }
static double uInt64_to_double ( UInt64* n ) { Int32 i; double base = 1.0; double sum = 0.0; for (i = 0; i < 8; i++) { sum += base * (double)(n->b[i]); base *= 256.0; } return sum; }
void uInt64_to_double(char *a0) { unsigned int v0; unsigned long long v1; void* v2; uint128_t v4; uint128_t v5; void* v6; v1 = 0x3ff0000000000000; v2 = 0; for (v0 = 0; v0 <= 7; v0 += 1) { v4 = 0; *(&v4) = a0[v0]; xmm0<16> = ((xmm0<16> * Conv(64->128, Load(addr=stack_base-24, size=8, endness=Iend_LE))) + Conv(64->128, Load(addr=stack_base-16, size=8, endness=Iend_LE))) v2 = v5; s_18 =L Conv(128->64, (0x4070000000000000<128> * Conv(64->128, Load(addr=stack_base-24, size=8, endness=Iend_LE))))<8> } v6 = v2; return; }
double monotime_double(void) { struct timespec ts; monotime_ts(&ts); return ts.tv_sec + ((double)ts.tv_nsec / 1000000000); }
long long monotime_double() { char v0; monotime_ts(&v0); return 0; }