input
stringlengths
28
169k
output
stringlengths
20
317k
static void apply_delayed_links (void) { struct delayed_link *ds; for (ds = delayed_link_head; ds; ) { struct string_list *sources = ds->sources; char const *valid_source = 0; chdir_do (ds->change_dir); for (sources = ds->sources; sources; sources = sources->next) { char const *source = sources->string; struct stat st; if (fstatat (chdir_fd, source, &st, 0x100 ) == 0 && st.st_dev == ds->dev && st.st_ino == ds->ino && timespec_cmp (get_stat_birthtime (&st), ds->birthtime) == 0) { if (unlinkat (chdir_fd, source, 0) != 0) unlink_error (source); else if (valid_source && (linkat (chdir_fd, valid_source, chdir_fd, source, 0) == 0)) ; else if (!ds->is_symlink) { if (linkat (chdir_fd, ds->target, chdir_fd, source, 0) != 0) link_error (ds->target, source); } else if (symlinkat (ds->target, chdir_fd, source) != 0) symlink_error (ds->target, source); else { struct tar_stat_info st1; st1.stat.st_mode = ds->mode; st1.stat.st_uid = ds->uid; st1.stat.st_gid = ds->gid; st1.atime = ds->atime; st1.mtime = ds->mtime; st1.cntx_name = ds->cntx_name; st1.acls_a_ptr = ds->acls_a_ptr; st1.acls_a_len = ds->acls_a_len; st1.acls_d_ptr = ds->acls_d_ptr; st1.acls_d_len = ds->acls_d_len; st1.xattr_map = ds->xattr_map; st1.xattr_map_size = ds->xattr_map_size; set_stat (source, &st1, -1, 0, 0, '2', 0 , 0x100 ); valid_source = source; } } } for (sources = ds->sources; sources; ) { struct string_list *next = sources->next; free (sources); sources = next; } xheader_xattr_free (ds->xattr_map, ds->xattr_map_size); free (ds->cntx_name); { struct delayed_link *next = ds->next; free (ds); ds = next; } } delayed_link_head = 0; }
void apply_delayed_links() { struct_0 *v0; unsigned long long *v1; unsigned long v2; void* v3; void* v4; unsigned long v5; char v6; char v7; char v8; unsigned long v9; unsigned long v10; unsigned long v11; unsigned long v12; unsigned long v13; unsigned int v14; unsigned int v15; unsigned int v16; unsigned long v17; unsigned long v18; unsigned long v19; unsigned long v20; unsigned long v21; unsigned long v22; char v23; unsigned long long *v31; unsigned long long v32; for (v0 = delayed_link_head; v0; v0 = v3) { v1 = v0->field_60; v2 = 0; chdir_do(v0->field_58); for (v1 = v0->field_60; v1; v1 = *(v1)) { v5 = v1 + 1; if (!fstatat(chdir_fd, v5, &v6, 0x100) && *(&v6) == v0->field_8 && *(&v7) == v0->field_10 && !timespec_cmp(get_stat_birthtime(&v6), &v6, v0->field_18, v0->field_20)) { if (unlinkat(chdir_fd, v5, 0x0, v5)) { unlink_error(v5); } else if (!v2 || linkat(chdir_fd, v2, chdir_fd, v5, 0x0)) { if ((v0->field_28 ^ 1)) { if (linkat(chdir_fd, v0 + 1, chdir_fd, v5, 0x0)) link_error(v0 + 1, v5, v0 + 1); } else { if (symlinkat(v0 + 1, chdir_fd, v5, v0 + 1)) { symlink_error(v0 + 1, v5, v0 + 1); } else { v14 = v0->field_2c; v15 = v0->field_30; v16 = v0->field_34; v17 = v0->field_38; v18 = v0->field_40; v19 = v0->field_48; v20 = v0->field_50; v9 = v0->field_68; v10 = v0->field_70; v11 = v0->field_78; v12 = v0->field_80; v13 = v0->field_88; v22 = v0->field_98; v21 = v0->field_90; set_stat(v5, &v8, 0xffffffff, 0x0, 0x0, 0x32, 0x0, 0x100); v2 = v5; } } } } } for (v1 = v0->field_60; v1; v1 = v4) { v4 = *(v1); free(v1); } xheader_xattr_free(v0->field_98, v0->field_90, v0->field_90); free(v0->field_68); v3 = v0->field_0; free(v0); } delayed_link_head = 0; v32 = *(&v23) ^ v31[5]; return; }
void env_free(char **envp) { char **p; for (p = envp; *p != ((void *)0) ; p++) free(*p); free(envp); }
void env_free(void **a1) { void **i; for ( i = a1; *i; ++i ) free(*i); free(a1); }
static int channel_check_window(struct ssh *ssh, Channel *c) { int r; if (c->type == 4 && !(c->flags & (0x01|0x02)) && ((c->local_window_max - c->local_window > c->local_maxpacket*3) || c->local_window < c->local_window_max/2) && c->local_consumed > 0) { if (!c->have_remote_id) sshfatal("channels.c", __func__, 2183, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "channel %d: no remote id", c->self); if ((r = sshpkt_start(ssh, 93)) != 0 || (r = sshpkt_put_u32(ssh, c->remote_id)) != 0 || (r = sshpkt_put_u32(ssh, c->local_consumed)) != 0 || (r = sshpkt_send(ssh)) != 0) { sshfatal("channels.c", __func__, 2189, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "channel %i", c->self); } sshlog("channels.c", __func__, 2191, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "channel %d: window %d sent adjust %d", c->self, c->local_window, c->local_consumed) ; c->local_window += c->local_consumed; c->local_consumed = 0; } return 1; }
undefined8 channel_check_window(undefined8 param_1,int *param_2) { int iVar1; uint uVar2; uint uVar3; undefined8 uVar4; int **ppiVar5; undefined *puVar6; char *apcStack128 [2]; ulong auStack112 [5]; char *pcStack72; ulong uStack64; int *local_38; undefined8 local_30; int local_1c; ppiVar5 = &local_38; local_38 = param_2; if (*param_2 != 4) { return 1; } if ((param_2[6] & 3U) != 0) { return 1; } if (((uint)(param_2[0x2d] - param_2[0x2c]) <= (uint)(param_2[0x2f] * 3)) && ((uint)param_2[0x2d] >> 1 <= (uint)param_2[0x2c])) { return 1; } if (param_2[0x2e] == 0) { return 1; } local_30 = param_1; if (param_2[3] == 0) { uStack64 = (ulong)(uint)param_2[1]; ppiVar5 = (int **)&pcStack72; pcStack72 = "channel %d: no remote id"; sshfatal("channels.c","channel_check_window",0x887,1,1,0); } *(undefined8 *)((long)ppiVar5 + -8) = 0x107251; local_1c = sshpkt_start(local_30,0x5d); if (local_1c == 0) { iVar1 = local_38[2]; *(undefined8 *)((long)ppiVar5 + -8) = 0x10726f; local_1c = sshpkt_put_u32(local_30,iVar1); if (local_1c == 0) { iVar1 = local_38[0x2e]; *(undefined8 *)((long)ppiVar5 + -8) = 0x107290; local_1c = sshpkt_put_u32(local_30,iVar1); if (local_1c == 0) { *(undefined8 *)((long)ppiVar5 + -8) = 0x1072a5; local_1c = sshpkt_send(local_30); puVar6 = (undefined *)ppiVar5; if (local_1c == 0) goto LAB_001072f3; } } } uVar2 = local_38[1]; *(undefined8 *)((long)ppiVar5 + -8) = 0x1072bf; uVar4 = ssh_err(local_1c); *(ulong *)((long)ppiVar5 + -8) = (ulong)uVar2; puVar6 = (undefined *)((long)ppiVar5 + -0x10); *(char **)((long)ppiVar5 + -0x10) = "channel %i"; *(undefined8 *)((long)ppiVar5 + -0x18) = 0x1072f3; sshfatal("channels.c","channel_check_window",0x88d,1,1,uVar4); LAB_001072f3: uVar2 = local_38[0x2c]; uVar3 = local_38[1]; *(ulong *)(puVar6 + -8) = (ulong)(uint)local_38[0x2e]; *(ulong *)(puVar6 + -0x10) = (ulong)uVar2; *(ulong *)(puVar6 + -0x18) = (ulong)uVar3; *(char **)(puVar6 + -0x20) = "channel %d: window %d sent adjust %d"; *(undefined8 *)(puVar6 + -0x28) = 0x107347; sshlog("channels.c","channel_check_window",0x88f,0,6,0); local_38[0x2c] = local_38[0x2c] + local_38[0x2e]; local_38[0x2e] = 0; return 1; }
static inline __u64 rta_getattr_u64(const struct rtattr *rta) { __u64 tmp; memcpy(&tmp, ((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), sizeof(__u64)); return tmp; }
int rta_getattr_u64(unsigned long a0) { char v0; memcpy(&v0, a0 + 4, 0x8); return *(&v0); }
static void setprompt(int which) { struct stackmark smark; int show; needprompt = 0; whichprompt = which; show = 1; if (show) { pushstackmark(&smark, stacknleft); outstr((getprompt( ((void *)0) )), out2); popstackmark(&smark); } }
void setprompt(unsigned long a0) { unsigned int v0; char v1; char v2; unsigned long long *v4; unsigned long long v5; quoteflag = 0; whichprompt = a0; v0 = 1; if (v0) { pushstackmark(&v1, stacknleft, stacknleft); outstr(getprompt(0x0), out2); popstackmark(&v1); } v5 = *(&v2) ^ v4[5]; return; }
_Bool sparse_fixup_header (struct tar_stat_info *st) { struct tar_sparse_file file; if (!tar_sparse_init (&file)) return 0 ; file.stat_info = st; return tar_sparse_fixup_header (&file); }
undefined8 sparse_fixup_header(undefined8 param_1) { char cVar1; undefined8 uVar2; long in_FS_OFFSET; undefined local_48 [24]; undefined8 local_30; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); cVar1 = tar_sparse_init(local_48); if (cVar1 == '\x01') { local_30 = param_1; uVar2 = tar_sparse_fixup_header(local_48); } else { uVar2 = 0; } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar2; }
result->buf, strerror( (*__errno_location ()) )); return -1; } else if (r != stab.st_size) {
char * strerror(int __errnum) { halt_baddata(); }
static void hostkeys_find_by_key(const char *host, const char *ip, const struct sshkey *key, char **user_hostfiles, u_int num_user_hostfiles, char **system_hostfiles, u_int num_system_hostfiles, char ***names, u_int *nnames) { struct find_by_key_ctx ctx = {0, 0, 0, 0, 0}; u_int i; *names = ((void *)0) ; *nnames = 0; if (key == ((void *)0) || sshkey_is_cert(key)) return; ctx.host = host; ctx.ip = ip; ctx.key = key; for (i = 0; i < num_user_hostfiles; i++) { if (hostkeys_find_by_key_hostfile(user_hostfiles[i], "user", &ctx) != 0) goto fail; } for (i = 0; i < num_system_hostfiles; i++) { if (hostkeys_find_by_key_hostfile(system_hostfiles[i], "system", &ctx) != 0) goto fail; } *names = ctx.names; *nnames = ctx.nnames; ctx.names = ((void *)0) ; ctx.nnames = 0; return; fail: for (i = 0; i < ctx.nnames; i++) free(ctx.names[i]); free(ctx.names); }
unsigned long hostkeys_find_by_key( long a1, long a2, long a3, long a4, unsigned int a5, long a6, unsigned int a7, void **a8, unsigned int *a9) { unsigned int i; unsigned int k; unsigned int j; long v17; long v18; long v19; void *ptr; unsigned int v21; unsigned long v22; v22 = __readfsqword(0x28u); v17 = 0LL; v18 = 0LL; v19 = 0LL; ptr = 0LL; v21 = 0; *a8 = 0LL; *a9 = 0; if ( a3 && !(unsigned int)sshkey_is_cert(a3) ) { v17 = a1; v18 = a2; v19 = a3; for ( i = 0; i < a5; ++i ) { if ( (unsigned int)hostkeys_find_by_key_hostfile(*(const char **)(8LL * i + a4), "user", &v17) ) { LABEL_12: for ( j = 0; j < v21; ++j ) free(*((void **)ptr + j)); free(ptr); return __readfsqword(0x28u) ^ v22; } } for ( k = 0; k < a7; ++k ) { if ( (unsigned int)hostkeys_find_by_key_hostfile(*(const char **)(8LL * k + a6), "system", &v17) ) goto LABEL_12; } *a8 = ptr; *a9 = v21; ptr = 0LL; v21 = 0; } return __readfsqword(0x28u) ^ v22; }
static void license ( void ) { fprintf ( stderr , "bzip2, a block-sorting file compressor. " "Version %s.\n" " \n" " Copyright (C) 1996-2019 by Julian Seward.\n" " \n" " This program is free software; you can redistribute it and/or modify\n" " it under the terms set out in the LICENSE file, which is included\n" " in the bzip2 source distribution.\n" " \n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" " LICENSE file for more details.\n" " \n", BZ2_bzlibVersion() ); }
void license(void) { undefined8 uVar1; uVar1 = BZ2_bzlibVersion(); fprintf(stderr, "bzip2, a block-sorting file compressor. Version %s.\n \n Copyright (C) 1996-2019 by Julian Seward.\n \n This program is free software; you can redistribute it and/or modify\n it under the terms set out in the LICENSE file, which is included\n in the bzip2 source distribution.\n \n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n LICENSE file for more details.\n \n" ,uVar1); return; }
static int vi_yank_dispatch (_rl_vimotion_cxt *m) { if (((strchr (" l|h^0%bBFT`", m->motion) == 0) && (rl_point >= m->start)) && (rl_mark < rl_end)) do { if ( (__ctype_get_mb_cur_max ()) == 1 || rl_byte_oriented) rl_mark++; else rl_mark = _rl_find_next_mbchar (rl_line_buffer, rl_mark, 1, 0x00); } while (0); rl_begin_undo_group (); rl_kill_text (rl_point, rl_mark); rl_end_undo_group (); rl_do_undo (); rl_point = m->start; _rl_fix_point (1); return (0); }
undefined8 vi_yank_dispatch(long param_1) { char *pcVar1; size_t sVar2; pcVar1 = strchr(" l|h^0%bBFT`",*(int *)(param_1 + 0x20)); if (((pcVar1 == (char *)0x0) && (*(int *)(param_1 + 0x14) <= rl_point)) && (rl_mark < rl_end)) { sVar2 = __ctype_get_mb_cur_max(); if ((sVar2 == 1) || (rl_byte_oriented != 0)) { rl_mark = rl_mark + 1; } else { rl_mark = _rl_find_next_mbchar(rl_line_buffer,rl_mark,1,0); } } rl_begin_undo_group(); rl_kill_text(rl_point,rl_mark); rl_end_undo_group(); rl_do_undo(); rl_point = *(undefined4 *)(param_1 + 0x14); _rl_fix_point(1); return 0; }
static int get_decode_statvfs(struct sftp_conn *conn, struct sftp_statvfs *st, u_int expected_id, int quiet) { struct sshbuf *msg; u_char type; u_int id; u_int64_t flag; int r; if ((msg = sshbuf_new()) == ((void *)0) ) sshfatal("sftp-client.c", __func__, 404, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); get_msg(conn, msg); if ((r = sshbuf_get_u8(msg, &type)) != 0 || (r = sshbuf_get_u32(msg, &id)) != 0) sshfatal("sftp-client.c", __func__, 409, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); sshlog("sftp-client.c", __func__, 411, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "Received statvfs reply T:%u I:%u", type, id); if (id != expected_id) sshfatal("sftp-client.c", __func__, 413, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "ID mismatch (%u != %u)", id, expected_id); if (type == 101) { u_int status; if ((r = sshbuf_get_u32(msg, &status)) != 0) sshfatal("sftp-client.c", __func__, 418, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse status"); if (quiet) sshlog("sftp-client.c", __func__, 420, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "remote statvfs: %s", fx2txt(status)); else sshlog("sftp-client.c", __func__, 422, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "remote statvfs: %s", fx2txt(status)); sshbuf_free(msg); return -1; } else if (type != 201) { sshfatal("sftp-client.c", __func__, 426, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Expected SSH2_FXP_EXTENDED_REPLY(%u) packet, got %u", 201, type) ; } memset(st, 0, sizeof(*st)); if ((r = sshbuf_get_u64(msg, &st->f_bsize)) != 0 || (r = sshbuf_get_u64(msg, &st->f_frsize)) != 0 || (r = sshbuf_get_u64(msg, &st->f_blocks)) != 0 || (r = sshbuf_get_u64(msg, &st->f_bfree)) != 0 || (r = sshbuf_get_u64(msg, &st->f_bavail)) != 0 || (r = sshbuf_get_u64(msg, &st->f_files)) != 0 || (r = sshbuf_get_u64(msg, &st->f_ffree)) != 0 || (r = sshbuf_get_u64(msg, &st->f_favail)) != 0 || (r = sshbuf_get_u64(msg, &st->f_fsid)) != 0 || (r = sshbuf_get_u64(msg, &flag)) != 0 || (r = sshbuf_get_u64(msg, &st->f_namemax)) != 0) sshfatal("sftp-client.c", __func__, 442, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse statvfs"); st->f_flag = (flag & 0x00000001) ? ST_RDONLY : 0; st->f_flag |= (flag & 0x00000002) ? ST_NOSUID : 0; sshbuf_free(msg); return 0; }
void get_decode_statvfs(void* a0, struct_0 *a1, unsigned long a2, unsigned long a3) { char v0; char v1; unsigned int v2; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long v6; char v7; unsigned long long v9; void* v10; v4 = sshbuf_new(); if (!v4) sshfatal("sftp-client.c", "get_decode_statvfs", 0x194, 0x1, 0x1, 0x0, "sshbuf_new failed"); get_msg(a0, v4); v2 = sshbuf_get_u8(v4, &v0, &v0); if (!v2) v2 = sshbuf_get_u32(v4, &v1, &v1); if (v2 || v2) { v5 = "parse"; sshfatal("sftp-client.c", "get_decode_statvfs", 0x199, 0x1, 0x1, ssh_err(v2), *(&v7)); } v5 = *(&v1); v4 = v0; v3 = "Received statvfs reply T:%u I:%u"; sshlog("sftp-client.c", "get_decode_statvfs", 0x19b, 0x0, 0x7, 0x0, *(&v7)); if (a2 != *(&v1)) { v5 = a2; v4 = *(&v1); v3 = "ID mismatch (%u != %u)"; sshfatal("sftp-client.c", "get_decode_statvfs", 0x19d, 0x0, 0x1, 0x0, *(&v7)); } if (v0 == 101) { v2 = sshbuf_get_u32(v4, &v3, &v3); if (v2) { v5 = "parse status"; sshfatal("sftp-client.c", "get_decode_statvfs", 0x1a2, 0x1, 0x1, ssh_err(v2), *(&v7)); } if (a3) { v6 = fx2txt(v3); v5 = "remote statvfs: %s"; sshlog("sftp-client.c", "get_decode_statvfs", 0x1a4, 0x0, 0x5, 0x0, *(&v7)); } else { v6 = fx2txt(v3); v5 = "remote statvfs: %s"; sshlog("sftp-client.c", "get_decode_statvfs", 0x1a6, 0x0, 0x2, 0x0, *(&v7)); } sshbuf_free(v4); v9 = 4294967295; } else { if (v0 != 201) { v5 = v0; v4 = 201; v3 = "Expected SSH2_FXP_EXTENDED_REPLY(%u) packet, got %u"; sshfatal("sftp-client.c", "get_decode_statvfs", 0x1aa, 0x0, 0x1, 0x0, *(&v7)); } memset(a1, 0x0, 0x58); v2 = sshbuf_get_u64(v4, a1, a1); if (!v2) { v2 = sshbuf_get_u64(v4, &a1->padding_0[8], &a1->padding_0[8]); if (!v2) { v2 = sshbuf_get_u64(v4, &a1->padding_0[16], &a1->padding_0[16]); if (!v2) { v2 = sshbuf_get_u64(v4, &a1->padding_0[24], &a1->padding_0[24]); if (!v2) { v2 = sshbuf_get_u64(v4, &a1->padding_0[32], &a1->padding_0[32]); if (!v2) { v2 = sshbuf_get_u64(v4, &a1->padding_0[40], &a1->padding_0[40]); if (!v2) { v2 = sshbuf_get_u64(v4, &a1->padding_0[48], &a1->padding_0[48]); if (!v2) { v2 = sshbuf_get_u64(v4, &a1->padding_0[56], &a1->padding_0[56]); if (!v2) { v2 = sshbuf_get_u64(v4, &a1->padding_0[64], &a1->padding_0[64]); if (!v2) { v2 = sshbuf_get_u64(v4, &v3, &v3); if (!v2) v2 = sshbuf_get_u64(v4, a1 + 1, a1 + 1); } } } } } } } } } if (...) { v5 = "parse statvfs"; sshfatal("sftp-client.c", "get_decode_statvfs", 0x1ba, 0x1, 0x1, ssh_err(v2), *(&v7)); } a1->field_48 = v3 & 1; a1->field_48 = v3 & 2 | a1->field_48; sshbuf_free(v4); v10 = 0; } return; }
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" : ""); }
unsigned long emit_ancillary_info(const char *a1) { char *v1; FILE *v2; char *v3; const char *v4; char *v5; const char *v6; char *v7; const char *v9; long *i; const char *v11; const char *v12; long v13[15]; unsigned long v14; v14 = __readfsqword(0x28u); v13[0] = (long)"["; v13[1] = (long)"test invocation"; v13[2] = (long)"coreutils"; v13[3] = (long)"Multi-call invocation"; v13[4] = (long)"sha224sum"; v13[5] = (long)"sha2 utilities"; v13[6] = (long)"sha256sum"; v13[7] = (long)"sha2 utilities"; v13[8] = (long)"sha384sum"; v13[9] = (long)"sha2 utilities"; v13[10] = (long)"sha512sum"; v13[11] = (long)"sha2 utilities"; v13[12] = 0LL; v13[13] = 0LL; v9 = a1; for ( i = v13; *i && strcmp(a1, (const char *)*i); i += 2 ) ; if ( i[1] ) v9 = (const char *)i[1]; v1 = gettext("\n%s online help: <%s>\n"); printf(v1, "GNU coreutils", "https: v11 = setlocale(5, 0LL); if ( v11 && strncmp(v11, "en_", 3uLL) ) { v2 = stdout; v3 = gettext("Report any translation bugs to <https: fputs_unlocked(v3, v2); } if ( !strcmp(a1, "[") ) v4 = "test"; else v4 = a1; v12 = v4; v5 = gettext("Full documentation <%s%s>\n"); printf(v5, "https: if ( v9 == a1 ) v6 = " invocation"; else v6 = locale; v7 = gettext("or available locally via: info '(coreutils) %s%s'\n"); printf(v7, v9, v6); return __readfsqword(0x28u) ^ v14; }
static void scanargs (int argc, char *const *argv) { idx_t blocksize = 0; intmax_t count = (9223372036854775807L) ; intmax_t skip = 0; intmax_t seek = 0; _Bool count_B = 0 , skip_B = 0 , seek_B = 0 ; for (int i = optind; i < argc; i++) { char const *name = argv[i]; char const *val = strchr (name, '='); if (val == ((void *)0) ) { nl_error (0, 0, gettext ("unrecognized operand %s"), quote (name)); usage ( 1 ); } val++; if (operand_is (name, "if")) input_file = val; else if (operand_is (name, "of")) output_file = val; else if (operand_is (name, "conv")) conversions_mask |= parse_symbols (val, conversions, 0 , "invalid conversion"); else if (operand_is (name, "iflag")) input_flags |= parse_symbols (val, flags, 0 , "invalid input flag"); else if (operand_is (name, "oflag")) output_flags |= parse_symbols (val, flags, 0 , "invalid output flag"); else if (operand_is (name, "status")) status_level = parse_symbols (val, statuses, 1 , "invalid status level"); else { strtol_error invalid = LONGINT_OK; intmax_t n = parse_integer (val, &invalid); _Bool has_B = !!strchr (val, 'B'); intmax_t n_min = 0; intmax_t n_max = (9223372036854775807L) ; idx_t *converted_idx = ((void *)0) ; idx_t max_blocksize = ((((9223372036854775807L) - 1 )<((((0x7fffffffffffffffL)<( ((off_t) (! (! ((off_t) 0 < (off_t) -1)) ? (off_t) -1 : ((((off_t) 1 << ((sizeof (off_t) * 8) - 2)) - 1) * 2 + 1))) ))?(0x7fffffffffffffffL):( ((off_t) (! (! ((off_t) 0 < (off_t) -1)) ? (off_t) -1 : ((((off_t) 1 << ((sizeof (off_t) * 8) - 2)) - 1) * 2 + 1))) ))))?((9223372036854775807L) - 1 ):((((0x7fffffffffffffffL)<( ((off_t) (! (! ((off_t) 0 < (off_t) -1)) ? (off_t) -1 : ((((off_t) 1 << ((sizeof (off_t) * 8) - 2)) - 1) * 2 + 1))) ))?(0x7fffffffffffffffL):( ((off_t) (! (! ((off_t) 0 < (off_t) -1)) ? (off_t) -1 : ((((off_t) 1 << ((sizeof (off_t) * 8) - 2)) - 1) * 2 + 1))) )))) ; if (operand_is (name, "ibs")) { n_min = 1; n_max = max_blocksize; converted_idx = &input_blocksize; } else if (operand_is (name, "obs")) { n_min = 1; n_max = max_blocksize; converted_idx = &output_blocksize; } else if (operand_is (name, "bs")) { n_min = 1; n_max = max_blocksize; converted_idx = &blocksize; } else if (operand_is (name, "cbs")) { n_min = 1; n_max = ((((18446744073709551615UL))<((9223372036854775807L)))?((18446744073709551615UL)):((9223372036854775807L))) ; converted_idx = &conversion_blocksize; } else if (operand_is (name, "skip") || operand_is (name, "iseek")) { skip = n; skip_B = has_B; } else if (operand_is (name + (*name == 'o'), "seek")) { seek = n; seek_B = has_B; } else if (operand_is (name, "count")) { count = n; count_B = has_B; } else { nl_error (0, 0, gettext ("unrecognized operand %s"), quote (name)); usage ( 1 ); } if (n < n_min) invalid = LONGINT_INVALID; else if (n_max < n) invalid = LONGINT_OVERFLOW; if (invalid != LONGINT_OK) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, invalid == LONGINT_OVERFLOW ? 75 : 0, \"%s: %s\", gettext (\"invalid number\"), quote (val)), assume (false))" ")"); int _gl_dummy; })) ? ((nl_error ( 1 , invalid == LONGINT_OVERFLOW ? 75 : 0, "%s: %s", gettext ("invalid number"), quote (val)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((nl_error ( 1 , invalid == LONGINT_OVERFLOW ? 75 : 0, "%s: %s", gettext ("invalid number"), quote (val)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; else if (converted_idx) *converted_idx = n; } } if (blocksize) input_blocksize = output_blocksize = blocksize; else { conversions_mask |= C_TWOBUFS; } if (input_blocksize == 0) input_blocksize = 512; if (output_blocksize == 0) output_blocksize = 512; if (conversion_blocksize == 0) conversions_mask &= ~(C_BLOCK | C_UNBLOCK); if (input_flags & ( 010000 | 04010000 )) input_flags |= 04010000 ; if (output_flags & O_FULLBLOCK) { nl_error (0, 0, "%s: %s", gettext ("invalid output flag"), quote ("fullblock")); usage ( 1 ); } if (skip_B) input_flags |= O_SKIP_BYTES; if (input_flags & O_SKIP_BYTES && skip != 0) { skip_records = skip / input_blocksize; skip_bytes = skip % input_blocksize; } else if (skip != 0) skip_records = skip; if (count_B) input_flags |= O_COUNT_BYTES; if (input_flags & O_COUNT_BYTES && count != (9223372036854775807L) ) { max_records = count / input_blocksize; max_bytes = count % input_blocksize; } else if (count != (9223372036854775807L) ) max_records = count; if (seek_B) output_flags |= O_SEEK_BYTES; if (output_flags & O_SEEK_BYTES && seek != 0) { seek_records = seek / output_blocksize; seek_bytes = seek % output_blocksize; } else if (seek != 0) seek_records = seek; warn_partial_read = (! (conversions_mask & C_TWOBUFS) && ! (input_flags & O_FULLBLOCK) && (skip_records || (0 < max_records && max_records < (9223372036854775807L) ) || (input_flags | output_flags) & 040000 )); iread_fnc = ((input_flags & O_FULLBLOCK) ? iread_fullblock : iread); input_flags &= ~O_FULLBLOCK; if (multiple_bits_set (conversions_mask & (C_ASCII | C_EBCDIC | C_IBM))) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot combine any two of {ascii,ebcdic,ibm}\")), assume (false))" ")"); int _gl_dummy; })) ? ((nl_error ( 1 , 0, gettext ("cannot combine any two of {ascii,ebcdic,ibm}")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((nl_error ( 1 , 0, gettext ("cannot combine any two of {ascii,ebcdic,ibm}")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (multiple_bits_set (conversions_mask & (C_BLOCK | C_UNBLOCK))) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot combine block and unblock\")), assume (false))" ")"); int _gl_dummy; })) ? ((nl_error ( 1 , 0, gettext ("cannot combine block and unblock")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((nl_error ( 1 , 0, gettext ("cannot combine block and unblock")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (multiple_bits_set (conversions_mask & (C_LCASE | C_UCASE))) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot combine lcase and ucase\")), assume (false))" ")"); int _gl_dummy; })) ? ((nl_error ( 1 , 0, gettext ("cannot combine lcase and ucase")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((nl_error ( 1 , 0, gettext ("cannot combine lcase and ucase")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (multiple_bits_set (conversions_mask & (C_EXCL | C_NOCREAT))) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot combine excl and nocreat\")), assume (false))" ")"); int _gl_dummy; })) ? ((nl_error ( 1 , 0, gettext ("cannot combine excl and nocreat")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((nl_error ( 1 , 0, gettext ("cannot combine excl and nocreat")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (multiple_bits_set (input_flags & ( 040000 | O_NOCACHE)) || multiple_bits_set (output_flags & ( 040000 | O_NOCACHE))) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot combine direct and nocache\")), assume (false))" ")"); int _gl_dummy; })) ? ((nl_error ( 1 , 0, gettext ("cannot combine direct and nocache")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((nl_error ( 1 , 0, gettext ("cannot combine direct and nocache")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (input_flags & O_NOCACHE) { i_nocache = 1 ; i_nocache_eof = (max_records == 0 && max_bytes == 0); input_flags &= ~O_NOCACHE; } if (output_flags & O_NOCACHE) { o_nocache = 1 ; o_nocache_eof = (max_records == 0 && max_bytes == 0); output_flags &= ~O_NOCACHE; } }
void scanargs(unsigned long a0, unsigned long a1, unsigned long a2, unsigned int a3, unsigned int a4, unsigned int a5) { unsigned long long *v0; int tmp_9; char v1; char v2; char v3; char v4; unsigned int v5; unsigned int v6; void* v7; unsigned long long v8; void* v9; void* v10; unsigned long long v11; unsigned long long v12; unsigned long long v13; char *v14; unsigned long v15; unsigned long v16; unsigned long long v17; char v18; unsigned int v20; unsigned long long v21; unsigned int v22; unsigned long v23; unsigned long long *v24; unsigned long long v25; v0 = a1; v7 = 0; v8 = 9223372036854775807; v9 = 0; v10 = 0; v1 = 0; v2 = 0; v3 = 0; v6 = optind; while (true) { if (v6 >= a0) break; v14 = v0[v6]; v15 = strchr(v14, 0x3d); if (!v15) { nl_error(0x0, 0x0, gettext("unrecognized operand %s"), quote(v14), a4, a5); usage(0x1); } v15 += 1; if (operand_is(v14, 0x4067c5)) { input_file = v15; goto LABEL_402579; } if (operand_is(v14, 0x4067c8)) { output_file = v15; goto LABEL_402579; } if (operand_is(v14, 0x4067cb)) { conversions_mask = parse_symbols(v15, 0x4052c0, 0x0, "invalid conversion", v20, a5) | conversions_mask; goto LABEL_402579; } if (operand_is(v14, 0x4067e3)) { input_flags = parse_symbols(v15, 0x4053e0, 0x0, "invalid input flag", v20, a5) | input_flags; goto LABEL_402579; } if (operand_is(v14, 0x4067fc)) { output_flags = parse_symbols(v15, 0x4053e0, 0x0, "invalid output flag", v20, a5) | output_flags; goto LABEL_402579; } if (operand_is(v14, 0x406816)) { status_level = parse_symbols(v15, 0x405520, 0x1, "invalid status level", v20, a5); goto LABEL_402579; } v5 = 0; v16 = parse_integer(v15, &v5, &v5, a3, v20, a5); v4 = strchr(v15, 0x42); v11 = 0; v12 = 9223372036854775807; v13 = 0; v17 = 9223372036854775806; if (operand_is(v14, 0x406832)) { v11 = 1; v12 = v17; v13 = &input_blocksize; goto LABEL_4024f1; } if (operand_is(v14, 0x406836)) { v11 = 1; v12 = v17; v13 = &output_blocksize; goto LABEL_4024f1; } if (operand_is(v14, 0x40683a)) { v11 = 1; v12 = v17; v13 = &v7; goto LABEL_4024f1; } if (operand_is(v14, 0x40683d)) { v11 = 1; v12 = 9223372036854775807; v13 = &conversion_blocksize; goto LABEL_4024f1; } if (operand_is(v14, 0x406841)) { LABEL_40243c: v9 = v16; v2 = v4; goto LABEL_4024f1; } else { if (!(!operand_is(v14, 0x406846))) goto LABEL_40243c; if (operand_is(&v14[*(v14) == 111], 0x40684c)) { v10 = v16; v3 = v4; } else if (operand_is(v14, 0x406851)) { v8 = v16; v1 = v4; } else { nl_error(0x0, 0x0, gettext("unrecognized operand %s"), quote(v14), a4, a5); usage(0x1); } LABEL_4024f1: if (v16 < v11) { v5 = 4; } else if (v12 < v16) { v5 = 1; } if (v5) { v20 = quote(v15); v22 = gettext("invalid number"); if (v5 != 1) v21 = 0; else v21 = 75; nl_error(0x1, v21, "%s: %s", v22, v20, a5); } if (v13) *(v13) = v16; LABEL_402579: v6 += 1; } } if (!v7) { v22 = conversions_mask; *(&v22) = (conversions_mask >> 8) | 8; tmp_9 = v22; conversions_mask = tmp_9; } else { output_blocksize = v7; input_blocksize = output_blocksize; } if (!input_blocksize) input_blocksize = 0x200; if (!output_blocksize) output_blocksize = 0x200; if (!conversion_blocksize) conversions_mask = conversions_mask & -25; if ((input_flags & 0x101000)) input_flags = input_flags | 0x101000; if ((output_flags & 1)) { nl_error(0x0, 0x0, "%s: %s", gettext("invalid output flag"), quote("fullblock"), a5); usage(0x1); } if (v2) input_flags = input_flags | 8; if ((input_flags & 8) && v9) { skip_records = (v9 >> 63 CONCAT v9) /m input_blocksize; skip_bytes = (v9 >> 63 CONCAT v9) /m input_blocksize >> 64; goto LABEL_4026e9; } if (v9) skip_records = v9; LABEL_4026e9: if (v1) input_flags = input_flags | 4; if ((input_flags & 4) && v8 != 9223372036854775807) { max_records = (v8 >> 63 CONCAT v8) /m input_blocksize; max_bytes = (v8 >> 63 CONCAT v8) /m input_blocksize >> 64; goto LABEL_402769; } if (v8 != 9223372036854775807) max_records = v8; LABEL_402769: if (v3) output_flags = output_flags | 16; if ((output_flags & 16) && v10) { seek_records = (v10 >> 63 CONCAT v10) /m output_blocksize; seek_bytes = (v10 >> 63 CONCAT v10) /m output_blocksize >> 64; goto LABEL_4027d7; } if (v10) seek_records = v10; LABEL_4027d7: if (!(conversions_mask & 0x800) && !(input_flags & 1)) { if (skip_records) { LABEL_402838: v22 = 1; goto LABEL_402844; } else { if (max_records > 0 && !(max_records == 9223372036854775807)) goto LABEL_402838; if (!(!((output_flags | input_flags) & 0x4000))) goto LABEL_402838; } } v22 = 0; LABEL_402844: *(&v22) = v22 & 1; warn_partial_read = v22; if ((input_flags & 1)) v23 = iread_fullblock; else v23 = iread; iread_fnc = v23; input_flags = input_flags & -2; if (multiple_bits_set(conversions_mask & 7)) nl_error(0x1, 0x0, gettext("cannot combine any two of {ascii,ebcdic,ibm}"), a3, v20, a5); if (multiple_bits_set(conversions_mask & 24)) nl_error(0x1, 0x0, gettext("cannot combine block and unblock"), a3, v20, a5); if (multiple_bits_set(conversions_mask & 96)) nl_error(0x1, 0x0, gettext("cannot combine lcase and ucase"), a3, v20, a5); if (multiple_bits_set(conversions_mask & 0x3000)) nl_error(0x1, 0x0, gettext("cannot combine excl and nocreat"), a3, v20, a5); if (!multiple_bits_set(input_flags & 16386) && !multiple_bits_set(output_flags & 16386)) goto LABEL_4029ad; nl_error(0x1, 0x0, gettext("cannot combine direct and nocache"), a3, v20, a5); LABEL_4029ad: if ((input_flags & 2)) { i_nocache = 1; if (!max_records && !max_bytes) { *(&v23) = 1; goto LABEL_4029e5; } *(&v23) = 0; LABEL_4029e5: *(&v23) = v23 & 1; i_nocache_eof = v23; input_flags = input_flags & -3; } if ((output_flags & 2)) { o_nocache = 1; if (!max_records && !max_bytes) { *(&v23) = 1; goto LABEL_402a35; } *(&v23) = 0; LABEL_402a35: *(&v23) = v23 & 1; o_nocache_eof = v23; output_flags = output_flags & -3; } v25 = *(&v18) ^ v24[5]; return; }
static int process(struct nlmsghdr *n, void *arg) { struct genlmsghdr *ghdr; struct rtattr *attrs[MACSEC_ATTR_MAX + 1]; struct rtattr *attrs_secy[MACSEC_SECY_ATTR_MAX + 1]; int len = n->nlmsg_len; int ifindex; __u64 sci; __u8 encoding_sa; if (n->nlmsg_type != genl_family) return -1; len -= ((( ((sizeof(struct genlmsghdr))+4U -1) & ~(4U -1) )) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))); if (len < 0) return -1; ghdr = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); if (ghdr->cmd != MACSEC_CMD_GET_TXSC) return 0; parse_rtattr(attrs, MACSEC_ATTR_MAX, (void *) ghdr + ( ((sizeof(struct genlmsghdr))+4U -1) & ~(4U -1) ), len); if (!validate_dump(attrs)) { fprintf( stderr , "incomplete dump message\n"); return -1; } ifindex = rta_getattr_u32(attrs[MACSEC_ATTR_IFINDEX]); (parse_rtattr_flags((attrs_secy), (MACSEC_SECY_ATTR_MAX), ((void*)(((char*)(attrs[MACSEC_ATTR_SECY])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((attrs[MACSEC_ATTR_SECY])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))) ; if (!validate_secy_dump(attrs_secy)) { fprintf( stderr , "incomplete dump message\n"); return -1; } sci = rta_getattr_u64(attrs_secy[MACSEC_SECY_ATTR_SCI]); encoding_sa = rta_getattr_u8(attrs_secy[MACSEC_SECY_ATTR_ENCODING_SA]); if (filter.ifindex && ifindex != filter.ifindex) return 0; if (filter.sci && sci != filter.sci) return 0; open_json_object( ((void *)0) ); print_uint(PRINT_ANY, "ifindex", "%u: ", ifindex); print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "%s: ", ll_index_to_name(ifindex)); print_attrs(attrs_secy); print_tx_sc(" ", sci, encoding_sa, attrs[MACSEC_ATTR_TXSC_STATS], attrs[MACSEC_ATTR_SECY_STATS], attrs[MACSEC_ATTR_TXSA_LIST]); if (attrs[MACSEC_ATTR_RXSC_LIST]) print_rxsc_list(attrs[MACSEC_ATTR_RXSC_LIST]); if (attrs[MACSEC_ATTR_OFFLOAD]) { struct rtattr *attrs_offload[MACSEC_OFFLOAD_ATTR_MAX + 1]; __u8 offload; (parse_rtattr_flags((attrs_offload), (MACSEC_OFFLOAD_ATTR_MAX), ((void*)(((char*)(attrs[MACSEC_ATTR_OFFLOAD])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((attrs[MACSEC_ATTR_OFFLOAD])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))) ; offload = rta_getattr_u8(attrs_offload[MACSEC_OFFLOAD_ATTR_TYPE]); print_string(PRINT_ANY, "offload", " offload: %s ", offload_to_str(offload)); print_nl(); } close_json_object(); return 0; }
long process(long a1) { const char *v2; const char *v3; const char *v4; unsigned char v5; unsigned char v6; int v7; unsigned int v8; long v9; char v10[8]; long v11; _QWORD v12[4]; unsigned short *v13; unsigned short *v14; char *v15; unsigned short *v16; unsigned short *v17; unsigned short *v18; long v19[16]; v19[15] = __readfsqword(0x28u); if ( *(unsigned short *)(a1 + 4) != genl_family ) return 0xFFFFFFFFLL; v7 = *(_DWORD *)a1 - 20; if ( v7 < 0 ) return 0xFFFFFFFFLL; if ( *(_BYTE *)(a1 + 16) ) return 0LL; parse_rtattr(v12, 9LL, a1 + 20, (unsigned int)v7); if ( validate_dump(v12) && (v8 = rta_getattr_u32(v12[1]), parse_rtattr_flags(v19, 14LL, v13 + 2, (unsigned int)*v13 - 4, 0x8000LL), validate_secy_dump(v19)) ) { v9 = rta_getattr_u64(v19[1]); v5 = rta_getattr_u8(v19[2]); if ( !filter || v8 == filter ) { if ( !qword_40E8 || v9 == qword_40E8 ) { open_json_object(0LL); print_uint(4u, (long)"ifindex", (long)"%u: ", v8); v2 = (const char *)ll_index_to_name(v8); print_color_string(4LL, 0LL, "ifname", "%s: ", v2); print_attrs(v19); v3 = " "; print_tx_sc(" ", v9, v5, v16, v17, v14); if ( v15 ) { v3 = v15; print_rxsc_list((unsigned short *)v15); } if ( v18 ) { parse_rtattr_flags(v10, 2LL, v18 + 2, (unsigned int)*v18 - 4, 0x8000LL); v6 = rta_getattr_u8(v11); v4 = offload_to_str(v6); v3 = (_BYTE *)&loc_4; print_string(4u, (long)"offload", " offload: %s ", (long)v4); print_nl(4LL); } close_json_object(v3); return 0LL; } else { return 0LL; } } else { return 0LL; } } else { fprintf(stderr, "incomplete dump message\n"); return 0xFFFFFFFFLL; } }
static int evalfor(union node *n, int flags) { struct arglist arglist; union node *argp; struct strlist *sp; int status; errlinno = lineno = n->nfor.linno; if (funcline) lineno -= funcline - 1; arglist.lastp = &arglist.list; for (argp = n->nfor.args ; argp ; argp = argp->narg.next) { expandarg(argp, &arglist, 0x1 | 0x2); } *arglist.lastp = ((void *)0) ; status = 0; loopnest++; flags &= 02; for (sp = arglist.list ; sp ; sp = sp->next) { setvar(n->nfor.var, sp->text, 0); status = evaltree(n->nfor.body, flags); if (skiploop() & ~(1 << 1)) break; } loopnest--; return status; }
long long evalfor(struct_0 *a0, unsigned long a1) { unsigned int v0; unsigned int v1; struct_1 *v2; unsigned long long v3; char v4; unsigned long long *v5; v0 = a1; lineno = a0->field_4; errlinno = lineno; if (funcline) lineno = lineno - (funcline - 1); v5 = &v4; for (v2 = a0->field_8; v2; v2 = v2->field_8) { expandarg(v2, &v4, 0x3, &v4); } *(v5) = 0; v1 = 0; inps4 = 283935561; v0 &= 2; for (v3 = *(&v4); v3; v3 = *(v3)) { setvar(a0->field_18, *((v3 + 8)), 0x0, *((v3 + 8))); v1 = evaltree(a0->field_10, v0); if ((skiploop() & -3)) break; } inps4 = 283935559; return v1; }
int kexc25519_shared_key_ext(const u_char key[32], const u_char pub[32], struct sshbuf *out, int raw) { u_char shared_key[32]; u_char zero[32]; int r; crypto_scalarmult_curve25519(shared_key, key, pub); explicit_bzero(zero, 32); if (timingsafe_bcmp(zero, shared_key, 32) == 0) return -20; if (raw) r = sshbuf_put(out, shared_key, 32); else r = sshbuf_put_bignum2_bytes(out, shared_key, 32); explicit_bzero(shared_key, 32); return r; }
undefined4 kexc25519_shared_key_ext(undefined8 param_1,undefined8 param_2,undefined8 param_3,int param_4) { int iVar1; long in_FS_OFFSET; undefined4 local_5c; undefined local_58 [32]; undefined local_38 [40]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); crypto_scalarmult_curve25519(local_58,param_1,param_2); explicit_bzero(local_38,0x20); iVar1 = timingsafe_bcmp(local_38,local_58,0x20); if (iVar1 == 0) { local_5c = 0xffffffec; } else { if (param_4 == 0) { local_5c = sshbuf_put_bignum2_bytes(param_3,local_58,0x20); } else { local_5c = sshbuf_put(param_3,local_58,0x20); } explicit_bzero(local_58,0x20); } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return local_5c; }
static inline _Bool is_range_start_index (uintmax_t k) { return k == current_rp->lo; }
bool is_range_start_index(long a1) { return a1 == *(_QWORD *)current_rp; }
int tarfileread(struct tar_archive *tar, char *buf, int len) { struct tarcontext *tc = (struct tarcontext *)tar->ctx; int r; r = fd_read(tc->backendpipe, buf, len); if (r < 0) ohshite(gettext("error reading from dpkg-deb pipe")); return r; }
long long tarfileread(struct_0 *a0, unsigned long long a1, unsigned long a2) { unsigned int v0; unsigned int *v1; v1 = a0->field_20; v0 = fd_read(*(v1), a1, a2, a1); if (v0 < 0) ohshite(gettext("error reading from dpkg-deb pipe")); return v0; }
int rl_execute_next (int c) { rl_pending_input = c; (rl_readline_state |= (0x0020000)); return 0; }
long long rl_execute_next(unsigned long a0) { rl_pending_input = a0; rl_readline_state = rl_readline_state | 0x20000; return 0; }
void _rl_internal_char_cleanup (void) { if (_rl_keep_mark_active) _rl_keep_mark_active = 0; else if (rl_mark_active_p ()) rl_deactivate_mark (); if (rl_editing_mode == 0 && _rl_keymap == vi_movement_keymap) rl_vi_check (); if (rl_num_chars_to_read && rl_end >= rl_num_chars_to_read) { (*rl_redisplay_function) (); _rl_want_redisplay = 0; rl_newline (1, '\n'); } if (rl_done == 0) { (*rl_redisplay_function) (); _rl_want_redisplay = 0; } if (rl_erase_empty_line && rl_done && rl_last_func == rl_newline && rl_point == 0 && rl_end == 0) _rl_erase_entire_line (); }
long long _rl_internal_char_cleanup(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned long long v2; if (_rl_keep_mark_active) { _rl_keep_mark_active = 0; } else if (rl_mark_active_p()) { rl_deactivate_mark(a0, a1, a2, a3, a4, a5); } if (!rl_editing_mode && _rl_keymap == 5243192) rl_vi_check(); if (rl_num_chars_to_read && 3850979413 >= rl_num_chars_to_read) { *(5243008)(); _rl_want_redisplay = 0; rl_newline(1, 10); } if (false) { *(5243008)(); _rl_want_redisplay = 0; } v2 = rl_erase_empty_line; if (rl_erase_empty_line) { v2 = 1219493948222425173; v2 = rl_last_func; if (rl_last_func == got.rl_newline) { v2 = 1219493948222425173; if (false) { v2 = 1219493948222425173; if (false) v2 = _rl_erase_entire_line(); } } } return v2; }
int history_expand(char *str, char **output) { int ret = 0; size_t idx, i, size; char *tmp, *result; if (h == ((void *)0) || e == ((void *)0) ) rl_initialize(); if (history_expansion_char == 0) { *output = strdup(str); return 0; } *output = ((void *)0) ; if (str[0] == history_subst_char) { *output = calloc(strlen(str) + 4 + 1, sizeof(**output)); if (*output == ((void *)0) ) return 0; (*output)[0] = (*output)[1] = history_expansion_char; (*output)[2] = ':'; (*output)[3] = 's'; (void)strcpy((*output) + 4, str); str = *output; } else { *output = strdup(str); if (*output == ((void *)0) ) return 0; } result = ((void *)0) ; size = idx = 0; tmp = ((void *)0) ; for (i = 0; str[i];) { int qchar, loop_again; size_t len, start, j; qchar = 0; loop_again = 1; start = j = i; loop: for (; str[j]; j++) { if (str[j] == '\\' && str[j + 1] == history_expansion_char) { len = strlen(&str[j + 1]) + 1; memmove(&str[j], &str[j + 1], len); continue; } if (!loop_again) { if ( ((*__ctype_b_loc ())[(int) (( (unsigned char) str[j] ))] & (unsigned short int) _ISspace) || str[j] == qchar) break; } if (str[j] == history_expansion_char && !strchr(history_no_expand_chars, str[j + 1]) && (!history_inhibit_expansion_function || (*history_inhibit_expansion_function)(str, (int)j) == 0)) break; } if (str[j] && loop_again) { i = j; qchar = (j > 0 && str[j - 1] == '"' )? '"':0; j++; if (str[j] == history_expansion_char) j++; loop_again = 0; goto loop; } len = i - start; { if (idx + len + 1 > size) { char *nresult = realloc(result, (size += len + 1) * sizeof(*nresult)); if (nresult == ((void *)0) ) { free(*output); free( ((void *)0) ); return 0; } result = nresult; } (void)strlcpy(&result[idx], &str[start], len + 1); idx += len; }; if (str[i] == '\0' || str[i] != history_expansion_char) { len = j - i; { if (idx + len + 1 > size) { char *nresult = realloc(result, (size += len + 1) * sizeof(*nresult)); if (nresult == ((void *)0) ) { free(*output); free( ((void *)0) ); return 0; } result = nresult; } (void)strlcpy(&result[idx], &str[i], len + 1); idx += len; }; if (start == 0) ret = 0; else ret = 1; break; } ret = _history_expand_command (str, i, (j - i), &tmp); if (ret > 0 && tmp) { len = strlen(tmp); { if (idx + len + 1 > size) { char *nresult = realloc(result, (size += len + 1) * sizeof(*nresult)); if (nresult == ((void *)0) ) { free(*output); free(tmp); return 0; } result = nresult; } (void)strlcpy(&result[idx], tmp, len + 1); idx += len; }; } if (tmp) { free(tmp); tmp = ((void *)0) ; } i = j; } if (ret == 2) { add_history(result); } free(*output); *output = result; return ret; }
long history_expand(char *a1, char **a2) { size_t v3; char *v4; int v5; char *s; int v7; int v8; int v9; char *v10; long v11; long v12; size_t size; void *ptr; long v15; long v16; size_t n; void *v18; void *v19; void *v20; unsigned long v21; s = a1; v21 = __readfsqword(0x28u); v7 = 0; if ( !h || !e ) rl_initialize(); if ( !history_expansion_char ) { *a2 = strdup(a1); return 0LL; } *a2 = 0LL; if ( *a1 == history_subst_char ) { v3 = strlen(a1); *a2 = (char *)calloc(v3 + 5, 1uLL); if ( !*a2 ) return 0LL; v4 = *a2 + 1; *v4 = history_expansion_char; **a2 = *v4; (*a2)[2] = 58; (*a2)[3] = 115; strcpy(*a2 + 4, a1); s = *a2; } else { *a2 = strdup(a1); if ( !*a2 ) return 0LL; } ptr = 0LL; v11 = 0LL; size = 0LL; v10 = 0LL; v12 = 0LL; while ( 2 ) { if ( !s[v12] ) goto LABEL_56; v8 = 0; v9 = 1; v15 = v12; v16 = v12; while ( 1 ) { while ( s[v15] ) { if ( s[v15] == 92 && s[v15 + 1] == history_expansion_char ) { n = strlen(&s[v15 + 1]) + 1; memmove(&s[v15], &s[v15 + 1], n); goto LABEL_24; } if ( !v9 && (((*_ctype_b_loc())[(unsigned char)s[v15]] & 0x2000) != 0 || v8 == s[v15]) || s[v15] == history_expansion_char && !strchr(history_no_expand_chars[0], s[v15 + 1]) && (!history_inhibit_expansion_function || !(unsigned int)history_inhibit_expansion_function(s, (unsigned int)v15)) ) { break; } LABEL_24: ++v15; } if ( !s[v15] || !v9 ) break; v12 = v15; if ( v15 && s[v15 - 1] == 34 ) v5 = 34; else v5 = 0; v8 = v5; if ( s[++v15] == history_expansion_char ) ++v15; v9 = 0; } n = v12 - v16; if ( size < v11 + v12 - v16 + 1 ) { size += n + 1; v18 = realloc(ptr, size); if ( !v18 ) goto LABEL_37; ptr = v18; } strlcpy((char *)ptr + v11, &s[v16], n + 1); v11 += n; if ( s[v12] && s[v12] == history_expansion_char ) { v7 = history_expand_command((long)s, v12, v15 - v12, &v10); if ( v7 <= 0 || !v10 ) goto LABEL_52; n = strlen(v10); if ( size >= v11 + n + 1 ) goto LABEL_51; size += n + 1; v19 = realloc(ptr, size); if ( v19 ) { ptr = v19; LABEL_51: strlcpy((char *)ptr + v11, v10, n + 1); v11 += n; LABEL_52: if ( v10 ) { free(v10); v10 = 0LL; } v12 = v15; continue; } free(*a2); free(v10); return 0LL; } else { n = v15 - v12; if ( size >= v11 + v15 - v12 + 1 ) goto LABEL_44; size += n + 1; v20 = realloc(ptr, size); if ( v20 ) { ptr = v20; LABEL_44: strlcpy((char *)ptr + v11, &s[v12], n + 1); v11 += n; v7 = v16 != 0; LABEL_56: if ( v7 == 2 ) add_history((long)ptr); free(*a2); *a2 = (char *)ptr; return (unsigned int)v7; } else { LABEL_37: free(*a2); free(0LL); return 0LL; } } } }
static void print_nh_res_bucket(FILE *fp, const struct rtattr *res_bucket_attr) { struct rtattr *tb[(__NHA_RES_BUCKET_MAX - 1) + 1]; (parse_rtattr_flags((tb), ((__NHA_RES_BUCKET_MAX - 1)), ((void*)(((char*)(res_bucket_attr)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((res_bucket_attr)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))); open_json_object("bucket"); if (tb[NHA_RES_BUCKET_INDEX]) print_uint(PRINT_ANY, "index", "index %u ", rta_getattr_u16(tb[NHA_RES_BUCKET_INDEX])); if (tb[NHA_RES_BUCKET_IDLE_TIME]) { struct rtattr *rta = tb[NHA_RES_BUCKET_IDLE_TIME]; struct timeval tv; __jiffies_to_tv(&tv, rta_getattr_u64(rta)); print_tv(PRINT_ANY, "idle_time", "idle_time %g ", &tv); } if (tb[NHA_RES_BUCKET_NH_ID]) print_uint(PRINT_ANY, "nhid", "nhid %u ", rta_getattr_u32(tb[NHA_RES_BUCKET_NH_ID])); close_json_object(); }
unsigned long print_nh_res_bucket(long a1, unsigned short *a2) { long v2; unsigned short *v3; const char *v4; const char *v5; unsigned short v6; long v7; unsigned int v8; unsigned long v10[2]; char v11[8]; long v12; long v13; long v14; unsigned long v15; v15 = __readfsqword(0x28u); v2 = (unsigned int)*a2 - 4; v3 = a2 + 2; v4 = (_BYTE *)(&loc_1 + 2); parse_rtattr_flags(v11, 3LL, v3, v2, 0x8000LL); v5 = "bucket"; open_json_object("bucket"); if ( v12 ) { v6 = rta_getattr_u16(v12); v4 = "index"; v5 = (_BYTE *)&loc_4; print_uint(4u, (long)"index", (long)"index %u ", v6); } if ( v13 ) { v7 = rta_getattr_u64(v13); _jiffies_to_tv(v10, v7); v4 = "idle_time"; v5 = (_BYTE *)&loc_4; print_tv(4u, (long)"idle_time", (long)"idle_time %g ", (long)v10); } if ( v14 ) { v8 = rta_getattr_u32(v14); v4 = "nhid"; v5 = (_BYTE *)&loc_4; print_uint(4u, (long)"nhid", (long)"nhid %u ", v8); } close_json_object(v5, v4); return __readfsqword(0x28u) ^ v15; }
static const char * diversion_current(const char *filename) { static struct varbuf str = { 0, 0, ((void *)0) }; if (opt_pkgname_match_any) { varbuf_reset(&str); if (opt_divertto == ((void *)0) ) varbuf_printf(&str, gettext("any diversion of %s"), filename); else varbuf_printf(&str, gettext("any diversion of %s to %s"), filename, opt_divertto); } else { return varbuf_diversion(&str, opt_pkgname, filename, opt_divertto); } return str.buf; }
int diversion_current(unsigned long long a0) { unsigned long long v1; if (!opt_pkgname_match_any) { v1 = varbuf_diversion(&str.4978, opt_pkgname, a0, *(&opt_divertto)); return v1; } varbuf_reset(&str.4978); if (*(&opt_divertto)) { varbuf_printf(&str.4978, gettext("any diversion of %s to %s"), a0, *(&opt_divertto)); } else { v1 = gettext("any diversion of %s"); varbuf_printf(&str.4978, v1, a0, v1); } *(&v1) = g_401df0; return v1; }
int sshbuf_check_reserve(const struct sshbuf *buf, size_t len) { int r; if ((r = sshbuf_check_sanity(buf)) != 0) return r; if (buf->readonly || buf->refcount > 1) return -49; ; if (len > buf->max_size || buf->max_size - len < buf->size - buf->off) return -9; return 0; }
long sshbuf_check_reserve(long a1, unsigned long a2) { unsigned int v3; v3 = sshbuf_check_sanity(a1); if ( v3 ) return v3; if ( *(_DWORD *)(a1 + 48) || *(_DWORD *)(a1 + 56) > 1u ) return 4294967247LL; if ( a2 <= *(_QWORD *)(a1 + 32) && *(_QWORD *)(a1 + 32) - a2 >= *(_QWORD *)(a1 + 24) - *(_QWORD *)(a1 + 16) ) return 0LL; return 4294967287LL; }
static void copy_stat(ifstat) struct stat *ifstat; { mode_t mode = ifstat->st_mode & ((0400|0200|0100) | ((0400|0200|0100) >> 3) | (((0400|0200|0100) >> 3) >> 3)) ; int r; _Bool restoring; struct timespec timespec[2]; timespec[0] = get_stat_atime (ifstat); timespec[1] = get_stat_mtime (ifstat); restoring = (decompress && 0 <= time_stamp.tv_nsec && ! (timespec[1].tv_sec == time_stamp.tv_sec && timespec[1].tv_nsec == time_stamp.tv_nsec)); if (restoring) timespec[1] = time_stamp; if (fdutimens (ofd, ofname, timespec) == 0) { if (restoring && 1 < verbose) { fprintf( stderr , "%s: timestamp restored\n", ofname); } } else { int e = (*__errno_location ()) ; {if (!quiet) fprintf ( stderr , "%s: ", program_name) ; if (exit_code == 0) exit_code = 2;}; if (!quiet) { (*__errno_location ()) = e; perror (ofname); } } do_chown (ofd, ofname, -1, ifstat->st_gid); r = fchmod (ofd, mode); if (r != 0) { int e = (*__errno_location ()) ; {if (!quiet) fprintf ( stderr , "%s: ", program_name) ; if (exit_code == 0) exit_code = 2;}; if (!quiet) { (*__errno_location ()) = e; perror(ofname); } } do_chown (ofd, ofname, ifstat->st_uid, -1); }
void copy_stat(long param_1) { uint uVar1; bool bVar2; int iVar3; int *piVar4; long in_FS_OFFSET; undefined local_38 [16]; undefined local_28 [24]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); uVar1 = *(uint *)(param_1 + 0x18); local_38 = get_stat_atime(param_1); local_28._0_16_ = get_stat_mtime(); if (((decompress == 0) || (time_stamp._8_8_ < 0)) || (local_28._0_16_ == CONCAT88(time_stamp._8_8_,time_stamp._0_8_))) { bVar2 = false; } else { bVar2 = true; } if (bVar2) { local_28._0_16_ = CONCAT88(time_stamp._8_8_,time_stamp._0_8_); } iVar3 = fdutimens(ofd,ofname,local_38); if (iVar3 == 0) { if ((bVar2) && (1 < verbose)) { fprintf(stderr,"%s: timestamp restored\n",ofname); } } else { piVar4 = __errno_location(); iVar3 = *piVar4; if (quiet == 0) { fprintf(stderr,"%s: ",program_name); } if (exit_code == 0) { exit_code = 2; } if (quiet == 0) { piVar4 = __errno_location(); *piVar4 = iVar3; perror(ofname); } } do_chown(ofd,ofname,0xffffffff,*(undefined4 *)(param_1 + 0x20)); iVar3 = fchmod(ofd,uVar1 & 0x1ff); if (iVar3 != 0) { piVar4 = __errno_location(); iVar3 = *piVar4; if (quiet == 0) { fprintf(stderr,"%s: ",program_name); } if (exit_code == 0) { exit_code = 2; } if (quiet == 0) { piVar4 = __errno_location(); *piVar4 = iVar3; perror(ofname); } } do_chown(ofd,ofname,*(undefined4 *)(param_1 + 0x1c),0xffffffff); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
&& ! chown_failure_ok (x)) { error (0, (*__errno_location ()) , gettext ("failed to preserve ownership for %s"), dst_name); if (x->require_preserve) goto un_backup; }
int chown_failure_ok(struct_0 *a0) { unsigned int v3; unsigned int v4; if (*(__errno_location()) != 1 && !(*(__errno_location()) == 22)) goto LABEL_407076; if ((a0->field_1a ^ 1)) { v3 = 1; goto LABEL_40707b; } LABEL_407076: v3 = 0; LABEL_40707b: v4 = v3 & 1; return v4; }
void ifsfree(void) { struct ifsregion *p = ifsfirst.next; if (!p) goto out; ({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; }); do { struct ifsregion *ifsp; ifsp = p->next; free((pointer)(p)); p = ifsp; } while (p); ifsfirst.next = ((void *)0) ; ({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; }); out: ifslastp = ((void *)0) ; }
void ifsfree(void) { long *plVar1; long *local_18; local_18 = ifsfirst._0_8_; if (ifsfirst._0_8_ != (long *)0x0) { suppressint = suppressint + 1; do { plVar1 = (long *)*local_18; free(local_18); local_18 = plVar1; } while (plVar1 != (long *)0x0); ifsfirst._0_8_ = (long *)0x0; suppressint = suppressint + -1; if ((suppressint == 0) && (intpending != 0)) { onint(); } } ifslastp = 0; return; }
static int show_config(struct kmod_ctx *ctx) { struct config_iterators { const char *name; struct kmod_config_iter *(*get_iter)(const struct kmod_ctx *ctx); } ci[] = { { "blacklist", kmod_config_get_blacklists }, { "install", kmod_config_get_install_commands }, { "remove", kmod_config_get_remove_commands }, { "alias", kmod_config_get_aliases }, { "options", kmod_config_get_options }, { "softdep", kmod_config_get_softdeps }, }; size_t i; for (i = 0; i < (sizeof(ci) / sizeof((ci)[0]) + ({ _Static_assert((!__builtin_types_compatible_p(typeof(ci), typeof(&(ci)[0]))), "!__builtin_types_compatible_p(typeof(ci), typeof(&(ci)[0]))"); 0; })); i++) { struct kmod_config_iter *iter = ci[i].get_iter(ctx); if (iter == ((void *)0) ) continue; while (kmod_config_iter_next(iter)) { const char *val; printf("%s %s", ci[i].name, kmod_config_iter_get_key(iter)); val = kmod_config_iter_get_value(iter); if (val != ((void *)0) ) { putchar(' '); puts(val); } else putchar('\n'); } kmod_config_iter_free_iter(iter); } puts("\n# End of configuration files. Dumping indexes now:\n"); fflush( stdout ); kmod_dump_index(ctx, KMOD_INDEX_MODULES_ALIAS, 1 ); kmod_dump_index(ctx, KMOD_INDEX_MODULES_SYMBOL, 1 ); return 0; }
int show_config(unsigned long long a0) { void* v0; unsigned long long v1; char *v2; unsigned long long v3; unsigned long v4; unsigned long long v5; unsigned long v6; unsigned long long v7; unsigned long v8; unsigned long long v9; unsigned long v10; unsigned long long v11; unsigned long v12; unsigned long long v13; unsigned long v14; v3 = "blacklist"; v4 = got.kmod_config_get_blacklists; v5 = "install"; v6 = got.kmod_config_get_install_commands; v7 = "remove"; v8 = got.kmod_config_get_remove_commands; v9 = "alias"; v10 = got.kmod_config_get_aliases; v11 = "options"; v12 = got.kmod_config_get_options; v13 = "softdep"; v14 = got.kmod_config_get_softdeps; for (v0 = 0; v0 <= 5; v0 += 1) { v1 = *((-112 + 16 * (stack_base)[144] + stack_base))(a0); if (v1) { while (kmod_config_iter_next(v1)) { printf("%s %s", *((&v3 + 0x10 * v0)), kmod_config_iter_get_key(v1)); v2 = kmod_config_iter_get_value(v1); if (!v2) { putchar(0xa); } else { putchar(0x20); puts(v2); } } kmod_config_iter_free_iter(v1); } } puts("\n# End of configuration files. Dumping indexes now:\n"); fflush(stdout); kmod_dump_index(a0, 0x1, 0x1); kmod_dump_index(a0, 0x2, 0x1); return 0; }
static void find_identical_ends (struct file_data filevec[]) { size_t *w0, *w1; char *p0, *p1, *buffer0, *buffer1; char const *end0, *beg0; char const **linbuf0, **linbuf1; lin i, lines; size_t n0, n1; lin alloc_lines0, alloc_lines1; _Bool prefix_needed; lin buffered_prefix, prefix_count, prefix_mask; lin middle_guess, suffix_guess; slurp (&filevec[0]); prepare_text (&filevec[0]); if (filevec[0].desc != filevec[1].desc) { slurp (&filevec[1]); prepare_text (&filevec[1]); } else { filevec[1].buffer = filevec[0].buffer; filevec[1].bufsize = filevec[0].bufsize; filevec[1].buffered = filevec[0].buffered; filevec[1].missing_newline = filevec[0].missing_newline; } w0 = filevec[0].buffer; w1 = filevec[1].buffer; p0 = buffer0 = (char *) w0; p1 = buffer1 = (char *) w1; n0 = filevec[0].buffered; n1 = filevec[1].buffered; if (p0 == p1) p0 = p1 += n1; else { if (n0 < n1) p0[n0] = ~p1[n0]; else p1[n1] = ~p0[n1]; while (*w0 == *w1) w0++, w1++; p0 = (char *) w0; p1 = (char *) w1; while (*p0 == *p1) p0++, p1++; if (((output_style) != OUTPUT_ED && (output_style) != OUTPUT_FORWARD_ED) && ((buffer0 + n0 - filevec[0].missing_newline < p0) != (buffer1 + n1 - filevec[1].missing_newline < p1))) p0--, p1--; } i = horizon_lines; while (p0 != buffer0 && (p0[-1] != '\n' || i--)) p0--, p1--; filevec[0].prefix_end = p0; filevec[1].prefix_end = p1; p0 = buffer0 + n0; p1 = buffer1 + n1; if (! ((output_style) != OUTPUT_ED && (output_style) != OUTPUT_FORWARD_ED) || filevec[0].missing_newline == filevec[1].missing_newline) { end0 = p0; beg0 = filevec[0].prefix_end + (n0 < n1 ? 0 : n0 - n1); while (p0 != beg0) if (*--p0 != *--p1) { ++p0, ++p1; beg0 = p0; break; } i = horizon_lines + !((buffer0 == p0 || p0[-1] == '\n') && (buffer1 == p1 || p1[-1] == '\n')); while (i-- && p0 != end0) while (*p0++ != '\n') continue; p1 += p0 - beg0; } filevec[0].suffix_begin = p0; filevec[1].suffix_begin = p1; if (no_diff_means_no_output && ! function_regexp.fastmap && context < (9223372036854775807L) / 4 && context < n0) { middle_guess = guess_lines (0, 0, p0 - filevec[0].prefix_end); suffix_guess = guess_lines (0, 0, buffer0 + n0 - p0); for (prefix_count = 1; prefix_count <= context; prefix_count *= 2) continue; alloc_lines0 = (prefix_count + middle_guess + ((context) <= (suffix_guess) ? (context) : (suffix_guess))); } else { prefix_count = 0; alloc_lines0 = guess_lines (0, 0, n0); } prefix_mask = prefix_count - 1; lines = 0; linbuf0 = xmalloc (alloc_lines0 * sizeof *linbuf0); prefix_needed = ! (no_diff_means_no_output && filevec[0].prefix_end == p0 && filevec[1].prefix_end == p1); p0 = buffer0; if (prefix_needed) { end0 = filevec[0].prefix_end; while (p0 != end0) { lin l = lines++ & prefix_mask; if (l == alloc_lines0) { if ( (9223372036854775807L) / (2 * sizeof *linbuf0) <= alloc_lines0) xalloc_die (); alloc_lines0 *= 2; linbuf0 = xrealloc (linbuf0, alloc_lines0 * sizeof *linbuf0); } linbuf0[l] = p0; while (*p0++ != '\n') continue; } } buffered_prefix = prefix_count && context < lines ? context : lines; middle_guess = guess_lines (lines, p0 - buffer0, p1 - filevec[1].prefix_end); suffix_guess = guess_lines (lines, p0 - buffer0, buffer1 + n1 - p1); alloc_lines1 = buffered_prefix + middle_guess + ((context) <= (suffix_guess) ? (context) : (suffix_guess)); if (alloc_lines1 < buffered_prefix || (9223372036854775807L) / sizeof *linbuf1 <= alloc_lines1) xalloc_die (); linbuf1 = xmalloc (alloc_lines1 * sizeof *linbuf1); if (buffered_prefix != lines) { for (i = 0; i < buffered_prefix; i++) linbuf1[i] = linbuf0[(lines - context + i) & prefix_mask]; for (i = 0; i < buffered_prefix; i++) linbuf0[i] = linbuf1[i]; } for (i = 0; i < buffered_prefix; i++) linbuf1[i] = linbuf0[i] - buffer0 + buffer1; filevec[0].linbuf = linbuf0 + buffered_prefix; filevec[1].linbuf = linbuf1 + buffered_prefix; filevec[0].linbuf_base = filevec[1].linbuf_base = - buffered_prefix; filevec[0].alloc_lines = alloc_lines0 - buffered_prefix; filevec[1].alloc_lines = alloc_lines1 - buffered_prefix; filevec[0].prefix_lines = filevec[1].prefix_lines = lines; }
void find_identical_ends(struct_0 *a0) { int tmp_9; char v0; int tmp_15; unsigned long long *v1; void* v2; void* v3; void* v4; char *v5; void* v6; void* v7; void* v8; char v9; unsigned long long v10; void* v11; void* v12; void* v13; void* v14; unsigned long v15; unsigned long v16; unsigned long long v17; unsigned long v18; void* v19; void* v20; unsigned long long v21; void* v22; unsigned int v24; unsigned long long v26; unsigned long long v27; unsigned long long v28; char v29; void* v30; void* v31; void* v32; unsigned long long v33; struct_0 *v34; slurp(a0); prepare_text(a0); if (a0->field_0 == a0->field_130) { a0->field_1d0 = a0->field_a0; a0->field_1d8 = a0->field_a8; a0->field_1e0 = a0->field_b0; a0->field_250 = a0->field_120; } else { slurp(&a0->field_130); prepare_text(&a0->field_130); } v1 = a0->field_a0; v2 = a0->field_1d0; v11 = v1; v3 = v11; v12 = v2; v4 = v12; v13 = a0->field_b0; v14 = a0->field_1e0; if (v3 == v4) { v4 += v14; v3 = v4; } else { if (v13 >= v14) { v24 = v4; *((v14 + v4)) = !(*((v14 + v3))); } else { v24 = v3; *((v13 + v3)) = !(*((v13 + v4))); } for (; *(v1) == *(v2); v2 += 8) { v1 += 1; } v3 = v1; for (v4 = v2; *(v3) == *(v4); v4 += 1) { v3 += 1; } switch (output_style) { case 4: case 5: break; default: *(&v24) = !(v3 <= v11 + v13 - a0->field_120); v29 = v12 + v14 - a0->field_250; *(&v29) = !(v4 <= v12 + v14 - a0->field_250); *(&v29) = v29 ^ v24; if (v29) { v3 -= 1; v4 -= 1; break; } } } for (v7 = horizon_lines; v3 != v11 && (v3[1] != 10 || (v29 = v7, v7 -= 1, v29)); v4 -= 1) { v3 -= 1; } a0->field_e0 = v3; a0->field_210 = v4; v3 = v13 + v11; v4 = v14 + v12; switch (output_style) { case 4: case 5: LABEL_40150b: v15 = v3; v26 = (v13 < v14 ? v13 - v14 : 0) + a0->field_e0; v5 = v26; do { if (v3 == v5) goto LABEL_4015a1; } while ((v3 -= 1, v4 = (v4 - 1), *(v3) == *(v4))); v3 += 1; v4 = &v4[1]; v5 = v3; LABEL_4015a1: if (v11 != v3 && v3[1] != 10 || v12 != v4 && v4[1] != 10) { v27 = 1; break; } else { v27 = 0; break; } v28 = horizon_lines + v27; v7 = v28; while (true) { v29 = v7; v7 -= 1; if (!(v29) || !(v3 != v15)) break; do { tmp_9 = v3; v3 = &v3[1]; *(&v29) = *(tmp_9); } while (v29 != 10); } v4 = v4 + v3 + -0x1 * v5; goto LABEL_40164b; default: if (a0->field_120 == a0->field_250) goto LABEL_40150b; else goto LABEL_40164b; } LABEL_40164b: a0->field_f0 = v3; a0->field_220 = v4; if (!no_diff_means_no_output || *(5243096) || context > 2305843009213693950 || v13 <= context) { v10 = 0; *(&v9) = guess_lines(0x0, 0x0); } else { v16 = guess_lines(0x0, 0x0); v17 = guess_lines(0x0, 0x0); for (v10 = 1; v10 <= context; v10 *= 2); v30 = context; if (v17 <= context) v30 = v17; v29 = v30 + v10 + v16; v9 = v29; } v18 = v10 - 1; v8 = 0; v6 = xmalloc(*(&v9) * 8); if ((no_diff_means_no_output ^ 1) || v3 != a0->field_e0 || v4 != a0->field_210) v29 = 1; else v29 = 0; v0 = v29; v0 &= 1; v3 = v11; if (v0) { v15 = a0->field_e0; while (v3 != v15) { tmp_15 = v8; v8 += 1; v19 = tmp_15 & v18; if (v19 == *(&v9)) { if (*(&v9) > 576460752303423486) xalloc_die(); *(&v9) = *(&v9) * 2; v6 = xrealloc(v6, *(&v9) * 8, *(&v9) * 8); } *((0x8 * v19 + v6)) = v3; do { tmp_9 = v3; v3 = &v3[1]; v29 = *(tmp_9); } while (v29 != 10); } } if (!v10 || v8 <= context) v31 = v8; else v31 = context; v20 = v31; v16 = guess_lines(v8, v3 - v11); v17 = guess_lines(v8, v3 - v11); v32 = context; if (v17 <= context) v32 = v17; v33 = v32 + v20 + v16; v21 = v33; if (v21 >= v20 && v21 <= 1152921504606846974) { v22 = xmalloc(v21 * 8); if (v20 != v8) { for (v7 = 0; v7 < v20; v7 += 1) { *((v22 + 0x8 * v7)) = *((v6 + 8 * (v7 + v8 - context & v18))); } for (v7 = 0; v7 < v20; v7 += 1) { *((v6 + 0x8 * v7)) = *((v22 + 0x8 * v7)); } } for (v7 = 0; v7 < v20; v7 += 1) { *((v22 + 0x8 * v7)) = v12 + *((v6 + 0x8 * v7)) - v11; } a0->field_b8 = v20 * 8 + v6; a0->field_1e8 = v22 + v20 * 8; a0->field_1f0 = -(v20); a0->field_c0 = a0->field_1f0; a0->field_d8 = *(&v9) - v20; a0->field_208 = v21 - v20; a0->field_218 = v8; v34 = a0; a0->field_e8 = a0->field_218; return; } xalloc_die(); }
struct timeval * difftimeval (d, t1, t2) struct timeval *d, *t1, *t2; { d->tv_sec = t2->tv_sec - t1->tv_sec; d->tv_usec = t2->tv_usec - t1->tv_usec; if (d->tv_usec < 0) { d->tv_usec += 1000000; d->tv_sec -= 1; if (d->tv_sec < 0) { d->tv_sec = 0; d->tv_usec = 0; } } return d; }
long long difftimeval(unsigned long long a0[2], unsigned long long a1[2], unsigned long long a2[2]) { a0[0] = a2[0] - a1[0]; a0[1] = a2[1] - a1[1]; if (a0[1] < 0) { a0[1] = a0[1] + 1000000; a0[0] = a0[0] - 1; if (a0[0] < 0) { a0[0] = 0; a0[1] = 0; } } return a0; }
void ensure_package_clientdata(struct pkginfo *pkg) { if (pkg->clientdata) return; pkg->clientdata = nfmalloc(sizeof(*pkg->clientdata)); pkg->clientdata->istobe = PKG_ISTOBE_NORMAL; pkg->clientdata->color = PKG_CYCLE_WHITE; pkg->clientdata->enqueued = 0 ; pkg->clientdata->replacingfilesandsaid = 0; pkg->clientdata->cmdline_seen = 0; pkg->clientdata->trigprocdeferred = ((void *)0) ; }
long long ensure_package_clientdata(struct_1 *a0) { struct_0 *v1; v1 = a0->field_138; if (!a0->field_138) { a0->field_138 = nfmalloc(0x20); a0->field_138->field_0 = 0; a0->field_138->field_4 = 0; a0->field_138->field_8 = 0; a0->field_138->field_c = 0; a0->field_138->field_10 = 0; v1 = a0->field_138; a0->field_138->field_18 = 0; } return v1; }
static inline struct ext2_inode *EXT2_INODE(struct ext2_inode_large *large_inode) { return (struct ext2_inode *) large_inode; }
long EXT2_INODE(long a1) { return a1; }
static _Bool insert_fls (const struct parser_table* entry, const char *filename) { struct predicate *our_pred = insert_primary_noarg (entry); if (filename) open_output_file (filename, &our_pred->args.printf_vec); else open_stdout (&our_pred->args.printf_vec); our_pred->side_effects = our_pred->no_default_print = 1 ; our_pred->est_success_rate = 1.0f; return 1 ; }
int insert_fls(unsigned long long a0, unsigned long long a1) { struct_0 *v0; v0 = insert_primary_noarg(a0); if (a1) open_output_file(a1, &v0[1].padding_0[16]); else open_stdout(&v0[1].padding_0[16]); v0->field_19 = 1; v0->field_18 = v0->field_19; v0->field_24 = 0x3e99999a3f800000; return 1; }
static int history_def_curr(void *p, HistEvent *ev) { history_t *h = (history_t *) p; if (h->cursor != &h->list) *ev = h->cursor->ev; else { { ev->num = (h->cur > 0) ? 8 : 5; ev->str = he_errlist[(h->cur > 0) ? 8 : 5]; } ; return -1; } return 0; }
long long history_def_curr(struct_1 *a0, struct_0 *a1) { unsigned long long v1; unsigned long long v2; unsigned int v3; unsigned long long v4; if (a0->field_28 != a0) { v1 = a0->field_28->field_8; *(&a1->field_0) = a0->field_28->field_0; a1->field_8 = v1; v2 = 0; } else { if (a0->field_34 <= 0) v3 = 5; else v3 = 8; a1->field_0 = v3; if (a0->field_34 > 0) v4 = 8; else v4 = 5; a1->field_8 = (&he_errlist)[v4]; v2 = 4294967295; } return v2; }
HASH_TABLE * hash_copy (table, cpdata) HASH_TABLE *table; sh_string_func_t *cpdata; { HASH_TABLE *new_table; int i; if (table == 0) return ((HASH_TABLE *) ((void *)0) ); new_table = hash_create (table->nbuckets); for (i = 0; i < table->nbuckets; i++) new_table->bucket_array[i] = copy_bucket_array (table->bucket_array[i], cpdata); new_table->nentries = table->nentries; return new_table; }
long hash_copy(long a1, long ( *a2)(long)) { long *v3; int i; long v5; if ( !a1 ) return 0LL; v5 = hash_create(*(_DWORD *)(a1 + 8)); for ( i = 0; i < *(_DWORD *)(a1 + 8); ++i ) { v3 = (long *)(*(_QWORD *)v5 + 8LL * i); *v3 = copy_bucket_array(*(long **)(8LL * i + *(_QWORD *)a1), a2); } *(_DWORD *)(v5 + 12) = *(_DWORD *)(a1 + 12); return v5; }
static int build_bl_tree(s) deflate_state *s; { int max_blindex; scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code); scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code); build_tree(s, (tree_desc *)(&(s->bl_desc))); for (max_blindex = 19 -1; max_blindex >= 3; max_blindex--) { if (s->bl_tree[bl_order[max_blindex]].dl.len != 0) break; } s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4; ; return max_blindex; }
int build_bl_tree(long param_1) { int local_c; scan_tree(param_1,param_1 + 0xd4,*(undefined4 *)(param_1 + 0xb60)); scan_tree(param_1,param_1 + 0x9c8,*(undefined4 *)(param_1 + 0xb78)); build_tree(param_1,param_1 + 0xb88); local_c = 0x12; while ((2 < local_c && (*(short *)(param_1 + 0xe + ((long)(int)(uint)(byte)bl_order[local_c] + 0x2ac) * 4) == 0))) { local_c = local_c + -1; } *(long *)(param_1 + 0x1718) = ((long)local_c + 1) * 3 + *(long *)(param_1 + 0x1718) + 0xe; return local_c; }
static int minor_from_header (const char *p, size_t s) { return from_header (p, s, "minor_t", ((int) ~ ((int) (! (! ((int) 0 < (int) -1)) ? (int) -1 : ((((int) 1 << ((sizeof (int) * 8) - 2)) - 1) * 2 + 1)))), ((int) (! (! ((int) 0 < (int) -1)) ? (int) -1 : ((((int) 1 << ((sizeof (int) * 8) - 2)) - 1) * 2 + 1))), 0 , 0 ); }
long minor_from_header(_BYTE *a1, size_t a2) { return from_header(a1, a2, (long)"minor_t", 0xFFFFFFFF80000000LL, 0x7FFFFFFFuLL, 0, 0); }
int hostfile_replace_entries(const char *filename, const char *host, const char *ip, struct sshkey **keys, size_t nkeys, int store_hash, int quiet, int hash_alg) { int r, fd, oerrno = 0; int loglevel = quiet ? SYSLOG_LEVEL_DEBUG1 : SYSLOG_LEVEL_VERBOSE; struct host_delete_ctx ctx; char *fp, *temp = ((void *)0) , *back = ((void *)0) ; const char *what; mode_t omask; size_t i; u_int want; omask = umask(077); memset(&ctx, 0, sizeof(ctx)); ctx.host = host; ctx.ip = ip; ctx.quiet = quiet; if ((ctx.match_keys = calloc(nkeys, sizeof(*ctx.match_keys))) == ((void *)0) ) return -2; ctx.keys = keys; ctx.nkeys = nkeys; ctx.modified = 0; if ((r = asprintf(&temp, "%s.XXXXXXXXXXX", filename)) == -1 || (r = asprintf(&back, "%s.old", filename)) == -1) { r = -2; goto fail; } if ((fd = mkstemp(temp)) == -1) { oerrno = (*__errno_location ()) ; sshlog("hostfile.c", __func__, 622, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "mkstemp: %s", strerror(oerrno)); r = -24; goto fail; } if ((ctx.out = fdopen(fd, "w")) == ((void *)0) ) { oerrno = (*__errno_location ()) ; close(fd); sshlog("hostfile.c", __func__, 629, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "fdopen: %s", strerror(oerrno)); r = -24; goto fail; } if ((r = hostkeys_foreach(filename, host_delete, &ctx, host, ip, (1<<1), 0)) != 0) { oerrno = (*__errno_location ()) ; sshlog("hostfile.c", __func__, 638, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "hostkeys_foreach"); goto fail; } want = (1) | (ip == ((void *)0) ? 0 : (1<<1)); for (i = 0; i < nkeys; i++) { if (keys[i] == ((void *)0) || (want & ctx.match_keys[i]) == want) continue; if ((fp = sshkey_fingerprint(keys[i], hash_alg, SSH_FP_DEFAULT)) == ((void *)0) ) { r = -2; goto fail; } what = ""; if (ctx.match_keys[i] == 0) { what = "Adding new key"; if (!write_host_entry(ctx.out, host, ip, keys[i], store_hash)) { r = -1; goto fail; } } else if ((want & ~ctx.match_keys[i]) == (1)) { what = "Fixing match (hostname)"; if (!write_host_entry(ctx.out, host, ((void *)0) , keys[i], store_hash)) { r = -1; goto fail; } } else if ((want & ~ctx.match_keys[i]) == (1<<1)) { what = "Fixing match (address)"; if (!write_host_entry(ctx.out, ip, ((void *)0) , keys[i], store_hash)) { r = -1; goto fail; } } sshlog("hostfile.c", __func__, 676, 0, loglevel, ((void *)0) , "%s%s%s for %s%s%s to %s: %s %s", quiet ? __func__ : "", quiet ? ": " : "", what, host, ip == ((void *)0) ? "" : ",", ip == ((void *)0) ? "" : ip, filename, sshkey_ssh_name(keys[i]), fp) ; free(fp); ctx.modified = 1; } fclose(ctx.out); ctx.out = ((void *)0) ; if (ctx.modified) { if (unlink(back) == -1 && (*__errno_location ()) != 2 ) { oerrno = (*__errno_location ()) ; sshlog("hostfile.c", __func__, 690, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "unlink %.100s: %s", back, strerror( (*__errno_location ()) )); r = -24; goto fail; } if (link(filename, back) == -1) { oerrno = (*__errno_location ()) ; sshlog("hostfile.c", __func__, 696, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "link %.100s to %.100s: %s", filename, back, strerror( (*__errno_location ()) )) ; r = -24; goto fail; } if (rename(temp, filename) == -1) { oerrno = (*__errno_location ()) ; sshlog("hostfile.c", __func__, 703, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "rename \"%s\" to \"%s\": %s", temp, filename, strerror( (*__errno_location ()) )) ; r = -24; goto fail; } } else { if (unlink(temp) != 0) sshlog("hostfile.c", __func__, 711, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "unlink \"%s\": %s", temp, strerror( (*__errno_location ()) )); } r = 0; fail: if (temp != ((void *)0) && r != 0) unlink(temp); free(temp); free(back); if (ctx.out != ((void *)0) ) fclose(ctx.out); free(ctx.match_keys); umask(omask); if (r == -24) (*__errno_location ()) = oerrno; return r; }
long long hostfile_replace_entries(unsigned long a0, unsigned long long a1, unsigned long long a2, unsigned long a3, unsigned int a4, unsigned long a5, unsigned int v31, unsigned int a6) { unsigned long long v0; unsigned long long v1; unsigned long long v2; unsigned long long v3; unsigned long v4; unsigned long long v5; unsigned long long v6; void* v7; unsigned long v8; void* v9; unsigned long long v10; unsigned long long v11; unsigned int v12; unsigned int v13; unsigned int v14; unsigned int v15; unsigned int v16; unsigned int v17; void* v18; void* v19; unsigned long long v20; void* v21; void* v22; void* v23; unsigned int v24; unsigned long v25; unsigned long v26; unsigned int *v27; void* v28; unsigned long v29; unsigned int v30; unsigned int v32; unsigned long long v33; unsigned int v34; unsigned long long v35; unsigned long long v36; unsigned long long v37; unsigned long long v38; unsigned long long v39; unsigned long long v40; unsigned long long v41; unsigned long long v43; unsigned long long v44; unsigned long long v45; v11 = a1; v10 = a2; v9 = a3; v13 = 0; if (v31) v32 = 5; else v32 = 4; v14 = v32; v18 = 0; v19 = 0; v15 = umask(0x3f); memset(&v23, 0x0, 0x40); v25 = v11; v26 = v10; v24 = v31; v27 = calloc(a4, 0x4); if (!v27) { v33 = 4294967294; } else { v28 = v9; *(&v29) = a4; v30 = 0; v12 = asprintf(&v18, "%s.XXXXXXXXXXX", a0); if (v12 != -1) { v12 = asprintf(&v19, "%s.old", a0); if (v12 != -1) { v16 = mkstemp(v18); if (v16 == -1) { v13 = *(__errno_location()); v8 = strerror(v13); sshlog("hostfile.c", "hostfile_replace_entries", 0x26e, 0x1, 0x2, 0x0); v12 = -24; } else { v23 = fdopen(v16, "w"); if (!v23) { v13 = *(__errno_location()); close(v16); v8 = strerror(v13); sshlog("hostfile.c", "hostfile_replace_entries", 0x275, 0x1, 0x2, 0x0); v12 = -24; } else { v12 = hostkeys_foreach(a0, host_delete, &v23, v11, v10, 0x2, 0x0); if (v12) { v13 = *(__errno_location()); sshlog("hostfile.c", "hostfile_replace_entries", 0x27e, 0x1, 0x2, ssh_err(v12)); } else { if (!v10) v34 = 1; else v34 = 3; v17 = v34; v21 = 0; while (true) { if (v21 < a4) { if (*((v9 + 0x8 * v21)) && v17 != (*((v27 + 0x4 * v21)) & v17)) { v22 = sshkey_fingerprint(*((v9 + 0x8 * v21)), a6, 0x0, a6); if (!v22) { v12 = -2; break; } else { v20 = &g_402eda; if (!*((v27 + 0x4 * v21))) { v20 = "Adding new key"; v35 = write_host_entry(v23, v11, v10, *((v9 + 0x8 * v21)), a5); if (!v35) { v12 = -1; break; } } else { if ((!(*((v27 + 0x4 * v21))) & v17) == 1) { v20 = "Fixing match (hostname)"; v36 = write_host_entry(v23, v11, 0x0, *((v9 + 0x8 * v21)), a5); if (!v36) { v12 = -1; break; } } else if (!v37 && (!(*((v27 + 0x4 * v21))) & v17) == 2) { v12 = -1; break; } if ((!(*((v27 + 0x4 * v21))) & v17) == 2) { v20 = "Fixing match (address)"; v37 = write_host_entry(v23, v10, 0x0, *((v9 + 0x8 * v21)), a5); } } } } if (...) { a0 = sshkey_ssh_name(*((v9 + 0x8 * v21))); if (v10) v38 = v10; else v38 = &g_402eda; if (!v10) v39 = &g_402eda; else v39 = ","; if (v31) v40 = ": "; else v40 = &g_402eda; if (v31) v41 = "hostfile_replace_entries"; else v41 = &g_402eda; v8 = v22; v7 = a0; v6 = v38; v5 = v39; v4 = v11; v3 = v20; v2 = v40; v1 = v41; v0 = "%s%s%s for %s%s%s to %s: %s %s"; sshlog("hostfile.c", "hostfile_replace_entries", 0x2a4, 0x0, v14, 0x0); free(v22); v30 = 1; } if (v36 || v37 || v22 || v35) v21 += 1; } else { fclose(v23); v23 = 0; if (v30) { v43 = unlink(v19); if (v43 == -1) { *(&v43) = *(__errno_location()); v13 = *(__errno_location()); strerror(*(__errno_location())); v7 = v19; v6 = "unlink %.100s: %s"; sshlog("hostfile.c", "hostfile_replace_entries", 0x2b2, 0x1, 0x2, 0x0); v12 = -24; break; } if (v43 == 2 || v43 != -1) { v44 = link(a0, v19); if (v44 == -1) { v13 = *(__errno_location()); v8 = strerror(*(__errno_location())); v7 = a0; v6 = "link %.100s to %.100s: %s"; sshlog("hostfile.c", "hostfile_replace_entries", 0x2b8, 0x1, 0x2, 0x0); v12 = -24; break; } else { v45 = rename(v18, a0); if (v45 == -1) { v13 = *(__errno_location()); v8 = strerror(*(__errno_location())); v7 = v18; v6 = "rename \"%s\" to \"%s\": %s"; sshlog("hostfile.c", "hostfile_replace_entries", 0x2bf, 0x1, 0x2, 0x0); v12 = -24; break; } } } } else if (unlink(v18)) { strerror(*(__errno_location())); v7 = v18; v6 = "unlink \"%s\": %s"; sshlog("hostfile.c", "hostfile_replace_entries", 0x2c7, 0x1, 0x2, 0x0); } if (!v30 || v43 == 2 && v45 != -1 && v44 != -1 || v43 != -1 && v45 != -1 && v44 != -1) { v12 = 0; break; } } } } } } } } if (v12 == -1 || v12 == -1) v12 = -2; if (v18 && v12) unlink(v18); free(v18); free(v19); if (v23) fclose(v23); free(v27); umask(v15); if (v12 == -24) *(__errno_location()) = v13; v33 = v12; } return v33; }
int config_has_permitted_cnames(Options *options) { if (options->num_permitted_cnames == 1 && strcasecmp(options->permitted_cnames[0].source_list, "none") == 0 && strcmp(options->permitted_cnames[0].target_list, "") == 0) return 0; return options->num_permitted_cnames > 0; }
int config_has_permitted_cnames(struct_0 *a0) { unsigned int v1; if (a0->field_14cc == 1 && !strcasecmp(a0->field_14d0, "none") && !strcmp(a0->field_14d8, &g_40b5e4)) { v1 = 0; goto LABEL_406db4; } v1 = a0->field_14cc > 0; LABEL_406db4: return v1; }
int main(int argc, char **argv) { FILE *fp; struct rtnl_handle rth; int family = 0 ; unsigned int groups = ~0U; int llink = 0; int laddr = 0; int lroute = 0; char *file = ((void *)0) ; while (argc > 1) { if (matches(argv[1], "-family") == 0) { argc--; argv++; if (argc <= 1) usage(); if (strcmp(argv[1], "inet") == 0) family = 2 ; else if (strcmp(argv[1], "inet6") == 0) family = 10 ; else if (strcmp(argv[1], "link") == 0) family = 10 ; else if (strcmp(argv[1], "help") == 0) usage(); else { fprintf( stderr , "Protocol ID \"%s\" is unknown, try \"rtmon help\".\n", argv[1]); exit(-1); } } else if (strcmp(argv[1], "-4") == 0) { family = 2 ; } else if (strcmp(argv[1], "-6") == 0) { family = 10 ; } else if (strcmp(argv[1], "-0") == 0) { family = 17 ; } else if (matches(argv[1], "-Version") == 0) { printf("rtmon utility, iproute2-%s\n", version); exit(0); } else if (matches(argv[1], "file") == 0) { argc--; argv++; if (argc <= 1) usage(); file = argv[1]; } else if (matches(argv[1], "link") == 0) { llink = 1; groups = 0; } else if (matches(argv[1], "address") == 0) { laddr = 1; groups = 0; } else if (matches(argv[1], "route") == 0) { lroute = 1; groups = 0; } else if (strcmp(argv[1], "all") == 0) { groups = ~0U; } else if (matches(argv[1], "help") == 0) { usage(); } else { fprintf( stderr , "Argument \"%s\" is unknown, try \"rtmon help\".\n", argv[1]); exit(-1); } argc--; argv++; } if (file == ((void *)0) ) { fprintf( stderr , "Not enough information: argument \"file\" is required\n"); exit(-1); } if (llink) groups |= nl_mgrp(RTNLGRP_LINK); if (laddr) { if (!family || family == 2 ) groups |= nl_mgrp(RTNLGRP_IPV4_IFADDR); if (!family || family == 10 ) groups |= nl_mgrp(RTNLGRP_IPV6_IFADDR); } if (lroute) { if (!family || family == 2 ) groups |= nl_mgrp(RTNLGRP_IPV4_ROUTE); if (!family || family == 10 ) groups |= nl_mgrp(RTNLGRP_IPV6_ROUTE); } fp = fopen(file, "w"); if (fp == ((void *)0) ) { perror("Cannot fopen"); exit(-1); } if (rtnl_open(&rth, groups) < 0) exit(1); if (rtnl_linkdump_req(&rth, 0 ) < 0) { perror("Cannot send dump request"); exit(1); } write_stamp(fp); if (rtnl_dump_filter_nc(&rth, dump_msg2, fp, 0) < 0) { fprintf( stderr , "Dump terminated\n"); return 1; } init_phase = 0; if (rtnl_listen(&rth, dump_msg, (void *)fp) < 0) exit(2); exit(0); }
int main(unsigned long a0, unsigned long a1) { struct_0 *v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; void* v7; void* v8; char v9; unsigned long v10; unsigned long long *v12; char v13; unsigned long long v14; unsigned long long v15; unsigned long long v16; unsigned long long v17; unsigned long long v18; unsigned long long v19; unsigned long long v20; v1 = a0; v0 = a1; v10 = v12[5]; v2 = 0; v3 = -1; v4 = 0; v5 = 0; v6 = 0; v7 = 0; while (true) { if (v1 > 1) { v13 = matches(v0->field_8, "-family") ^ 1; if (v13) { v1 -= 1; v0 = &v0->field_8; if (v1 <= 1) usage(); v15 = strcmp(v0->field_8, "inet"); if (!v15) { v2 = 2; } else { v17 = strcmp(v0->field_8, "inet6"); if (!v17) { v2 = 10; } else { v19 = strcmp(v0->field_8, "link"); if (!v19) { v2 = 10; } else { if (!strcmp(v0->field_8, "help")) usage(); fprintf(*(&stderr), "Protocol ID \"%s\" is unknown, try \"rtmon help\".\n", v0->field_8); exit(0xffffffff); } } } } else { v14 = strcmp(v0->field_8, "-4"); if (!v14) { v2 = 2; } else { v16 = strcmp(v0->field_8, "-6"); if (!v16) { v2 = 10; } else { v18 = strcmp(v0->field_8, "-0"); if (!v18) { v2 = 17; } else { *(&v18) = matches(v0->field_8, "-Version") ^ 1; if (v18) { printf("rtmon utility, iproute2-%s\n", &version); exit(0x0); } *(&v18) = matches(v0->field_8, "file") ^ 1; *(&v18) = matches(v0->field_8, "link") ^ 1; *(&v18) = matches(v0->field_8, "address") ^ 1; *(&v18) = matches(v0->field_8, "route") ^ 1; v20 = strcmp(v0->field_8, "all"); if (!v20) { v3 = -1; } else { *(&v20) = matches(v0->field_8, "help") ^ 1; if (v20) usage(); fprintf(*(&stderr), "Argument \"%s\" is unknown, try \"rtmon help\".\n", v0->field_8); exit(0xffffffff); } } } } } if (false) { v1 -= 1; v0 = &v0->field_8; v7 = v0->field_8; usage(); v4 = 1; v3 = 0; v5 = 1; v3 = 0; v6 = 1; v3 = 0; } if (!v18 && !v20 && !v13 && v18 && v14 && v16 || !v18 && !v13 && v14 && v16 || !v16 && !v13 && v14 || !v14 && !v13 || !v19 && v15 && v1 > 1 && v17 && v13 || !v17 && v15 && v1 > 1 && v13 || !v15 && v1 > 1 && v13) { v1 -= 1; v0 = &v0->field_8; } } else if (!v7) { fprintf(*(&stderr), "Not enough information: argument \"file\" is required\n"); exit(0xffffffff); } else { if (!v4) break; if (v4) { v3 |= nl_mgrp(0x1); break; } } } if (v5) { if (!v2 || v2 == 2) v3 |= nl_mgrp(0x5); if (!v2 || v2 == 10) v3 |= nl_mgrp(0x9); } if (v6) { if (!v2 || v2 == 2) v3 |= nl_mgrp(0x7); if (!v2 || v2 == 10) v3 |= nl_mgrp(0xb); } v8 = fopen64(v7, "w"); if (!v8) { perror("Cannot fopen"); exit(0xffffffff); } else if (rtnl_open(&v9, v3, v3) < 0) { exit(0x1); } else if (rtnl_linkdump_req(&v9, 0x0) < 0) { perror("Cannot send dump request"); exit(0x1); } else { write_stamp(v8); if (rtnl_dump_filter_nc(&v9, dump_msg2, v8, 0x0) < 0) { fprintf(*(&stderr), "Dump terminated\n"); if ((v10 ^ v12[5])) __stack_chk_fail(); return 1; } else { init_phase = 0; if (rtnl_listen(&v9, dump_msg, v8) < 0) exit(0x2); exit(0x0); } } }
static _Bool get_device (char const *device) { struct mount_entry const *me; struct mount_entry const *best_match = ((void *)0) ; _Bool best_match_accessible = 0 ; _Bool eclipsed_device = 0 ; char const *file = device; char *resolved = canonicalize_file_name (device); if (resolved && (((resolved)[0]) == '/')) device = resolved; size_t best_match_len = (18446744073709551615UL) ; for (me = mount_list; me; me = me->me_next) { char *devname = me->me_devname; char *canon_dev = canonicalize_file_name (me->me_devname); if (canon_dev && (((canon_dev)[0]) == '/')) devname = canon_dev; if ((strcmp (device, devname) == 0)) { char *last_device = last_device_for_mount (me->me_mountdir); eclipsed_device = last_device && ! (strcmp (last_device, devname) == 0); size_t len = strlen (me->me_mountdir); if (! eclipsed_device && (! best_match_accessible || len < best_match_len)) { struct stat device_stats; _Bool this_match_accessible = 0 ; if (stat (me->me_mountdir, &device_stats) == 0) best_match_accessible = this_match_accessible = 1 ; if (this_match_accessible || (! best_match_accessible && len < best_match_len)) { best_match = me; if (len == 1) { free (last_device); free (canon_dev); break; } else best_match_len = len; } } free (last_device); } free (canon_dev); } free (resolved); if (best_match) { get_dev (best_match->me_devname, best_match->me_mountdir, file, ((void *)0) , best_match->me_type, best_match->me_dummy, best_match->me_remote, ((void *)0) , 0 ); return 1 ; } else if (eclipsed_device) { error (0, 0, gettext ("cannot access %s: over-mounted by another device"), quotearg_style (shell_escape_always_quoting_style, file)); exit_status = 1 ; return 1 ; } return 0 ; }
int get_device(void* a0) { char *v0; char v1; char v2; char v3; unsigned long long v4[7]; void* v5; unsigned long long v6; char *v7; char *v8; char *v9; char *v10; void* v11; unsigned long v12; char v13; char v15; unsigned int v16; unsigned long long v17; v0 = a0; v5 = 0; v1 = 0; v2 = 0; v8 = v0; v9 = canonicalize_file_name(v0); if (v9 && *(v9) == 47) v0 = v9; v6 = -1; v4[0] = mount_list; while (true) { if (!v4) break; v7 = v4[0]; v10 = canonicalize_file_name(v4[0]); if (v10 && *(v10) == 47) v7 = v10; if (!strcmp(v0, v7)) { v11 = last_device_for_mount(v4[1]); if (!v11 || !strcmp(v11, v7)) v15 = 0; else v15 = 1; v2 = v15; v2 &= 1; v12 = strlen(v4[1]); if ((v2 ^ 1) && ((v1 ^ 1) || v12 < v6)) { v3 = 0; if (!stat(v4[1], &v13)) { v3 = 1; v1 = v3; } if (!(!v3) || !(!(v1 ^ 1)) && !(v12 >= v6)) { v5 = v4; if (v12 != 1) { v6 = v12; } else { free(v11); free(v10); break; } } } free(v11); } free(v10); v4[0] = v4[6]; } free(v9); if (v5) { get_dev(*(v5), v5[8], v8, NULL, v5[24], (v5[40] & 1), (v5[40] & 2), 0x0, 0x0); v16 = 1; return v16; } else if (v2) { v17 = quotearg_style(0x4, v8); error(0x0, 0x0, gettext("cannot access %s: over-mounted by another device")); exit_status = 1; v16 = 1; return v16; } else { v16 = 0; return v16; } }
static void add_one_listen_addr(ServerOptions *options, const char *addr, const char *rdomain, int port) { struct addrinfo hints, *ai, *aitop; char strport[ 32 ]; int gaierr; u_int i; for (i = 0; i < options->num_listen_addrs; i++) { if (rdomain == ((void *)0) && options->listen_addrs[i].rdomain == ((void *)0) ) break; if (rdomain == ((void *)0) || options->listen_addrs[i].rdomain == ((void *)0) ) continue; if (strcmp(rdomain, options->listen_addrs[i].rdomain) == 0) break; } if (i >= options->num_listen_addrs) { if (i >= 0x7fffffff) sshfatal("servconf.c", __func__, 787, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "too many listen addresses"); options->listen_addrs = xrecallocarray(options->listen_addrs, options->num_listen_addrs, options->num_listen_addrs + 1, sizeof(*options->listen_addrs)); i = options->num_listen_addrs++; if (rdomain != ((void *)0) ) options->listen_addrs[i].rdomain = xstrdup(rdomain); } memset(&hints, 0, sizeof(hints)); hints.ai_family = options->address_family; hints.ai_socktype = SOCK_STREAM ; hints.ai_flags = (addr == ((void *)0) ) ? 0x0001 : 0; snprintf(strport, sizeof strport, "%d", port); if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0) sshfatal("servconf.c", __func__, 803, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "bad addr or host: %s (%s)", addr ? addr : "<NULL>", ssh_gai_strerror(gaierr)) ; for (ai = aitop; ai->ai_next; ai = ai->ai_next) ; ai->ai_next = options->listen_addrs[i].addrs; options->listen_addrs[i].addrs = aitop; }
void add_one_listen_addr(struct_0 *a0, unsigned long long a1, char *a2, unsigned long a3) { char *v0; unsigned int v1; unsigned int v2; char v3; unsigned long long v4; char v5; unsigned int v6; unsigned int v7; char v8; unsigned long long v9; unsigned long long v10; unsigned long v11; char v12; unsigned int v14; unsigned long long v16; unsigned long long *v17; unsigned long long v18; v0 = a2; v1 = 0; while (true) { if (v1 >= a0->field_420) break; if (!v0 && !*((a0->field_418 + (v1 << 4)))) break; if (v0 && *((a0->field_418 + (v1 << 4))) && !strcmp(v0, *((a0->field_418 + (v1 << 4))))) break; v1 += 1; } if (v1 >= a0->field_420) { if (v1 > 2147483646) sshfatal("servconf.c", "add_one_listen_addr", 0x313, 0x1, 0x1, 0x0, "too many listen addresses"); a0->field_418 = xrecallocarray(a0->field_418, a0->field_420, a0->field_420 + 1, 0x10); v14 = a0->field_420; a0->field_420 = a0->field_420 + 1; v1 = v14; if (v0) *((a0->field_418 + v1 * 16)) = xstrdup(v0); } memset(&v5, 0x0, 0x30); v6 = a0->field_424; v7 = 1; v5 = !a1; snprintf(&v8, 0x20, "%d", a3); v2 = getaddrinfo(a1, &v8, &v5, &v3); if (v2) { if (!a1) v16 = "<NULL>"; else v16 = a1; v11 = ssh_gai_strerror(v2); v10 = v16; v9 = "bad addr or host: %s (%s)"; sshfatal("servconf.c", "add_one_listen_addr", 0x323, 0x0, 0x1, 0x0, *(&v12)); } for (v4 = *(&v3); *((v4 + 40)); v4 = *((v4 + 40))); *((v4 + 40)) = *((a0->field_418 + v1 * 16 + 8)); *((v1 * 16 + a0->field_418 + 8)) = *(&v3); v18 = v9 ^ v17[5]; return; }
size_t strdtb(char *s) { char *x = s; while (*x) x++; do { x--; } while (x >= s && ((*__ctype_b_loc ())[(int) (( (unsigned char) *x ))] & (unsigned short int) _ISspace) ); *++x = '\0'; return ((size_t)(x - s)); }
long long strdtb(unsigned long a0) { char *v0; unsigned int v3; for (v0 = a0; *(v0); v0 += 1); while (true) { v0 += 1; if (v0 < a0) break; v3 = *((*(v0) * 2 + *(__ctype_b_loc()))) & 0x2000; if (!v3) break; } v0 += 1; *(v0) = 0; return &v0[-1 * a0]; }
static int output_softdeps(struct depmod *depmod, FILE *out) { size_t i; fputs("# Soft dependencies extracted from modules themselves.\n", out); for (i = 0; i < depmod->modules.count; i++) { const struct mod *mod = depmod->modules.array[i]; struct kmod_list *l; for (l = ((mod->info_list) == ((void *)0) ) ? ((void *)0) : (mod->info_list); l != ((void *)0) ; l = (l->node.next == &((mod->info_list)->node)) ? ((void *)0) : ((struct kmod_list *) ((char *)(l->node.next) - __builtin_offsetof ( struct kmod_list , node ) ) - ((typeof(*(l->node.next)) *)0 != (typeof(((struct kmod_list *)0)->node) *)0))) { const char *key = kmod_module_info_get_key(l); const char *value = kmod_module_info_get_value(l); if (!(strcmp((key), ("softdep")) == 0)) continue; fprintf(out, "softdep %s %s\n", mod->modname, value); } } return 0; }
long long output_softdeps(unsigned long long a0[4], void* a1) { void* v0; unsigned long long *v1; struct_0 *v2; char *v3; unsigned long v4; fputs("# Soft dependencies extracted from modules themselves.\n", a1); for (v0 = 0; v0 < a0[3]; v0 += 1) { v2 = *((a0[2] + v0 * 8)); for (v1 = v2->field_20; v1; *(&v1) = (*(v1) == v2->field_20 ? *(v1) : 0)) { v3 = kmod_module_info_get_key(v1); v4 = kmod_module_info_get_value(v1); if (!strcmp(v3, "softdep")) fprintf(a1, "softdep %s %s\n", (v2 + 3), v4); } } return 0; }
static int gidtb_start(void) { static int fail = 0; if (gidtb != ((void *)0) ) return 0; if (fail) return -1; if ((gidtb = calloc(251, sizeof(GIDC *))) == ((void *)0) ) { ++fail; return -1; } return 0; }
undefined8 gidtb_start(void) { undefined8 uVar1; if (gidtb == (void *)0x0) { if (fail_4014 == 0) { gidtb = calloc(0xfb,8); if (gidtb == (void *)0x0) { fail_4014 = fail_4014 + 1; uVar1 = 0xffffffff; } else { uVar1 = 0; } } else { uVar1 = 0xffffffff; } } else { uVar1 = 0; } return uVar1; }
static int cfg_file_parse(struct cfg *cfg, const char *filename) { char *line; FILE *fp; unsigned int linenum = 0; int err; fp = fopen(filename, "r"); if (fp == ((void *)0) ) { err = - (*__errno_location ()) ; log_printf( 3 , "file parse %s: %m\n", filename); return err; } while ((line = freadline_wrapped(fp, &linenum)) != ((void *)0) ) { char *cmd, *saveptr; if (line[0] == '\0' || line[0] == '#') goto done_next; cmd = strtok_r(line, "\t ", &saveptr); if (cmd == ((void *)0) ) goto done_next; if ((strcmp((cmd), ("search")) == 0)) { const char *sp; while ((sp = strtok_r( ((void *)0) , "\t ", &saveptr)) != ((void *)0) ) { cfg_search_add(cfg, sp); } } else if ((strcmp((cmd), ("override")) == 0)) { const char *modname = strtok_r( ((void *)0) , "\t ", &saveptr); const char *version = strtok_r( ((void *)0) , "\t ", &saveptr); const char *subdir = strtok_r( ((void *)0) , "\t ", &saveptr); if (modname == ((void *)0) || version == ((void *)0) || subdir == ((void *)0) ) goto syntax_error; if (!cfg_kernel_matches(cfg, version)) { log_printf( 6 , "%s:%u: override kernel did not match %s\n", filename, linenum, version) ; goto done_next; } cfg_override_add(cfg, modname, subdir); } else if ((strcmp((cmd), ("external")) == 0)) { const char *version = strtok_r( ((void *)0) , "\t ", &saveptr); const char *dir = strtok_r( ((void *)0) , "\t ", &saveptr); if (version == ((void *)0) || dir == ((void *)0) ) goto syntax_error; if (!cfg_kernel_matches(cfg, version)) { log_printf( 6 , "%s:%u: external directory did not match %s\n", filename, linenum, version) ; goto done_next; } cfg_external_add(cfg, dir); } else if ((strcmp((cmd), ("exclude")) == 0)) { const char *sp; while ((sp = strtok_r( ((void *)0) , "\t ", &saveptr)) != ((void *)0) ) { cfg_exclude_add(cfg, sp); } } else if ((strcmp((cmd), ("include")) == 0) || (strcmp((cmd), ("make_map_files")) == 0)) { log_printf( 6 , "%s:%u: command %s not implemented yet\n", filename, linenum, cmd) ; } else { syntax_error: log_printf( 3 , "%s:%u: ignoring bad line starting with '%s'\n", filename, linenum, cmd) ; } done_next: free(line); } fclose(fp); return 0; }
void cfg_file_parse(void* a0, char *a1, unsigned long a2, unsigned long long a3, unsigned long long a4) { unsigned int v0; unsigned int v1; char v2; void* v3; char *v4; char *v5; void* v6; char *v7; char *v8; void* v9; char *v10; void* v11; void* v12; unsigned long long v14; void* v15; v0 = 0; v3 = fopen(a1, "r"); if (!v3) { v1 = -(*(__errno_location())); log_printf(0x3, "file parse %s: %m\n", a1, a3, a4); v14 = v1; } else { while (true) { v4 = freadline_wrapped(v3, &v0, &v0); if (!v4) break; if (*(v4) && *(v4) != 35) { v5 = strtok_r(v4, "\t ", &v2); if (!strcmp(v5, "search")) { while (true) { v12 = strtok_r(NULL, "\t ", &v2); if (!v12) break; cfg_search_add(a0, v12, v12, a3, a4); } } if (!strcmp(v5, "override")) { v9 = strtok_r(NULL, "\t ", &v2); v10 = strtok_r(NULL, "\t ", &v2); v11 = strtok_r(NULL, "\t ", &v2); if (v9 && v10 && v11) { if (!cfg_kernel_matches(a0, v10)) log_printf(0x6, "%s:%u: override kernel did not match %s\n", a1, v0, v10); else cfg_override_add(a0, v9, v11, v9, a4); } } else if (!strcmp(v5, "external")) { v7 = strtok_r(NULL, "\t ", &v2); v8 = strtok_r(NULL, "\t ", &v2); if (v7 && v8) { if (!cfg_kernel_matches(a0, v7)) log_printf(0x6, "%s:%u: external directory did not match %s\n", a1, v0, v7); else cfg_external_add(a0, v8, v8, a3, a4); } } else { if (!strcmp(v5, "exclude")) { while (true) { v6 = strtok_r(NULL, "\t ", &v2); if (!v6) break; cfg_exclude_add(a0, v6, v6, a3, a4); } } if (strcmp(v5, "include") && !(!strcmp(v5, "make_map_files"))) goto LABEL_402d05; log_printf(0x6, "%s:%u: command %s not implemented yet\n", a1, v0, v5); } LABEL_402d05: log_printf(0x3, "%s:%u: ignoring bad line starting with '%s'\n", a1, v0, v5); } free(v4); } fclose(v3); v15 = 0; } return; }
static void name_add_dir (const char *name) { struct name_elt *ep = name_elt_alloc (); ep->type = NELT_CHDIR; ep->v.name = name; }
long long name_add_dir(unsigned long a0) { struct_0 *v0; v0 = name_elt_alloc(); v0->field_10 = 1; v0->field_18 = a0; return v0; }
int sshkey_equal_public(const struct sshkey *a, const struct sshkey *b) { const BIGNUM *rsa_e_a, *rsa_n_a; const BIGNUM *rsa_e_b, *rsa_n_b; const BIGNUM *dsa_p_a, *dsa_q_a, *dsa_g_a, *dsa_pub_key_a; const BIGNUM *dsa_p_b, *dsa_q_b, *dsa_g_b, *dsa_pub_key_b; if (a == ((void *)0) || b == ((void *)0) || sshkey_type_plain(a->type) != sshkey_type_plain(b->type)) return 0; switch (a->type) { case KEY_RSA_CERT: case KEY_RSA: if (a->rsa == ((void *)0) || b->rsa == ((void *)0) ) return 0; RSA_get0_key(a->rsa, &rsa_n_a, &rsa_e_a, ((void *)0) ); RSA_get0_key(b->rsa, &rsa_n_b, &rsa_e_b, ((void *)0) ); return BN_cmp(rsa_e_a, rsa_e_b) == 0 && BN_cmp(rsa_n_a, rsa_n_b) == 0; case KEY_DSA_CERT: case KEY_DSA: if (a->dsa == ((void *)0) || b->dsa == ((void *)0) ) return 0; DSA_get0_pqg(a->dsa, &dsa_p_a, &dsa_q_a, &dsa_g_a); DSA_get0_pqg(b->dsa, &dsa_p_b, &dsa_q_b, &dsa_g_b); DSA_get0_key(a->dsa, &dsa_pub_key_a, ((void *)0) ); DSA_get0_key(b->dsa, &dsa_pub_key_b, ((void *)0) ); return BN_cmp(dsa_p_a, dsa_p_b) == 0 && BN_cmp(dsa_q_a, dsa_q_b) == 0 && BN_cmp(dsa_g_a, dsa_g_b) == 0 && BN_cmp(dsa_pub_key_a, dsa_pub_key_b) == 0; case KEY_ECDSA_SK: case KEY_ECDSA_SK_CERT: if (a->sk_application == ((void *)0) || b->sk_application == ((void *)0) ) return 0; if (strcmp(a->sk_application, b->sk_application) != 0) return 0; case KEY_ECDSA_CERT: case KEY_ECDSA: if (a->ecdsa == ((void *)0) || b->ecdsa == ((void *)0) || EC_KEY_get0_public_key(a->ecdsa) == ((void *)0) || EC_KEY_get0_public_key(b->ecdsa) == ((void *)0) ) return 0; if (EC_GROUP_cmp(EC_KEY_get0_group(a->ecdsa), EC_KEY_get0_group(b->ecdsa), ((void *)0) ) != 0 || EC_POINT_cmp(EC_KEY_get0_group(a->ecdsa), EC_KEY_get0_public_key(a->ecdsa), EC_KEY_get0_public_key(b->ecdsa), ((void *)0) ) != 0) return 0; return 1; case KEY_ED25519_SK: case KEY_ED25519_SK_CERT: if (a->sk_application == ((void *)0) || b->sk_application == ((void *)0) ) return 0; if (strcmp(a->sk_application, b->sk_application) != 0) return 0; case KEY_ED25519: case KEY_ED25519_CERT: return a->ed25519_pk != ((void *)0) && b->ed25519_pk != ((void *)0) && memcmp(a->ed25519_pk, b->ed25519_pk, 32U) == 0; default: return 0; } }
_BOOL8 sshkey_equal_public(long a1, long a2) { int v2; _BOOL8 result; long v4; long v5; long v6; long v7; long v8; long v9; long v10; long v11; long v12; long v13; long v14; long v15; long v16[4]; v16[1] = __readfsqword(0x28u); if ( !a1 ) return 0LL; if ( !a2 ) return 0LL; v2 = sshkey_type_plain(*(_DWORD *)a1); if ( v2 != (unsigned int)sshkey_type_plain(*(_DWORD *)a2) ) return 0LL; switch ( *(_DWORD *)a1 ) { case 0: case 4: if ( !*(_QWORD *)(a1 + 8) || !*(_QWORD *)(a2 + 8) ) return 0LL; RSA_get0_key(*(_QWORD *)(a1 + 8), &v14, &v13, 0LL); RSA_get0_key(*(_QWORD *)(a2 + 8), v16, &v15, 0LL); return !(unsigned int)BN_cmp(v13, v15) && !(unsigned int)BN_cmp(v14, v16[0]); case 1: case 5: if ( !*(_QWORD *)(a1 + 16) || !*(_QWORD *)(a2 + 16) ) return 0LL; DSA_get0_pqg(*(_QWORD *)(a1 + 16), &v9, &v10, &v11); DSA_get0_pqg(*(_QWORD *)(a2 + 16), &v13, &v14, &v15); DSA_get0_key(*(_QWORD *)(a1 + 16), &v12, 0LL); DSA_get0_key(*(_QWORD *)(a2 + 16), v16, 0LL); return !(unsigned int)BN_cmp(v9, v13) && !(unsigned int)BN_cmp(v10, v14) && !(unsigned int)BN_cmp(v11, v15) && !(unsigned int)BN_cmp(v12, v16[0]); case 2: case 6: goto LABEL_27; case 3: case 7: goto LABEL_41; case 0xA: case 0xB: if ( !*(_QWORD *)(a1 + 96) || !*(_QWORD *)(a2 + 96) ) return 0LL; if ( strcmp(*(const char **)(a1 + 96), *(const char **)(a2 + 96)) ) return 0LL; LABEL_27: if ( !*(_QWORD *)(a1 + 32) || !*(_QWORD *)(a2 + 32) || !EC_KEY_get0_public_key(*(_QWORD *)(a1 + 32)) || !EC_KEY_get0_public_key(*(_QWORD *)(a2 + 32)) ) { return 0LL; } v4 = EC_KEY_get0_group(*(_QWORD *)(a2 + 32)); v5 = EC_KEY_get0_group(*(_QWORD *)(a1 + 32)); result = 0; if ( !(unsigned int)EC_GROUP_cmp(v5, v4, 0LL) ) { v6 = EC_KEY_get0_public_key(*(_QWORD *)(a2 + 32)); v7 = EC_KEY_get0_public_key(*(_QWORD *)(a1 + 32)); v8 = EC_KEY_get0_group(*(_QWORD *)(a1 + 32)); if ( !(unsigned int)EC_POINT_cmp(v8, v7, v6, 0LL) ) return 1; } return result; case 0xC: case 0xD: if ( *(_QWORD *)(a1 + 96) && *(_QWORD *)(a2 + 96) ) { if ( !strcmp(*(const char **)(a1 + 96), *(const char **)(a2 + 96)) ) LABEL_41: result = *(_QWORD *)(a1 + 48) && *(_QWORD *)(a2 + 48) && !memcmp(*(const void **)(a1 + 48), *(const void **)(a2 + 48), 0x20uLL); else result = 0LL; } else { result = 0LL; } break; default: return 0LL; } return result; }
void tok_end(Tokenizer *tok) { free(tok->ifs); free(tok->wspace); free(tok->argv); free(tok); }
long long tok_end(unsigned long long a0[8]) { free(a0[0]); free(a0[7]); free(a0[3]); return free(a0); }
void set_color_palette (char const *palette) { color_palette = palette; }
long long set_color_palette(unsigned long long a0) { color_palette = a0; return a0; }
void getpass_copy(char *pass, size_t max_pass_size, const char *prompt) { char *tmp; size_t len; tmp = getpass(prompt); if (tmp == ((void *)0) ) { pass[0] = 0; return; } len = strlen(tmp); if (len >= max_pass_size) { gnutls_memset(tmp, 0, len); pass[0] = 0; return; } strcpy(pass, tmp); gnutls_memset(tmp, 0, len); return; }
void getpass_copy(char *param_1,ulong param_2,char *param_3) { char *__s; size_t sVar1; __s = getpass(param_3); if (__s == (char *)0x0) { *param_1 = '\0'; } else { sVar1 = strlen(__s); if (sVar1 < param_2) { strcpy(param_1,__s); gnutls_memset(__s,0,sVar1); } else { gnutls_memset(__s,0,sVar1); *param_1 = '\0'; } } return; }
static void process_readlink(u_int32_t id) { int r, len; char buf[ 4096 ]; char *path; if ((r = sshbuf_get_cstring(iqueue, &path, ((void *)0) )) != 0) sshfatal("sftp-server.c", __func__, 1335, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); sshlog("sftp-server.c", __func__, 1337, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "request %u: readlink", id); sshlog("sftp-server.c", __func__, 1338, 0, SYSLOG_LEVEL_VERBOSE, ((void *)0) , "readlink \"%s\"", path); if ((len = readlink(path, buf, sizeof(buf) - 1)) == -1) send_status(id, errno_to_portable( (*__errno_location ()) )); else { Stat s; buf[len] = '\0'; attrib_clear(&s.attrib); s.name = s.long_name = buf; send_names(id, 1, &s); } free(path); }
long long process_readlink(unsigned long a0) { unsigned long long v0; unsigned int v1; unsigned int v2; char v3; char *v4; char *v5; char v6; char v7; unsigned long long v8; unsigned long long v9; unsigned long v10; unsigned long long v11; unsigned long long v12; v8 = *(&v8); v1 = sshbuf_get_cstring(0xe87d894820ec8348, &v3, 0x0, &v3); if (v1) { v0 = "parse"; sshfatal("sftp-server.c", "process_readlink", 0x537, 0x1, 0x1, ssh_err(v1)); } v10 = a0; v9 = "request %u: readlink"; sshlog("sftp-server.c", "process_readlink", 0x539, 0x0, 0x7, 0x0, *(&v11)); v12 = *(&v3); v11 = "readlink \"%s\""; sshlog("sftp-server.c", "process_readlink", 0x53a, 0x0, 0x4, 0x0, "readlink \"%s\""); v2 = readlink(*(&v3), &v7, 0xfff); if (v2 == -1) { send_status(a0, errno_to_portable(*(__errno_location()))); } else { (&v7)[v2] = 0; attrib_clear(&v6); v5 = &v7; v4 = v5; send_names(a0, 0x1, &v4); } free(*(&v3)); return 0; }
_Bool pred_regex (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr) { int len = strlen (pathname); (void) stat_buf; if (re_match (pred_ptr->args.regex, pathname, len, 0, (struct re_registers *) ((void *)0) ) == len) return ( 1 ); return ( 0 ); }
long long pred_regex(char *a0, unsigned long a1, struct_0 *a2) { unsigned long v0; unsigned int v1; unsigned long long v3; v0 = a1; v1 = strlen(a0); if (v1 == re_match(a2->field_38, a0, v1, 0x0, 0x0)) v3 = 1; else v3 = 0; return v3; }
static __inline__ void expand_at_expression(FILE *f, e2fsck_t ctx, char ch, struct problem_context *pctx, int *first, int recurse) { const char **cpp, *str; for (cpp = abbrevs; *cpp; cpp++) { if (ch == *cpp[0]) break; } if (*cpp && recurse < 10) { str = (gettext (*cpp)) + 1; if (*first && ((*__ctype_b_loc ())[(int) (( *str ))] & (unsigned short int) _ISlower) ) { *first = 0; fputc(toupper(*str++), f); } print_e2fsck_message(f, ctx, str, pctx, *first, recurse+1); } else fprintf(f, "@%c", ch); }
void expand_at_expression(void* a0, unsigned long long *a1, unsigned long a2, unsigned long long a3, unsigned int *a4, unsigned long a5) { unsigned long long v0; int tmp_13; char *v1; unsigned long long v3; unsigned int v5; unsigned long long v7; v0 = &abbrevs; while (true) { if (!*(v0)) break; if (a2 == *(*(v0))) break; v0 += 8; } if (*(v0) && a5 <= 9) { v1 = gettext(*(v0)) + 1; if (*(a4)) { v5 = *((*(v1) * 2 + *(__ctype_b_loc()))) & 0x200; if (v5) { *(a4) = 0; tmp_13 = v1; v1 += 1; fputc(toupper(*(tmp_13)), a0); } } v7 = print_e2fsck_message(a0, a1, v1, a3, *(a4), a5 + 1); goto LABEL_40033e; } v3 = fprintf(a0, "@%c", a2); LABEL_40033e: return; }
static int safe_copy (char *buf, size_t buflen, const char *msg) { size_t len = strlen (msg); size_t moved = len < buflen ? len : buflen - 1; memmove (buf, msg, moved); buf[moved] = '\0'; return len < buflen ? 0 : 34 ; }
undefined8 safe_copy(void *param_1,ulong param_2,char *param_3) { size_t sVar1; size_t __n; undefined8 uVar2; sVar1 = strlen(param_3); __n = sVar1; if (param_2 <= sVar1) { __n = param_2 - 1; } memmove(param_1,param_3,__n); *(undefined *)(__n + (long)param_1) = 0; if (sVar1 < param_2) { uVar2 = 0; } else { uVar2 = 0x22; } return uVar2; }
static inline _Bool is_smack_enabled (void) { return 0 ; }
int is_smack_enabled() { return 0; }
static int e2fsck_journal_verify_csum_type(journal_t *j, journal_superblock_t *jsb) { if (!jbd2_journal_has_csum_v2or3(j)) return 1; return jsb->s_checksum_type == 4; }
bool e2fsck_journal_verify_csum_type(undefined8 param_1,long param_2) { int iVar1; bool bVar2; iVar1 = jbd2_journal_has_csum_v2or3(param_1); if (iVar1 == 0) { bVar2 = true; } else { bVar2 = *(char *)(param_2 + 0x50) == '\x04'; } return bVar2; }
ARRAY_ELEMENT * array_create_element(indx, value) arrayind_t indx; char *value; { ARRAY_ELEMENT *r; r = (ARRAY_ELEMENT *)sh_xmalloc((sizeof(ARRAY_ELEMENT)), "array.c", 520); r->ind = indx; r->value = value ? (char *)strcpy (sh_xmalloc((1 + strlen (value)), "array.c", 522), (value)) : (char *) ((void *)0) ; r->next = r->prev = (ARRAY_ELEMENT *) ((void *)0) ; return(r); }
_QWORD * array_create_element(long a1, const char *a2) { size_t v2; char *v3; char *v4; _QWORD *v6; v6 = (_QWORD *)sh_xmalloc(32LL, "array.c", 520LL); *v6 = a1; if ( a2 ) { v2 = strlen(a2); v3 = (char *)sh_xmalloc(v2 + 1, "array.c", 522LL); v4 = strcpy(v3, a2); } else { v4 = 0LL; } v6[1] = v4; v6[3] = 0LL; v6[2] = v6[3]; return v6; }
pid_t xfork (void) { pid_t p = fork (); if (p == (pid_t) -1) call_arg_fatal ("fork", gettext ("child process")); return p; }
__pid_t xfork(void) { __pid_t _Var1; undefined8 uVar2; _Var1 = fork(); if (_Var1 == -1) { uVar2 = gettext("child process"); call_arg_fatal(&DAT_00102749,uVar2); } return _Var1; }
int do_fsetstat(struct sftp_conn *conn, const u_char *handle, u_int handle_len, Attrib *a) { u_int status, id; sshlog("sftp-client.c", __func__, 981, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "Sending SSH2_FXP_FSETSTAT"); id = conn->msg_id++; send_string_attrs_request(conn, id, 10, handle, handle_len, a); status = get_status(conn, id); if (status != 0) sshlog("sftp-client.c", __func__, 989, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "remote fsetstat: %s", fx2txt(status)); return status == 0 ? 0 : -1; }
void do_fsetstat(struct_0 *a0, unsigned long long a1, unsigned long a2, unsigned long long a3) { int tmp_21; unsigned long v0; struct_0 *v1; unsigned int v2; unsigned int v3; unsigned long v5; v1 = a0; sshlog("sftp-client.c", "do_fsetstat", 0x3d5, 0x0, 0x6, 0x0, "Sending SSH2_FXP_FSETSTAT"); tmp_21 = a0->field_18; a0->field_18 = a0->field_18 + 1; v2 = tmp_21; send_string_attrs_request(a0, v2, 0xa, a1, a2, a3); v3 = get_status(a0, v2); if (v3) { v0 = fx2txt(v3); sshlog("sftp-client.c", "do_fsetstat", 0x3dd, 0x0, 0x2, 0x0, "remote fsetstat: %s"); } v5 = (!v3 ? 4294967295 : 0); return; }
char * get_posix_options (bitmap) char *bitmap; { register int i; if (bitmap == 0) bitmap = (char *)sh_xmalloc((num_posix_options ()), "general.c", 143); for (i = 0; posix_vars[i].posix_mode_var; i++) bitmap[i] = *(posix_vars[i].posix_mode_var); return bitmap; }
long get_posix_options(long a1) { int v1; int i; long v4; v4 = a1; if ( !a1 ) { v1 = num_posix_options(); v4 = sh_xmalloc(v1, "general.c", 143LL); } for ( i = 0; *(&posix_vars + i); ++i ) *(_BYTE *)(i + v4) = *(_DWORD *)*(&posix_vars + i); return v4; }
void print_cert_info(gnutls_session_t session, int verbose, int print_cert) { print_cert_info2(session, verbose, stdout , print_cert); }
void print_cert_info(unsigned long long a0, unsigned long a1, unsigned long a2) { unsigned long long v1; v1 = print_cert_info2(a0, a1, stdout, a2); return; }
static _Bool fremote (int fd, char const *name) { _Bool remote = 1 ; struct statfs buf; int err = fstatfs (fd, &buf); if (err != 0) { if ( (*__errno_location ()) != 38 ) error (0, (*__errno_location ()) , gettext ("cannot determine location of %s. " "reverting to polling") , quotearg_style (shell_escape_always_quoting_style, name)); } else { switch (is_local_fs_type (buf.f_type)) { case 0: break; case -1: break; case 1: remote = 0 ; break; default: ((void) sizeof (( !"unexpected return value from is_local_fs_type" ) ? 1 : 0), __extension__ ({ if ( !"unexpected return value from is_local_fs_type" ) ; else __assert_fail ( "!\"unexpected return value from is_local_fs_type\"" , "src/tail.c", 972, __extension__ __PRETTY_FUNCTION__); })) ; } } return remote; }
int fremote(unsigned long a0, unsigned long long a1) { char v0; unsigned int v1; char v2; unsigned long long v4; unsigned long long v6; v0 = 1; v1 = fstatfs(a0, &v2, &v2); if (!v1) { v4 = is_local_fs_type(*(&v2)); if (v4 != 1) { if ((v4 || v4 > 1) && (v4 > 1 || v4 != -1)) __assert_fail(); } else { v0 = 0; } } else if (*(__errno_location()) != 38) { v6 = quotearg_style(0x4, a1); error(0x0, *(__errno_location()), gettext("cannot determine location of %s. reverting to polling")); } if (v4 == 1 || v1 || !v4 && v4 <= 1 || v4 <= 1 && v4 == -1) return v0; }
void collect_and_sort_names (void) { struct name *name; struct name *next_name, *prev_name = ((void *)0) ; int num_names; Hash_table *nametab; name_gather (); if (!namelist) addname (".", 0, 0 , ((void *)0) ); if (listed_incremental_option) { switch (chdir_count ()) { case 0: break; case 1: if (namelist->change_dir == 0) do { if (error_hook) error_hook (); error (0, 0, gettext ("Using -C option inside file list is not " "allowed with --listed-incremental")); usage (2); } while (0) ; break; default: do { if (error_hook) error_hook (); error (0, 0, gettext ("Only one -C option is allowed with " "--listed-incremental")); usage (2); } while (0) ; } read_directory_file (); } num_names = 0; for (name = namelist; name; name = name->next, num_names++) { struct tar_stat_info st; if (name->found_count || name->directory) continue; if (name->matching_flags & (1 << 28)) continue; chdir_do (name->change_dir); if (name->name[0] == 0) continue; tar_stat_init (&st); if (deref_stat (name->name, &st.stat) != 0) { stat_diag (name->name); continue; } if ( (((( st.stat.st_mode )) & 0170000) == (0040000)) ) { int dir_fd = openat (chdir_fd, name->name, open_read_flags | 0200000 ); if (dir_fd < 0) open_diag (name->name); else { st.fd = dir_fd; if (fstat (dir_fd, &st.stat) != 0) stat_diag (name->name); else if ( 0200000 || (((( st.stat.st_mode )) & 0170000) == (0040000)) ) { st.orig_file_name = xstrdup (name->name); name->found_count++; add_hierarchy_to_namelist (&st, name); } else { (*__errno_location ()) = 20 ; open_diag (name->name); } } } tar_stat_destroy (&st); } namelist = merge_sort (namelist, num_names, compare_names); num_names = 0; nametab = hash_initialize (0, 0, name_hash, name_compare, ((void *)0) ); for (name = namelist; name; name = next_name) { next_name = name->next; name->caname = normalize_filename (name->change_dir, name->name); if (prev_name) { struct name *p = hash_lookup (nametab, name); if (p) { if (!name->parent) { if (p->child) rebase_child_list (p->child, name); hash_remove (nametab, name); remname (p); free_name (p); num_names--; } else { if (name->child) rebase_child_list (name->child, p); remname (name); free_name (name); continue; } } } name->found_count = 0; if (!hash_insert (nametab, name)) xalloc_die (); prev_name = name; num_names++; } nametail = prev_name; hash_free (nametab); namelist = merge_sort (namelist, num_names, compare_names_found); if (listed_incremental_option) { for (name = namelist; name && name->name[0] == 0; name = name->next) ; if (name) append_incremental_renames (name->directory); } }
unsigned long collect_and_sort_names(const char *a1, long a2) { int v2; char *v3; char *v4; int v6; int v7; int fd; long v9; long i; long j; long v12; long v13; long v14; long *v15; long v16[11]; struct stat v17[2]; int v18; unsigned long v19; v19 = __readfsqword(0x28u); v12 = 0LL; name_gather(); if ( !namelist ) { a2 = 0LL; a1 = "."; addname(".", 0, 0, 0LL); } if ( !listed_incremental_option ) goto LABEL_14; v2 = chdir_count(a1, a2); if ( v2 ) { if ( v2 != 1 ) { LABEL_10: if ( error_hook ) error_hook(); v4 = gettext("Only one -C option is allowed with --listed-incremental"); error(0, 0, v4); usage(2LL); goto LABEL_13; } if ( !*(_DWORD *)(namelist + 40) ) { if ( error_hook ) error_hook(); v3 = gettext("Using -C option inside file list is not allowed with --listed-incremental"); error(0, 0, v3); usage(2LL); goto LABEL_10; } } LABEL_13: read_directory_file(); LABEL_14: v6 = 0; v9 = namelist; while ( v9 ) { if ( !*(_QWORD *)(v9 + 48) && !*(_QWORD *)(v9 + 56) && (*(_DWORD *)(v9 + 32) & 0x10000000) == 0 ) { chdir_do(*(unsigned int *)(v9 + 40)); if ( **(_BYTE **)(v9 + 16) ) { tar_stat_init(v16); if ( (unsigned int)deref_stat(*(_QWORD *)(v9 + 16), v17) ) { stat_diag(*(_QWORD *)(v9 + 16)); } else { if ( (v17[0].st_mode & 0xF000) == 0x4000 ) { fd = openat(chdir_fd, *(const char **)(v9 + 16), open_read_flags | 0x10000); if ( fd >= 0 ) { v18 = fd; if ( fstat(fd, v17) ) { stat_diag(*(_QWORD *)(v9 + 16)); } else { v16[0] = xstrdup(*(_QWORD *)(v9 + 16)); ++*(_QWORD *)(v9 + 48); add_hierarchy_to_namelist((long)v16, v9); } } else { open_diag(*(_QWORD *)(v9 + 16)); } } tar_stat_destroy(v16); } } } v9 = *(_QWORD *)v9; ++v6; } namelist = (long)merge_sort((long *)namelist, v6, (int ( *)(long *, long))compare_names); v7 = 0; v13 = hash_initialize(0LL, 0LL, name_hash, name_compare, 0LL); for ( i = namelist; i; i = v14 ) { v14 = *(_QWORD *)i; *(_QWORD *)(i + 88) = normalize_filename(*(unsigned int *)(i + 40), *(_QWORD *)(i + 16)); if ( !v12 ) goto LABEL_40; v15 = (long *)hash_lookup(v13, i); if ( !v15 ) goto LABEL_40; if ( !*(_QWORD *)(i + 64) ) { if ( v15[9] ) rebase_child_list(v15[9], i); hash_remove(v13, i); remname(v15); free_name((void **)v15); --v7; LABEL_40: *(_QWORD *)(i + 48) = 0LL; if ( !hash_insert(v13, i) ) xalloc_die(); v12 = i; ++v7; continue; } if ( *(_QWORD *)(i + 72) ) rebase_child_list(*(_QWORD *)(i + 72), (long)v15); remname((long *)i); free_name((void **)i); } nametail = v12; hash_free(v13); namelist = (long)merge_sort((long *)namelist, v7, (int ( *)(long *, long))compare_names_found); if ( listed_incremental_option ) { for ( j = namelist; j && !**(_BYTE **)(j + 16); j = *(_QWORD *)j ) ; if ( j ) append_incremental_renames(*(_QWORD *)(j + 56)); } return __readfsqword(0x28u) ^ v19; }
static int ipstats_dump(struct ipstats_stat_enabled *enabled) { int rc = 0; if (rtnl_statsdump_req_filter(&rth, 0 , 0, ipstats_req_add_filters, enabled) < 0) { perror("Cannot send dump request"); return -2; } if (rtnl_dump_filter_nc(&rth, ipstats_dump_one, enabled, 0) < 0) { fprintf( stderr , "Dump terminated\n"); rc = -2; } fflush( stdout ); return rc; }
long ipstats_dump(long a1) { unsigned int v2; v2 = 0; if ( (int)rtnl_statsdump_req_filter(&rth, 0LL, 0LL, ipstats_req_add_filters, a1) >= 0 ) { if ( (int)rtnl_dump_filter_nc(&rth, ipstats_dump_one, a1, 0LL) < 0 ) { fprintf(stderr, "Dump terminated\n"); v2 = -2; } fflush(stdout); return v2; } else { perror("Cannot send dump request"); return 4294967294LL; } }
int _ssh_read_banner(struct ssh *ssh, struct sshbuf *banner) { struct sshbuf *input = ssh_packet_get_input(ssh); const char *mismatch = "Protocol mismatch.\r\n"; const u_char *s = sshbuf_ptr(input); u_char c; char *cp = ((void *)0) , *remote_version = ((void *)0) ; int r = 0, remote_major, remote_minor, expect_nl; size_t n, j; for (j = n = 0;;) { sshbuf_reset(banner); expect_nl = 0; for (;;) { if (j >= sshbuf_len(input)) return 0; c = s[j++]; if (c == '\r') { expect_nl = 1; continue; } if (c == '\n') break; if (expect_nl) goto bad; if ((r = sshbuf_put_u8(banner, c)) != 0) return r; if (sshbuf_len(banner) > 8192) goto bad; } if (sshbuf_len(banner) >= 4 && memcmp(sshbuf_ptr(banner), "SSH-", 4) == 0) break; sshlog("ssh_api.c", __func__, 358, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "%.*s", (int)sshbuf_len(banner), sshbuf_ptr(banner)) ; if (ssh->kex->server || ++n > 1024) { bad: if ((r = sshbuf_put(ssh_packet_get_output(ssh), mismatch, strlen(mismatch))) != 0) return r; return -38; } } if ((r = sshbuf_consume(input, j)) != 0) return r; if ((cp = sshbuf_dup_string(banner)) == ((void *)0) || (remote_version = calloc(1, sshbuf_len(banner))) == ((void *)0) ) { r = -2; goto out; } if (sscanf(cp, "SSH-%d.%d-%[^\n]\n", &remote_major, &remote_minor, remote_version) != 3) { r = -4; goto out; } sshlog("ssh_api.c", __func__, 388, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Remote protocol version %d.%d, remote software version %.100s", remote_major, remote_minor, remote_version) ; compat_banner(ssh, remote_version); if (remote_major == 1 && remote_minor == 99) { remote_major = 2; remote_minor = 0; } if (remote_major != 2) r = -37; sshlog("ssh_api.c", __func__, 399, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Remote version string %.100s", cp); out: free(cp); free(remote_version); return r; }
int _ssh_read_banner(long param_1,undefined8 param_2) { char cVar1; int iVar2; ulong uVar3; void *__s1; undefined8 uVar4; size_t sVar5; undefined8 uVar6; long in_FS_OFFSET; undefined8 uVar7; int local_68; int local_64; int local_60; int local_5c; void *local_58; ulong local_50; ulong local_48; undefined8 local_40; char *local_38; long local_30; void *local_28; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_40 = ssh_packet_get_input(param_1); local_38 = "Protocol mismatch.\r\n"; local_30 = sshbuf_ptr(local_40); local_28 = (void *)0x0; local_58 = (void *)0x0; local_60 = 0; local_50 = 0; local_48 = 0; do { sshbuf_reset(param_2); local_5c = 0; while( true ) { while( true ) { uVar3 = sshbuf_len(local_40); if (uVar3 <= local_48) { iVar2 = 0; goto LAB_00100e2b; } uVar3 = local_48 + 1; cVar1 = *(char *)(local_48 + local_30); local_48 = uVar3; if (cVar1 != '\r') break; local_5c = 1; } if (cVar1 == '\n') break; if (local_5c != 0) goto LAB_00100c5f; local_60 = sshbuf_put_u8(param_2,cVar1); iVar2 = local_60; if (local_60 != 0) goto LAB_00100e2b; uVar3 = sshbuf_len(param_2); if (0x2000 < uVar3) goto LAB_00100c5f; } uVar3 = sshbuf_len(param_2); if (3 < uVar3) { __s1 = (void *)sshbuf_ptr(param_2); iVar2 = memcmp(__s1,&DAT_00101bc2,4); if (iVar2 == 0) { local_60 = sshbuf_consume(local_40,local_48); iVar2 = local_60; if (local_60 == 0) { local_28 = (void *)sshbuf_dup_string(param_2); if (local_28 == (void *)0x0) { LAB_00100d0a: local_60 = -2; } else { sVar5 = sshbuf_len(param_2); local_58 = calloc(1,sVar5); if (local_58 == (void *)0x0) goto LAB_00100d0a; iVar2 = __isoc99_sscanf(local_28,"SSH-%d.%d-%[^\n]\n",&local_68,&local_64,local_58); if (iVar2 == 3) { sshlog("ssh_api.c","_ssh_read_banner",0x184,0,5,0, "Remote protocol version %d.%d, remote software version %.100s",local_68, local_64,local_58); compat_banner(param_1,local_58); if ((local_68 == 1) && (local_64 == 99)) { local_68 = 2; local_64 = 0; } if (local_68 != 2) { local_60 = -0x25; } sshlog("ssh_api.c","_ssh_read_banner",399,0,5,0,"Remote version string %.100s", local_28); } else { local_60 = -4; } } free(local_28); free(local_58); iVar2 = local_60; } goto LAB_00100e2b; } } uVar6 = sshbuf_ptr(param_2); uVar7 = 0x100bf4; uVar4 = sshbuf_len(param_2); sshlog("ssh_api.c","_ssh_read_banner",0x166,1,5,0,&DAT_00101bd1,uVar4,uVar6,uVar7); } while ((*(int *)(*(long *)(param_1 + 8) + 0x18) == 0) && (local_50 = local_50 + 1, local_50 < 0x401)); LAB_00100c5f: sVar5 = strlen(local_38); uVar6 = ssh_packet_get_output(param_1); local_60 = sshbuf_put(uVar6,local_38,sVar5); iVar2 = local_60; if (local_60 == 0) { iVar2 = -0x26; } LAB_00100e2b: if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return iVar2; } __stack_chk_fail(); }
void Blowfish_expand0state(blf_ctx *c, const u_int8_t *key, u_int16_t keybytes) { u_int16_t i; u_int16_t j; u_int16_t k; u_int32_t temp; u_int32_t datal; u_int32_t datar; j = 0; for (i = 0; i < 16 + 2; i++) { temp = Blowfish_stream2word(key, keybytes, &j); c->P[i] = c->P[i] ^ temp; } j = 0; datal = 0x00000000; datar = 0x00000000; for (i = 0; i < 16 + 2; i += 2) { Blowfish_encipher(c, &datal, &datar); c->P[i] = datal; c->P[i + 1] = datar; } for (i = 0; i < 4; i++) { for (k = 0; k < 256; k += 2) { Blowfish_encipher(c, &datal, &datar); c->S[i][k] = datal; c->S[i][k + 1] = datar; } } }
void Blowfish_expand0state(long param_1,undefined8 param_2,undefined2 param_3) { ushort uVar1; int iVar2; long in_FS_OFFSET; undefined2 local_32; ushort local_30; ushort local_2e; undefined4 local_2c; undefined4 local_28; uint local_24; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_32 = 0; for (local_30 = 0; local_30 < 0x12; local_30 = local_30 + 1) { local_24 = Blowfish_stream2word(param_2,param_3,&local_32); *(uint *)(param_1 + ((long)(int)(uint)local_30 + 0x400) * 4) = *(uint *)(param_1 + ((long)(int)(uint)local_30 + 0x400) * 4) ^ local_24; } local_32 = 0; local_2c = 0; local_28 = 0; for (local_30 = 0; local_30 < 0x12; local_30 = local_30 + 2) { Blowfish_encipher(param_1,&local_2c,&local_28); *(undefined4 *)(param_1 + ((long)(int)(uint)local_30 + 0x400) * 4) = local_2c; iVar2 = __addvsi3(local_30,1); *(undefined4 *)(param_1 + ((long)iVar2 + 0x400) * 4) = local_28; } for (local_30 = 0; local_30 < 4; local_30 = local_30 + 1) { for (local_2e = 0; local_2e < 0x100; local_2e = local_2e + 2) { Blowfish_encipher(param_1,&local_2c,&local_28); uVar1 = local_30; *(undefined4 *)(param_1 + ((long)(int)(uint)local_2e + (long)(int)(uint)local_30 * 0x100) * 4) = local_2c; iVar2 = __addvsi3(local_2e,1); *(undefined4 *)(param_1 + ((long)iVar2 + (long)(int)(uint)uVar1 * 0x100) * 4) = local_28; } } if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
int addr_sa_to_xaddr(struct sockaddr *sa, socklen_t slen, struct xaddr *xa) { struct sockaddr_in *in4 = (struct sockaddr_in *)sa; struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)sa; memset(xa, '\0', sizeof(*xa)); switch (sa->sa_family) { case 2 : if (slen < (socklen_t)sizeof(*in4)) return -1; xa->af = 2 ; memcpy(&xa->xa.v4, &in4->sin_addr, sizeof(xa->xa.v4)); break; case 10 : if (slen < (socklen_t)sizeof(*in6)) return -1; xa->af = 10 ; memcpy(&xa->xa.v6, &in6->sin6_addr, sizeof(xa->xa.v6)); xa->scope_id = in6->sin6_scope_id; break; default: return -1; } return 0; }
undefined8 addr_sa_to_xaddr(short *param_1,uint param_2,undefined2 *param_3) { memset(param_3,0,0x18); if (*param_1 == 2) { if (param_2 < 0x10) { return 0xffffffff; } *param_3 = 2; memcpy(param_3 + 2,param_1 + 2,4); } else { if (*param_1 != 10) { return 0xffffffff; } if (param_2 < 0x1c) { return 0xffffffff; } *param_3 = 10; memcpy(param_3 + 2,param_1 + 4,0x10); *(undefined4 *)(param_3 + 10) = *(undefined4 *)(param_1 + 0xc); } return 0; }
int unbind_function_def (name) const char *name; { BUCKET_CONTENTS *elt; FUNCTION_DEF *funcdef; elt = hash_remove (name, shell_function_defs, 0); if (elt == 0) return -1; funcdef = (FUNCTION_DEF *)elt->data; if (funcdef) dispose_function_def (funcdef); sh_xfree((elt->key), "variables.c", 3941); sh_xfree((elt), "variables.c", 3942); return 0; }
undefined8 unbind_function_def(undefined8 param_1) { long lVar1; undefined8 uVar2; lVar1 = hash_remove(param_1,shell_function_defs,0); if (lVar1 == 0) { uVar2 = 0xffffffff; } else { if (*(long *)(lVar1 + 0x10) != 0) { dispose_function_def(*(long *)(lVar1 + 0x10)); } sh_xfree(*(undefined8 *)(lVar1 + 8),"variables.c",0xf65); sh_xfree(lVar1,"variables.c",0xf66); uVar2 = 0; } return uVar2; }
&& (source_stats.st_nlink == 1 || same_nameat ( -100 , source, destdir_fd, dest_base))) { error (0, 0, gettext ("%s and %s are the same file"), quotearg_n_style (0, shell_escape_always_quoting_style, source), quotearg_n_style (1, shell_escape_always_quoting_style, dest)); goto fail; }
void same_nameat(void) { halt_baddata(); }
void * x2realloc (void *p, size_t *pn) { return x2nrealloc (p, pn, 1); }
long long x2realloc(void* a0, unsigned long long *a1) { return x2nrealloc(a0, a1, 0x1); }
static void xwrite_stdout (char const *buffer, size_t n_bytes) { if (n_bytes > 0 && fwrite_unlocked (buffer,1,n_bytes, stdout ) < n_bytes) { clearerr_unlocked ( stdout ); ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"error writing %s\"), quotearg_style (shell_escape_always_quoting_style, \"standard output\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , gettext ("error writing %s"), quotearg_style (shell_escape_always_quoting_style, "standard output")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , gettext ("error writing %s"), quotearg_style (shell_escape_always_quoting_style, "standard output")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; } }
void xwrite_stdout(const void *a1, size_t a2) { long v2; char *v3; int *v4; if ( a2 ) { if ( a2 > fwrite_unlocked(a1, 1uLL, a2, stdout) ) { clearerr_unlocked(stdout); v2 = quotearg_style(4LL, "standard output"); v3 = gettext("error writing %s"); v4 = _errno_location(); error(1, *v4, v3, v2); } } }
char * find_in_path (name, path_list, flags) const char *name; char *path_list; int flags; { return (find_user_command_in_path (name, path_list, flags, (int *)0)); }
long long find_in_path(char *a0, char *a1, unsigned long a2) { return find_user_command_in_path(a0, a1, a2, NULL); }
char * rl_copy_text (int from, int to) { register int length; char *copy; if (from > to) do { int t; t = from; from = to; to = t; } while (0); length = to - from; copy = (char *)xmalloc (1 + length); strncpy (copy, rl_line_buffer + from, length); copy[length] = '\0'; return (copy); }
char * rl_copy_text(int param_1,int param_2) { char *__dest; int local_30; int local_2c; local_30 = param_2; local_2c = param_1; if (param_2 < param_1) { local_30 = param_1; local_2c = param_2; } local_30 = local_30 - local_2c; __dest = (char *)xmalloc((long)(local_30 + 1)); strncpy(__dest,(char *)(rl_line_buffer + local_2c),(long)local_30); __dest[local_30] = '\0'; return __dest; }
static _Bool reset (int fd, struct stat const *st) { bufbeg = buflim = ((uintptr_t) (buffer + 1) % (pagesize) == 0 ? (buffer + 1) : (buffer + 1) + ((pagesize) - (uintptr_t) (buffer + 1) % (pagesize))); bufbeg[-1] = eolbyte; bufdesc = fd; bufoffset = fd == 0 ? lseek (fd, 0, 1 ) : 0; seek_failed = bufoffset < 0; seek_data_failed = seek_failed; if (seek_failed) { if ( (*__errno_location ()) != 29 ) { suppressible_error ( (*__errno_location ()) ); return 0 ; } bufoffset = 0; } return 1 ; }
int reset(unsigned long a0, unsigned long a1) { unsigned long v0; unsigned long long v2; unsigned long v3; v0 = a1; if (!(0 CONCAT buffer + 1) /m pagesize >> 64) v2 = buffer + 1; else v2 = pagesize - ((0 CONCAT buffer + 1) /m pagesize >> 64) + 1 + buffer; buflim = v2; bufbeg = buflim; *((bufbeg - 1)) = eolbyte; bufdesc = a0; if (!a0) v3 = lseek(a0, 0x0, 0x1); else v3 = 0; bufoffset = v3; seek_failed = bufoffset >> 63; seek_data_failed = seek_failed; if (seek_failed) { *(&v3) = *(__errno_location()); if (v3 != 29) { suppressible_error(*(__errno_location())); *(&v3) = 0; } else { bufoffset = 0; } } if (v3 == 29 || !seek_failed) *(&v3) = 1; return v3; }
int sshpkt_put(struct ssh *ssh, const void *v, size_t len) { return sshbuf_put(ssh->state->outgoing_packet, v, len); }
long long sshpkt_put(struct struct_0 **a0, unsigned long long a1, unsigned long long a2) { return sshbuf_put(*(a0)->field_30, a1, a2, a1); }
static void explain(void) { print_explain( stderr ); }
void explain(void) { print_explain(stderr); return; }
void sh_neednumarg (s) char *s; { builtin_error (gettext("%s: numeric argument required"), s); }
void sh_neednumarg(unsigned long a0) { unsigned long v0; unsigned long long v2; v0 = a0; gettext("%s: numeric argument required"); v2 = builtin_error(); return; }
const char *get_proxy_policy(char **policy, size_t * policylen) { const char *ret; if (batch) { ret = cfg.proxy_policy_language; if (!ret) ret = "1.3.6.1.5.5.7.21.1"; } else { do { ret = read_str ("Enter the OID of the proxy policy language: "); } while (ret == ((void *)0) ); } *policy = ((void *)0) ; *policylen = 0; if (strcmp(ret, "1.3.6.1.5.5.7.21.1") != 0 && strcmp(ret, "1.3.6.1.5.5.7.21.2") != 0) { fprintf( stderr , "Reading non-standard proxy policy not supported.\n"); } return ret; }
char * get_proxy_policy(undefined8 *param_1,undefined8 *param_2) { int iVar1; char *local_10; if (*piRam0000000000109211 == 0) { do { local_10 = (char *)read_str("Enter the OID of the proxy policy language: "); } while (local_10 == (char *)0x0); } else { local_10 = *(char **)(lRam000000000010921e + 0x280); if (local_10 == (char *)0x0) { local_10 = "1.3.6.1.5.5.7.21.1"; } } *param_1 = 0; *param_2 = 0; iVar1 = strcmp(local_10,"1.3.6.1.5.5.7.21.1"); if (iVar1 != 0) { iVar1 = strcmp(local_10,"1.3.6.1.5.5.7.21.2"); if (iVar1 != 0) { fprintf(*ppFRam000000000010929f,"Reading non-standard proxy policy not supported.\n"); } } return local_10; }
void usage (int status) { if (status != 0) { fprintf ( stderr , gettext("Usage: %s [OPTION]... PATTERNS [FILE]...\n"), getprogname ()); fprintf ( stderr , gettext("Try '%s --help' for more information.\n"), getprogname ()); } else { printf (gettext("Usage: %s [OPTION]... PATTERNS [FILE]...\n"), getprogname ()); printf (gettext("Search for PATTERNS in each FILE.\n")); printf (gettext("Example: %s -i 'hello world' menu.h main.c\nPATTERNS can contain multiple patterns separated by newlines.\n\nPattern selection and interpretation:\n") , getprogname ()); printf (gettext(" -E, --extended-regexp PATTERNS are extended regular expressions\n -F, --fixed-strings PATTERNS are strings\n -G, --basic-regexp PATTERNS are basic regular expressions\n -P, --perl-regexp PATTERNS are Perl regular expressions\n") ); printf (gettext(" -e, --regexp=PATTERNS use PATTERNS for matching\n -f, --file=FILE take PATTERNS from FILE\n -i, --ignore-case ignore case distinctions in patterns and data\n --no-ignore-case do not ignore case distinctions (default)\n -w, --word-regexp match only whole words\n -x, --line-regexp match only whole lines\n -z, --null-data a data line ends in 0 byte, not newline\n") ); printf (gettext("\nMiscellaneous:\n -s, --no-messages suppress error messages\n -v, --invert-match select non-matching lines\n -V, --version display version information and exit\n --help display this help text and exit\n") ); printf (gettext("\nOutput control:\n -m, --max-count=NUM stop after NUM selected lines\n -b, --byte-offset print the byte offset with output lines\n -n, --line-number print line number with output lines\n --line-buffered flush output on every line\n -H, --with-filename print file name with output lines\n -h, --no-filename suppress the file name prefix on output\n --label=LABEL use LABEL as the standard input file name prefix\n") ); printf (gettext(" -o, --only-matching show only nonempty parts of lines that match\n -q, --quiet, --silent suppress all normal output\n --binary-files=TYPE assume that binary files are TYPE;\n TYPE is 'binary', 'text', or 'without-match'\n -a, --text equivalent to --binary-files=text\n") ); printf (gettext(" -I equivalent to --binary-files=without-match\n -d, --directories=ACTION how to handle directories;\n ACTION is 'read', 'recurse', or 'skip'\n -D, --devices=ACTION how to handle devices, FIFOs and sockets;\n ACTION is 'read' or 'skip'\n -r, --recursive like --directories=recurse\n -R, --dereference-recursive likewise, but follow all symlinks\n") ); printf (gettext(" --include=GLOB search only files that match GLOB (a file pattern)" "\n --exclude=GLOB skip files that match GLOB\n --exclude-from=FILE skip files that match any file pattern from FILE\n --exclude-dir=GLOB skip directories that match GLOB\n") ); printf (gettext(" -L, --files-without-match print only names of FILEs with no selected lines\n -l, --files-with-matches print only names of FILEs with selected lines\n -c, --count print only a count of selected lines per FILE\n -T, --initial-tab make tabs line up (if needed)\n -Z, --null print 0 byte after FILE name\n") ); printf (gettext("\nContext control:\n -B, --before-context=NUM print NUM lines of leading context\n -A, --after-context=NUM print NUM lines of trailing context\n -C, --context=NUM print NUM lines of output context\n") ); printf (gettext(" -NUM same as --context=NUM\n --group-separator=SEP print SEP on line between matches with context\n --no-group-separator do not print separator for matches with context\n --color[=WHEN],\n --colour[=WHEN] use markers to highlight the matching strings;\n WHEN is 'always', 'never', or 'auto'\n -U, --binary do not strip CR characters at EOL (MSDOS/Windows)\n\n") ); printf (gettext("When FILE is '-', read standard input. With no FILE, read '.' if\nrecursive, '-' otherwise. With fewer than two FILEs, assume -h.\nExit status is 0 if any line is selected, 1 otherwise;\nif any error occurs and -q is not given, the exit status is 2.\n") ); emit_bug_reporting_address (); } exit (status); }
void usage(unsigned long long a0) { unsigned long v0; unsigned long v2; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long long v7; unsigned long long v8; unsigned long long v9; unsigned long long v10; v0 = v2; if (a0) { v4 = getprogname(); fprintf(stderr, gettext("Usage: %s [OPTION]... PATTERNS [FILE]...\n")); v5 = getprogname(); fprintf(stderr, gettext("Try '%s --help' for more information.\n")); } else { v3 = getprogname(); printf(gettext("Usage: %s [OPTION]... PATTERNS [FILE]...\n")); printf(gettext("Search for PATTERNS in each FILE.\n")); printf(gettext("Example: %s -i 'hello world' menu.h main.c\nPATTERNS can contain multiple patterns separated by newlines.\n\nPattern selection and interpretation:\n")); printf(gettext(" -E, --extended-regexp PATTERNS are extended regular expressions\n -F, --fixed-strings PATTERNS are strings\n -G, --basic-regexp PATTERNS are basic regular expressions\n -P, --perl-regexp PATTERNS are Perl regular expressions\n")); printf(gettext(" -e, --regexp=PATTERNS use PATTERNS for matching\n -f, --file=FILE take PATTERNS from FILE\n -i, --ignore-case ignore case distinctions in patterns and data\n --no-ignore-case do not ignore case distinctions (default)\n -w, --word-regexp match only whole words\n -x, --line-regexp match only whole lines\n -z, --null-data a data line ends in 0 byte, not newline\n")); printf(gettext("\nMiscellaneous:\n -s, --no-messages suppress error messages\n -v, --invert-match select non-matching lines\n -V, --version display version information and exit\n --help display this help text and exit\n")); printf(gettext("\nOutput control:\n -m, --max-count=NUM stop after NUM selected lines\n -b, --byte-offset print the byte offset with output lines\n -n, --line-number print line number with output lines\n --line-buffered flush output on every line\n -H, --with-filename print file name with output lines\n -h, --no-filename suppress the file name prefix on output\n --label=LABEL use LABEL as the standard input file name prefix\n")); printf(gettext(" -o, --only-matching show only nonempty parts of lines that match\n -q, --quiet, --silent suppress all normal output\n --binary-files=TYPE assume that binary files are TYPE;\n TYPE is 'binary', 'text', or 'without-match'\n -a, --text equivalent to --binary-files=text\n")); printf(gettext(" -I equivalent to --binary-files=without-match\n -d, --directories=ACTION how to handle directories;\n ACTION is 'read', 'recurse', or 'skip'\n -D, --devices=ACTION how to handle devices, FIFOs and sockets;\n ACTION is 'read' or 'skip'\n -r, --recursive like --directories=recurse\n -R, --dereference-recursive likewise, but follow all symlinks\n")); printf(gettext(" --include=GLOB search only files that match GLOB (a file pattern)\n --exclude=GLOB skip files that match GLOB\n --exclude-from=FILE skip files that match any file pattern from FILE\n --exclude-dir=GLOB skip directories that match GLOB\n")); printf(gettext(" -L, --files-without-match print only names of FILEs with no selected lines\n -l, --files-with-matches print only names of FILEs with selected lines\n -c, --count print only a count of selected lines per FILE\n -T, --initial-tab make tabs line up (if needed)\n -Z, --null print 0 byte after FILE name\n")); printf(gettext("\nContext control:\n -B, --before-context=NUM print NUM lines of leading context\n -A, --after-context=NUM print NUM lines of trailing context\n -C, --context=NUM print NUM lines of output context\n")); printf(gettext(" -NUM same as --context=NUM\n --group-separator=SEP print SEP on line between matches with context\n --no-group-separator do not print separator for matches with context\n --color[=WHEN],\n --colour[=WHEN] use markers to highlight the matching strings;\n WHEN is 'always', 'never', or 'auto'\n -U, --binary do not strip CR characters at EOL (MSDOS/Windows)\n\n")); printf(gettext("When FILE is '-', read standard input. With no FILE, read '.' if\nrecursive, '-' otherwise. With fewer than two FILEs, assume -h.\nExit status is 0 if any line is selected, 1 otherwise;\nif any error occurs and -q is not given, the exit status is 2.\n")); emit_bug_reporting_address(a0, getprogname(), v7, v8, v9, v10); } exit(a0); }
static char const * df_readable ( _Bool negative, uintmax_t n, char *buf, uintmax_t input_units, uintmax_t output_units) { if (! known_value (n) && !negative) return "-"; else { char *p = human_readable (negative ? -n : n, buf + negative, human_output_opts, input_units, output_units); if (negative) *--p = '-'; return p; } }
const char * df_readable(unsigned char a1, signed long a2, long a3, long a4, long a5) { long v6; long v10; if ( !known_value(a2) && a1 != 1 ) return "-"; if ( a1 ) v6 = -a2; else v6 = a2; v10 = human_readable(v6, a1 + a3, (unsigned int)human_output_opts, a4, a5); if ( a1 ) *(_BYTE *)--v10 = 45; return (const char *)v10; }
int export_dns_rr(const char *hostname, struct sshkey *key, FILE *f, int generic) { u_int8_t rdata_pubkey_algorithm = 0; u_int8_t rdata_digest_type = SSHFP_HASH_RESERVED; u_int8_t dtype; u_char *rdata_digest; size_t i, rdata_digest_len; int success = 0; for (dtype = SSHFP_HASH_SHA1; dtype < SSHFP_HASH_MAX; dtype++) { rdata_digest_type = dtype; if (dns_read_key(&rdata_pubkey_algorithm, &rdata_digest_type, &rdata_digest, &rdata_digest_len, key)) { if (generic) { fprintf(f, "%s IN TYPE%d \\# %zu %02x %02x ", hostname, 44, 2 + rdata_digest_len, rdata_pubkey_algorithm, rdata_digest_type); } else { fprintf(f, "%s IN SSHFP %d %d ", hostname, rdata_pubkey_algorithm, rdata_digest_type); } for (i = 0; i < rdata_digest_len; i++) fprintf(f, "%02x", rdata_digest[i]); fprintf(f, "\n"); free(rdata_digest); success = 1; } } if (success == 0) { sshlog("dns.c", __func__, 336, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "unsupported algorithm and/or digest_type"); } return success; }
long export_dns_rr(const char *a1, _DWORD *a2, FILE *a3, int a4) { unsigned char v7; unsigned char v8; unsigned char i; unsigned int v10; void *ptr; unsigned long v12; unsigned long j; unsigned long v14; v14 = __readfsqword(0x28u); v7 = 0; v8 = 0; v10 = 0; for ( i = 1; i <= 2u; ++i ) { v8 = i; if ( (unsigned int)dns_read_key(&v7, &v8, &ptr, &v12, a2) ) { if ( a4 ) fprintf(a3, "%s IN TYPE%d \\# %zu %02x %02x ", a1, 44LL, v12 + 2, v7, v8); else fprintf(a3, "%s IN SSHFP %d %d ", a1, v7, v8); for ( j = 0LL; j < v12; ++j ) fprintf(a3, "%02x", *((unsigned char *)ptr + j)); fprintf(a3, "\n"); free(ptr); v10 = 1; } } if ( !v10 ) sshlog("dns.c", "export_dns_rr", 336LL, 1LL, 2LL, 0LL, "unsupported algorithm and/or digest_type"); return v10; }
static int send_pubkey_test(struct ssh *ssh, Identity *id) { Authctxt *authctxt = (Authctxt *)ssh->authctxt; u_char *blob = ((void *)0) ; char *alg = ((void *)0) ; size_t bloblen; u_int have_sig = 0; int sent = 0, r; if ((alg = key_sig_algorithm(ssh, id->key)) == ((void *)0) ) { sshlog("sshconnect2.c", __func__, 1526, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "no mutual signature algorithm"); goto out; } if ((r = sshkey_to_blob(id->key, &blob, &bloblen)) != 0) { sshlog("sshconnect2.c", __func__, 1532, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "cannot handle key"); goto out; } ssh_dispatch_set(ssh, 60, &input_userauth_pk_ok); if ((r = sshpkt_start(ssh, 50)) != 0 || (r = sshpkt_put_cstring(ssh, authctxt->server_user)) != 0 || (r = sshpkt_put_cstring(ssh, authctxt->service)) != 0 || (r = sshpkt_put_cstring(ssh, authctxt->method->name)) != 0 || (r = sshpkt_put_u8(ssh, have_sig)) != 0 || (r = sshpkt_put_cstring(ssh, alg)) != 0 || (r = sshpkt_put_string(ssh, blob, bloblen)) != 0 || (r = sshpkt_send(ssh)) != 0) sshfatal("sshconnect2.c", __func__, 1546, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "send packet"); sent = 1; out: free(alg); free(blob); return sent; }
int send_pubkey_test(struct_0 *a0, struct_1 *a1) { unsigned int v0; unsigned int v1; unsigned int v2; void* v3; char v4; struct_2 *v5; void* v6; v5 = a0->field_860; v3 = 0; v6 = 0; v2 = 0; v0 = 0; v6 = key_sig_algorithm(a0, a1->field_18); if (!v6) { sshlog("sshconnect2.c", "send_pubkey_test", 0x5f6, 0x1, 0x5, 0x0, "no mutual signature algorithm"); } else { v1 = sshkey_to_blob(a1->field_18, &v3, &v4, &v3); if (v1) { sshlog("sshconnect2.c", "send_pubkey_test", 0x5fc, 0x1, 0x7, 0x0, "cannot handle key"); } else { ssh_dispatch_set(a0, 0x3c, input_userauth_pk_ok); v1 = sshpkt_start(a0, 0x32); if (!v1) { v1 = sshpkt_put_cstring(a0, v5->field_0); if (!v1) { v1 = sshpkt_put_cstring(a0, v5->field_18); if (!v1) { v1 = sshpkt_put_cstring(a0, v5->field_20->field_0); if (!v1) { v1 = sshpkt_put_u8(a0, v2); if (!v1) { v1 = sshpkt_put_cstring(a0, v6); if (!v1) { v1 = sshpkt_put_string(a0, v3, *(&v4), v3); if (!v1) { v1 = sshpkt_send(a0); if (!v1) goto LABEL_403ce7; } } } } } } } sshfatal("sshconnect2.c", "send_pubkey_test", 0x60a, 0x1, 0x1, ssh_err(v1)); LABEL_403ce7: v0 = 1; } } free(v6); free(v3); return v0; }
static int history_prev_string(HistoryW *h, HistEventW *ev, const wchar_t *str) { size_t len = wcslen(str); int retval; for (retval = (*(h)->h_curr)((h)->h_ref, ev); retval != -1; retval = (*(h)->h_next)((h)->h_ref, ev)) if (wcsncmp(str, ev->str, len) == 0) return 0; { ev->num = 9; ev->str = he_errlist[9]; }; return -1; }
long history_prev_string(_QWORD *a1, long a2, const wchar_t *a3) { int i; size_t n; n = wcslen(a3); for ( i = ((long ( *)(_QWORD, long))a1[6])(*a1, a2); i != -1; i = ((long ( *)(_QWORD, long))a1[3])(*a1, a2) ) { if ( !wcsncmp(a3, *(const wchar_t **)(a2 + 8), n) ) return 0LL; } *(_DWORD *)a2 = 9; *(_QWORD *)(a2 + 8) = "e"; return 0xFFFFFFFFLL; }
static struct name_elt * name_next_elt (int change_dirs) { static struct name_elt entry; struct name_elt *ep; while ((ep = name_head) != ((void *)0) ) { switch (ep->type) { case NELT_NOOP: name_list_advance (); break; case NELT_FILE: if (read_next_name (ep, &entry) == 0) return &entry; continue; case NELT_CHDIR: if (change_dirs) { chdir_do (chdir_arg (xstrdup (ep->v.name))); name_list_advance (); break; } __attribute__ ((__fallthrough__)); case NELT_NAME: copy_name (ep); if (unquote_option) unquote_string (name_buffer); entry.type = ep->type; entry.v.name = name_buffer; name_list_advance (); return &entry; case NELT_OPTION: handle_file_selection_option (ep->v.opt.rpl_option, ep->v.opt.arg); name_list_advance (); continue; } } unconsumed_option_report (); return ((void *)0) ; }
long long name_next_elt(unsigned long a0, unsigned long a1, unsigned long a2, unsigned int a3, unsigned long long a4, unsigned long long a5) { struct_0 *v0; unsigned long long v3; while (true) { v0 = name_head; if (v0) { switch (v0->field_10) { case 0: copy_name(v0); if (unquote_option) unquote_string(name_buffer); g_403690 = v0->field_10; g_403698 = name_buffer; name_list_advance(); v3 = &entry.7560; case 1: if (a0) { chdir_do(chdir_arg(xstrdup(*(&v0->field_18)))); name_list_advance(); break; } case 2: if (read_next_name(v0, &entry.7560, &g_4044f4, a3, a4, a5)) continue; v3 = &entry.7560; case 3: name_list_advance(); break; case 4: handle_file_selection_option(*(&v0->field_18), v0->field_20, v0->field_20, a3, a4, a5); name_list_advance(); break; } } else { unconsumed_option_report(); v3 = 0; break; } } return v3; }
Keymap rl_copy_keymap (Keymap map) { register int i; Keymap temp; temp = rl_make_bare_keymap (); for (i = 0; i < 257; i++) { temp[i].type = map[i].type; temp[i].function = map[i].function; } return (temp); }
long long rl_copy_keymap(void* a0) { void* v0; void* v2; v0 = rl_make_bare_keymap(); for (v2 = 0; v2 <= 0x100; v2 = v2 + 1) { *(v0 + 0x10 * v2) = *(a0 + 0x10 * v2); *((8 + v0 + 0x10 * v2)) = *((8 + a0 + 0x10 * v2)); } return v0; }
static void exit_cleanup (void) { if (temphead) { struct cs_status cs; cs_enter (&cs); cleanup (); cs_leave (&cs); } close_stdout (); }
void exit_cleanup(void) { EVP_PKEY_CTX *ctx; long in_FS_OFFSET; EVP_PKEY_CTX local_98 [136]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); if (temphead != 0) { ctx = local_98; cs_enter(); cleanup(ctx); cs_leave(local_98); } close_stdout(); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
inline void xset_binary_mode (int fd, int mode) { if (set_binary_mode (fd, mode) < 0) xset_binary_mode_error (); }
void xset_binary_mode(void) { halt_baddata(); }
int sshpkt_putb(struct ssh *ssh, const struct sshbuf *b) { return sshbuf_putb(ssh->state->outgoing_packet, b); }
long long sshpkt_putb(struct struct_0 **a0, unsigned long long a1) { return sshbuf_putb(*(a0)->field_30, a1, a1); }
static int flush_nexthop(struct nlmsghdr *nlh, void *arg) { struct nhmsg *nhm = ((void *)(((char *)nlh) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); struct rtattr *tb[(__NHA_MAX - 1)+1]; __u32 id = 0; int len; len = nlh->nlmsg_len - ( ((((sizeof(*nhm)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))))+4U -1) & ~(4U -1) ); if (len < 0) { fprintf( stderr , "BUG: wrong nlmsg len %d\n", len); return -1; } if (filter.proto && nhm->nh_protocol != filter.proto) return 0; parse_rtattr(tb, (__NHA_MAX - 1), ((struct rtattr *)(((char *)(nhm)) + ( ((sizeof(struct nhmsg))+4U -1) & ~(4U -1) ))), len); if (tb[NHA_ID]) id = rta_getattr_u32(tb[NHA_ID]); if (id && !delete_nexthop(id)) filter.flushed++; return 0; }
undefined8 flush_nexthop(int *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6) { uint uVar1; int iVar2; undefined8 uVar3; long in_FS_OFFSET; int local_98; undefined local_88 [8]; long local_80; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_98 = 0; uVar1 = *param_1 - 0x18; if ((int)uVar1 < 0) { fprintf(stderr,"BUG: wrong nlmsg len %d\n",(ulong)uVar1); uVar3 = 0xffffffff; } else if ((filter._16_4_ == 0) || (*(byte *)((long)param_1 + 0x12) == filter._16_4_)) { parse_rtattr(local_88,0xd,param_1 + 6,uVar1,param_5,param_6,param_2); if (local_80 != 0) { local_98 = rta_getattr_u32(local_80); } if (local_98 != 0) { iVar2 = delete_nexthop(local_98); if (iVar2 == 0) { filter._0_4_ = filter._0_4_ + 1; } } uVar3 = 0; } else { uVar3 = 0; } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar3; }
static void print_context_label (char const *mark, struct file_data *inf, char const *name, char const *label) { set_color_context (HEADER_CONTEXT); if (label) fprintf (outfile, "%s %s", mark, label); else { char buf[(((((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) + 32) >= ((((((sizeof (time_t) * 8) - (! ((__typeof__ (time_t)) 0 < (__typeof__ (time_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (time_t)) 0 < (__typeof__ (time_t)) -1))) + 11) ? ((((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) + 32) : ((((((sizeof (time_t) * 8) - (! ((__typeof__ (time_t)) 0 < (__typeof__ (time_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (time_t)) 0 < (__typeof__ (time_t)) -1))) + 11)) ]; struct tm const *tm = localtime (&inf->stat. st_mtim.tv_sec ); int nsec = get_stat_mtime_ns (&inf->stat); if (! (tm && nstrftime (buf, sizeof buf, time_format, tm, 0, nsec))) { _Static_assert (((time_t) 1.5 == 1), "verify (" "TYPE_IS_INTEGER (time_t)" ")"); if ( (-0x7fffffffffffffffL - 1L) <= ((time_t) ~ ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1)))) && ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))) <= 0x7fffffffffffffffL) { long int sec = inf->stat. st_mtim.tv_sec ; sprintf (buf, "%ld.%.9d", sec, nsec); } else if (((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))) <= (9223372036854775807L) ) { intmax_t sec = inf->stat. st_mtim.tv_sec ; sprintf (buf, "%" "l" "d" ".%.9d", sec, nsec); } else { uintmax_t sec = inf->stat. st_mtim.tv_sec ; sprintf (buf, "%" "l" "u" ".%.9d", sec, nsec); } } fprintf (outfile, "%s %s\t%s", mark, name, buf); } set_color_context (RESET_CONTEXT); putc_unlocked ('\n',outfile); }
void print_context_label(unsigned long a0, struct_0 *a1, unsigned long a2, unsigned long a3) { unsigned int v0; unsigned long long v1; unsigned long v2; char v3; char v4; unsigned long long *v6; unsigned long long v7; set_color_context(0x0); if (a3) { fprintf(*(&outfile), "%s %s", a0, a3); } else { v1 = localtime(&a1->field_68); v0 = get_stat_mtime_ns(&a1->padding_0[16]); if (!v1 || !nstrftime(&v3, 0x2b, time_format, v1, 0x0, v0)) { v2 = a1->field_68; sprintf(&v3, "%ld.%.9d", v2, v0); } fprintf(*(&outfile), "%s %s\t%s", a0, a2, &v3); } set_color_context(0x3); putc_unlocked(0xa, *(&outfile)); v7 = *(&v4) ^ v6[5]; return; }
static int ip6tunnel_parse_opt(struct link_util *lu, int argc, char **argv, struct nlmsghdr *n) { struct ifinfomsg *ifi = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); struct { struct nlmsghdr n; struct ifinfomsg i; } req = { .n.nlmsg_len = ((sizeof(*ifi)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))), .n.nlmsg_flags = 0x01, .n.nlmsg_type = RTM_GETLINK, .i.ifi_family = preferred_family, .i.ifi_index = ifi->ifi_index, }; struct nlmsghdr *answer; struct rtattr *tb[(__IFLA_MAX - 1) + 1]; struct rtattr *linkinfo[(__IFLA_INFO_MAX - 1)+1]; struct rtattr *iptuninfo[(__IFLA_IPTUN_MAX - 1) + 1]; int len; inet_prefix saddr, daddr; __u8 hop_limit = (64); __u8 encap_limit = 4; __u32 flowinfo = 0; __u32 flags = 0; __u8 proto = 0; __u32 link = 0; __u16 encaptype = 0; __u16 encapflags = (1<<1); __u16 encapsport = 0; __u16 encapdport = 0; __u8 metadata = 0; __u32 fwmark = 0; inet_prefix_reset(&saddr); inet_prefix_reset(&daddr); if (!(n->nlmsg_flags & 0x400)) { const struct rtattr *rta; if (rtnl_talk(&rth, &req.n, &answer) < 0) { get_failed: fprintf( stderr , "Failed to get existing tunnel info.\n"); return -1; } len = answer->nlmsg_len; len -= ((sizeof(*ifi)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))); if (len < 0) goto get_failed; parse_rtattr(tb, (__IFLA_MAX - 1), ((struct rtattr*)(((char*)(((void *)(((char *)answer) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))))) + ( ((sizeof(struct ifinfomsg))+4U -1) & ~(4U -1) ))), len); if (!tb[IFLA_LINKINFO]) goto get_failed; (parse_rtattr_flags((linkinfo), ((__IFLA_INFO_MAX - 1)), ((void*)(((char*)(tb[IFLA_LINKINFO])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((tb[IFLA_LINKINFO])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))); if (!linkinfo[IFLA_INFO_DATA]) goto get_failed; (parse_rtattr_flags((iptuninfo), ((__IFLA_IPTUN_MAX - 1)), ((void*)(((char*)(linkinfo[IFLA_INFO_DATA])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((linkinfo[IFLA_INFO_DATA])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))) ; rta = iptuninfo[IFLA_IPTUN_LOCAL]; if (rta && get_addr_rta(&saddr, rta, 10 )) goto get_failed; rta = iptuninfo[IFLA_IPTUN_REMOTE]; if (rta && get_addr_rta(&daddr, rta, 10 )) goto get_failed; if (iptuninfo[IFLA_IPTUN_TTL]) hop_limit = rta_getattr_u8(iptuninfo[IFLA_IPTUN_TTL]); if (iptuninfo[IFLA_IPTUN_ENCAP_LIMIT]) encap_limit = rta_getattr_u8(iptuninfo[IFLA_IPTUN_ENCAP_LIMIT]); if (iptuninfo[IFLA_IPTUN_FLOWINFO]) flowinfo = rta_getattr_u32(iptuninfo[IFLA_IPTUN_FLOWINFO]); if (iptuninfo[IFLA_IPTUN_FLAGS]) flags = rta_getattr_u32(iptuninfo[IFLA_IPTUN_FLAGS]); if (iptuninfo[IFLA_IPTUN_LINK]) link = rta_getattr_u32(iptuninfo[IFLA_IPTUN_LINK]); if (iptuninfo[IFLA_IPTUN_PROTO]) proto = rta_getattr_u8(iptuninfo[IFLA_IPTUN_PROTO]); if (iptuninfo[IFLA_IPTUN_COLLECT_METADATA]) metadata = 1; if (iptuninfo[IFLA_IPTUN_FWMARK]) fwmark = rta_getattr_u32(iptuninfo[IFLA_IPTUN_FWMARK]); free(answer); } while (argc > 0) { if (strcmp(*argv, "mode") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (strcmp(*argv, "ipv6/ipv6") == 0 || strcmp(*argv, "ip6ip6") == 0) proto = IPPROTO_IPV6 ; else if (strcmp(*argv, "ip/ipv6") == 0 || strcmp(*argv, "ipv4/ipv6") == 0 || strcmp(*argv, "ipip6") == 0 || strcmp(*argv, "ip4ip6") == 0) proto = IPPROTO_IPIP ; else if (strcmp(*argv, "any/ipv6") == 0 || strcmp(*argv, "any") == 0) proto = 0; else invarg("Cannot guess tunnel mode.", *argv); } else if (strcmp(*argv, "remote") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); get_addr(&daddr, *argv, 10 ); } else if (strcmp(*argv, "local") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); get_addr(&saddr, *argv, 10 ); } else if (matches(*argv, "dev") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); link = ll_name_to_index(*argv); if (!link) exit(nodev(*argv)); } else if (strcmp(*argv, "ttl") == 0 || strcmp(*argv, "hoplimit") == 0 || strcmp(*argv, "hlim") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (strcmp(*argv, "inherit") != 0) { if (get_u8(&hop_limit, *argv, 0)) invarg("invalid HLIM\n", *argv); } else hop_limit = 0; } else if (strcmp(*argv, "encaplimit") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (strcmp(*argv, "none") == 0) { flags |= 0x1; } else { __u8 uval; if (get_u8(&uval, *argv, 0) < -1) invarg("invalid ELIM", *argv); encap_limit = uval; flags &= ~0x1; } } else if (strcmp(*argv, "tos") == 0 || strcmp(*argv, "tclass") == 0 || strcmp(*argv, "tc") == 0 || matches(*argv, "dsfield") == 0) { __u8 uval; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); flowinfo &= ~htonl(0x0FF00000); if (strcmp(*argv, "inherit") == 0) flags |= 0x2; else { if (get_u8(&uval, *argv, 16)) invarg("invalid TClass", *argv); flowinfo |= htonl((__u32)uval << 20) & htonl(0x0FF00000); flags &= ~0x2; } } else if (strcmp(*argv, "flowlabel") == 0 || strcmp(*argv, "fl") == 0) { __u32 uval; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); flowinfo &= ~htonl(0x000FFFFF); if (strcmp(*argv, "inherit") == 0) flags |= 0x4; else { if (get_u32(&uval, *argv, 16)) invarg("invalid Flowlabel", *argv); if (uval > 0xFFFFF) invarg("invalid Flowlabel", *argv); flowinfo |= htonl(uval) & htonl(0x000FFFFF); flags &= ~0x4; } } else if (strcmp(*argv, "dscp") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (strcmp(*argv, "inherit") != 0) invarg("not inherit", *argv); flags |= 0x10; } else if (strcmp(*argv, "fwmark") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (strcmp(*argv, "inherit") == 0) { flags |= 0x20; fwmark = 0; } else { if (get_u32(&fwmark, *argv, 0)) invarg("invalid fwmark\n", *argv); flags &= ~0x20; } } else if (strcmp(*argv, "allow-localremote") == 0) { flags |= 0x40; } else if (strcmp(*argv, "noallow-localremote") == 0) { flags &= ~0x40; } else if (strcmp(*argv, "noencap") == 0) { encaptype = TUNNEL_ENCAP_NONE; } else if (strcmp(*argv, "encap") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (strcmp(*argv, "fou") == 0) encaptype = TUNNEL_ENCAP_FOU; else if (strcmp(*argv, "gue") == 0) encaptype = TUNNEL_ENCAP_GUE; else if (strcmp(*argv, "none") == 0) encaptype = TUNNEL_ENCAP_NONE; else invarg("Invalid encap type.", *argv); } else if (strcmp(*argv, "encap-sport") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (strcmp(*argv, "auto") == 0) encapsport = 0; else if (get_u16(&encapsport, *argv, 0)) invarg("Invalid source port.", *argv); } else if (strcmp(*argv, "encap-dport") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u16(&encapdport, *argv, 0)) invarg("Invalid destination port.", *argv); } else if (strcmp(*argv, "encap-csum") == 0) { encapflags |= (1<<0); } else if (strcmp(*argv, "noencap-csum") == 0) { encapflags &= ~(1<<0); } else if (strcmp(*argv, "encap-udp6-csum") == 0) { encapflags |= (1<<1); } else if (strcmp(*argv, "noencap-udp6-csum") == 0) { encapflags &= ~(1<<1); } else if (strcmp(*argv, "encap-remcsum") == 0) { encapflags |= (1<<2); } else if (strcmp(*argv, "noencap-remcsum") == 0) { encapflags &= ~(1<<2); } else if (strcmp(*argv, "external") == 0) { metadata = 1; } else { ip6tunnel_print_help(lu, argc, argv, stderr ); return -1; } argc--, argv++; } addattr8(n, 1024, IFLA_IPTUN_PROTO, proto); if (metadata) { addattr_l(n, 1024, IFLA_IPTUN_COLLECT_METADATA, ((void *)0) , 0); return 0; } if (is_addrtype_inet_not_unspec(&saddr)) { addattr_l(n, 1024, IFLA_IPTUN_LOCAL, saddr.data, saddr.bytelen); } if (is_addrtype_inet_not_unspec(&daddr)) { addattr_l(n, 1024, IFLA_IPTUN_REMOTE, daddr.data, daddr.bytelen); } addattr8(n, 1024, IFLA_IPTUN_TTL, hop_limit); addattr8(n, 1024, IFLA_IPTUN_ENCAP_LIMIT, encap_limit); addattr32(n, 1024, IFLA_IPTUN_FLOWINFO, flowinfo); addattr32(n, 1024, IFLA_IPTUN_FLAGS, flags); addattr32(n, 1024, IFLA_IPTUN_LINK, link); addattr32(n, 1024, IFLA_IPTUN_FWMARK, fwmark); addattr16(n, 1024, IFLA_IPTUN_ENCAP_TYPE, encaptype); addattr16(n, 1024, IFLA_IPTUN_ENCAP_FLAGS, encapflags); addattr16(n, 1024, IFLA_IPTUN_ENCAP_SPORT, htons(encapsport)); addattr16(n, 1024, IFLA_IPTUN_ENCAP_DPORT, htons(encapdport)); return 0; }
undefined8 ip6tunnel_parse_opt(undefined8 param_1,int param_2,char **param_3,long param_4) { char cVar1; uint16_t uVar2; int iVar3; uint32_t uVar4; uint32_t uVar5; undefined8 uVar6; long in_FS_OFFSET; char **local_580; int local_574; undefined local_564; undefined local_563; undefined local_562; char local_561; uint16_t local_560; uint16_t local_55e; undefined2 local_55c; ushort local_55a; undefined4 local_558; uint local_554; uint local_550; uint local_54c; int local_548; int local_544; int *local_540; long local_538; long local_530; undefined8 local_528; undefined8 local_520; ulong local_518; undefined8 local_510; undefined local_508 [16]; ushort *local_4f8; undefined local_4d8 [8]; long local_4d0; long local_4c8; long local_4c0; long local_4b8; long local_4a8; long local_4a0; long local_498; long local_490; long local_440; long local_438; undefined local_428 [2]; undefined2 local_426; undefined local_420 [264]; undefined local_318 [2]; undefined2 local_316; undefined local_310 [264]; undefined local_208 [144]; ushort *local_178; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_538 = param_4 + 0x10; local_520 = 0; local_510 = 0; local_528 = 0x1001200000020; local_518 = (ulong)(byte)preferred_family; local_518 = local_518 | (ulong)*(uint *)(param_4 + 0x14) << 0x20; local_564 = 0x40; local_563 = 4; local_550 = 0; local_54c = 0; local_562 = 0; local_548 = 0; local_55c = 0; local_55a = 2; local_560 = 0; local_55e = 0; local_561 = '\0'; local_558 = 0; inet_prefix_reset(local_428); inet_prefix_reset(local_318); local_580 = param_3; local_574 = param_2; if ((*(ushort *)(param_4 + 6) & 0x400) == 0) { iVar3 = rtnl_talk(&rth,&local_528,&local_540); if ((((-1 < iVar3) && (local_544 = *local_540 + -0x20, -1 < local_544)) && (parse_rtattr(local_208,0x3c,local_540 + 8,local_544), local_178 != (ushort *)0x0)) && (parse_rtattr_flags(local_508,5,local_178 + 2,*local_178 - 4,0x8000), local_4f8 != (ushort *)0x0)) { parse_rtattr_flags(local_4d8,0x14,local_4f8 + 2,*local_4f8 - 4,0x8000); local_530 = local_4c8; if (((local_4c8 == 0) || (iVar3 = get_addr_rta(local_428,local_4c8,10), iVar3 == 0)) && ((local_530 = local_4c0, local_4c0 == 0 || (iVar3 = get_addr_rta(local_318,local_4c0,10), iVar3 == 0)))) { if (local_4b8 != 0) { local_564 = rta_getattr_u8(local_4b8); } if (local_4a8 != 0) { local_563 = rta_getattr_u8(local_4a8); } if (local_4a0 != 0) { local_550 = rta_getattr_u32(local_4a0); } if (local_498 != 0) { local_54c = rta_getattr_u32(local_498); } if (local_4d0 != 0) { local_548 = rta_getattr_u32(local_4d0); } if (local_490 != 0) { local_562 = rta_getattr_u8(local_490); } if (local_440 != 0) { local_561 = '\x01'; } if (local_438 != 0) { local_558 = rta_getattr_u32(local_438); } free(local_540); goto LAB_00101140; } } fprintf(stderr,"Failed to get existing tunnel info.\n"); uVar6 = 0xffffffff; } else { LAB_00101140: for (; 0 < local_574; local_574 = local_574 + -1) { iVar3 = strcmp(*local_580,"mode"); if (iVar3 == 0) { local_580 = local_580 + 1; local_574 = local_574 + -1; if (local_574 < 1) { incomplete_command(); } iVar3 = strcmp(*local_580,"ipv6/ipv6"); if ((iVar3 == 0) || (iVar3 = strcmp(*local_580,"ip6ip6"), iVar3 == 0)) { local_562 = 0x29; } else { iVar3 = strcmp(*local_580,"ip/ipv6"); if ((iVar3 == 0) || (((iVar3 = strcmp(*local_580,"ipv4/ipv6"), iVar3 == 0 || (iVar3 = strcmp(*local_580,"ipip6"), iVar3 == 0)) || (iVar3 = strcmp(*local_580,"ip4ip6"), iVar3 == 0)))) { local_562 = 4; } else { iVar3 = strcmp(*local_580,"any/ipv6"); if ((iVar3 != 0) && (iVar3 = strcmp(*local_580,"any"), iVar3 != 0)) { invarg("Cannot guess tunnel mode.",*local_580); goto LAB_001006eb; } local_562 = 0; } } } else { LAB_001006eb: iVar3 = strcmp(*local_580,"remote"); if (iVar3 == 0) { local_580 = local_580 + 1; local_574 = local_574 + -1; if (local_574 < 1) { incomplete_command(); } get_addr(local_318,*local_580,10); } else { iVar3 = strcmp(*local_580,"local"); if (iVar3 == 0) { local_580 = local_580 + 1; local_574 = local_574 + -1; if (local_574 < 1) { incomplete_command(); } get_addr(local_428,*local_580,10); } else { cVar1 = matches(*local_580,&DAT_00101c5e); if (cVar1 == '\x01') { iVar3 = strcmp(*local_580,"ttl"); if (((iVar3 == 0) || (iVar3 = strcmp(*local_580,"hoplimit"), iVar3 == 0)) || (iVar3 = strcmp(*local_580,"hlim"), iVar3 == 0)) { local_580 = local_580 + 1; local_574 = local_574 + -1; if (local_574 < 1) { incomplete_command(); } iVar3 = strcmp(*local_580,"inherit"); if (iVar3 != 0) { iVar3 = get_u8(&local_564,*local_580,0); if (iVar3 == 0) goto LAB_00101131; invarg("invalid HLIM\n",*local_580); } local_564 = 0; } else { iVar3 = strcmp(*local_580,"encaplimit"); if (iVar3 == 0) { local_580 = local_580 + 1; local_574 = local_574 + -1; if (local_574 < 1) { incomplete_command(); } iVar3 = strcmp(*local_580,"none"); if (iVar3 == 0) { local_54c = local_54c | 1; } else { iVar3 = get_u8(&local_554,*local_580,0); if (iVar3 < -1) { invarg("invalid ELIM",*local_580); } local_563 = (undefined)local_554; local_54c = local_54c & 0xfffffffe; } } else { iVar3 = strcmp(*local_580,"tos"); if ((((iVar3 == 0) || (iVar3 = strcmp(*local_580,"tclass"), iVar3 == 0)) || (iVar3 = strcmp(*local_580,"tc"), iVar3 == 0)) || (cVar1 = matches(*local_580,"dsfield"), cVar1 != '\x01')) { local_580 = local_580 + 1; local_574 = local_574 + -1; if (local_574 < 1) { incomplete_command(); } uVar4 = htonl(0xff00000); local_550 = local_550 & ~uVar4; iVar3 = strcmp(*local_580,"inherit"); if (iVar3 == 0) { local_54c = local_54c | 2; } else { iVar3 = get_u8(&local_554,*local_580,0x10); if (iVar3 != 0) { invarg("invalid TClass",*local_580); } uVar4 = htonl((local_554 & 0xff) << 0x14); uVar5 = htonl(0xff00000); local_550 = local_550 | uVar5 & uVar4; local_54c = local_54c & 0xfffffffd; } } else { iVar3 = strcmp(*local_580,"flowlabel"); if ((iVar3 == 0) || (iVar3 = strcmp(*local_580,"fl"), iVar3 == 0)) { local_580 = local_580 + 1; local_574 = local_574 + -1; if (local_574 < 1) { incomplete_command(); } uVar4 = htonl(0xfffff); local_550 = local_550 & ~uVar4; iVar3 = strcmp(*local_580,"inherit"); if (iVar3 == 0) { local_54c = local_54c | 4; } else { iVar3 = get_u32(&local_554,*local_580,0x10); if (iVar3 != 0) { invarg("invalid Flowlabel",*local_580); } if (0xfffff < local_554) { invarg("invalid Flowlabel",*local_580); } uVar4 = htonl(local_554); uVar5 = htonl(0xfffff); local_550 = local_550 | uVar5 & uVar4; local_54c = local_54c & 0xfffffffb; } } else { iVar3 = strcmp(*local_580,"dscp"); if (iVar3 == 0) { local_580 = local_580 + 1; local_574 = local_574 + -1; if (local_574 < 1) { incomplete_command(); } iVar3 = strcmp(*local_580,"inherit"); if (iVar3 != 0) { invarg("not inherit",*local_580); } local_54c = local_54c | 0x10; } else { iVar3 = strcmp(*local_580,"fwmark"); if (iVar3 == 0) { local_580 = local_580 + 1; local_574 = local_574 + -1; if (local_574 < 1) { incomplete_command(); } iVar3 = strcmp(*local_580,"inherit"); if (iVar3 == 0) { local_54c = local_54c | 0x20; local_558 = 0; } else { iVar3 = get_u32(&local_558,*local_580,0); if (iVar3 != 0) { invarg("invalid fwmark\n",*local_580); } local_54c = local_54c & 0xffffffdf; } } else { iVar3 = strcmp(*local_580,"allow-localremote"); if (iVar3 == 0) { local_54c = local_54c | 0x40; } else { iVar3 = strcmp(*local_580,"noallow-localremote"); if (iVar3 == 0) { local_54c = local_54c & 0xffffffbf; } else { iVar3 = strcmp(*local_580,"noencap"); if (iVar3 == 0) { local_55c = 0; } else { iVar3 = strcmp(*local_580,"encap"); if (iVar3 == 0) { local_580 = local_580 + 1; local_574 = local_574 + -1; if (local_574 < 1) { incomplete_command(); } iVar3 = strcmp(*local_580,"fou"); if (iVar3 == 0) { local_55c = 1; } else { iVar3 = strcmp(*local_580,"gue"); if (iVar3 == 0) { local_55c = 2; } else { iVar3 = strcmp(*local_580,"none"); if (iVar3 != 0) { invarg("Invalid encap type.",*local_580); goto LAB_00100ec0; } local_55c = 0; } } } else { LAB_00100ec0: iVar3 = strcmp(*local_580,"encap-sport"); if (iVar3 == 0) { local_580 = local_580 + 1; local_574 = local_574 + -1; if (local_574 < 1) { incomplete_command(); } iVar3 = strcmp(*local_580,"auto"); if (iVar3 == 0) { local_560 = 0; } else { iVar3 = get_u16(&local_560,*local_580,0); if (iVar3 != 0) { invarg("Invalid source port.",*local_580); goto LAB_00100f6b; } } } else { LAB_00100f6b: iVar3 = strcmp(*local_580,"encap-dport"); if (iVar3 == 0) { local_580 = local_580 + 1; local_574 = local_574 + -1; if (local_574 < 1) { incomplete_command(); } iVar3 = get_u16(&local_55e,*local_580,0); if (iVar3 == 0) goto LAB_00101131; invarg("Invalid destination port.",*local_580); } iVar3 = strcmp(*local_580,"encap-csum"); if (iVar3 == 0) { local_55a = local_55a | 1; } else { iVar3 = strcmp(*local_580,"noencap-csum"); if (iVar3 == 0) { local_55a = local_55a & 0xfffe; } else { iVar3 = strcmp(*local_580,"encap-udp6-csum"); if (iVar3 == 0) { local_55a = local_55a | 2; } else { iVar3 = strcmp(*local_580,"noencap-udp6-csum"); if (iVar3 == 0) { local_55a = local_55a & 0xfffd; } else { iVar3 = strcmp(*local_580,"encap-remcsum"); if (iVar3 == 0) { local_55a = local_55a | 4; } else { iVar3 = strcmp(*local_580,"noencap-remcsum"); if (iVar3 == 0) { local_55a = local_55a & 0xfffb; } else { iVar3 = strcmp(*local_580,"external"); if (iVar3 != 0) { ip6tunnel_print_help (param_1,local_574,local_580,stderr); uVar6 = 0xffffffff; goto LAB_001013a6; } local_561 = '\x01'; } } } } } } } } } } } } } } } } } } else { local_580 = local_580 + 1; local_574 = local_574 + -1; if (local_574 < 1) { incomplete_command(); } local_548 = ll_name_to_index(*local_580); if (local_548 == 0) { iVar3 = nodev(); exit(iVar3); } } } } } LAB_00101131: local_580 = local_580 + 1; } addattr8(param_4,0x400,9,local_562); if (local_561 == '\0') { cVar1 = is_addrtype_inet_not_unspec(local_428); if (cVar1 != '\0') { addattr_l(param_4,0x400,2,local_420,local_426); } cVar1 = is_addrtype_inet_not_unspec(local_318); if (cVar1 != '\0') { addattr_l(param_4,0x400,3,local_310,local_316); } addattr8(param_4,0x400,4,local_564); addattr8(param_4,0x400,6,local_563); addattr32(param_4,0x400,7,local_550); addattr32(param_4,0x400,8,local_54c); addattr32(param_4,0x400,1,local_548); addattr32(param_4,0x400,0x14,local_558); addattr16(param_4,0x400,0xf,local_55c); addattr16(param_4,0x400,0x10,local_55a); uVar2 = htons(local_560); addattr16(param_4,0x400,0x11,uVar2); uVar2 = htons(local_55e); addattr16(param_4,0x400,0x12,uVar2); uVar6 = 0; } else { addattr_l(param_4,0x400,0x13,0,0); uVar6 = 0; } } LAB_001013a6: if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return uVar6; } __stack_chk_fail(); }
static inline __u64 rta_getattr_u64(const struct rtattr *rta) { __u64 tmp; memcpy(&tmp, ((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), sizeof(__u64)); return tmp; }
int rta_getattr_u64(unsigned long a0) { char v0; memcpy(&v0, a0 + 4, 0x8); return *(&v0); }
static void linkpath_coder (struct tar_stat_info const *st, char const *keyword, struct xheader *xhdr, void const *data __attribute__ ((unused))) { code_string (st->link_name, keyword, xhdr); }
long long linkpath_coder(struct_0 *a0, unsigned long long a1, unsigned long long a2, unsigned long a3) { unsigned long v0; v0 = a3; return code_string(a0->field_18, a1, a2); }
static union node * pipeline(void) { union node *n1, *n2, *pipenode; struct nodelist *lp, *prev; int negate; negate = 0; ; if (readtoken() == 13) { negate = !negate; checkkwd = 0x2 | 0x1; } else tokpushback++; n1 = command(); if (readtoken() == 6) { pipenode = (union node *)stalloc(sizeof (struct npipe)); pipenode->type = 1; pipenode->npipe.backgnd = 0; lp = (struct nodelist *)stalloc(sizeof (struct nodelist)); pipenode->npipe.cmdlist = lp; lp->n = n1; do { prev = lp; lp = (struct nodelist *)stalloc(sizeof (struct nodelist)); checkkwd = 0x4 | 0x2 | 0x1; lp->n = command(); prev->next = lp; } while (readtoken() == 6); lp->next = ((void *)0) ; n1 = pipenode; } tokpushback++; if (negate) { n2 = (union node *)stalloc(sizeof (struct nnot)); n2->type = 25; n2->nnot.com = n1; return n2; } else return n1; }
int pipeline(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned int v0; struct_1 *v1; unsigned long long v2[2]; struct_1 *v3; unsigned long long v4[2]; struct_0 *v5; unsigned int v7; v0 = 0; if (readtoken(a0, a1, a2, a3, a4, a5) != 13) { quoteflag = 283935561; } else { v0 = !v0; quoteflag = 3; } v1 = command(a0, a1, a2, a3, a4, a5); if (readtoken(a0, a1, a2, a3, a4, a5) == 6) { v3 = stalloc(0x10); v3->field_0 = 1; v3->field_4 = 0; v2[0] = stalloc(0x10); v3->field_8 = v2; v2[1] = v1; do { v4[0] = v2; v2[0] = stalloc(0x10); quoteflag = 7; v2[1] = command(0x10, a1, v2, a3, a4, a5); v4[0] = v2; } while (readtoken(0x10, a1, v2, a3, a4, a5) == 6); v2[0] = 0; v1 = v3; } quoteflag = 283935561; if (!v0) { v7 = v1; } else { v5 = stalloc(0x10); v5->field_0 = 25; v5->field_8 = v1; v7 = v5; } return v7; }
static void rsyslogdDebugSwitch(void) { time_t tTime; struct tm tp; datetime.GetTime(&tTime); localtime_r(&tTime, &tp); if(debugging_on == 0) { debugging_on = 1; r_dbgprintf("rsyslogd.c", "\n"); r_dbgprintf("rsyslogd.c", "\n"); r_dbgprintf("rsyslogd.c", "********************************************************************************\n"); r_dbgprintf("rsyslogd.c", "Switching debugging_on to true at %2.2d:%2.2d:%2.2d\n", tp.tm_hour, tp.tm_min, tp.tm_sec) ; r_dbgprintf("rsyslogd.c", "********************************************************************************\n"); } else { r_dbgprintf("rsyslogd.c", "********************************************************************************\n"); r_dbgprintf("rsyslogd.c", "Switching debugging_on to false at %2.2d:%2.2d:%2.2d\n", tp.tm_hour, tp.tm_min, tp.tm_sec) ; r_dbgprintf("rsyslogd.c", "********************************************************************************\n"); r_dbgprintf("rsyslogd.c", "\n"); r_dbgprintf("rsyslogd.c", "\n"); debugging_on = 0; } }
void rsyslogdDebugSwitch() { char v0; char v1; char v2; char v3; unsigned long long *v5; unsigned long long v6; *(&g_404648)(&v0); localtime_r(&v0, &v1); if (!debugging_on) { debugging_on = 1; r_dbgprintf("rsyslogd.c", "\n", *(&g_404648)); r_dbgprintf("rsyslogd.c", "\n", *(&g_404648)); r_dbgprintf("rsyslogd.c", "********************************************************************************\n", *(&g_404648)); r_dbgprintf("rsyslogd.c", "Switching debugging_on to true at %2.2d:%2.2d:%2.2d\n", *(&v2)); r_dbgprintf("rsyslogd.c", "********************************************************************************\n", *(&g_404648)); } else { r_dbgprintf("rsyslogd.c", "********************************************************************************\n", *(&g_404648)); r_dbgprintf("rsyslogd.c", "Switching debugging_on to false at %2.2d:%2.2d:%2.2d\n", *(&v2)); r_dbgprintf("rsyslogd.c", "********************************************************************************\n", *(&g_404648)); r_dbgprintf("rsyslogd.c", "\n", *(&g_404648)); r_dbgprintf("rsyslogd.c", "\n", *(&g_404648)); debugging_on = 0; } v6 = *(&v3) ^ v5[5]; return; }
int main (int argc, char *argv[]) { errcode_t retval = 0, retval2 = 0, orig_retval = 0; int exit_value = 0; ext2_filsys fs = 0; io_manager io_ptr; struct ext2_super_block *sb; const char *lib_ver_date; int my_ver, lib_ver; e2fsck_t ctx; blk64_t orig_superblock = ~(blk64_t)0; struct problem_context pctx; int flags, run_result, was_changed; int journal_size; int sysval, sys_page_size = 4096; int old_bitmaps; __u32 features[3]; char *cp; enum quota_type qtype; struct ext2fs_journal_params jparams; clear_problem_context(&pctx); sigcatcher_setup(); setlocale( 5 , ""); setlocale( 0 , ""); bindtextdomain("e2fsprogs", "/usr/share/locale"); textdomain("e2fsprogs"); set_com_err_gettext(gettext); my_ver = ext2fs_parse_version_string(my_ver_string); lib_ver = ext2fs_get_library_version(0, &lib_ver_date); if (my_ver > lib_ver) { fprintf( stderr , "%s", (gettext ("Error: ext2fs library version out of date!\n"))); show_version_only++; } retval = PRS(argc, argv, &ctx); if (retval) { com_err("e2fsck", retval, "%s", (gettext ("while trying to initialize program"))); exit(8); } reserve_stdio_fds(); set_up_logging(ctx); if (ctx->logf) { int i; fputs("E2fsck run: ", ctx->logf); for (i = 0; i < argc; i++) { if (i) fputc(' ', ctx->logf); fputs(argv[i], ctx->logf); } fputc('\n', ctx->logf); } if (ctx->problem_logf) { int i; fputs("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n", ctx->problem_logf); fprintf(ctx->problem_logf, "<problem_log time=\"%lu\">\n", (unsigned long) ctx->now); fprintf(ctx->problem_logf, "<invocation prog=\"%s\"", argv[0]); for (i = 1; i < argc; i++) fprintf(ctx->problem_logf, " arg%d=\"%s\"", i, argv[i]); fputs("/>\n", ctx->problem_logf); } init_resource_track(&ctx->global_rtrack, ((void *)0) ); if (!(ctx->options & 0x0002) || show_version_only) log_err(ctx, "e2fsck %s (%s)\n", my_ver_string, my_ver_date); if (show_version_only) { log_err(ctx, (gettext ("\tUsing %s, %s\n")), error_message((2133571328L)), lib_ver_date); exit(0); } check_mount(ctx); if (!(ctx->options & 0x0002) && !(ctx->options & 0x0008) && !(ctx->options & 0x0004)) { if (!ctx->interactive) fatal_error(ctx, (gettext ("need terminal for interactive repairs"))); } ctx->superblock = ctx->use_superblock; flags = 0x100000 | 0x4000000; restart: if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_BLOCK")) { io_ptr = test_io_manager; test_io_backing_manager = unix_io_manager; } else io_ptr = unix_io_manager; flags |= 0x10000; profile_get_boolean(ctx->profile, "options", "old_bitmaps", 0, 0, &old_bitmaps); if (!old_bitmaps) flags |= 0x20000; if ((ctx->options & 0x0001) == 0) { flags |= 0x01; if (!(ctx->mount_flags & 2 && ctx->mount_flags & 4)) flags |= 0x4000; if ((ctx->mount_flags & 4) && (ctx->options & 0x0100)) flags &= ~0x4000; } if (ctx->undo_file) { retval = e2fsck_setup_tdb(ctx, &io_ptr); if (retval) exit(8); } ctx->openfs_flags = flags; retval = try_open_fs(ctx, flags, io_ptr, &fs); if (!ctx->superblock && !(ctx->options & 0x0002) && !(ctx->flags & 0x0100) && ((retval == (2133571347L)) || (retval == (2133571480L)) || (retval == (2133571388L)) || ((retval == 0) && (retval2 = ext2fs_check_desc(fs))))) { if (retval) { pctx.errcode = retval; fix_problem(ctx, 0x000044, &pctx); } if (retval2) { pctx.errcode = retval2; fix_problem(ctx, 0x000045, &pctx); } pctx.errcode = 0; if (retval2 == 12 || retval2 == (2133571398L)) { retval = retval2; goto failure; } if (fs->flags & 0x10000) { ext2fs_free(fs); fs = ((void *)0) ; } if (!fs || (fs->group_desc_count > 1)) { log_out(ctx, (gettext ("%s: %s trying backup blocks...\n")), ctx->program_name, retval ? (gettext ("Superblock invalid,")) : (gettext ("Group descriptors look bad..."))); orig_superblock = ctx->superblock; get_backup_sb(ctx, fs, ctx->filesystem_name, io_ptr); if (fs) ext2fs_close_free(&fs); orig_retval = retval; retval = try_open_fs(ctx, flags, io_ptr, &fs); if ((orig_retval == 0) && retval != 0) { if (fs) ext2fs_close_free(&fs); log_out(ctx, (gettext ("%s: %s while using the " "backup blocks")) , ctx->program_name, error_message(retval)); log_out(ctx, (gettext ("%s: going back to original " "superblock\n")) , ctx->program_name); ctx->superblock = orig_superblock; retval = try_open_fs(ctx, flags, io_ptr, &fs); } } } if (((retval == (2133571395L)) || (retval == (2133571396L))) && fs && fs->super) { sb = fs->super; features[0] = (sb->s_feature_compat & ~(0x0001| 0x0002| 0x0004| 0x0010| 0x0020| 0x0008| 0x0200| 0x0400| 0x0800)); features[1] = (sb->s_feature_incompat & ~(0x0002| 0x0008| 0x0010| 0x0004| 0x0040| 0x0200| 0x0400| 0x0100| 0x0080| 0x8000| 0x10000| 0x20000| 0x2000| 0x4000)); features[2] = (sb->s_feature_ro_compat & ~(0x0001| 0x0008| 0x0002| 0x0020| 0x0040| 0x0010| 0x0200| 0x0100| 0x0400| 0x1000 | 0x2000 | 0x4000 | 0x8000)); if (features[0] || features[1] || features[2]) goto print_unsupp_features; } failure: if (retval) { if (orig_retval) retval = orig_retval; com_err(ctx->program_name, retval, (gettext ("while trying to open %s")), ctx->filesystem_name); if (retval == (2133571348L)) { log_out(ctx, "%s", (gettext ("The filesystem revision is apparently " "too high for this version of e2fsck.\n" "(Or the filesystem superblock " "is corrupt)\n\n")) ); fix_problem(ctx, 0x000004, &pctx); } else if (retval == (2133571364L)) log_out(ctx, "%s", (gettext ("Could this be a zero-length partition?\n"))); else if ((retval == 1 ) || (retval == 13 )) log_out(ctx, (gettext ("You must have %s access to the " "filesystem or be root\n")) , (ctx->options & 0x0001) ? "r/o" : "r/w"); else if (retval == 6 ) log_out(ctx, "%s", (gettext ("Possibly non-existent or swap device?\n"))); else if (retval == 16 ) log_out(ctx, "%s", (gettext ("Filesystem mounted or opened " "exclusively by another program?\n")) ); else if (retval == 2 ) log_out(ctx, "%s", (gettext ("Possibly non-existent device?\n"))); else if (retval == 30 ) log_out(ctx, "%s", (gettext ("Disk write-protected; use the " "-n option to do a read-only\n" "check of the device.\n")) ); else { if ((retval == (2133571388L)) && !(flags & 0x800000)) { if (fs) ext2fs_close_free(&fs); log_out(ctx, (gettext ("%s: Trying to load superblock " "despite errors...\n")) , ctx->program_name); flags |= 0x800000; if (orig_superblock != ~(blk64_t)0) ctx->superblock = orig_superblock; goto restart; } fix_problem(ctx, 0x000004, &pctx); if (retval == (2133571347L)) check_plausibility(ctx->filesystem_name, 0x0004, ((void *)0) ); } fatal_error(ctx, 0); } fs->flags |= 0x200; if (!(ctx->flags & 0x0800)) { __u32 blocksize = ((1 << 10) << (fs->super)->s_log_block_size); int need_restart = 0; pctx.errcode = ext2fs_get_device_size2(ctx->filesystem_name, blocksize, &ctx->num_blocks); if (pctx.errcode == 16 ) { ext2fs_close_free(&fs); need_restart++; pctx.errcode = ext2fs_get_device_size2(ctx->filesystem_name, blocksize, &ctx->num_blocks); } if (pctx.errcode == (2133571408L)) ctx->num_blocks = 0; else if (pctx.errcode) { fix_problem(ctx, 0x00000C, &pctx); ctx->flags |= 0x0001; fatal_error(ctx, 0); } ctx->flags |= 0x0800; if (need_restart) goto restart; } ctx->fs = fs; fs->now = ctx->now; sb = fs->super; if (sb->s_rev_level > 1) { com_err(ctx->program_name, (2133571348L), (gettext ("while trying to open %s")), ctx->filesystem_name); get_newer: fatal_error(ctx, (gettext ("Get a newer version of e2fsck!"))); } if (ctx->device_name == 0 && sb->s_volume_name[0]) ctx->device_name = string_copy(ctx, (char *) sb->s_volume_name, sizeof(sb->s_volume_name)); if (ctx->device_name == 0) ctx->device_name = string_copy(ctx, ctx->filesystem_name, 0); for (cp = ctx->device_name; *cp; cp++) if ( ((*__ctype_b_loc ())[(int) (( *cp ))] & (unsigned short int) _ISspace) || *cp == ':') *cp = '_'; if (ctx->problem_logf) { fprintf(ctx->problem_logf, "<filesystem dev=\"%s\"", ctx->filesystem_name); if (!uuid_is_null(sb->s_uuid)) { char buf[48]; uuid_unparse(sb->s_uuid, buf); fprintf(ctx->problem_logf, " uuid=\"%s\"", buf); } if (sb->s_volume_name[0]) fprintf(ctx->problem_logf, " label=\"%.*s\"", (int)sizeof(sb->s_volume_name), (char *)sb->s_volume_name); fputs("/>\n", ctx->problem_logf); } ehandler_init(fs->io); if (ext2fs_has_feature_mmp(fs->super) && (flags & 0x100000)) { if (e2fsck_check_mmp(fs, ctx)) fatal_error(ctx, 0); ext2fs_close_free(&ctx->fs); flags &= ~0x100000; goto restart; } if (ctx->logf) fprintf(ctx->logf, "Filesystem UUID: %s\n", e2p_uuid2str(sb->s_uuid)); if ((ctx->mount_flags & (1 | 16)) == 0) { retval = e2fsck_check_ext3_journal(ctx); if (retval) { com_err(ctx->program_name, retval, (gettext ("while checking journal for %s")), ctx->device_name); fatal_error(ctx, (gettext ("Cannot proceed with file system check"))); } } if (ext2fs_has_feature_journal_needs_recovery(sb)) { if (ctx->options & 0x0001) { log_out(ctx, "%s", (gettext ("Warning: skipping journal recovery because " "doing a read-only filesystem check.\n")) ); ((ctx->fs->io)->manager->flush((ctx->fs->io))); } else { if (ctx->flags & 0x0200) { com_err(ctx->program_name, 0, (gettext ("unable to set superblock flags " "on %s\n")) , ctx->device_name); fatal_error(ctx, 0); } retval = e2fsck_run_ext3_journal(ctx); if (retval == (2133571503L)) { log_out(ctx, (gettext ("Journal checksum error " "found in %s\n")) , ctx->device_name); } else if (retval == (2133571502L)) { log_out(ctx, (gettext ("Journal corrupted in %s\n")), ctx->device_name); } else if (retval) { com_err(ctx->program_name, retval, (gettext ("while recovering journal of %s")), ctx->device_name); } ext2fs_close_free(&ctx->fs); ctx->flags |= 0x0200; goto restart; } } features[0] = sb->s_feature_compat & ~(0x0001| 0x0002| 0x0004| 0x0010| 0x0020| 0x0008| 0x0200| 0x0400| 0x0800); features[1] = sb->s_feature_incompat & ~(0x0002| 0x0008| 0x0010| 0x0004| 0x0040| 0x0200| 0x0400| 0x0100| 0x0080| 0x8000| 0x10000| 0x20000| 0x2000| 0x4000); features[2] = (sb->s_feature_ro_compat & ~(0x0001| 0x0008| 0x0002| 0x0020| 0x0040| 0x0010| 0x0200| 0x0100| 0x0400| 0x1000 | 0x2000 | 0x4000 | 0x8000)); print_unsupp_features: if (features[0] || features[1] || features[2]) { int i, j; __u32 *mask = features, m; log_err(ctx, (gettext ("%s has unsupported feature(s):")), ctx->filesystem_name); for (i=0; i <3; i++,mask++) { for (j=0,m=1; j < 32; j++, m<<=1) { if (*mask & m) log_err(ctx, " %s", e2p_feature2string(i, m)); } } log_err(ctx, "\n"); goto get_newer; } if (ext2fs_has_feature_casefold(sb) && !fs->encoding) { log_err(ctx, (gettext ("%s has unsupported encoding: %0x\n")), ctx->filesystem_name, sb->s_encoding); goto get_newer; } if (ctx->superblock && !(ctx->options & 0x0001)) ext2fs_mark_super_dirty(fs); sysval = sysconf( _SC_PAGESIZE ); if (sysval > 0) sys_page_size = sysval; ctx->blocks_per_page = sys_page_size / fs->blocksize; if (ctx->blocks_per_page == 0) ctx->blocks_per_page = 1; if (ctx->superblock) set_latch_flags(0x0050, 0x0004, 0); ext2fs_mark_valid(fs); check_super_block(ctx); if (ctx->flags & (0x0001 | 0x0002)) fatal_error(ctx, 0); check_if_skip(ctx); check_resize_inode(ctx); if (bad_blocks_file) read_bad_blocks_file(ctx, bad_blocks_file, replace_bad_blocks); else if (cflag) read_bad_blocks_file(ctx, 0, !keep_bad_blocks); if (ctx->flags & (0x0001 | 0x0002)) fatal_error(ctx, 0); ext2fs_mark_valid(fs); retval = ext2fs_read_bb_inode(fs, &fs->badblocks); if (retval) { log_out(ctx, (gettext ("%s: %s while reading bad blocks inode\n")), ctx->program_name, error_message(retval)); preenhalt(ctx); log_out(ctx, "%s", (gettext ("This doesn't bode well, " "but we'll try to go on...\n")) ); } if (sb->s_jnl_backup_type == 1 && !ext2fs_has_feature_fast_commit(sb)) journal_size = (sb->s_jnl_blocks[15] << (32 - 20)) | (sb->s_jnl_blocks[16] >> 20); else journal_size = -1; if (ext2fs_has_feature_quota(sb)) { clear_problem_context(&pctx); pctx.errcode = quota_init_context(&ctx->qctx, ctx->fs, 0); if (pctx.errcode) { fix_problem(ctx, 0x00004C, &pctx); fatal_error(ctx, 0); } } run_result = e2fsck_run(ctx); e2fsck_clear_progbar(ctx); if (!ctx->invalid_bitmaps && (ctx->flags & 0x0080)) { if (fix_problem(ctx, 0x060001, &pctx)) { if (journal_size < 1024) { ext2fs_get_journal_params(&jparams, fs); } else { jparams.num_journal_blocks = journal_size; jparams.num_fc_blocks = 0; } log_out(ctx, (gettext ("Creating journal (%d blocks): ")), jparams.num_journal_blocks); fflush( stdout ); retval = ext2fs_add_journal_inode3(fs, &jparams, ~0ULL, 0); if (retval) { log_out(ctx, "%s: while trying to create " "journal\n", error_message(retval)); goto no_journal; } log_out(ctx, "%s", (gettext (" Done.\n"))); log_out(ctx, "%s", (gettext ("\n*** journal has been regenerated ***\n"))); } } no_journal: if (run_result & 0x0001) { fatal_error(ctx, (gettext ("aborted"))); } else if (run_result & 0x0002) { log_out(ctx, (gettext ("%s: e2fsck canceled.\n")), ctx->device_name ? ctx->device_name : ctx->filesystem_name); exit_value |= 32; } else if (ctx->qctx && !ctx->invalid_bitmaps) { int needs_writeout; for (qtype = 0; qtype < MAXQUOTAS; qtype++) { if (*quota_sb_inump(sb, qtype) == 0) continue; needs_writeout = 0; pctx.num = qtype; retval = quota_compare_and_update(ctx->qctx, qtype, &needs_writeout); if ((retval || needs_writeout) && fix_problem(ctx, 0x060002, &pctx)) { pctx.errcode = quota_write_inode(ctx->qctx, 1 << qtype); if (pctx.errcode) (void) fix_problem(ctx, 0x060006, &pctx); } } quota_release_context(&ctx->qctx); } if (run_result == 0x0004) { log_out(ctx, "%s", (gettext ("Restarting e2fsck from the beginning...\n"))); retval = e2fsck_reset_context(ctx); if (retval) { com_err(ctx->program_name, retval, "%s", (gettext ("while resetting context"))); fatal_error(ctx, 0); } ext2fs_close_free(&ctx->fs); goto restart; } was_changed = ext2fs_test_changed(fs); if (!(ctx->flags & ((0x0001 | 0x0002) | 0x0004)) && !(ctx->options & 0x0001)) { if (ext2fs_test_valid(fs)) { if (!(sb->s_state & 0x0001)) exit_value |= 1; sb->s_state = 0x0001; if (check_backup_super_block(ctx)) fs->flags &= ~0x200; } else sb->s_state &= ~0x0001; if (!(ctx->flags & 0x2000)) sb->s_lastcheck = ctx->now; sb->s_mnt_count = 0; memset(((char *) sb) + __builtin_offsetof(struct ext2_super_block,s_error_count), 0, (__builtin_offsetof(struct ext2_super_block,s_mount_opts) - __builtin_offsetof(struct ext2_super_block,s_error_count))); pctx.errcode = ext2fs_set_gdt_csum(ctx->fs); if (pctx.errcode) fix_problem(ctx, 0x060003, &pctx); ext2fs_mark_super_dirty(fs); } if (ext2fs_has_feature_shared_blocks(ctx->fs->super) && (ctx->options & 0x40000) && (ctx->options & 0x0008)) goto skip_write; if (!(ctx->options & 0x0001)) { e2fsck_write_bitmaps(ctx); if (fs->flags & 0x04) { pctx.errcode = ext2fs_flush(ctx->fs); if (pctx.errcode) fix_problem(ctx, 0x060004, &pctx); } pctx.errcode = ((ctx->fs->io)->manager->flush((ctx->fs->io))); if (pctx.errcode) fix_problem(ctx, 0x060005, &pctx); } if (was_changed) { int fs_fixed = (ctx->flags & 0x4000); if (fs_fixed) exit_value |= 1; if (!(ctx->options & 0x0002)) { log_out(ctx, (gettext ("\n%s: ***** FILE SYSTEM WAS MODIFIED *****\n")), ctx->device_name); } if (ctx->mount_flags & 2) { log_out(ctx, (gettext ("%s: ***** REBOOT SYSTEM *****\n")), ctx->device_name); exit_value |= 2; } } skip_write: if (!ext2fs_test_valid(fs) || ((exit_value & 32) && (sb->s_state & 0x0002))) { log_out(ctx, (gettext ("\n%s: ********** WARNING: Filesystem still has " "errors **********\n\n")) , ctx->device_name); exit_value |= 4; exit_value &= ~1; } if (exit_value & 32) { int allow_cancellation; profile_get_boolean(ctx->profile, "options", "allow_cancellation", 0, 0, &allow_cancellation); exit_value &= ~1; if (allow_cancellation && ext2fs_test_valid(fs) && (sb->s_state & 0x0001) && !(sb->s_state & 0x0002)) exit_value = 0; } else show_stats(ctx); print_resource_track(ctx, ((void *)0) , &ctx->global_rtrack, ctx->fs->io); ext2fs_close_free(&ctx->fs); free(ctx->journal_name); if (ctx->logf) fprintf(ctx->logf, "Exit status: %d\n", exit_value); e2fsck_free_context(ctx); remove_error_table(&et_ext2_error_table); remove_error_table(&et_prof_error_table); return exit_value; }
uint main(int param_1,undefined8 *param_2) { long *plVar1; uint uVar2; int iVar3; undefined8 uVar4; undefined8 uVar5; char *pcVar6; long lVar7; ushort **ppuVar8; int *piVar9; undefined *puVar10; long in_FS_OFFSET; int local_188; int local_184; uint local_180; uint local_17c; uint local_178; uint local_174; uint local_170; int local_16c; uint local_168; int local_164; int local_160; int local_15c; uint local_158; int local_154; int local_150; int local_14c; uint local_148; uint local_144; int local_140; uint local_13c; long local_138; undefined8 local_130; undefined8 local_128; long *local_120; long local_118; long local_110; long local_108; long local_100; long local_f8; char *local_f0; uint *local_e8; uint local_e0; undefined4 local_dc; long local_d8 [10]; ulong local_88; uint local_64; uint local_60; uint local_5c; undefined local_58 [56]; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_118 = 0; local_110 = 0; local_108 = 0; local_180 = 0; local_138 = 0; local_f8 = -1; local_174 = 0x1000; clear_problem_context(local_d8); sigcatcher_setup(); setlocale(5,""); setlocale(0,""); bindtextdomain("e2fsprogs","/usr/share/locale"); textdomain("e2fsprogs"); set_com_err_gettext(uRam00000000001045a2); local_154 = ext2fs_parse_version_string(my_ver_string); local_150 = ext2fs_get_library_version(0,&local_128); if (local_150 < local_154) { uVar4 = gettext("Error: ext2fs library version out of date!\n"); fprintf(stderr,"%s",uVar4); show_version_only = show_version_only + 1; } local_118 = PRS(param_1,param_2,&local_120); if (local_118 != 0) { uVar4 = gettext("while trying to initialize program"); com_err("e2fsck",local_118,&DAT_00106c11,uVar4); exit(8); } reserve_stdio_fds(); set_up_logging(local_120); if (local_120[5] != 0) { fputs("E2fsck run: ",(FILE *)local_120[5]); for (local_16c = 0; local_16c < param_1; local_16c = local_16c + 1) { if (local_16c != 0) { fputc(0x20,(FILE *)local_120[5]); } fputs((char *)param_2[local_16c],(FILE *)local_120[5]); } fputc(10,(FILE *)local_120[5]); } if (local_120[7] != 0) { fputs("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",(FILE *)local_120[7]); fprintf((FILE *)local_120[7],"<problem_log time=\"%lu\">\n",local_120[0x69]); fprintf((FILE *)local_120[7],"<invocation prog=\"%s\"",*param_2); for (local_168 = 1; (int)local_168 < param_1; local_168 = local_168 + 1) { fprintf((FILE *)local_120[7]," arg%d=\"%s\"",(ulong)local_168,param_2[(int)local_168]); } fputs("/>\n",(FILE *)local_120[7]); } init_resource_track(local_120 + 0x50,0); if (((*(uint *)((long)local_120 + 0x4c) & 2) == 0) || (show_version_only != 0)) { log_err(local_120,"e2fsck %s (%s)\n",my_ver_string,my_ver_date); } if (show_version_only != 0) { uVar4 = error_message(0x7f2bb700); uVar5 = gettext("\tUsing %s, %s\n"); log_err(local_120,uVar5,uVar4,local_128); exit(0); } check_mount(local_120); if (((((*(uint *)((long)local_120 + 0x4c) & 2) == 0) && ((*(uint *)((long)local_120 + 0x4c) & 8) == 0)) && ((*(uint *)((long)local_120 + 0x4c) & 4) == 0)) && (*(int *)(local_120 + 0x5b) == 0)) { uVar4 = gettext("need terminal for interactive repairs"); fatal_error(local_120,uVar4); } local_120[0xc] = local_120[0xb]; local_17c = 0x4100000; LAB_001049a3: pcVar6 = getenv("TEST_IO_FLAGS"); if ((pcVar6 == (char *)0x0) && (pcVar6 = getenv("TEST_IO_BLOCK"), pcVar6 == (char *)0x0)) { local_130 = unix_io_manager; } else { local_130 = test_io_manager; _test_io_backing_manager = unix_io_manager; } local_17c = local_17c | 0x10000; profile_get_boolean(local_120[0x6c],"options","old_bitmaps",0,0,&local_188); if (local_188 == 0) { local_17c = local_17c | 0x20000; } if ((*(uint *)((long)local_120 + 0x4c) & 1) == 0) { if (((*(uint *)((long)local_120 + 0x7c) & 2) == 0) || (uVar2 = local_17c | 1, (*(uint *)((long)local_120 + 0x7c) & 4) == 0)) { uVar2 = local_17c | 0x4001; } local_17c = uVar2; if (((*(uint *)((long)local_120 + 0x7c) & 4) != 0) && ((*(uint *)((long)local_120 + 0x4c) & 0x100) != 0)) { local_17c = local_17c & 0xffffbfff; } } if (local_120[0x75] != 0) { iVar3 = e2fsck_setup_tdb(local_120,&local_130); local_118 = (long)iVar3; if (local_118 != 0) { exit(8); } } *(uint *)(local_120 + 0x10) = local_17c; local_118 = try_open_fs(local_120,local_17c,local_130); if ((((local_120[0xc] == 0) && ((*(uint *)((long)local_120 + 0x4c) & 2) == 0)) && ((*(uint *)(local_120 + 9) & 0x100) == 0)) && (((local_118 == 0x7f2bb713 || (local_118 == 0x7f2bb798)) || ((local_118 == 0x7f2bb73c || ((local_118 == 0 && (local_110 = ext2fs_check_desc(local_138), local_110 != 0)))))))) { if (local_118 != 0) { local_d8[0] = local_118; fix_problem(local_120,0x44,local_d8); } if (local_110 != 0) { local_d8[0] = local_110; fix_problem(local_120,0x45,local_d8); } local_d8[0] = 0; if ((local_110 != 0xc) && (local_110 != 0x7f2bb746)) { if ((*(uint *)(local_138 + 0x10) & 0x10000) != 0) { ext2fs_free(local_138); local_138 = 0; } if ((local_138 == 0) || (1 < *(uint *)(local_138 + 0x30))) { if (local_118 == 0) { uVar4 = gettext("Group descriptors look bad..."); } else { uVar4 = gettext("Superblock invalid,"); } lVar7 = local_120[1]; uVar5 = gettext("%s: %s trying backup blocks...\n"); log_out(local_120,uVar5,lVar7,uVar4); local_f8 = local_120[0xc]; get_backup_sb(local_120,local_138,local_120[2],local_130); if (local_138 != 0) { ext2fs_close_free(&local_138); } local_108 = local_118; local_118 = try_open_fs(local_120,local_17c,local_130); if ((local_108 == 0) && (local_118 != 0)) { if (local_138 != 0) { ext2fs_close_free(&local_138); } uVar4 = error_message(local_118); lVar7 = local_120[1]; uVar5 = gettext("%s: %s while using the backup blocks"); log_out(local_120,uVar5,lVar7,uVar4); lVar7 = local_120[1]; uVar4 = gettext("%s: going back to original superblock\n"); log_out(local_120,uVar4,lVar7); local_120[0xc] = local_f8; local_118 = try_open_fs(local_120,local_17c,local_130); } } goto LAB_00104e98; } local_118 = local_110; } else { LAB_00104e98: if ((((local_118 == 0x7f2bb743) || (local_118 == 0x7f2bb744)) && (local_138 != 0)) && (*(long *)(local_138 + 0x20) != 0)) { local_100 = *(long *)(local_138 + 0x20); local_64 = *(uint *)(local_100 + 0x5c) & 0xfffff1c0; local_60 = *(uint *)(local_100 + 0x60) & 0xfffc1821; local_5c = *(uint *)(local_100 + 100) & 0xffff0884; if (local_64 != 0) goto LAB_001059ec; if (local_60 != 0) goto LAB_001059ec; if (local_5c != 0) goto LAB_001059ec; } } if (local_118 != 0) { if (local_108 != 0) { local_118 = local_108; } uVar4 = gettext("while trying to open %s"); com_err(local_120[1],local_118,uVar4); if (local_118 == 0x7f2bb714) { uVar4 = gettext( "The filesystem revision is apparently too high for this version of e2fsck.\n(Or the filesystem superblock is corrupt)\n\n" ); log_out(local_120,&DAT_00106c11,uVar4); fix_problem(local_120,4,local_d8); } else if (local_118 == 0x7f2bb724) { uVar4 = gettext("Could this be a zero-length partition?\n"); log_out(local_120,&DAT_00106c11,uVar4); } else if ((local_118 == 1) || (local_118 == 0xd)) { if ((*(uint *)((long)local_120 + 0x4c) & 1) == 0) { puVar10 = &DAT_001081ac; } else { puVar10 = &DAT_001081a8; } uVar4 = gettext("You must have %s access to the filesystem or be root\n"); log_out(local_120,uVar4,puVar10); } else if (local_118 == 6) { uVar4 = gettext("Possibly non-existent or swap device?\n"); log_out(local_120,&DAT_00106c11,uVar4); } else if (local_118 == 0x10) { uVar4 = gettext("Filesystem mounted or opened exclusively by another program?\n"); log_out(local_120,&DAT_00106c11,uVar4); } else if (local_118 == 2) { uVar4 = gettext("Possibly non-existent device?\n"); log_out(local_120,&DAT_00106c11,uVar4); } else if (local_118 == 0x1e) { uVar4 = gettext( "Disk write-protected; use the -n option to do a read-only\ncheck of the device.\n" ); log_out(local_120,&DAT_00106c11,uVar4); } else { if ((local_118 == 0x7f2bb73c) && ((local_17c & 0x800000) == 0)) { if (local_138 != 0) { ext2fs_close_free(&local_138); } lVar7 = local_120[1]; uVar4 = gettext("%s: Trying to load superblock despite errors...\n"); log_out(local_120,uVar4,lVar7); local_17c = local_17c | 0x800000; if (local_f8 != -1) { local_120[0xc] = local_f8; } goto LAB_001049a3; } fix_problem(local_120,4,local_d8); if (local_118 == 0x7f2bb713) { check_plausibility(local_120[2],4,0); } } fatal_error(local_120,0); } *(uint *)(local_138 + 0x10) = *(uint *)(local_138 + 0x10) | 0x200; if ((*(uint *)(local_120 + 9) & 0x800) == 0) goto code_r0x0010529d; goto LAB_001053da; code_r0x0010529d: local_14c = 0x400 << ((byte)*(undefined4 *)(*(long *)(local_138 + 0x20) + 0x18) & 0x1f); local_164 = 0; local_d8[0] = ext2fs_get_device_size2(local_120[2],local_14c,local_120 + 0xd); if (local_d8[0] == 0x10) { ext2fs_close_free(&local_138); local_164 = local_164 + 1; local_d8[0] = ext2fs_get_device_size2(local_120[2],local_14c,local_120 + 0xd); } if (local_d8[0] == 0x7f2bb750) { local_120[0xd] = 0; } else if (local_d8[0] != 0) { fix_problem(local_120,0xc,local_d8); *(uint *)(local_120 + 9) = *(uint *)(local_120 + 9) | 1; fatal_error(local_120,0); } *(uint *)(local_120 + 9) = *(uint *)(local_120 + 9) | 0x800; if (local_164 == 0) { LAB_001053da: *local_120 = local_138; *(long *)(local_138 + 0xb8) = local_120[0x69]; local_100 = *(long *)(local_138 + 0x20); if (*(uint *)(local_100 + 0x4c) < 2) goto LAB_00105483; lVar7 = local_120[2]; uVar4 = gettext("while trying to open %s"); com_err(local_120[1],0x7f2bb714,uVar4,lVar7); while( true ) { while( true ) { uVar4 = gettext("Get a newer version of e2fsck!"); fatal_error(local_120,uVar4); LAB_00105483: plVar1 = local_120; if ((local_120[3] == 0) && (*(char *)(local_100 + 0x78) != '\0')) { lVar7 = string_copy(local_120,local_100 + 0x78,0x10); plVar1[3] = lVar7; } plVar1 = local_120; if (local_120[3] == 0) { lVar7 = string_copy(local_120,local_120[2],0); plVar1[3] = lVar7; } for (local_f0 = (char *)local_120[3]; *local_f0 != '\0'; local_f0 = local_f0 + 1) { ppuVar8 = __ctype_b_loc(); if ((((*ppuVar8)[*local_f0] & 0x2000) != 0) || (*local_f0 == ':')) { *local_f0 = '_'; } } if (local_120[7] != 0) { fprintf((FILE *)local_120[7],"<filesystem dev=\"%s\"",local_120[2]); iVar3 = uuid_is_null(local_100 + 0x68); if (iVar3 == 0) { uuid_unparse(local_100 + 0x68,local_58); fprintf((FILE *)local_120[7]," uuid=\"%s\"",local_58); } if (*(char *)(local_100 + 0x78) != '\0') { fprintf((FILE *)local_120[7]," label=\"%.*s\"",0x10,local_100 + 0x78); } fputs("/>\n",(FILE *)local_120[7]); } ehandler_init(*(undefined8 *)(local_138 + 8)); iVar3 = ext2fs_has_feature_mmp(*(undefined8 *)(local_138 + 0x20)); if ((iVar3 != 0) && ((local_17c & 0x100000) != 0)) { lVar7 = e2fsck_check_mmp(local_138,local_120); if (lVar7 != 0) { fatal_error(local_120,0); } ext2fs_close_free(local_120); local_17c = local_17c & 0xffefffff; goto LAB_001049a3; } if (local_120[5] != 0) { uVar4 = e2p_uuid2str(local_100 + 0x68); fprintf((FILE *)local_120[5],"Filesystem UUID: %s\n",uVar4); } if (((*(uint *)((long)local_120 + 0x7c) & 0x11) == 0) && (local_118 = e2fsck_check_ext3_journal(local_120), local_118 != 0)) { lVar7 = local_120[3]; uVar4 = gettext("while checking journal for %s"); com_err(local_120[1],local_118,uVar4,lVar7); uVar4 = gettext("Cannot proceed with file system check"); fatal_error(local_120,uVar4); } iVar3 = ext2fs_has_feature_journal_needs_recovery(local_100); if (iVar3 != 0) { if ((*(uint *)((long)local_120 + 0x4c) & 1) == 0) { if ((*(uint *)(local_120 + 9) & 0x200) != 0) { lVar7 = local_120[3]; uVar4 = gettext("unable to set superblock flags on %s\n"); com_err(local_120[1],0,uVar4,lVar7); fatal_error(local_120,0); } local_118 = e2fsck_run_ext3_journal(local_120); if (local_118 == 0x7f2bb7af) { lVar7 = local_120[3]; uVar4 = gettext("Journal checksum error found in %s\n"); log_out(local_120,uVar4,lVar7); } else if (local_118 == 0x7f2bb7ae) { lVar7 = local_120[3]; uVar4 = gettext("Journal corrupted in %s\n"); log_out(local_120,uVar4,lVar7); } else if (local_118 != 0) { lVar7 = local_120[3]; uVar4 = gettext("while recovering journal of %s"); com_err(local_120[1],local_118,uVar4,lVar7); } ext2fs_close_free(local_120); *(uint *)(local_120 + 9) = *(uint *)(local_120 + 9) | 0x200; goto LAB_001049a3; } uVar4 = gettext( "Warning: skipping journal recovery because doing a read-only filesystem check.\n" ); log_out(local_120,&DAT_00106c11,uVar4); (**(code **)(*(long *)(*(long *)(*local_120 + 8) + 8) + 0x38)) (*(undefined8 *)(*local_120 + 8)); } local_64 = *(uint *)(local_100 + 0x5c) & 0xfffff1c0; local_60 = *(uint *)(local_100 + 0x60) & 0xfffc1821; local_5c = *(uint *)(local_100 + 100) & 0xffff0884; LAB_001059ec: if (((local_64 == 0) && (local_60 == 0)) && (local_5c == 0)) break; local_e8 = &local_64; lVar7 = local_120[2]; uVar4 = gettext("%s has unsupported feature(s):"); log_err(local_120,uVar4,lVar7); for (local_160 = 0; local_160 < 3; local_160 = local_160 + 1) { local_158 = 1; for (local_15c = 0; local_15c < 0x20; local_15c = local_15c + 1) { if ((*local_e8 & local_158) != 0) { uVar4 = e2p_feature2string(local_160,local_158); log_err(local_120,&DAT_00106dd3,uVar4); } local_158 = local_158 << 1; } local_e8 = local_e8 + 1; } log_err(local_120,&DAT_00106ddf); } iVar3 = ext2fs_has_feature_casefold(local_100); if ((iVar3 == 0) || (*(long *)(local_138 + 0x168) != 0)) break; lVar7 = local_120[2]; uVar4 = gettext("%s has unsupported encoding: %0x\n"); log_err(local_120,uVar4,lVar7); } if ((local_120[0xc] != 0) && ((*(uint *)((long)local_120 + 0x4c) & 1) == 0)) { ext2fs_mark_super_dirty(local_138); } lVar7 = sysconf(0x1e); local_148 = (uint)lVar7; if (0 < (int)local_148) { local_174 = local_148; } *(uint *)(local_120 + 0x6d) = local_174 / *(uint *)(local_138 + 0x28); if (*(int *)(local_120 + 0x6d) == 0) { *(undefined4 *)(local_120 + 0x6d) = 1; } if (local_120[0xc] != 0) { set_latch_flags(0x50,4,0); } ext2fs_mark_valid(local_138); check_super_block(local_120); if ((*(uint *)(local_120 + 9) & 3) != 0) { fatal_error(local_120,0); } check_if_skip(local_120); check_resize_inode(local_120); if (bad_blocks_file == 0) { if (cflag != 0) { read_bad_blocks_file(local_120,0,keep_bad_blocks == 0); } } else { read_bad_blocks_file(local_120,bad_blocks_file,replace_bad_blocks); } if ((*(uint *)(local_120 + 9) & 3) != 0) { fatal_error(local_120,0); } ext2fs_mark_valid(local_138); local_118 = ext2fs_read_bb_inode(local_138,local_138 + 0x88); if (local_118 != 0) { uVar4 = error_message(local_118); lVar7 = local_120[1]; uVar5 = gettext("%s: %s while reading bad blocks inode\n"); log_out(local_120,uVar5,lVar7,uVar4); preenhalt(local_120); uVar4 = gettext("This doesn\'t bode well, but we\'ll try to go on...\n"); log_out(local_120,&DAT_00106c11,uVar4); } if ((*(char *)(local_100 + 0xfd) == '\x01') && (iVar3 = ext2fs_has_feature_fast_commit(local_100), iVar3 == 0)) { local_178 = *(uint *)(local_100 + 0x14c) >> 0x14 | *(int *)(local_100 + 0x148) << 0xc; } else { local_178 = 0xffffffff; } iVar3 = ext2fs_has_feature_quota(local_100); if (iVar3 != 0) { clear_problem_context(local_d8); local_d8[0] = quota_init_context(local_120 + 0x4f,*local_120,0); if (local_d8[0] != 0) { fix_problem(local_120,0x4c,local_d8); fatal_error(local_120,0); } } local_144 = e2fsck_run(local_120); e2fsck_clear_progbar(local_120); if (((*(int *)(local_120 + 0x41) == 0) && ((*(uint *)(local_120 + 9) & 0x80) != 0)) && (iVar3 = fix_problem(local_120,0x60001,local_d8), iVar3 != 0)) { if ((int)local_178 < 0x400) { ext2fs_get_journal_params(&local_e0,local_138); } else { local_e0 = local_178; local_dc = 0; } uVar2 = local_e0; uVar4 = gettext("Creating journal (%d blocks): "); log_out(local_120,uVar4,uVar2); fflush(stdout); local_118 = ext2fs_add_journal_inode3(local_138,&local_e0,0xffffffffffffffff,0); if (local_118 == 0) { uVar4 = gettext(" Done.\n"); log_out(local_120,&DAT_00106c11,uVar4); uVar4 = gettext("\n*** journal has been regenerated ***\n"); log_out(local_120,&DAT_00106c11,uVar4); } else { uVar4 = error_message(local_118); log_out(local_120,"%s: while trying to create journal\n",uVar4); } } if ((local_144 & 1) == 0) { if ((local_144 & 2) == 0) { if ((local_120[0x4f] != 0) && (*(int *)(local_120 + 0x41) == 0)) { for (local_170 = 0; local_170 < 3; local_170 = local_170 + 1) { piVar9 = (int *)quota_sb_inump(local_100,local_170); if (*piVar9 != 0) { local_184 = 0; local_88 = (ulong)local_170; local_118 = quota_compare_and_update(local_120[0x4f],local_170,&local_184); if (((local_118 != 0) || (local_184 != 0)) && ((iVar3 = fix_problem(local_120,0x60002,local_d8), iVar3 != 0 && (local_d8[0] = quota_write_inode(local_120[0x4f]), local_d8[0] != 0)))) { fix_problem(local_120,0x60006,local_d8); } } } quota_release_context(local_120 + 0x4f); } } else { if (local_120[3] == 0) { lVar7 = local_120[2]; } else { lVar7 = local_120[3]; } uVar4 = gettext("%s: e2fsck canceled.\n"); log_out(local_120,uVar4,lVar7); local_180 = local_180 | 0x20; } } else { uVar4 = gettext("aborted"); fatal_error(local_120,uVar4); } if (local_144 != 4) { local_140 = ext2fs_test_changed(local_138); if (((*(uint *)(local_120 + 9) & 7) == 0) && ((*(uint *)((long)local_120 + 0x4c) & 1) == 0)) { iVar3 = ext2fs_test_valid(local_138); if (iVar3 == 0) { *(ushort *)(local_100 + 0x3a) = *(ushort *)(local_100 + 0x3a) & 0xfffe; } else { if ((*(ushort *)(local_100 + 0x3a) & 1) == 0) { local_180 = local_180 | 1; } *(undefined2 *)(local_100 + 0x3a) = 1; iVar3 = check_backup_super_block(local_120); if (iVar3 != 0) { *(uint *)(local_138 + 0x10) = *(uint *)(local_138 + 0x10) & 0xfffffdff; } } if ((*(uint *)(local_120 + 9) & 0x2000) == 0) { *(int *)(local_100 + 0x40) = (int)local_120[0x69]; } *(undefined2 *)(local_100 + 0x34) = 0; memset((void *)(local_100 + 0x194),0,0x6c); local_d8[0] = ext2fs_set_gdt_csum(*local_120); if (local_d8[0] != 0) { fix_problem(local_120,0x60003,local_d8); } ext2fs_mark_super_dirty(local_138); } iVar3 = ext2fs_has_feature_shared_blocks(*(undefined8 *)(*local_120 + 0x20)); if (((iVar3 == 0) || ((*(uint *)((long)local_120 + 0x4c) & 0x40000) == 0)) || ((*(uint *)((long)local_120 + 0x4c) & 8) == 0)) { if ((*(uint *)((long)local_120 + 0x4c) & 1) == 0) { e2fsck_write_bitmaps(local_120); if (((*(uint *)(local_138 + 0x10) & 4) != 0) && (local_d8[0] = ext2fs_flush(*local_120), local_d8[0] != 0)) { fix_problem(local_120,0x60004,local_d8); } local_d8[0] = (**(code **)(*(long *)(*(long *)(*local_120 + 8) + 8) + 0x38)) (*(undefined8 *)(*local_120 + 8)); if (local_d8[0] != 0) { fix_problem(local_120,0x60005,local_d8); } } if (local_140 != 0) { local_13c = *(uint *)(local_120 + 9) & 0x4000; if (local_13c != 0) { local_180 = local_180 | 1; } if ((*(uint *)((long)local_120 + 0x4c) & 2) == 0) { lVar7 = local_120[3]; uVar4 = gettext("\n%s: ***** FILE SYSTEM WAS MODIFIED *****\n"); log_out(local_120,uVar4,lVar7); } if ((*(uint *)((long)local_120 + 0x7c) & 2) != 0) { lVar7 = local_120[3]; uVar4 = gettext("%s: ***** REBOOT SYSTEM *****\n"); log_out(local_120,uVar4,lVar7); local_180 = local_180 | 2; } } } iVar3 = ext2fs_test_valid(local_138); if ((iVar3 == 0) || (((local_180 & 0x20) != 0 && ((*(ushort *)(local_100 + 0x3a) & 2) != 0)))) { lVar7 = local_120[3]; uVar4 = gettext("\n%s: ********** WARNING: Filesystem still has errors **********\n\n"); log_out(local_120,uVar4,lVar7); local_180 = local_180 & 0xfffffffe | 4; } if ((local_180 & 0x20) == 0) { show_stats(local_120); } else { profile_get_boolean(local_120[0x6c],"options","allow_cancellation",0,0,&local_184); local_180 = local_180 & 0xfffffffe; if ((((local_184 != 0) && (iVar3 = ext2fs_test_valid(local_138), iVar3 != 0)) && ((*(ushort *)(local_100 + 0x3a) & 1) != 0)) && ((*(ushort *)(local_100 + 0x3a) & 2) == 0)) { local_180 = 0; } } print_resource_track(local_120,0,local_120 + 0x50,*(undefined8 *)(*local_120 + 8)); ext2fs_close_free(local_120); free((void *)local_120[0x4e]); if (local_120[5] != 0) { fprintf((FILE *)local_120[5],"Exit status: %d\n",(ulong)local_180); } e2fsck_free_context(local_120); remove_error_table(&et_ext2_error_table); remove_error_table(&et_prof_error_table); if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return local_180; } __stack_chk_fail(); } uVar4 = gettext("Restarting e2fsck from the beginning...\n"); log_out(local_120,&DAT_00106c11,uVar4); local_118 = e2fsck_reset_context(local_120); if (local_118 != 0) { uVar4 = gettext("while resetting context"); com_err(local_120[1],local_118,&DAT_00106c11,uVar4); fatal_error(local_120,0); } ext2fs_close_free(local_120); } goto LAB_001049a3; }
static void write_to_file (intmax_t last_line, _Bool ignore, int argnum) { struct cstring *line; intmax_t first_line; intmax_t lines; intmax_t i; first_line = get_first_line_in_buffer (); if (first_line > last_line) { error (0, 0, gettext ("%s: line number out of range"), quote (global_argv[argnum])); cleanup_fatal (); } lines = last_line - first_line; for (i = 0; i < lines; i++) { line = remove_line (); if (line == ((void *)0) ) { error (0, 0, gettext ("%s: line number out of range"), quote (global_argv[argnum])); cleanup_fatal (); } if (!ignore) save_line_to_file (line); } }
void write_to_file(long param_1,char param_2,int param_3) { long lVar1; undefined8 uVar2; undefined8 uVar3; long lVar4; long local_38; lVar1 = get_first_line_in_buffer(); if (param_1 < lVar1) { uVar2 = quote(*(undefined8 *)(global_argv + (long)param_3 * 8)); uVar3 = gettext("%s: line number out of range"); error(0,0,uVar3,uVar2); cleanup_fatal(); } local_38 = 0; while( true ) { if (param_1 - lVar1 <= local_38) { return; } lVar4 = remove_line(); if (lVar4 == 0) break; if (param_2 != '\x01') { save_line_to_file(lVar4); } local_38 = local_38 + 1; } uVar2 = quote(*(undefined8 *)(global_argv + (long)param_3 * 8)); uVar3 = gettext("%s: line number out of range"); error(0,0,uVar3,uVar2); cleanup_fatal(); }
static void process_rename(u_int32_t id) { char *oldpath, *newpath; int r, status; struct stat sb; if ((r = sshbuf_get_cstring(iqueue, &oldpath, ((void *)0) )) != 0 || (r = sshbuf_get_cstring(iqueue, &newpath, ((void *)0) )) != 0) sshfatal("sftp-server.c", __func__, 1276, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); sshlog("sftp-server.c", __func__, 1278, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "request %u: rename", id); sshlog("sftp-server.c", __func__, 1279, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "rename old \"%s\" new \"%s\"", oldpath, newpath); status = 4; if (lstat(oldpath, &sb) == -1) status = errno_to_portable( (*__errno_location ()) ); else if ( (((( sb.st_mode )) & 0170000) == (0100000)) ) { if (link(oldpath, newpath) == -1) { if ( (*__errno_location ()) == 95 || (*__errno_location ()) == 38 || (*__errno_location ()) == 18 || (*__errno_location ()) == 1 ) { struct stat st; if (stat(newpath, &st) == -1) { if (rename(oldpath, newpath) == -1) status = errno_to_portable( (*__errno_location ()) ); else status = 0; } } else { status = errno_to_portable( (*__errno_location ()) ); } } else if (unlink(oldpath) == -1) { status = errno_to_portable( (*__errno_location ()) ); unlink(newpath); } else status = 0; } else if (stat(newpath, &sb) == -1) { if (rename(oldpath, newpath) == -1) status = errno_to_portable( (*__errno_location ()) ); else status = 0; } send_status(id, status); free(oldpath); free(newpath); }
unsigned long process_rename(unsigned int a1) { long v1; int *v2; int *v3; unsigned int cstring; unsigned int v6; unsigned int v7; unsigned int v8; char *file; char *to; struct stat v11; struct stat v12; unsigned long v13; v13 = __readfsqword(0x28u); cstring = sshbuf_get_cstring(iqueue, &file, 0LL); if ( cstring || (cstring = sshbuf_get_cstring(iqueue, &to, 0LL)) != 0 ) { v1 = ssh_err(cstring); sshfatal("sftp-server.c", "process_rename", 1276LL, 1LL, 1LL, v1, "parse"); } sshlog("sftp-server.c", "process_rename", 1278LL, 0LL, 7LL, 0LL, "request %u: rename", a1); sshlog("sftp-server.c", "process_rename", 1279LL, 0LL, 3LL, 0LL, "rename old \"%s\" new \"%s\"", file, to); v6 = 4; if ( lstat(file, &v11) == -1 ) goto LABEL_21; if ( (v11.st_mode & 0xF000) != 0x8000 ) { if ( stat(to, &v11) == -1 ) { if ( rename(file, to) == -1 ) goto LABEL_21; v6 = 0; } LABEL_23: send_status(a1, v6); goto LABEL_24; } if ( link(file, to) == -1 ) { if ( *_errno_location() != 95 && *_errno_location() != 38 && *_errno_location() != 18 && *_errno_location() != 1 ) goto LABEL_21; if ( stat(to, &v12) == -1 ) { if ( rename(file, to) != -1 ) goto LABEL_14; LABEL_21: v3 = _errno_location(); v8 = errno_to_portable(*v3); send_status(a1, v8); goto LABEL_24; } goto LABEL_23; } if ( unlink(file) == -1 ) { v2 = _errno_location(); v7 = errno_to_portable(*v2); unlink(to); send_status(a1, v7); goto LABEL_24; } LABEL_14: send_status(a1, 0); LABEL_24: free(file); free(to); return __readfsqword(0x28u) ^ v13; }
void usage (FILE *out, int status) { const char str[] = "ocsptool - GnuTLS OCSP tool\n" "Usage: ocsptool [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \n" "\n" "None:\n" "\n" " -d, --debug=num Enable debugging\n" " - it must be in the range:\n" " 0 to 9999\n" " -V, --verbose More verbose output\n" " --infile=file Input file\n" " - file must pre-exist\n" " --outfile=str Output file\n" " --ask[=str] Ask an OCSP/HTTP server on a certificate validity\n" " -e, --verify-response Verify response\n" " -i, --request-info Print information on a OCSP request\n" " -j, --response-info Print information on a OCSP response\n" " -q, --generate-request Generates an OCSP request\n" " --nonce Use (or not) a nonce to OCSP request\n" " --load-chain=file Reads a set of certificates forming a chain from file\n" " - file must pre-exist\n" " --load-issuer=file Reads issuer's certificate from file\n" " - file must pre-exist\n" " --load-cert=file Reads the certificate to check from file\n" " - file must pre-exist\n" " --load-trust=file Read OCSP trust anchors from file\n" " - prohibits the option 'load-signer'\n" " - file must pre-exist\n" " --load-signer=file Reads the OCSP response signer from file\n" " - prohibits the option 'load-trust'\n" " - file must pre-exist\n" " --inder Use DER format for input certificates and private keys\n" " --outder Use DER format for output of responses (this is the default)\n" " --outpem Use PEM format for output of responses\n" " -Q, --load-request=file Reads the DER encoded OCSP request from file\n" " - file must pre-exist\n" " -S, --load-response=file Reads the DER encoded OCSP response from file\n" " - file must pre-exist\n" " --ignore-errors Ignore any verification errors\n" " --verify-allow-broken Allow broken algorithms, such as MD5 for verification\n" "\n" "Version, usage and configuration options:\n" "\n" " -v, --version[=arg] output version information and exit\n" " -h, --help display extended usage information and exit\n" " -!, --more-help extended usage information passed thru pager\n" "\n" "Options are specified by doubled hyphens and their name or by a single\n" "hyphen and the flag character.\n" "\n" "ocsptool is a program that can parse and print information about\n" "OCSP requests/responses, generate requests and verify responses. Unlike\n" "other GnuTLS applications it outputs DER encoded structures by default\n" "unless the '--outpem' option is specified.\n" "\n" "Please send bug reports to: <bugs@gnutls.org>\n" "\n"; fprintf (out, "%s", str); exit (status); }
void usage(void* a0, unsigned long a1) { unsigned int v0; void* v1; unsigned long v2; unsigned long v3; unsigned long long *v5; unsigned long long v6; unsigned long long v7; unsigned long v8; unsigned long long *v9; v1 = a0; v0 = a1; v3 = v5[5]; v6 = 320; v9 = &v2; for (v7 = "ocsptool - GnuTLS OCSP tool\nUsage: ocsptool [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \n\nNone:\n\n -d, --debug=num Enable debugging\n\t\t\t\t- it must be in the range:\n\t\t\t\t 0 to 9999\n -V, --verbose More verbose output\n --infile=file Input file\n\t\t\t\t- file must pre-exist\n --outfile=str Output file\n --ask[=str] Ask an OCSP/HTTP server on a certificate validity\n -e, --verify-response Verify response\n -i, --request-info Print information on a OCSP request\n -j, --response-info Print information on a OCSP response\n -q, --generate-request Generates an OCSP request\n --nonce Use (or not) a nonce to OCSP request\n --load-chain=file Reads a set of certificates forming a chain from file\n\t\t\t\t- file must pre-exist\n --load-issuer=file Reads issuer's certificate from file\n\t\t\t\t- file must pre-exist\n --load-cert=file Reads the certificate to check from file\n\t\t\t\t- file must"; v6; v7 += v8 * 8) { v6 -= 1; v2 = *(v7); v9 = &v9[v8]; } fprintf(v1, "%s", &v2); exit(v0); }