Commit Graph

298 Commits

Author SHA1 Message Date
Gerald Combs 17bb0b7eb1 macOS: Switch ChmodBPF back from bash to sh.
The default shell in macOS 10.15 is zsh[1]. Bash appears to be included
for now, but it might be a good idea to start migrating away from it
just in case it's removed at some point in the future.

[1]https://support.apple.com/en-ca/HT208050

Change-Id: Ibe4338105d8fa1a590f84543489255ade71920d6
Reviewed-on: https://code.wireshark.org/review/35216
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-11-26 22:43:56 +00:00
Gerald Combs 56ed5d49f4 macOS: Use the correct path when building our app bundle.
Use the correct path to the Wireshark executable when finding
dependencies and adding debugging symbols.

Change-Id: Iefafa9d453ce60e77853f2d125769826b4d702c0
Reviewed-on: https://code.wireshark.org/review/35202
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-11-25 02:10:02 +00:00
Gerald Combs 7cc5f4c45f CMake: Work correctly without Sparkle.
Set or clear SPARKLE_LIBRARIES and SPARKLE_INCLUDE_DIRS in
FindSparkle.cmake, similar to what we do in other modules. Use them
instead of SPARKLE_LIBRARY and SPARKLE_INCLUDE_DIR.

Change-Id: I023c711edd6a44421aadf85413da3207d9b08e64
Reviewed-on: https://code.wireshark.org/review/35097
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-11-15 22:34:06 +00:00
Gerald Combs 1cc5b68ac9 macOS: Application bundle fixes.
Copy Sparkle.framework correctly. Force signing so that we replace
Sparkle's signature with ours.

In osx-app.sh, don't sign a file or framework if it's already signed.

Fix the osx-dmg.sh usage message while we're here.

Change-Id: I697073d234958e1d8386650935a132237ad88f64
Reviewed-on: https://code.wireshark.org/review/35095
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-11-15 20:14:36 +00:00
Gerald Combs 02057200fd macOS: Add support for automatic updates using Sparkle.
Add support for automatic updates using the Sparkle framework. Add
FindSparkle.cmake and associated CMake plumbing. Add a public key and
other info to Info.plist.in. Add ui/macosx/sparkle_bridge.{h,m}, which
wraps the Sparkle API. Make code that's specific to WinSparkle
Windows-only.

Add Sparkle installation steps to the macos-setup scripts. Sparkle
prints a warning if your bundle is unsigned (which is the case during
development) so disable installing it by default.

Updating here takes a long time. We might be able to fix that by
shipping our DSYMs separately.

Change-Id: I6cc6671db5657dadc514bda6bf6e1c8bbc9468a5
Reviewed-on: https://code.wireshark.org/review/35090
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-11-15 18:39:04 +00:00
Guy Harris a13d168916 Fix name of the "remove Wireshark from PATH" package.
Bug: 16200
Change-Id: I0e9ab373eb3f7f533fe1ae9bf0448b66b4cdf522
Reviewed-on: https://code.wireshark.org/review/35056
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-11-12 03:37:47 +00:00
Gerald Combs 5acf14d5c0 macOS: Remove an exit code check.
Change-Id: I2b9d576bf6d5c49dcfa716abb00f80ea067328db
Reviewed-on: https://code.wireshark.org/review/34953
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-11-04 13:48:07 +00:00
Gerald Combs 89890097bd macOS: Properly sign our extra packages.
Use productsign to sign product archives.

Change-Id: I40fd329e6f2b0abc49f1b4b0247eae380de8101b
Reviewed-on: https://code.wireshark.org/review/34951
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-11-04 13:33:53 +00:00
Gerald Combs 2dca23f836 macOS: Remove no-longer-relevant documentation.
Change-Id: I628395a761291a105fdc1ef79ce05db0b00a4ab3
Reviewed-on: https://code.wireshark.org/review/34630
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-09-26 23:22:19 +00:00
Gerald Combs af793b19d0 macOS: Sign our .dmg.
Add osx-dmg.sh back and make it a simple wrapper around dmgbuild and
codesign.

Change-Id: I0baa21fd971aa1b06e1a6700881cd7625dffff35
Reviewed-on: https://code.wireshark.org/review/34629
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-09-26 17:52:43 +00:00
Gerald Combs 75dc0933c6 macOS: Sign our extra packages.
Change-Id: If2e28e4708f1d71fa4e7b549a2ba021557711d4e
Reviewed-on: https://code.wireshark.org/review/34627
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-09-25 23:20:01 +00:00
Gerald Combs 60c9297069 macOS: Increase our .dmg compression level.
Change-Id: I273eb5174ef92146aa48eda8a2e37a13828d73f4
Reviewed-on: https://code.wireshark.org/review/34626
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-09-25 22:08:01 +00:00
Gerald Combs b789895c1b macOS: Use dmgbuild to build our .dmg.
Scripting the Finder in order to lay out our disk image assumes that we
have access to the Finder. This might not be the case on our builder,
and it arguably shoudn't be.

Switch from using a Bash script + AppleScript to build and lay out our
.dmg to using dmgbuild, which creates our .DS_Store directly using
Python's ds_store module.

Change-Id: I2e4a9dd89bc8297c9cbd9df7aa8d3a44447bde85
Reviewed-on: https://code.wireshark.org/review/34623
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-09-25 21:31:22 +00:00
Gerald Combs b1416fda0a macOS: Disable arrange_dmg.applescript.
arrange_dmg.applescript is failing on the macOS builder, so comment it
out for now.

Change-Id: Ibe7bf249623832954e9f67d241513b549dff990c
Reviewed-on: https://code.wireshark.org/review/34621
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-09-25 16:57:20 +00:00
Gerald Combs ac4f3c0f4d macOS: Make Wireshark.app drag-installable.
Create ChmodBPF installer and uninstaller packages using pkgbuild and
productbuild. Place them in Wireshark.app/Resources/Extras.

Add a path_helper installer and uninstaller which respectively add and
remove /etc/*paths.d/Wireshark.

Remove the PackageMaker and utility-launcher assets and build targets.

Show a message in the main welcome screen if we don't have capture
permissions. Add an link which launches the ChmodBPF installer.

Add a "macOS Extras" item to About → Folders.

Migrate "Read me first" from RTF to Asciidoctor, which lets us add links
and looks like our other documentation.

Rename dmg_set_style.scpt to arrange_dmg.applescript and make it plain
text. Always run it in osx-dmg.sh.

Bug: 6991
Bug: 12593
Bug: 11399
Ping-Bug: 16074
Change-Id: I7b6aa89aae2be522b4141b0d44e8142dec749e90
Reviewed-on: https://code.wireshark.org/review/31047
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-09-25 16:26:31 +00:00
Gerald Combs cfb2d7eb80 macOS: Don't clobber Wireshark.app during installation.
Removing Wireshark.app during preflight is the wrong way to ensure that
we uninstall old assets.

Bug: 16050
Change-Id: I39a0129e29830f8b6bc7ef228f3886db51d963ec
Reviewed-on: https://code.wireshark.org/review/34542
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-09-18 16:49:54 +00:00
Gerald Combs b28ae2dc74 macOS: Fix our token wait. Again.
altool isn't guaranteed to clean up after itself, e.g. if an earthquake
takes down the Developer ID Notary Service (thanks to Jim Young for
tracking this down). Instead of checking for the existence of tokens,
check their existence and age.

Change-Id: Iac216d524a4894115ecf33589af1bbdebcc9cbab
Reviewed-on: https://code.wireshark.org/review/33856
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-07-05 16:12:52 +00:00
Gerald Combs 8094ad896b macOS: Fix our token wait.
Change-Id: I3a678267b38a598f43322a1440dd87fa42acf901
Reviewed-on: https://code.wireshark.org/review/33750
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-06-26 23:30:17 +00:00
Gerald Combs d9e230d79a macOS: Add a notarization upload wait check.
altool appears to only support one notarization upload at a time. Add a
loop that waits for an empty upload token directory.

Convert the status check to a timeout loop.

Change-Id: I30fd15b6f098acfe5d9bdcd72237c56cc066dda4
Reviewed-on: https://code.wireshark.org/review/33749
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-06-26 23:15:04 +00:00
Gerald Combs e5230a5d10 macOS: Make sure we bundle our plugin dependencies.
Add our plugins to the bundle binary list.

Copy libraries using `install` in order to ensure that we can doctor
them up.

Bug: 15867
Change-Id: I864455f6ef7312938e89493015fd55874ab0a0c3
Reviewed-on: https://code.wireshark.org/review/33744
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-06-26 16:13:57 +00:00
Gerald Combs 867a13d9e6 Fix a couple of shellcheck issues.
Change-Id: Iaebbe5227ffcc581e794a3be1f8b9020fd600f68
Reviewed-on: https://code.wireshark.org/review/33739
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-06-25 15:13:51 +00:00
Gerald Combs 332eeb1f88 macOS: Notarization count fix.
Change-Id: If2be00ebf08655d967273ae3a84f4345ea10f06a
Reviewed-on: https://code.wireshark.org/review/33435
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-05-31 20:58:02 +00:00
Gerald Combs 23ec0666c5 macOS: Notarization updates.
Increase our timeout from 10 minutes to 20. Fixup our ID formatting.

Change-Id: I143c08880de4f285bd0bc6dbf6619d565ef97b3a
Reviewed-on: https://code.wireshark.org/review/33434
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-05-31 17:29:54 +00:00
Gerald Combs 64a56cf7a6 macOS: Add a workaround for libbrotli.
When gathering our dependencies, work around an issue with libbrotli's
install name similar to what we do with libssh.

Bug: 15730
Change-Id: I571746848e3343d81c286be66f6fe6510c698d6f
Reviewed-on: https://code.wireshark.org/review/32990
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-04-26 00:30:45 +00:00
Gerald Combs c9ca78fc2b macOS: Add a notarization script.
According to

https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution

notarization will be required in a future release of macOS. Add a script
for doing so. The process requires submitting our .dmg to Apple, waiting
for it to finish, and stapling a ticket to our .dmg.

Change-Id: I5b9c0c36cc2182fdd0baeada823aaacba7730a88
Reviewed-on: https://code.wireshark.org/review/32906
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-21 07:32:29 +00:00
Gerald Combs 6fc00612b4 macOS: Update a comment in osx-app.sh.in.
The answer to the question "do we need to add hardened runtime
entitlements or exceptions?" in osx-app.sh is "yes". Update a comment
accordingly.

Change-Id: Icc6f9ed31838aa6342f405a244e726586e9c0c4d
Reviewed-on: https://code.wireshark.org/review/32703
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-04-03 20:31:43 +00:00
Jason Cohen 00e2434a6f osx app bundle: add entitlement to allow loading 3rd party plugns
This adds the entitlement to everything we sign.  I cannot test a more
granular approach without access to an Apple issued codesigning cert/key
pair.

Bug: 15667
Change-Id: I9fe962a06b681d33853b0944765987e21d21be2d
Reviewed-on: https://code.wireshark.org/review/32700
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-04-03 20:24:12 +00:00
Gerald Combs 029f24e4cf macOS: Restore dark mode support.
Comment out the NSRequiresAquaSystemAppearance key in Info.plist under
the assumption that both we and Qt will have dark mode support in usable
shape by the next release.

Ping-Bug: 15511
Change-Id: Ic5960034ce302d81dcc624cbd0e2c017865f44e2
Reviewed-on: https://code.wireshark.org/review/32504
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-03-22 05:18:09 +00:00
Gerald Combs 1b10ac9bd4 macOS: Replace Wireshark.app when upgrading.
The packages that PackageMaker creates don't remove old files when
upgrading. Add a preflight script that removes Wireshark.app if it
exists.

Fix a version check while we're here.

Change-Id: I8be8cbf51b34fef8a2d4259478b7d3199d976de3
Reviewed-on: https://code.wireshark.org/review/32150
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-22 19:36:20 +00:00
Gerald Combs 2172fe93e1 macOS: Fixup our libssh workaround.
On the previous builder, `otool -L /path/to/libssh.4.dylib` returned a
bare "libssh.4.dylib", which required a workaround. On the new builder
it returns "@rpath/libssh.4.dylib". Adjust the workaround accordinly.

Remove a couple of chmods while we're here. Permission issues are better
addressed elsewhere.

Change-Id: If0692219d9558c77b45620e7aad309853012b7e8
Reviewed-on: https://code.wireshark.org/review/32059
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-17 16:46:35 +00:00
Gerald Combs ef0ef16c30 macOS: Try to work around .dmg packaging issues.
The new macOS builder sometimes fails due to busy disk images. Try to
work around the issue by adding a sleep (in case the culprit is
Spotlight) and by forcibly detaching disk images.

Change-Id: I65bd46420e7ae69d03b7c9a15a2bb0385a1cedff
Reviewed-on: https://code.wireshark.org/review/32035
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-14 20:33:01 +00:00
Gerald Combs 81338f1664 macOS: Packaging and code signing updates.
Sign our bundle as described in Apple's Code Signing Guide. Enable the
Hardened Runtime when signing.

Look for packagemaker in our PATH before checking specific locations.

Switch from zlib to bzip2 compression for our .dmg. Sign our .dmg.

To do: Notarization.

Change-Id: Ia6556e67998ff247dd3d77d6f040773e070f66cc
Reviewed-on: https://code.wireshark.org/review/32032
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-14 19:03:17 +00:00
Gerald Combs aedf6fe1c5 macOS: Fix our plugin path.
In CMake we only used PROJECT_RELEASE_VERSION to construct our plugin
path, so rename it to PLUGIN_PATH_ID. Use a dash to separate version
numbers on macOS in order to allow code signing and a period elsewhere.

In the C code we only used VERSION_RELEASE to construct our plugin path,
so rename it to PLUGIN_PATH_ID.

Change-Id: I02abc591d7857269e8d47b414b61df4b28a25f2d
Reviewed-on: https://code.wireshark.org/review/32013
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-13 23:55:10 +00:00
Guy Harris aa1f314464 Fix directory containing compiled plugins in macOS.
They weren't getting put in the version-number subdirectory, so the
plugin loader wasn't finding them.

If that causes problems with codesign, then we need to either

	1) figure out how to make it work with codesign

or

	2) for macOS, not put plugins in a version-number subdirectory
	   ***AND*** change the plugin loading process not to look for
	   compiled in a version-number subdirectory.

Change-Id: I58d344b728d05369d35edef4e4e530f10034e930
Reviewed-on: https://code.wireshark.org/review/32000
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-13 03:05:11 +00:00
Gerald Combs 80e33fffce MacOS: Fix a path.
Change-Id: Ie964e6294e5351627c6fbc4a6c7f855558bee55c
Reviewed-on: https://code.wireshark.org/review/31998
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-12 21:48:26 +00:00
Gerald Combs 6fef7cdc84 MacOS: Bundle and packaging updates
Update the code signing portions of the packaging scripts to match newer
versions of macOS.

Change-Id: I5e03611d8db61416955e797edcadfcff1404cc38
Reviewed-on: https://code.wireshark.org/review/31996
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-12 21:04:19 +00:00
Guy Harris 16c1f48074 Add captype and reordercap to the list of command-line binaries.
Change-Id: I7e9460960b83d673727aca1783c03952622aabb5
Reviewed-on: https://code.wireshark.org/review/31500
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-11 22:31:54 +00:00
Stig Bjørlykke a05ba5be69 Happy New Year 2019!
Change-Id: Ic140aafdb32e649e88bf3f00bda3cec9404e555a
Reviewed-on: https://code.wireshark.org/review/31284
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2019-01-01 11:58:07 +00:00
Gerald Combs a1ef5f6899 macOS: Make sure we package our own libraries.
As of 25e1e2c848 we no longer set LIBRARY_OUTPUT_DIRECTORY to
Wireshark.app/Contents/Frameworks. As a result we need to copy them into
place during our packaging process.

Change-Id: Idbdea289dce60e9acf9ab317f4151bfe2c993ddd
Reviewed-on: https://code.wireshark.org/review/31160
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-21 17:33:14 +00:00
Gerald Combs cea1686495 macOS: Minimize our dsyms.
Pass --minimize to dsymutil, which reduces the size of our dsyms. Print
the name of each file as we dsymify it.

Change-Id: Ic8b14daa2ceaa07c2c9ca3162020e5861d165f6d
Ping-bug: 15361
Reviewed-on: https://code.wireshark.org/review/31150
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-21 05:28:07 +00:00
Gerald Combs 5009f98c3a macOS: Fix a .dmg build path.
Fix the "Read me first" path.

Change-Id: I6d1a13a26db2023a30b7ae72caca86500d00f5b7
Reviewed-on: https://code.wireshark.org/review/31064
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-16 19:55:26 +00:00
Gerald Combs e13d8be962 CMake: Make sure we use the same minimum macOS version everywhere.
Add a MIN_MACOS_VERSION variable. Update it and sanity check it
according to CMAKE_OSX_DEPLOYMENT_TARGET and our Qt version. Use it to
set our minimum macOS version in various places.

Change-Id: Icaf0dbe463f34d182986868021e2b56d2239da38
Reviewed-on: https://code.wireshark.org/review/31048
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-15 07:38:08 +00:00
Roland Knall 81c4f74a19 macos: Prevent darkmode from appearing
Prevent dark mode from being used on newer versions of mac os x, as long as
Qt does not allow proper dark mode handling

Change-Id: Ifee14ec690331689b0a8a7486829dd129a2687b4
Reviewed-on: https://code.wireshark.org/review/30425
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-10-30 14:30:29 +00:00
Guy Harris 4332681300 No need for the debugging output.
The chmods seem to be working.

Change-Id: I0f85a1428de511497597a3fd304c700ea1a1f846
Reviewed-on: https://code.wireshark.org/review/30331
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-22 09:10:02 +00:00
Guy Harris 714c5dc2ab Fix quoting.
Change-Id: I3a0a8c661b1fec2ea4475eb9fe1d5c8a8ed7bbb5
Reviewed-on: https://code.wireshark.org/review/30328
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-22 07:36:01 +00:00
Guy Harris a2514faf1d Make the chmod verbose.
For some reason it's *not* taking away write permission; make it verbose
to try to debug that.

Change-Id: I180309953d36798d2da3a74959cdd934adc5a4a3
Reviewed-on: https://code.wireshark.org/review/30325
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-22 06:31:53 +00:00
Guy Harris e4e6beadb1 Don't unload the XQuartzFixer job if it doesn't exist.
But *do* get rid of the pre-launchd XQuartzFixer startup item; it's
probably not there, but we might as well leave things as clean as we
can.

Change-Id: Icfdbe6c0d022cde8cf30bd3c79fbf77896e6fe98
Reviewed-on: https://code.wireshark.org/review/30322
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-22 06:29:36 +00:00
Guy Harris af55deabbc More permission fixes.
Take away group write permission for stuff under
/Library/Application Support/Wireshark.  For some reason, it's getting
set; it's not necessary.

Change-Id: I4280a635e0c171cf5ad17cb91fe20d746c2daf79
Reviewed-on: https://code.wireshark.org/review/30317
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-21 21:36:42 +00:00
Guy Harris 2d1ade6446 Get rid of a launchd daemon we no longer need.
Change-Id: Ic287d6d8a84876da10ca600ef3899b40c8f5663e
Reviewed-on: https://code.wireshark.org/review/30310
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-21 18:52:37 +00:00
Guy Harris b51aafd77c Fix ownership and permissions on /Library/Application Support/Wireshark.
Bug: 14335
Change-Id: I657b024554e1eff01544b7726a7eec74c8da8be1
Reviewed-on: https://code.wireshark.org/review/30307
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-21 18:35:57 +00:00