The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Kris on Twitter: “On a scale of 1-8, how pessimistic is your code?”

Posted by jpluimers on 2024/10/17

Interesting series of tweets about what to harden your application for in a reply to [Wayback/Archive] Kris on Twitter: “On a scale of 1-8, how pessimistic is your code? “Write code to provision a Google Chrome Extension for an end users Mac.”” which I saved to [Wayback/Archive] Thread by @isotopp on Thread Reader App (actually the scale is 1-9):

Extensions are stored in a 32 letter directory in the user profile in the Extensions directory.

i.e.

/Users/kris/Library/Application Support/Google/Chrome/Default/Extensions/<32letters>

  1. The User has set up their Mac so that their home directory is not in /Users.
  2. The User has set up their Mac so that the home directory name is different from their login user name.
  3. The User has multiple user profiles in Chrome, so that the path is not $HOME/Library/Application Support/Google/Chrome/Default, but some other profile directory.
  4. The target profile is not “Default“.
  5. The target name is not a directory, but a symlink to some interesting system config file or directory instead.
  6. The target name already exists, and is a file, not a directory.
  7. The target name is a file, and has permissions set to 000 (chmod a-rwx).
  8. The file has an ACL that denies deletion to the user.
    $ chmod +a "$USER deny delete" <32chars>
  9. The file has been chflags‘ed to schg (immutable; irrevocable, unless the machine is rebooted to single user mode).

The above idea was for Chrome Extensions, so the below links are relevant, but it could be extended to any installer use case.

–jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.