input
stringlengths
28
169k
output
stringlengths
20
317k
static inline __u8 rta_getattr_u8(const struct rtattr *rta) { return *(__u8 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); }
int rta_getattr_u8(struct_0 *a0) { return a0->field_4; }
void bitmap_clear_bit(struct bitmap *b, u_int n) { size_t offset; if (b->top >= b->len || n > (1<<24)) return; offset = n / (sizeof(u_int) * 8); if (offset > b->top) return; b->d[offset] &= ~((u_int)1 << (n & ((u_int)(sizeof(u_int) * 8) - 1))); retop(b); }
long long bitmap_clear_bit(unsigned long long a0[3], unsigned long a1) { unsigned long long v0; unsigned long long v2; v2 = a0[1]; if (a0[2] < a0[1] && a1 <= 0x1000000) { v0 = a1 >> 5; v2 = a0[2]; if (v0 <= a0[2]) { *((a0[0] + v0 * 4)) = *((a0[0] + v0 * 4)) & !((1 << ((a1 & 31) & 31))); v2 = retop(a0); } } return v2; }
char * polite_directory_format (name) char *name; { char *home; int l; home = get_string_value ("HOME"); l = home ? strlen (home) : 0; if (l > 1 && strncmp (home, name, l) == 0 && (!name[l] || name[l] == '/')) { strncpy (tdir + 1, name + l, sizeof(tdir) - 2); tdir[0] = '~'; tdir[sizeof(tdir) - 1] = '\0'; return (tdir); } else return (name); }
undefined1 * polite_directory_format(undefined1 *param_1) { int iVar1; int iVar2; char *__s; size_t sVar3; __s = (char *)get_string_value(&DAT_001034e9); if (__s == (char *)0x0) { iVar1 = 0; } else { sVar3 = strlen(__s); iVar1 = (int)sVar3; } if (((1 < iVar1) && (iVar2 = strncmp(__s,param_1,(long)iVar1), iVar2 == 0)) && ((param_1[iVar1] == '\0' || (param_1[iVar1] == '/')))) { strncpy(tdir + 1,param_1 + iVar1,0xffe); tdir[0] = 0x7e; tdir[4095] = 0; param_1 = tdir; } return param_1; }
void xheader_destroy (struct xheader *xhdr) { if (xhdr->stk) { __extension__ ({ struct obstack *__o = (xhdr->stk); void *__obj = (void *) ( ((void *)0) ); if (__obj > (void *) __o->chunk && __obj < (void *) __o->chunk_limit) __o->next_free = __o->object_base = (char *) __obj; else _obstack_free (__o, __obj); }); free (xhdr->stk); xhdr->stk = ((void *)0) ; } else free (xhdr->buffer); xhdr->buffer = 0; xhdr->size = 0; }
void xheader_destroy(unsigned long long a0[3]) { unsigned long long v0[5]; void* v1; unsigned long long v3[3]; if (a0[0]) { v0[0] = a0[0]; v1 = 0; if (v1 > v0[1] && v1 < v0[4]) { v0[2] = v1; v0[3] = v0[2]; } if (v1 <= v0[1] || v1 >= v0[4]) _obstack_free(v0, v1); free(a0[0]); a0[0] = 0; } else { free(a0[2]); } a0[2] = 0; v3 = a0; a0[1] = 0; return; }
static void scan_entries (size_t n, const STRUCT_UTMP *utmp_buf) { char *ttyname_b ; time_t boottime = ((time_t) ~ ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1)))); if (include_heading) print_heading (); if (my_line_only) { ttyname_b = ttyname ( 0 ); if (!ttyname_b) return; if (strncmp (ttyname_b, "" "/dev/" "", sizeof ("/dev/") - 1) == 0) ttyname_b += (sizeof ("/dev/") - 1); } while (n--) { if (!my_line_only || (strncmp (ttyname_b, utmp_buf->ut_line, sizeof (utmp_buf->ut_line)) == 0) ) { if (need_users && (((utmp_buf)-> ut_user )[0] && (((utmp_buf)->ut_type == ( 7 )) || (0 && ((utmp_buf)->ut_tv.tv_sec) != 0)))) print_user (utmp_buf, boottime); else if (need_runlevel && ((utmp_buf)->ut_type == ( 1 ))) print_runlevel (utmp_buf); else if (need_boottime && ((utmp_buf)->ut_type == ( 2 ))) print_boottime (utmp_buf); else if (need_clockchange && ((utmp_buf)->ut_type == ( 3 ))) print_clockchange (utmp_buf); else if (need_initspawn && ((utmp_buf)->ut_type == ( 5 ))) print_initspawn (utmp_buf); else if (need_login && ((utmp_buf)->ut_type == ( 6 ))) print_login (utmp_buf); else if (need_deadprocs && ((utmp_buf)->ut_type == ( 8 ))) print_deadprocs (utmp_buf); } if (((utmp_buf)->ut_type == ( 2 ))) boottime = ((utmp_buf)->ut_tv.tv_sec); utmp_buf++; } }
void scan_entries(unsigned long long a0, void* a1) { struct_0 *v0; unsigned long long v1; char *v2; unsigned long v3; unsigned long long v6; v1 = a0; v0 = a1; v3 = 0x8000000000000000; if (include_heading) print_heading(); if (my_line_only) { v2 = ttyname(0x0); if (!v2) { return; } else if (!strncmp(v2, "/dev/", 0x5)) { v2 += 5; } } while (true) { v6 = v1; v1 -= 1; if (!v6) break; if ((my_line_only ^ 1) || !strncmp(v2, &v0->padding_2[6], 0x20)) { if (!(!need_users || !v0->field_2c || v0->field_0 != 7)) { print_user(v0, v3); } else if (!(!need_runlevel || v0->field_0 != 1)) { print_runlevel(v0); } else if (!(!need_boottime || v0->field_0 != 2)) { print_boottime(v0); } else if (!(!need_clockchange || v0->field_0 != 3)) { print_clockchange(v0); } else if (!(!need_initspawn || v0->field_0 != 5)) { print_initspawn(v0); } else if (!(!need_login || v0->field_0 != 6)) { print_login(v0); } else if (need_deadprocs && v0->field_0 == 8) { print_deadprocs(v0); } } if (v0->field_0 == 2) v3 = v0->field_154; v0 = &v0[1].padding_2[38]; } return; }
static void usage(void) { fprintf( stderr , "Usage: ip xfrm state { add | update } ID [ ALGO-LIST ] [ mode MODE ]\n" " [ mark MARK [ mask MASK ] ] [ reqid REQID ] [ seq SEQ ]\n" " [ replay-window SIZE ] [ replay-seq SEQ ] [ replay-oseq SEQ ]\n" " [ replay-seq-hi SEQ ] [ replay-oseq-hi SEQ ]\n" " [ flag FLAG-LIST ] [ sel SELECTOR ] [ LIMIT-LIST ] [ encap ENCAP ]\n" " [ coa ADDR[/PLEN] ] [ ctx CTX ] [ extra-flag EXTRA-FLAG-LIST ]\n" " [ offload [dev DEV] dir DIR ]\n" " [ output-mark OUTPUT-MARK [ mask MASK ] ]\n" " [ if_id IF_ID ] [ tfcpad LENGTH ]\n" "Usage: ip xfrm state allocspi ID [ mode MODE ] [ mark MARK [ mask MASK ] ]\n" " [ reqid REQID ] [ seq SEQ ] [ min SPI max SPI ]\n" "Usage: ip xfrm state { delete | get } ID [ mark MARK [ mask MASK ] ]\n" "Usage: ip xfrm state deleteall [ ID ] [ mode MODE ] [ reqid REQID ]\n" " [ flag FLAG-LIST ]\n" "Usage: ip xfrm state list [ nokeys ] [ ID ] [ mode MODE ] [ reqid REQID ]\n" " [ flag FLAG-LIST ]\n" "Usage: ip xfrm state flush [ proto XFRM-PROTO ]\n" "Usage: ip xfrm state count\n" "ID := [ src ADDR ] [ dst ADDR ] [ proto XFRM-PROTO ] [ spi SPI ]\n" "XFRM-PROTO := "); fprintf( stderr , "%s | %s | %s | %s | %s\n", strxf_xfrmproto( IPPROTO_ESP ), strxf_xfrmproto( IPPROTO_AH ), strxf_xfrmproto( IPPROTO_COMP ), strxf_xfrmproto( IPPROTO_ROUTING ), strxf_xfrmproto( IPPROTO_DSTOPTS )); fprintf( stderr , "ALGO-LIST := [ ALGO-LIST ] ALGO\n" "ALGO := { "); fprintf( stderr , "%s | %s", strxf_algotype(XFRMA_ALG_CRYPT), strxf_algotype(XFRMA_ALG_AUTH)); fprintf( stderr , " } ALGO-NAME ALGO-KEYMAT |\n" " %s", strxf_algotype(XFRMA_ALG_AUTH_TRUNC)); fprintf( stderr , " ALGO-NAME ALGO-KEYMAT ALGO-TRUNC-LEN |\n" " %s", strxf_algotype(XFRMA_ALG_AEAD)); fprintf( stderr , " ALGO-NAME ALGO-KEYMAT ALGO-ICV-LEN |\n" " %s", strxf_algotype(XFRMA_ALG_COMP)); fprintf( stderr , " ALGO-NAME\n" "MODE := transport | tunnel | beet | ro | in_trigger\n" "FLAG-LIST := [ FLAG-LIST ] FLAG\n" "FLAG := noecn | decap-dscp | nopmtudisc | wildrecv | icmp | af-unspec | align4 | esn\n" "EXTRA-FLAG-LIST := [ EXTRA-FLAG-LIST ] EXTRA-FLAG\n" "EXTRA-FLAG := dont-encap-dscp | oseq-may-wrap\n" "SELECTOR := [ src ADDR[/PLEN] ] [ dst ADDR[/PLEN] ] [ dev DEV ] [ UPSPEC ]\n" "UPSPEC := proto { { tcp | udp | sctp | dccp } [ sport PORT ] [ dport PORT ] |\n" " { icmp | ipv6-icmp | mobility-header } [ type NUMBER ] [ code NUMBER ] |\n" " gre [ key { DOTTED-QUAD | NUMBER } ] | PROTO }\n" "LIMIT-LIST := [ LIMIT-LIST ] limit LIMIT\n" "LIMIT := { time-soft | time-hard | time-use-soft | time-use-hard } SECONDS |\n" " { byte-soft | byte-hard } SIZE | { packet-soft | packet-hard } COUNT\n" "ENCAP := { espinudp | espinudp-nonike | espintcp } SPORT DPORT OADDR\n" "DIR := in | out\n"); exit(-1); }
void usage(void) { undefined8 uVar1; undefined8 uVar2; undefined8 uVar3; undefined8 uVar4; undefined8 uVar5; undefined8 uVar6; fprintf(stderr, "Usage: ip xfrm state { add | update } ID [ ALGO-LIST ] [ mode MODE ]\n [ mark MARK [ mask MASK ] ] [ reqid REQID ] [ seq SEQ ]\n [ replay-window SIZE ] [ replay-seq SEQ ] [ replay-oseq SEQ ]\n [ replay-seq-hi SEQ ] [ replay-oseq-hi SEQ ]\n [ flag FLAG-LIST ] [ sel SELECTOR ] [ LIMIT-LIST ] [ encap ENCAP ]\n [ coa ADDR[/PLEN] ] [ ctx CTX ] [ extra-flag EXTRA-FLAG-LIST ]\n [ offload [dev DEV] dir DIR ]\n [ output-mark OUTPUT-MARK [ mask MASK ] ]\n [ if_id IF_ID ] [ tfcpad LENGTH ]\nUsage: ip xfrm state allocspi ID [ mode MODE ] [ mark MARK [ mask MASK ] ]\n [ reqid REQID ] [ seq SEQ ] [ min SPI max SPI ]\nUsage: ip xfrm state { delete | get } ID [ mark MARK [ mask MASK ] ]\nUsage: ip xfrm state deleteall [ ID ] [ mode MODE ] [ reqid REQID ]\n [ flag FLAG-LIST ]\nUsage: ip xfrm state list [ nokeys ] [ ID ] [ mode MODE ] [ reqid REQID ]\n [ flag FLAG-LIST ]\nUsage: ip xfrm state flush [ proto XFRM-PROTO ]\nUsage: ip xfrm state count\nID := [ src ADDR ] [ dst ADDR ] [ proto XFRM-PROTO ] [ spi SPI ]\nXFRM-PROTO := " ); uVar1 = strxf_xfrmproto(0x3c); uVar2 = strxf_xfrmproto(0x2b); uVar3 = strxf_xfrmproto(0x6c); uVar4 = strxf_xfrmproto(0x33); uVar6 = 0x100079; uVar5 = strxf_xfrmproto(0x32); fprintf(stderr,"%s | %s | %s | %s | %s\n",uVar5,uVar4,uVar3,uVar2,uVar1,uVar6); fprintf(stderr,"ALGO-LIST := [ ALGO-LIST ] ALGO\nALGO := { "); uVar1 = strxf_algotype(1); uVar2 = strxf_algotype(2); fprintf(stderr,"%s | %s",uVar2,uVar1); uVar1 = strxf_algotype(0x14); fprintf(stderr," } ALGO-NAME ALGO-KEYMAT |\n %s",uVar1); uVar1 = strxf_algotype(0x12); fprintf(stderr," ALGO-NAME ALGO-KEYMAT ALGO-TRUNC-LEN |\n %s",uVar1); uVar1 = strxf_algotype(3); fprintf(stderr," ALGO-NAME ALGO-KEYMAT ALGO-ICV-LEN |\n %s",uVar1); fprintf(stderr, " ALGO-NAME\nMODE := transport | tunnel | beet | ro | in_trigger\nFLAG-LIST := [ FLAG-LIST ] FLAG\nFLAG := noecn | decap-dscp | nopmtudisc | wildrecv | icmp | af-unspec | align4 | esn\nEXTRA-FLAG-LIST := [ EXTRA-FLAG-LIST ] EXTRA-FLAG\nEXTRA-FLAG := dont-encap-dscp | oseq-may-wrap\nSELECTOR := [ src ADDR[/PLEN] ] [ dst ADDR[/PLEN] ] [ dev DEV ] [ UPSPEC ]\nUPSPEC := proto { { tcp | udp | sctp | dccp } [ sport PORT ] [ dport PORT ] |\n { icmp | ipv6-icmp | mobility-header } [ type NUMBER ] [ code NUMBER ] |\n gre [ key { DOTTED-QUAD | NUMBER } ] | PROTO }\nLIMIT-LIST := [ LIMIT-LIST ] limit LIMIT\nLIMIT := { time-soft | time-hard | time-use-soft | time-use-hard } SECONDS |\n { byte-soft | byte-hard } SIZE | { packet-soft | packet-hard } COUNT\nENCAP := { espinudp | espinudp-nonike | espintcp } SPORT DPORT OADDR\nDIR := in | out\n" ); exit(-1); }
idx_t kwswords (kwset_t kwset) { return kwset->words; }
long kwswords(long a1) { return *(_QWORD *)(a1 + 88); }
SHELL_VAR * find_global_variable (name) const char *name; { SHELL_VAR *var; var = var_lookup (name, global_variables); if (var && ((((var)->attributes) & (0x0000800)))) var = find_variable_nameref (var); if (var == 0) return ((SHELL_VAR *) ((void *)0) ); return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var); }
int find_global_variable(unsigned long long a0) { struct_0 *v0; unsigned int v2; v0 = var_lookup(a0, global_variables); if (v0 && (v0->field_28 & 0x800)) v0 = find_variable_nameref(v0); if (!v0) { v2 = 0; return v2; } else if (v0->field_18) { v2 = *(((stack_base)[16] + 24))(v0); return v2; } else { v2 = v0; return v2; } }
WORD_LIST * word_split (w, ifs_chars) WORD_DESC *w; char *ifs_chars; { WORD_LIST *result; if (w) { char *xifs; xifs = ((w->flags & (1 << 1)) || ifs_chars == 0) ? "" : ifs_chars; result = list_string (w->word, xifs, w->flags & (1 << 1)); } else result = (WORD_LIST *) ((void *)0) ; return (result); }
undefined8 word_split(undefined8 *param_1,undefined *param_2) { undefined8 local_18; if (param_1 == (undefined8 *)0x0) { local_18 = 0; } else { if (((*(uint *)(param_1 + 1) & 2) != 0) || (param_2 == (undefined *)0x0)) { param_2 = &DAT_0011fa65; } local_18 = list_string(*param_1,param_2,*(uint *)(param_1 + 1) & 2); } return local_18; }
void readlink_diag (char const *name) { if (ignore_failed_read_option) { if ((warning_option & (0x00800000))) readlink_warn (name); } else readlink_error (name); }
long long readlink_diag(unsigned long long a0) { unsigned long long v1; if (!ignore_failed_read_option) { v1 = readlink_error(a0); return v1; } v1 = warning_option & &g_800000; if ((warning_option & 0x800000)) { v1 = readlink_warn(a0); return v1; } return v1; }
intmax_t setvarint(const char *name, intmax_t val, int flags) { int len = max_int_length(sizeof(val)); char buf[len]; fmtstr(buf, len, "%" "l" "d" , val); setvar(name, buf, flags); return val; }
undefined8 setvarint(undefined8 param_1,undefined8 param_2,undefined4 param_3) { long lVar1; undefined4 uVar2; undefined8 uVar3; undefined *puVar4; ulong uVar5; undefined *puVar6; long lVar7; long in_FS_OFFSET; undefined auStack120 [12]; undefined4 local_6c; undefined8 local_68; undefined8 local_60; int local_54; long local_50; undefined *local_48; long local_40; local_40 = *(long *)(in_FS_OFFSET + 0x28); local_6c = param_3; local_68 = param_2; local_60 = param_1; local_54 = max_int_length(8); local_50 = (long)local_54 + -1; uVar5 = (((long)local_54 + 0xfU) / 0x10) * 0x10; for (puVar6 = auStack120; puVar6 != auStack120 + -(uVar5 & 0xfffffffffffff000); puVar6 = puVar6 + -0x1000) { *(undefined8 *)(puVar6 + -8) = *(undefined8 *)(puVar6 + -8); } lVar1 = -(ulong)((uint)uVar5 & 0xfff); if ((uVar5 & 0xfff) != 0) { *(undefined8 *)(puVar6 + ((ulong)((uint)uVar5 & 0xfff) - 8) + lVar1) = *(undefined8 *)(puVar6 + ((ulong)((uint)uVar5 & 0xfff) - 8) + lVar1); } uVar3 = local_68; local_48 = puVar6 + lVar1; lVar7 = (long)local_54; *(undefined8 *)(puVar6 + lVar1 + -8) = 0x100348; fmtstr((long)puVar6 + lVar1,lVar7,&DAT_001012a6,uVar3); puVar4 = local_48; uVar3 = local_60; uVar2 = local_6c; *(undefined8 *)(puVar6 + lVar1 + -8) = 0x10035e; setvar(uVar3,puVar4,uVar2); if (local_40 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return local_68; }
static void DestructTCPInstanceData(wrkrInstanceData_t *pWrkrData) { doZipFinish(pWrkrData); if(pWrkrData->pNetstrm != ((void *)0) ) netstrm.Destruct(&pWrkrData->pNetstrm); if(pWrkrData->pNS != ((void *)0) ) netstrms.Destruct(&pWrkrData->pNS); }
void DestructTCPInstanceData(unsigned long long a0[3]) { unsigned long long v1; unsigned long long v2; doZipFinish(a0); if (a0[2]) *(4217208)(&a0[2]); v1 = a0[1]; if (a0[1]) v2 = *(4216984)(&a0[1]); return; }
static int bareudp_parse_opt(struct link_util *lu, int argc, char **argv, struct nlmsghdr *n) { _Bool multiproto = 0 ; __u16 srcportmin = 0; __be16 ethertype = 0; __be16 dstport = 0; __u64 attrs = 0; while (argc > 0) { if (matches(*argv, "dstport") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); check_duparg(&attrs, IFLA_BAREUDP_PORT, "dstport", *argv); if (get_be16(&dstport, *argv, 0)) invarg("dstport", *argv); } else if (matches(*argv, "ethertype") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); check_duparg(&attrs, IFLA_BAREUDP_ETHERTYPE, "ethertype", *argv); if (ll_proto_a2n(&ethertype, *argv)) invarg("ethertype", *argv); } else if (matches(*argv, "srcportmin") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); check_duparg(&attrs, IFLA_BAREUDP_SRCPORT_MIN, "srcportmin", *argv); if (get_u16(&srcportmin, *argv, 0)) invarg("srcportmin", *argv); } else if (matches(*argv, "multiproto") == 0) { check_duparg(&attrs, IFLA_BAREUDP_MULTIPROTO_MODE, *argv, *argv); multiproto = 1 ; } else if (matches(*argv, "nomultiproto") == 0) { check_duparg(&attrs, IFLA_BAREUDP_MULTIPROTO_MODE, *argv, *argv); multiproto = 0 ; } else if (matches(*argv, "help") == 0) { explain(); return -1; } else { fprintf( stderr , "bareudp: unknown command \"%s\"?\n", *argv); explain(); return -1; } argc--, argv++; } if (!(((attrs) & (1L << (IFLA_BAREUDP_PORT))) != 0)) missarg("dstport"); if (!(((attrs) & (1L << (IFLA_BAREUDP_ETHERTYPE))) != 0)) missarg("ethertype"); addattr16(n, 1024, IFLA_BAREUDP_PORT, dstport); addattr16(n, 1024, IFLA_BAREUDP_ETHERTYPE, ethertype); if ((((attrs) & (1L << (IFLA_BAREUDP_SRCPORT_MIN))) != 0)) addattr16(n, 1024, IFLA_BAREUDP_SRCPORT_MIN, srcportmin); if (multiproto) addattr(n, 1024, IFLA_BAREUDP_MULTIPROTO_MODE); return 0; }
long bareudp_parse_opt(long a1, int a2, long *a3, long a4) { char v8; unsigned short v9; unsigned short v10; unsigned short v11; long v12[2]; v12[1] = __readfsqword(0x28u); v8 = 0; v9 = 0; v10 = 0; v11 = 0; v12[0] = 0LL; while ( 1 ) { if ( a2 <= 0 ) { if ( (v12[0] & 2) == 0 ) missarg("dstport"); if ( (v12[0] & 4) == 0 ) missarg("ethertype"); addattr16(a4, 1024LL, 1LL, v11); addattr16(a4, 1024LL, 2LL, v10); if ( (v12[0] & 8) != 0 ) addattr16(a4, 1024LL, 3LL, v9); if ( v8 ) addattr(a4, 1024LL, 4LL); return 0LL; } if ( (unsigned char)matches(*a3, "dstport") != 1 ) { ++a3; if ( --a2 <= 0 ) incomplete_command(); check_duparg(v12, 1, (long)"dstport", *a3); if ( !(unsigned int)get_be16(&v11, *a3, 0LL) ) goto LABEL_24; invarg("dstport", *a3); } if ( (unsigned char)matches(*a3, "ethertype") != 1 ) { ++a3; if ( --a2 <= 0 ) incomplete_command(); check_duparg(v12, 2, (long)"ethertype", *a3); if ( !(unsigned int)ll_proto_a2n(&v10, *a3) ) goto LABEL_24; invarg("ethertype", *a3); } if ( (unsigned char)matches(*a3, "srcportmin") == 1 ) goto LABEL_17; ++a3; if ( --a2 <= 0 ) incomplete_command(); check_duparg(v12, 3, (long)"srcportmin", *a3); if ( (unsigned int)get_u16(&v9, *a3, 0LL) ) break; LABEL_24: --a2; ++a3; } invarg("srcportmin", *a3); LABEL_17: if ( (unsigned char)matches(*a3, "multiproto") != 1 ) { check_duparg(v12, 4, *a3, *a3); v8 = 1; goto LABEL_24; } if ( (unsigned char)matches(*a3, "nomultiproto") != 1 ) { check_duparg(v12, 4, *a3, *a3); v8 = 0; goto LABEL_24; } if ( (unsigned char)matches(*a3, "help") == 1 ) fprintf(stderr, "bareudp: unknown command \"%s\"?\n", (const char *)*a3); explain(); return 0xFFFFFFFFLL; }
void chacha_ivsetup(chacha_ctx *x, const u8 *iv, const u8 *counter) { x->input[12] = counter == ((void *)0) ? 0 : (((u32)((counter + 0)[0]) ) | ((u32)((counter + 0)[1]) << 8) | ((u32)((counter + 0)[2]) << 16) | ((u32)((counter + 0)[3]) << 24)); x->input[13] = counter == ((void *)0) ? 0 : (((u32)((counter + 4)[0]) ) | ((u32)((counter + 4)[1]) << 8) | ((u32)((counter + 4)[2]) << 16) | ((u32)((counter + 4)[3]) << 24)); x->input[14] = (((u32)((iv + 0)[0]) ) | ((u32)((iv + 0)[1]) << 8) | ((u32)((iv + 0)[2]) << 16) | ((u32)((iv + 0)[3]) << 24)); x->input[15] = (((u32)((iv + 4)[0]) ) | ((u32)((iv + 4)[1]) << 8) | ((u32)((iv + 4)[2]) << 16) | ((u32)((iv + 4)[3]) << 24)); }
_DWORD * chacha_ivsetup(_DWORD *a1, unsigned short *a2, unsigned short *a3) { int v3; int v4; _DWORD *result; if ( a3 ) v3 = (*((unsigned char *)a3 + 3) << 24) | (*((unsigned char *)a3 + 2) << 16) | *a3; else v3 = 0; a1[12] = v3; if ( a3 ) v4 = (*((unsigned char *)a3 + 7) << 24) | (*((unsigned char *)a3 + 6) << 16) | a3[2]; else v4 = 0; a1[13] = v4; a1[14] = (*((unsigned char *)a2 + 3) << 24) | (*((unsigned char *)a2 + 2) << 16) | *a2; result = a1; a1[15] = (*((unsigned char *)a2 + 7) << 24) | (*((unsigned char *)a2 + 6) << 16) | a2[2]; return result; }
static void process_fsetstat(u_int32_t id) { Attrib a; int handle, fd, r; int status = 0; if ((r = get_handle(iqueue, &handle)) != 0 || (r = decode_attrib(iqueue, &a)) != 0) sshfatal("sftp-server.c", __func__, 1042, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); sshlog("sftp-server.c", __func__, 1044, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "request %u: fsetstat handle %d", id, handle); fd = handle_to_fd(handle); if (fd < 0) status = 4; else { char *name = handle_to_name(handle); if (a.flags & 0x00000001) { sshlog("sftp-server.c", __func__, 1052, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "set \"%s\" size %llu", name, (unsigned long long)a.size) ; r = ftruncate(fd, a.size); if (r == -1) status = errno_to_portable( (*__errno_location ()) ); } if (a.flags & 0x00000004) { sshlog("sftp-server.c", __func__, 1059, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "set \"%s\" mode %04o", name, a.perm); r = fchmod(fd, a.perm & 07777); if (r == -1) status = errno_to_portable( (*__errno_location ()) ); } if (a.flags & 0x00000008) { char buf[64]; time_t t = a.mtime; strftime(buf, sizeof(buf), "%Y%m%d-%H:%M:%S", localtime(&t)); sshlog("sftp-server.c", __func__, 1074, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "set \"%s\" modtime %s", name, buf); r = futimes(fd, attrib_to_tv(&a)); if (r == -1) status = errno_to_portable( (*__errno_location ()) ); } if (a.flags & 0x00000002) { sshlog("sftp-server.c", __func__, 1084, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "set \"%s\" owner %lu group %lu", name, (u_long)a.uid, (u_long)a.gid) ; r = fchown(fd, a.uid, a.gid); if (r == -1) status = errno_to_portable( (*__errno_location ()) ); } } send_status(id, status); }
long long process_fsetstat(unsigned long a0) { unsigned long long v0; unsigned int v1; char v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned long v6; unsigned long v7; char v8; char v9; char v10; char v11; char v12; char v13; char v14; unsigned long long v15; unsigned long v16; unsigned long v17; unsigned long v18; char v19; v1 = a0; v4 = 0; v3 = get_handle(0xe87d894820ec8348, &v2); if (!v3) v3 = decode_attrib(0xe87d894820ec8348, &v8, &v8); if (v3 || v3) { v0 = "parse"; sshfatal("sftp-server.c", "process_fsetstat", 0x412, 0x1, 0x1, ssh_err(v3)); } v17 = *(&v2); v16 = v1; v15 = "request %u: fsetstat handle %d"; sshlog("sftp-server.c", "process_fsetstat", 0x414, 0x0, 0x5, 0x0, *(&v19)); v5 = handle_to_fd(*(&v2)); if (v5 < 0) { v4 = 4; } else { v7 = handle_to_name(*(&v2)); if ((*(&v8) & 1)) { v17 = *(&v9); v16 = v7; v15 = "set \"%s\" size %llu"; sshlog("sftp-server.c", "process_fsetstat", 0x41c, 0x0, 0x3, 0x0, *(&v19)); v3 = ftruncate(v5, *(&v9)); if (v3 == -1) v4 = errno_to_portable(*(__errno_location())); } if ((*(&v8) & 4)) { v17 = *(&v12); v16 = v7; v15 = "set \"%s\" mode %04o"; sshlog("sftp-server.c", "process_fsetstat", 0x423, 0x0, 0x3, 0x0, *(&v19)); v3 = fchmod(v5, *(&v12) & 4095); if (v3 == -1) v4 = errno_to_portable(*(__errno_location())); } if ((*(&v8) & 8)) { v6 = *(&v13); strftime(&v14, 0x40, "%Y%m%d-%H:%M:%S", localtime(&v6)); v17 = &v14; v16 = v7; v15 = "set \"%s\" modtime %s"; sshlog("sftp-server.c", "process_fsetstat", 0x432, 0x0, 0x3, 0x0, *(&v19)); v3 = futimes(v5, attrib_to_tv(&v8)); if (v3 == -1) v4 = errno_to_portable(*(__errno_location())); } if ((*(&v8) & 2)) { v18 = *(&v11); v17 = *(&v10); v16 = v7; v15 = "set \"%s\" owner %lu group %lu"; sshlog("sftp-server.c", "process_fsetstat", 0x43c, 0x0, 0x3, 0x0, *(&v19)); v3 = fchown(v5, *(&v10), *(&v11)); if (v3 == -1) v4 = errno_to_portable(*(__errno_location())); } } send_status(v1, v4); return 0; }
static inline __u64 rta_getattr_u64(const struct rtattr *rta) { __u64 tmp; memcpy(&tmp, ((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), sizeof(__u64)); return tmp; }
long rta_getattr_u64(long a1) { long dest[2]; dest[1] = __readfsqword(0x28u); memcpy(dest, (const void *)(a1 + 4), 8uLL); return dest[0]; }
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 SHELL_VAR * do_compound_assignment (name, value, flags) char *name, *value; int flags; { SHELL_VAR *v; int mklocal, mkassoc, mkglobal, chklocal; WORD_LIST *list; char *newname; mklocal = flags & 0x0002; mkassoc = flags & 0x0004; mkglobal = flags & 0x0008; chklocal = flags & 0x0040; if (mklocal && variable_context) { v = find_variable (name); newname = (v == 0) ? nameref_transform_name (name, flags) : v->name; if (v && ((((((v)->attributes) & (0x0000002))) && (flags & 0x0020) == 0) || ((((v)->attributes) & (0x0004000))))) { if (((((v)->attributes) & (0x0000002)))) err_readonly (name); return (v); } list = expand_compound_array_assignment (v, value, flags); if (mkassoc) v = make_local_assoc_variable (newname, 0); else if (v == 0 || (((((v)->attributes) & (0x0000004))) == 0 && ((((v)->attributes) & (0x0000040))) == 0) || v->context != variable_context) v = make_local_array_variable (newname, 0); if (v) assign_compound_array_list (v, list, flags); if (list) dispose_words (list); } else if (mkglobal && variable_context) { v = chklocal ? find_variable (name) : 0; if (v && (((((v)->attributes) & (0x0000020))) == 0 || v->context != variable_context)) v = 0; if (v == 0) v = find_global_variable (name); if (v && ((((((v)->attributes) & (0x0000002))) && (flags & 0x0020) == 0) || ((((v)->attributes) & (0x0004000))))) { if (((((v)->attributes) & (0x0000002)))) err_readonly (name); return (v); } newname = (v == 0) ? nameref_transform_name (name, flags) : name; list = expand_compound_array_assignment (v, value, flags); if (v == 0 && mkassoc) v = make_new_assoc_variable (newname); else if (v && mkassoc && ((((v)->attributes) & (0x0000040))) == 0) v = convert_var_to_assoc (v); else if (v == 0) v = make_new_array_variable (newname); else if (v && mkassoc == 0 && ((((v)->attributes) & (0x0000004))) == 0) v = convert_var_to_array (v); if (v) assign_compound_array_list (v, list, flags); if (list) dispose_words (list); } else { v = assign_array_from_string (name, value, flags); if (v && ((((((v)->attributes) & (0x0000002))) && (flags & 0x0020) == 0) || ((((v)->attributes) & (0x0004000))))) { if (((((v)->attributes) & (0x0000002)))) err_readonly (name); return (v); } } return (v); }
int do_compound_assignment(unsigned long long a0, unsigned long long a1, unsigned long a2) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; void* v4; unsigned long long v5; unsigned long long v6; unsigned long long v9; v0 = a2 & 2; v1 = a2 & 4; v2 = a2 & 8; v3 = a2 & 64; if (!(!v0 || !variable_context)) { *(&v4) = find_variable(a0); if (v4) v9 = *(v4); else v9 = nameref_transform_name(a0, a2, a2); v5 = v9; if (v4 && (!(!(v4[40] & 2)) && !((a2 & 32)) || !(!(v4[40] & 0x4000)))) { if ((v4[40] & 2)) err_readonly(a0); *(&v9) = v4; return v9; } v6 = expand_compound_array_assignment(v4, a1, a2, a1); if (v1) { v9 = make_local_assoc_variable(v5, 0x0); v4 = v9; } else { if (!v4 || !(v4[40] & 4) && !(v4[40] & 64) || v4[44] != variable_context) { v9 = make_local_array_variable(v5, 0x0); v4 = v9; } } if (v4) assign_compound_array_list(v4, v6, a2, v6); if (v6) dispose_words(v6); } else if (!v2 || !variable_context) { v9 = assign_array_from_string(a0, a1, a2, a1); v4 = v9; if (v4 && (!(!(v4[40] & 2)) && !((a2 & 32)) || !(!(v4[40] & 0x4000)))) { if ((v4[40] & 2)) err_readonly(a0); *(&v9) = v4; return v9; } } else { if (!v3) v9 = 0; else v9 = find_variable(a0); v4 = v9; if (v4 && (!(v4[40] & 32) || v4[44] != variable_context)) v4 = 0; if (!v4) { v9 = find_global_variable(a0); v4 = v9; } if (v4 && (!(!(v4[40] & 2)) && !((a2 & 32)) || !(!(v4[40] & 0x4000)))) { if ((v4[40] & 2)) err_readonly(a0); *(&v9) = v4; return v9; } if (v4) v9 = a0; else v9 = nameref_transform_name(a0, a2, a2); v5 = v9; v6 = expand_compound_array_assignment(v4, a1, a2, a1); if (!(v4 || !v1)) { v9 = make_new_assoc_variable(v5); v4 = v9; } else if (!(!v4 || !v1 || (v4[40] & 64))) { v9 = convert_var_to_assoc(v4); v4 = v9; } else if (!v4) { v9 = make_new_array_variable(v5); v4 = v9; } else if (v4 && !v1 && !(v4[40] & 4)) { v9 = convert_var_to_array(v4); v4 = v9; } if (v4) assign_compound_array_list(v4, v6, a2, v6); if (v6) dispose_words(v6); } *(&v9) = v4; return v9; }
static struct mount_entry const * me_for_dev (dev_t dev) { struct devlist *dl = devlist_for_dev (dev); if (dl) return dl->me; return ((void *)0) ; }
long me_for_dev(long a1) { long v2; v2 = devlist_for_dev(a1); if ( v2 ) return *(_QWORD *)(v2 + 8); else return 0LL; }
static float estimate_pattern_match_rate (const char *pattern, int is_regex) { if (strpbrk (pattern, "*?[") || (is_regex && strpbrk(pattern, "."))) { return 0.8f; } else { return 0.1f; } }
undefined4 estimate_pattern_match_rate(char *param_1,int param_2) { char *pcVar1; undefined4 uVar2; pcVar1 = strpbrk(param_1,"*?["); if ((pcVar1 != (char *)0x0) || ((uVar2 = DAT_00106e38, param_2 != 0 && (pcVar1 = strpbrk(param_1,"."), uVar2 = DAT_00106e38, pcVar1 != (char *)0x0)))) { uVar2 = DAT_00106e5c; } return uVar2; }
void get_email_set(int type, void *crt) { int ret = 0, i; if (batch) { if (!cfg.email) return; for (i = 0; cfg.email[i] != ((void *)0) ; i++) { if (type == 1) ret = gnutls_x509_crt_set_subject_alt_name (crt, GNUTLS_SAN_RFC822NAME, cfg.email[i], strlen(cfg.email[i]), 1); else ret = gnutls_x509_crq_set_subject_alt_name (crt, GNUTLS_SAN_RFC822NAME, cfg.email[i], strlen(cfg.email[i]), 1); if (ret < 0) break; } } else { const char *p; p = read_str ("Enter the e-mail of the subject of the certificate: "); if (!p) return; if (type == 1) ret = gnutls_x509_crt_set_subject_alt_name(crt, GNUTLS_SAN_RFC822NAME, p, strlen(p), 1); else ret = gnutls_x509_crq_set_subject_alt_name(crt, GNUTLS_SAN_RFC822NAME, p, strlen(p), 1); } if (ret < 0) { fprintf( stderr , "set_subject_alt_name: %s\n", gnutls_strerror(ret)); exit(1); } }
long long get_email_set(unsigned long a0, unsigned long long a1) { unsigned int v0; unsigned int v1; char *v2; unsigned long long v4; v0 = 0; if (*(got.batch)) { v4 = *((got.cfg + 336)); if (!*((got.cfg + 336))) goto LABEL_407a28; v1 = 0; while (true) { v4 = *((*((got.cfg + 336)) + v1 * 8)); if (!*((*((got.cfg + 336)) + (v1 << 3)))) break; if (a0 != 1) { v4 = gnutls_x509_crq_set_subject_alt_name(a1, 0x2, *((*((got.cfg + 336)) + v1 * 8)), strlen(*((*((got.cfg + 336)) + v1 * 8))), 0x1); v0 = v4; } else { v4 = gnutls_x509_crt_set_subject_alt_name(a1, 0x2, *((*((got.cfg + 336)) + v1 * 8)), strlen(*((*((got.cfg + 336)) + v1 * 8))), 0x1); v0 = v4; } if (v0 < 0) break; v1 += 1; } } else { v4 = read_str("Enter the e-mail of the subject of the certificate: "); v2 = v4; if (!v2) goto LABEL_407a28; if (a0 == 1) { v4 = gnutls_x509_crt_set_subject_alt_name(a1, 0x2, v2, strlen(v2), 0x1); v0 = v4; } else { v4 = gnutls_x509_crq_set_subject_alt_name(a1, 0x2, v2, strlen(v2), 0x1); v0 = v4; } } if (v0 < 0) { fprintf(*(got.stderr), "set_subject_alt_name: %s\n", gnutls_strerror(v0)); exit(0x1); } LABEL_407a28: return v4; }
void xheader_write_global (struct xheader *xhdr) { if (keyword_global_override_list) { struct keyword_list *kp; xheader_init (xhdr); for (kp = keyword_global_override_list; kp; kp = kp->next) code_string (kp->value, kp->pattern, xhdr); } if (xhdr->stk) { char *name; xheader_finish (xhdr); name = xheader_ghdr_name (); xheader_write ('g', name, start_time.tv_sec, xhdr); free (name); } }
long long xheader_write_global(unsigned long long *a0) { unsigned long long v0[3]; void* v1; unsigned long long v3; if (keyword_global_override_list) { xheader_init(a0); for (v0[0] = keyword_global_override_list; v0; v0[0] = v0[0]) { code_string(v0[2], v0[1], a0); } } v3 = *(a0); if (*(a0)) { xheader_finish(a0); v1 = xheader_ghdr_name(); xheader_write(0x67, v1, start_time, a0); v3 = free(v1); } return v3; }
u_int32_t get_u32(const void *vp) { const u_char *p = (const u_char *)vp; u_int32_t v; v = (u_int32_t)p[0] << 24; v |= (u_int32_t)p[1] << 16; v |= (u_int32_t)p[2] << 8; v |= (u_int32_t)p[3]; return (v); }
long long get_u32(char a0[4]) { unsigned int v0; v0 = a0[0] * 0x1000000; v0 |= (a0[1] * 0x10000); v0 |= (a0[2] * 0x100); v0 |= a0[3]; return v0; }
static int isgrp (const char *name, const char *group) { struct group *grp; grp = getgrnam (group); if (!grp || !grp->gr_mem) return 0; return is_on_list (grp->gr_mem, name); }
undefined isgrp(undefined8 param_1,char *param_2) { undefined uVar1; group *pgVar2; pgVar2 = getgrnam(param_2); if ((pgVar2 == (group *)0x0) || (pgVar2->gr_mem == (char **)0x0)) { uVar1 = 0; } else { uVar1 = is_on_list(pgVar2->gr_mem,param_1); } return uVar1; }
static _Bool any_remote_file (const struct File_spec *f, size_t n_files) { for (size_t i = 0; i < n_files; i++) if (0 <= f[i].fd && f[i].remote) return 1 ; return 0 ; }
int any_remote_file(unsigned long a0, unsigned long a1) { void* v0; unsigned int v2; v0 = 0; while (true) { if (v0 >= a1) { v2 = 0; break; } else { if (*((a0 + ((v0 << 1) + v0 << 5) + 56)) >= 0 && *((a0 + ((v0 << 1) + v0 << 5) + 53))) { v2 = 1; break; } v0 += 1; } } return v2; }
static int input_userauth_failure(int type, u_int32_t seq, struct ssh *ssh) { Authctxt *authctxt = ssh->authctxt; char *authlist = ((void *)0) ; u_char partial; if (authctxt == ((void *)0) ) sshfatal("sshconnect2.c", __func__, 656, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "input_userauth_failure: no authentication context"); if (sshpkt_get_cstring(ssh, &authlist, ((void *)0) ) != 0 || sshpkt_get_u8(ssh, &partial) != 0 || sshpkt_get_end(ssh) != 0) goto out; if (partial != 0) { sshlog("sshconnect2.c", __func__, 664, 0, SYSLOG_LEVEL_VERBOSE, ((void *)0) , "Authenticated using \"%s\" with partial success.", authctxt->method->name) ; pubkey_reset(authctxt); } sshlog("sshconnect2.c", __func__, 669, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Authentications that can continue: %s", authlist); userauth(ssh, authlist); authlist = ((void *)0) ; out: free(authlist); return 0; }
long long input_userauth_failure(unsigned long a0, unsigned long a1, struct_0 *a2) { unsigned long long v0; unsigned int v1; unsigned int v2; char v3; void* v4; struct_1 *v5; unsigned long long v6; void* v7; char v8; v2 = a0; v1 = a1; v5 = a2->field_860; v4 = 0; if (!v5) { v0 = "input_userauth_failure: no authentication context"; sshfatal("sshconnect2.c", "input_userauth_failure", 0x290, 0x0, 0x1, 0x0); } if (!sshpkt_get_cstring(a2, &v4, 0x0, &v4) && !sshpkt_get_u8(a2, &v3, &v3) && !sshpkt_get_end(a2)) { if (v3) { v7 = v5->field_20->field_0; v6 = "Authenticated using \"%s\" with partial success."; sshlog("sshconnect2.c", "input_userauth_failure", 0x298, 0x0, 0x4, 0x0, *(&v8)); pubkey_reset(v5); } v7 = v4; v6 = "Authentications that can continue: %s"; sshlog("sshconnect2.c", "input_userauth_failure", 0x29d, 0x0, 0x5, 0x0, *(&v8)); userauth(a2, v4); v4 = 0; } free(v4); return 0; }
int chkexport (name) char *name; { SHELL_VAR *v; v = find_variable (name); if (v && ((((v)->attributes) & (0x0000001)))) { array_needs_making = 1; maybe_make_export_env (); return 1; } return 0; }
long long chkexport(unsigned long long a0) { struct_0 *v0; unsigned long long v2; v0 = find_variable(a0); if (v0 && (v0->field_28 & 1)) { array_needs_making = 1; maybe_make_export_env(); v2 = 1; } if (!v0 || !(v0->field_28 & 1)) v2 = 0; return v2; }
int sshpkt_put_bignum2(struct ssh *ssh, const BIGNUM *v) { return sshbuf_put_bignum2(ssh->state->outgoing_packet, v); }
long long sshpkt_put_bignum2(struct struct_0 **a0, unsigned long long a1) { return sshbuf_put_bignum2(*(a0)->field_30, a1, a1); }
static time_t get_int_date(const char *txt_val, int int_val, const char *msg) { if (batch) { if (txt_val == ((void *)0) ) { time_t secs; if (int_val == 0 || int_val < -2) secs = days_to_secs(365); else { secs = days_to_secs(int_val); } return secs; } else return get_date(txt_val); } else { int days; do { days = read_int(msg); } while (days == 0); return days_to_secs(days); } }
void get_int_date(unsigned long long a0, unsigned long a1, unsigned long long a2) { unsigned int v0; unsigned long long v1; unsigned long long v3; unsigned long long v4; unsigned long long v7; if (!*(got.batch)) { while (true) { v0 = read_int(a2); if (v0) break; } v4 = days_to_secs(v0); } else if (!a0) { if (a1 && a1 >= -2) *(&v1) = days_to_secs(a1); if (!a1 || a1 < -2) *(&v1) = days_to_secs(0x16d); v7 = v1; } else { v3 = get_date(a0); } return; }
static _Bool getseq (FILE *fp, struct seq *seq, int whichfile) { if (seq->count == seq->alloc) { seq->lines = ((!!sizeof (struct { _Static_assert (sizeof *(seq->lines) != 1, "verify_expr (" "sizeof *(seq->lines) != 1" ", " "x2nrealloc (seq->lines, &seq->alloc, sizeof *(seq->lines))" ")"); int _gl_dummy; })) ? (x2nrealloc (seq->lines, &seq->alloc, sizeof *(seq->lines))) : (x2nrealloc (seq->lines, &seq->alloc, sizeof *(seq->lines)))); for (size_t i = seq->count; i < seq->alloc; i++) seq->lines[i] = ((void *)0) ; } if (get_line (fp, &seq->lines[seq->count], whichfile)) { ++seq->count; return 1 ; } return 0 ; }
void getseq(void* a0, unsigned long long a1[3], unsigned long a2) { unsigned long long *v0; void* v2; unsigned long long v3; if (a1[0] == a1[1]) { a1[2] = x2nrealloc(a1[2], &a1[1], 0x8, &a1[1]); for (v0 = a1[0]; v0 < a1[1]; v0 = v0 + 1) { *((a1[2] + v0 * 8)) = 0; } } if (!get_line(a0, a1[2] + (a1[0] << 3), a2)) { v2 = 0; return; } a1[0] = a1[0] + 1; v3 = 1; return; }
int _rl_vi_textmod_command (int c) { return (((c) ? (char *)strchr ((vi_textmod), (c)) != (char *) ((void *)0) : 0)); }
undefined8 _rl_vi_textmod_command(int param_1) { char *pcVar1; if ((param_1 != 0) && (pcVar1 = strchr("_*\\AaIiCcDdPpYyRrSsXx~",param_1), pcVar1 != (char *)0x0)) { return 1; } return 0; }
_Bool force_conflicts(struct deppossi *possi) { return in_force(FORCE_CONFLICTS); }
long long force_conflicts(unsigned long a0) { unsigned long v0; v0 = a0; return in_force(0x800); }
static inline __u8 rta_getattr_u8(const struct rtattr *rta) { return *(__u8 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); }
int rta_getattr_u8(struct_0 *a0) { return a0->field_4; }
static int mux_master_process_open_fwd(struct ssh *ssh, u_int rid, Channel *c, struct sshbuf *m, struct sshbuf *reply) { struct Forward fwd; char *fwd_desc = ((void *)0) ; char *listen_addr, *connect_addr; u_int ftype; u_int lport, cport; int r, i, ret = 0, freefwd = 1; memset(&fwd, 0, sizeof(fwd)); if ((r = sshbuf_get_u32(m, &ftype)) != 0 || (r = sshbuf_get_cstring(m, &listen_addr, ((void *)0) )) != 0 || (r = sshbuf_get_u32(m, &lport)) != 0 || (r = sshbuf_get_cstring(m, &connect_addr, ((void *)0) )) != 0 || (r = sshbuf_get_u32(m, &cport)) != 0 || (lport != (u_int)-2 && lport > 65535) || (cport != (u_int)-2 && cport > 65535)) { sshlog("mux.c", __func__, 703, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "malformed message"); ret = -1; goto out; } if (*listen_addr == '\0') { free(listen_addr); listen_addr = ((void *)0) ; } if (*connect_addr == '\0') { free(connect_addr); connect_addr = ((void *)0) ; } memset(&fwd, 0, sizeof(fwd)); fwd.listen_port = lport; if (fwd.listen_port == -2) fwd.listen_path = listen_addr; else fwd.listen_host = listen_addr; fwd.connect_port = cport; if (fwd.connect_port == -2) fwd.connect_path = connect_addr; else fwd.connect_host = connect_addr; sshlog("mux.c", __func__, 728, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "channel %d: request %s", c->self, (fwd_desc = format_forward(ftype, &fwd))) ; if (ftype != 1 && ftype != 2 && ftype != 3) { sshlog("mux.c", __func__, 733, 1, SYSLOG_LEVEL_INFO, ((void *)0) , "invalid forwarding type %u", ftype); invalid: free(listen_addr); free(connect_addr); reply_error(reply, 0x80000003, rid, "Invalid forwarding request"); return 0; } if (ftype == 3 && fwd.listen_path) { sshlog("mux.c", __func__, 742, 1, SYSLOG_LEVEL_INFO, ((void *)0) , "streamlocal and dynamic forwards " "are mutually exclusive") ; goto invalid; } if (fwd.listen_port != -2 && fwd.listen_port >= 65536) { sshlog("mux.c", __func__, 747, 1, SYSLOG_LEVEL_INFO, ((void *)0) , "invalid listen port %u", fwd.listen_port); goto invalid; } if ((fwd.connect_port != -2 && fwd.connect_port >= 65536) || (ftype != 3 && ftype != 2 && fwd.connect_port == 0)) { sshlog("mux.c", __func__, 754, 1, SYSLOG_LEVEL_INFO, ((void *)0) , "invalid connect port %u", fwd.connect_port) ; goto invalid; } if (ftype != 3 && fwd.connect_host == ((void *)0) && fwd.connect_path == ((void *)0) ) { sshlog("mux.c", __func__, 760, 1, SYSLOG_LEVEL_INFO, ((void *)0) , "missing connect host"); goto invalid; } switch (ftype) { case 1: case 3: for (i = 0; i < options.num_local_forwards; i++) { if (compare_forward(&fwd, options.local_forwards + i)) { exists: sshlog("mux.c", __func__, 772, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "found existing forwarding"); reply_ok(reply, rid); goto out; } } break; case 2: for (i = 0; i < options.num_remote_forwards; i++) { if (!compare_forward(&fwd, options.remote_forwards + i)) continue; if (fwd.listen_port != 0) goto exists; sshlog("mux.c", __func__, 784, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "found allocated port"); if ((r = sshbuf_put_u32(reply, 0x80000007)) != 0 || (r = sshbuf_put_u32(reply, rid)) != 0 || (r = sshbuf_put_u32(reply, options.remote_forwards[i].allocated_port)) != 0) sshfatal("mux.c", __func__, 790, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "reply FWD_REMOTE"); goto out; } break; } if (options.control_master == 3 || options.control_master == 4) { if (!ask_permission("Open %s on %s?", fwd_desc, host)) { sshlog("mux.c", __func__, 799, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "forwarding refused by user"); reply_error(reply, 0x80000002, rid, "Permission denied"); goto out; } } if (ftype == 1 || ftype == 3) { if (!channel_setup_local_fwd_listener(ssh, &fwd, &options.fwd_opts)) { fail: sshlog("mux.c", __func__, 810, 1, SYSLOG_LEVEL_INFO, ((void *)0) , "requested %s failed", fwd_desc); reply_error(reply, 0x80000003, rid, "Port forwarding failed"); goto out; } add_local_forward(&options, &fwd); freefwd = 0; } else { struct mux_channel_confirm_ctx *fctx; fwd.handle = channel_request_remote_forwarding(ssh, &fwd); if (fwd.handle < 0) goto fail; add_remote_forward(&options, &fwd); fctx = xcalloc(1, sizeof(*fctx)); fctx->cid = c->self; fctx->rid = rid; fctx->fid = options.num_remote_forwards - 1; client_register_global_confirm(mux_confirm_remote_forward, fctx); freefwd = 0; c->mux_pause = 1; goto out; } reply_ok(reply, rid); out: free(fwd_desc); if (freefwd) { free(fwd.listen_host); free(fwd.listen_path); free(fwd.connect_host); free(fwd.connect_path); } return ret; }
undefined4 mux_master_process_open_fwd (undefined8 param_1,undefined4 param_2,long param_3,undefined8 param_4,undefined8 param_5) { void *pvVar1; undefined4 *puVar2; char *pcVar3; int iVar4; undefined4 uVar5; undefined *puVar6; long in_FS_OFFSET; undefined8 uVar7; undefined auStack184 [8]; undefined8 local_b0; undefined8 local_a8; long local_a0; undefined4 local_94; undefined8 local_90; uint local_84; uint local_80; uint local_7c; int local_78; int local_74; undefined4 local_70; int local_6c; char *local_68; char *local_60; void *local_58; undefined4 *local_50; char *local_48; uint local_40; char *local_38; char *local_30; uint local_28; char *local_20; int local_14; long local_10; puVar6 = auStack184; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_58 = (void *)0x0; local_70 = 0; local_6c = 1; local_b0 = param_5; local_a8 = param_4; local_a0 = param_3; local_94 = param_2; local_90 = param_1; memset(&local_48,0,0x38); uVar7 = 0x101f77; local_78 = sshbuf_get_u32(local_a8,&local_84); if (local_78 == 0) { uVar7 = 0x101f9f; local_78 = sshbuf_get_cstring(local_a8,&local_68,0); if (local_78 != 0) goto LAB_00102032; uVar7 = 0x101fc2; local_78 = sshbuf_get_u32(local_a8,&local_80); if (local_78 != 0) goto LAB_00102032; uVar7 = 0x101fe6; local_78 = sshbuf_get_cstring(local_a8,&local_60,0); if (local_78 != 0) goto LAB_00102032; uVar7 = 0x102005; local_78 = sshbuf_get_u32(local_a8,&local_7c); if (((local_78 != 0) || ((local_80 != 0xfffffffe && (0xffff < local_80)))) || ((local_7c != 0xfffffffe && (0xffff < local_7c)))) goto LAB_00102032; if (*local_68 == '\0') { free(local_68); local_68 = (char *)0x0; } if (*local_60 == '\0') { free(local_60); local_60 = (char *)0x0; } memset(&local_48,0,0x38); local_40 = local_80; if (local_80 == 0xfffffffe) { local_38 = local_68; } else { local_48 = local_68; } local_28 = local_7c; if (local_7c == 0xfffffffe) { local_20 = local_60; } else { local_30 = local_60; } uVar7 = 0x102121; local_58 = (void *)format_forward(local_84,&local_48); sshlog("mux.c","mux_master_process_open_fwd",0x2d8,1,6,0,"channel %d: request %s", *(undefined4 *)(local_a0 + 4),local_58,uVar7); if (((local_84 != 1) && (local_84 != 2)) && (local_84 != 3)) { sshlog("mux.c","mux_master_process_open_fwd",0x2dd,1,3,0,"invalid forwarding type %u",local_84 ); LAB_001021d3: free(local_68); free(local_60); reply_error(local_b0,0x80000003,local_94,"Invalid forwarding request"); puVar6 = auStack184; uVar5 = 0; goto LAB_00102841; } if ((local_84 == 3) && (local_38 != (char *)0x0)) { sshlog("mux.c","mux_master_process_open_fwd",0x2e6,1,3,0, "streamlocal and dynamic forwards are mutually exclusive"); goto LAB_001021d3; } if ((local_40 != 0xfffffffe) && (0xffff < (int)local_40)) { sshlog("mux.c","mux_master_process_open_fwd",0x2eb,1,3,0,"invalid listen port %u",local_40); goto LAB_001021d3; } if (((local_28 != 0xfffffffe) && (0xffff < (int)local_28)) || ((local_84 != 3 && ((local_84 != 2 && (local_28 == 0)))))) { sshlog("mux.c","mux_master_process_open_fwd",0x2f2,1,3,0,"invalid connect port %u",local_28); goto LAB_001021d3; } if (((local_84 != 3) && (local_30 == (char *)0x0)) && (local_20 == (char *)0x0)) { sshlog("mux.c","mux_master_process_open_fwd",0x2f8,1,3,0,"missing connect host"); goto LAB_001021d3; } if (local_84 == 3) { LAB_001023ac: for (local_74 = 0; puVar6 = auStack184, local_74 < _DAT_0010c338; local_74 = __addvsi3(local_74,1)) { iVar4 = compare_forward(&local_48,_DAT_0010c340 + (long)local_74 * 0x38); puVar6 = auStack184; if (iVar4 != 0) goto LAB_001023ee; } } else { puVar6 = auStack184; if (local_84 < 4) { if (local_84 == 1) goto LAB_001023ac; puVar6 = auStack184; if (local_84 == 2) { local_74 = 0; puVar6 = auStack184; while (local_74 < _DAT_0010c348) { *(undefined8 *)(puVar6 + -8) = 0x1024a6; iVar4 = compare_forward(&local_48,_DAT_0010c350 + (long)local_74 * 0x38); if (iVar4 == 0) { *(undefined8 *)(puVar6 + -8) = 0x1024b7; local_74 = __addvsi3(local_74,1); } else { if (local_40 != 0) goto LAB_001023ee; *(char **)(puVar6 + -0x10) = "found allocated port"; *(undefined8 *)(puVar6 + -0x18) = 0x102504; sshlog("mux.c","mux_master_process_open_fwd",0x310,1,6,0); *(undefined8 *)(puVar6 + -8) = 0x10251c; local_78 = sshbuf_put_u32(local_b0,0x80000007); if (local_78 == 0) { *(undefined8 *)(puVar6 + -8) = 0x10253c; local_78 = sshbuf_put_u32(local_b0,local_94); if (local_78 == 0) { uVar5 = *(undefined4 *)((long)local_74 * 0x38 + _DAT_0010c350 + 0x30); *(undefined8 *)(puVar6 + -8) = 0x102579; local_78 = sshbuf_put_u32(local_b0,uVar5); if (local_78 == 0) goto LAB_001027fc; } } *(undefined8 *)(puVar6 + -8) = 0x102590; uVar7 = ssh_err(local_78); *(char **)(puVar6 + -0x10) = "reply FWD_REMOTE"; *(undefined8 *)(puVar6 + -0x18) = 0x1025c7; sshfatal("mux.c","mux_master_process_open_fwd",0x316,1,1,uVar7); puVar6 = puVar6 + -0x10; } } } } } pvVar1 = local_58; if ((_DAT_0010c3c0 == 3) || (_DAT_0010c3c0 == 4)) { *(undefined8 *)(puVar6 + -8) = 0x102610; iVar4 = ask_permission("Open %s on %s?",pvVar1,host); if (iVar4 == 0) { *(char **)(puVar6 + -0x10) = "forwarding refused by user"; *(undefined8 *)(puVar6 + -0x18) = 0x10264e; sshlog("mux.c","mux_master_process_open_fwd",799,1,6,0); uVar5 = local_94; uVar7 = local_b0; *(undefined8 *)(puVar6 + -8) = 0x102673; reply_error(uVar7,0x80000002,uVar5,"Permission denied"); goto LAB_001027fc; } } uVar7 = local_90; if ((local_84 == 1) || (local_84 == 3)) { *(undefined8 *)(puVar6 + -8) = 0x1026a9; iVar4 = channel_setup_local_fwd_listener(uVar7,&local_48,sshbuf_get_cstring); if (iVar4 == 0) goto LAB_001026b1; *(undefined8 *)(puVar6 + -8) = 0x102727; add_local_forward(&options,&local_48); uVar5 = local_94; uVar7 = local_b0; local_6c = 0; *(undefined8 *)(puVar6 + -8) = 0x102745; reply_ok(uVar7,uVar5); } else { *(undefined8 *)(puVar6 + -8) = 0x102760; local_14 = channel_request_remote_forwarding(uVar7,&local_48); if (local_14 < 0) { LAB_001026b1: *(void **)(puVar6 + -8) = local_58; *(char **)(puVar6 + -0x10) = "requested %s failed"; *(undefined8 *)(puVar6 + -0x18) = 0x1026ea; sshlog("mux.c","mux_master_process_open_fwd",0x32a,1,3,0); uVar5 = local_94; uVar7 = local_b0; *(undefined8 *)(puVar6 + -8) = 0x10270f; reply_error(uVar7,0x80000003,uVar5,"Port forwarding failed"); } else { *(undefined8 *)(puVar6 + -8) = 0x102781; add_remote_forward(&options,&local_48); *(undefined8 *)(puVar6 + -8) = 0x102790; local_50 = (undefined4 *)xcalloc(1,0xc); *local_50 = *(undefined4 *)(local_a0 + 4); local_50[1] = local_94; *(undefined8 *)(puVar6 + -8) = 0x1027c5; uVar5 = __addvsi3(_DAT_0010c348,0xffffffff); puVar2 = local_50; local_50[2] = uVar5; *(undefined8 *)(puVar6 + -8) = 0x1027e1; client_register_global_confirm(mux_confirm_remote_forward,puVar2); local_6c = 0; *(undefined4 *)(local_a0 + 0x158) = 1; } } } else { LAB_00102032: sshlog("mux.c","mux_master_process_open_fwd",0x2bf,1,2,0,"malformed message",uVar7); local_70 = 0xffffffff; } LAB_001027fc: pvVar1 = local_58; *(undefined8 *)(puVar6 + -8) = 0x102808; free(pvVar1); pcVar3 = local_48; uVar5 = local_70; if (local_6c != 0) { *(undefined8 *)(puVar6 + -8) = 0x10281a; free(pcVar3); pcVar3 = local_38; *(undefined8 *)(puVar6 + -8) = 0x102826; free(pcVar3); pcVar3 = local_30; *(undefined8 *)(puVar6 + -8) = 0x102832; free(pcVar3); pcVar3 = local_20; *(undefined8 *)(puVar6 + -8) = 0x10283e; free(pcVar3); uVar5 = local_70; } LAB_00102841: if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return uVar5; } *(undefined8 *)(puVar6 + -8) = 0x102855; __stack_chk_fail(); LAB_001023ee: *(char **)(puVar6 + -0x10) = "found existing forwarding"; *(undefined8 *)(puVar6 + -0x18) = 0x102428; sshlog("mux.c","mux_master_process_open_fwd",0x304,1,6,0); uVar5 = local_94; uVar7 = local_b0; *(undefined8 *)(puVar6 + -8) = 0x102443; reply_ok(uVar7,uVar5); goto LAB_001027fc; }
static int do_df(struct sftp_conn *conn, const char *path, int hflag, int iflag) { struct sftp_statvfs st; char s_used[7], s_avail[7]; char s_root[7], s_total[7]; char s_icapacity[16], s_dcapacity[16]; if (do_statvfs(conn, path, &st, 1) == -1) return -1; if (st.f_files == 0) strlcpy(s_icapacity, "ERR", sizeof(s_icapacity)); else { snprintf(s_icapacity, sizeof(s_icapacity), "%3llu%%", (unsigned long long)(100 * (st.f_files - st.f_ffree) / st.f_files)); } if (st.f_blocks == 0) strlcpy(s_dcapacity, "ERR", sizeof(s_dcapacity)); else { snprintf(s_dcapacity, sizeof(s_dcapacity), "%3llu%%", (unsigned long long)(100 * (st.f_blocks - st.f_bfree) / st.f_blocks)); } if (iflag) { printf(" Inodes Used Avail " "(root) %%Capacity\n"); printf("%11llu %11llu %11llu %11llu %s\n", (unsigned long long)st.f_files, (unsigned long long)(st.f_files - st.f_ffree), (unsigned long long)st.f_favail, (unsigned long long)st.f_ffree, s_icapacity); } else if (hflag) { strlcpy(s_used, "error", sizeof(s_used)); strlcpy(s_avail, "error", sizeof(s_avail)); strlcpy(s_root, "error", sizeof(s_root)); strlcpy(s_total, "error", sizeof(s_total)); fmt_scaled((st.f_blocks - st.f_bfree) * st.f_frsize, s_used); fmt_scaled(st.f_bavail * st.f_frsize, s_avail); fmt_scaled(st.f_bfree * st.f_frsize, s_root); fmt_scaled(st.f_blocks * st.f_frsize, s_total); printf(" Size Used Avail (root) %%Capacity\n"); printf("%7sB %7sB %7sB %7sB %s\n", s_total, s_used, s_avail, s_root, s_dcapacity); } else { printf(" Size Used Avail " "(root) %%Capacity\n"); printf("%12llu %12llu %12llu %12llu %s\n", (unsigned long long)(st.f_frsize * st.f_blocks / 1024), (unsigned long long)(st.f_frsize * (st.f_blocks - st.f_bfree) / 1024), (unsigned long long)(st.f_frsize * st.f_bavail / 1024), (unsigned long long)(st.f_frsize * st.f_bfree / 1024), s_dcapacity); } return 0; }
undefined8 do_df(undefined8 param_1,undefined8 param_2,int param_3,int param_4) { int iVar1; undefined8 uVar2; long in_FS_OFFSET; undefined local_b8 [8]; long local_b0; ulong local_a8; long local_a0; long local_98; ulong local_90; long local_88; undefined8 local_80; undefined local_54 [7]; undefined local_4d [7]; undefined local_46 [7]; undefined local_3f [7]; char local_38 [16]; char local_28 [24]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); iVar1 = do_statvfs(param_1,param_2,local_b8,1); if (iVar1 == -1) { uVar2 = 0xffffffff; } else { if (local_90 == 0) { strlcpy(local_38,&DAT_00109b98,0x10); } else { snprintf(local_38,0x10,"%3llu%%",((local_90 - local_88) * 100) / local_90); } if (local_a8 == 0) { strlcpy(local_28,&DAT_00109b98,0x10); } else { snprintf(local_28,0x10,"%3llu%%",((local_a8 - local_a0) * 100) / local_a8); } if (param_4 == 0) { if (param_3 == 0) { printf(" Size Used Avail (root) %%Capacity\n"); printf("%12llu %12llu %12llu %12llu %s\n",local_a8 * local_b0 >> 10, local_b0 * (local_a8 - local_a0) >> 10,(ulong)(local_98 * local_b0) >> 10, (ulong)(local_a0 * local_b0) >> 10,local_28); } else { strlcpy(local_54,"error",7); strlcpy(local_4d,"error",7); strlcpy(local_46,"error",7); strlcpy(local_3f,"error",7); fmt_scaled(local_b0 * (local_a8 - local_a0),local_54); fmt_scaled(local_b0 * local_98,local_4d); fmt_scaled(local_b0 * local_a0,local_46); fmt_scaled(local_b0 * local_a8,local_3f); printf(" Size Used Avail (root) %%Capacity\n"); printf("%7sB %7sB %7sB %7sB %s\n",local_3f,local_54,local_4d,local_46,local_28); } } else { printf(" Inodes Used Avail (root) %%Capacity\n"); printf("%11llu %11llu %11llu %11llu %s\n",local_90,local_90 - local_88,local_80, local_88,local_38); } uVar2 = 0; } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return uVar2; }
int _rl_fix_last_undo_of_type (int type, int start, int end) { UNDO_LIST *rl; for (rl = rl_undo_list; rl; rl = rl->next) { if (rl->what == type) { rl->start = start; rl->end = end; return 0; } } return 1; }
long long _rl_fix_last_undo_of_type(unsigned long a0, unsigned long a1, unsigned long a2) { struct_0 *v0; unsigned long long v2; v0 = rl_undo_list; while (true) { if (!v0) { v2 = 1; return v2; } else if (v0->field_18 != a0) { v0 = v0->field_0; } else { v0->field_8 = a1; v0->field_c = a2; v2 = 0; return v2; } } }
int get_peer_port(int sock) { return get_sock_port(sock, 0); }
long long get_peer_port(unsigned long a0) { return get_sock_port(a0, 0x0); }
char * namebuf_name (namebuf_t buf, const char *name) { size_t len = strlen (name); while (buf->dir_length + len + 1 >= buf->buffer_size) buf->buffer = x2realloc (buf->buffer, &buf->buffer_size); strcpy (buf->buffer + buf->dir_length, name); return buf->buffer; }
long namebuf_name(_QWORD *a1, const char *a2) { size_t v3; v3 = strlen(a2); while ( a1[2] + v3 + 1 >= a1[1] ) *a1 = x2realloc(*a1, a1 + 1); strcpy((char *)(a1[2] + *a1), a2); return *a1; }
void bitmap_clear_bit(struct bitmap *b, u_int n) { size_t offset; if (b->top >= b->len || n > (1<<24)) return; offset = n / (sizeof(u_int) * 8); if (offset > b->top) return; b->d[offset] &= ~((u_int)1 << (n & ((u_int)(sizeof(u_int) * 8) - 1))); retop(b); }
long long bitmap_clear_bit(unsigned long long a0[3], unsigned long a1) { unsigned long long v0; unsigned long long v2; v2 = a0[1]; if (a0[2] < a0[1] && a1 <= 0x1000000) { v0 = a1 >> 5; v2 = a0[2]; if (v0 <= a0[2]) { *((a0[0] + v0 * 4)) = *((a0[0] + v0 * 4)) & !((1 << ((a1 & 31) & 31))); v2 = retop(a0); } } return v2; }
static void setoption(int flag, int val) { int i; for (i = 0; i < 17; i++) if (optletters[i] == flag) { optlist[i] = val; if (val) { if (flag == 'V') optlist[10] = 0; else if (flag == 'E') optlist[9] = 0; } return; } sh_error("Illegal option -%c", flag); }
void setoption(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned long long v2; unsigned long long v3; v0 = 0; while (true) { if (v0 > 16) { v2 = sh_error("Illegal option -%c"); break; } else if (a0 == *(v0 + &optletters)) { v3 = v0; *(v0 + &optlist) = a1; if (!a1) break; if (a1) { if (a0 == 86) { g_40001a = 0; break; } else { if (a0 != 69) break; if (a0 == 69) { g_400019 = 0; break; } } } } else { v0 += 1; } } return; }
static void send_mesg_to_tty (int tty_fd) { struct termios oldt, newt; FILE *mesg_file, *tty_file; _Bool is_tty; tty_file = fdopen (tty_fd, "w"); if ( ((void *)0) == tty_file) { return; } is_tty = (tcgetattr(tty_fd, &oldt) == 0); if (is_tty) { newt = oldt; newt.c_oflag |= 0000001 ; tcsetattr(tty_fd, 0 , &newt); } mesg_file = fopen ("/etc/logoutd.mesg", "r"); if ( ((void *)0) != mesg_file) { int c; while ((c = getc (mesg_file)) != (-1) ) { if (c == '\n') { putc ('\r', tty_file); } putc (c, tty_file); } fclose (mesg_file); } else { fputs (gettext ("login time exceeded\n\n"), tty_file); } fflush (tty_file); fclose (tty_file); if (is_tty) { tcsetattr(tty_fd, 0 , &oldt); } }
void send_mesg_to_tty(unsigned long a0) { char v0; char v1; unsigned int v2; void* v3; void* v4; char v5; char v6; char v7; char v8; char v9; char v10; char v11; char v12; unsigned long long v13; unsigned int v14; unsigned long long v15; unsigned long long v16; unsigned long long v17; unsigned long long v18; unsigned long long v19; unsigned long long v20; unsigned int v21; char v22; unsigned long long *v25; unsigned long long v26; v3 = fdopen(a0, "w"); if (v3) { v1 = !tcgetattr(*(&v0), &v5); if (v1) { v13 = *(&v5); v15 = *(&v6); v16 = *(&v7); v17 = *(&v8); v18 = *(&v9); v19 = *(&v10); v20 = *(&v11); v21 = *(&v12); v14 = *((&v13 + 4)) | 1; tcsetattr(*(&v0), 0x0, &v13); } v4 = fopen("/etc/logoutd.mesg", "r"); if (v4) { while (true) { v2 = getc(v4); if (v2 == -1) break; if (v2 == 10) putc(0xd, v3); putc(v2, v3); } fclose(v4); } else { fputs(gettext("login time exceeded\n\n"), v3); } fflush(v3); fclose(v3); if (v1) tcsetattr(*(&v0), 0x0, &v5); } v26 = *(&v22) ^ v25[5]; return; }
static int bridge_parse_opt(struct link_util *lu, int argc, char **argv, struct nlmsghdr *n) { struct br_boolopt_multi bm = {}; __u32 val; while (argc > 0) { if (matches(*argv, "forward_delay") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&val, *argv, 0)) invarg("invalid forward_delay", *argv); addattr32(n, 1024, IFLA_BR_FORWARD_DELAY, val); } else if (matches(*argv, "hello_time") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&val, *argv, 0)) invarg("invalid hello_time", *argv); addattr32(n, 1024, IFLA_BR_HELLO_TIME, val); } else if (matches(*argv, "max_age") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&val, *argv, 0)) invarg("invalid max_age", *argv); addattr32(n, 1024, IFLA_BR_MAX_AGE, val); } else if (matches(*argv, "ageing_time") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&val, *argv, 0)) invarg("invalid ageing_time", *argv); addattr32(n, 1024, IFLA_BR_AGEING_TIME, val); } else if (matches(*argv, "stp_state") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&val, *argv, 0)) invarg("invalid stp_state", *argv); addattr32(n, 1024, IFLA_BR_STP_STATE, val); } else if (matches(*argv, "priority") == 0) { __u16 prio; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u16(&prio, *argv, 0)) invarg("invalid priority", *argv); addattr16(n, 1024, IFLA_BR_PRIORITY, prio); } else if (matches(*argv, "vlan_filtering") == 0) { __u8 vlan_filter; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&vlan_filter, *argv, 0)) invarg("invalid vlan_filtering", *argv); addattr8(n, 1024, IFLA_BR_VLAN_FILTERING, vlan_filter); } else if (matches(*argv, "vlan_protocol") == 0) { __u16 vlan_proto; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (ll_proto_a2n(&vlan_proto, *argv)) invarg("invalid vlan_protocol", *argv); addattr16(n, 1024, IFLA_BR_VLAN_PROTOCOL, vlan_proto); } else if (matches(*argv, "group_fwd_mask") == 0) { __u16 fwd_mask; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u16(&fwd_mask, *argv, 0)) invarg("invalid group_fwd_mask", *argv); addattr16(n, 1024, IFLA_BR_GROUP_FWD_MASK, fwd_mask); } else if (matches(*argv, "group_address") == 0) { char llabuf[32]; int len; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); len = ll_addr_a2n(llabuf, sizeof(llabuf), *argv); if (len < 0) return -1; addattr_l(n, 1024, IFLA_BR_GROUP_ADDR, llabuf, len); } else if (matches(*argv, "fdb_flush") == 0) { addattr(n, 1024, IFLA_BR_FDB_FLUSH); } else if (matches(*argv, "vlan_default_pvid") == 0) { __u16 default_pvid; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u16(&default_pvid, *argv, 0)) invarg("invalid vlan_default_pvid", *argv); addattr16(n, 1024, IFLA_BR_VLAN_DEFAULT_PVID, default_pvid); } else if (matches(*argv, "vlan_stats_enabled") == 0) { __u8 vlan_stats_enabled; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&vlan_stats_enabled, *argv, 0)) invarg("invalid vlan_stats_enabled", *argv); addattr8(n, 1024, IFLA_BR_VLAN_STATS_ENABLED, vlan_stats_enabled); } else if (matches(*argv, "vlan_stats_per_port") == 0) { __u8 vlan_stats_per_port; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&vlan_stats_per_port, *argv, 0)) invarg("invalid vlan_stats_per_port", *argv); addattr8(n, 1024, IFLA_BR_VLAN_STATS_PER_PORT, vlan_stats_per_port); } else if (matches(*argv, "mcast_router") == 0) { __u8 mcast_router; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&mcast_router, *argv, 0)) invarg("invalid mcast_router", *argv); addattr8(n, 1024, IFLA_BR_MCAST_ROUTER, mcast_router); } else if (matches(*argv, "mcast_snooping") == 0) { __u8 mcast_snoop; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&mcast_snoop, *argv, 0)) invarg("invalid mcast_snooping", *argv); addattr8(n, 1024, IFLA_BR_MCAST_SNOOPING, mcast_snoop); } else if (strcmp(*argv, "mcast_vlan_snooping") == 0) { __u32 mcvl_bit = 1 << BR_BOOLOPT_MCAST_VLAN_SNOOPING; __u8 mcast_vlan_snooping; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&mcast_vlan_snooping, *argv, 0)) invarg("invalid mcast_vlan_snooping", *argv); bm.optmask |= 1 << BR_BOOLOPT_MCAST_VLAN_SNOOPING; if (mcast_vlan_snooping) bm.optval |= mcvl_bit; else bm.optval &= ~mcvl_bit; } else if (matches(*argv, "mcast_query_use_ifaddr") == 0) { __u8 mcast_qui; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&mcast_qui, *argv, 0)) invarg("invalid mcast_query_use_ifaddr", *argv); addattr8(n, 1024, IFLA_BR_MCAST_QUERY_USE_IFADDR, mcast_qui); } else if (matches(*argv, "mcast_querier") == 0) { __u8 mcast_querier; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&mcast_querier, *argv, 0)) invarg("invalid mcast_querier", *argv); addattr8(n, 1024, IFLA_BR_MCAST_QUERIER, mcast_querier); } else if (matches(*argv, "mcast_hash_elasticity") == 0) { __u32 mcast_hash_el; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&mcast_hash_el, *argv, 0)) invarg("invalid mcast_hash_elasticity", *argv); addattr32(n, 1024, IFLA_BR_MCAST_HASH_ELASTICITY, mcast_hash_el); } else if (matches(*argv, "mcast_hash_max") == 0) { __u32 mcast_hash_max; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&mcast_hash_max, *argv, 0)) invarg("invalid mcast_hash_max", *argv); addattr32(n, 1024, IFLA_BR_MCAST_HASH_MAX, mcast_hash_max); } else if (matches(*argv, "mcast_last_member_count") == 0) { __u32 mcast_lmc; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&mcast_lmc, *argv, 0)) invarg("invalid mcast_last_member_count", *argv); addattr32(n, 1024, IFLA_BR_MCAST_LAST_MEMBER_CNT, mcast_lmc); } else if (matches(*argv, "mcast_startup_query_count") == 0) { __u32 mcast_sqc; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&mcast_sqc, *argv, 0)) invarg("invalid mcast_startup_query_count", *argv); addattr32(n, 1024, IFLA_BR_MCAST_STARTUP_QUERY_CNT, mcast_sqc); } else if (matches(*argv, "mcast_last_member_interval") == 0) { __u64 mcast_last_member_intvl; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u64(&mcast_last_member_intvl, *argv, 0)) invarg("invalid mcast_last_member_interval", *argv); addattr64(n, 1024, IFLA_BR_MCAST_LAST_MEMBER_INTVL, mcast_last_member_intvl); } else if (matches(*argv, "mcast_membership_interval") == 0) { __u64 mcast_membership_intvl; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u64(&mcast_membership_intvl, *argv, 0)) invarg("invalid mcast_membership_interval", *argv); addattr64(n, 1024, IFLA_BR_MCAST_MEMBERSHIP_INTVL, mcast_membership_intvl); } else if (matches(*argv, "mcast_querier_interval") == 0) { __u64 mcast_querier_intvl; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u64(&mcast_querier_intvl, *argv, 0)) invarg("invalid mcast_querier_interval", *argv); addattr64(n, 1024, IFLA_BR_MCAST_QUERIER_INTVL, mcast_querier_intvl); } else if (matches(*argv, "mcast_query_interval") == 0) { __u64 mcast_query_intvl; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u64(&mcast_query_intvl, *argv, 0)) invarg("invalid mcast_query_interval", *argv); addattr64(n, 1024, IFLA_BR_MCAST_QUERY_INTVL, mcast_query_intvl); } else if (!matches(*argv, "mcast_query_response_interval")) { __u64 mcast_query_resp_intvl; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u64(&mcast_query_resp_intvl, *argv, 0)) invarg("invalid mcast_query_response_interval", *argv); addattr64(n, 1024, IFLA_BR_MCAST_QUERY_RESPONSE_INTVL, mcast_query_resp_intvl); } else if (!matches(*argv, "mcast_startup_query_interval")) { __u64 mcast_startup_query_intvl; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u64(&mcast_startup_query_intvl, *argv, 0)) invarg("invalid mcast_startup_query_interval", *argv); addattr64(n, 1024, IFLA_BR_MCAST_STARTUP_QUERY_INTVL, mcast_startup_query_intvl); } else if (matches(*argv, "mcast_stats_enabled") == 0) { __u8 mcast_stats_enabled; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&mcast_stats_enabled, *argv, 0)) invarg("invalid mcast_stats_enabled", *argv); addattr8(n, 1024, IFLA_BR_MCAST_STATS_ENABLED, mcast_stats_enabled); } else if (matches(*argv, "mcast_igmp_version") == 0) { __u8 igmp_version; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&igmp_version, *argv, 0)) invarg("invalid mcast_igmp_version", *argv); addattr8(n, 1024, IFLA_BR_MCAST_IGMP_VERSION, igmp_version); } else if (matches(*argv, "mcast_mld_version") == 0) { __u8 mld_version; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&mld_version, *argv, 0)) invarg("invalid mcast_mld_version", *argv); addattr8(n, 1024, IFLA_BR_MCAST_MLD_VERSION, mld_version); } else if (matches(*argv, "nf_call_iptables") == 0) { __u8 nf_call_ipt; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&nf_call_ipt, *argv, 0)) invarg("invalid nf_call_iptables", *argv); addattr8(n, 1024, IFLA_BR_NF_CALL_IPTABLES, nf_call_ipt); } else if (matches(*argv, "nf_call_ip6tables") == 0) { __u8 nf_call_ip6t; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&nf_call_ip6t, *argv, 0)) invarg("invalid nf_call_ip6tables", *argv); addattr8(n, 1024, IFLA_BR_NF_CALL_IP6TABLES, nf_call_ip6t); } else if (matches(*argv, "nf_call_arptables") == 0) { __u8 nf_call_arpt; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&nf_call_arpt, *argv, 0)) invarg("invalid nf_call_arptables", *argv); addattr8(n, 1024, IFLA_BR_NF_CALL_ARPTABLES, nf_call_arpt); } else if (matches(*argv, "help") == 0) { explain(); return -1; } else { fprintf( stderr , "bridge: unknown command \"%s\"?\n", *argv); explain(); return -1; } argc--, argv++; } if (bm.optmask) addattr_l(n, 1024, IFLA_BR_MULTI_BOOLOPT, &bm, sizeof(bm)); return 0; }
long long bridge_parse_opt(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long long a3) { unsigned long long *v0; unsigned int v1; unsigned long v2; char v3; unsigned int v4; unsigned int v5; char v6; unsigned int v7; unsigned int v8; char v9; unsigned long long v45; v2 = a0; v1 = a1; v0 = a2; v7 = 0; while (true) { if (v1 <= 0) { if (*((&v7 + 4))) addattr_l(a3, 0x400, 0x2e, &v7, 0x8); v45 = 0; break; } else { if ((matches(*(v0), "forward_delay") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u32(&v3, *(v0), 0x0, *(v0))) invarg("invalid forward_delay", *(v0)); addattr32(a3, 0x400, 0x1, *(&v3)); } else if ((matches(*(v0), "hello_time") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u32(&v3, *(v0), 0x0, *(v0))) invarg("invalid hello_time", *(v0)); addattr32(a3, 0x400, 0x2, *(&v3)); } else if ((matches(*(v0), "max_age") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u32(&v3, *(v0), 0x0, *(v0))) invarg("invalid max_age", *(v0)); addattr32(a3, 0x400, 0x3, *(&v3)); } else if ((matches(*(v0), "ageing_time") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u32(&v3, *(v0), 0x0, *(v0))) invarg("invalid ageing_time", *(v0)); addattr32(a3, 0x400, 0x4, *(&v3)); } else if ((matches(*(v0), "stp_state") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u32(&v3, *(v0), 0x0, *(v0))) invarg("invalid stp_state", *(v0)); addattr32(a3, 0x400, 0x5, *(&v3)); } else if ((matches(*(v0), "priority") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u16(&v6, *(v0), 0x0, *(v0))) invarg("invalid priority", *(v0)); addattr16(a3, 0x400, 0x6, *(&v6)); } else if ((matches(*(v0), "vlan_filtering") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u8(&v6, *(v0), 0x0, *(v0))) invarg("invalid vlan_filtering", *(v0)); addattr8(a3, 0x400, 0x7, v6); } else if ((matches(*(v0), "vlan_protocol") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (ll_proto_a2n(&v6, *(v0), *(v0))) invarg("invalid vlan_protocol", *(v0)); addattr16(a3, 0x400, 0x8, *(&v6)); } else if ((matches(*(v0), "group_fwd_mask") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u16(&v6, *(v0), 0x0, *(v0))) invarg("invalid group_fwd_mask", *(v0)); addattr16(a3, 0x400, 0x9, *(&v6)); } else if ((matches(*(v0), "group_address") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); v5 = ll_addr_a2n(&v9, 0x20, *(v0)); if (v5 >= 0) { addattr_l(a3, 0x400, 0x14, &v9, v5); } else { v45 = 4294967295; break; } } else if ((matches(*(v0), "fdb_flush") ^ 1)) { addattr(a3, 0x400, 0x15); } else if ((matches(*(v0), "vlan_default_pvid") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u16(&v6, *(v0), 0x0, *(v0))) invarg("invalid vlan_default_pvid", *(v0)); addattr16(a3, 0x400, 0x27, *(&v6)); } else if ((matches(*(v0), "vlan_stats_enabled") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u8(&v6, *(v0), 0x0, *(v0))) invarg("invalid vlan_stats_enabled", *(v0)); addattr8(a3, 0x400, 0x29, v6); } else if ((matches(*(v0), "vlan_stats_per_port") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u8(&v6, *(v0), 0x0, *(v0))) invarg("invalid vlan_stats_per_port", *(v0)); addattr8(a3, 0x400, 0x2d, v6); } else if ((matches(*(v0), "mcast_router") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u8(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_router", *(v0)); addattr8(a3, 0x400, 0x16, v6); } else if ((matches(*(v0), "mcast_snooping") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u8(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_snooping", *(v0)); addattr8(a3, 0x400, 0x17, v6); } else if (!strcmp(*(v0), "mcast_vlan_snooping")) { v4 = 2; v0 += 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u8(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_vlan_snooping", *(v0)); v8 = *((&v7 + 4)) | 2; if (!v6) v7 = v7 & !(v4); else v7 = v7 | v4; } else if ((matches(*(v0), "mcast_query_use_ifaddr") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u8(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_query_use_ifaddr", *(v0)); addattr8(a3, 0x400, 0x18, v6); } else if ((matches(*(v0), "mcast_querier") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u8(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_querier", *(v0)); addattr8(a3, 0x400, 0x19, v6); } else if ((matches(*(v0), "mcast_hash_elasticity") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u32(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_hash_elasticity", *(v0)); addattr32(a3, 0x400, 0x1a, *(&v6)); } else if ((matches(*(v0), "mcast_hash_max") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u32(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_hash_max", *(v0)); addattr32(a3, 0x400, 0x1b, *(&v6)); } else if ((matches(*(v0), "mcast_last_member_count") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u32(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_last_member_count", *(v0)); addattr32(a3, 0x400, 0x1c, *(&v6)); } else if ((matches(*(v0), "mcast_startup_query_count") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u32(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_startup_query_count", *(v0)); addattr32(a3, 0x400, 0x1d, *(&v6)); } else if ((matches(*(v0), "mcast_last_member_interval") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u64(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_last_member_interval", *(v0)); addattr64(a3, 0x400, 0x1e, *(&v6)); } else if ((matches(*(v0), "mcast_membership_interval") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u64(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_membership_interval", *(v0)); addattr64(a3, 0x400, 0x1f, *(&v6)); } else if ((matches(*(v0), "mcast_querier_interval") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u64(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_querier_interval", *(v0)); addattr64(a3, 0x400, 0x20, *(&v6)); } else if ((matches(*(v0), "mcast_query_interval") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u64(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_query_interval", *(v0)); addattr64(a3, 0x400, 0x21, *(&v6)); } else if ((matches(*(v0), "mcast_query_response_interval") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u64(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_query_response_interval", *(v0)); addattr64(a3, 0x400, 0x22, *(&v6)); } else if ((matches(*(v0), "mcast_startup_query_interval") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u64(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_startup_query_interval", *(v0)); addattr64(a3, 0x400, 0x23, *(&v6)); } else if ((matches(*(v0), "mcast_stats_enabled") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u8(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_stats_enabled", *(v0)); addattr8(a3, 0x400, 0x2a, v6); } else if ((matches(*(v0), "mcast_igmp_version") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u8(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_igmp_version", *(v0)); addattr8(a3, 0x400, 0x2b, v6); } else if ((matches(*(v0), "mcast_mld_version") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u8(&v6, *(v0), 0x0, *(v0))) invarg("invalid mcast_mld_version", *(v0)); addattr8(a3, 0x400, 0x2c, v6); } else if ((matches(*(v0), "nf_call_iptables") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u8(&v6, *(v0), 0x0, *(v0))) invarg("invalid nf_call_iptables", *(v0)); addattr8(a3, 0x400, 0x24, v6); } else if ((matches(*(v0), "nf_call_ip6tables") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u8(&v6, *(v0), 0x0, *(v0))) invarg("invalid nf_call_ip6tables", *(v0)); addattr8(a3, 0x400, 0x25, v6); } else if ((matches(*(v0), "nf_call_arptables") ^ 1)) { v0 = v0 + 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if (get_u8(&v6, *(v0), 0x0, *(v0))) invarg("invalid nf_call_arptables", *(v0)); addattr8(a3, 0x400, 0x26, v6); } else if ((matches(*(v0), "help") ^ 1)) { explain(); v45 = 4294967295; break; } else { fprintf(stderr, "bridge: unknown command \"%s\"?\n", *(v0)); explain(); v45 = 4294967295; break; } v1 -= 1; v0 += 1; } } return v45; }
static void obstack_code_rename (struct obstack *stk, char const *from, char const *to) { char const *s; s = from[0] == 0 ? from : safer_name_suffix (from, 0 , absolute_names_option); __extension__ ({ struct obstack *__o = (stk); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < 1) _obstack_newchunk (__o, 1); ((void) (*((__o)->next_free)++ = ('R'))); }); __extension__ ({ struct obstack *__o = (stk); size_t __len = (strlen (s) + 1); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < __len) _obstack_newchunk (__o, __len); memcpy (__o->next_free, s, __len); __o->next_free += __len; (void) 0; }); s = to[0] == 0 ? to: safer_name_suffix (to, 0 , absolute_names_option); __extension__ ({ struct obstack *__o = (stk); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < 1) _obstack_newchunk (__o, 1); ((void) (*((__o)->next_free)++ = ('T'))); }); __extension__ ({ struct obstack *__o = (stk); size_t __len = (strlen (s) + 1); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < __len) _obstack_newchunk (__o, __len); memcpy (__o->next_free, s, __len); __o->next_free += __len; (void) 0; }); }
void obstack_code_rename(long param_1,char *param_2,char *param_3) { undefined *puVar1; size_t sVar2; ulong uVar3; if (*param_2 != '\0') { param_2 = (char *)safer_name_suffix(param_2,0,absolute_names_option); } if (*(long *)(param_1 + 0x20) == *(long *)(param_1 + 0x18)) { _obstack_newchunk(param_1,1); } puVar1 = *(undefined **)(param_1 + 0x18); *(undefined **)(param_1 + 0x18) = puVar1 + 1; *puVar1 = 0x52; sVar2 = strlen(param_2); uVar3 = sVar2 + 1; if ((ulong)(*(long *)(param_1 + 0x20) - *(long *)(param_1 + 0x18)) < uVar3) { _obstack_newchunk(param_1,uVar3); } memcpy(*(void **)(param_1 + 0x18),param_2,uVar3); *(ulong *)(param_1 + 0x18) = *(long *)(param_1 + 0x18) + uVar3; if (*param_3 != '\0') { param_3 = (char *)safer_name_suffix(param_3,0,absolute_names_option); } if (*(long *)(param_1 + 0x20) == *(long *)(param_1 + 0x18)) { _obstack_newchunk(param_1,1); } puVar1 = *(undefined **)(param_1 + 0x18); *(undefined **)(param_1 + 0x18) = puVar1 + 1; *puVar1 = 0x54; sVar2 = strlen(param_3); uVar3 = sVar2 + 1; if ((ulong)(*(long *)(param_1 + 0x20) - *(long *)(param_1 + 0x18)) < uVar3) { _obstack_newchunk(param_1,uVar3); } memcpy(*(void **)(param_1 + 0x18),param_3,uVar3); *(ulong *)(param_1 + 0x18) = *(long *)(param_1 + 0x18) + uVar3; return; }
int unbind_unix_command (kseq) char *kseq; { Keymap cmd_xmap; cmd_xmap = get_cmd_xmap_from_keymap (rl_get_keymap ()); if (rl_bind_keyseq_in_map (kseq, (rl_command_func_t *) ((void *)0) , cmd_xmap) != 0) { builtin_error (gettext("`%s': cannot unbind in command keymap"), kseq); return 0; } return 1; }
long long unbind_unix_command(unsigned long long a0) { unsigned long long v0; unsigned long long v2; unsigned long long v3; v0 = get_cmd_xmap_from_keymap(rl_get_keymap()); if (!rl_bind_keyseq_in_map(a0, 0x0, v0)) { v2 = 1; return v2; } v3 = gettext("`%s': cannot unbind in command keymap"); builtin_error(v3, a0, v3); v2 = 0; return v2; }
void usage (int status) { if (status != 0 ) do { fprintf ( stderr , gettext ("Try '%s --help' for more information.\n"), program_name); } while (0); else { printf (gettext ("Usage: %s [OPTION]... [FILE]...\n or: %s [OPTION]... --files0-from=F\n") , program_name, program_name); fputs_unlocked (gettext ("Print newline, word, and byte counts for each FILE, and a total line if\nmore than one FILE is specified. A word is a non-zero-length sequence of\nprintable characters delimited by white space.\n"), stdout ) ; emit_stdin_note (); fputs_unlocked (gettext ("\nThe options below may be used to select which counts are printed, always in\nthe following order: newline, word, character, byte, maximum line length.\n -c, --bytes print the byte counts\n -m, --chars print the character counts\n -l, --lines print the newline counts\n"), stdout ) ; fputs_unlocked (gettext (" --files0-from=F read input from the files specified by\n NUL-terminated names in file F;\n If F is - then read names from standard input\n -L, --max-line-length print the maximum display width\n -w, --words print the word counts\n"), stdout ) ; fputs_unlocked (gettext (" --help display this help and exit\n"), stdout ); fputs_unlocked (gettext (" --version output version information and exit\n"), stdout ); emit_ancillary_info ("wc"); } exit (status); }
void usage(unsigned long a0) { unsigned long v0; unsigned long v1; unsigned long v3; unsigned long v4; v1 = v3; v0 = v4; if (a0) { fprintf(stderr, gettext("Try '%s --help' for more information.\n")); } else { printf(gettext("Usage: %s [OPTION]... [FILE]...\n or: %s [OPTION]... --files0-from=F\n")); fputs_unlocked(gettext("Print newline, word, and byte counts for each FILE, and a total line if\nmore than one FILE is specified. A word is a non-zero-length sequence of\nprintable characters delimited by white space.\n"), stdout); emit_stdin_note(); fputs_unlocked(gettext("\nThe options below may be used to select which counts are printed, always in\nthe following order: newline, word, character, byte, maximum line length.\n -c, --bytes print the byte counts\n -m, --chars print the character counts\n -l, --lines print the newline counts\n"), stdout); fputs_unlocked(gettext(" --files0-from=F read input from the files specified by\n NUL-terminated names in file F;\n If F is - then read names from standard input\n -L, --max-line-length print the maximum display width\n -w, --words print the word counts\n"), stdout); fputs_unlocked(gettext(" --help display this help and exit\n"), stdout); fputs_unlocked(gettext(" --version output version information and exit\n"), stdout); emit_ancillary_info("wc"); } exit(a0); }
static char * format_date (struct timespec ts, int kind) { enum { NS_BUF_LEN = 32, DATE_LEN_PERCENT_APLUS=21 }; static char buf[128u+10u + ((DATE_LEN_PERCENT_APLUS) > (((((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * ( 16 + 1) - 16 + 1 + 3) + 2) > (NS_BUF_LEN+64+200) ? (((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * ( 16 + 1) - 16 + 1 + 3) + 2) : (NS_BUF_LEN+64+200))) ? (DATE_LEN_PERCENT_APLUS) : (((((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * ( 16 + 1) - 16 + 1 + 3) + 2) > (NS_BUF_LEN+64+200) ? (((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * ( 16 + 1) - 16 + 1 + 3) + 2) : (NS_BUF_LEN+64+200)))) ]; char ns_buf[NS_BUF_LEN]; int charsprinted, need_ns_suffix; struct tm *tm; char fmt[12]; _Static_assert (sizeof (buf) >= ((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * ( 16 + 1) - 16 + 1 + 3), "verify (" "sizeof (buf) >= LONGEST_HUMAN_READABLE" ")"); charsprinted = 0; need_ns_suffix = 0; if (kind == '+') { strcpy (fmt, "%Y-%m-%d+%T"); need_ns_suffix = 1; } else { fmt[0] = '%'; fmt[1] = kind; fmt[2] = '\0'; switch (kind) { case 'S': case 'T': case 'X': case '@': need_ns_suffix = 1; break; default: need_ns_suffix = 0; break; } } if (need_ns_suffix) { charsprinted = snprintf (ns_buf, NS_BUF_LEN, ".%09ld0", (long int)ts.tv_nsec); ((void) sizeof (( charsprinted < NS_BUF_LEN ) ? 1 : 0), __extension__ ({ if ( charsprinted < NS_BUF_LEN ) ; else __assert_fail ( "charsprinted < NS_BUF_LEN" , "print.c", 665, __extension__ __PRETTY_FUNCTION__); })) ; } else { charsprinted = 0; ns_buf[0] = 0; } if (kind != '@') { tm = localtime (&ts.tv_sec); if (tm) { char *s = do_time_format (fmt, tm, ns_buf, charsprinted); if (s) return s; } } if (1) { uintmax_t w = ts.tv_sec; size_t used, len, remaining; char *p = human_readable (ts.tv_sec < 0 ? -w : w, buf + 1, human_ceiling, 1, 1); ((void) sizeof (( p > buf ) ? 1 : 0), __extension__ ({ if ( p > buf ) ; else __assert_fail ( "p > buf" , "print.c", 697, __extension__ __PRETTY_FUNCTION__); })) ; ((void) sizeof (( p < (buf + (sizeof buf)) ) ? 1 : 0), __extension__ ({ if ( p < (buf + (sizeof buf)) ) ; else __assert_fail ( "p < (buf + (sizeof buf))" , "print.c", 698, __extension__ __PRETTY_FUNCTION__); })) ; if (ts.tv_sec < 0) *--p = '-'; if (need_ns_suffix) { len = strlen (p); used = (p-buf) + len; ((void) sizeof (( sizeof buf > used ) ? 1 : 0), __extension__ ({ if ( sizeof buf > used ) ; else __assert_fail ( "sizeof buf > used" , "print.c", 711, __extension__ __PRETTY_FUNCTION__); })) ; remaining = sizeof buf - used - 1u; if (strlen (ns_buf) >= remaining) { error (0, 0, "charsprinted=%ld but remaining=%lu: ns_buf=%s", (long)charsprinted, (unsigned long)remaining, ns_buf); } ((void) sizeof (( strlen (ns_buf) < remaining ) ? 1 : 0), __extension__ ({ if ( strlen (ns_buf) < remaining ) ; else __assert_fail ( "strlen (ns_buf) < remaining" , "print.c", 720, __extension__ __PRETTY_FUNCTION__); })) ; strcat (p, ns_buf); } return p; } }
int format_date(unsigned long a0, unsigned long a1, unsigned long a2) { char v0; unsigned int v1; unsigned int v2; char *v3; void* v4; unsigned long v5; unsigned long v6; unsigned long v7; unsigned long v8; unsigned long v9; char v10; char v11; char v12; char v13; unsigned long v15; v1 = 0; v2 = 0; if (a2 != 43) { v10 = 37; v11 = a2; v12 = 0; if (24 < a2 - 64 || !((1 << ((a2 - 64) & 63)) & 18350081)) v2 = 0; else v2 = 1; } else { strcpy(&v10, "%Y-%m-%d+%T"); v2 = 1; } if (!v2) { v1 = 0; v13 = 0; } else { v1 = snprintf(&v13, 0x20, ".%09ld0", a1); if (v1 > 31) __assert_fail(); } if (a2 != 64) { v4 = localtime(&v0); if (v4) { v5 = do_time_format(&v10, v4, &v13, v1); if (v5) { v15 = v5; return v15; } } } v6 = a0; v15 = (a0 < 0 ? a0 : -(v6)); v3 = human_readable(v15); if (v3 <= 4204864) { __assert_fail(); } else if (v3 >= 4205655) { __assert_fail(); } else { if (a0 < 0) { v3 += 1; *(v3) = 45; } if (v2) { v7 = strlen(v3); v8 = v7 + v3 - &buf.10503; if (v8 > 790) __assert_fail(); v9 = 790 - v8; if (v9 <= strlen(&v13)) error(0x0, 0x0, "charsprinted=%ld but remaining=%lu: ns_buf=%s"); if (v9 <= strlen(&v13)) __assert_fail(); strcat(v3, &v13); } *(&v15) = v3; return v15; } }
static void name_add_option (int rpl_option, const char *arg) { struct name_elt *elt = name_elt_alloc (); elt->type = NELT_OPTION; elt->v.opt.rpl_option = rpl_option; elt->v.opt.arg = arg; }
_QWORD * name_add_option(int a1, long a2) { _QWORD *result; result = name_elt_alloc(); *((_DWORD *)result + 4) = 4; *((_DWORD *)result + 6) = a1; result[4] = a2; return result; }
static int fdlim_get(int hard) { struct rlimit rlfd; if (getrlimit( RLIMIT_NOFILE , &rlfd) == -1) return (-1); if ((hard ? rlfd.rlim_max : rlfd.rlim_cur) == ((__rlim_t) -1) ) return sysconf( _SC_OPEN_MAX ); else return hard ? rlfd.rlim_max : rlfd.rlim_cur; }
rlim_t fdlim_get(int param_1) { rlim_t rVar1; int iVar2; long in_FS_OFFSET; rlimit local_28; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); iVar2 = getrlimit(RLIMIT_NOFILE,&local_28); if (iVar2 == -1) { local_28.rlim_cur = 0xffffffff; } else { rVar1 = local_28.rlim_cur; if (param_1 != 0) { rVar1 = local_28.rlim_max; } if (rVar1 == 0xffffffffffffffff) { local_28.rlim_cur = sysconf(4); } else if (param_1 != 0) { local_28.rlim_cur = local_28.rlim_max; } } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return local_28.rlim_cur; } __stack_chk_fail(); }
static void process_cmdline(struct ssh *ssh) { void (*handler)(int); char *s, *cmd; int ok, delete = 0, local = 0, remote = 0, dynamic = 0; struct Forward fwd; memset(&fwd, 0, sizeof(fwd)); leave_raw_mode(options.request_tty == 3); handler = ssh_signal( 2 , ((__sighandler_t) 1) ); cmd = s = read_passphrase("\r\nssh> ", 0x0001); if (s == ((void *)0) ) goto out; while ( ((*__ctype_b_loc ())[(int) (( (u_char)*s ))] & (unsigned short int) _ISspace) ) s++; if (*s == '-') s++; if (*s == '\0') goto out; if (*s == 'h' || *s == 'H' || *s == '?') { sshlog("clientloop.c", __func__, 783, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Commands:"); sshlog("clientloop.c", __func__, 784, 0, SYSLOG_LEVEL_INFO, ((void *)0) , " -L[bind_address:]port:host:hostport " "Request local forward") ; sshlog("clientloop.c", __func__, 786, 0, SYSLOG_LEVEL_INFO, ((void *)0) , " -R[bind_address:]port:host:hostport " "Request remote forward") ; sshlog("clientloop.c", __func__, 788, 0, SYSLOG_LEVEL_INFO, ((void *)0) , " -D[bind_address:]port " "Request dynamic forward") ; sshlog("clientloop.c", __func__, 790, 0, SYSLOG_LEVEL_INFO, ((void *)0) , " -KL[bind_address:]port " "Cancel local forward") ; sshlog("clientloop.c", __func__, 792, 0, SYSLOG_LEVEL_INFO, ((void *)0) , " -KR[bind_address:]port " "Cancel remote forward") ; sshlog("clientloop.c", __func__, 794, 0, SYSLOG_LEVEL_INFO, ((void *)0) , " -KD[bind_address:]port " "Cancel dynamic forward") ; if (!options.permit_local_command) goto out; sshlog("clientloop.c", __func__, 798, 0, SYSLOG_LEVEL_INFO, ((void *)0) , " !args " "Execute local command") ; goto out; } if (*s == '!' && options.permit_local_command) { s++; ssh_local_cmd(s); goto out; } if (*s == 'K') { delete = 1; s++; } if (*s == 'L') local = 1; else if (*s == 'R') remote = 1; else if (*s == 'D') dynamic = 1; else { sshlog("clientloop.c", __func__, 820, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Invalid command."); goto out; } while ( ((*__ctype_b_loc ())[(int) (( (u_char)*++s ))] & (unsigned short int) _ISspace) ) ; if (delete) { if (!parse_forward(&fwd, s, 1, 0)) { sshlog("clientloop.c", __func__, 831, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Bad forwarding close specification."); goto out; } if (remote) ok = channel_request_rforward_cancel(ssh, &fwd) == 0; else if (dynamic) ok = channel_cancel_lport_listener(ssh, &fwd, 0, &options.fwd_opts) > 0; else ok = channel_cancel_lport_listener(ssh, &fwd, -1, &options.fwd_opts) > 0; if (!ok) { sshlog("clientloop.c", __func__, 844, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Unknown port forwarding."); goto out; } sshlog("clientloop.c", __func__, 847, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Canceled forwarding."); } else { if (!parse_forward(&fwd, s, dynamic, remote)) { sshlog("clientloop.c", __func__, 850, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Bad forwarding specification."); goto out; } if (local || dynamic) { if (!channel_setup_local_fwd_listener(ssh, &fwd, &options.fwd_opts)) { sshlog("clientloop.c", __func__, 856, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Port forwarding failed."); goto out; } } else { if (channel_request_remote_forwarding(ssh, &fwd) < 0) { sshlog("clientloop.c", __func__, 861, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Port forwarding failed."); goto out; } } sshlog("clientloop.c", __func__, 865, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Forwarding port."); } out: ssh_signal( 2 , handler); enter_raw_mode(options.request_tty == 3); free(cmd); free(fwd.listen_host); free(fwd.listen_path); free(fwd.connect_host); free(fwd.connect_path); }
void process_cmdline(unsigned long long a0) { unsigned long long v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; char *v6; unsigned long long v7; char *v8; char v9; char v10; char v11; char v12; char v13; unsigned int v16; unsigned int v17; unsigned long long *v21; unsigned long long v22; v2 = 0; v3 = 0; v4 = 0; v5 = 0; memset(&v9, 0x0, 0x38); leave_raw_mode(*(5247956) == 3); v7 = ssh_signal(0x2, 0x1); v6 = read_passphrase("\r\nssh> ", 0x1); v8 = v6; if (v6) { while (true) { v16 = *((*(v6) * 2 + *(__ctype_b_loc()))) & 0x2000; if (!v16) break; v6 += 1; } if (*(v6) == 45) v6 += 1; if (*(v6)) { if (*(v6) == 104) { LABEL_401abf: v0 = "Commands:"; sshlog("clientloop.c", "process_cmdline", 0x30f, 0x0, 0x3, 0x0); v0 = " -L[bind_address:]port:host:hostport Request local forward"; sshlog("clientloop.c", "process_cmdline", 0x310, 0x0, 0x3, 0x0); v0 = " -R[bind_address:]port:host:hostport Request remote forward"; sshlog("clientloop.c", "process_cmdline", 0x312, 0x0, 0x3, 0x0); v0 = " -D[bind_address:]port Request dynamic forward"; sshlog("clientloop.c", "process_cmdline", 0x314, 0x0, 0x3, 0x0); v0 = " -KL[bind_address:]port Cancel local forward"; sshlog("clientloop.c", "process_cmdline", 0x316, 0x0, 0x3, 0x0); v0 = " -KR[bind_address:]port Cancel remote forward"; sshlog("clientloop.c", "process_cmdline", 0x318, 0x0, 0x3, 0x0); v0 = " -KD[bind_address:]port Cancel dynamic forward"; sshlog("clientloop.c", "process_cmdline", 0x31a, 0x0, 0x3, 0x0); if (*(5247936)) { v0 = " !args Execute local command"; sshlog("clientloop.c", "process_cmdline", 0x31e, 0x0, 0x3, 0x0); } } else { if (*(v6) == 72) goto LABEL_401abf; if (*(v6) == 63) goto LABEL_401abf; if (*(v6) == 33 && *(5247936)) { v6 += 1; ssh_local_cmd(v6); goto LABEL_40208f; } if (*(v6) == 75) { v2 = 1; v6 += 1; } if (*(v6) == 76) { v3 = 1; } else if (*(v6) == 82) { v4 = 1; } else if (*(v6) == 68) { v5 = 1; } else { v0 = "Invalid command."; sshlog("clientloop.c", "process_cmdline", 0x334, 0x0, 0x3, 0x0); goto LABEL_40208f; } do { v6 += 1; *(&v16) = *((*(v6) * 2 + *(__ctype_b_loc()))); v17 = v16 & 0x2000; } while (v17); if (v2) { if (!parse_forward(&v9, v6, 0x1, 0x0)) { v0 = "Bad forwarding close specification."; sshlog("clientloop.c", "process_cmdline", 0x33f, 0x0, 0x3, 0x0); } else { if (v4) { v1 = !channel_request_rforward_cancel(a0, &v9, &v9); } else if (!v5) { v1 = channel_cancel_lport_listener(a0, &v9, 0xffffffff, strlen) > 0; } else { v1 = channel_cancel_lport_listener(a0, &v9, 0x0, strlen) > 0; } if (!v1) { v0 = "Unknown port forwarding."; sshlog("clientloop.c", "process_cmdline", 0x34c, 0x0, 0x3, 0x0); } else { v0 = "Canceled forwarding."; sshlog("clientloop.c", "process_cmdline", 0x34f, 0x0, 0x3, 0x0); } } } else { if (!parse_forward(&v9, v6, v5, v4)) { v0 = "Bad forwarding specification."; sshlog("clientloop.c", "process_cmdline", 0x352, 0x0, 0x3, 0x0); } else if (v3) { LABEL_401f8c: if (!channel_setup_local_fwd_listener(a0, &v9, strlen, &v9)) { v0 = "Port forwarding failed."; sshlog("clientloop.c", "process_cmdline", 0x358, 0x0, 0x3, 0x0); } } else { if (!(!v5)) goto LABEL_401f8c; if (channel_request_remote_forwarding(a0, &v9, &v9) < 0) { v0 = "Port forwarding failed."; sshlog("clientloop.c", "process_cmdline", 0x35d, 0x0, 0x3, 0x0); goto LABEL_40208f; } v0 = "Forwarding port."; sshlog("clientloop.c", "process_cmdline", 0x361, 0x0, 0x3, 0x0); } } } } } LABEL_40208f: ssh_signal(0x2, v7); enter_raw_mode(*(5247956) == 3); free(v8); free(*(&v9)); free(*(&v10)); free(*(&v11)); free(*(&v12)); v22 = *(&v13) ^ v21[5]; return; }
COMMAND * make_bare_simple_command () { COMMAND *command; SIMPLE_COM *temp; command = (COMMAND *)sh_xmalloc((sizeof (COMMAND)), "make_cmd.c", 501); command->value.Simple = temp = (SIMPLE_COM *)sh_xmalloc((sizeof (SIMPLE_COM)), "make_cmd.c", 502); temp->flags = 0; temp->line = line_number; temp->words = (WORD_LIST *) ((void *)0) ; temp->redirects = (REDIRECT *) ((void *)0) ; command->type = cm_simple; command->redirects = (REDIRECT *) ((void *)0) ; command->flags = 0; return (command); }
int make_bare_simple_command() { struct_0 *v0; struct_1 *v1; v0 = sh_xmalloc(0x20, "make_cmd.c", 0x1f5); v1 = sh_xmalloc(0x18, "make_cmd.c", 0x1f6); v0->field_18 = v1; v1->field_0 = 0; v1->field_4 = line_number; v1->field_8 = 0; v1->field_10 = 0; v0->field_0 = 4; v0->field_10 = 0; v0->field_4 = 0; return v0; }
static void ipnh_cache_unlink_entry(struct nh_entry *nhe) { hlist_del(&nhe->nh_hash); }
void ipnh_cache_unlink_entry(void* a0) { unsigned long long v1; v1 = hlist_del(a0); return; }
int _rl_null_function (int count, int key) { return 0; }
long long _rl_null_function(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned int v1; v1 = a0; v0 = a1; return 0; }
static void readline_default_bindings (void) { if (_rl_bind_stty_chars) rl_tty_set_default_bindings (_rl_keymap); }
long long readline_default_bindings() { unsigned long long v1; v1 = _rl_bind_stty_chars; if (_rl_bind_stty_chars) v1 = rl_tty_set_default_bindings(_rl_keymap); return v1; }
static void rmspace(u_char *buf, size_t len) { size_t i; if (!len) return; for (i = len - 1; i > 0; i--) if (i == len - 1 || buf[i] == ' ') buf[i] = '\0'; else break; }
void rmspace(char *a0, unsigned long a1) { char *v0; unsigned long long v2; unsigned long long v3; unsigned long long v4; if (a1) { v2 = a1 - 1; v0 = a1 - 1; while (true) { if (!v0) break; if (v0 != a1 - 1) { v3 = *((v0 + a0)); if (*((v0 + a0)) != 32) break; } v4 = v0 + a0; *((v0 + a0)) = 0; v0 += 1; } } return; }
static __inline void _rs_random_u32(uint32_t *val) { unsigned char *keystream; _rs_stir_if_needed(sizeof(*val)); if (rs->rs_have < sizeof(*val)) _rs_rekey( ((void *)0) , 0); keystream = rsx->rs_buf + sizeof(rsx->rs_buf) - rs->rs_have; memcpy(val, keystream, sizeof(*val)); memset(keystream, 0, sizeof(*val)); rs->rs_have -= sizeof(*val); }
void _rs_random_u32(void* a0) { void* v0; unsigned long long *v2; _rs_stir_if_needed(0x4); if (*(rs) <= 3) _rs_rekey(NULL, 0x0); v0 = 0x400 - *(rs) + rsx + 64; memcpy(a0, v0, 0x4); memset(v0, 0x0, 0x4); v2 = rs; *(rs) = *(rs) - 4; return; }
vi_replace_char(EditLine *el, wint_t c __attribute__((__unused__))) { if (el->el_line.cursor >= el->el_line.lastchar) return 6; el->el_map.current = el->el_map.key; el->el_state.inputmode = 2; cv_undo(el); return 3; }
long vi_replace_char(long a1) { if ( *(_QWORD *)(a1 + 88) >= *(_QWORD *)(a1 + 96) ) return 6LL; *(_QWORD *)(a1 + 1024) = *(_QWORD *)(a1 + 1016); *(_DWORD *)(a1 + 112) = 2; cv_undo(a1); return 3LL; }
void setproctitle(const char *fmt, ...) { va_list ap; char buf[1024], ptitle[1024]; size_t len = 0; int r; if (argv_env_len <= 0) return; strlcpy(buf, __progname, sizeof(buf)); r = -1; __builtin_va_start( ap , fmt ) ; if (fmt != ((void *)0) ) { len = strlcat(buf, ": ", sizeof(buf)); if (len < sizeof(buf)) r = vsnprintf(buf + len, sizeof(buf) - len , fmt, ap); } __builtin_va_end( ap ) ; if (r == -1 || (size_t)r >= sizeof(buf) - len) return; strnvis(ptitle, buf, sizeof(ptitle), 0x02|0x10|0x08|0x01); len = strlcpy(argv_start, ptitle, argv_env_len); for(; len < argv_env_len; len++) argv_start[len] = '\0'; }
long long setproctitle() { unsigned int v0; void* v1; unsigned int v2; unsigned int v3; unsigned long v4; unsigned long v5; char v6; char v7; unsigned long v8; char v9; unsigned long v10; unsigned long v11; unsigned long v12; unsigned long v13; unsigned long v14; int v15; int v16; int v17; int v18; int v19; int v20; int v21; int v22; unsigned long v23; unsigned long v24; unsigned long v25; unsigned long v26; unsigned long v27; unsigned long v28; char v29; int v30; int v31; int v32; int v33; int v34; int v35; int v36; int v37; unsigned long long *v38; char *v39; v10 = v24; v11 = v25; v12 = v26; v13 = v27; v14 = v28; if (v29) { v15 = v30; v16 = v31; v17 = v32; v18 = v33; v19 = v34; v20 = v35; v21 = v36; v22 = v37; } v8 = v38[5]; v1 = 0; if (argv_env_len) { strlcpy(&v6, *(got.__progname), 0x400, *(got.__progname)); v0 = -1; v2 = 8; v3 = 48; v4 = &v23; v5 = &v9; if (v39) { v1 = strlcat(&v6, ": ", 0x400); if (v1 <= 1023) v0 = vsnprintf(&v6 + v1, 0x400 - v1, v39, &v2); } if (v0 != -1 && v0 < 0x400 - v1) { strnvis(&v7, &v6, 0x400, 0x1b); for (v1 = strlcpy(argv_start, &v7, argv_env_len, &v7); v1 < argv_env_len; v1 += 1) { v1[argv_start] = 0; } goto LABEL_4004bb; } } LABEL_4004bb: if (!(v8 ^ v38[5])) return 0; __stack_chk_fail(); }
: !just_group && (just_group_list || !just_context)) { (*__errno_location ()) = 0; ruid = getuid (); if (ruid == NO_UID && (*__errno_location ()) ) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"cannot get real UID\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , gettext ("cannot get real UID")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , gettext ("cannot get real UID")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); }
int * __errno_location(void) { halt_baddata(); }
static _Bool selected_fstype (char const *fstype) { const struct fs_type_list *fsp; if (fs_select_list == ((void *)0) || fstype == ((void *)0) ) return 1 ; for (fsp = fs_select_list; fsp; fsp = fsp->fs_next) if ((strcmp (fstype, fsp->fs_name) == 0)) return 1 ; return 0 ; }
int selected_fstype(char *a0) { unsigned long long v0[2]; unsigned int v2; if (!fs_select_list) { LABEL_401122: v2 = 1; } else { if (!a0) goto LABEL_401122; v0[0] = fs_select_list; while (true) { if (!v0) { v2 = 0; break; } else if (strcmp(a0, v0[0])) { v0[0] = v0[1]; } else { v2 = 1; break; } } } return v2; }
int main (int argc, char **argv) { int optc; char const *datestr = ((void *)0) ; char const *set_datestr = ((void *)0) ; struct timespec when; _Bool set_date = 0 ; char const *format = ((void *)0) ; _Bool get_resolution = 0 ; char *batch_file = ((void *)0) ; char *reference = ((void *)0) ; struct stat refstats; _Bool ok; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdout); while ((optc = getopt_long (argc, argv, short_options, long_options, ((void *)0) )) != -1) { char const *new_format = ((void *)0) ; switch (optc) { case 'd': datestr = optarg; break; case DEBUG_DATE_PARSING_OPTION: parse_datetime_flags |= 1; break; case 'f': batch_file = optarg; break; case RESOLUTION_OPTION: get_resolution = 1 ; break; case RFC_3339_OPTION: { static char const rfc_3339_format[][32] = { "%Y-%m-%d", "%Y-%m-%d %H:%M:%S%:z", "%Y-%m-%d %H:%M:%S.%N%:z" }; enum Time_spec i = ((time_spec + 2) [__xargmatch_internal ("--rfc-3339", optarg, time_spec_string + 2, (void const *) (time_spec + 2), sizeof *(time_spec + 2), argmatch_die, 1 )]) ; new_format = rfc_3339_format[i]; break; } case 'I': { static char const iso_8601_format[][32] = { "%Y-%m-%d", "%Y-%m-%dT%H:%M:%S%:z", "%Y-%m-%dT%H:%M:%S,%N%:z", "%Y-%m-%dT%H%:z", "%Y-%m-%dT%H:%M%:z" }; enum Time_spec i = (optarg ? ((time_spec) [__xargmatch_internal ("--iso-8601", optarg, time_spec_string, (void const *) (time_spec), sizeof *(time_spec), argmatch_die, 1 )]) : TIME_SPEC_DATE); new_format = iso_8601_format[i]; break; } case 'r': reference = optarg; break; case 'R': new_format = rfc_email_format; break; case 's': set_datestr = optarg; set_date = 1 ; break; case 'u': if (putenv (bad_cast ("TZ=UTC0")) != 0) xalloc_die (); ; break; case GETOPT_HELP_CHAR: usage ( 0 ); break;; case GETOPT_VERSION_CHAR: version_etc ( stdout , "date", "GNU coreutils", Version, ("David MacKenzie"), (char *) ((void *)0) ); exit ( 0 ); break;; default: usage ( 1 ); } if (new_format) { if (format) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"multiple output formats specified\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("multiple output formats specified")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("multiple output formats specified")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); format = new_format; } } int option_specified_date = (!!datestr + !!batch_file + !!reference + get_resolution); if (option_specified_date > 1) { error (0, 0, gettext ("the options to specify dates for printing are mutually exclusive")); usage ( 1 ); } if (set_date && option_specified_date) { error (0, 0, gettext ("the options to print and set the time may not be used together")); usage ( 1 ); } if (optind < argc) { if (optind + 1 < argc) { error (0, 0, gettext ("extra operand %s"), quote (argv[optind + 1])); usage ( 1 ); } if (argv[optind][0] == '+') { if (format) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"multiple output formats specified\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("multiple output formats specified")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("multiple output formats specified")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); format = argv[optind++] + 1; } else if (set_date || option_specified_date) { error (0, 0, gettext ("the argument %s lacks a leading '+';\n" "when using an option to specify date(s), any non-option\n" "argument must be a format string beginning with '+'") , quote (argv[optind])); usage ( 1 ); } } if (!format) { if (get_resolution) format = "%s.%N"; else { format = nl_langinfo ( _DATE_FMT ); if (! *format) format = "%a %b %e %H:%M:%S %Z %Y"; } } char *format_copy = adjust_resolution (format); char const *format_res = format_copy ? format_copy : format; char const *tzstring = getenv ("TZ"); timezone_t tz = tzalloc (tzstring); if (batch_file != ((void *)0) ) ok = batch_convert (batch_file, format_res, tz, tzstring); else { _Bool valid_date = 1 ; ok = 1 ; if (!option_specified_date && !set_date) { if (optind < argc) { set_date = 1 ; datestr = argv[optind]; valid_date = posixtime (&when.tv_sec, datestr, (1 | 2 | 4)); when.tv_nsec = 0; } else { gettime (&when); } } else { if (reference != ((void *)0) ) { if (stat (reference, &refstats) != 0) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", quotearg_n_style_colon (0, shell_escape_quoting_style, reference)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, reference)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, reference)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); when = get_stat_mtime (&refstats); } else if (get_resolution) { long int res = gettime_res (); when.tv_sec = res / TIMESPEC_HZ; when.tv_nsec = res % TIMESPEC_HZ; } else { if (set_datestr) datestr = set_datestr; valid_date = parse_datetime2 (&when, datestr, ((void *)0) , parse_datetime_flags, tz, tzstring); } } if (! valid_date) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"invalid date %s\"), quote (datestr)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("invalid date %s"), quote (datestr)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("invalid date %s"), quote (datestr)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (set_date) { if (settime (&when) != 0) { error (0, (*__errno_location ()) , gettext ("cannot set date")); ok = 0 ; } } ok &= show_date (format_res, when, tz); } return ok ? 0 : 1 ; }
byte main(int param_1,undefined8 *param_2) { bool bVar1; byte bVar2; uint uVar3; int iVar4; undefined8 uVar5; char *pcVar6; long lVar7; undefined8 uVar8; int *piVar9; long in_FS_OFFSET; undefined8 uVar10; char local_133; byte local_132; char local_131; char *local_120; char *local_118; char *local_110; char *local_108; char *local_100; char *local_f8; undefined local_c8 [16]; stat local_b8; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_120 = (char *)0x0; local_118 = (char *)0x0; bVar1 = false; local_110 = (char *)0x0; local_133 = '\0'; local_108 = (char *)0x0; local_100 = (char *)0x0; set_program_name(*param_2); setlocale(6,""); bindtextdomain("coreutils","/usr/local/share/locale"); textdomain("coreutils"); atexit(p_Ram0000000000100a75); do { uVar10 = 0x100d70; iVar4 = getopt_long(param_1,param_2,short_options,long_options,0); if (iVar4 == -1) { bVar2 = local_133 + (local_120 != (char *)0x0) + (local_108 != (char *)0x0) + (local_100 != (char *)0x0); if (1 < bVar2) { uVar10 = gettext("the options to specify dates for printing are mutually exclusive"); error(0,0,uVar10); usage(1); } if ((bVar1) && (bVar2 != 0)) { uVar10 = gettext("the options to print and set the time may not be used together"); error(0,0,uVar10); usage(1); } if (optind < param_1) { if (optind + 1 < param_1) { uVar10 = quote(param_2[(long)optind + 1]); uVar5 = gettext("extra operand %s"); error(0,0,uVar5,uVar10); usage(1); } if (*(char *)param_2[optind] == '+') { if (local_110 != (char *)0x0) { uVar10 = gettext("multiple output formats specified"); error(1,0,uVar10); } local_110 = (char *)(param_2[optind] + 1); optind = optind + 1; } else if ((bVar1) || (bVar2 != 0)) { uVar10 = quote(param_2[optind]); uVar5 = gettext( "the argument %s lacks a leading \'+\';\nwhen using an option to specify date(s), any non-option\nargument must be a format string beginning with \'+\'" ); error(0,0,uVar5,uVar10); usage(1); } } if (local_110 == (char *)0x0) { if (local_133 == '\0') { local_110 = nl_langinfo(0x2006c); if (*local_110 == '\0') { local_110 = "%a %b %e %H:%M:%S %Z %Y"; } } else { local_110 = "%s.%N"; } } pcVar6 = (char *)adjust_resolution(local_110); if (pcVar6 != (char *)0x0) { local_110 = pcVar6; } pcVar6 = getenv("TZ"); uVar10 = tzalloc(pcVar6); if (local_108 == (char *)0x0) { local_131 = '\x01'; local_132 = 1; if ((bVar2 != 0) || (bVar1)) { if (local_100 == (char *)0x0) { if (local_133 == '\0') { if (local_118 != (char *)0x0) { local_120 = local_118; } local_131 = parse_datetime2(local_c8,local_120,0,parse_datetime_flags,uVar10,pcVar6); } else { lVar7 = gettime_res(); local_c8 = CONCAT88(lVar7 % 1000000000,lVar7 / 1000000000); } } else { iVar4 = stat(local_100,&local_b8); if (iVar4 != 0) { uVar5 = quotearg_n_style_colon(0,3,local_100); piVar9 = __errno_location(); error(1,*piVar9,&DAT_00102a61,uVar5); } local_c8 = get_stat_mtime(&local_b8); } } else if (optind < param_1) { bVar1 = true; local_120 = (char *)param_2[optind]; local_131 = posixtime(local_c8,local_120,7); local_c8 = ZEXT816(local_c8._0_8_); } else { gettime(local_c8); } if (local_131 != '\x01') { uVar5 = quote(local_120); uVar8 = gettext("invalid date %s"); error(1,0,uVar8,uVar5); } if (bVar1) { iVar4 = settime(local_c8); if (iVar4 != 0) { uVar5 = gettext("cannot set date"); piVar9 = __errno_location(); error(0,*piVar9,uVar5); local_132 = 0; } } local_c8._8_8_ = SUB168(local_c8 >> 0x40,0); bVar2 = show_date(local_110,local_c8._0_8_,local_c8._8_8_,uVar10); local_132 = (bVar2 & local_132) != 0; } else { local_132 = batch_convert(local_108,local_110,uVar10,pcVar6); } if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return local_132 ^ 1; } local_f8 = (char *)0x0; if (iVar4 < 0x83) { if (iVar4 < 0x49) { if (iVar4 == -0x83) goto LAB_00100cb5; if (iVar4 == -0x82) goto LAB_00100cab; goto switchD_00100afd_caseD_4a; } switch(iVar4) { case 0x49: if (optarg == (char *)0x0) { uVar3 = 0; } else { lVar7 = __xargmatch_internal ("--iso-8601",optarg,time_spec_string,time_spec,4,argmatch_die,1,uVar10) ; uVar3 = *(uint *)(time_spec + lVar7 * 4); } local_f8 = iso_8601_format_6307 + (ulong)uVar3 * 0x20; break; default: goto switchD_00100afd_caseD_4a; case 0x52: local_f8 = "%a, %d %b %Y %H:%M:%S %z"; break; case 100: local_120 = optarg; break; case 0x66: local_108 = optarg; break; case 0x72: local_100 = optarg; break; case 0x73: local_118 = optarg; bVar1 = true; break; case 0x75: pcVar6 = (char *)bad_cast("TZ=UTC0"); iVar4 = putenv(pcVar6); if (iVar4 != 0) { xalloc_die(); LAB_00100cab: usage(0); LAB_00100cb5: version_etc(stdout,&DAT_001016e9,"GNU coreutils",Version,"David MacKenzie",0); exit(0); } break; case 0x80: parse_datetime_flags = parse_datetime_flags | 1; break; case 0x81: local_133 = '\x01'; break; case 0x82: lVar7 = __xargmatch_internal("--rfc-3339",optarg,0x102e70,0x101708,4,argmatch_die,1,uVar10); local_f8 = rfc_3339_format_6304 + (ulong)*(uint *)(time_spec + (lVar7 + 2) * 4) * 0x20; } } else { switchD_00100afd_caseD_4a: usage(); } if (local_f8 != (char *)0x0) { if (local_110 != (char *)0x0) { uVar10 = gettext("multiple output formats specified"); error(1,0,uVar10); } local_110 = local_f8; } } while( true ); }
static void clear_files (void) { for (size_t i = 0; i < cwd_n_used; i++) { struct fileinfo *f = sorted_file[i]; free_ent (f); } cwd_n_used = 0; cwd_some_quoted = 0 ; any_has_acl = 0 ; inode_number_width = 0; block_size_width = 0; nlink_width = 0; owner_width = 0; group_width = 0; author_width = 0; scontext_width = 0; major_device_number_width = 0; minor_device_number_width = 0; file_size_width = 0; }
void clear_files() { void* v0; unsigned long long v1; unsigned long long v3; v0 = 0; while (true) { v3 = cwd_n_used; if (v0 >= cwd_n_used) break; v1 = *((sorted_file + v0 * 8)); free_ent(v1); v0 += 1; } cwd_n_used = 0; cwd_some_quoted = 0; any_has_acl = 0; inode_number_width = 0; block_size_width = 0; nlink_width = 0; owner_width = 0; group_width = 0; author_width = 0; scontext_width = 0; major_device_number_width = 0; minor_device_number_width = 0; file_size_width = 0; return; }
static struct directory * note_directory (char const *name, struct timespec mtime, dev_t dev, ino_t ino, _Bool nfs, _Bool found, const char *contents) { struct directory *directory = attach_directory (name); directory->mtime = mtime; directory->device_number = dev; directory->inode_number = ino; directory->children = CHANGED_CHILDREN; if (nfs) (directory)->flags |= (0x0002); if (found) (directory)->flags |= (0x0004); if (contents) directory->dump = dumpdir_create (contents); else directory->dump = ((void *)0) ; if (! ((directory_table || (directory_table = hash_initialize (0, 0, hash_directory_canonical_name, compare_directory_canonical_names, 0))) && hash_insert (directory_table, directory))) xalloc_die (); if (! ((directory_meta_table || (directory_meta_table = hash_initialize (0, 0, hash_directory_meta, compare_directory_meta, 0))) && hash_insert (directory_meta_table, directory))) xalloc_die (); return directory; }
int note_directory(char *a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5, unsigned int v2, void* a6) { char v0; struct_0 *v1; v0 = v2; v1 = attach_directory(a0); v1->field_8 = a1; v1->field_10 = a2; v1->field_18 = a3; v1->field_20 = a4; v1->field_38 = 1; if (a5) v1->field_3c = v1->field_3c | 2; if (v0) v1->field_3c = v1->field_3c | 4; if (!a6) v1->field_28 = 0; else v1->field_28 = dumpdir_create(a6); if (!directory_table) { directory_table = hash_initialize(0x0, 0x0, hash_directory_canonical_name, compare_directory_canonical_names, 0x0); if (!directory_table) goto LABEL_40091d; } if (hash_insert(directory_table, v1, v1)) { if (!directory_meta_table) { directory_meta_table = hash_initialize(0x0, 0x0, hash_directory_meta, compare_directory_meta, 0x0); if (!directory_meta_table) goto LABEL_40097f; } if (hash_insert(directory_meta_table, v1, v1)) return v1; LABEL_40097f: xalloc_die(); } LABEL_40091d: xalloc_die(); }
int unwind_protect_tag_on_stack (tag) const char *tag; { UNWIND_ELT *elt; elt = unwind_protect_list; while (elt) { if (elt->head.cleanup == 0 && ((elt->arg.v)[0] == (tag)[0] && strcmp(elt->arg.v, tag) == 0)) return 1; elt = elt->head.next; } return 0; }
undefined8 unwind_protect_tag_on_stack(char *param_1) { int iVar1; undefined8 *local_10; local_10 = unwind_protect_list; while( true ) { if (local_10 == (undefined8 *)0x0) { return 0; } if (((local_10[1] == 0) && (*(char *)local_10[2] == *param_1)) && (iVar1 = strcmp((char *)local_10[2],param_1), iVar1 == 0)) break; local_10 = (undefined8 *)*local_10; } return 1; }
test_code_t test_version_rollback(gnutls_session_t session) { int ret; if (tls1_ok == 0) return TEST_IGNORE; sprintf(prio_str, "NONE:" "+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL" ":%s:" "+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":" "+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH" ":+VKO-GOST-12" ":%s", protocol_str, rest); { int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 1398)) != TEST_SUCCEED) { return _ret; } }; gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred); _gnutls_record_set_default_version(session, 3, 0); ret = test_do_handshake(session); if (ret != TEST_SUCCEED) return ret; if (tls1_ok != 0 && gnutls_protocol_get_version(session) == GNUTLS_SSL3) return TEST_FAILED; return TEST_SUCCEED; }
long long test_version_rollback(unsigned long long a0) { unsigned int v0; unsigned int v1; unsigned long long v3; if (!tls1_ok) { v3 = 3; return v3; } sprintf(&prio_str, "NONE:+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC:+GOST28147-TC26Z-CNT:+COMP-NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT:+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH:+VKO-GOST-12:%s", &protocol_str, &rest); v0 = __gnutls_priority_set_direct(a0, &prio_str, 0x576); if (v0) { v3 = v0; return v3; } gnutls_credentials_set(a0, 0x1, xcred); _gnutls_record_set_default_version(a0, 0x3, 0x0); v1 = test_do_handshake(a0); if (v1) { v3 = v1; return v3; } else if (!tls1_ok) { v3 = 0; return v3; } else if (gnutls_protocol_get_version(a0) != 1) { v3 = 0; return v3; } else { v3 = 1; return v3; } }
int do_mkdir(struct sftp_conn *conn, const char *path, Attrib *a, int print_flag) { u_int status, id; sshlog("sftp-client.c", __func__, 873, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "Sending SSH2_FXP_MKDIR \"%s\"", path); id = conn->msg_id++; send_string_attrs_request(conn, id, 14, path, strlen(path), a); status = get_status(conn, id); if (status != 0 && print_flag) sshlog("sftp-client.c", __func__, 881, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "remote mkdir \"%s\": %s", path, fx2txt(status)); return status == 0 ? 0 : -1; }
long do_mkdir(unsigned int *a1, const char *a2, unsigned int *a3, int a4) { unsigned int v4; unsigned int v5; const char *v6; unsigned int v10; unsigned int status; sshlog("sftp-client.c", "do_mkdir", 873LL, 0LL, 6LL, 0LL, "Sending SSH2_FXP_MKDIR \"%s\"", a2); v4 = a1[6]; a1[6] = v4 + 1; v10 = v4; v5 = strlen(a2); send_string_attrs_request((long)a1, v10, 0xEu, (long)a2, v5, a3); status = get_status(a1, v10); if ( status && a4 ) { v6 = (const char *)fx2txt(status); sshlog("sftp-client.c", "do_mkdir", 881LL, 0LL, 2LL, 0LL, "remote mkdir \"%s\": %s", a2, v6); } if ( status ) return 0xFFFFFFFFLL; else return 0LL; }
char * rl_copy_text(int from, int to) { const LineInfo *li; size_t len; char * out; if (h == ((void *)0) || e == ((void *)0) ) rl_initialize(); li = el_line(e); if (from > to) return ((void *)0) ; if (li->buffer + from > li->lastchar) from = (int)(li->lastchar - li->buffer); if (li->buffer + to > li->lastchar) to = (int)(li->lastchar - li->buffer); len = (size_t)(to - from); out = malloc((size_t)len + 1); (void)strlcpy(out, li->buffer + from , len); return out; }
long long rl_copy_text(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned int v1; unsigned long long v2[3]; unsigned long long v3; unsigned long long v4; void* v6; v1 = a0; v0 = a1; if (!h || !e) rl_initialize(); v2[0] = el_line(e); if (v1 > v0) { v6 = 0; } else { if (v2[0] + v1 > v2[2]) v1 = v2[2] - v2[0]; if (v2[0] + v0 > v2[2]) v0 = v2[2] - v2[0]; v3 = v0 - v1; v4 = malloc(v3 + 1); strlcpy(v4, v2[0] + v1, v3, v2[0] + v1); v6 = v4; } return v6; }
static void uhash_init(uhash_ctx_t ahc, aes_int_key prf_key) { int i; UINT8 buf[(8*(16 / 4)+4)*sizeof(UINT64)]; memset(ahc, 0, sizeof(uhash_ctx)); nh_init(&ahc->hash, prf_key); kdf(buf, prf_key, 2, sizeof(buf)); for (i = 0; i < (16 / 4); i++) { memcpy(ahc->poly_key_8+i, buf+24*i, 8); endian_convert((ahc->poly_key_8+i),(8),(8)); ahc->poly_key_8[i] &= ((UINT64)0x01ffffffu << 32) + 0x01ffffffu; ahc->poly_accum[i] = 1; } kdf(buf, prf_key, 3, sizeof(buf)); for (i = 0; i < (16 / 4); i++) memcpy(ahc->ip_keys+4*i, buf+(8*i+4)*sizeof(UINT64), 4*sizeof(UINT64)); endian_convert((ahc->ip_keys),(sizeof(UINT64)),(sizeof(ahc->ip_keys))) ; for (i = 0; i < (16 / 4)*4; i++) ahc->ip_keys[i] %= ((UINT64)0x0000000FFFFFFFFBull); kdf(ahc->ip_trans, prf_key, 4, (16 / 4) * sizeof(UINT32)); endian_convert((ahc->ip_trans),(sizeof(UINT32)),((16 / 4) * sizeof(UINT32))) ; explicit_bzero(buf, sizeof(buf)); }
void uhash_init(unsigned long a0, unsigned long long a1) { unsigned int v0; char v1; char v2; char v3; unsigned long long *v5; unsigned long long v6; memset(a0, 0x0, 0x570); nh_init(a0, a1); kdf(&v1, a1, 0x2, 0x120); for (v0 = 0; v0 <= 3; v0 = __addvsi3(v0, 0x1)) { memcpy(v0 * 8 + a0 + 1176, &(&v1)[__mulvsi3(v0, 0x18)], 0x8); endian_convert(v0 * 8 + a0 + 1176, 0x8, 0x8); *((a0 + (v0 + 146) * 8 + 8)) = *((a0 + (v0 + 146) * 8 + 8)) & 144115183814443007; *((a0 + (v0 + 150) * 8 + 8)) = 1; } kdf(&v1, a1, 0x3, 0x120); for (v0 = 0; v0 <= 3; v0 = __addvsi3(v0, 0x1)) { memcpy(v0 * 32 + a0 + 1240, &(&v2)[64 * v0], 0x20); } endian_convert(a0 + 1240, 0x8, 0x80); for (v0 = 0; v0 <= 15; v0 = __addvsi3(v0, 0x1)) { *((a0 + (v0 + 154) * 8 + 8)) = ...; } kdf(a0 + 1368, a1, 0x4, 0x10); endian_convert(a0 + 1368, 0x4, 0x10); explicit_bzero(&v1, 0x120); v6 = *(&v3) ^ v5[5]; return; }
static void do_convert_from_pkcs8(struct sshkey **k, int *private) { EVP_PKEY *pubkey; FILE *fp; if ((fp = fopen(identity_file, "r")) == ((void *)0) ) sshfatal("ssh-keygen.c", __func__, 694, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s: %s: %s", __progname, identity_file, strerror( (*__errno_location ()) )); if ((pubkey = PEM_read_PUBKEY(fp, ((void *)0) , ((void *)0) , ((void *)0) )) == ((void *)0) ) { sshfatal("ssh-keygen.c", __func__, 696, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "%s is not a recognised public key format", identity_file) ; } fclose(fp); switch ( EVP_PKEY_get_base_id (pubkey)) { case 6 : if ((*k = sshkey_new(KEY_UNSPEC)) == ((void *)0) ) sshfatal("ssh-keygen.c", __func__, 703, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshkey_new failed"); (*k)->type = KEY_RSA; (*k)->rsa = EVP_PKEY_get1_RSA(pubkey); break; case 116 : if ((*k = sshkey_new(KEY_UNSPEC)) == ((void *)0) ) sshfatal("ssh-keygen.c", __func__, 709, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshkey_new failed"); (*k)->type = KEY_DSA; (*k)->dsa = EVP_PKEY_get1_DSA(pubkey); break; case 408 : if ((*k = sshkey_new(KEY_UNSPEC)) == ((void *)0) ) sshfatal("ssh-keygen.c", __func__, 716, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshkey_new failed"); (*k)->type = KEY_ECDSA; (*k)->ecdsa = EVP_PKEY_get1_EC_KEY(pubkey); (*k)->ecdsa_nid = sshkey_ecdsa_key_to_nid((*k)->ecdsa); break; default: sshfatal("ssh-keygen.c", __func__, 723, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "unsupported pubkey type %d", EVP_PKEY_get_base_id (pubkey)) ; } EVP_PKEY_free(pubkey); return; }
long do_convert_from_pkcs8(long *a1) { int *v1; char *v2; int base_id; long v4; long v5; _DWORD *v6; _DWORD *v7; long v8; FILE *stream; long PUBKEY; stream = fopen(&identity_file, "r"); if ( !stream ) { v1 = _errno_location(); v2 = strerror(*v1); sshfatal("ssh-keygen.c", "do_convert_from_pkcs8", 694LL, 0LL, 1LL, 0LL, "%s: %s: %s", _progname, &identity_file, v2); } PUBKEY = PEM_read_PUBKEY(stream, 0LL, 0LL, 0LL); if ( !PUBKEY ) sshfatal( "ssh-keygen.c", "do_convert_from_pkcs8", 696LL, 1LL, 1LL, 0LL, "%s is not a recognised public key format", &identity_file); fclose(stream); base_id = EVP_PKEY_get_base_id(PUBKEY); if ( base_id == 408 ) { *a1 = sshkey_new(14LL); if ( !*a1 ) sshfatal("ssh-keygen.c", "do_convert_from_pkcs8", 716LL, 0LL, 1LL, 0LL, "sshkey_new failed"); *(_DWORD *)*a1 = 2; v6 = (_DWORD *)*a1; *((_QWORD *)v6 + 4) = EVP_PKEY_get1_EC_KEY(PUBKEY); v7 = (_DWORD *)*a1; v7[6] = sshkey_ecdsa_key_to_nid(*(_QWORD *)(*a1 + 32)); } else { if ( base_id > 408 ) { LABEL_19: v8 = EVP_PKEY_get_base_id(PUBKEY); sshfatal("ssh-keygen.c", "do_convert_from_pkcs8", 723LL, 1LL, 1LL, 0LL, "unsupported pubkey type %d", v8); return EVP_PKEY_free(PUBKEY); } if ( base_id == 6 ) { *a1 = sshkey_new(14LL); if ( !*a1 ) sshfatal("ssh-keygen.c", "do_convert_from_pkcs8", 703LL, 0LL, 1LL, 0LL, "sshkey_new failed"); *(_DWORD *)*a1 = 0; v4 = *a1; *(_QWORD *)(v4 + 8) = EVP_PKEY_get1_RSA(PUBKEY); } else { if ( base_id != 116 ) goto LABEL_19; *a1 = sshkey_new(14LL); if ( !*a1 ) sshfatal("ssh-keygen.c", "do_convert_from_pkcs8", 709LL, 0LL, 1LL, 0LL, "sshkey_new failed"); *(_DWORD *)*a1 = 1; v5 = *a1; *(_QWORD *)(v5 + 16) = EVP_PKEY_get1_DSA(PUBKEY); } } return EVP_PKEY_free(PUBKEY); }
static inline void initialize_exit_failure (int status) { if (status != 1 ) exit_failure = status; }
void initialize_exit_failure(int param_1) { if (param_1 != 1) { _exit_failure = param_1; } return; }
void internal_error (const char *format, ...) { va_list args; error_prolog (1); __builtin_va_start( args , format ) ; vfprintf ( stderr , format, args); fprintf ( stderr , "\n"); __builtin_va_end( args ) ; }
unsigned long internal_error(const char *a1, long a2, long a3, long a4, long a5, long a6, ...) { gcc_va_list arg; unsigned long v8; long v9; long v10; long v11; long v12; long v13; va_start(arg, a6); v9 = a2; v10 = a3; v11 = a4; v12 = a5; v13 = a6; v8 = __readfsqword(0x28u); error_prolog(1); arg[0].gp_offset = 8; vfprintf(stderr, a1, arg); fprintf(stderr, "\n"); return __readfsqword(0x28u) ^ v8; }
COMMAND * make_function_def (name, command, lineno, lstart) WORD_DESC *name; COMMAND *command; int lineno, lstart; { FUNCTION_DEF *temp; SHELL_VAR *bash_source_v; ARRAY *bash_source_a; temp = (FUNCTION_DEF *)sh_xmalloc((sizeof (FUNCTION_DEF)), "make_cmd.c", 786); temp->command = command; temp->name = name; temp->line = lineno; temp->flags = 0; command->line = lstart; temp->source_file = 0; do { (bash_source_v) = find_variable ("BASH_SOURCE"); (bash_source_a) = ((bash_source_v) && (((((bash_source_v))->attributes) & (0x0000004)))) ? (ARRAY *)((bash_source_v)->value) : (ARRAY *)0; } while (0); if (bash_source_a && ((bash_source_a)->num_elements) > 0) temp->source_file = array_reference (bash_source_a, 0); if (temp->source_file == 0) temp->source_file = shell_initialized ? "main" : "environment"; bind_function_def (name->word, temp, 0); temp->source_file = temp->source_file ? (char *)strcpy (sh_xmalloc((1 + strlen (temp->source_file)), "make_cmd.c", 810), (temp->source_file)) : 0; return (make_command (cm_function_def, (SIMPLE_COM *)temp)); }
long long make_function_def(unsigned long long *a0, struct_0 *a1, unsigned long a2, unsigned long a3) { struct_1 *v0; struct_2 *v1; void* v2; void* v4; unsigned long long v5; void* v6; v0 = sh_xmalloc(0x20, "make_cmd.c", 0x312); v0->field_10 = a1; v0->field_8 = a0; v0->field_4 = a2; v0->field_0 = 0; a1->field_8 = a3; v0->field_18 = 0; v1 = find_variable("BASH_SOURCE"); if (v1 && (v1->field_28 & 4)) { v4 = v1->field_8; goto LABEL_40161f; } v4 = 0; LABEL_40161f: v2 = v4; if (v2 && v2[8] > 0) v0->field_18 = array_reference(v2, 0x0); if (!v0->field_18) { if (shell_initialized) v5 = "main"; else v5 = "environment"; v0->field_18 = v5; } bind_function_def(*(a0), v0, 0x0, v0); if (!v0->field_18) v6 = 0; else v6 = strcpy(sh_xmalloc(strlen(v0->field_18) + 1, "make_cmd.c", 0x32a), v0->field_18); v0->field_18 = v6; return make_command(0x7, v0); }
static _Bool wordchar (wint_t wc) { return wc == L'_' || iswalnum (wc); }
int wordchar(unsigned long a0) { unsigned int v1; unsigned int v2; if (a0 == 95 || iswalnum(a0)) v1 = 1; else v1 = 0; v2 = v1 & 1; return v2; }
static void prepare_new_block ( EState* s ) { Int32 i; s->nblock = 0; s->numZ = 0; s->state_out_pos = 0; { s->blockCRC = 0xffffffffL; }; for (i = 0; i < 256; i++) s->inUse[i] = ((Bool)0); s->blockNo++; }
void prepare_new_block(unsigned int a0[166]) { unsigned int v0; unsigned int v2[166]; a0[27] = 0; a0[29] = 0; a0[30] = 0; a0[162] = -1; for (v0 = 0; v0 <= 255; v0 += 1) { *(128 + &a0[0] + v0) = 0; } v2 = a0; a0[165] = a0[165] + 1; return; }
static int session_shell_req(struct ssh *ssh, Session *s) { int r; if ((r = sshpkt_get_end(ssh)) != 0) sshpkt_fatal(ssh, r, "%s: parse packet", __func__); return do_exec(ssh, s, ((void *)0) ) == 0; }
bool session_shell_req(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6) { int iVar1; iVar1 = sshpkt_get_end(param_1); if (iVar1 != 0) { sshpkt_fatal(param_1,iVar1,"%s: parse packet","session_shell_req",param_5,param_6,param_2); } iVar1 = do_exec(param_1,param_2,0); return iVar1 == 0; }
static void client_cleanup_stdio_fwd(struct ssh *ssh, int id, void *arg) { sshlog("ssh.c", __func__, 1847, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "stdio forwarding: done"); cleanup_exit(0); }
long client_cleanup_stdio_fwd() { int v0; sshlog("ssh.c", "client_cleanup_stdio_fwd", 1847LL, 0LL, 5LL, 0LL, "stdio forwarding: done"); cleanup_exit(0LL); return ssh_stdio_confirm(0LL, (long)"client_cleanup_stdio_fwd", v0); }
void ssh_dispatch_set(struct ssh *ssh, int type, dispatch_fn *fn) { ssh->dispatch[type] = fn; }
long long ssh_dispatch_set(unsigned long long *a0, unsigned long a1, unsigned long a2) { char v0; a0[8 + a1] = *(&v0); return a0; }
void progcomp_create () { if (prog_completes == 0) prog_completes = hash_create (512); }
long progcomp_create() { long result; result = prog_completes; if ( !prog_completes ) { result = hash_create(512LL); prog_completes = result; } return result; }
static void bind_arrow_keys (void) { bind_arrow_keys_internal (emacs_standard_keymap); bind_arrow_keys_internal (vi_movement_keymap); if (vi_movement_keymap[(('[') & 0x1f)].type == 1) rl_bind_keyseq_in_map ("\033", (rl_command_func_t *) ((void *)0) , vi_movement_keymap); bind_arrow_keys_internal (vi_insertion_keymap); }
long long bind_arrow_keys() { bind_arrow_keys_internal(&emacs_standard_keymap); bind_arrow_keys_internal(&vi_movement_keymap); if (malloc == 1) rl_bind_keyseq_in_map(&g_4022b8, 0x0, 0x500138); return bind_arrow_keys_internal(&vi_insertion_keymap); }
static errcode_t e2fsck_write_all_quotas(e2fsck_t ctx) { struct problem_context pctx; enum quota_type qtype; if (!ext2fs_has_feature_quota(ctx->fs->super)) return 0; clear_problem_context(&pctx); for (qtype = 0 ; qtype < MAXQUOTAS; qtype++) { pctx.num = qtype; pctx.errcode = quota_write_inode(ctx->qctx, 1 << qtype); if (pctx.errcode) { fix_problem(ctx, 0x060006, &pctx); break; } } quota_release_context(&ctx->qctx); return pctx.errcode; }
int e2fsck_write_all_quotas(struct_0 *a0) { unsigned int v0; unsigned long v1; unsigned long v2; unsigned int v4; if (!ext2fs_has_feature_quota(a0->field_0->field_20)) { v4 = 0; } else { clear_problem_context(&v1); v0 = 0; while (true) { if (v0 > 2) break; v2 = v0; v1 = quota_write_inode(a0->field_278, 1 << (v0 & 31), 1 << (v0 & 31), v0); if (!v1) { v0 += 1; } else { fix_problem(a0, 0x60006, &v1); break; } } quota_release_context(&a0->field_278); v4 = v1; } return v4; }
void print_for_mkdir (char *dirname, int length, mode_t mode) { char modes[11]; if (verbose_option > 1) { modes[0] = 'd'; pax_decode_mode (mode, modes + 1); if (block_number_option) { char buf[((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)]; fprintf (stdlis, gettext ("block %s: "), umaxtostr (current_block_ordinal (), buf)); } fprintf (stdlis, "%s %*s %s\n", modes, ugswidth + 1 + datewidth, gettext ("Creating directory:"), quotearg (dirname)); } }
unsigned long print_for_mkdir(long a1, long a2, unsigned int a3) { long v3; long v4; char *v5; const char *v6; char *v7; char v9; short v10; char v11[24]; unsigned long v12; v12 = __readfsqword(0x28u); if ( verbose_option > 1 ) { v9 = 100; pax_decode_mode(a3, &v10); if ( block_number_option ) { v3 = current_block_ordinal(); v4 = umaxtostr(v3, v11); v5 = gettext("block %s: "); fprintf(stdlis, v5, v4); } v6 = (const char *)quotearg(a1); v7 = gettext("Creating directory:"); fprintf(stdlis, "%s %*s %s\n", &v9, ugswidth + 1 + datewidth, v7, v6); } return __readfsqword(0x28u) ^ v12; }
SHELL_VAR * bind_int_variable (lhs, rhs, flags) char *lhs, *rhs; int flags; { register SHELL_VAR *v; int isint, isarr, implicitarray, vflags, avflags; isint = isarr = implicitarray = 0; vflags = (flags & 0x0080) ? 0x001 : 0; if (flags & 0x1000) vflags |= 0x002; if (valid_array_reference (lhs, vflags)) { isarr = 1; avflags = 0; if (flags & 0x0080) avflags |= 0x020; if (flags & 0x1000) avflags |= 0x040; v = array_variable_part (lhs, avflags, (char **)0, (int *)0); } else if (legal_identifier (lhs) == 0) { sh_invalidid (lhs); return ((SHELL_VAR *) ((void *)0) ); } else v = find_variable (lhs); if (v) { isint = ((((v)->attributes) & (0x0000010))); ((v)->attributes &= ~(0x0000010)); if (((((v)->attributes) & (0x0000004))) && isarr == 0) implicitarray = 1; } if (isarr) v = assign_array_element (lhs, rhs, flags, (array_eltstate_t *)0); else if (implicitarray) v = bind_array_variable (lhs, 0, rhs, 0); else v = bind_variable (lhs, rhs, 0); if (v) { if (isint) ((v)->attributes |= (0x0000010)); ((v)->attributes &= ~(0x0001000)); } if (v && ((((v)->attributes) & (0x0000800)))) internal_warning (gettext("%s: assigning integer to name reference"), lhs); return (v); }
long bind_int_variable(undefined8 param_1,undefined8 param_2,uint param_3) { bool bVar1; bool bVar2; int iVar3; long lVar4; undefined8 uVar5; uint local_2c; uint local_20; uint local_1c; bVar2 = false; bVar1 = false; local_2c = 0; local_20 = (int)param_3 >> 7 & 1; if ((param_3 & 0x1000) != 0) { local_20 = local_20 | 2; } iVar3 = valid_array_reference(param_1,local_20); if (iVar3 == 0) { iVar3 = legal_identifier(param_1); if (iVar3 == 0) { sh_invalidid(param_1); return 0; } lVar4 = find_variable(param_1); } else { bVar1 = true; local_1c = 0; if ((param_3 & 0x80) != 0) { local_1c = 0x20; } if ((param_3 & 0x1000) != 0) { local_1c = local_1c | 0x40; } lVar4 = array_variable_part(param_1,local_1c,0,0); } if (lVar4 != 0) { local_2c = *(uint *)(lVar4 + 0x28) & 0x10; *(uint *)(lVar4 + 0x28) = *(uint *)(lVar4 + 0x28) & 0xffffffef; if (((*(uint *)(lVar4 + 0x28) & 4) != 0) && (!bVar1)) { bVar2 = true; } } if (bVar1) { lVar4 = assign_array_element(param_1,param_2,param_3,0); } else if (bVar2) { lVar4 = bind_array_variable(param_1,0,param_2,0); } else { lVar4 = bind_variable(param_1,param_2,0); } if (lVar4 != 0) { if (local_2c != 0) { *(uint *)(lVar4 + 0x28) = *(uint *)(lVar4 + 0x28) | 0x10; } *(uint *)(lVar4 + 0x28) = *(uint *)(lVar4 + 0x28) & 0xffffefff; } if ((lVar4 != 0) && ((*(uint *)(lVar4 + 0x28) & 0x800) != 0)) { uVar5 = gettext("%s: assigning integer to name reference"); internal_warning(uVar5,param_1); } return lVar4; }
static _Bool deb_reassemble(const char **filename, const char **pfilename) { static char *reasmbuf = ((void *)0) ; struct stat stab; int status; pid_t pid; if (!reasmbuf) reasmbuf = dpkg_db_get_path("reassemble" ".deb"); if (unlink(reasmbuf) && (*__errno_location ()) != 2 ) ohshite(gettext("error ensuring '%.250s' doesn't exist"), reasmbuf); push_cleanup(cu_pathname, ~0, 1, (void *)reasmbuf); pid = subproc_fork(); if (!pid) { execlp("dpkg-split", "dpkg-split", "-Qao", reasmbuf, *filename, ((void *)0) ); ohshite(gettext("unable to execute %s (%s)"), gettext("split package reassembly"), "dpkg-split"); } status = subproc_reap(pid, "dpkg-split", SUBPROC_RETERROR); switch (status) { case 0: if (!stat(reasmbuf, &stab)) { *filename = reasmbuf; *pfilename = gettext("reassembled package file"); break; } else if ( (*__errno_location ()) == 2 ) { return 0 ; } case 1: break; default: ohshit(gettext("subprocess %s returned error exit status %d"), "dpkg-split", status); } return 1 ; }
int deb_reassemble(unsigned long long *a0, unsigned long long *a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned int v0; unsigned int v1; char v2; unsigned int v4; if (!reasmbuf.6464) reasmbuf.6464 = dpkg_db_get_path("reassemble.deb"); if (unlink(reasmbuf.6464)) { v4 = *(__errno_location()); if (v4 != 2) ohshite(gettext("error ensuring '%.250s' doesn't exist"), reasmbuf.6464); } push_cleanup(got.cu_pathname, 0xffffffff, 0x1, reasmbuf.6464); v0 = subproc_fork(a0, 0xffffffff, 0x1, a3, a4, a5); if (!v0) { execlp("dpkg-split", "dpkg-split"); ohshite(gettext("unable to execute %s (%s)"), gettext("split package reassembly")); } v1 = subproc_reap(v0, "dpkg-split", 0x8); if (v1) { if (v1 != 1) { v4 = gettext("subprocess %s returned error exit status %d"); ohshit(v4, "dpkg-split", v1, v4); } } else { if (!stat(reasmbuf.6464, &v2)) { *(a0) = reasmbuf.6464; *(a1) = gettext("reassembled package file"); } else { v4 = *(__errno_location()); if (v4 == 2) { v4 = 0; goto LABEL_4002e4; } } } v4 = 1; LABEL_4002e4: return v4; }
static char *getpasswd(struct console *con) { static char pass[128], *ptr; struct sigaction sa; struct chardata *cp; struct termios tty; char *ret = pass; unsigned char tc; char c, ascval; int eightbit; int fd; if (con->flags & 0x0002) goto out; fd = con->fd; cp = &con->cp; tty = con->tio; tty.c_iflag &= ~( 0001000 | 0002000 | 0010000 | 0004000 ); tty.c_lflag &= ~( 0000010 | 0000020 | 0000040 | 0000100 | 0000400 | 0000001 ); tc = (tcsetattr(fd, 2 , &tty) == 0); sa. __sigaction_handler.sa_handler = alrm_handler; sa.sa_flags = 0; sigaction( 14 , &sa, ((void *)0) ); if (timeout) alarm(timeout); ptr = &pass[0]; cp->eol = *ptr = '\0'; eightbit = ((con->flags & 0x0001) == 0 || (tty.c_cflag & ( 0001000 | 0000400 )) == 0); while (cp->eol == '\0') { if (read(fd, &c, 1) < 1) { if ( (*__errno_location ()) == 4 || (*__errno_location ()) == 11 ) { usleep(1000); continue; } ret = (char*)0; switch ( (*__errno_location ()) ) { case 0: case 5 : case 3 : case 22 : case 2 : break; default: fprintf( stderr , "sulogin: read(%s): %m\n\r", con->tty); break; } goto quit; } if (eightbit) ascval = c; else if (c != (ascval = (c & 0177))) { uint32_t bits, mask; for (bits = 1, mask = 1; mask & 0177; mask <<= 1) { if (mask & ascval) bits++; } cp->parity |= ((bits & 1) ? 1 : 2); } switch (ascval) { case 0: *ptr = '\0'; goto quit; case ( 'm' &037) : case ( 'j' &037) : *ptr = '\0'; cp->eol = ascval; break; case ( 'h' &037) : case 0177 : cp->erase = ascval; if (ptr > &pass[0]) ptr--; break; case ('u'&037) : cp->kill = ascval; while (ptr > &pass[0]) ptr--; break; case ('d'&037) : goto quit; default: if ((size_t)(ptr - &pass[0]) >= (sizeof(pass) -1 )) { fprintf( stderr , "sulogin: input overrun at %s\n\r", con->tty); ret = (char*)0; goto quit; } *ptr++ = ascval; break; } } quit: alarm(0); if (tc) (void)tcsetattr(fd, 2 , &con->tio); if (ret && *ret != '\0') tcfinal(con); printf("\r\n"); out: return ret; }
int getpasswd(struct_0 *a0) { int tmp_117; char v0; char v1; char v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned long long v7; char v8[4]; unsigned int v9; unsigned long v10; unsigned int v11; unsigned long v12; unsigned long v13; unsigned long v14; unsigned long v15; unsigned long v16; unsigned int v17; unsigned long long v18; unsigned int v19; unsigned int v21; char *v22; unsigned long long v23; v7 = &pass.4738; if (!(a0->field_10 & 2)) { v5 = a0->field_14; *(&v8) = &a0->padding_18[8]; v9 = *(&(&a0->padding_18)[1]); v10 = *((&a0->field_24 + 4)); v12 = *((&a0->field_2c + 4)); v13 = *((&a0->field_34 + 4)); v14 = *((&a0->field_3c + 4)); v15 = *((&a0->field_44 + 4)); v16 = *((&a0->field_4c + 4)); v17 = *((&a0->field_54 + 4)); v21 = v9; *(&v21) = (v9 >> 8) & 225; tmp_117 = v21; v9 = tmp_117; v11 = *((&v10 + 4)) & -378; v2 = !tcsetattr(v5, 0x2, &v9); v18 = alrm_handler; v19 = 0; sigaction(0xe, &v18, 0x0); if (timeout) alarm(timeout); ptr.4739 = &pass.4738; *(ptr.4739) = 0; v8[2] = 0; if (!(a0->field_10 & 1)) { LABEL_401112: v21 = 1; } else { if (!(v10 & 0x300)) goto LABEL_401112; v21 = 0; } v6 = v21; while (true) { if (v8[2]) goto LABEL_4013b0; if (read(v5, &v0, 0x1) <= 0) break; if (v6) { v1 = v0; } else { v1 = v0 & 127; if (v1 != v0) { v3 = 1; for (v4 = 1; (v4 & 127); v4 *= 2) { if ((v1 & v4)) v3 += 1; } if (!(v3 & 1)) v21 = 2; else v21 = 1; v8[3] = v21 | v8[3]; } } if (v1 > 21) { if (v1 == 127) goto LABEL_4012cd; else goto LABEL_40133d; } else { if (v1 < 0) goto LABEL_40133d; switch (v1) { case 0: *(ptr.4739) = 0; break; case 4: break; case 8: LABEL_4012cd: v8[0] = v1; if (ptr.4739 > 4203456) ptr.4739 = ptr.4739 - 1; continue; case 10: case 13: *(ptr.4739) = 0; v8[2] = v1; continue; case 21: for (v8[1] = v1; ptr.4739 > 4203456; ptr.4739 = ptr.4739 - 1); default: LABEL_40133d: if (ptr.4739 - 4203456 <= 126) { v22 = ptr.4739; ptr.4739 = ptr.4739 + 1; *(v22) = v1; continue; } else { fprintf(*(&stderr), "sulogin: input overrun at %s\n\r", a0->field_0); v7 = 0; break; } } } } v21 = *(__errno_location()); if (v21 != 4) { v21 = *(__errno_location()); if (v21 != 11) { v7 = 0; v23 = *(__errno_location()); if (22 >= v23 && !(!((1 << (v23 & 63)) & &g_40002d))) goto LABEL_4011cb; fprintf(*(&stderr), "sulogin: read(%s): %m\n\r", a0->field_0); LABEL_4011cb: goto LABEL_4013b0; } } usleep(0x3e8); continue; LABEL_4013b0: alarm(0x0); if (v2) tcsetattr(v5, 0x2, &(&a0->padding_18)[1]); if (v7 && *(v7)) tcfinal(a0); printf("\r\n"); } return v7; }
int el_get(EditLine *el, int op, ...) { va_list ap; int ret; if (!el) return -1; __builtin_va_start( ap , op ) ; switch (op) { case 0: case 12: { el_pfunc_t *p = __builtin_va_arg( ap , el_pfunc_t * ) ; ret = prompt_get(el, p, 0, op); break; } case 21: case 22: { el_pfunc_t *p = __builtin_va_arg( ap , el_pfunc_t * ) ; char *c = __builtin_va_arg( ap , char * ) ; wchar_t wc = 0; ret = prompt_get(el, p, &wc, op); *c = (char)wc; break; } case 2: { const char **p = __builtin_va_arg( ap , const char ** ) ; const wchar_t *pw; ret = el_wget(el, op, &pw); *p = ct_encode_string(pw, &el->el_lgcyconv); if (!el->el_lgcyconv.csize) ret = -1; break; } case 1: ret = el_wget(el, op, __builtin_va_arg( ap , const char ** ) ); break; case 3: case 11: case 25: case 15: case 16: ret = el_wget(el, op, __builtin_va_arg( ap , int * ) ); break; case 17: { char *argv[3]; static char gettc[] = "gettc"; argv[0] = gettc; argv[1] = __builtin_va_arg( ap , char * ) ; argv[2] = __builtin_va_arg( ap , void * ) ; ret = terminal_gettc(el, 3, argv); break; } case 13: ret = el_wget(el, op, __builtin_va_arg( ap , el_rfunc_t * ) ); break; case 14: ret = el_wget(el, op, __builtin_va_arg( ap , void ** ) ); break; case 18: { int what = __builtin_va_arg( ap , int ) ; FILE **fpp = __builtin_va_arg( ap , FILE ** ) ; ret = el_wget(el, op, what, fpp); break; } default: ret = -1; break; } __builtin_va_end( ap ) ; return ret; }
undefined4 el_get(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4, undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,long param_9, undefined4 param_10,undefined8 param_11,undefined8 param_12,undefined8 param_13, undefined8 param_14) { undefined8 *puVar1; undefined *puVar2; char in_AL; undefined8 uVar3; long in_FS_OFFSET; undefined4 local_130; undefined4 local_128; undefined4 uStack292; undefined *local_118; undefined8 *local_108; char *local_f8 [4]; undefined4 local_d8; undefined4 local_d4; undefined *local_d0; undefined *local_c8; long local_c0; undefined local_b8 [16]; undefined8 *local_a8; undefined *local_a0; undefined8 local_98; undefined8 local_90; undefined4 local_88; undefined4 local_78; undefined4 local_68; undefined4 local_58; undefined4 local_48; undefined4 local_38; undefined4 local_28; undefined4 local_18; puVar2 = local_a0; puVar1 = local_a8; if (in_AL != '\0') { local_88 = param_1; local_78 = param_2; local_68 = param_3; local_58 = param_4; local_48 = param_5; local_38 = param_6; local_28 = param_7; local_18 = param_8; } local_c0 = *(long *)(in_FS_OFFSET + 0x28); local_98 = param_13; local_90 = param_14; if (param_9 == 0) { local_130 = 0xffffffff; local_a8 = (undefined8 *)param_11; local_a0 = (undefined *)param_12; } else { local_d8 = 0x10; local_d4 = 0x30; local_d0 = &stack0x00000008; local_c8 = local_b8; switch(param_10) { case 0: case 0xc: local_d8 = 0x18; local_a8 = (undefined8 *)param_11; local_a0 = (undefined *)param_12; local_130 = prompt_get(param_9,puVar1,0,param_10); break; case 1: local_d8 = 0x18; local_a8 = (undefined8 *)param_11; local_a0 = (undefined *)param_12; local_130 = el_wget(param_9,param_10,puVar1); break; case 2: local_d8 = 0x18; local_108 = local_a8; local_a8 = (undefined8 *)param_11; local_a0 = (undefined *)param_12; local_130 = el_wget(param_9,param_10,&local_128); uVar3 = ct_encode_string(CONCAT44(uStack292,local_128),param_9 + 0x508); *local_108 = uVar3; if (*(long *)(param_9 + 0x510) == 0) { local_130 = 0xffffffff; } break; case 3: case 0xb: case 0xf: case 0x10: case 0x19: local_d8 = 0x18; local_a8 = (undefined8 *)param_11; local_a0 = (undefined *)param_12; local_130 = el_wget(param_9,param_10,puVar1); break; default: local_130 = 0xffffffff; local_a8 = (undefined8 *)param_11; local_a0 = (undefined *)param_12; break; case 0xd: local_d8 = 0x18; local_a8 = (undefined8 *)param_11; local_a0 = (undefined *)param_12; local_130 = el_wget(param_9,param_10,puVar1); break; case 0xe: local_d8 = 0x18; local_a8 = (undefined8 *)param_11; local_a0 = (undefined *)param_12; local_130 = el_wget(param_9,param_10,puVar1); break; case 0x11: local_f8[0] = gettc_5170; local_d8 = 0x20; local_a8 = (undefined8 *)param_11; local_a0 = (undefined *)param_12; local_130 = terminal_gettc(param_9,3,local_f8); break; case 0x12: local_d8 = 0x20; local_a8 = (undefined8 *)param_11; local_a0 = (undefined *)param_12; local_130 = el_wget(param_9,param_10,local_a8._0_4_,puVar2); break; case 0x15: case 0x16: local_d8 = 0x20; local_118 = local_a0; local_128 = 0; local_a8 = (undefined8 *)param_11; local_a0 = (undefined *)param_12; local_130 = prompt_get(param_9,puVar1,&local_128,param_10); *local_118 = (char)local_128; } } if (local_c0 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return local_130; }
int inflateUndermine(strm, subvert) z_streamp strm; int subvert; { struct inflate_state *state; if (inflateStateCheck(strm)) return (-2); state = (struct inflate_state *)strm->state; (void)subvert; state->sane = 1; return (-3); }
undefined8 inflateUndermine(long param_1) { int iVar1; undefined8 uVar2; iVar1 = inflateStateCheck(param_1); if (iVar1 == 0) { *(undefined4 *)(*(long *)(param_1 + 0x38) + 0x1be8) = 1; uVar2 = 0xfffffffd; } else { uVar2 = 0xfffffffe; } return uVar2; }
stderr , gettext ("%s: cannot open %s\n"), Prog, gr_dbname ()); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 4 , "cannot open %s", gr_dbname ()) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while (
void gettext(void) { halt_baddata(); }
void do_command(entry * e, user * u) { pid_t pid = getpid(); int ev; char **jobenv = ((void *)0) ; if ((DebugFlags & (0x0004)) != 0) printf ("[%ld] do_command(%s, (%s,%ld,%ld))\n", (long) pid, e->cmd, u->name, (long) e->pwd->pw_uid, (long) e->pwd->pw_gid) ; switch (fork()) { case -1: log_it("CRON", pid, "CAN'T FORK", "do_command", (*__errno_location ()) ); break; case 0: acquire_daemonlock(1); if (cron_set_job_security_context(e, u, &jobenv) != 0) { _exit(1); } ev = child_process(e, jobenv); env_free(jobenv); if ((DebugFlags & (0x0004)) != 0) printf ("[%ld] child process done, exiting\n", (long) getpid()); _exit(ev); break; default: break; } if ((DebugFlags & (0x0004)) != 0) printf ("[%ld] main process returning to work\n", (long) pid); }
long long do_command(unsigned long long a0, unsigned long long a1) { struct_2 *v0; struct_0 *v1; unsigned int v2; unsigned int v3; void* v4; unsigned long long v6; v1 = a0; v0 = a1; v2 = getpid(); v4 = 0; if ((DebugFlags & 4)) printf("[%ld] do_command(%s, (%s,%ld,%ld))\n", v2, v1->field_18, v0->field_10, v1->field_8->field_10, v1->field_8->field_14); v6 = fork(); if (v6 == -1) { log_it("CRON", v2, "CAN'T FORK", "do_command", *(__errno_location())); } else if (!v6) { acquire_daemonlock(0x1); if (cron_set_job_security_context(v1, v0, &v4, v0)) _exit(0x1); v3 = child_process(a0, a1, &v4); env_free(v4); if ((DebugFlags & 4)) printf("[%ld] child process done, exiting\n", getpid()); _exit(v3); } if ((DebugFlags & 4)) printf("[%ld] main process returning to work\n", v2); return 0; }
static int tty_setty(EditLine *el, int action, const struct termios *t) { int rv; while ((rv = tcsetattr(el->el_infd, action, t)) == -1 && (*__errno_location ()) == 4 ) continue; return rv; }
int tty_setty(struct_0 *a0, unsigned long a1, void* a2) { unsigned int v0; while (true) { v0 = tcsetattr(a0->field_20, a1, a2); if (v0 != -1) break; if (*(__errno_location()) != 4) break; } return v0; }
sh_builtin_func_t * find_special_builtin (name) char *name; { current_builtin = builtin_address_internal (name, 0); return ((current_builtin && (current_builtin->flags & 0x08)) ? current_builtin->function : (sh_builtin_func_t *) ((void *)0) ); }
undefined8 find_special_builtin(undefined8 param_1) { undefined8 uVar1; current_builtin = builtin_address_internal(param_1,0); if ((current_builtin == 0) || ((*(uint *)(current_builtin + 0x10) & 8) == 0)) { uVar1 = 0; } else { uVar1 = *(undefined8 *)(current_builtin + 8); } return uVar1; }
static int sftpio(void *_bwlimit, size_t amount) { struct bwlimit *bwlimit = (struct bwlimit *)_bwlimit; refresh_progress_meter(0); if (bwlimit != ((void *)0) ) bandwidth_limit(bwlimit, amount); return 0; }
long long sftpio(unsigned long long a0, unsigned long long a1) { refresh_progress_meter(0x0); if (a0) { bandwidth_limit(a0, a1, a1); return 0; } return 0; }
static void channel_pre_listener(struct ssh *ssh, Channel *c) { c->io_want = 0x10; }
long long channel_pre_listener(unsigned long a0, struct_0 *a1) { unsigned long v0; v0 = a0; a1->field_2c = 16; return a1; }
ARRAY * copy_string_array (array) ARRAY *array; { register int i; ARRAY *copy; if (!array) return (ARRAY *) ((void *)0) ; copy = array_create (sizeof (char *)); copy->size = array->size; copy->sindex = array->sindex; copy->width = array->width; copy->array = (char **)xmalloc ((1 + array->sindex) * sizeof (char *)); for (i = 0; i < array->sindex; i++) copy->array[i] = strcpy (xmalloc (1 + strlen (array->array[i])), (array->array[i])); copy->array[i] = (char *) ((void *)0) ; return (copy); }
undefined4 * copy_string_array(undefined4 *param_1) { long lVar1; undefined4 *puVar2; undefined8 uVar3; size_t sVar4; char *__dest; char *pcVar5; int iVar6; if (param_1 == (undefined4 *)0x0) { puVar2 = (undefined4 *)0x0; } else { puVar2 = (undefined4 *)array_create(8); *puVar2 = *param_1; puVar2[1] = param_1[1]; puVar2[2] = param_1[2]; uVar3 = xmalloc((long)(param_1[1] + 1) << 3); *(undefined8 *)(puVar2 + 4) = uVar3; for (iVar6 = 0; iVar6 < (int)param_1[1]; iVar6 = iVar6 + 1) { pcVar5 = *(char **)(*(long *)(param_1 + 4) + (long)iVar6 * 8); sVar4 = strlen(*(char **)(*(long *)(param_1 + 4) + (long)iVar6 * 8)); __dest = (char *)xmalloc(sVar4 + 1); lVar1 = *(long *)(puVar2 + 4); pcVar5 = strcpy(__dest,pcVar5); *(char **)(lVar1 + (long)iVar6 * 8) = pcVar5; } *(undefined8 *)(*(long *)(puVar2 + 4) + (long)iVar6 * 8) = 0; } return puVar2; }
static void out_html(char *c) { if (!c) return; if (no_newline_output) { int i = 0; no_newline_output = 1; while (c[i]) { if (!no_newline_output) c[i - 1] = c[i]; if (c[i] == '\n') no_newline_output = 1; i++; } if (!no_newline_output) c[i - 1] = 0; } if (scaninbuff) { while (*c) { if (buffpos >= buffmax) { char *h; h = realloc(buffer, buffmax * 2); if (!h) return; buffer = h; buffmax *= 2; } buffer[buffpos++] = *c++; } } else if (output_possible) { while (*c) { outbuffer[obp++] = *c; if (*c == '\n' || obp > 10000) { outbuffer[obp] = '\0'; add_links(outbuffer); obp = 0; } c++; } } }
void out_html(unsigned long a0) { char *v0; int tmp_14; int tmp_12; unsigned int v1; unsigned long long v2; struct_0 *v4; unsigned long long v5; unsigned long long v6; v0 = a0; if (v0) { if (no_newline_output) { v1 = 0; for (no_newline_output = 1; v0[v1]; v1 += 1) { if (!no_newline_output) v0[1 + v1] = v0[v1]; if (v0[v1] == 10) no_newline_output = 1; } if (!no_newline_output) v0[1 + v1] = 0; } if (scaninbuff) { while (true) { v5 = *(v0); if (!*(v0)) break; if (buffpos >= buffmax) { v5 = realloc(buffer, buffmax * 2); v2 = v5; if (!v2) break; if (v2) { buffer = v2; buffmax = buffmax * 2; } } tmp_14 = v0; v0 += 1; buffpos = buffpos + 1; *(&v5) = *(tmp_14); *((buffpos + buffer)) = v5; } } else { v4 = output_possible; if (output_possible) { while (true) { v6 = *(v0); if (!*(v0)) break; tmp_12 = obp; obp = obp + 1; *(tmp_12 + &outbuffer) = *(v0); if (*(v0) == 10 || obp > 10000) { *(obp + &outbuffer) = 0; add_links(&outbuffer); obp = 0; } v0 += 1; } } } } return; }
int xwrite(int fd, const void *p, size_t n) { const char *buf = p; while (n) { ssize_t i; size_t m; m = n; if (m > 0x7fffffffffffffffL) m = 0x7fffffffffffffffL; do { i = write(fd, buf, m); } while (i < 0 && (*dash_errno) == 4 ); if (i < 0) return -1; buf += i; n -= i; } return 0; }
int xwrite(unsigned long a0, void* a1, unsigned int a2) { unsigned int v0; unsigned long v1; unsigned long long v2; unsigned int v3; unsigned int v5; v0 = a2; v1 = a1; while (true) { if (*(&v0)) { v2 = *(&v0); if (v2 < 0) v2 = 9223372036854775807; do { v5 = write(a0, v1, v2); v3 = v5; if (!((*(&v3) - 0 >> 63))) break; } while (*(dash_errno) == 4); if ((*(&v3) - 0 >> 63)) { v5 = -1; break; } else { v1 += *(&v3); *(&v0) = *(&v0) - *(&v3); } } else { v5 = 0; break; } } return v5; }
int main (void) { const char *user, *tty; uid_t uid; tty = ttyname (0); if ( ((void *)0) == tty) { tty = "UNKNOWN"; } user = getlogin (); if ( ((void *)0) == user) { user = "UNKNOWN"; } char *ssh_origcmd = getenv("SSH_ORIGINAL_COMMAND"); uid = getuid (); openlog ("nologin", 0x02 , (4<<3) ); syslog ( 2 , "Attempted login by %s (UID: %d) on %s%s%s", user, uid, tty, (ssh_origcmd ? " SSH_ORIGINAL_COMMAND=" : ""), (ssh_origcmd ? ssh_origcmd : "")); closelog (); printf ("%s", "This account is currently not available.\n"); return 1 ; }
int main() { unsigned long long v0; unsigned int v1; unsigned long long v2; unsigned long long v3; unsigned long long v4; unsigned long long v6; v3 = ttyname(0x0); if (!v3) v3 = "UNKNOWN"; v2 = getlogin(); if (!v2) v2 = "UNKNOWN"; v4 = getenv("SSH_ORIGINAL_COMMAND"); v1 = getuid(); openlog("nologin", 0x2, 0x20); if (v4) v6 = v4; else v6 = &g_40011d; v0 = v6; syslog(0x2, "Attempted login by %s (UID: %d) on %s%s%s"); closelog(); printf("%s", &g_400168); return 1; }
test_code_t test_ecdhe_x25519(gnutls_session_t session) { return test_ecdhe_curve(session, "+CURVE-X25519", GNUTLS_ECC_CURVE_X25519); }
void test_ecdhe_x25519(undefined8 param_1) { test_ecdhe_curve(param_1,"+CURVE-X25519",6); return; }
static void seq_fast (char const *a, char const *b, uintmax_t step) { _Bool inf = (strcmp (b, "inf") == 0); a = trim_leading_zeros (a); b = trim_leading_zeros (b); size_t p_len = strlen (a); size_t q_len = inf ? 0 : strlen (b); size_t inc_size = (((((( p_len + 1 )>( q_len ))?( p_len + 1 ):( q_len )))>( 31 ))?(((( p_len + 1 )>( q_len ))?( p_len + 1 ):( q_len ))):( 31 )) ; _Static_assert (3 < 31 - 1, "verify (" "SEQ_FAST_STEP_LIMIT_DIGITS < INITIAL_ALLOC_DIGITS - 1" ")"); char *p0 = xmalloc (inc_size + 1); char *p = memcpy (p0 + inc_size - p_len, a, p_len + 1); char *q; char *q0; if (! inf) { q0 = xmalloc (inc_size + 1); q = memcpy (q0 + inc_size - q_len, b, q_len + 1); } else q = q0 = ((void *)0) ; _Bool ok = inf || cmp (p, p_len, q, q_len) <= 0; if (ok) { size_t buf_size = (((8192)>( (inc_size + 1) * 2 ))?(8192):( (inc_size + 1) * 2 )) ; char *buf = xmalloc (buf_size); char const *buf_end = buf + buf_size; char *bufp = buf; bufp = mempcpy (bufp, p, p_len); while ( 1 ) { for (uintmax_t n_incr = step; n_incr; n_incr--) incr (&p, &p_len); if (! inf && 0 < cmp (p, p_len, q, q_len)) break; *bufp++ = *separator; if (p_len == inc_size) { inc_size *= 2; p0 = xrealloc (p0, inc_size + 1); p = memmove (p0 + p_len, p0, p_len + 1); if (buf_size < (inc_size + 1) * 2) { size_t buf_offset = bufp - buf; buf_size = (inc_size + 1) * 2; buf = xrealloc (buf, buf_size); buf_end = buf + buf_size; bufp = buf + buf_offset; } } bufp = mempcpy (bufp, p, p_len); if (buf_end - (p_len + 1) < bufp) { if (fwrite_unlocked (buf,bufp - buf,1, stdout ) != 1) io_error (); bufp = buf; } } *bufp++ = *terminator; if (fwrite_unlocked (buf,bufp - buf,1, stdout ) != 1) io_error (); } if (ok) exit ( 0 ); free (p0); free (q0); }
void seq_fast(unsigned int a0, unsigned long a1, unsigned long a2) { unsigned long v0; int tmp_14; int tmp_15; unsigned int v1; char v2; char v3; unsigned int v4; void* v5; unsigned long v6; void* v7; void* v8; void* v9; unsigned long long v10; void* v11; unsigned long v12; void* v13; unsigned long v14; unsigned long v15; unsigned long v16; char v17; void* v19; unsigned long v20; unsigned long long v21; unsigned long long *v22; unsigned long long v23; v1 = a0; v0 = a1; v2 = !strcmp(v0, "inf"); v1 = trim_leading_zeros(*(&v1)); v0 = trim_leading_zeros(v0); *(&v4) = strlen(v1); if (v2) v19 = 0; else v19 = strlen(v0); v15 = v19; v20 = *(&v4) + 1; if (*(&v4) + 1 <= v15) v20 = v15; if (v20 < 31) v20 = 31; v6 = v20; v7 = xmalloc(v6 + 1); v5 = memcpy(v6 - *(&v4) + v7, v1, *(&v4) + 1); if (!(v2 ^ 1)) { v9 = 0; v8 = v9; } else { v9 = xmalloc(v6 + 1); v8 = memcpy(v6 - v15 + v9, v0, v15 + 1); } if (v2 || cmp(v5, *(&v4), v8, v15) <= 0) *(&v20) = 1; else *(&v20) = 0; v3 = v20; v3 &= 1; if (v3) { v21 = (v6 + 1) * 2; if (v6 + 1 << 1 < 0x2000) v21 = 0x2000; v10 = v21; v11 = xmalloc(v10); v12 = v10 + v11; v13 = v11; v13 = mempcpy(v13, v5, *(&v4)); while (true) { for (v14 = a2; v14; v14 -= 1) { incr(&v5, &v4); } if (!(!(v2 ^ 1)) && !(cmp(v5, *(&v4), v8, v15) <= 0)) break; tmp_14 = v13; v13 += 1; *(tmp_14) = *(separator); if (v6 == *(&v4)) { v6 *= 2; v7 = xrealloc(v7, v6 + 1, v6 + 1); v5 = memmove(*(&v4) + v7, v7, *(&v4) + 1); if (v10 < v6 + 1 << 1) { v16 = v13 - v11; v10 = (v6 + 1) * 2; v11 = xrealloc(v11, v10, v10); v12 = v10 + v11; v13 = v16 + v11; } } v13 = mempcpy(v13, v5, *(&v4)); if (v13 > v12 + !(*(&v4))) { if (fwrite_unlocked(v11, v13 - v11, 0x1, *(&stdout)) == 1) v13 = v11; else io_error(); } } tmp_15 = v13; v13 += 1; *(tmp_15) = 10; if (fwrite_unlocked(v11, v13 - v11, 0x1, *(&stdout)) != 1) io_error(); } if (!v3) { free(v7); free(v9); v23 = *(&v17) ^ v22[5]; return; } exit(0x0); }
0 ) do { fprintf ( stderr , gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
int fprintf(FILE *__stream,char *__format,...) { halt_baddata(); }
static void print_linkmode(FILE *f, struct rtattr *tb) { unsigned int mode = rta_getattr_u8(tb); if (mode >= (sizeof(link_modes) / sizeof((link_modes)[0]))) print_int(PRINT_ANY, "linkmode_index", "mode %d ", mode); else print_string(PRINT_ANY, "linkmode", "mode %s " , link_modes[mode]); }
void print_linkmode(unsigned long a0, void* a1) { unsigned long v0; unsigned int v1; unsigned long long v3; unsigned long long v4; v0 = a0; v1 = rta_getattr_u8(a1); if (v1 > 1) v4 = print_int(0x4, "linkmode_index", "mode %d ", v1); else v3 = print_string(0x4, "linkmode", "mode %s ", (&link_modes)[v1]); return; }
void setup_exec_ignore (varname) char *varname; { setup_ignore_patterns (&execignore); }
long long setup_exec_ignore(unsigned long a0) { unsigned long v0; v0 = a0; return setup_ignore_patterns(&execignore); }