input
stringlengths
28
169k
output
stringlengths
20
317k
static void build_tree() { int nodes = 0; int len; uch *prefixp; for (len = max_len; len >= 1; len--) { nodes >>= 1; parents[len] = nodes; lit_base[len] -= nodes; nodes += leaves[len]; } if ((nodes >> 1) != 1) gzip_error ("too few leaves in Huffman tree"); peek_bits = ((max_len) <= (12) ? (max_len) : (12)); prefixp = &outbuf[1<<peek_bits]; for (len = 1; len <= peek_bits; len++) { int prefixes = leaves[len] << (peek_bits-len); while (prefixes--) *--prefixp = (uch)len; } while (prefixp > outbuf) *--prefixp = 0; }
void build_tree(void) { int local_1c; int local_18; int local_14; char *local_10; local_1c = 0; for (local_18 = max_len; local_1c = local_1c >> 1, 0 < local_18; local_18 = local_18 + -1) { *(int *)(parents + (long)local_18 * 4) = local_1c; *(int *)(lit_base + (long)local_18 * 4) = *(int *)(lit_base + (long)local_18 * 4) - local_1c; local_1c = local_1c + *(int *)(leaves + (long)local_18 * 4); } if (local_1c != 1) { gzip_error("too few leaves in Huffman tree"); } peek_bits = max_len; if (0xc < max_len) { peek_bits = 0xc; } local_10 = &outbuf + (1 << ((byte)peek_bits & 0x1f)); for (local_18 = 1; local_18 <= peek_bits; local_18 = local_18 + 1) { local_14 = *(int *)(leaves + (long)local_18 * 4) << ((char)peek_bits - (char)local_18 & 0x1fU); while (local_14 != 0) { local_10 = local_10 + -1; *local_10 = (char)local_18; local_14 = local_14 + -1; } } while (&outbuf < local_10) { local_10 = local_10 + -1; *local_10 = '\0'; } return; }
static int parse_encap_ip(struct rtattr *rta, size_t len, int *argcp, char ***argvp) { int id_ok = 0, dst_ok = 0, src_ok = 0, tos_ok = 0, ttl_ok = 0; int key_ok = 0, csum_ok = 0, seq_ok = 0, opts_ok = 0; char **argv = *argvp; int argc = *argcp; int ret = 0; __u16 flags = 0; while (argc > 0) { if (strcmp(*argv, "id") == 0) { __u64 id; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (id_ok++) duparg2("id", *argv); if (get_be64(&id, *argv, 0)) invarg("\"id\" value is invalid\n", *argv); ret = rta_addattr64(rta, len, LWTUNNEL_IP_ID, id); } else if (strcmp(*argv, "dst") == 0) { inet_prefix addr; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (dst_ok++) duparg2("dst", *argv); get_addr(&addr, *argv, 2 ); ret = rta_addattr_l(rta, len, LWTUNNEL_IP_DST, &addr.data, addr.bytelen); } else if (strcmp(*argv, "src") == 0) { inet_prefix addr; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (src_ok++) duparg2("src", *argv); get_addr(&addr, *argv, 2 ); ret = rta_addattr_l(rta, len, LWTUNNEL_IP_SRC, &addr.data, addr.bytelen); } else if (strcmp(*argv, "tos") == 0) { __u32 tos; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (tos_ok++) duparg2("tos", *argv); if (rtnl_dsfield_a2n(&tos, *argv)) invarg("\"tos\" value is invalid\n", *argv); ret = rta_addattr8(rta, len, LWTUNNEL_IP_TOS, tos); } else if (strcmp(*argv, "ttl") == 0) { __u8 ttl; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (ttl_ok++) duparg2("ttl", *argv); if (get_u8(&ttl, *argv, 0)) invarg("\"ttl\" value is invalid\n", *argv); ret = rta_addattr8(rta, len, LWTUNNEL_IP_TTL, ttl); } else if (strcmp(*argv, "geneve_opts") == 0) { struct rtattr *nest; if (opts_ok++) duparg2("opts", *argv); do { argv++; if (--argc <= 0) incomplete_command(); } while(0); nest = rta_nest(rta, len, LWTUNNEL_IP_OPTS | (1 << 15)); ret = lwtunnel_parse_geneve_opts(*argv, len, rta); if (ret) invarg("\"geneve_opts\" value is invalid\n", *argv); rta_nest_end(rta, nest); } else if (strcmp(*argv, "vxlan_opts") == 0) { struct rtattr *nest; if (opts_ok++) duparg2("opts", *argv); do { argv++; if (--argc <= 0) incomplete_command(); } while(0); nest = rta_nest(rta, len, LWTUNNEL_IP_OPTS | (1 << 15)); ret = lwtunnel_parse_vxlan_opts(*argv, len, rta); if (ret) invarg("\"vxlan_opts\" value is invalid\n", *argv); rta_nest_end(rta, nest); } else if (strcmp(*argv, "erspan_opts") == 0) { struct rtattr *nest; if (opts_ok++) duparg2("opts", *argv); do { argv++; if (--argc <= 0) incomplete_command(); } while(0); nest = rta_nest(rta, len, LWTUNNEL_IP_OPTS | (1 << 15)); ret = lwtunnel_parse_erspan_opts(*argv, len, rta); if (ret) invarg("\"erspan_opts\" value is invalid\n", *argv); rta_nest_end(rta, nest); } else if (strcmp(*argv, "key") == 0) { if (key_ok++) duparg2("key", *argv); flags |= ((__be16)(__builtin_constant_p((__u16)(( 0x04 ))) ? ((__u16)( (((__u16)(( 0x04 )) & (__u16)0x00ffU) << 8) | (((__u16)(( 0x04 )) & (__u16)0xff00U) >> 8))) : __fswab16(( 0x04 )))) ; } else if (strcmp(*argv, "csum") == 0) { if (csum_ok++) duparg2("csum", *argv); flags |= ((__be16)(__builtin_constant_p((__u16)(( 0x01 ))) ? ((__u16)( (((__u16)(( 0x01 )) & (__u16)0x00ffU) << 8) | (((__u16)(( 0x01 )) & (__u16)0xff00U) >> 8))) : __fswab16(( 0x01 )))) ; } else if (strcmp(*argv, "seq") == 0) { if (seq_ok++) duparg2("seq", *argv); flags |= ((__be16)(__builtin_constant_p((__u16)(( 0x08 ))) ? ((__u16)( (((__u16)(( 0x08 )) & (__u16)0x00ffU) << 8) | (((__u16)(( 0x08 )) & (__u16)0xff00U) >> 8))) : __fswab16(( 0x08 )))) ; } else { break; } if (ret) break; argc--; argv++; } if (flags) ret = rta_addattr16(rta, len, LWTUNNEL_IP_FLAGS, flags); *argcp = argc + 1; *argvp = argv - 1; return ret; }
int parse_encap_ip(undefined8 param_1,ulong param_2,int *param_3,long *param_4) { int iVar1; long in_FS_OFFSET; ushort local_16e; int local_16c; int local_168; int local_164; int local_160; int local_15c; int local_158; int local_154; int local_150; int local_14c; int local_148; int local_144; undefined local_140 [8]; char **local_138; undefined8 local_130; undefined8 local_128; undefined8 local_120; undefined local_118 [2]; undefined2 local_116; undefined local_110 [256]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_16c = 0; local_168 = 0; local_164 = 0; local_160 = 0; local_15c = 0; local_158 = 0; local_154 = 0; local_150 = 0; local_14c = 0; local_138 = (char **)*param_4; local_148 = *param_3; local_144 = 0; local_16e = 0; for (; 0 < local_148; local_148 = local_148 + -1) { iVar1 = strcmp(*local_138,"id"); if (iVar1 == 0) { local_138 = local_138 + 1; local_148 = local_148 + -1; if (local_148 < 1) { incomplete_command(); } if (local_16c != 0) { duparg2(&DAT_00106f80,*local_138); } iVar1 = get_be64(local_140,*local_138,0); if (iVar1 != 0) { invarg("\"id\" value is invalid\n",*local_138); } local_144 = rta_addattr64(param_1,param_2 & 0xffffffff,1); local_16c = local_16c + 1; } else { iVar1 = strcmp(*local_138,"dst"); if (iVar1 == 0) { local_138 = local_138 + 1; local_148 = local_148 + -1; if (local_148 < 1) { incomplete_command(); } if (local_168 != 0) { duparg2(&DAT_00106f03,*local_138); } get_addr(local_118,*local_138,2); local_144 = rta_addattr_l(param_1,param_2 & 0xffffffff,2,local_110,local_116); local_168 = local_168 + 1; } else { iVar1 = strcmp(*local_138,"src"); if (iVar1 == 0) { local_138 = local_138 + 1; local_148 = local_148 + -1; if (local_148 < 1) { incomplete_command(); } if (local_164 != 0) { duparg2(&DAT_00106f8b,*local_138); } get_addr(local_118,*local_138,2); local_144 = rta_addattr_l(param_1,param_2 & 0xffffffff,3,local_110,local_116); local_164 = local_164 + 1; } else { iVar1 = strcmp(*local_138,"tos"); if (iVar1 == 0) { local_138 = local_138 + 1; local_148 = local_148 + -1; if (local_148 < 1) { incomplete_command(); } if (local_160 != 0) { duparg2(&DAT_00106f9f,*local_138); } iVar1 = rtnl_dsfield_a2n(local_140,*local_138); if (iVar1 != 0) { invarg("\"tos\" value is invalid\n",*local_138); } local_144 = rta_addattr8(param_1,param_2 & 0xffffffff,5); local_160 = local_160 + 1; } else { iVar1 = strcmp(*local_138,"ttl"); if (iVar1 == 0) { local_138 = local_138 + 1; local_148 = local_148 + -1; if (local_148 < 1) { incomplete_command(); } if (local_15c != 0) { duparg2(&DAT_00106f0f,*local_138); } iVar1 = get_u8(local_140,*local_138,0); if (iVar1 != 0) { invarg("\"ttl\" value is invalid\n",*local_138); } local_144 = rta_addattr8(param_1,param_2 & 0xffffffff,4); local_15c = local_15c + 1; } else { iVar1 = strcmp(*local_138,"geneve_opts"); if (iVar1 == 0) { if (local_14c != 0) { duparg2(&DAT_00107373,*local_138); } local_138 = local_138 + 1; local_148 = local_148 + -1; if (local_148 < 1) { incomplete_command(); } local_120 = rta_nest(param_1,param_2 & 0xffffffff,0x8008); local_144 = lwtunnel_parse_geneve_opts(*local_138,param_2,param_1); if (local_144 != 0) { invarg("\"geneve_opts\" value is invalid\n",*local_138); } rta_nest_end(param_1,local_120); local_14c = local_14c + 1; } else { iVar1 = strcmp(*local_138,"vxlan_opts"); if (iVar1 == 0) { if (local_14c != 0) { duparg2(&DAT_00107373,*local_138); } local_138 = local_138 + 1; local_148 = local_148 + -1; if (local_148 < 1) { incomplete_command(); } local_128 = rta_nest(param_1,param_2 & 0xffffffff,0x8008); local_144 = lwtunnel_parse_vxlan_opts(*local_138,param_2,param_1); if (local_144 != 0) { invarg("\"vxlan_opts\" value is invalid\n",*local_138); } rta_nest_end(param_1,local_128); local_14c = local_14c + 1; } else { iVar1 = strcmp(*local_138,"erspan_opts"); if (iVar1 == 0) { if (local_14c != 0) { duparg2(&DAT_00107373,*local_138); } local_138 = local_138 + 1; local_148 = local_148 + -1; if (local_148 < 1) { incomplete_command(); } local_130 = rta_nest(param_1,param_2 & 0xffffffff,0x8008); local_144 = lwtunnel_parse_erspan_opts(*local_138,param_2,param_1); if (local_144 != 0) { invarg("\"erspan_opts\" value is invalid\n",*local_138); } rta_nest_end(param_1,local_130); local_14c = local_14c + 1; } else { iVar1 = strcmp(*local_138,"key"); if (iVar1 == 0) { if (local_158 != 0) { duparg2(&DAT_00106fa8,*local_138); } local_16e = local_16e | 0x400; local_158 = local_158 + 1; } else { iVar1 = strcmp(*local_138,"csum"); if (iVar1 == 0) { if (local_154 != 0) { duparg2(&DAT_00106fb2,*local_138); } local_16e = local_16e | 0x100; local_154 = local_154 + 1; } else { iVar1 = strcmp(*local_138,"seq"); if (iVar1 != 0) break; if (local_150 != 0) { duparg2(&DAT_00106fbc,*local_138); } local_16e = local_16e | 0x800; local_150 = local_150 + 1; } } } } } } } } } } if (local_144 != 0) break; local_138 = local_138 + 1; } if (local_16e != 0) { local_144 = rta_addattr16(param_1,param_2 & 0xffffffff,6,local_16e); } *param_3 = local_148 + 1; *param_4 = (long)(local_138 + -1); if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return local_144; } __stack_chk_fail(); }
static void cfg_external_free(struct cfg_external *ext) { free(ext); }
void cfg_external_free(void* a0) { unsigned long long v1; v1 = free(a0); return; }
const char *raw_to_hex(const unsigned char *raw, size_t raw_size) { static char buf[1024]; size_t i; if (raw_size == 0) return "(empty)"; if (raw_size * 2 + 1 >= sizeof(buf)) return "(too large)"; for (i = 0; i < raw_size; i++) { sprintf(&(buf[i * 2]), "%02x", raw[i]); } buf[sizeof(buf) - 1] = '\0'; return buf; }
const char * raw_to_hex(long a1, unsigned long a2) { unsigned long i; if ( !a2 ) return "(empty)"; if ( 2 * a2 + 1 > 0x3FF ) return "(too large)"; for ( i = 0LL; i < a2; ++i ) sprintf(&buf_11892[2 * i], "%02x", *(unsigned char *)(a1 + i)); byte_413F = 0; return buf_11892; }
static void verify_certificate(common_info_st * cinfo) { char *cert; char *cas = ((void *)0) ; size_t cert_size; cert = (void *) _gnutls_fread_file(infile, 0, &cert_size); if (cert == ((void *)0) ) { fprintf( stderr , "Error reading certificate chain"); app_exit(1); } _verify_x509_mem(cert, cert_size, cinfo, 1, certtool_options.arg.verify_purpose, certtool_options.arg.verify_hostname, certtool_options.arg.verify_email); free(cert); free(cas); }
void verify_certificate(unsigned long long a0) { char v0; void* v1; void* v2; char v3; unsigned long long *v5; unsigned long long v6; v1 = 0; v2 = _gnutls_fread_file(infile, 0x0, &v0); if (!v2) { fprintf(stderr, "Error reading certificate chain"); app_exit(0x1); } _verify_x509_mem(v2, *(&v0), a0, 0x1, get_organization_crt_set, get_state_crt_set, get_locality_crt_set); free(v2); free(v1); v6 = *(&v3) ^ v5[5]; return; }
char * assoc_to_string (h, sep, quoted) HASH_TABLE *h; char *sep; int quoted; { BUCKET_CONTENTS *tlist; int i; char *result, *t, *w; WORD_LIST *list, *l; if (h == 0) return ((char *) ((void *)0) ); if (((h)->nentries == 0)) return ((char *)strcpy (sh_xmalloc((1 + strlen ("")), "assoc.c", 585), (""))); result = ((void *)0) ; l = list = ((void *)0) ; for (i = 0; i < h->nbuckets; i++) for (tlist = ((h && (i < h->nbuckets)) ? h->bucket_array[i] : (BUCKET_CONTENTS *) ((void *)0) ); tlist; tlist = tlist->next) { w = (char *)tlist->data; if (w == 0) continue; t = quoted ? quote_string (w) : (char *)strcpy (sh_xmalloc((1 + strlen (w)), "assoc.c", 598), (w)); list = make_word_list (make_bare_word(t), list); do { if (t) sh_xfree((t), "assoc.c", 600); } while (0); } l = ((list && list->next) ? (WORD_LIST *)list_reverse ((GENERIC_LIST *)list) : (WORD_LIST *)(list)); result = l ? string_list_internal (l, sep) : (char *)strcpy (sh_xmalloc((1 + strlen ("")), "assoc.c", 605), ("")); dispose_words (l); return result; }
char * assoc_to_string(long *param_1,undefined8 param_2,int param_3) { char *pcVar1; size_t sVar2; char *__dest; undefined8 uVar3; int local_3c; undefined8 *local_38; long *local_30; if (param_1 == (long *)0x0) { pcVar1 = (char *)0x0; } else if (*(int *)((long)param_1 + 0xc) == 0) { sVar2 = strlen(""); pcVar1 = (char *)sh_xmalloc(sVar2 + 1,"assoc.c",0x249); pcVar1 = strcpy(pcVar1,""); } else { local_30 = (long *)0x0; for (local_3c = 0; local_3c < *(int *)(param_1 + 1); local_3c = local_3c + 1) { if ((param_1 == (long *)0x0) || (*(int *)(param_1 + 1) <= local_3c)) { local_38 = (undefined8 *)0x0; } else { local_38 = *(undefined8 **)(*param_1 + (long)local_3c * 8); } for (; local_38 != (undefined8 *)0x0; local_38 = (undefined8 *)*local_38) { pcVar1 = (char *)local_38[2]; if (pcVar1 != (char *)0x0) { if (param_3 == 0) { sVar2 = strlen(pcVar1); __dest = (char *)sh_xmalloc(sVar2 + 1,"assoc.c",0x256); pcVar1 = strcpy(__dest,pcVar1); } else { pcVar1 = (char *)quote_string(pcVar1); } uVar3 = make_bare_word(pcVar1); local_30 = (long *)make_word_list(uVar3,local_30); if (pcVar1 != (char *)0x0) { sh_xfree(pcVar1,"assoc.c",600); } } } } if ((local_30 != (long *)0x0) && (*local_30 != 0)) { local_30 = (long *)list_reverse(local_30); } if (local_30 == (long *)0x0) { sVar2 = strlen(""); pcVar1 = (char *)sh_xmalloc(sVar2 + 1,"assoc.c",0x25d); pcVar1 = strcpy(pcVar1,""); } else { pcVar1 = (char *)string_list_internal(local_30,param_2); } dispose_words(local_30); } return pcVar1; }
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); }
static int getchr(void) { int val = 0; if (*gargv) val = **gargv++; return val; }
int getchr() { unsigned int v0; int tmp_6; v0 = 0; if (*(gargv)) { tmp_6 = gargv; gargv = gargv + 8; v0 = *(*(tmp_6)); } return v0; }
static int visible_array_vars (var) SHELL_VAR *var; { return (((((var)->attributes) & (0x0001000))) == 0 && (((((var)->attributes) & (0x0000004))) || ((((var)->attributes) & (0x0000040))))); }
long long visible_array_vars(struct_0 *a0) { unsigned long long v1; if (!(a0->field_28 & 0x1000)) { if ((a0->field_28 & 4)) { LABEL_407e02: v1 = 1; goto LABEL_407e0e; } else if (!(!(a0->field_28 & 64))) { goto LABEL_407e02; } } v1 = 0; LABEL_407e0e: return v1; }
static const char * rsa_hash_alg_ident(int hash_alg) { switch (hash_alg) { case 1: return "ssh-rsa"; case 2: return "rsa-sha2-256"; case 4: return "rsa-sha2-512"; } return ((void *)0) ; }
int rsa_hash_alg_ident(unsigned long a0) { unsigned int v1; if (a0 == 4) { v1 = &g_400f45; } else { if (a0 <= 4) { if (a0 == 1) { v1 = &g_400f30; goto LABEL_400045; } if (a0 == 2) { v1 = &g_400f38; goto LABEL_400045; } } v1 = 0; } LABEL_400045: return v1; }
sshbuf_froms(b, &webauthn_wrapper) != 0 || sshbuf_froms(b, &webauthn_exts) != 0) { ret = -4; goto out; }
void sshbuf_froms(void) { halt_baddata(); }
int ssh_packet_check_rekey(struct ssh *ssh) { if (!ssh_packet_need_rekeying(ssh, 0)) return 0; sshlog("packet.c", __func__, 1010, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "rekex triggered"); return kex_start_rekex(ssh); }
undefined8 ssh_packet_check_rekey(undefined8 param_1) { int iVar1; undefined8 uVar2; uVar2 = 0x101f31; iVar1 = ssh_packet_need_rekeying(param_1,0); if (iVar1 == 0) { uVar2 = 0; } else { sshlog("packet.c","ssh_packet_check_rekey",0x3f2,1,7,0,"rekex triggered",uVar2); uVar2 = kex_start_rekex(param_1); } return uVar2; }
static int setenv_TZ (char const *tz) { return tz ? setenv ("TZ", tz, 1) : unsetenv ("TZ"); }
void setenv_TZ(char *param_1) { if (param_1 == (char *)0x0) { unsetenv("TZ"); } else { setenv("TZ",param_1,1); } return; }
struct sshkey * get_hostkey_by_index(int ind) { if (ind < 0 || (u_int)ind >= options.num_host_key_files) return ( ((void *)0) ); return (sensitive_data.host_keys[ind]); }
long long get_hostkey_by_index(unsigned long a0) { void* v1; if (a0 >= 0 && 1221591368 > a0) v1 = *((0x7097058d480000 + a0 * 8)); if (1221591368 <= a0 || a0 < 0) v1 = 0; return v1; }
void xheader_xattr_add (struct tar_stat_info *st, const char *key, const char *val, size_t len) { size_t klen = strlen (key); char *xkey = xmalloc (strlen("SCHILY.xattr.") + klen + 1); char *tmp = xkey; tmp = stpcpy (tmp, "SCHILY.xattr."); stpcpy (tmp, key); xheader_xattr__add (&st->xattr_map, &st->xattr_map_size, xkey, val, len); free (xkey); }
void xheader_xattr_add(long param_1,char *param_2,undefined8 param_3,undefined8 param_4) { size_t sVar1; size_t sVar2; char *__dest; char *__dest_00; sVar1 = strlen(param_2); sVar2 = strlen("SCHILY.xattr."); __dest = (char *)xmalloc(sVar2 + sVar1 + 1); __dest_00 = stpcpy(__dest,"SCHILY.xattr."); stpcpy(__dest_00,param_2); xheader_xattr__add(param_1 + 0x160,param_1 + 0x158,__dest,param_3,param_4); free(__dest); return; }
void dispose_used_env_vars () { if (temporary_env) { dispose_temporary_env (propagate_temp_var); maybe_make_export_env (); } }
void dispose_used_env_vars(void) { if (temporary_env != 0) { dispose_temporary_env(propagate_temp_var); maybe_make_export_env(); } return; }
vi_substitute_line(EditLine *el, wint_t c __attribute__((__unused__))) { cv_undo(el); cv_yank(el, el->el_line.buffer, (int)(el->el_line.lastchar - el->el_line.buffer)); (void) em_kill_line(el, 0); el->el_map.current = el->el_map.key; return 4; }
long long vi_substitute_line(unsigned long long a0[129], unsigned long a1) { unsigned int v0; v0 = a1; cv_undo(a0); cv_yank(a0, a0[10], a0[12] - a0[10] >> 2, a0[10]); em_kill_line(a0, 0x0); a0[128] = a0[127]; return 4; }
static int redir_varassign (redir, fd) REDIRECT *redir; int fd; { WORD_DESC *w; SHELL_VAR *v; w = redir->redirector.filename; v = bind_var_to_int (w->word, fd, 0); if (v == 0 || ((((v)->attributes) & (0x0000002))) || ((((v)->attributes) & (0x0004000)))) return -5; stupidly_hack_special_variables (w->word); return 0; }
undefined8 redir_varassign(long param_1,int param_2) { undefined8 *puVar1; long lVar2; undefined8 uVar3; puVar1 = *(undefined8 **)(param_1 + 8); lVar2 = bind_var_to_int(*puVar1,(long)param_2,0); if (((lVar2 == 0) || ((*(uint *)(lVar2 + 0x28) & 2) != 0)) || ((*(uint *)(lVar2 + 0x28) & 0x4000) != 0)) { uVar3 = 0xfffffffb; } else { stupidly_hack_special_variables(*puVar1); uVar3 = 0; } return uVar3; }
static void init_global_tls_stuff(void) { gnutls_x509_trust_list_t tlist; int ret; if (gnutls_cli_options.present.provider) { ret = gnutls_pkcs11_init(0, ((void *)0) ); if (ret < 0) fprintf( stderr , "pkcs11_init: %s", gnutls_strerror(ret)); else { ret = gnutls_pkcs11_add_provider(gnutls_cli_options.arg.provider, ((void *)0) ); if (ret < 0) { fprintf( stderr , "pkcs11_add_provider: %s", gnutls_strerror(ret)); exit(1); } } } if (gnutls_certificate_allocate_credentials(&xcred) < 0) { fprintf( stderr , "Certificate allocation memory error\n"); exit(1); } gnutls_certificate_set_pin_function(xcred, pin_callback, ((void *)0) ); gnutls_certificate_set_verify_flags(xcred, global_vflags); gnutls_certificate_set_flags(xcred, GNUTLS_CERTIFICATE_VERIFY_CRLS); if (gnutls_x509_trust_list_init(&tlist, 0) < 0) { fprintf( stderr , "Trust list allocation memory error\n"); exit(1); } gnutls_certificate_set_trust_list(xcred, tlist, 0); if (x509_cafile != ((void *)0) ) { ret = gnutls_x509_trust_list_add_trust_file(tlist, x509_cafile, ((void *)0) , x509ctype, (1<<1), 0); } else { if (insecure == 0) { ret = gnutls_x509_trust_list_add_system_trust(tlist, (1<<1), 0); if (ret == -1250) { fprintf( stderr , "Warning: this system doesn't support a default trust store\n"); ret = 0; } } else { ret = 0; } } if (ret < 0) { fprintf( stderr , "Error setting the x509 trust file: %s\n", gnutls_strerror(ret)); exit(1); } else { log_msg( stdout , "Processed %d CA certificate(s).\n", ret); } if (gnutls_cli_options.enabled.ca_auto_retrieve) gnutls_x509_trust_list_set_getissuer_function(tlist, getissuer_callback); if (x509_crlfile != ((void *)0) ) { ret = gnutls_certificate_set_x509_crl_file(xcred, x509_crlfile, x509ctype); if (ret < 0) { fprintf( stderr , "Error setting the x509 CRL file: %s\n", gnutls_strerror(ret)); exit(1); } else { log_msg( stdout , "Processed %d CRL(s).\n", ret); } } load_x509_keys(); load_rawpk_keys(); if (srp_username && srp_passwd) { if (gnutls_srp_allocate_client_credentials(&srp_cred) < 0) { fprintf( stderr , "SRP authentication error\n"); } gnutls_srp_set_client_credentials_function(srp_cred, srp_username_callback); } if (gnutls_psk_allocate_client_credentials(&psk_cred) < 0) { fprintf( stderr , "PSK authentication error\n"); } if (psk_username && psk_key.data) { ret = gnutls_psk_set_client_credentials(psk_cred, psk_username, &psk_key, GNUTLS_PSK_KEY_HEX); if (ret < 0) { fprintf( stderr , "Error setting the PSK credentials: %s\n", gnutls_strerror(ret)); } } else gnutls_psk_set_client_credentials_function(psk_cred, psk_callback); if (gnutls_anon_allocate_client_credentials(&anon_cred) < 0) { fprintf( stderr , "Anonymous authentication error\n"); } }
void init_global_tls_stuff() { unsigned int v0; char v1; char v2; unsigned long long *v9; unsigned long long v10; if (g_500133) { v0 = gnutls_pkcs11_init(0x0, 0x0); if (v0 < 0) { fprintf(*(&stderr), "pkcs11_init: %s", gnutls_strerror(v0)); } else { v0 = gnutls_pkcs11_add_provider(str_unknown, 0x0); if (v0 < 0) { fprintf(*(&stderr), "pkcs11_add_provider: %s", gnutls_strerror(v0)); exit(0x1); } } } if (v0 < 0 || !g_500133 || v0 >= 0) { if (gnutls_certificate_allocate_credentials(&xcred) < 0) { fprintf(*(&stderr), "Certificate allocation memory error\n"); exit(0x1); } gnutls_certificate_set_pin_function(xcred, got.pin_callback, 0x0, got.pin_callback); gnutls_certificate_set_verify_flags(xcred, global_vflags, global_vflags); gnutls_certificate_set_flags(xcred, 0x8); if (gnutls_x509_trust_list_init(&v1, 0x0) < 0) { fprintf(*(&stderr), "Trust list allocation memory error\n"); exit(0x1); } gnutls_certificate_set_trust_list(xcred, *(&v1), 0x0, *(&v1)); if (x509_cafile) { v0 = gnutls_x509_trust_list_add_trust_file(*(&v1), x509_cafile, 0x0, x509ctype, 0x2, 0x0); } else if (!insecure) { v0 = gnutls_x509_trust_list_add_system_trust(*(&v1), 0x2, 0x0); if (v0 == -1250) { fprintf(*(&stderr), "Warning: this system doesn't support a default trust store\n"); v0 = 0; } } else { v0 = 0; } if (v0 < 0) { fprintf(*(&stderr), "Error setting the x509 trust file: %s\n", gnutls_strerror(v0)); exit(0x1); } log_msg(stdout, "Processed %d CA certificate(s).\n", v0); if (g_5002ba) gnutls_x509_trust_list_set_getissuer_function(*(&v1), getissuer_callback); if (x509_crlfile) { v0 = gnutls_certificate_set_x509_crl_file(xcred, x509_crlfile, x509ctype, x509_crlfile); if (v0 < 0) { fprintf(*(&stderr), "Error setting the x509 CRL file: %s\n", gnutls_strerror(v0)); exit(0x1); } log_msg(stdout, "Processed %d CRL(s).\n", v0); } if (!x509_crlfile || v0 >= 0) { load_x509_keys(); load_rawpk_keys(); if (srp_username && srp_passwd) { if (gnutls_srp_allocate_client_credentials(&srp_cred) < 0) fprintf(*(&stderr), "SRP authentication error\n"); gnutls_srp_set_client_credentials_function(srp_cred, srp_username_callback); } if (gnutls_psk_allocate_client_credentials(&psk_cred) < 0) fprintf(*(&stderr), "PSK authentication error\n"); if (psk_username && psk_key) { v0 = gnutls_psk_set_client_credentials(psk_cred, psk_username, &psk_key, 0x1); if (v0 < 0) fprintf(*(&stderr), "Error setting the PSK credentials: %s\n", gnutls_strerror(v0)); } if (!psk_username || !psk_key) gnutls_psk_set_client_credentials_function(psk_cred, psk_callback); if (gnutls_anon_allocate_client_credentials(&anon_cred) < 0) fprintf(*(&stderr), "Anonymous authentication error\n"); v10 = *(&v2) ^ v9[5]; return; } } }
static inline void emit_mandatory_arg_note (void) { fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout ) ; }
void emit_mandatory_arg_note(void) { char *__s; FILE *__stream; __stream = stdout; __s = (char *)gettext( "\nMandatory arguments to long options are mandatory for short options too.\n" ); fputs_unlocked(__s,__stream); return; }
int main (int argc, char **argv) { unsigned int id; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdout); parse_gnu_standard_options_only (argc, argv, "hostid", "GNU coreutils", Version, 1 , usage, ("Jim Meyering"), (char const *) ((void *)0) ); if (optind < argc) { error (0, 0, gettext ("extra operand %s"), quote (argv[optind])); usage ( 1 ); } id = gethostid (); id &= 0xffffffff; printf ("%08x\n", id); return 0 ; }
int main(unsigned long a0, unsigned long long *a1) { void* v0; unsigned int v1; unsigned long long v3; set_program_name(*(a1)); setlocale(0x6, &g_4005a3); bindtextdomain("coreutils", "/usr/local/share/locale"); textdomain("coreutils"); atexit(got.close_stdout); v0 = 0; parse_gnu_standard_options_only(a0, a1, "hostid", "GNU coreutils", Version, 0x1, usage, "Jim Meyering"); if (a0 <= optind) { v1 = gethostid(); printf("%08x\n", v1); return 0; } v3 = quote(a1[optind]); error(0x0, 0x0, gettext("extra operand %s")); usage(0x1); }
static inline void mark_block_used(e2fsck_t ctx, blk64_t block) { struct problem_context pctx; clear_problem_context(&pctx); if (ext2fs_fast_test_block_bitmap2(ctx->block_found_map, block)) { if (ext2fs_has_feature_shared_blocks(ctx->fs->super) && !(ctx->options & 0x40000)) { return; } if (!ctx->block_dup_map) { pctx.errcode = e2fsck_allocate_block_bitmap(ctx->fs, (gettext ("multiply claimed block map")), 2, "block_dup_map", &ctx->block_dup_map); if (pctx.errcode) { pctx.num = 3; fix_problem(ctx, 0x010025, &pctx); ctx->flags |= 0x0001; return; } } ext2fs_fast_mark_block_bitmap2(ctx->block_dup_map, block); } else { ext2fs_fast_mark_block_bitmap2(ctx->block_found_map, block); } }
void mark_block_used(struct_0 *a0, unsigned long long a1) { char v0; unsigned long long v1; char v2; unsigned long long *v4; unsigned long long v5; clear_problem_context(&v0); if (!ext2fs_fast_test_block_bitmap2(a0->field_1a0, a1, a1)) { ext2fs_fast_mark_block_bitmap2(a0->field_1a0, a1, a1); } else { if (ext2fs_has_feature_shared_blocks(a0->field_0->field_20) && !(a0->field_4c & 0x40000)) goto LABEL_406536; if (!a0->field_1a8) { v0 = e2fsck_allocate_block_bitmap(a0->field_0, gettext("multiply claimed block map"), 0x2, "block_dup_map", &a0->field_1a8); if (v0) { v1 = 3; fix_problem(a0, 0x10025, &v0); a0->field_48 = a0->field_48 | 1; goto LABEL_406536; } } ext2fs_fast_mark_block_bitmap2(a0->field_1a8, a1, a1); } LABEL_406536: v5 = *(&v2) ^ v4[5]; return; }
void remname (struct name *name) { struct name *p; if ((p = name->prev) != ((void *)0) ) p->next = name->next; else namelist = name->next; if ((p = name->next) != ((void *)0) ) p->prev = name->prev; else nametail = name->prev; }
long long remname(unsigned long long a0[2]) { unsigned long long *v0; struct_0 *v2; v0 = a0[1]; if (v0) *(v0) = a0[0]; else namelist = a0[0]; v0 = a0[0]; if (v0) { v2 = v0; v0->field_8 = a0[1]; return v2; } v2 = a0[1]; nametail = a0[1]; return v2; }
static gnutls_x509_privkey_t generate_private_key_int(common_info_st * cinfo) { gnutls_x509_privkey_t key; int ret, key_type, bits; unsigned provable = cinfo->provable; unsigned flags = 0; gnutls_keygen_data_st kdata[8]; unsigned kdata_size = 0; gnutls_x509_spki_t spki; key_type = req_key_type; ret = gnutls_x509_privkey_init(&key); if (ret < 0) { fprintf( stderr , "privkey_init: %s", gnutls_strerror(ret)); app_exit(1); } bits = get_bits(key_type, cinfo->bits, cinfo->sec_param, 1); if (key_type == GNUTLS_PK_ECDSA || key_type == GNUTLS_PK_EDDSA_ED25519 || key_type == GNUTLS_PK_EDDSA_ED448 || key_type == GNUTLS_PK_GOST_01 || key_type == GNUTLS_PK_GOST_12_256 || key_type == GNUTLS_PK_GOST_12_512) { char name[64]; int ecc_bits; if ((((unsigned int)(bits)) & 0x80000000)) { gnutls_ecc_curve_t curve = (((unsigned int)(bits)) & 0x7FFFFFFF); ecc_bits = gnutls_ecc_curve_get_size(curve) * 8; snprintf(name, sizeof(name), "(%s)", gnutls_ecc_curve_get_name(curve)); } else { ecc_bits = bits; name[0] = 0; } fprintf(stdlog, "Generating a %d bit %s private key %s...\n", ecc_bits, gnutls_pk_algorithm_get_name(key_type), name); if (ecc_bits < 256) fprintf( stderr , "Note that ECDSA keys with size less than 256 are not widely supported.\n\n"); } else { fprintf(stdlog, "Generating a %d bit %s private key...\n", bits, gnutls_pk_algorithm_get_name(key_type)); } if (provable && (!((key_type) == GNUTLS_PK_RSA || (key_type) == GNUTLS_PK_RSA_PSS) && key_type != GNUTLS_PK_DSA)) { fprintf( stderr , "The --provable parameter can only be used with RSA and DSA keys.\n"); app_exit(1); } if (bits > 1024 && key_type == GNUTLS_PK_DSA) fprintf( stderr , "Note that DSA keys with size over 1024 may cause incompatibility problems when used with earlier than TLS 1.2 versions.\n\n"); if ((certtool_options.present.seed || provable) && ((key_type) == GNUTLS_PK_RSA || (key_type) == GNUTLS_PK_RSA_PSS)) { if (bits != 2048 && bits != 3072 && bits != 4096 && bits != 6144 && bits != 7680 && bits != 8192 && bits != 15360) { fprintf( stderr , "Note that the FIPS 186-4 key generation restricts keys to be of known lengths (2048, 3072, etc)\n"); } } ret = gnutls_x509_spki_init(&spki); if (ret < 0) { fprintf( stderr , "error in SPKI initialization: %s\n", gnutls_strerror(ret)); app_exit(1); } switch_to_pkcs8_when_needed(cinfo, key, key_type); if (cinfo->seed_size > 0) { kdata[kdata_size].type = GNUTLS_KEYGEN_SEED; kdata[kdata_size].data = (void*)cinfo->seed; kdata[kdata_size++].size = cinfo->seed_size; if (((key_type) == GNUTLS_PK_RSA || (key_type) == GNUTLS_PK_RSA_PSS)) { if ((bits == 2048 && cinfo->seed_size != 28) || (bits == 3072 && cinfo->seed_size != 32) || (bits == 4096 && cinfo->seed_size != 38) || (bits == 6144 && cinfo->seed_size != 44) || (bits == 7680 && cinfo->seed_size != 48) || (bits == 8192 && cinfo->seed_size != 50) || (bits == 15360 && cinfo->seed_size != 64)) { fprintf( stderr , "The seed size (%d) doesn't match the size of the request security level; use -d 2 for more information.\n", (int)cinfo->seed_size); } } else if (key_type == GNUTLS_PK_DSA) { if (cinfo->seed_size != 65) { fprintf( stderr , "The seed size (%d) doesn't match the size of the request security level; use -d 2 for more information.\n", (int)cinfo->seed_size); } } flags |= GNUTLS_PRIVKEY_FLAG_PROVABLE; } if (key_type == GNUTLS_PK_RSA_PSS && (cinfo->hash || certtool_options.present.salt_size)) { do { unsigned _salt_size; if (!cinfo->hash) { fprintf( stderr , "You must provide the hash algorithm and optionally the salt size for RSA-PSS\n"); app_exit(1); } if (certtool_options.present.salt_size) { _salt_size = certtool_options.value.salt_size; } else { _salt_size = gnutls_hash_get_len(cinfo->hash); } gnutls_x509_spki_set_rsa_pss_params(spki, cinfo->hash, _salt_size); } while(0); kdata[kdata_size].type = GNUTLS_KEYGEN_SPKI; kdata[kdata_size].data = (void*)spki; kdata[kdata_size++].size = sizeof(spki); } if (provable) flags |= GNUTLS_PRIVKEY_FLAG_PROVABLE; ret = gnutls_x509_privkey_generate2(key, key_type, bits, flags, kdata, kdata_size); if (ret < 0) { fprintf( stderr , "privkey_generate: %s\n", gnutls_strerror(ret)); app_exit(1); } gnutls_x509_spki_deinit(spki); ret = gnutls_x509_privkey_verify_params(key); if (ret < 0) { fprintf( stderr , "privkey_verify_params: %s\n", gnutls_strerror(ret)); app_exit(1); } return key; }
int generate_private_key_int(struct_0 *a0) { unsigned int v0; int tmp_110; int tmp_100; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned int v8; char v9; char v10; char v11; char v12; char v13; char v14; v4 = a0->field_8c; v0 = 0; v1 = 0; v5 = req_key_type; v6 = gnutls_x509_privkey_init(&v9); if (v6 < 0) { fprintf(*(&stderr), "privkey_init: %s", gnutls_strerror(v6)); app_exit(0x1); } v7 = get_bits(v5, a0->field_58, a0->field_60, 0x1); if (v5 == 4) { LABEL_4002e9: if (v7 >= 0) { v2 = v7; v14 = 0; } else { v8 = v7 & 2147483647; v2 = gnutls_ecc_curve_get_size(v8) * 8; snprintf(&v14, 0x40, "(%s)", gnutls_ecc_curve_get_name(v8)); } fprintf(*(&stdlog), "Generating a %d bit %s private key %s...\n", v2, gnutls_pk_algorithm_get_name(v5), &v14); if (v2 <= 255) fprintf(*(&stderr), "Note that ECDSA keys with size less than 256 are not widely supported.\n\n"); } else { if (v5 == 7) goto LABEL_4002e9; if (v5 == 12) goto LABEL_4002e9; if (v5 == 8) goto LABEL_4002e9; if (v5 == 9) goto LABEL_4002e9; if (v5 == 10) goto LABEL_4002e9; fprintf(*(&stdlog), "Generating a %d bit %s private key...\n", v7, gnutls_pk_algorithm_get_name(v5)); } if (v4 && v5 != 1 && v5 != 6 && v5 != 2) { fprintf(*(&stderr), "The --provable parameter can only be used with RSA and DSA keys.\n"); app_exit(0x1); } if (v7 > 0x400 && v5 == 2) fprintf(*(&stderr), "Note that DSA keys with size over 1024 may cause incompatibility problems when used with earlier than TLS 1.2 versions.\n\n"); if (!g_500091 && !v4) goto LABEL_400502; if (v5 != 1 && !(v5 == 6)) goto LABEL_400502; if (v7 != 0x800 && v7 != 0xc00 && v7 != 0x1000 && v7 != 0x1800 && v7 != 0x1e00 && v7 != 0x2000 && v7 != 0x3c00) fprintf(*(&stderr), "Note that the FIPS 186-4 key generation restricts keys to be of known lengths (2048, 3072, etc)\n"); LABEL_400502: v6 = gnutls_x509_spki_init(&v10); if (v6 < 0) { fprintf(*(&stderr), "error in SPKI initialization: %s\n", gnutls_strerror(v6)); app_exit(0x1); } switch_to_pkcs8_when_needed(a0, *(&v9), v5); if (a0->field_98) { *(&(&v11)[24 * v1]) = 1; *(&(&v12)[24 * v1]) = a0->field_90; tmp_110 = v1; v1 += 1; *(&(&v13)[24 * tmp_110]) = a0->field_98; if (v5 == 1) { LABEL_400624: if (v7 == 0x800 && !(a0->field_98 == 28)) goto LABEL_400702; if (v7 == 0xc00 && !(a0->field_98 == 32)) goto LABEL_400702; if (v7 == 0x1000 && !(a0->field_98 == 38)) goto LABEL_400702; if (v7 == 0x1800 && !(a0->field_98 == 44)) goto LABEL_400702; if (v7 == 0x1e00 && !(a0->field_98 == 48)) goto LABEL_400702; if (v7 == 0x2000 && !(a0->field_98 == 50)) goto LABEL_400702; if (!(v7 == 0x3c00)) goto LABEL_400775; if (a0->field_98 == 64) goto LABEL_400775; LABEL_400702: fprintf(*(&stderr), "The seed size (%d) doesn't match the size of the request security level; use -d 2 for more information.\n", a0->field_98); LABEL_400775: } else { if (v5 == 6) goto LABEL_400624; if (v5 == 2 && a0->field_98 != 65) fprintf(*(&stderr), "The seed size (%d) doesn't match the size of the request security level; use -d 2 for more information.\n", a0->field_98); } v0 |= 32; } if (v5 == 6) { if (!a0->field_b0 && !g_5000b9) goto LABEL_4008ac; if (!a0->field_b0) { fprintf(*(&stderr), "You must provide the hash algorithm and optionally the salt size for RSA-PSS\n"); app_exit(0x1); } if (g_5000b9) v3 = gnutls_x509_crt_get_expiration_time; else v3 = gnutls_hash_get_len(a0->field_b0); gnutls_x509_spki_set_rsa_pss_params(*(&v10), a0->field_b0, v3, a0->field_b0); *(&(&v11)[24 * v1]) = 3; *(&(&v12)[24 * v1]) = *(&v10); tmp_100 = v1; v1 += 1; *(&(&v13)[24 * tmp_100]) = 8; } LABEL_4008ac: if (v4) v0 |= 32; v6 = gnutls_x509_privkey_generate2(*(&v9), v5, v7, v0, &v11, v1); if (v6 < 0) { fprintf(*(&stderr), "privkey_generate: %s\n", gnutls_strerror(v6)); app_exit(0x1); } gnutls_x509_spki_deinit(*(&v10)); v6 = gnutls_x509_privkey_verify_params(*(&v9)); if (v6 < 0) { fprintf(*(&stderr), "privkey_verify_params: %s\n", gnutls_strerror(v6)); app_exit(0x1); } return *(&v9); }
char *simple_ctime(const time_t *t, char out[64]) { struct tm tm; if (localtime_r(t, &tm) == ((void *)0) ) goto error; if (!strftime(out, 64, "%c", &tm)) goto error; return out; error: snprintf(out, 64, "[error]"); return out; }
long long simple_ctime(unsigned int *a0, char *a1) { char v0; unsigned long long v2; unsigned long long v3; unsigned long long v4; v2 = localtime_r(a0, &v0); if (v2) { v3 = strftime(a1, 0x40, "%c", &v0); if (v3) v4 = a1; } if (!v3 || !v2) { snprintf(a1, 0x40, "[error]"); v4 = a1; } return v4; }
static void check_path_safety (const char *action) { const char *path = getenv ("PATH"); const char *path_separators = ":"; size_t pos, len; if ( ((void *)0) == path) { return; } splitstring (path, path_separators, 1 , &pos, &len); do { if (0 == len || (1 == len && path[pos] == '.')) { ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"The current directory is included in the PATH \" \"environment variable, which is insecure in \" \"combination with the %s action of find. \" \"Please remove the current directory from your \" \"$PATH (that is, remove \\\".\\\", doubled colons, \" \"or leading or trailing colons)\"), action), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("The current directory is included in the PATH " "environment variable, which is insecure in " "combination with the %s action of find. " "Please remove the current directory from your " "$PATH (that is, remove \".\", doubled colons, " "or leading or trailing colons)"), action), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("The current directory is included in the PATH " "environment variable, which is insecure in " "combination with the %s action of find. " "Please remove the current directory from your " "$PATH (that is, remove \".\", doubled colons, " "or leading or trailing colons)"), action), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; } else if (path[pos] != '/') { char *relpath = strndup (&path[pos], len); ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"The relative path %s is included in the PATH \" \"environment variable, which is insecure in \" \"combination with the %s action of find. \" \"Please remove that entry from $PATH\"), safely_quote_err_filename (0, relpath ? relpath : &path[pos]), action), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("The relative path %s is included in the PATH " "environment variable, which is insecure in " "combination with the %s action of find. " "Please remove that entry from $PATH"), safely_quote_err_filename (0, relpath ? relpath : &path[pos]), action), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("The relative path %s is included in the PATH " "environment variable, which is insecure in " "combination with the %s action of find. " "Please remove that entry from $PATH"), safely_quote_err_filename (0, relpath ? relpath : &path[pos]), action), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; free (relpath); } } while (splitstring (path, path_separators, 0 , &pos, &len)); }
void check_path_safety(undefined8 param_1) { char cVar1; undefined8 uVar2; char *pcVar3; undefined8 uVar4; long in_FS_OFFSET; long local_48; size_t local_40; char *local_38; undefined *local_30; char *local_28; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_38 = getenv("PATH"); local_30 = &DAT_001069b5; if (local_38 != (char *)0x0) { splitstring(local_38,&DAT_001069b5,1,&local_48,&local_40); do { if ((local_40 == 0) || ((local_40 == 1 && (local_38[local_48] == '.')))) { uVar2 = gettext( "The current directory is included in the PATH environment variable, which is insecure in combination with the %s action of find. Please remove the current directory from your $PATH (that is, remove \".\", doubled colons, or leading or trailing colons)" ); error(1,0,uVar2,param_1); } if (local_38[local_48] != '/') { local_28 = strndup(local_38 + local_48,local_40); pcVar3 = local_28; if (local_28 == (char *)0x0) { pcVar3 = local_38 + local_48; } uVar2 = safely_quote_err_filename(0,pcVar3); uVar4 = gettext( "The relative path %s is included in the PATH environment variable, which is insecure in combination with the %s action of find. Please remove that entry from $PATH" ); error(1,0,uVar4,uVar2,param_1); } cVar1 = splitstring(local_38,local_30,0,&local_48,&local_40); } while (cVar1 != '\0'); } if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
long get_clk_tck () { static long retval = 0; if (retval != 0) return (retval); retval = sysconf ( _SC_CLK_TCK ); return (retval); }
long long get_clk_tck() { unsigned long long v1; if (retval.3359) { v1 = retval.3359; return v1; } retval.3359 = sysconf(0x2); v1 = retval.3359; return v1; }
void prog_fprintf (FILE *fp, char const *fmt, ...) { va_list ap; fputs_unlocked (program_name,fp); fputs_unlocked (": ",fp); __builtin_va_start( ap , fmt ) ; vfprintf (fp, fmt, ap); __builtin_va_end( ap ) ; fputc_unlocked ('\n',fp); }
long long prog_fprintf() { unsigned int v0; unsigned int v1; unsigned long v2; unsigned long v3; unsigned long v4; char v5; unsigned long v6; unsigned long v7; unsigned long v8; unsigned long v9; int v10; int v11; int v12; int v13; int v14; int v15; int v16; int v17; unsigned long v18; unsigned long v19; unsigned long v20; unsigned long v21; unsigned long v22; char v23; int v24; int v25; int v26; int v27; int v28; int v29; int v30; int v31; unsigned long long *v32; void* v33; char *v34; v6 = v19; v7 = v20; v8 = v21; v9 = v22; if (v23) { v10 = v24; v11 = v25; v12 = v26; v13 = v27; v14 = v28; v15 = v29; v16 = v30; v17 = v31; } v4 = v32[5]; fputs_unlocked(program_name, v33); fputs_unlocked(": ", v33); v0 = 16; v1 = 48; v2 = &v18; v3 = &v5; vfprintf(v33, v34, &v0); fputc_unlocked(0xa, v33); if ((v4 ^ v32[5])) __stack_chk_fail(); return 0; }
static int histignore_item_func (ign) struct ign *ign; { if (should_expand (ign->val)) ign->flags |= 0x01; return (0); }
long long histignore_item_func(struct_0 *a0) { if (should_expand(a0->field_0)) { a0->field_c = a0->field_c | 1; return 0; } return 0; }
static void write_header (char const *filename) { static _Bool first_file = 1 ; printf ("%s==> %s <==\n", (first_file ? "" : "\n"), filename); first_file = 0 ; }
void write_header(unsigned long a0) { unsigned int v1; unsigned long long v2; if (!first_file.5822) v1 = &g_402e2f; else v1 = &g_4028fb; v2 = printf("%s==> %s <==\n", v1, a0); first_file.5822 = 0; return; }
inline ext2_ino_t ext2fs_get_inode_bitmap_start2(ext2fs_inode_bitmap bitmap) { return (ext2_ino_t) ext2fs_get_generic_bmap_start((ext2fs_generic_bitmap) bitmap); }
void ext2fs_get_inode_bitmap_start2(void) { halt_baddata(); }
static int ex_len_compar(const void *arg1, const void *arg2) { const struct ext2fs_extent *ex1 = (const struct ext2fs_extent *)arg1; const struct ext2fs_extent *ex2 = (const struct ext2fs_extent *)arg2; if (ex1->e_len < ex2->e_len) return 1; if (ex1->e_lblk > ex2->e_lblk) return -1; return 0; }
long ex_len_compar(_DWORD *a1, _DWORD *a2) { if ( a1[4] < a2[4] ) return 1LL; if ( *((_QWORD *)a1 + 1) <= *((_QWORD *)a2 + 1) ) return 0LL; return 0xFFFFFFFFLL; }
void Blowfish_expandstate(blf_ctx *c, const u_int8_t *data, u_int16_t databytes, 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) { datal ^= Blowfish_stream2word(data, databytes, &j); datar ^= Blowfish_stream2word(data, databytes, &j); 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) { datal ^= Blowfish_stream2word(data, databytes, &j); datar ^= Blowfish_stream2word(data, databytes, &j); Blowfish_encipher(c, &datal, &datar); c->S[i][k] = datal; c->S[i][k + 1] = datar; } } }
unsigned long Blowfish_expandstate( _DWORD *a1, long a2, unsigned short a3, long a4, unsigned short a5) { int v5; int v6; int v7; int v8; short v13; unsigned short i; unsigned short j; int v16; int v17; int v18; unsigned long v19; v19 = __readfsqword(0x28u); v13 = 0; for ( i = 0; i <= 0x11u; ++i ) { v18 = Blowfish_stream2word(a4, a5, &v13); a1[i + 1024] ^= v18; } v13 = 0; v16 = 0; v17 = 0; for ( i = 0; i <= 0x11u; i += 2 ) { v5 = Blowfish_stream2word(a2, a3, &v13); v16 ^= v5; v6 = Blowfish_stream2word(a2, a3, &v13); v17 ^= v6; Blowfish_encipher(a1, &v16, &v17); a1[i + 1024] = v16; a1[i + 1025] = v17; } for ( i = 0; i <= 3u; ++i ) { for ( j = 0; j <= 0xFFu; j += 2 ) { v7 = Blowfish_stream2word(a2, a3, &v13); v16 ^= v7; v8 = Blowfish_stream2word(a2, a3, &v13); v17 ^= v8; Blowfish_encipher(a1, &v16, &v17); a1[256 * (unsigned long)i + j] = v16; a1[256 * (unsigned long)i + 1 + j] = v17; } } return __readfsqword(0x28u) ^ v19; }
static inline void emit_mandatory_arg_note (void) { fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout ) ; }
void emit_mandatory_arg_note() { unsigned long long v1; v1 = fputs_unlocked(gettext("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout); return; }
static enum simple_strtod_error simple_strtod_float (char const *input_str, char **endptr, long double *value, size_t *precision) { _Bool negative; enum simple_strtod_error e = SSE_OK; if (precision) *precision = 0; e = simple_strtod_int (input_str, endptr, value, &negative); if (e != SSE_OK && e != SSE_OK_PRECISION_LOSS) return e; if ((strncmp (*endptr, decimal_point, decimal_point_length) == 0)) { char *ptr2; long double val_frac = 0; _Bool neg_frac; (*endptr) += decimal_point_length; enum simple_strtod_error e2 = simple_strtod_int (*endptr, &ptr2, &val_frac, &neg_frac); if (e2 != SSE_OK && e2 != SSE_OK_PRECISION_LOSS) return e2; if (e2 == SSE_OK_PRECISION_LOSS) e = e2; if (neg_frac) return SSE_INVALID_NUMBER; size_t exponent = ptr2 - *endptr; val_frac = ((long double) val_frac) / powerld (10, exponent); if (value) { if (negative) *value -= val_frac; else *value += val_frac; } if (precision) *precision = exponent; *endptr = ptr2; } return e; }
long simple_strtod_float(const char *a1, const char **a2, long double *a3, const char **a4) { long double v5; long double v6; char v9; char v10; unsigned int v11; unsigned int v12; const char *v13; const char *v14; LONG_DOUBLE_16 v15; unsigned long v16; v16 = __readfsqword(0x28u); v11 = 0; if ( a4 ) *a4 = 0LL; v11 = simple_strtod_int(a1, a2, a3, &v9); if ( v11 >= 2 ) return v11; if ( !strncmp(*a2, decimal_point, decimal_point_length) ) { *(long double *)&v15 = 0.0; *a2 += decimal_point_length; v12 = simple_strtod_int(*a2, &v13, (long double *)&v15.value, &v10); if ( v12 >= 2 ) return v12; if ( v12 == 1 ) v11 = 1; if ( v10 ) return 3LL; v14 = (const char *)(v13 - *a2); v5 = *(long double *)&v15; *(long double *)&v15 = v5 / powerld((int)v14, 10.0); if ( a3 ) { if ( v9 ) v6 = *a3 - *(long double *)&v15; else v6 = *a3 + *(long double *)&v15; *a3 = v6; } if ( a4 ) *a4 = v14; *a2 = v13; } return v11; }
static void mergefps (struct sortfile *files, size_t ntemps, size_t nfiles, FILE *ofp, char const *output_file, FILE **fps) { struct buffer *buffer = xnmalloc (nfiles, sizeof *buffer); struct line saved; struct line const *savedline = ((void *)0) ; size_t savealloc = 0; struct line const **cur = xnmalloc (nfiles, sizeof *cur); struct line const **base = xnmalloc (nfiles, sizeof *base); size_t *ord = xnmalloc (nfiles, sizeof *ord); size_t i; size_t j; size_t t; struct keyfield const *key = keylist; saved.text = ((void *)0) ; for (i = 0; i < nfiles; ) { initbuf (&buffer[i], sizeof (struct line), ((( merge_buffer_size )>( sort_size / nfiles ))?( merge_buffer_size ):( sort_size / nfiles )) ); if (fillbuf (&buffer[i], fps[i], files[i].name)) { struct line const *linelim = buffer_linelim (&buffer[i]); cur[i] = linelim - 1; base[i] = linelim - buffer[i].nlines; i++; } else { xfclose (fps[i], files[i].name); if (i < ntemps) { ntemps--; zaptemp (files[i].name); } free (buffer[i].buf); --nfiles; for (j = i; j < nfiles; ++j) { files[j] = files[j + 1]; fps[j] = fps[j + 1]; } } } for (i = 0; i < nfiles; ++i) ord[i] = i; for (i = 1; i < nfiles; ++i) if (0 < compare (cur[ord[i - 1]], cur[ord[i]])) t = ord[i - 1], ord[i - 1] = ord[i], ord[i] = t, i = 0; while (nfiles) { struct line const *smallest = cur[ord[0]]; if (unique) { if (savedline && compare (savedline, smallest)) { savedline = ((void *)0) ; write_line (&saved, ofp, output_file); } if (!savedline) { savedline = &saved; if (savealloc < smallest->length) { do if (! savealloc) { savealloc = smallest->length; break; } while ((savealloc *= 2) < smallest->length); free (saved.text); saved.text = xmalloc (savealloc); } saved.length = smallest->length; memcpy (saved.text, smallest->text, saved.length); if (key) { saved.keybeg = saved.text + (smallest->keybeg - smallest->text); saved.keylim = saved.text + (smallest->keylim - smallest->text); } } } else write_line (smallest, ofp, output_file); if (base[ord[0]] < smallest) cur[ord[0]] = smallest - 1; else { if (fillbuf (&buffer[ord[0]], fps[ord[0]], files[ord[0]].name)) { struct line const *linelim = buffer_linelim (&buffer[ord[0]]); cur[ord[0]] = linelim - 1; base[ord[0]] = linelim - buffer[ord[0]].nlines; } else { for (i = 1; i < nfiles; ++i) if (ord[i] > ord[0]) --ord[i]; --nfiles; xfclose (fps[ord[0]], files[ord[0]].name); if (ord[0] < ntemps) { ntemps--; zaptemp (files[ord[0]].name); } free (buffer[ord[0]].buf); for (i = ord[0]; i < nfiles; ++i) { fps[i] = fps[i + 1]; files[i] = files[i + 1]; buffer[i] = buffer[i + 1]; cur[i] = cur[i + 1]; base[i] = base[i + 1]; } for (i = 0; i < nfiles; ++i) ord[i] = ord[i + 1]; continue; } } { size_t lo = 1; size_t hi = nfiles; size_t probe = lo; size_t ord0 = ord[0]; size_t count_of_smaller_lines; while (lo < hi) { int cmp = compare (cur[ord0], cur[ord[probe]]); if (cmp < 0 || (cmp == 0 && ord0 < ord[probe])) hi = probe; else lo = probe + 1; probe = (lo + hi) / 2; } count_of_smaller_lines = lo - 1; for (j = 0; j < count_of_smaller_lines; j++) ord[j] = ord[j + 1]; ord[count_of_smaller_lines] = ord0; } } if (unique && savedline) { write_line (&saved, ofp, output_file); free (saved.text); } xfclose (ofp, output_file); free (fps); free (buffer); free (ord); free (base); free (cur); }
void mergefps(long param_1,ulong param_2,ulong param_3,undefined8 param_4,undefined8 param_5, void *param_6) { void **ppvVar1; undefined8 uVar2; long lVar3; char cVar4; int iVar5; void *__ptr; void *__ptr_00; void *__ptr_01; ulong *__ptr_02; ulong uVar6; long lVar7; undefined8 *puVar8; undefined8 *puVar9; long in_FS_OFFSET; ulong local_100; ulong local_f8; void **local_d8; void *local_d0; ulong local_c8; ulong local_c0; ulong local_b8; ulong local_b0; ulong local_a8; void *local_48; void *local_40; long local_38; long local_30; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); __ptr = (void *)xnmalloc(param_3,0x38); local_d8 = (void **)0x0; local_d0 = (void *)0x0; __ptr_00 = (void *)xnmalloc(param_3,8); __ptr_01 = (void *)xnmalloc(param_3,8); __ptr_02 = (ulong *)xnmalloc(param_3,8); lVar3 = keylist; local_48 = (void *)0x0; local_c8 = 0; local_100 = param_3; local_f8 = param_2; while (local_c8 < local_100) { uVar6 = merge_buffer_size; if (merge_buffer_size <= sort_size / local_100) { uVar6 = sort_size / local_100; } initbuf((void *)((long)__ptr + local_c8 * 0x38),0x20,uVar6); cVar4 = fillbuf((void *)((long)__ptr + local_c8 * 0x38), *(undefined8 *)((long)param_6 + local_c8 * 8), *(undefined8 *)(param_1 + local_c8 * 0x10)); if (cVar4 == '\0') { xfclose(*(undefined8 *)((long)param_6 + local_c8 * 8), *(undefined8 *)(param_1 + local_c8 * 0x10)); if (local_c8 < local_f8) { local_f8 = local_f8 - 1; zaptemp(*(undefined8 *)(param_1 + local_c8 * 0x10)); } free(*(void **)((long)__ptr + local_c8 * 0x38)); local_100 = local_100 - 1; for (local_c0 = local_c8; local_c0 < local_100; local_c0 = local_c0 + 1) { puVar8 = (undefined8 *)(param_1 + (local_c0 + 1) * 0x10); puVar9 = (undefined8 *)(local_c0 * 0x10 + param_1); uVar2 = puVar8[1]; *puVar9 = *puVar8; puVar9[1] = uVar2; *(undefined8 *)((long)param_6 + local_c0 * 8) = *(undefined8 *)((long)param_6 + (local_c0 + 1) * 8); } } else { lVar7 = buffer_linelim((void *)((long)__ptr + local_c8 * 0x38)); *(long *)((long)__ptr_00 + local_c8 * 8) = lVar7 + -0x20; *(long *)((long)__ptr_01 + local_c8 * 8) = lVar7 + *(long *)((long)__ptr + local_c8 * 0x38 + 0x10) * -0x20; local_c8 = local_c8 + 1; } } for (local_c8 = 0; local_c8 < local_100; local_c8 = local_c8 + 1) { __ptr_02[local_c8] = local_c8; } for (local_c8 = 1; local_c8 < local_100; local_c8 = local_c8 + 1) { iVar5 = compare(*(undefined8 *)((long)__ptr_00 + __ptr_02[local_c8 - 1] * 8), *(undefined8 *)((long)__ptr_00 + __ptr_02[local_c8] * 8)); if (0 < iVar5) { uVar6 = __ptr_02[local_c8 - 1]; __ptr_02[local_c8 - 1] = __ptr_02[local_c8]; __ptr_02[local_c8] = uVar6; local_c8 = 0; } } LAB_00107143: do { if (local_100 == 0) { if ((unique != '\0') && (local_d8 != (void **)0x0)) { write_line(&local_48,param_4,param_5); free(local_48); } xfclose(param_4,param_5); free(param_6); free(__ptr); free(__ptr_02); free(__ptr_01); free(__ptr_00); if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); } ppvVar1 = *(void ***)((long)__ptr_00 + *__ptr_02 * 8); if (unique == '\0') { write_line(ppvVar1,param_4,param_5); } else { if ((local_d8 != (void **)0x0) && (iVar5 = compare(local_d8,ppvVar1), iVar5 != 0)) { local_d8 = (void **)0x0; write_line(&local_48,param_4,param_5); } if (local_d8 == (void **)0x0) { local_d8 = &local_48; if (local_d0 < ppvVar1[1]) { do { if (local_d0 == (void *)0x0) { local_d0 = ppvVar1[1]; break; } local_d0 = (void *)((long)local_d0 << 1); } while (local_d0 < ppvVar1[1]); free(local_48); local_48 = (void *)xmalloc(local_d0); } local_40 = ppvVar1[1]; memcpy(local_48,*ppvVar1,(size_t)local_40); if (lVar3 != 0) { local_38 = ((long)ppvVar1[2] - (long)*ppvVar1) + (long)local_48; local_30 = ((long)ppvVar1[3] - (long)*ppvVar1) + (long)local_48; } } } if (*(void ***)((long)__ptr_01 + *__ptr_02 * 8) < ppvVar1) { *(void ***)((long)__ptr_00 + *__ptr_02 * 8) = ppvVar1 + -4; } else { cVar4 = fillbuf((void *)((long)__ptr + *__ptr_02 * 0x38), *(undefined8 *)((long)param_6 + *__ptr_02 * 8), *(undefined8 *)(param_1 + *__ptr_02 * 0x10)); if (cVar4 == '\0') { for (local_c8 = 1; local_c8 < local_100; local_c8 = local_c8 + 1) { if (*__ptr_02 < __ptr_02[local_c8]) { __ptr_02[local_c8] = __ptr_02[local_c8] - 1; } } local_100 = local_100 - 1; xfclose(*(undefined8 *)((long)param_6 + *__ptr_02 * 8), *(undefined8 *)(param_1 + *__ptr_02 * 0x10)); if (*__ptr_02 < local_f8) { local_f8 = local_f8 - 1; zaptemp(*(undefined8 *)(param_1 + *__ptr_02 * 0x10)); } free(*(void **)((long)__ptr + *__ptr_02 * 0x38)); for (local_c8 = *__ptr_02; local_c8 < local_100; local_c8 = local_c8 + 1) { *(undefined8 *)((long)param_6 + local_c8 * 8) = *(undefined8 *)((long)param_6 + (local_c8 + 1) * 8); puVar8 = (undefined8 *)(param_1 + (local_c8 + 1) * 0x10); puVar9 = (undefined8 *)(local_c8 * 0x10 + param_1); uVar2 = puVar8[1]; *puVar9 = *puVar8; puVar9[1] = uVar2; puVar9 = (undefined8 *)((local_c8 + 1) * 0x38 + (long)__ptr); puVar8 = (undefined8 *)((long)__ptr + local_c8 * 0x38); uVar2 = puVar9[1]; *puVar8 = *puVar9; puVar8[1] = uVar2; uVar2 = puVar9[3]; puVar8[2] = puVar9[2]; puVar8[3] = uVar2; uVar2 = puVar9[5]; puVar8[4] = puVar9[4]; puVar8[5] = uVar2; puVar8[6] = puVar9[6]; *(undefined8 *)((long)__ptr_00 + local_c8 * 8) = *(undefined8 *)((long)__ptr_00 + (local_c8 + 1) * 8); *(undefined8 *)((long)__ptr_01 + local_c8 * 8) = *(undefined8 *)((long)__ptr_01 + (local_c8 + 1) * 8); } for (local_c8 = 0; local_c8 < local_100; local_c8 = local_c8 + 1) { __ptr_02[local_c8] = __ptr_02[local_c8 + 1]; } goto LAB_00107143; } lVar7 = buffer_linelim((void *)((long)__ptr + *__ptr_02 * 0x38)); *(long *)((long)__ptr_00 + *__ptr_02 * 8) = lVar7 + -0x20; *(long *)((long)__ptr_01 + *__ptr_02 * 8) = lVar7 + *(long *)((long)__ptr + *__ptr_02 * 0x38 + 0x10) * -0x20; } local_b8 = 1; local_b0 = local_100; local_a8 = 1; uVar6 = *__ptr_02; while (local_b8 < local_b0) { iVar5 = compare(*(undefined8 *)((long)__ptr_00 + uVar6 * 8), *(undefined8 *)((long)__ptr_00 + __ptr_02[local_a8] * 8)); if ((iVar5 < 0) || ((iVar5 == 0 && (uVar6 < __ptr_02[local_a8])))) { local_b0 = local_a8; } else { local_b8 = local_a8 + 1; } local_a8 = local_b0 + local_b8 >> 1; } for (local_c0 = 0; local_c0 < local_b8 - 1; local_c0 = local_c0 + 1) { __ptr_02[local_c0] = __ptr_02[local_c0 + 1]; } __ptr_02[local_b8 - 1] = uVar6; } while( true ); }
static void verify_numeric (char const *s, char const *end) { if ( (*__errno_location ()) ) { error (0, (*__errno_location ()) , "%s", quote (s)); exit_status = 1 ; } else if (*end) { if (s == end) error (0, 0, gettext ("%s: expected a numeric value"), quote (s)); else error (0, 0, gettext ("%s: value not completely converted"), quote (s)); exit_status = 1 ; } }
void verify_numeric(unsigned long long a0, char *a1) { unsigned long long v2; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; if (*(__errno_location())) { v3 = quote(a0); v4 = error(0x0, *(__errno_location()), "%s"); exit_status = 1; } else { v2 = *(a1); if (*(a1)) { if (a0 == a1) { v5 = quote(a0); v7 = error(0x0, 0x0, gettext("%s: expected a numeric value")); } else { v6 = quote(a0); v8 = error(0x0, 0x0, gettext("%s: value not completely converted")); } exit_status = 1; } } return; }
void xheader_xattr_free (struct xattr_array *xattr_map, size_t xattr_map_size) { size_t scan = 0; while (scan < xattr_map_size) { free (xattr_map[scan].xkey); free (xattr_map[scan].xval_ptr); ++scan; } free (xattr_map); }
long long xheader_xattr_free(void* a0, unsigned long a1) { void* v0; for (v0 = 0; v0 < a1; v0 += 1) { free(*((a0 + 0x18 * v0))); free(*((8 + a0 + 0x18 * v0))); } return free(a0); }
static gnutls_x509_trust_list_t load_tl_from_cert_chain(const char *cert, int cert_size) { gnutls_datum_t tmp; gnutls_x509_crt_t *x509_cert_list = ((void *)0) ; gnutls_x509_crl_t *x509_crl_list = ((void *)0) ; unsigned x509_ncerts, x509_ncrls = 0; unsigned i; int ret; gnutls_x509_trust_list_t list; ret = gnutls_x509_trust_list_init(&list, 0); if (ret < 0) { fprintf( stderr , "gnutls_x509_trust_list_init: %s\n", gnutls_strerror(ret)); app_exit(1); } tmp.data = (void *) cert; tmp.size = cert_size; ret = gnutls_x509_crt_list_import2(&x509_cert_list, &x509_ncerts, &tmp, GNUTLS_X509_FMT_PEM, 0); if (ret < 0 || x509_ncerts < 1) { fprintf( stderr , "error parsing CRTs: %s\n", gnutls_strerror(ret)); app_exit(1); } ret = gnutls_x509_crl_list_import2(&x509_crl_list, &x509_ncrls, &tmp, GNUTLS_X509_FMT_PEM, 0); if (ret < 0) { x509_crl_list = ((void *)0) ; x509_ncrls = 0; } ret = gnutls_x509_trust_list_add_cas(list, &x509_cert_list[x509_ncerts - 1], 1, 0); if (ret < 0) { fprintf( stderr , "gnutls_x509_trust_add_cas: %s\n", gnutls_strerror(ret)); app_exit(1); } if (x509_ncrls > 0) { ret = gnutls_x509_trust_list_add_crls(list, x509_crl_list, x509_ncrls, 0, 0); if (ret < 0) { fprintf( stderr , "gnutls_x509_trust_add_crls: %s\n", gnutls_strerror(ret)); app_exit(1); } } if (x509_ncerts > 1) { for (i=0;i<x509_ncerts-1;i++) gnutls_x509_crt_deinit(x509_cert_list[i]); } gnutls_free((void *) (x509_cert_list)), x509_cert_list= ((void *)0) ; gnutls_free((void *) (x509_crl_list)), x509_crl_list= ((void *)0) ; return list; }
int load_tl_from_cert_chain(unsigned long a0, unsigned long a1) { char v0; unsigned int v1; unsigned int v2; unsigned int v3; void* v4; void* v5; char v6; unsigned long v7; unsigned int v8; v4 = 0; v5 = 0; v1 = 0; v3 = gnutls_x509_trust_list_init(&v6, 0x0); if (v3 < 0) { fprintf(*(&stderr), "gnutls_x509_trust_list_init: %s\n", gnutls_strerror(v3)); app_exit(0x1); } v7 = a0; v8 = a1; v3 = gnutls_x509_crt_list_import2(&v4, &v0, &v7, 0x1, 0x0); if (v3 >= 0 && *(&v0)) { v3 = gnutls_x509_crl_list_import2(&v5, &v1, &v7, 0x1, 0x0); if (v3 < 0) { v5 = 0; v1 = 0; } v3 = gnutls_x509_trust_list_add_cas(*(&v6), v4 + (*(&v0) - 1) * 8, 0x1, 0x0); if (v3 < 0) { fprintf(*(&stderr), "gnutls_x509_trust_add_cas: %s\n", gnutls_strerror(v3)); app_exit(0x1); } if (v1) { v3 = gnutls_x509_trust_list_add_crls(*(&v6), v5, v1, 0x0, 0x0); if (v3 < 0) { fprintf(*(&stderr), "gnutls_x509_trust_add_crls: %s\n", gnutls_strerror(v3)); app_exit(0x1); } } if (*(&v0) > 1) { for (v2 = 0; v2 < *(&v0) - 1; v2 += 1) { gnutls_x509_crt_deinit(*((v4 + 8 * v2))); } } *(5243720)(v4); v4 = 0; *(5243720)(v5); v5 = 0; return *(&v6); } fprintf(*(&stderr), "error parsing CRTs: %s\n", gnutls_strerror(v3)); app_exit(0x1); }
void skip_member (void) { if (!current_stat_info.skipped) { char save_typeflag = current_header->header.typeflag; set_next_block_after (current_header); mv_begin_read (&current_stat_info); if (current_stat_info.is_sparse) sparse_skip_file (&current_stat_info); else if (save_typeflag != '5') skip_file (current_stat_info.stat.st_size); mv_end (); } }
void skip_member(unsigned long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { char v0; unsigned long long v2; unsigned long long v3; v2 = g_5001f9 ^ 1; if ((g_5001f9 ^ 1)) { v0 = *(282274124563428); set_next_block_after(0x100ba10ec8348); mv_begin_read(0x500070); if (memcpy) { sparse_skip_file(0x500070); } else if (v0 != 53) { skip_file(stdlis, a1, a2, a3, a4, a5); } v3 = mv_end(); } return; }
static int xfrm_parse_opt(struct link_util *lu, int argc, char **argv, struct nlmsghdr *n) { unsigned int link = 0; __u32 if_id = 0; while (argc > 0) { if (!matches(*argv, "dev")) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); link = ll_name_to_index(*argv); if (!link) exit(nodev(*argv)); } else if (!matches(*argv, "if_id")) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&if_id, *argv, 0)) invarg("if_id value is invalid", *argv); else if (!if_id) invarg("if_id value is invalid", *argv); else addattr32(n, 1024, IFLA_XFRM_IF_ID, if_id); } else { xfrm_print_help(lu, argc, argv, stderr ); return -1; } argc--; argv++; } if (!if_id) missarg("IF_ID"); if (link) addattr32(n, 1024, IFLA_XFRM_LINK, link); return 0; }
undefined8 xfrm_parse_opt(undefined8 param_1,int param_2,undefined8 *param_3,undefined8 param_4) { undefined8 *puVar1; char cVar2; int iVar3; undefined8 uVar4; long in_FS_OFFSET; undefined8 *local_30; int local_24; int local_18; int local_14; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_14 = 0; local_18 = 0; local_30 = param_3; local_24 = param_2; do { if (local_24 < 1) { if (local_18 == 0) { missarg("IF_ID"); } if (local_14 != 0) { addattr32(param_4,0x400,1,local_14); } uVar4 = 0; LAB_00100237: if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar4; } cVar2 = matches(*local_30,&DAT_0010030f); if (cVar2 == '\x01') { cVar2 = matches(*local_30,"if_id"); if (cVar2 == '\x01') { xfrm_print_help(param_1,local_24,local_30,stderr); uVar4 = 0xffffffff; goto LAB_00100237; } puVar1 = local_30 + 1; if (local_24 + -1 < 1) { incomplete_command(); } iVar3 = get_u32(&local_18,*puVar1,0); if (iVar3 != 0) { invarg("if_id value is invalid",*puVar1); } if (local_18 == 0) { invarg("if_id value is invalid",*puVar1); } addattr32(param_4,0x400,2,local_18); } else { if (local_24 + -1 < 1) { incomplete_command(); } local_14 = ll_name_to_index(local_30[1]); if (local_14 == 0) { iVar3 = nodev(); exit(iVar3); } } local_24 = local_24 + -2; local_30 = local_30 + 2; } while( true ); }
void pcomp_set_readline_variables (flags, nval) int flags, nval; { if (flags & (1<<2)) rl_filename_completion_desired = nval; if (flags & (1<<5)) rl_completion_suppress_append = nval; if (flags & (1<<4)) rl_filename_quoting_desired = 1 - nval; if (flags & (1<<8)) rl_sort_completion_matches = 1 - nval; }
long long pcomp_set_readline_variables(unsigned long a0, unsigned long a1) { unsigned long long v1; if ((a0 & 4)) rl_filename_completion_desired = a1; if ((a0 & 32)) rl_completion_suppress_append = a1; if ((a0 & 16)) rl_filename_quoting_desired = 1 - a1; v1 = a0 & 0x100; if ((a0 & 0x100)) { v1 = 1 - a1; rl_sort_completion_matches = 1 - a1; } return v1; }
static void add_links(char *c) { int i, j, nr; char *f, *g, *h; char *idtest[6]; out_length += strlen(c); nr = 0; idtest[0] = strstr(c + 1, ": idtest[1] = strchr(c + 1, '@'); idtest[2] = strstr(c, "www."); idtest[3] = strstr(c, "ftp."); idtest[4] = 0; idtest[5] = strstr(c + 1, ".h&gt;"); for (i = 0; i < 6; i++) nr += (idtest[i] != ((void *)0) ); while (nr) { j = -1; for (i = 0; i < 6; i++) if (idtest[i] && (j < 0 || idtest[i] < idtest[j])) j = i; switch (j) { case 5: f = idtest[5]; h = f + 2; g = f; while (g > c && g[-1] != ';') g--; if (g != c) { char t; t = *g; *g = '\0'; fputs(c, stdout ); *g = t; *h = '\0'; printf("<A HREF=\"file:/usr/include/%s\">%s</A>&gt;", g, g); c = f + 6; } else { f[5] = '\0'; fputs(c, stdout ); f[5] = ';'; c = f + 5; } break; case 4: break; case 3: case 2: g = f = idtest[j]; while (*g && ( ((*__ctype_b_loc ())[(int) (( *g ))] & (unsigned short int) _ISalnum) || *g == '_' || *g == '-' || *g == '+' || *g == '.')) g++; if (g[-1] == '.') g--; if (g - f > 4) { char t; t = *f; *f = '\0'; fputs(c, stdout ); *f = t; t = *g; *g = '\0'; printf("<A HREF=\"%s: f, f); *g = t; c = g; } else { f[3] = '\0'; fputs(c, stdout ); c = f + 3; f[3] = '.'; } break; case 1: g = f = idtest[1]; while (g > c && ( ((*__ctype_b_loc ())[(int) (( g[-1] ))] & (unsigned short int) _ISalnum) || g[-1] == '_' || g[-1] == '-' || g[-1] == '+' || g[-1] == '.' || g[-1] == '%')) g--; h = f + 1; while (*h && ( ((*__ctype_b_loc ())[(int) (( *h ))] & (unsigned short int) _ISalnum) || *h == '_' || *h == '-' || *h == '+' || *h == '.')) h++; if (*h == '.') h--; if (h - f > 4 && f - g > 1) { char t; t = *g; *g = '\0'; fputs(c, stdout ); *g = t; t = *h; *h = '\0'; printf("<A HREF=\"mailto:%s\">%s</A>", g, g); *h = t; c = h; } else { *f = '\0'; fputs(c, stdout ); *f = '@'; idtest[1] = c; c = f; } break; case 0: g = f = idtest[0]; while (g > c && ((*__ctype_b_loc ())[(int) (( g[-1] ))] & (unsigned short int) _ISalpha) && ((*__ctype_b_loc ())[(int) (( g[-1] ))] & (unsigned short int) _ISlower) ) g--; h = f + 3; while (*h && ! ((*__ctype_b_loc ())[(int) (( *h ))] & (unsigned short int) _ISspace) && *h != '<' && *h != '>' && *h != '"' && *h != '&') h++; if (f - g > 2 && f - g < 7 && h - f > 3) { char t; t = *g; *g = '\0'; fputs(c, stdout ); *g = t; t = *h; *h = '\0'; printf("<A HREF=\"%s\">%s</A>", g, g); *h = t; c = h; } else { f[1] = '\0'; fputs(c, stdout ); f[1] = '/'; c = f + 1; } break; default: break; } nr = 0; if (idtest[0] && idtest[0] < c) idtest[0] = strstr(c + 1, ": if (idtest[1] && idtest[1] < c) idtest[1] = strchr(c + 1, '@'); if (idtest[2] && idtest[2] < c) idtest[2] = strstr(c, "www."); if (idtest[3] && idtest[3] < c) idtest[3] = strstr(c, "ftp."); if (idtest[4] && idtest[4] < c) idtest[4] = strchr(c + 1, '('); if (idtest[5] && idtest[5] < c) idtest[5] = strstr(c + 1, ".h&gt;"); for (i = 0; i < 6; i++) nr += (idtest[i] != ((void *)0) ); } fputs(c, stdout ); }
void add_links(char *param_1) { char cVar1; char *pcVar2; char *pcVar3; size_t sVar4; char *pcVar5; ushort **ppuVar6; undefined *puVar7; long in_FS_OFFSET; char *local_80; int local_6c; int local_68; int local_64; char *local_60; char *local_58; char *local_48 [7]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); sVar4 = strlen(param_1); out_length = out_length + (int)sVar4; local_64 = 0; local_48[0] = strstr(param_1 + 1,": local_48[1] = strchr(param_1 + 1,0x40); local_48[2] = strstr(param_1,"www."); local_48[3] = strstr(param_1,"ftp."); local_48[4] = (char *)0x0; local_48[5] = strstr(param_1 + 1,".h&gt;"); for (local_6c = 0; local_80 = param_1, local_6c < 6; local_6c = local_6c + 1) { local_64 = local_64 + (uint)(local_48[local_6c] != (char *)0x0); } do { pcVar3 = local_48[5]; pcVar2 = local_48[1]; pcVar5 = local_48[0]; if (local_64 == 0) { fputs(local_80,stdout); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; } local_68 = -1; for (local_6c = 0; local_6c < 6; local_6c = local_6c + 1) { if ((local_48[local_6c] != (char *)0x0) && ((local_68 < 0 || (local_48[local_6c] < local_48[local_68])))) { local_68 = local_6c; } } switch(local_68) { case 0: local_60 = local_48[0]; while (((local_80 < local_60 && (ppuVar6 = __ctype_b_loc(), ((*ppuVar6)[local_60[-1]] & 0x400) != 0)) && (ppuVar6 = __ctype_b_loc(), ((*ppuVar6)[local_60[-1]] & 0x200) != 0))) { local_60 = local_60 + -1; } for (local_58 = pcVar5 + 3; (((*local_58 != '\0' && (ppuVar6 = __ctype_b_loc(), ((*ppuVar6)[*local_58] & 0x2000) == 0) ) && ((*local_58 != '<' && ((*local_58 != '>' && (*local_58 != '\"')))))) && (*local_58 != '&')); local_58 = local_58 + 1) { } if ((((long)pcVar5 - (long)local_60 < 3) || (6 < (long)pcVar5 - (long)local_60)) || ((long)local_58 - (long)pcVar5 < 4)) { pcVar5[1] = '\0'; fputs(local_80,stdout); pcVar5[1] = '/'; local_80 = pcVar5 + 1; } else { cVar1 = *local_60; *local_60 = '\0'; fputs(local_80,stdout); *local_60 = cVar1; cVar1 = *local_58; *local_58 = '\0'; printf("<A HREF=\"%s\">%s</A>",local_60,local_60); *local_58 = cVar1; local_80 = local_58; } break; case 1: for (local_60 = local_48[1]; (local_58 = pcVar2, local_80 < local_60 && (((ppuVar6 = __ctype_b_loc(), ((*ppuVar6)[local_60[-1]] & 8) != 0 || (local_60[-1] == '_') ) || ((local_60[-1] == '-' || (((local_60[-1] == '+' || (local_60[-1] == '.')) || (local_60[-1] == '%')))))))); local_60 = local_60 + -1) { } do { pcVar5 = local_58; local_58 = pcVar5 + 1; if (*local_58 == '\0') break; ppuVar6 = __ctype_b_loc(); } while (((((*ppuVar6)[*local_58] & 8) != 0) || (*local_58 == '_')) || ((*local_58 == '-' || ((*local_58 == '+' || (*local_58 == '.')))))); if (*local_58 == '.') { local_58 = pcVar5; } if (((long)local_58 - (long)pcVar2 < 5) || ((long)pcVar2 - (long)local_60 < 2)) { *pcVar2 = '\0'; fputs(local_80,stdout); *pcVar2 = '@'; local_48[1] = local_80; local_80 = pcVar2; } else { cVar1 = *local_60; *local_60 = '\0'; fputs(local_80,stdout); *local_60 = cVar1; cVar1 = *local_58; *local_58 = '\0'; printf("<A HREF=\"mailto:%s\">%s</A>",local_60,local_60); *local_58 = cVar1; local_80 = local_58; } break; case 2: case 3: pcVar5 = local_48[local_68]; for (local_60 = pcVar5; (*local_60 != '\0' && ((((ppuVar6 = __ctype_b_loc(), ((*ppuVar6)[*local_60] & 8) != 0 || (*local_60 == '_')) || (*local_60 == '-')) || ((*local_60 == '+' || (*local_60 == '.')))))); local_60 = local_60 + 1) { } if (local_60[-1] == '.') { local_60 = local_60 + -1; } if ((long)local_60 - (long)pcVar5 < 5) { pcVar5[3] = '\0'; fputs(local_80,stdout); local_80 = pcVar5 + 3; pcVar5[3] = '.'; } else { cVar1 = *pcVar5; *pcVar5 = '\0'; fputs(local_80,stdout); *pcVar5 = cVar1; cVar1 = *local_60; *local_60 = '\0'; if (local_68 == 3) { puVar7 = &DAT_00110202; } else { puVar7 = &DAT_00110206; } printf("<A HREF=\"%s: *local_60 = cVar1; local_80 = local_60; } break; case 5: pcVar5 = local_48[5] + 2; for (local_60 = local_48[5]; (local_80 < local_60 && (local_60[-1] != ';')); local_60 = local_60 + -1) { } if (local_60 == local_80) { local_48[5][5] = '\0'; fputs(local_80,stdout); pcVar3[5] = ';'; local_80 = pcVar3 + 5; } else { cVar1 = *local_60; *local_60 = '\0'; fputs(local_80,stdout); *local_60 = cVar1; *pcVar5 = '\0'; printf("<A HREF=\"file:/usr/include/%s\">%s</A>&gt;",local_60,local_60); local_80 = pcVar3 + 6; } } local_64 = 0; if ((local_48[0] != (char *)0x0) && (local_48[0] < local_80)) { local_48[0] = strstr(local_80 + 1,": } if ((local_48[1] != (char *)0x0) && (local_48[1] < local_80)) { local_48[1] = strchr(local_80 + 1,0x40); } if ((local_48[2] != (char *)0x0) && (local_48[2] < local_80)) { local_48[2] = strstr(local_80,"www."); } if ((local_48[3] != (char *)0x0) && (local_48[3] < local_80)) { local_48[3] = strstr(local_80,"ftp."); } if ((local_48[4] != (char *)0x0) && (local_48[4] < local_80)) { local_48[4] = strchr(local_80 + 1,0x28); } if ((local_48[5] != (char *)0x0) && (local_48[5] < local_80)) { local_48[5] = strstr(local_80 + 1,".h&gt;"); } for (local_6c = 0; local_6c < 6; local_6c = local_6c + 1) { local_64 = local_64 + (uint)(local_48[local_6c] != (char *)0x0); } } while( true ); }
static void mallocFail ( Int32 n ) { fprintf ( stderr , "%s: malloc failed on request for %d bytes.\n", progName, n ); fprintf ( stderr , "%s: warning: output file(s) may be incomplete.\n", progName ); exit ( 1 ); }
void mallocFail(unsigned int a1) { fprintf(stderr, "%s: malloc failed on request for %d bytes.\n", progName, a1); fprintf(stderr, "%s: warning: output file(s) may be incomplete.\n", progName); exit(1); }
int main (int argc, char **argv) { unsigned int n_files; _Bool old_options = 0 ; _Bool old_w = 0 ; _Bool old_s = 0 ; char **file_names; char *column_count_string = ((void *)0) ; size_t n_digits = 0; size_t n_alloc = 0; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdout); n_files = 0; file_names = (argc > 1 ? xnmalloc (argc - 1, sizeof (char *)) : ((void *)0) ); while ( 1 ) { int oi = -1; int c = getopt_long (argc, argv, short_options, long_options, &oi); if (c == -1) break; if (((unsigned int) (c) - '0' <= 9)) { if (n_digits + 1 >= n_alloc) column_count_string = ((!!sizeof (struct { _Static_assert (sizeof *(column_count_string) == 1, "verify_expr (" "sizeof *(column_count_string) == 1" ", " "x2realloc (column_count_string, &n_alloc)" ")"); int _gl_dummy; })) ? (x2realloc (column_count_string, &n_alloc)) : (x2realloc (column_count_string, &n_alloc))); column_count_string[n_digits++] = c; column_count_string[n_digits] = '\0'; continue; } n_digits = 0; switch (c) { case 1: if (! (first_page_number == 0 && *optarg == '+' && first_last_page (-2, '+', optarg + 1))) file_names[n_files++] = optarg; break; case PAGES_OPTION: { if (! optarg) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"'--pages=FIRST_PAGE[:LAST_PAGE]' missing argument\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("'--pages=FIRST_PAGE[:LAST_PAGE]' missing argument")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("'--pages=FIRST_PAGE[:LAST_PAGE]' missing argument")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; else if (! first_last_page (oi, 0, optarg)) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"invalid page range %s\"), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("invalid page range %s"), quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("invalid page range %s"), quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; break; } case COLUMNS_OPTION: { parse_column_count (optarg); free (column_count_string); column_count_string = ((void *)0) ; n_alloc = 0; break; } case 'a': print_across_flag = 1 ; storing_columns = 0 ; break; case 'b': balance_columns = 1 ; break; case 'c': use_cntrl_prefix = 1 ; break; case 'd': double_space = 1 ; break; case 'D': date_format = optarg; break; case 'e': if (optarg) getoptarg (optarg, 'e', &input_tab_char, &chars_per_input_tab); untabify_input = 1 ; break; case 'f': case 'F': use_form_feed = 1 ; break; case 'h': custom_header = optarg; break; case 'i': if (optarg) getoptarg (optarg, 'i', &output_tab_char, &chars_per_output_tab); tabify_output = 1 ; break; case 'J': join_lines = 1 ; break; case 'l': getoptnum (optarg, 1, &lines_per_page, gettext ("'-l PAGE_LENGTH' invalid number of lines")); break; case 'm': parallel_files = 1 ; storing_columns = 0 ; break; case 'n': numbered_lines = 1 ; if (optarg) getoptarg (optarg, 'n', &number_separator, &chars_per_number); break; case 'N': skip_count = 0 ; getoptnum (optarg, (-0x7fffffff - 1) , &start_line_num, gettext ("'-N NUMBER' invalid starting line number")); break; case 'o': getoptnum (optarg, 0, &chars_per_margin, gettext ("'-o MARGIN' invalid line offset")); break; case 'r': ignore_failed_opens = 1 ; break; case 's': old_options = 1 ; old_s = 1 ; if (!use_col_separator && optarg) separator_string (optarg); break; case 'S': old_s = 0 ; col_sep_string = ""; col_sep_length = 0; use_col_separator = 1 ; if (optarg) separator_string (optarg); break; case 't': extremities = 0 ; keep_FF = 1 ; break; case 'T': extremities = 0 ; keep_FF = 0 ; break; case 'v': use_esc_sequence = 1 ; break; case 'w': old_options = 1 ; old_w = 1 ; { int tmp_cpl; getoptnum (optarg, 1, &tmp_cpl, gettext ("'-w PAGE_WIDTH' invalid number of characters")); if (! truncate_lines) chars_per_line = tmp_cpl; } break; case 'W': old_w = 0 ; truncate_lines = 1 ; getoptnum (optarg, 1, &chars_per_line, gettext ("'-W PAGE_WIDTH' invalid number of characters")); break; case GETOPT_HELP_CHAR: usage ( 0 ); break;; case GETOPT_VERSION_CHAR: version_etc ( stdout , "pr", "GNU coreutils", Version, ("Pete TerMaat"), ("Roland Huebner"), (char *) ((void *)0) ); exit ( 0 ); break;; default: usage ( 1 ); break; } } if (column_count_string) { parse_column_count (column_count_string); free (column_count_string); } if (! date_format) date_format = (getenv ("POSIXLY_CORRECT") && !hard_locale ( 2 ) ? "%b %e %H:%M %Y" : "%Y-%m-%d %H:%M"); localtz = tzalloc (getenv ("TZ")); if (first_page_number == 0) first_page_number = 1; if (parallel_files && explicit_columns) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot specify number of columns when printing in parallel\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("cannot specify number of columns when printing in parallel")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("cannot specify number of columns when printing in parallel")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; if (parallel_files && print_across_flag) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot specify both printing across and printing in parallel\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("cannot specify both printing across and printing in parallel")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("cannot specify both printing across and printing in parallel")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; if (old_options) { if (old_w) { if (parallel_files || explicit_columns) { truncate_lines = 1 ; if (old_s) use_col_separator = 1 ; } else join_lines = 1 ; } else if (!use_col_separator) { if (old_s && (parallel_files || explicit_columns)) { if (!truncate_lines) { join_lines = 1 ; if (col_sep_length > 0) use_col_separator = 1 ; } else use_col_separator = 1 ; } } } for (; optind < argc; optind++) { file_names[n_files++] = argv[optind]; } if (n_files == 0) { print_files (0, ((void *)0) ); } else { if (parallel_files) print_files (n_files, file_names); else { for (unsigned int i = 0; i < n_files; i++) print_files (1, &file_names[i]); } } cleanup (); if (have_read_stdin && rpl_fclose ( stdin ) == (-1) ) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"standard input\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , gettext ("standard input")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , gettext ("standard input")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); return failed_opens ? 1 : 0 ; }
int main(int argc, const char **argv, const char **envp) { const char **v3; long v4; unsigned int v5; char *v6; long v7; char *v8; char *v9; char *v10; char *v11; char *v12; char *v13; const char *v14; char *v15; char *v16; char *v17; unsigned int v18; char *v19; int *v20; char v22; char v23; char v24; int longind; int v26; unsigned int v27; unsigned int i; int v29; unsigned long v30; void *ptr; long v32; const char **v33; unsigned long v34; v34 = __readfsqword(0x28u); v22 = 0; v23 = 0; v24 = 0; ptr = 0LL; v32 = 0LL; v30 = 0LL; set_program_name(*argv, argv, envp); setlocale(6, locale); bindtextdomain("coreutils", "/usr/local/share/locale"); textdomain("coreutils"); atexit((void (*)(void))&close_stdout); v27 = 0; if ( argc <= 1 ) v3 = 0LL; else v3 = (const char **)xnmalloc(argc - 1, 8LL); v33 = v3; while ( 1 ) { longind = -1; v29 = getopt_long( argc, (char *const *)argv, "-0123456789D:FJN:S_TW:abcde_fh:i_l:mn_o:rs_tvw:", &long_options, &longind); if ( v29 == -1 ) break; if ( (unsigned int)(v29 - 48) > 9 ) { v32 = 0LL; if ( v29 > 129 ) goto LABEL_61; if ( v29 <= 0 ) { if ( v29 == -131 ) { version_etc(stdout, "pr", "GNU coreutils", Version, "Pete TerMaat", "Roland Huebner", 0LL); exit(0); } if ( v29 == -130 ) usage(0); LABEL_61: usage(1); } switch ( v29 ) { case 1: if ( first_page_number || *optarg != 43 || (unsigned char)first_last_page(0xFFFFFFFE, 43, optarg + 1) != 1 ) { v5 = v27++; v33[v5] = optarg; } continue; case 68: date_format = (long)optarg; continue; case 70: case 102: use_form_feed = 1; continue; case 74: join_lines = 1; continue; case 78: skip_count = 0; v10 = gettext("'-N NUMBER' invalid starting line number"); getoptnum((long)optarg, 0x80000000, &start_line_num, (long)v10); continue; case 83: v24 = 0; col_sep_string = (char (*)[5])locale; col_sep_length = 0; use_col_separator = 1; if ( optarg ) goto LABEL_50; continue; case 84: extremities = 0; keep_FF = 0; continue; case 87: v23 = 0; truncate_lines = 1; v13 = gettext("'-W PAGE_WIDTH' invalid number of characters"); getoptnum((long)optarg, 1, &chars_per_line, (long)v13); continue; case 97: print_across_flag = 1; storing_columns = 0; continue; case 98: balance_columns = 1; continue; case 99: use_cntrl_prefix = 1; continue; case 100: double_space = 1; continue; case 101: if ( optarg ) getoptarg(optarg, 101, &input_tab_char, &chars_per_input_tab); untabify_input = 1; continue; case 104: custom_header = (long)optarg; continue; case 105: if ( optarg ) getoptarg(optarg, 105, &output_tab_char, &chars_per_output_tab); tabify_output = 1; continue; case 108: v9 = gettext("'-l PAGE_LENGTH' invalid number of lines"); getoptnum((long)optarg, 1, &lines_per_page, (long)v9); continue; case 109: parallel_files = 1; storing_columns = 0; continue; case 110: numbered_lines = 1; if ( optarg ) getoptarg(optarg, 110, &number_separator, &chars_per_number); continue; case 111: v11 = gettext("'-o MARGIN' invalid line offset"); getoptnum((long)optarg, 0, &chars_per_margin, (long)v11); continue; case 114: ignore_failed_opens = 1; continue; case 115: v22 = 1; v24 = 1; if ( use_col_separator != 1 && optarg ) LABEL_50: separator_string(optarg); continue; case 116: extremities = 0; keep_FF = 1; continue; case 118: use_esc_sequence = 1; continue; case 119: v22 = 1; v23 = 1; v12 = gettext("'-w PAGE_WIDTH' invalid number of characters"); getoptnum((long)optarg, 1, &v26, (long)v12); if ( truncate_lines != 1 ) chars_per_line = v26; continue; case 128: goto LABEL_26; case 129: if ( !optarg ) { v6 = gettext("'--pages=FIRST_PAGE[:LAST_PAGE]' missing argument"); error(1, 0, v6); } if ( (unsigned char)first_last_page(longind, 0, optarg) == 1 ) continue; v7 = quote(optarg); v8 = gettext("invalid page range %s"); error(1, 0, v8, v7); LABEL_26: parse_column_count((long)optarg); free(ptr); ptr = 0LL; v30 = 0LL; break; default: goto LABEL_61; } } else { if ( v32 + 1 >= v30 ) ptr = (void *)x2realloc(ptr, &v30); v4 = v32++; *((_BYTE *)ptr + v4) = v29; *((_BYTE *)ptr + v32) = 0; } } if ( ptr ) { parse_column_count((long)ptr); free(ptr); } if ( !date_format ) { if ( getenv("POSIXLY_CORRECT") && (unsigned char)hard_locale(2LL) != 1 ) v14 = "%b %e %H:%M %Y"; else v14 = "%Y-%m-%d %H:%M"; date_format = (long)v14; } v15 = getenv("TZ"); localtz = tzalloc(v15); if ( !first_page_number ) first_page_number = 1LL; if ( parallel_files && explicit_columns ) { v16 = gettext("cannot specify number of columns when printing in parallel"); error(1, 0, v16); } if ( parallel_files && print_across_flag ) { v17 = gettext("cannot specify both printing across and printing in parallel"); error(1, 0, v17); } if ( v22 ) { if ( v23 ) { if ( parallel_files || explicit_columns ) { truncate_lines = 1; if ( v24 ) use_col_separator = 1; } else { join_lines = 1; } } else if ( use_col_separator != 1 && v24 && (parallel_files || explicit_columns) ) { if ( truncate_lines != 1 ) { join_lines = 1; if ( col_sep_length > 0 ) use_col_separator = 1; } else { use_col_separator = 1; } } } while ( argc > optind ) { v18 = v27++; v33[v18] = argv[optind++]; } if ( v27 ) { if ( parallel_files ) { print_files(v27, v33); } else { for ( i = 0; i < v27; ++i ) print_files(1u, &v33[i]); } } else { print_files(0, 0LL); } cleanup(); if ( have_read_stdin && (unsigned int)rpl_fclose(stdin) == -1 ) { v19 = gettext("standard input"); v20 = _errno_location(); error(1, *v20, v19); } return (unsigned char)failed_opens; }
static union node * makename(void) { union node *n; n = (union node *)stalloc(sizeof (struct narg)); n->type = 15; n->narg.next = ((void *)0) ; n->narg.text = wordtext; n->narg.backquote = backquotelist; return n; }
int makename() { struct_0 *v0; v0 = stalloc(0x20); v0->field_0 = 15; v0->field_8 = 0; v0->field_10 = -556885833387505336; v0->field_18 = -556885833387505336; return v0; }
int main (int argc, char **argv) { ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdout); parse_gnu_standard_options_only (argc, argv, "uptime", "GNU coreutils", Version, 1 , usage, ("Joseph Arceneaux"), ("David MacKenzie"), ("Kaveh Ghazi"), (char const *) ((void *)0) ); switch (argc - optind) { case 0: uptime ( "/var/run/utmp" , READ_UTMP_CHECK_PIDS); break; case 1: uptime (argv[optind], 0); break; default: error (0, 0, gettext ("extra operand %s"), quote (argv[optind + 1])); usage ( 1 ); } }
int main(unsigned long a0) { void* v0; unsigned long v1; unsigned long v3; unsigned long long *v4; unsigned long long v5; v1 = v3; set_program_name(*(v4)); setlocale(0x6, &g_400bfb); bindtextdomain("coreutils", "/usr/local/share/locale"); textdomain("coreutils"); atexit(got.close_stdout); v0 = 0; parse_gnu_standard_options_only(a0, v4, "uptime", "GNU coreutils", Version, 0x1, usage, "Joseph Arceneaux", "David MacKenzie", "Kaveh Ghazi"); if (!a0 - optind) { uptime("/var/run/utmp", 0x1); } else if (a0 - optind == 1) { uptime(v4[optind], 0x0); } else { v5 = quote(v4[1 + optind]); error(0x0, 0x0, gettext("extra operand %s")); usage(0x1); } }
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 add(unsigned int out[32],const unsigned int a[32],const unsigned int b[32]) { unsigned int j; unsigned int u; u = 0; for (j = 0;j < 31;++j) { u += a[j] + b[j]; out[j] = u & 255; u >>= 8; } u += a[31] + b[31]; out[31] = u; }
void add(unsigned int a0[32], unsigned int a1[32], unsigned int a2[32]) { unsigned int v0; unsigned int v1; unsigned long long v3; v1 = 0; for (v0 = 0; v0 <= 30; v0 += 1) { v1 += a2[v0] + a1[v0]; a0[v0] = v1; v1 >>= 8; } v1 += a2[31] + a1[31]; v3 = v1; a0[31] = v1; return; }
static __inline void _rs_random_buf(void *_buf, size_t n) { u_char *buf = (u_char *)_buf; u_char *keystream; size_t m; _rs_stir_if_needed(n); while (n > 0) { if (rs->rs_have > 0) { m = ((n) < (rs->rs_have) ? (n) : (rs->rs_have)); keystream = rsx->rs_buf + sizeof(rsx->rs_buf) - rs->rs_have; memcpy(buf, keystream, m); memset(keystream, 0, m); buf += m; n -= m; rs->rs_have -= m; } if (rs->rs_have == 0) _rs_rekey( ((void *)0) , 0); } }
void _rs_random_buf(void* a0, unsigned long a1) { unsigned long v0; void* v1; unsigned int v2; void* v3; unsigned long long v5; unsigned long v6; unsigned long long v7; unsigned long long v8; v0 = a1; v1 = a0; v5 = _rs_stir_if_needed(v0); while (v0) { if (*(rs)) { v6 = *(rs); if (v0 <= *(rs)) v6 = v0; *(&v2) = v6; v3 = 0x400 - *(rs) + rsx + 64; memcpy(v1, v3, *(&v2)); memset(v3, 0x0, *(&v2)); v1 += *(&v2); v0 -= *(&v2); *(rs) = *(rs) - *(&v2); } v7 = *(rs); if (!*(rs)) v8 = _rs_rekey(NULL, 0x0); } return; }
static void writeError ( void ) { fprintf ( stderr , "%s: I/O error reading `%s', possible reason follows.\n", progName, inFileName ); perror ( progName ); fprintf ( stderr , "%s: warning: output file(s) may be incomplete.\n", progName ); exit ( 1 ); }
void writeError() { fprintf(stderr, "%s: I/O error reading `%s', possible reason follows.\n", progName, inFileName); perror(progName); fprintf(stderr, "%s: warning: output file(s) may be incomplete.\n", progName); exit(1); }
cron_db database(int installed, char **additional) { cron_db db = { ((void *)0) , ((void *)0) , (time_t) 0}; struct passwd pw; int fd; struct stat ss; user *u; if (installed) load_database(&db); for ( ; *additional != ((void *)0) ; additional++) { fd = open(*additional, 00 ); if (fd == -1) { perror(*additional); continue; } fstat(fd, &ss); if ( (((( ss.st_mode )) & 0170000) == (0040000)) ) { fprintf( stderr , "%s is a directory - skipping\n", *additional); close(fd); continue; } memset(&pw, 0, sizeof(pw)); pw.pw_name = *additional; pw.pw_passwd = ""; pw.pw_dir = "."; u = load_user(fd, &pw, *additional, *additional, *additional); if (u == ((void *)0) ) { printf("cannot load crontab %s\n", *additional); continue; } link_user(&db, u); } return db; }
undefined8 * database(undefined8 *param_1,int param_2,char **param_3) { int __fd; long lVar1; long in_FS_OFFSET; char **local_120; undefined8 local_f8; undefined8 local_f0; undefined8 local_e8; char *local_d8; undefined *local_d0; undefined *local_b8; stat local_a8; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_f8 = 0; local_f0 = 0; local_e8 = 0; local_120 = param_3; if (param_2 != 0) { load_database(&local_f8); } for (; *local_120 != (char *)0x0; local_120 = local_120 + 1) { __fd = open(*local_120,0); if (__fd == -1) { perror(*local_120); } else { fstat(__fd,&local_a8); if ((local_a8.st_mode & 0xf000) == 0x4000) { fprintf(stderr,"%s is a directory - skipping\n",*local_120); close(__fd); } else { memset(&local_d8,0,0x30); local_d8 = *local_120; local_d0 = &DAT_00101244; local_b8 = &DAT_0010127a; lVar1 = load_user(__fd,&local_d8,*local_120,*local_120,*local_120); if (lVar1 == 0) { printf("cannot load crontab %s\n",*local_120); } else { link_user(&local_f8,lVar1); } } } } *param_1 = local_f8; param_1[1] = local_f0; param_1[2] = local_e8; if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return param_1; }
static int hostget_cmd(void) { char n[ 4096 ]; FILE *f; if (!glue_strings(n, sizeof n, "/usr/local/var/spool/cron", ".cron.hostname", '/')) { fprintf( stderr , "path too long\n"); return (-2); } if (!(f = fopen(n, "r"))) { if ( (*__errno_location ()) == 2 ) fprintf( stderr , "File %s not found\n", n); else perror(n); return (-2); } if (get_string(Host, sizeof Host, f, "\n") == (-1) ) { fprintf( stderr , "Error reading from %s\n", n); fclose(f); return (-2); } fclose(f); printf("%s\n", Host); fflush( stdout ); log_it(RealUser, Pid, "GET HOST", Host, 0); return (0); }
int hostget_cmd() { void* v0; char v1; char v2; unsigned int v4; v2 = *(&v2); if (!glue_strings(&v1, 0x1000, "/usr/local/var/spool/cron", ".cron.hostname", 0x2f)) { fprintf(*(&stderr), "path too long\n"); v4 = -2; return v4; } v0 = fopen(&v1, "r"); if (v0) { if (get_string(&Host, 0x40, v0, "\n") == -1) { fprintf(*(&stderr), "Error reading from %s\n", &v1); fclose(v0); v4 = -2; return v4; } fclose(v0); printf("%s\n", &Host); fflush(stdout); log_it(&RealUser, Pid, "GET HOST", &Host, 0x0); v4 = 0; return v4; } else { if (*(__errno_location()) == 2) { fprintf(*(&stderr), "File %s not found\n", &v1); v4 = -2; return v4; } perror(&v1); v4 = -2; return v4; } }
static void swallow_file_in_memory (char const *file_name, BLOCK *block) { size_t used_length; _Bool using_stdin = !file_name || !*file_name || (strcmp (file_name, "-") == 0); if (using_stdin) block->start = fread_file ( stdin , 0, &used_length); else block->start = read_file (file_name, 0, &used_length); if (!block->start) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", quotearg_n_style_colon (0, shell_escape_quoting_style, using_stdin ? \"-\" : file_name)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, using_stdin ? "-" : file_name)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, using_stdin ? "-" : file_name)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (using_stdin) clearerr_unlocked ( stdin ); block->end = block->start + used_length; }
void swallow_file_in_memory(unsigned long long a0, unsigned long long *a1) { char v0; char v1; char v2; char v4; unsigned long long v5; unsigned long long *v6; unsigned long long v7; unsigned long long v8; if (!a0) { LABEL_4008e8: v4 = 1; } else { if (!*(a0)) goto LABEL_4008e8; if (!strcmp(a0, "-")) goto LABEL_4008e8; v4 = 0; } v0 = v4; v0 &= 1; if (v0) *(a1) = fread_file(stdin, 0x0, &v1); else *(a1) = read_file(a0, 0x0, &v1); if (*(a1)) { if (v0) clearerr_unlocked(stdin); a1[1] = *(a1) + *(&v1); v7 = *(&v2) ^ v6[5]; return; } else { if (v0) v5 = "-"; else v5 = a0; v8 = quotearg_n_style_colon(0x0, 0x3, v5); error(0x1, *(__errno_location()), "%s"); } }
int executable_or_directory (file) const char *file; { int s; s = file_status (file); return ((s & 0x2) || (s & 0x10)); }
long long executable_or_directory(char *a0) { unsigned int v0; unsigned long long v2; v0 = file_status(a0); if ((v0 & 2)) { v2 = 1; return v2; } else if ((v0 & 16)) { v2 = 1; return v2; } else { v2 = 0; return v2; } }
void get_cn_crt_set(gnutls_x509_crt_t crt) { int ret; if (batch) { if (!cfg.cn) return; ret = gnutls_x509_crt_set_dn_by_oid(crt, "2.5.4.3", 0, cfg.cn, strlen(cfg.cn)); if (ret < 0) { fprintf( stderr , "set_dn_by_oid: %s\n", gnutls_strerror(ret)); exit(1); } } else { read_crt_set(crt, "Common name: ", "2.5.4.3"); } }
long long get_cn_crt_set(unsigned long long a0) { unsigned int v0; unsigned long long v2; if (!*(got.batch)) { v2 = read_crt_set(a0, "Common name: ", "2.5.4.3"); return v2; } v2 = *((got.cfg + 40)); if (!*((got.cfg + 40))) return v2; v2 = gnutls_x509_crt_set_dn_by_oid(a0, "2.5.4.3", 0x0, *((got.cfg + 40)), strlen(*((got.cfg + 40)))); v0 = v2; if (v0 < 0) { fprintf(*(got.stderr), "set_dn_by_oid: %s\n", gnutls_strerror(v0)); exit(0x1); } return v2; }
static void check_nologin ( _Bool login_to_root) { const char *fname; fname = getdef_str ("NOLOGINS_FILE"); if (( ((void *)0) != fname) && (access (fname, 0 ) == 0)) { FILE *nlfp; nlfp = fopen (fname, "r"); if ( ((void *)0) != nlfp) { int c; while ((c = getc (nlfp)) != (-1) ) { if (c == '\n') { (void) putchar ('\r'); } (void) putchar (c); } (void) fflush ( stdout ); (void) fclose (nlfp); } else { (void) puts (gettext ("\nSystem closed for routine maintenance")); } if (!login_to_root) { closelog (); exit (0); } (void) puts (gettext ("\n[Disconnect bypassed -- root login allowed.]")); } }
void check_nologin(unsigned long a0) { unsigned int v0; char *v1; void* v2; unsigned long long v5; unsigned long long v6; *(&v1) = getdef_str("NOLOGINS_FILE"); if (v1) { v5 = access(v1, 0x0); if (!v5) { v2 = fopen(v1, "r"); if (v2) { while (true) { v0 = getc(v2); if (v0 == -1) break; if (v0 == 10) putchar(0xd); putchar(v0); } fflush(stdout); fclose(v2); } else { puts(gettext("\nSystem closed for routine maintenance")); } if ((a0 ^ 1)) { closelog(); exit(0x0); } v6 = puts(gettext("\n[Disconnect bypassed -- root login allowed.]")); } } if (!(a0 ^ 1) || !v1 || v5) return; }
static void KEM_KeyGen(unsigned char *pk,unsigned char *sk) { int i; ZKeyGen(pk,sk); sk += (2*((761 +3)/4)); for (i = 0;i < 1158;++i) *sk++ = pk[i]; arc4random_buf((sk), (((761 +3)/4))); sk += ((761 +3)/4); Hash_prefix(sk,4,pk,1158); }
void KEM_KeyGen(long param_1,long param_2) { undefined *local_28; int local_c; ZKeyGen(param_1,param_2); local_c = 0; local_28 = (undefined *)(param_2 + 0x17e); while (local_c < 0x486) { *local_28 = *(undefined *)(local_c + param_1); local_c = __addvsi3(local_c,1); local_28 = local_28 + 1; } arc4random_buf(local_28,0xbf); Hash_prefix(local_28 + 0xbf,4,param_1,0x486); return; }
size_t strlens(const char *last, ...) { va_list ap; size_t ret = 0; const char *str; __builtin_va_start( ap , last ) ; for (str = last; str != ((void *)0) ; str = __builtin_va_arg( ap , const char * ) ) ret += strlen(str); __builtin_va_end( ap ) ; return (ret); }
long long strlens() { void* v0; char *v1; unsigned int v2; unsigned int v3; unsigned long v4; unsigned long v5; unsigned long v6; char v7; unsigned long v8; unsigned long v9; unsigned long v10; unsigned long v11; int v12; int v13; int v14; int v15; int v16; int v17; int v18; int v19; unsigned long v20; unsigned long v21; unsigned long v22; unsigned long v23; unsigned long v24; char v25; int v26; int v27; int v28; int v29; int v30; int v31; int v32; int v33; unsigned long long *v34; char *v35; char *v36; v8 = v21; v9 = v22; v10 = v23; v11 = v24; if (v25) { v12 = v26; v13 = v27; v14 = v28; v15 = v29; v16 = v30; v17 = v31; v18 = v32; v19 = v33; } v6 = v34[5]; v0 = 0; v2 = 8; v3 = 48; v4 = &v20; v5 = &v7; for (v1 = v35; v1; v1 = v36) { v0 += strlen(v1); if (v2 > 47) v4 += 8; else v2 += 8; } if (!(v6 ^ v34[5])) return v0; __stack_chk_fail(); }
static void process_extension(SocketEntry *e) { int r, success = 0; char *name; sshlog("ssh-agent.c", __func__, 1577, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "entering"); if ((r = sshbuf_get_cstring(e->request, &name, ((void *)0) )) != 0) { sshlog("ssh-agent.c", __func__, 1579, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "parse"); goto send; } if (strcmp(name, "session-bind@openssh.com") == 0) success = process_ext_session_bind(e); else sshlog("ssh-agent.c", __func__, 1585, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "unsupported extension \"%s\"", name); free(name); send: send_status(e, success); }
void process_extension(struct_0 *a0) { char v0; char v1; char v2; unsigned int v3; unsigned int v4; char v5; char v6; unsigned long long *v8; unsigned long long v9; v3 = 0; sshlog("ssh-agent.c", "process_extension", 0x629, 0x1, 0x6, 0x0, "entering", *(&v0), *(&v1), a0, *(&v2)); v4 = sshbuf_get_cstring(a0->field_18, &v5, 0x0, &v5); if (v4) { sshlog("ssh-agent.c", "process_extension", 0x62b, 0x1, 0x2, ssh_err(v4), "parse", *(&v0), *(&v1), a0, *(&v2)); } else { if (strcmp(*(&v5), "session-bind@openssh.com")) sshlog("ssh-agent.c", "process_extension", 0x631, 0x1, 0x5, 0x0, "unsupported extension \"%s\"", *(&v5), *(&v1), a0, *(&v2)); else v3 = process_ext_session_bind(a0); free(*(&v5)); } send_status(a0, v3); v9 = *(&v6) ^ v8[5]; return; }
uLong crc32_combine_gen(len2) off_t len2; { return crc32_combine_gen64((off64_t)len2); }
long crc32_combine_gen(long a1) { return crc32_combine_gen64(a1); }
static const char * string_from_portable(int pflags) { static char ret[128]; *ret = '\0'; if (pflags & 0x00000001) { if (*ret != '\0') strlcat(ret, ",", sizeof(ret)); strlcat(ret, "READ", sizeof(ret)); } if (pflags & 0x00000002) { if (*ret != '\0') strlcat(ret, ",", sizeof(ret)); strlcat(ret, "WRITE", sizeof(ret)); } if (pflags & 0x00000004) { if (*ret != '\0') strlcat(ret, ",", sizeof(ret)); strlcat(ret, "APPEND", sizeof(ret)); } if (pflags & 0x00000008) { if (*ret != '\0') strlcat(ret, ",", sizeof(ret)); strlcat(ret, "CREATE", sizeof(ret)); } if (pflags & 0x00000010) { if (*ret != '\0') strlcat(ret, ",", sizeof(ret)); strlcat(ret, "TRUNCATE", sizeof(ret)); } if (pflags & 0x00000020) { if (*ret != '\0') strlcat(ret, ",", sizeof(ret)); strlcat(ret, "EXCL", sizeof(ret)); } return ret; }
int string_from_portable(unsigned long a0) { ret.12918 = 0; if ((a0 & 1)) { if (ret.12918) strlcat(&ret.12918, ",", 0x80); strlcat(&ret.12918, "READ", 0x80); } if ((a0 & 2)) { if (ret.12918) strlcat(&ret.12918, ",", 0x80); strlcat(&ret.12918, "WRITE", 0x80); } if ((a0 & 4)) { if (ret.12918) strlcat(&ret.12918, ",", 0x80); strlcat(&ret.12918, "APPEND", 0x80); } if ((a0 & 8)) { if (ret.12918) strlcat(&ret.12918, ",", 0x80); strlcat(&ret.12918, "CREATE", 0x80); } if ((a0 & 16)) { if (ret.12918) strlcat(&ret.12918, ",", 0x80); strlcat(&ret.12918, "TRUNCATE", 0x80); } if (!(a0 & 32)) return &ret.12918; if (ret.12918) strlcat(&ret.12918, ",", 0x80); strlcat(&ret.12918, "EXCL", 0x80); return &ret.12918; }
static inline __u32 rta_getattr_u32(const struct rtattr *rta) { return *(__u32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); }
long rta_getattr_u32(long a1) { return *(unsigned int *)(a1 + 4); }
stderr , gettext ("The password for %s cannot be changed.\n"), sp->sp_namp); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 4 , "password locked for '%s'", sp->sp_namp) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while (
void gettext(void) { halt_baddata(); }
static int funopen_seek(void *cookie, off64_t *offset, int whence) { struct funopen_cookie *cookiewrap = cookie; off_t soff = *offset; if (cookiewrap->seekfn == ((void *)0) ) { (*__errno_location ()) = 29 ; return -1; } soff = cookiewrap->seekfn(cookiewrap->orig_cookie, soff, whence); *offset = soff; return *offset; }
long long funopen_seek(unsigned long long a0[4], unsigned long long *a1, unsigned long a2) { unsigned long v0; unsigned long long v2; v0 = *(a1); if (!a0[3]) { *(__errno_location()) = 29; v2 = 4294967295; } else { v0 = a0[3](a0[0], v0, a2, v0, a0[3]); *(a1) = v0; v2 = *(a1); } return v2; }
void pkcs11_terminate(void) { if (fd >= 0) close(fd); }
void pkcs11_terminate(void) { if (-1 < fd) { close(fd); } return; }
static int history_save_fp(History *h, size_t nelem, FILE *fp) { HistEvent ev; int i = -1, retval; size_t len, max_size; char *ptr; const char *str; if (fchmod(fileno(fp), 0400 | 0200 ) == -1) goto done; if (ftell(fp) == 0 && fputs(hist_cookie, fp) == (-1) ) goto done; ptr = malloc((max_size = 1024) * sizeof(*ptr)); if (ptr == ((void *)0) ) goto done; if (nelem != (size_t)-1) { for (retval = (*(h)->h_first)((h)->h_ref, &ev); retval != -1 && nelem-- > 0; retval = (*(h)->h_next)((h)->h_ref, &ev)) continue; } else retval = -1; if (retval == -1) retval = (*(h)->h_last)((h)->h_ref, &ev); for (i = 0; retval != -1; retval = (*(h)->h_prev)((h)->h_ref, &ev), i++) { str = (ev.str); len = strlen(str) * 4 + 1; if (len > max_size) { char *nptr; max_size = (len + 1024) & (size_t)~1023; nptr = realloc((ptr), (max_size * sizeof(*ptr))); if (nptr == ((void *)0) ) { i = -1; goto oomem; } ptr = nptr; } (void) strvis(ptr, str, (0x0004 | 0x0008 | 0x0010)); (void) fprintf(fp, "%s\n", ptr); } oomem: free(ptr); done: return i; }
int history_save_fp(unsigned long long a0[6], unsigned long long a1, void* a2) { unsigned long long v0; unsigned int v1; unsigned int v2; unsigned long long v3; void* v4; unsigned long long v5; unsigned long v6; void* v7; char v8; char v9; v0 = a1; v1 = -1; if (fchmod(fileno(a2), 0x180) == -1) return v1; if (!ftell(a2) && fputs("_HiStOrY_V2_\n", a2) == -1) return v1; v3 = 0x400; v4 = malloc(0x400); if (!v4) return v1; if (v0 == -1) { v2 = -1; } else { for (v2 = a0[2](a0[0], &v8, &v8, a0[2]); v2 != -1 && (v0 -= 1, v0); v2 = a0[3](a0[0], &v8, &v8, a0[3])); } if (v2 == -1) v2 = a0[4](a0[0], &v8, &v8, a0[4]); v1 = 0; while (true) { if (v2 == -1) break; v5 = *(&v9); v6 = strlen(v5) * 4 + 1; if (v6 > v3) { *(&v3) = v6 + 0x400 & -0x400; v7 = realloc(v4, *(&v3)); if (v7) { v4 = v7; } else { v1 = -1; break; } } strvis(v4, v5, 0x1c, v5); fprintf(a2, "%s\n", v4); v2 = a0[5](a0[0], &v8, &v8, a0[5]); v1 += 1; } free(v4); return v1; }
int gzclose(file) gzFile file; { gz_statep state; if (file == ((void *)0) ) return (-2); state = (gz_statep)file; return state->mode == 7247 ? gzclose_r(file) : gzclose_w(file); }
long gzclose(long a1) { if ( !a1 ) return 4294967294LL; if ( *(_DWORD *)(a1 + 24) == 7247 ) return gzclose_r(a1); return gzclose_w(a1); }
static void usage(void) { print_usage( stderr ); }
void usage() { unsigned long long v1; v1 = print_usage(stderr); return; }
static char const * trim_leading_zeros (char const *s) { char const *p = s; while (*s == '0') ++s; if (!*s && s != p) --s; return s; }
int trim_leading_zeros(unsigned long a0) { char *v0; char *v1; v0 = a0; for (v1 = v0; *(v0) == 48; v0 += 1); if (!*(v0) && v0 != v1) v0 += 1; return v0; }
char * __acl_to_any_text(acl_t acl, ssize_t *len_p, const char *prefix, char separator, const char *suffix, int options) { acl_obj *acl_obj_p = ((acl_obj *)__ext2int_and_check(acl, (0x712C))); ssize_t size, len = 0, entry_len = 0, suffix_len = suffix ? strlen(suffix) : 0; string_obj *string_obj_p, *tmp; acl_entry_obj *entry_obj_p, *mask_obj_p = ((void *)0) ; if (!acl_obj_p) return ((void *)0) ; size = acl->a_used * 15 + 1; string_obj_p = ((string_obj *)__new_var_obj_p((0xD5F2), sizeof(string_obj) + size)); if (!string_obj_p) return ((void *)0) ; if (options & (0x01|0x02)) { for( (entry_obj_p) = (acl_obj_p)->i.a_next; (entry_obj_p) != (acl_entry_obj *)(acl_obj_p); (entry_obj_p) = (entry_obj_p)->i.e_next ) { if (entry_obj_p->i.e_entry.e_tag == (0x10)) { mask_obj_p = entry_obj_p; break; } } } for( (entry_obj_p) = (acl_obj_p)->i.a_next; (entry_obj_p) != (acl_entry_obj *)(acl_obj_p); (entry_obj_p) = (entry_obj_p)->i.e_next ) { repeat: entry_len = acl_entry_to_any_str(((entry_obj_p) ? &(entry_obj_p)->i : ((void *)0) ), string_obj_p->i.s_str + len, size-len, ((mask_obj_p) ? &(mask_obj_p)->i : ((void *)0) ), prefix, options); if (entry_len < 0) goto fail; else if (len + entry_len + suffix_len + 1 > size) { while (len + entry_len + suffix_len + 1 > size) size <<= 1; tmp = ((string_obj *)realloc(string_obj_p, sizeof(string_obj) + size)); if (tmp == ((void *)0) ) goto fail; string_obj_p = tmp; goto repeat; } else len += entry_len; string_obj_p->i.s_str[len] = separator; len++; } if (len) len--; if (len && suffix) { strcpy(string_obj_p->i.s_str + len, suffix); len += suffix_len; } else string_obj_p->i.s_str[len] = '\0'; if (len_p) *len_p = len; return (char *)((string_obj_p) ? &(string_obj_p)->i : ((void *)0) ); fail: (__free_obj_p((obj_prefix *)(string_obj_p))); return ((void *)0) ; }
long __acl_to_any_text(long param_1,long *param_2,undefined8 param_3,undefined param_4,char *param_5 ,uint param_6) { long lVar1; size_t sVar2; long lVar3; long lVar4; void *pvVar5; long local_50; long local_48; void *local_40; long local_38; long local_30; lVar1 = __ext2int_and_check(param_1,0x712c); local_48 = 0; if (param_5 == (char *)0x0) { sVar2 = 0; } else { sVar2 = strlen(param_5); } local_30 = 0; if (lVar1 == 0) { lVar1 = 0; } else { lVar4 = *(long *)(param_1 + 0x28) * 0xf; local_50 = lVar4 + 1; local_40 = (void *)__new_var_obj_p(0xd5f2,lVar4 + 9); if (local_40 == (void *)0x0) { lVar1 = 0; } else { if ((param_6 & 3) != 0) { for (local_38 = *(long *)(lVar1 + 0x10); local_38 != lVar1; local_38 = *(long *)(local_38 + 0x10)) { if (*(int *)(local_38 + 0x20) == 0x10) { local_30 = local_38; break; } } } for (local_38 = *(long *)(lVar1 + 0x10); pvVar5 = local_40, local_38 != lVar1; local_38 = *(long *)(local_38 + 0x10)) { while( true ) { local_40 = pvVar5; if (local_30 == 0) { lVar4 = 0; } else { lVar4 = local_30 + 8; } if (local_38 == 0) { lVar3 = 0; } else { lVar3 = local_38 + 8; } lVar4 = acl_entry_to_any_str (lVar3,(long)local_40 + local_48 + 8,local_50 - local_48,lVar4,param_3, param_6); if (lVar4 < 0) goto LAB_001002ad; if ((long)(sVar2 + local_48 + lVar4) < local_50) break; for (; local_50 <= (long)(sVar2 + local_48 + lVar4); local_50 = local_50 << 1) { } pvVar5 = realloc(local_40,local_50 + 8); if (pvVar5 == (void *)0x0) { LAB_001002ad: __free_obj_p(local_40); return 0; } } *(undefined *)((long)local_40 + local_48 + lVar4 + 8) = param_4; local_48 = local_48 + lVar4 + 1; } if (local_48 != 0) { local_48 = local_48 + -1; } if ((local_48 == 0) || (param_5 == (char *)0x0)) { *(undefined *)((long)local_40 + local_48 + 8) = 0; } else { strcpy((char *)((long)local_40 + local_48 + 8),param_5); local_48 = local_48 + sVar2; } if (param_2 != (long *)0x0) { *param_2 = local_48; } if (local_40 == (void *)0x0) { lVar1 = 0; } else { lVar1 = (long)local_40 + 8; } } } return lVar1; }
static off_t input_file_size (int fd, struct stat const *st, char *buf, size_t bufsize) { off_t cur = lseek (fd, 0, 1 ); if (cur < 0) { if ( (*__errno_location ()) == 29 ) (*__errno_location ()) = 0; return -1; } off_t size = 0; do { size_t n_read = safe_read (fd, buf + size, bufsize - size); if (n_read == 0) return size; if (n_read == ((size_t) -1)) return -1; size += n_read; } while (size < bufsize); if (st->st_size == 0) { (*__errno_location ()) = 75 ; return -1; } cur += size; off_t end; if (usable_st_size (st) && cur <= st->st_size) end = st->st_size; else { end = lseek (fd, 0, 2 ); if (end < 0) return -1; if (end != cur) { if (lseek (fd, cur, 0 ) < 0) return -1; if (end < cur) end = cur; } } size += end - cur; if (size == ((off_t) (! (! ((off_t) 0 < (off_t) -1)) ? (off_t) -1 : ((((off_t) 1 << ((sizeof (off_t) * 8) - 2)) - 1) * 2 + 1)))) { (*__errno_location ()) = 75 ; return -1; } return size; }
int input_file_size(unsigned long a0, struct_0 *a1, unsigned long a2, unsigned long a3) { char v0; void* v1; unsigned long v2; unsigned long v3; unsigned long v4; unsigned int v7; v3 = lseek(a0, 0x0, 0x1); if ((v3 - 0 >> 63)) { if (*(__errno_location()) == 29) *(__errno_location()) = 0; v7 = -1; } else { v1 = 0; while (true) { v4 = safe_read(*(&v0), v1 + a2, a3 - v1, v1 + a2); if (!v4) { v7 = v1; break; } else if (v4 == -1) { v7 = -1; break; } else { v1 = v4 + v1; if (a3 > v1) continue; if (!a1->field_30) { *(__errno_location()) = 75; v7 = -1; break; } else { *(&v3) = v3 + v1; v7 = usable_st_size(a1); if (v7 && *(&v3) <= a1->field_30) v2 = a1->field_30; if (!v7 || *(&v3) > a1->field_30) { v2 = lseek(*(&v0), 0x0, 0x2); if ((v2 - 0 >> 63)) { v7 = -1; break; } else if (v2 != *(&v3)) { v7 = lseek(*(&v0), *(&v3), 0x0); if (v7 < 0) { v7 = -1; break; } else if (v2 < *(&v3)) { v2 = *(&v3); } } } if (v2 == *(&v3) && !((v2 - 0 >> 63)) || *(&v3) <= a1->field_30 && v7 || !((v2 - 0 >> 63)) && v7 >= 0) { v1 += v2 - *(&v3); if (v1 == 9223372036854775807) { *(__errno_location()) = 75; v7 = -1; break; } else { v7 = v1; break; } } } } } } return v7; }
static char * array_to_string_internal (start, end, sep, quoted) ARRAY_ELEMENT *start, *end; char *sep; int quoted; { char *result, *t; ARRAY_ELEMENT *ae; int slen, rsize, rlen, reg; if (start == end) return ((char *) ((void *)0) ); slen = strlen(sep); result = ((void *)0) ; for (rsize = rlen = 0, ae = start; ae != end; ae = ((ae)->next)) { if (rsize == 0) result = (char *)sh_xmalloc((rsize = 64), "array.c", 927); if (((ae)->value)) { t = quoted ? quote_string(((ae)->value)) : ((ae)->value); reg = strlen(t); do { if ((rlen) + ((reg + slen + 2)) >= rsize) { while ((rlen) + ((reg + slen + 2)) >= rsize) rsize += (rsize); result = sh_xrealloc((result), (rsize), "array.c", 931); } } while (0) ; strcpy(result + rlen, t); rlen += reg; if (quoted) sh_xfree((t), "array.c", 936); if (((ae)->next) != end) { strcpy(result + rlen, sep); rlen += slen; } } } if (result) result[rlen] = '\0'; return(result); }
void array_to_string_internal(unsigned long a0, unsigned long a1, char *a2, unsigned long a3) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; void* v4; unsigned long long v5[3]; char *v6; void* v8; char *v10; void* v12; if (a0 == a1) { v8 = 0; } else { v2 = strlen(a2); v4 = 0; v1 = 0; v0 = v1; for (v5[0] = a0; v5 != a1; v5[0] = v5[2]) { if (!v0) { v0 = 64; *(&v4) = sh_xmalloc(0x40, "array.c", 0x39f); } if (v5[1]) { if (!a3) v10 = v5[1]; else v10 = quote_string(v5[1]); v6 = v10; if (v0 <= v1 + v2 + v3 + 2) { for (v3 = strlen(v6); v0 <= v1 + v2 + v3 + 2; v0 *= 2); *(&v4) = sh_xrealloc(v4, v0, "array.c", 0x3a3); } strcpy(v1 + v4, v6); v1 += v3; if (a3) sh_xfree(v6, "array.c", 0x3a8); if (a1 != v5[2]) { strcpy(v1 + v4, a2); v1 += v2; } } } if (v4) *(v4 + v1) = 0; v12 = v4; } return; }
static int sshsk_ed25519_assemble(struct sk_enroll_response *resp, struct sshkey **keyp) { struct sshkey *key = ((void *)0) ; int r; *keyp = ((void *)0) ; if (resp->public_key_len != 32U) { sshlog("ssh-sk.c", __func__, 266, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "invalid size: %zu", resp->public_key_len); r = -4; goto out; } if ((key = sshkey_new(KEY_ED25519_SK)) == ((void *)0) ) { sshlog("ssh-sk.c", __func__, 271, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "sshkey_new failed"); r = -2; goto out; } if ((key->ed25519_pk = malloc(32U)) == ((void *)0) ) { sshlog("ssh-sk.c", __func__, 276, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "malloc failed"); r = -2; goto out; } memcpy(key->ed25519_pk, resp->public_key, 32U); *keyp = key; key = ((void *)0) ; r = 0; out: sshkey_free(key); return r; }
undefined4 sshsk_ed25519_assemble(long param_1,long *param_2) { void *pvVar1; undefined8 uVar2; undefined4 local_14; long local_10; local_10 = 0; *param_2 = 0; if (*(long *)(param_1 + 0x10) == 0x20) { uVar2 = 0x1009fa; local_10 = sshkey_new(0xc); if (local_10 == 0) { sshlog("ssh-sk.c","sshsk_ed25519_assemble",0x10f,1,2,0,"sshkey_new failed",uVar2); local_14 = 0xfffffffe; } else { uVar2 = 0x100a59; pvVar1 = malloc(0x20); *(void **)(local_10 + 0x30) = pvVar1; if (*(long *)(local_10 + 0x30) == 0) { sshlog("ssh-sk.c","sshsk_ed25519_assemble",0x114,1,2,0,"malloc failed",uVar2); local_14 = 0xfffffffe; } else { memcpy(*(void **)(local_10 + 0x30),*(void **)(param_1 + 8),0x20); *param_2 = local_10; local_10 = 0; local_14 = 0; } } } else { sshlog("ssh-sk.c","sshsk_ed25519_assemble",0x10a,1,2,0,"invalid size: %zu", *(undefined8 *)(param_1 + 0x10)); local_14 = 0xfffffffc; } sshkey_free(local_10); return local_14; }
int ifdown(void) { char ifr_buf[sizeof(struct ifreq) * 64]; char *ifr_end; struct ifconf ifc; int fd; int shaper; if ((fd = socket( 2 , SOCK_DGRAM , 0)) < 0) { fprintf( stderr , "ifdown: "); perror("socket"); return -1; } ifc.ifc_len = sizeof(ifr_buf); ifc. ifc_ifcu.ifcu_buf = ifr_buf; if (ioctl(fd, 0x8912 , &ifc) < 0) { fprintf( stderr , "ifdown: "); perror("SIOCGIFCONF"); close(fd); return -1; } ifr_end = ifr_buf + ifc.ifc_len; for (shaper = 1; shaper >= 0; shaper--) { char *ifr_next = ifr_buf; while (ifr_next < ifr_end) { struct ifreq *ifr; int flags; ifr = (struct ifreq *)ifr_next; ifr_next += sizeof(struct ifreq); if ((strncmp(ifr-> ifr_ifrn.ifrn_name , "shaper", 6) == 0) != shaper) continue; if (strncmp(ifr-> ifr_ifrn.ifrn_name , "lo", 2) == 0) continue; if (strchr(ifr-> ifr_ifrn.ifrn_name , ':') != ((void *)0) ) continue; if (ioctl(fd, 0x8913 , ifr) < 0) { fprintf( stderr , "ifdown: shutdown "); perror(ifr-> ifr_ifrn.ifrn_name ); continue; } flags = ifr-> ifr_ifru.ifru_flags ; if (flags & IFF_UP ) { flags &= ~( IFF_UP ); ifr-> ifr_ifru.ifru_flags = flags; if (ioctl(fd, 0x8914 , ifr) < 0) { fprintf( stderr , "ifdown: shutdown "); perror(ifr-> ifr_ifrn.ifrn_name ); } } } } close(fd); return 0; }
long ifdown() { int i; int fd; short v3; char *j; char *v5; char *s1; int v7; char *v8; char v9[2568]; unsigned long v10; v10 = __readfsqword(0x28u); fd = socket(2, 2, 0); if ( fd >= 0 ) { v7 = 2560; v8 = v9; if ( ioctl(fd, 0x8912uLL, &v7) >= 0 ) { v5 = &v9[v7]; for ( i = 1; i >= 0; --i ) { for ( j = v9; j < v5; j += 40 ) { s1 = j; if ( i == (strncmp(s1, "shaper", 6uLL) == 0) ) { if ( strncmp(s1, "lo", 2uLL) ) { if ( !strchr(s1, 58) ) { if ( ioctl(fd, 0x8913uLL, s1) < 0 || (v3 = *((_WORD *)s1 + 8), (v3 & 1) != 0) && (*((_WORD *)s1 + 8) = v3 & 0xFFFE, ioctl(fd, 0x8914uLL, s1) < 0) ) { fprintf(stderr, "ifdown: shutdown "); perror(s1); } } } } } } close(fd); return 0LL; } else { fprintf(stderr, "ifdown: "); perror("SIOCGIFCONF"); close(fd); return 0xFFFFFFFFLL; } } else { fprintf(stderr, "ifdown: "); perror("socket"); return 0xFFFFFFFFLL; } }
static __inline void _rs_random_buf(void *_buf, size_t n) { unsigned char *buf = (unsigned char *)_buf; unsigned char *keystream; size_t m; _rs_stir_if_needed(n); while (n > 0) { if (rs->rs_have > 0) { m = ((n) < (rs->rs_have) ? (n) : (rs->rs_have)); keystream = rsx->rs_buf + sizeof(rsx->rs_buf) - rs->rs_have; memcpy(buf, keystream, m); memset(keystream, 0, m); buf += m; n -= m; rs->rs_have -= m; } if (rs->rs_have == 0) _rs_rekey( ((void *)0) , 0); } }
void _rs_random_buf(void *param_1,ulong param_2) { ulong __n; void *__src; ulong local_38; void *local_20; _rs_stir_if_needed(param_2); local_38 = param_2; local_20 = param_1; while (local_38 != 0) { if (*rs != 0) { __n = *rs; if (local_38 <= *rs) { __n = local_38; } __src = (void *)((rsx + 0x440) - *rs); memcpy(local_20,__src,__n); memset(__src,0,__n); local_20 = (void *)((long)local_20 + __n); local_38 = local_38 - __n; *rs = *rs - __n; } if (*rs == 0) { _rs_rekey(0,0); } } return; }
char * bash_tilde_find_word (s, flags, lenp) const char *s; int flags, *lenp; { const char *r; char *ret; int l; for (r = s; *r && *r != '/'; r++) { if (*r == '\\' || *r == '\'' || *r == '"') { ret = (char *)strcpy (sh_xmalloc((1 + strlen (s)), "general.c", 1184), (s)); if (lenp) *lenp = 0; return ret; } else if (flags && *r == ':') break; } l = r - s; ret = sh_xmalloc((l + 1), "general.c", 1193); strncpy (ret, s, l); ret[l] = '\0'; if (lenp) *lenp = l; return ret; }
long long bash_tilde_find_word(char *a0, unsigned long a1, unsigned int *a2) { unsigned int v0; char *v1; unsigned long long v2; char *v4; v1 = a0; while (true) { if (!*(v1)) { LABEL_401d31: v0 = v1 - a0; v2 = sh_xmalloc(v0 + 1, "general.c", 0x4a9); strncpy(v2, a0, v0); v2[v0] = 0; if (a2) *(a2) = v0; v4 = v2; break; } else { if (*(v1) == 47) goto LABEL_401d31; if (*(v1) == 92) { LABEL_401caa: v2 = strcpy(sh_xmalloc(strlen(a0) + 1, "general.c", 0x4a0), a0); if (a2) *(a2) = 0; v4 = v2; break; } else { if (*(v1) == 39) goto LABEL_401caa; if (*(v1) == 34) goto LABEL_401caa; if (a1 && *(v1) == 58) goto LABEL_401d31; v1 += 1; } } } return v4; }
static int show_handler(struct rtnl_ctrl_data *ctrl, struct nlmsghdr *n, void *arg) { struct ifaddrmsg *ifa = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); open_json_object( ((void *)0) ); print_int(PRINT_ANY, "index", "if%d:", ifa->ifa_index); print_nl(); print_addrinfo(n, stdout ); close_json_object(); return 0; }
undefined8 show_handler(undefined8 param_1,long param_2) { open_json_object(0); print_int(4,"index","if%d:",*(undefined4 *)(param_2 + 0x14)); print_nl(); print_addrinfo(param_2,stdout); close_json_object(); return 0; }
int do_upload(struct sftp_conn *conn, const char *local_path, const char *remote_path, int preserve_flag, int resume, int fsync_flag, int inplace_flag) { int r, local_fd; u_int openmode, id, status = 0, reordered = 0; off_t offset, progress_counter; u_char type, *handle, *data; struct sshbuf *msg; struct stat sb; Attrib a, t, *c = ((void *)0) ; u_int32_t startid, ackid; u_int64_t highwater = 0; struct request *ack = ((void *)0) ; struct requests acks; size_t handle_len; sshlog("sftp-client.c", __func__, 2008, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "upload local \"%s\" to remote \"%s\"", local_path, remote_path) ; do { (&acks)->tqh_first = ((void *)0) ; (&acks)->tqh_last = &(&acks)->tqh_first; } while (0); if ((local_fd = open(local_path, 00 )) == -1) { sshlog("sftp-client.c", __func__, 2014, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "open local \"%s\": %s", local_path, strerror( (*__errno_location ()) )); return(-1); } if (fstat(local_fd, &sb) == -1) { sshlog("sftp-client.c", __func__, 2018, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "fstat local \"%s\": %s", local_path, strerror( (*__errno_location ()) )); close(local_fd); return(-1); } if (! (((( sb.st_mode )) & 0170000) == (0100000)) ) { sshlog("sftp-client.c", __func__, 2023, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "local \"%s\" is not a regular file", local_path); close(local_fd); return(-1); } stat_to_attrib(&sb, &a); a.flags &= ~0x00000001; a.flags &= ~0x00000002; a.perm &= 0777; if (!preserve_flag) a.flags &= ~0x00000008; if (resume) { if ((c = do_stat(conn, remote_path, 0)) == ((void *)0) ) { close(local_fd); return -1; } if ((off_t)c->size >= sb.st_size) { sshlog("sftp-client.c", __func__, 2043, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "resume \"%s\": destination file " "same size or larger", local_path) ; close(local_fd); return -1; } if (lseek(local_fd, (off_t)c->size, 0 ) == -1) { close(local_fd); return -1; } } openmode = 0x00000002|0x00000008; if (resume) openmode |= 0x00000004; else if (!inplace_flag) openmode |= 0x00000010; if (send_open(conn, remote_path, "dest", openmode, &a, &handle, &handle_len) != 0) { close(local_fd); return -1; } id = conn->msg_id; startid = ackid = id + 1; data = xmalloc(conn->upload_buflen); offset = progress_counter = (resume ? c->size : 0); if (showprogress) { start_progress_meter(progress_meter_path(local_path), sb.st_size, &progress_counter); } if ((msg = sshbuf_new()) == ((void *)0) ) sshfatal("sftp-client.c", __func__, 2080, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); for (;;) { int len; if (interrupted || status != 0) len = 0; else do len = read(local_fd, data, conn->upload_buflen); while ((len == -1) && ( (*__errno_location ()) == 4 || (*__errno_location ()) == 11 || (*__errno_location ()) == 11 )); if (len == -1) { sshfatal("sftp-client.c", __func__, 2098, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "read local \"%s\": %s", local_path, strerror( (*__errno_location ()) )) ; } else if (len != 0) { ack = request_enqueue(&acks, ++id, len, offset); sshbuf_reset(msg); if ((r = sshbuf_put_u8(msg, 6)) != 0 || (r = sshbuf_put_u32(msg, ack->id)) != 0 || (r = sshbuf_put_string(msg, handle, handle_len)) != 0 || (r = sshbuf_put_u64(msg, offset)) != 0 || (r = sshbuf_put_string(msg, data, len)) != 0) sshfatal("sftp-client.c", __func__, 2109, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose"); send_msg(conn, msg); sshlog("sftp-client.c", __func__, 2111, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "Sent message SSH2_FXP_WRITE I:%u O:%llu S:%u", id, (unsigned long long)offset, len) ; } else if (((&acks)->tqh_first) == ((void *)0) ) break; if (ack == ((void *)0) ) sshfatal("sftp-client.c", __func__, 2117, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Unexpected ACK %u", id); if (id == startid || len == 0 || id - ackid >= conn->num_requests) { u_int rid; sshbuf_reset(msg); get_msg(conn, msg); if ((r = sshbuf_get_u8(msg, &type)) != 0 || (r = sshbuf_get_u32(msg, &rid)) != 0) sshfatal("sftp-client.c", __func__, 2127, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); if (type != 101) sshfatal("sftp-client.c", __func__, 2130, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Expected SSH2_FXP_STATUS(%d) packet, " "got %d", 101, type) ; if ((r = sshbuf_get_u32(msg, &status)) != 0) sshfatal("sftp-client.c", __func__, 2134, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse status"); sshlog("sftp-client.c", __func__, 2135, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "SSH2_FXP_STATUS %u", status); if ((ack = request_find(&acks, rid)) == ((void *)0) ) sshfatal("sftp-client.c", __func__, 2139, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Can't find request for ID %u", rid); do { if (((ack)->tq.tqe_next) != ((void *)0) ) (ack)->tq.tqe_next->tq.tqe_prev = (ack)->tq.tqe_prev; else (&acks)->tqh_last = (ack)->tq.tqe_prev; *(ack)->tq.tqe_prev = (ack)->tq.tqe_next; ; ; } while (0); sshlog("sftp-client.c", __func__, 2141, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "In write loop, ack for %u %zu bytes at %lld", ack->id, ack->len, (unsigned long long)ack->offset) ; ++ackid; progress_counter += ack->len; if (!reordered && ack->offset <= highwater) highwater = ack->offset + ack->len; else if (!reordered && ack->offset > highwater) { sshlog("sftp-client.c", __func__, 2148, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "server reordered ACKs"); reordered = 1; } free(ack); } offset += len; if (offset < 0) sshfatal("sftp-client.c", __func__, 2155, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "offset < 0"); } sshbuf_free(msg); if (showprogress) stop_progress_meter(); free(data); if (status != 0) { sshlog("sftp-client.c", __func__, 2164, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "write remote \"%s\": %s", remote_path, fx2txt(status)); status = 4; } if (inplace_flag || (resume && (status != 0 || interrupted))) { sshlog("sftp-client.c", __func__, 2169, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "truncating at %llu", (unsigned long long)highwater); attrib_clear(&t); t.flags = 0x00000001; t.size = highwater; do_fsetstat(conn, handle, handle_len, &t); } if (close(local_fd) == -1) { sshlog("sftp-client.c", __func__, 2177, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "close local \"%s\": %s", local_path, strerror( (*__errno_location ()) )); status = 4; } if (preserve_flag) do_fsetstat(conn, handle, handle_len, &a); if (fsync_flag) (void)do_fsync(conn, handle, handle_len); if (do_close(conn, handle, handle_len) != 0) status = 4; free(handle); return status == 0 ? 0 : -1; }
int do_upload(unsigned int a0[7], char *a1, char *a2, unsigned long a3, unsigned long a4, unsigned long a5, unsigned int v35) { unsigned long v0; unsigned long v1; char v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned int v8; unsigned int v9; unsigned int v10; unsigned int v11; void* v12; char v13; char v14; void* v15; void* v16; void* v17; void* v18; void* v19; unsigned long long v20; void* v21; unsigned long v22; unsigned int v23; unsigned int v24; unsigned int v25; void* v26; char v27; char v28; char v29; unsigned long long v30; unsigned long v31; unsigned long long v32; unsigned long v33; char v34; unsigned int v36; void* v38; v3 = 0; v7 = 0; v16 = 0; v17 = 0; v18 = 0; v0 = a1; sshlog("sftp-client.c", "do_upload", 0x7d8, 0x1, 0x6, 0x0, "upload local \"%s\" to remote \"%s\""); v21 = 0; v22 = &v21; v10 = open(a1, 0x0, 0x7d8); if (v10 == -1) { strerror(*(__errno_location())); v0 = a1; sshlog("sftp-client.c", "do_upload", 0x7de, 0x0, 0x2, 0x0, "open local \"%s\": %s"); v36 = -1; } else { v36 = fstat(v10, &v27); if (v36 == -1) { strerror(*(__errno_location())); v0 = a1; sshlog("sftp-client.c", "do_upload", 0x7e2, 0x0, 0x2, 0x0, "fstat local \"%s\": %s"); close(v10); v36 = -1; } else if ((*(&v28) & 0xf000) != 0x8000) { v1 = a1; sshlog("sftp-client.c", "do_upload", 0x7e7, 0x0, 0x2, 0x0, "local \"%s\" is not a regular file"); close(v10); v36 = -1; } else { stat_to_attrib(&v27, &v23, &v23); v23 = *(&v23) & -2; v23 &= -3; v24 = *(&v24) & 511; if (!a3) v23 &= -9; if (a4) { v16 = do_stat(a0, a2, 0x0); if (!v16) { close(v10); v36 = -1; } else if (v16[8] >= *(&v29)) { v1 = a1; sshlog("sftp-client.c", "do_upload", 0x7fb, 0x0, 0x2, 0x0, "resume \"%s\": destination file same size or larger"); close(v10); v36 = -1; } else { v36 = lseek(v10, v16[8], 0x0); if (v36 == -1) { close(v10); v36 = -1; } } } if (!a4 || v16[8] < *(&v29) && v16 && v36 != -1) { v5 = 10; if (a4) { v5 |= 4; } else if (!v35) { v5 |= 16; } v36 = send_open(a0, a2, "dest", v5, &v23, &v13, &v14); if (v36) { close(v10); v36 = -1; } else { v6 = a0[6]; v8 = v6 + 1; v11 = v8; v19 = xmalloc(a0[3]); if (a4) v38 = v16[8]; else v38 = 0; v12 = v38; v15 = v12; if (showprogress) { v38 = progress_meter_path(a1); start_progress_meter(v38, *(&v29), &v12, v38); } v20 = sshbuf_new(); if (!v20) sshfatal("sftp-client.c", "do_upload", 0x820, 0x1, 0x1, 0x0, "sshbuf_new failed"); while (true) { if (!interrupted && !v3) { while (true) { v9 = read(v10, v19, a0[3]); if (v9 != -1) break; *(&v38) = *(__errno_location()); if (v38 == 4) continue; *(&v38) = *(__errno_location()); if (v38 == 11) continue; *(&v38) = *(__errno_location()); if (v38 != 11) break; } } if (interrupted || v3) v9 = 0; if (v9 == -1) { v32 = strerror(*(__errno_location())); v31 = a1; v30 = "read local \"%s\": %s"; sshfatal("sftp-client.c", "do_upload", 0x832, 0x0, 0x1, 0x0, *(&v34)); } if (v9) { v6 += 1; v18 = request_enqueue(&v21, v6, v9, v15); sshbuf_reset(v20); v4 = sshbuf_put_u8(v20, 0x6, a0[3]); if (!v4) { v4 = sshbuf_put_u32(v20, *(v18), *(v18)); if (!v4) { v4 = sshbuf_put_string(v20, *(&v13), *(&v14), *(&v13)); if (!v4) { v4 = sshbuf_put_u64(v20, v15); if (!v4) v4 = sshbuf_put_string(v20, v19, v9, v19); } } } if (v4 || v4 || v4 || v4 || v4) { v32 = "compose"; sshfatal("sftp-client.c", "do_upload", 0x83d, 0x1, 0x1, ssh_err(v4), *(&v34)); } send_msg(a0, v20); v33 = v9; v32 = v15; v31 = v6; v30 = "Sent message SSH2_FXP_WRITE I:%u O:%llu S:%u"; sshlog("sftp-client.c", "do_upload", 0x83f, 0x0, 0x7, 0x0, *(&v34)); } else { if (!v21) break; } if (!v18) { v33 = v6; v32 = "Unexpected ACK %u"; sshfatal("sftp-client.c", "do_upload", 0x845, 0x0, 0x1, 0x0, *(&v34)); } if (!v9 || v6 == v11 || v6 - v8 >= a0[4]) { sshbuf_reset(v20); get_msg(a0, v20); v4 = sshbuf_get_u8(v20, &v2, &v2); if (!v4) v4 = sshbuf_get_u32(v20, &v25, &v25); if (v4 || v4) { v32 = "parse"; sshfatal("sftp-client.c", "do_upload", 0x84f, 0x1, 0x1, ssh_err(v4), *(&v34)); } if (v2 != 101) { v32 = v2; v31 = 101; v30 = "Expected SSH2_FXP_STATUS(%d) packet, got %d"; sshfatal("sftp-client.c", "do_upload", 0x852, 0x0, 0x1, 0x0, *(&v34)); } v4 = sshbuf_get_u32(v20, &v3, &v3); if (v4) { v32 = "parse status"; sshfatal("sftp-client.c", "do_upload", 0x856, 0x1, 0x1, ssh_err(v4), *(&v34)); } v33 = v3; v32 = "SSH2_FXP_STATUS %u"; sshlog("sftp-client.c", "do_upload", 0x857, 0x0, 0x7, 0x0, *(&v34)); v18 = request_find(&v21, *(&v25)); if (!v18) { v33 = *(&v25); v32 = "Can't find request for ID %u"; sshfatal("sftp-client.c", "do_upload", 0x85b, 0x0, 0x1, 0x0, *(&v34)); } if (v18->field_18) v18->field_18->field_20 = v18->field_20; else v22 = &v18->field_20->field_0; v18->field_20->field_0 = v18->field_18; v33 = v18->field_10; v32 = v18->field_8; v31 = *(v18); v30 = "In write loop, ack for %u %zu bytes at %lld"; sshlog("sftp-client.c", "do_upload", 0x85d, 0x0, 0x7, 0x0, *(&v34)); v8 += 1; v12 = v18->field_8 + v12; if (!v7 && v17 >= v18->field_10) v17 = v18->field_8 + v18->field_10; if ((v17 < v18->field_10 || v7) && !v7 && v17 < v18->field_10) { v32 = "server reordered ACKs"; sshlog("sftp-client.c", "do_upload", 0x864, 0x1, 0x7, 0x0, *(&v34)); v7 = 1; } free(v18); } v15 = __addvdi3(v15, v9); if (!((v15 - 0 >> 63))) continue; v32 = "offset < 0"; sshfatal("sftp-client.c", "do_upload", 0x86b, 0x1, 0x1, 0x0, *(&v34)); break; } sshbuf_free(v20); if (showprogress) stop_progress_meter(); free(v19); if (v3) { v32 = fx2txt(v3); v31 = a2; v30 = "write remote \"%s\": %s"; sshlog("sftp-client.c", "do_upload", 0x874, 0x0, 0x2, 0x0, *(&v34)); v3 = 4; } if (v35 || a4 && interrupted || a4 && v3) { v33 = v17; v32 = "truncating at %llu"; sshlog("sftp-client.c", "do_upload", 0x879, 0x0, 0x5, 0x0, *(&v34)); attrib_clear(&v25); v25 = 1; v26 = v17; do_fsetstat(a0, *(&v13), *(&v14), &v25); } if (close(v10) == -1) { v32 = strerror(*(__errno_location())); v31 = a1; v30 = "close local \"%s\": %s"; sshlog("sftp-client.c", "do_upload", 0x881, 0x0, 0x2, 0x0, *(&v34)); v3 = 4; } if (a3) do_fsetstat(a0, *(&v13), *(&v14), &v23); if (a5) do_fsync(a0, *(&v13), *(&v14)); v36 = do_close(a0, *(&v13), *(&v14)); if (v36) v3 = 4; free(*(&v13)); if (!v3) v36 = 0; else v36 = -1; } } } } return v36; }
static int ipstats_comp_enabled(const void *a, const void *b) { const struct ipstats_stat_enabled_one *en_a = a; const struct ipstats_stat_enabled_one *en_b = b; if (en_a->desc < en_b->desc) return -1; if (en_a->desc > en_b->desc) return 1; return 0; }
long long ipstats_comp_enabled(unsigned long long *a0, unsigned long long *a1) { unsigned long long v1; if (*(a0) < *(a1)) { v1 = 4294967295; } else if (*(a0) > *(a1)) { v1 = 1; } else { v1 = 0; } return v1; }
int main (int argc, char **argv) { _Bool ok; int optc; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdout); append = 0 ; ignore_interrupts = 0 ; while ((optc = getopt_long (argc, argv, "aip", long_options, ((void *)0) )) != -1) { switch (optc) { case 'a': append = 1 ; break; case 'i': ignore_interrupts = 1 ; break; case 'p': if (optarg) output_error = ((output_error_types) [__xargmatch_internal ("--output-error", optarg, output_error_args, (void const *) (output_error_types), sizeof *(output_error_types), argmatch_die, 1 )]) ; else output_error = output_error_warn_nopipe; break; case GETOPT_HELP_CHAR: usage ( 0 ); break;; case GETOPT_VERSION_CHAR: version_etc ( stdout , "tee", "GNU coreutils", Version, ("Mike Parker"), ("Richard M. Stallman"), ("David MacKenzie"), (char *) ((void *)0) ); exit ( 0 ); break;; default: usage ( 1 ); } } if (ignore_interrupts) signal ( 2 , ((__sighandler_t) 1) ); if (output_error != output_error_sigpipe) signal ( 13 , ((__sighandler_t) 1) ); ok = tee_files (argc - optind, &argv[optind]); if (close ( 0 ) != 0) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", gettext (\"standard input\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", gettext ("standard input")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", gettext ("standard input")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); return ok ? 0 : 1 ; }
byte main(int param_1,undefined8 *param_2) { byte bVar1; int iVar2; long lVar3; int *piVar4; undefined8 uVar5; set_program_name(*param_2); setlocale(6,""); bindtextdomain("coreutils","/usr/local/share/locale"); textdomain("coreutils"); atexit(p_Ram00000000001003ff); append = 0; ignore_interrupts = '\0'; LAB_00100557: while( true ) { uVar5 = 0x100579; iVar2 = getopt_long(param_1,param_2,&DAT_0010126b,long_options,0); if (iVar2 == -1) { if (ignore_interrupts != '\0') { signal(2,(__sighandler_t)0x1); } if (output_error != 0) { signal(0xd,(__sighandler_t)0x1); } bVar1 = tee_files(param_1 - optind,param_2 + optind); iVar2 = close(0); if (iVar2 != 0) { uVar5 = gettext("standard input"); piVar4 = __errno_location(); error(1,*piVar4,&DAT_0010127e,uVar5); } return bVar1 ^ 1; } if (iVar2 != 0x70) break; if (optarg == 0) { output_error = 2; } else { lVar3 = __xargmatch_internal ("--output-error",optarg,output_error_args,output_error_types,4,argmatch_die ,1,uVar5); output_error = *(int *)(output_error_types + lVar3 * 4); } } if (iVar2 < 0x71) { if (iVar2 == 0x69) { ignore_interrupts = '\x01'; goto LAB_00100557; } if (0x69 < iVar2) goto LAB_0010054d; if (iVar2 == 0x61) { append = 1; goto LAB_00100557; } if (iVar2 < 0x62) { if (iVar2 == -0x83) { LAB_001004fb: version_etc(stdout,&DAT_00101210,"GNU coreutils",Version,"Mike Parker","Richard M. Stallman" ,"David MacKenzie",0); exit(0); } if (iVar2 == -0x82) { usage(0); goto LAB_001004fb; } } } LAB_0010054d: usage(); goto LAB_00100557; }
int crypto_sign_ed25519_ref_isneutral_vartime(const crypto_sign_ed25519_ref_ge25519 *p) { int ret = 1; if(!crypto_sign_ed25519_ref_fe25519_iszero(&p->x)) ret = 0; if(!crypto_sign_ed25519_ref_fe25519_iseq_vartime(&p->y, &p->z)) ret = 0; return ret; }
long long crypto_sign_ed25519_ref_isneutral_vartime(unsigned long long a0) { unsigned int v0; v0 = 1; if (!crypto_sign_ed25519_ref_fe25519_iszero(a0)) v0 = 0; if (!crypto_sign_ed25519_ref_fe25519_iseq_vartime(a0 - -128, a0 + 0x100, a0 + 0x100)) { v0 = 0; return v0; } return v0; }
static void proc_footer (void) { current_type = footer_type; current_regex = &footer_regex; reset_lineno (); putchar_unlocked ('\n'); }
void proc_footer(void) { current_type = footer_type; current_regex = footer_regex; reset_lineno(); putchar_unlocked(10); return; }
errcode_t ea_refcount_increment(ext2_refcount_t refcount, ea_key_t ea_key, ea_value_t *ret) { struct ea_refcount_el *el; el = get_refcount_el(refcount, ea_key, 1); if (!el) return (2133571398L); el->ea_value++; if (ret) *ret = el->ea_value; return 0; }
undefined8 ea_refcount_increment(undefined8 param_1,undefined8 param_2,undefined8 *param_3) { long lVar1; undefined8 uVar2; lVar1 = get_refcount_el(param_1,param_2,1); if (lVar1 == 0) { uVar2 = 0x7f2bb746; } else { *(long *)(lVar1 + 8) = *(long *)(lVar1 + 8) + 1; if (param_3 != (undefined8 *)0x0) { *param_3 = *(undefined8 *)(lVar1 + 8); } uVar2 = 0; } return uVar2; }
static void syslog_sg (const char *name, const char *group) { const char *loginname = getlogin (); const char *tty = ttyname (0); char *free_login = ((void *)0) , *free_tty = ((void *)0) ; if (loginname != ((void *)0) ) { free_login = xstrdup (loginname); loginname = free_login; } if (tty != ((void *)0) ) { free_tty = xstrdup (tty); tty = free_tty; } if (loginname == ((void *)0) ) { loginname = "???"; } if (tty == ((void *)0) ) { tty = "???"; } else if (strncmp (tty, "/dev/", 5) == 0) { tty += 5; } do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 6 , "user '%s' (login '%s' on %s) switched to group '%s'", name, loginname, tty, group) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; free(free_login); free(free_tty); }
void syslog_sg(unsigned long a0, unsigned long a1) { unsigned long v0; unsigned long v1; void* v2; void* v3; void* v4; void* v5; void* v6; char *v7; unsigned long long v10; v1 = a0; v0 = a1; v2 = getlogin(); v3 = ttyname(0x0); v4 = 0; v5 = 0; if (v2) { v4 = xstrdup(v2); v2 = v4; } if (v3) { v5 = xstrdup(v3); v3 = v5; } if (!v2) v2 = "???"; if (!v3) { v3 = "???"; } else if (!strncmp(v3, "/dev/", 0x5)) { v3 += 5; } v7 = setlocale(0x6, NULL); v6 = 0; if (v7) v6 = strdup(v7); if (v6) setlocale(0x6, "C"); syslog(0x6, "user '%s' (login '%s' on %s) switched to group '%s'"); if (v6) { setlocale(0x6, v6); free(v6); } free(v4); v10 = free(v5); return; }
void coproc_init (cp) struct coproc *cp; { cp->c_name = 0; cp->c_pid = (pid_t)-1; cp->c_rfd = cp->c_wfd = -1; cp->c_rsave = cp->c_wsave = -1; cp->c_flags = cp->c_status = cp->c_lock = 0; }
void coproc_init(undefined8 *param_1) { *param_1 = 0; *(undefined4 *)(param_1 + 1) = 0xffffffff; *(undefined4 *)(param_1 + 2) = 0xffffffff; *(undefined4 *)((long)param_1 + 0xc) = *(undefined4 *)(param_1 + 2); *(undefined4 *)(param_1 + 3) = 0xffffffff; *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)(param_1 + 3); *(undefined4 *)((long)param_1 + 0x24) = 0; *(undefined4 *)(param_1 + 4) = *(undefined4 *)((long)param_1 + 0x24); *(undefined4 *)((long)param_1 + 0x1c) = *(undefined4 *)(param_1 + 4); return; }
static void display_all (struct termios *mode, char const *device_name) { int i; tcflag_t *bitsp; unsigned long mask; enum mode_type prev_type = control; display_speed (mode, 1 ); display_window_size ( 1 , device_name); wrapf ("line = %d;", mode->c_line); putchar_unlocked ('\n'); current_col = 0; for (i = 0; ! (strcmp (control_info[i].name, "min") == 0); ++i) { if ((strcmp (control_info[i].name, "flush") == 0)) continue; wrapf ("%s = %s;", control_info[i].name, visible (mode->c_cc[control_info[i].offset])); } wrapf ("min = %lu; time = %lu;", (unsigned long int) mode->c_cc[ 6 ], (unsigned long int) mode->c_cc[ 5 ]); if (current_col != 0) putchar_unlocked ('\n'); current_col = 0; for (i = 0; mode_info[i].name != ((void *)0) ; ++i) { if (mode_info[i].flags & 8) continue; if (mode_info[i].type != prev_type) { putchar_unlocked ('\n'); current_col = 0; prev_type = mode_info[i].type; } bitsp = mode_type_flag (mode_info[i].type, mode); mask = mode_info[i].mask ? mode_info[i].mask : mode_info[i].bits; ((void) sizeof (( bitsp ) ? 1 : 0), __extension__ ({ if ( bitsp ) ; else __assert_fail ( "bitsp" , "src/stty.c", 2037, __extension__ __PRETTY_FUNCTION__); })) ; if ((*bitsp & mask) == mode_info[i].bits) wrapf ("%s", mode_info[i].name); else if (mode_info[i].flags & 4) wrapf ("-%s", mode_info[i].name); } putchar_unlocked ('\n'); current_col = 0; }
void display_all(long param_1,undefined8 param_2) { int iVar1; undefined8 uVar2; uint *puVar3; ulong uVar4; int local_20; int local_1c; local_1c = 0; display_speed(param_1,1); display_window_size(1,param_2); wrapf("line = %d;",*(undefined *)(param_1 + 0x10)); putchar_unlocked(10); current_col = 0; local_20 = 0; while( true ) { iVar1 = strcmp(*(char **)(control_info + (long)local_20 * 0x18),"min"); if (iVar1 == 0) break; iVar1 = strcmp(*(char **)(control_info + (long)local_20 * 0x18),"flush"); if (iVar1 != 0) { uVar2 = visible(*(undefined *) (param_1 + 0x11 + *(long *)(control_info + (long)local_20 * 0x18 + 0x10))); wrapf("%s = %s;",*(undefined8 *)(control_info + (long)local_20 * 0x18),uVar2); } local_20 = local_20 + 1; } wrapf("min = %lu; time = %lu;",*(undefined *)(param_1 + 0x17),*(undefined *)(param_1 + 0x16)); if (current_col != 0) { putchar_unlocked(10); } current_col = 0; local_20 = 0; do { if (*(long *)(mode_info + (long)local_20 * 0x20) == 0) { putchar_unlocked(10); current_col = 0; return; } if ((mode_info[(long)local_20 * 0x20 + 0xc] & 8) == 0) { if (local_1c != *(int *)(mode_info + (long)local_20 * 0x20 + 8)) { putchar_unlocked(10); current_col = 0; local_1c = *(int *)(mode_info + (long)local_20 * 0x20 + 8); } puVar3 = (uint *)mode_type_flag(*(undefined4 *)(mode_info + (long)local_20 * 0x20 + 8),param_1 ); if (*(long *)(mode_info + (long)local_20 * 0x20 + 0x18) == 0) { uVar4 = *(ulong *)(mode_info + (long)local_20 * 0x20 + 0x10); } else { uVar4 = *(ulong *)(mode_info + (long)local_20 * 0x20 + 0x18); } if (puVar3 == (uint *)0x0) { __assert_fail("bitsp","src/stty.c",0x7f5,"display_all"); } if ((*puVar3 & uVar4) == *(ulong *)(mode_info + (long)local_20 * 0x20 + 0x10)) { wrapf(&DAT_0010620d,*(undefined8 *)(mode_info + (long)local_20 * 0x20)); } else if ((mode_info[(long)local_20 * 0x20 + 0xc] & 4) != 0) { wrapf(&DAT_0010630d,*(undefined8 *)(mode_info + (long)local_20 * 0x20)); } } local_20 = local_20 + 1; } while( true ); }
char * host_hash(const char *host, const char *name_from_hostfile, u_int src_len) { struct ssh_hmac_ctx *ctx; u_char salt[256], result[256]; char uu_salt[512], uu_result[512]; char *encoded = ((void *)0) ; u_int len; len = ssh_digest_bytes(1); if (name_from_hostfile == ((void *)0) ) { arc4random_buf(salt, len); } else { if (extract_salt(name_from_hostfile, src_len, salt, sizeof(salt)) == -1) return ( ((void *)0) ); } if ((ctx = ssh_hmac_start(1)) == ((void *)0) || ssh_hmac_init(ctx, salt, len) < 0 || ssh_hmac_update(ctx, host, strlen(host)) < 0 || ssh_hmac_final(ctx, result, sizeof(result))) sshfatal("hostfile.c", __func__, 140, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "ssh_hmac failed"); ssh_hmac_free(ctx); if ( __b64_ntop (salt,len,uu_salt,sizeof(uu_salt)) == -1 || __b64_ntop (result,len,uu_result,sizeof(uu_result)) == -1) sshfatal("hostfile.c", __func__, 145, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "__b64_ntop failed"); xasprintf(&encoded, "%s%s%c%s", "|1|", uu_salt, '|', uu_result); return (encoded); }
int host_hash(char *a0, unsigned long long a1, unsigned long a2) { unsigned long long v0; unsigned int v1; void* v2; unsigned long long v3; char v4; char v5; char v6; char v7; unsigned long long v8; unsigned int v10; v2 = 0; v1 = ssh_digest_bytes(0x1); if (!a1) { arc4random_buf(&v4, v1, v1); } else if (extract_salt(a1, a2, &v4, 0x100) == -1) { v10 = 0; goto LABEL_4004f8; } v3 = ssh_hmac_start(0x1); if (v3 && ssh_hmac_init(v3, &v4, v1, &v4) >= 0 && ssh_hmac_update(v3, a0, strlen(a0), a0) >= 0 && !ssh_hmac_final(v3, &v5, 0x100, &v5)) goto LABEL_400420; v0 = "ssh_hmac failed"; sshfatal("hostfile.c", "host_hash", 0x8c, 0x1, 0x1, 0x0); LABEL_400420: ssh_hmac_free(v3); if (__b64_ntop(&v4, v1, &v6, 0x200) != -1 && !(__b64_ntop(&v5, v1, &v7, 0x200) == -1)) goto LABEL_4004b5; v8 = "__b64_ntop failed"; sshfatal("hostfile.c", "host_hash", 0x91, 0x1, 0x1, 0x0); LABEL_4004b5: xasprintf(&v2, "%s%s%c%s", "|1|", &v6, 0x7c, &v7); v10 = v2; LABEL_4004f8: return v10; }
void e2fsck_pass1_dupblocks(e2fsck_t ctx, char *block_buf) { ext2_filsys fs = ctx->fs; struct problem_context pctx; struct resource_track rtrack; clear_problem_context(&pctx); pctx.errcode = e2fsck_allocate_inode_bitmap(fs, (gettext ("multiply claimed inode map")), 2, "inode_dup_map", &inode_dup_map); if (pctx.errcode) { fix_problem(ctx, 0x011005, &pctx); ctx->flags |= 0x0001; return; } dict_init(&ino_dict, (0x7fffffffffffffffL * 2UL + 1UL) , dict_int_cmp); dict_init(&clstr_dict, (0x7fffffffffffffffL * 2UL + 1UL) , dict_int_cmp); dict_set_allocator(&ino_dict, ((void *)0) , inode_dnode_free, ((void *)0) ); dict_set_allocator(&clstr_dict, ((void *)0) , cluster_dnode_free, ((void *)0) ); init_resource_track(&rtrack, ctx->fs->io); pass1b(ctx, block_buf); print_resource_track(ctx, "Pass 1b", &rtrack, ctx->fs->io); init_resource_track(&rtrack, ctx->fs->io); pass1c(ctx, block_buf); print_resource_track(ctx, "Pass 1c", &rtrack, ctx->fs->io); init_resource_track(&rtrack, ctx->fs->io); pass1d(ctx, block_buf); print_resource_track(ctx, "Pass 1d", &rtrack, ctx->fs->io); if (ext2fs_has_feature_shared_blocks(ctx->fs->super) && (ctx->options & 0x40000)) { blk64_t next; int result = ext2fs_find_first_set_block_bitmap2( ctx->block_dup_map, ctx->fs->super->s_first_data_block, ext2fs_blocks_count(ctx->fs->super) - 1, &next); if (result == 2 && !(ctx->options & 0x0008)) { ext2fs_clear_feature_shared_blocks(ctx->fs->super); ext2fs_mark_super_dirty(ctx->fs); } } dict_free_nodes(&ino_dict); dict_free_nodes(&clstr_dict); ext2fs_free_inode_bitmap(inode_dup_map); }
long long e2fsck_pass1_dupblocks(struct_0 *a0, unsigned long long a1) { unsigned int v0; char v1; unsigned long long v2[5]; char v3; char v4; v2[0] = a0->field_0; clear_problem_context(&v4); v4 = e2fsck_allocate_inode_bitmap(v2, gettext("multiply claimed inode map"), 0x2, "inode_dup_map", &inode_dup_map); if (v4) { fix_problem(a0, 0x11005, &v4); a0->field_48 = a0->field_48 | 1; return 0; } dict_init(&ino_dict, 0xffffffffffffffff, dict_int_cmp); dict_init(&clstr_dict, 0xffffffffffffffff, dict_int_cmp); dict_set_allocator(&ino_dict, 0x0, inode_dnode_free, 0x0); dict_set_allocator(&clstr_dict, 0x0, cluster_dnode_free, 0x0); init_resource_track(&v3, a0->field_0->field_8, a0->field_0->field_8); pass1b(a0, a1); print_resource_track(a0, "Pass 1b", &v3, a0->field_0->field_8); init_resource_track(&v3, a0->field_0->field_8, a0->field_0->field_8); pass1c(a0, a1); print_resource_track(a0, "Pass 1c", &v3, a0->field_0->field_8); init_resource_track(&v3, a0->field_0->field_8, a0->field_0->field_8); pass1d(a0, a1); print_resource_track(a0, "Pass 1d", &v3, a0->field_0->field_8); if (ext2fs_has_feature_shared_blocks(a0->field_0->field_20) && (a0->field_4c & 0x40000)) { v0 = ext2fs_find_first_set_block_bitmap2(a0->field_1a8, a0->field_0->field_20->field_14, ext2fs_blocks_count(a0->field_0->field_20) - 1, &v1); if (v0 == 2 && !(a0->field_4c & 8)) { ext2fs_clear_feature_shared_blocks(a0->field_0->field_20); ext2fs_mark_super_dirty(a0->field_0); } } dict_free_nodes(&ino_dict); dict_free_nodes(&clstr_dict); ext2fs_free_inode_bitmap(inode_dup_map); return 0; }
static void xsplit (mp, nu) union mhead *mp; int nu; { union mhead *nh; int nbuck, nblks, split_max; unsigned long siz; nbuck = nu - 1; while (nbuck >= 1 && busy[nbuck]) nbuck--; if (nbuck < 1) return; siz = binsizes[(nu)]; nblks = siz / binsizes[(nbuck)]; siz = binsizes[(nbuck)]; nh = mp; while (1) { mp->minfo.mi_alloc = ((char) 0x54); mp->minfo.mi_index = nbuck; if (--nblks <= 0) break; (*(union mhead **) (sizeof (char *) + (char *) (mp))) = (union mhead *)((char *)mp + siz); mp = (union mhead *)((char *)mp + siz); } busy[nbuck] = 1; (*(union mhead **) (sizeof (char *) + (char *) (mp))) = nextf[nbuck]; nextf[nbuck] = nh; busy[nbuck] = 0; }
void xsplit(unsigned long a0, unsigned long a1) { struct_1 *v0; unsigned int v1; unsigned int v2; unsigned long v3; struct_1 *v4; unsigned long long v6; unsigned long long v7; unsigned long long v8[525365]; v0 = a0; v6 = a1 - 1; for (v1 = a1 - 1; v1 > 0; v1 -= 1) { v7 = *(v1 + &busy); if (!*(v1 + &busy)) break; } if (v1 > 0) { v3 = *((4202912 + 8 * a1)); v2 = (0 CONCAT v3) /m *((4202912 + 8 * v1)); v3 = *((4202912 + 8 * v1)); v4 = v0; while (true) { v0->field_0 = 84; v0->field_1 = v1; v2 -= 1; if (v2 <= 0) break; v0->field_8 = &(&v0->field_0)[v3]; v0 = &(&v0->field_0)[v3]; } *(v1 + &busy) = 1; v0->field_8 = (&nextf)[v1]; (&nextf)[v1] = v4; v8 = v1; *(v1 + &busy) = 0; } return; }
static int history_def_prev(void *p, HistEvent *ev) { history_t *h = (history_t *) p; if (h->cursor == &h->list) { { ev->num = (h->cur > 0) ? 6 : 5; ev->str = he_errlist[(h->cur > 0) ? 6 : 5]; } ; return -1; } if (h->cursor->prev == &h->list) { { ev->num = 7; ev->str = he_errlist[7]; }; return -1; } h->cursor = h->cursor->prev; *ev = h->cursor->ev; return 0; }
undefined8 history_def_prev(long param_1,undefined8 *param_2) { int iVar1; undefined8 uVar2; undefined4 uVar3; if (*(long *)(param_1 + 0x28) == param_1) { if (*(int *)(param_1 + 0x34) < 1) { uVar3 = 5; } else { uVar3 = 6; } *(undefined4 *)param_2 = uVar3; if (*(int *)(param_1 + 0x34) < 1) { iVar1 = 5; } else { iVar1 = 6; } param_2[1] = *(undefined8 *)(he_errlist + (long)iVar1 * 8); uVar2 = 0xffffffff; } else if (*(long *)(*(long *)(param_1 + 0x28) + 0x20) == param_1) { *(undefined4 *)param_2 = 7; param_2[1] = "no previous event"; uVar2 = 0xffffffff; } else { *(undefined8 *)(param_1 + 0x28) = *(undefined8 *)(*(long *)(param_1 + 0x28) + 0x20); uVar2 = (*(undefined8 **)(param_1 + 0x28))[1]; *param_2 = **(undefined8 **)(param_1 + 0x28); param_2[1] = uVar2; uVar2 = 0; } return uVar2; }
static COMMAND * make_until_or_while (which, test, action) enum command_type which; COMMAND *test, *action; { WHILE_COM *temp; temp = (WHILE_COM *)sh_xmalloc((sizeof (WHILE_COM)), "make_cmd.c", 405); temp->flags = 0; temp->test = test; temp->action = action; return (make_command (which, (SIMPLE_COM *)temp)); }
void make_until_or_while(unsigned long a0, unsigned long a1, unsigned long a2) { struct_0 *v0; unsigned long long v2; v0 = sh_xmalloc(0x18, "make_cmd.c", 0x195); v0->field_0 = 0; v0->field_8 = a1; v0->field_10 = a2; v2 = make_command(a0, v0); return; }
char * expand_and_quote_kvpair_word (w) char *w; { char *r, *s, *t; t = w ? expand_subscript_string (w, 0) : 0; s = (t && strchr (t, '\001')) ? quote_escapes (t) : t; r = sh_single_quote (s ? s : ""); if (s != t) sh_xfree((s), "arrayfunc.c", 684); sh_xfree((t), "arrayfunc.c", 685); return r; }
long long expand_and_quote_kvpair_word(unsigned long long a0) { void* v0; void* v1; unsigned long v2; void* v4; unsigned long long v5; void* v6; unsigned long long v7; if (a0) v4 = expand_subscript_string(a0, 0x0); else v4 = 0; v0 = v4; if (v0) { v5 = strchr(v0, 0x1); if (v5) v6 = quote_escapes(v0); } if (!v5 || !v0) v6 = v0; v1 = v6; if (v1) v7 = v1; else v7 = &g_403ab5; v2 = sh_single_quote(v7); if (v1 != v0) sh_xfree(v1, "arrayfunc.c", 0x2ac); sh_xfree(v0, "arrayfunc.c", 0x2ad); return v2; }
static void lines_chunk_split (uintmax_t k, uintmax_t n, char *buf, size_t bufsize, size_t initial_read, off_t file_size) { ((void) sizeof (( n && k <= n && n <= file_size ) ? 1 : 0), __extension__ ({ if ( n && k <= n && n <= file_size ) ; else __assert_fail ( "n && k <= n && n <= file_size" , "src/split.c", 867, __extension__ __PRETTY_FUNCTION__); })) ; const off_t chunk_size = file_size / n; uintmax_t chunk_no = 1; off_t chunk_end = chunk_size - 1; off_t n_written = 0; _Bool new_file_flag = 1 ; _Bool chunk_truncated = 0 ; if (k > 1) { off_t start = (k - 1) * chunk_size - 1; if (start < initial_read) { memmove (buf, buf + start, initial_read - start); initial_read -= start; } else { if (lseek ( 0 , start - initial_read, 1 ) < 0) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); initial_read = (18446744073709551615UL) ; } n_written = start; chunk_no = k - 1; chunk_end = chunk_no * chunk_size - 1; } while (n_written < file_size) { char *bp = buf, *eob; size_t n_read; if (initial_read != (18446744073709551615UL) ) { n_read = initial_read; initial_read = (18446744073709551615UL) ; } else { n_read = safe_read ( 0 , buf, bufsize); if (n_read == ((size_t) -1)) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); } if (n_read == 0) break; n_read = ((( n_read )<( file_size - n_written ))?( n_read ):( file_size - n_written )) ; chunk_truncated = 0 ; eob = buf + n_read; while (bp != eob) { size_t to_write; _Bool next = 0 ; off_t skip = ((( n_read )<(((( 0 )>( chunk_end - n_written ))?( 0 ):( chunk_end - n_written ))))?( n_read ):(((( 0 )>( chunk_end - n_written ))?( 0 ):( chunk_end - n_written )))) ; char *bp_out = memchr (bp + skip, eolchar, n_read - skip); if (bp_out) { bp_out++; next = 1 ; } else bp_out = eob; to_write = bp_out - bp; if (k == chunk_no) { if (full_write ( 1 , bp, to_write) != to_write) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", gettext (\"write error\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", gettext ("write error")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", gettext ("write error")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); } else if (! k) cwrite (new_file_flag, bp, to_write); n_written += to_write; bp += to_write; n_read -= to_write; new_file_flag = next; while (next || chunk_end <= n_written - 1) { if (!next && bp == eob) { chunk_truncated = 1 ; break; } chunk_no++; if (k && chunk_no > k) return; if (chunk_no == n) chunk_end = file_size - 1; else chunk_end += chunk_size; if (chunk_end <= n_written - 1) { if (! k) cwrite ( 1 , ((void *)0) , 0); } else next = 0 ; } } } if (chunk_truncated) chunk_no++; while (!k && chunk_no++ <= n) cwrite ( 1 , ((void *)0) , 0); }
void lines_chunk_split(unsigned long a0, unsigned long a1, void* a2, unsigned long long a3, unsigned long long a4, unsigned long a5) { unsigned long long v0; char v1; char v2; char v3; unsigned long long v4; unsigned long v5; void* v6; unsigned long long v7; unsigned long long v8; unsigned long v9; unsigned long v10; unsigned long long v11; unsigned long v12; void* v13; unsigned long long v14; unsigned long long v16; void* v17; unsigned long long v18; unsigned long long v20; void* v21; unsigned long long v22; unsigned long long v23; unsigned long long v24; unsigned long long v25; unsigned long long v26; v0 = a4; if (a1 && a0 <= a1 && a1 <= a5) { v10 = (0 CONCAT a5) /m a1; v4 = 1; v5 = v10 - 1; v6 = 0; v1 = 1; v2 = 0; if (a0 > 1) { v11 = (a0 - 1) * v10 - 1; if (v0 > v11) { memmove(a2, v11 + a2, v0 - v11); v0 -= v11; } else if (lseek(0x0, v11 - v0, 0x1) >= 0) { v0 = -1; } else { v16 = quotearg_n_style_colon(0x0, 0x3, *(&infile)); error(0x1, *(__errno_location()), "%s"); } v6 = v11; v4 = a0 - 1; v5 = v4 * v10 - 1; } while (true) { v17 = v6; if (v6 >= a5) break; v7 = a2; if (v0 != -1) { v18 = v0; v8 = v0; v0 = -1; } else { *(&v8) = safe_read(0x0, a2, a3, a3); if (v8 == -1) { v23 = quotearg_n_style_colon(0x0, 0x3, *(&infile)); error(0x1, *(__errno_location()), "%s"); } } if (!v8) break; v20 = a5 - v6; if (v8 <= a5 - v6) v20 = v8; v8 = v20; v2 = 0; v12 = v8 + a2; while (v7 != v12) { v3 = 0; v21 = v5 - v6; if (v5 - v6 < 0) v21 = 0; if (v8 <= v21) v21 = v8; v13 = v21; v9 = memchr(v7 + v13, eolchar, v8 - v13); if (!v9) { v9 = v12; } else { v9 += 1; v3 = 1; } v14 = v9 - v7; if (a0 != v4) { if (!a0) cwrite(v1, v7, v14); } else { if (v14 != full_write(0x1, v7, v14, a3)) { v24 = gettext("write error"); error(0x1, *(__errno_location()), "%s"); } } v6 = v14 + v6; v7 += v14; v8 -= v14; v1 = v3; while (true) { if (!v3 && v6 <= v5) break; if (!(v3 ^ 1) || v7 != v12) { v4 += 1; if (a0) { v22 = v4; if (v4 > a0) return; } if (v4 == a1) v5 = a5 - 1; else v5 += v10; if (v6 <= v5) { v3 = 0; } else if (!a0) { cwrite(0x1, 0x0, 0x0); } } else { v2 = 1; break; } } } } if (v2) v4 += 1; while (!a0) { v25 = v4; v4 += 1; if (a1 < v25) return; v26 = cwrite(0x1, 0x0, 0x0); } return; } __assert_fail(); }
STRINGLIST * strlist_from_word_list (list, alloc, starting_index, ip) WORD_LIST *list; int alloc, starting_index, *ip; { STRINGLIST *ret; int slen, len; if (list == 0) { if (ip) *ip = 0; return ((STRINGLIST *)0); } slen = list_length (list); ret = (STRINGLIST *)sh_xmalloc((sizeof (STRINGLIST)), "stringlist.c", 276); ret->list = strvec_from_word_list (list, alloc, starting_index, &len); ret->list_size = slen + starting_index; ret->list_len = len; if (ip) *ip = len; return ret; }
long long strlist_from_word_list(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned int *a3) { char v0; unsigned int v1; void* v2; void* v4; if (a0) { v1 = list_length(a0); v2 = sh_xmalloc(0x10, "stringlist.c", 0x114); *(v2) = strvec_from_word_list(a0, a1, a2, &v0); *(&v2[8]) = v1 + a2; *(&v2[12]) = *(&v0); if (a3) *(a3) = *(&v0); v4 = v2; } else { if (a3) *(a3) = 0; v4 = 0; } return v4; }
static block_state deflate_huff(s, flush) deflate_state *s; int flush; { int bflush; for (;;) { if (s->lookahead == 0) { fill_window(s); if (s->lookahead == 0) { if (flush == 0) return need_more; break; } } s->match_length = 0; ; { uch cc = (s->window[s->strstart]); s->sym_buf[s->sym_next++] = 0; s->sym_buf[s->sym_next++] = 0; s->sym_buf[s->sym_next++] = cc; s->dyn_ltree[cc].fc.freq++; bflush = (s->sym_next == s->sym_end); }; s->lookahead--; s->strstart++; if (bflush) { { _tr_flush_block(s, (s->block_start >= 0L ? (charf *)&s->window[(unsigned)s->block_start] : (charf *)0), (ulg)((long)s->strstart - s->block_start), (0)); s->block_start = s->strstart; flush_pending(s->strm); ; }; if (s->strm->avail_out == 0) return (0) ? finish_started : need_more; }; } s->insert = 0; if (flush == 4) { { { _tr_flush_block(s, (s->block_start >= 0L ? (charf *)&s->window[(unsigned)s->block_start] : (charf *)0), (ulg)((long)s->strstart - s->block_start), (1)); s->block_start = s->strstart; flush_pending(s->strm); ; }; if (s->strm->avail_out == 0) return (1) ? finish_started : need_more; }; return finish_done; } if (s->sym_next) { { _tr_flush_block(s, (s->block_start >= 0L ? (charf *)&s->window[(unsigned)s->block_start] : (charf *)0), (ulg)((long)s->strstart - s->block_start), (0)); s->block_start = s->strstart; flush_pending(s->strm); ; }; if (s->strm->avail_out == 0) return (0) ? finish_started : need_more; }; return block_done; }
long deflate_huff(long a1, int a2) { long v3; unsigned int v4; long v5; unsigned int v6; long v7; unsigned int v8; long v9; long v10; long v11; unsigned char v13; _BOOL4 v14; while ( 1 ) { if ( !*(_DWORD *)(a1 + 180) ) { fill_window(a1); if ( !*(_DWORD *)(a1 + 180) ) break; } *(_DWORD *)(a1 + 160) = 0; v13 = *(_BYTE *)(*(_QWORD *)(a1 + 96) + *(unsigned int *)(a1 + 172)); v3 = *(_QWORD *)(a1 + 5888); v4 = *(_DWORD *)(a1 + 5900); *(_DWORD *)(a1 + 5900) = v4 + 1; *(_BYTE *)(v3 + v4) = 0; v5 = *(_QWORD *)(a1 + 5888); v6 = *(_DWORD *)(a1 + 5900); *(_DWORD *)(a1 + 5900) = v6 + 1; *(_BYTE *)(v5 + v6) = 0; v7 = *(_QWORD *)(a1 + 5888); v8 = *(_DWORD *)(a1 + 5900); *(_DWORD *)(a1 + 5900) = v8 + 1; *(_BYTE *)(v7 + v8) = v13; ++*(_WORD *)(a1 + 4 * (v13 + 52LL) + 4); v14 = *(_DWORD *)(a1 + 5900) == *(_DWORD *)(a1 + 5904); --*(_DWORD *)(a1 + 180); ++*(_DWORD *)(a1 + 172); if ( v14 ) { v9 = *(long *)(a1 + 152) < 0 ? 0LL : *(_QWORD *)(a1 + 96) + (unsigned int)*(_QWORD *)(a1 + 152); tr_flush_block(a1, v9, *(unsigned int *)(a1 + 172) - *(_QWORD *)(a1 + 152), 0LL); *(_QWORD *)(a1 + 152) = *(unsigned int *)(a1 + 172); flush_pending(*(_QWORD *)a1); if ( !*(_DWORD *)(*(_QWORD *)a1 + 32LL) ) return 0LL; } } if ( !a2 ) return 0LL; *(_DWORD *)(a1 + 5932) = 0; if ( a2 != 4 ) return !*(_DWORD *)(a1 + 5900) || (*(long *)(a1 + 152) < 0 ? (v11 = 0LL) : (v11 = *(_QWORD *)(a1 + 96) + (unsigned int)*(_QWORD *)(a1 + 152)), tr_flush_block(a1, v11, *(unsigned int *)(a1 + 172) - *(_QWORD *)(a1 + 152), 0LL), *(_QWORD *)(a1 + 152) = *(unsigned int *)(a1 + 172), flush_pending(*(_QWORD *)a1), *(_DWORD *)(*(_QWORD *)a1 + 32LL)); if ( *(long *)(a1 + 152) < 0 ) v10 = 0LL; else v10 = *(_QWORD *)(a1 + 96) + (unsigned int)*(_QWORD *)(a1 + 152); tr_flush_block(a1, v10, *(unsigned int *)(a1 + 172) - *(_QWORD *)(a1 + 152), 1LL); *(_QWORD *)(a1 + 152) = *(unsigned int *)(a1 + 172); flush_pending(*(_QWORD *)a1); if ( *(_DWORD *)(*(_QWORD *)a1 + 32LL) ) return 3LL; else return 2LL; }
int sshkey_putb_plain(const struct sshkey *key, struct sshbuf *b) { return to_blob_buf(key, b, 1, SSHKEY_SERIALIZE_DEFAULT); }
long sshkey_putb_plain(long a1, long a2) { return to_blob_buf(a1, a2, 1); }
size_t strlcat(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; size_t dlen; ; ; while (n-- != 0 && *d != '\0') d++; dlen = d - dst; n = siz - dlen; if (n == 0) return(dlen + strlen(s)); while (*s != '\0') { if (n != 1) { *d++ = *s; n--; } s++; } *d = '\0'; return(dlen + (s - src)); }
long long strlcat(unsigned long long a0, char *a1, unsigned long a2) { char *v0; char *v1; unsigned long v2; unsigned long v3; unsigned long long v5; char *v6; unsigned long long v7; v0 = a0; v1 = a1; v2 = a2; while (true) { v5 = v2; v2 -= 1; if (!v5) break; if (!*(v0)) break; v0 += 1; } v3 = &v0[-1 * a0]; if (!v2) { v7 = strlen(v1) + v3; } else { for (v2 = a2 - v3; *(v1); v1 += 1) { if (v2 != 1) { v6 = v0; v0 += 1; *(v6) = *(v1); v2 -= 1; } } *(v0) = 0; v7 = v3 + v1 - a1; } return v7; }
static void group_busy (gid_t gid) { struct passwd *pwd; prefix_setpwent (); while ( ((pwd = prefix_getpwent ()) != ((void *)0) ) && (pwd->pw_gid != gid) ); prefix_endpwent (); if (pwd == (struct passwd *) 0) { return; } fprintf ( stderr , gettext ("%s: cannot remove the primary group of user '%s'\n"), Prog, pwd->pw_name); exit (8); }
long long group_busy(unsigned long a0) { struct_0 *v0; prefix_setpwent(); do { v0 = prefix_getpwent(); if (!v0) break; } while (a0 != v0->field_14); if (v0) { fprintf(stderr, gettext("%s: cannot remove the primary group of user '%s'\n")); exit(0x8); } return prefix_endpwent(); }
static int decode_signum(const char *string) { int signo = -1; if (is_number(string)) { signo = atoi(string); if (signo >= (64 + 1) ) signo = -1; } return signo; }
long decode_signum(const char *a1) { int v2; v2 = -1; if ( (unsigned int)is_number(a1) ) { v2 = atoi(a1); if ( v2 > 64 ) return (unsigned int)-1; } return (unsigned int)v2; }