WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: showexec option in vfat mount  (Read 8865 times)

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
showexec option in vfat mount
« on: July 16, 2012, 08:09:21 AM »
whenever i insert a usb stick . all files have +x so txt file does not get opened in pcmanfm it says "do you want to execute in terminal"
Please see http://www.kernel.org/doc/Documentation/filesystems/vfat.txt
mount --help says
Code: [Select]
BusyBox v1.20.1 (2012-05-31 03:26:11 UTC) multi-call binary.

Usage: mount [OPTIONS] [-o OPTS] DEVICE NODE

Mount a filesystem. Filesystem autodetection requires /proc.

        -a              Mount all filesystems in fstab
        -f              Dry run
        -i              Don't run mount helper
        -r              Read-only mount
        -w              Read-write mount (default)
        -t FSTYPE[,...] Filesystem type(s)
        -O OPT          Mount only filesystems with option OPT (-a only)
-o OPT:
        loop            Ignored (loop devices are autodetected)
        [a]sync         Writes are [a]synchronous
        [no]atime       Disable/enable updates to inode access times
        [no]diratime    Disable/enable atime updates to directories
        [no]relatime    Disable/enable atime updates relative to modification time
        [no]dev         (Dis)allow use of special device files
        [no]exec        (Dis)allow use of executable files
        [no]suid        (Dis)allow set-user-id-root programs
        [r]shared       Convert [recursively] to a shared subtree
        [r]slave        Convert [recursively] to a slave subtree
        [r]private      Convert [recursively] to a private subtree
        [un]bindable    Make mount point [un]able to be bind mounted
        [r]bind         Bind a file or directory [recursively] to another location
        move            Relocate an existing mount point
        remount         Remount a mounted filesystem, changing flags
        ro/rw           Same as -r/-w

There are filesystem-specific -o flags.


Does that mean there is no way to mount vfat with showexec option ?
That would mean no files get handled by appropriate application.
http://cgit.freedesktop.org/udisks/commit/?id=7e7ec1abca069e9443f8eed49acec4ea32589d0c

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Re: showexec option in vfat mount
« Reply #1 on: July 16, 2012, 09:44:07 AM »
You could try the full fat mount command in the util-linux extension.

..or use a linux filesystem on your usb stick

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: showexec option in vfat mount
« Reply #2 on: July 16, 2012, 01:53:37 PM »
Any particular reason speaking against using "noexec"?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: showexec option in vfat mount
« Reply #3 on: July 16, 2012, 01:56:59 PM »
ROX-filer would have a particular related option in settings, i.e. to ignore the executable byte for known extensions on a Windows-type filesystem.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: showexec option in vfat mount
« Reply #4 on: July 22, 2012, 10:33:07 AM »
I installed util-linux.tcz
Now when I insert a fat16 or fat32 pendrive.
What command should I give ?

ALso as tinypoodle said 'withot installing anything can I use noexec option for fat16/fat32 '

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: showexec option in vfat mount
« Reply #5 on: August 26, 2012, 12:50:41 AM »

I have installed util-linux .
Now , how will a USB stick get mounted with noexec option .
Do I have to mount it manually  after inserting ?

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: showexec option in vfat mount
« Reply #6 on: August 26, 2012, 02:19:28 AM »
I did mount fat file system explicitly with '-o noexec' and it worked well.
There isn't any 'noexec' for ntfs partition .
What can I do there ?

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: showexec option in vfat mount
« Reply #7 on: August 26, 2012, 02:33:14 AM »
This worked for ntfs
ntfs-3g -o noexec <device> <mount-point>
For FAT it was
mount -o noexec <device> <mount-point>
« Last Edit: August 26, 2012, 02:36:17 AM by manit123 »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: showexec option in vfat mount
« Reply #8 on: August 26, 2012, 02:52:36 PM »
util-linux wasn't needed as the output in OP shows ;)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline AbNoRMiS

  • Hero Member
  • *****
  • Posts: 550
  • nothing can be impeccable in this imperfect world
    • @ß№®M!$
Re: showexec option in vfat mount
« Reply #9 on: August 26, 2012, 02:57:28 PM »
Any particular reason speaking against using "noexec"?
for example i don't understood how i can run executables on vfat
Basic Design Concept © @ß№®M!$
please forgive my terrible english :)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: showexec option in vfat mount
« Reply #10 on: August 26, 2012, 04:34:39 PM »
Well if you mount with "noexec" then you can't execute... ;)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: showexec option in vfat mount
« Reply #11 on: September 11, 2012, 07:51:35 AM »
Is there a script which gets run on mounting USB ?
I was thinking of editing it to include option 'noexec' in it so that clicking mounts USB with desired option.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: showexec option in vfat mount
« Reply #12 on: September 11, 2012, 09:40:25 AM »
Hi manit123
You might want to take a look at  /usr/bin/rebuildfstab

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: showexec option in vfat mount
« Reply #13 on: September 16, 2012, 08:44:12 AM »
tc@box:/mnt/sdc1/tce/optional$ cd /usr/bin/
tc@box:/usr/bin$ ls
[                   cmp                 fold                killall             patch               sethostname         tce-setup           vi
[[                  comm                free                killall5            pgrep               setkeycodes         tce-size            vlock
ab                  crontab             fromISOfile         last                pkill               setsid              tce-status          waitforX
ab2tce.sh           cut                 ftpget              ldd                 printf              setupdesktop        tce-update          wc
ar                  dc                  ftpput              length              provides.sh         sha1sum             tcemirror.sh        wget
arping              deallocvt           fuser               less                python              showbootcodes       tee                 which
aterm               desktop.sh          getRGB              loadfont            readlink            showrgb             telnet              who
autoscan-devices    diff                getTime.sh          locale              realpath            sort                test                whoami
awk                 dirname             get_device          logger              renice              split               text2lp0            xargs
backup              dnsdomainname       getdisklabel        logname             reset               start-stop-daemon   tftp                xauth
basename            dos2unix            getopt              logread             resize              startx              time                xkill
bbcheck.sh          du                  head                mcookie             rev                 strings             timeout             xlsfonts
bcrypt              dumpleases          hexdump             md5sum              rotdash             sudo                top                 xmodmap
bigHomeFiles.sh     eject               history             mesg                rpm2cpio            sudoedit            tr                  xset
bunzip2             env                 hostid              microcom            scm                 sum                 traceroute          xsetup
bzcat               ether-wake          hsetroot            mkfifo              scm-fetch.sh        systool             tty                 xsetup.sh
bzip2               exitcheck.sh        id                  mountables.sh       scm-load            tail                uniq                xterm
cal                 exittc              imlib2_conv         nc                  scm-search.sh       tc-terminal-server  unix2dos            xz
calc                expr                imlib2_grab         nohup               scm-update          tce-audit           unxz                xzcat
chrt                fdformat            install             nslookup            script              tce-fetch.sh        unzip               yes
chvt                fgconsole           ipcrm               od                  search.sh           tce-load            uptime              zsync
cksum               filetool.sh         ipcs                ondemand            seekWinPartition    tce-remove          uuid
clear               find                jpegtran            openvt              select              tce-run             uuidgen
cliorx              flock               keyword.sh          passwd              seq                 tce-setdrive        version

I did not find any such file.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: showexec option in vfat mount
« Reply #14 on: September 16, 2012, 09:06:48 AM »
Hi manit123
Of course you won't find it if I give you the wrong information, that should have been  /usr/sbin/rebuildfstab