2021-October-01, Developer Journal

I finally tracked down and fixed the Mac support issue in uDTU version 1.1.  It turned out my first reaction to the problem was 100% correct: "probably a filesystem permissions issue".  However, I must have been looking at the XCode developer folder instead of the installed Unity folder.  After wasting several hours chasing down other potential problems, I took another look at the filesystem permissions, and this time correctly saw that they were all "------rw-", aka "004".  I quickly traced this back to the code which was setting file permissions to "QFile::ReadOther | QFile::WriteOther".  Based on the Qt 4.8 API Documentation, I can understand why the original programmers accidentally chose these permission settings: 

QFile::ReadOther  -- The file is readable by anyone.
QFile::WriteOther -- The file is writable by anyone.

Most Unix/Mac filesystem users are probably shaking their heads at this egregious misinterpretation by the Qt Documentation right now.  Instead of "readable by anyone", the documentation should have said "readable by anyone other than the user/owner or group".   So the combination of the above two flags effectively locks out the user but allows everyone else Other than the user to read and write the affected file.  I fixed it by changing the permissions to "QFile::ReadOwner | QFile::WriteOwner | QFile::ReadUser | QFile::ReadGroup | QFile::ReadOther".  Which is equivalent to the command line: "chmod 644".

I probably should have made this change effective for all operating systems, but I hardcoded it for __APPLE__, since the Windows version has been working effectively with the original permissions.  I fully blame the makers of Qt for misleading documentation.  For a company that prides itself in creating a mult-platform API, Trolltech really dropped the ball on this one.


Latest mac-support changes here.  I plan on merging these into version 1.2 of the main unofficial branch.

By becoming a patron, you'll instantly unlock access to 28 exclusive posts
54
Images
4
Livestreams
17
Writings
2
Videos
By becoming a patron, you'll instantly unlock access to 28 exclusive posts
54
Images
4
Livestreams
17
Writings
2
Videos