Results 1 to 7 of 7
  1. #1
    unix executable to jpg?

    Member Since
    Oct 25, 2010
    Posts
    1
    unix executable to jpg?
    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?

  2. #2
    unix executable to jpg?

    Member Since
    Oct 26, 2009
    Posts
    128
    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.

  3. #3
    unix executable to jpg?
    IvanLasston's Avatar
    Member Since
    Feb 26, 2010
    Location
    Rocky Mountain High, Colorado
    Posts
    2,116
    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.

  4. #4
    unix executable to jpg?

    Member Since
    Oct 26, 2009
    Posts
    128
    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.

  5. #5
    unix executable to jpg?
    IvanLasston's Avatar
    Member Since
    Feb 26, 2010
    Location
    Rocky Mountain High, Colorado
    Posts
    2,116
    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

  6. #6
    unix executable to jpg?
    XJ-linux's Avatar
    Member Since
    Jul 02, 2007
    Location
    Going Galt...
    Posts
    3,418
    Specs:
    MacBookAir5,2:10.9.5-MacMini3,1:10.9.5-iPhone6,1:8.3
    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.
    Never judge a man, untill you have walked a mile in his shoes...
    That way you'll be a mile away from him, and you'll have his shoes.

  7. #7
    unix executable to jpg?

    Member Since
    Oct 26, 2009
    Posts
    128
    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 {} \;

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Unix executable file
    By BobanandaG5 in forum OS X - Operating System
    Replies: 1
    Last Post: 11-12-2013, 04:31 PM
  2. unix executable file
    By joe4735 in forum OS X - Operating System
    Replies: 9
    Last Post: 03-01-2013, 02:18 PM
  3. Unix Executable on Dock
    By rafikkipotter in forum OS X - Operating System
    Replies: 3
    Last Post: 08-27-2008, 12:02 PM
  4. unix executable file?
    By 88190211 in forum OS X - Operating System
    Replies: 1
    Last Post: 04-01-2008, 09:41 PM
  5. Unix Executable File problem
    By fender1100 in forum OS X - Apps and Games
    Replies: 9
    Last Post: 01-07-2007, 06:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •