New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

unix executable to jpg?


Post Reply New Thread Subscribe

 
Thread Tools
kimw

 
Member Since: Oct 25, 2010
Posts: 1
kimw is on a distinguished road

kimw is offline
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?
QUOTE Thanks
ukchucktown

 
Member Since: Oct 26, 2009
Posts: 128
ukchucktown has a spectacular aura about

ukchucktown is offline
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.
QUOTE Thanks
IvanLasston

 
IvanLasston's Avatar
 
Member Since: Feb 26, 2010
Location: Rocky Mountain High, Colorado
Posts: 2,116
IvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to behold
Mac Specs: 1.8 GHz i7 MBA 11" OSX 10.8.2

IvanLasston is offline
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.
QUOTE Thanks
ukchucktown

 
Member Since: Oct 26, 2009
Posts: 128
ukchucktown has a spectacular aura about

ukchucktown is offline
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.
QUOTE Thanks
IvanLasston

 
IvanLasston's Avatar
 
Member Since: Feb 26, 2010
Location: Rocky Mountain High, Colorado
Posts: 2,116
IvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to behold
Mac Specs: 1.8 GHz i7 MBA 11" OSX 10.8.2

IvanLasston is offline
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
QUOTE Thanks
XJ-linux

 
XJ-linux's Avatar
 
Member Since: Jul 02, 2007
Location: Going Galt...
Posts: 3,358
XJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond repute
Mac Specs: MacBookAir5,2:10.9.5-MacMini3,1:10.9.5-iPhone6,1:8.1

XJ-linux is offline
Quote:
Originally Posted by IvanLasston View Post
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.

"Those who don't understand Unix are condemned to reinvent it, poorly." Henry Spencer
QUOTE Thanks
ukchucktown

 
Member Since: Oct 26, 2009
Posts: 128
ukchucktown has a spectacular aura about

ukchucktown is offline
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 {} \;
QUOTE Thanks

Post Reply New Thread Subscribe


« Stuck at Gray Screen with Apple Logo and swirling circle. Help! | VPN & Windows server - connects OK, no data »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Unix Executable files being saved as text Rotgut OS X - Operating System 5 03-11-2010 09:09 PM
how to copy unix executable file by java program that preserve their properties Ashish Pancholi OS X - Development and Darwin 0 10-15-2009 01:27 AM
External HDD folder now Unix Executable enchanted_angel Other Hardware and Peripherals 3 06-24-2009 01:53 AM
Unix Executable File problem fender1100 OS X - Apps and Games 9 01-07-2007 07:20 AM
Unix executable on Mac OSx blackwaterdev Switcher Hangout 1 10-27-2004 09:52 PM

All times are GMT -4. The time now is 10:27 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?