unix executable to jpg?

Joined
Oct 25, 2010
Messages
1
Reaction score
0
Points
1
hi everyone, i've been looking for info on this problem, but haven't found anything helpful yet, so i hope this is the right forum to post the question. i've received a CD with images which was made on a windows machine (jpg format). the Finder thinks they're unix executables (I have 10.6.4). i've tried to copy them to the desktop and renaming to .jpg extension and open with Preview, but that doesn't work. i've also tried renaming to .tif and .gif, but without success. does anyone know how to solve this problem?
 
Joined
Oct 26, 2009
Messages
128
Reaction score
8
Points
18
Create a folder, copy all the files from the CD to the folder. Open Terminal, change directory to the folder where you copied the files. Then run the following command:

chmod -R 777 *

You should be able to open the files once you change the permissions. If you still can't open the files you may need to change file ownership using the chown command. The copy you performed should create the files with you as owner.
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
chmod -R 777 * wouldn't change the executable bit - wouldn't you want
chmod -R 644 * or 666 if you want everyone to be able to write it.

Also go to Finder -> Finder Preferences -> Advanced -> Make sure show all filename extensions is enabled - so you know the actual extension.
 
Joined
Oct 26, 2009
Messages
128
Reaction score
8
Points
18
Actually, the executable bit is important. You don't want to remove it, especially for directories. 777 is read/write/execute for everyone. The OP's problem has nothing to do with the executable bit. I suggested 777 because that allows anyone to read, write or execute the file. The permission they probably want is 755 which is rwx for the owner and rx for group and everyone else.
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
Executable is important for scripts and directories but normal files shouldn't be set executable. It actually is a security risk to set files executable if they don't need to be. It was an old school way to get a Trojan onto unix systems. If it is 777. If you could trick root to copy a file that is executable and then run it - you could run whatever you want as root. This thread actually shows an easy way. Fake a jpg - and have someone with administrator access try to double click. You'll run the script instead of opening a jpg.

I think the issue is with a hidden filetype but the executable bit could be why the files are showing up wrong.

For others here is a short article on what we are talking about when we are talking about file permissions.
File Permissions Linux article
 
Joined
Jul 2, 2007
Messages
3,494
Reaction score
204
Points
63
Location
Going Galt...
Your Mac's Specs
MacBookAir5,2:10.13.6-iMac18,3:10.13.6-iPhone9,3:11.4.1
This thread actually shows an easy way. Fake a jpg - and have someone with administrator access try to double click. You'll run the script instead of opening a jpg.

I think the issue is with a hidden filetype but the executable bit could be why the files are showing up wrong.

100% true stuff here. And Ivan is correct - in no world do jpeg files need to be as executable to be viewed or copied. They need only read and/or write permission.
 
Joined
Oct 26, 2009
Messages
128
Reaction score
8
Points
18
It might help if you understand why I said to use 777 instead of 666. Let's say that CD has files and directories. I assumed the CD had both. If you choose to run chmod -R 666 * or chmod -R 644 * as suggested then the folders will not be accessible, even to the owner of the files. You will get Permission Denied if you try and open the folder from Finder or Terminal. I assumed the OP wanted to create a temporary folder for viewing the files so the simple approach is chmod 777 -R * on everything to allow them to view everything. I was not trying to burden the OP with the finer details of Unix permissions only give them a simple solution to their problem. The more secure method is below...

find <folder> -type d -exec chmod 755 {} \;
find <folder> -type f -exec chmod 644 {} \;
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top