Choose style:

Author Topic: Text file default set to execute as program...[SOLVED]  (Read 759 times)

0 Members and 1 Guest are viewing this topic.

Offline ogopogo

  • Jr. Member
  • **
  • Posts: 54
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9
Text file default set to execute as program...[SOLVED]
« on: March 10, 2019, 10:59:18 pm »
Hi All,   I'm having an issue where I open a text file and get the following window:


 


I then have to right click on the file/ properties / permissions / then uncheck the box "allow to executing file as program"


 


Why is this checked as a default setting and how do I permanently keep this from happening?  Any help is appreciated! 

« Last Edit: March 14, 2019, 02:12:31 am by zebedeeboss »

Offline scifidude79

  • Global Moderator
  • Hero
  • *****
  • Posts: 4029
  • Karma: 863
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: Text file default set to execute as program
« Reply #1 on: March 10, 2019, 11:51:48 pm »
Well, you own the file, so just uncheck the box. I'm sure there's some terminal command to do it, but that's easier. (I know how to make them executable, but not the opposite)

As far as why it's set that way by default, I have no idea. I've never had that happen and I've created a new text document as recently as Thursday. In what format did you save it?

Offline pin

  • Trusted User
  • Veteran
  • *****
  • Posts: 1823
  • Karma: 250
    • View Profile

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25455
  • Karma: 2798
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Text file default set to execute as program
« Reply #3 on: March 11, 2019, 07:29:04 am »
That's not a default ..  where is the text file ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline ogopogo

  • Jr. Member
  • **
  • Posts: 54
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: Text file default set to execute as program
« Reply #4 on: March 11, 2019, 11:38:34 am »
Well, you own the file, so just uncheck the box. I'm sure there's some terminal command to do it, but that's easier. (I know how to make them executable, but not the opposite)

As far as why it's set that way by default, I have no idea. I've never had that happen and I've created a new text document as recently as Thursday. In what format did you save it?

No problems with checking or unchecking the box, its having to do it with every text file I have that's the pain. I think it all started after I reinstalled Peppermint one time.
Once they are unchecked, they stay unchecked the next time I open them. These files were never originally created with this box checked but somehow all got checked at the same time.
All were saved as: Text(text/plain)

https://linux.die.net/man/1/chmod
Thank you for the link, but what it said was Chinese to me.... I would need that dumbed down a bit  ;) in order to understand or do anything with it.

That's not a default ..  where is the text file ?
These text files are everywhere....mostly in my personal documents folders though: /mnt/DATA/Desktop,Documents, Music etc.

Offline pin

  • Trusted User
  • Veteran
  • *****
  • Posts: 1823
  • Karma: 250
    • View Profile
Re: Text file default set to execute as program
« Reply #5 on: March 11, 2019, 12:14:28 pm »
Ok, If you would have all those files in the same directory, and according to the man page I've linked earlier, I guess you could change that for all the files inside that directory using
Code: [Select]
chmod -R u -x /path/to/directory/*

EDIT: Command corrected and...  tested on NetBSD. Sorry, but it's the machine that I have with me at the moment.
« Last Edit: March 11, 2019, 05:01:19 pm by pin »

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25455
  • Karma: 2798
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Text file default set to execute as program
« Reply #6 on: March 11, 2019, 05:21:03 pm »
That's not a default ..  where is the text file ?
These text files are everywhere....mostly in my personal documents folders though: /mnt/DATA/Desktop,Documents, Music etc.

That's probably the issue .. as these are on a drive/partition you're mounting via fstab, your fstab entry needs fixing, and or the permissions of the mountpoint need fixing.
(so new files aren't created with the execute bit set)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline spence

  • Trusted User
  • Veteran
  • *****
  • Posts: 1887
  • Karma: 187
  • peppermint user since 2010
    • View Profile
  • Peppermint version(s): Peppermint 9 Respin
Re: Text file default set to execute as program
« Reply #7 on: March 11, 2019, 08:56:40 pm »
This question reminds me of my own problems with file permissions from this post https://forum.peppermintos.com/index.php/topic,5936.0.html...  Now that Win10 is gone I'mma revisit
spence
PeppermintOS 10installed  on:
'16 Antec Aria rebuild
 '18 Asus VivoBook


Do not despair, grasshopper...
    with patience all will be revealed...
       Through pain, enlightenment will come.

Offline spence

  • Trusted User
  • Veteran
  • *****
  • Posts: 1887
  • Karma: 187
  • peppermint user since 2010
    • View Profile
  • Peppermint version(s): Peppermint 9 Respin
Re: Text file default set to execute as program
« Reply #8 on: March 11, 2019, 09:03:50 pm »
Well, you own the file, so just uncheck the box.

On my machine, the check mark reappears a few seconds after removing it. I'mma start a new thread... tomorrow...
« Last Edit: March 11, 2019, 09:17:28 pm by spence »
spence
PeppermintOS 10installed  on:
'16 Antec Aria rebuild
 '18 Asus VivoBook


Do not despair, grasshopper...
    with patience all will be revealed...
       Through pain, enlightenment will come.

Offline ogopogo

  • Jr. Member
  • **
  • Posts: 54
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: Text file default set to execute as program
« Reply #9 on: March 11, 2019, 11:13:07 pm »
Ok, If you would have all those files in the same directory, and according to the man page I've linked earlier, I guess you could change that for all the files inside that directory using
Code: [Select]
chmod -R u -x /path/to/directory/*

EDIT: Command corrected and...  tested on NetBSD. Sorry, but it's the machine that I have with me at the moment.

This is the output for that command:
Code: [Select]
gerry@gerry-X542BA ~ $ sudo chmod -R u -x /home/gerry/Documents/*
chmod: cannot access 'u': No such file or directory

This question reminds me of my own problems with file permissions from this post https://forum.peppermintos.com/index.php/topic,5936.0.html...  Now that Win10 is gone I'mma revisit
Read through this post which does seem very similar. Doesn't seem there was a solution though that could be applied here other than just grin and bear it until I eventually find them all and manually uncheck the boxes.  :-\

That's not a default ..  where is the text file ?
These text files are everywhere....mostly in my personal documents folders though: /mnt/DATA/Desktop,Documents, Music etc.

That's probably the issue .. as these are on a drive/partition you're mounting via fstab, your fstab entry needs fixing, and or the permissions of the mountpoint need fixing.
(so new files aren't created with the execute bit set)

Here is the output of my fstab.... anything I can change here to make my DATA partition (that contains the text files in question) to not make them executable?

Code: [Select]
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdb3 during installation
UUID=d747ec97-d505-4a37-9211-f11d35851d5f /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sdb1 during installation
UUID=84C4-377A  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sdb2 during installation
UUID=2c6a20db-1cb8-4168-ae39-0d3e4b6e0270 /home           ext4    defaults        0       2
/swapfile                                 none            swap    sw              0       0
/dev/disk/by-id/usb-WD_My_Passport_0820_575846314541343836504641-0:0-part1 /mnt/usb-WD_My_Passport_0820_575846314541343836504641-0:0-part1 auto nosuid,nodev,nofail,x-gvfs-show 0 0
# User defined DATA partition. Created by "ogopogo".  Mount point is at /mnt/DATA ...
UUID=0bf84ff1-6444-4549-8d0c-8e23295d477b /mnt/DATA ext4 defaults 0 2
 

"permissions of the mountpoint need fixing."   Do you mean here? This is a screenshot of the permissions for one of the mountpoints where the text files are located


 

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25455
  • Karma: 2798
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Text file default set to execute as program
« Reply #10 on: March 12, 2019, 04:54:07 pm »
What's the output from:
Code: [Select]
ls -al /mnt
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline ogopogo

  • Jr. Member
  • **
  • Posts: 54
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: Text file default set to execute as program
« Reply #11 on: March 12, 2019, 08:09:37 pm »
Code: [Select]
erry@gerry-X542BA ~ $ ls -al /mnt
total 16
drwxr-xr-x  4 root  root  4096 Jul 11  2018 .
drwxr-xr-x 24 root  root  4096 Mar  5 10:58 ..
drwxr-xr-x 11 gerry gerry 4096 Jan  2 17:03 DATA
drwxr-xr-x  2 root  root  4096 Jul 10  2018 usb-WD_My_Passport_0820_575846314541343836504641-0:0-part1

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25455
  • Karma: 2798
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Text file default set to execute as program
« Reply #12 on: March 12, 2019, 08:49:41 pm »
is DATA on an internal drive ?

if so, you could change directory to /mnt/DATA
Code: [Select]
cd /mnt/DATA
then recursively change the permission of all FILES to 644:
Code: [Select]
find . -type f -exec chmod 0644 {} \;
and all DIRECTORIES to 755:
Code: [Select]
find . -type d -exec chmod 0755 {} \;
BE AWARE, if DATA is on an external drive the above commands could take some considerable time (depending on the amount of files/folders).

and remember, the above commands wil only work on files/folders you own.

ALSO bear in mind that going to mark ALL files as non-executable .. even scripts and binaries (not just text files).
« Last Edit: March 12, 2019, 08:52:59 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline rayzer

  • Jr. Member
  • **
  • Posts: 43
  • Karma: 7
  • New Forum User
    • View Profile
  • Peppermint version(s): 10
Re: Text file default set to execute as program
« Reply #13 on: March 13, 2019, 12:55:16 pm »
right click the file go to properties and in the 'open with' tab just pick a text editor like leafpad geany or whatever. then set it as default

Offline spence

  • Trusted User
  • Veteran
  • *****
  • Posts: 1887
  • Karma: 187
  • peppermint user since 2010
    • View Profile
  • Peppermint version(s): Peppermint 9 Respin
Re: Text file default set to execute as program
« Reply #14 on: March 13, 2019, 01:45:02 pm »
right click the file go to properties and in the 'open with' tab just pick a text editor like leafpad geany or whatever. then set it as default


Set As Default is greyed out on my desktop @rayzer, likely on the OP's system too. Plus he and I have thousands of files to reset.
spence
PeppermintOS 10installed  on:
'16 Antec Aria rebuild
 '18 Asus VivoBook


Do not despair, grasshopper...
    with patience all will be revealed...
       Through pain, enlightenment will come.