input
stringlengths
28
169k
output
stringlengths
20
317k
(r = sshbuf_put_bignum2(b, server_dh_pub)) != 0 || (r = sshbuf_put(b, shared_secret, secretlen)) != 0) { sshbuf_free(b); return r; }
void sshbuf_put_bignum2(void) { halt_baddata(); }
static void re_nextline(EditLine *el) { el->el_refresh.r_cursor.h = 0; if (el->el_refresh.r_cursor.v + 1 >= el->el_terminal.t_size.v) { int i, lins = el->el_terminal.t_size.v; wint_t *firstline = el->el_vdisplay[0]; for(i = 1; i < lins; i++) el->el_vdisplay[i - 1] = el->el_vdisplay[i]; firstline[0] = '\0'; el->el_vdisplay[i - 1] = firstline; } else el->el_refresh.r_cursor.v++; ; }
_DWORD * re_nextline(long a1) { _DWORD *result; int i; int v3; _DWORD *v4; *(_DWORD *)(a1 + 784) = 0; if ( *(_DWORD *)(a1 + 788) + 1 < *(_DWORD *)(a1 + 148) ) { result = (_DWORD *)a1; ++*(_DWORD *)(a1 + 788); } else { v3 = *(_DWORD *)(a1 + 148); v4 = **(_DWORD ***)(a1 + 64); for ( i = 1; i < v3; ++i ) *(_QWORD *)(*(_QWORD *)(a1 + 64) + 8LL * i - 8) = *(_QWORD *)(*(_QWORD *)(a1 + 64) + 8LL * i); *v4 = 0; result = v4; *(_QWORD *)(*(_QWORD *)(a1 + 64) + 8LL * i - 8) = v4; } return result; }
static void ssh_init_stdio_forwarding(struct ssh *ssh) { Channel *c; int in, out; if (options.stdio_forward_host == ((void *)0) ) return; sshlog("ssh.c", __func__, 1880, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "%s:%d", options.stdio_forward_host, options.stdio_forward_port) ; if ((in = dup( 0 )) == -1 || (out = dup( 1 )) == -1) sshfatal("ssh.c", __func__, 1885, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "dup() in/out failed"); if ((c = channel_connect_stdio_fwd(ssh, options.stdio_forward_host, options.stdio_forward_port, in, out, 2)) == ((void *)0) ) sshfatal("ssh.c", __func__, 1889, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "channel_connect_stdio_fwd failed"); channel_register_cleanup(ssh, c->self, client_cleanup_stdio_fwd, 0); channel_register_open_confirm(ssh, c->self, ssh_stdio_confirm, ((void *)0) ); }
void ssh_init_stdio_forwarding(unsigned long long a0) { unsigned long long v0; unsigned int v1; unsigned int v2; unsigned long long v3; unsigned long long v5; unsigned long long v6; v5 = 5011099010397275151; v0 = 4483503085816316; sshlog("ssh.c", "ssh_init_stdio_forwarding", 0x758, 0x1, 0x7, 0x0, "%s:%d", 0x458b0000010a840f); v1 = dup(0x0); if (v1 != -1) v2 = dup(0x1); if (v2 == -1 || v1 == -1) { v0 = "dup() in/out failed"; sshfatal("ssh.c", "ssh_init_stdio_forwarding", 0x75d, 0x1, 0x1, 0x0); } v3 = channel_connect_stdio_fwd(a0, 0x458b0000010a840f, 0xfedb8e8c789fc, v1, v2, 0x2); if (!v3) { v3 = "channel_connect_stdio_fwd failed"; sshfatal("ssh.c", "ssh_init_stdio_forwarding", 0x761, 0x1, 0x1, 0x0); } channel_register_cleanup(a0, *((v3 + 4)), client_cleanup_stdio_fwd, 0x0); v6 = channel_register_open_confirm(a0, *((v3 + 4)), ssh_stdio_confirm, 0x0); return; }
static void cp_option_init (struct cp_options *x) { cp_options_default (x); x->copy_as_regular = 1 ; x->reflink_mode = REFLINK_AUTO; x->dereference = DEREF_ALWAYS; x->unlink_dest_before_opening = 1 ; x->unlink_dest_after_failed_open = 0 ; x->hard_link = 0 ; x->interactive = I_UNSPECIFIED; x->move_mode = 0 ; x->install_mode = 1 ; x->one_file_system = 0 ; x->preserve_ownership = 0 ; x->preserve_links = 0 ; x->preserve_mode = 0 ; x->preserve_timestamps = 0 ; x->explicit_no_preserve_mode = 0 ; x->reduce_diagnostics= 0 ; x->data_copy_required = 1 ; x->require_preserve = 0 ; x->require_preserve_xattr = 0 ; x->recursive = 0 ; x->sparse_mode = SPARSE_AUTO; x->symbolic_link = 0 ; x->backup_type = no_backups; x->set_mode = 1 ; x->mode = 0400 | 0200 ; x->stdin_tty = 0 ; x->open_dangling_dest_symlink = 0 ; x->update = 0 ; x->require_preserve_context = 0 ; x->preserve_security_context = 0 ; x->set_security_context = ((void *)0) ; x->preserve_xattr = 0 ; x->verbose = 0 ; x->dest_info = ((void *)0) ; x->src_info = ((void *)0) ; }
void cp_option_init(struct_0 *a0) { struct_0 *v1; cp_options_default(a0); a0->field_14 = 1; a0->field_44 = 1; a0->field_4 = 4; a0->field_15 = 1; a0->field_16 = 0; a0->field_17 = 0; a0->field_8 = 4; a0->field_18 = 0; a0->field_19 = 1; a0->field_1c = 0; a0->field_1d = 0; a0->field_30 = 0; a0->field_1e = 0; a0->field_1f = 0; a0->field_20 = 0; a0->field_37 = 0; a0->field_31 = 1; a0->field_32 = 0; a0->field_36 = 0; a0->field_38 = 0; a0->field_c = 2; a0->field_3a = 0; a0->field_0 = 0; a0->field_39 = 1; a0->field_10 = 384; a0->field_3d = 0; a0->field_3e = 0; a0->field_3b = 0; a0->field_34 = 0; a0->field_33 = 0; a0->field_28 = 0; a0->field_35 = 0; a0->field_3c = 0; a0->field_48 = 0; v1 = a0; a0->field_50 = 0; return; }
static FILE * ck_fopen (char const *fname, char const *type) { FILE *r = fopen (fname, type); if (! r) perror_fatal (fname); return r; }
int ck_fopen(unsigned long a0, char *a1) { unsigned long v0; v0 = fopen(a0, a1); if (!v0) perror_fatal(a0); return v0; }
static int closefrom_procfs(int lowfd) { const char *path; DIR *dirp; struct dirent *dent; int *fd_array = ((void *)0) ; int fd_array_used = 0; int fd_array_size = 0; int ret = 0; int i; path = "/proc/self/fd"; dirp = opendir(path); if (dirp == ((void *)0) ) return -1; while ((dent = readdir(dirp)) != ((void *)0) ) { const char *errstr; int fd; fd = strtonum(dent->d_name, lowfd, 0x7fffffff, &errstr); if (errstr != ((void *)0) || fd == dirfd(dirp)) continue; if (fd_array_used >= fd_array_size) { int *ptr; if (fd_array_size > 0) fd_array_size *= 2; else fd_array_size = 32; ptr = reallocarray(fd_array, fd_array_size, sizeof(int)); if (ptr == ((void *)0) ) { ret = -1; break; } fd_array = ptr; } fd_array[fd_array_used++] = fd; } for (i = 0; i < fd_array_used; i++) closefrom_close(fd_array[i]); free(fd_array); (void)closedir(dirp); return ret; }
undefined4 closefrom_procfs(int param_1) { void *pvVar1; int iVar2; int iVar3; long in_FS_OFFSET; int local_54; int local_50; undefined4 local_4c; int local_48; long local_40; void *local_38; char *local_30; DIR *local_28; dirent *local_20; void *local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_38 = (void *)0x0; local_54 = 0; local_50 = 0; local_4c = 0; local_30 = "/proc/self/fd"; local_28 = opendir("/proc/self/fd"); if (local_28 == (DIR *)0x0) { local_4c = 0xffffffff; } else { while (local_20 = readdir(local_28), local_20 != (dirent *)0x0) { iVar2 = strtonum(local_20->d_name,(long)param_1,0x7fffffff,&local_40); if ((local_40 == 0) && (iVar3 = dirfd(local_28), iVar2 != iVar3)) { pvVar1 = local_38; if (local_50 <= local_54) { if (local_50 < 1) { local_50 = 0x20; } else { local_50 = local_50 << 1; } local_18 = (void *)reallocarray(local_38,(long)local_50,4); pvVar1 = local_18; if (local_18 == (void *)0x0) { local_4c = 0xffffffff; break; } } local_38 = pvVar1; *(int *)((long)local_54 * 4 + (long)local_38) = iVar2; local_54 = local_54 + 1; } } for (local_48 = 0; local_48 < local_54; local_48 = local_48 + 1) { closefrom_close(*(undefined4 *)((long)local_38 + (long)local_48 * 4)); } free(local_38); closedir(local_28); } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return local_4c; } __stack_chk_fail(); }
static void set_root(const struct cmdinfo *cip, const char *value) { instdir = dpkg_fsys_set_dir(value); admindir = dpkg_fsys_get_path("/usr/local/var/lib/dpkg"); }
long long set_root(unsigned long a0, unsigned long long a1) { unsigned long v0; v0 = a0; instdir = dpkg_fsys_set_dir(a1); admindir = dpkg_fsys_get_path("/usr/local/var/lib/dpkg"); return admindir; }
static void ip6tunnel_print_help(struct link_util *lu, int argc, char **argv, FILE *f) { fprintf(f, "Usage: ... %-6s [ remote ADDR ]\n" " [ local ADDR ]\n" " [ encaplimit ELIM ]\n" " [ hoplimit HLIM ]\n" " [ tclass TCLASS ]\n" " [ flowlabel FLOWLABEL ]\n" " [ dscp inherit ]\n" " [ [no]allow-localremote ]\n" " [ dev PHYS_DEV ]\n" " [ fwmark MARK ]\n" " [ external ]\n" " [ noencap ]\n" " [ encap { fou | gue | none } ]\n" " [ encap-sport PORT ]\n" " [ encap-dport PORT ]\n" " [ [no]encap-csum ]\n" " [ [no]encap-csum6 ]\n" " [ [no]encap-remcsum ]\n" " [ mode { ip6ip6 | ipip6 | any } ]\n" "\n" "Where: ADDR := IPV6_ADDRESS\n" " ELIM := { none | 0..255 }(default=%d)\n" " HLIM := 0..255 (default=%d)\n" " TCLASS := { 0x0..0xff | inherit }\n" " FLOWLABEL := { 0x0..0xfffff | inherit }\n" " MARK := { 0x0..0xffffffff | inherit }\n", lu->id, 4, (64)); }
void ip6tunnel_print_help (long param_1,undefined8 param_2,undefined8 param_3,FILE *param_4,undefined8 param_5, undefined8 param_6) { fprintf(param_4, "Usage: ... %-6s\t[ remote ADDR ]\n\t\t\t[ local ADDR ]\n\t\t\t[ encaplimit ELIM ]\n\t\t\t[ hoplimit HLIM ]\n\t\t\t[ tclass TCLASS ]\n\t\t\t[ flowlabel FLOWLABEL ]\n\t\t\t[ dscp inherit ]\n\t\t\t[ [no]allow-localremote ]\n\t\t\t[ dev PHYS_DEV ]\n\t\t\t[ fwmark MARK ]\n\t\t\t[ external ]\n\t\t\t[ noencap ]\n\t\t\t[ encap { fou | gue | none } ]\n\t\t\t[ encap-sport PORT ]\n\t\t\t[ encap-dport PORT ]\n\t\t\t[ [no]encap-csum ]\n\t\t\t[ [no]encap-csum6 ]\n\t\t\t[ [no]encap-remcsum ]\n\t\t\t[ mode { ip6ip6 | ipip6 | any } ]\n\nWhere:\tADDR\t := IPV6_ADDRESS\n\tELIM\t := { none | 0..255 }(default=%d)\n\tHLIM\t := 0..255 (default=%d)\n\tTCLASS := { 0x0..0xff | inherit }\n\tFLOWLABEL := { 0x0..0xfffff | inherit }\n\tMARK\t := { 0x0..0xffffffff | inherit }\n" ,*(undefined8 *)(param_1 + 8),4,0x40,param_6,param_4,param_3); return; }
static void can_print_ctrlmode_ext(FILE *f, struct rtattr *ctrlmode_ext_attr, __u32 cm_flags) { struct rtattr *tb[IFLA_CAN_CTRLMODE_MAX + 1]; (parse_rtattr_flags((tb), (IFLA_CAN_CTRLMODE_MAX), ((void*)(((char*)(ctrlmode_ext_attr)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((ctrlmode_ext_attr)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))); if (tb[IFLA_CAN_CTRLMODE_SUPPORTED]) { __u32 *supported = ((void*)(((char*)(tb[IFLA_CAN_CTRLMODE_SUPPORTED])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); print_ctrlmode(PRINT_JSON, *supported, "ctrlmode_supported"); print_ctrlmode(PRINT_JSON, cm_flags & ~*supported, "ctrlmode_static"); } }
void can_print_ctrlmode_ext(undefined8 param_1,ushort *param_2,uint param_3) { long in_FS_OFFSET; undefined local_28 [8]; long local_20; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); parse_rtattr_flags(local_28,1,param_2 + 2,*param_2 - 4,0x8000); if (local_20 != 0) { print_ctrlmode(2,*(uint *)(local_20 + 4),"ctrlmode_supported"); print_ctrlmode(2,~*(uint *)(local_20 + 4) & param_3,"ctrlmode_static"); } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
int sshpkt_put_bignum2(struct ssh *ssh, const BIGNUM *v) { return sshbuf_put_bignum2(ssh->state->outgoing_packet, v); }
void sshpkt_put_bignum2(long *param_1,undefined8 param_2) { sshbuf_put_bignum2(*(undefined8 *)(*param_1 + 0x30),param_2); return; }
void sh_nojobs (s) char *s; { if (s) builtin_error (gettext("%s: no job control"), s); else builtin_error (gettext("no job control")); }
long long sh_nojobs(unsigned long a0) { unsigned long long v1; if (a0) { gettext("%s: no job control"); v1 = builtin_error(); } else { gettext("no job control"); v1 = builtin_error(); } return v1; }
char * readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) { ssize_t nr; int input, output, save_errno, i, need_restart; char ch, *p, *end; struct termios term, oterm; struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm; struct sigaction savetstp, savettin, savettou, savepipe; if (bufsiz == 0) { (*__errno_location ()) = 22 ; return( ((void *)0) ); } restart: for (i = 0; i < (64 + 1) ; i++) signo[i] = 0; nr = -1; save_errno = 0; need_restart = 0; if ((flags & 0x20 ) || (input = output = open( "/dev/tty" , 02 )) == -1) { if (flags & 0x02 ) { (*__errno_location ()) = 25 ; return( ((void *)0) ); } input = 0 ; output = 2 ; } if (input != 0 && tcgetattr(input, &oterm) == 0) { memcpy(&term, &oterm, sizeof(term)); if (!(flags & 0x01 )) term.c_lflag &= ~( 0000010 | 0000100 ); (void)tcsetattr(input, 2 |0, &term); } else { memset(&term, 0, sizeof(term)); term.c_lflag |= 0000010 ; memset(&oterm, 0, sizeof(oterm)); oterm.c_lflag |= 0000010 ; } sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa. __sigaction_handler.sa_handler = handler; (void)sigaction( 14 , &sa, &savealrm); (void)sigaction( 1 , &sa, &savehup); (void)sigaction( 2 , &sa, &saveint); (void)sigaction( 13 , &sa, &savepipe); (void)sigaction( 3 , &sa, &savequit); (void)sigaction( 15 , &sa, &saveterm); (void)sigaction( 20 , &sa, &savetstp); (void)sigaction( 21 , &sa, &savettin); (void)sigaction( 22 , &sa, &savettou); if (!(flags & 0x20 )) (void)write(output, prompt, strlen(prompt)); end = buf + bufsiz - 1; p = buf; while ((nr = read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r') { if (p < end) { if ((flags & 0x10 )) ch &= 0x7f; if ( ((*__ctype_b_loc ())[(int) (( (unsigned char)ch ))] & (unsigned short int) _ISalpha) ) { if ((flags & 0x04 )) ch = (char)tolower((unsigned char)ch); if ((flags & 0x08 )) ch = (char)toupper((unsigned char)ch); } *p++ = ch; } } *p = '\0'; save_errno = (*__errno_location ()) ; if (!(term.c_lflag & 0000010 )) (void)write(output, "\n", 1); if (memcmp(&term, &oterm, sizeof(term)) != 0) { const int sigttou = signo[ 22 ]; while (tcsetattr(input, 2 |0, &oterm) == -1 && (*__errno_location ()) == 4 && !signo[ 22 ]) continue; signo[ 22 ] = sigttou; } (void)sigaction( 14 , &savealrm, ((void *)0) ); (void)sigaction( 1 , &savehup, ((void *)0) ); (void)sigaction( 2 , &saveint, ((void *)0) ); (void)sigaction( 3 , &savequit, ((void *)0) ); (void)sigaction( 13 , &savepipe, ((void *)0) ); (void)sigaction( 15 , &saveterm, ((void *)0) ); (void)sigaction( 20 , &savetstp, ((void *)0) ); (void)sigaction( 21 , &savettin, ((void *)0) ); (void)sigaction( 22 , &savettou, ((void *)0) ); if (input != 0 ) (void)close(input); for (i = 0; i < (64 + 1) ; i++) { if (signo[i]) { kill(getpid(), i); switch (i) { case 20 : case 21 : case 22 : need_restart = 1; } } } if (need_restart) goto restart; if (save_errno) (*__errno_location ()) = save_errno; return(nr == -1 ? ((void *)0) : buf); }
long long readpassphrase(void* a0, unsigned long long a1, unsigned long a2, unsigned long a3) { char v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; void* v7; unsigned long v8; unsigned long v9; char v10; unsigned int v11; char v12; char v13; unsigned long long v14; char v15; unsigned int v16; char v17; char v18; char v19; char v20; char v21; char v22; char v23; char v24; char v25; unsigned long long v27; char *v28; unsigned long long v30; void* v31; if (!a2) { *(__errno_location()) = 22; v31 = 0; } else { while (true) { for (v3 = 0; v3 <= 64; v3 += 1) { signo[v3] = 0; } v8 = -1; v5 = 0; v4 = 0; if (!(a3 & 32)) { v2 = open("/dev/tty", 0x2, v3 * 4); v1 = v2; } if (v1 == -1 || (a3 & 32)) { if ((a3 & 2)) { *(__errno_location()) = 25; v31 = 0; break; } else { v1 = 0; v2 = 2; } } if (!(a3 & 2) || !(a3 & 32) && v1 != -1) { if (v1) { v27 = tcgetattr(v1, &v12); if (!v27) { memcpy(&v10, &v12, 0x3c); if (!(a3 & 1)) v11 &= -73; tcsetattr(v1, 0x2, &v10); } } if (!v1 || v27) { memset(&v10, 0x0, 0x3c); v11 = *(&v11) | 8; memset(&v12, 0x0, 0x3c); v13 = *(&v13) | 8; } sigemptyset(&v15); v16 = 0; v14 = handler; sigaction(0xe, &v14, &v17); sigaction(0x1, &v14, &v19); sigaction(0x2, &v14, &v18); sigaction(0xd, &v14, &v25); sigaction(0x3, &v14, &v20); sigaction(0xf, &v14, &v21); sigaction(0x14, &v14, &v22); sigaction(0x15, &v14, &v23); sigaction(0x16, &v14, &v24); if (!(a3 & 32)) write(v2, a0, strlen(a0)); v9 = a1 + a2 - 1; v7 = a1; while (true) { v8 = read(v1, &v0, 0x1); if (v8 == 1 && v0 != 10 && v0 != 13) { if (v7 >= v9) continue; if ((a3 & 16)) v0 &= 127; *(&v27) = *((*(__ctype_b_loc()) + v0 * 2)); *(&v27) = v27 & 0x400; if (v27) { if ((a3 & 4)) v0 = tolower(v0); if ((a3 & 8)) v0 = toupper(v0); } v28 = v7; v7 += 1; *(v28) = v0; continue; } if (v0 == 10 || v0 == 13 || v8 != 1) { *(v7) = 0; v5 = *(__errno_location()); if (!(v11 & 8)) write(v2, "\n", 0x1); if (memcmp(&v10, &v12, 0x3c)) { v6 = g_400758; do { v30 = tcsetattr(v1, 0x2, &v12); if (v30 != -1) break; *(&v30) = *(__errno_location()); if (v30 != 4) break; } while (!g_400758); g_400758 = v6; } sigaction(0xe, &v17, 0x0); sigaction(0x1, &v19, 0x0); sigaction(0x2, &v18, 0x0); sigaction(0x3, &v20, 0x0); sigaction(0xd, &v25, 0x0); sigaction(0xf, &v21, 0x0); sigaction(0x14, &v22, 0x0); sigaction(0x15, &v23, 0x0); sigaction(0x16, &v24, 0x0); if (!v1) break; if (v1) { close(v1); break; } } } for (v3 = 0; v3 <= 64; v3 += 1) { if (signo[v3]) { kill(getpid(), v3); if (v3 - 20 <= 2) v4 = 1; } } if (v4) continue; if (v5) *(__errno_location()) = v5; if (v8 != -1) { v31 = a1; break; } else { v31 = 0; break; } } } } return v31; }
int main(int argc, char **argv) { int ch, fflag, tflag, status, n; char **newargv, *argv0; const char *errstr; enum scp_mode_e mode = MODE_SFTP; char *sftp_direct = ((void *)0) ; sanitise_stdfd(); msetlocale(); argv0 = argv[0]; newargv = xcalloc((((argc + 1) > (1)) ? (argc + 1) : (1)), sizeof(*newargv)); for (n = 0; n < argc; n++) newargv[n] = xstrdup(argv[n]); argv = newargv; __progname = ssh_get_progname(argv[0]); log_init(argv0, log_level, SYSLOG_FACILITY_USER, 2); memset(&args, '\0', sizeof(args)); memset(&remote_remote_args, '\0', sizeof(remote_remote_args)); args.list = remote_remote_args.list = ((void *)0) ; addargs(&args, "%s", ssh_program); addargs(&args, "-x"); addargs(&args, "-oPermitLocalCommand=no"); addargs(&args, "-oClearAllForwardings=yes"); addargs(&args, "-oRemoteCommand=none"); addargs(&args, "-oRequestTTY=no"); fflag = Tflag = tflag = 0; while ((ch = BSDgetopt(argc, argv, "12346ABCTdfOpqRrstvD:F:J:M:P:S:c:i:l:o:") ) != -1) { switch (ch) { case '1': sshfatal("scp.c", __func__, 487, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "SSH protocol v.1 is no longer supported"); break; case '2': break; case 'A': case '4': case '6': case 'C': addargs(&args, "-%c", ch); addargs(&remote_remote_args, "-%c", ch); break; case 'D': sftp_direct = BSDoptarg; break; case '3': throughlocal = 1; break; case 'R': throughlocal = 0; break; case 'o': case 'c': case 'i': case 'F': case 'J': addargs(&remote_remote_args, "-%c", ch); addargs(&remote_remote_args, "%s", BSDoptarg); addargs(&args, "-%c", ch); addargs(&args, "%s", BSDoptarg); break; case 'O': mode = MODE_SCP; break; case 's': mode = MODE_SFTP; break; case 'P': sshport = a2port(BSDoptarg); if (sshport <= 0) sshfatal("scp.c", __func__, 527, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "bad port \"%s\"\n", BSDoptarg); break; case 'B': addargs(&remote_remote_args, "-oBatchmode=yes"); addargs(&args, "-oBatchmode=yes"); break; case 'l': limit_kbps = strtonum(BSDoptarg, 1, 100 * 1024 * 1024, &errstr); if (errstr != ((void *)0) ) usage(); limit_kbps *= 1024; bandwidth_limit_init(&bwlimit, limit_kbps, 16384); break; case 'p': pflag = 1; break; case 'r': iamrecursive = 1; break; case 'S': ssh_program = xstrdup(BSDoptarg); break; case 'v': addargs(&args, "-v"); addargs(&remote_remote_args, "-v"); if (verbose_mode == 0) log_level = SYSLOG_LEVEL_DEBUG1; else if (log_level < SYSLOG_LEVEL_DEBUG3) log_level++; verbose_mode = 1; break; case 'q': addargs(&args, "-q"); addargs(&remote_remote_args, "-q"); showprogress = 0; break; case 'd': targetshouldbedirectory = 1; break; case 'f': iamremote = 1; fflag = 1; break; case 't': iamremote = 1; tflag = 1; break; case 'T': Tflag = 1; break; default: usage(); } } argc -= BSDoptind; argv += BSDoptind; log_init(argv0, log_level, SYSLOG_FACILITY_USER, 2); addargs(&args, "-oForwardAgent=no"); if (iamremote) mode = MODE_SCP; if ((pwd = getpwuid(userid = getuid())) == ((void *)0) ) sshfatal("scp.c", __func__, 599, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "unknown user %u", (u_int) userid); if (!isatty( 1 )) showprogress = 0; if (pflag) { } else { if (pledge("stdio rpath wpath cpath fattr tty proc exec", ((void *)0) ) == -1) { perror("pledge"); exit(1); } } remin = 0 ; remout = 1 ; if (fflag) { (void) response(); source(argc, argv); exit(errs != 0); } if (tflag) { sink(argc, argv, ((void *)0) ); exit(errs != 0); } if (argc < 2) usage(); if (argc > 2) targetshouldbedirectory = 1; remin = remout = -1; do_cmd_pid = -1; (void) snprintf(cmd, sizeof cmd, "scp%s%s%s%s", verbose_mode ? " -v" : "", iamrecursive ? " -r" : "", pflag ? " -p" : "", targetshouldbedirectory ? " -d" : ""); (void) ssh_signal( 13 , lostconn); if (colon(argv[argc - 1])) toremote(argc, argv, mode, sftp_direct); else { if (targetshouldbedirectory) verifydir(argv[argc - 1]); tolocal(argc, argv, mode, sftp_direct); } if (do_cmd_pid != -1 && (mode == MODE_SFTP || errs == 0)) { if (remin != -1) (void) close(remin); if (remout != -1) (void) close(remout); if (waitpid(do_cmd_pid, &status, 0) == -1) errs = 1; else { if (! ((( status ) & 0x7f) == 0) || ((( status ) & 0xff00) >> 8) != 0) errs = 1; } } exit(errs != 0); }
int main(int argc, const char **argv, const char **envp) { int v3; long v4; const char *v5; const char *v6; const char *v7; const char *v8; unsigned int v9; _QWORD *v11; char **v12; int v13; int stat_loc; int v15; int v16; int i; int v18; unsigned int v19; long v20; const char *v21; const char *v22; _QWORD *v23; unsigned long v24; v24 = __readfsqword(0x28u); v18 = 1; v21 = 0LL; sanitise_stdfd(argc, argv, envp); msetlocale(); v22 = *argv; v3 = argc + 1; if ( argc + 1 <= 0 ) v3 = 1; v23 = (_QWORD *)xcalloc(v3, 8LL); for ( i = 0; i < argc; ++i ) v23[i] = xstrdup(argv[i]); v11 = v23; _progname = ssh_get_progname(*v23); log_init(v22, (unsigned int)log_level, 1LL, 2LL); memset(remote_remote_args, 0, sizeof(remote_remote_args)); remote_remote_args[0] = 0LL; args = 0LL; addargs(&args, "%s", ssh_program); addargs(&args, "-x"); addargs(&args, "-oPermitLocalCommand=no"); addargs(&args, "-oClearAllForwardings=yes"); addargs(&args, "-oRemoteCommand=none"); addargs(&args, "-oRequestTTY=no"); v16 = 0; Tflag = 0; v15 = 0; while ( 1 ) { v19 = BSDgetopt((unsigned int)argc, v11, "12346ABCTdfOpqRrstvD:F:J:M:P:S:c:i:l:o:"); if ( v19 == -1 ) break; HIDWORD(v4) = 0; switch ( v19 ) { case '1': sshfatal("scp.c", "main", 487LL, 0LL, 1LL, 0LL, "SSH protocol v.1 is no longer supported"); goto LABEL_9; case '2': continue; case '3': throughlocal = 1; continue; case '4': case '6': case 'A': case 'C': LABEL_9: addargs(&args, "-%c", v19); addargs(remote_remote_args, "-%c", v19); continue; case 'B': goto LABEL_18; case 'D': v21 = (const char *)BSDoptarg; continue; case 'F': case 'J': case 'c': case 'i': case 'o': addargs(remote_remote_args, "-%c", v19); addargs(remote_remote_args, "%s", BSDoptarg); addargs(&args, "-%c", v19); addargs(&args, "%s", BSDoptarg); continue; case 'O': v18 = 0; continue; case 'P': sshport = a2port(BSDoptarg, v4); if ( sshport > 0 ) continue; sshfatal("scp.c", "main", 527LL, 0LL, 1LL, 0LL, "bad port \"%s\"\n", BSDoptarg); LABEL_18: addargs(remote_remote_args, "-oBatchmode=yes"); addargs(&args, "-oBatchmode=yes"); break; case 'R': throughlocal = 0; continue; case 'S': ssh_program = (char *)xstrdup(BSDoptarg); continue; case 'T': Tflag = 1; continue; case 'd': targetshouldbedirectory = 1; continue; case 'f': iamremote = 1; v15 = 1; continue; case 'l': limit_kbps = strtonum(BSDoptarg, 1LL, 104857600LL, &v20); if ( v20 ) usage(); limit_kbps <<= 10; bandwidth_limit_init(bwlimit, limit_kbps, 0x4000LL); continue; case 'p': pflag = 1; continue; case 'q': addargs(&args, (const char *)&off_6DD6); addargs(remote_remote_args, (const char *)&off_6DD6); showprogress = 0; continue; case 'r': iamrecursive = 1; continue; case 's': v18 = 1; continue; case 't': iamremote = 1; v16 = 1; continue; case 'v': addargs(&args, "-v"); addargs(remote_remote_args, "-v"); if ( verbose_mode ) { if ( log_level <= 6 ) ++log_level; } else { log_level = 5; } verbose_mode = 1; continue; default: usage(); } } v13 = argc - BSDoptind; v12 = (char **)&v11[BSDoptind]; log_init(v22, (unsigned int)log_level, 1LL, 2LL); addargs(&args, "-oForwardAgent=no"); if ( iamremote ) v18 = 0; userid = getuid(); pwd = (long)getpwuid(userid); if ( !pwd ) sshfatal("scp.c", "main", 599LL, 0LL, 1LL, 0LL, "unknown user %u", userid); if ( !isatty(1) ) showprogress = 0; if ( !pflag && (unsigned int)pledge("stdio rpath wpath cpath fattr tty proc exec", 0LL) == -1 ) { perror("pledge"); exit(1); } remin = 0; remout = 1; if ( v15 ) { response(); source(v13, (long)v12); exit(errs != 0); } if ( v16 ) { sink(v13, v12, 0LL); exit(errs != 0); } if ( v13 <= 1 ) usage(); if ( v13 > 2 ) targetshouldbedirectory = 1; remout = -1; remin = -1; do_cmd_pid = -1; if ( targetshouldbedirectory ) v5 = " -d"; else v5 = (const char *)&unk_6E67; if ( pflag ) v6 = " -p"; else v6 = (const char *)&unk_6E67; if ( iamrecursive ) v7 = " -r"; else v7 = (const char *)&unk_6E67; if ( verbose_mode ) v8 = " -v"; else v8 = (const char *)&unk_6E67; snprintf(&cmd, 0x40uLL, "scp%s%s%s%s", v8, v7, v6, v5); ssh_signal(13LL, lostconn); if ( colon(v12[v13 - 1], v9) ) { toremote(v13, (long)v12, v18, v21); } else { if ( targetshouldbedirectory ) verifydir(v12[v13 - 1]); tolocal(v13, (long)v12, v18, v21); } if ( do_cmd_pid != -1 && (v18 == 1 || !errs) ) { if ( remin != -1 ) close(remin); if ( remout != -1 ) close(remout); if ( waitpid(do_cmd_pid, &stat_loc, 0) == -1 ) { errs = 1; } else if ( (stat_loc & 0x7F) != 0 || BYTE1(stat_loc) ) { errs = 1; } } exit(errs != 0); }
void enqueue_conflictor(struct pkginfo *pkg) { pkg_queue_push(&conflictors, pkg); }
long enqueue_conflictor(long a1) { return pkg_queue_push(&conflictors, a1); }
static size_t dev_ino_hash (void const *x, size_t table_size) { struct dev_ino const *p = x; return (uintmax_t) p->st_ino % table_size; }
ulong dev_ino_hash(ulong *param_1,ulong param_2) { return *param_1 % param_2; }
static int ssh_request_reply(int sock, struct sshbuf *request, struct sshbuf *reply) { int r; size_t l, len; char buf[1024]; len = sshbuf_len(request); do { const u_int32_t __v = (len); ((u_char *)(buf))[0] = (__v >> 24) & 0xff; ((u_char *)(buf))[1] = (__v >> 16) & 0xff; ((u_char *)(buf))[2] = (__v >> 8) & 0xff; ((u_char *)(buf))[3] = __v & 0xff; } while (0); if (atomicio((ssize_t (*)(int, void *, size_t))write, sock, buf, 4) != 4 || atomicio((ssize_t (*)(int, void *, size_t))write, sock, sshbuf_mutable_ptr(request), sshbuf_len(request)) != sshbuf_len(request)) return -26; if (atomicio(read, sock, buf, 4) != 4) return -26; len = (((u_int32_t)(((const u_char *)(buf))[0]) << 24) | ((u_int32_t)(((const u_char *)(buf))[1]) << 16) | ((u_int32_t)(((const u_char *)(buf))[2]) << 8) | (u_int32_t)(((const u_char *)(buf))[3])); if (len > (256 * 1024)) return -4; sshbuf_reset(reply); while (len > 0) { l = len; if (l > sizeof(buf)) l = sizeof(buf); if (atomicio(read, sock, buf, l) != l) return -26; if ((r = sshbuf_put(reply, buf, l)) != 0) return r; len -= l; } return 0; }
int ssh_request_reply(unsigned long a0, unsigned long long a1, unsigned long long a2) { unsigned int v0; unsigned int v1; unsigned long long v2; unsigned long long v3; char v4; char v5; char v6; char v7; unsigned int v9; v3 = sshbuf_len(a1); v0 = v3; v4 = v0 >> 24; v5 = v0 >> 16; v6 = v0 >> 8; v7 = v0; if (atomicio(got.write, a0, &v4, 0x4) != 4) { LABEL_40034b: v9 = -26; } else { if (!(atomicio(got.write, a0, sshbuf_mutable_ptr(a1), sshbuf_len(a1)) == sshbuf_len(a1))) goto LABEL_40034b; if (atomicio(got.read, a0, &v4, 0x4) != 4) { v9 = -26; } else { v3 = v7 | (v4 * 0x1000000) | (v5 * 0x10000) | (v6 * 0x100); if (v3 > 0x40000) { v9 = -0x4; } else { sshbuf_reset(a2); while (true) { if (!v3) { v9 = 0; break; } else { v2 = v3; if (v2 > 0x400) v2 = 0x400; if (v2 != atomicio(got.read, a0, &v4, v2)) { v9 = -26; break; } else { v1 = sshbuf_put(a2, &v4, v2, &v4); if (!v1) { v3 -= v2; } else { v9 = v1; break; } } } } } } } return v9; }
static int write_all(int fd, const 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; }
int write_all(int param_1,void *param_2,size_t param_3) { ssize_t sVar1; int *piVar2; size_t local_30; void *local_28; int local_14; local_14 = 0; local_30 = param_3; local_28 = param_2; do { while( true ) { if (local_30 == 0) { return local_14; } sVar1 = write(param_1,local_28,local_30); if (sVar1 < 0) break; local_30 = local_30 - sVar1; local_28 = (void *)((long)local_28 + sVar1); local_14 = local_14 + (int)sVar1; } piVar2 = __errno_location(); } while ((*piVar2 == 0xb) || (piVar2 = __errno_location(), *piVar2 == 4)); return -1; }
em_inc_search_next(EditLine *el, wint_t c __attribute__((__unused__))) { el->el_search.patlen = 0; return ce_inc_search(el, 23); }
long em_inc_search_next(long a1) { *(_QWORD *)(a1 + 1184) = 0LL; return ce_inc_search(a1, 23LL); }
void auth2_update_session_info(Authctxt *authctxt, const char *method, const char *submethod) { int r; if (authctxt->session_info == ((void *)0) ) { if ((authctxt->session_info = sshbuf_new()) == ((void *)0) ) sshfatal("auth2.c", __func__, 817, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new"); } if ((r = sshbuf_putf(authctxt->session_info, "%s%s%s", method, submethod == ((void *)0) ? "" : "/", submethod == ((void *)0) ? "" : submethod)) != 0) sshfatal("auth2.c", __func__, 824, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "append method"); if (authctxt->auth_method_key != ((void *)0) ) { if ((r = sshbuf_put_u8(authctxt->session_info, ' ')) != 0 || (r = sshkey_format_text(authctxt->auth_method_key, authctxt->session_info)) != 0) sshfatal("auth2.c", __func__, 831, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "append key"); } if (authctxt->auth_method_info != ((void *)0) ) { if (strchr(authctxt->auth_method_info, '\n') != ((void *)0) ) sshfatal("auth2.c", __func__, 837, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "auth_method_info contains \\n"); if ((r = sshbuf_put_u8(authctxt->session_info, ' ')) != 0 || (r = sshbuf_putf(authctxt->session_info, "%s", authctxt->auth_method_info)) != 0) { sshfatal("auth2.c", __func__, 841, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "append method info"); } } if ((r = sshbuf_put_u8(authctxt->session_info, '\n')) != 0) sshfatal("auth2.c", __func__, 845, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "append"); }
void auth2_update_session_info(unsigned long long a0[18], unsigned long long a1, unsigned long a2) { unsigned long long v0; unsigned long long v1; unsigned int v2; unsigned long long v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long long v10; unsigned long long v11; if (!a0[17]) { a0[17] = sshbuf_new(); if (!a0[17]) { v0 = "sshbuf_new"; sshfatal("auth2.c", "auth2_update_session_info", 0x331, 0x1, 0x1, 0x0); } } v2 = sshbuf_putf(a0[17], "%s%s%s", a1, (!a2 ? "/" : &g_402830)); if (v2) { v5 = ssh_err(v2); v1 = "append method"; sshfatal("auth2.c", "auth2_update_session_info", 0x338, 0x1, 0x1, v5); } if (a0[15]) { v2 = sshbuf_put_u8(a0[17], 0x20); if (v2 || (v2 = sshkey_format_text(a0[15], a0[17], a0[17]), v2)) { v6 = ssh_err(v2); v1 = "append key"; sshfatal("auth2.c", "auth2_update_session_info", 0x33f, 0x1, 0x1, v6); } } if (a0[16]) { if (strchr(a0[16], 0xa)) { v1 = "auth_method_info contains \\n"; sshfatal("auth2.c", "auth2_update_session_info", 0x345, 0x1, 0x1, 0x0); } v2 = sshbuf_put_u8(a0[17], 0x20); if (v2 || (v2 = sshbuf_putf(a0[17], "%s", a0[16], v7), v2)) { v8 = ssh_err(v2); v1 = "append method info"; sshfatal("auth2.c", "auth2_update_session_info", 0x349, 0x1, 0x1, v8); } } v2 = sshbuf_put_u8(a0[17], 0xa); if (v2) { v10 = ssh_err(v2); v1 = "append"; v11 = sshfatal("auth2.c", "auth2_update_session_info", 0x34d, 0x1, 0x1, v10); return; } return; }
gnutls_x509_privkey_t load_x509_private_key(int mand, common_info_st * info) { gnutls_x509_privkey_t key; int ret; gnutls_datum_t dat; size_t size; unsigned int flags = 0; const char *pass; if (!info->privkey && !mand) return ((void *)0) ; if (info->privkey == ((void *)0) ) { fprintf( stderr , "missing --load-privkey\n"); app_exit(1); } ret = gnutls_x509_privkey_init(&key); if (ret < 0) { fprintf( stderr , "privkey_init: %s\n", gnutls_strerror(ret)); app_exit(1); } dat.data = (void *) _gnutls_read_file(info->privkey, 0x1, &size); dat.size = size; if (!dat.data) { fprintf( stderr , "error reading file at --load-privkey: %s\n", info->privkey); app_exit(1); } if (info->pkcs8) { pass = get_password(info, &flags, 0); ret = gnutls_x509_privkey_import_pkcs8(key, &dat, info->incert_format, pass, flags); } else { ret = gnutls_x509_privkey_import2(key, &dat, info->incert_format, ((void *)0) , 0); if (ret == -24) { pass = get_password(info, &flags, 0); ret = gnutls_x509_privkey_import2(key, &dat, info-> incert_format, pass, flags); } } free(dat.data); if (ret == -207) { fprintf( stderr , "import error: could not find a valid PEM header; " "check if your key is PEM encoded\n"); app_exit(1); } if (ret < 0) { fprintf( stderr , "error importing private key: %s: %s\n", info->privkey, gnutls_strerror(ret)); app_exit(1); } return key; }
long long load_x509_private_key(unsigned long a0, struct_0 *a1) { unsigned int v0; unsigned int v1; char v2; char v3; unsigned long long v4; void* v5; unsigned int v6; unsigned long long v8; v0 = 0; if (!a1->field_8 && !a0) v8 = 0; if (a1->field_8 || a0) { if (!a1->field_8) { fprintf(stderr, "missing --load-privkey\n"); app_exit(0x1); } v1 = gnutls_x509_privkey_init(&v2); if (v1 < 0) { fprintf(stderr, "privkey_init: %s\n", gnutls_strerror(v1)); app_exit(0x1); } v5 = _gnutls_read_file(a1->field_8, 0x1, &v3); v6 = *(&v3); if (!v5) { fprintf(stderr, "error reading file at --load-privkey: %s\n", a1->field_8); app_exit(0x1); } if (a1->field_18) { v4 = get_password(a1, &v0, 0x0); v1 = gnutls_x509_privkey_import_pkcs8(*(&v2), &v5, a1->field_1c, v4, v0); } else { v1 = gnutls_x509_privkey_import2(*(&v2), &v5, a1->field_1c, 0x0, 0x0); if (v1 == -24) { v4 = get_password(a1, &v0, 0x0); v1 = gnutls_x509_privkey_import2(*(&v2), &v5, a1->field_1c, v4, v0); } } free(v5); if (v1 == -207) { fprintf(stderr, "import error: could not find a valid PEM header; check if your key is PEM encoded\n"); app_exit(0x1); } if (v1 < 0) { fprintf(stderr, "error importing private key: %s: %s\n", a1->field_8, gnutls_strerror(v1)); app_exit(0x1); } v8 = *(&v2); } return v8; }
static void rl_display_search (char *search_string, int flags, int where) { char *message; int msglen, searchlen; searchlen = (search_string && *search_string) ? strlen (search_string) : 0; message = (char *)xmalloc (searchlen + 64); msglen = 0; message[msglen++] = '('; if (flags & 0x04) { strcpy (message + msglen, "failed "); msglen += 7; } if (flags & 0x01) { strcpy (message + msglen, "reverse-"); msglen += 8; } strcpy (message + msglen, "i-search)`"); msglen += 10; if (search_string && *search_string) { strcpy (message + msglen, search_string); msglen += searchlen; } else _rl_optimize_redisplay (); strcpy (message + msglen, "': "); rl_message ("%s", message); xfree (message); }
void rl_display_search(char *a0, unsigned long a1, unsigned long a2) { unsigned int v0; int tmp_24; unsigned int v1; unsigned int v2; char *v3; unsigned int v5; unsigned long long v6; v0 = a2; if (a0 && *(a0)) { v5 = strlen(a0); goto LABEL_400266; } v5 = 0; LABEL_400266: v2 = v5; v3 = xmalloc(v2 + 64); v1 = 0; tmp_24 = v1; v1 += 1; v3[tmp_24] = 40; if ((a1 & 4)) { strcpy(&v3[v1], "failed "); v1 += 7; } if ((a1 & 1)) { strcpy(&v3[v1], "reverse-"); v1 += 8; } strcpy(&v3[v1], "i-search)`"); v1 += 10; if (a0 && *(a0)) { strcpy(&v3[v1], a0); v1 += v2; goto LABEL_400349; } _rl_optimize_redisplay(); LABEL_400349: strcpy(&v3[v1], "': "); rl_message("%s", v3); v6 = xfree(v3); return; }
ed_next_char(EditLine *el, wint_t c __attribute__((__unused__))) { wchar_t *lim = el->el_line.lastchar; if (el->el_line.cursor >= lim || (el->el_line.cursor == lim - 1 && el->el_map.type == 1 && el->el_chared.c_vcmd.action == 0x00)) return 6; el->el_line.cursor += el->el_state.argument; if (el->el_line.cursor > lim) el->el_line.cursor = lim; if (el->el_map.type == 1) if (el->el_chared.c_vcmd.action != 0x00) { cv_delfini(el); return 4; } return 5; }
long long ed_next_char(struct_0 *a0, unsigned long a1) { unsigned int v0; unsigned long v1; unsigned long long v3; v0 = a1; v1 = a0->field_60; if (v1 <= a0->field_58) { LABEL_4005fe: v3 = 6; } else { if (a0->field_58 == v1 - 4 && a0->field_420 == 1) { if (!(!a0->field_3c0)) goto LABEL_400605; goto LABEL_4005fe; } LABEL_400605: a0->field_58 = a0->field_58 + a0->field_78 * 4; if (v1 < a0->field_58) a0->field_58 = v1; if (a0->field_420 == 1 && a0->field_3c0) { cv_delfini(a0); v3 = 4; goto LABEL_400674; } v3 = 5; } LABEL_400674: return v3; }
int tt_seteightbit (ttp) struct termios *ttp; { ttp->c_iflag &= ~ 0000040 ; ttp->c_cflag |= 0000060 ; ttp->c_cflag &= ~ 0000400 ; return 0; }
long tt_seteightbit(_DWORD *a1) { int v1; *a1 &= ~0x20u; a1[2] |= 0x30u; v1 = a1[2]; BYTE1(v1) &= ~1u; a1[2] = v1; return 0LL; }
static z_crc_t crc_word(data) z_word_t data; { int k; for (k = 0; k < 8; k++) data = (data >> 8) ^ crc_table[data & 0xff]; return (z_crc_t)data; }
int crc_word(unsigned long a0) { struct_0 *v0; unsigned int v1; v0 = a0; for (v1 = 0; v1 <= 7; v1 += 1) { v0 = *((0x4 * &v0->padding_0[0] + &crc_table)) ^ v0 >> 8; } return v0; }
static void builtin_error_prolog () { char *name; name = get_name_for_error (); fprintf ( stderr , "%s: ", name); if (interactive_shell == 0) fprintf ( stderr , gettext("line %d: "), executing_line_number ()); if (this_command_name && *this_command_name) fprintf ( stderr , "%s: ", this_command_name); }
int builtin_error_prolog() { unsigned int v0; char *v1; int result; const char *name_for_error; name_for_error = (const char *)get_name_for_error(); fprintf(stderr, "%s: ", name_for_error); if ( !interactive_shell ) { v0 = executing_line_number(); v1 = gettext("line %d: "); fprintf(stderr, v1, v0); } result = this_command_name; if ( this_command_name ) { result = (unsigned char)*this_command_name; if ( (_BYTE)result ) return fprintf(stderr, "%s: ", this_command_name); } return result; }
void savedir_diag (char const *name) { if (ignore_failed_read_option) { if ((warning_option & (0x00800000))) savedir_warn (name); } else savedir_error (name); }
long long savedir_diag(unsigned long long a0) { unsigned long long v1; if (!ignore_failed_read_option) { v1 = savedir_error(a0); } else { v1 = warning_option & &g_800000; if ((warning_option & 0x800000)) v1 = savedir_warn(a0); } return v1; }
static int ipstats_show(int argc, char **argv) { struct ipstats_stat_enabled enabled = {}; struct ipstats_sel sel = {}; const char *dev = ((void *)0) ; int ifindex; int err; int i; while (argc > 0) { if (strcmp(*argv, "dev") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (dev != ((void *)0) ) duparg2("dev", *argv); if (check_ifname(*argv)) invarg("\"dev\" not a valid ifname", *argv); dev = *argv; } else if (strcmp(*argv, "help") == 0) { do_help(); return 0; } else { _Bool found_level = 0 ; for (i = 0; i < (sizeof(ipstats_levels) / sizeof((ipstats_levels)[0])); i++) { if (strcmp(*argv, ipstats_levels[i]) == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); err = ipstats_select(&sel, *argv, i, &enabled); if (err) goto err; found_level = 1 ; } } if (!found_level) { fprintf( stderr , "What is \"%s\"?\n", *argv); do_help(); err = - 22 ; goto err; } } do { argv++; argc--; } while(0); } err = ipstats_enable_check(&sel, &enabled); if (err) goto err; if (dev) { ifindex = ll_name_to_index(dev); if (!ifindex) { err = nodev(dev); goto err; } } else { ifindex = 0; } err = ipstats_show_do(ifindex, &enabled); err: ipstats_enabled_free(&enabled); return err; }
long ipstats_show(int a1, const char **a2) { char v5; int v6; unsigned int v7; unsigned int i; long v9; void *v10[2]; long v11[4]; v11[3] = __readfsqword(0x28u); v10[0] = 0LL; v10[1] = 0LL; memset(v11, 0, 24); v9 = 0LL; while ( a1 > 0 ) { if ( !strcmp(*a2, "dev") ) { ++a2; if ( --a1 <= 0 ) incomplete_command(); if ( v9 ) duparg2("dev", *a2); if ( (unsigned int)check_ifname(*a2) ) invarg("\"dev\" not a valid ifname", *a2); v9 = (long)*a2; } else { if ( !strcmp(*a2, "help") ) { do_help(); return 0LL; } v5 = 0; for ( i = 0; i <= 2; ++i ) { if ( !strcmp(*a2, ipstats_levels[i]) ) { ++a2; if ( --a1 <= 0 ) incomplete_command(); v7 = ipstats_select(v11, *a2, i, (long)v10); if ( v7 ) goto LABEL_30; v5 = 1; } } if ( v5 != 1 ) { fprintf(stderr, "What is \"%s\"?\n", *a2); do_help(); v7 = -22; goto LABEL_30; } } ++a2; --a1; } v7 = ipstats_enable_check(v11, (long)v10); if ( !v7 ) { if ( v9 ) { v6 = ll_name_to_index(v9); if ( !v6 ) { v7 = nodev(v9); goto LABEL_30; } } else { v6 = 0; } v7 = ipstats_show_do(v6, v10); } LABEL_30: ipstats_enabled_free(v10); return v7; }
static void setInstParamDefaults(instanceData *pData) { pData->tplName = ((void *)0) ; pData->protocol = 0; pData->networkNamespace = ((void *)0) ; pData->originalNamespace = -1; pData->tcp_framing = TCP_FRAMING_OCTET_STUFFING; pData->tcp_framingDelimiter = '\n'; pData->pszStrmDrvr = ((void *)0) ; pData->pszStrmDrvrAuthMode = ((void *)0) ; pData->pszStrmDrvrPermitExpiredCerts = ((void *)0) ; pData->iStrmDrvrMode = 0; pData->iStrmDrvrExtendedCertCheck = 0; pData->iStrmDrvrSANPreference = 0; pData->iStrmTlsVerifyDepth = 0; pData->pszStrmDrvrCAFile = ((void *)0) ; pData->pszStrmDrvrKeyFile = ((void *)0) ; pData->pszStrmDrvrCertFile = ((void *)0) ; pData->iRebindInterval = 0; pData->bKeepAlive = 0; pData->iKeepAliveProbes = 0; pData->iKeepAliveIntvl = 0; pData->iKeepAliveTime = 0; pData->iConErrSkip = 0; pData->gnutlsPriorityString = ((void *)0) ; pData->bResendLastOnRecon = 0; pData->bSendToAll = -1; pData->iUDPSendDelay = 0; pData->UDPSendBuf = 0; pData->pPermPeers = ((void *)0) ; pData->compressionLevel = 9; pData->strmCompFlushOnTxEnd = 1; pData->compressionMode = 0; pData->ipfreebind = 0x02; pData->ratelimiter = ((void *)0) ; pData->ratelimitInterval = 0; pData->ratelimitBurst = 200; }
long setInstParamDefaults(long a1) { long result; *(_QWORD *)a1 = 0LL; *(_DWORD *)(a1 + 120) = 0; *(_QWORD *)(a1 + 128) = 0LL; *(_DWORD *)(a1 + 136) = -1; *(_DWORD *)(a1 + 192) = 0; *(_BYTE *)(a1 + 196) = 10; *(_QWORD *)(a1 + 8) = 0LL; *(_QWORD *)(a1 + 16) = 0LL; *(_QWORD *)(a1 + 24) = 0LL; *(_DWORD *)(a1 + 40) = 0; *(_DWORD *)(a1 + 44) = 0; *(_DWORD *)(a1 + 48) = 0; *(_DWORD *)(a1 + 52) = 0; *(_QWORD *)(a1 + 56) = 0LL; *(_QWORD *)(a1 + 64) = 0LL; *(_QWORD *)(a1 + 72) = 0LL; *(_DWORD *)(a1 + 140) = 0; *(_BYTE *)(a1 + 144) = 0; *(_DWORD *)(a1 + 152) = 0; *(_DWORD *)(a1 + 148) = 0; *(_DWORD *)(a1 + 156) = 0; *(_DWORD *)(a1 + 160) = 0; *(_QWORD *)(a1 + 168) = 0LL; *(_DWORD *)(a1 + 200) = 0; *(_DWORD *)(a1 + 180) = -1; *(_DWORD *)(a1 + 184) = 0; *(_DWORD *)(a1 + 188) = 0; *(_QWORD *)(a1 + 32) = 0LL; *(_DWORD *)(a1 + 104) = 9; *(_BYTE *)(a1 + 212) = 1; *(_BYTE *)(a1 + 204) = 0; *(_DWORD *)(a1 + 176) = 2; *(_QWORD *)(a1 + 224) = 0LL; *(_DWORD *)(a1 + 216) = 0; result = a1; *(_DWORD *)(a1 + 220) = 200; return result; }
static void sparse_major_coder (struct tar_stat_info const *st, char const *keyword, struct xheader *xhdr, void const *data) { code_num (st->sparse_major, keyword, xhdr); }
long long sparse_major_coder(struct_0 *a0, unsigned int a1, void* a2, unsigned long a3) { unsigned long v0; v0 = a3; return code_num(a0->field_124, a1, a2); }
static size_t default_sort_size (void) { size_t size = (18446744073709551615UL) ; struct rlimit rlimit; if (getrlimit ( RLIMIT_DATA , &rlimit) == 0 && rlimit.rlim_cur < size) size = rlimit.rlim_cur; if (getrlimit ( RLIMIT_AS , &rlimit) == 0 && rlimit.rlim_cur < size) size = rlimit.rlim_cur; size /= 2; if (getrlimit ( __RLIMIT_RSS , &rlimit) == 0 && rlimit.rlim_cur / 16 * 15 < size) size = rlimit.rlim_cur / 16 * 15; double avail = physmem_available (); double total = physmem_total (); double mem = ((( avail )>( total / 8 ))?( avail ):( total / 8 )) ; if (total * 0.75 < size) size = total * 0.75; if (mem < size) size = mem; return ((( size )>( (nmerge * (2 + sizeof (struct line))) ))?( size ):( (nmerge * (2 + sizeof (struct line))) )) ; }
ulong default_sort_size(void) { int iVar1; ulong uVar2; long in_FS_OFFSET; double dVar3; double dVar4; double dVar5; ulong local_48; rlimit local_28; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_48 = 0xffffffffffffffff; iVar1 = getrlimit(RLIMIT_DATA,&local_28); if ((iVar1 == 0) && (local_28.rlim_cur != 0xffffffffffffffff)) { local_48 = local_28.rlim_cur; } iVar1 = getrlimit(RLIMIT_AS,&local_28); if ((iVar1 == 0) && (local_28.rlim_cur < local_48)) { local_48 = local_28.rlim_cur; } local_48 = local_48 >> 1; iVar1 = getrlimit(__RLIMIT_RSS,&local_28); if ((iVar1 == 0) && ((local_28.rlim_cur & 0xfffffffffffffff0) - (local_28.rlim_cur >> 4) < local_48)) { local_48 = (local_28.rlim_cur & 0xfffffffffffffff0) - (local_28.rlim_cur >> 4); } dVar3 = (double)physmem_available(); dVar4 = (double)physmem_total(); if (dVar3 <= dVar4 / DAT_0010dad8) { dVar3 = dVar4 / DAT_0010dad8; } if ((long)local_48 < 0) { dVar5 = (double)(local_48 >> 1 | (ulong)((uint)local_48 & 1)); dVar5 = dVar5 + dVar5; } else { dVar5 = (double)local_48; } if (dVar4 * DAT_0010dae0 < dVar5) { dVar4 = DAT_0010dae0 * dVar4; if (DAT_0010dad0 <= dVar4) { local_48 = (long)(dVar4 - DAT_0010dad0) ^ 0x8000000000000000; } else { local_48 = (ulong)dVar4; } } if ((long)local_48 < 0) { dVar4 = (double)(local_48 >> 1 | (ulong)((uint)local_48 & 1)); dVar4 = dVar4 + dVar4; } else { dVar4 = (double)local_48; } if (dVar3 < dVar4) { if (DAT_0010dad0 <= dVar3) { local_48 = (long)(dVar3 - DAT_0010dad0) ^ 0x8000000000000000; } else { local_48 = (ulong)dVar3; } } uVar2 = (ulong)nmerge * 0x22; if ((ulong)nmerge * 0x22 <= local_48) { uVar2 = local_48; } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return uVar2; } __stack_chk_fail(); }
static const char * diversion_pkg_name(struct fsys_diversion *d) { if (d->pkgset == ((void *)0) ) return ":"; else return d->pkgset->name; }
const char * diversion_pkg_name(long a1) { if ( *(_QWORD *)(a1 + 16) ) return *(const char **)(*(_QWORD *)(a1 + 16) + 8LL); else return ":"; }
Attrib * do_lstat(struct sftp_conn *conn, const char *path, int quiet) { u_int id; if (conn->version == 0) { if (quiet) sshlog("sftp-client.c", __func__, 927, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Server version does not support lstat operation"); else sshlog("sftp-client.c", __func__, 929, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Server version does not support lstat operation"); return(do_stat(conn, path, quiet)); } id = conn->msg_id++; send_string_request(conn, id, 7, path, strlen(path)); return(get_decode_stat(conn, id, quiet)); }
int * do_lstat(unsigned int *a1, const char *a2, int a3) { unsigned int v4; unsigned int v5; unsigned int v7; if ( a1[5] ) { v4 = a1[6]; a1[6] = v4 + 1; v7 = v4; v5 = strlen(a2); send_string_request((long)a1, v7, 7u, (long)a2, v5); return get_decode_stat(a1, v7, a3); } else { if ( a3 ) sshlog("sftp-client.c", "do_lstat", 927LL, 0LL, 5LL, 0LL, "Server version does not support lstat operation"); else sshlog("sftp-client.c", "do_lstat", 929LL, 0LL, 3LL, 0LL, "Server version does not support lstat operation"); return do_stat(a1, a2, a3); } }
void decode_seed(gnutls_datum_t *seed, const char *hex, unsigned hex_size) { int ret; size_t seed_size; seed->size = hex_size; seed->data = malloc(hex_size); if (seed->data == ((void *)0) ) { fprintf( stderr , "memory error\n"); app_exit(1); } seed_size = hex_size; ret = gnutls_hex2bin(hex, hex_size, seed->data, &seed_size); if (ret < 0) { fprintf( stderr , "Could not hex decode data: %s\n", gnutls_strerror(ret)); app_exit(1); } seed->size = seed_size; return; }
unsigned long decode_seed(long a1, long a2, unsigned int a3) { const char *v3; int v6; long v7; unsigned long v8; v8 = __readfsqword(0x28u); *(_DWORD *)(a1 + 8) = a3; *(_QWORD *)a1 = malloc(a3); if ( !*(_QWORD *)a1 ) { fprintf(stderr, "memory error\n"); app_exit(1LL); } v7 = a3; v6 = gnutls_hex2bin(a2, a3, *(_QWORD *)a1, &v7); if ( v6 < 0 ) { v3 = (const char *)gnutls_strerror((unsigned int)v6); fprintf(stderr, "Could not hex decode data: %s\n", v3); app_exit(1LL); } *(_DWORD *)(a1 + 8) = v7; return __readfsqword(0x28u) ^ v8; }
static void wwan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) { if (!tb) return; if (tb[IFLA_WWAN_LINK_ID]) print_uint(PRINT_ANY, "linkid", "linkid %u ", rta_getattr_u32(tb[IFLA_WWAN_LINK_ID])); }
void wwan_print_opt(undefined8 param_1,undefined8 param_2,long param_3) { undefined4 uVar1; if ((param_3 != 0) && (*(long *)(param_3 + 8) != 0)) { uVar1 = rta_getattr_u32(*(undefined8 *)(param_3 + 8)); print_uint(4,"linkid","linkid %u ",uVar1); } return; }
static void explain(void) { vrf_explain( stderr ); }
void explain() { unsigned long long v1; v1 = vrf_explain(stderr); return; }
static int add_undo_close_redirect (fd) int fd; { REDIRECT *closer; REDIRECTEE sd; sd.dest = fd; rd.dest = 0; closer = make_redirection (sd, r_close_this, rd, 0); closer->flags |= 0x08; closer->next = redirection_undo_list; redirection_undo_list = closer; return 0; }
int add_undo_close_redirect(unsigned long a0) { unsigned int v0; struct_0 *v1; v0 = a0; rd = 0; v1 = make_redirection(*(&v0), 0x9, *(&rd), 0x0); v1->field_14 = v1->field_14 | 8; v1->field_0 = redirection_undo_list; redirection_undo_list = v1; return 0; }
int ssh_packet_is_rekeying(struct ssh *ssh) { return ssh->state->rekeying || (ssh->kex != ((void *)0) && ssh->kex->done == 0); }
_BOOL8 ssh_packet_is_rekeying(_QWORD *a1) { return *(_DWORD *)(*a1 + 476LL) || a1[1] && !*(_DWORD *)(a1[1] + 136LL); }
void netns_nsid_socket_init(void) { if (rtnsh.fd > -1 || !ipnetns_have_nsid()) return; if (rtnl_open(&rtnsh, 0) < 0) { fprintf( stderr , "Cannot open rtnetlink\n"); exit(1); } }
void netns_nsid_socket_init(void) { int iVar1; if (rtnsh._0_4_ < 0) { iVar1 = ipnetns_have_nsid(); if (iVar1 != 0) { iVar1 = rtnl_open(rtnsh,0); if (iVar1 < 0) { fprintf(stderr,"Cannot open rtnetlink\n"); exit(1); } } } return; }
static void history_def_clear(void *p, HistEvent *ev) { history_t *h = (history_t *) p; while (h->list.prev != &h->list) history_def_delete(h, ev, h->list.prev); h->cursor = &h->list; h->eventid = 0; h->cur = 0; }
void history_def_clear(struct_0 *a0, unsigned int a1) { struct_0 *v1; while (a0->field_20 != a0) { history_def_delete(a0, a1, a0->field_20); } a0->field_28 = a0; a0->field_38 = 0; v1 = a0; a0->field_34 = 0; return; }
static void print_rtax_features(FILE *fp, unsigned int features) { unsigned int of = features; if (features & (1 << 0)) { print_null(PRINT_ANY, "ecn", "ecn ", ((void *)0) ); features &= ~(1 << 0); } if (features) print_0xhex(PRINT_ANY, "features", "%#llx ", of); }
void print_rtax_features(undefined8 param_1,uint param_2) { uint local_24; local_24 = param_2; if ((param_2 & 1) != 0) { print_null(4,&DAT_00109f43,&DAT_00109f3e,0); local_24 = param_2 & 0xfffffffe; } if (local_24 != 0) { print_0xhex(4,"features","%#llx ",param_2); } return; }
static char ** hostnames_matching (text) char *text; { register int i, len, nmatch, rsize; char **result; if (hostname_list_initialized == 0) initialize_hostname_list (); if (hostname_list_initialized == 0) return ((char **) ((void *)0) ); if (*text == '\0') { result = strvec_create (1 + hostname_list_length); for (i = 0; i < hostname_list_length; i++) result[i] = hostname_list[i]; result[i] = (char *) ((void *)0) ; return (result); } len = strlen (text); result = (char **) ((void *)0) ; for (i = nmatch = rsize = 0; i < hostname_list_length; i++) { if (((len == 0) ? (1) : ((text)[0] == (hostname_list[i])[0] && strncmp(text, hostname_list[i], len) == 0)) == 0) continue; if (nmatch >= (rsize - 1)) { rsize = (rsize + 16) - (rsize % 16); result = strvec_resize (result, rsize); } result[nmatch++] = hostname_list[i]; } if (nmatch) result[nmatch] = (char *) ((void *)0) ; return (result); }
long hostnames_matching(char *param_1) { bool bVar1; int iVar2; uint uVar3; size_t sVar4; int iVar5; int iVar6; int iVar7; long local_30; if (hostname_list_initialized == 0) { initialize_hostname_list(); } if (hostname_list_initialized == 0) { local_30 = 0; } else if (*param_1 == '\0') { local_30 = strvec_create(hostname_list_length + 1); for (iVar6 = 0; iVar6 < hostname_list_length; iVar6 = iVar6 + 1) { *(undefined8 *)(local_30 + (long)iVar6 * 8) = *(undefined8 *)(hostname_list + (long)iVar6 * 8) ; } *(undefined8 *)(local_30 + (long)iVar6 * 8) = 0; } else { sVar4 = strlen(param_1); local_30 = 0; iVar5 = 0; iVar6 = 0; for (iVar7 = 0; iVar7 < hostname_list_length; iVar7 = iVar7 + 1) { if (((int)sVar4 == 0) || ((*param_1 == **(char **)(hostname_list + (long)iVar7 * 8) && (iVar2 = strncmp(param_1,*(char **)(hostname_list + (long)iVar7 * 8),(long)(int)sVar4), iVar2 == 0)))) { bVar1 = true; } else { bVar1 = false; } if (bVar1) { if (iVar5 + -1 <= iVar6) { uVar3 = (uint)(iVar5 >> 0x1f) >> 0x1c; iVar5 = (iVar5 + 0x10) - ((iVar5 + uVar3 & 0xf) - uVar3); local_30 = strvec_resize(local_30,iVar5); } *(undefined8 *)((long)iVar6 * 8 + local_30) = *(undefined8 *)(hostname_list + (long)iVar7 * 8); iVar6 = iVar6 + 1; } } if (iVar6 != 0) { *(undefined8 *)(local_30 + (long)iVar6 * 8) = 0; } } return local_30; }
static int ext4_fc_handle_del_range(e2fsck_t ctx, __u8 *val) { struct ext2fs_extent extent; struct ext4_fc_del_range del_range; int ret, ino; memcpy(&del_range, val, sizeof(del_range)); ino = (( __u32)(__le32)(del_range.fc_ino)); ext4_fc_flush_extents(ctx, ino); memset(&extent, 0, sizeof(extent)); extent.e_lblk = (( __u32)(__le32)(del_range.fc_lblk)); extent.e_len = (( __u32)(__le32)(del_range.fc_len)); ret = ext4_fc_read_extents(ctx, ino); if (ret) return ret; return ext4_del_extent_from_list(ctx, &ctx->fc_replay_state.fc_extent_list, &extent); }
int ext4_fc_handle_del_range(void* *a0, void* a1) { unsigned int v0; unsigned int v1; char v2; char v3; char v4; char v5; unsigned long v6; unsigned int v7; unsigned long v9; memcpy(&v2, a1, 0xc); v0 = *(&v2); ext4_fc_flush_extents(a0, v0); memset(&v5, 0x0, 0x18); v6 = *(&v3); v7 = *(&v4); v1 = ext4_fc_read_extents(a0, v0); if (v1) v9 = v1; else v9 = ext4_del_extent_from_list(a0, a0 + 118, &v5); return v9; }
static void do_show_cert(struct passwd *pw) { struct sshkey *key = ((void *)0) ; struct stat st; int r, is_stdin = 0, ok = 0; FILE *f; char *cp, *line = ((void *)0) ; const char *path; size_t linesize = 0; u_long lnum = 0; if (!have_identity) ask_filename(pw, "Enter file in which the key is"); if (strcmp(identity_file, "-") != 0 && stat(identity_file, &st) == -1) sshfatal("ssh-keygen.c", __func__, 2163, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: %s: %s", __progname, identity_file, strerror( (*__errno_location ()) )); path = identity_file; if (strcmp(path, "-") == 0) { f = stdin ; path = "(stdin)"; is_stdin = 1; } else if ((f = fopen(identity_file, "r")) == ((void *)0) ) sshfatal("ssh-keygen.c", __func__, 2171, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "fopen %s: %s", identity_file, strerror( (*__errno_location ()) )); while (getline(&line, &linesize, f) != -1) { lnum++; sshkey_free(key); key = ((void *)0) ; cp = line + strspn(line, " \t"); if (*cp == '#' || *cp == '\0') continue; if ((key = sshkey_new(KEY_UNSPEC)) == ((void *)0) ) sshfatal("ssh-keygen.c", __func__, 2182, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshkey_new"); if ((r = sshkey_read(key, &cp)) != 0) { sshlog("ssh-keygen.c", __func__, 2184, 0, SYSLOG_LEVEL_ERROR, ssh_err(r), "%s:%lu: invalid key", path, lnum); continue; } if (!sshkey_is_cert(key)) { sshlog("ssh-keygen.c", __func__, 2188, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "%s:%lu is not a certificate", path, lnum); continue; } ok = 1; if (!is_stdin && lnum == 1) printf("%s:\n", path); else printf("%s:%lu:\n", path, lnum); print_cert(key); } free(line); sshkey_free(key); fclose(f); exit(ok ? 0 : 1); }
void do_show_cert(void* a0) { unsigned long v0; unsigned long long v1; unsigned long v2; unsigned int v3; unsigned int v4; unsigned int v5; char *v6; void* v7; void* v8; void* v9; void* v10; unsigned long long v11; void* v12; char v13; unsigned long long v14; unsigned long long v15; unsigned long v16; char v17; unsigned long long v18; unsigned long v19; unsigned long long *v20; v16 = v19; v14 = v20[5]; v9 = 0; v3 = 0; v4 = 0; v7 = 0; v8 = 0; v12 = 0; if (!have_identity) ask_filename(a0, "Enter file in which the key is"); if (strcmp(&identity_file, "-") && stat(&identity_file, &v13) == -1) { v2 = strerror(*(__errno_location())); v1 = &identity_file; v0 = __progname; sshfatal("ssh-keygen.c", "do_show_cert", 0x873, 0x0, 0x1, 0x0, "%s: %s: %s"); } v11 = &identity_file; if (!strcmp(v11, "-")) { v10 = stdin; v11 = "(stdin)"; v3 = 1; } else { v10 = fopen(&identity_file, "r"); if (!v10) { v16 = strerror(*(__errno_location())); v15 = &identity_file; v14 = "fopen %s: %s"; sshfatal("ssh-keygen.c", "do_show_cert", 0x87b, 0x0, 0x1, 0x0, *(&v17)); } } while (true) { do { while (true) { if (getline(&v7, &v8, v10) != -1) { v12 += 1; sshkey_free(v9); v9 = 0; v6 = strspn(v7, " \t") + v7; if (*(v6) != 35) break; } else { free(v7); sshkey_free(v9); fclose(v10); exit(!v4); } } } while (!*(v6)); v9 = sshkey_new(0xe); if (!v9) { v16 = "sshkey_new"; sshfatal("ssh-keygen.c", "do_show_cert", 0x886, 0x0, 0x1, 0x0, *(&v17)); } v5 = sshkey_read(v9, &v6, &v6); if (v5) { v16 = v12; v15 = v11; v14 = "%s:%lu: invalid key"; sshlog("ssh-keygen.c", "do_show_cert", 0x888, 0x0, 0x2, ssh_err(v5), *(&v17), v18); } else if (!sshkey_is_cert(v9)) { v16 = v12; v15 = v11; v14 = "%s:%lu is not a certificate"; sshlog("ssh-keygen.c", "do_show_cert", 0x88c, 0x0, 0x2, 0x0, *(&v17), v18); } else { v4 = 1; if (!v3 && v12 == 1) printf("%s:\n", v11); if (v3 || v12 != 1) printf("%s:%lu:\n", v11, v12); print_cert(v9); } } }
static void tooManyBlocks ( Int32 max_handled_blocks ) { fprintf ( stderr , "%s: `%s' appears to contain more than %d blocks\n", progName, inFileName, max_handled_blocks ); fprintf ( stderr , "%s: and cannot be handled. To fix, increase\n", progName ); fprintf ( stderr , "%s: BZ_MAX_HANDLED_BLOCKS in bzip2recover.c, and recompile.\n", progName ); exit ( 1 ); }
void tooManyBlocks(unsigned long a0) { fprintf(stderr, "%s: `%s' appears to contain more than %d blocks\n", &progName, &inFileName, a0); fprintf(stderr, "%s: and cannot be handled. To fix, increase\n", &progName); fprintf(stderr, "%s: BZ_MAX_HANDLED_BLOCKS in bzip2recover.c, and recompile.\n", &progName); exit(0x1); }
static int make_pipe(int fd) { int fds[2]; if (pipe(fds)) { initlog((1|2), "pipe: %m"); return -1; } dup2(fds[0], fd); close(fds[0]); fcntl(fds[1], 2 , 1); fcntl(fd, 2 , 0); safe_write(fds[1], Signature, 8); return fds[1]; }
int make_pipe(unsigned long a0, unsigned long a1, unsigned int a2, unsigned int a3, unsigned int a4, unsigned int a5) { char v0; char v1; unsigned int v3; if (pipe(&v0)) { initlog(0x3, "pipe: %m", a2, a3, a4, a5); v3 = -1; } else { dup2(*(&v0), a0); close(*(&v0)); fcntl(*(&v1), 0x2); fcntl(a0, 0x2); safe_write(*(&v1), Signature, 0x8); v3 = *(&v1); } return v3; }
int importable_function_name (string, len) const char *string; size_t len; { if (absolute_program (string)) return 0; if (*string == '\n') return 0; if ((sh_syntaxtab[(unsigned char)(*string)] & 0x2000) || (sh_syntaxtab[(unsigned char)(string[len-1])] & 0x2000)) return 0; return (posixly_correct ? legal_identifier (string) : 1); }
long long importable_function_name(char *a0, unsigned long a1) { unsigned long long v2; if (absolute_program(a0)) { v2 = 0; } else if (*(a0) == 10) { v2 = 0; } else { if (!(sh_syntaxtab[*(a0)] & 0x2000) && !(sh_syntaxtab[a0[1 + a1]] & 0x2000)) { if (posixly_correct) v2 = legal_identifier(a0); else v2 = 1; } if ((sh_syntaxtab[a0[1 + a1]] & 0x2000) || (sh_syntaxtab[*(a0)] & 0x2000)) v2 = 0; } return v2; }
static int fallback_getfilecon (int fd, const char *name, char **p, int prev_rv) { switch ( (*__errno_location ()) ) { case 2 : case 20 : if (options.debug_options & DebugStat) { fprintf ( stderr , "fallback_getfilecon(): getfilecon(%s) failed; falling " "back on lgetfilecon()\n", name); } return lgetfileconat (fd, name, p); case 13 : case 5 : case 40 : case 36 : case 75 : default: return prev_rv; } }
ulong fallback_getfilecon(undefined4 param_1,undefined8 param_2,undefined8 param_3,uint param_4) { int *piVar1; ulong uVar2; piVar1 = __errno_location(); if ((*piVar1 == 2) || (*piVar1 == 0x14)) { if ((_error & 2) != 0) { fprintf(stderr,"fallback_getfilecon(): getfilecon(%s) failed; falling back on lgetfilecon()\n" ,param_2); } uVar2 = lgetfileconat(param_1,param_2,param_3); } else { uVar2 = (ulong)param_4; } return uVar2; }
c_insert(EditLine *el, int num) { wchar_t *cp; if (el->el_line.lastchar + num >= el->el_line.limit) { if (!ch_enlargebufs(el, (size_t)num)) return; } if (el->el_line.cursor < el->el_line.lastchar) { for (cp = el->el_line.lastchar; cp >= el->el_line.cursor; cp--) cp[num] = *cp; } el->el_line.lastchar += num; }
void c_insert(unsigned long long a0[14], unsigned long a1) { unsigned int *v0; unsigned long long v3[14]; if ((a1 << 2) + a0[12] < a0[13] || ch_enlargebufs(a0, a1)) { if (a0[11] < a0[12]) { for (v0 = a0[12]; v0 >= a0[11]; v0 += 1) { v0[a1] = *(v0); } } v3 = a0; a0[12] = a1 * 4 + a0[12]; } return; }
static _Bool parse_true (const struct parser_table* entry, char **argv, int *arg_ptr) { struct predicate *our_pred; (void) argv; (void) arg_ptr; our_pred = insert_primary_noarg (entry); our_pred->need_stat = our_pred->need_type = 0 ; our_pred->est_success_rate = 1.0f; return 1 ; }
void parse_true(unsigned long long a0, unsigned long a1, unsigned long a2) { unsigned long v0; unsigned long v1; struct_0 *v2; unsigned long long v4; v1 = a1; v0 = a2; v2 = insert_primary_noarg(a0); v2->field_1b = 0; v2->field_1a = v2->field_1b; v2->field_24 = 0x3e99999a3f800000; v4 = 1; return; }
int channel_request_remote_forwarding(struct ssh *ssh, struct Forward *fwd) { int r, success = 0, idx = -1; char *host_to_connect, *listen_host, *listen_path; int port_to_connect, listen_port; if (fwd->listen_path != ((void *)0) ) { if ((r = sshpkt_start(ssh, 80)) != 0 || (r = sshpkt_put_cstring(ssh, "streamlocal-forward@openssh.com")) != 0 || (r = sshpkt_put_u8(ssh, 1)) != 0 || (r = sshpkt_put_cstring(ssh, fwd->listen_path)) != 0 || (r = sshpkt_send(ssh)) != 0 || (r = ssh_packet_write_wait(ssh)) != 0) sshfatal("channels.c", __func__, 4096, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "request streamlocal"); } else { if ((r = sshpkt_start(ssh, 80)) != 0 || (r = sshpkt_put_cstring(ssh, "tcpip-forward")) != 0 || (r = sshpkt_put_u8(ssh, 1)) != 0 || (r = sshpkt_put_cstring(ssh, channel_rfwd_bind_host(fwd->listen_host))) != 0 || (r = sshpkt_put_u32(ssh, fwd->listen_port)) != 0 || (r = sshpkt_send(ssh)) != 0 || (r = ssh_packet_write_wait(ssh)) != 0) sshfatal("channels.c", __func__, 4106, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "request tcpip-forward"); } success = 1; if (success) { host_to_connect = listen_host = listen_path = ((void *)0) ; port_to_connect = listen_port = 0; if (fwd->connect_path != ((void *)0) ) { host_to_connect = xstrdup(fwd->connect_path); port_to_connect = -2; } else { host_to_connect = xstrdup(fwd->connect_host); port_to_connect = fwd->connect_port; } if (fwd->listen_path != ((void *)0) ) { listen_path = xstrdup(fwd->listen_path); listen_port = -2; } else { if (fwd->listen_host != ((void *)0) ) listen_host = xstrdup(fwd->listen_host); listen_port = fwd->listen_port; } idx = permission_set_add(ssh, 0x101, (1<<1), host_to_connect, port_to_connect, listen_host, listen_path, listen_port, ((void *)0) ); } return idx; }
long long channel_request_remote_forwarding(void* a0, struct_0 *a1) { unsigned long long v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned long v6; unsigned long long v7; void* v8; char v9; unsigned long v10; char v11; v5 = 0; v2 = -1; if (a1->field_10) { v1 = sshpkt_start(a0, 0x50); if (!v1) { v1 = sshpkt_put_cstring(a0, "streamlocal-forward@openssh.com"); if (!v1) { v1 = sshpkt_put_u8(a0, 0x1); if (!v1) { v1 = sshpkt_put_cstring(a0, a1->field_10); if (!v1) { v1 = sshpkt_send(a0); if (!v1) v1 = ssh_packet_write_wait(a0); } } } } if (v1 || v1 || v1 || v1 || v1 || v1) { v0 = "request streamlocal"; sshfatal("channels.c", "channel_request_remote_forwarding", 0x1000, 0x1, 0x1, ssh_err(v1)); } } if (!a1->field_10 || v1 || v1 || v1 || v1 || v1 || v1) { v1 = sshpkt_start(a0, 0x50); if (!v1) { v1 = sshpkt_put_cstring(a0, "tcpip-forward"); if (!v1) { v1 = sshpkt_put_u8(a0, 0x1); if (!v1) { v1 = sshpkt_put_cstring(a0, channel_rfwd_bind_host(a1->field_0)); if (!v1) { v1 = sshpkt_put_u32(a0, a1->field_8, a1->field_8); if (!v1) { v1 = sshpkt_send(a0); if (!v1) v1 = ssh_packet_write_wait(a0); } } } } } if (v1 || v1 || v1 || v1 || v1 || v1 || v1) { v8 = "request tcpip-forward"; sshfatal("channels.c", "channel_request_remote_forwarding", 0x100a, 0x1, 0x1, ssh_err(v1)); } } v5 = 1; if (v5) { v8 = 0; v7 = v8; v6 = v7; v4 = 0; v3 = v4; if (a1->field_28) { v6 = xstrdup(a1->field_28); v3 = -2; } else { v6 = xstrdup(a1->field_18); v3 = a1->field_20; } if (a1->field_10) { v8 = xstrdup(a1->field_10); v4 = -2; } else { if (a1->field_0) v7 = xstrdup(a1->field_0); v4 = a1->field_8; } v8 = 0; v7 = v4; v6 = v8; v2 = permission_set_add(a0, 0x101, 0x2, v6, v3, v7, *(&v9), v10, *(&v11)); } return v2; }
static void save_buffer (struct buffer_record *buf) { struct buffer_record *p; buf->next = ((void *)0) ; buf->curr_line = buf->line_start; if (head == ((void *)0) ) head = buf; else { for (p = head; p->next; p = p->next) ; p->next = buf; } }
void save_buffer(unsigned long long a0[9]) { struct_0 *v0; unsigned long long v2[9]; struct_0 *v3; a0[8] = 0; a0[7] = a0[6]; if (!head) { v2 = a0; head[0] = a0; } else { for (v0 = &head[0]; v0->field_40; v0 = v0->field_40); v3 = v0; v0->field_40 = a0; } return; }
int strlist_remove (sl, s) STRINGLIST *sl; char *s; { int r; if (sl == 0 || sl->list == 0 || sl->list_len == 0) return 0; r = strvec_remove (sl->list, s); if (r) sl->list_len--; return r; }
int strlist_remove(long *param_1,undefined8 param_2) { int iVar1; if (((param_1 == (long *)0x0) || (*param_1 == 0)) || (*(int *)((long)param_1 + 0xc) == 0)) { iVar1 = 0; } else { iVar1 = strvec_remove(*param_1,param_2); if (iVar1 != 0) { *(int *)((long)param_1 + 0xc) = *(int *)((long)param_1 + 0xc) + -1; } } return iVar1; }
static inline size_t gcd (size_t u, size_t v) { do { size_t t = u % v; u = v; v = t; } while (v); return u; }
ulong gcd(ulong param_1,ulong param_2) { ulong uVar1; ulong local_28; ulong local_20; uVar1 = param_2; local_20 = param_1; do { local_28 = uVar1; uVar1 = local_20 % local_28; local_20 = local_28; } while (uVar1 != 0); return local_28; }
static _Bool errno_unsupported (int err) { return err == 95 || err == 61 ; }
_BOOL8 errno_unsupported(int a1) { return a1 == 95 || a1 == 61; }
int ssh_digest_final(struct ssh_digest_ctx *ctx, u_char *d, size_t dlen) __attribute__(()); void ssh_digest_free(struct ssh_digest_ctx *ctx); const char *ssh_err(int n); struct ssh_digest_ctx { int alg; EVP_MD_CTX *mdctx; };
long ssh_digest_final(long a1, long a2, unsigned long a3) { int v5; char *v6; unsigned long v7; v7 = __readfsqword(0x28u); v6 = ssh_digest_by_alg(*(_DWORD *)a1); v5 = a3; if ( !v6 || a3 > 0xFFFFFFFF ) return 4294967286LL; if ( a3 < *((_QWORD *)v6 + 2) ) return 4294967286LL; if ( (unsigned int)EVP_DigestFinal_ex(*(_QWORD *)(a1 + 8), a2, &v5) != 1 ) return 4294967274LL; if ( v5 == *((_QWORD *)v6 + 2) ) return 0LL; return 0xFFFFFFFFLL; }
static STRINGLIST * gen_command_matches (cs, cmd, text, line, ind, lwords, nw, cw) COMPSPEC *cs; const char *cmd; const char *text; char *line; int ind; WORD_LIST *lwords; int nw, cw; { char *csbuf, *cscmd, *t; int cmdlen, cmdsize, n, ws, we; WORD_LIST *cmdlist, *cl; WORD_DESC *tw; STRINGLIST *sl; bind_compfunc_variables (line, ind, lwords, cw, 1); cmdlist = build_arg_list (cs->command, cmd, text, lwords, cw); n = strlen (cs->command); cmdsize = n + 1; for (cl = cmdlist->next; cl; cl = cl->next) cmdsize += (((cl->word->word) && (cl->word->word)[0]) ? ((cl->word->word)[1] ? ((cl->word->word)[2] ? strlen(cl->word->word) : 2) : 1) : 0) + 3; cmdsize += 2; cscmd = (char *)sh_xmalloc((cmdsize + 1), "pcomplete.c", 1237); strcpy (cscmd, cs->command); cmdlen = n; cscmd[cmdlen++] = ' '; for (cl = cmdlist->next; cl; cl = cl->next) { t = sh_single_quote (cl->word->word ? cl->word->word : ""); n = strlen (t); do { if ((cmdlen) + (n + 2) >= cmdsize) { while ((cmdlen) + (n + 2) >= cmdsize) cmdsize += (64); cscmd = sh_xrealloc((cscmd), (cmdsize), "pcomplete.c", 1246); } } while (0); strcpy (cscmd + cmdlen, t); cmdlen += n; if (cl->next) cscmd[cmdlen++] = ' '; sh_xfree((t), "pcomplete.c", 1251); } cscmd[cmdlen] = '\0'; tw = command_substitute (cscmd, 0, 0); csbuf = tw ? tw->word : (char *) ((void *)0) ; if (tw) dispose_word_desc (tw); dispose_words (cmdlist); sh_xfree((cscmd), "pcomplete.c", 1262); unbind_compfunc_variables (1); if (csbuf == 0 || *csbuf == '\0') { do { if (csbuf) sh_xfree((csbuf), "pcomplete.c", 1267); } while (0); return ((STRINGLIST *) ((void *)0) ); } sl = strlist_create (16); for (ws = 0; csbuf[ws]; ) { we = ws; while (csbuf[we] && csbuf[we] != '\n') { if (csbuf[we] == '\\' && csbuf[we+1] == '\n') we++; we++; } t = substring (csbuf, ws, we); if (sl->list_len >= sl->list_size - 1) strlist_resize (sl, sl->list_size + 16); sl->list[sl->list_len++] = t; while (csbuf[we] == '\n') we++; ws = we; } sl->list[sl->list_len] = (char *) ((void *)0) ; sh_xfree((csbuf), "pcomplete.c", 1292); return (sl); }
long gen_command_matches( long a1, long a2, long a3, long a4, int a5, _QWORD *a6, int a7, int a8) { int v8; void *v9; int v10; _BYTE *v11; long v13; int v14; int v17; int v18; int v19; unsigned int k; unsigned int m; int v22; int v23; char *dest; long *i; long *j; long **v27; _QWORD *v28; _BYTE *v29; long v30; char *s; char *sa; bind_compfunc_variables(a4, a5, (long)a6, a8, 1); v27 = (long **)build_arg_list(*(_QWORD *)(a1 + 64), a2, a3, a6, a8); v22 = strlen(*(const char **)(a1 + 64)); v18 = v22 + 1; for ( i = *v27; i; i = (long *)*i ) { if ( *(_QWORD *)i[1] && **(_BYTE **)i[1] ) { if ( *(_BYTE *)(*(_QWORD *)i[1] + 1LL) ) { if ( *(_BYTE *)(*(_QWORD *)i[1] + 2LL) ) v8 = strlen(*(const char **)i[1]) + 3; else v8 = 5; } else { v8 = 4; } } else { v8 = 3; } v18 += v8; } v19 = v18 + 2; dest = (char *)sh_xmalloc(v19 + 1, "pcomplete.c", 1237LL); strcpy(dest, *(const char **)(a1 + 64)); v17 = v22 + 1; dest[v22] = 32; for ( j = *v27; j; j = (long *)*j ) { if ( *(_QWORD *)j[1] ) v9 = *(void **)j[1]; else v9 = &unk_4236; s = (char *)sh_single_quote(v9); v23 = strlen(s); if ( v19 <= v23 + 2 + v17 ) { while ( v19 <= v23 + 2 + v17 ) v19 += 64; dest = (char *)sh_xrealloc(dest, v19, "pcomplete.c", 1246LL); } strcpy(&dest[v17], s); v17 += v23; if ( *j ) { v10 = v17++; dest[v10] = 32; } sh_xfree(s, "pcomplete.c", 1251LL); } dest[v17] = 0; v28 = (_QWORD *)command_substitute(dest, 0LL, 0LL); if ( v28 ) v11 = (_BYTE *)*v28; else v11 = 0LL; v29 = v11; if ( v28 ) dispose_word_desc(v28); dispose_words(v27); sh_xfree(dest, "pcomplete.c", 1262LL); unbind_compfunc_variables(1); if ( v29 && *v29 ) { v30 = strlist_create(16LL); for ( k = 0; v29[k]; k = m ) { for ( m = k; v29[m] && v29[m] != 10; ++m ) { if ( v29[m] == 92 && v29[m + 1] == 10 ) ++m; } sa = (char *)substring(v29, k, m); if ( *(_DWORD *)(v30 + 12) >= *(_DWORD *)(v30 + 8) - 1 ) strlist_resize(v30, (unsigned int)(*(_DWORD *)(v30 + 8) + 16)); v13 = *(_QWORD *)v30; v14 = *(_DWORD *)(v30 + 12); *(_DWORD *)(v30 + 12) = v14 + 1; *(_QWORD *)(v13 + 8LL * v14) = sa; while ( v29[m] == 10 ) ++m; } *(_QWORD *)(*(_QWORD *)v30 + 8LL * *(int *)(v30 + 12)) = 0LL; sh_xfree(v29, "pcomplete.c", 1292LL); return v30; } else { if ( v29 ) sh_xfree(v29, "pcomplete.c", 1267LL); return 0LL; } }
char * sh_double_quote (string) const char *string; { register unsigned char c; int mb_cur_max; char *result, *r; size_t slen; const char *s, *send; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); slen = strlen (string); send = string + slen; mb_cur_max = (__ctype_get_mb_cur_max ()) ; result = (char *)sh_xmalloc((3 + (2 * strlen (string))), "shquote.c", 149); r = result; *r++ = '"'; for (s = string; s && (c = *s); s++) { if ((sh_syntaxtab[c] & 0x0040) && c != '\n') *r++ = '\\'; if ((locale_utf8locale && (c & 0x80)) || (locale_utf8locale == 0 && mb_cur_max > 1 && is_basic (c) == 0)) { do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _k; _k = is_basic (*(s)); if (_k) mblength = 1; else if (locale_utf8locale && ((*(s) & 0x80) == 0)) mblength = *(s) != 0; else { state_bak = state; mblength = mbrlen ((s), (send) - (s), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; mblength = 1; } else mblength = (mblength < 1) ? 1 : mblength; for (_k = 0; _k < mblength; _k++) *(r)++ = *(s)++; } else *(r)++ = *(s)++; } while (0); s--; continue; } *r++ = c; } *r++ = '"'; *r = '\0'; return (result); }
undefined * sh_double_quote(byte *param_1) { byte bVar1; int iVar2; size_t sVar3; size_t sVar4; size_t sVar5; undefined *puVar6; long in_FS_OFFSET; int local_68; byte *local_60; byte *local_58; ulong local_50; mbstate_t local_30; mbstate_t local_28; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); memset(&local_30,0,8); sVar3 = strlen((char *)param_1); sVar4 = __ctype_get_mb_cur_max(); sVar5 = strlen((char *)param_1); puVar6 = (undefined *)sh_xmalloc(sVar5 * 2 + 3,"shquote.c",0x95); local_60 = puVar6 + 1; *puVar6 = 0x22; for (local_58 = param_1; local_58 != (byte *)0x0; local_58 = local_58 + 1) { bVar1 = *local_58; if (bVar1 == 0) break; if (((*(uint *)(&sh_syntaxtab + (long)(int)(uint)bVar1 * 4) & 0x40) != 0) && (bVar1 != 10)) { *local_60 = 0x5c; local_60 = local_60 + 1; } if (((locale_utf8locale == 0) || (-1 < (char)bVar1)) && ((locale_utf8locale != 0 || (((int)sVar4 < 2 || (iVar2 = is_basic((int)(char)bVar1), iVar2 != 0)))))) { *local_60 = bVar1; local_60 = local_60 + 1; } else { if (locale_mb_cur_max < 2) { *local_60 = *local_58; local_60 = local_60 + 1; local_58 = local_58 + 1; } else { iVar2 = is_basic((int)(char)*local_58); if (iVar2 == 0) { if ((locale_utf8locale == 0) || ((char)*local_58 < '\0')) { local_28 = local_30; local_50 = mbrlen((char *)local_58,(size_t)(param_1 + (sVar3 - (long)local_58)), &local_30); } else { local_50 = (ulong)(*local_58 != 0); } } else { local_50 = 1; } if ((local_50 == 0xfffffffffffffffe) || (local_50 == 0xffffffffffffffff)) { local_30 = local_28; local_50 = 1; } else if (local_50 == 0) { local_50 = 1; } for (local_68 = 0; (ulong)(long)local_68 < local_50; local_68 = local_68 + 1) { *local_60 = *local_58; local_60 = local_60 + 1; local_58 = local_58 + 1; } } local_58 = local_58 + -1; } } *local_60 = 0x22; local_60[1] = 0; if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return puVar6; } __stack_chk_fail(); }
38 , 1, 0, 0, 0) == -1) { sshlog("sandbox-seccomp-filter.c", __func__, 431, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%s: prctl(PR_SET_NO_NEW_PRIVS): %s", __func__, strerror( (*__errno_location ()) )) ; nnp_failed = 1; }
void sshlog(void) { halt_baddata(); }
static const char *const he_errlist[] = { "OK", "unknown error", "malloc() failed", "first event not found", "last event not found", "empty list", "no next event", "no previous event", "current event is invalid", "event not found", "can't read history from file", "can't write history", "required parameter(s) not supplied", "history size negative", "function not allowed with other history-functions-set the default", "bad parameters" };
char *he_errlist[16] = { "OK", "unknown error", "malloc() failed", "first event not found", "last event not found", "empty list", "no next event", "no previous event", "current event is invalid", "event not found", "can't read history from file", "can't write history", "required parameter(s) not supplied", "history size negative", "function not allowed with other history-functions-set the default", "bad parameters" };
static void xfrm_aead_print(struct xfrm_algo_aead *algo, int len, FILE *fp, const char *prefix, _Bool nokeys) { struct xfrm_algo *base_algo = __builtin_alloca ( sizeof(*base_algo) + algo->alg_key_len / 8 ) ; memcpy(base_algo->alg_name, algo->alg_name, sizeof(base_algo->alg_name)); base_algo->alg_key_len = algo->alg_key_len; memcpy(base_algo->alg_key, algo->alg_key, algo->alg_key_len / 8); __xfrm_algo_print(base_algo, XFRMA_ALG_AEAD, len, fp, prefix, 0, nokeys); fprintf(fp, " %d", algo->alg_icv_len); fprintf(fp, "%s", _SL_); }
void xfrm_aead_print(unsigned int a0[18], unsigned long a1, void* a2, char *a3, unsigned long a4) { char v0; unsigned long long v1; unsigned long long v2; char v3; unsigned long v4; unsigned long long *v5; unsigned long v6; for (; &v3 != &(&v0)[-1 * ((0 CONCAT 15 + (a0[16] >> 3) + 76) /m 16 * 16 & -0x1000)]; v2 = v2); if ((((0 CONCAT 15 + (a0[16] >> 3) + 76) /m 16 * 16) & 4095)) *((&v2 + (((0 CONCAT 15 + (a0[16] >> 3) + 76) /m 16 * 16) & 4095))) = *((&v2 + (((0 CONCAT 15 + (a0[16] >> 3) + 76) /m 16 * 16) & 4095))); v1 = (&v4 >> 4) * 16; memcpy(v1, a0, 0x40); *((v1 + 64)) = a0[16]; memcpy(v1 + 68, a0 + 1, a0[16] >> 3); __xfrm_algo_print(v1, 0x12, a1, a2, a3, 0x0, *(&v3)); fprintf(a2, " %d", a0[17]); fprintf(a2, "%s", _SL_); v6 = a4 ^ v5[5]; return; }
static void sort_die (char const *message, char const *file) { ((!!sizeof (struct { _Static_assert (SORT_FAILURE, "verify_expr (" "SORT_FAILURE" ", " "(error (SORT_FAILURE, (*__errno_location ()), \"%s: %s\", message, quotearg_n_style_colon (0, shell_escape_quoting_style, file ? file : gettext (\"standard output\"))), assume (false))" ")"); int _gl_dummy; })) ? ((error (SORT_FAILURE, (*__errno_location ()) , "%s: %s", message, quotearg_n_style_colon (0, shell_escape_quoting_style, file ? file : gettext ("standard output"))), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (SORT_FAILURE, (*__errno_location ()) , "%s: %s", message, quotearg_n_style_colon (0, shell_escape_quoting_style, file ? file : gettext ("standard output"))), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; }
void sort_die(unsigned long a0, unsigned long long a1, unsigned long a2) { unsigned long v0; unsigned long v1; unsigned long v3; unsigned long long v4; unsigned long long v5; v1 = v3; v0 = a0; if (a1) v4 = a1; else v4 = gettext("standard output"); v5 = quotearg_n_style_colon(0x0, 0x3, v4); error(0x2, *(__errno_location()), "%s: %s"); }
re_goto_bottom(EditLine *el) { terminal_move_to_line(el, el->el_refresh.r_oldcv); terminal__putc(el, '\n'); re_clear_display(el); terminal__flush(el); }
long long re_goto_bottom(struct_0 *a0) { terminal_move_to_line(a0, a0->field_318, a0->field_318); terminal__putc(a0, 0xa); re_clear_display(a0); return terminal__flush(a0); }
void read_diag_details (char const *name, off_t offset, size_t size) { if (ignore_failed_read_option) { if ((warning_option & (0x00800000))) read_warn_details (name, offset, size); } else read_error_details (name, offset, size); }
long long read_diag_details(unsigned long long a0, unsigned long long a1, unsigned long long a2) { unsigned long long v1; if (!ignore_failed_read_option) { v1 = read_error_details(a0, a1, a2, a1); return v1; } v1 = warning_option & &g_800000; if ((warning_option & 0x800000)) { v1 = read_warn_details(a0, a1, a2, a1); return v1; } return v1; }
static void fail_exit (int code) { if (home_added) { if (rmdir (prefix_user_home) != 0) { fprintf ( stderr , gettext ("%s: %s was created, but could not be removed\n"), Prog, prefix_user_home); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 3 , "failed to remove %s", prefix_user_home) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); } } if (spw_locked) { if (spw_unlock () == 0) { fprintf ( stderr , gettext ("%s: failed to unlock %s\n"), Prog, spw_dbname ()); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 3 , "failed to unlock %s", spw_dbname ()) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); } } if (pw_locked) { if (pw_unlock () == 0) { fprintf ( stderr , gettext ("%s: failed to unlock %s\n"), Prog, pw_dbname ()); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 3 , "failed to unlock %s", pw_dbname ()) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); } } if (gr_locked) { if (gr_unlock () == 0) { fprintf ( stderr , gettext ("%s: failed to unlock %s\n"), Prog, gr_dbname ()); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 3 , "failed to unlock %s", gr_dbname ()) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); } } if (sgr_locked) { if (sgr_unlock () == 0) { fprintf ( stderr , gettext ("%s: failed to unlock %s\n"), Prog, sgr_dbname ()); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 3 , "failed to unlock %s", sgr_dbname ()) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); } } if (sub_uid_locked) { if (sub_uid_unlock () == 0) { fprintf ( stderr , gettext ("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ()); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 3 , "failed to unlock %s", sub_uid_dbname ()) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); } } if (sub_gid_locked) { if (sub_gid_unlock () == 0) { fprintf ( stderr , gettext ("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ()); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 3 , "failed to unlock %s", sub_gid_dbname ()) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); } } do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 6 , "failed adding user '%s', exit code: %d", user_name, code) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); exit (code); }
void fail_exit(unsigned long a0) { void* v0; void* v1; void* v2; void* v3; void* v4; void* v5; void* v6; void* v7; char *v8; char *v9; char *v10; char *v11; char *v12; char *v13; char *v14; char *v15; unsigned long v16; unsigned long v17; unsigned long v19; unsigned long v20; unsigned long long v21; unsigned long long v22; unsigned long long v23; unsigned long long v24; unsigned long long v25; unsigned long long v26; v17 = v19; v16 = v20; if (home_added && rmdir(prefix_user_home)) { fprintf(stderr, gettext("%s: %s was created, but could not be removed\n")); v8 = setlocale(0x6, NULL); v0 = 0; if (v8) v0 = strdup(v8); if (v0) setlocale(0x6, "C"); syslog(0x3, "failed to remove %s"); if (v0) { setlocale(0x6, v0); free(v0); } } if (spw_locked && !spw_unlock()) { v21 = spw_dbname(); fprintf(stderr, gettext("%s: failed to unlock %s\n")); v9 = setlocale(0x6, NULL); v1 = 0; if (v9) v1 = strdup(v9); if (v1) setlocale(0x6, "C"); spw_dbname(); syslog(0x3, "failed to unlock %s"); if (v1) { setlocale(0x6, v1); free(v1); } } if (pw_locked && !pw_unlock()) { v22 = pw_dbname(); fprintf(stderr, gettext("%s: failed to unlock %s\n")); v10 = setlocale(0x6, NULL); v2 = 0; if (v10) v2 = strdup(v10); if (v2) setlocale(0x6, "C"); pw_dbname(); syslog(0x3, "failed to unlock %s"); if (v2) { setlocale(0x6, v2); free(v2); } } if (gr_locked && !gr_unlock()) { v23 = gr_dbname(); fprintf(stderr, gettext("%s: failed to unlock %s\n")); v11 = setlocale(0x6, NULL); v3 = 0; if (v11) v3 = strdup(v11); if (v3) setlocale(0x6, "C"); gr_dbname(); syslog(0x3, "failed to unlock %s"); if (v3) { setlocale(0x6, v3); free(v3); } } if (sgr_locked && !sgr_unlock()) { v24 = sgr_dbname(); fprintf(stderr, gettext("%s: failed to unlock %s\n")); v12 = setlocale(0x6, NULL); v4 = 0; if (v12) v4 = strdup(v12); if (v4) setlocale(0x6, "C"); sgr_dbname(); syslog(0x3, "failed to unlock %s"); if (v4) { setlocale(0x6, v4); free(v4); } } if (sub_uid_locked && !sub_uid_unlock()) { v25 = sub_uid_dbname(); fprintf(stderr, gettext("%s: failed to unlock %s\n")); v13 = setlocale(0x6, NULL); v5 = 0; if (v13) v5 = strdup(v13); if (v5) setlocale(0x6, "C"); sub_uid_dbname(); syslog(0x3, "failed to unlock %s"); if (v5) { setlocale(0x6, v5); free(v5); } } if (sub_gid_locked && !sub_gid_unlock()) { v26 = sub_gid_dbname(); fprintf(stderr, gettext("%s: failed to unlock %s\n")); v14 = setlocale(0x6, NULL); v6 = 0; if (v14) v6 = strdup(v14); if (v6) setlocale(0x6, "C"); sub_gid_dbname(); syslog(0x3, "failed to unlock %s"); if (v6) { setlocale(0x6, v6); free(v6); } } v15 = setlocale(0x6, NULL); v7 = 0; if (v15) v7 = strdup(v15); if (v7) setlocale(0x6, "C"); syslog(0x6, "failed adding user '%s', exit code: %d"); if (v7) { setlocale(0x6, v7); free(v7); } exit(a0); }
static void group_busy (gid_t gid) { struct passwd *pwd; prefix_setpwent (); while ( ((pwd = prefix_getpwent ()) != ((void *)0) ) && (pwd->pw_gid != gid) ); prefix_endpwent (); if (pwd == (struct passwd *) 0) { return; } fprintf ( stderr , gettext ("%s: cannot remove the primary group of user '%s'\n"), Prog, pwd->pw_name); exit (8); }
long long group_busy(unsigned long a0) { struct_0 *v0; prefix_setpwent(); do { v0 = prefix_getpwent(); } while (v0 && a0 != v0->field_14); if (v0) { fprintf(stderr, gettext("%s: cannot remove the primary group of user '%s'\n")); exit(0x8); } return prefix_endpwent(); }
static inline void emit_ancillary_info (char const *program) { struct infomap { char const *program; char const *node; } const infomap[] = { { "[", "test invocation" }, { "coreutils", "Multi-call invocation" }, { "sha224sum", "sha2 utilities" }, { "sha256sum", "sha2 utilities" }, { "sha384sum", "sha2 utilities" }, { "sha512sum", "sha2 utilities" }, { ((void *)0) , ((void *)0) } }; char const *node = program; struct infomap const *map_prog = infomap; while (map_prog->program && ! (strcmp (program, map_prog->program) == 0)) map_prog++; if (map_prog->node) node = map_prog->node; printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https: char const *lc_messages = setlocale ( 5 , ((void *)0) ); if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1)) { fputs_unlocked (gettext ("Report any translation bugs to " "<https: stdout ) ; } char const *url_program = (strcmp (program, "[") == 0) ? "test" : program; printf (gettext ("Full documentation <%s%s>\n"), "https: printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"), node, node == program ? " invocation" : ""); }
void emit_ancillary_info(char *param_1) { FILE *__stream; int iVar1; char *pcVar2; char *pcVar3; long in_FS_OFFSET; char *local_b8; char **local_b0; char *local_98; char *local_90; char *local_88; char *local_80; char *local_78; char *local_70; char *local_68; char *local_60; char *local_58; char *local_50; char *local_48; char *local_40; undefined8 local_38; undefined8 local_30; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_98 = "["; local_90 = "test invocation"; local_88 = "coreutils"; local_80 = "Multi-call invocation"; local_78 = "sha224sum"; local_70 = "sha2 utilities"; local_68 = "sha256sum"; local_60 = "sha2 utilities"; local_58 = "sha384sum"; local_50 = "sha2 utilities"; local_48 = "sha512sum"; local_40 = "sha2 utilities"; local_38 = 0; local_30 = 0; local_b0 = &local_98; while ((*local_b0 != (char *)0x0 && (iVar1 = strcmp(param_1,*local_b0), iVar1 != 0))) { local_b0 = local_b0 + 2; } local_b8 = param_1; if (local_b0[1] != (char *)0x0) { local_b8 = local_b0[1]; } pcVar2 = (char *)gettext("\n%s online help: <%s>\n"); printf(pcVar2,"GNU coreutils","https: pcVar2 = setlocale(5,(char *)0x0); if ((pcVar2 != (char *)0x0) && (iVar1 = strncmp(pcVar2,"en_",3), __stream = stdout, iVar1 != 0)) { pcVar2 = (char *)gettext( "Report any translation bugs to <https: ); fputs_unlocked(pcVar2,__stream); } iVar1 = strcmp(param_1,"["); pcVar2 = param_1; if (iVar1 == 0) { pcVar2 = "test"; } pcVar3 = (char *)gettext("Full documentation <%s%s>\n"); printf(pcVar3,"https: if (local_b8 == param_1) { pcVar2 = " invocation"; } else { pcVar2 = ""; } pcVar3 = (char *)gettext("or available locally via: info \'(coreutils) %s%s\'\n"); printf(pcVar3,local_b8,pcVar2); if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
static void close_file (COLUMN *p) { COLUMN *q; int i; if (p->status == CLOSED) return; int err = (*__errno_location ()) ; if (!ferror_unlocked (p->fp)) err = 0; if (fileno (p->fp) == 0 ) clearerr_unlocked (p->fp); else if ( rpl_fclose (p->fp) != 0 && !err) err = (*__errno_location ()) ; if (err) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, err, \"%s\", quotearg_n_style_colon (0, shell_escape_quoting_style, p->name)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , err, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, p->name)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , err, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, p->name)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (!parallel_files) { for (q = column_vector, i = columns; i; ++q, --i) { q->status = CLOSED; if (q->lines_stored == 0) { q->lines_to_print = 0; } } } else { p->status = CLOSED; p->lines_to_print = 0; } --files_ready_to_read; }
long close_file(_QWORD *a1) { long result; const char *v2; int i; int errnum; _DWORD *v5; result = *((unsigned int *)a1 + 4); if ( (_DWORD)result != 3 ) { errnum = *_errno_location(); if ( !ferror_unlocked((FILE *)*a1) ) errnum = 0; if ( fileno((FILE *)*a1) ) { if ( (unsigned int)rpl_fclose(*a1) && !errnum ) errnum = *_errno_location(); } else { clearerr_unlocked((FILE *)*a1); } if ( errnum ) { v2 = (const char *)quotearg_n_style_colon(0LL, 3LL, a1[1]); error(1, errnum, "%s", v2); } if ( parallel_files != 1 ) { v5 = column_vector; for ( i = columns; i; --i ) { v5[4] = 3; if ( !v5[11] ) v5[12] = 0; v5 += 16; } } else { *((_DWORD *)a1 + 4) = 3; *((_DWORD *)a1 + 12) = 0; } return (unsigned int)--files_ready_to_read; } return result; }
static void vxcan_print_help(struct link_util *lu, int argc, char **argv, FILE *f) { print_usage(f); }
long long vxcan_print_help(unsigned long a0, unsigned long a1, unsigned long a2, unsigned int a3) { unsigned long v0; unsigned int v1; unsigned long v2; v2 = a0; v1 = a1; v0 = a2; return print_usage(a3); }
static void re_update_line(EditLine *el, wchar_t *old, wchar_t *new, int i) { wchar_t *o, *n, *p, c; wchar_t *ofd, *ols, *oe, *nfd, *nls, *ne; wchar_t *osb, *ose, *nsb, *nse; int fx, sx; size_t len; for (o = old, n = new; *o && (*o == *n); o++, n++) continue; ofd = o; nfd = n; while (*o) o++; while (ofd < o) { if (o[-1] != ' ') break; o--; } oe = o; *oe = '\0'; while (*n) n++; while (nfd < n) { if (n[-1] != ' ') break; n--; } ne = n; *ne = '\0'; if (*ofd == '\0' && *nfd == '\0') { ; return; } while ((o > ofd) && (n > nfd) && (*--o == *--n)) continue; ols = ++o; nls = ++n; osb = ols; nsb = nls; ose = ols; nse = nls; if (*ofd) { for (c = *ofd, n = nfd; n < nls; n++) { if (c == *n) { for (o = ofd, p = n; p < nls && o < ols && *o == *p; o++, p++) continue; if (((nse - nsb) < (p - n)) && (2 * (p - n) > n - nfd)) { nsb = n; nse = p; osb = ofd; ose = o; } } } } if (*nfd) { for (c = *nfd, o = ofd; o < ols; o++) { if (c == *o) { for (n = nfd, p = o; p < ols && n < nls && *p == *n; p++, n++) continue; if (((ose - osb) < (p - o)) && (2 * (p - o) > o - ofd)) { nsb = nfd; nse = n; osb = o; ose = p; } } } } if ((oe - ols) < 4) { ols = oe; nls = ne; } fx = (int)((nsb - nfd) - (osb - ofd)); sx = (int)((nls - nse) - (ols - ose)); if (!((el)->el_terminal.t_flags & 0x001)) { if (fx > 0) { osb = ols; ose = ols; nsb = nls; nse = nls; } if (sx > 0) { ols = oe; nls = ne; } if ((ols - ofd) < (nls - nfd)) { ols = oe; nls = ne; } } if (!((el)->el_terminal.t_flags & 0x002)) { if (fx < 0) { osb = ols; ose = ols; nsb = nls; nse = nls; } if (sx < 0) { ols = oe; nls = ne; } if ((ols - ofd) > (nls - nfd)) { ols = oe; nls = ne; } } if ((ose - osb) < 4) { osb = ols; ose = ols; nsb = nls; nse = nls; } fx = (int)((nsb - nfd) - (osb - ofd)); sx = (int)((nls - nse) - (ols - ose)); ; ; ; ; ; terminal_move_to_line(el, i); p = (ols != oe) ? oe : ose; if ((nsb != nfd) && fx > 0 && ((p - old) + fx <= el->el_terminal.t_size.h)) { ; terminal_move_to_char(el, (int)(nfd - new)); if (nsb != ne) { ; if (fx > 0) { ; terminal_insertwrite(el, nfd, fx); re_insert(el, old, (int)(ofd - old), el->el_terminal.t_size.h, nfd, fx); } len = (size_t) ((nsb - nfd) - fx); terminal_overwrite(el, (nfd + fx), len); re__strncopy(ofd + fx, nfd + fx, len); } else { ; len = (size_t)(nsb - nfd); terminal_overwrite(el, nfd, len); re__strncopy(ofd, nfd, len); return; } } else if (fx < 0) { ; terminal_move_to_char(el, (int)(ofd - old)); if (osb != oe) { ; if (fx < 0) { ; terminal_deletechars(el, -fx); re_delete(el, old, (int)(ofd - old), el->el_terminal.t_size.h, -fx); } len = (size_t) (nsb - nfd); terminal_overwrite(el, nfd, len); re__strncopy(ofd, nfd, len); } else { ; terminal_overwrite(el, nfd, (size_t)(nsb - nfd)); re_clear_eol(el, fx, sx, (int)((oe - old) - (ne - new))); return; } } else fx = 0; if (sx < 0 && (ose - old) + fx < el->el_terminal.t_size.h) { ; terminal_move_to_char(el, (int)((ose - old) + fx)); if (ols != oe) { ; if (sx < 0) { ; terminal_deletechars(el, -sx); } terminal_overwrite(el, nse, (size_t)(nls - nse)); } else { ; terminal_overwrite(el, nse, (size_t)(nls - nse)); re_clear_eol(el, fx, sx, (int)((oe - old) - (ne - new))); } } if ((nsb != nfd) && (osb - ofd) <= (nsb - nfd) && (fx == 0)) { ; terminal_move_to_char(el, (int)(nfd - new)); if (nsb != ne) { ; fx = (int)((nsb - nfd) - (osb - ofd)); if (fx > 0) { ; terminal_insertwrite(el, nfd, fx); re_insert(el, old, (int)(ofd - old), el->el_terminal.t_size.h, nfd, fx); } len = (size_t) ((nsb - nfd) - fx); terminal_overwrite(el, (nfd + fx), len); re__strncopy(ofd + fx, nfd + fx, len); } else { ; len = (size_t) (nsb - nfd); terminal_overwrite(el, nfd, len); re__strncopy(ofd, nfd, len); } } if (sx >= 0) { ; terminal_move_to_char(el, (int)(nse - new)); if (ols != oe) { ; if (sx > 0) { ; terminal_insertwrite(el, nse, sx); } terminal_overwrite(el, (nse + sx), (size_t)((nls - nse) - sx)); } else { ; terminal_overwrite(el, nse, (size_t)(nls - nse)); } } ; }
long re_update_line(long a1, unsigned int *a2, unsigned int *a3, unsigned int a4) { long result; _BYTE *v5; int v7; int v8; int v9; int v10; int v11; unsigned int *v12; unsigned int *v13; unsigned int *m; unsigned int *i; unsigned int *j; unsigned int *v17; char *k; char *n; unsigned int *v20; unsigned int *v21; unsigned int *v22; char *v23; long v24; unsigned int *v25; unsigned int *v26; unsigned int *v27; unsigned int *v28; unsigned int *v29; long v30; long v31; v12 = a2; for ( i = a3; *v12 && *v12 == *i; ++i ) ++v12; v26 = v12; v27 = i; while ( *v12 ) ++v12; while ( v26 < v12 && *(v12 - 1) == 32 ) --v12; v28 = v12; *v12 = 0; while ( *i ) ++i; while ( v27 < i && *(i - 1) == 32 ) --i; v29 = i; *i = 0; if ( *v26 || (result = *v27, (_DWORD)result) ) { do { if ( v12 <= v26 ) break; if ( i <= v27 ) break; --v12; --i; } while ( *v12 == *i ); v20 = v12 + 1; v21 = i + 1; v22 = v12 + 1; v24 = (long)(i + 1); v23 = (char *)(v12 + 1); v25 = i + 1; if ( *v26 ) { for ( j = v27; j < v21; ++j ) { if ( *v26 == *j ) { v13 = v26; for ( k = (char *)j; k < (char *)v21 && v13 < v20 && *v13 == *(_DWORD *)k; k += 4 ) ++v13; if ( (long)v25 - v24 < k - (char *)j && (k - (char *)j) >> 1 > j - v27 ) { v24 = (long)j; v25 = (unsigned int *)k; v22 = v26; v23 = (char *)v13; } } } } if ( *v27 ) { for ( m = v26; m < v20; ++m ) { if ( *v27 == *m ) { v17 = v27; for ( n = (char *)m; n < (char *)v20 && v17 < v21 && *(_DWORD *)n == *v17; n += 4 ) ++v17; if ( v23 - (char *)v22 < n - (char *)m && (n - (char *)m) >> 1 > m - v26 ) { v24 = (long)v27; v25 = v17; v22 = m; v23 = n; } } } } if ( (char *)v28 - (char *)v20 <= 12 ) { v20 = v28; v21 = v29; } v7 = ((v24 - (long)v27) >> 2) - (v22 - v26); v10 = v21 - v25 - (((char *)v20 - v23) >> 2); if ( (*(_DWORD *)(a1 + 152) & 1) == 0 ) { if ( v7 > 0 ) { v22 = v20; v23 = (char *)v20; v24 = (long)v21; v25 = v21; } if ( v10 > 0 ) { v20 = v28; v21 = v29; } if ( (char *)v20 - (char *)v26 < (char *)v21 - (char *)v27 ) { v20 = v28; v21 = v29; } } if ( (*(_DWORD *)(a1 + 152) & 2) == 0 ) { if ( v7 < 0 ) { v22 = v20; v23 = (char *)v20; v24 = (long)v21; v25 = v21; } if ( v10 < 0 ) { v20 = v28; v21 = v29; } if ( (char *)v20 - (char *)v26 > (char *)v21 - (char *)v27 ) { v20 = v28; v21 = v29; } } if ( v23 - (char *)v22 <= 12 ) { v22 = v20; v23 = (char *)v20; v24 = (long)v21; v25 = v21; } v8 = ((v24 - (long)v27) >> 2) - (v22 - v26); v11 = v21 - v25 - (((char *)v20 - v23) >> 2); terminal_move_to_line(a1, a4); if ( v20 == v28 ) v5 = v23; else v5 = v28; if ( (unsigned int *)v24 == v27 || v8 <= 0 || v8 + ((v5 - (_BYTE *)a2) >> 2) > *(int *)(a1 + 144) ) { if ( v8 >= 0 ) { v8 = 0; } else { terminal_move_to_char(a1, (unsigned int)(v26 - a2)); if ( v22 == v28 ) { terminal_overwrite(a1, v27, (v24 - (long)v27) >> 2); return re_clear_eol(a1, v8, v11, (unsigned int)(v28 - a2) - (unsigned int)(v29 - a3)); } terminal_deletechars(a1, (unsigned int)(v22 - v26) - (unsigned int)((v24 - (long)v27) >> 2)); re_delete(a1, (long)a2, v26 - a2, *(_DWORD *)(a1 + 144), v22 - v26 - ((v24 - (long)v27) >> 2)); terminal_overwrite(a1, v27, (v24 - (long)v27) >> 2); re__strncopy(v26, v27, (v24 - (long)v27) >> 2); } } else { terminal_move_to_char(a1, (unsigned int)(v27 - a3)); if ( (unsigned int *)v24 == v29 ) { terminal_overwrite(a1, v27, (v24 - (long)v27) >> 2); return re__strncopy(v26, v27, (v24 - (long)v27) >> 2); } terminal_insertwrite(a1, v27, (unsigned int)v8); re_insert(a1, (long)a2, v26 - a2, *(_DWORD *)(a1 + 144), v27, v8); v30 = ((v24 - (long)v27) >> 2) - v8; terminal_overwrite(a1, &v27[v8], v30); re__strncopy(&v26[v8], &v27[v8], v30); } if ( v11 < 0 && v8 + ((v23 - (char *)a2) >> 2) < *(int *)(a1 + 144) ) { terminal_move_to_char(a1, (unsigned int)((v23 - (char *)a2) >> 2) + v8); if ( v20 == v28 ) { terminal_overwrite(a1, v25, v21 - v25); re_clear_eol(a1, v8, v11, v28 - a2 - (v29 - a3)); } else { terminal_deletechars(a1, (unsigned int)(((char *)v20 - v23) >> 2) - (unsigned int)(v21 - v25)); terminal_overwrite(a1, v25, v21 - v25); } } result = v24; if ( (unsigned int *)v24 != v27 ) { result = v24 - (_QWORD)v27; if ( (char *)v22 - (char *)v26 <= v24 - (long)v27 && !v8 ) { terminal_move_to_char(a1, (unsigned int)(v27 - a3)); if ( (unsigned int *)v24 == v29 ) { terminal_overwrite(a1, v27, (v24 - (long)v27) >> 2); result = re__strncopy(v26, v27, (v24 - (long)v27) >> 2); } else { v9 = ((v24 - (long)v27) >> 2) - (v22 - v26); if ( v9 > 0 ) { terminal_insertwrite(a1, v27, (unsigned int)v9); re_insert(a1, (long)a2, v26 - a2, *(_DWORD *)(a1 + 144), v27, v9); } v31 = ((v24 - (long)v27) >> 2) - v9; terminal_overwrite(a1, &v27[v9], v31); result = re__strncopy(&v26[v9], &v27[v9], v31); } } } if ( v11 >= 0 ) { terminal_move_to_char(a1, (unsigned int)(v25 - a3)); if ( v20 == v28 ) { return terminal_overwrite(a1, v25, v21 - v25); } else { if ( v11 > 0 ) terminal_insertwrite(a1, v25, (unsigned int)v11); return terminal_overwrite(a1, &v25[v11], v21 - v25 - v11); } } } return result; }
static Bool myfeof ( FILE* f ) { Int32 c = fgetc ( f ); if (c == (-1) ) return ((Bool)1); ungetc ( c, f ); return ((Bool)0); }
long myfeof(FILE *a1) { int c; c = fgetc(a1); if ( c == -1 ) return 1LL; ungetc(c, a1); return 0LL; }
static void color_cap_mt_fct (void) { context_match_color = selected_match_color; }
void color_cap_mt_fct(void) { context_match_color = selected_match_color; return; }
static PATTERN_LIST * copy_case_clause (clause) PATTERN_LIST *clause; { PATTERN_LIST *new_clause; new_clause = (PATTERN_LIST *)sh_xmalloc((sizeof (PATTERN_LIST)), "copy_cmd.c", 94); new_clause->patterns = copy_word_list (clause->patterns); new_clause->action = copy_command (clause->action); new_clause->flags = clause->flags; return (new_clause); }
long copy_case_clause(long param_1) { long lVar1; undefined8 uVar2; lVar1 = sh_xmalloc(0x20,"copy_cmd.c",0x5e); uVar2 = copy_word_list(*(undefined8 *)(param_1 + 8)); *(undefined8 *)(lVar1 + 8) = uVar2; uVar2 = copy_command(*(undefined8 *)(param_1 + 0x10)); *(undefined8 *)(lVar1 + 0x10) = uVar2; *(undefined4 *)(lVar1 + 0x18) = *(undefined4 *)(param_1 + 0x18); return lVar1; }
_Bool pred_or (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr) { if (pred_ptr->pred_left == ((void *)0) || !apply_predicate (pathname, stat_buf, pred_ptr->pred_left)) { return apply_predicate (pathname, stat_buf, pred_ptr->pred_right); } else return 1 ; }
long long pred_or(unsigned long long a0, unsigned long long a1, unsigned long long a2[36]) { unsigned long long v2; if (!a2[34]) { LABEL_401464: v2 = apply_predicate(a0, a1, a2[35], a1); } else { if (!(!(apply_predicate(a0, a1, a2[34], a1) ^ 1))) goto LABEL_401464; v2 = 1; } return v2; }
em_kill_line(EditLine *el, wint_t c __attribute__((__unused__))) { wchar_t *kp, *cp; cp = el->el_line.buffer; kp = el->el_chared.c_kill.buf; while (cp < el->el_line.lastchar) *kp++ = *cp++; el->el_chared.c_kill.last = kp; el->el_line.lastchar = el->el_line.buffer; el->el_line.cursor = el->el_line.buffer; return 4; }
undefined8 em_kill_line(long param_1) { undefined4 *local_18; undefined4 *local_10; local_18 = *(undefined4 **)(param_1 + 0x380); local_10 = *(undefined4 **)(param_1 + 0x50); while (local_10 < *(undefined4 **)(param_1 + 0x60)) { *local_18 = *local_10; local_18 = local_18 + 1; local_10 = local_10 + 1; } *(undefined4 **)(param_1 + 0x388) = local_18; *(undefined8 *)(param_1 + 0x60) = *(undefined8 *)(param_1 + 0x50); *(undefined8 *)(param_1 + 0x58) = *(undefined8 *)(param_1 + 0x50); return 4; }
static _Bool temp_stream (FILE **fp, char **file_name) { static char *tempfile = ((void *)0) ; static FILE *tmp_fp; if (tempfile == ((void *)0) ) { char const *t = getenv ("TMPDIR"); char const *tempdir = t ? t : "/tmp"; tempfile = mfile_name_concat (tempdir, "tacXXXXXX", ((void *)0) ); if (tempdir == ((void *)0) ) { error (0, 0, gettext ("memory exhausted")); return 0 ; } int fd = mkstemp_safer (tempfile); if (fd < 0) { error (0, (*__errno_location ()) , gettext ("failed to create temporary file in %s"), quotearg_style (shell_escape_always_quoting_style, tempdir)); goto Reset; } tmp_fp = fdopen (fd, ( 0 ? "w+b" : "w+")); if (! tmp_fp) { error (0, (*__errno_location ()) , gettext ("failed to open %s for writing"), quotearg_style (shell_escape_always_quoting_style, tempfile)); close (fd); unlink (tempfile); Reset: free (tempfile); tempfile = ((void *)0) ; return 0 ; } record_or_unlink_tempfile (tempfile, tmp_fp); } else { clearerr_unlocked (tmp_fp); if ( rpl_fseeko (tmp_fp, 0, 0 ) < 0 || ftruncate (fileno (tmp_fp), 0) < 0) { error (0, (*__errno_location ()) , gettext ("failed to rewind stream for %s"), quotearg_style (shell_escape_always_quoting_style, tempfile)); return 0 ; } } *fp = tmp_fp; *file_name = tempfile; return 1 ; }
long temp_stream(_QWORD *a1, _QWORD *a2) { const char *v2; char *v3; long v5; char *v6; int *v7; long v8; char *v9; int *v10; int v11; long v12; char *v13; int *v14; int fd; char *v16; const char *v17; if ( tempfile_5946 ) { clearerr_unlocked(tmp_fp_5947); if ( (int)rpl_fseeko(tmp_fp_5947, 0LL, 0LL) < 0 || (v11 = fileno(tmp_fp_5947), ftruncate(v11, 0LL) < 0) ) { v12 = quotearg_style(4LL, tempfile_5946); v13 = gettext("failed to rewind stream for %s"); v14 = _errno_location(); error(0, *v14, v13, v12); return 0LL; } } else { v16 = getenv("TMPDIR"); if ( v16 ) v2 = v16; else v2 = "/tmp"; v17 = v2; tempfile_5946 = (char *)mfile_name_concat(v2, "tacXXXXXX", 0LL); if ( !v17 ) { v3 = gettext("memory exhausted"); error(0, 0, v3); return 0LL; } fd = mkstemp_safer(tempfile_5946); if ( fd < 0 ) { v5 = quotearg_style(4LL, v17); v6 = gettext("failed to create temporary file in %s"); v7 = _errno_location(); error(0, *v7, v6, v5); LABEL_11: free(tempfile_5946); tempfile_5946 = 0LL; return 0LL; } tmp_fp_5947 = fdopen(fd, "w+"); if ( !tmp_fp_5947 ) { v8 = quotearg_style(4LL, tempfile_5946); v9 = gettext("failed to open %s for writing"); v10 = _errno_location(); error(0, *v10, v9, v8); close(fd); unlink(tempfile_5946); goto LABEL_11; } record_or_unlink_tempfile(tempfile_5946); } *a1 = tmp_fp_5947; *a2 = tempfile_5946; return 1LL; }
static char * prompt_modestr (int *lenp) { if (rl_editing_mode == 1) { if (lenp) *lenp = _rl_emacs_mode_str ? _rl_emacs_modestr_len : 1; return _rl_emacs_mode_str ? _rl_emacs_mode_str : "@"; } else if (_rl_keymap == vi_insertion_keymap) { if (lenp) *lenp = _rl_vi_ins_mode_str ? _rl_vi_ins_modestr_len : 5; return _rl_vi_ins_mode_str ? _rl_vi_ins_mode_str : "(ins)"; } else { if (lenp) *lenp = _rl_vi_cmd_mode_str ? _rl_vi_cmd_modestr_len : 5; return _rl_vi_cmd_mode_str ? _rl_vi_cmd_mode_str : "(cmd)"; } }
long long prompt_modestr(unsigned int *a0) { unsigned int v1; unsigned int v2; unsigned int v3; unsigned long long v4; if (rl_editing_mode == 1) { if (a0) { if (false) v1 = 1; else v1 = 9510614540747572040; *(a0) = v1; } if (false) v4 = "@"; else v4 = 9187057905897864585; } else if (_rl_keymap != 5242904) { if (a0) { if (false) v3 = 5; else v3 = 9510614540747572040; *(a0) = v3; } if (false) v4 = "(cmd)"; else v4 = 9187057905897864585; } else { if (a0) { if (false) v2 = 5; else v2 = 9510614540747572040; *(a0) = v2; } if (false) v4 = "(ins)"; else v4 = 9187057905897864585; } return v4; }
static size_t count_ampersands (char const *str) { size_t count = 0; do { if (*str == '&') count++; } while (*str++); return count; }
int count_ampersands(unsigned long a0) { char *v0; int tmp_9; void* v1; v0 = a0; v1 = 0; do { if (*(v0) == 38) v1 += 1; tmp_9 = v0; v0 += 1; } while (*(tmp_9)); return v1; }
static void clear_table(TABLEROW * table) { TABLEROW *tr1, *tr2; TABLEITEM *ti1, *ti2; tr1 = table; while (tr1->prev) tr1 = tr1->prev; while (tr1) { ti1 = tr1->first; while (ti1) { ti2 = ti1->next; if (ti1->contents) free(ti1->contents); free(ti1); ti1 = ti2; } tr2 = tr1; tr1 = tr1->next; free(tr2); } }
void clear_table(void ***a1) { void **ptr; void ***v3; void **v4; while ( a1[1] ) a1 = (void ***)a1[1]; while ( a1 ) { for ( ptr = *a1; ptr; ptr = v4 ) { v4 = (void **)ptr[6]; if ( *ptr ) free(*ptr); free(ptr); } v3 = a1; a1 = (void ***)a1[2]; free(v3); } }
static int bash_possible_hostname_completions (ignore, ignore2) int ignore, ignore2; { return bash_complete_hostname_internal ('?'); }
long long bash_possible_hostname_completions(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned int v1; v1 = a0; v0 = a1; return bash_complete_hostname_internal(0x3f); }
static int output_builtin_bin(struct depmod *depmod, FILE *out) { FILE *in; struct index_node *idx; char line[ 4096 ], modname[ 4096 ]; if (out == stdout ) return 0; in = dfdopen(depmod->cfg->dirname, "modules.builtin", 00 , "r"); if (in == ((void *)0) ) return 0; idx = index_create(); if (idx == ((void *)0) ) { fclose(in); return - 12 ; } while (fgets(line, sizeof(line), in) != ((void *)0) ) { if (! ((*__ctype_b_loc ())[(int) (( line[0] ))] & (unsigned short int) _ISalpha) ) { log_printf( 3 , "Invalid modules.builtin line: %s\n", line); continue; } path_to_modname(line, modname, ((void *)0) ); index_insert(idx, modname, "", 0); } index_write(idx, out); index_destroy(idx); fclose(in); return 0; }
undefined8 output_builtin_bin(long *param_1,long param_2) { undefined8 uVar1; FILE *__stream; long lVar2; ushort **ppuVar3; char *pcVar4; long in_FS_OFFSET; char local_2018 [4096]; undefined local_1018 [4104]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); if (param_2 == stdout) { uVar1 = 0; } else { __stream = (FILE *)dfdopen(*param_1 + 8,"modules.builtin",0,&DAT_0010064f); if (__stream == (FILE *)0x0) { uVar1 = 0; } else { lVar2 = index_create(); if (lVar2 == 0) { fclose(__stream); uVar1 = 0xfffffff4; } else { while( true ) { pcVar4 = fgets(local_2018,0x1000,__stream); if (pcVar4 == (char *)0x0) break; ppuVar3 = __ctype_b_loc(); if (((*ppuVar3)[local_2018[0]] & 0x400) == 0) { log_printf(3,"Invalid modules.builtin line: %s\n",local_2018); } else { path_to_modname(local_2018,local_1018,0); index_insert(lVar2,local_1018,&DAT_001004fd,0); } } index_write(lVar2,param_2); index_destroy(lVar2); fclose(__stream); uVar1 = 0; } } } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar1; }
!ext2fs_has_feature_extents(fs->super) && fix_problem(ctx, 0x000048, &pctx)) { ext2fs_set_feature_extents(fs->super); ext2fs_mark_super_dirty(fs); }
bool ext2fs_has_feature_extents(long param_1) { return (*(uint *)(param_1 + 0x60) & 0x40) != 0; }
static void hdlr_sigchld(void) { pthread_mutex_lock(&mutChildDied); bChildDied = 1; pthread_mutex_unlock(&mutChildDied); }
long long hdlr_sigchld() { pthread_mutex_lock(&mutChildDied); bChildDied = 1; return pthread_mutex_unlock(&mutChildDied); }
static _Bool string_match (const char *tok, const char *string) { if (strcasecmp (tok, "ALL") == 0) { return 1 ; } else if (strcasecmp (tok, string) == 0) { return 1 ; } return 0 ; }
int string_match(char *a0, char *a1) { unsigned int v1; if (!strcasecmp(a0, "ALL")) { v1 = 1; } else if (!strcasecmp(a0, a1)) { v1 = 1; } else { v1 = 0; } return v1; }
int rl_backward_char_search (int count, int key) { if ((rl_readline_state & (0x0080000))) { _rl_callback_data = _rl_callback_data_alloc (count); _rl_callback_data->i1 = -2; _rl_callback_data->i2 = 2; _rl_callback_func = _rl_char_search_callback; return (0); } return (_rl_char_search (count, -2, 2)); }
long long rl_backward_char_search(unsigned long a0, unsigned long a1) { unsigned int v0; void* v2; v0 = a1; if (!(rl_readline_state & 0x80000)) { v2 = _rl_char_search(a0, 0xfffffffe, 0x2); } else { _rl_callback_data = _rl_callback_data_alloc(a0); *((_rl_callback_data + 4)) = -2; *((_rl_callback_data + 8)) = 2; _rl_callback_func = _rl_char_search_callback; v2 = 0; } return v2; }
static unsigned char equal(signed char b,signed char c) { unsigned char ub = b; unsigned char uc = c; unsigned char x = ub ^ uc; crypto_uint32 y = x; y -= 1; y >>= 31; return y; }
int equal(unsigned long a0, unsigned long a1) { char v0; unsigned int v1; v0 = a0 ^ a1; v1 = v0; v1 -= 1; v1 >>= 31; return v1; }
static void bsPutUInt32 ( EState* s, UInt32 u ) { bsW ( s, 8, (u >> 24) & 0xffL ); bsW ( s, 8, (u >> 16) & 0xffL ); bsW ( s, 8, (u >> 8) & 0xffL ); bsW ( s, 8, u & 0xffL ); }
void bsPutUInt32(void* a0, unsigned long a1) { unsigned long long v1; bsW(a0, 0x8, a1 >> 24); bsW(a0, 0x8, a1 >> 16); bsW(a0, 0x8, a1 >> 8); v1 = bsW(a0, 0x8, a1); return; }
static void print_compopts (cmd, cs, full) const char *cmd; COMPSPEC *cs; int full; { printf ("compopt "); print_compoptions (cs->options, full); print_cmd_name (cmd); printf ("\n"); }
int print_compopts(const char *a1, long a2, int a3) { printf("compopt "); print_compoptions(*(_QWORD *)(a2 + 16), a3); print_cmd_name(a1); return printf("\n"); }
struct alias * lookupalias(const char *name, int check) { struct alias *ap = *__lookupalias(name); if (check && ap && (ap->flag & 1)) return ( ((void *)0) ); return (ap); }
long long lookupalias(char *a0, unsigned long a1) { void* v0; void* v3; v0 = *(__lookupalias(a0)); if (a1 && v0 && (v0[24] & 1)) { v3 = 0; return v3; } v3 = v0; return v3; }
static void * internal_memalign (alignment, size, file, line, flags) size_t alignment; size_t size; const char *file; int line, flags; { register char *ptr; register char *aligned; register union mhead *p; ptr = internal_malloc (size + alignment, file, line, 0x02); if (ptr == 0) return 0; if (((long) ptr & (alignment - 1)) == 0) return ptr; aligned = (char *) (((long) ptr + alignment - 1) & (~alignment + 1)); p = (union mhead *) aligned - 1; p->minfo.mi_nbytes = aligned - ptr; p->minfo.mi_alloc = ((char) 0xd6); return aligned; }
long internal_memalign(long a1, long a2, char *a3, unsigned int a4) { long result; long v5; result = internal_malloc(a2 + a1, a3, a4); if ( !result ) return 0LL; if ( (result & (a1 - 1)) != 0 ) { v5 = ((result + a1 - 1) & -a1) - 16; *(_DWORD *)(v5 + 4) = ((result + a1 - 1) & -(int)a1) - result; *(_BYTE *)v5 = -42; return (result + a1 - 1) & -a1; } return result; }
static int parse_fwd_field(char **p, struct fwdarg *fwd) { char *ep, *cp = *p; int ispath = 0; if (*cp == '\0') { *p = ((void *)0) ; return -1; } if (*cp == '[') { for (ep = cp + 1; *ep != ']' && *ep != '\0'; ep++) { if (*ep == '/') ispath = 1; } if (ep[0] != ']' || (ep[1] != ':' && ep[1] != '\0')) return -1; *ep++ = '\0'; if (*ep != '\0') *ep++ = '\0'; fwd->arg = cp + 1; fwd->ispath = ispath; *p = ep; return 0; } for (cp = *p; *cp != '\0'; cp++) { switch (*cp) { case '\\': memmove(cp, cp + 1, strlen(cp + 1) + 1); if (*cp == '\0') return -1; break; case '/': ispath = 1; break; case ':': *cp++ = '\0'; goto done; } } done: fwd->arg = *p; fwd->ispath = ispath; *p = cp; return 0; }
int parse_fwd_field(unsigned long long *a0, struct_0 *a1) { unsigned int v0; int tmp_11; unsigned long v1; unsigned long v2; unsigned int v4; v2 = *(a0); v0 = 0; if (!*(v2)) { *(a0) = 0; v4 = -1; } else if (*(v2) != 91) { v2 = *(a0); while (true) { if (!*(v2)) { LABEL_408c94: a1->field_0 = *(a0); a1->field_8 = v0; *(a0) = v2; *(&v4) = 0; break; } else { if (*(v2) == 92) { memmove(v2, v2 + 1, strlen(v2 + 1) + 1); if (!*(v2)) { v4 = -1; break; } } else if (*(v2) <= 92) { if (*(v2) == 47) { v0 = 1; } else if (*(v2) == 58) { v4 = v2; v2 += 1; *(v4) = 0; goto LABEL_408c94; } } v2 += 1; } } } else { v1 = v2 + 1; while (true) { if (*(v1) == 93) break; if (!*(v1)) break; if (*(v1) == 47) v0 = 1; v1 += 1; } if (*(v1) != 93) { LABEL_408b99: v4 = -1; } else if (*((v1 + 1)) == 58) { LABEL_408ba3: tmp_11 = v1; v1 += 1; *(tmp_11) = 0; if (*(v1)) { v4 = v1; v1 += 1; *(v4) = 0; } a1->field_0 = v2 + 1; a1->field_8 = v0; *(a0) = v1; *(&v4) = 0; } else { if (!*((v1 + 1))) goto LABEL_408ba3; goto LABEL_408b99; } } return v4; }
static int is_version_number(const char *version) { unsigned int d1, d2; return (sscanf(version, "%u.%u", &d1, &d2) == 2); }
_BOOL8 is_version_number(long a1) { char v2; char v3; unsigned long v4; v4 = __readfsqword(0x28u); return (unsigned int)_isoc99_sscanf(a1, "%u.%u", &v2, &v3) == 2; }
static void specify_nmerge (int oi, char c, char const *s) { uintmax_t n; struct rlimit rlimit; enum strtol_error e = xstrtoumax (s, ((void *)0) , 10, &n, ""); unsigned int max_nmerge = ((getrlimit ( RLIMIT_NOFILE , &rlimit) == 0 ? rlimit.rlim_cur : 20) - 3); if (e == LONGINT_OK) { nmerge = n; if (nmerge != n) e = LONGINT_OVERFLOW; else { if (nmerge < 2) { error (0, 0, gettext ("invalid --%s argument %s"), long_options[oi].name, quote (s)); ((!!sizeof (struct { _Static_assert (SORT_FAILURE, "verify_expr (" "SORT_FAILURE" ", " "(error (SORT_FAILURE, 0, gettext (\"minimum --%s argument is %s\"), long_options[oi].name, quote (\"2\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (SORT_FAILURE, 0, gettext ("minimum --%s argument is %s"), long_options[oi].name, quote ("2")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (SORT_FAILURE, 0, gettext ("minimum --%s argument is %s"), long_options[oi].name, quote ("2")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; } else if (max_nmerge < nmerge) { e = LONGINT_OVERFLOW; } else return; } } if (e == LONGINT_OVERFLOW) { char max_nmerge_buf[((((((sizeof (max_nmerge) * 8) - (! ((__typeof__ (max_nmerge)) 0 < (__typeof__ (max_nmerge)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (max_nmerge)) 0 < (__typeof__ (max_nmerge)) -1))) + 1)]; error (0, 0, gettext ("--%s argument %s too large"), long_options[oi].name, quote (s)); ((!!sizeof (struct { _Static_assert (SORT_FAILURE, "verify_expr (" "SORT_FAILURE" ", " "(error (SORT_FAILURE, 0, gettext (\"maximum --%s argument with current rlimit is %s\"), long_options[oi].name, uinttostr (max_nmerge, max_nmerge_buf)), assume (false))" ")"); int _gl_dummy; })) ? ((error (SORT_FAILURE, 0, gettext ("maximum --%s argument with current rlimit is %s"), long_options[oi].name, uinttostr (max_nmerge, max_nmerge_buf)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (SORT_FAILURE, 0, gettext ("maximum --%s argument with current rlimit is %s"), long_options[oi].name, uinttostr (max_nmerge, max_nmerge_buf)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; } else xstrtol_fatal (e, oi, c, long_options, s); }
unsigned long specify_nmerge(int a1, char a2, long a3) { int v3; long v4; long v5; char *v6; long v7; long v8; char *v9; long v10; long v11; char *v12; long v13; long v14; char *v15; unsigned int v18; unsigned int v19; long v20; struct rlimit rlimits; char v22[11]; unsigned long v23; v23 = __readfsqword(0x28u); v18 = xstrtoumax(a3, 0LL, 10LL, &v20, locale); if ( getrlimit(RLIMIT_NOFILE, &rlimits) ) v3 = 17; else v3 = LODWORD(rlimits.rlim_cur) - 3; v19 = v3; if ( v18 ) goto LABEL_11; nmerge = v20; if ( (unsigned int)v20 != v20 ) { v18 = 1; LABEL_11: if ( v18 == 1 ) { v10 = quote(a3); v11 = *((_QWORD *)&long_options.name + 4 * a1); v12 = gettext("--%s argument %s too large"); error(0, 0, v12, v11, v10); v13 = uinttostr(v19, v22); v14 = *((_QWORD *)&long_options.name + 4 * a1); v15 = gettext("maximum --%s argument with current rlimit is %s"); error(2, 0, v15, v14, v13); } xstrtol_fatal(v18, (unsigned int)a1, (unsigned int)a2, &long_options, a3); return __readfsqword(0x28u) ^ v23; } if ( (unsigned int)nmerge <= 1 ) { v4 = quote(a3); v5 = *((_QWORD *)&long_options.name + 4 * a1); v6 = gettext("invalid --%s argument %s"); error(0, 0, v6, v5, v4); v7 = quote("2"); v8 = *((_QWORD *)&long_options.name + 4 * a1); v9 = gettext("minimum --%s argument is %s"); error(2, 0, v9, v8, v7); } if ( v19 < nmerge ) { v18 = 1; goto LABEL_11; } return __readfsqword(0x28u) ^ v23; }
void array_dispose(a) ARRAY *a; { if (a == 0) return; array_flush (a); array_dispose_element(a->head); sh_xfree((a), "array.c", 123); }
void array_dispose(struct_0 *a0) { unsigned long long v1; if (a0) { array_flush(a0); array_dispose_element(a0->field_10); v1 = sh_xfree(a0, "array.c", 0x7b); return; } return; }
static _Bool count_items (__attribute__ ((__unused__)) struct item *unused) { n_strings++; return 0 ; }
undefined8 count_items(void) { n_strings = n_strings + 1; return 0; }
static void usage(void) { fprintf( stderr , "Usage: ip -f inet6 tunnel { add | change | del | show } [ NAME ]\n" " [ mode { ip6ip6 | ipip6 | ip6gre | vti6 | any } ]\n" " [ remote ADDR local ADDR ] [ dev PHYS_DEV ]\n" " [ encaplimit ELIM ]\n" " [ hoplimit TTL ] [ tclass TCLASS ] [ flowlabel FLOWLABEL ]\n" " [ dscp inherit ]\n" " [ [no]allow-localremote ]\n" " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n" "\n" "Where: NAME := STRING\n" " ADDR := IPV6_ADDRESS\n" " ELIM := { none | 0..255 }(default=%d)\n" " TTL := 0..255 (default=%d)\n" " TCLASS := { 0x0..0xff | inherit }\n" " FLOWLABEL := { 0x0..0xfffff | inherit }\n" " KEY := { DOTTED_QUAD | NUMBER }\n", 4, (64)); exit(-1); }
void usage() { fprintf(stderr, "Usage: ip -f inet6 tunnel { add | change | del | show } [ NAME ]\n [ mode { ip6ip6 | ipip6 | ip6gre | vti6 | any } ]\n [ remote ADDR local ADDR ] [ dev PHYS_DEV ]\n [ encaplimit ELIM ]\n [ hoplimit TTL ] [ tclass TCLASS ] [ flowlabel FLOWLABEL ]\n [ dscp inherit ]\n [ [no]allow-localremote ]\n [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n\nWhere: NAME := STRING\n ADDR := IPV6_ADDRESS\n ELIM := { none | 0..255 }(default=%d)\n TTL := 0..255 (default=%d)\n TCLASS := { 0x0..0xff | inherit }\n FLOWLABEL := { 0x0..0xfffff | inherit }\n KEY := { DOTTED_QUAD | NUMBER }\n", 4, 64); exit(0xffffffff); }
void print_select_command_head (select_command) SELECT_COM *select_command; { cprintf ("select %s in ", select_command->name->word); command_print_word_list (select_command->map_list, " "); }
void print_select_command_head(long param_1) { cprintf("select %s in ",**(undefined8 **)(param_1 + 8)); command_print_word_list(*(undefined8 *)(param_1 + 0x10),&DAT_00103591); return; }
char **env_set(char **envp, const char *envstr) { size_t count, found; char **p, *envtmp; found = (size_t)-1; for (count = 0; envp[count] != ((void *)0) ; count++) { if (!strcmp_until(envp[count], envstr, '=')) found = count; } count++; if (found != (size_t)-1) { if ((envtmp = strdup(envstr)) == ((void *)0) ) return ( ((void *)0) ); free(envp[found]); envp[found] = envtmp; return (envp); } if ((envtmp = strdup(envstr)) == ((void *)0) ) return ( ((void *)0) ); p = (char **) realloc((void *) envp, (count + 1) * sizeof (char *)); if (p == ((void *)0) ) { free(envtmp); return ( ((void *)0) ); } p[count] = p[count - 1]; p[count - 1] = envtmp; return (p); }
int env_set(unsigned long long a0, char *a1) { unsigned long long v0; unsigned long long v1; unsigned long v2; unsigned long long *v3; unsigned int v5; v1 = -1; for (v0 = 0; *((a0 + (v0 << 3))); v0 += 1) { v5 = strcmp_until(*((a0 + v0 * 8)), a1, 0x3d, a1); if (!v5) v1 = v0; } v0 += 1; if (v1 != -1) { v2 = strdup(a1); if (!v2) { v5 = 0; } else { free(*((a0 + v1 * 8))); *((v1 * 8 + a0)) = v2; v5 = a0; } } else { v2 = strdup(a1); if (!v2) { v5 = 0; } else { v3 = realloc(a0, (v0 + 1) * 8); if (!v3) { free(v2); v5 = 0; } else { *((v3 + 0x8 * v0)) = *((-8 + v3 + 0x8 * v0)); *((-8 + 0x8 * v0 + v3)) = v2; v5 = v3; } } } return v5; }
static void send_mesg_to_tty (int tty_fd) { struct termios oldt, newt; FILE *mesg_file, *tty_file; _Bool is_tty; tty_file = fdopen (tty_fd, "w"); if ( ((void *)0) == tty_file) { return; } is_tty = (tcgetattr(tty_fd, &oldt) == 0); if (is_tty) { newt = oldt; newt.c_oflag |= 0000001 ; tcsetattr(tty_fd, 0 , &newt); } mesg_file = fopen ("/etc/logoutd.mesg", "r"); if ( ((void *)0) != mesg_file) { int c; while ((c = getc (mesg_file)) != (-1) ) { if (c == '\n') { putc ('\r', tty_file); } putc (c, tty_file); } fclose (mesg_file); } else { fputs (gettext ("login time exceeded\n\n"), tty_file); } fflush (tty_file); fclose (tty_file); if (is_tty) { tcsetattr(tty_fd, 0 , &oldt); } }
void send_mesg_to_tty(int param_1) { int iVar1; int __c; FILE *__stream; FILE *__stream_00; char *__s; long in_FS_OFFSET; ulong local_98; undefined8 local_90; undefined8 local_88; undefined8 local_80; undefined8 local_78; undefined8 local_70; undefined8 local_68; speed_t local_60; ulong local_58; undefined8 local_50; undefined8 local_48; undefined8 local_40; undefined8 local_38; undefined8 local_30; undefined8 local_28; speed_t local_20; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); __stream = fdopen(param_1,"w"); if (__stream != (FILE *)0x0) { iVar1 = tcgetattr(param_1,(termios *)&local_98); if (iVar1 == 0) { local_50 = local_90; local_48 = local_88; local_40 = local_80; local_38 = local_78; local_30 = local_70; local_28 = local_68; local_20 = local_60; local_58 = local_98 | 0x100000000; tcsetattr(param_1,0,(termios *)&local_58); } __stream_00 = fopen("/etc/logoutd.mesg","r"); if (__stream_00 == (FILE *)0x0) { __s = (char *)gettext("login time exceeded\n\n"); fputs(__s,__stream); } else { while (__c = getc(__stream_00), __c != -1) { if (__c == 10) { putc(0xd,__stream); } putc(__c,__stream); } fclose(__stream_00); } fflush(__stream); fclose(__stream); if (iVar1 == 0) { tcsetattr(param_1,0,(termios *)&local_98); } } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
static int iplink_prop(int argc, char **argv) { struct iplink_req req = { .n.nlmsg_len = ((sizeof(struct ifinfomsg)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))), .n.nlmsg_flags = 0x01, .i.ifi_family = preferred_family, }; if (argc <= 0) { usage(); exit(-1); } if (matches(*argv, "add") == 0) { req.n.nlmsg_flags |= 0x200 | 0x400 | 0x800; req.n.nlmsg_type = RTM_NEWLINKPROP; } else if (matches(*argv, "del") == 0) { req.n.nlmsg_type = RTM_DELLINKPROP; } else if (matches(*argv, "help") == 0) { usage(); } else { fprintf( stderr , "Operator required\n"); exit(-1); } return iplink_prop_mod(argc - 1, argv + 1, &req); }
void iplink_prop(int param_1,undefined8 *param_2) { char cVar1; long lVar2; undefined8 *puVar3; long in_FS_OFFSET; undefined8 local_438; undefined local_428; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); puVar3 = &local_438; for (lVar2 = 0x84; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } local_438._0_4_ = 0x20; local_438._6_2_ = 1; local_428 = (undefined)preferred_family; if (param_1 < 1) { usage(); } cVar1 = matches(*param_2,&DAT_00107652); if (cVar1 == '\x01') { cVar1 = matches(*param_2,&DAT_00107656); if (cVar1 == '\x01') { cVar1 = matches(*param_2,&DAT_00107253); if (cVar1 != '\x01') { usage(); } fprintf(stderr,"Operator required\n"); exit(-1); } local_438._4_2_ = 0x6d; } else { local_438._6_2_ = local_438._6_2_ & 0xff | (ushort)(byte)((ulong)local_438._6_2_ >> 8) << 8 | 0xe00; local_438._4_2_ = 0x6c; } iplink_prop_mod(param_1 + -1,param_2 + 1,&local_438); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
static void deb_verify(const char *filename) { pid_t pid; if (!find_command("debsig-verify")) return; printf(gettext("Authenticating %s ...\n"), filename); fflush( stdout ); pid = subproc_fork(); if (!pid) { execlp("debsig-verify", "debsig-verify", "-q", filename, ((void *)0) ); ohshite(gettext("unable to execute %s (%s)"), gettext("package signature verification"), "debsig-verify"); } else { int status; status = subproc_reap(pid, "debsig-verify", SUBPROC_NOCHECK); if (!( ((( status ) & 0x7f) == 0) && ((( status ) & 0xff00) >> 8) == 0)) { if (!in_force(FORCE_BAD_VERIFY)) ohshit(gettext("verification on package %s failed!"), filename); else notice(gettext("verification on package %s failed; " "but installing anyway as you requested") , filename); } else { printf(gettext("passed\n")); } } }
void deb_verify(undefined8 param_1) { char cVar1; int iVar2; uint uVar3; char *pcVar4; undefined8 uVar5; undefined8 uVar6; cVar1 = find_command("debsig-verify"); if (cVar1 == '\x01') { pcVar4 = (char *)gettext("Authenticating %s ...\n"); printf(pcVar4,param_1); fflush(stdout); iVar2 = subproc_fork(); if (iVar2 == 0) { execlp("debsig-verify","debsig-verify",&DAT_00104a31,param_1,0); uVar5 = gettext("package signature verification"); uVar6 = gettext("unable to execute %s (%s)"); ohshite(uVar6,uVar5,"debsig-verify"); } uVar3 = subproc_reap(iVar2,"debsig-verify",4); if (((uVar3 & 0x7f) == 0) && (((int)uVar3 >> 8 & 0xffU) == 0)) { pcVar4 = (char *)gettext("passed\n"); printf(pcVar4); } else { cVar1 = in_force(4); if (cVar1 != '\x01') { uVar5 = gettext("verification on package %s failed!"); ohshit(uVar5,param_1); } uVar5 = gettext("verification on package %s failed; but installing anyway as you requested"); notice(uVar5,param_1); } } return; }