input
stringlengths 28
169k
| output
stringlengths 20
317k
|
|---|---|
static void fillbuf(n)
int n;
{
bitbuf <<= n;
while (n > bitcount) {
bitbuf |= subbitbuf << (n -= bitcount);
subbitbuf = (unsigned)(inptr < insize ? inbuf[inptr++] : fill_inbuf(1));
if ((int)subbitbuf ==
(-1)
) subbitbuf = 0;
bitcount = 8;
}
bitbuf |= subbitbuf >> (bitcount -= n);
}
|
void fillbuf(unsigned long a0) {
unsigned int v0;
unsigned long v2;
unsigned long long v3;
v0 = a0;
for (bitbuf = bitbuf << (v0 & 31); v0 > bitcount; bitcount = 8) {
v0 -= bitcount;
bitbuf = bitbuf | (subbitbuf << (v0 & 31));
if (inptr < insize) {
inptr = inptr + 1;
v2 = *(inptr + &inbuf);
} else {
v2 = fill_inbuf(0x1);
}
subbitbuf = v2;
if (subbitbuf == -1)
subbitbuf = 0;
}
bitcount = bitcount - v0;
v3 = bitbuf | (subbitbuf >> (bitcount & 31));
bitbuf = bitbuf | (subbitbuf >> (bitcount & 31));
return;
}
|
static int
ipstats_enable_recursively(const struct ipstats_stat_desc *desc,
struct ipstats_stat_enabled *enabled,
const struct ipstats_sel *sel)
{
_Bool
found =
0
;
size_t i;
int err;
if (desc->kind == IPSTATS_STAT_DESC_KIND_LEAF) {
struct ipstats_stat_enabled_one en[] = {{
.desc = desc,
.sel = *sel,
}};
return ipstats_add_enabled(en, (sizeof(en) / sizeof((en)[0])), enabled);
}
for (i = 0; i < desc->nsubs; i++) {
struct ipstats_sel subsel = *sel;
ipstats_select_push(&subsel, desc->subs[i]->name);
err = ipstats_enable_recursively(desc->subs[i], enabled,
&subsel);
if (err == -
2
)
continue;
if (err != 0)
return err;
found =
1
;
}
return found ? 0 : -
2
;
}
|
int ipstats_enable_recursively(struct_0 *a0, void* a1, unsigned long long a2[3]) {
char v0;
unsigned int v1;
void* v2;
struct_0 *v3;
unsigned long v4;
unsigned long v5;
unsigned long v6;
unsigned int v8;
v0 = 0;
if (!a0->field_8) {
v3 = a0;
v4 = a2[0];
v5 = a2[1];
v6 = a2[2];
v8 = ipstats_add_enabled(&v3, 0x1, a1);
} else {
v2 = 0;
while (true) {
if (v2 < a0->field_18) {
v3 = a2[0];
v4 = a2[1];
v5 = a2[2];
ipstats_select_push(&v3, *(*((a0->field_10 + v2 * 8))));
v1 = ipstats_enable_recursively(*((a0->field_10 + v2 * 8)), a1, &v3);
if (v1 != -2) {
if (!v1) {
v0 = 1;
} else {
v8 = v1;
break;
}
}
v2 += 1;
} else if (!v0) {
v8 = -2;
break;
} else {
v8 = 0;
break;
}
}
}
return v8;
}
|
static
_Bool
gl_linked_remove (gl_list_t list, const void *elt)
{
gl_list_node_t node = gl_linked_search_from_to (list, 0, list->count, elt);
if (node !=
((void *)0)
)
return gl_linked_remove_node (list, node);
else
return
0
;
}
|
long long gl_linked_remove(struct_0 *a0, unsigned long long a1) {
void* v0;
void* v2;
v0 = gl_linked_search_from_to(a0, 0x0, a0->field_40, a1);
if (!v0) {
v2 = 0;
return v2;
}
v2 = gl_linked_remove_node(a0, v0);
return v2;
}
|
int inflateSetDictionary(strm, dictionary, dictLength)
z_streamp strm;
const Bytef *dictionary;
uInt dictLength;
{
struct inflate_state *state;
unsigned long dictid;
int ret;
if (inflateStateCheck(strm)) return (-2);
state = (struct inflate_state *)strm->state;
if (state->wrap != 0 && state->mode != DICT)
return (-2);
if (state->mode == DICT) {
dictid = adler32(0L, 0, 0);
dictid = adler32(dictid, dictionary, dictLength);
if (dictid != state->check)
return (-3);
}
ret = updatewindow(strm, dictionary + dictLength, dictLength);
if (ret) {
state->mode = MEM;
return (-4);
}
state->havedict = 1;
;
return 0;
}
|
undefined8 inflateSetDictionary(long param_1,long param_2,uint param_3)
{
long lVar1;
int iVar2;
undefined8 uVar3;
long lVar4;
iVar2 = inflateStateCheck(param_1);
if (iVar2 == 0) {
lVar1 = *(long *)(param_1 + 0x38);
if ((*(int *)(lVar1 + 0x10) == 0) || (*(int *)(lVar1 + 8) == 0x3f3e)) {
if (*(int *)(lVar1 + 8) == 0x3f3e) {
uVar3 = adler32(0,0,0);
lVar4 = adler32(uVar3,param_2,param_3);
if (lVar4 != *(long *)(lVar1 + 0x20)) {
return 0xfffffffd;
}
}
iVar2 = updatewindow(param_1,(ulong)param_3 + param_2,param_3);
if (iVar2 == 0) {
*(undefined4 *)(lVar1 + 0x14) = 1;
uVar3 = 0;
}
else {
*(undefined4 *)(lVar1 + 8) = 0x3f52;
uVar3 = 0xfffffffc;
}
}
else {
uVar3 = 0xfffffffe;
}
}
else {
uVar3 = 0xfffffffe;
}
return uVar3;
}
|
static int print_spdinfo(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
__u32 *f = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
struct rtattr *tb[(__XFRMA_SPD_MAX - 1)+1];
struct rtattr *rta;
int len = n->nlmsg_len;
len -= ((sizeof(__u32)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )));
if (len < 0) {
fprintf(
stderr
, "SPDinfo: Wrong len %d\n", len);
return -1;
}
rta = ((struct rtattr*)(((char*)(f)) + ( ((sizeof(__u32))+4U -1) & ~(4U -1) )));
parse_rtattr(tb, (__XFRMA_SPD_MAX - 1), rta, len);
fprintf(fp, "\t SPD");
if (tb[XFRMA_SPD_INFO]) {
struct xfrmu_spdinfo *si;
if (((int)((tb[XFRMA_SPD_INFO])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) < sizeof(*si)) {
fprintf(
stderr
, "SPDinfo: Wrong len %d\n", len);
return -1;
}
si = ((void*)(((char*)(tb[XFRMA_SPD_INFO])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
fprintf(fp, " IN %d", si->incnt);
fprintf(fp, " OUT %d", si->outcnt);
fprintf(fp, " FWD %d", si->fwdcnt);
if (show_stats) {
fprintf(fp, " (Sock:");
fprintf(fp, " IN %d", si->inscnt);
fprintf(fp, " OUT %d", si->outscnt);
fprintf(fp, " FWD %d", si->fwdscnt);
fprintf(fp, ")");
}
fprintf(fp, "%s", _SL_);
}
if (show_stats > 1) {
struct xfrmu_spdhinfo *sh;
if (tb[XFRMA_SPD_HINFO]) {
if (((int)((tb[XFRMA_SPD_HINFO])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) < sizeof(*sh)) {
fprintf(
stderr
, "SPDinfo: Wrong len %d\n", len);
return -1;
}
sh = ((void*)(((char*)(tb[XFRMA_SPD_HINFO])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
fprintf(fp, "\t SPD buckets:");
fprintf(fp, " count %d", sh->spdhcnt);
fprintf(fp, " Max %d", sh->spdhmcnt);
fprintf(fp, "%s", _SL_);
}
if (tb[XFRMA_SPD_IPV4_HTHRESH]) {
struct xfrmu_spdhthresh *th;
if (((int)((tb[XFRMA_SPD_IPV4_HTHRESH])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) < sizeof(*th)) {
fprintf(
stderr
, "SPDinfo: Wrong len %d\n", len);
return -1;
}
th = ((void*)(((char*)(tb[XFRMA_SPD_IPV4_HTHRESH])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
fprintf(fp, "\t SPD IPv4 thresholds:");
fprintf(fp, " local %d", th->lbits);
fprintf(fp, " remote %d", th->rbits);
fprintf(fp, "%s", _SL_);
}
if (tb[XFRMA_SPD_IPV6_HTHRESH]) {
struct xfrmu_spdhthresh *th;
if (((int)((tb[XFRMA_SPD_IPV6_HTHRESH])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) < sizeof(*th)) {
fprintf(
stderr
, "SPDinfo: Wrong len %d\n", len);
return -1;
}
th = ((void*)(((char*)(tb[XFRMA_SPD_IPV6_HTHRESH])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
fprintf(fp, "\t SPD IPv6 thresholds:");
fprintf(fp, " local %d", th->lbits);
fprintf(fp, " remote %d", th->rbits);
fprintf(fp, "%s", _SL_);
}
}
if (oneline)
fprintf(fp, "\n");
return 0;
}
|
long print_spdinfo(_DWORD *a1, FILE *a2)
{
unsigned int v3;
unsigned int *v4;
unsigned int *v5;
unsigned char *v6;
unsigned char *v7;
char v8[8];
unsigned short *v9;
unsigned short *v10;
unsigned short *v11;
unsigned short *v12;
unsigned long v13;
v13 = __readfsqword(0x28u);
v3 = *a1 - 20;
if ( (v3 & 0x80000000) != 0 )
{
fprintf(stderr, "SPDinfo: Wrong len %d\n", v3);
return 0xFFFFFFFFLL;
}
parse_rtattr(v8, 4LL, a1 + 5, v3);
fprintf(a2, "\t SPD");
if ( v9 )
{
if ( (unsigned long)*v9 - 4 <= 0x17 )
goto LABEL_18;
v4 = (unsigned int *)(v9 + 2);
fprintf(a2, " IN %d", *((unsigned int *)v9 + 1));
fprintf(a2, " OUT %d", v4[1]);
fprintf(a2, " FWD %d", v4[2]);
if ( show_stats )
{
fprintf(a2, " (Sock:");
fprintf(a2, " IN %d", v4[3]);
fprintf(a2, " OUT %d", v4[4]);
fprintf(a2, " FWD %d", v4[5]);
fprintf(a2, ")");
}
fprintf(a2, "%s", SL_);
}
if ( show_stats > 1 )
{
if ( v10 )
{
if ( (unsigned long)*v10 - 4 <= 7 )
goto LABEL_18;
v5 = (unsigned int *)(v10 + 2);
fprintf(a2, "\t SPD buckets:");
fprintf(a2, " count %d", *v5);
fprintf(a2, " Max %d", v5[1]);
fprintf(a2, "%s", SL_);
}
if ( v11 )
{
if ( (unsigned long)*v11 - 4 <= 1 )
{
LABEL_18:
fprintf(stderr, "SPDinfo: Wrong len %d\n", v3);
return 0xFFFFFFFFLL;
}
v6 = (unsigned char *)(v11 + 2);
fprintf(a2, "\t SPD IPv4 thresholds:");
fprintf(a2, " local %d", *v6);
fprintf(a2, " remote %d", v6[1]);
fprintf(a2, "%s", SL_);
}
if ( v12 )
{
if ( (unsigned long)*v12 - 4 <= 1 )
goto LABEL_18;
v7 = (unsigned char *)(v12 + 2);
fprintf(a2, "\t SPD IPv6 thresholds:");
fprintf(a2, " local %d", *v7);
fprintf(a2, " remote %d", v7[1]);
fprintf(a2, "%s", SL_);
}
}
if ( oneline )
fprintf(a2, "\n");
return 0LL;
}
|
static void
send_statvfs(u_int32_t id, struct statvfs *st)
{
struct sshbuf *msg;
u_int64_t flag;
int r;
flag = (st->f_flag &
ST_RDONLY
) ? 0x00000001 : 0;
flag |= (st->f_flag &
ST_NOSUID
) ? 0x00000002 : 0;
if ((msg = sshbuf_new()) ==
((void *)0)
)
sshfatal("sftp-server.c", __func__, 666, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new failed");
if ((r = sshbuf_put_u8(msg, 201)) != 0 ||
(r = sshbuf_put_u32(msg, id)) != 0 ||
(r = sshbuf_put_u64(msg, st->f_bsize)) != 0 ||
(r = sshbuf_put_u64(msg, st->f_frsize)) != 0 ||
(r = sshbuf_put_u64(msg, st->f_blocks)) != 0 ||
(r = sshbuf_put_u64(msg, st->f_bfree)) != 0 ||
(r = sshbuf_put_u64(msg, st->f_bavail)) != 0 ||
(r = sshbuf_put_u64(msg, st->f_files)) != 0 ||
(r = sshbuf_put_u64(msg, st->f_ffree)) != 0 ||
(r = sshbuf_put_u64(msg, st->f_favail)) != 0 ||
(r = sshbuf_put_u64(msg, ((st->f_fsid)))) != 0 ||
(r = sshbuf_put_u64(msg, flag)) != 0 ||
(r = sshbuf_put_u64(msg, st->f_namemax)) != 0)
sshfatal("sftp-server.c", __func__, 680, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose");
send_msg(msg);
sshbuf_free(msg);
}
|
void send_statvfs(unsigned long a0, unsigned long long a1[11]) {
unsigned long long v0;
unsigned int v1;
unsigned long long v2;
unsigned long long v3;
unsigned long long v5;
v2 = a1[9] & 1;
v2 |= a1[9] & 2;
v3 = sshbuf_new();
if (!v3) {
v0 = "sshbuf_new failed";
sshfatal("sftp-server.c", "send_statvfs", 0x29a, 0x1, 0x1, 0x0);
}
v1 = sshbuf_put_u8(v3, 0xc9);
if (!v1) {
v1 = sshbuf_put_u32(v3, a0, a0);
if (!v1) {
v1 = sshbuf_put_u64(v3, a1[0], a1[0]);
if (!v1) {
v1 = sshbuf_put_u64(v3, a1[1], a1[1]);
if (!v1) {
v1 = sshbuf_put_u64(v3, a1[2], a1[2]);
if (!v1) {
v1 = sshbuf_put_u64(v3, a1[3], a1[3]);
if (!v1) {
v1 = sshbuf_put_u64(v3, a1[4], a1[4]);
if (!v1) {
v1 = sshbuf_put_u64(v3, a1[5], a1[5]);
if (!v1) {
v1 = sshbuf_put_u64(v3, a1[6], a1[6]);
if (!v1) {
v1 = sshbuf_put_u64(v3, a1[7], a1[7]);
if (!v1) {
v1 = sshbuf_put_u64(v3, a1[8], a1[8]);
if (!v1) {
v1 = sshbuf_put_u64(v3, v2, v2);
if (!v1) {
v1 = sshbuf_put_u64(v3, a1[10], a1[10]);
if (!v1)
goto LABEL_401a58;
}
}
}
}
}
}
}
}
}
}
}
}
v3 = "compose";
sshfatal("sftp-server.c", "send_statvfs", 0x2a8, 0x1, 0x1, ssh_err(v1));
LABEL_401a58:
send_msg(v3);
v5 = sshbuf_free(v3);
return;
}
|
static void
format_address_none (__attribute__ ((__unused__)) uintmax_t address,
__attribute__ ((__unused__)) char c)
{
}
|
void format_address_none(void)
{
return;
}
|
static int set_othername_octet(int type, void *crt)
{
int ret = 0, i;
const char *oid;
if (batch) {
if (!cfg.other_name_octet)
return 0;
for (i = 0; cfg.other_name_octet[i] !=
((void *)0)
; i += 2) {
oid = cfg.other_name_octet[i];
if (cfg.other_name_octet[i + 1] ==
((void *)0)
) {
fprintf(
stderr
,
"other_name_octet: %s does not have an argument.\n",
cfg.other_name_octet[i]);
exit(1);
}
if (type == 1)
ret =
gnutls_x509_crt_set_subject_alt_othername
(crt, oid,
cfg.other_name_octet[i + 1], strlen(cfg.other_name_octet[i + 1]),
1|(1<<1));
else
ret =
gnutls_x509_crq_set_subject_alt_othername
(crt, oid,
cfg.other_name_octet[i + 1], strlen(cfg.other_name_octet[i + 1]),
1|(1<<1));
if (ret < 0)
break;
}
}
if (ret < 0) {
fprintf(
stderr
, "set_subject_alt_othername: %s\n",
gnutls_strerror(ret));
exit(1);
}
return ret;
}
|
void set_othername_octet(unsigned long a0, unsigned long long a1) {
unsigned int v0;
unsigned int v1;
unsigned long long v2;
void* v4;
unsigned long long v5;
v0 = 0;
if (*(got.batch)) {
if (!*((got.cfg + 368))) {
v4 = 0;
} else {
for (v1 = 0; *((*((got.cfg + 368)) + (v1 << 3))); v1 += 2) {
v2 = *((*((got.cfg + 368)) + v1 * 8));
if (!*((*((got.cfg + 368)) + (v1 + 1 << 3)))) {
fprintf(*(*(&got.stderr)), "other_name_octet: %s does not have an argument.\n", *((*((got.cfg + 368)) + v1 * 8)));
exit(0x1);
}
if (a0 == 1)
v0 = gnutls_x509_crt_set_subject_alt_othername(a1, v2, *((*((got.cfg + 368)) + (v1 + 1) * 8)), strlen(*((*((got.cfg + 368)) + (v1 + 1) * 8))), 0x3);
else
v0 = gnutls_x509_crq_set_subject_alt_othername(a1, v2, *((*((got.cfg + 368)) + (v1 + 1) * 8)), strlen(*((*((got.cfg + 368)) + (v1 + 1) * 8))), 0x3);
if (v0 < 0)
break;
}
}
}
if (!*(got.batch) || *((got.cfg + 368))) {
if (v0 < 0) {
fprintf(*(*(&got.stderr)), "set_subject_alt_othername: %s\n", gnutls_strerror(v0));
exit(0x1);
}
v5 = v0;
}
if (v0 >= 0 || !*((got.cfg + 368)) && *(got.batch))
return;
}
|
static void
set_use_compress_program_option (const char *string, struct option_locus *loc)
{
struct option_locus *p = optloc_save (OC_COMPRESS, loc);
if (use_compress_program_option
&& strcmp (use_compress_program_option, string) != 0
&& p->source == OPTS_COMMAND_LINE)
do { if (error_hook) error_hook (); error (0, 0, gettext ("Conflicting compression options")); usage (2); } while (0);
use_compress_program_option = string;
}
|
void set_use_compress_program_option(char *param_1,undefined8 param_2)
{
int iVar1;
int *piVar2;
undefined8 uVar3;
piVar2 = (int *)optloc_save(0,param_2);
if (use_compress_program_option != (char *)0x0) {
iVar1 = strcmp(use_compress_program_option,param_1);
if ((iVar1 != 0) && (*piVar2 == 1)) {
if (error_hook != (code *)0x0) {
(*error_hook)();
}
uVar3 = gettext("Conflicting compression options");
error(0,0,uVar3);
usage(2);
}
}
use_compress_program_option = param_1;
return;
}
|
int e2fsck_reconnect_file(e2fsck_t ctx, ext2_ino_t ino)
{
ext2_filsys fs = ctx->fs;
errcode_t retval;
char name[80];
struct problem_context pctx;
struct ext2_inode inode;
int file_type = 0;
clear_problem_context(&pctx);
pctx.ino = ino;
if (!ctx->bad_lost_and_found && !ctx->lost_and_found) {
if (e2fsck_get_lost_and_found(ctx, 1) == 0)
ctx->bad_lost_and_found++;
}
if (ctx->bad_lost_and_found) {
fix_problem(ctx, 0x030006, &pctx);
return 1;
}
sprintf(name, "#%u", ino);
if (ext2fs_read_inode(fs, ino, &inode) == 0)
file_type = ext2_file_type(inode.i_mode);
retval = ext2fs_link(fs, ctx->lost_and_found, name, ino, file_type);
if (retval == (2133571366L)) {
if (!fix_problem(ctx, 0x030002, &pctx))
return 1;
retval = e2fsck_expand_directory(ctx, ctx->lost_and_found,
1, 0);
if (retval) {
pctx.errcode = retval;
fix_problem(ctx, 0x030007, &pctx);
return 1;
}
retval = ext2fs_link(fs, ctx->lost_and_found, name,
ino, file_type);
}
if (retval) {
pctx.errcode = retval;
fix_problem(ctx, 0x030008, &pctx);
return 1;
}
e2fsck_adjust_inode_count(ctx, ino, 1);
return 0;
}
|
int e2fsck_reconnect_file(struct_0 *a0, unsigned long a1) {
unsigned int v0;
unsigned long v1;
unsigned long long v2;
unsigned long v3;
unsigned int v4;
char v5;
char v6;
unsigned int v8;
v2 = a0->field_0;
v0 = 0;
clear_problem_context(&v3);
v4 = a1;
if (!a0->field_22c && !a0->field_228 && !e2fsck_get_lost_and_found(a0, 0x1))
a0->field_22c = a0->field_22c + 1;
if (a0->field_22c) {
fix_problem(a0, 0x30006, &v3);
v8 = 1;
return v8;
}
sprintf(&v6, "#%u", a1);
if (!ext2fs_read_inode(v2, a1, &v5, a1))
v0 = ext2_file_type(*(&v5));
v1 = ext2fs_link(v2, a0->field_228, &v6, a1, v0);
if (v1 == 2133571366) {
if (!fix_problem(a0, 0x30002, &v3)) {
v8 = 1;
return v8;
}
v1 = e2fsck_expand_directory(a0, a0->field_228, 0x1, 0x0);
if (v1) {
v3 = v1;
fix_problem(a0, 0x30007, &v3);
v8 = 1;
return v8;
}
v1 = ext2fs_link(v2, a0->field_228, &v6, a1, v0);
}
if (v1) {
v3 = v1;
fix_problem(a0, 0x30008, &v3);
v8 = 1;
return v8;
}
e2fsck_adjust_inode_count(a0, a1, 0x1);
v8 = 0;
return v8;
}
|
char *
getenv (name)
const char *name;
{
SHELL_VAR *var;
if (name == 0 || *name == '\0')
return ((char *)
((void *)0)
);
var = find_tempenv_variable ((char *)name);
if (var)
{
do { if (last_tempenv_value) sh_xfree((last_tempenv_value), "getenv.c", 61); } while (0);
last_tempenv_value = ((var)->value) ? (char *)strcpy (sh_xmalloc((1 + strlen (((var)->value))), "getenv.c", 63), (((var)->value))) : (char *)
((void *)0)
;
return (last_tempenv_value);
}
else if (shell_variables)
{
var = find_variable ((char *)name);
if (var && ((((var)->attributes) & (0x0000001))))
return (((var)->value));
}
else if (environ)
{
register int i, len;
for (i = 0, len = strlen (name); environ[i]; i++)
{
if ((((len == 0) ? (1) : ((environ[i])[0] == (name)[0] && strncmp(environ[i], name, len) == 0))) && (environ[i][len] == '='))
return (environ[i] + len + 1);
}
}
return ((char *)
((void *)0)
);
}
|
void getenv(char *a0) {
struct_1 *v0;
void* v2;
void* v3;
char *v4;
unsigned long long v5;
void* v6;
unsigned long long v7;
void* v8;
unsigned long long *v9;
if (a0 && *(a0)) {
v0 = find_tempenv_variable(a0);
if (v0) {
if (last_tempenv_value)
sh_xfree(last_tempenv_value, "getenv.c", 0x3d);
if (!v0->field_8)
v8 = 0;
else
v8 = strcpy(sh_xmalloc(strlen(v0->field_8) + 1, "getenv.c", 0x3f), v0->field_8);
last_tempenv_value = v8;
v9 = last_tempenv_value;
return;
} else {
if (shell_variables) {
v0 = find_variable(a0);
if (v0 && (v0->field_28 & 1)) {
v5 = v0->field_8;
return;
}
} else if (environ) {
v3 = 0;
for (v4 = strlen(a0); *((environ + (v3 << 3))); v3 = v3 + 1) {
if ((!v4 || *(*((environ + (v3 << 3)))) == *(a0) && !strncmp(*((environ + (v3 << 3))), a0, v4)) && v4[*((environ + (v3 << 3)))] == 61) {
v7 = &v4[1 + *((environ + v3 * 8))];
return;
}
}
}
v6 = 0;
return;
}
}
v2 = 0;
return;
}
|
static int
ssh_packet_read_poll2_mux(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
{
struct session_state *state = ssh->state;
const u_char *cp;
size_t need;
int r;
if (ssh->kex)
return -1;
*typep = 0;
cp = sshbuf_ptr(state->input);
if (state->packlen == 0) {
if (sshbuf_len(state->input) < 4 + 1)
return 0;
state->packlen = (((u_int32_t)(((const u_char *)(cp))[0]) << 24) | ((u_int32_t)(((const u_char *)(cp))[1]) << 16) | ((u_int32_t)(((const u_char *)(cp))[2]) << 8) | (u_int32_t)(((const u_char *)(cp))[3]));
if (state->packlen < 4 + 1 ||
state->packlen > (256 * 1024))
return -3;
}
need = state->packlen + 4;
if (sshbuf_len(state->input) < need)
return 0;
sshbuf_reset(state->incoming_packet);
if ((r = sshbuf_put(state->incoming_packet, cp + 4,
state->packlen)) != 0 ||
(r = sshbuf_consume(state->input, need)) != 0 ||
(r = sshbuf_get_u8(state->incoming_packet,
((void *)0)
)) != 0 ||
(r = sshbuf_get_u8(state->incoming_packet, typep)) != 0)
return r;
if (ssh_packet_log_type(*typep))
sshlog("packet.c", __func__, 1471, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "type %u", *typep);
state->packlen = 0;
return r;
}
|
void ssh_packet_read_poll2_mux(unsigned long long a0[2], char *a1, unsigned long a2) {
unsigned long long v0;
unsigned long v1;
unsigned long v2;
unsigned int v3;
struct_0 *v4;
char v5[4];
unsigned long long v6;
unsigned long long v8;
void* v9;
unsigned long long v10;
void* v11;
unsigned long long v12;
unsigned long long v13;
v2 = a2;
v4 = a0[0];
if (a0[1]) {
v8 = 4294967295;
} else {
*(a1) = 0;
*(&v5) = sshbuf_ptr(v4->field_20);
if (v4->field_1d8) {
LABEL_4032ae:
v6 = v4->field_1d8 + 4;
if (v6 > sshbuf_len(v4->field_20)) {
v11 = 0;
} else {
sshbuf_reset(v4->field_38);
v3 = sshbuf_put(v4->field_38, v5 + 1, v4->field_1d8, v5 + 1);
if (v3) {
LABEL_40337f:
v12 = v3;
} else {
v3 = sshbuf_consume(v4->field_20, v6);
if (!(!v3))
goto LABEL_40337f;
v3 = sshbuf_get_u8(v4->field_38, 0x0);
if (!(!v3))
goto LABEL_40337f;
v3 = sshbuf_get_u8(v4->field_38, a1);
if (!(!v3))
goto LABEL_40337f;
if (ssh_packet_log_type(*(a1))) {
v1 = *(a1);
v0 = "type %u";
sshlog("packet.c", "ssh_packet_read_poll2_mux", 0x5bf, 0x1, 0x7, 0x0);
}
v4->field_1d8 = 0;
v13 = v3;
}
}
} else {
if (sshbuf_len(v4->field_20) <= 4) {
v9 = 0;
goto LABEL_4033ef;
}
v4->field_1d8 = (v5[0] * 0x1000000) | (v5[1] * 0x10000) | (v5[2] * 0x100) | v5[3];
if (v4->field_1d8 > 4 && v4->field_1d8 <= 0x40000)
goto LABEL_4032ae;
v10 = 4294967293;
}
}
LABEL_4033ef:
return;
}
|
char *
tilde_expand_word (const char *filename)
{
char *dirname, *expansion, *username;
int user_len;
struct passwd *user_entry;
if (filename == 0)
return ((char *)
((void *)0)
);
if (*filename != '~')
return (strcpy ((char *)sh_xmalloc((1 + strlen (filename)), "tilde.c", 346), (filename)));
if (filename[1] == '\0' || filename[1] == '/')
{
expansion = sh_get_env_value ("HOME");
if (expansion == 0)
expansion = sh_get_home_dir ();
return (glue_prefix_and_suffix (expansion, filename, 1));
}
username = isolate_tilde_prefix (filename, &user_len);
if (tilde_expansion_preexpansion_hook)
{
expansion = (*tilde_expansion_preexpansion_hook) (username);
if (expansion)
{
dirname = glue_prefix_and_suffix (expansion, filename, user_len);
sh_xfree((username), "tilde.c", 376);
sh_xfree((expansion), "tilde.c", 377);
return (dirname);
}
}
dirname = (char *)
((void *)0)
;
user_entry = getpwnam (username);
if (user_entry == 0)
{
if (tilde_expansion_failure_hook)
{
expansion = (*tilde_expansion_failure_hook) (username);
if (expansion)
{
dirname = glue_prefix_and_suffix (expansion, filename, user_len);
sh_xfree((expansion), "tilde.c", 400);
}
}
if (dirname == 0)
dirname = strcpy ((char *)sh_xmalloc((1 + strlen (filename)), "tilde.c", 406), (filename));
}
else
dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len);
sh_xfree((username), "tilde.c", 413);
endpwent ();
return (dirname);
}
|
int tilde_expand_word(char a0[2]) {
char v0;
void* v1;
unsigned long long v2;
char *v3;
struct_0 *v4;
unsigned int v6;
if (!a0) {
v6 = 0;
} else if (a0[0] != 126) {
v6 = strcpy(sh_xmalloc(strlen(a0) + 1, "tilde.c", 0x15a), a0);
} else {
if (a0[1] && a0[1] != 47) {
v3 = isolate_tilde_prefix(a0, &v0);
if (tilde_expansion_preexpansion_hook) {
v2 = *(4196424)(v3);
if (v2) {
v1 = glue_prefix_and_suffix(v2, a0, *(&v0));
sh_xfree(v3, "tilde.c", 0x178);
sh_xfree(v2, "tilde.c", 0x179);
v6 = v1;
}
}
if (!v2 || !tilde_expansion_preexpansion_hook) {
v1 = 0;
v4 = &getpwnam(v3)->pw_name;
if (!v4) {
if (tilde_expansion_failure_hook) {
v2 = *(4196432)(v3);
if (v2) {
v1 = glue_prefix_and_suffix(v2, a0, *(&v0));
sh_xfree(v2, "tilde.c", 0x190);
}
}
if (!v1)
v1 = strcpy(sh_xmalloc(strlen(a0) + 1, "tilde.c", 0x196), a0);
} else {
v1 = glue_prefix_and_suffix(v4->field_20, a0, *(&v0));
}
sh_xfree(v3, "tilde.c", 0x19d);
endpwent();
v6 = v1;
}
}
if (!a0[1] || a0[1] == 47) {
v2 = sh_get_env_value("HOME");
if (!v2)
v2 = sh_get_home_dir();
v6 = glue_prefix_and_suffix(v2, a0, 0x1);
}
}
return v6;
}
|
static void
walk_tree (struct item *root,
_Bool
(*action) (struct item *))
{
if (root->right)
recurse_tree (root->right, action);
}
|
void walk_tree(struct_0 *a0, unsigned long long a1) {
unsigned long long v1;
unsigned long long v2;
v1 = a0->field_10;
if (a0->field_10)
v2 = recurse_tree(a0->field_10, a1);
return;
}
|
static void purge_members (const struct group *grp)
{
struct group *newgrp = __gr_dup (grp);
if (
((void *)0)
== newgrp) {
fprintf (
stderr
,
gettext ("%s: Out of memory. Cannot update %s.\n"),
Prog, gr_dbname ());
fail_exit (13);
}
newgrp->gr_mem[0] =
((void *)0)
;
if (is_shadowgrp) {
const struct sgrp *sg = sgr_locate (newgrp->gr_name);
struct sgrp *newsg;
if (
((void *)0)
== sg) {
static struct sgrp sgrent;
sgrent.sg_name = xstrdup (newgrp->gr_name);
sgrent.sg_mem = (char **) xmalloc (sizeof (char *));
sgrent.sg_mem[0] =
((void *)0)
;
sgrent.sg_adm = (char **) xmalloc (sizeof (char *));
sgrent.sg_adm[0] =
((void *)0)
;
sgrent.sg_passwd = newgrp->gr_passwd;
newgrp->gr_passwd = xstrdup("x");
newsg = &sgrent;
} else {
newsg = __sgr_dup (sg);
if (
((void *)0)
== newsg) {
fprintf (
stderr
,
gettext ("%s: Out of memory. Cannot update %s.\n"),
Prog, sgr_dbname ());
fail_exit (13);
}
newsg->sg_mem[0] =
((void *)0)
;
newsg->sg_adm[0] =
((void *)0)
;
}
if (sgr_update (newsg) == 0) {
fprintf (
stderr
,
gettext ("%s: failed to prepare the new %s entry '%s'\n"),
Prog, sgr_dbname (), newsg->sg_name);
fail_exit (13);
}
}
if (gr_update (newgrp) == 0) {
fprintf (
stderr
,
gettext ("%s: failed to prepare the new %s entry '%s'\n"),
Prog, gr_dbname (), newgrp->gr_name);
fail_exit (13);
}
}
|
void purge_members(undefined8 param_1)
{
int iVar1;
undefined8 *puVar2;
undefined8 uVar3;
char *pcVar4;
long lVar5;
undefined8 uVar6;
undefined8 uVar7;
undefined1 *local_40;
puVar2 = (undefined8 *)__gr_dup(param_1);
if (puVar2 == (undefined8 *)0x0) {
uVar3 = gr_dbname();
uVar6 = Prog;
pcVar4 = (char *)gettext("%s: Out of memory. Cannot update %s.\n");
fprintf(stderr,pcVar4,uVar6,uVar3);
fail_exit(0xd);
}
*(undefined8 *)puVar2[3] = 0;
if (is_shadowgrp != '\0') {
lVar5 = sgr_locate(*puVar2);
if (lVar5 == 0) {
sgrent_5677._0_8_ = xstrdup(*puVar2);
sgrent_5677._24_8_ = (undefined8 *)xmalloc(8);
*sgrent_5677._24_8_ = 0;
sgrent_5677._16_8_ = (undefined8 *)xmalloc(8);
*sgrent_5677._16_8_ = 0;
sgrent_5677._8_8_ = puVar2[1];
uVar6 = xstrdup(&DAT_00101756);
puVar2[1] = uVar6;
local_40 = sgrent_5677;
}
else {
local_40 = (undefined1 *)__sgr_dup(lVar5);
if ((undefined8 *)local_40 == (undefined8 *)0x0) {
uVar3 = sgr_dbname();
uVar6 = Prog;
pcVar4 = (char *)gettext("%s: Out of memory. Cannot update %s.\n");
fprintf(stderr,pcVar4,uVar6,uVar3);
fail_exit(0xd);
}
**(undefined8 **)((long)local_40 + 0x18) = 0;
**(undefined8 **)((long)local_40 + 0x10) = 0;
}
iVar1 = sgr_update(local_40);
if (iVar1 == 0) {
uVar6 = *(undefined8 *)local_40;
uVar7 = sgr_dbname();
uVar3 = Prog;
pcVar4 = (char *)gettext("%s: failed to prepare the new %s entry \'%s\'\n");
fprintf(stderr,pcVar4,uVar3,uVar7,uVar6);
fail_exit(0xd);
}
}
iVar1 = gr_update(puVar2);
if (iVar1 == 0) {
uVar6 = *puVar2;
uVar7 = gr_dbname();
uVar3 = Prog;
pcVar4 = (char *)gettext("%s: failed to prepare the new %s entry \'%s\'\n");
fprintf(stderr,pcVar4,uVar3,uVar7,uVar6);
fail_exit(0xd);
}
return;
}
|
static void nh_reset(nh_ctx *hc)
{
hc->bytes_hashed = 0;
hc->next_data_empty = 0;
hc->state[0] = 0;
hc->state[1] = 0;
hc->state[2] = 0;
hc->state[3] = 0;
}
|
void nh_reset(struct_0 *a0) {
char v0;
struct_0 *v2;
unsigned long long v3;
a0->field_474 = 0;
a0->field_470 = 0;
a0->field_478 = 0;
a0->field_480 = 0;
a0->field_488 = 0;
v2 = a0;
a0->field_490 = 0;
v3 = *(&v0);
return;
}
|
void
print_context_header (struct file_data inf[], char const *const *names,
_Bool
unidiff)
{
if (unidiff)
{
print_context_label ("---", &inf[0], names[0], file_label[0]);
print_context_label ("+++", &inf[1], names[1], file_label[1]);
}
else
{
print_context_label ("***", &inf[0], names[0], file_label[0]);
print_context_label ("---", &inf[1], names[1], file_label[1]);
}
}
|
void print_context_header(long param_1,undefined8 *param_2,char param_3)
{
if (param_3 == '\0') {
print_context_label(&DAT_00101118,param_1,*param_2,file_label);
print_context_label(&DAT_00101110,param_1 + 0x130,param_2[1],_ignore_blank_lines);
}
else {
print_context_label(&DAT_00101110,param_1,*param_2,file_label);
print_context_label(&DAT_00101114,param_1 + 0x130,param_2[1],_ignore_blank_lines);
}
return;
}
|
static Channel *
server_request_direct_tcpip(struct ssh *ssh, int *reason, const char **errmsg)
{
Channel *c =
((void *)0)
;
char *target =
((void *)0)
, *originator =
((void *)0)
;
u_int target_port = 0, originator_port = 0;
int r;
if ((r = sshpkt_get_cstring(ssh, &target,
((void *)0)
)) != 0 ||
(r = sshpkt_get_u32(ssh, &target_port)) != 0 ||
(r = sshpkt_get_cstring(ssh, &originator,
((void *)0)
)) != 0 ||
(r = sshpkt_get_u32(ssh, &originator_port)) != 0 ||
(r = sshpkt_get_end(ssh)) != 0)
sshpkt_fatal(ssh, r, "%s: parse packet", __func__);
if (target_port > 0xFFFF) {
sshlog("serverloop.c", __func__, 443, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "invalid target port");
*reason = 1;
goto out;
}
if (originator_port > 0xFFFF) {
sshlog("serverloop.c", __func__, 448, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "invalid originator port");
*reason = 1;
goto out;
}
sshlog("serverloop.c", __func__, 453, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "originator %s port %u, target %s port %u", originator, originator_port, target, target_port)
;
if ((options.allow_tcp_forwarding & (1<<1)) != 0 &&
auth_opts->permit_port_forwarding_flag &&
!options.disable_forwarding) {
c = channel_connect_to_port(ssh, target, target_port,
"direct-tcpip", "direct-tcpip", reason, errmsg);
} else {
sshlog("serverloop.c", __func__, 463, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "refused local port forward: " "originator %s port %d, target %s port %d", originator, originator_port, target, target_port)
;
if (reason !=
((void *)0)
)
*reason = 1;
}
out:
free(originator);
free(target);
return c;
}
|
undefined8 server_request_direct_tcpip(undefined8 param_1,undefined4 *param_2,undefined8 param_3)
{
long in_FS_OFFSET;
undefined8 uVar1;
int local_2c;
void *local_28;
void *local_20;
undefined8 local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_18 = 0;
local_28 = (void *)0x0;
local_20 = (void *)0x0;
local_2c = sshpkt_get_cstring(param_1,&local_28,0);
if ((((local_2c == 0) && (local_2c = sshpkt_get_u32(param_1), local_2c == 0)) &&
(local_2c = sshpkt_get_cstring(param_1,&local_20,0), local_2c == 0)) &&
(local_2c = sshpkt_get_u32(param_1), local_2c == 0)) {
uVar1 = 0x100f33;
local_2c = sshpkt_get_end(param_1);
if (local_2c == 0) goto LAB_00100f5e;
}
uVar1 = 0x100f5e;
sshpkt_fatal(param_1,local_2c,"%s: parse packet","server_request_direct_tcpip");
LAB_00100f5e:
sshlog("serverloop.c","server_request_direct_tcpip",0x1c5,1,5,0,
"originator %s port %u, target %s port %u",local_20,0,local_28,0,uVar1);
if ((((_DAT_00104564 & 2) == 0) || (*auth_opts == 0)) || (_DAT_00104570 != 0)) {
sshlog("serverloop.c","server_request_direct_tcpip",0x1cf,0,3,0,
"refused local port forward: originator %s port %d, target %s port %d",local_20,0,
local_28,0,uVar1);
if (param_2 != (undefined4 *)0x0) {
*param_2 = 1;
}
}
else {
local_18 = channel_connect_to_port
(param_1,local_28,0,"direct-tcpip","direct-tcpip",param_2,param_3);
}
free(local_20);
free(local_28);
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return local_18;
}
__stack_chk_fail();
}
|
void cu_prermdeconfigure(int argc, void **argv) {
struct pkginfo *deconf= (struct pkginfo*)argv[0];
struct pkginfo *conflictor = (struct pkginfo *)argv[1];
struct pkginfo *infavour= (struct pkginfo*)argv[2];
if (conflictor) {
maintscript_postinst(deconf, "abort-deconfigure",
"in-favour",
pkgbin_name(infavour, &infavour->available,
pnaw_nonambig),
versiondescribe(&infavour->available.version,
vdew_nonambig),
"removing",
pkg_name(conflictor, pnaw_nonambig),
versiondescribe(&conflictor->installed.version,
vdew_nonambig),
((void *)0)
);
} else {
maintscript_postinst(deconf, "abort-deconfigure",
"in-favour",
pkgbin_name(infavour, &infavour->available,
pnaw_nonambig),
versiondescribe(&infavour->available.version,
vdew_nonambig),
((void *)0)
);
}
post_postinst_tasks(deconf, PKG_STAT_INSTALLED);
}
|
long long cu_prermdeconfigure(unsigned long a0, unsigned long long a1[3]) {
unsigned long v0;
unsigned long v1;
void* v2;
unsigned int v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v8;
v3 = a0;
v4 = a1[0];
v5 = a1[1];
v6 = a1[2];
if (v5) {
v8 = versiondescribe(v5 + 152, 0x1);
versiondescribe(v6 + 272, 0x1);
v2 = 0;
v1 = v8;
v0 = pkg_name(v5, 0x1);
maintscript_postinst(v4, "abort-deconfigure", "in-favour", pkgbin_name(v6, v6 + 192, 0x1, v6 + 192));
} else {
versiondescribe(v6 + 272, 0x1);
maintscript_postinst(v4, "abort-deconfigure", "in-favour", pkgbin_name(v6, v6 + 192, 0x1, v6 + 192));
}
return post_postinst_tasks(v4, 0x7);
}
|
static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
{
int flush = 0;
int c, fd;
e2fsck_t ctx;
errcode_t retval;
struct sigaction sa;
char *extended_opts = 0;
char *cp;
int res;
unsigned long long phys_mem_kb, blk;
retval = e2fsck_allocate_context(&ctx);
if (retval)
return retval;
*ret_ctx = ctx;
e2fsck_global_ctx = ctx;
setvbuf(
stdout
,
((void *)0)
,
2
,
8192
);
setvbuf(
stderr
,
((void *)0)
,
2
,
8192
);
if (getenv("E2FSCK_FORCE_INTERACTIVE") || (isatty(0) && isatty(1))) {
ctx->interactive = 1;
} else {
ctx->start_meta[0] = '\001';
ctx->stop_meta[0] = '\002';
}
memset(bar, '=', sizeof(bar)-1);
memset(spaces, ' ', sizeof(spaces)-1);
add_error_table(&et_ext2_error_table);
add_error_table(&et_prof_error_table);
blkid_get_cache(&ctx->blkid,
((void *)0)
);
if (argc && *argv)
ctx->program_name = *argv;
else
ctx->program_name = "e2fsck";
phys_mem_kb = get_memory_size() / 1024;
ctx->readahead_kb = ~0ULL;
while ((c = getopt(argc, argv, "panyrcC:B:dE:fvtFVM:b:I:j:P:l:L:N:SsDkz:")) !=
(-1)
)
switch (c) {
case 'C':
ctx->progress = e2fsck_update_progress;
res = sscanf(optarg, "%d", &ctx->progress_fd);
if (res != 1)
goto sscanf_err;
if (ctx->progress_fd < 0) {
ctx->progress = 0;
ctx->progress_fd = ctx->progress_fd * -1;
}
if (!ctx->progress_fd)
break;
fd = dup(ctx->progress_fd);
if (fd < 0) {
fprintf(
stderr
,
(gettext ("Error validating file descriptor %d: %s\n")),
ctx->progress_fd,
error_message(
(*__errno_location ())
));
fatal_error(ctx,
(gettext ("Invalid completion information file descriptor")));
} else
close(fd);
break;
case 'D':
ctx->options |= 0x0400;
break;
case 'E':
extended_opts = optarg;
break;
case 'p':
case 'a':
if (ctx->options & (0x0004|0x0008)) {
conflict_opt:
fatal_error(ctx,
(gettext ("Only one of the options -p/-a, -n or -y may be specified.")));
}
ctx->options |= 0x0002;
break;
case 'n':
if (ctx->options & (0x0004|0x0002))
goto conflict_opt;
ctx->options |= 0x0008;
break;
case 'y':
if (ctx->options & (0x0002|0x0008))
goto conflict_opt;
ctx->options |= 0x0004;
break;
case 't':
if (ctx->options & 0x0010)
ctx->options |= 0x0020;
else
ctx->options |= 0x0010;
break;
case 'c':
if (cflag++)
ctx->options |= 0x0200;
ctx->options |= 0x0040;
break;
case 'r':
break;
case 'b':
res = sscanf(optarg, "%llu", &blk);
ctx->use_superblock = blk;
if (res != 1)
goto sscanf_err;
ctx->flags |= 0x0100;
break;
case 'B':
ctx->blocksize = atoi(optarg);
break;
case 'I':
res = sscanf(optarg, "%d", &ctx->inode_buffer_blocks);
if (res != 1)
goto sscanf_err;
break;
case 'j':
ctx->journal_name = blkid_get_devname(ctx->blkid,
optarg,
((void *)0)
);
if (!ctx->journal_name) {
com_err(ctx->program_name, 0,
(gettext ("Unable to resolve '%s'")),
optarg);
fatal_error(ctx, 0);
}
break;
case 'P':
res = sscanf(optarg, "%d", &ctx->process_inode_size);
if (res != 1)
goto sscanf_err;
break;
case 'L':
replace_bad_blocks++;
case 'l':
if (bad_blocks_file)
free(bad_blocks_file);
bad_blocks_file = string_copy(ctx, optarg, 0);
break;
case 'd':
ctx->options |= 0x0080;
break;
case 'f':
ctx->options |= 0x0100;
break;
case 'F':
flush = 1;
break;
case 'v':
verbose = 1;
break;
case 'V':
show_version_only = 1;
break;
case 'N':
ctx->device_name = string_copy(ctx, optarg, 0);
break;
case 'k':
keep_bad_blocks++;
break;
case 'z':
ctx->undo_file = optarg;
break;
default:
usage(ctx);
}
if (show_version_only)
return 0;
if (optind != argc - 1)
usage(ctx);
if ((ctx->options & 0x0008) &&
(ctx->options & 0x0400)) {
com_err(ctx->program_name, 0, "%s",
(gettext ("The -n and -D options are incompatible.")));
fatal_error(ctx, 0);
}
if ((ctx->options & 0x0008) && cflag) {
com_err(ctx->program_name, 0, "%s",
(gettext ("The -n and -c options are incompatible.")));
fatal_error(ctx, 0);
}
if ((ctx->options & 0x0008) && bad_blocks_file) {
com_err(ctx->program_name, 0, "%s",
(gettext ("The -n and -l/-L options are incompatible.")));
fatal_error(ctx, 0);
}
if (ctx->options & 0x0008)
ctx->options |= 0x0001;
ctx->io_options = strchr(argv[optind], '?');
if (ctx->io_options)
*ctx->io_options++ = 0;
ctx->filesystem_name = blkid_get_devname(ctx->blkid, argv[optind], 0);
if (!ctx->filesystem_name) {
com_err(ctx->program_name, 0, (gettext ("Unable to resolve '%s'")),
argv[optind]);
fatal_error(ctx, 0);
}
if (extended_opts)
parse_extended_opts(ctx, extended_opts);
if (getenv("E2FSCK_FIXES_ONLY"))
ctx->options |= 0x8000;
if ((ctx->options & 0x0400) &&
(ctx->options & 0x8000)) {
com_err(ctx->program_name, 0, "%s",
(gettext ("The -D and -E fixes_only options are incompatible.")));
fatal_error(ctx, 0);
}
if ((ctx->options & 0x4000) &&
(ctx->options & 0x8000)) {
com_err(ctx->program_name, 0, "%s",
(gettext ("The -E bmap2extent and fixes_only options are incompatible.")));
fatal_error(ctx, 0);
}
if ((cp = getenv("E2FSCK_CONFIG")) !=
((void *)0)
)
config_fn[0] = cp;
profile_set_syntax_err_cb(syntax_err_report);
profile_init(config_fn, &ctx->profile);
profile_get_boolean(ctx->profile, "options", "report_time", 0, 0,
&c);
if (c)
ctx->options |= 0x0010 | 0x0020;
profile_get_boolean(ctx->profile, "options", "report_verbose", 0, 0,
&c);
if (c)
verbose = 1;
profile_get_boolean(ctx->profile, "options", "no_optimize_extents",
0, 0, &c);
if (c)
ctx->options |= 0x10000;
profile_get_boolean(ctx->profile, "options", "inode_count_fullmap",
0, 0, &c);
if (c)
ctx->options |= 0x20000;
if (ctx->readahead_kb == ~0ULL) {
profile_get_integer(ctx->profile, "options",
"readahead_mem_pct", 0, -1, &c);
if (c >= 0 && c <= 100)
ctx->readahead_kb = phys_mem_kb * c / 100;
profile_get_integer(ctx->profile, "options",
"readahead_kb", 0, -1, &c);
if (c >= 0)
ctx->readahead_kb = c;
if (ctx->readahead_kb != ~0ULL &&
ctx->readahead_kb > phys_mem_kb)
ctx->readahead_kb = phys_mem_kb;
}
if ((ctx->options & 0x0008) &&
(ctx->options & 0x2000))
ctx->options &= ~0x2000;
if (flush) {
fd = open(ctx->filesystem_name,
00
, 0);
if (fd < 0) {
com_err("open",
(*__errno_location ())
,
(gettext ("while opening %s for flushing")),
ctx->filesystem_name);
fatal_error(ctx, 0);
}
if ((retval = ext2fs_sync_device(fd, 1))) {
com_err("ext2fs_sync_device", retval,
(gettext ("while trying to flush %s")),
ctx->filesystem_name);
fatal_error(ctx, 0);
}
close(fd);
}
if (cflag && bad_blocks_file) {
fprintf(
stderr
, "%s", (gettext ("The -c and the -l/-L options may not " "be both used at the same time.\n"))
);
exit(16);
}
memset(&sa, 0, sizeof(struct sigaction));
sa.
__sigaction_handler.sa_handler
= signal_cancel;
sigaction(
2
, &sa, 0);
sigaction(
15
, &sa, 0);
sa.sa_flags =
0x10000000
;
sa.
__sigaction_handler.sa_handler
= signal_progress_on;
sigaction(
10
, &sa, 0);
sa.
__sigaction_handler.sa_handler
= signal_progress_off;
sigaction(
12
, &sa, 0);
if (cflag) {
char *oldpath = getenv("PATH");
char *newpath;
int len = sizeof("PATH=/sbin") + 1;
if (oldpath)
len += strlen(oldpath);
newpath = malloc(len);
if (!newpath)
fatal_error(ctx, "Couldn't malloc() newpath");
strcpy(newpath, "PATH=/sbin");
if (oldpath) {
strcat(newpath, ":");
strcat(newpath, oldpath);
}
putenv(newpath);
}
return 0;
sscanf_err:
fprintf(
stderr
, (gettext ("\nInvalid non-numeric argument to -%c (\"%s\")\n\n")),
c, optarg);
exit (1);
}
|
int PRS(unsigned long a0, unsigned long long *a1, unsigned long a2) {
unsigned long long *v0;
int tmp_21;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
char v6;
char v7;
void* v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
char *v12;
char *v13;
unsigned long long v14;
unsigned int v15;
unsigned long v17;
v0 = a2;
v2 = 0;
v8 = 0;
v9 = e2fsck_allocate_context(&v6);
if (v9) {
v17 = v9;
} else {
*(v0) = *(&v6);
e2fsck_global_ctx = *(&v6);
setvbuf(stdout, NULL, 0x2, 0x2000);
setvbuf(stderr, NULL, 0x2, 0x2000);
if (getenv("E2FSCK_FORCE_INTERACTIVE")) {
LABEL_4029fe:
*((*(&v6) + 728)) = 1;
} else if (!isatty(0x0)) {
LABEL_402a11:
*((*(&v6) + 732)) = 1;
*((*(&v6) + 734)) = 2;
} else {
if (!isatty(0x1))
goto LABEL_402a11;
goto LABEL_4029fe;
}
memset(&bar, 0x3d, 0x7f);
memset(&spaces, 0x20, 0x7f);
add_error_table(0x5001c0);
add_error_table(0x5001d0);
blkid_get_cache(*(&v6) + 136, 0x0);
if (a0 && *(a1)) {
*((*(&v6) + 8)) = *(a1);
goto LABEL_402acc;
}
*((*(&v6) + 8)) = "e2fsck";
LABEL_402acc:
v10 = get_memory_size() >> 10;
*((*(&v6) + 920)) = -1;
v1 = getopt(a0, a1, "panyrcC:B:dE:fvtFVM:b:I:j:P:l:L:N:SsDkz:");
if (v1 != -1) {
switch (v1) {
case 66:
*((*(&v6) + 80)) = atoi(*(&optarg));
continue;
case 67:
*((*(&v6) + 352)) = e2fsck_update_progress;
v5 = __isoc99_sscanf(*(&optarg), "%d", (*(&v6) + 712));
if (v5 == 1) {
if (*((*(&v6) + 712)) < 0) {
*((*(&v6) + 352)) = 0;
*((*(&v6) + 712)) = -(*((*(&v6) + 712)));
}
if (*((*(&v6) + 712))) {
v4 = dup(*((*(&v6) + 712)));
if (v4 >= 0) {
close(v4);
break;
} else {
error_message(*(__errno_location()));
fprintf(stderr, gettext("Error validating file descriptor %d: %s\n"));
v17 = gettext("Invalid completion information file descriptor");
fatal_error(*(&v6), v17, v17);
}
}
continue;
}
case 68:
a2 = *((*(&v6) + 76));
*(&a2) = (*((*(&v6) + 76)) >> 8) | 4;
tmp_21 = a2;
*((*(&v6) + 76)) = tmp_21;
continue;
case 69:
v8 = *(&optarg);
continue;
case 70:
v2 = 1;
continue;
case 73:
v5 = __isoc99_sscanf(*(&optarg), "%d", (*(&v6) + 604));
if (v5 == 1)
continue;
case 78:
*((*(&v6) + 24)) = string_copy(*(&v6), *(&optarg), 0x0, *(&optarg));
continue;
case 80:
v5 = __isoc99_sscanf(*(&optarg), "%d", (*(&v6) + 600));
if (v5 == 1)
continue;
case 86:
show_version_only = 1;
continue;
case 97: case 112:
if (!(*((*(&v6) + 76)) & 12))
goto LABEL_402cda;
goto LABEL_402cb9;
case 98:
v5 = __isoc99_sscanf(*(&optarg), "%llu", &v7);
*((*(&v6) + 88)) = *(&v7);
if (v5 == 1) {
a2 = *((*(&v6) + 72));
*(&a2) = (*((*(&v6) + 72)) >> 8) | 1;
tmp_21 = a2;
*((*(&v6) + 72)) = tmp_21;
continue;
}
case 99:
cflag = cflag + 1;
if (cflag) {
a2 = *((*(&v6) + 76));
*(&a2) = (*((*(&v6) + 76)) >> 8) | 2;
tmp_21 = a2;
*((*(&v6) + 76)) = tmp_21;
}
*((*(&v6) + 76)) = *((*(&v6) + 76)) | 64;
continue;
case 100:
a2 = *((*(&v6) + 76));
*(&a2) = *((*(&v6) + 76)) | 128;
*((*(&v6) + 76)) = a2;
continue;
case 102:
a2 = *((*(&v6) + 76));
*(&a2) = (*((*(&v6) + 76)) >> 8) | 1;
tmp_21 = a2;
*((*(&v6) + 76)) = tmp_21;
continue;
case 106:
*((*(&v6) + 624)) = blkid_get_devname(*((*(&v6) + 136)), *(&optarg), 0x0, *(&optarg));
if (!*((*(&v6) + 624))) {
com_err(*((*(&v6) + 8)), 0x0, gettext("Unable to resolve '%s'"), *(&optarg));
fatal_error(*(&v6), 0x0, a2);
}
continue;
case 107:
keep_bad_blocks = keep_bad_blocks + 1;
continue;
case 110:
if (!(*((*(&v6) + 76)) & 6)) {
*((*(&v6) + 76)) = *((*(&v6) + 76)) | 8;
continue;
}
goto LABEL_402cb9;
case 114:
break;
case 116:
if (!(*((*(&v6) + 76)) & 16)) {
*((*(&v6) + 76)) = *((*(&v6) + 76)) | 16;
break;
} else {
*((*(&v6) + 76)) = *((*(&v6) + 76)) | 32;
}
continue;
case 118:
verbose = 1;
continue;
case 121:
if (!(*((*(&v6) + 76)) & 10)) {
*((*(&v6) + 76)) = *((*(&v6) + 76)) | 4;
continue;
}
LABEL_402cb9:
v17 = gettext("Only one of the options -p/-a, -n or -y may be specified.");
fatal_error(*(&v6), v17, v17);
LABEL_402cda:
*((*(&v6) + 76)) = *((*(&v6) + 76)) | 2;
break;
case 122:
*((*(&v6) + 936)) = *(&optarg);
continue;
case 76:
replace_bad_blocks = replace_bad_blocks + 1;
case 108:
if (bad_blocks_file)
free(bad_blocks_file);
bad_blocks_file = string_copy(*(&v6), *(&optarg), 0x0, *(&optarg));
continue;
default:
usage(*(&v6));
}
fprintf(stderr, gettext("\nInvalid non-numeric argument to -%c (\"%s\")\n\n"));
exit(0x1);
} else if (show_version_only) {
*(&v17) = 0;
} else if (a0 - 1 != optind) {
usage(*(&v6));
} else {
if ((*((*(&v6) + 76)) & 8) && (*((*(&v6) + 76)) & 0x400)) {
com_err(*((*(&v6) + 8)), 0x0, "%s", gettext("The -n and -D options are incompatible."));
fatal_error(*(&v6), 0x0, "%s");
}
if ((*((*(&v6) + 76)) & 8) && cflag) {
com_err(*((*(&v6) + 8)), 0x0, "%s", gettext("The -n and -c options are incompatible."));
fatal_error(*(&v6), 0x0, "%s");
}
if ((*((*(&v6) + 76)) & 8) && bad_blocks_file) {
com_err(*((*(&v6) + 8)), 0x0, "%s", gettext("The -n and -l/-L options are incompatible."));
fatal_error(*(&v6), 0x0, "%s");
}
if ((*((*(&v6) + 76)) & 8))
*((*(&v6) + 76)) = *((*(&v6) + 76)) | 1;
*((*(&v6) + 32)) = strchr(a1[optind], 0x3f);
if (*((*(&v6) + 32))) {
v17 = *((*(&v6) + 32));
*((*(&v6) + 32)) = *((*(&v6) + 32)) + 1;
*(v17) = 0;
}
*((*(&v6) + 16)) = blkid_get_devname(*((*(&v6) + 136)), a1[optind], 0x0, a1[optind]);
if (!*((*(&v6) + 16))) {
com_err(*((*(&v6) + 8)), 0x0, gettext("Unable to resolve '%s'"), a1[optind]);
fatal_error(*(&v6), 0x0, a2);
}
if (v8)
parse_extended_opts(*(&v6), v8);
if (getenv("E2FSCK_FIXES_ONLY")) {
a2 = *((*(&v6) + 76));
*(&a2) = (*((*(&v6) + 76)) >> 8) | 128;
tmp_21 = a2;
*((*(&v6) + 76)) = tmp_21;
}
if ((*((*(&v6) + 76)) & 0x400) && (*((*(&v6) + 76)) & 0x8000)) {
com_err(*((*(&v6) + 8)), 0x0, "%s", gettext("The -D and -E fixes_only options are incompatible."));
fatal_error(*(&v6), 0x0, "%s");
}
if ((*((*(&v6) + 76)) & 0x4000) && (*((*(&v6) + 76)) & 0x8000)) {
com_err(*((*(&v6) + 8)), 0x0, "%s", gettext("The -E bmap2extent and fixes_only options are incompatible."));
fatal_error(*(&v6), 0x0, "%s");
}
v11 = getenv("E2FSCK_CONFIG");
if (v11)
config_fn = v11;
profile_set_syntax_err_cb(syntax_err_report);
profile_init(&config_fn, *(&v6) + 864);
profile_get_boolean(*((*(&v6) + 864)), "options", "report_time", 0x0, 0x0, &v1);
if (v1)
*((*(&v6) + 76)) = *((*(&v6) + 76)) | 48;
profile_get_boolean(*((*(&v6) + 864)), "options", "report_verbose", 0x0, 0x0, &v1);
if (v1)
verbose = 1;
profile_get_boolean(*((*(&v6) + 864)), "options", "no_optimize_extents", 0x0, 0x0, &v1);
if (v1)
*((*(&v6) + 76)) = *((*(&v6) + 76)) | 0x10000;
profile_get_boolean(*((*(&v6) + 864)), "options", "inode_count_fullmap", 0x0, 0x0, &v1);
if (v1)
*((*(&v6) + 76)) = *((*(&v6) + 76)) | 0x20000;
if (*((*(&v6) + 920)) == -1) {
profile_get_integer(*((*(&v6) + 864)), "options", "readahead_mem_pct", 0x0, 0xffffffff, &v1);
if (v1 >= 0 && v1 <= 100)
*((*(&v6) + 920)) = (v10 * v1 >> 2) * 2951479051793528259 >> 64 >> 2;
profile_get_integer(*((*(&v6) + 864)), "options", "readahead_kb", 0x0, 0xffffffff, &v1);
if (v1 >= 0)
*((*(&v6) + 920)) = v1;
if (*((*(&v6) + 920)) != -1 && v10 < *((*(&v6) + 920)))
*((*(&v6) + 920)) = v10;
}
if ((*((*(&v6) + 76)) & 8) && (*((*(&v6) + 76)) & 0x2000)) {
a2 = *((*(&v6) + 76));
*(&a2) = (*((*(&v6) + 76)) >> 8) & 223;
tmp_21 = a2;
*((*(&v6) + 76)) = tmp_21;
}
if (v2) {
v4 = open(*((*(&v6) + 16)), 0x0, 0x0);
if (v4 < 0) {
com_err("open", *(__errno_location()), gettext("while opening %s for flushing"), *((*(&v6) + 16)));
fatal_error(*(&v6), 0x0, a2);
}
v9 = ext2fs_sync_device(v4, 0x1);
if (v9) {
com_err("ext2fs_sync_device", v9, gettext("while trying to flush %s"), *((*(&v6) + 16)));
fatal_error(*(&v6), 0x0, a2);
}
close(v4);
}
if (cflag && bad_blocks_file) {
fprintf(stderr, "%s", gettext("The -c and the -l/-L options may not be both used at the same time.\n"));
exit(0x10);
}
memset(&v14, 0x0, 0x98);
v14 = signal_cancel;
sigaction(0x2, &v14, 0x0);
sigaction(0xf, &v14, 0x0);
v15 = 0x10000000;
v14 = signal_progress_on;
sigaction(0xa, &v14, 0x0);
v14 = signal_progress_off;
sigaction(0xc, &v14, 0x0);
if (cflag) {
v12 = getenv("PATH");
v3 = 12;
if (v12) {
*(&v17) = v3 + strlen(v12);
v3 = v17;
}
v13 = malloc(v3);
if (!v13)
fatal_error(*(&v6), "Couldn't malloc() newpath", 0x0);
strcpy(v13, "PATH=/sbin");
if (v12) {
strcat(v13, ":");
strcat(v13, v12);
}
putenv(v13);
}
*(&v17) = 0;
}
}
return v17;
}
|
static int
control_path(const char *const *argv)
{
struct pkginfo *pkg;
const char *pkgname;
const char *control_file;
pkgname = *argv++;
if (!pkgname)
badusage(gettext("--%s needs at least one package name argument"),
cipaction->olong);
control_file = *argv++;
if (control_file && *argv)
badusage(gettext("--%s takes at most two arguments"), cipaction->olong);
if (control_file)
pkg_infodb_check_filetype(control_file);
modstatdb_open(msdbrw_readonly);
pkg = dpkg_options_parse_pkgname(cipaction, pkgname);
if (pkg->status == PKG_STAT_NOTINSTALLED)
ohshit(gettext("package '%s' is not installed"),
pkg_name(pkg, pnaw_nonambig));
if (control_file)
control_path_file(pkg, control_file);
else
pkg_infodb_foreach(pkg, &pkg->installed, pkg_infodb_print_filename);
modstatdb_shutdown();
return 0;
}
|
long long control_path(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long *v0;
int tmp_27;
int tmp_11;
unsigned long long v1;
char *v2;
struct_0 *v3;
v0 = a0;
tmp_27 = v0;
v0 += 1;
v1 = *(tmp_27);
if (!v1)
badusage(gettext("--%s needs at least one package name argument"));
tmp_11 = v0;
v0 += 1;
v2 = *(tmp_11);
if (v2 && *(v0))
badusage(gettext("--%s takes at most two arguments"));
if (v2)
pkg_infodb_check_filetype(v2);
modstatdb_open(0x0);
v3 = dpkg_options_parse_pkgname(cipaction, v1, v1);
if (!v3->field_18)
ohshit(gettext("package '%s' is not installed"), pkg_name(v3, 0x1, a2));
if (!v2)
pkg_infodb_foreach(v3, &v3[2].padding_0[16], pkg_infodb_print_filename, &v3[2].padding_0[16]);
else
control_path_file(v3, v2);
modstatdb_shutdown(a0, a1, a2, a3, a4, a5);
return 0;
}
|
int
_rl_read_mbchar (char *mbchar, int size)
{
int mb_len, c;
size_t mbchar_bytes_length;
wchar_t wc;
mbstate_t ps, ps_back;
memset(&ps, 0, sizeof (mbstate_t));
memset(&ps_back, 0, sizeof (mbstate_t));
mb_len = 0;
while (mb_len < size)
{
c = (mb_len == 0) ? _rl_bracketed_read_key () : rl_read_key ();
if (c < 0)
break;
mbchar[mb_len++] = c;
mbchar_bytes_length = mbrtowc (&wc, mbchar, mb_len, &ps);
if (mbchar_bytes_length == (size_t)(-1))
break;
else if (mbchar_bytes_length == (size_t)(-2))
{
ps = ps_back;
continue;
}
else if (mbchar_bytes_length == 0)
{
mbchar[0] = '\0';
mb_len = 1;
break;
}
else if (mbchar_bytes_length > (size_t)(0))
break;
}
return mb_len;
}
|
long long _rl_read_mbchar(char *a0, unsigned long a1) {
int tmp_17;
char v0;
unsigned int v1;
unsigned int v2;
unsigned long v3;
unsigned long long v4;
char v5;
unsigned long long v7;
memset(&v4, 0x0, 0x8);
memset(&v5, 0x0, 0x8);
v1 = 0;
while (true) {
if (v1 >= a1)
break;
if (v1)
v7 = rl_read_key();
else
v7 = _rl_bracketed_read_key();
v2 = v7;
if (v2 < 0)
break;
tmp_17 = v1;
v1 += 1;
a0[tmp_17] = v2;
v3 = mbrtowc(&v0, a0, v1, &v4);
if (v3 == -1)
break;
if (v3 == -2) {
v4 = *(&v5);
} else if (!v3) {
*(a0) = 0;
v1 = 1;
break;
} else if (v3) {
break;
}
}
return v1;
}
|
void
platform_pledge_mux(void)
{
}
|
long long platform_pledge_mux() {
unsigned long v1;
return v1;
}
|
static ssize_t
funopen_read(void *cookie, char *buf, size_t size)
{
struct funopen_cookie *cookiewrap = cookie;
if (cookiewrap->readfn ==
((void *)0)
) {
(*__errno_location ())
=
9
;
return -1;
}
return cookiewrap->readfn(cookiewrap->orig_cookie, buf, size);
}
|
long long funopen_read(unsigned long long a0[2], unsigned long long a1, unsigned long long a2) {
unsigned long long v1;
if (!a0[1]) {
*(__errno_location()) = 9;
v1 = -1;
} else {
v1 = a0[1](a0[0], a1, a2, a1, a0[1]);
}
return v1;
}
|
static
_Bool
name_compare (void const *entry1, void const *entry2)
{
struct name const *name1 = entry1;
struct name const *name2 = entry2;
return strcmp (name1->caname, name2->caname) == 0;
}
|
long long name_compare(struct_0 *a0, struct_0 *a1) {
unsigned long long v1;
v1 = strcmp(a0->field_58, a1->field_58);
*(&v1) = !v1;
return v1;
}
|
static intmax_t
expcomma ()
{
register intmax_t value;
value = expassign ();
while (curtok == ',')
{
readtok ();
value = expassign ();
}
return value;
}
|
int expcomma(unsigned long long a0, unsigned long long a1, unsigned long a2, unsigned long long a3) {
unsigned int v1;
unsigned long long v2;
unsigned long long v3;
for (v1 = expassign(a0, a1, a2, a3); curtok == 44; v1 = expassign(a0, a1, a2, a3)) {
readtok(a0, a1, a2, a3, v2, v3);
}
return v1;
}
|
static rsRetVal
setupInstStatsCtrs(instanceData *__restrict__ const pData)
{
uchar ctrName[512];
rsRetVal iRet = RS_RET_OK;
snprintf((char*)ctrName, sizeof(ctrName), "%s-%s-%s",
(pData->protocol == 1) ? "TCP" : "UDP",
pData->target, pData->port);
ctrName[sizeof(ctrName)-1] = '\0';
if((iRet = statsobj.Construct(&(pData->stats))) != RS_RET_OK) goto finalize_it;
if((iRet = statsobj.SetName(pData->stats, ctrName)) != RS_RET_OK) goto finalize_it;
if((iRet = statsobj.SetOrigin(pData->stats, (uchar*)"omfwd")) != RS_RET_OK) goto finalize_it;
pData->sentBytes = 0;
;
if((iRet = statsobj.AddCounter(pData->stats, ((uchar*) ("bytes.sent")), ctrType_IntCtr, 1, &(pData->sentBytes))) != RS_RET_OK) goto finalize_it
;
if((iRet = statsobj.ConstructFinalize(pData->stats)) != RS_RET_OK) goto finalize_it;
finalize_it:
return iRet;
}
|
void setupInstStatsCtrs(struct_0 *a0) {
unsigned int v0;
char v1;
char v2;
unsigned int v4;
unsigned long long v5;
v0 = 0;
if (a0->field_78 != 1)
v4 = &g_406ae6;
else
v4 = "TCP";
snprintf(&v1, 0x200, "%s-%s-%s", v4, a0->field_50, a0->field_70);
v2 = 0;
v0 = *(4217584)(&a0->field_e8);
if (!v0) {
v0 = g_405b08(a0->field_e8, &v1, &v1, g_405b08);
if (!v0) {
v0 = g_405b10(a0->field_e8, "omfwd", g_405b10);
if (!v0) {
a0->field_f0 = 0;
v0 = g_405b38(a0->field_e8, "bytes.sent", 0, 1, &a0->field_f0, g_405b38);
if (!v0)
v0 = *(4217592)(a0->field_e8);
}
}
}
v5 = v0;
return;
}
|
static __inline void
_rs_stir_if_needed(size_t len)
{
_rs_forkdetect();
if (!rs || rs->rs_count <= len)
_rs_stir();
if (rs->rs_count <= len)
rs->rs_count = 0;
else
rs->rs_count -= len;
}
|
void _rs_stir_if_needed(unsigned long a0) {
struct_0 *v1;
struct_0 *v2;
_rs_forkdetect();
if (!rs || a0 >= *((rs + 8)))
_rs_stir();
if (a0 >= *((rs + 8))) {
v1 = rs;
*((rs + 8)) = 0;
return;
}
v2 = rs;
*((rs + 8)) = *((rs + 8)) - a0;
return;
}
|
int main (int argc, char **argv)
{
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(
stderr
);
(void) setlocale (
6
, "");
(void) bindtextdomain ("shadow", "/usr/share/locale");
(void) textdomain ("shadow");
process_root_flag ("-R", argc, argv);
prefix = process_prefix_flag ("-P", argc, argv);
openlog("groupmod", (
0x01
),
(10<<3)
);
if (atexit (do_cleanups) != 0) {
fprintf (
stderr
,
gettext ("%s: Cannot setup cleanup service.\n"),
Prog);
exit (11);
}
process_flags (argc, argv);
is_shadow_grp = sgr_file_present ();
{
struct group *grp;
grp = prefix_getgrnam (group_name);
if (
((void *)0)
== grp) {
fprintf (
stderr
,
gettext ("%s: group '%s' does not exist\n"),
Prog, group_name);
exit (6);
} else {
group_id = grp->gr_gid;
}
}
if (gflg) {
check_new_gid ();
}
if (nflg) {
check_new_name ();
}
lock_files ();
prepare_failure_reports ();
open_files ();
grp_update ();
close_files ();
nscd_flush_cache ("group");
sssd_flush_cache (0x002);
return 0;
}
|
int main(int argc, const char **argv, const char **envp)
{
long v3;
char *v4;
char *v5;
long v6;
char *v7;
long v9;
Prog = Basename(*argv, argv, envp);
log_set_progname(Prog);
log_set_logfd(stderr);
setlocale(6, byte_1B48);
bindtextdomain("shadow", "/usr/share/locale");
textdomain("shadow");
process_root_flag("-R", (unsigned int)argc, argv);
prefix = (char (*)[8])process_prefix_flag("-P", (unsigned int)argc, argv);
openlog("groupmod", 1, 80);
if ( atexit((void (*)(void))&do_cleanups) )
{
v3 = Prog;
v4 = gettext("%s: Cannot setup cleanup service.\n");
fprintf(stderr, v4, v3);
exit(11);
}
process_flags(argc, (char *const *)argv);
is_shadow_grp = sgr_file_present();
v9 = prefix_getgrnam(group_name);
if ( !v9 )
{
v5 = group_name;
v6 = Prog;
v7 = gettext("%s: group '%s' does not exist\n");
fprintf(stderr, v7, v6, v5);
exit(6);
}
group_id = *(_DWORD *)(v9 + 16);
if ( gflg )
check_new_gid();
if ( nflg )
check_new_name();
lock_files();
prepare_failure_reports();
open_files();
grp_update();
close_files();
nscd_flush_cache("group");
sssd_flush_cache(2LL);
return 0;
}
|
static rsRetVal
prepareFile(instanceData *__restrict__ const pData, const uchar *__restrict__ const newFileName)
{
int fd;
char errStr[1024];
rsRetVal iRet = RS_RET_OK;
pData->pStrm =
((void *)0)
;
if(access((char*)newFileName,
0
) != 0) {
if(pData->bCreateDirs) {
if(makeFileParentDirs(newFileName, (strlen((const char*) (newFileName))),
pData->fDirCreateMode, pData->dirUID,
pData->dirGID, pData->bFailOnChown) != 0) {
rs_strerror_r(
(*__errno_location ())
, errStr, sizeof(errStr));
parser_errmsg( "omfile: creating parent "
"directories for file '%s' failed: %s",
newFileName, errStr);
do { iRet = RS_RET_ERR; goto finalize_it; } while (0);
}
}
fd = open((char*) newFileName,
01
|
02000
|
0100
|
0400
|
02000000
,
pData->fCreateMode);
if(fd != -1) {
if(pData->fileUID != (uid_t)-1 || pData->fileGID != (gid_t) -1) {
if(fchown(fd, pData->fileUID, pData->fileGID) != 0) {
rs_strerror_r(
(*__errno_location ())
, errStr, sizeof(errStr));
parser_errmsg(
"omfile: chown for file '%s' failed: %s",
newFileName, errStr);
if(pData->bFailOnChown) {
close(fd);
do { iRet = RS_RET_ERR; goto finalize_it; } while (0);
}
}
}
close(fd);
}
}
uchar szNameBuf[4096 +1];
uchar szDirName[4096 +1];
uchar szBaseName[4096 +1];
strncpy((char*)(szNameBuf), (char*)(newFileName), (4096));
szNameBuf[4096] = '\0';
strncpy((char*)(szDirName), (char*)((uchar*)dirname((char*)szNameBuf)), (4096));
szDirName[4096] = '\0';
strncpy((char*)(szNameBuf), (char*)(newFileName), (4096));
szNameBuf[4096] = '\0';
strncpy((char*)(szBaseName), (char*)((uchar*)
__xpg_basename
((char*)szNameBuf)), (4096));
szBaseName[4096] = '\0';
if((iRet = strm.Construct(&pData->pStrm)) != RS_RET_OK) goto finalize_it;
if((iRet = strm.SetFName(pData->pStrm, szBaseName, (strlen((const char*) (szBaseName))))) != RS_RET_OK) goto finalize_it;
if((iRet = strm.SetDir(pData->pStrm, szDirName, (strlen((const char*) (szDirName))))) != RS_RET_OK) goto finalize_it;
if((iRet = strm.SetiZipLevel(pData->pStrm, pData->iZipLevel)) != RS_RET_OK) goto finalize_it;
if((iRet = strm.SetbVeryReliableZip(pData->pStrm, pData->bVeryRobustZip)) != RS_RET_OK) goto finalize_it;
if((iRet = strm.SetsIOBufSize(pData->pStrm, (size_t) pData->iIOBufSize)) != RS_RET_OK) goto finalize_it;
if((iRet = strm.SettOperationsMode(pData->pStrm, STREAMMODE_WRITE_APPEND)) != RS_RET_OK) goto finalize_it;
if((iRet = strm.SettOpenMode(pData->pStrm, cs.fCreateMode)) != RS_RET_OK) goto finalize_it;
if((iRet = strm.SetcompressionDriver(pData->pStrm, runModConf->compressionDriver)) != RS_RET_OK) goto finalize_it;
if((iRet = strm.SetCompressionWorkers(pData->pStrm, runModConf->compressionDriver_workers)) != RS_RET_OK) goto finalize_it;
if((iRet = strm.SetbSync(pData->pStrm, pData->bSyncFile)) != RS_RET_OK) goto finalize_it;
if((iRet = strm.SetsType(pData->pStrm, STREAMTYPE_FILE_SINGLE)) != RS_RET_OK) goto finalize_it;
if((iRet = strm.SetiSizeLimit(pData->pStrm, pData->iSizeLimit)) != RS_RET_OK) goto finalize_it;
if(pData->useCryprov) {
if((iRet = strm.Setcryprov(pData->pStrm, &pData->cryprov)) != RS_RET_OK) goto finalize_it;
if((iRet = strm.SetcryprovData(pData->pStrm, pData->cryprovData)) != RS_RET_OK) goto finalize_it;
}
if(pData->bUseAsyncWriter)
if((iRet = strm.SetiFlushInterval(pData->pStrm, pData->iFlushInterval)) != RS_RET_OK) goto finalize_it;
if(pData->pszSizeLimitCmd !=
((void *)0)
)
if((iRet = strm.SetpszSizeLimitCmd(pData->pStrm, (uchar*)strdup((char*)(pData->pszSizeLimitCmd)))) != RS_RET_OK) goto finalize_it;
if((iRet = strm.ConstructFinalize(pData->pStrm)) != RS_RET_OK) goto finalize_it;
if(pData->useSigprov)
sigprovPrepare(pData, szNameBuf);
finalize_it:
if(iRet != RS_RET_OK) {
if(pData->pStrm !=
((void *)0)
) {
closeFile(pData);
}
}
return iRet;
}
|
int prepareFile(struct_0 *a0, char *a1) {
unsigned int v0;
unsigned int v1;
char v2;
char v3;
unsigned long long v4;
char v5;
char v6;
unsigned long long v7;
char v8;
char v9;
char v10;
char v11;
unsigned long long v13;
v10 = *(&v10);
v7 = *(&v7);
v4 = *(&v4);
v0 = 0;
a0->field_38 = 0;
if (!access(a1, 0x0)) {
LABEL_400c8d:
strncpy(&v3, a1, 0x1000);
v5 = 0;
strncpy(&v6, dirname(&v3), 0x1000);
v8 = 0;
strncpy(&v3, a1, 0x1000);
v5 = 0;
strncpy(&v9, __xpg_basename(&v3), 0x1000);
v11 = 0;
v0 = *(4215784)(&a0->field_38);
if (!v0) {
v0 = *(4215872)(a0->field_38, &v9, strlen(&v9), &v9);
if (!v0) {
v0 = *(4215880)(a0->field_38, &v6, strlen(&v6), &v6);
if (!v0) {
v0 = g_4054d0(a0->field_38, a0->field_168, a0->field_168, g_4054d0);
if (!v0) {
v0 = g_405510(a0->field_38, a0->field_178, a0->field_178, g_405510);
if (!v0) {
v0 = g_4054e8(a0->field_38, a0->field_16c, a0->field_16c, g_4054e8);
if (!v0) {
v0 = g_4054b0(a0->field_38, 4, g_4054b0);
if (!v0) {
v0 = g_4054b8(a0->field_38, g_405604, g_4054b8, g_405604);
if (!v0) {
v0 = g_4054c0(a0->field_38, *((runModConf + 44)), *((runModConf + 44)), g_4054c0);
if (!v0) {
v0 = g_405488(a0->field_38, *((runModConf + 48)), *((runModConf + 48)), g_405488);
if (!v0) {
v0 = g_4054d8(a0->field_38, a0->field_50, a0->field_50, g_4054d8);
if (!v0) {
v0 = g_4054c8(a0->field_38, 0, g_4054c8);
if (!v0) {
v0 = g_4054f0(a0->field_38, a0->field_158, a0->field_158, g_4054f0);
if (!v0 && (!a0->field_140 || (v0 = g_405520(a0->field_38, a0 + 232, g_405520, a0 + 232), !v0 && !v0)) && (!a0->field_177 || (v0 = g_4054f8(a0->field_38, a0->field_170, a0->field_170, g_4054f8), !v0))) {
if (a0->field_160) {
v13 = strdup(a0->field_160);
v0 = *(0x405500)(a0->field_38, v13, v13);
if (!(!v0))
goto LABEL_4011c2;
}
v0 = *(4215792)(a0->field_38);
if (!v0 && a0->field_c8)
sigprovPrepare(a0, &v3);
}
}
}
}
}
}
}
}
}
}
}
}
}
} else {
if (!(a0->field_4c) || !(makeFileParentDirs(a1, strlen(a1), a0->field_48, a0->field_5c, a0->field_64, a0->field_68))) {
v1 = open(a1, 0x80541, a0->field_44);
if (v1 == -1)
goto LABEL_400c8d;
if (a0->field_58 == -1 && a0->field_60 == -1 || !fchown(v1, a0->field_58, a0->field_60)) {
close(v1);
goto LABEL_400c8d;
}
}
rs_strerror_r(*(__errno_location()), &v2, 0x400, &v2);
if (a0->field_4c && makeFileParentDirs(a1, strlen(a1), a0->field_48, a0->field_5c, a0->field_64, a0->field_68)) {
parser_errmsg("omfile: creating parent directories for file '%s' failed: %s");
v0 = -3000;
} else {
parser_errmsg("omfile: chown for file '%s' failed: %s");
if (a0->field_68) {
close(v1);
v0 = -3000;
} else {
close(v1);
goto LABEL_400c8d;
}
}
}
LABEL_4011c2:
if (v0 && a0->field_38)
closeFile(a0);
return v0;
}
|
static
_Bool
re_protect (char const *const_dst_name, int dst_dirfd, char const *dst_relname,
struct dir_attr *attr_list, const struct cp_options *x)
{
struct dir_attr *p;
char *dst_name;
char *src_name;
do { dst_name =
(__extension__ ({ const char *__old = (
const_dst_name
); size_t __len = strlen (__old) + 1; char *__new = (char *) __builtin_alloca (__len); (char *) memcpy (__new, __old, __len); }))
; } while (0);
src_name = dst_name + (dst_relname - const_dst_name);
for (p = attr_list; p; p = p->next)
{
dst_name[p->slash_offset] = '\0';
if (x->preserve_timestamps)
{
struct timespec timespec[2];
timespec[0] = get_stat_atime (&p->st);
timespec[1] = get_stat_mtime (&p->st);
if (utimensat (dst_dirfd, src_name, timespec, 0))
{
error (0,
(*__errno_location ())
, gettext ("failed to preserve times for %s"),
quotearg_style (shell_escape_always_quoting_style, dst_name));
return
0
;
}
}
if (x->preserve_ownership)
{
if (lchownat (dst_dirfd, src_name, p->st.st_uid, p->st.st_gid) != 0)
{
if (! chown_failure_ok (x))
{
error (0,
(*__errno_location ())
, gettext ("failed to preserve ownership for %s"),
quotearg_style (shell_escape_always_quoting_style, dst_name));
return
0
;
}
(__extension__ ({ __typeof__ (lchownat (dst_dirfd, src_name, -1, p->st.st_gid)) __x = (lchownat (dst_dirfd, src_name, -1, p->st.st_gid)); (void) __x; }));
}
}
if (x->preserve_mode)
{
if (copy_acl (src_name, -1, dst_name, -1, p->st.st_mode) != 0)
return
0
;
}
else if (p->restore_mode)
{
if (lchmodat (dst_dirfd, src_name, p->st.st_mode) != 0)
{
error (0,
(*__errno_location ())
, gettext ("failed to preserve permissions for %s"),
quotearg_style (shell_escape_always_quoting_style, dst_name));
return
0
;
}
}
dst_name[p->slash_offset] = '/';
}
return
1
;
}
|
int re_protect(void* a0, unsigned long a1, unsigned long a2, unsigned long long a3, char a4[32]) {
char v0;
unsigned int v1;
struct_0 *v2;
unsigned int v3;
unsigned long long v4;
char *v5;
unsigned long long v6;
unsigned long v7;
unsigned long v8;
unsigned long v9;
unsigned long v10;
unsigned long long v11;
char v12;
unsigned long v13;
unsigned int v15;
unsigned long long v16;
unsigned long long v17;
unsigned long long v18;
for (*(&v3) = strlen(a0) + 1; &v12 != &(&v0)[-1 * ((0 CONCAT 15 + *(&v3) + 8) /m 16 * 16 & -0x1000)]; v11 = v11);
if ((((0 CONCAT 15 + *(&v3) + 8) /m 16 * 16) & 4095))
*((&v11 + (((0 CONCAT 15 + *(&v3) + 8) /m 16 * 16) & 4095))) = *((&v11 + (((0 CONCAT 15 + *(&v3) + 8) /m 16 * 16) & 4095)));
v4 = (&v13 >> 4) * 16;
v5 = memcpy(v4, a0, *(&v3));
v6 = v5 + a2 - a0;
v2 = a3;
while (true) {
if (!v2) {
v15 = 1;
break;
} else {
v5[v2->field_98] = 0;
if (a4[31]) {
v7 = get_stat_atime(v2);
v8 = v2->field_98;
v9 = get_stat_mtime(v2);
v10 = a2;
if (utimensat(a1, v6, &v7, 0x0)) {
v16 = quotearg_style(0x4, v5);
error(0x0, *(__errno_location()), gettext("failed to preserve times for %s"));
v15 = 0;
break;
}
}
if (a4[29] && lchownat(a1, v6, v2->field_1c, v2->field_20)) {
if (!(chown_failure_ok(a4) ^ 1)) {
v1 = lchownat(a1, v6, 0xffffffff, v2->field_20);
} else {
v18 = quotearg_style(0x4, v5);
error(0x0, *(__errno_location()), gettext("failed to preserve ownership for %s"));
v15 = 0;
break;
}
}
if (a4[30]) {
if (copy_acl(v6, 0xffffffff, v5, 0xffffffff, v2->field_18)) {
v15 = 0;
break;
}
} else {
if (v2->field_90 && lchmodat(a1, v6, v2->field_18, v6)) {
v17 = quotearg_style(0x4, v5);
error(0x0, *(__errno_location()), gettext("failed to preserve permissions for %s"));
v15 = 0;
break;
}
}
v5[v2->field_98] = 47;
v2 = v2->field_a0;
}
}
return v15;
}
|
int
sshbuf_write_file(const char *path, struct sshbuf *buf)
{
int fd, oerrno;
if ((fd = open(path,
01
|
0100
|
01000
, 0644)) == -1)
return -24;
if (atomicio((ssize_t (*)(int, void *, size_t))write, fd, sshbuf_mutable_ptr(buf),
sshbuf_len(buf)) != sshbuf_len(buf) || close(fd) != 0) {
oerrno =
(*__errno_location ())
;
close(fd);
unlink(path);
(*__errno_location ())
= oerrno;
return -24;
}
return 0;
}
|
long sshbuf_write_file(const char *a1, long a2)
{
long v3;
long v4;
long v5;
unsigned int fd;
int v7;
fd = open(a1, 577, 420LL);
if ( fd == -1 )
return 4294967272LL;
v3 = sshbuf_len(a2);
v4 = sshbuf_mutable_ptr(a2);
v5 = atomicio(&write, fd, v4, v3);
if ( v5 == sshbuf_len(a2) && !close(fd) )
return 0LL;
v7 = *_errno_location();
close(fd);
unlink(a1);
*_errno_location() = v7;
return 4294967272LL;
}
|
int
sshbuf_get_bignum2(struct sshbuf *buf, BIGNUM **valp)
{
BIGNUM *v;
const u_char *d;
size_t len;
int r;
if (valp !=
((void *)0)
)
*valp =
((void *)0)
;
if ((r = sshbuf_get_bignum2_bytes_direct(buf, &d, &len)) != 0)
return r;
if (valp !=
((void *)0)
) {
if ((v = BN_new()) ==
((void *)0)
||
BN_bin2bn(d, len, v) ==
((void *)0)
) {
BN_clear_free(v);
return -2;
}
*valp = v;
}
return 0;
}
|
int sshbuf_get_bignum2(undefined8 param_1,BIGNUM **param_2)
{
int iVar1;
BIGNUM *pBVar2;
long in_FS_OFFSET;
uchar *local_28;
int local_20 [2];
BIGNUM *local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
if (param_2 != (BIGNUM **)0x0) {
*param_2 = (BIGNUM *)0x0;
}
iVar1 = sshbuf_get_bignum2_bytes_direct(param_1,&local_28,local_20);
if (iVar1 == 0) {
if (param_2 != (BIGNUM **)0x0) {
local_18 = BN_new();
if ((local_18 == (BIGNUM *)0x0) ||
(pBVar2 = BN_bin2bn(local_28,local_20[0],local_18), pBVar2 == (BIGNUM *)0x0)) {
BN_clear_free(local_18);
iVar1 = -2;
goto LAB_001000b1;
}
*param_2 = local_18;
}
iVar1 = 0;
}
LAB_001000b1:
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return iVar1;
}
__stack_chk_fail();
}
|
int
sshbuf_put(struct sshbuf *buf, const void *v, size_t len)
{
u_char *p;
int r;
if ((r = sshbuf_reserve(buf, len, &p)) < 0)
return r;
if (len != 0)
memcpy(p, v, len);
return 0;
}
|
void sshbuf_put(unsigned long long a0, void* a1, unsigned long a2) {
unsigned int v0;
char v1;
unsigned long long v3;
void* v4;
v0 = sshbuf_reserve(a0, a2, &v1, a2);
if (v0 < 0) {
v3 = v0;
} else {
if (a2)
memcpy(*(&v1), a1, a2);
v4 = 0;
}
return;
}
|
char *
user_from_uid(uid_t uid, int nouser)
{
static struct ncache {
uid_t uid;
char *name;
} c_uid[64];
static int pwopen;
static char nbuf[15];
struct passwd *pw;
struct ncache *cp;
cp = c_uid + (uid & (64 - 1));
if (cp->uid != uid || cp->name ==
((void *)0)
) {
if (pwopen == 0) {
pwopen = 1;
}
if ((pw = getpwuid(uid)) ==
((void *)0)
) {
if (nouser)
return (
((void *)0)
);
(void)snprintf(nbuf, sizeof(nbuf), "%lu", (u_long)uid);
}
cp->uid = uid;
if (cp->name !=
((void *)0)
)
free(cp->name);
cp->name = strdup(pw ? pw->pw_name : nbuf);
}
return (cp->name);
}
|
undefined8 user_from_uid(uint param_1,int param_2)
{
long lVar1;
passwd *ppVar2;
undefined1 *__s;
char *pcVar3;
lVar1 = (ulong)(param_1 & 0x3f) * 0x10;
if ((param_1 != *(uint *)(c_uid_6366 + lVar1)) || (*(long *)(c_uid_6366 + lVar1 + 8) == 0)) {
if (pwopen_6367 == 0) {
pwopen_6367 = 1;
}
ppVar2 = getpwuid(param_1);
if (ppVar2 == (passwd *)0x0) {
if (param_2 != 0) {
return 0;
}
snprintf(nbuf_6368,0xf,"%lu",(ulong)param_1);
}
*(uint *)(c_uid_6366 + lVar1) = param_1;
if (*(long *)(c_uid_6366 + lVar1 + 8) != 0) {
free(*(void **)(c_uid_6366 + lVar1 + 8));
}
if (ppVar2 == (passwd *)0x0) {
__s = nbuf_6368;
}
else {
__s = ppVar2->pw_name;
}
pcVar3 = strdup(__s);
*(char **)(c_uid_6366 + lVar1 + 8) = pcVar3;
}
return *(undefined8 *)(c_uid_6366 + lVar1 + 8);
}
|
static void gtp_print_help(struct link_util *lu, int argc, char **argv,
FILE *f)
{
print_explain(f);
}
|
void gtp_print_help(void)
{
undefined8 in_RCX;
print_explain(in_RCX);
return;
}
|
static int
visible_and_exported (var)
SHELL_VAR *var;
{
return (((((var)->attributes) & (0x0001000))) == 0 && ((((var)->attributes) & (0x0000001))));
}
|
long long visible_and_exported(struct_0 *a0) {
unsigned long long v1;
if (!(a0->field_28 & 0x1000) && (a0->field_28 & 1))
v1 = 1;
if (!(a0->field_28 & 1) || (a0->field_28 & 0x1000))
v1 = 0;
return v1;
}
|
static
_Bool
skip_devices (
_Bool
command_line)
{
return (devices == SKIP_DEVICES
|| ((devices == READ_COMMAND_LINE_DEVICES) & !command_line));
}
|
int skip_devices(unsigned long a0) {
unsigned int v1;
unsigned int v2;
if (devices != 2 && !((a0 ^ 1) & !devices))
v1 = 0;
if (devices == 2 || ((a0 ^ 1) & !devices))
v1 = 1;
v2 = v1 & 1;
return v2;
}
|
static int
do_ls_dir(struct sftp_conn *conn, const char *path,
const char *strip_path, int lflag)
{
int n;
u_int c = 1, colspace = 0, columns = 1;
SFTP_DIRENT **d;
if ((n = do_readdir(conn, path, &d)) != 0)
return (n);
if (!(lflag & 0x0002)) {
u_int m = 0, width = 80;
struct winsize ws;
char *tmp;
for (n = 0; d[n] !=
((void *)0)
; n++) {
if (d[n]->filename[0] != '.' || (lflag & 0x0080))
m = (((m) > (strlen(d[n]->filename))) ? (m) : (strlen(d[n]->filename)));
}
tmp = path_strip(path, strip_path);
m += strlen(tmp);
free(tmp);
if (ioctl(fileno(
stdin
),
0x5413
, &ws) != -1)
width = ws.ws_col;
columns = width / (m + 2);
columns = (((columns) > (1)) ? (columns) : (1));
colspace = width / columns;
colspace = (((colspace) < (width)) ? (colspace) : (width));
}
if (lflag & (0x0008|0x0010|0x0020)) {
for (n = 0; d[n] !=
((void *)0)
; n++)
;
sort_flag = lflag & ((0x0008|0x0010|0x0020)|0x0040);
qsort(d, n, sizeof(*d), sdirent_comp);
}
get_remote_user_groups_from_dirents(conn, d);
for (n = 0; d[n] !=
((void *)0)
&& !interrupted; n++) {
char *tmp, *fname;
if (d[n]->filename[0] == '.' && !(lflag & 0x0080))
continue;
tmp = path_append(path, d[n]->filename);
fname = path_strip(tmp, strip_path);
free(tmp);
if (lflag & 0x0001) {
if ((lflag & (0x0004|0x0100)) != 0 ||
can_get_users_groups_by_id(conn)) {
char *lname;
struct stat sb;
memset(&sb, 0, sizeof(sb));
attrib_to_stat(&d[n]->a, &sb);
lname = ls_file(fname, &sb, 1,
(lflag & 0x0100),
ruser_name(sb.st_uid),
rgroup_name(sb.st_gid));
mprintf("%s\n", lname);
free(lname);
} else
mprintf("%s\n", d[n]->longname);
} else {
mprintf("%-*s", colspace, fname);
if (c >= columns) {
printf("\n");
c = 1;
} else
c++;
}
free(fname);
}
if (!(lflag & 0x0001) && (c != 1))
printf("\n");
free_sftp_dirents(d);
return (0);
}
|
int do_ls_dir(unsigned long long a0, unsigned long long a1, char *a2, unsigned long a3) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
char v6;
void* v7;
void* v8;
void* v9;
void* v10;
char v11;
char v12;
char v13;
char v14;
unsigned int v16;
v1 = 1;
v2 = 0;
v3 = 1;
v0 = do_readdir(a0, a1, &v6, a1);
if (v0) {
v16 = v0;
return v16;
}
if (!(a3 & 2)) {
v4 = 0;
v5 = 80;
for (v0 = 0; *((*(&v6) + (v0 << 3))); v0 = __addvsi3(v0, 0x1)) {
if (*(*(*((*(&v6) + (v0 << 3))))) != 46 || (a3 & 128)) {
if (v4 > strlen(*(*((*(&v6) + (v0 << 3))))))
v16 = v4;
else
v16 = strlen(*(*((*(&v6) + v0 * 8))));
v4 = v16;
}
}
v7 = path_strip(a1, a2);
v4 += strlen(v7);
free(v7);
if (ioctl(fileno(stdin), 0x5413) != -1)
v5 = *(&v11);
v3 = (0 CONCAT v5) /m (v4 + 2);
v16 = (v3 ? 1 : v3);
v3 = v16;
v2 = (0 CONCAT v5) /m v3;
v16 = v2;
if (v5 <= v2)
v16 = v5;
v2 = v16;
}
if ((a3 & 56)) {
for (v0 = 0; *((*(&v6) + (v0 << 3))); v0 = __addvsi3(v0, 0x1));
sort_flag = a3 & 120;
qsort(*(&v6), v0, 0x8, sdirent_comp);
}
get_remote_user_groups_from_dirents(a0, *(&v6), *(&v6));
for (v0 = 0; *((*(&v6) + (v0 << 3))) && !interrupted; v0 = __addvsi3(v0, 0x1)) {
if (*(*(*((*(&v6) + (v0 << 3))))) != 46 || (a3 & 128)) {
v8 = path_append(a1, *(*((*(&v6) + v0 * 8))), *(*((*(&v6) + v0 * 8))));
v9 = path_strip(v8, a2);
free(v8);
if (!(a3 & 1)) {
mprintf("%-*s", v2, v9);
if (v1 < v3) {
v1 += 1;
} else {
printf("\n");
v1 = 1;
}
} else if ((a3 & 260) || can_get_users_groups_by_id(a0)) {
memset(&v12, 0x0, 0x90);
attrib_to_stat(*((*(&v6) + v0 * 8)) + 16, &v12, *((*(&v6) + v0 * 8)) + 16);
v10 = ls_file(v9, &v12, 0x1, a3 & 0x100, ruser_name(*(&v13)), rgroup_name(*(&v14)));
mprintf("%s\n", v10, 0x1);
free(v10);
} else {
mprintf("%s\n", *((*((*(&v6) + v0 * 8)) + 8)), v0 * 8);
}
free(v9);
}
}
if (!(a3 & 1) && v1 != 1)
printf("\n");
free_sftp_dirents(*(&v6));
v16 = 0;
return v16;
}
|
vi_change_case(EditLine *el, wint_t c)
{
int i;
if (el->el_line.cursor >= el->el_line.lastchar)
return 6;
cv_undo(el);
for (i = 0; i < el->el_state.argument; i++) {
c = *el->el_line.cursor;
if (iswupper(c))
*el->el_line.cursor = towlower(c);
else if (iswlower(c))
*el->el_line.cursor = towupper(c);
if (++el->el_line.cursor >= el->el_line.lastchar) {
el->el_line.cursor--;
re_fastaddc(el);
break;
}
re_fastaddc(el);
}
return 0;
}
|
long long vi_change_case(struct_0 *a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned long long v3;
v0 = a1;
if (a0->field_58 >= a0->field_60) {
v3 = 6;
} else {
cv_undo(a0);
v1 = 0;
while (true) {
if (v1 >= a0->field_78)
break;
v0 = a0->field_58->field_0;
if (iswupper(v0)) {
a0->field_58->field_0 = towlower(v0);
} else if (iswlower(v0)) {
a0->field_58->field_0 = towupper(v0);
}
a0->field_58 = a0->field_58 + 1;
if (a0->field_58 < a0->field_60) {
re_fastaddc(a0);
v1 += 1;
} else {
a0->field_58 = a0->field_58 + 1;
re_fastaddc(a0);
break;
}
}
v3 = 0;
}
return v3;
}
|
void
ssh_packet_close(struct ssh *ssh)
{
ssh_packet_close_internal(ssh, 1);
}
|
void ssh_packet_close(undefined8 param_1)
{
ssh_packet_close_internal(param_1,1);
return;
}
|
void
complete_pending_execdirs (void)
{
if (state.execdirs_outstanding)
{
do_complete_pending_execdirs (get_eval_tree());
state.execdirs_outstanding =
0
;
}
}
|
void complete_pending_execdirs() {
unsigned long long v1;
unsigned long long v2;
v1 = uname;
if (uname) {
v2 = do_complete_pending_execdirs(get_eval_tree());
uname = 0;
return;
}
return;
}
|
const char *const *
findstring(const char *s, const char *const *array, size_t nmemb)
{
return bsearch(&s, array, nmemb, sizeof(const char *), pstrcmp);
}
|
long long findstring(unsigned long a0, unsigned long long a1, unsigned long long a2) {
unsigned long v0;
v0 = a0;
return bsearch(&v0, a1, a2, 0x8, pstrcmp);
}
|
static void
print_all_completions ()
{
progcomp_walk (print_compitem);
}
|
void print_all_completions() {
unsigned long long v1;
v1 = progcomp_walk(print_compitem);
return;
}
|
static void
freeline (struct line *line)
{
if (line ==
((void *)0)
)
return;
free (line->fields);
line->fields =
((void *)0)
;
free (line->buf.buffer);
line->buf.buffer =
((void *)0)
;
}
|
void freeline(unsigned long long a0[6]) {
unsigned long long v1[6];
if (a0) {
free(a0[5]);
a0[5] = 0;
free(a0[2]);
v1 = a0;
a0[2] = 0;
return;
}
return;
}
|
static int
ifsync (int fd)
{
int ret;
do
{
process_signals ();
ret = fsync (fd);
}
while (ret < 0 &&
(*__errno_location ())
==
4
);
return ret;
}
|
int ifsync(unsigned long a0) {
unsigned int v0;
unsigned int v2;
unsigned int v3;
unsigned long long v4;
unsigned int v5;
unsigned int v6;
while (true) {
process_signals(a0, v2, v3, v4, v5, v6);
v0 = fsync(a0);
if (v0 >= 0)
break;
if (*(__errno_location()) != 4)
break;
}
return v0;
}
|
static inline void
emit_mandatory_arg_note (void)
{
fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"),
stdout
)
;
}
|
void emit_mandatory_arg_note() {
unsigned long long v1;
v1 = fputs_unlocked(gettext("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout);
return;
}
|
static void
delay_set_stat (char const *file_name, struct tar_stat_info const *st,
mode_t current_mode, mode_t current_mode_mask,
mode_t mode, int atflag)
{
size_t file_name_len = strlen (file_name);
struct delayed_set_stat *data;
for (data = delayed_set_stat_head; data; data = data->next)
if (strcmp (data->file_name, file_name) == 0)
break;
if (data)
{
if (data->interdir)
{
struct stat real_st;
if (fstatat (chdir_fd, data->file_name,
&real_st, data->atflag) != 0)
{
stat_error (data->file_name);
}
else
{
data->dev = real_st.st_dev;
data->ino = real_st.st_ino;
}
}
}
else
{
data = xmalloc (sizeof (*data));
data->next = delayed_set_stat_head;
delayed_set_stat_head = data;
data->file_name_len = file_name_len;
data->file_name = xstrdup (file_name);
data->after_links =
0
;
if (st)
{
data->dev = st->stat.st_dev;
data->ino = st->stat.st_ino;
}
}
data->mode = mode;
if (st)
{
data->uid = st->stat.st_uid;
data->gid = st->stat.st_gid;
data->atime = st->atime;
data->mtime = st->mtime;
}
data->current_mode = current_mode;
data->current_mode_mask = current_mode_mask;
data->interdir = ! st;
data->atflag = atflag;
data->change_dir = chdir_current;
data->cntx_name =
((void *)0)
;
if (st)
assign_string (&data->cntx_name, st->cntx_name);
if (st && st->acls_a_ptr)
{
data->acls_a_ptr = xmemdup (st->acls_a_ptr, st->acls_a_len + 1);
data->acls_a_len = st->acls_a_len;
}
else
{
data->acls_a_ptr =
((void *)0)
;
data->acls_a_len = 0;
}
if (st && st->acls_d_ptr)
{
data->acls_d_ptr = xmemdup (st->acls_d_ptr, st->acls_d_len + 1);
data->acls_d_len = st->acls_d_len;
}
else
{
data->acls_d_ptr =
((void *)0)
;
data->acls_d_len = 0;
}
if (st)
xheader_xattr_copy (st, &data->xattr_map, &data->xattr_map_size);
else
{
data->xattr_map =
((void *)0)
;
data->xattr_map_size = 0;
}
if (must_be_dot_or_slash (file_name))
mark_after_links (data);
}
|
unsigned long delay_set_stat(const char *a1, long a2, int a3, int a4, int a5, int a6)
{
long v6;
long v7;
long i;
size_t v14;
struct stat buf;
unsigned long v16;
v16 = __readfsqword(0x28u);
v14 = strlen(a1);
for ( i = delayed_set_stat_head; i && strcmp(*(const char **)(i + 160), a1); i = *(_QWORD *)i )
;
if ( i )
{
if ( *(_BYTE *)(i + 80) )
{
if ( fstatat(chdir_fd, *(const char **)(i + 160), &buf, *(_DWORD *)(i + 84)) )
{
stat_error(*(_QWORD *)(i + 160));
}
else
{
*(_QWORD *)(i + 8) = buf.st_dev;
*(_QWORD *)(i + 16) = buf.st_ino;
}
}
}
else
{
i = xmalloc(168LL);
*(_QWORD *)i = delayed_set_stat_head;
delayed_set_stat_head = i;
*(_QWORD *)(i + 152) = v14;
*(_QWORD *)(i + 160) = xstrdup(a1);
*(_BYTE *)(i + 88) = 0;
if ( a2 )
{
*(_QWORD *)(i + 8) = *(_QWORD *)(a2 + 88);
*(_QWORD *)(i + 16) = *(_QWORD *)(a2 + 96);
}
}
*(_DWORD *)(i + 24) = a5;
if ( a2 )
{
*(_DWORD *)(i + 28) = *(_DWORD *)(a2 + 116);
*(_DWORD *)(i + 32) = *(_DWORD *)(a2 + 120);
v6 = *(_QWORD *)(a2 + 240);
*(_QWORD *)(i + 40) = *(_QWORD *)(a2 + 232);
*(_QWORD *)(i + 48) = v6;
v7 = *(_QWORD *)(a2 + 256);
*(_QWORD *)(i + 56) = *(_QWORD *)(a2 + 248);
*(_QWORD *)(i + 64) = v7;
}
*(_DWORD *)(i + 72) = a3;
*(_DWORD *)(i + 76) = a4;
*(_BYTE *)(i + 80) = a2 == 0;
*(_DWORD *)(i + 84) = a6;
*(_DWORD *)(i + 92) = chdir_current;
*(_QWORD *)(i + 96) = 0LL;
if ( a2 && (assign_string(i + 96, *(_QWORD *)(a2 + 48)), *(_QWORD *)(a2 + 56)) )
{
*(_QWORD *)(i + 104) = xmemdup(*(_QWORD *)(a2 + 56), *(_QWORD *)(a2 + 64) + 1LL);
*(_QWORD *)(i + 112) = *(_QWORD *)(a2 + 64);
}
else
{
*(_QWORD *)(i + 104) = 0LL;
*(_QWORD *)(i + 112) = 0LL;
}
if ( a2 && *(_QWORD *)(a2 + 72) )
{
*(_QWORD *)(i + 120) = xmemdup(*(_QWORD *)(a2 + 72), *(_QWORD *)(a2 + 80) + 1LL);
*(_QWORD *)(i + 128) = *(_QWORD *)(a2 + 80);
}
else
{
*(_QWORD *)(i + 120) = 0LL;
*(_QWORD *)(i + 128) = 0LL;
}
if ( a2 )
{
xheader_xattr_copy(a2, i + 144, i + 136);
}
else
{
*(_QWORD *)(i + 144) = 0LL;
*(_QWORD *)(i + 136) = 0LL;
}
if ( (unsigned char)must_be_dot_or_slash(a1) )
mark_after_links((long *)i);
return __readfsqword(0x28u) ^ v16;
}
|
static int
history_set_nth(void *p, HistEventW *ev, int n)
{
history_t *h = (history_t *) p;
if (h->cur == 0) {
{ ev->num = 5; ev->str = he_errlist[5]; };
return -1;
}
for (h->cursor = h->list.prev; h->cursor != &h->list;
h->cursor = h->cursor->prev)
if (n-- <= 0)
break;
if (h->cursor == &h->list) {
{ ev->num = 9; ev->str = he_errlist[9]; };
return -1;
}
return 0;
}
|
int history_set_nth(struct_1 *a0, struct_0 *a1, unsigned long a2) {
unsigned int v0;
unsigned int v2;
unsigned int v3;
v0 = a2;
if (!a0->field_34) {
a1->field_0 = 5;
a1->field_8 = "e";
v2 = -1;
} else {
a0->field_28 = a0->field_20;
while (true) {
if (a0->field_28 == a0)
break;
v3 = v0;
v0 -= 1;
if (v3 <= 0)
break;
a0->field_28 = a0->field_28->field_20;
}
if (a0->field_28 != a0) {
v2 = 0;
} else {
a1->field_0 = 9;
a1->field_8 = "e";
v2 = -1;
}
}
return v2;
}
|
static void
dump_cfg_strarray(OpCodes code, u_int count, char **vals)
{
u_int i;
for (i = 0; i < count; i++)
printf("%s %s\n", lookup_opcode_name(code), vals[i]);
}
|
void dump_cfg_strarray(unsigned long a0, unsigned long a1, unsigned long long *a2) {
unsigned int v0;
unsigned long long v2;
v0 = 0;
while (true) {
v2 = v0;
if (v0 >= a1)
break;
printf("%s %s\n", lookup_opcode_name(a0), a2[v0]);
v0 += 1;
}
return;
}
|
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]\n"), program_name);
fputs_unlocked (gettext ("Print the user's login name.\n\n"),
stdout
)
;
fputs_unlocked (gettext (" --help display this help and exit\n"),
stdout
);
fputs_unlocked (gettext (" --version output version information and exit\n"),
stdout
);
emit_ancillary_info ("logname");
}
exit (status);
}
|
void usage(int a1)
{
long v1;
char *v2;
char *v3;
FILE *v4;
char *v5;
FILE *v6;
char *v7;
FILE *v8;
char *v9;
v1 = program_name;
if ( a1 )
{
v2 = gettext("Try '%s --help' for more information.\n");
fprintf(stderr, v2, v1);
}
else
{
v3 = gettext("Usage: %s [OPTION]\n");
printf(v3, v1);
v4 = stdout;
v5 = gettext("Print the user's login name.\n\n");
fputs_unlocked(v5, v4);
v6 = stdout;
v7 = gettext(" --help display this help and exit\n");
fputs_unlocked(v7, v6);
v8 = stdout;
v9 = gettext(" --version output version information and exit\n");
fputs_unlocked(v9, v8);
emit_ancillary_info("logname");
}
exit(a1);
}
|
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;
}
|
SHELL_VAR *
assign_array_var_from_string (var, value, flags)
SHELL_VAR *var;
char *value;
int flags;
{
WORD_LIST *nlist;
if (value == 0)
return var;
nlist = expand_compound_array_assignment (var, value, flags);
assign_compound_array_list (var, nlist, flags);
if (nlist)
dispose_words (nlist);
if (var)
((var)->attributes &= ~(0x0001000));
return (var);
}
|
long assign_array_var_from_string(long a1, _BYTE *a2, unsigned int a3)
{
int v4;
long *v6;
if ( !a2 )
return a1;
v6 = expand_compound_array_assignment(a1, a2);
assign_compound_array_list((long *)a1, (_QWORD **)v6, a3);
if ( v6 )
dispose_words(v6);
if ( a1 )
{
v4 = *(_DWORD *)(a1 + 40);
BYTE1(v4) &= ~0x10u;
*(_DWORD *)(a1 + 40) = v4;
}
return a1;
}
|
static char *
read_check_passphrase(const char *prompt1, const char *prompt2,
const char *retry_prompt)
{
char *passphrase1, *passphrase2;
for (;;) {
passphrase1 = read_passphrase(prompt1, 0x0002);
passphrase2 = read_passphrase(prompt2, 0x0002);
if (strcmp(passphrase1, passphrase2) == 0) {
freezero(passphrase2, strlen(passphrase2));
return passphrase1;
}
freezero(passphrase1, strlen(passphrase1));
freezero(passphrase2, strlen(passphrase2));
fputs(retry_prompt,
stdout
);
fputc('\n',
stdout
);
fflush(
stdout
);
}
return
((void *)0)
;
}
|
void read_check_passphrase(unsigned long long a0, unsigned long long a1, char *a2) {
char *v0;
char *v1;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
while (true) {
*(&v0) = read_passphrase(a0, 0x2);
v1 = read_passphrase(a1, 0x2);
if (!strcmp(v0, v1))
break;
v4 = strlen(v0);
freezero(v0, v4, v4);
v5 = strlen(v1);
freezero(v1, v5, v5);
fputs(a2, stdout);
fputc(0xa, stdout);
fflush(stdout);
}
v6 = strlen(v1);
freezero(v1, v6, v6);
v7 = v0;
return;
}
|
static void
write_unique (struct line const *line, FILE *tfp, char const *temp_output)
{
if (unique)
{
if (saved_line.text && ! compare (line, &saved_line))
return;
saved_line = *line;
}
write_line (line, tfp, temp_output);
}
|
void write_unique(unsigned long long a0[4], void* a1, unsigned long long a2) {
unsigned long long v0;
int tmp_15;
unsigned long long v1[4];
unsigned long long v4;
unsigned long long v5;
v1[0] = a0;
v0 = a2;
if (unique) {
if (saved_line && !compare(a0, &saved_line))
goto LABEL_407ca7;
tmp_15 = a0[1];
saved_line = a0[0];
g_40b388 = tmp_15;
v4 = a0[3];
g_40b390 = a0[2];
g_40b398 = v4;
}
v5 = write_line(a0, a1, v0);
LABEL_407ca7:
return;
}
|
static int duplicate_search_and_fix(e2fsck_t ctx, ext2_filsys fs,
ext2_ino_t ino,
struct fill_dir_struct *fd,
const struct name_cmp_ctx *cmp_ctx)
{
struct problem_context pctx;
struct hash_entry *ent, *prev;
blk_t i, j;
int fixed = 0;
char new_name[256];
unsigned int new_len;
int hash_alg;
int hash_flags = fd->inode->i_flags & 0x40000000;
clear_problem_context(&pctx);
pctx.ino = ino;
hash_alg = fs->super->s_def_hash_version;
if ((hash_alg <= 2) &&
(fs->super->s_flags & 0x0002))
hash_alg += 3;
for (i=1; i < fd->num_array; i++) {
ent = fd->harray + i;
prev = ent - 1;
if (!ent->dir->inode ||
!same_name(cmp_ctx, ent->dir->name,
ext2fs_dirent_name_len(ent->dir),
prev->dir->name,
ext2fs_dirent_name_len(prev->dir)))
continue;
pctx.dirent = ent->dir;
if ((ent->dir->inode == prev->dir->inode) &&
fix_problem(ctx, 0x020041, &pctx)) {
e2fsck_adjust_inode_count(ctx, ent->dir->inode, -1);
ent->dir->inode = 0;
fixed++;
continue;
}
if (fd->inode->i_flags & 0x00000800) {
if (fix_problem(ctx, 0x020054, &pctx)) {
e2fsck_adjust_inode_count(ctx, ent->dir->inode, -1);
ent->dir->inode = 0;
fixed++;
continue;
}
}
new_len = ext2fs_dirent_name_len(ent->dir);
if (new_len == 0) {
ext2fs_unmark_valid(fs);
continue;
}
memcpy(new_name, ent->dir->name, new_len);
mutate_name(new_name, &new_len);
for (j=0; j < fd->num_array; j++) {
if ((i==j) ||
!same_name(cmp_ctx, new_name, new_len,
fd->harray[j].dir->name,
ext2fs_dirent_name_len(fd->harray[j].dir))) {
continue;
}
mutate_name(new_name, &new_len);
j = -1;
}
new_name[new_len] = 0;
pctx.str = new_name;
if (fix_problem(ctx, 0x020042, &pctx)) {
memcpy(ent->dir->name, new_name, new_len);
ext2fs_dirent_set_name_len(ent->dir, new_len);
ext2fs_dirhash2(hash_alg, new_name, new_len,
fs->encoding, hash_flags,
fs->super->s_hash_seed,
&ent->hash, &ent->minor_hash);
fixed++;
}
}
return fixed;
}
|
int duplicate_search_and_fix(unsigned long long a0, struct_0 *a1, unsigned long a2, struct_3 *a3, void* a4) {
unsigned long v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
struct_5 *v7;
struct_5 *v8;
char v9;
unsigned int v10;
unsigned int *v11;
char *v12;
char v13;
v4 = 0;
v6 = a3->field_8->field_20 & 0x40000000;
clear_problem_context(&v9);
v10 = a2;
v5 = a1->field_20->field_fc;
if (v5 <= 2 && (a1->field_20->field_160 & 2))
v5 += 3;
for (v2 = 1; v2 < a3->field_34; v2 += 1) {
v7 = v2 * 24 + a3->field_28;
v8 = v7 + 1;
if (!(!v7->field_10->field_0 || !same_name(a4, v7->field_10 + 2, ext2fs_dirent_name_len(v7->field_10), v8->field_10 + 2, ext2fs_dirent_name_len(v8->field_10)))) {
v11 = &v7->field_10->field_0;
if (!(v7->field_10->field_0 != v8->field_10->field_0 || !fix_problem(a0, 0x20041, &v9))) {
e2fsck_adjust_inode_count(a0, v7->field_10->field_0, 0xffffffff, v7->field_10->field_0);
v7->field_10->field_0 = 0;
v4 += 1;
} else if (!(a3->field_8->field_20 & 0x800) || !fix_problem(a0, 0x20054, &v9)) {
v1 = ext2fs_dirent_name_len(v7->field_10);
if (!v1) {
ext2fs_unmark_valid(a1);
} else {
memcpy(&v13, v7->field_10 + 2, v1);
mutate_name(&v13, &v1);
for (v3 = 0; v3 < a3->field_34; v3 += 1) {
if (!(v2 == v3 || !same_name(a4, &v13, v1, *((((v3 << 1) + v3 << 3) + a3->field_28 + 16)) + 8, ext2fs_dirent_name_len(*((((v3 << 1) + v3 << 3) + a3->field_28 + 16)))))) {
mutate_name(&v13, &v1);
v3 = -1;
}
}
(&v13)[v1] = 0;
v12 = &v13;
if (fix_problem(a0, 0x20042, &v9)) {
memcpy(v7->field_10 + 2, &v13, v1);
ext2fs_dirent_set_name_len(v7->field_10, v1, v1);
v0 = &v7->padding_0[4];
ext2fs_dirhash2(v5, &v13, v1, a1->field_168, v6, &a1->field_20->padding_0[236], v7);
v4 += 1;
}
}
} else {
e2fsck_adjust_inode_count(a0, v7->field_10->field_0, 0xffffffff, v7->field_10->field_0);
v7->field_10->field_0 = 0;
v4 += 1;
}
}
}
return v4;
}
|
static void
to_base256 (int negative, uintmax_t value, char *where, size_t size)
{
uintmax_t v = value;
uintmax_t propagated_sign_bits =
((uintmax_t) - negative << (8 * sizeof v - 8));
size_t i = size;
do
{
where[--i] = v & ((1 << 8) - 1);
v = propagated_sign_bits | (v >> 8);
}
while (i);
}
|
void to_base256(unsigned long a0, unsigned long a1, char *a2, unsigned long a3) {
unsigned int v0;
unsigned long long v1;
char *v2;
unsigned long v3;
unsigned long long v5;
v0 = a0;
v1 = a1;
v3 = -(v0) * 0x100000000000000;
v2 = a3;
do {
v2 += 1;
*((v2 + a2)) = v1;
v5 = v1 >> 8 | v3;
v1 = v1 >> 8 | v3;
} while (v2);
return;
}
|
char *
sysinttostr (uintmax_t value, intmax_t minval, uintmax_t maxval,
char buf[SYSINT_BUFSIZE])
{
if (value <= maxval)
return umaxtostr (value, buf);
else
{
intmax_t i = value - minval;
return imaxtostr (i + minval, buf);
}
}
|
long sysinttostr(unsigned long a1, long a2, unsigned long a3, long a4)
{
if ( a1 > a3 )
return imaxtostr(a1, a4);
else
return umaxtostr(a1, a4);
}
|
static int
update_card(int agent_fd, int add, const char *id, int qflag,
struct dest_constraint **dest_constraints, size_t ndest_constraints)
{
char *pin =
((void *)0)
;
int r, ret = -1;
if (add) {
if ((pin = read_passphrase("Enter passphrase for PKCS#11: ",
0x0002)) ==
((void *)0)
)
return -1;
}
if ((r = ssh_update_card(agent_fd, add, id, pin ==
((void *)0)
? "" : pin,
lifetime, confirm, dest_constraints, ndest_constraints)) == 0) {
ret = 0;
if (!qflag) {
fprintf(
stderr
, "Card %s: %s\n",
add ? "added" : "removed", id);
}
} else {
fprintf(
stderr
, "Could not %s card \"%s\": %s\n",
add ? "add" : "remove", id, ssh_err(r));
ret = -1;
}
free(pin);
return ret;
}
|
undefined4
update_card(undefined4 param_1,int param_2,undefined8 param_3,int param_4,undefined8 param_5,
undefined8 param_6)
{
int iVar1;
undefined *puVar2;
char *pcVar3;
undefined8 uVar4;
undefined4 local_18;
undefined *local_10;
local_10 = (undefined *)0x0;
if ((param_2 == 0) ||
(local_10 = (undefined *)read_passphrase("Enter passphrase for PKCS#11: ",2),
local_10 != (undefined *)0x0)) {
puVar2 = local_10;
if (local_10 == (undefined *)0x0) {
puVar2 = &DAT_001033df;
}
iVar1 = ssh_update_card(param_1,param_2,param_3,puVar2,lifetime,confirm,param_5,param_6);
if (iVar1 == 0) {
local_18 = 0;
if (param_4 == 0) {
if (param_2 == 0) {
pcVar3 = "removed";
}
else {
pcVar3 = "added";
}
fprintf(stderr,"Card %s: %s\n",pcVar3,param_3);
}
}
else {
uVar4 = ssh_err(iVar1);
if (param_2 == 0) {
pcVar3 = "remove";
}
else {
pcVar3 = "add";
}
fprintf(stderr,"Could not %s card \"%s\": %s\n",pcVar3,param_3,uVar4);
local_18 = 0xffffffff;
}
free(local_10);
}
else {
local_18 = 0xffffffff;
}
return local_18;
}
|
static
_Bool
expr (void)
{
if (pos >= argc)
beyond ();
return or ();
}
|
int expr() {
if (pos >= argc)
beyond();
return or();
}
|
static void print_ndtconfig(const struct ndt_config *ndtc)
{
print_uint(PRINT_ANY, "key_length",
" config key_len %u ", ndtc->ndtc_key_len);
print_uint(PRINT_ANY, "entry_size",
"entry_size %u ", ndtc->ndtc_entry_size);
print_uint(PRINT_ANY, "entries", "entries %u ", ndtc->ndtc_entries);
print_nl();
print_string(PRINT_ANY, "last_flush",
" last_flush %s ",
ntable_strtime_delta(ndtc->ndtc_last_flush));
print_string(PRINT_ANY, "last_rand",
"last_rand %s ",
ntable_strtime_delta(ndtc->ndtc_last_rand));
print_nl();
print_uint(PRINT_ANY, "hash_rnd",
" hash_rnd %u ", ndtc->ndtc_hash_rnd);
print_0xhex(PRINT_ANY, "hash_mask",
"hash_mask %08llx ", ndtc->ndtc_hash_mask);
print_uint(PRINT_ANY, "hash_chain_gc",
"hash_chain_gc %u ", ndtc->ndtc_hash_chain_gc);
print_uint(PRINT_ANY, "proxy_qlen",
"proxy_qlen %u ", ndtc->ndtc_proxy_qlen);
print_nl();
}
|
long print_ndtconfig(unsigned short *a1)
{
char *v1;
char *v2;
print_uint(4u, (long)"key_length", (long)" config key_len %u ", *a1);
print_uint(4u, (long)"entry_size", (long)"entry_size %u ", a1[1]);
print_uint(4u, (long)"entries", (long)"entries %u ", *((_DWORD *)a1 + 1));
print_nl(4LL);
v1 = ntable_strtime_delta(*((_DWORD *)a1 + 2));
print_string(4u, (long)"last_flush", " last_flush %s ", (long)v1);
v2 = ntable_strtime_delta(*((_DWORD *)a1 + 3));
print_string(4u, (long)"last_rand", "last_rand %s ", (long)v2);
print_nl(4LL);
print_uint(4u, (long)"hash_rnd", (long)" hash_rnd %u ", *((_DWORD *)a1 + 4));
print_0xhex(4u, (long)"hash_mask", (long)"hash_mask %08llx ", *((unsigned int *)a1 + 5));
print_uint(4u, (long)"hash_chain_gc", (long)"hash_chain_gc %u ", *((_DWORD *)a1 + 6));
print_uint(4u, (long)"proxy_qlen", (long)"proxy_qlen %u ", *((_DWORD *)a1 + 7));
return print_nl(4LL);
}
|
static int test_do_handshake(gnutls_session_t session)
{
int ret, alert;
do {
ret = gnutls_handshake(session);
}
while (ret < 0 && gnutls_error_is_fatal(ret) == 0);
handshake_output = ret;
if (ret < 0 && verbose > 1) {
if (ret == -12) {
alert = gnutls_alert_get(session);
printf("\n");
printf("*** Received alert [%d]: %s\n",
alert, gnutls_alert_get_name(alert));
}
}
if (ret < 0)
return TEST_FAILED;
gnutls_session_get_data(session,
((void *)0)
, &session_data_size);
if (sfree != 0) {
free(session_data);
sfree = 0;
}
session_data = malloc(session_data_size);
sfree = 1;
if (session_data ==
((void *)0)
) {
fprintf(
stderr
, "Memory error\n");
exit(1);
}
gnutls_session_get_data(session, session_data, &session_data_size);
session_id_size = sizeof(session_id);
gnutls_session_get_id(session, session_id, &session_id_size);
return TEST_SUCCEED;
}
|
long test_do_handshake(long a1)
{
const char *name;
int v3;
unsigned int v4;
do
v3 = gnutls_handshake(a1);
while ( v3 < 0 && !(unsigned int)gnutls_error_is_fatal((unsigned int)v3) );
handshake_output = v3;
if ( v3 < 0 && verbose > 1u && v3 == -12 )
{
v4 = gnutls_alert_get(a1);
printf("\n");
name = (const char *)gnutls_alert_get_name(v4);
printf("*** Received alert [%d]: %s\n", v4, name);
}
if ( v3 < 0 )
return 1LL;
gnutls_session_get_data(a1, 0LL, &session_data_size);
if ( sfree )
{
free(session_data);
sfree = 0;
}
session_data = malloc(session_data_size);
sfree = 1;
if ( !session_data )
{
fprintf(stderr, "Memory error\n");
exit(1);
}
gnutls_session_get_data(a1, session_data, &session_data_size);
session_id_size = 32LL;
gnutls_session_get_id(a1, &session_id, &session_id_size);
return 0LL;
}
|
int
rl_reset_terminal(const char *p __attribute__((__unused__)))
{
if (h ==
((void *)0)
|| e ==
((void *)0)
)
rl_initialize();
el_reset(e);
return 0;
}
|
long rl_reset_terminal()
{
if ( !h || !e )
rl_initialize();
el_reset(e);
return 0LL;
}
|
static void su_failure (const char *tty,
_Bool
su_to_root)
{
sulog (tty,
0
, caller_name, name);
if (getdef_bool ("SYSLOG_SU_ENAB")) {
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (su_to_root ?
5
:
6
, "- %s %s:%s", tty, ('\0' != caller_name[0]) ? caller_name : "???", ('\0' != name[0]) ? name : "???") ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
0
)
;
}
closelog ();
exit (1);
}
|
void su_failure(const char *a1, char a2)
{
const char *v2;
const char *v3;
int v4;
char *locale;
const char *s;
sulog(a1, 0LL, &caller_name, &name);
if ( (unsigned char)getdef_bool("SYSLOG_SU_ENAB") )
{
s = setlocale(6, 0LL);
locale = 0LL;
if ( s )
locale = strdup(s);
if ( locale )
setlocale(6, "C");
if ( name )
v2 = &name;
else
v2 = "???";
if ( caller_name )
v3 = &caller_name;
else
v3 = "???";
if ( a2 )
v4 = 5;
else
v4 = 6;
syslog(v4, "- %s %s:%s", a1, v3, v2);
if ( locale )
{
setlocale(6, locale);
free(locale);
}
}
closelog();
exit(1);
}
|
static void
xheader_set_single_keyword (char *kw)
{
do { if (error_hook) error_hook (); error (0, 0, gettext ("Keyword %s is unknown or not yet implemented"), kw); usage (2); } while (0);
}
|
void xheader_set_single_keyword(unsigned long a0) {
unsigned long v0;
v0 = a0;
if (error_hook)
*(5242936)();
error(0x0, 0x0, gettext("Keyword %s is unknown or not yet implemented"));
usage(0x2);
}
|
static inline int
is_basic (char c)
{
return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31))
& 1;
}
|
int is_basic(unsigned long a0) {
return (*((4 * (a0 >> 5) + &is_basic_table)) >> (a0 & 31 & 31)) & 1;
}
|
static void vxcan_print_help(struct link_util *lu, int argc, char **argv,
FILE *f)
{
print_usage(f);
}
|
void vxcan_print_help(void)
{
undefined8 in_RCX;
print_usage(in_RCX);
return;
}
|
void
sv_ifs (name)
char *name;
{
SHELL_VAR *v;
v = find_variable ("IFS");
setifs (v);
}
|
void sv_ifs(unsigned long a0) {
unsigned long v0;
unsigned long long v1;
unsigned long long v3;
v0 = a0;
v1 = find_variable("IFS");
v3 = setifs(v1);
return;
}
|
multiSubmitMsg2(multi_submit_t *const pMultiSub)
{
qqueue_t *pQueue;
ruleset_t *pRuleset;
rsRetVal iRet = RS_RET_OK;
if(pMultiSub->nElem == 0)
goto finalize_it;;
pRuleset = ((pMultiSub->ppMsgs[0])->pRuleset);
pQueue = (pRuleset ==
((void *)0)
) ? runConf->pMsgQueue : ruleset.GetRulesetQueue(pRuleset);
if(pQueue ==
((void *)0)
) {
if(Debug) { r_dbgprintf("rsyslogd.c", "multiSubmitMsg() could not submit message - " "queue does (no longer?) exist - ignored\n"); }
;
goto finalize_it;;
}
iRet = pQueue->MultiEnq(pQueue, pMultiSub);
pMultiSub->nElem = 0;
finalize_it:
return iRet;
}
|
int multiSubmitMsg2(struct_0 *a0) {
unsigned int v0;
unsigned long long v1;
struct_2 *v2;
unsigned long long v4;
v0 = 0;
if (!a0->field_2)
return v0;
v1 = *(a0->field_8)->field_100;
if (!v1)
v4 = *((runConf + 808));
else
v4 = g_4044a8(v1);
v2 = v4;
if (v2) {
v0 = v2->field_e0(v2, a0, a0, v2->field_e0);
a0->field_2 = 0;
return v0;
} else if (!Debug) {
return v0;
} else {
r_dbgprintf("rsyslogd.c", "multiSubmitMsg() could not submit message - queue does (no longer?) exist - ignored\n", g_4044a8);
return v0;
}
}
|
static int
read_conf_values(gnutls_datum_t * g, gnutls_datum_t * n, char *str)
{
char *p;
int len;
int index, ret;
gnutls_datum_t dat;
index = atoi(str);
p = strrchr(str, ':');
if (p ==
((void *)0)
) {
return -1;
}
*p = '\0';
p++;
len = strlen(p);
if (p[len - 1] == '\n')
len--;
dat.data = (void *) p;
dat.size = len;
ret = gnutls_srp_base64_decode2(&dat, g);
if (ret < 0) {
fprintf(
stderr
, "Decoding error\n");
return -1;
}
p = strrchr(str, ':');
if (p ==
((void *)0)
) {
return -1;
}
*p = '\0';
p++;
dat.data = (void *) p;
dat.size = strlen(p);
ret = gnutls_srp_base64_decode2(&dat, n);
if (ret < 0) {
fprintf(
stderr
, "Decoding error\n");
free(g->data);
return -1;
}
return index;
}
|
int read_conf_values(unsigned long long *a0, unsigned long long a1, char *a2) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
char *v3;
char *v4;
unsigned int v5;
unsigned int v7;
v1 = atoi(a2);
v3 = strrchr(a2, 0x3a);
if (!v3) {
v7 = -1;
} else {
*(v3) = 0;
v3 += 1;
v0 = strlen(v3);
if (v3[1 + v0] == 10)
v0 -= 1;
v4 = v3;
v5 = v0;
v2 = gnutls_srp_base64_decode2(&v4, a0, a0);
if (v2 < 0) {
fprintf(*(&stderr), "Decoding error\n");
v7 = -1;
} else {
v3 = strrchr(a2, 0x3a);
if (!v3) {
v7 = -1;
} else {
*(v3) = 0;
v3 += 1;
v4 = v3;
v5 = strlen(v3);
v2 = gnutls_srp_base64_decode2(&v4, a1, a1);
if (v2 < 0) {
fprintf(*(&stderr), "Decoding error\n");
free(*(a0));
v7 = -1;
} else {
v7 = v1;
}
}
}
}
return v7;
}
|
static void
tty__setchar(struct termios *td, unsigned char *s)
{
td->c_cc[
0
] = s[0];
td->c_cc[
1
] = s[1];
td->c_cc[
2
] = s[2];
td->c_cc[
3
] = s[3];
td->c_cc[
4
] = s[4];
td->c_cc[
11
] = s[5];
td->c_cc[
16
] = s[6];
td->c_cc[
8
] = s[10];
td->c_cc[
9
] = s[11];
td->c_cc[
14
] = s[12];
td->c_cc[
10
] = s[13];
td->c_cc[
12
] = s[15];
td->c_cc[
13
] = s[16];
td->c_cc[
15
] = s[17];
td->c_cc[
6
] = s[23];
td->c_cc[
5
] = s[24];
}
|
void tty__setchar(char a0[34], char a1[25]) {
char v0;
char v2[34];
unsigned long long v3;
a0[17] = a1[0];
a0[18] = a1[1];
a0[19] = a1[2];
a0[20] = a1[3];
a0[21] = a1[4];
a0[28] = a1[5];
a0[33] = a1[6];
a0[25] = a1[10];
a0[26] = a1[11];
a0[31] = a1[12];
a0[27] = a1[13];
a0[29] = a1[15];
a0[30] = a1[16];
a0[32] = a1[17];
a0[23] = a1[23];
v2 = a0;
a0[22] = a1[24];
v3 = *(&v0);
return;
}
|
void
internal_debug (const char *format, ...)
{
return;
}
|
char internal_debug(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned long v4;
unsigned long v5;
int v6;
int v7;
int v8;
int v9;
int v10;
int v11;
int v12;
int v13;
char v15;
int v16;
int v17;
int v18;
int v19;
int v20;
int v21;
int v22;
int v23;
v0 = a0;
v1 = a1;
v2 = a2;
v3 = a3;
v4 = a4;
v5 = a5;
if (v15) {
v6 = v16;
v7 = v17;
v8 = v18;
v9 = v19;
v10 = v20;
v11 = v21;
v12 = v22;
v13 = v23;
}
return v15;
}
|
static inline __u32 rta_getattr_u32(const struct rtattr *rta)
{
return *(__u32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
|
undefined4 rta_getattr_u32(long param_1)
{
return *(undefined4 *)(param_1 + 4);
}
|
static int
print_status(const char *const *argv)
{
const char *thisarg;
struct pkginfo *pkg;
int failures = 0;
modstatdb_open(msdbrw_readonly);
if (!*argv) {
writedb_records(
stdout
, gettext("<standard output>"), 0);
} else {
while ((thisarg = *argv++) !=
((void *)0)
) {
pkg = dpkg_options_parse_pkgname(cipaction, thisarg);
if (pkg->status == PKG_STAT_NOTINSTALLED &&
pkg->priority == PKG_PRIO_UNKNOWN &&
str_is_unset(pkg->section) &&
!pkg->archives &&
pkg->want == PKG_WANT_UNKNOWN &&
!pkg_is_informative(pkg, &pkg->installed)) {
notice(gettext("package '%s' is not installed and no information is available"),
pkg_name(pkg, pnaw_nonambig));
failures++;
} else {
writerecord(
stdout
, gettext("<standard output>"), pkg, &pkg->installed);
}
if (*argv !=
((void *)0)
)
putchar('\n');
}
}
m_output(
stdout
, gettext("<standard output>"));
if (failures) {
fputs(gettext("Use dpkg --info (= dpkg-deb --info) to examine archive files.\n"),
stderr
);
m_output(
stderr
, gettext("<standard error>"));
}
modstatdb_shutdown();
return failures;
}
|
long long print_status(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long *v0;
int tmp_11;
unsigned int v1;
unsigned long long v2;
struct_0 *v3;
char v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
v0 = a0;
v1 = 0;
modstatdb_open(0x0);
if (!*(v0)) {
v6 = gettext("<standard output>");
writedb_records(*(&stdout), v6, 0x0, v6);
} else {
while (true) {
tmp_11 = v0;
v0 += 1;
v2 = *(tmp_11);
if (!v2)
break;
v3 = dpkg_options_parse_pkgname(cipaction, v2, v2);
if (v3->field_18 || v3->field_1c != 6 || !str_is_unset(v3->field_28) || v3->field_140 || v3->field_10 || !((v5 = (pkg_is_informative(v3, v3 + 72, v3 + 72) ^ 1), v5))) {
writerecord(*(&stdout), gettext("<standard output>"), v3, &v3->padding_30[24]);
} else {
notice(gettext("package '%s' is not installed and no information is available"), pkg_name(v3, 0x1, a2));
v1 += 1;
}
if (!*(v0))
continue;
putchar(0xa);
}
}
v7 = gettext("<standard output>");
m_output(*(&stdout), v7, v7);
if (v1) {
fputs(gettext("Use dpkg --info (= dpkg-deb --info) to examine archive files.\n"), stderr);
v8 = gettext("<standard error>");
m_output(stderr, v8, v8);
}
modstatdb_shutdown(a0, a1, a2, a3, a4, a5);
return v1;
}
|
static
_Bool
pax_dump_header (struct tar_sparse_file *file)
{
file->stat_info->sparse_major = tar_sparse_major;
file->stat_info->sparse_minor = tar_sparse_minor;
return (file->stat_info->sparse_major == 0) ?
pax_dump_header_0 (file) : pax_dump_header_1 (file);
}
|
long long pax_dump_header(struct_0 *a0) {
unsigned long long v1;
a0->field_18->field_124 = tar_sparse_major;
a0->field_18->field_128 = tar_sparse_minor;
if (!a0->field_18->field_124) {
v1 = pax_dump_header_0(a0);
*(&v1) = v1;
} else {
v1 = pax_dump_header_1(a0);
*(&v1) = v1;
}
return v1;
}
|
SHELL_VAR *
find_variable_internal (name, flags)
const char *name;
int flags;
{
SHELL_VAR *var;
int search_tempenv, force_tempenv;
VAR_CONTEXT *vc;
var = (SHELL_VAR *)
((void *)0)
;
force_tempenv = (flags & 0x01);
search_tempenv = force_tempenv || (expanding_redir == 0 && subshell_environment);
if (search_tempenv && temporary_env)
var = hash_lookup (name, temporary_env);
if (var == 0)
{
if ((flags & 0x02) == 0)
var = var_lookup (name, shell_variables);
else
{
for (vc = shell_variables; vc; vc = vc->down)
{
var = hash_lookup (name, vc->table);
if (var && ((((var)->attributes) & (0x0001000))))
var = 0;
if (var)
break;
}
}
}
if (var == 0)
return ((SHELL_VAR *)
((void *)0)
);
return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var);
}
|
long find_variable_internal(long a1, char a2)
{
_BOOL4 v2;
long v4;
long i;
v4 = 0LL;
v2 = (a2 & 1) != 0 || !expanding_redir && subshell_environment;
if ( v2 && temporary_env )
v4 = hash_lookup(a1, temporary_env);
if ( !v4 )
{
if ( (a2 & 2) != 0 )
{
for ( i = shell_variables; i; i = *(_QWORD *)(i + 24) )
{
v4 = hash_lookup(a1, *(_QWORD *)(i + 32));
if ( v4 && (*(_DWORD *)(v4 + 40) & 0x1000) != 0 )
v4 = 0LL;
if ( v4 )
break;
}
}
else
{
v4 = var_lookup(a1, shell_variables);
}
}
if ( !v4 )
return 0LL;
if ( *(_QWORD *)(v4 + 24) )
return (*(long ( **)(long))(v4 + 24))(v4);
return v4;
}
|
static void print_vf_stats64(FILE *fp, struct rtattr *vfstats)
{
struct rtattr *vf[(__IFLA_VF_STATS_MAX - 1) + 1];
if (vfstats->rta_type != IFLA_VF_STATS) {
fprintf(
stderr
, "BUG: rta type is %d\n", vfstats->rta_type);
return;
}
(parse_rtattr_flags((vf), ((__IFLA_VF_STATS_MAX - 1)), ((void*)(((char*)(vfstats)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((vfstats)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)));
if (is_json_context()) {
open_json_object("stats");
open_json_object("rx");
print_u64(PRINT_JSON, "bytes",
((void *)0)
,
rta_getattr_u64(vf[IFLA_VF_STATS_RX_BYTES]));
print_u64(PRINT_JSON, "packets",
((void *)0)
,
rta_getattr_u64(vf[IFLA_VF_STATS_RX_PACKETS]));
print_u64(PRINT_JSON, "multicast",
((void *)0)
,
rta_getattr_u64(vf[IFLA_VF_STATS_MULTICAST]));
print_u64(PRINT_JSON, "broadcast",
((void *)0)
,
rta_getattr_u64(vf[IFLA_VF_STATS_BROADCAST]));
if (vf[IFLA_VF_STATS_RX_DROPPED])
print_u64(PRINT_JSON, "dropped",
((void *)0)
,
rta_getattr_u64(vf[IFLA_VF_STATS_RX_DROPPED]));
close_json_object();
open_json_object("tx");
print_u64(PRINT_JSON, "tx_bytes",
((void *)0)
,
rta_getattr_u64(vf[IFLA_VF_STATS_TX_BYTES]));
print_u64(PRINT_JSON, "tx_packets",
((void *)0)
,
rta_getattr_u64(vf[IFLA_VF_STATS_TX_PACKETS]));
if (vf[IFLA_VF_STATS_TX_DROPPED])
print_u64(PRINT_JSON, "dropped",
((void *)0)
,
rta_getattr_u64(vf[IFLA_VF_STATS_TX_DROPPED]));
close_json_object();
close_json_object();
} else {
fprintf(fp, "%s", _SL_);
fprintf(fp, " RX: bytes packets mcast bcast ");
if (vf[IFLA_VF_STATS_RX_DROPPED])
fprintf(fp, " dropped ");
fprintf(fp, "%s", _SL_);
fprintf(fp, " ");
print_num(fp, 10, rta_getattr_u64(vf[IFLA_VF_STATS_RX_BYTES]));
print_num(fp, 8, rta_getattr_u64(vf[IFLA_VF_STATS_RX_PACKETS]));
print_num(fp, 7, rta_getattr_u64(vf[IFLA_VF_STATS_MULTICAST]));
print_num(fp, 7, rta_getattr_u64(vf[IFLA_VF_STATS_BROADCAST]));
if (vf[IFLA_VF_STATS_RX_DROPPED])
print_num(fp, 8, rta_getattr_u64(vf[IFLA_VF_STATS_RX_DROPPED]));
fprintf(fp, "%s", _SL_);
fprintf(fp, " TX: bytes packets ");
if (vf[IFLA_VF_STATS_TX_DROPPED])
fprintf(fp, " dropped ");
fprintf(fp, "%s", _SL_);
fprintf(fp, " ");
print_num(fp, 10, rta_getattr_u64(vf[IFLA_VF_STATS_TX_BYTES]));
print_num(fp, 8, rta_getattr_u64(vf[IFLA_VF_STATS_TX_PACKETS]));
if (vf[IFLA_VF_STATS_TX_DROPPED])
print_num(fp, 8, rta_getattr_u64(vf[IFLA_VF_STATS_TX_DROPPED]));
}
}
|
void print_vf_stats64(void* a0, unsigned short a1[2], unsigned long a2, unsigned long long a3, unsigned long a4, unsigned long long a5) {
char v0;
char v1;
char v2;
char v3;
char v4;
char v5;
char v6;
char v7;
char v8;
unsigned long long *v10;
unsigned long long v11;
if (a1[1] != 8) {
fprintf(stderr, "BUG: rta type is %d\n", a1[1]);
} else {
parse_rtattr_flags(&v0, 0x8, a1 + 1, a1[0] - 4, 0x8000);
if (is_json_context()) {
open_json_object("stats");
open_json_object("rx");
print_u64(0x2, "bytes", 0x0, rta_getattr_u64(*(&v2)));
print_u64(0x2, "packets", 0x0, rta_getattr_u64(*(&v0)));
print_u64(0x2, "multicast", 0x0, rta_getattr_u64(*(&v5)));
print_u64(0x2, "broadcast", 0x0, rta_getattr_u64(*(&v4)));
if (*(&v6))
print_u64(0x2, "dropped", 0x0, rta_getattr_u64(*(&v6)));
close_json_object(0x2, a1, 0x0, a3, 0x8000, a5);
open_json_object("tx");
print_u64(0x2, "tx_bytes", 0x0, rta_getattr_u64(*(&v3)));
print_u64(0x2, "tx_packets", 0x0, rta_getattr_u64(*(&v1)));
if (*(&v7))
print_u64(0x2, "dropped", 0x0, rta_getattr_u64(*(&v7)));
close_json_object(0x2, a1, 0x0, a3, 0x8000, a5);
close_json_object(0x2, a1, 0x0, a3, 0x8000, a5);
} else {
fprintf(a0, "%s", _SL_);
fprintf(a0, " RX: bytes packets mcast bcast ");
if (*(&v6))
fprintf(a0, " dropped ");
fprintf(a0, "%s", _SL_);
fprintf(a0, " ");
print_num(a0, 0xa, rta_getattr_u64(*(&v2)));
print_num(a0, 0x8, rta_getattr_u64(*(&v0)));
print_num(a0, 0x7, rta_getattr_u64(*(&v5)));
print_num(a0, 0x7, rta_getattr_u64(*(&v4)));
if (*(&v6))
print_num(a0, 0x8, rta_getattr_u64(*(&v6)));
fprintf(a0, "%s", _SL_);
fprintf(a0, " TX: bytes packets ");
if (*(&v7))
fprintf(a0, " dropped ");
fprintf(a0, "%s", _SL_);
fprintf(a0, " ");
print_num(a0, 0xa, rta_getattr_u64(*(&v3)));
print_num(a0, 0x8, rta_getattr_u64(*(&v1)));
if (*(&v7))
print_num(a0, 0x8, rta_getattr_u64(*(&v7)));
}
}
v11 = *(&v8) ^ v10[5];
return;
}
|
static void license()
{
char const *const *p = license_msg;
printf ("%s %s\n", program_name, Version);
while (*p) printf ("%s\n", *p++);
}
|
void license() {
unsigned long long v0;
int tmp_9;
unsigned long long v2;
v0 = &license_msg;
printf("%s %s\n", -116028600, Version);
while (true) {
v2 = *(v0);
if (!*(v0))
break;
tmp_9 = v0;
v0 += 8;
printf("%s\n", *(tmp_9));
}
return;
}
|
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;
}
|
int cron_pclose(FILE * iop) {
int fdes;
sigset_t oset, nset;
int stat_loc;
pid_t pid;
fdes = fileno(iop);
if (pids ==
((void *)0)
|| fdes >= fds || pids[fdes] == 0L)
return (-1);
(void) fclose(iop);
sigemptyset(&nset);
sigaddset(&nset,
2
);
sigaddset(&nset,
3
);
sigaddset(&nset,
1
);
(void) sigprocmask(
0
, &nset, &oset);
while ((pid = wait(&stat_loc)) != pids[fdes] && pid != -1) ;
(void) sigprocmask(
2
, &oset,
((void *)0)
);
pids[fdes] = 0;
return (pid == -1 ? -1 :
(((
stat_loc
) & 0xff00) >> 8)
);
}
|
long cron_pclose(FILE *a1)
{
__WAIT_STATUS stat_loc;
__pid_t v3;
sigset_t oset;
sigset_t set;
unsigned long v6;
v6 = __readfsqword(0x28u);
HIDWORD(stat_loc.__iptr) = fileno(a1);
if ( !pids || SHIDWORD(stat_loc.__iptr) >= fds || !*((_DWORD *)pids + SHIDWORD(stat_loc.__iptr)) )
return 0xFFFFFFFFLL;
fclose(a1);
sigemptyset(&set);
sigaddset(&set, 2);
sigaddset(&set, 3);
sigaddset(&set, 1);
sigprocmask(0, &set, &oset);
do
v3 = wait((__WAIT_STATUS)&stat_loc);
while ( v3 != *((_DWORD *)pids + SHIDWORD(stat_loc.__iptr)) && v3 != -1 );
sigprocmask(2, &oset, 0LL);
*((_DWORD *)pids + SHIDWORD(stat_loc.__iptr)) = 0;
if ( v3 == -1 )
return 0xFFFFFFFFLL;
else
return BYTE1(stat_loc.__uptr);
}
|
void
sv_shcompat (name)
char *name;
{
SHELL_VAR *v;
char *val;
int tens, ones, compatval;
v = find_variable (name);
if (v == 0)
{
shell_compatibility_level = 52;
set_compatibility_opts ();
return;
}
val = ((v)->value);
if (val == 0 || *val == '\0')
{
shell_compatibility_level = 52;
set_compatibility_opts ();
return;
}
if ((1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)val[0]
))] & (unsigned short int) _ISdigit)
) && val[1] == '.' && (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)val[2]
))] & (unsigned short int) _ISdigit)
) && val[3] == 0)
{
tens = val[0] - '0';
ones = val[2] - '0';
compatval = tens*10 + ones;
}
else if ((1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)val[0]
))] & (unsigned short int) _ISdigit)
) && (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)val[1]
))] & (unsigned short int) _ISdigit)
) && val[2] == 0)
{
tens = val[0] - '0';
ones = val[1] - '0';
compatval = tens*10 + ones;
}
else
{
compat_error:
internal_error (gettext("%s: %s: compatibility value out of range"), name, val);
shell_compatibility_level = 52;
set_compatibility_opts ();
return;
}
if (compatval < 31 || compatval > 52)
goto compat_error;
shell_compatibility_level = compatval;
set_compatibility_opts ();
}
|
void sv_shcompat(unsigned long long a0) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
struct_0 *v3;
char v4[4];
unsigned long long v6;
unsigned long long v7;
unsigned int v9;
unsigned int v10;
unsigned int v11;
unsigned long long v12;
unsigned long long v13;
v3 = find_variable(a0);
if (!v3) {
shell_compatibility_level = 52;
v6 = set_compatibility_opts();
} else {
*(&v4) = v3->field_8;
if (v4 && v4[0]) {
v9 = *((v4[0] * 2 + *(__ctype_b_loc()))) & 0x800;
if (v9 && v4[1] == 46) {
*(&v9) = *((*(__ctype_b_loc()) + v4[2] * 2));
v9 = v9 & 0x800;
if (v9 && !v4[3]) {
v1 = v4[0] - 48;
v2 = v4[2] - 48;
v0 = v2 + ((v1 * 4) + v1) * 2;
}
}
if (!v9 || !v9 || v4[1] != 46 || v4[3]) {
*(&v9) = *((v4[0] * 2 + *(__ctype_b_loc())));
v10 = v9 & 0x800;
if (v10) {
*(&v10) = *((*(__ctype_b_loc()) + v4[1] * 2));
v11 = v10 & 0x800;
if (v11 && !v4[2]) {
v1 = v4[0] - 48;
v2 = v4[1] - 48;
v0 = v2 + ((v1 * 4) + v1) * 2;
}
}
}
if (...) {
shell_compatibility_level = v0;
v12 = set_compatibility_opts();
}
if (v0 > 52) {
internal_error(gettext("%s: %s: compatibility value out of range"));
shell_compatibility_level = 52;
v13 = set_compatibility_opts();
}
}
if (!v4[0] || !v4) {
shell_compatibility_level = 52;
v7 = set_compatibility_opts();
}
}
return;
}
|
void test_gzio(fname, uncompr, uncomprLen)
const char *fname;
Byte *uncompr;
uLong uncomprLen;
{
int err;
int len = (int)strlen(hello)+1;
gzFile file;
off_t pos;
file = gzopen(fname, "wb");
if (file ==
((void *)0)
) {
fprintf(
stderr
, "gzopen error\n");
exit(1);
}
gzputc(file, 'h');
if (gzputs(file, "ello") != 4) {
fprintf(
stderr
, "gzputs err: %s\n", gzerror(file, &err));
exit(1);
}
if (gzprintf(file, ", %s!", "hello") != 8) {
fprintf(
stderr
, "gzprintf err: %s\n", gzerror(file, &err));
exit(1);
}
gzseek(file, 1L,
1
);
gzclose(file);
file = gzopen(fname, "rb");
if (file ==
((void *)0)
) {
fprintf(
stderr
, "gzopen error\n");
exit(1);
}
strcpy((char*)uncompr, "garbage");
if (gzread(file, uncompr, (unsigned)uncomprLen) != len) {
fprintf(
stderr
, "gzread err: %s\n", gzerror(file, &err));
exit(1);
}
if (strcmp((char*)uncompr, hello)) {
fprintf(
stderr
, "bad gzread: %s\n", (char*)uncompr);
exit(1);
} else {
printf("gzread(): %s\n", (char*)uncompr);
}
pos = gzseek(file, -8L,
1
);
if (pos != 6 || gztell(file) != pos) {
fprintf(
stderr
, "gzseek error, pos=%ld, gztell=%ld\n",
(long)pos, (long)gztell(file));
exit(1);
}
if (((file)->have ? ((file)->have--, (file)->pos++, *((file)->next)++) : (gzgetc)(file)) != ' ') {
fprintf(
stderr
, "gzgetc error\n");
exit(1);
}
if (gzungetc(' ', file) != ' ') {
fprintf(
stderr
, "gzungetc error\n");
exit(1);
}
gzgets(file, (char*)uncompr, (int)uncomprLen);
if (strlen((char*)uncompr) != 7) {
fprintf(
stderr
, "gzgets err after gzseek: %s\n", gzerror(file, &err));
exit(1);
}
if (strcmp((char*)uncompr, hello + 6)) {
fprintf(
stderr
, "bad gzgets after gzseek\n");
exit(1);
} else {
printf("gzgets() after gzseek: %s\n", (char*)uncompr);
}
gzclose(file);
}
|
void test_gzio(unsigned long long a0, char *a1, unsigned long long a2) {
char v0;
int tmp_53;
unsigned int v1;
unsigned long long v2;
unsigned long v3;
char v4;
char v7;
unsigned long long *v8;
unsigned long long v9;
v1 = strlen("hello,") + 1;
v2 = gzopen(a0, "wb");
if (!v2) {
fprintf(*(&stderr), "gzopen error\n");
exit(0x1);
}
gzputc(v2, 0x68);
if (gzputs(v2, "ello") != 4) {
fprintf(*(&stderr), "gzputs err: %s\n", gzerror(v2, &v0, &v0));
exit(0x1);
} else if (gzprintf(v2, ", %s!", "hello") != 8) {
fprintf(*(&stderr), "gzprintf err: %s\n", gzerror(v2, &v0, &v0));
exit(0x1);
} else {
gzseek(v2, 0x1, 0x1);
gzclose(v2);
v2 = gzopen(a0, "rb");
if (!v2) {
fprintf(*(&stderr), "gzopen error\n");
exit(0x1);
}
strcpy(a1, "garbage");
if (v1 != gzread(v2, a1, a2, a1)) {
fprintf(*(&stderr), "gzread err: %s\n", gzerror(v2, &v0, &v0));
exit(0x1);
} else if (strcmp(a1, "hello,")) {
fprintf(*(&stderr), "bad gzread: %s\n", a1);
exit(0x1);
} else {
printf("gzread(): %s\n", a1);
v3 = gzseek(v2, 0xfffffffffffffff8, 0x1);
if (v3 == 6 && v3 == gztell(v2)) {
if (v2->field_0) {
v2->field_0 = v2->field_0 - 1;
v2->field_10 = v2->field_10 + 1;
tmp_53 = v2->field_8;
v2->field_8 = v2->field_8 + 1;
v7 = *(tmp_53) != 32;
} else {
v7 = gzgetc(v2) != 32;
}
if (v7) {
fprintf(*(&stderr), "gzgetc error\n");
exit(0x1);
} else if (gzungetc(0x20, v2) != 32) {
fprintf(*(&stderr), "gzungetc error\n");
exit(0x1);
} else {
gzgets(v2, a1, a2, a1);
if (strlen(a1) != 7) {
fprintf(*(&stderr), "gzgets err after gzseek: %s\n", gzerror(v2, &v0, &v0));
exit(0x1);
} else if (strcmp(a1, " hello!")) {
fprintf(*(&stderr), "bad gzgets after gzseek\n");
exit(0x1);
} else {
printf("gzgets() after gzseek: %s\n", a1);
gzclose(v2);
v9 = *(&v4) ^ v8[5];
return;
}
}
}
fprintf(*(&stderr), "gzseek error, pos=%ld, gztell=%ld\n", v3, gztell(v2));
exit(0x1);
}
}
}
|
static int
wskipname (pat, dname, flags)
wchar_t *pat, *dname;
int flags;
{
int i;
if (glob_always_skip_dot_and_dotdot && (dname[0] == L'.' && (dname[1] == L'\0' || (dname[1] == L'.' && dname[2] == L'\0'))))
return 1;
if (noglob_dot_filenames == 0 && pat[0] != L'.' &&
(pat[0] != L'\\' || pat[1] != L'.') &&
(dname[0] == L'.' && (dname[1] == L'\0' || (dname[1] == L'.' && dname[2] == L'\0'))))
return 1;
else if (noglob_dot_filenames && dname[0] == L'.' &&
pat[0] != L'.' && (pat[0] != L'\\' || pat[1] != L'.'))
return 1;
return 0;
}
|
_BOOL8 wskipname(_DWORD *a1, _DWORD *a2)
{
if ( glob_always_skip_dot_and_dotdot && *a2 == 46 && (!a2[1] || a2[1] == 46 && !a2[2]) )
return 1LL;
if ( !noglob_dot_filenames
&& *a1 != 46
&& (*a1 != 92 || a1[1] != 46)
&& *a2 == 46
&& (!a2[1] || a2[1] == 46 && !a2[2]) )
{
return 1LL;
}
return noglob_dot_filenames && *a2 == 46 && *a1 != 46 && (*a1 != 92 || a1[1] != 46);
}
|
static void print_rta_cacheinfo(FILE *fp, const struct rta_cacheinfo *ci)
{
static int hz;
if (!hz)
hz = get_user_hz();
if (ci->rta_expires != 0)
print_int(PRINT_ANY, "expires",
"expires %dsec ", ci->rta_expires/hz);
if (ci->rta_error != 0)
print_uint(PRINT_ANY, "error",
"error %u ", ci->rta_error);
if (show_stats) {
if (ci->rta_clntref)
print_uint(PRINT_ANY, "users",
"users %u ", ci->rta_clntref);
if (ci->rta_used != 0)
print_uint(PRINT_ANY, "used",
"used %u ", ci->rta_used);
if (ci->rta_lastuse != 0)
print_uint(PRINT_ANY, "age",
"age %usec ", ci->rta_lastuse/hz);
}
if (ci->rta_id)
print_0xhex(PRINT_ANY, "ipid",
"ipid 0x%04llx ", ci->rta_id);
if (ci->rta_ts || ci->rta_tsage) {
print_0xhex(PRINT_ANY, "ts",
"ts 0x%llx", ci->rta_ts);
print_uint(PRINT_ANY, "tsage",
"tsage %usec ", ci->rta_tsage);
}
}
|
void print_rta_cacheinfo(unsigned long a0, unsigned int a1[8]) {
unsigned long v0;
unsigned long long v2;
unsigned long long v3;
v0 = a0;
if (!hz.8788)
hz.8788 = get_user_hz();
if (a1[2])
print_int(0x4, "expires", "expires %dsec ", (a1[2] >> 31 CONCAT a1[2]) /m hz.8788);
if (a1[3])
print_uint(0x4, "error", "error %u ", a1[3]);
if (show_stats) {
if (a1[0])
print_uint(0x4, "users", "users %u ", a1[0]);
if (a1[4])
print_uint(0x4, "used", "used %u ", a1[4]);
if (a1[1])
print_uint(0x4, "age", "age %usec ", (0 CONCAT a1[1]) /m hz.8788);
}
if (a1[5])
print_0xhex(0x4, "ipid", "ipid 0x%04llx ", a1[5]);
if (!a1[6]) {
v2 = a1[7];
if (!a1[7])
goto LABEL_401a5b;
}
print_0xhex(0x4, "ts", "ts 0x%llx", a1[6]);
v3 = print_uint(0x4, "tsage", "tsage %usec ", a1[7]);
LABEL_401a5b:
return;
}
|
static struct dumpdir *
dumpdir_create0 (const char *contents, const char *cmask)
{
struct dumpdir *dump;
size_t i, total, ctsize, len;
char *p;
const char *q;
for (i = 0, total = 0, ctsize = 1, q = contents; *q; total++, q += len)
{
len = strlen (q) + 1;
ctsize += len;
if (!cmask || strchr (cmask, *q))
i++;
}
dump = xmalloc (sizeof (*dump) + ctsize);
dump->contents = (char*)(dump + 1);
memcpy (dump->contents, contents, ctsize);
dump->total = total;
dump->elc = i;
dump->elv = xcalloc (i + 1, sizeof (dump->elv[0]));
for (i = 0, p = dump->contents; *p; p += strlen (p) + 1)
{
if (!cmask || strchr (cmask, *p))
dump->elv[i++] = p + 1;
}
dump->elv[i] =
((void *)0)
;
return dump;
}
|
int dumpdir_create0(void* a0, char *a1) {
void* v0;
int tmp_28;
void* v1;
unsigned long long v2;
char *v3;
char *v4;
unsigned long long v5[4];
unsigned long v6;
v0 = 0;
v1 = 0;
v2 = 1;
for (v4 = a0; *(v4); v4 = &v4[v6]) {
v6 = strlen(v4) + 1;
v2 += v6;
if (!a1 || strchr(a1, *(v4)))
v0 += 1;
v1 += 1;
}
v5[0] = xmalloc(v2 + 32);
v5[0] = v5 + 1;
memcpy(v5[0], a0, v2);
v5[1] = v1;
v5[2] = v0;
v5[3] = xcalloc(v0 + 1, 0x8, v0);
v0 = 0;
for (v3 = v5[0]; *(v3); v3 = &v3[1 + strlen(v3)]) {
if (!a1 || strchr(a1, *(v3))) {
tmp_28 = v0;
v0 += 1;
*((tmp_28 * 8 + v5[3])) = v3 + 1;
}
}
*((v5[3] + v0 * 8)) = 0;
return v5;
}
|
static
void stop_handler(int sig __attribute__((unused)))
{
int saved_errno =
(*__errno_location ())
;
got_cont = 0;
while(!got_cont) pause();
got_cont = 0;
(*__errno_location ())
= saved_errno;
}
|
long long stop_handler(unsigned long a0) {
unsigned int v0;
unsigned int v1;
unsigned int *v4;
v0 = a0;
v1 = *(__errno_location());
got_cont = 0;
while (!got_cont) {
pause();
}
got_cont = 0;
v4 = __errno_location();
*(v4) = v1;
return v4;
}
|
static void
addcchar (c, flag)
unsigned char c;
int flag;
{
char *fstr;
if (debug)
{
fstr = getcstr (flag);
fprintf (
stderr
, "added %s for character %s\n", fstr, cdesc(c));
}
lsyntax[c] |= flag;
}
|
long addcchar(unsigned char a1, unsigned int a2)
{
const char *v2;
long result;
const char *v4;
if ( debug )
{
v4 = (const char *)getcstr(a2);
v2 = cdesc(a1);
fprintf(stderr, "added %s for character %s\n", v4, v2);
}
result = a2 | lsyntax[a1];
lsyntax[a1] = result;
return result;
}
|
int main (int argc, char **argv)
{
uid_t ruid, euid;
gid_t rgid, egid;
long sys_ngroups;
gid_t *groups;
int ngroups;
_Bool
aflg = 0;
struct passwd *pw;
struct group *gr;
(void) setlocale (
6
, "");
(void) bindtextdomain ("shadow", "/usr/share/locale");
(void) textdomain ("shadow");
sys_ngroups = sysconf (
_SC_NGROUPS_MAX
);
groups = (gid_t *) malloc (sizeof (gid_t) * sys_ngroups);
if (argc > 1) {
if ((argc > 2) || (strcmp (argv[1], "-a") != 0)) {
usage ();
} else {
aflg =
1
;
}
}
ruid = getuid ();
euid = geteuid ();
rgid = getgid ();
egid = getegid ();
pw = getpwuid (ruid);
if (
((void *)0)
!= pw) {
(void) printf ("UID=%lu(%s)",
(unsigned long) ruid, pw->pw_name);
} else {
(void) printf ("UID=%lu", (unsigned long) ruid);
}
gr = getgrgid (rgid);;
if (
((void *)0)
!= gr) {
(void) printf (" GID=%lu(%s)",
(unsigned long) rgid, gr->gr_name);
} else {
(void) printf (" GID=%lu", (unsigned long) rgid);
}
if (ruid != euid) {
pw = getpwuid (euid);
if (
((void *)0)
!= pw) {
(void) printf (" EUID=%lu(%s)",
(unsigned long) euid, pw->pw_name);
} else {
(void) printf (" EUID=%lu", (unsigned long) euid);
}
}
if (rgid != egid) {
gr = getgrgid (egid);
if (
((void *)0)
!= gr) {
(void) printf (" EGID=%lu(%s)",
(unsigned long) egid, gr->gr_name);
} else {
(void) printf (" EGID=%lu", (unsigned long) egid);
}
}
if (aflg && (ngroups = getgroups (sys_ngroups, groups)) != -1) {
int i;
(void) puts (gettext (" groups="));
for (i = 0; i < ngroups; i++) {
if (0 != i)
(void) putchar (',');
gr = getgrgid (groups[i]);
if (
((void *)0)
!= gr) {
(void) printf ("%lu(%s)",
(unsigned long) groups[i],
gr->gr_name);
} else {
(void) printf ("%lu",
(unsigned long) groups[i]);
}
}
}
free (groups);
(void) putchar ('\n');
return
0
;
}
|
int main(unsigned long a0, struct_0 *a1) {
char v0;
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 long long *v9;
unsigned long long *v10;
v0 = 0;
setlocale(0x6, &g_400358);
bindtextdomain("shadow", "/usr/share/locale");
textdomain("shadow");
*(&v7) = sysconf(0x3);
v8 = malloc(*(&v7) * 4);
if (a0 > 1) {
if (!(a0 <= 2) || !(!strcmp(a1->field_8, "-a")))
usage();
v0 = 1;
}
v2 = getuid();
v3 = geteuid();
v4 = getgid();
v5 = getegid();
v9 = &getpwuid(v2)->pw_name;
if (!v9)
printf("UID=%lu", v2);
else
printf("UID=%lu(%s)", v2, *(v9));
v10 = &getgrgid(v4)->gr_name;
if (!v10)
printf(" GID=%lu", v4);
else
printf(" GID=%lu(%s)", v4, *(v10));
if (v2 != v3) {
v9 = &getpwuid(v3)->pw_name;
if (!v9)
printf(" EUID=%lu", v3);
else
printf(" EUID=%lu(%s)", v3, *(v9));
}
if (v4 != v5) {
v10 = &getgrgid(v5)->gr_name;
if (!v10)
printf(" EGID=%lu", v5);
else
printf(" EGID=%lu(%s)", v5, *(v10));
}
if (v0) {
v6 = getgroups(*(&v7), v8);
if (v6 != -1) {
puts(gettext(" groups="));
for (v1 = 0; v1 < v6; v1 += 1) {
if (v1)
putchar(0x2c);
v10 = &getgrgid(v8[v1])->gr_name;
if (!v10)
printf("%lu", v8[v1]);
else
printf("%lu(%s)", v8[v1], *(v10));
}
}
}
free(v8);
putchar(0xa);
return 0;
}
|
!= 0) {
fprintf(
stderr
, "%s (%d): %s\n", "init.c", 406, strerror(
(*__errno_location ())
));
}
|
int fprintf(FILE *__stream,char *__format,...)
{
halt_baddata();
}
|
static void
raw_path_decoder (struct tar_stat_info *st, char const *arg)
{
decode_string (&st->orig_file_name, arg);
decode_string (&st->file_name, arg);
st->had_trailing_slash = strip_trailing_slashes (st->file_name);
}
|
void raw_path_decoder(struct_0 *a0, unsigned long long a1) {
decode_string(a0, a1);
decode_string(&a0->field_8, a1);
*(&a0->field_10) = strip_trailing_slashes(a0->field_8);
return;
}
|
void *
malloc_watch (addr)
void * addr;
{
register int i;
void * ret;
if (addr == 0)
return addr;
ret = (void *)0;
return ret;
}
|
long malloc_watch(long param_1)
{
if (param_1 != 0) {
param_1 = 0;
}
return param_1;
}
|
int
exportable_function_name (string)
const char *string;
{
if (absolute_program (string))
return 0;
if (mbschr (string, '=') != 0)
return 0;
return 1;
}
|
undefined8 exportable_function_name(undefined8 param_1)
{
int iVar1;
undefined8 uVar2;
long lVar3;
iVar1 = absolute_program(param_1);
if (iVar1 == 0) {
lVar3 = mbschr(param_1,0x3d);
if (lVar3 == 0) {
uVar2 = 1;
}
else {
uVar2 = 0;
}
}
else {
uVar2 = 0;
}
return uVar2;
}
|
void udp_server(const char *name, int port, int mtu)
{
int sock, ret;
struct sockaddr_storage cli_addr;
socklen_t cli_addr_size;
char buffer[255];
priv_data_st priv;
gnutls_session_t session;
gnutls_datum_t cookie_key;
gnutls_dtls_prestate_st prestate;
unsigned char sequence[8];
ret = gnutls_key_generate(&cookie_key, 16);
if (ret < 0) {
fprintf(
stderr
, "Cannot generate key\n");
exit(1);
}
ret = listen_socket(name, port,
SOCK_DGRAM
);
if (ret < 0) {
fprintf(
stderr
, "Cannot listen\n");
exit(1);
}
for (;;) {
printf("Waiting for connection...\n");
sock = wait_for_connection();
if (sock < 0)
continue;
cli_addr_size = sizeof(cli_addr);
ret =
recvfrom(sock, buffer, sizeof(buffer)-1,
MSG_PEEK
,
(struct sockaddr *) &cli_addr,
&cli_addr_size);
if (ret > 13 &&
buffer[0] == 22 &&
buffer[13] == GNUTLS_HANDSHAKE_CLIENT_HELLO) {
if (!gnutls_serv_options.present.nocookie) {
memset(&prestate, 0, sizeof(prestate));
ret =
gnutls_dtls_cookie_verify(&cookie_key,
&cli_addr,
cli_addr_size,
buffer, ret,
&prestate);
if (ret < 0) {
priv_data_st s;
memset(&s, 0, sizeof(s));
s.fd = sock;
s.cli_addr = (void *) &cli_addr;
s.cli_addr_size = cli_addr_size;
printf
("Sending hello verify request to %s\n",
human_addr((struct sockaddr *)
&cli_addr,
cli_addr_size, buffer,
sizeof(buffer)-1));
gnutls_dtls_cookie_send(&cookie_key,
&cli_addr,
cli_addr_size,
&prestate,
(gnutls_transport_ptr_t)
&s, push_func);
recvfrom(sock, buffer, sizeof(buffer)-1, 0,
(struct sockaddr *) &cli_addr,
&cli_addr_size);
continue;
}
}
printf("Accepted connection from %s\n",
human_addr((struct sockaddr *)
&cli_addr, sizeof(cli_addr),
buffer, sizeof(buffer)-1));
} else
continue;
session = initialize_session(1);
if (!gnutls_serv_options.present.nocookie)
gnutls_dtls_prestate_set(session, &prestate);
if (mtu)
gnutls_dtls_set_mtu(session, mtu);
priv.session = session;
priv.fd = sock;
priv.cli_addr = &cli_addr;
priv.cli_addr_size = cli_addr_size;
gnutls_transport_set_ptr(session, &priv);
gnutls_transport_set_push_function(session, push_func);
gnutls_transport_set_pull_function(session, pull_func);
gnutls_transport_set_pull_timeout_function(session,
pull_timeout_func);
do {
ret = gnutls_handshake(session);
}
while (ret == -28
|| ret == -52);
if (ret < 0) {
fprintf(
stderr
, "Error in handshake(): %s\n",
gnutls_strerror(ret));
gnutls_deinit(session);
continue;
}
for (;;) {
do {
ret =
gnutls_record_recv_seq(session, buffer,
sizeof(buffer)-1,
sequence);
if (ret ==
-293)
gnutls_heartbeat_pong(session, 0);
}
while (ret == -52
|| ret == -28
|| ret == -293);
if (ret == -37) {
fprintf(
stderr
,
"*** Received hello message\n");
do {
ret = gnutls_handshake(session);
}
while (ret == -52 ||
ret == -28);
if (ret == 0)
continue;
}
if (ret < 0) {
fprintf(
stderr
, "Error in recv(): %s\n",
gnutls_strerror(ret));
break;
}
if (ret == 0) {
printf("EOF\n\n");
break;
}
buffer[ret] = 0;
printf
("received[%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x]: %s\n",
sequence[0], sequence[1], sequence[2],
sequence[3], sequence[4], sequence[5],
sequence[6], sequence[7], buffer);
if (check_command(session, buffer, disable_client_cert) == 0) {
ret =
gnutls_record_send(session, buffer,
ret);
if (ret < 0) {
fprintf(
stderr
,
"Error in send(): %s\n",
gnutls_strerror(ret));
break;
}
}
}
gnutls_deinit(session);
}
}
|
void udp_server(undefined8 param_1,undefined4 param_2,int param_3)
{
int iVar1;
ssize_t sVar2;
undefined8 uVar3;
long in_FS_OFFSET;
socklen_t local_21c;
int local_218;
int local_214;
undefined8 local_210;
undefined local_204 [12];
undefined local_1f8 [16];
undefined8 local_1e8;
int local_1e0;
sockaddr *local_1d8;
socklen_t local_1d0;
undefined local_1c8 [8];
int local_1c0;
sockaddr *local_1b8;
socklen_t local_1b0;
sockaddr local_1a8 [8];
byte local_120;
byte local_11f;
byte local_11e;
byte local_11d;
byte local_11c;
byte local_11b;
byte local_11a;
byte local_119;
char local_118 [13];
char local_10b;
undefined8 local_10;
local_10 = *(undefined8 *)(in_FS_OFFSET + 0x28);
local_218 = gnutls_key_generate(local_1f8,0x10);
if (local_218 < 0) {
fprintf(stderr,"Cannot generate key\n");
exit(1);
}
local_218 = listen_socket(param_1,param_2,2);
if (local_218 < 0) {
fprintf(stderr,"Cannot listen\n");
exit(1);
}
do {
while( true ) {
do {
do {
printf("Waiting for connection...\n");
local_214 = wait_for_connection();
} while (local_214 < 0);
local_21c = 0x80;
sVar2 = recvfrom(local_214,local_118,0xfe,2,local_1a8,&local_21c);
local_218 = (int)sVar2;
} while (((local_218 < 0xe) || (local_118[0] != '\x16')) || (local_10b != '\x01'));
if (memset != (code)0x1) break;
LAB_001002cc:
uVar3 = human_addr(local_1a8,0x80,local_118,0xfe);
printf("Accepted connection from %s\n",uVar3);
local_210 = initialize_session(1);
if (memset != (code)0x1) {
gnutls_dtls_prestate_set(local_210,local_204);
}
if (param_3 != 0) {
gnutls_dtls_set_mtu(local_210,param_3);
}
local_1e8 = local_210;
local_1e0 = local_214;
local_1d8 = local_1a8;
local_1d0 = local_21c;
gnutls_transport_set_ptr(local_210,&local_1e8);
gnutls_transport_set_push_function(local_210,push_func);
gnutls_transport_set_pull_function(local_210,pull_func);
gnutls_transport_set_pull_timeout_function(local_210,pull_timeout_func);
do {
do {
local_218 = gnutls_handshake(local_210);
} while (local_218 == -0x1c);
} while (local_218 == -0x34);
if (local_218 < 0) {
uVar3 = gnutls_strerror(local_218);
fprintf(stderr,"Error in handshake(): %s\n",uVar3);
gnutls_deinit(local_210);
}
else {
LAB_00100456:
do {
local_218 = gnutls_record_recv_seq(local_210,local_118,0xfe,&local_120);
if (local_218 == -0x125) {
gnutls_heartbeat_pong();
}
} while (((local_218 == -0x34) || (local_218 == -0x1c)) || (local_218 == -0x125));
if (local_218 == -0x25) {
fprintf(stderr,"*** Received hello message\n");
do {
do {
local_218 = gnutls_handshake();
} while (local_218 == -0x34);
} while (local_218 == -0x1c);
if (local_218 == 0) goto LAB_00100456;
}
if (local_218 < 0) {
uVar3 = gnutls_strerror(local_218);
fprintf(stderr,"Error in recv(): %s\n",uVar3);
goto LAB_0010068d;
}
if (local_218 == 0) {
printf("EOF\n\n");
goto LAB_0010068d;
}
local_118[local_218] = '\0';
printf("received[%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x]: %s\n",(ulong)local_120,(ulong)local_11f,
(ulong)local_11e,(ulong)local_11d,(ulong)local_11c,(ulong)local_11b,(ulong)local_11a,
(ulong)local_119,local_118);
iVar1 = check_command(local_210,local_118,disable_client_cert);
if ((iVar1 != 0) ||
(local_218 = gnutls_record_send(local_210,local_118,(long)local_218), -1 < local_218))
goto LAB_00100456;
uVar3 = gnutls_strerror(local_218);
fprintf(stderr,"Error in send(): %s\n",uVar3);
LAB_0010068d:
gnutls_deinit(local_210);
}
}
memset(local_204,0,0xc);
local_218 = gnutls_dtls_cookie_verify
(local_1f8,local_1a8,local_21c,local_118,(long)local_218,local_204);
if (-1 < local_218) goto LAB_001002cc;
memset(local_1c8,0,0x20);
local_1c0 = local_214;
local_1b8 = local_1a8;
local_1b0 = local_21c;
uVar3 = human_addr(local_1a8,local_21c,local_118,0xfe);
printf("Sending hello verify request to %s\n",uVar3);
gnutls_dtls_cookie_send(local_1f8,local_1a8,local_21c,local_204,local_1c8,push_func);
recvfrom(local_214,local_118,0xfe,0,local_1a8,&local_21c);
} while( true );
}
|
static int wrap_db_delete(void *dbf, gnutls_datum_t key)
{
int i;
for (i = 0; i < cache_db_ptr; i++) {
if (key.size == cache_db[i].session_id_size &&
memcmp(key.data, cache_db[i].session_id,
key.size) == 0) {
cache_db[i].session_id_size = 0;
free(cache_db[i].session_data.data);
cache_db[i].session_data.data =
((void *)0)
;
cache_db[i].session_data.size = 0;
return 0;
}
}
return -30;
}
|
long long wrap_db_delete(unsigned long a0, void* a1, unsigned long a2) {
unsigned long v0;
unsigned long v1;
unsigned int v2;
unsigned long long v4;
v1 = a0;
v0 = a2;
v2 = 0;
while (true) {
if (v2 < cache_db_ptr) {
if (v0 == *(((((v2 << 3) + v2 << 1) + v2 << 3) + cache_db + 128)) && !memcmp(a1, (((v2 << 3) + v2 << 1) + v2 << 3) + cache_db, v0)) {
*((v2 * 152 + cache_db + 128)) = 0;
free(*((v2 * 152 + cache_db + 136)));
*((v2 * 152 + cache_db + 136)) = 0;
*((v2 * 152 + cache_db + 144)) = 0;
v4 = 0;
return v4;
}
v2 += 1;
} else {
v4 = 4294967266;
return v4;
}
}
}
|
void
strlist_sort (sl)
STRINGLIST *sl;
{
if (sl == 0 || sl->list_len == 0 || sl->list == 0)
return;
strvec_sort (sl->list, 0);
}
|
long long strlist_sort(struct_0 *a0) {
unsigned long long v1;
if (a0) {
v1 = a0->field_c;
if (a0->field_c) {
v1 = a0->field_0;
if (a0->field_0)
v1 = strvec_sort(a0->field_0, 0x0);
}
}
return v1;
}
|
static inline __u32 rta_getattr_u32(const struct rtattr *rta)
{
return *(__u32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
|
long rta_getattr_u32(long a1)
{
return *(unsigned int *)(a1 + 4);
}
|
void
rl_initialize_funmap (void)
{
register int i;
if (funmap_initialized)
return;
for (i = 0; default_funmap[i].name; i++)
rl_add_funmap_entry (default_funmap[i].name, default_funmap[i].function);
funmap_initialized = 1;
funmap_program_specific_entry_start = i;
}
|
char *rl_initialize_funmap()
{
char *result;
int i;
result = (char *)(unsigned int)funmap_initialized;
if ( !funmap_initialized )
{
for ( i = 0; ; ++i )
{
result = (&default_funmap)[2 * i];
if ( !result )
break;
rl_add_funmap_entry((long)(&default_funmap)[2 * i], (long)*(&off_BA8 + 2 * i));
}
funmap_initialized = 1;
funmap_program_specific_entry_start = i;
}
return result;
}
|
static ssize_t
client_push(gnutls_transport_ptr_t tr, const void *data, size_t len)
{
size_t newlen;
;
len = ((len)<(sizeof(to_server) - to_server_len)?(len):(sizeof(to_server) - to_server_len));
newlen = to_server_len + len;
memcpy(to_server + to_server_len, data, len);
to_server_len = newlen;
return len;
}
|
size_t client_push(undefined8 param_1,void *param_2,ulong param_3)
{
ulong __n;
long lVar1;
__n = 0x10000U - to_server_len;
if (param_3 <= 0x10000U - to_server_len) {
__n = param_3;
}
lVar1 = __n + to_server_len;
memcpy(to_server + to_server_len,param_2,__n);
to_server_len = lVar1;
return __n;
}
|
static void usage(void)
{
fprintf(
stderr
,
"Usage: ip ila add loc_match LOCATOR_MATCH loc LOCATOR [ dev DEV ] OPTIONS\n"
" ip ila del loc_match LOCATOR_MATCH [ loc LOCATOR ] [ dev DEV ]\n"
" ip ila list\n"
"OPTIONS := [ csum-mode { adj-transport | neutral-map |\n"
" neutral-map-auto | no-action } ]\n"
" [ ident-type { luid | use-format } ]\n");
exit(-1);
}
|
void usage() {
fprintf(stderr, "Usage: ip ila add loc_match LOCATOR_MATCH loc LOCATOR [ dev DEV ] OPTIONS\n ip ila del loc_match LOCATOR_MATCH [ loc LOCATOR ] [ dev DEV ]\n ip ila list\nOPTIONS := [ csum-mode { adj-transport | neutral-map |\n neutral-map-auto | no-action } ]\n [ ident-type { luid | use-format } ]\n");
exit(0xffffffff);
}
|
static void
do_convert_to(struct passwd *pw)
{
struct sshkey *k;
struct stat st;
int r;
if (!have_identity)
ask_filename(pw, "Enter file in which the key is");
if (stat(identity_file, &st) == -1)
sshfatal("ssh-keygen.c", __func__, 433, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: %s: %s", __progname, identity_file, strerror(
(*__errno_location ())
));
if ((r = sshkey_load_public(identity_file, &k,
((void *)0)
)) != 0)
k = load_identity(identity_file,
((void *)0)
);
switch (convert_format) {
case FMT_RFC4716:
do_convert_to_ssh2(pw, k);
break;
case FMT_PKCS8:
do_convert_to_pkcs8(k);
break;
case FMT_PEM:
do_convert_to_pem(k);
break;
default:
sshfatal("ssh-keygen.c", __func__, 447, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "unknown key format %d", convert_format);
}
exit(0);
}
|
void do_convert_to(void* a0) {
unsigned long v0;
unsigned long long v1;
unsigned long v2;
unsigned int v3;
unsigned long v4;
char v5;
unsigned long v6;
unsigned long v7;
char v8;
unsigned long long *v10;
v6 = v10[5];
if (!have_identity)
ask_filename(a0, "Enter file in which the key is");
if (stat(&identity_file, &v5) == -1) {
v2 = strerror(*(__errno_location()));
v1 = &identity_file;
v0 = __progname;
sshfatal("ssh-keygen.c", "do_convert_to", 0x1b1, 0x0, 0x1, 0x0, "%s: %s: %s");
}
v3 = sshkey_load_public(&identity_file, &v4, 0x0);
if (v3)
v4 = load_identity(&identity_file, NULL);
if (convert_format != 2) {
if (convert_format <= 2) {
if (!convert_format)
do_convert_to_ssh2(a0, v4, v4);
if (convert_format == 1)
do_convert_to_pkcs8(v4);
}
if (convert_format > 2 || convert_format != 1 && convert_format) {
v7 = convert_format;
v6 = "unknown key format %d";
sshfatal("ssh-keygen.c", "do_convert_to", 0x1bf, 0x1, 0x1, 0x0, *(&v8));
exit(0x0);
}
} else {
do_convert_to_pem(v4);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.