ping? On Tue, Sep 23, 2014 at 7:09 PM, enh <e...@google.com> wrote: > commit d2bed27b663096f8771df824a85f3815a0c7d7da > Author: Elliott Hughes <e...@google.com> > Date: Tue Sep 23 18:49:19 2014 -0700 > > Don't risk truncating open flags by using mode_t. > > On Android, 32-bit arm and x86 use __kernel_mode_t (an unsigned short) > as their mode_t. The open(2) flags are actually an int, so high ones > like O_CLOEXEC get truncated if you coerce them to mode_t. > > Signed-off-by: Elliott Hughes <e...@google.com> > > diff --git a/defs.h b/defs.h > index cd9817b..5bfeb6b 100644 > --- a/defs.h > +++ b/defs.h > @@ -708,8 +708,8 @@ extern void print_sigset_addr_len(struct tcb *, long, > long); > extern void printsignal(int); > extern void tprint_iov(struct tcb *, unsigned long, unsigned long, > int decode_iov); > extern void tprint_iov_upto(struct tcb *, unsigned long, unsigned > long, int decode_iov, unsigned long); > -extern void tprint_open_modes(mode_t); > -extern const char *sprint_open_modes(mode_t); > +extern void tprint_open_modes(int); > +extern const char *sprint_open_modes(int); > extern void print_loff_t(struct tcb *, long); > > extern const struct_ioctlent *ioctl_lookup(unsigned long); > diff --git a/file.c b/file.c > index c2bf6d3..0ec1d4b 100644 > --- a/file.c > +++ b/file.c > @@ -237,7 +237,7 @@ print_dirfd(struct tcb *tcp, int fd) > * other bits are real flags. > */ > const char * > -sprint_open_modes(mode_t flags) > +sprint_open_modes(int flags) > { > static char outstr[(1 + ARRAY_SIZE(open_mode_flags)) * > sizeof("O_LARGEFILE")]; > char *p; > @@ -274,7 +274,7 @@ sprint_open_modes(mode_t flags) > } > > void > -tprint_open_modes(mode_t flags) > +tprint_open_modes(int flags) > { > tprints(sprint_open_modes(flags) + sizeof("flags")); > }
-- Elliott Hughes - http://who/enh - http://jessies.org/~enh/ Java i18n/JNI/NIO, or bionic questions? Mail me/drop by/add me as a reviewer. ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ Strace-devel mailing list Strace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/strace-devel