tcmd/9pfuse: ignore FMODE_EXEC open flag - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 93f9789c048d9bfd75192adce3ed9a3ff8a68fbc
 (DIR) parent ac6456a0cc67ca33c7b9c64cf7a4598961de8911
 (HTM) Author: Nicola Girardi <nicola@aloc.in>
       Date:   Mon, 22 Jul 2019 18:39:56 +0000
       
       cmd/9pfuse: ignore FMODE_EXEC open flag
       
       Improved error message in case of unexpected open flags. The message
       
           unexpected open flags requested=0100040 unhandled=040
       
       prompted me to clear the FMODE_EXEC flag, although I wonder if I
       shouldn't have set OEXEC (0x3) instead.
       
       Diffstat:
         M src/cmd/9pfuse/main.c               |      13 +++++++++++--
       
       1 file changed, 11 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/9pfuse/main.c b/src/cmd/9pfuse/main.c
       t@@ -51,6 +51,14 @@
        #  endif
        #endif
        
       +#ifndef FMODE_EXEC
       +#  if defined(__linux__)
       +#    define FMODE_EXEC 040
       +#  else
       +#    define FMODE_EXEC 0
       +#  endif
       +#endif
       +
        int debug;
        char *argv0;
        char *aname = "";
       t@@ -583,7 +591,7 @@ _fuseopen(FuseMsg *m, int isdir)
                flags = in->flags;
                openmode = flags&3;
                flags &= ~3;
       -        flags &= ~(O_DIRECTORY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC);
       +        flags &= ~(O_DIRECTORY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC|FMODE_EXEC);
        #ifdef O_NOFOLLOW
                flags &= ~O_NOFOLLOW;
        #endif
       t@@ -602,13 +610,14 @@ _fuseopen(FuseMsg *m, int isdir)
                        openmode |= OTRUNC;
                        flags &= ~O_TRUNC;
                }
       +
                /*
                 * Could translate but not standard 9P:
                 *        O_DIRECT -> ODIRECT
                 *        O_NONBLOCK -> ONONBLOCK
                 */
                if(flags){
       -                fprint(2, "unexpected open flags %#uo\n", (uint)in->flags);
       +                fprint(2, "unexpected open flags requested=%#uo unhandled=%#uo\n", (uint)in->flags, (uint)flags);
                        replyfuseerrno(m, EACCES);
                        return;
                }