input
stringlengths
28
169k
output
stringlengths
20
317k
static void set_shell_var () { SHELL_VAR *temp_var; temp_var = find_variable ("SHELL"); if (temp_var == 0) { if (current_user.shell == 0) get_current_user_info (); temp_var = bind_variable ("SHELL", current_user.shell, 0); } }
long *set_shell_var() { long *result; result = find_variable((long)"SHELL"); if ( !result ) { if ( !current_user[3] ) get_current_user_info(); return (long *)bind_variable("SHELL", (char *)current_user[3], 0); } return result; }
void flush_write (void) { flush_write_ptr (record_size); }
long long flush_write() { return *(4213552)(record_size); }
vi_search_next(EditLine *el, wint_t c __attribute__((__unused__))) { return cv_search(el, 23); }
long long vi_search_next(unsigned long long a0, unsigned long a1) { unsigned int v0; v0 = a1; return cv_search(a0, 0x17); }
static void finalise_cert_exts(void) { if (certflags_command != ((void *)0) ) cert_ext_add("force-command", certflags_command, 1); if (certflags_src_addr != ((void *)0) ) cert_ext_add("source-address", certflags_src_addr, 1); if ((certflags_flags & (1<<6)) != 0) cert_ext_add("verify-required", ((void *)0) , 1); if ((certflags_flags & (1)) != 0) cert_ext_add("permit-X11-forwarding", ((void *)0) , 0); if ((certflags_flags & (1<<1)) != 0) cert_ext_add("permit-agent-forwarding", ((void *)0) , 0); if ((certflags_flags & (1<<2)) != 0) cert_ext_add("permit-port-forwarding", ((void *)0) , 0); if ((certflags_flags & (1<<3)) != 0) cert_ext_add("permit-pty", ((void *)0) , 0); if ((certflags_flags & (1<<4)) != 0) cert_ext_add("permit-user-rc", ((void *)0) , 0); if ((certflags_flags & (1<<5)) != 0) cert_ext_add("no-touch-required", ((void *)0) , 0); if (ncert_ext > 0) qsort(cert_ext, ncert_ext, sizeof(*cert_ext), cert_ext_cmp); }
void finalise_cert_exts() { unsigned long long v1; unsigned long long v2; if (certflags_command) cert_ext_add("force-command", certflags_command, 0x1); if (certflags_src_addr) cert_ext_add("source-address", certflags_src_addr, 0x1); if ((certflags_flags & 64)) cert_ext_add("verify-required", 0x0, 0x1); if ((certflags_flags & 1)) cert_ext_add("permit-X11-forwarding", 0x0, 0x0); if ((certflags_flags & 2)) cert_ext_add("permit-agent-forwarding", 0x0, 0x0); if ((certflags_flags & 4)) cert_ext_add("permit-port-forwarding", 0x0, 0x0); if ((certflags_flags & 8)) cert_ext_add("permit-pty", 0x0, 0x0); if ((certflags_flags & 16)) cert_ext_add("permit-user-rc", 0x0, 0x0); if ((certflags_flags & 32)) cert_ext_add("no-touch-required", 0x0, 0x0); v1 = ncert_ext; if (ncert_ext) v2 = qsort(cert_ext, ncert_ext, 0x18, cert_ext_cmp); return; }
static void print_esc_char (char c) { switch (c) { case 'a': c ='\a'; break; case 'b': c ='\b'; break; case 'e': c ='\x1B'; break; case 'f': c ='\f'; break; case 'n': c ='\n'; break; case 'r': c ='\r'; break; case 't': c ='\t'; break; case 'v': c ='\v'; break; case '"': case '\\': break; default: error (0, 0, gettext ("warning: unrecognized escape '\\%c'"), c); break; } putchar_unlocked (c); }
int print_esc_char(char a1) { char *v1; char v3; v3 = a1; if ( a1 != 34 ) { if ( a1 < 34 || a1 > 118 || a1 < 92 ) { LABEL_14: v1 = gettext("warning: unrecognized escape '\\%c'"); error(0, 0, v1, (unsigned int)a1); } else { switch ( a1 ) { case '\\': return putchar_unlocked(v3); case 'a': v3 = 7; break; case 'b': v3 = 8; break; case 'e': v3 = 27; break; case 'f': v3 = 12; break; case 'n': v3 = 10; break; case 'r': v3 = 13; break; case 't': v3 = 9; break; case 'v': v3 = 11; break; default: goto LABEL_14; } } } return putchar_unlocked(v3); }
!ext2fs_has_feature_largedir(fs->super)) { int blockbits = ((fs->super)->s_log_block_size + 10) + 10; unsigned idx_pb = 1 << (blockbits - 3); if (((pctx->inode)->i_size | ((__u64) (pctx->inode)->i_size_high << 32)) < (idx_pb - 1) * (idx_pb - 2) << blockbits && pctx->inode->i_blocks < (idx_pb - 1) * (idx_pb - 2) << (blockbits - 9) && fix_problem(ctx, 0x01004C, pctx)) return 1; }
int ext2fs_has_feature_largedir(struct_0 *a0) { return (a0->field_60 & 0x4000); }
static inline void emit_stdin_note (void) { fputs_unlocked (gettext ("\nWith no FILE, or when FILE is -, read standard input.\n"), stdout ) ; }
void emit_stdin_note(void) { char *__s; FILE *__stream; __stream = stdout; __s = (char *)gettext("\nWith no FILE, or when FILE is -, read standard input.\n"); fputs_unlocked(__s,__stream); return; }
static size_t xdupmbstowcs2 (destp, src) wchar_t **destp; const char *src; { const char *p; wchar_t *wsbuf; size_t wsbuf_size; size_t wcnum; mbstate_t state; size_t n, wcslength; const char *end_or_backslash; size_t nms; mbstate_t tmp_state; const char *tmp_p; memset (&state, '\0', sizeof(mbstate_t)); wsbuf_size = 0; wsbuf = ((void *)0) ; p = src; wcnum = 0; do { end_or_backslash = strchrnul(p, '\\'); nms = end_or_backslash - p; if (*end_or_backslash == '\0') nms++; tmp_p = p; tmp_state = state; if (nms == 0 && *p == '\\') nms = wcslength = 1; else wcslength = mbsnrtowcs ( ((void *)0) , &tmp_p, nms, 0, &tmp_state); if (wcslength == 0) { tmp_p = p; tmp_state = state; wcslength = 1; } if (wcslength == (size_t)-1) { free (wsbuf); *destp = ((void *)0) ; return (size_t)-1; } if (wsbuf_size < wcnum+wcslength+1) { wchar_t *wstmp; while (wsbuf_size < wcnum+wcslength+1) wsbuf_size += 32; wstmp = (wchar_t *) realloc (wsbuf, wsbuf_size * sizeof (wchar_t)); if (wstmp == ((void *)0) ) { free (wsbuf); *destp = ((void *)0) ; return (size_t)-1; } wsbuf = wstmp; } n = mbsnrtowcs(wsbuf+wcnum, &p, nms, wsbuf_size-wcnum, &state); if (n == 0 && p == 0) { wsbuf[wcnum] = L'\0'; break; } if (wcslength == 1 && (n == 0 || n == (size_t)-1)) { state = tmp_state; p = tmp_p; wsbuf[wcnum] = *p; if (*p == 0) break; else { wcnum++; p++; } } else wcnum += wcslength; if (mbsinit (&state) && (p != ((void *)0) ) && (*p == '\\')) { wsbuf[wcnum++] = L'\\'; p++; } } while (p != ((void *)0) ); *destp = wsbuf; return wcnum; }
long xdupmbstowcs2(void **a1, char *a2) { long v3; char *v4; char *src; void *ptr; unsigned long v7; long v8; size_t v9; size_t nmc; char *v11; void *v12; size_t v13; mbstate_t s; mbstate_t ps; unsigned long v16; v16 = __readfsqword(0x28u); memset(&s, 0, sizeof(s)); v7 = 0LL; ptr = 0LL; v4 = a2; v8 = 0LL; while ( 1 ) { v11 = strchrnul(v4, 92); nmc = v11 - v4; if ( !*v11 ) ++nmc; src = v4; ps = s; if ( nmc || *v4 != 92 ) { v9 = mbsnrtowcs(0LL, (const char **)&src, nmc, 0LL, &ps); } else { v9 = 1LL; nmc = 1LL; } if ( !v9 ) { src = v4; ps = s; v9 = 1LL; } if ( v9 == -1LL ) { LABEL_11: free(ptr); *a1 = 0LL; return -1LL; } if ( v7 < v8 + v9 + 1 ) { while ( v7 < v8 + v9 + 1 ) v7 += 32LL; v12 = realloc(ptr, 4 * v7); if ( !v12 ) goto LABEL_11; ptr = v12; } v13 = mbsnrtowcs((wchar_t *)ptr + v8, (const char **)&v4, nmc, v7 - v8, &s); if ( !v13 && !v4 ) break; if ( v9 == 1 && (!v13 || v13 == -1LL) ) { s = ps; v4 = src; *((_DWORD *)ptr + v8) = *src; if ( !*v4 ) goto LABEL_32; ++v8; ++v4; } else { v8 += v9; } if ( mbsinit(&s) && v4 && *v4 == 92 ) { v3 = v8++; *((_DWORD *)ptr + v3) = 92; ++v4; } if ( !v4 ) goto LABEL_32; } *((_DWORD *)ptr + v8) = 0; LABEL_32: *a1 = ptr; return v8; }
static inline char *_STPUTC(int c, char *p) { if (p == sstrend) p = growstackstr(); *p++ = c; return p; }
int _STPUTC(unsigned long a0, unsigned long a1) { char *v0; int tmp_13; v0 = a1; if (v0 == sstrend) v0 = growstackstr(); tmp_13 = v0; v0 += 1; *(tmp_13) = a0; return v0; }
static void cleanup_socket(void) { if (cleanup_pid != 0 && getpid() != cleanup_pid) return; sshlog("ssh-agent.c", __func__, 1951, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "cleanup"); if (socket_name[0]) unlink(socket_name); if (socket_dir[0]) rmdir(socket_dir); }
void cleanup_socket(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5, unsigned long long v2) { char v0; char v1; unsigned long long v4; unsigned long long v5; if (!cleanup_pid || getpid() == cleanup_pid) { sshlog("ssh-agent.c", "cleanup_socket", 0x79f, 0x1, 0x5, 0x0, "cleanup", *(&v0), &v1, *(&v1), v2); unlink(&lock_pwhash); v4 = 14378102485636827368; v5 = rmdir(&lock_pwhash); } return; }
int init_setenv(char *name, char *value) { struct init_request request; struct sigaction sa; int fd; size_t nl, vl; memset(&request, 0, sizeof(request)); request.magic = 0x03091969; request.cmd = 6; nl = strlen(name); vl = value ? strlen(value) : 0; if (nl + vl + 3 >= (int)sizeof(request.i.data)) return -1; memcpy(request.i.data, name, nl); if (value) { request.i.data[nl] = '='; memcpy(request.i.data + nl + 1, value, vl); } memset(&sa, 0, sizeof(sa)); sa. __sigaction_handler.sa_handler = alrm_handler; sigaction( 14 , &sa, ((void *)0) ); got_alrm = 0; alarm(3); if ((fd = open("/run/initctl", 01 )) >= 0) { ssize_t p = 0; size_t s = sizeof(request); void *ptr = &request; while (s > 0) { p = write(fd, ptr, s); if (p < 0) { if ( (*__errno_location ()) == 4 || (*__errno_location ()) == 11 ) continue; break; } ptr += p; s -= p; } close(fd); alarm(0); return 0; } fprintf( stderr , "shutdown: "); if (got_alrm) { fprintf( stderr , "timeout opening/writing control channel %s\n", "/run/initctl"); } else { perror("/run/initctl"); } return -1; }
void init_setenv(void* a0, void* a1) { unsigned int v0; unsigned long long v1; void* v2; char *v3; void* v4; unsigned long v5; char v6; unsigned int v7; unsigned int v8; char v9; char v10; void* v12; unsigned long long v13; void* v14; unsigned long long v15; memset(&v7, 0x0, 0x180); v7 = 50927977; v8 = 6; v3 = strlen(a0); if (!a1) v12 = 0; else v12 = strlen(a1); v4 = v12; if (v4 + v3 + 3 > 367) { v13 = 4294967295; } else { memcpy(&v9, a0, v3); if (a1) { *((v3 + &v9)) = 61; memcpy(&v10 + v3, a1, v4); } memset(&v6, 0x0, 0x98); v6 = alrm_handler; sigaction(0xe, &v6, 0x0); got_alrm = 0; alarm(0x3); v0 = open("/run/initctl", 0x1, 0x0); if (v0 < 0) { fprintf(stderr, "shutdown: "); if (!got_alrm) perror("/run/initctl"); else fprintf(stderr, "timeout opening/writing control channel %s\n", &g_401fe8); v15 = 4294967295; } else { v5 = 0; v1 = 384; v2 = &v7; while (true) { if (!v1) break; v5 = write(v0, v2, v1); if (!((v5 - 0 >> 63))) { v2 += v5; v1 -= v5; } else { *(&v12) = *(__errno_location()); if (v12 == 4) continue; *(&v12) = *(__errno_location()); if (v12 != 11) break; } } close(v0); alarm(0x0); v14 = 0; } } return; }
void usage (int status) { if (status != 0 ) do { fprintf ( stderr , gettext ("Try '%s --help' for more information.\n"), program_name); } while (0); else { printf (gettext ("Usage: %s [OPTION]... NAME TYPE [MAJOR MINOR]\n"), program_name); fputs_unlocked (gettext ("Create the special file NAME of the given TYPE.\n"), stdout ) ; emit_mandatory_arg_note (); fputs_unlocked (gettext (" -m, --mode=MODE set file permission bits to MODE, not a=rw - umask\n"), stdout ) ; fputs_unlocked (gettext (" -Z set the SELinux security context to default type\n --context[=CTX] like -Z, or if CTX is specified then set the SELinux\n or SMACK security context to CTX\n"), stdout ) ; fputs_unlocked (gettext (" --help display this help and exit\n"), stdout ); fputs_unlocked (gettext (" --version output version information and exit\n"), stdout ); fputs_unlocked (gettext ("\nBoth MAJOR and MINOR must be specified when TYPE is b, c, or u, and they\nmust be omitted when TYPE is p. If MAJOR or MINOR begins with 0x or 0X,\nit is interpreted as hexadecimal; otherwise, if it begins with 0, as octal;\notherwise, as decimal. TYPE may be:\n"), stdout ) ; fputs_unlocked (gettext ("\n b create a block (buffered) special file\n c, u create a character (unbuffered) special file\n p create a FIFO\n"), stdout ) ; printf (gettext ("\n" "NOTE: your shell may have its own version of %s, which usually supersedes\n" "the version described here. Please refer to your shell's documentation\n" "for details about the options it supports.\n"), "mknod"); emit_ancillary_info ("mknod"); } exit (status); }
void usage(int a1) { long v1; char *v2; char *v3; FILE *v4; char *v5; FILE *v6; char *v7; FILE *v8; char *v9; FILE *v10; char *v11; FILE *v12; char *v13; FILE *v14; char *v15; FILE *v16; char *v17; char *v18; v1 = program_name; if ( a1 ) { v2 = gettext("Try '%s --help' for more information.\n"); fprintf(stderr, v2, v1); } else { v3 = gettext("Usage: %s [OPTION]... NAME TYPE [MAJOR MINOR]\n"); printf(v3, v1); v4 = stdout; v5 = gettext("Create the special file NAME of the given TYPE.\n"); fputs_unlocked(v5, v4); emit_mandatory_arg_note(); v6 = stdout; v7 = gettext(" -m, --mode=MODE set file permission bits to MODE, not a=rw - umask\n"); fputs_unlocked(v7, v6); v8 = stdout; v9 = gettext( " -Z set the SELinux security context to default type\n" " --context[=CTX] like -Z, or if CTX is specified then set the SELinux\n" " or SMACK security context to CTX\n"); fputs_unlocked(v9, v8); v10 = stdout; v11 = gettext(" --help display this help and exit\n"); fputs_unlocked(v11, v10); v12 = stdout; v13 = gettext(" --version output version information and exit\n"); fputs_unlocked(v13, v12); v14 = stdout; v15 = gettext( "\n" "Both MAJOR and MINOR must be specified when TYPE is b, c, or u, and they\n" "must be omitted when TYPE is p. If MAJOR or MINOR begins with 0x or 0X,\n" "it is interpreted as hexadecimal; otherwise, if it begins with 0, as octal;\n" "otherwise, as decimal. TYPE may be:\n"); fputs_unlocked(v15, v14); v16 = stdout; v17 = gettext( "\n" " b create a block (buffered) special file\n" " c, u create a character (unbuffered) special file\n" " p create a FIFO\n"); fputs_unlocked(v17, v16); v18 = gettext( "\n" "NOTE: your shell may have its own version of %s, which usually supersedes\n" "the version described here. Please refer to your shell's documentation\n" "for details about the options it supports.\n"); printf(v18, "mknod"); emit_ancillary_info("mknod"); } exit(a1); }
static void print_srh(FILE *fp, struct ipv6_sr_hdr *srh) { int i; if (is_json_context()) open_json_array(PRINT_JSON, "segs"); else fprintf(fp, "segs %d [ ", srh->first_segment + 1); for (i = srh->first_segment; i >= 0; i--) print_color_string(PRINT_ANY, COLOR_INET6, ((void *)0) , "%s ", rt_addr_n2a( 10 , 16, &srh->segments[i])); if (is_json_context()) close_json_array(PRINT_JSON, ((void *)0) ); else fprintf(fp, "] "); if (((srh)->flags & (1 << 3))) { unsigned int offset = ((srh->hdrlen + 1) << 3) - 40; struct sr6_tlv_hmac *tlv; tlv = (struct sr6_tlv_hmac *)((char *)srh + offset); print_0xhex(PRINT_ANY, "hmac", "hmac %llX ", ntohl(tlv->hmackeyid)); } }
void print_srh(FILE *param_1,long param_2) { char cVar1; uint32_t uVar2; undefined8 uVar3; uint local_18; cVar1 = is_json_context(); if (cVar1 == '\0') { fprintf(param_1,"segs %d [ ",(ulong)(*(byte *)(param_2 + 4) + 1)); } else { open_json_array(2,&DAT_00106d06); } for (local_18 = (uint)*(byte *)(param_2 + 4); -1 < (int)local_18; local_18 = local_18 - 1) { uVar3 = rt_addr_n2a(10,0x10,param_2 + (long)(int)local_18 * 0x10 + 8); print_color_string(4,3,0,&DAT_00106d16,uVar3); } cVar1 = is_json_context(); if (cVar1 == '\0') { fprintf(param_1,"] "); } else { close_json_array(2,0); } if ((*(byte *)(param_2 + 5) & 8) != 0) { uVar2 = ntohl(*(uint32_t *)(param_2 + (ulong)((*(byte *)(param_2 + 1) + 1) * 8 - 0x28) + 4)); print_0xhex(4,&DAT_00106d28,"hmac %llX ",uVar2); } return; }
static _Bool time_overflow (intmax_t n) { return ! (((! ((time_t) 0 < (time_t) -1)) ? ((time_t) ~ ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1)))) <= n : 0 <= n) && n <= ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1)))); }
int time_overflow(unsigned long a0) { unsigned long v0; v0 = a0; return 0; }
int do_setstat(struct sftp_conn *conn, const char *path, Attrib *a) { u_int status, id; sshlog("sftp-client.c", __func__, 962, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "Sending SSH2_FXP_SETSTAT \"%s\"", path); id = conn->msg_id++; send_string_attrs_request(conn, id, 9, path, strlen(path), a); status = get_status(conn, id); if (status != 0) sshlog("sftp-client.c", __func__, 970, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "remote setstat \"%s\": %s", path, fx2txt(status)); return status == 0 ? 0 : -1; }
undefined8 do_setstat(long param_1,char *param_2,undefined8 param_3) { int iVar1; size_t sVar2; undefined8 uVar3; undefined8 uVar4; sshlog("sftp-client.c","do_setstat",0x3c2,0,6,0,"Sending SSH2_FXP_SETSTAT \"%s\"",param_2); iVar1 = *(int *)(param_1 + 0x18); *(int *)(param_1 + 0x18) = iVar1 + 1; sVar2 = strlen(param_2); send_string_attrs_request(param_1,iVar1,9,param_2,sVar2 & 0xffffffff,param_3); iVar1 = get_status(param_1,iVar1); if (iVar1 == 0) { uVar3 = 0; } else { uVar4 = 0x1039b8; uVar3 = fx2txt(iVar1); sshlog("sftp-client.c","do_setstat",0x3ca,0,2,0,"remote setstat \"%s\": %s",param_2,uVar3,uVar4) ; uVar3 = 0xffffffff; } return uVar3; }
static _Bool skip (uintmax_t n_skip) { _Bool ok = 1 ; int in_errno = 0; if (n_skip == 0) return 1 ; while (in_stream != ((void *)0) ) { struct stat file_stats; if (fstat (fileno (in_stream), &file_stats) == 0) { _Bool usable_size = usable_st_size (&file_stats); if (usable_size && ((0 < (file_stats).st_blksize && (file_stats).st_blksize <= ((size_t)-1) / 8 + 1) ? (file_stats).st_blksize : 512 ) < file_stats.st_size) { if ((uintmax_t) file_stats.st_size < n_skip) n_skip -= file_stats.st_size; else { if ( rpl_fseeko (in_stream, n_skip, 1 ) != 0) { in_errno = (*__errno_location ()) ; ok = 0 ; } n_skip = 0; } } else if (!usable_size && rpl_fseeko (in_stream, n_skip, 1 ) == 0) n_skip = 0; else { char buf[ 8192 ]; size_t n_bytes_read, n_bytes_to_read = 8192 ; while (0 < n_skip) { if (n_skip < n_bytes_to_read) n_bytes_to_read = n_skip; n_bytes_read = fread_unlocked (buf,1,n_bytes_to_read,in_stream); n_skip -= n_bytes_read; if (n_bytes_read != n_bytes_to_read) { if (ferror_unlocked (in_stream)) { in_errno = (*__errno_location ()) ; ok = 0 ; n_skip = 0; break; } if (feof_unlocked (in_stream)) break; } } } if (n_skip == 0) break; } else { error (0, (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, input_filename)); ok = 0 ; } ok &= check_and_close (in_errno); ok &= open_next_file (); } if (n_skip != 0) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot skip past end of combined input\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("cannot skip past end of combined input")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("cannot skip past end of combined input")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); return ok; }
int skip(unsigned long a0) { void* v0; char v1; char v2; unsigned int v3; unsigned long long v4; unsigned long v5; char v6; char v7; char v8; char v9; unsigned long long v10; char v11; unsigned long long v13; unsigned long long v14; v11 = *(&v11); v10 = *(&v10); v0 = a0; v1 = 1; if (!v0) { v13 = 1; } else { for (v3 = 0; in_stream; v1 = v13) { v13 = fstat(fileno(in_stream), &v6); if (!v13) { v2 = usable_st_size(&v6); if (v2) { if (*(&v8) > 0 && *(&v8) <= 0x2000000000000000) v13 = *(&v8); if (*(&v8) <= 0 || *(&v8) > 0x2000000000000000) v13 = 0x200; if (v13 < *(&v7)) { if (v0 > *(&v7)) { v0 -= *(&v7); } else { v13 = rpl_fseeko(in_stream, v0, 0x1, v0); if (v13) { *(&v13) = *(__errno_location()); v3 = v13; v1 = 0; } v0 = 0; } } } if (!v2 || v13 >= *(&v7)) { if ((v2 ^ 1)) { v13 = rpl_fseeko(in_stream, v0, 0x1, v0); if (!v13) v0 = 0; } if (!(v2 ^ 1) || v13) { v4 = 0x2000; while (v0) { if (v0 < v4) v4 = v0; v5 = fread_unlocked(&v9, 0x1, v4, in_stream); v0 -= v5; if (v5 == v4) continue; v13 = ferror_unlocked(in_stream); if (v13) { *(&v13) = *(__errno_location()); v3 = v13; v1 = 0; v0 = 0; break; } else { v13 = feof_unlocked(in_stream); if (v13) break; } } } } if (!v0) break; } else { v14 = quotearg_n_style_colon(0x0, 0x3, input_filename); error(0x0, *(__errno_location()), "%s"); v1 = 0; } v1 = (check_and_close(v3) & v1); *(&v13) = open_next_file() & v1; } if (v0) error(0x1, 0x0, gettext("cannot skip past end of combined input")); v13 = v1; } if (!v0 || !v0) return v13; }
static int getentropy_sysctl(void *buf, size_t len) { static int mib[] = { CTL_KERN, KERN_RANDOM, RANDOM_UUID }; size_t i; int save_errno = (*__errno_location ()) ; for (i = 0; i < len; ) { size_t chunk = (((len - i) < (16)) ? (len - i) : (16)); struct __sysctl_args args = { .name = mib, .nlen = 3, .oldval = (char *)buf + i, .oldlenp = &chunk, }; if (syscall( 156 , &args) != 0) goto sysctlfailed; i += chunk; } if (gotdata(buf, len) == 0) { (*__errno_location ()) = save_errno; return (0); } sysctlfailed: (*__errno_location ()) = 5 ; return (-1); }
long getentropy_sysctl(long a1, unsigned long a2) { long v2; int v4; long v5; unsigned long i; long v7[12]; v7[11] = __readfsqword(0x28u); v4 = *_errno_location(); for ( i = 0LL; i < a2; i += v5 ) { v2 = a2 - i; if ( a2 - i > 0x10 ) v2 = 16LL; v5 = v2; v7[1] = 3LL; memset(&v7[4], 0, 48); v7[0] = (long)&mib_6656; v7[2] = a1 + i; v7[3] = (long)&v5; if ( syscall(156LL, v7) ) goto LABEL_9; } if ( !(unsigned int)gotdata(a1, a2) ) { *_errno_location() = v4; return 0LL; } LABEL_9: *_errno_location() = 5; return 0xFFFFFFFFLL; }
time_t get_crl_this_update_date(void) { if (batch && cfg.this_update_date != ((void *)0) ) { return get_date(cfg.this_update_date); } return time( ((void *)0) ); }
long long get_crl_this_update_date() { unsigned long long v1; if (*(got.batch) && *((got.cfg + 504))) v1 = get_date(*((got.cfg + 504))); if (!*(got.batch) || !*((got.cfg + 504))) v1 = time(NULL); return v1; }
void set_force_option(const struct cmdinfo *cip, const char *value) { _Bool set = cip->arg_int; parse_force(value, set); }
long long set_force_option(struct_0 *a0, char *a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { char v0; v0 = a0->field_28; return parse_force(a1, v0, v0, a3, a4, a5); }
static int syslogin_perform_login(struct logininfo *li) { struct utmp *ut; ut = xmalloc(sizeof(*ut)); construct_utmp(li, ut); login(ut); free(ut); return (1); }
undefined8 syslogin_perform_login(undefined8 param_1) { void *__ptr; __ptr = (void *)xmalloc(0x180); construct_utmp(param_1,__ptr); login(__ptr); free(__ptr); return 1; }
char * username_completion_function(const char *text, int state) { struct passwd *pass = ((void *)0) ; if (text[0] == '\0') return ((void *)0) ; if (*text == '~') text++; if (state == 0) setpwent(); while ( (pass = getpwent()) != ((void *)0) && text[0] == pass->pw_name[0] && strcmp(text, pass->pw_name) == 0) continue; if (pass == ((void *)0) ) { endpwent(); return ((void *)0) ; } return strdup(pass->pw_name); }
long long username_completion_function(unsigned long long a0, unsigned long a1) { char *v0; char **v1; void* v3; v0 = a0; v1 = 0; switch (*(v0)) { case 0: v3 = 0; return v3; case 126: v0 += 1; break; default: if (!a1) setpwent(); do { } while ((v1 = getpwent(), v1 && *(v0) == *(*(v1)) && !strcmp(v0))); if (!v1) { endpwent(); v3 = 0; return v3; } v3 = strdup(*(v1)); return v3; } }
static void check_child_status (int werrno, int wstatus, int max_ok_status, char const *subsidiary_program) { int status = (! werrno && ((( wstatus ) & 0x7f) == 0) ? ((( wstatus ) & 0xff00) >> 8) : 0x7fffffff); if (max_ok_status < status) { error (0, werrno, gettext (status == 126 ? "subsidiary program '%s' could not be invoked" : status == 127 ? "subsidiary program '%s' not found" : status == 0x7fffffff ? "subsidiary program '%s' failed" : "subsidiary program '%s' failed (exit status %d)") , subsidiary_program, status); exiterr (); } }
void check_child_status(int param_1,uint param_2,int param_3,undefined8 param_4) { uint uVar1; char *pcVar2; undefined8 uVar3; if ((param_1 == 0) && ((param_2 & 0x7f) == 0)) { uVar1 = (int)param_2 >> 8 & 0xff; } else { uVar1 = 0x7fffffff; } if (param_3 < (int)uVar1) { if (uVar1 == 0x7e) { pcVar2 = "subsidiary program \'%s\' could not be invoked"; } else if (uVar1 == 0x7f) { pcVar2 = "subsidiary program \'%s\' not found"; } else if (uVar1 == 0x7fffffff) { pcVar2 = "subsidiary program \'%s\' failed"; } else { pcVar2 = "subsidiary program \'%s\' failed (exit status %d)"; } uVar3 = gettext(pcVar2); error(0,param_1,uVar3,param_4,uVar1); exiterr(); } return; }
static void out_epoch_sec (char *pformat, size_t prefix_len, struct timespec arg) { char *dot = memchr (pformat, '.', prefix_len); size_t sec_prefix_len = prefix_len; int width = 0; int precision = 0; _Bool frac_left_adjust = 0 ; if (dot) { sec_prefix_len = dot - pformat; pformat[prefix_len] = '\0'; if (((unsigned int) (dot[1]) - '0' <= 9)) { long int lprec = strtol (dot + 1, ((void *)0) , 10); precision = (lprec <= 0x7fffffff ? lprec : 0x7fffffff); } else { precision = 9; } if (precision && ((unsigned int) (dot[-1]) - '0' <= 9)) { char *p = dot; *dot = '\0'; do --p; while (((unsigned int) (p[-1]) - '0' <= 9)); long int lwidth = strtol (p, ((void *)0) , 10); width = (lwidth <= 0x7fffffff ? lwidth : 0x7fffffff); if (1 < width) { p += (*p == '0'); sec_prefix_len = p - pformat; int w_d = (decimal_point_len < width ? width - decimal_point_len : 0); if (1 < w_d) { int w = w_d - precision; if (1 < w) { char *dst = pformat; for (char const *src = dst; src < p; src++) { if (*src == '-') frac_left_adjust = 1 ; else *dst++ = *src; } sec_prefix_len = (dst - pformat + (frac_left_adjust ? 0 : sprintf (dst, "%d", w))); } } } } } int divisor = 1; for (int i = precision; i < 9; i++) divisor *= 10; int frac_sec = arg.tv_nsec / divisor; int int_len; if ((! ((time_t) 0 < (time_t) -1))) { _Bool minus_zero = 0 ; if (arg.tv_sec < 0 && arg.tv_nsec != 0) { int frac_sec_modulus = 1000000000 / divisor; frac_sec = (frac_sec_modulus - frac_sec - (arg.tv_nsec % divisor != 0)); arg.tv_sec += (frac_sec != 0); minus_zero = (arg.tv_sec == 0); } int_len = (minus_zero ? out_minus_zero (pformat, sec_prefix_len) : out_int (pformat, sec_prefix_len, arg.tv_sec)); } else int_len = out_uint (pformat, sec_prefix_len, arg.tv_sec); if (precision) { int prec = (precision < 9 ? precision : 9); int trailing_prec = precision - prec; int ilen = (int_len < 0 ? 0 : int_len); int trailing_width = (ilen < width && decimal_point_len < width - ilen ? width - ilen - decimal_point_len - prec : 0); printf ("%s%.*d%-*.*d", decimal_point, prec, frac_sec, trailing_width, trailing_prec, 0); } }
void out_epoch_sec(char *a0, char *a1, unsigned int a2, unsigned long a3) { void* v0; unsigned int v1; char v2; char v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned int v8; unsigned int v9; unsigned int v10; unsigned int v11; unsigned long long v12; unsigned int v13; unsigned int v14; unsigned int v15; unsigned int v16; char *v17; char v18[2]; char *v19; char *v20; char v21[2]; unsigned long v22; unsigned long v23; unsigned int v25; unsigned int v26; unsigned int v27; char *v28; void* v29; unsigned long long v30; unsigned int v31; unsigned long long v32; v1 = a2; *(&v21) = memchr(a0, 0x2e, a1); v17 = a1; v4 = 0; v5 = 0; v2 = 0; if (v21) { v17 = v21 - a0; *((a1 + a0)) = 0; if (v21[1] - 48 <= 9) { v22 = strtol(&v21[1], NULL, 0xa); if (v22 < 0x80000000) v25 = v22; else v25 = 2147483647; v5 = v25; } else { v5 = 9; } if (v5 && v21[1] - 48 <= 9) { *(&v18) = v21; v21[0] = 0; do { *(&v18) = &v18[1]; } while (v18[1] - 48 <= 9); v23 = strtol(v18, NULL, 0xa); if (v23 < 0x80000000) v26 = v23; else v26 = 2147483647; v4 = v26; if (v4 > 1) { v18 = &v18[v18[0] == 48]; v17 = v18 + -0x1 * a0; if (v4 > decimal_point_len) v27 = v4 - decimal_point_len; else v27 = 0; v9 = v27; if (v9 > 1) { v10 = v9 - v5; if (v10 > 1) { v19 = a0; for (v20 = v19; v20 < v18; v20 += 1) { if (*(v20) == 45) { v2 = 1; } else { v28 = v19; v19 += 1; *(v28) = *(v20); } } if ((v2 ^ 1)) v29 = sprintf(v19, "%d", v10); else v29 = 0; v30 = v29 + v19 - a0; v17 = v30; } } } } } v6 = 1; for (v7 = v5; v7 <= 8; v7 += 1) { v6 = ((v6 * 4) + v6) * 2; } v8 = (a3 >> 63 CONCAT a3) /m v6; v3 = 0; if (*(&v1) < 0 && a3) { v11 = 0x3b9aca00 /m v6; v8 = v11 - v8 - ((a3 >> 63 CONCAT a3) /m v6 >> 64); *(&v1) = (v8) + *(&v1); v3 = !*(&v1); } if (v3) v31 = out_minus_zero(a0, v17); else v31 = out_int(a0, v17, *(&v1)); *(&v12) = v31; if (v5) { if (v5 <= 9) v31 = v5; else v31 = 9; v13 = v31; v14 = v5 - v13; if ((v12 - 0 >> 31 & 1 ^ 1)) v31 = v12; else v31 = 0; v15 = v31; if (v15 < v4 && v4 - v15 > decimal_point_len) v31 = v4 - v15 - decimal_point_len - v13; if (v4 - v15 <= decimal_point_len || v15 >= v4) v31 = 0; v16 = v31; v0 = 0; v32 = printf("%s%.*d%-*.*d", decimal_point, v13); } return; }
static void tls_log_func(int level, const char *str) { fprintf( stderr , "|<%d>| %s", level, str); }
long long tls_log_func(unsigned long a0, unsigned long a1) { return fprintf(stderr, "|<%d>| %s", a0, a1); }
static void display_window_size ( _Bool fancy, char const *device_name) { struct winsize win; if (get_win_size ( 0 , &win)) { if ( (*__errno_location ()) != 22 ) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", quotearg_n_style_colon (0, shell_escape_quoting_style, device_name)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, device_name)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, device_name)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (!fancy) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"%s: no size information for this device\"), quotearg_n_style_colon (0, shell_escape_quoting_style, device_name)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("%s: no size information for this device"), quotearg_n_style_colon (0, shell_escape_quoting_style, device_name)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("%s: no size information for this device"), quotearg_n_style_colon (0, shell_escape_quoting_style, device_name)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; } else { wrapf (fancy ? "rows %d; columns %d;" : "%d %d\n", win.ws_row, win.ws_col); if (!fancy) current_col = 0; } }
void display_window_size(unsigned long a0, unsigned long long a1) { char v0; char v1; unsigned long long v4; unsigned long long v5; unsigned long long *v6; unsigned long long v7; if (!get_win_size(0x0, &v0)) { wrapf(); if ((a0 ^ 1)) current_col = 0; } else if (*(__errno_location()) != 22) { v4 = quotearg_n_style_colon(0x0, 0x3, a1); error(0x1, *(__errno_location()), "%s"); } else if ((a0 ^ 1)) { v5 = quotearg_n_style_colon(0x0, 0x3, a1); error(0x1, 0x0, gettext("%s: no size information for this device")); } v7 = *(&v1) ^ v6[5]; return; }
static int execute_cond_node (cond) COND_COM *cond; { int result, invert, patmatch, rmatch, arith, mode, mflags, ignore; char *arg1, *arg2, *op; invert = (cond->flags & 0x04); ignore = (cond->flags & 0x08); if (ignore) { if (cond->left) cond->left->flags |= 0x08; if (cond->right) cond->right->flags |= 0x08; } if (cond->type == 6) result = execute_cond_node (cond->left); else if (cond->type == 2) { result = execute_cond_node (cond->left); if (result != 0) result = execute_cond_node (cond->right); } else if (cond->type == 1) { result = execute_cond_node (cond->left); if (result == 0) result = execute_cond_node (cond->right); } else if (cond->type == 3) { int oa, varop, varflag; if (ignore) comsub_ignore_return++; varop = ((cond->op->word)[0] == ("-v")[0] && strcmp(cond->op->word, "-v") == 0); varflag = (varop && valid_array_reference (cond->left->op->word, 0x001)) ? 0x08 : 0; arg1 = cond_expand_word (cond->left->op, varop ? 3 : 0); if (ignore) comsub_ignore_return--; if (arg1 == 0) arg1 = nullstr; if (echo_command_at_execute) xtrace_print_cond_term (cond->type, invert, cond->op, arg1, (char *) ((void *)0) ); if (varop) oa = set_expand_once (0, 0); result = unary_test (cond->op->word, arg1, varflag) ? 0 : 1; if (varop) assoc_expand_once = oa; if (arg1 != nullstr) sh_xfree((arg1), "execute_cmd.c", 3931); } else if (cond->type == 4) { rmatch = 0; op = cond->op->word; mode = 0; patmatch = (((op[1] == '=') && (op[2] == '\0') && (op[0] == '!' || op[0] == '=')) || (op[0] == '=' && op[1] == '\0')); rmatch = (op[0] == '=' && op[1] == '~' && op[2] == '\0'); arith = ((op)[0] == ("-eq")[0] && strcmp(op, "-eq") == 0) || ((op)[0] == ("-ne")[0] && strcmp(op, "-ne") == 0) || ((op)[0] == ("-lt")[0] && strcmp(op, "-lt") == 0) || ((op)[0] == ("-le")[0] && strcmp(op, "-le") == 0) || ((op)[0] == ("-gt")[0] && strcmp(op, "-gt") == 0) || ((op)[0] == ("-ge")[0] && strcmp(op, "-ge") == 0); if (arith) mode = 3; else if (rmatch && shell_compatibility_level > 31) mode = 2; else if (patmatch) mode = 1; if (ignore) comsub_ignore_return++; arg1 = cond_expand_word (cond->left->op, arith ? mode : 0); if (ignore) comsub_ignore_return--; if (arg1 == 0) arg1 = nullstr; if (ignore) comsub_ignore_return++; arg2 = cond_expand_word (cond->right->op, mode); if (ignore) comsub_ignore_return--; if (arg2 == 0) arg2 = nullstr; if (echo_command_at_execute) xtrace_print_cond_term (cond->type, invert, cond->op, arg1, arg2); if (rmatch) { mflags = 0x002; mflags |= 0x001; result = sh_regmatch (arg1, arg2, mflags); } else { int oe; oe = extended_glob; extended_glob = 1; result = binary_test (cond->op->word, arg1, arg2, 0x01|0x02|0x04) ? 0 : 1; extended_glob = oe; } if (arg1 != nullstr) sh_xfree((arg1), "execute_cmd.c", 4002); if (arg2 != nullstr) sh_xfree((arg2), "execute_cmd.c", 4004); } else { command_error ("execute_cond_node", 1, cond->type, 0); jump_to_top_level (2); result = 1; } if (invert) result = (result == 0) ? 1 : 0; return result; }
uint execute_cond_node(uint *param_1) { char *__s1; bool bVar1; bool bVar2; bool bVar3; uint uVar4; uint uVar5; int iVar6; undefined4 uVar7; undefined8 uVar8; uint local_50; undefined4 local_4c; undefined4 local_48; undefined *local_20; undefined *local_18; uVar4 = *param_1 & 4; uVar5 = *param_1 & 8; if (uVar5 != 0) { if (*(long *)(param_1 + 6) != 0) { **(uint **)(param_1 + 6) = **(uint **)(param_1 + 6) | 8; } if (*(long *)(param_1 + 8) != 0) { **(uint **)(param_1 + 8) = **(uint **)(param_1 + 8) | 8; } } if (param_1[2] == 6) { local_50 = execute_cond_node(*(undefined8 *)(param_1 + 6)); } else if (param_1[2] == 2) { local_50 = execute_cond_node(*(undefined8 *)(param_1 + 6)); if (local_50 != 0) { local_50 = execute_cond_node(*(undefined8 *)(param_1 + 8)); } } else if (param_1[2] == 1) { local_50 = execute_cond_node(*(undefined8 *)(param_1 + 6)); if (local_50 == 0) { local_50 = execute_cond_node(*(undefined8 *)(param_1 + 8)); } } else if (param_1[2] == 3) { if (uVar5 != 0) { comsub_ignore_return = comsub_ignore_return + 1; } if ((***(char ***)(param_1 + 4) == '-') && (iVar6 = strcmp(**(char ***)(param_1 + 4),"-v"), iVar6 == 0)) { bVar1 = true; } else { bVar1 = false; } if ((bVar1) && (iVar6 = valid_array_reference(**(undefined8 **)(*(long *)(param_1 + 6) + 0x10),1), iVar6 != 0)) { uVar7 = 8; } else { uVar7 = 0; } if (bVar1) { uVar8 = 3; } else { uVar8 = 0; } local_20 = (undefined *)cond_expand_word(*(undefined8 *)(*(long *)(param_1 + 6) + 0x10),uVar8); if (uVar5 != 0) { comsub_ignore_return = comsub_ignore_return + -1; } if (local_20 == (undefined *)0x0) { local_20 = &DAT_0010b366; } if (echo_command_at_execute != 0) { xtrace_print_cond_term(param_1[2],uVar4,*(undefined8 *)(param_1 + 4),local_20,0); } if (bVar1) { local_48 = set_expand_once(0,0); } iVar6 = unary_test(**(undefined8 **)(param_1 + 4),local_20,uVar7); local_50 = (uint)(iVar6 == 0); if (bVar1) { _assoc_expand_once = local_48; } if (local_20 != &DAT_0010b366) { sh_xfree(local_20,"execute_cmd.c",0xf5b); } } else if (param_1[2] == 4) { __s1 = **(char ***)(param_1 + 4); local_4c = 0; if ((((__s1[1] == '=') && (__s1[2] == '\0')) && ((*__s1 == '!' || (*__s1 == '=')))) || ((*__s1 == '=' && (__s1[1] == '\0')))) { bVar1 = true; } else { bVar1 = false; } if (((*__s1 == '=') && (__s1[1] == '~')) && (__s1[2] == '\0')) { bVar3 = true; } else { bVar3 = false; } if (((((*__s1 == '-') && (iVar6 = strcmp(__s1,"-eq"), iVar6 == 0)) || ((*__s1 == '-' && (iVar6 = strcmp(__s1,"-ne"), iVar6 == 0)))) || (((*__s1 == '-' && (iVar6 = strcmp(__s1,"-lt"), iVar6 == 0)) || ((*__s1 == '-' && (iVar6 = strcmp(__s1,"-le"), iVar6 == 0)))))) || (((*__s1 == '-' && (iVar6 = strcmp(__s1,"-gt"), iVar6 == 0)) || ((*__s1 == '-' && (iVar6 = strcmp(__s1,"-ge"), iVar6 == 0)))))) { bVar2 = true; } else { bVar2 = false; } if (bVar2) { local_4c = 3; } else if ((bVar3) && (0x1f < shell_compatibility_level)) { local_4c = 2; } else if (bVar1) { local_4c = 1; } if (uVar5 != 0) { comsub_ignore_return = comsub_ignore_return + 1; } uVar7 = local_4c; if (!bVar2) { uVar7 = 0; } local_20 = (undefined *)cond_expand_word(*(undefined8 *)(*(long *)(param_1 + 6) + 0x10),uVar7); if (uVar5 != 0) { comsub_ignore_return = comsub_ignore_return + -1; } if (local_20 == (undefined *)0x0) { local_20 = &DAT_0010b366; } if (uVar5 != 0) { comsub_ignore_return = comsub_ignore_return + 1; } local_18 = (undefined *) cond_expand_word(*(undefined8 *)(*(long *)(param_1 + 8) + 0x10),local_4c); if (uVar5 != 0) { comsub_ignore_return = comsub_ignore_return + -1; } if (local_18 == (undefined *)0x0) { local_18 = &DAT_0010b366; } if (echo_command_at_execute != 0) { xtrace_print_cond_term(param_1[2],uVar4,*(undefined8 *)(param_1 + 4),local_20,local_18); } uVar7 = extended_glob; if (bVar3) { local_50 = sh_regmatch(local_20,local_18,3); } else { extended_glob = 1; iVar6 = binary_test(**(undefined8 **)(param_1 + 4),local_20,local_18,7); local_50 = (uint)(iVar6 == 0); extended_glob = uVar7; } if (local_20 != &DAT_0010b366) { sh_xfree(local_20,"execute_cmd.c",0xfa2); } if (local_18 != &DAT_0010b366) { sh_xfree(local_18,"execute_cmd.c",0xfa4); } } else { command_error("execute_cond_node",1,param_1[2],0); jump_to_top_level(2); } if (uVar4 != 0) { local_50 = (uint)(local_50 == 0); } return local_50; }
void u32reset () { if (u32init && localconv != (iconv_t)-1) { iconv_close (localconv); localconv = (iconv_t)-1; } u32init = 0; utf8locale = 0; }
long long u32reset() { unsigned long long v1; v1 = u32init; if (u32init) { v1 = localconv; if (localconv != -1) { v1 = iconv_close(localconv); localconv = -1; } } u32init = 0; utf8locale = 0; return v1; }
static gnutls_digest_algorithm_t get_dig(gnutls_x509_crt_t crt, common_info_st * cinfo) { gnutls_digest_algorithm_t dig; gnutls_pubkey_t pubkey; int result; result = gnutls_pubkey_init(&pubkey); if (result < 0) { fprintf( stderr , "memory error\n"); app_exit(1); } result = gnutls_pubkey_import_x509(pubkey, crt, 0); if (result < 0) { { fprintf( stderr , "gnutls_pubkey_import_x509: %s\n", gnutls_strerror(result)); app_exit(1); } } dig = get_dig_for_pub(pubkey, cinfo); gnutls_pubkey_deinit(pubkey); return dig; }
undefined4 get_dig(undefined8 param_1,undefined8 param_2) { int iVar1; undefined4 uVar2; undefined8 uVar3; long in_FS_OFFSET; undefined8 local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); iVar1 = gnutls_pubkey_init(&local_18); if (iVar1 < 0) { fprintf(stderr,"memory error\n"); app_exit(1); } iVar1 = gnutls_pubkey_import_x509(local_18,param_1,0); if (iVar1 < 0) { uVar3 = gnutls_strerror(iVar1); fprintf(stderr,"gnutls_pubkey_import_x509: %s\n",uVar3); app_exit(1); } uVar2 = get_dig_for_pub(local_18,param_2); gnutls_pubkey_deinit(local_18); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar2; }
void write_file_footers (structfile, externfile) FILE *structfile, *externfile; { register int i; if (structfile) { for (i = 0; structfile_footer[i]; i++) fprintf (structfile, "%s\n", structfile_footer[i]); } }
void write_file_footers(void* a0, unsigned long a1) { unsigned long v0; void* v2; unsigned long long v3; v0 = a1; if (a0) { v2 = 0; while (true) { v3 = *((0x8 * v2 + &structfile_footer[0])); if (!*((0x8 * v2 + &structfile_footer[0]))) break; fprintf(a0, "%s\n", *((0x8 * v2 + &structfile_footer[0]))); v2 = v2 + 1; } } return; }
rtnl_rttable_n2a(rta_getattr_u32(tb[SEG6_LOCAL_VRFTABLE]), b1, sizeof(b1))); if (tb[SEG6_LOCAL_NH4]) { print_string(PRINT_ANY, "nh4", "nh4 %s ", rt_addr_n2a( 2 , ((int)((tb[SEG6_LOCAL_NH4])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), ((void*)(((char*)(tb[SEG6_LOCAL_NH4])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))))); }
void rtnl_rttable_n2a(void) { halt_baddata(); }
static int channel_parse_id(struct ssh *ssh, const char *where, const char *what) { u_int32_t id; int r; if ((r = sshpkt_get_u32(ssh, &id)) != 0) { sshlog("channels.c", __func__, 3179, 0, SYSLOG_LEVEL_ERROR, ssh_err(r), "%s: parse id", where); ssh_packet_disconnect(ssh, "Invalid %s message", what); } if (id > 0x7fffffff) { sshlog("channels.c", __func__, 3183, 0, SYSLOG_LEVEL_ERROR, ssh_err(r), "%s: bad channel id %u", where, id); ssh_packet_disconnect(ssh, "Invalid %s channel id", what); } return (int)id; }
int channel_parse_id(unsigned long long a0, unsigned long a1, unsigned long long a2) { unsigned long v0; unsigned long v1; char v2; unsigned int v3; v3 = sshpkt_get_u32(a0, &v2, &v2); if (v3) { v1 = a1; sshlog("channels.c", "channel_parse_id", 0xc6b, 0x0, 0x2, ssh_err(v3), "%s: parse id"); ssh_packet_disconnect(a0, "Invalid %s message", a2); } if (*(&v2) < 0) { v0 = a1; sshlog("channels.c", "channel_parse_id", 0xc6f, 0x0, 0x2, ssh_err(v3), "%s: bad channel id %u"); ssh_packet_disconnect(a0, "Invalid %s channel id", a2); } return *(&v2); }
int should_optimize_fork (command, subshell) COMMAND *command; int subshell; { return (running_trap == 0 && command->type == cm_simple && signal_is_trapped (0) == 0 && signal_is_trapped ( (64 + 1) +1) == 0 && any_signals_trapped () < 0 && (subshell || (command->redirects == 0 && command->value.Simple->redirects == 0)) && ((command->flags & 0x80) == 0) && ((command->flags & 0x04) == 0)); }
_BOOL8 should_optimize_fork(long a1, int a2) { return !running_trap && *(_DWORD *)a1 == 4 && !(unsigned int)signal_is_trapped(0LL) && !(unsigned int)signal_is_trapped(66LL) && (int)any_signals_trapped() < 0 && (a2 || !*(_QWORD *)(a1 + 16) && !*(_QWORD *)(*(_QWORD *)(a1 + 24) + 16LL)) && (*(_DWORD *)(a1 + 4) & 0x80) == 0 && (*(_DWORD *)(a1 + 4) & 4) == 0; }
static void remove_suffix (char *name, char const *suffix) { char *np; char const *sp; np = name + strlen (name); sp = suffix + strlen (suffix); while (np > name && sp > suffix) if (*--np != *--sp) return; if (np > name) *np = '\0'; }
void remove_suffix(char *a0, char *a1) { char *v0; char *v1; unsigned long long v4; char *v5; char *v6; v0 = &a0[strlen(a0)]; v1 = &a1[strlen(a1)]; while (v0 > a0 && v1 > a1) { v0 += 1; v1 += 1; v4 = *(v1); if (*(v0) != *(v1)) return; } v5 = v0; if (v0 > a0) { v6 = v0; *(v0) = 0; } return; }
void log_setup_kmod_log(struct kmod_ctx *ctx, int priority) { log_priority = priority; kmod_set_log_priority(ctx, log_priority); kmod_set_log_fn(ctx, log_kmod, ((void *)0) ); }
void log_setup_kmod_log(undefined8 param_1,undefined4 param_2) { log_priority = param_2; kmod_set_log_priority(param_1,param_2); kmod_set_log_fn(param_1,log_kmod,0); return; }
static int optionl_getfilecon (int fd, const char *name, char **p) { int rv = getfileconat (fd, name, p); if (0 == rv) return 0; else return fallback_getfilecon (fd, name, p, rv); }
undefined8 optionl_getfilecon(undefined4 param_1,undefined8 param_2,undefined8 param_3) { int iVar1; undefined8 uVar2; iVar1 = getfileconat(param_1,param_2,param_3); if (iVar1 == 0) { uVar2 = 0; } else { uVar2 = fallback_getfilecon(param_1,param_2,param_3,iVar1); } return uVar2; }
static int reset_locale_vars () { char *t, *x; if (lang == 0 || *lang == '\0') maybe_make_export_env (); if (setlocale ( 6 , lang ? lang : "") == 0) return 0; x = 0; x = setlocale ( 0 , get_locale_var ("LC_CTYPE")); t = setlocale ( 3 , get_locale_var ("LC_COLLATE")); t = setlocale ( 5 , get_locale_var ("LC_MESSAGES")); t = setlocale ( 1 , get_locale_var ("LC_NUMERIC")); t = setlocale ( 2 , get_locale_var ("LC_TIME")); locale_setblanks (); locale_mb_cur_max = (__ctype_get_mb_cur_max ()) ; if (x) locale_utf8locale = locale_isutf8 (x); locale_shiftstates = mblen ((char *) ((void *)0) , 0); u32reset (); return 1; }
int reset_locale_vars(unsigned long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned int v0; unsigned long v1; unsigned int v3; if (!lang || !*(lang)) maybe_make_export_env(); v3 = (!lang ? lang : &g_401480); if (!setlocale(0x6, v3)) { v3 = 0; return v3; } v0 = 0; *(&v0) = setlocale(0x0, get_locale_var("LC_CTYPE")); v1 = setlocale(0x3, get_locale_var("LC_COLLATE")); v1 = setlocale(0x5, get_locale_var("LC_MESSAGES")); v1 = setlocale(0x1, get_locale_var("LC_NUMERIC")); v1 = setlocale(0x2, get_locale_var("LC_TIME")); locale_setblanks(); locale_mb_cur_max = __ctype_get_mb_cur_max(0x2, a1, a2, a3, a4, a5); if (*(&v0)) locale_mb_cur_max = locale_isutf8(*(&v0)); locale_shiftstates = mblen(NULL, 0x0); u32reset(0x0, 0x0, a2, a3, a4, a5); v3 = 1; return v3; }
((*__ctype_b_loc ())[(int) (( c ))] & (unsigned short int) _ISgraph) : iswgraph(c)) && !(((u_char)(c)) >= L'0' && ((u_char)(c)) <= L'7')) { *dst++ = L'\\'; *dst++ = c; return dst; }
ushort ** __ctype_b_loc(void) { halt_baddata(); }
static void print_cond_node (cond) COND_COM *cond; { if (cond->flags & 0x04) cprintf ("! "); if (cond->type == 6) { cprintf ("( "); print_cond_node (cond->left); cprintf (" )"); } else if (cond->type == 1) { print_cond_node (cond->left); cprintf (" && "); print_cond_node (cond->right); } else if (cond->type == 2) { print_cond_node (cond->left); cprintf (" || "); print_cond_node (cond->right); } else if (cond->type == 3) { cprintf ("%s", cond->op->word); cprintf (" "); print_cond_node (cond->left); } else if (cond->type == 4) { print_cond_node (cond->left); cprintf (" "); cprintf ("%s", cond->op->word); cprintf (" "); print_cond_node (cond->right); } else if (cond->type == 5) { cprintf ("%s", cond->op->word); } }
void print_cond_node(struct_0 *a0) { unsigned long long v1; unsigned long long v2; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; if ((a0->field_0 & 4)) cprintf("! "); if (a0->field_8 == 6) { cprintf("( "); print_cond_node(a0->field_18); v1 = cprintf(" )"); } else if (a0->field_8 == 1) { print_cond_node(a0->field_18); cprintf(" && "); v2 = print_cond_node(a0->field_20); } else if (a0->field_8 == 2) { print_cond_node(a0->field_18); cprintf(" || "); v4 = print_cond_node(a0->field_20); } else if (a0->field_8 == 3) { cprintf("%s"); cprintf(" "); v5 = print_cond_node(a0->field_18); } else if (a0->field_8 == 4) { print_cond_node(a0->field_18); cprintf(" "); cprintf("%s"); cprintf(" "); v7 = print_cond_node(a0->field_20); } else { v3 = a0->field_8; if (a0->field_8 == 5) v6 = cprintf("%s"); } return; }
void ssh_packet_send_debug(struct ssh *ssh, const char *fmt,...) { char buf[1024]; va_list args; int r; if ((ssh->compat & 0x00000040)) return; __builtin_va_start( args , fmt ) ; vsnprintf(buf, sizeof(buf), fmt, args); __builtin_va_end( args ) ; sshlog("packet.c", __func__, 1840, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "sending debug message: %s", buf); if ((r = sshpkt_start(ssh, 4)) != 0 || (r = sshpkt_put_u8(ssh, 0)) != 0 || (r = sshpkt_put_cstring(ssh, buf)) != 0 || (r = sshpkt_put_cstring(ssh, "")) != 0 || (r = sshpkt_send(ssh)) != 0 || (r = ssh_packet_write_wait(ssh)) != 0) sshfatal("packet.c", __func__, 1848, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "send DEBUG"); }
long long ssh_packet_send_debug() { unsigned long long v0; unsigned long v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned long v5; unsigned long v6; char v7; unsigned long v8; char v9; unsigned long v10; unsigned long v11; unsigned long v12; unsigned long v13; int v14; int v15; int v16; int v17; int v18; int v19; int v20; int v21; unsigned long v22; unsigned long v23; unsigned long v24; unsigned long v25; unsigned long v26; char v27; int v28; int v29; int v30; int v31; int v32; int v33; int v34; int v35; unsigned long long *v36; struct_0 *v37; char *v38; v10 = v23; v11 = v24; v12 = v25; v13 = v26; if (v27) { v14 = v28; v15 = v29; v16 = v30; v17 = v31; v18 = v32; v19 = v33; v20 = v34; v21 = v35; } v8 = v36[5]; if (!(v37->field_83c & 64)) { v3 = 16; v4 = 48; v5 = &v22; v6 = &v9; vsnprintf(&v7, 0x400, v38, &v3); v1 = &v7; v0 = "sending debug message: %s"; sshlog("packet.c", "ssh_packet_send_debug", 0x730, 0x0, 0x7, 0x0); v2 = sshpkt_start(v37, 0x4); if (!v2) { v2 = sshpkt_put_u8(v37, 0x0); if (!v2) { v2 = sshpkt_put_cstring(v37, &v7); if (!v2) { v2 = sshpkt_put_cstring(v37, &g_407061); if (!v2) { v2 = sshpkt_send(v37, &g_407061, 0x730, 0x0, 0x7, 0x0); if (!v2) { v2 = ssh_packet_write_wait(v37); if (!v2) { if (!(v8 ^ v36[5])) return 0; __stack_chk_fail(); } } } } } } v0 = "send DEBUG"; sshfatal("packet.c", "ssh_packet_send_debug", 0x738, 0x1, 0x1, ssh_err(v2)); } if ((v8 ^ v36[5])) __stack_chk_fail(); return 0; }
gnutls_session_t init_tls_session(const char *host) { const char *err; int ret; unsigned i; gnutls_session_t session; if (udp) { gnutls_init(&session, (1<<2) | init_flags); if (mtu) gnutls_dtls_set_mtu(session, mtu); } else gnutls_init(&session, init_flags); if (priorities == ((void *)0) ) { ret = gnutls_set_default_priority(session); if (ret < 0) { fprintf( stderr , "Error in setting priorities: %s\n", gnutls_strerror(ret)); exit(1); } } else { ret = gnutls_priority_set_direct(session, priorities, &err); if (ret < 0) { if (ret == -50) fprintf( stderr , "Syntax error at: %s\n", err); else fprintf( stderr , "Error in priorities: %s\n", gnutls_strerror(ret)); exit(1); } } if (disable_extensions == 0 && disable_sni == 0) { if (gnutls_cli_options.present.sni_hostname) { const char *sni_host = gnutls_cli_options.arg.sni_hostname; canonicalize_host((char *) sni_host, ((void *)0) , 0); gnutls_server_name_set(session, GNUTLS_NAME_DNS, sni_host, strlen(sni_host)); } else if (host != ((void *)0) && is_ip(host) == 0) gnutls_server_name_set(session, GNUTLS_NAME_DNS, host, strlen(host)); } if (gnutls_cli_options.present.dh_bits) { gnutls_dh_set_prime_bits(session, gnutls_cli_options.value.dh_bits); } if (gnutls_cli_options.present.alpn) { unsigned proto_n = gnutls_cli_options.list.alpn.count; char **protos = (void *) gnutls_cli_options.list.alpn.args; if (proto_n > 1024) { fprintf( stderr , "Number of ALPN protocols too large (%d)\n", proto_n); exit(1); } gnutls_datum_t p[1024]; for (i = 0; i < proto_n; i++) { p[i].data = (void *) protos[i]; p[i].size = strlen(protos[i]); } gnutls_alpn_set_protocols(session, p, proto_n, 0); } gnutls_credentials_set(session, GNUTLS_CRD_ANON, anon_cred); if (srp_cred) gnutls_credentials_set(session, GNUTLS_CRD_SRP, srp_cred); if (psk_cred) gnutls_credentials_set(session, GNUTLS_CRD_PSK, psk_cred); gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred); gnutls_certificate_set_retrieve_function2(xcred, cert_callback); gnutls_certificate_set_verify_function(xcred, cert_verify_callback); if (record_max_size > 0 && disable_extensions == 0) { if (gnutls_record_set_max_size(session, record_max_size) < 0) { fprintf( stderr , "Cannot set the maximum record size to %d.\n", record_max_size); fprintf( stderr , "Possible values: 512, 1024, 2048, 4096.\n"); exit(1); } } if (gnutls_cli_options.present.compress_cert && disable_extensions == 0) { ret = compress_cert_set_methods(session, gnutls_cli_options.list.compress_cert.args, gnutls_cli_options.list.compress_cert.count); if (ret < 0) exit(1); } if (gnutls_cli_options.present.heartbeat) gnutls_heartbeat_enable(session, (1)); if (gnutls_cli_options.present.srtp_profiles) { ret = gnutls_srtp_set_profile_direct(session, gnutls_cli_options.arg.srtp_profiles, &err); if (ret == -50) fprintf( stderr , "Syntax error at: %s\n", err); else if (ret != 0) fprintf( stderr , "Error in profiles: %s\n", gnutls_strerror(ret)); else fprintf( stderr ,"DTLS profile set to %s\n", gnutls_cli_options.arg.srtp_profiles); if (ret != 0) exit(1); } return session; }
long long init_tls_session(char *a0) { unsigned int v0; unsigned int v1; unsigned int v2; char v3; char v4; char *v5; unsigned long long *v6; char v7; char v8; char v9; unsigned long long v10; unsigned long v11; unsigned long long *v13; do { v10 = v10; } while (&v10 != &v9); v11 = v13[5]; if (!udp) { gnutls_init(&v4, *(&init_flags), *(&init_flags)); } else { gnutls_init(&v4, *(&init_flags) | 4, *(&init_flags) | 4); if (mtu) gnutls_dtls_set_mtu(*(&v4), mtu, mtu); } if (priorities) { v1 = gnutls_priority_set_direct(*(&v4), priorities, &v3, priorities); if (v1 < 0) { if (v1 == -50) fprintf(*(&stderr), "Syntax error at: %s\n", *(&v3)); else fprintf(*(&stderr), "Error in priorities: %s\n", gnutls_strerror(v1)); exit(0x1); } } else { v1 = gnutls_set_default_priority(*(&v4)); if (v1 < 0) { fprintf(*(&stderr), "Error in setting priorities: %s\n", gnutls_strerror(v1)); exit(0x1); } } if (!disable_extensions && !disable_sni) { if (g_500103) { v5 = service_to_port; canonicalize_host(v5, 0x0, 0x0); gnutls_server_name_set(*(&v4), 0x1, v5, strlen(v5)); } else if (a0 && !is_ip(a0)) { gnutls_server_name_set(*(&v4), 0x1, a0, strlen(a0)); } } if (g_500112) gnutls_dh_set_prime_bits(*(&v4), gnutls_perror, gnutls_perror); if (g_500129) { v2 = gnutls_session_get_data2; v6 = gnutls_session_is_resumed; if (v2 > 0x400) { fprintf(*(&stderr), "Number of ALPN protocols too large (%d)\n", v2); exit(0x1); } for (v0 = 0; v0 < v2; v0 += 1) { *(&(&v7)[16 * v0]) = v6[v0]; *(&(&v8)[16 * v0]) = strlen(v6[v0]); } gnutls_alpn_set_protocols(*(&v4), &v7, v2, 0x0); } gnutls_credentials_set(*(&v4), 0x2, anon_cred); if (srp_cred) gnutls_credentials_set(*(&v4), 0x3, srp_cred); if (psk_cred) gnutls_credentials_set(*(&v4), 0x4, psk_cred); gnutls_credentials_set(*(&v4), 0x1, xcred); gnutls_certificate_set_retrieve_function2(xcred, cert_callback); gnutls_certificate_set_verify_function(xcred, cert_verify_callback); if (record_max_size > 0 && !disable_extensions && gnutls_record_set_max_size(*(&v4), record_max_size, record_max_size) < 0) { fprintf(*(&stderr), "Cannot set the maximum record size to %d.\n", record_max_size); fprintf(*(&stderr), "Possible values: 512, 1024, 2048, 4096.\n"); exit(0x1); } if (g_50012a && !disable_extensions) { v1 = compress_cert_set_methods(*(&v4), gnutls_protocol_get_version, gnutls_session_get_flags, gnutls_protocol_get_version); if (v1 < 0) exit(0x1); } if (g_50012b) gnutls_heartbeat_enable(*(&v4), 0x1); if (perror) { v1 = gnutls_srtp_set_profile_direct(*(&v4), gnutls_heartbeat_enable, &v3, gnutls_heartbeat_enable); if (v1 == -50) { fprintf(*(&stderr), "Syntax error at: %s\n", *(&v3)); } else if (!v1) { fprintf(*(&stderr), "DTLS profile set to %s\n", gnutls_heartbeat_enable); } else { fprintf(*(&stderr), "Error in profiles: %s\n", gnutls_strerror(v1)); } if (v1) exit(0x1); } if (!(v11 ^ v13[5])) return *(&v4); __stack_chk_fail(); }
char * acl_to_any_text(acl_t acl, const char *prefix, char separator, int options) { return __acl_to_any_text(acl, ((void *)0) , prefix, separator, ((void *)0) , options); }
long long acl_to_any_text(unsigned long long a0, unsigned long long a1, unsigned long a2, unsigned long a3) { char v0; char v1; return __acl_to_any_text(a0, 0x0, a1, a2, 0x0, a3, *(&v0), *(&v1), a1, a0); }
int channel_request_remote_forwarding(struct ssh *ssh, struct Forward *fwd) { int r, success = 0, idx = -1; char *host_to_connect, *listen_host, *listen_path; int port_to_connect, listen_port; if (fwd->listen_path != ((void *)0) ) { if ((r = sshpkt_start(ssh, 80)) != 0 || (r = sshpkt_put_cstring(ssh, "streamlocal-forward@openssh.com")) != 0 || (r = sshpkt_put_u8(ssh, 1)) != 0 || (r = sshpkt_put_cstring(ssh, fwd->listen_path)) != 0 || (r = sshpkt_send(ssh)) != 0 || (r = ssh_packet_write_wait(ssh)) != 0) sshfatal("channels.c", __func__, 4096, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "request streamlocal"); } else { if ((r = sshpkt_start(ssh, 80)) != 0 || (r = sshpkt_put_cstring(ssh, "tcpip-forward")) != 0 || (r = sshpkt_put_u8(ssh, 1)) != 0 || (r = sshpkt_put_cstring(ssh, channel_rfwd_bind_host(fwd->listen_host))) != 0 || (r = sshpkt_put_u32(ssh, fwd->listen_port)) != 0 || (r = sshpkt_send(ssh)) != 0 || (r = ssh_packet_write_wait(ssh)) != 0) sshfatal("channels.c", __func__, 4106, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "request tcpip-forward"); } success = 1; if (success) { host_to_connect = listen_host = listen_path = ((void *)0) ; port_to_connect = listen_port = 0; if (fwd->connect_path != ((void *)0) ) { host_to_connect = xstrdup(fwd->connect_path); port_to_connect = -2; } else { host_to_connect = xstrdup(fwd->connect_host); port_to_connect = fwd->connect_port; } if (fwd->listen_path != ((void *)0) ) { listen_path = xstrdup(fwd->listen_path); listen_port = -2; } else { if (fwd->listen_host != ((void *)0) ) listen_host = xstrdup(fwd->listen_host); listen_port = fwd->listen_port; } idx = permission_set_add(ssh, 0x101, (1<<1), host_to_connect, port_to_connect, listen_host, listen_path, listen_port, ((void *)0) ); } return idx; }
long long channel_request_remote_forwarding(void* a0, struct_0 *a1) { unsigned long long v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned long v6; void* v7; void* v8; char v9; unsigned long v10; char v11; v5 = 0; v2 = -1; if (a1->field_10) { v1 = sshpkt_start(a0, 0x50); if (!v1) { v1 = sshpkt_put_cstring(a0, "streamlocal-forward@openssh.com"); if (!v1) { v1 = sshpkt_put_u8(a0, 0x1); if (!v1) { v1 = sshpkt_put_cstring(a0, a1->field_10); if (!v1) { v1 = sshpkt_send(a0); if (!v1) { v1 = ssh_packet_write_wait(a0); if (!v1) goto LABEL_40db50; } } } } } v0 = "request streamlocal"; sshfatal("channels.c", "channel_request_remote_forwarding", 0x1000, 0x1, 0x1, ssh_err(v1)); } v1 = sshpkt_start(a0, 0x50); if (!v1) { v1 = sshpkt_put_cstring(a0, "tcpip-forward"); if (!v1) { v1 = sshpkt_put_u8(a0, 0x1); if (!v1) { v1 = sshpkt_put_cstring(a0, channel_rfwd_bind_host(a1->field_0)); if (!v1) { v1 = sshpkt_put_u32(a0, a1->field_8, a1->field_8); if (!v1) { v1 = sshpkt_send(a0); if (!v1) { v1 = ssh_packet_write_wait(a0); if (!v1) goto LABEL_40db50; } } } } } } v8 = "request tcpip-forward"; sshfatal("channels.c", "channel_request_remote_forwarding", 0x100a, 0x1, 0x1, ssh_err(v1)); LABEL_40db50: v5 = 1; if (v5) { v8 = 0; v7 = v8; v6 = v7; v4 = 0; v3 = v4; if (!a1->field_28) { v6 = xstrdup(a1->field_18); v3 = a1->field_20; } else { v6 = xstrdup(a1->field_28); v3 = -2; } if (a1->field_10) { v8 = xstrdup(a1->field_10); v4 = -2; } else { if (a1->field_0) v7 = xstrdup(a1->field_0); v4 = a1->field_8; } v8 = 0; v7 = v4; v6 = v8; v2 = permission_set_add(a0, 0x101, 0x2, v6, v3, v7, *(&v9), v10, *(&v11)); } return v2; }
static void evalerror (msg) const char *msg; { char *name, *t; name = this_command_name; for (t = expression; t && (((*t) == ' ') || ((*t) == '\t')); t++) ; internal_error (gettext("%s%s%s: %s (error token is \"%s\")"), name ? name : "", name ? ": " : "", t ? t : "", msg, (lasttp && *lasttp) ? lasttp : ""); siglongjmp((evalbuf), (1)); }
void evalerror(long a1) { void *v1; void *v2; const char *v3; void *v4; char *v5; _BYTE *i; for ( i = (_BYTE *)expression; i && (*i == 32 || *i == 9); ++i ) ; if ( lasttp && *(_BYTE *)lasttp ) v1 = (void *)lasttp; else v1 = &unk_3102; if ( i ) v2 = i; else v2 = &unk_3102; if ( this_command_name ) v3 = ": "; else v3 = (const char *)&unk_3102; if ( this_command_name ) v4 = (void *)this_command_name; else v4 = &unk_3102; v5 = gettext("%s%s%s: %s (error token is \"%s\")"); internal_error(v5, v4, v3, v2, a1, v1); siglongjmp(evalbuf, 1); }
static void _rl_mvcxt_dispose (_rl_vimotion_cxt *m) { xfree (m); }
void _rl_mvcxt_dispose(unsigned long long a0) { unsigned long long v1; v1 = xfree(a0); return; }
static int ext4_fc_handle_del_range(e2fsck_t ctx, __u8 *val) { struct ext2fs_extent extent; struct ext4_fc_del_range del_range; int ret, ino; memcpy(&del_range, val, sizeof(del_range)); ino = (( __u32)(__le32)(del_range.fc_ino)); ext4_fc_flush_extents(ctx, ino); memset(&extent, 0, sizeof(extent)); extent.e_lblk = (( __u32)(__le32)(del_range.fc_lblk)); extent.e_len = (( __u32)(__le32)(del_range.fc_len)); ret = ext4_fc_read_extents(ctx, ino); if (ret) return ret; return ext4_del_extent_from_list(ctx, &ctx->fc_replay_state.fc_extent_list, &extent); }
long ext4_fc_handle_del_range(_QWORD *a1, const void *a2) { int v3; unsigned int extents; int dest[3]; long s[4]; s[3] = __readfsqword(0x28u); memcpy(dest, a2, sizeof(dest)); v3 = dest[0]; ext4_fc_flush_extents((long)a1, (void *)dest[0]); memset(s, 0, 0x18uLL); s[1] = (unsigned int)dest[1]; LODWORD(s[2]) = dest[2]; extents = ext4_fc_read_extents((long)a1, v3); if ( extents ) return extents; else return ext4_del_extent_from_list(a1, (long)(a1 + 118), s); }
static void print_redirection_list (redirects) REDIRECT *redirects; { REDIRECT *heredocs, *hdtail, *newredir; char *rw; heredocs = (REDIRECT *) ((void *)0) ; hdtail = heredocs; was_heredoc = 0; while (redirects) { if (redirects->instruction == r_reading_until || redirects->instruction == r_deblank_reading_until) { newredir = copy_redirect (redirects); newredir->next = (REDIRECT *) ((void *)0) ; print_heredoc_header (newredir); if (heredocs) { hdtail->next = newredir; hdtail = newredir; } else hdtail = heredocs = newredir; } else print_redirection (redirects); redirects = redirects->next; if (redirects) cprintf (" "); } if (heredocs && printing_connection) deferred_heredocs = heredocs; else if (heredocs) { print_heredoc_bodies (heredocs); dispose_redirects (heredocs); } }
void print_redirection_list(unsigned long long a0) { struct_0 *v0; void* v1; unsigned long long *v2; unsigned long long *v3; void* v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; void* v9; unsigned long long v10; v0 = a0; v1 = 0; v5 = v1; v2 = v1; was_heredoc = 0; while (true) { if (!v0) break; switch (v0->field_18) { case 4: case 8: v3 = copy_redirect(v0); *(v3) = 0; print_heredoc_header(v3); if (v1) { *(v2) = v3; v2 = v3; break; } else { v1 = v3; v2 = v1; break; } default: print_redirection(v0); } v6 = v0->field_0; v0 = v0->field_0; if (!v0) continue; v7 = cprintf(" "); } if (v1) { v8 = printing_connection; if (printing_connection) { v9 = v1; deferred_heredocs = v1; return; } } if (v1) { print_heredoc_bodies(v1); v10 = dispose_redirects(v1); return; } return; }
static void su_failure (const char *tty, _Bool su_to_root) { sulog (tty, 0 , caller_name, name); if (getdef_bool ("SYSLOG_SU_ENAB")) { do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog (su_to_root ? 5 : 6 , "- %s %s:%s", tty, ('\0' != caller_name[0]) ? caller_name : "???", ('\0' != name[0]) ? name : "???") ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; } closelog (); exit (1); }
void su_failure(unsigned long long a0, unsigned long a1) { void* v0; char *v1; unsigned int v3; sulog(a0, 0x0, &caller_name, &name); if (getdef_bool("SYSLOG_SU_ENAB")) { v1 = setlocale(0x6, NULL); v0 = 0; if (v1) v0 = strdup(v1); if (v0) setlocale(0x6, "C"); if (a1) v3 = 5; else v3 = 6; syslog(v3, "- %s %s:%s"); if (v0) { setlocale(0x6, v0); free(v0); } } closelog(); exit(0x1); }
static void get_hram(unsigned char *hram, const unsigned char *sm, const unsigned char *pk, unsigned char *playground, unsigned long long smlen) { unsigned long long i; for (i = 0;i < 32;++i) playground[i] = sm[i]; for (i = 32;i < 64;++i) playground[i] = pk[i-32]; for (i = 64;i < smlen;++i) playground[i] = sm[i]; crypto_hash_sha512(hram,playground,smlen); }
long get_hram(long a1, long a2, long a3, long a4, unsigned long a5) { unsigned long i; unsigned long j; unsigned long k; for ( i = 0LL; i <= 0x1F; ++i ) *(_BYTE *)(a4 + i) = *(_BYTE *)(a2 + i); for ( j = 32LL; j <= 0x3F; ++j ) *(_BYTE *)(a4 + j) = *(_BYTE *)(j - 32 + a3); for ( k = 64LL; k < a5; ++k ) *(_BYTE *)(a4 + k) = *(_BYTE *)(a2 + k); return crypto_hash_sha512(a1, a4, a5); }
void sh_warnx(const char *fmt, ...) { va_list ap; __builtin_va_start( ap , fmt ) ; exvwarning2(fmt, ap); __builtin_va_end( ap ) ; }
void sh_warnx(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8, undefined8 param_9,undefined8 param_10,undefined8 param_11,undefined8 param_12, undefined8 param_13,undefined8 param_14) { char in_AL; long in_FS_OFFSET; undefined4 local_d8; undefined4 local_d4; undefined *local_d0; undefined *local_c8; long local_c0; undefined local_b8 [8]; undefined8 local_b0; undefined8 local_a8; undefined8 local_a0; undefined8 local_98; undefined8 local_90; undefined4 local_88; undefined4 local_78; undefined4 local_68; undefined4 local_58; undefined4 local_48; undefined4 local_38; undefined4 local_28; undefined4 local_18; if (in_AL != '\0') { local_88 = param_1; local_78 = param_2; local_68 = param_3; local_58 = param_4; local_48 = param_5; local_38 = param_6; local_28 = param_7; local_18 = param_8; } local_c0 = *(long *)(in_FS_OFFSET + 0x28); local_d8 = 8; local_d4 = 0x30; local_d0 = &stack0x00000008; local_c8 = local_b8; local_b0 = param_10; local_a8 = param_11; local_a0 = param_12; local_98 = param_13; local_90 = param_14; exvwarning2(param_9,&local_d8); if (local_c0 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
static void r_sort_a(const unsigned char **a, int n, int i, const unsigned char *tr, unsigned int endch) { static unsigned int count[256], nc, bmin; unsigned int c; const unsigned char **ak, *r; stack s[512], *sp, *sp0, *sp1, temp; unsigned int *cp, bigc; const unsigned char **an, *t, **aj, **top[256]; sp = s; sp->sa = a, sp->sn = n, (sp++)->si = i; while (!(s >= sp)) { a = (--sp)->sa, n = sp->sn, i = sp->si; if (n < 20) { simplesort(a, n, i, tr, endch); continue; } an = a + n; if (nc == 0) { bmin = 255; for (ak = a; ak < an;) { c = tr[(*ak++)[i]]; if (++count[c] == 1 && c != endch) { if (c < bmin) bmin = c; nc++; } } if (sp + nc > s + 512) { r_sort_a(a, n, i, tr, endch); continue; } } if (nc == 1 && count[bmin] == (unsigned int)n) { sp->sa = a, sp->sn = n, (sp++)->si = i+1; nc = count[bmin] = 0; continue; } sp0 = sp1 = sp; bigc = 2; if (endch == 0) top[0] = ak = a + count[0]; else { ak = a; top[255] = an; } for (cp = count + bmin; nc > 0; cp++) { while (*cp == 0) cp++; if (*cp > 1) { if (*cp > bigc) { bigc = *cp; sp1 = sp; } sp->sa = ak, sp->sn = *cp, (sp++)->si = i+1; } top[cp-count] = ak += *cp; nc--; } temp = *sp0, *sp0 = *sp1, *sp1 = temp; for (aj = a; aj < an; *aj = r, aj += count[c], count[c] = 0) for (r = *aj; aj < (ak = --top[c = tr[r[i]]]);) t = *ak, *ak = r, r = t; } }
void r_sort_a(long *param_1,undefined4 param_2,undefined4 param_3,long param_4,uint param_5) { int iVar1; int iVar2; long *plVar3; long *plVar4; long *plVar5; long lVar6; long **pplVar7; long **pplVar8; uint uVar9; long *plVar10; long in_FS_OFFSET; uint local_2878; long *local_2870; long local_2868; long **local_2860; long **local_2858; uint *local_2850; long *local_2848; long *local_2818 [255]; long *local_2020; long *local_2018; undefined4 uStack8208; undefined4 uStack8204; long *local_2008 [1022]; long *plStack24; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_2018 = param_1; uStack8208 = param_2; uStack8204 = param_3; local_2860 = local_2008; LAB_001009e6: do { while( true ) { pplVar8 = local_2860; if (local_2860 <= &local_2018) { if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; } pplVar7 = local_2860 + -2; local_2848 = *pplVar7; iVar1 = *(int *)(local_2860 + -1); iVar2 = *(int *)((long)local_2860 + -4); if (0x13 < iVar1) break; simplesort(local_2848,iVar1,iVar2); local_2860 = pplVar7; } plVar10 = local_2848 + iVar1; if (nc_2973 == 0) { bmin_2974 = 0xff; local_2870 = local_2848; while (local_2870 < plVar10) { plVar3 = local_2870 + 1; uVar9 = (uint)*(byte *)(param_4 + (ulong)*(byte *)((long)iVar2 + *local_2870)); *(int *)(count_2972 + (ulong)uVar9 * 4) = *(int *)(count_2972 + (ulong)uVar9 * 4) + 1; local_2870 = plVar3; if ((*(int *)(count_2972 + (ulong)uVar9 * 4) == 1) && (uVar9 != param_5)) { if (uVar9 < bmin_2974) { bmin_2974 = uVar9; } nc_2973 = nc_2973 + 1; } } if (&plStack24 < pplVar7 + (ulong)nc_2973 * 2) { r_sort_a(local_2848,iVar1,iVar2,param_4,param_5); local_2860 = pplVar7; goto LAB_001009e6; } } uVar9 = bmin_2974; if ((nc_2973 == 1) && (*(int *)(count_2972 + (ulong)bmin_2974 * 4) == iVar1)) { *pplVar7 = local_2848; *(int *)(local_2860 + -1) = iVar1; *(int *)((long)local_2860 + -4) = iVar2 + 1; *(undefined4 *)(count_2972 + (ulong)bmin_2974 * 4) = 0; nc_2973 = *(uint *)(count_2972 + (ulong)uVar9 * 4); } else { local_2878 = 2; if (param_5 == 0) { local_2818[0] = local_2848 + count_2972._0_4_; local_2870 = local_2848 + count_2972._0_4_; } else { local_2020 = plVar10; local_2870 = local_2848; } local_2850 = (uint *)(count_2972 + (ulong)bmin_2974 * 4); local_2860 = pplVar7; local_2858 = pplVar7; for (; nc_2973 != 0; nc_2973 = nc_2973 - 1) { for (; *local_2850 == 0; local_2850 = local_2850 + 1) { } if (1 < *local_2850) { if (local_2878 < *local_2850) { local_2878 = *local_2850; local_2858 = local_2860; } *local_2860 = local_2870; *(uint *)(local_2860 + 1) = *local_2850; *(int *)((long)local_2860 + 0xc) = iVar2 + 1; local_2860 = local_2860 + 2; } local_2870 = local_2870 + *local_2850; local_2818[(long)(local_2850 + -0x40450) >> 2] = local_2870; local_2850 = local_2850 + 1; } plVar3 = pplVar8[-1]; plVar4 = *pplVar7; plVar5 = local_2858[1]; *pplVar7 = *local_2858; pplVar8[-1] = plVar5; *local_2858 = plVar4; local_2858[1] = plVar3; while (local_2848 < plVar10) { local_2868 = *local_2848; while( true ) { uVar9 = (uint)*(byte *)(param_4 + (ulong)*(byte *)(local_2868 + iVar2)); local_2818[uVar9] = local_2818[uVar9] + -1; plVar3 = local_2818[uVar9]; if (plVar3 <= local_2848) break; lVar6 = *plVar3; *plVar3 = local_2868; local_2868 = lVar6; } *local_2848 = local_2868; local_2848 = local_2848 + *(uint *)(count_2972 + (ulong)uVar9 * 4); *(undefined4 *)(count_2972 + (ulong)uVar9 * 4) = 0; } } } while( true ); }
char * ls_file(const char *name, const struct stat *st, int remote, int si_units, const char *user, const char *group) { int ulen, glen, sz = 0; struct tm *ltime = localtime(&st-> st_mtim.tv_sec ); char buf[1024], lc[8], mode[11+1], tbuf[12+1], ubuf[11+1], gbuf[11+1]; char sbuf[7]; time_t now; strmode(st->st_mode, mode); if (remote) { if (user == ((void *)0) ) { snprintf(ubuf, sizeof ubuf, "%u", (u_int)st->st_uid); user = ubuf; } if (group == ((void *)0) ) { snprintf(gbuf, sizeof gbuf, "%u", (u_int)st->st_gid); group = gbuf; } strlcpy(lc, "?", sizeof(lc)); } else { user = user_from_uid(st->st_uid, 0); group = group_from_gid(st->st_gid, 0); snprintf(lc, sizeof(lc), "%u", (u_int)st->st_nlink); } if (ltime != ((void *)0) ) { now = time( ((void *)0) ); if (now - (365*24*60*60)/2 < st-> st_mtim.tv_sec && now >= st-> st_mtim.tv_sec ) sz = strftime(tbuf, sizeof tbuf, "%b %e %H:%M", ltime); else sz = strftime(tbuf, sizeof tbuf, "%b %e %Y", ltime); } if (sz == 0) tbuf[0] = '\0'; ulen = (((strlen(user)) > (8)) ? (strlen(user)) : (8)); glen = (((strlen(group)) > (8)) ? (strlen(group)) : (8)); if (si_units) { fmt_scaled((long long)st->st_size, sbuf); snprintf(buf, sizeof buf, "%s %3s %-*s %-*s %8s %s %s", mode, lc, ulen, user, glen, group, sbuf, tbuf, name); } else { snprintf(buf, sizeof buf, "%s %3s %-*s %-*s %8llu %s %s", mode, lc, ulen, user, glen, group, (unsigned long long)st->st_size, tbuf, name); } return xstrdup(buf); }
long long ls_file(unsigned long a0, struct_0 *a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5) { unsigned long v0; unsigned long v1; unsigned long v2; unsigned long v3; unsigned long v4; unsigned long v5; unsigned int v6; unsigned int v7; unsigned int v8; void* v9; unsigned long long v10; char v11; char v12; char v13; char v14; char v15; char v16; char v17; unsigned long long v19; unsigned int v20; unsigned int v21; v5 = a4; v4 = a5; v6 = 0; v9 = localtime(&a1->field_58); strmode(a1->field_18, &v13, a1->field_18); if (a2) { if (!v5) { snprintf(&v14, 0xc, "%u", a1->field_1c); v5 = &v14; } if (!v4) { snprintf(&v15, 0xc, "%u", a1->field_20); v4 = &v15; } strlcpy(&v12, "?", 0x8); } else { v5 = user_from_uid(a1->field_1c, 0x0); v4 = group_from_gid(a1->field_20, 0x0); snprintf(&v12, 0x8, "%u", a1->field_10); } if (v9) { v10 = time(NULL); v19 = __addvdi3(v10, 0xffffffffff0f6640); if (v19 < a1->field_58 && v10 >= a1->field_58) v6 = strftime(&v16, 0xd, "%b %e %H:%M", v9); if (v10 < a1->field_58 || v19 >= a1->field_58) v6 = strftime(&v16, 0xd, "%b %e %Y", v9); } if (!v6) v16 = 0; v20 = strlen(v5); if (v20 > 8) v20 = strlen(v5); else v20 = 8; v7 = v20; v21 = strlen(v4); if (v21 > 8) v21 = strlen(v4); else v21 = 8; v8 = v21; if (a3) { fmt_scaled(a1->field_30, &v11, &v11); v3 = a0; v2 = &v16; v1 = &v11; v0 = v4; snprintf(&v17, 0x400, "%s %3s %-*s %-*s %8s %s %s", &v13, &v12, v7, v5, v8); } else { v3 = a0; v2 = &v16; v1 = a1->field_30; v0 = v4; snprintf(&v17, 0x400, "%s %3s %-*s %-*s %8llu %s %s", &v13, &v12, v7, v5, v8); } return xstrdup(&v17); }
void crypto_sign_ed25519_ref_fe25519_cmov(crypto_sign_ed25519_ref_fe25519 *r, const crypto_sign_ed25519_ref_fe25519 *x, unsigned char b) { int i; crypto_uint32 mask = b; mask = -mask; for(i=0;i<32;i++) r->v[i] ^= mask & (x->v[i] ^ r->v[i]); }
int crypto_sign_ed25519_ref_fe25519_cmov(long a1, long a2, unsigned char a3) { int result; int i; result = a3; for ( i = 0; i <= 31; ++i ) { *(_DWORD *)(a1 + 4LL * i) ^= -a3 & (*(_DWORD *)(a2 + 4LL * i) ^ *(_DWORD *)(a1 + 4LL * i)); result = i + 1; } return result; }
static char *host_specific_filename(const char *prefix, const char *suffix) { static char safename[ 4096 ]; char hostname[ 4096 ]; if (gethostname(hostname, sizeof hostname) != 0) return ((void *)0) ; if (prefix) { if (!glue_strings(safename, sizeof safename, prefix, hostname, '.')) return ((void *)0) ; strcpy(hostname, safename); } if (suffix) { if (!glue_strings(safename, sizeof safename, hostname, suffix, '.')) return ((void *)0) ; } return safename; }
int host_specific_filename(unsigned long long a0, unsigned long long a1) { char v0; unsigned long long v1; unsigned int v3; v1 = *(&v1); if (gethostname(&v0, 0x1000)) { v3 = 0; return v3; } if (a0) { if (glue_strings(&safename.4843, 0x1000, a0, &v0, 0x2e)) { strcpy(&v0, &safename.4843); } else { v3 = 0; return v3; } } if (!a1) { v3 = &safename.4843; return v3; } else if (glue_strings(&safename.4843, 0x1000, &v0, a1, 0x2e)) { v3 = &safename.4843; return v3; } else { v3 = 0; return v3; } }
terminal_set_arrow(EditLine *el, const wchar_t *name, keymacro_value_t *fun, int type) { funckey_t *arrow = el->el_terminal.t_fkey; int i; for (i = 0; i < 7; i++) if (wcscmp(name, arrow[i].name) == 0) { arrow[i].fun = *fun; arrow[i].type = type; return 0; } return -1; }
long long terminal_set_arrow(struct_0 *a0, unsigned short *a1, unsigned long long *a2, unsigned long a3) { unsigned int v0; unsigned long long *v1; unsigned long long v3; v1 = a0->field_c8; v0 = 0; while (true) { if (v0 > 6) { v3 = 4294967295; break; } else if (wcscmp(a1, v1[4 * v0])) { v0 += 1; } else { v1[2 + 4 * v0] = *(a2); *(&v1[3 + 4 * v0]) = a3; v3 = 0; break; } } return v3; }
{ return ext2fs_has_feature_metadata_csum(fs->super) || ext2fs_has_feature_gdt_csum(fs->super); }
_BOOL8 ext2fs_has_feature_metadata_csum(long a1) { return (*(_DWORD *)(a1 + 100) & 0x400) != 0; }
char * sh_get_home_dir () { if (current_user.home_dir == 0) get_current_user_info (); return current_user.home_dir; }
int sh_get_home_dir() { if (!login_shell) get_current_user_info(); return login_shell; }
void outfmt(struct output *file, const char *fmt, ...) { va_list ap; __builtin_va_start( ap , fmt ) ; doformat(file, fmt, ap); __builtin_va_end( ap ) ; }
unsigned long outfmt(long a1, const char *a2, long a3, long a4, long a5, long a6, ...) { gcc_va_list va; unsigned long v8; long v9; long v10; long v11; long v12; va_start(va, a6); v9 = a3; v10 = a4; v11 = a5; v12 = a6; v8 = __readfsqword(0x28u); va[0].gp_offset = 16; doformat(a1, a2, va); return __readfsqword(0x28u) ^ v8; }
void diff_archive (void) { set_next_block_after (current_header); if (verbose_option) { if (now_verifying) fprintf (stdlis, gettext ("Verify ")); print_header (&current_stat_info, current_header, -1); } switch (current_header->header.typeflag) { default: do { if (error_hook) error_hook (); error (0, 0, gettext ("%s: Unknown file type '%c', diffed as normal file"), quotearg_colon (current_stat_info.file_name), current_header->header.typeflag); exit_status = 2; } while (0) ; __attribute__ ((__fallthrough__)); case '\0': case '0': case 'S': case '7': if (current_stat_info.had_trailing_slash) diff_dir (); else diff_file (); break; case '1': diff_link (); break; case '2': diff_symlink (); break; case '3': case '4': case '6': diff_special (); break; case 'D': case '5': if (is_dumpdir (&current_stat_info)) diff_dumpdir (&current_stat_info); diff_dir (); break; case 'V': break; case 'M': diff_multivol (); } }
unsigned long diff_archive() { char *v0; unsigned long result; unsigned int v2; long v3; char *v4; set_next_block_after(current_header); if ( verbose_option ) { if ( now_verifying ) { v0 = gettext("Verify "); fprintf(stdlis, v0); } print_header(current_stat_info, current_header, -1LL); } result = (unsigned int)*(char *)(current_header + 156LL); switch ( *(_BYTE *)(current_header + 156LL) ) { case 0: case 0x30: case 0x37: case 0x53: goto LABEL_9; case 0x31: return diff_link(); case 0x32: return diff_symlink(); case 0x33: case 0x34: case 0x36: return diff_special(); case 0x35: case 0x44: if ( (unsigned char)is_dumpdir(current_stat_info) ) diff_dumpdir(current_stat_info); return diff_dir(); case 0x4D: return diff_multivol(); case 0x56: return result; default: if ( error_hook ) error_hook(); v2 = *(char *)(current_header + 156LL); v3 = quotearg_colon(current_stat_info[1]); v4 = gettext("%s: Unknown file type '%c', diffed as normal file"); error(0, 0, v4, v3, v2); exit_status = 2; LABEL_9: if ( LOBYTE(current_stat_info[2]) ) return diff_dir(); else return diff_file(); } }
static void checked_fprintf (struct format_val *dest, const char *fmt, ...) { int rv; va_list ap; __builtin_va_start( ap , fmt ) ; rv = vfprintf (dest->stream, fmt, ap); __builtin_va_end( ap ) ; if (rv < 0) nonfatal_nontarget_file_error ( (*__errno_location ()) , dest->filename); }
void checked_fprintf(unsigned long long a0[3], char *a1, unsigned long a2, unsigned long a3) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned long v3; unsigned long v4; unsigned long long v5; char v6; unsigned long v7; unsigned long v8; unsigned long v9; unsigned long v10; int v11; int v12; int v13; int v14; int v15; int v16; int v17; int v18; unsigned long v19; unsigned long v20; unsigned long v21; char v22; int v23; int v24; int v25; int v26; int v27; int v28; int v29; int v30; unsigned long long *v31; unsigned long long v32; v7 = a2; v8 = a3; v9 = v20; v10 = v21; if (v22) { v11 = v23; v12 = v24; v13 = v25; v14 = v26; v15 = v27; v16 = v28; v17 = v29; v18 = v30; } v5 = v31[5]; v1 = 16; v2 = 48; v3 = &v19; v4 = &v6; v0 = vfprintf(a0[1], a1, &v1); if (v0 < 0) nonfatal_nontarget_file_error(*(__errno_location()), a0[2]); v32 = v5 ^ v31[5]; if ((v5 ^ v31[5])) __stack_chk_fail(); return; }
static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, parser_control *pc) { ((void) (yyvaluep)); ((void) (pc)); if (!yymsg) yymsg = "Deleting"; ; ((void) (yykind)); }
void yydestruct(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3) { unsigned long v0; unsigned long v1; unsigned int v2; unsigned long v3; unsigned long long v5; v3 = a0; v2 = a1; v1 = a2; v0 = a3; if (!v3) { v5 = "Deleting"; v3 = "Deleting"; } return; }
static int server_input_hostkeys_prove(struct ssh *ssh, struct sshbuf **respp) { struct sshbuf *resp = ((void *)0) ; struct sshbuf *sigbuf = ((void *)0) ; struct sshkey *key = ((void *)0) , *key_pub = ((void *)0) , *key_prv = ((void *)0) ; int r, ndx, success = 0; const u_char *blob; const char *sigalg, *kex_rsa_sigalg = ((void *)0) ; u_char *sig = 0; size_t blen, slen; if ((resp = sshbuf_new()) == ((void *)0) || (sigbuf = sshbuf_new()) == ((void *)0) ) sshfatal("serverloop.c", __func__, 693, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new"); if (sshkey_type_plain(sshkey_type_from_name( ssh->kex->hostkey_alg)) == KEY_RSA) kex_rsa_sigalg = ssh->kex->hostkey_alg; while (ssh_packet_remaining(ssh) > 0) { sshkey_free(key); key = ((void *)0) ; if ((r = sshpkt_get_string_direct(ssh, &blob, &blen)) != 0 || (r = sshkey_from_blob(blob, blen, &key)) != 0) { sshlog("serverloop.c", __func__, 702, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "parse key"); goto out; } if ((ndx = ssh->kex->host_key_index(key, 1, ssh)) == -1) { sshlog("serverloop.c", __func__, 710, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "unknown host %s key", sshkey_type(key)); goto out; } if ((key_prv = get_hostkey_by_index(ndx)) == ((void *)0) && (key_pub = get_hostkey_public_by_index(ndx, ssh)) == ((void *)0) ) { sshlog("serverloop.c", __func__, 719, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "can't retrieve hostkey %d", ndx); goto out; } sshbuf_reset(sigbuf); free(sig); sig = ((void *)0) ; sigalg = ((void *)0) ; if (sshkey_type_plain(key->type) == KEY_RSA) { if (kex_rsa_sigalg != ((void *)0) ) sigalg = kex_rsa_sigalg; else if (ssh->kex->flags & 0x0010) sigalg = "rsa-sha2-512"; else if (ssh->kex->flags & 0x0008) sigalg = "rsa-sha2-256"; } sshlog("serverloop.c", __func__, 738, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "sign %s key (index %d) using sigalg %s", sshkey_type(key), ndx, sigalg == ((void *)0) ? "default" : sigalg) ; if ((r = sshbuf_put_cstring(sigbuf, "hostkeys-prove-00@openssh.com")) != 0 || (r = sshbuf_put_stringb(sigbuf, ssh->kex->session_id)) != 0 || (r = sshkey_puts(key, sigbuf)) != 0 || (r = ssh->kex->sign(ssh, key_prv, key_pub, &sig, &slen, sshbuf_ptr(sigbuf), sshbuf_len(sigbuf), sigalg)) != 0 || (r = sshbuf_put_string(resp, sig, slen)) != 0) { sshlog("serverloop.c", __func__, 748, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "assemble signature"); goto out; } } *respp = resp; resp = ((void *)0) ; success = 1; out: free(sig); sshbuf_free(resp); sshbuf_free(sigbuf); sshkey_free(key); return success; }
long server_input_hostkeys_prove(long a1, _QWORD *a2) { unsigned int v2; long v3; const char *v4; const char *v5; const char *v6; long ( *v7)(long, long, long, void **, long *, long, long, const char *); long v8; long v9; long v10; unsigned int string_direct; unsigned int v13; unsigned int v14; unsigned int v15; unsigned int *v16; long v17; void *ptr; long v19; long v20; long v21; long hostkey_public_by_index; const char *v23; const char *v24; long v25; long hostkey_by_index; unsigned long v27; v27 = __readfsqword(0x28u); v25 = 0LL; v16 = 0LL; hostkey_public_by_index = 0LL; hostkey_by_index = 0LL; v14 = 0; v24 = 0LL; ptr = 0LL; v21 = sshbuf_new(); if ( !v21 || (v25 = sshbuf_new()) == 0 ) sshfatal("serverloop.c", "server_input_hostkeys_prove", 693LL, 1LL, 1LL, 0LL, "sshbuf_new"); v2 = sshkey_type_from_name(*(_QWORD *)(*(_QWORD *)(a1 + 8) + 40LL)); if ( !(unsigned int)sshkey_type_plain(v2) ) v24 = *(const char **)(*(_QWORD *)(a1 + 8) + 40LL); while ( (int)ssh_packet_remaining(a1) > 0 ) { sshkey_free(v16); v16 = 0LL; string_direct = sshpkt_get_string_direct(a1, &v17, &v19); if ( string_direct || (string_direct = sshkey_from_blob(v17, v19, &v16)) != 0 ) { v3 = ssh_err(string_direct); sshlog("serverloop.c", "server_input_hostkeys_prove", 702LL, 1LL, 2LL, v3, "parse key"); goto LABEL_32; } v15 = (*(long ( **)(unsigned int *, long, long))(*(_QWORD *)(a1 + 8) + 184LL))(v16, 1LL, a1); if ( v15 == -1 ) { v4 = (const char *)sshkey_type(v16); sshlog("serverloop.c", "server_input_hostkeys_prove", 710LL, 1LL, 2LL, 0LL, "unknown host %s key", v4); goto LABEL_32; } hostkey_by_index = get_hostkey_by_index(v15); if ( !hostkey_by_index ) { hostkey_public_by_index = get_hostkey_public_by_index(v15, a1); if ( !hostkey_public_by_index ) { sshlog("serverloop.c", "server_input_hostkeys_prove", 719LL, 1LL, 2LL, 0LL, "can't retrieve hostkey %d", v15); goto LABEL_32; } } sshbuf_reset(v25); free(ptr); ptr = 0LL; v23 = 0LL; if ( !(unsigned int)sshkey_type_plain(*v16) ) { if ( v24 ) { v23 = v24; } else if ( (*(_DWORD *)(*(_QWORD *)(a1 + 8) + 140LL) & 0x10) != 0 ) { v23 = "rsa-sha2-512"; } else if ( (*(_DWORD *)(*(_QWORD *)(a1 + 8) + 140LL) & 8) != 0 ) { v23 = "rsa-sha2-256"; } } if ( v23 ) v5 = v23; else v5 = "default"; v6 = (const char *)sshkey_type(v16); sshlog( "serverloop.c", "server_input_hostkeys_prove", 738LL, 1LL, 7LL, 0LL, "sign %s key (index %d) using sigalg %s", v6, v15, v5); v13 = sshbuf_put_cstring(v25, "hostkeys-prove-00@openssh.com"); if ( !v13 ) { v13 = sshbuf_put_stringb(v25, *(_QWORD *)(*(_QWORD *)(a1 + 8) + 112LL)); if ( !v13 ) { v13 = sshkey_puts(v16, v25); if ( !v13 ) { v7 = *(long ( **)(long, long, long, void **, long *, long, long, const char *))(*(_QWORD *)(a1 + 8) + 192LL); v8 = sshbuf_len(v25); v9 = sshbuf_ptr(v25); v13 = v7(a1, hostkey_by_index, hostkey_public_by_index, &ptr, &v20, v9, v8, v23); if ( !v13 ) { v13 = sshbuf_put_string(v21, ptr, v20); if ( !v13 ) continue; } } } } v10 = ssh_err(v13); sshlog("serverloop.c", "server_input_hostkeys_prove", 748LL, 1LL, 2LL, v10, "assemble signature"); goto LABEL_32; } *a2 = v21; v21 = 0LL; v14 = 1; LABEL_32: free(ptr); sshbuf_free(v21); sshbuf_free(v25); sshkey_free(v16); return v14; }
static void check_duparg(__u64 *attrs, int type, const char *key, const char *argv) { if (!(((*attrs) & (1L << (type))) != 0)) { *attrs |= (1L << type); return; } duparg2(key, argv); }
void check_duparg(unsigned long long *a0, unsigned long a1, unsigned long long a2, unsigned long long a3) { unsigned long long v1; unsigned long long *v2; if ((1 << (a1 & 63) & *(a0))) { v1 = duparg2(a2, a3, a3); } else { v2 = a0; *(a0) = *(a0) | 1 << (a1 & 63); } return; }
static void check_inode_bitmap_checksum(e2fsck_t ctx) { struct problem_context pctx; char *buf = ((void *)0) ; dgrp_t i; int nbytes; ext2_ino_t ino_itr; errcode_t retval; if (!ext2fs_has_feature_metadata_csum(ctx->fs->super)) return; if (ext2fs_test_ib_dirty(ctx->fs)) return; nbytes = (size_t)(((ctx->fs->super)->s_inodes_per_group) / 8); retval = ext2fs_get_mem(ctx->fs->blocksize, &buf); if (retval) { com_err(ctx->program_name, 0, "%s", (gettext ("check_inode_bitmap_checksum: Memory allocation error"))); fatal_error(ctx, 0); } clear_problem_context(&pctx); for (i = 0; i < ctx->fs->group_desc_count; i++) { if (ext2fs_bg_flags_test(ctx->fs, i, 0x0001)) continue; ino_itr = 1 + (i * (nbytes << 3)); retval = ext2fs_get_inode_bitmap_range2(ctx->fs->inode_map, ino_itr, nbytes << 3, buf); if (retval) break; if (ext2fs_inode_bitmap_csum_verify(ctx->fs, i, buf, nbytes)) continue; pctx.group = i; if (!fix_problem(ctx, 0x05001A, &pctx)) continue; ext2fs_mark_ib_dirty(ctx->fs); break; } ext2fs_free_mem(&buf); }
void check_inode_bitmap_checksum(struct_0 *a0) { unsigned int v0; unsigned int v1; unsigned int v2; void* v3; unsigned long v4; char v5; unsigned int v6; char v7; unsigned long long *v9; unsigned long long v10; v3 = 0; if (ext2fs_has_feature_metadata_csum(a0->field_0->field_20) && !ext2fs_test_ib_dirty(a0->field_0)) { v1 = *((a0->field_0->field_20 + 40)) >> 3; v4 = ext2fs_get_mem(a0->field_0->field_28, &v3, a0->field_0->field_28); if (v4) { com_err(a0->field_8, 0x0, "%s", gettext("check_inode_bitmap_checksum: Memory allocation error")); fatal_error(a0, 0x0); } clear_problem_context(&v5); v0 = 0; while (true) { if (v0 >= a0->field_0->field_30) break; if (!ext2fs_bg_flags_test(a0->field_0, v0, 0x1, v0)) { v2 = v0 * (v1 * 8) + 1; v4 = ext2fs_get_inode_bitmap_range2(a0->field_0->field_50, v2, v1 * 8, v3); if (v4) break; if (!ext2fs_inode_bitmap_csum_verify(a0->field_0, v0, v3, v1) && (v6 = v0, fix_problem(a0, 0x5001a, &v5))) { ext2fs_mark_ib_dirty(a0->field_0); break; } } v0 += 1; } ext2fs_free_mem(&v3); } v10 = *(&v7) ^ v9[5]; return; }
ARRAY_ELEMENT * array_unshift_element(a) ARRAY *a; { return (array_shift (a, 1, 0)); }
void array_unshift_element(undefined8 param_1) { array_shift(param_1,1,0); return; }
int rl_universal_argument (int count, int key) { _rl_arg_init (); rl_numeric_arg *= 4; return ((rl_readline_state & (0x0080000)) ? 0 : rl_digit_loop ()); }
long long rl_universal_argument(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 int v0; unsigned int v1; void* v3; v1 = a0; v0 = a1; _rl_arg_init(); rl_numeric_arg = rl_numeric_arg * 4; if ((rl_readline_state & 0x80000)) v3 = 0; else v3 = rl_digit_loop(a0, a1, a2, a3, a4, a5); return v3; }
void set_color_palette (char const *palette) { color_palette = palette; }
long long set_color_palette(unsigned long long a0) { color_palette = a0; return a0; }