input
stringlengths
28
169k
output
stringlengths
20
317k
static inline void emit_mandatory_arg_note (void) { fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout ) ; }
int emit_mandatory_arg_note() { FILE *v0; char *v1; v0 = stdout; v1 = gettext("\nMandatory arguments to long options are mandatory for short options too.\n"); return fputs_unlocked(v1, v0); }
int print_foreign_arches(const char *const *argv) { struct dpkg_arch *arch; if (*argv) badusage(gettext("--%s takes no arguments"), cipaction->olong); dpkg_arch_load_list(); for (arch = dpkg_arch_get_list(); arch; arch = arch->next) { if (arch->type != DPKG_ARCH_FOREIGN) continue; printf("%s\n", arch->name); } m_output( stdout , gettext("<standard output>")); return 0; }
long long print_foreign_arches(unsigned long long *a0, unsigned long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { struct_0 *v0; unsigned long long v2; unsigned long long v3; if (*(a0)) badusage(gettext("--%s takes no arguments"), *(cipaction)); dpkg_arch_load_list(); for (v0 = dpkg_arch_get_list(v2, *(cipaction), a2, a3, a4, a5); v0; v0 = v0->field_0) { if (v0->field_10 == 6) printf("%s\n", v0->field_8); } v3 = gettext("<standard output>"); m_output(stdout, v3, v3); return 0; }
static void memory_error_and_abort () { fprintf ( stderr , "mkbuiltins: out of virtual memory\n"); abort (); }
void memory_error_and_abort() { fprintf(stderr, "mkbuiltins: out of virtual memory\n"); abort(); }
int array_insert(a, i, v) ARRAY *a; arrayind_t i; char *v; { register ARRAY_ELEMENT *new, *ae, *start; arrayind_t startind; int direction; if (a == 0) return(-1); new = array_create_element(i, v); if (i > ((a)->max_index)) { do { a->head->prev->next = new; new->prev = a->head->prev; a->head->prev = new; new->next = a->head; } while(0); a->max_index = i; a->num_elements++; a->lastref = (new); return(0); } else if (i < ((a)->head->next->ind)) { do { a->head->next->prev = new; new->next = a->head->next; new->prev = a->head; a->head->next = new; } while (0); a->num_elements++; a->lastref = (new); return(0); } start = (a->lastref ? a->lastref : ((a->head)->next)); startind = ((start)->ind); if (i < startind/2) { start = ((a->head)->next); startind = ((start)->ind); direction = 1; } else if (i >= startind) { direction = 1; } else { direction = -1; } for (ae = start; ae != a->head; ) { if (((ae)->ind) == i) { sh_xfree((((ae)->value)), "array.c", 610); ae->value = new->value; new->value = 0; array_dispose_element(new); a->lastref = (ae); return(0); } else if (direction == 1 && ((ae)->ind) > i) { do { ae->prev->next = new; new->prev = ae->prev; ae->prev = new; new->next = ae; } while(0); a->num_elements++; a->lastref = (new); return(0); } else if (direction == -1 && ((ae)->ind) < i) { do { ae->next->prev = new; new->next = ae->next; new->prev = ae; ae->next = new; } while (0); a->num_elements++; a->lastref = (new); return(0); } ae = direction == 1 ? ((ae)->next) : ((ae)->prev); } array_dispose_element(new); a->lastref = 0; return (-1); }
void array_insert(struct_0 *a0, unsigned int a1, char *a2) { unsigned int v0; unsigned long v1; unsigned long long v3; unsigned long long v4[4]; void* v5; void* v6; unsigned long long v7[4]; unsigned long long v8[4]; struct_2 *v9; void* v10; void* v11; unsigned long long v12; void* v13; if (!a0) { v3 = 4294967295; } else { v4 = array_create_element(a1, a2); if (a1 > a0->field_0) { *((a0->field_10->field_18 + 16)) = v4; v4[3] = a0->field_10->field_18; a0->field_10->field_18 = v4; v4[2] = a0->field_10; *(&a0->field_0) = a1; a0->field_8 = a0->field_8 + 1; a0->field_18 = v4; v5 = 0; } else if (a1 < *(a0->field_10->field_10)) { *((a0->field_10->field_10 + 24)) = v4; v4[2] = a0->field_10->field_10; v4[3] = a0->field_10; a0->field_10->field_10 = v4; a0->field_8 = a0->field_8 + 1; a0->field_18 = v4; v6 = 0; } else { if (a0->field_18) v7 = a0->field_18; else v7 = a0->field_10->field_10; v9 = v7; v1 = v7[0]; if (a1 < v1 + (v1 >> 63) >> 1) { v9 = a0->field_10->field_10; v1 = *(a0->field_10->field_10); v0 = 1; } else if (a1 < v1) { v0 = -1; } else { v0 = 1; } while (true) { if (v9 == a0->field_10) { array_dispose_element(v4); a0->field_18 = 0; v12 = 4294967295; break; } else if (a1 == v9->field_0) { sh_xfree(v9->field_8, "array.c", 0x262); v9->field_8 = v4[1]; v4[1] = 0; array_dispose_element(v4); a0->field_18 = v9; v13 = 0; break; } else { if (v0 == 1 && a1 < v9->field_0) { v9->field_18->field_10 = v4; v4[3] = v9->field_18; v9->field_18 = &v4[0]; v4[2] = v9; a0->field_8 = a0->field_8 + 1; a0->field_18 = v4; v10 = 0; break; } if (v0 == -1 && a1 > v9->field_0) { v9->field_10->field_18 = v4; v4[2] = v9->field_10; v4[3] = v9; v9->field_10 = &v4[0]; a0->field_8 = a0->field_8 + 1; a0->field_18 = v4; v11 = 0; break; } if (v0 != 1) v8 = v9->field_18; else v8 = v9->field_10; v9 = v8; } } } } return; }
static void reset_status (void) { int i = columns; COLUMN *p; for (p = column_vector; i; --i, ++p) if (p->status == ON_HOLD) { p->status = OPEN; files_ready_to_read++; } if (storing_columns) { if (column_vector->status == CLOSED) files_ready_to_read = 0; else files_ready_to_read = 1; } }
void reset_status() { unsigned int v0; struct_0 *v1; unsigned long long v3; unsigned long long v4; v0 = columns; for (v1 = column_vector; v0; v1 = &v1[3].padding_0[4]) { if (v1->field_10 == 2) { v1->field_10 = 0; files_ready_to_read = files_ready_to_read + 1; } v0 -= 1; } v3 = storing_columns; if (storing_columns) { v4 = *((column_vector + 16)); if (*((column_vector + 16)) == 3) files_ready_to_read = 0; else files_ready_to_read = 1; } return; }
void app_exit(int val) { if (val != 0) { if (outfile_name) (void)remove(outfile_name); } exit(val); }
void app_exit(unsigned long a0) { if (a0 && outfile_name) remove(outfile_name); exit(a0); }
int _rl_restore_tty_signals (void) { int r; if (tty_sigs_disabled == 0) return 0; r = _set_tty_settings (fileno (rl_instream), &sigstty); if (r == 0) tty_sigs_disabled = 0; return r; }
long long _rl_restore_tty_signals() { unsigned int v0; void* v2; if (!tty_sigs_disabled) { v2 = 0; } else { v0 = _set_tty_settings(fileno(rl_instream), &sigstty); if (!v0) tty_sigs_disabled = 0; v2 = v0; } return v2; }
int write_all(int fd, char *buf, size_t count) { ssize_t ret; int c = 0; while (count > 0) { ret = write(fd, buf, count); if (ret < 0) { if (( (*__errno_location ()) == 11 ) || ( (*__errno_location ()) == 4 )) continue; return -1; } count -= ret; buf += ret; c += ret; } return c; }
long long write_all(unsigned long a0, void* a1, unsigned int a2) { unsigned int v0; void* v1; unsigned int v2; unsigned long v3; unsigned long long v7; v1 = a1; v0 = a2; v2 = 0; while (true) { if (*(&v0)) { v3 = write(a0, v1, *(&v0)); if ((v3 - 0 >> 63)) { if (*(__errno_location()) == 11) continue; if (*(__errno_location()) == 4) continue; v7 = 4294967295; break; } else { *(&v0) = *(&v0) - v3; v1 += v3; v2 += v3; } } else { v7 = v2; break; } } return v7; }
static int ex_len_compar(const void *arg1, const void *arg2) { const struct ext2fs_extent *ex1 = (const struct ext2fs_extent *)arg1; const struct ext2fs_extent *ex2 = (const struct ext2fs_extent *)arg2; if (ex1->e_len < ex2->e_len) return 1; if (ex1->e_lblk > ex2->e_lblk) return -1; return 0; }
long long ex_len_compar(struct_0 *a0, struct_0 *a1) { unsigned long long v1; if (a0->field_10 < a1->field_10) { v1 = 1; } else if (a0->field_8 > a1->field_8) { v1 = 4294967295; } else { v1 = 0; } return v1; }
static void print_usage(FILE *f) { printf("Usage: ip link <options> type vxcan [peer <options>]\n" "To get <options> type 'ip link add help'\n"); }
void print_usage(unsigned long a0) { unsigned long v0; unsigned long long v2; v0 = a0; v2 = printf("Usage: ip link <options> type vxcan [peer <options>]\nTo get <options> type 'ip link add help'\n"); return; }
int is_number(const char *p) { do { if (! ((unsigned)((*p) - '0') <= 9)) return 0; } while (*++p != '\0'); return 1; }
long long is_number(unsigned long a0) { char *v0; unsigned long long v2; v0 = a0; do { if (*(v0) - 48 > 9) { v2 = 0; goto LABEL_4001f4; } v0 += 1; } while (*(v0)); v2 = 1; LABEL_4001f4: return v2; }
static FILE *save_output(const char *s0, const char *s1, const char *s2) { int c, fd, fds[2]; char *cp; pid_t pid; FILE *ret; if (s0 && *s0 == 0) s0 = 0; if (s1 && *s1 == 0) s1 = 0; if (s2 && *s2 == 0) s2 = 0; if (!s0 && !s1 && !s2) return ((void *)0) ; if (pipe(fds) < 0) { perror("pipe"); exit(1); } pid = fork(); if (pid < 0) { perror("fork"); exit(1); } if (pid == 0) { if (e2fsck_global_ctx && e2fsck_global_ctx->progress_fd) close(e2fsck_global_ctx->progress_fd); if (daemon(0, 0) < 0) { perror("daemon"); exit(1); } close(fds[1]); while (do_read(fds[0]) > 0) ; close(fds[0]); fd = -1; while (1) { if (fd < 0 && s0) fd = open(s0, 01 | 0100 | 01000 , 0644); if (fd < 0 && s1) fd = open(s1, 01 | 0100 | 01000 , 0644); if (fd < 0 && s2) fd = open(s2, 01 | 0100 | 01000 , 0644); if (fd >= 0) break; sleep(1); } cp = outbuf; while (outbufsize > 0) { c = write(fd, cp, outbufsize); if (c < 0) { if (( (*__errno_location ()) == 11 ) || ( (*__errno_location ()) == 4 )) continue; break; } outbufsize -= c; cp += c; } exit(0); } close(fds[0]); ret = fdopen(fds[1], "w"); if (!ret) close(fds[1]); return ret; }
FILE * save_output(char *a1, char *a2, char *a3) { char *v4; char *v5; char *file; int fd; __pid_t v8; int v9; char *buf; FILE *v11; int pipedes[2]; unsigned long v13; file = a1; v5 = a2; v4 = a3; v13 = __readfsqword(0x28u); if ( a1 && !*a1 ) file = 0LL; if ( a2 && !*a2 ) v5 = 0LL; if ( a3 && !*a3 ) v4 = 0LL; if ( !file && !v5 && !v4 ) return 0LL; if ( pipe(pipedes) < 0 ) { perror("pipe"); exit(1); } v8 = fork(); if ( v8 < 0 ) { perror("fork"); exit(1); } if ( !v8 ) { if ( e2fsck_global_ctx && *(_DWORD *)(e2fsck_global_ctx + 712LL) ) close(*(_DWORD *)(e2fsck_global_ctx + 712LL)); if ( daemon(0, 0) < 0 ) { perror("daemon"); exit(1); } close(pipedes[1]); while ( (int)do_read(pipedes[0]) > 0 ) ; close(pipedes[0]); fd = -1; while ( 1 ) { if ( file ) fd = open(file, 577, 420LL); if ( fd < 0 && v5 ) fd = open(v5, 577, 420LL); if ( fd < 0 && v4 ) fd = open(v4, 577, 420LL); if ( fd >= 0 ) break; sleep(1u); } buf = (char *)outbuf; while ( outbufsize > 0 ) { v9 = write(fd, buf, outbufsize); if ( v9 >= 0 ) { outbufsize -= v9; buf += v9; } else if ( *_errno_location() != 11 && *_errno_location() != 4 ) { break; } } exit(0); } close(pipedes[0]); v11 = fdopen(pipedes[1], "w"); if ( !v11 ) close(pipedes[1]); return v11; }
int ssh_add_hostkey(struct ssh *ssh, struct sshkey *key) { struct sshkey *pubkey = ((void *)0) ; struct key_entry *k = ((void *)0) , *k_prv = ((void *)0) ; int r; if (ssh->kex->server) { if ((r = sshkey_from_private(key, &pubkey)) != 0) return r; if ((k = malloc(sizeof(*k))) == ((void *)0) || (k_prv = malloc(sizeof(*k_prv))) == ((void *)0) ) { free(k); sshkey_free(pubkey); return -2; } k_prv->key = key; do { (k_prv)->next.tqe_next = ((void *)0) ; (k_prv)->next.tqe_prev = (&ssh->private_keys)->tqh_last; *(&ssh->private_keys)->tqh_last = (k_prv); (&ssh->private_keys)->tqh_last = &(k_prv)->next.tqe_next; } while (0); k->key = pubkey; do { (k)->next.tqe_next = ((void *)0) ; (k)->next.tqe_prev = (&ssh->public_keys)->tqh_last; *(&ssh->public_keys)->tqh_last = (k); (&ssh->public_keys)->tqh_last = &(k)->next.tqe_next; } while (0); r = 0; } else { if ((k = malloc(sizeof(*k))) == ((void *)0) ) return -2; k->key = key; do { (k)->next.tqe_next = ((void *)0) ; (k)->next.tqe_prev = (&ssh->public_keys)->tqh_last; *(&ssh->public_keys)->tqh_last = (k); (&ssh->public_keys)->tqh_last = &(k)->next.tqe_next; } while (0); r = 0; } return r; }
long long ssh_add_hostkey(struct_0 *a0, unsigned long long a1) { unsigned int v0; void* v1; unsigned long long v2[3]; unsigned long long v3[3]; unsigned long long v5; v1 = 0; v2 = 0; v3 = 0; if (!a0->field_8->field_18) { v2[0] = malloc(0x18); if (!v2) { v5 = 4294967294; return v5; } v2[2] = a1; } else { v0 = sshkey_from_private(a1, &v1, &v1); if (v0) { v5 = v0; return v5; } v2[0] = malloc(0x18); if (!(v2) || !((v3[0] = malloc(0x18), v3))) { free(v2); sshkey_free(v1); v5 = 4294967294; return v5; } v3[2] = a1; v3[0] = 0; v3[1] = a0->field_848; a0->field_848->field_0 = v3; a0->field_848 = &v3[0]; v2[2] = v1; } v2[0] = 0; v2[1] = a0->field_858; a0->field_858->field_0 = v2; a0->field_858 = &v2[0]; v0 = 0; v5 = v0; return v5; }
static void print_redirection_list (redirects) REDIRECT *redirects; { REDIRECT *heredocs, *hdtail, *newredir; char *rw; heredocs = (REDIRECT *) ((void *)0) ; hdtail = heredocs; was_heredoc = 0; while (redirects) { if (redirects->instruction == r_reading_until || redirects->instruction == r_deblank_reading_until) { newredir = copy_redirect (redirects); newredir->next = (REDIRECT *) ((void *)0) ; print_heredoc_header (newredir); if (heredocs) { hdtail->next = newredir; hdtail = newredir; } else hdtail = heredocs = newredir; } else print_redirection (redirects); redirects = redirects->next; if (redirects) cprintf (" "); } if (heredocs && printing_connection) deferred_heredocs = heredocs; else if (heredocs) { print_heredoc_bodies (heredocs); dispose_redirects (heredocs); } }
unsigned long print_redirection_list( long a1, long a2, long a3, long a4, long a5, long a6) { unsigned long result; long v7; long v8; long v9; long v10; _QWORD *v12; _QWORD *v13; _QWORD *v14; v12 = 0LL; result = 0LL; v13 = 0LL; was_heredoc = 0; while ( a1 ) { if ( *(_DWORD *)(a1 + 24) == 4 || *(_DWORD *)(a1 + 24) == 8 ) { v14 = (_QWORD *)copy_redirect(a1); *v14 = 0LL; print_heredoc_header((long)v14, a2, v7, v8, v9, v10); if ( v12 ) { a3 = (long)v14; *v13 = v14; } else { v12 = v14; } v13 = v14; } else { print_redirection(a1, a2, a3, a4, a5, a6); } result = *(_QWORD *)a1; a1 = *(_QWORD *)a1; if ( a1 ) result = cprintf(" ", a2, a3, a4, a5, a6); } if ( v12 && (result = (unsigned int)printing_connection, printing_connection) ) { result = (unsigned long)v12; deferred_heredocs = (long)v12; } else if ( v12 ) { print_heredoc_bodies(v12, a2, a3, a4, a5, a6); return dispose_redirects(v12); } return result; }
static int history_def_del(void *p, HistEvent *ev __attribute__((__unused__)), const int num) { history_t *h = (history_t *) p; if (history_def_set(h, ev, num) != 0) return -1; ev->str = strdup(h->cursor->ev.str); ev->num = h->cursor->ev.num; history_def_delete(h, ev, h->cursor); return 0; }
long history_def_del(long a1, long a2, int a3) { if ( (unsigned int)history_def_set(a1, a2, a3) ) return 0xFFFFFFFFLL; *(_QWORD *)(a2 + 8) = strdup(*(const char **)(*(_QWORD *)(a1 + 40) + 8LL)); *(_DWORD *)a2 = **(_DWORD **)(a1 + 40); history_def_delete(a1, a2, *(_QWORD *)(a1 + 40)); return 0LL; }
const char * ssh_local_ipaddr(struct ssh *ssh) { (void)ssh_remote_ipaddr(ssh); return ssh->local_ipaddr; }
long long ssh_local_ipaddr(struct_0 *a0) { ssh_remote_ipaddr(a0); return a0->field_20; }
static char *xfrm_policy_to_str(uint8_t policy) { switch (policy) { case 0: return "unspec"; case 1: return "block"; case 2: return "accept"; default: return "unknown"; } }
int xfrm_policy_to_str(unsigned long a0) { unsigned int v1; switch (a0) { case 2: v1 = &g_404d78; return v1; case 0: v1 = &g_404d7f; return v1; case 1: v1 = &g_404953; return v1; default: v1 = &g_4049e6; return v1; } }
static _Bool xheader_protected_keyword_p (const char *keyword) { struct xhdr_tab const *p; for (p = xhdr_tab; p->keyword; p++) if (!p->prefix && (p->flags & 0x01) && strcmp (p->keyword, keyword) == 0) return 1 ; return 0 ; }
int xheader_protected_keyword_p(char *a0) { unsigned long long v0; unsigned int v2; v0 = &xhdr_tab; while (true) { if (!*(v0)) { v2 = 0; break; } else { if ((*((v0 + 28)) ^ 1) && (*((v0 + 24)) & 1) && !strcmp(*(v0), a0)) { v2 = 1; break; } v0 += 32; } } return v2; }
static void chan_set_istate(Channel *c, u_int next) { if (c->istate > 3 || next > 3) sshfatal("nchan.c", __func__, 96, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "chan_set_istate: bad state %d -> %d", c->istate, next); sshlog("nchan.c", __func__, 97, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "channel %d: input %s -> %s", c->self, istates[c->istate], istates[next]) ; c->istate = next; }
void chan_set_istate(unsigned long a0, unsigned long a1) { unsigned long v0; unsigned long long v1; unsigned long v2; unsigned int v3[5]; unsigned long v4; char v5; unsigned long long v6; char v7; unsigned int v8[5]; v3 = a0; if (v3->field_10 > 3 || a1 > 3) { v0 = a1; sshfatal("nchan.c", "chan_set_istate", 0x60, 0x0, 0x1, 0x0, "chan_set_istate: bad state %d -> %d", v3->field_10); } v4 = (&istates)[a1]; *(&v3[0]) = (&istates)[v3->field_10]; v2 = v3[1]; v1 = "channel %d: input %s -> %s"; sshlog("nchan.c", "chan_set_istate", 0x61, 0x0, 0x6, 0x0, *(&v5), v6, *(&v7)); v8 = v3; v3[4] = *((&v2 + 4)); return; }
void array_dispose_element(ae) ARRAY_ELEMENT *ae; { if (ae) { do { if (ae->value) sh_xfree((ae->value), "array.c", 542); } while (0); sh_xfree((ae), "array.c", 543); } }
void array_dispose_element(struct_0 *a0) { unsigned long long v1; if (a0) { if (a0->field_8) sh_xfree(a0->field_8, "array.c", 0x21e); v1 = sh_xfree(a0, "array.c", 0x21f); } return; }
static char * run_case_conv (enum case_ctl_type case_ctl, char *ptr, size_t size) { static char *case_ctl_buffer; static size_t case_ctl_bufsize; char *p; if (case_ctl_bufsize < size) { case_ctl_bufsize = size; case_ctl_buffer = xrealloc (case_ctl_buffer, case_ctl_bufsize); } memcpy (case_ctl_buffer, ptr, size); switch (case_ctl) { case ctl_upcase_next: case_ctl_buffer[0] = toupper ((unsigned char) case_ctl_buffer[0]); break; case ctl_locase_next: case_ctl_buffer[0] = tolower ((unsigned char) case_ctl_buffer[0]); break; case ctl_upcase: for (p = case_ctl_buffer; p < case_ctl_buffer + size; p++) *p = toupper ((unsigned char) *p); break; case ctl_locase: for (p = case_ctl_buffer; p < case_ctl_buffer + size; p++) *p = tolower ((unsigned char) *p); break; case ctl_stop: break; } return case_ctl_buffer; }
int run_case_conv(unsigned long a0, void* a1, unsigned long a2) { char *v0; if (a2 > case_ctl_bufsize.7053) { case_ctl_bufsize.7053 = a2; case_ctl_buffer.7052 = xrealloc(case_ctl_buffer.7052, case_ctl_bufsize.7053, case_ctl_bufsize.7053); } memcpy(case_ctl_buffer.7052, a1, a2); switch (a0) { case 0: break; case 1: *(case_ctl_buffer.7052) = toupper(*(case_ctl_buffer.7052)); break; case 2: *(case_ctl_buffer.7052) = tolower(*(case_ctl_buffer.7052)); break; case 3: for (v0 = case_ctl_buffer.7052; v0 < a2 + case_ctl_buffer.7052; v0 += 1) { *(v0) = toupper(*(v0)); } case 4: for (v0 = case_ctl_buffer.7052; v0 < a2 + case_ctl_buffer.7052; v0 += 1) { *(v0) = tolower(*(v0)); } } return case_ctl_buffer.7052; }
static struct cstring * remove_line (void) { static struct buffer_record *prev_buf = ((void *)0) ; struct cstring *line; struct line *l; if (prev_buf) { free_buffer (prev_buf); prev_buf = ((void *)0) ; } if (head == ((void *)0) && !load_buffer ()) return ((void *)0) ; if (current_line < head->first_available) current_line = head->first_available; ++(head->first_available); l = head->curr_line; line = &l->starts[l->retrieve_index]; if (++l->retrieve_index == l->used) { head->curr_line = l->next; if (head->curr_line == ((void *)0) || head->curr_line->used == 0) { prev_buf = head; head = head->next; } } return line; }
int remove_line() { unsigned long long v0[164]; unsigned long v1; unsigned int v4; if (prev_buf.6103) { free_buffer(prev_buf.6103); prev_buf.6103 = 0; } if (!head && (load_buffer() ^ 1)) { v4 = 0; goto LABEL_400c20; } if (*((head + 24)) > current_line) current_line = *((head + 24)); *((head + 24)) = *((head + 24)) + 1; v0[0] = *((head + 56)); v1 = &v0[2 + 2 * v0[2] + 1]; v0[2] = v0[2] + 1; if (v0[2] == v0[0]) { *((head + 56)) = v0[163]; if (*((head + 56)) && !(!*(*((head + 56))))) goto LABEL_400c1c; prev_buf.6103 = head; head = *((head + 64)); } LABEL_400c1c: v4 = v1; LABEL_400c20: return v4; }
static int ext4_modify_extent_list(e2fsck_t ctx, struct extent_list *list, struct ext2fs_extent *ex, int del) { int ret, offset; unsigned int i; struct ext2fs_extent add_ex = *ex; for (i = 0; i < list->count; i++) { if (((&list->extents[i])->e_lblk + (&list->extents[i])->e_len - 1) < add_ex.e_lblk) continue; if (list->extents[i].e_lblk > ((&add_ex)->e_lblk + (&add_ex)->e_len - 1)) break; ext2fs_unmark_block_bitmap_range2(ctx->fs->block_map, list->extents[i].e_pblk, list->extents[i].e_len); if (list->extents[i].e_lblk < add_ex.e_lblk && ((&list->extents[i])->e_lblk + (&list->extents[i])->e_len - 1) > ((&add_ex)->e_lblk + (&add_ex)->e_len - 1)) { ret = make_room(list, i + 1); if (ret) return ret; list->extents[i + 1] = list->extents[i]; offset = ((&add_ex)->e_lblk + (&add_ex)->e_len - 1) + 1 - list->extents[i].e_lblk; list->extents[i + 1].e_lblk += offset; list->extents[i + 1].e_pblk += offset; list->extents[i + 1].e_len -= offset; list->extents[i].e_len = add_ex.e_lblk - list->extents[i].e_lblk; break; } if (add_ex.e_lblk <= list->extents[i].e_lblk && ((&list->extents[i])->e_lblk + (&list->extents[i])->e_len - 1) <= ((&add_ex)->e_lblk + (&add_ex)->e_len - 1)) { list->extents[i].e_len = 0; continue; } if (((&list->extents[i])->e_lblk + (&list->extents[i])->e_len - 1) > ((&add_ex)->e_lblk + (&add_ex)->e_len - 1)) { offset = ((&add_ex)->e_lblk + (&add_ex)->e_len - 1) + 1 - list->extents[i].e_lblk; list->extents[i].e_lblk += offset; list->extents[i].e_pblk += offset; list->extents[i].e_len -= offset; break; } if (((&add_ex)->e_lblk + (&add_ex)->e_len - 1) >= ((&list->extents[i])->e_lblk + (&list->extents[i])->e_len - 1)) list->extents[i].e_len = add_ex.e_lblk > list->extents[i].e_lblk ? add_ex.e_lblk - list->extents[i].e_lblk : 0; } if (add_ex.e_len && !del) { make_room(list, list->count); list->extents[list->count - 1] = add_ex; } ex_sort_and_merge(list); for (i = 0; i < list->count; i++) ext2fs_mark_block_bitmap_range2(ctx->fs->block_map, list->extents[i].e_pblk, list->extents[i].e_len); ext2fs_mark_bb_dirty(ctx->fs); return 0; }
void ext4_modify_extent_list(struct struct_4 **a0, struct_3 *a1, unsigned long long a2[3], unsigned long a3) { unsigned int v0; int tmp_209; int tmp_241; int tmp_248; struct_3 *v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned long v5; unsigned long v6; unsigned long v7; unsigned int v9; unsigned long long v10; unsigned long long v11[3]; void* v12; v1 = a1; v0 = a3; v5 = a2[0]; v6 = a2[1]; v7 = a2[2]; v2 = 0; while (true) { if (v2 < a1->field_10 && *((((v2 << 1) + v2 << 3) + a1->field_8 + 16)) + *((((v2 << 1) + v2 << 3) + a1->field_8 + 8)) - 1 >= v6 && *((((v2 << 1) + v2 << 3) + a1->field_8 + 8)) <= v6 + v7 - 1) { ext2fs_unmark_block_bitmap_range2(*(a0)->field_58, *((v2 * 24 + a1->field_8)), *((v2 * 24 + a1->field_8 + 16)), *((v2 * 24 + a1->field_8))); if (*((((v2 << 1) + v2 << 3) + a1->field_8 + 8)) < v6 && *((((v2 << 1) + v2 << 3) + a1->field_8 + 16)) + *((((v2 << 1) + v2 << 3) + a1->field_8 + 8)) - 1 > v6 + v7 - 1) { v3 = make_room(a1, v2 + 1); if (v3) { v10 = v3; break; } else { tmp_209 = a1->field_8 + v2 * 24; tmp_241 = a1->field_8 + (v2 + 1) * 24; tmp_248 = *((a1->field_8 + v2 * 24 + 8)); *((a1->field_8 + (v2 + 1) * 24)) = *((a1->field_8 + v2 * 24)); *((tmp_241 + 8)) = tmp_248; *((tmp_241 + 16)) = *((tmp_209 + 16)); v4 = v6 + v7 - *((v2 * 24 + a1->field_8 + 8)); *(((v2 + 1) * 24 + a1->field_8 + 8)) = v4 + *(((v2 + 1) * 24 + a1->field_8 + 8)); *(((v2 + 1) * 24 + a1->field_8)) = v4 + *(((v2 + 1) * 24 + a1->field_8)); *(((v2 + 1) * 24 + a1->field_8 + 16)) = *(((v2 + 1) * 24 + a1->field_8 + 16)) - v4; *((v2 * 24 + a1->field_8 + 16)) = v6 - *((v2 * 24 + a1->field_8 + 8)); } } } if (...) *((v2 * 24 + a1->field_8 + 16)) = 0; if (...) { if (*((((v2 << 1) + v2 << 3) + a1->field_8 + 16)) + *((((v2 << 1) + v2 << 3) + a1->field_8 + 8)) - 1 > v6 + v7 - 1) { v4 = v6 + v7 - *((v2 * 24 + a1->field_8 + 8)); *((v2 * 24 + a1->field_8 + 8)) = *((v2 * 24 + a1->field_8 + 8)) + v4; *((v2 * 24 + a1->field_8)) = *((v2 * 24 + a1->field_8)) + v4; *((v2 * 24 + a1->field_8 + 16)) = *((v2 * 24 + a1->field_8 + 16)) - v4; } else if (v6 + v7 - 1 >= *((((v2 << 1) + v2 << 3) + a1->field_8 + 16)) + *((((v2 << 1) + v2 << 3) + a1->field_8 + 8)) - 1) { if (v6 > *((((v2 << 1) + v2 << 3) + a1->field_8 + 8))) v9 = v6 - *((v2 * 24 + a1->field_8 + 8)); else v9 = 0; *((v2 * 24 + a1->field_8 + 16)) = v9; } } if (...) { if (v7 && !v0) { make_room(a1, a1->field_10); v11 = a1->field_8 + (a1->field_10 - 1) * 24; *((a1->field_8 + (a1->field_10 - 1) * 24)) = v5; v11[1] = v6; v11[2] = v7; } ex_sort_and_merge(a1); for (v2 = 0; v2 < a1->field_10; v2 += 1) { ext2fs_mark_block_bitmap_range2(*(a0)->field_58, *((v2 * 24 + a1->field_8)), *((v2 * 24 + a1->field_8 + 16)), *((v2 * 24 + a1->field_8))); } ext2fs_mark_bb_dirty(*(a0)); v12 = 0; break; } if (...) v2 += 1; } return; }
void changepath(const char *newval) { const char *new; int idx; int bltin; new = newval; idx = 0; bltin = -1; for (;;) { if (*new == '%' && prefix(new + 1, "builtin")) { bltin = idx; break; } new = strchr(new, ':'); if (!new) break; idx++; new++; } builtinloc = bltin; clearcmdentry(); }
long long changepath(char *a0) { unsigned int v0; unsigned int v1; char *v2; v2 = a0; v0 = 0; v1 = -1; while (true) { if (*(v2) == 37 && prefix(v2 + 1, "builtin")) { v1 = v0; break; } else { v2 = strchr(v2, 0x3a); if (!v2) break; v0 += 1; v2 += 1; } } builtinloc = v1; return clearcmdentry(); }
static void mainSort ( UInt32* ptr, UChar* block, UInt16* quadrant, UInt32* ftab, Int32 nblock, Int32 verb, Int32* budget ) { Int32 i, j, k, ss, sb; Int32 runningOrder[256]; Bool bigDone[256]; Int32 copyStart[256]; Int32 copyEnd [256]; UChar c1; Int32 numQSorted; UInt16 s; if (verb >= 4) fprintf( stderr ," main sort initialise ...\n"); for (i = 65536; i >= 0; i--) ftab[i] = 0; j = block[0] << 8; i = nblock-1; for (; i >= 3; i -= 4) { quadrant[i] = 0; j = (j >> 8) | ( ((UInt16)block[i]) << 8); ftab[j]++; quadrant[i-1] = 0; j = (j >> 8) | ( ((UInt16)block[i-1]) << 8); ftab[j]++; quadrant[i-2] = 0; j = (j >> 8) | ( ((UInt16)block[i-2]) << 8); ftab[j]++; quadrant[i-3] = 0; j = (j >> 8) | ( ((UInt16)block[i-3]) << 8); ftab[j]++; } for (; i >= 0; i--) { quadrant[i] = 0; j = (j >> 8) | ( ((UInt16)block[i]) << 8); ftab[j]++; } for (i = 0; i < (2 + 12 + 18 + 2); i++) { block [nblock+i] = block[i]; quadrant[nblock+i] = 0; } if (verb >= 4) fprintf( stderr ," bucket sorting ...\n"); for (i = 1; i <= 65536; i++) ftab[i] += ftab[i-1]; s = block[0] << 8; i = nblock-1; for (; i >= 3; i -= 4) { s = (s >> 8) | (block[i] << 8); j = ftab[s] -1; ftab[s] = j; ptr[j] = i; s = (s >> 8) | (block[i-1] << 8); j = ftab[s] -1; ftab[s] = j; ptr[j] = i-1; s = (s >> 8) | (block[i-2] << 8); j = ftab[s] -1; ftab[s] = j; ptr[j] = i-2; s = (s >> 8) | (block[i-3] << 8); j = ftab[s] -1; ftab[s] = j; ptr[j] = i-3; } for (; i >= 0; i--) { s = (s >> 8) | (block[i] << 8); j = ftab[s] -1; ftab[s] = j; ptr[j] = i; } for (i = 0; i <= 255; i++) { bigDone [i] = ((Bool)0); runningOrder[i] = i; } { Int32 vv; Int32 h = 1; do h = 3 * h + 1; while (h <= 256); do { h = h / 3; for (i = h; i <= 255; i++) { vv = runningOrder[i]; j = i; while ( (ftab[((runningOrder[j-h])+1) << 8] - ftab[(runningOrder[j-h]) << 8]) > (ftab[((vv)+1) << 8] - ftab[(vv) << 8]) ) { runningOrder[j] = runningOrder[j-h]; j = j - h; if (j <= (h - 1)) goto zero; } zero: runningOrder[j] = vv; } } while (h != 1); } numQSorted = 0; for (i = 0; i <= 255; i++) { ss = runningOrder[i]; for (j = 0; j <= 255; j++) { if (j != ss) { sb = (ss << 8) + j; if ( ! (ftab[sb] & (1 << 21)) ) { Int32 lo = ftab[sb] & (~((1 << 21))); Int32 hi = (ftab[sb+1] & (~((1 << 21)))) - 1; if (hi > lo) { if (verb >= 4) fprintf( stderr ," qsort [0x%x, 0x%x] " "done %d this %d\n",ss,j,numQSorted,hi - lo + 1) ; mainQSort3 ( ptr, block, quadrant, nblock, lo, hi, 2, budget ); numQSorted += (hi - lo + 1); if (*budget < 0) return; } } ftab[sb] |= (1 << 21); } } { if (!(!bigDone[ss])) BZ2_bz__AssertH__fail ( 1006 ); }; { for (j = 0; j <= 255; j++) { copyStart[j] = ftab[(j << 8) + ss] & (~((1 << 21))); copyEnd [j] = (ftab[(j << 8) + ss + 1] & (~((1 << 21)))) - 1; } for (j = ftab[ss << 8] & (~((1 << 21))); j < copyStart[ss]; j++) { k = ptr[j]-1; if (k < 0) k += nblock; c1 = block[k]; if (!bigDone[c1]) ptr[ copyStart[c1]++ ] = k; } for (j = (ftab[(ss+1) << 8] & (~((1 << 21)))) - 1; j > copyEnd[ss]; j--) { k = ptr[j]-1; if (k < 0) k += nblock; c1 = block[k]; if (!bigDone[c1]) ptr[ copyEnd[c1]-- ] = k; } } { if (!((copyStart[ss]-1 == copyEnd[ss]) || (copyStart[ss] == 0 && copyEnd[ss] == nblock-1))) BZ2_bz__AssertH__fail ( 1007 ); } for (j = 0; j <= 255; j++) ftab[(j << 8) + ss] |= (1 << 21); bigDone[ss] = ((Bool)1); if (i < 255) { Int32 bbStart = ftab[ss << 8] & (~((1 << 21))); Int32 bbSize = (ftab[(ss+1) << 8] & (~((1 << 21)))) - bbStart; Int32 shifts = 0; while ((bbSize >> shifts) > 65534) shifts++; for (j = bbSize-1; j >= 0; j--) { Int32 a2update = ptr[bbStart + j]; UInt16 qVal = (UInt16)(j >> shifts); quadrant[a2update] = qVal; if (a2update < (2 + 12 + 18 + 2)) quadrant[a2update + nblock] = qVal; } { if (!(((bbSize-1) >> shifts) <= 65535)) BZ2_bz__AssertH__fail ( 1002 ); }; } } if (verb >= 4) fprintf( stderr ," %d pointers, %d sorted, %d scanned\n",nblock,numQSorted,nblock - numQSorted) ; }
void mainSort(unsigned int *a0, char *a1, unsigned short *a2, unsigned int *a3, unsigned long a4, unsigned long a5, unsigned long long v23) { unsigned int *v0; int tmp_24; char v1; unsigned short v2; unsigned short 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 int v12; unsigned int v13; unsigned int v14; unsigned int v15; unsigned int v16; unsigned int v17; char v18; char v19; char v20; char v21; char v22; unsigned long long *v24; unsigned long long v25; v0 = v23; if (a5 > 3) fprintf(stderr, " main sort initialise ...\n"); for (v4 = 0x10000; v4 >= 0; v4 -= 1) { a3[v4] = 0; } v5 = *(a1) * 0x100; for (v4 = a4 - 1; v4 > 2; v4 -= 4) { a2[v4] = 0; v5 = (a1[v4] * 0x100) | (v5 >> 8); a3[v5] = a3[v5] + 1; a2[1 + v4] = 0; v5 = (a1[1 + v4] * 0x100) | (v5 >> 8); a3[v5] = a3[v5] + 1; a2[2 + v4] = 0; v5 = (a1[2 + v4] * 0x100) | (v5 >> 8); a3[v5] = a3[v5] + 1; a2[3 + v4] = 0; v5 = (a1[3 + v4] * 0x100) | (v5 >> 8); a3[v5] = a3[v5] + 1; } for (; v4 >= 0; v4 -= 1) { a2[v4] = 0; v5 = (a1[v4] * 0x100) | (v5 >> 8); a3[v5] = a3[v5] + 1; } for (v4 = 0; v4 <= 33; v4 += 1) { a1[a4 + v4] = a1[v4]; a2[a4 + v4] = 0; } if (a5 > 3) fprintf(stderr, " bucket sorting ...\n"); for (v4 = 1; v4 <= 0x10000; v4 += 1) { a3[v4] = a3[1 + v4] + a3[v4]; } v2 = *(a1) * 0x100; for (v4 = a4 - 1; v4 > 2; v4 -= 4) { v2 = (a1[v4] * 0x100) | (v2 >> 8); v5 = a3[v2] - 1; a3[v2] = v5; a0[v5] = v4; v2 = (a1[1 + v4] * 0x100) | (v2 >> 8); v5 = a3[v2] - 1; a3[v2] = v5; a0[v5] = v4 - 1; v2 = (a1[2 + v4] * 0x100) | (v2 >> 8); v5 = a3[v2] - 1; a3[v2] = v5; a0[v5] = v4 - 2; v2 = (a1[3 + v4] * 0x100) | (v2 >> 8); v5 = a3[v2] - 1; a3[v2] = v5; a0[v5] = v4 - 3; } for (; v4 >= 0; v4 -= 1) { v2 = (a1[v4] * 0x100) | (v2 >> 8); v5 = a3[v2] - 1; a3[v2] = v5; a0[v5] = v4; } for (v4 = 0; v4 <= 255; v4 += 1) { (&v21)[v4] = 0; *(&(&v18)[4 * v4]) = v4; } v8 = 1; do { v8 = v8 * 3 + 1; } while (v8 <= 0x100); do { v8 = (v8 * 1431655766 >> 32) - (v8 >> 31); for (v4 = v8; v4 <= 255; v4 += 1) { v17 = *(&(&v18)[4 * v4]); v5 = v4; while (a3[0x100 + 0x100 * *(&(&v18)[4 * v5 + -4 * v8])] - a3[0x100 * *(&(&v18)[4 * v5 + -4 * v8])] > a3[0x100 + 0x100 * v17] - a3[0x100 * v17]) { *(&(&v18)[4 * v5]) = *(&(&v18)[4 * v5 + -4 * v8]); v5 -= v8; if (v8 > v5) break; } *(&(&v18)[4 * v5]) = v17; } } while (v8 != 1); v7 = 0; v4 = 0; while (true) { if (v4 <= 255) { v10 = *(&(&v18)[4 * v4]); v5 = 0; while (true) { if (v5 <= 255) { if (v5 != v10) { v14 = v5 + (v10 * 0x100); if (!(a3[v14] & 0x200000)) { v15 = a3[v14] & -2097153; v16 = (a3[1 + v14] & -2097153) - 1; if (v16 > v15) { if (a5 > 3) fprintf(stderr, " qsort [0x%x, 0x%x] done %d this %d\n", v10, v5, v7, v16 - v15 + 1); mainQSort3(a0, a1, a2, a4, v15, v16, 0x2, v0); v7 += v16 - v15 + 1; if (*(v0) < 0) break; } } if (*(v0) >= 0) a3[v14] = a3[v14] | 0x200000; } v5 += 1; } else { if ((&v21)[v10]) BZ2_bz__AssertH__fail(0x3ee); for (v5 = 0; v5 <= 255; v5 += 1) { *(&(&v19)[4 * v5]) = a3[0x100 * v5 + v10] & -2097153; *(&(&v20)[4 * v5]) = (a3[1 + 0x100 * v5 + v10] & -2097153) - 1; } for (v5 = a3[0x100 * v10] & -2097153; v5 < *(&(&v19)[4 * v10]); v5 += 1) { v6 = a0[v5] - 1; if (v6 < 0) v6 += a4; v1 = a1[v6]; if (!(&v21)[v1]) { tmp_24 = *(&(&v19)[4 * v1]); *(&(&v19)[4 * v1]) = *(&(&v19)[4 * v1]) + 1; a0[tmp_24] = v6; } } for (v5 = (a3[0x100 + 0x100 * v10] & -2097153) - 1; v5 > *(&(&v20)[4 * v10]); v5 -= 1) { v6 = a0[v5] - 1; if (v6 < 0) v6 += a4; v1 = a1[v6]; if (!(&v21)[v1]) { tmp_24 = *(&(&v20)[4 * v1]); *(&(&v20)[4 * v1]) = *(&(&v20)[4 * v1]) - 1; a0[tmp_24] = v6; } } if (*(&(&v19)[4 * v10]) - 1 != *(&(&v20)[4 * v10]) && (*(&(&v20)[4 * v10]) != a4 - 1 || *(&(&v19)[4 * v10]))) BZ2_bz__AssertH__fail(0x3ef); for (v5 = 0; v5 <= 255; v5 += 1) { a3[0x100 * v5 + v10] = a3[0x100 * v5 + v10] | 0x200000; } (&v21)[v10] = 1; if (v4 <= 254) { v11 = a3[0x100 * v10] & -2097153; v12 = (a3[0x100 + 0x100 * v10] & -2097153) - v11; for (v9 = 0; (v12 >> (v9 & 31)) > 65534; v9 += 1); for (v5 = v12 - 1; v5 >= 0; v5 -= 1) { v13 = a0[v11 + v5]; v3 = v5 >> (v9 & 31); a2[v13] = v3; if (v13 <= 33) a2[v13 + a4] = v3; } if ((v12 - 1 >> (v9 & 31)) > 65535) BZ2_bz__AssertH__fail(0x3ea); } v4 += 1; break; } } if (*(v0) < 0 && !(a3[v14] & 0x200000) && v5 <= 255 && v16 > v15 && v5 != v10) break; } else { if (a5 <= 3) break; if (a5 > 3) { fprintf(stderr, " %d pointers, %d sorted, %d scanned\n", a4, v7, a4 - v7); break; } } } v25 = *(&v22) - v24[5]; return; }
int sshkey_load_private_cert(int type, const char *filename, const char *passphrase, struct sshkey **keyp) { struct sshkey *key = ((void *)0) , *cert = ((void *)0) ; int r; if (keyp != ((void *)0) ) *keyp = ((void *)0) ; switch (type) { case KEY_RSA: case KEY_DSA: case KEY_ECDSA: case KEY_ED25519: case KEY_XMSS: case KEY_UNSPEC: break; default: return -14; } if ((r = sshkey_load_private_type(type, filename, passphrase, &key, ((void *)0) )) != 0 || (r = sshkey_load_cert(filename, &cert)) != 0) goto out; if (sshkey_equal_public(key, cert) == 0) { r = -45; goto out; } if ((r = sshkey_to_certified(key)) != 0 || (r = sshkey_cert_copy(cert, key)) != 0) goto out; r = 0; if (keyp != ((void *)0) ) { *keyp = key; key = ((void *)0) ; } out: sshkey_free(key); sshkey_free(cert); return r; }
int sshkey_load_private_cert(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 *param_4) { int iVar1; long in_FS_OFFSET; int local_24; undefined8 local_20; undefined8 local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_20 = 0; local_18 = 0; if (param_4 != (undefined8 *)0x0) { *param_4 = 0; } if ((param_1 < 0xf) && ((1 << ((byte)param_1 & 0x3f) & 0x410fU) != 0)) { local_24 = sshkey_load_private_type(param_1,param_2,param_3,&local_20,0); if ((local_24 == 0) && (local_24 = sshkey_load_cert(param_2,&local_18), local_24 == 0)) { iVar1 = sshkey_equal_public(local_20,local_18); if (iVar1 == 0) { local_24 = -0x2d; } else { local_24 = sshkey_to_certified(local_20); if (((local_24 == 0) && (local_24 = sshkey_cert_copy(local_18,local_20), local_24 == 0)) && (local_24 = 0, param_4 != (undefined8 *)0x0)) { *param_4 = local_20; local_20 = 0; } } } sshkey_free(local_20); sshkey_free(local_18); } else { local_24 = -0xe; } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return local_24; } __stack_chk_fail(); }
static int bash_complete_command (ignore, ignore2) int ignore, ignore2; { return bash_complete_command_internal (rl_completion_mode (bash_complete_command)); }
long bash_complete_command() { unsigned int v0; v0 = rl_completion_mode(bash_complete_command); return bash_complete_command_internal(v0); }
static _Bool print_it (char const *format, int fd, char const *filename, _Bool (*print_func) (char *, size_t, char, char, int, char const *, void const *), void const *data) { _Bool fail = 0 ; enum { MAX_ADDITIONAL_BYTES = ( ((( sizeof "l" "d")>(((( sizeof "l" "o")>(((( sizeof "l" "u")>( sizeof "l" "x"))?( sizeof "l" "u"):( sizeof "l" "x"))))?( sizeof "l" "o"):(((( sizeof "l" "u")>( sizeof "l" "x"))?( sizeof "l" "u"):( sizeof "l" "x"))))))?( sizeof "l" "d"):(((( sizeof "l" "o")>(((( sizeof "l" "u")>( sizeof "l" "x"))?( sizeof "l" "u"):( sizeof "l" "x"))))?( sizeof "l" "o"):(((( sizeof "l" "u")>( sizeof "l" "x"))?( sizeof "l" "u"):( sizeof "l" "x")))))) - 1) }; size_t n_alloc = strlen (format) + MAX_ADDITIONAL_BYTES + 1; char *dest = xmalloc (n_alloc); char const *b; for (b = format; *b; b++) { switch (*b) { case '%': { size_t len = format_code_offset (b); char fmt_char = *(b + len); char mod_char = 0; memcpy (dest, b, len); b += len; switch (fmt_char) { case '\0': --b; __attribute__ ((__fallthrough__)); case '%': if (1 < len) { dest[len] = fmt_char; dest[len + 1] = '\0'; ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"%s: invalid directive\"), quote (dest)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("%s: invalid directive"), quote (dest)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("%s: invalid directive"), quote (dest)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; } putchar_unlocked ('%'); break; case 'H': case 'L': mod_char = fmt_char; fmt_char = *(b + 1); if (print_func == print_stat && (fmt_char == 'd' || fmt_char == 'r')) { b++; } else { fmt_char = mod_char; mod_char = 0; } __attribute__ ((__fallthrough__)); default: fail |= print_func (dest, len, mod_char, fmt_char, fd, filename, data); break; } break; } case '\\': if ( ! interpret_backslash_escapes) { putchar_unlocked ('\\'); break; } ++b; if (('0' <= (*b) && (*b) <= '7')) { int esc_value = ((*b) - '0'); int esc_length = 1; for (++b; esc_length < 3 && ('0' <= (*b) && (*b) <= '7'); ++esc_length, ++b) { esc_value = esc_value * 8 + ((*b) - '0'); } putchar_unlocked (esc_value); --b; } else if (*b == 'x' && ((*__ctype_b_loc ())[(int) (( to_uchar (b[1]) ))] & (unsigned short int) _ISxdigit) ) { int esc_value = ((b[1]) >= 'a' && (b[1]) <= 'f' ? (b[1]) - 'a' + 10 : (b[1]) >= 'A' && (b[1]) <= 'F' ? (b[1]) - 'A' + 10 : (b[1]) - '0'); ++b; if ( ((*__ctype_b_loc ())[(int) (( to_uchar (b[1]) ))] & (unsigned short int) _ISxdigit) ) { ++b; esc_value = esc_value * 16 + ((*b) >= 'a' && (*b) <= 'f' ? (*b) - 'a' + 10 : (*b) >= 'A' && (*b) <= 'F' ? (*b) - 'A' + 10 : (*b) - '0'); } putchar_unlocked (esc_value); } else if (*b == '\0') { error (0, 0, gettext ("warning: backslash at end of format")); putchar_unlocked ('\\'); --b; } else { print_esc_char (*b); } break; default: putchar_unlocked (*b); break; } } free (dest); fputs_unlocked (trailing_delim, stdout ); return fail; }
int print_it(unsigned long a0, unsigned long a1, unsigned long long a2, unsigned long a3, unsigned long a4) { unsigned long v0; unsigned long v1; char v2; char v3; char v4; unsigned int v5; unsigned int v6; unsigned int v7; char *v8; unsigned long long v9; char v10[2]; char v11[2]; unsigned short v14; unsigned int v15; unsigned int v16; unsigned int v19; unsigned long long v20; unsigned long long v21; v1 = a3; v2 = 0; v9 = strlen(a0) + 3; *(&v10) = xmalloc(v9); *(&v8) = a0; while (true) { if (v8[0]) { if (v8[0] == 37) { *(&v11) = format_code_offset(v8); v3 = *((v11 + v8)); v4 = 0; memcpy(v10, v8, v11); v8 += v11; if (v3 != 76 && v3 <= 76 && v3 != 72 && v3 <= 72) { if (!v3) v8 = &v8->field_1; if (v3 == 37 || !v3) { if (v11 > 1) { *((v10 + v11)) = v3; *((v10 + &v11[1])) = 0; v21 = quote(v10); error(0x1, 0x0, gettext("%s: invalid directive")); } putchar_unlocked(0x25); } } if ((v3 == 76 || v3 <= 76) && (v3 == 76 || v3 == 72)) { v4 = v3; v3 = v8->field_1; if (a3 == print_stat && (v3 == 100 || v3 == 114)) v8 = &v8->field_1; if (a3 != print_stat || v3 != 100 && v3 != 114) { v3 = v4; v4 = 0; } } if ((v3 == 76 || v3 == 72 || v3 != 37 || v3 > 72 || v3 > 76) && (v3 == 76 || v3 == 72 || v3 || v3 > 72 || v3 > 76)) { v0 = a4; v2 = ((stack_base)[104](v10, v11, v4, v3, a1, a2) | v2); } } else if (v8[0] != 92) { putchar_unlocked(v8[0]); } else if ((interpret_backslash_escapes ^ 1)) { putchar_unlocked(0x5c); } else { v8 = &v8->field_1; if (v8[0] > 47 && v8[0] <= 55) { v5 = v8[0] - 48; v6 = 1; for (v8 = &v8->field_1; v6 <= 2; v8 = &v8->field_1) { if (*(v8) <= 47) break; if (v8[0] > 47) { if (*(v8) > 55) break; } v5 = v8[0] - 48 + (v5 * 8); v6 += 1; } putchar_unlocked(v5); v8 = &v8->field_1; } if ((*(v8) <= 47 || *(v8) > 55) && v8[0] == 120) { v14 = *((to_uchar(v8[1]) * 2 + *(__ctype_b_loc()))); v15 = v14 & 0x1000; if (v15) { if (v8[1] > 96 && v8[1] <= 102) v16 = v8[1] - 87; if (v8[1] <= 96 || v8[1] > 102) { if (v8[1] > 64 && v8[1] <= 70) v16 = v8[1] - 55; if (v8[1] <= 64 || v8[1] > 70) v16 = v8[1] - 48; } v7 = v16; v8 = &v8->field_1; *(&v16) = *((to_uchar(v8[1]) * 2 + *(__ctype_b_loc()))); v19 = v16 & 0x1000; if (v19) { v8 = &v8->field_1; if (*(v8) > 96 && *(v8) <= 102) v20 = *(v8) - 87; if (*(v8) <= 96 || *(v8) > 102) { if (*(v8) > 64 && *(v8) <= 70) v20 = *(v8) - 55; if (*(v8) <= 64 || *(v8) > 70) v20 = *(v8) - 48; } *(&v20) = v20 + v7 * 16; v7 = v20; } putchar_unlocked(v7); } } if (*(v8) <= 47 && !v15 || *(v8) <= 47 && v8[0] != 120 || !v15 && *(v8) > 55 || v8[0] != 120 && *(v8) > 55) { if (!v8[0]) { error(0x0, 0x0, gettext("warning: backslash at end of format")); putchar_unlocked(0x5c); v8 = &v8->field_1; } else { print_esc_char(v8[0]); } } } if (v11 <= 1) v8 = &v8->field_1; } else { free(v10); fputs_unlocked(trailing_delim, stdout); return v2; } } }
static int depmod_calculate_dependencies(struct depmod *depmod) { const struct mod **itrm; uint16_t *users, *roots, *sorted; uint16_t i, n_roots = 0, n_sorted = 0, n_mods = depmod->modules.count; int ret = 0; users = malloc(sizeof(uint16_t) * n_mods * 3); if (users == ((void *)0) ) return - 12 ; roots = users + n_mods; sorted = roots + n_mods; log_printf( 7 , "calculate dependencies and ordering (%hu modules)\n", n_mods); ((void) sizeof (( depmod->modules.count < (65535)) ? 1 : 0), __extension__ ({ if ( depmod->modules.count < (65535)) ; else __assert_fail ( "depmod->modules.count < UINT16_MAX" , "tools/depmod.c", 1954, __extension__ __PRETTY_FUNCTION__); })) ; itrm = (const struct mod **)depmod->modules.array; for (i = 0; i < n_mods; i++, itrm++) { const struct mod *m = *itrm; users[i] = m->users; if (users[i] == 0) { roots[n_roots] = i; n_roots++; } } while (n_roots > 0) { const struct mod **itr_dst, **itr_dst_end; struct mod *src; uint16_t src_idx = roots[--n_roots]; src = depmod->modules.array[src_idx]; src->dep_sort_idx = n_sorted; sorted[n_sorted] = src_idx; n_sorted++; itr_dst = (const struct mod **)src->deps.array; itr_dst_end = itr_dst + src->deps.count; for (; itr_dst < itr_dst_end; itr_dst++) { const struct mod *dst = *itr_dst; uint16_t dst_idx = dst->idx; ((void) sizeof (( users[dst_idx] > 0 ) ? 1 : 0), __extension__ ({ if ( users[dst_idx] > 0 ) ; else __assert_fail ( "users[dst_idx] > 0" , "tools/depmod.c", 1983, __extension__ __PRETTY_FUNCTION__); })) ; users[dst_idx]--; if (users[dst_idx] == 0) { roots[n_roots] = dst_idx; n_roots++; } } } if (n_sorted < n_mods) { depmod_report_cycles(depmod, n_mods, users); ret = - 22 ; goto exit; } depmod_sort_dependencies(depmod); log_printf( 7 , "calculated dependencies and ordering (%hu modules)\n", n_mods); exit: free(users); return ret; }
int depmod_calculate_dependencies(unsigned long long a0[4], unsigned long a1, unsigned long a2, unsigned long long a3, unsigned long long a4) { unsigned short v0; unsigned short v1; unsigned short v2; unsigned short v3; unsigned short v4; unsigned short v5; unsigned int v6; unsigned long long *v7; unsigned long long *v8; unsigned short *v9; unsigned short *v10; unsigned short *v11; struct_1 *v12; unsigned long v13; struct_0 *v14; struct_2 *v15; unsigned int v17; v1 = 0; v2 = 0; v3 = a0[3]; v6 = 0; v9 = malloc(v3 * 6); if (!v9) { v17 = -12; } else { v10 = &v9[v3]; v11 = &v10[v3]; log_printf(0x7, "calculate dependencies and ordering (%hu modules)\n", v3, a3, a4); if (a0[3] > 65534) __assert_fail(); v7 = a0[2]; for (v0 = 0; [D] amd64g_calculate_condition(0x2<64>, 0x6<64>, Conv(16->64, Load(addr=stack_base-92, size=2, endness=Iend_LE)), Conv(16->64, Load(addr=stack_base-90, size=2, endness=Iend_LE)), cc_ndep<8>); v7 += 1) { v15 = *(v7); v9[v0] = v15->field_6a; if (!v9[v0]) { v10[v1] = v0; v1 += 1; } v0 += 1; } while (v1) { v1 -= 1; v4 = v10[v1]; v12 = *((a0[2] + v4 * 8)); v12->field_64 = v2; v11[v2] = v4; v2 += 1; v8 = v12->field_30; for (v13 = &v8[v12->field_38]; v8 < v13; v8 += 1) { v14 = *(v8); v5 = v14->field_68; if (!v9[v5]) __assert_fail(); v9[v5] = v9[v5] - 1; if (!v9[v5]) { v10[v1] = v5; v1 += 1; } } } if ([D] amd64g_calculate_condition(0x2<64>, 0x6<64>, Conv(16->64, Load(addr=stack_base-92, size=2, endness=Iend_LE)), Conv(16->64, Load(addr=stack_base-90, size=2, endness=Iend_LE)), cc_ndep<8>)) { depmod_report_cycles(a0, v3, v9, v3, a4); v6 = -22; } else { depmod_sort_dependencies(a0); log_printf(0x7, "calculated dependencies and ordering (%hu modules)\n", v3, a3, a4); } free(v9); v17 = v6; } if (!v9 || a0[3] <= 65534) return v17; }
void coproc_init (cp) struct coproc *cp; { cp->c_name = 0; cp->c_pid = (pid_t)-1; cp->c_rfd = cp->c_wfd = -1; cp->c_rsave = cp->c_wsave = -1; cp->c_flags = cp->c_status = cp->c_lock = 0; }
void coproc_init(struct_0 *a0) { char v0; struct_0 *v2; unsigned long long v3; a0->field_0 = 0; a0->field_8 = -1; a0->field_10 = -1; a0->field_c = a0->field_10; a0->field_18 = -1; a0->field_14 = a0->field_18; a0->field_24 = 0; a0->field_20 = a0->field_24; v2 = a0; a0->field_1c = a0->field_20; v3 = *(&v0); return; }
int inflateGetHeader(strm, head) z_streamp strm; gz_headerp head; { struct inflate_state *state; if (inflateStateCheck(strm)) return (-2); state = (struct inflate_state *)strm->state; if ((state->wrap & 2) == 0) return (-2); state->head = head; head->done = 0; return 0; }
long inflateGetHeader(_QWORD *a1, long a2) { long v3; if ( inflateStateCheck(a1) ) return 4294967294LL; v3 = a1[7]; if ( (*(_DWORD *)(v3 + 16) & 2) == 0 ) return 4294967294LL; *(_QWORD *)(v3 + 48) = a2; *(_DWORD *)(a2 + 72) = 0; return 0LL; }
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]... [-T] SOURCE DEST\n or: %s [OPTION]... SOURCE... DIRECTORY\n or: %s [OPTION]... -t DIRECTORY SOURCE...\n") , program_name, program_name, program_name); fputs_unlocked (gettext ("Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n"), stdout ) ; emit_mandatory_arg_note (); fputs_unlocked (gettext (" -a, --archive same as -dR --preserve=all\n --attributes-only don't copy the file data, just the attributes\n --backup[=CONTROL] make a backup of each existing destination file\n -b like --backup but does not accept an argument\n --copy-contents copy contents of special files when recursive\n -d same as --no-dereference --preserve=links\n"), stdout ) ; fputs_unlocked (gettext (" -f, --force if an existing destination file cannot be\n opened, remove it and try again (this option\n is ignored when the -n option is also used)\n -i, --interactive prompt before overwrite (overrides a previous -n\n option)\n -H follow command-line symbolic links in SOURCE\n"), stdout ) ; fputs_unlocked (gettext (" -l, --link hard link files instead of copying\n -L, --dereference always follow symbolic links in SOURCE\n"), stdout ) ; fputs_unlocked (gettext (" -n, --no-clobber do not overwrite an existing file (overrides\n a previous -i option)\n -P, --no-dereference never follow symbolic links in SOURCE\n"), stdout ) ; fputs_unlocked (gettext (" -p same as --preserve=mode,ownership,timestamps\n --preserve[=ATTR_LIST] preserve the specified attributes (default:\n mode,ownership,timestamps), if possible\n additional attributes: context, links, xattr,\n all\n"), stdout ) ; fputs_unlocked (gettext (" --no-preserve=ATTR_LIST don't preserve the specified attributes\n --parents use full source file name under DIRECTORY\n"), stdout ) ; fputs_unlocked (gettext (" -R, -r, --recursive copy directories recursively\n --reflink[=WHEN] control clone/CoW copies. See below\n --remove-destination remove each existing destination file before\n attempting to open it (contrast with --force)\n"), stdout ) ; fputs_unlocked (gettext (" --sparse=WHEN control creation of sparse files. See below\n --strip-trailing-slashes remove any trailing slashes from each SOURCE\n argument\n"), stdout ) ; fputs_unlocked (gettext (" -s, --symbolic-link make symbolic links instead of copying\n -S, --suffix=SUFFIX override the usual backup suffix\n -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY\n -T, --no-target-directory treat DEST as a normal file\n"), stdout ) ; fputs_unlocked (gettext (" -u, --update copy only when the SOURCE file is newer\n than the destination file or when the\n destination file is missing\n -v, --verbose explain what is being done\n -x, --one-file-system stay on this file system\n"), stdout ) ; fputs_unlocked (gettext (" -Z set SELinux security context of destination\n file to default type\n --context[=CTX] like -Z, or if CTX is specified then set the\n SELinux or SMACK security context to CTX\n"), stdout ) ; fputs_unlocked (gettext (" --help display this help and exit\n"), stdout ); fputs_unlocked (gettext (" --version output version information and exit\n"), stdout ); fputs_unlocked (gettext ("\nBy default, sparse SOURCE files are detected by a crude heuristic and the\ncorresponding DEST file is made sparse as well. That is the behavior\nselected by --sparse=auto. Specify --sparse=always to create a sparse DEST\nfile whenever the SOURCE file contains a long enough sequence of zero bytes.\nUse --sparse=never to inhibit creation of sparse files.\n"), stdout ) ; fputs_unlocked (gettext ("\nWhen --reflink[=always] is specified, perform a lightweight copy, where the\ndata blocks are copied only when modified. If this is not possible the copy\nfails, or if --reflink=auto is specified, fall back to a standard copy.\nUse --reflink=never to ensure a standard copy is performed.\n"), stdout ) ; emit_backup_suffix_note (); fputs_unlocked (gettext ("\nAs a special case, cp makes a backup of SOURCE when the force and backup\noptions are given and SOURCE and DEST are the same name for an existing,\nregular file.\n"), stdout ) ; emit_ancillary_info ("cp"); } exit (status); }
void usage(unsigned long a0) { unsigned long v0; unsigned long v1; unsigned long v2; unsigned long v4; unsigned long v5; unsigned long v6; v2 = v4; v1 = v5; v0 = v6; if (a0) { fprintf(stderr, gettext("Try '%s --help' for more information.\n")); } else { printf(gettext("Usage: %s [OPTION]... [-T] SOURCE DEST\n or: %s [OPTION]... SOURCE... DIRECTORY\n or: %s [OPTION]... -t DIRECTORY SOURCE...\n")); fputs_unlocked(gettext("Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n"), stdout); emit_mandatory_arg_note(); fputs_unlocked(gettext(" -a, --archive same as -dR --preserve=all\n --attributes-only don't copy the file data, just the attributes\n --backup[=CONTROL] make a backup of each existing destination file\n -b like --backup but does not accept an argument\n --copy-contents copy contents of special files when recursive\n -d same as --no-dereference --preserve=links\n"), stdout); fputs_unlocked(gettext(" -f, --force if an existing destination file cannot be\n opened, remove it and try again (this option\n is ignored when the -n option is also used)\n -i, --interactive prompt before overwrite (overrides a previous -n\n option)\n -H follow command-line symbolic links in SOURCE\n"), stdout); fputs_unlocked(gettext(" -l, --link hard link files instead of copying\n -L, --dereference always follow symbolic links in SOURCE\n"), stdout); fputs_unlocked(gettext(" -n, --no-clobber do not overwrite an existing file (overrides\n a previous -i option)\n -P, --no-dereference never follow symbolic links in SOURCE\n"), stdout); fputs_unlocked(gettext(" -p same as --preserve=mode,ownership,timestamps\n --preserve[=ATTR_LIST] preserve the specified attributes (default:\n mode,ownership,timestamps), if possible\n additional attributes: context, links, xattr,\n all\n"), stdout); fputs_unlocked(gettext(" --no-preserve=ATTR_LIST don't preserve the specified attributes\n --parents use full source file name under DIRECTORY\n"), stdout); fputs_unlocked(gettext(" -R, -r, --recursive copy directories recursively\n --reflink[=WHEN] control clone/CoW copies. See below\n --remove-destination remove each existing destination file before\n attempting to open it (contrast with --force)\n"), stdout); fputs_unlocked(gettext(" --sparse=WHEN control creation of sparse files. See below\n --strip-trailing-slashes remove any trailing slashes from each SOURCE\n argument\n"), stdout); fputs_unlocked(gettext(" -s, --symbolic-link make symbolic links instead of copying\n -S, --suffix=SUFFIX override the usual backup suffix\n -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY\n -T, --no-target-directory treat DEST as a normal file\n"), stdout); fputs_unlocked(gettext(" -u, --update copy only when the SOURCE file is newer\n than the destination file or when the\n destination file is missing\n -v, --verbose explain what is being done\n -x, --one-file-system stay on this file system\n"), stdout); fputs_unlocked(gettext(" -Z set SELinux security context of destination\n file to default type\n --context[=CTX] like -Z, or if CTX is specified then set the\n SELinux or SMACK security context to CTX\n"), stdout); fputs_unlocked(gettext(" --help display this help and exit\n"), stdout); fputs_unlocked(gettext(" --version output version information and exit\n"), stdout); fputs_unlocked(gettext("\nBy default, sparse SOURCE files are detected by a crude heuristic and the\ncorresponding DEST file is made sparse as well. That is the behavior\nselected by --sparse=auto. Specify --sparse=always to create a sparse DEST\nfile whenever the SOURCE file contains a long enough sequence of zero bytes.\nUse --sparse=never to inhibit creation of sparse files.\n"), stdout); fputs_unlocked(gettext("\nWhen --reflink[=always] is specified, perform a lightweight copy, where the\ndata blocks are copied only when modified. If this is not possible the copy\nfails, or if --reflink=auto is specified, fall back to a standard copy.\nUse --reflink=never to ensure a standard copy is performed.\n"), stdout); emit_backup_suffix_note(); fputs_unlocked(gettext("\nAs a special case, cp makes a backup of SOURCE when the force and backup\noptions are given and SOURCE and DEST are the same name for an existing,\nregular file.\n"), stdout); emit_ancillary_info("cp"); } exit(a0); }
ch_enlargebufs(EditLine *el, size_t addlen) { size_t sz, newsz; wchar_t *newbuffer, *oldbuf, *oldkbuf; sz = (size_t)(el->el_line.limit - el->el_line.buffer + 2); newsz = sz * 2; if (addlen > sz) { while(newsz - sz < addlen) newsz *= 2; } newbuffer = realloc(el->el_line.buffer, newsz * sizeof(*newbuffer)); if (!newbuffer) return 0; (void) memset(&newbuffer[sz], 0, (newsz - sz) * sizeof(*newbuffer)); oldbuf = el->el_line.buffer; el->el_line.buffer = newbuffer; el->el_line.cursor = newbuffer + (el->el_line.cursor - oldbuf); el->el_line.lastchar = newbuffer + (el->el_line.lastchar - oldbuf); el->el_line.limit = &newbuffer[sz - 2]; newbuffer = realloc(el->el_chared.c_kill.buf, newsz * sizeof(*newbuffer)) ; if (!newbuffer) return 0; (void) memset(&newbuffer[sz], 0, (newsz - sz) * sizeof(*newbuffer)); oldkbuf = el->el_chared.c_kill.buf; el->el_chared.c_kill.buf = newbuffer; el->el_chared.c_kill.last = newbuffer + (el->el_chared.c_kill.last - oldkbuf); el->el_chared.c_kill.mark = el->el_line.buffer + (el->el_chared.c_kill.mark - oldbuf); newbuffer = realloc(el->el_chared.c_undo.buf, newsz * sizeof(*newbuffer)) ; if (!newbuffer) return 0; (void) memset(&newbuffer[sz], 0, (newsz - sz) * sizeof(*newbuffer)); el->el_chared.c_undo.buf = newbuffer; newbuffer = realloc(el->el_chared.c_redo.buf, newsz * sizeof(*newbuffer)) ; if (!newbuffer) return 0; el->el_chared.c_redo.pos = newbuffer + (el->el_chared.c_redo.pos - el->el_chared.c_redo.buf); el->el_chared.c_redo.lim = newbuffer + (el->el_chared.c_redo.lim - el->el_chared.c_redo.buf); el->el_chared.c_redo.buf = newbuffer; if (!hist_enlargebuf(el, sz, newsz)) return 0; el->el_line.limit = &el->el_line.buffer[newsz - 2]; if (el->el_chared.c_resizefun) (*el->el_chared.c_resizefun)(el, el->el_chared.c_resizearg); return 1; }
long ch_enlargebufs(long a1, unsigned long a2) { long v3; unsigned long v4; char *v5; char *v6; char *v7; char *v8; long v9; long v10; v4 = ((long)(*(_QWORD *)(a1 + 104) - *(_QWORD *)(a1 + 80)) >> 2) + 2; v3 = 2 * v4; if ( a2 > v4 ) { while ( a2 > v3 - v4 ) v3 *= 2LL; } v5 = (char *)realloc(*(void **)(a1 + 80), 4 * v3); if ( !v5 ) return 0LL; memset(&v5[4 * v4], 0, 4 * (v3 - v4)); v9 = *(_QWORD *)(a1 + 80); *(_QWORD *)(a1 + 80) = v5; *(_QWORD *)(a1 + 88) = &v5[*(_QWORD *)(a1 + 88) - v9]; *(_QWORD *)(a1 + 96) = &v5[*(_QWORD *)(a1 + 96) - v9]; *(_QWORD *)(a1 + 104) = &v5[4 * v4 - 8]; v6 = (char *)realloc(*(void **)(a1 + 896), 4 * v3); if ( !v6 ) return 0LL; memset(&v6[4 * v4], 0, 4 * (v3 - v4)); v10 = *(_QWORD *)(a1 + 896); *(_QWORD *)(a1 + 896) = v6; *(_QWORD *)(a1 + 904) = &v6[*(_QWORD *)(a1 + 904) - v10]; *(_QWORD *)(a1 + 912) = *(_QWORD *)(a1 + 912) - v9 + *(_QWORD *)(a1 + 80); v7 = (char *)realloc(*(void **)(a1 + 888), 4 * v3); if ( !v7 ) return 0LL; memset(&v7[4 * v4], 0, 4 * (v3 - v4)); *(_QWORD *)(a1 + 888) = v7; v8 = (char *)realloc(*(void **)(a1 + 920), 4 * v3); if ( !v8 ) return 0LL; *(_QWORD *)(a1 + 928) = &v8[*(_QWORD *)(a1 + 928) - *(_QWORD *)(a1 + 920)]; *(_QWORD *)(a1 + 936) = &v8[*(_QWORD *)(a1 + 936) - *(_QWORD *)(a1 + 920)]; *(_QWORD *)(a1 + 920) = v8; if ( !(unsigned int)hist_enlargebuf(a1, v4, v3) ) return 0LL; *(_QWORD *)(a1 + 104) = *(_QWORD *)(a1 + 80) + 4 * v3 - 8; if ( *(_QWORD *)(a1 + 976) ) (*(void ( **)(long, _QWORD))(a1 + 976))(a1, *(_QWORD *)(a1 + 992)); return 1LL; }
void rsyslogd_submitErrMsg(const int severity, const int iErr, const uchar *msg) { if (glbl.GetGlobalInputTermState() == 1) { if(!doFork) dfltErrLogger(severity, iErr, msg); } else { logmsgInternal(iErr, (5<<3)|(severity & 0x07), msg, 0); } }
long rsyslogd_submitErrMsg(unsigned int a1, unsigned int a2, const char *a3) { long result; if ( (unsigned int)qword_4708() != 1 ) return logmsgInternal(a2, a1 & 7 | 0x28, a3, 0); result = (unsigned int)doFork; if ( !doFork ) return dfltErrLogger(a1, a2, a3); return result; }
int acl_entries(acl_t acl) { acl_obj *acl_obj_p = ((acl_obj *)__ext2int_and_check(acl, (0x712C))); if (!acl_obj_p) return -1; return acl_obj_p->i.a_used; }
long acl_entries(long a1) { long v2; v2 = _ext2int_and_check(a1, 28972LL); if ( v2 ) return *(_QWORD *)(v2 + 48); else return 0xFFFFFFFFLL; }
static void parse_format_string (char const *fmt) { size_t i; size_t prefix_len = 0; size_t suffix_pos; long int pad = 0; char *endptr = ((void *)0) ; _Bool zero_padding = 0 ; for (i = 0; !(fmt[i] == '%' && fmt[i + 1] != '%'); i += (fmt[i] == '%') + 1) { if (!fmt[i]) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"format %s has no %% directive\"), quote (fmt)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("format %s has no %% directive"), quote (fmt)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("format %s has no %% directive"), quote (fmt)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; prefix_len++; } i++; while ( 1 ) { size_t skip = strspn (fmt + i, " "); i += skip; if (fmt[i] == '\'') { grouping = 1; i++; } else if (fmt[i] == '0') { zero_padding = 1 ; i++; } else if (! skip) break; } (*__errno_location ()) = 0; pad = strtol (fmt + i, &endptr, 10); if ( (*__errno_location ()) == 34 || pad < -0x7fffffffffffffffL) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"invalid format %s (width overflow)\"), quote (fmt)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("invalid format %s (width overflow)"), quote (fmt)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("invalid format %s (width overflow)"), quote (fmt)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; if (endptr != (fmt + i) && pad != 0) { if (debug && padding_width && !(zero_padding && pad > 0)) error (0, 0, gettext ("--format padding overriding --padding")); if (pad < 0) { padding_alignment = MBS_ALIGN_LEFT; padding_width = -pad; } else { if (zero_padding) zero_padding_width = pad; else padding_width = pad; } } i = endptr - fmt; if (fmt[i] == '\0') ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"format %s ends in %%\"), quote (fmt)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("format %s ends in %%"), quote (fmt)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("format %s ends in %%"), quote (fmt)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (fmt[i] == '.') { i++; (*__errno_location ()) = 0; user_precision = strtol (fmt + i, &endptr, 10); if ( (*__errno_location ()) == 34 || user_precision < 0 || (18446744073709551615UL) < user_precision || ((*__ctype_b_loc ())[(int) (( fmt[i] ))] & (unsigned short int) _ISblank) || fmt[i] == '+') { ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"invalid precision in format %s\"), quote (fmt)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("invalid precision in format %s"), quote (fmt)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("invalid precision in format %s"), quote (fmt)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; } i = endptr - fmt; } if (fmt[i] != 'f') ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"invalid format %s,\" \" directive must be %%[0]['][-][N][.][N]f\"), quote (fmt)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("invalid format %s," " directive must be %%[0]['][-][N][.][N]f"), quote (fmt)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("invalid format %s," " directive must be %%[0]['][-][N][.][N]f"), quote (fmt)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; i++; suffix_pos = i; for (; fmt[i] != '\0'; i += (fmt[i] == '%') + 1) if (fmt[i] == '%' && fmt[i + 1] != '%') ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"format %s has too many %% directives\"), quote (fmt)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("format %s has too many %% directives"), quote (fmt)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("format %s has too many %% directives"), quote (fmt)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; if (prefix_len) format_str_prefix = ximemdup0 (fmt, prefix_len); if (fmt[suffix_pos] != '\0') format_str_suffix = xstrdup (fmt + suffix_pos); do { if (dev_debug) fprintf ( stderr , "format String:\n input: %s\n grouping: %s\n" " padding width: %ld\n alignment: %s\n" " prefix: %s\n suffix: %s\n", quote_n (0, fmt), (grouping) ? "yes" : "no", padding_width, (padding_alignment == MBS_ALIGN_LEFT) ? "Left" : "Right", quote_n (1, format_str_prefix ? format_str_prefix : ""), quote_n (2, format_str_suffix ? format_str_suffix : "")); } while (0) ; }
void parse_format_string(long param_1) { bool bVar1; int *piVar2; undefined8 uVar3; undefined8 uVar4; ushort **ppuVar5; long lVar6; undefined8 uVar7; undefined *puVar8; char *pcVar9; long in_FS_OFFSET; char *local_70; long local_68; long local_60; long local_58; size_t local_50; long local_48; long local_40; local_40 = *(long *)(in_FS_OFFSET + 0x28); local_60 = 0; local_58 = 0; local_70 = (char *)0x0; bVar1 = false; for (local_68 = 0; (*(char *)(local_68 + param_1) != '%' || (*(char *)(param_1 + local_68 + 1) == '%')); local_68 = local_68 + lVar6) { if (*(char *)(local_68 + param_1) == '\0') { uVar3 = quote(param_1); uVar4 = gettext("format %s has no %% directive"); error(1,0,uVar4,uVar3); } local_60 = local_60 + 1; if (*(char *)(local_68 + param_1) == '%') { lVar6 = 2; } else { lVar6 = 1; } } local_68 = local_68 + 1; do { while( true ) { while( true ) { local_50 = strspn((char *)(local_68 + param_1)," "); local_68 = local_68 + local_50; if (*(char *)(local_68 + param_1) != '\'') break; grouping = 1; local_68 = local_68 + 1; } if (*(char *)(local_68 + param_1) != '0') break; bVar1 = true; local_68 = local_68 + 1; } } while (local_50 != 0); piVar2 = __errno_location(); *piVar2 = 0; local_58 = strtol((char *)(param_1 + local_68),&local_70,10); piVar2 = __errno_location(); if ((*piVar2 == 0x22) || (local_58 == -0x8000000000000000)) { uVar3 = quote(param_1); uVar4 = gettext("invalid format %s (width overflow)"); error(1,0,uVar4,uVar3); } if (((char *)(param_1 + local_68) != local_70) && (local_58 != 0)) { if (((debug != '\0') && (padding_width != 0)) && ((!bVar1 || (local_58 < 1)))) { uVar3 = gettext("--format padding overriding --padding"); error(0,0,uVar3); } if (local_58 < 0) { padding_alignment = 0; padding_width = -local_58; } else if (bVar1) { zero_padding_width = local_58; } else { padding_width = local_58; } } local_68 = (long)local_70 - param_1; if (*(char *)(local_68 + param_1) == '\0') { uVar3 = quote(param_1); uVar4 = gettext("format %s ends in %%"); error(1,0,uVar4,uVar3); } if (*(char *)(local_68 + param_1) == '.') { local_68 = local_68 + 1; piVar2 = __errno_location(); *piVar2 = 0; user_precision = strtol((char *)(param_1 + local_68),&local_70,10); piVar2 = __errno_location(); if ((((*piVar2 == 0x22) || (user_precision < 0)) || (ppuVar5 = __ctype_b_loc(), ((*ppuVar5)[*(char *)(local_68 + param_1)] & 1) != 0)) || (*(char *)(local_68 + param_1) == '+')) { uVar3 = quote(param_1); uVar4 = gettext("invalid precision in format %s"); error(1,0,uVar4,uVar3); } local_68 = (long)local_70 - param_1; } if (*(char *)(local_68 + param_1) != 'f') { uVar3 = quote(param_1); uVar4 = gettext("invalid format %s, directive must be %%[0][\'][-][N][.][N]f"); error(1,0,uVar4,uVar3); } local_68 = local_68 + 1; local_48 = local_68; for (; *(char *)(local_68 + param_1) != '\0'; local_68 = local_68 + lVar6) { if ((*(char *)(local_68 + param_1) == '%') && (*(char *)(param_1 + local_68 + 1) != '%')) { uVar3 = quote(param_1); uVar4 = gettext("format %s has too many %% directives"); error(1,0,uVar4,uVar3); } if (*(char *)(local_68 + param_1) == '%') { lVar6 = 2; } else { lVar6 = 1; } } if (local_60 != 0) { format_str_prefix = (undefined *)ximemdup0(param_1,local_60); } if (*(char *)(local_48 + param_1) != '\0') { format_str_suffix = (undefined *)xstrdup(local_48 + param_1); } if (dev_debug != '\0') { puVar8 = format_str_suffix; if (format_str_suffix == (undefined *)0x0) { puVar8 = &DAT_001035f3; } uVar3 = quote_n(2,puVar8); puVar8 = format_str_prefix; if (format_str_prefix == (undefined *)0x0) { puVar8 = &DAT_001035f3; } uVar4 = quote_n(1,puVar8); lVar6 = padding_width; if (padding_alignment == 0) { pcVar9 = "Left"; } else { pcVar9 = "Right"; } if (grouping == 0) { puVar8 = &DAT_00104d34; } else { puVar8 = &DAT_00104d30; } uVar7 = quote_n(0,param_1); fprintf(stderr, "format String:\n input: %s\n grouping: %s\n padding width: %ld\n alignment: %s\n prefix: %s\n suffix: %s\n" ,uVar7,puVar8,lVar6,pcVar9,uVar4,uVar3); } if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
WORD_DESC * make_word_flags (w, string) WORD_DESC *w; const char *string; { register int i; size_t slen; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); i = 0; slen = strlen (string); while (i < slen) { switch (string[i]) { case '$': w->flags |= (1 << 0); break; case '\\': break; case '\'': case '`': case '"': w->flags |= (1 << 1); break; } do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0); } return (w); }
void make_word_flags(struct_0 *a0, void* a1) { unsigned int v0; unsigned long long v1; unsigned long v2; unsigned long long v3; unsigned long long v4; void* v6; struct_0 *v7; memset(&v3, 0x0, 0x8); v6 = 0; v2 = strlen(a1); while (true) { if (v2 <= v6) break; if (*((a1 + v6)) != 96) { if (!(*((a1 + v6)) <= 96)) goto LABEL_40026b; if (*((a1 + v6)) == 92) goto LABEL_40026b; if (!(*((a1 + v6)) <= 92)) goto LABEL_40026b; if (*((a1 + v6)) != 39) { if (!(*((a1 + v6)) <= 39)) goto LABEL_40026b; if (*((a1 + v6)) != 34 && *((a1 + v6)) == 36) { a0->field_8 = a0->field_8 | 1; goto LABEL_40026b; } } } a0->field_8 = a0->field_8 | 2; LABEL_40026b: if (locale_mb_cur_max <= 1) { v6 = v6 + 1; continue; } v0 = is_basic(*((a1 + v6))); if (v0) { v1 = 1; goto LABEL_40030d; } if (locale_utf8locale && *((a1 + v6)) >= 0) { v1 = *((a1 + v6)); goto LABEL_40030d; } v4 = v3; v1 = mbrlen(v6 + a1, v2 - v6, &v3, v6 + a1); LABEL_40030d: if (v1 == -2) { LABEL_40031b: v3 = v4; v6 = v6 + 1; } else { if (v1 == -1) goto LABEL_40031b; if (v1) v6 += v1; else v6 = v6 + 1; } } v7 = a0; return; }
static inline int varequal(const char *a, const char *b) { return !varcmp(a, b); }
_BOOL8 varequal(_BYTE *a1, char *a2) { return (unsigned int)varcmp(a1, a2) == 0; }
void init_volume_number (void) { FILE *file = fopen (volno_file_option, "r"); if (file) { if (fscanf (file, "%d", &global_volno) != 1 || global_volno < 0) do { if (error_hook) error_hook (); error (0, 0, gettext ("%s: contains invalid volume number"), quotearg_colon (volno_file_option)); fatal_exit (); } while (0) ; if (ferror_unlocked (file)) read_error (volno_file_option); if (fclose (file) != 0) close_error (volno_file_option); } else if ( (*__errno_location ()) != 2 ) open_error (volno_file_option); }
long long init_volume_number(unsigned long a0, unsigned long a1, unsigned long long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) { void* v0; unsigned long long v3; v0 = fopen(volno_file_option, "r"); if (v0) { if (global_volno < 0 || __isoc99_fscanf(v0, "%d", &global_volno) != 1) { if (error_hook) *(5243096)(); error(0x0, 0x0, gettext("%s: contains invalid volume number")); fatal_exit(0x0, 0x0, a2, quotearg_colon(volno_file_option), a4, a5); } if (ferror_unlocked(v0)) read_error(volno_file_option); v3 = fclose(v0); if (v3) v3 = close_error(volno_file_option); } else { v3 = *(__errno_location()); if (v3 != 2) v3 = open_error(volno_file_option); } return v3; }
terminal_change_size(EditLine *el, int lins, int cols) { coord_t cur = el->el_cursor; el->el_terminal.t_val[3] = (cols < 2) ? 80 : cols; el->el_terminal.t_val[2] = (lins < 1) ? 24 : lins; if (terminal_rebuffer_display(el) == -1) return -1; re_clear_display(el); el->el_cursor = cur; return 0; }
int terminal_change_size(struct_0 *a0, unsigned long a1, unsigned long a2) { unsigned long v0; unsigned int v2; unsigned int v3; unsigned int v4; v0 = a0->field_30; if (a2 > 1) v2 = a2; else v2 = 80; a0->field_b8->field_c = v2; if (a1 > 0) v3 = a1; else v3 = 24; a0->field_b8->field_8 = v3; v4 = terminal_rebuffer_display(a0); if (v4 == -1) { v4 = -1; } else { re_clear_display(a0); a0->field_30 = v0; v4 = 0; } return v4; }
int acl_free(void *obj_p) { obj_prefix *int_p = ((obj_prefix *)obj_p)-1; if (!obj_p || !int_p) { (*__errno_location ()) = 22 ; return -1; } switch(int_p->p_magic) { case (0x712C): __acl_free_acl_obj((acl_obj *)int_p); return 0; case (0x1C27): case (0xD5F2): (__free_obj_p((obj_prefix *)(int_p))); return 0; case (0x9D6B): case (0x1ED5): break; default: break; } (*__errno_location ()) = 22 ; return -1; }
long acl_free(long a1) { int v1; unsigned short *v3; v3 = (unsigned short *)(a1 - 8); if ( !a1 || a1 == 8 ) goto LABEL_13; v1 = *v3; if ( v1 == 54770 ) goto LABEL_12; if ( *v3 > 0xD5F2u || v1 == 40299 || *v3 > 0x9D6Bu ) goto LABEL_13; if ( v1 == 28972 ) { _acl_free_acl_obj((long)v3); return 0LL; } if ( v1 == 7207 ) { LABEL_12: _free_obj_p(v3); return 0LL; } else { LABEL_13: *_errno_location() = 22; return 0xFFFFFFFFLL; } }
int do_exec(struct ssh *ssh, Session *s, const char *command) { int ret; const char *forced = ((void *)0) , *tty = ((void *)0) ; char session_type[1024]; if (options.adm_forced_command) { original_command = command; command = options.adm_forced_command; forced = "(config)"; } else if (auth_opts->force_command != ((void *)0) ) { original_command = command; command = auth_opts->force_command; forced = "(key-option)"; } s->forced = 0; if (forced != ((void *)0) ) { s->forced = 1; if ((!strncmp(command, "internal-sftp", sizeof("internal-sftp") - 1) && (command[sizeof("internal-sftp") - 1] == '\0' || command[sizeof("internal-sftp") - 1] == ' ' || command[sizeof("internal-sftp") - 1] == '\t'))) { s->is_subsystem = s->is_subsystem ? 2 : 3; } else if (s->is_subsystem) s->is_subsystem = 1; snprintf(session_type, sizeof(session_type), "forced-command %s '%.900s'", forced, command); } else if (s->is_subsystem) { snprintf(session_type, sizeof(session_type), "subsystem '%.900s'", s->subsys); } else if (command == ((void *)0) ) { snprintf(session_type, sizeof(session_type), "shell"); } else { snprintf(session_type, sizeof(session_type), "command"); } if (s->ttyfd != -1) { tty = s->tty; if (strncmp(tty, "/dev/", 5) == 0) tty += 5; } sshlog("session.c", __func__, 699, 0, SYSLOG_LEVEL_VERBOSE, ((void *)0) , "Starting session: %s%s%s for %s from %.200s port %d id %d", session_type, tty == ((void *)0) ? "" : " on ", tty == ((void *)0) ? "" : tty, s->pw->pw_name, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), s->self) ; if (s->ttyfd != -1) ret = do_exec_pty(ssh, s, command); else ret = do_exec_no_pty(ssh, s, command); original_command = ((void *)0) ; sshbuf_reset(loginmsg); return ret; }
undefined4 do_exec(undefined8 param_1,long param_2,char *param_3) { int iVar1; undefined4 uVar2; undefined8 uVar3; undefined4 uVar4; undefined *puVar5; long in_FS_OFFSET; char *local_460; undefined4 local_43c; char *local_438; char *local_430; char local_428 [1032]; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_438 = (char *)0x0; local_430 = (char *)0x0; if (_DAT_0010bed0 == (char *)0x0) { local_460 = param_3; if (*(long *)(auth_opts + 0x38) != 0) { local_460 = *(char **)(auth_opts + 0x38); local_438 = "(key-option)"; original_command = param_3; } } else { local_460 = _DAT_0010bed0; local_438 = "(config)"; original_command = param_3; } *(undefined4 *)(param_2 + 0x24) = 0; if (local_438 == (char *)0x0) { if (*(int *)(param_2 + 200) == 0) { if (local_460 == (char *)0x0) { snprintf(local_428,0x400,"shell"); } else { snprintf(local_428,0x400,"command"); } } else { snprintf(local_428,0x400,"subsystem \'%.900s\'",*(undefined8 *)(param_2 + 0xd0)); } } else { *(undefined4 *)(param_2 + 0x24) = 1; iVar1 = strncmp(local_460,"internal-sftp",0xd); if ((iVar1 == 0) && (((local_460[0xd] == '\0' || (local_460[0xd] == ' ')) || (local_460[0xd] == '\t')))) { if (*(int *)(param_2 + 200) == 0) { uVar4 = 3; } else { uVar4 = 2; } *(undefined4 *)(param_2 + 200) = uVar4; } else if (*(int *)(param_2 + 200) != 0) { *(undefined4 *)(param_2 + 200) = 1; } snprintf(local_428,0x400,"forced-command %s \'%.900s\'",local_438,local_460); } if (*(int *)(param_2 + 0x34) != -1) { local_430 = (char *)(param_2 + 0x4c); iVar1 = strncmp(local_430,"/dev/",5); if (iVar1 == 0) { local_430 = (char *)(param_2 + 0x51); } } uVar4 = *(undefined4 *)(param_2 + 4); uVar2 = ssh_remote_port(param_1); uVar3 = ssh_remote_ipaddr(param_1); if (local_430 == (char *)0x0) { local_430 = ""; puVar5 = &DAT_00107897; } else { puVar5 = &DAT_00107898; } sshlog("session.c","do_exec",699,0,4,0,"Starting session: %s%s%s for %s from %.200s port %d id %d" ,local_428,puVar5,local_430,**(undefined8 **)(param_2 + 0x10),uVar3,uVar2,uVar4); if (*(int *)(param_2 + 0x34) == -1) { local_43c = do_exec_no_pty(param_1,param_2,local_460); } else { local_43c = do_exec_pty(param_1,param_2,local_460); } original_command = (char *)0x0; sshbuf_reset(loginmsg); if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return local_43c; } __stack_chk_fail(); }
static _Bool parse_wholename (const struct parser_table* entry, char **argv, int *arg_ptr) { return insert_path_check (entry, argv, arg_ptr, "wholename", pred_path); }
long parse_wholename(long a1, long a2, int *a3, __m128i a4) { return insert_path_check(a1, a2, a3, (long)"wholename", &pred_path, a4); }
void sbrand (seed) unsigned long seed; { rseed = seed; last_random_value = 0; }
void sbrand(unsigned long long a0) { char v0; unsigned long long v2; unsigned long long v3; v2 = a0; rseed = a0; last_random_value = 0; v3 = *(&v0); return; }
static void send_handle(u_int32_t id, int handle) { u_char *string; int hlen; handle_to_string(handle, &string, &hlen); sshlog("sftp-server.c", __func__, 610, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "request %u: sent handle handle %d", id, handle); send_data_or_handle(102, id, string, hlen); free(string); }
void send_handle(undefined4 param_1,undefined4 param_2) { long in_FS_OFFSET; undefined8 uVar1; undefined4 local_1c; void *local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); uVar1 = 0x1013b4; handle_to_string(param_2,&local_18,&local_1c); sshlog("sftp-server.c","send_handle",0x262,0,5,0,"request %u: sent handle handle %d",param_1, param_2,uVar1); send_data_or_handle(0x66,param_1,local_18,local_1c); free(local_18); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
static void parser_ungetc(struct parser_st *parser, int c) { ((void) sizeof (( parser->pushback_length < (sizeof(parser->pushback) / sizeof((parser->pushback)[0])) ) ? 1 : 0), __extension__ ({ if ( parser->pushback_length < (sizeof(parser->pushback) / sizeof((parser->pushback)[0])) ) ; else __assert_fail ( "parser->pushback_length < SIZEOF(parser->pushback)" , "cfg.c", 119, __extension__ __PRETTY_FUNCTION__); })) ; parser->pushback[parser->pushback_length++] = c; }
void parser_ungetc(struct_0 *a0, unsigned long a1) { unsigned long long v1; if (a0->field_10 <= 1) { v1 = a0->field_10; a0->field_10 = a0->field_10 + 1; a0->padding_0[8 + v1] = a1; return; } __assert_fail(); }
void initialize_shell_builtins () { qsort (shell_builtins, num_shell_builtins, sizeof (struct builtin), (QSFUNC *)shell_builtin_compare); }
long long initialize_shell_builtins() { return qsort(shell_builtins, num_shell_builtins, 0x30, shell_builtin_compare); }
void xheader_read (struct xheader *xhdr, union block *p, off_t size) { size_t j = 0; if (size < 0) size = 0; if ( (18446744073709551615UL) - 512 <= size) xalloc_die (); size += 512; xhdr->size = size; xhdr->buffer = xmalloc (size + 1); xhdr->buffer[size] = '\0'; do { size_t len = size; if (len > 512) len = 512; if (!p) do { if (error_hook) error_hook (); error (0, 0, gettext ("Unexpected EOF in archive")); fatal_exit (); } while (0); memcpy (&xhdr->buffer[j], p->buffer, len); set_next_block_after (p); p = find_next_block (); j += len; size -= len; } while (size > 0); }
long long xheader_read(unsigned long long a0[3], void* a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned long long v0; void* v1; void* v2; unsigned long long v3; unsigned int v5; unsigned long long v6; v1 = a1; v0 = a2; v2 = 0; if ((v0 - 0 >> 63)) v0 = 0; if (v0 > -514) xalloc_die(); v0 += 0x200; a0[1] = v0; a0[2] = xmalloc(v0 + 1); *((v0 + a0[2])) = 0; do { v3 = v0; if (v3 > 0x200) v3 = 0x200; if (!v1) { if (error_hook) *(5242936)(); v5 = 0; error(0x0, 0x0, gettext("Unexpected EOF in archive")); fatal_exit(0x0, reg_64, a2, a3, a4, a5); } memcpy(a0[2] + v2, v1, v3); set_next_block_after(v1); v1 = find_next_block(); v2 += v3; v6 = v0 - v3; v0 -= v3; } while (v0 > 0); return v6; }
int flopen(const char *path, int flags, ...) { va_list ap; int ret; __builtin_va_start( ap , flags ) ; ret = vflopenat( -100 , path, flags, ap); __builtin_va_end( ap ) ; return (ret); }
long long flopen(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned long v3; unsigned long v4; unsigned long v5; char v6; unsigned long v7; unsigned long v8; unsigned long v9; unsigned long v10; int v11; int v12; int v13; int v14; int v15; int v16; int v17; int v18; unsigned long v19; char v20; int v21; int v22; int v23; int v24; int v25; int v26; int v27; int v28; unsigned long long *v29; v7 = a2; v8 = a3; v9 = a4; v10 = a5; if (v20) { v11 = v21; v12 = v22; v13 = v23; v14 = v24; v15 = v25; v16 = v26; v17 = v27; v18 = v28; } v5 = v29[5]; v1 = 16; v2 = 48; v3 = &v19; v4 = &v6; v0 = vflopenat(0xffffff9c, a0, a1, &v1); if ((v5 ^ v29[5])) __stack_chk_fail(); return v0; }
static void pkg_array_list_item(struct pkg_array *array, struct pkginfo *pkg, void *pkg_data) { struct list_format *fmt = pkg_data; int l; const char *pdesc; list_format_init(fmt, array); list_format_print_header(fmt); pdesc = pkg_synopsis(pkg, &l); l = ((l) < (fmt->dw) ? (l) : (fmt->dw)); list_format_print(fmt, pkg_abbrev_want(pkg), pkg_abbrev_status(pkg), pkg_abbrev_eflag(pkg), pkg_name(pkg, pnaw_nonambig), versiondescribe(&pkg->installed.version, vdew_nonambig), dpkg_arch_describe(pkg->installed.arch), pdesc, l); }
long long pkg_array_list_item(void* a0, struct_0 *a1, struct_1 *a2) { unsigned long long v0; char v1; unsigned long long v2; unsigned int v4; list_format_init(a2, a0); list_format_print_header(a2); v2 = pkg_synopsis(a1, &v1, &v1); v4 = *(&v1); if (a2->field_10 <= *(&v1)) v4 = a2->field_10; v1 = v4; v0 = versiondescribe(&a1[1].padding_0[56], 0x1, &v1); list_format_print(a2, pkg_abbrev_want(a1), pkg_abbrev_status(a1), pkg_abbrev_eflag(a1), pkg_name(a1, 0x1, &v1), v0, dpkg_arch_describe(a1->field_58), v2, v1); return 0; }
int BZ2_bzflush (BZFILE *b) { return 0; }
long long BZ2_bzflush(unsigned long a0) { unsigned long v0; v0 = a0; return 0; }
static void failure (void) { fprintf ( stderr , gettext ("%s: Permission denied.\n"), Prog); log_gpasswd_failure (": Permission denied"); exit (1); }
void failure() { long v0; char *v1; v0 = Prog; v1 = gettext("%s: Permission denied.\n"); fprintf(stderr, v1, v0); log_gpasswd_failure(": Permission denied"); exit(1); }
void temporarily_use_uid(struct passwd *pw) { saved_euid = geteuid(); saved_egid = getegid(); sshlog("uidswap.c", __func__, 67, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "temporarily_use_uid: %u/%u (e=%u/%u)", (u_int)pw->pw_uid, (u_int)pw->pw_gid, (u_int)saved_euid, (u_int)saved_egid) ; if (saved_euid != 0) { privileged = 0; return; } privileged = 1; temporarily_use_uid_effective = 1; saved_egroupslen = getgroups(0, ((void *)0) ); if (saved_egroupslen == -1) sshfatal("uidswap.c", __func__, 88, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "getgroups: %.100s", strerror( (*__errno_location ()) )); if (saved_egroupslen > 0) { saved_egroups = xreallocarray(saved_egroups, saved_egroupslen, sizeof(gid_t)); if (getgroups(saved_egroupslen, saved_egroups) == -1) sshfatal("uidswap.c", __func__, 93, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "getgroups: %.100s", strerror( (*__errno_location ()) )); } else { free(saved_egroups); saved_egroups = ((void *)0) ; } if (user_groupslen == -1 || user_groups_uid != pw->pw_uid) { if (initgroups(pw->pw_name, pw->pw_gid) == -1) sshfatal("uidswap.c", __func__, 102, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "initgroups: %s: %.100s", pw->pw_name, strerror( (*__errno_location ()) )) ; user_groupslen = getgroups(0, ((void *)0) ); if (user_groupslen == -1) sshfatal("uidswap.c", __func__, 107, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "getgroups: %.100s", strerror( (*__errno_location ()) )); if (user_groupslen > 0) { user_groups = xreallocarray(user_groups, user_groupslen, sizeof(gid_t)); if (getgroups(user_groupslen, user_groups) == -1) sshfatal("uidswap.c", __func__, 112, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "getgroups: %.100s", strerror( (*__errno_location ()) )); } else { free(user_groups); user_groups = ((void *)0) ; } user_groups_uid = pw->pw_uid; } if (setgroups(user_groupslen, user_groups) == -1) sshfatal("uidswap.c", __func__, 121, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "setgroups: %.100s", strerror( (*__errno_location ()) )); if (setegid(pw->pw_gid) == -1) sshfatal("uidswap.c", __func__, 131, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "setegid %u: %.100s", (u_int)pw->pw_gid, strerror( (*__errno_location ()) )) ; if (seteuid(pw->pw_uid) == -1) sshfatal("uidswap.c", __func__, 134, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "seteuid %u: %.100s", (u_int)pw->pw_uid, strerror( (*__errno_location ()) )) ; }
long long temporarily_use_uid(unsigned long a0) { unsigned long long v0; unsigned long v1; unsigned long long v2; unsigned long v3; char v4; unsigned long long v6; v2 = a0; saved_euid = geteuid(); saved_egid = getegid(); sshlog("uidswap.c", "temporarily_use_uid", 0x43, 0x0, 0x5, 0x0, "temporarily_use_uid: %u/%u (e=%u/%u)", v2->field_10, v2->field_14, saved_euid); v6 = saved_euid; if (saved_euid) { privileged = 0; } else { privileged = 1; temporarily_use_uid_effective = 1; saved_egroupslen = getgroups(0x0, NULL); if (saved_egroupslen == -1) { v0 = strerror(*(__errno_location())); sshfatal("uidswap.c", "temporarily_use_uid", 0x58, 0x0, 0x1, 0x0, "getgroups: %.100s"); } if (saved_egroupslen > 0) { saved_egroups = xreallocarray(saved_egroups, saved_egroupslen, 0x4, saved_egroupslen); if (!(getgroups(saved_egroupslen, saved_egroups) == -1)) goto LABEL_4001c4; v3 = strerror(*(__errno_location())); v2 = "getgroups: %.100s"; sshfatal("uidswap.c", "temporarily_use_uid", 0x5d, 0x0, 0x1, 0x0, *(&v4)); } free(saved_egroups); saved_egroups = 0; LABEL_4001c4: if (user_groupslen != -1 && v2->field_10 == user_groups_uid) goto LABEL_400374; if (initgroups(v2->field_0, v2->field_14) == -1) { v2 = &strerror(*(__errno_location())); v1 = *(v2); v0 = "initgroups: %s: %.100s"; sshfatal("uidswap.c", "temporarily_use_uid", 0x66, 0x0, 0x1, 0x0, *(&v4)); } user_groupslen = getgroups(0x0, NULL); if (user_groupslen == -1) { v3 = strerror(*(__errno_location())); v2 = "getgroups: %.100s"; sshfatal("uidswap.c", "temporarily_use_uid", 0x6b, 0x0, 0x1, 0x0, *(&v4)); } if (user_groupslen > 0) { user_groups = xreallocarray(user_groups, user_groupslen, 0x4, user_groupslen); if (!(getgroups(user_groupslen, user_groups) == -1)) goto LABEL_400367; v3 = strerror(*(__errno_location())); v2 = "getgroups: %.100s"; sshfatal("uidswap.c", "temporarily_use_uid", 0x70, 0x0, 0x1, 0x0, *(&v4)); } free(user_groups); user_groups = 0; LABEL_400367: user_groups_uid = v2->field_10; LABEL_400374: if (setgroups(user_groupslen, user_groups) == -1) { v3 = strerror(*(__errno_location())); v2 = "setgroups: %.100s"; sshfatal("uidswap.c", "temporarily_use_uid", 0x79, 0x0, 0x1, 0x0, *(&v4)); } if (setegid(*((v2 + 20))) == -1) { v2 = strerror(*(__errno_location())); v1 = v2->field_14; v0 = "setegid %u: %.100s"; sshfatal("uidswap.c", "temporarily_use_uid", 0x83, 0x0, 0x1, 0x0, *(&v4)); } v6 = seteuid(*((v2 + 16))); if (v6 == -1) { v2 = &strerror(*(__errno_location())); v1 = v2->field_10; v0 = "seteuid %u: %.100s"; v6 = sshfatal("uidswap.c", "temporarily_use_uid", 0x86, 0x0, 0x1, 0x0, *(&v4)); } } return v6; }
static void process_flags (int argc, char *const *argv) { int arg; int flag; for (arg = 1; arg < argc; arg++) { if (argv[arg][0] == '-' && strlen (argv[arg]) > 2) { usage (); } if (strcmp(argv[arg], "--") == 0) { break; } } while ((flag = getopt (argc, argv, "d:fh:pr:")) != (-1) ) { switch (flag) { case 'd': break; case 'f': fflg = 1 ; break; case 'h': hflg = 1 ; hostname = optarg; reason = 201; break; case 'p': pflg = 1 ; break; default: usage (); } } if (( 0 || fflg || hflg) && !amroot) { fprintf ( stderr , gettext ("%s: Permission denied.\n"), Prog); exit (1); } if (optind < argc) { ((void) sizeof ((((void *)0) == username ) ? 1 : 0), __extension__ ({ if (((void *)0) == username ) ; else __assert_fail ( "NULL == username" , "login.c", 335, __extension__ __PRETTY_FUNCTION__); })) ; username = xstrdup (argv[optind]); explicit_bzero((argv[optind]), (strlen(argv[optind]))); ++optind; } if (fflg && ( ((void *)0) == username)) { usage (); } }
void process_flags(unsigned long a0, char **a1) { unsigned int v0; unsigned int v1; unsigned long long v4; unsigned long long v5; v0 = 1; while (true) { if (v0 >= a0) break; if (*(a1[v0]) == 45 && strlen(a1[v0]) > 2) usage(); if (!strcmp(a1[v0], "--")) break; v0 += 1; } while (true) { v1 = getopt(a0, a1, "d:fh:pr:"); if (v1 == -1) break; switch (v1) { case 112: pflg = 1; break; case 104: hflg = 1; hostname = optarg; reason = 201; break; case 100: break; case 102: fflg = 1; break; default: usage(); } } if ((fflg || hflg) && (amroot ^ 1)) { fprintf(stderr, gettext("%s: Permission denied.\n")); exit(0x1); } if (a0 > optind) { if (username) __assert_fail(); *(&username) = xstrdup(a1[optind]); explicit_bzero(a1[optind], strlen(a1[optind])); optind = optind + 1; } v4 = fflg; if (!fflg) return; v5 = username; if (username) return; usage(); }
int main (int argc, char **argv) { int c; _Bool ok; _Bool make_backups = 0 ; char const *backup_suffix = ((void *)0) ; char *version_control_string = ((void *)0) ; char const *target_directory = ((void *)0) ; int destdir_fd; _Bool no_target_directory = 0 ; int n_files; char **file; int link_errno = -1; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdin); symbolic_link = remove_existing_files = interactive = verbose = hard_dir_link = 0 ; while ((c = getopt_long (argc, argv, "bdfinrst:vFLPS:T", long_options, ((void *)0) )) != -1) { switch (c) { case 'b': make_backups = 1 ; if (optarg) version_control_string = optarg; break; case 'd': case 'F': hard_dir_link = 1 ; break; case 'f': remove_existing_files = 1 ; interactive = 0 ; break; case 'i': remove_existing_files = 0 ; interactive = 1 ; break; case 'L': logical = 1 ; break; case 'n': dereference_dest_dir_symlinks = 0 ; break; case 'P': logical = 0 ; break; case 'r': relative = 1 ; break; case 's': symbolic_link = 1 ; break; case 't': if (target_directory) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"multiple target directories specified\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("multiple target directories specified")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("multiple target directories specified")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); else { struct stat st; if (stat (optarg, &st) != 0) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"failed to access %s\"), quotearg_style (shell_escape_always_quoting_style, optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , gettext ("failed to access %s"), quotearg_style (shell_escape_always_quoting_style, optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , gettext ("failed to access %s"), quotearg_style (shell_escape_always_quoting_style, optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; if (! (((( st.st_mode )) & 0170000) == (0040000)) ) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"target %s is not a directory\"), quotearg_style (shell_escape_always_quoting_style, optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("target %s is not a directory"), quotearg_style (shell_escape_always_quoting_style, optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("target %s is not a directory"), quotearg_style (shell_escape_always_quoting_style, optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; } target_directory = optarg; break; case 'T': no_target_directory = 1 ; break; case 'v': verbose = 1 ; break; case 'S': make_backups = 1 ; backup_suffix = optarg; break; case GETOPT_HELP_CHAR: usage ( 0 ); break;; case GETOPT_VERSION_CHAR: version_etc ( stdout , "ln", "GNU coreutils", Version, ("Mike Parker"), ("David MacKenzie"), (char *) ((void *)0) ); exit ( 0 ); break;; default: usage ( 1 ); break; } } n_files = argc - optind; file = argv + optind; if (n_files <= 0) { error (0, 0, gettext ("missing file operand")); usage ( 1 ); } if (relative && !symbolic_link) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot do --relative without --symbolic\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("cannot do --relative without --symbolic")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("cannot do --relative without --symbolic")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (!hard_dir_link) { priv_set_remove_linkdir (); beware_hard_dir_link = ! 1 ; } if (no_target_directory) { if (target_directory) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot combine --target-directory \" \"and --no-target-directory\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("cannot combine --target-directory " "and --no-target-directory")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("cannot combine --target-directory " "and --no-target-directory")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; if (n_files != 2) { if (n_files < 2) error (0, 0, gettext ("missing destination file operand after %s"), quotearg_style (shell_escape_always_quoting_style, file[0])); else error (0, 0, gettext ("extra operand %s"), quotearg_style (shell_escape_always_quoting_style, file[2])); usage ( 1 ); } } else if (n_files < 2 && !target_directory) { target_directory = "."; destdir_fd = -100 ; } else { if (n_files == 2 && !target_directory) link_errno = atomic_link (file[0], -100 , file[1]); if (link_errno < 0 || link_errno == 17 || link_errno == 20 || link_errno == 22 ) { char const *d = target_directory ? target_directory : file[n_files - 1]; int flags = (O_PATHSEARCH | 0200000 | (dereference_dest_dir_symlinks ? 0 : 0400000 )); destdir_fd = openat_safer ( -100 , d, flags); int err = (*__errno_location ()) ; if (! 0200000 && 0 <= destdir_fd) { struct stat st; err = (fstat (destdir_fd, &st) != 0 ? (*__errno_location ()) : (((( st.st_mode )) & 0170000) == (0040000)) ? 0 : 20 ); if (err != 0) { close (destdir_fd); destdir_fd = -1; } } if (0 <= destdir_fd) { n_files -= !target_directory; target_directory = d; } else if (! (n_files == 2 && !target_directory)) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, err, gettext (\"target %s\"), quotearg_style (shell_escape_always_quoting_style, d)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , err, gettext ("target %s"), quotearg_style (shell_escape_always_quoting_style, d)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , err, gettext ("target %s"), quotearg_style (shell_escape_always_quoting_style, d)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); } } backup_type = (make_backups ? xget_version (gettext ("backup type"), version_control_string) : no_backups); set_simple_backup_suffix (backup_suffix); if (target_directory) { if (2 <= n_files && remove_existing_files && ! symbolic_link && backup_type != numbered_backups) { dest_set = hash_initialize (DEST_INFO_INITIAL_CAPACITY, ((void *)0) , triple_hash, triple_compare, triple_free); if (dest_set == ((void *)0) ) xalloc_die (); } ok = 1 ; for (int i = 0; i < n_files; ++i) { char *dest_base; char *dest = file_name_concat (target_directory, last_component (file[i]), &dest_base); strip_trailing_slashes (dest_base); ok &= do_link (file[i], destdir_fd, dest_base, dest, -1); free (dest); } } else ok = do_link (file[0], -100 , file[1], file[1], link_errno); return ok ? 0 : 1 ; }
int main(unsigned long a0, unsigned long long *a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long a5) { void* v0; char v1; char v2; char v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned int v8; unsigned int v9; unsigned int v10; char v11; void* v12; void* v13; unsigned long v14; unsigned long long v15[3]; unsigned int v16; void* v17; char v18; char v19; unsigned long long v21; unsigned long long v22; unsigned long long v23; unsigned long long v24; unsigned int v25; unsigned long long v26; unsigned long long v27; unsigned long long v28; v1 = 0; v12 = 0; v13 = 0; v14 = 0; v3 = 0; v6 = -1; set_program_name(*(a1)); setlocale(0x6, &g_401d03); bindtextdomain("coreutils", "/usr/local/share/locale"); textdomain("coreutils"); atexit(got.close_stdin); hard_dir_link = 0; verbose = hard_dir_link; interactive = verbose; remove_existing_files = interactive; symbolic_link = remove_existing_files; while (true) { v8 = getopt_long(a0, a1, "bdfinrst:vFLPS:T", &long_options, NULL); if (v8 == -1) break; switch (v8) { case 4294967165: v0 = 0; version_etc(stdout, "ln", "GNU coreutils", Version, "Mike Parker", "David MacKenzie"); exit(0x0); case 4294967166: usage(0x0); case 70: case 100: hard_dir_link = 1; break; case 76: logical = 1; break; case 80: logical = 0; break; case 83: v1 = 1; v12 = *(&optarg); break; case 84: v3 = 1; break; case 98: v1 = 1; if (*(&optarg)) { v13 = *(&optarg); break; } case 102: remove_existing_files = 1; interactive = 0; break; case 105: remove_existing_files = 0; interactive = 1; break; case 110: dereference_dest_dir_symlinks = 0; break; case 114: relative = 1; break; case 115: symbolic_link = 1; break; case 116: if (v14) { error(0x1, 0x0, gettext("multiple target directories specified")); } else if (stat(*(&optarg), &v18)) { v22 = quotearg_style(0x4, *(&optarg)); error(0x1, *(__errno_location()), gettext("failed to access %s")); } else if ((*(&v19) & 0xf000) == 0x4000) { v14 = *(&optarg); break; } else { v21 = quotearg_style(0x4, *(&optarg)); error(0x1, 0x0, gettext("target %s is not a directory")); } case 118: verbose = 1; break; default: usage(0x1); } } v5 = a0 - optind; v15[0] = &a1[optind]; if (v5 <= 0) { error(0x0, 0x0, gettext("missing file operand")); usage(0x1); } if (relative && (symbolic_link ^ 1)) error(0x1, 0x0, gettext("cannot do --relative without --symbolic")); if ((hard_dir_link ^ 1)) { priv_set_remove_linkdir(); beware_hard_dir_link = 0; } if (!v3) { if (v5 <= 1 && !v14) { v14 = "."; v4 = -100; goto LABEL_401786; } if (v5 == 2 && !v14) v6 = atomic_link(v15[0], 0xffffff9c, v15[1]); switch (v6) { case 17: case 20: case 22: v25 = (!v14 ? v14 : v15[1 + v5]); default: LABEL_401786: if (!v1) { v25 = 0; break; } else { v26 = gettext("backup type"); v25 = xget_version(v26, v13, v26); break; } backup_type = v25; set_simple_backup_suffix(v12); if (!v14) { v2 = do_link(v15[0], 0xffffff9c, v15[1], v15[1], v6, a5); return v2 ^ 1; } if (v5 > 1 && remove_existing_files && (symbolic_link ^ 1) && backup_type != 3) { dest_set = hash_initialize(0x3d, 0x0, got.triple_hash, got.triple_compare, got.triple_free); if (!dest_set) xalloc_die(); } v2 = 1; for (v7 = 0; v7 < v5; v7 += 1) { v28 = last_component(v15[v7]); v17 = file_name_concat(v14, v28, &v11, v28); strip_trailing_slashes(*(&v11)); v2 = (do_link(v15[v7], v4, *(&v11), v17, 0xffffffff, a5) & v2); free(v17); } return v2 ^ 1; } v16 = v25; v25 = (!dereference_dest_dir_symlinks ? 0x210000 : 0x230000); v9 = v25; v4 = openat_safer(0xffffff9c, *(&v16), v9); v25 = *(__errno_location()); v10 = v25; if (v4 >= 0) { v5 -= !v14; v14 = *(&v16); goto LABEL_401786; } else { if (!(v5 == 2) || !(!v14)) { v27 = quotearg_style(0x4, *(&v16)); error(0x1, v10, gettext("target %s")); } } } else if (v14) { error(0x1, 0x0, gettext("cannot combine --target-directory and --no-target-directory")); } else { if (v5 == 2) goto LABEL_401786; if (v5 <= 1) { v23 = quotearg_style(0x4, v15[0]); error(0x0, 0x0, gettext("missing destination file operand after %s")); } else { v24 = quotearg_style(0x4, v15[2]); error(0x0, 0x0, gettext("extra operand %s")); } usage(0x1); } }
static void color_cap_rv_fct (void) { color_option = -1; }
long long color_cap_rv_fct() { unsigned long v1; color_option = -1; return v1; }
void pubkey_info(gnutls_x509_crt_t crt, common_info_st * cinfo) { gnutls_pubkey_t pubkey; pubkey = find_pubkey(crt, cinfo); if (pubkey == 0) { fprintf( stderr , "find public key error\n"); app_exit(1); } print_pubkey_info(pubkey, outfile, full_format, outcert_format, cinfo->outtext); gnutls_pubkey_deinit(pubkey); }
long pubkey_info(long a1, long a2) { long pubkey; pubkey = find_pubkey(a1, a2); if ( !pubkey ) { fprintf(stderr, "find public key error\n"); app_exit(1); } print_pubkey_info( pubkey, outfile, (unsigned int)full_format, (unsigned int)outcert_format, *(unsigned int *)(a2 + 36)); return gnutls_pubkey_deinit(pubkey); }
static _Bool sip (struct file_data *current, _Bool skip_test) { if (current->desc < 0) { current->bufsize = sizeof (size_t); current->buffer = xmalloc (current->bufsize); } else { current->bufsize = buffer_lcm (sizeof (size_t), ((current->stat).st_blksize), (9223372036854775807L) - 2 * sizeof (size_t)); current->buffer = xmalloc (current->bufsize); if (! skip_test) { int prev_mode = set_binary_mode (current->desc, 0 ); off_t buffered; file_block_read (current, current->bufsize); buffered = current->buffered; if (prev_mode != 0 ) { if (lseek (current->desc, - buffered, 1 ) < 0) pfatal_with_name (current->name); set_binary_mode (current->desc, prev_mode); current->buffered = 0; current->eof = 0 ; } return (memchr (current->buffer, 0, buffered) != 0); } } current->buffered = 0; current->eof = 0 ; return 0 ; }
int sip(struct_0 *a0, unsigned long a1) { unsigned int v0; unsigned int v1; unsigned int v3; if (a0->field_0 < 0) a0->field_a8 = 8; else a0->field_a8 = buffer_lcm(0x8, a0->field_48, 0x7fffffffffffffef); a0->field_a0 = xmalloc(a0->field_a8); if (a0->field_0 >= 0 && (a1 ^ 1)) { v0 = set_binary_mode(a0->field_0, 0x0); file_block_read(a0, a0->field_a8); *(&v1) = a0->field_b0; if (v0) { if (lseek(a0->field_0, -(*(&v1)), 0x1) < 0) pfatal_with_name(a0->field_8); set_binary_mode(a0->field_0, v0); a0->field_b0 = 0; a0->field_121 = 0; } v3 = memchr(a0->field_a0, 0x0, *(&v1)); *(&v3) = v3; return v3; } a0->field_b0 = 0; a0->field_121 = 0; v3 = 0; return v3; }
static int send_userauth_info_request(struct ssh *ssh) { Authctxt *authctxt = ssh->authctxt; KbdintAuthctxt *kbdintctxt; char *name, *instr, **prompts; u_int r, i, *echo_on; kbdintctxt = authctxt->kbdintctxt; if (kbdintctxt->device->query(kbdintctxt->ctxt, &name, &instr, &kbdintctxt->nreq, &prompts, &echo_on)) return 0; if ((r = sshpkt_start(ssh, 60)) != 0 || (r = sshpkt_put_cstring(ssh, name)) != 0 || (r = sshpkt_put_cstring(ssh, instr)) != 0 || (r = sshpkt_put_cstring(ssh, "")) != 0 || (r = sshpkt_put_u32(ssh, kbdintctxt->nreq)) != 0) sshfatal("auth2-chall.c", __func__, 270, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "start packet"); for (i = 0; i < kbdintctxt->nreq; i++) { if ((r = sshpkt_put_cstring(ssh, prompts[i])) != 0 || (r = sshpkt_put_u8(ssh, echo_on[i])) != 0) sshfatal("auth2-chall.c", __func__, 274, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble packet"); } if ((r = sshpkt_send(ssh)) != 0 || (r = ssh_packet_write_wait(ssh)) != 0) sshfatal("auth2-chall.c", __func__, 278, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "send packet"); for (i = 0; i < kbdintctxt->nreq; i++) free(prompts[i]); free(prompts); free(echo_on); free(name); free(instr); return 1; }
int send_userauth_info_request(struct_0 *a0) { unsigned long long v0; char v1; unsigned int v2; unsigned int v3; char v4; char v5; char v6; char v7; struct_2 *v8; struct_1 *v9; unsigned long long v10; unsigned int v12; unsigned long long v13; v8 = a0->field_860; v9 = v8->field_58; if (*((*(((stack_base)[24] + 16)) + 16))(v9->field_8, &v4, &v5, &v9->field_18, &v6, &v7, *(&v1))) { v12 = 0; return v12; } v2 = sshpkt_start(a0, 0x3c); if (!v2) { v2 = sshpkt_put_cstring(a0, *(&v4), *(&v4)); if (v2) { v0 = "start packet"; sshfatal("auth2-c", "send_userauth_info_request", 0x10e, 0x1, 0x1, ssh_err(v2)); v3 = 0; } else { v2 = sshpkt_put_cstring(a0, *(&v5), *(&v5)); if (v2) { v0 = "start packet"; sshfatal("auth2-c", "send_userauth_info_request", 0x10e, 0x1, 0x1, ssh_err(v2)); v3 = 0; } else { v2 = sshpkt_put_cstring(a0, &g_400f60, v13); if (v2) { v0 = "start packet"; sshfatal("auth2-c", "send_userauth_info_request", 0x10e, 0x1, 0x1, ssh_err(v2)); v3 = 0; } else { v2 = sshpkt_put_u32(a0, v9->field_18, v9->field_18); if (!v2) { v3 = 0; } else { v0 = "start packet"; sshfatal("auth2-c", "send_userauth_info_request", 0x10e, 0x1, 0x1, ssh_err(v2)); v3 = 0; } } } } } else { v0 = "start packet"; sshfatal("auth2-c", "send_userauth_info_request", 0x10e, 0x1, 0x1, ssh_err(v2)); v3 = 0; } for (; v3 < v9->field_18; v3 += 1) { v2 = sshpkt_put_cstring(a0, *((*(&v6) + v3 * 8)), *((*(&v6) + v3 * 8))); if (v2 || (v2 = sshpkt_put_u8(a0, *((*(&v7) + v3 * 4)), *((*(&v7) + v3 * 4))), v2)) { v10 = "assemble packet"; sshfatal("auth2-c", "send_userauth_info_request", 0x112, 0x1, 0x1, ssh_err(v2)); } } v2 = sshpkt_send(a0); if (v2 || (v2 = ssh_packet_write_wait(a0), v2)) { v10 = "send packet"; sshfatal("auth2-c", "send_userauth_info_request", 0x116, 0x1, 0x1, ssh_err(v2)); } for (v3 = 0; v3 < v9->field_18; v3 += 1) { free(*((*(&v6) + v3 * 8))); } free(*(&v6)); free(*(&v7)); free(*(&v4)); free(*(&v5)); v12 = 1; return v12; }
void tar_stat_destroy (struct tar_stat_info *st) { tar_stat_close (st); xheader_xattr_free (st->xattr_map, st->xattr_map_size); free (st->orig_file_name); free (st->file_name); free (st->link_name); free (st->uname); free (st->gname); free (st->cntx_name); free (st->acls_a_ptr); free (st->acls_d_ptr); free (st->sparse_map); free (st->dumpdir); xheader_destroy (&st->xhdr); info_free_exclist (st); memset (st, 0, sizeof (*st)); }
long long tar_stat_destroy(unsigned long long a0[51]) { tar_stat_close(a0); xheader_xattr_free(a0[44], a0[43], a0[43]); free(a0[0]); free(a0[1]); free(a0[3]); free(a0[4]); free(a0[5]); free(a0[6]); free(a0[7]); free(a0[9]); free(a0[40]); free(a0[50]); xheader_destroy(&a0[45]); info_free_exclist(a0); return memset(a0, 0x0, 0x1b8); }
static void generate_request(gnutls_datum_t *nonce) { gnutls_datum_t dat; gnutls_x509_crt_t cert, issuer; common_info_st info; memset(&info, 0, sizeof(info)); info.verbose = verbose; if (!ocsptool_options.present.load_cert) { fprintf( stderr , "Missing option --load-cert\n"); app_exit(1); } info.cert = ocsptool_options.arg.load_cert; cert = load_cert(1, &info); memset(&info, 0, sizeof(info)); info.verbose = verbose; if (!ocsptool_options.present.load_issuer) { fprintf( stderr , "Missing option --load-issuer\n"); app_exit(1); } info.cert = ocsptool_options.arg.load_issuer; issuer = load_cert(1, &info); _generate_request(cert, issuer, &dat, nonce); gnutls_x509_crt_deinit(cert); gnutls_x509_crt_deinit(issuer); fwrite(dat.data, 1, dat.size, outfile); gnutls_free((void *) (dat.data)), dat.data= ((void *)0) ; }
void generate_request(unsigned long long a0) { unsigned long long v0; unsigned long long v1; void* v2; char v3; char v4; unsigned long v5; unsigned int v6; char v7; unsigned long long *v9; unsigned long long v10; memset(&v4, 0x0, 0xd8); v6 = verbose; if ((g_500044 ^ 1)) { fprintf(*(&stderr), "Missing option --load-cert\n"); app_exit(0x1); } v5 = gnutls_ocsp_req_deinit; v0 = load_cert(0x1, &v4); memset(&v4, 0x0, 0xd8); v6 = verbose; if (!(g_500043 ^ 1)) { v5 = printf; v1 = load_cert(0x1, &v4); _generate_request(v0, v1, &v2, a0); gnutls_x509_crt_deinit(v0); gnutls_x509_crt_deinit(v1); fwrite(*(&v2), 0x1, *(&v3), outfile); *(5243000)(*(&v2)); v2 = 0; v10 = *(&v7) ^ v9[5]; return; } fprintf(*(&stderr), "Missing option --load-issuer\n"); app_exit(0x1); }
static void print_FLT (float x) { char buf[( (1 + (((((24) * 1) * 146 + 484) / 485) + 1) + 16 + 1 + ( -100 < ((-37)) && (38) < 100 ? 3 : -1000 < ((-37)) && (38) < 1000 ? 4 : -10000 < ((-37)) && (38) < 10000 ? 5 : -100000 < ((-37)) && (38) < 100000 ? 6 : -1000000 < ((-37)) && (38) < 1000000 ? 7 : (((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) )) + 1)]; ftoastr (buf, sizeof buf, FTOASTR_LEFT_JUSTIFY, 0, x); puts (buf); }
unsigned long print_FLT(float a1) { char s[40]; unsigned long v3; v3 = __readfsqword(0x28u); ftoastr(s, 31LL, 1LL, 0LL, *(double *)_mm_cvtsi32_si128(LODWORD(a1)).m128i_i64); puts(s); return __readfsqword(0x28u) ^ v3; }
WORD_LIST * expand_word_leave_quoted (word, quoted) WORD_DESC *word; int quoted; { WORD_LIST *result; expand_no_split_dollar_star = 1; if (ifs_is_null) word->flags |= (1 << 4); word->flags |= (1 << 6); result = call_expand_word_internal (word, quoted, 0, (int *) ((void *)0) , (int *) ((void *)0) ); expand_no_split_dollar_star = 0; return result; }
int expand_word_leave_quoted(struct_0 *a0, unsigned long a1) { unsigned long v0; expand_no_split_dollar_star = 1; a0->field_8 = a0->field_8 | 16; a0->field_8 = a0->field_8 | 64; v0 = call_expand_word_internal(a0, a1, 0x0, 0x0, 0x0); expand_no_split_dollar_star = 0; return v0; }
static int create_backup_file (FILE * fp, const char *backup, struct stat *sb) { struct utimbuf ub; FILE *bkfp; int c; mode_t mask; mask = umask (077); bkfp = fopen (backup, "w"); (void) umask (mask); if ( ((void *)0) == bkfp) { return -1; } c = 0; if (fseeko (fp, 0, 0 ) == 0) while ((c = getc (fp)) != (-1) ) { if (putc (c, bkfp) == (-1) ) { break; } } if (( (-1) != c) || (ferror (fp) != 0) || (fflush (bkfp) != 0)) { fclose (bkfp); unlink (backup); return -1; } if (fsync (fileno (bkfp)) != 0) { (void) fclose (bkfp); unlink (backup); return -1; } if (fclose (bkfp) != 0) { unlink (backup); return -1; } ub.actime = sb-> st_atim.tv_sec ; ub.modtime = sb-> st_mtim.tv_sec ; if ( (utime (backup, &ub) != 0) || (chmod (backup, sb->st_mode) != 0) || (chown (backup, sb->st_uid, sb->st_gid) != 0)) { unlink (backup); return -1; } return 0; }
long create_backup_file(FILE *a1, const char *a2, long a3) { int v4; int c; __mode_t mask; FILE *v8; struct utimbuf file_times; unsigned long v10; v10 = __readfsqword(0x28u); mask = umask(0x3Fu); v8 = fopen(a2, "w"); umask(mask); if ( !v8 ) return 0xFFFFFFFFLL; c = 0; if ( !fseeko(a1, 0LL, 0) ) { do c = getc(a1); while ( c != -1 && putc(c, v8) != -1 ); } if ( c != -1 || ferror(a1) || fflush(v8) || (v4 = fileno(v8), fsync(v4)) ) { fclose(v8); unlink(a2); return 0xFFFFFFFFLL; } else if ( fclose(v8) ) { unlink(a2); return 0xFFFFFFFFLL; } else { file_times.actime = *(_QWORD *)(a3 + 72); file_times.modtime = *(_QWORD *)(a3 + 88); if ( utime(a2, &file_times) || chmod(a2, *(_DWORD *)(a3 + 24)) || chown(a2, *(_DWORD *)(a3 + 28), *(_DWORD *)(a3 + 32)) ) { unlink(a2); return 0xFFFFFFFFLL; } else { return 0LL; } } }
static char * default_client_percent_expand(const char *str, const struct ssh_conn_info *cinfo) { return percent_expand(str, "C", cinfo->conn_hash_hex, "L", cinfo->shorthost, "i", cinfo->uidstr, "k", cinfo->keyalias, "l", cinfo->thishost, "n", cinfo->host_arg, "p", cinfo->portstr, "d", cinfo->homedir, "h", cinfo->remhost, "r", cinfo->remuser, "u", cinfo->locuser, (char *) ((void *)0) ); }
int default_client_percent_expand(unsigned long long a0, unsigned long long a1[11]) { return percent_expand(a0, "C", a1[0], "L", a1[1], "i", a1[2], "k", a1[3], "l", a1[4], "n", a1[5], "p", a1[6], "d", a1[9], "h", a1[7], "r", a1[8], "u", a1[10], 0x0, a1); }
const wchar_t * el_wgets(EditLine *el, int *nread) { int retval; el_action_t cmdnum = 0; int num; wchar_t ch; int nrb; if (nread == ((void *)0) ) nread = &nrb; *nread = 0; el->el_read->read_errno = 0; if (el->el_flags & 0x002) { el->el_line.lastchar = el->el_line.buffer; return noedit_wgets(el, nread); } if ((el->el_flags & 0x008) == 0) read_prepare(el); if (el->el_flags & 0x004) { if ((el->el_flags & 0x008) == 0) el->el_line.lastchar = el->el_line.buffer; terminal__flush(el); return noedit_wgets(el, nread); } for (num = -1; num == -1;) { if (read_getcmd(el, &cmdnum, &ch) == -1) break; if ((size_t)cmdnum >= el->el_map.nfunc) continue; el->el_state.thiscmd = cmdnum; el->el_state.thisch = ch; if (el->el_map.type == 1 && el->el_map.current == el->el_map.key && el->el_chared.c_redo.pos < el->el_chared.c_redo.lim) { if (cmdnum == 58 && el->el_chared.c_redo.pos != el->el_chared.c_redo.buf && iswprint(el->el_chared.c_redo.pos[-1])) el->el_chared.c_redo.pos--; else *el->el_chared.c_redo.pos++ = ch; } retval = (*el->el_map.func[cmdnum]) (el, ch); el->el_state.lastcmd = cmdnum; switch (retval) { case 5: re_refresh_cursor(el); break; case 8: re_clear_lines(el); re_clear_display(el); case 4: re_refresh(el); break; case 9: re_refresh(el); terminal_beep(el); break; case 0: break; case 3: continue; case 2: if ((el->el_flags & 0x008) == 0) num = 0; else if (num == -1) { *el->el_line.lastchar++ = (('d') & 037); el->el_line.cursor = el->el_line.lastchar; num = 1; } break; case 1: num = (int)(el->el_line.lastchar - el->el_line.buffer); break; case 7: re_clear_display(el); ch_reset(el); read_clearmacros(&el->el_read->macros); re_refresh(el); break; case 6: default: terminal_beep(el); terminal__flush(el); break; } el->el_state.argument = 1; el->el_state.doingarg = 0; el->el_chared.c_vcmd.action = 0x00; if (el->el_flags & 0x008) break; } terminal__flush(el); if ((el->el_flags & 0x008) == 0) { read_finish(el); *nread = num != -1 ? num : 0; } else *nread = (int)(el->el_line.lastchar - el->el_line.buffer); if (*nread == 0) { if (num == -1) { *nread = -1; if (el->el_read->read_errno) (*__errno_location ()) = el->el_read->read_errno; } return ((void *)0) ; } else return el->el_line.buffer; }
long long el_wgets(struct_0 *a0, unsigned int *a1) { unsigned int *v0; int tmp_16; struct_3 *v1; char v2; char v3; char v4; unsigned int v5; unsigned int v6; void* v8; unsigned int v9; v1 = &a0->padding_0; v0 = a1; v2 = 0; if (!v0) v0 = &v4; *(v0) = 0; a0->field_4c0->field_18 = 0; if ((a0->field_2c & 2)) { a0->field_60 = a0->field_50; v8 = noedit_wgets(a0, v0); } else { if (!(a0->field_2c & 8)) read_prepare(a0); if ((a0->field_2c & 4)) { if (!(a0->field_2c & 8)) a0->field_60 = a0->field_50; terminal__flush(a0); v8 = noedit_wgets(a0, v0); } else { v5 = -1; if (true) { while (v5 == -1) { v9 = read_getcmd(a0, &v2, &v3); if (v9 == -1) break; if (v9 != -1) { if (v2 >= a0->field_438) continue; a0->field_81 = v2; a0->field_84 = *(&v3); if (a0->field_420 == 1 && a0->field_400 == a0->field_3f8 && a0->field_3a0 < a0->field_3a8) { if (v2 == 58 && a0->field_3a0 != a0->field_398) { v9 = iswprint(*((a0->field_3a0 - 4))); if (v9) a0->field_3a0 = a0->field_3a0 - 4; } if (!v9 || a0->field_3a0 == a0->field_398 || v2 != 58) { v9 = a0->field_3a0; a0->field_3a0 = a0->field_3a0 + 4; *(v9) = *(&v3); } } v6 = *((a0->field_430 + v2 * 8))(a0, *(&v3), *((a0->field_430 + v2 * 8)), *(&v3)); a0->field_80 = v2; switch (v6) { case 0: break; case 1: v5 = a0->field_60 + -1 * a0->field_50 >> 2; break; case 2: if (!(a0->field_2c & 8)) { v5 = 0; } else if (v5 == -1) { tmp_16 = a0->field_60; a0->field_60 = a0->field_60 + 1; *(tmp_16) = 4; a0->field_58 = a0->field_60; v5 = 1; } break; case 3: continue; case 4: re_refresh(a0); break; case 5: re_refresh_cursor(a0); break; case 7: re_clear_display(a0); ch_reset(a0); read_clearmacros(a0->field_4c0); re_refresh(a0); break; case 8: re_clear_lines(a0); re_clear_display(a0); case 9: re_refresh(a0); terminal_beep(a0); break; default: terminal_beep(a0); terminal__flush(a0); break; } } a0->field_78 = 1; a0->field_74 = 0; a0->field_3c0 = 0; if ((a0->field_2c & 8)) break; } } terminal__flush(a0); if (!(a0->field_2c & 8)) { read_finish(a0); if (v5 != -1) v9 = v5; else v9 = 0; *(v0) = v9; } else { *(v0) = a0->field_60 + -1 * a0->field_50 >> 2; } if (!*(v0)) { if (v5 == -1) { *(v0) = -1; if (a0->field_4c0->field_18) *(__errno_location()) = a0->field_4c0->field_18; } v8 = 0; } else { v8 = a0->field_50; } } } return v8; }
static void bi_windup(s) deflate_state *s; { if (s->bi_valid > 8) { { {s->pending_buf[s->pending++] = (Bytef)((uch)((s->bi_buf) & 0xff));}; {s->pending_buf[s->pending++] = (Bytef)((uch)((ush)(s->bi_buf) >> 8));}; }; } else if (s->bi_valid > 0) { {s->pending_buf[s->pending++] = (Bytef)((Byte)s->bi_buf);}; } s->bi_buf = 0; s->bi_valid = 0; }
void bi_windup(struct_2 *a0) { struct_2 *v0; int tmp_38; int tmp_46; int tmp_52; int tmp_98; int tmp_32; char *v3; char *v4; struct_2 *v5; v0 = a0; if (a0->field_1734 > 8) { tmp_38 = a0->field_1730; tmp_46 = a0->field_10; tmp_52 = a0->field_28; a0->field_28 = a0->field_28 + 1; *((tmp_52 + tmp_46)) = tmp_38; a0 = (a0->field_1730 >> 8); v3 = a0->field_10; tmp_98 = a0->field_28; a0->field_28 = a0->field_28 + 1; *(&v3[tmp_98]) = a0; } else if (a0->field_1734 > 0) { a0 = a0->field_1730; v4 = a0->field_10; tmp_32 = a0->field_28; a0->field_28 = a0->field_28 + 1; *(&v4[tmp_32]) = a0; } a0->field_1730 = 0; v5 = a0; a0->field_1734 = 0; return; }
static 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 SHELL_VAR * get_bashpid (var) SHELL_VAR *var; { int pid; pid = getpid (); return (set_int_value (var, pid, 1)); }
long long get_bashpid(void* a0) { unsigned int v0; v0 = getpid(); return set_int_value(a0, v0, 0x1); }
static int get_response(struct nlmsghdr *n, void *arg) { struct genlmsghdr *ghdr; struct l2tp_data *data = arg; struct l2tp_parm *p = &data->config; struct rtattr *attrs[(__L2TP_ATTR_MAX - 1) + 1]; struct rtattr *nla_stats, *rta; int len; if (n->nlmsg_type == 0x2) return - 74 ; ghdr = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); len = n->nlmsg_len - ((sizeof(*ghdr)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))); if (len < 0) return -1; parse_rtattr(attrs, (__L2TP_ATTR_MAX - 1), (void *)ghdr + ( ((sizeof(struct genlmsghdr))+4U -1) & ~(4U -1) ), len); if (attrs[L2TP_ATTR_PW_TYPE]) p->pw_type = rta_getattr_u16(attrs[L2TP_ATTR_PW_TYPE]); if (attrs[L2TP_ATTR_ENCAP_TYPE]) p->encap = rta_getattr_u16(attrs[L2TP_ATTR_ENCAP_TYPE]); if (attrs[L2TP_ATTR_CONN_ID]) p->tunnel_id = rta_getattr_u32(attrs[L2TP_ATTR_CONN_ID]); if (attrs[L2TP_ATTR_PEER_CONN_ID]) p->peer_tunnel_id = rta_getattr_u32(attrs[L2TP_ATTR_PEER_CONN_ID]); if (attrs[L2TP_ATTR_SESSION_ID]) p->session_id = rta_getattr_u32(attrs[L2TP_ATTR_SESSION_ID]); if (attrs[L2TP_ATTR_PEER_SESSION_ID]) p->peer_session_id = rta_getattr_u32(attrs[L2TP_ATTR_PEER_SESSION_ID]); if (attrs[L2TP_ATTR_L2SPEC_TYPE]) p->l2spec_type = rta_getattr_u8(attrs[L2TP_ATTR_L2SPEC_TYPE]); if (attrs[L2TP_ATTR_L2SPEC_LEN]) p->l2spec_len = rta_getattr_u8(attrs[L2TP_ATTR_L2SPEC_LEN]); if (attrs[L2TP_ATTR_UDP_CSUM]) p->udp_csum = !!rta_getattr_u8(attrs[L2TP_ATTR_UDP_CSUM]); p->udp6_csum_tx = !attrs[L2TP_ATTR_UDP_ZERO_CSUM6_TX]; p->udp6_csum_rx = !attrs[L2TP_ATTR_UDP_ZERO_CSUM6_RX]; if (attrs[L2TP_ATTR_COOKIE]) memcpy(p->cookie, ((void*)(((char*)(attrs[L2TP_ATTR_COOKIE])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), p->cookie_len = ((int)((attrs[L2TP_ATTR_COOKIE])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); if (attrs[L2TP_ATTR_PEER_COOKIE]) memcpy(p->peer_cookie, ((void*)(((char*)(attrs[L2TP_ATTR_PEER_COOKIE])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), p->peer_cookie_len = ((int)((attrs[L2TP_ATTR_PEER_COOKIE])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); if (attrs[L2TP_ATTR_RECV_SEQ]) p->recv_seq = !!rta_getattr_u8(attrs[L2TP_ATTR_RECV_SEQ]); if (attrs[L2TP_ATTR_SEND_SEQ]) p->send_seq = !!rta_getattr_u8(attrs[L2TP_ATTR_SEND_SEQ]); if (attrs[L2TP_ATTR_RECV_TIMEOUT]) p->reorder_timeout = rta_getattr_u64(attrs[L2TP_ATTR_RECV_TIMEOUT]); rta = attrs[L2TP_ATTR_IP_SADDR]; p->local_ip.family = 2 ; if (!rta) { rta = attrs[L2TP_ATTR_IP6_SADDR]; p->local_ip.family = 10 ; } if (rta && get_addr_rta(&p->local_ip, rta, p->local_ip.family)) return -1; rta = attrs[L2TP_ATTR_IP_DADDR]; p->peer_ip.family = 2 ; if (!rta) { rta = attrs[L2TP_ATTR_IP6_DADDR]; p->peer_ip.family = 10 ; } if (rta && get_addr_rta(&p->peer_ip, rta, p->peer_ip.family)) return -1; if (attrs[L2TP_ATTR_UDP_SPORT]) p->local_udp_port = rta_getattr_u16(attrs[L2TP_ATTR_UDP_SPORT]); if (attrs[L2TP_ATTR_UDP_DPORT]) p->peer_udp_port = rta_getattr_u16(attrs[L2TP_ATTR_UDP_DPORT]); if (attrs[L2TP_ATTR_IFNAME]) p->ifname = rta_getattr_str(attrs[L2TP_ATTR_IFNAME]); nla_stats = attrs[L2TP_ATTR_STATS]; if (nla_stats) { struct rtattr *tb[(__L2TP_ATTR_STATS_MAX - 1) + 1]; (parse_rtattr_flags((tb), ((__L2TP_ATTR_STATS_MAX - 1)), ((void*)(((char*)(nla_stats)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((nla_stats)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))); if (tb[L2TP_ATTR_TX_PACKETS]) data->stats.data_tx_packets = rta_getattr_u64(tb[L2TP_ATTR_TX_PACKETS]); if (tb[L2TP_ATTR_TX_BYTES]) data->stats.data_tx_bytes = rta_getattr_u64(tb[L2TP_ATTR_TX_BYTES]); if (tb[L2TP_ATTR_TX_ERRORS]) data->stats.data_tx_errors = rta_getattr_u64(tb[L2TP_ATTR_TX_ERRORS]); if (tb[L2TP_ATTR_RX_PACKETS]) data->stats.data_rx_packets = rta_getattr_u64(tb[L2TP_ATTR_RX_PACKETS]); if (tb[L2TP_ATTR_RX_BYTES]) data->stats.data_rx_bytes = rta_getattr_u64(tb[L2TP_ATTR_RX_BYTES]); if (tb[L2TP_ATTR_RX_ERRORS]) data->stats.data_rx_errors = rta_getattr_u64(tb[L2TP_ATTR_RX_ERRORS]); if (tb[L2TP_ATTR_RX_SEQ_DISCARDS]) data->stats.data_rx_oos_discards = rta_getattr_u64(tb[L2TP_ATTR_RX_SEQ_DISCARDS]); if (tb[L2TP_ATTR_RX_OOS_PACKETS]) data->stats.data_rx_oos_packets = rta_getattr_u64(tb[L2TP_ATTR_RX_OOS_PACKETS]); } return 0; }
int get_response(struct_1 *a0, struct_0 *a1) { unsigned int v0; unsigned long long v1; struct_0 *v2; unsigned long v3; unsigned long long v4; char v5; char v6; char v7; char v8; char v9; char v10; char v11; char v12; char v13; char v14; char v15; char v16; char v17; char v18; char v19; char v20; char v21; char v22; char v23; char v24; char v25; char v26; char v27; char v28; char v29; char v30; char v31; char v32; char v33; char v34; char v35; char v36; char v37; char v38; unsigned int v40; struct_0 *v41; unsigned long long v42; v2 = a1; if (a0->field_4 == 2) { v40 = -74; } else { v3 = &a0[2].field_4; v0 = a0->field_0 - 20; if (v0 < 0) { v40 = -1; } else { parse_rtattr(&v14, 0x23, v3 + 4, v0); if (*(&v15)) { v41 = v2; v2->field_240 = rta_getattr_u16(*(&v15)); } if (*(&v16)) { v40 = rta_getattr_u16(*(&v16)); v41 = v40; v2->field_10 = v40; } if (*(&v20)) { v41 = v2; v2->field_0 = rta_getattr_u32(*(&v20)); } if (*(&v21)) { v41 = v2; v2->field_4 = rta_getattr_u32(*(&v21)); } if (*(&v22)) { v41 = v2; v2->field_8 = rta_getattr_u32(*(&v22)); } if (*(&v23)) { v41 = v2; v2->field_c = rta_getattr_u32(*(&v23)); } if (*(&v17)) { v41 = v2; v2->field_250 = rta_getattr_u8(*(&v17)); } if (*(&v18)) { *(&v41) = v2; v2->field_251 = rta_getattr_u8(*(&v18)); } if (*(&v24)) { *(&v41) = rta_getattr_u8(*(&v24)); v41 = v2->field_242 & 4294967291 | ((v41 & 1) * 4); v2->field_242 = v41; } *(&v41) = !*(&v37); v42 = v2->field_242 & 4294967294 | v41 & 1; v2->field_242 = v42; *(&v42) = !*(&v38); *(&v42) = v2->field_242 & 4294967293 | ((v42 & 1) * 2); v2->field_242 = v42; if (*(&v25)) { v2->field_18 = *(*(&v25)) - 4; memcpy(&v2->padding_1c, *(&v25) + 4, v2->field_18); } if (*(&v26)) { v2->field_24 = *(*(&v26)) - 4; memcpy(&v2->padding_28, *(&v26) + 4, v2->field_24); } if (*(&v27)) { *(&v42) = rta_getattr_u8(*(&v27)); *(&v42) = v2->field_242 & 4294967287 | ((v42 & 1) * 8); v2->field_242 = v42; } if (*(&v28)) { *(&v42) = rta_getattr_u8(*(&v28)); *(&v42) = v2->field_242 & 4294967279 | ((v42 & 1) * 16); v2->field_242 = v42; } if (*(&v29)) v2->field_244 = rta_getattr_u64(*(&v29)); v1 = *(&v30); v2->field_36 = 2; if (!v1) { v1 = *(&v35); v2->field_36 = 10; } if (v1 && get_addr_rta(&v2->padding_28[8], v1, v2->field_36, &v2->padding_28[8])) { v40 = -1; goto LABEL_401801; } v1 = *(&v31); v2->field_13e = 2; if (!v1) { v1 = *(&v36); v2->field_13e = 10; } if (v1 && get_addr_rta(&v2->padding_38[0x100], v1, v2->field_13e, &v2->padding_38[0x100])) { v40 = -1; goto LABEL_401801; } if (*(&v32)) v2->field_14 = rta_getattr_u16(*(&v32)); if (*(&v33)) v2->field_16 = rta_getattr_u16(*(&v33)); if (*(&v19)) v2->field_248 = rta_getattr_str(*(&v19)); v4 = *(&v34); if (v4) { parse_rtattr_flags(&v5, 0xb, v4 + 4, *(v4) - 4, 0x8000); if (*(&v6)) a1->field_280 = rta_getattr_u64(*(&v6)); if (*(&v7)) a1->field_288 = rta_getattr_u64(*(&v7)); if (*(&v8)) a1->field_290 = rta_getattr_u64(*(&v8)); if (*(&v9)) a1->field_258 = rta_getattr_u64(*(&v9)); if (*(&v10)) a1->field_260 = rta_getattr_u64(*(&v10)); if (*(&v13)) a1->field_268 = rta_getattr_u64(*(&v13)); if (*(&v11)) a1->field_278 = rta_getattr_u64(*(&v11)); if (*(&v12)) a1->field_270 = rta_getattr_u64(*(&v12)); } v40 = 0; } } LABEL_401801: return v40; }
int ssh_output_space(struct ssh *ssh, size_t len) { return (0 == sshbuf_check_reserve(ssh_packet_get_output(ssh), len)); }
_BOOL8 ssh_output_space(long a1, long a2) { long output; output = ssh_packet_get_output(a1); return (unsigned int)sshbuf_check_reserve(output, a2) == 0; }
static void assemble_algorithms(ServerOptions *o) { char *all_cipher, *all_mac, *all_kex, *all_key, *all_sig; char *def_cipher, *def_mac, *def_kex, *def_key, *def_sig; int r; all_cipher = cipher_alg_list(',', 0); all_mac = mac_alg_list(','); all_kex = kex_alg_list(','); all_key = sshkey_alg_list(0, 0, 1, ','); all_sig = sshkey_alg_list(0, 1, 1, ','); def_cipher = match_filter_allowlist("chacha20-poly1305@openssh.com," "aes128-ctr,aes192-ctr,aes256-ctr," "aes128-gcm@openssh.com,aes256-gcm@openssh.com", all_cipher); def_mac = match_filter_allowlist("umac-64-etm@openssh.com," "umac-128-etm@openssh.com," "hmac-sha2-256-etm@openssh.com," "hmac-sha2-512-etm@openssh.com," "hmac-sha1-etm@openssh.com," "umac-64@openssh.com," "umac-128@openssh.com," "hmac-sha2-256," "hmac-sha2-512," "hmac-sha1", all_mac); def_kex = match_filter_allowlist("sntrup761x25519-sha512@openssh.com," "curve25519-sha256," "curve25519-sha256@libssh.org," "ecdh-sha2-nistp256," "ecdh-sha2-nistp384," "ecdh-sha2-nistp521," "diffie-hellman-group-exchange-sha256," "diffie-hellman-group16-sha512," "diffie-hellman-group18-sha512," "diffie-hellman-group14-sha256", all_kex); def_key = match_filter_allowlist("ssh-ed25519-cert-v01@openssh.com," "ecdsa-sha2-nistp256-cert-v01@openssh.com," "ecdsa-sha2-nistp384-cert-v01@openssh.com," "ecdsa-sha2-nistp521-cert-v01@openssh.com," "sk-ssh-ed25519-cert-v01@openssh.com," "sk-ecdsa-sha2-nistp256-cert-v01@openssh.com," "rsa-sha2-512-cert-v01@openssh.com," "rsa-sha2-256-cert-v01@openssh.com," "ssh-ed25519," "ecdsa-sha2-nistp256," "ecdsa-sha2-nistp384," "ecdsa-sha2-nistp521," "sk-ssh-ed25519@openssh.com," "sk-ecdsa-sha2-nistp256@openssh.com," "rsa-sha2-512," "rsa-sha2-256", all_key); def_sig = match_filter_allowlist("ssh-ed25519," "ecdsa-sha2-nistp256," "ecdsa-sha2-nistp384," "ecdsa-sha2-nistp521," "sk-ssh-ed25519@openssh.com," "sk-ecdsa-sha2-nistp256@openssh.com," "rsa-sha2-512," "rsa-sha2-256", all_sig); do { if ((r = kex_assemble_names(&o->ciphers, def_cipher, all_cipher)) != 0) sshfatal("servconf.c", __func__, 231, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s", "ciphers"); } while (0); do { if ((r = kex_assemble_names(&o->macs, def_mac, all_mac)) != 0) sshfatal("servconf.c", __func__, 232, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s", "macs"); } while (0); do { if ((r = kex_assemble_names(&o->kex_algorithms, def_kex, all_kex)) != 0) sshfatal("servconf.c", __func__, 233, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s", "kex_algorithms"); } while (0); do { if ((r = kex_assemble_names(&o->hostkeyalgorithms, def_key, all_key)) != 0) sshfatal("servconf.c", __func__, 234, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s", "hostkeyalgorithms"); } while (0); do { if ((r = kex_assemble_names(&o->hostbased_accepted_algos, def_key, all_key)) != 0) sshfatal("servconf.c", __func__, 235, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s", "hostbased_accepted_algos"); } while (0); do { if ((r = kex_assemble_names(&o->pubkey_accepted_algos, def_key, all_key)) != 0) sshfatal("servconf.c", __func__, 236, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s", "pubkey_accepted_algos"); } while (0); do { if ((r = kex_assemble_names(&o->ca_sign_algorithms, def_sig, all_sig)) != 0) sshfatal("servconf.c", __func__, 237, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "%s", "ca_sign_algorithms"); } while (0); free(all_cipher); free(all_mac); free(all_kex); free(all_key); free(all_sig); free(def_cipher); free(def_mac); free(def_kex); free(def_key); free(def_sig); }
void assemble_algorithms(unsigned long a0) { unsigned long long v0; unsigned int v1; void* v2; void* v3; void* v4; void* v5; void* v6; void* v7; void* v8; void* v9; void* v10; unsigned long long v11; unsigned long long v12; char v13; unsigned long long v15; v2 = cipher_alg_list(0x2c, 0x0); v3 = mac_alg_list(0x2c); v4 = kex_alg_list(0x2c); v5 = sshkey_alg_list(0x0, 0x0, 0x1, 0x2c); v6 = sshkey_alg_list(0x0, 0x1, 0x1, 0x2c); v7 = match_filter_allowlist("chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com", v2); v8 = match_filter_allowlist("umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1", v3); v9 = match_filter_allowlist("sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256", v4); v10 = match_filter_allowlist("ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256", v5); v11 = match_filter_allowlist("ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256", v6); v1 = kex_assemble_names(a0 + 1208, v7, v2, a0 + 1208); if (v1) { v0 = "ciphers"; sshfatal("servconf.c", "assemble_algorithms", 0xe7, 0x1, 0x1, ssh_err(v1), "%s"); } v1 = kex_assemble_names(a0 + 1216, v8, v3, a0 + 1216); if (v1) { v12 = "macs"; v11 = "%s"; sshfatal("servconf.c", "assemble_algorithms", 0xe8, 0x1, 0x1, ssh_err(v1), *(&v13)); } v1 = kex_assemble_names(a0 + 1224, v9, v4, a0 + 1224); if (v1) { v12 = "kex_algorithms"; v11 = "%s"; sshfatal("servconf.c", "assemble_algorithms", 0xe9, 0x1, 0x1, ssh_err(v1), *(&v13)); } v1 = kex_assemble_names(a0 + 0x500, v10, v5, a0 + 0x500); if (v1) { v12 = "hostkeyalgorithms"; v11 = "%s"; sshfatal("servconf.c", "assemble_algorithms", 0xea, 0x1, 0x1, ssh_err(v1), *(&v13)); } v1 = kex_assemble_names(a0 + 1272, v10, v5, a0 + 1272); if (v1) { v12 = "hostbased_accepted_algos"; v11 = "%s"; sshfatal("servconf.c", "assemble_algorithms", 0xeb, 0x1, 0x1, ssh_err(v1), *(&v13)); } v1 = kex_assemble_names(a0 + 1304, v10, v5, a0 + 1304); if (v1) { v12 = "pubkey_accepted_algos"; v11 = "%s"; sshfatal("servconf.c", "assemble_algorithms", 0xec, 0x1, 0x1, ssh_err(v1), *(&v13)); } v1 = kex_assemble_names(a0 + 1288, v11, v6, a0 + 1288); if (v1) { v12 = "ca_sign_algorithms"; v11 = "%s"; sshfatal("servconf.c", "assemble_algorithms", 0xed, 0x1, 0x1, ssh_err(v1), *(&v13)); } free(v2); free(v3); free(v4); free(v5); free(v6); free(v7); free(v8); free(v9); free(v10); v15 = free(v11); return; }
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); }
int gztell64(struct_0 *a0) { unsigned long v1; if (!a0) { v1 = -1; } else { if (a0->field_18 != 7247 && a0->field_18 != 31153) v1 = -1; if (a0->field_18 == 31153 || a0->field_18 == 7247) { if (a0->field_70) v1 = a0->field_68; else v1 = 0; *(&v1) = v1 + a0->field_10; } } return v1; }
inline errcode_t ext2fs_free_mem(void *ptr) { void *p; memcpy(&p, ptr, sizeof(p)); free(p); p = 0; memcpy(ptr, &p, sizeof(p)); return 0; }
void ext2fs_free_mem(void) { halt_baddata(); }
static int terminal_putc(int c) { if (terminal_outfile == ((void *)0) ) return -1; return fputc(c, terminal_outfile); }
int terminal_putc(int a1) { if ( terminal_outfile ) return fputc(a1, terminal_outfile); else return -1; }
test_code_t test_certificate(gnutls_session_t session) { int ret; FILE *fp; (void)remove("debug-certs.out"); if (verbose == 0) return TEST_IGNORE; sprintf(prio_str, "NONE:" "+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL" ":%s:" "+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":" "+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH" ":+VKO-GOST-12" ":%s", protocol_str, rest); { int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 1537)) != TEST_SUCCEED) { return _ret; } }; gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred); ret = test_do_handshake(session); if (ret == TEST_FAILED) return ret; fp = fopen("debug-certs.out", "w"); if (fp != ((void *)0) ) { fprintf(fp, "\n"); print_cert_info2(session, GNUTLS_CRT_PRINT_FULL, fp, verbose); fclose(fp); ext_text = "saved in debug-certs.out"; return TEST_SUCCEED; } return TEST_FAILED; }
long long test_certificate(unsigned long long a0) { unsigned int v0; unsigned int v1; void* v2; unsigned long long v4; remove("debug-certs.out"); if (!verbose) { v4 = 3; } else { sprintf(&prio_str, "NONE:+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC:+GOST28147-TC26Z-CNT:+COMP-NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT:+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH:+VKO-GOST-12:%s", &protocol_str, &rest); v0 = __gnutls_priority_set_direct(a0, &prio_str, 0x601); if (v0) { v4 = v0; } else { gnutls_credentials_set(a0, 0x1, xcred); v1 = test_do_handshake(a0); if (v1 == 1) { v4 = v1; } else { v2 = fopen("debug-certs.out", "w"); if (!v2) { v4 = 1; } else { fprintf(v2, "\n"); print_cert_info2(a0, 0x0, v2, verbose); fclose(v2); ext_text = "saved in debug-certs.out"; v4 = 0; } } } } return v4; }
static int set_xmpp_name(int type, void *crt) { int ret = 0, i; if (batch) { if (!cfg.xmpp_name) return 0; for (i = 0; cfg.xmpp_name[i] != ((void *)0) ; i ++) { if (type == 1) ret = gnutls_x509_crt_set_subject_alt_name (crt, GNUTLS_SAN_OTHERNAME_XMPP, cfg.xmpp_name[i], strlen(cfg.xmpp_name[i]), 1); else ret = gnutls_x509_crq_set_subject_alt_name (crt, GNUTLS_SAN_OTHERNAME_XMPP, cfg.xmpp_name[i], strlen(cfg.xmpp_name[i]), 1); if (ret < 0) break; } } if (ret < 0) { fprintf( stderr , "set_subject_alt_name(XMPP): %s\n", gnutls_strerror(ret)); exit(1); } return ret; }
void set_xmpp_name(unsigned long a0, unsigned long long a1) { unsigned int v0; unsigned int v1; void* v3; unsigned long long v4; v0 = 0; if (*(got.batch)) { if (*((got.cfg + 376))) { v1 = 0; while (true) { if (!*((*((got.cfg + 376)) + (v1 << 3)))) break; if (a0 == 1) v0 = gnutls_x509_crt_set_subject_alt_name(a1, 0x3e8, *((*((got.cfg + 376)) + v1 * 8)), strlen(*((*((got.cfg + 376)) + v1 * 8))), 0x1); else v0 = gnutls_x509_crq_set_subject_alt_name(a1, 0x3e8, *((*((got.cfg + 376)) + v1 * 8)), strlen(*((*((got.cfg + 376)) + v1 * 8))), 0x1); if (v0 < 0) break; v1 += 1; } } else { v3 = 0; return; } } if (v0 >= 0) { v4 = v0; return; } fprintf(*(got.stderr), "set_subject_alt_name(XMPP): %s\n", gnutls_strerror(v0)); exit(0x1); }
((*__ctype_b_loc ())[(int) (( (unsigned char)*p ))] & (unsigned short int) _ISdigit) ) { (*__errno_location ()) = 0; lval = strtol(p, &ep, 8); if (*ep) { (*__errno_location ()) = 22 ; goto out; } if ( (*__errno_location ()) == 34 && (lval == 0x7fffffffffffffffL || lval == (-0x7fffffffffffffffL - 1L) )) goto out; if (lval & ~(( 04000 | 02000 | (0400|0200|0100) | ((0400|0200|0100) >> 3) | (((0400|0200|0100) >> 3) >> 3) )| 01000 )) { (*__errno_location ()) = 22 ; goto out; } perm = (mode_t)lval; do { if (set >= endset) { ptrdiff_t setdiff = set - saveset; BITCMD *newset; setlen += 4; newset = reallocarray(saveset, setlen, sizeof(BITCMD)); if (newset == ((void *)0) ) goto out; set = newset + setdiff; saveset = newset; endset = newset + (setlen - 2); } set = addcmd(set, (mode_t)('='), (mode_t)((( 04000 | 02000 | (0400|0200|0100) | ((0400|0200|0100) >> 3) | (((0400|0200|0100) >> 3) >> 3) )| 01000 )), (mode_t)(perm), (mask)); } while ( 0); set->cmd = 0; return (saveset); }
ushort ** __ctype_b_loc(void) { halt_baddata(); }
void sshfatal(const char *file, const char *func, int line, int showfunc, LogLevel level, const char *suffix, const char *fmt, ...) { va_list args; __builtin_va_start( args , fmt ) ; sshlogv(file, func, line, showfunc, level, suffix, fmt, args); __builtin_va_end( args ) ; cleanup_exit(255); }
long long sshfatal(unsigned long long a0, unsigned long long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long a5, unsigned long long v16) { unsigned long v0; unsigned long long v1; unsigned int v2; unsigned int v3; unsigned long v4; unsigned long v5; unsigned long v6; char v7; int v8; int v9; int v10; int v11; int v12; int v13; int v14; int v15; char v17; char v18; int v19; int v20; int v21; int v22; int v23; int v24; int v25; int v26; unsigned long long *v27; if (v18) { v8 = v19; v9 = v20; v10 = v21; v11 = v22; v12 = v23; v13 = v24; v14 = v25; v15 = v26; } v1 = v16; v6 = v27[5]; v2 = 48; v3 = 48; v4 = &v17; v5 = &v7; v0 = &v2; sshlogv(a0, a1, a2, a3, a4, a5, v1); cleanup_exit(0xff); }
static struct replace_segm * add_segment (struct transform *tf) { struct replace_segm *segm = xmalloc (sizeof *segm); segm->next = ((void *)0) ; if (tf->repl_tail) tf->repl_tail->next = segm; else tf->repl_head = segm; tf->repl_tail = segm; tf->segm_count++; return segm; }
_QWORD * add_segment(long a1) { _QWORD *v2; v2 = xmalloc(32LL); *v2 = 0LL; if ( *(_QWORD *)(a1 + 96) ) **(_QWORD **)(a1 + 96) = v2; else *(_QWORD *)(a1 + 88) = v2; *(_QWORD *)(a1 + 96) = v2; ++*(_QWORD *)(a1 + 104); return v2; }
int ssh_packet_read(struct ssh *ssh) { u_char type; int r; if ((r = ssh_packet_read_seqnr(ssh, &type, ((void *)0) )) != 0) sshfatal("packet.c", __func__, 1413, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "read"); return type; }
undefined ssh_packet_read(undefined8 param_1) { undefined8 uVar1; undefined **ppuVar2; long in_FS_OFFSET; undefined *puStack56; undefined8 uStack48; undefined auStack40 [8]; undefined8 local_20; undefined local_15; int local_14; long local_10; ppuVar2 = (undefined **)auStack40; local_10 = *(long *)(in_FS_OFFSET + 0x28); uStack48 = 0x1030a1; local_20 = param_1; local_14 = ssh_packet_read_seqnr(param_1,&local_15,0); if (local_14 != 0) { uStack48 = 0x1030b4; uVar1 = ssh_err(local_14); ppuVar2 = &puStack56; puStack56 = &DAT_0010726b; sshfatal("packet.c","ssh_packet_read",0x585,1,1,uVar1); } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { *(undefined8 *)((long)ppuVar2 + -8) = 0x103106; __stack_chk_fail(); } return local_15; }
static void add_fs_type (char const *fstype) { struct fs_type_list *fsp; fsp = xmalloc (sizeof *fsp); fsp->fs_name = (char *) fstype; fsp->fs_next = fs_select_list; fs_select_list = fsp; }
void add_fs_type(unsigned long a0) { unsigned long long v0[2]; unsigned long long v3[2]; *(&v0[0]) = xmalloc(0x10); v0[0] = a0; v0[1] = fs_select_list; v3 = v0; fs_select_list[0] = v0; return; }
char * extract_colon_unit (string, p_index) char *string; int *p_index; { int i, start, len; char *value; if (string == 0) return (string); len = strlen (string); if (*p_index >= len) return ((char *) ((void *)0) ); i = *p_index; if (i && string[i] == ':') i++; for (start = i; string[i] && string[i] != ':'; i++) ; *p_index = i; if (i == start) { if (string[i]) (*p_index)++; value = (char *)sh_xmalloc((1), "general.c", 1046); value[0] = '\0'; } else value = substring (string, start, i); return (value); }
long long extract_colon_unit(void* a0, unsigned int *a1) { unsigned int *v0; unsigned int v1; unsigned int v2; unsigned int v3; void* v4; void* v6; v0 = a1; if (!a0) { v6 = a0; } else { v2 = strlen(a0); if (v2 <= *(a1)) { v6 = 0; } else { v1 = *(a1); if (v1 && *(a0 + v1) == 58) v1 += 1; for (v3 = v1; *(a0 + v1); v1 += 1) { if (*(a0 + v1) == 58) break; } *(a1) = v1; if (v1 == v3) { if (*(a0 + v1)) *(a1) = *(a1) + 1; v4 = sh_xmalloc(0x1, "general.c", 0x416); *(v4) = 0; } else { v4 = substring(a0, v3, v1, v3); } v6 = v4; } } return v6; }
static void free_identity(Identity *id) { sshkey_free(id->key); free(id->provider); free(id->comment); free(id->sk_provider); free_dest_constraints(id->dest_constraints, id->ndest_constraints); free(id); }
void free_identity(unsigned long long a0[10]) { unsigned long long v1; sshkey_free(a0[2]); free(a0[4]); free(a0[3]); free(a0[7]); free_dest_constraints(a0[8], a0[9]); v1 = free(a0); return; }
ptrdiff_t kwsexec (kwset_t kwset, char const *text, idx_t size, struct kwsmatch *kwsmatch, _Bool longest) { return kwset->kwsexec (kwset, text, size, kwsmatch, longest); }
long long kwsexec(struct_0 *a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long a4) { return a0->field_998(a0, a1, a2, a3, a4, a0->field_998); }
static void warn_changed_key(struct sshkey *host_key) { char *fp; fp = sshkey_fingerprint(host_key, options.fingerprint_hash, SSH_FP_DEFAULT); if (fp == ((void *)0) ) sshfatal("sshconnect.c", __func__, 1622, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshkey_fingerprint fail"); sshlog("sshconnect.c", __func__, 1624, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); sshlog("sshconnect.c", __func__, 1625, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @"); sshlog("sshconnect.c", __func__, 1626, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); sshlog("sshconnect.c", __func__, 1627, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!"); sshlog("sshconnect.c", __func__, 1628, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Someone could be eavesdropping on you right now (man-in-the-middle attack)!"); sshlog("sshconnect.c", __func__, 1629, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "It is also possible that a host key has just been changed."); sshlog("sshconnect.c", __func__, 1630, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "The fingerprint for the %s key sent by the remote host is\n%s.", sshkey_type(host_key), fp) ; sshlog("sshconnect.c", __func__, 1632, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Please contact your system administrator."); free(fp); }
void warn_changed_key(unsigned long long a0) { unsigned long long v0; unsigned long v1; unsigned long long v2; unsigned long long v3; unsigned long long v5; unsigned long long v6; v0 = a0; v2 = sshkey_fingerprint(v0, *(5248728), 0x0, *(5248728)); if (!v2) sshfatal("sshconnect.c", "warn_changed_key", 0x656, 0x1, 0x1, 0x0, "sshkey_fingerprint fail"); v2 = "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"; sshlog("sshconnect.c", "warn_changed_key", 0x658, 0x0, 0x2, 0x0, *(&v3)); v3 = "@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @"; sshlog("sshconnect.c", "warn_changed_key", 0x659, 0x0, 0x2, 0x0, "@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @"); v3 = "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"; sshlog("sshconnect.c", "warn_changed_key", 0x65a, 0x0, 0x2, 0x0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); v3 = "IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!"; sshlog("sshconnect.c", "warn_changed_key", 0x65b, 0x0, 0x2, 0x0, "IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!"); v3 = "Someone could be eavesdropping on you right now (man-in-the-middle attack)!"; sshlog("sshconnect.c", "warn_changed_key", 0x65c, 0x0, 0x2, 0x0, "Someone could be eavesdropping on you right now (man-in-the-middle attack)!"); v3 = "It is also possible that a host key has just been changed."; sshlog("sshconnect.c", "warn_changed_key", 0x65d, 0x0, 0x2, 0x0, "It is also possible that a host key has just been changed."); v2 = v2; v1 = sshkey_type(v0); v0 = "The fingerprint for the %s key sent by the remote host is\n%s."; sshlog("sshconnect.c", "warn_changed_key", 0x65e, 0x0, 0x2, 0x0, "It is also possible that a host key has just been changed."); v5 = "Please contact your system administrator."; sshlog("sshconnect.c", "warn_changed_key", 0x660, 0x0, 0x2, 0x0, "It is also possible that a host key has just been changed."); v6 = free(v2); return; }
static void volume_offset_coder (struct tar_stat_info const *st, char const *keyword, struct xheader *xhdr, void const *data) { off_t const *v = data; code_num (*v, keyword, xhdr); }
void volume_offset_coder(undefined8 param_1,undefined8 param_2,undefined8 param_3, undefined8 *param_4) { code_num(*param_4,param_2,param_3); return; }
void ipv64_normalise_mapped(struct sockaddr_storage *addr, socklen_t *len) { struct sockaddr_in6 *a6 = (struct sockaddr_in6 *)addr; struct sockaddr_in *a4 = (struct sockaddr_in *)addr; struct in_addr inaddr; u_int16_t port; if (addr->ss_family != 10 || ! (__extension__ ({ const struct in6_addr *__a = (const struct in6_addr *) ( &a6->sin6_addr ); __a->__in6_u.__u6_addr32[0] == 0 && __a->__in6_u.__u6_addr32[1] == 0 && __a->__in6_u.__u6_addr32[2] == htonl (0xffff); })) ) return; sshlog("canohost.c", __func__, 50, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "Normalising mapped IPv4 in IPv6 address"); memcpy(&inaddr, ((char *)&a6->sin6_addr) + 12, sizeof(inaddr)); port = a6->sin6_port; memset(a4, 0, sizeof(*a4)); a4->sin_family = 2 ; *len = sizeof(*a4); memcpy(&a4->sin_addr, &inaddr, sizeof(inaddr)); a4->sin_port = port; }
void ipv64_normalise_mapped(unsigned short a0[2], unsigned int *a1) { unsigned long long v0; unsigned short v1; char v2; unsigned short v3[2]; unsigned short v4[2]; unsigned int v5[3]; char v6; unsigned int v8; unsigned long long *v9; unsigned long long v10; *(&v3) = a0; *(&v4) = a0; if (a0[0] == 10) { *(&v5[0]) = v3 + 2; if (!v5[0] && !v5[1] && v5[2] == htonl(0xffff)) { v8 = 1; goto LABEL_400087; } v8 = 0; LABEL_400087: if (v8) { v0 = "Normalising mapped IPv4 in IPv6 address"; sshlog("canohost.c", "ipv64_normalise_mapped", 0x32, 0x0, 0x7, 0x0); memcpy(&v2, v3 + 5, 0x4); v1 = v3[1]; memset(v4, 0x0, 0x10); v4[0] = 2; *(a1) = 16; memcpy(v4 + 1, &v2, 0x4); v4[1] = v1; } } v10 = *(&v6) ^ v9[5]; return; }
ct_decode_argv(int argc, const char *argv[], ct_buffer_t *conv) { size_t bufspace; int i; wchar_t *p; wchar_t **wargv; ssize_t bytes; for (i = 0, bufspace = 0; i < argc; ++i) bufspace += argv[i] ? strlen(argv[i]) + 1 : 0; if (conv->wsize < ++bufspace) if (ct_conv_wbuff_resize(conv, bufspace + ((size_t)1024)) == -1) return ((void *)0) ; wargv = calloc((size_t)(argc + 1), sizeof(*wargv)); for (i = 0, p = conv->wbuff; i < argc; ++i) { if (!argv[i]) { wargv[i] = ((void *)0) ; continue; } else { wargv[i] = p; bytes = (ssize_t)mbstowcs(p, argv[i], bufspace); } if (bytes == -1) { free(wargv); return ((void *)0) ; } else bytes++; bufspace -= (size_t)bytes; p += bytes; } wargv[i] = ((void *)0) ; return wargv; }
long long ct_decode_argv(unsigned long a0, unsigned long long *a1, unsigned long long a2[4]) { unsigned int v0; void* v1; unsigned short *v2; unsigned long long *v3; unsigned long v4; void* v7; v0 = 0; for (v1 = 0; v0 < a0; v0 += 1) { v1 += (!a1[v0] ? strlen(a1[v0]) + 1 : 0); } *(&v1) = v1 + 1; if (*(&v1) > a2[3] && ct_conv_wbuff_resize(a2, *(&v1) + 0x400) == -1) { v7 = 0; return v7; } v3 = calloc(a0 + 1, 0x8); v0 = 0; v2 = a2[2]; while (true) { if (v0 < a0) { if (!a1[v0]) { v3[v0] = 0; } else { v3[v0] = v2; v4 = mbstowcs(v2, a1[v0], *(&v1)); if (v4 == -1) { free(v3); v7 = 0; return v7; } v4 += 1; v1 = *(&v1) - v4; v2 = &v2[2 * v4]; } v0 += 1; } else { v3[v0] = 0; v7 = v3; return v7; } } }
static int putx(c) int c; { int x; x = putc (c, rl_outstream); return x; }
long long putx(unsigned long a0) { unsigned int v0; v0 = putc(a0, rl_outstream); return v0; }
static void update_one ( const struct passwd *pw) { off_t offset; struct lastlog ll; int err; if ( ((void *)0) == pw) { return; } offset = (off_t) pw->pw_uid * sizeof (ll); err = fseeko (lastlogfile, offset, 0 ); ((void) sizeof (( 0 == err ) ? 1 : 0), __extension__ ({ if ( 0 == err ) ; else __assert_fail ( "0 == err" , "lastlog.c", 215, __extension__ __PRETTY_FUNCTION__); })) ; explicit_bzero((&ll), (sizeof (ll))); if (Sflg) { ll.ll_time = (time ((time_t *) 0)); strcpy (ll.ll_host, "localhost"); strcpy (ll.ll_line, "lastlog"); } if (fwrite (&ll, sizeof(ll), 1, lastlogfile) != 1) { fprintf ( stderr , gettext ("%s: Failed to update the entry for UID %lu\n"), Prog, (unsigned long int)pw->pw_uid); exit ( 1 ); } }
void update_one(long param_1) { uint uVar1; undefined8 uVar2; int iVar3; time_t tVar4; size_t sVar5; char *__format; long in_FS_OFFSET; undefined4 local_148; char acStack324 [32]; char acStack292 [260]; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); if (param_1 != 0) { iVar3 = fseeko(lastlogfile,(ulong)*(uint *)(param_1 + 0x10) * 0x124,0); if (iVar3 != 0) { __assert_fail("0 == err","lastlog.c",0xd7,"update_one"); } explicit_bzero(&local_148,0x124); if (Sflg != '\0') { tVar4 = time((time_t *)0x0); local_148 = (undefined4)tVar4; strcpy(acStack292,"localhost"); strcpy(acStack324,"lastlog"); } sVar5 = fwrite(&local_148,0x124,1,lastlogfile); uVar2 = Prog; if (sVar5 != 1) { uVar1 = *(uint *)(param_1 + 0x10); __format = (char *)gettext("%s: Failed to update the entry for UID %lu\n"); fprintf(stderr,__format,uVar2,(ulong)uVar1); exit(1); } } if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
static char * logical_getcwd (void) { struct stat st1; struct stat st2; char *wd = getenv ("PWD"); char *p; if (!wd || wd[0] != '/') return ((void *)0) ; p = wd; while ((p = strstr (p, "/."))) { if (!p[2] || p[2] == '/' || (p[2] == '.' && (!p[3] || p[3] == '/'))) return ((void *)0) ; p++; } if (stat (wd, &st1) == 0 && stat (".", &st2) == 0 && ((st1).st_ino == (st2).st_ino && (st1).st_dev == (st2).st_dev)) return wd; return ((void *)0) ; }
int logical_getcwd() { char *v0; char *v1; char v2; char v3; char v4; char v5; unsigned int v7; v1 = getenv("PWD"); if (!v1) { LABEL_400d42: v7 = 0; } else { if (!(*(v1) == 47)) goto LABEL_400d42; v0 = v1; while (true) { *(&v0) = strstr(v0, "/."); if (!v0) { if (!stat(v1, &v2) && !stat(".", &v4) && *(&v3) == *(&v5) && *(&v2) == *(&v4)) { v7 = v1; break; } v7 = 0; break; } if (!v0[2]) { LABEL_400db6: v7 = 0; break; } else { if (v0[2] == 47) goto LABEL_400db6; if (v0[2] != 46) { LABEL_400dc0: v0 = &v0[1]; } else if (v0[3]) { if (v0[3] == 47) goto LABEL_400db6; goto LABEL_400dc0; } } } } return v7; }
static inline _Bool is_addrtype_inet_not_unspec(const inet_prefix *p) { return (p->flags & ADDRTYPE_INET_UNSPEC) == ADDRTYPE_INET; }
int is_addrtype_inet_not_unspec(unsigned short *a0) { unsigned int v1; v1 = *(a0) & 6; *(&v1) = (*(a0) & 6) == 2; return v1; }
c__next_word(wchar_t *p, wchar_t *high, int n, int (*wtest)(wint_t)) { while (n--) { while ((p < high) && !(*wtest)(*p)) p++; while ((p < high) && (*wtest)(*p)) p++; } if (p > high) p = high; return p; }
unsigned int * c__next_word( unsigned int *a1, unsigned long a2, int a3, unsigned int ( *a4)(_QWORD)) { while ( a3-- ) { while ( (unsigned long)a1 < a2 && !a4(*a1) ) ++a1; while ( (unsigned long)a1 < a2 && a4(*a1) ) ++a1; } if ( (unsigned long)a1 > a2 ) return (unsigned int *)a2; return a1; }
void e2fsck_read_bitmaps(e2fsck_t ctx) { ext2_filsys fs = ctx->fs; errcode_t retval; const char *old_op; unsigned int save_type; int flags; if (ctx->invalid_bitmaps) { com_err(ctx->program_name, 0, (gettext ("e2fsck_read_bitmaps: illegal bitmap block(s) for %s")), ctx->device_name); fatal_error(ctx, 0); } old_op = ehandler_operation((gettext ("reading inode and block bitmaps"))); e2fsck_set_bitmap_type(fs, 2, "fs_bitmaps", &save_type); flags = ctx->fs->flags; ctx->fs->flags |= 0x200000; retval = ext2fs_read_bitmaps(fs); ctx->fs->flags = (flags & 0x200000) | (ctx->fs->flags & ~0x200000); fs->default_bitmap_type = save_type; ehandler_operation(old_op); if (retval) { com_err(ctx->program_name, retval, (gettext ("while retrying to read bitmaps for %s")), ctx->device_name); fatal_error(ctx, 0); } }
void e2fsck_read_bitmaps(long *param_1) { uint uVar1; long lVar2; long lVar3; undefined8 uVar4; long lVar5; long in_FS_OFFSET; undefined2 local_40; lVar2 = *(long *)(in_FS_OFFSET + 0x28); lVar3 = *param_1; if (*(int *)(param_1 + 0x41) != 0) { lVar5 = param_1[3]; uVar4 = gettext("e2fsck_read_bitmaps: illegal bitmap block(s) for %s"); com_err(param_1[1],0,uVar4,lVar5); fatal_error(param_1,0); } uVar4 = gettext("reading inode and block bitmaps"); uVar4 = ehandler_operation(uVar4); e2fsck_set_bitmap_type(lVar3,2,"fs_bitmaps"); uVar1 = *(uint *)(*param_1 + 0x10); *(uint *)(*param_1 + 0x10) = *(uint *)(*param_1 + 0x10) | 0x200000; lVar5 = ext2fs_read_bitmaps(lVar3); *(uint *)(*param_1 + 0x10) = *(uint *)(*param_1 + 0x10) & 0xffdfffff | uVar1 & 0x200000; *(undefined2 *)(lVar3 + 0xc4) = local_40; ehandler_operation(uVar4); if (lVar5 != 0) { lVar3 = param_1[3]; uVar4 = gettext("while retrying to read bitmaps for %s"); com_err(param_1[1],lVar5,uVar4,lVar3); fatal_error(param_1,0); } if (lVar2 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
void process_archive(const char *filename) { static const struct tar_operations tf = { .read = tarfileread, .extract_file = tarobject, .link = tarobject, .symlink = tarobject, .mkdir = tarobject, .mknod = tarobject, }; static int p1[2]; static enum pkgstatus oldversionstatus; static struct tarcontext tc; struct tar_archive tar; struct dpkg_error err; enum parsedbflags parsedb_flags; int rc; pid_t pid; struct pkginfo *pkg, *otherpkg; struct pkg_list *conflictor_iter; char *cidir = ((void *)0) ; char *cidirrest; char *psize; const char *pfilename; struct fsys_namenode_queue newconffiles, newfiles_queue; struct stat stab; cleanup_pkg_failed= cleanup_conflictor_failed= 0; pfilename = summarize_filename(filename); if (stat(filename, &stab)) ohshite(gettext("cannot access archive '%s'"), filename); if (!f_noact) { if (!deb_reassemble(&filename, &pfilename)) return; } if (!f_nodebsig) deb_verify(filename); cidir = get_control_dir(cidir); cidirrest = cidir + strlen(cidir); push_cleanup(cu_cidir, ~0, 2, (void *)cidir, (void *)cidirrest); pid = subproc_fork(); if (pid == 0) { cidirrest[-1] = '\0'; execlp("dpkg-deb", "dpkg-deb", "--control", filename, cidir, ((void *)0) ); ohshite(gettext("unable to execute %s (%s)"), gettext("package control information extraction"), "dpkg-deb"); } subproc_reap(pid, "dpkg-deb" " --control", 0); dir_sync_contents(cidir); strcpy(cidirrest,"control"); if (cipaction->arg_int == act_avail) parsedb_flags = pdb_parse_available; else parsedb_flags = pdb_parse_binary; parsedb_flags |= pdb_ignore_archives; if (in_force(FORCE_BAD_VERSION)) parsedb_flags |= pdb_lax_version_parser; parsedb(cidir, parsedb_flags, &pkg); if (!pkg->archives) { pkg->archives = nfmalloc(sizeof(*pkg->archives)); pkg->archives->next = ((void *)0) ; pkg->archives->name = ((void *)0) ; pkg->archives->msdosname = ((void *)0) ; pkg->archives->md5sum = ((void *)0) ; } psize = nfmalloc(30); sprintf(psize, "%jd", (intmax_t)stab.st_size); pkg->archives->size = psize; if (cipaction->arg_int == act_avail) { printf(gettext("Recorded info about %s from %s.\n"), pkgbin_name(pkg, &pkg->available, pnaw_nonambig), pfilename); pop_cleanup(ehflag_normaltidy); return; } if (pkg->available.arch->type != DPKG_ARCH_ALL && pkg->available.arch->type != DPKG_ARCH_NATIVE && pkg->available.arch->type != DPKG_ARCH_FOREIGN) forcibleerr(FORCE_ARCHITECTURE, gettext("package architecture (%s) does not match system (%s)"), pkg->available.arch->name, dpkg_arch_get(DPKG_ARCH_NATIVE)->name); clear_deconfigure_queue(); clear_istobes(); if (wanttoinstall(pkg)) { pkg_set_want(pkg, PKG_WANT_INSTALL); } else { pop_cleanup(ehflag_normaltidy); return; } for (otherpkg = &pkg->set->pkg; otherpkg; otherpkg = otherpkg->arch_next) { if (otherpkg == pkg) continue; if (otherpkg->status <= PKG_STAT_HALFCONFIGURED) continue; if (dpkg_version_compare(&pkg->available.version, &otherpkg->installed.version)) enqueue_deconfigure(otherpkg, ((void *)0) ); } pkg_check_depcon(pkg, pfilename); ensure_allinstfiles_available(); fsys_hash_init(); trig_file_interests_ensure(); printf(gettext("Preparing to unpack %s ...\n"), pfilename); if (pkg->status != PKG_STAT_NOTINSTALLED && pkg->status != PKG_STAT_CONFIGFILES) { log_action("upgrade", pkg, &pkg->installed); } else { log_action("install", pkg, &pkg->available); } if (f_noact) { pop_cleanup(ehflag_normaltidy); return; } trig_activate_packageprocessing(pkg); strcpy(cidirrest, "triggers"); trig_parse_ci(cidir, ((void *)0) , trig_cicb_statuschange_activate, pkg, &pkg->available); newconffiles.head = ((void *)0) ; newconffiles.tail = &newconffiles.head; push_cleanup(cu_fileslist, ~0, 0); strcpy(cidirrest,"conffiles"); deb_parse_conffiles(pkg, cidir, &newconffiles); pkg_conffiles_mark_old(pkg); for (conflictor_iter = conflictors.head; conflictor_iter; conflictor_iter = conflictor_iter->next) pkg_conffiles_mark_old(conflictor_iter->pkg); oldversionstatus= pkg->status; if (oldversionstatus > PKG_STAT_INSTALLED) do_internerr("unpack.c", 1369, __func__, "package %s state %d is out-of-bounds", pkg_name(pkg, pnaw_always), oldversionstatus) ; debug(dbg_general,"process_archive oldversionstatus=%s", statusstrings[oldversionstatus]); if (oldversionstatus == PKG_STAT_HALFCONFIGURED || oldversionstatus == PKG_STAT_TRIGGERSAWAITED || oldversionstatus == PKG_STAT_TRIGGERSPENDING || oldversionstatus == PKG_STAT_INSTALLED) { pkg_set_eflags(pkg, PKG_EFLAG_REINSTREQ); pkg_set_status(pkg, PKG_STAT_HALFCONFIGURED); modstatdb_note(pkg); push_cleanup(cu_prermupgrade, ~ehflag_normaltidy, 1, (void *)pkg); if (dpkg_version_compare(&pkg->available.version, &pkg->installed.version) >= 0) maintscript_fallback(pkg, "prerm", "pre-removal", cidir, cidirrest, "upgrade", "failed-upgrade"); else maintscript_installed(pkg, "prerm", "pre-removal", "upgrade", versiondescribe(&pkg->available.version, vdew_nonambig), ((void *)0) ); pkg_set_status(pkg, PKG_STAT_UNPACKED); oldversionstatus = PKG_STAT_UNPACKED; modstatdb_note(pkg); } pkg_deconfigure_others(pkg); for (conflictor_iter = conflictors.head; conflictor_iter; conflictor_iter = conflictor_iter->next) { struct pkginfo *conflictor = conflictor_iter->pkg; if (!(conflictor->status == PKG_STAT_HALFCONFIGURED || conflictor->status == PKG_STAT_TRIGGERSAWAITED || conflictor->status == PKG_STAT_TRIGGERSPENDING || conflictor->status == PKG_STAT_INSTALLED)) continue; trig_activate_packageprocessing(conflictor); pkg_set_status(conflictor, PKG_STAT_HALFCONFIGURED); modstatdb_note(conflictor); push_cleanup(cu_prerminfavour, ~ehflag_normaltidy, 2, conflictor, pkg); maintscript_installed(conflictor, "prerm", "pre-removal", "remove", "in-favour", pkgbin_name(pkg, &pkg->available, pnaw_nonambig), versiondescribe(&pkg->available.version, vdew_nonambig), ((void *)0) ); pkg_set_status(conflictor, PKG_STAT_HALFINSTALLED); modstatdb_note(conflictor); } pkg_set_eflags(pkg, PKG_EFLAG_REINSTREQ); if (pkg->status == PKG_STAT_NOTINSTALLED) { pkg->installed.version= pkg->available.version; pkg->installed.multiarch = pkg->available.multiarch; } pkg_set_status(pkg, PKG_STAT_HALFINSTALLED); modstatdb_note(pkg); if (oldversionstatus == PKG_STAT_NOTINSTALLED) { push_cleanup(cu_preinstverynew, ~ehflag_normaltidy, 3,(void*)pkg,(void*)cidir,(void*)cidirrest); maintscript_new(pkg, "preinst", "pre-installation", cidir, cidirrest, "install", ((void *)0) ); } else if (oldversionstatus == PKG_STAT_CONFIGFILES) { push_cleanup(cu_preinstnew, ~ehflag_normaltidy, 3,(void*)pkg,(void*)cidir,(void*)cidirrest); maintscript_new(pkg, "preinst", "pre-installation", cidir, cidirrest, "install", versiondescribe(&pkg->installed.version, vdew_nonambig), versiondescribe(&pkg->available.version, vdew_nonambig), ((void *)0) ); } else { push_cleanup(cu_preinstupgrade, ~ehflag_normaltidy, 4,(void*)pkg,(void*)cidir,(void*)cidirrest,(void*)&oldversionstatus); maintscript_new(pkg, "preinst", "pre-installation", cidir, cidirrest, "upgrade", versiondescribe(&pkg->installed.version, vdew_nonambig), versiondescribe(&pkg->available.version, vdew_nonambig), ((void *)0) ); } if (oldversionstatus == PKG_STAT_NOTINSTALLED || oldversionstatus == PKG_STAT_CONFIGFILES) { printf(gettext("Unpacking %s (%s) ...\n"), pkgbin_name(pkg, &pkg->available, pnaw_nonambig), versiondescribe(&pkg->available.version, vdew_nonambig)); } else { printf(gettext("Unpacking %s (%s) over (%s) ...\n"), pkgbin_name(pkg, &pkg->available, pnaw_nonambig), versiondescribe(&pkg->available.version, vdew_nonambig), versiondescribe(&pkg->installed.version, vdew_nonambig)); } m_pipe(p1); push_cleanup(cu_closepipe, ehflag_bombout, 1, (void *)&p1[0]); pid = subproc_fork(); if (pid == 0) { m_dup2(p1[1],1); close(p1[0]); close(p1[1]); execlp("dpkg-deb", "dpkg-deb", "--fsys-tarfile", filename, ((void *)0) ); ohshite(gettext("unable to execute %s (%s)"), gettext("package filesystem archive extraction"), "dpkg-deb"); } close(p1[1]); p1[1] = -1; newfiles_queue.head = ((void *)0) ; newfiles_queue.tail = &newfiles_queue.head; tc.newfiles_queue = &newfiles_queue; push_cleanup(cu_fileslist, ~0, 0); tc.pkg= pkg; tc.backendpipe= p1[0]; tc.pkgset_getting_in_sync = pkgset_getting_in_sync(pkg); tar.err = (struct dpkg_error){ DPKG_MSG_NONE, 0, ((void *)0) }; tar.ctx = &tc; tar.ops = &tf; rc = tar_extractor(&tar); if (rc) dpkg_error_print(&tar.err, gettext("corrupted filesystem tarfile in package archive")); if (buffer_skip_Int(p1[0], 0, -1, &err) < 0) ohshit(gettext("cannot zap possible trailing zeros from dpkg-deb: %s"), err.str); close(p1[0]); p1[0] = -1; subproc_reap(pid, "dpkg-deb" " --fsys-tarfile", SUBPROC_NOPIPE); tar_deferred_extract(newfiles_queue.head, pkg); if (oldversionstatus == PKG_STAT_HALFINSTALLED || oldversionstatus == PKG_STAT_UNPACKED) { pkg_set_status(pkg, PKG_STAT_HALFINSTALLED); modstatdb_note(pkg); push_cleanup(cu_postrmupgrade, ~ehflag_normaltidy, 1, (void *)pkg); maintscript_fallback(pkg, "postrm", "post-removal", cidir, cidirrest, "upgrade", "failed-upgrade"); } push_checkpoint(~ehflag_bombout, ehflag_normaltidy); pkg_remove_old_files(pkg, &newfiles_queue, &newconffiles); write_filelist_except(pkg, &pkg->available, newfiles_queue.head, 0); strcpy(cidirrest, "triggers"); trig_parse_ci(pkg_infodb_get_file(pkg, &pkg->installed, "triggers"), trig_cicb_interest_delete, ((void *)0) , pkg, &pkg->installed); trig_parse_ci(cidir, trig_cicb_interest_add, ((void *)0) , pkg, &pkg->available); trig_file_interests_save(); debug(dbg_general, "process_archive updating info directory"); pkg_infodb_update(pkg, cidir, cidirrest); write_filehash_except(pkg, &pkg->available, newfiles_queue.head, 0); pkg_update_fields(pkg, &newconffiles); for (otherpkg = &pkg->set->pkg; otherpkg; otherpkg = otherpkg->arch_next) { if (otherpkg == pkg) continue; if (otherpkg->installed.arch != pkg->installed.arch) continue; if (otherpkg->status != PKG_STAT_NOTINSTALLED) do_internerr("unpack.c", 1663, __func__, "other package %s instance in state %s instead of not-installed", pkg_name(otherpkg, pnaw_always), pkg_status_name(otherpkg)) ; pkg_blank(otherpkg); } pkg_disappear_others(pkg); pkg_remove_files_from_others(pkg, newfiles_queue.head); pkg_set_status(pkg, PKG_STAT_UNPACKED); modstatdb_note(pkg); pkg_remove_backup_files(pkg, newfiles_queue.head); pkg_reset_eflags(pkg); modstatdb_note(pkg); push_checkpoint(~ehflag_bombout, ehflag_normaltidy); while (!pkg_queue_is_empty(&conflictors)) { struct pkginfo *conflictor = pkg_queue_pop(&conflictors); ensure_allinstfiles_available(); removal_bulk(conflictor); } if (cipaction->arg_int == act_install) enqueue_package_mark_seen(pkg); }
long long process_archive(char *a0, unsigned long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { int tmp_23; unsigned long v0; unsigned long v1; char v2; char v3; char v4; char v5; unsigned int v6; unsigned int v7; unsigned int v8; char v9; unsigned long long v10; struct_1 *v11; struct_0 *v12; char *v13; char *v14; char *v15; unsigned long long v16; struct_3 *v17; char v18; char v19; void* v20; unsigned long v21; void* v22; unsigned long v23; unsigned int v24; unsigned int v25; void* v26; unsigned long long v27; unsigned long long v28; char v29; char v30; unsigned long long v34; unsigned long long v37; unsigned long long v38; unsigned long long v39; unsigned long long v40; unsigned long long v41; unsigned long long v42; v13 = 0; cleanup_conflictor_failed = 0; cleanup_pkg_failed = cleanup_conflictor_failed; v10 = summarize_filename(a0); if (stat(a0, &v29)) ohshite(gettext("cannot access archive '%s'"), a0); if (!f_noact && (deb_reassemble(&v3, &v10, &v10, a3, a4, a5) ^ 1)) return 0; if (!f_nodebsig) deb_verify(a0, a1, &v10, a3, a4, a5); v13 = get_control_dir(v13, a1); v14 = &v13[strlen(v13)]; push_cleanup(got.cu_cidir, 0xffffffff, 0x2, v13); v7 = subproc_fork(a0, 0xffffffff, 0x2, a3, a4, a5); if (!v7) { v14[1] = 0; execlp("dpkg-deb", "dpkg-deb"); ohshite(gettext("unable to execute %s (%s)"), gettext("package control information extraction")); } subproc_reap(v7, "dpkg-deb --control", 0x0); dir_sync_contents(v13); strcpy(v14, "control"); if (*((cipaction + 40)) == 38) v6 = 582; else v6 = 7; v6 |= 16; if (in_force(0x8)) v6 |= 64; parsedb(v13, v6, &v9, v6); if (!*((*(&v9) + 320))) { *((*(&v9) + 320)) = nfmalloc(0x28); *(*((*(&v9) + 320))) = 0; *((*((*(&v9) + 320)) + 8)) = 0; *((*((*(&v9) + 320)) + 16)) = 0; *((*((*(&v9) + 320)) + 32)) = 0; } v15 = nfmalloc(0x1e); sprintf(v15, "%jd", *(&v30)); *((*((*(&v9) + 320)) + 24)) = v15; if (*((cipaction + 40)) == 38) { v34 = pkgbin_name(*(&v9), *(&v9) + 192, 0x1, *(&v9) + 192); printf(gettext("Recorded info about %s from %s.\n")); pop_cleanup(0x1); return 0; } switch (*((*((*(&v9) + 208)) + 16))) { case 4: case 5: case 6: break; default: forcibleerr(0x1, gettext("package architecture (%s) does not match system (%s)"), *((*((*(&v9) + 208)) + 8)), *((dpkg_arch_get(0x5) + 8))); } clear_deconfigure_queue(); clear_istobes(a0, a1, a2, a3, v13, 0x0); if (!wanttoinstall(*(&v9))) { pop_cleanup(0x1); return 0; } pkg_set_want(*(&v9), 0x1); for (v11 = *(*(&v9)) + 16; v11; v11 = v11->field_8) { if (v11 != *(&v9) && v11->field_18 > 4 && dpkg_version_compare(*(&v9) + 272, &v11[5].field_8 + 4, &v11[5].field_8 + 4)) enqueue_deconfigure(v11, 0x0); } pkg_check_depcon(*(&v9), v10); ensure_allinstfiles_available(a0, a1, a2, a3, v13, 0x0); fsys_hash_init(a0, a1, a2, a3, v13, 0x0); trig_file_interests_ensure(a0, a1, a2, a3, v13, 0x0); printf(gettext("Preparing to unpack %s ...\n")); switch (*((*(&v9) + 24))) { case 0: case 1: log_action("install", *(&v9), *(&v9) + 192); default: log_action("upgrade", *(&v9), *(&v9) + 72); break; } if (f_noact) { pop_cleanup(0x1); return 0; } trig_activate_packageprocessing(*(&v9)); strcpy(v14, "triggers"); trig_parse_ci(v13, 0x0, got.trig_cicb_statuschange_activate, *(&v9), *(&v9) + 192); v20 = 0; v21 = &v20; push_cleanup(got.cu_fileslist, 0xffffffff, 0x0, a3); strcpy(v14, "conffiles"); deb_parse_conffiles(*(&v9), v13, &v20); pkg_conffiles_mark_old(*(&v9)); for (v12 = conflictors; v12; v12 = v12->field_0) { pkg_conffiles_mark_old(v12->field_8); } oldversionstatus.6720 = *((*(&v9) + 24)); if (oldversionstatus.6720 > 7) do_internerr("unpack.c", 0x559, "process_archive", "package %s state %d is out-of-bounds", pkg_name(*(&v9), 0x3), oldversionstatus.6720); debug(0x1, "process_archive oldversionstatus=%s", (&statusstrings)[oldversionstatus.6720], a3); switch (oldversionstatus.6720) { case 4: case 5: case 6: case 7: pkg_set_eflags(*(&v9), 0x1); pkg_set_status(*(&v9), 0x4); modstatdb_note(*(&v9)); push_cleanup(got.cu_prermupgrade, 0xfffffffe, 0x1, *(&v9)); if (dpkg_version_compare(*(&v9) + 272, *(&v9) + 152, *(&v9) + 152) < 0) { maintscript_installed(*(&v9), "prerm", "pre-removal", "upgrade", versiondescribe(*(&v9) + 272, 0x1), 0x0, *(&v2), a0, *(&v4), *(&v5)); } else { maintscript_fallback(*(&v9), "prerm", "pre-removal", v13, v14, "upgrade"); break; } pkg_set_status(*(&v9), 0x3); oldversionstatus.6720 = 3; modstatdb_note(*(&v9)); default: goto LABEL_403ca7; } LABEL_403ca7: pkg_deconfigure_others(*(&v9)); for (v12 = conflictors; v12; v12 = v12->field_0) { v17 = v12->field_8; switch (v17->field_18) { case 4: case 5: case 6: case 7: trig_activate_packageprocessing(v17); pkg_set_status(v17, 0x4); modstatdb_note(v17); push_cleanup(got.cu_prerminfavour, 0xfffffffe, 0x2, v17); maintscript_installed(v17, "prerm", "pre-removal", "remove", "in-favour", pkgbin_name(*(&v9), *(&v9) + 192, 0x1, *(&v9) + 192), versiondescribe(*(&v9) + 272, 0x1), 0x0, *(&v2), a0); pkg_set_status(v17, 0x2); modstatdb_note(v17); break; default: goto LABEL_403e24; } LABEL_403e24: } pkg_set_eflags(*(&v9), 0x1); if (!*((*(&v9) + 24))) { tmp_23 = *((*(&v9) + 280)); *((*(&v9) + 152)) = *((*(&v9) + 272)); *((*(&v9) + 160)) = tmp_23; *((*(&v9) + 168)) = *((*(&v9) + 288)); *((*(&v9) + 84)) = *((*(&v9) + 204)); } pkg_set_status(*(&v9), 0x2); modstatdb_note(*(&v9)); switch (oldversionstatus.6720) { case 0: push_cleanup(got.cu_preinstverynew, 0xfffffffe, 0x3, *(&v9)); maintscript_new(*(&v9), "preinst", "pre-installation", v13, v14, "install"); break; case 1: push_cleanup(got.cu_preinstnew, 0xfffffffe, 0x3, *(&v9)); v1 = versiondescribe(*(&v9) + 272, 0x1); v0 = versiondescribe(*(&v9) + 152, 0x1); maintscript_new(*(&v9), "preinst", "pre-installation", v13, v14, "install"); break; default: push_cleanup(got.cu_preinstupgrade, 0xfffffffe, 0x4, *(&v9)); v1 = versiondescribe(*(&v9) + 272, 0x1); v0 = versiondescribe(*(&v9) + 152, 0x1); maintscript_new(*(&v9), "preinst", "pre-installation", v13, v14, "upgrade"); break; } switch (oldversionstatus.6720) { case 0: case 1: v37 = versiondescribe(*(&v9) + 272, 0x1); v39 = pkgbin_name(*(&v9), *(&v9) + 192, 0x1, *(&v9) + 192); printf(gettext("Unpacking %s (%s) ...\n")); break; default: v38 = versiondescribe(*(&v9) + 152, 0x1); v40 = versiondescribe(*(&v9) + 272, 0x1); v41 = pkgbin_name(*(&v9), *(&v9) + 192, 0x1, *(&v9) + 192); printf(gettext("Unpacking %s (%s) over (%s) ...\n")); } m_pipe(&p1.6719); push_cleanup(got.cu_closepipe, 0x2, 0x1, &p1.6719); v7 = subproc_fork(a0, 0x2, 0x1, &p1.6719, v13, a5); if (!v7) { m_dup2(g_40490c, 0x1); close(p1.6719); close(g_40490c); execlp("dpkg-deb", "dpkg-deb"); ohshite(gettext("unable to execute %s (%s)"), gettext("package filesystem archive extraction")); } close(g_40490c); g_40490c = -1; v22 = 0; v23 = &v22; g_404930 = &v22; push_cleanup(got.cu_fileslist, 0xffffffff, 0x0, a0); g_404928 = *(&v9); tc.6721 = p1.6719; g_404938 = pkgset_getting_in_sync(*(&v9)); v24 = 0; v25 = 0; v26 = 0; v28 = &tc.6721; v27 = &tf.6718; v8 = tar_extractor(&v24); if (v8) { v42 = gettext("corrupted filesystem tarfile in package archive"); dpkg_error_print(&v24, v42, v42); } if (buffer_skip_Int(p1.6719, 0x0, 0xffffffffffffffff, &v18) < 0) ohshit(gettext("cannot zap possible trailing zeros from dpkg-deb: %s"), *(&v19), 0xffffffffffffffff, &v18); close(p1.6719); p1.6719 = -1; subproc_reap(v7, "dpkg-deb --fsys-tarfile", 0x2); tar_deferred_extract(v22, *(&v9), *(&v9)); switch (oldversionstatus.6720) { case 2: case 3: pkg_set_status(*(&v9), 0x2); modstatdb_note(*(&v9)); push_cleanup(got.cu_postrmupgrade, 0xfffffffe, 0x1, *(&v9)); maintscript_fallback(*(&v9), "postrm", "post-removal", v13, v14, "upgrade"); break; default: goto LABEL_404532; } LABEL_404532: push_checkpoint(0xfffffffd, 0x1); pkg_remove_old_files(*(&v9), &v22, &v20); write_filelist_except(*(&v9), *(&v9) + 192, v22, 0x0); strcpy(v14, "triggers"); trig_parse_ci(pkg_infodb_get_file(*(&v9), *(&v9) + 72, "triggers", *(&v9) + 72), got.trig_cicb_interest_delete, 0x0, *(&v9), *(&v9) + 72); trig_parse_ci(v13, got.trig_cicb_interest_add, 0x0, *(&v9), *(&v9) + 192); trig_file_interests_save(v7, a1, 0x0, a0, v13, a5); debug(0x1, "process_archive updating info directory", 0x0, a0); pkg_infodb_update(*(&v9), v13, v14); write_filehash_except(*(&v9), *(&v9) + 192, v22, 0x0); pkg_update_fields(*(&v9), &v20); for (v11 = *(*(&v9)) + 16; v11; v11 = v11->field_8) { if (v11 != *(&v9) && v11->field_58 == *((*(&v9) + 88))) { if (v11->field_18) do_internerr("unpack.c", 0x67f, "process_archive", "other package %s instance in state %s instead of not-installed", pkg_name(v11, 0x3), pkg_status_name(v11)); pkg_blank(v11); } } pkg_disappear_others(*(&v9), a1, v11->field_58, a0); pkg_remove_files_from_others(*(&v9), v22, v22, a0); pkg_set_status(*(&v9), 0x3); modstatdb_note(*(&v9)); pkg_remove_backup_files(*(&v9), v22); pkg_reset_eflags(*(&v9)); modstatdb_note(*(&v9)); push_checkpoint(0xfffffffd, 0x1); while (!pkg_queue_is_empty(&conflictors)) { v16 = pkg_queue_pop(&conflictors); ensure_allinstfiles_available(&conflictors, 0x1, v11->field_58, a0, v13, a5); removal_bulk(v16); } if (*((cipaction + 40)) == 3) { enqueue_package_mark_seen(*(&v9)); return 0; } return 0; }
void flush_read (void) { flush_read_ptr (); }
void flush_read() { unsigned long long v1; v1 = *(4213560)(); return; }
static int worst_cost (const struct predicate *p) { if (p) { unsigned int cost_r, cost_l, worst; cost_l = worst_cost (p->pred_left); cost_r = worst_cost (p->pred_right); worst = (cost_l > cost_r) ? cost_l : cost_r; if (worst < p->p_cost) worst = p->p_cost; return worst; } else { return 0; } }
int worst_cost(struct_0 *a0) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v4; unsigned int v5; if (a0) { v1 = worst_cost(a0->field_110); v2 = worst_cost(a0->field_118); v5 = v1; if (v1 <= v2) v5 = v2; v0 = v5; if (v0 < a0->field_20) v0 = a0->field_20; v4 = v0; } else { v4 = 0; } return v4; }
static void prepareBackground(const int parentPipeFD) { if(Debug) { r_dbgprintf("rsyslogd.c", "rsyslogd: in child, finalizing initialization\n"); }; dbgTimeoutToStderr = 0; int r = setsid(); if(r == -1) { char err[1024]; char em[2048]; rs_strerror_r( (*__errno_location ()) , err, sizeof(err)); snprintf(em, sizeof(em)-1, "rsyslog: error " "auto-backgrounding: %s\n", err); r_dbgprintf("rsyslogd.c", "%s\n", em); fprintf( stderr , "%s", em); } int beginClose = 3; const int endClose = getdtablesize(); close(0); for(int i = beginClose ; i <= endClose ; ++i) { if((i != dbgGetDbglogFd()) && (i != parentPipeFD)) { close(i); } } seedRandomNumberForChild(); }
void prepareBackground(unsigned long a0, unsigned long a1, unsigned long long a2) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; char v4; char v5; char v6; unsigned long long *v8; unsigned long long v9; if (Debug) r_dbgprintf("rsyslogd.c", "rsyslogd: in child, finalizing initialization\n", a2); dbgTimeoutToStderr = 0; v1 = setsid(); if (v1 == -1) { rs_strerror_r(*(__errno_location()), &v4, 0x400, &v4); snprintf(&v5, 0x7ff, "rsyslog: error auto-backgrounding: %s\n", &v4); r_dbgprintf("rsyslogd.c", "%s\n", &v5); fprintf(stderr, "%s", &v5); } v2 = 3; v3 = getdtablesize(); close(0x0); for (v0 = v2; v0 <= v3; v0 += 1) { if (v0 != dbgGetDbglogFd() && v0 != a0) close(v0); } seedRandomNumberForChild(); v9 = *(&v6) ^ v8[5]; return; }
int xfrm_reqid_parse(__u32 *reqid, int *argcp, char ***argvp) { int argc = *argcp; char **argv = *argvp; if (get_u32(reqid, *argv, 0)) invarg("REQID value is invalid", *argv); *argcp = argc; *argvp = argv; return 0; }
long xfrm_reqid_parse(long a1, int *a2, _QWORD **a3) { int v5; _QWORD *v6; v5 = *a2; v6 = *a3; if ( (unsigned int)get_u32(a1, **a3, 0LL) ) invarg("REQID value is invalid", *v6); *a2 = v5; *a3 = v6; return 0LL; }