Mac os remove carantine flag

Ошибка macOS Catalina: Приложение повреждено и его не удается открыть

Самым безопасным местом для загрузки программ на Mac остаётся фирменный магазин App Store и я настоятельно рекомендую устанавливать софт именно оттуда. Но что делать, если хочется немного «попиратствовать», а в macOS Catalina ещё сильнее затянули гайки с установкой приложений из непроверенных источников (наши любимые торренты относятся именно к таким).

Сегодня расскажу как можно довольно просто побороть вот такую ошибку при открытии приложений: «Приложение повреждено и его не удается открыть. Переместите приложение в Корзину.»

Для начала вернём в системные настройки выбор пункта, разрешающий использование приложений, загруженных из «Любого источника» (по умолчанию он теперь скрыт). А находится эта настройка тут «Системные настройки — > Защита и безопасность -> Основные», если кто не знал.

Чтобы появился пункт из «Любого источника» выполним в Терминале следующую команду (команда выполняется единожды):

sudo spctl —master-disable

Обычно этого хватает чтобы разблокировать работу неподписанных приложений, но не всегда.

Cнятие карантина для указанного приложения в macOS

Если чуда не произошло и приложение по-прежнему отказывается запускаться выдавая ошибку, попробуем удалить его из карантина macOS пишем в Терминале следующую команду:

sudo xattr -rd com.apple.quarantine

В конце ставим пробел и перетащив иконку нужной программы в окно Терминала нажимаем Enter. Теперь программа должна запуститься без проблем. По традиции предлагаю почитать про безопасное открытие программ и технологию Gatekeeper на Mac на сайте Apple https://support.apple.com/ru-ru/HT202491 (правда про обход системы безопасности там не будет написано).

Если считаете статью полезной,
не ленитесь ставить лайки и делиться с друзьями.

Комментариев: 6

Спасибо вам большое

спасибо огромное! кучу времени потратил на поиск этого решения.

Спасибо, добрый человек! помогло!

ты просто чудо. спасибо. Единственный рабочий способ

Источник

Question: Q: How to remove com.apple.quarantine from the files in a tar archive

How can I remove com.apple.quarantine from the files inside a tar archive?

I am developing WordPress websites using MAMP on my Mac running 10.6.8. I use a utility called Bloggzapper to build a tar.gz archive of my site and then upload it and use the same Bloggzapper to automatically install it on a remote server. Now I am suddenly getting corrupted displays from the server after the files have been extracted and the corruption is displaying lots of instances of com.apple.quarantine meta data at the top of my web pages. Somehow extended attribute meta data is being added to my various WordPress php files as they are compressed. How can I stop this? How can I remove such data from inside the tar archive without opening it? Any suggestions?

Posted on Jun 27, 2011 12:10 PM

Helpful answers

The link I posted shows how to create an alias to «tar -c —exclude» but you could do the same for whatever Bloggzapper uses as its call to build the tarball. If it calls tar directly, using the full path, this likely won’t work.

Unless you are extracting on a Mac OS X system, I would imagine the extended attributes are on the source files already.

Perhaps the php files have the quarantine attribute set before you are uploading. You can view the extended attributes in Terminal with:

Читайте также:  Формат жесткого диска для установки windows

You can delete the attributes with:

Or from a whole directory with:

Note that the version of tar on OS X does not suppor the —delete option, so I don’t see a way to delete anything from the archive.

You’ll either have to remove the attributes before compressing or after uncompressing.

Jun 28, 2011 4:59 AM

There’s more to the conversation

Loading page content

Page content loaded

Apple stores metadata in resource forks of the files. Many file systems don’t understand them, so the metadata gets stripped out into ._ files. They are just text descriptions of the metadata, so I would imagine they’d show up as such.

Jun 27, 2011 5:13 PM

I undertsand what this metadata problem is but I don’t think your advice helps me. The problem is this: I use the utility Bloggzaaper to clone WordPress sites developed in a MAMP setup on my Mac. Bloggzapper builds a tar archive of my local site and then I upload it to the remote server where it is decompressed and installed by Blogzapper at the other end. It is central to my work flow. Blogzapper builds a very specific tar archive and if you mess with it then Bloggzapper cannot work its magic on the remote server and install my wordpress site, it cannot deal with a tar archive that has been tampered with.

Suddenly after I installed 10.6.8 on my Mac I started to get corrupt installed caused by the com.apple.quarantine attribute being added to all my files inside the tar archive created by Bloggzapper — I assume it is caused by some aspect of a security upgrade in the 10.6.8 update.

So cannot open the archive on my mac as it breaks the bloggzapper work flow. What I need is either:

a) a way to stop this date being writen during the process of Bloggzapper creating the tar archive on my mac

b) a way to strip the extended attributes metadata from the files inside the tar archive (without decompressing it.

As it is this problem completely breaks my work flow

Jun 28, 2011 4:22 AM

The link I posted shows how to create an alias to «tar -c —exclude» but you could do the same for whatever Bloggzapper uses as its call to build the tarball. If it calls tar directly, using the full path, this likely won’t work.

Unless you are extracting on a Mac OS X system, I would imagine the extended attributes are on the source files already.

Perhaps the php files have the quarantine attribute set before you are uploading. You can view the extended attributes in Terminal with:

You can delete the attributes with:

Or from a whole directory with:

Note that the version of tar on OS X does not suppor the —delete option, so I don’t see a way to delete anything from the archive.

You’ll either have to remove the attributes before compressing or after uncompressing.

Jun 28, 2011 4:59 AM

Thanks for the info

A couple of questions about the xattr command. I have no experience of using the Terminal.

Do I need to put in a path to the file, I have multiple files with the same name (in different WordPress install). I tried the first of the commands you suggested with just a file name and it didn’t work.

Is there any sort of xattr utility with a GUI for seeing and deleting the attributes?

Читайте также:  Linux файрвол открыть порт

Jun 28, 2011 5:34 AM

For the xattr command, to simply print/list the extended attributes, just enter the command then, important , leave a space. Then drag the file whose extended attributes you want to see into the Terminal window and hit Return.

To use the delete command, you must use the file name as it was printed/listed above. Again, leave a space after the command. Copy/paste the file name after the space.

Jun 28, 2011 5:58 AM

Thanks — I will try this.

I found another solution (I think — still testing) which is based on using a USB drive formatted to MS-DOS FAT (which is actually FAT32) which does not support extended attributes metadata. I created a symbolic link to a folder on this drive (using a utility called SymbolicLinker) and placed the symbolic link in my htdocs folder in my MAMP folder (which is where MAMP expects site folders to be). Then I put the WordPress install files in the folder on the usb drive and then ran an install using MAMP via a url that pointed at the symbolic link. This all worked perfectly and WordPress installed into the folder on the USB drive. My Bloggzapper php utility also works in this folder via the symbolic link. So all the wordpress files and the tar archive are all created and live on the FAT32 USB drive so none can contain the metadata. I uploaded them to the remote server and the site seems to work with no metadata corruption. This seems a good method because all it means is one extra step (create the symbolic link) at the start of the wordpress web site development process and from then on I can forget that the files are actually on the USB stick.

Источник

Обходим систему безопасности macOS

Самым безопасным местом для загрузки программ на Mac остаётся фирменный магазин App Store и я настоятельно рекомендую устанавливать софт именно оттуда. Но что делать, если хочется немного «попиратствовать», а в macOS Catalina ещё сильнее затянули гайки с установкой приложений из непроверенных источников (наши любимые торренты относятся именно к таким).

Сегодня расскажу как можно довольно просто побороть вот такую ошибку при открытии приложений: «Приложение повреждено и его не удается открыть. Переместите приложение в Корзину.»

Для начала вернём в системные настройки выбор пункта, разрешающий использование приложений, загруженных из «Любого источника» (по умолчанию он теперь скрыт). А находится эта настройка тут «Системные настройки — > Защита и безопасность -> Основные», если кто не знал.

Чтобы появился пункт из «Любого источника» выполним в Терминале следующую команду (команда выполняется единожды):

Обычно этого хватает чтобы разблокировать работу неподписанных приложений, но не всегда.

Cнятие карантина для указанного приложения в macOS

Если чуда не произошло и приложение по-прежнему отказывается запускаться выдавая ошибку, попробуем удалить его из карантина macOS пишем в Терминале следующую команду:

В конце ставим пробел и перетащив иконку нужной программы в окно Терминала нажимаем Enter. Теперь программа должна запуститься без проблем. По традиции предлагаю почитать про безопасное открытие программ и технологию Gatekeeper на Mac на сайте Apple https://support.apple.com/ru-ru/HT202491 (правда про обход системы безопасности там не будет написано).

Подписывайтесь на канал Яндекс.Дзен и узнавайте первыми о новых материалах, опубликованных на сайте.

ЕСЛИ СЧИТАЕТЕ СТАТЬЮ ПОЛЕЗНОЙ,
НЕ ЛЕНИТЕСЬ СТАВИТЬ ЛАЙКИ И ДЕЛИТЬСЯ С ДРУЗЬЯМИ.

Источник

Question: Q: Removing Quarantine as non-admin

I use all my machines as a non-admin (Mac and Windoze), and occasionally, I run into a problem that I can’t work out. This is one.

Читайте также:  Dreamscene windows 64 bit

As everyone knows, newly downloaded/installed programs are flagged as «quarantined». When one of them is run for the first time, a dialog pops up saying:

«Program X» is an application which was downloaded from the Internet. Are you sure you want to open it?

I understand why Apple puts things into quarantine, and I know there is a workaround out there by Henrik Nyh ( http://henrik.nyh.se/2007/10/lift-the-l … quarantine) but his solution doesn’t really allow me to discriminate and «release» things as I want to.

As it is, if every time I update an app, I don’t also log in as an admin and «OK» the quarantine removal, I get the «are you sure you want to run it» question *every time* most apps are launched. In an attempt to remove the quarantine via context menu, I tried to make a finder plugin workflow, but it’s not working.

I pass the result of a «Get selected items» to the following AppleScript:

on run
do shell script «xattr -d com.apple.quarantine» & input with administrator privileges
return input
end run

Everything appears to run. I’m asked for credentials, and I get no errors. If I run it from in Automator, the results show the application I have selected. There is a warning in the log:

The Action «Get Selected Items» was not supplied with the required data.

, but that (whatever it is) doesn’t seem to me to be related.

I had created a short shell script action first, but couldn’t figure out how to be prompted for the admin credentials I also couldn’t get the shell script to work dropped into the Applescript.

do shell script «for f in» & input & «;do;xattr -d com.apple.quarantine \»$f\»;done» with administrator privileges

I’m testing the code with only a single item selected, but I’d love to be able to pass multiple items too.

If I run the «xattr. » line in a terminal window when logged in as admin (via fast user switching), my non-admin account is no longer prompted with the «are you sure» message. Thus, the concept works, so why don’t these scripts work?

Any suggestions would be greatly appreciated.

Источник

Der Flounder

Clearing the quarantine extended attribute from downloaded applications

When I’m packaging an application for deployment, I normally download the latest version from the vendor. If it’s a drag-and-drop install, where the application is a self-contained bundle, it will get the com.apple.quarantine extended attribute associated with it.

The quarantine attribute is added by the OS so that it can ask for user confirmation the first time the downloaded program is run. Gatekeeper in Lion and Mountain Lion also uses the com.apple.quarantine attribute to determine if an application should be checked (and blocked if needed.)

To avoid issues with both unwanted messages and Gatekeeper, I normally clear this attribute as part of my packaging. Here’s how to check to see if your application has the com.apple.quarantine attribute associated with it:

1. Open Terminal

2. Run the following command:

If the com.apple.quarantine attribute is associated with the application, you should see the following output:

computername:Applications username$ xattr /path/to/MyApp.app
com.apple.quarantine
computername:Applications username$

Note: Other attributes may also be listed, with com.apple.FinderInfo being a common one.

To remove the quarantine attribute, you would then run the following command:

Источник

Оцените статью