input
stringlengths
28
169k
output
stringlengths
20
317k
static void cleanup (int sig) { if (sig == 14 ) { timed_out = 1; sig = term_signal; } if (monitored_pid) { if (kill_after) { int saved_errno = (*__errno_location ()) ; term_signal = 9 ; settimeout (kill_after, 0 ); kill_after = 0; (*__errno_location ()) = saved_errno; } if (verbose) { char signame[ ((( (sizeof "SIGRTMAX" + (((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) - 1) )>( ((((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) + 1) ))?( (sizeof "SIGRTMAX" + (((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) - 1) ):( ((((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) + 1) )) ]; if (sig2str (sig, signame) != 0) snprintf (signame, sizeof signame, "%d", sig); error (0, 0, gettext ("sending signal %s to command %s"), signame, quote (command)); } send_sig (monitored_pid, sig); if (!foreground) { send_sig (0, sig); if (sig != 9 && sig != 18 ) { send_sig (monitored_pid, 18 ); send_sig (0, 18 ); } } } else _exit (128 + sig); }
void cleanup(EVP_PKEY_CTX *ctx) { int iVar1; int *piVar2; undefined8 uVar3; undefined8 uVar4; long in_FS_OFFSET; uint local_4c; char local_38 [24]; long local_20; local_4c = (uint)ctx; local_20 = *(long *)(in_FS_OFFSET + 0x28); if (local_4c == 0xe) { timed_out = 1; local_4c = term_signal; } if (monitored_pid == 0) { _exit(local_4c + 0x80); } if (kill_after != 0.0) { piVar2 = __errno_location(); iVar1 = *piVar2; term_signal = 9; settimeout(kill_after,0); kill_after = 0.0; piVar2 = __errno_location(); *piVar2 = iVar1; } if (verbose != '\0') { iVar1 = sig2str(local_4c,local_38); if (iVar1 != 0) { snprintf(local_38,0x13,"%d",(ulong)local_4c); } uVar3 = quote(command); uVar4 = gettext("sending signal %s to command %s"); error(0,0,uVar4,local_38,uVar3); } send_sig(monitored_pid,local_4c); if (((foreground != '\x01') && (send_sig(0,local_4c), local_4c != 9)) && (local_4c != 0x12)) { send_sig(monitored_pid,0x12); send_sig(0,0x12); } if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
static void try_help (char const *reason_msgid, char const *operand) { if (reason_msgid) error (0, 0, gettext (reason_msgid), operand); ((!!sizeof (struct { _Static_assert (2, "verify_expr (" "2" ", " "(error (2, 0, gettext (\"Try '%s --help' for more information.\"), program_name), assume (false))" ")"); int _gl_dummy; })) ? ((error (2, 0, gettext ("Try '%s --help' for more information."), program_name), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (2, 0, gettext ("Try '%s --help' for more information."), program_name), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; }
void try_help(char *a0, unsigned long a1) { unsigned long v0; unsigned long v1; unsigned long v3; v1 = v3; v0 = a1; if (a0) error(0x0, 0x0, gettext(a0)); error(0x2, 0x0, gettext("Try '%s --help' for more information.")); }
static void hash_to_blob(const char *cp, u_char **blobp, size_t *lenp, const char *file, u_long lnum) { char *tmp; size_t tlen; struct sshbuf *b; int r; if (strncmp(cp, "SHA256:", 7) != 0) sshfatal("ssh-keygen.c", __func__, 2229, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s:%lu: unsupported hash algorithm", file, lnum); cp += 7; tlen = strlen(cp); tmp = xmalloc(tlen + 4 + 1); strlcpy(tmp, cp, tlen + 1); while ((tlen % 4) != 0) { tmp[tlen++] = '='; tmp[tlen] = '\0'; } if ((b = sshbuf_new()) == ((void *)0) ) sshfatal("ssh-keygen.c", __func__, 2244, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); if ((r = sshbuf_b64tod(b, tmp)) != 0) sshfatal("ssh-keygen.c", __func__, 2246, 0, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s:%lu: decode hash failed", file, lnum); free(tmp); *lenp = sshbuf_len(b); *blobp = xmalloc(*lenp); memcpy(*blobp, sshbuf_ptr(b), *lenp); sshbuf_free(b); }
long hash_to_blob(const char *a1, void **a2, size_t *a3, const char *a4, long a5) { size_t v5; long v6; size_t v7; const void *v8; unsigned int v13; size_t v14; _BYTE *ptr; long v16; if ( strncmp(a1, "SHA256:", 7uLL) ) sshfatal("ssh-keygen.c", "hash_to_blob", 2229LL, 0LL, 1LL, 0LL, "%s:%lu: unsupported hash algorithm", a4, a5); v14 = strlen(a1 + 7); ptr = (_BYTE *)xmalloc(v14 + 5); strlcpy(ptr, a1 + 7, v14 + 1); while ( (v14 & 3) != 0 ) { v5 = v14++; ptr[v5] = 61; ptr[v14] = 0; } v16 = sshbuf_new(); if ( !v16 ) sshfatal("ssh-keygen.c", "hash_to_blob", 2244LL, 1LL, 1LL, 0LL, "sshbuf_new failed"); v13 = sshbuf_b64tod(v16, ptr); if ( v13 ) { v6 = ssh_err(v13); sshfatal("ssh-keygen.c", "hash_to_blob", 2246LL, 0LL, 1LL, v6, "%s:%lu: decode hash failed", a4, a5); } free(ptr); *a3 = sshbuf_len(v16); *a2 = (void *)xmalloc(*a3); v7 = *a3; v8 = (const void *)sshbuf_ptr(v16); memcpy(*a2, v8, v7); return sshbuf_free(v16); }
static void pkg_array_show_item(struct pkg_array *array, struct pkginfo *pkg, void *pkg_data) { struct pkg_format_node *fmt = pkg_data; pkg_format_show(fmt, pkg, &pkg->installed); }
void pkg_array_show_item(undefined8 param_1,long param_2,undefined8 param_3) { pkg_format_show(param_3,param_2,param_2 + 0x48); return; }
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; }
int node__get(unsigned long a0) { struct_0 *v0; unsigned int v2; v0 = malloc(0x20); if (!v0) { v2 = 0; return v2; } v0->field_0 = a0; v0->field_4 = 2; v0->field_8 = 0; v0->field_10 = 0; v0->field_18 = 0; v2 = v0; return v2; }
static _Bool pipe_lines (char const *pretty_filename, int fd, uintmax_t n_lines, uintmax_t *read_pos) { struct linebuffer { char buffer[ 8192 ]; size_t nbytes; size_t nlines; struct linebuffer *next; }; typedef struct linebuffer LBUFFER; LBUFFER *first, *last, *tmp; size_t total_lines = 0; _Bool ok = 1 ; size_t n_read; first = last = xmalloc (sizeof (LBUFFER)); first->nbytes = first->nlines = 0; first->next = ((void *)0) ; tmp = xmalloc (sizeof (LBUFFER)); while ( 1 ) { n_read = safe_read (fd, tmp->buffer, 8192 ); if (n_read == 0 || n_read == ((size_t) -1)) break; tmp->nbytes = n_read; *read_pos += n_read; tmp->nlines = 0; tmp->next = ((void *)0) ; { char const *buffer_end = tmp->buffer + n_read; char const *p = tmp->buffer; while ((p = memchr (p, line_end, buffer_end - p))) { ++p; ++tmp->nlines; } } total_lines += tmp->nlines; if (tmp->nbytes + last->nbytes < 8192 ) { memcpy (&last->buffer[last->nbytes], tmp->buffer, tmp->nbytes); last->nbytes += tmp->nbytes; last->nlines += tmp->nlines; } else { last = last->next = tmp; if (total_lines - first->nlines > n_lines) { tmp = first; total_lines -= first->nlines; first = first->next; } else tmp = xmalloc (sizeof (LBUFFER)); } } free (tmp); if (n_read == ((size_t) -1)) { error (0, (*__errno_location ()) , gettext ("error reading %s"), quotearg_style (shell_escape_always_quoting_style, pretty_filename)); ok = 0 ; goto free_lbuffers; } if (last->nbytes == 0) goto free_lbuffers; if (n_lines == 0) goto free_lbuffers; if (last->buffer[last->nbytes - 1] != line_end) { ++last->nlines; ++total_lines; } for (tmp = first; total_lines - tmp->nlines > n_lines; tmp = tmp->next) total_lines -= tmp->nlines; { char const *beg = tmp->buffer; char const *buffer_end = tmp->buffer + tmp->nbytes; if (total_lines > n_lines) { size_t j; for (j = total_lines - n_lines; j; --j) { beg = rawmemchr (beg, line_end); ++beg; } } xwrite_stdout (beg, buffer_end - beg); } for (tmp = tmp->next; tmp; tmp = tmp->next) xwrite_stdout (tmp->buffer, tmp->nbytes); free_lbuffers: while (first) { tmp = first->next; free (first); first = tmp; } return ok; }
void pipe_lines(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long long *a3) { unsigned long long *v0; char v1; struct_0 *v2; struct_0 *v3; struct_0 *v4; void* v5; struct_0 *v6; struct_0 *v7; unsigned long v8; unsigned long v9; unsigned long v10; unsigned long v11; unsigned long long v12; unsigned long long v13; char v14; unsigned long long v16; unsigned long long v17; unsigned long long v18; unsigned long long v19; unsigned long long v20; unsigned long long v21; unsigned long long v22; v13 = v16; v12 = v17; v0 = a3; v5 = 0; v1 = 1; v3 = xmalloc(0x2018); v2 = v3; v2->field_2008 = 0; v2->field_2000 = v2->field_2008; v2->field_2010 = 0; v4 = xmalloc(0x2018); while (true) { v9 = safe_read(a1, v4, 0x2000, v4); if (!v9) break; if (v9 == -1) break; v4->field_2000 = v9; *(a3) = *(a3) + v9; v4->field_2008 = 0; v4->field_2010 = 0; v10 = &(&v4->field_0)[v9]; v6 = v4; while (true) { v6 = memchr(v6, line_end, v10 + -0x1 * v6); if (!v6) break; v6 += 1; v4->field_2008 = v4->field_2008 + 1; } v5 += v4->field_2008; if (v3->field_2000 + v4->field_2000 <= 8191) { memcpy(&(&v3->field_0)[v3->field_2000], v4, v4->field_2000); v3->field_2000 = v3->field_2000 + v4->field_2000; v3->field_2008 = v3->field_2008 + v4->field_2008; } else { v3->field_2010 = v4; v3 = v3->field_2010; if (a2 < v5 - v2->field_2008) { v4 = v2; v5 -= v2->field_2008; v2 = v2->field_2010; } else { v4 = xmalloc(0x2018); } } } free(v4); if (v9 == -1) { v18 = quotearg_style(0x4, a0); error(0x0, *(__errno_location()), gettext("error reading %s")); v1 = 0; } else if (a2) { if (v3->padding_1[v3->field_2000] != line_end) { v3->field_2008 = v3->field_2008 + 1; v5 += 1; } for (v4 = v2; a2 < v5 - v4->field_2008; v4 = v4->field_2010) { v5 -= v4->field_2008; } v7 = v4; v11 = &(&v4->field_0)[v4->field_2000]; if (v5 > a2) { for (v8 = v5 - a2; v8; v8 -= 1) { v7 = rawmemchr(v7, line_end); v7 += 1; } } xwrite_stdout(v7, (v11 + -0x1 * v7)); for (v4 = v4->field_2010; v4; v4 = v4->field_2010) { xwrite_stdout(v4, v4->field_2000); } } for (; v2; v2 = v4) { v4 = v2->field_2010; free(v2); } v19 = v1; v20 = v12; v21 = v13; v22 = *(&v14); return; }
static void format_user (uid_t u, int width, _Bool stat_ok) { format_user_or_group (! stat_ok ? "?" : (numeric_ids ? ((void *)0) : getuser (u)), u, width); }
void format_user(unsigned long a0, unsigned long a1, unsigned long a2) { unsigned long long v1; unsigned long long v2; if ((a2 ^ 1)) { v1 = "?"; } else if (!numeric_ids) { v1 = getuser(a0); } else { v1 = 0; } v2 = format_user_or_group(v1, a0, a1); return; }
int kex_exchange_identification(struct ssh *ssh, int timeout_ms, const char *version_addendum) { int remote_major, remote_minor, mismatch, oerrno = 0; size_t len, i, n; int r, expect_nl; u_char c; struct sshbuf *our_version = ssh->kex->server ? ssh->kex->server_version : ssh->kex->client_version; struct sshbuf *peer_version = ssh->kex->server ? ssh->kex->client_version : ssh->kex->server_version; char *our_version_string = ((void *)0) , *peer_version_string = ((void *)0) ; char *cp, *remote_version = ((void *)0) ; sshbuf_reset(our_version); if (version_addendum != ((void *)0) && *version_addendum == '\0') version_addendum = ((void *)0) ; if ((r = sshbuf_putf(our_version, "SSH-%d.%d-%.100s%s%s\r\n", 2, 0, "OpenSSH_9.1", version_addendum == ((void *)0) ? "" : " ", version_addendum == ((void *)0) ? "" : version_addendum)) != 0) { oerrno = (*__errno_location ()) ; sshlog("kex.c", __func__, 1237, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "sshbuf_putf"); goto out; } if (atomicio((ssize_t (*)(int, void *, size_t))write, ssh_packet_get_connection_out(ssh), sshbuf_mutable_ptr(our_version), sshbuf_len(our_version)) != sshbuf_len(our_version)) { oerrno = (*__errno_location ()) ; sshlog("kex.c", __func__, 1245, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "write: %.100s", strerror( (*__errno_location ()) )); r = -24; goto out; } if ((r = sshbuf_consume_end(our_version, 2)) != 0) { oerrno = (*__errno_location ()) ; sshlog("kex.c", __func__, 1251, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "sshbuf_consume_end"); goto out; } our_version_string = sshbuf_dup_string(our_version); if (our_version_string == ((void *)0) ) { sshlog("kex.c", __func__, 1256, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "sshbuf_dup_string failed"); r = -2; goto out; } sshlog("kex.c", __func__, 1260, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Local version string %.100s", our_version_string); for (n = 0; ; n++) { if (n >= 1024) { send_error(ssh, "No SSH identification string " "received."); sshlog("kex.c", __func__, 1267, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "No SSH version received in first %u lines " "from server", 1024) ; r = -4; goto out; } sshbuf_reset(peer_version); expect_nl = 0; for (i = 0; ; i++) { if (timeout_ms > 0) { r = waitrfd(ssh_packet_get_connection_in(ssh), &timeout_ms); if (r == -1 && (*__errno_location ()) == 110 ) { send_error(ssh, "Timed out waiting " "for SSH identification string."); sshlog("kex.c", __func__, 1281, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Connection timed out during " "banner exchange") ; r = -53; goto out; } else if (r == -1) { oerrno = (*__errno_location ()) ; sshlog("kex.c", __func__, 1287, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "%s", strerror( (*__errno_location ()) )); r = -24; goto out; } } len = atomicio(read, ssh_packet_get_connection_in(ssh), &c, 1); if (len != 1 && (*__errno_location ()) == 32 ) { sshlog("kex.c", __func__, 1296, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "Connection closed by remote host"); r = -52; goto out; } else if (len != 1) { oerrno = (*__errno_location ()) ; sshlog("kex.c", __func__, 1301, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "read: %.100s", strerror( (*__errno_location ()) )); r = -24; goto out; } if (c == '\r') { expect_nl = 1; continue; } if (c == '\n') break; if (c == '\0' || expect_nl) { sshlog("kex.c", __func__, 1312, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "banner line contains invalid " "characters") ; goto invalid; } if ((r = sshbuf_put_u8(peer_version, c)) != 0) { oerrno = (*__errno_location ()) ; sshlog("kex.c", __func__, 1318, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "sshbuf_put"); goto out; } if (sshbuf_len(peer_version) > 8192) { sshlog("kex.c", __func__, 1322, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "banner line too long"); goto invalid; } } if (sshbuf_len(peer_version) > 4 && memcmp(sshbuf_ptr(peer_version), "SSH-", 4) == 0) break; if ((cp = sshbuf_dup_string(peer_version)) == ((void *)0) ) { sshlog("kex.c", __func__, 1332, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "sshbuf_dup_string failed"); r = -2; goto out; } if (ssh->kex->server) { sshlog("kex.c", __func__, 1338, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "client sent invalid protocol identifier " "\"%.256s\"", cp) ; free(cp); goto invalid; } sshlog("kex.c", __func__, 1343, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "banner line %zu: %s", n, cp); free(cp); } peer_version_string = sshbuf_dup_string(peer_version); if (peer_version_string == ((void *)0) ) sshlog("kex.c", __func__, 1348, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "sshbuf_dup_string failed"); if ((remote_version = calloc(1, sshbuf_len(peer_version))) == ((void *)0) ) { sshlog("kex.c", __func__, 1351, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "calloc failed"); r = -2; goto out; } if (sscanf(peer_version_string, "SSH-%d.%d-%[^\n]\n", &remote_major, &remote_minor, remote_version) != 3) { sshlog("kex.c", __func__, 1362, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Bad remote protocol version identification: '%.100s'", peer_version_string) ; invalid: send_error(ssh, "Invalid SSH identification string."); r = -4; goto out; } sshlog("kex.c", __func__, 1369, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Remote protocol version %d.%d, remote software version %.100s", remote_major, remote_minor, remote_version) ; compat_banner(ssh, remote_version); mismatch = 0; switch (remote_major) { case 2: break; case 1: if (remote_minor != 99) mismatch = 1; break; default: mismatch = 1; break; } if (mismatch) { sshlog("kex.c", __func__, 1386, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Protocol major versions differ: %d vs. %d", 2, remote_major) ; send_error(ssh, "Protocol major versions differ."); r = -38; goto out; } if (ssh->kex->server && (ssh->compat & 0x00400000) != 0) { sshlog("kex.c", __func__, 1394, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "probed from %s port %d with %s. Don't panic.", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), peer_version_string) ; r = -52; goto out; } if (ssh->kex->server && (ssh->compat & 0x00000800) != 0) { sshlog("kex.c", __func__, 1401, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "scanned from %s port %d with %s. Don't panic.", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), peer_version_string) ; r = -52; goto out; } if ((ssh->compat & 0x00002000) != 0) { sshlog("kex.c", __func__, 1408, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Remote version \"%.100s\" uses unsafe RSA signature " "scheme; disabling use of RSA keys", remote_version) ; } r = 0; out: free(our_version_string); free(peer_version_string); free(remote_version); if (r == -24) (*__errno_location ()) = oerrno; return r; }
int kex_exchange_identification(long param_1,undefined8 param_2,char *param_3) { int iVar1; long lVar2; int iVar3; int *piVar4; undefined8 uVar5; char *pcVar6; long in_FS_OFFSET; undefined8 uVar7; char *local_a0; lVar2 = *(long *)(in_FS_OFFSET + 0x28); if (*(int *)(*(long *)(param_1 + 8) + 0x18) == 0) { uVar5 = *(undefined8 *)(*(long *)(param_1 + 8) + 0x60); } else { uVar5 = *(undefined8 *)(*(long *)(param_1 + 8) + 0x68); } uVar7 = 0x103884; sshbuf_reset(uVar5); local_a0 = param_3; if ((param_3 != (char *)0x0) && (*param_3 == '\0')) { local_a0 = (char *)0x0; } if (local_a0 == (char *)0x0) { local_a0 = ""; pcVar6 = ""; } else { pcVar6 = " "; } iVar3 = sshbuf_putf(uVar5,"SSH-%d.%d-%.100s%s%s\r\n",2,0,"OpenSSH_9.1",pcVar6,local_a0,uVar7); if (iVar3 == 0) { sshbuf_len(uVar5); sshbuf_mutable_ptr(uVar5); ssh_packet_get_connection_out(param_1); } piVar4 = __errno_location(); iVar1 = *piVar4; uVar7 = 0x10392a; uVar5 = ssh_err(iVar3); sshlog("kex.c","kex_exchange_identification",0x4d5,1,2,uVar5,"sshbuf_putf",uVar7); free((void *)0x0); free((void *)0x0); free((void *)0x0); if (iVar3 == -0x18) { piVar4 = __errno_location(); *piVar4 = iVar1; } if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) { return iVar3; } __stack_chk_fail(); }
void auth2_challenge_stop(struct ssh *ssh) { Authctxt *authctxt = ssh->authctxt; ssh_dispatch_set(ssh, 61, ((void *)0) ); if (authctxt->kbdintctxt != ((void *)0) ) { kbdint_free(authctxt->kbdintctxt); authctxt->kbdintctxt = ((void *)0) ; } }
long auth2_challenge_stop(long a1) { long result; long v2; v2 = *(_QWORD *)(a1 + 2144); ssh_dispatch_set(a1, 61LL, 0LL); result = *(_QWORD *)(v2 + 88); if ( result ) { kbdint_free(*(_QWORD *)(v2 + 88)); result = v2; *(_QWORD *)(v2 + 88) = 0LL; } return result; }
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 long strvec_to_word_list(unsigned long long *a0, unsigned long a1, unsigned long a2) { unsigned int v0; unsigned int v1; void* v2; unsigned long long *v3; void* v5; unsigned long long v6; if (a0 && *(a0)) { for (v1 = 0; a0[v1]; v1 += 1); v0 = a2; for (v2 = 0; v0 < v1; v0 += 1) { if (a1) v6 = a0[v0]; else v6 = &g_40080b; v3 = make_bare_word(v6); if (!a1) { sh_xfree(*(v3), "stringvec.c", 0x10a); *(v3) = a0[v0]; } v2 = make_word_list(v3, v2, v2); } if (v2 && *(v2)) v5 = list_reverse(v2); if (!v2 || !*(v2)) v5 = v2; } if (!*(a0) || !a0) v5 = 0; return v5; }
static _Bool known_term_type (void) { char const *term = getenv ("TERM"); if (! term || ! *term) return 0 ; char const *line = G_line; while (line - G_line < sizeof (G_line)) { if (strncmp (line, "" "TERM " "", sizeof ("TERM ") - 1) == 0) { if (fnmatch (line + 5, term, 0) == 0) return 1 ; } line += strlen (line) + 1; } return 0 ; }
int known_term_type() { unsigned long long v0; char *v1; unsigned int v3; v1 = getenv("TERM"); if (!v1) { LABEL_403849: v3 = 0; } else { if (!*(v1)) goto LABEL_403849; v0 = "# Configuration file for dircolors, a utility to help you set the"; while (true) { if ((-4242272 + v0) > 4807) { v3 = 0; break; } else { if (!strncmp(v0, "TERM ", 0x5) && !fnmatch(v0 + 5, v1, 0x0)) { v3 = 1; break; } v3 = strlen(v0) + 1; v0 += v3; } } } return v3; }
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 **a1) { free(a1[2]); free(a1); }
inline errcode_t ext2fs_resize_mem(unsigned long __attribute__((unused)) old_size, unsigned long size, void *ptr) { void *p; memcpy(&p, ptr, sizeof(p)); p = realloc(p, size); if (!p) return (2133571398L); memcpy(ptr, &p, sizeof(p)); return 0; }
void ext2fs_resize_mem(void) { halt_baddata(); }
static int cmp_version (struct fileinfo const *a, struct fileinfo const *b) { int diff = filevercmp (a->name, b->name); return diff ? diff : strcmp (a->name, b->name); }
void cmp_version(unsigned long long *a0, unsigned long long *a1) { unsigned int v0; unsigned long long v2; unsigned long long v3; v0 = filevercmp(*(a0), *(a1), *(a1)); if (v0) v2 = v0; else v3 = strcmp(*(a0), *(a1)); return; }
static void readline_default_bindings (void) { if (_rl_bind_stty_chars) rl_tty_set_default_bindings (_rl_keymap); }
long long readline_default_bindings() { unsigned long long v1; v1 = _rl_bind_stty_chars; if (_rl_bind_stty_chars) v1 = rl_tty_set_default_bindings(_rl_keymap); return v1; }
int assign_in_env (word, flags) WORD_DESC *word; int flags; { int offset, aflags; char *name, *temp, *value, *newname; SHELL_VAR *var; const char *string; string = word->word; aflags = 0; offset = assignment (string, 0); newname = name = (char *)strcpy (sh_xmalloc((1 + strlen (string)), "variables.c", 3605), (string)); value = (char *) ((void *)0) ; if (name[offset] == '=') { name[offset] = 0; if (name[offset - 1] == '+') { name[offset - 1] = '\0'; aflags |= 0x0001; } if (legal_identifier (name) == 0) { sh_invalidid (name); sh_xfree((name), "variables.c", 3622); return (0); } var = find_variable (name); if (var == 0) { var = find_variable_last_nameref (name, 1); if (var && ((((var)->attributes) & (0x0000800))) && valid_nameref_value (((var)->value), 2)) { newname = ((var)->value); var = 0; } } else newname = ((var)->name); if (var && (((((var)->attributes) & (0x0000002))) || ((((var)->attributes) & (0x0004000))))) { if (((((var)->attributes) & (0x0000002)))) err_readonly (name); sh_xfree((name), "variables.c", 3651); return (0); } temp = name + offset + 1; value = expand_assignment_string_to_string (temp, 0); if (var && (aflags & 0x0001)) { if (value == 0) { value = (char *)sh_xmalloc((1), "variables.c", 3662); value[0] = '\0'; } temp = make_variable_value (var, value, aflags); do { if (value) sh_xfree((value), "variables.c", 3666); } while (0); value = temp; } } if (temporary_env == 0) temporary_env = hash_create (4); var = hash_lookup (newname, temporary_env); if (var == 0) var = make_new_variable (newname, temporary_env); else do { if (((var)->value)) sh_xfree((((var)->value)), "variables.c", 3678); } while (0); if (value == 0) { value = (char *)sh_xmalloc((1), "variables.c", 3682); value[0] = '\0'; } ((var)->value = (value)); var->attributes |= (0x0000001|0x0100000); var->context = variable_context; do { if ((var)->exportstr) { sh_xfree(((var)->exportstr), "variables.c", 3690); (var)->exportstr = (char *) ((void *)0) ; } } while (0); var->exportstr = mk_env_string (newname, value, 0); array_needs_making = 1; if (flags) { if (((newname)[0] == ("POSIXLY_CORRECT")[0] && strcmp(newname, "POSIXLY_CORRECT") == 0) || ((newname)[0] == ("POSIX_PEDANDTIC")[0] && strcmp(newname, "POSIX_PEDANDTIC") == 0)) save_posix_options (); stupidly_hack_special_variables (newname); } if (echo_command_at_execute) xtrace_print_assignment (name, value, 0, 1); sh_xfree((name), "variables.c", 3707); return 1; }
undefined8 assign_in_env(char **param_1,int param_2) { int iVar1; int iVar2; size_t sVar3; char *__dest; char *pcVar4; undefined *puVar5; undefined8 uVar6; bool bVar7; undefined *local_38; char *local_30; char **local_28; pcVar4 = *param_1; iVar1 = assignment(pcVar4,0); sVar3 = strlen(pcVar4); __dest = (char *)sh_xmalloc(sVar3 + 1,"variables.c",0xe15); pcVar4 = strcpy(__dest,pcVar4); local_38 = (undefined *)0x0; puVar5 = local_38; local_30 = pcVar4; if (pcVar4[iVar1] == '=') { pcVar4[iVar1] = '\0'; bVar7 = pcVar4[(long)iVar1 + -1] == '+'; if (bVar7) { pcVar4[(long)iVar1 + -1] = '\0'; } iVar2 = legal_identifier(pcVar4); if (iVar2 == 0) { sh_invalidid(pcVar4); sh_xfree(pcVar4,"variables.c",0xe26); return 0; } local_28 = (char **)find_variable(pcVar4); if (local_28 == (char **)0x0) { local_28 = (char **)find_variable_last_nameref(pcVar4,1); if (((local_28 != (char **)0x0) && ((*(uint *)(local_28 + 5) & 0x800) != 0)) && (iVar2 = valid_nameref_value(local_28[1],2), iVar2 != 0)) { local_30 = local_28[1]; local_28 = (char **)0x0; } } else { local_30 = *local_28; } if ((local_28 != (char **)0x0) && (((*(uint *)(local_28 + 5) & 2) != 0 || ((*(uint *)(local_28 + 5) & 0x4000) != 0)))) { if ((*(uint *)(local_28 + 5) & 2) != 0) { err_readonly(pcVar4); } sh_xfree(pcVar4,"variables.c",0xe43); return 0; } local_38 = (undefined *)expand_assignment_string_to_string(pcVar4 + (long)iVar1 + 1,0); puVar5 = local_38; if ((local_28 != (char **)0x0) && (bVar7)) { if (local_38 == (undefined *)0x0) { local_38 = (undefined *)sh_xmalloc(1,"variables.c",0xe4e); *local_38 = 0; } puVar5 = (undefined *)make_variable_value(local_28,local_38,bVar7); if (local_38 != (undefined *)0x0) { sh_xfree(local_38,"variables.c",0xe52); } } } local_38 = puVar5; if (temporary_env == 0) { temporary_env = hash_create(4); } local_28 = (char **)hash_lookup(local_30,temporary_env); if (local_28 == (char **)0x0) { local_28 = (char **)make_new_variable(local_30,temporary_env); } else if (*(long *)((long)local_28 + 8) != 0) { sh_xfree(*(undefined8 *)((long)local_28 + 8),"variables.c",0xe5e); } if (local_38 == (undefined *)0x0) { local_38 = (undefined *)sh_xmalloc(1,"variables.c",0xe62); *local_38 = 0; } *(undefined **)((long)local_28 + 8) = local_38; *(uint *)((long)local_28 + 0x28) = *(uint *)((long)local_28 + 0x28) | 0x100001; *(undefined4 *)((long)local_28 + 0x2c) = variable_context; if (*(long *)((long)local_28 + 0x10) != 0) { sh_xfree(*(undefined8 *)((long)local_28 + 0x10),"variables.c",0xe6a); *(undefined8 *)((long)local_28 + 0x10) = 0; } uVar6 = mk_env_string(local_30,local_38,0); *(undefined8 *)((long)local_28 + 0x10) = uVar6; array_needs_making = 1; if (param_2 != 0) { if (((*local_30 == 'P') && (iVar1 = strcmp(local_30,"POSIXLY_CORRECT"), iVar1 == 0)) || ((*local_30 == 'P' && (iVar1 = strcmp(local_30,"POSIX_PEDANDTIC"), iVar1 == 0)))) { save_posix_options(); } stupidly_hack_special_variables(local_30); } if (echo_command_at_execute != 0) { xtrace_print_assignment(pcVar4,local_38,0,1); } sh_xfree(pcVar4,"variables.c",0xe7b); return 1; }
void sh_free (mem, file, line) void * mem; const char *file; int line; { internal_free (mem, file, line, 0x01); }
long long sh_free(unsigned int a0, unsigned long long a1, unsigned long a2) { return internal_free(a0, a1, a2, 0x1); }
static _Bool tar_sparse_decode_header (struct tar_sparse_file *file) { if (file->optab->decode_header) return file->optab->decode_header (file); return 1 ; }
int tar_sparse_decode_header(struct_0 *a0) { unsigned int v1; if (a0->field_20->field_28) v1 = a0->field_20->field_28(a0); else v1 = 1; return v1; }
int rl_delete_or_show_completions (int count, int key) { if (rl_end != 0 && rl_point == rl_end) return (rl_possible_completions (count, key)); else return (rl_delete (count, key)); }
void rl_delete_or_show_completions(undefined4 param_1,undefined4 param_2) { if ((rl_end == 0) || (rl_point != rl_end)) { rl_delete(param_1,param_2); } else { rl_possible_completions(param_1,param_2); } return; }
static void parameter_brace_expand_error (name, value, check_null) char *name, *value; int check_null; { WORD_LIST *l; char *temp; set_exit_status (1); if (value && *value) { l = expand_string (value, 0); temp = string_list (l); report_error ("%s: %s", name, temp ? temp : ""); do { if (temp) sh_xfree((temp), "subst.c", 7939); } while (0); dispose_words (l); } else if (check_null == 0) report_error (gettext("%s: parameter not set"), name); else report_error (gettext("%s: parameter null or not set"), name); sh_xfree((name), "subst.c", 7949); do { if (value) sh_xfree((value), "subst.c", 7950); } while (0); }
void parameter_brace_expand_error(unsigned long long a0, char *a1, unsigned int a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { void* v0; unsigned long long v1; unsigned long long v3; unsigned long long v4; unsigned long long v6; unsigned long long v7; set_exit_status(0x1); if (!(!a1 || !*(a1))) { v0 = expand_string(a1, 0x0, a2, a3, a4, a5); v1 = string_list(v0); report_error("%s: %s", a0, (!v1 ? v1 : &g_41fa65), a0); if (v1) sh_xfree(v1, "subst.c", 0x1f03); dispose_words(v0); } else if (a2) { v4 = gettext("%s: parameter null or not set"); report_error(v4, a0, v4, a3); } else { v3 = gettext("%s: parameter not set"); report_error(v3, a0, v3, a3); } v6 = sh_xfree(a0, "subst.c", 0x1f0d); if (a1) { v7 = sh_xfree(a1, "subst.c", 0x1f0e); return; } return; }
static inline __u32 rta_getattr_u32(const struct rtattr *rta) { return *(__u32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); }
undefined4 rta_getattr_u32(long param_1) { return *(undefined4 *)(param_1 + 4); }
void ifsfree(void) { struct ifsregion *p = ifsfirst.next; if (!p) goto out; ({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; }); do { struct ifsregion *ifsp; ifsp = p->next; free((pointer)(p)); p = ifsp; } while (p); ifsfirst.next = ((void *)0) ; ({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; }); out: ifslastp = ((void *)0) ; }
void ifsfree() { unsigned long long *v0; void* v1; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; v3 = ifsfirst; v0 = ifsfirst; if (v0) { suppressint = suppressint + 1; do { v1 = *(v0); free(v0); v0 = v1; } while (v0); ifsfirst = 0; suppressint = suppressint - 1; v4 = suppressint; if (!suppressint) { v5 = intpending; if (intpending) v6 = onint(); } } ifslastp = 0; return; }
1 , 0, gettext ("Please specify a decimal number immediately after -O")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; } else if (*end) { ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"Invalid optimisation level %s\"), arg), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("Invalid optimisation level %s"), arg), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("Invalid optimisation level %s"), arg), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); }
void gettext(void) { halt_baddata(); }
static int parse_prime(int linenum, char *line, struct dhgroup *dhg) { char *cp, *arg; char *strsize, *gen, *prime; const char *errstr = ((void *)0) ; long long n; dhg->p = dhg->g = ((void *)0) ; cp = line; if ((arg = strdelim(&cp)) == ((void *)0) ) return 0; if (*arg == '\0') arg = strdelim(&cp); if (!arg || !*arg || *arg == '#') return 0; if (cp == ((void *)0) || *arg == '\0') goto truncated; arg = strsep(&cp, " "); if (cp == ((void *)0) || *arg == '\0') goto truncated; n = strtonum(arg, 0, 5, &errstr); if (errstr != ((void *)0) || n != (2)) { sshlog("dh.c", __func__, 87, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "moduli:%d: type is not %d", linenum, (2)); goto fail; } arg = strsep(&cp, " "); if (cp == ((void *)0) || *arg == '\0') goto truncated; n = strtonum(arg, 0, 0x1f, &errstr); if (errstr != ((void *)0) || (n & (0x01)) || !(n & ~(0x01))) { sshlog("dh.c", __func__, 97, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "moduli:%d: invalid moduli tests flag", linenum); goto fail; } arg = strsep(&cp, " "); if (cp == ((void *)0) || *arg == '\0') goto truncated; n = strtonum(arg, 0, 1<<30, &errstr); if (errstr != ((void *)0) || n == 0) { sshlog("dh.c", __func__, 105, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "moduli:%d: invalid primality trial count", linenum); goto fail; } strsize = strsep(&cp, " "); if (cp == ((void *)0) || *strsize == '\0' || (dhg->size = (int)strtonum(strsize, 0, 64*1024, &errstr)) == 0 || errstr) { sshlog("dh.c", __func__, 112, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "moduli:%d: invalid prime length", linenum); goto fail; } dhg->size++; gen = strsep(&cp, " "); if (cp == ((void *)0) || *gen == '\0') goto truncated; prime = strsep(&cp, " "); if (cp != ((void *)0) || *prime == '\0') { truncated: sshlog("dh.c", __func__, 123, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "moduli:%d: truncated", linenum); goto fail; } if ((dhg->g = BN_new()) == ((void *)0) || (dhg->p = BN_new()) == ((void *)0) ) { sshlog("dh.c", __func__, 129, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "parse_prime: BN_new failed"); goto fail; } if (BN_hex2bn(&dhg->g, gen) == 0) { sshlog("dh.c", __func__, 133, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "moduli:%d: could not parse generator value", linenum); goto fail; } if (BN_hex2bn(&dhg->p, prime) == 0) { sshlog("dh.c", __func__, 137, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "moduli:%d: could not parse prime value", linenum); goto fail; } if (BN_num_bits(dhg->p) != dhg->size) { sshlog("dh.c", __func__, 141, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "moduli:%d: prime has wrong size: actual %d listed %d", linenum, BN_num_bits(dhg->p), dhg->size - 1) ; goto fail; } if (BN_cmp(dhg->g, BN_value_one()) <= 0) { sshlog("dh.c", __func__, 146, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "moduli:%d: generator is invalid", linenum); goto fail; } return 1; fail: BN_clear_free(dhg->g); BN_clear_free(dhg->p); dhg->g = dhg->p = ((void *)0) ; return 0; }
int parse_prime(unsigned long a0, unsigned long a1, struct_0 *a2) { char v0; char v1; void* v2; char *v3; unsigned long v4; char *v5; char *v6; char *v7; unsigned int v9; unsigned long long v10; v2 = 0; a2->field_8 = 0; a2->field_10 = a2->field_8; v3 = strdelim(&v1); if (!v3) { v9 = 0; } else { if (!*(v3)) v3 = strdelim(&v1); if (!v3) { LABEL_4000ec: v9 = 0; } else { if (!*(v3)) goto LABEL_4000ec; if (*(v3) == 35) goto LABEL_4000ec; if (!a1) { LABEL_400437: goto LABEL_400447; } else { if (!*(v3)) goto LABEL_400437; v3 = strsep(&v1, " "); if (!a1) { LABEL_40043a: goto LABEL_400447; } else { if (!*(v3)) goto LABEL_40043a; v4 = strtonum(v3, 0x0, 0x5, &v2); if (v2) { LABEL_400176: sshlog("dh.c", "parse_prime", 0x57, 0x0, 0x2, 0x0, "moduli:%d: type is not %d", a0); goto LABEL_4006a3; } else { if (!(v4 == 2)) goto LABEL_400176; v3 = strsep(&v1, " "); if (!a1) { LABEL_40043d: goto LABEL_400447; } else { if (!*(v3)) goto LABEL_40043d; v4 = strtonum(v3, 0x0, 0x1f, &v2); if (v2) { LABEL_400235: sshlog("dh.c", "parse_prime", 0x61, 0x0, 0x2, 0x0, "moduli:%d: invalid moduli tests flag", a0); goto LABEL_4006a3; } else { if (!(!(v4 & 1))) goto LABEL_400235; if (!(v4 & -2)) goto LABEL_400235; v3 = strsep(&v1, " "); if (!a1) { LABEL_400440: goto LABEL_400447; } else { if (!*(v3)) goto LABEL_400440; v4 = strtonum(v3, 0x0, 0x40000000, &v2); if (v2) { LABEL_4002dc: sshlog("dh.c", "parse_prime", 0x69, 0x0, 0x2, 0x0, "moduli:%d: invalid primality trial count", a0); goto LABEL_4006a3; } else { if (!v4) goto LABEL_4002dc; v5 = strsep(&v1, " "); if (!a1) { LABEL_400382: sshlog("dh.c", "parse_prime", 0x70, 0x0, 0x2, 0x0, "moduli:%d: invalid prime length", a0); goto LABEL_4006a3; } else { if (!*(v5)) goto LABEL_400382; a2->field_0 = strtonum(v5, 0x0, 0x10000, &v2); if (!a2->field_0) goto LABEL_400382; if (!(!v2)) goto LABEL_400382; a2->field_0 = __addvsi3(a2->field_0, 0x1); v6 = strsep(&v1, " "); if (!a1) { LABEL_400443: goto LABEL_400447; } else { if (!*(v6)) goto LABEL_400443; v7 = strsep(&v1, " "); if (a1) { LABEL_400446: LABEL_400447: sshlog("dh.c", "parse_prime", 0x7b, 0x0, 0x2, 0x0, "moduli:%d: truncated", a0); goto LABEL_4006a3; } else { if (!*(v7)) goto LABEL_400446; a2->field_8 = BN_new(); if (!a2->field_8) { LABEL_4004be: sshlog("dh.c", "parse_prime", 0x81, 0x0, 0x2, 0x0, "parse_prime: BN_new failed", *(&v0)); goto LABEL_4006a3; } else { a2->field_10 = BN_new(); if (!a2->field_10) goto LABEL_4004be; if (!BN_hex2bn(&a2->field_8, v6, &a2->field_8)) { sshlog("dh.c", "parse_prime", 0x85, 0x0, 0x2, 0x0, "moduli:%d: could not parse generator value", a0); } else if (!BN_hex2bn(&a2->field_10, v7, &a2->field_10)) { sshlog("dh.c", "parse_prime", 0x89, 0x0, 0x2, 0x0, "moduli:%d: could not parse prime value", a0); } else if (BN_num_bits(a2->field_10) != a2->field_0) { v10 = __addvsi3(a2->field_0, 0xffffffff); BN_num_bits(a2->field_10); sshlog("dh.c", "parse_prime", 0x8d, 0x0, 0x2, 0x0, "moduli:%d: prime has wrong size: actual %d listed %d", a0); } else { v9 = BN_value_one(); if (BN_cmp(a2->field_8, v9, v9) > 0) { v9 = 1; goto LABEL_4006e4; } else { sshlog("dh.c", "parse_prime", 0x92, 0x0, 0x2, 0x0, "moduli:%d: generator is invalid", a0); } } LABEL_4006a3: BN_clear_free(a2->field_8); BN_clear_free(a2->field_10); a2->field_10 = 0; a2->field_8 = a2->field_10; v9 = 0; } } } } } } } } } } } } } LABEL_4006e4: return v9; }
int format_total_stats (FILE *fp, char const *const *formats, int eor, int eol) { int n; switch (subcommand_option) { case CREATE_SUBCOMMAND: case CAT_SUBCOMMAND: case UPDATE_SUBCOMMAND: case APPEND_SUBCOMMAND: n = print_stats (fp, formats[1], prev_written + bytes_written); break; case DELETE_SUBCOMMAND: { char buf[((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)]; n = print_stats (fp, formats[0], records_read * record_size); fputc_unlocked (eor,fp); n++; n += print_stats (fp, formats[1], prev_written + bytes_written); fputc_unlocked (eor,fp); n++; if (formats[2] && formats[2][0]) n += fprintf (fp, "%s: ", gettext (formats[2])); n += fprintf (fp, "%s", umaxtostr ((records_read - records_skipped) * record_size - (prev_written + bytes_written), buf) ); } break; case EXTRACT_SUBCOMMAND: case LIST_SUBCOMMAND: case DIFF_SUBCOMMAND: n = print_stats (fp, gettext (formats[0]), records_read * record_size); break; default: abort (); } if (eol) { fputc_unlocked (eol,fp); n++; } return n; }
void format_total_stats(unsigned long long a0, struct_2 *a1, unsigned long a2, unsigned long a3) { unsigned long long v0; unsigned int v1; char v2; uint128_t v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; if (subcommand_option == 8) { LABEL_400ca6: v1 = print_stats(a0, a1->field_8); goto LABEL_400f02; } else { if (subcommand_option <= 8 && subcommand_option <= 7) { if (subcommand_option >= 5) { if (16752697132039570248 * *(&record_size) >= 0) v0 = 16752697132039570248 * *(&record_size); else v0 = (16752697132039570248 * *(&record_size) >> 1 | (16752697132039570248 * *(&record_size)) & 1) * 2; v1 = print_stats(a0, gettext(a1->padding_0)); LABEL_400f02: if (a3) { fputc_unlocked(a3, a0); v1 += 1; } v7 = v1; return; } if (subcommand_option <= 3) { if (!subcommand_option) goto LABEL_400efd; goto LABEL_400ca6; } else if (subcommand_option == 4) { v1 = print_stats(a0, a1->padding_0); fputc_unlocked(a2, a0); v1 += 1; xmm0<16> = Conv(64->128, (Load(addr=0x404ae8<64>, size=8, endness=Iend_LE) + Load(addr=0x404ae0<64>, size=8, endness=Iend_LE))) v5 = print_stats(a0, a1->field_8); v1 += v5; fputc_unlocked(a2, a0); v1 += 1; if (a1[1].padding_0 && *(a1[1].padding_0)) { v5 = fprintf(a0, "%s: ", gettext(a1[1].padding_0)); v1 += v5; } if ((16752697132039570248 - records_skipped) * *(&record_size) >= 0) *(&v4) = (16752697132039570248 - records_skipped) * *(&record_size); else v4 = (0 CONCAT (16752697132039570248 - records_skipped) * *(&record_size) >> 1 | ((16752697132039570248 - records_skipped) * *(&record_size)) & 1) + (0 CONCAT (16752697132039570248 - records_skipped) * *(&record_size) >> 1 | ((16752697132039570248 - records_skipped) * *(&record_size)) & 1); xmm0lq<8> = Conv(128->64, (xmm0<16> - Conv(64->128, (Load(addr=0x404ae8<64>, size=8, endness=Iend_LE) + Load(addr=0x404ae0<64>, size=8, endness=Iend_LE))))) if ((BinaryOp CmpF & 1)) v5 = v4; else v6 = v5 - 0x43e0000000000000 ^ 0x8000000000000000; v1 += fprintf(a0, "%s", umaxtostr(v6, &v2, &v2)); goto LABEL_400f02; } } LABEL_400efd: abort(); } }
static void usage (int status) { FILE *usageout = (0 != status) ? stderr : stdout ; (void) fprintf (usageout, gettext ("Usage: %s [options] GROUP\n" "\n" "Options:\n") , Prog); (void) fputs (gettext (" -h, --help display this help message and exit\n"), usageout); (void) fputs (gettext (" -R, --root CHROOT_DIR directory to chroot into\n"), usageout); (void) fputs (gettext (" -P, --prefix PREFIX_DIR prefix directory where are located the /etc/* files\n"), usageout); (void) fputs (gettext (" -f, --force delete group even if it is the primary group of a user\n"), usageout); (void) fputs ("\n", usageout); exit (status); }
long long usage(unsigned long a0) { void* v0; unsigned long v1; unsigned long v3; v1 = v3; *(&v0) = (!a0 ? stderr : stdout); fprintf(v0, gettext("Usage: %s [options] GROUP\n\nOptions:\n")); fputs(gettext(" -h, --help display this help message and exit\n"), v0); fputs(gettext(" -R, --root CHROOT_DIR directory to chroot into\n"), v0); fputs(gettext(" -P, --prefix PREFIX_DIR prefix directory where are located the /etc }
int validate_version(const char *const *argv) { struct dpkg_version version; struct dpkg_error err; if (!argv[0] || argv[1]) badusage(gettext("--%s takes one <version> argument"), cipaction->olong); if (parseversion(&version, argv[0], &err) < 0) { dpkg_error_print(&err, gettext("version '%s' has bad syntax"), argv[0]); dpkg_error_destroy(&err); return 1; } return 0; }
long validate_version(_QWORD *a1) { long v1; char *v2; long v3; char *v4; char v6[16]; char v7[24]; unsigned long v8; v8 = __readfsqword(0x28u); if ( !*a1 || a1[1] ) { v1 = *cipaction; v2 = gettext("--%s takes one <version> argument"); badusage(v2, v1); } if ( (int)parseversion(v7, *a1, v6) >= 0 ) return 0LL; v3 = *a1; v4 = gettext("version '%s' has bad syntax"); dpkg_error_print(v6, v4, v3); dpkg_error_destroy(v6); return 1LL; }
static void sigchld_handler(int sig) { int save_errno = (*__errno_location ()) ; pid_t pid; const char msg[] = "\rConnection closed. \n"; while ((pid = waitpid(sshpid, ((void *)0) , 1 )) == -1 && (*__errno_location ()) == 4 ) continue; if (pid == sshpid) { (void)write( 2 , msg, sizeof(msg) - 1); sshpid = -1; } (*__errno_location ()) = save_errno; }
void sigchld_handler(void) { int iVar1; __pid_t _Var2; int *piVar3; long in_FS_OFFSET; undefined8 local_28; undefined8 local_20; undefined4 local_18; undefined2 local_14; undefined local_12; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); piVar3 = __errno_location(); iVar1 = *piVar3; local_28 = 0x7463656e6e6f430d; local_20 = 0x736f6c63206e6f69; local_18 = 0x202e6465; local_14 = 0xa20; local_12 = 0; do { _Var2 = waitpid(sshpid,(int *)0x0,1); if (_Var2 != -1) break; piVar3 = __errno_location(); } while (*piVar3 == 4); if (_Var2 == sshpid) { write(2,&local_28,0x16); sshpid = -1; } piVar3 = __errno_location(); *piVar3 = iVar1; if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
static void set_locktime (long locktime) { if (uflg && has_umin && has_umax && (umin==umax)) { if (set_locktime_one ((uid_t)umin, locktime)) { errors = 1 ; } } else { if (aflg) { uid_t uid = 0; uid_t uidmax = statbuf.st_size / sizeof (struct faillog); if (uidmax > 1) { uidmax--; } if (has_umin) { uid = (uid_t)umin; } if (has_umax) { uidmax = (uid_t)umax; } while (uid <= uidmax) { if (set_locktime_one (uid, locktime)) { errors = 1 ; } uid++; } } else { struct passwd *pwent; setpwent (); while ( (pwent = getpwent ()) != ((void *)0) ) { if ( uflg && ( (has_umin && (pwent->pw_uid < (uid_t)umin)) || (has_umax && (pwent->pw_uid > (uid_t)umax)))) { continue; } if (set_locktime_one (pwent->pw_uid, locktime)) { errors = 1 ; } } endpwent (); } } }
void set_locktime(undefined8 param_1) { char cVar1; passwd *ppVar2; uint local_18; uint local_14; if ((((uflg == '\0') || (has_umin == '\0')) || (has_umax == '\0')) || (umin != umax)) { if (aflg == '\0') { setpwent(); while (ppVar2 = getpwent(), ppVar2 != (passwd *)0x0) { if (((uflg == '\0') || (((has_umin == '\0' || ((uint)umin <= ppVar2->pw_uid)) && ((has_umax == '\0' || (ppVar2->pw_uid <= (uint)umax)))))) && (cVar1 = set_locktime_one(ppVar2->pw_uid,param_1), cVar1 != '\0')) { errors = 1; } } endpwent(); } else { local_18 = 0; local_14 = (uint)(statbuf._48_8_ >> 5); if (1 < local_14) { local_14 = local_14 - 1; } if (has_umin != '\0') { local_18 = (uint)umin; } if (has_umax != '\0') { local_14 = (uint)umax; } for (; local_18 <= local_14; local_18 = local_18 + 1) { cVar1 = set_locktime_one(local_18,param_1); if (cVar1 != '\0') { errors = 1; } } } } else { cVar1 = set_locktime_one(umin & 0xffffffff,param_1); if (cVar1 != '\0') { errors = 1; } } return; }
static int undoablefd (fd) int fd; { int clexec; clexec = fcntl (fd, 1 , 0); if (clexec == -1 || (fd >= 10 && clexec == 1)) return 0; return 1; }
long long undoablefd(unsigned long a0) { char v0; unsigned int v1; unsigned long long v3; v1 = fcntl(a0, 0x1); if (v1 == -1) { LABEL_401094: v3 = 0; } else if (*(&v0) <= 9) { LABEL_40109b: v3 = 1; } else { if (!(v1 == 1)) goto LABEL_40109b; goto LABEL_401094; } return v3; }
static void print_ndtparams(struct rtattr *tpb[]) { if (tpb[NDTPA_IFINDEX]) { __u32 ifindex = rta_getattr_u32(tpb[NDTPA_IFINDEX]); print_string(PRINT_FP, ((void *)0) , " dev ", ((void *)0) ); print_color_string(PRINT_ANY, COLOR_IFNAME, "dev", "%s ", ll_index_to_name(ifindex)); print_nl(); } print_string(PRINT_FP, ((void *)0) , " ", ((void *)0) ); if (tpb[NDTPA_REFCNT]) { __u32 refcnt = rta_getattr_u32(tpb[NDTPA_REFCNT]); print_uint(PRINT_ANY, "refcnt", "refcnt %u ", refcnt); } if (tpb[NDTPA_REACHABLE_TIME]) { __u64 reachable = rta_getattr_u64(tpb[NDTPA_REACHABLE_TIME]); print_u64(PRINT_ANY, "reachable", "reachable %llu ", reachable); } if (tpb[NDTPA_BASE_REACHABLE_TIME]) { __u64 breachable = rta_getattr_u64(tpb[NDTPA_BASE_REACHABLE_TIME]); print_u64(PRINT_ANY, "base_reachable", "base_reachable %llu ", breachable); } if (tpb[NDTPA_RETRANS_TIME]) { __u64 retrans = rta_getattr_u64(tpb[NDTPA_RETRANS_TIME]); print_u64(PRINT_ANY, "retrans", "retrans %llu ", retrans); } print_string(PRINT_FP, ((void *)0) , "%s ", _SL_); if (tpb[NDTPA_GC_STALETIME]) { __u64 gc_stale = rta_getattr_u64(tpb[NDTPA_GC_STALETIME]); print_u64(PRINT_ANY, "gc_stale", "gc_stale %llu ", gc_stale); } if (tpb[NDTPA_DELAY_PROBE_TIME]) { __u64 delay_probe = rta_getattr_u64(tpb[NDTPA_DELAY_PROBE_TIME]); print_u64(PRINT_ANY, "delay_probe", "delay_probe %llu ", delay_probe); } if (tpb[NDTPA_QUEUE_LEN]) { __u32 queue = rta_getattr_u32(tpb[NDTPA_QUEUE_LEN]); print_uint(PRINT_ANY, "queue", "queue %u ", queue); } print_string(PRINT_FP, ((void *)0) , "%s ", _SL_); if (tpb[NDTPA_APP_PROBES]) { __u32 aprobe = rta_getattr_u32(tpb[NDTPA_APP_PROBES]); print_uint(PRINT_ANY, "app_probes", "app_probes %u ", aprobe); } if (tpb[NDTPA_UCAST_PROBES]) { __u32 uprobe = rta_getattr_u32(tpb[NDTPA_UCAST_PROBES]); print_uint(PRINT_ANY, "ucast_probes", "ucast_probes %u ", uprobe); } if (tpb[NDTPA_MCAST_PROBES]) { __u32 mprobe = rta_getattr_u32(tpb[NDTPA_MCAST_PROBES]); print_uint(PRINT_ANY, "mcast_probes", "mcast_probes %u ", mprobe); } print_string(PRINT_FP, ((void *)0) , "%s ", _SL_); if (tpb[NDTPA_ANYCAST_DELAY]) { __u64 anycast_delay = rta_getattr_u64(tpb[NDTPA_ANYCAST_DELAY]); print_u64(PRINT_ANY, "anycast_delay", "anycast_delay %llu ", anycast_delay); } if (tpb[NDTPA_PROXY_DELAY]) { __u64 proxy_delay = rta_getattr_u64(tpb[NDTPA_PROXY_DELAY]); print_u64(PRINT_ANY, "proxy_delay", "proxy_delay %llu ", proxy_delay); } if (tpb[NDTPA_PROXY_QLEN]) { __u32 pqueue = rta_getattr_u32(tpb[NDTPA_PROXY_QLEN]); print_uint(PRINT_ANY, "proxy_queue", "proxy_queue %u ", pqueue); } if (tpb[NDTPA_LOCKTIME]) { __u64 locktime = rta_getattr_u64(tpb[NDTPA_LOCKTIME]); print_u64(PRINT_ANY, "locktime", "locktime %llu ", locktime); } print_nl(); }
long print_ndtparams(long *a1) { const char *v1; long v2; unsigned int v5; unsigned int v6; unsigned int v7; unsigned int v8; unsigned int v9; unsigned int v10; unsigned int v11; long v12; long v13; long v14; long v15; long v16; long v17; long v18; long v19; if ( a1[1] ) { v5 = rta_getattr_u32(a1[1]); print_string(1u, 0LL, " dev ", 0LL); v1 = (const char *)ll_index_to_name(v5); print_color_string(4LL, 0LL, "dev", "%s ", v1); print_nl(4LL); } print_string(1u, 0LL, " ", 0LL); if ( a1[2] ) { v6 = rta_getattr_u32(a1[2]); print_uint(4u, (long)"refcnt", (long)"refcnt %u ", v6); } if ( a1[3] ) { v12 = rta_getattr_u64(a1[3]); print_u64(4u, (long)"reachable", (long)"reachable %llu ", v12); } if ( a1[4] ) { v13 = rta_getattr_u64(a1[4]); print_u64(4u, (long)"base_reachable", (long)"base_reachable %llu ", v13); } if ( a1[5] ) { v14 = rta_getattr_u64(a1[5]); print_u64(4u, (long)"retrans", (long)"retrans %llu ", v14); } print_string(1u, 0LL, "%s ", SL_); if ( a1[6] ) { v15 = rta_getattr_u64(a1[6]); print_u64(4u, (long)"gc_stale", (long)"gc_stale %llu ", v15); } if ( a1[7] ) { v16 = rta_getattr_u64(a1[7]); print_u64(4u, (long)"delay_probe", (long)"delay_probe %llu ", v16); } if ( a1[8] ) { v7 = rta_getattr_u32(a1[8]); print_uint(4u, (long)"queue", (long)"queue %u ", v7); } print_string(1u, 0LL, "%s ", SL_); if ( a1[9] ) { v8 = rta_getattr_u32(a1[9]); print_uint(4u, (long)"app_probes", (long)"app_probes %u ", v8); } if ( a1[10] ) { v9 = rta_getattr_u32(a1[10]); print_uint(4u, (long)"ucast_probes", (long)"ucast_probes %u ", v9); } if ( a1[11] ) { v10 = rta_getattr_u32(a1[11]); print_uint(4u, (long)"mcast_probes", (long)"mcast_probes %u ", v10); } v2 = 1LL; print_string(1u, 0LL, "%s ", SL_); if ( a1[12] ) { v17 = rta_getattr_u64(a1[12]); v2 = 4LL; print_u64(4u, (long)"anycast_delay", (long)"anycast_delay %llu ", v17); } if ( a1[13] ) { v18 = rta_getattr_u64(a1[13]); v2 = 4LL; print_u64(4u, (long)"proxy_delay", (long)"proxy_delay %llu ", v18); } if ( a1[14] ) { v11 = rta_getattr_u32(a1[14]); v2 = 4LL; print_uint(4u, (long)"proxy_queue", (long)"proxy_queue %u ", v11); } if ( a1[15] ) { v19 = rta_getattr_u64(a1[15]); v2 = 4LL; print_u64(4u, (long)"locktime", (long)"locktime %llu ", v19); } return print_nl(v2); }
void set_follow_state (enum SymlinkOption opt) { switch (opt) { case SYMLINK_ALWAYS_DEREF: options.xstat = optionl_stat; options.x_getfilecon = optionl_getfilecon; options.no_leaf_check = 1 ; break; case SYMLINK_NEVER_DEREF: options.xstat = optionp_stat; options.x_getfilecon = optionp_getfilecon; break; case SYMLINK_DEREF_ARGSONLY: options.xstat = optionh_stat; options.x_getfilecon = optionh_getfilecon; options.no_leaf_check = 1 ; } options.symlink_handling = opt; if (options.debug_options & DebugStat) { options.xstat = debug_stat; } }
void set_follow_state(unsigned long a0) { unsigned long long v1; unsigned long long v2; switch (a0) { case 0: gettext = got.optionp_stat; get_stat_atime = optionp_getfilecon; break; case 1: gettext = got.optionl_stat; get_stat_atime = optionl_getfilecon; g_500014 = 1; break; default: goto LABEL_40040e; } LABEL_40040e: got.pred_prune = a0; v1 = pred_prune & 2; if ((pred_prune & 2)) { v2 = got.debug_stat; gettext = got.debug_stat; } return; }
static inline void __jiffies_to_tv(struct timeval *tv, unsigned long jiffies) { unsigned long long tvusec; tvusec = 10000ULL*jiffies; tv->tv_sec = tvusec/1000000; tv->tv_usec = tvusec - 1000000 * tv->tv_sec; }
void __jiffies_to_tv(unsigned long long a0[2], unsigned long a1) { unsigned long v0; char v1; unsigned long long v3[2]; unsigned long long v4; v0 = a1 * 10000; a0[0] = v0 * 4835703278458516699 >> 64 >> 18; v3 = a0; a0[1] = v0 - a0[0] * 1000000; v4 = *(&v1); return; }
static int do_add(int argc, char **argv) { struct { struct nlmsghdr n; struct genlmsghdr g; char buf[( ((0)+4U -1) & ~(4U -1) ) + (1024)]; } req = { .n = { .nlmsg_type = (genl_family), .nlmsg_flags = (0x01), .nlmsg_len = ((( ((sizeof(struct genlmsghdr))+4U -1) & ~(4U -1) ) + (0)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))), }, .g = { .cmd = (ILA_CMD_ADD), .version = (0x1), }, }; ila_parse_opt(argc, argv, &req.n, 1 ); if (rtnl_talk(&genl_rth, &req.n, ((void *)0) ) < 0) return -2; return 0; }
void do_add(unsigned long a0, unsigned int a1) { unsigned int v0; unsigned int v1; unsigned short v2; unsigned short v3; char v4; char v5; unsigned long long v7; void* v8; unsigned long v9; unsigned long long v11; void* v12; v0 = a0; v7 = 130; for (v8 = &v1; v7; v8 += v9 * 8) { v7 -= 1; v1 = 0; } *(v8) = 0; v1 = 20; v2 = genl_family; v3 = 1; v4 = 1; v5 = 1; ila_parse_opt(v0, a1, &v1, 0x1); if (rtnl_talk(&genl_rth, &v1, 0x0) < 0) v11 = 4294967294; else v12 = 0; return; }
static long_int shr (long_int a, int b) { long_int one = 1; return (-one >> 1 == -1 ? a >> b : (a + (a < 0)) / (one << b) - (a < 0)); }
int shr(unsigned long a0, unsigned long a1) { unsigned long long v0; unsigned int v2; v0 = 1; if (!(v0) >> 1 != -1) { v2 = ((a0 >> 63) + a0 >> 63 CONCAT (a0 >> 63) + a0) /m (v0 << (a1 & 63)) - a0 / 0x8000000000000000; return v2; } v2 = ((a1 & 63) ? (a0 >> (a1 & 63)) : (a0 >> (a1 & 63))); return v2; }
static void buffer_get_bignum_bits(struct sshbuf *b, BIGNUM *value) { u_int bytes, bignum_bits; int r; if ((r = sshbuf_get_u32(b, &bignum_bits)) != 0) sshfatal("ssh-keygen.c", __func__, 463, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); bytes = (bignum_bits + 7) / 8; if (sshbuf_len(b) < bytes) sshfatal("ssh-keygen.c", __func__, 466, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "input buffer too small: need %d have %zu", bytes, sshbuf_len(b)) ; if (BN_bin2bn(sshbuf_ptr(b), bytes, value) == ((void *)0) ) sshfatal("ssh-keygen.c", __func__, 469, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "BN_bin2bn failed"); if ((r = sshbuf_consume(b, bytes)) != 0) sshfatal("ssh-keygen.c", __func__, 471, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "consume"); }
unsigned long buffer_get_bignum_bits(long a1, long a2) { long v2; unsigned long v3; long v4; unsigned int v5; long v6; long v7; int v9; unsigned int u32; unsigned int v11; unsigned long v12; v12 = __readfsqword(0x28u); u32 = sshbuf_get_u32(a1, &v9); if ( u32 ) { v2 = ssh_err(u32); sshfatal("ssh-keygen.c", "buffer_get_bignum_bits", 463LL, 1LL, 1LL, v2, "parse"); } v11 = (unsigned int)(v9 + 7) >> 3; v3 = sshbuf_len(a1); if ( v3 < v11 ) { v4 = sshbuf_len(a1); sshfatal( "ssh-keygen.c", "buffer_get_bignum_bits", 466LL, 1LL, 1LL, 0LL, "input buffer too small: need %d have %zu", v11, v4); } v5 = v11; v6 = sshbuf_ptr(a1); if ( !BN_bin2bn(v6, v5, a2) ) sshfatal("ssh-keygen.c", "buffer_get_bignum_bits", 469LL, 1LL, 1LL, 0LL, "BN_bin2bn failed"); u32 = sshbuf_consume(a1, v11); if ( u32 ) { v7 = ssh_err(u32); sshfatal("ssh-keygen.c", "buffer_get_bignum_bits", 471LL, 1LL, 1LL, v7, "consume"); } return __readfsqword(0x28u) ^ v12; }
acl_t acl_dup(acl_t acl) { acl_entry_obj *entry_obj_p, *dup_entry_obj_p; acl_obj *acl_obj_p = ((acl_obj *)__ext2int_and_check(acl, (0x712C))); acl_obj *dup_obj_p; if (!acl_obj_p) return ((void *)0) ; dup_obj_p = __acl_init_obj(acl_obj_p->i.a_used); if (!dup_obj_p) return ((void *)0) ; for( (entry_obj_p) = (acl_obj_p)->i.a_next; (entry_obj_p) != (acl_entry_obj *)(acl_obj_p); (entry_obj_p) = (entry_obj_p)->i.e_next ) { dup_entry_obj_p = __acl_create_entry_obj(dup_obj_p); if (dup_entry_obj_p == ((void *)0) ) goto fail; dup_entry_obj_p->i.e_entry.e_tag = entry_obj_p->i.e_entry.e_tag; dup_entry_obj_p->i.e_entry.e_id = entry_obj_p->i.e_entry.e_id; dup_entry_obj_p->i.e_entry.e_perm = entry_obj_p->i.e_entry.e_perm; } return ((dup_obj_p) ? &(dup_obj_p)->i : ((void *)0) ); fail: __acl_free_acl_obj(dup_obj_p); return ((void *)0) ; }
long long acl_dup(unsigned long long a0) { struct_0 *v0; int tmp_41; unsigned long long v1[7]; unsigned long long v2; struct_1 *v3; void* v5; unsigned long long v6; v1[0] = __ext2int_and_check(a0, 0x712c); if (!v1) { v5 = 0; return v5; } v2 = __acl_init_obj(v1[6]); if (!v2) { v5 = 0; return v5; } for (v0 = v1[2]; v0 != v1; v0 = v0->field_10) { v3 = __acl_create_entry_obj(v2); if (!v3) { __acl_free_acl_obj(v2); v5 = 0; return v5; } v3->field_20 = v0->field_20; tmp_41 = v0->field_30; v3->field_28 = v0->field_28; v3->field_30 = tmp_41; v6 = v0->field_40; v3->field_38 = v0->field_38; v3->field_40 = v6; } v5 = (!v2 ? v2 + 8 : 0); return v5; }
int sshbuf_get_string_direct(struct sshbuf *buf, const u_char **valp, size_t *lenp) { size_t len; const u_char *p; int r; if (valp != ((void *)0) ) *valp = ((void *)0) ; if (lenp != ((void *)0) ) *lenp = 0; if ((r = sshbuf_peek_string_direct(buf, &p, &len)) < 0) return r; if (valp != ((void *)0) ) *valp = p; if (lenp != ((void *)0) ) *lenp = len; if (sshbuf_consume(buf, len + 4) != 0) { ; ; return -1; } return 0; }
int sshbuf_get_string_direct(unsigned long long a0, unsigned long long *a1, unsigned long long *a2) { unsigned int v0; char v1; char v2; unsigned int v4; if (a1) *(a1) = 0; if (a2) *(a2) = 0; v0 = sshbuf_peek_string_direct(a0, &v2, &v1); if (v0 < 0) { v4 = v0; } else { if (a1) *(a1) = *(&v2); if (a2) *(a2) = *(&v1); if (sshbuf_consume(a0, *(&v1) + 4, *(&v1) + 4)) v4 = -1; else v4 = 0; } return v4; }
void size_columns(unsigned int cols[], unsigned int n, ...) { unsigned int i, len; uint64_t val; va_list args; __builtin_va_start( args , n ) ; for (i = 0; i < n; i++) { val = __builtin_va_arg( args , unsigned long long ) ; if (human_readable) continue; for (len = 1; val > 9; len++, val /= 10) ; if (len > cols[i]) cols[i] = len; } __builtin_va_end( args ) ; }
unsigned long size_columns(long a1, unsigned int a2, ...) { unsigned long *v2; long v3; unsigned int i; unsigned int v6; unsigned long v7; gcc_va_list va; unsigned long v9; va_start(va, a2); v9 = __readfsqword(0x28u); for ( i = 0; i < a2; ++i ) { if ( va[0].gp_offset > 0x2F ) { v3 = va_arg(va, _QWORD); v2 = (unsigned long *)&v3; } else { v2 = (unsigned long *)((char *)va[0].reg_save_area + va[0].gp_offset); va[0].gp_offset += 8; } v7 = *v2; if ( !human_readable ) { v6 = 1; while ( v7 > 9 ) { ++v6; v7 /= 0xAuLL; } if ( v6 > *(_DWORD *)(4LL * i + a1) ) *(_DWORD *)(a1 + 4LL * i) = v6; } } return __readfsqword(0x28u) ^ v9; }
PIDQ_HEAD *init_pid_q(PIDQ_HEAD *q) { q->head = q->next = q->tail = ((void *)0) ; return q; }
int init_pid_q(unsigned long long a0[3]) { unsigned long long v0[3]; v0[0] = a0; a0[1] = 0; a0[2] = a0[1]; a0[0] = a0[2]; return a0; }
static void reserve_block_for_lnf_repair(e2fsck_t ctx) { blk64_t blk = 0; errcode_t err; ext2_filsys fs = ctx->fs; static const char name[] = "lost+found"; ext2_ino_t ino; ctx->lnf_repair_block = 0; if (!ext2fs_lookup(fs, 2, name, sizeof(name)-1, 0, &ino)) return; err = ext2fs_new_block2(fs, 0, ctx->block_found_map, &blk); if (err) return; ext2fs_mark_block_bitmap2(ctx->block_found_map, blk); ctx->lnf_repair_block = blk; }
void reserve_block_for_lnf_repair(unsigned long long a0[113]) { char v0; char v1; void* v2; unsigned long long v3; unsigned long v4; char v5; unsigned long long *v8; unsigned long long v9; v2 = 0; v3 = a0[0]; a0[112] = 0; if (ext2fs_lookup(v3, 0x2, "lost+found", 0xa, 0x0, &v1, *(&v0))) { v4 = ext2fs_new_block2(v3, 0x0, a0[52], &v2); if (!v4) { ext2fs_mark_block_bitmap2(a0[52], v2, v2); a0[112] = v2; } } v9 = *(&v5) ^ v8[5]; return; }
static _Bool parse_depth (const struct parser_table* entry, char **argv, int *arg_ptr) { (void) entry; (void) argv; options.do_dir_first = 0 ; options.explicit_depth = 1 ; return parse_noop (entry, argv, arg_ptr); }
void parse_depth(unsigned long long a0, unsigned long long a1, unsigned long long a2) { unsigned long long v1; options = 0; g_500009 = 1; v1 = parse_noop(a0, a1, a2); return; }
int get_encrypt_status(int server) { const char *msg; if (batch) { return cfg.encryption_key; } else { if (server) msg = "Will the certificate be used for encryption (RSA ciphersuites)? (Y/n): "; else msg = "Will the certificate be used for encryption (not required for TLS)? (Y/n): "; return read_yesno(msg, 1); } }
ulong get_encrypt_status(int param_1) { ulong uVar1; char *local_10; if (*piRam0000000000108f6c == 0) { if (param_1 == 0) { local_10 = "Will the certificate be used for encryption (not required for TLS)? (Y/n): "; } else { local_10 = "Will the certificate be used for encryption (RSA ciphersuites)? (Y/n): "; } uVar1 = read_yesno(local_10,1); } else { uVar1 = (ulong)*(uint *)(lRam0000000000108f79 + 0x230); } return uVar1; }
int main (int argc, char **argv) { int errors = 0; _Bool changed = 0 ; Prog = Basename (argv[0]); log_set_progname(Prog); log_set_logfd( stderr ); (void) setlocale ( 6 , ""); (void) bindtextdomain ("shadow", "/usr/share/locale"); (void) textdomain ("shadow"); process_root_flag ("-R", argc, argv); openlog("pwck", ( 0x01 ), (10<<3) ); process_flags (argc, argv); open_files (); if (sort_mode) { if (pw_sort () != 0) { fprintf ( stderr , gettext ("%s: cannot sort entries in %s\n"), Prog, pw_dbname ()); fail_exit (6); } if (is_shadow) { if (spw_sort () != 0) { fprintf ( stderr , gettext ("%s: cannot sort entries in %s\n"), Prog, spw_dbname ()); fail_exit (6); } } changed = 1 ; } else { check_pw_file (&errors, &changed); if (is_shadow) { check_spw_file (&errors, &changed); } } close_files (changed); if (!read_only) { nscd_flush_cache ("passwd"); sssd_flush_cache (0x001); } if (0 != errors) { printf (changed ? gettext ("%s: the files have been updated\n") : gettext ("%s: no changes\n"), Prog); } closelog (); return ((0 != errors) ? 2 : 0); }
int main(unsigned long a0, unsigned long long *a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { char v0; unsigned int v1; unsigned long long v3; unsigned long long v4; unsigned int v5; v1 = 0; v0 = 0; Prog = Basename(*(a1)); log_set_progname(0x8930ec8348535441); log_set_logfd(stderr); setlocale(0x6, &g_4020fd); bindtextdomain("shadow", "/usr/share/locale"); textdomain("shadow"); process_root_flag("-R", a0, a1); openlog("pwck", 0x1, 0x50); process_flags(a0, a1); open_files(); if (!sort_mode) { check_pw_file(&v1, &v0, &v0, a3, a4, a5); if (is_shadow) check_spw_file(&v1, &v0); } else if (pw_sort()) { v3 = pw_dbname(); fprintf(stderr, gettext("%s: cannot sort entries in %s\n")); fail_exit(0x6); } else { if (is_shadow && spw_sort()) { v4 = spw_dbname(); fprintf(stderr, gettext("%s: cannot sort entries in %s\n")); fail_exit(0x6); } v0 = 1; } close_files(v0); if ((read_only ^ 1)) { nscd_flush_cache("passwd"); sssd_flush_cache(0x1); } if (v1) { if (!v0) v5 = gettext("%s: no changes\n"); else v5 = gettext("%s: the files have been updated\n"); printf(v5); } closelog(); if (v1) v5 = 2; else v5 = 0; return v5; }
static int sh_open_fail(const char *pathname, int flags, int e) { const char *word; int action; word = "open"; action = 01; if (flags & 0100 ) { word = "create"; action = 02; } sh_error("cannot %s %s: %s", word, pathname, errmsg(e, action)); }
void sh_open_fail(unsigned long long a0, unsigned long a1, unsigned long a2) { unsigned int v0; unsigned long long v1; v1 = "open"; v0 = 1; if ((a1 & 64)) { v1 = "create"; v0 = 2; } sh_error("cannot %s %s: %s", v1, a0, errmsg(a2, v0, v0)); }
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]... [FILE]...\n") , program_name); printf (gettext ("Print the last %d lines of each FILE to standard output.\nWith more than one FILE, precede each with a header giving the file name.\n") , 10); emit_stdin_note (); emit_mandatory_arg_note (); fputs_unlocked (gettext (" -c, --bytes=[+]NUM output the last NUM bytes; or use -c +NUM to\n output starting with byte NUM of each file\n"), stdout ) ; fputs_unlocked (gettext (" -f, --follow[={name|descriptor}]\n output appended data as the file grows;\n an absent option argument means 'descriptor'\n -F same as --follow=name --retry\n"), stdout ) ; printf (gettext (" -n, --lines=[+]NUM output the last NUM lines, instead of the last %d;\n or use -n +NUM to output starting with line NUM\n --max-unchanged-stats=N\n with --follow=name, reopen a FILE which has not\n changed size after N (default %d) iterations\n to see if it has been unlinked or renamed\n (this is the usual case of rotated log files);\n with inotify, this option is rarely useful\n") , 10, 5 ); fputs_unlocked (gettext (" --pid=PID with -f, terminate after process ID, PID dies\n -q, --quiet, --silent never output headers giving file names\n --retry keep trying to open a file if it is inaccessible\n"), stdout ) ; fputs_unlocked (gettext (" -s, --sleep-interval=N with -f, sleep for approximately N seconds\n (default 1.0) between iterations;\n with inotify and --pid=P, check process P at\n least once every N seconds\n -v, --verbose always output headers giving file names\n"), stdout ) ; fputs_unlocked (gettext (" -z, --zero-terminated line delimiter is NUL, not newline\n"), stdout ) ; fputs_unlocked (gettext (" --help display this help and exit\n"), stdout ); fputs_unlocked (gettext (" --version output version information and exit\n"), stdout ); fputs_unlocked (gettext ("\nNUM may have a multiplier suffix:\nb 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\nGB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\nBinary prefixes can be used, too: KiB=K, MiB=M, and so on.\n\n"), stdout ) ; fputs_unlocked (gettext ("With --follow (-f), tail defaults to following the file descriptor, which\nmeans that even if a tail'ed file is renamed, tail will continue to track\nits end. This default behavior is not desirable when you really want to\ntrack the actual name of the file, not the file descriptor (e.g., log\nrotation). Use --follow=name in that case. That causes tail to track the\nnamed file in a way that accommodates renaming, removal and creation.\n"), stdout ) ; emit_ancillary_info ("tail"); } exit (status); }
void usage(unsigned long a0) { unsigned long v0; unsigned long v2; v0 = v2; if (a0) { fprintf(stderr, gettext("Try '%s --help' for more information.\n")); } else { printf(gettext("Usage: %s [OPTION]... [FILE]...\n")); printf(gettext("Print the last %d lines of each FILE to standard output.\nWith more than one FILE, precede each with a header giving the file name.\n")); emit_stdin_note(); emit_mandatory_arg_note(); fputs_unlocked(gettext(" -c, --bytes=[+]NUM output the last NUM bytes; or use -c +NUM to\n output starting with byte NUM of each file\n"), stdout); fputs_unlocked(gettext(" -f, --follow[={name|descriptor}]\n output appended data as the file grows;\n an absent option argument means 'descriptor'\n -F same as --follow=name --retry\n"), stdout); printf(gettext(" -n, --lines=[+]NUM output the last NUM lines, instead of the last %d;\n or use -n +NUM to output starting with line NUM\n --max-unchanged-stats=N\n with --follow=name, reopen a FILE which has not\n changed size after N (default %d) iterations\n to see if it has been unlinked or renamed\n (this is the usual case of rotated log files);\n with inotify, this option is rarely useful\n")); fputs_unlocked(gettext(" --pid=PID with -f, terminate after process ID, PID dies\n -q, --quiet, --silent never output headers giving file names\n --retry keep trying to open a file if it is inaccessible\n"), stdout); fputs_unlocked(gettext(" -s, --sleep-interval=N with -f, sleep for approximately N seconds\n (default 1.0) between iterations;\n with inotify and --pid=P, check process P at\n least once every N seconds\n -v, --verbose always output headers giving file names\n"), stdout); fputs_unlocked(gettext(" -z, --zero-terminated line delimiter is NUL, not newline\n"), stdout); fputs_unlocked(gettext(" --help display this help and exit\n"), stdout); fputs_unlocked(gettext(" --version output version information and exit\n"), stdout); fputs_unlocked(gettext("\nNUM may have a multiplier suffix:\nb 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\nGB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\nBinary prefixes can be used, too: KiB=K, MiB=M, and so on.\n\n"), stdout); fputs_unlocked(gettext("With --follow (-f), tail defaults to following the file descriptor, which\nmeans that even if a tail'ed file is renamed, tail will continue to track\nits end. This default behavior is not desirable when you really want to\ntrack the actual name of the file, not the file descriptor (e.g., log\nrotation). Use --follow=name in that case. That causes tail to track the\nnamed file in a way that accommodates renaming, removal and creation.\n"), stdout); emit_ancillary_info("tail"); } exit(a0); }
static char parse_octal_escape(const char *p, size_t *consumed) { register int n, i; size_t pos = 0; for (i = n = 0; i < 3 && is_octal_char(p[pos]); i++, pos++) { n = 8 * n + p[pos] - '0'; } --pos; *consumed = pos; return n; }
int parse_octal_escape(void* a0, unsigned long long *a1) { void* v0; void* v2; unsigned int v3; v0 = 0; v2 = 0; v3 = 0; while (true) { if (v3 > 2) break; if (!is_octal_char(*((v0 + a0)))) break; *(&v2) = *((v0 + a0)) + v2 * 8 - 48; v3 += 1; v0 += 1; } v0 -= 1; *(a1) = v0; return v2; }
static void cleanup_redirects (list) REDIRECT *list; { do_redirections (list, 0x01); dispose_redirects (list); }
void cleanup_redirects(unsigned long long a0) { unsigned long long v1; do_redirections(a0, 0x1); v1 = dispose_redirects(a0); return; }
static int write_devname(FILE *out, char modname[], char devname[], char type, unsigned int maj, unsigned int min) { int ret; ret = fprintf(out, "%s %s %c%u:%u\n", modname, devname, type, maj, min); if (ret >= 0) return 0 ; else return 1 ; }
long long write_devname(void* a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5) { unsigned int v0; v0 = fprintf(a0, "%s %s %c%u:%u\n", a1, a2, a3, a4, a5); return (v0 < 0 ? 0 : 1); }
void _rl_ttymsg (const char *format, ...) { va_list args; __builtin_va_start( args , format ) ; fprintf ( stderr , "readline: "); vfprintf ( stderr , format, args); fprintf ( stderr , "\n"); fflush ( stderr ); __builtin_va_end( args ) ; rl_forced_update_display (); }
long long _rl_ttymsg() { unsigned int v0; unsigned int v1; unsigned long v2; unsigned long v3; unsigned long v4; char v5; unsigned long v6; unsigned long v7; unsigned long v8; unsigned long v9; unsigned long v10; int v11; int v12; int v13; int v14; int v15; int v16; int v17; int v18; unsigned long v19; unsigned long v20; unsigned long v21; unsigned long long v22; unsigned long long v23; unsigned long long v24; char v25; int v26; int v27; int v28; int v29; int v30; int v31; int v32; int v33; unsigned long long *v34; char *v35; v6 = v20; v7 = v21; v8 = v22; v9 = v23; v10 = v24; if (v25) { v11 = v26; v12 = v27; v13 = v28; v14 = v29; v15 = v30; v16 = v31; v17 = v32; v18 = v33; } v4 = v34[5]; v0 = 8; v1 = 48; v2 = &v19; v3 = &v5; fprintf(stderr, "readline: "); vfprintf(stderr, v35, &v0); fprintf(stderr, "\n"); fflush(stderr); rl_forced_update_display(v35, "\n", &v0, v22, v23, v24); if ((v4 ^ v34[5])) __stack_chk_fail(); return 0; }
static void print_rcs_hunk (struct change *hunk) { lin i, f0, l0, f1, l1; printint tf0, tl0, tf1, tl1; enum changes changes = analyze_hunk (hunk, &f0, &l0, &f1, &l1); if (!changes) return; begin_output (); translate_range (&files[0], f0, l0, &tf0, &tl0); if (changes & OLD) { fprintf (outfile, "d%""l""d %""l""d\n", tf0, tf0 <= tl0 ? tl0 - tf0 + 1 : 1); } if (changes & NEW) { translate_range (&files[1], f1, l1, &tf1, &tl1); fprintf (outfile, "a%""l""d %""l""d\n", tl0, tf1 <= tl1 ? tl1 - tf1 + 1 : 1); for (i = f1; i <= l1; i++) print_1_line ("", &files[1].linbuf[i]); } }
void print_rcs_hunk(undefined8 param_1) { uint uVar1; long lVar2; long in_FS_OFFSET; undefined8 local_58; undefined8 local_50; long local_48; long local_40; long local_38; long local_30; long local_28; long local_20; long local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); uVar1 = analyze_hunk(param_1,&local_58,&local_50,&local_48,&local_40); if (uVar1 != 0) { begin_output(); translate_range(&files,local_58,local_50,&local_38,&local_30); if ((uVar1 & 1) != 0) { if (local_30 < local_38) { lVar2 = 1; } else { lVar2 = (local_30 - local_38) + 1; } fprintf(outfile,"d%ld %ld\n",local_38,lVar2); } if ((uVar1 & 2) != 0) { translate_range(0x101158,local_48,local_40,&local_28,&local_20); if (local_20 < local_28) { lVar2 = 1; } else { lVar2 = (local_20 - local_28) + 1; } fprintf(outfile,"a%ld %ld\n",local_30,lVar2); for (local_18 = local_48; local_18 <= local_40; local_18 = local_18 + 1) { print_1_line(&DAT_001004e5,_DAT_00101210 + local_18 * 8); } } } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
static inline __u8 rta_getattr_u8(const struct rtattr *rta) { return *(__u8 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); }
int rta_getattr_u8(struct_0 *a0) { return a0->field_4; }
static void mod_free(struct mod *mod) { log_printf( 7 , "free %p kmod=%p, path=%s\n", mod, mod->kmod, mod->path); array_free_array(&mod->deps); kmod_module_unref(mod->kmod); kmod_module_info_free_list(mod->info_list); kmod_module_dependency_symbols_free_list(mod->dep_sym_list); free(mod->uncrelpath); free(mod->path); free(mod); }
void mod_free(unsigned long long a0[6]) { unsigned long long v1; log_printf(0x7, "free %p kmod=%p, path=%s\n", a0, a0[0], a0[1]); array_free_array(a0 + 1); kmod_module_unref(a0[0]); kmod_module_info_free_list(a0[4]); kmod_module_dependency_symbols_free_list(a0[5]); free(a0[3]); free(a0[1]); v1 = free(a0); return; }
unsigned char crypto_sign_ed25519_ref_fe25519_getparity(const crypto_sign_ed25519_ref_fe25519 *x) { crypto_sign_ed25519_ref_fe25519 t = *x; crypto_sign_ed25519_ref_fe25519_freeze(&t); return t.v[0] & 1; }
long long crypto_sign_ed25519_ref_fe25519_getparity(unsigned long long a0[16]) { unsigned long v0; unsigned long v1; unsigned long v2; unsigned long v3; unsigned long v4; unsigned long v5; unsigned long v6; unsigned long v7; unsigned long v8; unsigned long v9; unsigned long v10; unsigned long v11; unsigned long v12; unsigned long v13; unsigned long v14; unsigned long v15; v0 = a0[0]; v1 = a0[1]; v2 = a0[2]; v3 = a0[3]; v4 = a0[4]; v5 = a0[5]; v6 = a0[6]; v7 = a0[7]; v8 = a0[8]; v9 = a0[9]; v10 = a0[10]; v11 = a0[11]; v12 = a0[12]; v13 = a0[13]; v14 = a0[14]; v15 = a0[15]; crypto_sign_ed25519_ref_fe25519_freeze(&v0); return v0 & 1; }
static void dump_cfg_strarray_oneline(OpCodes code, u_int count, char **vals) { u_int i; printf("%s", lookup_opcode_name(code)); if (count == 0) printf(" none"); for (i = 0; i < count; i++) printf(" %s", vals[i]); printf("\n"); }
void dump_cfg_strarray_oneline(unsigned long a0, unsigned long a1, unsigned long long *a2) { unsigned int v0; unsigned long long v2; printf("%s", lookup_opcode_name(a0)); if (!a1) printf(" none"); for (v0 = 0; v0 < a1; v0 += 1) { printf(" %s", a2[v0]); } v2 = printf("\n"); return; }
int compgen_builtin (list) WORD_LIST *list; { int rval; unsigned long acts, copts; COMPSPEC *cs; STRINGLIST *sl; char *word, **matches; char *old_line; int old_ind; if (list == 0) return (0); acts = copts = (unsigned long)0L; Garg = Warg = Parg = Sarg = Xarg = Farg = Carg = (char *) ((void *)0) ; cs = (COMPSPEC *) ((void *)0) ; rval = build_actions (list, (struct _optflags *) ((void *)0) , &acts, &copts); if (rval == 258) return (rval); if (rval == 1) return (0); list = loptend; word = (list && list->word) ? list->word->word : ""; if (Farg) builtin_error (gettext("warning: -F option may not work as you expect")); if (Carg) builtin_error (gettext("warning: -C option may not work as you expect")); cs = compspec_create (); cs->actions = acts; cs->options = copts; cs->refcount = 1; cs->globpat = ((Garg) ? (char *)strcpy (sh_xmalloc((1 + strlen (Garg)), "./complete.def", 706), (Garg)) : (char *) ((void *)0) ); cs->words = ((Warg) ? (char *)strcpy (sh_xmalloc((1 + strlen (Warg)), "./complete.def", 707), (Warg)) : (char *) ((void *)0) ); cs->prefix = ((Parg) ? (char *)strcpy (sh_xmalloc((1 + strlen (Parg)), "./complete.def", 708), (Parg)) : (char *) ((void *)0) ); cs->suffix = ((Sarg) ? (char *)strcpy (sh_xmalloc((1 + strlen (Sarg)), "./complete.def", 709), (Sarg)) : (char *) ((void *)0) ); cs->funcname = ((Farg) ? (char *)strcpy (sh_xmalloc((1 + strlen (Farg)), "./complete.def", 710), (Farg)) : (char *) ((void *)0) ); cs->command = ((Carg) ? (char *)strcpy (sh_xmalloc((1 + strlen (Carg)), "./complete.def", 711), (Carg)) : (char *) ((void *)0) ); cs->filterpat = ((Xarg) ? (char *)strcpy (sh_xmalloc((1 + strlen (Xarg)), "./complete.def", 712), (Xarg)) : (char *) ((void *)0) ); rval = 1; old_line = pcomp_line; old_ind = pcomp_ind; pcomp_line = (char *) ((void *)0) ; pcomp_ind = 0; sl = gen_compspec_completions (cs, "compgen", word, 0, 0, 0); pcomp_line = old_line; pcomp_ind = old_ind; if ((sl == 0 || sl->list_len == 0) && (copts & (1<<6))) { matches = bash_default_completion (word, 0, 0, 0, 0); sl = completions_to_stringlist (matches); strvec_dispose (matches); } if ((sl == 0 || sl->list_len == 0) && (copts & (1<<1))) { matches = rl_completion_matches (word, rl_filename_completion_function); strlist_dispose (sl); sl = completions_to_stringlist (matches); strvec_dispose (matches); } if (sl) { if (sl->list && sl->list_len) { rval = 0; strlist_print (sl, (char *) ((void *)0) ); } strlist_dispose (sl); } compspec_dispose (cs); return (rval); }
long long compgen_builtin(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) { struct_2 *v0; unsigned int v1; unsigned int v2; void* v3; void* v4; struct_1 *v5; struct_0 *v6; unsigned long long v7; char *v8; unsigned long long v9; void* v11; unsigned long long v12; void* v13; void* v14; void* v15; void* v16; void* v17; void* v18; void* v19; v0 = a0; if (!v0) { v11 = 0; } else { v4 = 0; v3 = v4; Carg = 0; Farg = Carg; Xarg = Farg; Sarg = Xarg; Parg = Sarg; Warg = Parg; Garg = Warg; v6 = 0; v1 = build_actions(v0, NULL, &v3, &v4, a4, a5); if (v1 == 258) { v11 = v1; } else if (v1 == 1) { v11 = 0; } else { v0 = loptend; if (v0 && v0->field_8) { v12 = v0->field_8->field_0; goto LABEL_401227; } v12 = &g_401d81; LABEL_401227: v7 = v12; if (Farg) builtin_error(gettext("warning: -F option may not work as you expect"), 0x0); if (Carg) builtin_error(gettext("warning: -C option may not work as you expect"), 0x0); v6 = compspec_create(); v6->field_8 = v3; v6->field_10 = v4; v6->field_0 = 1; if (!Garg) v13 = 0; else v13 = strcpy(sh_xmalloc(strlen(Garg) + 1, "./complete.def", 0x2c2), Garg); v6->field_18 = v13; if (!Warg) v14 = 0; else v14 = strcpy(sh_xmalloc(strlen(Warg) + 1, "./complete.def", 0x2c3), Warg); v6->field_20 = v14; if (!Parg) v15 = 0; else v15 = strcpy(sh_xmalloc(strlen(Parg) + 1, "./complete.def", 0x2c4), Parg); v6->field_28 = v15; if (!Sarg) v16 = 0; else v16 = strcpy(sh_xmalloc(strlen(Sarg) + 1, "./complete.def", 0x2c5), Sarg); v6->field_30 = v16; if (!Farg) v17 = 0; else v17 = strcpy(sh_xmalloc(strlen(Farg) + 1, "./complete.def", 0x2c6), Farg); v6->field_38 = v17; if (!Carg) v18 = 0; else v18 = strcpy(sh_xmalloc(strlen(Carg) + 1, "./complete.def", 0x2c7), Carg); v6->field_40 = v18; if (!Xarg) v19 = 0; else v19 = strcpy(sh_xmalloc(strlen(Xarg) + 1, "./complete.def", 0x2c8), Xarg); v6->field_50 = v19; v1 = 1; v8 = pcomp_line; v2 = pcomp_ind; pcomp_line = 0; pcomp_ind = 0; v5 = gen_compspec_completions(v6, "compgen", v7, 0x0, 0x0, 0x0); pcomp_line = v8; pcomp_ind = v2; if (v5 && !(!v5->field_c)) goto LABEL_4015bb; if ((v4 & 64)) { v9 = bash_default_completion(v7, 0x0, 0x0, 0x0, 0x0); v5 = completions_to_stringlist(v9); strvec_dispose(v9); } LABEL_4015bb: if (v5 && !(!v5->field_c)) goto LABEL_40161b; if ((v4 & 2)) { v9 = rl_completion_matches(v7, got.rl_filename_completion_function, got.rl_filename_completion_function); strlist_dispose(v5); v5 = completions_to_stringlist(v9); strvec_dispose(v9); } LABEL_40161b: if (v5) { if (v5->field_0 && v5->field_c) { v1 = 0; strlist_print(v5, 0x0); } strlist_dispose(v5); } compspec_dispose(v6); v11 = v1; } } return v11; }
void addargs(arglist *args, char *fmt, ...) { va_list ap; char *cp; u_int nalloc; int r; __builtin_va_start( ap , fmt ) ; r = vasprintf(&cp, fmt, ap); __builtin_va_end( ap ) ; if (r == -1) sshfatal("misc.c", __func__, 1072, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "argument too long"); nalloc = args->nalloc; if (args->list == ((void *)0) ) { nalloc = 32; args->num = 0; } else if (args->num > (256 * 1024)) sshfatal("misc.c", __func__, 1079, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "too many arguments"); else if (args->num >= args->nalloc) sshfatal("misc.c", __func__, 1081, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "arglist corrupt"); else if (args->num+2 >= nalloc) nalloc *= 2; args->list = xrecallocarray(args->list, args->nalloc, nalloc, sizeof(char *)); args->nalloc = nalloc; args->list[args->num++] = cp; args->list[args->num] = ((void *)0) ; }
long long addargs() { char *v0; int tmp_66; struct_0 *v1; unsigned int v2; unsigned int v3; char v4; unsigned int v5; unsigned int v6; unsigned long v7; unsigned long v8; unsigned long v9; char v10; unsigned long v11; unsigned long v12; unsigned long v13; unsigned long v14; int v15; int v16; int v17; int v18; int v19; int v20; int v21; int v22; unsigned long long v23; char v24; unsigned long v25; struct_0 *v26; char *v27; unsigned long v28; unsigned long v29; unsigned long v30; unsigned long v31; char v32; int v33; int v34; int v35; int v36; int v37; int v38; int v39; int v40; unsigned long long *v41; unsigned long long *v42; v1 = v26; v0 = v27; v11 = v28; v12 = v29; v13 = v30; v14 = v31; if (v32) { v15 = v33; v16 = v34; v17 = v35; v18 = v36; v19 = v37; v20 = v38; v21 = v39; v22 = v40; } v9 = v41[5]; v5 = 16; v6 = 48; v7 = &v25; v8 = &v10; v3 = vasprintf(&v4, v0, &v5); if (v3 == -1) sshfatal("misc.c", "addargs", 0x430, 0x1, 0x1, 0x0, "argument too long"); v2 = v26->field_c; if (!v26->field_0) { v2 = 32; v26->field_8 = 0; } else { if (v26->field_8 > 0x40000) { v23 = "too many arguments"; sshfatal("misc.c", "addargs", 0x437, 0x1, 0x1, 0x0, *(&v24)); } if (v26->field_8 >= v26->field_c) { v23 = "arglist corrupt"; sshfatal("misc.c", "addargs", 0x439, 0x1, 0x1, 0x0, *(&v24)); } if (v2 <= v26->field_8 + 2) v2 *= 2; } v26->field_0 = xrecallocarray(v26->field_0, v26->field_c, v2, 0x8); v26->field_c = v2; v42 = v26->field_0; tmp_66 = v26->field_8; v26->field_8 = v26->field_8 + 1; v42[tmp_66] = *(&v4); *((v26->field_8 * 8 + v26->field_0)) = 0; if ((v9 ^ v41[5])) __stack_chk_fail(); return 0; }
static int print_sadinfo(struct nlmsghdr *n, void *arg) { FILE *fp = (FILE *)arg; __u32 *f = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); struct rtattr *tb[(__XFRMA_SAD_MAX - 1)+1]; struct rtattr *rta; int len = n->nlmsg_len; len -= ((sizeof(__u32)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))); if (len < 0) { fprintf( stderr , "SADinfo: Wrong len %d\n", len); return -1; } rta = ((struct rtattr*)(((char*)(f)) + ( ((sizeof(__u32))+4U -1) & ~(4U -1) ))); parse_rtattr(tb, (__XFRMA_SAD_MAX - 1), rta, len); if (tb[XFRMA_SAD_CNT]) { __u32 cnt; fprintf(fp, "\t SAD"); cnt = rta_getattr_u32(tb[XFRMA_SAD_CNT]); fprintf(fp, " count %u", cnt); } else { fprintf(fp, "BAD SAD info returned\n"); return -1; } if (show_stats) { if (tb[XFRMA_SAD_HINFO]) { struct xfrmu_sadhinfo *si; if (((int)((tb[XFRMA_SAD_HINFO])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) < sizeof(*si)) { fprintf(fp, "BAD SAD length returned\n"); return -1; } si = ((void*)(((char*)(tb[XFRMA_SAD_HINFO])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); fprintf(fp, " (buckets "); fprintf(fp, "count %d", si->sadhcnt); fprintf(fp, " Max %d", si->sadhmcnt); fprintf(fp, ")"); } } fprintf(fp, "\n"); return 0; }
undefined8 print_sadinfo(int *param_1,FILE *param_2) { uint uVar1; undefined8 uVar2; long in_FS_OFFSET; undefined local_28 [8]; long local_20; ushort *local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); uVar1 = *param_1 - 0x14; if ((int)uVar1 < 0) { fprintf(stderr,"SADinfo: Wrong len %d\n",(ulong)uVar1); uVar2 = 0xffffffff; } else { parse_rtattr(local_28,2,param_1 + 5,uVar1); if (local_20 == 0) { fprintf(param_2,"BAD SAD info returned\n"); uVar2 = 0xffffffff; } else { fprintf(param_2,"\t SAD"); uVar1 = rta_getattr_u32(local_20); fprintf(param_2," count %u",(ulong)uVar1); if ((show_stats != 0) && (local_18 != (ushort *)0x0)) { if ((ulong)*local_18 - 4 < 8) { fprintf(param_2,"BAD SAD length returned\n"); uVar2 = 0xffffffff; goto LAB_00104587; } fprintf(param_2," (buckets "); fprintf(param_2,"count %d",(ulong)*(uint *)(local_18 + 2)); fprintf(param_2," Max %d",(ulong)*(uint *)(local_18 + 4)); fprintf(param_2,")"); } fprintf(param_2,"\n"); uVar2 = 0; } } LAB_00104587: if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar2; }
int do_ipneigh(int argc, char **argv) { if (argc > 0) { if (matches(*argv, "add") == 0) return ipneigh_modify(RTM_NEWNEIGH, 0x400|0x200, argc-1, argv+1); if (matches(*argv, "change") == 0 || strcmp(*argv, "chg") == 0) return ipneigh_modify(RTM_NEWNEIGH, 0x100, argc-1, argv+1); if (matches(*argv, "replace") == 0) return ipneigh_modify(RTM_NEWNEIGH, 0x400|0x100, argc-1, argv+1); if (matches(*argv, "delete") == 0) return ipneigh_modify(RTM_DELNEIGH, 0, argc-1, argv+1); if (matches(*argv, "get") == 0) return ipneigh_get(argc-1, argv+1); if (matches(*argv, "show") == 0 || matches(*argv, "lst") == 0 || matches(*argv, "list") == 0) return do_show_or_flush(argc-1, argv+1, 0); if (matches(*argv, "flush") == 0) return do_show_or_flush(argc-1, argv+1, 1); if (matches(*argv, "help") == 0) usage(); } else return do_show_or_flush(0, ((void *)0) , 0); fprintf( stderr , "Command \"%s\" is unknown, try \"ip neigh help\".\n", *argv); exit(-1); }
long long do_ipneigh(unsigned long a0, unsigned long long *a1, unsigned long a2, unsigned int a3, unsigned long long a4, unsigned long long a5) { unsigned long long v1; if (a0 <= 0) { v1 = do_show_or_flush(0x0, 0x0, 0x0); return v1; } else if (!(matches(*(a1), "add") ^ 1)) { if (!(matches(*(a1), "change") ^ 1) && strcmp(*(a1), "chg")) { if ((matches(*(a1), "replace") ^ 1)) { v1 = ipneigh_modify(0x1c, 0x500, a0 - 1, a1 + 1); return v1; } else if ((matches(*(a1), "delete") ^ 1)) { v1 = ipneigh_modify(0x1d, 0x0, a0 - 1, a1 + 1); return v1; } else if (!(matches(*(a1), "get") ^ 1)) { if (!(matches(*(a1), "show") ^ 1) && !(matches(*(a1), "lst") ^ 1) && !(matches(*(a1), "list") ^ 1)) { if ((matches(*(a1), "flush") ^ 1)) { v1 = do_show_or_flush(a0 - 1, a1 + 1, 0x1); return v1; } else if ((matches(*(a1), "help") ^ 1)) { usage(); } else { fprintf(stderr, "Command \"%s\" is unknown, try \"ip neigh help\".\n", *(a1)); exit(0xffffffff); } } v1 = do_show_or_flush(a0 - 1, a1 + 1, 0x0); return v1; } else { v1 = ipneigh_get(a0 - 1, a1 + 1, a1 + 1, a3, a4, a5); return v1; } } v1 = ipneigh_modify(0x1c, 0x100, a0 - 1, a1 + 1); return v1; } else { v1 = ipneigh_modify(0x1c, 0x600, a0 - 1, a1 + 1); return v1; } }
void merge_function_temporary_env () { if (temporary_env) dispose_temporary_env (push_temp_var); }
long long merge_function_temporary_env() { unsigned long long v1; v1 = temporary_env; if (temporary_env) v1 = dispose_temporary_env(push_temp_var); return v1; }
static _Bool tail (char const *filename, int fd, uintmax_t n_units, uintmax_t *read_pos) { *read_pos = 0; if (count_lines) return tail_lines (filename, fd, n_units, read_pos); else return tail_bytes (filename, fd, n_units, read_pos); }
int tail(unsigned long long a0, unsigned long a1, unsigned int a2, unsigned long long *a3) { unsigned long long v1; *(a3) = 0; if (!count_lines) v1 = tail_bytes(a0, a1, a2, a3); else v1 = tail_lines(a0, a1, a2, a3); return v1; }
static inline ext2_ino_t *quota_sb_inump(struct ext2_super_block *sb, enum quota_type qtype) { switch (qtype) { case USRQUOTA: return &sb->s_usr_quota_inum; case GRPQUOTA: return &sb->s_grp_quota_inum; case PRJQUOTA: return &sb->s_prj_quota_inum; default: return ((void *)0) ; } return ((void *)0) ; }
int quota_sb_inump(unsigned long a0, unsigned long a1) { unsigned int v1; switch (a1) { case 2: v1 = a0 + 620; return v1; case 0: v1 = a0 + 576; return v1; case 1: v1 = a0 + 580; return v1; default: v1 = 0; return v1; } }
static errcode_t clone_file(e2fsck_t ctx, ext2_ino_t ino, struct dup_inode *dp, char* block_buf) { ext2_filsys fs = ctx->fs; errcode_t retval; struct clone_struct cs; struct problem_context pctx; blk64_t blk, new_blk; dnode_t *n; struct inode_el *ino_el; struct dup_cluster *dc; struct dup_inode *di; clear_problem_context(&pctx); cs.errcode = 0; cs.dir = 0; cs.dup_cluster = ~0; cs.alloc_block = 0; cs.ctx = ctx; cs.ino = ino; cs.inode = &dp->inode; cs.save_dup_cluster = ((void *)0) ; cs.save_blocknr = 0; retval = ext2fs_get_mem(fs->blocksize, &cs.buf); if (retval) return retval; if (ext2fs_test_inode_bitmap2(ctx->inode_dir_map, ino)) cs.dir = ino; pctx.ino = ino; pctx.str = "clone_file"; if (ext2fs_inode_has_valid_blocks2(fs, EXT2_INODE(&dp->inode))) pctx.errcode = ext2fs_block_iterate3(fs, ino, 0, block_buf, clone_file_block, &cs); deferred_dec_badcount(&cs); ext2fs_mark_bb_dirty(fs); if (pctx.errcode) { fix_problem(ctx, 0x011006, &pctx); retval = pctx.errcode; goto errout; } if (cs.errcode) { com_err("clone_file", cs.errcode, "%s", (gettext ("returned from clone_file_block"))); retval = cs.errcode; goto errout; } e2fsck_read_inode_full(ctx, ino, EXT2_INODE(&dp->inode), sizeof(dp->inode), "clone file EA"); blk = ext2fs_file_acl_block(fs, EXT2_INODE(&dp->inode)); new_blk = blk; if (blk && (clone_file_block(fs, &new_blk, (-5), 0, 0, &cs) == 1)) { ext2fs_file_acl_block_set(fs, EXT2_INODE(&dp->inode), new_blk); e2fsck_write_inode_full(ctx, ino, EXT2_INODE(&dp->inode), sizeof(dp->inode), "clone file EA"); n = dict_lookup(&clstr_dict, ((void *)(intptr_t)(((blk) >> (fs)->cluster_ratio_bits)))); if (!n) { com_err("clone_file", 0, (gettext ("internal error: couldn't lookup EA " "block record for %llu")) , (unsigned long long) blk); retval = 0; goto errout; } dc = (struct dup_cluster *) ((n)->dict_data); for (ino_el = dc->inode_list; ino_el; ino_el = ino_el->next) { if (ino_el->inode == ino) continue; n = dict_lookup(&ino_dict, ((void *)(intptr_t)(ino_el->inode))); if (!n) { com_err("clone_file", 0, (gettext ("internal error: couldn't lookup EA " "inode record for %u")) , ino_el->inode); retval = 0; goto errout; } di = (struct dup_inode *) ((n)->dict_data); if (ext2fs_file_acl_block(fs, EXT2_INODE(&di->inode)) == blk) { ext2fs_file_acl_block_set(fs, EXT2_INODE(&di->inode), ext2fs_file_acl_block(fs, EXT2_INODE(&dp->inode))); e2fsck_write_inode_full(ctx, ino_el->inode, EXT2_INODE(&di->inode), sizeof(di->inode), "clone file EA"); decrement_badcount(ctx, blk, dc); } } } retval = 0; errout: ext2fs_free_mem(&cs.buf); return retval; }
int clone_file(unsigned long long a0[48], unsigned long a1, unsigned long a2, unsigned long long a3) { unsigned long v0; unsigned long long v1; void* v2; struct_1 *v3; unsigned int v4[49]; unsigned long long v5; struct_0 *v6; struct_2 *v7; unsigned long v8; void* v9; unsigned long long v10; void* v11; unsigned int v12; unsigned int v13; char v14; unsigned long long v15[48]; unsigned long v16; void* v17; void* v18; unsigned long v19; unsigned int v20; unsigned long long v21; unsigned long long v23; unsigned long long v25; v0 = a2; *(&v4[0]) = a0[0]; clear_problem_context(&v19); v9 = 0; v12 = 0; v10 = -1; v11 = 0; v15[0] = a0; v13 = a1; v16 = v0 + 8; v17 = 0; v18 = 0; v2 = ext2fs_get_mem(v4[10], &v14, v4[10]); if (v2) { v23 = v2; return v23; } if (ext2fs_test_inode_bitmap2(a0[47], a1, a1)) v12 = a1; v20 = a1; v21 = "clone_fi"; v23 = EXT2_INODE(v0 + 8); if (ext2fs_inode_has_valid_blocks2(v4, v23, v23)) v19 = ext2fs_block_iterate3(v4, a1, 0x0, a3, clone_file_block, &v9); deferred_dec_badcount(&v9); ext2fs_mark_bb_dirty(v4); if (v19) { fix_problem(a0, 0x11006, &v19); v2 = v19; } else if (v9) { com_err("clone_fi", v9, "%s", gettext("returned from clone_file_block")); v2 = v9; } else { e2fsck_read_inode_full(a0, a1, EXT2_INODE(v0 + 8), 0xa0, "clone file EA"); v23 = EXT2_INODE(v0 + 8); v5 = ext2fs_file_acl_block(v4, v23, v23); v1 = v5; if (!(v5) || !(clone_file_block(v4, &v1, 0xfffffffffffffffb, 0x0, 0x0, &v9) == 1)) { LABEL_4028d3: v2 = 0; } else { v23 = EXT2_INODE(v0 + 8); ext2fs_file_acl_block_set(v4, v23, v1, v23); e2fsck_write_inode_full(a0, a1, EXT2_INODE(v0 + 8), 0xa0, "clone file EA"); v6 = dict_lookup(&clstr_dict, ((v4[48] & 63) ? v5 >> (v4[48] & 63) : v5 >> (v4[48] & 63))); if (!v6) { com_err("clone_fi", 0x0, gettext("internal error: couldn't lookup EA block record for %llu"), v5); v2 = 0; } else { v7 = v6->field_28; for (v3 = v7->field_8; v3; v3 = v3->field_8) { if (a1 != v3->field_0) { v6 = dict_lookup(&ino_dict, v3->field_0); if (!v6) { com_err("clone_fi", 0x0, gettext("internal error: couldn't lookup EA inode record for %u"), v3->field_0); v2 = 0; ext2fs_free_mem(&v14); *(&v23) = v2; return v23; } v8 = v6->field_28; v23 = EXT2_INODE(v8 + 8); if (v5 == ext2fs_file_acl_block(v4, v23, v23)) { v25 = EXT2_INODE(v0 + 8); v23 = EXT2_INODE(v8 + 8); ext2fs_file_acl_block_set(v4, v23, ext2fs_file_acl_block(v4, v25, v25), v23); e2fsck_write_inode_full(a0, v3->field_0, EXT2_INODE(v8 + 8), 0xa0, "clone file EA"); decrement_badcount(a0, v5, v7); } } } goto LABEL_4028d3; } } } ext2fs_free_mem(&v14); *(&v23) = v2; return v23; }
int ssh_krl_revoke_key_sha1(struct ssh_krl *krl, const u_char *p, size_t len) { sshlog("krl.c", __func__, 436, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "revoke by sha1"); if (len != 20) return -4; return revoke_by_hash(&krl->revoked_sha1s, p, len); }
undefined8 ssh_krl_revoke_key_sha1(long param_1,undefined8 param_2,long param_3) { undefined8 uVar1; sshlog("krl.c","ssh_krl_revoke_key_sha1",0x1b4,1,7,0,"revoke by sha1"); if (param_3 == 0x14) { uVar1 = revoke_by_hash(param_1 + 0x28,param_2,0x14); } else { uVar1 = 0xfffffffc; } return uVar1; }
static _Bool parse_nowarn (const struct parser_table* entry, char **argv, int *arg_ptr) { options.warnings = 0 ; return parse_noop (entry, argv, arg_ptr); }
long long parse_nowarn(unsigned long long a0, unsigned long long a1, unsigned long long a2) { fprintf = 0; return parse_noop(a0, a1, a2); }
static void cluster_dnode_free(dnode_t *node, void *context __attribute__((unused))) { struct dup_cluster *dc; struct inode_el *p, *next; dc = (struct dup_cluster *) ((node)->dict_data); for (p = dc->inode_list; p; p = next) { next = p->next; ext2fs_free_mem(&p); } ext2fs_free_mem(&dc); ext2fs_free_mem(&node); }
unsigned long cluster_dnode_free(long a1) { long v2; long v3; long i; long v5; unsigned long v6; v2 = a1; v6 = __readfsqword(0x28u); v3 = *(_QWORD *)(a1 + 40); for ( i = *(_QWORD *)(v3 + 8); i; i = v5 ) { v5 = *(_QWORD *)(i + 8); ext2fs_free_mem(&i); } ext2fs_free_mem(&v3); ext2fs_free_mem(&v2); return __readfsqword(0x28u) ^ v6; }
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; }
int execute_cond_node(struct_0 *a0) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int 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 long long v13; char v14[3]; unsigned int v16; unsigned int v17; unsigned int v18; unsigned int v20; unsigned int v22; v3 = a0->field_0 & 4; v4 = a0->field_0 & 8; if (v4) { if (a0->field_18) a0->field_18->field_0 = a0->field_18->field_0 | 8; if (a0->field_20) a0->field_20->field_0 = a0->field_20->field_0 | 8; } switch (a0->field_8) { case 6: v0 = execute_cond_node(a0->field_18); break; case 2: v0 = execute_cond_node(a0->field_18); if (v0) { v0 = execute_cond_node(a0->field_20); break; } case 1: v0 = execute_cond_node(a0->field_18); if (!v0) { v0 = execute_cond_node(a0->field_20); break; } case 3: if (v4) comsub_ignore_return = comsub_ignore_return + 1; if (*(a0->field_10->field_0) != 45 || strcmp(a0->field_10->field_0, "-v")) v16 = 0; else v16 = 1; v10 = v16; if (!v10 || !valid_array_reference(*(a0->field_18->field_10), 0x1)) v18 = 0; else v18 = 8; v11 = v18; v12 = cond_expand_word(a0->field_18->field_10, (!v10 ? 3 : 0)); if (v4) comsub_ignore_return = comsub_ignore_return - 1; if (!v12) v12 = &g_40b366; if (*(&echo_command_at_execute)) xtrace_print_cond_term(a0->field_8, v3, a0->field_10, v12, 0x0); if (v10) v2 = set_expand_once(0x0, 0x0); v0 = !unary_test(a0->field_10->field_0, v12, v11, v12); if (v10) assoc_expand_once = v2; if (v12 != 4240230) { sh_xfree(v12, "execute_cmd.c", 0xf5b); break; } case 4: v5 = 0; *(&v14) = a0->field_10->field_0; v1 = 0; if (v14[1] == 61 && !v14[2] && (v14[0] == 33 || v14[0] == 61) || v14[0] == 61 && !v14[1]) v17 = 1; else v17 = 0; v6 = v17; if (v14[0] != 61 || v14[1] != 126 || v14[2]) v20 = 0; else v20 = 1; v5 = v20; if (v14[0] == 45 && !strcmp(v14, "-eq") || v14[0] == 45 && !strcmp(v14, "-ne") || v14[0] == 45 && !strcmp(v14, "-lt") || v14[0] == 45 && !strcmp(v14, "-le") || v14[0] == 45 && !strcmp(v14, "-gt") || v14[0] == 45 && !strcmp(v14, "-ge")) v22 = 1; else v22 = 0; v7 = v22; if (v7) { v1 = 3; } else if (!(!v5 || shell_compatibility_level <= 31)) { v1 = 2; } else if (v6) { v1 = 1; } if (v4) comsub_ignore_return = comsub_ignore_return + 1; v12 = cond_expand_word(a0->field_18->field_10, (!v7 ? v1 : 0)); if (v4) comsub_ignore_return = comsub_ignore_return - 1; if (!v12) v12 = &g_40b366; if (v4) comsub_ignore_return = comsub_ignore_return + 1; v13 = cond_expand_word(a0->field_20->field_10, v1); if (v4) comsub_ignore_return = comsub_ignore_return - 1; if (!v13) v13 = &g_40b366; if (*(&echo_command_at_execute)) xtrace_print_cond_term(a0->field_8, v3, a0->field_10, v12, v13); if (v5) { v9 = 2; v9 |= 1; v0 = sh_regmatch(v12, v13, v9, v13); } else { v8 = extended_glob; extended_glob = 1; v0 = !binary_test(a0->field_10->field_0, v12, v13, 0x7); extended_glob = v8; } if (v12 != 4240230) sh_xfree(v12, "execute_cmd.c", 0xfa2); if (v13 != 4240230) { sh_xfree(v13, "execute_cmd.c", 0xfa4); break; } default: command_error("execute_cond_node", 0x1, a0->field_8, 0x0); jump_to_top_level(0x2); } if (v3) v0 = !v0; return v0; }
static void print_select_list (list, list_len, max_elem_len, indices_len) WORD_LIST *list; int list_len, max_elem_len, indices_len; { int ind, row, elem_len, pos, cols, rows; int first_column_indices_len, other_indices_len; if (list == 0) { putc ('\n', stderr ); return; } cols = max_elem_len ? COLS / max_elem_len : 1; if (cols == 0) cols = 1; rows = list_len ? list_len / cols + (list_len % cols != 0) : 1; cols = list_len ? list_len / rows + (list_len % rows != 0) : 1; if (rows == 1) { rows = cols; cols = 1; } first_column_indices_len = ((rows < 10) ? 1 : ((rows < 100) ? 2 : ((rows < 1000) ? 3 : ((rows < 10000) ? 4 : ((rows < 100000) ? 5 : 6))))); other_indices_len = indices_len; for (row = 0; row < rows; row++) { ind = row; pos = 0; while (1) { indices_len = (pos == 0) ? first_column_indices_len : other_indices_len; elem_len = print_index_and_element (indices_len, ind + 1, list); elem_len += indices_len + 2; ind += rows; if (ind >= list_len) break; indent (pos + elem_len, pos + max_elem_len); pos += max_elem_len; } putc ('\n', stderr ); } }
void print_select_list(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long a3) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned int v8; unsigned long long v10; unsigned long long v15; v0 = a3; if (!a0) { v10 = putc(0xa, *(&stderr)); return; } v4 = (!a2 ? (COLS >> 31 CONCAT COLS) /m a2 : 1); if (!v4) v4 = 1; v5 = (!a1 ? ((a1 >> 31 CONCAT a1) /m v4 >> 32) + (a1 >> 31 CONCAT a1) /m v4 : 1); v4 = (!a1 ? ((a1 >> 31 CONCAT a1) /m v5 >> 32) + (a1 >> 31 CONCAT a1) /m v5 : 1); if (v5 == 1) { v5 = v4; v4 = 1; } v6 = (v5 <= 9 ? (v5 <= 99 ? (v5 <= 999 ? (v5 <= 9999 ? (v5 <= 99999 ? 6 : 5) : 4) : 3) : 2) : 1); v7 = v0; v2 = 0; while (true) { v15 = v2; if (v2 >= v5) break; v1 = v2; v3 = 0; while (true) { *(&v15) = (!v3 ? v7 : v6); v0 = v15; v8 = print_index_and_element(v0, v1 + 1, a0); v8 += v0 + 2; v1 += v5; if (v1 >= a1) break; indent(v8 + v3, v3 + a2); v3 += a2; } putc(0xa, *(&stderr)); v2 += 1; } return; }
char * dequote_string (string) char *string; { register char *s, *t; size_t slen; char *result, *send; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); if (string[0] == '\001' && string[1] == 0) internal_debug ("dequote_string: string with bare CTLESC"); slen = (((string) && (string)[0]) ? ((string)[1] ? ((string)[2] ? strlen(string) : 2) : 1) : 0); t = result = (char *)sh_xmalloc((slen + 1), "subst.c", 4879); if (((string)[0] == '\177' && (string)[1] == '\0')) { result[0] = '\0'; return (result); } if (string[0] == '\001' && string[1] == 0) { result[0] = '\001'; result[1] = '\0'; return (result); } if (strchr (string, '\001') == ((void *)0) ) return (strcpy (result, string)); send = string + slen; s = string; while (*s) { if (*s == '\001') { s++; if (*s == '\0') break; } do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _k; _k = is_basic (*(s)); if (_k) mblength = 1; else if (locale_utf8locale && ((*(s) & 0x80) == 0)) mblength = *(s) != 0; else { state_bak = state; mblength = mbrlen ((s), (send) - (s), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; mblength = 1; } else mblength = (mblength < 1) ? 1 : mblength; for (_k = 0; _k < mblength; _k++) *(t)++ = *(s)++; } else *(t)++ = *(s)++; } while (0); } *t = '\0'; return (result); }
char * dequote_string(long a1) { size_t v1; char *v2; const char *v4; long v5; const char *v6; char *v7; const char *v8; char *v9; int i; size_t v11; unsigned long v12; size_t v13; char *dest; long s; long v16; unsigned long v17; v17 = __readfsqword(0x28u); memset(&s, 0, sizeof(s)); if ( *(_BYTE *)a1 == 1 && !*(_BYTE *)(a1 + 1) ) internal_debug("dequote_string: string with bare CTLESC"); if ( a1 && *(_BYTE *)a1 ) { if ( *(_BYTE *)(a1 + 1) ) { if ( *(_BYTE *)(a1 + 2) ) v1 = strlen((const char *)a1); else v1 = 2LL; } else { v1 = 1LL; } } else { v1 = 0LL; } v13 = v1; dest = (char *)sh_xmalloc(v1 + 1, "subst.c", 4879LL); v2 = dest; if ( *(_BYTE *)a1 != 127 || *(_BYTE *)(a1 + 1) ) { if ( *(_BYTE *)a1 != 1 || *(_BYTE *)(a1 + 1) ) { if ( strchr((const char *)a1, 1) ) { v4 = (const char *)a1; while ( *v4 ) { if ( *v4 == 1 && !*++v4 ) break; if ( locale_mb_cur_max <= 1 ) { v8 = v4++; v9 = v2++; *v9 = *v8; } else { if ( (unsigned int)is_basic(*v4) ) { v11 = 1LL; } else if ( locale_utf8locale && *v4 >= 0 ) { v11 = *v4 != 0; } else { v16 = s; v11 = mbrlen(v4, a1 + v13 - (_QWORD)v4, (mbstate_t *)&s); } if ( v11 < 0xFFFFFFFFFFFFFFFELL ) { if ( v11 ) v5 = v11; else v5 = 1LL; v12 = v5; } else { s = v16; v12 = 1LL; } for ( i = 0; v12 > i; ++i ) { v6 = v4++; v7 = v2++; *v7 = *v6; } } } *v2 = 0; return dest; } else { return strcpy(dest, (const char *)a1); } } else { *dest = 1; dest[1] = 0; return dest; } } else { *dest = 0; return dest; } }
static void lbuf_putint (uintmax_t i, size_t min_width) { char buf[((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)]; char const *umaxstr = umaxtostr (i, buf); size_t width = sizeof (buf) - (umaxstr - buf) - 1; size_t z = width; for (; z < min_width; z++) *lbuf.end++ = '0'; memcpy (lbuf.end, umaxstr, width); lbuf.end += width; }
void lbuf_putint(undefined8 param_1,ulong param_2) { undefined *puVar1; void *__src; size_t __n; long in_FS_OFFSET; ulong local_40; undefined local_28 [24]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); __src = (void *)umaxtostr(param_1,local_28); __n = 0x14 - ((long)__src - (long)local_28); for (local_40 = __n; local_40 < param_2; local_40 = local_40 + 1) { puVar1 = lbuf._8_8_ + 1; *lbuf._8_8_ = 0x30; lbuf._8_8_ = puVar1; } memcpy(lbuf._8_8_,__src,__n); lbuf._8_8_ = lbuf._8_8_ + __n; if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
void __attribute__((visibility ("hidden"))) gz_error(state, err, msg) gz_statep state; int err; const char *msg; { if (state->msg != ((void *)0) ) { if (state->err != (-4)) free(state->msg); state->msg = ((void *)0) ; } if (err != 0 && err != (-5)) state->x.have = 0; state->err = err; if (msg == ((void *)0) ) return; if (err == (-4)) return; if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) == ((void *)0) ) { state->err = (-4); return; } (void)snprintf(state->msg, strlen(state->path) + strlen(msg) + 3, "%s%s%s", state->path, ": ", msg); }
void gz_error(struct_0 *a0, unsigned long a1, char *a2) { struct_0 *v1; struct_0 *v2; unsigned long long v3; if (a0->field_78) { if (a0->field_74 != -0x4) free(a0->field_78); a0->field_78 = 0; } if (a1 && a1 != -5) a0->field_0 = 0; v1 = a0; a0->field_74 = a1; if (a2 && a1 != -0x4) { a0->field_78 = malloc(strlen(a2) + strlen(a0->field_20) + 3); if (!a0->field_78) { v2 = a0; a0->field_74 = -0x4; } else { v3 = snprintf(a0->field_78, strlen(a2) + strlen(a0->field_20) + 3, "%s%s%s", a0->field_20, &g_400e9b, a2); } } return; }
int internal_strmatch (pattern, string, flags) unsigned char *pattern; unsigned char *string; int flags; { unsigned char *se, *pe; if (string == 0 || pattern == 0) return 1; se = string + strlen((char *)string); pe = pattern + strlen((char *)pattern); return (gmatch (string, se, pattern, pe, (struct smat_struct *) ((void *)0) , flags)); }
void internal_strmatch(char *a0, char *a1, unsigned long a2) { unsigned long long v0; unsigned long long v1; unsigned long long v3; unsigned long long v4; if (a1 && a0) { v0 = &a1[strlen(a1)]; v1 = &a0[strlen(a0)]; v4 = gmatch(a1, v0, a0, v1, 0x0, a2); } if (!a0 || !a1) v3 = 1; return; }
static _Bool dump_strings (void) { size_t bufsize = ((( 100 )>( string_min ))?( 100 ):( string_min )) ; char *buf = xmalloc (bufsize); uintmax_t address = n_bytes_to_skip; _Bool ok = 1 ; while ( 1 ) { size_t i; int c; tryline: if (limit_bytes_to_format && (end_offset < string_min || end_offset - string_min <= address)) break; for (i = 0; i < string_min; i++) { ok &= read_char (&c); address++; if (c < 0) { free (buf); return ok; } if (! ((*__ctype_b_loc ())[(int) (( c ))] & (unsigned short int) _ISprint) ) goto tryline; buf[i] = c; } while (!limit_bytes_to_format || address < end_offset) { if (i == bufsize) { buf = ((!!sizeof (struct { _Static_assert (sizeof *(buf) == 1, "verify_expr (" "sizeof *(buf) == 1" ", " "x2realloc (buf, &bufsize)" ")"); int _gl_dummy; })) ? (x2realloc (buf, &bufsize)) : (x2realloc (buf, &bufsize))); } ok &= read_char (&c); address++; if (c < 0) { free (buf); return ok; } if (c == '\0') break; if (! ((*__ctype_b_loc ())[(int) (( c ))] & (unsigned short int) _ISprint) ) goto tryline; buf[i++] = c; } buf[i] = 0; format_address (address - i - 1, ' '); for (i = 0; (c = buf[i]); i++) { switch (c) { case '\a': fputs_unlocked ("\\a", stdout ); break; case '\b': fputs_unlocked ("\\b", stdout ); break; case '\f': fputs_unlocked ("\\f", stdout ); break; case '\n': fputs_unlocked ("\\n", stdout ); break; case '\r': fputs_unlocked ("\\r", stdout ); break; case '\t': fputs_unlocked ("\\t", stdout ); break; case '\v': fputs_unlocked ("\\v", stdout ); break; default: putc_unlocked (c, stdout ); } } putchar_unlocked ('\n'); } free (buf); ok &= check_and_close (0); return ok; }
bool dump_strings(void) { byte bVar1; ushort **ppuVar2; long in_FS_OFFSET; bool local_35; int local_34; ulong local_30; void *local_28; ulong local_20; ulong local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_30 = string_min; if (string_min < 100) { local_30 = 100; } local_28 = (void *)xmalloc(local_30); local_20 = n_bytes_to_skip; local_35 = true; LAB_00102f75: do { if ((limit_bytes_to_format != '\0') && ((end_offset < string_min || (end_offset - string_min <= local_20)))) { free(local_28); bVar1 = check_and_close(0); local_35 = (bVar1 & local_35) != 0; LAB_001032aa: if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return local_35; } for (local_18 = 0; local_18 < string_min; local_18 = local_18 + 1) { bVar1 = read_char(&local_34); local_35 = (bVar1 & local_35) != 0; local_20 = local_20 + 1; if (local_34 < 0) { free(local_28); goto LAB_001032aa; } ppuVar2 = __ctype_b_loc(); if (((*ppuVar2)[local_34] & 0x4000) == 0) goto LAB_00102f75; *(char *)(local_18 + (long)local_28) = (char)local_34; } while ((limit_bytes_to_format != '\x01' || (local_20 < end_offset))) { if (local_18 == local_30) { local_28 = (void *)x2realloc(local_28,&local_30); } bVar1 = read_char(&local_34); local_35 = (bVar1 & local_35) != 0; local_20 = local_20 + 1; if (local_34 < 0) { free(local_28); goto LAB_001032aa; } if (local_34 == 0) break; ppuVar2 = __ctype_b_loc(); if (((*ppuVar2)[local_34] & 0x4000) == 0) goto LAB_00102f75; *(char *)(local_18 + (long)local_28) = (char)local_34; local_18 = local_18 + 1; } *(undefined *)(local_18 + (long)local_28) = 0; (*format_address)((local_20 - local_18) + -1,0x20); for (local_18 = 0; local_34 = (int)*(char *)(local_18 + (long)local_28), local_34 != 0; local_18 = local_18 + 1) { switch(local_34) { case 7: fputs_unlocked("\\a",stdout); break; case 8: fputs_unlocked("\\b",stdout); break; case 9: fputs_unlocked("\\t",stdout); break; case 10: fputs_unlocked("\\n",stdout); break; case 0xb: fputs_unlocked("\\v",stdout); break; case 0xc: fputs_unlocked("\\f",stdout); break; case 0xd: fputs_unlocked("\\r",stdout); break; default: putc_unlocked(local_34,stdout); } } putchar_unlocked(10); } while( true ); }
int ssh_digest_memory(int alg, const void *m, size_t mlen, u_char *d, size_t dlen) { const struct ssh_digest *digest = ssh_digest_by_alg(alg); u_int mdlen; if (digest == ((void *)0) ) return -10; if (dlen > (0x7fffffff * 2U + 1U) ) return -10; if (dlen < digest->digest_len) return -10; mdlen = dlen; if (!EVP_Digest(m, mlen, d, &mdlen, digest->mdfunc(), ((void *)0) )) return -22; return 0; }
undefined8 ssh_digest_memory(undefined4 param_1,void *param_2,size_t param_3,uchar *param_4,ulong param_5) { int iVar1; undefined8 uVar2; EVP_MD *type; long in_FS_OFFSET; uint local_1c; long local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_18 = ssh_digest_by_alg(param_1); if (local_18 == 0) { uVar2 = 0xfffffff6; } else if (param_5 < 0x100000000) { if (param_5 < *(ulong *)(local_18 + 0x10)) { uVar2 = 0xfffffff6; } else { local_1c = (uint)param_5; type = (EVP_MD *)(**(code **)(local_18 + 0x18))(); iVar1 = EVP_Digest(param_2,param_3,param_4,&local_1c,type,(ENGINE *)0x0); if (iVar1 == 0) { uVar2 = 0xffffffea; } else { uVar2 = 0; } } } else { uVar2 = 0xfffffff6; } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar2; }
static int int16_nonzero_mask(crypto_int16 x) { crypto_uint16 u = x; crypto_uint32 v = u; v = -v; v >>= 31; return -v; }
int int16_nonzero_mask(unsigned long a0) { unsigned int v0; v0 = a0; v0 = -(v0); v0 >>= 31; return -(v0); }
static void print_stats (void) { if (status_level == STATUS_NONE) return; if (0 < progress_len) { fputc_unlocked ('\n', stderr ); progress_len = 0; } fprintf ( stderr , gettext ("%" "l" "d" "+%" "l" "d" " records in\n" "%" "l" "d" "+%" "l" "d" " records out\n") , r_full, r_partial, w_full, w_partial); if (r_truncate != 0) fprintf ( stderr , ngettext ("%" "l" "d" " truncated record\n", "%" "l" "d" " truncated records\n", select_plural (r_truncate)), r_truncate); if (status_level == STATUS_NOXFER) return; print_xfer_stats (0); }
void print_stats(void) { undefined8 uVar1; undefined8 uVar2; undefined8 uVar3; long lVar4; char *pcVar5; undefined8 uVar6; if (status_level != 1) { if (0 < progress_len) { fputc_unlocked(10,stderr); progress_len = 0; } uVar3 = r_full; uVar2 = r_partial; uVar1 = w_full; uVar6 = w_partial; pcVar5 = (char *)gettext("%ld+%ld records in\n%ld+%ld records out\n"); fprintf(stderr,pcVar5,uVar3,uVar2,uVar1,uVar6); lVar4 = r_truncate; if (r_truncate != 0) { uVar6 = select_plural(r_truncate); pcVar5 = (char *)ngettext("%ld truncated record\n","%ld truncated records\n",uVar6); fprintf(stderr,pcVar5,lVar4); } if (status_level != 2) { print_xfer_stats(0); } } return; }
(r = ssh_packet_write_wait(ssh)) != 0) sshpkt_fatal(ssh, r, "%s", __func__); return 0; } int dispatch_protocol_ignore(int type, u_int32_t seq, struct ssh *ssh) { sshlog("dispatch.c", __func__, 57, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "dispatch_protocol_ignore: type %d seq %u", type, seq); return 0; }
void ssh_packet_write_wait(void) { halt_baddata(); }
off64_t gztell64(file) gzFile file; { gz_statep state; if (file == ((void *)0) ) return -1; state = (gz_statep)file; if (state->mode != 7247 && state->mode != 31153) return -1; return state->x.pos + (state->seek ? state->skip : 0); }
long gztell64(long param_1) { long lVar1; if (param_1 == 0) { lVar1 = -1; } else if ((*(int *)(param_1 + 0x18) == 0x1c4f) || (*(int *)(param_1 + 0x18) == 0x79b1)) { if (*(int *)(param_1 + 0x70) == 0) { lVar1 = 0; } else { lVar1 = *(long *)(param_1 + 0x68); } lVar1 = lVar1 + *(long *)(param_1 + 0x10); } else { lVar1 = -1; } return lVar1; }
static inline __u64 rta_getattr_u64(const struct rtattr *rta) { __u64 tmp; memcpy(&tmp, ((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), sizeof(__u64)); return tmp; }
long rta_getattr_u64(long a1) { long dest[2]; dest[1] = __readfsqword(0x28u); memcpy(dest, (const void *)(a1 + 4), 8uLL); return dest[0]; }
int deflateSetHeader(strm, head) z_streamp strm; gz_headerp head; { if (deflateStateCheck(strm) || strm->state->wrap != 2) return (-2); strm->state->gzhead = head; return 0; }
long deflateSetHeader(_QWORD *a1, long a2) { if ( deflateStateCheck(a1) || *(_DWORD *)(a1[7] + 48LL) != 2 ) return 4294967294LL; *(_QWORD *)(a1[7] + 56LL) = a2; return 0LL; }
static inline void setInstParamDefaults(instanceData *pData) { pData->bIsWall = 0; pData->tplName = ((void *)0) ; }
void setInstParamDefaults(struct_0 *a0) { char v0; struct_0 *v2; unsigned long long v3; a0->field_0 = 0; v2 = a0; a0->field_298 = 0; v3 = *(&v0); return; }
void print_ocsp_verify_res(unsigned int output) { int comma = 0; if (output) { printf("Failure"); comma = 1; } else { printf("Success"); comma = 1; } if (output & GNUTLS_OCSP_VERIFY_SIGNER_NOT_FOUND) { if (comma) printf(", "); printf("Signer cert not found"); comma = 1; } if (output & GNUTLS_OCSP_VERIFY_SIGNER_KEYUSAGE_ERROR) { if (comma) printf(", "); printf("Signer cert keyusage error"); comma = 1; } if (output & GNUTLS_OCSP_VERIFY_UNTRUSTED_SIGNER) { if (comma) printf(", "); printf("Signer cert is not trusted"); comma = 1; } if (output & GNUTLS_OCSP_VERIFY_INSECURE_ALGORITHM) { if (comma) printf(", "); printf("Insecure algorithm"); comma = 1; } if (output & GNUTLS_OCSP_VERIFY_SIGNATURE_FAILURE) { if (comma) printf(", "); printf("Signature failure"); comma = 1; } if (output & GNUTLS_OCSP_VERIFY_CERT_NOT_ACTIVATED) { if (comma) printf(", "); printf("Signer cert not yet activated"); comma = 1; } if (output & GNUTLS_OCSP_VERIFY_CERT_EXPIRED) { if (comma) printf(", "); printf("Signer cert expired"); } }
void print_ocsp_verify_res(unsigned long a0) { unsigned int v0; unsigned long v2; unsigned long long v3; v0 = 0; if (a0) { printf("Failure"); v0 = 1; } else { printf("Success"); v0 = 1; } if ((a0 & 1)) { if (v0) printf(", "); printf("Signer cert not found"); v0 = 1; } if ((a0 & 2)) { if (v0) printf(", "); printf("Signer cert keyusage error"); v0 = 1; } if ((a0 & 4)) { if (v0) printf(", "); printf("Signer cert is not trusted"); v0 = 1; } if ((a0 & 8)) { if (v0) printf(", "); printf("Insecure algorithm"); v0 = 1; } if ((a0 & 16)) { if (v0) printf(", "); printf("Signature failure"); v0 = 1; } if ((a0 & 32)) { if (v0) printf(", "); printf("Signer cert not yet activated"); v0 = 1; } v2 = a0 & 64; if ((a0 & 64)) { if (v0) printf(", "); v3 = printf("Signer cert expired"); } return; }
void xheader_xattr_copy (const struct tar_stat_info *st, struct xattr_array **xattr_map, size_t *xattr_map_size) { size_t scan = 0; *xattr_map = ((void *)0) ; *xattr_map_size = 0; while (scan < st->xattr_map_size) { char *key = st->xattr_map[scan].xkey; char *val = st->xattr_map[scan].xval_ptr; size_t len = st->xattr_map[scan].xval_len; xheader_xattr__add(xattr_map, xattr_map_size, key, val, len); ++scan; } }
long long xheader_xattr_copy(unsigned long long a0[45], unsigned long long *a1, unsigned long long *a2) { void* v0; unsigned long long v1; unsigned long long v2; unsigned long long v3; v0 = 0; *(a1) = 0; for (*(a2) = 0; v0 < a0[43]; v0 += 1) { v1 = *((v0 * 24 + a0[44])); v2 = *((v0 * 24 + a0[44] + 8)); v3 = *((v0 * 24 + a0[44] + 16)); xheader_xattr__add(a1, a2, v1, v2, v3); } return a0[43]; }
static size_t ignore_fifo_and_pipe (struct File_spec *f, size_t n_files) { size_t n_viable = 0; for (size_t i = 0; i < n_files; i++) { _Bool is_a_fifo_or_pipe = ((strcmp (f[i].name, "-") == 0) && !f[i].ignore && 0 <= f[i].fd && ( (((( f[i].mode )) & 0170000) == (0010000)) || (1 != 1 && isapipe (f[i].fd)))); if (is_a_fifo_or_pipe) { f[i].fd = -1; f[i].ignore = 1 ; } else ++n_viable; } return n_viable; }
long ignore_fifo_and_pipe(long param_1,ulong param_2) { bool bVar1; int iVar2; long local_18; ulong local_10; local_18 = 0; for (local_10 = 0; local_10 < param_2; local_10 = local_10 + 1) { iVar2 = strcmp(*(char **)(param_1 + local_10 * 0x60),"-"); if ((((iVar2 == 0) && (*(char *)(param_1 + local_10 * 0x60 + 0x34) != '\x01')) && (-1 < *(int *)(param_1 + local_10 * 0x60 + 0x38))) && ((*(uint *)(param_1 + local_10 * 0x60 + 0x30) & 0xf000) == 0x1000)) { bVar1 = true; } else { bVar1 = false; } if (bVar1) { *(undefined4 *)(param_1 + local_10 * 0x60 + 0x38) = 0xffffffff; *(undefined *)(param_1 + local_10 * 0x60 + 0x34) = 1; } else { local_18 = local_18 + 1; } } return local_18; }
static _Bool implemented (int err) { return ! (err == 38 || err == 95 || ( 95 != 95 && err == 95 )); }
_BOOL8 implemented(int a1) { return a1 != 38 && a1 != 95; }
static int ipnh_get_id(__u32 id) { struct nlmsghdr *answer; if (__ipnh_get_id(&rth, id, &answer) < 0) return -2; new_json_obj(json); if (print_nexthop_nocache(answer, (void *) stdout ) < 0) { free(answer); return -1; } delete_json_obj(); fflush( stdout ); free(answer); return 0; }
undefined8 ipnh_get_id(undefined4 param_1) { int iVar1; undefined8 uVar2; long in_FS_OFFSET; void *local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); iVar1 = __ipnh_get_id(&rth,param_1,&local_18); if (iVar1 < 0) { uVar2 = 0xfffffffe; } else { new_json_obj(json); iVar1 = print_nexthop_nocache(local_18,stdout); if (iVar1 < 0) { free(local_18); uVar2 = 0xffffffff; } else { delete_json_obj(); fflush(stdout); free(local_18); uVar2 = 0; } } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar2; }
static void check_ip_options(struct ssh *ssh) { int sock_in = ssh_packet_get_connection_in(ssh); struct sockaddr_storage from; u_char opts[200]; socklen_t i, option_size = sizeof(opts), fromlen = sizeof(from); char text[sizeof(opts) * 3 + 1]; memset(&from, 0, sizeof(from)); if (getpeername(sock_in, (struct sockaddr *)&from, &fromlen) == -1) return; if (from.ss_family != 2 ) return; if (getsockopt(sock_in, IPPROTO_IP , 4 , opts, &option_size) >= 0 && option_size != 0) { text[0] = '\0'; for (i = 0; i < option_size; i++) snprintf(text + i*3, sizeof(text) - i*3, " %2.2x", opts[i]); sshfatal("sshd.c", __func__, 1440, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Connection from %.100s port %d with IP opts: %.800s", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), text) ; } return; }
void check_ip_options(undefined8 param_1) { int iVar1; uint uVar2; char **ppcVar3; long in_FS_OFFSET; char *pcStack1048; undefined8 uStack1040; ulong uStack1032; char *pcStack1024; undefined auStack1016 [8]; undefined8 local_3f0; uint local_3e8; socklen_t local_3e4; uint local_3e0; int local_3dc; sockaddr local_3d8 [8]; byte local_358 [208]; char local_288 [616]; long local_20; ppcVar3 = (char **)auStack1016; local_20 = *(long *)(in_FS_OFFSET + 0x28); pcStack1024 = (char *)0x10399c; local_3f0 = param_1; local_3dc = ssh_packet_get_connection_in(param_1); local_3e8 = 200; local_3e4 = 0x80; pcStack1024 = (char *)0x1039cf; memset(local_3d8,0,0x80); pcStack1024 = (char *)0x1039f0; iVar1 = getpeername(local_3dc,local_3d8,&local_3e4); if ((iVar1 != -1) && (ppcVar3 = (char **)auStack1016, local_3d8[0].sa_family == 2)) { pcStack1024 = (char *)0x103a35; iVar1 = getsockopt(local_3dc,0,4,local_358,&local_3e8); ppcVar3 = (char **)auStack1016; if ((-1 < iVar1) && (ppcVar3 = (char **)auStack1016, local_3e8 != 0)) { local_288[0] = '\0'; for (local_3e0 = 0; local_3e0 < local_3e8; local_3e0 = local_3e0 + 1) { pcStack1024 = (char *)0x103ab4; snprintf(local_288 + local_3e0 * 3,0x259 - (ulong)(local_3e0 * 3)," %2.2x", (ulong)local_358[local_3e0]); } pcStack1024 = (char *)0x103ad8; uVar2 = ssh_remote_port(local_3f0); uStack1032 = (ulong)uVar2; pcStack1024 = (char *)0x103ae9; uStack1040 = ssh_remote_ipaddr(local_3f0); pcStack1024 = local_288; ppcVar3 = &pcStack1048; pcStack1048 = "Connection from %.100s port %d with IP opts: %.800s"; sshfatal("sshd.c","check_ip_options",0x5a0,0,1,0); } } if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return; } *(undefined8 *)((long)ppcVar3 + -8) = 0x103b44; __stack_chk_fail(); }
0 ) do { fprintf ( stderr , gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
int fprintf(FILE *__stream,char *__format,...) { halt_baddata(); }
static int local_and_exported (var) SHELL_VAR *var; { return (((((var)->attributes) & (0x0001000))) == 0 && ((((var)->attributes) & (0x0000020))) && var->context == variable_context && ((((var)->attributes) & (0x0000001)))); }
long long local_and_exported(unsigned int a0[12]) { unsigned long long v1; if (!(a0[10] & 0x1000) && (a0[10] & 32) && a0[11] == variable_context && (a0[10] & 1)) { v1 = 1; goto LABEL_407ba5; } v1 = 0; LABEL_407ba5: return v1; }
voidpf __attribute__((visibility ("hidden"))) zcalloc(opaque, items, size) voidpf opaque; unsigned items; unsigned size; { (void)opaque; return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : (voidpf)calloc(items, size); }
long long zcalloc(unsigned long a0, unsigned long a1, unsigned long a2) { unsigned long v0; v0 = a0; return malloc(a2 * a1); }
static void removal_bulk_remove_configfiles(struct pkginfo *pkg) { static const char *const removeconffexts[] = { "~", ".bak", "%", ".dpkg-tmp", ".dpkg-new", ".dpkg-old", ".dpkg-dist", ((void *)0) }; int rc; int conffnameused, conffbasenamelen; char *conffbasename; struct conffile *conff, **lconffp; struct fsys_namenode_list *searchfile; DIR *dsd; struct dirent *de; char *p; const char *const *ext; printf(gettext("Purging configuration files for %s (%s) ...\n"), pkg_name(pkg, pnaw_nonambig), versiondescribe(&pkg->installed.version, vdew_nonambig)); log_action("purge", pkg, &pkg->installed); trig_activate_packageprocessing(pkg); ensure_packagefiles_available(pkg); dpkg_version_blank(&pkg->configversion); modstatdb_note(pkg); for (lconffp = &pkg->installed.conffiles; (conff = *lconffp) != ((void *)0) ; ) { for (searchfile = pkg->files; searchfile && strcmp(searchfile->namenode->name,conff->name); searchfile= searchfile->next); if (!searchfile) { debug(dbg_conff, "removal_bulk conffile not ours any more '%s'", conff->name); *lconffp= conff->next; } else if (searchfile->namenode->divert && (searchfile->namenode->divert->camefrom || (searchfile->namenode->divert->useinstead && searchfile->namenode->divert->pkgset != pkg->set))) { debug(dbg_conff, "removal_bulk conffile '%s' ignored due to diversion", conff->name); *lconffp= conff->next; } else { debug(dbg_conffdetail, "removal_bulk set to new conffile '%s'", conff->name); conff->hash = "newconffile"; lconffp= &conff->next; } } modstatdb_note(pkg); for (conff= pkg->installed.conffiles; conff; conff= conff->next) { struct fsys_namenode *namenode, *usenode; static struct varbuf fnvb, removevb; struct varbuf_state removevb_state; if (conff->obsolete) { debug(dbg_conffdetail, "removal_bulk conffile obsolete %s", conff->name); } varbuf_reset(&fnvb); rc = conffderef(pkg, &fnvb, conff->name); debug(dbg_conffdetail, "removal_bulk conffile '%s' (= '%s')", conff->name, rc == -1 ? "<rc == -1>" : fnvb.buf); if (rc == -1) continue; namenode = fsys_hash_find_node(conff->name, 0); usenode = namenodetouse(namenode, pkg, &pkg->installed); trig_path_activate(usenode, pkg); conffnameused = fnvb.used; if (unlink(fnvb.buf) && (*__errno_location ()) != 2 && (*__errno_location ()) != 20 ) ohshite(gettext("cannot remove old config file '%.250s' (= '%.250s')"), conff->name, fnvb.buf); p= strrchr(fnvb.buf,'/'); if (!p) continue; *p = '\0'; varbuf_reset(&removevb); varbuf_add_buf(&removevb, fnvb.buf, strlen(fnvb.buf)); varbuf_add_char(&removevb, '/'); varbuf_end_str(&removevb); varbuf_snapshot(&removevb, &removevb_state); dsd= opendir(removevb.buf); if (!dsd) { int e= (*__errno_location ()) ; debug(dbg_conffdetail, "removal_bulk conffile no dsd %s %s", fnvb.buf, strerror(e)); (*__errno_location ()) = e; if ( (*__errno_location ()) == 2 || (*__errno_location ()) == 20 ) continue; ohshite(gettext("cannot read config file directory '%.250s' (from '%.250s')"), fnvb.buf, conff->name); } debug(dbg_conffdetail, "removal_bulk conffile cleaning dsd %s", fnvb.buf); push_cleanup(cu_closedir, ~0, 1, (void *)dsd); *p= '/'; conffbasenamelen= strlen(++p); conffbasename= fnvb.buf+conffnameused-conffbasenamelen; while ((de = readdir(dsd)) != ((void *)0) ) { debug(dbg_stupidlyverbose, "removal_bulk conffile dsd entry='%s'" " conffbasename='%s' conffnameused=%d conffbasenamelen=%d", de->d_name, conffbasename, conffnameused, conffbasenamelen); if (strncmp(de->d_name, conffbasename, conffbasenamelen) == 0) { debug(dbg_stupidlyverbose, "removal_bulk conffile dsd entry starts right"); for (ext= removeconffexts; *ext; ext++) if (strcmp(*ext, de->d_name + conffbasenamelen) == 0) goto yes_remove; p= de->d_name+conffbasenamelen; if (*p++ == '~') { while (*p && c_isdigit(*p)) p++; if (*p == '~' && !*++p) goto yes_remove; } } debug(dbg_stupidlyverbose, "removal_bulk conffile dsd entry starts wrong"); if (de->d_name[0] == '#' && strncmp(de->d_name + 1, conffbasename, conffbasenamelen) == 0 && strcmp(de->d_name + 1 + conffbasenamelen, "#") == 0) goto yes_remove; debug(dbg_stupidlyverbose, "removal_bulk conffile dsd entry not it"); continue; yes_remove: varbuf_rollback(&removevb, &removevb_state); varbuf_add_buf(&removevb, de->d_name, strlen(de->d_name)); varbuf_end_str(&removevb); debug(dbg_conffdetail, "removal_bulk conffile dsd entry removing '%s'", removevb.buf); if (unlink(removevb.buf) && (*__errno_location ()) != 2 && (*__errno_location ()) != 20 ) ohshite(gettext("cannot remove old backup config file '%.250s' (of '%.250s')"), removevb.buf, conff->name); } pop_cleanup(ehflag_normaltidy); } write_filelist_except(pkg, &pkg->installed, pkg->files, FNNF_OLD_CONFF); pkg->installed.conffiles = ((void *)0) ; modstatdb_note(pkg); maintscript_installed(pkg, "postrm", "post-removal", "purge", ((void *)0) ); }
void removal_bulk_remove_configfiles(long *param_1) { char cVar1; int iVar2; int iVar3; int iVar4; undefined8 uVar5; undefined8 uVar6; char *pcVar7; int *piVar8; size_t sVar9; long in_FS_OFFSET; undefined local_78 [8]; long **local_70; long **local_68; undefined8 *local_60; char *local_58; undefined1 *local_50; undefined8 local_48; undefined8 local_40; DIR *local_38; char *local_30; dirent *local_28; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); uVar5 = versiondescribe(param_1 + 0x13,1); uVar6 = pkg_name(param_1,1); pcVar7 = (char *)gettext("Purging configuration files for %s (%s) ...\n"); printf(pcVar7,uVar6,uVar5); log_action("purge",param_1,param_1 + 9); trig_activate_packageprocessing(param_1); ensure_packagefiles_available(param_1); dpkg_version_blank(param_1 + 6); modstatdb_note(param_1); local_68 = (long **)(param_1 + 0x16); while (local_70 = (long **)*local_68, local_70 != (long **)0x0) { local_60 = (undefined8 *)param_1[0x2d]; while ((local_60 != (undefined8 *)0x0 && (iVar2 = strcmp(*(char **)(local_60[1] + 8),(char *)local_70[1]), iVar2 != 0))) { local_60 = (undefined8 *)*local_60; } if (local_60 == (undefined8 *)0x0) { debug(0x10,"removal_bulk conffile not ours any more \'%s\'",local_70[1]); *local_68 = *local_70; } else if ((*(long *)(local_60[1] + 0x18) == 0) || ((*(long *)(*(long *)(local_60[1] + 0x18) + 8) == 0 && ((**(long **)(local_60[1] + 0x18) == 0 || (*(long *)(*(long *)(local_60[1] + 0x18) + 0x10) == *param_1)))))) { debug(0x80,"removal_bulk set to new conffile \'%s\'",local_70[1]); local_70[2] = (long *)"newconffile"; local_68 = local_70; } else { debug(0x10,"removal_bulk conffile \'%s\' ignored due to diversion",local_70[1]); *local_68 = *local_70; } } modstatdb_note(param_1); local_70 = (long **)param_1[0x16]; do { if (local_70 == (long **)0x0) { write_filelist_except(param_1,param_1 + 9,param_1[0x2d],4); param_1[0x16] = 0; modstatdb_note(param_1); maintscript_installed(param_1,"postrm","post-removal","purge",0); if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); } if (*(char *)(local_70 + 3) != '\0') { debug(0x80,"removal_bulk conffile obsolete %s",local_70[1]); } varbuf_reset(fnvb_5671); iVar2 = conffderef(param_1,fnvb_5671,local_70[1]); pcVar7 = fnvb_5671._16_8_; if (iVar2 == -1) { pcVar7 = "<rc == -1>"; } debug(0x80,"removal_bulk conffile \'%s\' (= \'%s\')",local_70[1],pcVar7); if (iVar2 != -1) { local_48 = fsys_hash_find_node(local_70[1],0); local_40 = namenodetouse(local_48,param_1,param_1 + 9); trig_path_activate(local_40,param_1); iVar2 = (int)fnvb_5671._0_8_; iVar3 = unlink(fnvb_5671._16_8_); if (((iVar3 != 0) && (piVar8 = __errno_location(), *piVar8 != 2)) && (piVar8 = __errno_location(), pcVar7 = fnvb_5671._16_8_, *piVar8 != 0x14)) { uVar5 = local_70[1]; uVar6 = gettext("cannot remove old config file \'%.250s\' (= \'%.250s\')"); ohshite(uVar6,uVar5,pcVar7); } local_58 = strrchr(fnvb_5671._16_8_,0x2f); if (local_58 != (char *)0x0) { *local_58 = '\0'; varbuf_reset(removevb_5672); sVar9 = strlen(fnvb_5671._16_8_); varbuf_add_buf(removevb_5672,fnvb_5671._16_8_,sVar9); varbuf_add_char(removevb_5672,0x2f); varbuf_end_str(removevb_5672); varbuf_snapshot(removevb_5672,local_78); local_38 = opendir(removevb_5672._16_8_); if (local_38 == (DIR *)0x0) { piVar8 = __errno_location(); iVar3 = *piVar8; pcVar7 = strerror(iVar3); debug(0x80,"removal_bulk conffile no dsd %s %s",fnvb_5671._16_8_,pcVar7); piVar8 = __errno_location(); *piVar8 = iVar3; piVar8 = __errno_location(); if ((*piVar8 == 2) || (piVar8 = __errno_location(), pcVar7 = fnvb_5671._16_8_, *piVar8 == 0x14)) goto LAB_00101e89; uVar5 = local_70[1]; uVar6 = gettext("cannot read config file directory \'%.250s\' (from \'%.250s\')"); ohshite(uVar6,pcVar7,uVar5); } debug(0x80,"removal_bulk conffile cleaning dsd %s",fnvb_5671._16_8_); push_cleanup(uRam0000000000101b9b,0xffffffff,1,local_38); *local_58 = '/'; local_58 = local_58 + 1; sVar9 = strlen(local_58); iVar3 = (int)sVar9; local_30 = fnvb_5671._16_8_ + ((long)iVar2 - (long)iVar3); while (local_28 = readdir(local_38), local_28 != (dirent *)0x0) { debug(0x400, "removal_bulk conffile dsd entry=\'%s\' conffbasename=\'%s\' conffnameused=%d conffbasenamelen=%d" ,local_28->d_name,local_30,iVar2,iVar3); iVar4 = strncmp(local_28->d_name,local_30,(long)iVar3); if (iVar4 == 0) { debug(0x400,"removal_bulk conffile dsd entry starts right"); for (local_50 = removeconffexts_5651; *(char **)local_50 != (char *)0x0; local_50 = (undefined1 *)((long)local_50 + 8)) { iVar4 = strcmp(*(char **)local_50,local_28->d_name + iVar3); if (iVar4 == 0) goto LAB_00101d99; } local_58 = local_28->d_name + iVar3 + 1; if (local_28->d_name[iVar3] != '~') goto LAB_00101d09; while ((*local_58 != '\0' && (cVar1 = c_isdigit((int)*local_58), cVar1 != '\0'))) { local_58 = local_58 + 1; } if ((*local_58 != '~') || (local_58 = local_58 + 1, *local_58 != '\0')) goto LAB_00101d09; LAB_00101d99: varbuf_rollback(removevb_5672,local_78); sVar9 = strlen(local_28->d_name); varbuf_add_buf(removevb_5672,local_28->d_name,sVar9); varbuf_end_str(removevb_5672); debug(0x80,"removal_bulk conffile dsd entry removing \'%s\'",removevb_5672._16_8_); iVar4 = unlink(removevb_5672._16_8_); if (((iVar4 != 0) && (piVar8 = __errno_location(), *piVar8 != 2)) && (piVar8 = __errno_location(), pcVar7 = removevb_5672._16_8_, *piVar8 != 0x14)) { uVar5 = local_70[1]; uVar6 = gettext("cannot remove old backup config file \'%.250s\' (of \'%.250s\')"); ohshite(uVar6,pcVar7,uVar5); } } else { LAB_00101d09: debug(0x400,"removal_bulk conffile dsd entry starts wrong"); if ((local_28->d_name[0] == '#') && ((iVar4 = strncmp(local_28->d_name + 1,local_30,(long)iVar3), iVar4 == 0 && (iVar4 = strcmp(local_28->d_name + (long)iVar3 + 1,"#"), iVar4 == 0)))) goto LAB_00101d99; debug(0x400); } } pop_cleanup(1); } } LAB_00101e89: local_70 = (long **)*local_70; } while( true ); }
static void parse_extended_opts(e2fsck_t ctx, const char *opts) { char *buf, *token, *next, *p, *arg; int ea_ver; int extended_usage = 0; unsigned long long reada_kb; buf = string_copy(ctx, opts, 0); for (token = buf; token && *token; token = next) { p = strchr(token, ','); next = 0; if (p) { *p = 0; next = p+1; } arg = strchr(token, '='); if (arg) { *arg = 0; arg++; } if (strcmp(token, "ea_ver") == 0) { if (!arg) { extended_usage++; continue; } ea_ver = strtoul(arg, &p, 0); if (*p || ((ea_ver != 1) && (ea_ver != 2))) { fprintf( stderr , "%s", (gettext ("Invalid EA version.\n"))); extended_usage++; continue; } ctx->ext_attr_ver = ea_ver; } else if (strcmp(token, "readahead_kb") == 0) { if (!arg) { extended_usage++; continue; } reada_kb = strtoull(arg, &p, 0); if (*p) { fprintf( stderr , "%s", (gettext ("Invalid readahead buffer size.\n"))); extended_usage++; continue; } ctx->readahead_kb = reada_kb; } else if (strcmp(token, "fragcheck") == 0) { ctx->options |= 0x0800; continue; } else if (strcmp(token, "journal_only") == 0) { if (arg) { extended_usage++; continue; } ctx->options |= 0x1000; } else if (strcmp(token, "discard") == 0) { ctx->options |= 0x2000; continue; } else if (strcmp(token, "nodiscard") == 0) { ctx->options &= ~0x2000; continue; } else if (strcmp(token, "optimize_extents") == 0) { ctx->options &= ~0x10000; continue; } else if (strcmp(token, "no_optimize_extents") == 0) { ctx->options |= 0x10000; continue; } else if (strcmp(token, "inode_count_fullmap") == 0) { ctx->options |= 0x20000; continue; } else if (strcmp(token, "no_inode_count_fullmap") == 0) { ctx->options &= ~0x20000; continue; } else if (strcmp(token, "log_filename") == 0) { if (!arg) extended_usage++; else ctx->log_fn = string_copy(ctx, arg, 0); continue; } else if (strcmp(token, "problem_log") == 0) { if (!arg) extended_usage++; else ctx->problem_log_fn = string_copy(ctx, arg, 0); continue; } else if (strcmp(token, "bmap2extent") == 0) { ctx->options |= 0x4000; continue; } else if (strcmp(token, "fixes_only") == 0) { ctx->options |= 0x8000; continue; } else if (strcmp(token, "unshare_blocks") == 0) { ctx->options |= 0x40000; ctx->options |= 0x0100; continue; } else if (strcmp(token, "check_encoding") == 0) { ctx->options |= 0x100000; continue; } else { fprintf( stderr , (gettext ("Unknown extended option: %s\n")), token); extended_usage++; } } free(buf); if (extended_usage) { fputs((gettext ("\nExtended options are separated by commas, " "and may take an argument which\n" "is set off by an equals ('=') sign. " "Valid extended options are:\n\n")) , stderr ); fputs((gettext ("\tea_ver=<ea_version (1 or 2)>\n")), stderr ); fputs("\tfragcheck\n", stderr ); fputs("\tjournal_only\n", stderr ); fputs("\tdiscard\n", stderr ); fputs("\tnodiscard\n", stderr ); fputs("\toptimize_extents\n", stderr ); fputs("\tno_optimize_extents\n", stderr ); fputs("\tinode_count_fullmap\n", stderr ); fputs("\tno_inode_count_fullmap\n", stderr ); fputs((gettext ("\treadahead_kb=<buffer size>\n")), stderr ); fputs("\tbmap2extent\n", stderr ); fputs("\tunshare_blocks\n", stderr ); fputs("\tfixes_only\n", stderr ); fputs("\tcheck_encoding\n", stderr ); fputc('\n', stderr ); exit(1); } }
void parse_extended_opts(struct_0 *a0, unsigned long long a1) { unsigned int v0; int tmp_17; int tmp_45; unsigned int v1; char *v2; void* v3; void* v4; char *v5; void* v6; unsigned long v7; char v8; unsigned long long v10; unsigned long long v11; unsigned long long v12; unsigned long long v13; unsigned long long v14; unsigned long long v15; unsigned long long v16; unsigned long long *v17; unsigned long long v18; v0 = 0; v6 = string_copy(a0, a1, 0x0, a1); for (v3 = v6; v3 && *(v3); v3 = v4) { v2 = strchr(v3, 0x2c); v4 = 0; if (v2) { *(v2) = 0; v4 = v2 + 1; } v5 = strchr(v3, 0x3d); if (v5) { *(v5) = 0; v5 += 1; } if (!strcmp(v3, "ea_ver")) { if (!v5) { v0 += 1; } else { v1 = strtoul(v5, &v2, 0x0, &v2); if (*(v2)) { fprintf(*(&stderr), "%s", gettext("Invalid EA version.\n")); v0 += 1; } else { switch (v1) { case 1: case 2: a0->field_358 = v1; break; default: fprintf(*(&stderr), "%s", gettext("Invalid EA version.\n")); v0 += 1; break; } } } } else { if (strcmp(v3, "readahead_kb")) { if (!strcmp(v3, "fragcheck")) { v10 = a0->field_4c; *(&v10) = (a0->field_4c >> 8) | 8; tmp_17 = v10; a0->field_4c = tmp_17; } else if (strcmp(v3, "journal_only")) { if (!strcmp(v3, "discard")) { v12 = a0->field_4c; *(&v12) = (a0->field_4c >> 8) | 32; tmp_17 = v12; a0->field_4c = tmp_17; } else if (!strcmp(v3, "nodiscard")) { v13 = a0->field_4c; *(&v13) = (a0->field_4c >> 8) & 223; tmp_17 = v13; a0->field_4c = tmp_17; } else if (!strcmp(v3, "optimize_extents")) { a0->field_4c = a0->field_4c & -65537; } else if (!strcmp(v3, "no_optimize_extents")) { a0->field_4c = a0->field_4c | 0x10000; } else if (!strcmp(v3, "inode_count_fullmap")) { a0->field_4c = a0->field_4c | 0x20000; } else if (!strcmp(v3, "no_inode_count_fullmap")) { a0->field_4c = a0->field_4c & -131073; } else if (!strcmp(v3, "log_filename")) { if (!v5) v0 += 1; else a0->field_30 = string_copy(a0, v5, 0x0, v5); } else { if (strcmp(v3, "problem_log")) { if (!strcmp(v3, "bmap2extent")) { v14 = a0->field_4c; *(&v14) = (a0->field_4c >> 8) | 64; tmp_17 = v14; a0->field_4c = tmp_17; } else if (!strcmp(v3, "fixes_only")) { v15 = a0->field_4c; *(&v15) = (a0->field_4c >> 8) | 128; tmp_17 = v15; a0->field_4c = tmp_17; } else if (!strcmp(v3, "unshare_blocks")) { a0->field_4c = a0->field_4c | 0x40000; v16 = a0->field_4c; *(&v16) = (a0->field_4c >> 8) | 1; tmp_45 = v16; a0->field_4c = tmp_45; } else if (!strcmp(v3, "check_encoding")) { a0->field_4c = a0->field_4c | 0x100000; } else { fprintf(*(&stderr), gettext("Unknown extended option: %s\n")); v0 += 1; } } else { if (v5) a0->field_40 = string_copy(a0, v5, 0x0, v5); else v0 += 1; } } } else { if (!v5) { v11 = a0->field_4c; *(&v11) = (a0->field_4c >> 8) | 16; tmp_17 = v11; a0->field_4c = tmp_17; } else { v0 += 1; } } } else { if (!v5) { v0 += 1; } else { v7 = strtoull(v5, &v2, 0x0); if (!*(v2)) { a0->field_398 = v7; } else { fprintf(*(&stderr), "%s", gettext("Invalid readahead buffer size.\n")); v0 += 1; } } } } } free(v6); if (!v0) { v18 = *(&v8) ^ v17[5]; return; } fputs(gettext("\nExtended options are separated by commas, and may take an argument which\nis set off by an equals ('=') sign. Valid extended options are:\n\n"), *(&stderr)); fputs(gettext("\tea_ver=<ea_version (1 or 2)>\n"), *(&stderr)); fputs("\tfragcheck\n", *(&stderr)); fputs("\tjournal_only\n", *(&stderr)); fputs("\tdiscard\n", *(&stderr)); fputs("\tnodiscard\n", *(&stderr)); fputs("\toptimize_extents\n", *(&stderr)); fputs("\tno_optimize_extents\n", *(&stderr)); fputs("\tinode_count_fullmap\n", *(&stderr)); fputs("\tno_inode_count_fullmap\n", *(&stderr)); fputs(gettext("\treadahead_kb=<buffer size>\n"), *(&stderr)); fputs("\tbmap2extent\n", *(&stderr)); fputs("\tunshare_blocks\n", *(&stderr)); fputs("\tfixes_only\n", *(&stderr)); fputs("\tcheck_encoding\n", *(&stderr)); fputc(0xa, *(&stderr)); exit(0x1); }
void crypto_sign_ed25519_ref_fe25519_mul(crypto_sign_ed25519_ref_fe25519 *r, const crypto_sign_ed25519_ref_fe25519 *x, const crypto_sign_ed25519_ref_fe25519 *y) { int i,j; crypto_uint32 t[63]; for(i=0;i<63;i++)t[i] = 0; for(i=0;i<32;i++) for(j=0;j<32;j++) t[i+j] += x->v[i] * y->v[j]; for(i=32;i<63;i++) r->v[i-32] = t[i-32] + times38(t[i]); r->v[31] = t[31]; reduce_mul(r); }
void crypto_sign_ed25519_ref_fe25519_mul(long param_1,long param_2,long param_3) { int iVar1; int iVar2; int iVar3; int iVar4; long in_FS_OFFSET; int local_130; int local_12c; int aiStack296 [31]; undefined4 local_ac; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); for (local_130 = 0; local_130 < 0x3f; local_130 = __addvsi3(local_130,1)) { aiStack296[local_130] = 0; } for (local_130 = 0; local_130 < 0x20; local_130 = __addvsi3(local_130,1)) { local_12c = 0; while (local_12c < 0x20) { iVar2 = __addvsi3(local_130,local_12c); iVar2 = aiStack296[iVar2]; iVar3 = *(int *)(param_2 + (long)local_130 * 4); iVar4 = *(int *)(param_3 + (long)local_12c * 4); iVar1 = __addvsi3(local_130,local_12c); aiStack296[iVar1] = iVar2 + iVar3 * iVar4; local_12c = __addvsi3(); } } for (local_130 = 0x20; local_130 < 0x3f; local_130 = __addvsi3(local_130,1)) { iVar2 = __addvsi3(local_130,0xffffffe0); iVar2 = aiStack296[iVar2]; iVar3 = times38(); iVar4 = __addvsi3(local_130,0xffffffe0); *(int *)(param_1 + (long)iVar4 * 4) = iVar2 + iVar3; } *(undefined4 *)(param_1 + 0x7c) = local_ac; reduce_mul(param_1); if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
static void pushexp () { EXPR_CONTEXT *context; if (expr_depth >= 1024) evalerror (gettext("expression recursion level exceeded")); if (expr_depth >= expr_stack_size) { expr_stack_size += 10; expr_stack = (EXPR_CONTEXT **)sh_xrealloc((expr_stack), (expr_stack_size * sizeof (EXPR_CONTEXT *)), "expr.c", 268); } context = (EXPR_CONTEXT *)sh_xmalloc((sizeof (EXPR_CONTEXT)), "expr.c", 271); context->expression = expression; do { (context)->curtok = curtok; (context)->lasttok = lasttok; (context)->tp = tp; (context)->lasttp = lasttp; (context)->tokval = tokval; (context)->tokstr = tokstr; (context)->noeval = noeval; (context)->lval = curlval; } while (0); expr_stack[expr_depth++] = context; }
void pushexp(void) { undefined8 uVar1; undefined4 *puVar2; long lVar3; if (0x3ff < expr_depth) { uVar1 = gettext("expression recursion level exceeded"); evalerror(uVar1); } if (expr_stack_size <= expr_depth) { expr_stack_size = expr_stack_size + 10; expr_stack = sh_xrealloc(expr_stack,(long)expr_stack_size * 8,"expr.c",0x10c); } puVar2 = (undefined4 *)sh_xmalloc(0x58,"expr.c",0x10f); *(undefined8 *)(puVar2 + 2) = expression; *puVar2 = curtok; puVar2[1] = lasttok; *(undefined8 *)(puVar2 + 4) = tp; *(undefined8 *)(puVar2 + 6) = lasttp; *(undefined8 *)(puVar2 + 8) = tokval; *(undefined8 *)(puVar2 + 10) = tokstr; puVar2[0xc] = noeval; uVar1 = curlval._8_8_; *(undefined8 *)(puVar2 + 0xe) = curlval._0_8_; *(undefined8 *)(puVar2 + 0x10) = uVar1; uVar1 = curlval._24_8_; *(undefined8 *)(puVar2 + 0x12) = curlval._16_8_; *(undefined8 *)(puVar2 + 0x14) = uVar1; lVar3 = (long)expr_depth; expr_depth = expr_depth + 1; *(undefined4 **)(expr_stack + lVar3 * 8) = puVar2; return; }
int addr_invert(struct xaddr *n) { int i; if (n == ((void *)0) ) return -1; switch (n->af) { case 2 : n->xa.v4.s_addr = ~n->xa.v4.s_addr; return 0; case 10 : for (i = 0; i < 4; i++) n->xa.addr32[i] = ~n->xa.addr32[i]; return 0; default: return -1; } }
undefined8 addr_invert(short *param_1) { undefined8 uVar1; int local_c; if (param_1 == (short *)0x0) { uVar1 = 0xffffffff; } else if (*param_1 == 2) { *(uint *)(param_1 + 2) = ~*(uint *)(param_1 + 2); uVar1 = 0; } else if (*param_1 == 10) { for (local_c = 0; local_c < 4; local_c = __addvsi3(local_c,1)) { *(uint *)(param_1 + (long)local_c * 2 + 2) = ~*(uint *)(param_1 + (long)local_c * 2 + 2); } uVar1 = 0; } else { uVar1 = 0xffffffff; } return uVar1; }
static void append_to_list (struct gnutls_serv_list *list, const char *name, const char *arg) { const char **tmp; size_t new_count = xsum (list->count, 1); if (((new_count) == (18446744073709551615UL) )) error ( 1 , 0, "too many arguments for %s", name); tmp = reallocarray (list->args, new_count, sizeof (char *)); if (!tmp) error ( 1 , 0, "unable to allocate memory for %s", name); list->args = tmp; list->args[list->count] = optarg; list->count = new_count; }
void append_to_list(struct_0 *a0, unsigned long a1, unsigned long a2) { unsigned long v0; unsigned long v1; unsigned int v2; unsigned long v3; struct_0 *v5; v1 = a1; v0 = a2; *(&v2) = xsum(a0->field_8, 0x1); if (*(&v2) == -1) error(0x1, 0x0, "too many arguments for %s"); v3 = reallocarray(a0->field_0, *(&v2), 0x8); if (!v3) error(0x1, 0x0, "unable to allocate memory for %s"); a0->field_0 = v3; *((a0->field_0 + a0->field_8 * 8)) = *(got.optarg); v5 = a0; a0->field_8 = *(&v2); return; }
static int getentropy_phdr(struct dl_phdr_info *info, size_t size, void *data) { SHA512_CTX *ctx = data; SHA512Update (ctx, (uint8_t *)&info->dlpi_addr, sizeof (info->dlpi_addr)); return (0); }
long getentropy_phdr(struct dl_phdr_info *a1, size_t a2, void *a3) { SHA512Update(a3, a1, 8LL); return 0LL; }
0 ) do { fprintf ( stderr , gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
int fprintf(FILE *__stream,char *__format,...) { halt_baddata(); }
0 ) { fprintf( stderr , "Device and destination are required arguments.\n"); exit(-1); }
int fprintf(FILE *__stream,char *__format,...) { halt_baddata(); }
char * _rl_make_prompt_for_search (int pchar) { int len; char *pmt, *p; rl_save_prompt (); p = rl_prompt ? strrchr (rl_prompt, '\n') : 0; if (p == 0) { len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0; pmt = (char *)xmalloc (len + 2); if (len) strcpy (pmt, rl_prompt); pmt[len] = pchar; pmt[len+1] = '\0'; } else { p++; len = strlen (p); pmt = (char *)xmalloc (len + 2); if (len) strcpy (pmt, p); pmt[len] = pchar; pmt[len+1] = '\0'; } prompt_physical_chars = saved_physical_chars + 1; return pmt; }
long long _rl_make_prompt_for_search(unsigned long a0) { unsigned int v0; char *v1; char *v2; unsigned long v4; rl_save_prompt(); if (!rl_prompt) v4 = 0; else v4 = strrchr(rl_prompt, 0xa); v2 = v4; if (!v2) { if (!rl_prompt || !*(rl_prompt)) *(&v4) = 0; else v4 = strlen(rl_prompt); v0 = v4; v1 = xmalloc(v0 + 2); if (v0) strcpy(v1, rl_prompt); v1[v0] = a0; v1[1 + v0] = 0; } else { v2 += 1; v0 = strlen(v2); v1 = xmalloc(v0 + 2); if (v0) strcpy(v1, v2); v1[v0] = a0; v1[1 + v0] = 0; } prompt_physical_chars = saved_physical_chars + 1; return v1; }