Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: manit123 on July 16, 2012, 08:09:21 AM

Title: showexec option in vfat mount
Post by: manit123 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
Title: Re: showexec option in vfat mount
Post by: Juanito 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
Title: Re: showexec option in vfat mount
Post by: tinypoodle on July 16, 2012, 01:53:37 PM
Any particular reason speaking against using "noexec"?
Title: Re: showexec option in vfat mount
Post by: tinypoodle 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.
Title: Re: showexec option in vfat mount
Post by: manit123 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 '
Title: Re: showexec option in vfat mount
Post by: manit123 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 ?
Title: Re: showexec option in vfat mount
Post by: manit123 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 ?
Title: Re: showexec option in vfat mount
Post by: manit123 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>
Title: Re: showexec option in vfat mount
Post by: tinypoodle on August 26, 2012, 02:52:36 PM
util-linux wasn't needed as the output in OP shows ;)
Title: Re: showexec option in vfat mount
Post by: AbNoRMiS 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
Title: Re: showexec option in vfat mount
Post by: tinypoodle on August 26, 2012, 04:34:39 PM
Well if you mount with "noexec" then you can't execute... ;)
Title: Re: showexec option in vfat mount
Post by: manit123 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.
Title: Re: showexec option in vfat mount
Post by: Rich on September 11, 2012, 09:40:25 AM
Hi manit123
You might want to take a look at  /usr/bin/rebuildfstab
Title: Re: showexec option in vfat mount
Post by: manit123 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.
Title: Re: showexec option in vfat mount
Post by: Rich 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
Title: Re: showexec option in vfat mount
Post by: manit123 on September 16, 2012, 10:41:52 AM

yeah , there is rebuildfstab script file in /usr/sbin.
how wIll it know to use 'noexec' option ?
Title: Re: showexec option in vfat mount
Post by: Rich on September 16, 2012, 12:27:20 PM
Hi manit123
That script updates the entries in /etc/fstab. It is run when you first boot and anytime you plug/unplug a thumb
drive. You will need to go through it and find where it determines the file system type and modify it to include
the  noexec  option in the appropriate lines of  fstab.