input
stringlengths
28
169k
output
stringlengths
20
317k
static void add_excluded_fs_type (char const *fstype) { struct fs_type_list *fsp; fsp = xmalloc (sizeof *fsp); fsp->fs_name = (char *) fstype; fsp->fs_next = fs_exclude_list; fs_exclude_list = fsp; }
void add_excluded_fs_type(unsigned long a0) { unsigned long long v0[2]; unsigned long long v3[2]; *(&v0[0]) = xmalloc(0x10); v0[0] = a0; v0[1] = fs_exclude_list; v3 = v0; fs_exclude_list[0] = v0; return; }
static Bool unRLE_obuf_to_output_SMALL ( DState* s ) { UChar k1; if (s->blockRandomised) { while (((Bool)1)) { while (((Bool)1)) { if (s->strm->avail_out == 0) return ((Bool)0); if (s->state_out_len == 0) break; *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; { s->calculatedBlockCRC = (s->calculatedBlockCRC << 8) ^ BZ2_crc32Table[(s->calculatedBlockCRC >> 24) ^ ((UChar)s->state_out_ch)]; }; s->state_out_len--; s->strm->next_out++; s->strm->avail_out--; s->strm->total_out_lo32++; if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; } if (s->nblock_used == s->save_nblock+1) return ((Bool)0); if (s->nblock_used > s->save_nblock+1) return ((Bool)1); s->state_out_len = 1; s->state_out_ch = s->k0; if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return ((Bool)1); k1 = BZ2_indexIntoF ( s->tPos, s->cftab ); s->tPos = (((UInt32)s->ll16[s->tPos]) | (((((UInt32)(s->ll4[(s->tPos) >> 1])) >> (((s->tPos) << 2) & 0x4)) & 0xF) << 16));; if (s->rNToGo == 0) { s->rNToGo = BZ2_rNums[s->rTPos]; s->rTPos++; if (s->rTPos == 512) s->rTPos = 0; } s->rNToGo--;; k1 ^= ((s->rNToGo == 1) ? 1 : 0); s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 2; if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return ((Bool)1); k1 = BZ2_indexIntoF ( s->tPos, s->cftab ); s->tPos = (((UInt32)s->ll16[s->tPos]) | (((((UInt32)(s->ll4[(s->tPos) >> 1])) >> (((s->tPos) << 2) & 0x4)) & 0xF) << 16));; if (s->rNToGo == 0) { s->rNToGo = BZ2_rNums[s->rTPos]; s->rTPos++; if (s->rTPos == 512) s->rTPos = 0; } s->rNToGo--;; k1 ^= ((s->rNToGo == 1) ? 1 : 0); s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 3; if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return ((Bool)1); k1 = BZ2_indexIntoF ( s->tPos, s->cftab ); s->tPos = (((UInt32)s->ll16[s->tPos]) | (((((UInt32)(s->ll4[(s->tPos) >> 1])) >> (((s->tPos) << 2) & 0x4)) & 0xF) << 16));; if (s->rNToGo == 0) { s->rNToGo = BZ2_rNums[s->rTPos]; s->rTPos++; if (s->rTPos == 512) s->rTPos = 0; } s->rNToGo--;; k1 ^= ((s->rNToGo == 1) ? 1 : 0); s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return ((Bool)1); k1 = BZ2_indexIntoF ( s->tPos, s->cftab ); s->tPos = (((UInt32)s->ll16[s->tPos]) | (((((UInt32)(s->ll4[(s->tPos) >> 1])) >> (((s->tPos) << 2) & 0x4)) & 0xF) << 16));; if (s->rNToGo == 0) { s->rNToGo = BZ2_rNums[s->rTPos]; s->rTPos++; if (s->rTPos == 512) s->rTPos = 0; } s->rNToGo--;; k1 ^= ((s->rNToGo == 1) ? 1 : 0); s->nblock_used++; s->state_out_len = ((Int32)k1) + 4; if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return ((Bool)1); s->k0 = BZ2_indexIntoF ( s->tPos, s->cftab ); s->tPos = (((UInt32)s->ll16[s->tPos]) | (((((UInt32)(s->ll4[(s->tPos) >> 1])) >> (((s->tPos) << 2) & 0x4)) & 0xF) << 16));; if (s->rNToGo == 0) { s->rNToGo = BZ2_rNums[s->rTPos]; s->rTPos++; if (s->rTPos == 512) s->rTPos = 0; } s->rNToGo--;; s->k0 ^= ((s->rNToGo == 1) ? 1 : 0); s->nblock_used++; } } else { while (((Bool)1)) { while (((Bool)1)) { if (s->strm->avail_out == 0) return ((Bool)0); if (s->state_out_len == 0) break; *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; { s->calculatedBlockCRC = (s->calculatedBlockCRC << 8) ^ BZ2_crc32Table[(s->calculatedBlockCRC >> 24) ^ ((UChar)s->state_out_ch)]; }; s->state_out_len--; s->strm->next_out++; s->strm->avail_out--; s->strm->total_out_lo32++; if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; } if (s->nblock_used == s->save_nblock+1) return ((Bool)0); if (s->nblock_used > s->save_nblock+1) return ((Bool)1); s->state_out_len = 1; s->state_out_ch = s->k0; if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return ((Bool)1); k1 = BZ2_indexIntoF ( s->tPos, s->cftab ); s->tPos = (((UInt32)s->ll16[s->tPos]) | (((((UInt32)(s->ll4[(s->tPos) >> 1])) >> (((s->tPos) << 2) & 0x4)) & 0xF) << 16));; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 2; if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return ((Bool)1); k1 = BZ2_indexIntoF ( s->tPos, s->cftab ); s->tPos = (((UInt32)s->ll16[s->tPos]) | (((((UInt32)(s->ll4[(s->tPos) >> 1])) >> (((s->tPos) << 2) & 0x4)) & 0xF) << 16));; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 3; if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return ((Bool)1); k1 = BZ2_indexIntoF ( s->tPos, s->cftab ); s->tPos = (((UInt32)s->ll16[s->tPos]) | (((((UInt32)(s->ll4[(s->tPos) >> 1])) >> (((s->tPos) << 2) & 0x4)) & 0xF) << 16));; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return ((Bool)1); k1 = BZ2_indexIntoF ( s->tPos, s->cftab ); s->tPos = (((UInt32)s->ll16[s->tPos]) | (((((UInt32)(s->ll4[(s->tPos) >> 1])) >> (((s->tPos) << 2) & 0x4)) & 0xF) << 16));; s->nblock_used++; s->state_out_len = ((Int32)k1) + 4; if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return ((Bool)1); s->k0 = BZ2_indexIntoF ( s->tPos, s->cftab ); s->tPos = (((UInt32)s->ll16[s->tPos]) | (((((UInt32)(s->ll4[(s->tPos) >> 1])) >> (((s->tPos) << 2) & 0x4)) & 0xF) << 16));; s->nblock_used++; } } }
undefined8 unRLE_obuf_to_output_SMALL(long *param_1) { byte bVar1; undefined4 uVar2; if (*(char *)((long)param_1 + 0x14) == '\0') { while (*(int *)(*param_1 + 0x20) != 0) { if (*(int *)(param_1 + 2) == 0) { if (*(int *)((long)param_1 + 0x444) == *(int *)(param_1 + 0x1f4a) + 1) { return 0; } if (*(int *)(param_1 + 0x1f4a) + 1 < *(int *)((long)param_1 + 0x444)) { return 1; } *(undefined4 *)(param_1 + 2) = 1; *(char *)((long)param_1 + 0xc) = (char)*(undefined4 *)(param_1 + 8); if ((uint)(*(int *)(param_1 + 5) * 100000) <= *(uint *)((long)param_1 + 0x3c)) { return 1; } bVar1 = BZ2_indexIntoF(*(undefined4 *)((long)param_1 + 0x3c)); *(uint *)((long)param_1 + 0x3c) = (uint)*(ushort *)((ulong)*(uint *)((long)param_1 + 0x3c) * 2 + param_1[0x18b]) | (*(byte *)((ulong)(*(uint *)((long)param_1 + 0x3c) >> 1) + param_1[0x18c]) >> (sbyte)((*(uint *)((long)param_1 + 0x3c) & 1) << 2) & 0xf) << 0x10; *(int *)((long)param_1 + 0x444) = *(int *)((long)param_1 + 0x444) + 1; if (*(int *)((long)param_1 + 0x444) != *(int *)(param_1 + 0x1f4a) + 1) { if ((uint)bVar1 == *(uint *)(param_1 + 8)) { *(undefined4 *)(param_1 + 2) = 2; if ((uint)(*(int *)(param_1 + 5) * 100000) <= *(uint *)((long)param_1 + 0x3c)) { return 1; } bVar1 = BZ2_indexIntoF(*(undefined4 *)((long)param_1 + 0x3c)); *(uint *)((long)param_1 + 0x3c) = (uint)*(ushort *)((ulong)*(uint *)((long)param_1 + 0x3c) * 2 + param_1[0x18b]) | (*(byte *)((ulong)(*(uint *)((long)param_1 + 0x3c) >> 1) + param_1[0x18c]) >> (sbyte)((*(uint *)((long)param_1 + 0x3c) & 1) << 2) & 0xf) << 0x10; *(int *)((long)param_1 + 0x444) = *(int *)((long)param_1 + 0x444) + 1; if (*(int *)((long)param_1 + 0x444) != *(int *)(param_1 + 0x1f4a) + 1) { if ((uint)bVar1 == *(uint *)(param_1 + 8)) { *(undefined4 *)(param_1 + 2) = 3; if ((uint)(*(int *)(param_1 + 5) * 100000) <= *(uint *)((long)param_1 + 0x3c)) { return 1; } bVar1 = BZ2_indexIntoF(*(undefined4 *)((long)param_1 + 0x3c)); *(uint *)((long)param_1 + 0x3c) = (uint)*(ushort *)((ulong)*(uint *)((long)param_1 + 0x3c) * 2 + param_1[0x18b]) | (*(byte *)((ulong)(*(uint *)((long)param_1 + 0x3c) >> 1) + param_1[0x18c]) >> (sbyte)((*(uint *)((long)param_1 + 0x3c) & 1) << 2) & 0xf) << 0x10; *(int *)((long)param_1 + 0x444) = *(int *)((long)param_1 + 0x444) + 1; if (*(int *)((long)param_1 + 0x444) != *(int *)(param_1 + 0x1f4a) + 1) { if ((uint)bVar1 == *(uint *)(param_1 + 8)) { if ((uint)(*(int *)(param_1 + 5) * 100000) <= *(uint *)((long)param_1 + 0x3c)) { return 1; } bVar1 = BZ2_indexIntoF(*(undefined4 *)((long)param_1 + 0x3c)); *(uint *)((long)param_1 + 0x3c) = (uint)*(ushort *) ((ulong)*(uint *)((long)param_1 + 0x3c) * 2 + param_1[0x18b]) | (*(byte *)((ulong)(*(uint *)((long)param_1 + 0x3c) >> 1) + param_1[0x18c]) >> (sbyte)((*(uint *)((long)param_1 + 0x3c) & 1) << 2) & 0xf) << 0x10; *(int *)((long)param_1 + 0x444) = *(int *)((long)param_1 + 0x444) + 1; *(uint *)(param_1 + 2) = bVar1 + 4; if ((uint)(*(int *)(param_1 + 5) * 100000) <= *(uint *)((long)param_1 + 0x3c)) { return 1; } uVar2 = BZ2_indexIntoF(*(undefined4 *)((long)param_1 + 0x3c)); *(undefined4 *)(param_1 + 8) = uVar2; *(uint *)((long)param_1 + 0x3c) = (uint)*(ushort *) ((ulong)*(uint *)((long)param_1 + 0x3c) * 2 + param_1[0x18b]) | (*(byte *)((ulong)(*(uint *)((long)param_1 + 0x3c) >> 1) + param_1[0x18c]) >> (sbyte)((*(uint *)((long)param_1 + 0x3c) & 1) << 2) & 0xf) << 0x10; *(int *)((long)param_1 + 0x444) = *(int *)((long)param_1 + 0x444) + 1; } else { *(uint *)(param_1 + 8) = (uint)bVar1; } } } else { *(uint *)(param_1 + 8) = (uint)bVar1; } } } else { *(uint *)(param_1 + 8) = (uint)bVar1; } } } else { **(undefined **)(*param_1 + 0x18) = *(undefined *)((long)param_1 + 0xc); *(uint *)(param_1 + 0x18e) = *(int *)(param_1 + 0x18e) << 8 ^ *(uint *)(&BZ2_crc32Table + (ulong)((uint)*(byte *)((long)param_1 + 0xc) ^ *(uint *)(param_1 + 0x18e) >> 0x18) * 4); *(int *)(param_1 + 2) = *(int *)(param_1 + 2) + -1; *(long *)(*param_1 + 0x18) = *(long *)(*param_1 + 0x18) + 1; *(int *)(*param_1 + 0x20) = *(int *)(*param_1 + 0x20) + -1; *(int *)(*param_1 + 0x24) = *(int *)(*param_1 + 0x24) + 1; if (*(int *)(*param_1 + 0x24) == 0) { *(int *)(*param_1 + 0x28) = *(int *)(*param_1 + 0x28) + 1; } } } } else { while (*(int *)(*param_1 + 0x20) != 0) { if (*(int *)(param_1 + 2) == 0) { if (*(int *)((long)param_1 + 0x444) == *(int *)(param_1 + 0x1f4a) + 1) { return 0; } if (*(int *)(param_1 + 0x1f4a) + 1 < *(int *)((long)param_1 + 0x444)) { return 1; } *(undefined4 *)(param_1 + 2) = 1; *(char *)((long)param_1 + 0xc) = (char)*(undefined4 *)(param_1 + 8); if ((uint)(*(int *)(param_1 + 5) * 100000) <= *(uint *)((long)param_1 + 0x3c)) { return 1; } bVar1 = BZ2_indexIntoF(*(undefined4 *)((long)param_1 + 0x3c)); *(uint *)((long)param_1 + 0x3c) = (uint)*(ushort *)((ulong)*(uint *)((long)param_1 + 0x3c) * 2 + param_1[0x18b]) | (*(byte *)((ulong)(*(uint *)((long)param_1 + 0x3c) >> 1) + param_1[0x18c]) >> (sbyte)((*(uint *)((long)param_1 + 0x3c) & 1) << 2) & 0xf) << 0x10; if (*(int *)(param_1 + 3) == 0) { *(undefined4 *)(param_1 + 3) = *(undefined4 *)(&BZ2_rNums + (long)*(int *)((long)param_1 + 0x1c) * 4); *(int *)((long)param_1 + 0x1c) = *(int *)((long)param_1 + 0x1c) + 1; if (*(int *)((long)param_1 + 0x1c) == 0x200) { *(undefined4 *)((long)param_1 + 0x1c) = 0; } } *(int *)(param_1 + 3) = *(int *)(param_1 + 3) + -1; bVar1 = bVar1 ^ *(int *)(param_1 + 3) == 1; *(int *)((long)param_1 + 0x444) = *(int *)((long)param_1 + 0x444) + 1; if (*(int *)((long)param_1 + 0x444) != *(int *)(param_1 + 0x1f4a) + 1) { if ((uint)bVar1 == *(uint *)(param_1 + 8)) { *(undefined4 *)(param_1 + 2) = 2; if ((uint)(*(int *)(param_1 + 5) * 100000) <= *(uint *)((long)param_1 + 0x3c)) { return 1; } bVar1 = BZ2_indexIntoF(*(undefined4 *)((long)param_1 + 0x3c)); *(uint *)((long)param_1 + 0x3c) = (uint)*(ushort *)((ulong)*(uint *)((long)param_1 + 0x3c) * 2 + param_1[0x18b]) | (*(byte *)((ulong)(*(uint *)((long)param_1 + 0x3c) >> 1) + param_1[0x18c]) >> (sbyte)((*(uint *)((long)param_1 + 0x3c) & 1) << 2) & 0xf) << 0x10; if (*(int *)(param_1 + 3) == 0) { *(undefined4 *)(param_1 + 3) = *(undefined4 *)(&BZ2_rNums + (long)*(int *)((long)param_1 + 0x1c) * 4); *(int *)((long)param_1 + 0x1c) = *(int *)((long)param_1 + 0x1c) + 1; if (*(int *)((long)param_1 + 0x1c) == 0x200) { *(undefined4 *)((long)param_1 + 0x1c) = 0; } } *(int *)(param_1 + 3) = *(int *)(param_1 + 3) + -1; bVar1 = bVar1 ^ *(int *)(param_1 + 3) == 1; *(int *)((long)param_1 + 0x444) = *(int *)((long)param_1 + 0x444) + 1; if (*(int *)((long)param_1 + 0x444) != *(int *)(param_1 + 0x1f4a) + 1) { if ((uint)bVar1 == *(uint *)(param_1 + 8)) { *(undefined4 *)(param_1 + 2) = 3; if ((uint)(*(int *)(param_1 + 5) * 100000) <= *(uint *)((long)param_1 + 0x3c)) { return 1; } bVar1 = BZ2_indexIntoF(*(undefined4 *)((long)param_1 + 0x3c)); *(uint *)((long)param_1 + 0x3c) = (uint)*(ushort *)((ulong)*(uint *)((long)param_1 + 0x3c) * 2 + param_1[0x18b]) | (*(byte *)((ulong)(*(uint *)((long)param_1 + 0x3c) >> 1) + param_1[0x18c]) >> (sbyte)((*(uint *)((long)param_1 + 0x3c) & 1) << 2) & 0xf) << 0x10; if (*(int *)(param_1 + 3) == 0) { *(undefined4 *)(param_1 + 3) = *(undefined4 *)(&BZ2_rNums + (long)*(int *)((long)param_1 + 0x1c) * 4); *(int *)((long)param_1 + 0x1c) = *(int *)((long)param_1 + 0x1c) + 1; if (*(int *)((long)param_1 + 0x1c) == 0x200) { *(undefined4 *)((long)param_1 + 0x1c) = 0; } } *(int *)(param_1 + 3) = *(int *)(param_1 + 3) + -1; bVar1 = bVar1 ^ *(int *)(param_1 + 3) == 1; *(int *)((long)param_1 + 0x444) = *(int *)((long)param_1 + 0x444) + 1; if (*(int *)((long)param_1 + 0x444) != *(int *)(param_1 + 0x1f4a) + 1) { if ((uint)bVar1 == *(uint *)(param_1 + 8)) { if ((uint)(*(int *)(param_1 + 5) * 100000) <= *(uint *)((long)param_1 + 0x3c)) { return 1; } bVar1 = BZ2_indexIntoF(*(undefined4 *)((long)param_1 + 0x3c)); *(uint *)((long)param_1 + 0x3c) = (uint)*(ushort *) ((ulong)*(uint *)((long)param_1 + 0x3c) * 2 + param_1[0x18b]) | (*(byte *)((ulong)(*(uint *)((long)param_1 + 0x3c) >> 1) + param_1[0x18c]) >> (sbyte)((*(uint *)((long)param_1 + 0x3c) & 1) << 2) & 0xf) << 0x10; if (*(int *)(param_1 + 3) == 0) { *(undefined4 *)(param_1 + 3) = *(undefined4 *)(&BZ2_rNums + (long)*(int *)((long)param_1 + 0x1c) * 4); *(int *)((long)param_1 + 0x1c) = *(int *)((long)param_1 + 0x1c) + 1; if (*(int *)((long)param_1 + 0x1c) == 0x200) { *(undefined4 *)((long)param_1 + 0x1c) = 0; } } *(int *)(param_1 + 3) = *(int *)(param_1 + 3) + -1; *(int *)((long)param_1 + 0x444) = *(int *)((long)param_1 + 0x444) + 1; *(uint *)(param_1 + 2) = (bVar1 ^ *(int *)(param_1 + 3) == 1) + 4; if ((uint)(*(int *)(param_1 + 5) * 100000) <= *(uint *)((long)param_1 + 0x3c)) { return 1; } uVar2 = BZ2_indexIntoF(*(undefined4 *)((long)param_1 + 0x3c)); *(undefined4 *)(param_1 + 8) = uVar2; *(uint *)((long)param_1 + 0x3c) = (uint)*(ushort *) ((ulong)*(uint *)((long)param_1 + 0x3c) * 2 + param_1[0x18b]) | (*(byte *)((ulong)(*(uint *)((long)param_1 + 0x3c) >> 1) + param_1[0x18c]) >> (sbyte)((*(uint *)((long)param_1 + 0x3c) & 1) << 2) & 0xf) << 0x10; if (*(int *)(param_1 + 3) == 0) { *(undefined4 *)(param_1 + 3) = *(undefined4 *)(&BZ2_rNums + (long)*(int *)((long)param_1 + 0x1c) * 4); *(int *)((long)param_1 + 0x1c) = *(int *)((long)param_1 + 0x1c) + 1; if (*(int *)((long)param_1 + 0x1c) == 0x200) { *(undefined4 *)((long)param_1 + 0x1c) = 0; } } *(int *)(param_1 + 3) = *(int *)(param_1 + 3) + -1; *(uint *)(param_1 + 8) = *(uint *)(param_1 + 8) ^ (uint)(*(int *)(param_1 + 3) == 1); *(int *)((long)param_1 + 0x444) = *(int *)((long)param_1 + 0x444) + 1; } else { *(uint *)(param_1 + 8) = (uint)bVar1; } } } else { *(uint *)(param_1 + 8) = (uint)bVar1; } } } else { *(uint *)(param_1 + 8) = (uint)bVar1; } } } else { **(undefined **)(*param_1 + 0x18) = *(undefined *)((long)param_1 + 0xc); *(uint *)(param_1 + 0x18e) = *(int *)(param_1 + 0x18e) << 8 ^ *(uint *)(&BZ2_crc32Table + (ulong)((uint)*(byte *)((long)param_1 + 0xc) ^ *(uint *)(param_1 + 0x18e) >> 0x18) * 4); *(int *)(param_1 + 2) = *(int *)(param_1 + 2) + -1; *(long *)(*param_1 + 0x18) = *(long *)(*param_1 + 0x18) + 1; *(int *)(*param_1 + 0x20) = *(int *)(*param_1 + 0x20) + -1; *(int *)(*param_1 + 0x24) = *(int *)(*param_1 + 0x24) + 1; if (*(int *)(*param_1 + 0x24) == 0) { *(int *)(*param_1 + 0x28) = *(int *)(*param_1 + 0x28) + 1; } } } } return 0; }
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"), program_name); printf (gettext ("Output who is currently logged in according to FILE.\nIf FILE is not specified, use %s. %s as FILE is common.\n\n") , "/var/run/utmp" , "/var/log/wtmp" ); 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 ("users"); } exit (status); }
void usage(int a1) { long v1; char *v2; char *v3; char *v4; FILE *v5; char *v6; FILE *v7; char *v8; v1 = program_name; if ( a1 ) { v2 = gettext("Try '%s --help' for more information.\n"); fprintf(stderr, v2, v1); } else { v3 = gettext("Usage: %s [OPTION]... [FILE]\n"); printf(v3, v1); v4 = gettext( "Output who is currently logged in according to FILE.\n" "If FILE is not specified, use %s. %s as FILE is common.\n" "\n"); printf(v4, "/var/run/utmp", "/var/log/wtmp"); v5 = stdout; v6 = gettext(" --help display this help and exit\n"); fputs_unlocked(v6, v5); v7 = stdout; v8 = gettext(" --version output version information and exit\n"); fputs_unlocked(v8, v7); emit_ancillary_info("users"); } exit(a1); }
void sv_path (name) char *name; { phash_flush (); }
long sv_path() { return phash_flush(); }
int diff_2_files (struct comparison *cmp) { int f; struct change *e, *p; struct change *script; int changes; if (read_files (cmp->file, files_can_be_treated_as_binary)) { if (cmp->file[0].stat.st_size != cmp->file[1].stat.st_size && 0 < cmp->file[0].stat.st_size && 0 < cmp->file[1].stat.st_size && (cmp->file[0].desc < 0 || (((( cmp->file[0].stat.st_mode )) & 0170000) == (0100000)) ) && (cmp->file[1].desc < 0 || (((( cmp->file[1].stat.st_mode )) & 0170000) == (0100000)) )) changes = 1; else if (cmp->file[0].desc == cmp->file[1].desc) changes = 0; else { size_t lcm_max = (9223372036854775807L) - 1; size_t buffer_size = buffer_lcm (sizeof (size_t), buffer_lcm (((cmp->file[0].stat).st_blksize), ((cmp->file[1].stat).st_blksize), lcm_max), lcm_max); for (f = 0; f < 2; f++) cmp->file[f].buffer = xrealloc (cmp->file[f].buffer, buffer_size); for (;; cmp->file[0].buffered = cmp->file[1].buffered = 0) { for (f = 0; f < 2; f++) if (0 <= cmp->file[f].desc) file_block_read (&cmp->file[f], buffer_size - cmp->file[f].buffered); if (cmp->file[0].buffered != cmp->file[1].buffered || memcmp (cmp->file[0].buffer, cmp->file[1].buffer, cmp->file[0].buffered)) { changes = 1; break; } if (cmp->file[0].buffered != buffer_size) { changes = 0; break; } } } briefly_report (changes, cmp->file); } else { struct context ctxt; lin diags; lin too_expensive; size_t s = cmp->file[0].buffered_lines + cmp->file[1].buffered_lines + 4; char *flag_space = zalloc (s); cmp->file[0].changed = flag_space + 1; cmp->file[1].changed = flag_space + cmp->file[0].buffered_lines + 3; discard_confusing_lines (cmp->file); ctxt.xvec = cmp->file[0].undiscarded; ctxt.yvec = cmp->file[1].undiscarded; diags = (cmp->file[0].nondiscarded_lines + cmp->file[1].nondiscarded_lines + 3); ctxt.fdiag = xmalloc (diags * (2 * sizeof *ctxt.fdiag)); ctxt.bdiag = ctxt.fdiag + diags; ctxt.fdiag += cmp->file[1].nondiscarded_lines + 1; ctxt.bdiag += cmp->file[1].nondiscarded_lines + 1; ctxt.heuristic = speed_large_files; too_expensive = 1; for (; diags != 0; diags >>= 2) too_expensive <<= 1; ctxt.too_expensive = ((4096) >= (too_expensive) ? (4096) : (too_expensive)); files[0] = cmp->file[0]; files[1] = cmp->file[1]; compareseq (0, cmp->file[0].nondiscarded_lines, 0, cmp->file[1].nondiscarded_lines, minimal, &ctxt); free (ctxt.fdiag - (cmp->file[1].nondiscarded_lines + 1)); shift_boundaries (cmp->file); if (output_style == OUTPUT_ED) script = build_reverse_script (cmp->file); else script = build_script (cmp->file); if (ignore_blank_lines || ignore_regexp.fastmap) { struct change *next = script; changes = 0; while (next && changes == 0) { struct change *this, *end; lin first0, last0, first1, last1; this = next; end = find_change (next); next = end->link; end->link = 0; if (analyze_hunk (this, &first0, &last0, &first1, &last1)) changes = 1; end->link = next; } } else changes = (script != 0); if (brief) briefly_report (changes, cmp->file); else { if (changes || !no_diff_means_no_output) { setup_output (file_label[0] ? file_label[0] : cmp->file[0].name, file_label[1] ? file_label[1] : cmp->file[1].name, cmp->parent != 0); switch (output_style) { case OUTPUT_CONTEXT: print_context_script (script, 0 ); break; case OUTPUT_UNIFIED: print_context_script (script, 1 ); break; case OUTPUT_ED: print_ed_script (script); break; case OUTPUT_FORWARD_ED: pr_forward_ed_script (script); break; case OUTPUT_RCS: print_rcs_script (script); break; case OUTPUT_NORMAL: print_normal_script (script); break; case OUTPUT_IFDEF: print_ifdef_script (script); break; case OUTPUT_SDIFF: print_sdiff_script (script); break; default: abort (); } finish_output (); } } free (cmp->file[0].undiscarded); free (flag_space); for (f = 0; f < 2; f++) { free (cmp->file[f].equivs); free (cmp->file[f].linbuf + cmp->file[f].linbuf_base); } for (e = script; e; e = p) { p = e->link; free (e); } if (! ((output_style) != OUTPUT_ED && (output_style) != OUTPUT_FORWARD_ED)) for (f = 0; f < 2; ++f) if (cmp->file[f].missing_newline) { error (0, 0, "%s: %s\n", file_label[f] ? file_label[f] : cmp->file[f].name, gettext ("No newline at end of file")); changes = 2; } } if (cmp->file[0].buffer != cmp->file[1].buffer) free (cmp->file[0].buffer); free (cmp->file[1].buffer); return changes; }
char diff_2_files(undefined8 *param_1) { char cVar1; int iVar2; undefined8 uVar3; long lVar4; long lVar5; undefined8 uVar6; undefined8 *puVar7; undefined8 *puVar8; long in_FS_OFFSET; byte bVar9; int local_d0; undefined local_c8 [8]; undefined local_c0 [8]; undefined local_b8 [8]; undefined local_b0 [8]; undefined8 *local_a8; undefined8 *local_a0; long local_98; long local_90; undefined8 *local_88; long local_80; void *local_78; undefined8 *local_70; undefined8 *local_68; undefined8 *local_60; undefined8 local_58; long local_50; undefined8 local_48; undefined8 local_40; long local_38; long local_30; undefined local_28; long local_20; long local_10; bVar9 = 0; local_10 = *(long *)(in_FS_OFFSET + 0x28); cVar1 = read_files(param_1,files_can_be_treated_as_binary); if (cVar1 == '\0') { local_80 = param_1[0x3f] + param_1[0x19] + 4; local_78 = (void *)zalloc(local_80); param_1[0x23] = (long)local_78 + 1; param_1[0x49] = param_1[0x19] + 3 + (long)local_78; discard_confusing_lines(param_1); local_48 = param_1[0x20]; local_40 = param_1[0x46]; local_98 = param_1[0x48] + param_1[0x22] + 3; lVar4 = xmalloc(local_98 * 0x10); local_38 = (param_1[0x48] + 1) * 8 + lVar4; local_30 = (param_1[0x48] + 1) * 8 + lVar4 + local_98 * 8; local_28 = speed_large_files; local_90 = 1; for (; local_98 != 0; local_98 = local_98 >> 2) { local_90 = local_90 << 1; } local_20 = 0x1000; if (0xfff < local_90) { local_20 = local_90; } puVar7 = param_1; puVar8 = &files; for (lVar4 = 0x26; lVar4 != 0; lVar4 = lVar4 + -1) { *puVar8 = *puVar7; puVar7 = puVar7 + (ulong)bVar9 * -2 + 1; puVar8 = puVar8 + (ulong)bVar9 * -2 + 1; } puVar7 = param_1 + 0x26; puVar8 = (undefined8 *)&DAT_00103130; for (lVar4 = 0x26; lVar4 != 0; lVar4 = lVar4 + -1) { *puVar8 = *puVar7; puVar7 = puVar7 + (ulong)bVar9 * -2 + 1; puVar8 = puVar8 + (ulong)bVar9 * -2 + 1; } compareseq(0,param_1[0x22],0,param_1[0x48],minimal,&local_48); free((void *)(param_1[0x48] * -8 + -8 + local_38)); shift_boundaries(param_1); if (output_style == 4) { local_a0 = (undefined8 *)build_reverse_script(param_1); } else { local_a0 = (undefined8 *)build_script(param_1); } if ((ignore_blank_lines == '\0') && (_setup_output == 0)) { cVar1 = local_a0 != (undefined8 *)0x0; } else { local_88 = local_a0; cVar1 = false; while ((local_88 != (undefined8 *)0x0 && ((bool)cVar1 == false))) { local_70 = local_88; local_68 = (undefined8 *)find_change(local_88); local_88 = (undefined8 *)*local_68; *local_68 = 0; iVar2 = analyze_hunk(local_70,local_c8,local_c0,local_b8,local_b0); if (iVar2 != 0) { cVar1 = true; } *local_68 = local_88; } } if ((char)brief == '\0') { if (((bool)cVar1 != false) || (no_diff_means_no_output != '\x01')) { if (brief._1_7_ == 0) { lVar4 = param_1[0x27]; } else { lVar4 = (ulong)brief._1_7_ << 8; } lVar5 = file_label; if (file_label == 0) { lVar5 = param_1[1]; } setup_output(lVar5,lVar4,param_1[0x4c] != 0); switch(output_style) { default: abort(); case 1: print_normal_script(local_a0); break; case 2: print_context_script(local_a0,0); break; case 3: print_context_script(local_a0,1); break; case 4: print_ed_script(local_a0); break; case 5: pr_forward_ed_script(local_a0); break; case 6: print_rcs_script(local_a0); break; case 7: print_ifdef_script(local_a0); break; case 8: print_sdiff_script(local_a0); } finish_output(); } } else { briefly_report(cVar1,param_1); } free((void *)param_1[0x20]); free(local_78); for (local_d0 = 0; local_d0 < 2; local_d0 = local_d0 + 1) { free((void *)param_1[(long)local_d0 * 0x26 + 0x1f]); free((void *)(param_1[(long)local_d0 * 0x26 + 0x18] * 8 + param_1[(long)local_d0 * 0x26 + 0x17])); } local_a8 = local_a0; while (local_a8 != (undefined8 *)0x0) { local_60 = (undefined8 *)*local_a8; free(local_a8); local_a8 = local_60; } if ((output_style == 4) || (output_style == 5)) { for (local_d0 = 0; local_d0 < 2; local_d0 = local_d0 + 1) { if (*(char *)(param_1 + (long)local_d0 * 0x26 + 0x24) != '\0') { uVar3 = gettext("No newline at end of file"); if ((&file_label)[local_d0] == 0) { uVar6 = param_1[(long)local_d0 * 0x26 + 1]; } else { uVar6 = (&file_label)[local_d0]; } error(0,0,"%s: %s\n",uVar6,uVar3); cVar1 = '\x02'; } } } } else { if (((((param_1[8] == param_1[0x2e]) || ((long)param_1[8] < 1)) || ((long)param_1[0x2e] < 1)) || ((-1 < *(int *)param_1 && ((*(uint *)(param_1 + 5) & 0xf000) != 0x8000)))) || ((-1 < *(int *)(param_1 + 0x26) && ((*(uint *)(param_1 + 0x2b) & 0xf000) != 0x8000)))) { if (*(int *)param_1 == *(int *)(param_1 + 0x26)) { cVar1 = '\0'; } else { local_58 = 0x7ffffffffffffffe; uVar3 = buffer_lcm(param_1[9],param_1[0x2f],0x7ffffffffffffffe); local_50 = buffer_lcm(8,uVar3,local_58); for (local_d0 = 0; local_d0 < 2; local_d0 = local_d0 + 1) { uVar3 = xrealloc(param_1[(long)local_d0 * 0x26 + 0x14],local_50); param_1[(long)local_d0 * 0x26 + 0x14] = uVar3; } while( true ) { for (local_d0 = 0; local_d0 < 2; local_d0 = local_d0 + 1) { if (-1 < *(int *)(param_1 + (long)local_d0 * 0x26)) { file_block_read(param_1 + (long)local_d0 * 0x26, local_50 - param_1[(long)local_d0 * 0x26 + 0x16]); } } if ((param_1[0x16] != param_1[0x3c]) || (iVar2 = memcmp((void *)param_1[0x14],(void *)param_1[0x3a],param_1[0x16]), iVar2 != 0) ) { cVar1 = '\x01'; goto LAB_0010252e; } if (local_50 != param_1[0x16]) break; param_1[0x3c] = 0; param_1[0x16] = param_1[0x3c]; } cVar1 = '\0'; } } else { cVar1 = '\x01'; } LAB_0010252e: briefly_report(cVar1,param_1); } if (param_1[0x14] != param_1[0x3a]) { free((void *)param_1[0x14]); } free((void *)param_1[0x3a]); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return cVar1; }
void brelse(struct buffer_head *bh) { if (bh->b_dirty) ll_rw_block(1, 0, 1, &bh); do { if ((3) <= (-1)) { printf ("" "(%s, %d): %s: ", "journal.c", 218, __FUNCTION__); printf ("freeing block %llu/%p (total %d)\n", bh->b_blocknr, (void *) bh, --bh_count); } } while (0) ; ext2fs_free_mem(&bh); }
void brelse(struct_0 *a0) { char v0; unsigned long long v2; if ((a0->field_18 & 1)) ll_rw_block(0x1, 0x0, 0x1, &v0); v2 = ext2fs_free_mem(&v0); return; }
static int ssh_packet_enable_delayed_compress(struct ssh *ssh) { struct session_state *state = ssh->state; struct sshcomp *comp = ((void *)0) ; int r, mode; state->after_authentication = 1; for (mode = 0; mode < MODE_MAX; mode++) { if (state->newkeys[mode] == ((void *)0) ) continue; comp = &state->newkeys[mode]->comp; if (comp && !comp->enabled && comp->type == 2) { if ((r = ssh_packet_init_compression(ssh)) != 0) return r; if (mode == MODE_OUT) { if ((r = start_compression_out(ssh, 6)) != 0) return r; } else { if ((r = start_compression_in(ssh)) != 0) return r; } comp->enabled = 1; } } return 0; }
long ssh_packet_enable_delayed_compress(long *a1) { int i; unsigned int inited; unsigned int started; unsigned int v5; long v6; _DWORD *v7; v6 = *a1; *(_DWORD *)(*a1 + 328) = 1; for ( i = 0; i <= 1; ++i ) { if ( *(_QWORD *)(v6 + 8 * (i + 42LL) + 8) ) { v7 = (_DWORD *)(*(_QWORD *)(v6 + 8 * (i + 42LL) + 8) + 104LL); if ( *(_QWORD *)(v6 + 8 * (i + 42LL) + 8) != -104LL && !*(_DWORD *)(*(_QWORD *)(v6 + 8 * (i + 42LL) + 8) + 108LL) && *v7 == 2 ) { inited = ssh_packet_init_compression(a1); if ( inited ) return inited; if ( i == 1 ) { started = start_compression_out((long)a1, 6u); if ( started ) return started; } else { v5 = start_compression_in((long)a1); if ( v5 ) return v5; } v7[1] = 1; } } } return 0LL; }
static _Bool zero_block_p (char const *buffer, size_t size) { while (size--) if (*buffer++) return 0 ; return 1 ; }
int zero_block_p(unsigned long a0, unsigned long long a1) { unsigned long long v0; int tmp_9; char *v1; unsigned int v3; v1 = a0; v0 = a1; do { v3 = v0; v0 -= 1; if (!v3) { v3 = 1; goto LABEL_40041b; } tmp_9 = v1; v1 += 1; *(&v3) = *(tmp_9); } while (!v3); v3 = 0; LABEL_40041b: return v3; }
static inline _Bool nonexistent_file_errno (int errnum) { switch (errnum) { case 84 : case 22 : case 2 : case 20 : return 1 ; default: return 0 ; } }
undefined8 nonexistent_file_errno(int param_1) { undefined8 uVar1; if ((param_1 == 0x54) || ((param_1 < 0x55 && ((param_1 == 0x16 || ((param_1 < 0x17 && ((param_1 == 2 || (param_1 == 0x14)))))))))) { uVar1 = 1; } else { uVar1 = 0; } return uVar1; }
int glob_pattern_p (pattern) const char *pattern; { size_t n; wchar_t *wpattern; int r; if ( (__ctype_get_mb_cur_max ()) == 1 || mbsmbchar (pattern) == 0) return (internal_glob_pattern_p ((unsigned char *)pattern)); n = xdupmbstowcs (&wpattern, ((void *)0) , pattern); if (n == (size_t)-1) return (internal_glob_pattern_p ((unsigned char *)pattern)); r = internal_glob_wpattern_p (wpattern); sh_xfree((wpattern), "glob.c", 179); return r; }
long glob_pattern_p(_BYTE *a1) { unsigned int v2; _DWORD *v3; long v4; unsigned long v5; v5 = __readfsqword(0x28u); if ( _ctype_get_mb_cur_max() == 1 || !mbsmbchar(a1) ) return internal_glob_pattern_p(a1); v4 = xdupmbstowcs(&v3, 0LL, a1); if ( v4 == -1 ) return internal_glob_pattern_p(a1); v2 = internal_glob_wpattern_p(v3); sh_xfree(v3, "glob.c", 179LL); return v2; }
static _Bool xheader_keyword_override_p (const char *keyword) { struct keyword_list *kp; for (kp = keyword_override_list; kp; kp = kp->next) if (strcmp (kp->pattern, keyword) == 0) return 1 ; return 0 ; }
int xheader_keyword_override_p(char *a0) { unsigned long long v0[2]; unsigned int v2; v0[0] = keyword_override_list; while (true) { if (v0) { v2 = strcmp(v0[1], a0); if (!v2) { v2 = 1; break; } else { v0[0] = v0[0]; } } else { v2 = 0; break; } } return v2; }
static struct fsys_namenode *th_nn_find(const char *name, _Bool nonew) { return fsys_hash_find_node(name, nonew ? FHFF_NONE : 0); } static struct trigfileint **th_nn_interested(struct fsys_namenode *fnn) { return &fnn->trig_interested; } static const char *th_nn_name(struct fsys_namenode *fnn) { return fnn->name; }
void th_nn_find(undefined8 param_1,char param_2) { undefined8 uVar1; if (param_2 == '\0') { uVar1 = 0; } else { uVar1 = 2; } fsys_hash_find_node(param_1,uVar1); return; }
static int handle_error(socket_st * hd, int err) { int alert, ret; const char *err_type, *str; if (err >= 0 || err == -28 || err == -52) return 0; if (gnutls_error_is_fatal(err) == 0) { ret = 0; err_type = "Non fatal"; } else { ret = err; err_type = "Fatal"; } str = gnutls_strerror(err); if (str == ((void *)0) ) str = str_unknown; fprintf( stderr , "*** %s error: %s\n", err_type, str); if (err == -16 || err == -12) { alert = gnutls_alert_get(hd->session); str = gnutls_alert_get_name(alert); if (str == ((void *)0) ) str = str_unknown; log_msg( stdout , "*** Received alert [%d]: %s\n", alert, str); } check_server_cmd(hd, err); return ret; }
int handle_error(long param_1,int param_2) { int iVar1; undefined4 uVar2; int local_20; char *local_18; undefined8 *local_10; if (((param_2 < 0) && (param_2 != -0x1c)) && (param_2 != -0x34)) { iVar1 = gnutls_error_is_fatal(param_2); if (iVar1 == 0) { local_20 = 0; local_18 = "Non fatal"; } else { local_18 = "Fatal"; local_20 = param_2; } local_10 = (undefined8 *)gnutls_strerror(param_2); if (local_10 == (undefined8 *)0x0) { local_10 = &str_unknown; } fprintf(stderr,"*** %s error: %s\n",local_18,local_10); if ((param_2 == -0x10) || (param_2 == -0xc)) { uVar2 = gnutls_alert_get(*(undefined8 *)(param_1 + 8)); local_10 = (undefined8 *)gnutls_alert_get_name(uVar2); if (local_10 == (undefined8 *)0x0) { local_10 = &str_unknown; } log_msg(stdout,"*** Received alert [%d]: %s\n",uVar2,local_10); } check_server_cmd(param_1,param_2); } else { local_20 = 0; } return local_20; }
static void queue_insert (struct merge_node_queue *queue, struct merge_node *node) { pthread_mutex_lock (&queue->mutex); heap_insert (queue->priority_queue, node); node->queued = 1 ; pthread_cond_signal (&queue->cond); pthread_mutex_unlock (&queue->mutex); }
void queue_insert(unsigned long long *a0, struct_0 *a1) { unsigned long long v1; pthread_mutex_lock(a0 + 1); heap_insert(*(a0), a1, a1); a1->field_54 = 1; pthread_cond_signal(a0 + 6); v1 = pthread_mutex_unlock(a0 + 1); return; }
static inline void emit_stdin_note (void) { fputs_unlocked (gettext ("\nWith no FILE, or when FILE is -, read standard input.\n"), stdout ) ; }
void emit_stdin_note() { unsigned long long v1; v1 = fputs_unlocked(gettext("\nWith no FILE, or when FILE is -, read standard input.\n"), stdout); return; }
static char ** history_tokenize_internal (const char *string, int wind, int *indp) { char **result; register int i, start, result_index, size; if (indp && wind != -1) *indp = -1; for (i = result_index = size = 0, result = (char **) ((void *)0) ; string[i]; ) { for (; string[i] && ((((string[i]) == ' ') || ((string[i]) == '\t')) || (string[i]) == '\n'); i++) ; if (string[i] == 0 || string[i] == history_comment_char) return (result); start = i; i = history_tokenize_word (string, start); if (i == start && history_word_delimiters) { i++; while (string[i] && ((string[i]) ? ((char *)strchr ((history_word_delimiters), (string[i])) != (char *) ((void *)0) ) : 0)) i++; } if (indp && wind != -1 && wind >= start && wind < i) *indp = result_index; if (result_index + 2 >= size) result = (char **)xrealloc (result, ((size += 10) * sizeof (char *))); result[result_index++] = history_substring (string, start, i); result[result_index] = (char *) ((void *)0) ; } return (result); }
int history_tokenize_internal(void* a0, unsigned long a1, unsigned int *a2) { void* v0; void* v2; unsigned long v3; unsigned int v4; if (a2 && a1 != -1) *(a2) = -1; v2 = 0; v0 = 0; while (true) { if (!*((a0 + v2))) { v4 = v0; return v4; } while (true) { switch (*((a0 + v2))) { case 9: case 10: case 32: v2 = v2 + 1; break; default: goto LABEL_403855; } } LABEL_403855: if (!(*((a0 + v2))) || !(*((a0 + v2)) != history_comment_char)) break; v3 = v2; v2 = history_tokenize_word(a0, v2); if (v2 == v3 && history_word_delimiters) { for (v2 = v2 + 1; *((a0 + v2)) && *((a0 + v2)) && strchr(history_word_delimiters, *((a0 + v2))); v2 = v2 + 1); } if (a2 && a1 != -1 && a1 >= v3 && a1 < v2) *(a2) = 0; if (0 <= 2) v0 = xrealloc(v0, 0x50, 0x50); *(v0) = history_substring(a0, v3, v2); *(&v0[8]) = 0; } v4 = v0; return v4; }
static void update_parents(struct dx_dir_info *dx_dir, int type) { struct dx_dirblock_info *dx_db, *dx_parent, *dx_previous; blk_t b; for (b = 0, dx_db = dx_dir->dx_block; b < dx_dir->numblocks; b++, dx_db++) { dx_parent = &dx_dir->dx_block[dx_db->parent]; if (dx_db->type != type) continue; if (dx_db->flags & 4) { dx_parent->min_hash = dx_db->min_hash; if (dx_parent->previous) { dx_previous = &dx_dir->dx_block[dx_parent->previous]; dx_previous->node_max_hash = dx_parent->min_hash; } } if (dx_db->flags & 8) { dx_parent->max_hash = dx_db->max_hash; } } }
void update_parents(long param_1,int param_2) { long lVar1; uint local_24; int *local_20; local_24 = 0; local_20 = *(int **)(param_1 + 0x10); for (; local_24 < *(uint *)(param_1 + 8); local_24 = local_24 + 1) { lVar1 = *(long *)(local_20 + 4) * 0x30 + *(long *)(param_1 + 0x10); if (param_2 == *local_20) { if (((local_20[1] & 4U) != 0) && (*(int *)(lVar1 + 0x20) = local_20[8], *(long *)(lVar1 + 0x18) != 0)) { *(undefined4 *)(*(long *)(lVar1 + 0x18) * 0x30 + *(long *)(param_1 + 0x10) + 0x2c) = *(undefined4 *)(lVar1 + 0x20); } if ((local_20[1] & 8U) != 0) { *(int *)(lVar1 + 0x24) = local_20[9]; } } local_20 = local_20 + 0xc; } return; }
static int expand_and_print_history (list) WORD_LIST *list; { char *s; int r, result; if (hist_last_line_pushed == 0 && hist_last_line_added && bash_delete_last_history () == 0) return 1; result = 0; while (list) { r = history_expand (list->word->word, &s); if (r < 0) { builtin_error (gettext("%s: history expansion failed"), list->word->word); result = 1; } else { fputs (s, stdout ); putchar ('\n'); } do { if (s) sh_xfree((s), "./history.def", 457); } while (0); list = list->next; } fflush ( stdout ); return result; }
long expand_and_print_history(long ***a1) { char *v2; unsigned int v4; char *s[4]; s[1] = (char *)__readfsqword(0x28u); if ( !hist_last_line_pushed && hist_last_line_added && !(unsigned int)bash_delete_last_history() ) return 1LL; v4 = 0; while ( a1 ) { if ( (int)history_expand(*a1[1], s) >= 0 ) { fputs(s[0], stdout); putchar(10); } else { v2 = gettext("%s: history expansion failed"); builtin_error(v2); v4 = 1; } if ( s[0] ) sh_xfree(s[0], "./history.def", 457LL); a1 = (long ***)*a1; } fflush(stdout); return v4; }
static void update_age ( const struct spwd *sp, const struct passwd *pw) { struct spwd spwent; if ( ((void *)0) == sp) { struct passwd pwent = *pw; explicit_bzero((&spwent), (sizeof spwent)); spwent.sp_namp = xstrdup (pwent.pw_name); spwent.sp_pwdp = xstrdup (pwent.pw_passwd); spwent.sp_flag = ((unsigned long int)-1); pwent.pw_passwd = "x"; if (pw_update (&pwent) == 0) { fprintf ( stderr , gettext ("%s: failed to prepare the new %s entry '%s'\n"), Prog, pw_dbname (), pwent.pw_name); fail_exit (1); } } else { spwent.sp_namp = xstrdup (sp->sp_namp); spwent.sp_pwdp = xstrdup (sp->sp_pwdp); spwent.sp_flag = sp->sp_flag; } spwent.sp_max = maxdays; spwent.sp_min = mindays; spwent.sp_lstchg = lstchgdate; spwent.sp_warn = warndays; spwent.sp_inact = inactdays; spwent.sp_expire = expdate; if (spw_update (&spwent) == 0) { fprintf ( stderr , gettext ("%s: failed to prepare the new %s entry '%s'\n"), Prog, spw_dbname (), spwent.sp_namp); fail_exit (1); } }
unsigned long update_age(_QWORD *a1, long *a2) { const char *v2; long v3; long v4; long v5; long v6; long v7; char *v8; long v9; long v10; long v11; char *v12; long v14; const char *v15; long v16; long v17; long v18; long v19; long v20; long v21; long v22; long v23; long v24; long v25; long v26; long v27; long v28; unsigned long v29; v29 = __readfsqword(0x28u); if ( a1 ) { v20 = xstrdup(*a1); v21 = xstrdup(a1[1]); v28 = a1[8]; } else { v2 = (const char *)a2[1]; v14 = *a2; v15 = v2; v3 = a2[3]; v16 = a2[2]; v17 = v3; v4 = a2[5]; v18 = a2[4]; v19 = v4; explicit_bzero(&v20, 72LL); v20 = xstrdup(v14); v21 = xstrdup(v15); v28 = -1LL; v15 = "x"; if ( !(unsigned int)pw_update(&v14) ) { v5 = v14; v6 = pw_dbname(); v7 = Prog; v8 = gettext("%s: failed to prepare the new %s entry '%s'\n"); fprintf(stderr, v8, v7, v6, v5); fail_exit(1); } } v24 = maxdays; v23 = mindays; v22 = lstchgdate; v25 = warndays; v26 = inactdays; v27 = expdate; if ( !(unsigned int)spw_update(&v20) ) { v9 = v20; v10 = spw_dbname(); v11 = Prog; v12 = gettext("%s: failed to prepare the new %s entry '%s'\n"); fprintf(stderr, v12, v11, v10, v9); fail_exit(1); } return __readfsqword(0x28u) ^ v29; }
int inflate(void) { int e; int r; unsigned h; outcnt = 0; bk = 0; bb = 0; h = 0; do { hufts = 0; if ((r = inflate_block(&e)) != 0) return r; if (hufts > h) h = hufts; } while (!e); while (bk >= 8) { bk -= 8; inptr--; } (outcnt=(outcnt),flush_window()); ; return 0; }
long long inflate() { char v0; unsigned int v1; unsigned int v2; void* v4; outcnt = 0; bk = 0; bb = 0; v1 = 0; while (true) { hufts = 0; v2 = inflate_block(&v0); if (v2) { v4 = v2; break; } else { if (v1 < hufts) v1 = hufts; if (!*(&v0)) continue; for (; bk > 7; inptr = inptr - 1) { bk = bk - 8; } outcnt = outcnt; flush_window(); v4 = 0; break; } } return v4; }
static int fill_dir_block(ext2_filsys fs, blk64_t *block_nr, e2_blkcnt_t blockcnt, blk64_t ref_block __attribute__((unused)), int ref_offset __attribute__((unused)), void *priv_data) { struct fill_dir_struct *fd = (struct fill_dir_struct *) priv_data; struct hash_entry *ent; struct ext2_dir_entry *dirent; char *dir; unsigned int offset, dir_offset, rec_len, name_len; int hash_alg, hash_flags, hash_in_entry; if (blockcnt < 0) return 0; offset = blockcnt * fs->blocksize; if (offset + fs->blocksize > fd->inode->i_size) { fd->err = (2133571363L); return 2; } dir = (fd->buf+offset); if (*block_nr == 0) { memset(dir, 0, fs->blocksize); dirent = (struct ext2_dir_entry *) dir; (void) ext2fs_set_rec_len(fs, fs->blocksize, dirent); } else { int flags = fs->flags; fs->flags |= 0x200000; fd->err = ext2fs_read_dir_block4(fs, *block_nr, dir, 0, fd->dir); fs->flags = (flags & 0x200000) | (fs->flags & ~0x200000); if (fd->err) return 2; } hash_flags = fd->inode->i_flags & 0x40000000; hash_in_entry = ext4_hash_in_dirent(fd->inode); hash_alg = fs->super->s_def_hash_version; if ((hash_alg <= 2) && (fs->super->s_flags & 0x0002)) hash_alg += 3; dir_offset = 0; while (dir_offset < fs->blocksize) { unsigned int min_rec = 8; int extended = hash_in_entry && !is_fake_entry(fs, blockcnt, dir_offset); if (extended) min_rec += 8; dirent = (struct ext2_dir_entry *) (dir + dir_offset); (void) ext2fs_get_rec_len(fs, dirent, &rec_len); name_len = ext2fs_dirent_name_len(dirent); if (((dir_offset + rec_len) > fs->blocksize) || (rec_len < min_rec) || ((rec_len % 4) != 0) || (name_len + min_rec > rec_len)) { fd->err = (2133571363L); return 2; } dir_offset += rec_len; if (dirent->inode == 0) continue; if ((name_len) == 0) { fd->err = (2133571363L); return 2; } if (!fd->compress && (name_len == 1) && (dirent->name[0] == '.')) continue; if (!fd->compress && (name_len == 2) && (dirent->name[0] == '.') && (dirent->name[1] == '.')) { fd->parent = dirent->inode; continue; } if (fd->num_array >= fd->max_array) { errcode_t retval; retval = ext2fs_resize_array(sizeof(struct hash_entry), fd->max_array, fd->max_array + 500, &fd->harray); if (retval) { fd->err = retval; return 2; } fd->max_array += 500; } ent = fd->harray + fd->num_array++; ent->dir = dirent; fd->dir_size += ext2fs_dir_rec_len(name_len, extended); ent->ino = dirent->inode; if (extended) { ent->hash = (( __u32)(__le32)(((struct ext2_dir_entry_hash *) &dirent->name[ (ext2fs_dirent_name_len(dirent) + (4 - 1)) & ~(4 - 1)])->hash)); ent->minor_hash = (( __u32)(__le32)(((struct ext2_dir_entry_hash *) &dirent->name[ (ext2fs_dirent_name_len(dirent) + (4 - 1)) & ~(4 - 1)])->minor_hash)); } else if (fd->compress) { ent->hash = ent->minor_hash = 0; } else { fd->err = ext2fs_dirhash2(hash_alg, dirent->name, name_len, fs->encoding, hash_flags, fs->super->s_hash_seed, &ent->hash, &ent->minor_hash); if (fd->err) return 2; } } return 0; }
undefined8 fill_dir_block(long param_1,long *param_2,ulong param_3,undefined8 param_4,undefined8 param_5, long *param_6) { int iVar1; uint uVar2; undefined8 uVar3; long lVar4; long in_FS_OFFSET; uint local_60; uint local_5c; uint local_58; uint local_54; uint local_50; uint local_4c; uint local_48; int local_44; int local_40; uint local_3c; long *local_38; uint *local_30; uint *local_28; long local_20; undefined4 *local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_38 = param_6; if ((long)param_3 < 0) { uVar3 = 0; } else { local_50 = *(int *)(param_1 + 0x28) * (int)param_3; if (*(uint *)(param_6[1] + 4) < *(int *)(param_1 + 0x28) + local_50) { param_6[3] = 0x7f2bb723; uVar3 = 2; } else { local_30 = (uint *)((ulong)local_50 + *param_6); if (*param_2 == 0) { memset(local_30,0,(ulong)*(uint *)(param_1 + 0x28)); local_28 = local_30; ext2fs_set_rec_len(param_1,*(undefined4 *)(param_1 + 0x28),local_30); } else { local_4c = *(uint *)(param_1 + 0x10); *(uint *)(param_1 + 0x10) = *(uint *)(param_1 + 0x10) | 0x200000; lVar4 = ext2fs_read_dir_block4(param_1,*param_2,local_30,0,*(undefined4 *)(param_6 + 9)); local_38[3] = lVar4; *(uint *)(param_1 + 0x10) = local_4c & 0x200000 | *(uint *)(param_1 + 0x10) & 0xffdfffff; if (local_38[3] != 0) { uVar3 = 2; goto LAB_00100ce6; } } local_48 = *(uint *)(local_38[1] + 0x20) & 0x40000000; local_44 = ext4_hash_in_dirent(local_38[1]); local_58 = (uint)*(byte *)(*(long *)(param_1 + 0x20) + 0xfc); if ((local_58 < 3) && ((*(uint *)(*(long *)(param_1 + 0x20) + 0x160) & 2) != 0)) { local_58 = local_58 + 3; } local_5c = 0; do { while( true ) { while( true ) { while( true ) { do { do { if (*(uint *)(param_1 + 0x28) <= local_5c) { uVar3 = 0; goto LAB_00100ce6; } local_54 = 8; if ((local_44 == 0) || (iVar1 = is_fake_entry(param_1,param_3 & 0xffffffff,local_5c), iVar1 != 0)) { local_40 = 0; } else { local_40 = 1; } if (local_40 != 0) { local_54 = local_54 + 8; } local_28 = (uint *)((long)local_30 + (ulong)local_5c); ext2fs_get_rec_len(param_1,local_28,&local_60); local_3c = ext2fs_dirent_name_len(local_28); if ((((*(uint *)(param_1 + 0x28) < local_60 + local_5c) || (local_60 < local_54)) || ((local_60 & 3) != 0)) || (local_60 < local_3c + local_54)) { local_38[3] = 0x7f2bb723; uVar3 = 2; goto LAB_00100ce6; } local_5c = local_5c + local_60; } while (*local_28 == 0); if (local_3c == 0) { local_38[3] = 0x7f2bb723; uVar3 = 2; goto LAB_00100ce6; } } while (((*(int *)(local_38 + 8) == 0) && (local_3c == 1)) && (*(char *)(local_28 + 2) == '.')); if (((*(int *)(local_38 + 8) != 0) || (local_3c != 2)) || ((*(char *)(local_28 + 2) != '.' || (*(char *)((long)local_28 + 9) != '.')))) break; *(uint *)((long)local_38 + 0x44) = *local_28; } if (*(uint *)(local_38 + 6) <= *(uint *)((long)local_38 + 0x34)) { local_20 = ext2fs_resize_array(0x18,*(undefined4 *)(local_38 + 6), *(int *)(local_38 + 6) + 500); if (local_20 != 0) { local_38[3] = local_20; uVar3 = 2; goto LAB_00100ce6; } *(int *)(local_38 + 6) = *(int *)(local_38 + 6) + 500; } uVar2 = *(uint *)((long)local_38 + 0x34); *(uint *)((long)local_38 + 0x34) = uVar2 + 1; local_18 = (undefined4 *)((ulong)uVar2 * 0x18 + local_38[5]); *(uint **)(local_18 + 4) = local_28; uVar2 = ext2fs_dir_rec_len(local_3c & 0xff); local_38[7] = (ulong)uVar2 + local_38[7]; *(ulong *)(local_18 + 2) = (ulong)*local_28; if (local_40 == 0) break; iVar1 = ext2fs_dirent_name_len(local_28); *local_18 = *(undefined4 *)((long)local_28 + (long)(int)(iVar1 + 3U & 0xfffffffc) + 8); iVar1 = ext2fs_dirent_name_len(local_28); local_18[1] = *(undefined4 *) ((long)local_28 + (long)(int)(iVar1 + 3U & 0xfffffffc) + 0xc); } if (*(int *)(local_38 + 8) == 0) break; local_18[1] = 0; *local_18 = local_18[1]; } lVar4 = ext2fs_dirhash2(local_58,local_28 + 2,local_3c,*(undefined8 *)(param_1 + 0x168), local_48,*(long *)(param_1 + 0x20) + 0xec,local_18,local_18 + 1); local_38[3] = lVar4; } while (local_38[3] == 0); uVar3 = 2; } } LAB_00100ce6: if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return uVar3; } __stack_chk_fail(); }
static void add_to_grand_total (struct field_values_t *bv, struct field_values_t *iv) { if (known_value (iv->total)) grand_fsu.fsu_files += iv->total; if (known_value (iv->available)) grand_fsu.fsu_ffree += iv->available; if (known_value (bv->total)) grand_fsu.fsu_blocks += bv->input_units * bv->total; if (known_value (bv->available_to_root)) grand_fsu.fsu_bfree += bv->input_units * bv->available_to_root; if (known_value (bv->available)) add_uint_with_neg_flag (&grand_fsu.fsu_bavail, &grand_fsu.fsu_bavail_top_bit_set, bv->input_units * bv->available, bv->negate_available); }
void add_to_grand_total(struct_0 *a0, unsigned long long a1[4]) { unsigned long long v2; if (known_value(a1[2])) g_404068 = a1[2] + g_404068; if (known_value(a1[3])) g_404070 = a1[3] + g_404070; if (known_value(a0->field_10)) g_404048 = a0->field_0 * a0->field_10 + g_404048; if (known_value(a0->field_28)) g_404050 = a0->field_0 * a0->field_28 + g_404050; if (known_value(a0->field_18)) v2 = add_uint_with_neg_flag(&g_404058, &g_404060, a0->field_0 * a0->field_18, a0->field_20); return; }
static void print_encap_seg6(FILE *fp, struct rtattr *encap) { struct rtattr *tb[(__SEG6_IPTUNNEL_MAX - 1)+1]; struct seg6_iptunnel_encap *tuninfo; (parse_rtattr_flags((tb), ((__SEG6_IPTUNNEL_MAX - 1)), ((void*)(((char*)(encap)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((encap)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))); if (!tb[SEG6_IPTUNNEL_SRH]) return; tuninfo = ((void*)(((char*)(tb[SEG6_IPTUNNEL_SRH])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); print_string(PRINT_ANY, "mode", "mode %s ", format_seg6mode_type(tuninfo->mode)); print_srh(fp, tuninfo->srh); }
void print_encap_seg6(void* a0, unsigned short *a1) { unsigned int *v0; char v1; char v2; char v3; unsigned long long *v5; unsigned long long v6; parse_rtattr_flags(&v1, 0x1, a1 + 2, *(a1) - 4, 0x8000); if (*(&v2)) { v0 = *(&v2) + 4; print_string(0x4, "mode", "mode %s ", format_seg6mode_type(*(v0))); print_srh(a0, v0 + 1); } v6 = *(&v3) ^ v5[5]; return; }
static void channel_pre_connecting(struct ssh *ssh, Channel *c) { sshlog("channels.c", __func__, 1108, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "channel %d: waiting for connection", c->self); c->io_want = 0x20; }
long channel_pre_connecting(long a1, long a2) { long result; sshlog( "channels.c", "channel_pre_connecting", 1108LL, 0LL, 7LL, 0LL, "channel %d: waiting for connection", *(unsigned int *)(a2 + 4)); result = a2; *(_DWORD *)(a2 + 44) = 32; return result; }
static int skip_double_quoted (string, slen, sind, flags) char *string; size_t slen; int sind; int flags; { int c, i; char *ret; int pass_next, backquote, si; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); pass_next = backquote = 0; i = sind; while (c = string[i]) { if (pass_next) { pass_next = 0; do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0); continue; } else if (c == '\\') { pass_next++; i++; continue; } else if (backquote) { if (c == '`') backquote = 0; do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0); continue; } else if (c == '`') { backquote++; i++; continue; } else if (c == '$' && ((string[i + 1] == '(') || (string[i + 1] == '{'))) { si = i + 2; if (string[i + 1] == '(') ret = extract_command_subst (string, &si, 0x0001|(flags&0x0400)); else ret = extract_dollar_brace_string (string, &si, 0x001, 0x0001); if (si >= slen) { i = slen; c = 0; break; } else; i = si + 1; continue; } else if (c != '"') { do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0); continue; } else break; } if (c) i++; return (i); } static inline char * string_extract_single_quoted (string, sindex, allowesc) char *string; int *sindex; int allowesc; { register int i; size_t slen; char *t; int pass_next; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); slen = ( (__ctype_get_mb_cur_max ()) > 1) ? strlen (string + *sindex) + *sindex : 0; i = *sindex; pass_next = 0; while (string[i]) { if (pass_next) { pass_next = 0; do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0); continue; } if (allowesc && string[i] == '\\') pass_next++; else if (string[i] == '\'') break; do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0); } t = substring (string, *sindex, i); if (string[i]) i++; *sindex = i; return (t); } static inline int skip_single_quoted (string, slen, sind, flags) const char *string; size_t slen; int sind; int flags; { register int c; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); c = sind; while (string[c] && string[c] != '\'') { if ((flags & 0x0400) && string[c] == '\\' && string[c+1] == '\'' && string[c+2]) do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[c]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[c] & 0x80) == 0)) mblength = (string)[c] != 0; else { state_bak = state; mblength = mbrlen ((string) + (c), (slen) - (c), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (c)++; } else if (mblength == 0) (c)++; else (c) += mblength; } else (c)++; } while (0); do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[c]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[c] & 0x80) == 0)) mblength = (string)[c] != 0; else { state_bak = state; mblength = mbrlen ((string) + (c), (slen) - (c), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (c)++; } else if (mblength == 0) (c)++; else (c) += mblength; } else (c)++; } while (0); } if (string[c]) c++; return c; } static char * string_extract_verbatim (string, slen, sindex, charlist, flags) char *string; size_t slen; int *sindex; char *charlist; int flags; { register int i; wchar_t *wcharlist; int c; char *temp; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); if ((flags & 0x0010) && charlist[0] == '\'' && charlist[1] == '\0') { temp = string_extract_single_quoted (string, sindex, 0); --*sindex; return temp; } if (*charlist == 0) { temp = string + *sindex; c = (*sindex == 0) ? slen : (((temp) && (temp)[0]) ? ((temp)[1] ? ((temp)[2] ? strlen(temp) : 2) : 1) : 0); temp = (char *)strcpy (sh_xmalloc((1 + strlen (temp)), "subst.c", 1195), (temp)); *sindex += c; return temp; } i = *sindex; wcharlist = 0; while (c = string[i]) { size_t mblength; if ((flags & 0x0010) == 0 && c == '\001') { i += 2; if (i >= slen) { i = slen; c = 0; break; } else; continue; } else if ((flags & 0x0020) == 0 && c == '\001' && string[i+1] == '\177') { i += 2; if (i >= slen) { i = slen; c = 0; break; } else; continue; } if (locale_utf8locale && slen > i && (((string[i]) & 0x80) == 0)) mblength = (string[i] != 0) ? 1 : 0; else mblength = (( (__ctype_get_mb_cur_max ()) > 1) ? mblen ((string + i), (slen - i)) : 1); if (mblength > 1) { wchar_t wc; mblength = mbtowc (&wc, string + i, slen - i); if (((mblength) == (size_t)-1 || (mblength) == (size_t)-2)) { if ((((c) && c == (charlist)[0] && !(charlist)[1]) || (((c) ? ((char *)mbschr ((charlist), (c)) != (char *) ((void *)0) ) : 0)))) break; } else { if (wcharlist == 0) { size_t len; len = mbstowcs (wcharlist, charlist, 0); if (len == -1) len = 0; wcharlist = (wchar_t *)sh_xmalloc((sizeof (wchar_t) * (len + 1)), "subst.c", 1247); mbstowcs (wcharlist, charlist, len + 1); } if (wcschr (wcharlist, wc)) break; } } else if ((((c) && c == (charlist)[0] && !(charlist)[1]) || (((c) ? ((char *)mbschr ((charlist), (c)) != (char *) ((void *)0) ) : 0)))) break; do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0); } do { if (wcharlist) sh_xfree((wcharlist), "subst.c", 1264); } while (0); temp = substring (string, *sindex, i); *sindex = i; return (temp); } char * extract_command_subst (string, sindex, xflags) char *string; int *sindex; int xflags; { char *ret; if (string[*sindex] == '(' || (xflags & 0x0400)) return (extract_delimited_string (string, sindex, "$(", "(", ")", xflags|0x0008)); else { xflags |= (no_longjmp_on_fatal_error ? 0x0040 : 0); ret = xparse_dolparen (string, string+*sindex, sindex, xflags); return ret; } } char * extract_arithmetic_subst (string, sindex) char *string; int *sindex; { return (extract_delimited_string (string, sindex, "$[", "[", "]", 0)); } char * extract_process_subst (string, starter, sindex, xflags) char *string; char *starter; int *sindex; int xflags; { xflags |= (no_longjmp_on_fatal_error ? 0x0040 : 0); return (xparse_dolparen (string, string+*sindex, sindex, xflags)); } char * extract_array_assignment_list (string, sindex) char *string; int *sindex; { int slen; char *ret; slen = strlen (string); if (string[slen - 1] == ')') { ret = substring (string, *sindex, slen - 1); *sindex = slen - 1; return ret; } return 0; } static char * extract_delimited_string (string, sindex, opener, alt_opener, closer, flags) char *string; int *sindex; char *opener, *alt_opener, *closer; int flags; { int i, c, si; size_t slen; char *t, *result; int pass_character, nesting_level, in_comment; int len_closer, len_opener, len_alt_opener; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); slen = strlen (string + *sindex) + *sindex; len_opener = (((opener) && (opener)[0]) ? ((opener)[1] ? ((opener)[2] ? strlen(opener) : 2) : 1) : 0); len_alt_opener = (((alt_opener) && (alt_opener)[0]) ? ((alt_opener)[1] ? ((alt_opener)[2] ? strlen(alt_opener) : 2) : 1) : 0); len_closer = (((closer) && (closer)[0]) ? ((closer)[1] ? ((closer)[2] ? strlen(closer) : 2) : 1) : 0); pass_character = in_comment = 0; nesting_level = 1; i = *sindex; while (nesting_level) { c = string[i]; if (i > slen) { i = slen; c = string[i = slen]; break; } if (c == 0) break; if (in_comment) { if (c == '\n') in_comment = 0; do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0); continue; } if (pass_character) { pass_character = 0; do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0); continue; } if ((flags & 0x0008) && c == '#' && (i == 0 || string[i - 1] == '\n' || (sh_syntaxtab[(unsigned char)(string[i - 1])] & 0x2000))) { in_comment = 1; do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0); continue; } if (c == '\001' || c == '\\') { pass_character++; i++; continue; } if ((flags & 0x0008) && string[i] == '$' && string[i+1] == '(') { si = i + 2; t = extract_command_subst (string, &si, flags|0x0001); if (si >= slen) { i = slen; c = 0; break; } else; i = si + 1; continue; } if (((len_opener == 0) ? (1) : ((string + i)[0] == (opener)[0] && strncmp(string + i, opener, len_opener) == 0))) { si = i + len_opener; t = extract_delimited_string (string, &si, opener, alt_opener, closer, flags|0x0001); if (si >= slen) { i = slen; c = 0; break; } else; i = si + 1; continue; } if (len_alt_opener && ((len_alt_opener == 0) ? (1) : ((string + i)[0] == (alt_opener)[0] && strncmp(string + i, alt_opener, len_alt_opener) == 0))) { si = i + len_alt_opener; t = extract_delimited_string (string, &si, alt_opener, alt_opener, closer, flags|0x0001); if (si >= slen) { i = slen; c = 0; break; } else; i = si + 1; continue; } if (((len_closer == 0) ? (1) : ((string + i)[0] == (closer)[0] && strncmp(string + i, closer, len_closer) == 0))) { i += len_closer - 1; nesting_level--; if (nesting_level == 0) break; } if (c == '`') { si = i + 1; t = string_extract (string, &si, "`", flags|0x0001); if (si >= slen) { i = slen; c = 0; break; } else; i = si + 1; continue; } if (c == '\'' || c == '"') { si = i + 1; i = (c == '\'') ? skip_single_quoted (string, slen, si, 0) : skip_double_quoted (string, slen, si, 0); continue; } do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _f; _f = is_basic ((string)[i]); if (_f) mblength = 1; else if (locale_utf8locale && (((string)[i] & 0x80) == 0)) mblength = (string)[i] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (slen) - (i), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; (i)++; } else if (mblength == 0) (i)++; else (i) += mblength; } else (i)++; } while (0); } if (c == 0 && nesting_level) { if (no_longjmp_on_fatal_error == 0) { last_command_exit_value = 1; report_error (gettext("bad substitution: no closing `%s' in %s"), closer, string); exp_jump_to_top_level (2); } else { *sindex = i; return (char *) ((void *)0) ; } } si = i - *sindex - len_closer + 1; if (flags & 0x0001) result = (char *) ((void *)0) ; else { result = (char *)sh_xmalloc((1 + si), "subst.c", 1513); strncpy (result, string + *sindex, si); result[si] = '\0'; } *sindex = i; return (result); } static char * extract_heredoc_dolbrace_string (string, sindex, quoted, flags) char *string; int *sindex, quoted, flags; { register int i, c; size_t slen, tlen, result_index, result_size; int pass_character, nesting_level, si, dolbrace_state; char *result, *t, *send; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); pass_character = 0; nesting_level = 1; slen = strlen (string + *sindex) + *sindex; send = string + slen; result_size = slen; result_index = 0; result = sh_xmalloc((result_size + 1), "subst.c", 1548); dolbrace_state = 0x40; i = *sindex; while (c = string[i]) { if (pass_character) { pass_character = 0; do { if ((result_index) + (locale_mb_cur_max + 1) >= result_size) { while ((result_index) + (locale_mb_cur_max + 1) >= result_size) result_size += (64); result = sh_xrealloc((result), (result_size), "subst.c", 1559); } } while (0); do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _k; _k = is_basic ((string)[(i)]); if (_k) mblength = 1; else if (locale_utf8locale && ((string)[(i)] & 0x80) == 0) mblength = (string)[(i)] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (send) - ((string)+(i)), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; mblength = 1; } else mblength = (mblength < 1) ? 1 : mblength; for (_k = 0; _k < mblength; _k++) result[result_index++] = string[i++]; } else result[result_index++] = string[i++]; } while (0); continue; } if (c == '\001' || c == '\\') { pass_character++; do { if ((result_index) + (2) >= result_size) { while ((result_index) + (2) >= result_size) result_size += (64); result = sh_xrealloc((result), (result_size), "subst.c", 1568); } } while (0); result[result_index++] = c; i++; continue; } if (c == '$' && string[i+1] == '\'') { char *ttrans; int ttranslen; if ((posixly_correct || extended_quote == 0) && dolbrace_state != 0x40 && dolbrace_state != 0x80) { do { if ((result_index) + (3) >= result_size) { while ((result_index) + (3) >= result_size) result_size += (64); result = sh_xrealloc((result), (result_size), "subst.c", 1582); } } while (0); result[result_index++] = '$'; result[result_index++] = '\''; i += 2; continue; } si = i + 2; t = string_extract_single_quoted (string, &si, 1); if (si >= slen) { i = slen; c = 0; break; } else; tlen = si - i - 2; ttrans = ansiexpand (t, 0, tlen, &ttranslen); sh_xfree((t), "subst.c", 1595); if (dolbrace_state == 0x40 || dolbrace_state == 0x80) { t = sh_single_quote (ttrans); tlen = strlen (t); sh_xfree((ttrans), "subst.c", 1602); } else if (extended_quote) { t = ttrans; tlen = strlen (t); } do { if ((result_index) + (tlen + 1) >= result_size) { while ((result_index) + (tlen + 1) >= result_size) result_size += (64); result = sh_xrealloc((result), (result_size), "subst.c", 1611); } } while (0); strncpy (result + result_index, t, tlen); result_index += tlen; sh_xfree((t), "subst.c", 1614); i = si; continue; } if (c == '$' && string[i+1] == '"') { char *ttrans; int ttranslen; si = i + 2; t = string_extract_double_quoted (string, &si, flags); if (si >= slen) { i = slen; c = 0; break; } else; tlen = si - i - 2; ttrans = locale_expand (t, 0, tlen, line_number, &ttranslen); sh_xfree((t), "subst.c", 1631); t = singlequote_translations ? sh_single_quote (ttrans) : sh_mkdoublequoted (ttrans, ttranslen, 0); tlen = strlen (t); sh_xfree((ttrans), "subst.c", 1635); do { if ((result_index) + (tlen + 1) >= result_size) { while ((result_index) + (tlen + 1) >= result_size) result_size += (64); result = sh_xrealloc((result), (result_size), "subst.c", 1637); } } while (0); strncpy (result + result_index, t, tlen); result_index += tlen; sh_xfree((t), "subst.c", 1640); i = si; continue; } if (c == '$' && string[i+1] == '{') { nesting_level++; do { if ((result_index) + (3) >= result_size) { while ((result_index) + (3) >= result_size) result_size += (64); result = sh_xrealloc((result), (result_size), "subst.c", 1649); } } while (0); result[result_index++] = c; result[result_index++] = string[i+1]; i += 2; if (dolbrace_state == 0x40 || dolbrace_state == 0x80 || dolbrace_state == 0x04) dolbrace_state = 0x01; continue; } if (c == '}') { nesting_level--; if (nesting_level == 0) break; do { if ((result_index) + (2) >= result_size) { while ((result_index) + (2) >= result_size) result_size += (64); result = sh_xrealloc((result), (result_size), "subst.c", 1663); } } while (0); result[result_index++] = c; i++; continue; } if (c == '`') { si = i + 1; t = string_extract (string, &si, "`", flags); if (si >= slen) { i = slen; c = 0; break; } else; tlen = si - i - 1; do { if ((result_index) + (tlen + 3) >= result_size) { while ((result_index) + (tlen + 3) >= result_size) result_size += (64); result = sh_xrealloc((result), (result_size), "subst.c", 1678); } } while (0); result[result_index++] = c; strncpy (result + result_index, t, tlen); result_index += tlen; result[result_index++] = string[si]; sh_xfree((t), "subst.c", 1683); i = si + 1; continue; } if (string[i] == '$' && string[i+1] == '(') { si = i + 2; t = extract_command_subst (string, &si, flags); if (si >= slen) { i = slen; c = 0; break; } else; tlen = si - i - 1; do { if ((result_index) + (tlen + 4) >= result_size) { while ((result_index) + (tlen + 4) >= result_size) result_size += (64); result = sh_xrealloc((result), (result_size), "subst.c", 1697); } } while (0); result[result_index++] = c; result[result_index++] = '('; strncpy (result + result_index, t, tlen); result_index += tlen; result[result_index++] = string[si]; sh_xfree((t), "subst.c", 1703); i = si + 1; continue; } if ((string[i] == '<' || string[i] == '>') && string[i+1] == '(') { si = i + 2; t = extract_process_subst (string, (string[i] == '<' ? "<(" : ">)"), &si, flags); if (si >= slen) { i = slen; c = 0; break; } else; tlen = si - i - 1; do { if ((result_index) + (tlen + 4) >= result_size) { while ((result_index) + (tlen + 4) >= result_size) result_size += (64); result = sh_xrealloc((result), (result_size), "subst.c", 1717); } } while (0); result[result_index++] = c; result[result_index++] = '('; strncpy (result + result_index, t, tlen); result_index += tlen; result[result_index++] = string[si]; sh_xfree((t), "subst.c", 1723); i = si + 1; continue; } if (c == '\'' && posixly_correct && shell_compatibility_level > 42 && dolbrace_state != 0x40) { do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _k; _k = is_basic ((string)[(i)]); if (_k) mblength = 1; else if (locale_utf8locale && ((string)[(i)] & 0x80) == 0) mblength = (string)[(i)] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (send) - ((string)+(i)), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; mblength = 1; } else mblength = (mblength < 1) ? 1 : mblength; for (_k = 0; _k < mblength; _k++) result[result_index++] = string[i++]; } else result[result_index++] = string[i++]; } while (0); continue; } if (c == '"' || c == '\'') { si = i + 1; if (c == '"') t = string_extract_double_quoted (string, &si, flags); else t = string_extract_single_quoted (string, &si, 0); if (si >= slen) { i = slen; c = 0; break; } else; tlen = si - i - 2; do { if ((result_index) + (tlen + 3) >= result_size) { while ((result_index) + (tlen + 3) >= result_size) result_size += (64); result = sh_xrealloc((result), (result_size), "subst.c", 1746); } } while (0); result[result_index++] = c; strncpy (result + result_index, t, tlen); result_index += tlen; result[result_index++] = string[si - 1]; sh_xfree((t), "subst.c", 1751); i = si; continue; } do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _k; _k = is_basic ((string)[(i)]); if (_k) mblength = 1; else if (locale_utf8locale && ((string)[(i)] & 0x80) == 0) mblength = (string)[(i)] != 0; else { state_bak = state; mblength = mbrlen ((string) + (i), (send) - ((string)+(i)), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; mblength = 1; } else mblength = (mblength < 1) ? 1 : mblength; for (_k = 0; _k < mblength; _k++) result[result_index++] = string[i++]; } else result[result_index++] = string[i++]; } while (0); if (dolbrace_state == 0x01 && c == '%' && (i - *sindex) > 1) dolbrace_state = 0x40; else if (dolbrace_state == 0x01 && c == '#' && (i - *sindex) > 1) dolbrace_state = 0x40; else if (dolbrace_state == 0x01 && c == '/' && (i - *sindex) > 1) dolbrace_state = 0x80; else if (dolbrace_state == 0x01 && c == '^' && (i - *sindex) > 1) dolbrace_state = 0x40; else if (dolbrace_state == 0x01 && c == ',' && (i - *sindex) > 1) dolbrace_state = 0x40; else if (dolbrace_state == 0x01 && strchr ("#%^,~:-=?+/", c) != 0) dolbrace_state = 0x02; else if (dolbrace_state == 0x02 && strchr ("#%^,~:-=?+/", c) == 0) dolbrace_state = 0x04; } if (c == 0 && nesting_level) { sh_xfree((result), "subst.c", 1781); if (no_longjmp_on_fatal_error == 0) { last_command_exit_value = 1; report_error (gettext("bad substitution: no closing `%s' in %s"), "}", string); exp_jump_to_top_level (2); } else { *sindex = i; return ((char *) ((void *)0) ); } } *sindex = i; result[result_index] = '\0'; return (result); }
long skip_double_quoted(long a1, unsigned long a2, unsigned int a3, short a4) { unsigned int v7; int v8; unsigned int v9; int v10; int v11; unsigned long v15; unsigned long v16; unsigned long v17; long command_subst; long s; long v20; unsigned long v21; v21 = __readfsqword(0x28u); memset(&s, 0, sizeof(s)); v11 = 0; v10 = 0; v9 = a3; while ( 1 ) { v8 = *(char *)((int)v9 + a1); if ( !v8 ) break; if ( v10 ) { v10 = 0; if ( locale_mb_cur_max <= 1 ) { ++v9; } else { if ( (unsigned int)is_basic(*(_BYTE *)((int)v9 + a1)) ) { v15 = 1LL; } else if ( locale_utf8locale && *(char *)((int)v9 + a1) >= 0 ) { v15 = *(_BYTE *)((int)v9 + a1) != 0; } else { v20 = s; v15 = mbrlen((const char *)((int)v9 + a1), a2 - (int)v9, (mbstate_t *)&s); } if ( v15 < 0xFFFFFFFFFFFFFFFELL ) { if ( v15 ) v9 += v15; else ++v9; } else { s = v20; ++v9; } } } else if ( v8 == 92 ) { ++v10; ++v9; } else if ( v11 ) { if ( v8 == 96 ) v11 = 0; if ( locale_mb_cur_max <= 1 ) { ++v9; } else { if ( (unsigned int)is_basic(*(_BYTE *)((int)v9 + a1)) ) { v16 = 1LL; } else if ( locale_utf8locale && *(char *)((int)v9 + a1) >= 0 ) { v16 = *(_BYTE *)((int)v9 + a1) != 0; } else { v20 = s; v16 = mbrlen((const char *)((int)v9 + a1), a2 - (int)v9, (mbstate_t *)&s); } if ( v16 < 0xFFFFFFFFFFFFFFFELL ) { if ( v16 ) v9 += v16; else ++v9; } else { s = v20; ++v9; } } } else if ( v8 == 96 ) { ++v11; ++v9; } else if ( v8 == 36 && (*(_BYTE *)((int)v9 + 1LL + a1) == 40 || *(_BYTE *)((int)v9 + 1LL + a1) == 123) ) { v7 = v9 + 2; if ( *(_BYTE *)((int)v9 + 1LL + a1) == 40 ) command_subst = (long)extract_command_subst(a1, (int *)&v7, a4 & 0x400 | 1u); else command_subst = extract_dollar_brace_string(a1, (int *)&v7, 1, 1u); if ( a2 <= (int)v7 ) { v9 = a2; v8 = 0; break; } v9 = v7 + 1; } else { if ( v8 == 34 ) break; if ( locale_mb_cur_max <= 1 ) { ++v9; } else { if ( (unsigned int)is_basic(*(_BYTE *)((int)v9 + a1)) ) { v17 = 1LL; } else if ( locale_utf8locale && *(char *)((int)v9 + a1) >= 0 ) { v17 = *(_BYTE *)((int)v9 + a1) != 0; } else { v20 = s; v17 = mbrlen((const char *)((int)v9 + a1), a2 - (int)v9, (mbstate_t *)&s); } if ( v17 < 0xFFFFFFFFFFFFFFFELL ) { if ( v17 ) v9 += v17; else ++v9; } else { s = v20; ++v9; } } } } if ( v8 ) ++v9; return v9; }
char * strip_compression_suffix (const char *name) { char *s = ((void *)0) ; size_t len; struct compression_suffix const *p = find_compression_suffix (name, &len); if (p) { if (len > 4 && strncmp (name + len - 4, ".tar", 4) == 0 && p->suffix[0] != 't') len -= 4; if (len == 0) return ((void *)0) ; s = xmalloc (len + 1); memcpy (s, name, len); s[len] = 0; } return s; }
long long strip_compression_suffix(void* a0) { void* v0; void* v1; char **v2; void* v4; v1 = 0; v2 = find_compression_suffix(a0, &v0); if (v2) { if (v0 > 4 && !strncmp(a0 + v0 - 4, ".tar", 0x4) && *(*(v2)) != 116) v0 -= 4; if (!v0) { v4 = 0; return v4; } v1 = xmalloc(v0 + 1); memcpy(v1, a0, v0); *((v1 + v0)) = 0; } v4 = v1; return v4; }
size_t hash_pjw_bare (const void *x, size_t n) { const unsigned char *s = x; size_t h = 0; unsigned i; for (i = 0; i < n; i++) h = s[i] + ((h << 9) | (h >> ((sizeof (size_t) * 8) - 9))); return h; }
long long hash_pjw_bare(char *a0, unsigned long a1) { unsigned int v0; void* v1; unsigned long v3; v1 = 0; for (v0 = 0; a1 > v0; v0 += 1) { v3 = [D] amd64g_calculate_rflags_all(0x4<64>, rdi<8>, Conv(32->64, Load(addr=stack_base-28, size=4, endness=Iend_LE)), cc_ndep<8>); v1 = a0[v0] + (v1 * 0x200 | v1 >> 55); } return v1; }
char *actattr(const char *tty) { char *ret = (char*)0; char *path; if (!tty || *tty == '\0') goto err; if (asprintf(&path, "/sys/class/tty/%s/active", tty) < 0) goto err; if ((ret = oneline(path)) == (char*)0) goto out; out: free(path); err: return ret; }
int actattr(char *a0) { char v0; void* v1; v1 = 0; if (!a0) { return v1; } else if (!*(a0)) { return v1; } else if (asprintf(&v0, "/sys/class/tty/%s/active", a0) < 0) { return v1; } else { v1 = oneline(*(&v0)); free(*(&v0)); return v1; } }
static int collequiv (c, equiv) int c, equiv; { if (charcmp (c, equiv, 1) == 0) return 1; return 0; }
int collequiv(unsigned long a0, unsigned long a1) { unsigned int v1; v1 = charcmp(a0, a1, 0x1); if (!v1) v1 = 1; else v1 = 0; return v1; }
int produces_handler (self, defs, arg) char *self; DEF_FILE *defs; char *arg; { if (only_documentation) return (0); output_cpp_line_info++; if (defs->production) line_error (defs, "%s already has a %s definition", defs->filename, self); else { defs->production = get_arg (self, defs, arg); if (inhibit_production) return (0); defs->output = fopen (defs->production, "w"); if (!defs->output) file_error (defs->production); fprintf (defs->output, "\n", defs->production, defs->filename); } return (0); }
long long produces_handler(unsigned int a0, unsigned long long a1[5], char *a2) { if (!only_documentation) { output_cpp_line_info = output_cpp_line_info + 1; if (a1[3]) { line_error(a1, "%s already has a %s definition", a1[0], a0); } else { a1[3] = get_arg(a0, a1, a2, a1); if (!inhibit_production) { a1[4] = fopen(a1[3], "w"); if (!a1[4]) file_error(a1[3]); fprintf(a1[4], "\n", a1[3], a1[0]); } } } if (a1[3] || a1[4] || inhibit_production || only_documentation) return 0; }
static void prjoin (struct line const *line1, struct line const *line2) { const struct outlist *outlist; char output_separator = tab < 0 ? ' ' : tab; size_t field; struct line const *line; outlist = outlist_head.next; if (outlist) { const struct outlist *o; o = outlist; while ( 1 ) { if (o->file == 0) { if (line1 == &uni_blank) { line = line2; field = join_field_2; } else { line = line1; field = join_field_1; } } else { line = (o->file == 1 ? line1 : line2); field = o->field; } prfield (field, line); o = o->next; if (o == ((void *)0) ) break; putchar_unlocked (output_separator); } putchar_unlocked (eolchar); } else { if (line1 == &uni_blank) { line = line2; field = join_field_2; } else { line = line1; field = join_field_1; } prfield (field, line); prfields (line1, join_field_1, autocount_1); prfields (line2, join_field_2, autocount_2); putchar_unlocked (eolchar); } }
int prjoin(void *a1, void *a2) { char v2; void *v3; char v5; long v6; if ( tab < 0 ) v2 = 32; else v2 = tab; v5 = v2; if ( qword_2820 ) { v6 = qword_2820; while ( 1 ) { if ( *(_DWORD *)v6 ) { v3 = *(_DWORD *)v6 == 1 ? a1 : a2; prfield(*(_QWORD *)(v6 + 8), (long)v3); } else if ( a1 == &uni_blank ) { prfield(join_field_2, (long)a2); } else { prfield(join_field_1, (long)a1); } v6 = *(_QWORD *)(v6 + 16); if ( !v6 ) break; putchar_unlocked(v5); } return putchar_unlocked(eolchar); } else { if ( a1 == &uni_blank ) prfield(join_field_2, (long)a2); else prfield(join_field_1, (long)a1); prfields((long)a1, join_field_1, autocount_1); prfields((long)a2, join_field_2, autocount_2); return putchar_unlocked(eolchar); } }
static const char * progress_meter_path(const char *path) { const char *progresspath; if ((progresspath = strrchr(path, '/')) == ((void *)0) ) return path; progresspath++; if (*progresspath == '\0') return path; return progresspath; }
int progress_meter_path(char *a0) { char *v0; unsigned int v2; v0 = strrchr(a0, 0x2f); if (!v0) { v2 = a0; } else { v0 += 1; if (!*(v0)) v2 = a0; else v2 = v0; } return v2; }
static errcode_t write_directory(e2fsck_t ctx, ext2_filsys fs, struct out_dir *outdir, ext2_ino_t ino, struct ext2_inode *inode, int compress) { struct write_dir_struct wd; errcode_t retval; retval = e2fsck_expand_directory(ctx, ino, -1, outdir->num); if (retval) return retval; wd.outdir = outdir; wd.err = 0; wd.ino = ino; wd.ctx = ctx; wd.dir = ino; retval = ext2fs_block_iterate3(fs, ino, 0, ((void *)0) , write_dir_block, &wd); if (retval) return retval; if (wd.err) return wd.err; e2fsck_read_inode(ctx, ino, inode, "rehash_dir"); if (compress) inode->i_flags &= ~0x00001000; else inode->i_flags |= 0x00001000; retval = ext2fs_inode_size_set(fs, inode, (ext2_off64_t)outdir->num * fs->blocksize); if (retval) return retval; return ext2fs_punch(fs, ino, inode, ((void *)0) , outdir->num, ~0ULL); }
long write_directory(long a1, long a2, unsigned int *a3, unsigned int a4, long a5, int a6) { int v7; long v12; long v13; long v14; unsigned int *v15; long v16; unsigned int v17; long v18; unsigned int v19; unsigned long v20; v20 = __readfsqword(0x28u); v12 = e2fsck_expand_directory(a1, a4, 0xFFFFFFFFLL, *a3); if ( v12 ) return v12; v15 = a3; v16 = 0LL; v17 = a4; v18 = a1; v19 = a4; v13 = ext2fs_block_iterate3(a2, a4, 0LL, 0LL, write_dir_block, &v15); if ( v13 ) return v13; if ( v16 ) return v16; e2fsck_read_inode(a1, a4, a5, "rehash_dir"); v7 = *(_DWORD *)(a5 + 32); if ( a6 ) BYTE1(v7) &= ~0x10u; else BYTE1(v7) |= 0x10u; *(_DWORD *)(a5 + 32) = v7; v14 = ext2fs_inode_size_set(a2, a5, *(unsigned int *)(a2 + 40) * (unsigned long)*a3); if ( v14 ) return v14; else return ext2fs_punch(a2, a4, a5, 0LL, *a3, -1LL); }
char * get_string_value (var_name) const char *var_name; { SHELL_VAR *var; var = find_variable (var_name); return ((var) ? get_variable_value (var) : (char *) ((void *)0) ); }
int get_string_value(unsigned long long a0) { unsigned long long v0; unsigned int v2; v0 = find_variable(a0); if (!v0) v2 = 0; else v2 = get_variable_value(v0); return v2; }
static void vti_print_help(struct link_util *lu, int argc, char **argv, FILE *f) { fprintf(f, "Usage: ... %-4s [ remote ADDR ]\n" " [ local ADDR ]\n" " [ [i|o]key KEY ]\n" " [ dev PHYS_DEV ]\n" " [ fwmark MARK ]\n" "\n" "Where: ADDR := { IP_ADDRESS }\n" " KEY := { DOTTED_QUAD | NUMBER }\n" " MARK := { 0x0..0xffffffff }\n", lu->id); }
void vti_print_help(long param_1,undefined8 param_2,undefined8 param_3,FILE *param_4) { fprintf(param_4, "Usage: ... %-4s\t[ remote ADDR ]\n\t\t[ local ADDR ]\n\t\t[ [i|o]key KEY ]\n\t\t[ dev PHYS_DEV ]\n\t\t[ fwmark MARK ]\n\nWhere:\tADDR := { IP_ADDRESS }\n\tKEY := { DOTTED_QUAD | NUMBER }\n\tMARK := { 0x0..0xffffffff }\n" ,*(undefined8 *)(param_1 + 8)); return; }
static int execute_null_command (redirects, pipe_in, pipe_out, async) REDIRECT *redirects; int pipe_in, pipe_out, async; { int r; int forcefork, fork_flags; REDIRECT *rd; for (forcefork = 0, rd = redirects; rd; rd = rd->next) { forcefork += rd->rflags & 0x01; forcefork += (rd->redirector.dest == 0 || fd_is_bash_input (rd->redirector.dest)) && ((rd->instruction == r_input_direction || rd->instruction == r_inputa_direction || rd->instruction == r_input_output) || (rd->instruction == r_duplicating_input_word || rd->instruction == r_duplicating_output_word || rd->instruction == r_move_input_word || rd->instruction == r_move_output_word) || rd->instruction == r_close_this); } if (forcefork || pipe_in != -1 || pipe_out != -1 || async) { fork_flags = async ? 1 : 0; if (make_child ((char *) ((void *)0) , fork_flags) == 0) { restore_original_signals (); do_piping (pipe_in, pipe_out); coproc_closeall (); interactive = 0; subshell_environment = 0; if (async) subshell_environment |= 0x01; if (pipe_in != -1 || pipe_out != -1) subshell_environment |= 0x10; if (do_redirections (redirects, 0x01) == 0) exit (0); else exit (1); } else { close_pipes (pipe_in, pipe_out); if (pipe_out == -1) unlink_fifo_list (); return (0); } } else { r = do_redirections (redirects, 0x01|0x02); cleanup_redirects (redirection_undo_list); redirection_undo_list = (REDIRECT *) ((void *)0) ; if (r != 0) return (1); else if (last_command_subst_pid != (pid_t)-1) return (last_command_exit_value); else return (0); } }
undefined4 execute_null_command(undefined8 *param_1,int param_2,int param_3,int param_4) { uint uVar1; int iVar2; undefined4 uVar3; int local_1c; undefined8 *local_10; local_1c = 0; for (local_10 = param_1; local_10 != (undefined8 *)0x0; local_10 = (undefined8 *)*local_10) { uVar1 = *(uint *)(local_10 + 2); if (((*(int *)(local_10 + 1) == 0) || (iVar2 = fd_is_bash_input(*(undefined4 *)(local_10 + 1)), iVar2 != 0)) && ((((*(int *)(local_10 + 3) == 1 || ((((*(int *)(local_10 + 3) == 2 || (*(int *)(local_10 + 3) == 0xb)) || (*(int *)(local_10 + 3) == 0xd)) || ((*(int *)(local_10 + 3) == 0xe || (*(int *)(local_10 + 3) == 0x11)))))) || (*(int *)(local_10 + 3) == 0x12)) || (*(int *)(local_10 + 3) == 9)))) { iVar2 = 1; } else { iVar2 = 0; } local_1c = local_1c + (uVar1 & 1) + iVar2; } if (((local_1c == 0) && (param_2 == -1)) && ((param_3 == -1 && (param_4 == 0)))) { iVar2 = do_redirections(param_1,3); cleanup_redirects(redirection_undo_list); redirection_undo_list = 0; if (iVar2 == 0) { uVar3 = last_command_exit_value; if (last_command_subst_pid == -1) { uVar3 = 0; } } else { uVar3 = 1; } } else { iVar2 = make_child(0,param_4 != 0); if (iVar2 == 0) { restore_original_signals(); do_piping(param_2,param_3); coproc_closeall(); interactive = 0; subshell_environment = (uint)(param_4 != 0); if ((param_2 != -1) || (param_3 != -1)) { subshell_environment = subshell_environment | 0x10; } iVar2 = do_redirections(param_1,1); if (iVar2 == 0) { exit(0); } exit(1); } close_pipes(param_2,param_3); if (param_3 == -1) { unlink_fifo_list(); } uVar3 = 0; } return uVar3; }
int check_zipfile(in) int in; { uch *h = inbuf + inptr; ifd = in; inptr += 30 + ((ush)(uch)((h + 26)[0]) | ((ush)(uch)((h + 26)[1]) << 8)) + ((ush)(uch)((h + 28)[0]) | ((ush)(uch)((h + 28)[1]) << 8)); if (inptr > insize || ((ulg)(((ush)(uch)((h)[0]) | ((ush)(uch)((h)[1]) << 8))) | ((ulg)(((ush)(uch)(((h)+2)[0]) | ((ush)(uch)(((h)+2)[1]) << 8))) << 16)) != 0x04034b50L) { fprintf( stderr , "\n%s: %s: not a valid zip file\n", program_name, ifname); exit_code = 1; return 1; } method = h[8]; if (method != 0 && method != 8) { fprintf( stderr , "\n%s: %s: first entry not deflated or stored -- use unzip\n", program_name, ifname); exit_code = 1; return 1; } if ((decrypt = h[6] & 1) != 0) { fprintf( stderr , "\n%s: %s: encrypted file -- use unzip\n", program_name, ifname); exit_code = 1; return 1; } ext_header = (h[6] & 8) != 0; pkzip = 1; return 0; }
long long check_zipfile(unsigned long a0) { char v0[30]; unsigned long long v2; *(&v0[0]) = &inbuf + inptr; ifd = a0; inptr = inptr + (v0[28] | (v0[29] * 0x100)) + (v0[26] | (v0[27] * 0x100)) + 30; if (inptr <= insize && (v0[0] | (v0[1] << 8) | (v0[2] | (v0[3] << 8)) << 16) == 67324752) { method = v0[8]; if (method && method != 8) { fprintf(*(&stderr), "\n%s: %s: first entry not deflated or stored -- use unzip\n", *(&program_name), &ifname); exit_code = 1; v2 = 1; } if (!method || method == 8) { decrypt = v0[6] & 1; if (decrypt) { fprintf(*(&stderr), "\n%s: %s: encrypted file -- use unzip\n", *(&program_name), &ifname); exit_code = 1; v2 = 1; } else { ext_header = (v0[6] & 8); pkzip = 1; v2 = 0; } } } if ((v0[0] | (v0[1] << 8) | (v0[2] | (v0[3] << 8)) << 16) != 67324752 || inptr > insize) { fprintf(*(&stderr), "\n%s: %s: not a valid zip file\n", *(&program_name), &ifname); exit_code = 1; v2 = 1; } return v2; }
static int cert_compare(struct sshkey_cert *a, struct sshkey_cert *b) { if (a == ((void *)0) && b == ((void *)0) ) return 1; if (a == ((void *)0) || b == ((void *)0) ) return 0; if (sshbuf_len(a->certblob) != sshbuf_len(b->certblob)) return 0; if (timingsafe_bcmp(sshbuf_ptr(a->certblob), sshbuf_ptr(b->certblob), sshbuf_len(a->certblob)) != 0) return 0; return 1; }
int cert_compare(unsigned long long *a0, unsigned long long *a1) { unsigned int v1; if (!a0 && !a1) v1 = 1; if (a0 || a1) { if (a0 && a1) { v1 = sshbuf_len(*(a1)); if (sshbuf_len(*(a0)) != v1) { v1 = 0; } else { v1 = timingsafe_bcmp(sshbuf_ptr(*(a0)), sshbuf_ptr(*(a1)), sshbuf_len(*(a0))); if (v1) v1 = 0; else v1 = 1; } } if (!a0 || !a1) v1 = 0; } return v1; }
static int history_def_prev(void *p, HistEventW *ev) { history_t *h = (history_t *) p; if (h->cursor == &h->list) { { ev->num = (h->cur > 0) ? 6 : 5; ev->str = he_errlist[(h->cur > 0) ? 6 : 5]; } ; return -1; } if (h->cursor->prev == &h->list) { { ev->num = 7; ev->str = he_errlist[7]; }; return -1; } h->cursor = h->cursor->prev; *ev = h->cursor->ev; return 0; }
long long history_def_prev(struct_1 *a0, unsigned long long a1[2]) { unsigned int v1; unsigned long long v2; unsigned long long v3; unsigned long long v4; if (a0->field_28 == a0) { if (a0->field_34 > 0) v1 = 6; else v1 = 5; *(&a1[0]) = v1; if (a0->field_34 > 0) v3 = 6; else v3 = 5; a1[1] = (&he_errlist)[v3]; v4 = 4294967295; } else if (a0->field_28->field_20 == a0) { *(&a1[0]) = 7; a1[1] = "n"; v4 = 4294967295; } else { a0->field_28 = a0->field_28->field_20; v2 = a0->field_28->field_8; a1[0] = a0->field_28->field_0; a1[1] = v2; v4 = 0; } return v4; }
int sshkey_cert_check_authority_now(const struct sshkey *k, int want_host, int require_principal, int wildcard_pattern, const char *name, const char **reason) { time_t now; if ((now = time( ((void *)0) )) < 0) { *reason = "Certificate invalid: not yet valid"; return -25; } return sshkey_cert_check_authority(k, want_host, require_principal, wildcard_pattern, (uint64_t)now, name, reason); }
long sshkey_cert_check_authority_now(long a1, int a2, int a3, int a4, const char *a5, _QWORD *a6) { signed long v11; v11 = time(0LL); if ( v11 >= 0 ) return sshkey_cert_check_authority(a1, a2, a3, a4, v11, a5, a6); *a6 = "Certificate invalid: not yet valid"; return 4294967271LL; }
static void mp_factor_using_pollard_rho (mpz_t n, unsigned long int a, struct mp_factors *factors) { mpz_t x, z, y, P; mpz_t t, t2; do { if (dev_debug) fprintf ( stderr , "[pollard-rho (%lu)] ", a); } while (0); __gmpz_inits (t, t2, ((void *)0) ); __gmpz_init_set_si (y, 2); __gmpz_init_set_si (x, 2); __gmpz_init_set_si (z, 2); __gmpz_init_set_ui (P, 1); unsigned long long int k = 1; unsigned long long int l = 1; while ( (__builtin_constant_p ( 1 ) && ( 1 ) == 0 ? (( n )->_mp_size < 0 ? -1 : ( n )->_mp_size > 0) : __gmpz_cmp_ui ( n , 1 )) != 0) { for (;;) { do { __gmpz_mul (t, x, x); __gmpz_mod (x, t, n); __gmpz_add_ui (x, x, a); __gmpz_sub (t, z, x); __gmpz_mul (t2, P, t); __gmpz_mod (P, t2, n); if (k % 32 == 1) { __gmpz_gcd (t, P, n); if ( (__builtin_constant_p ( 1 ) && ( 1 ) == 0 ? (( t )->_mp_size < 0 ? -1 : ( t )->_mp_size > 0) : __gmpz_cmp_ui ( t , 1 )) != 0) goto factor_found; __gmpz_set (y, x); } } while (--k != 0); __gmpz_set (z, x); k = l; l = 2 * l; for (unsigned long long int i = 0; i < k; i++) { __gmpz_mul (t, x, x); __gmpz_mod (x, t, n); __gmpz_add_ui (x, x, a); } __gmpz_set (y, x); } factor_found: do { __gmpz_mul (t, y, y); __gmpz_mod (y, t, n); __gmpz_add_ui (y, y, a); __gmpz_sub (t, z, y); __gmpz_gcd (t, t, n); } while ( (__builtin_constant_p ( 1 ) && ( 1 ) == 0 ? (( t )->_mp_size < 0 ? -1 : ( t )->_mp_size > 0) : __gmpz_cmp_ui ( t , 1 )) == 0); __gmpz_divexact (n, n, t); if (!mp_prime_p (t)) { do { if (dev_debug) fprintf ( stderr , "[composite factor--restarting pollard-rho] "); } while (0); mp_factor_using_pollard_rho (t, a + 1, factors); } else { mp_factor_insert (factors, t); } if (mp_prime_p (n)) { mp_factor_insert (factors, n); break; } __gmpz_mod (x, x, n); __gmpz_mod (z, z, n); __gmpz_mod (y, y, n); } __gmpz_clears (P, t2, t, z, x, y, ((void *)0) ); }
unsigned long mp_factor_using_pollard_rho(long a1, long a2, long *a3, long a4, long a5) { long v5; unsigned long v8; long v9; unsigned long i; char v11[16]; char v12[16]; char v13[16]; char v14[16]; char v15[16]; char v16[24]; unsigned long v17; v17 = __readfsqword(0x28u); if ( dev_debug ) fprintf(stderr, "[pollard-rho (%lu)] ", a2); _gmpz_inits(v15, v16, 0LL, v16, a5); _gmpz_init_set_si(v13, 2LL); _gmpz_init_set_si(v11, 2LL); _gmpz_init_set_si(v12, 2LL); _gmpz_init_set_ui(v14, 1LL); v8 = 1LL; v9 = 1LL; while ( 2 ) { if ( !(unsigned int)_gmpz_cmp_ui(a1, 1LL) ) goto LABEL_22; while ( 1 ) { _gmpz_mul(v15, v11, v11); _gmpz_mod(v11, v15, a1); _gmpz_add_ui(v11, v11, a2); _gmpz_sub(v15, v12, v11); _gmpz_mul(v16, v14, v15); _gmpz_mod(v14, v16, a1); if ( (v8 & 0x1F) == 1 ) break; LABEL_7: if ( !--v8 ) { _gmpz_set(v12, v11); v8 = v9; v9 *= 2LL; for ( i = 0LL; i < v8; ++i ) { _gmpz_mul(v15, v11, v11); _gmpz_mod(v11, v15, a1); _gmpz_add_ui(v11, v11, a2); } _gmpz_set(v13, v11); } } _gmpz_gcd(v15, v14, a1); if ( !(unsigned int)_gmpz_cmp_ui(v15, 1LL) ) { _gmpz_set(v13, v11); goto LABEL_7; } do { _gmpz_mul(v15, v13, v13); _gmpz_mod(v13, v15, a1); _gmpz_add_ui(v13, v13, a2); _gmpz_sub(v15, v12, v13); _gmpz_gcd(v15, v15, a1); } while ( !(unsigned int)_gmpz_cmp_ui(v15, 1LL) ); _gmpz_divexact(a1, a1, v15); if ( !mp_prime_p((long)v15) ) { if ( dev_debug ) fprintf(stderr, "[composite factor--restarting pollard-rho] "); mp_factor_using_pollard_rho((long)v15, a2 + 1, a3, a2 + 1, v5); } else { mp_factor_insert(a3, (long)v15); } if ( !mp_prime_p(a1) ) { _gmpz_mod(v11, v11, a1); _gmpz_mod(v12, v12, a1); _gmpz_mod(v13, v13, a1); continue; } break; } mp_factor_insert(a3, a1); LABEL_22: _gmpz_clears(v14, v16, v15, v12, v11); return __readfsqword(0x28u) ^ v17; }
static const char *gtp_role_to_string(__u32 role) { switch (role) { case GTP_ROLE_GGSN: return "ggsn"; case GTP_ROLE_SGSN: return "sgsn"; default: return "unknown"; } }
const char * gtp_role_to_string(int a1) { if ( !a1 ) return "ggsn"; if ( a1 == 1 ) return "sgsn"; return "unknown"; }
static void string_to_chars (char const *str, char *p, size_t s) { tar_copy_str (p, str, s); p[s - 1] = '\0'; }
void string_to_chars(void* a0, char *a1, unsigned int a2) { unsigned long long v1; tar_copy_str(a1, a0, a2); v1 = &a1[1 + a2]; a1[1 + a2] = 0; return; }
u_int16_t get_u16(const void *vp) { const u_char *p = (const u_char *)vp; u_int16_t v; v = (u_int16_t)p[0] << 8; v |= (u_int16_t)p[1]; return (v); }
long long get_u16(char a0[2]) { unsigned short v0; v0 = a0[0] * 0x100; v0 |= a0[1]; return v0; }
static void write_recent_bytes (char *data, size_t bytes) { size_t blocks = bytes / 512; size_t rest = bytes - blocks * 512; write_recent_blocks ((union block *)data, blocks); memcpy (new_record[new_blocks].buffer, data + blocks * 512, rest); if (rest < 512) memset (new_record[new_blocks].buffer + rest, 0, 512 - rest); new_blocks++; if (new_blocks == blocking_factor) write_record (1); }
void write_recent_bytes(unsigned long long a0, unsigned long a1) { unsigned int v0; unsigned int v1; unsigned long long v3; unsigned long long v4; *(&v0) = a1 / 0x200; *(&v1) = a1 - *(&v0) * 0x200; write_recent_blocks(a0, *(&v0)); memcpy(new_record + new_blocks * 0x200, *(&v0) * 0x200 + a0, *(&v1)); if (*(&v1) <= 511) memset(new_record + new_blocks * 0x200 + *(&v1), 0x0, 0x200 - *(&v1)); new_blocks = new_blocks + 1; v3 = blocking_factor; if (new_blocks == blocking_factor) v4 = write_record(0x1); return; }
void must_be_building (directive, defs) char *directive; DEF_FILE *defs; { if (!building_builtin) line_error (defs, "%s must be inside of a $BUILTIN block", directive); }
void must_be_building(unsigned int a0, void* a1, unsigned long a2, unsigned int a3) { unsigned long long v1; unsigned long long v2; v1 = building_builtin; if (!building_builtin) v2 = line_error(a1, "%s must be inside of a $BUILTIN block", a0, a3); return; }
static table const * lookup_word (parser_control const *pc, char *word) { char *p; char *q; idx_t wordlen; table const *tp; _Bool period_found; _Bool abbrev; for (p = word; *p; p++) *p = c_toupper (to_uchar (*p)); for (tp = meridian_table; tp->name; tp++) if (strcmp (word, tp->name) == 0) return tp; wordlen = strlen (word); abbrev = wordlen == 3 || (wordlen == 4 && word[3] == '.'); for (tp = month_and_day_table; tp->name; tp++) if ((abbrev ? strncmp (word, tp->name, 3) : strcmp (word, tp->name)) == 0) return tp; if ((tp = lookup_zone (pc, word))) return tp; if (strcmp (word, dst_table[0].name) == 0) return dst_table; for (tp = time_units_table; tp->name; tp++) if (strcmp (word, tp->name) == 0) return tp; if (word[wordlen - 1] == 'S') { word[wordlen - 1] = '\0'; for (tp = time_units_table; tp->name; tp++) if (strcmp (word, tp->name) == 0) return tp; word[wordlen - 1] = 'S'; } for (tp = relative_time_table; tp->name; tp++) if (strcmp (word, tp->name) == 0) return tp; if (wordlen == 1) for (tp = military_table; tp->name; tp++) if (word[0] == tp->name[0]) return tp; for (period_found = 0 , p = q = word; (*p = *q); q++) if (*q == '.') period_found = 1 ; else p++; if (period_found && (tp = lookup_zone (pc, word))) return tp; return ((void *)0) ; }
undefined1 * lookup_word(undefined8 param_1,char *param_2) { char cVar1; bool bVar2; int iVar3; size_t sVar4; undefined1 *puVar5; char *local_28; char *local_20; undefined1 *local_18; for (local_28 = param_2; *local_28 != '\0'; local_28 = local_28 + 1) { to_uchar((int)*local_28); cVar1 = c_toupper(); *local_28 = cVar1; } for (local_18 = meridian_table; *(char **)local_18 != (char *)0x0; local_18 = (undefined1 *)((long)local_18 + 0x10)) { iVar3 = strcmp(param_2,*(char **)local_18); if (iVar3 == 0) { return (undefined1 *)(char **)local_18; } } sVar4 = strlen(param_2); if ((sVar4 == 3) || ((sVar4 == 4 && (param_2[3] == '.')))) { bVar2 = true; } else { bVar2 = false; } local_18 = month_and_day_table; while( true ) { if (*(char **)local_18 == (char *)0x0) { puVar5 = (undefined1 *)lookup_zone(param_1,param_2); if ((char **)puVar5 == (char **)0x0) { iVar3 = strcmp(param_2,"DST"); if (iVar3 == 0) { puVar5 = dst_table; } else { for (local_18 = time_units_table; *(char **)local_18 != (char *)0x0; local_18 = (undefined1 *)((long)local_18 + 0x10)) { iVar3 = strcmp(param_2,*(char **)local_18); if (iVar3 == 0) { return (undefined1 *)(char **)local_18; } } if (param_2[sVar4 - 1] == 'S') { param_2[sVar4 - 1] = '\0'; for (local_18 = time_units_table; *(char **)local_18 != (char *)0x0; local_18 = (undefined1 *)((long)local_18 + 0x10)) { iVar3 = strcmp(param_2,*(char **)local_18); if (iVar3 == 0) { return (undefined1 *)(char **)local_18; } } param_2[sVar4 - 1] = 'S'; } for (local_18 = relative_time_table; *(char **)local_18 != (char *)0x0; local_18 = (undefined1 *)((long)local_18 + 0x10)) { iVar3 = strcmp(param_2,*(char **)local_18); if (iVar3 == 0) { return (undefined1 *)(char **)local_18; } } if (sVar4 == 1) { for (local_18 = military_table; *(char **)local_18 != (char *)0x0; local_18 = (undefined1 *)((long)local_18 + 0x10)) { if (*param_2 == **(char **)local_18) { return (undefined1 *)(char **)local_18; } } } bVar2 = false; local_28 = param_2; local_20 = param_2; while (*local_28 = *local_20, *local_28 != '\0') { if (*local_20 == '.') { bVar2 = true; } else { local_28 = local_28 + 1; } local_20 = local_20 + 1; } if ((!bVar2) || (puVar5 = (undefined1 *)lookup_zone(param_1,param_2), (char **)puVar5 == (char **)0x0)) { puVar5 = (undefined1 *)0x0; } } } return puVar5; } if (bVar2) { iVar3 = strncmp(param_2,*(char **)local_18,3); } else { iVar3 = strcmp(param_2,*(char **)local_18); } if (iVar3 == 0) break; local_18 = (undefined1 *)((long)local_18 + 0x10); } return (undefined1 *)(char **)local_18; }
void sh_notbuiltin (s) char *s; { builtin_error (gettext("%s: not a shell builtin"), s); }
long long sh_notbuiltin(unsigned long a0) { unsigned long v0; v0 = a0; gettext("%s: not a shell builtin"); return builtin_error(); }
static long_int tm_diff (long_int year, long_int yday, int hour, int min, int sec, struct tm const *tp) { return ydhms_diff (year, yday, hour, min, sec, tp->tm_year, tp->tm_yday, tp->tm_hour, tp->tm_min, tp->tm_sec); }
int tm_diff(unsigned long a0, unsigned int a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned int a5[8]) { return ydhms_diff(a0, a1, a2, a3, a4, a5[5], a5[7], a5[2], a5[1], a5[0]); }
int sshbuf_reserve(struct sshbuf *buf, size_t len, u_char **dpp) { u_char *dp; int r; if (dpp != ((void *)0) ) *dpp = ((void *)0) ; ; if ((r = sshbuf_allocate(buf, len)) != 0) return r; dp = buf->d + buf->size; buf->size += len; if (dpp != ((void *)0) ) *dpp = dp; return 0; }
long long sshbuf_reserve(unsigned long long a0[4], unsigned long a1, unsigned long long *a2) { unsigned int v0; unsigned long v1; void* v3; if (a2) *(a2) = 0; v0 = sshbuf_allocate(a0, a1); if (v0) { v3 = v0; } else { v1 = a0[3] + a0[0]; a0[3] = a0[3] + a1; if (a2) *(a2) = v1; v3 = 0; } return v3; }
void * xmalloc(size_t size) { void *ptr; if (size == 0) sshfatal("xmalloc.c", __func__, 39, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "xmalloc: zero size"); ptr = malloc(size); if (ptr == ((void *)0) ) sshfatal("xmalloc.c", __func__, 42, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "xmalloc: out of memory (allocating %zu bytes)", size); return ptr; }
void * xmalloc(size_t param_1) { char **ppcVar1; char *apcStack56 [2]; undefined auStack40 [8]; size_t local_20; void *local_10; ppcVar1 = (char **)auStack40; local_20 = param_1; if (param_1 == 0) { ppcVar1 = apcStack56; apcStack56[0] = "xmalloc: zero size"; sshfatal("xmalloc.c","xmalloc",0x27,0,1,0); } *(undefined8 *)((long)ppcVar1 + -8) = 0x10005d; local_10 = malloc(local_20); if (local_10 == (void *)0x0) { *(size_t *)((long)ppcVar1 + -8) = local_20; *(char **)((long)ppcVar1 + -0x10) = "xmalloc: out of memory (allocating %zu bytes)"; *(undefined8 *)((long)ppcVar1 + -0x18) = 0x1000a1; sshfatal("xmalloc.c","xmalloc",0x2a,0,1,0); } return local_10; }
static char * curencoding () { char *loc; char *dot, *mod; loc = get_locale_var ("LC_CTYPE"); if (loc == 0 || *loc == 0) return ""; dot = strchr (loc, '.'); if (dot == 0) return loc; mod = strchr (dot, '@'); if (mod) *mod = '\0'; return ++dot; }
int curencoding() { char *v0; char *v1; char *v2; unsigned int v4; v0 = get_locale_var("LC_CTYPE"); if (v0 && *(v0)) { v1 = strchr(v0, 0x2e); if (!v1) { v4 = v0; } else { v2 = strchr(v1, 0x40); if (v2) *(v2) = 0; v1 += 1; v4 = v1; } } if (!v0 || !*(v0)) v4 = &g_400141; return v4; }
static inline __u32 rta_getattr_u32(const struct rtattr *rta) { return *(__u32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); }
int rta_getattr_u32(struct_0 *a0) { return a0->field_4; }
static void code_num (uintmax_t value, char const *keyword, struct xheader *xhdr) { code_signed_num (value, keyword, 0, (18446744073709551615UL) , xhdr); }
unsigned long code_num(long a1, char *a2, long a3) { return code_signed_num(a1, a2, 0LL, -1LL, a3); }
int sshd_hostkey_sign(struct ssh *ssh, struct sshkey *privkey, struct sshkey *pubkey, u_char **signature, size_t *slenp, const u_char *data, size_t dlen, const char *alg) { int r; if (use_privsep) { if (privkey) { if (mm_sshkey_sign(ssh, privkey, signature, slenp, data, dlen, alg, options.sk_provider, ((void *)0) , ssh->compat) < 0) sshfatal("sshd.c", __func__, 2349, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "privkey sign failed"); } else { if (mm_sshkey_sign(ssh, pubkey, signature, slenp, data, dlen, alg, options.sk_provider, ((void *)0) , ssh->compat) < 0) sshfatal("sshd.c", __func__, 2354, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "pubkey sign failed"); } } else { if (privkey) { if (sshkey_sign(privkey, signature, slenp, data, dlen, alg, options.sk_provider, ((void *)0) , ssh->compat) < 0) sshfatal("sshd.c", __func__, 2360, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "privkey sign failed"); } else { if ((r = ssh_agent_sign(auth_sock, pubkey, signature, slenp, data, dlen, alg, ssh->compat)) != 0) { sshfatal("sshd.c", __func__, 2365, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "agent sign failed"); } } } return 0; }
long sshd_hostkey_sign( long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) { long v8; unsigned int v14; if ( use_privsep ) { if ( a2 ) { if ( (int)mm_sshkey_sign(a1, a2, a4, a5, a6, a7, a8, *(_QWORD *)&options[1966], 0LL, *(unsigned int *)(a1 + 2108)) >= 0 ) return 0LL; sshfatal("sshd.c", "sshd_hostkey_sign", 2349LL, 1LL, 1LL, 0LL, "privkey sign failed"); } if ( (int)mm_sshkey_sign(a1, a3, a4, a5, a6, a7, a8, *(_QWORD *)&options[1966], 0LL, *(unsigned int *)(a1 + 2108)) >= 0 ) return 0LL; sshfatal("sshd.c", "sshd_hostkey_sign", 2354LL, 1LL, 1LL, 0LL, "pubkey sign failed"); } if ( a2 ) { if ( (int)sshkey_sign(a2, a4, a5, a6, a7, a8, *(_QWORD *)&options[1966], 0LL, *(unsigned int *)(a1 + 2108)) >= 0 ) return 0LL; sshfatal("sshd.c", "sshd_hostkey_sign", 2360LL, 1LL, 1LL, 0LL, "privkey sign failed"); } v14 = ssh_agent_sign((unsigned int)auth_sock, a3, a4, a5, a6, a7, a8, *(unsigned int *)(a1 + 2108)); if ( v14 ) { v8 = ssh_err(v14); sshfatal("sshd.c", "sshd_hostkey_sign", 2365LL, 1LL, 1LL, v8, "agent sign failed"); } return 0LL; }
int perm_copy_fd (const char *src_path, int src_fd, const char *dst_path, int dst_fd, struct error_context *ctx) { acl_t acl; struct stat st; int ret = 0; ret = fstat(src_fd, &st); if (ret != 0) { const char *qpath = ( (( ctx ) && ( ctx )->quote) ? ( ctx )->quote(( ctx ), ( src_path )) : ( src_path ) ) ; do { if (( ctx ) && ( ctx )->error) ( ctx )->error(( ctx ), "%s", qpath ); } while(0) ; do { if (( ctx ) && ( ctx )->quote_free) ( ctx )->quote_free(( ctx ), ( qpath )); } while(0) ; return -1; } acl = acl_get_fd (src_fd); if (acl == ((void *)0) ) { ret = -1; if ( (*__errno_location ()) == 38 || (*__errno_location ()) == 95 ) ret = set_acl_fd (dst_path, dst_fd, st.st_mode, ctx); else { const char *qpath = ( (( ctx ) && ( ctx )->quote) ? ( ctx )->quote(( ctx ), ( src_path )) : ( src_path ) ) ; do { if (( ctx ) && ( ctx )->error) ( ctx )->error(( ctx ), "%s", qpath ); } while(0) ; do { if (( ctx ) && ( ctx )->quote_free) ( ctx )->quote_free(( ctx ), ( qpath )); } while(0) ; } return ret; } if (acl_set_fd (dst_fd, acl) != 0) { int saved_errno = (*__errno_location ()) ; __apply_mask_to_mode(&st.st_mode, acl); ret = fchmod (dst_fd, st.st_mode); if (( (*__errno_location ()) != 38 && (*__errno_location ()) != 95 ) || acl_entries (acl) != 3) { const char *qpath = ( (( ctx ) && ( ctx )->quote) ? ( ctx )->quote(( ctx ), ( dst_path )) : ( dst_path ) ) ; (*__errno_location ()) = saved_errno; do { if (( ctx ) && ( ctx )->error) ( ctx )->error(( ctx ), gettext("preserving permissions for %s"), qpath ); } while(0) ; do { if (( ctx ) && ( ctx )->quote_free) ( ctx )->quote_free(( ctx ), ( qpath )); } while(0) ; ret = -1; } } (void) acl_free (acl); return ret; }
long perm_copy_fd(const char *a1, int a2, long a3, int a4, long a5) { const char *v5; const char *v7; long v8; void (*v9)(long, const char *, ...); char *v10; unsigned int v14; unsigned int v15; int v16; long fd; long v18; const char *v19; const char *v20; struct stat buf; unsigned long v22; v22 = __readfsqword(0x28u); v14 = fstat(a2, &buf); if ( v14 ) { if ( a5 && *(_QWORD *)(a5 + 8) ) v5 = (const char *)(*(long ( **)(long, const char *))(a5 + 8))(a5, a1); else v5 = a1; v20 = v5; if ( a5 && *(_QWORD *)a5 ) (*(void (**)(long, const char *, ...))a5)(a5, "%s", v5); if ( a5 ) { if ( *(_QWORD *)(a5 + 16) ) (*(void ( **)(long, const char *))(a5 + 16))(a5, v20); } return 0xFFFFFFFFLL; } else { fd = acl_get_fd((unsigned int)a2); if ( fd ) { if ( (unsigned int)acl_set_fd((unsigned int)a4, fd) ) { if ( (v16 = *_errno_location(), _apply_mask_to_mode(&buf.st_mode, fd), v14 = fchmod(a4, buf.st_mode), *_errno_location() != 38) && *_errno_location() != 95 || (unsigned int)acl_entries(fd) != 3 ) { if ( a5 && *(_QWORD *)(a5 + 8) ) v8 = (*(long ( **)(long, long))(a5 + 8))(a5, a3); else v8 = a3; v18 = v8; *_errno_location() = v16; if ( a5 && *(_QWORD *)a5 ) { v9 = *(void (**)(long, const char *, ...))a5; v10 = gettext("preserving permissions for %s"); v9(a5, v10, v18); } if ( a5 && *(_QWORD *)(a5 + 16) ) (*(void ( **)(long, long))(a5 + 16))(a5, v18); v14 = -1; } } acl_free(fd); return v14; } else { v15 = -1; if ( *_errno_location() == 38 || *_errno_location() == 95 ) { return (unsigned int)set_acl_fd(a3, a4, buf.st_mode, a5); } else { if ( a5 && *(_QWORD *)(a5 + 8) ) v7 = (const char *)(*(long ( **)(long, const char *))(a5 + 8))(a5, a1); else v7 = a1; v19 = v7; if ( a5 && *(_QWORD *)a5 ) (*(void (**)(long, const char *, ...))a5)(a5, "%s", v7); if ( a5 && *(_QWORD *)(a5 + 16) ) (*(void ( **)(long, const char *))(a5 + 16))(a5, v19); } return v15; } } }
static _Bool is_ok (const char *program, const char *arg) { rpl_fflush ( stdout ); if (fprintf ( stderr , gettext ("< %s ... %s > ? "), program, arg) < 0) { ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"Failed to write prompt for -ok\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , gettext ("Failed to write prompt for -ok")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , gettext ("Failed to write prompt for -ok")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); } rpl_fflush ( stderr ); return yesno (); }
long is_ok(long a1, long a2) { char *v2; char *v3; int *v4; rpl_fflush(stdout); v2 = gettext("< %s ... %s > ? "); if ( fprintf(stderr, v2, a1, a2) < 0 ) { v3 = gettext("Failed to write prompt for -ok"); v4 = _errno_location(); error(1, *v4, v3); } rpl_fflush(stderr); return yesno(); }
HANDLER_ENTRY * find_directive (directive) char *directive; { register int i; for (i = 0; handlers[i].directive; i++) if (strcmp (handlers[i].directive, directive) == 0) return (&handlers[i]); return ((HANDLER_ENTRY *) ((void *)0) ); }
int find_directive(char *a0) { void* v1; unsigned int v2; v1 = 0; while (true) { if (!*((0x10 * v1 + &handlers[0]))) { v2 = 0; break; } else if (strcmp(*((0x10 * v1 + &handlers[0])), a0)) { v1 = v1 + 1; } else { v2 = (&handlers[0] + 0x10 * v1); break; } } return v2; }
static int bash_glob_expand_word (count, key) int count, key; { return bash_glob_completion_internal ('*'); }
long bash_glob_expand_word() { return bash_glob_completion_internal(0x2Au); }
int umaskcmd(int argc, char **argv) { char *ap; int mask; int i; int symbolic_mode = 0; while ((i = nextopt("S")) != '\0') { symbolic_mode = 1; } ({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; }); mask = umask(0); umask(mask); ({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; }); if ((ap = *argptr) == ((void *)0) ) { if (symbolic_mode) { char buf[18]; int j; mask = ~mask; ap = buf; for (i = 0; i < 3; i++) { *ap++ = "ugo"[i]; *ap++ = '='; for (j = 0; j < 3; j++) if (mask & (1 << (8 - (3*i + j)))) *ap++ = "rwx"[j]; *ap++ = ','; } ap[-1] = '\0'; out1fmt("%s\n", buf); } else { out1fmt("%.4o\n", mask); } } else { int new_mask; if ( ((*__ctype_b_loc ())[(int) (( (unsigned char) *ap ))] & (unsigned short int) _ISdigit) ) { new_mask = 0; do { if (*ap >= '8' || *ap < '0') sh_error(illnum, *argptr); new_mask = (new_mask << 3) + (*ap - '0'); } while (*++ap != '\0'); } else { int positions, new_val; char op; mask = ~mask; new_mask = mask; positions = 0; while (*ap) { while (*ap && strchr("augo", *ap)) switch (*ap++) { case 'a': positions |= 0111; break; case 'u': positions |= 0100; break; case 'g': positions |= 0010; break; case 'o': positions |= 0001; break; } if (!positions) positions = 0111; if (!strchr("=+-", op = *ap)) break; ap++; new_val = 0; while (*ap && strchr("rwxugoXs", *ap)) switch (*ap++) { case 'r': new_val |= 04; break; case 'w': new_val |= 02; break; case 'x': new_val |= 01; break; case 'u': new_val |= mask >> 6; break; case 'g': new_val |= mask >> 3; break; case 'o': new_val |= mask >> 0; break; case 'X': if (mask & 0111) new_val |= 01; break; case 's': break; } new_val = (new_val & 07) * positions; switch (op) { case '-': new_mask &= ~new_val; break; case '=': new_mask = new_val | (new_mask & ~(positions * 07)); break; case '+': new_mask |= new_val; } if (*ap == ',') { positions = 0; ap++; } else if (!strchr("=+-", *ap)) break; } if (*ap) { sh_error("Illegal mode: %s", *argptr); return 1; } new_mask = ~new_mask; } umask(new_mask); } return 0; }
long long umaskcmd(unsigned long a0, unsigned long a1) { unsigned long v0; int tmp_9; int tmp_12; int tmp_14; int tmp_37; unsigned int v1; char v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned int v8; unsigned int v9; char *v10; char v11; unsigned int v14; char *v15; char *v16; unsigned long long v17; unsigned long long v18; unsigned long long v19; unsigned long long v20; struct_0 *v21; unsigned long long v22; v1 = a0; v0 = a1; v4 = 0; while (true) { v3 = nextopt("S"); if (!v3) break; v4 = 1; } suppressint = suppressint + 1; v9 = umask(0x0); umask(v9); suppressint = suppressint - 1; if (!suppressint && intpending) onint(); v10 = *(argptr); if (v10) { v14 = *((*(v10) * 2 + *(__ctype_b_loc()))) & 0x800; if (v14) { v6 = 0; do { if (*(v10) <= 47 || *(v10) > 55) sh_error(0x5000f0); v6 = *(v10) - 48 + (v6 * 8); v10 += 1; } while (*(v10)); } else { v9 = !(v9); v6 = v9; v7 = 0; while (*(v10)) { while (true) { if (*(v10)) { v17 = strchr("augo", *(v10)); if (v17) { tmp_9 = v10; v10 += 1; v18 = *(tmp_9); if (v18 != 117) { if (v18 > 117) continue; if (v18 != 111) { if (v18 > 111) continue; if (v18 != 97) { if (v18 != 103) continue; v7 |= 8; continue; } else { v7 |= 73; continue; } } else { v7 |= 1; continue; } } else { v7 |= 64; continue; } } } if (!*(v10) || !v17) { if (!v7) v7 = 73; v2 = *(v10); v19 = strchr("=+-", v2); if (!v19) break; if (v19) { v10 += 1; v8 = 0; if (true) { while (true) { if (*(v10)) { v20 = strchr("rwxugoXs", *(v10)); if (v20) { tmp_12 = v10; v10 += 1; *(&v20) = *(tmp_12); v21 = v20 - 88; switch (v21) { case 0: if (!(v9 & 73)) continue; v8 |= 1; break; case 15: v8 |= (v9 >> 3); break; case 23: v8 |= v9; break; case 26: v8 |= 4; break; case 27: break; case 29: v8 |= (v9 >> 6); break; case 31: v8 |= 2; break; case 32: v8 |= 1; break; } v22 = *((0x4 * &v21->padding_0[0] + &g_400c18)) + &g_400c18; } } if (!*(v10) || !v20) { v8 = (v8 & 7) * v7; if (v2 != 61) { if (v2 > 61) break; if (v2 <= 61) { if (v2 != 43) { if (v2 != 45) break; if (v2 == 45) { v6 &= !(v8); break; } } else { v6 |= v8; break; } } } else { v6 = !((v7 * 8) - v7) & v6 | v8; break; } } } } if (*(v10) == 44) { v7 = 0; v10 += 1; break; } else { break; } } } } if (!v19 || !strchr("=+-", *(v10)) && *(v10) != 44) break; } if (*(v10)) sh_error("Illegal mode: %s"); v6 = !(v6); } umask(v6); } else if (v4) { v9 = !(v9); v10 = &v11; for (v3 = 0; v3 <= 2; v3 += 1) { tmp_14 = v10; v10 += 1; *(tmp_14) = *(v3 + &g_400c0d); tmp_37 = v10; v10 += 1; *(tmp_37) = 61; for (v5 = 0; v5 <= 2; v5 += 1) { if (((v9 >> ((8 - (v5 + v3 + (v3 << 1))) & 31)) & 1)) { v15 = v10; v10 += 1; *(v15) = *(v5 + &g_400c11); } } v16 = v10; v10 += 1; *(v16) = 44; } v10[1] = 0; out1fmt("%s\n", &v11); } else { out1fmt("%.4o\n", v9); } return 0; }
void sh_cfree (mem, file, line) void * mem; const char *file; int line; { internal_cfree (mem, file, line, 0x01); }
unsigned long sh_cfree(char *a1, char *a2, unsigned int a3) { return internal_cfree(a1, a2, a3); }
static _Bool tortoise_in_hare(struct pkginfo *processing_now, struct trigcycleperpkg *tortoise_pkg) { const char *processing_now_name, *tortoise_name; struct trigpend *hare_trig, *tortoise_trig; processing_now_name = pkg_name(processing_now, pnaw_nonambig); tortoise_name = pkg_name(tortoise_pkg->pkg, pnaw_nonambig); debug(dbg_triggersdetail, "%s pnow=%s tortoise=%s", __func__, processing_now_name, tortoise_name); for (tortoise_trig = tortoise_pkg->then_trigs; tortoise_trig; tortoise_trig = tortoise_trig->next) { debug(dbg_triggersdetail, "%s pnow=%s tortoise=%s tortoisetrig=%s", __func__, processing_now_name, tortoise_name, tortoise_trig->name); for (hare_trig = tortoise_pkg->pkg->trigpend_head; hare_trig; hare_trig = hare_trig->next) { debug(dbg_triggersstupid, "%s pnow=%s tortoise=%s" " tortoisetrig=%s haretrig=%s", __func__, processing_now_name, tortoise_name, tortoise_trig->name, hare_trig->name); if (strcmp(hare_trig->name, tortoise_trig->name) == 0) break; } if (hare_trig == ((void *)0) ) { debug(dbg_triggersdetail, "%s pnow=%s tortoise=%s OK", __func__, processing_now_name, tortoise_name); return 0 ; } } return 1 ; }
int tortoise_in_hare(unsigned long long a0, struct_0 *a1) { unsigned long v0; unsigned long long v1[2]; unsigned long long v2[2]; unsigned long v3; unsigned long v4; unsigned int v6; v3 = pkg_name(a0, 0x1); v4 = pkg_name(a1->field_8, 0x1); debug(0x2000, "%s pnow=%s tortoise=%s", "tortoise_in_hare"); v2[0] = a1->field_10; while (true) { if (!v2) { v6 = 1; break; } else { debug(0x2000, "%s pnow=%s tortoise=%s tortoisetrig=%s", "tortoise_in_hare"); v1[0] = a1->field_8->field_160; while (true) { if (!v1) break; v0 = v1[1]; debug(0x4000, "%s pnow=%s tortoise=%s tortoisetrig=%s haretrig=%s", "tortoise_in_hare"); if (!strcmp(v1[1], v2[1])) break; v1[0] = v1[0]; } if (v1) { v2[0] = v2[0]; } else { debug(0x2000, "%s pnow=%s tortoise=%s OK", "tortoise_in_hare"); v6 = 0; break; } } } return v6; }
struct sftp_conn * do_init(int fd_in, int fd_out, u_int transfer_buflen, u_int num_requests, u_int64_t limit_kbps) { u_char type; struct sshbuf *msg; struct sftp_conn *ret; int r; ret = xcalloc(1, sizeof(*ret)); ret->msg_id = 1; ret->fd_in = fd_in; ret->fd_out = fd_out; ret->download_buflen = ret->upload_buflen = transfer_buflen ? transfer_buflen : 32768; ret->num_requests = num_requests ? num_requests : 64; ret->exts = 0; ret->limit_kbps = 0; if ((msg = sshbuf_new()) == ((void *)0) ) sshfatal("sftp-client.c", __func__, 473, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); if ((r = sshbuf_put_u8(msg, 1)) != 0 || (r = sshbuf_put_u32(msg, 3)) != 0) sshfatal("sftp-client.c", __func__, 476, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse"); send_msg(ret, msg); get_msg_extended(ret, msg, 1); if ((r = sshbuf_get_u8(msg, &type)) != 0) sshfatal("sftp-client.c", __func__, 484, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse type"); if (type != 2) { sshlog("sftp-client.c", __func__, 486, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Invalid packet back from SSH2_FXP_INIT (type %u)", type) ; sshbuf_free(msg); free(ret); return( ((void *)0) ); } if ((r = sshbuf_get_u32(msg, &ret->version)) != 0) sshfatal("sftp-client.c", __func__, 493, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse version"); sshlog("sftp-client.c", __func__, 495, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "Remote version: %u", ret->version); while (sshbuf_len(msg) > 0) { char *name; u_char *value; size_t vlen; int known = 0; if ((r = sshbuf_get_cstring(msg, &name, ((void *)0) )) != 0 || (r = sshbuf_get_string(msg, &value, &vlen)) != 0) sshfatal("sftp-client.c", __func__, 506, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse extension"); if (strcmp(name, "posix-rename@openssh.com") == 0 && strcmp((char *)value, "1") == 0) { ret->exts |= 0x00000001; known = 1; } else if (strcmp(name, "statvfs@openssh.com") == 0 && strcmp((char *)value, "2") == 0) { ret->exts |= 0x00000002; known = 1; } else if (strcmp(name, "fstatvfs@openssh.com") == 0 && strcmp((char *)value, "2") == 0) { ret->exts |= 0x00000004; known = 1; } else if (strcmp(name, "hardlink@openssh.com") == 0 && strcmp((char *)value, "1") == 0) { ret->exts |= 0x00000008; known = 1; } else if (strcmp(name, "fsync@openssh.com") == 0 && strcmp((char *)value, "1") == 0) { ret->exts |= 0x00000010; known = 1; } else if (strcmp(name, "lsetstat@openssh.com") == 0 && strcmp((char *)value, "1") == 0) { ret->exts |= 0x00000020; known = 1; } else if (strcmp(name, "limits@openssh.com") == 0 && strcmp((char *)value, "1") == 0) { ret->exts |= 0x00000040; known = 1; } else if (strcmp(name, "expand-path@openssh.com") == 0 && strcmp((char *)value, "1") == 0) { ret->exts |= 0x00000080; known = 1; } else if (strcmp(name, "copy-data") == 0 && strcmp((char *)value, "1") == 0) { ret->exts |= 0x00000100; known = 1; } else if (strcmp(name, "users-groups-by-id@openssh.com") == 0 && strcmp((char *)value, "1") == 0) { ret->exts |= 0x00000200; known = 1; } if (known) { sshlog("sftp-client.c", __func__, 550, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "Server supports extension \"%s\" revision %s", name, value) ; } else { sshlog("sftp-client.c", __func__, 553, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "Unrecognised server extension \"%s\"", name); } free(name); free(value); } sshbuf_free(msg); if (ret->exts & 0x00000040) { struct sftp_limits limits; if (do_limits(ret, &limits) != 0) sshfatal("sftp-client.c", __func__, 565, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "limits failed"); if (transfer_buflen == 0) { ret->download_buflen = limits.read_length; ret->upload_buflen = limits.write_length; sshlog("sftp-client.c", __func__, 571, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Using server download size %u", ret->download_buflen); sshlog("sftp-client.c", __func__, 572, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Using server upload size %u", ret->upload_buflen); } if (num_requests == 0 && limits.open_handles) { ret->num_requests = (((64) < (limits.open_handles)) ? (64) : (limits.open_handles)); sshlog("sftp-client.c", __func__, 579, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Server handle limit %llu; using %u", (unsigned long long)limits.open_handles, ret->num_requests) ; } } if (ret->version == 0) { ret->download_buflen = (((ret->download_buflen) < (20480)) ? (ret->download_buflen) : (20480)); ret->upload_buflen = (((ret->upload_buflen) < (20480)) ? (ret->upload_buflen) : (20480)); } ret->limit_kbps = limit_kbps; if (ret->limit_kbps > 0) { bandwidth_limit_init(&ret->bwlimit_in, ret->limit_kbps, ret->download_buflen); bandwidth_limit_init(&ret->bwlimit_out, ret->limit_kbps, ret->upload_buflen); } return ret; }
void * do_init(int a1, int a2, int a3, int a4, long a5) { int v5; int v6; long v7; long v8; long v10; long v11; int v12; int v13; int v14; int v15; int v16; int v17; unsigned char v21; unsigned int u8; int v23; char *s1; char *v25; void *ptr; long v27; char v28[8]; long v29; long v30; unsigned long v31; unsigned long v32; v32 = __readfsqword(0x28u); ptr = (void *)xcalloc(1LL, 168LL); *((_DWORD *)ptr + 6) = 1; *(_DWORD *)ptr = a1; *((_DWORD *)ptr + 1) = a2; if ( a3 ) v5 = a3; else v5 = 0x8000; *((_DWORD *)ptr + 3) = v5; *((_DWORD *)ptr + 2) = *((_DWORD *)ptr + 3); if ( a4 ) v6 = a4; else v6 = 64; *((_DWORD *)ptr + 4) = v6; *((_DWORD *)ptr + 7) = 0; *((_QWORD *)ptr + 4) = 0LL; v27 = sshbuf_new(); if ( !v27 ) sshfatal("sftp-client.c", "do_init", 473LL, 1LL, 1LL, 0LL, "sshbuf_new failed"); u8 = sshbuf_put_u8(v27, 1LL); if ( u8 || (u8 = sshbuf_put_u32(v27, 3LL)) != 0 ) { v7 = ssh_err(u8); sshfatal("sftp-client.c", "do_init", 476LL, 1LL, 1LL, v7, "parse"); } send_msg((long)ptr, v27); get_msg_extended((unsigned int *)ptr, v27, 1); u8 = sshbuf_get_u8(v27, &v21); if ( u8 ) { v8 = ssh_err(u8); sshfatal("sftp-client.c", "do_init", 484LL, 1LL, 1LL, v8, "parse type"); } if ( v21 == 2 ) { u8 = sshbuf_get_u32(v27, (char *)ptr + 20); if ( u8 ) { v10 = ssh_err(u8); sshfatal("sftp-client.c", "do_init", 493LL, 1LL, 1LL, v10, "parse version"); } sshlog("sftp-client.c", "do_init", 495LL, 0LL, 6LL, 0LL, "Remote version: %u", *((unsigned int *)ptr + 5)); while ( sshbuf_len(v27) ) { v23 = 0; u8 = sshbuf_get_cstring(v27, &s1, 0LL); if ( u8 || (u8 = sshbuf_get_string(v27, &v25, v28)) != 0 ) { v11 = ssh_err(u8); sshfatal("sftp-client.c", "do_init", 506LL, 1LL, 1LL, v11, "parse extension"); } if ( !strcmp(s1, "posix-rename@openssh.com") && !strcmp(v25, "1") ) { *((_DWORD *)ptr + 7) |= 1u; v23 = 1; } else if ( !strcmp(s1, "statvfs@openssh.com") && !strcmp(v25, "2") ) { *((_DWORD *)ptr + 7) |= 2u; v23 = 1; } else if ( !strcmp(s1, "fstatvfs@openssh.com") && !strcmp(v25, "2") ) { *((_DWORD *)ptr + 7) |= 4u; v23 = 1; } else if ( !strcmp(s1, "hardlink@openssh.com") && !strcmp(v25, "1") ) { *((_DWORD *)ptr + 7) |= 8u; v23 = 1; } else if ( !strcmp(s1, "fsync@openssh.com") && !strcmp(v25, "1") ) { *((_DWORD *)ptr + 7) |= 0x10u; v23 = 1; } else if ( !strcmp(s1, "lsetstat@openssh.com") && !strcmp(v25, "1") ) { *((_DWORD *)ptr + 7) |= 0x20u; v23 = 1; } else if ( !strcmp(s1, "limits@openssh.com") && !strcmp(v25, "1") ) { *((_DWORD *)ptr + 7) |= 0x40u; v23 = 1; } else if ( !strcmp(s1, "expand-path@openssh.com") && !strcmp(v25, "1") ) { v12 = *((_DWORD *)ptr + 7); LOBYTE(v12) = v12 | 0x80; *((_DWORD *)ptr + 7) = v12; v23 = 1; } else if ( !strcmp(s1, "copy-data") && !strcmp(v25, "1") ) { v13 = *((_DWORD *)ptr + 7); BYTE1(v13) |= 1u; *((_DWORD *)ptr + 7) = v13; v23 = 1; } else if ( !strcmp(s1, "users-groups-by-id@openssh.com") && !strcmp(v25, "1") ) { v14 = *((_DWORD *)ptr + 7); BYTE1(v14) |= 2u; *((_DWORD *)ptr + 7) = v14; v23 = 1; } if ( v23 ) sshlog( "sftp-client.c", "do_init", 550LL, 0LL, 6LL, 0LL, "Server supports extension \"%s\" revision %s", s1, v25); else sshlog("sftp-client.c", "do_init", 553LL, 0LL, 6LL, 0LL, "Unrecognised server extension \"%s\"", s1); free(s1); free(v25); } sshbuf_free(v27); if ( (*((_DWORD *)ptr + 7) & 0x40) != 0 ) { if ( (unsigned int)do_limits((unsigned int *)ptr, v28) ) sshfatal("sftp-client.c", "do_init", 565LL, 1LL, 1LL, 0LL, "limits failed"); if ( !a3 ) { *((_DWORD *)ptr + 2) = v29; *((_DWORD *)ptr + 3) = v30; sshlog( "sftp-client.c", "do_init", 571LL, 0LL, 5LL, 0LL, "Using server download size %u", *((unsigned int *)ptr + 2)); sshlog( "sftp-client.c", "do_init", 572LL, 0LL, 5LL, 0LL, "Using server upload size %u", *((unsigned int *)ptr + 3)); } if ( !a4 && v31 ) { v15 = v31; if ( v31 > 0x40 ) v15 = 64; *((_DWORD *)ptr + 4) = v15; sshlog( "sftp-client.c", "do_init", 579LL, 0LL, 5LL, 0LL, "Server handle limit %llu; using %u", v31, *((unsigned int *)ptr + 4)); } } if ( !*((_DWORD *)ptr + 5) ) { v16 = 20480; if ( *((_DWORD *)ptr + 2) <= 0x5000u ) v16 = *((_DWORD *)ptr + 2); *((_DWORD *)ptr + 2) = v16; v17 = 20480; if ( *((_DWORD *)ptr + 3) <= 0x5000u ) v17 = *((_DWORD *)ptr + 3); *((_DWORD *)ptr + 3) = v17; } *((_QWORD *)ptr + 4) = a5; if ( *((_QWORD *)ptr + 4) ) { bandwidth_limit_init((char *)ptr + 40, *((_QWORD *)ptr + 4), *((unsigned int *)ptr + 2)); bandwidth_limit_init((char *)ptr + 104, *((_QWORD *)ptr + 4), *((unsigned int *)ptr + 3)); } return ptr; } else { sshlog("sftp-client.c", "do_init", 486LL, 0LL, 2LL, 0LL, "Invalid packet back from SSH2_FXP_INIT (type %u)", v21); sshbuf_free(v27); free(ptr); return 0LL; } }
void printentry(char *indent, entry *e, time_t next) { printf("%s - user: %s\n", indent, e->pwd->pw_name); printf("%s cmd: \"%s\"\n", indent, e->cmd); printf("%s flags: 0x%02X\n", indent, e->flags); printflags(indent, e->flags); printf("%s delay: %d\n", indent, e->delay); printf("%s next: %ld\n", indent, (long)next); printf("%s nextstring: ", indent); printf("%s", asctime(localtime(&next))); }
int printentry(const char *a1, long a2, time_t a3) { struct tm *v3; char *v4; time_t timer; long v7; const char *v8; v8 = a1; v7 = a2; timer = a3; printf("%s - user: %s\n", a1, **(const char ***)(a2 + 8)); printf("%s cmd: \"%s\"\n", a1, *(const char **)(a2 + 24)); printf("%s flags: 0x%02X\n", a1, *(unsigned int *)(a2 + 52)); printflags(a1, *(_DWORD *)(a2 + 52)); printf("%s delay: %d\n", a1, *(unsigned int *)(a2 + 56)); printf("%s next: %ld\n", a1, timer); printf("%s nextstring: ", a1); v3 = localtime(&timer); v4 = asctime(v3); return printf("%s", v4); }
int gzgetc(file) gzFile file; { unsigned char buf[1]; gz_statep state; if (file == ((void *)0) ) return -1; state = (gz_statep)file; if (state->mode != 7247 || (state->err != 0 && state->err != (-5))) return -1; if (state->x.have) { state->x.have--; state->x.pos++; return *(state->x.next)++; } return gz_read(state, buf, 1) < 1 ? -1 : buf[0]; }
long gzgetc(long a1) { unsigned char *v2; unsigned char v3; unsigned long v4; v4 = __readfsqword(0x28u); if ( !a1 ) return 0xFFFFFFFFLL; if ( *(_DWORD *)(a1 + 24) != 7247 || *(_DWORD *)(a1 + 116) && *(_DWORD *)(a1 + 116) != -5 ) return 0xFFFFFFFFLL; if ( *(_DWORD *)a1 ) { --*(_DWORD *)a1; ++*(_QWORD *)(a1 + 16); v2 = *(unsigned char **)(a1 + 8); *(_QWORD *)(a1 + 8) = v2 + 1; return *v2; } else if ( gz_read(a1, (char *)&v3, 1uLL) ) { return v3; } else { return 0xFFFFFFFFLL; } }
static void terminal_reset_arrow(EditLine *el) { funckey_t *arrow = el->el_terminal.t_fkey; static const wchar_t strA[] = L"\033[A"; static const wchar_t strB[] = L"\033[B"; static const wchar_t strC[] = L"\033[C"; static const wchar_t strD[] = L"\033[D"; static const wchar_t strH[] = L"\033[H"; static const wchar_t strF[] = L"\033[F"; static const wchar_t stOA[] = L"\033OA"; static const wchar_t stOB[] = L"\033OB"; static const wchar_t stOC[] = L"\033OC"; static const wchar_t stOD[] = L"\033OD"; static const wchar_t stOH[] = L"\033OH"; static const wchar_t stOF[] = L"\033OF"; keymacro_add(el, strA, &arrow[1].fun, arrow[1].type); keymacro_add(el, strB, &arrow[0].fun, arrow[0].type); keymacro_add(el, strC, &arrow[3].fun, arrow[3].type); keymacro_add(el, strD, &arrow[2].fun, arrow[2].type); keymacro_add(el, strH, &arrow[4].fun, arrow[4].type); keymacro_add(el, strF, &arrow[5].fun, arrow[5].type); keymacro_add(el, stOA, &arrow[1].fun, arrow[1].type); keymacro_add(el, stOB, &arrow[0].fun, arrow[0].type); keymacro_add(el, stOC, &arrow[3].fun, arrow[3].type); keymacro_add(el, stOD, &arrow[2].fun, arrow[2].type); keymacro_add(el, stOH, &arrow[4].fun, arrow[4].type); keymacro_add(el, stOF, &arrow[5].fun, arrow[5].type); if (el->el_map.type != 1) return; keymacro_add(el, &strA[1], &arrow[1].fun, arrow[1].type); keymacro_add(el, &strB[1], &arrow[0].fun, arrow[0].type); keymacro_add(el, &strC[1], &arrow[3].fun, arrow[3].type); keymacro_add(el, &strD[1], &arrow[2].fun, arrow[2].type); keymacro_add(el, &strH[1], &arrow[4].fun, arrow[4].type); keymacro_add(el, &strF[1], &arrow[5].fun, arrow[5].type); keymacro_add(el, &stOA[1], &arrow[1].fun, arrow[1].type); keymacro_add(el, &stOB[1], &arrow[0].fun, arrow[0].type); keymacro_add(el, &stOC[1], &arrow[3].fun, arrow[3].type); keymacro_add(el, &stOD[1], &arrow[2].fun, arrow[2].type); keymacro_add(el, &stOH[1], &arrow[4].fun, arrow[4].type); keymacro_add(el, &stOF[1], &arrow[5].fun, arrow[5].type); }
long terminal_reset_arrow(long a1) { long result; unsigned int *v2; v2 = *(unsigned int **)(a1 + 200); keymacro_add(a1, &strA_7375, v2 + 12, v2[14]); keymacro_add(a1, &strB_7376, v2 + 4, v2[6]); keymacro_add(a1, &strC_7377, v2 + 28, v2[30]); keymacro_add(a1, &strD_7378, v2 + 20, v2[22]); keymacro_add(a1, &strH_7379, v2 + 36, v2[38]); keymacro_add(a1, &strF_7380, v2 + 44, v2[46]); keymacro_add(a1, &stOA_7381, v2 + 12, v2[14]); keymacro_add(a1, &stOB_7382, v2 + 4, v2[6]); keymacro_add(a1, &stOC_7383, v2 + 28, v2[30]); keymacro_add(a1, &stOD_7384, v2 + 20, v2[22]); keymacro_add(a1, &stOH_7385, v2 + 36, v2[38]); keymacro_add(a1, &stOF_7386, v2 + 44, v2[46]); result = *(unsigned int *)(a1 + 1056); if ( (_DWORD)result == 1 ) { keymacro_add(a1, &unk_4EC4, v2 + 12, v2[14]); keymacro_add(a1, &unk_4ED4, v2 + 4, v2[6]); keymacro_add(a1, &unk_4EE4, v2 + 28, v2[30]); keymacro_add(a1, &unk_4EF4, v2 + 20, v2[22]); keymacro_add(a1, &unk_4F04, v2 + 36, v2[38]); keymacro_add(a1, &unk_4F14, v2 + 44, v2[46]); keymacro_add(a1, &unk_4F24, v2 + 12, v2[14]); keymacro_add(a1, &unk_4F34, v2 + 4, v2[6]); keymacro_add(a1, &unk_4F44, v2 + 28, v2[30]); keymacro_add(a1, &unk_4F54, v2 + 20, v2[22]); keymacro_add(a1, &unk_4F64, v2 + 36, v2[38]); return keymacro_add(a1, &unk_4F74, v2 + 44, v2[46]); } return result; }
int lookup_key_in_hostkeys_by_type(struct hostkeys *hostkeys, int keytype, int nid, const struct hostkey_entry **found) { return (check_hostkeys_by_key_or_type(hostkeys, ((void *)0) , keytype, nid, found) == HOST_FOUND); }
long long lookup_key_in_hostkeys_by_type(void* a0, unsigned long a1, unsigned long a2, unsigned long long *a3) { return check_hostkeys_by_key_or_type(a0, NULL, a1, a2, a3) == 4; }
static _Bool validate_file_name (char *file, _Bool check_basic_portability, _Bool check_extra_portability) { size_t filelen = strlen (file); char *start; _Bool check_component_lengths; _Bool file_exists = 0 ; if (check_extra_portability && ! no_leading_hyphen (file)) return 0 ; if ((check_basic_portability || check_extra_portability) && filelen == 0) { error (0, 0, gettext ("empty file name")); return 0 ; } if (check_basic_portability) { if (! portable_chars_only (file, filelen)) return 0 ; } else { struct stat st; if (lstat (file, &st) == 0) file_exists = 1 ; else if ( (*__errno_location ()) != 2 || filelen == 0) { error (0, (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, file)); return 0 ; } } if (check_basic_portability || (! file_exists && 256 <= filelen)) { size_t maxsize; if (check_basic_portability) maxsize = 256 ; else { long int size; char const *dir = (*file == '/' ? "/" : "."); (*__errno_location ()) = 0; size = pathconf (dir, _PC_PATH_MAX ); if (size < 0 && (*__errno_location ()) != 0) { error (0, (*__errno_location ()) , gettext ("%s: unable to determine maximum file name length"), dir); return 0 ; } maxsize = ((( size )<(0x7fffffffffffffffL))?( size ):(0x7fffffffffffffffL)) ; } if (maxsize <= filelen) { unsigned long int len = filelen; unsigned long int maxlen = maxsize - 1; error (0, 0, gettext ("limit %lu exceeded by length %lu of file name %s"), maxlen, len, quotearg_style (shell_escape_always_quoting_style, file)); return 0 ; } } check_component_lengths = check_basic_portability; if (! check_component_lengths && ! file_exists) { for (start = file; *(start = component_start (start)); ) { size_t length = component_len (start); if ( 14 < length) { check_component_lengths = 1 ; break; } start += length; } } if (check_component_lengths) { size_t name_max = 14 ; size_t known_name_max = (check_basic_portability ? 14 : 0); for (start = file; *(start = component_start (start)); ) { size_t length; if (known_name_max) name_max = known_name_max; else { long int len; char const *dir = (start == file ? "." : file); char c = *start; (*__errno_location ()) = 0; *start = '\0'; len = pathconf (dir, _PC_NAME_MAX ); *start = c; if (0 <= len) name_max = ((( len )<(0x7fffffffffffffffL))?( len ):(0x7fffffffffffffffL)) ; else switch ( (*__errno_location ()) ) { case 0: name_max = (18446744073709551615UL) ; break; case 2 : known_name_max = name_max; break; default: *start = '\0'; error (0, (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, dir)); *start = c; return 0 ; } } length = component_len (start); if (name_max < length) { unsigned long int len = length; unsigned long int maxlen = name_max; char c = start[len]; start[len] = '\0'; error (0, 0, gettext ("limit %lu exceeded by length %lu " "of file name component %s") , maxlen, len, quote (start)); start[len] = c; return 0 ; } start += length; } } return 1 ; }
int validate_file_name(char *a0, unsigned long a1, unsigned long a2) { char v0; char v1; char v2; char v3; char *v4; unsigned long long v5; unsigned long long v6; unsigned long v7; unsigned long long v8; unsigned int v9; unsigned long v10; unsigned long v11; unsigned long v12; unsigned long v13; unsigned int v14; unsigned long v15; unsigned long long v16; char *v17; unsigned long long v18; char v19; unsigned int v21; unsigned long long v22; unsigned long long v23; unsigned long long v24; unsigned long long v25; v8 = strlen(a0); v1 = 0; if (a2) { v21 = no_leading_hyphen(a0) ^ 1; if (v21) { v21 = 0; return v21; } } if ((a1 || a2) && !v8) { error(0x0, 0x0, gettext("empty file name")); v21 = 0; return v21; } if (a1) { v21 = portable_chars_only(a0, v8) ^ 1; if (v21) { v21 = 0; return v21; } } else if (!lstat(a0, &v19)) { v1 = 1; } else { v21 = *(__errno_location()); if (!(v21 == 2) || !(v8)) { v22 = quotearg_n_style_colon(0x0, 0x3, a0); error(0x0, *(__errno_location()), "%s"); v21 = 0; return v21; } } if (a1 || (v1 ^ 1) && v8 > 255) { if (a1) { v5 = 0x100; } else { v21 = (*(a0) == 47 ? "." : "/"); v9 = v21; *(__errno_location()) = 0; v10 = pathconf(*(&v9), 0x4); if ((v10 - 0 >> 63)) { v21 = *(__errno_location()); if (v21) { error(0x0, *(__errno_location()), gettext("%s: unable to determine maximum file name length")); v21 = 0; return v21; } } v5 = v10; } if (v5 <= v8) { v11 = v8; v12 = v5 - 1; v23 = quotearg_style(0x4, a0); error(0x0, 0x0, gettext("limit %lu exceeded by length %lu of file name %s")); v21 = 0; return v21; } } v0 = a1; if ((v0 ^ 1) && (v1 ^ 1)) { v4 = a0; while (true) { v4 = component_start(v4); if (!*(v4)) break; v13 = component_len(v4); if (v13 <= 14) { v4 = &v4[v13]; } else { v0 = 1; break; } } } if (!v0) { v21 = 1; return v21; } v6 = 14; v21 = (!a1 ? 14 : 0); v7 = v21; v4 = a0; while (true) { v4 = component_start(v4); if (!*(v4)) { v21 = 1; return v21; } if (v7) { v6 = v7; } else { v21 = (v4 == a0 ? a0 : "."); v14 = v21; v2 = *(v4); *(__errno_location()) = 0; *(v4) = 0; v15 = pathconf(*(&v14), 0x3); *(v4) = v2; if (!((v15 - 0 >> 63))) { v6 = v15; } else { v21 = *(__errno_location()); switch (v21) { case 0: v6 = -1; break; case 2: v7 = v6; break; default: *(v4) = 0; v24 = quotearg_n_style_colon(0x0, 0x3, *(&v14)); error(0x0, *(__errno_location()), "%s"); *(v4) = v2; v21 = 0; return v21; } } } v16 = component_len(v4); if (v6 < v16) { v17 = v16; v18 = v6; v3 = *((v17 + v4)); *((v17 + v4)) = 0; v25 = quote(v4); error(0x0, 0x0, gettext("limit %lu exceeded by length %lu of file name component %s")); *((v4 + v17)) = v3; v21 = 0; return v21; } v4 = &v4[v16]; } }
void open_archive (enum access_mode wanted_access) { flush_read_ptr = gnu_flush_read; flush_write_ptr = gnu_flush_write; _open_archive (wanted_access); switch (wanted_access) { case ACCESS_READ: case ACCESS_UPDATE: if (volume_label_option) match_volume_label (); break; case ACCESS_WRITE: records_written = 0; if (volume_label_option) write_volume_label (); break; } set_volume_start_time (); }
long long open_archive(unsigned int a0, unsigned long long a1, unsigned long long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) { flush_read_ptr = gnu_flush_read; flush_write_ptr = gnu_flush_write; _open_archive(a0, a1, a2, a3, a4, a5); if (a0 != 2 && a0 <= 2 && a0 && a0 == 1) { continued_file_offset = 0; if (*(&volume_label_option)) write_volume_label(); } if ((a0 == 2 || a0 <= 2 && !a0) && *(&volume_label_option)) match_volume_label(a0, a1, a2, a3, a4, a5); return set_volume_start_time(); }
int process_options (int argc, char **argv) { struct systemkey_tool_options *opts = &systemkey_tool_options; int opt; while ((opt = getopt_long (argc, argv, "!d:hv:", long_options, ((void *)0) )) != (-1) ) switch (opt) { case '\0': break; case 'd': opts->present.debug = 1 ; opts->arg.debug = optarg; opts->value.debug = parse_number(optarg); opts->enabled.debug = 1 ; break; case 0x7f + 1: opts->present.outfile = 1 ; opts->arg.outfile = optarg; opts->enabled.outfile = 1 ; break; case 0x7f + 2: opts->present.list = 1 ; opts->enabled.list = 1 ; break; case 0x7f + 3: opts->present.delete = 1 ; opts->arg.delete = optarg; opts->enabled.delete = 1 ; break; case 0x7f + 4: opts->present.outder = 1 ; opts->enabled.outder = 1 ; break; case 0x7f + 5: opts->present.outder = 1 ; opts->enabled.outder = 0 ; break; case 'v': opts->present.version = 1 ; opts->arg.version = optarg; opts->enabled.version = 1 ; break; case 'h': opts->present.help = 1 ; opts->enabled.help = 1 ; break; case '!': opts->present.more_help = 1 ; opts->enabled.more_help = 1 ; break; default: usage ( stderr , 1 ); break; } if (systemkey_tool_options.present.debug && systemkey_tool_options.value.debug < 0) { error ( 1 , 0, "%s option value %d is out of range.", "debug", opts->value.debug); } if (systemkey_tool_options.present.debug && systemkey_tool_options.value.debug > 9999) { error ( 1 , 0, "%s option value %d is out of range", "debug", opts->value.debug); } if (optind < argc) { error ( 1 , 0, "Command line arguments are not allowed."); } if (systemkey_tool_options.present.help) { usage ( stdout , (0)); } if (systemkey_tool_options.present.more_help) { pid_t pid; int pfds[2]; if (pipe (pfds) < 0) error ( 1 , (*__errno_location ()) , "pipe"); pid = fork (); if (pid < 0) error ( 1 , (*__errno_location ()) , "fork"); if (pid == 0) { close (pfds[0]); dup2 (pfds[1], 1 ); close (pfds[1]); usage ( stdout , 0); } else { const char *args[2]; const char *envvar; close (pfds[1]); dup2 (pfds[0], 0 ); close (pfds[0]); envvar = secure_getenv ("PAGER"); if (!envvar || *envvar == '\0') args[0] = "more"; else args[0] = envvar; args[1] = ((void *)0) ; execvp (args[0], (char * const *)args); exit ( 1 ); } } if (systemkey_tool_options.present.version) { if (!systemkey_tool_options.arg.version || !strcmp (systemkey_tool_options.arg.version, "c")) { const char str[] = "systemkey-tool 3.7.8\n" "Copyright (C) 2000-2021 Free Software Foundation, and others\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the GNU General Public License,\n" "version 3 or later <http: "\n" "Please send bug reports to: <bugs@gnutls.org> \n"; fprintf ( stdout , "%s", str); exit(0); } else if (!strcmp (systemkey_tool_options.arg.version, "v")) { const char str[] = "systemkey-tool 3.7.8\n"; fprintf ( stdout , "%s", str); exit(0); } else if (!strcmp (systemkey_tool_options.arg.version, "n")) { const char str[] = "systemkey-tool 3.7.8\n" "Copyright (C) 2000-2021 Free Software Foundation, and others\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the GNU General Public License,\n" "version 3 or later <http: "\n" "gnutls is free software: you can redistribute it and/or\n" "modify it under the terms of the GNU General Public License\n" "as published by the Free Software Foundation,\n" "either version 3 of the License, or (at your option) any later version.\n" "\n" "gnutls is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty\n" "of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" "See the GNU General Public License for more details.\n" "\n" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see <http: "\n" "Please send bug reports to: <bugs@gnutls.org> \n"; fprintf ( stdout , "%s", str); exit(0); } else { error ( 1 , 0, "version option argument 'a' invalid. Use:\n" " 'v' - version only\n" " 'c' - version and copyright\n" " 'n' - version and full copyright notice"); } } return optind; }
long long process_options(unsigned long a0, char **a1) { char **v0; unsigned int v1; unsigned int v2; unsigned int v3; struct_0 *v4; unsigned long long v5; char v6; char v7; unsigned long long v8; void* v9; unsigned long v10; unsigned long long v11; unsigned int v12; unsigned short v13; unsigned long long v16; unsigned long v18; struct_1 *v19; unsigned long long v20; unsigned long long v21; unsigned long long v23; struct_1 *v24; unsigned long long v25; unsigned long v26; v1 = a0; v0 = a1; v4 = got.systemkey_tool_options; while (true) { v2 = getopt_long(v1, v0, "!d:hv:", &long_options, NULL); if (v2 == -1) { if (*(got.systemkey_tool_options) && *((got.systemkey_tool_options + 40)) < 0) error(0x1, 0x0, "%s option value %d is out of range."); if (!*(got.systemkey_tool_options) || *((got.systemkey_tool_options + 40)) >= 0) { if (*(got.systemkey_tool_options) && *((got.systemkey_tool_options + 40)) > 9999) error(0x1, 0x0, "%s option value %d is out of range"); if (*((got.systemkey_tool_options + 40)) <= 9999 || !*(got.systemkey_tool_options)) { if (v1 > *(got.optind)) error(0x1, 0x0, "Command line arguments are not allowed."); if (*((got.systemkey_tool_options + 6))) usage(*(*(&got.stdout)), 0x0); if (*((got.systemkey_tool_options + 7))) { if (pipe(&v6) < 0) error(0x1, *(__errno_location()), "pipe"); v3 = fork(); if (v3 < 0) error(0x1, *(__errno_location()), "fork"); if (!v3) { close(*(&v6)); dup2(*(&v7), 0x1); close(*(&v7)); usage(*(*(&got.stdout)), 0x0); } close(*(&v7)); dup2(*(&v6), 0x0); close(*(&v6)); v5 = secure_getenv("PAGER"); if (v5 && *(v5)) v8 = v5; if (!v5 || !*(v5)) v8 = "more"; v9 = 0; execvp(v8, &v8); exit(0x1); } else { if (*((got.systemkey_tool_options + 5))) { if (*((got.systemkey_tool_options + 32))) { v16 = strcmp(*((got.systemkey_tool_options + 32)), "c"); if (v16) { if (!strcmp(*((got.systemkey_tool_options + 32)), "v")) { v10 = 7308055102851610995; v11 = 3684063721056120185; v12 = 942552878; v13 = 10; fprintf(*(*(&got.stdout)), "%s", &v10); exit(0x0); } if (!strcmp(*((got.systemkey_tool_options + 32)), "n")) { v23 = 115; v24 = &v10; for (v25 = "systemkey-tool 3.7.8\nCopyright (C) 2000-2021 Free Software Foundation, and others\nThis is free software. It is licensed for use, modification and\nredistribution under the terms of the GNU General Public License,\nversion 3 or later <http: v23 -= 1; v10 = *(v25); v24 = v24 + 8 * v26; } } else { error(0x1, 0x0, "version option argument 'a' invalid. Use:\n\t'v' - version only\n\t'c' - version and copyright\n\t'n' - version and full copyright notice"); } } } if (!v16 || !*((got.systemkey_tool_options + 32))) { v21 = 40; v19 = &v10; for (v20 = "systemkey-tool 3.7.8\nCopyright (C) 2000-2021 Free Software Foundation, and others\nThis is free software. It is licensed for use, modification and\nredistribution under the terms of the GNU General Public License,\nversion 3 or later <http: v21 -= 1; v10 = *(v20); v19 = v19 + 8 * v18; } *(&v19->field_0) = *(v20); v19->field_4 = *((v20 + 4)); v19->field_6 = *((v20 + 6)); fprintf(*(*(&got.stdout)), "%s", &v10); exit(0x0); } } else { return *(got.optind); } } } } } else if (v2 <= 132) { if (v2 < 100) { if (!v2) continue; if (v2 == 33) { v4->field_7 = 1; v4->field_33 = 1; } } else { switch (v2) { case 100: v4->field_0 = 1; v4->field_8 = *(*(&got.optarg)); v4->field_28 = parse_number(*(*(&got.optarg))); v4->field_2c = 1; break; case 104: v4->field_6 = 1; v4->field_32 = 1; break; case 118: v4->field_5 = 1; v4->field_20 = *(*(&got.optarg)); v4->field_31 = 1; break; case 128: v4->field_1 = 1; v4->field_10 = *(*(&got.optarg)); v4->field_2d = 1; break; case 129: v4->field_2 = 1; v4->field_2e = 1; break; case 130: v4->field_3 = 1; v4->field_18 = *(*(&got.optarg)); v4->field_2f = 1; break; case 131: v4->field_4 = 1; v4->field_30 = 1; break; case 132: v4->field_4 = 1; v4->field_30 = 0; break; default: usage(*(got.stderr), 0x1); } } } } *(&v24->field_0) = *(v25); v24->field_4 = *((v25 + 4)); v24->field_6 = *((v25 + 6)); fprintf(*(*(&got.stdout)), "%s", &v10); exit(0x0); }
static int heredoc_write (fd, heredoc, herelen) int fd; char *heredoc; size_t herelen; { ssize_t nw; int e; (*__errno_location ()) = 0; nw = write (fd, heredoc, herelen); e = (*__errno_location ()) ; if (nw != herelen) { if (e == 0) e = 28 ; return e; } return 0; }
int heredoc_write(unsigned long a0, void* a1, unsigned int a2) { unsigned int v0; unsigned long v1; unsigned int v3; *(__errno_location()) = 0; v1 = write(a0, a1, a2); v0 = *(__errno_location()); if (v1 != a2) { if (!v0) v0 = 28; v3 = v0; } else { v3 = 0; } return v3; }
static const char *strxf_share(__u8 share) { static char str[32]; switch (share) { case XFRM_SHARE_ANY: strcpy(str, "any"); break; case XFRM_SHARE_SESSION: strcpy(str, "session"); break; case XFRM_SHARE_USER: strcpy(str, "user"); break; case XFRM_SHARE_UNIQUE: strcpy(str, "unique"); break; default: sprintf(str, "%u", share); break; } return str; }
char * strxf_share(unsigned char a1) { if ( a1 == 3 ) { strcpy(str_9277, "unique"); return str_9277; } if ( a1 > 3u ) goto LABEL_10; if ( a1 == 2 ) { strcpy(str_9277, "user"); return str_9277; } if ( a1 > 2u ) { LABEL_10: sprintf(str_9277, "%u", a1); return str_9277; } if ( a1 ) strcpy(str_9277, "session"); else strcpy(str_9277, "any"); return str_9277; }
static Bool endsInBz2 ( Char* name ) { Int32 n = strlen ( name ); if (n <= 4) return ((Bool)0); return (name[n-4] == '.' && name[n-3] == 'b' && name[n-2] == 'z' && name[n-1] == '2'); }
undefined8 endsInBz2(char *param_1) { int iVar1; size_t sVar2; undefined8 uVar3; sVar2 = strlen(param_1); iVar1 = (int)sVar2; if (iVar1 < 5) { uVar3 = 0; } else if ((((param_1[(long)iVar1 + -4] == '.') && (param_1[(long)iVar1 + -3] == 'b')) && (param_1[(long)iVar1 + -2] == 'z')) && (param_1[(long)iVar1 + -1] == '2')) { uVar3 = 1; } else { uVar3 = 0; } return uVar3; }
static void send_string_attrs_request(struct sftp_conn *conn, u_int id, u_int code, const void *s, u_int len, Attrib *a) { struct sshbuf *msg; int r; if ((msg = sshbuf_new()) == ((void *)0) ) sshfatal("sftp-client.c", __func__, 259, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); if ((r = sshbuf_put_u8(msg, code)) != 0 || (r = sshbuf_put_u32(msg, id)) != 0 || (r = sshbuf_put_string(msg, s, len)) != 0 || (r = encode_attrib(msg, a)) != 0) sshfatal("sftp-client.c", __func__, 264, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose"); send_msg(conn, msg); sshlog("sftp-client.c", __func__, 266, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "Sent message fd %d T:%u I:%u F:0x%04x M:%05o", conn->fd_out, code, id, a->flags, a->perm) ; sshbuf_free(msg); }
void send_string_attrs_request(void* a0, unsigned long a1, unsigned long a2, unsigned long long a3, unsigned long a4, unsigned int a5[7]) { unsigned long long v0; unsigned long v1; struct_0 *v2; unsigned long v3; unsigned int v4; unsigned long long v5; unsigned long v6; char v7; unsigned long long v9; v2 = a0; v0 = a3; v5 = sshbuf_new(); if (!v5) sshfatal("sftp-client.c", "send_string_attrs_request", 0x103, 0x1, 0x1, 0x0, "sshbuf_new failed"); v4 = sshbuf_put_u8(v5, a2, a2); if (!(!v4) || !((v4 = sshbuf_put_u32(v5, a1, a1), !v4))) { LABEL_4008e6: v5 = "compose"; sshfatal("sftp-client.c", "send_string_attrs_request", 0x108, 0x1, 0x1, ssh_err(v4), *(&v7)); } else { v4 = sshbuf_put_string(v5, v0, a4, v0); if (v4 || (v4 = encode_attrib(v5, a5, a5), v4)) goto LABEL_4008e6; } send_msg(v2, v5); v6 = a5[6]; v5 = a5[0]; v3 = a1; v2 = a2; v1 = v2->field_4; v0 = "Sent message fd %d T:%u I:%u F:0x%04x M:%05o"; sshlog("sftp-client.c", "send_string_attrs_request", 0x10a, 0x0, 0x7, 0x0, *(&v7)); v9 = sshbuf_free(v5); return; }
int rl_set_timeout (unsigned int secs, unsigned int usecs) { timeout_duration.tv_sec = secs + usecs / 1000000; timeout_duration.tv_usec = usecs % 1000000; return 0; }
undefined8 rl_set_timeout(int param_1,uint param_2) { timeout_duration._0_8_ = (ulong)(param_1 + param_2 / 1000000); timeout_duration._8_8_ = (ulong)(param_2 % 1000000); return 0; }
static WORD_DESC * parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, contains_dollar_at) char *string; int *indexp, quoted, pflags, *quoted_dollar_atp, *contains_dollar_at; { int check_nullness, var_is_set, var_is_null, var_is_special; int want_substring, want_indir, want_patsub, want_casemod, want_attributes; char *name, *value, *temp, *temp1; WORD_DESC *tdesc, *ret; int t_index, sindex, c, tflag, modspec, local_pflags, all_element_arrayref; intmax_t number; array_eltstate_t es; temp = temp1 = value = (char *) ((void *)0) ; var_is_set = var_is_null = var_is_special = check_nullness = 0; want_substring = want_indir = want_patsub = want_casemod = want_attributes = 0; local_pflags = 0; all_element_arrayref = 0; sindex = *indexp; t_index = ++sindex; if (string[t_index] == '#' && ((1 && ((*__ctype_b_loc ())[(int) (( (unsigned char)string[t_index+1] ))] & (unsigned short int) _ISalpha) ) || (string[t_index+1] == '_'))) name = string_extract (string, &t_index, "}", 0x0002);
int parameter_brace_expand(unsigned long long a0, unsigned int *a1, unsigned long long a2, unsigned long long a3, unsigned int *a4, unsigned int *a5) { unsigned int v0; int tmp_37; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned int v8; unsigned int v9; unsigned int v10; unsigned int v11; unsigned int v12; unsigned int v13; unsigned int v14; unsigned int v15; unsigned int v16; unsigned int v17; unsigned int v18; char v19; char v20[3]; void* v21; void* v22; void* v23; struct_0 *v24; char v25[2]; unsigned long v26; unsigned long long v27; void* v28; unsigned long long v29; char v30[3]; char v31; unsigned long long v32; unsigned int v35; char v36[3]; unsigned long long v37; unsigned long long v38; unsigned long long v39; v1 = a2; v0 = a3; v21 = 0; v25 = v21; v22 = v25; v4 = 0; v6 = v4; v5 = v6; v16 = v5; v17 = 0; v9 = v17; v8 = v9; v18 = v8; v7 = v18; v13 = 0; v14 = 0; v3 = *(a1); v3 += 1; v2 = v3; if (*((a0 + v2)) == 35) { v35 = *((*(__ctype_b_loc()) + *((a0 + v2 + 1)) * 2)) & 0x400; if (*((a0 + v2 + 1)) == 95 || v35) *(&v20) = string_extract(a0, &v2, "}", 0x2, a4, a5); }
size_t blocking_write (int fd, void const *buf, size_t count) { size_t bytes = full_write (fd, buf, count); if (bytes < count && (*__errno_location ()) == 11 ) { int flags = rpl_fcntl (fd, 3 ); if (0 <= flags && flags & 04000 && rpl_fcntl (fd, 4 , flags & ~ 04000 ) != -1) { char const *buffer = buf; bytes += full_write (fd, buffer + bytes, count - bytes); } } return bytes; }
long long blocking_write(unsigned long a0, unsigned long long a1, unsigned long long a2) { unsigned int v0; unsigned long v1; v1 = full_write(a0, a1, a2, a1); if (v1 < a2 && *(__errno_location()) == 11) { v0 = rpl_fcntl(a0, 0x3); if (v0 >= 0 && (v0 & 0x800) && rpl_fcntl(a0, 0x4) != -1) v1 += full_write(a0, a1 + v1, a2 - v1, a1 + v1); } return v1; }
Hash_table * hash_initialize (size_t candidate, const Hash_tuning *tuning, Hash_hasher hasher, Hash_comparator comparator, Hash_data_freer data_freer) { Hash_table *table; if (hasher == ((void *)0) ) hasher = raw_hasher; if (comparator == ((void *)0) ) comparator = raw_comparator; table = malloc (sizeof *table); if (table == ((void *)0) ) return ((void *)0) ; if (!tuning) tuning = &default_tuning; table->tuning = tuning; if (!check_tuning (table)) { goto fail; } table->n_buckets = compute_bucket_size (candidate, tuning); if (!table->n_buckets) goto fail; table->bucket = calloc (table->n_buckets, sizeof *table->bucket); if (table->bucket == ((void *)0) ) goto fail; table->bucket_limit = table->bucket + table->n_buckets; table->n_buckets_used = 0; table->n_entries = 0; table->hasher = hasher; table->comparator = comparator; table->data_freer = data_freer; table->free_entry_list = ((void *)0) ; return table; fail: free (table); return ((void *)0) ; }
size_t * hash_initialize( unsigned long a1, void *a2, unsigned long ( *a3)(long a1, unsigned long a2), bool ( *a4)(long a1, long a2), size_t a5) { bool ( *v7)(long, long); unsigned long ( *v8)(long, unsigned long); void *v9; size_t *ptr; v9 = a2; v8 = a3; v7 = a4; if ( !a3 ) v8 = raw_hasher; if ( !a4 ) v7 = raw_comparator; ptr = (size_t *)malloc(0x50uLL); if ( !ptr ) return 0LL; if ( !a2 ) v9 = &default_tuning; ptr[5] = (size_t)v9; if ( (unsigned char)check_tuning((long)ptr) == 1 && (ptr[2] = compute_bucket_size(a1, (long)v9)) != 0 && (*ptr = (size_t)calloc(ptr[2], 0x10uLL)) != 0 ) { ptr[1] = 16 * ptr[2] + *ptr; ptr[3] = 0LL; ptr[4] = 0LL; ptr[6] = (size_t)v8; ptr[7] = (size_t)v7; ptr[8] = a5; ptr[9] = 0LL; return ptr; } else { free(ptr); return 0LL; } }
int process_options (int argc, char **argv) { struct gnutls_cli_options *opts = &gnutls_cli_options; int opt; opts->enabled.ca_verification = 1 ; while ((opt = getopt_long (argc, argv, "!Vbd:ehlp:rsuv:", long_options, ((void *)0) )) != (-1) ) switch (opt) { case '\0': break; case 'd': opts->present.debug = 1 ; opts->arg.debug = optarg; opts->value.debug = parse_number(optarg); opts->enabled.debug = 1 ; break; case 'V': opts->present.verbose = 1 ; opts->enabled.verbose = 1 ; break; case 0x7f + 1: opts->present.tofu = 1 ; opts->enabled.tofu = 1 ; break; case 0x7f + 2: opts->present.tofu = 1 ; opts->enabled.tofu = 0 ; break; case 0x7f + 3: opts->present.strict_tofu = 1 ; opts->enabled.strict_tofu = 1 ; break; case 0x7f + 4: opts->present.strict_tofu = 1 ; opts->enabled.strict_tofu = 0 ; break; case 0x7f + 5: opts->present.dane = 1 ; opts->enabled.dane = 1 ; break; case 0x7f + 6: opts->present.dane = 1 ; opts->enabled.dane = 0 ; break; case 0x7f + 7: opts->present.local_dns = 1 ; opts->enabled.local_dns = 1 ; break; case 0x7f + 8: opts->present.local_dns = 1 ; opts->enabled.local_dns = 0 ; break; case 0x7f + 9: opts->present.ca_verification = 1 ; opts->enabled.ca_verification = 1 ; break; case 0x7f + 10: opts->present.ca_verification = 1 ; opts->enabled.ca_verification = 0 ; break; case 0x7f + 11: opts->present.ocsp = 1 ; opts->enabled.ocsp = 1 ; break; case 0x7f + 12: opts->present.ocsp = 1 ; opts->enabled.ocsp = 0 ; break; case 'r': opts->present.resume = 1 ; opts->enabled.resume = 1 ; break; case 0x7f + 13: opts->present.earlydata = 1 ; opts->arg.earlydata = optarg; opts->enabled.earlydata = 1 ; break; case 'e': opts->present.rehandshake = 1 ; opts->enabled.rehandshake = 1 ; break; case 0x7f + 14: opts->present.sni_hostname = 1 ; opts->arg.sni_hostname = optarg; opts->enabled.sni_hostname = 1 ; break; case 0x7f + 15: opts->present.verify_hostname = 1 ; opts->arg.verify_hostname = optarg; opts->enabled.verify_hostname = 1 ; break; case 's': opts->present.starttls = 1 ; opts->enabled.starttls = 1 ; break; case 0x7f + 17: case 0x7f + 16: opts->present.starttls_proto = 1 ; opts->arg.starttls_proto = optarg; opts->enabled.starttls_proto = 1 ; break; case 'u': opts->present.udp = 1 ; opts->enabled.udp = 1 ; break; case 0x7f + 18: opts->present.mtu = 1 ; opts->arg.mtu = optarg; opts->value.mtu = parse_number(optarg); opts->enabled.mtu = 1 ; break; case 0x7f + 19: opts->present.crlf = 1 ; opts->enabled.crlf = 1 ; break; case 0x7f + 20: opts->present.fastopen = 1 ; opts->enabled.fastopen = 1 ; break; case 0x7f + 21: opts->present.x509fmtder = 1 ; opts->enabled.x509fmtder = 1 ; break; case 0x7f + 22: opts->present.print_cert = 1 ; opts->enabled.print_cert = 1 ; break; case 0x7f + 23: opts->present.save_cert = 1 ; opts->arg.save_cert = optarg; opts->enabled.save_cert = 1 ; break; case 0x7f + 24: opts->present.save_ocsp = 1 ; opts->arg.save_ocsp = optarg; opts->enabled.save_ocsp = 1 ; break; case 0x7f + 25: opts->present.save_ocsp_multi = 1 ; opts->arg.save_ocsp_multi = optarg; opts->enabled.save_ocsp_multi = 1 ; break; case 0x7f + 26: opts->present.save_server_trace = 1 ; opts->arg.save_server_trace = optarg; opts->enabled.save_server_trace = 1 ; break; case 0x7f + 27: opts->present.save_client_trace = 1 ; opts->arg.save_client_trace = optarg; opts->enabled.save_client_trace = 1 ; break; case 0x7f + 28: opts->present.dh_bits = 1 ; opts->arg.dh_bits = optarg; opts->value.dh_bits = parse_number(optarg); opts->enabled.dh_bits = 1 ; break; case 0x7f + 29: opts->present.priority = 1 ; opts->arg.priority = optarg; opts->enabled.priority = 1 ; break; case 0x7f + 30: opts->present.x509cafile = 1 ; opts->arg.x509cafile = optarg; opts->enabled.x509cafile = 1 ; break; case 0x7f + 31: opts->present.x509crlfile = 1 ; opts->arg.x509crlfile = optarg; opts->enabled.x509crlfile = 1 ; break; case 0x7f + 32: opts->present.x509keyfile = 1 ; opts->arg.x509keyfile = optarg; opts->enabled.x509keyfile = 1 ; break; case 0x7f + 33: opts->present.x509certfile = 1 ; opts->arg.x509certfile = optarg; opts->enabled.x509certfile = 1 ; break; case 0x7f + 34: opts->present.rawpkkeyfile = 1 ; opts->arg.rawpkkeyfile = optarg; opts->enabled.rawpkkeyfile = 1 ; break; case 0x7f + 35: opts->present.rawpkfile = 1 ; opts->arg.rawpkfile = optarg; opts->enabled.rawpkfile = 1 ; break; case 0x7f + 36: opts->present.srpusername = 1 ; opts->arg.srpusername = optarg; opts->enabled.srpusername = 1 ; break; case 0x7f + 37: opts->present.srppasswd = 1 ; opts->arg.srppasswd = optarg; opts->enabled.srppasswd = 1 ; break; case 0x7f + 38: opts->present.pskusername = 1 ; opts->arg.pskusername = optarg; opts->enabled.pskusername = 1 ; break; case 0x7f + 39: opts->present.pskkey = 1 ; opts->arg.pskkey = optarg; opts->enabled.pskkey = 1 ; break; case 'p': opts->present.port = 1 ; opts->arg.port = optarg; opts->enabled.port = 1 ; break; case 0x7f + 40: opts->present.insecure = 1 ; opts->enabled.insecure = 1 ; break; case 0x7f + 41: opts->present.verify_allow_broken = 1 ; opts->enabled.verify_allow_broken = 1 ; break; case 0x7f + 42: opts->present.ranges = 1 ; opts->enabled.ranges = 1 ; break; case 0x7f + 43: opts->present.benchmark_ciphers = 1 ; opts->enabled.benchmark_ciphers = 1 ; break; case 0x7f + 44: opts->present.benchmark_tls_kx = 1 ; opts->enabled.benchmark_tls_kx = 1 ; break; case 0x7f + 45: opts->present.benchmark_tls_ciphers = 1 ; opts->enabled.benchmark_tls_ciphers = 1 ; break; case 'l': opts->present.list = 1 ; opts->enabled.list = 1 ; break; case 0x7f + 46: opts->present.priority_list = 1 ; opts->enabled.priority_list = 1 ; break; case 0x7f + 47: opts->present.noticket = 1 ; opts->enabled.noticket = 1 ; break; case 0x7f + 48: opts->present.srtp_profiles = 1 ; opts->arg.srtp_profiles = optarg; opts->enabled.srtp_profiles = 1 ; break; case 0x7f + 49: opts->present.alpn = 1 ; append_to_list (&opts->list.alpn, "alpn", optarg); opts->enabled.alpn = 1 ; break; case 0x7f + 50: opts->present.compress_cert = 1 ; append_to_list (&opts->list.compress_cert, "compress-cert", optarg); opts->enabled.compress_cert = 1 ; break; case 'b': opts->present.heartbeat = 1 ; opts->enabled.heartbeat = 1 ; break; case 0x7f + 51: opts->present.recordsize = 1 ; opts->arg.recordsize = optarg; opts->value.recordsize = parse_number(optarg); opts->enabled.recordsize = 1 ; break; case 0x7f + 52: opts->present.disable_sni = 1 ; opts->enabled.disable_sni = 1 ; break; case 0x7f + 53: opts->present.disable_extensions = 1 ; opts->enabled.disable_extensions = 1 ; break; case 0x7f + 54: opts->present.single_key_share = 1 ; opts->enabled.single_key_share = 1 ; break; case 0x7f + 55: opts->present.post_handshake_auth = 1 ; opts->enabled.post_handshake_auth = 1 ; break; case 0x7f + 56: opts->present.inline_commands = 1 ; opts->enabled.inline_commands = 1 ; break; case 0x7f + 57: opts->present.inline_commands_prefix = 1 ; opts->arg.inline_commands_prefix = optarg; opts->enabled.inline_commands_prefix = 1 ; break; case 0x7f + 58: opts->present.provider = 1 ; opts->arg.provider = optarg; opts->enabled.provider = 1 ; break; case 0x7f + 59: opts->present.fips140_mode = 1 ; opts->enabled.fips140_mode = 1 ; break; case 0x7f + 60: opts->present.list_config = 1 ; opts->enabled.list_config = 1 ; break; case 0x7f + 61: opts->present.logfile = 1 ; opts->arg.logfile = optarg; opts->enabled.logfile = 1 ; break; case 0x7f + 62: opts->present.keymatexport = 1 ; opts->arg.keymatexport = optarg; opts->enabled.keymatexport = 1 ; break; case 0x7f + 63: opts->present.keymatexportsize = 1 ; opts->arg.keymatexportsize = optarg; opts->value.keymatexportsize = parse_number(optarg); opts->enabled.keymatexportsize = 1 ; break; case 0x7f + 64: opts->present.waitresumption = 1 ; opts->enabled.waitresumption = 1 ; break; case 0x7f + 65: opts->present.ca_auto_retrieve = 1 ; opts->enabled.ca_auto_retrieve = 1 ; break; case 0x7f + 66: opts->present.ca_auto_retrieve = 1 ; opts->enabled.ca_auto_retrieve = 0 ; break; case 'v': opts->present.version = 1 ; opts->arg.version = optarg; opts->enabled.version = 1 ; break; case 'h': opts->present.help = 1 ; opts->enabled.help = 1 ; break; case '!': opts->present.more_help = 1 ; opts->enabled.more_help = 1 ; break; default: usage ( stderr , 1 ); break; } if (gnutls_cli_options.present.debug && gnutls_cli_options.value.debug < 0) { error ( 1 , 0, "%s option value %d is out of range.", "debug", opts->value.debug); } if (gnutls_cli_options.present.debug && gnutls_cli_options.value.debug > 9999) { error ( 1 , 0, "%s option value %d is out of range", "debug", opts->value.debug); } if (gnutls_cli_options.present.starttls_proto && gnutls_cli_options.present.starttls) { error ( 1 , 0, "the '%s' and '%s' options conflict", "starttls-proto", "starttls"); } if (gnutls_cli_options.present.mtu && gnutls_cli_options.value.mtu < 0) { error ( 1 , 0, "%s option value %d is out of range.", "mtu", opts->value.mtu); } if (gnutls_cli_options.present.mtu && gnutls_cli_options.value.mtu > 17000) { error ( 1 , 0, "%s option value %d is out of range", "mtu", opts->value.mtu); } if (gnutls_cli_options.present.save_ocsp && gnutls_cli_options.present.save_ocsp_multi) { error ( 1 , 0, "the '%s' and '%s' options conflict", "save-ocsp", "save_ocsp_multi"); } if (gnutls_cli_options.present.save_ocsp_multi && gnutls_cli_options.present.save_ocsp) { error ( 1 , 0, "the '%s' and '%s' options conflict", "save-ocsp-multi", "save_ocsp"); } if (gnutls_cli_options.present.x509certfile && !gnutls_cli_options.present.x509keyfile) { error ( 1 , 0, "%s option requires the %s options", "x509certfile", "x509keyfile"); } if (gnutls_cli_options.present.rawpkfile && !gnutls_cli_options.present.rawpkkeyfile) { error ( 1 , 0, "%s option requires the %s options", "rawpkfile", "rawpkkeyfile"); } if (gnutls_cli_options.present.list && gnutls_cli_options.present.port) { error ( 1 , 0, "the '%s' and '%s' options conflict", "list", "port"); } if (gnutls_cli_options.present.recordsize && gnutls_cli_options.value.recordsize < 0) { error ( 1 , 0, "%s option value %d is out of range.", "recordsize", opts->value.recordsize); } if (gnutls_cli_options.present.recordsize && gnutls_cli_options.value.recordsize > 4096) { error ( 1 , 0, "%s option value %d is out of range", "recordsize", opts->value.recordsize); } if (gnutls_cli_options.present.help) { usage ( stdout , (0)); } if (gnutls_cli_options.present.more_help) { pid_t pid; int pfds[2]; if (pipe (pfds) < 0) error ( 1 , (*__errno_location ()) , "pipe"); pid = fork (); if (pid < 0) error ( 1 , (*__errno_location ()) , "fork"); if (pid == 0) { close (pfds[0]); dup2 (pfds[1], 1 ); close (pfds[1]); usage ( stdout , 0); } else { const char *args[2]; const char *envvar; close (pfds[1]); dup2 (pfds[0], 0 ); close (pfds[0]); envvar = secure_getenv ("PAGER"); if (!envvar || *envvar == '\0') args[0] = "more"; else args[0] = envvar; args[1] = ((void *)0) ; execvp (args[0], (char * const *)args); exit ( 1 ); } } if (gnutls_cli_options.present.version) { if (!gnutls_cli_options.arg.version || !strcmp (gnutls_cli_options.arg.version, "c")) { const char str[] = "gnutls-cli 3.7.8\n" "Copyright (C) 2000-2021 Free Software Foundation, and others\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the GNU General Public License,\n" "version 3 or later <http: "\n" "Please send bug reports to: <bugs@gnutls.org> \n"; fprintf ( stdout , "%s", str); exit(0); } else if (!strcmp (gnutls_cli_options.arg.version, "v")) { const char str[] = "gnutls-cli 3.7.8\n"; fprintf ( stdout , "%s", str); exit(0); } else if (!strcmp (gnutls_cli_options.arg.version, "n")) { const char str[] = "gnutls-cli 3.7.8\n" "Copyright (C) 2000-2021 Free Software Foundation, and others\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the GNU General Public License,\n" "version 3 or later <http: "\n" "gnutls is free software: you can redistribute it and/or\n" "modify it under the terms of the GNU General Public License\n" "as published by the Free Software Foundation,\n" "either version 3 of the License, or (at your option) any later version.\n" "\n" "gnutls is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty\n" "of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" "See the GNU General Public License for more details.\n" "\n" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see <http: "\n" "Please send bug reports to: <bugs@gnutls.org> \n"; fprintf ( stdout , "%s", str); exit(0); } else { error ( 1 , 0, "version option argument 'a' invalid. Use:\n" " 'v' - version only\n" " 'c' - version and copyright\n" " 'n' - version and full copyright notice"); } } return optind; }
undefined4 process_options(undefined4 param_1,undefined8 param_2) { undefined *puVar1; undefined4 uVar2; int iVar3; __pid_t _Var4; int *piVar5; long lVar6; undefined8 *puVar7; undefined8 *puVar8; long in_FS_OFFSET; byte bVar9; int local_3d0; int local_3cc; char *local_3c8; undefined8 local_3c0; undefined8 local_3b8; undefined8 local_3b0; undefined2 local_3a8; long local_10; puVar1 = puRam00000000001002a7; bVar9 = 0; local_10 = *(long *)(in_FS_OFFSET + 0x28); puRam00000000001002a7[0x186] = 1; do { uVar2 = getopt_long(param_1,param_2,"!Vbd:ehlp:rsuv:",long_options,0); switch(uVar2) { case 0: break; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: case 0x20: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f: case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x57: case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: case 0x60: case 0x61: case 99: case 0x66: case 0x67: case 0x69: case 0x6a: case 0x6b: case 0x6d: case 0x6e: case 0x6f: case 0x71: case 0x74: case 0x77: case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: usage(*puRam0000000000100fdf,1); case 0x21: puVar1[0x45] = 1; puVar1[0x1c5] = 1; break; case 0x56: puVar1[1] = 1; puVar1[0x181] = 1; break; case 0x62: puVar1[0x33] = 1; puVar1[0x1b3] = 1; break; case 100: *puVar1 = 1; *(undefined8 *)(puVar1 + 0x48) = *puRam0000000000100309; uVar2 = parse_number(); *(undefined4 *)(puVar1 + 0x148) = uVar2; puVar1[0x180] = 1; break; case 0x65: puVar1[10] = 1; puVar1[0x18a] = 1; break; case 0x68: puVar1[0x44] = 1; puVar1[0x1c4] = 1; break; case 0x6c: puVar1[0x2d] = 1; puVar1[0x1ad] = 1; break; case 0x70: puVar1[0x26] = 1; *(undefined8 *)(puVar1 + 0x100) = *puRam0000000000100aa7; puVar1[0x1a6] = 1; break; case 0x72: puVar1[8] = 1; puVar1[0x188] = 1; break; case 0x73: puVar1[0xd] = 1; puVar1[0x18d] = 1; break; case 0x75: puVar1[0xf] = 1; puVar1[399] = 1; break; case 0x76: puVar1[0x43] = 1; *(undefined8 *)(puVar1 + 0x140) = *puRam0000000000100f81; puVar1[0x1c3] = 1; break; case 0x80: puVar1[2] = 1; puVar1[0x182] = 1; break; case 0x81: puVar1[2] = 1; puVar1[0x182] = 0; break; case 0x82: puVar1[3] = 1; puVar1[0x183] = 1; break; case 0x83: puVar1[3] = 1; puVar1[0x183] = 0; break; case 0x84: puVar1[4] = 1; puVar1[0x184] = 1; break; case 0x85: puVar1[4] = 1; puVar1[0x184] = 0; break; case 0x86: puVar1[5] = 1; puVar1[0x185] = 1; break; case 0x87: puVar1[5] = 1; puVar1[0x185] = 0; break; case 0x88: puVar1[6] = 1; puVar1[0x186] = 1; break; case 0x89: puVar1[6] = 1; puVar1[0x186] = 0; break; case 0x8a: puVar1[7] = 1; puVar1[0x187] = 1; break; case 0x8b: puVar1[7] = 1; puVar1[0x187] = 0; break; case 0x8c: puVar1[9] = 1; *(undefined8 *)(puVar1 + 0x50) = *puRam0000000000100501; puVar1[0x189] = 1; break; case 0x8d: puVar1[0xb] = 1; *(undefined8 *)(puVar1 + 0x58) = *puRam0000000000100552; puVar1[0x18b] = 1; break; case 0x8e: puVar1[0xc] = 1; *(undefined8 *)(puVar1 + 0x60) = *puRam0000000000100585; puVar1[0x18c] = 1; break; case 0x8f: case 0x90: puVar1[0xe] = 1; *(undefined8 *)(puVar1 + 0x68) = *puRam00000000001005d6; puVar1[0x18e] = 1; break; case 0x91: puVar1[0x10] = 1; *(undefined8 *)(puVar1 + 0x70) = *puRam0000000000100627; uVar2 = parse_number(); *(undefined4 *)(puVar1 + 0x14c) = uVar2; puVar1[400] = 1; break; case 0x92: puVar1[0x11] = 1; puVar1[0x191] = 1; break; case 0x93: puVar1[0x12] = 1; puVar1[0x192] = 1; break; case 0x94: puVar1[0x13] = 1; puVar1[0x193] = 1; break; case 0x95: puVar1[0x14] = 1; puVar1[0x194] = 1; break; case 0x96: puVar1[0x15] = 1; *(undefined8 *)(puVar1 + 0x78) = *puRam00000000001006f3; puVar1[0x195] = 1; break; case 0x97: puVar1[0x16] = 1; *(undefined8 *)(puVar1 + 0x80) = *puRam0000000000100726; puVar1[0x196] = 1; break; case 0x98: puVar1[0x17] = 1; *(undefined8 *)(puVar1 + 0x88) = *puRam000000000010075c; puVar1[0x197] = 1; break; case 0x99: puVar1[0x18] = 1; *(undefined8 *)(puVar1 + 0x90) = *puRam0000000000100792; puVar1[0x198] = 1; break; case 0x9a: puVar1[0x19] = 1; *(undefined8 *)(puVar1 + 0x98) = *puRam00000000001007c8; puVar1[0x199] = 1; break; case 0x9b: puVar1[0x1a] = 1; *(undefined8 *)(puVar1 + 0xa0) = *puRam00000000001007fe; uVar2 = parse_number(); *(undefined4 *)(puVar1 + 0x150) = uVar2; puVar1[0x19a] = 1; break; case 0x9c: puVar1[0x1b] = 1; *(undefined8 *)(puVar1 + 0xa8) = *puRam0000000000100855; puVar1[0x19b] = 1; break; case 0x9d: puVar1[0x1c] = 1; *(undefined8 *)(puVar1 + 0xb0) = *puRam000000000010088b; puVar1[0x19c] = 1; break; case 0x9e: puVar1[0x1d] = 1; *(undefined8 *)(puVar1 + 0xb8) = *puRam00000000001008c1; puVar1[0x19d] = 1; break; case 0x9f: puVar1[0x1e] = 1; *(undefined8 *)(puVar1 + 0xc0) = *puRam00000000001008f7; puVar1[0x19e] = 1; break; case 0xa0: puVar1[0x1f] = 1; *(undefined8 *)(puVar1 + 200) = *puRam000000000010092d; puVar1[0x19f] = 1; break; case 0xa1: puVar1[0x20] = 1; *(undefined8 *)(puVar1 + 0xd0) = *puRam0000000000100963; puVar1[0x1a0] = 1; break; case 0xa2: puVar1[0x21] = 1; *(undefined8 *)(puVar1 + 0xd8) = *puRam0000000000100999; puVar1[0x1a1] = 1; break; case 0xa3: puVar1[0x22] = 1; *(undefined8 *)(puVar1 + 0xe0) = *puRam00000000001009cf; puVar1[0x1a2] = 1; break; case 0xa4: puVar1[0x23] = 1; *(undefined8 *)(puVar1 + 0xe8) = *puRam0000000000100a05; puVar1[0x1a3] = 1; break; case 0xa5: puVar1[0x24] = 1; *(undefined8 *)(puVar1 + 0xf0) = *puRam0000000000100a3b; puVar1[0x1a4] = 1; break; case 0xa6: puVar1[0x25] = 1; *(undefined8 *)(puVar1 + 0xf8) = *puRam0000000000100a71; puVar1[0x1a5] = 1; break; case 0xa7: puVar1[0x27] = 1; puVar1[0x1a7] = 1; break; case 0xa8: puVar1[0x28] = 1; puVar1[0x1a8] = 1; break; case 0xa9: puVar1[0x29] = 1; puVar1[0x1a9] = 1; break; case 0xaa: puVar1[0x2a] = 1; puVar1[0x1aa] = 1; break; case 0xab: puVar1[0x2b] = 1; puVar1[0x1ab] = 1; break; case 0xac: puVar1[0x2c] = 1; puVar1[0x1ac] = 1; break; case 0xad: puVar1[0x2e] = 1; puVar1[0x1ae] = 1; break; case 0xae: puVar1[0x2f] = 1; puVar1[0x1af] = 1; break; case 0xaf: puVar1[0x30] = 1; *(undefined8 *)(puVar1 + 0x108) = *puRam0000000000100beb; puVar1[0x1b0] = 1; break; case 0xb0: puVar1[0x31] = 1; append_to_list(puVar1 + 0x160,&DAT_00101ca2,*puRam0000000000100c21); puVar1[0x1b1] = 1; break; case 0xb1: puVar1[0x32] = 1; append_to_list(puVar1 + 0x170,"compress-cert",*puRam0000000000100c69); puVar1[0x1b2] = 1; break; case 0xb2: puVar1[0x34] = 1; *(undefined8 *)(puVar1 + 0x110) = *puRam0000000000100ccf; uVar2 = parse_number(); *(undefined4 *)(puVar1 + 0x154) = uVar2; puVar1[0x1b4] = 1; break; case 0xb3: puVar1[0x35] = 1; puVar1[0x1b5] = 1; break; case 0xb4: puVar1[0x36] = 1; puVar1[0x1b6] = 1; break; case 0xb5: puVar1[0x37] = 1; puVar1[0x1b7] = 1; break; case 0xb6: puVar1[0x38] = 1; puVar1[0x1b8] = 1; break; case 0xb7: puVar1[0x39] = 1; puVar1[0x1b9] = 1; break; case 0xb8: puVar1[0x3a] = 1; *(undefined8 *)(puVar1 + 0x118) = *puRam0000000000100dbc; puVar1[0x1ba] = 1; break; case 0xb9: puVar1[0x3b] = 1; *(undefined8 *)(puVar1 + 0x120) = *puRam0000000000100df2; puVar1[0x1bb] = 1; break; case 0xba: puVar1[0x3c] = 1; puVar1[0x1bc] = 1; break; case 0xbb: puVar1[0x3d] = 1; puVar1[0x1bd] = 1; break; case 0xbc: puVar1[0x3e] = 1; *(undefined8 *)(puVar1 + 0x128) = *puRam0000000000100e64; puVar1[0x1be] = 1; break; case 0xbd: puVar1[0x3f] = 1; *(undefined8 *)(puVar1 + 0x130) = *puRam0000000000100e9a; puVar1[0x1bf] = 1; break; case 0xbe: puVar1[0x40] = 1; *(undefined8 *)(puVar1 + 0x138) = *puRam0000000000100ed0; uVar2 = parse_number(); *(undefined4 *)(puVar1 + 0x158) = uVar2; puVar1[0x1c0] = 1; break; case 0xbf: puVar1[0x41] = 1; puVar1[0x1c1] = 1; break; case 0xc0: puVar1[0x42] = 1; puVar1[0x1c2] = 1; break; case 0xc1: puVar1[0x42] = 1; puVar1[0x1c2] = 0; break; default: if ((*pcRam0000000000101032 != '\0') && (*(int *)(lRam0000000000101040 + 0x148) < 0)) { error(1,0,"%s option value %d is out of range.","debug",*(undefined4 *)(puVar1 + 0x148)); } if ((*pcRam0000000000101083 != '\0') && (9999 < *(int *)(lRam0000000000101091 + 0x148))) { error(1,0,"%s option value %d is out of range","debug",*(undefined4 *)(puVar1 + 0x148)); } if ((*(char *)(lRam00000000001010d7 + 0xe) != '\0') && (*(char *)(lRam00000000001010e6 + 0xd) != '\0')) { error(1,0,"the \'%s\' and \'%s\' options conflict","starttls-proto","starttls"); } if ((*(char *)(lRam000000000010111e + 0x10) != '\0') && (*(int *)(lRam000000000010112d + 0x14c) < 0)) { error(1,0,"%s option value %d is out of range.",&DAT_00101b25, *(undefined4 *)(puVar1 + 0x14c)); } if ((*(char *)(lRam0000000000101170 + 0x10) != '\0') && (17000 < *(int *)(lRam000000000010117f + 0x14c))) { error(1,0,"%s option value %d is out of range",&DAT_00101b25,*(undefined4 *)(puVar1 + 0x14c) ); } if ((*(char *)(lRam00000000001011c5 + 0x16) != '\0') && (*(char *)(lRam00000000001011d4 + 0x17) != '\0')) { error(1,0,"the \'%s\' and \'%s\' options conflict","save-ocsp","save_ocsp_multi"); } if ((*(char *)(lRam000000000010120c + 0x17) != '\0') && (*(char *)(lRam000000000010121b + 0x16) != '\0')) { error(1,0,"the \'%s\' and \'%s\' options conflict","save-ocsp-multi","save_ocsp"); } if ((*(char *)(lRam0000000000101253 + 0x1f) != '\0') && (*(char *)(lRam0000000000101262 + 0x1e) != '\x01')) { error(1,0,"%s option requires the %s options","x509certfile","x509keyfile"); } if ((*(char *)(lRam000000000010129d + 0x21) != '\0') && (*(char *)(lRam00000000001012ac + 0x20) != '\x01')) { error(1,0,"%s option requires the %s options","rawpkfile","rawpkkeyfile"); } if ((*(char *)(lRam00000000001012e7 + 0x2d) != '\0') && (*(char *)(lRam00000000001012f6 + 0x26) != '\0')) { error(1,0,"the \'%s\' and \'%s\' options conflict",&DAT_00101c78,&DAT_00101c16); } if ((*(char *)(lRam000000000010132e + 0x34) != '\0') && (*(int *)(lRam000000000010133d + 0x154) < 0)) { error(1,0,"%s option value %d is out of range.","recordsize",*(undefined4 *)(puVar1 + 0x154) ); } if ((*(char *)(lRam0000000000101380 + 0x34) != '\0') && (0x1000 < *(int *)(lRam000000000010138f + 0x154))) { error(1,0,"%s option value %d is out of range","recordsize",*(undefined4 *)(puVar1 + 0x154)) ; } if (*(char *)(lRam00000000001013d5 + 0x44) != '\0') { usage(*puRam00000000001013e4,0); } if (*(char *)(lRam00000000001013fb + 0x45) != '\0') { iVar3 = pipe(&local_3d0); if (iVar3 < 0) { piVar5 = __errno_location(); error(1,*piVar5,&DAT_00101e8a); } _Var4 = fork(); if (-1 < _Var4) { if (_Var4 != 0) { close(local_3cc); dup2(local_3d0,0); close(local_3d0); local_3c8 = (char *)secure_getenv("PAGER"); if ((local_3c8 == (char *)0x0) || (*local_3c8 == '\0')) { local_3c8 = "more"; } local_3c0 = 0; execvp(local_3c8,&local_3c8); exit(1); } close(local_3d0); dup2(local_3cc,1); close(local_3cc); usage(*puRam00000000001014a8,0); } piVar5 = __errno_location(); error(1,*piVar5,&DAT_00101e8f); } if (*(char *)(lRam0000000000101567 + 0x43) == '\0') { if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return *puRam000000000010173d; } __stack_chk_fail(); } if ((*(long *)(lRam000000000010157a + 0x140) != 0) && (iVar3 = strcmp(*(char **)(lRam000000000010158d + 0x140),"c"), iVar3 != 0)) { iVar3 = strcmp(*(char **)(lRam000000000010161a + 0x140),"v"); if (iVar3 == 0) { local_3b8 = 0x632d736c74756e67; local_3b0 = 0x382e372e3320696c; local_3a8 = 10; fprintf(*ppFRam0000000000101666,"%s",&local_3b8); exit(0); } iVar3 = strcmp(*(char **)(lRam0000000000101695 + 0x140),"n"); if (iVar3 != 0) { error(1,0, "version option argument \'a\' invalid. Use:\n\t\'v\' - version only\n\t\'c\' - version and copyright\n\t\'n\' - version and full copyright notice" ); } puVar7 = (undefined8 *) "gnutls-cli 3.7.8\nCopyright (C) 2000-2021 Free Software Foundation, and others\nThis is free software. It is licensed for use, modification and\nredistribution under the terms of the GNU General Public License,\nversion 3 or later <http: ; puVar8 = &local_3b8; for (lVar6 = 0x73; lVar6 != 0; lVar6 = lVar6 + -1) { *puVar8 = *puVar7; puVar7 = puVar7 + (ulong)bVar9 * -2 + 1; puVar8 = puVar8 + (ulong)bVar9 * -2 + 1; } *(undefined2 *)puVar8 = *(undefined2 *)puVar7; *(undefined *)((long)puVar8 + 2) = *(undefined *)((long)puVar7 + 2); fprintf(*ppFRam00000000001016f3,"%s",&local_3b8); exit(0); } puVar7 = (undefined8 *) "gnutls-cli 3.7.8\nCopyright (C) 2000-2021 Free Software Foundation, and others\nThis is free software. It is licensed for use, modification and\nredistribution under the terms of the GNU General Public License,\nversion 3 or later <http: ; puVar8 = &local_3b8; for (lVar6 = 0x28; lVar6 != 0; lVar6 = lVar6 + -1) { *puVar8 = *puVar7; puVar7 = puVar7 + (ulong)bVar9 * -2 + 1; puVar8 = puVar8 + (ulong)bVar9 * -2 + 1; } *(undefined2 *)puVar8 = *(undefined2 *)puVar7; *(undefined *)((long)puVar8 + 2) = *(undefined *)((long)puVar7 + 2); fprintf(*ppFRam00000000001015eb,"%s",&local_3b8); exit(0); } } while( true ); }
static int netns_monitor(int argc, char **argv) { char buf[4096]; struct inotify_event *event; int fd; fd = inotify_init(); if (fd < 0) { fprintf( stderr , "inotify_init failed: %s\n", strerror( (*__errno_location ()) )); return -1; } if (create_netns_dir()) return -1; if (inotify_add_watch(fd, "/var/run/netns", 0x00000100 | 0x00000200 ) < 0) { fprintf( stderr , "inotify_add_watch failed: %s\n", strerror( (*__errno_location ()) )); return -1; } for (;;) { ssize_t len = read(fd, buf, sizeof(buf)); if (len < 0) { fprintf( stderr , "read failed: %s\n", strerror( (*__errno_location ()) )); return -1; } for (event = (struct inotify_event *)buf; (char *)event < &buf[len]; event = (struct inotify_event *)((char *)event + sizeof(*event) + event->len)) { if (event->mask & 0x00000100 ) printf("add %s\n", event->name); if (event->mask & 0x00000200 ) printf("delete %s\n", event->name); } } return 0; }
undefined8 netns_monitor(void) { int __fd; int iVar1; int *piVar2; char *pcVar3; ssize_t sVar4; long in_FS_OFFSET; undefined *local_1028; undefined local_1018 [4104]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); __fd = inotify_init(); if (__fd < 0) { piVar2 = __errno_location(); pcVar3 = strerror(*piVar2); fprintf(stderr,"inotify_init failed: %s\n",pcVar3); } else { iVar1 = create_netns_dir(); if (iVar1 == 0) { iVar1 = inotify_add_watch(__fd,"/var/run/netns",0x300); if (iVar1 < 0) { piVar2 = __errno_location(); pcVar3 = strerror(*piVar2); fprintf(stderr,"inotify_add_watch failed: %s\n",pcVar3); } else { while (sVar4 = read(__fd,local_1018,0x1000), -1 < sVar4) { for (local_1028 = local_1018; local_1028 < local_1018 + sVar4; local_1028 = local_1028 + (ulong)*(uint *)(local_1028 + 0xc) + 0x10) { if ((*(uint *)(local_1028 + 4) & 0x100) != 0) { printf("add %s\n",local_1028 + 0x10); } if ((*(uint *)(local_1028 + 4) & 0x200) != 0) { printf("delete %s\n",local_1028 + 0x10); } } } piVar2 = __errno_location(); pcVar3 = strerror(*piVar2); fprintf(stderr,"read failed: %s\n",pcVar3); } } } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return 0xffffffff; } __stack_chk_fail(); }
kwset_t kwsalloc (char const *trans) { struct kwset *kwset = xmalloc (sizeof *kwset); _obstack_begin ((&kwset->obstack), 0, 0, (xmalloc), (free)); kwset->words = 0; kwset->trie = __extension__ ({ struct obstack *__h = (&kwset->obstack); __extension__ ({ struct obstack *__o = (__h); size_t __len = ((sizeof *kwset->trie)); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < __len) _obstack_newchunk (__o, __len); ((void) ((__o)->next_free += (__len))); }); __extension__ ({ struct obstack *__o1 = (__h); void *__value = (void *) __o1->object_base; if (__o1->next_free == __value) __o1->maybe_empty_object = 1; __o1->next_free = ((sizeof (ptrdiff_t) < sizeof (void *) ? (__o1->object_base) : (char *) 0) + (((__o1->next_free) - (sizeof (ptrdiff_t) < sizeof (void *) ? (__o1->object_base) : (char *) 0) + (__o1->alignment_mask)) & ~(__o1->alignment_mask))); if ((size_t) (__o1->next_free - (char *) __o1->chunk) > (size_t) (__o1->chunk_limit - (char *) __o1->chunk)) __o1->next_free = __o1->chunk_limit; __o1->object_base = __o1->next_free; __value; }); }); kwset->trie->accepting = 0; kwset->trie->links = ((void *)0) ; kwset->trie->parent = ((void *)0) ; kwset->trie->next = ((void *)0) ; kwset->trie->fail = ((void *)0) ; kwset->trie->depth = 0; kwset->trie->shift = 0; kwset->mind = (9223372036854775807L) ; kwset->target = ((void *)0) ; kwset->trans = trans; kwset->kwsexec = acexec; return kwset; }
struct obstack * kwsalloc(struct _obstack_chunk *(*a1)(void *, long)) { struct obstack *v2; char *object_base; v2 = (struct obstack *)xmalloc(2464LL); obstack_begin(v2, 0, 0, (void *(*)(long))&xmalloc, (void (*)(void *))&free); v2[1].chunk_size = 0LL; if ( (_BYTE *)(v2->chunk_limit - v2->next_free) < (_BYTE *)&loc_3D + 3 ) obstack_newchunk(v2, 64); v2->next_free += 64; object_base = v2->object_base; if ( object_base == v2->next_free ) *((_BYTE *)v2 + 80) |= 2u; v2->next_free = (char *)((long)&v2->next_free[*(_QWORD *)&v2->alignment_mask] & ~*(_QWORD *)&v2->alignment_mask); if ( (char *)(v2->next_free - (char *)v2->chunk) > (char *)(v2->chunk_limit - (char *)v2->chunk) ) v2->next_free = v2->chunk_limit; v2->object_base = v2->next_free; v2[1].chunk = (struct _obstack_chunk *)object_base; v2[1].chunk->limit = 0LL; v2[1].chunk->prev = 0LL; *(_QWORD *)v2[1].chunk->contents = 0LL; v2[1].chunk[1].limit = 0LL; v2[1].chunk[1].prev = 0LL; *(_QWORD *)v2[1].chunk[1].contents = 0LL; v2[1].chunk[2].limit = 0LL; v2[1].object_base = (char *)0x7FFFFFFFFFFFFFFFLL; v2[27].temp.tempint = 0LL; v2[27].chunkfun = a1; *((_QWORD *)&v2[27] + 10) = acexec; return v2; }
WORD_DESC * make_word (string) const char *string; { WORD_DESC *temp; temp = make_bare_word (string); return (make_word_flags (temp, string)); }
int make_word(void* a0) { void* v0; v0 = make_bare_word(a0); return make_word_flags(v0, a0); }
static void send_handle(u_int32_t id, int handle) { u_char *string; int hlen; handle_to_string(handle, &string, &hlen); sshlog("sftp-server.c", __func__, 610, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "request %u: sent handle handle %d", id, handle); send_data_or_handle(102, id, string, hlen); free(string); }
void send_handle(unsigned long a0, unsigned long a1) { unsigned long v0; unsigned long v1; char v2; char v3; char v4; unsigned long long *v6; unsigned long long v7; handle_to_string(a1, &v3, &v2); v1 = a1; v0 = a0; sshlog("sftp-server.c", "send_handle", 0x262, 0x0, 0x5, 0x0, "request %u: sent handle handle %d"); send_data_or_handle(0x66, a0, *(&v3), *(&v2)); free(*(&v3)); v7 = *(&v4) ^ v6[5]; return; }
void _rl_move_vert (int to) { register int delta, i; if (_rl_last_v_pos == to || to > _rl_screenheight) return; if ((delta = to - _rl_last_v_pos) > 0) { for (i = 0; i < delta; i++) putc ('\n', rl_outstream); _rl_cr (); _rl_last_c_pos = 0; } else { if (_rl_term_up && *_rl_term_up) for (i = 0; i < -delta; i++) tputs (_rl_term_up, 1, _rl_output_character_function); } _rl_last_v_pos = to; }
long long _rl_move_vert(unsigned long a0) { unsigned long long v1; unsigned int v2; unsigned int v3; v1 = _rl_last_v_pos; if (a0 != _rl_last_v_pos) { v1 = _rl_screenheight; if (a0 <= _rl_screenheight) { if (a0 - _rl_last_v_pos > 0) { for (v2 = 0; v2 < a0 - _rl_last_v_pos; v2 += 1) { putc(0xa, rl_outstream); } _rl_cr(); _rl_last_c_pos = 0; } else if (_rl_term_up && *(_rl_term_up)) { for (v3 = 0; v3 < !(a0 - _rl_last_v_pos); v3 += 1) { tputs(_rl_term_up, 0x1, got._rl_output_character_function); } } v1 = a0; _rl_last_v_pos = a0; } } return v1; }
static _Bool elide_tail_lines_file (char const *filename, int fd, uintmax_t n_elide, struct stat const *st, off_t current_pos) { off_t size = st->st_size; if (presume_input_pipe || current_pos < 0 || size <= ((0 < (*st).st_blksize && (*st).st_blksize <= ((size_t)-1) / 8 + 1) ? (*st).st_blksize : 512 )) return elide_tail_lines_pipe (filename, fd, n_elide, current_pos); else { return (size <= current_pos || elide_tail_lines_seekable (filename, fd, n_elide, current_pos, size)); } }
void elide_tail_lines_file(unsigned long long a0, unsigned long a1, unsigned int a2, unsigned long long a3[8], unsigned int a4) { unsigned int v0; unsigned long v2; unsigned long long v3; unsigned long v4; *(&v0) = a3[6]; if (!presume_input_pipe && !((a4 - 0 >> 63))) { if (a3[7] <= 0 || a3[7] > 0x2000000000000000) v2 = 0x200; else v2 = a3[7]; if (v2 < *(&v0)) { if (*(&v0) <= a4 || elide_tail_lines_seekable(a0, a1, a2, a4, *(&v0))) *(&v2) = 1; else *(&v2) = 0; v4 = v2 & 1; return; } } v3 = elide_tail_lines_pipe(a0, a1, a2, a4); return; }
size_t hash_get_n_buckets_used (const Hash_table *table) { return table->n_buckets_used; }
int hash_get_n_buckets_used(struct_0 *a0) { return a0->field_18; }
static char * realpath_canon (char const *fname, int can_mode) { char *can_fname = canonicalize_filename_mode (fname, can_mode); if (logical && can_fname) { can_mode &= ~CAN_NOLINKS; char *can_fname2 = canonicalize_filename_mode (can_fname, can_mode); free (can_fname); return can_fname2; } return can_fname; }
int realpath_canon(unsigned long long a0, unsigned long a1) { unsigned int v0; void* v1; unsigned long v2; unsigned int v4; v0 = a1; v1 = canonicalize_filename_mode(a0, v0, v0); if (logical && v1) { v0 &= -5; v2 = canonicalize_filename_mode(v1, v0, v0); free(v1); v4 = v2; return v4; } v4 = v1; return v4; }
static Bool endsInBz2 ( Char* name ) { Int32 n = strlen ( name ); if (n <= 4) return ((Bool)0); return (name[n-4] == '.' && name[n-3] == 'b' && name[n-2] == 'z' && name[n-1] == '2'); }
int endsInBz2(char *a0) { unsigned int v0; unsigned int v2; v0 = strlen(a0); if (v0 <= 4) { v2 = 0; } else { if (a0[4 + v0] == 46 && a0[3 + v0] == 98 && a0[2 + v0] == 122 && a0[1 + v0] == 50) v2 = 1; if (a0[1 + v0] != 50 || a0[3 + v0] != 98 || a0[4 + v0] != 46 || a0[2 + v0] != 122) v2 = 0; } return v2; }
void argv_consume(int *argcp) { *argcp = 0; }
void argv_consume(undefined4 *param_1) { *param_1 = 0; return; }
static void gname_coder (struct tar_stat_info const *st, char const *keyword, struct xheader *xhdr, void const *data __attribute__ ((unused))) { code_string (st->gname, keyword, xhdr); }
long long gname_coder(struct_0 *a0, unsigned long long a1, unsigned long long a2, unsigned long a3) { unsigned long v0; v0 = a3; return code_string(a0->field_28, a1, a2); }
void blank_name_list (void) { struct name *name; gnu_list_name = 0; for (name = namelist; name; name = name->next) name->found_count = 0; }
long long blank_name_list() { unsigned long long v0[7]; unsigned long long v2; gnu_list_name = 0; v2 = namelist; for (v0[0] = namelist; v0; v0[0] = v0[0]) { v0[6] = 0; v2 = v0[0]; } return v2; }
void bash_history_reinit (interact) int interact; { history_expansion = (interact == 0) ? histexp_flag : 1; history_expansion_inhibited = (interact == 0) ? 1 - histexp_flag : 0; history_inhibit_expansion_function = bash_history_inhibit_expansion; remember_on_history = enable_history_list; }
long long bash_history_reinit(unsigned long a0) { unsigned int v1; unsigned int v2; if (a0) v1 = 1; else v1 = histexp_flag; history_expansion = v1; if (a0) v2 = 0; else v2 = 1 - histexp_flag; dont_save_function_defs = v2; history_inhibit_expansion_function = bash_history_inhibit_expansion; remember_on_history = enable_history_list; return enable_history_list; }
static void push_builtin_var (data) void * data; { SHELL_VAR *var; var = (SHELL_VAR *)data; push_posix_tempvar_internal (var, 1); }
long long push_builtin_var(void* a0, unsigned long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { return push_posix_tempvar_internal(a0, 0x1, a2, a3, a4, a5); }
static WORD_DESC * parameter_brace_expand_word (name, var_is_special, quoted, pflags, estatep) char *name; int var_is_special, quoted, pflags; array_eltstate_t *estatep; { WORD_DESC *ret; char *temp, *tt; intmax_t arg_index; SHELL_VAR *var; int rflags; array_eltstate_t es; ret = 0; temp = 0; rflags = 0; if (estatep) es = *estatep; else { init_eltstate (&es); es.ind = (-9223372036854775807L -1) ; } if (legal_number (name, &arg_index)) { tt = get_dollar_var_value (arg_index); if (tt) temp = (*tt && (quoted & (0x001|0x002))) ? quote_string (tt) : quote_escapes (tt); else temp = (char *) ((void *)0) ; do { if (tt) sh_xfree((tt), "subst.c", 7416); } while (0); } else if (var_is_special) { int sindex; tt = (char *)sh_xmalloc((2 + strlen (name)), "subst.c", 7421); tt[sindex = 0] = '$'; strcpy (tt + 1, name); ret = param_expand (tt, &sindex, quoted, (int *) ((void *)0) , (int *) ((void *)0) , (int *) ((void *)0) , (int *) ((void *)0) , pflags); if ((quoted & (0x001|0x002)) && ((((name)[0]) == '@' || ((name)[0]) == '*') && (name)[1] == '\0') && ret && ret->word && ((ret->word)[0] == '\177' && (ret->word)[1] == '\0')) ret->flags |= (1 << 18); sh_xfree((tt), "subst.c", 7434); } else if (valid_array_reference (name, 0)) { expand_arrayref: var = array_variable_part (name, 0, &tt, (int *)0); if (pflags & 0x08) { if (((tt[0]) == '@' || (tt[0]) == '*') && tt[1] == ']') { if (var && (((((var)->attributes) & (0x0000004))) || ((((var)->attributes) & (0x0000040))))) temp = array_value (name, quoted|0x001, 0x010, &es); else temp = array_value (name, quoted, 0, &es); } else temp = array_value (name, quoted, 0, &es); } else if (pflags & 0x04) { if (tt[0] == '@' && tt[1] == ']' && var && quoted == 0 && ifs_is_set && ifs_is_null == 0 && ifs_firstc[0] != ' ') temp = array_value (name, 0x001, 0x010, &es); else if (tt[0] == '@' && tt[1] == ']') temp = array_value (name, quoted, 0, &es); else if (tt[0] == '*' && tt[1] == ']' && expand_no_split_dollar_star && ifs_is_null) temp = array_value (name, 0x001|0x002, 0, &es); else if (tt[0] == '*' && tt[1] == ']') temp = array_value (name, quoted, 0, &es); else temp = array_value (name, quoted, 0, &es); } else if (tt[0] == '*' && tt[1] == ']' && expand_no_split_dollar_star && ifs_is_null) temp = array_value (name, 0x001|0x002, 0, &es); else temp = array_value (name, quoted, 0, &es); if (es.subtype == 0 && temp) { temp = (*temp && (quoted & (0x001|0x002))) ? quote_string (temp) : quote_escapes (temp); rflags |= (1 << 24); if (estatep) *estatep = es; } else if (es.subtype == 1 && temp && ((temp)[0] == '\177' && (temp)[1] == '\0') && (quoted & (0x001|0x002))) rflags |= (1 << 18); else if (es.subtype == 2 && temp && ((temp)[0] == '\177' && (temp)[1] == '\0') && (quoted & (0x001|0x002))) rflags |= (1 << 18); if (estatep == 0) flush_eltstate (&es); } else if (var = find_variable (name)) { if (((var)->value != 0) && ((((var)->attributes) & (0x0001000))) == 0) { tt = (char *) ((void *)0) ; if ((pflags & 0x40) && ((((var)->attributes) & (0x0000040)))) tt = temp = (((HASH_TABLE *)((var)->value))->nentries == 0) ? (char *) ((void *)0) : assoc_to_string ((HASH_TABLE *)((var)->value), " ", quoted); else if ((pflags & 0x40) && ((((var)->attributes) & (0x0000004)))) tt = temp = (((ARRAY *)((var)->value))->num_elements == 0) ? (char *) ((void *)0) : array_to_string ((ARRAY *)((var)->value), " ", quoted); else if (((((var)->attributes) & (0x0000040)))) temp = assoc_reference ((HASH_TABLE *)((var)->value), "0"); else if (((((var)->attributes) & (0x0000004)))) temp = array_reference ((ARRAY *)((var)->value), 0); else temp = ((var)->value); if (temp) temp = (*temp && (quoted & (0x001|0x002))) ? quote_string (temp) : ((pflags & 0x08) ? quote_rhs (temp) : quote_escapes (temp)); do { if (tt) sh_xfree((tt), "subst.c", 7526); } while (0); } else temp = (char *) ((void *)0) ; } else if (var = find_variable_last_nameref (name, 0)) { temp = ((var)->value); if (temp && *temp && valid_array_reference (temp, 0)) { name = temp; goto expand_arrayref; } else if (temp && *temp && legal_identifier (temp) == 0) { set_exit_status (1); report_error (gettext("%s: invalid variable name for name reference"), temp); temp = &expand_param_error; } else temp = (char *) ((void *)0) ; } else temp = (char *) ((void *)0) ; if (ret == 0) { ret = alloc_word_desc (); ret->word = temp; ret->flags |= rflags; } return ret; }
int parameter_brace_expand_word(char *a0, unsigned long a1, unsigned long a2, unsigned long long a3, unsigned long long a4[4]) { char v0[2]; unsigned int v1; unsigned int v2; void* v3; char v4; void* v5; char v6[2]; struct_0 *v7; unsigned long v8; unsigned long long v9; unsigned long v10; unsigned long v11; unsigned long long v13; void* v14; void* v17; unsigned long long v18; unsigned long long v19; unsigned long long v20; *(&v0) = a0; v5 = 0; v6 = 0; v2 = 0; if (a4) { v8 = a4[0]; v9 = a4[1]; v10 = a4[2]; v11 = a4[3]; } else { init_eltstate(&v8); v9 = 0x8000000000000000; } if (legal_number(v0, &v4, &v4)) { v3 = get_dollar_var_value(*(&v4)); if (!v3) { v6 = 0; } else { if (!*(v3) || !(a2 & 3)) v13 = quote_escapes(v3); else v13 = quote_string(v3); v6 = v13; } if (v3) sh_xfree(v3, "subst.c", 0x1cf8); } else if (a1) { v3 = sh_xmalloc(strlen(v0) + 2, "subst.c", 0x1cfd); v1 = 0; *(v3) = 36; strcpy(v3 + 1, v0); v5 = param_expand(v3, &v1, a2, 0x0, 0x0, 0x0, 0x0, a3); if ((a2 & 3)) { switch (v0[0]) { case 42: case 64: if (!v0[1] && v5 && *(v5) && *(*(v5)) == 127 && !*((*(v5) + 1))) { *(&v5[8]) = v5[8] | 0x40000; break; } default: goto LABEL_410f62; } } LABEL_410f62: sh_xfree(v3, "subst.c", 0x1d0a); } else if (valid_array_reference(v0, 0x0)) { LABEL_410f99: v7 = array_variable_part(v0, 0x0, &v3, 0x0); if ((a3 & 8)) { switch (*(v3)) { case 42: case 64: if (v3[1] != 93) { *(&v6) = array_value(v0, a2, 0x0, &v8); break; } else { if (!v7 || !(v7->field_28 & 4) && !(v7->field_28 & 64)) { *(&v6) = array_value(v0, a2, 0x0, &v8); break; } else { *(&v6) = array_value(v0, a2 | 1, 0x10, &v8); break; } } default: *(&v6) = array_value(v0, a2, 0x0, &v8); break; } } else if ((a3 & 4)) { if (!(true)) { *(&v6) = array_value(v0, 0x1, 0x10, &v8); } else if (!(*(v3) != 64 || v3[1] != 93)) { *(&v6) = array_value(v0, a2, 0x0, &v8); } else if (!(*(v3) != 42 || v3[1] != 93 || !*(&expand_no_split_dollar_star))) { *(&v6) = array_value(v0, 0x3, 0x0, &v8); } else if (*(v3) != 42 || v3[1] != 93) { *(&v6) = array_value(v0, a2, 0x0, &v8); } else { *(&v6) = array_value(v0, a2, 0x0, &v8); } } else { if (*(v3) != 42 || v3[1] != 93 || !*(&expand_no_split_dollar_star)) *(&v6) = array_value(v0, a2, 0x0, &v8); else *(&v6) = array_value(v0, 0x3, 0x0, &v8); } if (!(*((&v8 + 2)) || !v6)) { if (!v6[0] || !(a2 & 3)) v20 = quote_escapes(v6); else v20 = quote_string(v6); v6 = v20; v2 |= 0x1000000; if (a4) { a4[0] = v8; a4[1] = v9; a4[2] = v10; a4[3] = v11; } } else if (!(*((&v8 + 2)) != 1 || !v6 || v6[0] != 127 || v6[1] || !(a2 & 3))) { v2 |= 0x40000; } else if (*((&v8 + 2)) == 2 && v6 && v6[0] == 127 && !v6[1] && (a2 & 3)) { v2 |= 0x40000; } if (!a4) flush_eltstate(&v8); } else { v7 = find_variable(v0); if (!v7) { v7 = find_variable_last_nameref(v0, 0x0); if (!v7) { v6 = 0; goto LABEL_411623; } v6 = v7->field_8; if (!v6 || !v6[0] || !valid_array_reference(v6, 0x0)) { if (!v6 || !v6[0] || legal_identifier(v6)) { v6 = 0; } else { set_exit_status(0x1); v18 = gettext("%s: invalid variable name for name reference"); report_error(v18, v6, v18, a3); v6 = &expand_param_error; } } else { *(&v0) = v6; goto LABEL_410f99; } } else if (!v7->field_8 || (v7->field_28 & 0x1000)) { v6 = 0; } else { v3 = 0; if (!(!(a3 & 64) || !(v7->field_28 & 64))) { if (!v7->field_8[12]) v14 = 0; else v14 = assoc_to_string(v7->field_8, " ", a2); v6 = v14; v3 = v6; } else if (!(!(a3 & 64) || !(v7->field_28 & 4))) { if (!v7->field_8[8]) v17 = 0; else v17 = array_to_string(v7->field_8, " ", a2); v6 = v17; v3 = v6; } else if ((v7->field_28 & 64)) { *(&v6) = assoc_reference(v7->field_8, "0", &v4); } else if (!(v7->field_28 & 4)) { v6 = v7->field_8; } else { *(&v6) = array_reference(v7->field_8, 0x0, &v4); } if (v6) { if (!(!v6[0] || !(a2 & 3))) { v19 = quote_string(v6); } else if (!(a3 & 8)) { v19 = quote_escapes(v6); } else { v19 = quote_rhs(v6); } v6 = v19; } if (v3) sh_xfree(v3, "subst.c", 0x1d66); } } LABEL_411623: if (v5) return v5; v5 = alloc_word_desc(); *(v5) = v6; *(&v5[8]) = v5[8] | v2; return v5; }
static struct diff3_block * using_to_diff3_block (struct diff_block *using[2], struct diff_block *last_using[2], int low_thread, int high_thread, struct diff3_block const *last_diff3) { lin low[2], high[2]; struct diff3_block *result; struct diff_block *ptr; int d; lin i; lin lowc = ((using[low_thread])->ranges[1][0]); lin highc = ((last_using[high_thread])->ranges[1][1]); for (d = 0; d < 2; d++) if (using[d]) { low[d] = ((lowc) - (((using[d]))->ranges[(1)][0]) + (((using[d]))->ranges[(0)][0])); high[d] = ((highc) - (((last_using[d]))->ranges[(1)][1]) + (((last_using[d]))->ranges[(0)][1])); } else { low[d] = ((lowc) - (((last_diff3))->ranges[(2)][1]) + (((last_diff3))->ranges[(0 + d)][1])); high[d] = ((highc) - (((last_diff3))->ranges[(2)][1]) + (((last_diff3))->ranges[(0 + d)][1])); } result = create_diff3_block (low[0], high[0], low[1], high[1], lowc, highc); for (d = 0; d < 2; d++) for (ptr = using[d]; ptr; ptr = ((ptr)->next)) { lin result_offset = ((ptr)->ranges[1][0]) - lowc; if (!copy_stringlist (((ptr)->lines[1]), ((ptr)->lengths[1]), ((result)->lines[2]) + result_offset, ((result)->lengths[2]) + result_offset, (((ptr)->ranges[1][1]) - ((ptr)->ranges[1][0]) + 1))) return 0; } for (d = 0; d < 2; d++) { struct diff_block *u = using[d]; lin lo = low[d], hi = high[d]; for (i = 0; i + lo < (u ? ((u)->ranges[0][0]) : hi + 1); i++) { ((result)->lines[0 + d][i]) = ((result)->lines[2][i]); ((result)->lengths[0 + d][i]) = ((result)->lengths[2][i]); } for (ptr = u; ptr; ptr = ((ptr)->next)) { lin result_offset = ((ptr)->ranges[0][0]) - lo; lin linec; if (!copy_stringlist (((ptr)->lines[0]), ((ptr)->lengths[0]), ((result)->lines[0 + d]) + result_offset, ((result)->lengths[0 + d]) + result_offset, (((ptr)->ranges[0][1]) - ((ptr)->ranges[0][0]) + 1))) return 0; linec = ((ptr)->ranges[1][1]) + 1 - lowc; for (i = ((ptr)->ranges[0][1]) + 1 - lo; i < (((ptr)->next) ? ((((ptr)->next))->ranges[0][0]) : hi + 1) - lo; i++) { ((result)->lines[0 + d][i]) = ((result)->lines[2][linec]); ((result)->lengths[0 + d][i]) = ((result)->lengths[2][linec]); linec++; } } } if (!using[0]) ((result)->correspond) = DIFF_2ND; else if (!using[1]) ((result)->correspond) = DIFF_1ST; else { lin nl0 = (((result)->ranges[0][1]) - ((result)->ranges[0][0]) + 1); lin nl1 = (((result)->ranges[1][1]) - ((result)->ranges[1][0]) + 1); if (nl0 != nl1 || !compare_line_list (((result)->lines[0]), ((result)->lengths[0]), ((result)->lines[1]), ((result)->lengths[1]), nl0)) ((result)->correspond) = DIFF_ALL; else ((result)->correspond) = DIFF_3RD; } return result; }
undefined4 * using_to_diff3_block(long *param_1,long param_2,int param_3,int param_4,long param_5) { long lVar1; char cVar2; undefined4 *puVar3; long lVar4; long lVar5; long lVar6; long in_FS_OFFSET; int local_a4; long *local_a0; long local_98; long local_90; long local_38 [5]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); lVar6 = *(long *)(param_1[param_3] + 0x10); lVar4 = *(long *)(*(long *)(param_2 + (long)param_4 * 8) + 0x18); for (local_a4 = 0; local_a4 < 2; local_a4 = local_a4 + 1) { if (param_1[local_a4] == 0) { local_38[local_a4] = (lVar6 - *(long *)(param_5 + 0x30)) + *(long *)(param_5 + (long)local_a4 * 0x10 + 0x10); local_38[(long)local_a4 + 2] = (lVar4 - *(long *)(param_5 + 0x30)) + *(long *)(param_5 + (long)local_a4 * 0x10 + 0x10); } else { local_38[local_a4] = (lVar6 - *(long *)(param_1[local_a4] + 0x10)) + *(long *)param_1[local_a4]; local_38[(long)local_a4 + 2] = (lVar4 - *(long *)(*(long *)(param_2 + (long)local_a4 * 8) + 0x18)) + *(long *)(*(long *)(param_2 + (long)local_a4 * 8) + 8); } } puVar3 = (undefined4 *) create_diff3_block(local_38[0],local_38[2],local_38[1],local_38[3],lVar6,lVar4); for (local_a4 = 0; local_a4 < 2; local_a4 = local_a4 + 1) { for (local_a0 = (long *)param_1[local_a4]; local_a0 != (long *)0x0; local_a0 = *(long **)((long)local_a0 + 0x40)) { lVar4 = *(long *)((long)local_a0 + 0x10) - lVar6; cVar2 = copy_stringlist(*(undefined8 *)((long)local_a0 + 0x28), *(undefined8 *)((long)local_a0 + 0x38), lVar4 * 8 + *(long *)(puVar3 + 0x12), *(long *)(puVar3 + 0x18) + lVar4 * 8, (*(long *)((long)local_a0 + 0x18) - *(long *)((long)local_a0 + 0x10)) + 1); if (cVar2 != '\x01') { puVar3 = (undefined4 *)0x0; goto LAB_001014ac; } } } local_a4 = 0; do { if (1 < local_a4) { if (*param_1 == 0) { *puVar3 = 6; } else if (param_1[1] == 0) { *puVar3 = 5; } else { lVar6 = (*(long *)(puVar3 + 4) - *(long *)(puVar3 + 2)) + 1; if ((lVar6 == (*(long *)(puVar3 + 8) - *(long *)(puVar3 + 6)) + 1) && (cVar2 = compare_line_list(*(undefined8 *)(puVar3 + 0xe),*(undefined8 *)(puVar3 + 0x14), *(undefined8 *)(puVar3 + 0x10),*(undefined8 *)(puVar3 + 0x16), lVar6), cVar2 == '\x01')) { *puVar3 = 7; } else { *puVar3 = 4; } } LAB_001014ac: if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return puVar3; } __stack_chk_fail(); } local_a0 = (long *)param_1[local_a4]; lVar4 = local_38[local_a4]; lVar1 = local_38[(long)local_a4 + 2]; local_98 = 0; while( true ) { if (local_a0 == (long *)0x0) { lVar5 = lVar1 + 1; } else { lVar5 = *local_a0; } if (lVar5 <= local_98 + lVar4) break; *(undefined8 *)(local_98 * 8 + *(long *)(puVar3 + ((long)local_a4 + 6) * 2 + 2)) = *(undefined8 *)(*(long *)(puVar3 + 0x12) + local_98 * 8); *(undefined8 *)(local_98 * 8 + *(long *)(puVar3 + ((long)local_a4 + 10) * 2)) = *(undefined8 *)(*(long *)(puVar3 + 0x18) + local_98 * 8); local_98 = local_98 + 1; } for (; local_a0 != (long *)0x0; local_a0 = (long *)local_a0[8]) { cVar2 = copy_stringlist(local_a0[4],local_a0[6], (*local_a0 - lVar4) * 8 + *(long *)(puVar3 + ((long)local_a4 + 6) * 2 + 2), *(long *)(puVar3 + ((long)local_a4 + 10) * 2) + (*local_a0 - lVar4) * 8,(local_a0[1] - *local_a0) + 1); if (cVar2 != '\x01') { puVar3 = (undefined4 *)0x0; goto LAB_001014ac; } local_90 = (local_a0[3] + 1) - lVar6; local_98 = (local_a0[1] + 1) - lVar4; while( true ) { if (local_a0[8] == 0) { lVar5 = lVar1 + 1; } else { lVar5 = *(long *)local_a0[8]; } if (lVar5 - lVar4 <= local_98) break; *(undefined8 *)(local_98 * 8 + *(long *)(puVar3 + ((long)local_a4 + 6) * 2 + 2)) = *(undefined8 *)(*(long *)(puVar3 + 0x12) + local_90 * 8); *(undefined8 *)(local_98 * 8 + *(long *)(puVar3 + ((long)local_a4 + 10) * 2)) = *(undefined8 *)(*(long *)(puVar3 + 0x18) + local_90 * 8); local_90 = local_90 + 1; local_98 = local_98 + 1; } } local_a4 = local_a4 + 1; } while( true ); }
static int errnoize (int status) { return status < 0 ? (*__errno_location ()) : 0; }
void errnoize(unsigned long a0) { void* v1; unsigned long long v2; if (a0 >= 0) v1 = 0; else v2 = *(__errno_location()); return; }
static int client_input_channel_open(int type, u_int32_t seq, struct ssh *ssh) { Channel *c = ((void *)0) ; char *ctype = ((void *)0) ; int r; u_int rchan; size_t len; u_int rmaxpack, rwindow; if ((r = sshpkt_get_cstring(ssh, &ctype, &len)) != 0 || (r = sshpkt_get_u32(ssh, &rchan)) != 0 || (r = sshpkt_get_u32(ssh, &rwindow)) != 0 || (r = sshpkt_get_u32(ssh, &rmaxpack)) != 0) goto out; sshlog("clientloop.c", __func__, 1679, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "client_input_channel_open: ctype %s rchan %d win %d max %d", ctype, rchan, rwindow, rmaxpack) ; if (strcmp(ctype, "forwarded-tcpip") == 0) { c = client_request_forwarded_tcpip(ssh, ctype, rchan, rwindow, rmaxpack); } else if (strcmp(ctype, "forwarded-streamlocal@openssh.com") == 0) { c = client_request_forwarded_streamlocal(ssh, ctype, rchan); } else if (strcmp(ctype, "x11") == 0) { c = client_request_x11(ssh, ctype, rchan); } else if (strcmp(ctype, "auth-agent@openssh.com") == 0) { c = client_request_agent(ssh, ctype, rchan); } if (c != ((void *)0) && c->type == 16) { sshlog("clientloop.c", __func__, 1693, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "proxied to downstream: %s", ctype); } else if (c != ((void *)0) ) { sshlog("clientloop.c", __func__, 1695, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "confirm %s", ctype); c->remote_id = rchan; c->have_remote_id = 1; c->remote_window = rwindow; c->remote_maxpacket = rmaxpack; if (c->type != 12) { if ((r = sshpkt_start(ssh, 91)) != 0 || (r = sshpkt_put_u32(ssh, c->remote_id)) != 0 || (r = sshpkt_put_u32(ssh, c->self)) != 0 || (r = sshpkt_put_u32(ssh, c->local_window)) != 0 || (r = sshpkt_put_u32(ssh, c->local_maxpacket)) != 0 || (r = sshpkt_send(ssh)) != 0) sshpkt_fatal(ssh, r, "%s: send reply", __func__); } } else { sshlog("clientloop.c", __func__, 1710, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "failure %s", ctype); if ((r = sshpkt_start(ssh, 92)) != 0 || (r = sshpkt_put_u32(ssh, rchan)) != 0 || (r = sshpkt_put_u32(ssh, 1)) != 0 || (r = sshpkt_put_cstring(ssh, "open failed")) != 0 || (r = sshpkt_put_cstring(ssh, "")) != 0 || (r = sshpkt_send(ssh)) != 0) sshpkt_fatal(ssh, r, "%s: send failure", __func__); } r = 0; out: free(ctype); return r; }
int client_input_channel_open(undefined8 param_1,undefined4 param_2,undefined8 param_3) { int iVar1; long in_FS_OFFSET; undefined8 uVar2; int local_38; int local_34; int local_30; int local_2c; char *local_28; undefined local_20 [8]; int *local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_18 = (int *)0x0; local_28 = (char *)0x0; local_2c = sshpkt_get_cstring(param_3,&local_28,local_20); if (local_2c != 0) goto LAB_00104eb3; local_2c = sshpkt_get_u32(param_3,&local_38); if (local_2c != 0) goto LAB_00104eb3; local_2c = sshpkt_get_u32(param_3,&local_30); if (local_2c != 0) goto LAB_00104eb3; uVar2 = 0x104ab7; local_2c = sshpkt_get_u32(param_3); if (local_2c != 0) goto LAB_00104eb3; sshlog("clientloop.c","client_input_channel_open",0x68f,0,5,0, "client_input_channel_open: ctype %s rchan %d win %d max %d",local_28,local_38,local_30, local_34,uVar2,param_3,param_2); iVar1 = strcmp(local_28,"forwarded-tcpip"); if (iVar1 == 0) { local_18 = (int *)client_request_forwarded_tcpip(param_3,local_28,local_38,local_30,local_34); } else { iVar1 = strcmp(local_28,"forwarded-streamlocal@openssh.com"); if (iVar1 == 0) { local_18 = (int *)client_request_forwarded_streamlocal(param_3,local_28,local_38); } else { iVar1 = strcmp(local_28,"x11"); if (iVar1 == 0) { local_18 = (int *)client_request_x11(param_3,local_28,local_38); } else { iVar1 = strcmp(local_28,"auth-agent@openssh.com"); if (iVar1 == 0) { local_18 = (int *)client_request_agent(param_3,local_28,local_38); } } } } if ((local_18 == (int *)0x0) || (*local_18 != 0x10)) { if (local_18 != (int *)0x0) { sshlog("clientloop.c","client_input_channel_open",0x69f,0,5,0,"confirm %s",local_28); local_18[2] = local_38; local_18[3] = 1; local_18[0x2a] = local_30; local_18[0x2b] = local_34; if (*local_18 == 0xc) goto LAB_00104ea9; local_2c = sshpkt_start(param_3,0x5b); if (local_2c == 0) { local_2c = sshpkt_put_u32(param_3,local_18[2]); if (local_2c == 0) { local_2c = sshpkt_put_u32(param_3,local_18[1]); if (local_2c == 0) { local_2c = sshpkt_put_u32(param_3,local_18[0x2c]); if (local_2c == 0) { local_2c = sshpkt_put_u32(param_3,local_18[0x2f]); if (local_2c == 0) { local_2c = sshpkt_send(param_3); if (local_2c == 0) goto LAB_00104ea9; } } } } } sshpkt_fatal(param_3,local_2c,"%s: send reply","client_input_channel_open"); } sshlog("clientloop.c","client_input_channel_open",0x6ae,0,5,0,"failure %s",local_28); local_2c = sshpkt_start(param_3,0x5c); if (local_2c == 0) { local_2c = sshpkt_put_u32(param_3,local_38); if (local_2c == 0) { local_2c = sshpkt_put_u32(param_3,1); if (local_2c == 0) { local_2c = sshpkt_put_cstring(param_3,"open failed"); if (local_2c == 0) { local_2c = sshpkt_put_cstring(param_3,&DAT_00108c6c); if (local_2c == 0) { local_2c = sshpkt_send(param_3); if (local_2c == 0) goto LAB_00104ea9; } } } } } sshpkt_fatal(param_3,local_2c,"%s: send failure","client_input_channel_open"); } else { sshlog("clientloop.c","client_input_channel_open",0x69d,0,7,0,"proxied to downstream: %s", local_28); } LAB_00104ea9: local_2c = 0; LAB_00104eb3: free(local_28); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return local_2c; }
int assertverprovides(const char *const *argv) { struct dpkg_version version = { 0, "1.17.11", ((void *)0) }; return assert_version_support(argv, &version, gettext("versioned Provides")); }
long long assertverprovides(unsigned long long *a0) { unsigned int v0; unsigned long long v1; void* v2; v0 = 0; v1 = "1.17.11"; v2 = 0; return assert_version_support(a0, &v0, gettext("versioned Provides")); }
int _rl_disable_tty_signals (void) { if (tty_sigs_disabled) return 0; if (_get_tty_settings (fileno (rl_instream), &sigstty) < 0) return -1; nosigstty = sigstty; nosigstty.c_lflag &= ~ 0000001 ; nosigstty.c_iflag &= ~ 0002000 ; if (_set_tty_settings (fileno (rl_instream), &nosigstty) < 0) return (_set_tty_settings (fileno (rl_instream), &sigstty)); tty_sigs_disabled = 1; return 0; }
long long _rl_disable_tty_signals() { int tmp_59; unsigned long long v1; unsigned long long v2; if (tty_sigs_disabled) { v1 = 0; } else if (_get_tty_settings(fileno(rl_instream), &sigstty) < 0) { v1 = 4294967295; } else { *(&nosigstty) = sigstty; g_400ec8 = g_400e88; g_400ed0 = g_400e90; g_400ed8 = g_400e98; g_400ee0 = g_400ea0; g_400ee8 = g_400ea8; g_400ef0 = g_400eb0; g_400ef8 = g_400eb8; g_400ecc = g_400ecc & -2; v2 = *(&nosigstty); *(&v2) = (*(&nosigstty) >> 8) & 251; tmp_59 = v2; *(&nosigstty) = tmp_59; if (_set_tty_settings(fileno(rl_instream), &nosigstty) >= 0) { tty_sigs_disabled = 1; v1 = 0; } else { v1 = _set_tty_settings(fileno(rl_instream), &sigstty); } } return v1; }
void rsyslogdDoDie(int sig) { static int iRetries = 0; r_dbgprintf("rsyslogd.c", "DoDie called.\n"); if(Debug == 2) { if(write(1, "DoDie called.\n", sizeof("DoDie called.\n") - 1) == -1) { r_dbgprintf("rsyslogd.c", "%s:%d: write failed\n", "rsyslogd.c", 1822); } } if(iRetries++ == 4) { if(Debug == 2) { if(write(1, "DoDie called 5 times - unconditional exit\n", sizeof("DoDie called 5 times - unconditional exit\n") - 1) == -1) { r_dbgprintf("rsyslogd.c", "%s:%d: write failed\n", "rsyslogd.c", 1828); } } abort(); } bFinished = sig; if(runConf->globals.debugOnShutdown) { debugging_on = 0; rsyslogdDebugSwitch(); } r_dbgprintf("rsyslogd.c", "awaking mainthread\n"); pthread_kill(mainthread, 21 ); }
long long rsyslogdDoDie(unsigned long a0, unsigned long a1, unsigned long long a2) { unsigned long long v1; r_dbgprintf("rsyslogd.c", "DoDie called.\n", a2); if (Debug == 2 && write(0x1, "DoDie called.\n", 0xe) == -1) r_dbgprintf("rsyslogd.c", "%s:%d: write failed\n", "rsyslogd.c"); v1 = iRetries.10713; iRetries.10713 = iRetries.10713 + 1; if (v1 != 4) { bFinished = a0; if (*((runConf + 112))) { debugging_on = 0; rsyslogdDebugSwitch(); } r_dbgprintf("rsyslogd.c", "awaking mainthread\n", v1 + 1); return pthread_kill(mainthread, 0x15); } else { if (Debug == 2 && write(0x1, "DoDie called 5 times - unconditional exit\n", 0x2a) == -1) r_dbgprintf("rsyslogd.c", "%s:%d: write failed\n", "rsyslogd.c"); abort(); } }